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
Parte 1/Lista 01/013.py
Raiane-nepomuceno/Python
0
163057
n1=int(input('Digite a idade da primeira pessoa:')) n2=int(input('Digite a idade da segunda pessoa:')) n3=int(input('Digite a idade da terceira pessoa:')) #Maior ou igual a 100 #menor que 100 soma = n1+ n2+ n3 if soma > 100 or soma == 100: print('Maior ou igual a 100') else: print('Menor que 100')
[ 1, 302, 29896, 29922, 524, 29898, 2080, 877, 14991, 568, 263, 1178, 1943, 1146, 20997, 23109, 29874, 29901, 8785, 13, 29876, 29906, 29922, 524, 29898, 2080, 877, 14991, 568, 263, 1178, 1943, 1146, 17329, 23109, 29874, 29901, 8785, 13, 29876, 29941, 29922, 524, 29898, 2080, 877, 14991, 568, 263, 1178, 1943, 1146, 1935, 346, 3055, 23109, 29874, 29901, 8785, 13, 29937, 21870, 1611, 2123, 21432, 263, 29871, 29896, 29900, 29900, 13, 29937, 1527, 272, 712, 29871, 29896, 29900, 29900, 13, 29879, 4125, 353, 302, 29896, 29974, 302, 29906, 29974, 302, 29941, 13, 361, 1047, 29874, 1405, 29871, 29896, 29900, 29900, 470, 1047, 29874, 1275, 29871, 29896, 29900, 29900, 29901, 13, 1678, 1596, 877, 21870, 1611, 2123, 21432, 263, 29871, 29896, 29900, 29900, 1495, 13, 2870, 29901, 13, 1678, 1596, 877, 28154, 272, 712, 29871, 29896, 29900, 29900, 1495, 13, 2 ]
override.py
Sp-X/PCAP
0
109804
class Mouse: def __init__(self, name): self.name = name def __str__(self): return "My name is " + self.name class AncientMouse(Mouse): def __str__(self): return "Meum nomen est " + self.name mus = AncientMouse("Caesar") # Prints "Meum nomen est Caesar" print(mus)
[ 1, 29871, 30143, 1990, 25992, 29901, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1024, 1125, 30004, 13, 4706, 1583, 29889, 978, 353, 1024, 30004, 13, 30004, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 30004, 13, 4706, 736, 376, 3421, 1024, 338, 376, 718, 1583, 29889, 978, 30004, 13, 30004, 13, 1990, 530, 15566, 14346, 29898, 14346, 1125, 30004, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 30004, 13, 4706, 736, 376, 6816, 398, 2245, 264, 707, 376, 718, 1583, 29889, 978, 30004, 13, 30004, 13, 8366, 353, 530, 15566, 14346, 703, 26270, 26892, 1159, 29871, 396, 1588, 9466, 376, 6816, 398, 2245, 264, 707, 9243, 26892, 19451, 13, 2158, 29898, 8366, 8443, 13, 30004, 13, 2 ]
methods/final_solution/graph_metrics.py
PaulRaid/H-index-prediction
0
72639
<reponame>PaulRaid/H-index-prediction<gh_stars>0 import networkx as nx import pandas as pd import argparse import progress_bar as pb pb.init(1, _prefix="Refactoring metrics \t \t") parser = argparse.ArgumentParser( description="GCN") parser.add_argument("edge_index") parser.add_argument("author_abstract_count") parser.add_argument("output") args = parser.parse_args() edge_index_file_name = args.edge_index author_abstract_count_name = args.author_abstract_count output_file_name = args.output df_edge_index = pd.read_csv(edge_index_file_name, sep=";") df_author_abstract_count = pd.read_csv(author_abstract_count_name, sep=";", index_col=0) df_graph_metrics = pd.DataFrame() ### Calcul des features du graph G = nx.from_pandas_edgelist(df_edge_index, source= 'author_2', target= 'author_1') degree = nx.degree(G) core_number = nx.core_number(G) degree_centr = nx.degree_centrality(G) nbr_avg_deg = nx.average_neighbor_degree(G) pagerank = nx.pagerank(G, alpha=0.9) olayer = nx.onion_layers(G) df_graph_metrics.insert(0, "degree", degree) df_graph_metrics.insert(1, "core_number", core_number) df_graph_metrics.insert(2, "degree_centr", degree_centr) df_graph_metrics.insert(3, "nbr_avg_deg", nbr_avg_deg) df_graph_metrics.insert(4, "pagerank", pagerank) df_graph_metrics.insert(5, "olayer", olayer) pb.set_length(df_graph_metrics.shape[0]) def compute_row_feature(row): pb.progress(row.name) row.degree = G.degree[row.name] row.core_number = core_number[row.name] row.degree_centr = degree_centr[row.name] row.nbr_avg_deg = nbr_avg_deg[row.name] row.pagerank = pagerank[row.name] row.olayer = olayer[row.name] return row df_graph_metrics = df_graph_metrics.apply(lambda x: compute_row_feature(x), axis=1) df_graph_metrics.index.name="author" df_graph_metrics.insert(0, "author_abstract_count", df_author_abstract_count["count"]) pb.progress(df_graph_metrics.shape[0]) print(df_graph_metrics) df_graph_metrics.to_csv(output_file_name, sep=";",index=True)
[ 1, 529, 276, 1112, 420, 29958, 18275, 29934, 29874, 333, 29914, 29950, 29899, 2248, 29899, 11965, 2463, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 3564, 29916, 408, 302, 29916, 13, 5215, 11701, 408, 10518, 13, 5215, 1852, 5510, 13, 5215, 6728, 29918, 1646, 408, 282, 29890, 13, 13, 24381, 29889, 2344, 29898, 29896, 29892, 903, 13506, 543, 5620, 7168, 292, 21556, 320, 29873, 320, 29873, 1159, 13, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 29898, 13, 1678, 6139, 543, 8766, 29940, 1159, 13, 16680, 29889, 1202, 29918, 23516, 703, 12864, 29918, 2248, 1159, 13, 16680, 29889, 1202, 29918, 23516, 703, 8921, 29918, 16595, 29918, 2798, 1159, 13, 16680, 29889, 1202, 29918, 23516, 703, 4905, 1159, 13, 13, 5085, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 12864, 29918, 2248, 29918, 1445, 29918, 978, 353, 6389, 29889, 12864, 29918, 2248, 13, 8921, 29918, 16595, 29918, 2798, 29918, 978, 353, 6389, 29889, 8921, 29918, 16595, 29918, 2798, 13, 4905, 29918, 1445, 29918, 978, 353, 6389, 29889, 4905, 13, 13, 2176, 29918, 12864, 29918, 2248, 353, 10518, 29889, 949, 29918, 7638, 29898, 12864, 29918, 2248, 29918, 1445, 29918, 978, 29892, 16345, 543, 29936, 1159, 13, 2176, 29918, 8921, 29918, 16595, 29918, 2798, 353, 10518, 29889, 949, 29918, 7638, 29898, 8921, 29918, 16595, 29918, 2798, 29918, 978, 29892, 16345, 543, 29936, 613, 2380, 29918, 1054, 29922, 29900, 29897, 13, 2176, 29918, 4262, 29918, 2527, 10817, 353, 10518, 29889, 17271, 580, 13, 13, 2277, 29937, 20535, 553, 5680, 868, 3983, 13, 13, 29954, 353, 302, 29916, 29889, 3166, 29918, 15112, 29918, 287, 7467, 391, 29898, 2176, 29918, 12864, 29918, 2248, 29892, 2752, 29922, 525, 8921, 29918, 29906, 742, 3646, 29922, 525, 8921, 29918, 29896, 1495, 13, 13, 12163, 929, 353, 302, 29916, 29889, 12163, 929, 29898, 29954, 29897, 13, 3221, 29918, 4537, 353, 302, 29916, 29889, 3221, 29918, 4537, 29898, 29954, 29897, 13, 12163, 929, 29918, 1760, 29878, 353, 302, 29916, 29889, 12163, 929, 29918, 25171, 537, 29898, 29954, 29897, 13, 29876, 1182, 29918, 485, 29887, 29918, 12163, 353, 302, 29916, 29889, 12483, 482, 29918, 484, 1141, 4089, 29918, 12163, 929, 29898, 29954, 29897, 13, 29886, 1875, 804, 353, 302, 29916, 29889, 29886, 1875, 804, 29898, 29954, 29892, 15595, 29922, 29900, 29889, 29929, 29897, 13, 324, 2747, 353, 302, 29916, 29889, 265, 291, 29918, 29277, 29898, 29954, 29897, 13, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 7851, 29898, 29900, 29892, 376, 12163, 929, 613, 7426, 29897, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 7851, 29898, 29896, 29892, 376, 3221, 29918, 4537, 613, 7136, 29918, 4537, 29897, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 7851, 29898, 29906, 29892, 376, 12163, 929, 29918, 1760, 29878, 613, 7426, 29918, 1760, 29878, 29897, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 7851, 29898, 29941, 29892, 376, 29876, 1182, 29918, 485, 29887, 29918, 12163, 613, 302, 1182, 29918, 485, 29887, 29918, 12163, 29897, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 7851, 29898, 29946, 29892, 376, 29886, 1875, 804, 613, 282, 1875, 804, 29897, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 7851, 29898, 29945, 29892, 376, 324, 2747, 613, 288, 13148, 29897, 13, 13, 24381, 29889, 842, 29918, 2848, 29898, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 12181, 29961, 29900, 2314, 13, 13, 1753, 10272, 29918, 798, 29918, 14394, 29898, 798, 1125, 13, 1678, 282, 29890, 29889, 18035, 29898, 798, 29889, 978, 29897, 13, 1678, 1948, 29889, 12163, 929, 353, 402, 29889, 12163, 929, 29961, 798, 29889, 978, 29962, 13, 1678, 1948, 29889, 3221, 29918, 4537, 353, 7136, 29918, 4537, 29961, 798, 29889, 978, 29962, 13, 1678, 1948, 29889, 12163, 929, 29918, 1760, 29878, 353, 7426, 29918, 1760, 29878, 29961, 798, 29889, 978, 29962, 13, 1678, 1948, 29889, 29876, 1182, 29918, 485, 29887, 29918, 12163, 353, 302, 1182, 29918, 485, 29887, 29918, 12163, 29961, 798, 29889, 978, 29962, 13, 1678, 1948, 29889, 29886, 1875, 804, 353, 282, 1875, 804, 29961, 798, 29889, 978, 29962, 13, 1678, 1948, 29889, 324, 2747, 353, 288, 13148, 29961, 798, 29889, 978, 29962, 13, 1678, 736, 1948, 13, 13, 2176, 29918, 4262, 29918, 2527, 10817, 353, 4489, 29918, 4262, 29918, 2527, 10817, 29889, 7302, 29898, 2892, 921, 29901, 10272, 29918, 798, 29918, 14394, 29898, 29916, 511, 9685, 29922, 29896, 29897, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 2248, 29889, 978, 543, 8921, 29908, 13, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 7851, 29898, 29900, 29892, 376, 8921, 29918, 16595, 29918, 2798, 613, 4489, 29918, 8921, 29918, 16595, 29918, 2798, 3366, 2798, 20068, 13, 13, 24381, 29889, 18035, 29898, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 12181, 29961, 29900, 2314, 13, 2158, 29898, 2176, 29918, 4262, 29918, 2527, 10817, 29897, 13, 13, 2176, 29918, 4262, 29918, 2527, 10817, 29889, 517, 29918, 7638, 29898, 4905, 29918, 1445, 29918, 978, 29892, 16345, 543, 29936, 613, 2248, 29922, 5574, 29897, 2 ]
config_template.py
oholsen/scales
0
193108
<reponame>oholsen/scales<filename>config_template.py wifi_ssid = "" wifi_password = "" mqtt_username = "" mqtt_password = "" mqtt_address = "" mqtt_port = 8883
[ 1, 529, 276, 1112, 420, 29958, 1148, 3775, 264, 29914, 19529, 267, 29966, 9507, 29958, 2917, 29918, 6886, 29889, 2272, 13, 29893, 6832, 29918, 893, 333, 353, 5124, 13, 29893, 6832, 29918, 5630, 353, 5124, 13, 13, 28466, 698, 29918, 6786, 353, 5124, 13, 28466, 698, 29918, 5630, 353, 5124, 13, 28466, 698, 29918, 7328, 353, 5124, 13, 28466, 698, 29918, 637, 353, 29871, 29947, 29947, 29947, 29941, 13, 2 ]
certbot/compat/os.py
sharpmind-de/certbot
4
129056
""" This compat modules is a wrapper of the core os module that forbids usage of specific operations (e.g. chown, chmod, getuid) that would be harmful to the Windows file security model of Certbot. This module is intended to replace standard os module throughout certbot projects (except acme). """ from __future__ import absolute_import # First round of wrapping: we import statically all public attributes exposed by the os module # This allows in particular to have pylint, mypy, IDEs be aware that most of os members are # available in certbot.compat.os. from os import * # type: ignore # pylint: disable=wildcard-import,unused-wildcard-import,redefined-builtin,os-module-forbidden # Second round of wrapping: we import dynamically all attributes from the os module that have not # yet been imported by the first round (static import). This covers in particular the case of # specific python 3.x versions where not all public attributes are in the special __all__ of os, # and so not in `from os import *`. import os as std_os # pylint: disable=os-module-forbidden import sys as std_sys ourselves = std_sys.modules[__name__] for attribute in dir(std_os): # Check if the attribute does not already exist in our module. It could be internal attributes # of the module (__name__, __doc__), or attributes from standard os already imported with # `from os import *`. if not hasattr(ourselves, attribute): setattr(ourselves, attribute, getattr(std_os, attribute)) # Similar to os.path, allow certbot.compat.os.path to behave as a module std_sys.modules[__name__ + '.path'] = path # Clean all remaining importables that are not from the core os module. del ourselves, std_os, std_sys
[ 1, 9995, 13, 4013, 10007, 10585, 338, 263, 14476, 310, 278, 7136, 2897, 3883, 393, 19752, 4841, 8744, 310, 2702, 6931, 13, 29898, 29872, 29889, 29887, 29889, 521, 776, 29892, 521, 1545, 29892, 679, 5416, 29897, 393, 723, 367, 10311, 1319, 304, 278, 3852, 934, 6993, 1904, 310, 18410, 7451, 29889, 13, 4013, 3883, 338, 9146, 304, 5191, 3918, 2897, 3883, 10106, 2284, 7451, 9279, 313, 19499, 1274, 1004, 467, 13, 15945, 29908, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 13, 29937, 3824, 4513, 310, 28489, 29901, 591, 1053, 1002, 1711, 599, 970, 8393, 19884, 491, 278, 2897, 3883, 13, 29937, 910, 6511, 297, 3153, 304, 505, 282, 2904, 524, 29892, 590, 2272, 29892, 15004, 29879, 367, 9543, 393, 1556, 310, 2897, 5144, 526, 13, 29937, 3625, 297, 2284, 7451, 29889, 12667, 29889, 359, 29889, 13, 3166, 2897, 1053, 334, 29871, 396, 1134, 29901, 11455, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 29893, 789, 7543, 29899, 5215, 29892, 348, 3880, 29899, 29893, 789, 7543, 29899, 5215, 29892, 276, 12119, 29899, 16145, 262, 29892, 359, 29899, 5453, 29899, 1454, 29890, 4215, 13, 13, 29937, 6440, 4513, 310, 28489, 29901, 591, 1053, 11200, 599, 8393, 515, 278, 2897, 3883, 393, 505, 451, 13, 29937, 3447, 1063, 19673, 491, 278, 937, 4513, 313, 7959, 1053, 467, 910, 18469, 297, 3153, 278, 1206, 310, 13, 29937, 2702, 3017, 29871, 29941, 29889, 29916, 6910, 988, 451, 599, 970, 8393, 526, 297, 278, 4266, 4770, 497, 1649, 310, 2897, 29892, 13, 29937, 322, 577, 451, 297, 421, 3166, 2897, 1053, 334, 1412, 13, 5215, 2897, 408, 3659, 29918, 359, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 359, 29899, 5453, 29899, 1454, 29890, 4215, 13, 5215, 10876, 408, 3659, 29918, 9675, 13, 2470, 295, 1960, 353, 3659, 29918, 9675, 29889, 7576, 29961, 1649, 978, 1649, 29962, 13, 1454, 5352, 297, 4516, 29898, 4172, 29918, 359, 1125, 13, 1678, 396, 5399, 565, 278, 5352, 947, 451, 2307, 1863, 297, 1749, 3883, 29889, 739, 1033, 367, 7463, 8393, 13, 1678, 396, 310, 278, 3883, 313, 1649, 978, 1649, 29892, 4770, 1514, 1649, 511, 470, 8393, 515, 3918, 2897, 2307, 19673, 411, 13, 1678, 396, 421, 3166, 2897, 1053, 334, 1412, 13, 1678, 565, 451, 756, 5552, 29898, 2470, 295, 1960, 29892, 5352, 1125, 13, 4706, 731, 5552, 29898, 2470, 295, 1960, 29892, 5352, 29892, 679, 5552, 29898, 4172, 29918, 359, 29892, 5352, 876, 13, 13, 29937, 13999, 304, 2897, 29889, 2084, 29892, 2758, 2284, 7451, 29889, 12667, 29889, 359, 29889, 2084, 304, 23389, 408, 263, 3883, 13, 4172, 29918, 9675, 29889, 7576, 29961, 1649, 978, 1649, 718, 15300, 2084, 2033, 353, 2224, 13, 13, 29937, 315, 14044, 599, 9886, 1053, 1849, 393, 526, 451, 515, 278, 7136, 2897, 3883, 29889, 13, 6144, 20278, 29892, 3659, 29918, 359, 29892, 3659, 29918, 9675, 13, 2 ]
apps/ots/strategy/portfolio_hft.py
yt7589/iching
32
43176
# from __future__ import print_function import datetime as dt import math from apps.ots.strategy.performance import Performance try: import Queue as queue except ImportError: import queue import numpy as np import pandas as pd # from apps.ots.event.ots_event import OtsEvent from apps.ots.event.signal_event import SignalEvent from apps.ots.event.order_event import OrderEvent from apps.ots.event.fill_event import FillEvent from apps.ots.strategy.naive_risk_manager import NaiveRiskManager from apps.ots.order.ots_order import OtsOrder from apps.ots.ots_util import OtsUtil class PortfolioHft(object): ''' 处理所有持仓和市值,其接收Stategy产生的SignalEvent,根据现有持仓情况和规则, 以及风控模型,还有就是算法交易情况(如交易量巨大时分步来进行),生成OrderEvent, 同时接收Exchange系统产生的FillEvent,最终更新持仓情况。 position DataFrame 存放用时间为索引的持仓数量 holdings DataFrame 存放特定时间索引对应的每个代码的现金和总的市场持仓价值, 以及资产组合总量的百分比变化 ''' def __init__(self, bars, events, start_date, initial_capital=100000): self.risk_manager = NaiveRiskManager() self.bars = bars self.events = events self.symbol_list = self.bars.symbol_list self.start_date = start_date self.initial_capital = initial_capital self.all_positions = self.construct_all_positions() self.current_positions = dict((k, v) for k, v in [(s, 0) for s in self.symbol_list]) self.all_holdings = self.construct_all_holdings() self.current_holdings = self.construct_current_holdings() def construct_all_positions(self): ''' 使用start_date确定开始日期,构造持仓列表 ''' d = dict((k, v) for k, v in [(s, 0.0) for s in self.symbol_list]) d['datetime'] = self.start_date return [d] def construct_all_holdings(self): ''' 构造字典保存所有资产组合的开始日期的价值 ''' d = dict((k, v) for k, v in [(s, 0.0) for s in self.symbol_list]) d['cash'] = self.initial_capital d['commission'] = 0.0 d['total'] = self.initial_capital return [d] def construct_current_holdings(self): ''' 构造这典保存所有资产组合的当前价值 ''' d = dict((k, v) for k, v in [(s, 0.0) for s in self.symbol_list]) d['cash'] = self.initial_capital d['commission'] = 0.0 d['total'] = self.initial_capital return d def update_timeindex(self, event): ''' 根据当前市场数据,增加一条新数据,反映当前所有持仓的市场价值 event为市场事件 ''' latest_datetime = self.bars.get_latest_bar_dt(self.symbol_list[0]) dp = dict((k, v) for k, v in [(s, 0) for s in self.symbol_list]) dp['datetime'] = latest_datetime for s in self.symbol_list: dp[s] = self.current_positions[s] self.all_positions.append(dp) dh = dict((k, v) for k, v in [(s, 0) for s in self.symbol_list]) dh['datetime'] = latest_datetime dh['cash'] = self.current_holdings['cash'] dh['commission'] = self.current_holdings['commission'] dh['total'] = self.current_holdings['total'] for s in self.symbol_list: market_value = self.current_positions[s] * self.bars.get_latest_bar_value(s, 'close') dh[s] = market_value dh['total'] += market_value self.all_holdings.append(dh) def update_positions_from_fill(self, fillEvent): ''' 根据FillEvent更新持仓矩阵来反映最新持仓 ''' fill_direction = 0 if fillEvent.direction == 'BUY': fill_direction = 1 elif fillEvent.direction == 'SELL': fill_direction = -1 self.current_positions[fillEvent.symbol] += fill_direction * fillEvent.quantity def update_holdings_from_fill(self, fillEvent): ''' 根据FillEvent更新持仓价值矩阵 ''' fill_direction = 0 if fillEvent.direction == 'BUY': fill_direction = 1 elif fillEvent.direction == 'SELL': fill_direction = -1 fill_price = self.bars.get_latest_bar_value(fillEvent.symbol, 'close') amount = fill_direction * fill_price * fillEvent.quantity self.current_holdings[fillEvent.symbol] += amount self.current_holdings['commission'] = fillEvent.commission self.current_holdings['cash'] -= (amount + fillEvent.commission) self.current_holdings['total'] -= (amount + fillEvent.commission) def update_fill(self, event): ''' 接收到FillEvent后更新持仓和市值 ''' self.update_positions_from_fill(event) self.update_holdings_from_fill(event) def generate_order(self, signalEvent): ''' 根据信号事件生成订单对象 ''' order_event = None symbol = signalEvent.symbol direction = signalEvent.direction strength = signalEvent.strength mkt_quantity = self.risk_manager.get_mkt_quantity(signalEvent=signalEvent) curr_quantity = self.current_holdings[symbol] order_type = OtsOrder.OT_MKT if direction == 'LONG' and curr_quantity == 0: order_event = OrderEvent(symbol, order_type, mkt_quantity, 'BUY') elif direction == 'SHORT' and curr_quantity >= mkt_quantity: order_event = OrderEvent(symbol, order_type, mkt_quantity, 'SELL') elif direction == 'EXIT' and curr_quantity>0: order_event = OrderEvent(symbol, order_type, abs(mkt_quantity), 'SELL') elif direction == 'EXIT' and curr_quantity<0: order_event = OrderEvent(symbol, order_type, abs(mkt_quantity), 'BUY') return order_event def update_signal(self, event): order_event = self.generate_order(event) self.events.put(order_event) def update_from_event(self, event): ''' update_signal ''' if event.type == OtsEvent.ET_SIGNAL: self.update_signal(event) elif event.type == OtsEvent.ET_FILL: self.update_fill(event) def create_equity_curve_dataframe(self): ''' 基于all_holdings的DataFrame对象 ''' curve = pd.DataFrame(self.all_holdings) print('curve: {0}; {1};'.format(type(curve), curve)) curve.set_index('datetime', inplace=True) curve['returns'] = curve['total'].pct_change() curve['equity_curve'] = (1.0 + curve['returns']).cumprod() self.equity_curve = curve def output_summary_stats(self): ''' 所有资产组合的合计信息 ''' total_return = self.equity_curve['equity_curve'][-1] returns = self.equity_curve['returns'] pnl = self.equity_curve['equity_curve'] # 由于是分钟级数据,每年交易252天,每天6.5小时,每小时60分钟 sharpe_ratio = Performance.calculate_sharpe_ratio(returns, periods=252*6.5*60) drawdown, max_dd, dd_duration = Performance.calculate_drawdowns(pnl) self.equity_curve['drawdown'] = drawdown stats = [('Total Return', '{0:0.2f}%'.format((total_return - 1.0)*100)), ('Sharpe Ratio', '{0:0.2f}'.format(sharpe_ratio)), ('Max Drawdown', '{0:0.2f}'.format(max_dd*100)), ('Drawdown Duration', '{0}'.format(dd_duration)) ] self.equity_curve.to_csv('equity.csv') return stats
[ 1, 396, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 5215, 12865, 408, 11636, 13, 5215, 5844, 13, 3166, 11446, 29889, 1862, 29889, 710, 8963, 29889, 546, 13390, 1053, 23768, 13, 2202, 29901, 13, 1678, 1053, 5462, 434, 408, 9521, 13, 19499, 16032, 2392, 29901, 13, 1678, 1053, 9521, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 29937, 13, 3166, 11446, 29889, 1862, 29889, 3696, 29889, 1862, 29918, 3696, 1053, 438, 1372, 2624, 13, 3166, 11446, 29889, 1862, 29889, 3696, 29889, 25436, 29918, 3696, 1053, 9954, 284, 2624, 13, 3166, 11446, 29889, 1862, 29889, 3696, 29889, 2098, 29918, 3696, 1053, 8170, 2624, 13, 3166, 11446, 29889, 1862, 29889, 3696, 29889, 5589, 29918, 3696, 1053, 383, 453, 2624, 13, 3166, 11446, 29889, 1862, 29889, 710, 8963, 29889, 1056, 573, 29918, 3780, 29895, 29918, 12847, 1053, 4465, 573, 29934, 3873, 3260, 13, 3166, 11446, 29889, 1862, 29889, 2098, 29889, 1862, 29918, 2098, 1053, 438, 1372, 7514, 13, 3166, 11446, 29889, 1862, 29889, 1862, 29918, 4422, 1053, 438, 1372, 7270, 13, 13, 1990, 3371, 25648, 29950, 615, 29898, 3318, 1125, 13, 1678, 14550, 29871, 13, 268, 31548, 30687, 30744, 30417, 31695, 231, 190, 150, 30503, 30461, 30959, 30214, 31149, 31092, 31997, 855, 8963, 231, 189, 170, 30486, 30210, 10140, 284, 2624, 30214, 31393, 30763, 31424, 30417, 31695, 231, 190, 150, 30993, 232, 137, 184, 30503, 235, 170, 135, 31403, 30214, 13, 268, 30651, 31436, 236, 166, 145, 31617, 31382, 30883, 30214, 31994, 30417, 31238, 30392, 31565, 30545, 31398, 233, 155, 150, 30993, 232, 137, 184, 30419, 30847, 31398, 233, 155, 150, 31180, 232, 186, 171, 30257, 30594, 30748, 233, 176, 168, 30805, 31174, 30448, 30409, 30214, 30486, 30494, 7514, 2624, 30214, 13, 268, 30980, 30594, 31092, 31997, 1252, 3167, 31185, 31675, 231, 189, 170, 30486, 30210, 20876, 2624, 30214, 30878, 234, 190, 139, 31100, 30374, 31695, 231, 190, 150, 30993, 232, 137, 184, 30267, 13, 1678, 2602, 3630, 4308, 29871, 30946, 31182, 30406, 30594, 31016, 30573, 31836, 31674, 30210, 31695, 231, 190, 150, 30354, 31180, 13, 1678, 4808, 886, 3630, 4308, 29871, 30946, 31182, 31141, 30495, 30594, 31016, 31836, 31674, 30783, 31370, 30210, 31951, 30502, 30690, 31183, 30210, 31424, 30659, 30503, 233, 131, 190, 30210, 30461, 31632, 31695, 231, 190, 150, 231, 190, 186, 30959, 30214, 13, 268, 30651, 31436, 235, 184, 135, 231, 189, 170, 31263, 30733, 233, 131, 190, 31180, 30210, 31047, 30748, 31419, 31462, 30705, 13, 1678, 14550, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 22306, 29892, 4959, 29892, 1369, 29918, 1256, 29892, 2847, 29918, 5030, 2410, 29922, 29896, 29900, 29900, 29900, 29900, 29900, 1125, 13, 4706, 1583, 29889, 3780, 29895, 29918, 12847, 353, 4465, 573, 29934, 3873, 3260, 580, 13, 4706, 1583, 29889, 28408, 353, 22306, 13, 4706, 1583, 29889, 13604, 353, 4959, 13, 4706, 1583, 29889, 18098, 29918, 1761, 353, 1583, 29889, 28408, 29889, 18098, 29918, 1761, 13, 4706, 1583, 29889, 2962, 29918, 1256, 353, 1369, 29918, 1256, 13, 4706, 1583, 29889, 11228, 29918, 5030, 2410, 353, 2847, 29918, 5030, 2410, 13, 4706, 1583, 29889, 497, 29918, 1066, 2187, 353, 1583, 29889, 11433, 29918, 497, 29918, 1066, 2187, 580, 13, 4706, 1583, 29889, 3784, 29918, 1066, 2187, 353, 9657, 3552, 29895, 29892, 325, 29897, 363, 413, 29892, 325, 297, 17288, 29879, 29892, 29871, 29900, 29897, 363, 269, 297, 1583, 29889, 18098, 29918, 1761, 2314, 13, 4706, 1583, 29889, 497, 29918, 8948, 886, 353, 1583, 29889, 11433, 29918, 497, 29918, 8948, 886, 580, 13, 4706, 1583, 29889, 3784, 29918, 8948, 886, 353, 1583, 29889, 11433, 29918, 3784, 29918, 8948, 886, 580, 13, 13, 1678, 822, 3386, 29918, 497, 29918, 1066, 2187, 29898, 1311, 1125, 13, 4706, 14550, 13, 308, 30785, 30406, 2962, 29918, 1256, 31835, 30495, 31026, 31020, 30325, 31117, 30214, 31901, 31420, 31695, 231, 190, 150, 31025, 30746, 13, 4706, 14550, 13, 4706, 270, 353, 9657, 3552, 29895, 29892, 325, 29897, 363, 413, 29892, 325, 297, 17288, 29879, 29892, 29871, 29900, 29889, 29900, 29897, 363, 269, 297, 1583, 29889, 18098, 29918, 1761, 2314, 13, 4706, 270, 1839, 12673, 2033, 353, 1583, 29889, 2962, 29918, 1256, 13, 4706, 736, 518, 29881, 29962, 13, 13, 1678, 822, 3386, 29918, 497, 29918, 8948, 886, 29898, 1311, 1125, 13, 4706, 14550, 13, 308, 31901, 31420, 30578, 31259, 30982, 30946, 30744, 30417, 235, 184, 135, 231, 189, 170, 31263, 30733, 30210, 31026, 31020, 30325, 31117, 30210, 231, 190, 186, 30959, 13, 4706, 14550, 13, 4706, 270, 353, 9657, 3552, 29895, 29892, 325, 29897, 363, 413, 29892, 325, 297, 17288, 29879, 29892, 29871, 29900, 29889, 29900, 29897, 363, 269, 297, 1583, 29889, 18098, 29918, 1761, 2314, 13, 4706, 270, 1839, 29883, 1161, 2033, 353, 1583, 29889, 11228, 29918, 5030, 2410, 13, 4706, 270, 1839, 2055, 2333, 2033, 353, 29871, 29900, 29889, 29900, 13, 4706, 270, 1839, 7827, 2033, 353, 1583, 29889, 11228, 29918, 5030, 2410, 13, 4706, 736, 518, 29881, 29962, 13, 268, 13, 1678, 822, 3386, 29918, 3784, 29918, 8948, 886, 29898, 1311, 1125, 13, 4706, 14550, 29871, 31901, 31420, 30810, 31259, 30982, 30946, 30744, 30417, 235, 184, 135, 231, 189, 170, 31263, 30733, 30210, 30948, 30658, 231, 190, 186, 30959, 14550, 13, 4706, 270, 353, 9657, 3552, 29895, 29892, 325, 29897, 363, 413, 29892, 325, 297, 17288, 29879, 29892, 29871, 29900, 29889, 29900, 29897, 363, 269, 297, 1583, 29889, 18098, 29918, 1761, 2314, 13, 4706, 270, 1839, 29883, 1161, 2033, 353, 1583, 29889, 11228, 29918, 5030, 2410, 13, 4706, 270, 1839, 2055, 2333, 2033, 353, 29871, 29900, 29889, 29900, 13, 4706, 270, 1839, 7827, 2033, 353, 1583, 29889, 11228, 29918, 5030, 2410, 13, 4706, 736, 270, 13, 13, 1678, 822, 2767, 29918, 2230, 2248, 29898, 1311, 29892, 1741, 1125, 13, 4706, 14550, 13, 308, 31393, 30763, 30948, 30658, 30461, 31632, 30354, 30763, 30214, 232, 165, 161, 30666, 30287, 31217, 30374, 30354, 30763, 30214, 31908, 233, 155, 163, 30948, 30658, 30744, 30417, 31695, 231, 190, 150, 30210, 30461, 31632, 231, 190, 186, 30959, 13, 4706, 1741, 30573, 30461, 31632, 30745, 30631, 13, 4706, 14550, 13, 4706, 9281, 29918, 12673, 353, 1583, 29889, 28408, 29889, 657, 29918, 12333, 29918, 1646, 29918, 6008, 29898, 1311, 29889, 18098, 29918, 1761, 29961, 29900, 2314, 13, 4706, 270, 29886, 353, 9657, 3552, 29895, 29892, 325, 29897, 363, 413, 29892, 325, 297, 17288, 29879, 29892, 29871, 29900, 29897, 363, 269, 297, 1583, 29889, 18098, 29918, 1761, 2314, 13, 4706, 270, 29886, 1839, 12673, 2033, 353, 9281, 29918, 12673, 13, 4706, 363, 269, 297, 1583, 29889, 18098, 29918, 1761, 29901, 13, 9651, 270, 29886, 29961, 29879, 29962, 353, 1583, 29889, 3784, 29918, 1066, 2187, 29961, 29879, 29962, 13, 4706, 1583, 29889, 497, 29918, 1066, 2187, 29889, 4397, 29898, 6099, 29897, 13, 4706, 270, 29882, 353, 9657, 3552, 29895, 29892, 325, 29897, 363, 413, 29892, 325, 297, 17288, 29879, 29892, 29871, 29900, 29897, 363, 269, 297, 1583, 29889, 18098, 29918, 1761, 2314, 13, 4706, 270, 29882, 1839, 12673, 2033, 353, 9281, 29918, 12673, 13, 4706, 270, 29882, 1839, 29883, 1161, 2033, 353, 1583, 29889, 3784, 29918, 8948, 886, 1839, 29883, 1161, 2033, 13, 4706, 270, 29882, 1839, 2055, 2333, 2033, 353, 1583, 29889, 3784, 29918, 8948, 886, 1839, 2055, 2333, 2033, 13, 4706, 270, 29882, 1839, 7827, 2033, 353, 1583, 29889, 3784, 29918, 8948, 886, 1839, 7827, 2033, 13, 4706, 363, 269, 297, 1583, 29889, 18098, 29918, 1761, 29901, 13, 9651, 9999, 29918, 1767, 353, 1583, 29889, 3784, 29918, 1066, 2187, 29961, 29879, 29962, 334, 1583, 29889, 28408, 29889, 657, 29918, 12333, 29918, 1646, 29918, 1767, 29898, 29879, 29892, 525, 5358, 1495, 13, 9651, 270, 29882, 29961, 29879, 29962, 353, 9999, 29918, 1767, 13, 9651, 270, 29882, 1839, 7827, 2033, 4619, 9999, 29918, 1767, 13, 4706, 1583, 29889, 497, 29918, 8948, 886, 29889, 4397, 29898, 12744, 29897, 13, 13, 1678, 822, 2767, 29918, 1066, 2187, 29918, 3166, 29918, 5589, 29898, 1311, 29892, 5445, 2624, 1125, 13, 4706, 14550, 13, 308, 31393, 30763, 20876, 2624, 31100, 30374, 31695, 231, 190, 150, 234, 162, 172, 236, 155, 184, 30805, 31908, 233, 155, 163, 30878, 30374, 31695, 231, 190, 150, 13, 4706, 14550, 13, 4706, 5445, 29918, 20845, 353, 29871, 29900, 13, 4706, 565, 5445, 2624, 29889, 20845, 1275, 525, 7838, 29979, 2396, 13, 9651, 5445, 29918, 20845, 353, 29871, 29896, 13, 4706, 25342, 5445, 2624, 29889, 20845, 1275, 525, 1660, 2208, 2396, 13, 9651, 5445, 29918, 20845, 353, 448, 29896, 13, 4706, 1583, 29889, 3784, 29918, 1066, 2187, 29961, 5589, 2624, 29889, 18098, 29962, 4619, 5445, 29918, 20845, 334, 5445, 2624, 29889, 22640, 13, 13, 1678, 822, 2767, 29918, 8948, 886, 29918, 3166, 29918, 5589, 29898, 1311, 29892, 5445, 2624, 1125, 13, 4706, 14550, 13, 308, 31393, 30763, 20876, 2624, 31100, 30374, 31695, 231, 190, 150, 231, 190, 186, 30959, 234, 162, 172, 236, 155, 184, 13, 4706, 14550, 13, 4706, 5445, 29918, 20845, 353, 29871, 29900, 13, 4706, 565, 5445, 2624, 29889, 20845, 1275, 525, 7838, 29979, 2396, 13, 9651, 5445, 29918, 20845, 353, 29871, 29896, 13, 4706, 25342, 5445, 2624, 29889, 20845, 1275, 525, 1660, 2208, 2396, 13, 9651, 5445, 29918, 20845, 353, 448, 29896, 13, 4706, 5445, 29918, 9175, 353, 1583, 29889, 28408, 29889, 657, 29918, 12333, 29918, 1646, 29918, 1767, 29898, 5589, 2624, 29889, 18098, 29892, 525, 5358, 1495, 13, 4706, 5253, 353, 5445, 29918, 20845, 334, 5445, 29918, 9175, 334, 5445, 2624, 29889, 22640, 13, 4706, 1583, 29889, 3784, 29918, 8948, 886, 29961, 5589, 2624, 29889, 18098, 29962, 4619, 5253, 13, 4706, 1583, 29889, 3784, 29918, 8948, 886, 1839, 2055, 2333, 2033, 353, 5445, 2624, 29889, 2055, 2333, 13, 4706, 1583, 29889, 3784, 29918, 8948, 886, 1839, 29883, 1161, 2033, 22361, 313, 14506, 718, 5445, 2624, 29889, 2055, 2333, 29897, 13, 4706, 1583, 29889, 3784, 29918, 8948, 886, 1839, 7827, 2033, 22361, 313, 14506, 718, 5445, 2624, 29889, 2055, 2333, 29897, 13, 13, 1678, 822, 2767, 29918, 5589, 29898, 1311, 29892, 1741, 1125, 13, 4706, 14550, 13, 308, 31092, 31997, 30780, 20876, 2624, 30822, 31100, 30374, 31695, 231, 190, 150, 30503, 30461, 30959, 13, 4706, 14550, 13, 4706, 1583, 29889, 5504, 29918, 1066, 2187, 29918, 3166, 29918, 5589, 29898, 3696, 29897, 13, 4706, 1583, 29889, 5504, 29918, 8948, 886, 29918, 3166, 29918, 5589, 29898, 3696, 29897, 13, 13, 1678, 822, 5706, 29918, 2098, 29898, 1311, 29892, 7182, 2624, 1125, 13, 4706, 14550, 13, 308, 31393, 30763, 30689, 30850, 30745, 30631, 30486, 30494, 235, 177, 165, 31166, 30783, 31133, 13, 4706, 14550, 13, 4706, 1797, 29918, 3696, 353, 6213, 13, 4706, 5829, 353, 7182, 2624, 29889, 18098, 13, 4706, 5305, 353, 7182, 2624, 29889, 20845, 13, 4706, 9324, 353, 7182, 2624, 29889, 710, 1477, 13, 4706, 286, 1193, 29918, 22640, 353, 1583, 29889, 3780, 29895, 29918, 12847, 29889, 657, 29918, 29885, 1193, 29918, 22640, 29898, 25436, 2624, 29922, 25436, 2624, 29897, 13, 4706, 16256, 29918, 22640, 353, 1583, 29889, 3784, 29918, 8948, 886, 29961, 18098, 29962, 13, 4706, 1797, 29918, 1853, 353, 438, 1372, 7514, 29889, 2891, 29918, 29924, 29968, 29911, 13, 4706, 565, 5305, 1275, 525, 29931, 20614, 29915, 322, 16256, 29918, 22640, 1275, 29871, 29900, 29901, 13, 9651, 1797, 29918, 3696, 353, 8170, 2624, 29898, 18098, 29892, 1797, 29918, 1853, 29892, 286, 1193, 29918, 22640, 29892, 525, 7838, 29979, 1495, 13, 4706, 25342, 5305, 1275, 525, 7068, 8476, 29915, 322, 16256, 29918, 22640, 6736, 286, 1193, 29918, 22640, 29901, 13, 9651, 1797, 29918, 3696, 353, 8170, 2624, 29898, 18098, 29892, 1797, 29918, 1853, 29892, 286, 1193, 29918, 22640, 29892, 525, 1660, 2208, 1495, 13, 4706, 25342, 5305, 1275, 525, 5746, 1806, 29915, 322, 16256, 29918, 22640, 29958, 29900, 29901, 13, 9651, 1797, 29918, 3696, 353, 8170, 2624, 29898, 18098, 29892, 1797, 29918, 1853, 29892, 6425, 29898, 29885, 1193, 29918, 22640, 511, 525, 1660, 2208, 1495, 13, 4706, 25342, 5305, 1275, 525, 5746, 1806, 29915, 322, 16256, 29918, 22640, 29966, 29900, 29901, 13, 9651, 1797, 29918, 3696, 353, 8170, 2624, 29898, 18098, 29892, 1797, 29918, 1853, 29892, 6425, 29898, 29885, 1193, 29918, 22640, 511, 525, 7838, 29979, 1495, 13, 4706, 736, 1797, 29918, 3696, 13, 13, 1678, 822, 2767, 29918, 25436, 29898, 1311, 29892, 1741, 1125, 13, 4706, 1797, 29918, 3696, 353, 1583, 29889, 17158, 29918, 2098, 29898, 3696, 29897, 13, 4706, 1583, 29889, 13604, 29889, 649, 29898, 2098, 29918, 3696, 29897, 13, 13, 1678, 822, 2767, 29918, 3166, 29918, 3696, 29898, 1311, 29892, 1741, 1125, 13, 4706, 14550, 2767, 29918, 25436, 13, 4706, 14550, 13, 4706, 565, 1741, 29889, 1853, 1275, 438, 1372, 2624, 29889, 2544, 29918, 5425, 20728, 1964, 29901, 13, 9651, 1583, 29889, 5504, 29918, 25436, 29898, 3696, 29897, 13, 4706, 25342, 1741, 29889, 1853, 1275, 438, 1372, 2624, 29889, 2544, 29918, 3738, 2208, 29901, 13, 9651, 1583, 29889, 5504, 29918, 5589, 29898, 3696, 29897, 13, 13, 1678, 822, 1653, 29918, 1686, 537, 29918, 2764, 345, 29918, 1272, 2557, 29898, 1311, 1125, 13, 4706, 14550, 13, 308, 31359, 30909, 497, 29918, 8948, 886, 30210, 17271, 30783, 31133, 13, 4706, 14550, 13, 4706, 11672, 353, 10518, 29889, 17271, 29898, 1311, 29889, 497, 29918, 8948, 886, 29897, 13, 4706, 1596, 877, 2764, 345, 29901, 426, 29900, 3400, 426, 29896, 3400, 4286, 4830, 29898, 1853, 29898, 2764, 345, 511, 11672, 876, 13, 4706, 11672, 29889, 842, 29918, 2248, 877, 12673, 742, 297, 6689, 29922, 5574, 29897, 13, 4706, 11672, 1839, 18280, 2033, 353, 11672, 1839, 7827, 13359, 29886, 312, 29918, 3167, 580, 13, 4706, 11672, 1839, 1686, 537, 29918, 2764, 345, 2033, 353, 313, 29896, 29889, 29900, 718, 11672, 1839, 18280, 2033, 467, 29883, 398, 10633, 580, 13, 4706, 1583, 29889, 1686, 537, 29918, 2764, 345, 353, 11672, 13, 13, 1678, 822, 1962, 29918, 7727, 29918, 16202, 29898, 1311, 1125, 13, 4706, 14550, 13, 308, 30744, 30417, 235, 184, 135, 231, 189, 170, 31263, 30733, 30210, 30733, 31466, 30689, 31021, 13, 4706, 14550, 13, 4706, 3001, 29918, 2457, 353, 1583, 29889, 1686, 537, 29918, 2764, 345, 1839, 1686, 537, 29918, 2764, 345, 2033, 14352, 29896, 29962, 13, 4706, 3639, 353, 1583, 29889, 1686, 537, 29918, 2764, 345, 1839, 18280, 2033, 13, 4706, 282, 12938, 353, 1583, 29889, 1686, 537, 29918, 2764, 345, 1839, 1686, 537, 29918, 2764, 345, 2033, 13, 4706, 396, 29871, 31272, 30909, 30392, 30748, 236, 149, 162, 234, 189, 170, 30354, 30763, 30214, 31951, 30470, 31398, 233, 155, 150, 29906, 29945, 29906, 30408, 30214, 31951, 30408, 29953, 29889, 29945, 30446, 30594, 30214, 31951, 30446, 30594, 29953, 29900, 30748, 236, 149, 162, 13, 4706, 528, 279, 412, 29918, 3605, 601, 353, 23768, 29889, 15807, 403, 29918, 845, 279, 412, 29918, 3605, 601, 29898, 18280, 29892, 23704, 29922, 29906, 29945, 29906, 29930, 29953, 29889, 29945, 29930, 29953, 29900, 29897, 13, 4706, 4216, 3204, 29892, 4236, 29918, 1289, 29892, 24488, 29918, 19708, 353, 23768, 29889, 15807, 403, 29918, 4012, 3204, 29879, 29898, 29886, 12938, 29897, 13, 4706, 1583, 29889, 1686, 537, 29918, 2764, 345, 1839, 4012, 3204, 2033, 353, 4216, 3204, 13, 4706, 22663, 353, 518, 877, 11536, 7106, 742, 22372, 29900, 29901, 29900, 29889, 29906, 29888, 10560, 4286, 4830, 3552, 7827, 29918, 2457, 448, 29871, 29896, 29889, 29900, 11877, 29896, 29900, 29900, 8243, 13, 9651, 6702, 2713, 279, 412, 17450, 601, 742, 22372, 29900, 29901, 29900, 29889, 29906, 29888, 29913, 4286, 4830, 29898, 845, 279, 412, 29918, 3605, 601, 8243, 13, 9651, 6702, 7976, 18492, 3204, 742, 22372, 29900, 29901, 29900, 29889, 29906, 29888, 29913, 4286, 4830, 29898, 3317, 29918, 1289, 29930, 29896, 29900, 29900, 8243, 13, 9651, 6702, 8537, 3204, 360, 2633, 742, 22372, 29900, 29913, 4286, 4830, 29898, 1289, 29918, 19708, 876, 13, 4706, 4514, 13, 4706, 1583, 29889, 1686, 537, 29918, 2764, 345, 29889, 517, 29918, 7638, 877, 1686, 537, 29889, 7638, 1495, 13, 4706, 736, 22663, 13, 2 ]
src/pretix/base/migrations/0188_delete_requiredaction.py
fabm3n/pretix
1,248
159486
<reponame>fabm3n/pretix<gh_stars>1000+ # Generated by Django 3.2.2 on 2021-05-13 18:20 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('pretixbase', '0187_normalize_salutation'), ] operations = [ migrations.DeleteModel( name='RequiredAction', ), ]
[ 1, 529, 276, 1112, 420, 29958, 16582, 29885, 29941, 29876, 29914, 19819, 861, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29900, 29974, 13, 29937, 3251, 630, 491, 15337, 29871, 29941, 29889, 29906, 29889, 29906, 373, 29871, 29906, 29900, 29906, 29896, 29899, 29900, 29945, 29899, 29896, 29941, 29871, 29896, 29947, 29901, 29906, 29900, 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, 19819, 861, 3188, 742, 525, 29900, 29896, 29947, 29955, 29918, 8945, 675, 29918, 19585, 329, 362, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 12498, 3195, 29898, 13, 9651, 1024, 2433, 19347, 4276, 742, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
settings.py
Vetal1977/tf_aws_lambda
31
109411
<filename>settings.py ''' Common settings for using in a project scope ''' MODEL_ZIP_FILE_NAME_ENV_VAR = 'TF_AWS_MODEL_ZIP_FILE_NAME' MODEL_PROTOBUF_FILE_NAME_ENV_VAR = 'TF_AWS_MODEL_PROTOBUF_FILE_NAME' S3_MODEL_BUCKET_NAME_ENV_VAR = 'TF_AWS_S3_MODEL_BUCKET_NAME'
[ 1, 529, 9507, 29958, 11027, 29889, 2272, 13, 12008, 13, 18877, 6055, 363, 773, 297, 263, 2060, 6874, 13, 12008, 13, 20387, 29931, 29918, 29999, 5690, 29918, 7724, 29918, 5813, 29918, 25838, 29918, 26865, 353, 525, 8969, 29918, 29909, 7811, 29918, 20387, 29931, 29918, 29999, 5690, 29918, 7724, 29918, 5813, 29915, 13, 20387, 29931, 29918, 8618, 4986, 7838, 29943, 29918, 7724, 29918, 5813, 29918, 25838, 29918, 26865, 353, 525, 8969, 29918, 29909, 7811, 29918, 20387, 29931, 29918, 8618, 4986, 7838, 29943, 29918, 7724, 29918, 5813, 29915, 13, 29903, 29941, 29918, 20387, 29931, 29918, 7838, 7077, 2544, 29918, 5813, 29918, 25838, 29918, 26865, 353, 525, 8969, 29918, 29909, 7811, 29918, 29903, 29941, 29918, 20387, 29931, 29918, 7838, 7077, 2544, 29918, 5813, 29915, 13, 2 ]
scieio/conditions/apps.py
arnelimperial/scieio
0
1607269
from django.apps import AppConfig from django.utils.translation import gettext_lazy as _ class ConditionsConfig(AppConfig): name = 'scieio.conditions' verbose_name = _("Product Conditions")
[ 1, 515, 9557, 29889, 13371, 1053, 2401, 3991, 13, 3166, 9557, 29889, 13239, 29889, 3286, 18411, 1053, 679, 726, 29918, 433, 1537, 408, 903, 13, 13, 13, 1990, 11790, 2187, 3991, 29898, 2052, 3991, 1125, 13, 1678, 1024, 353, 525, 1557, 347, 601, 29889, 1116, 2187, 29915, 13, 1678, 26952, 29918, 978, 353, 903, 703, 7566, 11790, 2187, 1159, 13, 2 ]
pymer4/tests/test_utils.py
turbach/pymer4
127
104850
<filename>pymer4/tests/test_utils.py from __future__ import division from pymer4.utils import con2R, R2con, get_resource_path, result_to_table import pandas as pd import numpy as np from pymer4.models import Lm import os def test_con2R(): x = np.array([[-1, 0, 0, 1], [-0.5, -0.5, 0.5, 0.5], [-3 / 3, 1 / 3, 1 / 3, 1 / 3]]) out = con2R(x) assert out.shape == (4, 3) names = ["1 v s4", "1+2 vs 3+4", "1 vs 2+3+4"] out = con2R(x, names=names) assert isinstance(out, pd.DataFrame) assert [x == y for x, y in zip(out.columns, names)] assert out.shape == (4, 3) out = con2R(np.array([-1, 0, 1])) assert np.allclose( out, np.array([[-0.5, 0.40824829], [0.0, -0.81649658], [0.5, 0.40824829]]) ) def test_result_to_table(): df = pd.read_csv(os.path.join(get_resource_path(), "sample_data.csv")) model = Lm("DV ~ IV1 + IV3", data=df) model.fit(summarize=False) formatted = result_to_table(model, drop_intercept=False) assert isinstance(formatted, pd.DataFrame) assert formatted.shape == (3, 6) assert set(["Predictor", "b", "ci", "t", "df", "p"]) == set(formatted.columns) assert formatted.iloc[0, -1] == "< .001" formatted = result_to_table(model, drop_intercept=True) assert isinstance(formatted, pd.DataFrame) assert formatted.shape == (2, 6)
[ 1, 529, 9507, 29958, 29886, 962, 261, 29946, 29914, 21150, 29914, 1688, 29918, 13239, 29889, 2272, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 3166, 282, 962, 261, 29946, 29889, 13239, 1053, 378, 29906, 29934, 29892, 390, 29906, 535, 29892, 679, 29918, 10314, 29918, 2084, 29892, 1121, 29918, 517, 29918, 2371, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 3166, 282, 962, 261, 29946, 29889, 9794, 1053, 365, 29885, 13, 5215, 2897, 13, 13, 13, 1753, 1243, 29918, 535, 29906, 29934, 7295, 13, 1678, 921, 353, 7442, 29889, 2378, 4197, 14352, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 1402, 21069, 29900, 29889, 29945, 29892, 448, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29945, 1402, 21069, 29941, 847, 29871, 29941, 29892, 29871, 29896, 847, 29871, 29941, 29892, 29871, 29896, 847, 29871, 29941, 29892, 29871, 29896, 847, 29871, 29941, 24960, 13, 1678, 714, 353, 378, 29906, 29934, 29898, 29916, 29897, 13, 1678, 4974, 714, 29889, 12181, 1275, 313, 29946, 29892, 29871, 29941, 29897, 13, 1678, 2983, 353, 6796, 29896, 325, 269, 29946, 613, 376, 29896, 29974, 29906, 7186, 29871, 29941, 29974, 29946, 613, 376, 29896, 7186, 29871, 29906, 29974, 29941, 29974, 29946, 3108, 13, 1678, 714, 353, 378, 29906, 29934, 29898, 29916, 29892, 2983, 29922, 7039, 29897, 13, 1678, 4974, 338, 8758, 29898, 449, 29892, 10518, 29889, 17271, 29897, 13, 1678, 4974, 518, 29916, 1275, 343, 363, 921, 29892, 343, 297, 14319, 29898, 449, 29889, 13099, 29892, 2983, 4638, 13, 1678, 4974, 714, 29889, 12181, 1275, 313, 29946, 29892, 29871, 29941, 29897, 13, 13, 1678, 714, 353, 378, 29906, 29934, 29898, 9302, 29889, 2378, 4197, 29899, 29896, 29892, 29871, 29900, 29892, 29871, 29896, 12622, 13, 1678, 4974, 7442, 29889, 497, 5358, 29898, 13, 4706, 714, 29892, 7442, 29889, 2378, 4197, 14352, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29946, 29900, 29947, 29906, 29946, 29947, 29906, 29929, 1402, 518, 29900, 29889, 29900, 29892, 448, 29900, 29889, 29947, 29896, 29953, 29946, 29929, 29953, 29945, 29947, 1402, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29946, 29900, 29947, 29906, 29946, 29947, 29906, 29929, 24960, 13, 1678, 1723, 13, 13, 13, 1753, 1243, 29918, 2914, 29918, 517, 29918, 2371, 7295, 13, 1678, 4489, 353, 10518, 29889, 949, 29918, 7638, 29898, 359, 29889, 2084, 29889, 7122, 29898, 657, 29918, 10314, 29918, 2084, 3285, 376, 11249, 29918, 1272, 29889, 7638, 5783, 13, 1678, 1904, 353, 365, 29885, 703, 29928, 29963, 3695, 6599, 29896, 718, 6599, 29941, 613, 848, 29922, 2176, 29897, 13, 1678, 1904, 29889, 9202, 29898, 2083, 3034, 675, 29922, 8824, 29897, 13, 13, 1678, 20917, 353, 1121, 29918, 517, 29918, 2371, 29898, 4299, 29892, 5768, 29918, 1639, 1547, 29922, 8824, 29897, 13, 13, 1678, 4974, 338, 8758, 29898, 689, 19667, 29892, 10518, 29889, 17271, 29897, 13, 1678, 4974, 20917, 29889, 12181, 1275, 313, 29941, 29892, 29871, 29953, 29897, 13, 1678, 4974, 731, 29898, 3366, 23084, 919, 272, 613, 376, 29890, 613, 376, 455, 613, 376, 29873, 613, 376, 2176, 613, 376, 29886, 20068, 1275, 731, 29898, 689, 19667, 29889, 13099, 29897, 13, 1678, 4974, 20917, 29889, 309, 542, 29961, 29900, 29892, 448, 29896, 29962, 1275, 9872, 869, 29900, 29900, 29896, 29908, 13, 13, 1678, 20917, 353, 1121, 29918, 517, 29918, 2371, 29898, 4299, 29892, 5768, 29918, 1639, 1547, 29922, 5574, 29897, 13, 13, 1678, 4974, 338, 8758, 29898, 689, 19667, 29892, 10518, 29889, 17271, 29897, 13, 1678, 4974, 20917, 29889, 12181, 1275, 313, 29906, 29892, 29871, 29953, 29897, 13, 2 ]
src/tests/flow.py
SeleSchaefer/super_resolution
5
13664
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import cv2 import imageio import numpy as np from tar.miscellaneous import convert_flow_to_color prev = imageio.imread("ressources/1_1.png") prev = cv2.cvtColor(prev, cv2.COLOR_RGB2GRAY) curr = imageio.imread("ressources/1_2.png") curr = cv2.cvtColor(curr, cv2.COLOR_RGB2GRAY) flow = cv2.calcOpticalFlowFarneback(prev, curr, None, 0.9, 15, 20, 100, 10, 1.5, cv2.OPTFLOW_FARNEBACK_GAUSSIAN) rgb = convert_flow_to_color(flow) imageio.imsave("/Users/sele/Desktop/test.png", rgb)
[ 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, 13850, 29906, 13, 5215, 1967, 601, 13, 5215, 12655, 408, 7442, 13, 13, 3166, 9913, 29889, 26737, 3729, 23584, 1053, 3588, 29918, 1731, 29918, 517, 29918, 2780, 13, 13, 16304, 353, 1967, 601, 29889, 326, 949, 703, 1253, 2863, 29914, 29896, 29918, 29896, 29889, 2732, 1159, 13, 16304, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 16304, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 28212, 29906, 29954, 22800, 29897, 13, 21962, 353, 1967, 601, 29889, 326, 949, 703, 1253, 2863, 29914, 29896, 29918, 29906, 29889, 2732, 1159, 13, 21962, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 21962, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 28212, 29906, 29954, 22800, 29897, 13, 1731, 353, 13850, 29906, 29889, 28667, 20624, 936, 17907, 29943, 279, 484, 1627, 29898, 16304, 29892, 16256, 29892, 6213, 29892, 29871, 29900, 29889, 29929, 29892, 29871, 29896, 29945, 29892, 29871, 29906, 29900, 29892, 29871, 29896, 29900, 29900, 29892, 29871, 29896, 29900, 29892, 29871, 29896, 29889, 29945, 29892, 13850, 29906, 29889, 4590, 8969, 27998, 29918, 29943, 1718, 8186, 29933, 11375, 29918, 12739, 29965, 1799, 29902, 2190, 29897, 13, 13, 23973, 353, 3588, 29918, 1731, 29918, 517, 29918, 2780, 29898, 1731, 29897, 13, 3027, 601, 29889, 326, 7620, 11974, 5959, 29914, 344, 280, 29914, 17600, 29914, 1688, 29889, 2732, 613, 15552, 29890, 29897, 13, 2 ]
magnolia/python/training/data_iteration/mix_data.py
rashley-iqt/Magnolia
51
130168
<filename>magnolia/python/training/data_iteration/mix_data.py<gh_stars>10-100 import argparse import logging.config import json import numpy as np import msgpack import tqdm from magnolia.utils.sample import Sample from magnolia.utils.mixing import construct_mixed_sample def main(): # parse command line arguments parser = argparse.ArgumentParser(description='Run preprocessing pipeline.') parser.add_argument('--settings', '-s', default='../../settings/mixing_template.json', help='sample mixing settings JSON file') parser.add_argument('--logger_settings', '-l', default='../../settings/logging.conf', help='logging configuration file') args = parser.parse_args() # Load logging configuration logging.config.fileConfig(args.logger_settings) logger = logging.getLogger('partitioning') with open(args.settings) as settings_file: settings = json.load(settings_file) logger.debug('settings {}'.format(settings)) rng = np.random.RandomState(settings['rng_seed']) number_of_mixed_samples = settings['number_of_mixed_samples'] byte_buffer = settings['byte_buffer'] snr_range = settings['snr_range'] output_file_name = settings['output_file'] target_sample_length = settings['target_sample_length'] signals = [] noises = [] for signal_setting in settings['signals']: signals.append(Sample(rng, signal_setting)) for noise_setting in settings['noises']: noises.append(Sample(rng, noise_setting)) ofile = open(output_file_name, 'bw+') for _ in tqdm.trange(number_of_mixed_samples): snr = rng.uniform(*snr_range) result = construct_mixed_sample(signals, noises, snr, target_sample_length) bresult = msgpack.packb(result) ofile.write(bytes(format(len(bresult), str(byte_buffer)), 'utf-8')) ofile.write(bresult) if __name__ == '__main__': main()
[ 1, 529, 9507, 29958, 29885, 4211, 18001, 29914, 4691, 29914, 26495, 29914, 1272, 29918, 1524, 362, 29914, 28084, 29918, 1272, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 1852, 5510, 13, 5215, 12183, 29889, 2917, 13, 5215, 4390, 13, 5215, 12655, 408, 7442, 13, 5215, 10191, 4058, 13, 5215, 260, 29939, 18933, 13, 3166, 9119, 18001, 29889, 13239, 29889, 11249, 1053, 21029, 13, 3166, 9119, 18001, 29889, 13239, 29889, 28084, 292, 1053, 3386, 29918, 29885, 11925, 29918, 11249, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 396, 6088, 1899, 1196, 6273, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 6558, 758, 19170, 16439, 29889, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 11027, 742, 17411, 29879, 742, 13, 462, 4706, 2322, 2433, 21546, 11027, 29914, 28084, 292, 29918, 6886, 29889, 3126, 742, 13, 462, 4706, 1371, 2433, 11249, 24907, 6055, 4663, 934, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 21707, 29918, 11027, 742, 17411, 29880, 742, 13, 462, 4706, 2322, 2433, 21546, 11027, 29914, 21027, 29889, 5527, 742, 13, 462, 4706, 1371, 2433, 21027, 5285, 934, 1495, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 1678, 396, 16012, 12183, 5285, 13, 1678, 12183, 29889, 2917, 29889, 1445, 3991, 29898, 5085, 29889, 21707, 29918, 11027, 29897, 13, 1678, 17927, 353, 12183, 29889, 657, 16363, 877, 16707, 292, 1495, 13, 13, 1678, 411, 1722, 29898, 5085, 29889, 11027, 29897, 408, 6055, 29918, 1445, 29901, 13, 4706, 6055, 353, 4390, 29889, 1359, 29898, 11027, 29918, 1445, 29897, 13, 13, 4706, 17927, 29889, 8382, 877, 11027, 6571, 4286, 4830, 29898, 11027, 876, 13, 13, 4706, 364, 865, 353, 7442, 29889, 8172, 29889, 17875, 2792, 29898, 11027, 1839, 29878, 865, 29918, 26776, 11287, 13, 4706, 1353, 29918, 974, 29918, 29885, 11925, 29918, 27736, 353, 6055, 1839, 4537, 29918, 974, 29918, 29885, 11925, 29918, 27736, 2033, 13, 4706, 7023, 29918, 9040, 353, 6055, 1839, 10389, 29918, 9040, 2033, 13, 4706, 5807, 29878, 29918, 3881, 353, 6055, 1839, 16586, 29878, 29918, 3881, 2033, 13, 4706, 1962, 29918, 1445, 29918, 978, 353, 6055, 1839, 4905, 29918, 1445, 2033, 13, 4706, 3646, 29918, 11249, 29918, 2848, 353, 6055, 1839, 5182, 29918, 11249, 29918, 2848, 2033, 13, 4706, 18470, 353, 5159, 13, 4706, 694, 4637, 353, 5159, 13, 13, 4706, 363, 7182, 29918, 26740, 297, 6055, 1839, 4530, 1338, 2033, 29901, 13, 9651, 18470, 29889, 4397, 29898, 17708, 29898, 29878, 865, 29892, 7182, 29918, 26740, 876, 13, 4706, 363, 11462, 29918, 26740, 297, 6055, 1839, 1217, 4637, 2033, 29901, 13, 9651, 694, 4637, 29889, 4397, 29898, 17708, 29898, 29878, 865, 29892, 11462, 29918, 26740, 876, 13, 13, 4706, 310, 488, 353, 1722, 29898, 4905, 29918, 1445, 29918, 978, 29892, 525, 29890, 29893, 29974, 1495, 13, 4706, 363, 903, 297, 260, 29939, 18933, 29889, 509, 927, 29898, 4537, 29918, 974, 29918, 29885, 11925, 29918, 27736, 1125, 13, 9651, 5807, 29878, 353, 364, 865, 29889, 29590, 10456, 16586, 29878, 29918, 3881, 29897, 13, 13, 9651, 1121, 353, 3386, 29918, 29885, 11925, 29918, 11249, 29898, 4530, 1338, 29892, 694, 4637, 29892, 5807, 29878, 29892, 3646, 29918, 11249, 29918, 2848, 29897, 13, 13, 9651, 289, 2914, 353, 10191, 4058, 29889, 4058, 29890, 29898, 2914, 29897, 13, 9651, 310, 488, 29889, 3539, 29898, 13193, 29898, 4830, 29898, 2435, 29898, 29890, 2914, 511, 851, 29898, 10389, 29918, 9040, 8243, 525, 9420, 29899, 29947, 8785, 13, 9651, 310, 488, 29889, 3539, 29898, 29890, 2914, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 2 ]
sched_slack_bot/reminder/sender.py
Germandrummer92/SchedSlackBot
0
23064
<gh_stars>0 import abc from sched_slack_bot.model.reminder import Reminder class ReminderSender(abc.ABC): @abc.abstractmethod def send_reminder(self, reminder: Reminder) -> None: raise NotImplementedError("Not Implemented") @abc.abstractmethod def send_skip_message(self, reminder: Reminder) -> None: raise NotImplementedError("Not Implemented")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 25638, 13, 13, 3166, 28598, 29918, 29879, 2364, 29918, 7451, 29889, 4299, 29889, 1745, 4995, 1053, 5240, 4995, 13, 13, 13, 1990, 5240, 4995, 29615, 29898, 10736, 29889, 19658, 1125, 13, 13, 1678, 732, 10736, 29889, 16595, 5696, 13, 1678, 822, 3638, 29918, 1745, 4995, 29898, 1311, 29892, 1083, 4995, 29901, 5240, 4995, 29897, 1599, 6213, 29901, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 703, 3664, 1954, 2037, 287, 1159, 13, 13, 1678, 732, 10736, 29889, 16595, 5696, 13, 1678, 822, 3638, 29918, 11014, 29918, 4906, 29898, 1311, 29892, 1083, 4995, 29901, 5240, 4995, 29897, 1599, 6213, 29901, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 703, 3664, 1954, 2037, 287, 1159, 13, 2 ]
neuroConstruct/pythonScripts/RegenerateNml2.py
OpenSourceBrain/L5bPyrCellHayEtAl2011
4
107391
import sys import os try: from java.io import File except ImportError: print "Note: this file should be run using ..\\..\\..\\nC.bat -python XXX.py' or '../../../nC.sh -python XXX.py'" print "See http://www.neuroconstruct.org/docs/python.html for more details" quit() sys.path.append(os.environ["NC_HOME"]+"/pythonNeuroML/nCUtils") import ncutils as nc # Many useful functions such as SimManager.runMultipleSims found here projFile = File(os.getcwd(), "../L5bPyrCellHayEtAl2011.ncx") simConfigs = [] simConfigs.append("TestNeuroML") nc.generateNeuroML2(projFile, simConfigs) extra_files = ['.test*', 'cell2_fromNeurolucida.nml', 'CaDynamics_E2_NML2*gamma*.nml', 'L5PC.cell.nml', '*TestL5PC*ml', 'analyse_chans.sh', 'compare_nml2_mods.py', 'mods'] if len(sys.argv)==2 and sys.argv[1] == "-f": extra_files.append('L5bPyrCellHayEtAl2011.net.nml') extra_files.append('LEMS_L5bPyrCellHayEtAl2011.xml') extra_files.append('LEMS_L5bPyrCellHayEtAl2011_LowDt.xml') from subprocess import call for f in extra_files: call(["git", "checkout", "../generatedNeuroML2/%s"%f]) quit()
[ 1, 1053, 10876, 13, 5215, 2897, 13, 13, 2202, 29901, 13, 1678, 515, 2115, 29889, 601, 1053, 3497, 13, 19499, 16032, 2392, 29901, 13, 1678, 1596, 376, 9842, 29901, 445, 934, 881, 367, 1065, 773, 6317, 1966, 636, 1966, 636, 1966, 29876, 29907, 29889, 10222, 448, 4691, 22615, 29889, 2272, 29915, 470, 525, 21546, 6995, 29876, 29907, 29889, 845, 448, 4691, 22615, 29889, 2272, 11838, 13, 1678, 1596, 376, 13393, 1732, 597, 1636, 29889, 484, 2192, 11433, 29889, 990, 29914, 2640, 29914, 4691, 29889, 1420, 363, 901, 4902, 29908, 13, 1678, 23283, 580, 13, 13, 9675, 29889, 2084, 29889, 4397, 29898, 359, 29889, 21813, 3366, 15868, 29918, 17353, 3108, 13578, 29914, 4691, 8139, 2192, 1988, 29914, 29876, 29907, 12177, 1159, 13, 13, 5215, 302, 7582, 2719, 408, 302, 29883, 396, 9267, 5407, 3168, 1316, 408, 3439, 3260, 29889, 3389, 15329, 552, 8942, 29879, 1476, 1244, 13, 13, 20865, 2283, 353, 3497, 29898, 359, 29889, 657, 29883, 9970, 3285, 376, 6995, 29931, 29945, 29890, 29925, 4316, 4617, 29950, 388, 29923, 29873, 2499, 29906, 29900, 29896, 29896, 29889, 17608, 29916, 1159, 13, 13, 3601, 3991, 29879, 353, 5159, 13, 3601, 3991, 29879, 29889, 4397, 703, 3057, 8139, 2192, 1988, 1159, 13, 13, 17608, 29889, 17158, 8139, 2192, 1988, 29906, 29898, 20865, 2283, 29892, 1027, 3991, 29879, 29897, 13, 13, 17833, 29918, 5325, 353, 518, 4286, 1688, 29930, 742, 13, 1669, 525, 3729, 29906, 29918, 3166, 8139, 29884, 1467, 1682, 1458, 29889, 29876, 828, 742, 29871, 13, 1669, 525, 26270, 29928, 2926, 1199, 29918, 29923, 29906, 29918, 29940, 1988, 29906, 29930, 4283, 10521, 29876, 828, 742, 29871, 13, 1669, 525, 29931, 29945, 9026, 29889, 3729, 29889, 29876, 828, 742, 29871, 13, 1669, 525, 29930, 3057, 29931, 29945, 9026, 29930, 828, 742, 13, 1669, 525, 24209, 344, 29918, 305, 550, 29889, 845, 742, 13, 1669, 525, 18307, 29918, 29876, 828, 29906, 29918, 1545, 29879, 29889, 2272, 742, 13, 1669, 525, 1545, 29879, 2033, 13, 361, 7431, 29898, 9675, 29889, 19218, 29897, 1360, 29906, 322, 10876, 29889, 19218, 29961, 29896, 29962, 1275, 11663, 29888, 1115, 13, 1678, 4805, 29918, 5325, 29889, 4397, 877, 29931, 29945, 29890, 29925, 4316, 4617, 29950, 388, 29923, 29873, 2499, 29906, 29900, 29896, 29896, 29889, 1212, 29889, 29876, 828, 1495, 13, 1678, 4805, 29918, 5325, 29889, 4397, 877, 1307, 4345, 29918, 29931, 29945, 29890, 29925, 4316, 4617, 29950, 388, 29923, 29873, 2499, 29906, 29900, 29896, 29896, 29889, 3134, 1495, 13, 1678, 4805, 29918, 5325, 29889, 4397, 877, 1307, 4345, 29918, 29931, 29945, 29890, 29925, 4316, 4617, 29950, 388, 29923, 29873, 2499, 29906, 29900, 29896, 29896, 29918, 29931, 340, 29928, 29873, 29889, 3134, 1495, 13, 268, 13, 3166, 1014, 5014, 1053, 1246, 13, 1454, 285, 297, 4805, 29918, 5325, 29901, 13, 1678, 1246, 29898, 3366, 5559, 613, 376, 3198, 449, 613, 376, 6995, 13525, 8139, 2192, 1988, 29906, 22584, 29879, 29908, 29995, 29888, 2314, 13, 13, 28358, 580, 13, 2 ]
FigureTable/NeuroPathRegions/barplots.py
vkola-lab/multi-task
1
15579
from correlate import * import matplotlib import matplotlib.pyplot as plt import seaborn as sns from matplotlib import rc, rcParams rc('axes', linewidth=1) rc('font', weight='bold', size=10) def barplots(prefixes, regions, stains, corre, error, name, folder, ylim): for stain in stains: barplot(prefixes, regions, stain, corre, error, name, folder, ylim) def barplot(prefixes, regions, stain, corre, error, name, folder, ylim): colors = ['#bfe2e3', '#69869c', '#36896e', '#c22e00', '#c6d645', '#ffd3b6', '#b2b2b2', '#4724a9', '#9bc84d', '#7141ae', '#d2a782', '#933b61', '#435299', '#d88770', '#765aa8', '#719795'] Val, Std = [], [] for i, prefix in enumerate(prefixes): val, std = corre[prefix][stain], error[prefix][stain] Val.append(val) Std.append(std) fig, ax = plt.subplots(dpi=300, figsize=(6, 3)) index = [i for i in range(len(regions))] ax.bar(index, Val, yerr=Std, capsize=2, color=colors[:len(prefixes)]) ax.set_ylabel('Spearman\'s rank correlation', fontweight='bold') ax.set_ylim(ylim[0]-0.05, ylim[1]+0.05) ax.set_xticks(index) ax.set_xticklabels(regions, rotation=45, ha="right") ax.grid(which='major', axis='both', linestyle='--') plt.savefig(folder + 'bar_{}_{}.png'.format(stain, name), bbox_inches='tight') plt.close() if __name__ == "__main__": years = 2 layername = 'block2BN' time_threshold, type = 365*years, 'COG' folder = type + '_correlation_{}_years/'.format(years) if not os.path.exists(folder): os.mkdir(folder) interval = file_interval_info(type) y_lim = [0, 0] corre = collections.defaultdict(dict) error = collections.defaultdict(dict) pool = [[0, prefixes[i], regions[i]] for i in range(len(regions))] for i, region in enumerate(prefixes): for stain in stains: corr, std = get_correlation(region + '_' + stain, prefix_idx[region], time_threshold, interval, folder, type, layername, missing=0) corre[region][stain] = corr error[region][stain] = 0 y_lim[1] = max(y_lim[1], corr) y_lim[0] = min(y_lim[0], corr) pool[i][0] -= corr pool.sort() prefixes = [p[1] for p in pool] regions = [p[2] for p in pool] barplots(prefixes, regions, stains, corre, error, '{}days_{}shap_{}'.format(time_threshold, type, layername), folder, y_lim)
[ 1, 515, 18088, 1053, 334, 13, 5215, 22889, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 409, 370, 1398, 408, 269, 1983, 13, 13, 3166, 22889, 1053, 364, 29883, 29892, 364, 29883, 9629, 13, 2214, 877, 1165, 267, 742, 1196, 2103, 29922, 29896, 29897, 13, 2214, 877, 5657, 742, 7688, 2433, 8934, 742, 2159, 29922, 29896, 29900, 29897, 13, 13, 1753, 2594, 26762, 29898, 13506, 267, 29892, 12786, 29892, 380, 2708, 29892, 14515, 29892, 1059, 29892, 1024, 29892, 4138, 29892, 343, 2576, 1125, 13, 1678, 363, 380, 475, 297, 380, 2708, 29901, 13, 4706, 2594, 5317, 29898, 13506, 267, 29892, 12786, 29892, 380, 475, 29892, 14515, 29892, 1059, 29892, 1024, 29892, 4138, 29892, 343, 2576, 29897, 13, 13, 1753, 2594, 5317, 29898, 13506, 267, 29892, 12786, 29892, 380, 475, 29892, 14515, 29892, 1059, 29892, 1024, 29892, 4138, 29892, 343, 2576, 1125, 13, 1678, 11955, 353, 6024, 29937, 1635, 29872, 29906, 29872, 29941, 742, 16321, 29953, 29929, 29947, 29953, 29929, 29883, 742, 16321, 29941, 29953, 29947, 29929, 29953, 29872, 742, 16321, 29883, 29906, 29906, 29872, 29900, 29900, 742, 16321, 29883, 29953, 29881, 29953, 29946, 29945, 742, 16321, 600, 29881, 29941, 29890, 29953, 742, 16321, 29890, 29906, 29890, 29906, 29890, 29906, 742, 16321, 29946, 29955, 29906, 29946, 29874, 29929, 742, 13, 795, 16321, 29929, 12328, 29947, 29946, 29881, 742, 16321, 29955, 29896, 29946, 29896, 3660, 742, 16321, 29881, 29906, 29874, 29955, 29947, 29906, 742, 16321, 29929, 29941, 29941, 29890, 29953, 29896, 742, 16321, 29946, 29941, 29945, 29906, 29929, 29929, 742, 16321, 29881, 29947, 29947, 29955, 29955, 29900, 742, 16321, 29955, 29953, 29945, 7340, 29947, 742, 16321, 29955, 29896, 29929, 29955, 29929, 29945, 2033, 13, 1678, 2630, 29892, 624, 29881, 353, 19997, 5159, 13, 1678, 363, 474, 29892, 10944, 297, 26985, 29898, 13506, 267, 1125, 13, 4706, 659, 29892, 3659, 353, 14515, 29961, 13506, 3816, 303, 475, 1402, 1059, 29961, 13506, 3816, 303, 475, 29962, 13, 4706, 2630, 29889, 4397, 29898, 791, 29897, 13, 4706, 624, 29881, 29889, 4397, 29898, 4172, 29897, 13, 1678, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 29898, 29881, 1631, 29922, 29941, 29900, 29900, 29892, 2537, 2311, 7607, 29953, 29892, 29871, 29941, 876, 13, 1678, 2380, 353, 518, 29875, 363, 474, 297, 3464, 29898, 2435, 29898, 1727, 1080, 28166, 13, 1678, 4853, 29889, 1646, 29898, 2248, 29892, 2630, 29892, 343, 3127, 29922, 855, 29881, 29892, 2117, 2311, 29922, 29906, 29892, 2927, 29922, 27703, 7503, 2435, 29898, 13506, 267, 29897, 2314, 13, 1678, 4853, 29889, 842, 29918, 29891, 1643, 877, 10649, 279, 1171, 20333, 29879, 7115, 19869, 742, 4079, 7915, 2433, 8934, 1495, 13, 1678, 4853, 29889, 842, 29918, 29891, 2576, 29898, 29891, 2576, 29961, 29900, 29962, 29899, 29900, 29889, 29900, 29945, 29892, 343, 2576, 29961, 29896, 10062, 29900, 29889, 29900, 29945, 29897, 13, 1678, 4853, 29889, 842, 29918, 486, 7358, 29898, 2248, 29897, 13, 1678, 4853, 29889, 842, 29918, 486, 860, 21134, 29898, 1727, 1080, 29892, 13733, 29922, 29946, 29945, 29892, 447, 543, 1266, 1159, 13, 1678, 4853, 29889, 7720, 29898, 4716, 2433, 21355, 742, 9685, 2433, 20313, 742, 6276, 342, 1508, 2433, 489, 1495, 13, 1678, 14770, 29889, 7620, 1003, 29898, 12083, 718, 525, 1646, 648, 3227, 1836, 2732, 4286, 4830, 29898, 303, 475, 29892, 1024, 511, 289, 1884, 29918, 262, 6609, 2433, 29873, 523, 1495, 13, 1678, 14770, 29889, 5358, 580, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 2440, 353, 29871, 29906, 13, 1678, 6568, 4510, 353, 525, 1271, 29906, 29933, 29940, 29915, 13, 1678, 931, 29918, 386, 12268, 29892, 1134, 353, 29871, 29941, 29953, 29945, 29930, 6360, 29879, 29892, 525, 3217, 29954, 29915, 13, 1678, 4138, 353, 1134, 718, 22868, 2616, 23445, 648, 2403, 6360, 29879, 29914, 4286, 4830, 29898, 6360, 29879, 29897, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 12083, 1125, 13, 4706, 2897, 29889, 11256, 3972, 29898, 12083, 29897, 13, 1678, 7292, 353, 934, 29918, 19207, 29918, 3888, 29898, 1853, 29897, 13, 13, 1678, 343, 29918, 2576, 353, 518, 29900, 29892, 29871, 29900, 29962, 13, 1678, 14515, 353, 16250, 29889, 4381, 8977, 29898, 8977, 29897, 13, 1678, 1059, 353, 16250, 29889, 4381, 8977, 29898, 8977, 29897, 13, 1678, 11565, 353, 5519, 29900, 29892, 10944, 267, 29961, 29875, 1402, 12786, 29961, 29875, 5262, 363, 474, 297, 3464, 29898, 2435, 29898, 1727, 1080, 28166, 13, 1678, 363, 474, 29892, 5120, 297, 26985, 29898, 13506, 267, 1125, 13, 4706, 363, 380, 475, 297, 380, 2708, 29901, 13, 9651, 27760, 29892, 3659, 353, 679, 29918, 2616, 23445, 29898, 12803, 718, 22868, 29915, 718, 380, 475, 29892, 10944, 29918, 13140, 29961, 12803, 1402, 931, 29918, 386, 12268, 29892, 7292, 29892, 4138, 29892, 1134, 29892, 6568, 4510, 29892, 4567, 29922, 29900, 29897, 13, 9651, 14515, 29961, 12803, 3816, 303, 475, 29962, 353, 27760, 13, 9651, 1059, 29961, 12803, 3816, 303, 475, 29962, 353, 29871, 29900, 13, 9651, 343, 29918, 2576, 29961, 29896, 29962, 353, 4236, 29898, 29891, 29918, 2576, 29961, 29896, 1402, 27760, 29897, 13, 9651, 343, 29918, 2576, 29961, 29900, 29962, 353, 1375, 29898, 29891, 29918, 2576, 29961, 29900, 1402, 27760, 29897, 13, 9651, 11565, 29961, 29875, 3816, 29900, 29962, 22361, 27760, 13, 1678, 11565, 29889, 6605, 580, 13, 1678, 10944, 267, 353, 518, 29886, 29961, 29896, 29962, 363, 282, 297, 11565, 29962, 13, 1678, 12786, 353, 518, 29886, 29961, 29906, 29962, 363, 282, 297, 11565, 29962, 13, 1678, 2594, 26762, 29898, 13506, 267, 29892, 12786, 29892, 380, 2708, 29892, 14515, 29892, 1059, 29892, 525, 8875, 16700, 648, 29913, 845, 481, 648, 29913, 4286, 4830, 29898, 2230, 29918, 386, 12268, 29892, 1134, 29892, 6568, 4510, 511, 4138, 29892, 343, 29918, 2576, 29897, 13, 13, 13, 13, 13, 13, 13, 13, 13, 2 ]
Robocop.py
kitlith/robocop-ng
0
77223
import os import asyncio import sys import logging import logging.handlers import traceback import aiohttp import config import discord from discord.ext import commands script_name = os.path.basename(__file__).split('.')[0] log_file_name = f"{script_name}.log" # Limit of discord (non-nitro) is 8MB (not MiB) max_file_size = 1000 * 1000 * 8 backup_count = 3 file_handler = logging.handlers.RotatingFileHandler( filename=log_file_name, maxBytes=max_file_size, backupCount=backup_count) stdout_handler = logging.StreamHandler(sys.stdout) log_format = logging.Formatter( '[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s') file_handler.setFormatter(log_format) stdout_handler.setFormatter(log_format) log = logging.getLogger('discord') log.setLevel(logging.INFO) log.addHandler(file_handler) log.addHandler(stdout_handler) def get_prefix(bot, message): prefixes = config.prefixes return commands.when_mentioned_or(*prefixes)(bot, message) wanted_jsons = ["data/restrictions.json", "data/robocronptab.json", "data/userlog.json"] initial_extensions = ['cogs.common', 'cogs.admin', 'cogs.verification', 'cogs.mod', 'cogs.mod_note', 'cogs.mod_reacts', 'cogs.mod_userlog', 'cogs.mod_timed', 'cogs.basic', 'cogs.logs', 'cogs.err', 'cogs.lockdown', 'cogs.legacy', 'cogs.links', 'cogs.remind', 'cogs.robocronp', 'cogs.meme'] bot = commands.Bot(command_prefix=get_prefix, description=config.bot_description, pm_help=True) bot.log = log bot.loop = asyncio.get_event_loop() bot.config = config bot.script_name = script_name bot.wanted_jsons = wanted_jsons if __name__ == '__main__': for extension in initial_extensions: try: bot.load_extension(extension) except Exception as e: log.error(f'Failed to load extension {extension}.') log.error(traceback.print_exc()) @bot.event async def on_ready(): aioh = {"User-Agent": f"{script_name}/1.0'"} bot.aiosession = aiohttp.ClientSession(headers=aioh) bot.app_info = await bot.application_info() bot.botlog_channel = bot.get_channel(config.botlog_channel) log.info(f'\nLogged in as: {bot.user.name} - ' f'{bot.user.id}\ndpy version: {discord.__version__}\n') game_name = f"{config.prefixes[0]}help" # Send "Robocop has started! x has y members!" guild = bot.botlog_channel.guild msg = f"{bot.user.name} has started! "\ f"{guild.name} has {guild.member_count} members!" data_files = [discord.File(fpath) for fpath in wanted_jsons] await bot.botlog_channel.send(msg, files=data_files) activity = discord.Activity(name=game_name, type=discord.ActivityType.listening) await bot.change_presence(activity=activity) @bot.event async def on_command(ctx): log_text = f"{ctx.message.author} ({ctx.message.author.id}): "\ f"\"{ctx.message.content}\" " if ctx.guild: # was too long for tertiary if log_text += f"on \"{ctx.channel.name}\" ({ctx.channel.id}) "\ f"at \"{ctx.guild.name}\" ({ctx.guild.id})" else: log_text += f"on DMs ({ctx.channel.id})" log.info(log_text) @bot.event async def on_error(event_method, *args, **kwargs): log.error(f"Error on {event_method}: {sys.exc_info()}") @bot.event async def on_command_error(ctx, error): error_text = str(error) err_msg = f"Error with \"{ctx.message.content}\" from "\ f"\"{ctx.message.author} ({ctx.message.author.id}) "\ f"of type {type(error)}: {error_text}" log.error(err_msg) if not isinstance(error, commands.CommandNotFound): err_msg = bot.escape_message(err_msg) await bot.botlog_channel.send(err_msg) if isinstance(error, commands.NoPrivateMessage): return await ctx.send("This command doesn't work on DMs.") elif isinstance(error, commands.MissingPermissions): roles_needed = '\n- '.join(error.missing_perms) return await ctx.send(f"{ctx.author.mention}: You don't have the right" " permissions to run this command. You need: " f"```- {roles_needed}```") elif isinstance(error, commands.BotMissingPermissions): roles_needed = '\n-'.join(error.missing_perms) return await ctx.send(f"{ctx.author.mention}: Bot doesn't have " "the right permissions to run this command. " "Please add the following roles: " f"```- {roles_needed}```") elif isinstance(error, commands.CommandOnCooldown): return await ctx.send(f"{ctx.author.mention}: You're being " "ratelimited. Try in " f"{error.retry_after:.1f} seconds.") elif isinstance(error, commands.CheckFailure): return await ctx.send(f"{ctx.author.mention}: Check failed. " "You might not have the right permissions " "to run this command.") elif isinstance(error, commands.CommandInvokeError) and\ ("Cannot send messages to this user" in error_text): return await ctx.send(f"{ctx.author.mention}: I can't DM you.\n" "You might have me blocked or have DMs " f"blocked globally or for {ctx.guild.name}.\n" "Please resolve that, then " "run the command again.") elif isinstance(error, commands.CommandNotFound): # Nothing to do when command is not found. return help_text = f"Usage of this command is: ```{ctx.prefix}"\ f"{ctx.command.signature}```\nPlease see `{ctx.prefix}help "\ f"{ctx.command.name}` for more info about this command." if isinstance(error, commands.BadArgument): return await ctx.send(f"{ctx.author.mention}: You gave incorrect " f"arguments. {help_text}") elif isinstance(error, commands.MissingRequiredArgument): return await ctx.send(f"{ctx.author.mention}: You gave incomplete " f"arguments. {help_text}") @bot.event async def on_message(message): if message.author.bot: return if (message.guild) and (message.guild.id not in config.guild_whitelist): return # Ignore messages in newcomers channel, unless it's potentially reset if message.channel.id == config.welcome_channel and\ "reset" not in message.content: return ctx = await bot.get_context(message) await bot.invoke(ctx) if not os.path.exists("data"): os.makedirs("data") for wanted_json in wanted_jsons: if not os.path.exists(wanted_json): with open(wanted_json, "w") as f: f.write("{}") bot.run(config.token, bot=True, reconnect=True, loop=bot.loop)
[ 1, 1053, 2897, 13, 5215, 408, 948, 3934, 13, 5215, 10876, 13, 5215, 12183, 13, 5215, 12183, 29889, 3179, 9306, 13, 5215, 9637, 1627, 13, 5215, 263, 601, 1124, 13, 5215, 2295, 13, 13, 5215, 2313, 536, 13, 3166, 2313, 536, 29889, 1062, 1053, 8260, 13, 13, 2154, 29918, 978, 353, 2897, 29889, 2084, 29889, 6500, 3871, 22168, 1445, 1649, 467, 5451, 12839, 29861, 29900, 29962, 13, 13, 1188, 29918, 1445, 29918, 978, 353, 285, 29908, 29912, 2154, 29918, 978, 1836, 1188, 29908, 13, 13, 29937, 9628, 277, 310, 2313, 536, 313, 5464, 29899, 26129, 307, 29897, 338, 29871, 29947, 9486, 313, 1333, 5493, 29933, 29897, 13, 3317, 29918, 1445, 29918, 2311, 353, 29871, 29896, 29900, 29900, 29900, 334, 29871, 29896, 29900, 29900, 29900, 334, 29871, 29947, 13, 1627, 786, 29918, 2798, 353, 29871, 29941, 13, 1445, 29918, 13789, 353, 12183, 29889, 3179, 9306, 29889, 21281, 1218, 2283, 4598, 29898, 13, 1678, 10422, 29922, 1188, 29918, 1445, 29918, 978, 29892, 4236, 11207, 29922, 3317, 29918, 1445, 29918, 2311, 29892, 16199, 3981, 29922, 1627, 786, 29918, 2798, 29897, 13, 25393, 29918, 13789, 353, 12183, 29889, 3835, 4598, 29898, 9675, 29889, 25393, 29897, 13, 13, 1188, 29918, 4830, 353, 12183, 29889, 18522, 29898, 13, 1678, 525, 29961, 29995, 29898, 294, 312, 603, 29897, 29879, 29962, 18674, 29898, 9507, 29897, 29879, 16664, 29898, 1915, 8154, 29897, 29881, 29913, 1273, 29898, 5563, 978, 29897, 29879, 448, 1273, 29898, 4906, 29897, 29879, 1495, 13, 1445, 29918, 13789, 29889, 842, 18522, 29898, 1188, 29918, 4830, 29897, 13, 25393, 29918, 13789, 29889, 842, 18522, 29898, 1188, 29918, 4830, 29897, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 877, 2218, 16090, 1495, 13, 1188, 29889, 842, 10108, 29898, 21027, 29889, 11690, 29897, 13, 1188, 29889, 1202, 4598, 29898, 1445, 29918, 13789, 29897, 13, 1188, 29889, 1202, 4598, 29898, 25393, 29918, 13789, 29897, 13, 13, 13, 1753, 679, 29918, 13506, 29898, 7451, 29892, 2643, 1125, 13, 1678, 10944, 267, 353, 2295, 29889, 13506, 267, 13, 13, 1678, 736, 8260, 29889, 8256, 29918, 358, 28487, 29918, 272, 10456, 13506, 267, 5033, 7451, 29892, 2643, 29897, 13, 13, 13, 29893, 9714, 29918, 1315, 787, 353, 6796, 1272, 29914, 5060, 4146, 1080, 29889, 3126, 613, 13, 18884, 376, 1272, 29914, 13716, 542, 1617, 415, 370, 29889, 3126, 613, 13, 18884, 376, 1272, 29914, 1792, 1188, 29889, 3126, 3108, 13, 13, 11228, 29918, 24299, 353, 6024, 29883, 12099, 29889, 9435, 742, 13, 462, 418, 525, 29883, 12099, 29889, 6406, 742, 13, 462, 418, 525, 29883, 12099, 29889, 369, 2450, 742, 13, 462, 418, 525, 29883, 12099, 29889, 1545, 742, 13, 462, 418, 525, 29883, 12099, 29889, 1545, 29918, 6812, 742, 13, 462, 418, 525, 29883, 12099, 29889, 1545, 29918, 8423, 29879, 742, 13, 462, 418, 525, 29883, 12099, 29889, 1545, 29918, 1792, 1188, 742, 13, 462, 418, 525, 29883, 12099, 29889, 1545, 29918, 9346, 287, 742, 13, 462, 418, 525, 29883, 12099, 29889, 16121, 742, 13, 462, 418, 525, 29883, 12099, 29889, 20756, 742, 13, 462, 418, 525, 29883, 12099, 29889, 3127, 742, 13, 462, 418, 525, 29883, 12099, 29889, 908, 3204, 742, 13, 462, 418, 525, 29883, 12099, 29889, 1397, 4135, 742, 13, 462, 418, 525, 29883, 12099, 29889, 4965, 742, 13, 462, 418, 525, 29883, 12099, 29889, 1745, 513, 742, 13, 462, 418, 525, 29883, 12099, 29889, 13716, 542, 1617, 29886, 742, 13, 462, 418, 525, 29883, 12099, 29889, 29885, 2004, 2033, 13, 13, 7451, 353, 8260, 29889, 29933, 327, 29898, 6519, 29918, 13506, 29922, 657, 29918, 13506, 29892, 13, 462, 259, 6139, 29922, 2917, 29889, 7451, 29918, 8216, 29892, 26354, 29918, 8477, 29922, 5574, 29897, 13, 13, 7451, 29889, 1188, 353, 1480, 13, 7451, 29889, 7888, 353, 408, 948, 3934, 29889, 657, 29918, 3696, 29918, 7888, 580, 13, 7451, 29889, 2917, 353, 2295, 13, 7451, 29889, 2154, 29918, 978, 353, 2471, 29918, 978, 13, 7451, 29889, 29893, 9714, 29918, 1315, 787, 353, 5131, 29918, 1315, 787, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 363, 6081, 297, 2847, 29918, 24299, 29901, 13, 4706, 1018, 29901, 13, 9651, 9225, 29889, 1359, 29918, 17588, 29898, 17588, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 1480, 29889, 2704, 29898, 29888, 29915, 17776, 304, 2254, 6081, 426, 17588, 1836, 1495, 13, 9651, 1480, 29889, 2704, 29898, 15003, 1627, 29889, 2158, 29918, 735, 29883, 3101, 13, 13, 13, 29992, 7451, 29889, 3696, 13, 12674, 822, 373, 29918, 2040, 7295, 13, 1678, 263, 601, 29882, 353, 8853, 2659, 29899, 19661, 1115, 285, 29908, 29912, 2154, 29918, 978, 6822, 29896, 29889, 29900, 29915, 9092, 13, 1678, 9225, 29889, 1794, 359, 1211, 353, 263, 601, 1124, 29889, 4032, 7317, 29898, 13662, 29922, 29874, 601, 29882, 29897, 13, 1678, 9225, 29889, 932, 29918, 3888, 353, 7272, 9225, 29889, 6214, 29918, 3888, 580, 13, 1678, 9225, 29889, 7451, 1188, 29918, 12719, 353, 9225, 29889, 657, 29918, 12719, 29898, 2917, 29889, 7451, 1188, 29918, 12719, 29897, 13, 13, 1678, 1480, 29889, 3888, 29898, 29888, 12764, 29876, 3403, 3192, 297, 408, 29901, 426, 7451, 29889, 1792, 29889, 978, 29913, 448, 525, 13, 632, 285, 29915, 29912, 7451, 29889, 1792, 29889, 333, 1012, 299, 2272, 1873, 29901, 426, 2218, 16090, 17255, 3259, 1649, 1012, 29876, 1495, 13, 1678, 3748, 29918, 978, 353, 285, 29908, 29912, 2917, 29889, 13506, 267, 29961, 29900, 12258, 8477, 29908, 13, 13, 1678, 396, 15076, 376, 21860, 542, 459, 756, 4687, 29991, 921, 756, 343, 5144, 3850, 13, 1678, 1410, 789, 353, 9225, 29889, 7451, 1188, 29918, 12719, 29889, 2543, 789, 13, 1678, 10191, 353, 285, 29908, 29912, 7451, 29889, 1792, 29889, 978, 29913, 756, 4687, 29991, 6634, 13, 3986, 285, 29908, 29912, 2543, 789, 29889, 978, 29913, 756, 426, 2543, 789, 29889, 14242, 29918, 2798, 29913, 5144, 3850, 13, 13, 1678, 848, 29918, 5325, 353, 518, 2218, 16090, 29889, 2283, 29898, 29888, 2084, 29897, 363, 285, 2084, 297, 5131, 29918, 1315, 787, 29962, 13, 1678, 7272, 9225, 29889, 7451, 1188, 29918, 12719, 29889, 6717, 29898, 7645, 29892, 2066, 29922, 1272, 29918, 5325, 29897, 13, 13, 1678, 6354, 353, 2313, 536, 29889, 3886, 29898, 978, 29922, 11802, 29918, 978, 29892, 13, 462, 18884, 1134, 29922, 2218, 16090, 29889, 3886, 1542, 29889, 1761, 8333, 29897, 13, 13, 1678, 7272, 9225, 29889, 3167, 29918, 4569, 663, 29898, 10072, 29922, 10072, 29897, 13, 13, 13, 29992, 7451, 29889, 3696, 13, 12674, 822, 373, 29918, 6519, 29898, 13073, 1125, 13, 1678, 1480, 29918, 726, 353, 285, 29908, 29912, 13073, 29889, 4906, 29889, 8921, 29913, 21313, 13073, 29889, 4906, 29889, 8921, 29889, 333, 29913, 1125, 6634, 13, 1669, 285, 29908, 5931, 29912, 13073, 29889, 4906, 29889, 3051, 1012, 29908, 376, 13, 1678, 565, 12893, 29889, 2543, 789, 29901, 29871, 396, 471, 2086, 1472, 363, 260, 814, 29875, 653, 565, 13, 4706, 1480, 29918, 726, 4619, 285, 29908, 265, 13218, 29912, 13073, 29889, 12719, 29889, 978, 1012, 29908, 21313, 13073, 29889, 12719, 29889, 333, 1800, 6634, 13, 462, 1678, 285, 29908, 271, 13218, 29912, 13073, 29889, 2543, 789, 29889, 978, 1012, 29908, 21313, 13073, 29889, 2543, 789, 29889, 333, 1800, 29908, 13, 1678, 1683, 29901, 13, 4706, 1480, 29918, 726, 4619, 285, 29908, 265, 27692, 29879, 21313, 13073, 29889, 12719, 29889, 333, 1800, 29908, 13, 1678, 1480, 29889, 3888, 29898, 1188, 29918, 726, 29897, 13, 13, 13, 29992, 7451, 29889, 3696, 13, 12674, 822, 373, 29918, 2704, 29898, 3696, 29918, 5696, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 1678, 1480, 29889, 2704, 29898, 29888, 29908, 2392, 373, 426, 3696, 29918, 5696, 6177, 426, 9675, 29889, 735, 29883, 29918, 3888, 580, 27195, 13, 13, 13, 29992, 7451, 29889, 3696, 13, 12674, 822, 373, 29918, 6519, 29918, 2704, 29898, 13073, 29892, 1059, 1125, 13, 1678, 1059, 29918, 726, 353, 851, 29898, 2704, 29897, 13, 13, 1678, 4589, 29918, 7645, 353, 285, 29908, 2392, 411, 13218, 29912, 13073, 29889, 4906, 29889, 3051, 1012, 29908, 515, 6634, 13, 795, 285, 29908, 5931, 29912, 13073, 29889, 4906, 29889, 8921, 29913, 21313, 13073, 29889, 4906, 29889, 8921, 29889, 333, 1800, 6634, 13, 795, 285, 29908, 974, 1134, 426, 1853, 29898, 2704, 2915, 29901, 426, 2704, 29918, 726, 5038, 13, 13, 1678, 1480, 29889, 2704, 29898, 3127, 29918, 7645, 29897, 13, 13, 1678, 565, 451, 338, 8758, 29898, 2704, 29892, 8260, 29889, 6255, 17413, 1125, 13, 4706, 4589, 29918, 7645, 353, 9225, 29889, 21587, 29918, 4906, 29898, 3127, 29918, 7645, 29897, 13, 4706, 7272, 9225, 29889, 7451, 1188, 29918, 12719, 29889, 6717, 29898, 3127, 29918, 7645, 29897, 13, 13, 1678, 565, 338, 8758, 29898, 2704, 29892, 8260, 29889, 3782, 25207, 3728, 1125, 13, 4706, 736, 7272, 12893, 29889, 6717, 703, 4013, 1899, 1838, 29915, 29873, 664, 373, 27692, 29879, 23157, 13, 1678, 25342, 338, 8758, 29898, 2704, 29892, 8260, 29889, 18552, 292, 15737, 6847, 1125, 13, 4706, 16178, 29918, 484, 19226, 353, 11297, 29876, 29899, 15300, 7122, 29898, 2704, 29889, 27259, 29918, 546, 1516, 29897, 13, 4706, 736, 7272, 12893, 29889, 6717, 29898, 29888, 29908, 29912, 13073, 29889, 8921, 29889, 358, 291, 6177, 887, 1016, 29915, 29873, 505, 278, 1492, 29908, 13, 462, 795, 376, 11239, 304, 1065, 445, 1899, 29889, 887, 817, 29901, 376, 13, 462, 795, 285, 6937, 16159, 29899, 426, 307, 793, 29918, 484, 19226, 10114, 16159, 1159, 13, 1678, 25342, 338, 8758, 29898, 2704, 29892, 8260, 29889, 29933, 327, 18552, 292, 15737, 6847, 1125, 13, 4706, 16178, 29918, 484, 19226, 353, 11297, 29876, 29899, 4286, 7122, 29898, 2704, 29889, 27259, 29918, 546, 1516, 29897, 13, 4706, 736, 7272, 12893, 29889, 6717, 29898, 29888, 29908, 29912, 13073, 29889, 8921, 29889, 358, 291, 6177, 11273, 1838, 29915, 29873, 505, 376, 13, 462, 795, 376, 1552, 1492, 11239, 304, 1065, 445, 1899, 29889, 376, 13, 462, 795, 376, 12148, 788, 278, 1494, 16178, 29901, 376, 13, 462, 795, 285, 6937, 16159, 29899, 426, 307, 793, 29918, 484, 19226, 10114, 16159, 1159, 13, 1678, 25342, 338, 8758, 29898, 2704, 29892, 8260, 29889, 6255, 2951, 7967, 1025, 776, 1125, 13, 4706, 736, 7272, 12893, 29889, 6717, 29898, 29888, 29908, 29912, 13073, 29889, 8921, 29889, 358, 291, 6177, 887, 29915, 276, 1641, 376, 13, 462, 795, 376, 3605, 295, 326, 1573, 29889, 3967, 297, 376, 13, 462, 795, 285, 29908, 29912, 2704, 29889, 276, 2202, 29918, 7045, 29901, 29889, 29896, 29888, 29913, 6923, 23157, 13, 1678, 25342, 338, 8758, 29898, 2704, 29892, 8260, 29889, 5596, 24155, 1125, 13, 4706, 736, 7272, 12893, 29889, 6717, 29898, 29888, 29908, 29912, 13073, 29889, 8921, 29889, 358, 291, 6177, 5399, 5229, 29889, 376, 13, 462, 795, 376, 3492, 1795, 451, 505, 278, 1492, 11239, 376, 13, 462, 795, 376, 517, 1065, 445, 1899, 23157, 13, 1678, 25342, 338, 8758, 29898, 2704, 29892, 8260, 29889, 6255, 20731, 2392, 29897, 322, 29905, 13, 9651, 4852, 29089, 3638, 7191, 304, 445, 1404, 29908, 297, 1059, 29918, 726, 1125, 13, 4706, 736, 7272, 12893, 29889, 6717, 29898, 29888, 29908, 29912, 13073, 29889, 8921, 29889, 358, 291, 6177, 306, 508, 29915, 29873, 27692, 366, 7790, 29876, 29908, 13, 462, 795, 376, 3492, 1795, 505, 592, 24370, 470, 505, 27692, 29879, 376, 13, 462, 795, 285, 29908, 1271, 287, 13149, 635, 470, 363, 426, 13073, 29889, 2543, 789, 29889, 978, 1836, 29905, 29876, 29908, 13, 462, 795, 376, 12148, 8814, 393, 29892, 769, 376, 13, 462, 795, 376, 3389, 278, 1899, 1449, 23157, 13, 1678, 25342, 338, 8758, 29898, 2704, 29892, 8260, 29889, 6255, 17413, 1125, 13, 4706, 396, 9531, 304, 437, 746, 1899, 338, 451, 1476, 29889, 13, 4706, 736, 13, 13, 1678, 1371, 29918, 726, 353, 285, 29908, 27573, 310, 445, 1899, 338, 29901, 7521, 29912, 13073, 29889, 13506, 5038, 29905, 13, 18884, 285, 29908, 29912, 13073, 29889, 6519, 29889, 4530, 1535, 10114, 16159, 29905, 29876, 12148, 1074, 23230, 13073, 29889, 13506, 29913, 8477, 6634, 13, 18884, 285, 29908, 29912, 13073, 29889, 6519, 29889, 978, 10114, 363, 901, 5235, 1048, 445, 1899, 1213, 13, 1678, 565, 338, 8758, 29898, 2704, 29892, 8260, 29889, 22050, 15730, 1125, 13, 4706, 736, 7272, 12893, 29889, 6717, 29898, 29888, 29908, 29912, 13073, 29889, 8921, 29889, 358, 291, 6177, 887, 4846, 10240, 376, 13, 462, 795, 285, 29908, 25699, 29889, 426, 8477, 29918, 726, 27195, 13, 1678, 25342, 338, 8758, 29898, 2704, 29892, 8260, 29889, 18552, 292, 19347, 15730, 1125, 13, 4706, 736, 7272, 12893, 29889, 6717, 29898, 29888, 29908, 29912, 13073, 29889, 8921, 29889, 358, 291, 6177, 887, 4846, 28907, 376, 13, 462, 795, 285, 29908, 25699, 29889, 426, 8477, 29918, 726, 27195, 13, 13, 13, 29992, 7451, 29889, 3696, 13, 12674, 822, 373, 29918, 4906, 29898, 4906, 1125, 13, 1678, 565, 2643, 29889, 8921, 29889, 7451, 29901, 13, 4706, 736, 13, 13, 1678, 565, 313, 4906, 29889, 2543, 789, 29897, 322, 313, 4906, 29889, 2543, 789, 29889, 333, 451, 297, 2295, 29889, 2543, 789, 29918, 1332, 7454, 391, 1125, 13, 4706, 736, 13, 13, 1678, 396, 18076, 487, 7191, 297, 716, 510, 414, 8242, 29892, 6521, 372, 29915, 29879, 19998, 10092, 13, 1678, 565, 2643, 29889, 12719, 29889, 333, 1275, 2295, 29889, 20466, 2763, 29918, 12719, 322, 29905, 13, 9651, 376, 12071, 29908, 451, 297, 2643, 29889, 3051, 29901, 13, 4706, 736, 13, 13, 1678, 12893, 353, 7272, 9225, 29889, 657, 29918, 4703, 29898, 4906, 29897, 13, 1678, 7272, 9225, 29889, 9772, 29898, 13073, 29897, 13, 13, 361, 451, 2897, 29889, 2084, 29889, 9933, 703, 1272, 29908, 1125, 13, 1678, 2897, 29889, 29885, 12535, 12935, 703, 1272, 1159, 13, 13, 1454, 5131, 29918, 3126, 297, 5131, 29918, 1315, 787, 29901, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 29893, 9714, 29918, 3126, 1125, 13, 4706, 411, 1722, 29898, 29893, 9714, 29918, 3126, 29892, 376, 29893, 1159, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 703, 8875, 1159, 13, 13, 7451, 29889, 3389, 29898, 2917, 29889, 6979, 29892, 9225, 29922, 5574, 29892, 337, 6915, 29922, 5574, 29892, 2425, 29922, 7451, 29889, 7888, 29897, 13, 2 ]
payments/migrations/0019_markdownx.py
jakereps/workshops.qiime2.org
0
144383
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2018, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- from django.db import migrations import markdownx.models class Migration(migrations.Migration): dependencies = [ ('payments', '0018_workshops_defaults'), ] operations = [ migrations.AlterField( model_name='workshop', name='description', field=markdownx.models.MarkdownxField(), ), ]
[ 1, 396, 448, 2683, 2683, 2683, 2683, 1378, 5634, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29953, 29899, 29906, 29900, 29896, 29947, 29892, 660, 2687, 2303, 29871, 29906, 5849, 3815, 29889, 13, 29937, 13, 29937, 6652, 7541, 1090, 278, 4958, 310, 278, 3382, 2164, 350, 7230, 19245, 29889, 13, 29937, 13, 29937, 450, 2989, 19405, 338, 297, 278, 934, 365, 2965, 1430, 1660, 29892, 13235, 411, 445, 7047, 29889, 13, 29937, 448, 2683, 2683, 2683, 2683, 1378, 5634, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 13, 5215, 2791, 3204, 29916, 29889, 9794, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 10472, 1860, 742, 525, 29900, 29900, 29896, 29947, 29918, 1287, 845, 3554, 29918, 4381, 29879, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 1287, 19032, 742, 13, 9651, 1024, 2433, 8216, 742, 13, 9651, 1746, 29922, 3502, 3204, 29916, 29889, 9794, 29889, 9802, 3204, 29916, 3073, 3285, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
ykdl/extractors/sina/video.py
Fearyncess/ykdl
2
132117
#!/usr/bin/env python # -*- coding: utf-8 -*- from ykdl.extractor import VideoExtractor from ykdl.util.match import match1, matchall from ykdl.util.html import get_content, get_location from ykdl.videoinfo import VideoInfo import json def get_realurl(url): location = get_location(url) if location != url: return location else: html = get_content(url) return matchall(html, ['CDATA\[([^\]]+)'])[1] class Sina(VideoExtractor): name = u"新浪视频 (sina)" def prepare(self): info = VideoInfo(self.name) self.vid = match1(self.url, 'video_id=(\d+)', '#(\d{5,})', '(\d{5,})\.swf') if not self.vid: html = get_content(self.url) self.vid = match1(html, 'video_id:\'([^\']+)', 'SINA_TEXT_PAGE_INFO[\s\S]+?video_id: ?(\d+)') assert self.vid, "can't get vid" api_url = 'http://s.video.sina.com.cn/video/h5play?video_id={}'.format(self.vid) data = json.loads(get_content(api_url))['data'] info.title = data['title'] for t in ['mp4', '3gp', 'flv']: if t in data['videos']: video_info = data['videos'][t] break for profile in video_info: if not profile in info.stream_types: v = video_info[profile] tp = v['type'] url = v['file_api']+'?vid='+v['file_id'] r_url = get_realurl(url) info.stream_types.append(profile) info.streams[profile] = {'container': tp, 'video_profile': profile, 'src': [r_url], 'size' : 0} return info def prepare_list(self): html = get_content(self.url) return matchall(html, ['video_id: ([^,]+)']) site = Sina()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 343, 29895, 11671, 29889, 21111, 272, 1053, 13987, 5647, 28891, 13, 3166, 343, 29895, 11671, 29889, 4422, 29889, 4352, 1053, 1993, 29896, 29892, 1993, 497, 13, 3166, 343, 29895, 11671, 29889, 4422, 29889, 1420, 1053, 679, 29918, 3051, 29892, 679, 29918, 5479, 13, 3166, 343, 29895, 11671, 29889, 9641, 3888, 1053, 13987, 3401, 13, 13, 5215, 4390, 13, 13, 1753, 679, 29918, 6370, 2271, 29898, 2271, 1125, 13, 1678, 4423, 353, 679, 29918, 5479, 29898, 2271, 29897, 13, 1678, 565, 4423, 2804, 3142, 29901, 13, 4706, 736, 4423, 13, 1678, 1683, 29901, 13, 539, 3472, 353, 679, 29918, 3051, 29898, 2271, 29897, 13, 539, 736, 1993, 497, 29898, 1420, 29892, 6024, 6530, 8254, 29905, 29961, 4197, 3823, 5262, 28135, 2033, 9601, 29896, 29962, 13, 13, 1990, 317, 1099, 29898, 15167, 5647, 28891, 1125, 13, 1678, 1024, 353, 318, 29908, 30374, 233, 184, 173, 31568, 236, 165, 148, 313, 29879, 1099, 5513, 13, 13, 1678, 822, 19012, 29898, 1311, 1125, 13, 4706, 5235, 353, 13987, 3401, 29898, 1311, 29889, 978, 29897, 13, 4706, 1583, 29889, 8590, 353, 1993, 29896, 29898, 1311, 29889, 2271, 29892, 525, 9641, 29918, 333, 29922, 1194, 29881, 28135, 742, 16321, 1194, 29881, 29912, 29945, 29892, 1800, 742, 525, 1194, 29881, 29912, 29945, 29892, 11606, 29889, 2774, 29888, 1495, 13, 4706, 565, 451, 1583, 29889, 8590, 29901, 13, 9651, 3472, 353, 679, 29918, 3051, 29898, 1311, 29889, 2271, 29897, 13, 9651, 1583, 29889, 8590, 353, 1993, 29896, 29898, 1420, 29892, 13, 462, 795, 525, 9641, 29918, 333, 3583, 29915, 4197, 3823, 2033, 28135, 742, 13, 462, 795, 525, 29903, 1177, 29909, 29918, 16975, 29918, 7228, 1692, 29918, 11690, 7110, 29879, 29905, 29903, 10062, 29973, 9641, 29918, 333, 29901, 1577, 1194, 29881, 28135, 1495, 13, 13, 4706, 4974, 1583, 29889, 8590, 29892, 376, 3068, 29915, 29873, 679, 7840, 29908, 13, 13, 4706, 7882, 29918, 2271, 353, 525, 1124, 597, 29879, 29889, 9641, 29889, 29879, 1099, 29889, 510, 29889, 18038, 29914, 9641, 29914, 29882, 29945, 1456, 29973, 9641, 29918, 333, 3790, 29913, 4286, 4830, 29898, 1311, 29889, 8590, 29897, 13, 4706, 848, 353, 4390, 29889, 18132, 29898, 657, 29918, 3051, 29898, 2754, 29918, 2271, 876, 1839, 1272, 2033, 13, 4706, 5235, 29889, 3257, 353, 848, 1839, 3257, 2033, 13, 4706, 363, 260, 297, 6024, 1526, 29946, 742, 525, 29941, 29887, 29886, 742, 525, 1579, 29894, 2033, 29901, 13, 9651, 565, 260, 297, 848, 1839, 29894, 7958, 2033, 29901, 13, 18884, 4863, 29918, 3888, 353, 848, 1839, 29894, 7958, 2033, 29961, 29873, 29962, 13, 18884, 2867, 13, 13, 4706, 363, 8722, 297, 4863, 29918, 3888, 29901, 13, 9651, 565, 451, 8722, 297, 5235, 29889, 5461, 29918, 8768, 29901, 13, 18884, 325, 353, 4863, 29918, 3888, 29961, 10185, 29962, 13, 18884, 260, 29886, 353, 325, 1839, 1853, 2033, 13, 18884, 3142, 353, 325, 1839, 1445, 29918, 2754, 2033, 23097, 29973, 8590, 2433, 29974, 29894, 1839, 1445, 29918, 333, 2033, 13, 18884, 364, 29918, 2271, 353, 679, 29918, 6370, 2271, 29898, 2271, 29897, 13, 18884, 5235, 29889, 5461, 29918, 8768, 29889, 4397, 29898, 10185, 29897, 13, 18884, 5235, 29889, 5461, 29879, 29961, 10185, 29962, 353, 11117, 7611, 2396, 260, 29886, 29892, 525, 9641, 29918, 10185, 2396, 8722, 29892, 525, 4351, 2396, 518, 29878, 29918, 2271, 1402, 525, 2311, 29915, 584, 29871, 29900, 29913, 13, 4706, 736, 5235, 13, 13, 1678, 822, 19012, 29918, 1761, 29898, 1311, 1125, 13, 4706, 3472, 353, 679, 29918, 3051, 29898, 1311, 29889, 2271, 29897, 13, 4706, 736, 1993, 497, 29898, 1420, 29892, 6024, 9641, 29918, 333, 29901, 9310, 29985, 29892, 10062, 29897, 11287, 13, 13, 2746, 353, 317, 1099, 580, 13, 2 ]
model-optimizer/extensions/front/caffe/correlation_ext_test.py
fujunwei/dldt
1
140296
<reponame>fujunwei/dldt """ Copyright (C) 2018-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 unittest from unittest.mock import patch from extensions.front.caffe.correlation_ext import CorrelationFrontExtractor from extensions.ops.correlation import CorrelationOp from mo.utils.unittest.extractors import FakeMultiParam from mo.utils.unittest.graph import FakeNode from mo.ops.op import Op class FakeCorrProtoLayer: def __init__(self, val): self.correlation_param = val class TestCorrelationExt(unittest.TestCase): @classmethod def setUpClass(cls): Op.registered_ops['Correlation'] = CorrelationOp def test_da_no_pb_no_ml(self): self.assertRaises(AttributeError, CorrelationFrontExtractor.extract, None) @patch('extensions.front.caffe.correlation_ext.merge_attrs') def test_resample_ext_ideal_numbers(self, merge_attrs_mock): params = { 'pad': 20, 'kernel_size': 1, 'max_displacement': 20, 'stride_1': 1, 'stride_2': 2, 'single_direction': 0, 'do_abs': False, 'correlation_type': 'caffe.CorrelationParameter.MULTIPLY' } merge_attrs_mock.return_value = { **params, 'test': 54, 'test2': 'test3' } fake_pl = FakeCorrProtoLayer(FakeMultiParam(params)) fake_node = FakeNode(fake_pl, None) CorrelationFrontExtractor.extract(fake_node) exp_res = { 'type': "Correlation", 'pad': 20, 'kernel_size': 1, 'max_displacement': 20, 'stride_1': 1, 'stride_2': 2, 'single_direction': 0, 'do_abs': False, 'correlation_type': 'caffe.CorrelationParameter.MULTIPLY', 'infer': CorrelationOp.corr_infer } for key in exp_res.keys(): self.assertEqual(fake_node[key], exp_res[key])
[ 1, 529, 276, 1112, 420, 29958, 29888, 8016, 348, 26599, 29914, 29881, 430, 29873, 13, 15945, 29908, 13, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29947, 29899, 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, 13, 418, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 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, 13, 5215, 443, 27958, 13, 3166, 443, 27958, 29889, 17640, 1053, 13261, 13, 13, 3166, 17752, 29889, 8862, 29889, 1113, 17615, 29889, 2616, 23445, 29918, 1062, 1053, 2994, 23445, 29348, 5647, 28891, 13, 3166, 17752, 29889, 3554, 29889, 2616, 23445, 1053, 2994, 23445, 11746, 13, 3166, 2730, 29889, 13239, 29889, 348, 27958, 29889, 21111, 943, 1053, 383, 1296, 15329, 4736, 13, 3166, 2730, 29889, 13239, 29889, 348, 27958, 29889, 4262, 1053, 383, 1296, 4247, 13, 3166, 2730, 29889, 3554, 29889, 459, 1053, 6461, 13, 13, 13, 1990, 383, 1296, 12521, 29878, 1184, 517, 14420, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 659, 1125, 13, 4706, 1583, 29889, 2616, 23445, 29918, 3207, 353, 659, 13, 13, 13, 1990, 4321, 12521, 23445, 5647, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 731, 3373, 2385, 29898, 25932, 1125, 13, 4706, 6461, 29889, 9573, 287, 29918, 3554, 1839, 12521, 23445, 2033, 353, 2994, 23445, 11746, 13, 13, 1678, 822, 1243, 29918, 1388, 29918, 1217, 29918, 24381, 29918, 1217, 29918, 828, 29898, 1311, 1125, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 6708, 2392, 29892, 2994, 23445, 29348, 5647, 28891, 29889, 21111, 29892, 6213, 29897, 13, 13, 1678, 732, 5041, 877, 24299, 29889, 8862, 29889, 1113, 17615, 29889, 2616, 23445, 29918, 1062, 29889, 14634, 29918, 5552, 29879, 1495, 13, 1678, 822, 1243, 29918, 690, 981, 29918, 1062, 29918, 680, 284, 29918, 20326, 29898, 1311, 29892, 10366, 29918, 5552, 29879, 29918, 17640, 1125, 13, 4706, 8636, 353, 426, 13, 9651, 525, 8305, 2396, 29871, 29906, 29900, 29892, 13, 9651, 525, 17460, 29918, 2311, 2396, 29871, 29896, 29892, 13, 9651, 525, 3317, 29918, 2218, 29886, 9552, 2396, 29871, 29906, 29900, 29892, 13, 9651, 525, 303, 2426, 29918, 29896, 2396, 29871, 29896, 29892, 13, 9651, 525, 303, 2426, 29918, 29906, 2396, 29871, 29906, 29892, 13, 9651, 525, 14369, 29918, 20845, 2396, 29871, 29900, 29892, 13, 9651, 525, 1867, 29918, 6897, 2396, 7700, 29892, 13, 9651, 525, 2616, 23445, 29918, 1853, 2396, 525, 1113, 17615, 29889, 12521, 23445, 9329, 29889, 29924, 8647, 5690, 16786, 29915, 13, 4706, 500, 13, 4706, 10366, 29918, 5552, 29879, 29918, 17640, 29889, 2457, 29918, 1767, 353, 426, 13, 9651, 3579, 7529, 29892, 13, 9651, 525, 1688, 2396, 29871, 29945, 29946, 29892, 13, 9651, 525, 1688, 29906, 2396, 525, 1688, 29941, 29915, 13, 4706, 500, 13, 13, 4706, 25713, 29918, 572, 353, 383, 1296, 12521, 29878, 1184, 517, 14420, 29898, 29943, 1296, 15329, 4736, 29898, 7529, 876, 13, 4706, 25713, 29918, 3177, 353, 383, 1296, 4247, 29898, 29888, 1296, 29918, 572, 29892, 6213, 29897, 13, 13, 4706, 2994, 23445, 29348, 5647, 28891, 29889, 21111, 29898, 29888, 1296, 29918, 3177, 29897, 13, 13, 4706, 1518, 29918, 690, 353, 426, 13, 9651, 525, 1853, 2396, 376, 12521, 23445, 613, 13, 9651, 525, 8305, 2396, 29871, 29906, 29900, 29892, 13, 9651, 525, 17460, 29918, 2311, 2396, 29871, 29896, 29892, 13, 9651, 525, 3317, 29918, 2218, 29886, 9552, 2396, 29871, 29906, 29900, 29892, 13, 9651, 525, 303, 2426, 29918, 29896, 2396, 29871, 29896, 29892, 13, 9651, 525, 303, 2426, 29918, 29906, 2396, 29871, 29906, 29892, 13, 9651, 525, 14369, 29918, 20845, 2396, 29871, 29900, 29892, 13, 9651, 525, 1867, 29918, 6897, 2396, 7700, 29892, 13, 9651, 525, 2616, 23445, 29918, 1853, 2396, 525, 1113, 17615, 29889, 12521, 23445, 9329, 29889, 29924, 8647, 5690, 16786, 742, 13, 9651, 525, 262, 571, 2396, 2994, 23445, 11746, 29889, 29725, 29918, 262, 571, 13, 4706, 500, 13, 13, 4706, 363, 1820, 297, 1518, 29918, 690, 29889, 8149, 7295, 13, 9651, 1583, 29889, 9294, 9843, 29898, 29888, 1296, 29918, 3177, 29961, 1989, 1402, 1518, 29918, 690, 29961, 1989, 2314, 13, 2 ]
Chapter02/Pandas_Join.py
PacktPublishing/Bioinformatics-with-Python-Cookbook-third-edition
9
111492
# # Pandas advanced import numpy as np import pandas as pd # # Code to sample original data # # ``` # vdata = pd.read_csv("2021VAERSDATA.csv.gz", encoding="iso-8859-1") # vdata.sample(frac=0.9).to_csv("vdata_sample.csv.gz", index=False) # vax = pd.read_csv("2021VAERSVAX.csv.gz", encoding="iso-8859-1") # vax.sample(frac=0.9).to_csv("vax_sample.csv.gz", index=False) # ``` vdata = pd.read_csv("vdata_sample.csv.gz") # No encoding vax = pd.read_csv("vax_sample.csv.gz") vdata_with_vax = vdata.join( vax.set_index("VAERS_ID"), on="VAERS_ID", how="inner") len(vdata), len(vax), len(vdata_with_vax) lost_vdata = vdata.loc[~vdata.index.isin(vdata_with_vax.index)] lost_vdata lost_vax = vax[~vax["VAERS_ID"].isin(vdata_with_vax["VAERS_ID"])] lost_vax # Left, Right and outer caveats vdata_with_vax_left = vdata.join( vax.set_index("VAERS_ID"), on="VAERS_ID") vdata_with_vax_left.groupby("VAERS_ID").size().sort_values() len(vdata_with_vax_left), len(vdata_with_vax_left.VAERS_ID.unique()) # + #vdata_all = pd.read_csv("2021VAERSDATA.csv.gz", encoding="iso-8859-1") #vax_all = pd.read_csv("2021VAERSVAX.csv.gz", encoding="iso-8859-1") # - dead = vdata[vdata.DIED == "Y"] vax19 = vax[vax.VAX_TYPE == "COVID19"] vax19_dead = vax19.join(dead.set_index("VAERS_ID"), on="VAERS_ID", how="right") # join on id, discuss len(vax19), len(dead), len(vax19_dead) len(vax19_dead[vax19_dead.VAERS_ID.duplicated()]) len(vax19_dead) - len(dead) vax19_dead["STATE"] = vax19_dead["STATE"].str.upper() dead_lot = vax19_dead[["VAERS_ID", "VAX_LOT", "STATE"]].set_index(["VAERS_ID", "VAX_LOT"]) dead_lot_clean = dead_lot[~dead_lot.index.duplicated()] dead_lot_clean = dead_lot_clean.reset_index() dead_lot_clean[dead_lot_clean.VAERS_ID.isna()] baddies = dead_lot_clean.groupby("VAX_LOT").size().sort_values(ascending=False) for i, (lot, cnt) in enumerate(baddies.items()): print(lot, cnt, len(dead_lot_clean[dead_lot_clean.VAX_LOT == lot].groupby("STATE"))) if i == 10: break
[ 1, 396, 396, 349, 7086, 12862, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 13, 29937, 396, 5920, 304, 4559, 2441, 848, 13, 29937, 13, 29937, 7521, 13, 29937, 325, 1272, 353, 10518, 29889, 949, 29918, 7638, 703, 29906, 29900, 29906, 29896, 20449, 1001, 7230, 8254, 29889, 7638, 29889, 18828, 613, 8025, 543, 10718, 29899, 29947, 29947, 29945, 29929, 29899, 29896, 1159, 13, 29937, 325, 1272, 29889, 11249, 29898, 1154, 29922, 29900, 29889, 29929, 467, 517, 29918, 7638, 703, 29894, 1272, 29918, 11249, 29889, 7638, 29889, 18828, 613, 2380, 29922, 8824, 29897, 13, 29937, 325, 1165, 353, 10518, 29889, 949, 29918, 7638, 703, 29906, 29900, 29906, 29896, 20449, 1001, 7597, 6604, 29889, 7638, 29889, 18828, 613, 8025, 543, 10718, 29899, 29947, 29947, 29945, 29929, 29899, 29896, 1159, 13, 29937, 325, 1165, 29889, 11249, 29898, 1154, 29922, 29900, 29889, 29929, 467, 517, 29918, 7638, 703, 29894, 1165, 29918, 11249, 29889, 7638, 29889, 18828, 613, 2380, 29922, 8824, 29897, 13, 29937, 7521, 13, 13, 29894, 1272, 353, 10518, 29889, 949, 29918, 7638, 703, 29894, 1272, 29918, 11249, 29889, 7638, 29889, 18828, 1159, 396, 1939, 8025, 13, 29894, 1165, 353, 10518, 29889, 949, 29918, 7638, 703, 29894, 1165, 29918, 11249, 29889, 7638, 29889, 18828, 1159, 13, 13, 29894, 1272, 29918, 2541, 29918, 29894, 1165, 353, 325, 1272, 29889, 7122, 29898, 13, 1678, 325, 1165, 29889, 842, 29918, 2248, 703, 20449, 23598, 29918, 1367, 4968, 13, 1678, 373, 543, 20449, 23598, 29918, 1367, 613, 13, 1678, 920, 543, 3993, 1159, 13, 13, 2435, 29898, 29894, 1272, 511, 7431, 29898, 29894, 1165, 511, 7431, 29898, 29894, 1272, 29918, 2541, 29918, 29894, 1165, 29897, 13, 13, 18767, 29918, 29894, 1272, 353, 325, 1272, 29889, 2029, 29961, 30022, 29894, 1272, 29889, 2248, 29889, 275, 262, 29898, 29894, 1272, 29918, 2541, 29918, 29894, 1165, 29889, 2248, 4638, 13, 18767, 29918, 29894, 1272, 13, 13, 18767, 29918, 29894, 1165, 353, 325, 1165, 29961, 30022, 29894, 1165, 3366, 20449, 23598, 29918, 1367, 16862, 275, 262, 29898, 29894, 1272, 29918, 2541, 29918, 29894, 1165, 3366, 20449, 23598, 29918, 1367, 20068, 29962, 13, 18767, 29918, 29894, 1165, 13, 13, 13, 29937, 19941, 29892, 10428, 322, 11420, 24230, 1446, 13, 13, 13, 29894, 1272, 29918, 2541, 29918, 29894, 1165, 29918, 1563, 353, 325, 1272, 29889, 7122, 29898, 13, 1678, 325, 1165, 29889, 842, 29918, 2248, 703, 20449, 23598, 29918, 1367, 4968, 13, 1678, 373, 543, 20449, 23598, 29918, 1367, 1159, 13, 13, 29894, 1272, 29918, 2541, 29918, 29894, 1165, 29918, 1563, 29889, 27789, 703, 20449, 23598, 29918, 1367, 2564, 2311, 2141, 6605, 29918, 5975, 580, 13, 13, 2435, 29898, 29894, 1272, 29918, 2541, 29918, 29894, 1165, 29918, 1563, 511, 7431, 29898, 29894, 1272, 29918, 2541, 29918, 29894, 1165, 29918, 1563, 29889, 20449, 23598, 29918, 1367, 29889, 13092, 3101, 13, 13, 29937, 718, 13, 29937, 29894, 1272, 29918, 497, 353, 10518, 29889, 949, 29918, 7638, 703, 29906, 29900, 29906, 29896, 20449, 1001, 7230, 8254, 29889, 7638, 29889, 18828, 613, 8025, 543, 10718, 29899, 29947, 29947, 29945, 29929, 29899, 29896, 1159, 13, 29937, 29894, 1165, 29918, 497, 353, 10518, 29889, 949, 29918, 7638, 703, 29906, 29900, 29906, 29896, 20449, 1001, 7597, 6604, 29889, 7638, 29889, 18828, 613, 8025, 543, 10718, 29899, 29947, 29947, 29945, 29929, 29899, 29896, 1159, 13, 29937, 448, 13, 13, 311, 328, 353, 325, 1272, 29961, 29894, 1272, 29889, 4571, 3352, 1275, 376, 29979, 3108, 13, 29894, 1165, 29896, 29929, 353, 325, 1165, 29961, 29894, 1165, 29889, 29963, 6604, 29918, 11116, 1275, 376, 3217, 13044, 29896, 29929, 3108, 13, 29894, 1165, 29896, 29929, 29918, 311, 328, 353, 325, 1165, 29896, 29929, 29889, 7122, 29898, 311, 328, 29889, 842, 29918, 2248, 703, 20449, 23598, 29918, 1367, 4968, 373, 543, 20449, 23598, 29918, 1367, 613, 920, 543, 1266, 1159, 13, 29937, 5988, 373, 1178, 29892, 5353, 13, 13, 2435, 29898, 29894, 1165, 29896, 29929, 511, 7431, 29898, 311, 328, 511, 7431, 29898, 29894, 1165, 29896, 29929, 29918, 311, 328, 29897, 13, 13, 2435, 29898, 29894, 1165, 29896, 29929, 29918, 311, 328, 29961, 29894, 1165, 29896, 29929, 29918, 311, 328, 29889, 20449, 23598, 29918, 1367, 29889, 20908, 9169, 580, 2314, 13, 13, 2435, 29898, 29894, 1165, 29896, 29929, 29918, 311, 328, 29897, 448, 7431, 29898, 311, 328, 29897, 13, 13, 29894, 1165, 29896, 29929, 29918, 311, 328, 3366, 19713, 3108, 353, 325, 1165, 29896, 29929, 29918, 311, 328, 3366, 19713, 16862, 710, 29889, 21064, 580, 13, 311, 328, 29918, 8276, 353, 325, 1165, 29896, 29929, 29918, 311, 328, 29961, 3366, 20449, 23598, 29918, 1367, 613, 376, 29963, 6604, 29918, 29931, 2891, 613, 376, 19713, 3108, 1822, 842, 29918, 2248, 29898, 3366, 20449, 23598, 29918, 1367, 613, 376, 29963, 6604, 29918, 29931, 2891, 20068, 13, 311, 328, 29918, 8276, 29918, 14941, 353, 7123, 29918, 8276, 29961, 30022, 311, 328, 29918, 8276, 29889, 2248, 29889, 20908, 9169, 580, 29962, 13, 311, 328, 29918, 8276, 29918, 14941, 353, 7123, 29918, 8276, 29918, 14941, 29889, 12071, 29918, 2248, 580, 13, 311, 328, 29918, 8276, 29918, 14941, 29961, 311, 328, 29918, 8276, 29918, 14941, 29889, 20449, 23598, 29918, 1367, 29889, 275, 1056, 580, 29962, 13, 13, 29890, 1202, 583, 353, 7123, 29918, 8276, 29918, 14941, 29889, 27789, 703, 29963, 6604, 29918, 29931, 2891, 2564, 2311, 2141, 6605, 29918, 5975, 29898, 6151, 2548, 29922, 8824, 29897, 13, 1454, 474, 29892, 313, 8276, 29892, 274, 593, 29897, 297, 26985, 29898, 29890, 1202, 583, 29889, 7076, 580, 1125, 13, 1678, 1596, 29898, 8276, 29892, 274, 593, 29892, 7431, 29898, 311, 328, 29918, 8276, 29918, 14941, 29961, 311, 328, 29918, 8276, 29918, 14941, 29889, 29963, 6604, 29918, 29931, 2891, 1275, 3287, 1822, 27789, 703, 19713, 29908, 4961, 13, 1678, 565, 474, 1275, 29871, 29896, 29900, 29901, 13, 4706, 2867, 13, 2 ]
Chapter07/python/com/sparksamples/linearregression/LinearRegressionCrossValidationIterations.py
quguiliang/Machine-Learning-with-Spark-Second-Edition
112
60670
<reponame>quguiliang/Machine-Learning-with-Spark-Second-Edition import os import sys import pylab as P import matplotlib import matplotlib.pyplot as plt from com.sparksamples.util import evaluate from com.sparksamples.linearregression.LinearRegressionUtil import get_train_test_data try: from pyspark import SparkContext from pyspark import SparkConf except ImportError as e: print ("Error importing Spark Modules", e) sys.exit(1) from com.sparksamples.util import SPARK_HOME os.environ['SPARK_HOME'] = SPARK_HOME sys.path.append(SPARK_HOME + "/python") def main(): execute() def execute(): train_data, test_data = get_train_test_data() params = [1, 5, 10, 20, 50, 100, 200] metrics = [evaluate(train_data, test_data, param, 0.01, 0.0, 'l2', False) for param in params] print params print metrics P.plot(params, metrics) fig = matplotlib.pyplot.gcf() plt.xscale('log') plt.title("LinearRegressionWithSGD : Iterations") plt.xlabel("Iterators") plt.ylabel("RMSLE") P.show() if __name__ == "__main__": main()
[ 1, 529, 276, 1112, 420, 29958, 339, 2543, 2638, 574, 29914, 29076, 29899, 29931, 799, 1076, 29899, 2541, 29899, 29903, 6378, 29899, 11863, 29899, 3853, 654, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 5215, 282, 2904, 370, 408, 349, 13, 5215, 22889, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 3166, 419, 29889, 29879, 862, 2039, 9422, 29889, 4422, 1053, 14707, 13, 3166, 419, 29889, 29879, 862, 2039, 9422, 29889, 10660, 276, 11476, 29889, 12697, 4597, 23881, 7270, 1053, 679, 29918, 14968, 29918, 1688, 29918, 1272, 13, 13, 13, 2202, 29901, 13, 1678, 515, 282, 952, 6378, 1053, 20814, 2677, 13, 1678, 515, 282, 952, 6378, 1053, 20814, 16376, 13, 19499, 16032, 2392, 408, 321, 29901, 13, 1678, 1596, 4852, 2392, 28348, 20814, 3382, 2540, 613, 321, 29897, 13, 1678, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 3166, 419, 29889, 29879, 862, 2039, 9422, 29889, 4422, 1053, 10937, 1718, 29968, 29918, 17353, 13, 13, 359, 29889, 21813, 1839, 5550, 1718, 29968, 29918, 17353, 2033, 353, 10937, 1718, 29968, 29918, 17353, 13, 9675, 29889, 2084, 29889, 4397, 29898, 5550, 1718, 29968, 29918, 17353, 718, 5591, 4691, 1159, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 6222, 580, 13, 13, 13, 1753, 6222, 7295, 13, 1678, 7945, 29918, 1272, 29892, 1243, 29918, 1272, 353, 679, 29918, 14968, 29918, 1688, 29918, 1272, 580, 13, 1678, 8636, 353, 518, 29896, 29892, 29871, 29945, 29892, 29871, 29896, 29900, 29892, 29871, 29906, 29900, 29892, 29871, 29945, 29900, 29892, 29871, 29896, 29900, 29900, 29892, 29871, 29906, 29900, 29900, 29962, 13, 1678, 21556, 353, 518, 24219, 403, 29898, 14968, 29918, 1272, 29892, 1243, 29918, 1272, 29892, 1828, 29892, 29871, 29900, 29889, 29900, 29896, 29892, 29871, 29900, 29889, 29900, 29892, 525, 29880, 29906, 742, 7700, 29897, 363, 1828, 297, 8636, 29962, 13, 1678, 1596, 8636, 13, 1678, 1596, 21556, 13, 1678, 349, 29889, 5317, 29898, 7529, 29892, 21556, 29897, 13, 1678, 2537, 353, 22889, 29889, 2272, 5317, 29889, 29887, 6854, 580, 13, 1678, 14770, 29889, 29916, 7052, 877, 1188, 1495, 13, 1678, 14770, 29889, 3257, 703, 12697, 4597, 23881, 3047, 26016, 29928, 584, 20504, 800, 1159, 13, 1678, 14770, 29889, 29916, 1643, 703, 13463, 4097, 1159, 13, 1678, 14770, 29889, 29891, 1643, 703, 29934, 4345, 1307, 1159, 13, 1678, 349, 29889, 4294, 580, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1667, 580, 13, 13, 2 ]
Packs/mnemonicMDR/Integrations/ArgusManagedDefence/ArgusManagedDefence.py
matan-xmcyber/content
0
5758
import demistomock as demisto from CommonServerPython import * """ IMPORTS """ import json import urllib3 import dateparser import traceback from typing import Any, Dict, List, Union import logging from argus_api import session as argus_session from argus_api.api.currentuser.v1.user import get_current_user from argus_api.api.cases.v2.case import ( add_case_tag, add_comment, advanced_case_search, close_case, create_case, delete_case, delete_comment, download_attachment, edit_comment, get_attachment, get_case_metadata_by_id, list_case_attachments, list_case_tags, list_case_comments, remove_case_tag_by_id, remove_case_tag_by_key_value, update_case, ) from argus_api.api.events.v1 import get_event_by_path from argus_api.api.events.v1.case.case import get_events_for_case from argus_api.api.events.v1.aggregated import ( find_aggregated_events, list_aggregated_events, ) from argus_api.api.events.v1.payload import get_payload from argus_api.api.events.v1.pcap import get_pcap from argus_api.api.events.v1.nids import find_n_i_d_s_events, list_n_i_d_s_events from argus_api.api.pdns.v3.search import search_records from argus_api.api.reputation.v1.observation import ( fetch_observations_for_domain, fetch_observations_for_i_p, ) # Disable insecure warnings urllib3.disable_warnings() """ CONSTANTS """ DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ" PRETTY_DATE_FORMAT = "%b %d, %Y, %H:%M:%S" FETCH_TAG = demisto.params().get("fetch_tag") """ HELPER FUNCTIONS """ def set_argus_settings( api_key: str, base_url: str = None, proxies: dict = None, verify: bool = None ): argus_session.api_key = api_key argus_session.base_url = base_url argus_session.proxies = proxies argus_session.verify = verify def argus_priority_to_demisto_severity(priority: str) -> int: mapping = {"low": 1, "medium": 2, "high": 3, "critical": 4} return mapping.get(priority, 0) def argus_status_to_demisto_status(status: str) -> int: mapping = { "pendingCustomer": 0, "pendingSoc": 0, "pendingVendor": 0, "pendingClose": 0, "workingSoc": 1, "workingCustomer": 1, "closed": 2, } return mapping.get(status, 0) def build_argus_priority_from_min_severity(min_severity: str) -> List[str]: severities = ["low", "medium", "high", "critical"] min_severity_list = [] for severity in severities: if argus_priority_to_demisto_severity( min_severity.lower() ) <= argus_priority_to_demisto_severity(severity): min_severity_list.append(severity) return min_severity_list def parse_first_fetch(first_fetch: Any) -> Any: if isinstance(first_fetch, str): if first_fetch[0] != "-": first_fetch = f"-{first_fetch}" return first_fetch def build_tags_from_list(lst: list) -> List[Dict]: if not lst: return [] if len(lst) % 2 != 0: return [] tags = [] for i in range(0, len(lst), 2): tags.append({"key": lst[i], "value": lst[i + 1]}) return tags def str_to_dict(string: str) -> dict: if not string: return {} lst = argToList(string) if len(lst) % 2 != 0: return {} return {lst[i]: lst[i + 1] for i in range(0, len(lst), 2)} def date_time_to_epoch_milliseconds(date_time: Union[datetime, str] = None) -> int: if isinstance(date_time, datetime): return int(date_time.timestamp() * 1000) if isinstance(date_time, str): return date_time_to_epoch_milliseconds(dateparser.parse(date_time)) return int(datetime.now().timestamp() * 1000) def pretty_print_date(date_time: Union[datetime, str] = None) -> str: if isinstance(date_time, datetime): return date_time.strftime(PRETTY_DATE_FORMAT) if isinstance(date_time, str): return pretty_print_date(dateparser.parse(date_time)) return datetime.now().strftime(PRETTY_DATE_FORMAT) def pretty_print_case_metadata(result: dict, title: str = None) -> str: data = result["data"] string = title if title else f"# #{data['id']}: {data['subject']}\n" string += "_Priority: {}, status: {}, last updated: {}_\n".format( data["priority"], data["status"], pretty_print_date(data["lastUpdatedTime"]) ) string += "Reported by {} at {}\n\n".format( data["publishedByUser"]["name"], pretty_print_date(data["publishedTime"]) ) string += data["description"] return string def pretty_print_comment(comment: dict, title: str = None) -> str: string = title if title else "" string += f"#### *{comment['addedByUser']['userName']} - {pretty_print_date(comment['addedTime'])}*\n" string += ( f"_Last updated {pretty_print_date(comment['lastUpdatedTime'])}_\n" if comment["lastUpdatedTime"] else "" ) string += f"{comment['comment']}\n\n" string += f"_id: {comment['id']}_\n" string += f"_Flags: {str(comment['flags'])}_\n" if comment["flags"] else "" string += "* * *\n" return string def pretty_print_comments(comments: list, title: str = None) -> str: string = title if title else "" for comment in comments: string += pretty_print_comment(comment) return string def pretty_print_events(result: dict, title: str = None) -> str: string = title if title else "" string += "_Count: {}, showing {} events, from {} to {}_\n".format( result["count"], result["size"], result["offset"], result["limit"] ) string += tableToMarkdown("Events", result["data"]) return string """ COMMAND FUNCTIONS """ def test_module_command() -> str: response = get_current_user() if response["responseCode"] == 200: return "ok" return ( f"Unable to communicate with Argus API {response['responseCode']}, {response}" ) def fetch_incidents( last_run: dict, first_fetch_period: str, limit: int = 25, min_severity: str = "low" ): start_timestamp = last_run.get("start_time", None) if last_run else None # noinspection PyTypeChecker result = advanced_case_search( startTimestamp=start_timestamp if start_timestamp else first_fetch_period, endTimestamp="now", limit=limit, sortBy=["createdTimestamp"], priority=build_argus_priority_from_min_severity(min_severity), subCriteria=[ {"exclude": True, "status": ["closed"]}, ], timeFieldStrategy=["createdTimestamp"], ) incidents = [] for case in result["data"]: incidents.append( { "name": f"#{case['id']}: {case['subject']}", "occurred": case["createdTime"], "severity": argus_priority_to_demisto_severity(case["priority"]), "status": argus_status_to_demisto_status(case["status"]), "details": case["description"], "customFields": { "argus_id": str(case["id"]), "type": case["type"], "category": case["category"]["name"] if case["category"] else None, "service": case["service"]["name"], "lastUpdatedTime": case["lastUpdatedTime"], "createdTimestamp": case["createdTimestamp"], "customer": case["customer"]["shortName"], }, "rawJSON": json.dumps(case), } ) if result["data"]: last_run["start_time"] = str(result["data"][-1]["createdTimestamp"] + 1) return last_run, incidents def add_case_tag_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) key = args.get("key", None) value = args.get("value", None) if not case_id: raise ValueError("case_id not specified") if not key: raise ValueError("key not specified") if not value: raise ValueError("value not specified") tag = {"key": key, "value": value} result = add_case_tag(caseID=case_id, tags=tag) headers = ["key", "value", "addedTime"] readable_output = tableToMarkdown( f"#{case_id}: Tags", result["data"], headers=headers ) return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Tags", outputs=result, raw_response=result, ) def add_comment_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) comment = args.get("comment", None) if not case_id: raise ValueError("case_id not specified") if not comment: raise ValueError("comment not specified") result = add_comment( caseID=case_id, comment=comment, asReplyTo=args.get("as_reply_to", None), internal=args.get("internal", None), originEmailAddress=args.get("origin_email_address", None), associatedAttachmentID=args.get("associated_attachment_id", None), ) return CommandResults( readable_output=pretty_print_comment( result["data"], f"# #{case_id}: Added comment\n" ), outputs_prefix="Argus.Comment", outputs=result, raw_response=result, ) def advanced_case_search_command(args: Dict[str, Any]) -> CommandResults: # noinspection PyTypeChecker result = advanced_case_search( startTimestamp=args.get("start_timestamp", None), endTimestamp=args.get("end_timestamp", None), limit=args.get("limit", None), offset=args.get("offset", None), includeDeleted=args.get("include_deleted", None), subCriteria=argToList(args.get("sub_criteria", None)), exclude=args.get("exclude", None), required=args.get("required", None), customerID=argToList(args.get("customer_id", None)), caseID=argToList(args.get("case_id", None)), customer=argToList(args.get("customer", None)), type=argToList(args.get("case_type", None)), service=argToList(args.get("service", None)), category=argToList(args.get("category", None)), status=argToList(args.get("status", None)), priority=argToList(args.get("priority", None)), assetID=argToList(args.get("asset_id", None)), tag=argToList(args.get("tag", None)), workflow=argToList(args.get("workflow", None)), field=argToList(args.get("field", None)), keywords=argToList(args.get("keywords", None)), timeFieldStrategy=argToList(args.get("time_field_strategy", None)), timeMatchStrategy=args.get("time_match_strategy", None), keywordFieldStrategy=argToList(args.get("keyword_field_strategy", None)), keywordMatchStrategy=args.get("keyword_match_strategy", None), user=argToList(args.get("user", None)), userFieldStrategy=argToList(args.get("user_field_strategy", None)), userAssigned=args.get("user_assigned", None), techAssigned=args.get("tech_assigned", None), includeWorkflows=args.get("include_workflows", None), includeDescription=args.get("include_description", None), accessMode=argToList(args.get("access_mode", None)), explicitAccess=argToList(args.get("explicit_access", None)), sortBy=argToList(args.get("sort_by", None)), includeFlags=argToList(args.get("include_flags", None)), excludeFlags=argToList(args.get("exclude_flags", None)), ) readable_output = f"Advanced Case Search: {result['count']} result(s)\n" readable_output += tableToMarkdown( "Output not suitable for playground", result["data"] ) return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Cases", outputs=result, raw_response=result, ) def close_case_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) if not case_id: raise ValueError("case_id not specified") result = close_case( caseID=case_id, comment=args.get("comment", None), ) readable_output = f"# #{case_id}: close case\n" readable_output += ( f"_Status: {result['data']['status']}, at: {result['data']['closedTime']}_" ) return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Case", outputs=result, raw_response=result, ) def create_case_command(args: Dict[str, Any]) -> CommandResults: subject = args.get("subject", None) description = args.get("description", None) service = args.get("service", None) case_type = args.get("type", None) tags = args.get("tags", None) if not subject: raise ValueError("subject not specified") if not description: raise ValueError("description not specified") if not service: raise ValueError("service not specified") if not case_type: raise ValueError("case_type not specified") if tags: tags = str(tags).split(",") if len(tags) % 2 != 0: raise ValueError("tags list must be of even number", tags) tags = build_tags_from_list(tags) result = create_case( customer=args.get("customer", None), service=service, category=args.get("category", None), type=case_type, status=args.get("status", None), tags=tags, subject=subject, description=description, customerReference=args.get("customer_reference", None), priority=args.get("priority", None), accessMode=args.get("access_mode", None), originEmailAddress=args.get("origin_email_address", None), publish=args.get("publish", None), defaultWatchers=args.get("default_watchers", None), ) return CommandResults( readable_output=pretty_print_case_metadata(result), outputs_prefix="Argus.Case", outputs=result, raw_response=result, ) def delete_case_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) if not case_id: raise ValueError("case id not specified") result = delete_case(caseID=case_id) return CommandResults( readable_output=pretty_print_case_metadata(result, "Case deleted"), outputs_prefix="Argus.Case", outputs=result, raw_response=result, ) def delete_comment_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) comment_id = args.get("comment_id", None) if not case_id: raise ValueError("case id not specified") if not comment_id: raise ValueError("comment id not specified") result = delete_comment(caseID=case_id, commentID=comment_id) return CommandResults( readable_output=pretty_print_comment( result["data"], f"# #{case_id}: Deleted comment\n" ), outputs_prefix="Argus.Comment", outputs=result, raw_response=result, ) def download_attachment_command(args: Dict[str, Any]) -> Any: case_id = args.get("case_id", None) attachment_id = args.get("attachment_id", None) if not case_id: raise ValueError("case id not specified") if not attachment_id: raise ValueError("attachment id not specified") result = download_attachment(caseID=case_id, attachmentID=attachment_id) return fileResult(attachment_id, result.content) def edit_comment_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) comment_id = args.get("comment_id", None) comment = args.get("comment", None) if not case_id: raise ValueError("case id not specified") if not comment_id: raise ValueError("comment id not specified") if not comment: raise ValueError("comment not specified") result = edit_comment(caseID=case_id, commentID=comment_id, comment=comment) return CommandResults( readable_output=pretty_print_comment( result["data"], f"# #{case_id}: Updated comment\n" ), outputs_prefix="Argus.Comment", outputs=result, raw_response=result, ) def get_attachment_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) attachment_id = args.get("attachment_id", None) if not case_id: raise ValueError("case id not specified") if not attachment_id: raise ValueError("attachment id not specified") result = get_attachment(caseID=case_id, attachmentID=attachment_id) readable_output = f"# #{case_id}: attachment metadata\n" readable_output += f"#### *{result['data']['addedByUser']['userName']} - {result['data']['addedTime']}*\n" readable_output += f"{result['data']['name']} ({result['data']['mimeType']}, {result['data']['size']} bytes)\n\n" readable_output += f"_id: {result['data']['id']}_\n" return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Attachments", outputs=result, raw_response=result, ) def get_case_metadata_by_id_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) if not case_id: raise ValueError("case id not specified") result = get_case_metadata_by_id( id=case_id, skipRedirect=args.get("skip_redirect", None) ) return CommandResults( readable_output=pretty_print_case_metadata(result), outputs_prefix="Argus.Case", outputs=result, raw_response=result, ) def list_case_attachments_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) if not case_id: raise ValueError("case_id not specified") result = list_case_attachments( caseID=case_id, limit=args.get("limit", None), offset=args.get("offset", None) ) readable_output = f"# #{case_id}: Case attachments\n" for attachment in result["data"]: readable_output += f"#### *{attachment['addedByUser']['userName']} - {attachment['addedTime']}*\n" readable_output += f"{attachment['name']} ({attachment['mimeType']}, {attachment['size']} kb)\n\n" readable_output += f"_id: {attachment['id']}_\n" readable_output += "* * *\n" return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Attachments", outputs=result, raw_response=result, ) def list_case_tags_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) if not case_id: raise ValueError("case_id not specified") result = list_case_tags( caseID=case_id, limit=args.get("limit", None), offset=args.get("offset", None) ) headers = ["key", "value", "addedTime", "id"] readable_output = tableToMarkdown( f"#{case_id}: Tags", result["data"], headers=headers ) return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Tags", outputs=result, raw_response=result, ) def list_case_comments_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) sort_by = args.get("sort_by", None) if not case_id: raise ValueError("case_id not specified") if sort_by: sort_by = ["addedTimestamp"] if sort_by == "ascending" else ["-addedTimestamp"] result = list_case_comments( caseID=case_id, beforeComment=args.get("before_comment", None), afterComment=args.get("after_comment", None), offset=args.get("offset", None), limit=args.get("limit", None), sortBy=sort_by, ) return CommandResults( readable_output=pretty_print_comments( result["data"], f"# #{case_id}: Comments\n" ), outputs_prefix="Argus.Comments", outputs=result, raw_response=result, ) def remove_case_tag_by_id_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) tag_id = args.get("tag_id", None) if not case_id: raise ValueError("case id not specified") if not tag_id: raise ValueError("tag id not specified") result = remove_case_tag_by_id(caseID=case_id, tagID=tag_id) headers = ["key", "value", "addedTime", "id", "flags"] readable_output = tableToMarkdown( f"#{case_id}: Delete tags", result["data"], headers=headers ) return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Tags", outputs=result, raw_response=result, ) def remove_case_tag_by_key_value_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) key = args.get("key", None) value = args.get("value", None) if not case_id: raise ValueError("case id not specified") if not key: raise ValueError("key not specified") if not value: raise ValueError("value not specified") result = remove_case_tag_by_key_value(caseID=case_id, tagKey=key, tagValue=value) headers = ["key", "value", "addedTime", "id", "flags"] readable_output = tableToMarkdown( f"#{case_id}: Delete tags", result["data"], headers=headers ) return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Tags", outputs=result, raw_response=result, ) def update_case_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) if not case_id: raise ValueError("case id not specified") result = update_case( id=case_id, subject=args.get("subject", None), description=args.get("description", None), status=args.get("status", None), priority=args.get("priority", None), category=args.get("category", None), reporter=args.get("reporter", None), assignedUser=args.get("assigned_user", None), assignedTech=args.get("assigned_tech", None), customerReference=args.get("customer_reference", None), comment=args.get("comment", None), originEmailAddress=args.get("origin_email_address", None), hasEvents=args.get("has_events", None), internalComment=args.get("internal_comment", None), ) return CommandResults( readable_output=pretty_print_case_metadata(result), outputs_prefix="Argus.Case", outputs=result, raw_response=result, ) def get_event_command(args: Dict[str, Any]) -> CommandResults: event_type = args.get("type", None) timestamp = args.get("timestamp", None) customer_id = args.get("customer_id", None) event_id = args.get("event_id", None) if not event_type: raise ValueError("event type not specified") if not timestamp: raise ValueError("timestamp not specified") if not customer_id: raise ValueError("customer id not specified") if not event_id: raise ValueError("event id not specified") result = get_event_by_path( type=event_type, timestamp=timestamp, customerID=customer_id, eventID=event_id ) return CommandResults( readable_output=tableToMarkdown(f"Event: {event_id}", result["data"]), outputs_prefix="Argus.Event", outputs=result, raw_response=result, ) def get_events_for_case_command(args: Dict[str, Any]) -> CommandResults: case_id = args.get("case_id", None) if not case_id: raise ValueError("case id not specified") result = get_events_for_case( caseID=case_id, limit=args.get("limit", None), offset=args.get("offset", None) ) return CommandResults( readable_output=pretty_print_events( dict(result), f"# #{case_id}: Associated Events\n" ), outputs_prefix="Argus.Events", outputs=result, raw_response=result, ) def find_aggregated_events_command(args: Dict[str, Any]) -> CommandResults: # noinspection PyTypeChecker result = find_aggregated_events( skipFutureEvents=args.get("skip_future_events", None), exclude=args.get("exclude", None), locationID=argToList(args.get("location_id", None)), severity=argToList(args.get("severity", None)), customer=argToList(args.get("customer", None)), alarmID=argToList(args.get("alarm_id", None)), attackCategoryID=argToList(args.get("attack_category_id", None)), sourceGeoCountry=argToList(args.get("source_geo_country", None)), destinationGeoCountry=argToList(args.get("destination_geo_country", None)), geoCountry=argToList(args.get("geo_country", None)), properties=str_to_dict(args.get("properties", None)), exactMatchProperties=args.get("exact_match_properties", None), subCriteria=argToList(args.get("sub_criteria", None)), signature=argToList(args.get("signature", None)), lastUpdatedTimestamp=args.get("last_updated_timestamp", None), indexStartTime=args.get("index_start_time", None), indexEndTime=args.get("index_end_time", None), destinationIP=argToList(args.get("destination_ip", None)), sourceIP=argToList(args.get("source_ip", None)), ip=argToList(args.get("ip", None)), destinationPort=argToList(args.get("destination_port", None)), sourcePort=argToList(args.get("source_port", None)), port=argToList(args.get("port", None)), minSeverity=args.get("min_severity", None), maxSeverity=args.get("max_severity", None), limit=args.get("limit", 25), offset=args.get("offset", None), includeDeleted=args.get("include_deleted", None), minCount=args.get("min_count", None), associatedCaseID=argToList(args.get("associated_case_id", None)), sourceIPMinBits=args.get("source_ip_min_bits", None), destinationIPMinBits=args.get("destination_ip_min_bits", None), startTimestamp=args.get("start_timestamp", "-24hours"), endTimestamp=args.get("end_timestamp", "now"), sortBy=argToList(args.get("sort_by", None)), includeFlags=argToList(args.get("include_flags", None)), excludeFlags=argToList(args.get("exclude_flags", None)), ) return CommandResults( readable_output=pretty_print_events(dict(result), "# Find events\n"), outputs_prefix="Argus.Events", outputs=result, raw_response=result, ) def list_aggregated_events_command(args: Dict[str, Any]) -> CommandResults: result = list_aggregated_events( customerID=args.get("customer_id", None), signature=args.get("signature", None), ip=args.get("ip", None), startTimestamp=args.get("start_timestamp", None), endTimestamp=args.get("end_timestamp", None), limit=args.get("limit", None), offset=args.get("offset", None), ) return CommandResults( readable_output=pretty_print_events(dict(result), "# List Events\n"), outputs_prefix="Argus.Events", outputs=result, raw_response=result, ) def get_payload_command(args: Dict[str, Any]) -> CommandResults: event_type = args.get("type", None) timestamp = args.get("timestamp", None) customer_id = args.get("customer_id", None) event_id = args.get("event_id", None) if not event_type: raise ValueError("event type not specified") if not timestamp: raise ValueError("timestamp not specified") if not customer_id: raise ValueError("customer id not specified") if not event_id: raise ValueError("event id not specified") result = get_payload( type=event_type, timestamp=timestamp, customerID=customer_id, eventID=event_id ) readable_output = "# Event payload\n" readable_output += f"Event: {event_id}, type: {result['data']['type']}\n" readable_output += result["data"]["payload"] return CommandResults( readable_output=readable_output, outputs_prefix="Argus.Payload", outputs=result, raw_response=result, ) def get_pcap_command(args: Dict[str, Any]) -> Any: event_type = args.get("type", None) timestamp = args.get("timestamp", None) customer_id = args.get("customer_id", None) event_id = args.get("event_id", None) if not event_type: raise ValueError("event type not specified") if not timestamp: raise ValueError("timestamp not specified") if not customer_id: raise ValueError("customer id not specified") if not event_id: raise ValueError("event id not specified") result = get_pcap( type=event_type, timestamp=timestamp, customerID=customer_id, eventID=event_id ) return fileResult(f"{event_id}_pcap", result.content) def find_nids_events_command(args: Dict[str, Any]) -> CommandResults: # noinspection PyTypeChecker result = find_n_i_d_s_events( skipFutureEvents=args.get("skip_future_events", None), exclude=args.get("exclude", None), eventIdentifier=argToList(args.get("event_identifier", None)), locationID=argToList(args.get("location_id", None)), severity=argToList(args.get("severity", None)), customer=argToList(args.get("customer", None)), alarmID=argToList(args.get("alarm_id", None)), attackCategoryID=argToList(args.get("attack_category_id", None)), sourceGeoCountry=argToList(args.get("source_geo_country", None)), destinationGeoCountry=argToList(args.get("destination_geo_country", None)), geoCountry=argToList(args.get("geo_country", None)), properties=str_to_dict(args.get("properties", None)), exactMatchProperties=args.get("exact_match_properties", None), sensorID=argToList(args.get("sensor_id", None)), subCriteria=argToList(args.get("sub_criteria", None)), signature=argToList(args.get("signature", None)), lastUpdatedTimestamp=args.get("last_updated_timestamp", None), indexStartTime=args.get("index_start_time", None), indexEndTime=args.get("index_end_time", None), destinationIP=argToList(args.get("destination_ip", None)), sourceIP=argToList(args.get("source_ip", None)), ip=argToList(args.get("ip", None)), destinationPort=argToList(args.get("destination_port", None)), sourcePort=argToList(args.get("source_port", None)), port=argToList(args.get("port", None)), minSeverity=args.get("min_severity", None), maxSeverity=args.get("max_severity", None), limit=args.get("limit", 25), offset=args.get("offset", None), includeDeleted=args.get("include_deleted", None), startTimestamp=args.get("start_timestamp", "-24hours"), endTimestamp=args.get("end_timestamp", "now"), sortBy=argToList(args.get("sort_by", None)), includeFlags=argToList(args.get("include_flags", None)), excludeFlags=argToList(args.get("exclude_flags", None)), ) return CommandResults( readable_output=pretty_print_events(dict(result), "# Find NIDS Events\n"), outputs_prefix="Argus.NIDS", outputs=result, raw_response=result, ) def list_nids_events_command(args: Dict[str, Any]) -> CommandResults: result = list_n_i_d_s_events( customerID=args.get("customer_id", None), signature=args.get("signature", None), ip=args.get("ip", None), startTimestamp=args.get("start_timestamp", None), endTimestamp=args.get("end_timestamp", None), limit=args.get("limit", None), offset=args.get("offset", None), ) return CommandResults( readable_output=pretty_print_events(dict(result), "# List NIDS Events\n"), outputs_prefix="Argus.NIDS", outputs=result, raw_response=result, ) def search_records_command(args: Dict[str, Any]) -> CommandResults: query = args.get("query", None) if not query: raise ValueError("query not specified") # noinspection PyTypeChecker result = search_records( query=query, aggregateResult=args.get("aggregate_result", None), includeAnonymousResults=args.get("include_anonymous_results", None), rrClass=argToList(args.get("rr_class", None)), rrType=argToList(args.get("rr_type", None)), customerID=argToList(args.get("customer_id", None)), tlp=argToList((args.get("tlp", None))), limit=args.get("limit", 25), offset=args.get("offset", None), ) return CommandResults( readable_output=tableToMarkdown("PDNS records", result["data"]), outputs_prefix="Argus.PDNS", outputs=result, raw_response=result, ) def fetch_observations_for_domain_command(args: Dict[str, Any]) -> CommandResults: fqdn = args.get("fqdn", None) if not fqdn: raise ValueError("fqdn not specified") result = fetch_observations_for_domain(fqdn=fqdn) return CommandResults( readable_output=tableToMarkdown( f'Domain observations for "{fqdn}"', result["data"] ), outputs_prefix="Argus.ObservationsDomain", outputs=result, raw_response=result, ) def fetch_observations_for_i_p_command(args: Dict[str, Any]) -> CommandResults: ip = args.get("ip", None) if not ip: raise ValueError("ip not specified") result = fetch_observations_for_i_p(ip=ip) return CommandResults( readable_output=tableToMarkdown(f'IP observations for "{ip}"', result["data"]), outputs_prefix="Argus.ObservationsIP", outputs=result, raw_response=result, ) """ MAIN FUNCTION """ def main() -> None: logging.getLogger("argus_cli").setLevel("WARNING") first_fetch_period = parse_first_fetch( demisto.params().get("first_fetch", "-1 day") ) set_argus_settings( demisto.params().get("api_key"), demisto.params().get("api_url"), handle_proxy(), demisto.params().get("insecure", None), ) demisto.debug(f"Command being called is {demisto.command()}") try: if demisto.command() == "test-module": # This is the call made when pressing the integration Test button. return_results(test_module_command()) elif demisto.command() == "fetch-incidents": # Set and define the fetch incidents command to run after activated via integration settings. next_run, incidents = fetch_incidents( last_run=demisto.getLastRun(), first_fetch_period=first_fetch_period, limit=demisto.params().get("max_fetch", 25), min_severity=demisto.params().get("min_severity", "low"), ) demisto.setLastRun(next_run) demisto.incidents(incidents) elif demisto.command() == "argus-add-case-tag": return_results(add_case_tag_command(demisto.args())) elif demisto.command() == "argus-add-comment": return_results(add_comment_command(demisto.args())) elif demisto.command() == "argus-advanced-case-search": return_results(advanced_case_search_command(demisto.args())) elif demisto.command() == "argus-close-case": return_results(close_case_command(demisto.args())) elif demisto.command() == "argus-create-case": return_results(create_case_command(demisto.args())) elif demisto.command() == "argus-delete-case": return_results(delete_case_command(demisto.args())) elif demisto.command() == "argus-delete-comment": return_results(delete_comment_command(demisto.args())) elif demisto.command() == "argus-download-attachment": return_results(download_attachment_command(demisto.args())) elif demisto.command() == "argus-edit-comment": return_results(edit_comment_command(demisto.args())) elif demisto.command() == "argus-get-attachment": return_results(get_attachment_command(demisto.args())) elif demisto.command() == "argus-get-case-metadata-by-id": return_results(get_case_metadata_by_id_command(demisto.args())) elif demisto.command() == "argus-list-case-attachments": return_results(list_case_attachments_command(demisto.args())) elif demisto.command() == "argus-list-case-tags": return_results(list_case_tags_command(demisto.args())) elif demisto.command() == "argus-list-case-comments": return_results(list_case_comments_command(demisto.args())) elif demisto.command() == "argus-remove-case-tag-by-id": return_results(remove_case_tag_by_id_command(demisto.args())) elif demisto.command() == "argus-remove-case-tag-by-key-value": return_results(remove_case_tag_by_key_value_command(demisto.args())) elif demisto.command() == "argus-update-case": return_results(update_case_command(demisto.args())) elif demisto.command() == "argus-get-event": return_results(get_event_command(demisto.args())) elif demisto.command() == "argus-get-events-for-case": return_results(get_events_for_case_command(demisto.args())) elif demisto.command() == "argus-find-aggregated-events": return_results(find_aggregated_events_command(demisto.args())) elif demisto.command() == "argus-list-aggregated-events": return_results(list_aggregated_events_command(demisto.args())) elif demisto.command() == "argus-get-payload": return_results(get_payload_command(demisto.args())) elif demisto.command() == "argus-get-pcap": return_results(get_pcap_command(demisto.args())) elif demisto.command() == "argus-find-nids-events": return_results(find_nids_events_command(demisto.args())) elif demisto.command() == "argus-list-nids-events": return_results(list_nids_events_command(demisto.args())) elif demisto.command() == "argus-pdns-search-records": return_results(search_records_command(demisto.args())) elif demisto.command() == "argus-fetch-observations-for-domain": return_results(fetch_observations_for_domain_command(demisto.args())) elif demisto.command() == "argus-fetch-observations-for-ip": return_results(fetch_observations_for_i_p_command(demisto.args())) # Log exceptions and return errors except Exception as e: demisto.error(traceback.format_exc()) # print the traceback return_error( f"Failed to execute {demisto.command()} command.\nError:\n{str(e)}" ) """ ENTRY POINT """ if __name__ in ("__main__", "__builtin__", "builtins"): main()
[ 1, 1053, 1261, 391, 290, 1698, 408, 1261, 5137, 13, 3166, 13103, 6004, 11980, 1053, 334, 13, 13, 15945, 29908, 306, 3580, 8476, 29903, 9995, 13, 13, 5215, 4390, 13, 5215, 3142, 1982, 29941, 13, 13, 5215, 2635, 16680, 13, 5215, 9637, 1627, 13, 3166, 19229, 1053, 3139, 29892, 360, 919, 29892, 2391, 29892, 7761, 13, 13, 5215, 12183, 13, 13, 3166, 1852, 375, 29918, 2754, 1053, 4867, 408, 1852, 375, 29918, 7924, 13, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 3784, 1792, 29889, 29894, 29896, 29889, 1792, 1053, 679, 29918, 3784, 29918, 1792, 13, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 11436, 29889, 29894, 29906, 29889, 4878, 1053, 313, 13, 1678, 788, 29918, 4878, 29918, 4039, 29892, 13, 1678, 788, 29918, 9342, 29892, 13, 1678, 12862, 29918, 4878, 29918, 4478, 29892, 13, 1678, 3802, 29918, 4878, 29892, 13, 1678, 1653, 29918, 4878, 29892, 13, 1678, 5217, 29918, 4878, 29892, 13, 1678, 5217, 29918, 9342, 29892, 13, 1678, 5142, 29918, 14930, 358, 29892, 13, 1678, 3863, 29918, 9342, 29892, 13, 1678, 679, 29918, 14930, 358, 29892, 13, 1678, 679, 29918, 4878, 29918, 19635, 29918, 1609, 29918, 333, 29892, 13, 1678, 1051, 29918, 4878, 29918, 14930, 1860, 29892, 13, 1678, 1051, 29918, 4878, 29918, 11338, 29892, 13, 1678, 1051, 29918, 4878, 29918, 21032, 29892, 13, 1678, 3349, 29918, 4878, 29918, 4039, 29918, 1609, 29918, 333, 29892, 13, 1678, 3349, 29918, 4878, 29918, 4039, 29918, 1609, 29918, 1989, 29918, 1767, 29892, 13, 1678, 2767, 29918, 4878, 29892, 13, 29897, 13, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 13604, 29889, 29894, 29896, 1053, 679, 29918, 3696, 29918, 1609, 29918, 2084, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 13604, 29889, 29894, 29896, 29889, 4878, 29889, 4878, 1053, 679, 29918, 13604, 29918, 1454, 29918, 4878, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 13604, 29889, 29894, 29896, 29889, 26193, 630, 1053, 313, 13, 1678, 1284, 29918, 26193, 630, 29918, 13604, 29892, 13, 1678, 1051, 29918, 26193, 630, 29918, 13604, 29892, 13, 29897, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 13604, 29889, 29894, 29896, 29889, 23813, 1053, 679, 29918, 23813, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 13604, 29889, 29894, 29896, 29889, 29886, 5030, 1053, 679, 29918, 29886, 5030, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 13604, 29889, 29894, 29896, 29889, 29876, 4841, 1053, 1284, 29918, 29876, 29918, 29875, 29918, 29881, 29918, 29879, 29918, 13604, 29892, 1051, 29918, 29876, 29918, 29875, 29918, 29881, 29918, 29879, 29918, 13604, 13, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 15926, 1983, 29889, 29894, 29941, 29889, 4478, 1053, 2740, 29918, 3757, 4339, 13, 13, 3166, 1852, 375, 29918, 2754, 29889, 2754, 29889, 276, 14584, 29889, 29894, 29896, 29889, 26739, 362, 1053, 313, 13, 1678, 6699, 29918, 26739, 800, 29918, 1454, 29918, 7247, 29892, 13, 1678, 6699, 29918, 26739, 800, 29918, 1454, 29918, 29875, 29918, 29886, 29892, 13, 29897, 13, 13, 29937, 3295, 519, 297, 24216, 18116, 13, 2271, 1982, 29941, 29889, 20472, 29918, 25442, 886, 580, 13, 13, 15945, 29908, 8707, 1254, 2190, 9375, 9995, 13, 13, 6248, 29918, 19094, 1299, 353, 11860, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 16664, 29903, 29999, 29908, 13, 15094, 29911, 15631, 29918, 6248, 29918, 19094, 1299, 353, 11860, 29890, 1273, 29881, 29892, 1273, 29979, 29892, 1273, 29950, 16664, 29924, 16664, 29903, 29908, 13, 29943, 2544, 3210, 29918, 16881, 353, 1261, 5137, 29889, 7529, 2141, 657, 703, 9155, 29918, 4039, 1159, 13, 13, 13, 15945, 29908, 379, 6670, 13171, 383, 28700, 29903, 9995, 13, 13, 13, 1753, 731, 29918, 1191, 375, 29918, 11027, 29898, 13, 1678, 7882, 29918, 1989, 29901, 851, 29892, 2967, 29918, 2271, 29901, 851, 353, 6213, 29892, 410, 29916, 583, 29901, 9657, 353, 6213, 29892, 11539, 29901, 6120, 353, 6213, 13, 1125, 13, 1678, 1852, 375, 29918, 7924, 29889, 2754, 29918, 1989, 353, 7882, 29918, 1989, 13, 1678, 1852, 375, 29918, 7924, 29889, 3188, 29918, 2271, 353, 2967, 29918, 2271, 13, 1678, 1852, 375, 29918, 7924, 29889, 771, 29916, 583, 353, 410, 29916, 583, 13, 1678, 1852, 375, 29918, 7924, 29889, 27902, 353, 11539, 13, 13, 13, 1753, 1852, 375, 29918, 29886, 21766, 29918, 517, 29918, 2310, 5137, 29918, 344, 369, 537, 29898, 29886, 21766, 29901, 851, 29897, 1599, 938, 29901, 13, 1678, 10417, 353, 8853, 677, 1115, 29871, 29896, 29892, 376, 27891, 1115, 29871, 29906, 29892, 376, 9812, 1115, 29871, 29941, 29892, 376, 9695, 936, 1115, 29871, 29946, 29913, 13, 1678, 736, 10417, 29889, 657, 29898, 29886, 21766, 29892, 29871, 29900, 29897, 13, 13, 13, 1753, 1852, 375, 29918, 4882, 29918, 517, 29918, 2310, 5137, 29918, 4882, 29898, 4882, 29901, 851, 29897, 1599, 938, 29901, 13, 1678, 10417, 353, 426, 13, 4706, 376, 29886, 2548, 15122, 1115, 29871, 29900, 29892, 13, 4706, 376, 29886, 2548, 29903, 542, 1115, 29871, 29900, 29892, 13, 4706, 376, 29886, 2548, 29963, 12184, 1115, 29871, 29900, 29892, 13, 4706, 376, 29886, 2548, 11123, 1115, 29871, 29900, 29892, 13, 4706, 376, 22899, 29903, 542, 1115, 29871, 29896, 29892, 13, 4706, 376, 22899, 15122, 1115, 29871, 29896, 29892, 13, 4706, 376, 15603, 1115, 29871, 29906, 29892, 13, 1678, 500, 13, 1678, 736, 10417, 29889, 657, 29898, 4882, 29892, 29871, 29900, 29897, 13, 13, 13, 1753, 2048, 29918, 1191, 375, 29918, 29886, 21766, 29918, 3166, 29918, 1195, 29918, 344, 369, 537, 29898, 1195, 29918, 344, 369, 537, 29901, 851, 29897, 1599, 2391, 29961, 710, 5387, 13, 1678, 2775, 1907, 353, 6796, 677, 613, 376, 27891, 613, 376, 9812, 613, 376, 9695, 936, 3108, 13, 1678, 1375, 29918, 344, 369, 537, 29918, 1761, 353, 5159, 13, 1678, 363, 2775, 537, 297, 2775, 1907, 29901, 13, 4706, 565, 1852, 375, 29918, 29886, 21766, 29918, 517, 29918, 2310, 5137, 29918, 344, 369, 537, 29898, 13, 9651, 1375, 29918, 344, 369, 537, 29889, 13609, 580, 13, 4706, 1723, 5277, 1852, 375, 29918, 29886, 21766, 29918, 517, 29918, 2310, 5137, 29918, 344, 369, 537, 29898, 344, 369, 537, 1125, 13, 9651, 1375, 29918, 344, 369, 537, 29918, 1761, 29889, 4397, 29898, 344, 369, 537, 29897, 13, 1678, 736, 1375, 29918, 344, 369, 537, 29918, 1761, 13, 13, 13, 1753, 6088, 29918, 4102, 29918, 9155, 29898, 4102, 29918, 9155, 29901, 3139, 29897, 1599, 3139, 29901, 13, 1678, 565, 338, 8758, 29898, 4102, 29918, 9155, 29892, 851, 1125, 13, 4706, 565, 937, 29918, 9155, 29961, 29900, 29962, 2804, 11663, 1115, 13, 9651, 937, 29918, 9155, 353, 285, 29908, 29899, 29912, 4102, 29918, 9155, 5038, 13, 1678, 736, 937, 29918, 9155, 13, 13, 13, 1753, 2048, 29918, 11338, 29918, 3166, 29918, 1761, 29898, 20155, 29901, 1051, 29897, 1599, 2391, 29961, 21533, 5387, 13, 1678, 565, 451, 24471, 29901, 13, 4706, 736, 5159, 13, 1678, 565, 7431, 29898, 20155, 29897, 1273, 29871, 29906, 2804, 29871, 29900, 29901, 13, 4706, 736, 5159, 13, 1678, 8282, 353, 5159, 13, 1678, 363, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 20155, 511, 29871, 29906, 1125, 13, 4706, 8282, 29889, 4397, 3319, 29908, 1989, 1115, 24471, 29961, 29875, 1402, 376, 1767, 1115, 24471, 29961, 29875, 718, 29871, 29896, 29962, 1800, 13, 1678, 736, 8282, 13, 13, 13, 1753, 851, 29918, 517, 29918, 8977, 29898, 1807, 29901, 851, 29897, 1599, 9657, 29901, 13, 1678, 565, 451, 1347, 29901, 13, 4706, 736, 6571, 13, 1678, 24471, 353, 1852, 21254, 29898, 1807, 29897, 13, 1678, 565, 7431, 29898, 20155, 29897, 1273, 29871, 29906, 2804, 29871, 29900, 29901, 13, 4706, 736, 6571, 13, 1678, 736, 426, 20155, 29961, 29875, 5387, 24471, 29961, 29875, 718, 29871, 29896, 29962, 363, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 20155, 511, 29871, 29906, 2915, 13, 13, 13, 1753, 2635, 29918, 2230, 29918, 517, 29918, 1022, 2878, 29918, 19958, 21462, 29898, 1256, 29918, 2230, 29901, 7761, 29961, 12673, 29892, 851, 29962, 353, 6213, 29897, 1599, 938, 29901, 13, 1678, 565, 338, 8758, 29898, 1256, 29918, 2230, 29892, 12865, 1125, 13, 4706, 736, 938, 29898, 1256, 29918, 2230, 29889, 16394, 580, 334, 29871, 29896, 29900, 29900, 29900, 29897, 13, 1678, 565, 338, 8758, 29898, 1256, 29918, 2230, 29892, 851, 1125, 13, 4706, 736, 2635, 29918, 2230, 29918, 517, 29918, 1022, 2878, 29918, 19958, 21462, 29898, 1256, 16680, 29889, 5510, 29898, 1256, 29918, 2230, 876, 13, 1678, 736, 938, 29898, 12673, 29889, 3707, 2141, 16394, 580, 334, 29871, 29896, 29900, 29900, 29900, 29897, 13, 13, 13, 1753, 5051, 29918, 2158, 29918, 1256, 29898, 1256, 29918, 2230, 29901, 7761, 29961, 12673, 29892, 851, 29962, 353, 6213, 29897, 1599, 851, 29901, 13, 1678, 565, 338, 8758, 29898, 1256, 29918, 2230, 29892, 12865, 1125, 13, 4706, 736, 2635, 29918, 2230, 29889, 710, 615, 603, 29898, 15094, 29911, 15631, 29918, 6248, 29918, 19094, 1299, 29897, 13, 1678, 565, 338, 8758, 29898, 1256, 29918, 2230, 29892, 851, 1125, 13, 4706, 736, 5051, 29918, 2158, 29918, 1256, 29898, 1256, 16680, 29889, 5510, 29898, 1256, 29918, 2230, 876, 13, 1678, 736, 12865, 29889, 3707, 2141, 710, 615, 603, 29898, 15094, 29911, 15631, 29918, 6248, 29918, 19094, 1299, 29897, 13, 13, 13, 1753, 5051, 29918, 2158, 29918, 4878, 29918, 19635, 29898, 2914, 29901, 9657, 29892, 3611, 29901, 851, 353, 6213, 29897, 1599, 851, 29901, 13, 1678, 848, 353, 1121, 3366, 1272, 3108, 13, 1678, 1347, 353, 3611, 565, 3611, 1683, 285, 29908, 29937, 24037, 1272, 1839, 333, 2033, 6177, 426, 1272, 1839, 16009, 2033, 1012, 29876, 29908, 13, 1678, 1347, 4619, 11119, 29925, 21766, 29901, 24335, 4660, 29901, 24335, 1833, 4784, 29901, 426, 12806, 29876, 1642, 4830, 29898, 13, 4706, 848, 3366, 29886, 21766, 12436, 848, 3366, 4882, 12436, 5051, 29918, 2158, 29918, 1256, 29898, 1272, 3366, 4230, 29248, 2481, 20068, 13, 1678, 1723, 13, 1678, 1347, 4619, 376, 13020, 287, 491, 6571, 472, 426, 1012, 29876, 29905, 29876, 1642, 4830, 29898, 13, 4706, 848, 3366, 5467, 3726, 2059, 2659, 3108, 3366, 978, 12436, 5051, 29918, 2158, 29918, 1256, 29898, 1272, 3366, 5467, 3726, 2481, 20068, 13, 1678, 1723, 13, 1678, 1347, 4619, 848, 3366, 8216, 3108, 13, 1678, 736, 1347, 13, 13, 13, 1753, 5051, 29918, 2158, 29918, 9342, 29898, 9342, 29901, 9657, 29892, 3611, 29901, 851, 353, 6213, 29897, 1599, 851, 29901, 13, 1678, 1347, 353, 3611, 565, 3611, 1683, 5124, 13, 1678, 1347, 4619, 285, 29908, 4136, 334, 29912, 9342, 1839, 23959, 2059, 2659, 16215, 1792, 1170, 2033, 29913, 448, 426, 1457, 4349, 29918, 2158, 29918, 1256, 29898, 9342, 1839, 23959, 2481, 2033, 2915, 17710, 29876, 29908, 13, 1678, 1347, 4619, 313, 13, 4706, 285, 29908, 29918, 8897, 4784, 426, 1457, 4349, 29918, 2158, 29918, 1256, 29898, 9342, 1839, 4230, 29248, 2481, 11287, 12806, 29876, 29908, 13, 4706, 565, 3440, 3366, 4230, 29248, 2481, 3108, 13, 4706, 1683, 5124, 13, 1678, 1723, 13, 1678, 1347, 4619, 285, 29908, 29912, 9342, 1839, 9342, 2033, 1012, 29876, 29905, 29876, 29908, 13, 1678, 1347, 4619, 285, 29908, 29918, 333, 29901, 426, 9342, 1839, 333, 2033, 12806, 29876, 29908, 13, 1678, 1347, 4619, 285, 29908, 29918, 15675, 29901, 426, 710, 29898, 9342, 1839, 15764, 11287, 12806, 29876, 29908, 565, 3440, 3366, 15764, 3108, 1683, 5124, 13, 1678, 1347, 4619, 26345, 334, 334, 29905, 29876, 29908, 13, 1678, 736, 1347, 13, 13, 13, 1753, 5051, 29918, 2158, 29918, 21032, 29898, 21032, 29901, 1051, 29892, 3611, 29901, 851, 353, 6213, 29897, 1599, 851, 29901, 13, 1678, 1347, 353, 3611, 565, 3611, 1683, 5124, 13, 1678, 363, 3440, 297, 6589, 29901, 13, 4706, 1347, 4619, 5051, 29918, 2158, 29918, 9342, 29898, 9342, 29897, 13, 1678, 736, 1347, 13, 13, 13, 1753, 5051, 29918, 2158, 29918, 13604, 29898, 2914, 29901, 9657, 29892, 3611, 29901, 851, 353, 6213, 29897, 1599, 851, 29901, 13, 1678, 1347, 353, 3611, 565, 3611, 1683, 5124, 13, 1678, 1347, 4619, 11119, 3981, 29901, 24335, 6445, 6571, 4959, 29892, 515, 6571, 304, 426, 12806, 29876, 1642, 4830, 29898, 13, 4706, 1121, 3366, 2798, 12436, 1121, 3366, 2311, 12436, 1121, 3366, 10289, 12436, 1121, 3366, 13400, 3108, 13, 1678, 1723, 13, 1678, 1347, 4619, 1591, 1762, 9802, 3204, 703, 13634, 613, 1121, 3366, 1272, 20068, 13, 1678, 736, 1347, 13, 13, 13, 15945, 29908, 23353, 1529, 2797, 383, 28700, 29903, 9995, 13, 13, 13, 1753, 1243, 29918, 5453, 29918, 6519, 580, 1599, 851, 29901, 13, 1678, 2933, 353, 679, 29918, 3784, 29918, 1792, 580, 13, 1678, 565, 2933, 3366, 5327, 3399, 3108, 1275, 29871, 29906, 29900, 29900, 29901, 13, 4706, 736, 376, 554, 29908, 13, 1678, 736, 313, 13, 4706, 285, 29908, 2525, 519, 304, 23120, 411, 11842, 375, 3450, 426, 5327, 1839, 5327, 3399, 2033, 1118, 426, 5327, 5038, 13, 1678, 1723, 13, 13, 13, 1753, 6699, 29918, 3742, 16719, 29898, 13, 1678, 1833, 29918, 3389, 29901, 9657, 29892, 937, 29918, 9155, 29918, 19145, 29901, 851, 29892, 4046, 29901, 938, 353, 29871, 29906, 29945, 29892, 1375, 29918, 344, 369, 537, 29901, 851, 353, 376, 677, 29908, 13, 1125, 13, 1678, 1369, 29918, 16394, 353, 1833, 29918, 3389, 29889, 657, 703, 2962, 29918, 2230, 613, 6213, 29897, 565, 1833, 29918, 3389, 1683, 6213, 13, 1678, 396, 694, 1144, 27988, 10772, 1542, 5596, 261, 13, 1678, 1121, 353, 12862, 29918, 4878, 29918, 4478, 29898, 13, 4706, 1369, 27939, 29922, 2962, 29918, 16394, 565, 1369, 29918, 16394, 1683, 937, 29918, 9155, 29918, 19145, 29892, 13, 4706, 1095, 27939, 543, 3707, 613, 13, 4706, 4046, 29922, 13400, 29892, 13, 4706, 2656, 2059, 29922, 3366, 11600, 27939, 12436, 13, 4706, 20136, 29922, 4282, 29918, 1191, 375, 29918, 29886, 21766, 29918, 3166, 29918, 1195, 29918, 344, 369, 537, 29898, 1195, 29918, 344, 369, 537, 511, 13, 4706, 1014, 29907, 21977, 11759, 13, 9651, 8853, 735, 2325, 1115, 5852, 29892, 376, 4882, 1115, 6796, 15603, 3108, 1118, 13, 4706, 21251, 13, 4706, 931, 3073, 26910, 29922, 3366, 11600, 27939, 12436, 13, 1678, 1723, 13, 1678, 5528, 16719, 353, 5159, 13, 1678, 363, 1206, 297, 1121, 3366, 1272, 3108, 29901, 13, 4706, 5528, 16719, 29889, 4397, 29898, 13, 9651, 426, 13, 18884, 376, 978, 1115, 285, 29908, 26660, 4878, 1839, 333, 2033, 6177, 426, 4878, 1839, 16009, 2033, 17671, 13, 18884, 376, 542, 2764, 1127, 1115, 1206, 3366, 11600, 2481, 12436, 13, 18884, 376, 344, 369, 537, 1115, 1852, 375, 29918, 29886, 21766, 29918, 517, 29918, 2310, 5137, 29918, 344, 369, 537, 29898, 4878, 3366, 29886, 21766, 3108, 511, 13, 18884, 376, 4882, 1115, 1852, 375, 29918, 4882, 29918, 517, 29918, 2310, 5137, 29918, 4882, 29898, 4878, 3366, 4882, 3108, 511, 13, 18884, 376, 14144, 1115, 1206, 3366, 8216, 12436, 13, 18884, 376, 6341, 14256, 1115, 426, 13, 462, 1678, 376, 1191, 375, 29918, 333, 1115, 851, 29898, 4878, 3366, 333, 3108, 511, 13, 462, 1678, 376, 1853, 1115, 1206, 3366, 1853, 12436, 13, 462, 1678, 376, 7320, 1115, 1206, 3366, 7320, 3108, 3366, 978, 3108, 565, 1206, 3366, 7320, 3108, 1683, 6213, 29892, 13, 462, 1678, 376, 5509, 1115, 1206, 3366, 5509, 3108, 3366, 978, 12436, 13, 462, 1678, 376, 4230, 29248, 2481, 1115, 1206, 3366, 4230, 29248, 2481, 12436, 13, 462, 1678, 376, 11600, 27939, 1115, 1206, 3366, 11600, 27939, 12436, 13, 462, 1678, 376, 15539, 1115, 1206, 3366, 15539, 3108, 3366, 12759, 1170, 12436, 13, 18884, 2981, 13, 18884, 376, 1610, 7249, 1115, 4390, 29889, 29881, 17204, 29898, 4878, 511, 13, 9651, 500, 13, 4706, 1723, 13, 1678, 565, 1121, 3366, 1272, 3108, 29901, 13, 4706, 1833, 29918, 3389, 3366, 2962, 29918, 2230, 3108, 353, 851, 29898, 2914, 3366, 1272, 3108, 14352, 29896, 29962, 3366, 11600, 27939, 3108, 718, 29871, 29896, 29897, 13, 13, 1678, 736, 1833, 29918, 3389, 29892, 5528, 16719, 13, 13, 13, 1753, 788, 29918, 4878, 29918, 4039, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 1820, 353, 6389, 29889, 657, 703, 1989, 613, 6213, 29897, 13, 1678, 995, 353, 6389, 29889, 657, 703, 1767, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 29918, 333, 451, 6790, 1159, 13, 1678, 565, 451, 1820, 29901, 13, 4706, 12020, 7865, 2392, 703, 1989, 451, 6790, 1159, 13, 1678, 565, 451, 995, 29901, 13, 4706, 12020, 7865, 2392, 703, 1767, 451, 6790, 1159, 13, 13, 1678, 4055, 353, 8853, 1989, 1115, 1820, 29892, 376, 1767, 1115, 995, 29913, 13, 1678, 1121, 353, 788, 29918, 4878, 29918, 4039, 29898, 4878, 1367, 29922, 4878, 29918, 333, 29892, 8282, 29922, 4039, 29897, 13, 1678, 9066, 353, 6796, 1989, 613, 376, 1767, 613, 376, 23959, 2481, 3108, 13, 1678, 19909, 29918, 4905, 353, 1591, 1762, 9802, 3204, 29898, 13, 4706, 285, 29908, 26660, 4878, 29918, 333, 6177, 917, 613, 1121, 3366, 1272, 12436, 9066, 29922, 13662, 13, 1678, 1723, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 28089, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 788, 29918, 9342, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 3440, 353, 6389, 29889, 657, 703, 9342, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 29918, 333, 451, 6790, 1159, 13, 1678, 565, 451, 3440, 29901, 13, 4706, 12020, 7865, 2392, 703, 9342, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 788, 29918, 9342, 29898, 13, 4706, 1206, 1367, 29922, 4878, 29918, 333, 29892, 13, 4706, 3440, 29922, 9342, 29892, 13, 4706, 408, 5612, 368, 1762, 29922, 5085, 29889, 657, 703, 294, 29918, 3445, 368, 29918, 517, 613, 6213, 511, 13, 4706, 7463, 29922, 5085, 29889, 657, 703, 7564, 613, 6213, 511, 13, 4706, 3978, 9823, 7061, 29922, 5085, 29889, 657, 703, 12574, 29918, 5269, 29918, 7328, 613, 6213, 511, 13, 4706, 6942, 4165, 25117, 1367, 29922, 5085, 29889, 657, 703, 21264, 630, 29918, 14930, 358, 29918, 333, 613, 6213, 511, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 9342, 29898, 13, 9651, 1121, 3366, 1272, 12436, 285, 29908, 29937, 24037, 4878, 29918, 333, 6177, 25601, 3440, 29905, 29876, 29908, 13, 4706, 10353, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 20001, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 12862, 29918, 4878, 29918, 4478, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 396, 694, 1144, 27988, 10772, 1542, 5596, 261, 13, 1678, 1121, 353, 12862, 29918, 4878, 29918, 4478, 29898, 13, 4706, 1369, 27939, 29922, 5085, 29889, 657, 703, 2962, 29918, 16394, 613, 6213, 511, 13, 4706, 1095, 27939, 29922, 5085, 29889, 657, 703, 355, 29918, 16394, 613, 6213, 511, 13, 4706, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 6213, 511, 13, 4706, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 511, 13, 4706, 3160, 2772, 22742, 29922, 5085, 29889, 657, 703, 2856, 29918, 311, 22742, 613, 6213, 511, 13, 4706, 1014, 29907, 21977, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1491, 29918, 29883, 21977, 613, 6213, 8243, 13, 4706, 19060, 29922, 5085, 29889, 657, 703, 735, 2325, 613, 6213, 511, 13, 4706, 3734, 29922, 5085, 29889, 657, 703, 12403, 613, 6213, 511, 13, 4706, 11962, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 15539, 29918, 333, 613, 6213, 8243, 13, 4706, 1206, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 8243, 13, 4706, 11962, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 15539, 613, 6213, 8243, 13, 4706, 1134, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4878, 29918, 1853, 613, 6213, 8243, 13, 4706, 2669, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 5509, 613, 6213, 8243, 13, 4706, 7663, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 7320, 613, 6213, 8243, 13, 4706, 4660, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4882, 613, 6213, 8243, 13, 4706, 20136, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 29886, 21766, 613, 6213, 8243, 13, 4706, 24342, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 24129, 29918, 333, 613, 6213, 8243, 13, 4706, 4055, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4039, 613, 6213, 8243, 13, 4706, 27321, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1287, 1731, 613, 6213, 8243, 13, 4706, 1746, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 2671, 613, 6213, 8243, 13, 4706, 29361, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1989, 9303, 613, 6213, 8243, 13, 4706, 931, 3073, 26910, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 2230, 29918, 2671, 29918, 710, 8963, 613, 6213, 8243, 13, 4706, 931, 9652, 26910, 29922, 5085, 29889, 657, 703, 2230, 29918, 4352, 29918, 710, 8963, 613, 6213, 511, 13, 4706, 13553, 3073, 26910, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 26766, 29918, 2671, 29918, 710, 8963, 613, 6213, 8243, 13, 4706, 13553, 9652, 26910, 29922, 5085, 29889, 657, 703, 26766, 29918, 4352, 29918, 710, 8963, 613, 6213, 511, 13, 4706, 1404, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1792, 613, 6213, 8243, 13, 4706, 1404, 3073, 26910, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1792, 29918, 2671, 29918, 710, 8963, 613, 6213, 8243, 13, 4706, 1404, 7900, 12961, 29922, 5085, 29889, 657, 703, 1792, 29918, 465, 12961, 613, 6213, 511, 13, 4706, 734, 305, 7900, 12961, 29922, 5085, 29889, 657, 703, 11345, 29918, 465, 12961, 613, 6213, 511, 13, 4706, 3160, 5531, 1731, 29879, 29922, 5085, 29889, 657, 703, 2856, 29918, 1287, 1731, 29879, 613, 6213, 511, 13, 4706, 3160, 9868, 29922, 5085, 29889, 657, 703, 2856, 29918, 8216, 613, 6213, 511, 13, 4706, 2130, 6818, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 5943, 29918, 8513, 613, 6213, 8243, 13, 4706, 6261, 6638, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4548, 4019, 29918, 5943, 613, 6213, 8243, 13, 4706, 2656, 2059, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 6605, 29918, 1609, 613, 6213, 8243, 13, 4706, 3160, 15675, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 2856, 29918, 15764, 613, 6213, 8243, 13, 4706, 19060, 15675, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 735, 2325, 29918, 15764, 613, 6213, 8243, 13, 1678, 1723, 13, 1678, 19909, 29918, 4905, 353, 285, 29908, 3253, 16858, 11733, 11856, 29901, 426, 2914, 1839, 2798, 2033, 29913, 1121, 29898, 29879, 2144, 29876, 29908, 13, 1678, 19909, 29918, 4905, 4619, 1591, 1762, 9802, 3204, 29898, 13, 4706, 376, 6466, 451, 13907, 363, 1708, 2057, 613, 1121, 3366, 1272, 3108, 13, 1678, 1723, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 29907, 2129, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 3802, 29918, 4878, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 29918, 333, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 3802, 29918, 4878, 29898, 13, 4706, 1206, 1367, 29922, 4878, 29918, 333, 29892, 13, 4706, 3440, 29922, 5085, 29889, 657, 703, 9342, 613, 6213, 511, 13, 1678, 1723, 13, 1678, 19909, 29918, 4905, 353, 285, 29908, 29937, 24037, 4878, 29918, 333, 6177, 3802, 1206, 29905, 29876, 29908, 13, 1678, 19909, 29918, 4905, 4619, 313, 13, 4706, 285, 29908, 29918, 5709, 29901, 426, 2914, 1839, 1272, 16215, 4882, 2033, 1118, 472, 29901, 426, 2914, 1839, 1272, 16215, 15603, 2481, 2033, 2403, 29908, 13, 1678, 1723, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 8259, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 1653, 29918, 4878, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 4967, 353, 6389, 29889, 657, 703, 16009, 613, 6213, 29897, 13, 1678, 6139, 353, 6389, 29889, 657, 703, 8216, 613, 6213, 29897, 13, 1678, 2669, 353, 6389, 29889, 657, 703, 5509, 613, 6213, 29897, 13, 1678, 1206, 29918, 1853, 353, 6389, 29889, 657, 703, 1853, 613, 6213, 29897, 13, 1678, 8282, 353, 6389, 29889, 657, 703, 11338, 613, 6213, 29897, 13, 1678, 565, 451, 4967, 29901, 13, 4706, 12020, 7865, 2392, 703, 16009, 451, 6790, 1159, 13, 1678, 565, 451, 6139, 29901, 13, 4706, 12020, 7865, 2392, 703, 8216, 451, 6790, 1159, 13, 1678, 565, 451, 2669, 29901, 13, 4706, 12020, 7865, 2392, 703, 5509, 451, 6790, 1159, 13, 1678, 565, 451, 1206, 29918, 1853, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 29918, 1853, 451, 6790, 1159, 13, 1678, 565, 8282, 29901, 13, 4706, 8282, 353, 851, 29898, 11338, 467, 5451, 28165, 1159, 13, 4706, 565, 7431, 29898, 11338, 29897, 1273, 29871, 29906, 2804, 29871, 29900, 29901, 13, 9651, 12020, 7865, 2392, 703, 11338, 1051, 1818, 367, 310, 1584, 1353, 613, 8282, 29897, 13, 4706, 8282, 353, 2048, 29918, 11338, 29918, 3166, 29918, 1761, 29898, 11338, 29897, 13, 13, 1678, 1121, 353, 1653, 29918, 4878, 29898, 13, 4706, 11962, 29922, 5085, 29889, 657, 703, 15539, 613, 6213, 511, 13, 4706, 2669, 29922, 5509, 29892, 13, 4706, 7663, 29922, 5085, 29889, 657, 703, 7320, 613, 6213, 511, 13, 4706, 1134, 29922, 4878, 29918, 1853, 29892, 13, 4706, 4660, 29922, 5085, 29889, 657, 703, 4882, 613, 6213, 511, 13, 4706, 8282, 29922, 11338, 29892, 13, 4706, 4967, 29922, 16009, 29892, 13, 4706, 6139, 29922, 8216, 29892, 13, 4706, 11962, 7422, 29922, 5085, 29889, 657, 703, 15539, 29918, 5679, 613, 6213, 511, 13, 4706, 20136, 29922, 5085, 29889, 657, 703, 29886, 21766, 613, 6213, 511, 13, 4706, 2130, 6818, 29922, 5085, 29889, 657, 703, 5943, 29918, 8513, 613, 6213, 511, 13, 4706, 3978, 9823, 7061, 29922, 5085, 29889, 657, 703, 12574, 29918, 5269, 29918, 7328, 613, 6213, 511, 13, 4706, 9805, 29922, 5085, 29889, 657, 703, 23679, 613, 6213, 511, 13, 4706, 2322, 24709, 414, 29922, 5085, 29889, 657, 703, 4381, 29918, 12344, 414, 613, 6213, 511, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 4878, 29918, 19635, 29898, 2914, 511, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 8259, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 5217, 29918, 4878, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 5217, 29918, 4878, 29898, 4878, 1367, 29922, 4878, 29918, 333, 29897, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 4878, 29918, 19635, 29898, 2914, 29892, 376, 8259, 11132, 4968, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 8259, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 5217, 29918, 9342, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 3440, 29918, 333, 353, 6389, 29889, 657, 703, 9342, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 3440, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 9342, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 5217, 29918, 9342, 29898, 4878, 1367, 29922, 4878, 29918, 333, 29892, 3440, 1367, 29922, 9342, 29918, 333, 29897, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 9342, 29898, 13, 9651, 1121, 3366, 1272, 12436, 285, 29908, 29937, 24037, 4878, 29918, 333, 6177, 897, 22742, 3440, 29905, 29876, 29908, 13, 4706, 10353, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 20001, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 5142, 29918, 14930, 358, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 3139, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 26305, 29918, 333, 353, 6389, 29889, 657, 703, 14930, 358, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 26305, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 14930, 358, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 5142, 29918, 14930, 358, 29898, 4878, 1367, 29922, 4878, 29918, 333, 29892, 26305, 1367, 29922, 14930, 358, 29918, 333, 29897, 13, 13, 1678, 736, 934, 3591, 29898, 14930, 358, 29918, 333, 29892, 1121, 29889, 3051, 29897, 13, 13, 13, 1753, 3863, 29918, 9342, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 3440, 29918, 333, 353, 6389, 29889, 657, 703, 9342, 29918, 333, 613, 6213, 29897, 13, 1678, 3440, 353, 6389, 29889, 657, 703, 9342, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 3440, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 9342, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 3440, 29901, 13, 4706, 12020, 7865, 2392, 703, 9342, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 3863, 29918, 9342, 29898, 4878, 1367, 29922, 4878, 29918, 333, 29892, 3440, 1367, 29922, 9342, 29918, 333, 29892, 3440, 29922, 9342, 29897, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 9342, 29898, 13, 9651, 1121, 3366, 1272, 12436, 285, 29908, 29937, 24037, 4878, 29918, 333, 6177, 25723, 3440, 29905, 29876, 29908, 13, 4706, 10353, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 20001, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 679, 29918, 14930, 358, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 26305, 29918, 333, 353, 6389, 29889, 657, 703, 14930, 358, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 26305, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 14930, 358, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 679, 29918, 14930, 358, 29898, 4878, 1367, 29922, 4878, 29918, 333, 29892, 26305, 1367, 29922, 14930, 358, 29918, 333, 29897, 13, 1678, 19909, 29918, 4905, 353, 285, 29908, 29937, 24037, 4878, 29918, 333, 6177, 26305, 15562, 29905, 29876, 29908, 13, 1678, 19909, 29918, 4905, 4619, 285, 29908, 4136, 334, 29912, 2914, 1839, 1272, 16215, 23959, 2059, 2659, 16215, 1792, 1170, 2033, 29913, 448, 426, 2914, 1839, 1272, 16215, 23959, 2481, 2033, 29913, 17710, 29876, 29908, 13, 1678, 19909, 29918, 4905, 4619, 285, 29908, 29912, 2914, 1839, 1272, 16215, 978, 2033, 29913, 21313, 2914, 1839, 1272, 16215, 29885, 603, 1542, 2033, 1118, 426, 2914, 1839, 1272, 16215, 2311, 2033, 29913, 6262, 2144, 29876, 29905, 29876, 29908, 13, 1678, 19909, 29918, 4905, 4619, 285, 29908, 29918, 333, 29901, 426, 2914, 1839, 1272, 16215, 333, 2033, 12806, 29876, 29908, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 4165, 496, 1860, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 679, 29918, 4878, 29918, 19635, 29918, 1609, 29918, 333, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 679, 29918, 4878, 29918, 19635, 29918, 1609, 29918, 333, 29898, 13, 4706, 1178, 29922, 4878, 29918, 333, 29892, 14383, 24735, 29922, 5085, 29889, 657, 703, 11014, 29918, 17886, 613, 6213, 29897, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 4878, 29918, 19635, 29898, 2914, 511, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 8259, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 1051, 29918, 4878, 29918, 14930, 1860, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 29918, 333, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 1051, 29918, 4878, 29918, 14930, 1860, 29898, 13, 4706, 1206, 1367, 29922, 4878, 29918, 333, 29892, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 6213, 511, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 29897, 13, 1678, 1723, 13, 1678, 19909, 29918, 4905, 353, 285, 29908, 29937, 24037, 4878, 29918, 333, 6177, 11733, 10641, 1860, 29905, 29876, 29908, 13, 1678, 363, 26305, 297, 1121, 3366, 1272, 3108, 29901, 13, 4706, 19909, 29918, 4905, 4619, 285, 29908, 4136, 334, 29912, 14930, 358, 1839, 23959, 2059, 2659, 16215, 1792, 1170, 2033, 29913, 448, 426, 14930, 358, 1839, 23959, 2481, 2033, 29913, 17710, 29876, 29908, 13, 4706, 19909, 29918, 4905, 4619, 285, 29908, 29912, 14930, 358, 1839, 978, 2033, 29913, 21313, 14930, 358, 1839, 29885, 603, 1542, 2033, 1118, 426, 14930, 358, 1839, 2311, 2033, 29913, 413, 29890, 2144, 29876, 29905, 29876, 29908, 13, 4706, 19909, 29918, 4905, 4619, 285, 29908, 29918, 333, 29901, 426, 14930, 358, 1839, 333, 2033, 12806, 29876, 29908, 13, 4706, 19909, 29918, 4905, 4619, 26345, 334, 334, 29905, 29876, 29908, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 4165, 496, 1860, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 1051, 29918, 4878, 29918, 11338, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 29918, 333, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 1051, 29918, 4878, 29918, 11338, 29898, 13, 4706, 1206, 1367, 29922, 4878, 29918, 333, 29892, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 6213, 511, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 29897, 13, 1678, 1723, 13, 1678, 9066, 353, 6796, 1989, 613, 376, 1767, 613, 376, 23959, 2481, 613, 376, 333, 3108, 13, 1678, 19909, 29918, 4905, 353, 1591, 1762, 9802, 3204, 29898, 13, 4706, 285, 29908, 26660, 4878, 29918, 333, 6177, 917, 613, 1121, 3366, 1272, 12436, 9066, 29922, 13662, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 28089, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 1051, 29918, 4878, 29918, 21032, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 2656, 29918, 1609, 353, 6389, 29889, 657, 703, 6605, 29918, 1609, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 29918, 333, 451, 6790, 1159, 13, 1678, 565, 2656, 29918, 1609, 29901, 13, 4706, 2656, 29918, 1609, 353, 6796, 23959, 27939, 3108, 565, 2656, 29918, 1609, 1275, 376, 6151, 2548, 29908, 1683, 6796, 29899, 23959, 27939, 3108, 13, 13, 1678, 1121, 353, 1051, 29918, 4878, 29918, 21032, 29898, 13, 4706, 1206, 1367, 29922, 4878, 29918, 333, 29892, 13, 4706, 1434, 20001, 29922, 5085, 29889, 657, 703, 11083, 29918, 9342, 613, 6213, 511, 13, 4706, 1156, 20001, 29922, 5085, 29889, 657, 703, 7045, 29918, 9342, 613, 6213, 511, 13, 4706, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 511, 13, 4706, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 6213, 511, 13, 4706, 2656, 2059, 29922, 6605, 29918, 1609, 29892, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 21032, 29898, 13, 9651, 1121, 3366, 1272, 12436, 285, 29908, 29937, 24037, 4878, 29918, 333, 6177, 461, 29879, 29905, 29876, 29908, 13, 4706, 10353, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 1523, 1860, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 3349, 29918, 4878, 29918, 4039, 29918, 1609, 29918, 333, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 4055, 29918, 333, 353, 6389, 29889, 657, 703, 4039, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 4055, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4039, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 3349, 29918, 4878, 29918, 4039, 29918, 1609, 29918, 333, 29898, 4878, 1367, 29922, 4878, 29918, 333, 29892, 4055, 1367, 29922, 4039, 29918, 333, 29897, 13, 1678, 9066, 353, 6796, 1989, 613, 376, 1767, 613, 376, 23959, 2481, 613, 376, 333, 613, 376, 15764, 3108, 13, 1678, 19909, 29918, 4905, 353, 1591, 1762, 9802, 3204, 29898, 13, 4706, 285, 29908, 26660, 4878, 29918, 333, 6177, 21267, 8282, 613, 1121, 3366, 1272, 12436, 9066, 29922, 13662, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 28089, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 3349, 29918, 4878, 29918, 4039, 29918, 1609, 29918, 1989, 29918, 1767, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 1820, 353, 6389, 29889, 657, 703, 1989, 613, 6213, 29897, 13, 1678, 995, 353, 6389, 29889, 657, 703, 1767, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 1820, 29901, 13, 4706, 12020, 7865, 2392, 703, 1989, 451, 6790, 1159, 13, 1678, 565, 451, 995, 29901, 13, 4706, 12020, 7865, 2392, 703, 1767, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 3349, 29918, 4878, 29918, 4039, 29918, 1609, 29918, 1989, 29918, 1767, 29898, 4878, 1367, 29922, 4878, 29918, 333, 29892, 4055, 2558, 29922, 1989, 29892, 4055, 1917, 29922, 1767, 29897, 13, 1678, 9066, 353, 6796, 1989, 613, 376, 1767, 613, 376, 23959, 2481, 613, 376, 333, 613, 376, 15764, 3108, 13, 1678, 19909, 29918, 4905, 353, 1591, 1762, 9802, 3204, 29898, 13, 4706, 285, 29908, 26660, 4878, 29918, 333, 6177, 21267, 8282, 613, 1121, 3366, 1272, 12436, 9066, 29922, 13662, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 28089, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 2767, 29918, 4878, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 2767, 29918, 4878, 29898, 13, 4706, 1178, 29922, 4878, 29918, 333, 29892, 13, 4706, 4967, 29922, 5085, 29889, 657, 703, 16009, 613, 6213, 511, 13, 4706, 6139, 29922, 5085, 29889, 657, 703, 8216, 613, 6213, 511, 13, 4706, 4660, 29922, 5085, 29889, 657, 703, 4882, 613, 6213, 511, 13, 4706, 20136, 29922, 5085, 29889, 657, 703, 29886, 21766, 613, 6213, 511, 13, 4706, 7663, 29922, 5085, 29889, 657, 703, 7320, 613, 6213, 511, 13, 4706, 1634, 9555, 29922, 5085, 29889, 657, 703, 276, 18505, 613, 6213, 511, 13, 4706, 9859, 2659, 29922, 5085, 29889, 657, 703, 465, 12961, 29918, 1792, 613, 6213, 511, 13, 4706, 9859, 29911, 5309, 29922, 5085, 29889, 657, 703, 465, 12961, 29918, 11345, 613, 6213, 511, 13, 4706, 11962, 7422, 29922, 5085, 29889, 657, 703, 15539, 29918, 5679, 613, 6213, 511, 13, 4706, 3440, 29922, 5085, 29889, 657, 703, 9342, 613, 6213, 511, 13, 4706, 3978, 9823, 7061, 29922, 5085, 29889, 657, 703, 12574, 29918, 5269, 29918, 7328, 613, 6213, 511, 13, 4706, 756, 13634, 29922, 5085, 29889, 657, 703, 5349, 29918, 13604, 613, 6213, 511, 13, 4706, 7463, 20001, 29922, 5085, 29889, 657, 703, 7564, 29918, 9342, 613, 6213, 511, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 4878, 29918, 19635, 29898, 2914, 511, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 8259, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 679, 29918, 3696, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1741, 29918, 1853, 353, 6389, 29889, 657, 703, 1853, 613, 6213, 29897, 13, 1678, 14334, 353, 6389, 29889, 657, 703, 16394, 613, 6213, 29897, 13, 1678, 11962, 29918, 333, 353, 6389, 29889, 657, 703, 15539, 29918, 333, 613, 6213, 29897, 13, 1678, 1741, 29918, 333, 353, 6389, 29889, 657, 703, 3696, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1741, 29918, 1853, 29901, 13, 4706, 12020, 7865, 2392, 703, 3696, 1134, 451, 6790, 1159, 13, 1678, 565, 451, 14334, 29901, 13, 4706, 12020, 7865, 2392, 703, 16394, 451, 6790, 1159, 13, 1678, 565, 451, 11962, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 15539, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 1741, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 3696, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 679, 29918, 3696, 29918, 1609, 29918, 2084, 29898, 13, 4706, 1134, 29922, 3696, 29918, 1853, 29892, 14334, 29922, 16394, 29892, 11962, 1367, 29922, 15539, 29918, 333, 29892, 1741, 1367, 29922, 3696, 29918, 333, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 2371, 1762, 9802, 3204, 29898, 29888, 29908, 2624, 29901, 426, 3696, 29918, 333, 17671, 1121, 3366, 1272, 3108, 511, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 2624, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 679, 29918, 13604, 29918, 1454, 29918, 4878, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1206, 29918, 333, 353, 6389, 29889, 657, 703, 4878, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1206, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 4878, 1178, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 679, 29918, 13604, 29918, 1454, 29918, 4878, 29898, 13, 4706, 1206, 1367, 29922, 4878, 29918, 333, 29892, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 6213, 511, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 29897, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 13604, 29898, 13, 9651, 9657, 29898, 2914, 511, 285, 29908, 29937, 24037, 4878, 29918, 333, 6177, 6853, 630, 28488, 29905, 29876, 29908, 13, 4706, 10353, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 13634, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 1284, 29918, 26193, 630, 29918, 13604, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 396, 694, 1144, 27988, 10772, 1542, 5596, 261, 13, 1678, 1121, 353, 1284, 29918, 26193, 630, 29918, 13604, 29898, 13, 4706, 14383, 20154, 13634, 29922, 5085, 29889, 657, 703, 11014, 29918, 29888, 9130, 29918, 13604, 613, 6213, 511, 13, 4706, 19060, 29922, 5085, 29889, 657, 703, 735, 2325, 613, 6213, 511, 13, 4706, 4423, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 5479, 29918, 333, 613, 6213, 8243, 13, 4706, 2775, 537, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 344, 369, 537, 613, 6213, 8243, 13, 4706, 11962, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 15539, 613, 6213, 8243, 13, 4706, 21200, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 284, 2817, 29918, 333, 613, 6213, 8243, 13, 4706, 5337, 10900, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1131, 547, 29918, 7320, 29918, 333, 613, 6213, 8243, 13, 4706, 2752, 7999, 29877, 20779, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4993, 29918, 24756, 29918, 13509, 613, 6213, 8243, 13, 4706, 12551, 7999, 29877, 20779, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 23848, 29918, 24756, 29918, 13509, 613, 6213, 8243, 13, 4706, 1737, 29877, 20779, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 24756, 29918, 13509, 613, 6213, 8243, 13, 4706, 4426, 29922, 710, 29918, 517, 29918, 8977, 29898, 5085, 29889, 657, 703, 11330, 613, 6213, 8243, 13, 4706, 2684, 9652, 11857, 29922, 5085, 29889, 657, 703, 735, 627, 29918, 4352, 29918, 11330, 613, 6213, 511, 13, 4706, 1014, 29907, 21977, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1491, 29918, 29883, 21977, 613, 6213, 8243, 13, 4706, 12608, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4530, 1535, 613, 6213, 8243, 13, 4706, 1833, 29248, 27939, 29922, 5085, 29889, 657, 703, 4230, 29918, 21402, 29918, 16394, 613, 6213, 511, 13, 4706, 2380, 4763, 2481, 29922, 5085, 29889, 657, 703, 2248, 29918, 2962, 29918, 2230, 613, 6213, 511, 13, 4706, 2380, 5044, 2481, 29922, 5085, 29889, 657, 703, 2248, 29918, 355, 29918, 2230, 613, 6213, 511, 13, 4706, 12551, 5690, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 23848, 29918, 666, 613, 6213, 8243, 13, 4706, 2752, 5690, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4993, 29918, 666, 613, 6213, 8243, 13, 4706, 10377, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 666, 613, 6213, 8243, 13, 4706, 12551, 2290, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 23848, 29918, 637, 613, 6213, 8243, 13, 4706, 2752, 2290, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4993, 29918, 637, 613, 6213, 8243, 13, 4706, 2011, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 637, 613, 6213, 8243, 13, 4706, 1375, 29903, 1310, 537, 29922, 5085, 29889, 657, 703, 1195, 29918, 344, 369, 537, 613, 6213, 511, 13, 4706, 4236, 29903, 1310, 537, 29922, 5085, 29889, 657, 703, 3317, 29918, 344, 369, 537, 613, 6213, 511, 13, 4706, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 29871, 29906, 29945, 511, 13, 4706, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 511, 13, 4706, 3160, 2772, 22742, 29922, 5085, 29889, 657, 703, 2856, 29918, 311, 22742, 613, 6213, 511, 13, 4706, 1375, 3981, 29922, 5085, 29889, 657, 703, 1195, 29918, 2798, 613, 6213, 511, 13, 4706, 6942, 8259, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 21264, 630, 29918, 4878, 29918, 333, 613, 6213, 8243, 13, 4706, 2752, 5690, 8140, 29933, 1169, 29922, 5085, 29889, 657, 703, 4993, 29918, 666, 29918, 1195, 29918, 14836, 613, 6213, 511, 13, 4706, 12551, 5690, 8140, 29933, 1169, 29922, 5085, 29889, 657, 703, 23848, 29918, 666, 29918, 1195, 29918, 14836, 613, 6213, 511, 13, 4706, 1369, 27939, 29922, 5085, 29889, 657, 703, 2962, 29918, 16394, 613, 11663, 29906, 29946, 29882, 2470, 4968, 13, 4706, 1095, 27939, 29922, 5085, 29889, 657, 703, 355, 29918, 16394, 613, 376, 3707, 4968, 13, 4706, 2656, 2059, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 6605, 29918, 1609, 613, 6213, 8243, 13, 4706, 3160, 15675, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 2856, 29918, 15764, 613, 6213, 8243, 13, 4706, 19060, 15675, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 735, 2325, 29918, 15764, 613, 6213, 8243, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 13604, 29898, 8977, 29898, 2914, 511, 12305, 10987, 4959, 29905, 29876, 4968, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 13634, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 1051, 29918, 26193, 630, 29918, 13604, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1121, 353, 1051, 29918, 26193, 630, 29918, 13604, 29898, 13, 4706, 11962, 1367, 29922, 5085, 29889, 657, 703, 15539, 29918, 333, 613, 6213, 511, 13, 4706, 12608, 29922, 5085, 29889, 657, 703, 4530, 1535, 613, 6213, 511, 13, 4706, 10377, 29922, 5085, 29889, 657, 703, 666, 613, 6213, 511, 13, 4706, 1369, 27939, 29922, 5085, 29889, 657, 703, 2962, 29918, 16394, 613, 6213, 511, 13, 4706, 1095, 27939, 29922, 5085, 29889, 657, 703, 355, 29918, 16394, 613, 6213, 511, 13, 4706, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 6213, 511, 13, 4706, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 511, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 13604, 29898, 8977, 29898, 2914, 511, 12305, 2391, 28488, 29905, 29876, 4968, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 13634, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 679, 29918, 23813, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1741, 29918, 1853, 353, 6389, 29889, 657, 703, 1853, 613, 6213, 29897, 13, 1678, 14334, 353, 6389, 29889, 657, 703, 16394, 613, 6213, 29897, 13, 1678, 11962, 29918, 333, 353, 6389, 29889, 657, 703, 15539, 29918, 333, 613, 6213, 29897, 13, 1678, 1741, 29918, 333, 353, 6389, 29889, 657, 703, 3696, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1741, 29918, 1853, 29901, 13, 4706, 12020, 7865, 2392, 703, 3696, 1134, 451, 6790, 1159, 13, 1678, 565, 451, 14334, 29901, 13, 4706, 12020, 7865, 2392, 703, 16394, 451, 6790, 1159, 13, 1678, 565, 451, 11962, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 15539, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 1741, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 3696, 1178, 451, 6790, 1159, 13, 1678, 1121, 353, 679, 29918, 23813, 29898, 13, 4706, 1134, 29922, 3696, 29918, 1853, 29892, 14334, 29922, 16394, 29892, 11962, 1367, 29922, 15539, 29918, 333, 29892, 1741, 1367, 29922, 3696, 29918, 333, 13, 1678, 1723, 13, 1678, 19909, 29918, 4905, 353, 12305, 6864, 20092, 29905, 29876, 29908, 13, 1678, 19909, 29918, 4905, 4619, 285, 29908, 2624, 29901, 426, 3696, 29918, 333, 1118, 1134, 29901, 426, 2914, 1839, 1272, 16215, 1853, 2033, 1012, 29876, 29908, 13, 1678, 19909, 29918, 4905, 4619, 1121, 3366, 1272, 3108, 3366, 23813, 3108, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 949, 519, 29918, 4905, 29892, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 15467, 1359, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 679, 29918, 29886, 5030, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 3139, 29901, 13, 1678, 1741, 29918, 1853, 353, 6389, 29889, 657, 703, 1853, 613, 6213, 29897, 13, 1678, 14334, 353, 6389, 29889, 657, 703, 16394, 613, 6213, 29897, 13, 1678, 11962, 29918, 333, 353, 6389, 29889, 657, 703, 15539, 29918, 333, 613, 6213, 29897, 13, 1678, 1741, 29918, 333, 353, 6389, 29889, 657, 703, 3696, 29918, 333, 613, 6213, 29897, 13, 1678, 565, 451, 1741, 29918, 1853, 29901, 13, 4706, 12020, 7865, 2392, 703, 3696, 1134, 451, 6790, 1159, 13, 1678, 565, 451, 14334, 29901, 13, 4706, 12020, 7865, 2392, 703, 16394, 451, 6790, 1159, 13, 1678, 565, 451, 11962, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 15539, 1178, 451, 6790, 1159, 13, 1678, 565, 451, 1741, 29918, 333, 29901, 13, 4706, 12020, 7865, 2392, 703, 3696, 1178, 451, 6790, 1159, 13, 1678, 1121, 353, 679, 29918, 29886, 5030, 29898, 13, 4706, 1134, 29922, 3696, 29918, 1853, 29892, 14334, 29922, 16394, 29892, 11962, 1367, 29922, 15539, 29918, 333, 29892, 1741, 1367, 29922, 3696, 29918, 333, 13, 1678, 1723, 13, 13, 1678, 736, 934, 3591, 29898, 29888, 29908, 29912, 3696, 29918, 333, 2403, 29886, 5030, 613, 1121, 29889, 3051, 29897, 13, 13, 13, 1753, 1284, 29918, 29876, 4841, 29918, 13604, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 396, 694, 1144, 27988, 10772, 1542, 5596, 261, 13, 1678, 1121, 353, 1284, 29918, 29876, 29918, 29875, 29918, 29881, 29918, 29879, 29918, 13604, 29898, 13, 4706, 14383, 20154, 13634, 29922, 5085, 29889, 657, 703, 11014, 29918, 29888, 9130, 29918, 13604, 613, 6213, 511, 13, 4706, 19060, 29922, 5085, 29889, 657, 703, 735, 2325, 613, 6213, 511, 13, 4706, 1741, 12889, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 3696, 29918, 25378, 613, 6213, 8243, 13, 4706, 4423, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 5479, 29918, 333, 613, 6213, 8243, 13, 4706, 2775, 537, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 344, 369, 537, 613, 6213, 8243, 13, 4706, 11962, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 15539, 613, 6213, 8243, 13, 4706, 21200, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 284, 2817, 29918, 333, 613, 6213, 8243, 13, 4706, 5337, 10900, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1131, 547, 29918, 7320, 29918, 333, 613, 6213, 8243, 13, 4706, 2752, 7999, 29877, 20779, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4993, 29918, 24756, 29918, 13509, 613, 6213, 8243, 13, 4706, 12551, 7999, 29877, 20779, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 23848, 29918, 24756, 29918, 13509, 613, 6213, 8243, 13, 4706, 1737, 29877, 20779, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 24756, 29918, 13509, 613, 6213, 8243, 13, 4706, 4426, 29922, 710, 29918, 517, 29918, 8977, 29898, 5085, 29889, 657, 703, 11330, 613, 6213, 8243, 13, 4706, 2684, 9652, 11857, 29922, 5085, 29889, 657, 703, 735, 627, 29918, 4352, 29918, 11330, 613, 6213, 511, 13, 4706, 23530, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 29879, 6073, 29918, 333, 613, 6213, 8243, 13, 4706, 1014, 29907, 21977, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 1491, 29918, 29883, 21977, 613, 6213, 8243, 13, 4706, 12608, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4530, 1535, 613, 6213, 8243, 13, 4706, 1833, 29248, 27939, 29922, 5085, 29889, 657, 703, 4230, 29918, 21402, 29918, 16394, 613, 6213, 511, 13, 4706, 2380, 4763, 2481, 29922, 5085, 29889, 657, 703, 2248, 29918, 2962, 29918, 2230, 613, 6213, 511, 13, 4706, 2380, 5044, 2481, 29922, 5085, 29889, 657, 703, 2248, 29918, 355, 29918, 2230, 613, 6213, 511, 13, 4706, 12551, 5690, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 23848, 29918, 666, 613, 6213, 8243, 13, 4706, 2752, 5690, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4993, 29918, 666, 613, 6213, 8243, 13, 4706, 10377, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 666, 613, 6213, 8243, 13, 4706, 12551, 2290, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 23848, 29918, 637, 613, 6213, 8243, 13, 4706, 2752, 2290, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 4993, 29918, 637, 613, 6213, 8243, 13, 4706, 2011, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 637, 613, 6213, 8243, 13, 4706, 1375, 29903, 1310, 537, 29922, 5085, 29889, 657, 703, 1195, 29918, 344, 369, 537, 613, 6213, 511, 13, 4706, 4236, 29903, 1310, 537, 29922, 5085, 29889, 657, 703, 3317, 29918, 344, 369, 537, 613, 6213, 511, 13, 4706, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 29871, 29906, 29945, 511, 13, 4706, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 511, 13, 4706, 3160, 2772, 22742, 29922, 5085, 29889, 657, 703, 2856, 29918, 311, 22742, 613, 6213, 511, 13, 4706, 1369, 27939, 29922, 5085, 29889, 657, 703, 2962, 29918, 16394, 613, 11663, 29906, 29946, 29882, 2470, 4968, 13, 4706, 1095, 27939, 29922, 5085, 29889, 657, 703, 355, 29918, 16394, 613, 376, 3707, 4968, 13, 4706, 2656, 2059, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 6605, 29918, 1609, 613, 6213, 8243, 13, 4706, 3160, 15675, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 2856, 29918, 15764, 613, 6213, 8243, 13, 4706, 19060, 15675, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 735, 2325, 29918, 15764, 613, 6213, 8243, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 13604, 29898, 8977, 29898, 2914, 511, 12305, 10987, 405, 1367, 29903, 28488, 29905, 29876, 4968, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 29940, 1367, 29903, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 1051, 29918, 29876, 4841, 29918, 13604, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 1121, 353, 1051, 29918, 29876, 29918, 29875, 29918, 29881, 29918, 29879, 29918, 13604, 29898, 13, 4706, 11962, 1367, 29922, 5085, 29889, 657, 703, 15539, 29918, 333, 613, 6213, 511, 13, 4706, 12608, 29922, 5085, 29889, 657, 703, 4530, 1535, 613, 6213, 511, 13, 4706, 10377, 29922, 5085, 29889, 657, 703, 666, 613, 6213, 511, 13, 4706, 1369, 27939, 29922, 5085, 29889, 657, 703, 2962, 29918, 16394, 613, 6213, 511, 13, 4706, 1095, 27939, 29922, 5085, 29889, 657, 703, 355, 29918, 16394, 613, 6213, 511, 13, 4706, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 6213, 511, 13, 4706, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 511, 13, 1678, 1723, 13, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 1457, 4349, 29918, 2158, 29918, 13604, 29898, 8977, 29898, 2914, 511, 12305, 2391, 405, 1367, 29903, 28488, 29905, 29876, 4968, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 29940, 1367, 29903, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 2740, 29918, 3757, 4339, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 2346, 353, 6389, 29889, 657, 703, 1972, 613, 6213, 29897, 13, 1678, 565, 451, 2346, 29901, 13, 4706, 12020, 7865, 2392, 703, 1972, 451, 6790, 1159, 13, 1678, 396, 694, 1144, 27988, 10772, 1542, 5596, 261, 13, 1678, 1121, 353, 2740, 29918, 3757, 4339, 29898, 13, 4706, 2346, 29922, 1972, 29892, 13, 4706, 20431, 3591, 29922, 5085, 29889, 657, 703, 26193, 403, 29918, 2914, 613, 6213, 511, 13, 4706, 3160, 2744, 11428, 12191, 29922, 5085, 29889, 657, 703, 2856, 29918, 25772, 29918, 9902, 613, 6213, 511, 13, 4706, 364, 29878, 2385, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 21478, 29918, 1990, 613, 6213, 8243, 13, 4706, 364, 29878, 1542, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 21478, 29918, 1853, 613, 6213, 8243, 13, 4706, 11962, 1367, 29922, 1191, 21254, 29898, 5085, 29889, 657, 703, 15539, 29918, 333, 613, 6213, 8243, 13, 4706, 260, 22833, 29922, 1191, 21254, 3552, 5085, 29889, 657, 703, 15206, 29886, 613, 6213, 876, 511, 13, 4706, 4046, 29922, 5085, 29889, 657, 703, 13400, 613, 29871, 29906, 29945, 511, 13, 4706, 9210, 29922, 5085, 29889, 657, 703, 10289, 613, 6213, 511, 13, 1678, 1723, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 2371, 1762, 9802, 3204, 703, 25014, 3059, 6475, 613, 1121, 3366, 1272, 3108, 511, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 25014, 3059, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 6699, 29918, 26739, 800, 29918, 1454, 29918, 7247, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 285, 29939, 5200, 353, 6389, 29889, 657, 703, 29888, 29939, 5200, 613, 6213, 29897, 13, 1678, 565, 451, 285, 29939, 5200, 29901, 13, 4706, 12020, 7865, 2392, 703, 29888, 29939, 5200, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 6699, 29918, 26739, 800, 29918, 1454, 29918, 7247, 29898, 29888, 29939, 5200, 29922, 29888, 29939, 5200, 29897, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 2371, 1762, 9802, 3204, 29898, 13, 9651, 285, 29915, 15951, 13917, 363, 29850, 29888, 29939, 5200, 5038, 742, 1121, 3366, 1272, 3108, 13, 4706, 10353, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 6039, 2140, 800, 15951, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 1753, 6699, 29918, 26739, 800, 29918, 1454, 29918, 29875, 29918, 29886, 29918, 6519, 29898, 5085, 29901, 360, 919, 29961, 710, 29892, 3139, 2314, 1599, 10516, 12191, 29901, 13, 1678, 10377, 353, 6389, 29889, 657, 703, 666, 613, 6213, 29897, 13, 1678, 565, 451, 10377, 29901, 13, 4706, 12020, 7865, 2392, 703, 666, 451, 6790, 1159, 13, 13, 1678, 1121, 353, 6699, 29918, 26739, 800, 29918, 1454, 29918, 29875, 29918, 29886, 29898, 666, 29922, 666, 29897, 13, 1678, 736, 10516, 12191, 29898, 13, 4706, 19909, 29918, 4905, 29922, 2371, 1762, 9802, 3204, 29898, 29888, 29915, 5690, 13917, 363, 29850, 666, 5038, 742, 1121, 3366, 1272, 3108, 511, 13, 4706, 14391, 29918, 13506, 543, 8559, 375, 29889, 6039, 2140, 800, 5690, 613, 13, 4706, 14391, 29922, 2914, 29892, 13, 4706, 10650, 29918, 5327, 29922, 2914, 29892, 13, 1678, 1723, 13, 13, 13, 15945, 29908, 14861, 1177, 383, 28700, 9995, 13, 13, 13, 1753, 1667, 580, 1599, 6213, 29901, 13, 1678, 12183, 29889, 657, 16363, 703, 1191, 375, 29918, 11303, 2564, 842, 10108, 703, 29956, 25614, 1159, 13, 13, 1678, 937, 29918, 9155, 29918, 19145, 353, 6088, 29918, 4102, 29918, 9155, 29898, 13, 4706, 1261, 5137, 29889, 7529, 2141, 657, 703, 4102, 29918, 9155, 613, 11663, 29896, 2462, 1159, 13, 1678, 1723, 13, 13, 1678, 731, 29918, 1191, 375, 29918, 11027, 29898, 13, 4706, 1261, 5137, 29889, 7529, 2141, 657, 703, 2754, 29918, 1989, 4968, 13, 4706, 1261, 5137, 29889, 7529, 2141, 657, 703, 2754, 29918, 2271, 4968, 13, 4706, 4386, 29918, 14701, 3285, 13, 4706, 1261, 5137, 29889, 7529, 2141, 657, 703, 262, 24216, 613, 6213, 511, 13, 1678, 1723, 13, 13, 1678, 1261, 5137, 29889, 8382, 29898, 29888, 29908, 6255, 1641, 2000, 338, 426, 2310, 5137, 29889, 6519, 580, 27195, 13, 1678, 1018, 29901, 13, 4706, 565, 1261, 5137, 29889, 6519, 580, 1275, 376, 1688, 29899, 5453, 1115, 13, 9651, 396, 910, 338, 278, 1246, 1754, 746, 24795, 278, 13465, 4321, 2826, 29889, 13, 9651, 736, 29918, 9902, 29898, 1688, 29918, 5453, 29918, 6519, 3101, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 9155, 29899, 3742, 16719, 1115, 13, 9651, 396, 3789, 322, 4529, 278, 6699, 5528, 16719, 1899, 304, 1065, 1156, 5039, 630, 3025, 13465, 6055, 29889, 13, 9651, 2446, 29918, 3389, 29892, 5528, 16719, 353, 6699, 29918, 3742, 16719, 29898, 13, 18884, 1833, 29918, 3389, 29922, 2310, 5137, 29889, 657, 8897, 6558, 3285, 13, 18884, 937, 29918, 9155, 29918, 19145, 29922, 4102, 29918, 9155, 29918, 19145, 29892, 13, 18884, 4046, 29922, 2310, 5137, 29889, 7529, 2141, 657, 703, 3317, 29918, 9155, 613, 29871, 29906, 29945, 511, 13, 18884, 1375, 29918, 344, 369, 537, 29922, 2310, 5137, 29889, 7529, 2141, 657, 703, 1195, 29918, 344, 369, 537, 613, 376, 677, 4968, 13, 9651, 1723, 13, 13, 9651, 1261, 5137, 29889, 842, 8897, 6558, 29898, 4622, 29918, 3389, 29897, 13, 9651, 1261, 5137, 29889, 3742, 16719, 29898, 3742, 16719, 29897, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 1202, 29899, 4878, 29899, 4039, 1115, 13, 9651, 736, 29918, 9902, 29898, 1202, 29918, 4878, 29918, 4039, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 1202, 29899, 9342, 1115, 13, 9651, 736, 29918, 9902, 29898, 1202, 29918, 9342, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 328, 16858, 29899, 4878, 29899, 4478, 1115, 13, 9651, 736, 29918, 9902, 29898, 328, 16858, 29918, 4878, 29918, 4478, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 5358, 29899, 4878, 1115, 13, 9651, 736, 29918, 9902, 29898, 5358, 29918, 4878, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 3258, 29899, 4878, 1115, 13, 9651, 736, 29918, 9902, 29898, 3258, 29918, 4878, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 8143, 29899, 4878, 1115, 13, 9651, 736, 29918, 9902, 29898, 8143, 29918, 4878, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 8143, 29899, 9342, 1115, 13, 9651, 736, 29918, 9902, 29898, 8143, 29918, 9342, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 10382, 29899, 14930, 358, 1115, 13, 9651, 736, 29918, 9902, 29898, 10382, 29918, 14930, 358, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 5628, 29899, 9342, 1115, 13, 9651, 736, 29918, 9902, 29898, 5628, 29918, 9342, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 657, 29899, 14930, 358, 1115, 13, 9651, 736, 29918, 9902, 29898, 657, 29918, 14930, 358, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 657, 29899, 4878, 29899, 19635, 29899, 1609, 29899, 333, 1115, 13, 9651, 736, 29918, 9902, 29898, 657, 29918, 4878, 29918, 19635, 29918, 1609, 29918, 333, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 1761, 29899, 4878, 29899, 14930, 1860, 1115, 13, 9651, 736, 29918, 9902, 29898, 1761, 29918, 4878, 29918, 14930, 1860, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 1761, 29899, 4878, 29899, 11338, 1115, 13, 9651, 736, 29918, 9902, 29898, 1761, 29918, 4878, 29918, 11338, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 1761, 29899, 4878, 29899, 21032, 1115, 13, 9651, 736, 29918, 9902, 29898, 1761, 29918, 4878, 29918, 21032, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 5992, 29899, 4878, 29899, 4039, 29899, 1609, 29899, 333, 1115, 13, 9651, 736, 29918, 9902, 29898, 5992, 29918, 4878, 29918, 4039, 29918, 1609, 29918, 333, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 5992, 29899, 4878, 29899, 4039, 29899, 1609, 29899, 1989, 29899, 1767, 1115, 13, 9651, 736, 29918, 9902, 29898, 5992, 29918, 4878, 29918, 4039, 29918, 1609, 29918, 1989, 29918, 1767, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 5504, 29899, 4878, 1115, 13, 9651, 736, 29918, 9902, 29898, 5504, 29918, 4878, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 657, 29899, 3696, 1115, 13, 9651, 736, 29918, 9902, 29898, 657, 29918, 3696, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 657, 29899, 13604, 29899, 1454, 29899, 4878, 1115, 13, 9651, 736, 29918, 9902, 29898, 657, 29918, 13604, 29918, 1454, 29918, 4878, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 2886, 29899, 26193, 630, 29899, 13604, 1115, 13, 9651, 736, 29918, 9902, 29898, 2886, 29918, 26193, 630, 29918, 13604, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 1761, 29899, 26193, 630, 29899, 13604, 1115, 13, 9651, 736, 29918, 9902, 29898, 1761, 29918, 26193, 630, 29918, 13604, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 657, 29899, 23813, 1115, 13, 9651, 736, 29918, 9902, 29898, 657, 29918, 23813, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 657, 29899, 29886, 5030, 1115, 13, 9651, 736, 29918, 9902, 29898, 657, 29918, 29886, 5030, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 2886, 29899, 29876, 4841, 29899, 13604, 1115, 13, 9651, 736, 29918, 9902, 29898, 2886, 29918, 29876, 4841, 29918, 13604, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 1761, 29899, 29876, 4841, 29899, 13604, 1115, 13, 9651, 736, 29918, 9902, 29898, 1761, 29918, 29876, 4841, 29918, 13604, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 15926, 1983, 29899, 4478, 29899, 3757, 4339, 1115, 13, 9651, 736, 29918, 9902, 29898, 4478, 29918, 3757, 4339, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 9155, 29899, 26739, 800, 29899, 1454, 29899, 7247, 1115, 13, 9651, 736, 29918, 9902, 29898, 9155, 29918, 26739, 800, 29918, 1454, 29918, 7247, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 4706, 25342, 1261, 5137, 29889, 6519, 580, 1275, 376, 1191, 375, 29899, 9155, 29899, 26739, 800, 29899, 1454, 29899, 666, 1115, 13, 9651, 736, 29918, 9902, 29898, 9155, 29918, 26739, 800, 29918, 1454, 29918, 29875, 29918, 29886, 29918, 6519, 29898, 2310, 5137, 29889, 5085, 22130, 13, 13, 1678, 396, 4522, 15283, 322, 736, 4436, 13, 1678, 5174, 8960, 408, 321, 29901, 13, 4706, 1261, 5137, 29889, 2704, 29898, 15003, 1627, 29889, 4830, 29918, 735, 29883, 3101, 29871, 396, 1596, 278, 9637, 1627, 13, 4706, 736, 29918, 2704, 29898, 13, 9651, 285, 29908, 17776, 304, 6222, 426, 2310, 5137, 29889, 6519, 28296, 1899, 7790, 29876, 2392, 3583, 29876, 29912, 710, 29898, 29872, 2915, 29908, 13, 4706, 1723, 13, 13, 13, 15945, 29908, 12524, 5659, 29979, 349, 6992, 29911, 9995, 13, 13, 361, 4770, 978, 1649, 297, 4852, 1649, 3396, 1649, 613, 376, 1649, 16145, 262, 1649, 613, 376, 16145, 1144, 29908, 1125, 13, 1678, 1667, 580, 13, 2 ]
src/GUI/__init__.py
shulip/ShoppingMallSystem
0
140095
<gh_stars>0 #!/usr/bin/env python # -*- coding:utf-8 -*- from .LCEOWindow import * from .LProprietorWindow import * from .LLoginWindow import * from .LManagerWindow import *
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29871, 13, 29937, 448, 29930, 29899, 14137, 29901, 9420, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 869, 29931, 4741, 29949, 5907, 1053, 334, 13, 3166, 869, 29931, 20420, 374, 300, 272, 5907, 1053, 334, 13, 3166, 869, 2208, 468, 262, 5907, 1053, 334, 13, 3166, 869, 29931, 3260, 5907, 1053, 334, 13, 2 ]
src/make_notebooks/__init__.py
marskar/make_notebooks
0
150508
# -*- coding: utf-8 -*- """Top-level package for Make Notebooks.""" __author__ = """<NAME>""" __version__ = '0.0.1'
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 15945, 29908, 7031, 29899, 5563, 3577, 363, 8561, 2216, 19273, 29879, 1213, 15945, 13, 13, 1649, 8921, 1649, 353, 9995, 29966, 5813, 11903, 15945, 13, 1649, 3259, 1649, 353, 525, 29900, 29889, 29900, 29889, 29896, 29915, 13, 13, 2 ]
tests/test_ms_sql_server.py
changrunner/zeppos_microsoft_sql_server
0
37450
import unittest from zeppos_microsoft_sql_server.ms_sql_server import MsSqlServer import pandas as pd import pyodbc import os class TestTheProjectMethods(unittest.TestCase): def test_constructor_methods(self): self.assertEqual("<class 'zeppos_microsoft_sql_server.ms_sql_server.MsSqlServer'>", str(type(MsSqlServer("")))) def test_execute_sql_method(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") self.assertEqual(True, ms_sql.execute_sql("drop table if exists #tmp")) def test_drop_table_method(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") self.assertEqual(True, ms_sql.drop_table("dbo", "table_does_not_exist")) def test_create_table_method(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") df = pd.DataFrame({'column_1': [3600], 'column_2': ['12'], 'column_3': [23] }, columns=['column_1', 'column_2', 'column_3']) df['column_1'] = df['column_1'].astype(object) df['column_2'] = df['column_2'].astype(str) df['column_3'] = df['column_3'].astype(int) ms_sql.drop_table("dbo", "table_does_not_exist") self.assertEqual(True, ms_sql.create_table("dbo", "table_does_not_exist", df)) def test_does_table_exists(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") self.assertEqual(False, ms_sql.does_table_exists('dbo', 'test123456123')) def test_save_dataframe_by_record_method(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") ms_sql.drop_table("dbo", "test_table") ms_sql.execute_sql("create table dbo.test_table (column_1 int)") # test df_actual = pd.DataFrame({'column_1': [3600]}, columns=['column_1']) self.assertEqual(True, ms_sql.save_dataframe_by_record(df_actual, "dbo", "test_table")) self.assertEqual(1, pd.read_sql("SELECT TOP 1 column_1 FROM dbo.test_table", pyodbc.connect( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;")).shape[0]) def test_save_dataframe_in_bulk_method(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") # test df_actual = pd.DataFrame({'column_1': [3600]}, columns=['column_1']) self.assertEqual(True, ms_sql.save_dataframe_in_bulk(df_actual, "dbo", "test_table")) self.assertEqual(1, pd.read_sql("SELECT TOP 1 column_1 FROM dbo.test_table", pyodbc.connect( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;")).shape[ 0]) def test_1_read_data_into_dataframe_method(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") self.assertEqual(1, ms_sql.read_data_into_dataframe("SELECT TOP 1 COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS").shape[0]) def test_2_read_data_into_dataframe_method(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") self.assertEqual(1, ms_sql.read_data_into_dataframe(""" SET NOCOUNT ON; -- This has to be here. DROP TABLE IF EXISTS #tmp SELECT DISTINCT TABLE_SCHEMA, TABLE_NAME into #tmp FROM INFORMATION_SCHEMA.COLUMNS SELECT count(1) as RECORD_COUNT from #tmp """).shape[0]) def test_extract_to_csv_method(self): ms_sql = MsSqlServer( "DRIVER={ODBC Driver 13 for SQL Server}; SERVER=localhost\sqlexpress; DATABASE=master; Trusted_Connection=yes;") csv_file = ms_sql.extract_to_csv("select table_schema, table_name from information_schema.tables", r"c:\temp", "test.csv") self.assertEqual(True, os.path.exists(csv_file.full_file_name)) df = pd.read_csv(csv_file.full_file_name, sep="|") self.assertGreater(df.shape[0], 0) os.remove(csv_file.full_file_name) if __name__ == '__main__': unittest.main()
[ 1, 1053, 443, 27958, 13, 3166, 3777, 407, 359, 29918, 4994, 29918, 2850, 29918, 2974, 29889, 1516, 29918, 2850, 29918, 2974, 1053, 341, 29879, 10520, 6004, 13, 5215, 11701, 408, 10518, 13, 5215, 11451, 10396, 29883, 13, 5215, 2897, 13, 13, 1990, 4321, 1576, 7653, 26112, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 27821, 29918, 23515, 29898, 1311, 1125, 13, 4706, 1583, 29889, 9294, 9843, 28945, 1990, 525, 911, 407, 359, 29918, 4994, 29918, 2850, 29918, 2974, 29889, 1516, 29918, 2850, 29918, 2974, 29889, 29924, 29879, 10520, 6004, 11041, 613, 851, 29898, 1853, 29898, 29924, 29879, 10520, 6004, 703, 5783, 876, 13, 13, 1678, 822, 1243, 29918, 7978, 29918, 2850, 29918, 5696, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5574, 29892, 10887, 29918, 2850, 29889, 7978, 29918, 2850, 703, 8865, 1591, 565, 4864, 396, 7050, 5783, 13, 13, 1678, 822, 1243, 29918, 8865, 29918, 2371, 29918, 5696, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5574, 29892, 10887, 29918, 2850, 29889, 8865, 29918, 2371, 703, 21627, 613, 376, 2371, 29918, 13221, 29918, 1333, 29918, 28997, 5783, 13, 13, 1678, 822, 1243, 29918, 3258, 29918, 2371, 29918, 5696, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 4706, 4489, 353, 10518, 29889, 17271, 3319, 29915, 4914, 29918, 29896, 2396, 518, 29941, 29953, 29900, 29900, 1402, 13, 462, 965, 525, 4914, 29918, 29906, 2396, 6024, 29896, 29906, 7464, 13, 462, 965, 525, 4914, 29918, 29941, 2396, 518, 29906, 29941, 29962, 13, 462, 965, 2981, 4341, 29922, 1839, 4914, 29918, 29896, 742, 525, 4914, 29918, 29906, 742, 525, 4914, 29918, 29941, 11287, 13, 4706, 4489, 1839, 4914, 29918, 29896, 2033, 353, 4489, 1839, 4914, 29918, 29896, 13359, 579, 668, 29898, 3318, 29897, 13, 4706, 4489, 1839, 4914, 29918, 29906, 2033, 353, 4489, 1839, 4914, 29918, 29906, 13359, 579, 668, 29898, 710, 29897, 13, 4706, 4489, 1839, 4914, 29918, 29941, 2033, 353, 4489, 1839, 4914, 29918, 29941, 13359, 579, 668, 29898, 524, 29897, 13, 4706, 10887, 29918, 2850, 29889, 8865, 29918, 2371, 703, 21627, 613, 376, 2371, 29918, 13221, 29918, 1333, 29918, 28997, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5574, 29892, 10887, 29918, 2850, 29889, 3258, 29918, 2371, 703, 21627, 613, 376, 2371, 29918, 13221, 29918, 1333, 29918, 28997, 613, 4489, 876, 13, 13, 1678, 822, 1243, 29918, 13221, 29918, 2371, 29918, 9933, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 8824, 29892, 10887, 29918, 2850, 29889, 13221, 29918, 2371, 29918, 9933, 877, 21627, 742, 525, 1688, 29896, 29906, 29941, 29946, 29945, 29953, 29896, 29906, 29941, 8785, 13, 13, 1678, 822, 1243, 29918, 7620, 29918, 1272, 2557, 29918, 1609, 29918, 11651, 29918, 5696, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 4706, 10887, 29918, 2850, 29889, 8865, 29918, 2371, 703, 21627, 613, 376, 1688, 29918, 2371, 1159, 13, 4706, 10887, 29918, 2850, 29889, 7978, 29918, 2850, 703, 3258, 1591, 26895, 29889, 1688, 29918, 2371, 313, 4914, 29918, 29896, 938, 25760, 13, 13, 4706, 396, 1243, 13, 4706, 4489, 29918, 19304, 353, 10518, 29889, 17271, 3319, 29915, 4914, 29918, 29896, 2396, 518, 29941, 29953, 29900, 29900, 29962, 1118, 4341, 29922, 1839, 4914, 29918, 29896, 11287, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5574, 29892, 10887, 29918, 2850, 29889, 7620, 29918, 1272, 2557, 29918, 1609, 29918, 11651, 29898, 2176, 29918, 19304, 29892, 376, 21627, 613, 376, 1688, 29918, 2371, 5783, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29896, 29892, 10518, 29889, 949, 29918, 2850, 703, 6404, 323, 4590, 29871, 29896, 1897, 29918, 29896, 3895, 26895, 29889, 1688, 29918, 2371, 613, 11451, 10396, 29883, 29889, 6915, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 467, 12181, 29961, 29900, 2314, 13, 13, 1678, 822, 1243, 29918, 7620, 29918, 1272, 2557, 29918, 262, 29918, 8645, 29895, 29918, 5696, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 13, 4706, 396, 1243, 13, 4706, 4489, 29918, 19304, 353, 10518, 29889, 17271, 3319, 29915, 4914, 29918, 29896, 2396, 518, 29941, 29953, 29900, 29900, 29962, 1118, 4341, 29922, 1839, 4914, 29918, 29896, 11287, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5574, 29892, 10887, 29918, 2850, 29889, 7620, 29918, 1272, 2557, 29918, 262, 29918, 8645, 29895, 29898, 2176, 29918, 19304, 29892, 376, 21627, 613, 376, 1688, 29918, 2371, 5783, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29896, 29892, 10518, 29889, 949, 29918, 2850, 703, 6404, 323, 4590, 29871, 29896, 1897, 29918, 29896, 3895, 26895, 29889, 1688, 29918, 2371, 613, 11451, 10396, 29883, 29889, 6915, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 467, 12181, 29961, 13, 632, 29900, 2314, 13, 13, 1678, 822, 1243, 29918, 29896, 29918, 949, 29918, 1272, 29918, 8941, 29918, 1272, 2557, 29918, 5696, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29896, 29892, 13, 9651, 10887, 29918, 2850, 29889, 949, 29918, 1272, 29918, 8941, 29918, 1272, 2557, 703, 6404, 323, 4590, 29871, 29896, 23958, 29127, 29918, 5813, 3895, 2672, 19094, 8098, 29918, 29903, 3210, 26862, 29889, 15032, 5005, 3059, 2564, 12181, 29961, 29900, 2314, 13, 13, 1678, 822, 1243, 29918, 29906, 29918, 949, 29918, 1272, 29918, 8941, 29918, 1272, 2557, 29918, 5696, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 29896, 29892, 10887, 29918, 2850, 29889, 949, 29918, 1272, 29918, 8941, 29918, 1272, 2557, 703, 15945, 13, 18884, 11368, 11698, 18736, 6732, 29936, 1192, 910, 756, 304, 367, 1244, 29889, 13, 462, 13, 18884, 360, 29366, 10911, 10762, 28731, 396, 7050, 13, 462, 13, 18884, 5097, 360, 9047, 28852, 10911, 29918, 29903, 3210, 26862, 29892, 10911, 29918, 5813, 964, 396, 7050, 29871, 13, 18884, 3895, 2672, 19094, 8098, 29918, 29903, 3210, 26862, 29889, 15032, 5005, 3059, 13, 632, 13, 18884, 5097, 2302, 29898, 29896, 29897, 408, 5195, 29907, 25593, 29918, 18736, 515, 396, 7050, 13, 9651, 5124, 2564, 12181, 29961, 29900, 2314, 13, 13, 1678, 822, 1243, 29918, 21111, 29918, 517, 29918, 7638, 29918, 5696, 29898, 1311, 1125, 13, 4706, 10887, 29918, 2850, 353, 341, 29879, 10520, 6004, 29898, 13, 9651, 376, 29928, 3960, 5348, 3790, 29949, 22840, 26391, 29871, 29896, 29941, 363, 3758, 5656, 3400, 26996, 5348, 29922, 7640, 29905, 3044, 2506, 2139, 29936, 27640, 27982, 29922, 6207, 29936, 1605, 16656, 29918, 5350, 29922, 3582, 29936, 1159, 13, 4706, 11799, 29918, 1445, 353, 10887, 29918, 2850, 29889, 21111, 29918, 517, 29918, 7638, 703, 2622, 1591, 29918, 11010, 29892, 1591, 29918, 978, 515, 2472, 29918, 11010, 29889, 24051, 613, 364, 29908, 29883, 3583, 7382, 613, 376, 1688, 29889, 7638, 1159, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5574, 29892, 2897, 29889, 2084, 29889, 9933, 29898, 7638, 29918, 1445, 29889, 8159, 29918, 1445, 29918, 978, 876, 13, 4706, 4489, 353, 10518, 29889, 949, 29918, 7638, 29898, 7638, 29918, 1445, 29889, 8159, 29918, 1445, 29918, 978, 29892, 16345, 543, 29989, 1159, 13, 4706, 1583, 29889, 9294, 25120, 1008, 29898, 2176, 29889, 12181, 29961, 29900, 1402, 29871, 29900, 29897, 13, 4706, 2897, 29889, 5992, 29898, 7638, 29918, 1445, 29889, 8159, 29918, 1445, 29918, 978, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
oommfc/oommf/oommf.py
spinachslayer420/MSE598-SAF-Project
0
179634
import os import abc import sys import time import datetime import logging import shutil import oommfc as oc import subprocess as sp import ubermagutil as uu import micromagneticmodel as mm log = logging.getLogger(__name__) _cached_oommf_runner = None class OOMMFRunner(metaclass=abc.ABCMeta): """Abstract class for running OOMMF. """ def call(self, argstr, need_stderr=False): """Calls OOMMF by passing ``argstr`` to OOMMF. Parameters ---------- argstr : str Argument string passed to OOMMF. need_stderr : bool If ``need_stderr=True``, standard error is captured. Defaults to ``False``. Raises ------ RuntimeError If an error occured. Returns ------- int When the OOMMF run was successful, ``0`` is returned. Examples -------- 1. Getting OOMMF runner automatically and calling it. >>> import oommfc as oc ... >>> runner = oc.oommf.get_oommf_runner() >>> runner.call(argstr='+version') Running OOMMF... CompletedProcess(...) """ now = datetime.datetime.now() timestamp = '{}/{:02d}/{:02d} {:02d}:{:02d}'.format(now.year, now.month, now.day, now.hour, now.minute) print(f'Running OOMMF ({self.__class__.__name__}) [{timestamp}]... ', end='') tic = time.time() res = self._call(argstr=argstr, need_stderr=need_stderr) self._kill() # kill OOMMF (mostly needed on Windows) toc = time.time() seconds = '({:0.1f} s)'.format(toc - tic) print(seconds) # append seconds to the previous print. if res.returncode != 0: if sys.platform != 'win32': # Only on Linux and MacOS - on Windows we do not get stderr and # stdout. stderr = res.stderr.decode('utf-8', 'replace') stdout = res.stdout.decode('utf-8', 'replace') cmdstr = ' '.join(res.args) print('OOMMF error:') print(f'\tcommand: {cmdstr}') print(f'\tstdout: {cmdstr}') print(f'\tstderr: {stderr}') print('\n') raise RuntimeError('Error in OOMMF run.') return res @abc.abstractmethod def _call(self, argstr, need_stderr=False): """This method should be implemented in subclass. """ pass # pragma: no cover @abc.abstractmethod def _kill(self, targets=('all',)): """This method should be implemented in subclass. """ pass # pragma: no cover @abc.abstractmethod def errors(self): """Returns the content of ``boxsii.errors`` OOMMF file. Returns ------- str ``boxsii.errors`` OOMMF file. """ pass # pragma: no cover def version(self): """Returns the OOMMF version. Returns ------- str OOMMF version. Examples -------- 1. Getting OOMMF version. >>> import oommfc as oc ... >>> runner = oc.oommf.get_oommf_runner() >>> runner.version() Running OOMMF... '...' """ res = self.call(argstr='+version', need_stderr=True) return res.stderr.decode('utf-8').split('oommf.tcl')[-1].strip() def platform(self): """Returns platform seen by OOMMF. Returns ------- str Platform. Examples -------- 1. Getting platform. >>> import oommfc as oc ... >>> runner = oc.oommf.get_oommf_runner() >>> runner.platform() Running OOMMF... '...' """ res = self.call(argstr='+platform', need_stderr=True) return res.stderr.decode('utf-8') @uu.inherit_docs class TclOOMMFRunner(OOMMFRunner): """OOMMF runner using path to ``oommf.tcl``. Parameters ---------- oommf_tcl: str Path to ``oommf.tcl``file. """ def __init__(self, oommf_tcl): self.oommf_tcl = oommf_tcl # a path to oommf.tcl def _call(self, argstr, need_stderr=False): cmd = ['tclsh', self.oommf_tcl, 'boxsi', '+fg', argstr, '-exitondone', '1'] # Not clear why we cannot get stderr and stdout on win32. Calls to # OOMMF get stuck. stdout = stderr = sp.PIPE if sys.platform == 'win32' and not need_stderr: stdout = stderr = None # pragma: no cover return sp.run(cmd, stdout=stdout, stderr=stderr) def _kill(self, targets=['all']): sp.run(['tclsh', self.oommf_tcl, 'killoommf'] + targets) def errors(self): errors_file = os.path.join(os.path.dirname(self.oommf_tcl), 'boxsi.errors') with open(errors_file, 'r') as f: errors = f.read() return errors @uu.inherit_docs class ExeOOMMFRunner(OOMMFRunner): """OOMMF runner using OOMMF executable, which can be found on $PATH. Parameters ---------- oommf_exe: str Name of the OOMMF executable. Defaults to ``oommf``. """ def __init__(self, oommf_exe='oommf'): self.oommf_exe = oommf_exe def _call(self, argstr, need_stderr=False): # Here we might need stderr = stdot = None like in # TclOOMMFRunner for Windows. This is not clear because we # never use ExeOOMMFRunner on Windows. cmd = [self.oommf_exe, 'boxsi', '+fg', argstr, '-exitondone', '1'] return sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE) def _kill(self, targets=['all']): sp.run([self.oommf_exe, 'killoommf'] + targets) def errors(self): try: errors_file = os.path.join( os.path.dirname(shutil.which(self.oommf_exe)), '..', 'opt', 'oommf', 'boxsi.errors') with open(errors_file, 'r') as f: errors = f.read() return errors except FileNotFoundError: msg = 'boxsi.errors cannot be retrieved.' raise EnvironmentError(msg) @uu.inherit_docs class DockerOOMMFRunner(OOMMFRunner): """OOMMF runner using Docker. Parameters ---------- docker_exe: str Docker executable. Defaults to ``docker``. image: str Docker image on DockerHub. Defaults to ``ubermag/oommf``. """ def __init__(self, docker_exe='docker', image='ubermag/oommf'): self.docker_exe = docker_exe self.image = image def _call(self, argstr, need_stderr=False): cmd = [self.docker_exe, 'run', '-v', os.getcwd()+':/io', self.image, '/bin/bash', '-c', ('tclsh /usr/local/oommf/oommf/oommf.tcl boxsi ' '+fg {} -exitondone 1').format(argstr)] return sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE) def _kill(self, targets=('all',)): # There is no need to kill OOMMF when run inside docker. pass def errors(self): msg = 'boxsi.errors cannot be retrieved from Docker container.' raise EnvironmentError(msg) def get_oommf_runner(use_cache=True, envvar='OOMMFTCL', oommf_exe='oommf', docker_exe='docker'): """Find the best available way to run OOMMF. Returns an ``oommfc.oommf.OOMMFRunner`` object, or raises ``EnvironmentError`` if no suitable method is found. Parameters ---------- use_cache : bool The first call to this function will determine the best way to run OOMMF and cache it. Normally, subsequent calls will return the ``OOMMFRunner`` object from the cache. Setting this parameter to ``False`` will cause it to check for available methods again. Defaults to ``True``. envvar : str Name of the environment variable containing the path to ``oommf.tcl``. Defaults to ``'OOMMFTCL'``. oommf_exe : str The name or path of the executable ``oommf`` command. Defaults to ``'oommf'``. docker_exe : str The name or path of the docker command. Defaults to ``'docker'``. Returns ------- oommfc.oommf.OOMMFRunner An OOMMF runner. Raises ------ EnvironmentError If no OOMMF can be found on host. Examples -------- 1. Getting OOMMF Runner. >>> import oommfc as oc ... >>> runner = oc.oommf.get_oommf_runner() >>> isinstance(runner, oc.oommf.OOMMFRunner) True """ global _cached_oommf_runner if use_cache and (_cached_oommf_runner is not None): return _cached_oommf_runner # Check for the OOMMFTCL environment variable pointing to oommf.tcl. oommf_tcl = os.environ.get(envvar, None) if oommf_tcl is not None: cmd = ['tclsh', oommf_tcl, 'boxsi', '+fg', '+version', '-exitondone', '1'] try: res = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE) except FileNotFoundError: log.warning('oommf.tcl was not found.') else: if res.returncode: log.warning('OOMMFTCL is set, but OOMMF could not be run.\n' f'stdout:\n{res.stdout}\n' f'stderr:\n{res.stderr}') else: _cached_oommf_runner = TclOOMMFRunner(oommf_tcl) return _cached_oommf_runner # OOMMF is installed via conda and oommf.tcl is in opt/oommf (Windows). # This would probably also work on MacOS/Linux, but on these operating # systems, when installed via conda, we use 'oommf' executable. if sys.platform == 'win32' and \ os.path.isdir(os.path.join(sys.prefix, 'conda-meta')): oommf_tcl = os.path.join(sys.prefix, 'opt', 'oommf', 'oommf.tcl') if os.path.isfile(oommf_tcl): _cached_oommf_runner = TclOOMMFRunner(oommf_tcl) return _cached_oommf_runner # OOMMF available as an executable - in a conda env on Mac/Linux, or oommf # installed separately. oommf_exe = shutil.which(oommf_exe) if oommf_exe: _cached_oommf_runner = ExeOOMMFRunner(oommf_exe) return _cached_oommf_runner # Check for docker to run OOMMF in a docker image. cmd = [docker_exe, 'images'] try: res = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE) except FileNotFoundError: log.warning('Docker was not found.') else: if res.returncode: log.warning('Error running docker\n' f'stdout:\n{res.stdout}\n' f'stderr:\n{res.stderr}') else: _cached_oommf_runner = DockerOOMMFRunner(docker_exe=docker_exe, image='ubermag/oommf') return _cached_oommf_runner # If OOMMFRunner was not returned up to this point, we raise an # exception. raise EnvironmentError('Cannot find OOMMF.') def status(): """Run a macrospin example for 1 ps through oommfc and print the OOMMF status. Returns ------- int If ``0``, the OOMMF is found and running. Otherwise, ``1`` is returned. Examples -------- 1. Checking the OOMMF status. >>> import oommfc as oc ... >>> oc.oommf.status() Running OOMMF... OOMMF found and running. 0 """ system = mm.examples.macrospin() try: td = oc.TimeDriver() td.drive(system, t=1e-12, n=1) print('OOMMF found and running.') return 0 except (EnvironmentError, RuntimeError): print('Cannot find OOMMF.') return 1 def overhead(): """Run a macrospin example for 1 ps through ``oommfc`` and directly and return the difference in run times. Returns ------- float The time difference (overhead) between running OOMMF though ``oommfc`` and directly. Examples -------- 1. Getting the overhead time. >>> import oommfc as oc ... >>> isinstance(oc.oommf.overhead(), float) Running OOMMF... True """ # Running OOMMF through oommfc. system = mm.examples.macrospin() td = oc.TimeDriver() oommfc_start = time.time() td.drive(system, t=1e-12, n=1, save=True, overwrite=True) oommfc_stop = time.time() oommfc_time = oommfc_stop - oommfc_start # Running OOMMF directly. oommf_runner = get_oommf_runner() mifpath = os.path.realpath(os.path.join(system.name, 'drive-0', 'macrospin.mif')) oommf_start = time.time() oommf_runner.call(mifpath) oommf_stop = time.time() oommf_time = oommf_stop - oommf_start oc.delete(system) return oommfc_time - oommf_time
[ 1, 1053, 2897, 13, 5215, 25638, 13, 5215, 10876, 13, 5215, 931, 13, 5215, 12865, 13, 5215, 12183, 13, 5215, 528, 4422, 13, 5215, 288, 3011, 13801, 408, 12954, 13, 5215, 1014, 5014, 408, 805, 13, 5215, 318, 495, 11082, 4422, 408, 318, 29884, 13, 5215, 20710, 26097, 293, 4299, 408, 5654, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 29918, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 353, 6213, 13, 13, 13, 1990, 438, 6488, 29924, 29943, 16802, 29898, 2527, 562, 605, 29922, 10736, 29889, 19658, 19346, 1125, 13, 1678, 9995, 9118, 770, 363, 2734, 438, 6488, 29924, 29943, 29889, 13, 13, 1678, 9995, 13, 1678, 822, 1246, 29898, 1311, 29892, 1852, 710, 29892, 817, 29918, 303, 20405, 29922, 8824, 1125, 13, 4706, 9995, 29907, 4293, 438, 6488, 29924, 29943, 491, 6819, 4954, 1191, 710, 16159, 304, 438, 6488, 29924, 29943, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1852, 710, 584, 851, 13, 13, 9651, 23125, 1347, 4502, 304, 438, 6488, 29924, 29943, 29889, 13, 13, 4706, 817, 29918, 303, 20405, 584, 6120, 13, 13, 9651, 960, 4954, 26180, 29918, 303, 20405, 29922, 5574, 29952, 1673, 3918, 1059, 338, 15468, 29889, 13109, 29879, 304, 13, 9651, 4954, 8824, 29952, 1412, 13, 13, 4706, 390, 1759, 267, 13, 4706, 448, 23648, 13, 4706, 24875, 2392, 13, 13, 9651, 960, 385, 1059, 2179, 2955, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 938, 13, 13, 9651, 1932, 278, 438, 6488, 29924, 29943, 1065, 471, 9150, 29892, 4954, 29900, 16159, 338, 4133, 29889, 13, 13, 4706, 1222, 9422, 13, 4706, 448, 26589, 13, 308, 29896, 29889, 24162, 438, 6488, 29924, 29943, 28877, 6336, 322, 5432, 372, 29889, 13, 13, 4706, 8653, 1053, 288, 3011, 13801, 408, 12954, 13, 4706, 2023, 13, 4706, 8653, 28877, 353, 12954, 29889, 29877, 3011, 29888, 29889, 657, 29918, 29877, 3011, 29888, 29918, 27492, 580, 13, 4706, 8653, 28877, 29889, 4804, 29898, 1191, 710, 2433, 29974, 3259, 1495, 13, 4706, 19509, 438, 6488, 29924, 29943, 856, 13, 4706, 15642, 9446, 7032, 29077, 13, 13, 4706, 9995, 13, 4706, 1286, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 4706, 14334, 353, 22372, 6822, 25641, 29900, 29906, 29881, 6822, 25641, 29900, 29906, 29881, 29913, 12365, 29900, 29906, 29881, 6177, 25641, 29900, 29906, 29881, 29913, 4286, 4830, 29898, 3707, 29889, 6360, 29892, 13, 462, 462, 462, 9651, 1286, 29889, 10874, 29892, 13, 462, 462, 462, 9651, 1286, 29889, 3250, 29892, 13, 462, 462, 462, 9651, 1286, 29889, 18721, 29892, 13, 462, 462, 462, 9651, 1286, 29889, 1195, 1082, 29897, 13, 4706, 1596, 29898, 29888, 29915, 27795, 438, 6488, 29924, 29943, 21313, 1311, 17255, 1990, 1649, 17255, 978, 1649, 1800, 15974, 16394, 6525, 856, 13420, 13, 795, 1095, 2433, 1495, 13, 13, 4706, 260, 293, 353, 931, 29889, 2230, 580, 13, 4706, 620, 353, 1583, 3032, 4804, 29898, 1191, 710, 29922, 1191, 710, 29892, 817, 29918, 303, 20405, 29922, 26180, 29918, 303, 20405, 29897, 13, 4706, 1583, 3032, 21174, 580, 29871, 396, 12088, 438, 6488, 29924, 29943, 313, 3242, 368, 4312, 373, 3852, 29897, 13, 4706, 304, 29883, 353, 931, 29889, 2230, 580, 13, 4706, 6923, 353, 525, 3319, 29901, 29900, 29889, 29896, 29888, 29913, 269, 29897, 4286, 4830, 29898, 517, 29883, 448, 260, 293, 29897, 13, 4706, 1596, 29898, 23128, 29897, 29871, 396, 9773, 6923, 304, 278, 3517, 1596, 29889, 13, 13, 4706, 565, 620, 29889, 2457, 401, 2804, 29871, 29900, 29901, 13, 9651, 565, 10876, 29889, 12120, 2804, 525, 5080, 29941, 29906, 2396, 13, 18884, 396, 9333, 373, 8074, 322, 4326, 3267, 448, 373, 3852, 591, 437, 451, 679, 380, 20405, 322, 13, 18884, 396, 27591, 29889, 13, 18884, 380, 20405, 353, 620, 29889, 303, 20405, 29889, 13808, 877, 9420, 29899, 29947, 742, 525, 6506, 1495, 13, 18884, 27591, 353, 620, 29889, 25393, 29889, 13808, 877, 9420, 29899, 29947, 742, 525, 6506, 1495, 13, 18884, 9920, 710, 353, 525, 15300, 7122, 29898, 690, 29889, 5085, 29897, 13, 18884, 1596, 877, 29949, 6488, 29924, 29943, 1059, 29901, 1495, 13, 18884, 1596, 29898, 29888, 12764, 29873, 6519, 29901, 426, 9006, 710, 29913, 1495, 13, 18884, 1596, 29898, 29888, 12764, 29873, 25393, 29901, 426, 9006, 710, 29913, 1495, 13, 18884, 1596, 29898, 29888, 12764, 29873, 303, 20405, 29901, 426, 303, 20405, 29913, 1495, 13, 18884, 1596, 28909, 29876, 1495, 13, 9651, 12020, 24875, 2392, 877, 2392, 297, 438, 6488, 29924, 29943, 1065, 29889, 1495, 13, 13, 4706, 736, 620, 13, 13, 1678, 732, 10736, 29889, 16595, 5696, 13, 1678, 822, 903, 4804, 29898, 1311, 29892, 1852, 710, 29892, 817, 29918, 303, 20405, 29922, 8824, 1125, 13, 4706, 9995, 4013, 1158, 881, 367, 8762, 297, 19481, 29889, 13, 13, 4706, 9995, 13, 4706, 1209, 29871, 396, 282, 23929, 29901, 694, 4612, 13, 13, 1678, 732, 10736, 29889, 16595, 5696, 13, 1678, 822, 903, 21174, 29898, 1311, 29892, 22525, 29922, 877, 497, 742, 22164, 13, 4706, 9995, 4013, 1158, 881, 367, 8762, 297, 19481, 29889, 13, 13, 4706, 9995, 13, 4706, 1209, 29871, 396, 282, 23929, 29901, 694, 4612, 13, 13, 1678, 732, 10736, 29889, 16595, 5696, 13, 1678, 822, 4436, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 2793, 310, 4954, 1884, 1039, 29875, 29889, 12523, 16159, 438, 6488, 29924, 29943, 934, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 851, 13, 13, 9651, 4954, 1884, 1039, 29875, 29889, 12523, 16159, 438, 6488, 29924, 29943, 934, 29889, 13, 13, 4706, 9995, 13, 4706, 1209, 29871, 396, 282, 23929, 29901, 694, 4612, 13, 13, 1678, 822, 1873, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 278, 438, 6488, 29924, 29943, 1873, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 851, 13, 13, 9651, 438, 6488, 29924, 29943, 1873, 29889, 13, 13, 4706, 1222, 9422, 13, 4706, 448, 26589, 13, 308, 29896, 29889, 24162, 438, 6488, 29924, 29943, 1873, 29889, 13, 13, 4706, 8653, 1053, 288, 3011, 13801, 408, 12954, 13, 4706, 2023, 13, 4706, 8653, 28877, 353, 12954, 29889, 29877, 3011, 29888, 29889, 657, 29918, 29877, 3011, 29888, 29918, 27492, 580, 13, 4706, 8653, 28877, 29889, 3259, 580, 13, 4706, 19509, 438, 6488, 29924, 29943, 856, 13, 4706, 525, 856, 29915, 13, 13, 4706, 9995, 13, 4706, 620, 353, 1583, 29889, 4804, 29898, 1191, 710, 2433, 29974, 3259, 742, 817, 29918, 303, 20405, 29922, 5574, 29897, 13, 4706, 736, 620, 29889, 303, 20405, 29889, 13808, 877, 9420, 29899, 29947, 2824, 5451, 877, 29877, 3011, 29888, 29889, 29873, 695, 1495, 14352, 29896, 1822, 17010, 580, 13, 13, 1678, 822, 7481, 29898, 1311, 1125, 13, 4706, 9995, 11609, 29879, 7481, 3595, 491, 438, 6488, 29924, 29943, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 851, 13, 13, 9651, 28096, 29889, 13, 13, 4706, 1222, 9422, 13, 4706, 448, 26589, 13, 308, 29896, 29889, 24162, 7481, 29889, 13, 13, 4706, 8653, 1053, 288, 3011, 13801, 408, 12954, 13, 4706, 2023, 13, 4706, 8653, 28877, 353, 12954, 29889, 29877, 3011, 29888, 29889, 657, 29918, 29877, 3011, 29888, 29918, 27492, 580, 13, 4706, 8653, 28877, 29889, 12120, 580, 13, 4706, 19509, 438, 6488, 29924, 29943, 856, 13, 4706, 525, 856, 29915, 13, 13, 4706, 9995, 13, 4706, 620, 353, 1583, 29889, 4804, 29898, 1191, 710, 2433, 29974, 12120, 742, 817, 29918, 303, 20405, 29922, 5574, 29897, 13, 4706, 736, 620, 29889, 303, 20405, 29889, 13808, 877, 9420, 29899, 29947, 1495, 13, 13, 13, 29992, 29884, 29884, 29889, 262, 27069, 29918, 2640, 13, 1990, 323, 695, 29949, 6488, 29924, 29943, 16802, 29898, 29949, 6488, 29924, 29943, 16802, 1125, 13, 1678, 9995, 29949, 6488, 29924, 29943, 28877, 773, 2224, 304, 4954, 29877, 3011, 29888, 29889, 29873, 695, 29952, 1412, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 288, 3011, 29888, 29918, 29873, 695, 29901, 851, 13, 13, 4706, 10802, 304, 4954, 29877, 3011, 29888, 29889, 29873, 695, 16159, 1445, 29889, 13, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 288, 3011, 29888, 29918, 29873, 695, 1125, 13, 4706, 1583, 29889, 29877, 3011, 29888, 29918, 29873, 695, 353, 288, 3011, 29888, 29918, 29873, 695, 29871, 396, 263, 2224, 304, 288, 3011, 29888, 29889, 29873, 695, 13, 13, 1678, 822, 903, 4804, 29898, 1311, 29892, 1852, 710, 29892, 817, 29918, 303, 20405, 29922, 8824, 1125, 13, 4706, 9920, 353, 6024, 29873, 695, 845, 742, 1583, 29889, 29877, 3011, 29888, 29918, 29873, 695, 29892, 525, 1884, 1039, 742, 525, 29974, 16434, 742, 13, 1669, 1852, 710, 29892, 17411, 13322, 898, 650, 742, 525, 29896, 2033, 13, 13, 4706, 396, 2216, 2821, 2020, 591, 2609, 679, 380, 20405, 322, 27591, 373, 5401, 29941, 29906, 29889, 315, 4293, 304, 13, 4706, 396, 438, 6488, 29924, 29943, 679, 10771, 29889, 13, 4706, 27591, 353, 380, 20405, 353, 805, 29889, 2227, 4162, 13, 4706, 565, 10876, 29889, 12120, 1275, 525, 5080, 29941, 29906, 29915, 322, 451, 817, 29918, 303, 20405, 29901, 13, 9651, 27591, 353, 380, 20405, 353, 6213, 29871, 396, 282, 23929, 29901, 694, 4612, 13, 13, 4706, 736, 805, 29889, 3389, 29898, 9006, 29892, 27591, 29922, 25393, 29892, 380, 20405, 29922, 303, 20405, 29897, 13, 13, 1678, 822, 903, 21174, 29898, 1311, 29892, 22525, 29922, 1839, 497, 2033, 1125, 13, 4706, 805, 29889, 3389, 18959, 29873, 695, 845, 742, 1583, 29889, 29877, 3011, 29888, 29918, 29873, 695, 29892, 525, 29895, 9093, 3011, 29888, 2033, 718, 22525, 29897, 13, 13, 1678, 822, 4436, 29898, 1311, 1125, 13, 4706, 4436, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 29898, 1311, 29889, 29877, 3011, 29888, 29918, 29873, 695, 511, 13, 462, 462, 259, 525, 1884, 1039, 29889, 12523, 1495, 13, 4706, 411, 1722, 29898, 12523, 29918, 1445, 29892, 525, 29878, 1495, 408, 285, 29901, 13, 9651, 4436, 353, 285, 29889, 949, 580, 13, 13, 4706, 736, 4436, 13, 13, 13, 29992, 29884, 29884, 29889, 262, 27069, 29918, 2640, 13, 1990, 1222, 29872, 29949, 6488, 29924, 29943, 16802, 29898, 29949, 6488, 29924, 29943, 16802, 1125, 13, 1678, 9995, 29949, 6488, 29924, 29943, 28877, 773, 438, 6488, 29924, 29943, 16813, 29892, 607, 508, 367, 1476, 373, 395, 10145, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 288, 3011, 29888, 29918, 8097, 29901, 851, 13, 13, 4706, 4408, 310, 278, 438, 6488, 29924, 29943, 16813, 29889, 13109, 29879, 304, 4954, 29877, 3011, 29888, 29952, 1412, 13, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 288, 3011, 29888, 29918, 8097, 2433, 29877, 3011, 29888, 29374, 13, 4706, 1583, 29889, 29877, 3011, 29888, 29918, 8097, 353, 288, 3011, 29888, 29918, 8097, 13, 13, 1678, 822, 903, 4804, 29898, 1311, 29892, 1852, 710, 29892, 817, 29918, 303, 20405, 29922, 8824, 1125, 13, 4706, 396, 2266, 591, 1795, 817, 380, 20405, 353, 3659, 327, 353, 6213, 763, 297, 13, 4706, 396, 323, 695, 29949, 6488, 29924, 29943, 16802, 363, 3852, 29889, 29871, 910, 338, 451, 2821, 1363, 591, 13, 4706, 396, 2360, 671, 1222, 29872, 29949, 6488, 29924, 29943, 16802, 373, 3852, 29889, 13, 4706, 9920, 353, 518, 1311, 29889, 29877, 3011, 29888, 29918, 8097, 29892, 525, 1884, 1039, 742, 525, 29974, 16434, 742, 1852, 710, 29892, 17411, 13322, 898, 650, 742, 525, 29896, 2033, 13, 4706, 736, 805, 29889, 3389, 29898, 9006, 29892, 27591, 29922, 1028, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1028, 29889, 2227, 4162, 29897, 13, 13, 1678, 822, 903, 21174, 29898, 1311, 29892, 22525, 29922, 1839, 497, 2033, 1125, 13, 4706, 805, 29889, 3389, 4197, 1311, 29889, 29877, 3011, 29888, 29918, 8097, 29892, 525, 29895, 9093, 3011, 29888, 2033, 718, 22525, 29897, 13, 13, 1678, 822, 4436, 29898, 1311, 1125, 13, 4706, 1018, 29901, 13, 9651, 4436, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 29898, 13, 18884, 2897, 29889, 2084, 29889, 25721, 29898, 845, 4422, 29889, 4716, 29898, 1311, 29889, 29877, 3011, 29888, 29918, 8097, 8243, 13, 18884, 525, 636, 742, 525, 3670, 742, 525, 29877, 3011, 29888, 742, 525, 1884, 1039, 29889, 12523, 1495, 13, 9651, 411, 1722, 29898, 12523, 29918, 1445, 29892, 525, 29878, 1495, 408, 285, 29901, 13, 18884, 4436, 353, 285, 29889, 949, 580, 13, 9651, 736, 4436, 13, 13, 4706, 5174, 3497, 17413, 2392, 29901, 13, 9651, 10191, 353, 525, 1884, 1039, 29889, 12523, 2609, 367, 27387, 6169, 13, 9651, 12020, 16738, 2392, 29898, 7645, 29897, 13, 13, 13, 29992, 29884, 29884, 29889, 262, 27069, 29918, 2640, 13, 1990, 20868, 29949, 6488, 29924, 29943, 16802, 29898, 29949, 6488, 29924, 29943, 16802, 1125, 13, 1678, 9995, 29949, 6488, 29924, 29943, 28877, 773, 20868, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 10346, 29918, 8097, 29901, 851, 13, 13, 4706, 20868, 16813, 29889, 13109, 29879, 304, 4954, 14695, 29952, 1412, 13, 13, 1678, 1967, 29901, 851, 13, 13, 4706, 20868, 1967, 373, 20868, 16046, 29889, 13109, 29879, 304, 4954, 431, 837, 351, 29914, 29877, 3011, 29888, 29952, 1412, 13, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 10346, 29918, 8097, 2433, 14695, 742, 1967, 2433, 431, 837, 351, 29914, 29877, 3011, 29888, 29374, 13, 4706, 1583, 29889, 14695, 29918, 8097, 353, 10346, 29918, 8097, 13, 4706, 1583, 29889, 3027, 353, 1967, 13, 13, 1678, 822, 903, 4804, 29898, 1311, 29892, 1852, 710, 29892, 817, 29918, 303, 20405, 29922, 8824, 1125, 13, 4706, 9920, 353, 518, 1311, 29889, 14695, 29918, 8097, 29892, 525, 3389, 742, 17411, 29894, 742, 2897, 29889, 657, 29883, 9970, 580, 29974, 2396, 29914, 601, 742, 13, 1669, 1583, 29889, 3027, 29892, 8207, 2109, 29914, 13067, 742, 17411, 29883, 742, 13, 1669, 6702, 29873, 695, 845, 847, 4855, 29914, 2997, 29914, 29877, 3011, 29888, 29914, 29877, 3011, 29888, 29914, 29877, 3011, 29888, 29889, 29873, 695, 3800, 1039, 525, 13, 18884, 525, 29974, 16434, 6571, 448, 13322, 898, 650, 29871, 29896, 2824, 4830, 29898, 1191, 710, 4638, 13, 4706, 736, 805, 29889, 3389, 29898, 9006, 29892, 27591, 29922, 1028, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1028, 29889, 2227, 4162, 29897, 13, 13, 1678, 822, 903, 21174, 29898, 1311, 29892, 22525, 29922, 877, 497, 742, 22164, 13, 4706, 396, 1670, 338, 694, 817, 304, 12088, 438, 6488, 29924, 29943, 746, 1065, 2768, 10346, 29889, 13, 4706, 1209, 13, 13, 1678, 822, 4436, 29898, 1311, 1125, 13, 4706, 10191, 353, 525, 1884, 1039, 29889, 12523, 2609, 367, 27387, 515, 20868, 5639, 6169, 13, 4706, 12020, 16738, 2392, 29898, 7645, 29897, 13, 13, 13, 1753, 679, 29918, 29877, 3011, 29888, 29918, 27492, 29898, 1509, 29918, 8173, 29922, 5574, 29892, 8829, 1707, 2433, 29949, 6488, 29924, 7818, 6154, 742, 13, 462, 268, 288, 3011, 29888, 29918, 8097, 2433, 29877, 3011, 29888, 742, 10346, 29918, 8097, 2433, 14695, 29374, 13, 1678, 9995, 12542, 278, 1900, 3625, 982, 304, 1065, 438, 6488, 29924, 29943, 29889, 13, 13, 1678, 16969, 385, 4954, 29877, 3011, 13801, 29889, 29877, 3011, 29888, 29889, 29949, 6488, 29924, 29943, 16802, 16159, 1203, 29892, 470, 1153, 4637, 13, 1678, 4954, 18649, 2392, 16159, 565, 694, 13907, 1158, 338, 1476, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 671, 29918, 8173, 584, 6120, 13, 13, 418, 450, 937, 1246, 304, 445, 740, 674, 8161, 278, 1900, 982, 304, 1065, 438, 6488, 29924, 29943, 13, 418, 322, 7090, 372, 29889, 5655, 635, 29892, 15352, 5717, 674, 736, 278, 4954, 29949, 6488, 29924, 29943, 16802, 16159, 13, 418, 1203, 515, 278, 7090, 29889, 21605, 445, 3443, 304, 4954, 8824, 16159, 674, 4556, 372, 13, 418, 304, 1423, 363, 3625, 3519, 1449, 29889, 13109, 29879, 304, 4954, 5574, 29952, 1412, 13, 13, 1678, 8829, 1707, 584, 851, 13, 13, 418, 4408, 310, 278, 5177, 2286, 6943, 278, 2224, 304, 4954, 29877, 3011, 29888, 29889, 29873, 695, 29952, 1412, 13, 418, 13109, 29879, 304, 4954, 29915, 29949, 6488, 29924, 7818, 6154, 11120, 1412, 13, 13, 1678, 288, 3011, 29888, 29918, 8097, 584, 851, 13, 13, 418, 450, 1024, 470, 2224, 310, 278, 16813, 4954, 29877, 3011, 29888, 16159, 1899, 29889, 13109, 29879, 304, 13, 418, 4954, 29915, 29877, 3011, 29888, 11120, 1412, 13, 13, 1678, 10346, 29918, 8097, 584, 851, 13, 13, 418, 450, 1024, 470, 2224, 310, 278, 10346, 1899, 29889, 13109, 29879, 304, 4954, 29915, 14695, 11120, 1412, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 288, 3011, 13801, 29889, 29877, 3011, 29888, 29889, 29949, 6488, 29924, 29943, 16802, 13, 13, 4706, 530, 438, 6488, 29924, 29943, 28877, 29889, 13, 13, 1678, 390, 1759, 267, 13, 1678, 448, 23648, 13, 1678, 16738, 2392, 13, 13, 4706, 960, 694, 438, 6488, 29924, 29943, 508, 367, 1476, 373, 3495, 29889, 13, 13, 1678, 1222, 9422, 13, 1678, 448, 26589, 13, 268, 29896, 29889, 24162, 438, 6488, 29924, 29943, 7525, 1089, 29889, 13, 13, 1678, 8653, 1053, 288, 3011, 13801, 408, 12954, 13, 1678, 2023, 13, 1678, 8653, 28877, 353, 12954, 29889, 29877, 3011, 29888, 29889, 657, 29918, 29877, 3011, 29888, 29918, 27492, 580, 13, 1678, 8653, 338, 8758, 29898, 27492, 29892, 12954, 29889, 29877, 3011, 29888, 29889, 29949, 6488, 29924, 29943, 16802, 29897, 13, 1678, 5852, 13, 13, 1678, 9995, 13, 1678, 5534, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 13, 1678, 565, 671, 29918, 8173, 322, 9423, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 338, 451, 6213, 1125, 13, 4706, 736, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 13, 13, 1678, 396, 5399, 363, 278, 438, 6488, 29924, 7818, 6154, 5177, 2286, 13330, 304, 288, 3011, 29888, 29889, 29873, 695, 29889, 13, 1678, 288, 3011, 29888, 29918, 29873, 695, 353, 2897, 29889, 21813, 29889, 657, 29898, 6272, 1707, 29892, 6213, 29897, 13, 1678, 565, 288, 3011, 29888, 29918, 29873, 695, 338, 451, 6213, 29901, 13, 4706, 9920, 353, 6024, 29873, 695, 845, 742, 288, 3011, 29888, 29918, 29873, 695, 29892, 525, 1884, 1039, 742, 13, 1669, 525, 29974, 16434, 742, 525, 29974, 3259, 742, 17411, 13322, 898, 650, 742, 525, 29896, 2033, 13, 4706, 1018, 29901, 13, 9651, 620, 353, 805, 29889, 3389, 29898, 9006, 29892, 27591, 29922, 1028, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1028, 29889, 2227, 4162, 29897, 13, 4706, 5174, 3497, 17413, 2392, 29901, 13, 9651, 1480, 29889, 27392, 877, 29877, 3011, 29888, 29889, 29873, 695, 471, 451, 1476, 29889, 1495, 13, 4706, 1683, 29901, 13, 9651, 565, 620, 29889, 2457, 401, 29901, 13, 18884, 1480, 29889, 27392, 877, 29949, 6488, 29924, 7818, 6154, 338, 731, 29892, 541, 438, 6488, 29924, 29943, 1033, 451, 367, 1065, 7790, 29876, 29915, 13, 462, 9651, 285, 29915, 25393, 3583, 29876, 29912, 690, 29889, 25393, 1012, 29876, 29915, 13, 462, 9651, 285, 29915, 303, 20405, 3583, 29876, 29912, 690, 29889, 303, 20405, 29913, 1495, 13, 9651, 1683, 29901, 13, 18884, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 353, 323, 695, 29949, 6488, 29924, 29943, 16802, 29898, 29877, 3011, 29888, 29918, 29873, 695, 29897, 13, 18884, 736, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 13, 13, 1678, 396, 438, 6488, 29924, 29943, 338, 5130, 3025, 378, 1388, 322, 288, 3011, 29888, 29889, 29873, 695, 338, 297, 3523, 29914, 29877, 3011, 29888, 313, 7685, 467, 13, 1678, 396, 910, 723, 3117, 884, 664, 373, 4326, 3267, 29914, 24085, 29892, 541, 373, 1438, 13598, 13, 1678, 396, 6757, 29892, 746, 5130, 3025, 378, 1388, 29892, 591, 671, 525, 29877, 3011, 29888, 29915, 16813, 29889, 13, 1678, 565, 10876, 29889, 12120, 1275, 525, 5080, 29941, 29906, 29915, 322, 320, 13, 539, 2897, 29889, 2084, 29889, 275, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 9675, 29889, 13506, 29892, 525, 18050, 29899, 7299, 8785, 29901, 13, 4706, 288, 3011, 29888, 29918, 29873, 695, 353, 2897, 29889, 2084, 29889, 7122, 29898, 9675, 29889, 13506, 29892, 525, 3670, 742, 525, 29877, 3011, 29888, 742, 525, 29877, 3011, 29888, 29889, 29873, 695, 1495, 13, 4706, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 29877, 3011, 29888, 29918, 29873, 695, 1125, 13, 9651, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 353, 323, 695, 29949, 6488, 29924, 29943, 16802, 29898, 29877, 3011, 29888, 29918, 29873, 695, 29897, 13, 9651, 736, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 13, 13, 1678, 396, 438, 6488, 29924, 29943, 3625, 408, 385, 16813, 448, 297, 263, 378, 1388, 8829, 373, 4326, 29914, 24085, 29892, 470, 288, 3011, 29888, 13, 1678, 396, 5130, 16949, 29889, 13, 1678, 288, 3011, 29888, 29918, 8097, 353, 528, 4422, 29889, 4716, 29898, 29877, 3011, 29888, 29918, 8097, 29897, 13, 1678, 565, 288, 3011, 29888, 29918, 8097, 29901, 13, 4706, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 353, 1222, 29872, 29949, 6488, 29924, 29943, 16802, 29898, 29877, 3011, 29888, 29918, 8097, 29897, 13, 4706, 736, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 13, 13, 1678, 396, 5399, 363, 10346, 304, 1065, 438, 6488, 29924, 29943, 297, 263, 10346, 1967, 29889, 13, 1678, 9920, 353, 518, 14695, 29918, 8097, 29892, 525, 8346, 2033, 13, 1678, 1018, 29901, 13, 4706, 620, 353, 805, 29889, 3389, 29898, 9006, 29892, 27591, 29922, 1028, 29889, 2227, 4162, 29892, 380, 20405, 29922, 1028, 29889, 2227, 4162, 29897, 13, 1678, 5174, 3497, 17413, 2392, 29901, 13, 4706, 1480, 29889, 27392, 877, 29928, 8658, 471, 451, 1476, 29889, 1495, 13, 1678, 1683, 29901, 13, 4706, 565, 620, 29889, 2457, 401, 29901, 13, 9651, 1480, 29889, 27392, 877, 2392, 2734, 10346, 29905, 29876, 29915, 13, 462, 4706, 285, 29915, 25393, 3583, 29876, 29912, 690, 29889, 25393, 1012, 29876, 29915, 13, 462, 4706, 285, 29915, 303, 20405, 3583, 29876, 29912, 690, 29889, 303, 20405, 29913, 1495, 13, 4706, 1683, 29901, 13, 9651, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 353, 20868, 29949, 6488, 29924, 29943, 16802, 29898, 14695, 29918, 8097, 29922, 14695, 29918, 8097, 29892, 13, 462, 462, 462, 268, 1967, 2433, 431, 837, 351, 29914, 29877, 3011, 29888, 1495, 13, 9651, 736, 903, 29883, 3791, 29918, 29877, 3011, 29888, 29918, 27492, 13, 13, 1678, 396, 960, 438, 6488, 29924, 29943, 16802, 471, 451, 4133, 701, 304, 445, 1298, 29892, 591, 12020, 385, 13, 1678, 396, 3682, 29889, 13, 1678, 12020, 16738, 2392, 877, 29089, 1284, 438, 6488, 29924, 29943, 29889, 1495, 13, 13, 13, 1753, 4660, 7295, 13, 1678, 9995, 6558, 263, 11758, 1028, 262, 1342, 363, 29871, 29896, 6529, 1549, 288, 3011, 13801, 322, 1596, 278, 438, 6488, 29924, 29943, 13, 1678, 4660, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 938, 13, 13, 4706, 960, 4954, 29900, 29952, 1673, 278, 438, 6488, 29924, 29943, 338, 1476, 322, 2734, 29889, 13466, 29892, 4954, 29896, 16159, 338, 4133, 29889, 13, 13, 1678, 1222, 9422, 13, 1678, 448, 26589, 13, 268, 29896, 29889, 5399, 292, 278, 438, 6488, 29924, 29943, 4660, 29889, 13, 13, 1678, 8653, 1053, 288, 3011, 13801, 408, 12954, 13, 1678, 2023, 13, 1678, 8653, 12954, 29889, 29877, 3011, 29888, 29889, 4882, 580, 13, 1678, 19509, 438, 6488, 29924, 29943, 856, 13, 1678, 438, 6488, 29924, 29943, 1476, 322, 2734, 29889, 13, 268, 29900, 13, 13, 1678, 9995, 13, 1678, 1788, 353, 5654, 29889, 19057, 29889, 25254, 1028, 262, 580, 13, 1678, 1018, 29901, 13, 4706, 22599, 353, 12954, 29889, 2481, 12376, 580, 13, 4706, 22599, 29889, 21594, 29898, 5205, 29892, 260, 29922, 29896, 29872, 29899, 29896, 29906, 29892, 302, 29922, 29896, 29897, 13, 4706, 1596, 877, 29949, 6488, 29924, 29943, 1476, 322, 2734, 29889, 1495, 13, 4706, 736, 29871, 29900, 13, 1678, 5174, 313, 18649, 2392, 29892, 24875, 2392, 1125, 13, 4706, 1596, 877, 29089, 1284, 438, 6488, 29924, 29943, 29889, 1495, 13, 4706, 736, 29871, 29896, 13, 13, 13, 1753, 18702, 7295, 13, 1678, 9995, 6558, 263, 11758, 1028, 262, 1342, 363, 29871, 29896, 6529, 1549, 4954, 29877, 3011, 13801, 16159, 322, 4153, 322, 13, 1678, 736, 278, 4328, 297, 1065, 3064, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 5785, 13, 13, 418, 450, 931, 4328, 313, 957, 2813, 29897, 1546, 2734, 438, 6488, 29924, 29943, 2466, 4954, 29877, 3011, 13801, 16159, 13, 418, 322, 4153, 29889, 13, 13, 1678, 1222, 9422, 13, 1678, 448, 26589, 13, 268, 29896, 29889, 24162, 278, 18702, 931, 29889, 13, 13, 1678, 8653, 1053, 288, 3011, 13801, 408, 12954, 13, 1678, 2023, 13, 1678, 8653, 338, 8758, 29898, 542, 29889, 29877, 3011, 29888, 29889, 957, 2813, 3285, 5785, 29897, 13, 1678, 19509, 438, 6488, 29924, 29943, 856, 13, 1678, 5852, 13, 13, 1678, 9995, 13, 1678, 396, 19509, 438, 6488, 29924, 29943, 1549, 288, 3011, 13801, 29889, 13, 1678, 1788, 353, 5654, 29889, 19057, 29889, 25254, 1028, 262, 580, 13, 1678, 22599, 353, 12954, 29889, 2481, 12376, 580, 13, 1678, 288, 3011, 13801, 29918, 2962, 353, 931, 29889, 2230, 580, 13, 1678, 22599, 29889, 21594, 29898, 5205, 29892, 260, 29922, 29896, 29872, 29899, 29896, 29906, 29892, 302, 29922, 29896, 29892, 4078, 29922, 5574, 29892, 26556, 29922, 5574, 29897, 13, 1678, 288, 3011, 13801, 29918, 9847, 353, 931, 29889, 2230, 580, 13, 1678, 288, 3011, 13801, 29918, 2230, 353, 288, 3011, 13801, 29918, 9847, 448, 288, 3011, 13801, 29918, 2962, 13, 13, 1678, 396, 19509, 438, 6488, 29924, 29943, 4153, 29889, 13, 1678, 288, 3011, 29888, 29918, 27492, 353, 679, 29918, 29877, 3011, 29888, 29918, 27492, 580, 13, 1678, 286, 361, 2084, 353, 2897, 29889, 2084, 29889, 6370, 2084, 29898, 359, 29889, 2084, 29889, 7122, 29898, 5205, 29889, 978, 29892, 13, 462, 462, 9651, 525, 21594, 29899, 29900, 742, 13, 462, 462, 9651, 525, 25254, 1028, 262, 29889, 29885, 361, 8785, 13, 1678, 288, 3011, 29888, 29918, 2962, 353, 931, 29889, 2230, 580, 13, 1678, 288, 3011, 29888, 29918, 27492, 29889, 4804, 29898, 29885, 361, 2084, 29897, 13, 1678, 288, 3011, 29888, 29918, 9847, 353, 931, 29889, 2230, 580, 13, 1678, 288, 3011, 29888, 29918, 2230, 353, 288, 3011, 29888, 29918, 9847, 448, 288, 3011, 29888, 29918, 2962, 13, 1678, 12954, 29889, 8143, 29898, 5205, 29897, 13, 13, 1678, 736, 288, 3011, 13801, 29918, 2230, 448, 288, 3011, 29888, 29918, 2230, 13, 2 ]
__init__.py
allan920693/PTT-Photo-Crawler-with-Scrapy
0
1600971
# coding=utf-8 # This package will contain the spiders of your Scrapy project # # Please refer to the documentation for information on how to create and manage # your spiders. import scrapy import logging from scrapy.http import FormRequest import datetime from ptt.items import PostItem import re class PTTSpider(scrapy.Spider): name = 'ptt' allowed_domains = ['ptt.cc'] start_urls = ('https://www.ptt.cc/bbs/Gossiping/index.html', ) _retries = 0 MAX_RETRY = 1 _pages = 0 MAX_PAGES = 4 #Maxixum number of crawled pages total_score_threshold = 20 # Threshold of push score (for filtering) keyword = [u'政治',u'藍營',u'綠營',u'總統','立法',u'行政',u'執政',] # Please specify your keyword keyword_count_threshold = 1 # Threshold of keyword occurence (for filtering) def parse(self, response): if len(response.xpath('//div[@class="over18-notice"]')) > 0: if self._retries < PTTSpider.MAX_RETRY: self._retries += 1 logging.warning('retry {} times...'.format(self._retries)) yield FormRequest.from_response(response, formdata={'yes': 'yes'}, callback=self.parse) else: logging.warning('!!!!!!!!!!!!!!!!!you cannot pass!!!!!!!!!!!!!!') else: filename = response.url.split('/')[-2] + '.html' with open(filename, 'wb') as f: f.write(response.body) self._pages += 1 for href in response.css('.r-ent > div.title > a::attr(href)'): url = response.urljoin(href.extract()) yield scrapy.Request(url, callback=self.parse_post) if self._pages < PTTSpider.MAX_PAGES: next_page = response.xpath(u'//div[@id="action-bar-container"]//a[contains(text(), "上頁")]/@href') logging.warning(next_page) logging.warning('231') if next_page: url = response.urljoin(next_page[0].extract()) yield scrapy.Request(url, self.parse) else: logging.warning('no next page') else: logging.warning('max pages reached') def parse_post(self, response): item = PostItem() # item['title'] = response.xpath( # '//meta[@property="og:title"]/@content')[0].extract() # item['author'] = response.xpath( # u'//div[@class="article-metaline"]/span[text()="作者"]/following-sibling::span[1]/text()')[ # 0].extract().split(' ')[0] # datetime_str = response.xpath( # u'//div[@class="article-metaline"]/span[text()="時間"]/following-sibling::span[1]/text()')[ # 0].extract() # item['date'] = datetime.datetime.strptime(datetime_str, '%a %b %d %H:%M:%S %Y') # item['content'] = response.xpath('//div[@id="main-content"]/text()')[0].extract() comments = [] total_score = 0 for comment in response.xpath('//div[@class="push"]'): push_tag = comment.css('span.push-tag::text')[0].extract() push_user = comment.css('span.push-userid::text')[0].extract() push_content = comment.css('span.push-content::text')[0].extract() if u'推' in push_tag: score = 1 elif u'噓' in push_tag: score = -1 else: score = 0 total_score += score comments.append({'user': push_user, 'content': push_content, 'score': score}) # item['comments'] = comments # item['score'] = total_score # item['url'] = response.url if total_score >= self.total_score_threshold: check_content = response.xpath('//div[@id="main-content"]/text()')[ 0].extract() keyword_count = 0 for i in range(0,len(self.keyword),1): if re.search(self.keyword[i],check_content): keyword_count+=1 else: continue if keyword_count >= self.keyword_count_threshold: incontent = response.xpath('//div[@id="main-content"]') for incontent_href in incontent.css('a::attr(href)'): if re.search('.png',incontent_href.extract()): item['incontent_url'] = incontent_href.extract() item['incontent_url_type'] = '.png' if re.search('.jpg',incontent_href.extract()): item['incontent_url'] = incontent_href.extract() item['incontent_url_type'] = '.jpg' yield item
[ 1, 396, 14137, 29922, 9420, 29899, 29947, 13, 29937, 910, 3577, 674, 1712, 278, 805, 11376, 310, 596, 2522, 336, 2272, 2060, 13, 29937, 13, 29937, 3529, 2737, 304, 278, 5106, 363, 2472, 373, 920, 304, 1653, 322, 10933, 13, 29937, 596, 805, 11376, 29889, 13, 5215, 24559, 2272, 13, 5215, 12183, 13, 3166, 24559, 2272, 29889, 1124, 1053, 3812, 3089, 13, 5215, 12865, 13, 3166, 282, 698, 29889, 7076, 1053, 4918, 2001, 13, 5215, 337, 13, 13, 13, 13, 13, 13, 1990, 349, 19988, 5592, 1241, 29898, 1557, 336, 2272, 29889, 5592, 1241, 1125, 13, 1678, 1024, 353, 525, 415, 29873, 29915, 13, 1678, 6068, 29918, 3129, 2708, 353, 6024, 415, 29873, 29889, 617, 2033, 13, 1678, 1369, 29918, 26045, 353, 6702, 991, 597, 1636, 29889, 415, 29873, 29889, 617, 29914, 1327, 29879, 29914, 29954, 2209, 666, 292, 29914, 2248, 29889, 1420, 742, 1723, 13, 1678, 903, 2267, 2722, 353, 29871, 29900, 13, 1678, 18134, 29918, 1525, 5659, 29979, 353, 29871, 29896, 13, 1678, 903, 12292, 353, 29871, 29900, 13, 1678, 18134, 29918, 7228, 1692, 29903, 353, 29871, 29946, 29871, 396, 7976, 861, 398, 1353, 310, 29349, 839, 6515, 13, 1678, 3001, 29918, 13628, 29918, 386, 12268, 353, 29871, 29906, 29900, 396, 498, 12268, 310, 5503, 8158, 313, 1454, 21166, 29897, 13, 1678, 13553, 353, 518, 29884, 29915, 31014, 31032, 742, 29884, 29915, 235, 154, 144, 234, 138, 162, 742, 29884, 29915, 234, 185, 163, 234, 138, 162, 742, 29884, 29915, 234, 187, 192, 234, 184, 180, 3788, 30939, 30545, 742, 29884, 29915, 30448, 31014, 742, 29884, 29915, 232, 162, 186, 31014, 742, 29962, 396, 3529, 6084, 596, 13553, 13, 1678, 13553, 29918, 2798, 29918, 386, 12268, 353, 29871, 29896, 396, 498, 12268, 310, 13553, 6403, 663, 313, 1454, 21166, 29897, 13, 268, 13, 13, 259, 13, 1678, 822, 6088, 29898, 1311, 29892, 2933, 1125, 13, 308, 565, 7431, 29898, 5327, 29889, 23635, 877, 458, 4563, 17548, 1990, 543, 957, 29896, 29947, 29899, 1333, 625, 3108, 8785, 1405, 29871, 29900, 29901, 13, 9651, 565, 1583, 3032, 2267, 2722, 529, 349, 19988, 5592, 1241, 29889, 12648, 29918, 1525, 5659, 29979, 29901, 13, 18884, 1583, 3032, 2267, 2722, 4619, 29871, 29896, 13, 18884, 12183, 29889, 27392, 877, 276, 2202, 6571, 3064, 856, 4286, 4830, 29898, 1311, 3032, 2267, 2722, 876, 13, 18884, 7709, 3812, 3089, 29889, 3166, 29918, 5327, 29898, 5327, 29892, 13, 462, 462, 18884, 883, 1272, 3790, 29915, 3582, 2396, 525, 3582, 16675, 13, 462, 462, 18884, 6939, 29922, 1311, 29889, 5510, 29897, 13, 9651, 1683, 29901, 13, 18884, 12183, 29889, 27392, 877, 6824, 6824, 6824, 6824, 6824, 6824, 6824, 21004, 6293, 2609, 1209, 6824, 6824, 6824, 6824, 6824, 6824, 6824, 1495, 13, 308, 1683, 29901, 13, 18884, 10422, 353, 2933, 29889, 2271, 29889, 5451, 11219, 1495, 14352, 29906, 29962, 718, 15300, 1420, 29915, 29871, 13, 462, 13, 13, 18884, 411, 1722, 29898, 9507, 29892, 525, 29893, 29890, 1495, 408, 285, 29901, 13, 462, 1678, 285, 29889, 3539, 29898, 5327, 29889, 2587, 29897, 13, 462, 1678, 1583, 3032, 12292, 4619, 29871, 29896, 13, 13, 18884, 363, 2822, 297, 2933, 29889, 4268, 12839, 29878, 29899, 296, 1405, 1933, 29889, 3257, 1405, 263, 1057, 5552, 29898, 12653, 16029, 1125, 13, 462, 1678, 3142, 353, 2933, 29889, 2271, 7122, 29898, 12653, 29889, 21111, 3101, 13, 462, 1678, 7709, 24559, 2272, 29889, 3089, 29898, 2271, 29892, 6939, 29922, 1311, 29889, 5510, 29918, 2490, 29897, 13, 13, 18884, 565, 1583, 3032, 12292, 529, 349, 19988, 5592, 1241, 29889, 12648, 29918, 7228, 1692, 29903, 29901, 13, 462, 1678, 2446, 29918, 3488, 353, 2933, 29889, 23635, 29898, 29884, 29915, 458, 4563, 17548, 333, 543, 2467, 29899, 1646, 29899, 7611, 3108, 458, 29874, 29961, 11516, 29898, 726, 3285, 376, 30429, 236, 163, 132, 13531, 29368, 12653, 1495, 13, 462, 1678, 12183, 29889, 27392, 29898, 4622, 29918, 3488, 29897, 13, 462, 1678, 12183, 29889, 27392, 877, 29906, 29941, 29896, 1495, 13, 462, 1678, 565, 2446, 29918, 3488, 29901, 13, 462, 4706, 3142, 353, 2933, 29889, 2271, 7122, 29898, 4622, 29918, 3488, 29961, 29900, 1822, 21111, 3101, 13, 462, 4706, 7709, 24559, 2272, 29889, 3089, 29898, 2271, 29892, 1583, 29889, 5510, 29897, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 12183, 29889, 27392, 877, 1217, 2446, 1813, 1495, 13, 18884, 1683, 29901, 13, 462, 1678, 12183, 29889, 27392, 877, 3317, 6515, 7450, 1495, 13, 462, 268, 13, 1678, 822, 6088, 29918, 2490, 29898, 1311, 29892, 2933, 1125, 13, 418, 13, 4706, 2944, 353, 4918, 2001, 580, 539, 13, 29937, 4706, 2944, 1839, 3257, 2033, 353, 29871, 2933, 29889, 23635, 29898, 13, 29937, 9651, 525, 458, 7299, 17548, 6799, 543, 468, 29901, 3257, 3108, 29368, 3051, 29861, 29900, 1822, 21111, 580, 29871, 13, 29937, 4706, 2944, 1839, 8921, 2033, 353, 2933, 29889, 23635, 29898, 13, 29937, 9651, 318, 29915, 458, 4563, 17548, 1990, 543, 7914, 29899, 2527, 284, 457, 3108, 29914, 9653, 29961, 726, 580, 543, 30732, 30767, 3108, 29914, 23031, 292, 29899, 29879, 747, 1847, 1057, 9653, 29961, 29896, 16261, 726, 580, 29861, 13, 29937, 462, 29900, 1822, 21111, 2141, 5451, 877, 525, 9601, 29900, 29962, 13, 29937, 4706, 12865, 29918, 710, 353, 2933, 29889, 23635, 29898, 13, 29937, 9651, 318, 29915, 458, 4563, 17548, 1990, 543, 7914, 29899, 2527, 284, 457, 3108, 29914, 9653, 29961, 726, 580, 543, 30974, 31069, 3108, 29914, 23031, 292, 29899, 29879, 747, 1847, 1057, 9653, 29961, 29896, 16261, 726, 580, 29861, 13, 29937, 462, 29900, 1822, 21111, 580, 13, 29937, 4706, 2944, 1839, 1256, 2033, 353, 12865, 29889, 12673, 29889, 710, 415, 603, 29898, 12673, 29918, 710, 29892, 14210, 29874, 1273, 29890, 1273, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 1273, 29979, 1495, 13, 13, 29937, 4706, 2944, 1839, 3051, 2033, 353, 2933, 29889, 23635, 877, 458, 4563, 17548, 333, 543, 3396, 29899, 3051, 3108, 29914, 726, 580, 29861, 29900, 1822, 21111, 580, 13, 13, 4706, 6589, 353, 5159, 13, 4706, 3001, 29918, 13628, 353, 29871, 29900, 13, 4706, 363, 3440, 297, 2933, 29889, 23635, 877, 458, 4563, 17548, 1990, 543, 5910, 3108, 29374, 13, 9651, 5503, 29918, 4039, 353, 3440, 29889, 4268, 877, 9653, 29889, 5910, 29899, 4039, 1057, 726, 29861, 29900, 1822, 21111, 580, 13, 9651, 5503, 29918, 1792, 353, 3440, 29889, 4268, 877, 9653, 29889, 5910, 29899, 1792, 333, 1057, 726, 29861, 29900, 1822, 21111, 580, 13, 9651, 5503, 29918, 3051, 353, 3440, 29889, 4268, 877, 9653, 29889, 5910, 29899, 3051, 1057, 726, 29861, 29900, 1822, 21111, 580, 13, 13, 9651, 565, 318, 29915, 233, 145, 171, 29915, 297, 5503, 29918, 4039, 29901, 13, 18884, 8158, 353, 29871, 29896, 13, 9651, 25342, 318, 29915, 232, 156, 150, 29915, 297, 5503, 29918, 4039, 29901, 13, 18884, 8158, 353, 448, 29896, 13, 9651, 1683, 29901, 13, 18884, 8158, 353, 29871, 29900, 13, 13, 9651, 3001, 29918, 13628, 4619, 8158, 13, 13, 9651, 6589, 29889, 4397, 3319, 29915, 1792, 2396, 5503, 29918, 1792, 29892, 13, 462, 632, 525, 3051, 2396, 5503, 29918, 3051, 29892, 13, 462, 632, 525, 13628, 2396, 8158, 1800, 13, 13, 396, 418, 2944, 1839, 21032, 2033, 353, 6589, 13, 396, 539, 2944, 1839, 13628, 2033, 353, 3001, 29918, 13628, 13, 396, 539, 2944, 1839, 2271, 2033, 353, 2933, 29889, 2271, 13, 308, 13, 4706, 565, 3001, 29918, 13628, 6736, 29871, 1583, 29889, 7827, 29918, 13628, 29918, 386, 12268, 29901, 13, 9651, 1423, 29918, 3051, 353, 2933, 29889, 23635, 877, 458, 4563, 17548, 333, 543, 3396, 29899, 3051, 3108, 29914, 726, 580, 29861, 13, 632, 29900, 1822, 21111, 580, 13, 632, 13, 9651, 13553, 29918, 2798, 353, 29871, 29900, 1678, 13, 9651, 363, 474, 297, 3464, 29898, 29900, 29892, 2435, 29898, 1311, 29889, 26766, 511, 29896, 1125, 13, 18884, 565, 337, 29889, 4478, 29898, 1311, 29889, 26766, 29961, 29875, 1402, 3198, 29918, 3051, 1125, 13, 462, 259, 13553, 29918, 2798, 23661, 29896, 13, 18884, 1683, 29901, 13, 462, 259, 6773, 13, 9651, 565, 13553, 29918, 2798, 6736, 1583, 29889, 26766, 29918, 2798, 29918, 386, 12268, 29901, 13, 18884, 297, 3051, 353, 2933, 29889, 23635, 877, 458, 4563, 17548, 333, 543, 3396, 29899, 3051, 3108, 1495, 13, 18884, 363, 297, 3051, 29918, 12653, 297, 297, 3051, 29889, 4268, 877, 29874, 1057, 5552, 29898, 12653, 16029, 1125, 13, 462, 29871, 565, 337, 29889, 4478, 12839, 2732, 742, 262, 3051, 29918, 12653, 29889, 21111, 580, 1125, 259, 13, 462, 418, 2944, 1839, 262, 3051, 29918, 2271, 2033, 353, 297, 3051, 29918, 12653, 29889, 21111, 580, 13, 462, 418, 2944, 1839, 262, 3051, 29918, 2271, 29918, 1853, 2033, 353, 15300, 2732, 29915, 13, 462, 539, 13, 462, 29871, 565, 337, 29889, 4478, 12839, 6173, 742, 262, 3051, 29918, 12653, 29889, 21111, 580, 1125, 13, 462, 539, 2944, 1839, 262, 3051, 29918, 2271, 2033, 353, 297, 3051, 29918, 12653, 29889, 21111, 580, 13, 462, 539, 2944, 1839, 262, 3051, 29918, 2271, 29918, 1853, 2033, 353, 15300, 6173, 29915, 13, 13, 4706, 7709, 2944, 13, 2 ]
tests/test_utilities/test_csvgrep.py
diraol/csvkit
0
1613485
<filename>tests/test_utilities/test_csvgrep.py #!/usr/bin/env python import StringIO import unittest from csvkit import CSVKitReader from csvkit.utilities.csvgrep import CSVGrep from csvkit.exceptions import ColumnIdentifierError, RequiredHeaderError class TestCSVGrep(unittest.TestCase): def test_match(self): args = ['-c', '1', '-m', '1', 'examples/dummy.csv'] output_file = StringIO.StringIO() utility = CSVGrep(args, output_file) utility.main() input_file = StringIO.StringIO(output_file.getvalue()) reader = CSVKitReader(input_file) self.assertEqual(reader.next(), ['a', 'b', 'c']) self.assertEqual(reader.next(), ['1', '2', '3']) def test_no_match(self): args = ['-c', '1', '-m', 'NO MATCH', 'examples/dummy.csv'] output_file = StringIO.StringIO() utility = CSVGrep(args, output_file) utility.main() input_file = StringIO.StringIO(output_file.getvalue()) reader = CSVKitReader(input_file) self.assertEqual(reader.next(), ['a', 'b', 'c']) def test_invert_match(self): args = ['-c', '1', '-i', '-m', 'NO MATCH', 'examples/dummy.csv'] output_file = StringIO.StringIO() utility = CSVGrep(args, output_file) utility.main() input_file = StringIO.StringIO(output_file.getvalue()) reader = CSVKitReader(input_file) self.assertEqual(reader.next(), ['a', 'b', 'c']) self.assertEqual(reader.next(), ['1', '2', '3']) def test_re_match(self): args = ['-c', '3', '-r', '^(3|9)$', 'examples/dummy.csv'] output_file = StringIO.StringIO() utility = CSVGrep(args, output_file) utility.main() input_file = StringIO.StringIO(output_file.getvalue()) reader = CSVKitReader(input_file) self.assertEqual(reader.next(), ['a', 'b', 'c']) self.assertEqual(reader.next(), ['1', '2', '3']) def test_string_match(self): args = ['-c', '1', '-m', 'ILLINOIS', 'examples/realdata/FY09_EDU_Recipients_by_State.csv'] output_file = StringIO.StringIO() utility = CSVGrep(args, output_file) utility.main() input_file = StringIO.StringIO(output_file.getvalue()) reader = CSVKitReader(input_file) self.assertEqual(reader.next(), ['State Name', 'State Abbreviate', 'Code', 'Montgomery GI Bill-Active Duty', 'Montgomery GI Bill- Selective Reserve', 'Dependents\' Educational Assistance', 'Reserve Educational Assistance Program', 'Post-Vietnam Era Veteran\'s Educational Assistance Program', 'TOTAL', '']) self.assertEqual(reader.next(), ['ILLINOIS', 'IL', '17', '15,659', '2,491', '2,025', '1,770', '19', '21,964', '']) def test_invalid_column(self): args = ['-c', '0', '-m', '1', 'examples/dummy.csv'] output_file = StringIO.StringIO() utility = CSVGrep(args, output_file) self.assertRaises(ColumnIdentifierError, utility.main)
[ 1, 529, 9507, 29958, 21150, 29914, 1688, 29918, 4422, 1907, 29914, 1688, 29918, 7638, 22385, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 1714, 5971, 13, 5215, 443, 27958, 13, 13, 3166, 11799, 7354, 1053, 16874, 13117, 6982, 13, 3166, 11799, 7354, 29889, 4422, 1907, 29889, 7638, 22385, 1053, 16874, 29954, 3445, 13, 3166, 11799, 7354, 29889, 11739, 29879, 1053, 12481, 12889, 2392, 29892, 830, 5958, 7850, 2392, 13, 13, 1990, 4321, 29907, 7597, 29954, 3445, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 4352, 29898, 1311, 1125, 13, 4706, 6389, 353, 6024, 29899, 29883, 742, 525, 29896, 742, 17411, 29885, 742, 525, 29896, 742, 525, 19057, 29914, 29881, 11770, 29889, 7638, 2033, 13, 4706, 1962, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 580, 13, 4706, 19725, 353, 16874, 29954, 3445, 29898, 5085, 29892, 1962, 29918, 1445, 29897, 13, 13, 4706, 19725, 29889, 3396, 580, 13, 13, 4706, 1881, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 29898, 4905, 29918, 1445, 29889, 657, 1767, 3101, 13, 4706, 9591, 353, 16874, 13117, 6982, 29898, 2080, 29918, 1445, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 29874, 742, 525, 29890, 742, 525, 29883, 11287, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 29896, 742, 525, 29906, 742, 525, 29941, 11287, 13, 13, 1678, 822, 1243, 29918, 1217, 29918, 4352, 29898, 1311, 1125, 13, 4706, 6389, 353, 6024, 29899, 29883, 742, 525, 29896, 742, 17411, 29885, 742, 525, 6632, 341, 14789, 742, 525, 19057, 29914, 29881, 11770, 29889, 7638, 2033, 13, 4706, 1962, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 580, 13, 4706, 19725, 353, 16874, 29954, 3445, 29898, 5085, 29892, 1962, 29918, 1445, 29897, 13, 13, 4706, 19725, 29889, 3396, 580, 13, 13, 4706, 1881, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 29898, 4905, 29918, 1445, 29889, 657, 1767, 3101, 13, 4706, 9591, 353, 16874, 13117, 6982, 29898, 2080, 29918, 1445, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 29874, 742, 525, 29890, 742, 525, 29883, 11287, 13, 13, 1678, 822, 1243, 29918, 262, 1765, 29918, 4352, 29898, 1311, 1125, 13, 4706, 6389, 353, 6024, 29899, 29883, 742, 525, 29896, 742, 17411, 29875, 742, 17411, 29885, 742, 525, 6632, 341, 14789, 742, 525, 19057, 29914, 29881, 11770, 29889, 7638, 2033, 13, 4706, 1962, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 580, 13, 4706, 19725, 353, 16874, 29954, 3445, 29898, 5085, 29892, 1962, 29918, 1445, 29897, 13, 13, 4706, 19725, 29889, 3396, 580, 13, 13, 4706, 1881, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 29898, 4905, 29918, 1445, 29889, 657, 1767, 3101, 13, 4706, 9591, 353, 16874, 13117, 6982, 29898, 2080, 29918, 1445, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 29874, 742, 525, 29890, 742, 525, 29883, 11287, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 29896, 742, 525, 29906, 742, 525, 29941, 11287, 13, 13, 1678, 822, 1243, 29918, 276, 29918, 4352, 29898, 1311, 1125, 13, 4706, 6389, 353, 6024, 29899, 29883, 742, 525, 29941, 742, 17411, 29878, 742, 525, 23733, 29941, 29989, 29929, 1262, 742, 525, 19057, 29914, 29881, 11770, 29889, 7638, 2033, 13, 4706, 1962, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 580, 13, 4706, 19725, 353, 16874, 29954, 3445, 29898, 5085, 29892, 1962, 29918, 1445, 29897, 13, 13, 4706, 19725, 29889, 3396, 580, 13, 13, 4706, 1881, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 29898, 4905, 29918, 1445, 29889, 657, 1767, 3101, 13, 4706, 9591, 353, 16874, 13117, 6982, 29898, 2080, 29918, 1445, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 29874, 742, 525, 29890, 742, 525, 29883, 11287, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 29896, 742, 525, 29906, 742, 525, 29941, 11287, 13, 13, 1678, 822, 1243, 29918, 1807, 29918, 4352, 29898, 1311, 1125, 13, 4706, 6389, 353, 6024, 29899, 29883, 742, 525, 29896, 742, 17411, 29885, 742, 525, 24071, 1177, 29949, 3235, 742, 525, 19057, 29914, 6370, 1272, 29914, 29943, 29979, 29900, 29929, 29918, 3352, 29965, 29918, 1123, 7334, 10070, 29918, 1609, 29918, 2792, 29889, 7638, 2033, 13, 4706, 1962, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 580, 13, 4706, 19725, 353, 16874, 29954, 3445, 29898, 5085, 29892, 1962, 29918, 1445, 29897, 13, 13, 4706, 19725, 29889, 3396, 580, 13, 13, 4706, 1881, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 29898, 4905, 29918, 1445, 29889, 657, 1767, 3101, 13, 4706, 9591, 353, 16874, 13117, 6982, 29898, 2080, 29918, 1445, 29897, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 2792, 4408, 742, 525, 2792, 1976, 1030, 1403, 403, 742, 525, 3399, 742, 525, 24665, 27157, 708, 402, 29902, 6682, 29899, 9966, 360, 329, 29891, 742, 525, 24665, 27157, 708, 402, 29902, 6682, 29899, 7605, 573, 27811, 742, 525, 8498, 355, 1237, 20333, 7519, 29883, 1288, 4007, 21558, 742, 525, 1666, 7143, 7519, 29883, 1288, 4007, 21558, 7835, 742, 525, 6747, 29899, 29963, 16062, 21018, 478, 1308, 273, 20333, 29879, 7519, 29883, 1288, 4007, 21558, 7835, 742, 525, 29911, 2891, 1964, 742, 525, 11287, 13, 4706, 1583, 29889, 9294, 9843, 29898, 16950, 29889, 4622, 3285, 6024, 24071, 1177, 29949, 3235, 742, 525, 6227, 742, 525, 29896, 29955, 742, 525, 29896, 29945, 29892, 29953, 29945, 29929, 742, 525, 29906, 29892, 29946, 29929, 29896, 742, 525, 29906, 29892, 29900, 29906, 29945, 742, 525, 29896, 29892, 29955, 29955, 29900, 742, 525, 29896, 29929, 742, 525, 29906, 29896, 29892, 29929, 29953, 29946, 742, 525, 11287, 13, 13, 1678, 822, 1243, 29918, 20965, 29918, 4914, 29898, 1311, 1125, 13, 4706, 6389, 353, 6024, 29899, 29883, 742, 525, 29900, 742, 17411, 29885, 742, 525, 29896, 742, 525, 19057, 29914, 29881, 11770, 29889, 7638, 2033, 13, 4706, 1962, 29918, 1445, 353, 1714, 5971, 29889, 1231, 5971, 580, 13, 4706, 19725, 353, 16874, 29954, 3445, 29898, 5085, 29892, 1962, 29918, 1445, 29897, 13, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 4409, 12889, 2392, 29892, 19725, 29889, 3396, 29897, 13, 2 ]
pyspark/example/spark_core/4.7_spark_prog.py
chiliangpi/hellobi
53
11562
<reponame>chiliangpi/hellobi import os import numpy as np import sys import logging LOG_PATH = os.environ['log'] spark_home = os.environ['SPARK_HOME'] sys.path.insert(0, os.path.join(spark_home, 'python')) sys.path.insert(0, os.path.join(spark_home, 'python/lib/py4j-0.10.4-src.zip')) from pyspark.sql import SparkSession spark = SparkSession.builder.appName("test") \ .getOrCreate() logger = logging.getLogger(__name__) logger.addHandler(logging.FileHandler(LOG_PATH)) def main(*args): top = int(args[0][0]) data = spark.read.csv("hdfs:///tmp/ratings.csv", sep = ',', header= True) result = (data .groupBy("movieid") .agg({'rating': 'mean'}) .withColumnRenamed("avg(rating)", "avg_ratings") .dropna() .orderBy(['avg_ratings'], ascending=[0]) .limit(top)) logger.info("result: {}".format(result.toPandas())) #spark.stop() if __name__ == '__main__': logging.basicConfig(format='[%(levelname)s] %(asctime)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=logging.INFO) main(sys.argv[1:])
[ 1, 529, 276, 1112, 420, 29958, 305, 2638, 574, 1631, 29914, 3952, 2127, 29875, 13, 5215, 2897, 13, 5215, 12655, 408, 7442, 13, 5215, 10876, 13, 5215, 12183, 13, 13, 14480, 29918, 10145, 353, 2897, 29889, 21813, 1839, 1188, 2033, 13, 12597, 29918, 5184, 353, 2897, 29889, 21813, 1839, 5550, 1718, 29968, 29918, 17353, 2033, 13, 9675, 29889, 2084, 29889, 7851, 29898, 29900, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 12597, 29918, 5184, 29892, 525, 4691, 8785, 13, 9675, 29889, 2084, 29889, 7851, 29898, 29900, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 12597, 29918, 5184, 29892, 525, 4691, 29914, 1982, 29914, 2272, 29946, 29926, 29899, 29900, 29889, 29896, 29900, 29889, 29946, 29899, 4351, 29889, 7554, 8785, 13, 13, 3166, 282, 952, 6378, 29889, 2850, 1053, 20814, 7317, 13, 13, 12597, 353, 20814, 7317, 29889, 16409, 29889, 932, 1170, 703, 1688, 1159, 320, 13, 259, 869, 657, 2816, 4391, 580, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 21707, 29889, 1202, 4598, 29898, 21027, 29889, 2283, 4598, 29898, 14480, 29918, 10145, 876, 13, 13, 1753, 1667, 10456, 5085, 1125, 13, 1678, 2246, 353, 938, 29898, 5085, 29961, 29900, 3816, 29900, 2314, 13, 1678, 848, 353, 16267, 29889, 949, 29889, 7638, 703, 29882, 29069, 597, 29914, 7050, 29914, 3605, 886, 29889, 7638, 613, 16345, 353, 13420, 742, 4839, 29922, 5852, 29897, 13, 1678, 1121, 353, 313, 1272, 13, 1669, 869, 2972, 2059, 703, 27362, 333, 1159, 13, 1669, 869, 16170, 3319, 29915, 29741, 2396, 525, 12676, 29915, 1800, 13, 1669, 869, 2541, 4409, 29934, 264, 2795, 703, 485, 29887, 29898, 29741, 19123, 376, 485, 29887, 29918, 3605, 886, 1159, 13, 1669, 869, 8865, 1056, 580, 13, 1669, 869, 2098, 2059, 18959, 485, 29887, 29918, 3605, 886, 7464, 12066, 2548, 11759, 29900, 2314, 13, 12, 539, 869, 13400, 29898, 3332, 876, 13, 1678, 17927, 29889, 3888, 703, 2914, 29901, 6571, 1642, 4830, 29898, 2914, 29889, 517, 29925, 7086, 22130, 13, 1678, 396, 12597, 29889, 9847, 580, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 12183, 29889, 16121, 3991, 29898, 4830, 2433, 29961, 29995, 29898, 5563, 978, 29897, 29879, 29962, 1273, 29898, 294, 312, 603, 29897, 29879, 1273, 29898, 4906, 29897, 29879, 742, 13, 268, 12, 1256, 23479, 2433, 29995, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 742, 13, 268, 12, 5563, 29922, 21027, 29889, 11690, 29897, 13, 1678, 1667, 29898, 9675, 29889, 19218, 29961, 29896, 29901, 2314, 13, 2 ]
content_interactions_stats/migrations/0001_initial.py
aaboffill/django-content-interactions
0
106224
<reponame>aaboffill/django-content-interactions<filename>content_interactions_stats/migrations/0001_initial.py<gh_stars>0 # -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Stats' db.create_table(u'content_interactions_stats_stats', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('likes', self.gf('django.db.models.fields.IntegerField')(default=0)), ('ratings', self.gf('django.db.models.fields.IntegerField')(default=0)), ('rating_5_count', self.gf('django.db.models.fields.IntegerField')(default=0)), ('rating_4_count', self.gf('django.db.models.fields.IntegerField')(default=0)), ('rating_3_count', self.gf('django.db.models.fields.IntegerField')(default=0)), ('rating_2_count', self.gf('django.db.models.fields.IntegerField')(default=0)), ('rating_1_count', self.gf('django.db.models.fields.IntegerField')(default=0)), ('rating', self.gf('django.db.models.fields.DecimalField')(default=0, max_digits=2, decimal_places=1)), ('favorite_marks', self.gf('django.db.models.fields.IntegerField')(default=0)), ('shares', self.gf('django.db.models.fields.IntegerField')(default=0)), ('denounces', self.gf('django.db.models.fields.IntegerField')(default=0)), ('visits', self.gf('django.db.models.fields.IntegerField')(default=0)), ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(related_name='content_type_set_for_stats', to=orm['contenttypes.ContentType'])), ('object_pk', self.gf('django.db.models.fields.IntegerField')()), )) db.send_create_signal(u'content_interactions_stats', ['Stats']) # Adding unique constraint on 'Stats', fields ['content_type', 'object_pk'] db.create_unique(u'content_interactions_stats_stats', ['content_type_id', 'object_pk']) def backwards(self, orm): # Removing unique constraint on 'Stats', fields ['content_type', 'object_pk'] db.delete_unique(u'content_interactions_stats_stats', ['content_type_id', 'object_pk']) # Deleting model 'Stats' db.delete_table(u'content_interactions_stats_stats') models = { u'content_interactions_stats.stats': { 'Meta': {'unique_together': "(('content_type', 'object_pk'),)", 'object_name': 'Stats'}, 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'content_type_set_for_stats'", 'to': u"orm['contenttypes.ContentType']"}), 'denounces': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'favorite_marks': ('django.db.models.fields.IntegerField', [], {'default': '0'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'likes': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'object_pk': ('django.db.models.fields.IntegerField', [], {}), 'rating': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '2', 'decimal_places': '1'}), 'rating_1_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'rating_2_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'rating_3_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'rating_4_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'rating_5_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'ratings': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'shares': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'visits': ('django.db.models.fields.IntegerField', [], {'default': '0'}) }, u'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) } } complete_apps = ['content_interactions_stats']
[ 1, 529, 276, 1112, 420, 29958, 29874, 370, 2696, 453, 29914, 14095, 29899, 3051, 29899, 1639, 7387, 29966, 9507, 29958, 3051, 29918, 1639, 7387, 29918, 16202, 29914, 26983, 800, 29914, 29900, 29900, 29900, 29896, 29918, 11228, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 7062, 29889, 13239, 1053, 12865, 29918, 13239, 408, 12865, 13, 3166, 7062, 29889, 2585, 1053, 4833, 13, 3166, 7062, 29889, 29894, 29906, 1053, 1102, 2603, 29924, 16783, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 13, 13, 1990, 341, 16783, 29898, 12763, 29924, 16783, 1125, 13, 13, 1678, 822, 363, 2935, 29898, 1311, 29892, 470, 29885, 1125, 13, 4706, 396, 18804, 1904, 525, 25060, 29915, 13, 4706, 4833, 29889, 3258, 29918, 2371, 29898, 29884, 29915, 3051, 29918, 1639, 7387, 29918, 16202, 29918, 16202, 742, 313, 13, 9651, 313, 29884, 29915, 333, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 12300, 3073, 1495, 29898, 16072, 29918, 1989, 29922, 5574, 8243, 13, 9651, 6702, 5081, 267, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 3605, 886, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 29741, 29918, 29945, 29918, 2798, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 29741, 29918, 29946, 29918, 2798, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 29741, 29918, 29941, 29918, 2798, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 29741, 29918, 29906, 29918, 2798, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 29741, 29918, 29896, 29918, 2798, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 29741, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 23307, 3073, 1495, 29898, 4381, 29922, 29900, 29892, 4236, 29918, 7501, 1169, 29922, 29906, 29892, 13677, 29918, 29886, 6048, 29922, 29896, 8243, 13, 9651, 6702, 29888, 17118, 568, 29918, 22848, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 845, 5114, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 1145, 1309, 778, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 1730, 1169, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 29898, 4381, 29922, 29900, 8243, 13, 9651, 6702, 3051, 29918, 1853, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 12817, 29889, 27755, 2558, 1495, 29898, 12817, 29918, 978, 2433, 3051, 29918, 1853, 29918, 842, 29918, 1454, 29918, 16202, 742, 304, 29922, 555, 1839, 3051, 8768, 29889, 3916, 1542, 2033, 8243, 13, 9651, 6702, 3318, 29918, 20571, 742, 1583, 29889, 29887, 29888, 877, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 1495, 25739, 13, 308, 876, 13, 4706, 4833, 29889, 6717, 29918, 3258, 29918, 25436, 29898, 29884, 29915, 3051, 29918, 1639, 7387, 29918, 16202, 742, 6024, 25060, 11287, 13, 13, 4706, 396, 18804, 5412, 7276, 373, 525, 25060, 742, 4235, 6024, 3051, 29918, 1853, 742, 525, 3318, 29918, 20571, 2033, 13, 4706, 4833, 29889, 3258, 29918, 13092, 29898, 29884, 29915, 3051, 29918, 1639, 7387, 29918, 16202, 29918, 16202, 742, 6024, 3051, 29918, 1853, 29918, 333, 742, 525, 3318, 29918, 20571, 11287, 13, 13, 13, 1678, 822, 28953, 29898, 1311, 29892, 470, 29885, 1125, 13, 4706, 396, 5240, 21081, 5412, 7276, 373, 525, 25060, 742, 4235, 6024, 3051, 29918, 1853, 742, 525, 3318, 29918, 20571, 2033, 13, 4706, 4833, 29889, 8143, 29918, 13092, 29898, 29884, 29915, 3051, 29918, 1639, 7387, 29918, 16202, 29918, 16202, 742, 6024, 3051, 29918, 1853, 29918, 333, 742, 525, 3318, 29918, 20571, 11287, 13, 13, 4706, 396, 897, 1026, 292, 1904, 525, 25060, 29915, 13, 4706, 4833, 29889, 8143, 29918, 2371, 29898, 29884, 29915, 3051, 29918, 1639, 7387, 29918, 16202, 29918, 16202, 1495, 13, 13, 13, 1678, 4733, 353, 426, 13, 4706, 318, 29915, 3051, 29918, 1639, 7387, 29918, 16202, 29889, 16202, 2396, 426, 13, 9651, 525, 19346, 2396, 11117, 13092, 29918, 29873, 12966, 2396, 18227, 877, 3051, 29918, 1853, 742, 525, 3318, 29918, 20571, 5477, 19123, 525, 3318, 29918, 978, 2396, 525, 25060, 16675, 13, 9651, 525, 3051, 29918, 1853, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 12817, 29889, 27755, 2558, 742, 19997, 11117, 12817, 29918, 978, 2396, 13577, 3051, 29918, 1853, 29918, 842, 29918, 1454, 29918, 16202, 29915, 613, 525, 517, 2396, 318, 29908, 555, 1839, 3051, 8768, 29889, 3916, 1542, 2033, 9092, 511, 13, 9651, 525, 1145, 1309, 778, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 29888, 17118, 568, 29918, 22848, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 318, 29915, 333, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 12300, 3073, 742, 19997, 11117, 16072, 29918, 1989, 2396, 525, 5574, 29915, 9594, 13, 9651, 525, 5081, 267, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 3318, 29918, 20571, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 6571, 511, 13, 9651, 525, 29741, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 23307, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 742, 525, 3317, 29918, 7501, 1169, 2396, 525, 29906, 742, 525, 7099, 3039, 29918, 29886, 6048, 2396, 525, 29896, 29915, 9594, 13, 9651, 525, 29741, 29918, 29896, 29918, 2798, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 29741, 29918, 29906, 29918, 2798, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 29741, 29918, 29941, 29918, 2798, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 29741, 29918, 29946, 29918, 2798, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 29741, 29918, 29945, 29918, 2798, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 3605, 886, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 845, 5114, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 9594, 13, 9651, 525, 1730, 1169, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 7798, 3073, 742, 19997, 11117, 4381, 2396, 525, 29900, 29915, 1800, 13, 4706, 2981, 13, 4706, 318, 29915, 3051, 8768, 29889, 3051, 1853, 2396, 426, 13, 9651, 525, 19346, 2396, 11117, 2098, 292, 2396, 376, 877, 978, 742, 19123, 525, 13092, 29918, 29873, 12966, 2396, 18227, 877, 932, 29918, 1643, 742, 525, 4299, 5477, 19123, 525, 3318, 29918, 978, 2396, 525, 3916, 1542, 742, 525, 2585, 29918, 2371, 2396, 13577, 14095, 29918, 3051, 29918, 1853, 29915, 10758, 13, 9651, 525, 932, 29918, 1643, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 27890, 742, 19997, 11117, 3317, 29918, 2848, 2396, 525, 29896, 29900, 29900, 29915, 9594, 13, 9651, 318, 29915, 333, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 12300, 3073, 742, 19997, 11117, 16072, 29918, 1989, 2396, 525, 5574, 29915, 9594, 13, 9651, 525, 4299, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 27890, 742, 19997, 11117, 3317, 29918, 2848, 2396, 525, 29896, 29900, 29900, 29915, 9594, 13, 9651, 525, 978, 2396, 6702, 14095, 29889, 2585, 29889, 9794, 29889, 9621, 29889, 27890, 742, 19997, 11117, 3317, 29918, 2848, 2396, 525, 29896, 29900, 29900, 29915, 1800, 13, 4706, 500, 13, 1678, 500, 13, 13, 1678, 4866, 29918, 13371, 353, 6024, 3051, 29918, 1639, 7387, 29918, 16202, 2033, 2 ]
ccnlab/utils.py
nikhilxb/ccnlab
5
166264
<reponame>nikhilxb/ccnlab import fnmatch from collections import defaultdict def listdict_to_dictlist(ld): dl = defaultdict(list) keys = set(k for d in ld for k in d) for d in ld: for k in keys: dl[k].append(d[k] if k in d else None) return dl class SearchableRegistry: def __init__(self): self.items = {} def __call__(self, *args, **kwargs): return self.get(*args, **kwargs) def register(self, item): self.items[item.__name__] = item def get(self, *globs, call=True): """Return items that match any of the specified globs. By default, assumes that items are callable (i.e. a function or constructor that requires no arguments) and calls them.""" names = self.items.keys() if len(globs) > 0: names = [name for name in names if any(fnmatch.fnmatch(name, glob) for glob in globs)] return [self.items[name]() if call else self.items[name] for name in names]
[ 1, 529, 276, 1112, 420, 29958, 5585, 29882, 309, 29916, 29890, 29914, 617, 29876, 8205, 13, 5215, 7876, 4352, 13, 3166, 16250, 1053, 2322, 8977, 13, 13, 13, 1753, 1051, 8977, 29918, 517, 29918, 8977, 1761, 29898, 430, 1125, 13, 29871, 270, 29880, 353, 2322, 8977, 29898, 1761, 29897, 13, 29871, 6611, 353, 731, 29898, 29895, 363, 270, 297, 301, 29881, 363, 413, 297, 270, 29897, 13, 29871, 363, 270, 297, 301, 29881, 29901, 13, 1678, 363, 413, 297, 6611, 29901, 13, 418, 270, 29880, 29961, 29895, 1822, 4397, 29898, 29881, 29961, 29895, 29962, 565, 413, 297, 270, 1683, 6213, 29897, 13, 29871, 736, 270, 29880, 13, 13, 13, 1990, 11856, 519, 22579, 29901, 13, 29871, 822, 4770, 2344, 12035, 1311, 1125, 13, 1678, 1583, 29889, 7076, 353, 6571, 13, 13, 29871, 822, 4770, 4804, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 1678, 736, 1583, 29889, 657, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 29871, 822, 6036, 29898, 1311, 29892, 2944, 1125, 13, 1678, 1583, 29889, 7076, 29961, 667, 17255, 978, 1649, 29962, 353, 2944, 13, 13, 29871, 822, 679, 29898, 1311, 29892, 334, 23705, 29879, 29892, 1246, 29922, 5574, 1125, 13, 1678, 9995, 11609, 4452, 393, 1993, 738, 310, 278, 6790, 13149, 29879, 29889, 2648, 2322, 29892, 15894, 393, 4452, 526, 29871, 13, 1678, 1246, 519, 313, 29875, 29889, 29872, 29889, 263, 740, 470, 5823, 393, 6858, 694, 6273, 29897, 322, 5717, 963, 1213, 15945, 13, 1678, 2983, 353, 1583, 29889, 7076, 29889, 8149, 580, 13, 1678, 565, 7431, 29898, 23705, 29879, 29897, 1405, 29871, 29900, 29901, 13, 418, 2983, 353, 518, 978, 363, 1024, 297, 2983, 565, 738, 29898, 9144, 4352, 29889, 9144, 4352, 29898, 978, 29892, 13149, 29897, 363, 13149, 297, 13149, 29879, 4638, 13, 1678, 736, 518, 1311, 29889, 7076, 29961, 978, 29962, 580, 565, 1246, 1683, 1583, 29889, 7076, 29961, 978, 29962, 363, 1024, 297, 2983, 29962, 13, 2 ]
src/demo2.py
lorenzobini/3D-shape-retrieval-search-engine
2
162128
import os import numpy as np import matplotlib.pyplot as plt from shape import Shape from visualize import visualize from normalize import normalize_data, normalize_shape from dataLoader import import_dataset, import_normalised_data from featureExtraction import * from featureMatching import * from utils import pick_file DATA_PATH = os.path.join(os.getcwd(), 'data') + os.sep DATA_SHAPES_PRICETON = DATA_PATH + 'benchmark' + os.sep + 'db' + os.sep SAVED_DATA = DATA_PATH + 'cache' + os.sep NORMALIZED_DATA = SAVED_DATA + 'processed_data' + os.sep try: features = np.load(SAVED_DATA + "features.npy", allow_pickle=True) features = features.item() except: pass #TODO: Include a file picker to show that aspect we also implemented, and the speed of the feature calculation # Retrieving shape print("\n----------------------------------------------------") print("3D Shapes Search Engine") print("----------------------------------------------------") while True: print("Select a shape to search for similar ones. Only OFF and PLY formats are supported. \n") try: shape = pick_file() break except FileNotFoundError: print("File not found. Try again.\n") continue except FileExistsError: print("Format not supported. Please select an OFF or PLY file.\n") continue print('Normalising query shape . . . ') shape, new_n_verts, new_n_faces = normalize_shape(shape) # Calculating features for the shape print('Calculating features for query shape and standardize them. . .') shape_features = calculate_single_shape_metrics(shape) shape_features = standardize_single_shape(shape_features) # Calculate nearest neighbors via ANN and R-Nearest Neighbors neighbors = r_neighbors(shape_features, features) n_shapes_id, n_distances = neighbors[0][1:], neighbors[1][1:] # Retrieving shapes from database n_shapes = [] for id in n_shapes_id: filename =NORMALIZED_DATA + "n" + str(id) + ".off" file = open(filename, 'r') verts, faces, n_verts, n_faces = read_off(file) mesh = trm.load_mesh(filename) shape = Shape(verts, faces, mesh) shape.set_id(id) n_shapes.append(shape) visualize(n_shapes)
[ 1, 1053, 2897, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 3166, 8267, 1053, 1383, 4085, 13, 3166, 7604, 675, 1053, 7604, 675, 13, 3166, 4226, 675, 1053, 4226, 675, 29918, 1272, 29892, 4226, 675, 29918, 12181, 13, 3166, 848, 10036, 1053, 1053, 29918, 24713, 29892, 1053, 29918, 8945, 3368, 29918, 1272, 13, 3166, 4682, 5647, 13857, 1053, 334, 13, 3166, 4682, 9652, 292, 1053, 334, 13, 3166, 3667, 29879, 1053, 5839, 29918, 1445, 13, 13, 14573, 29918, 10145, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 657, 29883, 9970, 3285, 525, 1272, 1495, 718, 2897, 29889, 19570, 13, 14573, 29918, 7068, 3301, 2890, 29918, 10593, 2965, 2544, 1164, 353, 360, 8254, 29918, 10145, 718, 525, 1785, 16580, 29915, 718, 2897, 29889, 19570, 718, 525, 2585, 29915, 718, 2897, 29889, 19570, 29871, 13, 29903, 7520, 3352, 29918, 14573, 353, 360, 8254, 29918, 10145, 718, 525, 8173, 29915, 718, 2897, 29889, 19570, 13, 29940, 1955, 1529, 5265, 29999, 3352, 29918, 14573, 353, 317, 7520, 3352, 29918, 14573, 718, 525, 5014, 287, 29918, 1272, 29915, 718, 2897, 29889, 19570, 13, 13, 2202, 29901, 13, 1678, 5680, 353, 7442, 29889, 1359, 29898, 29903, 7520, 3352, 29918, 14573, 718, 376, 22100, 29889, 29876, 2272, 613, 2758, 29918, 23945, 280, 29922, 5574, 29897, 13, 1678, 5680, 353, 5680, 29889, 667, 580, 13, 19499, 29901, 13, 1678, 1209, 13, 13, 29937, 4986, 3970, 29901, 512, 2325, 263, 934, 5839, 261, 304, 1510, 393, 9565, 591, 884, 8762, 29892, 322, 278, 6210, 310, 278, 4682, 13944, 13, 29937, 19338, 1747, 8267, 13, 2158, 14182, 29876, 2683, 2683, 2683, 807, 1159, 13, 2158, 703, 29941, 29928, 1383, 11603, 11856, 10863, 1159, 13, 2158, 703, 2683, 2683, 2683, 807, 1159, 13, 13, 8000, 5852, 29901, 13, 1678, 1596, 703, 3549, 263, 8267, 304, 2740, 363, 2788, 6743, 29889, 9333, 438, 4198, 322, 16507, 29979, 21971, 526, 6969, 29889, 320, 29876, 1159, 13, 1678, 1018, 29901, 13, 4706, 8267, 353, 5839, 29918, 1445, 580, 13, 4706, 2867, 13, 1678, 5174, 3497, 17413, 2392, 29901, 13, 4706, 1596, 703, 2283, 451, 1476, 29889, 3967, 1449, 7790, 29876, 1159, 13, 4706, 6773, 13, 1678, 5174, 3497, 24217, 2392, 29901, 13, 4706, 1596, 703, 5809, 451, 6969, 29889, 3529, 1831, 385, 438, 4198, 470, 16507, 29979, 934, 7790, 29876, 1159, 13, 4706, 6773, 13, 13, 13, 13, 2158, 877, 19077, 5921, 2346, 8267, 869, 869, 869, 25710, 13, 12181, 29892, 716, 29918, 29876, 29918, 369, 1372, 29892, 716, 29918, 29876, 29918, 8726, 353, 4226, 675, 29918, 12181, 29898, 12181, 29897, 13, 13, 29937, 20535, 1218, 5680, 363, 278, 8267, 13, 2158, 877, 27065, 1218, 5680, 363, 2346, 8267, 322, 3918, 675, 963, 29889, 869, 869, 1495, 13, 12181, 29918, 22100, 353, 8147, 29918, 14369, 29918, 12181, 29918, 2527, 10817, 29898, 12181, 29897, 13, 12181, 29918, 22100, 353, 3918, 675, 29918, 14369, 29918, 12181, 29898, 12181, 29918, 22100, 29897, 13, 13, 29937, 20535, 403, 20471, 22092, 943, 3025, 319, 10262, 322, 390, 29899, 29940, 799, 342, 2448, 1141, 29890, 943, 13, 484, 1141, 29890, 943, 353, 364, 29918, 484, 1141, 29890, 943, 29898, 12181, 29918, 22100, 29892, 5680, 29897, 13, 29876, 29918, 845, 11603, 29918, 333, 29892, 302, 29918, 5721, 2925, 353, 22092, 943, 29961, 29900, 3816, 29896, 29901, 1402, 22092, 943, 29961, 29896, 3816, 29896, 17531, 13, 13, 29937, 19338, 1747, 25834, 515, 2566, 13, 29876, 29918, 845, 11603, 353, 5159, 13, 1454, 1178, 297, 302, 29918, 845, 11603, 29918, 333, 29901, 13, 1678, 10422, 353, 29940, 1955, 1529, 5265, 29999, 3352, 29918, 14573, 718, 376, 29876, 29908, 718, 851, 29898, 333, 29897, 718, 11393, 2696, 29908, 13, 1678, 934, 353, 1722, 29898, 9507, 29892, 525, 29878, 1495, 13, 1678, 4837, 29879, 29892, 17240, 29892, 302, 29918, 369, 1372, 29892, 302, 29918, 8726, 353, 1303, 29918, 2696, 29898, 1445, 29897, 13, 1678, 27716, 353, 534, 29885, 29889, 1359, 29918, 4467, 29882, 29898, 9507, 29897, 13, 268, 13, 1678, 8267, 353, 1383, 4085, 29898, 369, 1372, 29892, 17240, 29892, 27716, 29897, 13, 1678, 8267, 29889, 842, 29918, 333, 29898, 333, 29897, 13, 1678, 302, 29918, 845, 11603, 29889, 4397, 29898, 12181, 29897, 13, 13, 20119, 675, 29898, 29876, 29918, 845, 11603, 29897, 13, 13, 13, 2 ]
tests/confmeasure.py
Mic92/vmsh
39
130396
<gh_stars>10-100 #!/usr/bin/env python3 import contextlib import sys from datetime import datetime from pathlib import Path from typing import List, Type, Optional import pytest from qemu import QemuVm, VmImage, spawn_qemu from nix import notos_image, busybox_image from root import TEST_ROOT from vmsh import spawn_vmsh_command, VmshPopen sys.path.append(str(TEST_ROOT.parent)) NOW = datetime.now().strftime("%Y%m%d-%H%M%S") # passed to numactl, starts with 0 CORES_VMSH = "1-3" CORES_QEMU = "4-7" class Helpers: @staticmethod def root() -> Path: return TEST_ROOT @staticmethod def notos_image() -> VmImage: return notos_image(nix=".#measurement-image") @staticmethod def busybox_image() -> "contextlib._GeneratorContextManager[Path]": # return busybox_image(nix=".#measurement-image") return busybox_image() @staticmethod def spawn_vmsh_command( args: List[str], cargo_executable: str = "vmsh" ) -> VmshPopen: return spawn_vmsh_command( args, cargo_executable, target="release", pin_cores=CORES_VMSH ) @staticmethod def run_vmsh_command(args: List[str], cargo_executable: str = "vmsh") -> VmshPopen: proc = spawn_vmsh_command( args, cargo_executable, target="release", pin_cores=CORES_VMSH ) assert proc.wait() == 0 return proc @staticmethod def spawn_qemu( image: VmImage, virtio_blk: Optional[str] = None, virtio_9p: Optional[str] = None, extra_args: List[str] = [], ) -> "contextlib._GeneratorContextManager[QemuVm]": extra_args_pre = [ "numactl", "-C", CORES_QEMU, ] extra_args_ = extra_args.copy() if virtio_blk is not None: extra_args_ += [ "-drive", f"id=drive2,file={virtio_blk},format=raw,if=none", "-device", "virtio-blk-pci,drive=drive2", # TODO mmio ] if virtio_9p is not None: extra_args_ += [ "-virtfs", f"local,path={virtio_9p},security_model=none,mount_tag=measure9p", ] return spawn_qemu(image, extra_args_, extra_args_pre) @pytest.fixture def helpers() -> Type[Helpers]: return Helpers
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 3030, 1982, 13, 5215, 10876, 13, 3166, 12865, 1053, 12865, 13, 3166, 2224, 1982, 1053, 10802, 13, 3166, 19229, 1053, 2391, 29892, 5167, 29892, 28379, 13, 13, 5215, 11451, 1688, 13, 3166, 3855, 24425, 1053, 660, 24425, 29963, 29885, 29892, 478, 29885, 2940, 29892, 29178, 29918, 29939, 24425, 13, 3166, 302, 861, 1053, 451, 359, 29918, 3027, 29892, 19587, 1884, 29918, 3027, 13, 3166, 3876, 1053, 17067, 1254, 29918, 21289, 13, 3166, 22419, 845, 1053, 29178, 29918, 6925, 845, 29918, 6519, 29892, 478, 29885, 845, 29925, 3150, 13, 13, 9675, 29889, 2084, 29889, 4397, 29898, 710, 29898, 18267, 29918, 21289, 29889, 3560, 876, 13, 13, 13, 6632, 29956, 353, 12865, 29889, 3707, 2141, 710, 615, 603, 11702, 29979, 29995, 29885, 29995, 29881, 19222, 29950, 29995, 29924, 29995, 29903, 1159, 13, 13, 29937, 4502, 304, 954, 627, 29880, 29892, 8665, 411, 29871, 29900, 13, 3217, 15989, 29918, 29963, 4345, 29950, 353, 376, 29896, 29899, 29941, 29908, 13, 3217, 15989, 29918, 29984, 12665, 29965, 353, 376, 29946, 29899, 29955, 29908, 13, 13, 13, 1990, 6162, 6774, 29901, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 3876, 580, 1599, 10802, 29901, 13, 4706, 736, 17067, 1254, 29918, 21289, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 451, 359, 29918, 3027, 580, 1599, 478, 29885, 2940, 29901, 13, 4706, 736, 451, 359, 29918, 3027, 29898, 29876, 861, 29569, 29937, 26658, 358, 29899, 3027, 1159, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 19587, 1884, 29918, 3027, 580, 1599, 376, 4703, 1982, 3032, 21575, 2677, 3260, 29961, 2605, 29962, 1115, 13, 4706, 396, 736, 19587, 1884, 29918, 3027, 29898, 29876, 861, 29569, 29937, 26658, 358, 29899, 3027, 1159, 13, 4706, 736, 19587, 1884, 29918, 3027, 580, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 29178, 29918, 6925, 845, 29918, 6519, 29898, 13, 4706, 6389, 29901, 2391, 29961, 710, 1402, 17040, 29918, 4258, 9246, 29901, 851, 353, 376, 6925, 845, 29908, 13, 1678, 1723, 1599, 478, 29885, 845, 29925, 3150, 29901, 13, 4706, 736, 29178, 29918, 6925, 845, 29918, 6519, 29898, 13, 9651, 6389, 29892, 17040, 29918, 4258, 9246, 29892, 3646, 543, 14096, 613, 12534, 29918, 29883, 2361, 29922, 3217, 15989, 29918, 29963, 4345, 29950, 13, 4706, 1723, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1065, 29918, 6925, 845, 29918, 6519, 29898, 5085, 29901, 2391, 29961, 710, 1402, 17040, 29918, 4258, 9246, 29901, 851, 353, 376, 6925, 845, 1159, 1599, 478, 29885, 845, 29925, 3150, 29901, 13, 4706, 9580, 353, 29178, 29918, 6925, 845, 29918, 6519, 29898, 13, 9651, 6389, 29892, 17040, 29918, 4258, 9246, 29892, 3646, 543, 14096, 613, 12534, 29918, 29883, 2361, 29922, 3217, 15989, 29918, 29963, 4345, 29950, 13, 4706, 1723, 13, 4706, 4974, 9580, 29889, 10685, 580, 1275, 29871, 29900, 13, 4706, 736, 9580, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 29178, 29918, 29939, 24425, 29898, 13, 4706, 1967, 29901, 478, 29885, 2940, 29892, 13, 4706, 4610, 601, 29918, 2204, 29895, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 4706, 4610, 601, 29918, 29929, 29886, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 4706, 4805, 29918, 5085, 29901, 2391, 29961, 710, 29962, 353, 19997, 13, 1678, 1723, 1599, 376, 4703, 1982, 3032, 21575, 2677, 3260, 29961, 29984, 24425, 29963, 29885, 29962, 1115, 13, 4706, 4805, 29918, 5085, 29918, 1457, 353, 518, 13, 9651, 376, 1949, 627, 29880, 613, 13, 9651, 11663, 29907, 613, 13, 9651, 4810, 15989, 29918, 29984, 12665, 29965, 29892, 13, 4706, 4514, 13, 4706, 4805, 29918, 5085, 29918, 353, 4805, 29918, 5085, 29889, 8552, 580, 13, 4706, 565, 4610, 601, 29918, 2204, 29895, 338, 451, 6213, 29901, 13, 9651, 4805, 29918, 5085, 29918, 4619, 518, 13, 18884, 11663, 21594, 613, 13, 18884, 285, 29908, 333, 29922, 21594, 29906, 29892, 1445, 3790, 15389, 601, 29918, 2204, 29895, 1118, 4830, 29922, 1610, 29892, 361, 29922, 9290, 613, 13, 18884, 11663, 10141, 613, 13, 18884, 376, 15389, 601, 29899, 2204, 29895, 29899, 29886, 455, 29892, 21594, 29922, 21594, 29906, 613, 29871, 396, 14402, 5654, 601, 13, 9651, 4514, 13, 4706, 565, 4610, 601, 29918, 29929, 29886, 338, 451, 6213, 29901, 13, 9651, 4805, 29918, 5085, 29918, 4619, 518, 13, 18884, 11663, 15389, 5847, 613, 13, 18884, 285, 29908, 2997, 29892, 2084, 3790, 15389, 601, 29918, 29929, 29886, 1118, 8926, 29918, 4299, 29922, 9290, 29892, 16476, 29918, 4039, 29922, 26658, 29929, 29886, 613, 13, 9651, 4514, 13, 4706, 736, 29178, 29918, 29939, 24425, 29898, 3027, 29892, 4805, 29918, 5085, 3383, 4805, 29918, 5085, 29918, 1457, 29897, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 13, 1753, 1371, 414, 580, 1599, 5167, 29961, 7658, 6774, 5387, 13, 1678, 736, 6162, 6774, 13, 2 ]
utils/label_data.py
safdark/CarND-Capstone
2
99907
<filename>utils/label_data.py import glob import os import time import numpy as np import tensorflow as tf from PIL import Image from lxml import etree from tqdm import tqdm flags = tf.app.flags flags.DEFINE_string('data_dir', None, 'Path to the folder where the images are stored') flags.DEFINE_string('labels_dir', None, 'Path to the folder labels annotation are stored') flags.DEFINE_string('model_path', None, 'Path to the frozen graph used for traffic light detection') flags.DEFINE_string('label', None, 'The name of the corresponding label') flags.DEFINE_integer('category_index', 10, 'The id of the traffic light category as detected by the model') tf.app.flags.mark_flag_as_required('data_dir') tf.app.flags.mark_flag_as_required('model_path') tf.app.flags.mark_flag_as_required('label') FLAGS = flags.FLAGS def load_model(file_path): detection_graph = tf.Graph() with detection_graph.as_default(): od_graph_def = tf.GraphDef() with tf.gfile.GFile(file_path, 'rb') as fid: serialized_graph = fid.read() od_graph_def.ParseFromString(serialized_graph) tf.import_graph_def(od_graph_def, name='') return detection_graph def load_image(image_path): image = Image.open(image_path) (im_width, im_height) = image.size return np.array(image.getdata()).reshape((im_height, im_width, 3)).astype(np.uint8), im_width, im_height def run_inference(sess, ops, image_tensor, image): output_dict = {} time_s = time.time() num_detections, boxes, scores, classes = sess.run(ops, feed_dict={image_tensor: image}) time_t = time.time() - time_s output_dict['num_detections'] = int(num_detections[0]) output_dict['detection_classes'] = classes[0].astype(np.uint8) output_dict['detection_boxes'] = boxes[0] output_dict['detection_scores'] = scores[0] output_dict['detection_time'] = time_t return output_dict def create_xml_annotation(detection_dict, label_path, label, category_index, threshold=0.5): root = etree.Element("annotation") etree.SubElement(root, "filename").text = os.path.basename(detection_dict['filename']) source = etree.SubElement(root, 'source') etree.SubElement(source, 'database').text = 'Unknown' size = etree.SubElement(root, 'size') width = detection_dict['width'] height = detection_dict['height'] etree.SubElement(size, 'width').text = str(width) etree.SubElement(size, 'height').text = str(height) etree.SubElement(size, 'depth').text = str(detection_dict['depth']) etree.SubElement(root, 'segmented').text = '0' num_detections = detection_dict['num_detections'] detection_classes = detection_dict['detection_classes'] detection_boxes = detection_dict['detection_boxes'] detection_scores = detection_dict['detection_scores'] # Selects the indexes that correspond to the correct category and that passes the detection score threshold traffic_lights_idx = np.where((detection_classes == category_index) & (detection_scores >= threshold)) detection_boxes = detection_boxes[traffic_lights_idx] for box in detection_boxes: detection = etree.Element('object') etree.SubElement(detection, 'name').text = label etree.SubElement(detection, 'pose').text = 'Unspecified' etree.SubElement(detection, 'truncated').text = '0' etree.SubElement(detection, 'difficult').text = '0' bound_box = etree.SubElement(detection, 'bndbox') # Convert from normalized boxes etree.SubElement(bound_box, 'xmin').text = str(int(box[1] * width)) etree.SubElement(bound_box, 'ymin').text = str(int(box[0] * height)) etree.SubElement(bound_box, 'xmax').text = str(int(box[3] * width)) etree.SubElement(bound_box, 'ymax').text = str(int(box[2] * height)) root.append(detection) with open(label_path, 'wb') as f: f.write(etree.tostring(root, pretty_print=True)) def main(unused_argv): if FLAGS.labels_dir is None: FLAGS.labels_dir = os.path.join(FLAGS.data_dir, 'labels') if not os.path.isdir(FLAGS.labels_dir): os.makedirs(FLAGS.labels_dir) image_paths = glob.glob(os.path.join(FLAGS.data_dir, '*.jpg')) graph = load_model(FLAGS.model_path) with graph.as_default(): image_tensor = graph.get_tensor_by_name('image_tensor:0') boxes_tensor = graph.get_tensor_by_name('detection_boxes:0') scores_tensor = graph.get_tensor_by_name('detection_scores:0') classes_tensor = graph.get_tensor_by_name('detection_classes:0') detections_tensor = graph.get_tensor_by_name('num_detections:0') ops = [detections_tensor, boxes_tensor, scores_tensor, classes_tensor] with tf.Session() as sess: for image_path in tqdm(image_paths, desc='Processing', unit=' images'): image, width, height = load_image(image_path) # Expand dimensions since the model expects images to have shape: [1, None, None, 3] image_np_expanded = np.expand_dims(image, axis=0) # Actual detection. output_dict = run_inference(sess, ops, image_tensor, image_np_expanded) file_name = os.path.basename(image_path) # Adds some metadata output_dict['filename'] = file_name output_dict['width'] = width output_dict['height'] = height output_dict['depth'] = 3 label_path = os.path.join(FLAGS.labels_dir, '{}.xml'.format(os.path.splitext(file_name)[0])) create_xml_annotation(output_dict, label_path, FLAGS.label, FLAGS.category_index) if __name__ == '__main__': tf.app.run()
[ 1, 529, 9507, 29958, 13239, 29914, 1643, 29918, 1272, 29889, 2272, 13, 5215, 13149, 13, 5215, 2897, 13, 5215, 931, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 26110, 408, 15886, 13, 3166, 349, 6227, 1053, 7084, 13, 3166, 301, 3134, 1053, 634, 929, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 13, 13, 15764, 353, 15886, 29889, 932, 29889, 15764, 13, 13, 15764, 29889, 24405, 8895, 29918, 1807, 877, 1272, 29918, 3972, 742, 6213, 29892, 525, 2605, 304, 278, 4138, 988, 278, 4558, 526, 6087, 1495, 13, 15764, 29889, 24405, 8895, 29918, 1807, 877, 21134, 29918, 3972, 742, 6213, 29892, 525, 2605, 304, 278, 4138, 11073, 17195, 526, 6087, 1495, 13, 15764, 29889, 24405, 8895, 29918, 1807, 877, 4299, 29918, 2084, 742, 6213, 29892, 525, 2605, 304, 278, 14671, 2256, 3983, 1304, 363, 12469, 3578, 15326, 1495, 13, 15764, 29889, 24405, 8895, 29918, 1807, 877, 1643, 742, 6213, 29892, 525, 1576, 1024, 310, 278, 6590, 3858, 1495, 13, 15764, 29889, 24405, 8895, 29918, 16031, 877, 7320, 29918, 2248, 742, 29871, 29896, 29900, 29892, 525, 1576, 1178, 310, 278, 12469, 3578, 7663, 408, 17809, 491, 278, 1904, 1495, 13, 13, 13264, 29889, 932, 29889, 15764, 29889, 3502, 29918, 15581, 29918, 294, 29918, 12403, 877, 1272, 29918, 3972, 1495, 13, 13264, 29889, 932, 29889, 15764, 29889, 3502, 29918, 15581, 29918, 294, 29918, 12403, 877, 4299, 29918, 2084, 1495, 13, 13264, 29889, 932, 29889, 15764, 29889, 3502, 29918, 15581, 29918, 294, 29918, 12403, 877, 1643, 1495, 13, 13, 18823, 10749, 353, 13449, 29889, 18823, 10749, 13, 13, 13, 1753, 2254, 29918, 4299, 29898, 1445, 29918, 2084, 1125, 13, 1678, 15326, 29918, 4262, 353, 15886, 29889, 9527, 580, 13, 1678, 411, 15326, 29918, 4262, 29889, 294, 29918, 4381, 7295, 13, 4706, 2413, 29918, 4262, 29918, 1753, 353, 15886, 29889, 9527, 3206, 580, 13, 4706, 411, 15886, 29889, 29887, 1445, 29889, 29954, 2283, 29898, 1445, 29918, 2084, 29892, 525, 6050, 1495, 408, 25947, 29901, 13, 9651, 7797, 1891, 29918, 4262, 353, 25947, 29889, 949, 580, 13, 9651, 2413, 29918, 4262, 29918, 1753, 29889, 12914, 4591, 1231, 29898, 15550, 1891, 29918, 4262, 29897, 13, 9651, 15886, 29889, 5215, 29918, 4262, 29918, 1753, 29898, 397, 29918, 4262, 29918, 1753, 29892, 1024, 2433, 1495, 13, 1678, 736, 15326, 29918, 4262, 13, 13, 13, 1753, 2254, 29918, 3027, 29898, 3027, 29918, 2084, 1125, 13, 1678, 1967, 353, 7084, 29889, 3150, 29898, 3027, 29918, 2084, 29897, 13, 1678, 313, 326, 29918, 2103, 29892, 527, 29918, 3545, 29897, 353, 1967, 29889, 2311, 13, 1678, 736, 7442, 29889, 2378, 29898, 3027, 29889, 657, 1272, 16655, 690, 14443, 3552, 326, 29918, 3545, 29892, 527, 29918, 2103, 29892, 29871, 29941, 8106, 579, 668, 29898, 9302, 29889, 13470, 29947, 511, 527, 29918, 2103, 29892, 527, 29918, 3545, 13, 13, 13, 1753, 1065, 29918, 262, 1659, 29898, 29879, 404, 29892, 288, 567, 29892, 1967, 29918, 20158, 29892, 1967, 1125, 13, 1678, 1962, 29918, 8977, 353, 6571, 13, 13, 1678, 931, 29918, 29879, 353, 931, 29889, 2230, 580, 13, 1678, 954, 29918, 29881, 2650, 1953, 29892, 16273, 29892, 19435, 29892, 4413, 353, 27937, 29889, 3389, 29898, 3554, 29892, 8343, 29918, 8977, 3790, 3027, 29918, 20158, 29901, 1967, 1800, 13, 1678, 931, 29918, 29873, 353, 931, 29889, 2230, 580, 448, 931, 29918, 29879, 13, 13, 1678, 1962, 29918, 8977, 1839, 1949, 29918, 29881, 2650, 1953, 2033, 353, 938, 29898, 1949, 29918, 29881, 2650, 1953, 29961, 29900, 2314, 13, 1678, 1962, 29918, 8977, 1839, 29881, 2650, 428, 29918, 13203, 2033, 353, 4413, 29961, 29900, 1822, 579, 668, 29898, 9302, 29889, 13470, 29947, 29897, 13, 1678, 1962, 29918, 8977, 1839, 29881, 2650, 428, 29918, 1884, 267, 2033, 353, 16273, 29961, 29900, 29962, 13, 1678, 1962, 29918, 8977, 1839, 29881, 2650, 428, 29918, 1557, 2361, 2033, 353, 19435, 29961, 29900, 29962, 13, 1678, 1962, 29918, 8977, 1839, 29881, 2650, 428, 29918, 2230, 2033, 353, 931, 29918, 29873, 13, 13, 1678, 736, 1962, 29918, 8977, 13, 13, 13, 1753, 1653, 29918, 3134, 29918, 18317, 29898, 29881, 2650, 428, 29918, 8977, 29892, 3858, 29918, 2084, 29892, 3858, 29892, 7663, 29918, 2248, 29892, 16897, 29922, 29900, 29889, 29945, 1125, 13, 1678, 3876, 353, 634, 929, 29889, 2642, 703, 18317, 1159, 13, 13, 1678, 634, 929, 29889, 4035, 2642, 29898, 4632, 29892, 376, 9507, 2564, 726, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 29881, 2650, 428, 29918, 8977, 1839, 9507, 11287, 13, 13, 1678, 2752, 353, 634, 929, 29889, 4035, 2642, 29898, 4632, 29892, 525, 4993, 1495, 13, 1678, 634, 929, 29889, 4035, 2642, 29898, 4993, 29892, 525, 9803, 2824, 726, 353, 525, 14148, 29915, 13, 13, 1678, 2159, 353, 634, 929, 29889, 4035, 2642, 29898, 4632, 29892, 525, 2311, 1495, 13, 1678, 2920, 353, 15326, 29918, 8977, 1839, 2103, 2033, 13, 1678, 3171, 353, 15326, 29918, 8977, 1839, 3545, 2033, 13, 13, 1678, 634, 929, 29889, 4035, 2642, 29898, 2311, 29892, 525, 2103, 2824, 726, 353, 851, 29898, 2103, 29897, 13, 1678, 634, 929, 29889, 4035, 2642, 29898, 2311, 29892, 525, 3545, 2824, 726, 353, 851, 29898, 3545, 29897, 13, 1678, 634, 929, 29889, 4035, 2642, 29898, 2311, 29892, 525, 19488, 2824, 726, 353, 851, 29898, 29881, 2650, 428, 29918, 8977, 1839, 19488, 11287, 13, 1678, 634, 929, 29889, 4035, 2642, 29898, 4632, 29892, 525, 28192, 287, 2824, 726, 353, 525, 29900, 29915, 13, 13, 1678, 954, 29918, 29881, 2650, 1953, 353, 15326, 29918, 8977, 1839, 1949, 29918, 29881, 2650, 1953, 2033, 13, 1678, 15326, 29918, 13203, 353, 15326, 29918, 8977, 1839, 29881, 2650, 428, 29918, 13203, 2033, 13, 1678, 15326, 29918, 1884, 267, 353, 15326, 29918, 8977, 1839, 29881, 2650, 428, 29918, 1884, 267, 2033, 13, 1678, 15326, 29918, 1557, 2361, 353, 15326, 29918, 8977, 1839, 29881, 2650, 428, 29918, 1557, 2361, 2033, 13, 13, 1678, 396, 7605, 29879, 278, 18111, 393, 3928, 304, 278, 1959, 7663, 322, 393, 14517, 278, 15326, 8158, 16897, 13, 1678, 12469, 29918, 4366, 29879, 29918, 13140, 353, 7442, 29889, 3062, 3552, 29881, 2650, 428, 29918, 13203, 1275, 7663, 29918, 2248, 29897, 669, 313, 29881, 2650, 428, 29918, 1557, 2361, 6736, 16897, 876, 13, 1678, 15326, 29918, 1884, 267, 353, 15326, 29918, 1884, 267, 29961, 3018, 2416, 29918, 4366, 29879, 29918, 13140, 29962, 13, 1678, 363, 3800, 297, 15326, 29918, 1884, 267, 29901, 13, 4706, 15326, 353, 634, 929, 29889, 2642, 877, 3318, 1495, 13, 4706, 634, 929, 29889, 4035, 2642, 29898, 29881, 2650, 428, 29892, 525, 978, 2824, 726, 353, 3858, 13, 4706, 634, 929, 29889, 4035, 2642, 29898, 29881, 2650, 428, 29892, 525, 4220, 2824, 726, 353, 525, 25807, 3135, 2164, 29915, 13, 4706, 634, 929, 29889, 4035, 2642, 29898, 29881, 2650, 428, 29892, 525, 509, 4661, 630, 2824, 726, 353, 525, 29900, 29915, 13, 4706, 634, 929, 29889, 4035, 2642, 29898, 29881, 2650, 428, 29892, 525, 12765, 3953, 2824, 726, 353, 525, 29900, 29915, 13, 4706, 3216, 29918, 1884, 353, 634, 929, 29889, 4035, 2642, 29898, 29881, 2650, 428, 29892, 525, 29890, 299, 1884, 1495, 13, 4706, 396, 14806, 515, 4226, 1891, 16273, 13, 4706, 634, 929, 29889, 4035, 2642, 29898, 9917, 29918, 1884, 29892, 525, 29916, 1195, 2824, 726, 353, 851, 29898, 524, 29898, 1884, 29961, 29896, 29962, 334, 2920, 876, 13, 4706, 634, 929, 29889, 4035, 2642, 29898, 9917, 29918, 1884, 29892, 525, 962, 262, 2824, 726, 353, 851, 29898, 524, 29898, 1884, 29961, 29900, 29962, 334, 3171, 876, 13, 4706, 634, 929, 29889, 4035, 2642, 29898, 9917, 29918, 1884, 29892, 525, 29916, 3317, 2824, 726, 353, 851, 29898, 524, 29898, 1884, 29961, 29941, 29962, 334, 2920, 876, 13, 4706, 634, 929, 29889, 4035, 2642, 29898, 9917, 29918, 1884, 29892, 525, 29891, 3317, 2824, 726, 353, 851, 29898, 524, 29898, 1884, 29961, 29906, 29962, 334, 3171, 876, 13, 4706, 3876, 29889, 4397, 29898, 29881, 2650, 428, 29897, 13, 13, 1678, 411, 1722, 29898, 1643, 29918, 2084, 29892, 525, 29893, 29890, 1495, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 300, 929, 29889, 517, 1807, 29898, 4632, 29892, 5051, 29918, 2158, 29922, 5574, 876, 13, 13, 13, 1753, 1667, 29898, 348, 3880, 29918, 19218, 1125, 13, 1678, 565, 383, 4375, 10749, 29889, 21134, 29918, 3972, 338, 6213, 29901, 13, 4706, 383, 4375, 10749, 29889, 21134, 29918, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 18823, 10749, 29889, 1272, 29918, 3972, 29892, 525, 21134, 1495, 13, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 18823, 10749, 29889, 21134, 29918, 3972, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 18823, 10749, 29889, 21134, 29918, 3972, 29897, 13, 13, 1678, 1967, 29918, 24772, 353, 13149, 29889, 23705, 29898, 359, 29889, 2084, 29889, 7122, 29898, 18823, 10749, 29889, 1272, 29918, 3972, 29892, 525, 10521, 6173, 8785, 13, 1678, 3983, 353, 2254, 29918, 4299, 29898, 18823, 10749, 29889, 4299, 29918, 2084, 29897, 13, 13, 1678, 411, 3983, 29889, 294, 29918, 4381, 7295, 13, 13, 4706, 1967, 29918, 20158, 353, 3983, 29889, 657, 29918, 20158, 29918, 1609, 29918, 978, 877, 3027, 29918, 20158, 29901, 29900, 1495, 13, 4706, 16273, 29918, 20158, 353, 3983, 29889, 657, 29918, 20158, 29918, 1609, 29918, 978, 877, 29881, 2650, 428, 29918, 1884, 267, 29901, 29900, 1495, 13, 4706, 19435, 29918, 20158, 353, 3983, 29889, 657, 29918, 20158, 29918, 1609, 29918, 978, 877, 29881, 2650, 428, 29918, 1557, 2361, 29901, 29900, 1495, 13, 4706, 4413, 29918, 20158, 353, 3983, 29889, 657, 29918, 20158, 29918, 1609, 29918, 978, 877, 29881, 2650, 428, 29918, 13203, 29901, 29900, 1495, 13, 4706, 1439, 29872, 1953, 29918, 20158, 353, 3983, 29889, 657, 29918, 20158, 29918, 1609, 29918, 978, 877, 1949, 29918, 29881, 2650, 1953, 29901, 29900, 1495, 13, 13, 4706, 288, 567, 353, 518, 29881, 2650, 1953, 29918, 20158, 29892, 16273, 29918, 20158, 29892, 19435, 29918, 20158, 29892, 4413, 29918, 20158, 29962, 13, 13, 4706, 411, 15886, 29889, 7317, 580, 408, 27937, 29901, 13, 9651, 363, 1967, 29918, 2084, 297, 260, 29939, 18933, 29898, 3027, 29918, 24772, 29892, 5153, 2433, 7032, 292, 742, 5190, 2433, 4558, 29374, 13, 18884, 1967, 29892, 2920, 29892, 3171, 353, 2254, 29918, 3027, 29898, 3027, 29918, 2084, 29897, 13, 18884, 396, 12027, 392, 13391, 1951, 278, 1904, 23347, 4558, 304, 505, 8267, 29901, 518, 29896, 29892, 6213, 29892, 6213, 29892, 29871, 29941, 29962, 13, 18884, 1967, 29918, 9302, 29918, 18837, 287, 353, 7442, 29889, 18837, 29918, 6229, 29879, 29898, 3027, 29892, 9685, 29922, 29900, 29897, 13, 18884, 396, 3185, 950, 15326, 29889, 13, 18884, 1962, 29918, 8977, 353, 1065, 29918, 262, 1659, 29898, 29879, 404, 29892, 288, 567, 29892, 1967, 29918, 20158, 29892, 1967, 29918, 9302, 29918, 18837, 287, 29897, 13, 18884, 934, 29918, 978, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 3027, 29918, 2084, 29897, 13, 18884, 396, 3462, 29879, 777, 15562, 13, 18884, 1962, 29918, 8977, 1839, 9507, 2033, 353, 934, 29918, 978, 13, 18884, 1962, 29918, 8977, 1839, 2103, 2033, 353, 2920, 13, 18884, 1962, 29918, 8977, 1839, 3545, 2033, 353, 3171, 13, 18884, 1962, 29918, 8977, 1839, 19488, 2033, 353, 29871, 29941, 13, 18884, 3858, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 18823, 10749, 29889, 21134, 29918, 3972, 29892, 22372, 1836, 3134, 4286, 4830, 29898, 359, 29889, 2084, 29889, 23579, 568, 486, 29898, 1445, 29918, 978, 9601, 29900, 12622, 13, 18884, 1653, 29918, 3134, 29918, 18317, 29898, 4905, 29918, 8977, 29892, 3858, 29918, 2084, 29892, 383, 4375, 10749, 29889, 1643, 29892, 383, 4375, 10749, 29889, 7320, 29918, 2248, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 15886, 29889, 932, 29889, 3389, 580, 13, 2 ]
librs/dblib.py
mrabobi/ISChallenge
1
163117
<filename>librs/dblib.py import os import time import traceback from datetime import datetime from sqlalchemy import create_engine, engine, text cloud_sql_connection_name = os.getenv("CLOUD_SQL_CONNECTION_NAME") db = create_engine( engine.url.URL( drivername="mysql+pymysql", username=os.getenv("DB_USER"), password=<PASSWORD>("<PASSWORD>"), database=os.getenv("DB_NAME"), query={"unix_socket": "/cloudsql/{}".format(cloud_sql_connection_name)}, ), ) def insert_user(name, email, token=None): with db.connect() as conn: added_at_timestamp = int(time.time()) added_at_formatted = datetime.fromtimestamp(added_at_timestamp).strftime("%Y-%m-%d %H:%M:%S") stmt = text( "INSERT INTO users (name, email, added_at, token) VALUES (:name, :email, :added_at, :token)" ) result = conn.execute( stmt, name=name, email=email, added_at=added_at_formatted, token=token ) if result: return True return False def user_add_new_challange(user_id, location_id): with db.connect() as conn: # Format -- 2020-01-01 10:10:10 start_time_timestamp = int(time.time()) start_time_formatted = datetime.fromtimestamp(start_time_timestamp).strftime("%Y-%m-%d %H:%M:%S") stmt = text( "INSERT INTO picked (user_id, location_id, start_time) VALUES (:user_id, :location_id, :start_time)" ) result = conn.execute( stmt, user_id=user_id, location_id=location_id, start_time=start_time_formatted ) if result: return True return False def insert_new_location(lat, long, name, url, description): with db.connect() as conn: stmt = text( "INSERT INTO locations (latitude, longitude, name, url, description)" " VALUES (:latitude, :longitude, :name, :url, :description)" ) result = conn.execute( stmt, latitude=lat, longitude=long, name=name, url=url, description=description ) if result: return True return False def get_location_id(name): with db.connect() as conn: stmt = text( "SELECT location_id FROM locations WHERE name=:name" ) result = conn.execute( stmt, name=name ).fetchone() if result: return result[0] return None def get_user_id(name): with db.connect() as conn: stmt = text( "SELECT user_id FROM users WHERE name=:name" ) result = conn.execute( stmt, name=name ).fetchone() if result: return result[0] return None def get_coords(name): with db.connect() as conn: stmt = text( "SELECT latitude, longitude FROM locations WHERE name=:name" ) result = conn.execute( stmt, name=name ).fetchone() if result: return result, "result is {}".format(result) return None, "" def get_everything_from_locations(): with db.connect() as conn: stmt = text( "SELECT latitude, longitude, url, name FROM locations" ) result = conn.execute(stmt).fetchall() li = list() for index in result: li.append(index) return li, "result is {}".format(result)
[ 1, 529, 9507, 29958, 492, 1182, 29879, 29914, 2585, 1982, 29889, 2272, 13, 5215, 2897, 13, 5215, 931, 13, 5215, 9637, 1627, 13, 3166, 12865, 1053, 12865, 13, 13, 3166, 4576, 284, 305, 6764, 1053, 1653, 29918, 10599, 29892, 6012, 29892, 1426, 13, 13, 9274, 29918, 2850, 29918, 9965, 29918, 978, 353, 2897, 29889, 657, 6272, 703, 29907, 3927, 15789, 29918, 4176, 29918, 6007, 8186, 9838, 29918, 5813, 1159, 13, 2585, 353, 1653, 29918, 10599, 29898, 13, 1678, 6012, 29889, 2271, 29889, 4219, 29898, 13, 4706, 7156, 978, 543, 7938, 29974, 29886, 962, 952, 1519, 613, 13, 4706, 8952, 29922, 359, 29889, 657, 6272, 703, 4051, 29918, 11889, 4968, 13, 4706, 4800, 29922, 29966, 25711, 17013, 29958, 28945, 25711, 17013, 29958, 4968, 13, 4706, 2566, 29922, 359, 29889, 657, 6272, 703, 4051, 29918, 5813, 4968, 13, 4706, 2346, 3790, 29908, 24538, 29918, 11514, 1115, 5591, 9274, 2850, 29914, 8875, 1642, 4830, 29898, 9274, 29918, 2850, 29918, 9965, 29918, 978, 19230, 13, 1678, 10353, 13, 29897, 13, 13, 13, 1753, 4635, 29918, 1792, 29898, 978, 29892, 4876, 29892, 5993, 29922, 8516, 1125, 13, 1678, 411, 4833, 29889, 6915, 580, 408, 11009, 29901, 13, 4706, 2715, 29918, 271, 29918, 16394, 353, 938, 29898, 2230, 29889, 2230, 3101, 13, 4706, 2715, 29918, 271, 29918, 689, 19667, 353, 12865, 29889, 3166, 16394, 29898, 23959, 29918, 271, 29918, 16394, 467, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 1159, 13, 4706, 380, 4378, 353, 1426, 29898, 13, 9651, 376, 19460, 11646, 4160, 313, 978, 29892, 4876, 29892, 2715, 29918, 271, 29892, 5993, 29897, 15673, 13940, 978, 29892, 584, 5269, 29892, 584, 23959, 29918, 271, 29892, 584, 6979, 5513, 13, 4706, 1723, 13, 13, 4706, 1121, 353, 11009, 29889, 7978, 29898, 13, 9651, 380, 4378, 29892, 1024, 29922, 978, 29892, 4876, 29922, 5269, 29892, 2715, 29918, 271, 29922, 23959, 29918, 271, 29918, 689, 19667, 29892, 5993, 29922, 6979, 13, 4706, 1723, 13, 13, 1678, 565, 1121, 29901, 13, 4706, 736, 5852, 13, 13, 1678, 736, 7700, 13, 13, 13, 1753, 1404, 29918, 1202, 29918, 1482, 29918, 305, 497, 927, 29898, 1792, 29918, 333, 29892, 4423, 29918, 333, 1125, 13, 1678, 411, 4833, 29889, 6915, 580, 408, 11009, 29901, 13, 4706, 396, 19191, 1192, 29871, 29906, 29900, 29906, 29900, 29899, 29900, 29896, 29899, 29900, 29896, 29871, 29896, 29900, 29901, 29896, 29900, 29901, 29896, 29900, 13, 4706, 1369, 29918, 2230, 29918, 16394, 353, 938, 29898, 2230, 29889, 2230, 3101, 13, 4706, 1369, 29918, 2230, 29918, 689, 19667, 353, 12865, 29889, 3166, 16394, 29898, 2962, 29918, 2230, 29918, 16394, 467, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 1159, 13, 4706, 380, 4378, 353, 1426, 29898, 13, 9651, 376, 19460, 11646, 18691, 313, 1792, 29918, 333, 29892, 4423, 29918, 333, 29892, 1369, 29918, 2230, 29897, 15673, 13940, 1792, 29918, 333, 29892, 584, 5479, 29918, 333, 29892, 584, 2962, 29918, 2230, 5513, 13, 4706, 1723, 13, 13, 4706, 1121, 353, 11009, 29889, 7978, 29898, 13, 9651, 380, 4378, 29892, 1404, 29918, 333, 29922, 1792, 29918, 333, 29892, 4423, 29918, 333, 29922, 5479, 29918, 333, 29892, 1369, 29918, 2230, 29922, 2962, 29918, 2230, 29918, 689, 19667, 13, 4706, 1723, 13, 13, 1678, 565, 1121, 29901, 13, 4706, 736, 5852, 13, 13, 1678, 736, 7700, 13, 13, 13, 1753, 4635, 29918, 1482, 29918, 5479, 29898, 5066, 29892, 1472, 29892, 1024, 29892, 3142, 29892, 6139, 1125, 13, 1678, 411, 4833, 29889, 6915, 580, 408, 11009, 29901, 13, 4706, 380, 4378, 353, 1426, 29898, 13, 9651, 376, 19460, 11646, 14354, 313, 5066, 4279, 29892, 28745, 29892, 1024, 29892, 3142, 29892, 6139, 5513, 13, 9651, 376, 15673, 13940, 5066, 4279, 29892, 584, 5426, 4279, 29892, 584, 978, 29892, 584, 2271, 29892, 584, 8216, 5513, 13, 4706, 1723, 13, 13, 4706, 1121, 353, 11009, 29889, 7978, 29898, 13, 9651, 380, 4378, 29892, 26271, 29922, 5066, 29892, 28745, 29922, 5426, 29892, 1024, 29922, 978, 29892, 3142, 29922, 2271, 29892, 6139, 29922, 8216, 13, 4706, 1723, 13, 13, 1678, 565, 1121, 29901, 13, 4706, 736, 5852, 13, 13, 1678, 736, 7700, 13, 13, 13, 1753, 679, 29918, 5479, 29918, 333, 29898, 978, 1125, 13, 1678, 411, 4833, 29889, 6915, 580, 408, 11009, 29901, 13, 4706, 380, 4378, 353, 1426, 29898, 13, 9651, 376, 6404, 4423, 29918, 333, 3895, 14354, 5754, 1024, 29922, 29901, 978, 29908, 13, 4706, 1723, 13, 13, 4706, 1121, 353, 11009, 29889, 7978, 29898, 13, 9651, 380, 4378, 29892, 1024, 29922, 978, 13, 4706, 13742, 9155, 650, 580, 13, 13, 1678, 565, 1121, 29901, 13, 4706, 736, 1121, 29961, 29900, 29962, 13, 13, 1678, 736, 6213, 13, 13, 13, 1753, 679, 29918, 1792, 29918, 333, 29898, 978, 1125, 13, 1678, 411, 4833, 29889, 6915, 580, 408, 11009, 29901, 13, 4706, 380, 4378, 353, 1426, 29898, 13, 9651, 376, 6404, 1404, 29918, 333, 3895, 4160, 5754, 1024, 29922, 29901, 978, 29908, 13, 4706, 1723, 13, 13, 4706, 1121, 353, 11009, 29889, 7978, 29898, 13, 9651, 380, 4378, 29892, 1024, 29922, 978, 13, 4706, 13742, 9155, 650, 580, 13, 13, 1678, 565, 1121, 29901, 13, 4706, 736, 1121, 29961, 29900, 29962, 13, 13, 1678, 736, 6213, 13, 13, 13, 1753, 679, 29918, 1111, 4339, 29898, 978, 1125, 13, 1678, 411, 4833, 29889, 6915, 580, 408, 11009, 29901, 13, 4706, 380, 4378, 353, 1426, 29898, 13, 9651, 376, 6404, 26271, 29892, 28745, 3895, 14354, 5754, 1024, 29922, 29901, 978, 29908, 13, 4706, 1723, 13, 13, 4706, 1121, 353, 11009, 29889, 7978, 29898, 13, 9651, 380, 4378, 29892, 1024, 29922, 978, 13, 4706, 13742, 9155, 650, 580, 13, 13, 1678, 565, 1121, 29901, 13, 4706, 736, 1121, 29892, 376, 2914, 338, 6571, 1642, 4830, 29898, 2914, 29897, 13, 13, 1678, 736, 6213, 29892, 5124, 13, 13, 13, 1753, 679, 29918, 17991, 1918, 29918, 3166, 29918, 2029, 800, 7295, 13, 1678, 411, 4833, 29889, 6915, 580, 408, 11009, 29901, 13, 4706, 380, 4378, 353, 1426, 29898, 13, 9651, 376, 6404, 26271, 29892, 28745, 29892, 3142, 29892, 1024, 3895, 14354, 29908, 13, 4706, 1723, 13, 13, 4706, 1121, 353, 11009, 29889, 7978, 29898, 17868, 467, 9155, 497, 580, 13, 4706, 619, 353, 1051, 580, 13, 4706, 363, 2380, 297, 1121, 29901, 13, 9651, 619, 29889, 4397, 29898, 2248, 29897, 13, 4706, 736, 619, 29892, 376, 2914, 338, 6571, 1642, 4830, 29898, 2914, 29897, 2 ]
14/python/collatz.py
tylermumford/euler
1
54573
#!/usr/bin/env python3 collatz_memo = {1: 1} def collatz(n): '''Return the length of the Collatz sequence for the given input''' if n in collatz_memo: result = collatz_memo[n] elif n % 2 == 0: collatz_memo[n] = 1 + collatz(n / 2) result = collatz_memo[n] else: collatz_memo[n] = 1 + collatz(3 * n + 1) result = collatz_memo[n] return result if __name__ == '__main__': import argparse desc = 'Return the collatz number for a given input' parser = argparse.ArgumentParser(description=desc) parser.add_argument('n', type=int, help='integer to use as input') args = parser.parse_args() print(collatz(args.n))
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 22017, 4101, 29918, 6954, 29877, 353, 426, 29896, 29901, 29871, 29896, 29913, 13, 13, 1753, 5321, 4101, 29898, 29876, 1125, 13, 1678, 14550, 11609, 278, 3309, 310, 278, 13435, 4101, 5665, 363, 278, 2183, 1881, 12008, 13, 13, 1678, 565, 302, 297, 5321, 4101, 29918, 6954, 29877, 29901, 13, 4706, 1121, 353, 5321, 4101, 29918, 6954, 29877, 29961, 29876, 29962, 13, 1678, 25342, 302, 1273, 29871, 29906, 1275, 29871, 29900, 29901, 13, 4706, 5321, 4101, 29918, 6954, 29877, 29961, 29876, 29962, 353, 29871, 29896, 718, 5321, 4101, 29898, 29876, 847, 29871, 29906, 29897, 13, 4706, 1121, 353, 5321, 4101, 29918, 6954, 29877, 29961, 29876, 29962, 13, 1678, 1683, 29901, 13, 4706, 5321, 4101, 29918, 6954, 29877, 29961, 29876, 29962, 353, 29871, 29896, 718, 5321, 4101, 29898, 29941, 334, 302, 718, 29871, 29896, 29897, 13, 4706, 1121, 353, 5321, 4101, 29918, 6954, 29877, 29961, 29876, 29962, 13, 13, 1678, 736, 1121, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1053, 1852, 5510, 13, 1678, 5153, 353, 525, 11609, 278, 5321, 4101, 1353, 363, 263, 2183, 1881, 29915, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 29922, 14273, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29876, 742, 1134, 29922, 524, 29892, 1371, 2433, 16031, 304, 671, 408, 1881, 1495, 13, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 1596, 29898, 22017, 4101, 29898, 5085, 29889, 29876, 876, 13, 2 ]
build/lib.linux-x86_64-2.7_ucs4/mx/DateTime/ISO.py
mkubux/egenix-mx-base
0
55207
""" This module provides a set of constructors and routines to convert between DateTime[Delta] instances and ISO representations of date and time. Note: Timezones are only interpreted by ParseDateTimeGMT(). All other constructors silently ignore the time zone information. Copyright (c) 1998-2000, <NAME>; mailto:<EMAIL> Copyright (c) 2000-2015, eGenix.com Software GmbH; mailto:<EMAIL> See the documentation for further information on copyrights, or contact the author. """ import DateTime,Timezone import re # Grammar: ISO 8601 (not all, but what we need from it) _year = '(?P<year>\d?\d\d\d)' _month = '(?P<month>\d?\d)' _day = '(?P<day>\d?\d)' _hour = '(?P<hour>\d?\d)' _minute = '(?P<minute>\d?\d)' _second = '(?P<second>\d?\d(?:\.\d+)?)' _sign = '(?P<sign>[-+])' _week = 'W(?P<week>\d?\d)' _zone = Timezone.isozone _weekdate = _year + '-?(?:' + _week + '-?' + _day + '?)?' _date = _year + '-?' + '(?:' + _month + '-?' + _day + '?)?' _time = _hour + ':?' + _minute + ':?' + _second + '?(?:' + _zone + ')?' isodatetimeRE = re.compile(_date + '(?:[ T]' + _time + ')?$') isodateRE = re.compile(_date + '$') isotimeRE = re.compile(_time + '$') isodeltaRE = re.compile(_sign + '?' + _time + '$') isoweekRE = re.compile(_weekdate + '$') isoweektimeRE = re.compile(_weekdate + '(?:[ T]' + _time + ')?$') def WeekTime(year,isoweek=1,isoday=1,hour=0,minute=0,second=0.0): """ Week(year,isoweek=1,isoday=1,hour=0,minute=0,second=0.0) Returns a DateTime instance pointing to the given ISO week and day. isoday defaults to 1, which corresponds to Monday in the ISO numbering. The time part is set as given. """ d = DateTime.DateTime(year,1,1,hour,minute,second) if d.iso_week[0] == year: # 1.1. belongs to year (backup to Monday) return d + (-d.day_of_week + 7 * (isoweek-1) + isoday-1) else: # 1.1. belongs to year-1 (advance to next Monday) return d + (7-d.day_of_week + 7 * (isoweek-1) + isoday-1) # Alias Week = WeekTime # Aliases for the other constructors (they all happen to already use # ISO format) Date = DateTime.Date Time = DateTime.Time TimeDelta = DateTime.TimeDelta def ParseDateTime(isostring,parse_isodatetime=isodatetimeRE.match): """ ParseDateTime(isostring) Returns a DateTime instance reflecting the given ISO date. A time part is optional and must be delimited from the date by a space or 'T'. Time zone information is parsed, but not evaluated. """ s = isostring.strip() date = parse_isodatetime(s) if not date: raise ValueError,'wrong format, use YYYY-MM-DD HH:MM:SS' year,month,day,hour,minute,second,zone = date.groups() year = int(year) if month is None: month = 1 else: month = int(month) if day is None: day = 1 else: day = int(day) if hour is None: hour = 0 else: hour = int(hour) if minute is None: minute = 0 else: minute = int(minute) if second is None: second = 0.0 else: second = float(second) return DateTime.DateTime(year,month,day,hour,minute,second) def ParseDateTimeGMT(isostring,parse_isodatetime=isodatetimeRE.match): """ ParseDateTimeGMT(isostring) Returns a DateTime instance in UTC reflecting the given ISO date. A time part is optional and must be delimited from the date by a space or 'T'. Timezones are honored. """ s = isostring.strip() date = parse_isodatetime(s) if not date: raise ValueError,'wrong format, use YYYY-MM-DD HH:MM:SS' year,month,day,hour,minute,second,zone = date.groups() year = int(year) if month is None: month = 1 else: month = int(month) if day is None: day = 1 else: day = int(day) if hour is None: hour = 0 else: hour = int(hour) if minute is None: minute = 0 else: minute = int(minute) if second is None: second = 0.0 else: second = float(second) offset = Timezone.utc_offset(zone) return DateTime.DateTime(year,month,day,hour,minute,second) - offset # Alias ParseDateTimeUTC = ParseDateTimeGMT def ParseDate(isostring,parse_isodate=isodateRE.match): """ ParseDate(isostring) Returns a DateTime instance reflecting the given ISO date. A time part may not be included. """ s = isostring.strip() date = parse_isodate(s) if not date: raise ValueError,'wrong format, use YYYY-MM-DD' year,month,day = date.groups() year = int(year) if month is None: month = 1 else: month = int(month) if day is None: day = 1 else: day = int(day) return DateTime.DateTime(year,month,day) def ParseWeek(isostring,parse_isoweek=isoweekRE.match): """ ParseWeek(isostring) Returns a DateTime instance reflecting the given ISO date. A time part may not be included. """ s = isostring.strip() date = parse_isoweek(s) if not date: raise ValueError,'wrong format, use yyyy-Www-d, e.g. 1998-W01-1' year,week,day = date.groups() year = int(year) if week is None: week = 1 else: week = int(week) if day is None: day = 1 else: day = int(day) return Week(year,week,day) def ParseWeekTime(isostring,parse_isoweektime=isoweektimeRE.match): """ ParseWeekTime(isostring) Returns a DateTime instance reflecting the given ISO date. A time part is optional and must be delimited from the date by a space or 'T'. """ s = isostring.strip() date = parse_isoweektime(s) if not date: raise ValueError,'wrong format, use e.g. "1998-W01-1 12:00:30"' year,week,day,hour,minute,second,zone = date.groups() year = int(year) if week is None: week = 1 else: week = int(week) if day is None: day = 1 else: day = int(day) if hour is None: hour = 0 else: hour = int(hour) if minute is None: minute = 0 else: minute = int(minute) if second is None: second = 0.0 else: second = float(second) return WeekTime(year,week,day,hour,minute,second) def ParseTime(isostring,parse_isotime=isotimeRE.match): """ ParseTime(isostring) Returns a DateTimeDelta instance reflecting the given ISO time. Hours and minutes must be given, seconds are optional. Fractions of a second may also be used, e.g. 12:23:12.34. """ s = isostring.strip() time = parse_isotime(s) if not time: raise ValueError,'wrong format, use HH:MM:SS' hour,minute,second,zone = time.groups() hour = int(hour) minute = int(minute) if second is not None: second = float(second) else: second = 0.0 return DateTime.TimeDelta(hour,minute,second) def ParseTimeDelta(isostring,parse_isodelta=isodeltaRE.match): """ ParseTimeDelta(isostring) Returns a DateTimeDelta instance reflecting the given ISO time as delta. Hours and minutes must be given, seconds are optional. Fractions of a second may also be used, e.g. 12:23:12.34. In addition to the ISO standard a sign may be prepended to the time, e.g. -12:34. """ s = isostring.strip() time = parse_isodelta(s) if not time: raise ValueError,'wrong format, use [-]HH:MM:SS' sign,hour,minute,second,zone = time.groups() hour = int(hour) minute = int(minute) if second is not None: second = float(second) else: second = 0.0 if sign and sign == '-': return -DateTime.TimeDelta(hour,minute,second) else: return DateTime.TimeDelta(hour,minute,second) def ParseAny(isostring): """ ParseAny(isostring) Parses the given string and tries to convert it to a DateTime[Delta] instance. """ try: return ParseDateTime(isostring) except ValueError: pass try: return ParseWeekTime(isostring) except ValueError: pass try: return ParseTimeDelta(isostring) except ValueError: raise ValueError,'unsupported format: "%s"' % isostring def str(datetime,tz=None): """ str(datetime,tz=DateTime.tz_offset(datetime)) Returns the datetime instance as ISO date string. tz can be given as DateTimeDelta instance providing the time zone difference from datetime's zone to UTC. It defaults to DateTime.tz_offset(datetime) which assumes local time. """ if tz is None: tz = datetime.gmtoffset() return '%04i-%02i-%02i %02i:%02i:%02i%+03i%02i' % ( datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second, tz.hour,tz.minute) def strGMT(datetime): """ strGMT(datetime) Returns the datetime instance as ISO date string assuming it is given in GMT. """ return '%04i-%02i-%02i %02i:%02i:%02i+0000' % ( datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second) def strUTC(datetime): """ strUTC(datetime) Returns the datetime instance as ISO date string assuming it is given in UTC. """ return '%04i-%02i-%02i %02i:%02i:%02i+0000' % ( datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second) # Testing if __name__ == '__main__': e = DateTime.Date(1900,1,1) for i in range(100000): d = e + i year,week,day = d.iso_week c = WeekTime(year,week,day) if d != c: print ' Check %s (given; %i) != %s (parsed)' % (d,d.day_of_week,c) elif i % 1000 == 0: print d,'ok'
[ 1, 9995, 910, 3883, 8128, 263, 731, 310, 3386, 943, 322, 6745, 1475, 304, 3588, 13, 1678, 1546, 12315, 29961, 5268, 29962, 8871, 322, 17723, 22540, 310, 2635, 13, 1678, 322, 931, 29889, 13, 13, 1678, 3940, 29901, 5974, 29920, 2873, 526, 871, 21551, 491, 20969, 11384, 29954, 11490, 2141, 2178, 13, 1678, 916, 3386, 943, 4047, 2705, 11455, 278, 931, 10640, 2472, 29889, 13, 13, 1678, 14187, 1266, 313, 29883, 29897, 29871, 29896, 29929, 29929, 29947, 29899, 29906, 29900, 29900, 29900, 29892, 529, 5813, 25867, 10524, 517, 29901, 29966, 26862, 6227, 29958, 13, 1678, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29900, 29900, 29899, 29906, 29900, 29896, 29945, 29892, 321, 15462, 861, 29889, 510, 18540, 18156, 29936, 10524, 517, 29901, 29966, 26862, 6227, 29958, 13, 1678, 2823, 278, 5106, 363, 4340, 2472, 373, 3509, 1266, 29879, 29892, 13, 1678, 470, 6958, 278, 4148, 29889, 13, 13, 15945, 29908, 13, 5215, 12315, 29892, 2481, 8028, 13, 5215, 337, 13, 13, 29937, 16878, 3034, 29901, 17723, 29871, 29947, 29953, 29900, 29896, 313, 1333, 599, 29892, 541, 825, 591, 817, 515, 372, 29897, 13, 29918, 6360, 353, 525, 10780, 29925, 29966, 6360, 14247, 29881, 29973, 29905, 29881, 29905, 29881, 29905, 29881, 16029, 13, 29918, 10874, 353, 525, 10780, 29925, 29966, 10874, 14247, 29881, 29973, 29905, 29881, 16029, 13, 29918, 3250, 353, 525, 10780, 29925, 29966, 3250, 14247, 29881, 29973, 29905, 29881, 16029, 13, 29918, 18721, 353, 525, 10780, 29925, 29966, 18721, 14247, 29881, 29973, 29905, 29881, 16029, 13, 29918, 1195, 1082, 353, 525, 10780, 29925, 29966, 1195, 1082, 14247, 29881, 29973, 29905, 29881, 16029, 13, 29918, 7496, 353, 525, 10780, 29925, 29966, 7496, 14247, 29881, 29973, 29905, 29881, 10780, 3583, 7790, 29881, 29974, 6877, 16029, 13, 29918, 4530, 353, 525, 10780, 29925, 29966, 4530, 24566, 11793, 2314, 29915, 13, 29918, 18448, 353, 525, 29956, 10780, 29925, 29966, 18448, 14247, 29881, 29973, 29905, 29881, 16029, 13, 29918, 8028, 353, 5974, 8028, 29889, 275, 2112, 650, 13, 13, 29918, 18448, 1256, 353, 903, 6360, 718, 17411, 29973, 10780, 11283, 718, 903, 18448, 718, 17411, 17901, 718, 903, 3250, 718, 525, 29973, 6877, 29915, 13, 29918, 1256, 353, 903, 6360, 718, 17411, 17901, 718, 525, 10780, 11283, 718, 903, 10874, 718, 17411, 17901, 718, 903, 3250, 718, 525, 29973, 6877, 29915, 13, 29918, 2230, 353, 903, 18721, 718, 525, 29901, 17901, 718, 903, 1195, 1082, 718, 525, 29901, 17901, 718, 903, 7496, 718, 525, 29973, 10780, 11283, 718, 903, 8028, 718, 525, 6877, 29915, 13, 13, 275, 397, 271, 5410, 1525, 353, 337, 29889, 12198, 7373, 1256, 718, 525, 10780, 10834, 323, 29962, 29915, 718, 903, 2230, 718, 525, 6877, 29938, 1495, 13, 275, 397, 403, 1525, 353, 337, 29889, 12198, 7373, 1256, 718, 14180, 1495, 13, 275, 327, 603, 1525, 353, 337, 29889, 12198, 7373, 2230, 718, 14180, 1495, 13, 275, 397, 2554, 1525, 353, 337, 29889, 12198, 7373, 4530, 718, 525, 17901, 718, 903, 2230, 718, 14180, 1495, 13, 275, 4657, 1416, 1525, 353, 337, 29889, 12198, 7373, 18448, 1256, 718, 14180, 1495, 13, 275, 340, 3905, 1193, 603, 1525, 353, 337, 29889, 12198, 7373, 18448, 1256, 718, 525, 10780, 10834, 323, 29962, 29915, 718, 903, 2230, 718, 525, 6877, 29938, 1495, 13, 13, 1753, 15511, 2481, 29898, 6360, 29892, 275, 4657, 1416, 29922, 29896, 29892, 275, 397, 388, 29922, 29896, 29892, 18721, 29922, 29900, 29892, 1195, 1082, 29922, 29900, 29892, 7496, 29922, 29900, 29889, 29900, 1125, 13, 13, 1678, 9995, 15511, 29898, 6360, 29892, 275, 4657, 1416, 29922, 29896, 29892, 275, 397, 388, 29922, 29896, 29892, 18721, 29922, 29900, 29892, 1195, 1082, 29922, 29900, 29892, 7496, 29922, 29900, 29889, 29900, 29897, 13, 13, 4706, 16969, 263, 12315, 2777, 13330, 304, 278, 2183, 17723, 4723, 322, 13, 4706, 2462, 29889, 29871, 338, 397, 388, 21274, 304, 29871, 29896, 29892, 607, 16161, 304, 27822, 297, 278, 13, 4706, 17723, 1353, 292, 29889, 450, 931, 760, 338, 731, 408, 2183, 29889, 13, 13, 1678, 9995, 13, 1678, 270, 353, 12315, 29889, 11384, 29898, 6360, 29892, 29896, 29892, 29896, 29892, 18721, 29892, 1195, 1082, 29892, 7496, 29897, 13, 1678, 565, 270, 29889, 10718, 29918, 18448, 29961, 29900, 29962, 1275, 1629, 29901, 13, 4706, 396, 29871, 29896, 29889, 29896, 29889, 14393, 304, 1629, 313, 1627, 786, 304, 27822, 29897, 13, 4706, 736, 270, 718, 8521, 29881, 29889, 3250, 29918, 974, 29918, 18448, 718, 29871, 29955, 334, 313, 275, 4657, 1416, 29899, 29896, 29897, 718, 338, 397, 388, 29899, 29896, 29897, 13, 1678, 1683, 29901, 13, 4706, 396, 29871, 29896, 29889, 29896, 29889, 14393, 304, 1629, 29899, 29896, 313, 17263, 749, 304, 2446, 27822, 29897, 13, 4706, 736, 270, 718, 313, 29955, 29899, 29881, 29889, 3250, 29918, 974, 29918, 18448, 718, 29871, 29955, 334, 313, 275, 4657, 1416, 29899, 29896, 29897, 718, 338, 397, 388, 29899, 29896, 29897, 13, 13, 29937, 10785, 294, 13, 22606, 353, 15511, 2481, 13, 13, 29937, 10785, 2129, 363, 278, 916, 3386, 943, 313, 19562, 599, 3799, 304, 2307, 671, 13, 29937, 17723, 3402, 29897, 13, 2539, 353, 12315, 29889, 2539, 13, 2481, 353, 12315, 29889, 2481, 13, 2481, 5268, 353, 12315, 29889, 2481, 5268, 13, 13, 1753, 20969, 11384, 29898, 275, 520, 5393, 29892, 5510, 29918, 275, 397, 271, 5410, 29922, 275, 397, 271, 5410, 1525, 29889, 4352, 1125, 13, 13, 1678, 9995, 20969, 11384, 29898, 275, 520, 5393, 29897, 13, 13, 4706, 16969, 263, 12315, 2777, 9432, 292, 278, 2183, 17723, 2635, 29889, 319, 13, 4706, 931, 760, 338, 13136, 322, 1818, 367, 628, 326, 1573, 515, 278, 2635, 491, 263, 13, 4706, 2913, 470, 525, 29911, 4286, 13, 13, 4706, 5974, 10640, 2472, 338, 21213, 29892, 541, 451, 19030, 29889, 13, 13, 1678, 9995, 13, 1678, 269, 353, 338, 520, 5393, 29889, 17010, 580, 13, 1678, 2635, 353, 6088, 29918, 275, 397, 271, 5410, 29898, 29879, 29897, 13, 1678, 565, 451, 2635, 29901, 13, 4706, 12020, 7865, 2392, 5501, 15866, 549, 3402, 29892, 671, 612, 14995, 29979, 29899, 7428, 29899, 7858, 379, 29950, 29901, 7428, 29901, 1799, 29915, 13, 1678, 1629, 29892, 10874, 29892, 3250, 29892, 18721, 29892, 1195, 1082, 29892, 7496, 29892, 8028, 353, 2635, 29889, 13155, 580, 13, 1678, 1629, 353, 938, 29898, 6360, 29897, 13, 1678, 565, 4098, 338, 6213, 29901, 13, 4706, 4098, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 4098, 353, 938, 29898, 10874, 29897, 13, 1678, 565, 2462, 338, 6213, 29901, 13, 4706, 2462, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 2462, 353, 938, 29898, 3250, 29897, 13, 1678, 565, 7234, 338, 6213, 29901, 13, 4706, 7234, 353, 29871, 29900, 13, 1678, 1683, 29901, 13, 4706, 7234, 353, 938, 29898, 18721, 29897, 13, 1678, 565, 11015, 338, 6213, 29901, 13, 4706, 11015, 353, 29871, 29900, 13, 1678, 1683, 29901, 13, 4706, 11015, 353, 938, 29898, 1195, 1082, 29897, 13, 1678, 565, 1473, 338, 6213, 29901, 13, 4706, 1473, 353, 29871, 29900, 29889, 29900, 13, 1678, 1683, 29901, 13, 4706, 1473, 353, 5785, 29898, 7496, 29897, 13, 1678, 736, 12315, 29889, 11384, 29898, 6360, 29892, 10874, 29892, 3250, 29892, 18721, 29892, 1195, 1082, 29892, 7496, 29897, 13, 13, 1753, 20969, 11384, 29954, 11490, 29898, 275, 520, 5393, 29892, 5510, 29918, 275, 397, 271, 5410, 29922, 275, 397, 271, 5410, 1525, 29889, 4352, 1125, 13, 13, 1678, 9995, 20969, 11384, 29954, 11490, 29898, 275, 520, 5393, 29897, 13, 13, 4706, 16969, 263, 12315, 2777, 297, 17998, 9432, 292, 278, 2183, 17723, 13, 4706, 2635, 29889, 319, 931, 760, 338, 13136, 322, 1818, 367, 628, 326, 1573, 515, 278, 13, 4706, 2635, 491, 263, 2913, 470, 525, 29911, 4286, 5974, 29920, 2873, 526, 4207, 4395, 29889, 13, 13, 1678, 9995, 13, 1678, 269, 353, 338, 520, 5393, 29889, 17010, 580, 13, 1678, 2635, 353, 6088, 29918, 275, 397, 271, 5410, 29898, 29879, 29897, 13, 1678, 565, 451, 2635, 29901, 13, 4706, 12020, 7865, 2392, 5501, 15866, 549, 3402, 29892, 671, 612, 14995, 29979, 29899, 7428, 29899, 7858, 379, 29950, 29901, 7428, 29901, 1799, 29915, 13, 1678, 1629, 29892, 10874, 29892, 3250, 29892, 18721, 29892, 1195, 1082, 29892, 7496, 29892, 8028, 353, 2635, 29889, 13155, 580, 13, 1678, 1629, 353, 938, 29898, 6360, 29897, 13, 1678, 565, 4098, 338, 6213, 29901, 13, 4706, 4098, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 4098, 353, 938, 29898, 10874, 29897, 13, 1678, 565, 2462, 338, 6213, 29901, 13, 4706, 2462, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 2462, 353, 938, 29898, 3250, 29897, 13, 1678, 565, 7234, 338, 6213, 29901, 13, 4706, 7234, 353, 29871, 29900, 13, 1678, 1683, 29901, 13, 4706, 7234, 353, 938, 29898, 18721, 29897, 13, 1678, 565, 11015, 338, 6213, 29901, 13, 4706, 11015, 353, 29871, 29900, 13, 1678, 1683, 29901, 13, 4706, 11015, 353, 938, 29898, 1195, 1082, 29897, 13, 1678, 565, 1473, 338, 6213, 29901, 13, 4706, 1473, 353, 29871, 29900, 29889, 29900, 13, 1678, 1683, 29901, 13, 4706, 1473, 353, 5785, 29898, 7496, 29897, 13, 1678, 9210, 353, 5974, 8028, 29889, 329, 29883, 29918, 10289, 29898, 8028, 29897, 13, 1678, 736, 12315, 29889, 11384, 29898, 6360, 29892, 10874, 29892, 3250, 29892, 18721, 29892, 1195, 1082, 29892, 7496, 29897, 448, 9210, 13, 13, 29937, 10785, 294, 13, 12914, 11384, 26913, 353, 20969, 11384, 29954, 11490, 13, 13, 1753, 20969, 2539, 29898, 275, 520, 5393, 29892, 5510, 29918, 275, 397, 403, 29922, 275, 397, 403, 1525, 29889, 4352, 1125, 13, 13, 1678, 9995, 20969, 2539, 29898, 275, 520, 5393, 29897, 13, 13, 4706, 16969, 263, 12315, 2777, 9432, 292, 278, 2183, 17723, 2635, 29889, 319, 13, 4706, 931, 760, 1122, 451, 367, 5134, 29889, 13, 13, 1678, 9995, 13, 1678, 269, 353, 338, 520, 5393, 29889, 17010, 580, 13, 1678, 2635, 353, 6088, 29918, 275, 397, 403, 29898, 29879, 29897, 13, 1678, 565, 451, 2635, 29901, 13, 4706, 12020, 7865, 2392, 5501, 15866, 549, 3402, 29892, 671, 612, 14995, 29979, 29899, 7428, 29899, 7858, 29915, 13, 1678, 1629, 29892, 10874, 29892, 3250, 353, 2635, 29889, 13155, 580, 13, 1678, 1629, 353, 938, 29898, 6360, 29897, 13, 1678, 565, 4098, 338, 6213, 29901, 13, 4706, 4098, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 4098, 353, 938, 29898, 10874, 29897, 13, 1678, 565, 2462, 338, 6213, 29901, 13, 4706, 2462, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 2462, 353, 938, 29898, 3250, 29897, 13, 1678, 736, 12315, 29889, 11384, 29898, 6360, 29892, 10874, 29892, 3250, 29897, 13, 13, 1753, 20969, 22606, 29898, 275, 520, 5393, 29892, 5510, 29918, 275, 4657, 1416, 29922, 275, 4657, 1416, 1525, 29889, 4352, 1125, 13, 13, 1678, 9995, 20969, 22606, 29898, 275, 520, 5393, 29897, 13, 13, 4706, 16969, 263, 12315, 2777, 9432, 292, 278, 2183, 17723, 2635, 29889, 319, 13, 4706, 931, 760, 1122, 451, 367, 5134, 29889, 13, 13, 1678, 9995, 13, 1678, 269, 353, 338, 520, 5393, 29889, 17010, 580, 13, 1678, 2635, 353, 6088, 29918, 275, 4657, 1416, 29898, 29879, 29897, 13, 1678, 565, 451, 2635, 29901, 13, 4706, 12020, 7865, 2392, 5501, 15866, 549, 3402, 29892, 671, 343, 8071, 29891, 29899, 29956, 1615, 29899, 29881, 29892, 321, 29889, 29887, 29889, 29871, 29896, 29929, 29929, 29947, 29899, 29956, 29900, 29896, 29899, 29896, 29915, 13, 1678, 1629, 29892, 18448, 29892, 3250, 353, 2635, 29889, 13155, 580, 13, 1678, 1629, 353, 938, 29898, 6360, 29897, 13, 1678, 565, 4723, 338, 6213, 29901, 13, 4706, 4723, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 4723, 353, 938, 29898, 18448, 29897, 13, 1678, 565, 2462, 338, 6213, 29901, 13, 4706, 2462, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 2462, 353, 938, 29898, 3250, 29897, 13, 1678, 736, 15511, 29898, 6360, 29892, 18448, 29892, 3250, 29897, 13, 13, 1753, 20969, 22606, 2481, 29898, 275, 520, 5393, 29892, 5510, 29918, 275, 340, 3905, 1193, 603, 29922, 275, 340, 3905, 1193, 603, 1525, 29889, 4352, 1125, 13, 13, 1678, 9995, 20969, 22606, 2481, 29898, 275, 520, 5393, 29897, 13, 13, 4706, 16969, 263, 12315, 2777, 9432, 292, 278, 2183, 17723, 2635, 29889, 319, 13, 4706, 931, 760, 338, 13136, 322, 1818, 367, 628, 326, 1573, 515, 278, 2635, 491, 263, 13, 4706, 2913, 470, 525, 29911, 4286, 13, 13, 1678, 9995, 13, 1678, 269, 353, 338, 520, 5393, 29889, 17010, 580, 13, 1678, 2635, 353, 6088, 29918, 275, 340, 3905, 1193, 603, 29898, 29879, 29897, 13, 1678, 565, 451, 2635, 29901, 13, 4706, 12020, 7865, 2392, 5501, 15866, 549, 3402, 29892, 671, 321, 29889, 29887, 29889, 376, 29896, 29929, 29929, 29947, 29899, 29956, 29900, 29896, 29899, 29896, 29871, 29896, 29906, 29901, 29900, 29900, 29901, 29941, 29900, 29908, 29915, 13, 1678, 1629, 29892, 18448, 29892, 3250, 29892, 18721, 29892, 1195, 1082, 29892, 7496, 29892, 8028, 353, 2635, 29889, 13155, 580, 13, 1678, 1629, 353, 938, 29898, 6360, 29897, 13, 1678, 565, 4723, 338, 6213, 29901, 13, 4706, 4723, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 4723, 353, 938, 29898, 18448, 29897, 13, 1678, 565, 2462, 338, 6213, 29901, 13, 4706, 2462, 353, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 2462, 353, 938, 29898, 3250, 29897, 13, 1678, 565, 7234, 338, 6213, 29901, 13, 4706, 7234, 353, 29871, 29900, 13, 1678, 1683, 29901, 13, 4706, 7234, 353, 938, 29898, 18721, 29897, 13, 1678, 565, 11015, 338, 6213, 29901, 13, 4706, 11015, 353, 29871, 29900, 13, 1678, 1683, 29901, 13, 4706, 11015, 353, 938, 29898, 1195, 1082, 29897, 13, 1678, 565, 1473, 338, 6213, 29901, 13, 4706, 1473, 353, 29871, 29900, 29889, 29900, 13, 1678, 1683, 29901, 13, 4706, 1473, 353, 5785, 29898, 7496, 29897, 13, 1678, 736, 15511, 2481, 29898, 6360, 29892, 18448, 29892, 3250, 29892, 18721, 29892, 1195, 1082, 29892, 7496, 29897, 13, 13, 1753, 20969, 2481, 29898, 275, 520, 5393, 29892, 5510, 29918, 275, 327, 603, 29922, 275, 327, 603, 1525, 29889, 4352, 1125, 13, 13, 1678, 9995, 20969, 2481, 29898, 275, 520, 5393, 29897, 13, 13, 4706, 16969, 263, 12315, 5268, 2777, 9432, 292, 278, 2183, 17723, 931, 29889, 13, 4706, 379, 2470, 322, 6233, 1818, 367, 2183, 29892, 6923, 526, 13, 4706, 13136, 29889, 7347, 1953, 310, 263, 1473, 1122, 884, 367, 1304, 29892, 13, 4706, 321, 29889, 29887, 29889, 29871, 29896, 29906, 29901, 29906, 29941, 29901, 29896, 29906, 29889, 29941, 29946, 29889, 13, 13, 1678, 9995, 13, 1678, 269, 353, 338, 520, 5393, 29889, 17010, 580, 13, 1678, 931, 353, 6088, 29918, 275, 327, 603, 29898, 29879, 29897, 13, 1678, 565, 451, 931, 29901, 13, 4706, 12020, 7865, 2392, 5501, 15866, 549, 3402, 29892, 671, 379, 29950, 29901, 7428, 29901, 1799, 29915, 13, 1678, 7234, 29892, 1195, 1082, 29892, 7496, 29892, 8028, 353, 931, 29889, 13155, 580, 13, 1678, 7234, 353, 938, 29898, 18721, 29897, 13, 1678, 11015, 353, 938, 29898, 1195, 1082, 29897, 13, 1678, 565, 1473, 338, 451, 6213, 29901, 13, 4706, 1473, 353, 5785, 29898, 7496, 29897, 13, 1678, 1683, 29901, 13, 4706, 1473, 353, 29871, 29900, 29889, 29900, 13, 1678, 736, 12315, 29889, 2481, 5268, 29898, 18721, 29892, 1195, 1082, 29892, 7496, 29897, 13, 13, 1753, 20969, 2481, 5268, 29898, 275, 520, 5393, 29892, 5510, 29918, 275, 397, 2554, 29922, 275, 397, 2554, 1525, 29889, 4352, 1125, 13, 13, 1678, 9995, 20969, 2481, 5268, 29898, 275, 520, 5393, 29897, 13, 13, 4706, 16969, 263, 12315, 5268, 2777, 9432, 292, 278, 2183, 17723, 931, 13, 4706, 408, 19471, 29889, 379, 2470, 322, 6233, 1818, 367, 2183, 29892, 6923, 526, 13, 4706, 13136, 29889, 7347, 1953, 310, 263, 1473, 1122, 884, 367, 1304, 29892, 13, 4706, 321, 29889, 29887, 29889, 29871, 29896, 29906, 29901, 29906, 29941, 29901, 29896, 29906, 29889, 29941, 29946, 29889, 512, 6124, 304, 278, 17723, 3918, 263, 1804, 1122, 367, 13, 4706, 8273, 2760, 304, 278, 931, 29892, 321, 29889, 29887, 29889, 448, 29896, 29906, 29901, 29941, 29946, 29889, 13, 13, 1678, 9995, 13, 1678, 269, 353, 338, 520, 5393, 29889, 17010, 580, 13, 1678, 931, 353, 6088, 29918, 275, 397, 2554, 29898, 29879, 29897, 13, 1678, 565, 451, 931, 29901, 13, 4706, 12020, 7865, 2392, 5501, 15866, 549, 3402, 29892, 671, 21069, 29962, 27590, 29901, 7428, 29901, 1799, 29915, 13, 1678, 1804, 29892, 18721, 29892, 1195, 1082, 29892, 7496, 29892, 8028, 353, 931, 29889, 13155, 580, 13, 1678, 7234, 353, 938, 29898, 18721, 29897, 13, 1678, 11015, 353, 938, 29898, 1195, 1082, 29897, 13, 1678, 565, 1473, 338, 451, 6213, 29901, 13, 4706, 1473, 353, 5785, 29898, 7496, 29897, 13, 1678, 1683, 29901, 13, 4706, 1473, 353, 29871, 29900, 29889, 29900, 13, 1678, 565, 1804, 322, 1804, 1275, 17411, 2396, 13, 4706, 736, 448, 11384, 29889, 2481, 5268, 29898, 18721, 29892, 1195, 1082, 29892, 7496, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 12315, 29889, 2481, 5268, 29898, 18721, 29892, 1195, 1082, 29892, 7496, 29897, 13, 13, 1753, 20969, 10773, 29898, 275, 520, 5393, 1125, 13, 13, 1678, 9995, 20969, 10773, 29898, 275, 520, 5393, 29897, 13, 13, 4706, 1459, 29879, 267, 278, 2183, 1347, 322, 14335, 304, 3588, 372, 304, 263, 13, 4706, 12315, 29961, 5268, 29962, 2777, 29889, 13, 13, 1678, 9995, 13, 1678, 1018, 29901, 13, 4706, 736, 20969, 11384, 29898, 275, 520, 5393, 29897, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 1209, 13, 1678, 1018, 29901, 13, 4706, 736, 20969, 22606, 2481, 29898, 275, 520, 5393, 29897, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 1209, 13, 1678, 1018, 29901, 13, 4706, 736, 20969, 2481, 5268, 29898, 275, 520, 5393, 29897, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 12020, 7865, 2392, 5501, 348, 23765, 3402, 29901, 11860, 29879, 29908, 29915, 1273, 338, 520, 5393, 13, 13, 1753, 851, 29898, 12673, 29892, 17559, 29922, 8516, 1125, 13, 13, 1678, 9995, 851, 29898, 12673, 29892, 17559, 29922, 11384, 29889, 17559, 29918, 10289, 29898, 12673, 876, 13, 13, 4706, 16969, 278, 12865, 2777, 408, 17723, 2635, 1347, 29889, 260, 29920, 508, 367, 13, 4706, 2183, 408, 12315, 5268, 2777, 13138, 278, 931, 10640, 13, 4706, 4328, 515, 12865, 29915, 29879, 10640, 304, 17998, 29889, 739, 21274, 304, 13, 4706, 12315, 29889, 17559, 29918, 10289, 29898, 12673, 29897, 607, 15894, 1887, 931, 29889, 13, 13, 1678, 9995, 13, 1678, 565, 260, 29920, 338, 6213, 29901, 13, 4706, 260, 29920, 353, 12865, 29889, 29887, 29885, 517, 600, 842, 580, 13, 1678, 736, 14210, 29900, 29946, 29875, 19222, 29900, 29906, 29875, 19222, 29900, 29906, 29875, 1273, 29900, 29906, 29875, 16664, 29900, 29906, 29875, 16664, 29900, 29906, 29875, 29995, 29974, 29900, 29941, 29875, 29995, 29900, 29906, 29875, 29915, 1273, 313, 13, 4706, 12865, 29889, 6360, 29892, 12865, 29889, 10874, 29892, 12865, 29889, 3250, 29892, 29871, 13, 4706, 12865, 29889, 18721, 29892, 12865, 29889, 1195, 1082, 29892, 12865, 29889, 7496, 29892, 13, 4706, 260, 29920, 29889, 18721, 29892, 17559, 29889, 1195, 1082, 29897, 13, 13, 1753, 851, 29954, 11490, 29898, 12673, 1125, 13, 13, 1678, 9995, 851, 29954, 11490, 29898, 12673, 29897, 13, 13, 4706, 16969, 278, 12865, 2777, 408, 17723, 2635, 1347, 10241, 372, 338, 13, 4706, 2183, 297, 402, 11490, 29889, 13, 13, 1678, 9995, 13, 1678, 736, 14210, 29900, 29946, 29875, 19222, 29900, 29906, 29875, 19222, 29900, 29906, 29875, 1273, 29900, 29906, 29875, 16664, 29900, 29906, 29875, 16664, 29900, 29906, 29875, 29974, 29900, 29900, 29900, 29900, 29915, 1273, 313, 13, 4706, 12865, 29889, 6360, 29892, 12865, 29889, 10874, 29892, 12865, 29889, 3250, 29892, 29871, 13, 4706, 12865, 29889, 18721, 29892, 12865, 29889, 1195, 1082, 29892, 12865, 29889, 7496, 29897, 13, 13, 1753, 851, 26913, 29898, 12673, 1125, 13, 13, 1678, 9995, 851, 26913, 29898, 12673, 29897, 13, 13, 4706, 16969, 278, 12865, 2777, 408, 17723, 2635, 1347, 10241, 372, 338, 13, 4706, 2183, 297, 17998, 29889, 13, 13, 1678, 9995, 13, 1678, 736, 14210, 29900, 29946, 29875, 19222, 29900, 29906, 29875, 19222, 29900, 29906, 29875, 1273, 29900, 29906, 29875, 16664, 29900, 29906, 29875, 16664, 29900, 29906, 29875, 29974, 29900, 29900, 29900, 29900, 29915, 1273, 313, 13, 4706, 12865, 29889, 6360, 29892, 12865, 29889, 10874, 29892, 12865, 29889, 3250, 29892, 29871, 13, 4706, 12865, 29889, 18721, 29892, 12865, 29889, 1195, 1082, 29892, 12865, 29889, 7496, 29897, 13, 13, 29937, 4321, 292, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 321, 353, 12315, 29889, 2539, 29898, 29896, 29929, 29900, 29900, 29892, 29896, 29892, 29896, 29897, 13, 1678, 363, 474, 297, 3464, 29898, 29896, 29900, 29900, 29900, 29900, 29900, 1125, 13, 4706, 270, 353, 321, 718, 474, 13, 4706, 1629, 29892, 18448, 29892, 3250, 353, 270, 29889, 10718, 29918, 18448, 13, 4706, 274, 353, 15511, 2481, 29898, 6360, 29892, 18448, 29892, 3250, 29897, 13, 4706, 565, 270, 2804, 274, 29901, 13, 9651, 1596, 525, 5399, 1273, 29879, 313, 29887, 5428, 29936, 1273, 29875, 29897, 2804, 1273, 29879, 313, 862, 8485, 16029, 1273, 313, 29881, 29892, 29881, 29889, 3250, 29918, 974, 29918, 18448, 29892, 29883, 29897, 13, 4706, 25342, 474, 1273, 29871, 29896, 29900, 29900, 29900, 1275, 29871, 29900, 29901, 13, 9651, 1596, 270, 5501, 554, 29915, 13, 2 ]
oks/elements/operation/eitem.py
alnvdl/oks
2
107972
<gh_stars>1-10 #!/usr/bin/env python #-*- coding:utf-8 -*- from core.output import * from oks.elements.operation import OperationElement import oks class ExchangeItem(OperationElement): TYPE = oks.EXCHANGE_ITEM def __init__(self, **kwargs): self.name = "" self.quantity = 1 self.notes = "" self.row = ("name", "quantity", "notes") OperationElement.__init__(self, **kwargs) def make_output(self): eitem = Section("eitem_{0}".format(self.row_id), self.name) quantity = FloatData("quantity", "Quantidade", self.quantity, strip_zeros=True) eitem.add_child(quantity) notes = StringData("notes", "Observações", self.notes) eitem.add_child(notes) return eitem
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 29899, 29930, 29899, 14137, 29901, 9420, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 7136, 29889, 4905, 1053, 334, 13, 3166, 288, 2039, 29889, 17664, 29889, 16453, 1053, 20462, 2642, 13, 5215, 288, 2039, 13, 13, 1990, 24004, 2001, 29898, 10925, 2642, 1125, 13, 1678, 323, 6959, 353, 288, 2039, 29889, 5746, 3210, 24336, 29918, 9094, 29924, 308, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3579, 19290, 1125, 13, 4706, 1583, 29889, 978, 353, 5124, 13, 4706, 1583, 29889, 22640, 353, 29871, 29896, 13, 4706, 1583, 29889, 16953, 353, 5124, 13, 4706, 1583, 29889, 798, 353, 4852, 978, 613, 376, 22640, 613, 376, 16953, 1159, 13, 13, 4706, 20462, 2642, 17255, 2344, 12035, 1311, 29892, 3579, 19290, 29897, 13, 268, 13, 1678, 822, 1207, 29918, 4905, 29898, 1311, 1125, 13, 4706, 321, 667, 353, 9779, 703, 29872, 667, 648, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 798, 29918, 333, 511, 1583, 29889, 978, 29897, 13, 308, 13, 4706, 14728, 353, 27842, 1469, 703, 22640, 613, 376, 22930, 5558, 613, 1583, 29889, 22640, 29892, 13, 462, 632, 17820, 29918, 3298, 359, 29922, 5574, 29897, 13, 4706, 321, 667, 29889, 1202, 29918, 5145, 29898, 22640, 29897, 13, 308, 13, 4706, 11486, 353, 1714, 1469, 703, 16953, 613, 376, 6039, 643, 1564, 5616, 613, 1583, 29889, 16953, 29897, 13, 4706, 321, 667, 29889, 1202, 29918, 5145, 29898, 16953, 29897, 29871, 13, 13, 4706, 736, 321, 667, 13, 2 ]
test/resources/app.py
earwig/bitshift
28
144896
""" Module to contain all the project's Flask server plumbing. """ from flask import Flask from flask import render_template, session from bitshift import assets # from bitshift.database import Database # from bitshift.query import parse_query app = Flask(__name__) app.config.from_object("bitshift.config") app_env = app.jinja_env app_env.line_statement_prefix = "=" app_env.globals.update(assets=assets) # database = Database() @app.route("/") def index(): return render_template("index.html") @app.route("/search/<query>") def search(query): # tree = parse_query(query) # database.search(tree) pass @app.route("/about") def about(): return render_template("about.html") @app.route("/developers") def developers(): return render_template("developers.html") if __name__ == "__main__": app.run(debug=True)
[ 1, 9995, 13, 7355, 304, 1712, 599, 278, 2060, 29915, 29879, 2379, 1278, 1923, 715, 3774, 292, 29889, 13, 15945, 29908, 13, 13, 3166, 29784, 1053, 2379, 1278, 13, 3166, 29784, 1053, 4050, 29918, 6886, 29892, 4867, 13, 13, 3166, 2586, 10889, 1053, 21608, 13, 29937, 515, 2586, 10889, 29889, 9803, 1053, 5470, 13, 29937, 515, 2586, 10889, 29889, 1972, 1053, 6088, 29918, 1972, 13, 13, 932, 353, 2379, 1278, 22168, 978, 1649, 29897, 13, 932, 29889, 2917, 29889, 3166, 29918, 3318, 703, 2966, 10889, 29889, 2917, 1159, 13, 13, 932, 29918, 6272, 353, 623, 29889, 28789, 1764, 29918, 6272, 13, 932, 29918, 6272, 29889, 1220, 29918, 20788, 29918, 13506, 353, 376, 543, 13, 932, 29918, 6272, 29889, 23705, 1338, 29889, 5504, 29898, 16596, 29922, 16596, 29897, 13, 13, 29937, 2566, 353, 5470, 580, 13, 13, 29992, 932, 29889, 13134, 11974, 1159, 13, 1753, 2380, 7295, 13, 1678, 736, 4050, 29918, 6886, 703, 2248, 29889, 1420, 1159, 13, 13, 29992, 932, 29889, 13134, 11974, 4478, 29914, 29966, 1972, 29958, 1159, 13, 1753, 2740, 29898, 1972, 1125, 13, 1678, 396, 5447, 353, 6088, 29918, 1972, 29898, 1972, 29897, 13, 1678, 396, 2566, 29889, 4478, 29898, 8336, 29897, 13, 1678, 1209, 13, 13, 29992, 932, 29889, 13134, 11974, 12717, 1159, 13, 1753, 1048, 7295, 13, 1678, 736, 4050, 29918, 6886, 703, 12717, 29889, 1420, 1159, 13, 13, 29992, 932, 29889, 13134, 11974, 17426, 1159, 13, 1753, 18777, 7295, 13, 1678, 736, 4050, 29918, 6886, 703, 17426, 29889, 1420, 1159, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 623, 29889, 3389, 29898, 8382, 29922, 5574, 29897, 13, 2 ]
peptidemapper/src/pepmapperapp/migrations/0002_mapperautocomplete.py
uvic-proteincentre/MRMAssayDB
0
26357
<filename>peptidemapper/src/pepmapperapp/migrations/0002_mapperautocomplete.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('pepmapperapp', '0001_initial'), ] operations = [ migrations.CreateModel( name='MapperAutoComplete', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('uniprotacc', models.CharField(max_length=20)), ('prot_name', models.CharField(max_length=300)), ('gene', models.CharField(max_length=100)), ('organism', models.CharField(max_length=100)), ('pepseq', models.CharField(max_length=20)), ('path_name', models.CharField(max_length=1000)), ('dis_mut', models.CharField(max_length=1000)), ('go_id', models.CharField(max_length=100)), ('go_name', models.CharField(max_length=1000)), ('go_term', models.CharField(max_length=100)), ], ), ]
[ 1, 529, 9507, 29958, 412, 415, 680, 655, 2496, 29914, 4351, 29914, 412, 29886, 655, 2496, 932, 29914, 26983, 800, 29914, 29900, 29900, 29900, 29906, 29918, 655, 2496, 6921, 8835, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 3166, 9557, 29889, 2585, 1053, 4733, 29892, 9725, 800, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 412, 29886, 655, 2496, 932, 742, 525, 29900, 29900, 29900, 29896, 29918, 11228, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 19968, 12300, 17813, 742, 13, 9651, 4235, 11759, 13, 18884, 6702, 333, 742, 4733, 29889, 12300, 3073, 29898, 369, 15828, 29918, 978, 2433, 1367, 742, 28755, 29922, 8824, 29892, 4469, 29918, 11600, 29922, 5574, 29892, 7601, 29918, 1989, 29922, 5574, 8243, 13, 18884, 6702, 348, 666, 5450, 5753, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29900, 8243, 13, 18884, 6702, 771, 29873, 29918, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29941, 29900, 29900, 8243, 13, 18884, 6702, 29887, 1600, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 8243, 13, 18884, 6702, 6388, 1608, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 8243, 13, 18884, 6702, 412, 29886, 11762, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29900, 8243, 13, 18884, 6702, 2084, 29918, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29900, 8243, 13, 18884, 6702, 2218, 29918, 6149, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29900, 8243, 13, 18884, 6702, 1484, 29918, 333, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 8243, 13, 18884, 6702, 1484, 29918, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29900, 8243, 13, 18884, 6702, 1484, 29918, 8489, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 8243, 13, 9651, 21251, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
assam/scheduling/scheduling_module.py
ykawashima/assam
3
86826
<reponame>ykawashima/assam<filename>assam/scheduling/scheduling_module.py<gh_stars>1-10 #!/usr/bin/env python """ MIT License Copyright (c) 2020-2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import operator import numpy as np from tqdm import tqdm class SchedulingModule(): def __init__(self, targets): """ Initialisation function for the scheduling module. Parameters ---------- targets : list List of targets. Returns ------- None. """ # Store targets self.targets = targets # Declare empty variables self.contacts = None self.scheduled_contacts = None def combine_contacts(self): """ Function to combine contacts from all the targets into one list. Returns ------- contacts : list List of all contacts. """ # Extract contacts contacts = [contact for target in self.targets for contact in target.contacts] # Store contacts self.contacts = contacts # Return contacts return contacts def simple_dynamic_schedule(self): """ Function to schedule contacts using the simple dynamic linear programming method. Returns ------- scheduled_contacts : list List of scheduled contacts. benefit_optimal : numpy.float64 Optimal benefit corresponding to the scheduled contacts. """ # Sort list of contacts by end time contacts = self.contacts contact_key = operator.attrgetter("end") contacts.sort(key=contact_key) # Shift the contacts by using a dummy element as the original # algorithm assumes indexing from one contacts_shift = [None] + contacts # Calculate predecessors pred = np.zeros(len(contacts_shift), dtype="uintc") # Loop through each contact for i, contact in enumerate(tqdm(contacts_shift, "Calculating Predecessors")): # Skip dummy element if i == 0: continue # Loop through preceeding contacts, working backwards from the # current contact for j in range(i-1, 0, -1): # Extract second contact second_contact = contacts_shift[j] # Update predecessor if it does not intersect with the contact if contact.start >= second_contact.end: pred[i] = j break # Calculate schedule benefit = np.zeros(len(contacts_shift)) optimal_contacts = [[]] + [None] * (len(contacts)) # Iterate through subproblems for i, contact in enumerate(tqdm(contacts_shift, "Scheduling")): # Skip dummy element if i == 0: continue # Calculate previous benefit benefit_previous = benefit[i-1] # Calculate new benefit benefit_new = benefit[pred[i]] + contact.benefit # Update benefit benefit[i] = max(benefit_previous, benefit_new) # Update included contacts optimal_contacts_previous = optimal_contacts[i-1] optimal_contacts_new = optimal_contacts[pred[i]] + [i] if benefit_new > benefit_previous: optimal_contacts[i] = optimal_contacts_new else: optimal_contacts[i] = optimal_contacts_previous # Extract optimal benefit and contacts benefit_optimal = benefit[-1] scheduled_contacts = [contacts_shift[i] for i in optimal_contacts[-1]] # Store scheduled_contacts self.scheduled_contacts = scheduled_contacts # Return scheduled contacts and optimal benefit return scheduled_contacts, benefit_optimal
[ 1, 529, 276, 1112, 420, 29958, 29891, 1335, 29893, 1161, 2946, 29914, 465, 314, 29966, 9507, 29958, 465, 314, 29914, 816, 287, 19478, 29914, 816, 287, 19478, 29918, 5453, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 15945, 29908, 13, 26349, 19245, 13, 13, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29900, 29899, 29906, 29900, 29906, 29896, 529, 5813, 29958, 13, 13, 27293, 338, 1244, 1609, 16896, 29892, 3889, 310, 8323, 29892, 304, 738, 2022, 4017, 292, 263, 3509, 13, 974, 445, 7047, 322, 6942, 5106, 2066, 313, 1552, 376, 6295, 14093, 4968, 304, 5376, 13, 262, 278, 18540, 1728, 24345, 29892, 3704, 1728, 29485, 278, 10462, 13, 517, 671, 29892, 3509, 29892, 6623, 29892, 10366, 29892, 9805, 29892, 1320, 2666, 29892, 269, 803, 1947, 29892, 322, 29914, 272, 19417, 13, 9708, 583, 310, 278, 18540, 29892, 322, 304, 14257, 12407, 304, 6029, 278, 18540, 338, 13, 29888, 595, 3276, 304, 437, 577, 29892, 4967, 304, 278, 1494, 5855, 29901, 13, 13, 1576, 2038, 3509, 1266, 8369, 322, 445, 10751, 8369, 4091, 367, 5134, 297, 599, 13, 9708, 583, 470, 23228, 2011, 1080, 310, 278, 18540, 29889, 13, 13, 28350, 7791, 7818, 12982, 1525, 8519, 13756, 13044, 3352, 376, 3289, 8519, 613, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29979, 8079, 13764, 29979, 476, 22255, 29892, 8528, 15094, 1799, 6323, 13, 29902, 3580, 5265, 3352, 29892, 2672, 6154, 15789, 4214, 350, 2692, 6058, 27848, 3352, 7495, 6093, 399, 1718, 29934, 13566, 29059, 8079, 341, 1001, 3210, 13566, 2882, 6227, 11937, 29892, 13, 29943, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 5300, 405, 1164, 1177, 15860, 1177, 1692, 13780, 29889, 2672, 11698, 382, 29963, 3919, 24972, 9818, 6093, 13, 20656, 29950, 24125, 6323, 315, 4590, 29979, 22789, 3912, 379, 5607, 8032, 29903, 20700, 17705, 6181, 15842, 13764, 29979, 315, 4375, 7833, 29892, 21330, 1529, 1692, 29903, 6323, 438, 29911, 4448, 13, 5265, 2882, 6227, 11937, 29892, 12317, 2544, 4448, 2672, 13764, 319, 9838, 8079, 8707, 29911, 4717, 1783, 29892, 323, 8476, 6323, 438, 29911, 4448, 22119, 1660, 29892, 9033, 3235, 4214, 3895, 29892, 13, 12015, 8079, 6323, 2672, 8707, 8186, 9838, 22659, 6093, 7791, 7818, 12982, 1525, 6323, 6093, 501, 1660, 6323, 438, 29911, 4448, 5012, 1964, 4214, 29903, 2672, 6093, 13, 6156, 7818, 12982, 1525, 29889, 13, 15945, 29908, 13, 13, 5215, 5455, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 13, 13, 13, 1990, 1102, 287, 19478, 7355, 7295, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 22525, 1125, 13, 4706, 9995, 13, 4706, 17250, 4371, 740, 363, 278, 28598, 19478, 3883, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 22525, 584, 1051, 13, 9651, 2391, 310, 22525, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6213, 29889, 13, 13, 4706, 9995, 13, 13, 4706, 396, 14491, 22525, 13, 4706, 1583, 29889, 5182, 29879, 353, 22525, 13, 13, 4706, 396, 3826, 8663, 4069, 3651, 13, 4706, 1583, 29889, 12346, 29879, 353, 6213, 13, 4706, 1583, 29889, 816, 14989, 29918, 12346, 29879, 353, 6213, 13, 13, 1678, 822, 14405, 29918, 12346, 29879, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 6680, 304, 14405, 25957, 515, 599, 278, 22525, 964, 697, 1051, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 25957, 584, 1051, 13, 9651, 2391, 310, 599, 25957, 29889, 13, 13, 4706, 9995, 13, 13, 4706, 396, 7338, 1461, 25957, 13, 4706, 25957, 353, 518, 12346, 13, 462, 1678, 363, 3646, 297, 1583, 29889, 5182, 29879, 13, 462, 1678, 363, 6958, 297, 3646, 29889, 12346, 29879, 29962, 13, 13, 4706, 396, 14491, 25957, 13, 4706, 1583, 29889, 12346, 29879, 353, 25957, 13, 13, 4706, 396, 7106, 25957, 13, 4706, 736, 25957, 13, 13, 1678, 822, 2560, 29918, 16626, 29918, 816, 11272, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 6680, 304, 20410, 25957, 773, 278, 2560, 7343, 5608, 13, 4706, 8720, 1158, 29889, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 21467, 29918, 12346, 29879, 584, 1051, 13, 9651, 2391, 310, 21467, 25957, 29889, 13, 4706, 14169, 29918, 3670, 3039, 584, 12655, 29889, 7411, 29953, 29946, 13, 9651, 20693, 3039, 14169, 6590, 304, 278, 21467, 25957, 29889, 13, 13, 4706, 9995, 13, 13, 4706, 396, 20025, 1051, 310, 25957, 491, 1095, 931, 13, 4706, 25957, 353, 1583, 29889, 12346, 29879, 13, 4706, 6958, 29918, 1989, 353, 5455, 29889, 5552, 657, 357, 703, 355, 1159, 13, 4706, 25957, 29889, 6605, 29898, 1989, 29922, 12346, 29918, 1989, 29897, 13, 13, 4706, 396, 1383, 2027, 278, 25957, 491, 773, 263, 20254, 1543, 408, 278, 2441, 13, 4706, 396, 5687, 15894, 26190, 515, 697, 13, 4706, 25957, 29918, 10889, 353, 518, 8516, 29962, 718, 25957, 13, 13, 4706, 396, 20535, 403, 27978, 985, 943, 13, 4706, 4450, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 12346, 29879, 29918, 10889, 511, 26688, 543, 13470, 29883, 1159, 13, 4706, 396, 21493, 1549, 1269, 6958, 13, 4706, 363, 474, 29892, 6958, 297, 26985, 29898, 29873, 29939, 18933, 29898, 12346, 29879, 29918, 10889, 29892, 376, 27065, 1218, 4721, 311, 985, 943, 5783, 29901, 13, 9651, 396, 4971, 666, 20254, 1543, 13, 9651, 565, 474, 1275, 29871, 29900, 29901, 13, 18884, 6773, 13, 13, 9651, 396, 21493, 1549, 758, 3947, 292, 25957, 29892, 1985, 28953, 515, 278, 13, 9651, 396, 1857, 6958, 13, 9651, 363, 432, 297, 3464, 29898, 29875, 29899, 29896, 29892, 29871, 29900, 29892, 448, 29896, 1125, 13, 18884, 396, 7338, 1461, 1473, 6958, 13, 18884, 1473, 29918, 12346, 353, 25957, 29918, 10889, 29961, 29926, 29962, 13, 13, 18884, 396, 10318, 27978, 985, 272, 565, 372, 947, 451, 25869, 411, 278, 6958, 13, 18884, 565, 6958, 29889, 2962, 6736, 1473, 29918, 12346, 29889, 355, 29901, 13, 462, 1678, 4450, 29961, 29875, 29962, 353, 432, 13, 462, 1678, 2867, 13, 13, 4706, 396, 20535, 403, 20410, 13, 4706, 14169, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 12346, 29879, 29918, 10889, 876, 13, 4706, 14413, 29918, 12346, 29879, 353, 518, 2636, 29962, 718, 518, 8516, 29962, 334, 313, 2435, 29898, 12346, 29879, 876, 13, 13, 4706, 396, 20504, 403, 1549, 1014, 17199, 29879, 13, 4706, 363, 474, 29892, 6958, 297, 26985, 29898, 29873, 29939, 18933, 29898, 12346, 29879, 29918, 10889, 29892, 376, 4504, 287, 19478, 5783, 29901, 13, 9651, 396, 4971, 666, 20254, 1543, 13, 9651, 565, 474, 1275, 29871, 29900, 29901, 13, 18884, 6773, 13, 13, 9651, 396, 20535, 403, 3517, 14169, 13, 9651, 14169, 29918, 24957, 353, 14169, 29961, 29875, 29899, 29896, 29962, 13, 13, 9651, 396, 20535, 403, 716, 14169, 13, 9651, 14169, 29918, 1482, 353, 14169, 29961, 11965, 29961, 29875, 5262, 718, 6958, 29889, 1785, 1389, 277, 13, 13, 9651, 396, 10318, 14169, 13, 9651, 14169, 29961, 29875, 29962, 353, 4236, 29898, 1785, 1389, 277, 29918, 24957, 29892, 14169, 29918, 1482, 29897, 13, 13, 9651, 396, 10318, 5134, 25957, 13, 9651, 14413, 29918, 12346, 29879, 29918, 24957, 353, 14413, 29918, 12346, 29879, 29961, 29875, 29899, 29896, 29962, 13, 9651, 14413, 29918, 12346, 29879, 29918, 1482, 353, 14413, 29918, 12346, 29879, 29961, 11965, 29961, 29875, 5262, 718, 518, 29875, 29962, 13, 9651, 565, 14169, 29918, 1482, 1405, 14169, 29918, 24957, 29901, 13, 18884, 14413, 29918, 12346, 29879, 29961, 29875, 29962, 353, 14413, 29918, 12346, 29879, 29918, 1482, 13, 9651, 1683, 29901, 13, 18884, 14413, 29918, 12346, 29879, 29961, 29875, 29962, 353, 14413, 29918, 12346, 29879, 29918, 24957, 13, 13, 4706, 396, 7338, 1461, 14413, 14169, 322, 25957, 13, 4706, 14169, 29918, 3670, 3039, 353, 14169, 14352, 29896, 29962, 13, 4706, 21467, 29918, 12346, 29879, 353, 518, 12346, 29879, 29918, 10889, 29961, 29875, 29962, 363, 474, 297, 14413, 29918, 12346, 29879, 14352, 29896, 5262, 13, 13, 4706, 396, 14491, 21467, 29918, 12346, 29879, 13, 4706, 1583, 29889, 816, 14989, 29918, 12346, 29879, 353, 21467, 29918, 12346, 29879, 13, 308, 13, 4706, 396, 7106, 21467, 25957, 322, 14413, 14169, 13, 4706, 736, 21467, 29918, 12346, 29879, 29892, 14169, 29918, 3670, 3039, 13, 2 ]
count_doubles.py
tiagocoutinho/tc-rusty
0
114545
<filename>count_doubles.py #!/usr/bin/env python # -*- coding: utf-8 -*- import os import random import string import itertools import functools import six import numpy from tools import GCContext, run from tools import c_debug, c_release from tools import rust_debug, rust_release # ---- RUST ------------------------------------- count_doubles_rust_debug = rust_debug.count_doubles count_doubles_rust = rust_release.count_doubles # ---- C ---------------------------------------- count_doubles_c_debug = c_debug.count_doubles count_doubles_c = c_release.count_doubles # ---- PYTHON ----------------------------------- def count_doubles_python(val, n): total = 0 for c1, c2 in itertools.izip(val, val[1:]): if c1 == c2: total += 1 return total # ---- PYTHON NUMBA ----------------------------- import numba def numba_numpy(f): @functools.wraps(f) def wrapper(val, n): val = numpy.frombuffer(val, dtype=numpy.uint8) return f(val, n) return wrapper @numba_numpy @numba.jit def count_doubles_numba(val, n): total = 0 for c1, c2 in zip(val, val[1:]): if c1 == c2: total += 1 return total # ---- PYTHON PYTHRAN --------------------------- from pythrantcrusty import count_doubles_pythran, count_doubles_pythran_zip # ----------------------------------------------- def get_data(): this_dir = os.path.dirname(os.path.abspath(__file__)) data_file = os.path.join(this_dir, 'count_doubles.data') if os.path.isfile(data_file): with open(data_file, 'rb') as f: data = f.read() else: six.print_('Generating data...', end='', flush=True) N = 10000000 data = ''.join(random.choice(string.ascii_letters) for i in range(N)) with open(data_file, 'wb') as f: f.write(data) six.print_('[DONE]') return data data = get_data() ARGS = [data, len(data)] def main(): TESTS = ( 'count_doubles_rust', 'count_doubles_c', 'count_doubles_numba', 'count_doubles_pythran', 'count_doubles_python', ) expected = count_doubles_c(*ARGS) run('count_doubles', TESTS, expected=expected, repeat=10) if __name__ == "__main__": main()
[ 1, 529, 9507, 29958, 2798, 29918, 29881, 283, 7586, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 2897, 13, 5215, 4036, 13, 5215, 1347, 13, 5215, 4256, 8504, 13, 5215, 2090, 312, 8789, 13, 13, 5215, 4832, 13, 5215, 12655, 13, 13, 3166, 8492, 1053, 19983, 2677, 29892, 1065, 13, 3166, 8492, 1053, 274, 29918, 8382, 29892, 274, 29918, 14096, 13, 3166, 8492, 1053, 21580, 29918, 8382, 29892, 21580, 29918, 14096, 13, 13, 13, 29937, 23250, 390, 17321, 448, 2683, 2683, 807, 13, 13, 2798, 29918, 29881, 283, 7586, 29918, 23575, 29918, 8382, 353, 21580, 29918, 8382, 29889, 2798, 29918, 29881, 283, 7586, 13, 2798, 29918, 29881, 283, 7586, 29918, 23575, 353, 21580, 29918, 14096, 29889, 2798, 29918, 29881, 283, 7586, 13, 13, 29937, 23250, 315, 448, 2683, 2683, 26589, 13, 13, 2798, 29918, 29881, 283, 7586, 29918, 29883, 29918, 8382, 353, 274, 29918, 8382, 29889, 2798, 29918, 29881, 283, 7586, 13, 2798, 29918, 29881, 283, 7586, 29918, 29883, 353, 274, 29918, 14096, 29889, 2798, 29918, 29881, 283, 7586, 13, 13, 29937, 23250, 349, 29979, 4690, 1164, 448, 2683, 2683, 489, 13, 13, 1753, 2302, 29918, 29881, 283, 7586, 29918, 4691, 29898, 791, 29892, 302, 1125, 13, 1678, 3001, 353, 29871, 29900, 13, 1678, 363, 274, 29896, 29892, 274, 29906, 297, 4256, 8504, 29889, 466, 666, 29898, 791, 29892, 659, 29961, 29896, 17531, 1125, 13, 4706, 565, 274, 29896, 1275, 274, 29906, 29901, 13, 9651, 3001, 4619, 29871, 29896, 13, 1678, 736, 3001, 13, 13, 29937, 23250, 349, 29979, 4690, 1164, 28019, 5688, 448, 2683, 9072, 13, 13, 5215, 954, 2291, 13, 13, 1753, 954, 2291, 29918, 23749, 29898, 29888, 1125, 13, 1678, 732, 7692, 312, 8789, 29889, 29893, 336, 567, 29898, 29888, 29897, 13, 1678, 822, 14476, 29898, 791, 29892, 302, 1125, 13, 4706, 659, 353, 12655, 29889, 3166, 9040, 29898, 791, 29892, 26688, 29922, 23749, 29889, 13470, 29947, 29897, 13, 4706, 736, 285, 29898, 791, 29892, 302, 29897, 13, 1678, 736, 14476, 13, 13, 29992, 1949, 2291, 29918, 23749, 13, 29992, 1949, 2291, 29889, 29926, 277, 13, 1753, 2302, 29918, 29881, 283, 7586, 29918, 1949, 2291, 29898, 791, 29892, 302, 1125, 13, 1678, 3001, 353, 29871, 29900, 13, 1678, 363, 274, 29896, 29892, 274, 29906, 297, 14319, 29898, 791, 29892, 659, 29961, 29896, 17531, 1125, 13, 4706, 565, 274, 29896, 1275, 274, 29906, 29901, 13, 9651, 3001, 4619, 29871, 29896, 13, 1678, 736, 3001, 13, 13, 29937, 23250, 349, 29979, 4690, 1164, 349, 29979, 4690, 29934, 2190, 448, 2683, 28400, 13, 13, 3166, 282, 1541, 21867, 7283, 504, 29891, 1053, 2302, 29918, 29881, 283, 7586, 29918, 29886, 1541, 661, 29892, 2302, 29918, 29881, 283, 7586, 29918, 29886, 1541, 661, 29918, 7554, 13, 13, 13, 29937, 448, 2683, 2683, 9072, 489, 13, 13, 1753, 679, 29918, 1272, 7295, 13, 1678, 445, 29918, 3972, 353, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 22168, 1445, 1649, 876, 13, 1678, 848, 29918, 1445, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1366, 29918, 3972, 29892, 525, 2798, 29918, 29881, 283, 7586, 29889, 1272, 1495, 13, 1678, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 1272, 29918, 1445, 1125, 13, 4706, 411, 1722, 29898, 1272, 29918, 1445, 29892, 525, 6050, 1495, 408, 285, 29901, 13, 9651, 848, 353, 285, 29889, 949, 580, 13, 1678, 1683, 29901, 13, 4706, 4832, 29889, 2158, 29918, 877, 5631, 1218, 848, 856, 742, 1095, 2433, 742, 28371, 29922, 5574, 29897, 13, 4706, 405, 353, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 13, 4706, 848, 353, 525, 4286, 7122, 29898, 8172, 29889, 16957, 29898, 1807, 29889, 294, 18869, 29918, 1026, 2153, 29897, 13, 462, 539, 363, 474, 297, 3464, 29898, 29940, 876, 13, 4706, 411, 1722, 29898, 1272, 29918, 1445, 29892, 525, 29893, 29890, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 1272, 29897, 13, 4706, 4832, 29889, 2158, 29918, 877, 29961, 29928, 12413, 29962, 1495, 13, 1678, 736, 848, 13, 13, 1272, 353, 679, 29918, 1272, 580, 13, 1718, 10749, 353, 518, 1272, 29892, 7431, 29898, 1272, 4638, 13, 13, 1753, 1667, 7295, 13, 1678, 17067, 1254, 29903, 353, 313, 13, 4706, 525, 2798, 29918, 29881, 283, 7586, 29918, 23575, 742, 13, 4706, 525, 2798, 29918, 29881, 283, 7586, 29918, 29883, 742, 13, 4706, 525, 2798, 29918, 29881, 283, 7586, 29918, 1949, 2291, 742, 13, 4706, 525, 2798, 29918, 29881, 283, 7586, 29918, 29886, 1541, 661, 742, 13, 4706, 525, 2798, 29918, 29881, 283, 7586, 29918, 4691, 742, 13, 1678, 1723, 13, 13, 1678, 3806, 353, 2302, 29918, 29881, 283, 7586, 29918, 29883, 10456, 1718, 10749, 29897, 13, 1678, 1065, 877, 2798, 29918, 29881, 283, 7586, 742, 17067, 1254, 29903, 29892, 3806, 29922, 9684, 29892, 12312, 29922, 29896, 29900, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1667, 580, 13, 2 ]
TrendTrading/BearBullIndicators/SPY DOW RUSS market.py
benjabee10/WKUResearch
0
92571
<gh_stars>0 import numpy as np import pandas as pd import talib low=0.9 high=1.1 pct= 0.1 def initialize(context): context.stocks= [sid(8347), sid(6653), sid(3149), sid(4151), sid(5061), sid(19675), sid(700), sid(8229)] context.spy= sid(8554) context.russ= sid(21519) context.dow= sid(2174) context.small= 50 context.large= 200 context.market= 0 schedule_function(check) def check(context, data): spydata= data.history(context.spy, 'price', context.large+10, '1d') spys= talib.SMA(spydata, context.small)[-1] spyl= talib.SMA(spydata, context.large)[-1] russdata= data.history(context.russ, 'price', context.large+10, '1d') russs= talib.SMA(russdata, context.small)[-1] russl= talib.SMA(russdata, context.large)[-1] dowdata= data.history(context.dow, 'price', context.large+10, '1d') dows= talib.SMA(dowdata, context.small)[-1] dowl= talib.SMA(dowdata, context.large)[-1] if spys > high*spyl and russs > high*russl and dows > high*dowl: context.market= -1 elif low*spyl <= spys <= high*spyl or low*russl <= russs <= high*russl or low*dowl <= dows <= high*dowl: context.market= 0 elif spys < low*spyl and russs < low*russl and dows < low*dowl: context.market= 1 spyposition = context.portfolio.positions[context.spy].amount russposition = context.portfolio.positions[context.russ].amount dowposition = context.portfolio.positions[context.spy].amount if context.market == 1 and spyposition==0: order_target_percent(context.spy, 0.3) order_target_percent(context.russ, 0.3) order_target_percent(context.dow, 0.3) clearstocks(context, data) elif context.market == 0: apotrade(context, data) order_target_percent(context.spy, 0) order_target_percent(context.russ, 0) order_target_percent(context.dow, 0) elif context.market == -1 and spyposition==0: order_target_percent(context.spy, -0.3) order_target_percent(context.russ, -0.3) order_target_percent(context.dow, -0.3) clearstocks(context, data) record(market=context.market, leverage=context.account.leverage) def apotrade(context, data): for stock in context.stocks: prices = data.history(stock, 'price', 50, '1d') apo = talib.APO(prices, fastperiod=12, slowperiod=26, matype=0)[-1] position = context.portfolio.positions[stock].amount if apo > 0 and position == 0: order_target_percent(stock, pct) elif apo < 0 and position > 0: order_target_percent(stock, 0) def clearstocks(context, data): for stock in context.stocks: order_target_percent(stock, 0)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 5215, 5969, 747, 13, 13, 677, 29922, 29900, 29889, 29929, 13, 9812, 29922, 29896, 29889, 29896, 13, 29886, 312, 29922, 29871, 29900, 29889, 29896, 13, 1753, 11905, 29898, 4703, 1125, 13, 1678, 3030, 29889, 17712, 29879, 29922, 518, 29879, 333, 29898, 29947, 29941, 29946, 29955, 511, 25349, 29898, 29953, 29953, 29945, 29941, 511, 25349, 29898, 29941, 29896, 29946, 29929, 511, 25349, 29898, 29946, 29896, 29945, 29896, 511, 25349, 29898, 29945, 29900, 29953, 29896, 511, 25349, 29898, 29896, 29929, 29953, 29955, 29945, 511, 25349, 29898, 29955, 29900, 29900, 511, 25349, 29898, 29947, 29906, 29906, 29929, 4638, 13, 1678, 3030, 29889, 1028, 29891, 29922, 25349, 29898, 29947, 29945, 29945, 29946, 29897, 13, 1678, 3030, 29889, 29878, 1558, 29922, 25349, 29898, 29906, 29896, 29945, 29896, 29929, 29897, 13, 1678, 3030, 29889, 29881, 340, 29922, 25349, 29898, 29906, 29896, 29955, 29946, 29897, 13, 1678, 3030, 29889, 9278, 29922, 29871, 29945, 29900, 13, 1678, 3030, 29889, 16961, 29922, 29871, 29906, 29900, 29900, 13, 13, 1678, 3030, 29889, 28549, 29922, 29871, 29900, 13, 1678, 20410, 29918, 2220, 29898, 3198, 29897, 13, 13, 1753, 1423, 29898, 4703, 29892, 848, 1125, 13, 1678, 805, 29891, 1272, 29922, 848, 29889, 18434, 29898, 4703, 29889, 1028, 29891, 29892, 525, 9175, 742, 3030, 29889, 16961, 29974, 29896, 29900, 29892, 525, 29896, 29881, 1495, 13, 1678, 805, 952, 29922, 5969, 747, 29889, 29903, 1529, 29898, 1028, 29891, 1272, 29892, 3030, 29889, 9278, 9601, 29899, 29896, 29962, 13, 1678, 805, 2904, 29922, 5969, 747, 29889, 29903, 1529, 29898, 1028, 29891, 1272, 29892, 3030, 29889, 16961, 9601, 29899, 29896, 29962, 13, 1678, 17626, 1272, 29922, 848, 29889, 18434, 29898, 4703, 29889, 29878, 1558, 29892, 525, 9175, 742, 3030, 29889, 16961, 29974, 29896, 29900, 29892, 525, 29896, 29881, 1495, 13, 1678, 13005, 893, 29922, 5969, 747, 29889, 29903, 1529, 29898, 29878, 1558, 1272, 29892, 3030, 29889, 9278, 9601, 29899, 29896, 29962, 13, 1678, 17626, 29880, 29922, 5969, 747, 29889, 29903, 1529, 29898, 29878, 1558, 1272, 29892, 3030, 29889, 16961, 9601, 29899, 29896, 29962, 13, 1678, 16611, 1272, 29922, 848, 29889, 18434, 29898, 4703, 29889, 29881, 340, 29892, 525, 9175, 742, 3030, 29889, 16961, 29974, 29896, 29900, 29892, 525, 29896, 29881, 1495, 13, 1678, 270, 1242, 29922, 5969, 747, 29889, 29903, 1529, 29898, 29881, 340, 1272, 29892, 3030, 29889, 9278, 9601, 29899, 29896, 29962, 13, 1678, 16611, 29880, 29922, 5969, 747, 29889, 29903, 1529, 29898, 29881, 340, 1272, 29892, 3030, 29889, 16961, 9601, 29899, 29896, 29962, 13, 268, 13, 268, 13, 1678, 565, 805, 952, 1405, 1880, 29930, 1028, 2904, 322, 13005, 893, 1405, 1880, 29930, 29878, 1558, 29880, 322, 270, 1242, 1405, 1880, 29930, 29881, 340, 29880, 29901, 13, 4706, 3030, 29889, 28549, 29922, 448, 29896, 13, 13, 1678, 25342, 4482, 29930, 1028, 2904, 5277, 805, 952, 5277, 1880, 29930, 1028, 2904, 470, 4482, 29930, 29878, 1558, 29880, 5277, 13005, 893, 5277, 1880, 29930, 29878, 1558, 29880, 470, 4482, 29930, 29881, 340, 29880, 5277, 270, 1242, 5277, 1880, 29930, 29881, 340, 29880, 29901, 13, 4706, 3030, 29889, 28549, 29922, 29871, 29900, 13, 13, 1678, 25342, 805, 952, 529, 4482, 29930, 1028, 2904, 322, 13005, 893, 529, 4482, 29930, 29878, 1558, 29880, 322, 270, 1242, 529, 4482, 29930, 29881, 340, 29880, 29901, 13, 4706, 3030, 29889, 28549, 29922, 29871, 29896, 13, 13, 1678, 805, 29891, 3283, 353, 3030, 29889, 637, 25648, 29889, 1066, 2187, 29961, 4703, 29889, 1028, 29891, 1822, 14506, 13, 1678, 13005, 1028, 4490, 353, 3030, 29889, 637, 25648, 29889, 1066, 2187, 29961, 4703, 29889, 29878, 1558, 1822, 14506, 13, 1678, 16611, 3283, 353, 3030, 29889, 637, 25648, 29889, 1066, 2187, 29961, 4703, 29889, 1028, 29891, 1822, 14506, 13, 13, 1678, 565, 3030, 29889, 28549, 1275, 29871, 29896, 322, 805, 29891, 3283, 1360, 29900, 29901, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 1028, 29891, 29892, 29871, 29900, 29889, 29941, 29897, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 29878, 1558, 29892, 29871, 29900, 29889, 29941, 29897, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 29881, 340, 29892, 29871, 29900, 29889, 29941, 29897, 13, 4706, 2821, 17712, 29879, 29898, 4703, 29892, 848, 29897, 13, 13, 1678, 25342, 3030, 29889, 28549, 1275, 29871, 29900, 29901, 13, 4706, 3095, 327, 15464, 29898, 4703, 29892, 848, 29897, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 1028, 29891, 29892, 29871, 29900, 29897, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 29878, 1558, 29892, 29871, 29900, 29897, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 29881, 340, 29892, 29871, 29900, 29897, 13, 13, 1678, 25342, 3030, 29889, 28549, 1275, 448, 29896, 322, 805, 29891, 3283, 1360, 29900, 29901, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 1028, 29891, 29892, 448, 29900, 29889, 29941, 29897, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 29878, 1558, 29892, 448, 29900, 29889, 29941, 29897, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 4703, 29889, 29881, 340, 29892, 448, 29900, 29889, 29941, 29897, 13, 4706, 2821, 17712, 29879, 29898, 4703, 29892, 848, 29897, 13, 308, 13, 1678, 2407, 29898, 28549, 29922, 4703, 29889, 28549, 29892, 454, 19698, 29922, 4703, 29889, 10149, 29889, 280, 19698, 29897, 13, 268, 13, 1753, 3095, 327, 15464, 29898, 4703, 29892, 848, 1125, 13, 1678, 363, 10961, 297, 3030, 29889, 17712, 29879, 29901, 13, 4706, 26094, 353, 848, 29889, 18434, 29898, 17712, 29892, 525, 9175, 742, 29871, 29945, 29900, 29892, 525, 29896, 29881, 1495, 13, 4706, 16798, 353, 5969, 747, 29889, 3301, 29949, 29898, 558, 1575, 29892, 5172, 19145, 29922, 29896, 29906, 29892, 5232, 19145, 29922, 29906, 29953, 29892, 1775, 668, 29922, 29900, 9601, 29899, 29896, 29962, 13, 4706, 2602, 353, 3030, 29889, 637, 25648, 29889, 1066, 2187, 29961, 17712, 1822, 14506, 308, 13, 4706, 565, 16798, 1405, 29871, 29900, 322, 2602, 1275, 29871, 29900, 29901, 13, 9651, 1797, 29918, 5182, 29918, 25376, 29898, 17712, 29892, 282, 312, 29897, 13, 13, 4706, 25342, 16798, 529, 29871, 29900, 322, 2602, 1405, 29871, 29900, 29901, 13, 9651, 1797, 29918, 5182, 29918, 25376, 29898, 17712, 29892, 29871, 29900, 29897, 13, 13, 1753, 2821, 17712, 29879, 29898, 4703, 29892, 848, 1125, 13, 1678, 363, 10961, 297, 3030, 29889, 17712, 29879, 29901, 13, 4706, 1797, 29918, 5182, 29918, 25376, 29898, 17712, 29892, 29871, 29900, 29897, 2 ]
cosmoscope/server.py
cosmoscope/cosmo-server
0
26781
import logging import signal import gevent import msgpack from zerorpc import Publisher, Puller, Pusher, Server import numpy as np import jsonpickle from .store import store from .data import Data from .operations.operation import Operation from .utils.singleton import Singleton __all__ = ['ServerAPI'] class ServerAPI(Server, metaclass=Singleton): """ RPC server class. """ def __init__(self, publisher=None, *args, **kwargs): super(ServerAPI, self).__init__(*args, **kwargs) self.publisher = publisher def undo(self): """ Undo an operation popping from the stack and calling its `undo` method. """ Operation.pop().undo() def redo(self): """ Call the `redo` method on the latest operation to be added to stack. """ Operation.redo() def register(self, msg): pass # self.publisher.testing("This is a test on client.") def load_data(self, path, format): """ Load a data file given path and format. """ import astropy.units as u # data = Data.read(path, format=format) data = Data(np.random.sample(100) * u.Jy, spectral_axis=np.linspace(1100, 1200, 100) * u.AA) self.publisher.data_loaded(data.identifier) def create_data(self, *args, **kwargs): data = Data(*args, **kwargs) self.publisher.data_created(data.identifier) return data.identifier def query_loader_formats(self): """ Returns a list of available data loader formats. """ from specutils import Spectrum1D from astropy.io import registry as io_registry all_formats = io_registry.get_formats(Spectrum1D)['Format'] return all_formats def query_data(self, identifier): data = store[identifier] data_dict = { 'name': data.name, 'identifier': data.identifier, 'spectral_axis': data.spectral_axis.value.tolist(), 'spectral_axis_unit': data.spectral_axis.unit.to_string(), 'flux': data.flux.value.tolist(), 'unit': data.flux.unit.to_string() } return data_dict def query_data_attribute(self, identifier, name): data = store[identifier] data_attr = getattr(data, name) packed_data_attr = data.encode(data_attr) return packed_data_attr def launch(server_address=None, publisher_address=None, block=True): server_address = server_address or "tcp://127.0.0.1:4242" publisher_address = publisher_address or "tcp://127.0.0.1:4243" # Establish the publisher service. This will send events to any # subscribed services along the designated address. publisher = Publisher() publisher.connect(publisher_address) # Setup the server service. This will be the api that clients # will send events to. server = ServerAPI(publisher) server.bind(server_address) logging.info( "Server is now listening on %s and sending on %s.", server_address, publisher_address) # Allow for stopping the server via ctrl-c gevent.signal(signal.SIGINT, server.stop) server.run() if block else gevent.spawn(server.run)
[ 1, 1053, 12183, 13, 13, 5215, 7182, 13, 5215, 1737, 794, 13, 5215, 10191, 4058, 13, 3166, 503, 261, 272, 6739, 1053, 12904, 261, 29892, 349, 913, 261, 29892, 349, 1878, 261, 29892, 5656, 13, 5215, 12655, 408, 7442, 13, 5215, 4390, 23945, 280, 13, 13, 3166, 869, 8899, 1053, 3787, 13, 3166, 869, 1272, 1053, 3630, 13, 3166, 869, 3372, 800, 29889, 16453, 1053, 20462, 13, 3166, 869, 13239, 29889, 2976, 11285, 1053, 6106, 11285, 13, 13, 1649, 497, 1649, 353, 6024, 6004, 8787, 2033, 13, 13, 13, 1990, 5656, 8787, 29898, 6004, 29892, 1539, 562, 605, 29922, 10873, 11285, 1125, 13, 1678, 9995, 13, 1678, 390, 9026, 1923, 770, 29889, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 9805, 261, 29922, 8516, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 29898, 6004, 8787, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 29889, 23679, 261, 353, 9805, 261, 13, 13, 1678, 822, 563, 29877, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 14211, 29877, 385, 5858, 772, 3262, 515, 278, 5096, 322, 5432, 967, 421, 6201, 29952, 1158, 29889, 13, 4706, 9995, 13, 4706, 20462, 29889, 7323, 2141, 6201, 580, 13, 13, 1678, 822, 337, 1867, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 8251, 278, 421, 1127, 29877, 29952, 1158, 373, 278, 9281, 5858, 304, 367, 2715, 304, 5096, 29889, 13, 4706, 9995, 13, 4706, 20462, 29889, 1127, 29877, 580, 13, 13, 1678, 822, 6036, 29898, 1311, 29892, 10191, 1125, 13, 4706, 1209, 13, 4706, 396, 1583, 29889, 23679, 261, 29889, 13424, 703, 4013, 338, 263, 1243, 373, 3132, 23157, 13, 13, 1678, 822, 2254, 29918, 1272, 29898, 1311, 29892, 2224, 29892, 3402, 1125, 13, 4706, 9995, 13, 4706, 16012, 263, 848, 934, 2183, 2224, 322, 3402, 29889, 13, 4706, 9995, 13, 4706, 1053, 8717, 14441, 29889, 348, 1169, 408, 318, 13, 4706, 396, 848, 353, 3630, 29889, 949, 29898, 2084, 29892, 3402, 29922, 4830, 29897, 13, 4706, 848, 353, 3630, 29898, 9302, 29889, 8172, 29889, 11249, 29898, 29896, 29900, 29900, 29897, 334, 318, 29889, 29967, 29891, 29892, 23161, 29918, 8990, 29922, 9302, 29889, 1915, 3493, 29898, 29896, 29896, 29900, 29900, 29892, 29871, 29896, 29906, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29897, 334, 318, 29889, 6344, 29897, 13, 13, 4706, 1583, 29889, 23679, 261, 29889, 1272, 29918, 15638, 29898, 1272, 29889, 25378, 29897, 13, 13, 1678, 822, 1653, 29918, 1272, 29898, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 848, 353, 3630, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 4706, 1583, 29889, 23679, 261, 29889, 1272, 29918, 11600, 29898, 1272, 29889, 25378, 29897, 13, 13, 4706, 736, 848, 29889, 25378, 13, 13, 1678, 822, 2346, 29918, 12657, 29918, 689, 1446, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 16969, 263, 1051, 310, 3625, 848, 23466, 21971, 29889, 13, 4706, 9995, 13, 4706, 515, 1580, 13239, 1053, 27738, 5848, 29896, 29928, 13, 4706, 515, 8717, 14441, 29889, 601, 1053, 21235, 408, 12013, 29918, 1727, 6020, 13, 13, 4706, 599, 29918, 689, 1446, 353, 12013, 29918, 1727, 6020, 29889, 657, 29918, 689, 1446, 29898, 29903, 1103, 5848, 29896, 29928, 29897, 1839, 5809, 2033, 13, 13, 4706, 736, 599, 29918, 689, 1446, 13, 13, 1678, 822, 2346, 29918, 1272, 29898, 1311, 29892, 15882, 1125, 13, 4706, 848, 353, 3787, 29961, 25378, 29962, 13, 13, 4706, 848, 29918, 8977, 353, 426, 13, 9651, 525, 978, 2396, 848, 29889, 978, 29892, 13, 9651, 525, 25378, 2396, 848, 29889, 25378, 29892, 13, 9651, 525, 21494, 1705, 29918, 8990, 2396, 848, 29889, 21494, 1705, 29918, 8990, 29889, 1767, 29889, 25027, 391, 3285, 13, 9651, 525, 21494, 1705, 29918, 8990, 29918, 5441, 2396, 848, 29889, 21494, 1705, 29918, 8990, 29889, 5441, 29889, 517, 29918, 1807, 3285, 13, 9651, 525, 1579, 1314, 2396, 848, 29889, 1579, 1314, 29889, 1767, 29889, 25027, 391, 3285, 13, 9651, 525, 5441, 2396, 848, 29889, 1579, 1314, 29889, 5441, 29889, 517, 29918, 1807, 580, 13, 4706, 500, 13, 13, 4706, 736, 848, 29918, 8977, 13, 13, 1678, 822, 2346, 29918, 1272, 29918, 12715, 29898, 1311, 29892, 15882, 29892, 1024, 1125, 13, 4706, 848, 353, 3787, 29961, 25378, 29962, 13, 13, 4706, 848, 29918, 5552, 353, 679, 5552, 29898, 1272, 29892, 1024, 29897, 13, 13, 4706, 4870, 287, 29918, 1272, 29918, 5552, 353, 848, 29889, 12508, 29898, 1272, 29918, 5552, 29897, 13, 13, 4706, 736, 4870, 287, 29918, 1272, 29918, 5552, 13, 13, 13, 1753, 6826, 29898, 2974, 29918, 7328, 29922, 8516, 29892, 9805, 261, 29918, 7328, 29922, 8516, 29892, 2908, 29922, 5574, 1125, 13, 1678, 1923, 29918, 7328, 353, 1923, 29918, 7328, 470, 376, 23981, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29946, 29906, 29946, 29906, 29908, 13, 1678, 9805, 261, 29918, 7328, 353, 9805, 261, 29918, 7328, 470, 376, 23981, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29946, 29906, 29946, 29941, 29908, 13, 13, 1678, 396, 2661, 370, 1674, 278, 9805, 261, 2669, 29889, 910, 674, 3638, 4959, 304, 738, 13, 1678, 396, 21696, 2580, 5786, 3412, 278, 25373, 3211, 29889, 13, 1678, 9805, 261, 353, 12904, 261, 580, 13, 1678, 9805, 261, 29889, 6915, 29898, 23679, 261, 29918, 7328, 29897, 13, 13, 1678, 396, 3789, 786, 278, 1923, 2669, 29889, 910, 674, 367, 278, 7882, 393, 13154, 13, 1678, 396, 674, 3638, 4959, 304, 29889, 13, 1678, 1923, 353, 5656, 8787, 29898, 23679, 261, 29897, 13, 1678, 1923, 29889, 5355, 29898, 2974, 29918, 7328, 29897, 13, 13, 1678, 12183, 29889, 3888, 29898, 13, 4706, 376, 6004, 338, 1286, 19866, 373, 1273, 29879, 322, 9348, 373, 1273, 29879, 19602, 13, 4706, 1923, 29918, 7328, 29892, 9805, 261, 29918, 7328, 29897, 13, 13, 1678, 396, 29408, 363, 25480, 278, 1923, 3025, 274, 11742, 29899, 29883, 13, 1678, 1737, 794, 29889, 25436, 29898, 25436, 29889, 5425, 29954, 10192, 29892, 1923, 29889, 9847, 29897, 13, 13, 1678, 1923, 29889, 3389, 580, 565, 2908, 1683, 1737, 794, 29889, 1028, 18101, 29898, 2974, 29889, 3389, 29897, 2 ]
gsea_api/gsea/java.py
krassowski/gsea-api
8
97770
<reponame>krassowski/gsea-api import re from glob import glob from pathlib import Path from shutil import rmtree from tempfile import TemporaryDirectory from typing import Union from warnings import warn from pandas import read_table, DataFrame from .base import GSEA from ..molecular_signatures_db import GeneSets from ..paths import tmp_dir, third_party_dir class GSEADesktop(GSEA): path = Path('java') def __init__(self, memory_size=5000, gsea_jar_path: Union[str, Path] = None, **kwargs): super().__init__(**kwargs) self.memory_size = memory_size if gsea_jar_path is None: gsea_jar_path = third_party_dir / 'gsea-3.0.jar' else: gsea_jar_path = Path(gsea_jar_path) if not str(gsea_jar_path).endswith('.jar'): warn(f'{gsea_jar_path} does not look like a valid GSEADesktop path') self.gsea_path = gsea_jar_path if not self.gsea_path.exists(): raise Exception( f'Could not find GSEADesktop installation in {gsea_jar_path};' f' please symlink it or set path in "gsea_jar_path" argument.' ) @property def core_command(self): return f'{self.path} -cp {self.gsea_path}' @staticmethod def load_results(out_dir, name, expression_data, delete=True): timestamps = [] for path in glob(f'{out_dir}/{name}.Gsea.*'): match = re.match(rf'{name}\.Gsea\.(\d*)', Path(path).name) timestamp = match.group(1) timestamps.append(timestamp) timestamps = sorted(timestamps, reverse=True) newest = timestamps[0] results = {} for class_type in set(expression_data.safe_classes): path = f'{out_dir}/{name}.Gsea.{newest}/gsea_report_for_{class_type}_{newest}.xls' result: DataFrame = read_table(path) assert all(result['Unnamed: 11'].isnull()) result.drop('Unnamed: 11', axis='columns', inplace=True) result.columns = [column.lower().replace(' ', '_') for column in result.columns] result.drop('gs<br>_follow_link_to_msigdb', axis='columns', inplace=True) result = result.sort_values('fdr_q-val') result.set_index('name', inplace=True) results[class_type] = result.dropna(subset=['nes', 'fdr_q-val']) if delete: rmtree(f'{out_dir}/{name}.Gsea.{newest}', ignore_errors=True) return results metrics_using_variance = {'tTest', 'Signal2Noise'} def run( # Common GSEA interface self, expression_data, gene_sets: Union[str, GeneSets], metric='Signal2Noise', permutations=1000, permutation_type='phenotype', verbose=False, # GSEADesktop-specific collapse=True, mode='Max_probe', detailed_sets_analysis=False, out_dir=None, plot_top_x=0, name='my_analysis', normalization='meandiv', min_genes=15, max_genes=500, sort='real', # internal, won't be passed to GSEA use_existing=False, delete=True, # additional arguments to be passed **kwargs ): """Memory in MB""" super().run(expression_data, gene_sets, metric=metric) gene_sets = self.solve_gene_sets(gene_sets) assert permutation_type in {'Gene_set', 'phenotype'} assert metric in {'Diff_of_Classes', 'log2_Ratio_of_Classes', 'Ratio_of_Classes' 'tTest', 'Signal2Noise'} if use_existing: try: results = self.load_results(out_dir, name, expression_data) print( 'Re-using pre-calculated results for GSEA' ' (to prevent this, set use_existing=False or clear the temporary GSEA folder)' ) return results except IndexError: pass command = f'{self.core_command} -Xmx{self.memory_size}m xtools.gsea.Gsea' for key, value in kwargs.items(): command += f' -{key} {value}' data_path, classes_path = self.prepare_files(expression_data) with TemporaryDirectory(dir=tmp_dir) as temp_dir: out_dir = self.prepare_out_dir(out_dir, temp_dir) command += ( f' -res {data_path}' f' -cls {classes_path}' f' -gmx {gene_sets}' f' -collapse false -mode {mode} -norm {normalization}' f' -nperm {permutations} -permute {permutation_type} -rnd_type no_balance' f' -scoring_scheme weighted -rpt_label {name}' f' -metric {metric}' f' -sort {sort} -order descending' ' -create_gcts false -create_svgs false' # ' -include_only_symbols true' f' -make_sets {str(detailed_sets_analysis).lower()} -median false -num 100' f' -plot_top_x {plot_top_x} -rnd_seed timestamp' ' -save_rnd_lists false' f' -set_max {max_genes} -set_min {min_genes}' ' -zip_report false' f' -out {out_dir}' ' -gui false' ) self.run_in_subprocess(command, verbose=verbose) results = self.load_results(out_dir, name, expression_data, delete=delete) if delete: self.clean_up(data_path, classes_path) return results
[ 1, 529, 276, 1112, 420, 29958, 12748, 465, 11716, 29914, 29887, 344, 29874, 29899, 2754, 13, 5215, 337, 13, 3166, 13149, 1053, 13149, 13, 3166, 2224, 1982, 1053, 10802, 13, 3166, 528, 4422, 1053, 364, 4378, 929, 13, 3166, 5694, 1445, 1053, 6789, 1971, 653, 9882, 13, 3166, 19229, 1053, 7761, 13, 3166, 18116, 1053, 29383, 13, 13, 3166, 11701, 1053, 1303, 29918, 2371, 29892, 3630, 4308, 13, 13, 3166, 869, 3188, 1053, 402, 1660, 29909, 13, 3166, 6317, 29885, 1772, 16637, 29918, 4530, 3698, 29918, 2585, 1053, 15350, 29903, 1691, 13, 3166, 6317, 24772, 1053, 13128, 29918, 3972, 29892, 4654, 29918, 22633, 29918, 3972, 13, 13, 13, 1990, 402, 1660, 3035, 267, 6883, 29898, 29954, 1660, 29909, 1125, 13, 1678, 2224, 353, 10802, 877, 1645, 1495, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3370, 29918, 2311, 29922, 29945, 29900, 29900, 29900, 29892, 330, 344, 29874, 29918, 4758, 29918, 2084, 29901, 7761, 29961, 710, 29892, 10802, 29962, 353, 6213, 29892, 3579, 19290, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 1068, 19290, 29897, 13, 4706, 1583, 29889, 14834, 29918, 2311, 353, 3370, 29918, 2311, 13, 4706, 565, 330, 344, 29874, 29918, 4758, 29918, 2084, 338, 6213, 29901, 13, 9651, 330, 344, 29874, 29918, 4758, 29918, 2084, 353, 4654, 29918, 22633, 29918, 3972, 847, 525, 29887, 344, 29874, 29899, 29941, 29889, 29900, 29889, 4758, 29915, 13, 4706, 1683, 29901, 13, 9651, 330, 344, 29874, 29918, 4758, 29918, 2084, 353, 10802, 29898, 29887, 344, 29874, 29918, 4758, 29918, 2084, 29897, 13, 9651, 565, 451, 851, 29898, 29887, 344, 29874, 29918, 4758, 29918, 2084, 467, 1975, 2541, 12839, 4758, 29374, 13, 18884, 29383, 29898, 29888, 29915, 29912, 29887, 344, 29874, 29918, 4758, 29918, 2084, 29913, 947, 451, 1106, 763, 263, 2854, 402, 1660, 3035, 267, 6883, 2224, 1495, 13, 4706, 1583, 29889, 29887, 344, 29874, 29918, 2084, 353, 330, 344, 29874, 29918, 4758, 29918, 2084, 13, 4706, 565, 451, 1583, 29889, 29887, 344, 29874, 29918, 2084, 29889, 9933, 7295, 13, 9651, 12020, 8960, 29898, 13, 18884, 285, 29915, 23323, 451, 1284, 402, 1660, 3035, 267, 6883, 11161, 297, 426, 29887, 344, 29874, 29918, 4758, 29918, 2084, 3400, 29915, 13, 18884, 285, 29915, 3113, 9878, 828, 682, 372, 470, 731, 2224, 297, 376, 29887, 344, 29874, 29918, 4758, 29918, 2084, 29908, 2980, 6169, 13, 9651, 1723, 13, 13, 1678, 732, 6799, 13, 1678, 822, 7136, 29918, 6519, 29898, 1311, 1125, 13, 4706, 736, 285, 29915, 29912, 1311, 29889, 2084, 29913, 448, 6814, 426, 1311, 29889, 29887, 344, 29874, 29918, 2084, 10162, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2254, 29918, 9902, 29898, 449, 29918, 3972, 29892, 1024, 29892, 4603, 29918, 1272, 29892, 5217, 29922, 5574, 1125, 13, 4706, 5335, 342, 15092, 353, 5159, 13, 4706, 363, 2224, 297, 13149, 29898, 29888, 29915, 29912, 449, 29918, 3972, 6822, 29912, 978, 1836, 29954, 344, 29874, 5575, 29374, 13, 9651, 1993, 353, 337, 29889, 4352, 29898, 9600, 29915, 29912, 978, 1012, 29889, 29954, 344, 29874, 23301, 1194, 29881, 7528, 742, 10802, 29898, 2084, 467, 978, 29897, 13, 9651, 14334, 353, 1993, 29889, 2972, 29898, 29896, 29897, 13, 9651, 5335, 342, 15092, 29889, 4397, 29898, 16394, 29897, 13, 13, 4706, 5335, 342, 15092, 353, 12705, 29898, 9346, 342, 15092, 29892, 11837, 29922, 5574, 29897, 13, 4706, 716, 342, 353, 5335, 342, 15092, 29961, 29900, 29962, 13, 13, 4706, 2582, 353, 6571, 13, 4706, 363, 770, 29918, 1853, 297, 731, 29898, 17471, 29918, 1272, 29889, 11177, 29918, 13203, 1125, 13, 9651, 2224, 353, 285, 29915, 29912, 449, 29918, 3972, 6822, 29912, 978, 1836, 29954, 344, 29874, 29889, 29912, 1482, 342, 6822, 29887, 344, 29874, 29918, 12276, 29918, 1454, 648, 1990, 29918, 1853, 3227, 1482, 342, 1836, 20267, 29915, 13, 9651, 1121, 29901, 3630, 4308, 353, 1303, 29918, 2371, 29898, 2084, 29897, 13, 9651, 4974, 599, 29898, 2914, 1839, 2525, 17514, 29901, 29871, 29896, 29896, 13359, 275, 4304, 3101, 13, 9651, 1121, 29889, 8865, 877, 2525, 17514, 29901, 29871, 29896, 29896, 742, 9685, 2433, 13099, 742, 297, 6689, 29922, 5574, 29897, 13, 9651, 1121, 29889, 13099, 353, 518, 4914, 29889, 13609, 2141, 6506, 877, 13420, 22868, 1495, 363, 1897, 297, 1121, 29889, 13099, 29962, 13, 9651, 1121, 29889, 8865, 877, 3174, 29966, 1182, 29958, 29918, 23031, 29918, 2324, 29918, 517, 29918, 1516, 335, 2585, 742, 9685, 2433, 13099, 742, 297, 6689, 29922, 5574, 29897, 13, 9651, 1121, 353, 1121, 29889, 6605, 29918, 5975, 877, 29888, 7707, 29918, 29939, 29899, 791, 1495, 13, 9651, 1121, 29889, 842, 29918, 2248, 877, 978, 742, 297, 6689, 29922, 5574, 29897, 13, 13, 9651, 2582, 29961, 1990, 29918, 1853, 29962, 353, 1121, 29889, 8865, 1056, 29898, 6484, 29922, 1839, 4515, 742, 525, 29888, 7707, 29918, 29939, 29899, 791, 11287, 13, 13, 4706, 565, 5217, 29901, 13, 9651, 364, 4378, 929, 29898, 29888, 29915, 29912, 449, 29918, 3972, 6822, 29912, 978, 1836, 29954, 344, 29874, 29889, 29912, 1482, 342, 29913, 742, 11455, 29918, 12523, 29922, 5574, 29897, 13, 13, 4706, 736, 2582, 13, 13, 1678, 21556, 29918, 4746, 29918, 1707, 8837, 353, 11117, 29873, 3057, 742, 525, 10140, 284, 29906, 3782, 895, 10827, 13, 13, 1678, 822, 1065, 29898, 13, 4706, 396, 13103, 402, 1660, 29909, 5067, 13, 4706, 1583, 29892, 4603, 29918, 1272, 29892, 18530, 29918, 7224, 29901, 7761, 29961, 710, 29892, 15350, 29903, 1691, 1402, 12714, 2433, 10140, 284, 29906, 3782, 895, 742, 13, 4706, 20005, 800, 29922, 29896, 29900, 29900, 29900, 29892, 20005, 362, 29918, 1853, 2433, 9789, 327, 668, 742, 26952, 29922, 8824, 29892, 13, 4706, 396, 402, 1660, 3035, 267, 6883, 29899, 14940, 13, 4706, 24382, 29922, 5574, 29892, 4464, 2433, 7976, 29918, 771, 915, 742, 13173, 29918, 7224, 29918, 15916, 29922, 8824, 29892, 714, 29918, 3972, 29922, 8516, 29892, 13, 4706, 6492, 29918, 3332, 29918, 29916, 29922, 29900, 29892, 1024, 2433, 1357, 29918, 15916, 742, 4226, 2133, 2433, 1004, 392, 440, 742, 1375, 29918, 1885, 267, 29922, 29896, 29945, 29892, 4236, 29918, 1885, 267, 29922, 29945, 29900, 29900, 29892, 13, 4706, 2656, 2433, 6370, 742, 13, 4706, 396, 7463, 29892, 2113, 29915, 29873, 367, 4502, 304, 402, 1660, 29909, 13, 4706, 671, 29918, 735, 15423, 29922, 8824, 29892, 5217, 29922, 5574, 29892, 13, 4706, 396, 5684, 6273, 304, 367, 4502, 13, 4706, 3579, 19290, 13, 268, 1125, 13, 4706, 9995, 16015, 297, 13232, 15945, 29908, 13, 4706, 2428, 2141, 3389, 29898, 17471, 29918, 1272, 29892, 18530, 29918, 7224, 29892, 12714, 29922, 16414, 29897, 13, 13, 4706, 18530, 29918, 7224, 353, 1583, 29889, 2929, 345, 29918, 29887, 1600, 29918, 7224, 29898, 29887, 1600, 29918, 7224, 29897, 13, 13, 4706, 4974, 20005, 362, 29918, 1853, 297, 11117, 29954, 1600, 29918, 842, 742, 525, 9789, 327, 668, 10827, 13, 4706, 4974, 12714, 297, 11117, 26023, 29918, 974, 29918, 27403, 742, 525, 1188, 29906, 29918, 29934, 20819, 29918, 974, 29918, 27403, 742, 525, 29934, 20819, 29918, 974, 29918, 27403, 29915, 525, 29873, 3057, 742, 525, 10140, 284, 29906, 3782, 895, 10827, 13, 13, 4706, 565, 671, 29918, 735, 15423, 29901, 13, 9651, 1018, 29901, 13, 18884, 2582, 353, 1583, 29889, 1359, 29918, 9902, 29898, 449, 29918, 3972, 29892, 1024, 29892, 4603, 29918, 1272, 29897, 13, 18884, 1596, 29898, 13, 462, 1678, 525, 1123, 29899, 4746, 758, 29899, 15807, 630, 2582, 363, 402, 1660, 29909, 29915, 13, 462, 1678, 525, 313, 517, 5557, 445, 29892, 731, 671, 29918, 735, 15423, 29922, 8824, 470, 2821, 278, 13201, 402, 1660, 29909, 4138, 16029, 13, 18884, 1723, 13, 18884, 736, 2582, 13, 9651, 5174, 11374, 2392, 29901, 13, 18884, 1209, 13, 13, 4706, 1899, 353, 285, 29915, 29912, 1311, 29889, 3221, 29918, 6519, 29913, 448, 29990, 16838, 29912, 1311, 29889, 14834, 29918, 2311, 29913, 29885, 29871, 486, 8789, 29889, 29887, 344, 29874, 29889, 29954, 344, 29874, 29915, 13, 13, 4706, 363, 1820, 29892, 995, 297, 9049, 5085, 29889, 7076, 7295, 13, 9651, 1899, 4619, 285, 29915, 448, 29912, 1989, 29913, 426, 1767, 10162, 13, 13, 4706, 848, 29918, 2084, 29892, 4413, 29918, 2084, 353, 1583, 29889, 19125, 29918, 5325, 29898, 17471, 29918, 1272, 29897, 13, 13, 4706, 411, 6789, 1971, 653, 9882, 29898, 3972, 29922, 7050, 29918, 3972, 29897, 408, 5694, 29918, 3972, 29901, 13, 9651, 714, 29918, 3972, 353, 1583, 29889, 19125, 29918, 449, 29918, 3972, 29898, 449, 29918, 3972, 29892, 5694, 29918, 3972, 29897, 13, 13, 9651, 1899, 4619, 313, 13, 18884, 285, 29915, 448, 690, 426, 1272, 29918, 2084, 10162, 13, 18884, 285, 29915, 448, 25932, 426, 13203, 29918, 2084, 10162, 13, 18884, 285, 29915, 448, 29887, 16838, 426, 29887, 1600, 29918, 7224, 10162, 13, 18884, 285, 29915, 448, 27756, 2089, 448, 8513, 426, 8513, 29913, 448, 12324, 426, 8945, 2133, 10162, 13, 18884, 285, 29915, 448, 29876, 17858, 426, 546, 6149, 800, 29913, 448, 17858, 1082, 426, 546, 6149, 362, 29918, 1853, 29913, 448, 29878, 299, 29918, 1853, 694, 29918, 5521, 749, 29915, 13, 18884, 285, 29915, 448, 1557, 8253, 29918, 816, 2004, 7688, 287, 448, 29878, 415, 29918, 1643, 426, 978, 10162, 13, 18884, 285, 29915, 448, 16414, 426, 16414, 10162, 13, 18884, 285, 29915, 448, 6605, 426, 6605, 29913, 448, 2098, 5153, 2548, 29915, 13, 18884, 525, 448, 3258, 29918, 29887, 312, 29879, 2089, 448, 3258, 29918, 4501, 3174, 2089, 29915, 13, 18884, 396, 525, 448, 2856, 29918, 6194, 29918, 18098, 29879, 1565, 29915, 13, 18884, 285, 29915, 448, 5675, 29918, 7224, 426, 710, 29898, 29881, 11881, 29918, 7224, 29918, 15916, 467, 13609, 28296, 448, 2168, 713, 2089, 448, 1949, 29871, 29896, 29900, 29900, 29915, 13, 18884, 285, 29915, 448, 5317, 29918, 3332, 29918, 29916, 426, 5317, 29918, 3332, 29918, 29916, 29913, 448, 29878, 299, 29918, 26776, 14334, 29915, 13, 18884, 525, 448, 7620, 29918, 29878, 299, 29918, 21513, 2089, 29915, 13, 18884, 285, 29915, 448, 842, 29918, 3317, 426, 3317, 29918, 1885, 267, 29913, 448, 842, 29918, 1195, 426, 1195, 29918, 1885, 267, 10162, 13, 18884, 525, 448, 7554, 29918, 12276, 2089, 29915, 13, 18884, 285, 29915, 448, 449, 426, 449, 29918, 3972, 10162, 13, 18884, 525, 448, 23569, 2089, 29915, 13, 9651, 1723, 13, 9651, 1583, 29889, 3389, 29918, 262, 29918, 1491, 5014, 29898, 6519, 29892, 26952, 29922, 369, 15828, 29897, 13, 13, 9651, 2582, 353, 1583, 29889, 1359, 29918, 9902, 29898, 449, 29918, 3972, 29892, 1024, 29892, 4603, 29918, 1272, 29892, 5217, 29922, 8143, 29897, 13, 13, 4706, 565, 5217, 29901, 13, 9651, 1583, 29889, 14941, 29918, 786, 29898, 1272, 29918, 2084, 29892, 4413, 29918, 2084, 29897, 13, 13, 4706, 736, 2582, 13, 13, 2 ]
Drawing Book/code.py
swy20190/HackerRankChallenge
0
38826
<gh_stars>0 import os def pageCount(n, p): # Write your code here front_flip = int(p/2) end_flip = int(n/2)-front_flip return min(front_flip, end_flip) if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') n = int(input().strip()) p = int(input().strip()) result = pageCount(n, p) fptr.write(str(result) + '\n') fptr.close()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 13, 13, 1753, 1813, 3981, 29898, 29876, 29892, 282, 1125, 13, 1678, 396, 14350, 596, 775, 1244, 13, 1678, 4565, 29918, 29888, 3466, 353, 938, 29898, 29886, 29914, 29906, 29897, 13, 1678, 1095, 29918, 29888, 3466, 353, 938, 29898, 29876, 29914, 29906, 6817, 8862, 29918, 29888, 3466, 13, 1678, 736, 1375, 29898, 8862, 29918, 29888, 3466, 29892, 1095, 29918, 29888, 3466, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 285, 7414, 353, 1722, 29898, 359, 29889, 21813, 1839, 12015, 12336, 29918, 10145, 7464, 525, 29893, 1495, 13, 13, 1678, 302, 353, 938, 29898, 2080, 2141, 17010, 3101, 13, 13, 1678, 282, 353, 938, 29898, 2080, 2141, 17010, 3101, 13, 13, 1678, 1121, 353, 1813, 3981, 29898, 29876, 29892, 282, 29897, 13, 13, 1678, 285, 7414, 29889, 3539, 29898, 710, 29898, 2914, 29897, 718, 11297, 29876, 1495, 13, 13, 1678, 285, 7414, 29889, 5358, 580, 13, 2 ]
fairepart/backends/__init__.py
thoas/django-fairepart
2
123264
def get_backends(): from ..settings import BACKENDS from ..utils import load_class backends = {} for backend_path in BACKENDS: backend = load_class(backend_path) backends[backend.name] = backend return backends
[ 1, 822, 679, 29918, 1627, 1975, 7295, 13, 1678, 515, 6317, 11027, 1053, 350, 11375, 1430, 8452, 13, 1678, 515, 6317, 13239, 1053, 2254, 29918, 1990, 13, 13, 1678, 1250, 1975, 353, 6571, 13, 13, 1678, 363, 14998, 29918, 2084, 297, 350, 11375, 1430, 8452, 29901, 13, 4706, 14998, 353, 2254, 29918, 1990, 29898, 27852, 29918, 2084, 29897, 13, 4706, 1250, 1975, 29961, 27852, 29889, 978, 29962, 353, 14998, 13, 13, 1678, 736, 1250, 1975, 13, 2 ]
imports/download-json.py
UrbanDS/semantic-segmentation-editor
0
192063
import glob import requests import json files = glob.glob('*.jpg') for file in files: base_file = file.split("/")[-1] output = open(base_file.replace(".jpg", ".json")) url = f"http://localhost:3000/api/json/{base_file}" json.dump(requests.get(url).json(), output)
[ 1, 1053, 13149, 13, 5215, 7274, 13, 5215, 4390, 13, 13, 5325, 353, 13149, 29889, 23705, 877, 10521, 6173, 1495, 13, 13, 1454, 934, 297, 2066, 29901, 13, 12, 3188, 29918, 1445, 353, 934, 29889, 5451, 11974, 1159, 14352, 29896, 29962, 13, 12, 4905, 353, 1722, 29898, 3188, 29918, 1445, 29889, 6506, 17350, 6173, 613, 11393, 3126, 5783, 13, 12, 2271, 353, 285, 29908, 1124, 597, 7640, 29901, 29941, 29900, 29900, 29900, 29914, 2754, 29914, 3126, 19248, 3188, 29918, 1445, 5038, 13, 12, 3126, 29889, 15070, 29898, 24830, 29889, 657, 29898, 2271, 467, 3126, 3285, 1962, 29897, 2 ]
app.py
SamEdwardes/wod-tracker
0
1604905
import os import boto3 import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import numpy as np import pandas as pd import dash from dash.dependencies import Input, Output, State from src.aws import refresh_aws_table from src.helpers import clean_text dynamodb = boto3.resource('dynamodb', region_name='ca-central-1') ############################################## # Boilterplate ############################################## app = dash.Dash(__name__, external_stylesheets=[dbc.themes.FLATLY]) app.title = "WOD Log" port = int(os.environ.get("PORT", 5000)) server = app.server ############################################## # Data ############################################## wod_log = dynamodb.Table('wod_log') ############################################## # Layouts ############################################## layout_01_navbar = dbc.Navbar( [ html.A( # Use row and col to control vertical alignment of logo / brand dbc.Row( [ dbc.Col(dbc.NavbarBrand("Wod Log", className="ml-2")), ], align="center", no_gutters=True, ), ), ], color="primary", dark=True, ) layout_02_workout_entry = dbc.Col([ # Row 1: User and Date dbc.Row( [ dbc.Col( dbc.FormGroup( [ dbc.Label("User", html_for="new-user"), dbc.Input( type="text", id="new-user", placeholder="Enter name of user (e.g. <NAME>", ), ] ), width=6, ), dbc.Col( dbc.FormGroup( [ dbc.Label("Date", html_for="new-date"), dbc.Input( type="date", id="new-date", placeholder="Enter date", ), ] ), width=6, ), ], form=True, ), # Row 2: Exercise dbc.Row( [ dbc.Col( dbc.FormGroup( [ dbc.Label("Name of exercise", html_for="new-name"), dbc.Input( type="text", id="new-name", placeholder="Name of movement (e.g. 'Squat')", ), ] ) ) ] ), # Row 3: Sets, reps, weight dbc.Row( [ dbc.Col( dbc.FormGroup( [ dbc.Label("Sets", html_for="new-sets"), dbc.Input( type="number", id="new-sets", placeholder="Enter number of sets (e.g. '3')", ), ] ), width=4, ), dbc.Col( dbc.FormGroup( [ dbc.Label("Reps", html_for="new-reps"), dbc.Input( type="number", id="new-reps", placeholder="Enter the number of reps (e.g. '10'", ), ] ), width=4, ), dbc.Col( dbc.FormGroup( [ dbc.Label("Weight", html_for="new-weight"), dbc.Input( type="number", id="new-weight", placeholder="Enter date", ), ] ), width=4, ), ], form=True, ), # Row 4: Submit button dbc.Row(dbc.Col([ dbc.Button(id='submit-entry-button', children="Submit Movement") ])), dbc.Row(dbc.Col([ dbc.Label(id='submit-status') ])) ]) ############################################## # App layout ############################################## app.layout = html.Div([ layout_01_navbar, dbc.Col(html.Div([ html.Br(), html.P('''Welcome to WOD Log. A tool for tracking the progress of your workouts'''), dbc.Label("History"), html.Div(id="wod-log-df"), html.Hr(), html.P("Log a new workout"), layout_02_workout_entry, html.P("End of app...") ])) ]) ############################################## # App Callbacks ############################################## @app.callback( [Output("submit-status", "children"), Output("wod-log-df", "children")], [Input("submit-entry-button", "n_clicks")], [State("new-date", "value"), State("new-name", "value"), State("new-sets", "value"), State("new-reps", "value"), State("new-weight", "value"), State("new-user", "value")]) def submit_new_entry(n_clicks, date, name, sets, reps, weight, user): if n_clicks is None: return ( "Press button to submit workout", refresh_aws_table(wod_log)[1] ) else: wod_log.put_item( Item={ 'name': clean_text(name), 'date': date, 'sets': sets, 'reps': reps, 'weight': weight, 'user': clean_text(user) } ) return ( f"Workout logged! Performed {sets} of {name} using {weight} lbs on {date}.", refresh_aws_table(wod_log)[1] ) ############################################## # Run ############################################## if __name__ == '__main__': app.run_server( debug=True, host="0.0.0.0", port=port )
[ 1, 1053, 2897, 13, 13, 5215, 289, 3747, 29941, 13, 5215, 12569, 29918, 8704, 29918, 14036, 408, 4833, 29883, 13, 5215, 12569, 29918, 3221, 29918, 14036, 408, 270, 617, 13, 5215, 12569, 29918, 1420, 29918, 14036, 408, 3472, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 13, 5215, 12569, 13, 3166, 12569, 29889, 22594, 1053, 10567, 29892, 10604, 29892, 4306, 13, 13, 3166, 4765, 29889, 10467, 1053, 11086, 29918, 10467, 29918, 2371, 13, 3166, 4765, 29889, 3952, 6774, 1053, 5941, 29918, 726, 13, 13, 29881, 2926, 10396, 353, 289, 3747, 29941, 29889, 10314, 877, 29881, 2926, 10396, 742, 5120, 29918, 978, 2433, 1113, 29899, 25171, 29899, 29896, 1495, 13, 13, 13, 13383, 13383, 7346, 4136, 2277, 13, 29937, 1952, 309, 357, 2341, 13, 13383, 13383, 7346, 4136, 2277, 13, 932, 353, 12569, 29889, 29928, 1161, 22168, 978, 1649, 29892, 7029, 29918, 9783, 354, 1691, 11759, 11140, 29889, 386, 13826, 29889, 10536, 1299, 16786, 2314, 13, 932, 29889, 3257, 353, 376, 29956, 13668, 4522, 29908, 13, 637, 353, 938, 29898, 359, 29889, 21813, 29889, 657, 703, 15082, 613, 29871, 29945, 29900, 29900, 29900, 876, 13, 2974, 353, 623, 29889, 2974, 13, 13, 13383, 13383, 7346, 4136, 2277, 13, 29937, 3630, 13, 13383, 13383, 7346, 4136, 2277, 13, 27309, 29918, 1188, 353, 4292, 10396, 29889, 3562, 877, 27309, 29918, 1188, 1495, 13, 13, 13, 13383, 13383, 7346, 4136, 2277, 13, 29937, 20259, 29879, 13, 13383, 13383, 7346, 4136, 2277, 13, 13, 2680, 29918, 29900, 29896, 29918, 21890, 353, 4833, 29883, 29889, 22107, 1646, 29898, 13, 1678, 518, 13, 4706, 3472, 29889, 29909, 29898, 13, 9651, 396, 4803, 1948, 322, 784, 304, 2761, 11408, 22239, 310, 20194, 847, 14982, 13, 9651, 4833, 29883, 29889, 4301, 29898, 13, 18884, 518, 13, 462, 1678, 4833, 29883, 29889, 1625, 29898, 11140, 29889, 22107, 1646, 29933, 9502, 703, 29956, 397, 4522, 613, 22030, 543, 828, 29899, 29906, 1159, 511, 13, 18884, 21251, 13, 18884, 7595, 543, 5064, 613, 13, 18884, 694, 29918, 29887, 329, 2153, 29922, 5574, 29892, 13, 9651, 10353, 13, 4706, 10353, 13, 1678, 21251, 13, 1678, 2927, 543, 16072, 613, 13, 1678, 6501, 29922, 5574, 29892, 13, 29897, 13, 13, 2680, 29918, 29900, 29906, 29918, 1287, 449, 29918, 8269, 353, 4833, 29883, 29889, 1625, 4197, 13, 1678, 396, 11438, 29871, 29896, 29901, 4911, 322, 4712, 13, 1678, 4833, 29883, 29889, 4301, 29898, 13, 4706, 518, 13, 9651, 4833, 29883, 29889, 1625, 29898, 13, 18884, 4833, 29883, 29889, 2500, 4782, 29898, 13, 462, 1678, 518, 13, 462, 4706, 4833, 29883, 29889, 4775, 703, 2659, 613, 3472, 29918, 1454, 543, 1482, 29899, 1792, 4968, 13, 462, 4706, 4833, 29883, 29889, 4290, 29898, 13, 462, 9651, 1134, 543, 726, 613, 13, 462, 9651, 1178, 543, 1482, 29899, 1792, 613, 13, 462, 9651, 12983, 543, 10399, 1024, 310, 1404, 313, 29872, 29889, 29887, 29889, 529, 5813, 28341, 13, 462, 4706, 10353, 13, 462, 1678, 4514, 13, 18884, 10353, 13, 18884, 2920, 29922, 29953, 29892, 13, 9651, 10353, 13, 9651, 4833, 29883, 29889, 1625, 29898, 13, 18884, 4833, 29883, 29889, 2500, 4782, 29898, 13, 462, 1678, 518, 13, 462, 4706, 4833, 29883, 29889, 4775, 703, 2539, 613, 3472, 29918, 1454, 543, 1482, 29899, 1256, 4968, 13, 462, 4706, 4833, 29883, 29889, 4290, 29898, 13, 462, 9651, 1134, 543, 1256, 613, 13, 462, 9651, 1178, 543, 1482, 29899, 1256, 613, 13, 462, 9651, 12983, 543, 10399, 2635, 613, 13, 462, 4706, 10353, 13, 462, 1678, 4514, 13, 18884, 10353, 13, 18884, 2920, 29922, 29953, 29892, 13, 9651, 10353, 13, 4706, 21251, 13, 4706, 883, 29922, 5574, 29892, 13, 1678, 10353, 13, 1678, 396, 11438, 29871, 29906, 29901, 1222, 6269, 895, 13, 1678, 4833, 29883, 29889, 4301, 29898, 13, 4706, 518, 13, 9651, 4833, 29883, 29889, 1625, 29898, 13, 18884, 4833, 29883, 29889, 2500, 4782, 29898, 13, 462, 1678, 518, 13, 462, 4706, 4833, 29883, 29889, 4775, 703, 1170, 310, 15058, 613, 3472, 29918, 1454, 543, 1482, 29899, 978, 4968, 13, 462, 4706, 4833, 29883, 29889, 4290, 29898, 13, 462, 9651, 1134, 543, 726, 613, 13, 462, 9651, 1178, 543, 1482, 29899, 978, 613, 13, 462, 9651, 12983, 543, 1170, 310, 10298, 313, 29872, 29889, 29887, 29889, 525, 29903, 339, 271, 1495, 613, 13, 462, 4706, 10353, 13, 462, 1678, 4514, 13, 18884, 1723, 13, 9651, 1723, 13, 4706, 4514, 13, 1678, 10353, 13, 1678, 396, 11438, 29871, 29941, 29901, 317, 1691, 29892, 337, 567, 29892, 7688, 13, 1678, 4833, 29883, 29889, 4301, 29898, 13, 4706, 518, 13, 9651, 4833, 29883, 29889, 1625, 29898, 13, 18884, 4833, 29883, 29889, 2500, 4782, 29898, 13, 462, 1678, 518, 13, 462, 4706, 4833, 29883, 29889, 4775, 703, 29903, 1691, 613, 3472, 29918, 1454, 543, 1482, 29899, 7224, 4968, 13, 462, 4706, 4833, 29883, 29889, 4290, 29898, 13, 462, 9651, 1134, 543, 4537, 613, 13, 462, 9651, 1178, 543, 1482, 29899, 7224, 613, 13, 462, 9651, 12983, 543, 10399, 1353, 310, 6166, 313, 29872, 29889, 29887, 29889, 525, 29941, 1495, 613, 13, 462, 4706, 10353, 13, 462, 1678, 4514, 13, 18884, 10353, 13, 18884, 2920, 29922, 29946, 29892, 13, 9651, 10353, 13, 9651, 4833, 29883, 29889, 1625, 29898, 13, 18884, 4833, 29883, 29889, 2500, 4782, 29898, 13, 462, 1678, 518, 13, 462, 4706, 4833, 29883, 29889, 4775, 703, 1123, 567, 613, 3472, 29918, 1454, 543, 1482, 29899, 276, 567, 4968, 13, 462, 4706, 4833, 29883, 29889, 4290, 29898, 13, 462, 9651, 1134, 543, 4537, 613, 13, 462, 9651, 1178, 543, 1482, 29899, 276, 567, 613, 13, 462, 9651, 12983, 543, 10399, 278, 1353, 310, 337, 567, 313, 29872, 29889, 29887, 29889, 525, 29896, 29900, 29915, 613, 13, 462, 4706, 10353, 13, 462, 1678, 4514, 13, 18884, 10353, 13, 18884, 2920, 29922, 29946, 29892, 13, 9651, 10353, 13, 9651, 4833, 29883, 29889, 1625, 29898, 13, 18884, 4833, 29883, 29889, 2500, 4782, 29898, 13, 462, 1678, 518, 13, 462, 4706, 4833, 29883, 29889, 4775, 703, 22676, 613, 3472, 29918, 1454, 543, 1482, 29899, 7915, 4968, 13, 462, 4706, 4833, 29883, 29889, 4290, 29898, 13, 462, 9651, 1134, 543, 4537, 613, 13, 462, 9651, 1178, 543, 1482, 29899, 7915, 613, 13, 462, 9651, 12983, 543, 10399, 2635, 613, 13, 462, 4706, 10353, 13, 462, 1678, 4514, 13, 18884, 10353, 13, 18884, 2920, 29922, 29946, 29892, 13, 9651, 10353, 13, 4706, 21251, 13, 4706, 883, 29922, 5574, 29892, 13, 1678, 10353, 13, 1678, 396, 11438, 29871, 29946, 29901, 3323, 2415, 2826, 13, 1678, 4833, 29883, 29889, 4301, 29898, 11140, 29889, 1625, 4197, 13, 4706, 4833, 29883, 29889, 3125, 29898, 333, 2433, 7892, 29899, 8269, 29899, 3092, 742, 29871, 4344, 543, 16228, 14104, 882, 1159, 13, 13, 268, 2314, 511, 13, 1678, 4833, 29883, 29889, 4301, 29898, 11140, 29889, 1625, 4197, 13, 4706, 4833, 29883, 29889, 4775, 29898, 333, 2433, 7892, 29899, 4882, 1495, 13, 1678, 4514, 876, 13, 2314, 13, 13, 13383, 13383, 7346, 4136, 2277, 13, 29937, 2401, 5912, 13, 13383, 13383, 7346, 4136, 2277, 13, 932, 29889, 2680, 353, 3472, 29889, 12596, 4197, 13, 1678, 5912, 29918, 29900, 29896, 29918, 21890, 29892, 13, 1678, 4833, 29883, 29889, 1625, 29898, 1420, 29889, 12596, 4197, 13, 4706, 3472, 29889, 12432, 3285, 13, 4706, 3472, 29889, 29925, 877, 4907, 28862, 2763, 304, 399, 13668, 4522, 29889, 319, 5780, 363, 23110, 278, 6728, 310, 596, 13, 462, 29871, 664, 17718, 4907, 5477, 13, 4706, 4833, 29883, 29889, 4775, 703, 20570, 4968, 13, 4706, 3472, 29889, 12596, 29898, 333, 543, 27309, 29899, 1188, 29899, 2176, 4968, 13, 4706, 3472, 29889, 29950, 29878, 3285, 13, 4706, 3472, 29889, 29925, 703, 3403, 263, 716, 664, 449, 4968, 13, 4706, 5912, 29918, 29900, 29906, 29918, 1287, 449, 29918, 8269, 29892, 13, 4706, 3472, 29889, 29925, 703, 5044, 310, 623, 856, 1159, 13, 1678, 4514, 876, 13, 2314, 13, 13, 13383, 13383, 7346, 4136, 2277, 13, 29937, 2401, 8251, 1627, 29879, 13, 13383, 13383, 7346, 4136, 2277, 13, 29992, 932, 29889, 14035, 29898, 13, 1678, 518, 6466, 703, 7892, 29899, 4882, 613, 376, 11991, 4968, 13, 268, 10604, 703, 27309, 29899, 1188, 29899, 2176, 613, 376, 11991, 1159, 1402, 29871, 13, 1678, 518, 4290, 703, 7892, 29899, 8269, 29899, 3092, 613, 376, 29876, 29918, 3808, 29879, 1159, 1402, 13, 1678, 518, 2792, 703, 1482, 29899, 1256, 613, 376, 1767, 4968, 13, 268, 4306, 703, 1482, 29899, 978, 613, 376, 1767, 4968, 13, 268, 4306, 703, 1482, 29899, 7224, 613, 376, 1767, 4968, 13, 268, 4306, 703, 1482, 29899, 276, 567, 613, 376, 1767, 4968, 13, 268, 4306, 703, 1482, 29899, 7915, 613, 376, 1767, 4968, 13, 268, 4306, 703, 1482, 29899, 1792, 613, 376, 1767, 1159, 2314, 13, 1753, 9752, 29918, 1482, 29918, 8269, 29898, 29876, 29918, 3808, 29879, 29892, 2635, 29892, 1024, 29892, 6166, 29892, 337, 567, 29892, 7688, 29892, 1404, 1125, 13, 1678, 565, 302, 29918, 3808, 29879, 338, 6213, 29901, 13, 4706, 736, 313, 13, 9651, 376, 10923, 2826, 304, 9752, 664, 449, 613, 13, 9651, 11086, 29918, 10467, 29918, 2371, 29898, 27309, 29918, 1188, 9601, 29896, 29962, 13, 4706, 1723, 13, 1678, 1683, 29901, 13, 4706, 281, 397, 29918, 1188, 29889, 649, 29918, 667, 29898, 13, 4706, 10976, 3790, 13, 9651, 525, 978, 2396, 5941, 29918, 726, 29898, 978, 511, 13, 9651, 525, 1256, 2396, 2635, 29892, 13, 9651, 525, 7224, 2396, 6166, 29892, 13, 9651, 525, 276, 567, 2396, 337, 567, 29892, 13, 9651, 525, 7915, 2396, 7688, 29892, 13, 9651, 525, 1792, 2396, 5941, 29918, 726, 29898, 1792, 29897, 13, 9651, 500, 13, 4706, 1723, 13, 4706, 736, 313, 13, 632, 285, 29908, 5531, 449, 13817, 29991, 2431, 15628, 426, 7224, 29913, 310, 426, 978, 29913, 773, 426, 7915, 29913, 301, 5824, 373, 426, 1256, 1836, 613, 13, 632, 11086, 29918, 10467, 29918, 2371, 29898, 27309, 29918, 1188, 9601, 29896, 29962, 13, 4706, 1723, 13, 4706, 13, 13, 13383, 13383, 7346, 4136, 2277, 13, 29937, 7525, 13, 13383, 13383, 7346, 4136, 2277, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 623, 29889, 3389, 29918, 2974, 29898, 13, 4706, 4744, 29922, 5574, 29892, 13, 4706, 3495, 543, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 613, 13, 4706, 2011, 29922, 637, 13, 1678, 1723, 13, 2 ]
python-backend/tests/status/resources/test_mine_status_resource.py
MaxWardle/mds
0
39031
import json from app.api.constants import MINE_STATUS_OPTIONS from tests.constants import TEST_MINE_GUID # GET def test_get_mine_status_option(test_client, auth_headers): get_resp = test_client.get('/mines/status', headers=auth_headers['full_auth_header']) get_data = json.loads(get_resp.data.decode()) assert get_data == {'options': MINE_STATUS_OPTIONS} assert get_resp.status_code == 200 def test_get_mine_status_not_found(test_client, auth_headers): get_resp = test_client.get('/mines/status/' + TEST_MINE_GUID, headers=auth_headers['full_auth_header']) get_data = json.loads(get_resp.data.decode()) assert get_data['error']['message'] == 'Mine Status not found' assert get_resp.status_code == 404
[ 1, 1053, 4390, 13, 13, 3166, 623, 29889, 2754, 29889, 3075, 1934, 1053, 341, 8895, 29918, 27047, 29918, 14094, 27946, 13, 3166, 6987, 29889, 3075, 1934, 1053, 17067, 1254, 29918, 29924, 8895, 29918, 29954, 11150, 13, 13, 13, 29937, 12354, 13, 1753, 1243, 29918, 657, 29918, 24669, 29918, 4882, 29918, 3385, 29898, 1688, 29918, 4645, 29892, 4817, 29918, 13662, 1125, 13, 1678, 679, 29918, 13713, 353, 1243, 29918, 4645, 29889, 657, 11219, 1195, 267, 29914, 4882, 742, 9066, 29922, 5150, 29918, 13662, 1839, 8159, 29918, 5150, 29918, 6672, 11287, 13, 1678, 679, 29918, 1272, 353, 4390, 29889, 18132, 29898, 657, 29918, 13713, 29889, 1272, 29889, 13808, 3101, 13, 1678, 4974, 679, 29918, 1272, 1275, 11117, 6768, 2396, 341, 8895, 29918, 27047, 29918, 14094, 27946, 29913, 13, 1678, 4974, 679, 29918, 13713, 29889, 4882, 29918, 401, 1275, 29871, 29906, 29900, 29900, 13, 13, 13, 1753, 1243, 29918, 657, 29918, 24669, 29918, 4882, 29918, 1333, 29918, 11940, 29898, 1688, 29918, 4645, 29892, 4817, 29918, 13662, 1125, 13, 1678, 679, 29918, 13713, 353, 1243, 29918, 4645, 29889, 657, 11219, 1195, 267, 29914, 4882, 22208, 718, 17067, 1254, 29918, 29924, 8895, 29918, 29954, 11150, 29892, 9066, 29922, 5150, 29918, 13662, 1839, 8159, 29918, 5150, 29918, 6672, 11287, 13, 1678, 679, 29918, 1272, 353, 4390, 29889, 18132, 29898, 657, 29918, 13713, 29889, 1272, 29889, 13808, 3101, 13, 1678, 4974, 679, 29918, 1272, 1839, 2704, 16215, 4906, 2033, 1275, 525, 29924, 457, 16034, 451, 1476, 29915, 13, 1678, 4974, 679, 29918, 13713, 29889, 4882, 29918, 401, 1275, 29871, 29946, 29900, 29946, 13, 2 ]
561. Array Partition I/main.py
Competitive-Programmers-Community/LeetCode
2
102450
class Solution: def arrayPairSum(self, nums): """ :type nums: List[int] :rtype: int """ nums.sort() s=0 for i in range(0,len(nums),2): s+=nums[i] return s
[ 1, 770, 24380, 29901, 13, 1678, 822, 1409, 20547, 11139, 29898, 1311, 29892, 954, 29879, 1125, 13, 4706, 9995, 13, 4706, 584, 1853, 954, 29879, 29901, 2391, 29961, 524, 29962, 13, 4706, 584, 29878, 1853, 29901, 938, 13, 4706, 9995, 13, 4706, 954, 29879, 29889, 6605, 580, 13, 4706, 269, 29922, 29900, 13, 4706, 363, 474, 297, 3464, 29898, 29900, 29892, 2435, 29898, 1949, 29879, 511, 29906, 1125, 13, 9651, 269, 23661, 1949, 29879, 29961, 29875, 29962, 13, 632, 13, 4706, 736, 269, 13, 2 ]
systori/apps/equipment/urls.py
systori/systori
12
8921
<filename>systori/apps/equipment/urls.py from django.conf.urls import url from django.urls import path, include from systori.apps.user.authorization import office_auth from systori.apps.equipment.views import EquipmentListView, EquipmentView, EquipmentCreate, EquipmentDelete, EquipmentUpdate, RefuelingStopCreate, RefuelingStopDelete, RefuelingStopUpdate, MaintenanceCreate, MaintenanceDelete, MaintenanceUpdate urlpatterns = [ # two url rules to make the active_filter keyword optional url( r"^equipment/$", office_auth(EquipmentListView.as_view()), name="equipment.list" ), url( r"^equipment/(?P<active_filter>[\w-]+)$", office_auth(EquipmentListView.as_view()), name="equipment.list", ), url( r"^equipment-(?P<pk>\d+)$", office_auth(EquipmentView.as_view()), name="equipment.view", ), url( r"^create-equipment$", office_auth(EquipmentCreate.as_view()), name="equipment.create", ), url( r"^equipment-(?P<pk>\d+)/edit$", office_auth(EquipmentUpdate.as_view()), name="equipment.edit", ), url( r"^equipment-(?P<pk>\d+)/delete$", office_auth(EquipmentDelete.as_view()), name="equipment.delete", ), url( r"^equipment-(?P<pk>\d+)/create-refueling-stop$", office_auth(RefuelingStopCreate.as_view()), name="refueling_stop.create", ), url( r"^equipment-(?P<equipment_pk>\d+)/refueling-stop-(?P<pk>\d+)/update$", office_auth(RefuelingStopUpdate.as_view()), name="refueling_stop.update", ), url( r"^equipment-(?P<equipment_pk>\d+)/refueling-stop-(?P<pk>\d+)/delete", office_auth(RefuelingStopDelete.as_view()), name="refueling_stop.delete", ), url( r"^equipment-(?P<pk>\d+)/create-maintenance", office_auth(MaintenanceCreate.as_view()), name="maintenance.create", ), url( r"^equipment-(?P<equipment_pk>\d+)/maintenance-(?P<pk>\d+)/update$", office_auth(MaintenanceUpdate.as_view()), name="maintenance.update", ), url( r"^equipment-(?P<equipment_pk>\d+)/maintenance-(?P<pk>\d+)/delete", office_auth(MaintenanceDelete.as_view()), name="maintenance.delete", ), ]
[ 1, 529, 9507, 29958, 29879, 858, 4170, 29914, 13371, 29914, 1686, 666, 358, 29914, 26045, 29889, 2272, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 3166, 9557, 29889, 26045, 1053, 2224, 29892, 3160, 13, 13, 3166, 13107, 4170, 29889, 13371, 29889, 1792, 29889, 8921, 2133, 1053, 8034, 29918, 5150, 13, 3166, 13107, 4170, 29889, 13371, 29889, 1686, 666, 358, 29889, 7406, 1053, 11243, 666, 358, 15660, 29892, 11243, 666, 358, 1043, 29892, 11243, 666, 358, 4391, 29892, 11243, 666, 358, 12498, 29892, 11243, 666, 358, 6422, 29892, 9897, 2491, 292, 16329, 4391, 29892, 9897, 2491, 292, 16329, 12498, 29892, 9897, 2491, 292, 16329, 6422, 29892, 4241, 841, 749, 4391, 29892, 4241, 841, 749, 12498, 29892, 4241, 841, 749, 6422, 13, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 396, 1023, 3142, 6865, 304, 1207, 278, 6136, 29918, 4572, 13553, 13136, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 13346, 613, 8034, 29918, 5150, 29898, 6108, 666, 358, 15660, 29889, 294, 29918, 1493, 25739, 1024, 543, 1686, 666, 358, 29889, 1761, 29908, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29914, 10780, 29925, 29966, 4925, 29918, 4572, 29958, 7110, 29893, 29899, 10062, 1262, 613, 13, 4706, 8034, 29918, 5150, 29898, 6108, 666, 358, 15660, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 1686, 666, 358, 29889, 1761, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 1262, 613, 13, 4706, 8034, 29918, 5150, 29898, 6108, 666, 358, 1043, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 1686, 666, 358, 29889, 1493, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 3258, 29899, 1686, 666, 358, 29938, 613, 13, 4706, 8034, 29918, 5150, 29898, 6108, 666, 358, 4391, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 1686, 666, 358, 29889, 3258, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 5628, 29938, 613, 13, 4706, 8034, 29918, 5150, 29898, 6108, 666, 358, 6422, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 1686, 666, 358, 29889, 5628, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 8143, 29938, 613, 13, 4706, 8034, 29918, 5150, 29898, 6108, 666, 358, 12498, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 1686, 666, 358, 29889, 8143, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 3258, 29899, 999, 2491, 292, 29899, 9847, 29938, 613, 13, 4706, 8034, 29918, 5150, 29898, 5620, 2491, 292, 16329, 4391, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 999, 2491, 292, 29918, 9847, 29889, 3258, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 1686, 666, 358, 29918, 20571, 14247, 29881, 29974, 6802, 999, 2491, 292, 29899, 9847, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 5504, 29938, 613, 13, 4706, 8034, 29918, 5150, 29898, 5620, 2491, 292, 16329, 6422, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 999, 2491, 292, 29918, 9847, 29889, 5504, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 1686, 666, 358, 29918, 20571, 14247, 29881, 29974, 6802, 999, 2491, 292, 29899, 9847, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 8143, 613, 13, 4706, 8034, 29918, 5150, 29898, 5620, 2491, 292, 16329, 12498, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 999, 2491, 292, 29918, 9847, 29889, 8143, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 3258, 29899, 3396, 841, 749, 613, 13, 4706, 8034, 29918, 5150, 29898, 6330, 841, 749, 4391, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 3396, 841, 749, 29889, 3258, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 1686, 666, 358, 29918, 20571, 14247, 29881, 29974, 6802, 3396, 841, 749, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 5504, 29938, 613, 13, 4706, 8034, 29918, 5150, 29898, 6330, 841, 749, 6422, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 3396, 841, 749, 29889, 5504, 613, 13, 1678, 10353, 13, 1678, 3142, 29898, 13, 4706, 364, 29908, 29985, 1686, 666, 358, 29899, 10780, 29925, 29966, 1686, 666, 358, 29918, 20571, 14247, 29881, 29974, 6802, 3396, 841, 749, 29899, 10780, 29925, 29966, 20571, 14247, 29881, 29974, 6802, 8143, 613, 13, 4706, 8034, 29918, 5150, 29898, 6330, 841, 749, 12498, 29889, 294, 29918, 1493, 25739, 13, 4706, 1024, 543, 3396, 841, 749, 29889, 8143, 613, 13, 1678, 10353, 13, 29962, 13, 2 ]
app/core/models.py
echosisdev/openmrs-disa-sync
0
11932
from django.db import models from django.db.models.signals import pre_save, post_save from core.utils.constants import Constants from core.utils.data_convertion import DataConversion class ExcelFile(models.Model): file_name = models.FileField(upload_to='uploads') date_created = models.DateTimeField(auto_now_add=True) activated = models.BooleanField(default=False) def __str__(self): return f'File Id{self.id} File name {self.file_name}' class CsvFile(models.Model): file_name = models.FileField(upload_to='uploads') date_uploaded = models.DateTimeField(auto_now_add=True) activated = models.BooleanField(default=False) def __str__(self): return f'File Id{self.id} File name {self.file_name}' class ViralLoad(models.Model): laboratory_id = models.CharField(max_length=100, null=True, blank=True) sector = models.CharField(max_length=30, blank=True, null=True) number_orig_lab = models.CharField(max_length=100, blank=True, null=True) province = models.CharField(max_length=100, blank=True, null=True) district = models.CharField(max_length=100, blank=True, null=True) health_facility = models.CharField(max_length=100, blank=True, null=True) patient_name = models.CharField(max_length=100, blank=True, null=True) gender = models.CharField(max_length=100, blank=True, null=True) reference = models.CharField(max_length=100, blank=True, null=True) capture_date = models.DateField(null=True, blank=True) access_date = models.DateField(null=True, blank=True) nid = models.CharField(max_length=100, blank=True, null=True) viral_load = models.CharField(max_length=100, null=True, blank=True) viral_load_qualitative = models.CharField( max_length=100, blank=True, null=True) synced = models.BooleanField(default=False) formatted_nid = models.CharField(max_length=100, blank=True, null=True) class Meta: verbose_name = 'Viral Load' verbose_name_plural = 'Viral Loads' def __str__(self): return self.patient_name class Patient(models.Model): patient_uuid = models.CharField(max_length=500) #person_id = models.IntegerField() nid = models.CharField(max_length=100, blank=True, null=True) patient_name = models.CharField(max_length=100, blank=True, null=True) def __str__(self): return self.patient_name class Encounter(models.Model): encounterDatetime = models.DateTimeField(auto_now_add=True) patient = models.ForeignKey(Patient, on_delete=models.CASCADE) encounterType_uuid = models.CharField( max_length=255, default=Constants().get_uuids().get('encounter_type')) location_uuid = models.CharField( max_length=255, default=Constants().get_uuids().get('hpt')) form_uuid = models.CharField( max_length=255, default=Constants().get_uuids().get('form')) synced = models.BooleanField(default=False) def __str__(self): return self.patient.name class Observation(models.Model): patient = models.ForeignKey( Patient, on_delete=models.CASCADE) obsDateTime = models.DateTimeField(auto_now_add=True) concept = models.CharField(max_length=255) value_numeric = models.PositiveIntegerField(null=True, blank=True) value_coded = models.PositiveIntegerField(null=True, blank=True) value_datetime = models.DateTimeField(null=True, blank=True) encounter = models.ForeignKey(Encounter, on_delete=models.CASCADE) location = models.CharField( max_length=255, default=Constants().get_uuids().get('hpt')) value = models.CharField(max_length=255) voided = models.BooleanField(default=False) synced = models.BooleanField(default=False) def __str__(self): return self.id # def insert_formatted_nid(sender, instance, created, *args, **kwargs): # if created: # instance.formatted_nid = DataConversion.format_nid(instance.nid) # print(instance.formatted_nid) # post_save.connect(insert_formatted_nid, sender=ViralLoad)
[ 1, 515, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 2585, 29889, 9794, 29889, 4530, 1338, 1053, 758, 29918, 7620, 29892, 1400, 29918, 7620, 13, 13, 3166, 7136, 29889, 13239, 29889, 3075, 1934, 1053, 5798, 1934, 13, 3166, 7136, 29889, 13239, 29889, 1272, 29918, 13441, 291, 1053, 3630, 1168, 3259, 13, 13, 13, 1990, 11388, 2283, 29898, 9794, 29889, 3195, 1125, 13, 1678, 934, 29918, 978, 353, 4733, 29889, 2283, 3073, 29898, 9009, 29918, 517, 2433, 9009, 29879, 1495, 13, 1678, 2635, 29918, 11600, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 5039, 630, 353, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 285, 29915, 2283, 5163, 29912, 1311, 29889, 333, 29913, 3497, 1024, 426, 1311, 29889, 1445, 29918, 978, 10162, 13, 13, 13, 1990, 315, 4501, 2283, 29898, 9794, 29889, 3195, 1125, 13, 1678, 934, 29918, 978, 353, 4733, 29889, 2283, 3073, 29898, 9009, 29918, 517, 2433, 9009, 29879, 1495, 13, 1678, 2635, 29918, 9009, 287, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 5039, 630, 353, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 285, 29915, 2283, 5163, 29912, 1311, 29889, 333, 29913, 3497, 1024, 426, 1311, 29889, 1445, 29918, 978, 10162, 13, 13, 13, 1990, 6749, 284, 5896, 29898, 9794, 29889, 3195, 1125, 13, 1678, 10212, 7606, 29918, 333, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 1870, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 17535, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29941, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 1353, 29918, 12683, 29918, 8205, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 12291, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 6474, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 9045, 29918, 17470, 1793, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 16500, 29918, 978, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 23346, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 3407, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 10446, 29918, 1256, 353, 4733, 29889, 2539, 3073, 29898, 4304, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 2130, 29918, 1256, 353, 4733, 29889, 2539, 3073, 29898, 4304, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 302, 333, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 10636, 284, 29918, 1359, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 1870, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 10636, 284, 29918, 1359, 29918, 15380, 23378, 353, 4733, 29889, 27890, 29898, 13, 4706, 4236, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 5222, 1133, 353, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 8824, 29897, 13, 1678, 20917, 29918, 29876, 333, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 26952, 29918, 978, 353, 525, 29963, 19647, 16012, 29915, 13, 4706, 26952, 29918, 978, 29918, 572, 3631, 353, 525, 29963, 19647, 4309, 7925, 29915, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 5031, 993, 29918, 978, 13, 13, 13, 1990, 4121, 993, 29898, 9794, 29889, 3195, 1125, 13, 1678, 16500, 29918, 25118, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29945, 29900, 29900, 29897, 13, 1678, 396, 10532, 29918, 333, 353, 4733, 29889, 7798, 3073, 580, 13, 1678, 302, 333, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 16500, 29918, 978, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 5031, 993, 29918, 978, 13, 13, 13, 1990, 11346, 5336, 29898, 9794, 29889, 3195, 1125, 13, 1678, 11735, 16390, 5410, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 16500, 353, 4733, 29889, 27755, 2558, 29898, 11457, 993, 29892, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29897, 13, 1678, 11735, 1542, 29918, 25118, 353, 4733, 29889, 27890, 29898, 13, 4706, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 2322, 29922, 26570, 2141, 657, 29918, 29884, 29884, 4841, 2141, 657, 877, 3977, 5336, 29918, 1853, 8785, 13, 1678, 4423, 29918, 25118, 353, 4733, 29889, 27890, 29898, 13, 4706, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 2322, 29922, 26570, 2141, 657, 29918, 29884, 29884, 4841, 2141, 657, 877, 29882, 415, 8785, 13, 1678, 883, 29918, 25118, 353, 4733, 29889, 27890, 29898, 13, 4706, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 2322, 29922, 26570, 2141, 657, 29918, 29884, 29884, 4841, 2141, 657, 877, 689, 8785, 13, 1678, 5222, 1133, 353, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 5031, 993, 29889, 978, 13, 13, 13, 1990, 21651, 362, 29898, 9794, 29889, 3195, 1125, 13, 1678, 16500, 353, 4733, 29889, 27755, 2558, 29898, 13, 4706, 4121, 993, 29892, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29897, 13, 1678, 20881, 11384, 353, 4733, 29889, 11384, 3073, 29898, 6921, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 6964, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29897, 13, 1678, 995, 29918, 21574, 353, 4733, 29889, 9135, 3321, 7798, 3073, 29898, 4304, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 995, 29918, 29659, 353, 4733, 29889, 9135, 3321, 7798, 3073, 29898, 4304, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 995, 29918, 12673, 353, 4733, 29889, 11384, 3073, 29898, 4304, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 11735, 353, 4733, 29889, 27755, 2558, 29898, 8566, 5336, 29892, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29897, 13, 1678, 4423, 353, 4733, 29889, 27890, 29898, 13, 4706, 4236, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 2322, 29922, 26570, 2141, 657, 29918, 29884, 29884, 4841, 2141, 657, 877, 29882, 415, 8785, 13, 1678, 995, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29897, 13, 1678, 1780, 287, 353, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 8824, 29897, 13, 1678, 5222, 1133, 353, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 8824, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 333, 13, 13, 13, 29937, 822, 4635, 29918, 689, 19667, 29918, 29876, 333, 29898, 15452, 29892, 2777, 29892, 2825, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 29937, 268, 565, 2825, 29901, 13, 29937, 308, 2777, 29889, 689, 19667, 29918, 29876, 333, 353, 3630, 1168, 3259, 29889, 4830, 29918, 29876, 333, 29898, 8758, 29889, 29876, 333, 29897, 13, 29937, 308, 1596, 29898, 8758, 29889, 689, 19667, 29918, 29876, 333, 29897, 13, 13, 13, 29937, 1400, 29918, 7620, 29889, 6915, 29898, 7851, 29918, 689, 19667, 29918, 29876, 333, 29892, 10004, 29922, 29963, 19647, 5896, 29897, 13, 2 ]
karte.py
goodmanjonathan/kattis-problems
0
52183
<filename>karte.py import sys def replicate(n, x): ret = [] for _ in range(n): ret.append(x) return ret line = input() cards = replicate(53, False) for i in range(0, len(line), 3): card_num = int(line[i+1:i+3]) offset = 0 if line[i] == 'P': pass elif line[i] == 'K': offset = 13 elif line[i] == 'H': offset = 26 else: offset = 39 if cards[offset + card_num] is True: print("GRESKA") sys.exit(0) else: cards[offset + card_num] = True suits = [cards[1:14], cards[14:27], cards[27:40], cards[40:53]] for (idx, suit) in enumerate(suits): if idx != 0: print(end=" ") print(len(list(filter(lambda card: card is False, suit))), end="") print()
[ 1, 529, 9507, 29958, 5689, 371, 29889, 2272, 13, 5215, 10876, 13, 13, 1753, 1634, 5926, 29898, 29876, 29892, 921, 1125, 13, 1678, 3240, 353, 5159, 13, 1678, 363, 903, 297, 3464, 29898, 29876, 1125, 13, 4706, 3240, 29889, 4397, 29898, 29916, 29897, 13, 1678, 736, 3240, 13, 13, 1220, 353, 1881, 580, 13, 28160, 353, 1634, 5926, 29898, 29945, 29941, 29892, 7700, 29897, 13, 13, 1454, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 1220, 511, 29871, 29941, 1125, 13, 1678, 5881, 29918, 1949, 353, 938, 29898, 1220, 29961, 29875, 29974, 29896, 29901, 29875, 29974, 29941, 2314, 13, 13, 1678, 9210, 353, 29871, 29900, 13, 1678, 565, 1196, 29961, 29875, 29962, 1275, 525, 29925, 2396, 13, 4706, 1209, 13, 1678, 25342, 1196, 29961, 29875, 29962, 1275, 525, 29968, 2396, 13, 4706, 9210, 353, 29871, 29896, 29941, 13, 1678, 25342, 1196, 29961, 29875, 29962, 1275, 525, 29950, 2396, 13, 4706, 9210, 353, 29871, 29906, 29953, 13, 1678, 1683, 29901, 13, 4706, 9210, 353, 29871, 29941, 29929, 13, 13, 1678, 565, 15889, 29961, 10289, 718, 5881, 29918, 1949, 29962, 338, 5852, 29901, 13, 4706, 1596, 703, 29954, 15989, 29968, 29909, 1159, 13, 4706, 10876, 29889, 13322, 29898, 29900, 29897, 13, 1678, 1683, 29901, 13, 4706, 15889, 29961, 10289, 718, 5881, 29918, 1949, 29962, 353, 5852, 13, 13, 2146, 1169, 353, 518, 28160, 29961, 29896, 29901, 29896, 29946, 1402, 15889, 29961, 29896, 29946, 29901, 29906, 29955, 1402, 15889, 29961, 29906, 29955, 29901, 29946, 29900, 1402, 15889, 29961, 29946, 29900, 29901, 29945, 29941, 5262, 13, 1454, 313, 13140, 29892, 14726, 29897, 297, 26985, 29898, 2146, 1169, 1125, 13, 1678, 565, 22645, 2804, 29871, 29900, 29901, 13, 4706, 1596, 29898, 355, 543, 16521, 13, 1678, 1596, 29898, 2435, 29898, 1761, 29898, 4572, 29898, 2892, 5881, 29901, 5881, 338, 7700, 29892, 14726, 876, 511, 1095, 543, 1159, 13, 2158, 580, 13, 13, 2 ]
glmsingle/utils/robustrange.py
gretatuckute/GLMsingle
35
78064
<gh_stars>10-100 import numpy as np def robustrange(m): """ robustrange(m) <m> is an array figure out a reasonable range for the values in <m>, that is, one that tries to include as many of the values as possible, but also tries to exclude the effects of potential outliers (so that we don't get a really large range). see the code for specific details on how we do this. return: <f> as [<mn> <mx>] <mn> as the minimum value of the range <mx> as the maximum value of the range example: import matplotlib.pyplot as plt x = np.random.randn(10000)**2 plt.hist(x,100) rng = robustrange(x)[0] plt.plot( [rng[0], rng[0]], plt.ylim(), color='r', linestyle='-', linewidth=2) plt.plot( [rng[1], rng[1]], plt.ylim(), color='r', linestyle='-', linewidth=2) plt.title(f'range is {rng[0]:.20f} {rng[1]:.20f}') """ # absolute min and max absmn = np.min(m.flatten()) absmx = np.max(m.flatten()) # percentiles vals = np.percentile(m.flatten(), [.1, 10, 50, 90, 99.9]) # percentile-based min and max pmn = vals[2] - 5*(vals[2]-vals[1]) pmx = vals[2] + 5*(vals[3]-vals[2]) # whether to rerun (recursively) rerun = 0 # deal with max if vals[4] <= pmx: # if the 99.9 is reasonably small, use it if absmx <= vals[2] + 1.1*(vals[4]-vals[2]): # actually, if the absolute max isn't too big, use that finalmx = absmx else: finalmx = vals[4] else: # hmm, something is funny. probably there are outliers. # let's chop off and re-run. rerun = 1 m = m[np.logical_not(m > pmx)] # deal with min if vals[0] >= pmn: if absmn >= vals[2] - 1.1*(vals[2]-vals[0]): finalmn = absmn else: finalmn = vals[0] else: rerun = 1 m = m[np.logical_not(m < pmn)] # rerun without outliers and output if rerun: f, mn, mx = robustrange(m) return f, mn, mx else: f = [finalmn, finalmx] mn = finalmn mx = finalmx return f, mx, mn
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 5215, 12655, 408, 7442, 13, 13, 13, 1753, 16424, 3881, 29898, 29885, 1125, 13, 1678, 9995, 13, 268, 16424, 3881, 29898, 29885, 29897, 13, 13, 268, 529, 29885, 29958, 338, 385, 1409, 13, 13, 268, 4377, 714, 263, 15590, 3464, 363, 278, 1819, 297, 529, 29885, 10202, 13, 268, 393, 338, 29892, 697, 393, 14335, 304, 3160, 408, 1784, 310, 278, 1819, 13, 268, 408, 1950, 29892, 541, 884, 14335, 304, 19060, 278, 9545, 310, 7037, 13, 268, 714, 27801, 313, 578, 393, 591, 1016, 29915, 29873, 679, 263, 2289, 2919, 3464, 467, 13, 268, 1074, 278, 775, 363, 2702, 4902, 373, 920, 591, 437, 445, 29889, 13, 13, 268, 736, 29901, 13, 418, 529, 29888, 29958, 408, 518, 29966, 23521, 29958, 529, 16838, 29958, 29962, 13, 418, 529, 23521, 29958, 408, 278, 9212, 995, 310, 278, 3464, 13, 418, 529, 16838, 29958, 408, 278, 7472, 995, 310, 278, 3464, 13, 13, 268, 1342, 29901, 13, 268, 1053, 22889, 29889, 2272, 5317, 408, 14770, 13, 268, 921, 353, 7442, 29889, 8172, 29889, 9502, 29876, 29898, 29896, 29900, 29900, 29900, 29900, 29897, 1068, 29906, 13, 268, 14770, 29889, 29882, 391, 29898, 29916, 29892, 29896, 29900, 29900, 29897, 13, 268, 364, 865, 353, 16424, 3881, 29898, 29916, 9601, 29900, 29962, 13, 268, 14770, 29889, 5317, 29898, 13, 308, 518, 29878, 865, 29961, 29900, 1402, 364, 865, 29961, 29900, 20526, 13, 308, 14770, 29889, 29891, 2576, 3285, 13, 308, 2927, 2433, 29878, 742, 13, 308, 6276, 342, 1508, 2433, 29899, 742, 13, 308, 1196, 2103, 29922, 29906, 29897, 13, 268, 14770, 29889, 5317, 29898, 13, 308, 518, 29878, 865, 29961, 29896, 1402, 364, 865, 29961, 29896, 20526, 13, 308, 14770, 29889, 29891, 2576, 3285, 13, 308, 2927, 2433, 29878, 742, 13, 308, 6276, 342, 1508, 2433, 29899, 742, 13, 308, 1196, 2103, 29922, 29906, 29897, 13, 268, 14770, 29889, 3257, 29898, 29888, 29915, 3881, 338, 426, 29878, 865, 29961, 29900, 5387, 29889, 29906, 29900, 29888, 29913, 426, 29878, 865, 29961, 29896, 5387, 29889, 29906, 29900, 29888, 29913, 1495, 13, 13, 1678, 9995, 13, 1678, 396, 8380, 1375, 322, 4236, 13, 13, 1678, 633, 3844, 29876, 353, 7442, 29889, 1195, 29898, 29885, 29889, 1579, 8606, 3101, 13, 1678, 633, 3844, 29916, 353, 7442, 29889, 3317, 29898, 29885, 29889, 1579, 8606, 3101, 13, 13, 1678, 396, 10151, 5475, 13, 1678, 659, 29879, 353, 7442, 29889, 25376, 488, 29898, 29885, 29889, 1579, 8606, 3285, 518, 29889, 29896, 29892, 29871, 29896, 29900, 29892, 29871, 29945, 29900, 29892, 29871, 29929, 29900, 29892, 29871, 29929, 29929, 29889, 29929, 2314, 13, 13, 1678, 396, 10151, 488, 29899, 6707, 1375, 322, 4236, 13, 1678, 282, 23521, 353, 659, 29879, 29961, 29906, 29962, 448, 29871, 29945, 16395, 791, 29879, 29961, 29906, 29962, 29899, 791, 29879, 29961, 29896, 2314, 13, 1678, 282, 16838, 353, 659, 29879, 29961, 29906, 29962, 718, 29871, 29945, 16395, 791, 29879, 29961, 29941, 29962, 29899, 791, 29879, 29961, 29906, 2314, 13, 13, 1678, 396, 3692, 304, 364, 261, 348, 313, 3757, 1295, 3598, 29897, 13, 1678, 364, 261, 348, 353, 29871, 29900, 13, 13, 1678, 396, 5376, 411, 4236, 13, 1678, 565, 659, 29879, 29961, 29946, 29962, 5277, 282, 16838, 29901, 29871, 396, 565, 278, 29871, 29929, 29929, 29889, 29929, 338, 2769, 2197, 2319, 29892, 671, 372, 13, 4706, 565, 633, 3844, 29916, 5277, 659, 29879, 29961, 29906, 29962, 718, 29871, 29896, 29889, 29896, 16395, 791, 29879, 29961, 29946, 29962, 29899, 791, 29879, 29961, 29906, 29962, 1125, 13, 9651, 396, 2869, 29892, 565, 278, 8380, 4236, 3508, 29915, 29873, 2086, 4802, 29892, 671, 393, 13, 9651, 2186, 16838, 353, 633, 3844, 29916, 13, 4706, 1683, 29901, 13, 9651, 2186, 16838, 353, 659, 29879, 29961, 29946, 29962, 13, 13, 1678, 1683, 29901, 13, 4706, 396, 298, 4317, 29892, 1554, 338, 2090, 1460, 29889, 29871, 3117, 727, 526, 714, 27801, 29889, 13, 4706, 396, 1235, 29915, 29879, 521, 459, 1283, 322, 337, 29899, 3389, 29889, 13, 4706, 364, 261, 348, 353, 29871, 29896, 13, 4706, 286, 353, 286, 29961, 9302, 29889, 1188, 936, 29918, 1333, 29898, 29885, 1405, 282, 16838, 4638, 13, 13, 1678, 396, 5376, 411, 1375, 13, 1678, 565, 659, 29879, 29961, 29900, 29962, 6736, 282, 23521, 29901, 13, 4706, 565, 633, 3844, 29876, 6736, 659, 29879, 29961, 29906, 29962, 448, 29871, 29896, 29889, 29896, 16395, 791, 29879, 29961, 29906, 29962, 29899, 791, 29879, 29961, 29900, 29962, 1125, 13, 9651, 2186, 23521, 353, 633, 3844, 29876, 13, 4706, 1683, 29901, 13, 9651, 2186, 23521, 353, 659, 29879, 29961, 29900, 29962, 13, 13, 1678, 1683, 29901, 13, 4706, 364, 261, 348, 353, 29871, 29896, 13, 4706, 286, 353, 286, 29961, 9302, 29889, 1188, 936, 29918, 1333, 29898, 29885, 529, 282, 23521, 4638, 13, 13, 1678, 396, 364, 261, 348, 1728, 714, 27801, 322, 1962, 13, 1678, 565, 364, 261, 348, 29901, 13, 4706, 285, 29892, 28597, 29892, 286, 29916, 353, 16424, 3881, 29898, 29885, 29897, 13, 4706, 736, 285, 29892, 28597, 29892, 286, 29916, 13, 1678, 1683, 29901, 13, 4706, 285, 353, 518, 8394, 23521, 29892, 2186, 16838, 29962, 13, 4706, 28597, 353, 2186, 23521, 13, 4706, 286, 29916, 353, 2186, 16838, 13, 4706, 736, 285, 29892, 286, 29916, 29892, 28597, 13, 2 ]
directory/factories.py
arogachev/dgtt
0
94888
<reponame>arogachev/dgtt from functools import reduce from random import randint from django.contrib.gis.geos import Point import factory from faker.providers import BaseProvider from .models import Building, Category, Organization LOCALE = 'ru_RU' class CoordinatesProvider(BaseProvider): CENTER_COORDINATES = (54.873950, 69.152105) RADIUS = 5 def coordinates(self): latitude = factory.Faker('geo_coordinate', center=self.CENTER_COORDINATES[0], radius=self.RADIUS).generate({}) longitude = factory.Faker('geo_coordinate', center=self.CENTER_COORDINATES[1], radius=self.RADIUS).generate({}) return Point((latitude, longitude)) class CategoryProvider(BaseProvider): WORDS_COUNT_MIN = 1 WORDS_COUNT_MAX = 3 INSTANCES_COUNT_MIN = 1 INSTANCES_COUNT_MAX = 3 def __init__(self, generator): super().__init__(generator) self._iterator = factory.Iterator(Category.objects.order_by('pk').all()) def category_name(self): words_count = randint(self.WORDS_COUNT_MIN, self.WORDS_COUNT_MAX) words = factory.Faker('words', nb=words_count).generate({}) return ' '.join(words).capitalize() def category_instances(self): count = randint(self.INSTANCES_COUNT_MIN, self.INSTANCES_COUNT_MAX) return tuple(self._iterator.evaluate(None, None, None) for _ in range(count)) class PhonesProvider(BaseProvider): COUNT_MIN = 1 COUNT_MAX = 3 def phones(self): count = randint(self.COUNT_MIN, self.COUNT_MAX) return [factory.Faker('phone_number').generate({}) for _ in range(count)] factory.Faker._DEFAULT_LOCALE = LOCALE factory.Faker.add_provider(CoordinatesProvider) factory.Faker.add_provider(CategoryProvider) factory.Faker.add_provider(PhonesProvider) class BuildingFactory(factory.django.DjangoModelFactory): class Meta: model = Building address = factory.Faker('address') coordinates = factory.Faker('coordinates') class CategoryFactory(factory.django.DjangoModelFactory): class Meta: model = Category name = factory.Faker('category_name') @classmethod def create_batch_tree(cls, children_per_level): items_per_level = tuple( reduce(lambda x, y: x * y, children_per_level[:level + 1]) for level, _ in enumerate(children_per_level) ) categories_map = {level: [] for level, _ in enumerate(children_per_level)} prev_level_items_count = 0 for level, items_count in enumerate(items_per_level): prev_level = level - 1 for item_number in range(items_count): category = CategoryFactory.build() if prev_level >= 0: category.parent = categories_map[prev_level][item_number % prev_level_items_count] category.save() categories_map[level].append(category) prev_level_items_count = items_count class OrganizationFactory(factory.django.DjangoModelFactory): class Meta: model = Organization name = factory.Faker('company') phones = factory.Faker('phones') building = factory.Iterator(Building.objects.order_by('pk').all()) @classmethod def create_batch(cls, size, **kwargs): return [cls.create(categories=factory.Faker('category_instances'), **kwargs) for _ in range(size)] @factory.post_generation def categories(self, create, extracted, **kwargs): if not create: return if extracted: for category in extracted: self.categories.add(category)
[ 1, 529, 276, 1112, 420, 29958, 279, 468, 1829, 29894, 29914, 20726, 698, 13, 3166, 2090, 312, 8789, 1053, 10032, 13, 3166, 4036, 1053, 20088, 524, 13, 13, 3166, 9557, 29889, 21570, 29889, 29887, 275, 29889, 479, 359, 1053, 8984, 13, 5215, 12529, 13, 3166, 285, 5790, 29889, 771, 29454, 1053, 7399, 6980, 13, 13, 3166, 869, 9794, 1053, 17166, 29892, 17943, 29892, 9205, 2133, 13, 13, 3927, 5454, 1307, 353, 525, 582, 29918, 28283, 29915, 13, 13, 13, 1990, 3189, 24266, 6980, 29898, 5160, 6980, 1125, 13, 1678, 315, 3919, 1001, 29918, 3217, 25593, 1177, 1299, 2890, 353, 313, 29945, 29946, 29889, 29947, 29955, 29941, 29929, 29945, 29900, 29892, 29871, 29953, 29929, 29889, 29896, 29945, 29906, 29896, 29900, 29945, 29897, 13, 1678, 390, 3035, 29902, 3308, 353, 29871, 29945, 13, 13, 1678, 822, 10350, 29898, 1311, 1125, 13, 4706, 26271, 353, 12529, 29889, 29943, 5790, 877, 24756, 29918, 29302, 742, 4818, 29922, 1311, 29889, 29907, 3919, 1001, 29918, 3217, 25593, 1177, 1299, 2890, 29961, 29900, 1402, 11855, 29922, 1311, 29889, 29934, 3035, 29902, 3308, 467, 17158, 3319, 1800, 13, 4706, 28745, 353, 12529, 29889, 29943, 5790, 877, 24756, 29918, 29302, 742, 4818, 29922, 1311, 29889, 29907, 3919, 1001, 29918, 3217, 25593, 1177, 1299, 2890, 29961, 29896, 1402, 11855, 29922, 1311, 29889, 29934, 3035, 29902, 3308, 467, 17158, 3319, 1800, 13, 4706, 736, 8984, 3552, 5066, 4279, 29892, 28745, 876, 13, 13, 13, 1990, 17943, 6980, 29898, 5160, 6980, 1125, 13, 1678, 399, 1955, 8452, 29918, 18736, 29918, 16173, 353, 29871, 29896, 13, 1678, 399, 1955, 8452, 29918, 18736, 29918, 12648, 353, 29871, 29941, 13, 13, 1678, 2672, 1254, 2190, 27266, 29918, 18736, 29918, 16173, 353, 29871, 29896, 13, 1678, 2672, 1254, 2190, 27266, 29918, 18736, 29918, 12648, 353, 29871, 29941, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 15299, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 27959, 29897, 13, 4706, 1583, 3032, 17609, 353, 12529, 29889, 20277, 29898, 10900, 29889, 12650, 29889, 2098, 29918, 1609, 877, 20571, 2824, 497, 3101, 13, 13, 1678, 822, 7663, 29918, 978, 29898, 1311, 1125, 13, 4706, 3838, 29918, 2798, 353, 20088, 524, 29898, 1311, 29889, 11686, 8452, 29918, 18736, 29918, 16173, 29892, 1583, 29889, 11686, 8452, 29918, 18736, 29918, 12648, 29897, 13, 4706, 3838, 353, 12529, 29889, 29943, 5790, 877, 9303, 742, 302, 29890, 29922, 9303, 29918, 2798, 467, 17158, 3319, 1800, 13, 4706, 736, 525, 15300, 7122, 29898, 9303, 467, 5030, 2410, 675, 580, 13, 13, 1678, 822, 7663, 29918, 2611, 2925, 29898, 1311, 1125, 13, 4706, 2302, 353, 20088, 524, 29898, 1311, 29889, 25580, 2190, 27266, 29918, 18736, 29918, 16173, 29892, 1583, 29889, 25580, 2190, 27266, 29918, 18736, 29918, 12648, 29897, 13, 4706, 736, 18761, 29898, 1311, 3032, 17609, 29889, 24219, 403, 29898, 8516, 29892, 6213, 29892, 6213, 29897, 363, 903, 297, 3464, 29898, 2798, 876, 13, 13, 13, 1990, 1963, 2873, 6980, 29898, 5160, 6980, 1125, 13, 1678, 21122, 29918, 16173, 353, 29871, 29896, 13, 1678, 21122, 29918, 12648, 353, 29871, 29941, 13, 13, 1678, 822, 1374, 2873, 29898, 1311, 1125, 13, 4706, 2302, 353, 20088, 524, 29898, 1311, 29889, 18736, 29918, 16173, 29892, 1583, 29889, 18736, 29918, 12648, 29897, 13, 4706, 736, 518, 14399, 29889, 29943, 5790, 877, 6710, 29918, 4537, 2824, 17158, 3319, 1800, 363, 903, 297, 3464, 29898, 2798, 4638, 13, 13, 13, 14399, 29889, 29943, 5790, 3032, 23397, 29918, 3927, 5454, 1307, 353, 11247, 5454, 1307, 13, 14399, 29889, 29943, 5790, 29889, 1202, 29918, 18121, 29898, 7967, 24266, 6980, 29897, 13, 14399, 29889, 29943, 5790, 29889, 1202, 29918, 18121, 29898, 10900, 6980, 29897, 13, 14399, 29889, 29943, 5790, 29889, 1202, 29918, 18121, 29898, 4819, 2873, 6980, 29897, 13, 13, 13, 1990, 17166, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 17166, 13, 13, 1678, 3211, 353, 12529, 29889, 29943, 5790, 877, 7328, 1495, 13, 1678, 10350, 353, 12529, 29889, 29943, 5790, 877, 1111, 24266, 1495, 13, 13, 13, 1990, 17943, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 17943, 13, 13, 1678, 1024, 353, 12529, 29889, 29943, 5790, 877, 7320, 29918, 978, 1495, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 1653, 29918, 16175, 29918, 8336, 29898, 25932, 29892, 4344, 29918, 546, 29918, 5563, 1125, 13, 4706, 4452, 29918, 546, 29918, 5563, 353, 18761, 29898, 13, 9651, 10032, 29898, 2892, 921, 29892, 343, 29901, 921, 334, 343, 29892, 4344, 29918, 546, 29918, 5563, 7503, 5563, 718, 29871, 29896, 2314, 13, 9651, 363, 3233, 29892, 903, 297, 26985, 29898, 11991, 29918, 546, 29918, 5563, 29897, 13, 4706, 1723, 13, 4706, 13997, 29918, 1958, 353, 426, 5563, 29901, 5159, 363, 3233, 29892, 903, 297, 26985, 29898, 11991, 29918, 546, 29918, 5563, 2915, 13, 4706, 12379, 29918, 5563, 29918, 7076, 29918, 2798, 353, 29871, 29900, 13, 13, 4706, 363, 3233, 29892, 4452, 29918, 2798, 297, 26985, 29898, 7076, 29918, 546, 29918, 5563, 1125, 13, 9651, 12379, 29918, 5563, 353, 3233, 448, 29871, 29896, 13, 13, 9651, 363, 2944, 29918, 4537, 297, 3464, 29898, 7076, 29918, 2798, 1125, 13, 18884, 7663, 353, 17943, 5126, 29889, 4282, 580, 13, 13, 18884, 565, 12379, 29918, 5563, 6736, 29871, 29900, 29901, 13, 462, 1678, 7663, 29889, 3560, 353, 13997, 29918, 1958, 29961, 16304, 29918, 5563, 3816, 667, 29918, 4537, 1273, 12379, 29918, 5563, 29918, 7076, 29918, 2798, 29962, 13, 13, 18884, 7663, 29889, 7620, 580, 13, 18884, 13997, 29918, 1958, 29961, 5563, 1822, 4397, 29898, 7320, 29897, 13, 13, 9651, 12379, 29918, 5563, 29918, 7076, 29918, 2798, 353, 4452, 29918, 2798, 13, 13, 13, 1990, 9205, 2133, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 9205, 2133, 13, 13, 1678, 1024, 353, 12529, 29889, 29943, 5790, 877, 14518, 1495, 13, 1678, 1374, 2873, 353, 12529, 29889, 29943, 5790, 877, 561, 2873, 1495, 13, 1678, 5214, 353, 12529, 29889, 20277, 29898, 8893, 292, 29889, 12650, 29889, 2098, 29918, 1609, 877, 20571, 2824, 497, 3101, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 1653, 29918, 16175, 29898, 25932, 29892, 2159, 29892, 3579, 19290, 1125, 13, 4706, 736, 518, 25932, 29889, 3258, 29898, 20683, 29922, 14399, 29889, 29943, 5790, 877, 7320, 29918, 2611, 2925, 5477, 3579, 19290, 29897, 363, 903, 297, 3464, 29898, 2311, 4638, 13, 13, 1678, 732, 14399, 29889, 2490, 29918, 4738, 362, 13, 1678, 822, 13997, 29898, 1311, 29892, 1653, 29892, 23892, 29892, 3579, 19290, 1125, 13, 4706, 565, 451, 1653, 29901, 13, 9651, 736, 13, 13, 4706, 565, 23892, 29901, 13, 9651, 363, 7663, 297, 23892, 29901, 13, 18884, 1583, 29889, 20683, 29889, 1202, 29898, 7320, 29897, 13, 2 ]
flashpandas/__init__.py
MaxTechniche/flash-pandas
0
135779
<reponame>MaxTechniche/flash-pandas<filename>flashpandas/__init__.py<gh_stars>0 import time import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from flask import session from dash.dependencies import Output, State, Input from .app import APP, users, cards from .pages import home, learn, test, login, signup, search, create, signout, profile app = APP server = app.server my_blue = "#C8E4F4" user_details = html.Div(id="user-details", style={"display": "none"}) url = dcc.Location(id="url") navbar = dbc.NavbarSimple( children=[ dbc.NavLink("Cards", href="/cards"), # dbc.NavLink('Test', href='/test'), dbc.NavLink("Create", href="/create", disabled=True, id="create-link"), dbc.DropdownMenu( children=[ dbc.DropdownMenuItem("Login", href="/login"), dbc.DropdownMenuItem("Create Account", href="/signup"), ], id="account-dropdown", label="Account", nav=True, style={"margin-right": "20px"}, ), ], brand="Flash-Pandas", brand_href="/", sticky="top", style={"margin": "0px", "margin-left": "20px", "margin-right": "20px"}, ) page = html.Div(id="page-content", style={"margin": "1rem"}) footer = dbc.Col( [ "Built by <NAME> with Dash.", html.Div( [ html.A( dbc.Button( "YouTube", id="youtube", color="danger", outline=True, size="sm" ), href="https://youtube.com/MaxTechniche", style={"margin": "1%"}, ), html.A( dbc.Button( "GitHub", id="github", color="dark", outline=True, size="sm" ), href="https://github.com/MaxTechniche", style={"margin": "1%"}, ), ], style={"margin-top": "5px"}, ), ], style={"text-align": "center", "margin-bottom": "15px"}, ) app.layout = dbc.Container( [user_details, url, navbar, page, footer], style={"word-wrap": "break-word", "position": "relative", "min-height": "95vh"}, ) @app.callback( [ Output("create-link", "disabled"), Output("account-dropdown", "children"), Output("page-content", "children"), ], Input("url", "pathname"), ) def display_page(pathname): n_layout = None if pathname == "/": n_layout = [home.layout] if pathname == "/login": if session.get("username", None): n_layout = [login.logged_in_layout] else: n_layout = [login.logged_out_layout] if pathname == "/signup": n_layout = [signup.layout] if pathname in ["/signout", "/logout"]: session.pop("username", None) time.sleep(1) n_layout = [home.layout] if pathname == "/create": if not session.get("username", None): n_layout = [create.logged_out_layout] else: n_layout = [create.layout] if pathname == "/cards": n_layout = [learn.layout] if not n_layout: try: n_layout = [globals()[f"{ pathname.replace('/', '') }"].layout] except KeyError: n_layout = html.Div("Path not found.", style={"text-align": "center"}) c_link = get_create_link() a_drop = get_account_dropdown() return [c_link, a_drop, n_layout] def get_create_link(): if session.get("username", None): return False return True def get_account_dropdown(): if session.get("username", None): return [ dbc.DropdownMenuItem("Profile", href="/profile"), dbc.DropdownMenuItem("Sign Out", href="/signout"), ] else: return [ dbc.DropdownMenuItem("Login", href="/login"), dbc.DropdownMenuItem("Create Account", href="/signup"), ] def get_page_content(): pass
[ 1, 529, 276, 1112, 420, 29958, 7976, 7141, 3049, 4070, 29914, 28041, 29899, 15112, 29966, 9507, 29958, 28041, 15112, 29914, 1649, 2344, 26914, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 931, 13, 5215, 12569, 29918, 8704, 29918, 14036, 408, 4833, 29883, 13, 5215, 12569, 29918, 3221, 29918, 14036, 408, 270, 617, 13, 5215, 12569, 29918, 1420, 29918, 14036, 408, 3472, 13, 3166, 29784, 1053, 4867, 13, 3166, 12569, 29889, 22594, 1053, 10604, 29892, 4306, 29892, 10567, 13, 3166, 869, 932, 1053, 12279, 29925, 29892, 4160, 29892, 15889, 13, 3166, 869, 12292, 1053, 3271, 29892, 5110, 29892, 1243, 29892, 6464, 29892, 1804, 786, 29892, 2740, 29892, 1653, 29892, 1804, 449, 29892, 8722, 13, 13, 13, 932, 353, 12279, 29925, 13, 2974, 353, 623, 29889, 2974, 13, 13, 1357, 29918, 9539, 353, 12305, 29907, 29947, 29923, 29946, 29943, 29946, 29908, 13, 13, 1792, 29918, 14144, 353, 3472, 29889, 12596, 29898, 333, 543, 1792, 29899, 14144, 613, 3114, 3790, 29908, 4990, 1115, 376, 9290, 29908, 1800, 13, 13, 2271, 353, 270, 617, 29889, 6508, 29898, 333, 543, 2271, 1159, 13, 13, 13, 21890, 353, 4833, 29883, 29889, 22107, 1646, 15427, 29898, 13, 1678, 4344, 11759, 13, 4706, 4833, 29883, 29889, 22107, 6595, 703, 29907, 3163, 613, 2822, 13802, 28160, 4968, 13, 4706, 396, 4833, 29883, 29889, 22107, 6595, 877, 3057, 742, 2822, 2433, 29914, 1688, 5477, 13, 4706, 4833, 29883, 29889, 22107, 6595, 703, 4391, 613, 2822, 13802, 3258, 613, 12708, 29922, 5574, 29892, 1178, 543, 3258, 29899, 2324, 4968, 13, 4706, 4833, 29883, 29889, 15063, 3204, 6823, 29898, 13, 9651, 4344, 11759, 13, 18884, 4833, 29883, 29889, 15063, 3204, 21331, 703, 11049, 613, 2822, 13802, 7507, 4968, 13, 18884, 4833, 29883, 29889, 15063, 3204, 21331, 703, 4391, 16535, 613, 2822, 13802, 4530, 786, 4968, 13, 9651, 21251, 13, 9651, 1178, 543, 10149, 29899, 19305, 613, 13, 9651, 3858, 543, 10601, 613, 13, 9651, 6283, 29922, 5574, 29892, 13, 9651, 3114, 3790, 29908, 9264, 29899, 1266, 1115, 376, 29906, 29900, 1756, 10758, 13, 4706, 10353, 13, 1678, 21251, 13, 1678, 14982, 543, 8754, 1161, 29899, 29925, 7086, 613, 13, 1678, 14982, 29918, 12653, 13802, 613, 13, 1678, 12070, 29891, 543, 3332, 613, 13, 1678, 3114, 3790, 29908, 9264, 1115, 376, 29900, 1756, 613, 376, 9264, 29899, 1563, 1115, 376, 29906, 29900, 1756, 613, 376, 9264, 29899, 1266, 1115, 376, 29906, 29900, 1756, 10758, 13, 29897, 13, 13, 13, 3488, 353, 3472, 29889, 12596, 29898, 333, 543, 3488, 29899, 3051, 613, 3114, 3790, 29908, 9264, 1115, 376, 29896, 1745, 29908, 1800, 13, 13, 21720, 353, 4833, 29883, 29889, 1625, 29898, 13, 1678, 518, 13, 4706, 376, 3727, 2782, 491, 529, 5813, 29958, 411, 360, 1161, 19602, 13, 4706, 3472, 29889, 12596, 29898, 13, 9651, 518, 13, 18884, 3472, 29889, 29909, 29898, 13, 462, 1678, 4833, 29883, 29889, 3125, 29898, 13, 462, 4706, 376, 3492, 13425, 613, 1178, 543, 19567, 613, 2927, 543, 29881, 4600, 613, 27887, 29922, 5574, 29892, 2159, 543, 3844, 29908, 13, 462, 1678, 10353, 13, 462, 1678, 2822, 543, 991, 597, 19567, 29889, 510, 29914, 7976, 7141, 3049, 4070, 613, 13, 462, 1678, 3114, 3790, 29908, 9264, 1115, 376, 29896, 29995, 10758, 13, 18884, 10353, 13, 18884, 3472, 29889, 29909, 29898, 13, 462, 1678, 4833, 29883, 29889, 3125, 29898, 13, 462, 4706, 376, 28712, 16046, 613, 1178, 543, 3292, 613, 2927, 543, 26031, 613, 27887, 29922, 5574, 29892, 2159, 543, 3844, 29908, 13, 462, 1678, 10353, 13, 462, 1678, 2822, 543, 991, 597, 3292, 29889, 510, 29914, 7976, 7141, 3049, 4070, 613, 13, 462, 1678, 3114, 3790, 29908, 9264, 1115, 376, 29896, 29995, 10758, 13, 18884, 10353, 13, 9651, 21251, 13, 9651, 3114, 3790, 29908, 9264, 29899, 3332, 1115, 376, 29945, 1756, 10758, 13, 4706, 10353, 13, 1678, 21251, 13, 1678, 3114, 3790, 29908, 726, 29899, 2520, 1115, 376, 5064, 613, 376, 9264, 29899, 8968, 1115, 376, 29896, 29945, 1756, 10758, 13, 29897, 13, 13, 932, 29889, 2680, 353, 4833, 29883, 29889, 7895, 29898, 13, 1678, 518, 1792, 29918, 14144, 29892, 3142, 29892, 6283, 1646, 29892, 1813, 29892, 24166, 1402, 13, 1678, 3114, 3790, 29908, 1742, 29899, 6312, 1115, 376, 8690, 29899, 1742, 613, 376, 3283, 1115, 376, 22925, 613, 376, 1195, 29899, 3545, 1115, 376, 29929, 29945, 29894, 29882, 10758, 13, 29897, 13, 13, 13, 29992, 932, 29889, 14035, 29898, 13, 1678, 518, 13, 4706, 10604, 703, 3258, 29899, 2324, 613, 376, 18279, 4968, 13, 4706, 10604, 703, 10149, 29899, 19305, 613, 376, 11991, 4968, 13, 4706, 10604, 703, 3488, 29899, 3051, 613, 376, 11991, 4968, 13, 1678, 21251, 13, 1678, 10567, 703, 2271, 613, 376, 2084, 978, 4968, 13, 29897, 13, 1753, 2479, 29918, 3488, 29898, 2084, 978, 1125, 13, 13, 1678, 302, 29918, 2680, 353, 6213, 13, 13, 1678, 565, 2224, 978, 1275, 5591, 1115, 13, 4706, 302, 29918, 2680, 353, 518, 5184, 29889, 2680, 29962, 13, 13, 1678, 565, 2224, 978, 1275, 5591, 7507, 1115, 13, 4706, 565, 4867, 29889, 657, 703, 6786, 613, 6213, 1125, 13, 9651, 302, 29918, 2680, 353, 518, 7507, 29889, 1188, 3192, 29918, 262, 29918, 2680, 29962, 13, 4706, 1683, 29901, 13, 9651, 302, 29918, 2680, 353, 518, 7507, 29889, 1188, 3192, 29918, 449, 29918, 2680, 29962, 13, 13, 1678, 565, 2224, 978, 1275, 5591, 4530, 786, 1115, 13, 4706, 302, 29918, 2680, 353, 518, 4530, 786, 29889, 2680, 29962, 13, 13, 1678, 565, 2224, 978, 297, 6796, 29914, 4530, 449, 613, 5591, 1188, 449, 3108, 29901, 13, 4706, 4867, 29889, 7323, 703, 6786, 613, 6213, 29897, 13, 4706, 931, 29889, 17059, 29898, 29896, 29897, 13, 4706, 302, 29918, 2680, 353, 518, 5184, 29889, 2680, 29962, 13, 13, 1678, 565, 2224, 978, 1275, 5591, 3258, 1115, 13, 4706, 565, 451, 4867, 29889, 657, 703, 6786, 613, 6213, 1125, 13, 9651, 302, 29918, 2680, 353, 518, 3258, 29889, 1188, 3192, 29918, 449, 29918, 2680, 29962, 13, 4706, 1683, 29901, 13, 9651, 302, 29918, 2680, 353, 518, 3258, 29889, 2680, 29962, 13, 13, 1678, 565, 2224, 978, 1275, 5591, 28160, 1115, 13, 4706, 302, 29918, 2680, 353, 518, 19668, 29889, 2680, 29962, 13, 13, 1678, 565, 451, 302, 29918, 2680, 29901, 13, 4706, 1018, 29901, 13, 9651, 302, 29918, 2680, 353, 518, 23705, 1338, 580, 29961, 29888, 29908, 29912, 2224, 978, 29889, 6506, 11219, 742, 27255, 500, 16862, 2680, 29962, 13, 4706, 5174, 7670, 2392, 29901, 13, 9651, 302, 29918, 2680, 353, 3472, 29889, 12596, 703, 2605, 451, 1476, 19602, 3114, 3790, 29908, 726, 29899, 2520, 1115, 376, 5064, 29908, 1800, 13, 13, 1678, 274, 29918, 2324, 353, 679, 29918, 3258, 29918, 2324, 580, 13, 1678, 263, 29918, 8865, 353, 679, 29918, 10149, 29918, 19305, 580, 13, 13, 1678, 736, 518, 29883, 29918, 2324, 29892, 263, 29918, 8865, 29892, 302, 29918, 2680, 29962, 13, 13, 13, 1753, 679, 29918, 3258, 29918, 2324, 7295, 13, 1678, 565, 4867, 29889, 657, 703, 6786, 613, 6213, 1125, 13, 4706, 736, 7700, 13, 1678, 736, 5852, 13, 13, 13, 1753, 679, 29918, 10149, 29918, 19305, 7295, 13, 1678, 565, 4867, 29889, 657, 703, 6786, 613, 6213, 1125, 13, 4706, 736, 518, 13, 9651, 4833, 29883, 29889, 15063, 3204, 21331, 703, 13909, 613, 2822, 13802, 10185, 4968, 13, 9651, 4833, 29883, 29889, 15063, 3204, 21331, 703, 10140, 4451, 613, 2822, 13802, 4530, 449, 4968, 13, 4706, 4514, 13, 1678, 1683, 29901, 13, 4706, 736, 518, 13, 9651, 4833, 29883, 29889, 15063, 3204, 21331, 703, 11049, 613, 2822, 13802, 7507, 4968, 13, 9651, 4833, 29883, 29889, 15063, 3204, 21331, 703, 4391, 16535, 613, 2822, 13802, 4530, 786, 4968, 13, 4706, 4514, 13, 13, 13, 1753, 679, 29918, 3488, 29918, 3051, 7295, 13, 1678, 1209, 13, 2 ]
config/experiments.b.py
shibaji7/model.CODE_BASE
0
155305
#!/usr/bin/env python """experiments.py: experiments python program for different experiment applications""" __author__ = "<NAME>." __copyright__ = "Copyright 2020, SuperDARN@VT" __credits__ = [] __license__ = "MIT" __version__ = "1.0." __maintainer__ = "<NAME>." __email__ = "<EMAIL>" __status__ = "Research" import matplotlib matplotlib.use("Agg") import matplotlib.dates as mdates import matplotlib.pyplot as plt plt.style.use("config/alt.mplstyle") import sys sys.path.append("models/") sys.path.append("models/experiments/") import os import numpy as np import argparse import pandas as pd import datetime as dt from netCDF4 import Dataset, num2date from dateutil import parser as dparser import glob import xarray import statsmodels.api as sm from statsmodels.formula.api import ols from constant import * import utils from absorption import * import case0 from model import Model fontT = {"family": "serif", "color": "k", "weight": "normal", "size": 8} font = {"family": "serif", "color": "black", "weight": "normal", "size": 10} from matplotlib import font_manager ticks_font = font_manager.FontProperties(family="serif", size=10, weight="normal") matplotlib.rcParams["xtick.color"] = "k" matplotlib.rcParams["ytick.color"] = "k" matplotlib.rcParams["xtick.labelsize"] = 10 matplotlib.rcParams["ytick.labelsize"] = 10 matplotlib.rcParams["mathtext.default"] = "default" def coloring_axes(ax, atype="left", col="red", fmtr="%H", ivl=60): ax.spines[atype].set_color(col) ax.tick_params(axis="y", which="both", colors=col) ax.yaxis.label.set_color(col) fmt = matplotlib.dates.DateFormatter(fmtr) ax.xaxis.set_major_formatter(fmt) ax.xaxis.set_major_locator(mdates.MinuteLocator(interval=ivl)) return ax def coloring_twaxes(ax, atype="left", col="red", twcol="k", fmtr="%H", ivl=60): ax.spines[atype].set_color(col) ax.tick_params(axis="y", which="both", colors=twcol) ax.yaxis.label.set_color(twcol) fmt = matplotlib.dates.DateFormatter(fmtr) ax.xaxis.set_major_formatter(fmt) ax.xaxis.set_major_locator(mdates.MinuteLocator(interval=ivl)) return ax def _case0_(args): """ Impact of the I0 and frequency """ chi = np.deg2rad(np.linspace(0,90,91)) f0 = 10**np.linspace(-6,-1,31) * 1e3 fo = 10**np.linspace(np.log10(.1), np.log10(200), 100) ev, start, end = dt.datetime(2015,3,11,16,22), dt.datetime(2015,3,11,15,30), dt.datetime(2015,3,11,17,30) l, r = 52, 53 _f0_ = case0._Case0_(start, end)[40:53] fname = "data/sim/case0.nc.gz" os.system("gzip -d "+fname) _nc = Dataset(fname.replace(".gz", "")) os.system("gzip "+fname.replace(".gz", "")) pg = utils.PointGrid("ott", ev, start, end, 30, v=False) _lo_,_qo_ = [],[] b = pg.igrf["B"][l:r,:] pg._col_.nu_FT = pg._col_.nu_FT[l:r,:] pg._col_.nu_av_CC = pg._col_.nu_av_CC[l:r,:] pg._col_.nu_av_MB = pg._col_.nu_av_MB[l:r,:] pg._col_.nu_SN["total"] = pg._col_.nu_SN["total"][l:r,:] ne = _nc.variables["ne"][l:r,:] for _f_ in fo: print(" Frequency - ", _f_, " MHz") u = Absorption(b, pg._col_, ne, fo=_f_*1e6) _lo_.append([utils.int_absorption(u.AH["SN"]["O"], pg.alts, extpoint=68, llim = 60, ulim = 110), utils.int_absorption(u.AH["AV_CC"]["O"], pg.alts, extpoint=64, llim = 60, ulim = 110), utils.int_absorption(u.AH["AV_MB"]["O"], pg.alts, extpoint=64, llim = 60, ulim = 110), utils.int_absorption(u.SW["FT"]["O"], pg.alts, extpoint=64, llim = 60, ulim = 110)]) continue _lo_ = np.array(_lo_) ne = _nc.variables["ne"][40:53,:] nfo = np.linspace(1,70,50) for i, _ in enumerate(_f0_): _k_ = [] for _f_ in nfo: print(" Frequency, I - ", _f_, " MHz,", _f0_[i], "W/m2") u = Absorption(b, pg._col_, ne[i:i+1,:], fo=_f_*1e6) _k_.append([utils.int_absorption(u.AH["SN"]["O"], pg.alts, extpoint=68, llim = 60, ulim = 110), utils.int_absorption(u.AH["AV_CC"]["O"], pg.alts, extpoint=64, llim = 60, ulim = 110), utils.int_absorption(u.AH["AV_MB"]["O"], pg.alts, extpoint=64, llim = 60, ulim = 110), utils.int_absorption(u.SW["FT"]["O"], pg.alts, extpoint=64, llim = 60, ulim = 110)]) _k_ = np.array(_k_)[:,:,0] _qo_.append([10**utils.extrap1d(_k_[:,0], np.log10(nfo))([1])[0], 10**utils.extrap1d(_k_[:,1], np.log10(nfo))([1])[0], 10**utils.extrap1d(_k_[:,2], np.log10(nfo))([1])[0], 10**utils.extrap1d(_k_[:,3], np.log10(nfo))([1])[0]]) _qo_ = np.array(_qo_) haf0 = 93.5 * (f0**0.25) l0 = 4.37e3 * (.22**0.5) / (fo)**2 haf1 = 10*np.log10(f0*1e-3) + 65 l1 = ((10*np.log10(2.2e-4) + 65)/fo)**1.5 matplotlib.rcParams["xtick.labelsize"] = 10 matplotlib.rcParams["ytick.labelsize"] = 10 matplotlib.rcParams["mathtext.default"] = "default" font = {"family": "serif", "color": "black", "weight": "normal", "size": 10} fonttext = {"family": "serif", "color": "blue", "weight": "normal", "size": 10} #fig, axes = plt.subplots(figsize=(6, 6), nrows=2, ncols=2, dpi=150) #fig.subplots_adjust(hspace=.3, wspace=.1) fig, ax = plt.subplots(figsize=(3, 3), nrows=1, ncols=1, dpi=100) #ax = axes[0,0] #ax.loglog(f0*1e-3, haf0, "r", linewidth=1.2, label="Sato (1975)") #ax.loglog(f0*1e-3, haf1, "b", linewidth=1.2, label="DARP2") #ax.set_ylabel("HAF, MHz", fontdict=font) #ax.set_xlim(1e-6,1e-1) #ax.legend(loc=2, scatterpoints=3, fontsize=8, frameon=True) #ax.text(0.2, 1.05, r"(a) $\chi=0^o$", horizontalalignment="center", verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) #ax = axes[0,1] #ax.set_yticks([]) #ax = ax.twinx() #ax.loglog(fo, l0, "r", linewidth=1.2, label="Sato (1975)") ax.loglog(fo, l1, "darkred", ls="--", linewidth=0.8, label="DARP") ax.set_xlim(1,200) ax.set_ylim(1,1e5) ax.set_ylabel("Absorption, dB", fontdict=font) #ax.legend(loc=1, scatterpoints=3, fontsize=8, frameon=True) ax.text(0.5, 1.05, r"$\chi=0^o$, $I_{\infty}=2.2\times 10^{-4}$ $Wm^{-2}$", horizontalalignment="center", verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) #ax = axes[1,0] #ax.loglog(_f0_, _qo_[:,0], "ro", markersize=1.2, label=r"$\beta_{ah}(\nu_{sn})$") #ax.loglog(_f0_, _qo_[:,1], "go", markersize=0.8, label=r"$\beta_{ah}(\nu_{av}^{cc})$") #ax.loglog(_f0_, _qo_[:,2], "bo", markersize=1.2, label=r"$\beta_{ah}(\nu_{av}^{mb})$") #ax.loglog(_f0_, _qo_[:,3], "ko", markersize=1.2, label=r"$\beta_{sw}(\nu_{me})$") #ax.set_ylabel("HAF, MHz", fontdict=font) #ax.set_xlabel(r"SXR, $Wm^{-2}$", fontdict=font) #ax.set_xlim(1e-6,1e-1) #ax.legend(loc=2, scatterpoints=3, fontsize=8, frameon=True) #ax.text(0.2, 1.05, r"(b) $\chi=0^o$", horizontalalignment="center", verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) #ax = axes[1,1] ax.set_xlabel("Frequency, MHz", fontdict=font) #ax.set_yticks([]) #ax = ax.twinx() ax.loglog(fo, utils.smooth(_lo_[:,0,0], 11), "r", linewidth=1.2, label=r"$\beta_{ah}(\nu_{sn})$") ax.loglog(fo, utils.smooth(_lo_[:,1,0], 11), "g", linewidth=0.8, label=r"$\beta_{ah}(\nu_{av}^{cc})$") ax.loglog(fo, utils.smooth(_lo_[:,2,0], 11), "b", linewidth=1.2, label=r"$\beta_{ah}(\nu_{av}^{mb})$") ax.loglog(fo, utils.smooth(_lo_[:,3,0], 11), "k", linewidth=1.2, label=r"$\beta_{sw}(\nu_{me})$") ax.set_ylim(1,1e5) ax.set_xlim(1,200) ax.set_ylabel("Absorption, dB", fontdict=font) ax.legend(loc=1, scatterpoints=3, fontsize=8, frameon=True) ax.text(0.5, 1.05, r"$\chi=0^o$, $I_{\infty}=2.2\times 10^{-4}$ $Wm^{-2}$", horizontalalignment="center", verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) fig.savefig("_images_/case0.png", bbox_inches="tight") return def _case1_(args): """ Impact of special event case study """ evs, rs, starts, ends = [dt.datetime(2017,9,5), dt.datetime(2017,9,6), dt.datetime(2017,9,7)],\ ["sps","sps","sps"],\ [dt.datetime(2017,9,5,17), dt.datetime(2017,9,6,11), dt.datetime(2017,9,7,13,30)],\ [dt.datetime(2017,9,5,19,30), dt.datetime(2017,9,6,17), dt.datetime(2017,9,7,19)] for ev, r, start, end in zip(evs, rs, starts, ends): if args.prog == "bgc": cmd = "python simulate.py -p bgc -r {r} -ev {ev} -s {s} -e {e} -v -fr {fr}".format(r=r, ev=ev.strftime("%Y-%m-%dT%H:%M"), s=start.strftime("%Y-%m-%dT%H:%M"), e=end.strftime("%Y-%m-%dT%H:%M"), fr=5.24) print(" "+ cmd) os.system(cmd) elif args.prog == "flare": cmd = "python simulate.py -p flare -r {r} -ev {ev} -s {s} -e {e} -v -fr {fr} -rm".format(r=r, ev=ev.strftime("%Y-%m-%dT%H:%M"), s=start.strftime("%Y-%m-%dT%H:%M"), e=end.strftime("%Y-%m-%dT%H:%M"), fr=5.24) print(" "+ cmd) os.system(cmd) if args.prog == "plot": fmt = matplotlib.dates.DateFormatter("%H") fig, axes = plt.subplots(figsize=(9, 5), nrows=2, ncols=3, dpi=150) fig.subplots_adjust(hspace=.1, wspace=.3) i = 0 CC = ["M2.3", "X9.3", "X1.7"] for ev, start, end in zip(evs, starts, ends): _X_ = pd.read_csv("config/dat/case1.ev{t}.csv".format(t=i)) _X_["dt"] = [ev + dt.timedelta(hours=h) for h in _X_.dt] _X_ = _X_.sort_values(by=["dt"]) ax = axes[0,i] gos = utils.read_goes(ev) col = "r" ax = coloring_axes(ax, col="k") ax.semilogy(gos.date,gos.B_AVG,col,linewidth=0.75, label="SXR (.1-.8 nm)") ax.semilogy(gos.date,gos.A_AVG,"b",linewidth=0.75, label="HXR (.05-.4 nm)") if i==2: ax.legend(bbox_to_anchor=(1.4, 0.5), scatterpoints=3, ncol=1, fontsize=8, frameon=True) ax.set_ylim(1e-8,1e-3) ax.set_yticks([1e-8, 1e-7, 1e-6, 1e-5, 1e-4,1e-3]) ax.set_xlim(start,end) if i==0: ax.set_ylabel(r"Solar Flux, $Wm^{-2}$",fontdict=font) font["color"] = "k" font["color"] = "darkgreen" ax.text(0.5,1.05,"%s, %s"%(ev.strftime("%d %b %Y"), CC[i]),horizontalalignment="center", verticalalignment="center", transform=ax.transAxes,fontdict=font) font["color"] = "k" ax = axes[1,i] ax = coloring_axes(ax, col="k") if i==0: ax.set_ylabel("Observations \n HF Absorption, db",fontdict=font) ax.scatter(_X_[_X_.model=="N"].dt, _X_[_X_.model=="N"].db, s=3., color="gray", alpha=0.8, marker="D", label="Ionosonde") #ax.legend(loc=1, scatterpoints=3, fontsize=8, frameon=True) #ax.text(0.35, 1.05, "(a.%d) "%(i+1) + ev.strftime("%Y-%m-%d")+" UT", horizontalalignment="center", # verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) fname = "data/sim/{date}/flare.sps.nc.gz".format(date=ev.strftime("%Y.%m.%d.%H.%M")) os.system("gzip -d " + fname) nc = Dataset(fname.replace(".gz","")) os.system("gzip " + fname.replace(".gz","")) times = num2date(nc.variables["time"][:], nc.variables["time"].units, nc.variables["time"].calendar) times = np.array([x._to_real_datetime() for x in times]).astype("datetime64[ns]") times = [dt.datetime.utcfromtimestamp(x.astype(int) * 1e-9) for x in times] ax.plot(times, 2*nc.variables["drap"][:], "darkred", ls="--", linewidth=0.8, label="DRAP2") ax.plot(times, 2*utils.int_absorption(nc.variables["abs.ah.sn.o"][:], model["alts"], extpoint=68), "r", linewidth=1.2, label=r"$\beta_{ah}(\nu_{sn})$") ax.plot(times, 2*utils.int_absorption(nc.variables["abs.ah.av.cc.o"][:], model["alts"], extpoint=64), "g", linewidth=0.8, label=r"$\beta_{ah}(\nu_{av}^{cc})$") ax.plot(times, 2*utils.int_absorption(nc.variables["abs.ah.av.mb.o"][:], model["alts"], extpoint=64), "b", linewidth=1.2, label=r"$\beta_{ah}(\nu_{av}^{mb})$") ax.plot(times, 2*utils.int_absorption(nc.variables["abs.sw.ft.o"][:], model["alts"], extpoint=64), "k", linewidth=0.8, label=r"$\beta_{ah}(\nu_{av}^{cc})$") ax.set_xlim(start, end) ax.scatter(_X_[_X_.model=="Y"].dt, _X_[_X_.model=="Y"].db, s=1.2, color="darkred", alpha=0.8, label="Levine et al. (2019)") if i==2: ax.legend(bbox_to_anchor=(1.12, 0.9), scatterpoints=3, fontsize=8, frameon=True) #ax.text(0.5, 1.05, "(b.%d) "%(i+1) + ev.strftime("%Y-%m-%d")+" UT, @6.4 MHz", horizontalalignment="center", # verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) i += 1 axes[1,0].set_xlabel("Time (UT)", fontdict=font) axes[1,1].set_xlabel("Time (UT)", fontdict=font) axes[1,2].set_xlabel("Time (UT)", fontdict=font) font["color"] = "k" fig.autofmt_xdate(rotation=25,ha="center") fig.savefig("_images_/case1.png", bbox_inches="tight") return def _case2_(args): """ Testing electron temperature dependence """ args.event, args.rio, args.start, args.end = dt.datetime(2011,9,7,22,38), "mcmu",\ dt.datetime(2011,9,7,22,10), dt.datetime(2011,9,7,23,20) start, end = dt.datetime(2011,9,7,22,30), dt.datetime(2011,9,7,23,0) TElec = np.linspace(0.75,1.75,101) if args.prog == "bgc": cmd = "python simulate.py -p bgc -r {r} -ev {ev} -s {s} -e {e} -v".format(r=args.rio, ev=args.event.strftime("%Y-%m-%dT%H:%M"), s=args.start.strftime("%Y-%m-%dT%H:%M"), e=args.end.strftime("%Y-%m-%dT%H:%M")) print(" "+ cmd) os.system(cmd) elif args.prog == "flare": for t in TElec: print(" TElec:", t) Model(args.rio, args.event, args)._exp_("TElec", {"TElec": t}) elif args.prog == "plot": matplotlib.rcParams["xtick.labelsize"] = 6 matplotlib.rcParams["ytick.labelsize"] = 6 matplotlib.rcParams["mathtext.default"] = "default" font = {"family": "serif", "color": "black", "weight": "normal", "size": 6} fonttext = {"family": "serif", "color": "blue", "weight": "normal", "size": 6} fmt = matplotlib.dates.DateFormatter("%H:%M") fig, axes = plt.subplots(figsize=(6, 2), nrows=1, ncols=2, dpi=100) #ax = axes[0] #import bootstrapped.bootstrap as bs #import bootstrapped.stats_functions as bs_stats #from scipy.stats import norm #x = np.linspace(0.5,2,151) #loc = bs.bootstrap(x, stat_func=bs_stats.mean).value #scale = bs.bootstrap(x, stat_func=bs_stats.std).value #ax.plot(x, norm.pdf(x, loc=loc, scale=scale), "r", lw=0.8, alpha=0.6) #ax.text(0.5, 1.05, r"(a) Distribution of $T_d$", horizontalalignment="center", # verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) files = glob.glob("data/sim/{dn}/flare*TElec*".format(dn=args.event.strftime("%Y.%m.%d.%H.%M"))) ax = axes[0] ax.xaxis.set_major_formatter(fmt) files.sort() X = [] _abs_ = utils.read_riometer(args.event, args.rio) _abs_ = _abs_[(_abs_.date > start) & (_abs_.date < end-dt.timedelta(minutes=1))] cmap = matplotlib.cm.get_cmap("Reds") Mx = np.zeros((int((end-start).total_seconds()/60), len(files))) for i,f in enumerate(files): os.system("gzip -d " + f) nc = Dataset(f.replace(".gz", "")) os.system("gzip " + f.replace(".gz", "")) times = num2date(nc.variables["time"][:], nc.variables["time"].units, nc.variables["time"].calendar) times = np.array([x._to_real_datetime() for x in times]).astype("datetime64[ns]") times = [dt.datetime.utcfromtimestamp(x.astype(int) * 1e-9) for x in times] #if np.mod(i,20)==0: ax.plot(times, utils.smooth(utils.int_absorption(nc.variables["abs.ah.sn.o"][:], # model["alts"], extpoint=68), 5), color=cmap(.2+(i/200)), # linewidth=0.6, ls="--", label=r"$T_d$=%.2f"%TElec[i]) m = pd.DataFrame() m["date"] = times m["hf_abs"] = utils.smooth(utils.int_absorption(nc.variables["abs.ah.sn.o"][:], model["alts"], extpoint=68), 5) m = m[(m.date >= start) & (m.date < end)] Mx[:,i] = m.hf_abs.tolist() e = utils.estimate_error(m, _abs_) X.append(e) ax.plot(_abs_.date, _abs_.hf_abs, "ko", alpha=0.4, markersize=0.1, label=r"$\beta_{R}$", lw=.4) mn, st = 1.2*np.median(Mx, axis=1), 1.98*np.std(Mx, axis=1) ax.plot(m.date, mn, color="r", linewidth=0.8, ls="--", label=r"$\beta_m$") ax.fill_between(m.date, mn - st, mn + st, color="r", alpha=0.5, label="95% CI") X = np.array(X) ax.set_xlim(start, end) ax.text(0.5, 1.05, r"(b) %s UT, %s @30 MHz, $T_d=\frac{T^{90}}{T^{90}_{base}}$"%(args.event.strftime("%Y-%m-%d"), args.rio.upper()), horizontalalignment="center", verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) ax.set_ylim(-.1,2.5) ax.legend(loc=1, scatterpoints=3, fontsize=4, ncol=1, frameon=True) ax.set_xlabel("Time (UT)", fontdict=font) ax.set_ylabel("Absorption, dB", fontdict=font) ax = axes[1] ax.grid(False, axis="y") ax.set_xlabel(r"Temperature ratio, $\frac{T^{90}}{T^{90}_{base}}$", fontdict=font) ax.set_yticklabels([]) ax = ax.twinx() ax.plot(TElec, X, "ro", markersize=0.3, alpha=.6) ax.set_xlim(.75,1.75) ax.axvline(TElec[np.argmin(X)], ls="--", lw=0.4, color="b") ax.set_ylabel("RMSE", fontdict=font) ax.text(0.5, 1.05, "(c) Impact of Temperature on RMSE", horizontalalignment="center", verticalalignment="center", transform=ax.transAxes, fontdict=fonttext) fonttext["size"] = 4 ax.text(TElec[np.argmin(X)], 0.745, r"$T_d$=%.2f"%TElec[np.argmin(X)], horizontalalignment="center", verticalalignment="center", fontdict=fonttext, rotation=90) fig.autofmt_xdate() fig.savefig("_images_/case2.png", bbox_inches="tight") return def _stats_(args): """ Estimate and plot statistics """ x = pd.read_csv("config/flare.stats.m.csv") x.dn = [dt.datetime.strptime(t,"%Y.%m.%d.%H.%M") for t in x.dn] if args.prog == "plot": matplotlib.rcParams["xtick.labelsize"] = 12 matplotlib.rcParams["ytick.labelsize"] = 12 matplotlib.rcParams["mathtext.default"] = "default" font = {"family": "serif", "color": "black", "weight": "normal", "size": 12} fonttext = {"family": "serif", "color": "blue", "weight": "normal", "size": 12} fig1, axes1 = plt.subplots(figsize=(9, 12), nrows=4, ncols=3, dpi=90, sharey="row", sharex="col") edist = {} for j, nm in enumerate(["sn","cc","mb","me"]): df = [] name = "mRMSE_"+nm for i, row in x.iterrows(): stn = row["rio"] f = "data/sim/archive/{dn}/skills.{rio}.nc".format(dn=row["dn"].strftime("%Y.%m.%d.%H.%M"), rio=stn) d = xarray.open_dataset(f) d.attrs.update({"acc": 1-(d.attrs[name]/d.attrs["mRMSE_dr"]), name: (d.attrs[name]), "sza": np.median(d["sza"].values), "local_time": np.median(d["local_time"].values), "mlt": np.mean(d["mlt"].values)}) df.append(d.attrs) #print(d.attrs["dPeak"]-d.attrs["mPeak_"+nm]) df = pd.DataFrame.from_records(df) ux = df[np.abs(df["dPeak"]-d.attrs["mPeak_dr"])<.8] print(np.corrcoef(ux.dPeak, ux["mPeak_dr"]), len(ux)) df = df[~df.isin([np.nan, np.inf, -np.inf]).any(1)] model = ols("acc ~ sza+local_time+mlt+mlat", data=df) #model = ols(name + "~ sza*local_time*mlt*mlat", data=df) response = model.fit() anova = sm.stats.anova_lm(response, typ=2) edist[nm] = df.acc.tolist() print(anova) #print(response.summary()) ax = axes1[j, 0] sza, acc = running_mean(df.sza, df.acc, dx=5) ax.plot(df.sza, df.acc, "ro", alpha=0.5, markersize=0.75) #x = _create_x_(df.cossza.tolist(), np.mean(df.lat), np.mean(df.logfmax), np.mean(df["lt"]), lp="cossza") #o = r.get_prediction(x[["sza","mlt",""]].values) #m, v = o.predicted_mean, np.sqrt(o.var_pred_mean) #ax.plot(df.sza, o.predicted_mean, "r-", linewidth=0.75, alpha=0.8) #ax.fill_between(df.sza, m - 1.98*v, m + 1.98*v, color="r", alpha=0.2) ax = axes1[j, 1] ax.plot(df.local_time, df.acc, "ro", alpha=0.5, markersize=0.75) ax = axes1[j, 2] ax.plot(df.mlt, df.acc, "ro", alpha=0.5, markersize=0.75) axes1[0,0].set_ylabel("RMSE", fontdict=font) axes1[1,0].set_ylabel("RMSE", fontdict=font) axes1[2,0].set_ylabel("RMSE", fontdict=font) axes1[3,0].set_ylabel("RMSE", fontdict=font) axes1[3,0].set_xlabel(r"SZA, $\chi(^o)$", fontdict=font) axes1[3,1].set_xlabel(r"LT, Hours", fontdict=font) axes1[3,2].set_xlabel(r"MLT, Hours", fontdict=font) from scipy import stats print(stats.ttest_rel(edist["mb"], edist["sn"])) fig1.savefig("_images_/stats.png", bbox_inches="tight") else: xref = pd.read_csv("config/flares.csv", parse_dates=["dn", "start", "end"]) for i, row in x.iterrows(): ref = xref[xref.dn==row["dn"]] stn = row["rio"] f = "data/sim/archive/{dn}/flare.{rio}.nc.gz".format(dn=row["dn"].strftime("%Y.%m.%d.%H.%M"), rio=stn) os.system("gzip -d " + f) _x_ = Dataset(f.replace(".gz", "")) os.system("gzip " + f.replace(".gz", "")) times = num2date(_x_.variables["time"][:], _x_.variables["time"].units, _x_.variables["time"].calendar, only_use_cftime_datetimes=False) times = np.array([x._to_real_datetime() for x in times]).astype("datetime64[ns]") times = [dt.datetime.utcfromtimestamp(x.astype(int) * 1e-9) for x in times] alts = _x_.variables["alts"][:] o = { "sn": utils.int_absorption(_x_.variables["abs.ah.sn.o"][:], alts, extpoint=68), "cc": utils.int_absorption(_x_.variables["abs.ah.av.cc.o"][:], alts, extpoint=64), "mb": utils.int_absorption(_x_.variables["abs.ah.av.mb.o"][:], alts, extpoint=64), "me": utils.int_absorption(_x_.variables["abs.sw.ft.o"][:], alts, extpoint=64), "dr": _x_.variables["drap"][:], } pf = utils.Performance(stn=stn, ev=row["dn"], times=times, model=o, start=ref["start"].tolist()[0], end=ref["end"].tolist()[0], bar=row["bar"], alt=row["alt"]) fname = f.replace("flare","skills") pf._skill_()._params_()._to_netcdf_(fname.replace(".gz","")) return if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-p", "--prog", default="flare", help="Program code [bgc/flare] (default bgc)") parser.add_argument("-r", "--rio", default="ott", help="Riometer code (default ott)") parser.add_argument("-ev", "--event", default=dt.datetime(2015,3,11,16,22), help="Start date (default 2015-3-11T16:22)", type=dparser.isoparse) parser.add_argument("-s", "--start", default=dt.datetime(2015,3,11,16), help="Start date (default 2015-3-11T15:30)", type=dparser.isoparse) parser.add_argument("-e", "--end", default=dt.datetime(2015,3,11,17), help="End date (default 2015-3-11T17:30)", type=dparser.isoparse) parser.add_argument("-g", "--save_goes", action="store_false", help="Save goes data (default True)") parser.add_argument("-sat", "--sat", type=int, default=15, help="Satellite number (default 15)") parser.add_argument("-rm", "--save_riom", action="store_false", help="Save riometer data (default True)") parser.add_argument("-ps", "--plot_summary", action="store_true", help="Plot summary report (default False)") parser.add_argument("-sr", "--save_result", action="store_false", help="Save results (default True)") parser.add_argument("-c", "--clear", action="store_true", help="Clear pervious stored files (default False)") parser.add_argument("-irr", "--irradiance", default="EUVAC+", help="Irradiance model (default EUVAC+)") parser.add_argument("-v", "--verbose", action="store_true", help="Increase output verbosity (default False)") parser.add_argument("-pc", "--plot_code", type=int, default=0, help="Plotting code,applicable if --prog==plot (default 0)") parser.add_argument("-fr", "--frequency", type=float, default=30, help="Frequency of oprrations in MHz (default 30 MHz)") parser.add_argument("-ex", "--exp", type=int, default=0, help="Program code [0-10] (default0)") args = parser.parse_args() if args.verbose: print("\n Parameter list for simulation ") for k in vars(args).keys(): print(" " , k , "->" , str(vars(args)[k])) if args.exp == 0: _case0_(args) if args.exp == 1: _case1_(args) if args.exp == 2: _case2_(args) if args.exp == 3: _stats_(args) else: print("\n Program not implemented") print("") if os.path.exists("models/__pycache__"): os.system("rm -rf models/__pycache__") if os.path.exists("models/experiments/__pycache__"): os.system("rm -rf models/experiments/__pycache__")
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 15945, 29908, 735, 546, 7862, 29889, 2272, 29901, 15729, 3017, 1824, 363, 1422, 7639, 8324, 15945, 29908, 13, 13, 1649, 8921, 1649, 353, 9872, 5813, 29958, 1213, 13, 1649, 8552, 1266, 1649, 353, 376, 11882, 1266, 29871, 29906, 29900, 29906, 29900, 29892, 5670, 29928, 15249, 29992, 29963, 29911, 29908, 13, 1649, 11944, 1169, 1649, 353, 5159, 13, 1649, 506, 1947, 1649, 353, 376, 26349, 29908, 13, 1649, 3259, 1649, 353, 376, 29896, 29889, 29900, 1213, 13, 1649, 29885, 2365, 4008, 1649, 353, 9872, 5813, 29958, 1213, 13, 1649, 5269, 1649, 353, 9872, 26862, 6227, 11903, 13, 1649, 4882, 1649, 353, 376, 1666, 2842, 29908, 13, 13, 5215, 22889, 13, 2922, 17357, 29889, 1509, 703, 29909, 1505, 1159, 13, 5215, 22889, 29889, 15190, 408, 286, 15190, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 572, 29873, 29889, 3293, 29889, 1509, 703, 2917, 29914, 1997, 29889, 29885, 572, 3293, 1159, 13, 13, 5215, 10876, 13, 9675, 29889, 2084, 29889, 4397, 703, 9794, 29914, 1159, 13, 9675, 29889, 2084, 29889, 4397, 703, 9794, 29914, 735, 546, 7862, 29914, 1159, 13, 5215, 2897, 13, 5215, 12655, 408, 7442, 13, 5215, 1852, 5510, 13, 5215, 11701, 408, 10518, 13, 5215, 12865, 408, 11636, 13, 3166, 7787, 29907, 4037, 29946, 1053, 13373, 24541, 29892, 954, 29906, 1256, 13, 3166, 2635, 4422, 1053, 13812, 408, 270, 16680, 13, 5215, 13149, 13, 5215, 921, 2378, 13, 5215, 22663, 9794, 29889, 2754, 408, 1560, 13, 3166, 22663, 9794, 29889, 689, 2497, 29889, 2754, 1053, 288, 3137, 13, 13, 3166, 4868, 1053, 334, 13, 5215, 3667, 29879, 13, 3166, 17977, 683, 1053, 334, 13, 5215, 1206, 29900, 13, 3166, 1904, 1053, 8125, 13, 13, 13, 5657, 29911, 353, 8853, 11922, 1115, 376, 643, 361, 613, 376, 2780, 1115, 29871, 376, 29895, 613, 376, 7915, 1115, 376, 8945, 613, 376, 2311, 1115, 29871, 29947, 29913, 13, 5657, 353, 8853, 11922, 1115, 376, 643, 361, 613, 376, 2780, 1115, 29871, 376, 8517, 613, 376, 7915, 1115, 376, 8945, 613, 376, 2311, 1115, 29871, 29896, 29900, 29913, 13, 13, 3166, 22889, 1053, 4079, 29918, 12847, 13, 29873, 7358, 29918, 5657, 353, 4079, 29918, 12847, 29889, 9824, 11857, 29898, 11922, 543, 643, 361, 613, 2159, 29922, 29896, 29900, 29892, 7688, 543, 8945, 1159, 13, 2922, 17357, 29889, 2214, 9629, 3366, 486, 860, 29889, 2780, 3108, 353, 376, 29895, 29908, 13, 2922, 17357, 29889, 2214, 9629, 3366, 3637, 860, 29889, 2780, 3108, 353, 376, 29895, 29908, 13, 2922, 17357, 29889, 2214, 9629, 3366, 486, 860, 29889, 1643, 2311, 3108, 353, 29871, 29896, 29900, 13, 2922, 17357, 29889, 2214, 9629, 3366, 3637, 860, 29889, 1643, 2311, 3108, 353, 29871, 29896, 29900, 13, 2922, 17357, 29889, 2214, 9629, 3366, 755, 726, 29889, 4381, 3108, 353, 376, 4381, 29908, 13, 13, 1753, 2927, 292, 29918, 1165, 267, 29898, 1165, 29892, 472, 668, 543, 1563, 613, 784, 543, 1127, 613, 285, 29885, 509, 543, 29995, 29950, 613, 20444, 29880, 29922, 29953, 29900, 1125, 13, 1678, 4853, 29889, 1028, 1475, 29961, 23179, 1822, 842, 29918, 2780, 29898, 1054, 29897, 13, 1678, 4853, 29889, 24667, 29918, 7529, 29898, 8990, 543, 29891, 613, 607, 543, 20313, 613, 11955, 29922, 1054, 29897, 13, 1678, 4853, 29889, 29891, 8990, 29889, 1643, 29889, 842, 29918, 2780, 29898, 1054, 29897, 13, 1678, 19200, 353, 22889, 29889, 15190, 29889, 2539, 18522, 29898, 24826, 509, 29897, 13, 1678, 4853, 29889, 29916, 8990, 29889, 842, 29918, 21355, 29918, 689, 2620, 29898, 23479, 29897, 13, 1678, 4853, 29889, 29916, 8990, 29889, 842, 29918, 21355, 29918, 2029, 1061, 29898, 3487, 1078, 29889, 8140, 1082, 3524, 1061, 29898, 19207, 29922, 440, 29880, 876, 13, 1678, 736, 4853, 13, 13, 1753, 2927, 292, 29918, 7516, 1165, 267, 29898, 1165, 29892, 472, 668, 543, 1563, 613, 784, 543, 1127, 613, 3252, 1054, 543, 29895, 613, 285, 29885, 509, 543, 29995, 29950, 613, 20444, 29880, 29922, 29953, 29900, 1125, 13, 1678, 4853, 29889, 1028, 1475, 29961, 23179, 1822, 842, 29918, 2780, 29898, 1054, 29897, 13, 1678, 4853, 29889, 24667, 29918, 7529, 29898, 8990, 543, 29891, 613, 607, 543, 20313, 613, 11955, 29922, 7516, 1054, 29897, 13, 1678, 4853, 29889, 29891, 8990, 29889, 1643, 29889, 842, 29918, 2780, 29898, 7516, 1054, 29897, 13, 1678, 19200, 353, 22889, 29889, 15190, 29889, 2539, 18522, 29898, 24826, 509, 29897, 13, 1678, 4853, 29889, 29916, 8990, 29889, 842, 29918, 21355, 29918, 689, 2620, 29898, 23479, 29897, 13, 1678, 4853, 29889, 29916, 8990, 29889, 842, 29918, 21355, 29918, 2029, 1061, 29898, 3487, 1078, 29889, 8140, 1082, 3524, 1061, 29898, 19207, 29922, 440, 29880, 876, 13, 1678, 736, 4853, 13, 13, 1753, 903, 4878, 29900, 23538, 5085, 1125, 13, 1678, 9995, 14305, 627, 310, 278, 306, 29900, 322, 10868, 9995, 13, 13, 1678, 18558, 353, 7442, 29889, 12163, 29906, 3665, 29898, 9302, 29889, 1915, 3493, 29898, 29900, 29892, 29929, 29900, 29892, 29929, 29896, 876, 13, 1678, 285, 29900, 353, 29871, 29896, 29900, 1068, 9302, 29889, 1915, 3493, 6278, 29953, 6653, 29896, 29892, 29941, 29896, 29897, 334, 29871, 29896, 29872, 29941, 13, 1678, 1701, 353, 29871, 29896, 29900, 1068, 9302, 29889, 1915, 3493, 29898, 9302, 29889, 1188, 29896, 29900, 11891, 29896, 511, 7442, 29889, 1188, 29896, 29900, 29898, 29906, 29900, 29900, 511, 29871, 29896, 29900, 29900, 29897, 13, 13, 1678, 3415, 29892, 1369, 29892, 1095, 353, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29945, 29892, 29941, 29892, 29896, 29896, 29892, 29896, 29953, 29892, 29906, 29906, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29945, 29892, 29941, 29892, 29896, 29896, 29892, 29896, 29945, 29892, 29941, 29900, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29945, 29892, 29941, 29892, 29896, 29896, 29892, 29896, 29955, 29892, 29941, 29900, 29897, 13, 1678, 301, 29892, 364, 353, 29871, 29945, 29906, 29892, 29871, 29945, 29941, 13, 1678, 903, 29888, 29900, 29918, 353, 1206, 29900, 3032, 8259, 29900, 23538, 2962, 29892, 1095, 9601, 29946, 29900, 29901, 29945, 29941, 29962, 13, 1678, 285, 978, 353, 376, 1272, 29914, 3601, 29914, 4878, 29900, 29889, 17608, 29889, 18828, 29908, 13, 1678, 2897, 29889, 5205, 703, 29887, 7554, 448, 29881, 15691, 29888, 978, 29897, 13, 1678, 903, 17608, 353, 13373, 24541, 29898, 29888, 978, 29889, 6506, 17350, 18828, 613, 5124, 876, 13, 1678, 2897, 29889, 5205, 703, 29887, 7554, 15691, 29888, 978, 29889, 6506, 17350, 18828, 613, 5124, 876, 13, 1678, 23822, 353, 3667, 29879, 29889, 5228, 5756, 703, 1501, 613, 3415, 29892, 1369, 29892, 1095, 29892, 29871, 29941, 29900, 29892, 325, 29922, 8824, 29897, 13, 1678, 903, 417, 3383, 29918, 29939, 29877, 29918, 353, 19997, 2636, 13, 1678, 289, 353, 23822, 29889, 4481, 29888, 3366, 29933, 3108, 29961, 29880, 29901, 29878, 29892, 17531, 13, 1678, 23822, 3032, 1054, 5396, 3433, 29918, 7818, 353, 23822, 3032, 1054, 5396, 3433, 29918, 7818, 29961, 29880, 29901, 29878, 29892, 17531, 13, 1678, 23822, 3032, 1054, 5396, 3433, 29918, 485, 29918, 4174, 353, 23822, 3032, 1054, 5396, 3433, 29918, 485, 29918, 4174, 29961, 29880, 29901, 29878, 29892, 17531, 13, 1678, 23822, 3032, 1054, 5396, 3433, 29918, 485, 29918, 9486, 353, 23822, 3032, 1054, 5396, 3433, 29918, 485, 29918, 9486, 29961, 29880, 29901, 29878, 29892, 17531, 13, 1678, 23822, 3032, 1054, 5396, 3433, 29918, 19296, 3366, 7827, 3108, 353, 23822, 3032, 1054, 5396, 3433, 29918, 19296, 3366, 7827, 3108, 29961, 29880, 29901, 29878, 29892, 17531, 13, 1678, 452, 353, 903, 17608, 29889, 20897, 3366, 484, 3108, 29961, 29880, 29901, 29878, 29892, 17531, 13, 1678, 363, 903, 29888, 29918, 297, 1701, 29901, 13, 4706, 1596, 703, 3878, 23860, 448, 9162, 903, 29888, 3383, 376, 341, 12661, 1159, 13, 4706, 318, 353, 24650, 272, 683, 29898, 29890, 29892, 23822, 3032, 1054, 3383, 452, 29892, 1701, 29922, 29918, 29888, 24563, 29896, 29872, 29953, 29897, 13, 4706, 903, 417, 5396, 4397, 4197, 13239, 29889, 524, 29918, 6897, 272, 683, 29898, 29884, 29889, 29909, 29950, 3366, 19296, 3108, 3366, 29949, 12436, 23822, 29889, 284, 1372, 29892, 1294, 3149, 29922, 29953, 29947, 29892, 301, 2576, 353, 29871, 29953, 29900, 29892, 318, 2576, 353, 29871, 29896, 29896, 29900, 511, 13, 632, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 29898, 29884, 29889, 29909, 29950, 3366, 7520, 29918, 4174, 3108, 3366, 29949, 12436, 23822, 29889, 284, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 29892, 301, 2576, 353, 29871, 29953, 29900, 29892, 318, 2576, 353, 29871, 29896, 29896, 29900, 511, 13, 632, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 29898, 29884, 29889, 29909, 29950, 3366, 7520, 29918, 9486, 3108, 3366, 29949, 12436, 23822, 29889, 284, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 29892, 301, 2576, 353, 29871, 29953, 29900, 29892, 318, 2576, 353, 29871, 29896, 29896, 29900, 511, 13, 632, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 29898, 29884, 29889, 23066, 3366, 7818, 3108, 3366, 29949, 12436, 23822, 29889, 284, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 29892, 301, 2576, 353, 29871, 29953, 29900, 29892, 318, 2576, 353, 29871, 29896, 29896, 29900, 29897, 2314, 13, 4706, 6773, 13, 1678, 903, 417, 29918, 353, 7442, 29889, 2378, 7373, 417, 19925, 13, 13, 1678, 452, 353, 903, 17608, 29889, 20897, 3366, 484, 3108, 29961, 29946, 29900, 29901, 29945, 29941, 29892, 17531, 13, 1678, 302, 1181, 353, 7442, 29889, 1915, 3493, 29898, 29896, 29892, 29955, 29900, 29892, 29945, 29900, 29897, 13, 1678, 363, 474, 29892, 903, 297, 26985, 7373, 29888, 29900, 29918, 1125, 13, 4706, 903, 29895, 29918, 353, 5159, 13, 4706, 363, 903, 29888, 29918, 297, 302, 1181, 29901, 13, 9651, 1596, 703, 3878, 23860, 29892, 306, 448, 9162, 903, 29888, 3383, 376, 341, 12661, 29892, 613, 903, 29888, 29900, 29918, 29961, 29875, 1402, 376, 29956, 29914, 29885, 29906, 1159, 13, 9651, 318, 353, 24650, 272, 683, 29898, 29890, 29892, 23822, 3032, 1054, 3383, 452, 29961, 29875, 29901, 29875, 29974, 29896, 29892, 29901, 1402, 1701, 29922, 29918, 29888, 24563, 29896, 29872, 29953, 29897, 13, 9651, 903, 29895, 5396, 4397, 4197, 13239, 29889, 524, 29918, 6897, 272, 683, 29898, 29884, 29889, 29909, 29950, 3366, 19296, 3108, 3366, 29949, 12436, 23822, 29889, 284, 1372, 29892, 1294, 3149, 29922, 29953, 29947, 29892, 301, 2576, 353, 29871, 29953, 29900, 29892, 318, 2576, 353, 29871, 29896, 29896, 29900, 511, 13, 18884, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 29898, 29884, 29889, 29909, 29950, 3366, 7520, 29918, 4174, 3108, 3366, 29949, 12436, 23822, 29889, 284, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 29892, 301, 2576, 353, 29871, 29953, 29900, 29892, 318, 2576, 353, 29871, 29896, 29896, 29900, 511, 13, 18884, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 29898, 29884, 29889, 29909, 29950, 3366, 7520, 29918, 9486, 3108, 3366, 29949, 12436, 23822, 29889, 284, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 29892, 301, 2576, 353, 29871, 29953, 29900, 29892, 318, 2576, 353, 29871, 29896, 29896, 29900, 511, 13, 18884, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 29898, 29884, 29889, 23066, 3366, 7818, 3108, 3366, 29949, 12436, 23822, 29889, 284, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 29892, 301, 2576, 353, 29871, 29953, 29900, 29892, 318, 2576, 353, 29871, 29896, 29896, 29900, 29897, 2314, 13, 4706, 903, 29895, 29918, 353, 7442, 29889, 2378, 7373, 29895, 19925, 7503, 29892, 29901, 29892, 29900, 29962, 13, 4706, 903, 29939, 29877, 5396, 4397, 4197, 29896, 29900, 1068, 13239, 29889, 1062, 2390, 29896, 29881, 7373, 29895, 29918, 7503, 29892, 29900, 1402, 7442, 29889, 1188, 29896, 29900, 29898, 29876, 1181, 876, 4197, 29896, 2314, 29961, 29900, 1402, 29871, 13, 632, 29896, 29900, 1068, 13239, 29889, 1062, 2390, 29896, 29881, 7373, 29895, 29918, 7503, 29892, 29896, 1402, 7442, 29889, 1188, 29896, 29900, 29898, 29876, 1181, 876, 4197, 29896, 2314, 29961, 29900, 1402, 13, 632, 29896, 29900, 1068, 13239, 29889, 1062, 2390, 29896, 29881, 7373, 29895, 29918, 7503, 29892, 29906, 1402, 7442, 29889, 1188, 29896, 29900, 29898, 29876, 1181, 876, 4197, 29896, 2314, 29961, 29900, 1402, 13, 632, 29896, 29900, 1068, 13239, 29889, 1062, 2390, 29896, 29881, 7373, 29895, 29918, 7503, 29892, 29941, 1402, 7442, 29889, 1188, 29896, 29900, 29898, 29876, 1181, 876, 4197, 29896, 2314, 29961, 29900, 24960, 13, 1678, 903, 29939, 29877, 29918, 353, 7442, 29889, 2378, 7373, 29939, 29877, 19925, 13, 13, 1678, 447, 29888, 29900, 353, 29871, 29929, 29941, 29889, 29945, 334, 313, 29888, 29900, 1068, 29900, 29889, 29906, 29945, 29897, 13, 1678, 301, 29900, 353, 29871, 29946, 29889, 29941, 29955, 29872, 29941, 334, 14544, 29906, 29906, 1068, 29900, 29889, 29945, 29897, 847, 313, 1181, 29897, 1068, 29906, 13, 1678, 447, 29888, 29896, 353, 29871, 29896, 29900, 29930, 9302, 29889, 1188, 29896, 29900, 29898, 29888, 29900, 29930, 29896, 29872, 29899, 29941, 29897, 718, 29871, 29953, 29945, 13, 1678, 301, 29896, 353, 5135, 29896, 29900, 29930, 9302, 29889, 1188, 29896, 29900, 29898, 29906, 29889, 29906, 29872, 29899, 29946, 29897, 718, 29871, 29953, 29945, 6802, 1181, 29897, 1068, 29896, 29889, 29945, 13, 13, 1678, 22889, 29889, 2214, 9629, 3366, 486, 860, 29889, 1643, 2311, 3108, 353, 29871, 29896, 29900, 13, 1678, 22889, 29889, 2214, 9629, 3366, 3637, 860, 29889, 1643, 2311, 3108, 353, 29871, 29896, 29900, 13, 1678, 22889, 29889, 2214, 9629, 3366, 755, 726, 29889, 4381, 3108, 353, 376, 4381, 29908, 13, 1678, 4079, 353, 8853, 11922, 1115, 376, 643, 361, 613, 376, 2780, 1115, 29871, 376, 8517, 613, 376, 7915, 1115, 376, 8945, 613, 376, 2311, 1115, 29871, 29896, 29900, 29913, 13, 1678, 4079, 726, 353, 8853, 11922, 1115, 376, 643, 361, 613, 376, 2780, 1115, 29871, 376, 9539, 613, 376, 7915, 1115, 376, 8945, 613, 376, 2311, 1115, 29871, 29896, 29900, 29913, 13, 1678, 396, 1003, 29892, 27815, 353, 14770, 29889, 1491, 26762, 29898, 1003, 2311, 7607, 29953, 29892, 29871, 29953, 511, 302, 5727, 29922, 29906, 29892, 302, 22724, 29922, 29906, 29892, 270, 1631, 29922, 29896, 29945, 29900, 29897, 13, 1678, 396, 1003, 29889, 1491, 26762, 29918, 328, 5143, 29898, 14158, 21098, 29941, 29892, 281, 3493, 21098, 29896, 29897, 13, 1678, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 29898, 1003, 2311, 7607, 29941, 29892, 29871, 29941, 511, 302, 5727, 29922, 29896, 29892, 302, 22724, 29922, 29896, 29892, 270, 1631, 29922, 29896, 29900, 29900, 29897, 13, 13, 1678, 396, 1165, 353, 27815, 29961, 29900, 29892, 29900, 29962, 13, 1678, 396, 1165, 29889, 1188, 1188, 29898, 29888, 29900, 29930, 29896, 29872, 29899, 29941, 29892, 447, 29888, 29900, 29892, 376, 29878, 613, 1196, 2103, 29922, 29896, 29889, 29906, 29892, 3858, 543, 29903, 1219, 313, 29896, 29929, 29955, 29945, 25760, 13, 1678, 396, 1165, 29889, 1188, 1188, 29898, 29888, 29900, 29930, 29896, 29872, 29899, 29941, 29892, 447, 29888, 29896, 29892, 376, 29890, 613, 1196, 2103, 29922, 29896, 29889, 29906, 29892, 3858, 543, 29928, 1718, 29925, 29906, 1159, 13, 1678, 396, 1165, 29889, 842, 29918, 29891, 1643, 703, 29950, 5098, 29892, 341, 12661, 613, 4079, 8977, 29922, 5657, 29897, 13, 1678, 396, 1165, 29889, 842, 29918, 29916, 2576, 29898, 29896, 29872, 29899, 29953, 29892, 29896, 29872, 29899, 29896, 29897, 13, 1678, 396, 1165, 29889, 26172, 29898, 2029, 29922, 29906, 29892, 14801, 9748, 29922, 29941, 29892, 4079, 2311, 29922, 29947, 29892, 3515, 265, 29922, 5574, 29897, 13, 1678, 396, 1165, 29889, 726, 29898, 29900, 29889, 29906, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 364, 29908, 29898, 29874, 29897, 779, 4161, 29922, 29900, 29985, 29877, 29938, 613, 14698, 2520, 358, 543, 5064, 613, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 13, 1678, 396, 1165, 353, 27815, 29961, 29900, 29892, 29896, 29962, 13, 1678, 396, 1165, 29889, 842, 29918, 3637, 7358, 4197, 2314, 13, 1678, 396, 1165, 353, 4853, 29889, 29873, 5080, 29916, 580, 13, 1678, 396, 1165, 29889, 1188, 1188, 29898, 1181, 29892, 301, 29900, 29892, 376, 29878, 613, 1196, 2103, 29922, 29896, 29889, 29906, 29892, 3858, 543, 29903, 1219, 313, 29896, 29929, 29955, 29945, 25760, 13, 1678, 4853, 29889, 1188, 1188, 29898, 1181, 29892, 301, 29896, 29892, 376, 26031, 1127, 613, 19375, 543, 489, 613, 1196, 2103, 29922, 29900, 29889, 29947, 29892, 3858, 543, 29928, 1718, 29925, 1159, 13, 1678, 4853, 29889, 842, 29918, 29916, 2576, 29898, 29896, 29892, 29906, 29900, 29900, 29897, 13, 1678, 4853, 29889, 842, 29918, 29891, 2576, 29898, 29896, 29892, 29896, 29872, 29945, 29897, 13, 1678, 4853, 29889, 842, 29918, 29891, 1643, 703, 4920, 29879, 272, 683, 29892, 270, 29933, 613, 4079, 8977, 29922, 5657, 29897, 13, 1678, 396, 1165, 29889, 26172, 29898, 2029, 29922, 29896, 29892, 14801, 9748, 29922, 29941, 29892, 4079, 2311, 29922, 29947, 29892, 3515, 265, 29922, 5574, 29897, 13, 1678, 4853, 29889, 726, 29898, 29900, 29889, 29945, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 364, 29908, 4535, 4161, 29922, 29900, 29985, 29877, 1628, 395, 29902, 1665, 3411, 5369, 29906, 29889, 29906, 29905, 3706, 29871, 29896, 29900, 3426, 29946, 1042, 395, 29956, 29885, 3426, 29906, 1042, 613, 14698, 2520, 358, 543, 5064, 613, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 13, 1678, 396, 1165, 353, 27815, 29961, 29896, 29892, 29900, 29962, 13, 1678, 396, 1165, 29889, 1188, 1188, 7373, 29888, 29900, 3383, 903, 29939, 29877, 29918, 7503, 29892, 29900, 1402, 376, 307, 613, 29320, 675, 29922, 29896, 29889, 29906, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 16586, 8435, 1159, 13, 1678, 396, 1165, 29889, 1188, 1188, 7373, 29888, 29900, 3383, 903, 29939, 29877, 29918, 7503, 29892, 29896, 1402, 376, 1484, 613, 29320, 675, 29922, 29900, 29889, 29947, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 485, 2844, 617, 8435, 1159, 13, 1678, 396, 1165, 29889, 1188, 1188, 7373, 29888, 29900, 3383, 903, 29939, 29877, 29918, 7503, 29892, 29906, 1402, 376, 833, 613, 29320, 675, 29922, 29896, 29889, 29906, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 485, 2844, 8337, 8435, 1159, 13, 1678, 396, 1165, 29889, 1188, 1188, 7373, 29888, 29900, 3383, 903, 29939, 29877, 29918, 7503, 29892, 29941, 1402, 376, 2901, 613, 29320, 675, 29922, 29896, 29889, 29906, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 2774, 4678, 3433, 648, 1004, 8435, 1159, 13, 1678, 396, 1165, 29889, 842, 29918, 29891, 1643, 703, 29950, 5098, 29892, 341, 12661, 613, 4079, 8977, 29922, 5657, 29897, 13, 1678, 396, 1165, 29889, 842, 29918, 29916, 1643, 29898, 29878, 29908, 29903, 29990, 29934, 29892, 395, 29956, 29885, 3426, 29906, 1042, 613, 4079, 8977, 29922, 5657, 29897, 13, 1678, 396, 1165, 29889, 842, 29918, 29916, 2576, 29898, 29896, 29872, 29899, 29953, 29892, 29896, 29872, 29899, 29896, 29897, 13, 1678, 396, 1165, 29889, 26172, 29898, 2029, 29922, 29906, 29892, 14801, 9748, 29922, 29941, 29892, 4079, 2311, 29922, 29947, 29892, 3515, 265, 29922, 5574, 29897, 13, 1678, 396, 1165, 29889, 726, 29898, 29900, 29889, 29906, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 364, 29908, 29898, 29890, 29897, 779, 4161, 29922, 29900, 29985, 29877, 29938, 613, 14698, 2520, 358, 543, 5064, 613, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 13, 1678, 396, 1165, 353, 27815, 29961, 29896, 29892, 29896, 29962, 13, 1678, 4853, 29889, 842, 29918, 29916, 1643, 703, 23923, 23860, 29892, 341, 12661, 613, 4079, 8977, 29922, 5657, 29897, 13, 1678, 396, 1165, 29889, 842, 29918, 3637, 7358, 4197, 2314, 13, 1678, 396, 1165, 353, 4853, 29889, 29873, 5080, 29916, 580, 13, 1678, 4853, 29889, 1188, 1188, 29898, 1181, 29892, 3667, 29879, 29889, 3844, 6983, 7373, 417, 29918, 7503, 29892, 29900, 29892, 29900, 1402, 29871, 29896, 29896, 511, 376, 29878, 613, 1196, 2103, 29922, 29896, 29889, 29906, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 16586, 8435, 1159, 13, 1678, 4853, 29889, 1188, 1188, 29898, 1181, 29892, 3667, 29879, 29889, 3844, 6983, 7373, 417, 29918, 7503, 29892, 29896, 29892, 29900, 1402, 29871, 29896, 29896, 511, 376, 29887, 613, 1196, 2103, 29922, 29900, 29889, 29947, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 485, 2844, 617, 8435, 1159, 13, 1678, 4853, 29889, 1188, 1188, 29898, 1181, 29892, 3667, 29879, 29889, 3844, 6983, 7373, 417, 29918, 7503, 29892, 29906, 29892, 29900, 1402, 29871, 29896, 29896, 511, 376, 29890, 613, 1196, 2103, 29922, 29896, 29889, 29906, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 485, 2844, 8337, 8435, 1159, 13, 1678, 4853, 29889, 1188, 1188, 29898, 1181, 29892, 3667, 29879, 29889, 3844, 6983, 7373, 417, 29918, 7503, 29892, 29941, 29892, 29900, 1402, 29871, 29896, 29896, 511, 376, 29895, 613, 1196, 2103, 29922, 29896, 29889, 29906, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 2774, 4678, 3433, 648, 1004, 8435, 1159, 13, 1678, 4853, 29889, 842, 29918, 29891, 2576, 29898, 29896, 29892, 29896, 29872, 29945, 29897, 13, 1678, 4853, 29889, 842, 29918, 29916, 2576, 29898, 29896, 29892, 29906, 29900, 29900, 29897, 13, 1678, 4853, 29889, 842, 29918, 29891, 1643, 703, 4920, 29879, 272, 683, 29892, 270, 29933, 613, 4079, 8977, 29922, 5657, 29897, 13, 1678, 4853, 29889, 26172, 29898, 2029, 29922, 29896, 29892, 14801, 9748, 29922, 29941, 29892, 4079, 2311, 29922, 29947, 29892, 3515, 265, 29922, 5574, 29897, 13, 1678, 4853, 29889, 726, 29898, 29900, 29889, 29945, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 364, 29908, 4535, 4161, 29922, 29900, 29985, 29877, 1628, 395, 29902, 1665, 3411, 5369, 29906, 29889, 29906, 29905, 3706, 29871, 29896, 29900, 3426, 29946, 1042, 395, 29956, 29885, 3426, 29906, 1042, 613, 14698, 2520, 358, 543, 5064, 613, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 13, 1678, 2537, 29889, 7620, 1003, 703, 29918, 8346, 29918, 29914, 4878, 29900, 29889, 2732, 613, 289, 1884, 29918, 262, 6609, 543, 29873, 523, 1159, 13, 1678, 736, 13, 13, 1753, 903, 4878, 29896, 23538, 5085, 1125, 13, 1678, 9995, 14305, 627, 310, 4266, 1741, 1206, 6559, 9995, 13, 1678, 3415, 29879, 29892, 20371, 29892, 8665, 29892, 10614, 353, 518, 6008, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29945, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29953, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29955, 29897, 1402, 29905, 13, 18884, 6796, 29879, 567, 3284, 29879, 567, 3284, 29879, 567, 12436, 29905, 13, 18884, 518, 6008, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29945, 29892, 29896, 29955, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29953, 29892, 29896, 29896, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29955, 29892, 29896, 29941, 29892, 29941, 29900, 29897, 1402, 29905, 13, 18884, 518, 6008, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29945, 29892, 29896, 29929, 29892, 29941, 29900, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29953, 29892, 29896, 29955, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29955, 29892, 29929, 29892, 29955, 29892, 29896, 29929, 4638, 13, 1678, 363, 3415, 29892, 364, 29892, 1369, 29892, 1095, 297, 14319, 29898, 29872, 4270, 29892, 20371, 29892, 8665, 29892, 10614, 1125, 13, 4706, 565, 6389, 29889, 29097, 1275, 376, 16264, 29883, 1115, 13, 9651, 9920, 353, 376, 4691, 29611, 29889, 2272, 448, 29886, 25989, 29883, 448, 29878, 426, 29878, 29913, 448, 5750, 426, 5750, 29913, 448, 29879, 426, 29879, 29913, 448, 29872, 426, 29872, 29913, 448, 29894, 448, 1341, 426, 1341, 29913, 1642, 4830, 29898, 29878, 29922, 29878, 29892, 13, 462, 1678, 3415, 29922, 5750, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 4968, 269, 29922, 2962, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 4968, 13, 462, 1678, 321, 29922, 355, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 4968, 1424, 29922, 29945, 29889, 29906, 29946, 29897, 13, 9651, 1596, 703, 15691, 9920, 29897, 13, 9651, 2897, 29889, 5205, 29898, 9006, 29897, 13, 4706, 25342, 6389, 29889, 29097, 1275, 376, 29888, 8663, 1115, 13, 9651, 9920, 353, 376, 4691, 29611, 29889, 2272, 448, 29886, 285, 8663, 448, 29878, 426, 29878, 29913, 448, 5750, 426, 5750, 29913, 448, 29879, 426, 29879, 29913, 448, 29872, 426, 29872, 29913, 448, 29894, 448, 1341, 426, 1341, 29913, 448, 1758, 1642, 4830, 29898, 29878, 29922, 29878, 29892, 13, 462, 1678, 3415, 29922, 5750, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 4968, 269, 29922, 2962, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 4968, 13, 462, 1678, 321, 29922, 355, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 4968, 1424, 29922, 29945, 29889, 29906, 29946, 29897, 13, 9651, 1596, 703, 15691, 9920, 29897, 13, 9651, 2897, 29889, 5205, 29898, 9006, 29897, 13, 1678, 565, 6389, 29889, 29097, 1275, 376, 5317, 1115, 29871, 13, 4706, 19200, 353, 22889, 29889, 15190, 29889, 2539, 18522, 11702, 29950, 1159, 13, 4706, 2537, 29892, 27815, 353, 14770, 29889, 1491, 26762, 29898, 1003, 2311, 7607, 29929, 29892, 29871, 29945, 511, 302, 5727, 29922, 29906, 29892, 302, 22724, 29922, 29941, 29892, 270, 1631, 29922, 29896, 29945, 29900, 29897, 13, 4706, 2537, 29889, 1491, 26762, 29918, 328, 5143, 29898, 14158, 21098, 29896, 29892, 281, 3493, 21098, 29941, 29897, 13, 13, 4706, 474, 353, 29871, 29900, 13, 4706, 19178, 353, 6796, 29924, 29906, 29889, 29941, 613, 376, 29990, 29929, 29889, 29941, 613, 376, 29990, 29896, 29889, 29955, 3108, 13, 4706, 363, 3415, 29892, 1369, 29892, 1095, 297, 14319, 29898, 29872, 4270, 29892, 8665, 29892, 10614, 1125, 13, 9651, 903, 29990, 29918, 353, 10518, 29889, 949, 29918, 7638, 703, 2917, 29914, 4130, 29914, 4878, 29896, 29889, 5750, 29912, 29873, 1836, 7638, 1642, 4830, 29898, 29873, 29922, 29875, 876, 13, 9651, 903, 29990, 29918, 3366, 6008, 3108, 353, 518, 5750, 718, 11636, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29882, 29897, 363, 298, 297, 903, 29990, 5396, 6008, 29962, 13, 9651, 903, 29990, 29918, 353, 903, 29990, 5396, 6605, 29918, 5975, 29898, 1609, 29922, 3366, 6008, 20068, 13, 9651, 4853, 353, 27815, 29961, 29900, 29892, 29875, 29962, 13, 9651, 330, 359, 353, 3667, 29879, 29889, 949, 29918, 1484, 267, 29898, 5750, 29897, 13, 9651, 784, 353, 376, 29878, 29908, 13, 9651, 4853, 353, 2927, 292, 29918, 1165, 267, 29898, 1165, 29892, 784, 543, 29895, 1159, 13, 9651, 4853, 29889, 12846, 309, 6933, 29898, 29887, 359, 29889, 1256, 29892, 29887, 359, 29889, 29933, 29918, 7520, 29954, 29892, 1054, 29892, 16292, 29922, 29900, 29889, 29955, 29945, 29892, 3858, 543, 29903, 29990, 29934, 14544, 29896, 28753, 29947, 302, 29885, 25760, 13, 9651, 4853, 29889, 12846, 309, 6933, 29898, 29887, 359, 29889, 1256, 29892, 29887, 359, 29889, 29909, 29918, 7520, 29954, 1699, 29890, 613, 16292, 29922, 29900, 29889, 29955, 29945, 29892, 3858, 543, 29950, 29990, 29934, 14544, 29900, 29945, 28753, 29946, 302, 29885, 25760, 13, 9651, 565, 474, 1360, 29906, 29901, 4853, 29889, 26172, 29898, 29890, 1884, 29918, 517, 29918, 25367, 7607, 29896, 29889, 29946, 29892, 29871, 29900, 29889, 29945, 511, 14801, 9748, 29922, 29941, 29892, 302, 1054, 29922, 29896, 29892, 4079, 2311, 29922, 29947, 29892, 3515, 265, 29922, 5574, 29897, 13, 9651, 4853, 29889, 842, 29918, 29891, 2576, 29898, 29896, 29872, 29899, 29947, 29892, 29896, 29872, 29899, 29941, 29897, 13, 9651, 4853, 29889, 842, 29918, 3637, 7358, 4197, 29896, 29872, 29899, 29947, 29892, 29871, 29896, 29872, 29899, 29955, 29892, 29871, 29896, 29872, 29899, 29953, 29892, 29871, 29896, 29872, 29899, 29945, 29892, 29871, 29896, 29872, 29899, 29946, 29892, 29896, 29872, 29899, 29941, 2314, 13, 9651, 4853, 29889, 842, 29918, 29916, 2576, 29898, 2962, 29892, 355, 29897, 13, 9651, 565, 474, 1360, 29900, 29901, 4853, 29889, 842, 29918, 29891, 1643, 29898, 29878, 29908, 29903, 10170, 2379, 1314, 29892, 395, 29956, 29885, 3426, 29906, 1042, 613, 5657, 8977, 29922, 5657, 29897, 13, 9651, 4079, 3366, 2780, 3108, 353, 376, 29895, 29908, 13, 9651, 4079, 3366, 2780, 3108, 353, 376, 26031, 12692, 29908, 13, 9651, 4853, 29889, 726, 29898, 29900, 29889, 29945, 29892, 29896, 29889, 29900, 29945, 1699, 29995, 29879, 29892, 1273, 29879, 29908, 29995, 29898, 5750, 29889, 710, 615, 603, 11702, 29881, 1273, 29890, 1273, 29979, 4968, 19178, 29961, 29875, 11724, 22672, 2520, 358, 543, 5064, 613, 13, 462, 9651, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 5657, 8977, 29922, 5657, 29897, 13, 9651, 4079, 3366, 2780, 3108, 353, 376, 29895, 29908, 13, 13, 9651, 4853, 353, 27815, 29961, 29896, 29892, 29875, 29962, 13, 9651, 4853, 353, 2927, 292, 29918, 1165, 267, 29898, 1165, 29892, 784, 543, 29895, 1159, 13, 9651, 565, 474, 1360, 29900, 29901, 13, 18884, 4853, 29889, 842, 29918, 29891, 1643, 703, 6039, 2140, 800, 320, 29876, 379, 29943, 24650, 272, 683, 29892, 4833, 613, 5657, 8977, 29922, 5657, 29897, 13, 9651, 4853, 29889, 1557, 2620, 7373, 29990, 29918, 28513, 29990, 5396, 4299, 26359, 29940, 16862, 6008, 29892, 903, 29990, 29918, 28513, 29990, 5396, 4299, 26359, 29940, 16862, 2585, 29892, 269, 29922, 29941, 1696, 2927, 543, 21012, 613, 15595, 29922, 29900, 29889, 29947, 29892, 17456, 543, 29928, 613, 3858, 543, 29902, 265, 359, 13469, 1159, 13, 9651, 396, 1165, 29889, 26172, 29898, 2029, 29922, 29896, 29892, 14801, 9748, 29922, 29941, 29892, 4079, 2311, 29922, 29947, 29892, 3515, 265, 29922, 5574, 29897, 13, 9651, 396, 1165, 29889, 726, 29898, 29900, 29889, 29941, 29945, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 18227, 29874, 29889, 29995, 29881, 29897, 11860, 29898, 29875, 29974, 29896, 29897, 718, 3415, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 1159, 13578, 501, 29911, 613, 14698, 2520, 358, 543, 5064, 613, 29871, 13, 9651, 396, 4706, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 13, 9651, 285, 978, 353, 376, 1272, 29914, 3601, 19248, 1256, 6822, 29888, 8663, 29889, 29879, 567, 29889, 17608, 29889, 18828, 1642, 4830, 29898, 1256, 29922, 5750, 29889, 710, 615, 603, 11702, 29979, 29889, 29995, 29885, 29889, 29995, 29881, 29889, 29995, 29950, 29889, 29995, 29924, 5783, 13, 9651, 2897, 29889, 5205, 703, 29887, 7554, 448, 29881, 376, 718, 285, 978, 29897, 13, 9651, 302, 29883, 353, 13373, 24541, 29898, 29888, 978, 29889, 6506, 17350, 18828, 3284, 5783, 13, 9651, 2897, 29889, 5205, 703, 29887, 7554, 376, 718, 285, 978, 29889, 6506, 17350, 18828, 3284, 5783, 13, 9651, 3064, 353, 954, 29906, 1256, 29898, 17608, 29889, 20897, 3366, 2230, 3108, 7503, 1402, 302, 29883, 29889, 20897, 3366, 2230, 16862, 348, 1169, 29892, 302, 29883, 29889, 20897, 3366, 2230, 16862, 23392, 29897, 13, 9651, 3064, 353, 7442, 29889, 2378, 4197, 29916, 3032, 517, 29918, 6370, 29918, 12673, 580, 363, 921, 297, 3064, 14664, 579, 668, 703, 12673, 29953, 29946, 29961, 1983, 29962, 1159, 13, 9651, 3064, 353, 518, 6008, 29889, 12673, 29889, 329, 29883, 3166, 16394, 29898, 29916, 29889, 579, 668, 29898, 524, 29897, 334, 29871, 29896, 29872, 29899, 29929, 29897, 363, 921, 297, 3064, 29962, 13, 9651, 4853, 29889, 5317, 29898, 3706, 29892, 29871, 29906, 29930, 17608, 29889, 20897, 3366, 29881, 2390, 3108, 7503, 1402, 376, 26031, 1127, 613, 19375, 543, 489, 613, 1196, 2103, 29922, 29900, 29889, 29947, 29892, 3858, 543, 8353, 3301, 29906, 1159, 13, 9651, 4853, 29889, 5317, 29898, 3706, 29892, 29871, 29906, 29930, 13239, 29889, 524, 29918, 6897, 272, 683, 29898, 17608, 29889, 20897, 3366, 6897, 29889, 801, 29889, 16586, 29889, 29877, 3108, 7503, 1402, 1904, 3366, 284, 1372, 12436, 1294, 3149, 29922, 29953, 29947, 511, 376, 29878, 613, 13, 462, 462, 4706, 1196, 2103, 29922, 29896, 29889, 29906, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 16586, 8435, 1159, 13, 9651, 4853, 29889, 5317, 29898, 3706, 29892, 29871, 29906, 29930, 13239, 29889, 524, 29918, 6897, 272, 683, 29898, 17608, 29889, 20897, 3366, 6897, 29889, 801, 29889, 485, 29889, 617, 29889, 29877, 3108, 7503, 1402, 1904, 3366, 284, 1372, 12436, 1294, 3149, 29922, 29953, 29946, 511, 376, 29887, 613, 13, 462, 1678, 1196, 2103, 29922, 29900, 29889, 29947, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 485, 2844, 617, 8435, 1159, 13, 9651, 4853, 29889, 5317, 29898, 3706, 29892, 29871, 29906, 29930, 13239, 29889, 524, 29918, 6897, 272, 683, 29898, 17608, 29889, 20897, 3366, 6897, 29889, 801, 29889, 485, 29889, 8337, 29889, 29877, 3108, 7503, 1402, 1904, 3366, 284, 1372, 12436, 1294, 3149, 29922, 29953, 29946, 511, 376, 29890, 613, 13, 462, 1678, 1196, 2103, 29922, 29896, 29889, 29906, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 485, 2844, 8337, 8435, 1159, 13, 9651, 4853, 29889, 5317, 29898, 3706, 29892, 29871, 29906, 29930, 13239, 29889, 524, 29918, 6897, 272, 683, 29898, 17608, 29889, 20897, 3366, 6897, 29889, 2774, 29889, 615, 29889, 29877, 3108, 7503, 1402, 1904, 3366, 284, 1372, 12436, 1294, 3149, 29922, 29953, 29946, 511, 376, 29895, 613, 13, 462, 1678, 1196, 2103, 29922, 29900, 29889, 29947, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 801, 4678, 3433, 648, 485, 2844, 617, 8435, 1159, 13, 9651, 4853, 29889, 842, 29918, 29916, 2576, 29898, 2962, 29892, 1095, 29897, 13, 9651, 4853, 29889, 1557, 2620, 7373, 29990, 29918, 28513, 29990, 5396, 4299, 26359, 29979, 16862, 6008, 29892, 903, 29990, 29918, 28513, 29990, 5396, 4299, 26359, 29979, 16862, 2585, 29892, 269, 29922, 29896, 29889, 29906, 29892, 2927, 543, 26031, 1127, 613, 29871, 13, 462, 1678, 15595, 29922, 29900, 29889, 29947, 29892, 3858, 543, 3226, 29894, 457, 634, 394, 29889, 313, 29906, 29900, 29896, 29929, 25760, 13, 9651, 565, 474, 1360, 29906, 29901, 4853, 29889, 26172, 29898, 29890, 1884, 29918, 517, 29918, 25367, 7607, 29896, 29889, 29896, 29906, 29892, 29871, 29900, 29889, 29929, 511, 14801, 9748, 29922, 29941, 29892, 4079, 2311, 29922, 29947, 29892, 3515, 265, 29922, 5574, 29897, 13, 9651, 396, 1165, 29889, 726, 29898, 29900, 29889, 29945, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 18227, 29890, 29889, 29995, 29881, 29897, 11860, 29898, 29875, 29974, 29896, 29897, 718, 3415, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 1159, 13578, 501, 29911, 29892, 732, 29953, 29889, 29946, 341, 12661, 613, 14698, 2520, 358, 543, 5064, 613, 29871, 13, 9651, 396, 4706, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 9651, 474, 4619, 29871, 29896, 13, 13, 4706, 27815, 29961, 29896, 29892, 29900, 1822, 842, 29918, 29916, 1643, 703, 2481, 313, 2692, 19123, 4079, 8977, 29922, 5657, 29897, 13, 4706, 27815, 29961, 29896, 29892, 29896, 1822, 842, 29918, 29916, 1643, 703, 2481, 313, 2692, 19123, 4079, 8977, 29922, 5657, 29897, 13, 4706, 27815, 29961, 29896, 29892, 29906, 1822, 842, 29918, 29916, 1643, 703, 2481, 313, 2692, 19123, 4079, 8977, 29922, 5657, 29897, 13, 4706, 4079, 3366, 2780, 3108, 353, 376, 29895, 29908, 13, 4706, 2537, 29889, 1300, 974, 4378, 29918, 29916, 1256, 29898, 5450, 362, 29922, 29906, 29945, 29892, 2350, 543, 5064, 1159, 13, 4706, 2537, 29889, 7620, 1003, 703, 29918, 8346, 29918, 29914, 4878, 29896, 29889, 2732, 613, 289, 1884, 29918, 262, 6609, 543, 29873, 523, 1159, 13, 1678, 736, 13, 13, 1753, 903, 4878, 29906, 23538, 5085, 1125, 13, 1678, 9995, 4321, 292, 11966, 10430, 26307, 9995, 13, 1678, 6389, 29889, 3696, 29892, 6389, 29889, 5378, 29892, 6389, 29889, 2962, 29892, 6389, 29889, 355, 353, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29896, 29892, 29929, 29892, 29955, 29892, 29906, 29906, 29892, 29941, 29947, 511, 376, 14047, 2589, 613, 29905, 13, 9651, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29896, 29892, 29929, 29892, 29955, 29892, 29906, 29906, 29892, 29896, 29900, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29896, 29892, 29929, 29892, 29955, 29892, 29906, 29941, 29892, 29906, 29900, 29897, 13, 1678, 1369, 29892, 1095, 353, 29871, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29896, 29892, 29929, 29892, 29955, 29892, 29906, 29906, 29892, 29941, 29900, 511, 11636, 29889, 12673, 29898, 29906, 29900, 29896, 29896, 29892, 29929, 29892, 29955, 29892, 29906, 29941, 29892, 29900, 29897, 13, 1678, 17067, 280, 29883, 353, 7442, 29889, 1915, 3493, 29898, 29900, 29889, 29955, 29945, 29892, 29896, 29889, 29955, 29945, 29892, 29896, 29900, 29896, 29897, 13, 1678, 565, 6389, 29889, 29097, 1275, 376, 16264, 29883, 1115, 13, 4706, 9920, 353, 376, 4691, 29611, 29889, 2272, 448, 29886, 25989, 29883, 448, 29878, 426, 29878, 29913, 448, 5750, 426, 5750, 29913, 448, 29879, 426, 29879, 29913, 448, 29872, 426, 29872, 29913, 448, 29894, 1642, 4830, 29898, 29878, 29922, 5085, 29889, 5378, 29892, 13, 18884, 3415, 29922, 5085, 29889, 3696, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 4968, 269, 29922, 5085, 29889, 2962, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 4968, 13, 18884, 321, 29922, 5085, 29889, 355, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 5783, 13, 4706, 1596, 703, 15691, 9920, 29897, 13, 4706, 2897, 29889, 5205, 29898, 9006, 29897, 13, 1678, 25342, 6389, 29889, 29097, 1275, 376, 29888, 8663, 1115, 13, 4706, 363, 260, 297, 17067, 280, 29883, 29901, 13, 9651, 1596, 703, 17067, 280, 29883, 29901, 613, 260, 29897, 13, 9651, 8125, 29898, 5085, 29889, 5378, 29892, 6389, 29889, 3696, 29892, 6389, 467, 29918, 4548, 29918, 703, 4330, 280, 29883, 613, 8853, 4330, 280, 29883, 1115, 260, 1800, 13, 1678, 25342, 6389, 29889, 29097, 1275, 376, 5317, 1115, 13, 4706, 22889, 29889, 2214, 9629, 3366, 486, 860, 29889, 1643, 2311, 3108, 353, 29871, 29953, 13, 4706, 22889, 29889, 2214, 9629, 3366, 3637, 860, 29889, 1643, 2311, 3108, 353, 29871, 29953, 13, 4706, 22889, 29889, 2214, 9629, 3366, 755, 726, 29889, 4381, 3108, 353, 376, 4381, 29908, 13, 4706, 4079, 353, 8853, 11922, 1115, 376, 643, 361, 613, 376, 2780, 1115, 29871, 376, 8517, 613, 376, 7915, 1115, 376, 8945, 613, 376, 2311, 1115, 29871, 29953, 29913, 13, 4706, 4079, 726, 353, 8853, 11922, 1115, 376, 643, 361, 613, 376, 2780, 1115, 29871, 376, 9539, 613, 376, 7915, 1115, 376, 8945, 613, 376, 2311, 1115, 29871, 29953, 29913, 13, 4706, 19200, 353, 22889, 29889, 15190, 29889, 2539, 18522, 11702, 29950, 16664, 29924, 1159, 13, 4706, 2537, 29892, 27815, 353, 14770, 29889, 1491, 26762, 29898, 1003, 2311, 7607, 29953, 29892, 29871, 29906, 511, 302, 5727, 29922, 29896, 29892, 302, 22724, 29922, 29906, 29892, 270, 1631, 29922, 29896, 29900, 29900, 29897, 13, 4706, 396, 1165, 353, 27815, 29961, 29900, 29962, 13, 4706, 396, 5215, 6579, 4151, 2986, 29889, 8704, 408, 24512, 13, 4706, 396, 5215, 6579, 4151, 2986, 29889, 16202, 29918, 12171, 408, 24512, 29918, 16202, 13, 4706, 396, 3166, 4560, 2272, 29889, 16202, 1053, 6056, 13, 4706, 396, 29916, 353, 7442, 29889, 1915, 3493, 29898, 29900, 29889, 29945, 29892, 29906, 29892, 29896, 29945, 29896, 29897, 13, 4706, 396, 2029, 353, 24512, 29889, 8704, 29898, 29916, 29892, 1002, 29918, 9891, 29922, 5824, 29918, 16202, 29889, 12676, 467, 1767, 13, 4706, 396, 7052, 353, 24512, 29889, 8704, 29898, 29916, 29892, 1002, 29918, 9891, 29922, 5824, 29918, 16202, 29889, 4172, 467, 1767, 13, 4706, 396, 1165, 29889, 5317, 29898, 29916, 29892, 6056, 29889, 5140, 29898, 29916, 29892, 1180, 29922, 2029, 29892, 6287, 29922, 7052, 511, 376, 29878, 613, 301, 29893, 29922, 29900, 29889, 29947, 29892, 15595, 29922, 29900, 29889, 29953, 29897, 13, 4706, 396, 1165, 29889, 726, 29898, 29900, 29889, 29945, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 364, 29908, 29898, 29874, 29897, 17740, 310, 395, 29911, 29918, 29881, 29938, 613, 14698, 2520, 358, 543, 5064, 613, 13, 4706, 396, 4706, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 4706, 2066, 353, 13149, 29889, 23705, 703, 1272, 29914, 3601, 19248, 5200, 6822, 29888, 8663, 29930, 4330, 280, 29883, 29930, 1642, 4830, 29898, 5200, 29922, 5085, 29889, 3696, 29889, 710, 615, 603, 11702, 29979, 29889, 29995, 29885, 29889, 29995, 29881, 29889, 29995, 29950, 29889, 29995, 29924, 29908, 4961, 13, 4706, 4853, 353, 27815, 29961, 29900, 29962, 13, 4706, 4853, 29889, 29916, 8990, 29889, 842, 29918, 21355, 29918, 689, 2620, 29898, 23479, 29897, 13, 4706, 2066, 29889, 6605, 580, 13, 4706, 1060, 353, 5159, 13, 4706, 903, 6897, 29918, 353, 3667, 29879, 29889, 949, 29918, 374, 8328, 29898, 5085, 29889, 3696, 29892, 6389, 29889, 5378, 29897, 13, 4706, 903, 6897, 29918, 353, 903, 6897, 29918, 29961, 7373, 6897, 5396, 1256, 1405, 1369, 29897, 669, 9423, 6897, 5396, 1256, 529, 1095, 29899, 6008, 29889, 9346, 287, 2554, 29898, 1195, 2667, 29922, 29896, 28166, 13, 4706, 274, 1958, 353, 22889, 29889, 4912, 29889, 657, 29918, 29883, 1958, 703, 29934, 5779, 1159, 13, 4706, 341, 29916, 353, 7442, 29889, 3298, 359, 3552, 524, 3552, 355, 29899, 2962, 467, 7827, 29918, 23128, 580, 29914, 29953, 29900, 511, 7431, 29898, 5325, 4961, 13, 4706, 363, 474, 29892, 29888, 297, 26985, 29898, 5325, 1125, 13, 9651, 2897, 29889, 5205, 703, 29887, 7554, 448, 29881, 376, 718, 285, 29897, 13, 9651, 302, 29883, 353, 13373, 24541, 29898, 29888, 29889, 6506, 17350, 18828, 613, 5124, 876, 13, 9651, 2897, 29889, 5205, 703, 29887, 7554, 376, 718, 285, 29889, 6506, 17350, 18828, 613, 5124, 876, 13, 9651, 3064, 353, 954, 29906, 1256, 29898, 17608, 29889, 20897, 3366, 2230, 3108, 7503, 1402, 302, 29883, 29889, 20897, 3366, 2230, 16862, 348, 1169, 29892, 302, 29883, 29889, 20897, 3366, 2230, 16862, 23392, 29897, 13, 9651, 3064, 353, 7442, 29889, 2378, 4197, 29916, 3032, 517, 29918, 6370, 29918, 12673, 580, 363, 921, 297, 3064, 14664, 579, 668, 703, 12673, 29953, 29946, 29961, 1983, 29962, 1159, 13, 9651, 3064, 353, 518, 6008, 29889, 12673, 29889, 329, 29883, 3166, 16394, 29898, 29916, 29889, 579, 668, 29898, 524, 29897, 334, 29871, 29896, 29872, 29899, 29929, 29897, 363, 921, 297, 3064, 29962, 13, 9651, 396, 361, 7442, 29889, 1545, 29898, 29875, 29892, 29906, 29900, 29897, 1360, 29900, 29901, 4853, 29889, 5317, 29898, 3706, 29892, 3667, 29879, 29889, 3844, 6983, 29898, 13239, 29889, 524, 29918, 6897, 272, 683, 29898, 17608, 29889, 20897, 3366, 6897, 29889, 801, 29889, 16586, 29889, 29877, 3108, 7503, 1402, 13, 9651, 396, 1678, 1904, 3366, 284, 1372, 12436, 1294, 3149, 29922, 29953, 29947, 511, 29871, 29945, 511, 2927, 29922, 29883, 1958, 11891, 29906, 17108, 29875, 29914, 29906, 29900, 29900, 8243, 29871, 13, 9651, 396, 1678, 1196, 2103, 29922, 29900, 29889, 29953, 29892, 19375, 543, 489, 613, 3858, 29922, 29878, 29908, 29938, 29911, 29918, 29881, 29938, 29922, 15543, 29906, 29888, 29908, 29995, 4330, 280, 29883, 29961, 29875, 2314, 13, 9651, 286, 353, 10518, 29889, 17271, 580, 13, 9651, 286, 3366, 1256, 3108, 353, 3064, 13, 9651, 286, 3366, 29882, 29888, 29918, 6897, 3108, 353, 3667, 29879, 29889, 3844, 6983, 29898, 13239, 29889, 524, 29918, 6897, 272, 683, 29898, 17608, 29889, 20897, 3366, 6897, 29889, 801, 29889, 16586, 29889, 29877, 3108, 7503, 1402, 1904, 3366, 284, 1372, 12436, 1294, 3149, 29922, 29953, 29947, 511, 29871, 29945, 29897, 13, 9651, 286, 353, 286, 15625, 29885, 29889, 1256, 6736, 1369, 29897, 669, 313, 29885, 29889, 1256, 529, 1095, 4638, 13, 9651, 341, 29916, 7503, 29892, 29875, 29962, 353, 286, 29889, 29882, 29888, 29918, 6897, 29889, 25027, 391, 580, 13, 9651, 321, 353, 3667, 29879, 29889, 342, 6490, 29918, 2704, 29898, 29885, 29892, 903, 6897, 19925, 13, 9651, 1060, 29889, 4397, 29898, 29872, 29897, 13, 4706, 4853, 29889, 5317, 7373, 6897, 5396, 1256, 29892, 903, 6897, 5396, 29882, 29888, 29918, 6897, 29892, 376, 2901, 613, 15595, 29922, 29900, 29889, 29946, 29892, 29320, 675, 29922, 29900, 29889, 29896, 29892, 3858, 29922, 29878, 29908, 4535, 3571, 648, 29934, 1042, 613, 301, 29893, 21098, 29946, 29897, 13, 4706, 28597, 29892, 380, 353, 29871, 29896, 29889, 29906, 29930, 9302, 29889, 2168, 713, 29898, 29924, 29916, 29892, 9685, 29922, 29896, 511, 29871, 29896, 29889, 29929, 29947, 29930, 9302, 29889, 4172, 29898, 29924, 29916, 29892, 9685, 29922, 29896, 29897, 13, 4706, 4853, 29889, 5317, 29898, 29885, 29889, 1256, 29892, 28597, 29892, 2927, 543, 29878, 613, 1196, 2103, 29922, 29900, 29889, 29947, 29892, 19375, 543, 489, 613, 3858, 29922, 29878, 29908, 4535, 3571, 29918, 29885, 29938, 1159, 13, 4706, 4853, 29889, 5589, 29918, 14811, 29898, 29885, 29889, 1256, 29892, 28597, 448, 380, 29892, 28597, 718, 380, 29892, 2927, 543, 29878, 613, 15595, 29922, 29900, 29889, 29945, 29892, 3858, 543, 29929, 29945, 29995, 25781, 1159, 13, 4706, 1060, 353, 7442, 29889, 2378, 29898, 29990, 29897, 13, 4706, 4853, 29889, 842, 29918, 29916, 2576, 29898, 2962, 29892, 1095, 29897, 13, 4706, 4853, 29889, 726, 29898, 29900, 29889, 29945, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 364, 29908, 29898, 29890, 29897, 1273, 29879, 501, 29911, 29892, 1273, 29879, 732, 29941, 29900, 341, 12661, 29892, 395, 29911, 29918, 29881, 2013, 1154, 29912, 29911, 998, 29929, 29900, 7585, 29911, 998, 29929, 29900, 3227, 3188, 7920, 29908, 29995, 29898, 5085, 29889, 3696, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 4968, 29871, 13, 9651, 6389, 29889, 5378, 29889, 21064, 25739, 14698, 2520, 358, 543, 5064, 613, 13, 9651, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 4706, 4853, 29889, 842, 29918, 29891, 2576, 6278, 29889, 29896, 29892, 29906, 29889, 29945, 29897, 13, 4706, 4853, 29889, 26172, 29898, 2029, 29922, 29896, 29892, 14801, 9748, 29922, 29941, 29892, 4079, 2311, 29922, 29946, 29892, 302, 1054, 29922, 29896, 29892, 3515, 265, 29922, 5574, 29897, 13, 4706, 4853, 29889, 842, 29918, 29916, 1643, 703, 2481, 313, 2692, 19123, 4079, 8977, 29922, 5657, 29897, 13, 4706, 4853, 29889, 842, 29918, 29891, 1643, 703, 4920, 29879, 272, 683, 29892, 270, 29933, 613, 4079, 8977, 29922, 5657, 29897, 13, 13, 4706, 4853, 353, 27815, 29961, 29896, 29962, 13, 4706, 4853, 29889, 7720, 29898, 8824, 29892, 9685, 543, 29891, 1159, 13, 4706, 4853, 29889, 842, 29918, 29916, 1643, 29898, 29878, 29908, 5776, 546, 1535, 11959, 29892, 779, 1154, 29912, 29911, 998, 29929, 29900, 7585, 29911, 998, 29929, 29900, 3227, 3188, 7920, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 4853, 29889, 842, 29918, 3637, 860, 21134, 4197, 2314, 13, 4706, 4853, 353, 4853, 29889, 29873, 5080, 29916, 580, 13, 4706, 4853, 29889, 5317, 29898, 4330, 280, 29883, 29892, 1060, 29892, 376, 307, 613, 29320, 675, 29922, 29900, 29889, 29941, 29892, 15595, 21098, 29953, 29897, 13, 4706, 4853, 29889, 842, 29918, 29916, 2576, 11891, 29955, 29945, 29892, 29896, 29889, 29955, 29945, 29897, 13, 4706, 4853, 29889, 1165, 29894, 1220, 29898, 4330, 280, 29883, 29961, 9302, 29889, 1191, 1195, 29898, 29990, 29897, 1402, 19375, 543, 489, 613, 301, 29893, 29922, 29900, 29889, 29946, 29892, 2927, 543, 29890, 1159, 13, 4706, 4853, 29889, 842, 29918, 29891, 1643, 703, 29934, 29924, 1660, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 4853, 29889, 726, 29898, 29900, 29889, 29945, 29892, 29871, 29896, 29889, 29900, 29945, 29892, 18227, 29883, 29897, 14305, 627, 310, 6789, 546, 1535, 373, 390, 29924, 1660, 613, 14698, 2520, 358, 543, 5064, 613, 13, 462, 9651, 11408, 2520, 358, 543, 5064, 613, 4327, 29922, 1165, 29889, 3286, 29909, 9100, 29892, 4079, 8977, 29922, 5657, 726, 29897, 13, 4706, 4079, 726, 3366, 2311, 3108, 353, 29871, 29946, 13, 4706, 4853, 29889, 726, 29898, 4330, 280, 29883, 29961, 9302, 29889, 1191, 1195, 29898, 29990, 29897, 1402, 29871, 29900, 29889, 29955, 29946, 29945, 29892, 364, 29908, 29938, 29911, 29918, 29881, 29938, 29922, 15543, 29906, 29888, 29908, 29995, 4330, 280, 29883, 29961, 9302, 29889, 1191, 1195, 29898, 29990, 29897, 1402, 14698, 2520, 358, 543, 5064, 613, 13, 18884, 11408, 2520, 358, 543, 5064, 613, 4079, 8977, 29922, 5657, 726, 29892, 13733, 29922, 29929, 29900, 29897, 13, 4706, 2537, 29889, 1300, 974, 4378, 29918, 29916, 1256, 580, 13, 4706, 2537, 29889, 7620, 1003, 703, 29918, 8346, 29918, 29914, 4878, 29906, 29889, 2732, 613, 289, 1884, 29918, 262, 6609, 543, 29873, 523, 1159, 13, 1678, 736, 13, 13, 13, 1753, 903, 16202, 23538, 5085, 1125, 13, 1678, 9995, 2661, 6490, 322, 6492, 13964, 9995, 13, 1678, 921, 353, 10518, 29889, 949, 29918, 7638, 703, 2917, 29914, 29888, 8663, 29889, 16202, 29889, 29885, 29889, 7638, 1159, 13, 1678, 921, 29889, 5200, 353, 518, 6008, 29889, 12673, 29889, 710, 415, 603, 29898, 29873, 1699, 29995, 29979, 29889, 29995, 29885, 29889, 29995, 29881, 29889, 29995, 29950, 29889, 29995, 29924, 1159, 363, 260, 297, 921, 29889, 5200, 29962, 13, 1678, 565, 6389, 29889, 29097, 1275, 376, 5317, 1115, 13, 4706, 22889, 29889, 2214, 9629, 3366, 486, 860, 29889, 1643, 2311, 3108, 353, 29871, 29896, 29906, 13, 4706, 22889, 29889, 2214, 9629, 3366, 3637, 860, 29889, 1643, 2311, 3108, 353, 29871, 29896, 29906, 13, 4706, 22889, 29889, 2214, 9629, 3366, 755, 726, 29889, 4381, 3108, 353, 376, 4381, 29908, 13, 4706, 4079, 353, 8853, 11922, 1115, 376, 643, 361, 613, 376, 2780, 1115, 29871, 376, 8517, 613, 376, 7915, 1115, 376, 8945, 613, 376, 2311, 1115, 29871, 29896, 29906, 29913, 13, 4706, 4079, 726, 353, 8853, 11922, 1115, 376, 643, 361, 613, 376, 2780, 1115, 29871, 376, 9539, 613, 376, 7915, 1115, 376, 8945, 613, 376, 2311, 1115, 29871, 29896, 29906, 29913, 13, 4706, 2537, 29896, 29892, 27815, 29896, 353, 14770, 29889, 1491, 26762, 29898, 1003, 2311, 7607, 29929, 29892, 29871, 29896, 29906, 511, 302, 5727, 29922, 29946, 29892, 302, 22724, 29922, 29941, 29892, 270, 1631, 29922, 29929, 29900, 29892, 6232, 29891, 543, 798, 613, 6232, 29916, 543, 1054, 1159, 13, 4706, 1226, 391, 353, 6571, 13, 4706, 363, 432, 29892, 302, 29885, 297, 26985, 29898, 3366, 16586, 3284, 617, 3284, 8337, 3284, 1004, 3108, 1125, 13, 9651, 4489, 353, 5159, 13, 9651, 1024, 353, 376, 29885, 29934, 29924, 1660, 29918, 17969, 22882, 13, 9651, 363, 474, 29892, 1948, 297, 921, 29889, 1524, 5727, 7295, 13, 18884, 380, 29876, 353, 1948, 3366, 5378, 3108, 13, 18884, 285, 353, 376, 1272, 29914, 3601, 29914, 10867, 19248, 5200, 6822, 808, 6090, 29889, 29912, 5378, 1836, 17608, 1642, 4830, 29898, 5200, 29922, 798, 3366, 5200, 16862, 710, 615, 603, 11702, 29979, 29889, 29995, 29885, 29889, 29995, 29881, 29889, 29995, 29950, 29889, 29995, 29924, 4968, 364, 601, 29922, 303, 29876, 29897, 13, 18884, 270, 353, 921, 2378, 29889, 3150, 29918, 24713, 29898, 29888, 29897, 13, 18884, 270, 29889, 5552, 29879, 29889, 5504, 3319, 29908, 5753, 1115, 29871, 29896, 17722, 29881, 29889, 5552, 29879, 29961, 978, 16261, 29881, 29889, 5552, 29879, 3366, 29885, 29934, 29924, 1660, 29918, 7707, 3108, 511, 29871, 13, 462, 1678, 1024, 29901, 29871, 313, 29881, 29889, 5552, 29879, 29961, 978, 11724, 376, 29879, 1362, 1115, 7442, 29889, 2168, 713, 29898, 29881, 3366, 29879, 1362, 16862, 5975, 511, 29871, 13, 462, 1678, 376, 2997, 29918, 2230, 1115, 7442, 29889, 2168, 713, 29898, 29881, 3366, 2997, 29918, 2230, 16862, 5975, 511, 376, 828, 29873, 1115, 7442, 29889, 12676, 29898, 29881, 3366, 828, 29873, 16862, 5975, 26972, 13, 18884, 4489, 29889, 4397, 29898, 29881, 29889, 5552, 29879, 29897, 13, 18884, 396, 2158, 29898, 29881, 29889, 5552, 29879, 3366, 29881, 15666, 557, 3108, 29899, 29881, 29889, 5552, 29879, 3366, 29885, 15666, 557, 29918, 17969, 22882, 2314, 13, 9651, 4489, 353, 10518, 29889, 17271, 29889, 3166, 29918, 3757, 4339, 29898, 2176, 29897, 13, 9651, 318, 29916, 353, 4489, 29961, 9302, 29889, 6897, 29898, 2176, 3366, 29881, 15666, 557, 3108, 29899, 29881, 29889, 5552, 29879, 3366, 29885, 15666, 557, 29918, 7707, 20068, 29966, 29889, 29947, 29962, 13, 9651, 1596, 29898, 9302, 29889, 29725, 1111, 1389, 29898, 1314, 29889, 29881, 15666, 557, 29892, 318, 29916, 3366, 29885, 15666, 557, 29918, 7707, 3108, 511, 7431, 29898, 1314, 876, 13, 9651, 4489, 353, 4489, 29961, 30022, 2176, 29889, 275, 262, 4197, 9302, 29889, 13707, 29892, 7442, 29889, 7192, 29892, 448, 9302, 29889, 7192, 14664, 1384, 29898, 29896, 4638, 13, 9651, 1904, 353, 288, 3137, 703, 5753, 3695, 269, 1362, 29974, 2997, 29918, 2230, 29974, 828, 29873, 29974, 828, 271, 613, 848, 29922, 2176, 29897, 13, 9651, 396, 4299, 353, 288, 3137, 29898, 978, 718, 376, 30022, 269, 1362, 29930, 2997, 29918, 2230, 29930, 828, 29873, 29930, 828, 271, 613, 848, 29922, 2176, 29897, 13, 9651, 2933, 353, 1904, 29889, 9202, 580, 29871, 13, 9651, 385, 4273, 353, 1560, 29889, 16202, 29889, 273, 4273, 29918, 21457, 29898, 5327, 29892, 2393, 29922, 29906, 29897, 13, 9651, 1226, 391, 29961, 22882, 29962, 353, 4489, 29889, 5753, 29889, 25027, 391, 580, 13, 9651, 1596, 29898, 273, 4273, 29897, 13, 9651, 396, 2158, 29898, 5327, 29889, 7727, 3101, 13, 632, 13, 9651, 4853, 353, 27815, 29896, 29961, 29926, 29892, 29871, 29900, 29962, 13, 9651, 269, 1362, 29892, 1035, 353, 2734, 29918, 12676, 29898, 2176, 29889, 29879, 1362, 29892, 4489, 29889, 5753, 29892, 15414, 29922, 29945, 29897, 13, 9651, 4853, 29889, 5317, 29898, 2176, 29889, 29879, 1362, 29892, 4489, 29889, 5753, 29892, 376, 307, 613, 15595, 29922, 29900, 29889, 29945, 29892, 29320, 675, 29922, 29900, 29889, 29955, 29945, 29897, 13, 9651, 396, 29916, 353, 903, 3258, 29918, 29916, 23538, 2176, 29889, 29883, 2209, 1362, 29889, 25027, 391, 3285, 7442, 29889, 12676, 29898, 2176, 29889, 5066, 511, 7442, 29889, 12676, 29898, 2176, 29889, 1188, 29888, 3317, 511, 7442, 29889, 12676, 29898, 2176, 3366, 1896, 3108, 511, 301, 29886, 543, 29883, 2209, 1362, 1159, 13, 9651, 396, 29877, 353, 364, 29889, 657, 29918, 11965, 2463, 29898, 29916, 29961, 3366, 29879, 1362, 3284, 828, 29873, 3284, 3108, 1822, 5975, 29897, 13, 9651, 396, 29885, 29892, 325, 353, 288, 29889, 11965, 18186, 29918, 12676, 29892, 7442, 29889, 3676, 29898, 29877, 29889, 1707, 29918, 11965, 29918, 12676, 29897, 13, 9651, 396, 1165, 29889, 5317, 29898, 2176, 29889, 29879, 1362, 29892, 288, 29889, 11965, 18186, 29918, 12676, 29892, 376, 29878, 29899, 613, 1196, 2103, 29922, 29900, 29889, 29955, 29945, 29892, 15595, 29922, 29900, 29889, 29947, 29897, 13, 9651, 396, 1165, 29889, 5589, 29918, 14811, 29898, 2176, 29889, 29879, 1362, 29892, 286, 448, 29871, 29896, 29889, 29929, 29947, 29930, 29894, 29892, 286, 718, 29871, 29896, 29889, 29929, 29947, 29930, 29894, 29892, 2927, 543, 29878, 613, 15595, 29922, 29900, 29889, 29906, 29897, 13, 13, 9651, 4853, 353, 27815, 29896, 29961, 29926, 29892, 29871, 29896, 29962, 13, 9651, 4853, 29889, 5317, 29898, 2176, 29889, 2997, 29918, 2230, 29892, 4489, 29889, 5753, 29892, 376, 307, 613, 15595, 29922, 29900, 29889, 29945, 29892, 29320, 675, 29922, 29900, 29889, 29955, 29945, 29897, 13, 13, 9651, 4853, 353, 27815, 29896, 29961, 29926, 29892, 29871, 29906, 29962, 13, 9651, 4853, 29889, 5317, 29898, 2176, 29889, 828, 29873, 29892, 4489, 29889, 5753, 29892, 376, 307, 613, 15595, 29922, 29900, 29889, 29945, 29892, 29320, 675, 29922, 29900, 29889, 29955, 29945, 29897, 13, 13, 4706, 27815, 29896, 29961, 29900, 29892, 29900, 1822, 842, 29918, 29891, 1643, 703, 29934, 29924, 1660, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 27815, 29896, 29961, 29896, 29892, 29900, 1822, 842, 29918, 29891, 1643, 703, 29934, 29924, 1660, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 27815, 29896, 29961, 29906, 29892, 29900, 1822, 842, 29918, 29891, 1643, 703, 29934, 29924, 1660, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 27815, 29896, 29961, 29941, 29892, 29900, 1822, 842, 29918, 29891, 1643, 703, 29934, 29924, 1660, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 27815, 29896, 29961, 29941, 29892, 29900, 1822, 842, 29918, 29916, 1643, 29898, 29878, 29908, 29903, 29999, 29909, 29892, 779, 4161, 29898, 29985, 29877, 1262, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 27815, 29896, 29961, 29941, 29892, 29896, 1822, 842, 29918, 29916, 1643, 29898, 29878, 29908, 5850, 29892, 379, 2470, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 27815, 29896, 29961, 29941, 29892, 29906, 1822, 842, 29918, 29916, 1643, 29898, 29878, 29908, 1988, 29911, 29892, 379, 2470, 613, 4079, 8977, 29922, 5657, 29897, 13, 4706, 515, 4560, 2272, 1053, 22663, 13, 4706, 1596, 29898, 16202, 29889, 698, 342, 29918, 2674, 29898, 287, 391, 3366, 8337, 12436, 1226, 391, 3366, 16586, 3108, 876, 13, 4706, 2537, 29896, 29889, 7620, 1003, 703, 29918, 8346, 29918, 29914, 16202, 29889, 2732, 613, 289, 1884, 29918, 262, 6609, 543, 29873, 523, 1159, 13, 1678, 1683, 29901, 13, 4706, 921, 999, 353, 10518, 29889, 949, 29918, 7638, 703, 2917, 29914, 1579, 5114, 29889, 7638, 613, 6088, 29918, 15190, 29922, 3366, 5200, 613, 376, 2962, 613, 376, 355, 20068, 13, 4706, 363, 474, 29892, 1948, 297, 921, 29889, 1524, 5727, 7295, 13, 9651, 2143, 353, 921, 999, 29961, 29916, 999, 29889, 5200, 1360, 798, 3366, 5200, 3108, 29962, 13, 9651, 380, 29876, 353, 1948, 3366, 5378, 3108, 13, 9651, 285, 353, 376, 1272, 29914, 3601, 29914, 10867, 19248, 5200, 6822, 29888, 8663, 29889, 29912, 5378, 1836, 17608, 29889, 18828, 1642, 4830, 29898, 5200, 29922, 798, 3366, 5200, 16862, 710, 615, 603, 11702, 29979, 29889, 29995, 29885, 29889, 29995, 29881, 29889, 29995, 29950, 29889, 29995, 29924, 4968, 364, 601, 29922, 303, 29876, 29897, 13, 9651, 2897, 29889, 5205, 703, 29887, 7554, 448, 29881, 376, 718, 285, 29897, 13, 9651, 903, 29916, 29918, 353, 13373, 24541, 29898, 29888, 29889, 6506, 17350, 18828, 613, 5124, 876, 13, 9651, 2897, 29889, 5205, 703, 29887, 7554, 376, 718, 285, 29889, 6506, 17350, 18828, 613, 5124, 876, 13, 9651, 3064, 353, 954, 29906, 1256, 7373, 29916, 5396, 20897, 3366, 2230, 3108, 7503, 1402, 903, 29916, 5396, 20897, 3366, 2230, 16862, 348, 1169, 29892, 903, 29916, 5396, 20897, 3366, 2230, 16862, 23392, 29892, 13, 462, 1678, 871, 29918, 1509, 29918, 29883, 615, 603, 29918, 4130, 300, 1355, 29922, 8824, 29897, 13, 9651, 3064, 353, 7442, 29889, 2378, 4197, 29916, 3032, 517, 29918, 6370, 29918, 12673, 580, 363, 921, 297, 3064, 14664, 579, 668, 703, 12673, 29953, 29946, 29961, 1983, 29962, 1159, 13, 9651, 3064, 353, 518, 6008, 29889, 12673, 29889, 329, 29883, 3166, 16394, 29898, 29916, 29889, 579, 668, 29898, 524, 29897, 334, 29871, 29896, 29872, 29899, 29929, 29897, 363, 921, 297, 3064, 29962, 13, 9651, 394, 1372, 353, 903, 29916, 5396, 20897, 3366, 284, 1372, 3108, 7503, 29962, 13, 9651, 288, 353, 426, 13, 462, 1678, 376, 16586, 1115, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 7373, 29916, 5396, 20897, 3366, 6897, 29889, 801, 29889, 16586, 29889, 29877, 3108, 7503, 1402, 394, 1372, 29892, 1294, 3149, 29922, 29953, 29947, 511, 13, 462, 1678, 376, 617, 1115, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 7373, 29916, 5396, 20897, 3366, 6897, 29889, 801, 29889, 485, 29889, 617, 29889, 29877, 3108, 7503, 1402, 394, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 511, 13, 462, 1678, 376, 8337, 1115, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 7373, 29916, 5396, 20897, 3366, 6897, 29889, 801, 29889, 485, 29889, 8337, 29889, 29877, 3108, 7503, 1402, 394, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 511, 13, 462, 1678, 376, 1004, 1115, 3667, 29879, 29889, 524, 29918, 6897, 272, 683, 7373, 29916, 5396, 20897, 3366, 6897, 29889, 2774, 29889, 615, 29889, 29877, 3108, 7503, 1402, 394, 1372, 29892, 1294, 3149, 29922, 29953, 29946, 511, 13, 462, 1678, 376, 7707, 1115, 903, 29916, 5396, 20897, 3366, 29881, 2390, 3108, 7503, 1402, 13, 18884, 500, 13, 9651, 282, 29888, 353, 3667, 29879, 29889, 5894, 13390, 29898, 303, 29876, 29922, 303, 29876, 29892, 3415, 29922, 798, 3366, 5200, 12436, 3064, 29922, 3706, 29892, 1904, 29922, 29877, 29892, 1369, 29922, 999, 3366, 2962, 16862, 25027, 391, 580, 29961, 29900, 1402, 29871, 13, 462, 1678, 1095, 29922, 999, 3366, 355, 16862, 25027, 391, 580, 29961, 29900, 1402, 2594, 29922, 798, 3366, 1646, 12436, 5272, 29922, 798, 3366, 1997, 20068, 13, 9651, 285, 978, 353, 285, 29889, 6506, 703, 29888, 8663, 3284, 808, 6090, 1159, 13, 9651, 282, 29888, 3032, 808, 453, 29918, 2141, 29918, 7529, 29918, 2141, 29918, 517, 29918, 1212, 29883, 2176, 23538, 29888, 978, 29889, 6506, 17350, 18828, 3284, 5783, 13, 1678, 736, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29886, 613, 376, 489, 29097, 613, 2322, 543, 29888, 8663, 613, 1371, 543, 9283, 775, 518, 16264, 29883, 29914, 29888, 8663, 29962, 313, 4381, 25989, 29883, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29878, 613, 376, 489, 5378, 613, 2322, 543, 1501, 613, 1371, 543, 29934, 29875, 8328, 775, 313, 4381, 12586, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 5750, 613, 376, 489, 3696, 613, 2322, 29922, 6008, 29889, 12673, 29898, 29906, 29900, 29896, 29945, 29892, 29941, 29892, 29896, 29896, 29892, 29896, 29953, 29892, 29906, 29906, 511, 1371, 543, 4763, 2635, 313, 4381, 29871, 29906, 29900, 29896, 29945, 29899, 29941, 29899, 29896, 29896, 29911, 29896, 29953, 29901, 29906, 29906, 19123, 13, 9651, 1134, 29922, 29881, 16680, 29889, 275, 459, 7989, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29879, 613, 376, 489, 2962, 613, 2322, 29922, 6008, 29889, 12673, 29898, 29906, 29900, 29896, 29945, 29892, 29941, 29892, 29896, 29896, 29892, 29896, 29953, 511, 1371, 543, 4763, 2635, 313, 4381, 29871, 29906, 29900, 29896, 29945, 29899, 29941, 29899, 29896, 29896, 29911, 29896, 29945, 29901, 29941, 29900, 19123, 13, 9651, 1134, 29922, 29881, 16680, 29889, 275, 459, 7989, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29872, 613, 376, 489, 355, 613, 2322, 29922, 6008, 29889, 12673, 29898, 29906, 29900, 29896, 29945, 29892, 29941, 29892, 29896, 29896, 29892, 29896, 29955, 511, 1371, 543, 5044, 2635, 313, 4381, 29871, 29906, 29900, 29896, 29945, 29899, 29941, 29899, 29896, 29896, 29911, 29896, 29955, 29901, 29941, 29900, 19123, 13, 9651, 1134, 29922, 29881, 16680, 29889, 275, 459, 7989, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29887, 613, 376, 489, 7620, 29918, 1484, 267, 613, 3158, 543, 8899, 29918, 4541, 613, 1371, 543, 11371, 5771, 848, 313, 4381, 5852, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29879, 271, 613, 376, 489, 29879, 271, 613, 1134, 29922, 524, 29892, 2322, 29922, 29896, 29945, 29892, 1371, 543, 29903, 271, 20911, 1353, 313, 4381, 29871, 29896, 29945, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 1758, 613, 376, 489, 7620, 29918, 374, 290, 613, 3158, 543, 8899, 29918, 4541, 613, 1371, 543, 11371, 10107, 8328, 848, 313, 4381, 5852, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 567, 613, 376, 489, 5317, 29918, 7727, 613, 3158, 543, 8899, 29918, 3009, 613, 1371, 543, 20867, 15837, 3461, 313, 4381, 7700, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 21935, 613, 376, 489, 7620, 29918, 2914, 613, 3158, 543, 8899, 29918, 4541, 613, 1371, 543, 11371, 2582, 313, 4381, 5852, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29883, 613, 376, 489, 8551, 613, 3158, 543, 8899, 29918, 3009, 613, 1371, 543, 18759, 639, 2366, 6087, 2066, 313, 4381, 7700, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 381, 29878, 613, 376, 489, 381, 3665, 8837, 613, 2322, 543, 29923, 29965, 29963, 2477, 29974, 613, 1371, 543, 29902, 29878, 3665, 8837, 1904, 313, 4381, 19007, 29963, 2477, 29974, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 29894, 613, 376, 489, 369, 15828, 613, 3158, 543, 8899, 29918, 3009, 613, 1371, 543, 797, 1037, 559, 1962, 9750, 359, 537, 313, 4381, 7700, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 6739, 613, 376, 489, 5317, 29918, 401, 613, 1134, 29922, 524, 29892, 2322, 29922, 29900, 29892, 1371, 543, 20867, 1259, 775, 29892, 932, 506, 519, 565, 1192, 29097, 1360, 5317, 313, 4381, 29871, 29900, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 1341, 613, 376, 489, 10745, 23860, 613, 1134, 29922, 7411, 29892, 2322, 29922, 29941, 29900, 29892, 1371, 543, 23923, 23860, 310, 288, 558, 29878, 800, 297, 341, 12661, 313, 4381, 29871, 29941, 29900, 341, 12661, 25760, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 29899, 735, 613, 376, 489, 4548, 613, 1134, 29922, 524, 29892, 2322, 29922, 29900, 29892, 1371, 543, 9283, 775, 518, 29900, 29899, 29896, 29900, 29962, 313, 4381, 29900, 25760, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 565, 6389, 29889, 369, 15828, 29901, 13, 4706, 1596, 14182, 29876, 24953, 1051, 363, 17402, 16521, 13, 4706, 363, 413, 297, 24987, 29898, 5085, 467, 8149, 7295, 13, 9651, 1596, 703, 268, 376, 1919, 413, 1919, 376, 976, 29908, 1919, 851, 29898, 16908, 29898, 5085, 9601, 29895, 12622, 13, 1678, 565, 6389, 29889, 4548, 1275, 29871, 29900, 29901, 903, 4878, 29900, 23538, 5085, 29897, 13, 1678, 565, 6389, 29889, 4548, 1275, 29871, 29896, 29901, 903, 4878, 29896, 23538, 5085, 29897, 13, 1678, 565, 6389, 29889, 4548, 1275, 29871, 29906, 29901, 903, 4878, 29906, 23538, 5085, 29897, 13, 1678, 565, 6389, 29889, 4548, 1275, 29871, 29941, 29901, 903, 16202, 23538, 5085, 29897, 13, 1678, 1683, 29901, 1596, 14182, 29876, 7835, 451, 8762, 1159, 13, 1678, 1596, 703, 1159, 13, 1678, 565, 2897, 29889, 2084, 29889, 9933, 703, 9794, 29914, 1649, 2272, 8173, 1649, 29908, 1125, 2897, 29889, 5205, 703, 1758, 448, 9600, 4733, 29914, 1649, 2272, 8173, 1649, 1159, 13, 1678, 565, 2897, 29889, 2084, 29889, 9933, 703, 9794, 29914, 735, 546, 7862, 29914, 1649, 2272, 8173, 1649, 29908, 1125, 2897, 29889, 5205, 703, 1758, 448, 9600, 4733, 29914, 735, 546, 7862, 29914, 1649, 2272, 8173, 1649, 1159, 13, 2 ]
config.py
HarryThuku/Group-of-Schools
0
1609165
<filename>config.py import os, subprocess appData = { 'institution_name' : os.environ.get("INSTITUTION_NAME"), 'institution_initials':os.environ.get("INSTITUTION_INITIALS"), 'app_base_url' : os.environ.get("APP_URL"), 'map_coordinates' : '', 'country' : os.environ.get("COUNTRY"), 'email' : os.environ.get("MAIL_USERNAME"), 'primary_phone' : os.environ.get("PRIMARY_PHONE"), 'secondary_phone' : '', 'stateOrCounty' : os.environ.get("STATE_OR_COUNTY"), 'about' : '' } class Config: ''' General configuration parent class ''' SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_DATABASE_URI = os.environ.get("SQLALCHEMY_DATABASE_URI") UPLOADED_PHOTOS_DEST = 'app/static/photos' # email configurations MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 587 MAIL_USE_TLS = True MAIL_USE_SSL = False MAIL_USERNAME = os.environ.get('MAIL_USERNAME') MAIL_PASSWORD = <PASSWORD>('MAIL_PASSWORD') MAIL_DEFAULT_SENDER = os.environ.get('MAIL_DEFAULT_SENDER') MAIL_MAX_EMAILS = os.environ.get('') MAIL_SUPPRESS_SEND = os.environ.get('') MAIL_ASCII_ATTACHMENTS = os.environ.get('') SUBJECT_PREFIX = appData['institution_name'] SQLALCHEMY_TRACK_MODIFICATIONS = True # simplemde confirgurations # simplemde configurations SIMPLEMDE_JS_IIFE = True SIMPLEMDE_USE_CDN = True class ProdConfig(Config): ''' Production configuration child class Args: Config: The parent configuration class with General configuration settings ''' # SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URI') APP_URL = os.environ.get('APP_URL') TESTING = False MAIL_SUPPRESS_SEND = False MAIL_DEBUG = False DEBUG = False class TestConfig(Config): SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://harryking:bigboy999@localhost/school_sys_test' class DevConfig(Config): ''' Development configuration child class Args: Config : the parent configuration class with General configuration settings ''' SQLALCHEMY_DATABASE_URI = f'postgresql+psycopg2://harryking:bigboy999@localhost/school_system' MAIL_SUPPRESS_SEND = True MAIL_DEBUG = True TESTING = True DEBUG = True config_options = { 'development' : DevConfig, 'production' : ProdConfig, 'test' : TestConfig }
[ 1, 529, 9507, 29958, 2917, 29889, 2272, 13, 5215, 2897, 29892, 1014, 5014, 13, 13, 932, 1469, 353, 426, 13, 1678, 525, 2611, 5008, 29918, 978, 29915, 584, 2897, 29889, 21813, 29889, 657, 703, 25580, 1806, 2692, 2725, 29918, 5813, 4968, 13, 1678, 525, 2611, 5008, 29918, 11228, 29879, 2396, 359, 29889, 21813, 29889, 657, 703, 25580, 1806, 2692, 2725, 29918, 26019, 25758, 29903, 4968, 13, 1678, 525, 932, 29918, 3188, 29918, 2271, 29915, 584, 2897, 29889, 21813, 29889, 657, 703, 20576, 29918, 4219, 4968, 13, 1678, 525, 1958, 29918, 1111, 24266, 29915, 584, 15516, 13, 1678, 525, 13509, 29915, 584, 2897, 29889, 21813, 29889, 657, 703, 3217, 3904, 5659, 29979, 4968, 13, 1678, 525, 5269, 29915, 584, 2897, 29889, 21813, 29889, 657, 703, 1529, 6227, 29918, 11889, 5813, 4968, 13, 1678, 525, 16072, 29918, 6710, 29915, 584, 2897, 29889, 21813, 29889, 657, 703, 10593, 24480, 29918, 19689, 12413, 4968, 13, 1678, 525, 7496, 653, 29918, 6710, 29915, 584, 15516, 13, 1678, 525, 3859, 2816, 3981, 29891, 29915, 584, 2897, 29889, 21813, 29889, 657, 703, 19713, 29918, 1955, 29918, 18736, 29979, 4968, 13, 1678, 525, 12717, 29915, 584, 6629, 13, 29913, 13, 13, 13, 1990, 12782, 29901, 13, 1678, 14550, 13, 1678, 4593, 5285, 3847, 770, 13, 1678, 14550, 13, 1678, 3725, 22245, 29911, 29918, 10818, 353, 2897, 29889, 21813, 29889, 657, 877, 1660, 22245, 29911, 29918, 10818, 1495, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 2897, 29889, 21813, 29889, 657, 703, 4176, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 1159, 13, 1678, 11901, 3927, 29909, 2287, 29928, 29918, 19689, 2891, 3267, 29918, 2287, 1254, 353, 525, 932, 29914, 7959, 29914, 561, 15788, 29915, 13, 13, 1678, 396, 4876, 22920, 13, 1678, 14861, 6227, 29918, 18603, 353, 525, 3844, 9392, 29889, 21980, 29889, 510, 29915, 13, 1678, 14861, 6227, 29918, 15082, 353, 29871, 29945, 29947, 29955, 13, 1678, 14861, 6227, 29918, 17171, 29918, 29911, 8547, 353, 5852, 13, 1678, 14861, 6227, 29918, 17171, 29918, 18641, 353, 7700, 13, 1678, 14861, 6227, 29918, 11889, 5813, 353, 2897, 29889, 21813, 29889, 657, 877, 1529, 6227, 29918, 11889, 5813, 1495, 13, 1678, 14861, 6227, 29918, 25711, 17013, 353, 529, 25711, 17013, 29958, 877, 1529, 6227, 29918, 25711, 17013, 1495, 13, 1678, 14861, 6227, 29918, 23397, 29918, 29903, 1430, 8032, 353, 2897, 29889, 21813, 29889, 657, 877, 1529, 6227, 29918, 23397, 29918, 29903, 1430, 8032, 1495, 13, 1678, 14861, 6227, 29918, 12648, 29918, 26862, 6227, 29903, 353, 2897, 29889, 21813, 29889, 657, 877, 1495, 13, 1678, 14861, 6227, 29918, 29903, 4897, 15094, 1799, 29918, 29903, 11794, 353, 2897, 29889, 21813, 29889, 657, 877, 1495, 13, 1678, 14861, 6227, 29918, 28599, 2687, 29918, 1299, 8687, 29950, 13780, 29903, 353, 2897, 29889, 21813, 29889, 657, 877, 1495, 13, 1678, 27092, 17637, 29918, 15094, 25634, 353, 623, 1469, 1839, 2611, 5008, 29918, 978, 2033, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 5659, 11375, 29918, 6720, 4571, 29943, 28541, 29903, 353, 5852, 29871, 13, 13, 1678, 396, 2560, 29885, 311, 12388, 29887, 332, 800, 13, 1678, 396, 2560, 29885, 311, 29871, 22920, 13, 1678, 22717, 3580, 1307, 29924, 2287, 29918, 8700, 29918, 2687, 16359, 353, 5852, 13, 1678, 22717, 3580, 1307, 29924, 2287, 29918, 17171, 29918, 6530, 29940, 353, 5852, 13, 13, 13, 1990, 1019, 29881, 3991, 29898, 3991, 1125, 13, 1678, 14550, 13, 1678, 19561, 5285, 2278, 770, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 12782, 29901, 450, 3847, 5285, 770, 411, 4593, 5285, 6055, 13, 1678, 14550, 13, 1678, 396, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 2897, 29889, 21813, 29889, 657, 703, 25832, 27982, 29918, 4219, 1159, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 2897, 29889, 21813, 29889, 657, 877, 25832, 27982, 29918, 15551, 1495, 13, 1678, 12279, 29925, 29918, 4219, 353, 2897, 29889, 21813, 29889, 657, 877, 20576, 29918, 4219, 1495, 13, 1678, 17067, 1254, 4214, 353, 7700, 13, 1678, 14861, 6227, 29918, 29903, 4897, 15094, 1799, 29918, 29903, 11794, 353, 7700, 13, 1678, 14861, 6227, 29918, 18525, 353, 7700, 13, 1678, 21681, 353, 7700, 13, 13, 13, 1990, 4321, 3991, 29898, 3991, 1125, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 525, 29272, 29974, 567, 29891, 9708, 29887, 29906, 597, 8222, 719, 9292, 29901, 3752, 19415, 29929, 29929, 29929, 29992, 7640, 29914, 27041, 29918, 9675, 29918, 1688, 29915, 13, 13, 13, 1990, 9481, 3991, 29898, 3991, 1125, 13, 1678, 14550, 13, 1678, 14650, 5285, 2278, 770, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 12782, 584, 278, 3847, 5285, 770, 411, 4593, 5285, 6055, 13, 1678, 14550, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 285, 29915, 29272, 29974, 567, 29891, 9708, 29887, 29906, 597, 8222, 719, 9292, 29901, 3752, 19415, 29929, 29929, 29929, 29992, 7640, 29914, 27041, 29918, 5205, 29915, 13, 1678, 14861, 6227, 29918, 29903, 4897, 15094, 1799, 29918, 29903, 11794, 353, 5852, 13, 1678, 14861, 6227, 29918, 18525, 353, 5852, 29871, 13, 1678, 17067, 1254, 4214, 353, 5852, 13, 1678, 21681, 353, 5852, 13, 13, 13, 2917, 29918, 6768, 353, 426, 13, 1678, 525, 25431, 29915, 584, 9481, 3991, 29892, 13, 1678, 525, 24601, 29915, 584, 1019, 29881, 3991, 29892, 13, 1678, 525, 1688, 29915, 584, 4321, 3991, 13, 29913, 2 ]
chatbot/__init__.py
chengdrabin325/karina_botproject
1
65099
import re,random,requests,json from os import path from .DefaultSubs import * from .spellcheck import correction,WORDS try: from urllib import quote except ImportError as e: from urllib.parse import quote reflections = { "i am" : "you are", "i was" : "you were", "i" : "you", "i'm" : "you are", "i'd" : "you would", "i've" : "you have", "i'll" : "you will", "my" : "your", "you are" : "I am", "you were" : "I was", "you've" : "I have", "you'll" : "I will", "your" : "my", "yours" : "mine", "you" : "me", "me" : "you" } class multiFunctionCall: def __init__(self,func={}): self.__func__ = func def defaultfunc(self,string,sessionID ="general"): return string def call(self,string,sessionID): s = string.split(":") if len(s)<=1: return string name = s[0].strip() s = ":".join(s[1:]) func = self.defaultfunc try:func = self.__func__[name] except:s = string return re.sub(r'\\([\[\]{}%:])',r"\1",func(re.sub(r'([\[\]{}%:])',r"\\\1",s),sessionID =sessionID)) class dummyMatch: def __init__(self,string): self.string = string def group(self,index): if index==0:return self.string raise IndexError("no such group") def groupdict(self,*arg,**karg): return {} class Topic: def __init__(self,topics): self.topic={"general":''} self.topics = topics def __setitem__(self,key,value): value = value.strip() if value and value[0]==".": index=1 current_topic = self.topic[key].split(".") while value[index]==".": index+=1 current_topic.pop() current_topic.append(value[index:]) value = ".".join(current_topic) self.topic[key]=value def __getitem__(self,key): topic = self.topic[key] if topic in self.topics(): return topic return '' class Chat(object): def __init__(self, pairs=(), reflections=reflections, call=multiFunctionCall(), api={}, normalizer=defaultNormal,default_template=path.join(path.dirname(path.abspath(__file__)),"default.template")): """ Initialize the chatbot. Pairs is a list of patterns and responses. Each pattern is a regular expression matching the user's statement or question, e.g. r'I like (.*)'. For each such pattern a list of possible responses is given, e.g. ['Why do you like %1', 'Did you ever dislike %1']. Material which is matched by parenthesized sections of the patterns (e.g. .*) is mapped to the numbered positions in the responses, e.g. %1. :type pairs: list of tuple :param pairs: The patterns and responses :type reflections: dict :param reflections: A mapping between first and second person expressions :rtype: None """ self.__init__handler() defaultpairs = self.__processTemplateFile(default_template) if type(pairs).__name__ in ('unicode','str'): pairs = self.__processTemplateFile(pairs) self._pairs = {'':{"pairs":[],"defaults":[]}} if type(pairs)!=dict: pairs = {'':{"pairs":pairs,"defaults":[]}} elif not '' in pairs: raise KeyError("Default topic missing") self._normalizer = dict(normalizer) for key in normalizer: self._normalizer[key.lower()] = normalizer[key] self._normalizer_regex = self._compile_reflections(normalizer) self.__processLearn(defaultpairs) self.__processLearn(pairs) self._reflections = reflections self._regex = self._compile_reflections(reflections) self._memory = {"general":{}} self.conversation = {"general":[]} self.sessionID = "general" self.attr = {"general":{"match":None,"pmatch":None,"_quote":False,"substitute":True}} self.call = call self.topic = Topic(self._pairs.keys) try:self._api = api if type(api)==dict else json.load(api) except:raise SyntaxError("Invalid value for api") def __init__handler(self): """ initialize handlers and operator functionality """ self.__action_handlers = {"chat":self.__chat_handler, "low":self.__low_handler, "up":self.__up_handler, "cap":self.__cap_handler, "call":self.__call_handler, "topic":self.__topic_handler, "map":self.__map_handler, "eval":self.__eval_handler, } self.__confitional_operator = { "!=":lambda a,b:a!=b, ">=":lambda a,b:a>=b, "<=":lambda a,b:a<=b, "==":lambda a,b:a==b, "<":lambda a,b:a<b, ">":lambda a,b:a>b } self.__logical_operator ={ '&':lambda a,b:a and b, '|':lambda a,b:a or b, '^':lambda a,b:a ^ b } def __normalize(self,text): """ Substitute words in the string, according to the specified Normal, e.g. "I'm" -> "I am" :type str: str :param str: The string to be mapped :rtype: str """ return self._normalizer_regex.sub(lambda mo: self._normalizer[mo.string[mo.start():mo.end()]], text.lower()) def __errorMessage(self,expected,found): return "Expected '%s' tag found '%s'" % (expected,found) def __responseTags(self,text,pos,index): next_index=index+1 if pos[next_index][2]!="endresponse": raise SyntaxError(self.__errorMessage("endresponse",pos[next_index][2])) return text[pos[index][1]:pos[next_index][0]].strip(" \t\n") def __blockTags(self,text,pos,length,index): withinblock = {"learn":{},"response":[],"client":[],"prev":[]} while pos[index][2]!="endblock": if pos[index][2]=="learn": withinblock["learn"]={} index = self.__GroupTags(text,pos,withinblock["learn"],(lambda i:pos[i][2]!="endlearn"),length,index+1) index-=1 elif pos[index][2]=="response": withinblock["response"].append(self.__responseTags(text,pos,index)) index+=1 elif pos[index][2]=="client": index+=1 if pos[index][2]!="endclient": raise SyntaxError(self.__errorMessage("endclient",pos[index][2])) withinblock["client"].append(text[pos[index-1][1]:pos[index][0]].strip(" \t\n")) elif pos[index][2]=="prev": index+=1 if pos[index][2]!="endprev": raise SyntaxError(self.__errorMessage("endprev",pos[index][2])) withinblock["prev"].append(text[pos[index-1][1]:pos[index][0]].strip(" \t\n")) else: raise NameError("Invalid Tag '%s'" % pos[index][2]) index+=1 return index+1,(withinblock["client"][0], withinblock["prev"][0] if withinblock["prev"] else None, withinblock["response"], withinblock["learn"] ) def __GroupTags(self,text,pos,groups,condition,length,index=0,name=""): pairs=[] defaults=[] while condition(index): if pos[index][2]=="block": p,within = self.__blockTags(text,pos,length,index+1) pairs.append(within) index=p elif pos[index][2]=="response": defaults.append(self.__responseTags(text,pos,index)) index+=2 elif pos[index][2]=="group": child_name=(name+"."+pos[index][3].strip()) if name else pos[index][3].strip() index = self.__GroupTags(text,pos,groups,(lambda i:pos[i][2]!="endgroup"),length,index+1, name=child_name) else: raise SyntaxError(self.__errorMessage('group, block, or response',pos[index][2])) if name in groups: groups[name]["pairs"].extend(pairs) groups[name]["defaults"].extend(defaults) else: groups[name]={"pairs":pairs,"defaults":defaults} return index+1 def __processTemplateFile(self,fileName): with open(fileName, encoding='utf-8') as template: text = template.read() pos = [(m.start(0),m.end(0),text[m.start(1):m.end(1)],text[m.start(4):m.end(4)]) \ for m in re.finditer( r'{%[\s\t]+((end)?(block|learn|response|client|prev|group))[\s\t]+([^%]*|%(?=[^}]))%}', text) ] length = len(pos) groups = {} self.__GroupTags(text,pos,groups,(lambda i:i<length),length) return groups def __build_pattern(self,pattern): if pattern!=None: try:return re.compile(self.__normalize(pattern), re.IGNORECASE) except Exception as e: e.args=(str(e)+ " in pattern "+pattern, ) raise e def __processLearn(self,pairs): for topic in pairs: if topic not in self._pairs:self._pairs[topic]={"pairs":[],"defaults":[]} self._pairs[topic]["defaults"].extend([(i,self._condition(i)) for i in pairs[topic].get("defaults",[])]) for pair in pairs[topic]["pairs"][::-1]: learn, previous = {}, None length = len(pair) if length>3:client,previous,responses,learn = pair[:4] elif length==3: if type(pair[1]) in (tuple,list):client,responses,learn = pair else:client,previous,responses = pair elif length==2 and type(pair[1]) in (tuple,list):client,responses = pair else:raise ValueError("Response not specified") if type(learn) != dict: raise TypeError("Invalid Type for learn expected dict got '%s'" % type(l).__name__) self._pairs[topic]["pairs"].insert(0,(self.__build_pattern(client), self.__build_pattern(previous), tuple((i,self._condition(i)) for i in responses), learn)) def _startNewSession(self,sessionID,topic=''): self._memory[sessionID]={} self.conversation[sessionID]=[] self.attr[sessionID]={"match":None,"pmatch":None,"_quote":False,"substitute":True} self.topic[sessionID] = topic def _restructure(self,group,index=None): if index==None: toremove={} allElem = list(group) for i in group: toremove[i]=set() for j in group[i]: toremove[i].update(set(group[i]).intersection(group[j])) for i in group: for j in toremove[i]: group[i].remove(j) try: allElem.remove(j) except: pass index = list(group) toremove = [j for i in list(allElem) for j in group[i]] for i in toremove: try: allElem.remove(i) except: pass else: allElem = list(index) while index: i = index.pop() if type(group[i])==list: group[i] = self._restructure(dict(group),group[i]) for j in list(group[i]): try: index.remove(j) except: pass return {i:group[i] for i in allElem} def _subAction(self,group,start_end_pair,action): return {i:{ "action":action[i], "start":start_end_pair[i][0], "end":start_end_pair[i][1], "child":self._subAction(group[i],start_end_pair,action) } for i in group} def _getWithin(self,group,index): def init_group(i): group[index[i]]["within"]=[] orderedGroup.append(group[index[i]]) return i+1 def append_group(pos,i): pos,within = self._getWithin(group,index[pos:]) group[index[i-1]]["within"]+=within return pos i = 0 orderedGroup = [] while i<len(index): if group[index[i]]["action"]=="if": i=init_group(i) startIF = True while startIF: if i>=len(index): raise SyntaxError("If not closed in Conditional statement") if group[index[i]]["action"]=="elif": i = init_group(i) elif group[index[i]]["action"]=="else": pos = i = init_group(i) startIF = False while group[index[pos]]["action"]!="endif": pos = append_group(pos,i)+i i = init_group(pos) elif group[index[i]]["action"]=="endif": i = init_group(i) startIF = False else: pos = append_group(i,i) for j in range(i,pos): del group[index[j]] i += pos elif group[index[i]]["action"] in self.__action_handlers .keys(): orderedGroup.append(group[index[i]]) i += 1 else:return i,orderedGroup return i,orderedGroup def _setwithin(self,group): old =group for i in group: if group[i]["child"]: group[i]["child"] = self._setwithin(group[i]["child"]) index = list(group) index.sort(key =lambda x: group[x]["start"]) pos,orderedGroup = self._getWithin(group,index) if pos<len(index): raise SyntaxError("invalid statement") return orderedGroup def _inherit(self,start_end_pair,action): group = {} for i in range(len(start_end_pair)): group[i] = [] for j in range(len(start_end_pair)): if start_end_pair[i][0]<start_end_pair[j][0] and start_end_pair[i][1]>start_end_pair[j][1]: group[i].append(j) group = self._restructure(group) group = self._subAction(group,start_end_pair,action) return self._setwithin(group) def _condition(self,response): pos = [(m.start(0),m.end(0)) for m in re.finditer(r'{%?|%?}|\[|\]', response)] newPos = [(start,end) for start,end in pos if (not start) or response[start-1]!="\\" ] i=0 start_end_pair = [] actions = [] while newPos: for i in range(1,len(newPos)): if response[newPos[i][1]-1] in "}]": break if response[newPos[i-1][0]] in "{[": endTag = newPos.pop(i) biginTag = newPos.pop(i-1) bN = biginTag[1]-biginTag[0] eN = endTag[1]-endTag[0] if bN != eN or not ((response[biginTag[0]] == "{" and response[endTag[1]-1] == "}") or (response[biginTag[0]] == "[" and response[endTag[1]-1] == "]")): raise SyntaxError("invalid syntax '%s'" % response) start_end_pair.append((biginTag[1],endTag[0])) if bN == 2: statement = re.findall( r'^[\s\t]*(if|endif|elif|else|chat|low|up|cap|call|topic)[\s\t]+', response[biginTag[1]:endTag[0]]) if statement: actions.append(statement[0]) else: raise SyntaxError("invalid statement '%s'" % response[biginTag[1]:endTag[0]] ) else: if response[biginTag[0]] == "{": actions.append("map") else: actions.append("eval") else: raise SyntaxError("invalid syntax in \"%s\"" % response) try: group = self._inherit(start_end_pair,actions) except SyntaxError: raise SyntaxError("invalid statement in \"%s\"" % response) return group def _compile_reflections(self,normal): sorted_refl = sorted(normal.keys(), key=len, reverse=True) return re.compile(r"\b({0})\b".format("|".join(map(re.escape, sorted_refl))), re.IGNORECASE) def _substitute(self, str): """ Substitute words in the string, according to the specified reflections, e.g. "I'm" -> "you are" :type str: str :param str: The string to be mapped :rtype: str """ if not self.attr.get("substitute",True):return str return self._regex.sub(lambda mo: self._reflections[mo.string[mo.start():mo.end()]], str.lower()) def _checkIF(self,con,sessionID = "general"): pos = [(m.start(0),m.end(0),m.group(0)) for m in re.finditer(r'([\<\>!=]=|[\<\>]|&|\|)', con)] if not pos:return con.strip() res = prevres = True prevO = None pcsymbol = "&" A = con[0:pos[0][0]].strip() for j in range(len(pos)): s,e,o = pos[j] try:B = con[e:pos[j+1][0]].strip() except:B = con[e:].strip() try:a,b = float(A),float(b) except:a,b = A,B try:res = self.__confitional_operator[o](a,b) and res except: try:prevres,res = self.__logical_operator[pcsymbol](prevres,res),True except:SyntaxError("invalid conditional operator \"%s\"" % pcsymbol) pcsymbol = o A = B return self.__logical_operator[pcsymbol](prevres,res) def __if_handler(self,i,condition,response,sessionID): start = self.__get_start_pos(condition[i]["start"],response,"if") end = condition[i]["end"] check = True matchedIndex = None _quote = self.attr[sessionID]["_quote"] self.attr[sessionID]["_quote"] = False substitute = self.attr.get("substitute",True) self.attr["substitute"] = False while check: con = self._checkAndEvaluateCondition(response,condition[i]["child"],start,end,sessionID =sessionID) i+=1 if self._checkIF(con,sessionID =sessionID): matchedIndex = i-1 while condition[i]["action"] != "endif": i+=1 check = False elif condition[i]["action"] == "else": matchedIndex = i while condition[i]["action"] != "endif": i+=1 check = False elif condition[i]["action"] == "elif": start = self.__get_start_pos(condition[i]["start"],response,"elif") end = condition[i]["end"] elif condition[i]["action"] == "endif": check = False self.attr[sessionID]["_quote"] = _quote self.attr["substitute"] = substitute return ((self._checkAndEvaluateCondition( response, condition[matchedIndex]["within"], condition[matchedIndex]["end"]+2, condition[matchedIndex+1]["start"]-2, sessionID =sessionID ) if matchedIndex!=None else ""),i) def __handler(self,condition,response,action,sessionID): return self._checkAndEvaluateCondition( response, condition["child"], self.__get_start_pos(condition["start"],response,action), condition["end"], sessionID =sessionID ) def __chat_handler(self,i,condition,response,sessionID): substitute = self.attr.get("substitute",True) self.attr["substitute"] = False response = self.respond(self.__handler(condition[i],response,"chat",sessionID),sessionID =sessionID) self.attr["substitute"] = substitute return response def __low_handler(self,i,condition,response,sessionID): return self.__handler(condition[i],response,"low",sessionID).lower() def __up_handler(self,i,condition,response,sessionID): return self.__handler(condition[i],response,"up",sessionID).upper() def __cap_handler(self,i,condition,response,sessionID): return self.__handler(condition[i],response,"cap",sessionID).capitalize() def __call_handler(self,i,condition,response,sessionID): return self.call.call(self.__handler(condition[i],response,"call",sessionID),sessionID =sessionID) def __topic_handler(self,i,condition,response,sessionID): self.topic[sessionID] = self.__handler(condition[i],response,"topic",sessionID).strip() return "" def __get_start_pos(self,start,response,exp): return start+re.compile(r"([\s\t]*"+exp+"[\s\t]+)").search(response[start:]).end(1) def __map_handler(self,i,condition,response,sessionID): start = condition[i]["start"] end = condition[i]["end"] think = False if response[start] == "!": think = True start +=1 content = self._checkAndEvaluateCondition( response, condition[i]["child"], start, end, sessionID =sessionID ).strip().split(":") name = content[0] thisIndex=0 for thisIndex in range(1,len(content)): if name[-1]=="\\": name += ":"+content[thisIndex] else: thisIndex-=1 break thisIndex+=1 name = name.strip().lower() if thisIndex<(len(content)): value = content[thisIndex] for thisIndex in range(thisIndex+1,len(content)): if value[-1]=="\\": value += ":"+content[thisIndex] else: break self._memory[sessionID][name] = self._substitute(value.strip()) return self._memory[sessionID][name] if not think and name in self._memory[sessionID] else "" def __eval_handler(self,i,condition,restopnse,sessionID): start = condition[i]["start"] end = condition[i]["end"] think = False if response[start] == "!": think = True start +=1 _quote = self.attr[sessionID]["_quote"] self.attr[sessionID]["_quote"] = True content = self._checkAndEvaluateCondition( response, condition[i]["child"], start, end, sessionID =sessionID ).strip() self.attr[sessionID]["_quote"] = _quote vals = content.split(",") names = vals[0].split(":") apiName = names[0] methodName = ":".join(names[1:]) data={} key=None for i in vals[1:]: pair = vals[i].split(":") if len(pair)>=2: key = pair[0] data[key]=":".join(pair[1:]) elif key!=None: data[key]+=","+pair[0] else:raise SyntaxError("invalid syntax '%s'" % response[start:end] ) result = self.__api_handler(apiName,methodName,data) return "" if think else result def __api_request(self,url,method,**karg): try:return requests.__dict__[method.lower().strip()](url,**karg) except requests.exceptions.MissingSchema as e: return self.__api_request("http://"+url,method,**karg) except requests.exceptions.ConnectionError as e: raise RuntimeError("Couldn't connect to server (unreachable). Check your network") except KeyError as e: raise RuntimeError("Invalid method name '%s' in api.json" % method) def __api_handler(self,apiName,methodName,data={}): if apiName not in self._api or methodName not in self._api[apiName]: raise RuntimeError("Invalid method name '%s' for api '%s' ",(methodName,apiName)) api_params = dict(self._api[apiName][methodName]) if "auth" in self._api[apiName]: try:api_params["cookies"] = self.__api_request(**self._api[apiName]["auth"]).cookies except:raise ValueError("In api.json 'auth' of '%s' is wrongly configured." % apiName) param = "params" if self._api[apiName][methodName]["method"].upper().strip() == "GET" else "data" try:api_params[param].update(data) except:api_params[param] = data api_type = "normal" if "type" in api_params: api_type = api_params["type"] del api_params["type"] api_data_getter = [] if "value_getter" in api_params: api_data_getter = api_params["value_getter"] del api_params["value_getter"] response = self.__api_request(**api_params) responseText = response.json() if api_type.upper().strip()=="JSON" else response.content for key in api_data_getter: responseText = responseText[key] return responseText def _quote(self,string,sessionID): if self.attr[sessionID]["_quote"]: try:return urllib2.quote(string) except:return urllib2.quote(string.encode("UTF-8")) return string def __substituteFromClientStatement(self,match,prevResponse,extraSymbol="",sessionID = "general"): """ Substitute from Client statement into respose """ prev = 0 startPadding = 1+len(extraSymbol) finalResponse = "" for m in re.finditer(r'%'+extraSymbol+'[0-9]+', prevResponse): start = m.start(0) end = m.end(0) num = int(prevResponse[start+startPadding:end]) finalResponse += prevResponse[prev:start] try:finalResponse += self._quote(self._substitute(match.group(num)),sessionID) except IndexError as e:pass prev = end namedGroup = match.groupdict() if namedGroup: prevResponse = finalResponse + prevResponse[prev:] finalResponse = "" prev = 0 for m in re.finditer(r'%'+extraSymbol+'([a-zA-Z_][a-zA-Z_0-9]*)([^a-zA-Z_0-9]|$)', prevResponse): start = m.start(1) end = m.end(1) finalResponse += prevResponse[prev:start] try: value = namedGroup[prevResponse[start+startPadding:end]] if value:finalResponse += self._quote(self._substitute(value),sessionID) except KeyError as e:pass prev = end return finalResponse + prevResponse[prev:] def _checkAndEvaluateCondition(self, response,condition=[],startIndex=0,endIndex=None,sessionID = "general"): endIndex = endIndex if endIndex != None else len(response) if not condition: finalResponse = self.__substituteFromClientStatement(self.attr[sessionID]["match"],response[startIndex:endIndex],sessionID = sessionID) parentMatch=self.attr[sessionID]["pmatch"] return self.__substituteFromClientStatement(parentMatch,finalResponse,extraSymbol = '!',sessionID = sessionID) if parentMatch!=None else finalResponse i=0 finalResponse = "" while i < len(condition): pos = condition[i]["start"]-(1 if condition[i]["action"] in ["map","eval"] else 2) finalResponse += self._checkAndEvaluateCondition(response[startIndex:pos],sessionID =sessionID) _quote = self.attr[sessionID]["_quote"] try: self.attr[sessionID]["_quote"] = False tempResponse = self.__action_handlers[condition[i]["action"]](i,condition,response,sessionID) self.attr[sessionID]["_quote"] = _quote finalResponse += self._quote(tempResponse,sessionID) except KeyError as e: if condition[i]["action"] == "if": self.attr[sessionID]["_quote"] = _quote response_txt,i = self.__if_handler(i,condition,response,sessionID) finalResponse += response_txt startIndex = condition[i]["end"]+(1 if condition[i]["action"] in ["map","eval"] else 2) i+=1 self.attr[sessionID]["_quote"] = _quote finalResponse += self._checkAndEvaluateCondition(response[startIndex:endIndex],sessionID = sessionID) return finalResponse def _wildcards(self, response, match, parentMatch,sessionID = "general"): self.attr[sessionID]["match"]=match self.attr[sessionID]["pmatch"]=parentMatch response,condition = response return re.sub(r'\\([\[\]{}%:])',r"\1",self._checkAndEvaluateCondition(response,condition,sessionID = sessionID )) def __chose_and_process(self,choices,match,parentMatch,sessionID): resp = random.choice(choices) # pick a random response resp = self._wildcards(resp, match, parentMatch,sessionID = sessionID) # process wildcards # fix munged punctuation at the end if resp[-2:] == '?.': resp = resp[:-2] + '.' if resp[-2:] == '??': resp = resp[:-2] + '?' return resp def __intend_selection(self, text, previousText, current_topic, sessionID): for (pattern, parent, response,learn) in self._pairs[current_topic]["pairs"]:# check each pattern match = pattern.match(text) if not match:continue if parent==None:return match,None,response,learn parentMatch = parent.match(previousText) if parentMatch:# did the pattern match? return match,parentMatch,response,learn def __response_on_topic(self, text, previousText, text_correction, current_topic, sessionID = "general"): match=self.__intend_selection(text, previousText, current_topic, sessionID) or \ self.__intend_selection(text_correction, previousText, current_topic, sessionID) if match: match,parentMatch,response,learn=match if learn: self.__processLearn({ self._wildcards((topic,self._condition(topic)), match, parentMatch,sessionID = sessionID): \ {'pairs':[self.__substituteInLearn(pair, match, parentMatch,sessionID = sessionID) for pair in learn[topic]['pairs']], 'defaults':[self._wildcards((default,self._condition(default)), match, parentMatch,sessionID = sessionID) for default in learn[topic]['defaults']] } \ for topic in learn}) return self.__chose_and_process(response,match,parentMatch,sessionID) if self._pairs[current_topic]["defaults"]: return self.__chose_and_process(self._pairs[current_topic]["defaults"],dummyMatch(text), None,sessionID) raise ValueError("No match found") def __correction(self,text): """ spell correction """ new_text = [] for i in text.split(): if len(i)>3: low = i.lower() new_text.append(i if WORDS[i] else correction(i)) else:new_text.append(i) return " ".join(new_text) def respond(self, text, sessionID = "general"): """ Generate a response to the user input. :type text: str :param text: The string to be mapped :rtype: str """ text = self.__normalize(text) previousText = self.__normalize(self.conversation[sessionID][-2]) text_correction = self.__correction(text) current_topic = self.topic[sessionID] current_topic_order = current_topic.split(".") while current_topic_order: try:return self.__response_on_topic(text, previousText, text_correction, current_topic, sessionID) except ValueError as e:pass current_topic_order.pop() current_topic = ".".join(current_topic_order) try:return self.__response_on_topic(text, previousText, text_correction, current_topic, sessionID) except ValueError as e:return "Sorry I couldn't find anything relevant" def __substituteInLearn(self,pair, match, parentMatch,sessionID = "general"): return tuple((self.__substituteInLearn(i, match, parentMatch,sessionID = sessionID) if type(i) in (tuple,list) else \ (i if type(i) == dict else (self._wildcards((i,self._condition(i)), match, parentMatch,sessionID = sessionID) if i else i))) for i in pair) def __get_topic_recursion(self,topics): result={} for topic in topics: topic_depth=result for sub_topic in topic.split("."): topic_depth=topic_depth.setdefault(sub_topic,{}) try: del result[''] result={'':result} except:pass return result def save_template(self,filename): with open(filename,"w") as template: for topic_name,sub_topic in self.__get_topic_recursion(self._pairs).items(): self.__genrate_and_write_template(template,self._pairs,topic_name,sub_topic) def __genrate_and_write_template(self,template,pairs,topic,sub_topics,base_path=None): full_path=(base_path+"."+topic) if base else topic if topic:template.write("{% group "+topic+" %}") for topic_name,sub_topic in sub_topics.items():self.__genrate_and_write_template(template,pairs,topic_name,sub_topic,full_path) for (pattern, parent, response,learn) in pairs[full_path]["pairs"]: template.write("{% block %}") template.write("{% client %}"+pattern.pattern+"{% endclient %}") if parent!=None: template.write("{% prev %}"+parent.pattern+"{% endprev %}") for res in response: template.write("{% response %}"+res[0]+"{% response %}") if learn: template.write("{% learn %}") for topic_name,sub_topic in self.__get_topic_recursion(learn).items():self.__genrate_and_write_template(template,learn,topic_name,sub_topic) template.write("{% endlearn %}") template.write("{% endblock %}") for res in pairs[topic]["defaults"]: template.write("{% response %}"+res[0]+"{% response %}") if topic:template.write("{% endgroup %}") # Hold a conversation with a chatbot def converse(self,firstQuestion=None ,quit="quit",sessionID = "general"): if firstQuestion!= None: self.conversation[sessionID].append(firstQuestion) print (firstQuestion) try:input_reader = raw_input except NameError:input_reader = input input_sentence = "" while input_sentence != quit: input_sentence = quit try: input_sentence = input_reader("> ") except EOFError:print (input_sentence) if input_sentence: self.conversation[sessionID].append(input_sentence) while input_sentence[-1] in "!.": input_sentence = input_sentence[:-1] self.conversation[sessionID].append(self.respond(input_sentence,sessionID=sessionID)) print (self.conversation[sessionID][-1]) def demo(): firstQuestion="Hi, how are you?" Chat().converse(firstQuestion)
[ 1, 1053, 337, 29892, 8172, 29892, 24830, 29892, 3126, 13, 3166, 2897, 1053, 2224, 13, 3166, 869, 4592, 4035, 29879, 1053, 334, 13, 3166, 869, 1028, 514, 3198, 1053, 26385, 29892, 11686, 8452, 13, 2202, 29901, 13, 29871, 515, 3142, 1982, 1053, 14978, 13, 19499, 16032, 2392, 408, 321, 29901, 13, 29871, 515, 3142, 1982, 29889, 5510, 1053, 14978, 13, 259, 13, 259, 13, 999, 5942, 353, 426, 13, 29871, 376, 29875, 626, 29908, 539, 584, 376, 6293, 526, 613, 13, 29871, 376, 29875, 471, 29908, 418, 584, 376, 6293, 892, 613, 13, 29871, 376, 29875, 29908, 3986, 584, 376, 6293, 613, 13, 29871, 376, 29875, 29915, 29885, 29908, 4706, 584, 376, 6293, 526, 613, 13, 29871, 376, 29875, 29915, 29881, 29908, 4706, 584, 376, 6293, 723, 613, 13, 29871, 376, 29875, 29915, 345, 29908, 539, 584, 376, 6293, 505, 613, 13, 29871, 376, 29875, 29915, 645, 29908, 539, 584, 376, 6293, 674, 613, 13, 29871, 376, 1357, 29908, 308, 584, 376, 8066, 613, 13, 29871, 376, 6293, 526, 29908, 1678, 584, 376, 29902, 626, 613, 13, 29871, 376, 6293, 892, 29908, 259, 584, 376, 29902, 471, 613, 13, 29871, 376, 6293, 29915, 345, 29908, 268, 584, 376, 29902, 505, 613, 13, 29871, 376, 6293, 29915, 645, 29908, 268, 584, 376, 29902, 674, 613, 13, 29871, 376, 8066, 29908, 539, 584, 376, 1357, 613, 13, 29871, 376, 29891, 2470, 29908, 418, 584, 376, 24669, 613, 13, 29871, 376, 6293, 29908, 4706, 584, 376, 1004, 613, 13, 29871, 376, 1004, 29908, 308, 584, 376, 6293, 29908, 13, 29913, 13, 13, 13, 1990, 2473, 6678, 5594, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 9891, 3790, 29913, 1125, 13, 4706, 1583, 17255, 9891, 1649, 353, 3653, 13, 308, 13, 1678, 822, 2322, 9891, 29898, 1311, 29892, 1807, 29892, 7924, 1367, 29465, 17492, 29908, 1125, 13, 4706, 736, 1347, 13, 13, 1678, 822, 1246, 29898, 1311, 29892, 1807, 29892, 7924, 1367, 1125, 13, 4706, 269, 353, 1347, 29889, 5451, 703, 29901, 1159, 13, 4706, 565, 7431, 29898, 29879, 29897, 14065, 29896, 29901, 13, 9651, 736, 1347, 13, 4706, 1024, 353, 269, 29961, 29900, 1822, 17010, 580, 13, 4706, 269, 353, 29242, 1642, 7122, 29898, 29879, 29961, 29896, 29901, 2314, 13, 4706, 3653, 353, 1583, 29889, 4381, 9891, 13, 4706, 1018, 29901, 9891, 353, 1583, 17255, 9891, 1649, 29961, 978, 29962, 13, 4706, 5174, 29901, 29879, 353, 1347, 13, 4706, 736, 337, 29889, 1491, 29898, 29878, 29915, 1966, 4197, 29905, 7110, 3199, 10560, 29901, 2314, 742, 29878, 26732, 29896, 613, 9891, 29898, 276, 29889, 1491, 29898, 29878, 29915, 4197, 29905, 7110, 3199, 10560, 29901, 2314, 742, 29878, 29908, 1966, 29905, 29896, 613, 29879, 511, 7924, 1367, 353, 7924, 1367, 876, 13, 13, 1990, 20254, 9652, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1807, 1125, 13, 4706, 1583, 29889, 1807, 353, 1347, 13, 13, 1678, 822, 2318, 29898, 1311, 29892, 2248, 1125, 13, 4706, 565, 2380, 1360, 29900, 29901, 2457, 1583, 29889, 1807, 13, 4706, 12020, 11374, 2392, 703, 1217, 1316, 2318, 1159, 13, 13, 1678, 822, 2318, 8977, 29898, 1311, 29892, 29930, 1191, 29892, 1068, 29895, 1191, 1125, 13, 4706, 736, 6571, 13, 13, 1990, 7488, 293, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3332, 1199, 1125, 13, 4706, 1583, 29889, 13010, 3790, 29908, 17492, 1115, 4907, 29913, 13, 4706, 1583, 29889, 3332, 1199, 353, 23820, 13, 268, 13, 1678, 822, 4770, 842, 667, 12035, 1311, 29892, 1989, 29892, 1767, 1125, 13, 4706, 995, 353, 995, 29889, 17010, 580, 13, 4706, 565, 995, 322, 995, 29961, 29900, 13192, 29569, 1115, 13, 9651, 2380, 29922, 29896, 13, 9651, 1857, 29918, 13010, 353, 1583, 29889, 13010, 29961, 1989, 1822, 5451, 17350, 1159, 13, 9651, 1550, 995, 29961, 2248, 13192, 29569, 1115, 13, 18884, 2380, 23661, 29896, 13, 18884, 1857, 29918, 13010, 29889, 7323, 580, 13, 9651, 1857, 29918, 13010, 29889, 4397, 29898, 1767, 29961, 2248, 29901, 2314, 13, 9651, 995, 353, 376, 1213, 29889, 7122, 29898, 3784, 29918, 13010, 29897, 13, 4706, 1583, 29889, 13010, 29961, 1989, 13192, 1767, 13, 308, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 1989, 1125, 13, 4706, 11261, 353, 1583, 29889, 13010, 29961, 1989, 29962, 13, 4706, 565, 11261, 297, 1583, 29889, 3332, 1199, 7295, 13, 9651, 736, 11261, 13, 4706, 736, 6629, 13, 13, 1990, 678, 271, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 11000, 29922, 3285, 2143, 5942, 29922, 999, 5942, 29892, 1246, 29922, 9910, 6678, 5594, 3285, 7882, 3790, 1118, 4226, 3950, 29922, 4381, 19077, 29892, 4381, 29918, 6886, 29922, 2084, 29889, 7122, 29898, 2084, 29889, 25721, 29898, 2084, 29889, 370, 1028, 493, 22168, 1445, 1649, 8243, 29908, 4381, 29889, 6886, 5783, 29901, 13, 4706, 9995, 13, 4706, 25455, 278, 13563, 7451, 29889, 29871, 349, 7121, 338, 263, 1051, 310, 15038, 322, 20890, 29889, 29871, 7806, 13, 4706, 4766, 338, 263, 4943, 4603, 9686, 278, 1404, 29915, 29879, 3229, 470, 1139, 29892, 13, 4706, 321, 29889, 29887, 29889, 364, 29915, 29902, 763, 313, 5575, 29897, 4286, 29871, 1152, 1269, 1316, 4766, 263, 1051, 310, 1950, 20890, 13, 4706, 338, 2183, 29892, 321, 29889, 29887, 29889, 6024, 11008, 437, 366, 763, 1273, 29896, 742, 525, 9260, 366, 3926, 766, 4561, 1273, 29896, 13359, 29871, 17582, 13, 4706, 607, 338, 19228, 491, 28076, 1891, 13926, 310, 278, 15038, 313, 29872, 29889, 29887, 29889, 869, 7528, 338, 20545, 304, 13, 4706, 278, 1353, 287, 11909, 297, 278, 20890, 29892, 321, 29889, 29887, 29889, 1273, 29896, 29889, 13, 13, 4706, 584, 1853, 11000, 29901, 1051, 310, 18761, 13, 4706, 584, 3207, 11000, 29901, 450, 15038, 322, 20890, 13, 4706, 584, 1853, 2143, 5942, 29901, 9657, 13, 4706, 584, 3207, 2143, 5942, 29901, 319, 10417, 1546, 937, 322, 1473, 2022, 12241, 13, 4706, 584, 29878, 1853, 29901, 6213, 13, 4706, 9995, 13, 4706, 1583, 17255, 2344, 1649, 13789, 580, 13, 4706, 2322, 29886, 7121, 353, 1583, 17255, 5014, 6733, 2283, 29898, 4381, 29918, 6886, 29897, 13, 4706, 565, 1134, 29898, 29886, 7121, 467, 1649, 978, 1649, 297, 6702, 2523, 356, 3788, 710, 29374, 13, 3986, 11000, 353, 1583, 17255, 5014, 6733, 2283, 29898, 29886, 7121, 29897, 13, 4706, 1583, 3032, 29886, 7121, 353, 11117, 2396, 6377, 29886, 7121, 1115, 29961, 1402, 29908, 4381, 29879, 1115, 2636, 930, 29871, 13, 4706, 565, 1134, 29898, 29886, 7121, 29897, 19216, 8977, 29901, 13, 3986, 11000, 353, 11117, 2396, 6377, 29886, 7121, 1115, 29886, 7121, 1699, 4381, 29879, 1115, 2636, 930, 13, 4706, 25342, 451, 6629, 297, 11000, 29901, 13, 3986, 12020, 7670, 2392, 703, 4592, 11261, 4567, 1159, 13, 4706, 1583, 3032, 8945, 3950, 353, 9657, 29898, 8945, 3950, 29897, 13, 4706, 363, 1820, 297, 4226, 3950, 29901, 13, 9651, 1583, 3032, 8945, 3950, 29961, 1989, 29889, 13609, 580, 29962, 353, 4226, 3950, 29961, 1989, 29962, 13, 4706, 1583, 3032, 8945, 3950, 29918, 13087, 353, 1583, 3032, 12198, 29918, 999, 5942, 29898, 8945, 3950, 29897, 13, 4706, 1583, 17255, 5014, 29931, 799, 29876, 29898, 4381, 29886, 7121, 29897, 13, 4706, 1583, 17255, 5014, 29931, 799, 29876, 29898, 29886, 7121, 29897, 13, 4706, 1583, 3032, 999, 5942, 353, 2143, 5942, 13, 4706, 1583, 3032, 13087, 353, 1583, 3032, 12198, 29918, 999, 5942, 29898, 999, 5942, 29897, 13, 4706, 1583, 3032, 14834, 353, 8853, 17492, 1115, 29912, 930, 13, 4706, 1583, 29889, 535, 874, 362, 353, 8853, 17492, 1115, 2636, 29913, 13, 4706, 1583, 29889, 7924, 1367, 353, 376, 17492, 29908, 13, 4706, 1583, 29889, 5552, 353, 8853, 17492, 28819, 4352, 1115, 8516, 1699, 3358, 905, 1115, 8516, 1699, 29918, 1396, 1115, 8824, 1699, 22492, 12356, 1115, 5574, 930, 13, 4706, 1583, 29889, 4804, 353, 1246, 13, 4706, 1583, 29889, 13010, 353, 7488, 293, 29898, 1311, 3032, 29886, 7121, 29889, 8149, 29897, 13, 4706, 1018, 29901, 1311, 3032, 2754, 353, 7882, 565, 1134, 29898, 2754, 29897, 1360, 8977, 1683, 4390, 29889, 1359, 29898, 2754, 29897, 13, 4706, 5174, 29901, 22692, 21306, 2392, 703, 13919, 995, 363, 7882, 1159, 13, 13, 1678, 822, 4770, 2344, 1649, 13789, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 11905, 25795, 322, 5455, 9863, 13, 4706, 9995, 13, 4706, 1583, 17255, 2467, 29918, 3179, 9306, 353, 8853, 13496, 1115, 1311, 17255, 13496, 29918, 13789, 29892, 13, 462, 3986, 376, 677, 1115, 1311, 17255, 677, 29918, 13789, 29892, 13, 462, 3986, 376, 786, 1115, 1311, 17255, 786, 29918, 13789, 29892, 13, 462, 3986, 376, 5030, 1115, 1311, 17255, 5030, 29918, 13789, 29892, 13, 462, 3986, 376, 4804, 1115, 1311, 17255, 4804, 29918, 13789, 29892, 13, 462, 3986, 376, 13010, 1115, 1311, 17255, 13010, 29918, 13789, 29892, 13, 462, 3986, 376, 1958, 1115, 1311, 17255, 1958, 29918, 13789, 29892, 13, 462, 3986, 376, 14513, 1115, 1311, 17255, 14513, 29918, 13789, 29892, 13, 9651, 500, 13, 4706, 1583, 17255, 5527, 3245, 29918, 6891, 353, 426, 13, 18884, 376, 29991, 543, 29901, 2892, 263, 29892, 29890, 29901, 29874, 19216, 29890, 29892, 13, 18884, 376, 29958, 543, 29901, 2892, 263, 29892, 29890, 29901, 29874, 18572, 29890, 29892, 13, 18884, 9872, 543, 29901, 2892, 263, 29892, 29890, 29901, 29874, 14065, 29890, 29892, 13, 18884, 376, 26359, 29901, 2892, 263, 29892, 29890, 29901, 29874, 1360, 29890, 29892, 13, 18884, 9872, 1115, 2892, 263, 29892, 29890, 29901, 29874, 29966, 29890, 29892, 13, 18884, 376, 29958, 1115, 2892, 263, 29892, 29890, 29901, 29874, 29958, 29890, 13, 9651, 500, 13, 4706, 1583, 17255, 1188, 936, 29918, 6891, 353, 29912, 13, 18884, 525, 29987, 2396, 2892, 263, 29892, 29890, 29901, 29874, 322, 289, 29892, 13, 18884, 525, 29989, 2396, 2892, 263, 29892, 29890, 29901, 29874, 470, 289, 29892, 13, 18884, 525, 29985, 2396, 2892, 263, 29892, 29890, 29901, 29874, 6228, 289, 13, 9651, 500, 13, 308, 13, 13, 1678, 822, 4770, 8945, 675, 29898, 1311, 29892, 726, 1125, 13, 4706, 9995, 13, 4706, 3323, 303, 12356, 3838, 297, 278, 1347, 29892, 5034, 304, 278, 6790, 21981, 29892, 13, 4706, 321, 29889, 29887, 29889, 376, 29902, 29915, 29885, 29908, 1599, 376, 29902, 626, 29908, 13, 13, 4706, 584, 1853, 851, 29901, 851, 13, 4706, 584, 3207, 851, 29901, 450, 1347, 304, 367, 20545, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 8945, 3950, 29918, 13087, 29889, 1491, 29898, 2892, 2730, 29901, 13, 18884, 1583, 3032, 8945, 3950, 29961, 4346, 29889, 1807, 29961, 4346, 29889, 2962, 7295, 4346, 29889, 355, 580, 20526, 13, 462, 1678, 1426, 29889, 13609, 3101, 13, 13, 1678, 822, 4770, 2704, 3728, 29898, 1311, 29892, 9684, 29892, 11940, 1125, 13, 4706, 736, 376, 1252, 6021, 14210, 29879, 29915, 4055, 1476, 14210, 29879, 11838, 1273, 313, 9684, 29892, 11940, 29897, 13, 13, 1678, 822, 4770, 5327, 28089, 29898, 1311, 29892, 726, 29892, 1066, 29892, 2248, 1125, 13, 4706, 2446, 29918, 2248, 29922, 2248, 29974, 29896, 13, 4706, 565, 926, 29961, 4622, 29918, 2248, 3816, 29906, 29962, 29991, 543, 355, 5327, 1115, 13, 9651, 12020, 21306, 2392, 29898, 1311, 17255, 2704, 3728, 703, 355, 5327, 613, 1066, 29961, 4622, 29918, 2248, 3816, 29906, 12622, 13, 4706, 736, 1426, 29961, 1066, 29961, 2248, 3816, 29896, 5387, 1066, 29961, 4622, 29918, 2248, 3816, 29900, 29962, 1822, 17010, 703, 320, 29873, 29905, 29876, 1159, 13, 1669, 13, 1678, 822, 4770, 1271, 28089, 29898, 1311, 29892, 726, 29892, 1066, 29892, 2848, 29892, 2248, 1125, 13, 4706, 2629, 1271, 353, 8853, 19668, 1115, 29912, 1118, 29908, 5327, 1115, 29961, 1402, 29908, 4645, 1115, 29961, 1402, 29908, 16304, 1115, 2636, 29913, 13, 4706, 1550, 926, 29961, 2248, 3816, 29906, 29962, 29991, 543, 355, 1271, 1115, 13, 9651, 565, 926, 29961, 2248, 3816, 29906, 13192, 543, 19668, 1115, 13, 18884, 2629, 1271, 3366, 19668, 3108, 3790, 29913, 13, 18884, 2380, 353, 1583, 17255, 4782, 28089, 29898, 726, 29892, 1066, 29892, 2541, 262, 1271, 3366, 19668, 12436, 29898, 2892, 474, 29901, 1066, 29961, 29875, 3816, 29906, 29962, 29991, 543, 355, 19668, 4968, 2848, 29892, 2248, 29974, 29896, 29897, 13, 18884, 2380, 29899, 29922, 29896, 13, 9651, 25342, 926, 29961, 2248, 3816, 29906, 13192, 543, 5327, 1115, 13, 18884, 2629, 1271, 3366, 5327, 16862, 4397, 29898, 1311, 17255, 5327, 28089, 29898, 726, 29892, 1066, 29892, 2248, 876, 13, 18884, 2380, 23661, 29896, 13, 9651, 25342, 926, 29961, 2248, 3816, 29906, 13192, 543, 4645, 1115, 13, 18884, 2380, 23661, 29896, 13, 18884, 565, 926, 29961, 2248, 3816, 29906, 29962, 29991, 543, 355, 4645, 1115, 13, 462, 1678, 12020, 21306, 2392, 29898, 1311, 17255, 2704, 3728, 703, 355, 4645, 613, 1066, 29961, 2248, 3816, 29906, 12622, 13, 18884, 2629, 1271, 3366, 4645, 16862, 4397, 29898, 726, 29961, 1066, 29961, 2248, 29899, 29896, 3816, 29896, 5387, 1066, 29961, 2248, 3816, 29900, 29962, 1822, 17010, 703, 320, 29873, 29905, 29876, 5783, 13, 9651, 25342, 926, 29961, 2248, 3816, 29906, 13192, 543, 16304, 1115, 13, 18884, 2380, 23661, 29896, 13, 18884, 565, 926, 29961, 2248, 3816, 29906, 29962, 29991, 543, 355, 16304, 1115, 13, 462, 1678, 12020, 21306, 2392, 29898, 1311, 17255, 2704, 3728, 703, 355, 16304, 613, 1066, 29961, 2248, 3816, 29906, 12622, 13, 18884, 2629, 1271, 3366, 16304, 16862, 4397, 29898, 726, 29961, 1066, 29961, 2248, 29899, 29896, 3816, 29896, 5387, 1066, 29961, 2248, 3816, 29900, 29962, 1822, 17010, 703, 320, 29873, 29905, 29876, 5783, 13, 9651, 1683, 29901, 13, 18884, 12020, 4408, 2392, 703, 13919, 10522, 14210, 29879, 11838, 1273, 29871, 926, 29961, 2248, 3816, 29906, 2314, 13, 9651, 2380, 23661, 29896, 13, 4706, 736, 2380, 29974, 29896, 22657, 2541, 262, 1271, 3366, 4645, 3108, 29961, 29900, 1402, 13, 462, 1678, 2629, 1271, 3366, 16304, 3108, 29961, 29900, 29962, 565, 2629, 1271, 3366, 16304, 3108, 1683, 6213, 29892, 13, 462, 1678, 2629, 1271, 3366, 5327, 12436, 13, 462, 1678, 2629, 1271, 3366, 19668, 3108, 1723, 13, 268, 13, 1678, 822, 4770, 4782, 28089, 29898, 1311, 29892, 726, 29892, 1066, 29892, 13155, 29892, 16122, 29892, 2848, 29892, 2248, 29922, 29900, 29892, 978, 13776, 1125, 13, 4706, 11000, 29922, 2636, 13, 4706, 21274, 29922, 2636, 13, 4706, 1550, 4195, 29898, 2248, 1125, 13, 9651, 565, 926, 29961, 2248, 3816, 29906, 13192, 543, 1271, 1115, 13, 18884, 282, 29892, 2541, 262, 353, 1583, 17255, 1271, 28089, 29898, 726, 29892, 1066, 29892, 2848, 29892, 2248, 29974, 29896, 29897, 13, 18884, 11000, 29889, 4397, 29898, 2541, 262, 29897, 13, 18884, 2380, 29922, 29886, 13, 9651, 25342, 926, 29961, 2248, 3816, 29906, 13192, 543, 5327, 1115, 13, 18884, 21274, 29889, 4397, 29898, 1311, 17255, 5327, 28089, 29898, 726, 29892, 1066, 29892, 2248, 876, 13, 18884, 2380, 23661, 29906, 13, 9651, 25342, 926, 29961, 2248, 3816, 29906, 13192, 543, 2972, 1115, 13, 18884, 2278, 29918, 978, 7607, 978, 13578, 1213, 29974, 1066, 29961, 2248, 3816, 29941, 1822, 17010, 3101, 565, 1024, 1683, 926, 29961, 2248, 3816, 29941, 1822, 17010, 580, 13, 18884, 2380, 353, 1583, 17255, 4782, 28089, 29898, 726, 29892, 1066, 29892, 13155, 22657, 2892, 474, 29901, 1066, 29961, 29875, 3816, 29906, 29962, 29991, 543, 355, 2972, 4968, 2848, 29892, 2248, 29974, 29896, 29892, 1024, 29922, 5145, 29918, 978, 29897, 13, 9651, 1683, 29901, 13, 18884, 12020, 21306, 2392, 29898, 1311, 17255, 2704, 3728, 877, 2972, 29892, 2908, 29892, 470, 2933, 742, 1066, 29961, 2248, 3816, 29906, 12622, 13, 4706, 565, 1024, 297, 6471, 29901, 13, 9651, 6471, 29961, 978, 29962, 3366, 29886, 7121, 16862, 21843, 29898, 29886, 7121, 29897, 13, 9651, 6471, 29961, 978, 29962, 3366, 4381, 29879, 16862, 21843, 29898, 4381, 29879, 29897, 13, 4706, 1683, 29901, 13, 9651, 6471, 29961, 978, 29962, 3790, 29908, 29886, 7121, 1115, 29886, 7121, 1699, 4381, 29879, 1115, 4381, 29879, 29913, 13, 4706, 736, 2380, 29974, 29896, 13, 308, 13, 1678, 822, 4770, 5014, 6733, 2283, 29898, 1311, 29892, 28926, 1125, 13, 4706, 411, 1722, 29898, 28926, 29892, 8025, 2433, 9420, 29899, 29947, 1495, 408, 4472, 29901, 13, 9651, 1426, 353, 4472, 29889, 949, 580, 13, 4706, 926, 353, 17288, 29885, 29889, 2962, 29898, 29900, 511, 29885, 29889, 355, 29898, 29900, 511, 726, 29961, 29885, 29889, 2962, 29898, 29896, 1125, 29885, 29889, 355, 29898, 29896, 29897, 1402, 726, 29961, 29885, 29889, 2962, 29898, 29946, 1125, 29885, 29889, 355, 29898, 29946, 29897, 2314, 320, 13, 18884, 363, 286, 297, 29871, 337, 29889, 2886, 1524, 29898, 29871, 13, 462, 1678, 364, 29915, 18255, 7110, 29879, 29905, 29873, 10062, 3552, 355, 6877, 29898, 1271, 29989, 19668, 29989, 5327, 29989, 4645, 29989, 16304, 29989, 2972, 876, 7110, 29879, 29905, 29873, 10062, 4197, 29985, 29995, 14178, 29989, 29995, 10780, 11759, 29985, 6525, 876, 29995, 29913, 742, 13, 462, 1678, 1426, 29897, 13, 795, 4514, 13, 4706, 3309, 353, 7431, 29898, 1066, 29897, 13, 4706, 6471, 353, 6571, 13, 4706, 1583, 17255, 4782, 28089, 29898, 726, 29892, 1066, 29892, 13155, 22657, 2892, 474, 29901, 29875, 29966, 2848, 511, 2848, 29897, 13, 4706, 736, 6471, 13, 268, 13, 1678, 822, 4770, 4282, 29918, 11037, 29898, 1311, 29892, 11037, 1125, 13, 4706, 565, 4766, 19216, 8516, 29901, 13, 3986, 1018, 29901, 2457, 337, 29889, 12198, 29898, 1311, 17255, 8945, 675, 29898, 11037, 511, 337, 29889, 6259, 6632, 1525, 23487, 29897, 13, 3986, 5174, 8960, 408, 321, 29901, 13, 9651, 321, 29889, 5085, 7607, 710, 29898, 29872, 7240, 376, 297, 4766, 15691, 11037, 29892, 1723, 13, 9651, 12020, 321, 13, 539, 13, 539, 13, 1678, 822, 4770, 5014, 29931, 799, 29876, 29898, 1311, 29892, 29886, 7121, 1125, 13, 4706, 363, 11261, 297, 11000, 29901, 13, 9651, 565, 11261, 451, 297, 1583, 3032, 29886, 7121, 29901, 1311, 3032, 29886, 7121, 29961, 13010, 29962, 3790, 29908, 29886, 7121, 1115, 29961, 1402, 29908, 4381, 29879, 1115, 2636, 29913, 13, 9651, 1583, 3032, 29886, 7121, 29961, 13010, 29962, 3366, 4381, 29879, 16862, 21843, 4197, 29898, 29875, 29892, 1311, 3032, 16122, 29898, 29875, 876, 29871, 13, 462, 462, 462, 1678, 363, 474, 297, 11000, 29961, 13010, 1822, 657, 703, 4381, 29879, 613, 23076, 2314, 13, 9651, 363, 5101, 297, 11000, 29961, 13010, 29962, 3366, 29886, 7121, 3108, 29961, 1057, 29899, 29896, 5387, 13, 18884, 5110, 29892, 3517, 353, 24335, 6213, 13, 18884, 3309, 353, 7431, 29898, 18784, 29897, 13, 18884, 565, 3309, 29958, 29941, 29901, 4645, 29892, 24957, 29892, 26679, 267, 29892, 19668, 353, 5101, 7503, 29946, 29962, 13, 18884, 25342, 3309, 1360, 29941, 29901, 13, 462, 1678, 565, 1134, 29898, 18784, 29961, 29896, 2314, 297, 313, 23583, 29892, 1761, 1125, 4645, 29892, 26679, 267, 29892, 19668, 353, 5101, 13, 462, 1678, 1683, 29901, 4645, 29892, 24957, 29892, 26679, 267, 353, 5101, 13, 18884, 25342, 3309, 1360, 29906, 322, 1134, 29898, 18784, 29961, 29896, 2314, 297, 313, 23583, 29892, 1761, 1125, 4645, 29892, 26679, 267, 353, 5101, 13, 18884, 1683, 29901, 22692, 7865, 2392, 703, 5103, 451, 6790, 1159, 13, 18884, 565, 1134, 29898, 19668, 29897, 2804, 9657, 29901, 13, 462, 1678, 12020, 20948, 703, 13919, 5167, 363, 5110, 3806, 9657, 2355, 14210, 29879, 11838, 1273, 1134, 29898, 29880, 467, 1649, 978, 1649, 29897, 13, 18884, 1583, 3032, 29886, 7121, 29961, 13010, 29962, 3366, 29886, 7121, 16862, 7851, 29898, 29900, 22657, 1311, 17255, 4282, 29918, 11037, 29898, 4645, 511, 13, 462, 462, 462, 418, 1583, 17255, 4282, 29918, 11037, 29898, 24957, 511, 13, 462, 462, 462, 418, 18761, 3552, 29875, 29892, 1311, 3032, 16122, 29898, 29875, 876, 363, 474, 297, 20890, 511, 13, 462, 462, 462, 418, 5110, 876, 13, 268, 13, 1678, 822, 903, 2962, 4373, 7317, 29898, 1311, 29892, 7924, 1367, 29892, 13010, 2433, 29374, 13, 4706, 1583, 3032, 14834, 29961, 7924, 1367, 29962, 3790, 29913, 13, 4706, 1583, 29889, 535, 874, 362, 29961, 7924, 1367, 13192, 2636, 13, 4706, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3790, 29908, 4352, 1115, 8516, 1699, 3358, 905, 1115, 8516, 1699, 29918, 1396, 1115, 8824, 1699, 22492, 12356, 1115, 5574, 29913, 13, 4706, 1583, 29889, 13010, 29961, 7924, 1367, 29962, 353, 11261, 13, 13, 1678, 822, 903, 5060, 1247, 545, 29898, 1311, 29892, 2972, 29892, 2248, 29922, 8516, 1125, 13, 4706, 565, 2380, 1360, 8516, 29901, 13, 9651, 260, 3668, 994, 3790, 29913, 13, 9651, 599, 29923, 2409, 353, 1051, 29898, 2972, 29897, 13, 9651, 363, 474, 297, 2318, 29901, 13, 18884, 260, 3668, 994, 29961, 29875, 13192, 842, 580, 13, 18884, 363, 432, 297, 2318, 29961, 29875, 5387, 13, 462, 1678, 260, 3668, 994, 29961, 29875, 1822, 5504, 29898, 842, 29898, 2972, 29961, 29875, 14664, 1639, 2042, 29898, 2972, 29961, 29926, 12622, 13, 9651, 363, 474, 297, 2318, 29901, 13, 18884, 363, 432, 297, 260, 3668, 994, 29961, 29875, 5387, 13, 462, 1678, 2318, 29961, 29875, 1822, 5992, 29898, 29926, 29897, 13, 462, 1678, 1018, 29901, 599, 29923, 2409, 29889, 5992, 29898, 29926, 29897, 13, 462, 1678, 5174, 29901, 1209, 13, 9651, 2380, 353, 1051, 29898, 2972, 29897, 13, 9651, 260, 3668, 994, 353, 518, 29926, 363, 474, 297, 1051, 29898, 497, 29923, 2409, 29897, 363, 432, 297, 2318, 29961, 29875, 5262, 13, 9651, 363, 474, 297, 260, 3668, 994, 29901, 13, 18884, 1018, 29901, 599, 29923, 2409, 29889, 5992, 29898, 29875, 29897, 13, 18884, 5174, 29901, 1209, 13, 4706, 1683, 29901, 13, 9651, 599, 29923, 2409, 353, 1051, 29898, 2248, 29897, 13, 4706, 1550, 2380, 29901, 13, 9651, 474, 353, 2380, 29889, 7323, 580, 13, 9651, 565, 1134, 29898, 2972, 29961, 29875, 2314, 1360, 1761, 29901, 13, 18884, 2318, 29961, 29875, 29962, 353, 1583, 3032, 5060, 1247, 545, 29898, 8977, 29898, 2972, 511, 2972, 29961, 29875, 2314, 13, 18884, 363, 432, 297, 1051, 29898, 2972, 29961, 29875, 29962, 1125, 13, 462, 1678, 1018, 29901, 2380, 29889, 5992, 29898, 29926, 29897, 13, 462, 1678, 5174, 29901, 1209, 13, 4706, 736, 426, 29875, 29901, 2972, 29961, 29875, 29962, 363, 474, 297, 599, 29923, 2409, 29913, 13, 308, 13, 1678, 822, 903, 1491, 4276, 29898, 1311, 29892, 2972, 29892, 2962, 29918, 355, 29918, 18784, 29892, 2467, 1125, 13, 4706, 736, 426, 29875, 26254, 13, 462, 1678, 376, 2467, 1115, 2467, 29961, 29875, 1402, 13, 462, 1678, 376, 2962, 1115, 2962, 29918, 355, 29918, 18784, 29961, 29875, 3816, 29900, 1402, 13, 462, 1678, 376, 355, 1115, 2962, 29918, 355, 29918, 18784, 29961, 29875, 3816, 29896, 1402, 13, 462, 1678, 376, 5145, 1115, 1311, 3032, 1491, 4276, 29898, 2972, 29961, 29875, 1402, 2962, 29918, 355, 29918, 18784, 29892, 2467, 29897, 13, 462, 29871, 500, 363, 474, 297, 2318, 29913, 13, 268, 13, 1678, 822, 903, 657, 3047, 262, 29898, 1311, 29892, 2972, 29892, 2248, 1125, 13, 13, 308, 13, 4706, 822, 2069, 29918, 2972, 29898, 29875, 1125, 13, 9651, 2318, 29961, 2248, 29961, 29875, 5262, 3366, 2541, 262, 3108, 29922, 2636, 13, 9651, 10372, 4782, 29889, 4397, 29898, 2972, 29961, 2248, 29961, 29875, 24960, 13, 9651, 736, 474, 29974, 29896, 13, 13, 4706, 822, 9773, 29918, 2972, 29898, 1066, 29892, 29875, 1125, 13, 9651, 926, 29892, 2541, 262, 353, 1583, 3032, 657, 3047, 262, 29898, 2972, 29892, 2248, 29961, 1066, 29901, 2314, 13, 9651, 2318, 29961, 2248, 29961, 29875, 29899, 29896, 5262, 3366, 2541, 262, 3108, 23661, 2541, 262, 13, 9651, 736, 926, 13, 13, 4706, 474, 353, 29871, 29900, 13, 4706, 10372, 4782, 353, 5159, 13, 4706, 1550, 474, 29966, 2435, 29898, 2248, 1125, 13, 9651, 565, 2318, 29961, 2248, 29961, 29875, 5262, 3366, 2467, 3108, 26359, 361, 1115, 13, 18884, 474, 29922, 2344, 29918, 2972, 29898, 29875, 29897, 13, 18884, 1369, 6545, 353, 5852, 29871, 13, 18884, 1550, 1369, 6545, 29901, 13, 462, 1678, 565, 474, 18572, 2435, 29898, 2248, 1125, 13, 462, 4706, 12020, 21306, 2392, 703, 3644, 451, 5764, 297, 11790, 3245, 3229, 1159, 13, 462, 1678, 565, 2318, 29961, 2248, 29961, 29875, 5262, 3366, 2467, 3108, 26359, 23681, 1115, 474, 353, 2069, 29918, 2972, 29898, 29875, 29897, 13, 462, 1678, 25342, 2318, 29961, 2248, 29961, 29875, 5262, 3366, 2467, 3108, 26359, 2870, 1115, 13, 462, 4706, 926, 353, 474, 353, 2069, 29918, 2972, 29898, 29875, 29897, 13, 462, 4706, 1369, 6545, 353, 7700, 13, 462, 4706, 1550, 2318, 29961, 2248, 29961, 1066, 5262, 3366, 2467, 3108, 29991, 543, 15224, 1115, 926, 353, 9773, 29918, 2972, 29898, 1066, 29892, 29875, 7240, 29875, 13, 462, 4706, 474, 353, 2069, 29918, 2972, 29898, 1066, 29897, 13, 462, 1678, 25342, 2318, 29961, 2248, 29961, 29875, 5262, 3366, 2467, 3108, 26359, 15224, 1115, 13, 462, 4706, 474, 353, 2069, 29918, 2972, 29898, 29875, 29897, 13, 462, 4706, 1369, 6545, 353, 7700, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 926, 353, 9773, 29918, 2972, 29898, 29875, 29892, 29875, 29897, 13, 462, 4706, 363, 432, 297, 3464, 29898, 29875, 29892, 1066, 1125, 628, 2318, 29961, 2248, 29961, 29926, 5262, 13, 462, 4706, 474, 4619, 926, 13, 9651, 25342, 2318, 29961, 2248, 29961, 29875, 5262, 3366, 2467, 3108, 297, 1583, 17255, 2467, 29918, 3179, 9306, 869, 8149, 7295, 13, 18884, 10372, 4782, 29889, 4397, 29898, 2972, 29961, 2248, 29961, 29875, 24960, 13, 18884, 474, 4619, 29871, 29896, 13, 9651, 1683, 29901, 2457, 474, 29892, 21693, 4782, 13, 4706, 736, 474, 29892, 21693, 4782, 13, 462, 13, 1678, 822, 903, 842, 2541, 262, 29898, 1311, 29892, 2972, 1125, 13, 4706, 2030, 353, 2972, 13, 4706, 363, 474, 297, 2318, 29901, 13, 9651, 565, 2318, 29961, 29875, 29962, 3366, 5145, 3108, 29901, 13, 18884, 2318, 29961, 29875, 29962, 3366, 5145, 3108, 353, 1583, 3032, 842, 2541, 262, 29898, 2972, 29961, 29875, 29962, 3366, 5145, 20068, 13, 4706, 2380, 353, 1051, 29898, 2972, 29897, 13, 4706, 2380, 29889, 6605, 29898, 1989, 353, 2892, 921, 29901, 2318, 29961, 29916, 29962, 3366, 2962, 20068, 13, 4706, 926, 29892, 21693, 4782, 353, 1583, 3032, 657, 3047, 262, 29898, 2972, 29892, 2248, 29897, 13, 4706, 565, 926, 29966, 2435, 29898, 2248, 1125, 13, 9651, 12020, 21306, 2392, 703, 20965, 3229, 1159, 13, 4706, 736, 10372, 4782, 13, 268, 13, 1678, 822, 903, 262, 27069, 29898, 1311, 29892, 2962, 29918, 355, 29918, 18784, 29892, 2467, 1125, 13, 4706, 2318, 353, 6571, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 2962, 29918, 355, 29918, 18784, 22164, 13, 9651, 2318, 29961, 29875, 29962, 353, 5159, 13, 9651, 363, 432, 297, 3464, 29898, 2435, 29898, 2962, 29918, 355, 29918, 18784, 22164, 13, 18884, 565, 1369, 29918, 355, 29918, 18784, 29961, 29875, 3816, 29900, 29962, 29966, 2962, 29918, 355, 29918, 18784, 29961, 29926, 3816, 29900, 29962, 322, 1369, 29918, 355, 29918, 18784, 29961, 29875, 3816, 29896, 29962, 29958, 2962, 29918, 355, 29918, 18784, 29961, 29926, 3816, 29896, 5387, 13, 462, 1678, 2318, 29961, 29875, 1822, 4397, 29898, 29926, 29897, 13, 4706, 2318, 353, 1583, 3032, 5060, 1247, 545, 29898, 2972, 29897, 13, 4706, 2318, 353, 1583, 3032, 1491, 4276, 29898, 2972, 29892, 2962, 29918, 355, 29918, 18784, 29892, 2467, 29897, 13, 4706, 736, 1583, 3032, 842, 2541, 262, 29898, 2972, 29897, 13, 13, 1678, 822, 903, 16122, 29898, 1311, 29892, 5327, 1125, 13, 4706, 926, 353, 17288, 29885, 29889, 2962, 29898, 29900, 511, 29885, 29889, 355, 29898, 29900, 876, 363, 286, 297, 337, 29889, 2886, 1524, 29898, 29878, 29915, 18255, 29973, 29989, 29995, 13684, 4295, 29961, 4295, 29962, 742, 2933, 4638, 13, 4706, 716, 9135, 353, 17288, 2962, 29892, 355, 29897, 363, 1369, 29892, 355, 297, 926, 565, 313, 1333, 1369, 29897, 470, 2933, 29961, 2962, 29899, 29896, 29962, 29991, 543, 1966, 29908, 4514, 13, 4706, 474, 29922, 29900, 13, 4706, 1369, 29918, 355, 29918, 18784, 353, 5159, 13, 4706, 8820, 353, 5159, 13, 4706, 1550, 716, 9135, 29901, 13, 9651, 363, 474, 297, 3464, 29898, 29896, 29892, 2435, 29898, 1482, 9135, 22164, 13, 18884, 565, 2933, 29961, 1482, 9135, 29961, 29875, 3816, 29896, 29962, 29899, 29896, 29962, 297, 376, 6525, 1115, 13, 462, 1678, 2867, 13, 9651, 565, 2933, 29961, 1482, 9135, 29961, 29875, 29899, 29896, 3816, 29900, 5262, 297, 376, 13970, 1115, 13, 18884, 1095, 8176, 353, 716, 9135, 29889, 7323, 29898, 29875, 29897, 13, 18884, 4802, 262, 8176, 353, 716, 9135, 29889, 7323, 29898, 29875, 29899, 29896, 29897, 13, 18884, 289, 29940, 353, 4802, 262, 8176, 29961, 29896, 29962, 29899, 3752, 262, 8176, 29961, 29900, 29962, 13, 18884, 321, 29940, 353, 1095, 8176, 29961, 29896, 29962, 29899, 355, 8176, 29961, 29900, 29962, 13, 18884, 565, 289, 29940, 2804, 321, 29940, 470, 451, 5135, 5327, 29961, 3752, 262, 8176, 29961, 29900, 5262, 1275, 376, 6377, 322, 2933, 29961, 355, 8176, 29961, 29896, 29962, 29899, 29896, 29962, 1275, 376, 27195, 470, 313, 5327, 29961, 3752, 262, 8176, 29961, 29900, 5262, 1275, 376, 3366, 322, 2933, 29961, 355, 8176, 29961, 29896, 29962, 29899, 29896, 29962, 1275, 376, 29962, 5783, 29901, 13, 462, 1678, 12020, 21306, 2392, 703, 20965, 5877, 14210, 29879, 11838, 1273, 2933, 29897, 13, 18884, 1369, 29918, 355, 29918, 18784, 29889, 4397, 3552, 3752, 262, 8176, 29961, 29896, 1402, 355, 8176, 29961, 29900, 12622, 13, 18884, 565, 289, 29940, 1275, 29871, 29906, 29901, 13, 462, 1678, 3229, 353, 337, 29889, 2886, 497, 29898, 364, 29915, 29985, 7110, 29879, 29905, 29873, 14178, 29898, 361, 29989, 15224, 29989, 23681, 29989, 2870, 29989, 13496, 29989, 677, 29989, 786, 29989, 5030, 29989, 4804, 29989, 13010, 29897, 7110, 29879, 29905, 29873, 10062, 742, 13, 462, 462, 9651, 2933, 29961, 3752, 262, 8176, 29961, 29896, 5387, 355, 8176, 29961, 29900, 24960, 13, 462, 1678, 565, 3229, 29901, 13, 462, 4706, 8820, 29889, 4397, 29898, 20788, 29961, 29900, 2314, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 12020, 21306, 2392, 703, 20965, 3229, 14210, 29879, 11838, 1273, 2933, 29961, 3752, 262, 8176, 29961, 29896, 5387, 355, 8176, 29961, 29900, 5262, 1723, 13, 18884, 1683, 29901, 13, 462, 1678, 565, 2933, 29961, 3752, 262, 8176, 29961, 29900, 5262, 1275, 29850, 1115, 13, 462, 4706, 8820, 29889, 4397, 703, 1958, 1159, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 8820, 29889, 4397, 703, 14513, 1159, 13, 9651, 1683, 29901, 13, 18884, 12020, 21306, 2392, 703, 20965, 5877, 297, 13218, 29995, 29879, 5931, 29908, 1273, 2933, 29897, 13, 4706, 1018, 29901, 13, 9651, 2318, 353, 1583, 3032, 262, 27069, 29898, 2962, 29918, 355, 29918, 18784, 29892, 7387, 29897, 13, 4706, 5174, 21306, 2392, 29901, 13, 9651, 12020, 21306, 2392, 703, 20965, 3229, 297, 13218, 29995, 29879, 5931, 29908, 1273, 2933, 29897, 13, 4706, 736, 2318, 13, 268, 13, 1678, 822, 903, 12198, 29918, 999, 5942, 29898, 1311, 29892, 8945, 1125, 13, 4706, 12705, 29918, 999, 29880, 353, 12705, 29898, 8945, 29889, 8149, 3285, 1820, 29922, 2435, 29892, 11837, 29922, 5574, 29897, 13, 4706, 736, 29871, 337, 29889, 12198, 29898, 29878, 26732, 29890, 3319, 29900, 11606, 29890, 1642, 4830, 703, 29989, 1642, 7122, 29898, 1958, 29898, 276, 29889, 21587, 29892, 13, 9651, 12705, 29918, 999, 29880, 876, 511, 337, 29889, 6259, 6632, 1525, 23487, 29897, 13, 13, 1678, 822, 903, 22492, 12356, 29898, 1311, 29892, 851, 1125, 13, 4706, 9995, 13, 4706, 3323, 303, 12356, 3838, 297, 278, 1347, 29892, 5034, 304, 278, 6790, 2143, 5942, 29892, 13, 4706, 321, 29889, 29887, 29889, 376, 29902, 29915, 29885, 29908, 1599, 376, 6293, 526, 29908, 13, 13, 4706, 584, 1853, 851, 29901, 851, 13, 4706, 584, 3207, 851, 29901, 450, 1347, 304, 367, 20545, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 565, 451, 1583, 29889, 5552, 29889, 657, 703, 22492, 12356, 613, 5574, 1125, 2457, 851, 13, 4706, 736, 1583, 3032, 13087, 29889, 1491, 29898, 2892, 2730, 29901, 13, 18884, 1583, 3032, 999, 5942, 29961, 4346, 29889, 1807, 29961, 4346, 29889, 2962, 7295, 4346, 29889, 355, 580, 20526, 13, 462, 1678, 851, 29889, 13609, 3101, 13, 268, 13, 1678, 822, 903, 3198, 6545, 29898, 1311, 29892, 535, 29892, 7924, 1367, 353, 376, 17492, 29908, 1125, 13, 4706, 926, 353, 17288, 29885, 29889, 2962, 29898, 29900, 511, 29885, 29889, 355, 29898, 29900, 511, 29885, 29889, 2972, 29898, 29900, 876, 363, 286, 297, 337, 29889, 2886, 1524, 29898, 29878, 29915, 4197, 4488, 29905, 29958, 19216, 13192, 29989, 29961, 4488, 29905, 29958, 29962, 29989, 29987, 4295, 29989, 29897, 742, 378, 4638, 13, 4706, 565, 451, 926, 29901, 2457, 378, 29889, 17010, 580, 13, 4706, 620, 353, 12379, 690, 353, 5852, 13, 4706, 12379, 29949, 353, 6213, 13, 4706, 282, 2395, 2789, 353, 376, 29987, 29908, 13, 4706, 319, 353, 378, 29961, 29900, 29901, 1066, 29961, 29900, 3816, 29900, 29962, 1822, 17010, 580, 13, 4706, 363, 432, 297, 29871, 3464, 29898, 2435, 29898, 1066, 22164, 13, 9651, 269, 29892, 29872, 29892, 29877, 353, 926, 29961, 29926, 29962, 13, 9651, 1018, 29901, 29933, 353, 378, 29961, 29872, 29901, 1066, 29961, 29926, 29974, 29896, 3816, 29900, 29962, 1822, 17010, 580, 13, 9651, 5174, 29901, 29933, 353, 378, 29961, 29872, 29901, 1822, 17010, 580, 13, 9651, 1018, 29901, 29874, 29892, 29890, 353, 5785, 29898, 29909, 511, 7411, 29898, 29890, 29897, 13, 9651, 5174, 29901, 29874, 29892, 29890, 353, 319, 29892, 29933, 13, 9651, 1018, 29901, 690, 353, 1583, 17255, 5527, 3245, 29918, 6891, 29961, 29877, 850, 29874, 29892, 29890, 29897, 322, 620, 13, 9651, 5174, 29901, 13, 18884, 1018, 29901, 16304, 690, 29892, 690, 353, 1583, 17255, 1188, 936, 29918, 6891, 29961, 29886, 2395, 2789, 850, 16304, 690, 29892, 690, 511, 5574, 13, 18884, 5174, 29901, 16676, 2392, 703, 20965, 15047, 5455, 13218, 29995, 29879, 5931, 29908, 1273, 282, 2395, 2789, 29897, 13, 18884, 282, 2395, 2789, 353, 288, 13, 9651, 319, 353, 350, 13, 4706, 736, 1583, 17255, 1188, 936, 29918, 6891, 29961, 29886, 2395, 2789, 850, 16304, 690, 29892, 690, 29897, 13, 268, 13, 1678, 822, 4770, 361, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 1125, 13, 4706, 1369, 353, 1583, 17255, 657, 29918, 2962, 29918, 1066, 29898, 16122, 29961, 29875, 29962, 3366, 2962, 12436, 5327, 1699, 361, 1159, 13, 4706, 1095, 353, 4195, 29961, 29875, 29962, 3366, 355, 3108, 13, 4706, 1423, 353, 5852, 13, 4706, 19228, 3220, 353, 6213, 13, 4706, 903, 1396, 353, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 13, 4706, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 353, 7700, 13, 4706, 23764, 353, 1583, 29889, 5552, 29889, 657, 703, 22492, 12356, 613, 5574, 29897, 13, 4706, 1583, 29889, 5552, 3366, 22492, 12356, 3108, 353, 7700, 13, 4706, 1550, 1423, 29901, 13, 9651, 378, 353, 1583, 3032, 3198, 2855, 29923, 4387, 403, 25255, 29898, 5327, 29892, 16122, 29961, 29875, 29962, 3366, 5145, 12436, 2962, 29892, 355, 29892, 7924, 1367, 353, 7924, 1367, 29897, 13, 9651, 474, 23661, 29896, 13, 9651, 565, 1583, 3032, 3198, 6545, 29898, 535, 29892, 7924, 1367, 353, 7924, 1367, 1125, 13, 18884, 19228, 3220, 353, 474, 29899, 29896, 13, 18884, 1550, 4195, 29961, 29875, 29962, 3366, 2467, 3108, 2804, 376, 15224, 1115, 13, 462, 1678, 474, 23661, 29896, 13, 18884, 1423, 353, 7700, 13, 9651, 25342, 4195, 29961, 29875, 29962, 3366, 2467, 3108, 1275, 376, 2870, 1115, 13, 18884, 19228, 3220, 353, 474, 13, 18884, 1550, 4195, 29961, 29875, 29962, 3366, 2467, 3108, 2804, 376, 15224, 1115, 13, 462, 1678, 474, 23661, 29896, 13, 18884, 1423, 353, 7700, 462, 308, 13, 9651, 25342, 4195, 29961, 29875, 29962, 3366, 2467, 3108, 1275, 376, 23681, 1115, 13, 18884, 1369, 353, 1583, 17255, 657, 29918, 2962, 29918, 1066, 29898, 16122, 29961, 29875, 29962, 3366, 2962, 12436, 5327, 1699, 23681, 1159, 13, 18884, 1095, 353, 4195, 29961, 29875, 29962, 3366, 355, 3108, 13, 9651, 25342, 4195, 29961, 29875, 29962, 3366, 2467, 3108, 1275, 376, 15224, 1115, 13, 18884, 1423, 353, 7700, 13, 4706, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 353, 903, 1396, 13, 4706, 1583, 29889, 5552, 3366, 22492, 12356, 3108, 353, 23764, 13, 4706, 736, 5135, 1311, 3032, 3198, 2855, 29923, 4387, 403, 25255, 29898, 13, 462, 18884, 2933, 29892, 13, 462, 18884, 4195, 29961, 4352, 287, 3220, 29962, 3366, 2541, 262, 12436, 13, 462, 18884, 4195, 29961, 4352, 287, 3220, 29962, 3366, 355, 3108, 29974, 29906, 29892, 13, 462, 18884, 4195, 29961, 4352, 287, 3220, 29974, 29896, 29962, 3366, 2962, 3108, 29899, 29906, 29892, 13, 462, 18884, 4867, 1367, 353, 7924, 1367, 13, 462, 18884, 1723, 565, 19228, 3220, 19216, 8516, 1683, 376, 4968, 29875, 29897, 13, 268, 13, 1678, 822, 4770, 13789, 29898, 1311, 29892, 16122, 29892, 5327, 29892, 2467, 29892, 7924, 1367, 1125, 13, 4706, 736, 1583, 3032, 3198, 2855, 29923, 4387, 403, 25255, 29898, 13, 462, 18884, 2933, 29892, 13, 462, 18884, 4195, 3366, 5145, 12436, 13, 462, 18884, 1583, 17255, 657, 29918, 2962, 29918, 1066, 29898, 16122, 3366, 2962, 12436, 5327, 29892, 2467, 511, 13, 462, 18884, 4195, 3366, 355, 12436, 13, 462, 18884, 4867, 1367, 353, 7924, 1367, 13, 462, 18884, 1723, 13, 268, 13, 1678, 822, 4770, 13496, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 1125, 13, 4706, 23764, 353, 1583, 29889, 5552, 29889, 657, 703, 22492, 12356, 613, 5574, 29897, 13, 4706, 1583, 29889, 5552, 3366, 22492, 12356, 3108, 353, 7700, 13, 4706, 2933, 353, 1583, 29889, 3636, 29898, 1311, 17255, 13789, 29898, 16122, 29961, 29875, 1402, 5327, 1699, 13496, 613, 7924, 1367, 511, 7924, 1367, 353, 7924, 1367, 29897, 13, 4706, 1583, 29889, 5552, 3366, 22492, 12356, 3108, 353, 23764, 13, 4706, 736, 2933, 13, 268, 13, 1678, 822, 4770, 677, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 1125, 13, 4706, 736, 1583, 17255, 13789, 29898, 16122, 29961, 29875, 1402, 5327, 1699, 677, 613, 7924, 1367, 467, 13609, 580, 13, 308, 13, 1678, 822, 4770, 786, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 1125, 13, 4706, 736, 1583, 17255, 13789, 29898, 16122, 29961, 29875, 1402, 5327, 1699, 786, 613, 7924, 1367, 467, 21064, 580, 13, 308, 13, 1678, 822, 4770, 5030, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 1125, 13, 4706, 736, 1583, 17255, 13789, 29898, 16122, 29961, 29875, 1402, 5327, 1699, 5030, 613, 7924, 1367, 467, 5030, 2410, 675, 580, 13, 268, 13, 1678, 822, 4770, 4804, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 1125, 13, 4706, 736, 1583, 29889, 4804, 29889, 4804, 29898, 1311, 17255, 13789, 29898, 16122, 29961, 29875, 1402, 5327, 1699, 4804, 613, 7924, 1367, 511, 7924, 1367, 353, 7924, 1367, 29897, 13, 268, 13, 1678, 822, 4770, 13010, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 1125, 13, 4706, 1583, 29889, 13010, 29961, 7924, 1367, 29962, 353, 1583, 17255, 13789, 29898, 16122, 29961, 29875, 1402, 5327, 1699, 13010, 613, 7924, 1367, 467, 17010, 580, 13, 4706, 736, 5124, 13, 308, 13, 1678, 822, 4770, 657, 29918, 2962, 29918, 1066, 29898, 1311, 29892, 2962, 29892, 5327, 29892, 4548, 1125, 13, 4706, 736, 1369, 29974, 276, 29889, 12198, 29898, 29878, 29908, 4197, 29905, 29879, 29905, 29873, 14178, 17969, 4548, 13578, 7110, 29879, 29905, 29873, 10062, 29897, 2564, 4478, 29898, 5327, 29961, 2962, 29901, 14664, 355, 29898, 29896, 29897, 13, 13, 1678, 822, 4770, 1958, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 1125, 13, 4706, 1369, 353, 4195, 29961, 29875, 29962, 3366, 2962, 3108, 13, 4706, 1095, 353, 4195, 29961, 29875, 29962, 3366, 355, 3108, 13, 4706, 1348, 353, 7700, 13, 4706, 565, 2933, 29961, 2962, 29962, 1275, 376, 29991, 1115, 13, 9651, 1348, 353, 5852, 13, 9651, 1369, 4619, 29896, 13, 4706, 2793, 353, 1583, 3032, 3198, 2855, 29923, 4387, 403, 25255, 29898, 13, 462, 462, 1678, 2933, 29892, 13, 462, 462, 1678, 4195, 29961, 29875, 29962, 3366, 5145, 12436, 13, 462, 462, 1678, 1369, 29892, 13, 462, 462, 1678, 1095, 29892, 13, 462, 462, 1678, 4867, 1367, 353, 7924, 1367, 13, 462, 462, 1678, 13742, 17010, 2141, 5451, 703, 29901, 1159, 13, 4706, 1024, 353, 2793, 29961, 29900, 29962, 13, 4706, 445, 3220, 29922, 29900, 13, 4706, 363, 445, 3220, 297, 3464, 29898, 29896, 29892, 2435, 29898, 3051, 22164, 13, 9651, 565, 1024, 14352, 29896, 13192, 543, 1966, 1115, 13, 18884, 1024, 4619, 376, 6160, 29974, 3051, 29961, 1366, 3220, 29962, 13, 9651, 1683, 29901, 13, 18884, 445, 3220, 29899, 29922, 29896, 13, 18884, 2867, 13, 4706, 445, 3220, 23661, 29896, 13, 4706, 1024, 353, 1024, 29889, 17010, 2141, 13609, 580, 13, 4706, 565, 445, 3220, 29966, 29898, 2435, 29898, 3051, 22164, 13, 9651, 995, 353, 2793, 29961, 1366, 3220, 29962, 13, 9651, 363, 445, 3220, 297, 3464, 29898, 1366, 3220, 29974, 29896, 29892, 2435, 29898, 3051, 22164, 13, 18884, 565, 995, 14352, 29896, 13192, 543, 1966, 1115, 13, 462, 1678, 995, 4619, 376, 6160, 29974, 3051, 29961, 1366, 3220, 29962, 13, 18884, 1683, 29901, 13, 462, 1678, 2867, 13, 9651, 1583, 3032, 14834, 29961, 7924, 1367, 3816, 978, 29962, 353, 1583, 3032, 22492, 12356, 29898, 1767, 29889, 17010, 3101, 13, 4706, 736, 1583, 3032, 14834, 29961, 7924, 1367, 3816, 978, 29962, 565, 451, 1348, 322, 1024, 297, 1583, 3032, 14834, 29961, 7924, 1367, 29962, 1683, 5124, 13, 268, 13, 1678, 822, 4770, 14513, 29918, 13789, 29898, 1311, 29892, 29875, 29892, 16122, 29892, 5060, 459, 29876, 344, 29892, 7924, 1367, 1125, 13, 4706, 1369, 353, 4195, 29961, 29875, 29962, 3366, 2962, 3108, 13, 4706, 1095, 353, 4195, 29961, 29875, 29962, 3366, 355, 3108, 13, 4706, 1348, 353, 7700, 13, 4706, 565, 2933, 29961, 2962, 29962, 1275, 376, 29991, 1115, 13, 9651, 1348, 353, 5852, 13, 9651, 1369, 4619, 29896, 13, 4706, 903, 1396, 353, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 13, 4706, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 353, 5852, 13, 4706, 2793, 353, 1583, 3032, 3198, 2855, 29923, 4387, 403, 25255, 29898, 13, 462, 462, 1678, 2933, 29892, 13, 462, 462, 1678, 4195, 29961, 29875, 29962, 3366, 5145, 12436, 13, 462, 462, 1678, 1369, 29892, 13, 462, 462, 1678, 1095, 29892, 13, 462, 462, 1678, 4867, 1367, 353, 7924, 1367, 13, 462, 462, 1678, 13742, 17010, 580, 13, 4706, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 353, 903, 1396, 13, 4706, 659, 29879, 353, 2793, 29889, 5451, 28165, 1159, 13, 4706, 2983, 353, 659, 29879, 29961, 29900, 1822, 5451, 703, 29901, 1159, 13, 4706, 7882, 1170, 353, 2983, 29961, 29900, 29962, 13, 4706, 1158, 1170, 353, 29242, 1642, 7122, 29898, 7039, 29961, 29896, 29901, 2314, 13, 4706, 848, 3790, 29913, 13, 4706, 1820, 29922, 8516, 13, 4706, 363, 474, 297, 659, 29879, 29961, 29896, 29901, 5387, 13, 9651, 5101, 353, 659, 29879, 29961, 29875, 1822, 5451, 703, 29901, 1159, 13, 9651, 565, 7431, 29898, 18784, 15410, 29922, 29906, 29901, 13, 18884, 1820, 353, 5101, 29961, 29900, 29962, 13, 18884, 848, 29961, 1989, 24927, 29901, 1642, 7122, 29898, 18784, 29961, 29896, 29901, 2314, 13, 9651, 25342, 1820, 19216, 8516, 29901, 13, 18884, 848, 29961, 1989, 10062, 543, 1699, 29974, 18784, 29961, 29900, 29962, 13, 9651, 1683, 29901, 22692, 21306, 2392, 703, 20965, 5877, 14210, 29879, 11838, 1273, 2933, 29961, 2962, 29901, 355, 29962, 1723, 13, 4706, 1121, 353, 1583, 17255, 2754, 29918, 13789, 29898, 2754, 1170, 29892, 5696, 1170, 29892, 1272, 29897, 13, 4706, 736, 5124, 565, 1348, 1683, 1121, 13, 308, 13, 1678, 822, 4770, 2754, 29918, 3827, 29898, 1311, 29892, 2271, 29892, 5696, 29892, 1068, 29895, 1191, 1125, 13, 4706, 1018, 29901, 2457, 7274, 17255, 8977, 1649, 29961, 5696, 29889, 13609, 2141, 17010, 580, 850, 2271, 29892, 1068, 29895, 1191, 29897, 13, 4706, 5174, 7274, 29889, 11739, 29879, 29889, 18552, 292, 12763, 408, 321, 29901, 13, 9651, 736, 1583, 17255, 2754, 29918, 3827, 703, 1124, 597, 17969, 2271, 29892, 5696, 29892, 1068, 29895, 1191, 29897, 13, 4706, 5174, 7274, 29889, 11739, 29879, 29889, 5350, 2392, 408, 321, 29901, 13, 9651, 12020, 24875, 2392, 703, 23323, 29876, 29915, 29873, 4511, 304, 1923, 313, 348, 276, 496, 519, 467, 5399, 596, 3564, 1159, 13, 4706, 5174, 7670, 2392, 408, 321, 29901, 13, 9651, 12020, 24875, 2392, 703, 13919, 1158, 1024, 14210, 29879, 29915, 297, 7882, 29889, 3126, 29908, 1273, 1158, 29897, 13, 268, 13, 1678, 822, 4770, 2754, 29918, 13789, 29898, 1311, 29892, 2754, 1170, 29892, 5696, 1170, 29892, 1272, 3790, 29913, 1125, 13, 4706, 565, 7882, 1170, 451, 297, 1583, 3032, 2754, 470, 1158, 1170, 451, 297, 1583, 3032, 2754, 29961, 2754, 1170, 5387, 13, 9651, 12020, 24875, 2392, 703, 13919, 1158, 1024, 14210, 29879, 29915, 363, 7882, 14210, 29879, 29915, 9162, 29898, 5696, 1170, 29892, 2754, 1170, 876, 13, 4706, 7882, 29918, 7529, 353, 9657, 29898, 1311, 3032, 2754, 29961, 2754, 1170, 3816, 5696, 1170, 2314, 13, 4706, 565, 376, 5150, 29908, 297, 1583, 3032, 2754, 29961, 2754, 1170, 5387, 13, 9651, 1018, 29901, 2754, 29918, 7529, 3366, 15108, 583, 3108, 353, 1583, 17255, 2754, 29918, 3827, 29898, 1068, 1311, 3032, 2754, 29961, 2754, 1170, 29962, 3366, 5150, 3108, 467, 15108, 583, 13, 9651, 5174, 29901, 22692, 7865, 2392, 703, 797, 7882, 29889, 3126, 525, 5150, 29915, 310, 14210, 29879, 29915, 338, 2743, 368, 13252, 1213, 1273, 7882, 1170, 29897, 13, 4706, 1828, 353, 376, 7529, 29908, 565, 1583, 3032, 2754, 29961, 2754, 1170, 3816, 5696, 1170, 29962, 3366, 5696, 16862, 21064, 2141, 17010, 580, 1275, 376, 7194, 29908, 1683, 376, 1272, 29908, 13, 4706, 1018, 29901, 2754, 29918, 7529, 29961, 3207, 1822, 5504, 29898, 1272, 29897, 13, 4706, 5174, 29901, 2754, 29918, 7529, 29961, 3207, 29962, 353, 848, 13, 4706, 7882, 29918, 1853, 353, 376, 8945, 29908, 13, 4706, 565, 376, 1853, 29908, 297, 7882, 29918, 7529, 29901, 13, 9651, 7882, 29918, 1853, 353, 7882, 29918, 7529, 3366, 1853, 3108, 13, 9651, 628, 7882, 29918, 7529, 3366, 1853, 3108, 13, 4706, 7882, 29918, 1272, 29918, 657, 357, 353, 5159, 13, 4706, 565, 376, 1767, 29918, 657, 357, 29908, 297, 7882, 29918, 7529, 29901, 13, 9651, 7882, 29918, 1272, 29918, 657, 357, 353, 7882, 29918, 7529, 3366, 1767, 29918, 657, 357, 3108, 13, 9651, 628, 7882, 29918, 7529, 3366, 1767, 29918, 657, 357, 3108, 13, 4706, 2933, 353, 1583, 17255, 2754, 29918, 3827, 29898, 1068, 2754, 29918, 7529, 29897, 13, 4706, 2933, 1626, 353, 2933, 29889, 3126, 580, 565, 7882, 29918, 1853, 29889, 21064, 2141, 17010, 580, 26359, 7249, 29908, 1683, 2933, 29889, 3051, 13, 4706, 363, 1820, 297, 7882, 29918, 1272, 29918, 657, 357, 29901, 13, 9651, 2933, 1626, 353, 2933, 1626, 29961, 1989, 29962, 13, 4706, 736, 2933, 1626, 13, 268, 13, 1678, 822, 903, 1396, 29898, 1311, 29892, 1807, 29892, 7924, 1367, 1125, 13, 4706, 565, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 29901, 13, 9651, 1018, 29901, 2457, 3142, 1982, 29906, 29889, 1396, 29898, 1807, 29897, 13, 9651, 5174, 29901, 2457, 3142, 1982, 29906, 29889, 1396, 29898, 1807, 29889, 12508, 703, 10496, 29899, 29947, 5783, 13, 4706, 736, 1347, 13, 13, 1678, 822, 4770, 22492, 12356, 4591, 4032, 14473, 29898, 1311, 29892, 4352, 29892, 16304, 5103, 29892, 17833, 14730, 543, 613, 7924, 1367, 353, 376, 17492, 29908, 1125, 13, 4706, 9995, 13, 4706, 3323, 303, 12356, 515, 12477, 3229, 964, 620, 4220, 13, 4706, 9995, 13, 4706, 12379, 353, 29871, 29900, 13, 4706, 1369, 29925, 4676, 353, 29871, 29896, 29974, 2435, 29898, 17833, 14730, 29897, 13, 4706, 2186, 5103, 353, 5124, 13, 4706, 363, 286, 297, 337, 29889, 2886, 1524, 29898, 29878, 29915, 29995, 18717, 17833, 14730, 23097, 29961, 29900, 29899, 29929, 10062, 742, 12379, 5103, 1125, 13, 9651, 1369, 353, 286, 29889, 2962, 29898, 29900, 29897, 13, 9651, 1095, 353, 286, 29889, 355, 29898, 29900, 29897, 418, 13, 9651, 954, 353, 938, 29898, 16304, 5103, 29961, 2962, 29974, 2962, 29925, 4676, 29901, 355, 2314, 13, 9651, 2186, 5103, 4619, 12379, 5103, 29961, 16304, 29901, 2962, 29962, 13, 9651, 1018, 29901, 8394, 5103, 4619, 1583, 3032, 1396, 29898, 1311, 3032, 22492, 12356, 29898, 4352, 29889, 2972, 29898, 1949, 8243, 7924, 1367, 29897, 13, 9651, 5174, 11374, 2392, 408, 321, 29901, 3364, 13, 9651, 12379, 353, 1095, 13, 4706, 4257, 4782, 353, 1993, 29889, 2972, 8977, 580, 13, 4706, 565, 4257, 4782, 29901, 13, 9651, 12379, 5103, 353, 2186, 5103, 718, 12379, 5103, 29961, 16304, 17531, 13, 9651, 2186, 5103, 353, 5124, 13, 9651, 12379, 353, 29871, 29900, 13, 9651, 363, 286, 297, 337, 29889, 2886, 1524, 29898, 29878, 29915, 29995, 18717, 17833, 14730, 23097, 4197, 29874, 29899, 25265, 29899, 29999, 29918, 3816, 29874, 29899, 25265, 29899, 29999, 29918, 29900, 29899, 29929, 29962, 7528, 4197, 29985, 29874, 29899, 25265, 29899, 29999, 29918, 29900, 29899, 29929, 29962, 29989, 10931, 742, 12379, 5103, 1125, 13, 18884, 1369, 353, 286, 29889, 2962, 29898, 29896, 29897, 13, 18884, 1095, 353, 286, 29889, 355, 29898, 29896, 29897, 13, 18884, 2186, 5103, 4619, 12379, 5103, 29961, 16304, 29901, 2962, 29962, 13, 18884, 1018, 29901, 13, 462, 1678, 995, 353, 4257, 4782, 29961, 16304, 5103, 29961, 2962, 29974, 2962, 29925, 4676, 29901, 355, 5262, 13, 462, 1678, 565, 995, 29901, 8394, 5103, 4619, 1583, 3032, 1396, 29898, 1311, 3032, 22492, 12356, 29898, 1767, 511, 7924, 1367, 29897, 13, 18884, 5174, 7670, 2392, 408, 321, 29901, 3364, 13, 18884, 12379, 353, 1095, 13, 4706, 736, 2186, 5103, 718, 12379, 5103, 29961, 16304, 17531, 13, 268, 13, 1678, 822, 903, 3198, 2855, 29923, 4387, 403, 25255, 29898, 1311, 29892, 2933, 29892, 16122, 11759, 1402, 2962, 3220, 29922, 29900, 29892, 355, 3220, 29922, 8516, 29892, 7924, 1367, 353, 376, 17492, 29908, 1125, 13, 4706, 1095, 3220, 353, 1095, 3220, 565, 1095, 3220, 2804, 6213, 1683, 7431, 29898, 5327, 29897, 13, 4706, 565, 451, 4195, 29901, 13, 9651, 2186, 5103, 353, 1583, 17255, 22492, 12356, 4591, 4032, 14473, 29898, 1311, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 4352, 12436, 5327, 29961, 2962, 3220, 29901, 355, 3220, 1402, 7924, 1367, 353, 4867, 1367, 29897, 13, 9651, 3847, 9652, 29922, 1311, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 3358, 905, 3108, 13, 9651, 736, 1583, 17255, 22492, 12356, 4591, 4032, 14473, 29898, 3560, 9652, 29892, 8394, 5103, 29892, 17833, 14730, 353, 525, 29991, 742, 7924, 1367, 353, 4867, 1367, 29897, 565, 3847, 9652, 19216, 8516, 1683, 2186, 5103, 13, 4706, 474, 29922, 29900, 13, 4706, 2186, 5103, 353, 5124, 13, 4706, 1550, 474, 529, 7431, 29898, 16122, 1125, 13, 9651, 926, 353, 29871, 4195, 29961, 29875, 29962, 3366, 2962, 3108, 17722, 29896, 565, 4195, 29961, 29875, 29962, 3366, 2467, 3108, 297, 29871, 6796, 1958, 3284, 14513, 3108, 1683, 29871, 29906, 29897, 29871, 13, 9651, 2186, 5103, 4619, 1583, 3032, 3198, 2855, 29923, 4387, 403, 25255, 29898, 5327, 29961, 2962, 3220, 29901, 1066, 1402, 7924, 1367, 353, 7924, 1367, 29897, 13, 9651, 903, 1396, 353, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 13, 9651, 1018, 29901, 13, 18884, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 353, 7700, 13, 18884, 5694, 5103, 353, 1583, 17255, 2467, 29918, 3179, 9306, 29961, 16122, 29961, 29875, 29962, 3366, 2467, 3108, 850, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 29897, 13, 18884, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 353, 903, 1396, 13, 18884, 2186, 5103, 4619, 1583, 3032, 1396, 29898, 7382, 5103, 29892, 7924, 1367, 29897, 13, 9651, 5174, 7670, 2392, 408, 321, 29901, 13, 18884, 565, 4195, 29961, 29875, 29962, 3366, 2467, 3108, 1275, 376, 361, 1115, 13, 462, 1678, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 353, 903, 1396, 13, 462, 1678, 2933, 29918, 3945, 29892, 29875, 353, 1583, 17255, 361, 29918, 13789, 29898, 29875, 29892, 16122, 29892, 5327, 29892, 7924, 1367, 29897, 13, 462, 1678, 2186, 5103, 4619, 2933, 29918, 3945, 13, 9651, 1369, 3220, 353, 4195, 29961, 29875, 29962, 3366, 355, 3108, 17108, 29896, 565, 4195, 29961, 29875, 29962, 3366, 2467, 3108, 297, 29871, 6796, 1958, 3284, 14513, 3108, 1683, 29871, 29906, 29897, 29871, 13, 9651, 474, 23661, 29896, 13, 4706, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 29918, 1396, 3108, 353, 903, 1396, 13, 4706, 2186, 5103, 4619, 1583, 3032, 3198, 2855, 29923, 4387, 403, 25255, 29898, 5327, 29961, 2962, 3220, 29901, 355, 3220, 1402, 7924, 1367, 353, 4867, 1367, 29897, 13, 4706, 736, 2186, 5103, 13, 268, 13, 1678, 822, 903, 29893, 789, 28160, 29898, 1311, 29892, 2933, 29892, 1993, 29892, 3847, 9652, 29892, 7924, 1367, 353, 376, 17492, 29908, 1125, 13, 4706, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 4352, 3108, 29922, 4352, 13, 4706, 1583, 29889, 5552, 29961, 7924, 1367, 29962, 3366, 3358, 905, 3108, 29922, 3560, 9652, 13, 4706, 2933, 29892, 16122, 353, 29871, 2933, 13, 4706, 736, 337, 29889, 1491, 29898, 29878, 29915, 1966, 4197, 29905, 7110, 3199, 10560, 29901, 2314, 742, 29878, 26732, 29896, 613, 1311, 3032, 3198, 2855, 29923, 4387, 403, 25255, 29898, 5327, 29892, 16122, 29892, 7924, 1367, 353, 4867, 1367, 29871, 876, 13, 13, 1678, 822, 4770, 305, 852, 29918, 392, 29918, 5014, 29898, 1311, 29892, 1859, 1575, 29892, 4352, 29892, 3560, 9652, 29892, 7924, 1367, 1125, 13, 4706, 4613, 353, 4036, 29889, 16957, 29898, 1859, 1575, 29897, 1678, 396, 5839, 263, 4036, 2933, 13, 4706, 4613, 353, 1583, 3032, 29893, 789, 28160, 29898, 13713, 29892, 1993, 29892, 3847, 9652, 29892, 7924, 1367, 353, 4867, 1367, 29897, 396, 1889, 8775, 28160, 13, 4706, 396, 2329, 286, 686, 287, 6035, 22999, 362, 472, 278, 1095, 13, 4706, 565, 4613, 14352, 29906, 17531, 1275, 525, 9808, 2396, 4613, 353, 4613, 7503, 29899, 29906, 29962, 718, 525, 6169, 13, 4706, 565, 4613, 14352, 29906, 17531, 1275, 525, 8773, 2396, 4613, 353, 4613, 7503, 29899, 29906, 29962, 718, 525, 17901, 13, 4706, 736, 4613, 13, 13, 1678, 822, 4770, 524, 355, 29918, 21731, 29898, 1311, 29892, 1426, 29892, 3517, 1626, 29892, 1857, 29918, 13010, 29892, 4867, 1367, 1125, 13, 4706, 363, 313, 11037, 29892, 3847, 29892, 2933, 29892, 19668, 29897, 297, 1583, 3032, 29886, 7121, 29961, 3784, 29918, 13010, 29962, 3366, 29886, 7121, 3108, 21968, 1423, 1269, 4766, 13, 3986, 1993, 353, 4766, 29889, 4352, 29898, 726, 29897, 13, 3986, 565, 451, 1993, 29901, 19878, 13, 3986, 565, 3847, 1360, 8516, 29901, 2457, 1993, 29892, 8516, 29892, 5327, 29892, 19668, 13, 3986, 3847, 9652, 353, 3847, 29889, 4352, 29898, 24957, 1626, 29897, 13, 3986, 565, 3847, 9652, 21968, 1258, 278, 4766, 1993, 29973, 13, 9651, 736, 1993, 29892, 3560, 9652, 29892, 5327, 29892, 19668, 13, 13, 1678, 822, 4770, 5327, 29918, 265, 29918, 13010, 29898, 1311, 29892, 1426, 29892, 3517, 1626, 29892, 1426, 29918, 2616, 276, 428, 29892, 1857, 29918, 13010, 29892, 4867, 1367, 353, 376, 17492, 29908, 1125, 13, 4706, 1993, 29922, 1311, 17255, 524, 355, 29918, 21731, 29898, 726, 29892, 3517, 1626, 29892, 1857, 29918, 13010, 29892, 4867, 1367, 29897, 470, 320, 13, 795, 1583, 17255, 524, 355, 29918, 21731, 29898, 726, 29918, 2616, 276, 428, 29892, 3517, 1626, 29892, 1857, 29918, 13010, 29892, 4867, 1367, 29897, 13, 4706, 565, 1993, 29901, 13, 3986, 1993, 29892, 3560, 9652, 29892, 5327, 29892, 19668, 29922, 4352, 13, 3986, 565, 5110, 29901, 13, 9651, 1583, 17255, 5014, 29931, 799, 29876, 3319, 13, 462, 29871, 1583, 3032, 29893, 789, 28160, 3552, 13010, 29892, 1311, 3032, 16122, 29898, 13010, 8243, 1993, 29892, 3847, 9652, 29892, 7924, 1367, 353, 4867, 1367, 1125, 320, 13, 462, 29871, 11117, 29886, 7121, 2396, 29961, 1311, 17255, 22492, 12356, 797, 29931, 799, 29876, 29898, 18784, 29892, 1993, 29892, 3847, 9652, 29892, 7924, 1367, 353, 4867, 1367, 29897, 363, 5101, 297, 5110, 29961, 13010, 22322, 29886, 7121, 2033, 1402, 13, 462, 259, 525, 4381, 29879, 2396, 29961, 1311, 3032, 29893, 789, 28160, 3552, 4381, 29892, 1311, 3032, 16122, 29898, 4381, 8243, 1993, 29892, 3847, 9652, 29892, 7924, 1367, 353, 4867, 1367, 29897, 363, 2322, 297, 5110, 29961, 13010, 22322, 4381, 29879, 2033, 29962, 29871, 500, 320, 13, 462, 29871, 363, 11261, 297, 5110, 1800, 13, 3986, 736, 1583, 17255, 305, 852, 29918, 392, 29918, 5014, 29898, 5327, 29892, 4352, 29892, 3560, 9652, 29892, 7924, 1367, 29897, 13, 4706, 565, 1583, 3032, 29886, 7121, 29961, 3784, 29918, 13010, 29962, 3366, 4381, 29879, 3108, 29901, 13, 3986, 736, 1583, 17255, 305, 852, 29918, 392, 29918, 5014, 29898, 1311, 3032, 29886, 7121, 29961, 3784, 29918, 13010, 29962, 3366, 4381, 29879, 12436, 29881, 11770, 9652, 29898, 726, 511, 6213, 29892, 7924, 1367, 29897, 13, 4706, 12020, 7865, 2392, 703, 3782, 1993, 1476, 1159, 13, 13, 1678, 822, 4770, 2616, 276, 428, 29898, 1311, 29892, 726, 1125, 13, 4706, 9995, 13, 4706, 24779, 26385, 13, 4706, 9995, 13, 4706, 716, 29918, 726, 353, 5159, 13, 4706, 363, 474, 297, 1426, 29889, 5451, 7295, 13, 9651, 565, 7431, 29898, 29875, 15410, 29941, 29901, 13, 18884, 4482, 353, 474, 29889, 13609, 580, 13, 18884, 716, 29918, 726, 29889, 4397, 29898, 29875, 565, 399, 1955, 8452, 29961, 29875, 29962, 1683, 26385, 29898, 29875, 876, 13, 9651, 1683, 29901, 1482, 29918, 726, 29889, 4397, 29898, 29875, 29897, 13, 4706, 736, 376, 11393, 7122, 29898, 1482, 29918, 726, 29897, 13, 13, 1678, 822, 10049, 29898, 1311, 29892, 1426, 29892, 4867, 1367, 353, 376, 17492, 29908, 1125, 13, 4706, 9995, 13, 4706, 3251, 403, 263, 2933, 304, 278, 1404, 1881, 29889, 13, 13, 4706, 584, 1853, 1426, 29901, 851, 13, 4706, 584, 3207, 1426, 29901, 450, 1347, 304, 367, 20545, 13, 4706, 584, 29878, 1853, 29901, 851, 13, 4706, 9995, 13, 4706, 1426, 353, 29871, 1583, 17255, 8945, 675, 29898, 726, 29897, 13, 4706, 3517, 1626, 353, 1583, 17255, 8945, 675, 29898, 1311, 29889, 535, 874, 362, 29961, 7924, 1367, 3816, 29899, 29906, 2314, 13, 4706, 1426, 29918, 2616, 276, 428, 353, 1583, 17255, 2616, 276, 428, 29898, 726, 29897, 13, 4706, 1857, 29918, 13010, 353, 1583, 29889, 13010, 29961, 7924, 1367, 29962, 13, 4706, 1857, 29918, 13010, 29918, 2098, 353, 1857, 29918, 13010, 29889, 5451, 17350, 1159, 13, 4706, 1550, 1857, 29918, 13010, 29918, 2098, 29901, 13, 3986, 1018, 29901, 2457, 1583, 17255, 5327, 29918, 265, 29918, 13010, 29898, 726, 29892, 3517, 1626, 29892, 1426, 29918, 2616, 276, 428, 29892, 1857, 29918, 13010, 29892, 4867, 1367, 29897, 13, 3986, 5174, 7865, 2392, 408, 321, 29901, 3364, 13, 3986, 1857, 29918, 13010, 29918, 2098, 29889, 7323, 580, 13, 3986, 1857, 29918, 13010, 353, 376, 1213, 29889, 7122, 29898, 3784, 29918, 13010, 29918, 2098, 29897, 13, 4706, 1018, 29901, 2457, 1583, 17255, 5327, 29918, 265, 29918, 13010, 29898, 726, 29892, 3517, 1626, 29892, 1426, 29918, 2616, 276, 428, 29892, 1857, 29918, 13010, 29892, 4867, 1367, 29897, 13, 4706, 5174, 7865, 2392, 408, 321, 29901, 2457, 376, 29903, 3818, 306, 8496, 29915, 29873, 1284, 3099, 8018, 29908, 13, 268, 13, 1678, 822, 4770, 22492, 12356, 797, 29931, 799, 29876, 29898, 1311, 29892, 18784, 29892, 1993, 29892, 3847, 9652, 29892, 7924, 1367, 353, 376, 17492, 29908, 1125, 13, 4706, 736, 18761, 3552, 1311, 17255, 22492, 12356, 797, 29931, 799, 29876, 29898, 29875, 29892, 1993, 29892, 3847, 9652, 29892, 7924, 1367, 353, 4867, 1367, 29897, 565, 1134, 29898, 29875, 29897, 297, 313, 23583, 29892, 1761, 29897, 1683, 320, 13, 9651, 313, 29875, 565, 1134, 29898, 29875, 29897, 1275, 9657, 1683, 313, 1311, 3032, 29893, 789, 28160, 3552, 29875, 29892, 1311, 3032, 16122, 29898, 29875, 8243, 1993, 29892, 3847, 9652, 29892, 7924, 1367, 353, 4867, 1367, 29897, 565, 474, 1683, 474, 4961, 363, 474, 297, 5101, 29897, 13, 539, 13, 1678, 822, 4770, 657, 29918, 13010, 29918, 3757, 1295, 291, 29898, 1311, 29892, 3332, 1199, 1125, 13, 4706, 1121, 3790, 29913, 13, 4706, 363, 11261, 297, 23820, 29901, 13, 3986, 11261, 29918, 19488, 29922, 2914, 13, 3986, 363, 1014, 29918, 13010, 297, 11261, 29889, 5451, 703, 1213, 1125, 13, 9651, 11261, 29918, 19488, 29922, 13010, 29918, 19488, 29889, 842, 4381, 29898, 1491, 29918, 13010, 29892, 29912, 1800, 13, 4706, 1018, 29901, 13, 3986, 628, 1121, 1839, 2033, 13, 3986, 1121, 3790, 29915, 2396, 2914, 29913, 13, 4706, 5174, 29901, 3364, 13, 4706, 736, 1121, 13, 259, 13, 1678, 822, 4078, 29918, 6886, 29898, 1311, 29892, 9507, 1125, 13, 4706, 411, 1722, 29898, 9507, 1699, 29893, 1159, 408, 4472, 29901, 13, 3986, 363, 11261, 29918, 978, 29892, 1491, 29918, 13010, 297, 1583, 17255, 657, 29918, 13010, 29918, 3757, 1295, 291, 29898, 1311, 3032, 29886, 7121, 467, 7076, 7295, 13, 9651, 1583, 17255, 1885, 10492, 29918, 392, 29918, 3539, 29918, 6886, 29898, 6886, 29892, 1311, 3032, 29886, 7121, 29892, 13010, 29918, 978, 29892, 1491, 29918, 13010, 29897, 13, 13, 1678, 822, 4770, 1885, 10492, 29918, 392, 29918, 3539, 29918, 6886, 29898, 1311, 29892, 6886, 29892, 29886, 7121, 29892, 13010, 29892, 1491, 29918, 3332, 1199, 29892, 3188, 29918, 2084, 29922, 8516, 1125, 13, 4706, 2989, 29918, 2084, 7607, 3188, 29918, 2084, 13578, 1213, 29974, 13010, 29897, 565, 2967, 1683, 11261, 13, 4706, 565, 11261, 29901, 6886, 29889, 3539, 703, 18255, 2318, 15691, 13010, 13578, 15493, 1159, 13, 4706, 363, 11261, 29918, 978, 29892, 1491, 29918, 13010, 297, 1014, 29918, 3332, 1199, 29889, 7076, 7295, 1311, 17255, 1885, 10492, 29918, 392, 29918, 3539, 29918, 6886, 29898, 6886, 29892, 29886, 7121, 29892, 13010, 29918, 978, 29892, 1491, 29918, 13010, 29892, 8159, 29918, 2084, 29897, 13, 4706, 363, 313, 11037, 29892, 3847, 29892, 2933, 29892, 19668, 29897, 297, 11000, 29961, 8159, 29918, 2084, 29962, 3366, 29886, 7121, 3108, 29901, 13, 9651, 4472, 29889, 3539, 703, 18255, 2908, 15493, 1159, 13, 9651, 4472, 29889, 3539, 703, 18255, 3132, 1273, 5038, 29974, 11037, 29889, 11037, 13578, 18255, 1095, 4645, 15493, 1159, 13, 9651, 565, 3847, 19216, 8516, 29901, 13, 18884, 4472, 29889, 3539, 703, 18255, 12379, 1273, 5038, 29974, 3560, 29889, 11037, 13578, 18255, 1095, 16304, 15493, 1159, 13, 9651, 363, 620, 297, 2933, 29901, 13, 18884, 4472, 29889, 3539, 703, 18255, 2933, 1273, 5038, 29974, 690, 29961, 29900, 10062, 29908, 18255, 2933, 15493, 1159, 13, 9651, 565, 5110, 29901, 13, 18884, 4472, 29889, 3539, 703, 18255, 5110, 15493, 1159, 13, 18884, 363, 11261, 29918, 978, 29892, 1491, 29918, 13010, 297, 1583, 17255, 657, 29918, 13010, 29918, 3757, 1295, 291, 29898, 19668, 467, 7076, 7295, 1311, 17255, 1885, 10492, 29918, 392, 29918, 3539, 29918, 6886, 29898, 6886, 29892, 19668, 29892, 13010, 29918, 978, 29892, 1491, 29918, 13010, 29897, 13, 18884, 4472, 29889, 3539, 703, 18255, 1095, 19668, 15493, 1159, 13, 9651, 4472, 29889, 3539, 703, 18255, 1095, 1271, 15493, 1159, 13, 4706, 363, 620, 297, 11000, 29961, 13010, 29962, 3366, 4381, 29879, 3108, 29901, 13, 9651, 4472, 29889, 3539, 703, 18255, 2933, 1273, 5038, 29974, 690, 29961, 29900, 10062, 29908, 18255, 2933, 15493, 1159, 13, 4706, 565, 11261, 29901, 6886, 29889, 3539, 703, 18255, 1095, 2972, 15493, 1159, 13, 462, 308, 13, 1678, 396, 21771, 263, 14983, 411, 263, 13563, 7451, 462, 462, 4706, 13, 1678, 822, 378, 3901, 29898, 1311, 29892, 4102, 16492, 29922, 8516, 1919, 28358, 543, 28358, 613, 7924, 1367, 353, 376, 17492, 29908, 1125, 13, 4706, 565, 937, 16492, 19216, 6213, 29901, 13, 9651, 1583, 29889, 535, 874, 362, 29961, 7924, 1367, 1822, 4397, 29898, 4102, 16492, 29897, 13, 9651, 1596, 313, 4102, 16492, 29897, 13, 4706, 1018, 29901, 2080, 29918, 16950, 353, 10650, 29918, 2080, 13, 4706, 5174, 4408, 2392, 29901, 2080, 29918, 16950, 353, 1881, 13, 4706, 1881, 29918, 18616, 663, 353, 5124, 13, 4706, 1550, 1881, 29918, 18616, 663, 2804, 23283, 29901, 13, 9651, 1881, 29918, 18616, 663, 353, 23283, 13, 9651, 1018, 29901, 1881, 29918, 18616, 663, 353, 1881, 29918, 16950, 703, 29958, 16521, 13, 9651, 5174, 382, 9800, 2392, 29901, 2158, 313, 2080, 29918, 18616, 663, 29897, 13, 9651, 565, 1881, 29918, 18616, 663, 29901, 13, 18884, 1583, 29889, 535, 874, 362, 29961, 7924, 1367, 1822, 4397, 29898, 2080, 29918, 18616, 663, 29897, 13, 18884, 1550, 1881, 29918, 18616, 663, 14352, 29896, 29962, 297, 376, 21520, 1115, 1881, 29918, 18616, 663, 353, 1881, 29918, 18616, 663, 7503, 29899, 29896, 29962, 13, 18884, 1583, 29889, 535, 874, 362, 29961, 7924, 1367, 1822, 4397, 29898, 1311, 29889, 3636, 29898, 2080, 29918, 18616, 663, 29892, 7924, 1367, 29922, 7924, 1367, 876, 13, 18884, 1596, 313, 1311, 29889, 535, 874, 362, 29961, 7924, 1367, 3816, 29899, 29896, 2314, 13, 13, 13, 1753, 13455, 7295, 13, 1678, 937, 16492, 543, 18567, 29892, 920, 526, 366, 3026, 13, 1678, 678, 271, 2141, 535, 3901, 29898, 4102, 16492, 29897, 13, 13, 2 ]
steampak/webapi/resources/user.py
idlesign/steampak
24
94688
<filename>steampak/webapi/resources/user.py from ..settings import URL_COMMUNITY_BASE, APPID_STEAM from ..utils import str_sub, DataFetcher from ..exceptions import ResponseError from .market import Item, Card, TAG_ITEM_CLASS_CARD URL_USER_BASE = URL_COMMUNITY_BASE + '/id/$username' URL_USER_INVENTORY_PUBLIC_BASE = URL_USER_BASE + '/inventory/json/' URL_USER_INVENTORY_PUBLIC_APP = URL_USER_INVENTORY_PUBLIC_BASE + '$appid/6' URL_USER_INVENTORY_PUBLIC_STEAM = str_sub(URL_USER_INVENTORY_PUBLIC_APP, appid=APPID_STEAM) URL_USER_GAMES_OWNED = URL_USER_BASE + '/games/?xml=1' INV_CLASSID_GEM = '667924416' class User(object): def __init__(self, username): self.username = username self._intentory_raw = None def _get_inventory_raw(self): url = str_sub(URL_USER_INVENTORY_PUBLIC_STEAM, username=self.username) response = DataFetcher(url).fetch_json() if not response: raise ResponseError('No response', url) if not response['success']: raise ResponseError(response['Error'], url) self._intentory_raw = response return response def traverse_inventory(self, item_filter=None): """Generates market Item objects for each inventory item. :param str item_filter: See `TAG_ITEM_CLASS_` contants from .market module. """ not self._intentory_raw and self._get_inventory_raw() for item in self._intentory_raw['rgDescriptions'].values(): tags = item['tags'] for tag in tags: internal_name = tag['internal_name'] if item_filter is None or internal_name == item_filter: item_type = Item if internal_name == TAG_ITEM_CLASS_CARD: item_type = Card appid = item['market_fee_app'] title = item['name'] yield item_type(appid, title) @property def gems_total(self): not self._intentory_raw and self._get_inventory_raw() items = self._intentory_raw['rgInventory'] return sum([int(item['amount']) for item in items.values() if item['classid'] == INV_CLASSID_GEM]) def get_games_owned(self): url = str_sub(URL_USER_GAMES_OWNED, username=self.username) xml = DataFetcher(url).fetch_xml() games = {} for el in xml: if el.tag == 'games': for game in el: props = {} for prop in game: if prop.tag == 'appID': props['appid'] = prop.text elif prop.tag == 'name': props['title'] = prop.text games[props['appid']] = props return games
[ 1, 529, 9507, 29958, 1655, 1160, 557, 29914, 2676, 2754, 29914, 13237, 29914, 1792, 29889, 2272, 13, 3166, 6317, 11027, 1053, 3988, 29918, 3217, 7428, 3904, 11937, 29918, 25416, 29892, 12279, 29925, 1367, 29918, 1254, 29923, 5194, 13, 3166, 6317, 13239, 1053, 851, 29918, 1491, 29892, 3630, 20927, 261, 13, 3166, 6317, 11739, 29879, 1053, 13291, 2392, 13, 3166, 869, 28549, 1053, 10976, 29892, 9160, 29892, 323, 10051, 29918, 9094, 29924, 29918, 13875, 1799, 29918, 29907, 17011, 13, 13, 13, 4219, 29918, 11889, 29918, 25416, 353, 3988, 29918, 3217, 7428, 3904, 11937, 29918, 25416, 718, 8207, 333, 13346, 6786, 29915, 13, 4219, 29918, 11889, 29918, 1177, 29963, 3919, 18929, 29918, 7056, 13367, 2965, 29918, 25416, 353, 3988, 29918, 11889, 29918, 25416, 718, 8207, 262, 23886, 29914, 3126, 22208, 13, 4219, 29918, 11889, 29918, 1177, 29963, 3919, 18929, 29918, 7056, 13367, 2965, 29918, 20576, 353, 3988, 29918, 11889, 29918, 1177, 29963, 3919, 18929, 29918, 7056, 13367, 2965, 29918, 25416, 718, 14180, 932, 333, 29914, 29953, 29915, 13, 4219, 29918, 11889, 29918, 1177, 29963, 3919, 18929, 29918, 7056, 13367, 2965, 29918, 1254, 29923, 5194, 353, 851, 29918, 1491, 29898, 4219, 29918, 11889, 29918, 1177, 29963, 3919, 18929, 29918, 7056, 13367, 2965, 29918, 20576, 29892, 623, 333, 29922, 20576, 1367, 29918, 1254, 29923, 5194, 29897, 13, 4219, 29918, 11889, 29918, 12739, 2303, 29903, 29918, 9806, 29940, 3352, 353, 3988, 29918, 11889, 29918, 25416, 718, 8207, 29887, 1280, 13401, 3134, 29922, 29896, 29915, 13, 13, 1177, 29963, 29918, 13875, 1799, 1367, 29918, 1692, 29924, 353, 525, 29953, 29953, 29955, 29929, 29906, 29946, 29946, 29896, 29953, 29915, 13, 13, 13, 1990, 4911, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8952, 1125, 13, 4706, 1583, 29889, 6786, 353, 8952, 13, 4706, 1583, 3032, 14029, 706, 29918, 1610, 353, 6213, 13, 13, 1678, 822, 903, 657, 29918, 262, 23886, 29918, 1610, 29898, 1311, 1125, 13, 4706, 3142, 353, 851, 29918, 1491, 29898, 4219, 29918, 11889, 29918, 1177, 29963, 3919, 18929, 29918, 7056, 13367, 2965, 29918, 1254, 29923, 5194, 29892, 8952, 29922, 1311, 29889, 6786, 29897, 13, 13, 4706, 2933, 353, 3630, 20927, 261, 29898, 2271, 467, 9155, 29918, 3126, 580, 13, 4706, 565, 451, 2933, 29901, 13, 9651, 12020, 13291, 2392, 877, 3782, 2933, 742, 3142, 29897, 13, 13, 4706, 565, 451, 2933, 1839, 8698, 2033, 29901, 13, 9651, 12020, 13291, 2392, 29898, 5327, 1839, 2392, 7464, 3142, 29897, 13, 13, 4706, 1583, 3032, 14029, 706, 29918, 1610, 353, 2933, 13, 13, 4706, 736, 2933, 13, 13, 1678, 822, 29370, 29918, 262, 23886, 29898, 1311, 29892, 2944, 29918, 4572, 29922, 8516, 1125, 13, 4706, 9995, 5631, 1078, 9999, 10976, 3618, 363, 1269, 11817, 706, 2944, 29889, 13, 13, 4706, 584, 3207, 851, 2944, 29918, 4572, 29901, 2823, 421, 16881, 29918, 9094, 29924, 29918, 13875, 1799, 29918, 29952, 640, 1934, 515, 869, 28549, 3883, 29889, 13, 13, 4706, 9995, 13, 4706, 451, 1583, 3032, 14029, 706, 29918, 1610, 322, 1583, 3032, 657, 29918, 262, 23886, 29918, 1610, 580, 13, 13, 4706, 363, 2944, 297, 1583, 3032, 14029, 706, 29918, 1610, 1839, 11007, 4002, 699, 1980, 13359, 5975, 7295, 13, 9651, 8282, 353, 2944, 1839, 11338, 2033, 13, 9651, 363, 4055, 297, 8282, 29901, 13, 18884, 7463, 29918, 978, 353, 4055, 1839, 7564, 29918, 978, 2033, 13, 18884, 565, 2944, 29918, 4572, 338, 6213, 470, 7463, 29918, 978, 1275, 2944, 29918, 4572, 29901, 13, 13, 462, 1678, 2944, 29918, 1853, 353, 10976, 13, 462, 1678, 565, 7463, 29918, 978, 1275, 323, 10051, 29918, 9094, 29924, 29918, 13875, 1799, 29918, 29907, 17011, 29901, 13, 462, 4706, 2944, 29918, 1853, 353, 9160, 13, 13, 462, 1678, 623, 333, 353, 2944, 1839, 28549, 29918, 1725, 29872, 29918, 932, 2033, 13, 462, 1678, 3611, 353, 2944, 1839, 978, 2033, 13, 13, 462, 1678, 7709, 2944, 29918, 1853, 29898, 932, 333, 29892, 3611, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 330, 1567, 29918, 7827, 29898, 1311, 1125, 13, 4706, 451, 1583, 3032, 14029, 706, 29918, 1610, 322, 1583, 3032, 657, 29918, 262, 23886, 29918, 1610, 580, 13, 13, 4706, 4452, 353, 1583, 3032, 14029, 706, 29918, 1610, 1839, 11007, 797, 23886, 2033, 13, 4706, 736, 2533, 4197, 524, 29898, 667, 1839, 14506, 11287, 363, 2944, 297, 4452, 29889, 5975, 580, 565, 2944, 1839, 1990, 333, 2033, 1275, 2672, 29963, 29918, 13875, 1799, 1367, 29918, 1692, 29924, 2314, 13, 13, 1678, 822, 679, 29918, 29887, 1280, 29918, 26689, 29898, 1311, 1125, 13, 4706, 3142, 353, 851, 29918, 1491, 29898, 4219, 29918, 11889, 29918, 12739, 2303, 29903, 29918, 9806, 29940, 3352, 29892, 8952, 29922, 1311, 29889, 6786, 29897, 13, 4706, 4903, 353, 3630, 20927, 261, 29898, 2271, 467, 9155, 29918, 3134, 580, 13, 13, 4706, 8090, 353, 6571, 13, 4706, 363, 560, 297, 4903, 29901, 13, 9651, 565, 560, 29889, 4039, 1275, 525, 29887, 1280, 2396, 13, 18884, 363, 3748, 297, 560, 29901, 13, 462, 1678, 17761, 353, 6571, 13, 13, 462, 1678, 363, 3107, 297, 3748, 29901, 13, 462, 4706, 565, 3107, 29889, 4039, 1275, 525, 932, 1367, 2396, 13, 462, 9651, 17761, 1839, 932, 333, 2033, 353, 3107, 29889, 726, 13, 13, 462, 4706, 25342, 3107, 29889, 4039, 1275, 525, 978, 2396, 13, 462, 9651, 17761, 1839, 3257, 2033, 353, 3107, 29889, 726, 13, 13, 462, 1678, 8090, 29961, 11030, 1839, 932, 333, 2033, 29962, 353, 17761, 13, 13, 4706, 736, 8090, 13, 2 ]
plotting/single_trials.py
PFMassiani/vibly
5
28241
import numpy as np import matplotlib.pyplot as plt # colors corresponding to initial flight, stance, second flight colors = ['k', 'b', 'g'] ### The attributes of sol are: ## sol.t : series of time-points at which the solution was calculated ## sol.y : simulation results, size 6 x times ## sol.t_events : list of the times of 7 events: # - fall during flight # - touchdown # - fall during stance # - lift-off # - reversal during stance # - apex during flight # - fall during flight ### If the event did not occur than the array is empty. def com_visualisation(sol, leg_visibility=0.5, colors=colors, size=100, Ground=False): ''' This function plots failure events in red. ''' times = sol.t result = sol.y t_events = sol.t_events x_com = result[0] y_com = result[1] # plt.figure() ### Initial position plt.scatter(x_com[0], y_com[0], color = colors[0], s = size) foot_x = result[4,0] foot_y = result[5,0] plt.plot([foot_x,x_com[0]],[foot_y,y_com[0]], color = colors[0], alpha = leg_visibility) ### First flight phase if len(t_events[1]) == 0: # no touch-down ## Time of failure if len(t_events[0]) == 0: # no fall during initial flight print('No touch-down but no fall during flight') else: failure = t_events[0][0] fail_index = np.argmax(times > failure) plt.plot(x_com[:fail_index],y_com[:fail_index], color = colors[0]) plt.scatter(x_com[fail_index -1],y_com[fail_index-1], color = 'r', s = size) else: touchdown = t_events[1][0] index = np.argmax(times > touchdown) foot_x = result[4,index] plt.plot(x_com[:index],y_com[:index], color = colors[0]) plt.scatter(x_com[index-1],y_com[index-1], color = colors[1], s = size) plt.plot([foot_x,x_com[index-1]],[0,y_com[index-1]], color = colors[1], alpha = leg_visibility) ### Stance phase if len(t_events[3]) == 0: # no lift-off ## Time of failure failure = False if len(t_events[2]) == 0: # no fall during initial flight if len(t_events[4]) == 0: # no reversal during initial flight print('No lift-off but no failure during stance') else: failure = t_events[4][0] # time of reversal else: failure = t_events[2][0] # time of fall if failure: fail_index = np.argmax(times > failure) plt.plot(x_com[index:fail_index],y_com[index:fail_index], color = colors[1]) plt.scatter(x_com[fail_index -1],y_com[fail_index-1], color = 'r', s = size) else: liftoff = t_events[3][0] lift_index = np.argmax(times > liftoff) plt.plot(x_com[index-1:lift_index],y_com[index-1:lift_index], color = colors[1]) plt.scatter(x_com[lift_index-1],y_com[lift_index-1], color = colors[2], s = size) plt.plot([foot_x,x_com[lift_index-1]],[0,y_com[lift_index-1]], color = colors[2], alpha = leg_visibility) ### Flight phase if len(t_events[5]) == 0: # no apex ## Time of failure if len(t_events[6]) == 0: # no fall print('No apex but no fall during flight') else: failure = t_events[6][0] fail_index = np.argmax(times > failure) plt.plot(x_com[lift_index-1:fail_index],y_com[lift_index-1:fail_index], color = colors[2]) plt.scatter(x_com[fail_index -1],y_com[fail_index-1], color = 'r', s = size) else: apex = t_events[5][0] if times[-1] > apex: apex_index = np.argmax(times > apex) else: apex_index = len(times) plt.plot(x_com[lift_index-1:apex_index], y_com[lift_index-1:apex_index], color = colors[2]) plt.scatter(x_com[apex_index-1],y_com[apex_index-1], color = colors[0], s = size) plt.plot([result[4,apex_index-1],x_com[apex_index-1]], [result[5,apex_index-1],y_com[apex_index-1]], color = colors[0], alpha = leg_visibility) if Ground: ground = result[-1] plt.plot(x_com, ground, color = 'k') else: plt.axhline(y=0, color = 'k') plt.xlabel('Horizontal position') plt.ylabel('Vertical position') def full_visualisation(sol, colors = colors, foot = False): ''' This function only plots if there was no failure in the trial ''' times = sol.t result = sol.y t_events = sol.t_events labels = ['touchdown','liftoff','apex'] # If the trial was not a failure: if len(t_events[1]) > 0 and len(t_events[3]) > 0 and len(t_events[5]) > 0: events = [t_events[1][0],t_events[3][0],t_events[5][0]] indices = [0] for e in range(3): indices.append(np.argmax(times >= events[e])) if foot: ## Foot trajectory foot_x = result[4] foot_y = result[5] plt.figure() for e in range(3): plt.subplot(221) plt.plot(times[indices[e]:indices[e+1]], foot_x[indices[e]:indices[e+1]], color = colors[e]) plt.subplot(223) plt.plot(times[indices[e]:indices[e+1]], foot_y[indices[e]:indices[e+1]], color = colors[e]) plt.subplot(122) plt.plot(foot_x[indices[e]:indices[e+1]], foot_y[indices[e]:indices[e+1]], color = colors[e]) plt.scatter(foot_x[indices[e]], foot_y[indices[e]], color = colors[e]) ## Indicate the events for i in [3,1]: plt.subplot(2,2,i) plt.axvline(x = events[e], color = colors[e], label = labels[e]) ## Legends and labels plt.subplot(221) plt.xticks([]) plt.ylabel('Horizontal position') plt.subplot(223) plt.ylabel('Vertical position') plt.xlabel('Time') plt.subplot(122) plt.xlabel('Horizontal position') plt.ylabel('Vertical position') plt.title('Foot trajectory') ## CoM position plt.figure() for e in range(3): for i in range(2): for j in range(2): plt.subplot(2,3,1+i+3*j) plt.plot(times[indices[e]:indices[e+1]+1], result[i+2*j,indices[e]:indices[e+1]+1], color = colors[e]) plt.subplot(133) plt.plot(result[0,indices[e]:indices[e+1]+1], result[1,indices[e]:indices[e+1]+1], color = colors[e]) ## Indicate the events for i in range(2): for j in range(2): plt.subplot(2,3,1+i+3*j) plt.axvline(x = events[e], color = colors[e], label = labels[e]) plt.subplot(133) index = np.argmax(times >= events[e]) plt.scatter(result[0,index], result[1,index], color = colors[e]) ## Legends and labels plt.subplot(231) plt.legend(loc = 2) plt.xticks([]) plt.ylabel('Horizontal position') plt.subplot(232) plt.xticks([]) plt.ylabel('Vertical position') plt.subplot(234) plt.xlabel('Time') plt.ylabel('Horizontal speed') plt.subplot(235) plt.xlabel('Time') plt.ylabel('Vertical speed') plt.subplot(133) plt.xlabel('Horizontal position') plt.ylabel('Vertical position') plt.title('CoM trajectory') else: print('The trial was a failure')
[ 1, 1053, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 29937, 11955, 6590, 304, 2847, 16286, 29892, 380, 749, 29892, 1473, 16286, 13, 27703, 353, 6024, 29895, 742, 525, 29890, 742, 525, 29887, 2033, 13, 13, 2277, 29937, 450, 8393, 310, 899, 526, 29901, 13, 2277, 899, 29889, 29873, 29871, 12, 12, 29901, 3652, 310, 931, 29899, 9748, 472, 607, 278, 1650, 471, 12833, 13, 2277, 899, 29889, 29891, 29871, 12, 12, 29901, 17402, 2582, 29892, 2159, 29871, 29953, 921, 3064, 13, 2277, 899, 29889, 29873, 29918, 13604, 12, 29901, 1051, 310, 278, 3064, 310, 29871, 29955, 4959, 29901, 13, 29937, 448, 6416, 2645, 16286, 13, 29937, 448, 6023, 3204, 13, 29937, 448, 6416, 2645, 380, 749, 13, 29937, 448, 13777, 29899, 2696, 13, 29937, 448, 18764, 284, 2645, 380, 749, 13, 29937, 448, 263, 412, 29916, 2645, 16286, 13, 29937, 448, 6416, 2645, 16286, 13, 2277, 29937, 960, 278, 1741, 1258, 451, 6403, 1135, 278, 1409, 338, 4069, 29889, 13, 13, 1753, 419, 29918, 20119, 4371, 29898, 2929, 29892, 2814, 29918, 28814, 29922, 29900, 29889, 29945, 29892, 11955, 29922, 27703, 29892, 2159, 29922, 29896, 29900, 29900, 29892, 1632, 618, 29922, 8824, 1125, 13, 12, 12008, 13, 12, 910, 740, 24580, 10672, 4959, 297, 2654, 29889, 13, 12, 14550, 13, 13, 12, 3706, 1678, 353, 899, 29889, 29873, 13, 12, 2914, 259, 353, 899, 29889, 29891, 13, 12, 29873, 29918, 13604, 353, 899, 29889, 29873, 29918, 13604, 13, 12, 29916, 29918, 510, 1678, 353, 1121, 29961, 29900, 29962, 13, 12, 29891, 29918, 510, 1678, 353, 1121, 29961, 29896, 29962, 13, 13, 12, 29937, 14770, 29889, 4532, 580, 13, 13, 12, 2277, 29937, 17250, 2602, 13, 12, 572, 29873, 29889, 1557, 2620, 29898, 29916, 29918, 510, 29961, 29900, 1402, 343, 29918, 510, 29961, 29900, 1402, 2927, 353, 11955, 29961, 29900, 1402, 269, 353, 2159, 29897, 13, 12, 6661, 29918, 29916, 353, 1121, 29961, 29946, 29892, 29900, 29962, 13, 12, 6661, 29918, 29891, 353, 1121, 29961, 29945, 29892, 29900, 29962, 13, 12, 572, 29873, 29889, 5317, 4197, 6661, 29918, 29916, 29892, 29916, 29918, 510, 29961, 29900, 29962, 16272, 6661, 29918, 29891, 29892, 29891, 29918, 510, 29961, 29900, 20526, 2927, 353, 11955, 29961, 29900, 1402, 29871, 13, 12, 12, 12, 2312, 353, 2814, 29918, 28814, 29897, 13, 13, 12, 2277, 29937, 3824, 16286, 8576, 13, 12, 361, 7431, 29898, 29873, 29918, 13604, 29961, 29896, 2314, 1275, 29871, 29900, 29901, 396, 694, 6023, 29899, 3204, 13, 12, 12, 2277, 5974, 310, 10672, 13, 12, 12, 361, 7431, 29898, 29873, 29918, 13604, 29961, 29900, 2314, 1275, 29871, 29900, 29901, 396, 694, 6416, 2645, 2847, 16286, 13, 12, 12, 12, 2158, 877, 3782, 6023, 29899, 3204, 541, 694, 6416, 2645, 16286, 1495, 13, 12, 12, 2870, 29901, 13, 12, 12, 12, 14057, 545, 353, 260, 29918, 13604, 29961, 29900, 3816, 29900, 29962, 13, 12, 12, 12, 14057, 29918, 2248, 353, 7442, 29889, 1191, 3317, 29898, 3706, 1405, 10672, 29897, 13, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 29916, 29918, 510, 7503, 14057, 29918, 2248, 1402, 29891, 29918, 510, 7503, 14057, 29918, 2248, 1402, 2927, 353, 11955, 29961, 29900, 2314, 13, 12, 12, 12, 572, 29873, 29889, 1557, 2620, 29898, 29916, 29918, 510, 29961, 14057, 29918, 2248, 448, 29896, 1402, 29891, 29918, 510, 29961, 14057, 29918, 2248, 29899, 29896, 1402, 13, 12, 12, 12, 12, 12, 2780, 353, 525, 29878, 742, 269, 353, 2159, 29897, 13, 12, 2870, 29901, 13, 12, 12, 16747, 3204, 353, 260, 29918, 13604, 29961, 29896, 3816, 29900, 29962, 13, 12, 12, 2248, 268, 353, 7442, 29889, 1191, 3317, 29898, 3706, 1405, 6023, 3204, 29897, 13, 12, 12, 6661, 29918, 29916, 1678, 353, 1121, 29961, 29946, 29892, 2248, 29962, 13, 12, 12, 572, 29873, 29889, 5317, 29898, 29916, 29918, 510, 7503, 2248, 1402, 29891, 29918, 510, 7503, 2248, 1402, 2927, 353, 11955, 29961, 29900, 2314, 13, 12, 12, 572, 29873, 29889, 1557, 2620, 29898, 29916, 29918, 510, 29961, 2248, 29899, 29896, 1402, 29891, 29918, 510, 29961, 2248, 29899, 29896, 1402, 2927, 353, 11955, 29961, 29896, 1402, 269, 353, 2159, 29897, 13, 12, 12, 572, 29873, 29889, 5317, 4197, 6661, 29918, 29916, 29892, 29916, 29918, 510, 29961, 2248, 29899, 29896, 29962, 16272, 29900, 29892, 29891, 29918, 510, 29961, 2248, 29899, 29896, 20526, 2927, 353, 11955, 29961, 29896, 1402, 13, 12, 12, 12, 12, 2312, 353, 2814, 29918, 28814, 29897, 13, 13, 12, 12, 2277, 29937, 624, 749, 8576, 13, 12, 12, 361, 7431, 29898, 29873, 29918, 13604, 29961, 29941, 2314, 1275, 29871, 29900, 29901, 396, 694, 13777, 29899, 2696, 13, 12, 12, 12, 2277, 5974, 310, 10672, 13, 12, 12, 12, 14057, 545, 353, 7700, 13, 12, 12, 12, 361, 7431, 29898, 29873, 29918, 13604, 29961, 29906, 2314, 1275, 29871, 29900, 29901, 396, 694, 6416, 2645, 2847, 16286, 13, 12, 12, 12, 12, 361, 7431, 29898, 29873, 29918, 13604, 29961, 29946, 2314, 1275, 29871, 29900, 29901, 396, 694, 18764, 284, 2645, 2847, 16286, 13, 12, 12, 12, 12, 12, 2158, 877, 3782, 13777, 29899, 2696, 541, 694, 10672, 2645, 380, 749, 1495, 13, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 14057, 545, 353, 260, 29918, 13604, 29961, 29946, 3816, 29900, 29962, 396, 931, 310, 18764, 284, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 14057, 545, 353, 260, 29918, 13604, 29961, 29906, 3816, 29900, 29962, 396, 931, 310, 6416, 13, 12, 12, 12, 361, 10672, 29901, 13, 12, 12, 12, 12, 14057, 29918, 2248, 353, 7442, 29889, 1191, 3317, 29898, 3706, 1405, 10672, 29897, 13, 12, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 29916, 29918, 510, 29961, 2248, 29901, 14057, 29918, 2248, 1402, 29891, 29918, 510, 29961, 2248, 29901, 14057, 29918, 2248, 1402, 13, 12, 12, 12, 12, 12, 12, 2780, 353, 11955, 29961, 29896, 2314, 13, 12, 12, 12, 12, 572, 29873, 29889, 1557, 2620, 29898, 29916, 29918, 510, 29961, 14057, 29918, 2248, 448, 29896, 1402, 29891, 29918, 510, 29961, 14057, 29918, 2248, 29899, 29896, 1402, 13, 12, 12, 12, 12, 12, 12, 2780, 353, 525, 29878, 742, 269, 353, 2159, 29897, 13, 12, 12, 2870, 29901, 13, 12, 12, 12, 29880, 361, 517, 600, 353, 260, 29918, 13604, 29961, 29941, 3816, 29900, 29962, 13, 12, 12, 12, 29880, 2027, 29918, 2248, 353, 7442, 29889, 1191, 3317, 29898, 3706, 1405, 11747, 517, 600, 29897, 13, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 29916, 29918, 510, 29961, 2248, 29899, 29896, 29901, 29880, 2027, 29918, 2248, 1402, 29891, 29918, 510, 29961, 2248, 29899, 29896, 29901, 29880, 2027, 29918, 2248, 1402, 13, 12, 12, 12, 12, 12, 2780, 353, 11955, 29961, 29896, 2314, 13, 12, 12, 12, 572, 29873, 29889, 1557, 2620, 29898, 29916, 29918, 510, 29961, 29880, 2027, 29918, 2248, 29899, 29896, 1402, 29891, 29918, 510, 29961, 29880, 2027, 29918, 2248, 29899, 29896, 1402, 13, 12, 12, 12, 12, 12, 2780, 353, 11955, 29961, 29906, 1402, 269, 353, 2159, 29897, 13, 12, 12, 12, 572, 29873, 29889, 5317, 4197, 6661, 29918, 29916, 29892, 29916, 29918, 510, 29961, 29880, 2027, 29918, 2248, 29899, 29896, 29962, 16272, 29900, 29892, 29891, 29918, 510, 29961, 29880, 2027, 29918, 2248, 29899, 29896, 20526, 13, 12, 12, 12, 12, 12, 2780, 353, 11955, 29961, 29906, 1402, 15595, 353, 2814, 29918, 28814, 29897, 13, 13, 12, 12, 12, 2277, 29937, 2379, 523, 8576, 13, 12, 12, 12, 361, 7431, 29898, 29873, 29918, 13604, 29961, 29945, 2314, 1275, 29871, 29900, 29901, 396, 694, 263, 412, 29916, 13, 12, 12, 12, 12, 2277, 5974, 310, 10672, 13, 12, 12, 12, 12, 361, 7431, 29898, 29873, 29918, 13604, 29961, 29953, 2314, 1275, 29871, 29900, 29901, 396, 694, 6416, 13, 12, 12, 12, 12, 12, 2158, 877, 3782, 263, 412, 29916, 541, 694, 6416, 2645, 16286, 1495, 13, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 14057, 545, 353, 260, 29918, 13604, 29961, 29953, 3816, 29900, 29962, 13, 12, 12, 12, 12, 12, 14057, 29918, 2248, 353, 7442, 29889, 1191, 3317, 29898, 3706, 1405, 10672, 29897, 13, 12, 12, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 29916, 29918, 510, 29961, 29880, 2027, 29918, 2248, 29899, 29896, 29901, 14057, 29918, 2248, 1402, 29891, 29918, 510, 29961, 29880, 2027, 29918, 2248, 29899, 29896, 29901, 14057, 29918, 2248, 1402, 2927, 353, 11955, 29961, 29906, 2314, 13, 12, 12, 12, 12, 12, 572, 29873, 29889, 1557, 2620, 29898, 29916, 29918, 510, 29961, 14057, 29918, 2248, 448, 29896, 1402, 29891, 29918, 510, 29961, 14057, 29918, 2248, 29899, 29896, 1402, 2927, 353, 525, 29878, 742, 269, 353, 2159, 29897, 13, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 4085, 29916, 353, 260, 29918, 13604, 29961, 29945, 3816, 29900, 29962, 13, 12, 12, 12, 12, 361, 3064, 14352, 29896, 29962, 1405, 263, 412, 29916, 29901, 13, 12, 12, 12, 12, 12, 4085, 29916, 29918, 2248, 353, 7442, 29889, 1191, 3317, 29898, 3706, 1405, 263, 412, 29916, 29897, 13, 12, 12, 12, 12, 2870, 29901, 13, 12, 12, 12, 12, 12, 4085, 29916, 29918, 2248, 353, 7431, 29898, 3706, 29897, 13, 12, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 29916, 29918, 510, 29961, 29880, 2027, 29918, 2248, 29899, 29896, 29901, 4085, 29916, 29918, 2248, 1402, 13, 12, 12, 12, 12, 12, 12, 29891, 29918, 510, 29961, 29880, 2027, 29918, 2248, 29899, 29896, 29901, 4085, 29916, 29918, 2248, 1402, 2927, 353, 11955, 29961, 29906, 2314, 13, 12, 12, 12, 12, 572, 29873, 29889, 1557, 2620, 29898, 29916, 29918, 510, 29961, 4085, 29916, 29918, 2248, 29899, 29896, 1402, 29891, 29918, 510, 29961, 4085, 29916, 29918, 2248, 29899, 29896, 1402, 13, 12, 12, 12, 12, 12, 12, 2780, 353, 11955, 29961, 29900, 1402, 269, 353, 2159, 29897, 13, 12, 12, 12, 12, 572, 29873, 29889, 5317, 4197, 2914, 29961, 29946, 29892, 4085, 29916, 29918, 2248, 29899, 29896, 1402, 29916, 29918, 510, 29961, 4085, 29916, 29918, 2248, 29899, 29896, 20526, 13, 12, 12, 12, 12, 12, 12, 29961, 2914, 29961, 29945, 29892, 4085, 29916, 29918, 2248, 29899, 29896, 1402, 29891, 29918, 510, 29961, 4085, 29916, 29918, 2248, 29899, 29896, 20526, 13, 12, 12, 12, 12, 12, 12, 2780, 353, 11955, 29961, 29900, 1402, 15595, 353, 2814, 29918, 28814, 29897, 13, 12, 12, 12, 12, 12, 12, 13, 12, 361, 1632, 618, 29901, 13, 12, 12, 2057, 353, 1121, 14352, 29896, 29962, 13, 12, 12, 572, 29873, 29889, 5317, 29898, 29916, 29918, 510, 29892, 5962, 29892, 2927, 353, 525, 29895, 1495, 13, 12, 2870, 29901, 12, 12, 12, 12, 12, 13, 12, 12, 572, 29873, 29889, 1165, 7760, 29898, 29891, 29922, 29900, 29892, 2927, 353, 525, 29895, 1495, 13, 12, 572, 29873, 29889, 29916, 1643, 877, 24932, 2602, 1495, 13, 12, 572, 29873, 29889, 29891, 1643, 877, 29270, 2602, 1495, 13, 13, 13, 1753, 2989, 29918, 20119, 4371, 29898, 2929, 29892, 11955, 353, 11955, 29892, 3661, 353, 7700, 1125, 13, 12, 12008, 13, 12, 910, 740, 871, 24580, 565, 727, 471, 694, 10672, 297, 278, 14260, 13, 12, 14550, 13, 12, 3706, 1678, 353, 899, 29889, 29873, 13, 12, 2914, 259, 353, 899, 29889, 29891, 13, 12, 29873, 29918, 13604, 353, 899, 29889, 29873, 29918, 13604, 13, 12, 21134, 353, 6024, 16747, 3204, 3788, 29880, 361, 517, 600, 3788, 4085, 29916, 2033, 13, 12, 29937, 960, 278, 14260, 471, 451, 263, 10672, 29901, 13, 12, 361, 7431, 29898, 29873, 29918, 13604, 29961, 29896, 2314, 1405, 29871, 29900, 322, 7431, 29898, 29873, 29918, 13604, 29961, 29941, 2314, 1405, 29871, 29900, 322, 7431, 29898, 29873, 29918, 13604, 29961, 29945, 2314, 1405, 29871, 29900, 29901, 13, 13, 12, 12, 13604, 29871, 12, 29922, 518, 29873, 29918, 13604, 29961, 29896, 3816, 29900, 1402, 29873, 29918, 13604, 29961, 29941, 3816, 29900, 1402, 29873, 29918, 13604, 29961, 29945, 3816, 29900, 5262, 13, 12, 12, 513, 1575, 353, 518, 29900, 29962, 13, 12, 12, 1454, 321, 297, 3464, 29898, 29941, 1125, 13, 12, 12, 12, 513, 1575, 29889, 4397, 29898, 9302, 29889, 1191, 3317, 29898, 3706, 6736, 4959, 29961, 29872, 12622, 13, 13, 12, 12, 361, 3661, 29901, 13, 12, 12, 12, 2277, 7527, 23324, 706, 13, 12, 12, 12, 6661, 29918, 29916, 353, 1121, 29961, 29946, 29962, 13, 12, 12, 12, 6661, 29918, 29891, 353, 1121, 29961, 29945, 29962, 13, 12, 12, 12, 572, 29873, 29889, 4532, 580, 13, 12, 12, 12, 1454, 321, 297, 3464, 29898, 29941, 1125, 13, 12, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29906, 29896, 29897, 13, 12, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 3706, 29961, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 20526, 3661, 29918, 29916, 29961, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 20526, 2927, 353, 11955, 29961, 29872, 2314, 13, 12, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29906, 29941, 29897, 13, 12, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 3706, 29961, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 20526, 3661, 29918, 29891, 29961, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 20526, 2927, 353, 11955, 29961, 29872, 2314, 13, 12, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29906, 29906, 29897, 13, 12, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 6661, 29918, 29916, 29961, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 20526, 3661, 29918, 29891, 29961, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 20526, 2927, 353, 11955, 29961, 29872, 2314, 13, 12, 12, 12, 12, 572, 29873, 29889, 1557, 2620, 29898, 6661, 29918, 29916, 29961, 513, 1575, 29961, 29872, 20526, 3661, 29918, 29891, 29961, 513, 1575, 29961, 29872, 20526, 2927, 353, 11955, 29961, 29872, 2314, 13, 12, 12, 12, 12, 2277, 1894, 9593, 278, 4959, 13, 12, 12, 12, 12, 1454, 474, 297, 518, 29941, 29892, 29896, 5387, 13, 12, 12, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29892, 29906, 29892, 29875, 29897, 13, 12, 12, 12, 12, 12, 572, 29873, 29889, 1165, 29894, 1220, 29898, 29916, 353, 4959, 29961, 29872, 1402, 2927, 353, 11955, 29961, 29872, 1402, 3858, 353, 11073, 29961, 29872, 2314, 13, 12, 12, 12, 2277, 5682, 1975, 322, 11073, 13, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29906, 29896, 29897, 13, 12, 12, 12, 572, 29873, 29889, 486, 7358, 4197, 2314, 13, 12, 12, 12, 572, 29873, 29889, 29891, 1643, 877, 24932, 2602, 1495, 13, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29906, 29941, 29897, 13, 12, 12, 12, 572, 29873, 29889, 29891, 1643, 877, 29270, 2602, 1495, 13, 12, 12, 12, 572, 29873, 29889, 29916, 1643, 877, 2481, 1495, 13, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29906, 29906, 29897, 13, 12, 12, 12, 572, 29873, 29889, 29916, 1643, 877, 24932, 2602, 1495, 13, 12, 12, 12, 572, 29873, 29889, 29891, 1643, 877, 29270, 2602, 1495, 13, 12, 12, 12, 572, 29873, 29889, 3257, 877, 13440, 23324, 706, 1495, 13, 13, 12, 12, 2277, 3189, 29924, 2602, 13, 12, 12, 572, 29873, 29889, 4532, 580, 13, 12, 12, 1454, 321, 297, 3464, 29898, 29941, 1125, 13, 12, 12, 12, 1454, 474, 297, 3464, 29898, 29906, 1125, 13, 12, 12, 12, 12, 1454, 432, 297, 3464, 29898, 29906, 1125, 13, 12, 12, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29892, 29941, 29892, 29896, 29974, 29875, 29974, 29941, 29930, 29926, 29897, 13, 12, 12, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 3706, 29961, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 10062, 29896, 1402, 13, 12, 12, 12, 12, 12, 12, 12, 2914, 29961, 29875, 29974, 29906, 29930, 29926, 29892, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 10062, 29896, 1402, 13, 12, 12, 12, 12, 12, 12, 12, 2780, 353, 11955, 29961, 29872, 2314, 13, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29941, 29941, 29897, 13, 12, 12, 12, 572, 29873, 29889, 5317, 29898, 2914, 29961, 29900, 29892, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 10062, 29896, 1402, 13, 12, 12, 12, 12, 12, 2914, 29961, 29896, 29892, 513, 1575, 29961, 29872, 5387, 513, 1575, 29961, 29872, 29974, 29896, 10062, 29896, 1402, 2927, 353, 11955, 29961, 29872, 2314, 13, 12, 12, 12, 2277, 1894, 9593, 278, 4959, 13, 12, 12, 12, 1454, 474, 297, 3464, 29898, 29906, 1125, 13, 12, 12, 12, 12, 1454, 432, 297, 3464, 29898, 29906, 1125, 13, 12, 12, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29892, 29941, 29892, 29896, 29974, 29875, 29974, 29941, 29930, 29926, 29897, 13, 12, 12, 12, 12, 12, 572, 29873, 29889, 1165, 29894, 1220, 29898, 29916, 353, 4959, 29961, 29872, 1402, 2927, 353, 11955, 29961, 29872, 1402, 13, 12, 12, 12, 12, 12, 12, 12, 1643, 353, 11073, 29961, 29872, 2314, 13, 12, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29941, 29941, 29897, 13, 12, 12, 12, 2248, 353, 7442, 29889, 1191, 3317, 29898, 3706, 6736, 4959, 29961, 29872, 2314, 13, 12, 12, 12, 572, 29873, 29889, 1557, 2620, 29898, 2914, 29961, 29900, 29892, 2248, 1402, 1121, 29961, 29896, 29892, 2248, 1402, 2927, 353, 11955, 29961, 29872, 2314, 13, 12, 12, 2277, 5682, 1975, 322, 11073, 13, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29941, 29896, 29897, 13, 12, 12, 572, 29873, 29889, 26172, 29898, 2029, 353, 29871, 29906, 29897, 13, 12, 12, 572, 29873, 29889, 486, 7358, 4197, 2314, 13, 12, 12, 572, 29873, 29889, 29891, 1643, 877, 24932, 2602, 1495, 13, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29941, 29906, 29897, 13, 12, 12, 572, 29873, 29889, 486, 7358, 4197, 2314, 13, 12, 12, 572, 29873, 29889, 29891, 1643, 877, 29270, 2602, 1495, 13, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29941, 29946, 29897, 13, 12, 12, 572, 29873, 29889, 29916, 1643, 877, 2481, 1495, 13, 12, 12, 572, 29873, 29889, 29891, 1643, 877, 24932, 6210, 1495, 13, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29906, 29941, 29945, 29897, 13, 12, 12, 572, 29873, 29889, 29916, 1643, 877, 2481, 1495, 13, 12, 12, 572, 29873, 29889, 29891, 1643, 877, 29270, 6210, 1495, 13, 12, 12, 572, 29873, 29889, 1491, 5317, 29898, 29896, 29941, 29941, 29897, 13, 12, 12, 572, 29873, 29889, 29916, 1643, 877, 24932, 2602, 1495, 13, 12, 12, 572, 29873, 29889, 29891, 1643, 877, 29270, 2602, 1495, 13, 12, 12, 572, 29873, 29889, 3257, 877, 7967, 29924, 23324, 706, 1495, 13, 12, 2870, 29901, 13, 12, 12, 2158, 877, 1576, 14260, 471, 263, 10672, 1495, 2 ]
detectron2/distiller_zoo/CC.py
lijingyao20010602/Dilation-FasterRCNN
1
75286
<reponame>lijingyao20010602/Dilation-FasterRCNN<gh_stars>1-10 from __future__ import print_function import torch import torch.nn as nn class Correlation(nn.Module): """Correlation Congruence for Knowledge Distillation, ICCV 2019. The authors nicely shared the code with me. I restructured their code to be compatible with my running framework. Credits go to the original author""" def __init__(self): super(Correlation, self).__init__() def forward(self, f_s, f_t): # delta:两个特征矩阵的差 delta = torch.abs(f_s - f_t) # delta[:-1]* delta[1:]中的第i行表示第i和第i+1个batch的delta特征向量点乘 # 求和后表示第i和第i+1个batch的相异程度 # 求平均表示两两batch的平均delta相异程度 loss = torch.mean((delta[:-1] * delta[1:]).sum(1)) return loss
[ 1, 529, 276, 1112, 420, 29958, 7267, 292, 3761, 29877, 29906, 29900, 29900, 29896, 29900, 29953, 29900, 29906, 29914, 29928, 8634, 29899, 29943, 1901, 10363, 10262, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 13, 13, 1990, 2994, 23445, 29898, 15755, 29889, 7355, 1125, 13, 1678, 9995, 12521, 23445, 6005, 582, 663, 363, 19320, 5485, 6652, 453, 362, 29892, 306, 4174, 29963, 29871, 29906, 29900, 29896, 29929, 29889, 13, 1678, 450, 15717, 28138, 7258, 278, 775, 411, 592, 29889, 306, 1791, 1247, 2955, 1009, 775, 304, 367, 29871, 13, 1678, 15878, 411, 590, 2734, 6890, 29889, 24596, 1169, 748, 304, 278, 2441, 4148, 15945, 29908, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 12521, 23445, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 285, 29918, 29879, 29892, 285, 29918, 29873, 1125, 13, 4706, 396, 19471, 30383, 31977, 30502, 31141, 232, 193, 132, 234, 162, 172, 236, 155, 184, 30210, 232, 186, 177, 13, 4706, 19471, 353, 4842, 305, 29889, 6897, 29898, 29888, 29918, 29879, 448, 285, 29918, 29873, 29897, 13, 4706, 396, 19471, 7503, 29899, 29896, 14178, 19471, 29961, 29896, 17531, 30275, 30210, 30622, 29875, 30448, 30746, 30858, 30622, 29875, 30503, 30622, 29875, 29974, 29896, 30502, 16175, 30210, 4181, 31141, 232, 193, 132, 31331, 31180, 30940, 231, 188, 155, 13, 4706, 396, 29871, 31376, 30503, 30822, 30746, 30858, 30622, 29875, 30503, 30622, 29875, 29974, 29896, 30502, 16175, 30210, 30990, 232, 191, 133, 31101, 30898, 13, 4706, 396, 29871, 31376, 30606, 232, 160, 138, 30746, 30858, 31977, 31977, 16175, 30210, 30606, 232, 160, 138, 4181, 30990, 232, 191, 133, 31101, 30898, 13, 4706, 6410, 353, 4842, 305, 29889, 12676, 3552, 4181, 7503, 29899, 29896, 29962, 334, 19471, 29961, 29896, 29901, 14664, 2083, 29898, 29896, 876, 13, 4706, 736, 6410, 13, 13, 13, 2 ]
dota2MemComm/dota2comm.py
Keithenneu/dota2comm
13
123457
<filename>dota2MemComm/dota2comm.py import sys from ctypes import cdll, c_char_p, c_void_p, cast class Dota2Comm: def __init__(self, name): self.__dota2comm = cdll.LoadLibrary("dota2comm.dll") self.name = name self.__name = name.encode() self.__receiveMessage = self.__dota2comm.receiveMessage self.__receiveMessage.argtypes = [c_char_p] self.__receiveMessage.restype = c_void_p self.__sendMessage = self.__dota2comm.sendMessage self.__sendMessage.argtypes = [c_char_p, c_char_p] self.__freeString = self.__dota2comm.freeString self.__freeString.argtypes = [c_void_p] err = self.__dota2comm.init(self.__name) if err != 0: raise Exception("init failed! error code %d" % err) nrofclients = self.__dota2comm.getNrConnectedClients(self.__name) if nrofclients < 1: raise Exception("No clients found. Did the game start?") def receiveMessage(self): msg = self.__receiveMessage(self.__name) if msg is None: return None else: ptr = msg msg = cast(msg, c_char_p).value self.__freeString(ptr) return msg.decode()[:-len(self.name)]#removing r_marker def sendMessage(self, message): return self.__sendMessage(self.__name, message.encode()) def exit(self): pass
[ 1, 529, 9507, 29958, 29881, 4616, 29906, 11442, 5261, 29914, 29881, 4616, 29906, 2055, 29889, 2272, 13, 5215, 10876, 13, 3166, 274, 8768, 1053, 274, 12396, 29892, 274, 29918, 3090, 29918, 29886, 29892, 274, 29918, 5405, 29918, 29886, 29892, 4320, 13, 13, 13, 1990, 360, 4616, 29906, 5261, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1024, 1125, 13, 4706, 1583, 17255, 29881, 4616, 29906, 2055, 353, 274, 12396, 29889, 5896, 12284, 703, 29881, 4616, 29906, 2055, 29889, 12396, 1159, 13, 4706, 1583, 29889, 978, 353, 1024, 13, 4706, 1583, 17255, 978, 353, 1024, 29889, 12508, 580, 13, 308, 13, 4706, 1583, 17255, 13556, 573, 3728, 353, 1583, 17255, 29881, 4616, 29906, 2055, 29889, 13556, 573, 3728, 13, 4706, 1583, 17255, 13556, 573, 3728, 29889, 1191, 8768, 353, 518, 29883, 29918, 3090, 29918, 29886, 29962, 13, 4706, 1583, 17255, 13556, 573, 3728, 29889, 5060, 668, 353, 274, 29918, 5405, 29918, 29886, 13, 13, 4706, 1583, 17255, 6717, 3728, 353, 1583, 17255, 29881, 4616, 29906, 2055, 29889, 6717, 3728, 13, 4706, 1583, 17255, 6717, 3728, 29889, 1191, 8768, 353, 518, 29883, 29918, 3090, 29918, 29886, 29892, 274, 29918, 3090, 29918, 29886, 29962, 13, 13, 4706, 1583, 17255, 9021, 1231, 353, 1583, 17255, 29881, 4616, 29906, 2055, 29889, 9021, 1231, 13, 4706, 1583, 17255, 9021, 1231, 29889, 1191, 8768, 353, 518, 29883, 29918, 5405, 29918, 29886, 29962, 13, 13, 4706, 4589, 353, 1583, 17255, 29881, 4616, 29906, 2055, 29889, 2344, 29898, 1311, 17255, 978, 29897, 13, 4706, 565, 4589, 2804, 29871, 29900, 29901, 13, 9651, 12020, 8960, 703, 2344, 5229, 29991, 1059, 775, 1273, 29881, 29908, 1273, 4589, 29897, 13, 632, 13, 4706, 302, 307, 29888, 11303, 1237, 353, 1583, 17255, 29881, 4616, 29906, 2055, 29889, 657, 29940, 29878, 20971, 2954, 29907, 492, 1237, 29898, 1311, 17255, 978, 29897, 13, 308, 13, 4706, 565, 302, 307, 29888, 11303, 1237, 529, 29871, 29896, 29901, 13, 9651, 12020, 8960, 703, 3782, 13154, 1476, 29889, 7440, 278, 3748, 1369, 29973, 1159, 13, 13, 1678, 822, 7150, 3728, 29898, 1311, 1125, 13, 4706, 10191, 353, 1583, 17255, 13556, 573, 3728, 29898, 1311, 17255, 978, 29897, 13, 308, 13, 4706, 565, 10191, 338, 6213, 29901, 13, 9651, 736, 6213, 13, 4706, 1683, 29901, 13, 9651, 23246, 353, 10191, 13, 9651, 10191, 353, 4320, 29898, 7645, 29892, 274, 29918, 3090, 29918, 29886, 467, 1767, 13, 9651, 1583, 17255, 9021, 1231, 29898, 7414, 29897, 13, 9651, 736, 10191, 29889, 13808, 580, 7503, 29899, 2435, 29898, 1311, 29889, 978, 4638, 29937, 1745, 21081, 364, 29918, 22976, 13, 13, 1678, 822, 3638, 3728, 29898, 1311, 29892, 2643, 1125, 13, 4706, 736, 1583, 17255, 6717, 3728, 29898, 1311, 17255, 978, 29892, 2643, 29889, 12508, 3101, 13, 308, 13, 1678, 822, 6876, 29898, 1311, 1125, 13, 4706, 1209, 2 ]
nvc-api/app/controllers/api/vm.py
BiznetGIO/nvc-lite
0
1604264
<reponame>BiznetGIO/nvc-lite<filename>nvc-api/app/controllers/api/vm.py from app.helpers.rest import * from neo.libs import vm from neo.libs import orchestration as orch from app.middlewares import auth from app.helpers.session import * from app.libs import neo, utils from flask_restful import Resource, request class GetListVm(Resource): @auth.login_required def get(self): nvc_images_data = list() redis_data = utils.get_redis(request.headers['Access-Token']) nvc_images = utils.parse_nvc_images(redis_data['region']) nvc_images = nvc_images[redis_data['region']] try: nvc_images_data = neo.get_nvc(request.headers['Access-Token'], nvc_images) except Exception as e: return response(401, message=str(e)) else: return response(200, data=nvc_images_data)
[ 1, 529, 276, 1112, 420, 29958, 29933, 466, 1212, 29954, 5971, 29914, 29876, 7071, 29899, 29880, 568, 29966, 9507, 29958, 29876, 7071, 29899, 2754, 29914, 932, 29914, 1285, 11897, 29914, 2754, 29914, 6925, 29889, 2272, 13, 3166, 623, 29889, 3952, 6774, 29889, 5060, 1053, 334, 13, 3166, 452, 29877, 29889, 10254, 1053, 22419, 13, 3166, 452, 29877, 29889, 10254, 1053, 22624, 16444, 362, 408, 22624, 13, 3166, 623, 29889, 17662, 4495, 267, 1053, 4817, 13, 3166, 623, 29889, 3952, 6774, 29889, 7924, 1053, 334, 13, 3166, 623, 29889, 10254, 1053, 452, 29877, 29892, 3667, 29879, 13, 3166, 29784, 29918, 5060, 1319, 1053, 18981, 29892, 2009, 13, 13, 13, 1990, 3617, 1293, 29963, 29885, 29898, 6848, 1125, 13, 1678, 732, 5150, 29889, 7507, 29918, 12403, 13, 1678, 822, 679, 29898, 1311, 1125, 13, 4706, 302, 7071, 29918, 8346, 29918, 1272, 353, 1051, 580, 13, 4706, 29825, 29918, 1272, 353, 3667, 29879, 29889, 657, 29918, 1127, 275, 29898, 3827, 29889, 13662, 1839, 6638, 29899, 6066, 11287, 13, 4706, 302, 7071, 29918, 8346, 353, 3667, 29879, 29889, 5510, 29918, 29876, 7071, 29918, 8346, 29898, 1127, 275, 29918, 1272, 1839, 12803, 11287, 13, 4706, 302, 7071, 29918, 8346, 353, 302, 7071, 29918, 8346, 29961, 1127, 275, 29918, 1272, 1839, 12803, 2033, 29962, 13, 4706, 1018, 29901, 13, 9651, 302, 7071, 29918, 8346, 29918, 1272, 353, 452, 29877, 29889, 657, 29918, 29876, 7071, 29898, 3827, 29889, 13662, 1839, 6638, 29899, 6066, 7464, 13, 462, 462, 9651, 302, 7071, 29918, 8346, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 736, 2933, 29898, 29946, 29900, 29896, 29892, 2643, 29922, 710, 29898, 29872, 876, 13, 4706, 1683, 29901, 13, 9651, 736, 2933, 29898, 29906, 29900, 29900, 29892, 848, 29922, 29876, 7071, 29918, 8346, 29918, 1272, 29897, 13, 308, 2 ]
software/python/addons/remote_console/server_demo.py
ltstein/SCUTTLE
0
46424
# This file is just a basic example of the server comunication structure to a client program. # The server is run on the embedded computer and passes data to a client on your local pc # over a direct wifi connection. This can be used to display telemetry. import time import json import socket def current_time(start_time): current_time = time.time() - start_time day = current_time // (24 * 3600) current_time = current_time % (24 * 3600) hour = current_time // 3600 current_time %= 3600 minutes = current_time // 60 current_time %= 60 seconds = round(current_time,3) return hour, minutes, seconds def log(*args): t = current_time(start_time) print("%02d:%02d:%02.3f -" % (t[0],t[1],t[2]),' '.join(map(str, args))) ip = "0.0.0.0" # 0.0.0.0 will make the server accessable on all network interfaces port = 2442 # Port to run server on start_time = time.time() # Record start time for logging socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Setup UDP Communication socket.bind((ip, port)) print("Bound to IP: ",ip,"\n\t Port:",port) print("\nServer running!") while 1: data = { "a": 1, "b": 2, "c": 3 } ###################################### # UPDATE DATA HERE # Example: # data["batt_v"] = analog_read(battery) ###################################### try: request, ip = socket.recvfrom(1024) # Wait until data is received request = json.loads(request.decode('utf-8')) # Converts data back from bytes to string log("Received Request from", ip[0], "for:", request) # Log to console packet = [] # Create empty list to construct packet for item in request: # Iterate through requested items and # assemble packet in order requested if item in data: # Check requested item exists in data dictionary packet.append(data[item]) # If items exists append to end of packet elif item not in data: # If item doesnt exist in data dictionary log("Item \"",item,"\"", "does not exist!") # Log to console packet.append(None) # append 'None' for better error handling packet = json.dumps(packet) # Convert message to bytes socket.sendto(packet.encode('utf-8'), ip) # Send back to device that requested log("Sent response", packet,"to",ip[0]) # Log to console except Exception as e: # If there is an error print(e) # Print error exit() # Exit code. Replace with "pass" for code to move on after error
[ 1, 396, 910, 934, 338, 925, 263, 6996, 1342, 310, 278, 1923, 419, 2523, 362, 3829, 304, 263, 3132, 1824, 29889, 13, 29937, 450, 1923, 338, 1065, 373, 278, 15685, 6601, 322, 14517, 848, 304, 263, 3132, 373, 596, 1887, 22844, 13, 29937, 975, 263, 1513, 281, 6832, 3957, 29889, 910, 508, 367, 1304, 304, 2479, 734, 2409, 27184, 29889, 29871, 13, 13, 5215, 931, 13, 5215, 4390, 13, 5215, 9909, 13, 13, 1753, 1857, 29918, 2230, 29898, 2962, 29918, 2230, 1125, 13, 1678, 1857, 29918, 2230, 353, 931, 29889, 2230, 580, 448, 1369, 29918, 2230, 13, 1678, 2462, 353, 1857, 29918, 2230, 849, 313, 29906, 29946, 334, 29871, 29941, 29953, 29900, 29900, 29897, 13, 1678, 1857, 29918, 2230, 353, 1857, 29918, 2230, 1273, 313, 29906, 29946, 334, 29871, 29941, 29953, 29900, 29900, 29897, 13, 1678, 7234, 353, 1857, 29918, 2230, 849, 29871, 29941, 29953, 29900, 29900, 13, 1678, 1857, 29918, 2230, 1273, 29922, 29871, 29941, 29953, 29900, 29900, 13, 1678, 6233, 353, 1857, 29918, 2230, 849, 29871, 29953, 29900, 13, 1678, 1857, 29918, 2230, 1273, 29922, 29871, 29953, 29900, 13, 1678, 6923, 353, 4513, 29898, 3784, 29918, 2230, 29892, 29941, 29897, 13, 1678, 736, 7234, 29892, 6233, 29892, 6923, 13, 13, 1753, 1480, 10456, 5085, 1125, 13, 1678, 260, 353, 1857, 29918, 2230, 29898, 2962, 29918, 2230, 29897, 13, 1678, 1596, 11702, 29900, 29906, 29881, 16664, 29900, 29906, 29881, 16664, 29900, 29906, 29889, 29941, 29888, 448, 29908, 1273, 313, 29873, 29961, 29900, 1402, 29873, 29961, 29896, 1402, 29873, 29961, 29906, 11724, 29915, 15300, 7122, 29898, 1958, 29898, 710, 29892, 6389, 4961, 13, 13, 666, 353, 376, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 29908, 418, 396, 29871, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 674, 1207, 278, 1923, 2130, 519, 373, 599, 3564, 19510, 13, 637, 353, 29871, 29906, 29946, 29946, 29906, 308, 396, 3371, 304, 1065, 1923, 373, 13, 13, 2962, 29918, 2230, 353, 931, 29889, 2230, 580, 1678, 396, 14164, 1369, 931, 363, 12183, 13, 13, 11514, 353, 9909, 29889, 11514, 29898, 11514, 29889, 5098, 29918, 1177, 2544, 29892, 9909, 29889, 6156, 7077, 29918, 29928, 29954, 25058, 29897, 259, 396, 3789, 786, 501, 11191, 22365, 362, 13, 11514, 29889, 5355, 3552, 666, 29892, 2011, 876, 13, 13, 2158, 703, 17109, 304, 5641, 29901, 29871, 9162, 666, 1699, 29905, 29876, 29905, 29873, 3371, 29901, 613, 637, 29897, 13, 2158, 14182, 29876, 6004, 2734, 29991, 1159, 13, 13, 8000, 29871, 29896, 29901, 13, 13, 1678, 848, 353, 426, 13, 418, 376, 29874, 1115, 29871, 29896, 29892, 13, 418, 376, 29890, 1115, 29871, 29906, 29892, 13, 418, 376, 29883, 1115, 29871, 29941, 13, 1678, 500, 13, 13, 13383, 13383, 4136, 2277, 13, 13, 1678, 396, 16924, 360, 8254, 379, 27267, 13, 13, 1678, 396, 8741, 29901, 13, 1678, 396, 848, 3366, 29890, 1131, 29918, 29894, 3108, 353, 15690, 29918, 949, 29898, 29890, 2620, 29891, 29897, 13, 13, 13383, 13383, 4136, 2277, 13, 13, 1678, 1018, 29901, 13, 13, 4706, 2009, 29892, 10377, 353, 9909, 29889, 3757, 29894, 3166, 29898, 29896, 29900, 29906, 29946, 29897, 462, 268, 396, 20340, 2745, 848, 338, 4520, 13, 4706, 2009, 353, 4390, 29889, 18132, 29898, 3827, 29889, 13808, 877, 9420, 29899, 29947, 8785, 965, 396, 1281, 369, 1372, 848, 1250, 515, 6262, 304, 1347, 13, 4706, 1480, 703, 29816, 10729, 515, 613, 10377, 29961, 29900, 1402, 376, 1454, 29901, 613, 2009, 29897, 1678, 396, 4522, 304, 2991, 13, 4706, 18203, 353, 5159, 462, 462, 632, 396, 6204, 4069, 1051, 304, 3386, 18203, 13, 13, 4706, 363, 2944, 297, 2009, 29901, 18884, 396, 20504, 403, 1549, 13877, 4452, 322, 13, 462, 462, 9651, 396, 24940, 18203, 297, 1797, 13877, 13, 9651, 565, 2944, 297, 848, 29901, 18884, 396, 5399, 13877, 2944, 4864, 297, 848, 8600, 13, 13, 18884, 18203, 29889, 4397, 29898, 1272, 29961, 667, 2314, 259, 396, 960, 4452, 4864, 9773, 304, 1095, 310, 18203, 13, 13, 9651, 25342, 2944, 451, 297, 848, 29901, 462, 795, 396, 960, 2944, 19403, 1863, 297, 848, 8600, 13, 18884, 1480, 703, 2001, 13218, 613, 667, 1699, 5931, 613, 376, 13221, 451, 1863, 29991, 1159, 268, 396, 4522, 304, 2991, 13, 18884, 18203, 29889, 4397, 29898, 8516, 29897, 462, 632, 396, 9773, 525, 8516, 29915, 363, 2253, 1059, 11415, 13, 13, 4706, 18203, 353, 4390, 29889, 29881, 17204, 29898, 4058, 300, 29897, 462, 268, 396, 14806, 2643, 304, 6262, 13, 4706, 9909, 29889, 6717, 517, 29898, 4058, 300, 29889, 12508, 877, 9420, 29899, 29947, 5477, 10377, 29897, 539, 396, 15076, 1250, 304, 4742, 393, 13877, 13, 4706, 1480, 703, 29903, 296, 2933, 613, 18203, 1699, 517, 613, 666, 29961, 29900, 2314, 308, 396, 4522, 304, 2991, 13, 13, 1678, 5174, 8960, 408, 321, 29901, 418, 396, 960, 727, 338, 385, 1059, 13, 4706, 1596, 29898, 29872, 29897, 18884, 396, 13905, 1059, 13, 4706, 6876, 580, 462, 29871, 396, 25954, 775, 29889, 22108, 411, 376, 3364, 29908, 363, 775, 304, 4337, 373, 1156, 1059, 13, 2 ]
tests/benchmarks/garage/tf/algos/benchmark_ddpg.py
bainro/garage
0
188937
<filename>tests/benchmarks/garage/tf/algos/benchmark_ddpg.py """This script creates a regression test over garage-DDPG and baselines-DDPG. It get Mujoco1M benchmarks from baselines benchmark, and test each task in its trial times on garage model and baselines model. For each task, there will be `trial` times with different random seeds. For each trial, there will be two log directories corresponding to baselines and garage. And there will be a plot plotting the average return curve from baselines and garage. """ import datetime import os import os.path as osp import random from baselines import bench from baselines import logger as baselines_logger from baselines.bench import benchmarks from baselines.common.misc_util import set_global_seeds from baselines.common.vec_env import DummyVecEnv from baselines.ddpg import ddpg from baselines.logger import configure import dowel from dowel import logger as dowel_logger import gym import pytest import tensorflow as tf from garage.envs import normalize from garage.experiment import deterministic from garage.np.exploration_strategies import OUStrategy from garage.replay_buffer import SimpleReplayBuffer from garage.tf.algos import DDPG from garage.tf.envs import TfEnv from garage.tf.experiment import LocalTFRunner from garage.tf.policies import ContinuousMLPPolicy from garage.tf.q_functions import ContinuousMLPQFunction from tests.fixtures import snapshot_config import tests.helpers as Rh from tests.wrappers import AutoStopEnv # Hyperparams for baselines and garage params = { 'policy_lr': 1e-4, 'qf_lr': 1e-3, 'policy_hidden_sizes': [64, 64], 'qf_hidden_sizes': [64, 64], 'n_epochs': 500, 'steps_per_epoch': 20, 'n_rollout_steps': 100, 'n_train_steps': 50, 'discount': 0.9, 'tau': 1e-2, 'replay_buffer_size': int(1e6), 'sigma': 0.2, } def benchmark_ddpg(): """Compare benchmarks between garage and baselines.""" # Load Mujoco1M tasks, you can check other benchmarks here # https://github.com/openai/baselines/blob/master/baselines/bench/benchmarks.py mujoco1m = benchmarks.get_benchmark('Mujoco1M') timestamp = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S-%f') benchmark_dir = osp.join(os.getcwd(), 'data', 'local', 'benchmarks', 'ddpg', timestamp) result_json = {} for task in mujoco1m['tasks']: env_id = task['env_id'] env = gym.make(env_id) baseline_env = AutoStopEnv(env_name=env_id, max_path_length=params['n_rollout_steps']) seeds = random.sample(range(100), task['trials']) task_dir = osp.join(benchmark_dir, env_id) plt_file = osp.join(benchmark_dir, '{}_benchmark.png'.format(env_id)) relplt_file = osp.join(benchmark_dir, '{}_benchmark_mean.png'.format(env_id)) baselines_csvs = [] garage_csvs = [] for trial in range(task['trials']): env.reset() baseline_env.reset() seed = seeds[trial] trial_dir = osp.join(task_dir, 'trial_{}_seed_{}'.format(trial + 1, seed)) garage_dir = osp.join(trial_dir, 'garage') baselines_dir = osp.join(trial_dir, 'baselines') with tf.Graph().as_default(): # Run garage algorithms garage_csv = run_garage(env, seed, garage_dir) # Run baselines algorithms baselines_csv = run_baselines(baseline_env, seed, baselines_dir) garage_csvs.append(garage_csv) baselines_csvs.append(baselines_csv) env.close() Rh.plot(b_csvs=baselines_csvs, g_csvs=garage_csvs, g_x='Epoch', g_y='Evaluation/AverageReturn', g_z='Garage', b_x='total/epochs', b_y='rollout/return', b_z='Baseline', trials=task['trials'], seeds=seeds, plt_file=plt_file, env_id=env_id, x_label='Epoch', y_label='Evaluation/AverageReturn') Rh.relplot(g_csvs=garage_csvs, b_csvs=baselines_csvs, g_x='Epoch', g_y='Evaluation/AverageReturn', g_z='Garage', b_x='total/epochs', b_y='rollout/return', b_z='Baseline', trials=task['trials'], seeds=seeds, plt_file=relplt_file, env_id=env_id, x_label='Epoch', y_label='Evaluation/AverageReturn') result_json[env_id] = Rh.create_json( b_csvs=baselines_csvs, g_csvs=garage_csvs, seeds=seeds, trails=task['trials'], g_x='Epoch', g_y='Evaluation/AverageReturn', b_x='total/epochs', b_y='rollout/return', factor_g=params['steps_per_epoch'] * params['n_rollout_steps'], factor_b=1) Rh.write_file(result_json, 'DDPG') def run_garage(env, seed, log_dir): """Create garage model and training. Replace the ppo with the algorithm you want to run. Args: env (gym.Env): Environment of the task. seed (int): Random seed for the trial. log_dir (str): Log dir path. Returns: str: The log file path. """ deterministic.set_seed(seed) with LocalTFRunner(snapshot_config) as runner: env = TfEnv(normalize(env)) # Set up params for ddpg action_noise = OUStrategy(env.spec, sigma=params['sigma']) policy = ContinuousMLPPolicy( env_spec=env.spec, hidden_sizes=params['policy_hidden_sizes'], hidden_nonlinearity=tf.nn.relu, output_nonlinearity=tf.nn.tanh) qf = ContinuousMLPQFunction(env_spec=env.spec, hidden_sizes=params['qf_hidden_sizes'], hidden_nonlinearity=tf.nn.relu) replay_buffer = SimpleReplayBuffer( env_spec=env.spec, size_in_transitions=params['replay_buffer_size'], time_horizon=params['n_rollout_steps']) algo = DDPG(env_spec=env.spec, policy=policy, qf=qf, replay_buffer=replay_buffer, steps_per_epoch=params['steps_per_epoch'], policy_lr=params['policy_lr'], qf_lr=params['qf_lr'], target_update_tau=params['tau'], n_train_steps=params['n_train_steps'], discount=params['discount'], min_buffer_size=int(1e4), exploration_strategy=action_noise, policy_optimizer=tf.compat.v1.train.AdamOptimizer, qf_optimizer=tf.compat.v1.train.AdamOptimizer) # Set up logger since we are not using run_experiment tabular_log_file = osp.join(log_dir, 'progress.csv') tensorboard_log_dir = osp.join(log_dir) dowel_logger.add_output(dowel.StdOutput()) dowel_logger.add_output(dowel.CsvOutput(tabular_log_file)) dowel_logger.add_output(dowel.TensorBoardOutput(tensorboard_log_dir)) runner.setup(algo, env) runner.train(n_epochs=params['n_epochs'], batch_size=params['n_rollout_steps']) dowel_logger.remove_all() return tabular_log_file def run_baselines(env, seed, log_dir): """Create baselines model and training. Replace the ppo and its training with the algorithm you want to run. Args: env (gym.Env): Environment of the task. seed (int): Random seed for the trial. log_dir (str): Log dir path. Returns: str: The log file path. """ seed = seed + 1000000 set_global_seeds(seed) env.seed(seed) # Set up logger for baselines configure(dir=log_dir, format_strs=['stdout', 'log', 'csv', 'tensorboard']) baselines_logger.info('seed={}, logdir={}'.format( seed, baselines_logger.get_dir())) env = DummyVecEnv([ lambda: bench.Monitor( env, baselines_logger.get_dir(), allow_early_resets=True) ]) ddpg.learn(network='mlp', env=env, nb_epochs=params['n_epochs'], nb_epoch_cycles=params['steps_per_epoch'], normalize_observations=False, critic_l2_reg=0, actor_lr=params['policy_lr'], critic_lr=params['qf_lr'], gamma=params['discount'], nb_train_steps=params['n_train_steps'], nb_rollout_steps=params['n_rollout_steps'], nb_eval_steps=100) return osp.join(log_dir, 'progress.csv')
[ 1, 529, 9507, 29958, 21150, 29914, 1785, 16580, 29879, 29914, 5397, 482, 29914, 13264, 29914, 9564, 359, 29914, 1785, 16580, 29918, 1289, 4061, 29889, 2272, 13, 15945, 29908, 4013, 2471, 10017, 263, 17855, 1243, 975, 7171, 482, 29899, 7858, 16903, 322, 2362, 24210, 29899, 7858, 16903, 29889, 13, 3112, 679, 341, 8016, 6235, 29896, 29924, 23513, 29879, 515, 2362, 24210, 23513, 29892, 322, 1243, 1269, 3414, 297, 13, 1169, 14260, 3064, 373, 7171, 482, 1904, 322, 2362, 24210, 1904, 29889, 1152, 1269, 3414, 29892, 727, 674, 13, 915, 421, 3626, 284, 29952, 3064, 411, 1422, 4036, 409, 5779, 29889, 1152, 1269, 14260, 29892, 727, 674, 367, 1023, 13, 1188, 17525, 6590, 304, 2362, 24210, 322, 7171, 482, 29889, 1126, 727, 674, 367, 263, 6492, 13, 5317, 1259, 278, 6588, 736, 11672, 515, 2362, 24210, 322, 7171, 482, 29889, 13, 15945, 29908, 13, 5215, 12865, 13, 5215, 2897, 13, 5215, 2897, 29889, 2084, 408, 288, 1028, 13, 5215, 4036, 13, 13, 3166, 2362, 24210, 1053, 3856, 305, 13, 3166, 2362, 24210, 1053, 17927, 408, 2362, 24210, 29918, 21707, 13, 3166, 2362, 24210, 29889, 1785, 305, 1053, 23513, 29879, 13, 3166, 2362, 24210, 29889, 9435, 29889, 29885, 10669, 29918, 4422, 1053, 731, 29918, 10945, 29918, 344, 5779, 13, 3166, 2362, 24210, 29889, 9435, 29889, 2003, 29918, 6272, 1053, 360, 11770, 25987, 21745, 13, 3166, 2362, 24210, 29889, 1289, 4061, 1053, 24488, 4061, 13, 3166, 2362, 24210, 29889, 21707, 1053, 10822, 13, 5215, 16611, 295, 13, 3166, 16611, 295, 1053, 17927, 408, 16611, 295, 29918, 21707, 13, 5215, 330, 962, 13, 5215, 11451, 1688, 13, 5215, 26110, 408, 15886, 13, 13, 3166, 7171, 482, 29889, 264, 4270, 1053, 4226, 675, 13, 3166, 7171, 482, 29889, 735, 15362, 1053, 11806, 4695, 13, 3166, 7171, 482, 29889, 9302, 29889, 24516, 12418, 29918, 710, 1845, 583, 1053, 438, 3308, 509, 8963, 13, 3166, 7171, 482, 29889, 276, 1456, 29918, 9040, 1053, 12545, 1123, 1456, 7701, 13, 3166, 7171, 482, 29889, 13264, 29889, 9564, 359, 1053, 360, 11191, 29954, 13, 3166, 7171, 482, 29889, 13264, 29889, 264, 4270, 1053, 323, 29888, 21745, 13, 3166, 7171, 482, 29889, 13264, 29889, 735, 15362, 1053, 9959, 8969, 16802, 13, 3166, 7171, 482, 29889, 13264, 29889, 3733, 293, 583, 1053, 2866, 8675, 681, 1988, 29925, 15644, 13, 3166, 7171, 482, 29889, 13264, 29889, 29939, 29918, 12171, 1053, 2866, 8675, 681, 1988, 29925, 29984, 6678, 13, 3166, 6987, 29889, 7241, 486, 1973, 1053, 22395, 29918, 2917, 13, 5215, 6987, 29889, 3952, 6774, 408, 7861, 13, 3166, 6987, 29889, 29893, 336, 22437, 1053, 11133, 16329, 21745, 13, 13, 29937, 26078, 7529, 363, 2362, 24210, 322, 7171, 482, 13, 7529, 353, 426, 13, 1678, 525, 22197, 29918, 29212, 2396, 29871, 29896, 29872, 29899, 29946, 29892, 13, 1678, 525, 29939, 29888, 29918, 29212, 2396, 29871, 29896, 29872, 29899, 29941, 29892, 13, 1678, 525, 22197, 29918, 10892, 29918, 29879, 7093, 2396, 518, 29953, 29946, 29892, 29871, 29953, 29946, 1402, 13, 1678, 525, 29939, 29888, 29918, 10892, 29918, 29879, 7093, 2396, 518, 29953, 29946, 29892, 29871, 29953, 29946, 1402, 13, 1678, 525, 29876, 29918, 1022, 2878, 29879, 2396, 29871, 29945, 29900, 29900, 29892, 13, 1678, 525, 24530, 29918, 546, 29918, 1022, 2878, 2396, 29871, 29906, 29900, 29892, 13, 1678, 525, 29876, 29918, 1245, 449, 29918, 24530, 2396, 29871, 29896, 29900, 29900, 29892, 13, 1678, 525, 29876, 29918, 14968, 29918, 24530, 2396, 29871, 29945, 29900, 29892, 13, 1678, 525, 2218, 2798, 2396, 29871, 29900, 29889, 29929, 29892, 13, 1678, 525, 4722, 2396, 29871, 29896, 29872, 29899, 29906, 29892, 13, 1678, 525, 276, 1456, 29918, 9040, 29918, 2311, 2396, 938, 29898, 29896, 29872, 29953, 511, 13, 1678, 525, 3754, 2396, 29871, 29900, 29889, 29906, 29892, 13, 29913, 13, 13, 13, 1753, 23513, 29918, 1289, 4061, 7295, 13, 1678, 9995, 6843, 598, 23513, 29879, 1546, 7171, 482, 322, 2362, 24210, 1213, 15945, 13, 1678, 396, 16012, 341, 8016, 6235, 29896, 29924, 9595, 29892, 366, 508, 1423, 916, 23513, 29879, 1244, 13, 1678, 396, 2045, 597, 3292, 29889, 510, 29914, 3150, 1794, 29914, 6500, 24210, 29914, 10054, 29914, 6207, 29914, 6500, 24210, 29914, 1785, 305, 29914, 1785, 16580, 29879, 29889, 2272, 13, 1678, 3887, 29926, 6235, 29896, 29885, 353, 23513, 29879, 29889, 657, 29918, 1785, 16580, 877, 29924, 8016, 6235, 29896, 29924, 1495, 13, 13, 1678, 14334, 353, 12865, 29889, 12673, 29889, 3707, 2141, 710, 615, 603, 877, 29995, 29979, 19222, 29885, 19222, 29881, 19222, 29950, 19222, 29924, 19222, 29903, 19222, 29888, 1495, 13, 1678, 23513, 29918, 3972, 353, 288, 1028, 29889, 7122, 29898, 359, 29889, 657, 29883, 9970, 3285, 525, 1272, 742, 525, 2997, 742, 525, 1785, 16580, 29879, 742, 13, 462, 632, 525, 1289, 4061, 742, 14334, 29897, 13, 1678, 1121, 29918, 3126, 353, 6571, 13, 1678, 363, 3414, 297, 3887, 29926, 6235, 29896, 29885, 1839, 20673, 2033, 29901, 13, 4706, 8829, 29918, 333, 353, 3414, 1839, 6272, 29918, 333, 2033, 13, 4706, 8829, 353, 330, 962, 29889, 5675, 29898, 6272, 29918, 333, 29897, 13, 4706, 2362, 5570, 29918, 6272, 353, 11133, 16329, 21745, 29898, 6272, 29918, 978, 29922, 6272, 29918, 333, 29892, 13, 462, 462, 259, 4236, 29918, 2084, 29918, 2848, 29922, 7529, 1839, 29876, 29918, 1245, 449, 29918, 24530, 11287, 13, 4706, 409, 5779, 353, 4036, 29889, 11249, 29898, 3881, 29898, 29896, 29900, 29900, 511, 3414, 1839, 3626, 1338, 11287, 13, 13, 4706, 3414, 29918, 3972, 353, 288, 1028, 29889, 7122, 29898, 1785, 16580, 29918, 3972, 29892, 8829, 29918, 333, 29897, 13, 4706, 14770, 29918, 1445, 353, 288, 1028, 29889, 7122, 29898, 1785, 16580, 29918, 3972, 29892, 22372, 2403, 1785, 16580, 29889, 2732, 4286, 4830, 29898, 6272, 29918, 333, 876, 13, 4706, 1104, 572, 29873, 29918, 1445, 353, 288, 1028, 29889, 7122, 29898, 1785, 16580, 29918, 3972, 29892, 13, 462, 1669, 22372, 2403, 1785, 16580, 29918, 12676, 29889, 2732, 4286, 4830, 29898, 6272, 29918, 333, 876, 13, 4706, 2362, 24210, 29918, 2395, 4270, 353, 5159, 13, 4706, 7171, 482, 29918, 2395, 4270, 353, 5159, 13, 13, 4706, 363, 14260, 297, 3464, 29898, 7662, 1839, 3626, 1338, 2033, 1125, 13, 9651, 8829, 29889, 12071, 580, 13, 9651, 2362, 5570, 29918, 6272, 29889, 12071, 580, 13, 9651, 16717, 353, 409, 5779, 29961, 3626, 284, 29962, 13, 13, 9651, 14260, 29918, 3972, 353, 288, 1028, 29889, 7122, 29898, 7662, 29918, 3972, 29892, 13, 462, 462, 525, 3626, 284, 648, 2403, 26776, 648, 29913, 4286, 4830, 29898, 3626, 284, 718, 29871, 29896, 29892, 16717, 876, 13, 9651, 7171, 482, 29918, 3972, 353, 288, 1028, 29889, 7122, 29898, 3626, 284, 29918, 3972, 29892, 525, 5397, 482, 1495, 13, 9651, 2362, 24210, 29918, 3972, 353, 288, 1028, 29889, 7122, 29898, 3626, 284, 29918, 3972, 29892, 525, 6500, 24210, 1495, 13, 13, 9651, 411, 15886, 29889, 9527, 2141, 294, 29918, 4381, 7295, 13, 18884, 396, 7525, 7171, 482, 14009, 13, 18884, 7171, 482, 29918, 7638, 353, 1065, 29918, 5397, 482, 29898, 6272, 29892, 16717, 29892, 7171, 482, 29918, 3972, 29897, 13, 13, 18884, 396, 7525, 2362, 24210, 14009, 13, 18884, 2362, 24210, 29918, 7638, 353, 1065, 29918, 6500, 24210, 29898, 6500, 5570, 29918, 6272, 29892, 16717, 29892, 13, 462, 462, 795, 2362, 24210, 29918, 3972, 29897, 13, 13, 9651, 7171, 482, 29918, 2395, 4270, 29889, 4397, 29898, 5397, 482, 29918, 7638, 29897, 13, 9651, 2362, 24210, 29918, 2395, 4270, 29889, 4397, 29898, 6500, 24210, 29918, 7638, 29897, 13, 13, 4706, 8829, 29889, 5358, 580, 13, 13, 4706, 7861, 29889, 5317, 29898, 29890, 29918, 2395, 4270, 29922, 6500, 24210, 29918, 2395, 4270, 29892, 13, 18884, 330, 29918, 2395, 4270, 29922, 5397, 482, 29918, 2395, 4270, 29892, 13, 18884, 330, 29918, 29916, 2433, 29923, 1129, 305, 742, 13, 18884, 330, 29918, 29891, 2433, 29923, 4387, 362, 29914, 29909, 19698, 11609, 742, 13, 18884, 330, 29918, 29920, 2433, 29954, 279, 482, 742, 13, 18884, 289, 29918, 29916, 2433, 7827, 29914, 1022, 2878, 29879, 742, 13, 18884, 289, 29918, 29891, 2433, 1245, 449, 29914, 2457, 742, 13, 18884, 289, 29918, 29920, 2433, 9496, 5570, 742, 13, 18884, 3367, 1338, 29922, 7662, 1839, 3626, 1338, 7464, 13, 18884, 409, 5779, 29922, 344, 5779, 29892, 13, 18884, 14770, 29918, 1445, 29922, 572, 29873, 29918, 1445, 29892, 13, 18884, 8829, 29918, 333, 29922, 6272, 29918, 333, 29892, 13, 18884, 921, 29918, 1643, 2433, 29923, 1129, 305, 742, 13, 18884, 343, 29918, 1643, 2433, 29923, 4387, 362, 29914, 29909, 19698, 11609, 1495, 13, 13, 4706, 7861, 29889, 2674, 5317, 29898, 29887, 29918, 2395, 4270, 29922, 5397, 482, 29918, 2395, 4270, 29892, 13, 462, 259, 289, 29918, 2395, 4270, 29922, 6500, 24210, 29918, 2395, 4270, 29892, 13, 462, 259, 330, 29918, 29916, 2433, 29923, 1129, 305, 742, 13, 462, 259, 330, 29918, 29891, 2433, 29923, 4387, 362, 29914, 29909, 19698, 11609, 742, 13, 462, 259, 330, 29918, 29920, 2433, 29954, 279, 482, 742, 13, 462, 259, 289, 29918, 29916, 2433, 7827, 29914, 1022, 2878, 29879, 742, 13, 462, 259, 289, 29918, 29891, 2433, 1245, 449, 29914, 2457, 742, 13, 462, 259, 289, 29918, 29920, 2433, 9496, 5570, 742, 13, 462, 259, 3367, 1338, 29922, 7662, 1839, 3626, 1338, 7464, 13, 462, 259, 409, 5779, 29922, 344, 5779, 29892, 13, 462, 259, 14770, 29918, 1445, 29922, 2674, 572, 29873, 29918, 1445, 29892, 13, 462, 259, 8829, 29918, 333, 29922, 6272, 29918, 333, 29892, 13, 462, 259, 921, 29918, 1643, 2433, 29923, 1129, 305, 742, 13, 462, 259, 343, 29918, 1643, 2433, 29923, 4387, 362, 29914, 29909, 19698, 11609, 1495, 13, 13, 4706, 1121, 29918, 3126, 29961, 6272, 29918, 333, 29962, 353, 7861, 29889, 3258, 29918, 3126, 29898, 13, 9651, 289, 29918, 2395, 4270, 29922, 6500, 24210, 29918, 2395, 4270, 29892, 13, 9651, 330, 29918, 2395, 4270, 29922, 5397, 482, 29918, 2395, 4270, 29892, 13, 9651, 409, 5779, 29922, 344, 5779, 29892, 13, 9651, 1020, 2719, 29922, 7662, 1839, 3626, 1338, 7464, 13, 9651, 330, 29918, 29916, 2433, 29923, 1129, 305, 742, 13, 9651, 330, 29918, 29891, 2433, 29923, 4387, 362, 29914, 29909, 19698, 11609, 742, 13, 9651, 289, 29918, 29916, 2433, 7827, 29914, 1022, 2878, 29879, 742, 13, 9651, 289, 29918, 29891, 2433, 1245, 449, 29914, 2457, 742, 13, 9651, 7329, 29918, 29887, 29922, 7529, 1839, 24530, 29918, 546, 29918, 1022, 2878, 2033, 334, 8636, 1839, 29876, 29918, 1245, 449, 29918, 24530, 7464, 13, 9651, 7329, 29918, 29890, 29922, 29896, 29897, 13, 13, 1678, 7861, 29889, 3539, 29918, 1445, 29898, 2914, 29918, 3126, 29892, 525, 7858, 16903, 1495, 13, 13, 13, 1753, 1065, 29918, 5397, 482, 29898, 6272, 29892, 16717, 29892, 1480, 29918, 3972, 1125, 13, 1678, 9995, 4391, 7171, 482, 1904, 322, 6694, 29889, 13, 13, 1678, 22108, 278, 282, 1129, 411, 278, 5687, 366, 864, 304, 1065, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 8829, 313, 29887, 962, 29889, 21745, 1125, 16738, 310, 278, 3414, 29889, 13, 4706, 16717, 313, 524, 1125, 16968, 16717, 363, 278, 14260, 29889, 13, 4706, 1480, 29918, 3972, 313, 710, 1125, 4522, 4516, 2224, 29889, 13, 13, 1678, 16969, 29901, 13, 4706, 851, 29901, 450, 1480, 934, 2224, 29889, 13, 13, 1678, 9995, 13, 1678, 11806, 4695, 29889, 842, 29918, 26776, 29898, 26776, 29897, 13, 13, 1678, 411, 9959, 8969, 16802, 29898, 29879, 14551, 29918, 2917, 29897, 408, 28877, 29901, 13, 4706, 8829, 353, 323, 29888, 21745, 29898, 8945, 675, 29898, 6272, 876, 13, 4706, 396, 3789, 701, 8636, 363, 24488, 4061, 13, 4706, 3158, 29918, 1217, 895, 353, 438, 3308, 509, 8963, 29898, 6272, 29889, 6550, 29892, 269, 2934, 29922, 7529, 1839, 3754, 11287, 13, 13, 4706, 8898, 353, 2866, 8675, 681, 1988, 29925, 15644, 29898, 13, 9651, 8829, 29918, 6550, 29922, 6272, 29889, 6550, 29892, 13, 9651, 7934, 29918, 29879, 7093, 29922, 7529, 1839, 22197, 29918, 10892, 29918, 29879, 7093, 7464, 13, 9651, 7934, 29918, 5464, 10660, 537, 29922, 13264, 29889, 15755, 29889, 2674, 29884, 29892, 13, 9651, 1962, 29918, 5464, 10660, 537, 29922, 13264, 29889, 15755, 29889, 13161, 29882, 29897, 13, 13, 4706, 3855, 29888, 353, 2866, 8675, 681, 1988, 29925, 29984, 6678, 29898, 6272, 29918, 6550, 29922, 6272, 29889, 6550, 29892, 13, 462, 462, 1678, 7934, 29918, 29879, 7093, 29922, 7529, 1839, 29939, 29888, 29918, 10892, 29918, 29879, 7093, 7464, 13, 462, 462, 1678, 7934, 29918, 5464, 10660, 537, 29922, 13264, 29889, 15755, 29889, 2674, 29884, 29897, 13, 13, 4706, 337, 1456, 29918, 9040, 353, 12545, 1123, 1456, 7701, 29898, 13, 9651, 8829, 29918, 6550, 29922, 6272, 29889, 6550, 29892, 13, 9651, 2159, 29918, 262, 29918, 3286, 2187, 29922, 7529, 1839, 276, 1456, 29918, 9040, 29918, 2311, 7464, 13, 9651, 931, 29918, 2015, 18162, 29922, 7529, 1839, 29876, 29918, 1245, 449, 29918, 24530, 11287, 13, 13, 4706, 24673, 353, 360, 11191, 29954, 29898, 6272, 29918, 6550, 29922, 6272, 29889, 6550, 29892, 13, 462, 1678, 8898, 29922, 22197, 29892, 13, 462, 1678, 3855, 29888, 29922, 29939, 29888, 29892, 13, 462, 1678, 337, 1456, 29918, 9040, 29922, 276, 1456, 29918, 9040, 29892, 13, 462, 1678, 6576, 29918, 546, 29918, 1022, 2878, 29922, 7529, 1839, 24530, 29918, 546, 29918, 1022, 2878, 7464, 13, 462, 1678, 8898, 29918, 29212, 29922, 7529, 1839, 22197, 29918, 29212, 7464, 13, 462, 1678, 3855, 29888, 29918, 29212, 29922, 7529, 1839, 29939, 29888, 29918, 29212, 7464, 13, 462, 1678, 3646, 29918, 5504, 29918, 4722, 29922, 7529, 1839, 4722, 7464, 13, 462, 1678, 302, 29918, 14968, 29918, 24530, 29922, 7529, 1839, 29876, 29918, 14968, 29918, 24530, 7464, 13, 462, 1678, 2313, 792, 29922, 7529, 1839, 2218, 2798, 7464, 13, 462, 1678, 1375, 29918, 9040, 29918, 2311, 29922, 524, 29898, 29896, 29872, 29946, 511, 13, 462, 1678, 3902, 12418, 29918, 710, 8963, 29922, 2467, 29918, 1217, 895, 29892, 13, 462, 1678, 8898, 29918, 20640, 3950, 29922, 13264, 29889, 12667, 29889, 29894, 29896, 29889, 14968, 29889, 3253, 314, 20624, 326, 3950, 29892, 13, 462, 1678, 3855, 29888, 29918, 20640, 3950, 29922, 13264, 29889, 12667, 29889, 29894, 29896, 29889, 14968, 29889, 3253, 314, 20624, 326, 3950, 29897, 13, 13, 4706, 396, 3789, 701, 17927, 1951, 591, 526, 451, 773, 1065, 29918, 735, 15362, 13, 4706, 4434, 1070, 29918, 1188, 29918, 1445, 353, 288, 1028, 29889, 7122, 29898, 1188, 29918, 3972, 29892, 525, 18035, 29889, 7638, 1495, 13, 4706, 12489, 3377, 29918, 1188, 29918, 3972, 353, 288, 1028, 29889, 7122, 29898, 1188, 29918, 3972, 29897, 13, 4706, 16611, 295, 29918, 21707, 29889, 1202, 29918, 4905, 29898, 29881, 27531, 29889, 855, 29881, 6466, 3101, 13, 4706, 16611, 295, 29918, 21707, 29889, 1202, 29918, 4905, 29898, 29881, 27531, 29889, 29907, 4501, 6466, 29898, 9456, 29918, 1188, 29918, 1445, 876, 13, 4706, 16611, 295, 29918, 21707, 29889, 1202, 29918, 4905, 29898, 29881, 27531, 29889, 29911, 6073, 28397, 6466, 29898, 20158, 3377, 29918, 1188, 29918, 3972, 876, 13, 13, 4706, 28877, 29889, 14669, 29898, 284, 1484, 29892, 8829, 29897, 13, 4706, 28877, 29889, 14968, 29898, 29876, 29918, 1022, 2878, 29879, 29922, 7529, 1839, 29876, 29918, 1022, 2878, 29879, 7464, 13, 462, 268, 9853, 29918, 2311, 29922, 7529, 1839, 29876, 29918, 1245, 449, 29918, 24530, 11287, 13, 13, 4706, 16611, 295, 29918, 21707, 29889, 5992, 29918, 497, 580, 13, 13, 4706, 736, 4434, 1070, 29918, 1188, 29918, 1445, 13, 13, 13, 1753, 1065, 29918, 6500, 24210, 29898, 6272, 29892, 16717, 29892, 1480, 29918, 3972, 1125, 13, 1678, 9995, 4391, 2362, 24210, 1904, 322, 6694, 29889, 13, 13, 1678, 22108, 278, 282, 1129, 322, 967, 6694, 411, 278, 5687, 366, 864, 304, 1065, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 8829, 313, 29887, 962, 29889, 21745, 1125, 16738, 310, 278, 3414, 29889, 13, 4706, 16717, 313, 524, 1125, 16968, 16717, 363, 278, 14260, 29889, 13, 4706, 1480, 29918, 3972, 313, 710, 1125, 4522, 4516, 2224, 29889, 13, 13, 1678, 16969, 29901, 13, 4706, 851, 29901, 450, 1480, 934, 2224, 29889, 13, 13, 1678, 9995, 13, 1678, 16717, 353, 16717, 718, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 13, 1678, 731, 29918, 10945, 29918, 344, 5779, 29898, 26776, 29897, 13, 1678, 8829, 29889, 26776, 29898, 26776, 29897, 13, 13, 1678, 396, 3789, 701, 17927, 363, 2362, 24210, 13, 1678, 10822, 29898, 3972, 29922, 1188, 29918, 3972, 29892, 3402, 29918, 710, 29879, 29922, 1839, 25393, 742, 525, 1188, 742, 525, 7638, 742, 525, 20158, 3377, 11287, 13, 1678, 2362, 24210, 29918, 21707, 29889, 3888, 877, 26776, 3790, 1118, 1480, 3972, 3790, 29913, 4286, 4830, 29898, 13, 4706, 16717, 29892, 2362, 24210, 29918, 21707, 29889, 657, 29918, 3972, 22130, 13, 13, 1678, 8829, 353, 360, 11770, 25987, 21745, 4197, 13, 4706, 14013, 29901, 3856, 305, 29889, 7185, 2105, 29898, 13, 9651, 8829, 29892, 2362, 24210, 29918, 21707, 29889, 657, 29918, 3972, 3285, 2758, 29918, 799, 368, 29918, 690, 1691, 29922, 5574, 29897, 13, 268, 2314, 13, 13, 1678, 24488, 4061, 29889, 19668, 29898, 11618, 2433, 828, 29886, 742, 13, 1669, 8829, 29922, 6272, 29892, 13, 1669, 302, 29890, 29918, 1022, 2878, 29879, 29922, 7529, 1839, 29876, 29918, 1022, 2878, 29879, 7464, 13, 1669, 302, 29890, 29918, 1022, 2878, 29918, 1270, 7799, 29922, 7529, 1839, 24530, 29918, 546, 29918, 1022, 2878, 7464, 13, 1669, 4226, 675, 29918, 26739, 800, 29922, 8824, 29892, 13, 1669, 11164, 29918, 29880, 29906, 29918, 1727, 29922, 29900, 29892, 13, 1669, 11339, 29918, 29212, 29922, 7529, 1839, 22197, 29918, 29212, 7464, 13, 1669, 11164, 29918, 29212, 29922, 7529, 1839, 29939, 29888, 29918, 29212, 7464, 13, 1669, 330, 2735, 29922, 7529, 1839, 2218, 2798, 7464, 13, 1669, 302, 29890, 29918, 14968, 29918, 24530, 29922, 7529, 1839, 29876, 29918, 14968, 29918, 24530, 7464, 13, 1669, 302, 29890, 29918, 1245, 449, 29918, 24530, 29922, 7529, 1839, 29876, 29918, 1245, 449, 29918, 24530, 7464, 13, 1669, 302, 29890, 29918, 14513, 29918, 24530, 29922, 29896, 29900, 29900, 29897, 13, 13, 1678, 736, 288, 1028, 29889, 7122, 29898, 1188, 29918, 3972, 29892, 525, 18035, 29889, 7638, 1495, 13, 2 ]
examples/ecs/server_interface.py
wangrui1121/huaweicloud-sdk-python
43
20046
<filename>examples/ecs/server_interface.py<gh_stars>10-100 # -*-coding:utf-8 -*- from openstack import connection # create connection username = "xxxxxx" password = "<PASSWORD>" projectId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # tenant ID userDomainId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # user account ID auth_url = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" # endpoint url conn = connection.Connection(auth_url=auth_url, user_domain_id=userDomainId, project_id=projectId, username=username, password=password) # create server interface def create_server_interface(server_id, net_id=None, port_id=None, fixed_ip=None): attrs = {"net_id": net_id, "port_id": port_id, "fixed_ip": fixed_ip} kwargs = {} for key in attrs: if attrs[key]: kwargs[key] = attrs[key] print(kwargs) if kwargs == {}: message = "Parameter error" raise exceptions.SDKException(message) server = conn.compute.create_server_interface(server_id, **kwargs) print(server) return server # delete interface def delete_server_interface(server_interface, servr_id): conn.compute.delete_server_interface(server_interface, server=servr_id) # show interface detail def get_server_interface(server_interface, servr_id): server_ifa = conn.compute.get_server_interface(server_interface, server=servr_id) print(server_ifa) # get list of interface def server_interfaces(server_id): server_ifas = conn.compute.server_interfaces(server_id) for ifa in server_ifas: print(ifa) if __name__ == "__main__": server_id = "8700184b-79ff-414b-ab8e-11ed01bd3d3d" net_id = "e2103034-dcf3-4ac3-b551-6d5dd8fadb6e" server = create_server_interface(server_id, net_id) get_server_interface(server.id, server_id) server_interfaces(server_id) delete_server_interface(server.id, server_id)
[ 1, 529, 9507, 29958, 19057, 29914, 687, 29879, 29914, 2974, 29918, 13248, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 448, 29930, 29899, 29883, 3689, 29901, 9420, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 1722, 1429, 1053, 3957, 13, 13, 29937, 1653, 3957, 13, 6786, 353, 376, 14633, 4419, 29908, 13, 5630, 353, 9872, 25711, 17013, 11903, 13, 4836, 1204, 353, 376, 14633, 14633, 14633, 14633, 14633, 14633, 14633, 29908, 1678, 396, 3006, 424, 3553, 13, 1792, 15951, 1204, 353, 376, 14633, 14633, 14633, 14633, 14633, 14633, 14633, 29908, 1678, 396, 1404, 3633, 3553, 13, 5150, 29918, 2271, 353, 376, 14633, 14633, 14633, 14633, 14633, 14633, 14633, 29908, 1678, 396, 16248, 3142, 13, 13082, 353, 3957, 29889, 5350, 29898, 5150, 29918, 2271, 29922, 5150, 29918, 2271, 29892, 13, 462, 632, 1404, 29918, 7247, 29918, 333, 29922, 1792, 15951, 1204, 29892, 13, 462, 632, 2060, 29918, 333, 29922, 4836, 1204, 29892, 13, 462, 632, 8952, 29922, 6786, 29892, 13, 462, 632, 4800, 29922, 5630, 29897, 13, 13, 13, 29937, 1653, 1923, 5067, 13, 1753, 1653, 29918, 2974, 29918, 13248, 29898, 2974, 29918, 333, 29892, 7787, 29918, 333, 29922, 8516, 29892, 2011, 29918, 333, 29922, 8516, 29892, 13, 462, 9651, 4343, 29918, 666, 29922, 8516, 1125, 13, 1678, 12421, 29879, 353, 8853, 1212, 29918, 333, 1115, 7787, 29918, 333, 29892, 376, 637, 29918, 333, 1115, 2011, 29918, 333, 29892, 376, 20227, 29918, 666, 1115, 4343, 29918, 666, 29913, 13, 1678, 9049, 5085, 353, 6571, 13, 1678, 363, 1820, 297, 12421, 29879, 29901, 13, 4706, 565, 12421, 29879, 29961, 1989, 5387, 13, 9651, 9049, 5085, 29961, 1989, 29962, 353, 12421, 29879, 29961, 1989, 29962, 13, 1678, 1596, 29898, 19290, 29897, 13, 1678, 565, 9049, 5085, 1275, 426, 6177, 13, 4706, 2643, 353, 376, 9329, 1059, 29908, 13, 4706, 12020, 15283, 29889, 26912, 2451, 29898, 4906, 29897, 13, 1678, 1923, 353, 11009, 29889, 26017, 29889, 3258, 29918, 2974, 29918, 13248, 29898, 2974, 29918, 333, 29892, 3579, 19290, 29897, 13, 1678, 1596, 29898, 2974, 29897, 13, 1678, 736, 1923, 13, 13, 13, 29937, 5217, 5067, 13, 1753, 5217, 29918, 2974, 29918, 13248, 29898, 2974, 29918, 13248, 29892, 3348, 29878, 29918, 333, 1125, 13, 1678, 11009, 29889, 26017, 29889, 8143, 29918, 2974, 29918, 13248, 29898, 2974, 29918, 13248, 29892, 1923, 29922, 2140, 29878, 29918, 333, 29897, 13, 13, 13, 29937, 1510, 5067, 9493, 13, 1753, 679, 29918, 2974, 29918, 13248, 29898, 2974, 29918, 13248, 29892, 3348, 29878, 29918, 333, 1125, 13, 1678, 1923, 29918, 26056, 353, 11009, 29889, 26017, 29889, 657, 29918, 2974, 29918, 13248, 29898, 2974, 29918, 13248, 29892, 13, 462, 462, 462, 259, 1923, 29922, 2140, 29878, 29918, 333, 29897, 13, 1678, 1596, 29898, 2974, 29918, 26056, 29897, 13, 13, 13, 29937, 679, 1051, 310, 5067, 13, 1753, 1923, 29918, 1639, 8726, 29898, 2974, 29918, 333, 1125, 13, 1678, 1923, 29918, 361, 294, 353, 11009, 29889, 26017, 29889, 2974, 29918, 1639, 8726, 29898, 2974, 29918, 333, 29897, 13, 1678, 363, 565, 29874, 297, 1923, 29918, 361, 294, 29901, 13, 4706, 1596, 29898, 26056, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1923, 29918, 333, 353, 376, 29947, 29955, 29900, 29900, 29896, 29947, 29946, 29890, 29899, 29955, 29929, 600, 29899, 29946, 29896, 29946, 29890, 29899, 370, 29947, 29872, 29899, 29896, 29896, 287, 29900, 29896, 6448, 29941, 29881, 29941, 29881, 29908, 13, 1678, 7787, 29918, 333, 353, 376, 29872, 29906, 29896, 29900, 29941, 29900, 29941, 29946, 29899, 29881, 6854, 29941, 29899, 29946, 562, 29941, 29899, 29890, 29945, 29945, 29896, 29899, 29953, 29881, 29945, 1289, 29947, 29888, 328, 29890, 29953, 29872, 29908, 13, 1678, 1923, 353, 1653, 29918, 2974, 29918, 13248, 29898, 2974, 29918, 333, 29892, 7787, 29918, 333, 29897, 13, 1678, 679, 29918, 2974, 29918, 13248, 29898, 2974, 29889, 333, 29892, 1923, 29918, 333, 29897, 13, 1678, 1923, 29918, 1639, 8726, 29898, 2974, 29918, 333, 29897, 13, 1678, 5217, 29918, 2974, 29918, 13248, 29898, 2974, 29889, 333, 29892, 1923, 29918, 333, 29897, 13, 2 ]
REDServer/gunicorn.conf.py
illusioneering/RED
1
25481
bind = "0.0.0.0:80"
[ 1, 7868, 353, 376, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 29901, 29947, 29900, 29908, 13, 2 ]
exec/compressible_mui/scripts/4spec/vert_stat.py
PeculiarOvertones/FHDeX
3
143049
import numpy as np NSAMPLE=64 NSPEC=4 for spec in range(NSPEC): list = [] for i in range(NSAMPLE): infile = "RUN%d/res.mass_spec%d_final_vert" % (i+1,spec+1) a = np.loadtxt(infile) list.append(a) list = np.transpose(np.array(list)) mean = np.mean(list,axis=1) std = np.std(list,axis=1,ddof=1) res_stat = np.transpose([mean,std]) outfile = "res.mass_spec%d_final_vert_stat" % (spec+1) np.savetxt(outfile,res_stat)
[ 1, 1053, 12655, 408, 7442, 13, 13, 3059, 19297, 1307, 29922, 29953, 29946, 13, 3059, 4162, 29907, 29922, 29946, 13, 13, 1454, 1580, 297, 3464, 29898, 3059, 4162, 29907, 1125, 13, 13, 1678, 1051, 353, 5159, 13, 13, 1678, 363, 474, 297, 3464, 29898, 3059, 19297, 1307, 1125, 13, 4706, 297, 1445, 353, 376, 29934, 3904, 29995, 29881, 29914, 690, 29889, 25379, 29918, 6550, 29995, 29881, 29918, 8394, 29918, 1765, 29908, 1273, 313, 29875, 29974, 29896, 29892, 6550, 29974, 29896, 29897, 13, 4706, 263, 353, 7442, 29889, 1359, 3945, 29898, 262, 1445, 29897, 13, 4706, 1051, 29889, 4397, 29898, 29874, 29897, 13, 268, 13, 1678, 1051, 353, 7442, 29889, 3286, 4220, 29898, 9302, 29889, 2378, 29898, 1761, 876, 13, 268, 13, 1678, 2099, 353, 7442, 29889, 12676, 29898, 1761, 29892, 8990, 29922, 29896, 29897, 13, 1678, 3659, 353, 7442, 29889, 4172, 29898, 1761, 29892, 8990, 29922, 29896, 29892, 1289, 974, 29922, 29896, 29897, 13, 268, 13, 1678, 620, 29918, 6112, 353, 7442, 29889, 3286, 4220, 4197, 12676, 29892, 4172, 2314, 13, 268, 13, 1678, 714, 1445, 353, 376, 690, 29889, 25379, 29918, 6550, 29995, 29881, 29918, 8394, 29918, 1765, 29918, 6112, 29908, 1273, 313, 6550, 29974, 29896, 29897, 29871, 13, 1678, 7442, 29889, 29879, 485, 300, 486, 29898, 449, 1445, 29892, 690, 29918, 6112, 29897, 13, 2 ]
EduData/Task/__init__.py
BAOOOOOM/EduData
98
6513
# coding: utf-8 # 2019/8/23 @ tongshiwei
[ 1, 396, 14137, 29901, 23616, 29899, 29947, 13, 29937, 29871, 29906, 29900, 29896, 29929, 29914, 29947, 29914, 29906, 29941, 732, 21861, 845, 29875, 26599, 13, 2 ]
L7-folsom-floodfreq.py
jdherman/eci273
10
159182
<filename>L7-folsom-floodfreq.py import numpy as np import matplotlib.pyplot as plt from scipy import stats x = np.loadtxt('data/folsom-annual-peak-flow.csv', delimiter=',', skiprows=1, usecols=[1]) # data in cfs y = np.log(x) N = len(y) # plt.hist(y) # plt.show() # what is the estimate of the 100-year flood? # assuming 2-parameter lognormal distribution T = 100 m = np.mean(y) s = np.std(y) Zp = stats.norm.ppf(1 - 1/T) Qt = np.exp(m + Zp*s) print('Lognormal %d-year flood: %0.2f cfs' % (T,Qt)) # how different is the LP3? # g = stats.skew(y) # Kp = (2/g)*(1 + g*Zp/6 - g**2/36)**3 - 2/g # Qt = np.exp(m + Kp*s) # print('LP3 %d-year flood: %0.2f cfs' % (T,Qt)) # confidence interval for lognormal # comment out LP3 part first halfwidth = stats.norm.ppf(0.975)*np.sqrt((s**2/N)*(1 + Zp**2/2)) lb = np.exp(m + Zp*s - halfwidth) ub = np.exp(m + Zp*s + halfwidth) print('95%% CI: [%f, %f]' % (lb,ub))
[ 1, 529, 9507, 29958, 29931, 29955, 29899, 29888, 3775, 290, 29899, 29888, 417, 397, 29888, 7971, 29889, 2272, 13, 5215, 12655, 408, 7442, 29871, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 4560, 2272, 1053, 22663, 13, 13, 29916, 353, 7442, 29889, 1359, 3945, 877, 1272, 29914, 29888, 3775, 290, 29899, 812, 950, 29899, 412, 557, 29899, 1731, 29889, 7638, 742, 29871, 13, 18884, 28552, 29922, 742, 742, 29871, 13, 18884, 14383, 5727, 29922, 29896, 29892, 671, 22724, 11759, 29896, 2314, 396, 848, 297, 274, 5847, 13, 29891, 353, 7442, 29889, 1188, 29898, 29916, 29897, 13, 29940, 353, 7431, 29898, 29891, 29897, 13, 13, 29937, 14770, 29889, 29882, 391, 29898, 29891, 29897, 13, 29937, 14770, 29889, 4294, 580, 13, 13, 29937, 825, 338, 278, 12678, 310, 278, 29871, 29896, 29900, 29900, 29899, 6360, 5685, 397, 29973, 13, 29937, 10241, 29871, 29906, 29899, 15501, 1480, 8945, 4978, 13, 29911, 353, 29871, 29896, 29900, 29900, 13, 29885, 353, 7442, 29889, 12676, 29898, 29891, 29897, 13, 29879, 353, 7442, 29889, 4172, 29898, 29891, 29897, 13, 29999, 29886, 353, 22663, 29889, 12324, 29889, 407, 29888, 29898, 29896, 448, 29871, 29896, 29914, 29911, 29897, 13, 17303, 353, 7442, 29889, 4548, 29898, 29885, 718, 796, 29886, 29930, 29879, 29897, 13, 2158, 877, 3403, 8945, 1273, 29881, 29899, 6360, 5685, 397, 29901, 1273, 29900, 29889, 29906, 29888, 274, 5847, 29915, 1273, 313, 29911, 29892, 17303, 876, 13, 13, 29937, 920, 1422, 338, 278, 23671, 29941, 29973, 13, 29937, 330, 353, 22663, 29889, 26050, 29893, 29898, 29891, 29897, 13, 29937, 476, 29886, 353, 313, 29906, 29914, 29887, 11877, 29898, 29896, 718, 330, 29930, 29999, 29886, 29914, 29953, 448, 330, 1068, 29906, 29914, 29941, 29953, 29897, 1068, 29941, 448, 29871, 29906, 29914, 29887, 13, 29937, 14705, 353, 7442, 29889, 4548, 29898, 29885, 718, 476, 29886, 29930, 29879, 29897, 13, 29937, 1596, 877, 13208, 29941, 1273, 29881, 29899, 6360, 5685, 397, 29901, 1273, 29900, 29889, 29906, 29888, 274, 5847, 29915, 1273, 313, 29911, 29892, 17303, 876, 13, 13, 29937, 16420, 7292, 363, 1480, 8945, 13, 29937, 3440, 714, 23671, 29941, 760, 937, 13, 24498, 2103, 353, 22663, 29889, 12324, 29889, 407, 29888, 29898, 29900, 29889, 29929, 29955, 29945, 11877, 9302, 29889, 3676, 3552, 29879, 1068, 29906, 29914, 29940, 11877, 29898, 29896, 718, 796, 29886, 1068, 29906, 29914, 29906, 876, 13, 27728, 353, 7442, 29889, 4548, 29898, 29885, 718, 796, 29886, 29930, 29879, 448, 4203, 2103, 29897, 13, 431, 353, 7442, 29889, 4548, 29898, 29885, 718, 796, 29886, 29930, 29879, 718, 4203, 2103, 29897, 13, 2158, 877, 29929, 29945, 7686, 25781, 29901, 518, 29995, 29888, 29892, 1273, 29888, 29962, 29915, 1273, 313, 27728, 29892, 431, 876, 13, 13, 13, 13, 2 ]
test/unit/test_structures.py
piotr-rusin/spam-lists
7
1617001
<reponame>piotr-rusin/spam-lists # -*- coding: utf-8 -*- """Tests for functions and classes defined in spam_lists.structures.""" from __future__ import unicode_literals # pylint: disable=redefined-builtin from builtins import str, range, object from nose_parameterized import parameterized from spam_lists.exceptions import InvalidHostError, InvalidHostnameError from spam_lists.structures import ( Hostname, create_host, IPv4Address, IPv6Address ) from test.compat import unittest, Mock, patch, MagicMock class BaseHostTest(object): """Tests for subclasses of Host class. :ivar tested_instance: an instance of tested class to be used in tests :cvar class_to_test: a class to be tested """ def setUp(self): self.tested_instance.value = MagicMock() def test_lt_for_smaller_value(self): """Test if False is returned for a smaller value.""" self.tested_instance.value.__lt__.return_value = False self.assertFalse(self.tested_instance < Mock()) def test_lt_for_larger_value(self): """Test if True is returned for a larger value.""" self.tested_instance.value.__lt__.return_value = True self.assertTrue(self.tested_instance < Mock()) def test_lt_for_missing_value_attribute(self): """Test for TypeError when value misses a 'value' attribute.""" other = Mock(spec=[]) self.assertRaises( TypeError, self.tested_instance.__lt__, other ) @parameterized.expand([ ('type_error', TypeError), ('not_implemented_return_value', lambda o: NotImplemented) ]) def test_lt_for_missing_to_unicode_method_to_handle(self, _, side_effect): """Test for TypeError when the other misses to_unicode method. :param side_effect: a side effect for __lt__ method of value attribute of the tested instance. """ other = Mock(spec=['value']) value = MagicMock() value.__lt__.side_effect = side_effect self.tested_instance.value = value self.assertRaises( TypeError, self.tested_instance.__lt__, other ) class HostnameTest(BaseHostTest, unittest.TestCase): """Tests for Hostname class. :cvar superdomain_str: a string value representing a parent of a domain used to create tested instance :cvar domain_str: a string value used as an argument to constructor when creating tested instance :cvar subdomain_str: a string value representing a child domain to the one used to create tested instance :cvar superdomain: a Hostname instance representing a parent of the tested instance :cvar domain: a Hostname instance to be tested :cvar subdomain: a Hostname instance representing a child of the tested instance :cvar unrelated_domain: a Hostname instance representing a domain unrelated to the one represented by tested instance """ # pylint: disable=too-many-public-methods class_to_test = Hostname superdomain_str = 'superdomain.com' domain_str = 'domain.'+superdomain_str subdomain_str = 'subdomain.'+domain_str superdomain = class_to_test(superdomain_str) domain = class_to_test(domain_str) subdomain = class_to_test(subdomain_str) unrelated_domain = class_to_test('other.com') tested_instance = class_to_test('compared.com') @parameterized.expand([ ('hostname', '-e'), ('hostname', '/e'), ('argument', 123) ]) def test_constructor_for_invalid(self, _, value): """Test if InvalidHostnameError is raised. :param value: a value used to construct an instance of the tested class """ self.assertRaises(InvalidHostnameError, Hostname, value) @parameterized.expand([ ('unrelated_domain', unrelated_domain, False), ('a_subdomain', subdomain, False), ('non_hostname_object', '172.16.31.10', False), ('the_same_domain', domain, True), ('a_superdomain', superdomain, True) ]) def test_is_subdomain_for(self, _, other, expected): """Test if an expected value is returned. :param other: the other object passed as argument of the tested method :param expected: a boolean value expected to be returned for given argument """ actual = self.domain.is_subdomain(other) if expected: self.assertTrue(actual) else: self.assertFalse(actual) @parameterized.expand([ ('returns_false', False), ('returns_true', True) ]) def test_lt_for_not_comparable_values(self, _, result): self.tested_instance.value.__lt__.side_effect = TypeError str_value = self.tested_instance.to_unicode() str_value.__lt__.return_value = result other = Mock() assertion = self.assertTrue if result else self.assertFalse assertion(self.tested_instance < other) class IPAddressTestMixin(BaseHostTest): """Tests for subclasses of IPAddress. :cvar class_to_test: a subclass of IPAddress to be tested """ def setUp(self): self.value_constructor_patcher = patch.object( self.class_to_test, 'factory', Mock() ) self.value_constructor_mock = self.value_constructor_patcher.start() self.name_from_ip_patcher = patch('spam_lists.structures.name_from_ip') self.name_from_ip_mock = self.name_from_ip_patcher.start() self.tested_instance = self.class_to_test(Mock()) super(IPAddressTestMixin, self).setUp() def tearDown(self): self.value_constructor_patcher.stop() self.name_from_ip_patcher.stop() def test_constructor_for_invalid_argument(self): """Test if an error is raised for an invalid argument.""" self.value_constructor_mock.side_effect = ValueError self.assertRaises( self.class_to_test.invalid_ip_error_type, self.class_to_test, Mock() ) def test_create_relative_domain_for_ip(self): """Test if accessing relative_domain creates a relative domain.""" # pylint: disable=W0104 self.tested_instance.relative_domain self.name_from_ip_mock.assert_called_once_with( str(self.tested_instance.value) ) name = self.name_from_ip_mock.return_value name.relativize.assert_called_once_with( self.class_to_test.reverse_domain ) def test_relative_domain_value(self): """Test if relative_domain has an expected value.""" name = self.name_from_ip_mock.return_value expected = name.relativize.return_value actual = self.tested_instance.relative_domain self.assertEqual(expected, actual) def test_lt_for_not_comparable_values(self): """Test a result of comparing non-comparable values. The result is expected to be equal to that of comparison of string values of both objects. """ self.tested_instance.value.__lt__.side_effect = TypeError str_value = self.tested_instance.to_unicode() other = Mock() other_str_value = 'other_str' other.to_unicode.return_value = other_str_value self.assertEqual( str_value < other_str_value, self.tested_instance < other ) class IPv4AddressTest(IPAddressTestMixin, unittest.TestCase): """Tests for IPv4Address class.""" # pylint: disable=too-many-public-methods class_to_test = IPv4Address class IPv6AddressTest(IPAddressTestMixin, unittest.TestCase): """Tests for IPv6Address class.""" # pylint: disable=too-many-public-methods class_to_test = IPv6Address class CreateHostTest(unittest.TestCase): """Tests for create_host function. :cvar factories: a list of mocks representing factories used by the function during tests """ # pylint: disable=too-many-public-methods def setUp(self): self.factories = tuple(Mock() for _ in range(5)) @parameterized.expand([ ('v4', '127.0.0.1'), ('v6', '2001:db8:abc:125::45'), ]) def test_host_for_ip(self, _, value): """Test return value of the function for IP address argument. :param value: an IP address to be passed to the create_host function """ ip_address = self.factories[0] expected = ip_address(value) actual = create_host(self.factories, value) self.assertEqual(actual, expected) def test_host_for_hostname(self): """Test return value of the function for hostname argument. The function is expected to return an object returned by a host factory for given hostname. """ for i, factory in enumerate(self.factories): if i != 1: factory.side_effect = InvalidHostError host_factory = self.factories[1] host_value = 'abc.com' expected = host_factory(host_value) actual = create_host(self.factories, host_value) self.assertEqual(expected, actual) @parameterized.expand([ ('ipv4', '299.0.0.1'), ('ipv4', '99.22.33.1.23'), ('ipv6', '2001:db8:abc:125::4h'), ('ipv6', '2001:db8:abcef:125::43'), ('hostname', '-e'), ('hostname', '/e') ]) def test_host_for_invalid(self, _, value): """Test for InvalidHostError when the argument is invalid. :param value: a value to be passed as the argument to the create_host function """ for factory in self.factories: factory.side_effect = InvalidHostError self.assertRaises(InvalidHostError, create_host, self.factories, value) if __name__ == "__main__": # import sys;sys.argv = ['', 'Test.testName'] unittest.main()
[ 1, 529, 276, 1112, 420, 29958, 1631, 25730, 29899, 15816, 262, 29914, 1028, 314, 29899, 21513, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 24376, 363, 3168, 322, 4413, 3342, 297, 805, 314, 29918, 21513, 29889, 4984, 1973, 1213, 15945, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 276, 12119, 29899, 16145, 262, 13, 3166, 4240, 1144, 1053, 851, 29892, 3464, 29892, 1203, 13, 3166, 26414, 29918, 15501, 1891, 1053, 3443, 1891, 13, 13, 3166, 805, 314, 29918, 21513, 29889, 11739, 29879, 1053, 21403, 8514, 2392, 29892, 21403, 8514, 978, 2392, 13, 3166, 805, 314, 29918, 21513, 29889, 4984, 1973, 1053, 313, 13, 1678, 16956, 978, 29892, 1653, 29918, 3069, 29892, 5641, 29894, 29946, 7061, 29892, 5641, 29894, 29953, 7061, 13, 29897, 13, 3166, 1243, 29889, 12667, 1053, 443, 27958, 29892, 26297, 29892, 13261, 29892, 26494, 18680, 13, 13, 13, 1990, 7399, 8514, 3057, 29898, 3318, 1125, 13, 1678, 9995, 24376, 363, 1014, 13203, 310, 16956, 770, 29889, 13, 13, 1678, 584, 440, 279, 9528, 29918, 8758, 29901, 385, 2777, 310, 9528, 770, 304, 367, 1304, 13, 1678, 297, 6987, 13, 1678, 584, 29883, 1707, 770, 29918, 517, 29918, 1688, 29901, 263, 770, 304, 367, 9528, 13, 1678, 9995, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1688, 287, 29918, 8758, 29889, 1767, 353, 26494, 18680, 580, 13, 13, 1678, 822, 1243, 29918, 1896, 29918, 1454, 29918, 9278, 261, 29918, 1767, 29898, 1311, 1125, 13, 4706, 9995, 3057, 565, 7700, 338, 4133, 363, 263, 7968, 995, 1213, 15945, 13, 4706, 1583, 29889, 1688, 287, 29918, 8758, 29889, 1767, 17255, 1896, 26914, 2457, 29918, 1767, 353, 7700, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1311, 29889, 1688, 287, 29918, 8758, 529, 26297, 3101, 13, 13, 1678, 822, 1243, 29918, 1896, 29918, 1454, 29918, 4675, 914, 29918, 1767, 29898, 1311, 1125, 13, 4706, 9995, 3057, 565, 5852, 338, 4133, 363, 263, 7200, 995, 1213, 15945, 13, 4706, 1583, 29889, 1688, 287, 29918, 8758, 29889, 1767, 17255, 1896, 26914, 2457, 29918, 1767, 353, 5852, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 1688, 287, 29918, 8758, 529, 26297, 3101, 13, 13, 1678, 822, 1243, 29918, 1896, 29918, 1454, 29918, 27259, 29918, 1767, 29918, 12715, 29898, 1311, 1125, 13, 4706, 9995, 3057, 363, 20948, 746, 995, 3052, 267, 263, 525, 1767, 29915, 5352, 1213, 15945, 13, 4706, 916, 353, 26297, 29898, 6550, 11759, 2314, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13, 9651, 20948, 29892, 13, 9651, 1583, 29889, 1688, 287, 29918, 8758, 17255, 1896, 1649, 29892, 13, 9651, 916, 13, 4706, 1723, 13, 13, 1678, 732, 15501, 1891, 29889, 18837, 4197, 13, 4706, 6702, 1853, 29918, 2704, 742, 20948, 511, 13, 4706, 6702, 1333, 29918, 326, 2037, 287, 29918, 2457, 29918, 1767, 742, 14013, 288, 29901, 2216, 1888, 2037, 287, 29897, 13, 268, 2314, 13, 1678, 822, 1243, 29918, 1896, 29918, 1454, 29918, 27259, 29918, 517, 29918, 2523, 356, 29918, 5696, 29918, 517, 29918, 8411, 29898, 1311, 29892, 17117, 2625, 29918, 15987, 1125, 13, 4706, 9995, 3057, 363, 20948, 746, 278, 916, 3052, 267, 304, 29918, 2523, 356, 1158, 29889, 13, 13, 4706, 584, 3207, 2625, 29918, 15987, 29901, 263, 2625, 2779, 363, 4770, 1896, 1649, 1158, 310, 995, 13, 4706, 5352, 310, 278, 9528, 2777, 29889, 13, 4706, 9995, 13, 4706, 916, 353, 26297, 29898, 6550, 29922, 1839, 1767, 11287, 13, 4706, 995, 353, 26494, 18680, 580, 13, 4706, 995, 17255, 1896, 26914, 2975, 29918, 15987, 353, 2625, 29918, 15987, 13, 4706, 1583, 29889, 1688, 287, 29918, 8758, 29889, 1767, 353, 995, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13, 9651, 20948, 29892, 13, 9651, 1583, 29889, 1688, 287, 29918, 8758, 17255, 1896, 1649, 29892, 13, 9651, 916, 13, 4706, 1723, 13, 13, 13, 1990, 16956, 978, 3057, 29898, 5160, 8514, 3057, 29892, 443, 27958, 29889, 3057, 8259, 1125, 13, 1678, 9995, 24376, 363, 16956, 978, 770, 29889, 13, 13, 1678, 584, 29883, 1707, 2428, 7247, 29918, 710, 29901, 263, 1347, 995, 15783, 263, 3847, 310, 13, 1678, 263, 5354, 1304, 304, 1653, 9528, 2777, 13, 1678, 584, 29883, 1707, 5354, 29918, 710, 29901, 263, 1347, 995, 1304, 408, 385, 2980, 304, 13, 1678, 5823, 746, 4969, 9528, 2777, 13, 1678, 584, 29883, 1707, 1014, 7247, 29918, 710, 29901, 263, 1347, 995, 15783, 263, 2278, 5354, 13, 1678, 304, 278, 697, 1304, 304, 1653, 9528, 2777, 13, 1678, 584, 29883, 1707, 2428, 7247, 29901, 263, 16956, 978, 2777, 15783, 263, 3847, 13, 1678, 310, 278, 9528, 2777, 13, 1678, 584, 29883, 1707, 5354, 29901, 263, 16956, 978, 2777, 304, 367, 9528, 13, 1678, 584, 29883, 1707, 1014, 7247, 29901, 263, 16956, 978, 2777, 15783, 263, 2278, 13, 1678, 310, 278, 9528, 2777, 13, 1678, 584, 29883, 1707, 443, 12817, 29918, 7247, 29901, 263, 16956, 978, 2777, 15783, 13, 1678, 263, 5354, 443, 12817, 304, 278, 697, 9875, 491, 9528, 2777, 13, 1678, 9995, 13, 13, 1678, 396, 282, 2904, 524, 29901, 11262, 29922, 517, 29877, 29899, 13011, 29899, 3597, 29899, 23515, 13, 13, 1678, 770, 29918, 517, 29918, 1688, 353, 16956, 978, 13, 1678, 2428, 7247, 29918, 710, 353, 525, 9136, 7247, 29889, 510, 29915, 13, 1678, 5354, 29918, 710, 353, 525, 7247, 6169, 29974, 9136, 7247, 29918, 710, 13, 1678, 1014, 7247, 29918, 710, 353, 525, 1491, 7247, 6169, 29974, 7247, 29918, 710, 13, 1678, 2428, 7247, 353, 770, 29918, 517, 29918, 1688, 29898, 9136, 7247, 29918, 710, 29897, 13, 1678, 5354, 353, 770, 29918, 517, 29918, 1688, 29898, 7247, 29918, 710, 29897, 13, 1678, 1014, 7247, 353, 770, 29918, 517, 29918, 1688, 29898, 1491, 7247, 29918, 710, 29897, 13, 1678, 443, 12817, 29918, 7247, 353, 770, 29918, 517, 29918, 1688, 877, 1228, 29889, 510, 1495, 13, 1678, 9528, 29918, 8758, 353, 770, 29918, 517, 29918, 1688, 877, 2388, 1965, 29889, 510, 1495, 13, 13, 1678, 732, 15501, 1891, 29889, 18837, 4197, 13, 4706, 6702, 28988, 742, 17411, 29872, 5477, 13, 4706, 6702, 28988, 742, 8207, 29872, 5477, 13, 4706, 6702, 23516, 742, 29871, 29896, 29906, 29941, 29897, 13, 268, 2314, 13, 1678, 822, 1243, 29918, 27821, 29918, 1454, 29918, 20965, 29898, 1311, 29892, 17117, 995, 1125, 13, 4706, 9995, 3057, 565, 21403, 8514, 978, 2392, 338, 10425, 29889, 13, 13, 4706, 584, 3207, 995, 29901, 263, 995, 1304, 304, 3386, 385, 2777, 310, 13, 4706, 278, 9528, 770, 13, 4706, 9995, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13919, 8514, 978, 2392, 29892, 16956, 978, 29892, 995, 29897, 13, 13, 1678, 732, 15501, 1891, 29889, 18837, 4197, 13, 4706, 6702, 348, 12817, 29918, 7247, 742, 443, 12817, 29918, 7247, 29892, 7700, 511, 13, 4706, 6702, 29874, 29918, 1491, 7247, 742, 1014, 7247, 29892, 7700, 511, 13, 4706, 6702, 5464, 29918, 28988, 29918, 3318, 742, 525, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29941, 29896, 29889, 29896, 29900, 742, 7700, 511, 13, 4706, 6702, 1552, 29918, 17642, 29918, 7247, 742, 5354, 29892, 5852, 511, 13, 4706, 6702, 29874, 29918, 9136, 7247, 742, 2428, 7247, 29892, 5852, 29897, 13, 268, 2314, 13, 1678, 822, 1243, 29918, 275, 29918, 1491, 7247, 29918, 1454, 29898, 1311, 29892, 17117, 916, 29892, 3806, 1125, 13, 4706, 9995, 3057, 565, 385, 3806, 995, 338, 4133, 29889, 13, 13, 4706, 584, 3207, 916, 29901, 278, 916, 1203, 4502, 408, 2980, 310, 13, 4706, 278, 9528, 1158, 13, 4706, 584, 3207, 3806, 29901, 263, 7223, 995, 3806, 304, 367, 4133, 13, 4706, 363, 2183, 2980, 13, 4706, 9995, 13, 4706, 3935, 353, 1583, 29889, 7247, 29889, 275, 29918, 1491, 7247, 29898, 1228, 29897, 13, 4706, 565, 3806, 29901, 13, 9651, 1583, 29889, 9294, 5574, 29898, 19304, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 9294, 8824, 29898, 19304, 29897, 13, 13, 1678, 732, 15501, 1891, 29889, 18837, 4197, 13, 4706, 6702, 18280, 29918, 4541, 742, 7700, 511, 13, 4706, 6702, 18280, 29918, 3009, 742, 5852, 29897, 13, 268, 2314, 13, 1678, 822, 1243, 29918, 1896, 29918, 1454, 29918, 1333, 29918, 510, 862, 519, 29918, 5975, 29898, 1311, 29892, 17117, 1121, 1125, 13, 4706, 1583, 29889, 1688, 287, 29918, 8758, 29889, 1767, 17255, 1896, 26914, 2975, 29918, 15987, 353, 20948, 13, 13, 4706, 851, 29918, 1767, 353, 1583, 29889, 1688, 287, 29918, 8758, 29889, 517, 29918, 2523, 356, 580, 13, 4706, 851, 29918, 1767, 17255, 1896, 26914, 2457, 29918, 1767, 353, 1121, 13, 4706, 916, 353, 26297, 580, 13, 13, 4706, 28306, 353, 1583, 29889, 9294, 5574, 565, 1121, 1683, 1583, 29889, 9294, 8824, 13, 4706, 28306, 29898, 1311, 29889, 1688, 287, 29918, 8758, 529, 916, 29897, 13, 13, 13, 1990, 5641, 7061, 3057, 29924, 861, 262, 29898, 5160, 8514, 3057, 1125, 13, 1678, 9995, 24376, 363, 1014, 13203, 310, 5641, 7061, 29889, 13, 13, 1678, 584, 29883, 1707, 770, 29918, 517, 29918, 1688, 29901, 263, 19481, 310, 5641, 7061, 304, 367, 9528, 13, 1678, 9995, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1767, 29918, 27821, 29918, 5041, 261, 353, 13261, 29889, 3318, 29898, 13, 9651, 1583, 29889, 1990, 29918, 517, 29918, 1688, 29892, 13, 9651, 525, 14399, 742, 13, 9651, 26297, 580, 13, 4706, 1723, 13, 4706, 1583, 29889, 1767, 29918, 27821, 29918, 17640, 353, 1583, 29889, 1767, 29918, 27821, 29918, 5041, 261, 29889, 2962, 580, 13, 13, 4706, 1583, 29889, 978, 29918, 3166, 29918, 666, 29918, 5041, 261, 353, 13261, 877, 1028, 314, 29918, 21513, 29889, 4984, 1973, 29889, 978, 29918, 3166, 29918, 666, 1495, 13, 4706, 1583, 29889, 978, 29918, 3166, 29918, 666, 29918, 17640, 353, 1583, 29889, 978, 29918, 3166, 29918, 666, 29918, 5041, 261, 29889, 2962, 580, 13, 13, 4706, 1583, 29889, 1688, 287, 29918, 8758, 353, 1583, 29889, 1990, 29918, 517, 29918, 1688, 29898, 18680, 3101, 13, 4706, 2428, 29898, 5690, 7061, 3057, 29924, 861, 262, 29892, 1583, 467, 842, 3373, 580, 13, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1767, 29918, 27821, 29918, 5041, 261, 29889, 9847, 580, 13, 4706, 1583, 29889, 978, 29918, 3166, 29918, 666, 29918, 5041, 261, 29889, 9847, 580, 13, 13, 1678, 822, 1243, 29918, 27821, 29918, 1454, 29918, 20965, 29918, 23516, 29898, 1311, 1125, 13, 4706, 9995, 3057, 565, 385, 1059, 338, 10425, 363, 385, 8340, 2980, 1213, 15945, 13, 4706, 1583, 29889, 1767, 29918, 27821, 29918, 17640, 29889, 2975, 29918, 15987, 353, 7865, 2392, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13, 9651, 1583, 29889, 1990, 29918, 517, 29918, 1688, 29889, 20965, 29918, 666, 29918, 2704, 29918, 1853, 29892, 13, 9651, 1583, 29889, 1990, 29918, 517, 29918, 1688, 29892, 13, 9651, 26297, 580, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 3258, 29918, 22925, 29918, 7247, 29918, 1454, 29918, 666, 29898, 1311, 1125, 13, 4706, 9995, 3057, 565, 17378, 6198, 29918, 7247, 10017, 263, 6198, 5354, 1213, 15945, 13, 4706, 396, 282, 2904, 524, 29901, 11262, 29922, 29956, 29900, 29896, 29900, 29946, 13, 4706, 1583, 29889, 1688, 287, 29918, 8758, 29889, 22925, 29918, 7247, 13, 13, 4706, 1583, 29889, 978, 29918, 3166, 29918, 666, 29918, 17640, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 851, 29898, 1311, 29889, 1688, 287, 29918, 8758, 29889, 1767, 29897, 13, 4706, 1723, 13, 4706, 1024, 353, 1583, 29889, 978, 29918, 3166, 29918, 666, 29918, 17640, 29889, 2457, 29918, 1767, 13, 4706, 1024, 29889, 2674, 1926, 675, 29889, 9294, 29918, 13998, 29918, 10646, 29918, 2541, 29898, 13, 9651, 1583, 29889, 1990, 29918, 517, 29918, 1688, 29889, 24244, 29918, 7247, 13, 4706, 1723, 13, 13, 1678, 822, 1243, 29918, 22925, 29918, 7247, 29918, 1767, 29898, 1311, 1125, 13, 4706, 9995, 3057, 565, 6198, 29918, 7247, 756, 385, 3806, 995, 1213, 15945, 13, 4706, 1024, 353, 1583, 29889, 978, 29918, 3166, 29918, 666, 29918, 17640, 29889, 2457, 29918, 1767, 13, 4706, 3806, 353, 1024, 29889, 2674, 1926, 675, 29889, 2457, 29918, 1767, 13, 4706, 3935, 353, 1583, 29889, 1688, 287, 29918, 8758, 29889, 22925, 29918, 7247, 13, 4706, 1583, 29889, 9294, 9843, 29898, 9684, 29892, 3935, 29897, 13, 13, 1678, 822, 1243, 29918, 1896, 29918, 1454, 29918, 1333, 29918, 510, 862, 519, 29918, 5975, 29898, 1311, 1125, 13, 4706, 9995, 3057, 263, 1121, 310, 17420, 1661, 29899, 510, 862, 519, 1819, 29889, 13, 13, 4706, 450, 1121, 338, 3806, 304, 367, 5186, 304, 393, 310, 10230, 310, 13, 4706, 1347, 1819, 310, 1716, 3618, 29889, 13, 4706, 9995, 13, 4706, 1583, 29889, 1688, 287, 29918, 8758, 29889, 1767, 17255, 1896, 26914, 2975, 29918, 15987, 353, 20948, 13, 13, 4706, 851, 29918, 1767, 353, 1583, 29889, 1688, 287, 29918, 8758, 29889, 517, 29918, 2523, 356, 580, 13, 4706, 916, 353, 26297, 580, 13, 4706, 916, 29918, 710, 29918, 1767, 353, 525, 1228, 29918, 710, 29915, 13, 4706, 916, 29889, 517, 29918, 2523, 356, 29889, 2457, 29918, 1767, 353, 916, 29918, 710, 29918, 1767, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 13, 9651, 851, 29918, 1767, 529, 916, 29918, 710, 29918, 1767, 29892, 13, 9651, 1583, 29889, 1688, 287, 29918, 8758, 529, 916, 13, 4706, 1723, 13, 13, 13, 1990, 5641, 29894, 29946, 7061, 3057, 29898, 5690, 7061, 3057, 29924, 861, 262, 29892, 443, 27958, 29889, 3057, 8259, 1125, 13, 1678, 9995, 24376, 363, 5641, 29894, 29946, 7061, 770, 1213, 15945, 13, 13, 1678, 396, 282, 2904, 524, 29901, 11262, 29922, 517, 29877, 29899, 13011, 29899, 3597, 29899, 23515, 13, 1678, 770, 29918, 517, 29918, 1688, 353, 5641, 29894, 29946, 7061, 13, 13, 13, 1990, 5641, 29894, 29953, 7061, 3057, 29898, 5690, 7061, 3057, 29924, 861, 262, 29892, 443, 27958, 29889, 3057, 8259, 1125, 13, 1678, 9995, 24376, 363, 5641, 29894, 29953, 7061, 770, 1213, 15945, 13, 13, 1678, 396, 282, 2904, 524, 29901, 11262, 29922, 517, 29877, 29899, 13011, 29899, 3597, 29899, 23515, 13, 1678, 770, 29918, 517, 29918, 1688, 353, 5641, 29894, 29953, 7061, 13, 13, 13, 1990, 6204, 8514, 3057, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 9995, 24376, 363, 1653, 29918, 3069, 740, 29889, 13, 13, 1678, 584, 29883, 1707, 2114, 3842, 29901, 263, 1051, 310, 11187, 29879, 15783, 2114, 3842, 1304, 491, 13, 1678, 278, 740, 2645, 6987, 13, 1678, 9995, 13, 13, 1678, 396, 282, 2904, 524, 29901, 11262, 29922, 517, 29877, 29899, 13011, 29899, 3597, 29899, 23515, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 17028, 3842, 353, 18761, 29898, 18680, 580, 363, 903, 297, 3464, 29898, 29945, 876, 13, 13, 1678, 732, 15501, 1891, 29889, 18837, 4197, 13, 4706, 6702, 29894, 29946, 742, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 5477, 13, 4706, 6702, 29894, 29953, 742, 525, 29906, 29900, 29900, 29896, 29901, 2585, 29947, 29901, 10736, 29901, 29896, 29906, 29945, 1057, 29946, 29945, 5477, 13, 268, 2314, 13, 1678, 822, 1243, 29918, 3069, 29918, 1454, 29918, 666, 29898, 1311, 29892, 17117, 995, 1125, 13, 4706, 9995, 3057, 736, 995, 310, 278, 740, 363, 5641, 3211, 2980, 29889, 13, 13, 4706, 584, 3207, 995, 29901, 385, 5641, 3211, 304, 367, 4502, 304, 278, 1653, 29918, 3069, 13, 4706, 740, 13, 4706, 9995, 13, 4706, 10377, 29918, 7328, 353, 1583, 29889, 17028, 3842, 29961, 29900, 29962, 13, 4706, 3806, 353, 10377, 29918, 7328, 29898, 1767, 29897, 13, 4706, 3935, 353, 1653, 29918, 3069, 29898, 1311, 29889, 17028, 3842, 29892, 995, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 19304, 29892, 3806, 29897, 13, 13, 1678, 822, 1243, 29918, 3069, 29918, 1454, 29918, 28988, 29898, 1311, 1125, 13, 4706, 9995, 3057, 736, 995, 310, 278, 740, 363, 3495, 978, 2980, 29889, 13, 13, 4706, 450, 740, 338, 3806, 304, 736, 385, 1203, 4133, 491, 263, 3495, 13, 4706, 12529, 363, 2183, 3495, 978, 29889, 13, 4706, 9995, 13, 4706, 363, 474, 29892, 12529, 297, 26985, 29898, 1311, 29889, 17028, 3842, 1125, 13, 9651, 565, 474, 2804, 29871, 29896, 29901, 13, 18884, 12529, 29889, 2975, 29918, 15987, 353, 21403, 8514, 2392, 13, 4706, 3495, 29918, 14399, 353, 1583, 29889, 17028, 3842, 29961, 29896, 29962, 13, 4706, 3495, 29918, 1767, 353, 525, 10736, 29889, 510, 29915, 13, 4706, 3806, 353, 3495, 29918, 14399, 29898, 3069, 29918, 1767, 29897, 13, 4706, 3935, 353, 1653, 29918, 3069, 29898, 1311, 29889, 17028, 3842, 29892, 3495, 29918, 1767, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 9684, 29892, 3935, 29897, 13, 13, 1678, 732, 15501, 1891, 29889, 18837, 4197, 13, 4706, 6702, 666, 29894, 29946, 742, 525, 29906, 29929, 29929, 29889, 29900, 29889, 29900, 29889, 29896, 5477, 13, 4706, 6702, 666, 29894, 29946, 742, 525, 29929, 29929, 29889, 29906, 29906, 29889, 29941, 29941, 29889, 29896, 29889, 29906, 29941, 5477, 13, 4706, 6702, 666, 29894, 29953, 742, 525, 29906, 29900, 29900, 29896, 29901, 2585, 29947, 29901, 10736, 29901, 29896, 29906, 29945, 1057, 29946, 29882, 5477, 13, 4706, 6702, 666, 29894, 29953, 742, 525, 29906, 29900, 29900, 29896, 29901, 2585, 29947, 29901, 370, 346, 29888, 29901, 29896, 29906, 29945, 1057, 29946, 29941, 5477, 13, 4706, 6702, 28988, 742, 17411, 29872, 5477, 13, 4706, 6702, 28988, 742, 8207, 29872, 1495, 13, 268, 2314, 13, 1678, 822, 1243, 29918, 3069, 29918, 1454, 29918, 20965, 29898, 1311, 29892, 17117, 995, 1125, 13, 4706, 9995, 3057, 363, 21403, 8514, 2392, 746, 278, 2980, 338, 8340, 29889, 13, 13, 4706, 584, 3207, 995, 29901, 263, 995, 304, 367, 4502, 408, 278, 2980, 304, 13, 4706, 278, 1653, 29918, 3069, 740, 13, 4706, 9995, 13, 4706, 363, 12529, 297, 1583, 29889, 17028, 3842, 29901, 13, 9651, 12529, 29889, 2975, 29918, 15987, 353, 21403, 8514, 2392, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13919, 8514, 2392, 29892, 1653, 29918, 3069, 29892, 1583, 29889, 17028, 3842, 29892, 995, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 396, 1053, 10876, 29936, 9675, 29889, 19218, 353, 6024, 742, 525, 3057, 29889, 1688, 1170, 2033, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
Turtle-Alpha.py
Space-Luis/Python_Turtle_Example
0
173787
<reponame>Space-Luis/Python_Turtle_Example<gh_stars>0 import turtle T = turtle.Turtle() T.shape("Turtle") #Turtle의 모양을 거북이로 지정 T.color("LightBlue") #색깔을 LightBlue로 변경 T.forward(100) #Turtle을 앞으로 100만큼 가도록 실행 T.circle(100) #Turtle을 반지름이 100이도록 원을 그림
[ 1, 529, 276, 1112, 420, 29958, 14936, 29899, 29931, 4664, 29914, 11980, 29918, 29911, 4227, 280, 29918, 14023, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 260, 4227, 280, 30004, 13, 30004, 13, 29911, 353, 260, 4227, 280, 29889, 29911, 4227, 280, 26471, 13, 30004, 13, 29911, 29889, 12181, 703, 29911, 4227, 280, 1159, 396, 29911, 4227, 280, 30708, 29871, 31962, 239, 153, 148, 31286, 29871, 237, 180, 179, 238, 185, 132, 30393, 30906, 29871, 30811, 30852, 30004, 13, 30004, 13, 29911, 29889, 2780, 703, 20769, 21319, 1159, 396, 239, 134, 140, 237, 188, 151, 31286, 12790, 21319, 30906, 29871, 238, 182, 131, 31378, 30004, 13, 30004, 13, 29911, 29889, 11333, 29898, 29896, 29900, 29900, 29897, 396, 29911, 4227, 280, 31286, 29871, 239, 152, 161, 239, 159, 191, 30906, 29871, 29896, 29900, 29900, 31826, 240, 132, 191, 29871, 30903, 31136, 238, 164, 160, 29871, 239, 142, 167, 240, 153, 140, 30004, 13, 29911, 29889, 16622, 29898, 29896, 29900, 29900, 29897, 396, 29911, 4227, 280, 31286, 29871, 238, 179, 155, 30811, 238, 169, 135, 30393, 29871, 29896, 29900, 29900, 30393, 31136, 238, 164, 160, 29871, 31198, 31286, 29871, 31607, 238, 169, 191, 30004, 13, 2 ]
main.py
Abhay420000/List-of-all-Files-and-Directories
0
71658
# -*- coding: utf-8 -*- """ Created on Sat May 1 18:26:28 2021 @author: abhay version: 0.0.1 """ import os,argparse stack = [] ''' Stack is Used as a directory(folder/path) pointer due to its property of LIFO It's last element is current directory Current Directory ''' ipath = '' ''' This is the path made every time when we move from directory to directory Maked by using Stack ''' unordereddat = {} ''' Data added when a directory is found eg.{'MYDIR':[file1,dir2,file2],'dir2':[file5,file6]} Note:Uncomment KeepRec if you want to use. ''' def stackUpdate(dirr,operation): ''' Its going to update here when required Its required when we have to go back or forward in a directory(path). Note:Whenever do stackUpdate always do buildUpdate ''' global stack if operation == 'a': stack.append(dirr) elif operation == 'p' and len(stack) != 0: stack.pop() def buildPath(): ''' This is going to build path for us using stack. Note:Whenever do stackUpdate always do buildUpdate ''' global stack,ipath,path ipath = path if len(stack) > 0: for i in range(0,len(stack)): ipath = ipath + stack[i] + '/' else: ipath = path def keepRec():#Not required (Optional) ''' Used to keep record of each and every files in a directory. It must be called to do so. A dictionary with key = Folder name, values =[file1,file2,file3] ''' global unordereddat,ipath,stack files = [] with os.scandir(ipath) as ent: for i in ent: files.append(i.name) try: dirc = stack[-1] except: #for the frist time dirc = path unordereddat[dirc] = files def datas(): ''' This function is going to do our actual work of listing files and directories order wise. ''' global ps,wp,f buildPath() #keepRec() with os.scandir(ipath) as ent: for i in ent: #listing all files if os.path.isfile(ipath+i.name): if ps == "p" and wp == "wp": print(ipath+i.name+'\n') elif ps == "p" and wp == "nwp": print(len(stack)*'\t'+'-'+i.name) elif ps == "s" and wp == "wp": f.write(ipath+i.name+'\n') elif ps == "s" and wp == "nwp": f.write(len(stack)*'\t'+'-'+i.name) #listing directorie and going inside it elif os.path.isdir(ipath+i.name): if ps == "p" and wp == "wp": print(ipath+i.name+'\n') elif ps == "p" and wp == "nwp": print(len(stack)*'\t'+'-'+i.name) elif ps == "s" and wp == "wp": f.write(ipath+i.name+'\n') elif ps == "s" and wp == "nwp": f.write(len(stack)*'\t'+'-'+i.name) stackUpdate(i.name,'a') buildPath() #keepRec() datas() stackUpdate(ipath, 'p') buildPath() parser = argparse.ArgumentParser() parser.add_argument("Path", help = "Enter Main Path (path of directory inside which you want list)") parser.add_argument("Print_Store", help = "Print or Store Output", choices = ["p","s"]) parser.add_argument("With_Without_Path", help = "What you want output with full path or without path(Only Name) ?", choices = ["wp","nwp"]) args = parser.parse_args() path = args.Path ps = args.Print_Store wp = args.With_Without_Path if ps == "s": f = open('Output.txt','w') datas() if ps == "s": f.close() #print(unordereddat)#Gives a dictionary with key = Folder name, values =[file1,file2,file3] #Note: Uncomment keepRec above in code frist
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 30004, 13, 15945, 19451, 13, 20399, 373, 12178, 2610, 259, 29896, 29871, 29896, 29947, 29901, 29906, 29953, 29901, 29906, 29947, 29871, 29906, 29900, 29906, 29896, 30004, 13, 30004, 13, 29992, 8921, 29901, 633, 29882, 388, 30004, 13, 30004, 13, 3259, 29901, 29871, 29900, 29889, 29900, 29889, 29896, 30004, 13, 30004, 13, 15945, 19451, 13, 30004, 13, 5215, 2897, 29892, 1191, 5510, 30004, 13, 30004, 13, 1429, 353, 5159, 30004, 13, 12008, 30004, 13, 7264, 338, 501, 8485, 408, 263, 3884, 29898, 12083, 29914, 2084, 29897, 4879, 2861, 304, 967, 2875, 310, 17705, 5800, 30004, 13, 3112, 29915, 29879, 1833, 1543, 338, 1857, 3884, 9626, 18862, 30004, 13, 12008, 30004, 13, 30004, 13, 666, 493, 353, 6629, 30004, 13, 12008, 30004, 13, 4013, 338, 278, 2224, 1754, 1432, 931, 746, 591, 4337, 515, 30004, 13, 12322, 304, 3884, 30004, 13, 29924, 12535, 491, 773, 10292, 30004, 13, 12008, 30004, 13, 30004, 13, 348, 21693, 4130, 353, 6571, 30004, 13, 12008, 30004, 13, 1469, 2715, 746, 263, 3884, 338, 1476, 30004, 13, 387, 29889, 10998, 17870, 9464, 2396, 29961, 1445, 29896, 29892, 3972, 29906, 29892, 1445, 29906, 1402, 29915, 3972, 29906, 2396, 29961, 1445, 29945, 29892, 1445, 29953, 29962, 8117, 13, 30004, 13, 9842, 29901, 2525, 9342, 19152, 4789, 565, 366, 864, 304, 671, 22993, 13, 12008, 30004, 13, 30004, 13, 1753, 5096, 6422, 29898, 3972, 29878, 29892, 16453, 1125, 30004, 13, 1678, 14550, 30004, 13, 1678, 8011, 2675, 304, 2767, 1244, 746, 3734, 30004, 13, 1678, 8011, 3734, 746, 591, 505, 304, 748, 1250, 470, 6375, 30004, 13, 1678, 297, 263, 3884, 29898, 2084, 467, 30004, 13, 1678, 6756, 13, 1678, 3940, 29901, 10401, 1310, 437, 5096, 6422, 2337, 437, 2048, 6422, 30004, 13, 1678, 14550, 30004, 13, 1678, 5534, 5096, 30004, 13, 1678, 565, 5858, 1275, 525, 29874, 2396, 30004, 13, 4706, 5096, 29889, 4397, 29898, 3972, 29878, 8443, 13, 1678, 25342, 5858, 1275, 525, 29886, 29915, 322, 7431, 29898, 1429, 29897, 2804, 29871, 29900, 29901, 30004, 13, 4706, 5096, 29889, 7323, 26471, 13, 30004, 13, 1753, 2048, 2605, 7295, 30004, 13, 1678, 14550, 30004, 13, 1678, 910, 338, 2675, 304, 2048, 2224, 363, 502, 773, 5096, 22993, 13, 1678, 6756, 13, 1678, 3940, 29901, 10401, 1310, 437, 5096, 6422, 2337, 437, 2048, 6422, 30004, 13, 1678, 6756, 13, 1678, 14550, 30004, 13, 1678, 5534, 5096, 29892, 666, 493, 29892, 2084, 30004, 13, 1678, 474, 2084, 353, 2224, 30004, 13, 1678, 565, 7431, 29898, 1429, 29897, 1405, 29871, 29900, 29901, 30004, 13, 4706, 363, 474, 297, 3464, 29898, 29900, 29892, 2435, 29898, 1429, 22164, 30004, 13, 9651, 474, 2084, 353, 474, 2084, 718, 5096, 29961, 29875, 29962, 718, 8207, 29915, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 474, 2084, 353, 2224, 30004, 13, 30004, 13, 30004, 13, 1753, 3013, 4789, 7295, 29937, 3664, 3734, 313, 27636, 8443, 13, 1678, 14550, 30004, 13, 1678, 501, 8485, 304, 3013, 2407, 310, 1269, 322, 1432, 2066, 297, 263, 3884, 22993, 13, 1678, 739, 1818, 367, 2000, 304, 437, 577, 22993, 13, 1678, 319, 8600, 411, 1820, 353, 383, 3194, 1024, 29892, 1819, 353, 29961, 1445, 29896, 29892, 1445, 29906, 29892, 1445, 29941, 29962, 30004, 13, 1678, 6756, 13, 1678, 14550, 30004, 13, 1678, 5534, 443, 21693, 4130, 29892, 666, 493, 29892, 1429, 30004, 13, 1678, 2066, 353, 5159, 30004, 13, 1678, 411, 2897, 29889, 1557, 392, 381, 29898, 666, 493, 29897, 408, 875, 29901, 30004, 13, 4706, 363, 474, 297, 875, 29901, 30004, 13, 9651, 2066, 29889, 4397, 29898, 29875, 29889, 978, 8443, 13, 1678, 6756, 13, 1678, 1018, 29901, 30004, 13, 4706, 270, 2076, 353, 5096, 14352, 29896, 29962, 30004, 13, 1678, 5174, 29901, 30004, 13, 4706, 396, 1454, 278, 1424, 391, 931, 30004, 13, 4706, 270, 2076, 353, 2224, 30004, 13, 1678, 443, 21693, 4130, 29961, 29881, 2076, 29962, 353, 2066, 30004, 13, 30004, 13, 1753, 6155, 7295, 30004, 13, 1678, 14550, 30004, 13, 1678, 910, 740, 338, 2675, 304, 437, 1749, 3935, 664, 310, 18028, 30004, 13, 1678, 2066, 322, 17525, 1797, 19396, 22993, 13, 1678, 6756, 13, 1678, 14550, 30004, 13, 1678, 6756, 13, 1678, 5534, 6529, 29892, 11912, 29892, 29888, 30004, 13, 1678, 6756, 13, 1678, 2048, 2605, 26471, 13, 1678, 396, 17462, 4789, 26471, 13, 1678, 6756, 13, 1678, 411, 2897, 29889, 1557, 392, 381, 29898, 666, 493, 29897, 408, 875, 29901, 30004, 13, 4706, 363, 474, 297, 875, 29901, 30004, 13, 9651, 6756, 13, 9651, 396, 1761, 292, 599, 2066, 30004, 13, 9651, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 666, 493, 29974, 29875, 29889, 978, 1125, 30004, 13, 18884, 565, 6529, 1275, 376, 29886, 29908, 322, 19247, 1275, 376, 11912, 1115, 30004, 13, 462, 1678, 1596, 29898, 666, 493, 29974, 29875, 29889, 978, 29974, 12764, 29876, 1495, 30004, 13, 18884, 25342, 6529, 1275, 376, 29886, 29908, 322, 19247, 1275, 376, 29876, 11912, 1115, 30004, 13, 462, 1678, 1596, 29898, 2435, 29898, 1429, 11877, 12764, 29873, 18717, 28560, 18717, 29875, 29889, 978, 8443, 13, 18884, 25342, 6529, 1275, 376, 29879, 29908, 322, 19247, 1275, 376, 11912, 1115, 30004, 13, 462, 1678, 285, 29889, 3539, 29898, 666, 493, 29974, 29875, 29889, 978, 29974, 12764, 29876, 1495, 30004, 13, 18884, 25342, 6529, 1275, 376, 29879, 29908, 322, 19247, 1275, 376, 29876, 11912, 1115, 30004, 13, 462, 1678, 285, 29889, 3539, 29898, 2435, 29898, 1429, 11877, 12764, 29873, 18717, 28560, 18717, 29875, 29889, 978, 8443, 13, 9651, 6756, 13, 9651, 396, 1761, 292, 1513, 7661, 322, 2675, 2768, 372, 30004, 13, 9651, 25342, 2897, 29889, 2084, 29889, 275, 3972, 29898, 666, 493, 29974, 29875, 29889, 978, 1125, 30004, 13, 18884, 565, 6529, 1275, 376, 29886, 29908, 322, 19247, 1275, 376, 11912, 1115, 30004, 13, 462, 1678, 1596, 29898, 666, 493, 29974, 29875, 29889, 978, 29974, 12764, 29876, 1495, 30004, 13, 18884, 25342, 6529, 1275, 376, 29886, 29908, 322, 19247, 1275, 376, 29876, 11912, 1115, 30004, 13, 462, 1678, 1596, 29898, 2435, 29898, 1429, 11877, 12764, 29873, 18717, 28560, 18717, 29875, 29889, 978, 8443, 13, 18884, 25342, 6529, 1275, 376, 29879, 29908, 322, 19247, 1275, 376, 11912, 1115, 30004, 13, 462, 1678, 285, 29889, 3539, 29898, 666, 493, 29974, 29875, 29889, 978, 29974, 12764, 29876, 1495, 30004, 13, 18884, 25342, 6529, 1275, 376, 29879, 29908, 322, 19247, 1275, 376, 29876, 11912, 1115, 30004, 13, 462, 1678, 285, 29889, 3539, 29898, 2435, 29898, 1429, 11877, 12764, 29873, 18717, 28560, 18717, 29875, 29889, 978, 8443, 13, 18884, 6756, 13, 18884, 5096, 6422, 29898, 29875, 29889, 978, 5501, 29874, 1495, 30004, 13, 18884, 2048, 2605, 26471, 13, 18884, 396, 17462, 4789, 26471, 13, 18884, 6155, 26471, 13, 18884, 5096, 6422, 29898, 666, 493, 29892, 525, 29886, 1495, 30004, 13, 18884, 2048, 2605, 26471, 13, 18884, 6756, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 26471, 13, 16680, 29889, 1202, 29918, 23516, 703, 2605, 613, 1371, 353, 376, 10399, 4241, 10802, 313, 2084, 310, 3884, 2768, 607, 366, 864, 1051, 25760, 30004, 13, 16680, 29889, 1202, 29918, 23516, 703, 11816, 29918, 9044, 613, 1371, 353, 376, 11816, 470, 14491, 10604, 613, 19995, 353, 6796, 29886, 3284, 29879, 20068, 30004, 13, 16680, 29889, 1202, 29918, 23516, 703, 3047, 29918, 3047, 449, 29918, 2605, 613, 1371, 353, 376, 5618, 366, 864, 1962, 411, 2989, 2224, 29871, 470, 1728, 2224, 29898, 11730, 4408, 29897, 1577, 613, 19995, 353, 6796, 11912, 3284, 29876, 11912, 20068, 30004, 13, 30004, 13, 5085, 353, 13812, 29889, 5510, 29918, 5085, 26471, 13, 30004, 13, 2084, 353, 6389, 29889, 2605, 30004, 13, 567, 353, 6389, 29889, 11816, 29918, 9044, 30004, 13, 11912, 353, 6389, 29889, 3047, 29918, 3047, 449, 29918, 2605, 30004, 13, 30004, 13, 361, 6529, 1275, 376, 29879, 1115, 30004, 13, 1678, 285, 353, 1722, 877, 6466, 29889, 3945, 3788, 29893, 1495, 30004, 13, 30004, 13, 14538, 26471, 13, 30004, 13, 361, 6529, 1275, 376, 29879, 1115, 30004, 13, 1678, 285, 29889, 5358, 26471, 13, 30004, 13, 29937, 2158, 29898, 348, 21693, 4130, 29897, 29937, 29954, 3145, 263, 8600, 411, 1820, 353, 383, 3194, 1024, 29892, 1819, 353, 29961, 1445, 29896, 29892, 1445, 29906, 29892, 1445, 29941, 29962, 30004, 13, 29937, 9842, 29901, 853, 9342, 3013, 4789, 2038, 297, 775, 1424, 391, 30004, 13, 2 ]
src/kgmk/cp/read_stdin.py
kagemeka/python
0
1603593
import typing class ReadStdin: def __call__( self, ) -> bytes: return next(self.__chunks) def __init__( self, ) -> typing.NoReturn: import sys self.__buf = ( sys.stdin.buffer ) self.__chunks = ( self.__read_chunks() ) def int( self, ) -> int: return int(self()) def __read_chunks( self, ) -> typing.Iterator[bytes]: while 1: l = self.__buf.readline() for chunk in l.split(): yield chunk def str( self, ) -> str: b = self() return b.decode()
[ 1, 1053, 19229, 13, 13, 13, 13, 1990, 7523, 855, 24581, 29901, 13, 29871, 822, 4770, 4804, 12035, 13, 1678, 1583, 29892, 13, 29871, 1723, 1599, 6262, 29901, 13, 1678, 736, 2446, 29898, 1311, 17255, 305, 18801, 29897, 13, 268, 13, 13, 29871, 822, 4770, 2344, 12035, 13, 1678, 1583, 29892, 13, 29871, 1723, 1599, 19229, 29889, 3782, 11609, 29901, 13, 1678, 1053, 10876, 13, 1678, 1583, 17255, 9721, 353, 313, 13, 418, 10876, 29889, 4172, 262, 29889, 9040, 13, 1678, 1723, 13, 1678, 1583, 17255, 305, 18801, 353, 313, 13, 418, 1583, 17255, 949, 29918, 305, 18801, 580, 13, 1678, 1723, 13, 13, 13, 29871, 822, 938, 29898, 13, 1678, 1583, 29892, 13, 29871, 1723, 1599, 938, 29901, 13, 1678, 736, 938, 29898, 1311, 3101, 13, 13, 13, 29871, 822, 4770, 949, 29918, 305, 18801, 29898, 13, 1678, 1583, 29892, 13, 29871, 1723, 1599, 19229, 29889, 20277, 29961, 13193, 5387, 13, 1678, 1550, 29871, 29896, 29901, 13, 418, 301, 353, 1583, 17255, 9721, 29889, 949, 1220, 580, 13, 418, 363, 19875, 297, 301, 29889, 5451, 7295, 13, 4706, 7709, 19875, 13, 259, 13, 13, 29871, 822, 851, 29898, 13, 1678, 1583, 29892, 13, 29871, 1723, 1599, 851, 29901, 13, 1678, 289, 353, 1583, 580, 13, 1678, 736, 289, 29889, 13808, 580, 2 ]
chapter_13/pymail.py
bimri/programming_python
0
12819
"A Console-Based Email Client" #!/usr/local/bin/python """ ########################################################################## pymail - a simple console email interface client in Python; uses Python poplib module to view POP email messages, smtplib to send new mails, and the email package to extract mail headers and payload and compose mails; ########################################################################## """ import poplib, smtplib, email.utils, mailconfig from email.parser import Parser from email.message import Message fetchEncoding = mailconfig.fetchEncoding def decodeToUnicode(messageBytes, fetchEncoding=fetchEncoding): """ 4E, Py3.1: decode fetched bytes to str Unicode string for display or parsing; use global setting (or by platform default, hdrs inspection, intelligent guess); in Python 3.2/3.3, this step may not be required: if so, return message intact; """ return [line.decode(fetchEncoding) for line in messageBytes] def splitaddrs(field): """ 4E: split address list on commas, allowing for commas in name parts """ pairs = email.utils.getaddresses([field]) # [(name,addr)] return [email.utils.formataddr(pair) for pair in pairs] # [name <addr>] def inputmessage(): import sys From = input('From? ').strip() To = input('To? ').strip() # datetime hdr may be set auto To = splitaddrs(To) # possible many, name+<addr> okay Subj = input('Subj? ').strip() # don't split blindly on ',' or ';' print('Type message text, end with line="."') text = '' while True: line = sys.stdin.readline() if line == '.\n': break text += line return From, To, Subj, text def sendmessage(): From, To, Subj, text = inputmessage() msg = Message() msg['From'] = From msg['To'] = ', '.join(To) # join for hdr, not send msg['Subject'] = Subj msg['Date'] = email.utils.formatdate() # curr datetime, rfc2822 msg.set_payload(text) server = smtplib.SMTP(mailconfig.smtpservername) try: failed = server.sendmail(From, To, str(msg)) # may also raise exc except: print('Error - send failed') else: if failed: print('Failed:', failed) def connect(servername, user, passwd): print('Connecting...') server = poplib.POP3(servername) server.user(user) # connect, log in to mail server server.pass_(passwd) # pass is a reserved word print(server.getwelcome()) # print returned greeting message return server def loadmessages(servername, user, passwd, loadfrom=1): server = connect(servername, user, passwd) try: print(server.list()) (msgCount, msgBytes) = server.stat() print('There are', msgCount, 'mail messages in', msgBytes, 'bytes') print('Retrieving...') msgList = [] # fetch mail now for i in range(loadfrom, msgCount+1): # empty if low >= high (hdr, message, octets) = server.retr(i) # save text on list message = decodeToUnicode(message) # 4E, Py3.1: bytes to str msgList.append('\n'.join(message)) # leave mail on server finally: server.quit() # unlock the mail box assert len(msgList) == (msgCount - loadfrom) + 1 # msg nums start at 1 return msgList def deletemessages(servername, user, passwd, toDelete, verify=True): print('To be deleted:', toDelete) if verify and input('Delete?')[:1] not in ['y', 'Y']: print('Delete cancelled.') else: server = connect(servername, user, passwd) try: print('Deleting messages from server...') for msgnum in toDelete: # reconnect to delete mail server.dele(msgnum) # mbox locked until quit() finally: server.quit() def showindex(msgList): count = 0 # show some mail headers for msgtext in msgList: msghdrs = Parser().parsestr(msgtext, headersonly=True) # expects str in 3.1 count += 1 print('%d:\t%d bytes' % (count, len(msgtext))) for hdr in ('From', 'To', 'Date', 'Subject'): try: print('\t%-8s=>%s' % (hdr, msghdrs[hdr])) except KeyError: print('\t%-8s=>(unknown)' % hdr) if count % 5 == 0: input('[Press Enter key]') # pause after each 5 def showmessage(i, msgList): if 1 <= i <= len(msgList): #print(msgList[i-1]) # old: prints entire mail--hdrs+text print('-' * 79) msg = Parser().parsestr(msgList[i-1]) # expects str in 3.1 content = msg.get_payload() # prints payload: string, or [Messages] if isinstance(content, str): # keep just one end-line at end content = content.rstrip() + '\n' print(content) print('-' * 79) # to get text only, see email.parsers else: print('Bad message number') def savemessage(i, mailfile, msgList): if 1 <= i <= len(msgList): savefile = open(mailfile, 'a', encoding=mailconfig.fetchEncoding) # 4E savefile.write('\n' + msgList[i-1] + '-'*80 + '\n') else: print('Bad message number') def msgnum(command): try: return int(command.split()[1]) except: return -1 # assume this is bad helptext = """ Available commands: i - index display l n? - list all messages (or just message n) d n? - mark all messages for deletion (or just message n) s n? - save all messages to a file (or just message n) m - compose and send a new mail message q - quit pymail ? - display this help text """ def interact(msgList, mailfile): showindex(msgList) toDelete = [] while True: try: command = input('[Pymail] Action? (i, l, d, s, m, q, ?) ') except EOFError: command = 'q' if not command: command = '*' # quit if command == 'q': break # index elif command[0] == 'i': showindex(msgList) # list elif command[0] == 'l': if len(command) == 1: for i in range(1, len(msgList)+1): showmessage(i, msgList) else: showmessage(msgnum(command), msgList) # save elif command[0] == 's': if len(command) == 1: for i in range(1, len(msgList)+1): savemessage(i, mailfile, msgList) else: savemessage(msgnum(command), mailfile, msgList) # delete elif command[0] == 'd': if len(command) == 1: # delete all later toDelete = list(range(1, len(msgList)+1)) # 3.x requires list else: delnum = msgnum(command) if (1 <= delnum <= len(msgList)) and (delnum not in toDelete): toDelete.append(delnum) else: print('Bad message number') # mail elif command[0] == 'm': # send a new mail via SMTP sendmessage() #execfile('smtpmail.py', {}) # alt: run file in own namespace elif command[0] == '?': print(helptext) else: print('What? -- type "?" for commands help') return toDelete if __name__ == '__main__': import getpass, mailconfig mailserver = mailconfig.popservername # ex: 'pop.rmi.net' mailuser = mailconfig.popusername # ex: 'lutz' mailfile = mailconfig.savemailfile # ex: r'c:\stuff\savemail' mailpswd = getpass.getpass('Password for %s?' % mailserver) print('[Pymail email client]') msgList = loadmessages(mailserver, mailuser, mailpswd) # load all toDelete = interact(msgList, mailfile) if toDelete: deletemessages(mailserver, mailuser, mailpswd, toDelete) print('Bye.')
[ 1, 376, 29909, 9405, 29899, 29933, 1463, 22608, 12477, 29908, 13, 13, 29937, 14708, 4855, 29914, 2997, 29914, 2109, 29914, 4691, 13, 15945, 29908, 13, 13383, 13383, 13383, 13383, 7346, 2277, 13, 2272, 2549, 448, 263, 2560, 2991, 4876, 5067, 3132, 297, 5132, 29936, 3913, 5132, 13, 7323, 1982, 3883, 304, 1776, 349, 4590, 4876, 7191, 29892, 1560, 9392, 1982, 304, 3638, 716, 611, 2719, 29892, 322, 13, 1552, 4876, 3577, 304, 6597, 10524, 9066, 322, 20092, 322, 27435, 611, 2719, 29936, 13, 13383, 13383, 13383, 13383, 7346, 2277, 13, 15945, 29908, 13, 13, 5215, 1835, 1982, 29892, 1560, 9392, 1982, 29892, 4876, 29889, 13239, 29892, 10524, 2917, 13, 3166, 4876, 29889, 16680, 29871, 1053, 1459, 643, 13, 3166, 4876, 29889, 4906, 1053, 7777, 13, 9155, 14934, 353, 10524, 2917, 29889, 9155, 14934, 13, 13, 1753, 21822, 1762, 2525, 12858, 29898, 4906, 11207, 29892, 6699, 14934, 29922, 9155, 14934, 1125, 13, 1678, 9995, 13, 268, 29946, 29923, 29892, 10772, 29941, 29889, 29896, 29901, 21822, 6699, 287, 6262, 304, 851, 23862, 1347, 363, 2479, 470, 13755, 29936, 13, 1678, 671, 5534, 4444, 313, 272, 491, 7481, 2322, 29892, 298, 29881, 2288, 1663, 27988, 29892, 13052, 296, 4140, 416, 13, 1678, 297, 5132, 29871, 29941, 29889, 29906, 29914, 29941, 29889, 29941, 29892, 445, 4331, 1122, 451, 367, 3734, 29901, 565, 577, 29892, 736, 2643, 938, 627, 29936, 13, 1678, 9995, 13, 1678, 736, 518, 1220, 29889, 13808, 29898, 9155, 14934, 29897, 363, 1196, 297, 2643, 11207, 29962, 13, 13, 1753, 6219, 1202, 2288, 29898, 2671, 1125, 13, 1678, 9995, 13, 268, 29946, 29923, 29901, 6219, 3211, 1051, 373, 844, 294, 29892, 14372, 363, 844, 294, 297, 1024, 5633, 13, 1678, 9995, 13, 1678, 11000, 353, 4876, 29889, 13239, 29889, 657, 7328, 267, 4197, 2671, 2314, 462, 396, 17288, 978, 29892, 10030, 4638, 13, 1678, 736, 518, 5269, 29889, 13239, 29889, 4830, 10030, 29898, 18784, 29897, 363, 5101, 297, 11000, 29962, 259, 396, 518, 978, 529, 10030, 29958, 29962, 259, 13, 13, 1753, 1881, 4906, 7295, 13, 1678, 1053, 10876, 13, 1678, 3645, 353, 1881, 877, 4591, 29973, 525, 467, 17010, 580, 13, 1678, 1763, 259, 353, 1881, 877, 1762, 29973, 259, 525, 467, 17010, 580, 965, 396, 12865, 298, 7707, 1122, 367, 731, 4469, 13, 1678, 1763, 259, 353, 6219, 1202, 2288, 29898, 1762, 29897, 462, 1678, 396, 1950, 1784, 29892, 1024, 29974, 29966, 10030, 29958, 20759, 13, 1678, 3323, 29926, 353, 1881, 877, 4035, 29926, 29973, 525, 467, 17010, 580, 965, 396, 1016, 29915, 29873, 6219, 16842, 368, 373, 525, 5501, 470, 21921, 29915, 13, 1678, 1596, 877, 1542, 2643, 1426, 29892, 1095, 411, 1196, 543, 1213, 1495, 13, 1678, 1426, 353, 6629, 13, 1678, 1550, 5852, 29901, 13, 4706, 1196, 353, 10876, 29889, 4172, 262, 29889, 949, 1220, 580, 13, 4706, 565, 1196, 1275, 525, 7790, 29876, 2396, 2867, 13, 4706, 1426, 4619, 1196, 13, 1678, 736, 3645, 29892, 1763, 29892, 3323, 29926, 29892, 1426, 13, 13, 1753, 3638, 4906, 7295, 13, 1678, 3645, 29892, 1763, 29892, 3323, 29926, 29892, 1426, 353, 1881, 4906, 580, 13, 1678, 10191, 353, 7777, 580, 13, 1678, 10191, 1839, 4591, 2033, 1678, 353, 3645, 13, 1678, 10191, 1839, 1762, 2033, 418, 353, 13420, 15300, 7122, 29898, 1762, 29897, 462, 268, 396, 5988, 363, 298, 7707, 29892, 451, 3638, 13, 1678, 10191, 1839, 20622, 2033, 353, 3323, 29926, 13, 1678, 10191, 1839, 2539, 2033, 1678, 353, 4876, 29889, 13239, 29889, 4830, 1256, 580, 3986, 396, 16256, 12865, 29892, 364, 13801, 29906, 29947, 29906, 29906, 13, 1678, 10191, 29889, 842, 29918, 23813, 29898, 726, 29897, 13, 1678, 1923, 353, 1560, 9392, 1982, 29889, 17061, 3557, 29898, 2549, 2917, 29889, 3844, 29873, 567, 261, 369, 978, 29897, 13, 1678, 1018, 29901, 13, 4706, 5229, 353, 1923, 29889, 6717, 2549, 29898, 4591, 29892, 1763, 29892, 851, 29898, 7645, 876, 259, 396, 1122, 884, 12020, 5566, 13, 1678, 5174, 29901, 13, 4706, 1596, 877, 2392, 448, 3638, 5229, 1495, 13, 1678, 1683, 29901, 13, 4706, 565, 5229, 29901, 1596, 877, 17776, 29901, 742, 5229, 29897, 13, 13, 1753, 4511, 29898, 2974, 978, 29892, 1404, 29892, 1209, 9970, 1125, 13, 1678, 1596, 877, 17918, 292, 856, 1495, 13, 1678, 1923, 353, 1835, 1982, 29889, 29925, 4590, 29941, 29898, 2974, 978, 29897, 13, 1678, 1923, 29889, 1792, 29898, 1792, 29897, 462, 268, 396, 4511, 29892, 1480, 297, 304, 10524, 1923, 13, 1678, 1923, 29889, 3364, 23538, 3364, 9970, 29897, 462, 29871, 396, 1209, 338, 263, 21676, 1734, 13, 1678, 1596, 29898, 2974, 29889, 657, 20466, 2763, 3101, 9651, 396, 1596, 4133, 1395, 15133, 2643, 13, 1678, 736, 1923, 13, 13, 1753, 2254, 19158, 29898, 2974, 978, 29892, 1404, 29892, 1209, 9970, 29892, 2254, 3166, 29922, 29896, 1125, 13, 1678, 1923, 353, 4511, 29898, 2974, 978, 29892, 1404, 29892, 1209, 9970, 29897, 13, 1678, 1018, 29901, 13, 4706, 1596, 29898, 2974, 29889, 1761, 3101, 13, 4706, 313, 7645, 3981, 29892, 10191, 11207, 29897, 353, 1923, 29889, 6112, 580, 13, 4706, 1596, 877, 8439, 526, 742, 10191, 3981, 29892, 525, 2549, 7191, 297, 742, 10191, 11207, 29892, 525, 13193, 1495, 13, 4706, 1596, 877, 8015, 2546, 1747, 856, 1495, 13, 4706, 10191, 1293, 353, 5159, 462, 462, 268, 396, 6699, 10524, 1286, 13, 4706, 363, 474, 297, 3464, 29898, 1359, 3166, 29892, 10191, 3981, 29974, 29896, 1125, 9651, 396, 4069, 565, 4482, 6736, 1880, 13, 9651, 313, 29882, 7707, 29892, 2643, 29892, 4725, 1691, 29897, 353, 1923, 29889, 276, 509, 29898, 29875, 29897, 418, 396, 4078, 1426, 373, 1051, 13, 9651, 2643, 353, 21822, 1762, 2525, 12858, 29898, 4906, 29897, 965, 396, 29871, 29946, 29923, 29892, 10772, 29941, 29889, 29896, 29901, 6262, 304, 851, 13, 9651, 10191, 1293, 29889, 4397, 28909, 29876, 4286, 7122, 29898, 4906, 876, 965, 396, 5967, 10524, 373, 1923, 13, 1678, 7146, 29901, 13, 4706, 1923, 29889, 28358, 580, 462, 462, 1678, 396, 443, 908, 278, 10524, 3800, 13, 1678, 4974, 7431, 29898, 7645, 1293, 29897, 1275, 313, 7645, 3981, 448, 2254, 3166, 29897, 718, 29871, 29896, 268, 396, 10191, 954, 29879, 1369, 472, 29871, 29896, 13, 1678, 736, 10191, 1293, 13, 13, 1753, 7374, 331, 404, 1179, 29898, 2974, 978, 29892, 1404, 29892, 1209, 9970, 29892, 304, 12498, 29892, 11539, 29922, 5574, 1125, 13, 1678, 1596, 877, 1762, 367, 11132, 29901, 742, 304, 12498, 29897, 13, 1678, 565, 11539, 322, 1881, 877, 12498, 29973, 1495, 7503, 29896, 29962, 451, 297, 6024, 29891, 742, 525, 29979, 2033, 29901, 13, 4706, 1596, 877, 12498, 12611, 839, 29889, 1495, 13, 1678, 1683, 29901, 13, 4706, 1923, 353, 4511, 29898, 2974, 978, 29892, 1404, 29892, 1209, 9970, 29897, 13, 4706, 1018, 29901, 13, 9651, 1596, 877, 2772, 1026, 292, 7191, 515, 1923, 856, 1495, 13, 9651, 363, 10191, 1949, 297, 304, 12498, 29901, 462, 396, 337, 6915, 304, 5217, 10524, 13, 18884, 1923, 29889, 311, 280, 29898, 7645, 1949, 29897, 462, 396, 286, 1884, 22822, 2745, 23283, 580, 13, 4706, 7146, 29901, 13, 9651, 1923, 29889, 28358, 580, 13, 13, 1753, 1510, 2248, 29898, 7645, 1293, 1125, 13, 1678, 2302, 353, 29871, 29900, 462, 462, 539, 396, 1510, 777, 10524, 9066, 13, 1678, 363, 10191, 726, 297, 10191, 1293, 29901, 13, 4706, 10191, 16440, 2288, 353, 1459, 643, 2141, 862, 29879, 16444, 29898, 7645, 726, 29892, 2343, 1330, 368, 29922, 5574, 29897, 29871, 396, 23347, 851, 297, 29871, 29941, 29889, 29896, 13, 4706, 2302, 4619, 29871, 29896, 13, 4706, 1596, 877, 29995, 29881, 3583, 29873, 29995, 29881, 6262, 29915, 1273, 313, 2798, 29892, 7431, 29898, 7645, 726, 4961, 13, 4706, 363, 298, 7707, 297, 6702, 4591, 742, 525, 1762, 742, 525, 2539, 742, 525, 20622, 29374, 13, 9651, 1018, 29901, 13, 18884, 1596, 28909, 29873, 29995, 29899, 29947, 29879, 4261, 29995, 29879, 29915, 1273, 313, 29882, 7707, 29892, 10191, 16440, 2288, 29961, 29882, 7707, 12622, 13, 9651, 5174, 7670, 2392, 29901, 13, 18884, 1596, 28909, 29873, 29995, 29899, 29947, 29879, 4261, 29898, 26690, 16029, 1273, 298, 7707, 29897, 13, 4706, 565, 2302, 1273, 29871, 29945, 1275, 29871, 29900, 29901, 13, 9651, 1881, 877, 29961, 10923, 9041, 1820, 29962, 1495, 29871, 396, 19957, 1156, 1269, 29871, 29945, 13, 13, 1753, 1510, 4906, 29898, 29875, 29892, 10191, 1293, 1125, 13, 1678, 565, 29871, 29896, 5277, 474, 5277, 7431, 29898, 7645, 1293, 1125, 13, 539, 396, 2158, 29898, 7645, 1293, 29961, 29875, 29899, 29896, 2314, 632, 396, 2030, 29901, 14677, 4152, 10524, 489, 16440, 2288, 29974, 726, 13, 4706, 1596, 877, 29899, 29915, 334, 29871, 29955, 29929, 29897, 13, 4706, 10191, 353, 1459, 643, 2141, 862, 29879, 16444, 29898, 7645, 1293, 29961, 29875, 29899, 29896, 2314, 418, 396, 23347, 851, 297, 29871, 29941, 29889, 29896, 13, 4706, 2793, 353, 10191, 29889, 657, 29918, 23813, 580, 268, 396, 14677, 20092, 29901, 1347, 29892, 470, 518, 25510, 29962, 13, 4706, 565, 338, 8758, 29898, 3051, 29892, 851, 1125, 1678, 396, 3013, 925, 697, 1095, 29899, 1220, 472, 1095, 13, 9651, 2793, 353, 2793, 29889, 29878, 17010, 580, 718, 11297, 29876, 29915, 13, 4706, 1596, 29898, 3051, 29897, 13, 4706, 1596, 877, 29899, 29915, 334, 29871, 29955, 29929, 29897, 462, 396, 304, 679, 1426, 871, 29892, 1074, 4876, 29889, 862, 4253, 13, 1678, 1683, 29901, 13, 4706, 1596, 877, 22050, 2643, 1353, 1495, 13, 13, 1753, 4048, 331, 1448, 29898, 29875, 29892, 10524, 1445, 29892, 10191, 1293, 1125, 13, 1678, 565, 29871, 29896, 5277, 474, 5277, 7431, 29898, 7645, 1293, 1125, 13, 4706, 4078, 1445, 353, 1722, 29898, 2549, 1445, 29892, 525, 29874, 742, 8025, 29922, 2549, 2917, 29889, 9155, 14934, 29897, 29871, 396, 29871, 29946, 29923, 13, 4706, 4078, 1445, 29889, 3539, 28909, 29876, 29915, 718, 10191, 1293, 29961, 29875, 29899, 29896, 29962, 718, 17411, 29915, 29930, 29947, 29900, 718, 11297, 29876, 1495, 13, 1678, 1683, 29901, 13, 4706, 1596, 877, 22050, 2643, 1353, 1495, 13, 13, 1753, 10191, 1949, 29898, 6519, 1125, 13, 1678, 1018, 29901, 13, 4706, 736, 938, 29898, 6519, 29889, 5451, 580, 29961, 29896, 2314, 13, 1678, 5174, 29901, 13, 4706, 736, 448, 29896, 259, 396, 5251, 445, 338, 4319, 13, 13, 8477, 726, 353, 9995, 13, 27635, 8260, 29901, 13, 29875, 268, 448, 2380, 2479, 13, 29880, 302, 29973, 29871, 448, 1051, 599, 7191, 313, 272, 925, 2643, 302, 29897, 13, 29881, 302, 29973, 29871, 448, 2791, 599, 7191, 363, 7374, 291, 313, 272, 925, 2643, 302, 29897, 13, 29879, 302, 29973, 29871, 448, 4078, 599, 7191, 304, 263, 934, 313, 272, 925, 2643, 302, 29897, 13, 29885, 268, 448, 27435, 322, 3638, 263, 716, 10524, 2643, 13, 29939, 268, 448, 23283, 11451, 2549, 13, 29973, 268, 448, 2479, 445, 1371, 1426, 13, 15945, 29908, 13, 13, 1753, 16254, 29898, 7645, 1293, 29892, 10524, 1445, 1125, 13, 1678, 1510, 2248, 29898, 7645, 1293, 29897, 13, 1678, 304, 12498, 353, 5159, 13, 1678, 1550, 5852, 29901, 13, 4706, 1018, 29901, 13, 9651, 1899, 353, 1881, 877, 29961, 19737, 2549, 29962, 9123, 29973, 313, 29875, 29892, 301, 29892, 270, 29892, 269, 29892, 286, 29892, 3855, 29892, 1577, 29897, 25710, 13, 4706, 5174, 382, 9800, 2392, 29901, 13, 9651, 1899, 353, 525, 29939, 29915, 13, 4706, 565, 451, 1899, 29901, 1899, 353, 525, 29930, 29915, 13, 13, 4706, 396, 23283, 13, 4706, 565, 1899, 1275, 525, 29939, 2396, 13, 9651, 2867, 13, 13, 4706, 396, 2380, 13, 4706, 25342, 1899, 29961, 29900, 29962, 1275, 525, 29875, 2396, 13, 9651, 1510, 2248, 29898, 7645, 1293, 29897, 13, 13, 4706, 396, 1051, 13, 4706, 25342, 1899, 29961, 29900, 29962, 1275, 525, 29880, 2396, 13, 9651, 565, 7431, 29898, 6519, 29897, 1275, 29871, 29896, 29901, 13, 18884, 363, 474, 297, 3464, 29898, 29896, 29892, 7431, 29898, 7645, 1293, 7240, 29896, 1125, 13, 462, 1678, 1510, 4906, 29898, 29875, 29892, 10191, 1293, 29897, 13, 9651, 1683, 29901, 13, 18884, 1510, 4906, 29898, 7645, 1949, 29898, 6519, 511, 10191, 1293, 29897, 13, 13, 4706, 396, 4078, 13, 4706, 25342, 1899, 29961, 29900, 29962, 1275, 525, 29879, 2396, 13, 9651, 565, 7431, 29898, 6519, 29897, 1275, 29871, 29896, 29901, 13, 18884, 363, 474, 297, 3464, 29898, 29896, 29892, 7431, 29898, 7645, 1293, 7240, 29896, 1125, 13, 462, 1678, 4048, 331, 1448, 29898, 29875, 29892, 10524, 1445, 29892, 10191, 1293, 29897, 13, 9651, 1683, 29901, 13, 18884, 4048, 331, 1448, 29898, 7645, 1949, 29898, 6519, 511, 10524, 1445, 29892, 10191, 1293, 29897, 13, 13, 4706, 396, 5217, 13, 4706, 25342, 1899, 29961, 29900, 29962, 1275, 525, 29881, 2396, 13, 9651, 565, 7431, 29898, 6519, 29897, 1275, 29871, 29896, 29901, 462, 3986, 396, 5217, 599, 2678, 13, 18884, 304, 12498, 353, 1051, 29898, 3881, 29898, 29896, 29892, 7431, 29898, 7645, 1293, 7240, 29896, 876, 29871, 396, 29871, 29941, 29889, 29916, 6858, 1051, 13, 9651, 1683, 29901, 13, 18884, 628, 1949, 353, 10191, 1949, 29898, 6519, 29897, 13, 18884, 565, 313, 29896, 5277, 628, 1949, 5277, 7431, 29898, 7645, 1293, 876, 322, 313, 6144, 1949, 451, 297, 304, 12498, 1125, 13, 462, 1678, 304, 12498, 29889, 4397, 29898, 6144, 1949, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 1596, 877, 22050, 2643, 1353, 1495, 13, 13, 4706, 396, 10524, 13, 4706, 25342, 1899, 29961, 29900, 29962, 1275, 525, 29885, 2396, 18884, 396, 3638, 263, 716, 10524, 3025, 13766, 3557, 13, 9651, 3638, 4906, 580, 13, 9651, 396, 4258, 1445, 877, 3844, 9392, 2549, 29889, 2272, 742, 426, 1800, 539, 396, 5272, 29901, 1065, 934, 297, 1914, 7397, 13, 13, 4706, 25342, 1899, 29961, 29900, 29962, 1275, 525, 29973, 2396, 13, 9651, 1596, 29898, 8477, 726, 29897, 13, 4706, 1683, 29901, 13, 9651, 1596, 877, 5618, 29973, 1192, 1134, 376, 3026, 363, 8260, 1371, 1495, 13, 1678, 736, 304, 12498, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1053, 679, 3364, 29892, 10524, 2917, 13, 1678, 10524, 2974, 353, 10524, 2917, 29889, 7323, 2974, 978, 4706, 396, 429, 29901, 525, 7323, 29889, 1758, 29875, 29889, 1212, 29915, 13, 1678, 10524, 1792, 259, 353, 10524, 2917, 29889, 7323, 6786, 3986, 396, 429, 29901, 525, 29880, 7427, 29915, 13, 1678, 10524, 1445, 259, 353, 10524, 2917, 29889, 29879, 485, 5269, 1445, 308, 396, 429, 29901, 29871, 364, 29915, 29883, 3583, 303, 3096, 29905, 29879, 485, 5269, 29915, 13, 1678, 10524, 567, 9970, 259, 353, 679, 3364, 29889, 657, 3364, 877, 10048, 363, 1273, 29879, 17901, 1273, 10524, 2974, 29897, 13, 1678, 1596, 877, 29961, 19737, 2549, 4876, 3132, 29962, 1495, 13, 1678, 10191, 1293, 1678, 353, 2254, 19158, 29898, 2549, 2974, 29892, 10524, 1792, 29892, 10524, 567, 9970, 29897, 268, 396, 2254, 599, 13, 1678, 304, 12498, 259, 353, 16254, 29898, 7645, 1293, 29892, 10524, 1445, 29897, 13, 1678, 565, 304, 12498, 29901, 7374, 331, 404, 1179, 29898, 2549, 2974, 29892, 10524, 1792, 29892, 10524, 567, 9970, 29892, 304, 12498, 29897, 13, 1678, 1596, 877, 2059, 29872, 29889, 1495, 13, 2 ]
pyExpenses/RecManip.py
JasonLai256/pyExpenses
1
184620
#! /usr/bin/env python # -*- coding:utf-8 -*- """ pyExpenses.RecManip ~~~~~~~~~~~~~~~~~~~ Implements the interface's object that manipulator of records for pyExpenses. :copyright: (c) 2012 by <NAME>. :license: BSD, see LICENSE for more details. """ from datetime import date, timedelta from ConfigManip import Config import RecManipImpl STORAGE_BACKEND = RecManipImpl.__dict__[Config.getInfo('StorageBackend')] class RecManip(object): def setUp(self, *args, **kwargs): """It's the method really initialize the instance. This should be called after create a instance, the passing arguments can control defferent options. """ self.impl = STORAGE_BACKEND(*args, **kwargs) def updatePassword(self, oldpwd, newpwd): self.impl.updatePassword(oldpwd, newpwd) def cancelPassword(self, oldpwd): from RecManipImpl import DEFAULT_PASSWORD self.impl.updatePassword(oldpwd, DEFAULT_PASSWORD) def addItem(self, rdate, base_rec): """add a basic record to storage.""" self.impl.addItem(rdate, base_rec) def delItem(self, rdate, base_rec): """delete a specified record. @NOTE: if date not exist,raise a exception. """ self.impl.delItem(rdate, base_rec) def updateItem(self, rdate, base_rec, new_rec): self.impl.updateItem(rdate, base_rec, new_rec) def getAll(self): return self.impl.getAll() def getInfo(self): return self.impl.getInfo() def date_range(self, begin, end): """Return a range of records in specified period. @NOTE: """ return self.impl.date_range(begin, end) def findDate(self, fdate): """find and return the matching record. @NOTE: if date not exist,raise a exception. """ return self.impl.date_range(fdate, fdate + timedelta(1)) def findDates(self, fdate, nth=0): return self.impl.date_range(fdate, fdate + timedelta(nth)) def clear(self): """clear all the data in data manipulator.""" self.impl.clear() def save(self): """save all the data in data manipulator to permanent storage.""" self.impl.save() def importRecord(self, filename): self.impl.importRecord(filename) def exportRecord(self, filename): self.impl.exportRecord(filename)
[ 1, 396, 29991, 847, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 9420, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 1678, 11451, 9544, 11259, 29889, 4789, 2517, 666, 13, 1678, 3695, 26594, 26594, 7377, 13, 13, 1678, 1954, 9711, 278, 5067, 29915, 29879, 1203, 393, 11525, 9183, 310, 6475, 363, 11451, 9544, 11259, 29889, 13, 13, 1678, 584, 8552, 1266, 29901, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29906, 491, 529, 5813, 15513, 13, 1678, 584, 506, 1947, 29901, 350, 7230, 29892, 1074, 365, 2965, 1430, 1660, 363, 901, 4902, 29889, 13, 15945, 29908, 13, 13, 3166, 12865, 1053, 2635, 29892, 5335, 287, 2554, 13, 13, 3166, 12782, 2517, 666, 1053, 12782, 13, 5215, 3599, 2517, 666, 6647, 13, 13, 1254, 1955, 10461, 29918, 29933, 11375, 11794, 353, 3599, 2517, 666, 6647, 17255, 8977, 1649, 29961, 3991, 29889, 657, 3401, 877, 10486, 5841, 355, 1495, 29962, 13, 13, 1990, 3599, 2517, 666, 29898, 3318, 1125, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 9995, 3112, 29915, 29879, 278, 1158, 2289, 11905, 278, 2777, 29889, 910, 881, 367, 13, 4706, 2000, 1156, 1653, 263, 2777, 29892, 278, 6819, 6273, 508, 2761, 13, 4706, 822, 571, 296, 3987, 29889, 13, 4706, 9995, 13, 4706, 1583, 29889, 13699, 353, 6850, 1955, 10461, 29918, 29933, 11375, 11794, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 822, 2767, 10048, 29898, 1311, 29892, 2030, 29886, 9970, 29892, 716, 29886, 9970, 1125, 13, 4706, 1583, 29889, 13699, 29889, 5504, 10048, 29898, 1025, 29886, 9970, 29892, 716, 29886, 9970, 29897, 13, 13, 1678, 822, 12611, 10048, 29898, 1311, 29892, 2030, 29886, 9970, 1125, 13, 4706, 515, 3599, 2517, 666, 6647, 1053, 22236, 29918, 25711, 17013, 13, 4706, 1583, 29889, 13699, 29889, 5504, 10048, 29898, 1025, 29886, 9970, 29892, 22236, 29918, 25711, 17013, 29897, 13, 13, 1678, 822, 788, 2001, 29898, 1311, 29892, 364, 1256, 29892, 2967, 29918, 3757, 1125, 13, 4706, 9995, 1202, 263, 6996, 2407, 304, 8635, 1213, 15945, 13, 4706, 1583, 29889, 13699, 29889, 1202, 2001, 29898, 29878, 1256, 29892, 2967, 29918, 3757, 29897, 13, 13, 1678, 822, 628, 2001, 29898, 1311, 29892, 364, 1256, 29892, 2967, 29918, 3757, 1125, 13, 4706, 9995, 8143, 263, 6790, 2407, 29889, 13, 4706, 732, 12256, 29923, 29901, 565, 2635, 451, 1863, 29892, 22692, 263, 3682, 29889, 13, 4706, 9995, 13, 4706, 1583, 29889, 13699, 29889, 6144, 2001, 29898, 29878, 1256, 29892, 2967, 29918, 3757, 29897, 13, 13, 1678, 822, 2767, 2001, 29898, 1311, 29892, 364, 1256, 29892, 2967, 29918, 3757, 29892, 716, 29918, 3757, 1125, 13, 4706, 1583, 29889, 13699, 29889, 5504, 2001, 29898, 29878, 1256, 29892, 2967, 29918, 3757, 29892, 716, 29918, 3757, 29897, 13, 13, 1678, 822, 679, 3596, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 13699, 29889, 657, 3596, 580, 13, 13, 1678, 822, 679, 3401, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 13699, 29889, 657, 3401, 580, 13, 13, 1678, 822, 2635, 29918, 3881, 29898, 1311, 29892, 3380, 29892, 1095, 1125, 13, 4706, 9995, 11609, 263, 3464, 310, 6475, 297, 6790, 3785, 29889, 13, 4706, 732, 12256, 29923, 29901, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 13699, 29889, 1256, 29918, 3881, 29898, 463, 29892, 1095, 29897, 13, 13, 1678, 822, 1284, 2539, 29898, 1311, 29892, 285, 1256, 1125, 13, 4706, 9995, 2886, 322, 736, 278, 9686, 2407, 29889, 29871, 13, 4706, 732, 12256, 29923, 29901, 565, 2635, 451, 1863, 29892, 22692, 263, 3682, 29889, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 13699, 29889, 1256, 29918, 3881, 29898, 29888, 1256, 29892, 285, 1256, 718, 5335, 287, 2554, 29898, 29896, 876, 13, 13, 1678, 822, 1284, 29928, 1078, 29898, 1311, 29892, 285, 1256, 29892, 302, 386, 29922, 29900, 1125, 13, 4706, 736, 1583, 29889, 13699, 29889, 1256, 29918, 3881, 29898, 29888, 1256, 29892, 285, 1256, 718, 5335, 287, 2554, 29898, 20800, 876, 13, 13, 1678, 822, 2821, 29898, 1311, 1125, 13, 4706, 9995, 8551, 599, 278, 848, 297, 848, 11525, 9183, 1213, 15945, 13, 4706, 1583, 29889, 13699, 29889, 8551, 580, 13, 13, 1678, 822, 4078, 29898, 1311, 1125, 13, 4706, 9995, 7620, 599, 278, 848, 297, 848, 11525, 9183, 304, 17667, 8635, 1213, 15945, 13, 4706, 1583, 29889, 13699, 29889, 7620, 580, 13, 13, 1678, 822, 1053, 9182, 29898, 1311, 29892, 10422, 1125, 13, 4706, 1583, 29889, 13699, 29889, 5215, 9182, 29898, 9507, 29897, 13, 13, 1678, 822, 5609, 9182, 29898, 1311, 29892, 10422, 1125, 13, 4706, 1583, 29889, 13699, 29889, 15843, 9182, 29898, 9507, 29897, 13, 2 ]
docs/rips/tests/test_surfaces.py
OPM/ResInsight-UserDocumentation
1
14297
import sys import os import tempfile from pathlib import Path import pytest sys.path.insert(1, os.path.join(sys.path[0], "../../")) import rips import dataroot @pytest.mark.skipif( sys.platform.startswith("linux"), reason="Brugge is currently exceptionally slow on Linux", ) def test_create_and_export_surface(rips_instance, initialize_test): case_path = dataroot.PATH + "/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID" case = rips_instance.project.load_case(path=case_path) assert len(case.grids()) == 1 surface_collection = rips_instance.project.descendants(rips.SurfaceCollection)[0] surface = surface_collection.new_surface(case, 5) assert surface with tempfile.TemporaryDirectory(prefix="rips") as tmpdirname: path = Path(tmpdirname, "mysurface.ts") print("Temporary folder: ", path.as_posix()) fname = surface.export_to_file(path.as_posix()) assert len(fname.values) == 1 assert path.exists()
[ 1, 1053, 10876, 13, 5215, 2897, 13, 5215, 5694, 1445, 13, 3166, 2224, 1982, 1053, 10802, 13, 5215, 11451, 1688, 13, 13, 9675, 29889, 2084, 29889, 7851, 29898, 29896, 29892, 2897, 29889, 2084, 29889, 7122, 29898, 9675, 29889, 2084, 29961, 29900, 1402, 376, 21546, 5783, 13, 5215, 364, 4512, 13, 13, 5215, 1418, 279, 3155, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 11014, 361, 29898, 13, 1678, 10876, 29889, 12120, 29889, 27382, 2541, 703, 9389, 4968, 13, 1678, 2769, 543, 29933, 11124, 479, 338, 5279, 3682, 635, 5232, 373, 8074, 613, 13, 29897, 13, 1753, 1243, 29918, 3258, 29918, 392, 29918, 15843, 29918, 7610, 2161, 29898, 374, 567, 29918, 8758, 29892, 11905, 29918, 1688, 1125, 13, 1678, 1206, 29918, 2084, 353, 1418, 279, 3155, 29889, 10145, 718, 5591, 8259, 29918, 2541, 29918, 29896, 29900, 29918, 9346, 4196, 567, 29914, 21713, 29900, 29914, 15176, 23338, 1692, 29918, 29900, 29900, 29900, 29900, 29889, 11787, 29934, 1367, 29908, 13, 1678, 1206, 353, 364, 4512, 29918, 8758, 29889, 4836, 29889, 1359, 29918, 4878, 29898, 2084, 29922, 4878, 29918, 2084, 29897, 13, 1678, 4974, 7431, 29898, 4878, 29889, 629, 4841, 3101, 1275, 29871, 29896, 13, 13, 1678, 7101, 29918, 10855, 353, 364, 4512, 29918, 8758, 29889, 4836, 29889, 14273, 355, 1934, 29898, 374, 567, 29889, 18498, 2161, 7196, 9601, 29900, 29962, 13, 13, 1678, 7101, 353, 7101, 29918, 10855, 29889, 1482, 29918, 7610, 2161, 29898, 4878, 29892, 29871, 29945, 29897, 13, 1678, 4974, 7101, 13, 13, 1678, 411, 5694, 1445, 29889, 5776, 1971, 653, 9882, 29898, 13506, 543, 374, 567, 1159, 408, 13128, 25721, 29901, 13, 4706, 2224, 353, 10802, 29898, 7050, 25721, 29892, 376, 5781, 332, 2161, 29889, 1372, 1159, 13, 4706, 1596, 703, 5776, 1971, 653, 4138, 29901, 9162, 2224, 29889, 294, 29918, 1066, 861, 3101, 13, 13, 4706, 285, 978, 353, 7101, 29889, 15843, 29918, 517, 29918, 1445, 29898, 2084, 29889, 294, 29918, 1066, 861, 3101, 13, 4706, 4974, 7431, 29898, 29888, 978, 29889, 5975, 29897, 1275, 29871, 29896, 13, 13, 4706, 4974, 2224, 29889, 9933, 580, 13, 2 ]
old_code/app.1.py
LucasBiason/python521
0
112685
<filename>old_code/app.1.py import flask import pymongo client = pymongo.MongoClient() db = client.users app = flask.Flask(__name__) IS_AUTH = False @app.route('users/sign-in', methods=['GET', 'POST']) def sign_in(): if flask.request.method == 'POST': form = flask.request.form user = db.usuarios.find({'email':form['email']}) if not user: return 'Usuário não encontrado' if form['password'] == user['password']: IS_AUTH = True return flask.redirect('/dashboard') return flask.render_template('sign-in.html') @app.route('users/sign-up', methods=['POST']) def sign_up(): form = flask.request.form for user in db.usuarios.find(): if form['email'] == user['email']: if form['password'] == user['password']: return 'usuário já existente' db.usuarios.insert(form) return flask.redirect('/home') @app.route('users/sign-out', methods=['POST']) def sign_out(): pass if __name__ == '__main__': app.run(debug=True)
[ 1, 529, 9507, 29958, 1025, 29918, 401, 29914, 932, 29889, 29896, 29889, 2272, 13, 5215, 29784, 13, 5215, 282, 962, 7443, 13, 13, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 580, 13, 2585, 353, 3132, 29889, 7193, 13, 13, 932, 353, 29784, 29889, 8754, 1278, 22168, 978, 1649, 29897, 13, 13, 3235, 29918, 20656, 29950, 353, 7700, 13, 13, 29992, 932, 29889, 13134, 877, 7193, 29914, 4530, 29899, 262, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 11287, 13, 1753, 1804, 29918, 262, 7295, 13, 1678, 565, 29784, 29889, 3827, 29889, 5696, 1275, 525, 5438, 2396, 13, 4706, 883, 353, 29784, 29889, 3827, 29889, 689, 13, 4706, 1404, 353, 4833, 29889, 375, 29884, 8596, 29889, 2886, 3319, 29915, 5269, 2396, 689, 1839, 5269, 2033, 1800, 13, 4706, 565, 451, 1404, 29901, 13, 9651, 736, 525, 29965, 2146, 12288, 8145, 14567, 912, 29915, 13, 13, 4706, 565, 883, 1839, 5630, 2033, 1275, 1404, 1839, 5630, 2033, 29901, 13, 9651, 8519, 29918, 20656, 29950, 353, 5852, 13, 9651, 736, 29784, 29889, 17886, 11219, 14592, 3377, 1495, 13, 308, 13, 1678, 736, 29784, 29889, 9482, 29918, 6886, 877, 4530, 29899, 262, 29889, 1420, 1495, 13, 13, 29992, 932, 29889, 13134, 877, 7193, 29914, 4530, 29899, 786, 742, 3519, 29922, 1839, 5438, 11287, 13, 1753, 1804, 29918, 786, 7295, 13, 1678, 883, 353, 29784, 29889, 3827, 29889, 689, 13, 268, 13, 1678, 363, 1404, 297, 4833, 29889, 375, 29884, 8596, 29889, 2886, 7295, 13, 4706, 565, 883, 1839, 5269, 2033, 1275, 1404, 1839, 5269, 2033, 29901, 13, 9651, 565, 883, 1839, 5630, 2033, 1275, 1404, 1839, 5630, 2033, 29901, 13, 18884, 736, 525, 375, 29884, 12288, 17333, 1863, 2016, 29915, 13, 268, 13, 1678, 4833, 29889, 375, 29884, 8596, 29889, 7851, 29898, 689, 29897, 13, 1678, 736, 29784, 29889, 17886, 11219, 5184, 1495, 13, 13, 29992, 932, 29889, 13134, 877, 7193, 29914, 4530, 29899, 449, 742, 3519, 29922, 1839, 5438, 11287, 13, 1753, 1804, 29918, 449, 7295, 13, 1678, 1209, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 623, 29889, 3389, 29898, 8382, 29922, 5574, 29897, 2 ]
code/df_basics.py
jrihds/pdat.github.io
0
61647
#!/usr/bin/env python """Basic operations on dataframes.""" import pandas as pd # This script isn't for execution, just for notes # explore the shape and contents of a dataframe df.describe() df.info() df.shape df.columns df.index df.head(10) df.tail(10) type(df) # <class 'pandas.core.frame.DataFrame'> type(df['a']) # <class 'pandas.core.series.Series'> type(df['a'].values) # <class 'numpy.ndarray'> # copy a dataframe df2 = df.copy() # create a new index column df.reset_index() # Drop any row containing 'NaN' df.dropna() # double brackets returns dataframe df[['a']] df[['a', 'c']] # single brackets returns a Series series = df["a"] # iloc uses numbers, 0 based indexing # [row, column] df.iloc[:5, :] # first 5 rows, all columns df.iloc[-5:, :] # last 5 rows, all columns df.iloc[:, 1] # all rows, second column # loc use text labels df.loc[:, 'b':] # all rows, columns 'b' onwards df.loc[3, 'a'] # row 4 from column 'a' # Filter on a multi level index # a # one 0 1 # 1 2 # 2 3 # two 0 4 # 1 5 # 2 6 df.loc['one'] # a # 0 1 # 1 2 # 2 3 # Filter on inner label idx = pd.IndexSlice df.loc[idx[:, 1], :] # a # one 1 2 # two 1 5 # Convet df column type into a data type df['a'].astype(int) # Coerce the column to into a numeric type df['number'] = pd.to_numeric(df['number'], errors='coerce') # Apply a lambda function over each row in a df df['d'] = df['a'].apply(lambda x: x+1) df['d'] = df.apply(lambda x: x['a']+1, axis=1) # Drop duplicates df = df.drop_duplicates() # Calculate statitstics for a column df['a'].median() df['a'].std() df['a'].mean() df['a'].mode() # Fill missing values in a column df['a'] = df.a.fillna(0) # Count non null values df['a'].count() # Print the 5th and 95th percentiles df.quantile([0.05, 0.95]) # rolling window across data # Given # 0 # 0 0 # 1 1 # 2 2 # 3 3 # 4 4 # 5 5 # 6 6 # 7 7 # 8 8 # 9 9 df.rolling(5).max() # 0 # 0 NaN # 1 NaN # 2 NaN # 3 NaN # 4 4.0 # 5 5.0 # 6 6.0 # 7 7.0 # 8 8.0 # 9 9.0 df.rolling(5).mean() # 0 # 0 NaN # 1 NaN # 2 NaN # 3 NaN # 4 2.0 (0+1+2+3+4)/5 = 2 # 5 3.0 # 6 4.0 # 7 5.0 # 8 6.0 # 9 7.0 # Sort values based on index df.sort_index() df.sort_index(ascending=False) # Sort values based on column df.sort_values('Max TemperatureF') # reindex sorts the index according to a list # a # 0 0 # 1 1 # 2 2 # 3 3 # 4 4 df.reindex([4, 3, 2, 1, 0]) # a # 4 4 # 3 3 # 2 2 # 1 1 # 0 0 # ffil adds values if the new list contains indexes not in the dataframe df.reindex([0, 1, 2, 3, 4, 5, 6, 7]).ffill() # a # 0 0.0 # 1 1.0 # 2 2.0 # 3 3.0 # 4 4.0 # 5 4.0 # 6 4.0 # 7 4.0
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 16616, 6931, 373, 848, 19935, 1213, 15945, 13, 13, 5215, 11701, 408, 10518, 13, 13, 29937, 910, 2471, 3508, 29915, 29873, 363, 8225, 29892, 925, 363, 11486, 13, 13, 29937, 26987, 278, 8267, 322, 8118, 310, 263, 12205, 13, 2176, 29889, 2783, 29581, 580, 13, 2176, 29889, 3888, 580, 13, 2176, 29889, 12181, 13, 2176, 29889, 13099, 13, 2176, 29889, 2248, 13, 2176, 29889, 2813, 29898, 29896, 29900, 29897, 13, 2176, 29889, 18237, 29898, 29896, 29900, 29897, 13, 13, 1853, 29898, 2176, 29897, 13, 29937, 529, 1990, 525, 15112, 29889, 3221, 29889, 2557, 29889, 17271, 11041, 13, 1853, 29898, 2176, 1839, 29874, 11287, 13, 29937, 529, 1990, 525, 15112, 29889, 3221, 29889, 13757, 29889, 19204, 11041, 13, 1853, 29898, 2176, 1839, 29874, 13359, 5975, 29897, 13, 29937, 529, 1990, 525, 23749, 29889, 299, 2378, 11041, 13, 13, 29937, 3509, 263, 12205, 13, 2176, 29906, 353, 4489, 29889, 8552, 580, 13, 13, 29937, 1653, 263, 716, 2380, 1897, 13, 2176, 29889, 12071, 29918, 2248, 580, 13, 13, 29937, 20724, 738, 1948, 6943, 525, 19377, 29915, 13, 2176, 29889, 8865, 1056, 580, 13, 13, 29937, 3765, 20476, 3639, 12205, 13, 2176, 29961, 1839, 29874, 2033, 29962, 13, 2176, 29961, 1839, 29874, 742, 525, 29883, 2033, 29962, 13, 13, 29937, 2323, 20476, 3639, 263, 10488, 13, 13757, 353, 4489, 3366, 29874, 3108, 13, 13, 29937, 980, 542, 3913, 3694, 29892, 29871, 29900, 2729, 26190, 13, 29937, 518, 798, 29892, 1897, 29962, 13, 2176, 29889, 309, 542, 7503, 29945, 29892, 584, 29962, 418, 396, 937, 29871, 29945, 4206, 29892, 599, 4341, 13, 2176, 29889, 309, 542, 14352, 29945, 29901, 29892, 584, 29962, 268, 396, 1833, 29871, 29945, 4206, 29892, 599, 4341, 13, 2176, 29889, 309, 542, 7503, 29892, 29871, 29896, 29962, 539, 396, 599, 4206, 29892, 1473, 1897, 13, 13, 29937, 1180, 671, 1426, 11073, 13, 2176, 29889, 2029, 7503, 29892, 525, 29890, 2396, 29962, 268, 396, 599, 4206, 29892, 4341, 525, 29890, 29915, 373, 2935, 13, 2176, 29889, 2029, 29961, 29941, 29892, 525, 29874, 2033, 418, 396, 1948, 29871, 29946, 515, 1897, 525, 29874, 29915, 13, 13, 29937, 19916, 373, 263, 2473, 3233, 2380, 13, 29937, 4706, 263, 13, 29937, 697, 29871, 29900, 259, 29896, 13, 29937, 418, 29896, 259, 29906, 13, 29937, 418, 29906, 259, 29941, 13, 29937, 1023, 29871, 29900, 259, 29946, 13, 29937, 418, 29896, 259, 29945, 13, 29937, 418, 29906, 259, 29953, 13, 13, 2176, 29889, 2029, 1839, 650, 2033, 13, 13, 29937, 1678, 263, 13, 29937, 29871, 29900, 259, 29896, 13, 29937, 29871, 29896, 259, 29906, 13, 29937, 29871, 29906, 259, 29941, 13, 13, 396, 19916, 373, 6426, 3858, 13, 13140, 353, 10518, 29889, 3220, 29903, 5897, 13, 2176, 29889, 2029, 29961, 13140, 7503, 29892, 29871, 29896, 1402, 584, 29962, 13, 13, 29937, 4706, 263, 13, 29937, 697, 29871, 29896, 259, 29906, 13, 29937, 1023, 29871, 29896, 259, 29945, 13, 13, 13, 29937, 1281, 5990, 4489, 1897, 1134, 964, 263, 848, 1134, 13, 2176, 1839, 29874, 13359, 579, 668, 29898, 524, 29897, 13, 13, 29937, 3189, 261, 346, 278, 1897, 304, 964, 263, 16985, 1134, 13, 2176, 1839, 4537, 2033, 353, 10518, 29889, 517, 29918, 21574, 29898, 2176, 1839, 4537, 7464, 4436, 2433, 1111, 261, 346, 1495, 13, 13, 29937, 2401, 368, 263, 14013, 740, 975, 1269, 1948, 297, 263, 4489, 13, 2176, 1839, 29881, 2033, 353, 4489, 1839, 29874, 13359, 7302, 29898, 2892, 921, 29901, 921, 29974, 29896, 29897, 13, 2176, 1839, 29881, 2033, 353, 4489, 29889, 7302, 29898, 2892, 921, 29901, 921, 1839, 29874, 2033, 29974, 29896, 29892, 9685, 29922, 29896, 29897, 13, 13, 29937, 20724, 20955, 13, 2176, 353, 4489, 29889, 8865, 29918, 20908, 15815, 580, 13, 13, 29937, 20535, 403, 1002, 277, 303, 1199, 363, 263, 1897, 13, 2176, 1839, 29874, 13359, 2168, 713, 580, 13, 2176, 1839, 29874, 13359, 4172, 580, 13, 2176, 1839, 29874, 13359, 12676, 580, 13, 2176, 1839, 29874, 13359, 8513, 580, 13, 13, 29937, 383, 453, 4567, 1819, 297, 263, 1897, 13, 2176, 1839, 29874, 2033, 353, 4489, 29889, 29874, 29889, 5589, 1056, 29898, 29900, 29897, 13, 13, 29937, 3917, 1661, 1870, 1819, 13, 2176, 1839, 29874, 13359, 2798, 580, 13, 13, 29937, 13905, 278, 29871, 29945, 386, 322, 29871, 29929, 29945, 386, 10151, 5475, 13, 2176, 29889, 12150, 488, 4197, 29900, 29889, 29900, 29945, 29892, 29871, 29900, 29889, 29929, 29945, 2314, 13, 13, 29937, 27777, 3474, 4822, 848, 13, 29937, 11221, 13, 29937, 268, 29900, 13, 29937, 29871, 29900, 259, 29900, 13, 29937, 29871, 29896, 259, 29896, 13, 29937, 29871, 29906, 259, 29906, 13, 29937, 29871, 29941, 259, 29941, 13, 29937, 29871, 29946, 259, 29946, 13, 29937, 29871, 29945, 259, 29945, 13, 29937, 29871, 29953, 259, 29953, 13, 29937, 29871, 29955, 259, 29955, 13, 29937, 29871, 29947, 259, 29947, 13, 29937, 29871, 29929, 259, 29929, 13, 13, 2176, 29889, 22155, 29898, 29945, 467, 3317, 580, 13, 13, 29937, 539, 29900, 13, 29937, 29871, 29900, 29871, 18780, 13, 29937, 29871, 29896, 29871, 18780, 13, 29937, 29871, 29906, 29871, 18780, 13, 29937, 29871, 29941, 29871, 18780, 13, 29937, 29871, 29946, 259, 29946, 29889, 29900, 13, 29937, 29871, 29945, 259, 29945, 29889, 29900, 13, 29937, 29871, 29953, 259, 29953, 29889, 29900, 13, 29937, 29871, 29955, 259, 29955, 29889, 29900, 13, 29937, 29871, 29947, 259, 29947, 29889, 29900, 13, 29937, 29871, 29929, 259, 29929, 29889, 29900, 13, 13, 2176, 29889, 22155, 29898, 29945, 467, 12676, 580, 13, 13, 29937, 539, 29900, 13, 29937, 29871, 29900, 29871, 18780, 13, 29937, 29871, 29896, 29871, 18780, 13, 29937, 29871, 29906, 29871, 18780, 13, 29937, 29871, 29941, 29871, 18780, 13, 29937, 29871, 29946, 259, 29906, 29889, 29900, 29871, 313, 29900, 29974, 29896, 29974, 29906, 29974, 29941, 29974, 29946, 6802, 29945, 353, 29871, 29906, 13, 29937, 29871, 29945, 259, 29941, 29889, 29900, 13, 29937, 29871, 29953, 259, 29946, 29889, 29900, 13, 29937, 29871, 29955, 259, 29945, 29889, 29900, 13, 29937, 29871, 29947, 259, 29953, 29889, 29900, 13, 29937, 29871, 29929, 259, 29955, 29889, 29900, 13, 13, 13, 29937, 20025, 1819, 2729, 373, 2380, 13, 2176, 29889, 6605, 29918, 2248, 580, 13, 2176, 29889, 6605, 29918, 2248, 29898, 6151, 2548, 29922, 8824, 29897, 13, 13, 29937, 20025, 1819, 2729, 373, 1897, 13, 2176, 29889, 6605, 29918, 5975, 877, 7976, 6789, 546, 1535, 29943, 1495, 13, 13, 29937, 337, 2248, 23551, 278, 2380, 5034, 304, 263, 1051, 13, 29937, 1678, 263, 13, 29937, 29871, 29900, 259, 29900, 13, 29937, 29871, 29896, 259, 29896, 13, 29937, 29871, 29906, 259, 29906, 13, 29937, 29871, 29941, 259, 29941, 13, 29937, 29871, 29946, 259, 29946, 13, 13, 2176, 29889, 276, 2248, 4197, 29946, 29892, 29871, 29941, 29892, 29871, 29906, 29892, 29871, 29896, 29892, 29871, 29900, 2314, 13, 13, 29937, 1678, 263, 13, 29937, 29871, 29946, 259, 29946, 13, 29937, 29871, 29941, 259, 29941, 13, 29937, 29871, 29906, 259, 29906, 13, 29937, 29871, 29896, 259, 29896, 13, 29937, 29871, 29900, 259, 29900, 13, 13, 29937, 285, 1777, 12778, 1819, 565, 278, 716, 1051, 3743, 18111, 451, 297, 278, 12205, 13, 2176, 29889, 276, 2248, 4197, 29900, 29892, 29871, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 29892, 29871, 29953, 29892, 29871, 29955, 14664, 600, 453, 580, 13, 13, 29937, 418, 263, 13, 29937, 29871, 29900, 259, 29900, 29889, 29900, 13, 29937, 29871, 29896, 259, 29896, 29889, 29900, 13, 29937, 29871, 29906, 259, 29906, 29889, 29900, 13, 29937, 29871, 29941, 259, 29941, 29889, 29900, 13, 29937, 29871, 29946, 259, 29946, 29889, 29900, 13, 29937, 29871, 29945, 259, 29946, 29889, 29900, 13, 29937, 29871, 29953, 259, 29946, 29889, 29900, 13, 29937, 29871, 29955, 259, 29946, 29889, 29900, 13, 2 ]
BOJ_Solved/BOJ-19698.py
CodingLeeSeungHoon/Python_Algorithm_TeamNote
7
13701
""" 백준 19698번 : 헛간 청약 """ N, W, H, L = map(int, input().split()) print(min(W//L * H//L, N))
[ 1, 9995, 13, 31989, 239, 167, 131, 29871, 29896, 29929, 29953, 29929, 29947, 238, 181, 139, 584, 29871, 240, 154, 158, 237, 179, 135, 29871, 239, 181, 176, 239, 152, 192, 13, 15945, 29908, 13, 13, 29940, 29892, 399, 29892, 379, 29892, 365, 353, 2910, 29898, 524, 29892, 1881, 2141, 5451, 3101, 13, 2158, 29898, 1195, 29898, 29956, 458, 29931, 334, 379, 458, 29931, 29892, 405, 876, 2 ]
src/transformers/models/bert/modeling_flax_bert.py
manuelciosici/transformers
8,028
103049
# coding=utf-8 # Copyright 2021 The Google Flax Team Authors and The HuggingFace Inc. team. # # 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 typing import Callable, Optional, Tuple import numpy as np import flax import flax.linen as nn import jax import jax.numpy as jnp from flax.core.frozen_dict import FrozenDict, freeze, unfreeze from flax.linen import combine_masks, make_causal_mask from flax.linen.attention import dot_product_attention_weights from flax.traverse_util import flatten_dict, unflatten_dict from jax import lax from ...modeling_flax_outputs import ( FlaxBaseModelOutputWithPastAndCrossAttentions, FlaxBaseModelOutputWithPooling, FlaxBaseModelOutputWithPoolingAndCrossAttentions, FlaxCausalLMOutputWithCrossAttentions, FlaxMaskedLMOutput, FlaxMultipleChoiceModelOutput, FlaxNextSentencePredictorOutput, FlaxQuestionAnsweringModelOutput, FlaxSequenceClassifierOutput, FlaxTokenClassifierOutput, ) from ...modeling_flax_utils import ( ACT2FN, FlaxPreTrainedModel, append_call_sample_docstring, append_replace_return_docstrings, overwrite_call_docstring, ) from ...utils import ModelOutput, add_start_docstrings, add_start_docstrings_to_model_forward, logging from .configuration_bert import BertConfig logger = logging.get_logger(__name__) _CHECKPOINT_FOR_DOC = "bert-base-uncased" _CONFIG_FOR_DOC = "BertConfig" _TOKENIZER_FOR_DOC = "BertTokenizer" @flax.struct.dataclass class FlaxBertForPreTrainingOutput(ModelOutput): """ Output type of [`BertForPreTraining`]. Args: prediction_logits (`jnp.ndarray` of shape `(batch_size, sequence_length, config.vocab_size)`): Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax). seq_relationship_logits (`jnp.ndarray` of shape `(batch_size, 2)`): Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation before SoftMax). hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`): Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`. Hidden-states of the model at the output of each layer plus the initial embedding outputs. attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`): Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length, sequence_length)`. Attentions weights after the attention softmax, used to compute the weighted average in the self-attention heads. """ prediction_logits: jnp.ndarray = None seq_relationship_logits: jnp.ndarray = None hidden_states: Optional[Tuple[jnp.ndarray]] = None attentions: Optional[Tuple[jnp.ndarray]] = None BERT_START_DOCSTRING = r""" This model inherits from [`FlaxPreTrainedModel`]. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading, saving and converting weights from PyTorch models) This model is also a Flax Linen [flax.linen.Module](https://flax.readthedocs.io/en/latest/flax.linen.html#module) subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to general usage and behavior. Finally, this model supports inherent JAX features such as: - [Just-In-Time (JIT) compilation](https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit) - [Automatic Differentiation](https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation) - [Vectorization](https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap) - [Parallelization](https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap) Parameters: config ([`BertConfig`]): Model configuration class with all the parameters of the model. Initializing with a config file does not load the weights associated with the model, only the configuration. Check out the [`~FlaxPreTrainedModel.from_pretrained`] method to load the model weights. dtype (`jax.numpy.dtype`, *optional*, defaults to `jax.numpy.float32`): The data type of the computation. Can be one of `jax.numpy.float32`, `jax.numpy.float16` (on GPUs) and `jax.numpy.bfloat16` (on TPUs). This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If specified all the computation will be performed with the given `dtype`. **Note that this only specifies the dtype of the computation and does not influence the dtype of model parameters.** If you wish to change the dtype of the model parameters, see [`~FlaxPreTrainedModel.to_fp16`] and [`~FlaxPreTrainedModel.to_bf16`]. dtype (`jax.numpy.dtype`, *optional*, defaults to `jax.numpy.float32`): The data type of the computation. Can be one of `jax.numpy.float32`, `jax.numpy.float16` (on GPUs) and `jax.numpy.bfloat16` (on TPUs). This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If specified all the computation will be performed with the given `dtype`. **Note that this only specifies the dtype of the computation and does not influence the dtype of model parameters.** If you wish to change the dtype of the model parameters, see [`~FlaxPreTrainedModel.to_fp16`] and [`~FlaxPreTrainedModel.to_bf16`]. """ BERT_INPUTS_DOCSTRING = r""" Args: input_ids (`numpy.ndarray` of shape `({0})`): Indices of input sequence tokens in the vocabulary. Indices can be obtained using [`BertTokenizer`]. See [`PreTrainedTokenizer.encode`] and [`PreTrainedTokenizer.__call__`] for details. [What are input IDs?](../glossary#input-ids) attention_mask (`numpy.ndarray` of shape `({0})`, *optional*): Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`: - 1 for tokens that are **not masked**, - 0 for tokens that are **masked**. [What are attention masks?](../glossary#attention-mask) token_type_ids (`numpy.ndarray` of shape `({0})`, *optional*): Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0, 1]`: - 0 corresponds to a *sentence A* token, - 1 corresponds to a *sentence B* token. [What are token type IDs?](../glossary#token-type-ids) position_ids (`numpy.ndarray` of shape `({0})`, *optional*): Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0, config.max_position_embeddings - 1]`. head_mask (`numpy.ndarray` of shape `({0})`, `optional): Mask to nullify selected heads of the attention modules. Mask values selected in `[0, 1]`: - 1 indicates the head is **not masked**, - 0 indicates the head is **masked**. return_dict (`bool`, *optional*): Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple. """ class FlaxBertEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings.""" config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.word_embeddings = nn.Embed( self.config.vocab_size, self.config.hidden_size, embedding_init=jax.nn.initializers.normal(stddev=self.config.initializer_range), ) self.position_embeddings = nn.Embed( self.config.max_position_embeddings, self.config.hidden_size, embedding_init=jax.nn.initializers.normal(stddev=self.config.initializer_range), ) self.token_type_embeddings = nn.Embed( self.config.type_vocab_size, self.config.hidden_size, embedding_init=jax.nn.initializers.normal(stddev=self.config.initializer_range), ) self.LayerNorm = nn.LayerNorm(epsilon=self.config.layer_norm_eps, dtype=self.dtype) self.dropout = nn.Dropout(rate=self.config.hidden_dropout_prob) def __call__(self, input_ids, token_type_ids, position_ids, attention_mask, deterministic: bool = True): # Embed inputs_embeds = self.word_embeddings(input_ids.astype("i4")) position_embeds = self.position_embeddings(position_ids.astype("i4")) token_type_embeddings = self.token_type_embeddings(token_type_ids.astype("i4")) # Sum all embeddings hidden_states = inputs_embeds + token_type_embeddings + position_embeds # Layer Norm hidden_states = self.LayerNorm(hidden_states) hidden_states = self.dropout(hidden_states, deterministic=deterministic) return hidden_states class FlaxBertSelfAttention(nn.Module): config: BertConfig causal: bool = False dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.head_dim = self.config.hidden_size // self.config.num_attention_heads if self.config.hidden_size % self.config.num_attention_heads != 0: raise ValueError( "`config.hidden_size`: {self.config.hidden_size} has to be a multiple of `config.num_attention_heads`\ : {self.config.num_attention_heads}" ) self.query = nn.Dense( self.config.hidden_size, dtype=self.dtype, kernel_init=jax.nn.initializers.normal(self.config.initializer_range), ) self.key = nn.Dense( self.config.hidden_size, dtype=self.dtype, kernel_init=jax.nn.initializers.normal(self.config.initializer_range), ) self.value = nn.Dense( self.config.hidden_size, dtype=self.dtype, kernel_init=jax.nn.initializers.normal(self.config.initializer_range), ) if self.causal: self.causal_mask = make_causal_mask( jnp.ones((1, self.config.max_position_embeddings), dtype="bool"), dtype="bool" ) def _split_heads(self, hidden_states): return hidden_states.reshape(hidden_states.shape[:2] + (self.config.num_attention_heads, self.head_dim)) def _merge_heads(self, hidden_states): return hidden_states.reshape(hidden_states.shape[:2] + (self.config.hidden_size,)) @nn.compact # Copied from transformers.models.bart.modeling_flax_bart.FlaxBartAttention._concatenate_to_cache def _concatenate_to_cache(self, key, value, query, attention_mask): """ This function takes projected key, value states from a single input token and concatenates the states to cached states from previous steps. This function is slighly adapted from the official Flax repository: https://github.com/google/flax/blob/491ce18759622506588784b4fca0e4bf05f8c8cd/flax/linen/attention.py#L252 """ # detect if we're initializing by absence of existing cache data. is_initialized = self.has_variable("cache", "cached_key") cached_key = self.variable("cache", "cached_key", jnp.zeros, key.shape, key.dtype) cached_value = self.variable("cache", "cached_value", jnp.zeros, value.shape, value.dtype) cache_index = self.variable("cache", "cache_index", lambda: jnp.array(0, dtype=jnp.int32)) if is_initialized: *batch_dims, max_length, num_heads, depth_per_head = cached_key.value.shape # update key, value caches with our new 1d spatial slices cur_index = cache_index.value indices = (0,) * len(batch_dims) + (cur_index, 0, 0) key = lax.dynamic_update_slice(cached_key.value, key, indices) value = lax.dynamic_update_slice(cached_value.value, value, indices) cached_key.value = key cached_value.value = value num_updated_cache_vectors = query.shape[1] cache_index.value = cache_index.value + num_updated_cache_vectors # causal mask for cached decoder self-attention: our single query position should only attend to those key positions that have already been generated and cached, not the remaining zero elements. pad_mask = jnp.broadcast_to( jnp.arange(max_length) < cur_index + num_updated_cache_vectors, tuple(batch_dims) + (1, num_updated_cache_vectors, max_length), ) attention_mask = combine_masks(pad_mask, attention_mask) return key, value, attention_mask def __call__( self, hidden_states, attention_mask, layer_head_mask, key_value_states: Optional[jnp.array] = None, init_cache: bool = False, deterministic=True, output_attentions: bool = False, ): # if key_value_states are provided this layer is used as a cross-attention layer # for the decoder is_cross_attention = key_value_states is not None batch_size = hidden_states.shape[0] # get query proj query_states = self.query(hidden_states) # get key, value proj if is_cross_attention: # cross_attentions key_states = self.key(key_value_states) value_states = self.value(key_value_states) else: # self_attention key_states = self.key(hidden_states) value_states = self.value(hidden_states) query_states = self._split_heads(query_states) key_states = self._split_heads(key_states) value_states = self._split_heads(value_states) # handle cache prepare causal attention mask if self.causal: query_length, key_length = query_states.shape[1], key_states.shape[1] if self.has_variable("cache", "cached_key"): mask_shift = self.variables["cache"]["cache_index"] max_decoder_length = self.variables["cache"]["cached_key"].shape[1] causal_mask = lax.dynamic_slice( self.causal_mask, (0, 0, mask_shift, 0), (1, 1, query_length, max_decoder_length) ) else: causal_mask = self.causal_mask[:, :, :query_length, :key_length] causal_mask = jnp.broadcast_to(causal_mask, (batch_size,) + causal_mask.shape[1:]) # combine masks if needed if attention_mask is not None and self.causal: attention_mask = jnp.broadcast_to(jnp.expand_dims(attention_mask, axis=(-3, -2)), causal_mask.shape) attention_mask = combine_masks(attention_mask, causal_mask) elif self.causal: attention_mask = causal_mask elif attention_mask is not None: attention_mask = jnp.expand_dims(attention_mask, axis=(-3, -2)) # During fast autoregressive decoding, we feed one position at a time, # and cache the keys and values step by step. if self.causal and (self.has_variable("cache", "cached_key") or init_cache): key_states, value_states, attention_mask = self._concatenate_to_cache( key_states, value_states, query_states, attention_mask ) # Convert the boolean attention mask to an attention bias. if attention_mask is not None: # attention mask in the form of attention bias attention_bias = lax.select( attention_mask > 0, jnp.full(attention_mask.shape, 0.0).astype(self.dtype), jnp.full(attention_mask.shape, -1e10).astype(self.dtype), ) else: attention_bias = None dropout_rng = None if not deterministic and self.config.attention_probs_dropout_prob > 0.0: dropout_rng = self.make_rng("dropout") attn_weights = dot_product_attention_weights( query_states, key_states, bias=attention_bias, dropout_rng=dropout_rng, dropout_rate=self.config.attention_probs_dropout_prob, broadcast_dropout=True, deterministic=deterministic, dtype=self.dtype, precision=None, ) # Mask heads if we want to if layer_head_mask is not None: attn_weights = jnp.einsum("...hqk,h->...hqk", attn_weights, layer_head_mask) attn_output = jnp.einsum("...hqk,...khd->...qhd", attn_weights, value_states) attn_output = attn_output.reshape(attn_output.shape[:2] + (-1,)) outputs = (attn_output, attn_weights) if output_attentions else (attn_output,) return outputs class FlaxBertSelfOutput(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.dense = nn.Dense( self.config.hidden_size, kernel_init=jax.nn.initializers.normal(self.config.initializer_range), dtype=self.dtype, ) self.LayerNorm = nn.LayerNorm(epsilon=self.config.layer_norm_eps, dtype=self.dtype) self.dropout = nn.Dropout(rate=self.config.hidden_dropout_prob) def __call__(self, hidden_states, input_tensor, deterministic: bool = True): hidden_states = self.dense(hidden_states) hidden_states = self.dropout(hidden_states, deterministic=deterministic) hidden_states = self.LayerNorm(hidden_states + input_tensor) return hidden_states class FlaxBertAttention(nn.Module): config: BertConfig causal: bool = False dtype: jnp.dtype = jnp.float32 def setup(self): self.self = FlaxBertSelfAttention(self.config, causal=self.causal, dtype=self.dtype) self.output = FlaxBertSelfOutput(self.config, dtype=self.dtype) def __call__( self, hidden_states, attention_mask, layer_head_mask, key_value_states=None, init_cache=False, deterministic=True, output_attentions: bool = False, ): # Attention mask comes in as attention_mask.shape == (*batch_sizes, kv_length) # FLAX expects: attention_mask.shape == (*batch_sizes, 1, 1, kv_length) such that it is broadcastable # with attn_weights.shape == (*batch_sizes, num_heads, q_length, kv_length) attn_outputs = self.self( hidden_states, attention_mask, layer_head_mask=layer_head_mask, key_value_states=key_value_states, init_cache=init_cache, deterministic=deterministic, output_attentions=output_attentions, ) attn_output = attn_outputs[0] hidden_states = self.output(attn_output, hidden_states, deterministic=deterministic) outputs = (hidden_states,) if output_attentions: outputs += (attn_outputs[1],) return outputs class FlaxBertIntermediate(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.dense = nn.Dense( self.config.intermediate_size, kernel_init=jax.nn.initializers.normal(self.config.initializer_range), dtype=self.dtype, ) self.activation = ACT2FN[self.config.hidden_act] def __call__(self, hidden_states): hidden_states = self.dense(hidden_states) hidden_states = self.activation(hidden_states) return hidden_states class FlaxBertOutput(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.dense = nn.Dense( self.config.hidden_size, kernel_init=jax.nn.initializers.normal(self.config.initializer_range), dtype=self.dtype, ) self.dropout = nn.Dropout(rate=self.config.hidden_dropout_prob) self.LayerNorm = nn.LayerNorm(epsilon=self.config.layer_norm_eps, dtype=self.dtype) def __call__(self, hidden_states, attention_output, deterministic: bool = True): hidden_states = self.dense(hidden_states) hidden_states = self.dropout(hidden_states, deterministic=deterministic) hidden_states = self.LayerNorm(hidden_states + attention_output) return hidden_states class FlaxBertLayer(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.attention = FlaxBertAttention(self.config, causal=self.config.is_decoder, dtype=self.dtype) self.intermediate = FlaxBertIntermediate(self.config, dtype=self.dtype) self.output = FlaxBertOutput(self.config, dtype=self.dtype) if self.config.add_cross_attention: self.crossattention = FlaxBertAttention(self.config, causal=False, dtype=self.dtype) def __call__( self, hidden_states, attention_mask, layer_head_mask, encoder_hidden_states: Optional[jnp.ndarray] = None, encoder_attention_mask: Optional[jnp.ndarray] = None, init_cache: bool = False, deterministic: bool = True, output_attentions: bool = False, ): # Self Attention attention_outputs = self.attention( hidden_states, attention_mask, layer_head_mask=layer_head_mask, init_cache=init_cache, deterministic=deterministic, output_attentions=output_attentions, ) attention_output = attention_outputs[0] # Cross-Attention Block if encoder_hidden_states is not None: cross_attention_outputs = self.crossattention( attention_output, attention_mask=encoder_attention_mask, layer_head_mask=layer_head_mask, key_value_states=encoder_hidden_states, deterministic=deterministic, output_attentions=output_attentions, ) attention_output = cross_attention_outputs[0] hidden_states = self.intermediate(attention_output) hidden_states = self.output(hidden_states, attention_output, deterministic=deterministic) outputs = (hidden_states,) if output_attentions: outputs += (attention_outputs[1],) if encoder_hidden_states is not None: outputs += (cross_attention_outputs[1],) return outputs class FlaxBertLayerCollection(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.layers = [ FlaxBertLayer(self.config, name=str(i), dtype=self.dtype) for i in range(self.config.num_hidden_layers) ] def __call__( self, hidden_states, attention_mask, head_mask, encoder_hidden_states: Optional[jnp.ndarray] = None, encoder_attention_mask: Optional[jnp.ndarray] = None, init_cache: bool = False, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): all_attentions = () if output_attentions else None all_hidden_states = () if output_hidden_states else None all_cross_attentions = () if (output_attentions and encoder_hidden_states is not None) else None # Check if head_mask has a correct number of layers specified if desired if head_mask is not None: if head_mask.shape[0] != (len(self.layers)): raise ValueError( f"The head_mask should be specified for {len(self.layers)} layers, but it is for \ {head_mask.shape[0]}." ) for i, layer in enumerate(self.layers): if output_hidden_states: all_hidden_states += (hidden_states,) layer_outputs = layer( hidden_states, attention_mask, layer_head_mask=head_mask[i] if head_mask is not None else None, encoder_hidden_states=encoder_hidden_states, encoder_attention_mask=encoder_attention_mask, init_cache=init_cache, deterministic=deterministic, output_attentions=output_attentions, ) hidden_states = layer_outputs[0] if output_attentions: all_attentions += (layer_outputs[1],) if encoder_hidden_states is not None: all_cross_attentions += (layer_outputs[2],) if output_hidden_states: all_hidden_states += (hidden_states,) outputs = (hidden_states,) if not return_dict: return tuple(v for v in outputs if v is not None) return FlaxBaseModelOutputWithPastAndCrossAttentions( last_hidden_state=hidden_states, hidden_states=all_hidden_states, attentions=all_attentions, cross_attentions=all_cross_attentions, ) class FlaxBertEncoder(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.layer = FlaxBertLayerCollection(self.config, dtype=self.dtype) def __call__( self, hidden_states, attention_mask, head_mask, encoder_hidden_states: Optional[jnp.ndarray] = None, encoder_attention_mask: Optional[jnp.ndarray] = None, init_cache: bool = False, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): return self.layer( hidden_states, attention_mask, head_mask=head_mask, encoder_hidden_states=encoder_hidden_states, encoder_attention_mask=encoder_attention_mask, init_cache=init_cache, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) class FlaxBertPooler(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation def setup(self): self.dense = nn.Dense( self.config.hidden_size, kernel_init=jax.nn.initializers.normal(self.config.initializer_range), dtype=self.dtype, ) def __call__(self, hidden_states): cls_hidden_state = hidden_states[:, 0] cls_hidden_state = self.dense(cls_hidden_state) return nn.tanh(cls_hidden_state) class FlaxBertPredictionHeadTransform(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.dense = nn.Dense(self.config.hidden_size, dtype=self.dtype) self.activation = ACT2FN[self.config.hidden_act] self.LayerNorm = nn.LayerNorm(epsilon=self.config.layer_norm_eps, dtype=self.dtype) def __call__(self, hidden_states): hidden_states = self.dense(hidden_states) hidden_states = self.activation(hidden_states) return self.LayerNorm(hidden_states) class FlaxBertLMPredictionHead(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 bias_init: Callable[..., np.ndarray] = jax.nn.initializers.zeros def setup(self): self.transform = FlaxBertPredictionHeadTransform(self.config, dtype=self.dtype) self.decoder = nn.Dense(self.config.vocab_size, dtype=self.dtype, use_bias=False) self.bias = self.param("bias", self.bias_init, (self.config.vocab_size,)) def __call__(self, hidden_states, shared_embedding=None): hidden_states = self.transform(hidden_states) if shared_embedding is not None: hidden_states = self.decoder.apply({"params": {"kernel": shared_embedding.T}}, hidden_states) else: hidden_states = self.decoder(hidden_states) bias = jnp.asarray(self.bias, self.dtype) hidden_states += bias return hidden_states class FlaxBertOnlyMLMHead(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.predictions = FlaxBertLMPredictionHead(self.config, dtype=self.dtype) def __call__(self, hidden_states, shared_embedding=None): hidden_states = self.predictions(hidden_states, shared_embedding=shared_embedding) return hidden_states class FlaxBertOnlyNSPHead(nn.Module): dtype: jnp.dtype = jnp.float32 def setup(self): self.seq_relationship = nn.Dense(2, dtype=self.dtype) def __call__(self, pooled_output): return self.seq_relationship(pooled_output) class FlaxBertPreTrainingHeads(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.predictions = FlaxBertLMPredictionHead(self.config, dtype=self.dtype) self.seq_relationship = nn.Dense(2, dtype=self.dtype) def __call__(self, hidden_states, pooled_output, shared_embedding=None): prediction_scores = self.predictions(hidden_states, shared_embedding=shared_embedding) seq_relationship_score = self.seq_relationship(pooled_output) return prediction_scores, seq_relationship_score class FlaxBertPreTrainedModel(FlaxPreTrainedModel): """ An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained models. """ config_class = BertConfig base_model_prefix = "bert" module_class: nn.Module = None def __init__( self, config: BertConfig, input_shape: Tuple = (1, 1), seed: int = 0, dtype: jnp.dtype = jnp.float32, _do_init: bool = True, **kwargs ): module = self.module_class(config=config, dtype=dtype, **kwargs) super().__init__(config, module, input_shape=input_shape, seed=seed, dtype=dtype, _do_init=_do_init) def init_weights(self, rng: jax.random.PRNGKey, input_shape: Tuple, params: FrozenDict = None) -> FrozenDict: # init input tensors input_ids = jnp.zeros(input_shape, dtype="i4") token_type_ids = jnp.zeros_like(input_ids) position_ids = jnp.broadcast_to(jnp.arange(jnp.atleast_2d(input_ids).shape[-1]), input_shape) attention_mask = jnp.ones_like(input_ids) head_mask = jnp.ones((self.config.num_hidden_layers, self.config.num_attention_heads)) params_rng, dropout_rng = jax.random.split(rng) rngs = {"params": params_rng, "dropout": dropout_rng} if self.config.add_cross_attention: encoder_hidden_states = jnp.zeros(input_shape + (self.config.hidden_size,)) encoder_attention_mask = attention_mask module_init_outputs = self.module.init( rngs, input_ids, attention_mask, token_type_ids, position_ids, head_mask, encoder_hidden_states, encoder_attention_mask, return_dict=False, ) else: module_init_outputs = self.module.init( rngs, input_ids, attention_mask, token_type_ids, position_ids, head_mask, return_dict=False ) random_params = module_init_outputs["params"] if params is not None: random_params = flatten_dict(unfreeze(random_params)) params = flatten_dict(unfreeze(params)) for missing_key in self._missing_keys: params[missing_key] = random_params[missing_key] self._missing_keys = set() return freeze(unflatten_dict(params)) else: return random_params # Copied from transformers.models.bart.modeling_flax_bart.FlaxBartDecoderPreTrainedModel.init_cache def init_cache(self, batch_size, max_length): r""" Args: batch_size (`int`): batch_size used for fast auto-regressive decoding. Defines the batch size of the initialized cache. max_length (`int`): maximum possible length for auto-regressive decoding. Defines the sequence length of the initialized cache. """ # init input variables to retrieve cache input_ids = jnp.ones((batch_size, max_length), dtype="i4") attention_mask = jnp.ones_like(input_ids, dtype="i4") position_ids = jnp.broadcast_to(jnp.arange(jnp.atleast_2d(input_ids).shape[-1]), input_ids.shape) init_variables = self.module.init( jax.random.PRNGKey(0), input_ids, attention_mask, position_ids, return_dict=False, init_cache=True ) return unfreeze(init_variables["cache"]) @add_start_docstrings_to_model_forward(BERT_INPUTS_DOCSTRING.format("batch_size, sequence_length")) def __call__( self, input_ids, attention_mask=None, token_type_ids=None, position_ids=None, head_mask=None, encoder_hidden_states=None, encoder_attention_mask=None, params: dict = None, dropout_rng: jax.random.PRNGKey = None, train: bool = False, output_attentions: Optional[bool] = None, output_hidden_states: Optional[bool] = None, return_dict: Optional[bool] = None, past_key_values: dict = None, ): output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions output_hidden_states = ( output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states ) return_dict = return_dict if return_dict is not None else self.config.return_dict # init input tensors if not passed if token_type_ids is None: token_type_ids = jnp.zeros_like(input_ids) if position_ids is None: position_ids = jnp.broadcast_to(jnp.arange(jnp.atleast_2d(input_ids).shape[-1]), input_ids.shape) if attention_mask is None: attention_mask = jnp.ones_like(input_ids) if head_mask is None: head_mask = jnp.ones((self.config.num_hidden_layers, self.config.num_attention_heads)) # Handle any PRNG if needed rngs = {} if dropout_rng is not None: rngs["dropout"] = dropout_rng inputs = {"params": params or self.params} if self.config.add_cross_attention: # if past_key_values are passed then cache is already initialized a private flag init_cache has to be passed # down to ensure cache is used. It has to be made sure that cache is marked as mutable so that it can be # changed by FlaxBertAttention module if past_key_values: inputs["cache"] = past_key_values mutable = ["cache"] else: mutable = False outputs = self.module.apply( inputs, jnp.array(input_ids, dtype="i4"), jnp.array(attention_mask, dtype="i4"), token_type_ids=jnp.array(token_type_ids, dtype="i4"), position_ids=jnp.array(position_ids, dtype="i4"), head_mask=jnp.array(head_mask, dtype="i4"), encoder_hidden_states=encoder_hidden_states, encoder_attention_mask=encoder_attention_mask, deterministic=not train, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, rngs=rngs, mutable=mutable, ) # add updated cache to model output if past_key_values is not None and return_dict: outputs, past_key_values = outputs outputs["past_key_values"] = unfreeze(past_key_values["cache"]) return outputs elif past_key_values is not None and not return_dict: outputs, past_key_values = outputs outputs = outputs[:1] + (unfreeze(past_key_values["cache"]),) + outputs[1:] else: outputs = self.module.apply( inputs, jnp.array(input_ids, dtype="i4"), jnp.array(attention_mask, dtype="i4"), token_type_ids=jnp.array(token_type_ids, dtype="i4"), position_ids=jnp.array(position_ids, dtype="i4"), head_mask=jnp.array(head_mask, dtype="i4"), deterministic=not train, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, rngs=rngs, ) return outputs class FlaxBertModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 # the dtype of the computation add_pooling_layer: bool = True def setup(self): self.embeddings = FlaxBertEmbeddings(self.config, dtype=self.dtype) self.encoder = FlaxBertEncoder(self.config, dtype=self.dtype) self.pooler = FlaxBertPooler(self.config, dtype=self.dtype) def __call__( self, input_ids, attention_mask, token_type_ids: Optional[jnp.ndarray] = None, position_ids: Optional[jnp.ndarray] = None, head_mask: Optional[jnp.ndarray] = None, encoder_hidden_states: Optional[jnp.ndarray] = None, encoder_attention_mask: Optional[jnp.ndarray] = None, init_cache: bool = False, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): # make sure `token_type_ids` is correctly initialized when not passed if token_type_ids is None: token_type_ids = jnp.zeros_like(input_ids) # make sure `position_ids` is correctly initialized when not passed if position_ids is None: position_ids = jnp.broadcast_to(jnp.arange(jnp.atleast_2d(input_ids).shape[-1]), input_ids.shape) hidden_states = self.embeddings( input_ids, token_type_ids, position_ids, attention_mask, deterministic=deterministic ) outputs = self.encoder( hidden_states, attention_mask, head_mask=head_mask, deterministic=deterministic, encoder_hidden_states=encoder_hidden_states, encoder_attention_mask=encoder_attention_mask, init_cache=init_cache, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) hidden_states = outputs[0] pooled = self.pooler(hidden_states) if self.add_pooling_layer else None if not return_dict: # if pooled is None, don't return it if pooled is None: return (hidden_states,) + outputs[1:] return (hidden_states, pooled) + outputs[1:] return FlaxBaseModelOutputWithPoolingAndCrossAttentions( last_hidden_state=hidden_states, pooler_output=pooled, hidden_states=outputs.hidden_states, attentions=outputs.attentions, cross_attentions=outputs.cross_attentions, ) @add_start_docstrings( "The bare Bert Model transformer outputting raw hidden-states without any specific head on top.", BERT_START_DOCSTRING, ) class FlaxBertModel(FlaxBertPreTrainedModel): module_class = FlaxBertModule append_call_sample_docstring( FlaxBertModel, _TOKENIZER_FOR_DOC, _CHECKPOINT_FOR_DOC, FlaxBaseModelOutputWithPooling, _CONFIG_FOR_DOC ) class FlaxBertForPreTrainingModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.bert = FlaxBertModule(config=self.config, dtype=self.dtype) self.cls = FlaxBertPreTrainingHeads(config=self.config, dtype=self.dtype) def __call__( self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): # Model outputs = self.bert( input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) if self.config.tie_word_embeddings: shared_embedding = self.bert.variables["params"]["embeddings"]["word_embeddings"]["embedding"] else: shared_embedding = None hidden_states = outputs[0] pooled_output = outputs[1] prediction_scores, seq_relationship_score = self.cls( hidden_states, pooled_output, shared_embedding=shared_embedding ) if not return_dict: return (prediction_scores, seq_relationship_score) + outputs[2:] return FlaxBertForPreTrainingOutput( prediction_logits=prediction_scores, seq_relationship_logits=seq_relationship_score, hidden_states=outputs.hidden_states, attentions=outputs.attentions, ) @add_start_docstrings( """ Bert Model with two heads on top as done during the pretraining: a `masked language modeling` head and a `next sentence prediction (classification)` head. """, BERT_START_DOCSTRING, ) class FlaxBertForPreTraining(FlaxBertPreTrainedModel): module_class = FlaxBertForPreTrainingModule FLAX_BERT_FOR_PRETRAINING_DOCSTRING = """ Returns: Example: ```python >>> from transformers import BertTokenizer, FlaxBertForPreTraining >>> tokenizer = BertTokenizer.from_pretrained("bert-base-uncased") >>> model = FlaxBertForPreTraining.from_pretrained("bert-base-uncased") >>> inputs = tokenizer("Hello, my dog is cute", return_tensors="np") >>> outputs = model(**inputs) >>> prediction_logits = outputs.prediction_logits >>> seq_relationship_logits = outputs.seq_relationship_logits ``` """ overwrite_call_docstring( FlaxBertForPreTraining, BERT_INPUTS_DOCSTRING.format("batch_size, sequence_length") + FLAX_BERT_FOR_PRETRAINING_DOCSTRING, ) append_replace_return_docstrings( FlaxBertForPreTraining, output_type=FlaxBertForPreTrainingOutput, config_class=_CONFIG_FOR_DOC ) class FlaxBertForMaskedLMModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.bert = FlaxBertModule(config=self.config, add_pooling_layer=False, dtype=self.dtype) self.cls = FlaxBertOnlyMLMHead(config=self.config, dtype=self.dtype) def __call__( self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): # Model outputs = self.bert( input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) hidden_states = outputs[0] if self.config.tie_word_embeddings: shared_embedding = self.bert.variables["params"]["embeddings"]["word_embeddings"]["embedding"] else: shared_embedding = None # Compute the prediction scores logits = self.cls(hidden_states, shared_embedding=shared_embedding) if not return_dict: return (logits,) + outputs[1:] return FlaxMaskedLMOutput( logits=logits, hidden_states=outputs.hidden_states, attentions=outputs.attentions, ) @add_start_docstrings("""Bert Model with a `language modeling` head on top.""", BERT_START_DOCSTRING) class FlaxBertForMaskedLM(FlaxBertPreTrainedModel): module_class = FlaxBertForMaskedLMModule append_call_sample_docstring( FlaxBertForMaskedLM, _TOKENIZER_FOR_DOC, _CHECKPOINT_FOR_DOC, FlaxMaskedLMOutput, _CONFIG_FOR_DOC ) class FlaxBertForNextSentencePredictionModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.bert = FlaxBertModule(config=self.config, dtype=self.dtype) self.cls = FlaxBertOnlyNSPHead(dtype=self.dtype) def __call__( self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): return_dict = return_dict if return_dict is not None else self.config.return_dict # Model outputs = self.bert( input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) pooled_output = outputs[1] seq_relationship_scores = self.cls(pooled_output) if not return_dict: return (seq_relationship_scores,) + outputs[2:] return FlaxNextSentencePredictorOutput( logits=seq_relationship_scores, hidden_states=outputs.hidden_states, attentions=outputs.attentions, ) @add_start_docstrings( """Bert Model with a `next sentence prediction (classification)` head on top.""", BERT_START_DOCSTRING, ) class FlaxBertForNextSentencePrediction(FlaxBertPreTrainedModel): module_class = FlaxBertForNextSentencePredictionModule FLAX_BERT_FOR_NEXT_SENT_PRED_DOCSTRING = """ Returns: Example: ```python >>> from transformers import BertTokenizer, FlaxBertForNextSentencePrediction >>> tokenizer = BertTokenizer.from_pretrained("bert-base-uncased") >>> model = FlaxBertForNextSentencePrediction.from_pretrained("bert-base-uncased") >>> prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced." >>> next_sentence = "The sky is blue due to the shorter wavelength of blue light." >>> encoding = tokenizer(prompt, next_sentence, return_tensors="jax") >>> outputs = model(**encoding) >>> logits = outputs.logits >>> assert logits[0, 0] < logits[0, 1] # next sentence was random ``` """ overwrite_call_docstring( FlaxBertForNextSentencePrediction, BERT_INPUTS_DOCSTRING.format("batch_size, sequence_length") + FLAX_BERT_FOR_NEXT_SENT_PRED_DOCSTRING, ) append_replace_return_docstrings( FlaxBertForNextSentencePrediction, output_type=FlaxNextSentencePredictorOutput, config_class=_CONFIG_FOR_DOC ) class FlaxBertForSequenceClassificationModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.bert = FlaxBertModule(config=self.config, dtype=self.dtype) classifier_dropout = ( self.config.classifier_dropout if self.config.classifier_dropout is not None else self.config.hidden_dropout_prob ) self.dropout = nn.Dropout(rate=classifier_dropout) self.classifier = nn.Dense( self.config.num_labels, dtype=self.dtype, ) def __call__( self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): # Model outputs = self.bert( input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) pooled_output = outputs[1] pooled_output = self.dropout(pooled_output, deterministic=deterministic) logits = self.classifier(pooled_output) if not return_dict: return (logits,) + outputs[2:] return FlaxSequenceClassifierOutput( logits=logits, hidden_states=outputs.hidden_states, attentions=outputs.attentions, ) @add_start_docstrings( """ Bert Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g. for GLUE tasks. """, BERT_START_DOCSTRING, ) class FlaxBertForSequenceClassification(FlaxBertPreTrainedModel): module_class = FlaxBertForSequenceClassificationModule append_call_sample_docstring( FlaxBertForSequenceClassification, _TOKENIZER_FOR_DOC, _CHECKPOINT_FOR_DOC, FlaxSequenceClassifierOutput, _CONFIG_FOR_DOC, ) class FlaxBertForMultipleChoiceModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.bert = FlaxBertModule(config=self.config, dtype=self.dtype) self.dropout = nn.Dropout(rate=self.config.hidden_dropout_prob) self.classifier = nn.Dense(1, dtype=self.dtype) def __call__( self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): num_choices = input_ids.shape[1] input_ids = input_ids.reshape(-1, input_ids.shape[-1]) if input_ids is not None else None attention_mask = attention_mask.reshape(-1, attention_mask.shape[-1]) if attention_mask is not None else None token_type_ids = token_type_ids.reshape(-1, token_type_ids.shape[-1]) if token_type_ids is not None else None position_ids = position_ids.reshape(-1, position_ids.shape[-1]) if position_ids is not None else None # Model outputs = self.bert( input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) pooled_output = outputs[1] pooled_output = self.dropout(pooled_output, deterministic=deterministic) logits = self.classifier(pooled_output) reshaped_logits = logits.reshape(-1, num_choices) if not return_dict: return (reshaped_logits,) + outputs[2:] return FlaxMultipleChoiceModelOutput( logits=reshaped_logits, hidden_states=outputs.hidden_states, attentions=outputs.attentions, ) @add_start_docstrings( """ Bert Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a softmax) e.g. for RocStories/SWAG tasks. """, BERT_START_DOCSTRING, ) class FlaxBertForMultipleChoice(FlaxBertPreTrainedModel): module_class = FlaxBertForMultipleChoiceModule overwrite_call_docstring( FlaxBertForMultipleChoice, BERT_INPUTS_DOCSTRING.format("batch_size, num_choices, sequence_length") ) append_call_sample_docstring( FlaxBertForMultipleChoice, _TOKENIZER_FOR_DOC, _CHECKPOINT_FOR_DOC, FlaxMultipleChoiceModelOutput, _CONFIG_FOR_DOC ) class FlaxBertForTokenClassificationModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.bert = FlaxBertModule(config=self.config, dtype=self.dtype, add_pooling_layer=False) classifier_dropout = ( self.config.classifier_dropout if self.config.classifier_dropout is not None else self.config.hidden_dropout_prob ) self.dropout = nn.Dropout(rate=classifier_dropout) self.classifier = nn.Dense(self.config.num_labels, dtype=self.dtype) def __call__( self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): # Model outputs = self.bert( input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) hidden_states = outputs[0] hidden_states = self.dropout(hidden_states, deterministic=deterministic) logits = self.classifier(hidden_states) if not return_dict: return (logits,) + outputs[1:] return FlaxTokenClassifierOutput( logits=logits, hidden_states=outputs.hidden_states, attentions=outputs.attentions, ) @add_start_docstrings( """ Bert Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks. """, BERT_START_DOCSTRING, ) class FlaxBertForTokenClassification(FlaxBertPreTrainedModel): module_class = FlaxBertForTokenClassificationModule append_call_sample_docstring( FlaxBertForTokenClassification, _TOKENIZER_FOR_DOC, _CHECKPOINT_FOR_DOC, FlaxTokenClassifierOutput, _CONFIG_FOR_DOC ) class FlaxBertForQuestionAnsweringModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.bert = FlaxBertModule(config=self.config, dtype=self.dtype, add_pooling_layer=False) self.qa_outputs = nn.Dense(self.config.num_labels, dtype=self.dtype) def __call__( self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): # Model outputs = self.bert( input_ids, attention_mask, token_type_ids, position_ids, head_mask, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) hidden_states = outputs[0] logits = self.qa_outputs(hidden_states) start_logits, end_logits = logits.split(self.config.num_labels, axis=-1) start_logits = start_logits.squeeze(-1) end_logits = end_logits.squeeze(-1) if not return_dict: return (start_logits, end_logits) + outputs[1:] return FlaxQuestionAnsweringModelOutput( start_logits=start_logits, end_logits=end_logits, hidden_states=outputs.hidden_states, attentions=outputs.attentions, ) @add_start_docstrings( """ Bert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layers on top of the hidden-states output to compute `span start logits` and `span end logits`). """, BERT_START_DOCSTRING, ) class FlaxBertForQuestionAnswering(FlaxBertPreTrainedModel): module_class = FlaxBertForQuestionAnsweringModule append_call_sample_docstring( FlaxBertForQuestionAnswering, _TOKENIZER_FOR_DOC, _CHECKPOINT_FOR_DOC, FlaxQuestionAnsweringModelOutput, _CONFIG_FOR_DOC, ) class FlaxBertForCausalLMModule(nn.Module): config: BertConfig dtype: jnp.dtype = jnp.float32 def setup(self): self.bert = FlaxBertModule(config=self.config, add_pooling_layer=False, dtype=self.dtype) self.cls = FlaxBertOnlyMLMHead(config=self.config, dtype=self.dtype) def __call__( self, input_ids, attention_mask, position_ids, token_type_ids: Optional[jnp.ndarray] = None, head_mask: Optional[jnp.ndarray] = None, encoder_hidden_states: Optional[jnp.ndarray] = None, encoder_attention_mask: Optional[jnp.ndarray] = None, init_cache: bool = False, deterministic: bool = True, output_attentions: bool = False, output_hidden_states: bool = False, return_dict: bool = True, ): # Model outputs = self.bert( input_ids, attention_mask, token_type_ids, position_ids, head_mask, encoder_hidden_states=encoder_hidden_states, encoder_attention_mask=encoder_attention_mask, init_cache=init_cache, deterministic=deterministic, output_attentions=output_attentions, output_hidden_states=output_hidden_states, return_dict=return_dict, ) hidden_states = outputs[0] if self.config.tie_word_embeddings: shared_embedding = self.bert.variables["params"]["embeddings"]["word_embeddings"]["embedding"] else: shared_embedding = None # Compute the prediction scores logits = self.cls(hidden_states, shared_embedding=shared_embedding) if not return_dict: return (logits,) + outputs[1:] return FlaxCausalLMOutputWithCrossAttentions( logits=logits, hidden_states=outputs.hidden_states, attentions=outputs.attentions, cross_attentions=outputs.cross_attentions, ) @add_start_docstrings( """ Bert Model with a language modeling head on top (a linear layer on top of the hidden-states output) e.g for autoregressive tasks. """, BERT_START_DOCSTRING, ) class FlaxBertForCausalLM(FlaxBertPreTrainedModel): module_class = FlaxBertForCausalLMModule def prepare_inputs_for_generation(self, input_ids, max_length, attention_mask: Optional[jnp.DeviceArray] = None): # initializing the cache batch_size, seq_length = input_ids.shape past_key_values = self.init_cache(batch_size, max_length) # Note that usually one would have to put 0's in the attention_mask for x > input_ids.shape[-1] and x < cache_length. # But since the decoder uses a causal mask, those positions are masked anyway. # Thus, we can create a single static attention_mask here, which is more efficient for compilation extended_attention_mask = jnp.ones((batch_size, max_length), dtype="i4") if attention_mask is not None: position_ids = attention_mask.cumsum(axis=-1) - 1 extended_attention_mask = lax.dynamic_update_slice(extended_attention_mask, attention_mask, (0, 0)) else: position_ids = jnp.broadcast_to(jnp.arange(seq_length, dtype="i4")[None, :], (batch_size, seq_length)) return { "past_key_values": past_key_values, "attention_mask": extended_attention_mask, "position_ids": position_ids, } def update_inputs_for_generation(self, model_outputs, model_kwargs): model_kwargs["past_key_values"] = model_outputs.past_key_values model_kwargs["position_ids"] = model_kwargs["position_ids"][:, -1:] + 1 return model_kwargs append_call_sample_docstring( FlaxBertForCausalLM, _TOKENIZER_FOR_DOC, _CHECKPOINT_FOR_DOC, FlaxCausalLMOutputWithCrossAttentions, _CONFIG_FOR_DOC, )
[ 1, 396, 14137, 29922, 9420, 29899, 29947, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 450, 5087, 383, 21222, 8583, 13189, 943, 322, 450, 379, 688, 3460, 23360, 9266, 29889, 3815, 29889, 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, 13, 3166, 19229, 1053, 8251, 519, 29892, 28379, 29892, 12603, 552, 13, 13, 5215, 12655, 408, 7442, 13, 13, 5215, 17422, 29916, 13, 5215, 17422, 29916, 29889, 1915, 264, 408, 302, 29876, 13, 5215, 432, 1165, 13, 5215, 432, 1165, 29889, 23749, 408, 432, 9302, 13, 3166, 17422, 29916, 29889, 3221, 29889, 29888, 307, 2256, 29918, 8977, 1053, 25022, 2256, 21533, 29892, 3889, 911, 29892, 443, 9021, 911, 13, 3166, 17422, 29916, 29889, 1915, 264, 1053, 14405, 29918, 13168, 29879, 29892, 1207, 29918, 1113, 375, 284, 29918, 13168, 13, 3166, 17422, 29916, 29889, 1915, 264, 29889, 1131, 2509, 1053, 8329, 29918, 4704, 29918, 1131, 2509, 29918, 705, 5861, 13, 3166, 17422, 29916, 29889, 3018, 3901, 29918, 4422, 1053, 1652, 8606, 29918, 8977, 29892, 443, 1579, 8606, 29918, 8977, 13, 3166, 432, 1165, 1053, 425, 29916, 13, 13, 3166, 2023, 4299, 292, 29918, 29888, 21222, 29918, 4905, 29879, 1053, 313, 13, 1678, 383, 21222, 5160, 3195, 6466, 3047, 29925, 579, 2855, 29907, 2124, 4165, 296, 1080, 29892, 13, 1678, 383, 21222, 5160, 3195, 6466, 3047, 11426, 292, 29892, 13, 1678, 383, 21222, 5160, 3195, 6466, 3047, 11426, 292, 2855, 29907, 2124, 4165, 296, 1080, 29892, 13, 1678, 383, 21222, 29907, 1485, 284, 26369, 6466, 3047, 29907, 2124, 4165, 296, 1080, 29892, 13, 1678, 383, 21222, 19832, 287, 26369, 6466, 29892, 13, 1678, 383, 21222, 15329, 552, 29620, 3195, 6466, 29892, 13, 1678, 383, 21222, 9190, 29903, 296, 663, 23084, 919, 272, 6466, 29892, 13, 1678, 383, 21222, 16492, 22550, 292, 3195, 6466, 29892, 13, 1678, 383, 21222, 20529, 2385, 3709, 6466, 29892, 13, 1678, 383, 21222, 6066, 2385, 3709, 6466, 29892, 13, 29897, 13, 3166, 2023, 4299, 292, 29918, 29888, 21222, 29918, 13239, 1053, 313, 13, 1678, 319, 1783, 29906, 29943, 29940, 29892, 13, 1678, 383, 21222, 6572, 5323, 1312, 3195, 29892, 13, 1678, 9773, 29918, 4804, 29918, 11249, 29918, 1514, 1807, 29892, 13, 1678, 9773, 29918, 6506, 29918, 2457, 29918, 1514, 19651, 29892, 13, 1678, 26556, 29918, 4804, 29918, 1514, 1807, 29892, 13, 29897, 13, 3166, 2023, 13239, 1053, 8125, 6466, 29892, 788, 29918, 2962, 29918, 1514, 19651, 29892, 788, 29918, 2962, 29918, 1514, 19651, 29918, 517, 29918, 4299, 29918, 11333, 29892, 12183, 13, 3166, 869, 13305, 29918, 2151, 1053, 16662, 3991, 13, 13, 13, 21707, 353, 12183, 29889, 657, 29918, 21707, 22168, 978, 1649, 29897, 13, 13, 29918, 3210, 16658, 29925, 6992, 29911, 29918, 22051, 29918, 28665, 353, 376, 2151, 29899, 3188, 29899, 4661, 1463, 29908, 13, 29918, 25903, 29918, 22051, 29918, 28665, 353, 376, 29933, 814, 3991, 29908, 13, 29918, 4986, 29968, 1430, 26664, 1001, 29918, 22051, 29918, 28665, 353, 376, 29933, 814, 6066, 3950, 29908, 13, 13, 13, 29992, 29888, 21222, 29889, 4984, 29889, 1272, 1990, 13, 1990, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 6466, 29898, 3195, 6466, 1125, 13, 1678, 9995, 13, 1678, 10604, 1134, 310, 5913, 29933, 814, 2831, 6572, 5323, 2827, 29952, 1822, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 18988, 29918, 1188, 1169, 6695, 29926, 9302, 29889, 299, 2378, 29952, 310, 8267, 12270, 16175, 29918, 2311, 29892, 5665, 29918, 2848, 29892, 2295, 29889, 29894, 542, 370, 29918, 2311, 3569, 1125, 13, 9651, 21099, 2463, 19435, 310, 278, 4086, 1904, 292, 2343, 313, 1557, 2361, 363, 1269, 7931, 370, 352, 653, 5993, 1434, 1105, 615, 7976, 467, 13, 4706, 19359, 29918, 2674, 800, 4034, 29918, 1188, 1169, 6695, 29926, 9302, 29889, 299, 2378, 29952, 310, 8267, 12270, 16175, 29918, 2311, 29892, 29871, 29906, 3569, 1125, 13, 9651, 21099, 2463, 19435, 310, 278, 2446, 5665, 18988, 313, 1990, 2450, 29897, 2343, 313, 1557, 2361, 310, 5852, 29914, 8824, 3133, 362, 13, 9651, 1434, 1105, 615, 7976, 467, 13, 4706, 7934, 29918, 28631, 6695, 23583, 29898, 29926, 9302, 29889, 299, 2378, 20362, 334, 25253, 15966, 4133, 746, 421, 4905, 29918, 10892, 29918, 28631, 29922, 5574, 29952, 338, 4502, 470, 746, 421, 2917, 29889, 4905, 29918, 10892, 29918, 28631, 29922, 5574, 29952, 1125, 13, 9651, 12603, 552, 310, 421, 29926, 9302, 29889, 299, 2378, 29952, 313, 650, 363, 278, 1962, 310, 278, 8297, 29881, 886, 718, 697, 363, 278, 1962, 310, 1269, 7546, 29897, 310, 8267, 13, 9651, 12270, 16175, 29918, 2311, 29892, 5665, 29918, 2848, 29892, 7934, 29918, 2311, 14466, 13, 13, 9651, 379, 4215, 29899, 28631, 310, 278, 1904, 472, 278, 1962, 310, 1269, 7546, 2298, 278, 2847, 23655, 14391, 29889, 13, 4706, 1098, 296, 1080, 6695, 23583, 29898, 29926, 9302, 29889, 299, 2378, 20362, 334, 25253, 15966, 4133, 746, 421, 4905, 29918, 1131, 296, 1080, 29922, 5574, 29952, 338, 4502, 470, 746, 421, 2917, 29889, 4905, 29918, 1131, 296, 1080, 29922, 5574, 29952, 1125, 13, 9651, 12603, 552, 310, 421, 29926, 9302, 29889, 299, 2378, 29952, 313, 650, 363, 1269, 7546, 29897, 310, 8267, 12270, 16175, 29918, 2311, 29892, 954, 29918, 2813, 29879, 29892, 5665, 29918, 2848, 29892, 13, 9651, 5665, 29918, 2848, 14466, 13, 13, 9651, 6212, 296, 1080, 18177, 1156, 278, 8570, 4964, 3317, 29892, 1304, 304, 10272, 278, 7688, 287, 6588, 297, 278, 1583, 29899, 1131, 2509, 13, 9651, 15883, 29889, 13, 1678, 9995, 13, 13, 1678, 18988, 29918, 1188, 1169, 29901, 432, 9302, 29889, 299, 2378, 353, 6213, 13, 1678, 19359, 29918, 2674, 800, 4034, 29918, 1188, 1169, 29901, 432, 9302, 29889, 299, 2378, 353, 6213, 13, 1678, 7934, 29918, 28631, 29901, 28379, 29961, 23215, 552, 29961, 29926, 9302, 29889, 299, 2378, 5262, 353, 6213, 13, 1678, 1098, 296, 1080, 29901, 28379, 29961, 23215, 552, 29961, 29926, 9302, 29889, 299, 2378, 5262, 353, 6213, 13, 13, 13, 13635, 29911, 29918, 25826, 29918, 28665, 20785, 353, 364, 15945, 29908, 13, 13, 1678, 910, 1904, 7846, 1169, 515, 5913, 29943, 21222, 6572, 5323, 1312, 3195, 29952, 1822, 5399, 278, 2428, 1990, 5106, 363, 278, 10035, 3519, 278, 13, 1678, 3489, 10703, 363, 599, 967, 1904, 313, 14565, 408, 28536, 29892, 14238, 322, 17415, 18177, 515, 10772, 29911, 25350, 4733, 29897, 13, 13, 1678, 910, 1904, 338, 884, 263, 383, 21222, 4342, 264, 518, 29888, 21222, 29889, 1915, 264, 29889, 7355, 850, 991, 597, 29888, 21222, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 29888, 21222, 29889, 1915, 264, 29889, 1420, 29937, 5453, 29897, 13, 1678, 19481, 29889, 4803, 372, 408, 263, 4943, 383, 21222, 6276, 264, 15591, 322, 2737, 304, 278, 383, 21222, 5106, 363, 599, 4383, 4475, 304, 13, 1678, 2498, 8744, 322, 6030, 29889, 13, 13, 1678, 9788, 29892, 445, 1904, 11286, 7846, 296, 435, 6604, 5680, 1316, 408, 29901, 13, 13, 1678, 448, 518, 14084, 29899, 797, 29899, 2481, 313, 29967, 1806, 29897, 14835, 850, 991, 597, 6487, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 6487, 29889, 1420, 29937, 5143, 29899, 262, 29899, 2230, 29899, 2388, 8634, 29899, 29926, 277, 29897, 13, 1678, 448, 518, 28451, 2454, 360, 8349, 7268, 362, 850, 991, 597, 6487, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 6487, 29889, 1420, 29937, 17405, 2454, 29899, 29881, 8349, 7268, 362, 29897, 13, 1678, 448, 518, 12877, 2133, 850, 991, 597, 6487, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 6487, 29889, 1420, 29937, 8111, 2133, 29899, 29894, 1958, 29897, 13, 1678, 448, 518, 2177, 6553, 2133, 850, 991, 597, 6487, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 6487, 29889, 1420, 29937, 23482, 2133, 29899, 29886, 1958, 29897, 13, 13, 1678, 12662, 2699, 29901, 13, 4706, 2295, 9310, 29952, 29933, 814, 3991, 29952, 29962, 1125, 8125, 5285, 770, 411, 599, 278, 4128, 310, 278, 1904, 29889, 13, 9651, 17250, 5281, 411, 263, 2295, 934, 947, 451, 2254, 278, 18177, 6942, 411, 278, 1904, 29892, 871, 278, 13, 9651, 5285, 29889, 5399, 714, 278, 5913, 30022, 29943, 21222, 6572, 5323, 1312, 3195, 29889, 3166, 29918, 1457, 3018, 1312, 29952, 29962, 1158, 304, 2254, 278, 1904, 18177, 29889, 13, 4706, 26688, 6695, 6487, 29889, 23749, 29889, 29881, 1853, 1673, 334, 25253, 15966, 21274, 304, 421, 6487, 29889, 23749, 29889, 7411, 29941, 29906, 29952, 1125, 13, 9651, 450, 848, 1134, 310, 278, 16287, 29889, 1815, 367, 697, 310, 421, 6487, 29889, 23749, 29889, 7411, 29941, 29906, 1673, 421, 6487, 29889, 23749, 29889, 7411, 29896, 29953, 29952, 313, 265, 22796, 29879, 29897, 322, 13, 9651, 421, 6487, 29889, 23749, 29889, 1635, 3071, 29896, 29953, 29952, 313, 265, 323, 7056, 29879, 467, 13, 13, 9651, 910, 508, 367, 1304, 304, 9025, 12849, 29899, 17990, 2459, 6694, 470, 4203, 29899, 17990, 2459, 27262, 373, 22796, 29879, 470, 323, 7056, 29879, 29889, 960, 13, 9651, 6790, 599, 278, 16287, 674, 367, 8560, 411, 278, 2183, 421, 29881, 1853, 1412, 13, 13, 9651, 3579, 9842, 393, 445, 871, 1580, 11057, 278, 26688, 310, 278, 16287, 322, 947, 451, 9949, 278, 26688, 310, 1904, 13, 9651, 4128, 29889, 1068, 13, 13, 9651, 960, 366, 6398, 304, 1735, 278, 26688, 310, 278, 1904, 4128, 29892, 1074, 5913, 30022, 29943, 21222, 6572, 5323, 1312, 3195, 29889, 517, 29918, 18091, 29896, 29953, 29952, 29962, 322, 13, 9651, 5913, 30022, 29943, 21222, 6572, 5323, 1312, 3195, 29889, 517, 29918, 1635, 29896, 29953, 29952, 1822, 13, 4706, 26688, 6695, 6487, 29889, 23749, 29889, 29881, 1853, 1673, 334, 25253, 15966, 21274, 304, 421, 6487, 29889, 23749, 29889, 7411, 29941, 29906, 29952, 1125, 13, 9651, 450, 848, 1134, 310, 278, 16287, 29889, 1815, 367, 697, 310, 421, 6487, 29889, 23749, 29889, 7411, 29941, 29906, 1673, 421, 6487, 29889, 23749, 29889, 7411, 29896, 29953, 29952, 313, 265, 22796, 29879, 29897, 322, 13, 9651, 421, 6487, 29889, 23749, 29889, 1635, 3071, 29896, 29953, 29952, 313, 265, 323, 7056, 29879, 467, 13, 13, 9651, 910, 508, 367, 1304, 304, 9025, 12849, 29899, 17990, 2459, 6694, 470, 4203, 29899, 17990, 2459, 27262, 373, 22796, 29879, 470, 323, 7056, 29879, 29889, 960, 13, 9651, 6790, 599, 278, 16287, 674, 367, 8560, 411, 278, 2183, 421, 29881, 1853, 1412, 13, 13, 9651, 3579, 9842, 393, 445, 871, 1580, 11057, 278, 26688, 310, 278, 16287, 322, 947, 451, 9949, 278, 26688, 310, 1904, 13, 9651, 4128, 29889, 1068, 13, 13, 9651, 960, 366, 6398, 304, 1735, 278, 26688, 310, 278, 1904, 4128, 29892, 1074, 5913, 30022, 29943, 21222, 6572, 5323, 1312, 3195, 29889, 517, 29918, 18091, 29896, 29953, 29952, 29962, 322, 13, 9651, 5913, 30022, 29943, 21222, 6572, 5323, 1312, 3195, 29889, 517, 29918, 1635, 29896, 29953, 29952, 1822, 13, 13, 15945, 29908, 13, 13, 13635, 29911, 29918, 1177, 12336, 29903, 29918, 28665, 20785, 353, 364, 15945, 29908, 13, 1678, 826, 3174, 29901, 13, 4706, 1881, 29918, 4841, 6695, 23749, 29889, 299, 2378, 29952, 310, 8267, 421, 3319, 29900, 1800, 29952, 1125, 13, 9651, 1894, 1575, 310, 1881, 5665, 18897, 297, 278, 7931, 370, 352, 653, 29889, 13, 13, 9651, 1894, 1575, 508, 367, 7625, 773, 5913, 29933, 814, 6066, 3950, 29952, 1822, 2823, 5913, 6572, 5323, 1312, 6066, 3950, 29889, 12508, 29952, 29962, 322, 13, 9651, 5913, 6572, 5323, 1312, 6066, 3950, 17255, 4804, 1649, 29952, 29962, 363, 4902, 29889, 13, 13, 9651, 518, 5618, 526, 1881, 23481, 10846, 6995, 3820, 2209, 653, 29937, 2080, 29899, 4841, 29897, 13, 4706, 8570, 29918, 13168, 6695, 23749, 29889, 299, 2378, 29952, 310, 8267, 421, 3319, 29900, 1800, 1673, 334, 25253, 29930, 1125, 13, 9651, 341, 1278, 304, 4772, 15859, 8570, 373, 7164, 5993, 16285, 29889, 341, 1278, 1819, 4629, 297, 10338, 29900, 29892, 29871, 29896, 29962, 6998, 13, 13, 9651, 448, 29871, 29896, 363, 18897, 393, 526, 3579, 1333, 11105, 287, 1068, 29892, 13, 9651, 448, 29871, 29900, 363, 18897, 393, 526, 3579, 13168, 287, 1068, 29889, 13, 13, 9651, 518, 5618, 526, 8570, 11105, 29879, 10846, 6995, 3820, 2209, 653, 29937, 1131, 2509, 29899, 13168, 29897, 13, 4706, 5993, 29918, 1853, 29918, 4841, 6695, 23749, 29889, 299, 2378, 29952, 310, 8267, 421, 3319, 29900, 1800, 1673, 334, 25253, 29930, 1125, 13, 9651, 6667, 358, 5993, 16285, 304, 12266, 937, 322, 1473, 2011, 1080, 310, 278, 10970, 29889, 1894, 1575, 526, 4629, 297, 10338, 29900, 29892, 13, 632, 29896, 29962, 6998, 13, 13, 9651, 448, 29871, 29900, 16161, 304, 263, 334, 18616, 663, 319, 29930, 5993, 29892, 13, 9651, 448, 29871, 29896, 16161, 304, 263, 334, 18616, 663, 350, 29930, 5993, 29889, 13, 13, 9651, 518, 5618, 526, 5993, 1134, 23481, 10846, 6995, 3820, 2209, 653, 29937, 6979, 29899, 1853, 29899, 4841, 29897, 13, 4706, 2602, 29918, 4841, 6695, 23749, 29889, 299, 2378, 29952, 310, 8267, 421, 3319, 29900, 1800, 1673, 334, 25253, 29930, 1125, 13, 9651, 1894, 1575, 310, 11909, 310, 1269, 1881, 5665, 18897, 297, 278, 2602, 8297, 29881, 886, 29889, 22012, 297, 278, 3464, 10338, 29900, 29892, 13, 9651, 2295, 29889, 3317, 29918, 3283, 29918, 17987, 29881, 886, 448, 29871, 29896, 27865, 13, 4706, 2343, 29918, 13168, 6695, 23749, 29889, 299, 2378, 29952, 310, 8267, 421, 3319, 29900, 1800, 1673, 421, 25253, 1125, 13, 9651, 341, 1278, 304, 1870, 1598, 4629, 15883, 310, 278, 8570, 10585, 29889, 341, 1278, 1819, 4629, 297, 10338, 29900, 29892, 29871, 29896, 29962, 6998, 13, 13, 9651, 448, 29871, 29896, 14088, 278, 2343, 338, 3579, 1333, 11105, 287, 1068, 29892, 13, 9651, 448, 29871, 29900, 14088, 278, 2343, 338, 3579, 13168, 287, 1068, 29889, 13, 13, 4706, 736, 29918, 8977, 6695, 11227, 1673, 334, 25253, 29930, 1125, 13, 9651, 26460, 470, 451, 304, 736, 263, 5913, 30022, 13239, 29889, 3195, 6466, 29952, 29962, 2012, 310, 263, 8656, 18761, 29889, 13, 13, 15945, 29908, 13, 13, 13, 1990, 383, 21222, 29933, 814, 6026, 2580, 29881, 886, 29898, 15755, 29889, 7355, 1125, 13, 1678, 9995, 1168, 4984, 278, 8297, 29881, 886, 515, 1734, 29892, 2602, 322, 5993, 29918, 1853, 8297, 29881, 886, 1213, 15945, 13, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1742, 29918, 17987, 29881, 886, 353, 302, 29876, 29889, 6026, 2580, 29898, 13, 9651, 1583, 29889, 2917, 29889, 29894, 542, 370, 29918, 2311, 29892, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 23655, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 4172, 3359, 29922, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 4706, 1723, 13, 4706, 1583, 29889, 3283, 29918, 17987, 29881, 886, 353, 302, 29876, 29889, 6026, 2580, 29898, 13, 9651, 1583, 29889, 2917, 29889, 3317, 29918, 3283, 29918, 17987, 29881, 886, 29892, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 23655, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 4172, 3359, 29922, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 4706, 1723, 13, 4706, 1583, 29889, 6979, 29918, 1853, 29918, 17987, 29881, 886, 353, 302, 29876, 29889, 6026, 2580, 29898, 13, 9651, 1583, 29889, 2917, 29889, 1853, 29918, 29894, 542, 370, 29918, 2311, 29892, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 23655, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 4172, 3359, 29922, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 4706, 1723, 13, 4706, 1583, 29889, 14420, 29940, 555, 353, 302, 29876, 29889, 14420, 29940, 555, 29898, 5463, 29922, 1311, 29889, 2917, 29889, 13148, 29918, 12324, 29918, 8961, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 8865, 449, 353, 302, 29876, 29889, 15063, 449, 29898, 10492, 29922, 1311, 29889, 2917, 29889, 10892, 29918, 8865, 449, 29918, 22795, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 1881, 29918, 4841, 29892, 5993, 29918, 1853, 29918, 4841, 29892, 2602, 29918, 4841, 29892, 8570, 29918, 13168, 29892, 11806, 4695, 29901, 6120, 353, 5852, 1125, 13, 4706, 396, 2812, 2580, 13, 4706, 10970, 29918, 1590, 5779, 353, 1583, 29889, 1742, 29918, 17987, 29881, 886, 29898, 2080, 29918, 4841, 29889, 579, 668, 703, 29875, 29946, 5783, 13, 4706, 2602, 29918, 1590, 5779, 353, 1583, 29889, 3283, 29918, 17987, 29881, 886, 29898, 3283, 29918, 4841, 29889, 579, 668, 703, 29875, 29946, 5783, 13, 4706, 5993, 29918, 1853, 29918, 17987, 29881, 886, 353, 1583, 29889, 6979, 29918, 1853, 29918, 17987, 29881, 886, 29898, 6979, 29918, 1853, 29918, 4841, 29889, 579, 668, 703, 29875, 29946, 5783, 13, 13, 4706, 396, 6991, 599, 8297, 29881, 886, 13, 4706, 7934, 29918, 28631, 353, 10970, 29918, 1590, 5779, 718, 5993, 29918, 1853, 29918, 17987, 29881, 886, 718, 2602, 29918, 1590, 5779, 13, 13, 4706, 396, 365, 2747, 5655, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 14420, 29940, 555, 29898, 10892, 29918, 28631, 29897, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 8865, 449, 29898, 10892, 29918, 28631, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 29897, 13, 4706, 736, 7934, 29918, 28631, 13, 13, 13, 1990, 383, 21222, 29933, 814, 24313, 4165, 2509, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 3269, 284, 29901, 6120, 353, 7700, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2813, 29918, 6229, 353, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 849, 1583, 29889, 2917, 29889, 1949, 29918, 1131, 2509, 29918, 2813, 29879, 13, 4706, 565, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 1273, 1583, 29889, 2917, 29889, 1949, 29918, 1131, 2509, 29918, 2813, 29879, 2804, 29871, 29900, 29901, 13, 9651, 12020, 7865, 2392, 29898, 13, 18884, 29724, 2917, 29889, 10892, 29918, 2311, 6998, 426, 1311, 29889, 2917, 29889, 10892, 29918, 2311, 29913, 756, 304, 367, 263, 2999, 310, 421, 2917, 29889, 1949, 29918, 1131, 2509, 29918, 2813, 29879, 29952, 29905, 13, 462, 1678, 584, 426, 1311, 29889, 2917, 29889, 1949, 29918, 1131, 2509, 29918, 2813, 29879, 5038, 13, 9651, 1723, 13, 13, 4706, 1583, 29889, 1972, 353, 302, 29876, 29889, 29928, 1947, 29898, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 9651, 8466, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 4706, 1723, 13, 4706, 1583, 29889, 1989, 353, 302, 29876, 29889, 29928, 1947, 29898, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 9651, 8466, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 4706, 1723, 13, 4706, 1583, 29889, 1767, 353, 302, 29876, 29889, 29928, 1947, 29898, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 9651, 8466, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 4706, 1723, 13, 13, 4706, 565, 1583, 29889, 1113, 375, 284, 29901, 13, 9651, 1583, 29889, 1113, 375, 284, 29918, 13168, 353, 1207, 29918, 1113, 375, 284, 29918, 13168, 29898, 13, 18884, 432, 9302, 29889, 2873, 3552, 29896, 29892, 1583, 29889, 2917, 29889, 3317, 29918, 3283, 29918, 17987, 29881, 886, 511, 26688, 543, 11227, 4968, 26688, 543, 11227, 29908, 13, 9651, 1723, 13, 13, 1678, 822, 903, 5451, 29918, 2813, 29879, 29898, 1311, 29892, 7934, 29918, 28631, 1125, 13, 4706, 736, 7934, 29918, 28631, 29889, 690, 14443, 29898, 10892, 29918, 28631, 29889, 12181, 7503, 29906, 29962, 718, 313, 1311, 29889, 2917, 29889, 1949, 29918, 1131, 2509, 29918, 2813, 29879, 29892, 1583, 29889, 2813, 29918, 6229, 876, 13, 13, 1678, 822, 903, 14634, 29918, 2813, 29879, 29898, 1311, 29892, 7934, 29918, 28631, 1125, 13, 4706, 736, 7934, 29918, 28631, 29889, 690, 14443, 29898, 10892, 29918, 28631, 29889, 12181, 7503, 29906, 29962, 718, 313, 1311, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 876, 13, 13, 1678, 732, 15755, 29889, 2388, 627, 13, 1678, 396, 10061, 1000, 515, 4327, 414, 29889, 9794, 29889, 29890, 442, 29889, 4299, 292, 29918, 29888, 21222, 29918, 29890, 442, 29889, 29943, 21222, 29933, 442, 4165, 2509, 3032, 535, 29883, 2579, 403, 29918, 517, 29918, 8173, 13, 1678, 822, 903, 535, 29883, 2579, 403, 29918, 517, 29918, 8173, 29898, 1311, 29892, 1820, 29892, 995, 29892, 2346, 29892, 8570, 29918, 13168, 1125, 13, 4706, 9995, 13, 4706, 910, 740, 4893, 2060, 287, 1820, 29892, 995, 5922, 515, 263, 2323, 1881, 5993, 322, 16125, 1078, 278, 5922, 304, 22152, 13, 4706, 5922, 515, 3517, 6576, 29889, 910, 740, 338, 2243, 1141, 368, 23430, 515, 278, 6221, 383, 21222, 9810, 29901, 13, 4706, 2045, 597, 3292, 29889, 510, 29914, 3608, 29914, 29888, 21222, 29914, 10054, 29914, 29946, 29929, 29896, 346, 29896, 29947, 29955, 29945, 29929, 29953, 29906, 29906, 29945, 29900, 29953, 29945, 29947, 29947, 29955, 29947, 29946, 29890, 29946, 29888, 1113, 29900, 29872, 29946, 1635, 29900, 29945, 29888, 29947, 29883, 29947, 2252, 29914, 29888, 21222, 29914, 1915, 264, 29914, 1131, 2509, 29889, 2272, 29937, 29931, 29906, 29945, 29906, 13, 4706, 9995, 13, 4706, 396, 6459, 565, 591, 29915, 276, 2847, 5281, 491, 18070, 310, 5923, 7090, 848, 29889, 13, 4706, 338, 29918, 11228, 1891, 353, 1583, 29889, 5349, 29918, 11918, 703, 8173, 613, 376, 29883, 3791, 29918, 1989, 1159, 13, 4706, 22152, 29918, 1989, 353, 1583, 29889, 11918, 703, 8173, 613, 376, 29883, 3791, 29918, 1989, 613, 432, 9302, 29889, 3298, 359, 29892, 1820, 29889, 12181, 29892, 1820, 29889, 29881, 1853, 29897, 13, 4706, 22152, 29918, 1767, 353, 1583, 29889, 11918, 703, 8173, 613, 376, 29883, 3791, 29918, 1767, 613, 432, 9302, 29889, 3298, 359, 29892, 995, 29889, 12181, 29892, 995, 29889, 29881, 1853, 29897, 13, 4706, 7090, 29918, 2248, 353, 1583, 29889, 11918, 703, 8173, 613, 376, 8173, 29918, 2248, 613, 14013, 29901, 432, 9302, 29889, 2378, 29898, 29900, 29892, 26688, 29922, 29926, 9302, 29889, 524, 29941, 29906, 876, 13, 13, 4706, 565, 338, 29918, 11228, 1891, 29901, 13, 9651, 334, 16175, 29918, 6229, 29879, 29892, 4236, 29918, 2848, 29892, 954, 29918, 2813, 29879, 29892, 10809, 29918, 546, 29918, 2813, 353, 22152, 29918, 1989, 29889, 1767, 29889, 12181, 13, 9651, 396, 2767, 1820, 29892, 995, 274, 14520, 411, 1749, 716, 29871, 29896, 29881, 18652, 269, 29399, 13, 9651, 3151, 29918, 2248, 353, 7090, 29918, 2248, 29889, 1767, 13, 9651, 16285, 353, 313, 29900, 29892, 29897, 334, 7431, 29898, 16175, 29918, 6229, 29879, 29897, 718, 313, 2764, 29918, 2248, 29892, 29871, 29900, 29892, 29871, 29900, 29897, 13, 9651, 1820, 353, 425, 29916, 29889, 16626, 29918, 5504, 29918, 18337, 29898, 29883, 3791, 29918, 1989, 29889, 1767, 29892, 1820, 29892, 16285, 29897, 13, 9651, 995, 353, 425, 29916, 29889, 16626, 29918, 5504, 29918, 18337, 29898, 29883, 3791, 29918, 1767, 29889, 1767, 29892, 995, 29892, 16285, 29897, 13, 9651, 22152, 29918, 1989, 29889, 1767, 353, 1820, 13, 9651, 22152, 29918, 1767, 29889, 1767, 353, 995, 13, 9651, 954, 29918, 21402, 29918, 8173, 29918, 345, 14359, 353, 2346, 29889, 12181, 29961, 29896, 29962, 13, 9651, 7090, 29918, 2248, 29889, 1767, 353, 7090, 29918, 2248, 29889, 1767, 718, 954, 29918, 21402, 29918, 8173, 29918, 345, 14359, 13, 9651, 396, 3269, 284, 11105, 363, 22152, 1602, 6119, 1583, 29899, 1131, 2509, 29901, 1749, 2323, 2346, 2602, 881, 871, 14333, 304, 1906, 1820, 11909, 393, 505, 2307, 1063, 5759, 322, 22152, 29892, 451, 278, 9886, 5225, 3161, 29889, 13, 9651, 17132, 29918, 13168, 353, 432, 9302, 29889, 6729, 328, 4384, 29918, 517, 29898, 13, 18884, 432, 9302, 29889, 279, 927, 29898, 3317, 29918, 2848, 29897, 529, 3151, 29918, 2248, 718, 954, 29918, 21402, 29918, 8173, 29918, 345, 14359, 29892, 13, 18884, 18761, 29898, 16175, 29918, 6229, 29879, 29897, 718, 313, 29896, 29892, 954, 29918, 21402, 29918, 8173, 29918, 345, 14359, 29892, 4236, 29918, 2848, 511, 13, 9651, 1723, 13, 9651, 8570, 29918, 13168, 353, 14405, 29918, 13168, 29879, 29898, 8305, 29918, 13168, 29892, 8570, 29918, 13168, 29897, 13, 4706, 736, 1820, 29892, 995, 29892, 8570, 29918, 13168, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 7934, 29918, 28631, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 7546, 29918, 2813, 29918, 13168, 29892, 13, 4706, 1820, 29918, 1767, 29918, 28631, 29901, 28379, 29961, 29926, 9302, 29889, 2378, 29962, 353, 6213, 29892, 13, 4706, 2069, 29918, 8173, 29901, 6120, 353, 7700, 29892, 13, 4706, 11806, 4695, 29922, 5574, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 268, 1125, 13, 4706, 396, 565, 1820, 29918, 1767, 29918, 28631, 526, 4944, 445, 7546, 338, 1304, 408, 263, 4891, 29899, 1131, 2509, 7546, 13, 4706, 396, 363, 278, 1602, 6119, 13, 4706, 338, 29918, 19128, 29918, 1131, 2509, 353, 1820, 29918, 1767, 29918, 28631, 338, 451, 6213, 13, 4706, 9853, 29918, 2311, 353, 7934, 29918, 28631, 29889, 12181, 29961, 29900, 29962, 13, 13, 4706, 396, 679, 2346, 410, 29926, 13, 4706, 2346, 29918, 28631, 353, 1583, 29889, 1972, 29898, 10892, 29918, 28631, 29897, 13, 4706, 396, 679, 1820, 29892, 995, 410, 29926, 13, 4706, 565, 338, 29918, 19128, 29918, 1131, 2509, 29901, 13, 9651, 396, 4891, 29918, 1131, 296, 1080, 13, 9651, 1820, 29918, 28631, 353, 1583, 29889, 1989, 29898, 1989, 29918, 1767, 29918, 28631, 29897, 13, 9651, 995, 29918, 28631, 353, 1583, 29889, 1767, 29898, 1989, 29918, 1767, 29918, 28631, 29897, 13, 4706, 1683, 29901, 13, 9651, 396, 1583, 29918, 1131, 2509, 13, 9651, 1820, 29918, 28631, 353, 1583, 29889, 1989, 29898, 10892, 29918, 28631, 29897, 13, 9651, 995, 29918, 28631, 353, 1583, 29889, 1767, 29898, 10892, 29918, 28631, 29897, 13, 13, 4706, 2346, 29918, 28631, 353, 1583, 3032, 5451, 29918, 2813, 29879, 29898, 1972, 29918, 28631, 29897, 13, 4706, 1820, 29918, 28631, 353, 1583, 3032, 5451, 29918, 2813, 29879, 29898, 1989, 29918, 28631, 29897, 13, 4706, 995, 29918, 28631, 353, 1583, 3032, 5451, 29918, 2813, 29879, 29898, 1767, 29918, 28631, 29897, 13, 13, 4706, 396, 4386, 7090, 19012, 3269, 284, 8570, 11105, 13, 4706, 565, 1583, 29889, 1113, 375, 284, 29901, 13, 9651, 2346, 29918, 2848, 29892, 1820, 29918, 2848, 353, 2346, 29918, 28631, 29889, 12181, 29961, 29896, 1402, 1820, 29918, 28631, 29889, 12181, 29961, 29896, 29962, 13, 9651, 565, 1583, 29889, 5349, 29918, 11918, 703, 8173, 613, 376, 29883, 3791, 29918, 1989, 29908, 1125, 13, 18884, 11105, 29918, 10889, 353, 1583, 29889, 20897, 3366, 8173, 3108, 3366, 8173, 29918, 2248, 3108, 13, 18884, 4236, 29918, 7099, 6119, 29918, 2848, 353, 1583, 29889, 20897, 3366, 8173, 3108, 3366, 29883, 3791, 29918, 1989, 16862, 12181, 29961, 29896, 29962, 13, 18884, 3269, 284, 29918, 13168, 353, 425, 29916, 29889, 16626, 29918, 18337, 29898, 13, 462, 1678, 1583, 29889, 1113, 375, 284, 29918, 13168, 29892, 313, 29900, 29892, 29871, 29900, 29892, 11105, 29918, 10889, 29892, 29871, 29900, 511, 313, 29896, 29892, 29871, 29896, 29892, 2346, 29918, 2848, 29892, 4236, 29918, 7099, 6119, 29918, 2848, 29897, 13, 18884, 1723, 13, 9651, 1683, 29901, 13, 18884, 3269, 284, 29918, 13168, 353, 1583, 29889, 1113, 375, 284, 29918, 13168, 7503, 29892, 584, 29892, 584, 1972, 29918, 2848, 29892, 584, 1989, 29918, 2848, 29962, 13, 9651, 3269, 284, 29918, 13168, 353, 432, 9302, 29889, 6729, 328, 4384, 29918, 517, 29898, 1113, 375, 284, 29918, 13168, 29892, 313, 16175, 29918, 2311, 29892, 29897, 718, 3269, 284, 29918, 13168, 29889, 12181, 29961, 29896, 29901, 2314, 13, 13, 4706, 396, 14405, 11105, 29879, 565, 4312, 13, 4706, 565, 8570, 29918, 13168, 338, 451, 6213, 322, 1583, 29889, 1113, 375, 284, 29901, 13, 9651, 8570, 29918, 13168, 353, 432, 9302, 29889, 6729, 328, 4384, 29918, 517, 29898, 29926, 9302, 29889, 18837, 29918, 6229, 29879, 29898, 1131, 2509, 29918, 13168, 29892, 9685, 29922, 6278, 29941, 29892, 448, 29906, 8243, 3269, 284, 29918, 13168, 29889, 12181, 29897, 13, 9651, 8570, 29918, 13168, 353, 14405, 29918, 13168, 29879, 29898, 1131, 2509, 29918, 13168, 29892, 3269, 284, 29918, 13168, 29897, 13, 4706, 25342, 1583, 29889, 1113, 375, 284, 29901, 13, 9651, 8570, 29918, 13168, 353, 3269, 284, 29918, 13168, 13, 4706, 25342, 8570, 29918, 13168, 338, 451, 6213, 29901, 13, 9651, 8570, 29918, 13168, 353, 432, 9302, 29889, 18837, 29918, 6229, 29879, 29898, 1131, 2509, 29918, 13168, 29892, 9685, 29922, 6278, 29941, 29892, 448, 29906, 876, 13, 13, 4706, 396, 7133, 5172, 8478, 387, 1253, 573, 1602, 3689, 29892, 591, 8343, 697, 2602, 472, 263, 931, 29892, 13, 4706, 396, 322, 7090, 278, 6611, 322, 1819, 4331, 491, 4331, 29889, 13, 4706, 565, 1583, 29889, 1113, 375, 284, 322, 313, 1311, 29889, 5349, 29918, 11918, 703, 8173, 613, 376, 29883, 3791, 29918, 1989, 1159, 470, 2069, 29918, 8173, 1125, 13, 9651, 1820, 29918, 28631, 29892, 995, 29918, 28631, 29892, 8570, 29918, 13168, 353, 1583, 3032, 535, 29883, 2579, 403, 29918, 517, 29918, 8173, 29898, 13, 18884, 1820, 29918, 28631, 29892, 995, 29918, 28631, 29892, 2346, 29918, 28631, 29892, 8570, 29918, 13168, 13, 9651, 1723, 13, 13, 4706, 396, 14806, 278, 7223, 8570, 11105, 304, 385, 8570, 24003, 29889, 13, 4706, 565, 8570, 29918, 13168, 338, 451, 6213, 29901, 13, 9651, 396, 8570, 11105, 297, 278, 883, 310, 8570, 24003, 13, 9651, 8570, 29918, 29890, 3173, 353, 425, 29916, 29889, 2622, 29898, 13, 18884, 8570, 29918, 13168, 1405, 29871, 29900, 29892, 13, 18884, 432, 9302, 29889, 8159, 29898, 1131, 2509, 29918, 13168, 29889, 12181, 29892, 29871, 29900, 29889, 29900, 467, 579, 668, 29898, 1311, 29889, 29881, 1853, 511, 13, 18884, 432, 9302, 29889, 8159, 29898, 1131, 2509, 29918, 13168, 29889, 12181, 29892, 448, 29896, 29872, 29896, 29900, 467, 579, 668, 29898, 1311, 29889, 29881, 1853, 511, 13, 9651, 1723, 13, 4706, 1683, 29901, 13, 9651, 8570, 29918, 29890, 3173, 353, 6213, 13, 13, 4706, 5768, 449, 29918, 29878, 865, 353, 6213, 13, 4706, 565, 451, 11806, 4695, 322, 1583, 29889, 2917, 29889, 1131, 2509, 29918, 771, 5824, 29918, 8865, 449, 29918, 22795, 1405, 29871, 29900, 29889, 29900, 29901, 13, 9651, 5768, 449, 29918, 29878, 865, 353, 1583, 29889, 5675, 29918, 29878, 865, 703, 8865, 449, 1159, 13, 13, 4706, 1098, 29876, 29918, 705, 5861, 353, 8329, 29918, 4704, 29918, 1131, 2509, 29918, 705, 5861, 29898, 13, 9651, 2346, 29918, 28631, 29892, 13, 9651, 1820, 29918, 28631, 29892, 13, 9651, 24003, 29922, 1131, 2509, 29918, 29890, 3173, 29892, 13, 9651, 5768, 449, 29918, 29878, 865, 29922, 8865, 449, 29918, 29878, 865, 29892, 13, 9651, 5768, 449, 29918, 10492, 29922, 1311, 29889, 2917, 29889, 1131, 2509, 29918, 771, 5824, 29918, 8865, 449, 29918, 22795, 29892, 13, 9651, 12672, 29918, 8865, 449, 29922, 5574, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 9651, 16716, 29922, 8516, 29892, 13, 4706, 1723, 13, 13, 4706, 396, 341, 1278, 15883, 565, 591, 864, 304, 13, 4706, 565, 7546, 29918, 2813, 29918, 13168, 338, 451, 6213, 29901, 13, 9651, 1098, 29876, 29918, 705, 5861, 353, 432, 9302, 29889, 29872, 1144, 398, 703, 856, 29882, 29939, 29895, 29892, 29882, 976, 856, 29882, 29939, 29895, 613, 1098, 29876, 29918, 705, 5861, 29892, 7546, 29918, 2813, 29918, 13168, 29897, 13, 13, 4706, 1098, 29876, 29918, 4905, 353, 432, 9302, 29889, 29872, 1144, 398, 703, 856, 29882, 29939, 29895, 29892, 856, 15339, 29881, 976, 856, 29939, 16440, 613, 1098, 29876, 29918, 705, 5861, 29892, 995, 29918, 28631, 29897, 13, 4706, 1098, 29876, 29918, 4905, 353, 1098, 29876, 29918, 4905, 29889, 690, 14443, 29898, 1131, 29876, 29918, 4905, 29889, 12181, 7503, 29906, 29962, 718, 8521, 29896, 29892, 876, 13, 13, 4706, 14391, 353, 313, 1131, 29876, 29918, 4905, 29892, 1098, 29876, 29918, 705, 5861, 29897, 565, 1962, 29918, 1131, 296, 1080, 1683, 313, 1131, 29876, 29918, 4905, 29892, 29897, 13, 4706, 736, 14391, 13, 13, 13, 1990, 383, 21222, 29933, 814, 24313, 6466, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1145, 344, 353, 302, 29876, 29889, 29928, 1947, 29898, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 8466, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 4706, 1723, 13, 4706, 1583, 29889, 14420, 29940, 555, 353, 302, 29876, 29889, 14420, 29940, 555, 29898, 5463, 29922, 1311, 29889, 2917, 29889, 13148, 29918, 12324, 29918, 8961, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 8865, 449, 353, 302, 29876, 29889, 15063, 449, 29898, 10492, 29922, 1311, 29889, 2917, 29889, 10892, 29918, 8865, 449, 29918, 22795, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 7934, 29918, 28631, 29892, 1881, 29918, 20158, 29892, 11806, 4695, 29901, 6120, 353, 5852, 1125, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 1145, 344, 29898, 10892, 29918, 28631, 29897, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 8865, 449, 29898, 10892, 29918, 28631, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 29897, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 14420, 29940, 555, 29898, 10892, 29918, 28631, 718, 1881, 29918, 20158, 29897, 13, 4706, 736, 7934, 29918, 28631, 13, 13, 13, 1990, 383, 21222, 29933, 814, 4165, 2509, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 3269, 284, 29901, 6120, 353, 7700, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1311, 353, 383, 21222, 29933, 814, 24313, 4165, 2509, 29898, 1311, 29889, 2917, 29892, 3269, 284, 29922, 1311, 29889, 1113, 375, 284, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 4905, 353, 383, 21222, 29933, 814, 24313, 6466, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 7934, 29918, 28631, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 7546, 29918, 2813, 29918, 13168, 29892, 13, 4706, 1820, 29918, 1767, 29918, 28631, 29922, 8516, 29892, 13, 4706, 2069, 29918, 8173, 29922, 8824, 29892, 13, 4706, 11806, 4695, 29922, 5574, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 268, 1125, 13, 4706, 396, 6212, 2509, 11105, 5304, 297, 408, 8570, 29918, 13168, 29889, 12181, 1275, 3070, 16175, 29918, 29879, 7093, 29892, 10908, 29918, 2848, 29897, 13, 4706, 396, 383, 4375, 29990, 23347, 29901, 8570, 29918, 13168, 29889, 12181, 1275, 3070, 16175, 29918, 29879, 7093, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 10908, 29918, 2848, 29897, 1316, 393, 372, 338, 12672, 519, 13, 4706, 396, 411, 1098, 29876, 29918, 705, 5861, 29889, 12181, 1275, 3070, 16175, 29918, 29879, 7093, 29892, 954, 29918, 2813, 29879, 29892, 3855, 29918, 2848, 29892, 10908, 29918, 2848, 29897, 13, 4706, 1098, 29876, 29918, 4905, 29879, 353, 1583, 29889, 1311, 29898, 13, 9651, 7934, 29918, 28631, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 7546, 29918, 2813, 29918, 13168, 29922, 13148, 29918, 2813, 29918, 13168, 29892, 13, 9651, 1820, 29918, 1767, 29918, 28631, 29922, 1989, 29918, 1767, 29918, 28631, 29892, 13, 9651, 2069, 29918, 8173, 29922, 2344, 29918, 8173, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 4706, 1098, 29876, 29918, 4905, 353, 1098, 29876, 29918, 4905, 29879, 29961, 29900, 29962, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 4905, 29898, 1131, 29876, 29918, 4905, 29892, 7934, 29918, 28631, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 29897, 13, 13, 4706, 14391, 353, 313, 10892, 29918, 28631, 29892, 29897, 13, 13, 4706, 565, 1962, 29918, 1131, 296, 1080, 29901, 13, 9651, 14391, 4619, 313, 1131, 29876, 29918, 4905, 29879, 29961, 29896, 1402, 29897, 13, 13, 4706, 736, 14391, 13, 13, 13, 1990, 383, 21222, 29933, 814, 4074, 13847, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1145, 344, 353, 302, 29876, 29889, 29928, 1947, 29898, 13, 9651, 1583, 29889, 2917, 29889, 1639, 13847, 29918, 2311, 29892, 13, 9651, 8466, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 4706, 1723, 13, 4706, 1583, 29889, 11236, 362, 353, 319, 1783, 29906, 29943, 29940, 29961, 1311, 29889, 2917, 29889, 10892, 29918, 627, 29962, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 7934, 29918, 28631, 1125, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 1145, 344, 29898, 10892, 29918, 28631, 29897, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 11236, 362, 29898, 10892, 29918, 28631, 29897, 13, 4706, 736, 7934, 29918, 28631, 13, 13, 13, 1990, 383, 21222, 29933, 814, 6466, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1145, 344, 353, 302, 29876, 29889, 29928, 1947, 29898, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 8466, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 4706, 1723, 13, 4706, 1583, 29889, 8865, 449, 353, 302, 29876, 29889, 15063, 449, 29898, 10492, 29922, 1311, 29889, 2917, 29889, 10892, 29918, 8865, 449, 29918, 22795, 29897, 13, 4706, 1583, 29889, 14420, 29940, 555, 353, 302, 29876, 29889, 14420, 29940, 555, 29898, 5463, 29922, 1311, 29889, 2917, 29889, 13148, 29918, 12324, 29918, 8961, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 7934, 29918, 28631, 29892, 8570, 29918, 4905, 29892, 11806, 4695, 29901, 6120, 353, 5852, 1125, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 1145, 344, 29898, 10892, 29918, 28631, 29897, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 8865, 449, 29898, 10892, 29918, 28631, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 29897, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 14420, 29940, 555, 29898, 10892, 29918, 28631, 718, 8570, 29918, 4905, 29897, 13, 4706, 736, 7934, 29918, 28631, 13, 13, 13, 1990, 383, 21222, 29933, 814, 14420, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1131, 2509, 353, 383, 21222, 29933, 814, 4165, 2509, 29898, 1311, 29889, 2917, 29892, 3269, 284, 29922, 1311, 29889, 2917, 29889, 275, 29918, 7099, 6119, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 1639, 13847, 353, 383, 21222, 29933, 814, 4074, 13847, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 4905, 353, 383, 21222, 29933, 814, 6466, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 565, 1583, 29889, 2917, 29889, 1202, 29918, 19128, 29918, 1131, 2509, 29901, 13, 9651, 1583, 29889, 19128, 1131, 2509, 353, 383, 21222, 29933, 814, 4165, 2509, 29898, 1311, 29889, 2917, 29892, 3269, 284, 29922, 8824, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 7934, 29918, 28631, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 7546, 29918, 2813, 29918, 13168, 29892, 13, 4706, 2094, 6119, 29918, 10892, 29918, 28631, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2069, 29918, 8173, 29901, 6120, 353, 7700, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 268, 1125, 13, 4706, 396, 21782, 6212, 2509, 13, 4706, 8570, 29918, 4905, 29879, 353, 1583, 29889, 1131, 2509, 29898, 13, 9651, 7934, 29918, 28631, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 7546, 29918, 2813, 29918, 13168, 29922, 13148, 29918, 2813, 29918, 13168, 29892, 13, 9651, 2069, 29918, 8173, 29922, 2344, 29918, 8173, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 4706, 8570, 29918, 4905, 353, 8570, 29918, 4905, 29879, 29961, 29900, 29962, 13, 13, 4706, 396, 11189, 29899, 4165, 2509, 15658, 13, 4706, 565, 2094, 6119, 29918, 10892, 29918, 28631, 338, 451, 6213, 29901, 13, 9651, 4891, 29918, 1131, 2509, 29918, 4905, 29879, 353, 1583, 29889, 19128, 1131, 2509, 29898, 13, 18884, 8570, 29918, 4905, 29892, 13, 18884, 8570, 29918, 13168, 29922, 3977, 6119, 29918, 1131, 2509, 29918, 13168, 29892, 13, 18884, 7546, 29918, 2813, 29918, 13168, 29922, 13148, 29918, 2813, 29918, 13168, 29892, 13, 18884, 1820, 29918, 1767, 29918, 28631, 29922, 3977, 6119, 29918, 10892, 29918, 28631, 29892, 13, 18884, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 18884, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1723, 13, 9651, 8570, 29918, 4905, 353, 4891, 29918, 1131, 2509, 29918, 4905, 29879, 29961, 29900, 29962, 13, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 1639, 13847, 29898, 1131, 2509, 29918, 4905, 29897, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 4905, 29898, 10892, 29918, 28631, 29892, 8570, 29918, 4905, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 29897, 13, 13, 4706, 14391, 353, 313, 10892, 29918, 28631, 29892, 29897, 13, 13, 4706, 565, 1962, 29918, 1131, 296, 1080, 29901, 13, 9651, 14391, 4619, 313, 1131, 2509, 29918, 4905, 29879, 29961, 29896, 1402, 29897, 13, 9651, 565, 2094, 6119, 29918, 10892, 29918, 28631, 338, 451, 6213, 29901, 13, 18884, 14391, 4619, 313, 19128, 29918, 1131, 2509, 29918, 4905, 29879, 29961, 29896, 1402, 29897, 13, 4706, 736, 14391, 13, 13, 13, 1990, 383, 21222, 29933, 814, 14420, 7196, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 29277, 353, 518, 13, 9651, 383, 21222, 29933, 814, 14420, 29898, 1311, 29889, 2917, 29892, 1024, 29922, 710, 29898, 29875, 511, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 363, 474, 297, 3464, 29898, 1311, 29889, 2917, 29889, 1949, 29918, 10892, 29918, 29277, 29897, 13, 4706, 4514, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 7934, 29918, 28631, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 2094, 6119, 29918, 10892, 29918, 28631, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2069, 29918, 8173, 29901, 6120, 353, 7700, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 599, 29918, 1131, 296, 1080, 353, 3861, 565, 1962, 29918, 1131, 296, 1080, 1683, 6213, 13, 4706, 599, 29918, 10892, 29918, 28631, 353, 3861, 565, 1962, 29918, 10892, 29918, 28631, 1683, 6213, 13, 4706, 599, 29918, 19128, 29918, 1131, 296, 1080, 353, 3861, 565, 313, 4905, 29918, 1131, 296, 1080, 322, 2094, 6119, 29918, 10892, 29918, 28631, 338, 451, 6213, 29897, 1683, 6213, 13, 13, 4706, 396, 5399, 565, 2343, 29918, 13168, 756, 263, 1959, 1353, 310, 15359, 6790, 565, 7429, 13, 4706, 565, 2343, 29918, 13168, 338, 451, 6213, 29901, 13, 9651, 565, 2343, 29918, 13168, 29889, 12181, 29961, 29900, 29962, 2804, 313, 2435, 29898, 1311, 29889, 29277, 22164, 13, 18884, 12020, 7865, 2392, 29898, 13, 462, 1678, 285, 29908, 1576, 2343, 29918, 13168, 881, 367, 6790, 363, 426, 2435, 29898, 1311, 29889, 29277, 2915, 15359, 29892, 541, 372, 338, 363, 320, 13, 462, 4706, 426, 2813, 29918, 13168, 29889, 12181, 29961, 29900, 12258, 1213, 13, 18884, 1723, 13, 13, 4706, 363, 474, 29892, 7546, 297, 26985, 29898, 1311, 29889, 29277, 1125, 13, 9651, 565, 1962, 29918, 10892, 29918, 28631, 29901, 13, 18884, 599, 29918, 10892, 29918, 28631, 4619, 313, 10892, 29918, 28631, 29892, 29897, 13, 13, 9651, 7546, 29918, 4905, 29879, 353, 7546, 29898, 13, 18884, 7934, 29918, 28631, 29892, 13, 18884, 8570, 29918, 13168, 29892, 13, 18884, 7546, 29918, 2813, 29918, 13168, 29922, 2813, 29918, 13168, 29961, 29875, 29962, 565, 2343, 29918, 13168, 338, 451, 6213, 1683, 6213, 29892, 13, 18884, 2094, 6119, 29918, 10892, 29918, 28631, 29922, 3977, 6119, 29918, 10892, 29918, 28631, 29892, 13, 18884, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29922, 3977, 6119, 29918, 1131, 2509, 29918, 13168, 29892, 13, 18884, 2069, 29918, 8173, 29922, 2344, 29918, 8173, 29892, 13, 18884, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 18884, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1723, 13, 13, 9651, 7934, 29918, 28631, 353, 7546, 29918, 4905, 29879, 29961, 29900, 29962, 13, 13, 9651, 565, 1962, 29918, 1131, 296, 1080, 29901, 13, 18884, 599, 29918, 1131, 296, 1080, 4619, 313, 13148, 29918, 4905, 29879, 29961, 29896, 1402, 29897, 13, 13, 18884, 565, 2094, 6119, 29918, 10892, 29918, 28631, 338, 451, 6213, 29901, 13, 462, 1678, 599, 29918, 19128, 29918, 1131, 296, 1080, 4619, 313, 13148, 29918, 4905, 29879, 29961, 29906, 1402, 29897, 13, 13, 4706, 565, 1962, 29918, 10892, 29918, 28631, 29901, 13, 9651, 599, 29918, 10892, 29918, 28631, 4619, 313, 10892, 29918, 28631, 29892, 29897, 13, 13, 4706, 14391, 353, 313, 10892, 29918, 28631, 29892, 29897, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 18761, 29898, 29894, 363, 325, 297, 14391, 565, 325, 338, 451, 6213, 29897, 13, 13, 4706, 736, 383, 21222, 5160, 3195, 6466, 3047, 29925, 579, 2855, 29907, 2124, 4165, 296, 1080, 29898, 13, 9651, 1833, 29918, 10892, 29918, 3859, 29922, 10892, 29918, 28631, 29892, 13, 9651, 7934, 29918, 28631, 29922, 497, 29918, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 497, 29918, 1131, 296, 1080, 29892, 13, 9651, 4891, 29918, 1131, 296, 1080, 29922, 497, 29918, 19128, 29918, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 1990, 383, 21222, 29933, 814, 8566, 6119, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 13148, 353, 383, 21222, 29933, 814, 14420, 7196, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 7934, 29918, 28631, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 2094, 6119, 29918, 10892, 29918, 28631, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2069, 29918, 8173, 29901, 6120, 353, 7700, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 736, 1583, 29889, 13148, 29898, 13, 9651, 7934, 29918, 28631, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 2343, 29918, 13168, 29922, 2813, 29918, 13168, 29892, 13, 9651, 2094, 6119, 29918, 10892, 29918, 28631, 29922, 3977, 6119, 29918, 10892, 29918, 28631, 29892, 13, 9651, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29922, 3977, 6119, 29918, 1131, 2509, 29918, 13168, 29892, 13, 9651, 2069, 29918, 8173, 29922, 2344, 29918, 8173, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 13, 1990, 383, 21222, 29933, 814, 11426, 261, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1145, 344, 353, 302, 29876, 29889, 29928, 1947, 29898, 13, 9651, 1583, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 13, 9651, 8466, 29918, 2344, 29922, 6487, 29889, 15755, 29889, 11228, 19427, 29889, 8945, 29898, 1311, 29889, 2917, 29889, 11228, 3950, 29918, 3881, 511, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 4706, 1723, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 7934, 29918, 28631, 1125, 13, 4706, 1067, 29879, 29918, 10892, 29918, 3859, 353, 7934, 29918, 28631, 7503, 29892, 29871, 29900, 29962, 13, 4706, 1067, 29879, 29918, 10892, 29918, 3859, 353, 1583, 29889, 1145, 344, 29898, 25932, 29918, 10892, 29918, 3859, 29897, 13, 4706, 736, 302, 29876, 29889, 13161, 29882, 29898, 25932, 29918, 10892, 29918, 3859, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 23084, 2463, 5494, 13372, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1145, 344, 353, 302, 29876, 29889, 29928, 1947, 29898, 1311, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 11236, 362, 353, 319, 1783, 29906, 29943, 29940, 29961, 1311, 29889, 2917, 29889, 10892, 29918, 627, 29962, 13, 4706, 1583, 29889, 14420, 29940, 555, 353, 302, 29876, 29889, 14420, 29940, 555, 29898, 5463, 29922, 1311, 29889, 2917, 29889, 13148, 29918, 12324, 29918, 8961, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 7934, 29918, 28631, 1125, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 1145, 344, 29898, 10892, 29918, 28631, 29897, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 11236, 362, 29898, 10892, 29918, 28631, 29897, 13, 4706, 736, 1583, 29889, 14420, 29940, 555, 29898, 10892, 29918, 28631, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 29931, 3580, 1127, 2463, 5494, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 1678, 24003, 29918, 2344, 29901, 8251, 519, 29961, 16361, 7442, 29889, 299, 2378, 29962, 353, 432, 1165, 29889, 15755, 29889, 11228, 19427, 29889, 3298, 359, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 9067, 353, 383, 21222, 29933, 814, 23084, 2463, 5494, 13372, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 7099, 6119, 353, 302, 29876, 29889, 29928, 1947, 29898, 1311, 29889, 2917, 29889, 29894, 542, 370, 29918, 2311, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 671, 29918, 29890, 3173, 29922, 8824, 29897, 13, 4706, 1583, 29889, 29890, 3173, 353, 1583, 29889, 3207, 703, 29890, 3173, 613, 1583, 29889, 29890, 3173, 29918, 2344, 29892, 313, 1311, 29889, 2917, 29889, 29894, 542, 370, 29918, 2311, 29892, 876, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 7934, 29918, 28631, 29892, 7258, 29918, 17987, 8497, 29922, 8516, 1125, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 9067, 29898, 10892, 29918, 28631, 29897, 13, 13, 4706, 565, 7258, 29918, 17987, 8497, 338, 451, 6213, 29901, 13, 9651, 7934, 29918, 28631, 353, 1583, 29889, 7099, 6119, 29889, 7302, 3319, 29908, 7529, 1115, 8853, 17460, 1115, 7258, 29918, 17987, 8497, 29889, 29911, 11656, 7934, 29918, 28631, 29897, 13, 4706, 1683, 29901, 13, 9651, 7934, 29918, 28631, 353, 1583, 29889, 7099, 6119, 29898, 10892, 29918, 28631, 29897, 13, 13, 4706, 24003, 353, 432, 9302, 29889, 294, 2378, 29898, 1311, 29889, 29890, 3173, 29892, 1583, 29889, 29881, 1853, 29897, 13, 4706, 7934, 29918, 28631, 4619, 24003, 13, 4706, 736, 7934, 29918, 28631, 13, 13, 13, 1990, 383, 21222, 29933, 814, 11730, 1988, 29924, 5494, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 27711, 1080, 353, 383, 21222, 29933, 814, 29931, 3580, 1127, 2463, 5494, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 7934, 29918, 28631, 29892, 7258, 29918, 17987, 8497, 29922, 8516, 1125, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 27711, 1080, 29898, 10892, 29918, 28631, 29892, 7258, 29918, 17987, 8497, 29922, 12366, 29918, 17987, 8497, 29897, 13, 4706, 736, 7934, 29918, 28631, 13, 13, 13, 1990, 383, 21222, 29933, 814, 11730, 3059, 29925, 5494, 29898, 15755, 29889, 7355, 1125, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 11762, 29918, 2674, 800, 4034, 353, 302, 29876, 29889, 29928, 1947, 29898, 29906, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 772, 29877, 839, 29918, 4905, 1125, 13, 4706, 736, 1583, 29889, 11762, 29918, 2674, 800, 4034, 29898, 1129, 29877, 839, 29918, 4905, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 6572, 5323, 2827, 5494, 29879, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 27711, 1080, 353, 383, 21222, 29933, 814, 29931, 3580, 1127, 2463, 5494, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 11762, 29918, 2674, 800, 4034, 353, 302, 29876, 29889, 29928, 1947, 29898, 29906, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 7934, 29918, 28631, 29892, 772, 29877, 839, 29918, 4905, 29892, 7258, 29918, 17987, 8497, 29922, 8516, 1125, 13, 4706, 18988, 29918, 1557, 2361, 353, 1583, 29889, 27711, 1080, 29898, 10892, 29918, 28631, 29892, 7258, 29918, 17987, 8497, 29922, 12366, 29918, 17987, 8497, 29897, 13, 4706, 19359, 29918, 2674, 800, 4034, 29918, 13628, 353, 1583, 29889, 11762, 29918, 2674, 800, 4034, 29898, 1129, 29877, 839, 29918, 4905, 29897, 13, 4706, 736, 18988, 29918, 1557, 2361, 29892, 19359, 29918, 2674, 800, 4034, 29918, 13628, 13, 13, 13, 1990, 383, 21222, 29933, 814, 6572, 5323, 1312, 3195, 29898, 29943, 21222, 6572, 5323, 1312, 3195, 1125, 13, 1678, 9995, 13, 1678, 530, 9846, 770, 304, 4386, 18177, 17865, 322, 263, 2560, 5067, 363, 28536, 322, 8363, 758, 3018, 1312, 13, 1678, 4733, 29889, 13, 1678, 9995, 13, 13, 1678, 2295, 29918, 1990, 353, 16662, 3991, 13, 1678, 2967, 29918, 4299, 29918, 13506, 353, 376, 2151, 29908, 13, 1678, 3883, 29918, 1990, 29901, 302, 29876, 29889, 7355, 353, 6213, 13, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 2295, 29901, 16662, 3991, 29892, 13, 4706, 1881, 29918, 12181, 29901, 12603, 552, 353, 313, 29896, 29892, 29871, 29896, 511, 13, 4706, 16717, 29901, 938, 353, 29871, 29900, 29892, 13, 4706, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29892, 13, 4706, 903, 1867, 29918, 2344, 29901, 6120, 353, 5852, 29892, 13, 4706, 3579, 19290, 13, 268, 1125, 13, 4706, 3883, 353, 1583, 29889, 5453, 29918, 1990, 29898, 2917, 29922, 2917, 29892, 26688, 29922, 29881, 1853, 29892, 3579, 19290, 29897, 13, 4706, 2428, 2141, 1649, 2344, 12035, 2917, 29892, 3883, 29892, 1881, 29918, 12181, 29922, 2080, 29918, 12181, 29892, 16717, 29922, 26776, 29892, 26688, 29922, 29881, 1853, 29892, 903, 1867, 29918, 2344, 29922, 29918, 1867, 29918, 2344, 29897, 13, 13, 1678, 822, 2069, 29918, 705, 5861, 29898, 1311, 29892, 364, 865, 29901, 432, 1165, 29889, 8172, 29889, 10593, 9312, 2558, 29892, 1881, 29918, 12181, 29901, 12603, 552, 29892, 8636, 29901, 25022, 2256, 21533, 353, 6213, 29897, 1599, 25022, 2256, 21533, 29901, 13, 4706, 396, 2069, 1881, 25187, 943, 13, 4706, 1881, 29918, 4841, 353, 432, 9302, 29889, 3298, 359, 29898, 2080, 29918, 12181, 29892, 26688, 543, 29875, 29946, 1159, 13, 4706, 5993, 29918, 1853, 29918, 4841, 353, 432, 9302, 29889, 3298, 359, 29918, 4561, 29898, 2080, 29918, 4841, 29897, 13, 4706, 2602, 29918, 4841, 353, 432, 9302, 29889, 6729, 328, 4384, 29918, 517, 29898, 29926, 9302, 29889, 279, 927, 29898, 29926, 9302, 29889, 271, 280, 579, 29918, 29906, 29881, 29898, 2080, 29918, 4841, 467, 12181, 14352, 29896, 11724, 1881, 29918, 12181, 29897, 13, 4706, 8570, 29918, 13168, 353, 432, 9302, 29889, 2873, 29918, 4561, 29898, 2080, 29918, 4841, 29897, 13, 4706, 2343, 29918, 13168, 353, 432, 9302, 29889, 2873, 3552, 1311, 29889, 2917, 29889, 1949, 29918, 10892, 29918, 29277, 29892, 1583, 29889, 2917, 29889, 1949, 29918, 1131, 2509, 29918, 2813, 29879, 876, 13, 13, 4706, 8636, 29918, 29878, 865, 29892, 5768, 449, 29918, 29878, 865, 353, 432, 1165, 29889, 8172, 29889, 5451, 29898, 29878, 865, 29897, 13, 4706, 364, 865, 29879, 353, 8853, 7529, 1115, 8636, 29918, 29878, 865, 29892, 376, 8865, 449, 1115, 5768, 449, 29918, 29878, 865, 29913, 13, 13, 4706, 565, 1583, 29889, 2917, 29889, 1202, 29918, 19128, 29918, 1131, 2509, 29901, 13, 9651, 2094, 6119, 29918, 10892, 29918, 28631, 353, 432, 9302, 29889, 3298, 359, 29898, 2080, 29918, 12181, 718, 313, 1311, 29889, 2917, 29889, 10892, 29918, 2311, 29892, 876, 13, 9651, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 353, 8570, 29918, 13168, 13, 9651, 3883, 29918, 2344, 29918, 4905, 29879, 353, 1583, 29889, 5453, 29889, 2344, 29898, 13, 18884, 364, 865, 29879, 29892, 13, 18884, 1881, 29918, 4841, 29892, 13, 18884, 8570, 29918, 13168, 29892, 13, 18884, 5993, 29918, 1853, 29918, 4841, 29892, 13, 18884, 2602, 29918, 4841, 29892, 13, 18884, 2343, 29918, 13168, 29892, 13, 18884, 2094, 6119, 29918, 10892, 29918, 28631, 29892, 13, 18884, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29892, 13, 18884, 736, 29918, 8977, 29922, 8824, 29892, 13, 9651, 1723, 13, 4706, 1683, 29901, 13, 9651, 3883, 29918, 2344, 29918, 4905, 29879, 353, 1583, 29889, 5453, 29889, 2344, 29898, 13, 18884, 364, 865, 29879, 29892, 1881, 29918, 4841, 29892, 8570, 29918, 13168, 29892, 5993, 29918, 1853, 29918, 4841, 29892, 2602, 29918, 4841, 29892, 2343, 29918, 13168, 29892, 736, 29918, 8977, 29922, 8824, 13, 9651, 1723, 13, 13, 4706, 4036, 29918, 7529, 353, 3883, 29918, 2344, 29918, 4905, 29879, 3366, 7529, 3108, 13, 13, 4706, 565, 8636, 338, 451, 6213, 29901, 13, 9651, 4036, 29918, 7529, 353, 1652, 8606, 29918, 8977, 29898, 348, 9021, 911, 29898, 8172, 29918, 7529, 876, 13, 9651, 8636, 353, 1652, 8606, 29918, 8977, 29898, 348, 9021, 911, 29898, 7529, 876, 13, 9651, 363, 4567, 29918, 1989, 297, 1583, 3032, 27259, 29918, 8149, 29901, 13, 18884, 8636, 29961, 27259, 29918, 1989, 29962, 353, 4036, 29918, 7529, 29961, 27259, 29918, 1989, 29962, 13, 9651, 1583, 3032, 27259, 29918, 8149, 353, 731, 580, 13, 9651, 736, 3889, 911, 29898, 348, 1579, 8606, 29918, 8977, 29898, 7529, 876, 13, 4706, 1683, 29901, 13, 9651, 736, 4036, 29918, 7529, 13, 13, 1678, 396, 10061, 1000, 515, 4327, 414, 29889, 9794, 29889, 29890, 442, 29889, 4299, 292, 29918, 29888, 21222, 29918, 29890, 442, 29889, 29943, 21222, 29933, 442, 6185, 6119, 6572, 5323, 1312, 3195, 29889, 2344, 29918, 8173, 13, 1678, 822, 2069, 29918, 8173, 29898, 1311, 29892, 9853, 29918, 2311, 29892, 4236, 29918, 2848, 1125, 13, 4706, 364, 15945, 29908, 13, 4706, 826, 3174, 29901, 13, 9651, 9853, 29918, 2311, 6695, 524, 29952, 1125, 13, 18884, 9853, 29918, 2311, 1304, 363, 5172, 4469, 29899, 276, 3663, 573, 1602, 3689, 29889, 5282, 1475, 278, 9853, 2159, 310, 278, 16601, 7090, 29889, 13, 9651, 4236, 29918, 2848, 6695, 524, 29952, 1125, 13, 18884, 7472, 1950, 3309, 363, 4469, 29899, 276, 3663, 573, 1602, 3689, 29889, 5282, 1475, 278, 5665, 3309, 310, 278, 16601, 13, 18884, 7090, 29889, 13, 4706, 9995, 13, 4706, 396, 2069, 1881, 3651, 304, 10563, 7090, 13, 4706, 1881, 29918, 4841, 353, 432, 9302, 29889, 2873, 3552, 16175, 29918, 2311, 29892, 4236, 29918, 2848, 511, 26688, 543, 29875, 29946, 1159, 13, 4706, 8570, 29918, 13168, 353, 432, 9302, 29889, 2873, 29918, 4561, 29898, 2080, 29918, 4841, 29892, 26688, 543, 29875, 29946, 1159, 13, 4706, 2602, 29918, 4841, 353, 432, 9302, 29889, 6729, 328, 4384, 29918, 517, 29898, 29926, 9302, 29889, 279, 927, 29898, 29926, 9302, 29889, 271, 280, 579, 29918, 29906, 29881, 29898, 2080, 29918, 4841, 467, 12181, 14352, 29896, 11724, 1881, 29918, 4841, 29889, 12181, 29897, 13, 13, 4706, 2069, 29918, 20897, 353, 1583, 29889, 5453, 29889, 2344, 29898, 13, 9651, 432, 1165, 29889, 8172, 29889, 10593, 9312, 2558, 29898, 29900, 511, 1881, 29918, 4841, 29892, 8570, 29918, 13168, 29892, 2602, 29918, 4841, 29892, 736, 29918, 8977, 29922, 8824, 29892, 2069, 29918, 8173, 29922, 5574, 13, 4706, 1723, 13, 4706, 736, 443, 9021, 911, 29898, 2344, 29918, 20897, 3366, 8173, 20068, 13, 13, 1678, 732, 1202, 29918, 2962, 29918, 1514, 19651, 29918, 517, 29918, 4299, 29918, 11333, 29898, 13635, 29911, 29918, 1177, 12336, 29903, 29918, 28665, 20785, 29889, 4830, 703, 16175, 29918, 2311, 29892, 5665, 29918, 2848, 5783, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29922, 8516, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29922, 8516, 29892, 13, 4706, 2602, 29918, 4841, 29922, 8516, 29892, 13, 4706, 2343, 29918, 13168, 29922, 8516, 29892, 13, 4706, 2094, 6119, 29918, 10892, 29918, 28631, 29922, 8516, 29892, 13, 4706, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29922, 8516, 29892, 13, 4706, 8636, 29901, 9657, 353, 6213, 29892, 13, 4706, 5768, 449, 29918, 29878, 865, 29901, 432, 1165, 29889, 8172, 29889, 10593, 9312, 2558, 353, 6213, 29892, 13, 4706, 7945, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 28379, 29961, 11227, 29962, 353, 6213, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 28379, 29961, 11227, 29962, 353, 6213, 29892, 13, 4706, 736, 29918, 8977, 29901, 28379, 29961, 11227, 29962, 353, 6213, 29892, 13, 4706, 4940, 29918, 1989, 29918, 5975, 29901, 9657, 353, 6213, 29892, 13, 268, 1125, 13, 4706, 1962, 29918, 1131, 296, 1080, 353, 1962, 29918, 1131, 296, 1080, 565, 1962, 29918, 1131, 296, 1080, 338, 451, 6213, 1683, 1583, 29889, 2917, 29889, 4905, 29918, 1131, 296, 1080, 13, 4706, 1962, 29918, 10892, 29918, 28631, 353, 313, 13, 9651, 1962, 29918, 10892, 29918, 28631, 565, 1962, 29918, 10892, 29918, 28631, 338, 451, 6213, 1683, 1583, 29889, 2917, 29889, 4905, 29918, 10892, 29918, 28631, 13, 4706, 1723, 13, 4706, 736, 29918, 8977, 353, 736, 29918, 8977, 565, 736, 29918, 8977, 338, 451, 6213, 1683, 1583, 29889, 2917, 29889, 2457, 29918, 8977, 13, 13, 4706, 396, 2069, 1881, 25187, 943, 565, 451, 4502, 13, 4706, 565, 5993, 29918, 1853, 29918, 4841, 338, 6213, 29901, 13, 9651, 5993, 29918, 1853, 29918, 4841, 353, 432, 9302, 29889, 3298, 359, 29918, 4561, 29898, 2080, 29918, 4841, 29897, 13, 13, 4706, 565, 2602, 29918, 4841, 338, 6213, 29901, 13, 9651, 2602, 29918, 4841, 353, 432, 9302, 29889, 6729, 328, 4384, 29918, 517, 29898, 29926, 9302, 29889, 279, 927, 29898, 29926, 9302, 29889, 271, 280, 579, 29918, 29906, 29881, 29898, 2080, 29918, 4841, 467, 12181, 14352, 29896, 11724, 1881, 29918, 4841, 29889, 12181, 29897, 13, 13, 4706, 565, 8570, 29918, 13168, 338, 6213, 29901, 13, 9651, 8570, 29918, 13168, 353, 432, 9302, 29889, 2873, 29918, 4561, 29898, 2080, 29918, 4841, 29897, 13, 13, 4706, 565, 2343, 29918, 13168, 338, 6213, 29901, 13, 9651, 2343, 29918, 13168, 353, 432, 9302, 29889, 2873, 3552, 1311, 29889, 2917, 29889, 1949, 29918, 10892, 29918, 29277, 29892, 1583, 29889, 2917, 29889, 1949, 29918, 1131, 2509, 29918, 2813, 29879, 876, 13, 13, 4706, 396, 29273, 738, 12089, 9312, 565, 4312, 13, 4706, 364, 865, 29879, 353, 6571, 13, 4706, 565, 5768, 449, 29918, 29878, 865, 338, 451, 6213, 29901, 13, 9651, 364, 865, 29879, 3366, 8865, 449, 3108, 353, 5768, 449, 29918, 29878, 865, 13, 13, 4706, 10970, 353, 8853, 7529, 1115, 8636, 470, 1583, 29889, 7529, 29913, 13, 13, 4706, 565, 1583, 29889, 2917, 29889, 1202, 29918, 19128, 29918, 1131, 2509, 29901, 13, 9651, 396, 565, 4940, 29918, 1989, 29918, 5975, 526, 4502, 769, 7090, 338, 2307, 16601, 263, 2024, 7353, 2069, 29918, 8173, 756, 304, 367, 4502, 13, 9651, 396, 1623, 304, 9801, 7090, 338, 1304, 29889, 739, 756, 304, 367, 1754, 1854, 393, 7090, 338, 10902, 408, 26691, 577, 393, 372, 508, 367, 13, 9651, 396, 3939, 491, 383, 21222, 29933, 814, 4165, 2509, 3883, 13, 9651, 565, 4940, 29918, 1989, 29918, 5975, 29901, 13, 18884, 10970, 3366, 8173, 3108, 353, 4940, 29918, 1989, 29918, 5975, 13, 18884, 26691, 353, 6796, 8173, 3108, 13, 9651, 1683, 29901, 13, 18884, 26691, 353, 7700, 13, 13, 9651, 14391, 353, 1583, 29889, 5453, 29889, 7302, 29898, 13, 18884, 10970, 29892, 13, 18884, 432, 9302, 29889, 2378, 29898, 2080, 29918, 4841, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 432, 9302, 29889, 2378, 29898, 1131, 2509, 29918, 13168, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 5993, 29918, 1853, 29918, 4841, 29922, 29926, 9302, 29889, 2378, 29898, 6979, 29918, 1853, 29918, 4841, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 2602, 29918, 4841, 29922, 29926, 9302, 29889, 2378, 29898, 3283, 29918, 4841, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 2343, 29918, 13168, 29922, 29926, 9302, 29889, 2378, 29898, 2813, 29918, 13168, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 2094, 6119, 29918, 10892, 29918, 28631, 29922, 3977, 6119, 29918, 10892, 29918, 28631, 29892, 13, 18884, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29922, 3977, 6119, 29918, 1131, 2509, 29918, 13168, 29892, 13, 18884, 11806, 4695, 29922, 1333, 7945, 29892, 13, 18884, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 18884, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 18884, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 18884, 364, 865, 29879, 29922, 29878, 865, 29879, 29892, 13, 18884, 26691, 29922, 23975, 29892, 13, 9651, 1723, 13, 13, 9651, 396, 788, 4784, 7090, 304, 1904, 1962, 13, 9651, 565, 4940, 29918, 1989, 29918, 5975, 338, 451, 6213, 322, 736, 29918, 8977, 29901, 13, 18884, 14391, 29892, 4940, 29918, 1989, 29918, 5975, 353, 14391, 13, 18884, 14391, 3366, 29886, 579, 29918, 1989, 29918, 5975, 3108, 353, 443, 9021, 911, 29898, 29886, 579, 29918, 1989, 29918, 5975, 3366, 8173, 20068, 13, 18884, 736, 14391, 13, 9651, 25342, 4940, 29918, 1989, 29918, 5975, 338, 451, 6213, 322, 451, 736, 29918, 8977, 29901, 13, 18884, 14391, 29892, 4940, 29918, 1989, 29918, 5975, 353, 14391, 13, 18884, 14391, 353, 14391, 7503, 29896, 29962, 718, 313, 348, 9021, 911, 29898, 29886, 579, 29918, 1989, 29918, 5975, 3366, 8173, 3108, 511, 29897, 718, 14391, 29961, 29896, 17531, 13, 13, 4706, 1683, 29901, 13, 9651, 14391, 353, 1583, 29889, 5453, 29889, 7302, 29898, 13, 18884, 10970, 29892, 13, 18884, 432, 9302, 29889, 2378, 29898, 2080, 29918, 4841, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 432, 9302, 29889, 2378, 29898, 1131, 2509, 29918, 13168, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 5993, 29918, 1853, 29918, 4841, 29922, 29926, 9302, 29889, 2378, 29898, 6979, 29918, 1853, 29918, 4841, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 2602, 29918, 4841, 29922, 29926, 9302, 29889, 2378, 29898, 3283, 29918, 4841, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 2343, 29918, 13168, 29922, 29926, 9302, 29889, 2378, 29898, 2813, 29918, 13168, 29892, 26688, 543, 29875, 29946, 4968, 13, 18884, 11806, 4695, 29922, 1333, 7945, 29892, 13, 18884, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 18884, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 18884, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 18884, 364, 865, 29879, 29922, 29878, 865, 29879, 29892, 13, 9651, 1723, 13, 13, 4706, 736, 14391, 13, 13, 13, 1990, 383, 21222, 29933, 814, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 29871, 396, 278, 26688, 310, 278, 16287, 13, 1678, 788, 29918, 10109, 292, 29918, 13148, 29901, 6120, 353, 5852, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 17987, 29881, 886, 353, 383, 21222, 29933, 814, 6026, 2580, 29881, 886, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 3977, 6119, 353, 383, 21222, 29933, 814, 8566, 6119, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 10109, 261, 353, 383, 21222, 29933, 814, 11426, 261, 29898, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2602, 29918, 4841, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2343, 29918, 13168, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2094, 6119, 29918, 10892, 29918, 28631, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2069, 29918, 8173, 29901, 6120, 353, 7700, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 396, 1207, 1854, 421, 6979, 29918, 1853, 29918, 4841, 29952, 338, 5149, 16601, 746, 451, 4502, 13, 4706, 565, 5993, 29918, 1853, 29918, 4841, 338, 6213, 29901, 13, 9651, 5993, 29918, 1853, 29918, 4841, 353, 432, 9302, 29889, 3298, 359, 29918, 4561, 29898, 2080, 29918, 4841, 29897, 13, 13, 4706, 396, 1207, 1854, 421, 3283, 29918, 4841, 29952, 338, 5149, 16601, 746, 451, 4502, 13, 4706, 565, 2602, 29918, 4841, 338, 6213, 29901, 13, 9651, 2602, 29918, 4841, 353, 432, 9302, 29889, 6729, 328, 4384, 29918, 517, 29898, 29926, 9302, 29889, 279, 927, 29898, 29926, 9302, 29889, 271, 280, 579, 29918, 29906, 29881, 29898, 2080, 29918, 4841, 467, 12181, 14352, 29896, 11724, 1881, 29918, 4841, 29889, 12181, 29897, 13, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 17987, 29881, 886, 29898, 13, 9651, 1881, 29918, 4841, 29892, 5993, 29918, 1853, 29918, 4841, 29892, 2602, 29918, 4841, 29892, 8570, 29918, 13168, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 13, 4706, 1723, 13, 4706, 14391, 353, 1583, 29889, 3977, 6119, 29898, 13, 9651, 7934, 29918, 28631, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 2343, 29918, 13168, 29922, 2813, 29918, 13168, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 2094, 6119, 29918, 10892, 29918, 28631, 29922, 3977, 6119, 29918, 10892, 29918, 28631, 29892, 13, 9651, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29922, 3977, 6119, 29918, 1131, 2509, 29918, 13168, 29892, 13, 9651, 2069, 29918, 8173, 29922, 2344, 29918, 8173, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 4706, 7934, 29918, 28631, 353, 14391, 29961, 29900, 29962, 13, 4706, 772, 29877, 839, 353, 1583, 29889, 10109, 261, 29898, 10892, 29918, 28631, 29897, 565, 1583, 29889, 1202, 29918, 10109, 292, 29918, 13148, 1683, 6213, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 396, 565, 772, 29877, 839, 338, 6213, 29892, 1016, 29915, 29873, 736, 372, 13, 9651, 565, 772, 29877, 839, 338, 6213, 29901, 13, 18884, 736, 313, 10892, 29918, 28631, 29892, 29897, 718, 14391, 29961, 29896, 17531, 13, 9651, 736, 313, 10892, 29918, 28631, 29892, 772, 29877, 839, 29897, 718, 14391, 29961, 29896, 17531, 13, 13, 4706, 736, 383, 21222, 5160, 3195, 6466, 3047, 11426, 292, 2855, 29907, 2124, 4165, 296, 1080, 29898, 13, 9651, 1833, 29918, 10892, 29918, 3859, 29922, 10892, 29918, 28631, 29892, 13, 9651, 11565, 261, 29918, 4905, 29922, 1129, 29877, 839, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 9651, 4891, 29918, 1131, 296, 1080, 29922, 4905, 29879, 29889, 19128, 29918, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 29898, 13, 1678, 376, 1576, 16079, 16662, 8125, 4327, 261, 1962, 1259, 10650, 7934, 29899, 28631, 1728, 738, 2702, 2343, 373, 2246, 19602, 13, 1678, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29892, 13, 29897, 13, 1990, 383, 21222, 29933, 814, 3195, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 7355, 13, 13, 13, 4397, 29918, 4804, 29918, 11249, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 3195, 29892, 903, 4986, 29968, 1430, 26664, 1001, 29918, 22051, 29918, 28665, 29892, 903, 3210, 16658, 29925, 6992, 29911, 29918, 22051, 29918, 28665, 29892, 383, 21222, 5160, 3195, 6466, 3047, 11426, 292, 29892, 903, 25903, 29918, 22051, 29918, 28665, 13, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2151, 353, 383, 21222, 29933, 814, 7355, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 25932, 353, 383, 21222, 29933, 814, 6572, 5323, 2827, 5494, 29879, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29892, 13, 4706, 2602, 29918, 4841, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 13, 4706, 396, 8125, 13, 4706, 14391, 353, 1583, 29889, 2151, 29898, 13, 9651, 1881, 29918, 4841, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 5993, 29918, 1853, 29918, 4841, 29892, 13, 9651, 2602, 29918, 4841, 29892, 13, 9651, 2343, 29918, 13168, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 4706, 565, 1583, 29889, 2917, 29889, 29873, 347, 29918, 1742, 29918, 17987, 29881, 886, 29901, 13, 9651, 7258, 29918, 17987, 8497, 353, 1583, 29889, 2151, 29889, 20897, 3366, 7529, 3108, 3366, 17987, 29881, 886, 3108, 3366, 1742, 29918, 17987, 29881, 886, 3108, 3366, 17987, 8497, 3108, 13, 4706, 1683, 29901, 13, 9651, 7258, 29918, 17987, 8497, 353, 6213, 13, 13, 4706, 7934, 29918, 28631, 353, 14391, 29961, 29900, 29962, 13, 4706, 772, 29877, 839, 29918, 4905, 353, 14391, 29961, 29896, 29962, 13, 13, 4706, 18988, 29918, 1557, 2361, 29892, 19359, 29918, 2674, 800, 4034, 29918, 13628, 353, 1583, 29889, 25932, 29898, 13, 9651, 7934, 29918, 28631, 29892, 772, 29877, 839, 29918, 4905, 29892, 7258, 29918, 17987, 8497, 29922, 12366, 29918, 17987, 8497, 13, 4706, 1723, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 313, 11965, 2463, 29918, 1557, 2361, 29892, 19359, 29918, 2674, 800, 4034, 29918, 13628, 29897, 718, 14391, 29961, 29906, 17531, 13, 13, 4706, 736, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 6466, 29898, 13, 9651, 18988, 29918, 1188, 1169, 29922, 11965, 2463, 29918, 1557, 2361, 29892, 13, 9651, 19359, 29918, 2674, 800, 4034, 29918, 1188, 1169, 29922, 11762, 29918, 2674, 800, 4034, 29918, 13628, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 29898, 13, 1678, 9995, 13, 1678, 16662, 8125, 411, 1023, 15883, 373, 2246, 408, 2309, 2645, 278, 758, 26495, 29901, 263, 421, 13168, 287, 4086, 1904, 292, 29952, 2343, 322, 263, 421, 4622, 13, 1678, 10541, 18988, 313, 1990, 2450, 3569, 2343, 29889, 13, 1678, 5124, 613, 13, 1678, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29892, 13, 29897, 13, 1990, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 7355, 13, 13, 13, 18823, 29990, 29918, 13635, 29911, 29918, 22051, 29918, 15094, 29911, 4717, 1177, 4214, 29918, 28665, 20785, 353, 9995, 13, 1678, 16969, 29901, 13, 13, 1678, 8741, 29901, 13, 13, 1678, 7521, 4691, 13, 1678, 8653, 515, 4327, 414, 1053, 16662, 6066, 3950, 29892, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 13, 13, 1678, 8653, 5993, 3950, 353, 16662, 6066, 3950, 29889, 3166, 29918, 1457, 3018, 1312, 703, 2151, 29899, 3188, 29899, 4661, 1463, 1159, 13, 1678, 8653, 1904, 353, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 29889, 3166, 29918, 1457, 3018, 1312, 703, 2151, 29899, 3188, 29899, 4661, 1463, 1159, 13, 13, 1678, 8653, 10970, 353, 5993, 3950, 703, 10994, 29892, 590, 11203, 338, 274, 1082, 613, 736, 29918, 29873, 575, 943, 543, 9302, 1159, 13, 1678, 8653, 14391, 353, 1904, 29898, 1068, 2080, 29879, 29897, 13, 13, 1678, 8653, 18988, 29918, 1188, 1169, 353, 14391, 29889, 11965, 2463, 29918, 1188, 1169, 13, 1678, 8653, 19359, 29918, 2674, 800, 4034, 29918, 1188, 1169, 353, 14391, 29889, 11762, 29918, 2674, 800, 4034, 29918, 1188, 1169, 13, 1678, 7521, 13, 15945, 29908, 13, 13, 957, 3539, 29918, 4804, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 29892, 13, 1678, 350, 20161, 29918, 1177, 12336, 29903, 29918, 28665, 20785, 29889, 4830, 703, 16175, 29918, 2311, 29892, 5665, 29918, 2848, 1159, 718, 383, 4375, 29990, 29918, 13635, 29911, 29918, 22051, 29918, 15094, 29911, 4717, 1177, 4214, 29918, 28665, 20785, 29892, 13, 29897, 13, 4397, 29918, 6506, 29918, 2457, 29918, 1514, 19651, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 6572, 5323, 2827, 29892, 1962, 29918, 1853, 29922, 29943, 21222, 29933, 814, 2831, 6572, 5323, 2827, 6466, 29892, 2295, 29918, 1990, 29922, 29918, 25903, 29918, 22051, 29918, 28665, 13, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 2831, 19832, 287, 26369, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2151, 353, 383, 21222, 29933, 814, 7355, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 788, 29918, 10109, 292, 29918, 13148, 29922, 8824, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 25932, 353, 383, 21222, 29933, 814, 11730, 1988, 29924, 5494, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29892, 13, 4706, 2602, 29918, 4841, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 396, 8125, 13, 4706, 14391, 353, 1583, 29889, 2151, 29898, 13, 9651, 1881, 29918, 4841, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 5993, 29918, 1853, 29918, 4841, 29892, 13, 9651, 2602, 29918, 4841, 29892, 13, 9651, 2343, 29918, 13168, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 4706, 7934, 29918, 28631, 353, 14391, 29961, 29900, 29962, 13, 4706, 565, 1583, 29889, 2917, 29889, 29873, 347, 29918, 1742, 29918, 17987, 29881, 886, 29901, 13, 9651, 7258, 29918, 17987, 8497, 353, 1583, 29889, 2151, 29889, 20897, 3366, 7529, 3108, 3366, 17987, 29881, 886, 3108, 3366, 1742, 29918, 17987, 29881, 886, 3108, 3366, 17987, 8497, 3108, 13, 4706, 1683, 29901, 13, 9651, 7258, 29918, 17987, 8497, 353, 6213, 13, 13, 4706, 396, 11796, 29872, 278, 18988, 19435, 13, 4706, 1480, 1169, 353, 1583, 29889, 25932, 29898, 10892, 29918, 28631, 29892, 7258, 29918, 17987, 8497, 29922, 12366, 29918, 17987, 8497, 29897, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 313, 1188, 1169, 29892, 29897, 718, 14391, 29961, 29896, 17531, 13, 13, 4706, 736, 383, 21222, 19832, 287, 26369, 6466, 29898, 13, 9651, 1480, 1169, 29922, 1188, 1169, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 703, 15945, 29933, 814, 8125, 411, 263, 421, 11675, 1904, 292, 29952, 2343, 373, 2246, 1213, 29908, 613, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29897, 13, 1990, 383, 21222, 29933, 814, 2831, 19832, 287, 26369, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 2831, 19832, 287, 26369, 7355, 13, 13, 13, 4397, 29918, 4804, 29918, 11249, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 19832, 287, 26369, 29892, 903, 4986, 29968, 1430, 26664, 1001, 29918, 22051, 29918, 28665, 29892, 903, 3210, 16658, 29925, 6992, 29911, 29918, 22051, 29918, 28665, 29892, 383, 21222, 19832, 287, 26369, 6466, 29892, 903, 25903, 29918, 22051, 29918, 28665, 13, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 2831, 9190, 29903, 296, 663, 23084, 2463, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2151, 353, 383, 21222, 29933, 814, 7355, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 25932, 353, 383, 21222, 29933, 814, 11730, 3059, 29925, 5494, 29898, 29881, 1853, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29892, 13, 4706, 2602, 29918, 4841, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 736, 29918, 8977, 353, 736, 29918, 8977, 565, 736, 29918, 8977, 338, 451, 6213, 1683, 1583, 29889, 2917, 29889, 2457, 29918, 8977, 13, 13, 4706, 396, 8125, 13, 4706, 14391, 353, 1583, 29889, 2151, 29898, 13, 9651, 1881, 29918, 4841, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 5993, 29918, 1853, 29918, 4841, 29892, 13, 9651, 2602, 29918, 4841, 29892, 13, 9651, 2343, 29918, 13168, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 4706, 772, 29877, 839, 29918, 4905, 353, 14391, 29961, 29896, 29962, 13, 4706, 19359, 29918, 2674, 800, 4034, 29918, 1557, 2361, 353, 1583, 29889, 25932, 29898, 1129, 29877, 839, 29918, 4905, 29897, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 313, 11762, 29918, 2674, 800, 4034, 29918, 1557, 2361, 29892, 29897, 718, 14391, 29961, 29906, 17531, 13, 13, 4706, 736, 383, 21222, 9190, 29903, 296, 663, 23084, 919, 272, 6466, 29898, 13, 9651, 1480, 1169, 29922, 11762, 29918, 2674, 800, 4034, 29918, 1557, 2361, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 29898, 13, 1678, 9995, 29933, 814, 8125, 411, 263, 421, 4622, 10541, 18988, 313, 1990, 2450, 3569, 2343, 373, 2246, 1213, 29908, 613, 13, 1678, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29892, 13, 29897, 13, 1990, 383, 21222, 29933, 814, 2831, 9190, 29903, 296, 663, 23084, 2463, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 2831, 9190, 29903, 296, 663, 23084, 2463, 7355, 13, 13, 13, 18823, 29990, 29918, 13635, 29911, 29918, 22051, 29918, 29940, 12194, 29918, 29903, 3919, 29918, 15094, 29928, 29918, 28665, 20785, 353, 9995, 13, 1678, 16969, 29901, 13, 13, 1678, 8741, 29901, 13, 13, 1678, 7521, 4691, 13, 1678, 8653, 515, 4327, 414, 1053, 16662, 6066, 3950, 29892, 383, 21222, 29933, 814, 2831, 9190, 29903, 296, 663, 23084, 2463, 13, 13, 1678, 8653, 5993, 3950, 353, 16662, 6066, 3950, 29889, 3166, 29918, 1457, 3018, 1312, 703, 2151, 29899, 3188, 29899, 4661, 1463, 1159, 13, 1678, 8653, 1904, 353, 383, 21222, 29933, 814, 2831, 9190, 29903, 296, 663, 23084, 2463, 29889, 3166, 29918, 1457, 3018, 1312, 703, 2151, 29899, 3188, 29899, 4661, 1463, 1159, 13, 13, 1678, 8653, 9508, 353, 376, 797, 12730, 29892, 282, 24990, 6766, 297, 11595, 6055, 29892, 1316, 408, 472, 263, 27144, 29892, 338, 9132, 9644, 506, 287, 1213, 13, 1678, 8653, 2446, 29918, 18616, 663, 353, 376, 1576, 14744, 338, 7254, 2861, 304, 278, 20511, 281, 6447, 1477, 310, 7254, 3578, 1213, 13, 1678, 8653, 8025, 353, 5993, 3950, 29898, 14032, 415, 29892, 2446, 29918, 18616, 663, 29892, 736, 29918, 29873, 575, 943, 543, 6487, 1159, 13, 13, 1678, 8653, 14391, 353, 1904, 29898, 1068, 22331, 29897, 13, 1678, 8653, 1480, 1169, 353, 14391, 29889, 1188, 1169, 13, 1678, 8653, 4974, 1480, 1169, 29961, 29900, 29892, 29871, 29900, 29962, 529, 1480, 1169, 29961, 29900, 29892, 29871, 29896, 29962, 29871, 396, 2446, 10541, 471, 4036, 13, 1678, 7521, 13, 15945, 29908, 13, 13, 13, 957, 3539, 29918, 4804, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 9190, 29903, 296, 663, 23084, 2463, 29892, 13, 1678, 350, 20161, 29918, 1177, 12336, 29903, 29918, 28665, 20785, 29889, 4830, 703, 16175, 29918, 2311, 29892, 5665, 29918, 2848, 1159, 718, 383, 4375, 29990, 29918, 13635, 29911, 29918, 22051, 29918, 29940, 12194, 29918, 29903, 3919, 29918, 15094, 29928, 29918, 28665, 20785, 29892, 13, 29897, 13, 4397, 29918, 6506, 29918, 2457, 29918, 1514, 19651, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 9190, 29903, 296, 663, 23084, 2463, 29892, 1962, 29918, 1853, 29922, 29943, 21222, 9190, 29903, 296, 663, 23084, 919, 272, 6466, 29892, 2295, 29918, 1990, 29922, 29918, 25903, 29918, 22051, 29918, 28665, 13, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 2831, 20529, 2385, 2450, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2151, 353, 383, 21222, 29933, 814, 7355, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 770, 3709, 29918, 8865, 449, 353, 313, 13, 9651, 1583, 29889, 2917, 29889, 1990, 3709, 29918, 8865, 449, 13, 9651, 565, 1583, 29889, 2917, 29889, 1990, 3709, 29918, 8865, 449, 338, 451, 6213, 13, 9651, 1683, 1583, 29889, 2917, 29889, 10892, 29918, 8865, 449, 29918, 22795, 13, 4706, 1723, 13, 4706, 1583, 29889, 8865, 449, 353, 302, 29876, 29889, 15063, 449, 29898, 10492, 29922, 1990, 3709, 29918, 8865, 449, 29897, 13, 4706, 1583, 29889, 1990, 3709, 353, 302, 29876, 29889, 29928, 1947, 29898, 13, 9651, 1583, 29889, 2917, 29889, 1949, 29918, 21134, 29892, 13, 9651, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 13, 4706, 1723, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29892, 13, 4706, 2602, 29918, 4841, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 396, 8125, 13, 4706, 14391, 353, 1583, 29889, 2151, 29898, 13, 9651, 1881, 29918, 4841, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 5993, 29918, 1853, 29918, 4841, 29892, 13, 9651, 2602, 29918, 4841, 29892, 13, 9651, 2343, 29918, 13168, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 4706, 772, 29877, 839, 29918, 4905, 353, 14391, 29961, 29896, 29962, 13, 4706, 772, 29877, 839, 29918, 4905, 353, 1583, 29889, 8865, 449, 29898, 1129, 29877, 839, 29918, 4905, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 29897, 13, 4706, 1480, 1169, 353, 1583, 29889, 1990, 3709, 29898, 1129, 29877, 839, 29918, 4905, 29897, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 313, 1188, 1169, 29892, 29897, 718, 14391, 29961, 29906, 17531, 13, 13, 4706, 736, 383, 21222, 20529, 2385, 3709, 6466, 29898, 13, 9651, 1480, 1169, 29922, 1188, 1169, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 29898, 13, 1678, 9995, 13, 1678, 16662, 8125, 4327, 261, 411, 263, 5665, 12965, 29914, 276, 11476, 2343, 373, 2246, 313, 29874, 5608, 7546, 373, 2246, 310, 278, 772, 29877, 839, 13, 1678, 1962, 29897, 321, 29889, 29887, 29889, 363, 12729, 4462, 9595, 29889, 13, 1678, 5124, 613, 13, 1678, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29892, 13, 29897, 13, 1990, 383, 21222, 29933, 814, 2831, 20529, 2385, 2450, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 2831, 20529, 2385, 2450, 7355, 13, 13, 13, 4397, 29918, 4804, 29918, 11249, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 20529, 2385, 2450, 29892, 13, 1678, 903, 4986, 29968, 1430, 26664, 1001, 29918, 22051, 29918, 28665, 29892, 13, 1678, 903, 3210, 16658, 29925, 6992, 29911, 29918, 22051, 29918, 28665, 29892, 13, 1678, 383, 21222, 20529, 2385, 3709, 6466, 29892, 13, 1678, 903, 25903, 29918, 22051, 29918, 28665, 29892, 13, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 2831, 15329, 552, 29620, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2151, 353, 383, 21222, 29933, 814, 7355, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 8865, 449, 353, 302, 29876, 29889, 15063, 449, 29898, 10492, 29922, 1311, 29889, 2917, 29889, 10892, 29918, 8865, 449, 29918, 22795, 29897, 13, 4706, 1583, 29889, 1990, 3709, 353, 302, 29876, 29889, 29928, 1947, 29898, 29896, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29892, 13, 4706, 2602, 29918, 4841, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 954, 29918, 1859, 1575, 353, 1881, 29918, 4841, 29889, 12181, 29961, 29896, 29962, 13, 4706, 1881, 29918, 4841, 353, 1881, 29918, 4841, 29889, 690, 14443, 6278, 29896, 29892, 1881, 29918, 4841, 29889, 12181, 14352, 29896, 2314, 565, 1881, 29918, 4841, 338, 451, 6213, 1683, 6213, 13, 4706, 8570, 29918, 13168, 353, 8570, 29918, 13168, 29889, 690, 14443, 6278, 29896, 29892, 8570, 29918, 13168, 29889, 12181, 14352, 29896, 2314, 565, 8570, 29918, 13168, 338, 451, 6213, 1683, 6213, 13, 4706, 5993, 29918, 1853, 29918, 4841, 353, 5993, 29918, 1853, 29918, 4841, 29889, 690, 14443, 6278, 29896, 29892, 5993, 29918, 1853, 29918, 4841, 29889, 12181, 14352, 29896, 2314, 565, 5993, 29918, 1853, 29918, 4841, 338, 451, 6213, 1683, 6213, 13, 4706, 2602, 29918, 4841, 353, 2602, 29918, 4841, 29889, 690, 14443, 6278, 29896, 29892, 2602, 29918, 4841, 29889, 12181, 14352, 29896, 2314, 565, 2602, 29918, 4841, 338, 451, 6213, 1683, 6213, 13, 13, 4706, 396, 8125, 13, 4706, 14391, 353, 1583, 29889, 2151, 29898, 13, 9651, 1881, 29918, 4841, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 5993, 29918, 1853, 29918, 4841, 29892, 13, 9651, 2602, 29918, 4841, 29892, 13, 9651, 2343, 29918, 13168, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 4706, 772, 29877, 839, 29918, 4905, 353, 14391, 29961, 29896, 29962, 13, 4706, 772, 29877, 839, 29918, 4905, 353, 1583, 29889, 8865, 449, 29898, 1129, 29877, 839, 29918, 4905, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 29897, 13, 4706, 1480, 1169, 353, 1583, 29889, 1990, 3709, 29898, 1129, 29877, 839, 29918, 4905, 29897, 13, 13, 4706, 620, 29882, 10501, 29918, 1188, 1169, 353, 1480, 1169, 29889, 690, 14443, 6278, 29896, 29892, 954, 29918, 1859, 1575, 29897, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 313, 3781, 10501, 29918, 1188, 1169, 29892, 29897, 718, 14391, 29961, 29906, 17531, 13, 13, 4706, 736, 383, 21222, 15329, 552, 29620, 3195, 6466, 29898, 13, 9651, 1480, 1169, 29922, 3781, 10501, 29918, 1188, 1169, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 29898, 13, 1678, 9995, 13, 1678, 16662, 8125, 411, 263, 2999, 7348, 12965, 2343, 373, 2246, 313, 29874, 5608, 7546, 373, 2246, 310, 278, 772, 29877, 839, 1962, 322, 263, 13, 1678, 4964, 3317, 29897, 321, 29889, 29887, 29889, 363, 25111, 855, 3842, 29914, 23066, 10051, 9595, 29889, 13, 1678, 5124, 613, 13, 1678, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29892, 13, 29897, 13, 1990, 383, 21222, 29933, 814, 2831, 15329, 552, 29620, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 2831, 15329, 552, 29620, 7355, 13, 13, 13, 957, 3539, 29918, 4804, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 15329, 552, 29620, 29892, 350, 20161, 29918, 1177, 12336, 29903, 29918, 28665, 20785, 29889, 4830, 703, 16175, 29918, 2311, 29892, 954, 29918, 1859, 1575, 29892, 5665, 29918, 2848, 1159, 13, 29897, 13, 4397, 29918, 4804, 29918, 11249, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 15329, 552, 29620, 29892, 903, 4986, 29968, 1430, 26664, 1001, 29918, 22051, 29918, 28665, 29892, 903, 3210, 16658, 29925, 6992, 29911, 29918, 22051, 29918, 28665, 29892, 383, 21222, 15329, 552, 29620, 3195, 6466, 29892, 903, 25903, 29918, 22051, 29918, 28665, 13, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 2831, 6066, 2385, 2450, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2151, 353, 383, 21222, 29933, 814, 7355, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 788, 29918, 10109, 292, 29918, 13148, 29922, 8824, 29897, 13, 4706, 770, 3709, 29918, 8865, 449, 353, 313, 13, 9651, 1583, 29889, 2917, 29889, 1990, 3709, 29918, 8865, 449, 13, 9651, 565, 1583, 29889, 2917, 29889, 1990, 3709, 29918, 8865, 449, 338, 451, 6213, 13, 9651, 1683, 1583, 29889, 2917, 29889, 10892, 29918, 8865, 449, 29918, 22795, 13, 4706, 1723, 13, 4706, 1583, 29889, 8865, 449, 353, 302, 29876, 29889, 15063, 449, 29898, 10492, 29922, 1990, 3709, 29918, 8865, 449, 29897, 13, 4706, 1583, 29889, 1990, 3709, 353, 302, 29876, 29889, 29928, 1947, 29898, 1311, 29889, 2917, 29889, 1949, 29918, 21134, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29892, 13, 4706, 2602, 29918, 4841, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 396, 8125, 13, 4706, 14391, 353, 1583, 29889, 2151, 29898, 13, 9651, 1881, 29918, 4841, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 5993, 29918, 1853, 29918, 4841, 29892, 13, 9651, 2602, 29918, 4841, 29892, 13, 9651, 2343, 29918, 13168, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 4706, 7934, 29918, 28631, 353, 14391, 29961, 29900, 29962, 13, 4706, 7934, 29918, 28631, 353, 1583, 29889, 8865, 449, 29898, 10892, 29918, 28631, 29892, 11806, 4695, 29922, 4801, 837, 262, 4695, 29897, 13, 4706, 1480, 1169, 353, 1583, 29889, 1990, 3709, 29898, 10892, 29918, 28631, 29897, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 313, 1188, 1169, 29892, 29897, 718, 14391, 29961, 29896, 17531, 13, 13, 4706, 736, 383, 21222, 6066, 2385, 3709, 6466, 29898, 13, 9651, 1480, 1169, 29922, 1188, 1169, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 29898, 13, 1678, 9995, 13, 1678, 16662, 8125, 411, 263, 5993, 12965, 2343, 373, 2246, 313, 29874, 5608, 7546, 373, 2246, 310, 278, 7934, 29899, 28631, 1962, 29897, 321, 29889, 29887, 29889, 363, 13, 1678, 405, 2795, 29899, 6691, 29899, 23122, 654, 313, 13865, 29897, 9595, 29889, 13, 1678, 5124, 613, 13, 1678, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29892, 13, 29897, 13, 1990, 383, 21222, 29933, 814, 2831, 6066, 2385, 2450, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 2831, 6066, 2385, 2450, 7355, 13, 13, 13, 4397, 29918, 4804, 29918, 11249, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 6066, 2385, 2450, 29892, 903, 4986, 29968, 1430, 26664, 1001, 29918, 22051, 29918, 28665, 29892, 903, 3210, 16658, 29925, 6992, 29911, 29918, 22051, 29918, 28665, 29892, 383, 21222, 6066, 2385, 3709, 6466, 29892, 903, 25903, 29918, 22051, 29918, 28665, 13, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 2831, 16492, 22550, 292, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2151, 353, 383, 21222, 29933, 814, 7355, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29892, 788, 29918, 10109, 292, 29918, 13148, 29922, 8824, 29897, 13, 4706, 1583, 29889, 25621, 29918, 4905, 29879, 353, 302, 29876, 29889, 29928, 1947, 29898, 1311, 29889, 2917, 29889, 1949, 29918, 21134, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29892, 13, 4706, 2602, 29918, 4841, 29892, 13, 4706, 2343, 29918, 13168, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 396, 8125, 13, 4706, 14391, 353, 1583, 29889, 2151, 29898, 13, 9651, 1881, 29918, 4841, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 5993, 29918, 1853, 29918, 4841, 29892, 13, 9651, 2602, 29918, 4841, 29892, 13, 9651, 2343, 29918, 13168, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 4706, 7934, 29918, 28631, 353, 14391, 29961, 29900, 29962, 13, 13, 4706, 1480, 1169, 353, 1583, 29889, 25621, 29918, 4905, 29879, 29898, 10892, 29918, 28631, 29897, 13, 4706, 1369, 29918, 1188, 1169, 29892, 1095, 29918, 1188, 1169, 353, 1480, 1169, 29889, 5451, 29898, 1311, 29889, 2917, 29889, 1949, 29918, 21134, 29892, 9685, 10457, 29896, 29897, 13, 4706, 1369, 29918, 1188, 1169, 353, 1369, 29918, 1188, 1169, 29889, 29879, 802, 29872, 911, 6278, 29896, 29897, 13, 4706, 1095, 29918, 1188, 1169, 353, 1095, 29918, 1188, 1169, 29889, 29879, 802, 29872, 911, 6278, 29896, 29897, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 313, 2962, 29918, 1188, 1169, 29892, 1095, 29918, 1188, 1169, 29897, 718, 14391, 29961, 29896, 17531, 13, 13, 4706, 736, 383, 21222, 16492, 22550, 292, 3195, 6466, 29898, 13, 9651, 1369, 29918, 1188, 1169, 29922, 2962, 29918, 1188, 1169, 29892, 13, 9651, 1095, 29918, 1188, 1169, 29922, 355, 29918, 1188, 1169, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 29898, 13, 1678, 9995, 13, 1678, 16662, 8125, 411, 263, 10638, 12965, 2343, 373, 2246, 363, 6597, 573, 1139, 29899, 12011, 292, 9595, 763, 317, 2182, 3035, 313, 29874, 5608, 13, 1678, 15359, 373, 2246, 310, 278, 7934, 29899, 28631, 1962, 304, 10272, 421, 9653, 1369, 1480, 1169, 29952, 322, 421, 9653, 1095, 1480, 1169, 12913, 13, 1678, 5124, 613, 13, 1678, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29892, 13, 29897, 13, 1990, 383, 21222, 29933, 814, 2831, 16492, 22550, 292, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 2831, 16492, 22550, 292, 7355, 13, 13, 13, 4397, 29918, 4804, 29918, 11249, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 16492, 22550, 292, 29892, 13, 1678, 903, 4986, 29968, 1430, 26664, 1001, 29918, 22051, 29918, 28665, 29892, 13, 1678, 903, 3210, 16658, 29925, 6992, 29911, 29918, 22051, 29918, 28665, 29892, 13, 1678, 383, 21222, 16492, 22550, 292, 3195, 6466, 29892, 13, 1678, 903, 25903, 29918, 22051, 29918, 28665, 29892, 13, 29897, 13, 13, 13, 1990, 383, 21222, 29933, 814, 2831, 29907, 1485, 284, 26369, 7355, 29898, 15755, 29889, 7355, 1125, 13, 1678, 2295, 29901, 16662, 3991, 13, 1678, 26688, 29901, 432, 9302, 29889, 29881, 1853, 353, 432, 9302, 29889, 7411, 29941, 29906, 13, 13, 1678, 822, 6230, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2151, 353, 383, 21222, 29933, 814, 7355, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 788, 29918, 10109, 292, 29918, 13148, 29922, 8824, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 4706, 1583, 29889, 25932, 353, 383, 21222, 29933, 814, 11730, 1988, 29924, 5494, 29898, 2917, 29922, 1311, 29889, 2917, 29892, 26688, 29922, 1311, 29889, 29881, 1853, 29897, 13, 13, 1678, 822, 4770, 4804, 12035, 13, 4706, 1583, 29892, 13, 4706, 1881, 29918, 4841, 29892, 13, 4706, 8570, 29918, 13168, 29892, 13, 4706, 2602, 29918, 4841, 29892, 13, 4706, 5993, 29918, 1853, 29918, 4841, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2343, 29918, 13168, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2094, 6119, 29918, 10892, 29918, 28631, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29901, 28379, 29961, 29926, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 4706, 2069, 29918, 8173, 29901, 6120, 353, 7700, 29892, 13, 4706, 11806, 4695, 29901, 6120, 353, 5852, 29892, 13, 4706, 1962, 29918, 1131, 296, 1080, 29901, 6120, 353, 7700, 29892, 13, 4706, 1962, 29918, 10892, 29918, 28631, 29901, 6120, 353, 7700, 29892, 13, 4706, 736, 29918, 8977, 29901, 6120, 353, 5852, 29892, 13, 268, 1125, 13, 4706, 396, 8125, 13, 4706, 14391, 353, 1583, 29889, 2151, 29898, 13, 9651, 1881, 29918, 4841, 29892, 13, 9651, 8570, 29918, 13168, 29892, 13, 9651, 5993, 29918, 1853, 29918, 4841, 29892, 13, 9651, 2602, 29918, 4841, 29892, 13, 9651, 2343, 29918, 13168, 29892, 13, 9651, 2094, 6119, 29918, 10892, 29918, 28631, 29922, 3977, 6119, 29918, 10892, 29918, 28631, 29892, 13, 9651, 2094, 6119, 29918, 1131, 2509, 29918, 13168, 29922, 3977, 6119, 29918, 1131, 2509, 29918, 13168, 29892, 13, 9651, 2069, 29918, 8173, 29922, 2344, 29918, 8173, 29892, 13, 9651, 11806, 4695, 29922, 4801, 837, 262, 4695, 29892, 13, 9651, 1962, 29918, 1131, 296, 1080, 29922, 4905, 29918, 1131, 296, 1080, 29892, 13, 9651, 1962, 29918, 10892, 29918, 28631, 29922, 4905, 29918, 10892, 29918, 28631, 29892, 13, 9651, 736, 29918, 8977, 29922, 2457, 29918, 8977, 29892, 13, 4706, 1723, 13, 13, 4706, 7934, 29918, 28631, 353, 14391, 29961, 29900, 29962, 13, 4706, 565, 1583, 29889, 2917, 29889, 29873, 347, 29918, 1742, 29918, 17987, 29881, 886, 29901, 13, 9651, 7258, 29918, 17987, 8497, 353, 1583, 29889, 2151, 29889, 20897, 3366, 7529, 3108, 3366, 17987, 29881, 886, 3108, 3366, 1742, 29918, 17987, 29881, 886, 3108, 3366, 17987, 8497, 3108, 13, 4706, 1683, 29901, 13, 9651, 7258, 29918, 17987, 8497, 353, 6213, 13, 13, 4706, 396, 11796, 29872, 278, 18988, 19435, 13, 4706, 1480, 1169, 353, 1583, 29889, 25932, 29898, 10892, 29918, 28631, 29892, 7258, 29918, 17987, 8497, 29922, 12366, 29918, 17987, 8497, 29897, 13, 13, 4706, 565, 451, 736, 29918, 8977, 29901, 13, 9651, 736, 313, 1188, 1169, 29892, 29897, 718, 14391, 29961, 29896, 17531, 13, 13, 4706, 736, 383, 21222, 29907, 1485, 284, 26369, 6466, 3047, 29907, 2124, 4165, 296, 1080, 29898, 13, 9651, 1480, 1169, 29922, 1188, 1169, 29892, 13, 9651, 7934, 29918, 28631, 29922, 4905, 29879, 29889, 10892, 29918, 28631, 29892, 13, 9651, 1098, 296, 1080, 29922, 4905, 29879, 29889, 1131, 296, 1080, 29892, 13, 9651, 4891, 29918, 1131, 296, 1080, 29922, 4905, 29879, 29889, 19128, 29918, 1131, 296, 1080, 29892, 13, 4706, 1723, 13, 13, 13, 29992, 1202, 29918, 2962, 29918, 1514, 19651, 29898, 13, 1678, 9995, 13, 1678, 16662, 8125, 411, 263, 4086, 1904, 292, 2343, 373, 2246, 313, 29874, 5608, 7546, 373, 2246, 310, 278, 7934, 29899, 28631, 1962, 29897, 321, 29889, 29887, 363, 13, 1678, 8478, 387, 1253, 573, 9595, 29889, 13, 1678, 5124, 613, 13, 1678, 350, 20161, 29918, 25826, 29918, 28665, 20785, 29892, 13, 29897, 13, 1990, 383, 21222, 29933, 814, 2831, 29907, 1485, 284, 26369, 29898, 29943, 21222, 29933, 814, 6572, 5323, 1312, 3195, 1125, 13, 1678, 3883, 29918, 1990, 353, 383, 21222, 29933, 814, 2831, 29907, 1485, 284, 26369, 7355, 13, 13, 1678, 822, 19012, 29918, 2080, 29879, 29918, 1454, 29918, 4738, 362, 29898, 1311, 29892, 1881, 29918, 4841, 29892, 4236, 29918, 2848, 29892, 8570, 29918, 13168, 29901, 28379, 29961, 29926, 9302, 29889, 11501, 2588, 29962, 353, 6213, 1125, 13, 4706, 396, 2847, 5281, 278, 7090, 13, 4706, 9853, 29918, 2311, 29892, 19359, 29918, 2848, 353, 1881, 29918, 4841, 29889, 12181, 13, 13, 4706, 4940, 29918, 1989, 29918, 5975, 353, 1583, 29889, 2344, 29918, 8173, 29898, 16175, 29918, 2311, 29892, 4236, 29918, 2848, 29897, 13, 4706, 396, 3940, 393, 5491, 697, 723, 505, 304, 1925, 29871, 29900, 29915, 29879, 297, 278, 8570, 29918, 13168, 363, 921, 1405, 1881, 29918, 4841, 29889, 12181, 14352, 29896, 29962, 322, 921, 529, 7090, 29918, 2848, 29889, 13, 4706, 396, 1205, 1951, 278, 1602, 6119, 3913, 263, 3269, 284, 11105, 29892, 1906, 11909, 526, 11105, 287, 8763, 29889, 13, 4706, 396, 6549, 29892, 591, 508, 1653, 263, 2323, 2294, 8570, 29918, 13168, 1244, 29892, 607, 338, 901, 8543, 363, 14835, 13, 4706, 10410, 29918, 1131, 2509, 29918, 13168, 353, 432, 9302, 29889, 2873, 3552, 16175, 29918, 2311, 29892, 4236, 29918, 2848, 511, 26688, 543, 29875, 29946, 1159, 13, 4706, 565, 8570, 29918, 13168, 338, 451, 6213, 29901, 13, 9651, 2602, 29918, 4841, 353, 8570, 29918, 13168, 29889, 29883, 398, 2083, 29898, 8990, 10457, 29896, 29897, 448, 29871, 29896, 13, 9651, 10410, 29918, 1131, 2509, 29918, 13168, 353, 425, 29916, 29889, 16626, 29918, 5504, 29918, 18337, 29898, 1062, 2760, 29918, 1131, 2509, 29918, 13168, 29892, 8570, 29918, 13168, 29892, 313, 29900, 29892, 29871, 29900, 876, 13, 4706, 1683, 29901, 13, 9651, 2602, 29918, 4841, 353, 432, 9302, 29889, 6729, 328, 4384, 29918, 517, 29898, 29926, 9302, 29889, 279, 927, 29898, 11762, 29918, 2848, 29892, 26688, 543, 29875, 29946, 1159, 29961, 8516, 29892, 584, 1402, 313, 16175, 29918, 2311, 29892, 19359, 29918, 2848, 876, 13, 13, 4706, 736, 426, 13, 9651, 376, 29886, 579, 29918, 1989, 29918, 5975, 1115, 4940, 29918, 1989, 29918, 5975, 29892, 13, 9651, 376, 1131, 2509, 29918, 13168, 1115, 10410, 29918, 1131, 2509, 29918, 13168, 29892, 13, 9651, 376, 3283, 29918, 4841, 1115, 2602, 29918, 4841, 29892, 13, 4706, 500, 13, 13, 1678, 822, 2767, 29918, 2080, 29879, 29918, 1454, 29918, 4738, 362, 29898, 1311, 29892, 1904, 29918, 4905, 29879, 29892, 1904, 29918, 19290, 1125, 13, 4706, 1904, 29918, 19290, 3366, 29886, 579, 29918, 1989, 29918, 5975, 3108, 353, 1904, 29918, 4905, 29879, 29889, 29886, 579, 29918, 1989, 29918, 5975, 13, 4706, 1904, 29918, 19290, 3366, 3283, 29918, 4841, 3108, 353, 1904, 29918, 19290, 3366, 3283, 29918, 4841, 3108, 7503, 29892, 448, 29896, 17531, 718, 29871, 29896, 13, 4706, 736, 1904, 29918, 19290, 13, 13, 13, 4397, 29918, 4804, 29918, 11249, 29918, 1514, 1807, 29898, 13, 1678, 383, 21222, 29933, 814, 2831, 29907, 1485, 284, 26369, 29892, 13, 1678, 903, 4986, 29968, 1430, 26664, 1001, 29918, 22051, 29918, 28665, 29892, 13, 1678, 903, 3210, 16658, 29925, 6992, 29911, 29918, 22051, 29918, 28665, 29892, 13, 1678, 383, 21222, 29907, 1485, 284, 26369, 6466, 3047, 29907, 2124, 4165, 296, 1080, 29892, 13, 1678, 903, 25903, 29918, 22051, 29918, 28665, 29892, 13, 29897, 13, 2 ]
hex-to-dec/eval.py
adiyen/jetson-projects
0
37283
# MIT License # Copyright (c) 2019 JetsonHacks # See license # Using a CSI camera (such as the Raspberry Pi Version 2) connected to a # NVIDIA Jetson Nano Developer Kit using OpenCV # Drivers for the camera and OpenCV are included in the base image from __future__ import print_function import os import argparse import numpy as np import cv2 import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from train import Net # gstreamer_pipeline returns a GStreamer pipeline for capturing from the CSI camera # Defaults to 1280x720 @ 60fps # Flip the image by setting the flip_method (most common values: 0 and 2) # display_width and display_height determine the size of the window on the screen def gstreamer_pipeline (capture_width=1280, capture_height=720, display_width=640, display_height=360, framerate=20, flip_method=0) : return ('nvarguscamerasrc ! ' 'video/x-raw(memory:NVMM), ' 'width=(int)%d, height=(int)%d, ' 'format=(string)NV12, framerate=(fraction)%d/1 ! ' 'nvvidconv flip-method=%d ! ' 'video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! ' 'videoconvert ! ' 'video/x-raw, format=(string)BGR ! appsink' % (capture_width,capture_height,framerate,flip_method,display_width,display_height)) def transform_inputs(image, device): img = cv2.resize(image, (28, 28), interpolation=cv2.INTER_AREA) # img = cv2.resize(image, (28, 28)) # image = cv2.threshold(image0, 50, 255, cv2.THRESH_BINARY)[1] blur = cv2.GaussianBlur(img,(5,5),0) image = cv2.threshold(blur,0,255,cv2.THRESH_BINARY_INV+cv2.THRESH_OTSU)[1] # image = image[np.newaxis, ...] transform = transforms.Compose([ transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,)) ]) inputs = transform(image) inputs = inputs.unsqueeze(0) return inputs.to(device) def show_camera(args): # To flip the image, modify the flip_method parameter (0 and 2 are the most common) print(gstreamer_pipeline(flip_method=0)) labels = [] with open("data/labels.txt", "r") as f: for line in f: labels.append(line.strip()) use_cuda = torch.cuda.is_available() device = torch.device("cuda" if use_cuda else "cpu") model = Net(n_classes=len(labels)) model.load_state_dict(torch.load(args.model_path)) model = model.to(device) font = cv2.FONT_HERSHEY_SIMPLEX fontScale = 1 org = (30, 50) color = (0, 0, 255) thickness = 2 cap = cv2.VideoCapture(gstreamer_pipeline(flip_method=0), cv2.CAP_GSTREAMER) if cap.isOpened(): window_handle = cv2.namedWindow('Camera', cv2.WINDOW_AUTOSIZE) # Window while cv2.getWindowProperty('Camera',0) >= 0: ret_val, img = cap.read() # Convert to grayscale and apply Gaussian filtering im_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) im_gray = cv2.GaussianBlur(im_gray, (5, 5), 0) # Threshold the image ret, im_th = cv2.threshold(im_gray, 90, 255, cv2.THRESH_BINARY_INV) # Find contours in the image im2, ctrs, hier = cv2.findContours(im_th, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) # Get rectangles contains each contour rects = [cv2.boundingRect(ctr) for ctr in ctrs] # For each rectangular region, calculate HOG features and predict # the digit using Linear SVM. for rect in rects: # Draw the rectangles cv2.rectangle(img, (rect[0], rect[1]), (rect[0] + rect[2], rect[1] + rect[3]), (0, 255, 0), 3) # Make the rectangular region around the digit leng = int(rect[3] * 1.6) pt1 = int(rect[1] + rect[3] // 2 - leng // 2) pt2 = int(rect[0] + rect[2] // 2 - leng // 2) roi = im_gray[pt1:pt1+leng, pt2:pt2+leng] # Resize the image h, w = roi.shape if h > 10 and w > 10: # Transform inputs inputs = transform_inputs(roi, device) # Run Model Evaluation output = model(inputs) result = output.data.cpu().numpy().argmax() cv2.putText(img, labels[result], (rect[0], rect[1]),cv2.FONT_HERSHEY_DUPLEX, 2, (0, 255, 255), 3) cv2.imshow("Camera", img) # This also acts as keyCode = cv2.waitKey(30) & 0xff # Stop the program on the ESC key if keyCode == 27: break cap.release() cv2.destroyAllWindows() else: print('Unable to open camera') if __name__ == '__main__': parser = argparse.ArgumentParser(description='PyTorch MNIST Example') parser.add_argument('--model_path', default="models/model.pt") args = parser.parse_args() show_camera(args)
[ 1, 396, 341, 1806, 19245, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29929, 27804, 1100, 29950, 26514, 13, 29937, 2823, 19405, 13, 29937, 5293, 263, 315, 5425, 10656, 313, 14565, 408, 278, 390, 4692, 16344, 7362, 10079, 29871, 29906, 29897, 6631, 304, 263, 29871, 13, 29937, 405, 13044, 10764, 27804, 1100, 405, 1562, 10682, 261, 26240, 773, 4673, 15633, 13, 29937, 360, 374, 874, 363, 278, 10656, 322, 4673, 15633, 526, 5134, 297, 278, 2967, 1967, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 5215, 2897, 13, 5215, 1852, 5510, 13, 5215, 12655, 408, 7442, 13, 5215, 13850, 29906, 13, 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, 5215, 4842, 305, 29889, 20640, 408, 5994, 13, 3166, 4842, 305, 4924, 1053, 20035, 29892, 4327, 29879, 13, 13, 3166, 7945, 1053, 12670, 13, 13, 29937, 330, 5461, 261, 29918, 13096, 5570, 3639, 263, 402, 3835, 261, 16439, 363, 4332, 3864, 515, 278, 315, 5425, 10656, 13, 29937, 13109, 29879, 304, 29871, 29896, 29906, 29947, 29900, 29916, 29955, 29906, 29900, 732, 29871, 29953, 29900, 29888, 567, 29871, 13, 29937, 383, 3466, 278, 1967, 491, 4444, 278, 285, 3466, 29918, 5696, 313, 3242, 3619, 1819, 29901, 29871, 29900, 322, 29871, 29906, 29897, 13, 29937, 2479, 29918, 2103, 322, 2479, 29918, 3545, 8161, 278, 2159, 310, 278, 3474, 373, 278, 4315, 13, 1753, 330, 5461, 261, 29918, 13096, 5570, 313, 17885, 545, 29918, 2103, 29922, 29896, 29906, 29947, 29900, 29892, 10446, 29918, 3545, 29922, 29955, 29906, 29900, 29892, 2479, 29918, 2103, 29922, 29953, 29946, 29900, 29892, 2479, 29918, 3545, 29922, 29941, 29953, 29900, 29892, 1424, 4183, 403, 29922, 29906, 29900, 29892, 285, 3466, 29918, 5696, 29922, 29900, 29897, 584, 1678, 13, 1678, 736, 6702, 29876, 29894, 1191, 22142, 4183, 294, 2214, 1738, 525, 29871, 13, 1678, 525, 9641, 29914, 29916, 29899, 1610, 29898, 14834, 29901, 29940, 29963, 7428, 511, 525, 13, 1678, 525, 2103, 7607, 524, 29897, 29995, 29881, 29892, 3171, 7607, 524, 29897, 29995, 29881, 29892, 525, 13, 1678, 525, 4830, 7607, 1807, 29897, 29940, 29963, 29896, 29906, 29892, 1424, 4183, 403, 7607, 29888, 13857, 29897, 29995, 29881, 29914, 29896, 1738, 525, 13, 1678, 525, 29876, 29894, 8590, 20580, 285, 3466, 29899, 5696, 16328, 29881, 1738, 525, 13, 1678, 525, 9641, 29914, 29916, 29899, 1610, 29892, 2920, 7607, 524, 29897, 29995, 29881, 29892, 3171, 7607, 524, 29897, 29995, 29881, 29892, 3402, 7607, 1807, 29897, 29933, 14345, 29916, 1738, 525, 13, 1678, 525, 9641, 13441, 1738, 525, 13, 1678, 525, 9641, 29914, 29916, 29899, 1610, 29892, 3402, 7607, 1807, 29897, 29933, 14345, 1738, 11446, 682, 29915, 29871, 1273, 313, 17885, 545, 29918, 2103, 29892, 17885, 545, 29918, 3545, 29892, 1341, 4183, 403, 29892, 29888, 3466, 29918, 5696, 29892, 4990, 29918, 2103, 29892, 4990, 29918, 3545, 876, 13, 13, 13, 1753, 4327, 29918, 2080, 29879, 29898, 3027, 29892, 4742, 1125, 13, 1678, 10153, 353, 13850, 29906, 29889, 21476, 29898, 3027, 29892, 313, 29906, 29947, 29892, 29871, 29906, 29947, 511, 29694, 29922, 11023, 29906, 29889, 23845, 29918, 29909, 1525, 29909, 29897, 13, 1678, 396, 10153, 353, 13850, 29906, 29889, 21476, 29898, 3027, 29892, 313, 29906, 29947, 29892, 29871, 29906, 29947, 876, 13, 1678, 396, 1967, 353, 13850, 29906, 29889, 386, 12268, 29898, 3027, 29900, 29892, 29871, 29945, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 13850, 29906, 29889, 4690, 1525, 7068, 29918, 29933, 1177, 19926, 9601, 29896, 29962, 13, 1678, 1999, 332, 353, 13850, 29906, 29889, 29954, 17019, 10358, 332, 29898, 2492, 22657, 29945, 29892, 29945, 511, 29900, 29897, 13, 1678, 1967, 353, 13850, 29906, 29889, 386, 12268, 29898, 2204, 332, 29892, 29900, 29892, 29906, 29945, 29945, 29892, 11023, 29906, 29889, 4690, 1525, 7068, 29918, 29933, 1177, 19926, 29918, 1177, 29963, 29974, 11023, 29906, 29889, 4690, 1525, 7068, 29918, 2891, 14605, 9601, 29896, 29962, 13, 13, 1678, 396, 1967, 353, 1967, 29961, 9302, 29889, 1482, 8990, 29892, 2023, 29962, 13, 1678, 4327, 353, 4327, 29879, 29889, 1523, 4220, 4197, 13, 462, 965, 4327, 29879, 29889, 1762, 29911, 6073, 3285, 13, 462, 965, 4327, 29879, 29889, 19077, 675, 3552, 29900, 29889, 29896, 29941, 29900, 29955, 29892, 511, 313, 29900, 29889, 29941, 29900, 29947, 29896, 29892, 876, 13, 462, 2314, 13, 1678, 10970, 353, 4327, 29898, 3027, 29897, 13, 1678, 10970, 353, 10970, 29889, 6948, 802, 29872, 911, 29898, 29900, 29897, 13, 1678, 736, 10970, 29889, 517, 29898, 10141, 29897, 13, 13, 13, 1753, 1510, 29918, 26065, 29898, 5085, 1125, 13, 1678, 396, 1763, 285, 3466, 278, 1967, 29892, 6623, 278, 285, 3466, 29918, 5696, 3443, 313, 29900, 322, 29871, 29906, 526, 278, 1556, 3619, 29897, 13, 1678, 1596, 29898, 29887, 5461, 261, 29918, 13096, 5570, 29898, 29888, 3466, 29918, 5696, 29922, 29900, 876, 13, 1678, 11073, 353, 5159, 13, 1678, 411, 1722, 703, 1272, 29914, 21134, 29889, 3945, 613, 376, 29878, 1159, 408, 285, 29901, 13, 4706, 363, 1196, 297, 285, 29901, 13, 9651, 11073, 29889, 4397, 29898, 1220, 29889, 17010, 3101, 13, 13, 1678, 671, 29918, 29883, 6191, 353, 4842, 305, 29889, 29883, 6191, 29889, 275, 29918, 16515, 580, 13, 1678, 4742, 353, 4842, 305, 29889, 10141, 703, 29883, 6191, 29908, 565, 671, 29918, 29883, 6191, 1683, 376, 21970, 1159, 13, 1678, 1904, 353, 12670, 29898, 29876, 29918, 13203, 29922, 2435, 29898, 21134, 876, 13, 1678, 1904, 29889, 1359, 29918, 3859, 29918, 8977, 29898, 7345, 305, 29889, 1359, 29898, 5085, 29889, 4299, 29918, 2084, 876, 13, 1678, 1904, 353, 1904, 29889, 517, 29898, 10141, 29897, 13, 13, 1678, 4079, 353, 13850, 29906, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 5425, 3580, 1307, 29990, 13, 1678, 4079, 17185, 353, 29871, 29896, 13, 1678, 1638, 353, 313, 29941, 29900, 29892, 29871, 29945, 29900, 29897, 13, 1678, 2927, 353, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 29897, 13, 1678, 12003, 2264, 353, 29871, 29906, 13, 13, 1678, 2117, 353, 13850, 29906, 29889, 15167, 21133, 545, 29898, 29887, 5461, 261, 29918, 13096, 5570, 29898, 29888, 3466, 29918, 5696, 29922, 29900, 511, 13850, 29906, 29889, 29907, 3301, 29918, 29954, 1254, 1525, 5194, 1001, 29897, 13, 1678, 565, 2117, 29889, 275, 6585, 287, 7295, 13, 4706, 3474, 29918, 8411, 353, 13850, 29906, 29889, 17514, 5907, 877, 20717, 742, 13850, 29906, 29889, 25152, 3970, 29956, 29918, 20656, 3267, 29902, 10721, 29897, 13, 13, 4706, 396, 18379, 29871, 13, 4706, 1550, 13850, 29906, 29889, 657, 5907, 4854, 877, 20717, 742, 29900, 29897, 6736, 29871, 29900, 29901, 13, 9651, 3240, 29918, 791, 29892, 10153, 353, 2117, 29889, 949, 580, 13, 13, 9651, 396, 14806, 304, 16749, 7052, 322, 3394, 22477, 21166, 13, 9651, 527, 29918, 21012, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2492, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 9651, 527, 29918, 21012, 353, 13850, 29906, 29889, 29954, 17019, 10358, 332, 29898, 326, 29918, 21012, 29892, 313, 29945, 29892, 29871, 29945, 511, 29871, 29900, 29897, 13, 13, 9651, 396, 498, 12268, 278, 1967, 13, 9651, 3240, 29892, 527, 29918, 386, 353, 13850, 29906, 29889, 386, 12268, 29898, 326, 29918, 21012, 29892, 29871, 29929, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 13850, 29906, 29889, 4690, 1525, 7068, 29918, 29933, 1177, 19926, 29918, 1177, 29963, 29897, 13, 13, 9651, 396, 10987, 640, 2470, 297, 278, 1967, 13, 9651, 527, 29906, 29892, 274, 509, 29879, 29892, 6128, 353, 13850, 29906, 29889, 2886, 1323, 2470, 29898, 326, 29918, 386, 29892, 13850, 29906, 29889, 1525, 5659, 29918, 5746, 4945, 29940, 1964, 29892, 13850, 29906, 29889, 3210, 29909, 1177, 29918, 3301, 8618, 29990, 29918, 5425, 3580, 1307, 29897, 13, 13, 9651, 396, 3617, 7705, 19536, 3743, 1269, 640, 473, 13, 9651, 7705, 29879, 353, 518, 11023, 29906, 29889, 9917, 292, 7364, 29898, 9988, 29897, 363, 274, 509, 297, 274, 509, 29879, 29962, 13, 13, 9651, 396, 1152, 1269, 7705, 6825, 5120, 29892, 8147, 29832, 29954, 5680, 322, 8500, 13, 9651, 396, 278, 13615, 773, 22985, 317, 9219, 29889, 13, 9651, 363, 7705, 297, 7705, 29879, 29901, 13, 18884, 396, 18492, 278, 7705, 19536, 13, 18884, 13850, 29906, 29889, 1621, 2521, 29898, 2492, 29892, 313, 1621, 29961, 29900, 1402, 7705, 29961, 29896, 11724, 313, 1621, 29961, 29900, 29962, 718, 7705, 29961, 29906, 1402, 7705, 29961, 29896, 29962, 718, 7705, 29961, 29941, 11724, 313, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 511, 29871, 29941, 29897, 29871, 13, 18884, 396, 8561, 278, 7705, 6825, 5120, 2820, 278, 13615, 13, 18884, 28537, 353, 938, 29898, 1621, 29961, 29941, 29962, 334, 29871, 29896, 29889, 29953, 29897, 13, 18884, 19592, 29896, 353, 938, 29898, 1621, 29961, 29896, 29962, 718, 7705, 29961, 29941, 29962, 849, 29871, 29906, 448, 28537, 849, 29871, 29906, 29897, 13, 18884, 19592, 29906, 353, 938, 29898, 1621, 29961, 29900, 29962, 718, 7705, 29961, 29906, 29962, 849, 29871, 29906, 448, 28537, 849, 29871, 29906, 29897, 13, 18884, 14100, 353, 527, 29918, 21012, 29961, 415, 29896, 29901, 415, 29896, 29974, 29880, 996, 29892, 19592, 29906, 29901, 415, 29906, 29974, 29880, 996, 29962, 13, 18884, 396, 2538, 675, 278, 1967, 13, 18884, 298, 29892, 281, 353, 14100, 29889, 12181, 13, 18884, 565, 298, 1405, 29871, 29896, 29900, 322, 281, 1405, 29871, 29896, 29900, 29901, 13, 462, 1678, 396, 4103, 689, 10970, 13, 462, 1678, 10970, 353, 4327, 29918, 2080, 29879, 29898, 307, 29875, 29892, 4742, 29897, 13, 462, 1678, 396, 7525, 8125, 382, 4387, 362, 13, 462, 1678, 1962, 353, 1904, 29898, 2080, 29879, 29897, 13, 462, 1678, 1121, 353, 1962, 29889, 1272, 29889, 21970, 2141, 23749, 2141, 1191, 3317, 580, 13, 462, 1678, 13850, 29906, 29889, 649, 1626, 29898, 2492, 29892, 11073, 29961, 2914, 1402, 313, 1621, 29961, 29900, 1402, 7705, 29961, 29896, 11724, 11023, 29906, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 29928, 4897, 1307, 29990, 29892, 29871, 29906, 29892, 313, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 511, 29871, 29941, 29897, 13, 632, 13, 9651, 13850, 29906, 29889, 326, 4294, 703, 20717, 613, 10153, 29897, 13, 13, 12, 1678, 396, 910, 884, 14741, 408, 29871, 13, 9651, 1820, 3399, 353, 13850, 29906, 29889, 10685, 2558, 29898, 29941, 29900, 29897, 669, 29871, 29900, 29916, 600, 13, 9651, 396, 22303, 278, 1824, 373, 278, 382, 7187, 1820, 13, 9651, 565, 1820, 3399, 1275, 29871, 29906, 29955, 29901, 13, 1669, 2867, 13, 4706, 2117, 29889, 14096, 580, 13, 4706, 13850, 29906, 29889, 20524, 3596, 7685, 580, 13, 1678, 1683, 29901, 13, 4706, 1596, 877, 2525, 519, 304, 1722, 10656, 1495, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 19737, 29911, 25350, 341, 29940, 9047, 8741, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 4299, 29918, 2084, 742, 2322, 543, 9794, 29914, 4299, 29889, 415, 1159, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 1510, 29918, 26065, 29898, 5085, 29897, 13, 2 ]
deep_hipsc_tracking/plotting/compartment_plot.py
JackToppen/deep-hipsc-tracking
2
36448
""" Plot data split by compartments Classes: * :py:class:`CompartmentPlot`: compartment plotting tool """ # Standard lib from typing import Tuple, Optional, Dict # 3rd party imports import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns # Our own imports from .styling import set_plot_style from .utils import bootstrap_ci, get_histogram # Classes class CompartmentPlot(object): """ Plot data split by multiple compartments :param int n_compartments: How many compartments to split the data into :param int topk: How many samples to take from each compartment """ def __init__(self, n_compartments: int, topk: Optional[int] = None, figsize: Tuple[int] = (8, 8), plot_style: str = 'dark', suffix: str = '.png'): self.n_compartments = n_compartments self.topk = topk self.figsize = figsize self.plot_style = plot_style self.suffix = suffix # Color palettes for the different compartments self.colors = (['blue', 'orange', 'green', 'red', 'purple', 'grey'])[:n_compartments] self.palletes = [sns.color_palette(c.capitalize()+'s', n_colors=10) for c in self.colors] # Calculated values self._bin_indices = None self._bin_values = None self._xdata = None self._xcolumn = None self._ycolumn = None self._plotdata = None self._distdata = None self._total_count = None def calc_indices(self, values: np.ndarray): """ Calculate the indicies for each bin :param ndarray values: The values to use to generate the bins """ if self.topk is None: self.topk = values.shape[0] // self.n_compartments if values.shape[0] < self.topk * self.n_compartments: err = 'Got too few values for {} samples of {} compartments: {}' err = err.format(self.topk, self.n_compartments, values.shape[0]) raise ValueError(err) print(f'Spliting into {self.n_compartments} compartments of {self.topk} samples each') # Sort all the indices indices = np.argsort(values) # Split into even bins of size topk bin_start = np.floor(np.linspace(0, indices.shape[0]-self.topk, self.n_compartments)) bin_start[bin_start < 0] = 0 bin_end = bin_start + self.topk bin_end[bin_end > indices.shape[0]] = indices.shape[0] # Extract the sorted bins for each compartment self._bin_indices = [indices[int(s):int(e)] for s, e in zip(bin_start, bin_end)] def calc_bin(self, bin_value: np.ndarray, label: str, total_count: int) -> Dict[str, float]: """ Calculate all the stats for a single bin :param ndarray bin_value: The 2D array of n timepoints x k samples :param str label: The label for this category :param int total_count: The total number of samples in this bin :returns: A dictionary of bin stats for plotting """ bin_mean = np.nanmean(bin_value, axis=1) bin_std = np.nanstd(bin_value, axis=1) bin5, bin25, bin50, bin75, bin95 = np.nanpercentile(bin_value, [5, 25, 50, 75, 95], axis=1) bin_mean_ci0, bin_mean_ci1 = bootstrap_ci(bin_value, func=np.nanmean, axis=1) assert bin_mean_ci0.shape == bin_mean.shape assert bin_mean_ci1.shape == bin_mean.shape bin_median_ci0, bin_median_ci1 = bootstrap_ci(bin_value, func=np.nanmedian, axis=1) assert bin_median_ci0.shape == bin50.shape assert bin_median_ci0.shape == bin50.shape # Work out how many samples/bin we have in each timepoint bin_count = np.sum(~np.isnan(bin_value), axis=1) bin_support = bin_count / total_count bin_support[~np.isfinite(bin_support)] = 0 # Stash all the values for later return { 'mean' + label: bin_mean, 'mean ci low' + label: bin_mean_ci0, 'mean ci high' + label: bin_mean_ci1, 'std' + label: bin_std, 'p5' + label: bin5, 'p25' + label: bin25, 'p50' + label: bin50, 'p50 ci low' + label: bin_median_ci0, 'p50 ci high' + label: bin_median_ci1, 'p75' + label: bin75, 'p95' + label: bin95, 'count' + label: bin_count, 'support' + label: bin_support, } def split_comparison(self, data: Dict[str, np.ndarray], xcolumn: str, ycolumn: str, integrate_values: bool = False): """ Split the comparison by the bins :param dict[str, Any] data: A dictionary containing the xcolumn and ycolumn data :param str xcolumn: The column containing the shared time vector to plot along :param str ycolumn: The column containing the values to bin along :param bool integrate_values: If True, integrate the resulting statistics over the xdata range """ xdata = data[xcolumn] plotdata = { xcolumn: xdata, } values = np.stack(data[ycolumn], axis=1) total_count = np.sum(~np.isnan(values), axis=1) if values.shape[0] != xdata.shape[0]: raise ValueError('Expected {} with shape {}, got {}'.format(ycolumn, xdata.shape[0], values.shape[0])) bin_values = [] # Add a set for all the values plotdata.update(self.calc_bin(values, f' {ycolumn} all', total_count)) for i, indices in enumerate(self._bin_indices): bin_value = values[:, indices] bin_values.append(bin_value) label = f' {ycolumn} bin{i+1}' plotdata.update(self.calc_bin(bin_value, label, total_count)) self._plotdata = plotdata self._xdata = xdata self._xcolumn = xcolumn self._ycolumn = ycolumn self._bin_values = bin_values self._total_count = total_count def calc_envelope(self, label: str, envelope: str = 'std') -> Tuple[float]: """ Calculate the envelope (high/low) stats for a label :param str label: The label to calculate the envelope for :param str envelope: Which stats to calculate the envelope with :returns: A tuple of low, high values """ plotdata = self._plotdata if envelope == 'std': value_mean = plotdata['mean' + label] value_std = plotdata['std' + label] value_st = value_mean - value_std value_ed = value_mean + value_std elif envelope == 'mean ci': value_st = plotdata['mean ci low' + label] value_ed = plotdata['mean ci high' + label] elif envelope == 'median ci': value_st = plotdata['p50 ci low' + label] value_ed = plotdata['p50 ci high' + label] elif envelope == 'iqr': value_st = plotdata['p25' + label] value_ed = plotdata['p75' + label] else: raise ValueError('Unknown envelope function "{}"'.format(envelope)) return value_st, value_ed def plot_raw_tracks(self, outfile=None, xlabel=None, ylabel=None): """ Plot individual raw tracks """ with set_plot_style(self.plot_style) as style: fig, ax = plt.subplots(1, 1, figsize=self.figsize) for i, bin_value in enumerate(self._bin_values): ax.set_prop_cycle(color=self.palletes[i]) ax.plot(self._xdata, bin_value, '-') if xlabel is not None: ax.set_xlabel(xlabel) if ylabel is not None: ax.set_ylabel(ylabel) style.show(outfile=outfile, fig=fig) def plot_mean_tracks(self, outfile=None, xlabel=None, ylabel=None, envelope='std', mode='split'): """ Mean and deviation envelope :param Path outfile: If not None, the file to write out :param str xlabel: Label for the x-axis (time) :param str ylabel: Label for the y-axis (category) """ plotdata = self._plotdata with set_plot_style(self.plot_style) as style: fig, ax = plt.subplots(1, 1, figsize=self.figsize) if mode == 'split': for i in range(self.n_compartments): label = ' {} bin{}'.format(self._ycolumn, i+1) value_mean = plotdata['mean' + label] value_st, value_ed = self.calc_envelope(label, envelope) ax.fill_between(self._xdata, value_st, value_ed, facecolor=self.colors[i], alpha=0.5) ax.plot(self._xdata, value_mean, '-', color=self.colors[i], linewidth=2) elif mode == 'all': label = ' {} all'.format(self._ycolumn) value_mean = plotdata['mean' + label] value_st, value_ed = self.calc_envelope(label, envelope) ax.fill_between(self._xdata, value_st, value_ed, facecolor='b', alpha=0.5) ax.plot(self._xdata, value_mean, '-', color='b', linewidth=2) else: raise ValueError('Unknown mode {}'.format(mode)) if xlabel is not None: ax.set_xlabel(xlabel) if ylabel is not None: ax.set_ylabel(ylabel) style.show(outfile=outfile, fig=fig) def plot_median_tracks(self, outfile=None, xlabel=None, ylabel=None, envelope='iqr', mode='split'): """ Median and 25/75% envelope """ plotdata = self._plotdata with set_plot_style(self.plot_style) as style: fig, ax = plt.subplots(1, 1, figsize=self.figsize) if mode == 'split': for i in range(self.n_compartments): label = ' {} bin{}'.format(self._ycolumn, i+1) value_mid = plotdata['p50' + label] value_st, value_ed = self.calc_envelope(label, envelope) ax.fill_between(self._xdata, value_st, value_ed, facecolor=self.colors[i], alpha=0.5) ax.plot(self._xdata, value_mid, '-', color=self.colors[i], linewidth=2) elif mode == 'all': label = ' {} all'.format(self._ycolumn) value_mean = plotdata['p50' + label] value_st, value_ed = self.calc_envelope(label, envelope) ax.fill_between(self._xdata, value_st, value_ed, facecolor='b', alpha=0.5) ax.plot(self._xdata, value_mean, '-', color='b', linewidth=2) else: raise ValueError('Unknown mode {}'.format(mode)) if xlabel is not None: ax.set_xlabel(xlabel) if ylabel is not None: ax.set_ylabel(ylabel) style.show(outfile=outfile, fig=fig) def plot_track_support(self, outfile=None, xlabel=None, ylabel=None): """ Plot how many tracks are in a given bin at a given time """ plotdata = self._plotdata with set_plot_style(self.plot_style) as style: fig_x, fig_y = self.figsize fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(fig_x*2, fig_y)) ax1.plot(self._xdata, self._total_count, '-k', linewidth=2) ax2.hlines([100], np.min(self._xdata), np.max(self._xdata), colors=['k'], linewidth=2) for i in range(self.n_compartments): label = ' {} bin{}'.format(self._ycolumn, i+1) count = plotdata['count' + label] support = plotdata['support' + label] ax1.plot(self._xdata, count, '-', color=self.colors[i], linewidth=2) ax2.plot(self._xdata, support*100, '-', color=self.colors[i], linewidth=2) if xlabel is not None: ax1.set_xlabel(xlabel) ax2.set_xlabel(xlabel) ax1.set_ylabel('Num Tracks') ax2.set_ylabel('Percent Total Tracks') ax1.set_ylim([0, np.max(self._total_count)*1.02]) ax2.set_ylim([0, 102]) style.show(outfile=outfile, fig=fig) def plot_dist_histogram(self, values, outfile=None, xlabel=None, ylabel=None): """ Plot where on the histogram each value occurs :param ndarray values: The values to generate a histogram for :param Path outfile: If not None, the path to save the plot to """ # Histogram the distribution and which compartments are being labeled _, _, kernel_x, kernel_y = get_histogram(values, bins=10, kernel_smoothing=True) compartment_values = [values[indices] for indices in self._bin_indices] distdata = { 'compartment': [], 'value': [], 'density': [], } # Now, plot each compartment on the total histogram with set_plot_style(self.plot_style) as style: fig, ax = plt.subplots(1, 1, figsize=self.figsize) ax.plot(kernel_x, kernel_y, '-', color='gray') distdata['compartment'].extend(0 for _ in kernel_x) distdata['value'].extend(kernel_x) distdata['density'].extend(kernel_y) for i, compartment_value in enumerate(compartment_values): compartment_min = np.min(compartment_value) compartment_max = np.max(compartment_value) kernel_mask = np.logical_and(kernel_x >= compartment_min, kernel_x <= compartment_max) compartment_x = kernel_x[kernel_mask] compartment_y = kernel_y[kernel_mask] distdata['compartment'].extend(i+1 for _ in compartment_x) distdata['value'].extend(compartment_x) distdata['density'].extend(compartment_y) ax.fill_between(compartment_x, 0, compartment_y, facecolor=self.colors[i], alpha=0.5) ax.plot(compartment_x, compartment_y, '-', color=self.colors[i], linewidth=2) if xlabel is not None: ax.set_xlabel(xlabel) if ylabel is not None: ax.set_ylabel(ylabel) style.show(outfile=outfile, fig=fig) self._distdata = distdata def save_plotdata(self, outfile, suffix='.csv'): """ Save the plot data """ if self._plotdata is None: raise ValueError('No distribution data, call split_comparison first') outfile = outfile.parent / (outfile.stem + suffix) print('Writing distribution data to {}'.format(outfile)) plotdata = pd.DataFrame(self._plotdata) if suffix == '.csv': plotdata.to_csv(str(outfile), header=True, index=False) elif suffix == '.xlsx': plotdata.to_excel(str(outfile), header=True, index=False) else: raise KeyError('Unknown plot data output file type: {}'.format(outfile)) def save_distdata(self, outfile, suffix='.csv'): """ Save the distribution data """ if self._distdata is None: raise ValueError('No distribution data, call plot_dist_histogram first') outfile = outfile.parent / (outfile.stem + suffix) print('Writing distribution data to {}'.format(outfile)) distdata = pd.DataFrame(self._distdata) if suffix == '.csv': distdata.to_csv(str(outfile), header=True, index=False) elif suffix == '.xlsx': distdata.to_excel(str(outfile), header=True, index=False) else: raise KeyError('Unknown dist data output file type: {}'.format(outfile))
[ 1, 9995, 18399, 848, 6219, 491, 29078, 1860, 13, 13, 27403, 29901, 13, 13, 29930, 584, 2272, 29901, 1990, 18078, 1523, 8076, 20867, 6998, 29078, 358, 6492, 1259, 5780, 13, 13, 15945, 29908, 13, 13, 29937, 10117, 4303, 13, 3166, 19229, 1053, 12603, 552, 29892, 28379, 29892, 360, 919, 13, 13, 29937, 29871, 29941, 5499, 6263, 24802, 13, 5215, 12655, 408, 7442, 13, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 13, 5215, 11701, 408, 10518, 13, 13, 5215, 409, 370, 1398, 408, 269, 1983, 13, 13, 29937, 8680, 1914, 24802, 13, 3166, 869, 22062, 1847, 1053, 731, 29918, 5317, 29918, 3293, 13, 3166, 869, 13239, 1053, 16087, 29918, 455, 29892, 679, 29918, 29882, 391, 13342, 13, 13, 29937, 4134, 267, 13, 13, 13, 1990, 422, 8076, 20867, 29898, 3318, 1125, 13, 1678, 9995, 18399, 848, 6219, 491, 2999, 29078, 1860, 13, 13, 1678, 584, 3207, 938, 302, 29918, 510, 1595, 1860, 29901, 13, 4706, 1128, 1784, 29078, 1860, 304, 6219, 278, 848, 964, 13, 1678, 584, 3207, 938, 2246, 29895, 29901, 13, 4706, 1128, 1784, 11916, 304, 2125, 515, 1269, 29078, 358, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 13, 462, 302, 29918, 510, 1595, 1860, 29901, 938, 29892, 13, 462, 2246, 29895, 29901, 28379, 29961, 524, 29962, 353, 6213, 29892, 13, 462, 2537, 2311, 29901, 12603, 552, 29961, 524, 29962, 353, 313, 29947, 29892, 29871, 29947, 511, 13, 462, 6492, 29918, 3293, 29901, 851, 353, 525, 26031, 742, 13, 462, 25557, 29901, 851, 353, 15300, 2732, 29374, 13, 4706, 1583, 29889, 29876, 29918, 510, 1595, 1860, 353, 302, 29918, 510, 1595, 1860, 13, 4706, 1583, 29889, 3332, 29895, 353, 2246, 29895, 13, 13, 4706, 1583, 29889, 1003, 2311, 353, 2537, 2311, 13, 4706, 1583, 29889, 5317, 29918, 3293, 353, 6492, 29918, 3293, 13, 4706, 1583, 29889, 2146, 600, 861, 353, 25557, 13, 13, 4706, 396, 9159, 15509, 698, 267, 363, 278, 1422, 29078, 1860, 13, 4706, 1583, 29889, 27703, 353, 313, 1839, 9539, 742, 525, 272, 927, 742, 525, 12692, 742, 525, 1127, 742, 525, 15503, 552, 742, 525, 7979, 29891, 11287, 7503, 29876, 29918, 510, 1595, 1860, 29962, 13, 4706, 1583, 29889, 7830, 1026, 267, 353, 518, 29879, 1983, 29889, 2780, 29918, 29886, 26456, 29898, 29883, 29889, 5030, 2410, 675, 580, 23097, 29879, 742, 302, 29918, 27703, 29922, 29896, 29900, 29897, 13, 462, 308, 363, 274, 297, 1583, 29889, 27703, 29962, 13, 13, 4706, 396, 20535, 630, 1819, 13, 4706, 1583, 3032, 2109, 29918, 513, 1575, 353, 6213, 13, 4706, 1583, 3032, 2109, 29918, 5975, 353, 6213, 13, 4706, 1583, 3032, 29916, 1272, 353, 6213, 13, 4706, 1583, 3032, 29916, 4914, 353, 6213, 13, 4706, 1583, 3032, 29891, 4914, 353, 6213, 13, 4706, 1583, 3032, 5317, 1272, 353, 6213, 13, 4706, 1583, 3032, 5721, 1272, 353, 6213, 13, 4706, 1583, 3032, 7827, 29918, 2798, 353, 6213, 13, 13, 1678, 822, 22235, 29918, 513, 1575, 29898, 1311, 29892, 1819, 29901, 7442, 29889, 299, 2378, 1125, 13, 4706, 9995, 20535, 403, 278, 4221, 583, 363, 1269, 9016, 13, 13, 4706, 584, 3207, 29871, 299, 2378, 1819, 29901, 13, 9651, 450, 1819, 304, 671, 304, 5706, 278, 289, 1144, 13, 4706, 9995, 13, 4706, 565, 1583, 29889, 3332, 29895, 338, 6213, 29901, 13, 9651, 1583, 29889, 3332, 29895, 353, 1819, 29889, 12181, 29961, 29900, 29962, 849, 1583, 29889, 29876, 29918, 510, 1595, 1860, 13, 13, 4706, 565, 1819, 29889, 12181, 29961, 29900, 29962, 529, 1583, 29889, 3332, 29895, 334, 1583, 29889, 29876, 29918, 510, 1595, 1860, 29901, 13, 9651, 4589, 353, 525, 29954, 327, 2086, 2846, 1819, 363, 6571, 11916, 310, 6571, 29078, 1860, 29901, 6571, 29915, 13, 9651, 4589, 353, 4589, 29889, 4830, 29898, 1311, 29889, 3332, 29895, 29892, 1583, 29889, 29876, 29918, 510, 1595, 1860, 29892, 1819, 29889, 12181, 29961, 29900, 2314, 13, 9651, 12020, 7865, 2392, 29898, 3127, 29897, 13, 4706, 1596, 29898, 29888, 29915, 18772, 292, 964, 426, 1311, 29889, 29876, 29918, 510, 1595, 1860, 29913, 29078, 1860, 310, 426, 1311, 29889, 3332, 29895, 29913, 11916, 1269, 1495, 13, 13, 4706, 396, 20025, 599, 278, 16285, 13, 4706, 16285, 353, 7442, 29889, 5085, 441, 29898, 5975, 29897, 13, 13, 4706, 396, 26178, 964, 1584, 289, 1144, 310, 2159, 2246, 29895, 13, 4706, 9016, 29918, 2962, 353, 7442, 29889, 14939, 29898, 9302, 29889, 1915, 3493, 29898, 29900, 29892, 16285, 29889, 12181, 29961, 29900, 29962, 29899, 1311, 29889, 3332, 29895, 29892, 1583, 29889, 29876, 29918, 510, 1595, 1860, 876, 13, 4706, 9016, 29918, 2962, 29961, 2109, 29918, 2962, 529, 29871, 29900, 29962, 353, 29871, 29900, 13, 4706, 9016, 29918, 355, 353, 9016, 29918, 2962, 718, 1583, 29889, 3332, 29895, 13, 4706, 9016, 29918, 355, 29961, 2109, 29918, 355, 1405, 16285, 29889, 12181, 29961, 29900, 5262, 353, 16285, 29889, 12181, 29961, 29900, 29962, 13, 13, 4706, 396, 7338, 1461, 278, 12705, 289, 1144, 363, 1269, 29078, 358, 13, 4706, 1583, 3032, 2109, 29918, 513, 1575, 353, 518, 513, 1575, 29961, 524, 29898, 29879, 1125, 524, 29898, 29872, 4638, 363, 269, 29892, 321, 297, 14319, 29898, 2109, 29918, 2962, 29892, 9016, 29918, 355, 4638, 13, 13, 1678, 822, 22235, 29918, 2109, 29898, 1311, 29892, 13, 462, 9016, 29918, 1767, 29901, 7442, 29889, 299, 2378, 29892, 13, 462, 3858, 29901, 851, 29892, 13, 462, 3001, 29918, 2798, 29901, 938, 29897, 1599, 360, 919, 29961, 710, 29892, 5785, 5387, 13, 4706, 9995, 20535, 403, 599, 278, 22663, 363, 263, 2323, 9016, 13, 13, 4706, 584, 3207, 29871, 299, 2378, 9016, 29918, 1767, 29901, 13, 9651, 450, 29871, 29906, 29928, 1409, 310, 302, 931, 9748, 921, 413, 11916, 13, 4706, 584, 3207, 851, 3858, 29901, 13, 9651, 450, 3858, 363, 445, 7663, 13, 4706, 584, 3207, 938, 3001, 29918, 2798, 29901, 13, 9651, 450, 3001, 1353, 310, 11916, 297, 445, 9016, 13, 4706, 584, 18280, 29901, 13, 9651, 319, 8600, 310, 9016, 22663, 363, 6492, 1259, 13, 4706, 9995, 13, 13, 4706, 9016, 29918, 12676, 353, 7442, 29889, 13707, 12676, 29898, 2109, 29918, 1767, 29892, 9685, 29922, 29896, 29897, 13, 4706, 9016, 29918, 4172, 353, 7442, 29889, 13707, 4172, 29898, 2109, 29918, 1767, 29892, 9685, 29922, 29896, 29897, 13, 13, 4706, 9016, 29945, 29892, 9016, 29906, 29945, 29892, 9016, 29945, 29900, 29892, 9016, 29955, 29945, 29892, 9016, 29929, 29945, 353, 7442, 29889, 13707, 25376, 488, 29898, 2109, 29918, 1767, 29892, 518, 29945, 29892, 29871, 29906, 29945, 29892, 29871, 29945, 29900, 29892, 29871, 29955, 29945, 29892, 29871, 29929, 29945, 1402, 9685, 29922, 29896, 29897, 13, 4706, 9016, 29918, 12676, 29918, 455, 29900, 29892, 9016, 29918, 12676, 29918, 455, 29896, 353, 16087, 29918, 455, 29898, 2109, 29918, 1767, 29892, 3653, 29922, 9302, 29889, 13707, 12676, 29892, 9685, 29922, 29896, 29897, 13, 4706, 4974, 9016, 29918, 12676, 29918, 455, 29900, 29889, 12181, 1275, 9016, 29918, 12676, 29889, 12181, 13, 4706, 4974, 9016, 29918, 12676, 29918, 455, 29896, 29889, 12181, 1275, 9016, 29918, 12676, 29889, 12181, 13, 13, 4706, 9016, 29918, 2168, 713, 29918, 455, 29900, 29892, 9016, 29918, 2168, 713, 29918, 455, 29896, 353, 16087, 29918, 455, 29898, 2109, 29918, 1767, 29892, 3653, 29922, 9302, 29889, 13707, 2168, 713, 29892, 9685, 29922, 29896, 29897, 13, 4706, 4974, 9016, 29918, 2168, 713, 29918, 455, 29900, 29889, 12181, 1275, 9016, 29945, 29900, 29889, 12181, 13, 4706, 4974, 9016, 29918, 2168, 713, 29918, 455, 29900, 29889, 12181, 1275, 9016, 29945, 29900, 29889, 12181, 13, 13, 4706, 396, 5244, 714, 920, 1784, 11916, 29914, 2109, 591, 505, 297, 1269, 931, 3149, 13, 4706, 9016, 29918, 2798, 353, 7442, 29889, 2083, 29898, 30022, 9302, 29889, 275, 13707, 29898, 2109, 29918, 1767, 511, 9685, 29922, 29896, 29897, 13, 4706, 9016, 29918, 5924, 353, 9016, 29918, 2798, 847, 3001, 29918, 2798, 13, 4706, 9016, 29918, 5924, 29961, 30022, 9302, 29889, 4492, 262, 568, 29898, 2109, 29918, 5924, 4638, 353, 29871, 29900, 13, 13, 4706, 396, 624, 1161, 599, 278, 1819, 363, 2678, 13, 4706, 736, 426, 13, 9651, 525, 12676, 29915, 718, 3858, 29901, 9016, 29918, 12676, 29892, 13, 9651, 525, 12676, 4583, 4482, 29915, 718, 3858, 29901, 9016, 29918, 12676, 29918, 455, 29900, 29892, 13, 9651, 525, 12676, 4583, 1880, 29915, 718, 3858, 29901, 9016, 29918, 12676, 29918, 455, 29896, 29892, 13, 9651, 525, 4172, 29915, 718, 3858, 29901, 9016, 29918, 4172, 29892, 13, 9651, 525, 29886, 29945, 29915, 718, 3858, 29901, 9016, 29945, 29892, 13, 9651, 525, 29886, 29906, 29945, 29915, 718, 3858, 29901, 9016, 29906, 29945, 29892, 13, 9651, 525, 29886, 29945, 29900, 29915, 718, 3858, 29901, 9016, 29945, 29900, 29892, 13, 9651, 525, 29886, 29945, 29900, 4583, 4482, 29915, 718, 3858, 29901, 9016, 29918, 2168, 713, 29918, 455, 29900, 29892, 13, 9651, 525, 29886, 29945, 29900, 4583, 1880, 29915, 718, 3858, 29901, 9016, 29918, 2168, 713, 29918, 455, 29896, 29892, 13, 9651, 525, 29886, 29955, 29945, 29915, 718, 3858, 29901, 9016, 29955, 29945, 29892, 13, 9651, 525, 29886, 29929, 29945, 29915, 718, 3858, 29901, 9016, 29929, 29945, 29892, 13, 9651, 525, 2798, 29915, 718, 3858, 29901, 9016, 29918, 2798, 29892, 13, 9651, 525, 5924, 29915, 718, 3858, 29901, 9016, 29918, 5924, 29892, 13, 4706, 500, 13, 13, 1678, 822, 6219, 29918, 510, 20941, 29898, 1311, 29892, 13, 462, 308, 848, 29901, 360, 919, 29961, 710, 29892, 7442, 29889, 299, 2378, 1402, 13, 462, 308, 921, 4914, 29901, 851, 29892, 13, 462, 308, 343, 4914, 29901, 851, 29892, 13, 462, 308, 22782, 29918, 5975, 29901, 6120, 353, 7700, 1125, 13, 4706, 9995, 26178, 278, 10230, 491, 278, 289, 1144, 13, 13, 4706, 584, 3207, 9657, 29961, 710, 29892, 3139, 29962, 848, 29901, 13, 9651, 319, 8600, 6943, 278, 921, 4914, 322, 343, 4914, 848, 13, 4706, 584, 3207, 851, 921, 4914, 29901, 13, 9651, 450, 1897, 6943, 278, 7258, 931, 4608, 304, 6492, 3412, 13, 4706, 584, 3207, 851, 343, 4914, 29901, 13, 9651, 450, 1897, 6943, 278, 1819, 304, 9016, 3412, 13, 4706, 584, 3207, 6120, 22782, 29918, 5975, 29901, 13, 9651, 960, 5852, 29892, 22782, 278, 9819, 13964, 975, 278, 921, 1272, 3464, 13, 4706, 9995, 13, 4706, 921, 1272, 353, 848, 29961, 29916, 4914, 29962, 13, 4706, 6492, 1272, 353, 426, 13, 9651, 921, 4914, 29901, 921, 1272, 29892, 13, 4706, 500, 13, 4706, 1819, 353, 7442, 29889, 1429, 29898, 1272, 29961, 29891, 4914, 1402, 9685, 29922, 29896, 29897, 13, 4706, 3001, 29918, 2798, 353, 7442, 29889, 2083, 29898, 30022, 9302, 29889, 275, 13707, 29898, 5975, 511, 9685, 29922, 29896, 29897, 13, 13, 4706, 565, 1819, 29889, 12181, 29961, 29900, 29962, 2804, 921, 1272, 29889, 12181, 29961, 29900, 5387, 13, 9651, 12020, 7865, 2392, 877, 1252, 6021, 6571, 411, 8267, 24335, 2355, 6571, 4286, 4830, 29898, 29891, 4914, 29892, 921, 1272, 29889, 12181, 29961, 29900, 1402, 1819, 29889, 12181, 29961, 29900, 12622, 13, 13, 4706, 9016, 29918, 5975, 353, 5159, 13, 13, 4706, 396, 3462, 263, 731, 363, 599, 278, 1819, 13, 4706, 6492, 1272, 29889, 5504, 29898, 1311, 29889, 28667, 29918, 2109, 29898, 5975, 29892, 285, 29915, 426, 29891, 4914, 29913, 599, 742, 3001, 29918, 2798, 876, 13, 4706, 363, 474, 29892, 16285, 297, 26985, 29898, 1311, 3032, 2109, 29918, 513, 1575, 1125, 13, 9651, 9016, 29918, 1767, 353, 1819, 7503, 29892, 16285, 29962, 13, 9651, 9016, 29918, 5975, 29889, 4397, 29898, 2109, 29918, 1767, 29897, 13, 13, 9651, 3858, 353, 285, 29915, 426, 29891, 4914, 29913, 9016, 29912, 29875, 29974, 29896, 10162, 13, 9651, 6492, 1272, 29889, 5504, 29898, 1311, 29889, 28667, 29918, 2109, 29898, 2109, 29918, 1767, 29892, 3858, 29892, 3001, 29918, 2798, 876, 13, 13, 4706, 1583, 3032, 5317, 1272, 353, 6492, 1272, 13, 4706, 1583, 3032, 29916, 1272, 353, 921, 1272, 13, 4706, 1583, 3032, 29916, 4914, 353, 921, 4914, 13, 4706, 1583, 3032, 29891, 4914, 353, 343, 4914, 13, 4706, 1583, 3032, 2109, 29918, 5975, 353, 9016, 29918, 5975, 13, 4706, 1583, 3032, 7827, 29918, 2798, 353, 3001, 29918, 2798, 13, 13, 1678, 822, 22235, 29918, 264, 21367, 29898, 1311, 29892, 3858, 29901, 851, 29892, 427, 21367, 29901, 851, 353, 525, 4172, 1495, 1599, 12603, 552, 29961, 7411, 5387, 13, 4706, 9995, 20535, 403, 278, 427, 21367, 313, 9812, 29914, 677, 29897, 22663, 363, 263, 3858, 13, 13, 4706, 584, 3207, 851, 3858, 29901, 13, 9651, 450, 3858, 304, 8147, 278, 427, 21367, 363, 13, 4706, 584, 3207, 851, 427, 21367, 29901, 13, 9651, 8449, 22663, 304, 8147, 278, 427, 21367, 411, 13, 4706, 584, 18280, 29901, 13, 9651, 319, 18761, 310, 4482, 29892, 1880, 1819, 13, 4706, 9995, 13, 4706, 6492, 1272, 353, 1583, 3032, 5317, 1272, 13, 13, 4706, 565, 427, 21367, 1275, 525, 4172, 2396, 13, 9651, 995, 29918, 12676, 353, 6492, 1272, 1839, 12676, 29915, 718, 3858, 29962, 13, 9651, 995, 29918, 4172, 353, 6492, 1272, 1839, 4172, 29915, 718, 3858, 29962, 13, 9651, 995, 29918, 303, 353, 995, 29918, 12676, 448, 995, 29918, 4172, 13, 9651, 995, 29918, 287, 353, 995, 29918, 12676, 718, 995, 29918, 4172, 13, 4706, 25342, 427, 21367, 1275, 525, 12676, 4583, 2396, 13, 9651, 995, 29918, 303, 353, 6492, 1272, 1839, 12676, 4583, 4482, 29915, 718, 3858, 29962, 13, 9651, 995, 29918, 287, 353, 6492, 1272, 1839, 12676, 4583, 1880, 29915, 718, 3858, 29962, 13, 4706, 25342, 427, 21367, 1275, 525, 2168, 713, 4583, 2396, 13, 9651, 995, 29918, 303, 353, 6492, 1272, 1839, 29886, 29945, 29900, 4583, 4482, 29915, 718, 3858, 29962, 13, 9651, 995, 29918, 287, 353, 6492, 1272, 1839, 29886, 29945, 29900, 4583, 1880, 29915, 718, 3858, 29962, 13, 4706, 25342, 427, 21367, 1275, 525, 29875, 29939, 29878, 2396, 13, 9651, 995, 29918, 303, 353, 6492, 1272, 1839, 29886, 29906, 29945, 29915, 718, 3858, 29962, 13, 9651, 995, 29918, 287, 353, 6492, 1272, 1839, 29886, 29955, 29945, 29915, 718, 3858, 29962, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 14148, 427, 21367, 740, 29850, 5038, 4286, 4830, 29898, 264, 21367, 876, 13, 4706, 736, 995, 29918, 303, 29892, 995, 29918, 287, 13, 13, 1678, 822, 6492, 29918, 1610, 29918, 3018, 4684, 29898, 1311, 29892, 714, 1445, 29922, 8516, 29892, 921, 1643, 29922, 8516, 29892, 343, 1643, 29922, 8516, 1125, 13, 4706, 9995, 18399, 5375, 10650, 16257, 9995, 13, 13, 4706, 411, 731, 29918, 5317, 29918, 3293, 29898, 1311, 29889, 5317, 29918, 3293, 29897, 408, 3114, 29901, 13, 9651, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 29898, 29896, 29892, 29871, 29896, 29892, 2537, 2311, 29922, 1311, 29889, 1003, 2311, 29897, 13, 9651, 363, 474, 29892, 9016, 29918, 1767, 297, 26985, 29898, 1311, 3032, 2109, 29918, 5975, 1125, 13, 18884, 4853, 29889, 842, 29918, 7728, 29918, 23090, 29898, 2780, 29922, 1311, 29889, 7830, 1026, 267, 29961, 29875, 2314, 13, 18884, 4853, 29889, 5317, 29898, 1311, 3032, 29916, 1272, 29892, 9016, 29918, 1767, 29892, 17411, 1495, 13, 9651, 565, 921, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29889, 842, 29918, 29916, 1643, 29898, 29916, 1643, 29897, 13, 9651, 565, 343, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29889, 842, 29918, 29891, 1643, 29898, 29891, 1643, 29897, 13, 9651, 3114, 29889, 4294, 29898, 449, 1445, 29922, 449, 1445, 29892, 2537, 29922, 1003, 29897, 13, 13, 1678, 822, 6492, 29918, 12676, 29918, 3018, 4684, 29898, 1311, 29892, 714, 1445, 29922, 8516, 29892, 921, 1643, 29922, 8516, 29892, 343, 1643, 29922, 8516, 29892, 427, 21367, 2433, 4172, 742, 4464, 2433, 5451, 29374, 13, 4706, 9995, 16316, 322, 29522, 427, 21367, 13, 13, 4706, 584, 3207, 10802, 714, 1445, 29901, 13, 9651, 960, 451, 6213, 29892, 278, 934, 304, 2436, 714, 13, 4706, 584, 3207, 851, 921, 1643, 29901, 13, 9651, 15796, 363, 278, 921, 29899, 8990, 313, 2230, 29897, 13, 4706, 584, 3207, 851, 343, 1643, 29901, 13, 9651, 15796, 363, 278, 343, 29899, 8990, 313, 7320, 29897, 13, 4706, 9995, 13, 4706, 6492, 1272, 353, 1583, 3032, 5317, 1272, 13, 13, 4706, 411, 731, 29918, 5317, 29918, 3293, 29898, 1311, 29889, 5317, 29918, 3293, 29897, 408, 3114, 29901, 13, 9651, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 29898, 29896, 29892, 29871, 29896, 29892, 2537, 2311, 29922, 1311, 29889, 1003, 2311, 29897, 13, 9651, 565, 4464, 1275, 525, 5451, 2396, 13, 18884, 363, 474, 297, 3464, 29898, 1311, 29889, 29876, 29918, 510, 1595, 1860, 1125, 13, 462, 1678, 3858, 353, 525, 6571, 9016, 8875, 4286, 4830, 29898, 1311, 3032, 29891, 4914, 29892, 474, 29974, 29896, 29897, 13, 462, 1678, 995, 29918, 12676, 353, 6492, 1272, 1839, 12676, 29915, 718, 3858, 29962, 13, 462, 1678, 995, 29918, 303, 29892, 995, 29918, 287, 353, 1583, 29889, 28667, 29918, 264, 21367, 29898, 1643, 29892, 427, 21367, 29897, 13, 462, 1678, 4853, 29889, 5589, 29918, 14811, 29898, 1311, 3032, 29916, 1272, 29892, 995, 29918, 303, 29892, 995, 29918, 287, 29892, 13, 462, 462, 1678, 3700, 2780, 29922, 1311, 29889, 27703, 29961, 29875, 1402, 15595, 29922, 29900, 29889, 29945, 29897, 13, 462, 1678, 4853, 29889, 5317, 29898, 1311, 3032, 29916, 1272, 29892, 995, 29918, 12676, 29892, 17411, 742, 2927, 29922, 1311, 29889, 27703, 29961, 29875, 1402, 1196, 2103, 29922, 29906, 29897, 13, 9651, 25342, 4464, 1275, 525, 497, 2396, 13, 18884, 3858, 353, 525, 6571, 599, 4286, 4830, 29898, 1311, 3032, 29891, 4914, 29897, 13, 18884, 995, 29918, 12676, 353, 6492, 1272, 1839, 12676, 29915, 718, 3858, 29962, 13, 18884, 995, 29918, 303, 29892, 995, 29918, 287, 353, 1583, 29889, 28667, 29918, 264, 21367, 29898, 1643, 29892, 427, 21367, 29897, 13, 18884, 4853, 29889, 5589, 29918, 14811, 29898, 1311, 3032, 29916, 1272, 29892, 995, 29918, 303, 29892, 995, 29918, 287, 29892, 13, 462, 18884, 3700, 2780, 2433, 29890, 742, 15595, 29922, 29900, 29889, 29945, 29897, 13, 18884, 4853, 29889, 5317, 29898, 1311, 3032, 29916, 1272, 29892, 995, 29918, 12676, 29892, 17411, 742, 2927, 2433, 29890, 742, 1196, 2103, 29922, 29906, 29897, 13, 9651, 1683, 29901, 13, 18884, 12020, 7865, 2392, 877, 14148, 4464, 6571, 4286, 4830, 29898, 8513, 876, 13, 9651, 565, 921, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29889, 842, 29918, 29916, 1643, 29898, 29916, 1643, 29897, 13, 9651, 565, 343, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29889, 842, 29918, 29891, 1643, 29898, 29891, 1643, 29897, 13, 9651, 3114, 29889, 4294, 29898, 449, 1445, 29922, 449, 1445, 29892, 2537, 29922, 1003, 29897, 13, 13, 1678, 822, 6492, 29918, 2168, 713, 29918, 3018, 4684, 29898, 1311, 29892, 714, 1445, 29922, 8516, 29892, 921, 1643, 29922, 8516, 29892, 343, 1643, 29922, 8516, 29892, 427, 21367, 2433, 29875, 29939, 29878, 742, 4464, 2433, 5451, 29374, 13, 4706, 9995, 3436, 713, 322, 29871, 29906, 29945, 29914, 29955, 29945, 29995, 427, 21367, 9995, 13, 13, 4706, 6492, 1272, 353, 1583, 3032, 5317, 1272, 13, 13, 4706, 411, 731, 29918, 5317, 29918, 3293, 29898, 1311, 29889, 5317, 29918, 3293, 29897, 408, 3114, 29901, 13, 9651, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 29898, 29896, 29892, 29871, 29896, 29892, 2537, 2311, 29922, 1311, 29889, 1003, 2311, 29897, 13, 9651, 565, 4464, 1275, 525, 5451, 2396, 13, 18884, 363, 474, 297, 3464, 29898, 1311, 29889, 29876, 29918, 510, 1595, 1860, 1125, 13, 462, 1678, 3858, 353, 525, 6571, 9016, 8875, 4286, 4830, 29898, 1311, 3032, 29891, 4914, 29892, 474, 29974, 29896, 29897, 13, 462, 1678, 995, 29918, 6563, 353, 6492, 1272, 1839, 29886, 29945, 29900, 29915, 718, 3858, 29962, 13, 462, 1678, 995, 29918, 303, 29892, 995, 29918, 287, 353, 1583, 29889, 28667, 29918, 264, 21367, 29898, 1643, 29892, 427, 21367, 29897, 13, 462, 1678, 4853, 29889, 5589, 29918, 14811, 29898, 1311, 3032, 29916, 1272, 29892, 995, 29918, 303, 29892, 995, 29918, 287, 29892, 13, 462, 462, 1678, 3700, 2780, 29922, 1311, 29889, 27703, 29961, 29875, 1402, 15595, 29922, 29900, 29889, 29945, 29897, 13, 462, 1678, 4853, 29889, 5317, 29898, 1311, 3032, 29916, 1272, 29892, 995, 29918, 6563, 29892, 17411, 742, 2927, 29922, 1311, 29889, 27703, 29961, 29875, 1402, 1196, 2103, 29922, 29906, 29897, 13, 9651, 25342, 4464, 1275, 525, 497, 2396, 13, 18884, 3858, 353, 525, 6571, 599, 4286, 4830, 29898, 1311, 3032, 29891, 4914, 29897, 13, 18884, 995, 29918, 12676, 353, 6492, 1272, 1839, 29886, 29945, 29900, 29915, 718, 3858, 29962, 13, 18884, 995, 29918, 303, 29892, 995, 29918, 287, 353, 1583, 29889, 28667, 29918, 264, 21367, 29898, 1643, 29892, 427, 21367, 29897, 13, 18884, 4853, 29889, 5589, 29918, 14811, 29898, 1311, 3032, 29916, 1272, 29892, 995, 29918, 303, 29892, 995, 29918, 287, 29892, 13, 462, 18884, 3700, 2780, 2433, 29890, 742, 15595, 29922, 29900, 29889, 29945, 29897, 13, 18884, 4853, 29889, 5317, 29898, 1311, 3032, 29916, 1272, 29892, 995, 29918, 12676, 29892, 17411, 742, 2927, 2433, 29890, 742, 1196, 2103, 29922, 29906, 29897, 13, 9651, 1683, 29901, 13, 18884, 12020, 7865, 2392, 877, 14148, 4464, 6571, 4286, 4830, 29898, 8513, 876, 13, 13, 9651, 565, 921, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29889, 842, 29918, 29916, 1643, 29898, 29916, 1643, 29897, 13, 9651, 565, 343, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29889, 842, 29918, 29891, 1643, 29898, 29891, 1643, 29897, 13, 9651, 3114, 29889, 4294, 29898, 449, 1445, 29922, 449, 1445, 29892, 2537, 29922, 1003, 29897, 13, 13, 1678, 822, 6492, 29918, 11294, 29918, 5924, 29898, 1311, 29892, 714, 1445, 29922, 8516, 29892, 921, 1643, 29922, 8516, 29892, 343, 1643, 29922, 8516, 1125, 13, 4706, 9995, 18399, 920, 1784, 16257, 526, 297, 263, 2183, 9016, 472, 263, 2183, 931, 9995, 13, 4706, 6492, 1272, 353, 1583, 3032, 5317, 1272, 13, 13, 4706, 411, 731, 29918, 5317, 29918, 3293, 29898, 1311, 29889, 5317, 29918, 3293, 29897, 408, 3114, 29901, 13, 9651, 2537, 29918, 29916, 29892, 2537, 29918, 29891, 353, 1583, 29889, 1003, 2311, 13, 9651, 2537, 29892, 313, 1165, 29896, 29892, 4853, 29906, 29897, 353, 14770, 29889, 1491, 26762, 29898, 29896, 29892, 29871, 29906, 29892, 2537, 2311, 7607, 1003, 29918, 29916, 29930, 29906, 29892, 2537, 29918, 29891, 876, 13, 9651, 4853, 29896, 29889, 5317, 29898, 1311, 3032, 29916, 1272, 29892, 1583, 3032, 7827, 29918, 2798, 29892, 17411, 29895, 742, 1196, 2103, 29922, 29906, 29897, 13, 9651, 4853, 29906, 29889, 4415, 1475, 4197, 29896, 29900, 29900, 1402, 7442, 29889, 1195, 29898, 1311, 3032, 29916, 1272, 511, 7442, 29889, 3317, 29898, 1311, 3032, 29916, 1272, 511, 11955, 29922, 1839, 29895, 7464, 1196, 2103, 29922, 29906, 29897, 13, 13, 9651, 363, 474, 297, 3464, 29898, 1311, 29889, 29876, 29918, 510, 1595, 1860, 1125, 13, 18884, 3858, 353, 525, 6571, 9016, 8875, 4286, 4830, 29898, 1311, 3032, 29891, 4914, 29892, 474, 29974, 29896, 29897, 13, 18884, 2302, 353, 6492, 1272, 1839, 2798, 29915, 718, 3858, 29962, 13, 18884, 2304, 353, 6492, 1272, 1839, 5924, 29915, 718, 3858, 29962, 13, 18884, 4853, 29896, 29889, 5317, 29898, 1311, 3032, 29916, 1272, 29892, 2302, 29892, 17411, 742, 2927, 29922, 1311, 29889, 27703, 29961, 29875, 1402, 1196, 2103, 29922, 29906, 29897, 13, 18884, 4853, 29906, 29889, 5317, 29898, 1311, 3032, 29916, 1272, 29892, 2304, 29930, 29896, 29900, 29900, 29892, 17411, 742, 2927, 29922, 1311, 29889, 27703, 29961, 29875, 1402, 1196, 2103, 29922, 29906, 29897, 13, 9651, 565, 921, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29896, 29889, 842, 29918, 29916, 1643, 29898, 29916, 1643, 29897, 13, 18884, 4853, 29906, 29889, 842, 29918, 29916, 1643, 29898, 29916, 1643, 29897, 13, 9651, 4853, 29896, 29889, 842, 29918, 29891, 1643, 877, 8009, 3201, 4684, 1495, 13, 9651, 4853, 29906, 29889, 842, 29918, 29891, 1643, 877, 27933, 14990, 3201, 4684, 1495, 13, 9651, 4853, 29896, 29889, 842, 29918, 29891, 2576, 4197, 29900, 29892, 7442, 29889, 3317, 29898, 1311, 3032, 7827, 29918, 2798, 11877, 29896, 29889, 29900, 29906, 2314, 13, 9651, 4853, 29906, 29889, 842, 29918, 29891, 2576, 4197, 29900, 29892, 29871, 29896, 29900, 29906, 2314, 13, 9651, 3114, 29889, 4294, 29898, 449, 1445, 29922, 449, 1445, 29892, 2537, 29922, 1003, 29897, 13, 13, 1678, 822, 6492, 29918, 5721, 29918, 29882, 391, 13342, 29898, 1311, 29892, 1819, 29892, 714, 1445, 29922, 8516, 29892, 921, 1643, 29922, 8516, 29892, 343, 1643, 29922, 8516, 1125, 13, 4706, 9995, 18399, 988, 373, 278, 9825, 13342, 1269, 995, 10008, 13, 13, 4706, 584, 3207, 29871, 299, 2378, 1819, 29901, 13, 9651, 450, 1819, 304, 5706, 263, 9825, 13342, 363, 13, 4706, 584, 3207, 10802, 714, 1445, 29901, 13, 9651, 960, 451, 6213, 29892, 278, 2224, 304, 4078, 278, 6492, 304, 13, 4706, 9995, 13, 4706, 396, 15179, 13342, 278, 4978, 322, 607, 29078, 1860, 526, 1641, 301, 24025, 13, 4706, 17117, 17117, 8466, 29918, 29916, 29892, 8466, 29918, 29891, 353, 679, 29918, 29882, 391, 13342, 29898, 5975, 29892, 289, 1144, 29922, 29896, 29900, 29892, 8466, 29918, 3844, 29877, 6046, 29922, 5574, 29897, 13, 4706, 29078, 358, 29918, 5975, 353, 518, 5975, 29961, 513, 1575, 29962, 363, 16285, 297, 1583, 3032, 2109, 29918, 513, 1575, 29962, 13, 13, 4706, 1320, 1272, 353, 426, 13, 9651, 525, 510, 8076, 2396, 19997, 13, 9651, 525, 1767, 2396, 19997, 13, 9651, 525, 21518, 537, 2396, 19997, 13, 4706, 500, 13, 13, 4706, 396, 2567, 29892, 6492, 1269, 29078, 358, 373, 278, 3001, 9825, 13342, 13, 4706, 411, 731, 29918, 5317, 29918, 3293, 29898, 1311, 29889, 5317, 29918, 3293, 29897, 408, 3114, 29901, 13, 9651, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 29898, 29896, 29892, 29871, 29896, 29892, 2537, 2311, 29922, 1311, 29889, 1003, 2311, 29897, 13, 9651, 4853, 29889, 5317, 29898, 17460, 29918, 29916, 29892, 8466, 29918, 29891, 29892, 17411, 742, 2927, 2433, 21012, 1495, 13, 9651, 1320, 1272, 1839, 510, 8076, 13359, 21843, 29898, 29900, 363, 903, 297, 8466, 29918, 29916, 29897, 13, 9651, 1320, 1272, 1839, 1767, 13359, 21843, 29898, 17460, 29918, 29916, 29897, 13, 9651, 1320, 1272, 1839, 21518, 537, 13359, 21843, 29898, 17460, 29918, 29891, 29897, 13, 9651, 363, 474, 29892, 29078, 358, 29918, 1767, 297, 26985, 29898, 510, 8076, 29918, 5975, 1125, 13, 18884, 29078, 358, 29918, 1195, 353, 7442, 29889, 1195, 29898, 510, 8076, 29918, 1767, 29897, 13, 18884, 29078, 358, 29918, 3317, 353, 7442, 29889, 3317, 29898, 510, 8076, 29918, 1767, 29897, 13, 18884, 8466, 29918, 13168, 353, 7442, 29889, 1188, 936, 29918, 392, 29898, 17460, 29918, 29916, 6736, 29078, 358, 29918, 1195, 29892, 13, 462, 462, 632, 8466, 29918, 29916, 5277, 29078, 358, 29918, 3317, 29897, 13, 13, 18884, 29078, 358, 29918, 29916, 353, 8466, 29918, 29916, 29961, 17460, 29918, 13168, 29962, 13, 18884, 29078, 358, 29918, 29891, 353, 8466, 29918, 29891, 29961, 17460, 29918, 13168, 29962, 13, 18884, 1320, 1272, 1839, 510, 8076, 13359, 21843, 29898, 29875, 29974, 29896, 363, 903, 297, 29078, 358, 29918, 29916, 29897, 13, 18884, 1320, 1272, 1839, 1767, 13359, 21843, 29898, 510, 8076, 29918, 29916, 29897, 13, 18884, 1320, 1272, 1839, 21518, 537, 13359, 21843, 29898, 510, 8076, 29918, 29891, 29897, 13, 13, 18884, 4853, 29889, 5589, 29918, 14811, 29898, 510, 8076, 29918, 29916, 29892, 29871, 29900, 29892, 29078, 358, 29918, 29891, 29892, 13, 462, 18884, 3700, 2780, 29922, 1311, 29889, 27703, 29961, 29875, 1402, 15595, 29922, 29900, 29889, 29945, 29897, 13, 18884, 4853, 29889, 5317, 29898, 510, 8076, 29918, 29916, 29892, 29078, 358, 29918, 29891, 29892, 17411, 742, 13, 462, 4706, 2927, 29922, 1311, 29889, 27703, 29961, 29875, 1402, 1196, 2103, 29922, 29906, 29897, 13, 9651, 565, 921, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29889, 842, 29918, 29916, 1643, 29898, 29916, 1643, 29897, 13, 9651, 565, 343, 1643, 338, 451, 6213, 29901, 13, 18884, 4853, 29889, 842, 29918, 29891, 1643, 29898, 29891, 1643, 29897, 13, 9651, 3114, 29889, 4294, 29898, 449, 1445, 29922, 449, 1445, 29892, 2537, 29922, 1003, 29897, 13, 4706, 1583, 3032, 5721, 1272, 353, 1320, 1272, 13, 13, 1678, 822, 4078, 29918, 5317, 1272, 29898, 1311, 29892, 714, 1445, 29892, 25557, 2433, 29889, 7638, 29374, 13, 4706, 9995, 16913, 278, 6492, 848, 9995, 13, 4706, 565, 1583, 3032, 5317, 1272, 338, 6213, 29901, 13, 9651, 12020, 7865, 2392, 877, 3782, 4978, 848, 29892, 1246, 6219, 29918, 510, 20941, 937, 1495, 13, 13, 4706, 714, 1445, 353, 714, 1445, 29889, 3560, 847, 313, 449, 1445, 29889, 303, 331, 718, 25557, 29897, 13, 4706, 1596, 877, 29956, 768, 292, 4978, 848, 304, 6571, 4286, 4830, 29898, 449, 1445, 876, 13, 4706, 6492, 1272, 353, 10518, 29889, 17271, 29898, 1311, 3032, 5317, 1272, 29897, 13, 13, 4706, 565, 25557, 1275, 15300, 7638, 2396, 13, 9651, 6492, 1272, 29889, 517, 29918, 7638, 29898, 710, 29898, 449, 1445, 511, 4839, 29922, 5574, 29892, 2380, 29922, 8824, 29897, 13, 4706, 25342, 25557, 1275, 15300, 20267, 29916, 2396, 13, 9651, 6492, 1272, 29889, 517, 29918, 24633, 29898, 710, 29898, 449, 1445, 511, 4839, 29922, 5574, 29892, 2380, 29922, 8824, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 7670, 2392, 877, 14148, 6492, 848, 1962, 934, 1134, 29901, 6571, 4286, 4830, 29898, 449, 1445, 876, 13, 13, 1678, 822, 4078, 29918, 5721, 1272, 29898, 1311, 29892, 714, 1445, 29892, 25557, 2433, 29889, 7638, 29374, 13, 4706, 9995, 16913, 278, 4978, 848, 9995, 13, 4706, 565, 1583, 3032, 5721, 1272, 338, 6213, 29901, 13, 9651, 12020, 7865, 2392, 877, 3782, 4978, 848, 29892, 1246, 6492, 29918, 5721, 29918, 29882, 391, 13342, 937, 1495, 13, 13, 4706, 714, 1445, 353, 714, 1445, 29889, 3560, 847, 313, 449, 1445, 29889, 303, 331, 718, 25557, 29897, 13, 4706, 1596, 877, 29956, 768, 292, 4978, 848, 304, 6571, 4286, 4830, 29898, 449, 1445, 876, 13, 4706, 1320, 1272, 353, 10518, 29889, 17271, 29898, 1311, 3032, 5721, 1272, 29897, 13, 13, 4706, 565, 25557, 1275, 15300, 7638, 2396, 13, 9651, 1320, 1272, 29889, 517, 29918, 7638, 29898, 710, 29898, 449, 1445, 511, 4839, 29922, 5574, 29892, 2380, 29922, 8824, 29897, 13, 4706, 25342, 25557, 1275, 15300, 20267, 29916, 2396, 13, 9651, 1320, 1272, 29889, 517, 29918, 24633, 29898, 710, 29898, 449, 1445, 511, 4839, 29922, 5574, 29892, 2380, 29922, 8824, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 7670, 2392, 877, 14148, 1320, 848, 1962, 934, 1134, 29901, 6571, 4286, 4830, 29898, 449, 1445, 876, 13, 2 ]
process/LanesFrom2D.py
sameeptandon/sail-car-log
1
180021
<reponame>sameeptandon/sail-car-log<filename>process/LanesFrom2D.py<gh_stars>1-10 import bisect import cv2 import glob import numpy as np import sys from ArgParser import parse_args from GPSReader import GPSReader from GPSTransforms import IMUTransforms, absoluteTransforms from LaneMarkingHelper import get_transforms, mk2_to_mk1, BackProjector from LidarTransforms import R_to_c_from_l, utc_from_gps_log_all from VideoReader import VideoReader class ImageClicker(object): def __init__(self): args = parse_args(sys.argv[1], sys.argv[2]) planar = glob.glob(sys.argv[1] + '/*_planar.npz')[0] npz = np.load(planar) self.planes = npz['planes'] (self.imu_transforms_mk1, self.gps_data_mk1, self.gps_times_mk1) = get_transforms(args, 'mark1') (self.imu_transforms_mk2, self.gps_data_mk2, self.gps_times_mk2) = get_transforms(args, 'mark2') self.back_projector = BackProjector(args) self.vr = VideoReader(args['video']) self.t = 1 cv2.namedWindow('image', cv2.WINDOW_AUTOSIZE) cv2.setMouseCallback('image', self.mouseHandler) self.lanes = None self.markings = None def mouseHandler(self, event, x, y, flags, param): if event == cv2.EVENT_LBUTTONUP: if self.markings == None: self.markings = np.array([x, y])[np.newaxis] else: self.markings = np.vstack([self.markings, [x, y]]) pix = np.array([x, y, 1]) mk1_t = mk2_to_mk1(self.t, self.gps_times_mk1, self.gps_times_mk2) xform = self.imu_transforms_mk1[mk1_t] v = self.back_projector.calculateBackProjection(xform, pix) l0 = self.back_projector.calculateBackProjection(xform) l = l0 - v best_model = (np.inf, 0, 0) for i, plane in enumerate(self.planes): pt = self.back_projector.calculateIntersection(l0, l, plane) d = np.linalg.norm(pt - plane[3:]) if d < best_model[0]: best_model = (d, i, pt) print best_model[-1] if self.lanes == None: self.lanes = best_model[-1] else: self.lanes = np.vstack((self.lanes, best_model[-1])) def exportData(self, file_name): lanes = {} lanes['lane0'] = self.lanes print 'saved:' print self.lanes np.savez(file_name, **lanes) def nextFrame(self): while True: while self.vr.framenum < self.t: success, I = self.vr.getNextFrame() if self.markings != None: x = self.markings[:, 0] y = self.markings[:, 1] for i in xrange(4): I[y+i, x, :] = np.array([255, 255, 0]) I[y-i, x, :] = np.array([255, 255, 0]) I[y, x+i, :] = np.array([255, 255, 0]) I[y, x-i, :] = np.array([255, 255, 0]) cv2.imshow('image', I) key = cv2.waitKey(1) & 0xFF if key != 255: print key if key == 27: # esc return if key == 115: # s self.exportData(sys.argv[1] + '/multilane_points_image.npz') elif key == 32: # space self.t += 20 self.markings = None if __name__ == '__main__': ic = ImageClicker() ic.nextFrame()
[ 1, 529, 276, 1112, 420, 29958, 17642, 29872, 415, 9214, 29914, 29879, 737, 29899, 4287, 29899, 1188, 29966, 9507, 29958, 5014, 29914, 29931, 17297, 4591, 29906, 29928, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 2652, 522, 13, 5215, 13850, 29906, 13, 5215, 13149, 13, 5215, 12655, 408, 7442, 13, 5215, 10876, 13, 13, 3166, 11842, 11726, 1053, 6088, 29918, 5085, 13, 3166, 402, 7024, 6982, 1053, 402, 7024, 6982, 13, 3166, 28258, 1254, 29878, 550, 9514, 1053, 22313, 29965, 4300, 9514, 29892, 8380, 4300, 9514, 13, 3166, 23841, 9802, 292, 10739, 1053, 679, 29918, 9067, 29879, 29892, 14690, 29906, 29918, 517, 29918, 11256, 29896, 29892, 7437, 7653, 272, 13, 3166, 365, 333, 279, 4300, 9514, 1053, 390, 29918, 517, 29918, 29883, 29918, 3166, 29918, 29880, 29892, 3477, 29883, 29918, 3166, 29918, 29887, 567, 29918, 1188, 29918, 497, 13, 3166, 13987, 6982, 1053, 13987, 6982, 13, 13, 1990, 7084, 4164, 261, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 6389, 353, 6088, 29918, 5085, 29898, 9675, 29889, 19218, 29961, 29896, 1402, 10876, 29889, 19218, 29961, 29906, 2314, 13, 13, 4706, 3814, 279, 353, 13149, 29889, 23705, 29898, 9675, 29889, 19218, 29961, 29896, 29962, 718, 525, 5515, 29918, 9018, 279, 29889, 9302, 29920, 29861, 29900, 29962, 13, 4706, 7442, 29920, 353, 7442, 29889, 1359, 29898, 9018, 279, 29897, 13, 4706, 1583, 29889, 9018, 267, 353, 7442, 29920, 1839, 9018, 267, 2033, 13, 13, 4706, 313, 1311, 29889, 326, 29884, 29918, 9067, 29879, 29918, 11256, 29896, 29892, 13, 308, 1583, 29889, 29887, 567, 29918, 1272, 29918, 11256, 29896, 29892, 13, 308, 1583, 29889, 29887, 567, 29918, 3706, 29918, 11256, 29896, 29897, 353, 679, 29918, 9067, 29879, 29898, 5085, 29892, 525, 3502, 29896, 1495, 13, 13, 4706, 313, 1311, 29889, 326, 29884, 29918, 9067, 29879, 29918, 11256, 29906, 29892, 13, 308, 1583, 29889, 29887, 567, 29918, 1272, 29918, 11256, 29906, 29892, 13, 308, 1583, 29889, 29887, 567, 29918, 3706, 29918, 11256, 29906, 29897, 353, 679, 29918, 9067, 29879, 29898, 5085, 29892, 525, 3502, 29906, 1495, 13, 13, 4706, 1583, 29889, 1627, 29918, 4836, 272, 353, 7437, 7653, 272, 29898, 5085, 29897, 13, 4706, 1583, 29889, 13416, 353, 13987, 6982, 29898, 5085, 1839, 9641, 11287, 13, 13, 4706, 1583, 29889, 29873, 353, 29871, 29896, 13, 4706, 13850, 29906, 29889, 17514, 5907, 877, 3027, 742, 13850, 29906, 29889, 25152, 3970, 29956, 29918, 20656, 3267, 29902, 10721, 29897, 13, 4706, 13850, 29906, 29889, 842, 14346, 10717, 877, 3027, 742, 1583, 29889, 15769, 4598, 29897, 13, 13, 4706, 1583, 29889, 6468, 267, 353, 6213, 13, 4706, 1583, 29889, 3502, 886, 353, 6213, 13, 13, 1678, 822, 9495, 4598, 29898, 1311, 29892, 1741, 29892, 921, 29892, 343, 29892, 13449, 29892, 1828, 1125, 13, 4706, 565, 1741, 1275, 13850, 29906, 29889, 22240, 3919, 29918, 29931, 29933, 2692, 29911, 1164, 4897, 29901, 13, 13, 9651, 565, 1583, 29889, 3502, 886, 1275, 6213, 29901, 13, 18884, 1583, 29889, 3502, 886, 353, 7442, 29889, 2378, 4197, 29916, 29892, 343, 2314, 29961, 9302, 29889, 1482, 8990, 29962, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 3502, 886, 353, 7442, 29889, 29894, 1429, 4197, 1311, 29889, 3502, 886, 29892, 518, 29916, 29892, 343, 24960, 13, 13, 9651, 9277, 353, 7442, 29889, 2378, 4197, 29916, 29892, 343, 29892, 29871, 29896, 2314, 13, 9651, 14690, 29896, 29918, 29873, 353, 14690, 29906, 29918, 517, 29918, 11256, 29896, 29898, 1311, 29889, 29873, 29892, 1583, 29889, 29887, 567, 29918, 3706, 29918, 11256, 29896, 29892, 1583, 29889, 29887, 567, 29918, 3706, 29918, 11256, 29906, 29897, 13, 13, 9651, 921, 689, 353, 1583, 29889, 326, 29884, 29918, 9067, 29879, 29918, 11256, 29896, 29961, 11256, 29896, 29918, 29873, 29962, 13, 13, 9651, 325, 353, 1583, 29889, 1627, 29918, 4836, 272, 29889, 15807, 403, 5841, 1184, 6929, 29898, 29916, 689, 29892, 9277, 29897, 13, 9651, 301, 29900, 353, 1583, 29889, 1627, 29918, 4836, 272, 29889, 15807, 403, 5841, 1184, 6929, 29898, 29916, 689, 29897, 13, 13, 9651, 301, 353, 301, 29900, 448, 325, 13, 13, 9651, 1900, 29918, 4299, 353, 313, 9302, 29889, 7192, 29892, 29871, 29900, 29892, 29871, 29900, 29897, 13, 9651, 363, 474, 29892, 10694, 297, 26985, 29898, 1311, 29889, 9018, 267, 1125, 13, 18884, 19592, 353, 1583, 29889, 1627, 29918, 4836, 272, 29889, 15807, 403, 4074, 2042, 29898, 29880, 29900, 29892, 301, 29892, 13, 462, 462, 462, 1669, 10694, 29897, 13, 18884, 270, 353, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 415, 448, 10694, 29961, 29941, 29901, 2314, 13, 18884, 565, 270, 529, 1900, 29918, 4299, 29961, 29900, 5387, 13, 462, 1678, 1900, 29918, 4299, 353, 313, 29881, 29892, 474, 29892, 19592, 29897, 13, 13, 9651, 1596, 1900, 29918, 4299, 14352, 29896, 29962, 13, 9651, 565, 1583, 29889, 6468, 267, 1275, 6213, 29901, 13, 18884, 1583, 29889, 6468, 267, 353, 1900, 29918, 4299, 14352, 29896, 29962, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 6468, 267, 353, 7442, 29889, 29894, 1429, 3552, 1311, 29889, 6468, 267, 29892, 1900, 29918, 4299, 14352, 29896, 12622, 13, 13, 1678, 822, 5609, 1469, 29898, 1311, 29892, 934, 29918, 978, 1125, 13, 4706, 10906, 267, 353, 6571, 13, 4706, 10906, 267, 1839, 25821, 29900, 2033, 353, 1583, 29889, 6468, 267, 13, 13, 4706, 1596, 525, 17314, 11283, 13, 4706, 1596, 1583, 29889, 6468, 267, 13, 4706, 7442, 29889, 7620, 29920, 29898, 1445, 29918, 978, 29892, 3579, 6468, 267, 29897, 13, 13, 1678, 822, 2446, 4308, 29898, 1311, 1125, 13, 4706, 1550, 5852, 29901, 13, 9651, 1550, 1583, 29889, 13416, 29889, 1341, 5071, 398, 529, 1583, 29889, 29873, 29901, 13, 18884, 2551, 29892, 306, 353, 1583, 29889, 13416, 29889, 657, 9190, 4308, 580, 13, 13, 9651, 565, 1583, 29889, 3502, 886, 2804, 6213, 29901, 13, 18884, 921, 353, 1583, 29889, 3502, 886, 7503, 29892, 29871, 29900, 29962, 13, 18884, 343, 353, 1583, 29889, 3502, 886, 7503, 29892, 29871, 29896, 29962, 13, 18884, 363, 474, 297, 921, 3881, 29898, 29946, 1125, 13, 462, 1678, 306, 29961, 29891, 29974, 29875, 29892, 921, 29892, 584, 29962, 353, 7442, 29889, 2378, 4197, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 2314, 13, 462, 1678, 306, 29961, 29891, 29899, 29875, 29892, 921, 29892, 584, 29962, 353, 7442, 29889, 2378, 4197, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 2314, 13, 462, 1678, 306, 29961, 29891, 29892, 921, 29974, 29875, 29892, 584, 29962, 353, 7442, 29889, 2378, 4197, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 2314, 13, 462, 1678, 306, 29961, 29891, 29892, 921, 29899, 29875, 29892, 584, 29962, 353, 7442, 29889, 2378, 4197, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 2314, 13, 13, 9651, 13850, 29906, 29889, 326, 4294, 877, 3027, 742, 306, 29897, 13, 9651, 1820, 353, 13850, 29906, 29889, 10685, 2558, 29898, 29896, 29897, 669, 29871, 29900, 29916, 4198, 13, 13, 9651, 565, 1820, 2804, 29871, 29906, 29945, 29945, 29901, 13, 18884, 1596, 1820, 13, 18884, 565, 1820, 1275, 29871, 29906, 29955, 29901, 259, 396, 3966, 13, 462, 1678, 736, 13, 18884, 565, 1820, 1275, 29871, 29896, 29896, 29945, 29901, 29871, 396, 269, 13, 462, 1678, 1583, 29889, 15843, 1469, 29898, 9675, 29889, 19218, 29961, 29896, 29962, 718, 8207, 4713, 309, 1662, 29918, 9748, 29918, 3027, 29889, 9302, 29920, 1495, 13, 18884, 25342, 1820, 1275, 29871, 29941, 29906, 29901, 396, 2913, 13, 462, 1678, 1583, 29889, 29873, 4619, 29871, 29906, 29900, 13, 462, 1678, 1583, 29889, 3502, 886, 353, 6213, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 16077, 353, 7084, 4164, 261, 580, 13, 1678, 16077, 29889, 4622, 4308, 580, 13, 2 ]
AMIS-30543 Example.py
capella-ben/microPython_AMIS-30543
0
173495
# Wiring: # Pico - AMIS-30543 # SPIO-RX - DO (4.7K pullup) # SPIO-TX - DI # SPIO-CSK - CLK # 5 - CS # 15 - NXT # Ground - GND # # Also connect the motor power and the stepper driver. from machine import Pin import time from AMIS30543 import AMIS30543 stepPin = 15 csPin = 5 myDriver = AMIS30543(csPin, stepPin) myDriver.resetSettings() myDriver.setCurrentMilliamps(myDriver.idleCurrent) myDriver.setStepMode(myDriver.MicroStep4) myDriver.enableDriver() print("poistion:", myDriver.readPosition()) if myDriver.readThermalWarning(): print("Driver too hot!") else: print("Driver cool as a cucumber") for i in range(1): print("Iteration:", i) myDriver.moveStepsAcc(200 * 4 * 1, 1000, 30, False, 1000) myDriver.moveStepsAcc(200 * 4 * 5, 6000, 30, True, 1000) myDriver.moveStepsAcc(200 * 4 * 2, 2000, 30, False, 1000) myDriver.moveStepsAcc(200, 5000, 30, True, 800) myDriver.moveStepsAcc(300, 5000, 30, False, 800) myDriver.moveStepsAcc(400, 5000, 30, True, 800) myDriver.moveStepsAcc(500, 5000, 30, False, 800) time.sleep_ms(200) print() myDriver.disableDriver()
[ 1, 396, 399, 8491, 29901, 13, 29937, 349, 1417, 418, 448, 1678, 13862, 3235, 29899, 29941, 29900, 29945, 29946, 29941, 13, 29937, 317, 2227, 29949, 29899, 29934, 29990, 259, 448, 1678, 11662, 268, 313, 29946, 29889, 29955, 29968, 8206, 786, 29897, 13, 29937, 317, 2227, 29949, 29899, 28627, 259, 448, 1678, 22471, 13, 29937, 317, 2227, 29949, 29899, 9295, 29968, 29871, 448, 1678, 17332, 29968, 13, 29937, 29871, 29945, 308, 448, 1678, 21107, 13, 29937, 29871, 29896, 29945, 4706, 448, 1678, 405, 12188, 13, 29937, 1632, 618, 1678, 448, 1678, 10453, 13, 29937, 29871, 13, 29937, 3115, 4511, 278, 10992, 3081, 322, 278, 1886, 2496, 7156, 29889, 13, 13, 13, 3166, 4933, 1053, 17434, 13, 5215, 931, 13, 3166, 13862, 3235, 29941, 29900, 29945, 29946, 29941, 1053, 13862, 3235, 29941, 29900, 29945, 29946, 29941, 13, 13, 13, 10568, 29925, 262, 353, 29871, 29896, 29945, 13, 2395, 29925, 262, 353, 29871, 29945, 13, 13, 13, 13, 1357, 12376, 353, 13862, 3235, 29941, 29900, 29945, 29946, 29941, 29898, 2395, 29925, 262, 29892, 4331, 29925, 262, 29897, 13, 1357, 12376, 29889, 12071, 9585, 580, 13, 1357, 12376, 29889, 842, 7583, 19169, 2829, 567, 29898, 1357, 12376, 29889, 333, 280, 7583, 29897, 13, 1357, 12376, 29889, 842, 14448, 6818, 29898, 1357, 12376, 29889, 29924, 2357, 14448, 29946, 29897, 13, 1357, 12376, 29889, 12007, 12376, 580, 13, 13, 2158, 703, 1129, 391, 291, 29901, 613, 590, 12376, 29889, 949, 8003, 3101, 13, 13, 361, 590, 12376, 29889, 949, 1349, 837, 284, 22709, 7295, 13, 1678, 1596, 703, 12376, 2086, 7375, 29991, 1159, 13, 2870, 29901, 13, 1678, 1596, 703, 12376, 12528, 408, 263, 274, 1682, 2807, 1159, 13, 13, 13, 1454, 474, 297, 3464, 29898, 29896, 1125, 13, 1678, 1596, 703, 13463, 362, 29901, 613, 474, 29897, 13, 1678, 590, 12376, 29889, 11631, 7789, 567, 7504, 29898, 29906, 29900, 29900, 334, 29871, 29946, 334, 29871, 29896, 29892, 29871, 29896, 29900, 29900, 29900, 29892, 29871, 29941, 29900, 29892, 7700, 29892, 29871, 29896, 29900, 29900, 29900, 29897, 13, 1678, 590, 12376, 29889, 11631, 7789, 567, 7504, 29898, 29906, 29900, 29900, 334, 29871, 29946, 334, 29871, 29945, 29892, 29871, 29953, 29900, 29900, 29900, 29892, 29871, 29941, 29900, 29892, 5852, 29892, 29871, 29896, 29900, 29900, 29900, 29897, 13, 1678, 590, 12376, 29889, 11631, 7789, 567, 7504, 29898, 29906, 29900, 29900, 334, 29871, 29946, 334, 29871, 29906, 29892, 29871, 29906, 29900, 29900, 29900, 29892, 29871, 29941, 29900, 29892, 7700, 29892, 29871, 29896, 29900, 29900, 29900, 29897, 13, 1678, 590, 12376, 29889, 11631, 7789, 567, 7504, 29898, 29906, 29900, 29900, 29892, 29871, 29945, 29900, 29900, 29900, 29892, 29871, 29941, 29900, 29892, 5852, 29892, 29871, 29947, 29900, 29900, 29897, 13, 1678, 590, 12376, 29889, 11631, 7789, 567, 7504, 29898, 29941, 29900, 29900, 29892, 29871, 29945, 29900, 29900, 29900, 29892, 29871, 29941, 29900, 29892, 7700, 29892, 29871, 29947, 29900, 29900, 29897, 13, 1678, 590, 12376, 29889, 11631, 7789, 567, 7504, 29898, 29946, 29900, 29900, 29892, 29871, 29945, 29900, 29900, 29900, 29892, 29871, 29941, 29900, 29892, 5852, 29892, 29871, 29947, 29900, 29900, 29897, 13, 1678, 590, 12376, 29889, 11631, 7789, 567, 7504, 29898, 29945, 29900, 29900, 29892, 29871, 29945, 29900, 29900, 29900, 29892, 29871, 29941, 29900, 29892, 7700, 29892, 29871, 29947, 29900, 29900, 29897, 13, 1678, 931, 29889, 17059, 29918, 1516, 29898, 29906, 29900, 29900, 29897, 13, 1678, 1596, 580, 13, 13, 1357, 12376, 29889, 20472, 12376, 580, 2 ]
example_consumer/settings.py
open-craft/django-openid-auth
11
129564
# django-openid-auth - OpenID integration for django.contrib.auth # # Copyright (C) 2007 <NAME> # Copyright (C) 2008-2013 Canonical Ltd. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. """ Django settings for example_consumer project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import django BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '34958734985734985734985798437' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'debug': True, 'context_processors': [ 'django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.template.context_processors.static', 'django.template.context_processors.tz', 'django.contrib.messages.context_processors.messages', ] } } ] ALLOWED_HOSTS = [] # https://docs.djangoproject.com/en/2.0/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware # SHIM: Old style (pre Django 1.10), can be removed, once Django 1.10 support is dropped if django.VERSION < (1, 10): MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', ) else: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] # Application definition INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', 'django_openid_auth', ) if django.VERSION < (1, 7): INSTALLED_APPS += ('south',) ROOT_URLCONF = 'example_consumer.urls' WSGI_APPLICATION = 'example_consumer.wsgi.application' # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Internationalization # https://docs.djangoproject.com/en/1.7/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ STATIC_URL = '/static/' # the library python-openid does not support a json session serializer # <openid.yadis.manager.YadisServiceManager> is not JSON serializable # https://github.com/openid/python-openid/issues/17 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer' AUTHENTICATION_BACKENDS = ( 'django_openid_auth.auth.OpenIDBackend', 'django.contrib.auth.backends.ModelBackend', ) # Should users be created when new OpenIDs are used to log in? OPENID_CREATE_USERS = True # When logging in again, should we overwrite user details based on # data received via Simple Registration? OPENID_UPDATE_DETAILS_FROM_SREG = True # Map of OpenID Provider base URLs to recognised account verification schemes # returned in response to a http://ns.login.ubuntu.com/2013/validation/account # request. Use None as the key in place of a URL to specify verification # schemes that will be trusted from unknown OpenID Providers (not recommended). OPENID_VALID_VERIFICATION_SCHEMES = { None: (), } # If set, always use this as the identity URL rather than asking the # user. This only makes sense if it is a server URL. OPENID_SSO_SERVER_URL = 'https://login.ubuntu.com/' # Tell django.contrib.auth to use the OpenID signin URLs. LOGIN_URL = '/openid/login/' LOGIN_REDIRECT_URL = '/' # Should django_auth_openid be used to sign into the admin interface? OPENID_USE_AS_ADMIN_LOGIN = False
[ 1, 396, 9557, 29899, 3150, 333, 29899, 5150, 448, 29871, 4673, 1367, 13465, 363, 9557, 29889, 21570, 29889, 5150, 13, 29937, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29900, 29955, 529, 5813, 29958, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29900, 29947, 29899, 29906, 29900, 29896, 29941, 1815, 265, 936, 19806, 29889, 13, 29937, 13, 29937, 4367, 391, 3224, 322, 671, 297, 2752, 322, 7581, 7190, 29892, 411, 470, 1728, 13, 29937, 21733, 29892, 526, 21905, 4944, 393, 278, 1494, 5855, 13, 29937, 526, 1539, 29901, 13, 29937, 13, 29937, 334, 4367, 391, 3224, 29879, 310, 2752, 775, 1818, 11551, 278, 2038, 3509, 1266, 13, 29937, 8369, 29892, 445, 1051, 310, 5855, 322, 278, 1494, 2313, 433, 4193, 29889, 13, 29937, 13, 29937, 334, 4367, 391, 3224, 29879, 297, 7581, 883, 1818, 18532, 278, 2038, 3509, 1266, 13, 29937, 8369, 29892, 445, 1051, 310, 5855, 322, 278, 1494, 2313, 433, 4193, 297, 278, 13, 29937, 5106, 322, 29914, 272, 916, 17279, 4944, 411, 278, 4978, 29889, 13, 29937, 13, 29937, 3446, 3235, 7791, 7818, 12982, 1525, 8519, 13756, 13044, 3352, 6770, 6093, 315, 4590, 29979, 22789, 3912, 379, 5607, 8032, 29903, 5300, 8707, 29911, 3960, 29933, 2692, 24125, 13, 29937, 376, 3289, 8519, 29908, 5300, 13764, 29979, 8528, 15094, 1799, 6323, 306, 3580, 5265, 3352, 399, 1718, 29934, 13566, 29059, 29892, 2672, 6154, 15789, 4214, 29892, 350, 2692, 6058, 13, 29937, 27848, 3352, 7495, 29892, 6093, 306, 3580, 5265, 3352, 399, 1718, 29934, 13566, 29059, 8079, 341, 1001, 3210, 13566, 2882, 6227, 11937, 5300, 383, 1806, 8186, 1799, 13, 29937, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 319, 1525, 28657, 13875, 8890, 29928, 29889, 2672, 11698, 382, 29963, 3919, 24972, 9818, 6093, 13, 29937, 315, 4590, 29979, 22789, 3912, 438, 29956, 13865, 6323, 8707, 29911, 3960, 29933, 2692, 24125, 20700, 17705, 6181, 15842, 13764, 29979, 22471, 26282, 29892, 2672, 4571, 26282, 29892, 13, 29937, 2672, 29907, 1367, 3919, 1964, 29892, 317, 4162, 8426, 1964, 29892, 8528, 29923, 3580, 29931, 19926, 29892, 6323, 8707, 1660, 13356, 3919, 25758, 21330, 1529, 1692, 29903, 313, 1177, 6154, 15789, 4214, 29892, 13, 29937, 350, 2692, 6058, 27848, 3352, 7495, 29892, 13756, 29907, 11499, 13780, 8079, 27092, 1254, 1806, 26027, 21947, 29949, 8452, 6323, 26996, 29963, 2965, 2890, 29936, 13, 29937, 11247, 1799, 8079, 501, 1660, 29892, 360, 8254, 29892, 6323, 13756, 29943, 1806, 29903, 29936, 6323, 350, 3308, 8895, 1799, 2672, 4945, 29934, 4897, 29911, 2725, 29897, 29832, 8851, 5348, 13, 29937, 12766, 17171, 29928, 5300, 6732, 13764, 29979, 6093, 18929, 8079, 17705, 2882, 6227, 11937, 29892, 12317, 2544, 4448, 2672, 8707, 29911, 4717, 1783, 29892, 6850, 3960, 1783, 13, 29937, 17705, 2882, 6227, 11937, 29892, 6323, 323, 8476, 313, 1177, 6154, 15789, 4214, 405, 11787, 5265, 24647, 4741, 6323, 438, 29911, 4448, 22119, 1660, 29897, 9033, 3235, 4214, 2672, 13, 29937, 13764, 29979, 399, 29909, 29979, 19474, 8079, 6093, 501, 1660, 8079, 3446, 3235, 7791, 7818, 12982, 1525, 29892, 382, 29963, 1430, 10762, 11033, 18118, 1660, 29928, 8079, 6093, 13, 29937, 21521, 1799, 8979, 6227, 11937, 8079, 20134, 3210, 21330, 1529, 1692, 29889, 13, 13, 15945, 29908, 13, 29928, 5364, 6055, 363, 1342, 29918, 25978, 261, 2060, 29889, 13, 13, 2831, 901, 2472, 373, 445, 934, 29892, 1074, 13, 991, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 3332, 1199, 29914, 11027, 29914, 13, 13, 2831, 278, 2989, 1051, 310, 6055, 322, 1009, 1819, 29892, 1074, 13, 991, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 999, 29914, 11027, 29914, 13, 15945, 29908, 13, 13, 29937, 8878, 10898, 2768, 278, 2060, 763, 445, 29901, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 9464, 29892, 29757, 13, 5215, 2897, 13, 5215, 9557, 13, 13, 25416, 29918, 9464, 353, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 876, 13, 13, 13, 29937, 26141, 29899, 2962, 5849, 6055, 448, 443, 2146, 8270, 363, 5802, 13, 29937, 2823, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 3525, 517, 29914, 16519, 358, 29914, 3198, 1761, 29914, 13, 13, 29937, 3725, 22484, 11937, 399, 25614, 29901, 3013, 278, 7035, 1820, 1304, 297, 5802, 7035, 29991, 13, 1660, 22245, 29911, 29918, 10818, 353, 525, 29941, 29946, 29929, 29945, 29947, 29955, 29941, 29946, 29929, 29947, 29945, 29955, 29941, 29946, 29929, 29947, 29945, 29955, 29941, 29946, 29929, 29947, 29945, 29955, 29929, 29947, 29946, 29941, 29955, 29915, 13, 13, 29937, 3725, 22484, 11937, 399, 25614, 29901, 1016, 29915, 29873, 1065, 411, 4744, 6077, 373, 297, 5802, 29991, 13, 18525, 353, 5852, 13, 13, 4330, 3580, 29931, 1299, 2890, 353, 518, 13, 1678, 426, 13, 4706, 525, 29933, 11375, 11794, 2396, 525, 14095, 29889, 6886, 29889, 1627, 1975, 29889, 14095, 29889, 29928, 5364, 5776, 9884, 742, 13, 4706, 525, 9464, 29903, 2396, 19997, 13, 4706, 525, 20576, 29918, 9464, 29903, 2396, 5852, 29892, 13, 4706, 525, 14094, 27946, 2396, 426, 13, 9651, 525, 8382, 2396, 5852, 29892, 13, 9651, 525, 4703, 29918, 5014, 943, 2396, 518, 13, 18884, 525, 14095, 29889, 21570, 29889, 5150, 29889, 4703, 29918, 5014, 943, 29889, 5150, 742, 13, 18884, 525, 14095, 29889, 6886, 29889, 4703, 29918, 5014, 943, 29889, 8382, 742, 13, 18884, 525, 14095, 29889, 6886, 29889, 4703, 29918, 5014, 943, 29889, 29875, 29896, 29947, 29876, 742, 13, 18884, 525, 14095, 29889, 6886, 29889, 4703, 29918, 5014, 943, 29889, 9799, 742, 13, 18884, 525, 14095, 29889, 6886, 29889, 4703, 29918, 5014, 943, 29889, 7959, 742, 13, 18884, 525, 14095, 29889, 6886, 29889, 4703, 29918, 5014, 943, 29889, 17559, 742, 13, 18884, 525, 14095, 29889, 21570, 29889, 19158, 29889, 4703, 29918, 5014, 943, 29889, 19158, 742, 13, 9651, 4514, 13, 4706, 500, 13, 1678, 500, 13, 29962, 13, 13, 1964, 27998, 3352, 29918, 20832, 29903, 353, 5159, 13, 13, 29937, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29906, 29889, 29900, 29914, 3332, 1199, 29914, 1124, 29914, 17662, 2519, 8484, 786, 5105, 292, 29899, 1457, 29899, 14095, 29899, 29896, 29899, 29896, 29900, 29899, 3293, 29899, 17662, 2519, 13, 29937, 24972, 7833, 29901, 8198, 3114, 313, 1457, 15337, 29871, 29896, 29889, 29896, 29900, 511, 508, 367, 6206, 29892, 2748, 15337, 29871, 29896, 29889, 29896, 29900, 2304, 338, 13700, 13, 361, 9557, 29889, 16358, 529, 313, 29896, 29892, 29871, 29896, 29900, 1125, 13, 1678, 341, 1367, 29928, 1307, 12982, 1525, 29918, 6154, 3289, 1660, 29903, 353, 313, 13, 4706, 525, 14095, 29889, 17662, 2519, 29889, 9435, 29889, 18877, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 21570, 29889, 29879, 10964, 29889, 17662, 2519, 29889, 7317, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 21570, 29889, 5150, 29889, 17662, 2519, 29889, 16746, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 17662, 2519, 29889, 2395, 9600, 29889, 29907, 29879, 9600, 1043, 25411, 2519, 742, 13, 1678, 1723, 13, 2870, 29901, 13, 1678, 341, 1367, 29928, 1307, 12982, 1525, 353, 518, 13, 4706, 525, 14095, 29889, 17662, 2519, 29889, 8926, 29889, 13228, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 21570, 29889, 29879, 10964, 29889, 17662, 2519, 29889, 7317, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 17662, 2519, 29889, 9435, 29889, 18877, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 17662, 2519, 29889, 2395, 9600, 29889, 29907, 29879, 9600, 1043, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 21570, 29889, 5150, 29889, 17662, 2519, 29889, 16746, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 21570, 29889, 19158, 29889, 17662, 2519, 29889, 3728, 25411, 2519, 742, 13, 4706, 525, 14095, 29889, 17662, 2519, 29889, 3808, 21452, 292, 29889, 29990, 4308, 5856, 25411, 2519, 742, 13, 1678, 4514, 13, 13, 29937, 8427, 5023, 13, 13, 25580, 1964, 20566, 29918, 3301, 7024, 353, 313, 13, 1678, 525, 14095, 29889, 21570, 29889, 5150, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 3051, 8768, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 29879, 10964, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 6406, 742, 13, 1678, 525, 14095, 29918, 3150, 333, 29918, 5150, 742, 13, 29897, 13, 13, 361, 9557, 29889, 16358, 529, 313, 29896, 29892, 29871, 29955, 1125, 13, 1678, 2672, 1254, 1964, 20566, 29918, 3301, 7024, 4619, 6702, 29879, 2438, 742, 29897, 13, 13, 21289, 29918, 4219, 6007, 29943, 353, 525, 4773, 29918, 25978, 261, 29889, 26045, 29915, 13, 13, 7811, 29954, 29902, 29918, 3301, 7390, 28541, 353, 525, 4773, 29918, 25978, 261, 29889, 5652, 3146, 29889, 6214, 29915, 13, 13, 29937, 5470, 13, 29937, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 999, 29914, 11027, 8484, 29503, 2129, 13, 13, 25832, 27982, 29903, 353, 426, 13, 1678, 525, 4381, 2396, 426, 13, 4706, 525, 1430, 29954, 8895, 2396, 525, 14095, 29889, 2585, 29889, 1627, 1975, 29889, 22793, 29941, 742, 13, 4706, 525, 5813, 2396, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 9464, 29892, 525, 2585, 29889, 22793, 29941, 5477, 13, 1678, 500, 13, 29913, 13, 13, 29937, 4623, 2133, 13, 29937, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 3332, 1199, 29914, 29875, 29896, 29947, 29876, 29914, 13, 13, 29931, 19453, 29965, 10461, 29918, 16524, 353, 525, 264, 29899, 375, 29915, 13, 13, 15307, 29918, 29999, 12413, 353, 525, 26913, 29915, 13, 13, 17171, 29918, 29902, 29896, 29947, 29940, 353, 5852, 13, 13, 17171, 29918, 29911, 29999, 353, 5852, 13, 13, 29937, 624, 2454, 2066, 313, 19407, 29892, 8286, 29892, 1954, 1179, 29897, 13, 29937, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29896, 29889, 29955, 29914, 3525, 517, 29914, 7959, 29899, 5325, 29914, 13, 13, 17816, 2965, 29918, 4219, 353, 8207, 7959, 22208, 13, 13, 29937, 278, 3489, 3017, 29899, 3150, 333, 947, 451, 2304, 263, 4390, 4867, 7797, 3950, 13, 29937, 529, 3150, 333, 29889, 29891, 328, 275, 29889, 12847, 29889, 29979, 328, 275, 3170, 3260, 29958, 338, 451, 4663, 7797, 13902, 13, 29937, 2045, 597, 3292, 29889, 510, 29914, 3150, 333, 29914, 4691, 29899, 3150, 333, 29914, 12175, 29914, 29896, 29955, 13, 17493, 29918, 6304, 25758, 26664, 1001, 353, 525, 14095, 29889, 21570, 29889, 29879, 10964, 29889, 15550, 19427, 29889, 29925, 860, 280, 17679, 29915, 13, 13, 20656, 29950, 3919, 28541, 29918, 29933, 11375, 1430, 8452, 353, 313, 13, 1678, 525, 14095, 29918, 3150, 333, 29918, 5150, 29889, 5150, 29889, 6585, 1367, 5841, 355, 742, 13, 1678, 525, 14095, 29889, 21570, 29889, 5150, 29889, 1627, 1975, 29889, 3195, 5841, 355, 742, 13, 29897, 13, 13, 29937, 10575, 4160, 367, 2825, 746, 716, 4673, 1367, 29879, 526, 1304, 304, 1480, 297, 29973, 13, 4590, 1430, 1367, 29918, 27045, 29918, 11889, 29903, 353, 5852, 13, 13, 29937, 1932, 12183, 297, 1449, 29892, 881, 591, 26556, 1404, 4902, 2729, 373, 13, 29937, 848, 4520, 3025, 12545, 2169, 8306, 29973, 13, 4590, 1430, 1367, 29918, 14474, 29918, 2287, 6040, 6227, 29903, 29918, 21482, 29918, 29903, 18166, 353, 5852, 13, 13, 29937, 7315, 310, 4673, 1367, 1019, 5489, 2967, 24295, 304, 5936, 3368, 3633, 1147, 2450, 27715, 13, 29937, 4133, 297, 2933, 304, 263, 1732, 597, 1983, 29889, 7507, 29889, 8767, 29889, 510, 29914, 29906, 29900, 29896, 29941, 29914, 18157, 29914, 10149, 13, 29937, 2009, 29889, 29871, 4803, 6213, 408, 278, 1820, 297, 2058, 310, 263, 3988, 304, 6084, 1147, 2450, 13, 29937, 27715, 393, 674, 367, 9311, 287, 515, 9815, 4673, 1367, 1019, 29454, 313, 1333, 13622, 467, 13, 4590, 1430, 1367, 29918, 26707, 29918, 5348, 6545, 28541, 29918, 29903, 3210, 29923, 2303, 29903, 353, 426, 13, 1678, 6213, 29901, 313, 511, 13, 29913, 13, 13, 29937, 960, 731, 29892, 2337, 671, 445, 408, 278, 10110, 3988, 3265, 1135, 6721, 278, 13, 29937, 1404, 29889, 29871, 910, 871, 3732, 4060, 565, 372, 338, 263, 1923, 3988, 29889, 13, 4590, 1430, 1367, 29918, 1799, 29949, 29918, 18603, 29918, 4219, 353, 525, 991, 597, 7507, 29889, 8767, 29889, 510, 22208, 13, 13, 29937, 24948, 9557, 29889, 21570, 29889, 5150, 304, 671, 278, 4673, 1367, 1804, 262, 24295, 29889, 13, 14480, 1177, 29918, 4219, 353, 8207, 3150, 333, 29914, 7507, 22208, 13, 14480, 1177, 29918, 1525, 4571, 26282, 29918, 4219, 353, 8207, 29915, 13, 13, 29937, 10575, 9557, 29918, 5150, 29918, 3150, 333, 367, 1304, 304, 1804, 964, 278, 4113, 5067, 29973, 13, 4590, 1430, 1367, 29918, 17171, 29918, 3289, 29918, 3035, 16173, 29918, 14480, 1177, 353, 7700, 13, 2 ]
alembic/dev_seeds.py
ryanmahan/police-data-trust
0
52950
<gh_stars>0 from backend.database.core import db from backend.database import User, UserRole from backend.auth import user_manager from backend.database.models.incident import Incident from backend.database.models.officer import Officer from backend.database.models.use_of_force import UseOfForce def create_user(user): user_exists = ( db.session.query(User).filter_by(email=user.email).first() is not None ) if not user_exists: user.create() create_user( User( email="<EMAIL>", password=<PASSWORD>("password"), role=UserRole.PUBLIC, first_name="Test", last_name="Example", ) ) create_user( User( email="<EMAIL>", password=<PASSWORD>("password"), role=UserRole.CONTRIBUTOR, first_name="Contributor", last_name="Example", ) ) create_user( User( email="<EMAIL>", password=<PASSWORD>("password"), role=UserRole.ADMIN, first_name="Admin", last_name="Example", ) ) create_user( User( email="<EMAIL>", password=<PASSWORD>("password"), role=UserRole.PASSPORT, first_name="Passport", last_name="Example", ) ) def create_incident(key=1, date="10-01-2019"): base_id = 10000000 id = base_id + key incident = Incident( id=id, location=f"Test location {key}", description=f"Test description {key}", department=f"Small Police Department {key}", time_of_incident=f"{date} 00:00:00", officers=[ Officer( first_name=f"TestFirstName {key}", last_name=f"TestLastName {key}", ) ], use_of_force=[UseOfForce(item=f"gunshot {key}")], source="mpv", ) exists = db.session.query(Incident).filter_by(id=id).first() is not None if not exists: incident.create() create_incident(key=1, date="10-01-2019") create_incident(key=2, date="11-01-2019") create_incident(key=3, date="12-01-2019") create_incident(key=4, date="03-15-2020") create_incident(key=5, date="04-15-2020") create_incident(key=6, date="08-10-2020") create_incident(key=7, date="10-01-2020") create_incident(key=8, date="10-15-2020")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 14998, 29889, 9803, 29889, 3221, 1053, 4833, 13, 3166, 14998, 29889, 9803, 1053, 4911, 29892, 4911, 16727, 13, 3166, 14998, 29889, 5150, 1053, 1404, 29918, 12847, 13, 3166, 14998, 29889, 9803, 29889, 9794, 29889, 3742, 1693, 1053, 9266, 1693, 13, 3166, 14998, 29889, 9803, 29889, 9794, 29889, 29877, 2416, 261, 1053, 28288, 13, 3166, 14998, 29889, 9803, 29889, 9794, 29889, 1509, 29918, 974, 29918, 10118, 1053, 4803, 2776, 2831, 346, 13, 13, 13, 1753, 1653, 29918, 1792, 29898, 1792, 1125, 13, 1678, 1404, 29918, 9933, 353, 313, 13, 4706, 4833, 29889, 7924, 29889, 1972, 29898, 2659, 467, 4572, 29918, 1609, 29898, 5269, 29922, 1792, 29889, 5269, 467, 4102, 580, 338, 451, 6213, 13, 1678, 1723, 13, 13, 1678, 565, 451, 1404, 29918, 9933, 29901, 13, 4706, 1404, 29889, 3258, 580, 13, 13, 13, 3258, 29918, 1792, 29898, 13, 1678, 4911, 29898, 13, 4706, 4876, 543, 29966, 26862, 6227, 28341, 13, 4706, 4800, 29922, 29966, 25711, 17013, 29958, 703, 5630, 4968, 13, 4706, 6297, 29922, 2659, 16727, 29889, 7056, 13367, 2965, 29892, 13, 4706, 937, 29918, 978, 543, 3057, 613, 13, 4706, 1833, 29918, 978, 543, 14023, 613, 13, 1678, 1723, 13, 29897, 13, 13, 3258, 29918, 1792, 29898, 13, 1678, 4911, 29898, 13, 4706, 4876, 543, 29966, 26862, 6227, 28341, 13, 4706, 4800, 29922, 29966, 25711, 17013, 29958, 703, 5630, 4968, 13, 4706, 6297, 29922, 2659, 16727, 29889, 22412, 3960, 29933, 2692, 1955, 29892, 13, 4706, 937, 29918, 978, 543, 1323, 1091, 3406, 613, 13, 4706, 1833, 29918, 978, 543, 14023, 613, 13, 1678, 1723, 13, 29897, 13, 13, 3258, 29918, 1792, 29898, 13, 1678, 4911, 29898, 13, 4706, 4876, 543, 29966, 26862, 6227, 28341, 13, 4706, 4800, 29922, 29966, 25711, 17013, 29958, 703, 5630, 4968, 13, 4706, 6297, 29922, 2659, 16727, 29889, 3035, 16173, 29892, 13, 4706, 937, 29918, 978, 543, 12754, 613, 13, 4706, 1833, 29918, 978, 543, 14023, 613, 13, 1678, 1723, 13, 29897, 13, 13, 3258, 29918, 1792, 29898, 13, 1678, 4911, 29898, 13, 4706, 4876, 543, 29966, 26862, 6227, 28341, 13, 4706, 4800, 29922, 29966, 25711, 17013, 29958, 703, 5630, 4968, 13, 4706, 6297, 29922, 2659, 16727, 29889, 25711, 15082, 29892, 13, 4706, 937, 29918, 978, 543, 7129, 637, 613, 13, 4706, 1833, 29918, 978, 543, 14023, 613, 13, 1678, 1723, 13, 29897, 13, 13, 13, 1753, 1653, 29918, 3742, 1693, 29898, 1989, 29922, 29896, 29892, 2635, 543, 29896, 29900, 29899, 29900, 29896, 29899, 29906, 29900, 29896, 29929, 29908, 1125, 13, 1678, 2967, 29918, 333, 353, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29900, 13, 1678, 1178, 353, 2967, 29918, 333, 718, 1820, 13, 1678, 15134, 353, 9266, 1693, 29898, 13, 4706, 1178, 29922, 333, 29892, 13, 4706, 4423, 29922, 29888, 29908, 3057, 4423, 426, 1989, 17671, 13, 4706, 6139, 29922, 29888, 29908, 3057, 6139, 426, 1989, 17671, 13, 4706, 14311, 29922, 29888, 29908, 12636, 497, 18923, 10317, 426, 1989, 17671, 13, 4706, 931, 29918, 974, 29918, 3742, 1693, 29922, 29888, 29908, 29912, 1256, 29913, 29871, 29900, 29900, 29901, 29900, 29900, 29901, 29900, 29900, 613, 13, 4706, 13049, 11759, 13, 9651, 28288, 29898, 13, 18884, 937, 29918, 978, 29922, 29888, 29908, 3057, 29541, 426, 1989, 17671, 13, 18884, 1833, 29918, 978, 29922, 29888, 29908, 3057, 8897, 1170, 426, 1989, 17671, 13, 9651, 1723, 13, 4706, 21251, 13, 4706, 671, 29918, 974, 29918, 10118, 11759, 11403, 2776, 2831, 346, 29898, 667, 29922, 29888, 29908, 28798, 8962, 426, 1989, 27195, 1402, 13, 4706, 2752, 543, 1526, 29894, 613, 13, 1678, 1723, 13, 1678, 4864, 353, 4833, 29889, 7924, 29889, 1972, 29898, 797, 29883, 1693, 467, 4572, 29918, 1609, 29898, 333, 29922, 333, 467, 4102, 580, 338, 451, 6213, 13, 13, 1678, 565, 451, 4864, 29901, 13, 4706, 15134, 29889, 3258, 580, 13, 13, 13, 3258, 29918, 3742, 1693, 29898, 1989, 29922, 29896, 29892, 2635, 543, 29896, 29900, 29899, 29900, 29896, 29899, 29906, 29900, 29896, 29929, 1159, 13, 3258, 29918, 3742, 1693, 29898, 1989, 29922, 29906, 29892, 2635, 543, 29896, 29896, 29899, 29900, 29896, 29899, 29906, 29900, 29896, 29929, 1159, 13, 3258, 29918, 3742, 1693, 29898, 1989, 29922, 29941, 29892, 2635, 543, 29896, 29906, 29899, 29900, 29896, 29899, 29906, 29900, 29896, 29929, 1159, 13, 3258, 29918, 3742, 1693, 29898, 1989, 29922, 29946, 29892, 2635, 543, 29900, 29941, 29899, 29896, 29945, 29899, 29906, 29900, 29906, 29900, 1159, 13, 3258, 29918, 3742, 1693, 29898, 1989, 29922, 29945, 29892, 2635, 543, 29900, 29946, 29899, 29896, 29945, 29899, 29906, 29900, 29906, 29900, 1159, 13, 3258, 29918, 3742, 1693, 29898, 1989, 29922, 29953, 29892, 2635, 543, 29900, 29947, 29899, 29896, 29900, 29899, 29906, 29900, 29906, 29900, 1159, 13, 3258, 29918, 3742, 1693, 29898, 1989, 29922, 29955, 29892, 2635, 543, 29896, 29900, 29899, 29900, 29896, 29899, 29906, 29900, 29906, 29900, 1159, 13, 3258, 29918, 3742, 1693, 29898, 1989, 29922, 29947, 29892, 2635, 543, 29896, 29900, 29899, 29896, 29945, 29899, 29906, 29900, 29906, 29900, 1159, 13, 2 ]
deepff/process.py
JunboLu/CP2K_kit
16
41987
#! /usr/env/bin python import os import linecache import numpy as np from collections import OrderedDict from CP2K_kit.tools import call from CP2K_kit.tools import data_op from CP2K_kit.tools import file_tools from CP2K_kit.tools import read_input from CP2K_kit.tools import traj_info from CP2K_kit.deepff import load_data from CP2K_kit.deepff import gen_lammps_task def get_sys_num(exe_dir): ''' get_sys_num: get the number of systems Args: exe_dir: string exe_dir is the directory where shell script will be excuted. Returns: sys_num: int sys_num is the number of systems. ''' cmd = "ls | grep %s" % ('sys_') sys_num = len(call.call_returns_shell(exe_dir, cmd)) return sys_num def get_data_num(exe_dir): ''' get_data_num: get the number of data Args: exe_dir: string exe_dir is the directory where shell script will be excuted. Returns: data_num: int data_num is the number of data. ''' cmd = "ls | grep %s" % ('data_') data_num = len(call.call_returns_shell(exe_dir, cmd)) return data_num def get_task_num(exe_dir, get_task_dir=False): ''' get_task_num: get the number of tasks in a system Args: exe_dir: string exe_dir is the directory where shell script will be excuted. Returns: task_num: int task_num is the number of tasks in a system. ''' cmd = "ls | grep %s" % ('task_') task_dir = call.call_returns_shell(exe_dir, cmd) task_num = len(task_dir) if get_task_dir: return task_num, task_dir else: return task_num def get_lmp_model_num(exe_dir): ''' get_lmp_model_num: get the number of models in lammps directory. Args: exe_dir: string exe_dir is the directory where shell script will be excuted. Returns: model_num: int model_num is the number of models in lammps directory. ''' cmd = "ls | grep %s" % ("'model_[0-9]'") model_num = len(call.call_returns_shell(exe_dir, cmd)) return model_num def get_deepmd_model_num(exe_dir): ''' get_deepmd_model_num: get the number of models in deepmd directory. Args: exe_dir: string exe_dir is the directory where shell script will be excuted. Returns: model_num: int model_num is the number of models in deepmd directory. ''' model_num = len(call.call_returns_shell(exe_dir, "ls -ll |awk '/^d/ {print $NF}'")) return model_num def get_traj_num(exe_dir): ''' get_traj_num: get the number of frames Args: exe_dir: string exe_dir is the directory where shell script will be excuted. Returns: traj_num: int traj_num is the number of frames. ''' cmd = "ls | grep %s" % ('traj_') traj_num = len(call.call_returns_shell(exe_dir, cmd)) return traj_num def dump_input(work_dir, inp_file, f_key): ''' dump_input: dump deepff input file, it will call read_input module. Args: work_dir: string work_dir is the working directory of CP2K_kit. inp_file: string inp_file is the deepff input file f_key: 1-d string list f_key is fixed to: ['deepmd', 'lammps', 'cp2k', 'model_devi', 'environ'] Returns : deepmd_dic: dictionary deepmd_dic contains keywords used in deepmd. lammps_dic: dictionary lammpd_dic contains keywords used in lammps. cp2k_dic: dictionary cp2k_dic contains keywords used in cp2k. model_devi_dic: dictionary model_devi contains keywords used in model_devi. environ_dic: dictionary environ_dic contains keywords used in environment. ''' job_type_param = read_input.dump_info(work_dir, inp_file, f_key) deepmd_dic = job_type_param[0] lammps_dic = job_type_param[1] cp2k_dic = job_type_param[2] active_learn_dic = job_type_param[3] environ_dic = job_type_param[4] return deepmd_dic, lammps_dic, cp2k_dic, active_learn_dic, environ_dic def get_atoms_type(deepmd_dic): ''' get_atoms_type: get atoms type for total systems Args: deepmd_dic: dictionary deepmd_dic contains keywords used in deepmd. Returns: final_atoms_type: list final_atoms_type is the atoms type for all systems. Example: ['O', 'H'] ''' import linecache atoms_type = [] train_dic = deepmd_dic['training'] for key in train_dic: if ( 'system' in key ): traj_coord_file = train_dic[key]['traj_coord_file'] line_num = file_tools.grep_line_num("'PDB file'", traj_coord_file, os.getcwd()) if ( line_num == 0 ): coord_file_type = 'coord_xyz' else: coord_file_type = 'coord_pdb' atoms_num, pre_base_block, end_base_block, pre_base, frames_num, each, start_id, end_id, time_step = \ traj_info.get_traj_info(traj_coord_file, coord_file_type) atoms = [] for i in range(atoms_num): line_i = linecache.getline(traj_coord_file, pre_base+pre_base_block+i+1) line_i_split = data_op.split_str(line_i, ' ', '\n') if ( coord_file_type == 'coord_xyz' ): atoms.append(line_i_split[0]) elif ( coord_file_type == 'coord_pdb' ): atoms.append(line_i_split[len(line_i_split)-1]) linecache.clearcache() atoms_type.append(data_op.list_replicate(atoms)) tot_atoms_type = data_op.list_reshape(atoms_type) final_atoms_type = data_op.list_replicate(tot_atoms_type) return final_atoms_type def dump_init_data(work_dir, deepmd_dic, train_stress, tot_atoms_type_dic): ''' dump_init_data: load initial training data. Args: work_dir: string work_dir is working directory of CP2K_kit. deepmd_dic: dictionary deepmd_dic contains keywords used in deepmd. train_stress: bool train_stress is whether we need to dump stress. tot_atoms_type_dic: dictionary tot_atoms_type_dic is the atoms type dictionary. Returns: init_train_data: 1-d string list init_train_data contains initial training data directories. init_data_num : int init_data_num is the number of data for initial training. ''' init_train_data_dir = ''.join((work_dir, '/init_train_data')) if ( not os.path.exists(init_train_data_dir) ): cmd = "mkdir %s" % ('init_train_data') call.call_simple_shell(work_dir, cmd) i = 0 init_train_data = [] init_data_num = 0 train_dic = deepmd_dic['training'] shuffle_data = train_dic['shuffle_data'] for key in train_dic: if ( 'system' in key): save_dir = ''.join((work_dir, '/init_train_data/data_', str(i))) if ( not os.path.exists(save_dir) ): cmd = "mkdir %s" % (save_dir) call.call_simple_shell(work_dir, cmd) init_train_data.append(save_dir) cmd = "ls | grep %s" %("'set.'") set_dir_name = call.call_returns_shell(save_dir, cmd) choosed_num = train_dic[key]['choosed_frame_num'] data_num = [] if ( len(set_dir_name) > 0 ): for set_dir in set_dir_name: data_num_part = [] set_dir_abs = ''.join((save_dir, '/', set_dir)) coord_npy_file = ''.join((set_dir_abs, '/coord.npy')) force_npy_file = ''.join((set_dir_abs, '/force.npy')) box_npy_file = ''.join((set_dir_abs, '/box.npy')) energy_npy_file = ''.join((set_dir_abs, '/energy.npy')) if ( all(os.path.exists(npy_file) for npy_file in [coord_npy_file, force_npy_file, box_npy_file, energy_npy_file]) ): for npy_file in [coord_npy_file, force_npy_file, box_npy_file, energy_npy_file]: data_num_part.append(len(np.load(npy_file))) else: data_num_part = [0,0,0,0] virial_npy_file = ''.join((set_dir_abs, '/virial.npy')) if ( os.path.exists(virial_npy_file) ): data_num_part.append(len(np.load(virial_npy_file))) data_num.append(data_num_part) else: data_num = [[0,0,0,0]] data_num = data_op.add_2d_list(data_num) if ( all(j == choosed_num for j in data_num) ): if ( len(set_dir_name) == 1 ): init_data_num_part = choosed_num else: final_set_dir_abs = ''.join((save_dir, '/', set_dir_name[len(set_dir_name)-1])) final_energy_npy_file = ''.join((final_set_dir_abs, '/energy.npy')) init_data_num_part = choosed_num-len(np.load(final_energy_npy_file)) else: traj_type = train_dic[key]['traj_type'] start = train_dic[key]['start_frame'] end = train_dic[key]['end_frame'] parts = train_dic[key]['set_parts'] if ( traj_type == 'md' ): traj_coord_file = train_dic[key]['traj_coord_file'] traj_frc_file = train_dic[key]['traj_frc_file'] traj_cell_file = train_dic[key]['traj_cell_file'] traj_stress_file = train_dic[key]['traj_stress_file'] load_data.load_data_from_dir(traj_coord_file, traj_frc_file, traj_cell_file, traj_stress_file, \ train_stress, work_dir, save_dir, start, end, choosed_num, tot_atoms_type_dic) elif ( traj_type == 'mtd' ): data_dir = train_dic[key]['data_dir'] task_dir_prefix = train_dic[key]['task_dir_prefix'] proj_name = train_dic[key]['proj_name'] out_file_name = train_dic[key]['out_file_name'] choosed_index = data_op.gen_list(start, end, 1) choosed_index_array = np.array(choosed_index) np.random.shuffle(choosed_index_array) choosed_index = list(choosed_index_array[0:choosed_num]) load_data.load_data_from_sepfile(data_dir, save_dir, task_dir_prefix, proj_name, tot_atoms_type_dic, \ sorted(choosed_index), out_file_name) energy_array, coord_array, frc_array, box_array, virial_array = load_data.read_raw_data(save_dir) init_data_num_part, init_test_data_num_part = load_data.raw_data_to_set(parts, shuffle_data, save_dir, energy_array, \ coord_array, frc_array, box_array, virial_array) init_data_num = init_data_num+init_data_num_part i = i+1 if ( 'set_data_dir' in train_dic.keys() ): init_train_data.append(os.path.abspath(train_dic['set_data_dir'])) energy_npy_file = ''.join((os.path.abspath(train_dic['set_data_dir']), '/set.000/energy.npy')) set_data_num = len(np.load(energy_npy_file)) init_data_num = init_data_num+set_data_num return init_train_data, init_data_num def check_deepff_run(work_dir, iter_id): ''' check_deepff_run: check the running state of deepff Args: work_dir: string work_dir is workding directory. iter_id: int iter_id is current iteration number. Returns: failure_model: 1-d int list failure_model is the id of failure models. ''' train_dir = ''.join((work_dir, '/iter_', str(iter_id), '/01.train')) model_num = get_deepmd_model_num(train_dir) failure_model = [] for i in range(model_num): model_dir = ''.join((train_dir, '/', str(i))) lcurve_file = ''.join((model_dir, '/lcurve.out')) whole_line_num = len(open(lcurve_file).readlines()) choosed_line_num = int(0.1*whole_line_num) start_line = whole_line_num-choosed_line_num force_trn = [] for j in range(choosed_line_num): line = linecache.getline(lcurve_file, start_line+j+1) line_split = data_op.split_str(line, ' ') if ( data_op.eval_str(line_split[0]) == 1 and len(line_split) >= 8 ): force_trn.append(float(line_split[6])) linecache.clearcache() force_max = max(force_trn) force_min = min(force_trn) force_avg = np.mean(np.array(force_trn)) if ( ((force_max-force_min) >= 0.04 and force_max >= 0.08) or force_avg >= 0.08 ): failure_model.append(i) return failure_model def get_md_sys_info(lmp_dic, tot_atoms_type_dic): ''' get_md_sys_info: get the system information for lammps md. Args: lmp_dic: dictionary lmp_dic contains parameters for lammps. tot_atoms_type_dic: dictionary tot_atoms_type_dic is the atoms type dictionary. Returns: sys_num: int sys_num is the number of systems. atoms_type_multi_sys: 2-d dictionary, dim = (num of lammps systems) * (num of atom types) atoms_type_multi_sys is the atoms type for multi-systems. example: {0:{'O':1,'H':2,'N':3},1:{'O':1,'S':2,'N':3}} atoms_num_tot: dictionary atoms_num_tot contains number of atoms for different systems. Example: {0:3, 1:3} use_mtd_tot: bool use_mtd_tot is whethet using metadynamics for whole systems. ''' atoms_type_multi_sys = [] atoms_num_tot = [] use_mtd_tot = [] sys_num = 0 for key in lmp_dic: if 'system' in key: sys_num = sys_num + 1 for i in range(sys_num): sys = 'system' + str(i) box_file_name = lmp_dic[sys]['box'] coord_file_name = lmp_dic[sys]['coord'] use_mtd = lmp_dic[sys]['use_mtd'] tri_cell_vec, atoms, x, y, z = gen_lammps_task.get_box_coord(box_file_name, coord_file_name) atoms_type = data_op.list_replicate(atoms) atoms_type_dic = OrderedDict() for j in atoms_type: if j in tot_atoms_type_dic.keys(): atoms_type_dic[j] = tot_atoms_type_dic[j]+1 else: log_info.log_error('Input error: %s atom type in system %d is not trained, please check deepff/lammps/system' %(j, i)) exit() atoms_type_multi_sys.append(atoms_type_dic) atoms_num_tot.append(len(atoms)) use_mtd_tot.append(use_mtd) return sys_num, atoms_type_multi_sys, atoms_num_tot, use_mtd_tot
[ 1, 396, 29991, 847, 4855, 29914, 6272, 29914, 2109, 3017, 13, 13, 5215, 2897, 13, 5215, 1196, 8173, 13, 5215, 12655, 408, 7442, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 3166, 28505, 29906, 29968, 29918, 7354, 29889, 8504, 1053, 1246, 13, 3166, 28505, 29906, 29968, 29918, 7354, 29889, 8504, 1053, 848, 29918, 459, 13, 3166, 28505, 29906, 29968, 29918, 7354, 29889, 8504, 1053, 934, 29918, 8504, 13, 3166, 28505, 29906, 29968, 29918, 7354, 29889, 8504, 1053, 1303, 29918, 2080, 13, 3166, 28505, 29906, 29968, 29918, 7354, 29889, 8504, 1053, 1020, 29926, 29918, 3888, 13, 3166, 28505, 29906, 29968, 29918, 7354, 29889, 24535, 600, 1053, 2254, 29918, 1272, 13, 3166, 28505, 29906, 29968, 29918, 7354, 29889, 24535, 600, 1053, 2531, 29918, 29880, 4850, 567, 29918, 7662, 13, 13, 1753, 679, 29918, 9675, 29918, 1949, 29898, 8097, 29918, 3972, 1125, 13, 13, 29871, 14550, 13, 29871, 679, 29918, 9675, 29918, 1949, 29901, 679, 278, 1353, 310, 6757, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 429, 29872, 29918, 3972, 29901, 1347, 13, 418, 429, 29872, 29918, 3972, 338, 278, 3884, 988, 6473, 2471, 674, 367, 5566, 3860, 29889, 13, 29871, 16969, 29901, 13, 1678, 10876, 29918, 1949, 29901, 938, 13, 418, 10876, 29918, 1949, 338, 278, 1353, 310, 6757, 29889, 13, 29871, 14550, 13, 13, 29871, 9920, 353, 376, 3137, 891, 12680, 1273, 29879, 29908, 1273, 6702, 9675, 29918, 1495, 13, 29871, 10876, 29918, 1949, 353, 7431, 29898, 4804, 29889, 4804, 29918, 18280, 29918, 15903, 29898, 8097, 29918, 3972, 29892, 9920, 876, 13, 13, 29871, 736, 10876, 29918, 1949, 13, 13, 1753, 679, 29918, 1272, 29918, 1949, 29898, 8097, 29918, 3972, 1125, 13, 13, 29871, 14550, 13, 29871, 679, 29918, 1272, 29918, 1949, 29901, 679, 278, 1353, 310, 848, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 429, 29872, 29918, 3972, 29901, 1347, 13, 418, 429, 29872, 29918, 3972, 338, 278, 3884, 988, 6473, 2471, 674, 367, 5566, 3860, 29889, 13, 29871, 16969, 29901, 13, 1678, 848, 29918, 1949, 29901, 938, 13, 418, 848, 29918, 1949, 338, 278, 1353, 310, 848, 29889, 13, 29871, 14550, 13, 13, 29871, 9920, 353, 376, 3137, 891, 12680, 1273, 29879, 29908, 1273, 6702, 1272, 29918, 1495, 13, 29871, 848, 29918, 1949, 353, 7431, 29898, 4804, 29889, 4804, 29918, 18280, 29918, 15903, 29898, 8097, 29918, 3972, 29892, 9920, 876, 13, 13, 29871, 736, 848, 29918, 1949, 13, 13, 1753, 679, 29918, 7662, 29918, 1949, 29898, 8097, 29918, 3972, 29892, 679, 29918, 7662, 29918, 3972, 29922, 8824, 1125, 13, 13, 29871, 14550, 13, 29871, 679, 29918, 7662, 29918, 1949, 29901, 679, 278, 1353, 310, 9595, 297, 263, 1788, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 429, 29872, 29918, 3972, 29901, 1347, 13, 418, 429, 29872, 29918, 3972, 338, 278, 3884, 988, 6473, 2471, 674, 367, 5566, 3860, 29889, 13, 29871, 16969, 29901, 13, 1678, 3414, 29918, 1949, 29901, 938, 13, 418, 3414, 29918, 1949, 338, 278, 1353, 310, 9595, 297, 263, 1788, 29889, 13, 29871, 14550, 13, 13, 29871, 9920, 353, 376, 3137, 891, 12680, 1273, 29879, 29908, 1273, 6702, 7662, 29918, 1495, 13, 29871, 3414, 29918, 3972, 353, 1246, 29889, 4804, 29918, 18280, 29918, 15903, 29898, 8097, 29918, 3972, 29892, 9920, 29897, 13, 29871, 3414, 29918, 1949, 353, 7431, 29898, 7662, 29918, 3972, 29897, 13, 13, 29871, 565, 679, 29918, 7662, 29918, 3972, 29901, 13, 1678, 736, 3414, 29918, 1949, 29892, 3414, 29918, 3972, 13, 29871, 1683, 29901, 13, 1678, 736, 3414, 29918, 1949, 13, 13, 1753, 679, 29918, 29880, 1526, 29918, 4299, 29918, 1949, 29898, 8097, 29918, 3972, 1125, 13, 13, 29871, 14550, 13, 29871, 679, 29918, 29880, 1526, 29918, 4299, 29918, 1949, 29901, 679, 278, 1353, 310, 4733, 297, 301, 4850, 567, 3884, 29889, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 429, 29872, 29918, 3972, 29901, 1347, 13, 418, 429, 29872, 29918, 3972, 338, 278, 3884, 988, 6473, 2471, 674, 367, 5566, 3860, 29889, 13, 29871, 16969, 29901, 13, 1678, 1904, 29918, 1949, 29901, 938, 13, 418, 1904, 29918, 1949, 338, 278, 1353, 310, 4733, 297, 301, 4850, 567, 3884, 29889, 13, 29871, 14550, 13, 13, 29871, 9920, 353, 376, 3137, 891, 12680, 1273, 29879, 29908, 1273, 4852, 29915, 4299, 29918, 29961, 29900, 29899, 29929, 29962, 29915, 1159, 13, 29871, 1904, 29918, 1949, 353, 7431, 29898, 4804, 29889, 4804, 29918, 18280, 29918, 15903, 29898, 8097, 29918, 3972, 29892, 9920, 876, 13, 13, 29871, 736, 1904, 29918, 1949, 13, 13, 1753, 679, 29918, 24535, 3487, 29918, 4299, 29918, 1949, 29898, 8097, 29918, 3972, 1125, 13, 13, 29871, 14550, 13, 29871, 679, 29918, 24535, 3487, 29918, 4299, 29918, 1949, 29901, 679, 278, 1353, 310, 4733, 297, 6483, 3487, 3884, 29889, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 429, 29872, 29918, 3972, 29901, 1347, 13, 418, 429, 29872, 29918, 3972, 338, 278, 3884, 988, 6473, 2471, 674, 367, 5566, 3860, 29889, 13, 29871, 16969, 29901, 13, 1678, 1904, 29918, 1949, 29901, 938, 13, 418, 1904, 29918, 1949, 338, 278, 1353, 310, 4733, 297, 6483, 3487, 3884, 29889, 13, 29871, 14550, 13, 13, 29871, 1904, 29918, 1949, 353, 7431, 29898, 4804, 29889, 4804, 29918, 18280, 29918, 15903, 29898, 8097, 29918, 3972, 29892, 376, 3137, 448, 645, 891, 20011, 8207, 29985, 29881, 29914, 426, 2158, 395, 22498, 10162, 5783, 13, 13, 29871, 736, 1904, 29918, 1949, 13, 13, 1753, 679, 29918, 3018, 29926, 29918, 1949, 29898, 8097, 29918, 3972, 1125, 13, 13, 29871, 14550, 13, 29871, 679, 29918, 3018, 29926, 29918, 1949, 29901, 679, 278, 1353, 310, 16608, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 429, 29872, 29918, 3972, 29901, 1347, 13, 418, 429, 29872, 29918, 3972, 338, 278, 3884, 988, 6473, 2471, 674, 367, 5566, 3860, 29889, 13, 29871, 16969, 29901, 13, 1678, 1020, 29926, 29918, 1949, 29901, 938, 13, 418, 1020, 29926, 29918, 1949, 338, 278, 1353, 310, 16608, 29889, 13, 29871, 14550, 13, 13, 29871, 9920, 353, 376, 3137, 891, 12680, 1273, 29879, 29908, 1273, 6702, 3018, 29926, 29918, 1495, 13, 29871, 1020, 29926, 29918, 1949, 353, 7431, 29898, 4804, 29889, 4804, 29918, 18280, 29918, 15903, 29898, 8097, 29918, 3972, 29892, 9920, 876, 13, 13, 29871, 736, 1020, 29926, 29918, 1949, 13, 13, 1753, 16766, 29918, 2080, 29898, 1287, 29918, 3972, 29892, 297, 29886, 29918, 1445, 29892, 285, 29918, 1989, 1125, 13, 13, 29871, 14550, 13, 29871, 16766, 29918, 2080, 29901, 16766, 6483, 600, 1881, 934, 29892, 372, 674, 1246, 1303, 29918, 2080, 3883, 29889, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 664, 29918, 3972, 29901, 1347, 13, 418, 664, 29918, 3972, 338, 278, 1985, 3884, 310, 28505, 29906, 29968, 29918, 7354, 29889, 13, 1678, 297, 29886, 29918, 1445, 29901, 1347, 13, 418, 297, 29886, 29918, 1445, 338, 278, 6483, 600, 1881, 934, 13, 1678, 285, 29918, 1989, 29901, 29871, 29896, 29899, 29881, 1347, 1051, 13, 418, 285, 29918, 1989, 338, 4343, 304, 29901, 6024, 24535, 3487, 742, 525, 29880, 4850, 567, 742, 525, 6814, 29906, 29895, 742, 525, 4299, 29918, 311, 1403, 742, 525, 21813, 2033, 13, 29871, 16969, 584, 13, 1678, 6483, 3487, 29918, 27774, 29901, 8600, 13, 418, 6483, 3487, 29918, 27774, 3743, 29361, 1304, 297, 6483, 3487, 29889, 13, 1678, 301, 4850, 567, 29918, 27774, 29901, 8600, 13, 418, 301, 314, 1526, 29881, 29918, 27774, 3743, 29361, 1304, 297, 301, 4850, 567, 29889, 13, 1678, 21447, 29906, 29895, 29918, 27774, 29901, 8600, 13, 418, 21447, 29906, 29895, 29918, 27774, 3743, 29361, 1304, 297, 21447, 29906, 29895, 29889, 13, 1678, 1904, 29918, 311, 1403, 29918, 27774, 29901, 8600, 13, 418, 1904, 29918, 311, 1403, 3743, 29361, 1304, 297, 1904, 29918, 311, 1403, 29889, 13, 1678, 12471, 29918, 27774, 29901, 8600, 13, 418, 12471, 29918, 27774, 3743, 29361, 1304, 297, 5177, 29889, 13, 29871, 14550, 13, 13, 29871, 4982, 29918, 1853, 29918, 3207, 353, 1303, 29918, 2080, 29889, 15070, 29918, 3888, 29898, 1287, 29918, 3972, 29892, 297, 29886, 29918, 1445, 29892, 285, 29918, 1989, 29897, 13, 29871, 6483, 3487, 29918, 27774, 353, 4982, 29918, 1853, 29918, 3207, 29961, 29900, 29962, 13, 29871, 301, 4850, 567, 29918, 27774, 353, 4982, 29918, 1853, 29918, 3207, 29961, 29896, 29962, 13, 29871, 21447, 29906, 29895, 29918, 27774, 353, 4982, 29918, 1853, 29918, 3207, 29961, 29906, 29962, 13, 29871, 6136, 29918, 19668, 29918, 27774, 353, 4982, 29918, 1853, 29918, 3207, 29961, 29941, 29962, 13, 29871, 12471, 29918, 27774, 353, 4982, 29918, 1853, 29918, 3207, 29961, 29946, 29962, 13, 13, 29871, 736, 6483, 3487, 29918, 27774, 29892, 301, 4850, 567, 29918, 27774, 29892, 21447, 29906, 29895, 29918, 27774, 29892, 6136, 29918, 19668, 29918, 27774, 29892, 12471, 29918, 27774, 13, 13, 1753, 679, 29918, 271, 4835, 29918, 1853, 29898, 24535, 3487, 29918, 27774, 1125, 13, 13, 29871, 14550, 13, 29871, 679, 29918, 271, 4835, 29918, 1853, 29901, 679, 28422, 1134, 363, 3001, 6757, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 6483, 3487, 29918, 27774, 29901, 8600, 13, 418, 6483, 3487, 29918, 27774, 3743, 29361, 1304, 297, 6483, 3487, 29889, 13, 29871, 16969, 29901, 13, 1678, 2186, 29918, 271, 4835, 29918, 1853, 29901, 1051, 13, 418, 2186, 29918, 271, 4835, 29918, 1853, 338, 278, 28422, 1134, 363, 599, 6757, 29889, 13, 418, 8741, 29901, 6024, 29949, 742, 525, 29950, 2033, 13, 29871, 14550, 13, 13, 29871, 1053, 1196, 8173, 13, 13, 29871, 28422, 29918, 1853, 353, 5159, 13, 29871, 7945, 29918, 27774, 353, 6483, 3487, 29918, 27774, 1839, 26495, 2033, 13, 29871, 363, 1820, 297, 7945, 29918, 27774, 29901, 13, 1678, 565, 313, 525, 5205, 29915, 297, 1820, 29871, 1125, 13, 418, 1020, 29926, 29918, 1111, 536, 29918, 1445, 353, 7945, 29918, 27774, 29961, 1989, 22322, 3018, 29926, 29918, 1111, 536, 29918, 1445, 2033, 13, 418, 1196, 29918, 1949, 353, 934, 29918, 8504, 29889, 22385, 29918, 1220, 29918, 1949, 703, 29915, 29925, 4051, 934, 29915, 613, 1020, 29926, 29918, 1111, 536, 29918, 1445, 29892, 2897, 29889, 657, 29883, 9970, 3101, 13, 418, 565, 313, 1196, 29918, 1949, 1275, 29871, 29900, 29871, 1125, 13, 4706, 29311, 29918, 1445, 29918, 1853, 353, 525, 1111, 536, 29918, 20230, 29915, 13, 418, 1683, 29901, 13, 4706, 29311, 29918, 1445, 29918, 1853, 353, 525, 1111, 536, 29918, 29886, 2585, 29915, 13, 418, 28422, 29918, 1949, 29892, 758, 29918, 3188, 29918, 1271, 29892, 1095, 29918, 3188, 29918, 1271, 29892, 758, 29918, 3188, 29892, 16608, 29918, 1949, 29892, 1269, 29892, 1369, 29918, 333, 29892, 1095, 29918, 333, 29892, 931, 29918, 10568, 353, 320, 13, 418, 1020, 29926, 29918, 3888, 29889, 657, 29918, 3018, 29926, 29918, 3888, 29898, 3018, 29926, 29918, 1111, 536, 29918, 1445, 29892, 29311, 29918, 1445, 29918, 1853, 29897, 13, 418, 28422, 353, 5159, 13, 418, 363, 474, 297, 3464, 29898, 271, 4835, 29918, 1949, 1125, 13, 4706, 1196, 29918, 29875, 353, 1196, 8173, 29889, 657, 1220, 29898, 3018, 29926, 29918, 1111, 536, 29918, 1445, 29892, 758, 29918, 3188, 29974, 1457, 29918, 3188, 29918, 1271, 29974, 29875, 29974, 29896, 29897, 13, 4706, 1196, 29918, 29875, 29918, 5451, 353, 848, 29918, 459, 29889, 5451, 29918, 710, 29898, 1220, 29918, 29875, 29892, 525, 13420, 11297, 29876, 1495, 13, 4706, 565, 313, 29311, 29918, 1445, 29918, 1853, 1275, 525, 1111, 536, 29918, 20230, 29915, 29871, 1125, 13, 3986, 28422, 29889, 4397, 29898, 1220, 29918, 29875, 29918, 5451, 29961, 29900, 2314, 13, 4706, 25342, 313, 29311, 29918, 1445, 29918, 1853, 1275, 525, 1111, 536, 29918, 29886, 2585, 29915, 29871, 1125, 13, 3986, 28422, 29889, 4397, 29898, 1220, 29918, 29875, 29918, 5451, 29961, 2435, 29898, 1220, 29918, 29875, 29918, 5451, 6817, 29896, 2314, 13, 418, 1196, 8173, 29889, 8551, 8173, 580, 13, 418, 28422, 29918, 1853, 29889, 4397, 29898, 1272, 29918, 459, 29889, 1761, 29918, 3445, 5926, 29898, 271, 4835, 876, 13, 13, 29871, 2025, 29918, 271, 4835, 29918, 1853, 353, 848, 29918, 459, 29889, 1761, 29918, 690, 14443, 29898, 271, 4835, 29918, 1853, 29897, 13, 29871, 2186, 29918, 271, 4835, 29918, 1853, 353, 848, 29918, 459, 29889, 1761, 29918, 3445, 5926, 29898, 4260, 29918, 271, 4835, 29918, 1853, 29897, 13, 13, 29871, 736, 2186, 29918, 271, 4835, 29918, 1853, 13, 13, 1753, 16766, 29918, 2344, 29918, 1272, 29898, 1287, 29918, 3972, 29892, 6483, 3487, 29918, 27774, 29892, 7945, 29918, 710, 404, 29892, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 1125, 13, 13, 29871, 14550, 13, 29871, 16766, 29918, 2344, 29918, 1272, 29901, 2254, 2847, 6694, 848, 29889, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 664, 29918, 3972, 29901, 1347, 13, 418, 664, 29918, 3972, 338, 1985, 3884, 310, 28505, 29906, 29968, 29918, 7354, 29889, 13, 1678, 6483, 3487, 29918, 27774, 29901, 8600, 13, 418, 6483, 3487, 29918, 27774, 3743, 29361, 1304, 297, 6483, 3487, 29889, 13, 1678, 7945, 29918, 710, 404, 29901, 6120, 13, 418, 7945, 29918, 710, 404, 338, 3692, 591, 817, 304, 16766, 22884, 29889, 13, 1678, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 29901, 8600, 13, 418, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 338, 278, 28422, 1134, 8600, 29889, 13, 29871, 16969, 29901, 13, 1678, 2069, 29918, 14968, 29918, 1272, 29901, 29871, 29896, 29899, 29881, 1347, 1051, 13, 418, 2069, 29918, 14968, 29918, 1272, 3743, 2847, 6694, 848, 17525, 29889, 13, 1678, 2069, 29918, 1272, 29918, 1949, 584, 938, 13, 418, 2069, 29918, 1272, 29918, 1949, 338, 278, 1353, 310, 848, 363, 2847, 6694, 29889, 13, 29871, 14550, 13, 13, 29871, 2069, 29918, 14968, 29918, 1272, 29918, 3972, 353, 525, 4286, 7122, 3552, 1287, 29918, 3972, 29892, 8207, 2344, 29918, 14968, 29918, 1272, 8785, 13, 29871, 565, 313, 451, 2897, 29889, 2084, 29889, 9933, 29898, 2344, 29918, 14968, 29918, 1272, 29918, 3972, 29897, 29871, 1125, 13, 1678, 9920, 353, 376, 11256, 3972, 1273, 29879, 29908, 1273, 6702, 2344, 29918, 14968, 29918, 1272, 1495, 13, 1678, 1246, 29889, 4804, 29918, 12857, 29918, 15903, 29898, 1287, 29918, 3972, 29892, 9920, 29897, 13, 13, 29871, 474, 353, 29871, 29900, 13, 29871, 2069, 29918, 14968, 29918, 1272, 353, 5159, 13, 29871, 2069, 29918, 1272, 29918, 1949, 353, 29871, 29900, 13, 29871, 7945, 29918, 27774, 353, 6483, 3487, 29918, 27774, 1839, 26495, 2033, 13, 29871, 528, 21897, 29918, 1272, 353, 7945, 29918, 27774, 1839, 845, 21897, 29918, 1272, 2033, 13, 29871, 363, 1820, 297, 7945, 29918, 27774, 29901, 13, 1678, 565, 313, 525, 5205, 29915, 297, 1820, 1125, 13, 418, 4078, 29918, 3972, 353, 525, 4286, 7122, 3552, 1287, 29918, 3972, 29892, 8207, 2344, 29918, 14968, 29918, 1272, 29914, 1272, 29918, 742, 851, 29898, 29875, 4961, 13, 418, 565, 313, 451, 2897, 29889, 2084, 29889, 9933, 29898, 7620, 29918, 3972, 29897, 29871, 1125, 13, 4706, 9920, 353, 376, 11256, 3972, 1273, 29879, 29908, 1273, 313, 7620, 29918, 3972, 29897, 13, 4706, 1246, 29889, 4804, 29918, 12857, 29918, 15903, 29898, 1287, 29918, 3972, 29892, 9920, 29897, 13, 418, 2069, 29918, 14968, 29918, 1272, 29889, 4397, 29898, 7620, 29918, 3972, 29897, 13, 418, 9920, 353, 376, 3137, 891, 12680, 1273, 29879, 29908, 1273, 703, 29915, 842, 6169, 1159, 13, 418, 731, 29918, 3972, 29918, 978, 353, 1246, 29889, 4804, 29918, 18280, 29918, 15903, 29898, 7620, 29918, 3972, 29892, 9920, 29897, 13, 418, 3060, 2662, 29918, 1949, 353, 7945, 29918, 27774, 29961, 1989, 22322, 1859, 2662, 29918, 2557, 29918, 1949, 2033, 13, 418, 848, 29918, 1949, 353, 5159, 13, 418, 565, 313, 7431, 29898, 842, 29918, 3972, 29918, 978, 29897, 1405, 29871, 29900, 29871, 1125, 13, 4706, 363, 731, 29918, 3972, 297, 731, 29918, 3972, 29918, 978, 29901, 13, 3986, 848, 29918, 1949, 29918, 1595, 353, 5159, 13, 3986, 731, 29918, 3972, 29918, 6897, 353, 525, 4286, 7122, 3552, 7620, 29918, 3972, 29892, 8207, 742, 731, 29918, 3972, 876, 13, 3986, 29311, 29918, 29876, 2272, 29918, 1445, 353, 525, 4286, 7122, 3552, 842, 29918, 3972, 29918, 6897, 29892, 8207, 1111, 536, 29889, 29876, 2272, 8785, 13, 3986, 4889, 29918, 29876, 2272, 29918, 1445, 353, 525, 4286, 7122, 3552, 842, 29918, 3972, 29918, 6897, 29892, 8207, 10118, 29889, 29876, 2272, 8785, 13, 3986, 3800, 29918, 29876, 2272, 29918, 1445, 353, 525, 4286, 7122, 3552, 842, 29918, 3972, 29918, 6897, 29892, 8207, 1884, 29889, 29876, 2272, 8785, 13, 3986, 5864, 29918, 29876, 2272, 29918, 1445, 353, 525, 4286, 7122, 3552, 842, 29918, 3972, 29918, 6897, 29892, 8207, 27548, 29889, 29876, 2272, 8785, 13, 3986, 565, 313, 599, 29898, 359, 29889, 2084, 29889, 9933, 29898, 29876, 2272, 29918, 1445, 29897, 363, 302, 2272, 29918, 1445, 297, 518, 1111, 536, 29918, 29876, 2272, 29918, 1445, 29892, 4889, 29918, 29876, 2272, 29918, 1445, 29892, 3800, 29918, 29876, 2272, 29918, 1445, 29892, 5864, 29918, 29876, 2272, 29918, 1445, 2314, 29871, 1125, 13, 9651, 363, 302, 2272, 29918, 1445, 297, 518, 1111, 536, 29918, 29876, 2272, 29918, 1445, 29892, 4889, 29918, 29876, 2272, 29918, 1445, 29892, 3800, 29918, 29876, 2272, 29918, 1445, 29892, 5864, 29918, 29876, 2272, 29918, 1445, 5387, 13, 795, 848, 29918, 1949, 29918, 1595, 29889, 4397, 29898, 2435, 29898, 9302, 29889, 1359, 29898, 29876, 2272, 29918, 1445, 4961, 13, 3986, 1683, 29901, 13, 9651, 848, 29918, 1949, 29918, 1595, 353, 518, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 29962, 13, 3986, 3516, 9315, 29918, 29876, 2272, 29918, 1445, 353, 525, 4286, 7122, 3552, 842, 29918, 3972, 29918, 6897, 29892, 8207, 1403, 9315, 29889, 29876, 2272, 8785, 13, 3986, 565, 313, 2897, 29889, 2084, 29889, 9933, 29898, 1403, 9315, 29918, 29876, 2272, 29918, 1445, 29897, 29871, 1125, 13, 9651, 848, 29918, 1949, 29918, 1595, 29889, 4397, 29898, 2435, 29898, 9302, 29889, 1359, 29898, 1403, 9315, 29918, 29876, 2272, 29918, 1445, 4961, 13, 3986, 848, 29918, 1949, 29889, 4397, 29898, 1272, 29918, 1949, 29918, 1595, 29897, 13, 418, 1683, 29901, 13, 4706, 848, 29918, 1949, 353, 5519, 29900, 29892, 29900, 29892, 29900, 29892, 29900, 5262, 13, 418, 848, 29918, 1949, 353, 848, 29918, 459, 29889, 1202, 29918, 29906, 29881, 29918, 1761, 29898, 1272, 29918, 1949, 29897, 13, 418, 565, 313, 599, 29898, 29926, 1275, 3060, 2662, 29918, 1949, 363, 432, 297, 848, 29918, 1949, 29897, 29871, 1125, 13, 4706, 565, 313, 7431, 29898, 842, 29918, 3972, 29918, 978, 29897, 1275, 29871, 29896, 29871, 1125, 13, 3986, 2069, 29918, 1272, 29918, 1949, 29918, 1595, 353, 3060, 2662, 29918, 1949, 13, 4706, 1683, 29901, 13, 3986, 2186, 29918, 842, 29918, 3972, 29918, 6897, 353, 525, 4286, 7122, 3552, 7620, 29918, 3972, 29892, 8207, 742, 731, 29918, 3972, 29918, 978, 29961, 2435, 29898, 842, 29918, 3972, 29918, 978, 6817, 29896, 12622, 13, 3986, 2186, 29918, 27548, 29918, 29876, 2272, 29918, 1445, 353, 525, 4286, 7122, 3552, 8394, 29918, 842, 29918, 3972, 29918, 6897, 29892, 8207, 27548, 29889, 29876, 2272, 8785, 13, 3986, 2069, 29918, 1272, 29918, 1949, 29918, 1595, 353, 3060, 2662, 29918, 1949, 29899, 2435, 29898, 9302, 29889, 1359, 29898, 8394, 29918, 27548, 29918, 29876, 2272, 29918, 1445, 876, 13, 418, 1683, 29901, 13, 4706, 1020, 29926, 29918, 1853, 353, 7945, 29918, 27774, 29961, 1989, 22322, 3018, 29926, 29918, 1853, 2033, 13, 4706, 1369, 353, 7945, 29918, 27774, 29961, 1989, 22322, 2962, 29918, 2557, 2033, 13, 4706, 1095, 353, 7945, 29918, 27774, 29961, 1989, 22322, 355, 29918, 2557, 2033, 13, 4706, 5633, 353, 7945, 29918, 27774, 29961, 1989, 22322, 842, 29918, 20895, 2033, 13, 4706, 565, 313, 1020, 29926, 29918, 1853, 1275, 525, 3487, 29915, 29871, 1125, 13, 3986, 1020, 29926, 29918, 1111, 536, 29918, 1445, 353, 7945, 29918, 27774, 29961, 1989, 22322, 3018, 29926, 29918, 1111, 536, 29918, 1445, 2033, 13, 3986, 1020, 29926, 29918, 1341, 29883, 29918, 1445, 353, 7945, 29918, 27774, 29961, 1989, 22322, 3018, 29926, 29918, 1341, 29883, 29918, 1445, 2033, 13, 3986, 1020, 29926, 29918, 3729, 29918, 1445, 353, 7945, 29918, 27774, 29961, 1989, 22322, 3018, 29926, 29918, 3729, 29918, 1445, 2033, 13, 3986, 1020, 29926, 29918, 710, 404, 29918, 1445, 353, 7945, 29918, 27774, 29961, 1989, 22322, 3018, 29926, 29918, 710, 404, 29918, 1445, 2033, 13, 3986, 2254, 29918, 1272, 29889, 1359, 29918, 1272, 29918, 3166, 29918, 3972, 29898, 3018, 29926, 29918, 1111, 536, 29918, 1445, 29892, 1020, 29926, 29918, 1341, 29883, 29918, 1445, 29892, 1020, 29926, 29918, 3729, 29918, 1445, 29892, 1020, 29926, 29918, 710, 404, 29918, 1445, 29892, 320, 13, 462, 462, 539, 7945, 29918, 710, 404, 29892, 664, 29918, 3972, 29892, 4078, 29918, 3972, 29892, 1369, 29892, 1095, 29892, 3060, 2662, 29918, 1949, 29892, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 29897, 13, 4706, 25342, 313, 1020, 29926, 29918, 1853, 1275, 525, 29885, 1594, 29915, 29871, 1125, 13, 3986, 848, 29918, 3972, 353, 7945, 29918, 27774, 29961, 1989, 22322, 1272, 29918, 3972, 2033, 13, 3986, 3414, 29918, 3972, 29918, 13506, 353, 7945, 29918, 27774, 29961, 1989, 22322, 7662, 29918, 3972, 29918, 13506, 2033, 13, 3986, 410, 29926, 29918, 978, 353, 7945, 29918, 27774, 29961, 1989, 22322, 20865, 29918, 978, 2033, 13, 3986, 714, 29918, 1445, 29918, 978, 353, 7945, 29918, 27774, 29961, 1989, 22322, 449, 29918, 1445, 29918, 978, 2033, 13, 3986, 3060, 2662, 29918, 2248, 353, 848, 29918, 459, 29889, 1885, 29918, 1761, 29898, 2962, 29892, 1095, 29892, 29871, 29896, 29897, 13, 3986, 3060, 2662, 29918, 2248, 29918, 2378, 353, 7442, 29889, 2378, 29898, 1859, 2662, 29918, 2248, 29897, 13, 3986, 7442, 29889, 8172, 29889, 845, 21897, 29898, 1859, 2662, 29918, 2248, 29918, 2378, 29897, 13, 3986, 3060, 2662, 29918, 2248, 353, 1051, 29898, 1859, 2662, 29918, 2248, 29918, 2378, 29961, 29900, 29901, 1859, 2662, 29918, 1949, 2314, 13, 3986, 2254, 29918, 1272, 29889, 1359, 29918, 1272, 29918, 3166, 29918, 19570, 1445, 29898, 1272, 29918, 3972, 29892, 4078, 29918, 3972, 29892, 3414, 29918, 3972, 29918, 13506, 29892, 410, 29926, 29918, 978, 29892, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 29892, 320, 13, 462, 462, 965, 12705, 29898, 1859, 2662, 29918, 2248, 511, 714, 29918, 1445, 29918, 978, 29897, 13, 4706, 5864, 29918, 2378, 29892, 29311, 29918, 2378, 29892, 1424, 29883, 29918, 2378, 29892, 3800, 29918, 2378, 29892, 3516, 9315, 29918, 2378, 353, 2254, 29918, 1272, 29889, 949, 29918, 1610, 29918, 1272, 29898, 7620, 29918, 3972, 29897, 13, 4706, 2069, 29918, 1272, 29918, 1949, 29918, 1595, 29892, 2069, 29918, 1688, 29918, 1272, 29918, 1949, 29918, 1595, 353, 2254, 29918, 1272, 29889, 1610, 29918, 1272, 29918, 517, 29918, 842, 29898, 20895, 29892, 528, 21897, 29918, 1272, 29892, 4078, 29918, 3972, 29892, 5864, 29918, 2378, 29892, 320, 13, 462, 462, 462, 462, 18884, 29311, 29918, 2378, 29892, 1424, 29883, 29918, 2378, 29892, 3800, 29918, 2378, 29892, 3516, 9315, 29918, 2378, 29897, 13, 418, 2069, 29918, 1272, 29918, 1949, 353, 2069, 29918, 1272, 29918, 1949, 29974, 2344, 29918, 1272, 29918, 1949, 29918, 1595, 13, 418, 474, 353, 474, 29974, 29896, 13, 13, 29871, 565, 313, 525, 842, 29918, 1272, 29918, 3972, 29915, 297, 7945, 29918, 27774, 29889, 8149, 580, 29871, 1125, 13, 1678, 2069, 29918, 14968, 29918, 1272, 29889, 4397, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 14968, 29918, 27774, 1839, 842, 29918, 1272, 29918, 3972, 25901, 13, 1678, 5864, 29918, 29876, 2272, 29918, 1445, 353, 525, 4286, 7122, 3552, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 14968, 29918, 27774, 1839, 842, 29918, 1272, 29918, 3972, 2033, 511, 8207, 842, 29889, 29900, 29900, 29900, 29914, 27548, 29889, 29876, 2272, 8785, 13, 1678, 731, 29918, 1272, 29918, 1949, 353, 7431, 29898, 9302, 29889, 1359, 29898, 27548, 29918, 29876, 2272, 29918, 1445, 876, 13, 1678, 2069, 29918, 1272, 29918, 1949, 353, 2069, 29918, 1272, 29918, 1949, 29974, 842, 29918, 1272, 29918, 1949, 13, 13, 29871, 736, 2069, 29918, 14968, 29918, 1272, 29892, 2069, 29918, 1272, 29918, 1949, 13, 13, 1753, 1423, 29918, 24535, 600, 29918, 3389, 29898, 1287, 29918, 3972, 29892, 4256, 29918, 333, 1125, 13, 13, 29871, 14550, 13, 29871, 1423, 29918, 24535, 600, 29918, 3389, 29901, 1423, 278, 2734, 2106, 310, 6483, 600, 13, 13, 29871, 826, 3174, 29901, 13, 259, 664, 29918, 3972, 29901, 1347, 13, 418, 664, 29918, 3972, 338, 664, 8497, 3884, 29889, 13, 1678, 4256, 29918, 333, 29901, 938, 13, 418, 4256, 29918, 333, 338, 1857, 12541, 1353, 29889, 13, 29871, 16969, 29901, 13, 1678, 10672, 29918, 4299, 29901, 29871, 29896, 29899, 29881, 938, 1051, 13, 418, 10672, 29918, 4299, 338, 278, 1178, 310, 10672, 4733, 29889, 13, 29871, 14550, 13, 13, 29871, 7945, 29918, 3972, 353, 525, 4286, 7122, 3552, 1287, 29918, 3972, 29892, 8207, 1524, 29918, 742, 851, 29898, 1524, 29918, 333, 511, 8207, 29900, 29896, 29889, 14968, 8785, 13, 29871, 1904, 29918, 1949, 353, 679, 29918, 24535, 3487, 29918, 4299, 29918, 1949, 29898, 14968, 29918, 3972, 29897, 13, 29871, 10672, 29918, 4299, 353, 5159, 13, 29871, 363, 474, 297, 3464, 29898, 4299, 29918, 1949, 1125, 13, 1678, 1904, 29918, 3972, 353, 525, 4286, 7122, 3552, 14968, 29918, 3972, 29892, 8207, 742, 851, 29898, 29875, 4961, 13, 1678, 301, 2764, 345, 29918, 1445, 353, 525, 4286, 7122, 3552, 4299, 29918, 3972, 29892, 8207, 29880, 2764, 345, 29889, 449, 8785, 13, 1678, 3353, 29918, 1220, 29918, 1949, 353, 7431, 29898, 3150, 29898, 29880, 2764, 345, 29918, 1445, 467, 949, 9012, 3101, 13, 1678, 3060, 2662, 29918, 1220, 29918, 1949, 353, 938, 29898, 29900, 29889, 29896, 29930, 15970, 280, 29918, 1220, 29918, 1949, 29897, 13, 1678, 1369, 29918, 1220, 353, 3353, 29918, 1220, 29918, 1949, 29899, 1859, 2662, 29918, 1220, 29918, 1949, 13, 1678, 4889, 29918, 509, 29876, 353, 5159, 13, 1678, 363, 432, 297, 3464, 29898, 1859, 2662, 29918, 1220, 29918, 1949, 1125, 13, 418, 1196, 353, 1196, 8173, 29889, 657, 1220, 29898, 29880, 2764, 345, 29918, 1445, 29892, 1369, 29918, 1220, 29974, 29926, 29974, 29896, 29897, 13, 418, 1196, 29918, 5451, 353, 848, 29918, 459, 29889, 5451, 29918, 710, 29898, 1220, 29892, 525, 25710, 13, 418, 565, 313, 848, 29918, 459, 29889, 14513, 29918, 710, 29898, 1220, 29918, 5451, 29961, 29900, 2314, 1275, 29871, 29896, 322, 7431, 29898, 1220, 29918, 5451, 29897, 6736, 29871, 29947, 29871, 1125, 13, 4706, 4889, 29918, 509, 29876, 29889, 4397, 29898, 7411, 29898, 1220, 29918, 5451, 29961, 29953, 12622, 13, 1678, 1196, 8173, 29889, 8551, 8173, 580, 13, 1678, 4889, 29918, 3317, 353, 4236, 29898, 10118, 29918, 509, 29876, 29897, 13, 1678, 4889, 29918, 1195, 353, 1375, 29898, 10118, 29918, 509, 29876, 29897, 13, 1678, 4889, 29918, 485, 29887, 353, 7442, 29889, 12676, 29898, 9302, 29889, 2378, 29898, 10118, 29918, 509, 29876, 876, 13, 1678, 565, 313, 5135, 10118, 29918, 3317, 29899, 10118, 29918, 1195, 29897, 6736, 29871, 29900, 29889, 29900, 29946, 322, 4889, 29918, 3317, 6736, 29871, 29900, 29889, 29900, 29947, 29897, 470, 4889, 29918, 485, 29887, 6736, 29871, 29900, 29889, 29900, 29947, 29871, 1125, 13, 418, 10672, 29918, 4299, 29889, 4397, 29898, 29875, 29897, 13, 13, 29871, 736, 10672, 29918, 4299, 13, 13, 1753, 679, 29918, 3487, 29918, 9675, 29918, 3888, 29898, 29880, 1526, 29918, 27774, 29892, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 1125, 13, 13, 29871, 14550, 13, 29871, 679, 29918, 3487, 29918, 9675, 29918, 3888, 29901, 679, 278, 1788, 2472, 363, 301, 4850, 567, 22821, 29889, 13, 13, 29871, 826, 3174, 29901, 13, 1678, 301, 1526, 29918, 27774, 29901, 8600, 13, 418, 301, 1526, 29918, 27774, 3743, 4128, 363, 301, 4850, 567, 29889, 13, 1678, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 29901, 8600, 13, 418, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 338, 278, 28422, 1134, 8600, 29889, 13, 29871, 16969, 29901, 13, 1678, 10876, 29918, 1949, 29901, 938, 13, 418, 10876, 29918, 1949, 338, 278, 1353, 310, 6757, 29889, 13, 1678, 28422, 29918, 1853, 29918, 9910, 29918, 9675, 29901, 29871, 29906, 29899, 29881, 8600, 29892, 3964, 353, 313, 1949, 310, 301, 4850, 567, 6757, 29897, 334, 313, 1949, 310, 12301, 4072, 29897, 13, 418, 28422, 29918, 1853, 29918, 9910, 29918, 9675, 338, 278, 28422, 1134, 363, 2473, 29899, 5205, 29879, 29889, 13, 418, 1342, 29901, 426, 29900, 29901, 10998, 29949, 2396, 29896, 5501, 29950, 2396, 29906, 5501, 29940, 2396, 29941, 1118, 29896, 29901, 10998, 29949, 2396, 29896, 5501, 29903, 2396, 29906, 5501, 29940, 2396, 29941, 930, 13, 1678, 28422, 29918, 1949, 29918, 4260, 29901, 8600, 13, 418, 28422, 29918, 1949, 29918, 4260, 3743, 1353, 310, 28422, 363, 1422, 6757, 29889, 13, 418, 8741, 29901, 426, 29900, 29901, 29941, 29892, 29871, 29896, 29901, 29941, 29913, 13, 1678, 671, 29918, 29885, 1594, 29918, 4260, 29901, 6120, 13, 418, 671, 29918, 29885, 1594, 29918, 4260, 338, 377, 621, 300, 773, 1539, 328, 2926, 1199, 363, 3353, 6757, 29889, 13, 29871, 14550, 13, 13, 29871, 28422, 29918, 1853, 29918, 9910, 29918, 9675, 353, 5159, 13, 29871, 28422, 29918, 1949, 29918, 4260, 353, 5159, 13, 29871, 671, 29918, 29885, 1594, 29918, 4260, 353, 5159, 13, 29871, 10876, 29918, 1949, 353, 29871, 29900, 13, 29871, 363, 1820, 297, 301, 1526, 29918, 27774, 29901, 13, 1678, 565, 525, 5205, 29915, 297, 1820, 29901, 13, 418, 10876, 29918, 1949, 353, 10876, 29918, 1949, 718, 29871, 29896, 13, 13, 29871, 363, 474, 297, 3464, 29898, 9675, 29918, 1949, 1125, 13, 1678, 10876, 353, 525, 5205, 29915, 718, 851, 29898, 29875, 29897, 13, 1678, 3800, 29918, 1445, 29918, 978, 353, 301, 1526, 29918, 27774, 29961, 9675, 22322, 1884, 2033, 13, 1678, 29311, 29918, 1445, 29918, 978, 353, 301, 1526, 29918, 27774, 29961, 9675, 22322, 1111, 536, 2033, 13, 1678, 671, 29918, 29885, 1594, 353, 301, 1526, 29918, 27774, 29961, 9675, 22322, 1509, 29918, 29885, 1594, 2033, 13, 1678, 3367, 29918, 3729, 29918, 2003, 29892, 28422, 29892, 921, 29892, 343, 29892, 503, 353, 2531, 29918, 29880, 4850, 567, 29918, 7662, 29889, 657, 29918, 1884, 29918, 1111, 536, 29898, 1884, 29918, 1445, 29918, 978, 29892, 29311, 29918, 1445, 29918, 978, 29897, 13, 1678, 28422, 29918, 1853, 353, 848, 29918, 459, 29889, 1761, 29918, 3445, 5926, 29898, 271, 4835, 29897, 13, 1678, 28422, 29918, 1853, 29918, 27774, 353, 8170, 287, 21533, 580, 13, 1678, 363, 432, 297, 28422, 29918, 1853, 29901, 13, 418, 565, 432, 297, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 29889, 8149, 7295, 13, 4706, 28422, 29918, 1853, 29918, 27774, 29961, 29926, 29962, 353, 2025, 29918, 271, 4835, 29918, 1853, 29918, 27774, 29961, 29926, 10062, 29896, 13, 418, 1683, 29901, 13, 4706, 1480, 29918, 3888, 29889, 1188, 29918, 2704, 877, 4290, 1059, 29901, 1273, 29879, 12301, 1134, 297, 1788, 1273, 29881, 338, 451, 16370, 29892, 3113, 1423, 6483, 600, 29914, 29880, 4850, 567, 29914, 5205, 29915, 1273, 29898, 29926, 29892, 474, 876, 13, 4706, 6876, 580, 13, 1678, 28422, 29918, 1853, 29918, 9910, 29918, 9675, 29889, 4397, 29898, 271, 4835, 29918, 1853, 29918, 27774, 29897, 13, 1678, 28422, 29918, 1949, 29918, 4260, 29889, 4397, 29898, 2435, 29898, 271, 4835, 876, 13, 1678, 671, 29918, 29885, 1594, 29918, 4260, 29889, 4397, 29898, 1509, 29918, 29885, 1594, 29897, 13, 13, 29871, 736, 10876, 29918, 1949, 29892, 28422, 29918, 1853, 29918, 9910, 29918, 9675, 29892, 28422, 29918, 1949, 29918, 4260, 29892, 671, 29918, 29885, 1594, 29918, 4260, 13, 2 ]
project/evaluate/views.py
ktzoulas/stateless-password-manager
0
47157
""" Contains the views of the 'evaluate' blueprint. """ # pylint: disable=invalid-name from flask import Blueprint, render_template, request from project.evaluate.forms import EvaluateForm from project.evaluate.helpers import evaluate_pass evaluate_blueprint = Blueprint('evaluate', __name__, url_prefix='/evaluate') @evaluate_blueprint.route('/', methods=['GET', 'POST']) def index(): """ TODO: add function docstring""" power = None form = EvaluateForm(request.form) if form.validate_on_submit(): if form.password.data is not None and form.password.data != '': power = evaluate_pass(form.password.data) return render_template('evaluate/index.html', form=form, power=power, breadcrumb=(('Home', 'main.index'), 'Evaluate')) return render_template('evaluate/index.html', form=form, breadcrumb=(('Home', 'main.index'), 'Evaluate'))
[ 1, 9995, 13, 1678, 2866, 2708, 278, 8386, 310, 278, 525, 24219, 403, 29915, 7254, 2158, 29889, 13, 15945, 29908, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 20965, 29899, 978, 13, 13, 3166, 29784, 1053, 10924, 2158, 29892, 4050, 29918, 6886, 29892, 2009, 13, 3166, 2060, 29889, 24219, 403, 29889, 9514, 1053, 382, 4387, 403, 2500, 13, 3166, 2060, 29889, 24219, 403, 29889, 3952, 6774, 1053, 14707, 29918, 3364, 13, 13, 24219, 403, 29918, 9539, 2158, 353, 10924, 2158, 877, 24219, 403, 742, 4770, 978, 1649, 29892, 3142, 29918, 13506, 2433, 29914, 24219, 403, 1495, 13, 13, 13, 29992, 24219, 403, 29918, 9539, 2158, 29889, 13134, 11219, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 11287, 13, 1753, 2380, 7295, 13, 1678, 9995, 14402, 29901, 788, 740, 1574, 1807, 15945, 29908, 13, 1678, 3081, 353, 6213, 13, 1678, 883, 353, 382, 4387, 403, 2500, 29898, 3827, 29889, 689, 29897, 13, 1678, 565, 883, 29889, 15480, 29918, 265, 29918, 7892, 7295, 13, 4706, 565, 883, 29889, 5630, 29889, 1272, 338, 451, 6213, 322, 883, 29889, 5630, 29889, 1272, 2804, 525, 2396, 13, 9651, 3081, 353, 14707, 29918, 3364, 29898, 689, 29889, 5630, 29889, 1272, 29897, 13, 13, 4706, 736, 4050, 29918, 6886, 877, 24219, 403, 29914, 2248, 29889, 1420, 742, 883, 29922, 689, 29892, 3081, 29922, 13519, 29892, 13, 462, 1669, 18423, 7283, 3774, 7607, 877, 11184, 742, 525, 3396, 29889, 2248, 5477, 525, 29923, 4387, 403, 8785, 13, 13, 1678, 736, 4050, 29918, 6886, 877, 24219, 403, 29914, 2248, 29889, 1420, 742, 883, 29922, 689, 29892, 13, 462, 965, 18423, 7283, 3774, 7607, 877, 11184, 742, 525, 3396, 29889, 2248, 5477, 525, 29923, 4387, 403, 8785, 13, 2 ]
iologik/e2210.py
shannon-jia/iologik
0
15627
import aiohttp import asyncio import async_timeout import logging from collections import namedtuple, deque from .events import Events from html.parser import HTMLParser log = logging.getLogger(__name__) class Parser(HTMLParser): def handle_starttag(self, tag, attrs): log.debug("Encountered a start tag: {}".format(tag)) def handle_endtag(self, tag): log.debug("Encountered an end tag : {}".format(tag)) def handle_data(self, data): log.debug("Encountered some data : {}".format(data)) if self.callback: self.callback(data) def set_callback(self, callback): self.callback = callback class E2210(object): ''' Moxa iologik E2210 module 12 inputs and 8 outputs ''' MAX_INPUTS = 12 MAX_OUTPUTS = 8 GET_PATH = 'getParam.cgi' SET_PATH = 'setParam.cgi' SYS_INFO = ['DATE', 'TIME', 'IP', 'LOC', 'DESC', 'FWR_V', 'MOD_NAME', 'SN_NUM', 'MAC_ADDR'] def __init__(self, loop, url=None, events=None, line=0, addr=1, handle_events=None): self.loop = loop or None self.url = url self.line = line self.addr = addr self.events = events or Events() self.parser = Parser() self.parser.set_callback(self.received) self.handle_events = handle_events self.connection = None self.changed = True self.fail = True self.command = namedtuple('Command', 'name method params completed') self.setting = {'System': {}, 'DIMode': ['DI' for i in range(self.MAX_INPUTS)], 'DIStatus': [0 for i in range(self.MAX_INPUTS)], 'DIFilter': [200 for i in range(self.MAX_INPUTS)], 'DOMode': ['DO' for i in range(self.MAX_OUTPUTS)], 'DOStatus': [1 for i in range(self.MAX_OUTPUTS)] } self.CMDS = { 'get_sys_info': ('get', '&'.join(['{}=?'.format(i) for i in self.SYS_INFO])), 'get_di_mode': ('get', '&'.join(['DIMode_{:02d}=?'.format(i) for i in range(self.MAX_INPUTS)])), 'set_di_mode': ('set', '&'.join(['DIMode_{:02d}=0'.format(i) for i in range(self.MAX_INPUTS)])), 'get_di_status': ('get', '&'.join(['DIStatus_{:02d}=?'.format(i) for i in range(self.MAX_INPUTS)])), 'set_di_filter_low': ('set', '&'.join(['DIFilter_{:02d}={}'.format(i, self.setting['DIFilter'][i]) for i in range(0, self.MAX_OUTPUTS//2)])), 'set_di_filter_high': ('set', '&'.join(['DIFilter_{:02d}={}'.format(i, self.setting['DIFilter'][i]) for i in range(self.MAX_OUTPUTS//2, self.MAX_OUTPUTS)])), 'get_do_mode': ('get', '&'.join(['DOMode_{:02d}=?'.format(i) for i in range(self.MAX_OUTPUTS)])), 'set_do_mode': ('set', '&'.join(['DOMode_{:02d}=0'.format(i) for i in range(self.MAX_OUTPUTS)])), 'get_do_status': ('get', '&'.join(['DOStatus_{:02d}=?'.format(i) for i in range(self.MAX_OUTPUTS)])), 'set_do_status': ('set', '&'.join(['DOStatus_{:02d}=1'.format(i) for i in range(self.MAX_OUTPUTS)])), } self.cmd_deque = deque() for name in self.CMDS: self.append_cmd(name) # start to poll http server self.restart_poll() def poll(self): pass def do_output(self, addr, which, action, deadtime): if which >= self.MAX_OUTPUTS or which < 0: return status = (action == 'Activate' and 0 or 1) params = 'DOStatus_{:02d}={}'.format(which, status) self.cmd_deque.appendleft(self.command('do_outputs', 'set', params, False)) def append_cmd(self, cmd_name=None): cmd = self.CMDS.get(cmd_name) if cmd: self.cmd_deque.append(self.command(cmd_name, cmd[0], cmd[1], False)) def received(self, data): log.debug("Encountered some data : {}".format(data)) l = data.split('=') if len(l) != 2: return reg = l[0] val = l[1] if reg in self.SYS_INFO: self.setting['System'][reg] = val elif reg.startswith('DIMode'): n = int(reg.split('_')[1]) if n < 0 or n >= self.MAX_INPUTS: return self.setting['DIMode'][n] = (val == '0' and 'DI' or 'COUNTER') elif reg.startswith('DIStatus'): n = int(reg.split('_')[1]) if n < 0 or n >= self.MAX_INPUTS: return self.setting['DIStatus'][n] = (val == '0' and 'ALARM' or 'NORMAL') event_type = 'Auxiliary Input' event = 'MXI_{}_{}_{}'.format(self.line, self.addr, n) condition = (val == '0' and True or False) self.events.append(event, event_type, condition) elif reg.startswith('DIFilter'): n = int(reg.split('_')[1]) if n < 0 or n >= self.MAX_INPUTS: return self.setting['DIFilter'][n] = int(val) elif reg.startswith('DOMode'): n = int(reg.split('_')[1]) if n < 0 or n >= self.MAX_OUTPUTS: return self.setting['DOMode'][n] = (val == '0' and 'DO' or 'PULSE') elif reg.startswith('DOStatus'): n = int(reg.split('_')[1]) if n < 0 or n >= self.MAX_OUTPUTS: return self.setting['DOStatus'][n] = (val == '0' and 'OFF' or 'ON') else: log.warn("Do not care it: {}".format(data)) def processor(self): if not self.events: return if callable(self.handle_events): return self.handle_events(self.events) else: log.warn('No master to processor {}'.format(self.events)) def restart_poll(self): asyncio.ensure_future(self.loop_polling()) async def _fetch(self, params, method='get'): endpoint = (method == 'get' and self.GET_PATH or self.SET_PATH) async with aiohttp.ClientSession() as session: with async_timeout.timeout(20): async with session.get('{}/{}?{}'.format(self.url, endpoint, params)) as response: if response.status >= 200 and response.status <= 300: self.parser.feed(await response.text()) async def _request(self): try: self.cmd = self.cmd_deque.popleft() except IndexError: self.append_cmd('get_di_status') self.append_cmd('get_do_status') self.cmd = self.cmd_deque.popleft() log.debug('Request: {}'.format(self.cmd.name)) x = await self._fetch(self.cmd.params, method=self.cmd.method) async def loop_polling(self): try: while True: try: await self._request() self.connection = True self.processor() except Exception as err: log.error("Cmd {} failed, with Error: {} " "Will retry in {} seconds" .format(self.cmd.name, err, 10)) self.connection = False if self.connection is not True: self.changed = True self.cmd_deque.append(self.cmd) self.fail = True await asyncio.sleep(10) else: self.changed = False self.fail = False log.info("{} Successfully requested. ".format(self.cmd.name)) # poll connection state every 1s await asyncio.sleep(0.5) except asyncio.CancelledError: self.connection = False except Exception as err: log.error("Failed to access http server with Error: {}".format(err)) self.connection = False
[ 1, 1053, 263, 601, 1124, 13, 5215, 408, 948, 3934, 13, 5215, 7465, 29918, 15619, 13, 5215, 12183, 13, 3166, 16250, 1053, 4257, 23583, 29892, 316, 802, 13, 3166, 869, 13604, 1053, 28488, 13, 13, 3166, 3472, 29889, 16680, 1053, 4544, 11726, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 1990, 1459, 643, 29898, 7020, 11726, 1125, 13, 1678, 822, 4386, 29918, 2962, 4039, 29898, 1311, 29892, 4055, 29892, 12421, 29879, 1125, 13, 4706, 1480, 29889, 8382, 703, 8566, 5336, 287, 263, 1369, 4055, 29901, 6571, 1642, 4830, 29898, 4039, 876, 13, 13, 1678, 822, 4386, 29918, 355, 4039, 29898, 1311, 29892, 4055, 1125, 13, 4706, 1480, 29889, 8382, 703, 8566, 5336, 287, 385, 1095, 4055, 584, 6571, 1642, 4830, 29898, 4039, 876, 13, 13, 1678, 822, 4386, 29918, 1272, 29898, 1311, 29892, 848, 1125, 13, 4706, 1480, 29889, 8382, 703, 8566, 5336, 287, 777, 848, 584, 6571, 1642, 4830, 29898, 1272, 876, 13, 4706, 565, 1583, 29889, 14035, 29901, 13, 9651, 1583, 29889, 14035, 29898, 1272, 29897, 13, 13, 1678, 822, 731, 29918, 14035, 29898, 1311, 29892, 6939, 1125, 13, 4706, 1583, 29889, 14035, 353, 6939, 13, 13, 13, 1990, 382, 29906, 29906, 29896, 29900, 29898, 3318, 1125, 13, 1678, 14550, 341, 2251, 29874, 474, 1189, 638, 382, 29906, 29906, 29896, 29900, 3883, 13, 308, 29896, 29906, 10970, 322, 29871, 29947, 14391, 13, 1678, 14550, 13, 13, 1678, 18134, 29918, 1177, 12336, 29903, 353, 29871, 29896, 29906, 13, 1678, 18134, 29918, 12015, 12336, 29903, 353, 29871, 29947, 13, 1678, 12354, 29918, 10145, 353, 525, 657, 4736, 29889, 20006, 29915, 13, 1678, 11368, 29918, 10145, 353, 525, 842, 4736, 29889, 20006, 29915, 13, 1678, 317, 21554, 29918, 11690, 353, 6024, 6248, 742, 525, 15307, 742, 525, 5690, 742, 525, 16652, 742, 525, 2287, 7187, 742, 13, 18884, 525, 29943, 9980, 29918, 29963, 742, 525, 6720, 29928, 29918, 5813, 742, 525, 19296, 29918, 13967, 742, 525, 1529, 29907, 29918, 3035, 8353, 2033, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2425, 29892, 13, 462, 3142, 29922, 8516, 29892, 13, 462, 4959, 29922, 8516, 29892, 13, 462, 1196, 29922, 29900, 29892, 13, 462, 28915, 29922, 29896, 29892, 13, 462, 4386, 29918, 13604, 29922, 8516, 1125, 13, 4706, 1583, 29889, 7888, 353, 2425, 470, 6213, 13, 4706, 1583, 29889, 2271, 353, 3142, 13, 4706, 1583, 29889, 1220, 353, 1196, 13, 4706, 1583, 29889, 10030, 353, 28915, 13, 4706, 1583, 29889, 13604, 353, 4959, 470, 28488, 580, 13, 4706, 1583, 29889, 16680, 353, 1459, 643, 580, 13, 4706, 1583, 29889, 16680, 29889, 842, 29918, 14035, 29898, 1311, 29889, 13556, 2347, 29897, 13, 4706, 1583, 29889, 8411, 29918, 13604, 353, 4386, 29918, 13604, 13, 4706, 1583, 29889, 9965, 353, 6213, 13, 4706, 1583, 29889, 15033, 353, 5852, 13, 4706, 1583, 29889, 14057, 353, 5852, 13, 4706, 1583, 29889, 6519, 353, 4257, 23583, 877, 6255, 742, 525, 978, 1158, 8636, 8676, 1495, 13, 4706, 1583, 29889, 26740, 353, 11117, 3924, 2396, 24335, 13, 462, 4706, 525, 4571, 6818, 2396, 6024, 4571, 29915, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 1177, 12336, 29903, 29897, 1402, 13, 462, 4706, 525, 4571, 5709, 2396, 518, 29900, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 1177, 12336, 29903, 29897, 1402, 13, 462, 4706, 525, 4571, 5072, 2396, 518, 29906, 29900, 29900, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 1177, 12336, 29903, 29897, 1402, 13, 462, 4706, 525, 3970, 6818, 2396, 6024, 3970, 29915, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 12015, 12336, 29903, 29897, 1402, 13, 462, 4706, 525, 3970, 5709, 2396, 518, 29896, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 12015, 12336, 29903, 4638, 13, 462, 4706, 500, 13, 4706, 1583, 29889, 29907, 5773, 29903, 353, 426, 13, 9651, 525, 657, 29918, 9675, 29918, 3888, 2396, 6702, 657, 742, 13, 462, 632, 525, 29987, 4286, 7122, 18959, 29912, 5369, 29973, 4286, 4830, 29898, 29875, 29897, 363, 474, 297, 1583, 29889, 14816, 29903, 29918, 11690, 2314, 511, 13, 9651, 525, 657, 29918, 6051, 29918, 8513, 2396, 6702, 657, 742, 13, 462, 9651, 525, 29987, 4286, 7122, 18959, 4571, 6818, 648, 29901, 29900, 29906, 29881, 5369, 29973, 4286, 4830, 29898, 29875, 29897, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 1177, 12336, 29903, 29897, 2314, 511, 13, 9651, 525, 842, 29918, 6051, 29918, 8513, 2396, 6702, 842, 742, 13, 462, 9651, 525, 29987, 4286, 7122, 18959, 4571, 6818, 648, 29901, 29900, 29906, 29881, 5369, 29900, 4286, 4830, 29898, 29875, 29897, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 1177, 12336, 29903, 29897, 2314, 511, 13, 9651, 525, 657, 29918, 6051, 29918, 4882, 2396, 6702, 657, 742, 13, 462, 9651, 525, 29987, 4286, 7122, 18959, 4571, 5709, 648, 29901, 29900, 29906, 29881, 5369, 29973, 4286, 4830, 29898, 29875, 29897, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 1177, 12336, 29903, 29897, 2314, 511, 13, 9651, 525, 842, 29918, 6051, 29918, 4572, 29918, 677, 2396, 6702, 842, 742, 13, 462, 462, 29871, 525, 29987, 4286, 7122, 18959, 4571, 5072, 648, 29901, 29900, 29906, 29881, 29913, 3790, 29913, 4286, 4830, 29898, 29875, 29892, 1583, 29889, 26740, 1839, 4571, 5072, 2033, 29961, 29875, 2314, 363, 474, 297, 3464, 29898, 29900, 29892, 1583, 29889, 12648, 29918, 12015, 12336, 29903, 458, 29906, 29897, 2314, 511, 13, 9651, 525, 842, 29918, 6051, 29918, 4572, 29918, 9812, 2396, 6702, 842, 742, 13, 462, 462, 29871, 525, 29987, 4286, 7122, 18959, 4571, 5072, 648, 29901, 29900, 29906, 29881, 29913, 3790, 29913, 4286, 4830, 29898, 29875, 29892, 1583, 29889, 26740, 1839, 4571, 5072, 2033, 29961, 29875, 2314, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 12015, 12336, 29903, 458, 29906, 29892, 1583, 29889, 12648, 29918, 12015, 12336, 29903, 29897, 2314, 511, 13, 13, 9651, 525, 657, 29918, 1867, 29918, 8513, 2396, 6702, 657, 742, 13, 462, 9651, 525, 29987, 4286, 7122, 18959, 3970, 6818, 648, 29901, 29900, 29906, 29881, 5369, 29973, 4286, 4830, 29898, 29875, 29897, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 12015, 12336, 29903, 29897, 2314, 511, 13, 9651, 525, 842, 29918, 1867, 29918, 8513, 2396, 6702, 842, 742, 13, 462, 9651, 525, 29987, 4286, 7122, 18959, 3970, 6818, 648, 29901, 29900, 29906, 29881, 5369, 29900, 4286, 4830, 29898, 29875, 29897, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 12015, 12336, 29903, 29897, 2314, 511, 13, 9651, 525, 657, 29918, 1867, 29918, 4882, 2396, 6702, 657, 742, 13, 462, 9651, 525, 29987, 4286, 7122, 18959, 3970, 5709, 648, 29901, 29900, 29906, 29881, 5369, 29973, 4286, 4830, 29898, 29875, 29897, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 12015, 12336, 29903, 29897, 2314, 511, 13, 9651, 525, 842, 29918, 1867, 29918, 4882, 2396, 6702, 842, 742, 13, 462, 9651, 525, 29987, 4286, 7122, 18959, 3970, 5709, 648, 29901, 29900, 29906, 29881, 5369, 29896, 4286, 4830, 29898, 29875, 29897, 363, 474, 297, 3464, 29898, 1311, 29889, 12648, 29918, 12015, 12336, 29903, 29897, 2314, 511, 13, 9651, 500, 13, 13, 4706, 1583, 29889, 9006, 29918, 311, 802, 353, 316, 802, 580, 13, 4706, 363, 1024, 297, 1583, 29889, 29907, 5773, 29903, 29901, 13, 9651, 1583, 29889, 4397, 29918, 9006, 29898, 978, 29897, 13, 13, 4706, 396, 1369, 304, 21180, 1732, 1923, 13, 4706, 1583, 29889, 5060, 442, 29918, 29886, 3028, 580, 13, 13, 1678, 822, 21180, 29898, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 822, 437, 29918, 4905, 29898, 1311, 29892, 28915, 29892, 607, 29892, 3158, 29892, 7123, 2230, 1125, 13, 4706, 565, 607, 6736, 1583, 29889, 12648, 29918, 12015, 12336, 29903, 470, 607, 529, 29871, 29900, 29901, 13, 9651, 736, 13, 4706, 4660, 353, 313, 2467, 1275, 525, 21786, 403, 29915, 322, 29871, 29900, 470, 29871, 29896, 29897, 13, 4706, 8636, 353, 525, 3970, 5709, 648, 29901, 29900, 29906, 29881, 29913, 3790, 29913, 4286, 4830, 29898, 4716, 29892, 4660, 29897, 13, 4706, 1583, 29889, 9006, 29918, 311, 802, 29889, 4397, 1563, 29898, 1311, 29889, 6519, 877, 1867, 29918, 4905, 29879, 742, 13, 462, 462, 1669, 525, 842, 742, 8636, 29892, 7700, 876, 13, 13, 13, 1678, 822, 9773, 29918, 9006, 29898, 1311, 29892, 9920, 29918, 978, 29922, 8516, 1125, 13, 4706, 9920, 353, 1583, 29889, 29907, 5773, 29903, 29889, 657, 29898, 9006, 29918, 978, 29897, 13, 4706, 565, 9920, 29901, 13, 9651, 1583, 29889, 9006, 29918, 311, 802, 29889, 4397, 29898, 1311, 29889, 6519, 29898, 9006, 29918, 978, 29892, 13, 462, 462, 1669, 9920, 29961, 29900, 1402, 9920, 29961, 29896, 1402, 7700, 876, 13, 13, 13, 1678, 822, 4520, 29898, 1311, 29892, 848, 1125, 13, 4706, 1480, 29889, 8382, 703, 8566, 5336, 287, 777, 848, 584, 6571, 1642, 4830, 29898, 1272, 876, 13, 4706, 301, 353, 848, 29889, 5451, 877, 29922, 1495, 13, 4706, 565, 7431, 29898, 29880, 29897, 2804, 29871, 29906, 29901, 13, 9651, 736, 13, 4706, 1072, 353, 301, 29961, 29900, 29962, 13, 4706, 659, 353, 301, 29961, 29896, 29962, 13, 4706, 565, 1072, 297, 1583, 29889, 14816, 29903, 29918, 11690, 29901, 13, 9651, 1583, 29889, 26740, 1839, 3924, 2033, 29961, 1727, 29962, 353, 659, 13, 4706, 25342, 1072, 29889, 27382, 2541, 877, 4571, 6818, 29374, 13, 9651, 302, 353, 938, 29898, 1727, 29889, 5451, 877, 29918, 29861, 29896, 2314, 13, 9651, 565, 302, 529, 29871, 29900, 470, 302, 6736, 1583, 29889, 12648, 29918, 1177, 12336, 29903, 29901, 13, 18884, 736, 13, 9651, 1583, 29889, 26740, 1839, 4571, 6818, 2033, 29961, 29876, 29962, 353, 313, 791, 1275, 525, 29900, 29915, 322, 525, 4571, 29915, 470, 525, 3217, 3904, 4945, 1495, 13, 4706, 25342, 1072, 29889, 27382, 2541, 877, 4571, 5709, 29374, 13, 9651, 302, 353, 938, 29898, 1727, 29889, 5451, 877, 29918, 29861, 29896, 2314, 13, 9651, 565, 302, 529, 29871, 29900, 470, 302, 6736, 1583, 29889, 12648, 29918, 1177, 12336, 29903, 29901, 13, 18884, 736, 13, 9651, 1583, 29889, 26740, 1839, 4571, 5709, 2033, 29961, 29876, 29962, 353, 313, 791, 1275, 525, 29900, 29915, 322, 525, 1964, 1718, 29924, 29915, 470, 525, 29940, 1955, 1529, 29931, 1495, 13, 9651, 1741, 29918, 1853, 353, 525, 29909, 1314, 2638, 653, 10567, 29915, 13, 9651, 1741, 353, 525, 29924, 29990, 29902, 648, 3227, 3227, 29913, 4286, 4830, 29898, 1311, 29889, 1220, 29892, 1583, 29889, 10030, 29892, 302, 29897, 13, 9651, 4195, 353, 313, 791, 1275, 525, 29900, 29915, 322, 5852, 470, 7700, 29897, 13, 9651, 1583, 29889, 13604, 29889, 4397, 29898, 3696, 29892, 1741, 29918, 1853, 29892, 4195, 29897, 13, 4706, 25342, 1072, 29889, 27382, 2541, 877, 4571, 5072, 29374, 13, 9651, 302, 353, 938, 29898, 1727, 29889, 5451, 877, 29918, 29861, 29896, 2314, 13, 9651, 565, 302, 529, 29871, 29900, 470, 302, 6736, 1583, 29889, 12648, 29918, 1177, 12336, 29903, 29901, 13, 18884, 736, 13, 9651, 1583, 29889, 26740, 1839, 4571, 5072, 2033, 29961, 29876, 29962, 353, 938, 29898, 791, 29897, 13, 4706, 25342, 1072, 29889, 27382, 2541, 877, 3970, 6818, 29374, 13, 9651, 302, 353, 938, 29898, 1727, 29889, 5451, 877, 29918, 29861, 29896, 2314, 13, 9651, 565, 302, 529, 29871, 29900, 470, 302, 6736, 1583, 29889, 12648, 29918, 12015, 12336, 29903, 29901, 13, 18884, 736, 13, 9651, 1583, 29889, 26740, 1839, 3970, 6818, 2033, 29961, 29876, 29962, 353, 313, 791, 1275, 525, 29900, 29915, 322, 525, 3970, 29915, 470, 525, 7056, 29931, 1660, 1495, 13, 4706, 25342, 1072, 29889, 27382, 2541, 877, 3970, 5709, 29374, 13, 9651, 302, 353, 938, 29898, 1727, 29889, 5451, 877, 29918, 29861, 29896, 2314, 13, 9651, 565, 302, 529, 29871, 29900, 470, 302, 6736, 1583, 29889, 12648, 29918, 12015, 12336, 29903, 29901, 13, 18884, 736, 13, 9651, 1583, 29889, 26740, 1839, 3970, 5709, 2033, 29961, 29876, 29962, 353, 313, 791, 1275, 525, 29900, 29915, 322, 525, 27681, 29915, 470, 525, 1164, 1495, 13, 4706, 1683, 29901, 13, 9651, 1480, 29889, 25442, 703, 6132, 451, 2562, 372, 29901, 6571, 1642, 4830, 29898, 1272, 876, 13, 13, 13, 1678, 822, 21433, 29898, 1311, 1125, 13, 4706, 565, 451, 1583, 29889, 13604, 29901, 13, 9651, 736, 13, 4706, 565, 1246, 519, 29898, 1311, 29889, 8411, 29918, 13604, 1125, 13, 9651, 736, 1583, 29889, 8411, 29918, 13604, 29898, 1311, 29889, 13604, 29897, 13, 4706, 1683, 29901, 13, 9651, 1480, 29889, 25442, 877, 3782, 5835, 304, 21433, 6571, 4286, 4830, 29898, 1311, 29889, 13604, 876, 13, 13, 1678, 822, 10715, 29918, 29886, 3028, 29898, 1311, 1125, 13, 4706, 408, 948, 3934, 29889, 7469, 29918, 29888, 9130, 29898, 1311, 29889, 7888, 29918, 3733, 1847, 3101, 13, 13, 1678, 7465, 822, 903, 9155, 29898, 1311, 29892, 8636, 29892, 1158, 2433, 657, 29374, 13, 4706, 16248, 353, 313, 5696, 1275, 525, 657, 29915, 322, 1583, 29889, 7194, 29918, 10145, 470, 1583, 29889, 10490, 29918, 10145, 29897, 13, 4706, 7465, 411, 263, 601, 1124, 29889, 4032, 7317, 580, 408, 4867, 29901, 13, 9651, 411, 7465, 29918, 15619, 29889, 15619, 29898, 29906, 29900, 1125, 13, 18884, 7465, 411, 4867, 29889, 657, 877, 29912, 6822, 8875, 29973, 8875, 4286, 4830, 29898, 1311, 29889, 2271, 29892, 13, 462, 462, 462, 308, 16248, 29892, 13, 462, 462, 462, 308, 8636, 876, 408, 2933, 29901, 13, 462, 1678, 565, 2933, 29889, 4882, 6736, 29871, 29906, 29900, 29900, 322, 2933, 29889, 4882, 5277, 29871, 29941, 29900, 29900, 29901, 13, 462, 4706, 1583, 29889, 16680, 29889, 18798, 29898, 20675, 2933, 29889, 726, 3101, 13, 13, 1678, 7465, 822, 903, 3827, 29898, 1311, 1125, 13, 4706, 1018, 29901, 13, 9651, 1583, 29889, 9006, 353, 1583, 29889, 9006, 29918, 311, 802, 29889, 7323, 1563, 580, 13, 4706, 5174, 11374, 2392, 29901, 13, 9651, 1583, 29889, 4397, 29918, 9006, 877, 657, 29918, 6051, 29918, 4882, 1495, 13, 9651, 1583, 29889, 4397, 29918, 9006, 877, 657, 29918, 1867, 29918, 4882, 1495, 13, 9651, 1583, 29889, 9006, 353, 1583, 29889, 9006, 29918, 311, 802, 29889, 7323, 1563, 580, 13, 13, 4706, 1480, 29889, 8382, 877, 3089, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 9006, 29889, 978, 876, 13, 4706, 921, 353, 7272, 1583, 3032, 9155, 29898, 1311, 29889, 9006, 29889, 7529, 29892, 13, 462, 795, 1158, 29922, 1311, 29889, 9006, 29889, 5696, 29897, 13, 13, 1678, 7465, 822, 2425, 29918, 3733, 1847, 29898, 1311, 1125, 13, 4706, 1018, 29901, 13, 9651, 1550, 5852, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 7272, 1583, 3032, 3827, 580, 13, 462, 1678, 1583, 29889, 9965, 353, 5852, 13, 462, 1678, 1583, 29889, 26482, 580, 13, 18884, 5174, 8960, 408, 4589, 29901, 13, 462, 1678, 1480, 29889, 2704, 703, 23651, 6571, 5229, 29892, 411, 4829, 29901, 6571, 376, 13, 462, 795, 376, 12984, 337, 2202, 297, 6571, 6923, 29908, 13, 462, 795, 869, 4830, 29898, 1311, 29889, 9006, 29889, 978, 29892, 4589, 29892, 29871, 29896, 29900, 876, 13, 462, 1678, 1583, 29889, 9965, 353, 7700, 13, 18884, 565, 1583, 29889, 9965, 338, 451, 5852, 29901, 13, 462, 1678, 1583, 29889, 15033, 353, 5852, 13, 462, 1678, 1583, 29889, 9006, 29918, 311, 802, 29889, 4397, 29898, 1311, 29889, 9006, 29897, 13, 462, 1678, 1583, 29889, 14057, 353, 5852, 13, 462, 1678, 7272, 408, 948, 3934, 29889, 17059, 29898, 29896, 29900, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 29889, 15033, 353, 7700, 13, 462, 1678, 1583, 29889, 14057, 353, 7700, 13, 462, 1678, 1480, 29889, 3888, 703, 8875, 21397, 3730, 13877, 29889, 11393, 4830, 29898, 1311, 29889, 9006, 29889, 978, 876, 13, 18884, 396, 21180, 3957, 2106, 1432, 29871, 29896, 29879, 13, 18884, 7272, 408, 948, 3934, 29889, 17059, 29898, 29900, 29889, 29945, 29897, 13, 4706, 5174, 408, 948, 3934, 29889, 19420, 839, 2392, 29901, 13, 9651, 1583, 29889, 9965, 353, 7700, 13, 4706, 5174, 8960, 408, 4589, 29901, 13, 9651, 1480, 29889, 2704, 703, 17776, 304, 2130, 1732, 1923, 411, 4829, 29901, 6571, 1642, 4830, 29898, 3127, 876, 13, 9651, 1583, 29889, 9965, 353, 7700, 13, 13, 2 ]
mission/constants/teagle.py
cuauv/software
70
51976
from mission.constants.missions import Gate, Path from conf.vehicle import is_mainsub HYDROPHONES_PINGER_DEPTH = 3.0 NONSURFACE_MIN_DEPTH = 0.6 # gate = Gate( # depth=1.0, # initial_approach_target_percent_of_screen=.45, # gate_width_threshold=0.4, # pre_spin_charge_dist=16 if is_mainsub else 12, # spin_charge_dist=16 if is_mainsub else 12, # post_spin_charge_dist=16 if is_mainsub else 12 # ) path = Path( depth=1.0, search_forward=6 if is_mainsub else 2, search_stride = 10 if is_mainsub else 8, search_right_first=True, search_speed=0.1, post_dist=2.5, failure_back_up_dist=0.5 if is_mainsub else 0.1, failure_back_up_speed=0.2 if is_mainsub else 0.1, ) #dice = Dice( # depth=3.3, # max_depth=4, # search_forward=3, # search_stride=8, # search_speed=0.1, # min_dot_radius=0.03, # ram_dist=1.0, # ram_speed=0.1, # rammed_back_up_timeout=20, # lost_sight_back_up_timeout=5, # search_default_zero_timeout=60, #) # #highway = Highway( # high_depth=1.0, # low_depth=1.2, # dist=6 if is_mainsub else 2, # speed=0.4 if is_mainsub else 0.2, #) # #track = Track( # depth=1.6, # slow_down_dist=5, # max_speed=0.3 if is_mainsub else 0.2, # min_speed=0.1, # vision_frame_period=0.5, #) # #roulette = Roulette( # depth_search=1.0, # depth_realign=2.5, # depth_drop=3.0, # heading_offset=30, #) # #cash_in = CashIn( # approach_funnel_depth=0.5, # drop_approach_dist=0.2, # # (right, left) # drop_dvl_forward_correct_dist=(0.1, -0.13), # drop_heading_correct=(0, -7), # pick_up_both_depth=1.0, # pick_up_search_depth_1=2.0, # pick_up_search_depth_2=2.25, # pick_up_search_depth_3=2.5, # pick_up_start_follow_depth=3.2, # attempt_surface_depth=-1, # attempt_funnel_depth=0, #)
[ 1, 515, 10655, 29889, 3075, 1934, 29889, 29885, 6847, 1053, 22510, 29892, 10802, 13, 13, 3166, 1970, 29889, 345, 29882, 2512, 1053, 338, 29918, 3396, 1491, 13, 13, 29950, 29979, 29928, 1672, 19689, 1164, 2890, 29918, 29925, 4214, 1001, 29918, 2287, 29925, 4690, 353, 29871, 29941, 29889, 29900, 13, 13, 29940, 1164, 29903, 4574, 29943, 11538, 29918, 16173, 29918, 2287, 29925, 4690, 353, 29871, 29900, 29889, 29953, 13, 13, 29937, 12417, 353, 22510, 29898, 13, 29937, 268, 10809, 29922, 29896, 29889, 29900, 29892, 13, 29937, 268, 2847, 29918, 9961, 496, 29918, 5182, 29918, 25376, 29918, 974, 29918, 10525, 21098, 29946, 29945, 29892, 13, 29937, 268, 12417, 29918, 2103, 29918, 386, 12268, 29922, 29900, 29889, 29946, 29892, 13, 29937, 268, 758, 29918, 1028, 262, 29918, 23367, 29918, 5721, 29922, 29896, 29953, 565, 338, 29918, 3396, 1491, 1683, 29871, 29896, 29906, 29892, 13, 29937, 268, 10917, 29918, 23367, 29918, 5721, 29922, 29896, 29953, 565, 338, 29918, 3396, 1491, 1683, 29871, 29896, 29906, 29892, 13, 29937, 268, 1400, 29918, 1028, 262, 29918, 23367, 29918, 5721, 29922, 29896, 29953, 565, 338, 29918, 3396, 1491, 1683, 29871, 29896, 29906, 13, 29937, 1723, 13, 13, 2084, 353, 10802, 29898, 13, 1678, 10809, 29922, 29896, 29889, 29900, 29892, 13, 1678, 2740, 29918, 11333, 29922, 29953, 565, 338, 29918, 3396, 1491, 1683, 29871, 29906, 29892, 13, 1678, 2740, 29918, 303, 2426, 353, 29871, 29896, 29900, 565, 338, 29918, 3396, 1491, 1683, 29871, 29947, 29892, 13, 1678, 2740, 29918, 1266, 29918, 4102, 29922, 5574, 29892, 13, 1678, 2740, 29918, 19322, 29922, 29900, 29889, 29896, 29892, 13, 1678, 1400, 29918, 5721, 29922, 29906, 29889, 29945, 29892, 13, 1678, 10672, 29918, 1627, 29918, 786, 29918, 5721, 29922, 29900, 29889, 29945, 565, 338, 29918, 3396, 1491, 1683, 29871, 29900, 29889, 29896, 29892, 13, 1678, 10672, 29918, 1627, 29918, 786, 29918, 19322, 29922, 29900, 29889, 29906, 565, 338, 29918, 3396, 1491, 1683, 29871, 29900, 29889, 29896, 29892, 13, 29897, 13, 13, 29937, 29881, 625, 353, 360, 625, 29898, 13, 29937, 1678, 10809, 29922, 29941, 29889, 29941, 29892, 13, 29937, 1678, 4236, 29918, 19488, 29922, 29946, 29892, 13, 29937, 1678, 2740, 29918, 11333, 29922, 29941, 29892, 13, 29937, 1678, 2740, 29918, 303, 2426, 29922, 29947, 29892, 13, 29937, 1678, 2740, 29918, 19322, 29922, 29900, 29889, 29896, 29892, 13, 29937, 1678, 1375, 29918, 6333, 29918, 13471, 29922, 29900, 29889, 29900, 29941, 29892, 13, 29937, 1678, 13472, 29918, 5721, 29922, 29896, 29889, 29900, 29892, 13, 29937, 1678, 13472, 29918, 19322, 29922, 29900, 29889, 29896, 29892, 13, 29937, 1678, 13472, 2168, 29918, 1627, 29918, 786, 29918, 15619, 29922, 29906, 29900, 29892, 13, 29937, 1678, 5714, 29918, 29879, 523, 29918, 1627, 29918, 786, 29918, 15619, 29922, 29945, 29892, 13, 29937, 1678, 2740, 29918, 4381, 29918, 9171, 29918, 15619, 29922, 29953, 29900, 29892, 13, 29937, 29897, 13, 29937, 13, 29937, 9812, 1582, 353, 22080, 29898, 13, 29937, 1678, 1880, 29918, 19488, 29922, 29896, 29889, 29900, 29892, 13, 29937, 1678, 4482, 29918, 19488, 29922, 29896, 29889, 29906, 29892, 13, 29937, 1678, 1320, 29922, 29953, 565, 338, 29918, 3396, 1491, 1683, 29871, 29906, 29892, 13, 29937, 1678, 6210, 29922, 29900, 29889, 29946, 565, 338, 29918, 3396, 1491, 1683, 29871, 29900, 29889, 29906, 29892, 13, 29937, 29897, 13, 29937, 13, 29937, 11294, 353, 17026, 29898, 13, 29937, 1678, 10809, 29922, 29896, 29889, 29953, 29892, 13, 29937, 1678, 5232, 29918, 3204, 29918, 5721, 29922, 29945, 29892, 13, 29937, 1678, 4236, 29918, 19322, 29922, 29900, 29889, 29941, 565, 338, 29918, 3396, 1491, 1683, 29871, 29900, 29889, 29906, 29892, 13, 29937, 1678, 1375, 29918, 19322, 29922, 29900, 29889, 29896, 29892, 13, 29937, 1678, 18551, 29918, 2557, 29918, 19145, 29922, 29900, 29889, 29945, 29892, 13, 29937, 29897, 13, 29937, 13, 29937, 27537, 20200, 353, 15915, 20200, 29898, 13, 29937, 1678, 10809, 29918, 4478, 29922, 29896, 29889, 29900, 29892, 13, 29937, 1678, 10809, 29918, 276, 2520, 29922, 29906, 29889, 29945, 29892, 13, 29937, 1678, 10809, 29918, 8865, 29922, 29941, 29889, 29900, 29892, 13, 29937, 1678, 28435, 29918, 10289, 29922, 29941, 29900, 29892, 13, 29937, 29897, 13, 29937, 13, 29937, 29883, 1161, 29918, 262, 353, 315, 1161, 797, 29898, 13, 29937, 1678, 2948, 29918, 29888, 16163, 29918, 19488, 29922, 29900, 29889, 29945, 29892, 13, 29937, 1678, 5768, 29918, 9961, 496, 29918, 5721, 29922, 29900, 29889, 29906, 29892, 13, 29937, 1678, 396, 313, 1266, 29892, 2175, 29897, 13, 29937, 1678, 5768, 29918, 29881, 20901, 29918, 11333, 29918, 15728, 29918, 5721, 7607, 29900, 29889, 29896, 29892, 448, 29900, 29889, 29896, 29941, 511, 13, 29937, 1678, 5768, 29918, 2813, 292, 29918, 15728, 7607, 29900, 29892, 448, 29955, 511, 13, 29937, 1678, 5839, 29918, 786, 29918, 20313, 29918, 19488, 29922, 29896, 29889, 29900, 29892, 13, 29937, 1678, 5839, 29918, 786, 29918, 4478, 29918, 19488, 29918, 29896, 29922, 29906, 29889, 29900, 29892, 13, 29937, 1678, 5839, 29918, 786, 29918, 4478, 29918, 19488, 29918, 29906, 29922, 29906, 29889, 29906, 29945, 29892, 13, 29937, 1678, 5839, 29918, 786, 29918, 4478, 29918, 19488, 29918, 29941, 29922, 29906, 29889, 29945, 29892, 13, 29937, 1678, 5839, 29918, 786, 29918, 2962, 29918, 23031, 29918, 19488, 29922, 29941, 29889, 29906, 29892, 13, 29937, 1678, 4218, 29918, 7610, 2161, 29918, 19488, 10457, 29896, 29892, 13, 29937, 1678, 4218, 29918, 29888, 16163, 29918, 19488, 29922, 29900, 29892, 13, 29937, 29897, 13, 2 ]
built-in/MindSpore/Official/cv/detection/MaskRCNN_for_MindSpore/infer/sdk/main.py
Ascend/modelzoo
12
69935
<gh_stars>10-100 # Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ import argparse import json import logging import os import time import cv2 import mmcv import numpy as np from PIL import Image from api.draw_predict import draw_label from api.infer import SdkApi from config import config as cfg from eval.eval_by_sdk import get_eval_result def parser_args(): parser = argparse.ArgumentParser(description="maskrcnn inference") parser.add_argument("--img_path", type=str, required=True, help="image directory.") parser.add_argument( "--pipeline_path", type=str, required=False, default="config/maskrcnn_ms.pipeline", help="image file path. The default is 'config/maskrcnn_ms.pipeline'. ") parser.add_argument( "--model_type", type=str, required=False, default="dvpp", help= "rgb: high-precision, dvpp: high performance. The default is 'dvpp'.") parser.add_argument( "--infer_mode", type=str, required=False, default="infer", help= "infer:only infer, eval: accuracy evaluation. The default is 'infer'.") parser.add_argument( "--infer_result_dir", type=str, required=False, default="../data/infer_result", help= "cache dir of inference result. The default is '../data/infer_result'." ) parser.add_argument("--ann_file", type=str, required=False, help="eval ann_file.") args = parser.parse_args() return args def get_img_metas(file_name): img = Image.open(file_name) img_size = img.size org_width, org_height = img_size resize_ratio = cfg.MODEL_WIDTH / org_width if resize_ratio > cfg.MODEL_HEIGHT / org_height: resize_ratio = cfg.MODEL_HEIGHT / org_height img_metas = np.array([img_size[1], img_size[0]] + [resize_ratio, resize_ratio]) return img_metas def convert_result(result, img_metas): bboxes = result.get("MxpiObject") for i, bbox in enumerate(bboxes): mask_width = bbox["imageMask"]["shape"][1] mask_height = bbox["imageMask"]["shape"][0] mask_str = bbox["imageMask"]["data"] mask = [1 if i == '1' else 0 for i in mask_str] mask = np.array(mask) mask = mask.reshape((mask_height, mask_width)).astype('float32') bbox['x0'] = max(min(bbox['x0'], img_metas[1] - 1), 0) bbox['x1'] = max(min(bbox['x1'], img_metas[1] - 1), 0) bbox['y0'] = max(min(bbox['y0'], img_metas[0] - 1), 0) bbox['y1'] = max(min(bbox['y1'], img_metas[0] - 1), 0) # rescale mask w = int(max(bbox['x1'] - bbox['x0'] + 1, 1)) h = int(max(bbox['y1'] - bbox['y0'] + 1, 1)) bbox["imageMask"]["shape"] = [h, w] mask = mmcv.imresize(mask, (w, h)) print( f"Image_metas: {img_metas}, shape:{mask.shape}, " f"bbox_shape: {bbox['imageMask']['shape']}, ori_shape: {(mask_height, mask_width)}" ) mask_str = ''.join(['1' if i else '0' for i in mask.flatten()]) bbox['imageMask']['data'] = mask_str return result def process_img(img_file): img = cv2.imread(img_file) model_img = mmcv.imrescale(img, (cfg.MODEL_WIDTH, cfg.MODEL_HEIGHT)) if model_img.shape[0] > cfg.MODEL_HEIGHT: model_img = mmcv.imrescale(model_img, (cfg.MODEL_HEIGHT, cfg.MODEL_HEIGHT)) pad_img = np.zeros( (cfg.MODEL_HEIGHT, cfg.MODEL_WIDTH, 3)).astype(model_img.dtype) pad_img[0:model_img.shape[0], 0:model_img.shape[1], :] = model_img pad_img.astype(np.float16) return pad_img def image_inference(pipeline_path, stream_name, img_dir, result_dir, replace_last, model_type): sdk_api = SdkApi(pipeline_path) if not sdk_api.init(): exit(-1) if not os.path.exists(result_dir): os.makedirs(result_dir) img_data_plugin_id = 0 img_metas_plugin_id = 1 print(f"\nBegin to inference for {img_dir}.\n\n") file_list = os.listdir(img_dir) total_len = len(file_list) for img_id, file_name in enumerate(file_list): if not file_name.lower().endswith((".jpg", "jpeg")): continue file_path = os.path.join(img_dir, file_name) save_path = os.path.join(result_dir, f"{os.path.splitext(file_name)[0]}.json") if not replace_last and os.path.exists(save_path): print( f"The infer result json({save_path}) has existed, will be skip." ) continue try: if model_type == 'dvpp': with open(file_path, "rb") as fp: data = fp.read() sdk_api.send_data_input(stream_name, img_data_plugin_id, data) else: img_np = process_img(file_path) sdk_api.send_img_input(stream_name, img_data_plugin_id, "appsrc0", img_np.tobytes(), img_np.shape) # set image data img_metas = get_img_metas(file_path).astype(np.float16) sdk_api.send_tensor_input(stream_name, img_metas_plugin_id, "appsrc1", img_metas.tobytes(), [1, 4], cfg.TENSOR_DTYPE_FLOAT16) start_time = time.time() result = sdk_api.get_result(stream_name) end_time = time.time() - start_time result = convert_result(result, img_metas) with open(save_path, "w") as fp: fp.write(json.dumps(result)) print( f"End-2end inference, file_name: {file_path}, {img_id + 1}/{total_len}, elapsed_time: {end_time}.\n" ) draw_label(save_path, file_path, result_dir) except Exception as ex: logging.exception("Unknown error, msg(%s).", ex) if __name__ == "__main__": args = parser_args() replace_last = True stream_name = cfg.STREAM_NAME.encode("utf-8") image_inference(args.pipeline_path, stream_name, args.img_path, args.infer_result_dir, replace_last, args.model_type) if args.infer_mode == "eval": print("Infer end.") print("Begin to eval...") get_eval_result(args.ann_file, args.img_path, args.infer_result_dir)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 379, 3357, 26599, 8364, 11763, 3189, 1696, 19806, 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, 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, 1275, 9166, 9166, 9166, 9166, 4936, 1360, 13, 13, 5215, 1852, 5510, 13, 5215, 4390, 13, 5215, 12183, 13, 5215, 2897, 13, 5215, 931, 13, 13, 5215, 13850, 29906, 13, 5215, 5654, 11023, 13, 5215, 12655, 408, 7442, 13, 3166, 349, 6227, 1053, 7084, 13, 13, 3166, 7882, 29889, 4012, 29918, 27711, 1053, 4216, 29918, 1643, 13, 3166, 7882, 29889, 262, 571, 1053, 317, 8181, 11713, 13, 3166, 2295, 1053, 2295, 408, 274, 16434, 13, 3166, 19745, 29889, 14513, 29918, 1609, 29918, 15348, 1053, 679, 29918, 14513, 29918, 2914, 13, 13, 13, 1753, 13812, 29918, 5085, 7295, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 543, 13168, 2214, 15755, 27262, 1159, 13, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 2492, 29918, 2084, 613, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 3734, 29922, 5574, 29892, 13, 462, 4706, 1371, 543, 3027, 3884, 23157, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 376, 489, 13096, 5570, 29918, 2084, 613, 13, 4706, 1134, 29922, 710, 29892, 13, 4706, 3734, 29922, 8824, 29892, 13, 4706, 2322, 543, 2917, 29914, 13168, 2214, 15755, 29918, 1516, 29889, 13096, 5570, 613, 13, 4706, 1371, 543, 3027, 934, 2224, 29889, 450, 2322, 338, 525, 2917, 29914, 13168, 2214, 15755, 29918, 1516, 29889, 13096, 5570, 4286, 16521, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 376, 489, 4299, 29918, 1853, 613, 13, 4706, 1134, 29922, 710, 29892, 13, 4706, 3734, 29922, 8824, 29892, 13, 4706, 2322, 543, 29881, 29894, 407, 613, 13, 4706, 1371, 29922, 13, 4706, 376, 23973, 29901, 1880, 29899, 17990, 2459, 29892, 14897, 407, 29901, 1880, 4180, 29889, 450, 2322, 338, 525, 29881, 29894, 407, 4286, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 376, 489, 262, 571, 29918, 8513, 613, 13, 4706, 1134, 29922, 710, 29892, 13, 4706, 3734, 29922, 8824, 29892, 13, 4706, 2322, 543, 262, 571, 613, 13, 4706, 1371, 29922, 13, 4706, 376, 262, 571, 29901, 6194, 10115, 29892, 19745, 29901, 13600, 17983, 29889, 450, 2322, 338, 525, 262, 571, 4286, 1159, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 376, 489, 262, 571, 29918, 2914, 29918, 3972, 613, 13, 4706, 1134, 29922, 710, 29892, 13, 4706, 3734, 29922, 8824, 29892, 13, 4706, 2322, 543, 6995, 1272, 29914, 262, 571, 29918, 2914, 613, 13, 4706, 1371, 29922, 13, 4706, 376, 8173, 4516, 310, 27262, 1121, 29889, 450, 2322, 338, 525, 6995, 1272, 29914, 262, 571, 29918, 2914, 29915, 1213, 13, 1678, 1723, 13, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 812, 29918, 1445, 613, 13, 462, 4706, 1134, 29922, 710, 29892, 13, 462, 4706, 3734, 29922, 8824, 29892, 13, 462, 4706, 1371, 543, 14513, 2889, 29918, 1445, 23157, 13, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 736, 6389, 13, 13, 13, 1753, 679, 29918, 2492, 29918, 2527, 294, 29898, 1445, 29918, 978, 1125, 13, 1678, 10153, 353, 7084, 29889, 3150, 29898, 1445, 29918, 978, 29897, 13, 1678, 10153, 29918, 2311, 353, 10153, 29889, 2311, 13, 13, 1678, 1638, 29918, 2103, 29892, 1638, 29918, 3545, 353, 10153, 29918, 2311, 13, 1678, 19490, 29918, 3605, 601, 353, 274, 16434, 29889, 20387, 29931, 29918, 22574, 847, 1638, 29918, 2103, 13, 1678, 565, 19490, 29918, 3605, 601, 1405, 274, 16434, 29889, 20387, 29931, 29918, 9606, 22530, 847, 1638, 29918, 3545, 29901, 13, 4706, 19490, 29918, 3605, 601, 353, 274, 16434, 29889, 20387, 29931, 29918, 9606, 22530, 847, 1638, 29918, 3545, 13, 13, 1678, 10153, 29918, 2527, 294, 353, 7442, 29889, 2378, 4197, 2492, 29918, 2311, 29961, 29896, 1402, 10153, 29918, 2311, 29961, 29900, 5262, 718, 13, 462, 308, 518, 21476, 29918, 3605, 601, 29892, 19490, 29918, 3605, 601, 2314, 13, 1678, 736, 10153, 29918, 2527, 294, 13, 13, 13, 1753, 3588, 29918, 2914, 29898, 2914, 29892, 10153, 29918, 2527, 294, 1125, 13, 1678, 289, 1884, 267, 353, 1121, 29889, 657, 703, 29924, 29916, 1631, 2061, 1159, 13, 1678, 363, 474, 29892, 289, 1884, 297, 26985, 29898, 29890, 1884, 267, 1125, 13, 4706, 11105, 29918, 2103, 353, 289, 1884, 3366, 3027, 19832, 3108, 3366, 12181, 3108, 29961, 29896, 29962, 13, 4706, 11105, 29918, 3545, 353, 289, 1884, 3366, 3027, 19832, 3108, 3366, 12181, 3108, 29961, 29900, 29962, 13, 4706, 11105, 29918, 710, 353, 289, 1884, 3366, 3027, 19832, 3108, 3366, 1272, 3108, 13, 4706, 11105, 353, 518, 29896, 565, 474, 1275, 525, 29896, 29915, 1683, 29871, 29900, 363, 474, 297, 11105, 29918, 710, 29962, 13, 4706, 11105, 353, 7442, 29889, 2378, 29898, 13168, 29897, 13, 4706, 11105, 353, 11105, 29889, 690, 14443, 3552, 13168, 29918, 3545, 29892, 11105, 29918, 2103, 8106, 579, 668, 877, 7411, 29941, 29906, 1495, 13, 13, 4706, 289, 1884, 1839, 29916, 29900, 2033, 353, 4236, 29898, 1195, 29898, 29890, 1884, 1839, 29916, 29900, 7464, 10153, 29918, 2527, 294, 29961, 29896, 29962, 448, 29871, 29896, 511, 29871, 29900, 29897, 13, 4706, 289, 1884, 1839, 29916, 29896, 2033, 353, 4236, 29898, 1195, 29898, 29890, 1884, 1839, 29916, 29896, 7464, 10153, 29918, 2527, 294, 29961, 29896, 29962, 448, 29871, 29896, 511, 29871, 29900, 29897, 13, 4706, 289, 1884, 1839, 29891, 29900, 2033, 353, 4236, 29898, 1195, 29898, 29890, 1884, 1839, 29891, 29900, 7464, 10153, 29918, 2527, 294, 29961, 29900, 29962, 448, 29871, 29896, 511, 29871, 29900, 29897, 13, 4706, 289, 1884, 1839, 29891, 29896, 2033, 353, 4236, 29898, 1195, 29898, 29890, 1884, 1839, 29891, 29896, 7464, 10153, 29918, 2527, 294, 29961, 29900, 29962, 448, 29871, 29896, 511, 29871, 29900, 29897, 13, 4706, 396, 620, 29883, 744, 11105, 13, 4706, 281, 353, 938, 29898, 3317, 29898, 29890, 1884, 1839, 29916, 29896, 2033, 448, 289, 1884, 1839, 29916, 29900, 2033, 718, 29871, 29896, 29892, 29871, 29896, 876, 13, 4706, 298, 353, 938, 29898, 3317, 29898, 29890, 1884, 1839, 29891, 29896, 2033, 448, 289, 1884, 1839, 29891, 29900, 2033, 718, 29871, 29896, 29892, 29871, 29896, 876, 13, 4706, 289, 1884, 3366, 3027, 19832, 3108, 3366, 12181, 3108, 353, 518, 29882, 29892, 281, 29962, 13, 4706, 11105, 353, 5654, 11023, 29889, 326, 21476, 29898, 13168, 29892, 313, 29893, 29892, 298, 876, 13, 4706, 1596, 29898, 13, 9651, 285, 29908, 2940, 29918, 2527, 294, 29901, 426, 2492, 29918, 2527, 294, 1118, 8267, 26254, 13168, 29889, 12181, 1118, 376, 13, 9651, 285, 29908, 29890, 1884, 29918, 12181, 29901, 426, 29890, 1884, 1839, 3027, 19832, 16215, 12181, 2033, 1118, 470, 29875, 29918, 12181, 29901, 426, 29898, 13168, 29918, 3545, 29892, 11105, 29918, 2103, 2915, 29908, 13, 4706, 1723, 13, 4706, 11105, 29918, 710, 353, 525, 4286, 7122, 18959, 29896, 29915, 565, 474, 1683, 525, 29900, 29915, 363, 474, 297, 11105, 29889, 1579, 8606, 580, 2314, 13, 4706, 289, 1884, 1839, 3027, 19832, 16215, 1272, 2033, 353, 11105, 29918, 710, 13, 1678, 736, 1121, 13, 13, 13, 1753, 1889, 29918, 2492, 29898, 2492, 29918, 1445, 1125, 13, 1678, 10153, 353, 13850, 29906, 29889, 326, 949, 29898, 2492, 29918, 1445, 29897, 13, 1678, 1904, 29918, 2492, 353, 5654, 11023, 29889, 326, 690, 29883, 744, 29898, 2492, 29892, 313, 16859, 29889, 20387, 29931, 29918, 22574, 29892, 274, 16434, 29889, 20387, 29931, 29918, 9606, 22530, 876, 13, 1678, 565, 1904, 29918, 2492, 29889, 12181, 29961, 29900, 29962, 1405, 274, 16434, 29889, 20387, 29931, 29918, 9606, 22530, 29901, 13, 4706, 1904, 29918, 2492, 353, 5654, 11023, 29889, 326, 690, 29883, 744, 29898, 4299, 29918, 2492, 29892, 13, 462, 462, 259, 313, 16859, 29889, 20387, 29931, 29918, 9606, 22530, 29892, 274, 16434, 29889, 20387, 29931, 29918, 9606, 22530, 876, 13, 1678, 17132, 29918, 2492, 353, 7442, 29889, 3298, 359, 29898, 13, 4706, 313, 16859, 29889, 20387, 29931, 29918, 9606, 22530, 29892, 274, 16434, 29889, 20387, 29931, 29918, 22574, 29892, 29871, 29941, 8106, 579, 668, 29898, 4299, 29918, 2492, 29889, 29881, 1853, 29897, 13, 1678, 17132, 29918, 2492, 29961, 29900, 29901, 4299, 29918, 2492, 29889, 12181, 29961, 29900, 1402, 29871, 29900, 29901, 4299, 29918, 2492, 29889, 12181, 29961, 29896, 1402, 584, 29962, 353, 1904, 29918, 2492, 13, 1678, 17132, 29918, 2492, 29889, 579, 668, 29898, 9302, 29889, 7411, 29896, 29953, 29897, 13, 1678, 736, 17132, 29918, 2492, 13, 13, 13, 1753, 1967, 29918, 262, 1659, 29898, 13096, 5570, 29918, 2084, 29892, 4840, 29918, 978, 29892, 10153, 29918, 3972, 29892, 1121, 29918, 3972, 29892, 13, 462, 1678, 5191, 29918, 4230, 29892, 1904, 29918, 1853, 1125, 13, 1678, 269, 8181, 29918, 2754, 353, 317, 8181, 11713, 29898, 13096, 5570, 29918, 2084, 29897, 13, 1678, 565, 451, 269, 8181, 29918, 2754, 29889, 2344, 7295, 13, 4706, 6876, 6278, 29896, 29897, 13, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 2914, 29918, 3972, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 2914, 29918, 3972, 29897, 13, 13, 1678, 10153, 29918, 1272, 29918, 8582, 29918, 333, 353, 29871, 29900, 13, 1678, 10153, 29918, 2527, 294, 29918, 8582, 29918, 333, 353, 29871, 29896, 13, 1678, 1596, 29898, 29888, 26732, 29876, 17946, 304, 27262, 363, 426, 2492, 29918, 3972, 1836, 29905, 29876, 29905, 29876, 1159, 13, 13, 1678, 934, 29918, 1761, 353, 2897, 29889, 1761, 3972, 29898, 2492, 29918, 3972, 29897, 13, 1678, 3001, 29918, 2435, 353, 7431, 29898, 1445, 29918, 1761, 29897, 13, 1678, 363, 10153, 29918, 333, 29892, 934, 29918, 978, 297, 26985, 29898, 1445, 29918, 1761, 1125, 13, 4706, 565, 451, 934, 29918, 978, 29889, 13609, 2141, 1975, 2541, 29898, 17350, 6173, 613, 376, 26568, 5783, 29901, 13, 9651, 6773, 13, 4706, 934, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 2492, 29918, 3972, 29892, 934, 29918, 978, 29897, 13, 4706, 4078, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 2914, 29918, 3972, 29892, 13, 462, 462, 285, 29908, 29912, 359, 29889, 2084, 29889, 23579, 568, 486, 29898, 1445, 29918, 978, 9601, 29900, 29962, 1836, 3126, 1159, 13, 4706, 565, 451, 5191, 29918, 4230, 322, 2897, 29889, 2084, 29889, 9933, 29898, 7620, 29918, 2084, 1125, 13, 9651, 1596, 29898, 13, 18884, 285, 29908, 1576, 10115, 1121, 4390, 3319, 7620, 29918, 2084, 1800, 756, 22856, 29892, 674, 367, 14383, 1213, 13, 9651, 1723, 13, 9651, 6773, 13, 13, 4706, 1018, 29901, 13, 9651, 565, 1904, 29918, 1853, 1275, 525, 29881, 29894, 407, 2396, 13, 18884, 411, 1722, 29898, 1445, 29918, 2084, 29892, 376, 6050, 1159, 408, 285, 29886, 29901, 13, 462, 1678, 848, 353, 285, 29886, 29889, 949, 580, 13, 18884, 269, 8181, 29918, 2754, 29889, 6717, 29918, 1272, 29918, 2080, 29898, 5461, 29918, 978, 29892, 10153, 29918, 1272, 29918, 8582, 29918, 333, 29892, 848, 29897, 13, 9651, 1683, 29901, 13, 18884, 10153, 29918, 9302, 353, 1889, 29918, 2492, 29898, 1445, 29918, 2084, 29897, 13, 18884, 269, 8181, 29918, 2754, 29889, 6717, 29918, 2492, 29918, 2080, 29898, 5461, 29918, 978, 29892, 13, 462, 462, 539, 10153, 29918, 1272, 29918, 8582, 29918, 333, 29892, 376, 932, 4351, 29900, 613, 13, 462, 462, 539, 10153, 29918, 9302, 29889, 517, 13193, 3285, 10153, 29918, 9302, 29889, 12181, 29897, 13, 13, 9651, 396, 731, 1967, 848, 13, 9651, 10153, 29918, 2527, 294, 353, 679, 29918, 2492, 29918, 2527, 294, 29898, 1445, 29918, 2084, 467, 579, 668, 29898, 9302, 29889, 7411, 29896, 29953, 29897, 13, 9651, 269, 8181, 29918, 2754, 29889, 6717, 29918, 20158, 29918, 2080, 29898, 5461, 29918, 978, 29892, 10153, 29918, 2527, 294, 29918, 8582, 29918, 333, 29892, 13, 462, 462, 418, 376, 932, 4351, 29896, 613, 10153, 29918, 2527, 294, 29889, 517, 13193, 3285, 518, 29896, 29892, 29871, 29946, 1402, 13, 462, 462, 418, 274, 16434, 29889, 29911, 1430, 29903, 1955, 29918, 29928, 11116, 29918, 29943, 3927, 1299, 29896, 29953, 29897, 13, 13, 9651, 1369, 29918, 2230, 353, 931, 29889, 2230, 580, 13, 9651, 1121, 353, 269, 8181, 29918, 2754, 29889, 657, 29918, 2914, 29898, 5461, 29918, 978, 29897, 13, 9651, 1095, 29918, 2230, 353, 931, 29889, 2230, 580, 448, 1369, 29918, 2230, 13, 13, 9651, 1121, 353, 3588, 29918, 2914, 29898, 2914, 29892, 10153, 29918, 2527, 294, 29897, 13, 13, 9651, 411, 1722, 29898, 7620, 29918, 2084, 29892, 376, 29893, 1159, 408, 285, 29886, 29901, 13, 18884, 285, 29886, 29889, 3539, 29898, 3126, 29889, 29881, 17204, 29898, 2914, 876, 13, 9651, 1596, 29898, 13, 18884, 285, 29908, 5044, 29899, 29906, 355, 27262, 29892, 934, 29918, 978, 29901, 426, 1445, 29918, 2084, 1118, 426, 2492, 29918, 333, 718, 29871, 29896, 6822, 29912, 7827, 29918, 2435, 1118, 560, 28170, 29918, 2230, 29901, 426, 355, 29918, 2230, 1836, 29905, 29876, 29908, 13, 9651, 1723, 13, 13, 9651, 4216, 29918, 1643, 29898, 7620, 29918, 2084, 29892, 934, 29918, 2084, 29892, 1121, 29918, 3972, 29897, 13, 4706, 5174, 8960, 408, 429, 29901, 13, 9651, 12183, 29889, 11739, 703, 14148, 1059, 29892, 10191, 29414, 29879, 467, 613, 429, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 6389, 353, 13812, 29918, 5085, 580, 13, 13, 1678, 5191, 29918, 4230, 353, 5852, 13, 1678, 4840, 29918, 978, 353, 274, 16434, 29889, 1254, 1525, 5194, 29918, 5813, 29889, 12508, 703, 9420, 29899, 29947, 1159, 13, 1678, 1967, 29918, 262, 1659, 29898, 5085, 29889, 13096, 5570, 29918, 2084, 29892, 4840, 29918, 978, 29892, 6389, 29889, 2492, 29918, 2084, 29892, 13, 462, 1678, 6389, 29889, 262, 571, 29918, 2914, 29918, 3972, 29892, 5191, 29918, 4230, 29892, 6389, 29889, 4299, 29918, 1853, 29897, 13, 1678, 565, 6389, 29889, 262, 571, 29918, 8513, 1275, 376, 14513, 1115, 13, 4706, 1596, 703, 797, 571, 1095, 23157, 13, 4706, 1596, 703, 17946, 304, 19745, 856, 1159, 13, 4706, 679, 29918, 14513, 29918, 2914, 29898, 5085, 29889, 812, 29918, 1445, 29892, 6389, 29889, 2492, 29918, 2084, 29892, 6389, 29889, 262, 571, 29918, 2914, 29918, 3972, 29897, 13, 2 ]
setup.py
acocac/scivision-test-plugin
0
193317
<gh_stars>0 #!/usr/bin/env python from setuptools import find_packages, setup requirements = [] with open("requirements.txt") as f: for line in f: stripped = line.split("#")[0].strip() if len(stripped) > 0: requirements.append(stripped) setup( name="scivision_test_plugin", version="0.0.1", description="scivision test plugin", author="<NAME>", author_email="<EMAIL>", url="https://github.com/quantumjot/scivision-test-plugin", packages=find_packages(), install_requires=requirements, python_requires=">=3.7", )
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 3166, 731, 21245, 8789, 1053, 1284, 29918, 8318, 29892, 6230, 13, 13, 12277, 1860, 353, 5159, 13, 2541, 1722, 703, 12277, 1860, 29889, 3945, 1159, 408, 285, 29901, 13, 1678, 363, 1196, 297, 285, 29901, 13, 4706, 10076, 2986, 353, 1196, 29889, 5451, 14822, 1159, 29961, 29900, 1822, 17010, 580, 13, 4706, 565, 7431, 29898, 303, 374, 2986, 29897, 1405, 29871, 29900, 29901, 13, 9651, 11780, 29889, 4397, 29898, 303, 374, 2986, 29897, 13, 13, 14669, 29898, 13, 1678, 1024, 543, 1557, 440, 2459, 29918, 1688, 29918, 8582, 613, 13, 1678, 1873, 543, 29900, 29889, 29900, 29889, 29896, 613, 13, 1678, 6139, 543, 1557, 440, 2459, 1243, 7079, 613, 13, 1678, 4148, 543, 29966, 5813, 28341, 13, 1678, 4148, 29918, 5269, 543, 29966, 26862, 6227, 28341, 13, 1678, 3142, 543, 991, 597, 3292, 29889, 510, 29914, 12150, 398, 29926, 327, 29914, 1557, 440, 2459, 29899, 1688, 29899, 8582, 613, 13, 1678, 9741, 29922, 2886, 29918, 8318, 3285, 13, 1678, 2601, 29918, 276, 339, 2658, 29922, 12277, 1860, 29892, 13, 1678, 3017, 29918, 276, 339, 2658, 543, 18572, 29941, 29889, 29955, 613, 13, 29897, 13, 2 ]
ssd/modeling/backbone/backbone_cfg.py
xu-peng-tao/SSD-Pruning-and-quantization
19
46336
# !/usr/bin/env python # coding:utf-8 # Author:XuPengTao # Date: 2020/3/14 from ssd.layers import L2Norm import torch.nn.functional as F import torch.nn as nn import torch from ssd.modeling import registry import os import quantization.WqAq.dorefa.models.util_wqaq as dorefa import quantization.WqAq.IAO.models.util_wqaq as IAO import quantization.WbWtAb.models.util_wt_bab as BWN def fuse_conv_and_bn(conv, bn): # https://tehnokv.com/posts/fusing-batchnorm-and-conv/ with torch.no_grad(): # init fusedconv = torch.nn.Conv2d(conv.in_channels, conv.out_channels, kernel_size=conv.kernel_size, stride=conv.stride, padding=conv.padding, dilation=conv.dilation, groups=conv.groups, bias=True) # prepare filters w_conv = conv.weight.clone().view(conv.out_channels, -1) w_bn = torch.diag(bn.weight.div(torch.sqrt(bn.eps + bn.running_var))) fusedconv.weight.copy_(torch.mm(w_bn, w_conv).view(fusedconv.weight.size())) # prepare spatial bias if conv.bias is not None: b_conv = conv.bias else: b_conv = torch.zeros(conv.weight.size(0)).cuda() b_bn = bn.bias - bn.weight.mul(bn.running_mean).div(torch.sqrt(bn.running_var + bn.eps)) fusedconv.bias.copy_(bn.weight.mul(b_conv).div(torch.sqrt(bn.running_var + bn.eps))+ b_bn) return fusedconv class Swish(nn.Module): def __init__(self): super(Swish, self).__init__() def forward(self, x): return x * torch.sigmoid(x) class relu6(nn.Module): def __init__(self): super(relu6, self).__init__() def forward(self, x): return F.relu6(x, inplace=True) class h_swish(nn.Module): def __init__(self): super(h_swish, self).__init__() def forward(self, x): return x * (F.relu6(x + 3.0, inplace=True) / 6.0) class h_sigmoid(nn.Module): def __init__(self): super(h_sigmoid, self).__init__() def forward(self, x): out = F.relu6(x + 3.0, inplace=True) / 6.0 return out class SE(nn.Module): def __init__(self, channel, reduction=4): super(SE, self).__init__() self.avg_pool = nn.AdaptiveAvgPool2d(1) self.fc = nn.Sequential( nn.Linear(channel, channel // reduction, bias=False), nn.ReLU(inplace=True), nn.Linear(channel // reduction, channel, bias=False), h_sigmoid() # nn.Sigmoid() ) def forward(self, x): b, c, _, _ = x.size() y = self.avg_pool(x).view(b, c) y = self.fc(y).view(b, c, 1, 1) return x * y.expand_as(x) class Backbone(nn.Module): def __init__(self, cfg): super().__init__() self.quan_type = cfg.QUANTIZATION.TYPE if self.quan_type == 'dorefa': self.quan_conv = dorefa.Conv2d_Q self.wbits = cfg.QUANTIZATION.WBITS self.abits = cfg.QUANTIZATION.ABITS elif self.quan_type == 'IAO': self.quan_conv_bn = IAO.BNFold_Conv2d_Q # BN融合训练 self.quan_conv = IAO.Conv2d_Q self.wbits = cfg.QUANTIZATION.WBITS self.abits = cfg.QUANTIZATION.ABITS elif self.quan_type =='BWN': self.quan_conv = BWN.Conv2d_Q self.wbits = cfg.QUANTIZATION.WBITS self.abits = cfg.QUANTIZATION.ABITS if self.abits!=2: #这里2不表示2位,表示二值 print('激活未量化') if self.wbits!=2 and self.wbits!=3: print('权重未量化') self.module_defs = self.parse_model_cfg(cfg.MODEL.BACKBONE.CFG) self.module_list, self.l2_norm_index,self.features,self.l2_norm,self.routs= self.create_backbone(cfg,self.module_defs) self.reset_parameters() def parse_model_cfg(self,path): # Parses the ssd layer configuration file and returns module definitions # print(os.getcwd())#绝对路径 # print(os.path.abspath(os.path.join(os.getcwd(), "../../.."))) #获取上上上级目录 # file = open(os.path.join(os.path.abspath(os.path.join(os.getcwd(), "../../..")),path), 'r') #测试本文件时使用 file=open(path,'r') lines = file.read().split('\n') lines = [x for x in lines if x and not x.startswith('#')] lines = [x.rstrip().lstrip() for x in lines] # get rid of fringe whitespaces mdefs = [] # module definitions for line in lines: if line.startswith('['): # This marks the start of a new block mdefs.append({}) mdefs[-1]['type'] = line[1:-1].rstrip() if mdefs[-1]['type'] == 'convolutional' or mdefs[-1]['type'] == 'depthwise': mdefs[-1]['batch_normalize'] = '0' # pre-populate with zeros (may be overwritten later) mdefs[-1]['feature'] = 'no' mdefs[-1]['dilation'] = '1' mdefs[-1]['bias'] = '1' mdefs[-1]['quantization'] = '0' else: mdefs[-1]['feature'] = 'no' else: key, val = line.split("=") key = key.rstrip() mdefs[-1][key] = val.strip() return mdefs def create_backbone(self,cfg, module_defs): # Constructs module list of layer blocks from module configuration in module_defs output_filters = [int(cfg.INPUT.CHANNELS)] module_list = nn.ModuleList() features = [] # list of layers which rout to detection layes routs = [] # list of layers which rout to deeper layes l2_norm_index = 0 l2_norm = 0 for i, mdef in enumerate(module_defs): modules = nn.Sequential() # print(mdef) if mdef['type'] == 'convolutional': bn = int(mdef['batch_normalize']) quantization = int(mdef['quantization']) filters = int(mdef['filters']) kernel_size = int(mdef['size']) pad = int(mdef['pad']) if mdef['bias']=='1': bias=True else: bias=False if quantization == 0: modules.add_module('Conv2d', nn.Conv2d(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, dilation=int(mdef['dilation']),bias=bias)) if bn: modules.add_module('BatchNorm2d', nn.BatchNorm2d(filters, momentum=0.1)) elif self.quan_type=='dorefa': # print('Q') modules.add_module('Conv2d', self.quan_conv(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, dilation=int(mdef['dilation']), a_bits=self.abits, w_bits=self.wbits,bias=bias)) if bn: modules.add_module('BatchNorm2d', nn.BatchNorm2d(filters, momentum=0.1)) elif self.quan_type=='IAO': if bn: modules.add_module('Conv2d', self.quan_conv_bn(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, dilation=int(mdef['dilation']), a_bits=self.abits, w_bits=self.wbits,bias=False))##BN_fold这一版默认没有bias #默认对称量化 量化零点为0 else: modules.add_module('Conv2d', self.quan_conv(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, dilation=int(mdef['dilation']), a_bits=self.abits, w_bits=self.wbits,bias=bias)) elif self.quan_type=='BWN': modules.add_module('Conv2d', self.quan_conv(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, dilation=int(mdef['dilation']), A=self.abits, W=self.wbits, bias=bias)) if bn: modules.add_module('BatchNorm2d', nn.BatchNorm2d(filters, momentum=0.1)) if mdef['activation'] == 'leaky': modules.add_module('activation', nn.LeakyReLU(0.1, inplace=True)) elif mdef['activation'] == 'relu': modules.add_module('activation', nn.ReLU(inplace=True)) elif mdef['activation'] == 'relu6': modules.add_module('activation', relu6()) elif mdef['activation'] == 'h_swish': modules.add_module('activation', h_swish()) elif mdef['type'] == 'depthwise': bn = int(mdef['batch_normalize']) filters = int(mdef['filters']) kernel_size = int(mdef['size']) pad = int(mdef['pad']) quantization = int(mdef['quantization']) if mdef['bias'] == '1': bias = True else: bias = False if quantization == 0: modules.add_module('DepthWise2d', nn.Conv2d(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, groups=output_filters[-1], dilation=int(mdef['dilation']), bias=bias)) if bn: modules.add_module('BatchNorm2d', nn.BatchNorm2d(filters, momentum=0.1)) elif self.quan_type=='dorefa': # print('Q') modules.add_module('DepthWise2d', self.quan_conv(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, dilation=int(mdef['dilation']), groups=output_filters[-1], a_bits=self.abits, w_bits=self.wbits,bias=bias)) if bn: modules.add_module('BatchNorm2d', nn.BatchNorm2d(filters, momentum=0.1)) elif self.quan_type=='IAO': if bn: modules.add_module('Conv2d', self.quan_conv_bn(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, dilation=int(mdef['dilation']), groups=output_filters[-1], a_bits=self.abits, w_bits=self.wbits,bias=False))##BN_fold这一版默认没有bias #默认对称量化 量化零点为0 else: modules.add_module('Conv2d', self.quan_conv(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, groups=output_filters[-1], dilation=int(mdef['dilation']), a_bits=self.abits, w_bits=self.wbits,bias=bias)) elif self.quan_type=='BWN': modules.add_module('Conv2d', self.quan_conv(in_channels=output_filters[-1], out_channels=filters, kernel_size=kernel_size, stride=int(mdef['stride']), padding=pad, dilation=int(mdef['dilation']), groups=output_filters[-1], A=self.abits, W=self.wbits, bias=bias)) if bn: modules.add_module('BatchNorm2d', nn.BatchNorm2d(filters, momentum=0.1)) if mdef['activation'] == 'leaky': modules.add_module('activation', nn.LeakyReLU(0.1, inplace=True)) elif mdef['activation'] == 'relu': modules.add_module('activation', nn.ReLU(inplace=True)) elif mdef['activation'] == 'relu6': modules.add_module('activation', relu6()) elif mdef['activation'] == 'h_swish': modules.add_module('activation', h_swish()) #不能加else 会影响linear不激活 elif mdef['type'] == 'shortcut': # nn.Sequential() placeholder for 'shortcut' layer layer = int(mdef['from']) filters = output_filters[layer] routs.extend([i + layer if layer < 0 else layer]) elif mdef['type'] == 'maxpool': kernel_size = int(mdef['size']) stride = int(mdef['stride']) ceil_mode = True if int(mdef['ceil_mode']) else False maxpool = nn.MaxPool2d(kernel_size=kernel_size, stride=stride, padding=int(mdef['pad']), ceil_mode=ceil_mode)#https://www.cnblogs.com/xxxxxxxxx/p/11529343.html ceilmode modules = maxpool else: print("Error type!") raise Exception if mdef['feature'] == 'linear': # 传入预测层 features.append(i) elif mdef['feature'] == 'l2_norm': features.append(i) l2_norm_index = i l2_norm = L2Norm(filters) # Register module list and number of output filters module_list.append(modules) output_filters.append(filters) return module_list, l2_norm_index, features, l2_norm,routs def reset_parameters(self): for m in self.module_list.modules(): if isinstance(m, nn.Conv2d): nn.init.kaiming_uniform_(m.weight) if m.bias is not None: nn.init.zeros_(m.bias) def forward(self, x): layer_outputs = [] features=[] for i, (mdef, module) in enumerate(zip(self.module_defs, self.module_list)): mtype = mdef['type'] if mtype in ['convolutional', 'depthwise', 'se', 'upsample', 'maxpool']: x = module(x)#过卷积、激活 # #打印中间输出 # import numpy as np # import sys # np.set_printoptions(threshold=sys.maxsize) # 全部输出,无省略号 # np.set_printoptions(suppress=True) # 不用指数e # print(x.shape) # # print(x.cpu().numpy()) # np.savetxt(f'fpga/{i}_{x.shape}.txt', x.flatten().cpu().numpy()) # # #模拟fpga量化特征值 # # 给你一个weight.txt和bias.txt的float型数据 # # 跑你现在的ssd网络,针对每一层的输出特征,进行量化(找到这一层的最大值(因为是relu,所以最小值可以不管)之后最大值如果是56,可以用2 ^ 6 # # 表示,那么这一层的数同时乘以再除以2 ^ 9(此处用short型或者int16型,之后传到下一层)) # max=torch.max(x) # # print(max) # for bit in range(15):#16bit量化 符号位占一位 # if max<pow(2,bit): # zhengshu=bit#整数部分用几位 # break # xiaoshu=15-zhengshu # # print(xiaoshu) # # print((x*torch.tensor([pow(2,xiaoshu)]).cuda()).int().float()) # x=(x*torch.tensor([pow(2,xiaoshu)]).cuda()).int().float()/torch.tensor([pow(2,xiaoshu)]).cuda() # # print(x_copy-x) # # print('max:') # print(torch.max(x)) ######### elif mtype == 'shortcut': x = x + layer_outputs[int(mdef['from'])] layer_outputs.append(x if i in self.routs else []) if i in self.features: if i!=self.l2_norm_index: features.append(x) else:#l2_norm feature=self.l2_norm(x) features.append(feature) return tuple(features) def bn_fuse(self): #dilation应该不影响bn融合 # Fuse Conv2d + BatchNorm2d layers throughout model BN融合 fused_list = nn.ModuleList() # print(list(self.children())[0])#module_list for a in list(self.children())[0]: # print(a) if isinstance(a, nn.Sequential): for i, b in enumerate(a): if isinstance(b, nn.modules.batchnorm.BatchNorm2d): # print(1) # # fuse this bn layer with the previous conv2d layer # print(a[i-1]) # print(b) # print(*list(a.children())[i + 1:]) conv = a[i - 1] fused = fuse_conv_and_bn(conv, b) a = nn.Sequential(fused, *list(a.children())[i + 1:]) break fused_list.append(a) self.module_list = fused_list @registry.BACKBONES.register('cfg_backbone') def cfg_backbone(cfg, pretrained=True): model = Backbone(cfg) if pretrained: # print('Load pretrained model from {}'.format(cfg.MODEL.BACKBONE.WEIGHTS)) state = torch.load(cfg.MODEL.BACKBONE.WEIGHTS) if cfg.MODEL.BACKBONE.WEIGHTS.find('ssd') >= 0: #在检测数据集(voc\coco)上的预训练模型,加载全部backbone if 'model' in state.keys(): state = state['model'] name_list = list(state.keys()) num = 0 for i, (mdef, module) in enumerate(zip(model.module_defs, model.module_list)): if mdef['type'] == 'convolutional' or mdef['type'] == 'depthwise': conv_layer = module[0] conv_layer.weight.data.copy_(state[name_list[num]]) num = num + 1 if conv_layer.bias is not None: conv_layer.bias.data.copy_(state[name_list[num]]) ##可能之前的全精度权重有bias,IAO没有 if mdef['bias']=='1': num=num+1 if mdef['batch_normalize'] == '1': if isinstance(conv_layer, IAO.BNFold_Conv2d_Q): # iIAO bn conv_layer.gamma.data.copy_(state[name_list[num]]) num = num + 1 conv_layer.beta.data.copy_(state[name_list[num]]) num = num + 1 conv_layer.running_mean.data.copy_(state[name_list[num]]) num = num + 1 conv_layer.running_var.data.copy_(state[name_list[num]]) num = num + 2 # 跳过num_batches_tracked else: # Load BN bias, weights, running mean and running variance bn_layer = module[1] bn_layer.weight.data.copy_(state[name_list[num]]) num = num + 1 bn_layer.bias.data.copy_(state[name_list[num]]) num = num + 1 bn_layer.running_mean.data.copy_(state[name_list[num]]) num = num + 1 bn_layer.running_var.data.copy_(state[name_list[num]]) num = num + 2 # 跳过num_batches_tracked else:#加载在分类数据集(imagenet)上的权重,只加载reduce_fc的部分 name_list = list(state.keys()) num = 0 for i, (mdef, module) in enumerate(zip(model.module_defs, model.module_list)): if mdef['type'] == 'convolutional' or mdef['type'] == 'depthwise': conv_layer = module[0] conv_layer.weight.data.copy_(state[name_list[num]]) num = num + 1 if conv_layer.bias is not None: conv_layer.bias.data.copy_(state[name_list[num]]) num = num + 1 if mdef['batch_normalize'] == '1': # Load BN bias, weights, running mean and running variance bn_layer = module[1] bn_layer.weight.data.copy_(state[name_list[num]]) num = num + 1 bn_layer.bias.data.copy_(state[name_list[num]]) num = num + 1 bn_layer.running_mean.data.copy_(state[name_list[num]]) num = num + 1 bn_layer.running_var.data.copy_(state[name_list[num]]) num = num + 2 # 跳过num_batches_tracked if 'backbone' in mdef.keys():#加载在分类数据集(imagenet)上的权重,只加载reduce_fc的部分,之后不加载 break return model if __name__=='__main__': from ssd.config import cfg model = Backbone(cfg) print(model)
[ 1, 396, 1738, 29914, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29901, 9420, 29899, 29947, 13, 29937, 13361, 29901, 29990, 29884, 29925, 996, 29911, 6241, 13, 29937, 4712, 29901, 29871, 29906, 29900, 29906, 29900, 29914, 29941, 29914, 29896, 29946, 13, 3166, 269, 4928, 29889, 29277, 1053, 365, 29906, 29940, 555, 13, 5215, 4842, 305, 29889, 15755, 29889, 2220, 284, 408, 383, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 5215, 4842, 305, 13, 3166, 269, 4928, 29889, 4299, 292, 1053, 21235, 13, 5215, 2897, 13, 5215, 4323, 2133, 29889, 29956, 29939, 29909, 29939, 29889, 29881, 487, 5444, 29889, 9794, 29889, 4422, 29918, 29893, 25621, 29939, 408, 270, 487, 5444, 13, 5215, 4323, 2133, 29889, 29956, 29939, 29909, 29939, 29889, 10764, 29949, 29889, 9794, 29889, 4422, 29918, 29893, 25621, 29939, 408, 306, 29909, 29949, 13, 5215, 4323, 2133, 29889, 29956, 29890, 29956, 29873, 4920, 29889, 9794, 29889, 4422, 29918, 14554, 29918, 29890, 370, 408, 350, 16048, 13, 1753, 285, 1509, 29918, 20580, 29918, 392, 29918, 11197, 29898, 20580, 29892, 289, 29876, 1125, 13, 1678, 396, 2045, 597, 371, 3123, 554, 29894, 29889, 510, 29914, 14080, 29914, 29888, 4746, 29899, 16175, 12324, 29899, 392, 29899, 20580, 29914, 13, 1678, 411, 4842, 305, 29889, 1217, 29918, 5105, 7295, 13, 4706, 396, 2069, 13, 4706, 285, 3880, 20580, 353, 4842, 305, 29889, 15755, 29889, 1168, 29894, 29906, 29881, 29898, 20580, 29889, 262, 29918, 305, 12629, 29892, 13, 462, 462, 1678, 7602, 29889, 449, 29918, 305, 12629, 29892, 13, 462, 462, 1678, 8466, 29918, 2311, 29922, 20580, 29889, 17460, 29918, 2311, 29892, 13, 462, 462, 1678, 380, 2426, 29922, 20580, 29889, 303, 2426, 29892, 13, 462, 462, 1678, 7164, 29922, 20580, 29889, 12791, 29892, 13, 462, 462, 1678, 270, 8634, 29922, 20580, 29889, 29881, 8634, 29892, 13, 462, 462, 1678, 6471, 29922, 20580, 29889, 13155, 29892, 13, 462, 462, 1678, 24003, 29922, 5574, 29897, 13, 13, 4706, 396, 19012, 18094, 13, 4706, 281, 29918, 20580, 353, 7602, 29889, 7915, 29889, 16513, 2141, 1493, 29898, 20580, 29889, 449, 29918, 305, 12629, 29892, 448, 29896, 29897, 13, 4706, 281, 29918, 11197, 353, 4842, 305, 29889, 6051, 351, 29898, 11197, 29889, 7915, 29889, 4563, 29898, 7345, 305, 29889, 3676, 29898, 11197, 29889, 8961, 718, 289, 29876, 29889, 21094, 29918, 1707, 4961, 13, 4706, 285, 3880, 20580, 29889, 7915, 29889, 8552, 23538, 7345, 305, 29889, 4317, 29898, 29893, 29918, 11197, 29892, 281, 29918, 20580, 467, 1493, 29898, 29888, 3880, 20580, 29889, 7915, 29889, 2311, 22130, 13, 13, 4706, 396, 19012, 18652, 24003, 13, 4706, 565, 7602, 29889, 29890, 3173, 338, 451, 6213, 29901, 13, 9651, 289, 29918, 20580, 353, 7602, 29889, 29890, 3173, 13, 4706, 1683, 29901, 13, 9651, 289, 29918, 20580, 353, 4842, 305, 29889, 3298, 359, 29898, 20580, 29889, 7915, 29889, 2311, 29898, 29900, 8106, 29883, 6191, 580, 13, 4706, 289, 29918, 11197, 353, 289, 29876, 29889, 29890, 3173, 448, 289, 29876, 29889, 7915, 29889, 16109, 29898, 11197, 29889, 21094, 29918, 12676, 467, 4563, 29898, 7345, 305, 29889, 3676, 29898, 11197, 29889, 21094, 29918, 1707, 718, 289, 29876, 29889, 8961, 876, 13, 4706, 285, 3880, 20580, 29889, 29890, 3173, 29889, 8552, 23538, 11197, 29889, 7915, 29889, 16109, 29898, 29890, 29918, 20580, 467, 4563, 29898, 7345, 305, 29889, 3676, 29898, 11197, 29889, 21094, 29918, 1707, 718, 289, 29876, 29889, 8961, 876, 29974, 289, 29918, 11197, 29897, 13, 13, 4706, 736, 285, 3880, 20580, 13, 13, 1990, 3925, 728, 29898, 15755, 29889, 7355, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 10840, 728, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 921, 1125, 13, 4706, 736, 921, 334, 4842, 305, 29889, 18816, 29885, 3398, 29898, 29916, 29897, 13, 13, 13, 1990, 1104, 29884, 29953, 29898, 15755, 29889, 7355, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 2674, 29884, 29953, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 921, 1125, 13, 4706, 736, 383, 29889, 2674, 29884, 29953, 29898, 29916, 29892, 297, 6689, 29922, 5574, 29897, 13, 13, 13, 1990, 298, 29918, 2774, 728, 29898, 15755, 29889, 7355, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 29882, 29918, 2774, 728, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 921, 1125, 13, 4706, 736, 921, 334, 313, 29943, 29889, 2674, 29884, 29953, 29898, 29916, 718, 29871, 29941, 29889, 29900, 29892, 297, 6689, 29922, 5574, 29897, 847, 29871, 29953, 29889, 29900, 29897, 13, 13, 13, 1990, 298, 29918, 18816, 29885, 3398, 29898, 15755, 29889, 7355, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 29882, 29918, 18816, 29885, 3398, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 921, 1125, 13, 4706, 714, 353, 383, 29889, 2674, 29884, 29953, 29898, 29916, 718, 29871, 29941, 29889, 29900, 29892, 297, 6689, 29922, 5574, 29897, 847, 29871, 29953, 29889, 29900, 13, 4706, 736, 714, 13, 13, 13, 1990, 3725, 29898, 15755, 29889, 7355, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8242, 29892, 20376, 29922, 29946, 1125, 13, 4706, 2428, 29898, 1660, 29892, 1583, 467, 1649, 2344, 1649, 580, 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, 13801, 353, 302, 29876, 29889, 16941, 2556, 29898, 13, 9651, 302, 29876, 29889, 12697, 29898, 12719, 29892, 8242, 849, 20376, 29892, 24003, 29922, 8824, 511, 13, 9651, 302, 29876, 29889, 1123, 29931, 29965, 29898, 262, 6689, 29922, 5574, 511, 13, 9651, 302, 29876, 29889, 12697, 29898, 12719, 849, 20376, 29892, 8242, 29892, 24003, 29922, 8824, 511, 13, 9651, 298, 29918, 18816, 29885, 3398, 580, 13, 9651, 396, 302, 29876, 29889, 29903, 335, 29885, 3398, 580, 13, 4706, 1723, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 921, 1125, 13, 4706, 289, 29892, 274, 29892, 17117, 903, 353, 921, 29889, 2311, 580, 13, 4706, 343, 353, 1583, 29889, 485, 29887, 29918, 10109, 29898, 29916, 467, 1493, 29898, 29890, 29892, 274, 29897, 13, 4706, 343, 353, 1583, 29889, 13801, 29898, 29891, 467, 1493, 29898, 29890, 29892, 274, 29892, 29871, 29896, 29892, 29871, 29896, 29897, 13, 4706, 736, 921, 334, 343, 29889, 18837, 29918, 294, 29898, 29916, 29897, 13, 1990, 7437, 15933, 29898, 15755, 29889, 7355, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 274, 16434, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 339, 273, 29918, 1853, 353, 274, 16434, 29889, 13356, 13566, 26664, 8098, 29889, 11116, 13, 4706, 565, 1583, 29889, 339, 273, 29918, 1853, 1275, 525, 29881, 487, 5444, 2396, 13, 9651, 1583, 29889, 339, 273, 29918, 20580, 353, 270, 487, 5444, 29889, 1168, 29894, 29906, 29881, 29918, 29984, 13, 9651, 1583, 29889, 29893, 14836, 353, 274, 16434, 29889, 13356, 13566, 26664, 8098, 29889, 29956, 22698, 29903, 13, 9651, 1583, 29889, 370, 1169, 353, 274, 16434, 29889, 13356, 13566, 26664, 8098, 29889, 2882, 1806, 29903, 13, 4706, 25342, 1583, 29889, 339, 273, 29918, 1853, 1275, 525, 10764, 29949, 2396, 13, 9651, 1583, 29889, 339, 273, 29918, 20580, 29918, 11197, 353, 306, 29909, 29949, 29889, 29933, 22498, 1025, 29918, 1168, 29894, 29906, 29881, 29918, 29984, 29871, 396, 350, 29940, 235, 161, 144, 30733, 235, 177, 176, 234, 190, 134, 13, 9651, 1583, 29889, 339, 273, 29918, 20580, 353, 306, 29909, 29949, 29889, 1168, 29894, 29906, 29881, 29918, 29984, 13, 9651, 1583, 29889, 29893, 14836, 353, 274, 16434, 29889, 13356, 13566, 26664, 8098, 29889, 29956, 22698, 29903, 13, 9651, 1583, 29889, 370, 1169, 353, 274, 16434, 29889, 13356, 13566, 26664, 8098, 29889, 2882, 1806, 29903, 13, 4706, 25342, 1583, 29889, 339, 273, 29918, 1853, 1275, 29915, 29933, 16048, 2396, 13, 9651, 1583, 29889, 339, 273, 29918, 20580, 353, 350, 16048, 29889, 1168, 29894, 29906, 29881, 29918, 29984, 13, 9651, 1583, 29889, 29893, 14836, 353, 274, 16434, 29889, 13356, 13566, 26664, 8098, 29889, 29956, 22698, 29903, 13, 9651, 1583, 29889, 370, 1169, 353, 274, 16434, 29889, 13356, 13566, 26664, 8098, 29889, 2882, 1806, 29903, 13, 9651, 565, 1583, 29889, 370, 1169, 19216, 29906, 29901, 29871, 396, 30810, 30755, 29906, 30413, 30746, 30858, 29906, 30956, 30214, 30746, 30858, 30685, 30959, 13, 18884, 1596, 877, 233, 194, 131, 31704, 31295, 31180, 30705, 1495, 13, 9651, 565, 1583, 29889, 29893, 14836, 19216, 29906, 322, 1583, 29889, 29893, 14836, 19216, 29941, 29901, 13, 18884, 1596, 877, 233, 160, 134, 30908, 31295, 31180, 30705, 1495, 13, 4706, 1583, 29889, 5453, 29918, 1753, 29879, 353, 1583, 29889, 5510, 29918, 4299, 29918, 16859, 29898, 16859, 29889, 20387, 29931, 29889, 29933, 11375, 29933, 12413, 29889, 9207, 29954, 29897, 13, 4706, 1583, 29889, 5453, 29918, 1761, 29892, 1583, 29889, 29880, 29906, 29918, 12324, 29918, 2248, 29892, 1311, 29889, 22100, 29892, 1311, 29889, 29880, 29906, 29918, 12324, 29892, 1311, 29889, 14608, 29879, 29922, 1583, 29889, 3258, 29918, 1627, 15933, 29898, 16859, 29892, 1311, 29889, 5453, 29918, 1753, 29879, 29897, 13, 4706, 1583, 29889, 12071, 29918, 16744, 580, 13, 13, 13, 13, 1678, 822, 6088, 29918, 4299, 29918, 16859, 29898, 1311, 29892, 2084, 1125, 13, 4706, 396, 1459, 29879, 267, 278, 269, 4928, 7546, 5285, 934, 322, 3639, 3883, 15848, 13, 4706, 396, 1596, 29898, 359, 29889, 657, 29883, 9970, 3101, 29937, 234, 190, 160, 30783, 30874, 232, 193, 135, 13, 4706, 396, 1596, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 657, 29883, 9970, 3285, 376, 21546, 636, 29908, 4961, 29871, 396, 31024, 30683, 30429, 30429, 30429, 234, 189, 170, 30895, 31283, 13, 4706, 396, 934, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 657, 29883, 9970, 3285, 376, 21546, 636, 1159, 511, 2084, 511, 525, 29878, 1495, 29871, 396, 31851, 31787, 30346, 30333, 30631, 30594, 30785, 30406, 13, 4706, 934, 29922, 3150, 29898, 2084, 5501, 29878, 1495, 13, 4706, 3454, 353, 934, 29889, 949, 2141, 5451, 28909, 29876, 1495, 13, 4706, 3454, 353, 518, 29916, 363, 921, 297, 3454, 565, 921, 322, 451, 921, 29889, 27382, 2541, 14237, 1495, 29962, 13, 4706, 3454, 353, 518, 29916, 29889, 29878, 17010, 2141, 29880, 17010, 580, 363, 921, 297, 3454, 29962, 29871, 396, 679, 8177, 310, 1424, 19144, 18960, 22459, 13, 4706, 286, 1753, 29879, 353, 5159, 29871, 396, 3883, 15848, 13, 4706, 363, 1196, 297, 3454, 29901, 13, 9651, 565, 1196, 29889, 27382, 2541, 877, 1839, 1125, 29871, 396, 910, 17997, 278, 1369, 310, 263, 716, 2908, 13, 18884, 286, 1753, 29879, 29889, 4397, 3319, 1800, 13, 18884, 286, 1753, 29879, 14352, 29896, 22322, 1853, 2033, 353, 1196, 29961, 29896, 13018, 29896, 1822, 29878, 17010, 580, 13, 18884, 565, 286, 1753, 29879, 14352, 29896, 22322, 1853, 2033, 1275, 525, 535, 4068, 284, 29915, 470, 286, 1753, 29879, 14352, 29896, 22322, 1853, 2033, 1275, 525, 19488, 3538, 2396, 13, 462, 1678, 286, 1753, 29879, 14352, 29896, 22322, 16175, 29918, 8945, 675, 2033, 353, 525, 29900, 29915, 29871, 396, 758, 29899, 7323, 5987, 411, 24786, 313, 13029, 367, 975, 17625, 2678, 29897, 13, 462, 1678, 286, 1753, 29879, 14352, 29896, 22322, 14394, 2033, 353, 525, 1217, 29915, 13, 462, 1678, 286, 1753, 29879, 14352, 29896, 22322, 29881, 8634, 2033, 353, 525, 29896, 29915, 13, 462, 1678, 286, 1753, 29879, 14352, 29896, 22322, 29890, 3173, 2033, 353, 525, 29896, 29915, 13, 462, 1678, 286, 1753, 29879, 14352, 29896, 22322, 12150, 2133, 2033, 353, 525, 29900, 29915, 13, 18884, 1683, 29901, 13, 462, 1678, 286, 1753, 29879, 14352, 29896, 22322, 14394, 2033, 353, 525, 1217, 29915, 13, 9651, 1683, 29901, 13, 18884, 1820, 29892, 659, 353, 1196, 29889, 5451, 703, 543, 29897, 13, 18884, 1820, 353, 1820, 29889, 29878, 17010, 580, 13, 18884, 286, 1753, 29879, 14352, 29896, 3816, 1989, 29962, 353, 659, 29889, 17010, 580, 13, 4706, 736, 286, 1753, 29879, 13, 13, 1678, 822, 1653, 29918, 1627, 15933, 29898, 1311, 29892, 16859, 29892, 3883, 29918, 1753, 29879, 1125, 13, 4706, 396, 1281, 4984, 29879, 3883, 1051, 310, 7546, 10930, 515, 3883, 5285, 297, 3883, 29918, 1753, 29879, 13, 4706, 1962, 29918, 26705, 353, 518, 524, 29898, 16859, 29889, 1177, 12336, 29889, 3210, 2190, 29940, 6670, 29903, 4638, 13, 4706, 3883, 29918, 1761, 353, 302, 29876, 29889, 7355, 1293, 580, 13, 4706, 5680, 353, 5159, 29871, 396, 1051, 310, 15359, 607, 6745, 304, 15326, 6568, 267, 13, 4706, 6745, 29879, 353, 5159, 29871, 396, 1051, 310, 15359, 607, 6745, 304, 25871, 6568, 267, 13, 4706, 301, 29906, 29918, 12324, 29918, 2248, 353, 29871, 29900, 13, 4706, 301, 29906, 29918, 12324, 353, 29871, 29900, 13, 4706, 363, 474, 29892, 286, 1753, 297, 26985, 29898, 5453, 29918, 1753, 29879, 1125, 13, 9651, 10585, 353, 302, 29876, 29889, 16941, 2556, 580, 13, 9651, 396, 1596, 29898, 29885, 1753, 29897, 13, 9651, 565, 286, 1753, 1839, 1853, 2033, 1275, 525, 535, 4068, 284, 2396, 13, 18884, 289, 29876, 353, 938, 29898, 29885, 1753, 1839, 16175, 29918, 8945, 675, 11287, 13, 18884, 4323, 2133, 353, 938, 29898, 29885, 1753, 1839, 12150, 2133, 11287, 13, 18884, 18094, 353, 938, 29898, 29885, 1753, 1839, 26705, 11287, 13, 18884, 8466, 29918, 2311, 353, 938, 29898, 29885, 1753, 1839, 2311, 11287, 13, 18884, 17132, 353, 938, 29898, 29885, 1753, 1839, 8305, 11287, 13, 18884, 565, 286, 1753, 1839, 29890, 3173, 2033, 1360, 29915, 29896, 2396, 13, 462, 1678, 24003, 29922, 5574, 13, 18884, 1683, 29901, 13, 462, 1678, 24003, 29922, 8824, 13, 18884, 565, 4323, 2133, 1275, 29871, 29900, 29901, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 1168, 29894, 29906, 29881, 742, 302, 29876, 29889, 1168, 29894, 29906, 29881, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 965, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 965, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 965, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 965, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 965, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 29890, 3173, 29922, 29890, 3173, 876, 13, 462, 1678, 565, 289, 29876, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 23145, 29940, 555, 29906, 29881, 742, 302, 29876, 29889, 23145, 29940, 555, 29906, 29881, 29898, 26705, 29892, 19399, 29922, 29900, 29889, 29896, 876, 13, 18884, 25342, 1583, 29889, 339, 273, 29918, 1853, 1360, 29915, 29881, 487, 5444, 2396, 13, 462, 1678, 396, 1596, 877, 29984, 1495, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 1168, 29894, 29906, 29881, 742, 1583, 29889, 339, 273, 29918, 20580, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 965, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 965, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 965, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 965, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 965, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 13, 462, 462, 462, 965, 263, 29918, 14836, 29922, 1311, 29889, 370, 1169, 29892, 13, 462, 462, 462, 965, 281, 29918, 14836, 29922, 1311, 29889, 29893, 14836, 29892, 29890, 3173, 29922, 29890, 3173, 876, 13, 462, 1678, 565, 289, 29876, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 23145, 29940, 555, 29906, 29881, 742, 302, 29876, 29889, 23145, 29940, 555, 29906, 29881, 29898, 26705, 29892, 19399, 29922, 29900, 29889, 29896, 876, 13, 18884, 25342, 1583, 29889, 339, 273, 29918, 1853, 1360, 29915, 10764, 29949, 2396, 13, 462, 1678, 565, 289, 29876, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 1168, 29894, 29906, 29881, 742, 1583, 29889, 339, 273, 29918, 20580, 29918, 11197, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 965, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 965, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 965, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 965, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 965, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 13, 462, 462, 462, 965, 263, 29918, 14836, 29922, 1311, 29889, 370, 1169, 29892, 13, 462, 462, 462, 965, 281, 29918, 14836, 29922, 1311, 29889, 29893, 14836, 29892, 29890, 3173, 29922, 8824, 876, 2277, 29933, 29940, 29918, 8771, 30810, 30287, 30845, 31735, 31439, 31423, 30417, 29890, 3173, 29871, 396, 31735, 31439, 30783, 31685, 31180, 30705, 259, 31180, 30705, 236, 158, 185, 30940, 30573, 29900, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 1168, 29894, 29906, 29881, 742, 1583, 29889, 339, 273, 29918, 20580, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 462, 539, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 462, 539, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 462, 539, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 462, 539, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 462, 539, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 13, 462, 462, 462, 462, 539, 263, 29918, 14836, 29922, 1311, 29889, 370, 1169, 29892, 13, 462, 462, 462, 462, 539, 281, 29918, 14836, 29922, 1311, 29889, 29893, 14836, 29892, 29890, 3173, 29922, 29890, 3173, 876, 13, 18884, 25342, 1583, 29889, 339, 273, 29918, 1853, 1360, 29915, 29933, 16048, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 1168, 29894, 29906, 29881, 742, 1583, 29889, 339, 273, 29918, 20580, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 18884, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 18884, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 18884, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 18884, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 18884, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 13, 462, 462, 462, 18884, 319, 29922, 1311, 29889, 370, 1169, 29892, 13, 462, 462, 462, 18884, 399, 29922, 1311, 29889, 29893, 14836, 29892, 24003, 29922, 29890, 3173, 876, 13, 462, 1678, 565, 289, 29876, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 23145, 29940, 555, 29906, 29881, 742, 302, 29876, 29889, 23145, 29940, 555, 29906, 29881, 29898, 26705, 29892, 19399, 29922, 29900, 29889, 29896, 876, 13, 13, 18884, 565, 286, 1753, 1839, 11236, 362, 2033, 1275, 525, 280, 557, 29891, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 11236, 362, 742, 302, 29876, 29889, 3226, 557, 29891, 1123, 29931, 29965, 29898, 29900, 29889, 29896, 29892, 297, 6689, 29922, 5574, 876, 13, 18884, 25342, 286, 1753, 1839, 11236, 362, 2033, 1275, 525, 2674, 29884, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 11236, 362, 742, 302, 29876, 29889, 1123, 29931, 29965, 29898, 262, 6689, 29922, 5574, 876, 13, 18884, 25342, 286, 1753, 1839, 11236, 362, 2033, 1275, 525, 2674, 29884, 29953, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 11236, 362, 742, 1104, 29884, 29953, 3101, 13, 18884, 25342, 286, 1753, 1839, 11236, 362, 2033, 1275, 525, 29882, 29918, 2774, 728, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 11236, 362, 742, 298, 29918, 2774, 728, 3101, 13, 9651, 25342, 286, 1753, 1839, 1853, 2033, 1275, 525, 19488, 3538, 2396, 13, 18884, 289, 29876, 353, 938, 29898, 29885, 1753, 1839, 16175, 29918, 8945, 675, 11287, 13, 18884, 18094, 353, 938, 29898, 29885, 1753, 1839, 26705, 11287, 13, 18884, 8466, 29918, 2311, 353, 938, 29898, 29885, 1753, 1839, 2311, 11287, 13, 18884, 17132, 353, 938, 29898, 29885, 1753, 1839, 8305, 11287, 13, 18884, 4323, 2133, 353, 938, 29898, 29885, 1753, 1839, 12150, 2133, 11287, 13, 18884, 565, 286, 1753, 1839, 29890, 3173, 2033, 1275, 525, 29896, 2396, 13, 462, 1678, 24003, 353, 5852, 13, 18884, 1683, 29901, 13, 462, 1678, 24003, 353, 7700, 13, 18884, 565, 4323, 2133, 1275, 29871, 29900, 29901, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 8498, 386, 29956, 895, 29906, 29881, 742, 302, 29876, 29889, 1168, 29894, 29906, 29881, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 18884, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 18884, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 18884, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 18884, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 18884, 6471, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 18884, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 24003, 29922, 29890, 3173, 876, 13, 462, 1678, 565, 289, 29876, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 23145, 29940, 555, 29906, 29881, 742, 302, 29876, 29889, 23145, 29940, 555, 29906, 29881, 29898, 26705, 29892, 19399, 29922, 29900, 29889, 29896, 876, 13, 18884, 25342, 1583, 29889, 339, 273, 29918, 1853, 1360, 29915, 29881, 487, 5444, 2396, 13, 462, 1678, 396, 1596, 877, 29984, 1495, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 8498, 386, 29956, 895, 29906, 29881, 742, 1583, 29889, 339, 273, 29918, 20580, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 965, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 965, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 965, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 965, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 965, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 13, 462, 462, 462, 965, 6471, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 965, 263, 29918, 14836, 29922, 1311, 29889, 370, 1169, 29892, 13, 462, 462, 462, 965, 281, 29918, 14836, 29922, 1311, 29889, 29893, 14836, 29892, 29890, 3173, 29922, 29890, 3173, 876, 13, 462, 1678, 565, 289, 29876, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 23145, 29940, 555, 29906, 29881, 742, 302, 29876, 29889, 23145, 29940, 555, 29906, 29881, 29898, 26705, 29892, 19399, 29922, 29900, 29889, 29896, 876, 13, 18884, 25342, 1583, 29889, 339, 273, 29918, 1853, 1360, 29915, 10764, 29949, 2396, 13, 462, 1678, 565, 289, 29876, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 1168, 29894, 29906, 29881, 742, 1583, 29889, 339, 273, 29918, 20580, 29918, 11197, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 965, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 965, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 965, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 965, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 965, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 13, 462, 462, 462, 965, 6471, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 965, 263, 29918, 14836, 29922, 1311, 29889, 370, 1169, 29892, 13, 462, 462, 462, 965, 281, 29918, 14836, 29922, 1311, 29889, 29893, 14836, 29892, 29890, 3173, 29922, 8824, 876, 2277, 29933, 29940, 29918, 8771, 30810, 30287, 30845, 31735, 31439, 31423, 30417, 29890, 3173, 29871, 396, 31735, 31439, 30783, 31685, 31180, 30705, 259, 31180, 30705, 236, 158, 185, 30940, 30573, 29900, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 1168, 29894, 29906, 29881, 742, 1583, 29889, 339, 273, 29918, 20580, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 462, 539, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 462, 539, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 462, 539, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 462, 539, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 462, 539, 6471, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 462, 539, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 13, 462, 462, 462, 462, 539, 263, 29918, 14836, 29922, 1311, 29889, 370, 1169, 29892, 13, 462, 462, 462, 462, 539, 281, 29918, 14836, 29922, 1311, 29889, 29893, 14836, 29892, 29890, 3173, 29922, 29890, 3173, 876, 13, 18884, 25342, 1583, 29889, 339, 273, 29918, 1853, 1360, 29915, 29933, 16048, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 1168, 29894, 29906, 29881, 742, 1583, 29889, 339, 273, 29918, 20580, 29898, 262, 29918, 305, 12629, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 18884, 714, 29918, 305, 12629, 29922, 26705, 29892, 13, 462, 462, 462, 18884, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 13, 462, 462, 462, 18884, 380, 2426, 29922, 524, 29898, 29885, 1753, 1839, 303, 2426, 2033, 511, 13, 462, 462, 462, 18884, 7164, 29922, 8305, 29892, 13, 462, 462, 462, 18884, 270, 8634, 29922, 524, 29898, 29885, 1753, 1839, 29881, 8634, 2033, 511, 13, 462, 462, 462, 18884, 6471, 29922, 4905, 29918, 26705, 14352, 29896, 1402, 13, 462, 462, 462, 18884, 319, 29922, 1311, 29889, 370, 1169, 29892, 13, 462, 462, 462, 18884, 399, 29922, 1311, 29889, 29893, 14836, 29892, 24003, 29922, 29890, 3173, 876, 13, 462, 1678, 565, 289, 29876, 29901, 13, 462, 4706, 10585, 29889, 1202, 29918, 5453, 877, 23145, 29940, 555, 29906, 29881, 742, 302, 29876, 29889, 23145, 29940, 555, 29906, 29881, 29898, 26705, 29892, 19399, 29922, 29900, 29889, 29896, 876, 13, 13, 13, 18884, 565, 286, 1753, 1839, 11236, 362, 2033, 1275, 525, 280, 557, 29891, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 11236, 362, 742, 302, 29876, 29889, 3226, 557, 29891, 1123, 29931, 29965, 29898, 29900, 29889, 29896, 29892, 297, 6689, 29922, 5574, 876, 13, 18884, 25342, 286, 1753, 1839, 11236, 362, 2033, 1275, 525, 2674, 29884, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 11236, 362, 742, 302, 29876, 29889, 1123, 29931, 29965, 29898, 262, 6689, 29922, 5574, 876, 13, 18884, 25342, 286, 1753, 1839, 11236, 362, 2033, 1275, 525, 2674, 29884, 29953, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 11236, 362, 742, 1104, 29884, 29953, 3101, 13, 18884, 25342, 286, 1753, 1839, 11236, 362, 2033, 1275, 525, 29882, 29918, 2774, 728, 2396, 13, 462, 1678, 10585, 29889, 1202, 29918, 5453, 877, 11236, 362, 742, 298, 29918, 2774, 728, 3101, 13, 18884, 396, 30413, 30815, 30666, 2870, 259, 30437, 31619, 232, 150, 144, 10660, 30413, 233, 194, 131, 31704, 13, 13, 9651, 25342, 286, 1753, 1839, 1853, 2033, 1275, 525, 12759, 7582, 2396, 29871, 396, 302, 29876, 29889, 16941, 2556, 580, 12983, 363, 525, 12759, 7582, 29915, 7546, 13, 18884, 7546, 353, 938, 29898, 29885, 1753, 1839, 3166, 11287, 13, 18884, 18094, 353, 1962, 29918, 26705, 29961, 13148, 29962, 13, 18884, 6745, 29879, 29889, 21843, 4197, 29875, 718, 7546, 565, 7546, 529, 29871, 29900, 1683, 7546, 2314, 13, 13, 9651, 25342, 286, 1753, 1839, 1853, 2033, 1275, 525, 3317, 10109, 2396, 13, 18884, 8466, 29918, 2311, 353, 938, 29898, 29885, 1753, 1839, 2311, 11287, 13, 18884, 380, 2426, 353, 938, 29898, 29885, 1753, 1839, 303, 2426, 11287, 13, 18884, 2257, 309, 29918, 8513, 353, 5852, 565, 938, 29898, 29885, 1753, 1839, 27696, 29918, 8513, 11287, 1683, 7700, 13, 18884, 4236, 10109, 353, 302, 29876, 29889, 7976, 11426, 29906, 29881, 29898, 17460, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 380, 2426, 29922, 303, 2426, 29892, 7164, 29922, 524, 29898, 29885, 1753, 1839, 8305, 2033, 511, 13, 462, 462, 539, 2257, 309, 29918, 8513, 29922, 27696, 29918, 8513, 29897, 29937, 991, 597, 1636, 29889, 18038, 25762, 29889, 510, 29914, 14633, 4419, 12353, 29914, 29886, 29914, 29896, 29896, 29945, 29906, 29929, 29941, 29946, 29941, 29889, 1420, 2257, 309, 8513, 13, 18884, 10585, 353, 4236, 10109, 13, 9651, 1683, 29901, 13, 18884, 1596, 703, 2392, 1134, 29991, 1159, 13, 18884, 12020, 8960, 13, 9651, 565, 286, 1753, 1839, 14394, 2033, 1275, 525, 10660, 2396, 29871, 396, 29871, 31471, 30752, 236, 165, 135, 31851, 232, 180, 133, 13, 18884, 5680, 29889, 4397, 29898, 29875, 29897, 13, 9651, 25342, 286, 1753, 1839, 14394, 2033, 1275, 525, 29880, 29906, 29918, 12324, 2396, 13, 18884, 5680, 29889, 4397, 29898, 29875, 29897, 13, 18884, 301, 29906, 29918, 12324, 29918, 2248, 353, 474, 13, 18884, 301, 29906, 29918, 12324, 353, 365, 29906, 29940, 555, 29898, 26705, 29897, 13, 9651, 396, 12577, 3883, 1051, 322, 1353, 310, 1962, 18094, 13, 9651, 3883, 29918, 1761, 29889, 4397, 29898, 7576, 29897, 13, 9651, 1962, 29918, 26705, 29889, 4397, 29898, 26705, 29897, 13, 13, 4706, 736, 3883, 29918, 1761, 29892, 301, 29906, 29918, 12324, 29918, 2248, 29892, 5680, 29892, 301, 29906, 29918, 12324, 29892, 14608, 29879, 13, 1678, 822, 10092, 29918, 16744, 29898, 1311, 1125, 13, 4706, 363, 286, 297, 1583, 29889, 5453, 29918, 1761, 29889, 7576, 7295, 13, 9651, 565, 338, 8758, 29898, 29885, 29892, 302, 29876, 29889, 1168, 29894, 29906, 29881, 1125, 13, 18884, 302, 29876, 29889, 2344, 29889, 1335, 326, 292, 29918, 29590, 23538, 29885, 29889, 7915, 29897, 13, 18884, 565, 286, 29889, 29890, 3173, 338, 451, 6213, 29901, 13, 462, 1678, 302, 29876, 29889, 2344, 29889, 3298, 359, 23538, 29885, 29889, 29890, 3173, 29897, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 921, 1125, 13, 4706, 7546, 29918, 4905, 29879, 353, 5159, 13, 4706, 5680, 29922, 2636, 13, 4706, 363, 474, 29892, 313, 29885, 1753, 29892, 3883, 29897, 297, 26985, 29898, 7554, 29898, 1311, 29889, 5453, 29918, 1753, 29879, 29892, 1583, 29889, 5453, 29918, 1761, 22164, 13, 9651, 286, 1853, 353, 286, 1753, 1839, 1853, 2033, 13, 9651, 565, 286, 1853, 297, 6024, 535, 4068, 284, 742, 525, 19488, 3538, 742, 525, 344, 742, 525, 14340, 981, 742, 525, 3317, 10109, 2033, 29901, 13, 18884, 921, 353, 3883, 29898, 29916, 29897, 29937, 31138, 232, 144, 186, 234, 170, 178, 30330, 233, 194, 131, 31704, 13, 18884, 396, 396, 31656, 232, 144, 179, 30275, 31016, 31573, 30544, 13, 18884, 396, 1053, 12655, 408, 7442, 13, 18884, 396, 1053, 10876, 13, 18884, 396, 7442, 29889, 842, 29918, 558, 8941, 1980, 29898, 386, 12268, 29922, 9675, 29889, 3317, 2311, 29897, 29871, 396, 29871, 30753, 30636, 31573, 30544, 29892, 31352, 31600, 234, 152, 168, 30850, 13, 18884, 396, 7442, 29889, 842, 29918, 558, 8941, 1980, 29898, 19303, 1253, 29922, 5574, 29897, 29871, 396, 29871, 30413, 30406, 31084, 30354, 29872, 13, 18884, 396, 1596, 29898, 29916, 29889, 12181, 29897, 13, 18884, 396, 396, 1596, 29898, 29916, 29889, 21970, 2141, 23749, 3101, 13, 18884, 396, 7442, 29889, 29879, 485, 300, 486, 29898, 29888, 29915, 18091, 3249, 19248, 29875, 3227, 29916, 29889, 12181, 1836, 3945, 742, 921, 29889, 1579, 8606, 2141, 21970, 2141, 23749, 3101, 13, 18884, 396, 13, 18884, 396, 396, 31382, 233, 142, 162, 18091, 3249, 31180, 30705, 31141, 232, 193, 132, 30959, 13, 18884, 396, 396, 29871, 31999, 30919, 30287, 30502, 7915, 29889, 3945, 30503, 29890, 3173, 29889, 3945, 30210, 7411, 30883, 30354, 30763, 13, 18884, 396, 396, 29871, 235, 186, 148, 30919, 31424, 30505, 30210, 893, 29881, 31222, 234, 190, 159, 30214, 236, 149, 139, 30783, 31951, 30287, 232, 180, 133, 30210, 31573, 30544, 31141, 232, 193, 132, 30214, 31174, 30448, 31180, 30705, 30419, 233, 140, 193, 30780, 30810, 30287, 232, 180, 133, 30210, 30878, 30257, 30959, 30419, 31570, 30573, 30392, 2674, 29884, 30214, 30744, 30651, 30878, 30446, 30959, 30682, 30651, 30413, 31624, 30409, 30577, 30822, 30878, 30257, 30959, 30847, 30801, 30392, 29945, 29953, 30214, 30682, 30651, 30406, 29906, 6228, 29871, 29953, 13, 18884, 396, 396, 29871, 30746, 30858, 30214, 31356, 31882, 30810, 30287, 232, 180, 133, 30210, 30354, 30980, 30594, 231, 188, 155, 30651, 31733, 31152, 30651, 29906, 6228, 29871, 29929, 30419, 31389, 31548, 30406, 12759, 30883, 31391, 30767, 524, 29896, 29953, 30883, 30214, 30577, 30822, 31471, 30780, 30557, 30287, 232, 180, 133, 30409, 30409, 13, 18884, 396, 4236, 29922, 7345, 305, 29889, 3317, 29898, 29916, 29897, 13, 18884, 396, 396, 1596, 29898, 3317, 29897, 13, 18884, 396, 363, 2586, 297, 3464, 29898, 29896, 29945, 1125, 29937, 29896, 29953, 2966, 31180, 30705, 1678, 31277, 30850, 30956, 232, 144, 163, 30287, 30956, 13, 18884, 396, 268, 565, 4236, 29966, 12248, 29898, 29906, 29892, 2966, 1125, 13, 18884, 396, 308, 503, 29882, 996, 845, 29884, 29922, 2966, 29937, 233, 152, 183, 30354, 30636, 30748, 30406, 232, 138, 163, 30956, 13, 18884, 396, 308, 2867, 13, 18884, 396, 921, 423, 359, 6905, 29922, 29896, 29945, 29899, 17599, 996, 845, 29884, 13, 18884, 396, 396, 1596, 29898, 29916, 423, 359, 6905, 29897, 13, 18884, 396, 396, 1596, 3552, 29916, 29930, 7345, 305, 29889, 20158, 4197, 12248, 29898, 29906, 29892, 29916, 423, 359, 6905, 4638, 467, 29883, 6191, 16655, 524, 2141, 7411, 3101, 13, 18884, 396, 921, 7607, 29916, 29930, 7345, 305, 29889, 20158, 4197, 12248, 29898, 29906, 29892, 29916, 423, 359, 6905, 4638, 467, 29883, 6191, 16655, 524, 2141, 7411, 580, 29914, 7345, 305, 29889, 20158, 4197, 12248, 29898, 29906, 29892, 29916, 423, 359, 6905, 4638, 467, 29883, 6191, 580, 13, 18884, 396, 396, 1596, 29898, 29916, 29918, 8552, 29899, 29916, 29897, 13, 18884, 396, 13, 18884, 396, 1596, 877, 3317, 29901, 1495, 13, 18884, 396, 1596, 29898, 7345, 305, 29889, 3317, 29898, 29916, 876, 13, 13, 18884, 835, 4136, 2277, 13, 13, 9651, 25342, 286, 1853, 1275, 525, 12759, 7582, 2396, 13, 18884, 921, 353, 921, 718, 7546, 29918, 4905, 29879, 29961, 524, 29898, 29885, 1753, 1839, 3166, 2033, 4638, 13, 9651, 7546, 29918, 4905, 29879, 29889, 4397, 29898, 29916, 565, 474, 297, 1583, 29889, 14608, 29879, 1683, 518, 2314, 13, 9651, 565, 474, 297, 1583, 29889, 22100, 29901, 13, 18884, 565, 474, 19216, 1311, 29889, 29880, 29906, 29918, 12324, 29918, 2248, 29901, 13, 462, 1678, 5680, 29889, 4397, 29898, 29916, 29897, 13, 18884, 1683, 21968, 29880, 29906, 29918, 12324, 13, 462, 1678, 4682, 29922, 1311, 29889, 29880, 29906, 29918, 12324, 29898, 29916, 29897, 13, 462, 1678, 5680, 29889, 4397, 29898, 14394, 29897, 13, 4706, 736, 18761, 29898, 22100, 29897, 13, 1678, 822, 289, 29876, 29918, 29888, 1509, 29898, 1311, 1125, 13, 4706, 396, 29881, 8634, 31370, 31751, 30413, 31619, 232, 150, 144, 11197, 235, 161, 144, 30733, 13, 4706, 396, 383, 1509, 1281, 29894, 29906, 29881, 718, 350, 905, 29940, 555, 29906, 29881, 15359, 10106, 1904, 268, 350, 29940, 235, 161, 144, 30733, 13, 4706, 285, 3880, 29918, 1761, 353, 302, 29876, 29889, 7355, 1293, 580, 13, 4706, 396, 1596, 29898, 1761, 29898, 1311, 29889, 11991, 3101, 29961, 29900, 2314, 29937, 5453, 29918, 1761, 13, 4706, 363, 263, 297, 1051, 29898, 1311, 29889, 11991, 3101, 29961, 29900, 5387, 13, 9651, 396, 1596, 29898, 29874, 29897, 13, 9651, 565, 338, 8758, 29898, 29874, 29892, 302, 29876, 29889, 16941, 2556, 1125, 13, 18884, 363, 474, 29892, 289, 297, 26985, 29898, 29874, 1125, 13, 462, 1678, 565, 338, 8758, 29898, 29890, 29892, 302, 29876, 29889, 7576, 29889, 16175, 12324, 29889, 23145, 29940, 555, 29906, 29881, 1125, 13, 462, 4706, 396, 1596, 29898, 29896, 29897, 13, 462, 4706, 396, 396, 285, 1509, 445, 289, 29876, 7546, 411, 278, 3517, 7602, 29906, 29881, 7546, 13, 462, 4706, 396, 1596, 29898, 29874, 29961, 29875, 29899, 29896, 2314, 13, 462, 4706, 396, 1596, 29898, 29890, 29897, 13, 462, 4706, 396, 1596, 10456, 1761, 29898, 29874, 29889, 11991, 3101, 29961, 29875, 718, 29871, 29896, 29901, 2314, 13, 462, 4706, 7602, 353, 263, 29961, 29875, 448, 29871, 29896, 29962, 13, 462, 4706, 285, 3880, 353, 285, 1509, 29918, 20580, 29918, 392, 29918, 11197, 29898, 20580, 29892, 289, 29897, 13, 462, 4706, 263, 353, 302, 29876, 29889, 16941, 2556, 29898, 29888, 3880, 29892, 334, 1761, 29898, 29874, 29889, 11991, 3101, 29961, 29875, 718, 29871, 29896, 29901, 2314, 13, 462, 4706, 2867, 13, 9651, 285, 3880, 29918, 1761, 29889, 4397, 29898, 29874, 29897, 13, 4706, 1583, 29889, 5453, 29918, 1761, 353, 285, 3880, 29918, 1761, 13, 29992, 1727, 6020, 29889, 29933, 11375, 29933, 1164, 2890, 29889, 9573, 877, 16859, 29918, 1627, 15933, 1495, 13, 1753, 274, 16434, 29918, 1627, 15933, 29898, 16859, 29892, 758, 3018, 1312, 29922, 5574, 1125, 13, 1678, 1904, 353, 7437, 15933, 29898, 16859, 29897, 13, 1678, 565, 758, 3018, 1312, 29901, 13, 4706, 396, 1596, 877, 5896, 758, 3018, 1312, 1904, 515, 6571, 4286, 4830, 29898, 16859, 29889, 20387, 29931, 29889, 29933, 11375, 29933, 12413, 29889, 8851, 22530, 29903, 876, 13, 4706, 2106, 353, 4842, 305, 29889, 1359, 29898, 16859, 29889, 20387, 29931, 29889, 29933, 11375, 29933, 12413, 29889, 8851, 22530, 29903, 29897, 13, 4706, 565, 274, 16434, 29889, 20387, 29931, 29889, 29933, 11375, 29933, 12413, 29889, 8851, 22530, 29903, 29889, 2886, 877, 893, 29881, 1495, 6736, 29871, 29900, 29901, 29871, 396, 30505, 233, 166, 131, 31851, 30354, 30763, 30893, 29898, 29894, 542, 29905, 29883, 6235, 29897, 30429, 30210, 236, 165, 135, 235, 177, 176, 234, 190, 134, 31382, 30883, 30214, 30666, 31526, 30753, 30636, 1627, 15933, 13, 9651, 565, 525, 4299, 29915, 297, 2106, 29889, 8149, 7295, 13, 18884, 2106, 353, 2106, 1839, 4299, 2033, 13, 9651, 1024, 29918, 1761, 353, 1051, 29898, 3859, 29889, 8149, 3101, 13, 9651, 954, 353, 29871, 29900, 13, 9651, 363, 474, 29892, 313, 29885, 1753, 29892, 3883, 29897, 297, 26985, 29898, 7554, 29898, 4299, 29889, 5453, 29918, 1753, 29879, 29892, 1904, 29889, 5453, 29918, 1761, 22164, 13, 18884, 565, 286, 1753, 1839, 1853, 2033, 1275, 525, 535, 4068, 284, 29915, 470, 286, 1753, 1839, 1853, 2033, 1275, 525, 19488, 3538, 2396, 13, 462, 1678, 7602, 29918, 13148, 353, 3883, 29961, 29900, 29962, 13, 462, 1678, 7602, 29918, 13148, 29889, 7915, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 1678, 954, 353, 954, 718, 29871, 29896, 13, 462, 1678, 565, 7602, 29918, 13148, 29889, 29890, 3173, 338, 451, 6213, 29901, 13, 462, 4706, 7602, 29918, 13148, 29889, 29890, 3173, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 1678, 444, 30682, 30815, 30577, 30658, 30210, 30753, 234, 181, 193, 30898, 233, 160, 134, 30908, 30417, 29890, 3173, 29892, 10764, 29949, 31423, 30417, 13, 462, 1678, 565, 286, 1753, 1839, 29890, 3173, 2033, 1360, 29915, 29896, 2396, 13, 462, 4706, 954, 29922, 1949, 29974, 29896, 13, 462, 1678, 565, 286, 1753, 1839, 16175, 29918, 8945, 675, 2033, 1275, 525, 29896, 2396, 13, 462, 4706, 565, 338, 8758, 29898, 20580, 29918, 13148, 29892, 306, 29909, 29949, 29889, 29933, 22498, 1025, 29918, 1168, 29894, 29906, 29881, 29918, 29984, 1125, 29871, 396, 474, 10764, 29949, 289, 29876, 13, 462, 9651, 7602, 29918, 13148, 29889, 4283, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 9651, 954, 353, 954, 718, 29871, 29896, 13, 462, 9651, 7602, 29918, 13148, 29889, 3571, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 9651, 954, 353, 954, 718, 29871, 29896, 13, 462, 9651, 7602, 29918, 13148, 29889, 21094, 29918, 12676, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 9651, 954, 353, 954, 718, 29871, 29896, 13, 462, 9651, 7602, 29918, 13148, 29889, 21094, 29918, 1707, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 9651, 954, 353, 954, 718, 29871, 29906, 29871, 396, 29871, 235, 186, 182, 31138, 1949, 29918, 16175, 267, 29918, 11294, 287, 13, 462, 4706, 1683, 29901, 13, 462, 9651, 396, 16012, 350, 29940, 24003, 29892, 18177, 29892, 2734, 2099, 322, 2734, 20162, 13, 462, 9651, 289, 29876, 29918, 13148, 353, 3883, 29961, 29896, 29962, 13, 462, 9651, 289, 29876, 29918, 13148, 29889, 7915, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 9651, 954, 353, 954, 718, 29871, 29896, 13, 462, 9651, 289, 29876, 29918, 13148, 29889, 29890, 3173, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 9651, 954, 353, 954, 718, 29871, 29896, 13, 462, 9651, 289, 29876, 29918, 13148, 29889, 21094, 29918, 12676, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 9651, 954, 353, 954, 718, 29871, 29896, 13, 462, 9651, 289, 29876, 29918, 13148, 29889, 21094, 29918, 1707, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 9651, 954, 353, 954, 718, 29871, 29906, 29871, 396, 29871, 235, 186, 182, 31138, 1949, 29918, 16175, 267, 29918, 11294, 287, 13, 4706, 1683, 21968, 30666, 31526, 30505, 30748, 30832, 30354, 30763, 30893, 30419, 326, 5370, 300, 29897, 30429, 30210, 233, 160, 134, 30908, 30214, 31557, 30666, 31526, 17469, 29918, 13801, 30210, 30636, 30748, 13, 9651, 1024, 29918, 1761, 353, 1051, 29898, 3859, 29889, 8149, 3101, 13, 9651, 954, 353, 29871, 29900, 13, 9651, 363, 474, 29892, 313, 29885, 1753, 29892, 3883, 29897, 297, 26985, 29898, 7554, 29898, 4299, 29889, 5453, 29918, 1753, 29879, 29892, 1904, 29889, 5453, 29918, 1761, 22164, 13, 18884, 565, 286, 1753, 1839, 1853, 2033, 1275, 525, 535, 4068, 284, 29915, 470, 286, 1753, 1839, 1853, 2033, 1275, 525, 19488, 3538, 2396, 13, 462, 1678, 7602, 29918, 13148, 353, 3883, 29961, 29900, 29962, 13, 462, 1678, 7602, 29918, 13148, 29889, 7915, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 1678, 954, 353, 954, 718, 29871, 29896, 13, 462, 1678, 565, 7602, 29918, 13148, 29889, 29890, 3173, 338, 451, 6213, 29901, 13, 462, 4706, 7602, 29918, 13148, 29889, 29890, 3173, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 4706, 954, 353, 954, 718, 29871, 29896, 13, 462, 1678, 565, 286, 1753, 1839, 16175, 29918, 8945, 675, 2033, 1275, 525, 29896, 2396, 13, 462, 4706, 396, 16012, 350, 29940, 24003, 29892, 18177, 29892, 2734, 2099, 322, 2734, 20162, 13, 462, 4706, 289, 29876, 29918, 13148, 353, 3883, 29961, 29896, 29962, 13, 462, 4706, 289, 29876, 29918, 13148, 29889, 7915, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 4706, 954, 353, 954, 718, 29871, 29896, 13, 462, 4706, 289, 29876, 29918, 13148, 29889, 29890, 3173, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 4706, 954, 353, 954, 718, 29871, 29896, 13, 462, 4706, 289, 29876, 29918, 13148, 29889, 21094, 29918, 12676, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 4706, 954, 353, 954, 718, 29871, 29896, 13, 462, 4706, 289, 29876, 29918, 13148, 29889, 21094, 29918, 1707, 29889, 1272, 29889, 8552, 23538, 3859, 29961, 978, 29918, 1761, 29961, 1949, 24960, 13, 462, 4706, 954, 353, 954, 718, 29871, 29906, 29871, 396, 29871, 235, 186, 182, 31138, 1949, 29918, 16175, 267, 29918, 11294, 287, 13, 18884, 565, 525, 1627, 15933, 29915, 297, 286, 1753, 29889, 8149, 7295, 29937, 30666, 31526, 30505, 30748, 30832, 30354, 30763, 30893, 30419, 326, 5370, 300, 29897, 30429, 30210, 233, 160, 134, 30908, 30214, 31557, 30666, 31526, 17469, 29918, 13801, 30210, 30636, 30748, 29892, 30577, 30822, 30413, 30666, 31526, 13, 462, 1678, 2867, 13, 1678, 736, 1904, 13, 361, 4770, 978, 1649, 1360, 29915, 1649, 3396, 1649, 2396, 13, 1678, 515, 269, 4928, 29889, 2917, 1053, 274, 16434, 13, 1678, 1904, 353, 7437, 15933, 29898, 16859, 29897, 13, 1678, 1596, 29898, 4299, 29897, 13, 13, 13, 2 ]
vlcp/service/connection/tcpserver.py
geek-plus/vlcp
1
20546
<filename>vlcp/service/connection/tcpserver.py ''' Created on 2015/10/19 :author: hubo ''' from vlcp.server.module import Module, api from vlcp.event import TcpServer from vlcp.event.runnable import RoutineContainer from vlcp.event.connection import Client class TcpServerBase(Module): ''' Generic tcp server on specified URLs, vHosts are supported. ''' _default_url = 'tcp:///' _default_connmanage = False _default_client = False service = True def _createprotocol(self, config): return self._protocolclass() def _createServers(self, config, vhostname, defaultconfig = {}, key = None, certificate = None, ca_certs = None, exists = {}, client = False): urls = list(getattr(config, 'urls', [])) if hasattr(config, 'url') and config.url and config.url.strip(): urls.append(config.url.strip()) settings = dict(defaultconfig.items()) if hasattr(config, 'protocol'): settings.update(config.protocol.items()) key = getattr(config, 'key', key) certificate = getattr(config, 'certificate', certificate) ca_certs = getattr(config, 'ca_certs', ca_certs) client = getattr(config, 'client', client) if urls: defaultProtocol = self._createprotocol(config) if self.connmanage: # Patch init() and final() def patch(prococol): orig_init = prococol.init def init(conn): for m in orig_init(conn): yield m self.managed_connections.add(conn) prococol.init = init orig_final = prococol.final def final(conn): try: self.managed_connections.remove(conn) except Exception: pass for m in orig_final(conn): yield m prococol.final = final patch(defaultProtocol) defaultProtocol.vhost = vhostname # Copy extra configurations to protocol for k,v in settings: setattr(defaultProtocol, k, v) for url in urls: if (vhostname, url) in exists: exists.remove((vhostname, url)) else: if client: self.connections.append(self._client_class(config, defaultProtocol, vhostname)(url, defaultProtocol, self.scheduler, key, certificate, ca_certs, getattr(config, 'bindaddress', None))) else: self.connections.append(self._server_class(config, defaultProtocol, vhostname)(url, defaultProtocol, self.scheduler, key, certificate, ca_certs)) if hasattr(config, 'vhost'): for k,v in config.vhost.items(): self._createServers(v, k, settings, key, certificate, ca_certs, exists, client) def _client_class(self, config, protocol, vhost): return Client def _server_class(self, config, protocol, vhost): return TcpServer def __init__(self, server, protocolclass): Module.__init__(self, server) self._protocolclass = protocolclass self.apiroutine = RoutineContainer(self.scheduler) self.managed_connections = set() self._createServers(self, '') self.createAPI(api(self.getservers), api(self.stoplisten, self.apiroutine), api(self.startlisten, self.apiroutine), api(self.updateconfig, self.apiroutine), api(self.getconnections)) def unload(self, container, force=False): if self.connmanage: self.connections.extend(self.managed_connections) self.managed_connections.clear() for m in Module.unload(self, container, force=force): yield m def getservers(self, vhost = None): ''' Return current servers :param vhost: return only servers of vhost if specified. '' to return only default servers. None for all servers. ''' if vhost is not None: return [s for s in self.connections if s.protocol.vhost == vhost] else: return list(self.connections) def stoplisten(self, vhost = None): ''' Stop listen on current servers :param vhost: return only servers of vhost if specified. '' to return only default servers. None for all servers. ''' servers = self.getservers(vhost) for s in servers: for m in s.stoplisten(): yield m self.apiroutine.retvalue = len(servers) def startlisten(self, vhost = None): ''' Start listen on current servers :param vhost: return only servers of vhost if specified. '' to return only default servers. None for all servers. ''' servers = self.getservers(vhost) for s in servers: for m in s.startlisten(): yield m self.apiroutine.retvalue = len(servers) def updateconfig(self): "Reload configurations, remove non-exist servers, add new servers, and leave others unchanged" exists = {} for s in self.connections: exists[(s.protocol.vhost, s.rawurl)] = s self._createServers(self, '', exists = exists) for _,v in exists.items(): for m in v.shutdown(): yield m self.connections.remove(v) self.apiroutine.retvalue = None def getconnections(self, vhost = None): "Return accepted connections, optionally filtered by vhost" if vhost is None: return list(self.managed_connections) else: return [c for c in self.managed_connections if c.protocol.vhost == vhost]
[ 1, 529, 9507, 29958, 20901, 6814, 29914, 5509, 29914, 9965, 29914, 14246, 567, 261, 369, 29889, 2272, 13, 12008, 13, 20399, 373, 29871, 29906, 29900, 29896, 29945, 29914, 29896, 29900, 29914, 29896, 29929, 13, 13, 29901, 8921, 29901, 19766, 29877, 13, 12008, 13, 3166, 14204, 6814, 29889, 2974, 29889, 5453, 1053, 15591, 29892, 7882, 13, 3166, 14204, 6814, 29889, 3696, 1053, 323, 6814, 6004, 13, 3166, 14204, 6814, 29889, 3696, 29889, 3389, 29876, 519, 1053, 20829, 457, 7895, 13, 3166, 14204, 6814, 29889, 3696, 29889, 9965, 1053, 12477, 13, 13, 1990, 323, 6814, 6004, 5160, 29898, 7355, 1125, 13, 1678, 14550, 13, 1678, 3251, 293, 22729, 1923, 373, 6790, 24295, 29892, 325, 8514, 29879, 526, 6969, 29889, 13, 1678, 14550, 13, 1678, 903, 4381, 29918, 2271, 353, 525, 23981, 597, 22208, 13, 1678, 903, 4381, 29918, 13082, 1171, 482, 353, 7700, 13, 1678, 903, 4381, 29918, 4645, 353, 7700, 13, 1678, 2669, 353, 5852, 13, 1678, 822, 903, 3258, 20464, 29898, 1311, 29892, 2295, 1125, 13, 4706, 736, 1583, 3032, 20464, 1990, 580, 13, 1678, 822, 903, 3258, 1748, 874, 29898, 1311, 29892, 2295, 29892, 325, 28988, 29892, 2322, 2917, 353, 24335, 1820, 353, 6213, 29892, 12289, 353, 6213, 29892, 5777, 29918, 6327, 29879, 353, 6213, 29892, 4864, 353, 24335, 3132, 353, 7700, 1125, 13, 4706, 23942, 353, 1051, 29898, 657, 5552, 29898, 2917, 29892, 525, 26045, 742, 5159, 876, 13, 4706, 565, 756, 5552, 29898, 2917, 29892, 525, 2271, 1495, 322, 2295, 29889, 2271, 322, 2295, 29889, 2271, 29889, 17010, 7295, 13, 9651, 23942, 29889, 4397, 29898, 2917, 29889, 2271, 29889, 17010, 3101, 13, 4706, 6055, 353, 9657, 29898, 4381, 2917, 29889, 7076, 3101, 13, 4706, 565, 756, 5552, 29898, 2917, 29892, 525, 20464, 29374, 13, 9651, 6055, 29889, 5504, 29898, 2917, 29889, 20464, 29889, 7076, 3101, 13, 4706, 1820, 353, 679, 5552, 29898, 2917, 29892, 525, 1989, 742, 1820, 29897, 13, 4706, 12289, 353, 679, 5552, 29898, 2917, 29892, 525, 6327, 8021, 742, 12289, 29897, 13, 4706, 5777, 29918, 6327, 29879, 353, 679, 5552, 29898, 2917, 29892, 525, 1113, 29918, 6327, 29879, 742, 5777, 29918, 6327, 29879, 29897, 13, 4706, 3132, 353, 679, 5552, 29898, 2917, 29892, 525, 4645, 742, 3132, 29897, 13, 4706, 565, 23942, 29901, 13, 9651, 2322, 17830, 353, 1583, 3032, 3258, 20464, 29898, 2917, 29897, 13, 9651, 565, 1583, 29889, 13082, 1171, 482, 29901, 13, 18884, 396, 349, 905, 2069, 580, 322, 2186, 580, 13, 18884, 822, 13261, 29898, 15439, 542, 324, 1125, 13, 462, 1678, 1677, 29918, 2344, 353, 9580, 542, 324, 29889, 2344, 13, 462, 1678, 822, 2069, 29898, 13082, 1125, 13, 462, 4706, 363, 286, 297, 1677, 29918, 2344, 29898, 13082, 1125, 13, 462, 9651, 7709, 286, 13, 462, 4706, 1583, 29889, 25240, 29918, 11958, 1953, 29889, 1202, 29898, 13082, 29897, 13, 462, 1678, 9580, 542, 324, 29889, 2344, 353, 2069, 13, 462, 13, 462, 1678, 1677, 29918, 8394, 353, 9580, 542, 324, 29889, 8394, 13, 462, 1678, 822, 2186, 29898, 13082, 1125, 13, 462, 4706, 1018, 29901, 13, 462, 9651, 1583, 29889, 25240, 29918, 11958, 1953, 29889, 5992, 29898, 13082, 29897, 13, 462, 4706, 5174, 8960, 29901, 13, 462, 9651, 1209, 13, 462, 4706, 363, 286, 297, 1677, 29918, 8394, 29898, 13082, 1125, 13, 462, 9651, 7709, 286, 13, 462, 1678, 9580, 542, 324, 29889, 8394, 353, 2186, 13, 18884, 13261, 29898, 4381, 17830, 29897, 13, 9651, 2322, 17830, 29889, 29894, 3069, 353, 325, 28988, 13, 9651, 396, 14187, 4805, 22920, 304, 9608, 13, 9651, 363, 413, 29892, 29894, 297, 6055, 29901, 13, 18884, 731, 5552, 29898, 4381, 17830, 29892, 413, 29892, 325, 29897, 13, 9651, 363, 3142, 297, 23942, 29901, 13, 18884, 565, 313, 29894, 28988, 29892, 3142, 29897, 297, 4864, 29901, 13, 462, 1678, 4864, 29889, 5992, 3552, 29894, 28988, 29892, 3142, 876, 13, 18884, 1683, 29901, 13, 462, 1678, 565, 3132, 29901, 13, 462, 4706, 1583, 29889, 11958, 1953, 29889, 4397, 29898, 1311, 3032, 4645, 29918, 1990, 29898, 2917, 29892, 2322, 17830, 29892, 325, 28988, 5033, 2271, 29892, 2322, 17830, 29892, 1583, 29889, 816, 14952, 29892, 13, 462, 462, 462, 539, 1820, 29892, 12289, 29892, 5777, 29918, 6327, 29879, 29892, 679, 5552, 29898, 2917, 29892, 525, 5355, 7328, 742, 6213, 4961, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1583, 29889, 11958, 1953, 29889, 4397, 29898, 1311, 3032, 2974, 29918, 1990, 29898, 2917, 29892, 2322, 17830, 29892, 325, 28988, 5033, 2271, 29892, 2322, 17830, 29892, 1583, 29889, 816, 14952, 29892, 13, 462, 462, 462, 418, 1820, 29892, 12289, 29892, 5777, 29918, 6327, 29879, 876, 13, 4706, 565, 756, 5552, 29898, 2917, 29892, 525, 29894, 3069, 29374, 13, 9651, 363, 413, 29892, 29894, 297, 2295, 29889, 29894, 3069, 29889, 7076, 7295, 13, 18884, 1583, 3032, 3258, 1748, 874, 29898, 29894, 29892, 413, 29892, 6055, 29892, 1820, 29892, 12289, 29892, 5777, 29918, 6327, 29879, 29892, 4864, 29892, 3132, 29897, 13, 1678, 822, 903, 4645, 29918, 1990, 29898, 1311, 29892, 2295, 29892, 9608, 29892, 325, 3069, 1125, 13, 4706, 736, 12477, 13, 1678, 822, 903, 2974, 29918, 1990, 29898, 1311, 29892, 2295, 29892, 9608, 29892, 325, 3069, 1125, 13, 4706, 736, 323, 6814, 6004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1923, 29892, 9608, 1990, 1125, 13, 4706, 15591, 17255, 2344, 12035, 1311, 29892, 1923, 29897, 13, 4706, 1583, 3032, 20464, 1990, 353, 9608, 1990, 13, 4706, 1583, 29889, 481, 381, 449, 457, 353, 20829, 457, 7895, 29898, 1311, 29889, 816, 14952, 29897, 13, 4706, 1583, 29889, 25240, 29918, 11958, 1953, 353, 731, 580, 13, 4706, 1583, 3032, 3258, 1748, 874, 29898, 1311, 29892, 27255, 13, 4706, 1583, 29889, 3258, 8787, 29898, 2754, 29898, 1311, 29889, 657, 643, 874, 511, 13, 462, 539, 7882, 29898, 1311, 29889, 9847, 20631, 29892, 1583, 29889, 481, 381, 449, 457, 511, 13, 462, 539, 7882, 29898, 1311, 29889, 2962, 20631, 29892, 1583, 29889, 481, 381, 449, 457, 511, 13, 462, 539, 7882, 29898, 1311, 29889, 5504, 2917, 29892, 1583, 29889, 481, 381, 449, 457, 511, 13, 462, 539, 7882, 29898, 1311, 29889, 657, 11958, 1953, 876, 13, 1678, 822, 443, 1359, 29898, 1311, 29892, 5639, 29892, 4889, 29922, 8824, 1125, 13, 4706, 565, 1583, 29889, 13082, 1171, 482, 29901, 13, 9651, 1583, 29889, 11958, 1953, 29889, 21843, 29898, 1311, 29889, 25240, 29918, 11958, 1953, 29897, 13, 9651, 1583, 29889, 25240, 29918, 11958, 1953, 29889, 8551, 580, 13, 4706, 363, 286, 297, 15591, 29889, 348, 1359, 29898, 1311, 29892, 5639, 29892, 4889, 29922, 10118, 1125, 13, 9651, 7709, 286, 13, 1678, 822, 679, 643, 874, 29898, 1311, 29892, 325, 3069, 353, 6213, 1125, 13, 4706, 14550, 13, 4706, 7106, 1857, 12424, 13, 4706, 584, 3207, 325, 3069, 29901, 736, 871, 12424, 310, 325, 3069, 565, 6790, 29889, 6629, 304, 736, 871, 2322, 12424, 29889, 13, 462, 418, 6213, 363, 599, 12424, 29889, 13, 4706, 14550, 13, 4706, 565, 325, 3069, 338, 451, 6213, 29901, 13, 9651, 736, 518, 29879, 363, 269, 297, 1583, 29889, 11958, 1953, 565, 269, 29889, 20464, 29889, 29894, 3069, 1275, 325, 3069, 29962, 13, 4706, 1683, 29901, 13, 9651, 736, 1051, 29898, 1311, 29889, 11958, 1953, 29897, 13, 1678, 822, 5040, 20631, 29898, 1311, 29892, 325, 3069, 353, 6213, 1125, 13, 4706, 14550, 13, 4706, 22303, 11621, 373, 1857, 12424, 13, 4706, 584, 3207, 325, 3069, 29901, 736, 871, 12424, 310, 325, 3069, 565, 6790, 29889, 6629, 304, 736, 871, 2322, 12424, 29889, 13, 462, 418, 6213, 363, 599, 12424, 29889, 13, 4706, 14550, 13, 4706, 12424, 353, 1583, 29889, 657, 643, 874, 29898, 29894, 3069, 29897, 13, 4706, 363, 269, 297, 12424, 29901, 13, 9651, 363, 286, 297, 269, 29889, 9847, 20631, 7295, 13, 18884, 7709, 286, 13, 4706, 1583, 29889, 481, 381, 449, 457, 29889, 2267, 1767, 353, 7431, 29898, 643, 874, 29897, 13, 1678, 822, 1369, 20631, 29898, 1311, 29892, 325, 3069, 353, 6213, 1125, 13, 4706, 14550, 13, 4706, 7370, 11621, 373, 1857, 12424, 13, 4706, 584, 3207, 325, 3069, 29901, 736, 871, 12424, 310, 325, 3069, 565, 6790, 29889, 6629, 304, 736, 871, 2322, 12424, 29889, 13, 462, 418, 6213, 363, 599, 12424, 29889, 13, 4706, 14550, 13, 4706, 12424, 353, 1583, 29889, 657, 643, 874, 29898, 29894, 3069, 29897, 13, 4706, 363, 269, 297, 12424, 29901, 13, 9651, 363, 286, 297, 269, 29889, 2962, 20631, 7295, 13, 18884, 7709, 286, 13, 4706, 1583, 29889, 481, 381, 449, 457, 29889, 2267, 1767, 353, 7431, 29898, 643, 874, 29897, 13, 1678, 822, 2767, 2917, 29898, 1311, 1125, 13, 4706, 376, 29934, 7078, 328, 22920, 29892, 3349, 1661, 29899, 28997, 12424, 29892, 788, 716, 12424, 29892, 322, 5967, 4045, 443, 15033, 29908, 13, 4706, 4864, 353, 6571, 13, 4706, 363, 269, 297, 1583, 29889, 11958, 1953, 29901, 13, 9651, 4864, 15625, 29879, 29889, 20464, 29889, 29894, 3069, 29892, 269, 29889, 1610, 2271, 4638, 353, 269, 13, 4706, 1583, 3032, 3258, 1748, 874, 29898, 1311, 29892, 15516, 4864, 353, 4864, 29897, 13, 4706, 363, 17117, 29894, 297, 4864, 29889, 7076, 7295, 13, 9651, 363, 286, 297, 325, 29889, 845, 329, 3204, 7295, 13, 18884, 7709, 286, 13, 9651, 1583, 29889, 11958, 1953, 29889, 5992, 29898, 29894, 29897, 13, 4706, 1583, 29889, 481, 381, 449, 457, 29889, 2267, 1767, 353, 6213, 13, 1678, 822, 679, 11958, 1953, 29898, 1311, 29892, 325, 3069, 353, 6213, 1125, 13, 4706, 376, 11609, 9259, 12368, 29892, 2984, 635, 22289, 491, 325, 3069, 29908, 13, 4706, 565, 325, 3069, 338, 6213, 29901, 13, 9651, 736, 1051, 29898, 1311, 29889, 25240, 29918, 11958, 1953, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 518, 29883, 363, 274, 297, 1583, 29889, 25240, 29918, 11958, 1953, 565, 274, 29889, 20464, 29889, 29894, 3069, 1275, 325, 3069, 29962, 13, 2 ]
formapi/urls.py
reduxionist/django-formapi
3
73787
<filename>formapi/urls.py # coding=utf-8 from . import views from .api import API from .compat import patterns, url urlpatterns = patterns( '', url(r'discover/$', views.discover, name='api_discover'), url(r'call/(?P<version>.+)/(?P<namespace>\w+)/(?P<call_name>\w+)/$', views.call, name='api_call'), url(r'(?P<version>.+)/(?P<namespace>\w+)/(?P<call>\w+)/', API.as_view(), name='api_view'), )
[ 1, 529, 9507, 29958, 689, 2754, 29914, 26045, 29889, 2272, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 3166, 869, 1053, 8386, 13, 3166, 869, 2754, 1053, 3450, 13, 3166, 869, 12667, 1053, 15038, 29892, 3142, 13, 13, 13, 2271, 11037, 29879, 353, 15038, 29898, 13, 1678, 15516, 13, 1678, 3142, 29898, 29878, 29915, 2218, 11911, 13346, 742, 8386, 29889, 2218, 11911, 29892, 1024, 2433, 2754, 29918, 2218, 11911, 5477, 13, 1678, 3142, 29898, 29878, 29915, 4804, 29914, 10780, 29925, 29966, 3259, 15513, 29974, 6802, 10780, 29925, 29966, 22377, 14247, 29893, 29974, 6802, 10780, 29925, 29966, 4804, 29918, 978, 14247, 29893, 29974, 6802, 29938, 742, 13, 4706, 8386, 29889, 4804, 29892, 1024, 2433, 2754, 29918, 4804, 5477, 13, 1678, 3142, 29898, 29878, 29915, 10780, 29925, 29966, 3259, 15513, 29974, 6802, 10780, 29925, 29966, 22377, 14247, 29893, 29974, 6802, 10780, 29925, 29966, 4804, 14247, 29893, 29974, 6802, 742, 3450, 29889, 294, 29918, 1493, 3285, 1024, 2433, 2754, 29918, 1493, 5477, 13, 29897, 13, 2 ]
hello/views.py
CupOfJoe-L/python-docs-hello-django
0
45889
<reponame>CupOfJoe-L/python-docs-hello-django from django.http import HttpResponse from django.shortcuts import render def hello(request): return HttpResponse("Hello, World! And everyone out there! This is the Django Version of the App I'm trying to Deploy.")
[ 1, 529, 276, 1112, 420, 29958, 29907, 786, 2776, 29967, 7297, 29899, 29931, 29914, 4691, 29899, 2640, 29899, 12199, 29899, 14095, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 13, 13, 1753, 22172, 29898, 3827, 1125, 13, 1678, 736, 9056, 5103, 703, 10994, 29892, 2787, 29991, 1126, 14332, 714, 727, 29991, 910, 338, 278, 15337, 10079, 310, 278, 2401, 306, 29915, 29885, 1811, 304, 10034, 2376, 23157, 13, 2 ]
util.py
majora2007/easy-java
1
159680
import re from collections import Counter from re import split from os import chdir, environ from os.path import join, dirname import sys def pyinstaller_get_full_path(filename): """ If bundling files in onefile with pyinstaller, use thise to get the temp directory where file actually resides """ if hasattr(sys, '_MEIPASS'): # PyInstaller >= 1.6 #chdir(sys._MEIPASS) filename = join(sys._MEIPASS, filename) elif '_MEIPASS2' in environ: # PyInstaller < 1.6 (tested on 1.5 only) #chdir(environ['_MEIPASS2']) filename = join(environ['_MEIPASS2'], filename) else: #chdir(dirname(sys.argv[0])) filename = join(dirname(sys.argv[0]), filename) return filename words_path = pyinstaller_get_full_path('words.txt') def word_prob(word): return dictionary[word] / total def words(text): return re.findall('[a-z]+', text.lower()) dictionary = Counter(words(open(words_path).read())) max_word_length = max(map(len, dictionary)) total = float(sum(dictionary.values())) print('Loading words.txt from {0}'.format(words_path)) print('Using word bank of: {0}'.format(total)) def viterbi_segment(text): probs, lasts = [1.0], [0] for i in range(1, len(text) + 1): prob_k, k = max((probs[j] * word_prob(text[j:i]), j) for j in range(max(0, i - max_word_length), i)) probs.append(prob_k) lasts.append(k) words = [] i = len(text) while 0 < i: words.append(text[lasts[i]:i]) i = lasts[i] words.reverse() return words, probs[-1] def first_upper(s): return s[0].upper() + s[1:] def camel_case(s): sentence = ' '.join(viterbi_segment(s.replace('_', '').lower())[0]) word = ''.join(a.capitalize() for a in split('([^a-zA-Z0-9])', sentence) if a.isalnum()) return word[0].lower() + word[1:] def first_chars(s): """ Returns first characters combined of string. ApplicationGroup returns ag """ words = viterbi_segment(s.lower())[0] end = (len(words) - 1) or 1 if len(words) is 1: return ''.join(words[0:end]) else: return ''.join([a[0] for a in words]) def spinal_case(s): sentence = ' '.join(viterbi_segment(s.lower())[0]) word = '-'.join(a.capitalize() for a in split('([^a-zA-Z0-9])', sentence) if a.isalnum()) return word if __name__ == '__main__': sentence = ' '.join(viterbi_segment('RCCBROLE'.lower())[0]) print('sentence: {0}'.format(sentence)) word = ''.join(a.capitalize() for a in split('([^a-zA-Z0-9])', sentence) if a.isalnum()) print('word: {0}'.format(word[0].lower() + word[1:])) #print('application: {0}'.format(first_chars('application'))) #print('applicationgroup: {0}'.format(first_chars('applicationgroup')))
[ 1, 1053, 337, 13, 3166, 16250, 1053, 315, 5336, 13, 3166, 337, 1053, 6219, 13, 13, 3166, 2897, 1053, 521, 3972, 29892, 12471, 13, 3166, 2897, 29889, 2084, 1053, 5988, 29892, 4516, 978, 13, 5215, 10876, 13, 13, 1753, 11451, 6252, 261, 29918, 657, 29918, 8159, 29918, 2084, 29898, 9507, 1125, 13, 1678, 9995, 960, 22813, 1847, 2066, 297, 697, 1445, 411, 11451, 6252, 261, 29892, 671, 445, 29872, 304, 679, 278, 5694, 3884, 988, 934, 2869, 620, 2247, 9995, 13, 1678, 565, 756, 5552, 29898, 9675, 29892, 22868, 2303, 5690, 22933, 29374, 13, 4706, 396, 10772, 3379, 12572, 6736, 29871, 29896, 29889, 29953, 13, 4706, 396, 305, 3972, 29898, 9675, 3032, 2303, 5690, 22933, 29897, 13, 4706, 10422, 353, 5988, 29898, 9675, 3032, 2303, 5690, 22933, 29892, 10422, 29897, 13, 1678, 25342, 22868, 2303, 5690, 22933, 29906, 29915, 297, 12471, 29901, 13, 4706, 396, 10772, 3379, 12572, 529, 29871, 29896, 29889, 29953, 313, 1688, 287, 373, 29871, 29896, 29889, 29945, 871, 29897, 13, 4706, 396, 305, 3972, 29898, 21813, 1839, 29918, 2303, 5690, 22933, 29906, 11287, 13, 4706, 10422, 353, 5988, 29898, 21813, 1839, 29918, 2303, 5690, 22933, 29906, 7464, 10422, 29897, 13, 1678, 1683, 29901, 13, 4706, 396, 305, 3972, 29898, 25721, 29898, 9675, 29889, 19218, 29961, 29900, 12622, 13, 4706, 10422, 353, 5988, 29898, 25721, 29898, 9675, 29889, 19218, 29961, 29900, 11724, 10422, 29897, 13, 268, 13, 1678, 736, 10422, 13, 13, 13, 13, 13, 9303, 29918, 2084, 353, 11451, 6252, 261, 29918, 657, 29918, 8159, 29918, 2084, 877, 9303, 29889, 3945, 1495, 13, 13, 1753, 1734, 29918, 22795, 29898, 1742, 1125, 736, 8600, 29961, 1742, 29962, 847, 3001, 13, 1753, 3838, 29898, 726, 1125, 736, 337, 29889, 2886, 497, 877, 29961, 29874, 29899, 29920, 10062, 742, 1426, 29889, 13609, 3101, 29871, 13, 27126, 353, 315, 5336, 29898, 9303, 29898, 3150, 29898, 9303, 29918, 2084, 467, 949, 22130, 13, 3317, 29918, 1742, 29918, 2848, 353, 4236, 29898, 1958, 29898, 2435, 29892, 8600, 876, 13, 7827, 353, 5785, 29898, 2083, 29898, 27126, 29889, 5975, 22130, 13, 13, 2158, 877, 23456, 3838, 29889, 3945, 515, 426, 29900, 29913, 4286, 4830, 29898, 9303, 29918, 2084, 876, 13, 2158, 877, 15156, 1734, 9124, 310, 29901, 426, 29900, 29913, 4286, 4830, 29898, 7827, 876, 13, 13, 1753, 325, 1524, 5365, 29918, 28192, 29898, 726, 1125, 13, 1678, 2070, 29879, 29892, 1833, 29879, 353, 518, 29896, 29889, 29900, 1402, 518, 29900, 29962, 13, 1678, 363, 474, 297, 3464, 29898, 29896, 29892, 7431, 29898, 726, 29897, 718, 29871, 29896, 1125, 13, 4706, 2070, 29918, 29895, 29892, 413, 353, 4236, 3552, 771, 5824, 29961, 29926, 29962, 334, 1734, 29918, 22795, 29898, 726, 29961, 29926, 29901, 29875, 11724, 432, 29897, 13, 462, 4706, 363, 432, 297, 3464, 29898, 3317, 29898, 29900, 29892, 474, 448, 4236, 29918, 1742, 29918, 2848, 511, 474, 876, 13, 4706, 2070, 29879, 29889, 4397, 29898, 22795, 29918, 29895, 29897, 13, 4706, 1833, 29879, 29889, 4397, 29898, 29895, 29897, 13, 1678, 3838, 353, 5159, 13, 1678, 474, 353, 7431, 29898, 726, 29897, 13, 1678, 1550, 29871, 29900, 529, 474, 29901, 13, 4706, 3838, 29889, 4397, 29898, 726, 29961, 4230, 29879, 29961, 29875, 5387, 29875, 2314, 13, 4706, 474, 353, 1833, 29879, 29961, 29875, 29962, 13, 1678, 3838, 29889, 24244, 580, 13, 1678, 736, 3838, 29892, 2070, 29879, 14352, 29896, 29962, 13, 13, 13, 1753, 937, 29918, 21064, 29898, 29879, 1125, 13, 1678, 736, 269, 29961, 29900, 1822, 21064, 580, 718, 269, 29961, 29896, 17531, 13, 13, 1753, 3949, 295, 29918, 4878, 29898, 29879, 1125, 13, 1678, 10541, 353, 525, 15300, 7122, 29898, 29894, 1524, 5365, 29918, 28192, 29898, 29879, 29889, 6506, 877, 29918, 742, 525, 2824, 13609, 3101, 29961, 29900, 2314, 13, 1678, 1734, 353, 525, 4286, 7122, 29898, 29874, 29889, 5030, 2410, 675, 580, 363, 263, 297, 6219, 877, 4197, 29985, 29874, 29899, 25265, 29899, 29999, 29900, 29899, 29929, 2314, 742, 10541, 29897, 13, 539, 565, 263, 29889, 275, 284, 1949, 3101, 13, 1678, 736, 1734, 29961, 29900, 1822, 13609, 580, 718, 1734, 29961, 29896, 17531, 13, 13, 1753, 937, 29918, 305, 1503, 29898, 29879, 1125, 13, 1678, 9995, 16969, 937, 4890, 12420, 310, 1347, 29889, 8427, 4782, 3639, 946, 9995, 13, 1678, 3838, 353, 325, 1524, 5365, 29918, 28192, 29898, 29879, 29889, 13609, 3101, 29961, 29900, 29962, 13, 1678, 1095, 353, 313, 2435, 29898, 9303, 29897, 448, 29871, 29896, 29897, 470, 29871, 29896, 13, 1678, 565, 7431, 29898, 9303, 29897, 338, 29871, 29896, 29901, 13, 4706, 736, 525, 4286, 7122, 29898, 9303, 29961, 29900, 29901, 355, 2314, 13, 1678, 1683, 29901, 13, 4706, 736, 525, 4286, 7122, 4197, 29874, 29961, 29900, 29962, 363, 263, 297, 3838, 2314, 13, 13, 1753, 805, 979, 29918, 4878, 29898, 29879, 1125, 13, 1678, 10541, 353, 525, 15300, 7122, 29898, 29894, 1524, 5365, 29918, 28192, 29898, 29879, 29889, 13609, 3101, 29961, 29900, 2314, 13, 1678, 1734, 353, 17411, 4286, 7122, 29898, 29874, 29889, 5030, 2410, 675, 580, 363, 263, 297, 6219, 877, 4197, 29985, 29874, 29899, 25265, 29899, 29999, 29900, 29899, 29929, 2314, 742, 10541, 29897, 13, 539, 565, 263, 29889, 275, 284, 1949, 3101, 13, 1678, 736, 1734, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 10541, 353, 525, 15300, 7122, 29898, 29894, 1524, 5365, 29918, 28192, 877, 29934, 4174, 29933, 1672, 1307, 4286, 13609, 3101, 29961, 29900, 2314, 13, 1678, 1596, 877, 18616, 663, 29901, 426, 29900, 29913, 4286, 4830, 29898, 18616, 663, 876, 13, 1678, 1734, 353, 525, 4286, 7122, 29898, 29874, 29889, 5030, 2410, 675, 580, 363, 263, 297, 6219, 877, 4197, 29985, 29874, 29899, 25265, 29899, 29999, 29900, 29899, 29929, 2314, 742, 10541, 29897, 13, 539, 565, 263, 29889, 275, 284, 1949, 3101, 13, 1678, 1596, 877, 1742, 29901, 426, 29900, 29913, 4286, 4830, 29898, 1742, 29961, 29900, 1822, 13609, 580, 718, 1734, 29961, 29896, 29901, 12622, 13, 13, 1678, 396, 2158, 877, 6214, 29901, 426, 29900, 29913, 4286, 4830, 29898, 4102, 29918, 305, 1503, 877, 6214, 29915, 4961, 13, 1678, 396, 2158, 877, 6214, 2972, 29901, 426, 29900, 29913, 4286, 4830, 29898, 4102, 29918, 305, 1503, 877, 6214, 2972, 29915, 4961, 13, 2 ]