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
|
---|---|---|---|---|---|
magenta/models/onsets_frames_transcription/infer.py | zhangxu999/magenta | 17 | 69732 | # Copyright 2020 The Magenta 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.
# Lint as: python3
"""Inference for onset conditioned model.
A histogram summary will be written for every example processed, and the
resulting MIDI and pianoroll images will also be written for every example.
The final summary value is the mean score for all examples.
"""
import collections
import functools
import os
import time
import imageio
from magenta.models.onsets_frames_transcription import constants
from magenta.models.onsets_frames_transcription import data
from magenta.models.onsets_frames_transcription import infer_util
from magenta.models.onsets_frames_transcription import train_util
from note_seq import midi_io
from note_seq import sequences_lib
from note_seq.protobuf import music_pb2
import numpy as np
import six
import tensorflow.compat.v1 as tf
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('master', '',
'Name of the TensorFlow runtime to use.')
tf.app.flags.DEFINE_string('config', 'onsets_frames',
'Name of the config to use.')
tf.app.flags.DEFINE_string('model_dir', None, 'Path to look for checkpoints.')
tf.app.flags.DEFINE_string(
'checkpoint_path', None,
'Filename of the checkpoint to use. If not specified, will use the latest '
'checkpoint')
tf.app.flags.DEFINE_string('examples_path', None,
'Path to test examples TFRecord.')
tf.app.flags.DEFINE_string(
'output_dir', '~/tmp/onsets_frames/infer',
'Path to store output midi files and summary events.')
tf.app.flags.DEFINE_string(
'hparams', '',
'A comma-separated list of `name=value` hyperparameter values.')
tf.app.flags.DEFINE_boolean(
'shuffle_examples', False, 'Whether to shuffle examples.')
tf.app.flags.DEFINE_string(
'log', 'INFO',
'The threshold for what messages will be logged: '
'DEBUG, INFO, WARN, ERROR, or FATAL.')
tf.app.flags.DEFINE_boolean('preprocess_examples', False,
'Whether or not to run preprocessing on examples.')
def model_inference(model_fn,
model_dir,
checkpoint_path,
data_fn,
hparams,
examples_path,
output_dir,
summary_writer,
master,
preprocess_examples,
shuffle_examples):
"""Runs inference for the given examples."""
tf.logging.info('model_dir=%s', model_dir)
tf.logging.info('checkpoint_path=%s', checkpoint_path)
tf.logging.info('examples_path=%s', examples_path)
tf.logging.info('output_dir=%s', output_dir)
estimator = train_util.create_estimator(
model_fn, model_dir, hparams, master=master)
transcription_data = functools.partial(
data_fn, examples=examples_path, preprocess_examples=preprocess_examples,
is_training=False, shuffle_examples=shuffle_examples,
skip_n_initial_records=0)
input_fn = infer_util.labels_to_features_wrapper(transcription_data)
start_time = time.time()
infer_times = []
num_frames = []
file_num = 0
all_metrics = collections.defaultdict(list)
for predictions in estimator.predict(
input_fn, checkpoint_path=checkpoint_path, yield_single_examples=False):
# Remove batch dimension for convenience.
for k in predictions.keys():
if predictions[k].shape[0] != 1:
raise ValueError(
'All predictions must have batch size 1, but shape of '
'{} was: {}'.format(k, + predictions[k].shape[0]))
predictions[k] = predictions[k][0]
end_time = time.time()
infer_time = end_time - start_time
infer_times.append(infer_time)
num_frames.append(predictions['frame_predictions'].shape[0])
tf.logging.info(
'Infer time %f, frames %d, frames/sec %f, running average %f',
infer_time, num_frames[-1], num_frames[-1] / infer_time,
np.sum(num_frames) / np.sum(infer_times))
tf.logging.info('Scoring sequence %s', predictions['sequence_ids'])
sequence_prediction = music_pb2.NoteSequence.FromString(
predictions['sequence_predictions'])
sequence_label = music_pb2.NoteSequence.FromString(
predictions['sequence_labels'])
# Make filenames UNIX-friendly.
filename_chars = six.ensure_text(predictions['sequence_ids'], 'utf-8')
filename_chars = [c if c.isalnum() else '_' for c in filename_chars]
filename_safe = ''.join(filename_chars).rstrip()
filename_safe = '{:04d}_{}'.format(file_num, filename_safe[:200])
file_num += 1
output_file = os.path.join(output_dir, filename_safe + '.mid')
tf.logging.info('Writing inferred midi file to %s', output_file)
midi_io.sequence_proto_to_midi_file(sequence_prediction, output_file)
label_output_file = os.path.join(output_dir, filename_safe + '_label.mid')
tf.logging.info('Writing label midi file to %s', label_output_file)
midi_io.sequence_proto_to_midi_file(sequence_label, label_output_file)
# Also write a pianoroll showing acoustic model output vs labels.
pianoroll_output_file = os.path.join(
output_dir, filename_safe + '_pianoroll.png')
tf.logging.info('Writing acoustic logit/label file to %s',
pianoroll_output_file)
# Calculate frames based on the sequence. Includes any postprocessing done
# to turn raw onsets/frames predictions into the final sequence.
# TODO(fjord): This work is duplicated in metrics.py.
sequence_frame_predictions = sequences_lib.sequence_to_pianoroll(
sequence_prediction,
frames_per_second=data.hparams_frames_per_second(hparams),
min_pitch=constants.MIN_MIDI_PITCH,
max_pitch=constants.MAX_MIDI_PITCH).active
with tf.gfile.GFile(pianoroll_output_file, mode='w') as f:
imageio.imwrite(
f,
infer_util.posterior_pianoroll_image(
predictions['onset_probs'],
predictions['onset_labels'],
predictions['frame_probs'],
predictions['frame_labels'],
sequence_frame_predictions),
format='png')
# Update histogram and current scalar for metrics.
with tf.Graph().as_default(), tf.Session().as_default():
for k, v in predictions.items():
if not k.startswith('metrics/'):
continue
all_metrics[k].extend(v)
histogram_name = k + '_histogram'
metric_summary = tf.summary.histogram(histogram_name, all_metrics[k])
summary_writer.add_summary(metric_summary.eval(), global_step=file_num)
scalar_name = k
metric_summary = tf.summary.scalar(scalar_name, np.mean(all_metrics[k]))
summary_writer.add_summary(metric_summary.eval(), global_step=file_num)
summary_writer.flush()
start_time = time.time()
# Write final mean values for all metrics.
with tf.Graph().as_default(), tf.Session().as_default():
for k, v in all_metrics.items():
final_scalar_name = 'final/' + k
metric_summary = tf.summary.scalar(
final_scalar_name, np.mean(all_metrics[k]))
summary_writer.add_summary(metric_summary.eval())
summary_writer.flush()
def run(config_map, data_fn):
"""Run the infer script."""
output_dir = os.path.expanduser(FLAGS.output_dir)
config = config_map[FLAGS.config]
hparams = config.hparams
hparams.parse(FLAGS.hparams)
# Batch size should always be 1 for inference.
hparams.batch_size = 1
tf.logging.info(hparams)
tf.gfile.MakeDirs(output_dir)
summary_writer = tf.summary.FileWriter(logdir=output_dir)
with tf.Session():
run_config = '\n\n'.join([
'model_dir: ' + FLAGS.model_dir,
'checkpoint_path: ' + str(FLAGS.checkpoint_path),
'examples_path: ' + FLAGS.examples_path,
str(hparams),
])
run_config_summary = tf.summary.text(
'run_config',
tf.constant(run_config, name='run_config'),
collections=[])
summary_writer.add_summary(run_config_summary.eval())
model_inference(
model_fn=config.model_fn,
model_dir=FLAGS.model_dir,
checkpoint_path=FLAGS.checkpoint_path,
data_fn=data_fn,
hparams=hparams,
examples_path=FLAGS.examples_path,
output_dir=output_dir,
summary_writer=summary_writer,
preprocess_examples=FLAGS.preprocess_examples,
master=FLAGS.master,
shuffle_examples=FLAGS.shuffle_examples)
| [
1,
396,
14187,
1266,
29871,
29906,
29900,
29906,
29900,
450,
3561,
6381,
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,
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,
29937,
365,
524,
408,
29901,
3017,
29941,
13,
15945,
29908,
797,
1659,
363,
373,
842,
4195,
287,
1904,
29889,
13,
13,
29909,
9825,
13342,
15837,
674,
367,
3971,
363,
1432,
1342,
19356,
29892,
322,
278,
13,
2914,
292,
341,
1367,
29902,
322,
16782,
272,
3028,
4558,
674,
884,
367,
3971,
363,
1432,
1342,
29889,
13,
1576,
2186,
15837,
995,
338,
278,
2099,
8158,
363,
599,
6455,
29889,
13,
15945,
29908,
13,
13,
5215,
16250,
13,
5215,
2090,
312,
8789,
13,
5215,
2897,
13,
5215,
931,
13,
5215,
1967,
601,
13,
3166,
2320,
6381,
29889,
9794,
29889,
787,
1691,
29918,
19935,
29918,
3286,
3395,
1053,
17727,
13,
3166,
2320,
6381,
29889,
9794,
29889,
787,
1691,
29918,
19935,
29918,
3286,
3395,
1053,
848,
13,
3166,
2320,
6381,
29889,
9794,
29889,
787,
1691,
29918,
19935,
29918,
3286,
3395,
1053,
10115,
29918,
4422,
13,
3166,
2320,
6381,
29889,
9794,
29889,
787,
1691,
29918,
19935,
29918,
3286,
3395,
1053,
7945,
29918,
4422,
13,
3166,
4443,
29918,
11762,
1053,
7145,
29875,
29918,
601,
13,
3166,
4443,
29918,
11762,
1053,
15602,
29918,
1982,
13,
3166,
4443,
29918,
11762,
29889,
17529,
9721,
1053,
4696,
29918,
24381,
29906,
13,
5215,
12655,
408,
7442,
13,
5215,
4832,
13,
5215,
26110,
29889,
12667,
29889,
29894,
29896,
408,
15886,
13,
13,
13,
18823,
10749,
353,
15886,
29889,
932,
29889,
15764,
29889,
18823,
10749,
13,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
1807,
877,
6207,
742,
15516,
13,
462,
965,
525,
1170,
310,
278,
323,
6073,
17907,
10073,
304,
671,
29889,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
1807,
877,
2917,
742,
525,
787,
1691,
29918,
19935,
742,
13,
462,
965,
525,
1170,
310,
278,
2295,
304,
671,
29889,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
1807,
877,
4299,
29918,
3972,
742,
6213,
29892,
525,
2605,
304,
1106,
363,
1423,
9748,
29889,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
1807,
29898,
13,
1678,
525,
3198,
3149,
29918,
2084,
742,
6213,
29892,
13,
1678,
525,
3434,
3871,
310,
278,
1423,
3149,
304,
671,
29889,
960,
451,
6790,
29892,
674,
671,
278,
9281,
525,
13,
1678,
525,
3198,
3149,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
1807,
877,
19057,
29918,
2084,
742,
6213,
29892,
13,
462,
965,
525,
2605,
304,
1243,
6455,
323,
29943,
9182,
29889,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
1807,
29898,
13,
1678,
525,
4905,
29918,
3972,
742,
525,
20038,
7050,
29914,
787,
1691,
29918,
19935,
29914,
262,
571,
742,
13,
1678,
525,
2605,
304,
3787,
1962,
7145,
29875,
2066,
322,
15837,
4959,
29889,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
1807,
29898,
13,
1678,
525,
29882,
7529,
742,
15516,
13,
1678,
525,
29909,
16694,
29899,
25048,
630,
1051,
310,
421,
978,
29922,
1767,
29952,
11266,
15501,
1819,
29889,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
20054,
29898,
13,
1678,
525,
845,
21897,
29918,
19057,
742,
7700,
29892,
525,
8809,
1979,
304,
528,
21897,
6455,
29889,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
1807,
29898,
13,
1678,
525,
1188,
742,
525,
11690,
742,
13,
1678,
525,
1576,
16897,
363,
825,
7191,
674,
367,
13817,
29901,
525,
13,
1678,
525,
18525,
29892,
15233,
29892,
399,
15249,
29892,
14431,
29892,
470,
383,
1299,
1964,
29889,
1495,
13,
13264,
29889,
932,
29889,
15764,
29889,
24405,
8895,
29918,
20054,
877,
1457,
5014,
29918,
19057,
742,
7700,
29892,
13,
462,
9651,
525,
8809,
1979,
470,
451,
304,
1065,
758,
19170,
373,
6455,
29889,
1495,
13,
13,
13,
1753,
1904,
29918,
262,
1659,
29898,
4299,
29918,
9144,
29892,
13,
462,
1678,
1904,
29918,
3972,
29892,
13,
462,
1678,
1423,
3149,
29918,
2084,
29892,
13,
462,
1678,
848,
29918,
9144,
29892,
13,
462,
1678,
298,
7529,
29892,
13,
462,
1678,
6455,
29918,
2084,
29892,
13,
462,
1678,
1962,
29918,
3972,
29892,
13,
462,
1678,
15837,
29918,
13236,
29892,
13,
462,
1678,
5835,
29892,
13,
462,
1678,
758,
5014,
29918,
19057,
29892,
13,
462,
1678,
528,
21897,
29918,
19057,
1125,
13,
29871,
9995,
6558,
29879,
27262,
363,
278,
2183,
6455,
1213,
15945,
13,
29871,
15886,
29889,
21027,
29889,
3888,
877,
4299,
29918,
3972,
16328,
29879,
742,
1904,
29918,
3972,
29897,
13,
29871,
15886,
29889,
21027,
29889,
3888,
877,
3198,
3149,
29918,
2084,
16328,
29879,
742,
1423,
3149,
29918,
2084,
29897,
13,
29871,
15886,
29889,
21027,
29889,
3888,
877,
19057,
29918,
2084,
16328,
29879,
742,
6455,
29918,
2084,
29897,
13,
29871,
15886,
29889,
21027,
29889,
3888,
877,
4905,
29918,
3972,
16328,
29879,
742,
1962,
29918,
3972,
29897,
13,
13,
29871,
4844,
1061,
353,
7945,
29918,
4422,
29889,
3258,
29918,
342,
326,
1061,
29898,
13,
418,
1904,
29918,
9144,
29892,
1904,
29918,
3972,
29892,
298,
7529,
29892,
5835,
29922,
6207,
29897,
13,
13,
29871,
1301,
3395,
29918,
1272,
353,
2090,
312,
8789,
29889,
3846,
29898,
13,
418,
848,
29918,
9144,
29892,
6455,
29922,
19057,
29918,
2084,
29892,
758,
5014,
29918,
19057,
29922,
1457,
5014,
29918,
19057,
29892,
13,
418,
338,
29918,
26495,
29922,
8824,
29892,
528,
21897,
29918,
19057,
29922,
845,
21897,
29918,
19057,
29892,
13,
418,
14383,
29918,
29876,
29918,
11228,
29918,
3757,
4339,
29922,
29900,
29897,
13,
13,
29871,
1881,
29918,
9144,
353,
10115,
29918,
4422,
29889,
21134,
29918,
517,
29918,
22100,
29918,
17699,
29898,
3286,
3395,
29918,
1272,
29897,
13,
13,
29871,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
29871,
10115,
29918,
3706,
353,
5159,
13,
29871,
954,
29918,
19935,
353,
5159,
13,
13,
29871,
934,
29918,
1949,
353,
29871,
29900,
13,
13,
29871,
599,
29918,
2527,
10817,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
13,
29871,
363,
27303,
297,
4844,
1061,
29889,
27711,
29898,
13,
418,
1881,
29918,
9144,
29892,
1423,
3149,
29918,
2084,
29922,
3198,
3149,
29918,
2084,
29892,
7709,
29918,
14369,
29918,
19057,
29922,
8824,
1125,
13,
13,
1678,
396,
15154,
9853,
9927,
363,
29703,
29889,
13,
1678,
363,
413,
297,
27303,
29889,
8149,
7295,
13,
418,
565,
27303,
29961,
29895,
1822,
12181,
29961,
29900,
29962,
2804,
29871,
29896,
29901,
13,
4706,
12020,
7865,
2392,
29898,
13,
9651,
525,
3596,
27303,
1818,
505,
9853,
2159,
29871,
29896,
29892,
541,
8267,
310,
525,
13,
9651,
525,
8875,
471,
29901,
6571,
4286,
4830,
29898,
29895,
29892,
718,
27303,
29961,
29895,
1822,
12181,
29961,
29900,
12622,
13,
418,
27303,
29961,
29895,
29962,
353,
27303,
29961,
29895,
3816,
29900,
29962,
13,
13,
1678,
1095,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
1678,
10115,
29918,
2230,
353,
1095,
29918,
2230,
448,
1369,
29918,
2230,
13,
1678,
10115,
29918,
3706,
29889,
4397,
29898,
262,
571,
29918,
2230,
29897,
13,
1678,
954,
29918,
19935,
29889,
4397,
29898,
27711,
1080,
1839,
2557,
29918,
27711,
1080,
13359,
12181,
29961,
29900,
2314,
13,
1678,
15886,
29889,
21027,
29889,
3888,
29898,
13,
4706,
525,
797,
571,
931,
1273,
29888,
29892,
16608,
1273,
29881,
29892,
16608,
29914,
3471,
1273,
29888,
29892,
2734,
6588,
1273,
29888,
742,
13,
4706,
10115,
29918,
2230,
29892,
954,
29918,
19935,
14352,
29896,
1402,
954,
29918,
19935,
14352,
29896,
29962,
847,
10115,
29918,
2230,
29892,
13,
4706,
7442,
29889,
2083,
29898,
1949,
29918,
19935,
29897,
847,
7442,
29889,
2083,
29898,
262,
571,
29918,
3706,
876,
13,
13,
1678,
15886,
29889,
21027,
29889,
3888,
877,
29903,
2616,
292,
5665,
1273,
29879,
742,
27303,
1839,
16506,
29918,
4841,
11287,
13,
13,
1678,
5665,
29918,
11965,
2463,
353,
4696,
29918,
24381,
29906,
29889,
9842,
20529,
29889,
4591,
1231,
29898,
13,
4706,
27303,
1839,
16506,
29918,
27711,
1080,
11287,
13,
1678,
5665,
29918,
1643,
353,
4696,
29918,
24381,
29906,
29889,
9842,
20529,
29889,
4591,
1231,
29898,
13,
4706,
27303,
1839,
16506,
29918,
21134,
11287,
13,
13,
1678,
396,
8561,
977,
264,
1280,
8291,
6415,
29899,
18326,
368,
29889,
13,
1678,
10422,
29918,
305,
1503,
353,
4832,
29889,
7469,
29918,
726,
29898,
27711,
1080,
1839,
16506,
29918,
4841,
7464,
525,
9420,
29899,
29947,
1495,
13,
1678,
10422,
29918,
305,
1503,
353,
518,
29883,
565,
274,
29889,
275,
284,
1949,
580,
1683,
22868,
29915,
363,
274,
297,
10422,
29918,
305,
1503,
29962,
13,
1678,
10422,
29918,
11177,
353,
525,
4286,
7122,
29898,
9507,
29918,
305,
1503,
467,
29878,
17010,
580,
13,
1678,
10422,
29918,
11177,
353,
22372,
29901,
29900,
29946,
29881,
3227,
29913,
4286,
4830,
29898,
1445,
29918,
1949,
29892,
10422,
29918,
11177,
7503,
29906,
29900,
29900,
2314,
13,
1678,
934,
29918,
1949,
4619,
29871,
29896,
13,
1678,
1962,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4905,
29918,
3972,
29892,
10422,
29918,
11177,
718,
15300,
6563,
1495,
13,
1678,
15886,
29889,
21027,
29889,
3888,
877,
29956,
768,
292,
10115,
1127,
7145,
29875,
934,
304,
1273,
29879,
742,
1962,
29918,
1445,
29897,
13,
1678,
7145,
29875,
29918,
601,
29889,
16506,
29918,
17529,
29918,
517,
29918,
6563,
29875,
29918,
1445,
29898,
16506,
29918,
11965,
2463,
29892,
1962,
29918,
1445,
29897,
13,
13,
1678,
3858,
29918,
4905,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4905,
29918,
3972,
29892,
10422,
29918,
11177,
718,
22868,
1643,
29889,
6563,
1495,
13,
1678,
15886,
29889,
21027,
29889,
3888,
877,
29956,
768,
292,
3858,
7145,
29875,
934,
304,
1273,
29879,
742,
3858,
29918,
4905,
29918,
1445,
29897,
13,
1678,
7145,
29875,
29918,
601,
29889,
16506,
29918,
17529,
29918,
517,
29918,
6563,
29875,
29918,
1445,
29898,
16506,
29918,
1643,
29892,
3858,
29918,
4905,
29918,
1445,
29897,
13,
13,
1678,
396,
3115,
2436,
263,
16782,
272,
3028,
6445,
1274,
18291,
293,
1904,
1962,
7186,
11073,
29889,
13,
1678,
16782,
272,
3028,
29918,
4905,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
13,
4706,
1962,
29918,
3972,
29892,
10422,
29918,
11177,
718,
22868,
29886,
713,
272,
3028,
29889,
2732,
1495,
13,
1678,
15886,
29889,
21027,
29889,
3888,
877,
29956,
768,
292,
1274,
18291,
293,
1480,
277,
29914,
1643,
934,
304,
1273,
29879,
742,
13,
462,
1678,
16782,
272,
3028,
29918,
4905,
29918,
1445,
29897,
13,
1678,
396,
20535,
403,
16608,
2729,
373,
278,
5665,
29889,
512,
27722,
738,
1400,
19170,
2309,
13,
1678,
396,
304,
2507,
10650,
373,
7224,
29914,
19935,
27303,
964,
278,
2186,
5665,
29889,
13,
1678,
396,
14402,
29898,
29888,
29926,
536,
1125,
910,
664,
338,
5141,
9169,
297,
21556,
29889,
2272,
29889,
13,
1678,
5665,
29918,
2557,
29918,
27711,
1080,
353,
15602,
29918,
1982,
29889,
16506,
29918,
517,
29918,
29886,
713,
272,
3028,
29898,
13,
4706,
5665,
29918,
11965,
2463,
29892,
13,
4706,
16608,
29918,
546,
29918,
7496,
29922,
1272,
29889,
29882,
7529,
29918,
19935,
29918,
546,
29918,
7496,
29898,
29882,
7529,
511,
13,
4706,
1375,
29918,
29886,
2335,
29922,
3075,
1934,
29889,
16173,
29918,
29924,
1367,
29902,
29918,
29925,
1806,
3210,
29892,
13,
4706,
4236,
29918,
29886,
2335,
29922,
3075,
1934,
29889,
12648,
29918,
29924,
1367,
29902,
29918,
29925,
1806,
3210,
467,
4925,
13,
1678,
411,
15886,
29889,
29887,
1445,
29889,
29954,
2283,
29898,
29886,
713,
272,
3028,
29918,
4905,
29918,
1445,
29892,
4464,
2433,
29893,
1495,
408,
285,
29901,
13,
418,
1967,
601,
29889,
326,
3539,
29898,
13,
3986,
285,
29892,
13,
3986,
10115,
29918,
4422,
29889,
2490,
261,
1611,
29918,
29886,
713,
272,
3028,
29918,
3027,
29898,
13,
795,
27303,
1839,
787,
300,
29918,
771,
5824,
7464,
13,
795,
27303,
1839,
787,
300,
29918,
21134,
7464,
13,
795,
27303,
1839,
2557,
29918,
771,
5824,
7464,
13,
795,
27303,
1839,
2557,
29918,
21134,
7464,
13,
795,
5665,
29918,
2557,
29918,
27711,
1080,
511,
13,
3986,
3402,
2433,
2732,
1495,
13,
13,
1678,
396,
10318,
9825,
13342,
322,
1857,
17336,
363,
21556,
29889,
13,
1678,
411,
15886,
29889,
9527,
2141,
294,
29918,
4381,
3285,
15886,
29889,
7317,
2141,
294,
29918,
4381,
7295,
13,
418,
363,
413,
29892,
325,
297,
27303,
29889,
7076,
7295,
13,
4706,
565,
451,
413,
29889,
27382,
2541,
877,
2527,
10817,
22208,
1125,
13,
3986,
6773,
13,
4706,
599,
29918,
2527,
10817,
29961,
29895,
1822,
21843,
29898,
29894,
29897,
13,
4706,
9825,
13342,
29918,
978,
353,
413,
718,
22868,
29882,
391,
13342,
29915,
13,
4706,
12714,
29918,
7727,
353,
15886,
29889,
7727,
29889,
29882,
391,
13342,
29898,
29882,
391,
13342,
29918,
978,
29892,
599,
29918,
2527,
10817,
29961,
29895,
2314,
13,
4706,
15837,
29918,
13236,
29889,
1202,
29918,
7727,
29898,
16414,
29918,
7727,
29889,
14513,
3285,
5534,
29918,
10568,
29922,
1445,
29918,
1949,
29897,
13,
4706,
17336,
29918,
978,
353,
413,
13,
4706,
12714,
29918,
7727,
353,
15886,
29889,
7727,
29889,
19529,
279,
29898,
19529,
279,
29918,
978,
29892,
7442,
29889,
12676,
29898,
497,
29918,
2527,
10817,
29961,
29895,
12622,
13,
4706,
15837,
29918,
13236,
29889,
1202,
29918,
7727,
29898,
16414,
29918,
7727,
29889,
14513,
3285,
5534,
29918,
10568,
29922,
1445,
29918,
1949,
29897,
13,
418,
15837,
29918,
13236,
29889,
23126,
580,
13,
13,
1678,
1369,
29918,
2230,
353,
931,
29889,
2230,
580,
13,
13,
29871,
396,
14350,
2186,
2099,
1819,
363,
599,
21556,
29889,
13,
29871,
411,
15886,
29889,
9527,
2141,
294,
29918,
4381,
3285,
15886,
29889,
7317,
2141,
294,
29918,
4381,
7295,
13,
1678,
363,
413,
29892,
325,
297,
599,
29918,
2527,
10817,
29889,
7076,
7295,
13,
418,
2186,
29918,
19529,
279,
29918,
978,
353,
525,
8394,
22208,
718,
413,
13,
418,
12714,
29918,
7727,
353,
15886,
29889,
7727,
29889,
19529,
279,
29898,
13,
3986,
2186,
29918,
19529,
279,
29918,
978,
29892,
7442,
29889,
12676,
29898,
497,
29918,
2527,
10817,
29961,
29895,
12622,
13,
418,
15837,
29918,
13236,
29889,
1202,
29918,
7727,
29898,
16414,
29918,
7727,
29889,
14513,
3101,
13,
1678,
15837,
29918,
13236,
29889,
23126,
580,
13,
13,
13,
1753,
1065,
29898,
2917,
29918,
1958,
29892,
848,
29918,
9144,
1125,
13,
29871,
9995,
6558,
278,
10115,
2471,
1213,
15945,
13,
29871,
1962,
29918,
3972,
353,
2897,
29889,
2084,
29889,
18837,
1792,
29898,
18823,
10749,
29889,
4905,
29918,
3972,
29897,
13,
13,
29871,
2295,
353,
2295,
29918,
1958,
29961,
18823,
10749,
29889,
2917,
29962,
13,
29871,
298,
7529,
353,
2295,
29889,
29882,
7529,
13,
29871,
298,
7529,
29889,
5510,
29898,
18823,
10749,
29889,
29882,
7529,
29897,
13,
13,
29871,
396,
350,
905,
2159,
881,
2337,
367,
29871,
29896,
363,
27262,
29889,
13,
29871,
298,
7529,
29889,
16175,
29918,
2311,
353,
29871,
29896,
13,
13,
29871,
15886,
29889,
21027,
29889,
3888,
29898,
29882,
7529,
29897,
13,
13,
29871,
15886,
29889,
29887,
1445,
29889,
9984,
9170,
29879,
29898,
4905,
29918,
3972,
29897,
13,
13,
29871,
15837,
29918,
13236,
353,
15886,
29889,
7727,
29889,
2283,
10507,
29898,
1188,
3972,
29922,
4905,
29918,
3972,
29897,
13,
13,
29871,
411,
15886,
29889,
7317,
7295,
13,
1678,
1065,
29918,
2917,
353,
11297,
29876,
29905,
29876,
4286,
7122,
4197,
13,
4706,
525,
4299,
29918,
3972,
29901,
525,
718,
383,
4375,
10749,
29889,
4299,
29918,
3972,
29892,
13,
4706,
525,
3198,
3149,
29918,
2084,
29901,
525,
718,
851,
29898,
18823,
10749,
29889,
3198,
3149,
29918,
2084,
511,
13,
4706,
525,
19057,
29918,
2084,
29901,
525,
718,
383,
4375,
10749,
29889,
19057,
29918,
2084,
29892,
13,
4706,
851,
29898,
29882,
7529,
511,
13,
268,
2314,
13,
1678,
1065,
29918,
2917,
29918,
7727,
353,
15886,
29889,
7727,
29889,
726,
29898,
13,
4706,
525,
3389,
29918,
2917,
742,
13,
4706,
15886,
29889,
23362,
29898,
3389,
29918,
2917,
29892,
1024,
2433,
3389,
29918,
2917,
5477,
13,
4706,
16250,
11759,
2314,
13,
1678,
15837,
29918,
13236,
29889,
1202,
29918,
7727,
29898,
3389,
29918,
2917,
29918,
7727,
29889,
14513,
3101,
13,
13,
29871,
1904,
29918,
262,
1659,
29898,
13,
418,
1904,
29918,
9144,
29922,
2917,
29889,
4299,
29918,
9144,
29892,
13,
418,
1904,
29918,
3972,
29922,
18823,
10749,
29889,
4299,
29918,
3972,
29892,
13,
418,
1423,
3149,
29918,
2084,
29922,
18823,
10749,
29889,
3198,
3149,
29918,
2084,
29892,
13,
418,
848,
29918,
9144,
29922,
1272,
29918,
9144,
29892,
13,
418,
298,
7529,
29922,
29882,
7529,
29892,
13,
418,
6455,
29918,
2084,
29922,
18823,
10749,
29889,
19057,
29918,
2084,
29892,
13,
418,
1962,
29918,
3972,
29922,
4905,
29918,
3972,
29892,
13,
418,
15837,
29918,
13236,
29922,
7727,
29918,
13236,
29892,
13,
418,
758,
5014,
29918,
19057,
29922,
18823,
10749,
29889,
1457,
5014,
29918,
19057,
29892,
13,
418,
5835,
29922,
18823,
10749,
29889,
6207,
29892,
13,
418,
528,
21897,
29918,
19057,
29922,
18823,
10749,
29889,
845,
21897,
29918,
19057,
29897,
13,
2
] |
templatizator/domain/container.py | jhonasn/templatizator | 0 | 101566 | '''Container module that instantiate classes to accomplish IoC role'''
from templatizator.domain.repository import ConfigurationRepository, \
VariableRepository, TemplateRepository, TemplateFileRepository, \
ConfigurableRepository, ConfigurableFileRepository
from templatizator.domain.service import ProjectService, \
ConfigurationService, VariableService, TemplateService, ConfigurableService
from templatizator.domain.application import ProjectApplication, \
VariableApplication, TemplateApplication, ConfigurableFileApplication
from templatizator.domain.helper import Event
# pylint: disable=too-few-public-methods
class Container:
'''Static container class that holds the important instances available
for presentation layer
'''
def __init__(self):
raise Exception('Static class is not instantiable')
@staticmethod
def configure():
'''Instantiate events, and DDD layers'''
# events
project_changed_event = Event()
configuration_changed_event = Event()
# repository layer
configuration_repository = ConfigurationRepository()
variable_repository = VariableRepository()
template_repository = TemplateRepository()
template_file_repository = TemplateFileRepository()
configurable_repository = ConfigurableRepository()
configurable_file_repository = ConfigurableFileRepository()
# service layer
# the order affects the event subscribe and publish into the services
variable_service = VariableService(
variable_repository,
project_changed_event
)
template_service = TemplateService(
template_repository,
template_file_repository,
project_changed_event
)
configurable_service = ConfigurableService(
configurable_repository,
configurable_file_repository,
project_changed_event
)
project_service = ProjectService(
configuration_repository, variable_repository, template_repository,
configurable_repository, template_file_repository,
configurable_file_repository, configuration_changed_event,
project_changed_event
)
configuration_service = ConfigurationService(
configuration_repository,
configuration_changed_event
)
# application layer
Container.project_application = ProjectApplication(
project_service,
configuration_service
)
Container.variable_application = VariableApplication(variable_service)
Container.template_application = TemplateApplication(template_service)
Container.configurable_file_application = ConfigurableFileApplication(
configurable_service
)
| [
1,
14550,
7895,
3883,
393,
25112,
4413,
304,
12709,
22244,
29907,
6297,
12008,
30004,
13,
3166,
1350,
572,
271,
466,
1061,
29889,
7247,
29889,
19033,
1053,
20999,
11481,
29892,
320,
30004,
13,
1678,
28736,
11481,
29892,
25663,
11481,
29892,
25663,
2283,
11481,
29892,
320,
30004,
13,
1678,
12782,
21115,
11481,
29892,
12782,
21115,
2283,
11481,
30004,
13,
3166,
1350,
572,
271,
466,
1061,
29889,
7247,
29889,
5509,
1053,
8010,
3170,
29892,
320,
30004,
13,
1678,
20999,
3170,
29892,
28736,
3170,
29892,
25663,
3170,
29892,
12782,
21115,
3170,
30004,
13,
3166,
1350,
572,
271,
466,
1061,
29889,
7247,
29889,
6214,
1053,
8010,
4873,
29892,
320,
30004,
13,
1678,
28736,
4873,
29892,
25663,
4873,
29892,
12782,
21115,
2283,
4873,
30004,
13,
3166,
1350,
572,
271,
466,
1061,
29889,
7247,
29889,
20907,
1053,
6864,
30004,
13,
30004,
13,
30004,
13,
29937,
282,
2904,
524,
29901,
11262,
29922,
517,
29877,
29899,
29888,
809,
29899,
3597,
29899,
23515,
30004,
13,
1990,
21679,
29901,
30004,
13,
1678,
14550,
17046,
5639,
770,
393,
8640,
278,
4100,
8871,
3625,
30004,
13,
1678,
363,
24329,
7546,
30004,
13,
1678,
14550,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
12020,
8960,
877,
17046,
770,
338,
451,
13213,
519,
1495,
30004,
13,
30004,
13,
1678,
732,
7959,
5696,
30004,
13,
1678,
822,
10822,
7295,
30004,
13,
4706,
14550,
3379,
3656,
403,
4959,
29892,
322,
360,
7858,
15359,
12008,
30004,
13,
4706,
396,
4959,
30004,
13,
4706,
2060,
29918,
15033,
29918,
3696,
353,
6864,
26471,
13,
4706,
5285,
29918,
15033,
29918,
3696,
353,
6864,
26471,
13,
30004,
13,
4706,
396,
9810,
7546,
30004,
13,
4706,
5285,
29918,
19033,
353,
20999,
11481,
26471,
13,
4706,
2286,
29918,
19033,
353,
28736,
11481,
26471,
13,
4706,
4472,
29918,
19033,
353,
25663,
11481,
26471,
13,
4706,
4472,
29918,
1445,
29918,
19033,
353,
25663,
2283,
11481,
26471,
13,
4706,
17127,
519,
29918,
19033,
353,
12782,
21115,
11481,
26471,
13,
4706,
17127,
519,
29918,
1445,
29918,
19033,
353,
12782,
21115,
2283,
11481,
26471,
13,
30004,
13,
4706,
396,
2669,
7546,
30004,
13,
4706,
396,
278,
1797,
6602,
29879,
278,
1741,
1014,
13086,
322,
9805,
964,
278,
5786,
30004,
13,
4706,
2286,
29918,
5509,
353,
28736,
3170,
29898,
30004,
13,
9651,
2286,
29918,
19033,
11167,
13,
9651,
2060,
29918,
15033,
29918,
3696,
30004,
13,
4706,
1723,
30004,
13,
4706,
4472,
29918,
5509,
353,
25663,
3170,
29898,
30004,
13,
9651,
4472,
29918,
19033,
11167,
13,
9651,
4472,
29918,
1445,
29918,
19033,
11167,
13,
9651,
2060,
29918,
15033,
29918,
3696,
30004,
13,
4706,
1723,
30004,
13,
4706,
17127,
519,
29918,
5509,
353,
12782,
21115,
3170,
29898,
30004,
13,
9651,
17127,
519,
29918,
19033,
11167,
13,
9651,
17127,
519,
29918,
1445,
29918,
19033,
11167,
13,
9651,
2060,
29918,
15033,
29918,
3696,
30004,
13,
4706,
1723,
30004,
13,
4706,
2060,
29918,
5509,
353,
8010,
3170,
29898,
30004,
13,
9651,
5285,
29918,
19033,
29892,
2286,
29918,
19033,
29892,
4472,
29918,
19033,
11167,
13,
9651,
17127,
519,
29918,
19033,
29892,
4472,
29918,
1445,
29918,
19033,
11167,
13,
9651,
17127,
519,
29918,
1445,
29918,
19033,
29892,
5285,
29918,
15033,
29918,
3696,
11167,
13,
9651,
2060,
29918,
15033,
29918,
3696,
30004,
13,
4706,
1723,
30004,
13,
4706,
5285,
29918,
5509,
353,
20999,
3170,
29898,
30004,
13,
9651,
5285,
29918,
19033,
11167,
13,
9651,
5285,
29918,
15033,
29918,
3696,
30004,
13,
4706,
1723,
30004,
13,
30004,
13,
4706,
396,
2280,
7546,
30004,
13,
4706,
21679,
29889,
4836,
29918,
6214,
353,
8010,
4873,
29898,
30004,
13,
9651,
2060,
29918,
5509,
11167,
13,
9651,
5285,
29918,
5509,
30004,
13,
4706,
1723,
30004,
13,
4706,
21679,
29889,
11918,
29918,
6214,
353,
28736,
4873,
29898,
11918,
29918,
5509,
8443,
13,
4706,
21679,
29889,
6886,
29918,
6214,
353,
25663,
4873,
29898,
6886,
29918,
5509,
8443,
13,
4706,
21679,
29889,
2917,
21115,
29918,
1445,
29918,
6214,
353,
12782,
21115,
2283,
4873,
29898,
30004,
13,
9651,
17127,
519,
29918,
5509,
30004,
13,
4706,
1723,
30004,
13,
2
] |
azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/next_hop_result_py3.py | JonathanGailliez/azure-sdk-for-python | 1 | 1609855 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class NextHopResult(Model):
"""The information about next hop from the specified VM.
:param next_hop_type: Next hop type. Possible values include: 'Internet',
'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal',
'HyperNetGateway', 'None'
:type next_hop_type: str or
~azure.mgmt.network.v2018_10_01.models.NextHopType
:param next_hop_ip_address: Next hop IP Address
:type next_hop_ip_address: str
:param route_table_id: The resource identifier for the route table
associated with the route being returned. If the route being returned does
not correspond to any user created routes then this field will be the
string 'System Route'.
:type route_table_id: str
"""
_attribute_map = {
'next_hop_type': {'key': 'nextHopType', 'type': 'str'},
'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'},
'route_table_id': {'key': 'routeTableId', 'type': 'str'},
}
def __init__(self, *, next_hop_type=None, next_hop_ip_address: str=None, route_table_id: str=None, **kwargs) -> None:
super(NextHopResult, self).__init__(**kwargs)
self.next_hop_type = next_hop_type
self.next_hop_ip_address = next_hop_ip_address
self.route_table_id = route_table_id
| [
1,
396,
14137,
29922,
9420,
29899,
29947,
13,
29937,
448,
2683,
2683,
2683,
2683,
1378,
29899,
13,
29937,
14187,
1266,
313,
29883,
29897,
7783,
15025,
29889,
2178,
10462,
21676,
29889,
13,
29937,
10413,
21144,
1090,
278,
341,
1806,
19245,
29889,
2823,
19245,
29889,
3945,
297,
278,
2060,
3876,
363,
13,
29937,
19405,
2472,
29889,
13,
29937,
13,
29937,
5920,
5759,
491,
7783,
313,
29934,
29897,
11133,
15078,
5920,
3251,
1061,
29889,
13,
29937,
678,
6916,
1122,
4556,
10240,
6030,
322,
674,
367,
5714,
565,
278,
775,
338,
13,
29937,
1072,
759,
630,
29889,
13,
29937,
448,
2683,
2683,
2683,
2683,
1378,
29899,
13,
13,
3166,
10887,
5060,
29889,
15550,
2133,
1053,
8125,
13,
13,
13,
1990,
8084,
29950,
459,
3591,
29898,
3195,
1125,
13,
1678,
9995,
1576,
2472,
1048,
2446,
8171,
515,
278,
6790,
11400,
29889,
13,
13,
1678,
584,
3207,
2446,
29918,
29882,
459,
29918,
1853,
29901,
8084,
8171,
1134,
29889,
20049,
1819,
3160,
29901,
525,
26341,
742,
13,
268,
525,
21287,
2052,
13036,
742,
525,
21287,
13724,
29954,
403,
1582,
742,
525,
29963,
1212,
7717,
742,
13,
268,
525,
26322,
546,
6779,
29954,
403,
1582,
742,
525,
8516,
29915,
13,
1678,
584,
1853,
2446,
29918,
29882,
459,
29918,
1853,
29901,
851,
470,
13,
268,
3695,
17688,
29889,
29885,
29887,
4378,
29889,
11618,
29889,
29894,
29906,
29900,
29896,
29947,
29918,
29896,
29900,
29918,
29900,
29896,
29889,
9794,
29889,
9190,
29950,
459,
1542,
13,
1678,
584,
3207,
2446,
29918,
29882,
459,
29918,
666,
29918,
7328,
29901,
8084,
8171,
5641,
16428,
13,
1678,
584,
1853,
2446,
29918,
29882,
459,
29918,
666,
29918,
7328,
29901,
851,
13,
1678,
584,
3207,
5782,
29918,
2371,
29918,
333,
29901,
450,
6503,
15882,
363,
278,
5782,
1591,
13,
268,
6942,
411,
278,
5782,
1641,
4133,
29889,
960,
278,
5782,
1641,
4133,
947,
13,
268,
451,
3928,
304,
738,
1404,
2825,
12049,
769,
445,
1746,
674,
367,
278,
13,
268,
1347,
525,
3924,
12034,
4286,
13,
1678,
584,
1853,
5782,
29918,
2371,
29918,
333,
29901,
851,
13,
1678,
9995,
13,
13,
1678,
903,
12715,
29918,
1958,
353,
426,
13,
4706,
525,
4622,
29918,
29882,
459,
29918,
1853,
2396,
11117,
1989,
2396,
525,
4622,
29950,
459,
1542,
742,
525,
1853,
2396,
525,
710,
16675,
13,
4706,
525,
4622,
29918,
29882,
459,
29918,
666,
29918,
7328,
2396,
11117,
1989,
2396,
525,
4622,
29950,
459,
29902,
29886,
7061,
742,
525,
1853,
2396,
525,
710,
16675,
13,
4706,
525,
13134,
29918,
2371,
29918,
333,
2396,
11117,
1989,
2396,
525,
13134,
3562,
1204,
742,
525,
1853,
2396,
525,
710,
16675,
13,
1678,
500,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
29892,
2446,
29918,
29882,
459,
29918,
1853,
29922,
8516,
29892,
2446,
29918,
29882,
459,
29918,
666,
29918,
7328,
29901,
851,
29922,
8516,
29892,
5782,
29918,
2371,
29918,
333,
29901,
851,
29922,
8516,
29892,
3579,
19290,
29897,
1599,
6213,
29901,
13,
4706,
2428,
29898,
9190,
29950,
459,
3591,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
4706,
1583,
29889,
4622,
29918,
29882,
459,
29918,
1853,
353,
2446,
29918,
29882,
459,
29918,
1853,
13,
4706,
1583,
29889,
4622,
29918,
29882,
459,
29918,
666,
29918,
7328,
353,
2446,
29918,
29882,
459,
29918,
666,
29918,
7328,
13,
4706,
1583,
29889,
13134,
29918,
2371,
29918,
333,
353,
5782,
29918,
2371,
29918,
333,
13,
2
] |
mhandle_content.py | zyhibook/igotolibrary | 171 | 66325 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# @filename:mhandle_content.py
# @author: wheee/qmppz
# @time:20190709
# @description: handle msg, python3
import configparser
import time
import random
import json
import os
import re
import requests
import sys
# sys.path.append("../..")
# import igotolibrary.mhandle_content as test_mhandle_content
import utils
import crawldata
'''
conf for this py file
refresh first time
'''
# GBCF = utils.GBCF
a_task = utils.Atask()
CF = utils.GBCF()
# add value
CF.task_id = int(utils.get_date().split('_')[0]) - 20180000 + (100 if int(utils.get_date().split('_')[0]) % 2 == 0 else -100) + 1110
requests.adapters.DEFAULT_RETRIES = 5
CF.sess = requests.Session()
CF.sess.keep_alive = False
# sql action
sqlact = utils.SqlAct()
# memcache
mc = utils.MyMemcache()
# debug print
debug_p = utils.debug_p
'''
get_reply_msg from robot
'''
def get_reply_msg(str_info, str_flg='ROBOT', sess=object):
if str_flg == "ROBOT":
# if str_info.find("抢座") >= 0 or str_info.find("帮助") >= 0 :
# return ' '
# turing robot
api_url = 'http://openapi.tuling123.com/openapi/api/v2'
data = {
"reqType": 0, # 输入类型 0-文本, 1-图片, 2-音频
"perception": # 信息参数
{
"inputText": # 文本信息
{
"text": str_info
},
"selfInfo": # 用户参数
{
}
},
"userInfo":
{
"apiKey": ["<KEY>", "<KEY>", "<KEY>"][random.randint(0, 3)],
# 改为自己申请的key
"userId": "0001" # 用户唯一标识(随便填, 非密钥)
}
}
data = json.dumps(data).encode('utf8')
response = requests.post(api_url, data=data, headers={'content-type': 'application/json'})
replys = json.loads(response.text, encoding="UTF-8")
return replys
elif str_flg == "RIGHT":
return str_info
elif str_flg == "ERROR":
return str_info
else:
return "#[E]: 致命错误!"
'''
class for cmd prefix map to function
'''
class CmdFunction():
CMD_HINT = {
'HELP': '请回复:\n\n指令帮助\n\n',
'CMD_HELP': '【抢座指令】请按如下格式发送指令:\n#抢座; 学校英文简称; 自习室id;座位号; 自习室id;座位号; wechat_sess_id; serverid;',
'CMD_CHECK': ' '
}
HELP_INFO = {
}
face_ico = {
'positive': ['😃 ', '😏 ', '😁 ', '😌 ', '😜 ', '😝', '😂 '],
'emmm': ['😂'],
'negative': ['😂', '😰 ', '😭 ', '😱 ', '😨 ', '😷 ', '😔']
}
def getico(flag='emmm'):
if flag == -1:
flag = 'negative'
elif flag == 1:
flag = 'positive'
elif flag == 0:
flag = 'emmm'
return random.choice(CmdFunction.face_ico[flag])
'''
modify_opentime
'''
# @utils.catch_exception
def modify_opentime(userid, content):
# xgqzsj, bjtu, 20:35
# opentime : 20:35
_, schl_abbr, opentime = content.split(CF.USER_CMD_SPLTCH)
opentime = opentime.split('-')[0].replace('.', ':')
# 6:00 --> 06:00
if len(opentime.split(':')[0]) == 1:
opentime = '0' + opentime
# 20:10 --> 20:10:00
if opentime.count(':') == 1:
opentime += ':00'
if not schl_abbr or not opentime or opentime.count(':') < 1:
return 'modify_opentime failed'
# UPDATE schl_lib_stmp SET open_time = '00:00' WHERE schl_abbr like 'bjtu';
sql_update = 'UPDATE ' + sqlact.tb_schl_lib_stmp + ' SET open_time = \'' + opentime + '\' WHERE schl_abbr like \'' + schl_abbr.lower() + '\';'
sqlact.cur.execute(sql_update)
sqlact.conn.commit()
return 'modify_opentime succ'
'''
check school info if exist
'''
def check_school(userid, content):
check_cmd_str = '#查询; 学校英文简称'
info = {
'verify_failed_format': CmdFunction.getico(-1) + '操作失败:【指令格式可能有误】;请按如下指令查询学校信息:\n\n' + check_cmd_str,
'schl_info_not_found': CmdFunction.getico(-1) + '暂无 [{school_info}] 的自习室信息,请发送【添加】指令进行学校信息添加;格式如下:\n\n#添加学校; 学校英文简称; wechat_sess_id; serverid',
'check_succ': CmdFunction.getico(1) + '查询成功,[{school_name}-{schl_abbr}]自习室信息如下:\n\n{classrm_libid}\n开放抢座时间:{open_time}'
}
func_name = '[check_school]'
tmp_ls = content.split(CF.USER_CMD_SPLTCH)
if len(tmp_ls) < 2:
return info['verify_failed_format']
_, schl_abbr = tmp_ls[:2]
# check [school_name] seatmap data exist or not; # {user_name:'',schl_abbr:'', 'open_time':'', school_name:'', classroom:[{'classroom_name':classroom_name,'libid':libid, 'path':classroom_path,'seat_map':''},{},{}...]}
user_conf_dict = sqlact.query_school_info(schl_abbr=schl_abbr) # , libid1='', libid2=libid2)
debug_p('func_name=', func_name, 'query_school_info()', user_conf_dict)
if not user_conf_dict:
# schl_info_not_found
reply_text = info['schl_info_not_found'].replace('{school_info}', schl_abbr)
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
else:
school_name = user_conf_dict.get('school_name', 'school_name')
# schl_info_found
reply_text = info['check_succ'].replace('{school_name}', school_name).replace('{schl_abbr}', schl_abbr).replace('{open_time}', user_conf_dict.get('open_time', '--:--')).replace('{classrm_libid}', '\n'.join([e['classroom_name'] + '-id=' + str(e['libid']) for e in user_conf_dict['classroom']]))
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
'''
force_add_school_info
'''
def force_add_school_info(userid, content):
func_name = '[force_add_school_info]'
debug_p(func_name, 'content=', content)
return CmdFunction.add_school_info(userid=userid, content=content, force=True)
'''
add school info
'''
def add_school_info(userid, content, force=False):
'''
#添加学校; bbmc; wechat_sess_id; serverid
'''
func_name = '[add_school_info]'
info = {
'verify_failed_format': CmdFunction.getico(-1) + '操作失败:【添加指令格式可能有误】;\n在自身没有预约座位和自习室开放的状态下,添加指令才能有效;请按如下指令添加学校信息:\n\n#添加学校; 学校英文简称; wechat_sess_id; serverid',
'verify_failed_wechat_sess_id_invalid': CmdFunction.getico(-1) + '操作失败:【wechat_sess_id; serverid可能失效】;\nwechat_sess_id、serverid是需要自己去抓包获取的,不是示例里面的qwertyxxxx,具体获取方法请看指令帮助文档。',
'failed_add_school_except': CmdFunction.getico(-1) + '操作失败:【尝试获取自习室信息失败】\n 在自身没有预约座位和自习室开放的状态下,添加指令才能有效;多次出错请联系管理员',
'already_exist': CmdFunction.getico(1) + '操作成功:【学校 [{schl_abbr}] 的自习室信息已经存在】;自习室信息如下:\n\n{classrm_libid}\n开放抢座时间:{open_time};\n快使用抢座指令添加任务吧!\n自习室的数量 id 时间不正确请反馈管理员',
'succ_add_school_info': CmdFunction.getico(1) + '操作成功:【成功添加学校 [{school_name}-{schl_abbr}] 的自习室信息】;信息如下:\n\n{classrm_libid}\n开放抢座时间:{open_time}\n自习室的数量 id 时间不正确请反馈管理员'
}
# #添加学校, schl_abbr, sess_id, - 平台=来选座
tmp_ls = content.split(CF.USER_CMD_SPLTCH)
# if len(tmp_ls) < 4:
if len(tmp_ls) < 3:
return info['verify_failed_format']
# _, schl_abbr, wechat_sess_id, serverid = tmp_ls[:4]
_, schl_abbr, wechat_sess_id = tmp_ls[:3]
cmd_dict = utils.parse_extra_cmd(extra_cmd=content)
# init a_task
# if cmd_dict.get('platform') == 'CTRS':
a_task = utils.Atask(platform=cmd_dict.get('platform', CF.PLATFORM['IGTL']))
# schl_abbr transfer to lower
schl_abbr = str(schl_abbr).replace('[', '').replace(']', '').lower()
# verify_key = '您好'
# url_homepage = 'https://wechat.v2.traceint.com/index.php/reserve/index.html?f=wechat'
# # fill cookies
# if serverid.split('|') != 3:
# serverid = serverid.split('|')[0] + '|' + '1234567890' + '|' + a_task.M_COOKIES['SERVERID'].split('|')[-1]
# a_task.M_COOKIES = utils.fill_cookies(cookies=a_task.M_COOKIES, serverid=serverid, wechat_sess_id=wechat_sess_id)
a_task.M_COOKIES = utils.fill_cookies(cookies=a_task.M_COOKIES, wechat_sess_id=wechat_sess_id, platform=a_task.platform)
# entry homepage
homepage_response = utils.get_response(url=a_task.CURRENT_URL['home_page'],
sess=CF.sess,
m_headers=a_task.M_HEADERS,
m_cookies=a_task.M_COOKIES,
verify_key=a_task.VERIFYKEY_OF_HOMEPAGE)
if not homepage_response:
# verify failed; cmd is invalid
return info['verify_failed_wechat_sess_id_invalid']
debug_p('homepage_response=', homepage_response[:200])
# parse homepage_response get user_name, school_name
user_name, school_name = crawldata.get_name(homepage_response)
# check [school_name] seatmap data exist or not; # {user_name:'',schl_abbr:'', school_name:'', 'open_time':'', classroom:[{'classroom_name':classroom_name,'libid':libid, 'path':classroom_path,'seat_map':''},{},{}...]}
user_conf_dict = sqlact.query_school_info(schl_abbr=schl_abbr, libid1='', libid2='')
# if query failed, refresh school info
if force == True or not user_conf_dict:
# school info not exist, refresh this school; # {user_name:'',schl_abbr:'', school_name:'', 'open_time':'', classroom:[{'classroom_name':classroom_name,'libid':libid, 'path':classroom_path,'seat_map':''},{},{}...]}
# user_conf_dict = crawldata.refresh_school_info(homepage_url='', homepage_response=homepage_response,
# sess=CF.sess, m_headers=a_task.M_HEADERS,
# m_cookies=a_task.M_COOKIES,
# verify_key='',
# schl_abbr=schl_abbr,
# platform=a_task.platform,
# sql_conn=sqlact.conn
# )
user_conf_dict = crawldata.refresh_school_info(homepage_response=homepage_response,
a_task=a_task,
schl_abbr=schl_abbr,
sess=CF.sess, m_headers=a_task.M_HEADERS,
m_cookies=a_task.M_COOKIES,
sql_conn=sqlact.conn
)
else:
# already exist
reply_text = info['already_exist'].replace('{schl_abbr}', schl_abbr).replace('{open_time}', user_conf_dict.get('open_time', '--:--')).replace('{classrm_libid}', '\n'.join([e['classroom_name'] + '-id=' + str(e['libid']) for e in user_conf_dict['classroom']]))
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
if not user_conf_dict.get('classroom', []):
return info['failed_add_school_except']
reply_text = info['succ_add_school_info'].replace('{school_name}', user_conf_dict.get('school_name', 'school_name')).replace('{schl_abbr}', schl_abbr).replace('{open_time}', user_conf_dict.get('open_time', '--:--')).replace('{classrm_libid}', '\n'.join([e['classroom_name'] + '-id=' + str(e['libid']) for e in user_conf_dict['classroom']]))
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
'''
parse trace,return serverid wechat_sess_id # and two time value
'''
def parse_trace(userid, content):
# verify content format
info = {
'verify_failed': CmdFunction.getico(-1) + '您发送的 trace 校验格式不通过,请重新获取后再尝试!'
}
if len(content) < 100:
return info['verify_failed']
if content.find('wechatSESS_ID') < 0:
return info['verify_failed'] + '\n' + '没有找解析出 wechatSESS_ID 字段'
# elif content.find('SERVERID')<0:
# return info['verify_failed']+'\n'+'没有找解析出 SERVERID 字段'
try:
content += ' ;'
# pattern = re.compile(r'SERVERID\=\w+\|\d{10}\|\d{10}')
# SERVERID = pattern.search(content).group(0)
pattern = re.compile(r'wechatSESS_ID\=\w+(?=[\s;])')
wechatSESS_ID = pattern.search(content).group(0)
# pattern = re.compile(r'(?<=Hm_lvt_\w{32}\=)\d{10}(?=[\s;])')
# Hm_lvt_time = pattern.search(content).group(0)
#
# SERVERID_time_2 = re.compile(r'(?<=SERVERID\=\w{32}\|\d{10}\|)\d{10}(?=[\s;])')
# SERVERID_time_2 = pattern.search(content).group(0)
return '\n' + wechatSESS_ID + '\n' # +SERVERID
except Exception as e:
debug_p('[E]: action [%s] failed, exception is %s' % ('parse_trace', repr(e)))
return info['verify_failed'] + '[wechatSESS_ID 没有找到]'
'''
realtime
'''
def realtime(userid, content):
func_name = '#realtime'
debug_p('func_name=', func_name, 'userid, content', userid, content)
return CmdFunction.grab_seat(userid, content, task_kind=CF.TASK_KIND['realtime'])
'''
grab_seat
'''
def grab_seat(userid, content, task_kind=CF.TASK_KIND['reserve']):
'''
实时预定 | 捡漏 | jl | #jl | 明日预约 | 抢座 | #qz | qz ;
学校英文简称 | 首拼;
自习室id1;座位号1;自习室id2,座位号2;
serverid;wechat_sess_id
extra_info:
exetime 首次执行时间 | 开抢时间;
pre_today 当日即时预订 | 明日预约;
lgtl_or_ctrs 我去图书馆 | 来选座;
unknown_cmd 扩展指令
'''
func_name = '#grab_seat'
debug_p('func_name=', func_name, 'userid, content', userid, content)
task_kind_str = '[准点抢座] ' if task_kind == CF.TASK_KIND['reserve'] else '[实时捡漏] '
info = {
'grab_cmd_help': 'help info',
'verify_failed_format': CmdFunction.getico(-1) + task_kind_str +'task提交失败:【抢座指令格式可能有误】\n请仔细检查并按如下顺序重新编辑发送:\n\n#抢座; 学校英文简称; 自习室id;座位号;自习室id;座位号; wechat_sess_id; serverid',
'verify_failed_wechat_sess_id_invalid': CmdFunction.getico(-1) + task_kind_str + 'task提交失败:【wechat_sess_id; serverid可能失效】\nwechat_sess_id、serverid是需要自己去抓包获取的,不是示例里面的qwertyxxxx,更不是wechat_sess_id,serverid这两个单词;具体获取方法请看指令帮助文档。',
'verify_failed_get_school_info': CmdFunction.getico(-1) + task_kind_str + 'task提交失败:【座位表信息不匹配】请确认自习室信息存在且自习室id正确\n如需帮助请联系管理员处理',
'verify_failed_seatnum_not_found': CmdFunction.getico(-1) + task_kind_str + 'task提交失败:【自习室id不匹配或不存在此座位号】请检查后再试\n支持的自习室的id信息:{classrm_libid}',
'unknown_error': CmdFunction.getico(-1) + task_kind_str + 'task提交失败;未知错误;\n请联系管理员并提供如下信息:\n\n{unknown_error}',
'verify_succ': CmdFunction.getico(1) + task_kind_str + 'task提交成功:task_id={task_id};\n您的任务信息如下:\n{task_info}',
}
if not content:
reply_text = info['help_info']
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
# cmd type = user
# verify format, cmd_dict : # {schl_abbr: '', libid1: '', seat_num1: '', libid2: '', seat_num2: '',serverid:'', wechat_sess_id:''}
cmd_dict = utils.parse_grab_seat_cmd(command=content)
debug_p('func_name=', func_name, 'parse_grab_seat_cmd()', cmd_dict)
if not cmd_dict:
reply_text = info['verify_failed_format']
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
# normal cmd
# schl_abbr, libid1, seat_num1, libid2, seat_num2, wechat_sess_id, serverid = cmd_dict['schl_abbr'], cmd_dict['libid1'], cmd_dict['seat_num1'], cmd_dict['libid2'], cmd_dict['seat_num2'], cmd_dict['wechat_sess_id'], cmd_dict['serverid']
schl_abbr, libid1, seat_num1, libid2, seat_num2, wechat_sess_id, = cmd_dict['schl_abbr'], cmd_dict['libid1'], cmd_dict['seat_num1'], cmd_dict['libid2'], cmd_dict['seat_num2'], cmd_dict['wechat_sess_id'] # , cmd_dict['serverid']
# cmd
exe_time = cmd_dict.get('exe_time', '') # open_time
# pattern = cmd_dict.get('pattern', CF.PATTERN['PRE']) # pre
# a task , a Atask, init
a_task = utils.Atask(platform=cmd_dict.get('platform', CF.PLATFORM['IGTL']),
pattern=cmd_dict.get('pattern', CF.PATTERN['TODAY']))
# verify serverid and wechat_sess_id
# fill cookies
# a_task.M_COOKIES = utils.fill_cookies(cookies=a_task.M_COOKIES, serverid=serverid, wechat_sess_id=wechat_sess_id, platform=a_task.platform)
a_task.M_COOKIES = utils.fill_cookies(cookies=a_task.M_COOKIES, wechat_sess_id=wechat_sess_id, platform=a_task.platform)
debug_p('func_name=', func_name, 'fill_cookies()', a_task.M_COOKIES)
# entry homepage
# test
homepage_response = utils.get_response(url=a_task.CURRENT_URL['home_page'], sess=CF.sess,
m_headers=a_task.M_HEADERS,
m_cookies=a_task.M_COOKIES,
verify_key=a_task.VERIFYKEY_OF_HOMEPAGE)
debug_p('func_name=', func_name, 'get_response()', homepage_response[:300])
if not homepage_response:
# verify failed; cmd is invalid
reply_text = info['verify_failed_wechat_sess_id_invalid']
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
# debug_p('homepage_response=', homepage_response)
# parse homepage_response get user_name, school_name
user_name, school_name = crawldata.get_name(homepage_response)
# check [school_name] seatmap data exist or not; # {user_name:'',schl_abbr:'', 'open_time':'', school_name:'', classroom:[{'classroom_name':classroom_name,'libid':libid, 'path':classroom_path,'seat_map':''},{},{}...]}
user_conf_dict = sqlact.query_school_info(schl_abbr=schl_abbr) # , libid1='', libid2=libid2)
debug_p('func_name=', func_name, 'query_school_info()', str(user_conf_dict)[:400])
# # if query failed, refresh school info
# if not user_conf_dict:
# # school info not exist, refresh this school; # {user_name:'',schl_abbr:'', 'open_time':'', school_name:'', classroom:[{'classroom_name':classroom_name,'libid':libid, 'path':classroom_path,'seat_map':''},{},{}...]}
# user_conf_dict = crawldata.refresh_school_info(homepage_url='', homepage_response=homepage_response,
# sess=CF.sess, m_headers=CF.M_HEADERS, m_cookies=CF.M_COOKIES,
# verify_key='',
# schl_abbr=schl_abbr,
# sql_conn=sqlact.conn
# )
# debug_p('func_name=', func_name, 'refresh_school_info()', user_conf_dict)
# action query and refresh both failed
if not user_conf_dict:
reply_text = info['verify_failed_get_school_info']
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
# get school info succ and then construct [re_reserve_cmd] data: task_id;userid; 323;21,31; 324;41,51; wechat_sess_id; serverid; comment_info
user_conf_dict['user_name'] = user_name
# get seat coordinate and classroom_name
# all_lib_clssrm dict{libid: clssrm}
all_lib_clssrm = dict([(classroom['libid'], classroom['classroom_name']) for classroom in user_conf_dict['classroom']])
lib_seat_ls = [(libid1, seat_num1), (libid2, seat_num2)]
clssrm_crdnt = CmdFunction.verify_seat(lib_seat_ls, user_conf_dict)
# if coordinate not match, exception
if not clssrm_crdnt:
reply_text = info['verify_failed_seatnum_not_found'].replace('{classrm_libid}', '\n'.join([e['classroom_name'] + '-id=' + str(e['libid']) for e in user_conf_dict['classroom']]))
debug_p('func_name=', func_name, 'reply_text=', reply_text)
return reply_text
classroom_name1, coordinate1 = clssrm_crdnt[0]
classroom_name2, coordinate2 = clssrm_crdnt[1]
debug_p('func_name=', func_name, 'get coordinate1 and coordinate2', 'classroom_name1=', classroom_name1,
'coordinate1=',
coordinate1, 'classroom_name2=', classroom_name2, 'coordinate2=', coordinate2)
# construct[re_reserve_cmd] task_id; userid; user_name; school_name; classroom_name1;323;seat_num; 21,31; classroom_name2; 324; seat_num2; 41,51; wechat_sess_id; serverid; comment_info
open_time = user_conf_dict.get('open_time', '00:00-00:00') if task_kind == CF.TASK_KIND['reserve'] else utils.get_date(format="%H:%M:%S")
submit_time = utils.get_date(format='%Y-%m-%d %H:%M:%S')
open_time = exe_time if exe_time else open_time
wechat_sess_id = wechat_sess_id
succ_failed, detail_info, others_result_info = '', '', ''
task_id = CF.TASK_ID
# others_info is json format
others_info = {}
others_info['all_lib_clssrm'] = all_lib_clssrm
comment_info = ''
serverid = CF.SERVERID if a_task.platform == CF.PLATFORM['IGTL'] else ''
# print('serverid', serverid)
param = (
userid, task_kind, wechat_sess_id, succ_failed, detail_info, others_result_info, task_id,
user_name, school_name, schl_abbr, open_time, classroom_name1, libid1, seat_num1, coordinate1,
classroom_name2, libid2, seat_num2, coordinate2, serverid, comment_info, submit_time,
a_task.pattern, a_task.platform, json.dumps(others_info)
)
#
tb_today_task = 'today_task'
# replace will delete the exist trace and insert a new trace, then the id will change
# insert into tb_today_task
# REPLACE into today_task (userid, task_kind, wechat_sess_id, succ_failed, detail_info, others_result_info , task_id, user_name, school_name, schl_abbr, open_time, classroom_name1, libid1, seat_num1, coordinate1, classroom_name2, libid2, seat_num2, coordinate2, serverid, comment_info, submit_time, pattern, platform, others_info )
sql_today_task = 'REPLACE INTO ' + tb_today_task + \
'(userid, task_kind, wechat_sess_id, succ_failed, detail_info, others_result_info, task_id,' \
'user_name, school_name, schl_abbr, open_time, classroom_name1, libid1, seat_num1, coordinate1,' \
'classroom_name2, libid2, seat_num2, coordinate2, serverid, comment_info, submit_time,' \
'pattern, platform, others_info) ' + \
' VALUES(' + '?,' * (len(param) - 1) + '?)'
sqlact.cur.execute(sql_today_task, param)
sqlact.conn.commit()
debug_p('func_name=', func_name, 'REPLACE and INSERT action; param=', param)
reply_text = info['verify_succ'].replace('{task_id}', str(CF.TASK_ID)).replace('{task_info}', '\n[' + school_name + '-' + schl_abbr + ']' +
'的\n[' + classroom_name1 + '-id=' + libid1 + ']的[' + str(seat_num1) + ']号座位\n' +
'[' + classroom_name2 + '-id=' + libid2 + ']的[' + str(seat_num2) + ']号座位\n执行时间:' + open_time + '') + \
'\n模式:' + ('预定当日💺' if a_task.pattern == CF.PATTERN['TODAY'] else '预约明天💺') + '\n平台:' + ('<我去图书馆>' if a_task.platform == CF.PLATFORM['IGTL'] else '<来选座>')
CF.TASK_ID += 1
debug_p('func_name=', func_name, 'TASK_ID=', CF.TASK_ID, 'grab_seat action over, reply_text=', reply_text)
return reply_text
'''
query_realtime_result
'''
def query_realtime_result(userid, content):
func_name = '[query_realtime_result]'
debug_p(func_name, 'userid, content', userid, content)
return CmdFunction.query_result(userid, content, task_kind=CF.TASK_KIND['realtime'])
'''
parse the dict from memcache
return reply str
'''
def parse_dct_from_mc(result_dct={}, char_limit=CF.CHAR_LIMIT):
# exe trace format
# TRACE_FORMAT = {
# 'head': '状态:{status}\n[{school_name}-{schl_abbr}_{task_id}]\n{submit_time} 提交\n',
# 'exe_trace': '{emoji}{try_cnt}. {exe_time} [{classroom_name}]-[{seat_num}]号座位:{feedback}\n',
# }
default_value = ''
flag = {
'SUCC': '✅',
'FAILED': '❌',
# 'Ongoing': '🔄',
'Ongoing': '🌀',
# 'exe_trace_failed': '⏬'
'exe_trace_failed': '🔸'
}
status = 'Ongoing'
reply_str = '...\n'
reply_str += CF.TRACE_FORMAT['head'].format(status=flag[status] + status, school_name=result_dct.get('school_name', default_value),
schl_abbr=result_dct.get('schl_abbr', default_value), task_id=result_dct.get('task_id', default_value),
submit_time=result_dct.get('submit_time', default_value))
if len(result_dct['exe_trace']) < 1:
return reply_str
code = result_dct['exe_trace'][-1].get('code', default_value)
completed_flag = result_dct['exe_trace'][-1].get('completed_flag', default_value)
if completed_flag == 'completed':
status = 'SUCC' if str(code) == '0' else 'FAILED'
for i, trace in enumerate(result_dct['exe_trace']):
reply_str += CF.TRACE_FORMAT['exe_trace'].format(
emoji=flag['exe_trace_failed'] if str(trace.get('code', default_value)) != '0' else flag['SUCC'],
try_cnt=i, exe_time=trace.get('exe_time', default_value),
classroom_name=trace.get('clssrm', default_value),
seat_num=trace.get('seat_num', default_value), feedback=trace.get('msg', default_value))
return reply_str[-1*char_limit:]
'''
query task result
'''
def query_result(userid, content, task_kind=CF.TASK_KIND['reserve']):
func_name = '[query_result]'
debug_p('func_name=', func_name, 'userid, content', userid, content)
info = {
'default': '没有查询到最近这段时间抢座任务执行状态信息',
}
reply_str = info['default']
result = mc.get_value(key=task_kind + '_' + userid, default='')
if result:
reply_str = CmdFunction.parse_dct_from_mc(result)
# parse the dict from memcache
debug_p(func_name, 'task result reply_str=', reply_str)
# return {'kind': 'no_prefix', 'reply_str': reply_str}
return reply_str
'''
FUNCTION_MAP
'''
FUNCTION_MAP = {
'#check_schl': check_school,
'#add_school_info': add_school_info,
'#force_add_school_info': force_add_school_info,
'#parse_trace': parse_trace,
'#grab_seat': grab_seat,
'#modify_opentime': modify_opentime,
# '#needhelp': needhelp,
'#query_result': query_result,
'#realtime': realtime,
'#query_realtime_result': query_realtime_result,
}
# verify_seat, return clssrm_crdnt=[(classroom_name, coordinate), () ... ]
def verify_seat(lib_seat_ls, user_conf_dict, num_0_value='任意'):
clssrm_crdnt = []
for libid, seatnum in lib_seat_ls:
if int(libid) <= 0:
seatnum = '0'
# user_conf_dict['classroom']:[{'classroom_name':classroom_name,'libid':libid, 'path':classroom_path,'seat_map':''}
# if libid == 0:
classroom_name, coordinate = num_0_value, '0'
for classroom in user_conf_dict['classroom']:
# if int(libid) == 0: classroom_name = "任意"; coordinate = '0'; break
if int(libid) != 0 and coordinate == '0' and classroom['libid'] == libid.replace('-', ''):
classroom_name = classroom['classroom_name']
if seatnum == '0':
coordinate = '0'
break
for pre_0 in ['', '0', '00', '000']:
coordinate = classroom['seat_map'].get(pre_0 + seatnum, coordinate)
if libid != '0' and classroom_name == num_0_value:
# error: libid not found
return []
clssrm_crdnt.append((classroom_name, coordinate))
return clssrm_crdnt
'''
extra help info
'''
class ExtraInfo(object):
prefix = '\n\nℹ️随机帮助信息ℹ️\n'
I = {
# 'help': '强调:wechat_sess_id和serverid是需要自己抓包获取的,不是示例里面的qwertyxxx,请仔细阅读说明\n为了避免id失效,抢座任务请尽量在开抢前的5-30分钟时间段内提交\ngithub:https://github.com/qmppz/igotolibrary',
# 'administrator_info': '如果出现指令无响应无反馈、添加学校失败、多次任务失败...等等摸不着头脑的问题请联系管理员处理。\nwx: turing_01110101',
}
others = ['查看<为了学习>抢座工程的更新进度和即时通知,请看管理员朋友圈。wx: turing_01110101',
'<为了学习>已经向<我去图书馆>官方反馈了抢座漏洞,官方答复:正在修复中。',
'wechat_sess_id、serverid是需要自己去抓包获取的,不是示例里面的qwertyxxxx,具体获取方法请看指令帮助文档',
'指令分隔符可以是逗号或句号或分号或空格或回车,。;,.; 且支持中文符号和英文符号。',
'<为了学习>工程抢座原理已经开源,且无收费的服务、不买卖程序!只为非计算机的同学提供近似公平的抢座。',
'服务器已经升级,抢座task实际测试速度提升明显。',
'服务器指令解析需要时间,请等待几秒钟。',
'有什么意见或者建议请向管理员反馈。',
'指令中的[学校简称]是英文简称,而不是学校名字的首拼。'
'为避免抓包获取的serverid失效以及抢座任务遗漏,请在开抢前5-30分钟时间段提交抢座任务。',
'如果出现指令无响应无反馈、添加学校失败、多次任务失败...等等摸不着头脑的问题请联系管理员。',
'注意不要把抓包获取到的trace发到<我去图书馆>...请认准<为了学习>',
'后台消息过多,反馈问题或者建议意见请发送到管理员的微信 turing_01110101',
'抓包的意思就是进行网络监听并将请求的数据记录显示出来,所以开启抓包软件的时候手机会有风险提示',
'使用[添加指令]需要满足:1, 在自身没有预定座位的状态下; 2, 自习室都开放的状态下',
'自习室数量、开抢时间等不正确请反馈管理员wx:turing_01110101',
'抢座任务在开抢前5-30分钟时间段内提交才能有效',
# '接下来尝试更新'
]
# cmd_help = '\n指令帮助文档:https://mp.weixin.qq.com/s/1FVTjlDunfngwMip3TFakA'
cmd_help = '\n<a href="https://mp.weixin.qq.com/s/8HmS4Ct02ZQIcBYRnhTl9Q"> ☞☞指令帮助文档 </a>'
# get_random_info
def get_random_info(whichone=-1):
info = list(ExtraInfo.I.values()) + ExtraInfo.others
return ExtraInfo.prefix + random.choice(info) + ExtraInfo.cmd_help
'''
parse msg from wechat handle; verify if is cmd and execute the cmd`s function
return response
'''
@utils.catch_exception
def handle_msg(userid, content, my_id, LOCAL=False):
# transfer content from byte to str
m_content = content
if isinstance(content, bytes):
m_content = content.decode(encoding='utf-8')
func_name = '#handle_msg'
debug_p('func_name=', func_name, 'userid=', userid, 'content=', content)
'''
check if is test, discard test flag
'''
if str(m_content[:4].split()[0]).lower() in {'test', '内测', '测试'}:
m_content = m_content[:4].replace('test', '').replace('内测', '').replace('测试', '') +\
m_content[4:]
# else:
# # old version entrance function
# return old_version_entrance(userid, content, my_id)
# content is none
content = m_content
if not content:
# return get_reply_msg(str_info=content)
reply_text = CmdFunction.getico(1) + '\n'
return reply_text + ExtraInfo.get_random_info()
# parse, if command
cmd_pre_flag = {
# 'igotolibrary': {'我去图书馆', '来选座'},
# qiangzuo task
'#grab_seat': {'抢座', '明日预约', '预约座位', '抢座位', '抢坐', '#抢坐', '抢位置', 'grab_seat', '#抢座', 'qz', '#qz'},
# realtime greb seat
'#realtime': {'捡漏', '实时预定', '即时预订', '实时预订', '即时预定', 'jl', 'ssyd', 'jsyd', 'realtime'},
'#check_schl': {'查询', '#查询', 'cx', '#cx', 'chaxun', '#查询学校', '查询学校'},
# parse trace
'#parse_trace': {'jx', '#jx', '解析', '#解析', 'wechatsess_id=', 'get'},
# status query
'#add_school_info': {'#添加学校', '添加学校', 'tj', '#tj', '#添加', '添加'},
# force add school
'#force_add_school_info': {'强制添加', '强制添加学校', '强制添加学校信息', 'qztj', 'qztjxxxx'},
# '#needhelp':{'帮助', 'help', 'bz', '帮助信息', '提示'},
# admin cmd
'#gengxin': {},
# modify opentime
'#modify_opentime': {'修改抢座时间', 'xgqzsj', '修改开抢时间', 'xgkqsj'},
# query reserve result
'#query_result': {'查询结果', '结果', 'jg', 'cxjg', '抢座结果', 'qzjg', '查询抢座结果', '查询抢座'},
# query realtime result
'#query_realtime_result': {'查询捡漏结果', '捡漏结果', 'jljg', 'cxjljg', 'jlqzjg', 'jl结果', '实时预定结果', '实时预订结果'}
}
# formatting split_ch to blank
frmt_content = re.sub(r'[(()),;。;,\.]', ' ', content.replace(u'#', '')
.replace(u'#', '')
.replace(u'-', '-').replace(u'➖', '-').replace('- -', '--')
.replace('=', '=')
.replace('\n', CF.USER_CMD_SPLTCH)
)
# del all \n \r and blank
frmt_content = re.sub(r'\s+', CF.USER_CMD_SPLTCH, frmt_content.strip())
content = frmt_content
# judge which kind cmd from index 0
cmd_ls = content.split(CF.USER_CMD_SPLTCH)
cmd_kind = ''
for pre_flag in cmd_pre_flag.keys():
if cmd_ls[0].lower().replace('#', '').strip() in cmd_pre_flag[pre_flag]:
cmd_kind = pre_flag
break
if not cmd_kind:
# specify parse trace
if len(content) > 100 and content.find('wechatSESS_ID') >= 0: # and content.find('SERVERID') >= 0:
# parse trace
cmd_kind = '#parse_trace'
else:
# content is not cmd
no_match_cmd_reply = ['没有匹配到指令...不知道该回应什么',
'没有匹配到指令...反馈问题请联系管理员']
reply_text = CmdFunction.getico(1) * 3 + random.choice(no_match_cmd_reply) + '\n'
return reply_text + ExtraInfo.get_random_info()
# swap wechatSESS_ID and SERVERID to ...;wechatSESS_ID; SERVERID
# if len(cmd_ls) > 2 and cmd_ls[-1].find('wechatSESS_ID') >= 0 and cmd_ls[-2].find('SERVERID') >= 0:
# cmd_ls[-1], cmd_ls[-2] = cmd_ls[-2], cmd_ls[-1]
# content = CF.USER_CMD_SPLTCH.join(cmd_ls)
# print('cmd_ls=', cmd_ls)
# content is cmd then save cmd log
a_cmd_log = utils.get_date() + '|from_user=' + userid + '|cmd_kind=' + cmd_kind + '|content=' + content + '\n'
debug_p('func_name=', func_name, 'cmd_kind=', cmd_kind, 'a_cmd_log=', a_cmd_log)
# content is cmd then exe cmd function
reply_text = CmdFunction.FUNCTION_MAP[cmd_kind](userid, content)
# return reply text
if reply_text.find('状态') < 0:
reply_text = reply_text + ExtraInfo.get_random_info() if cmd_kind != '#parse_trace' else reply_text
return reply_text
'''
test
'''
if __name__ == '__main__':
LOCAL = utils.LOCAL
# zl_ls = [
# # '#抢座; bjtu; 323;81; 324;80; d3936289adfff6c3874a2579058ac651|1563028695|1563028690; 12cb1a0ebdb4f4260e4d2527110a2959491c24eccf287d75',
# # '#抢座; bbmc; 323;81; 324;80; d3936289adfff6c3874a2579058ac651|1563028695|1563028690; 12cb1a0ebdb4f4260e4d2527110a2959491c24eccf287d75',
# # '#抢座; pku; 323;81; 324;80; d3936289adfff6c3874a2579058ac651|1563028695|1563028690; 12cb1a0ebdb4f4260e4d2527110a2959491c24eccf287d75',
# # '查询;bbmc',
#
# # '添加;hbucm; wechatSESS_ID=5c4b33b34a20e0e0fea9864a253bd3575dcf545689ce9c0e SERVERID=b9fc7bd86d2eed91b23d7347e0ee995e|1565443472|1565443470'
#
# # '#xgqzsj, bjtu,21:22'
# 'jl, bjtu, 323, 7, 324 77 ' + \
# # 'tj, bjtu ' + \
# 'wechatSESS_ID=26443f7ddc48027297ce0e4330308d17f4b7d624aff7b416 ' + \
# 'SERVERID=b9fc7bd86d2eed91b23d7347e0ee995e|1570237808|1570237801 ' + \
# '-- t=07:00. 平台=lxz; 今明=明'
#
# # 'cxqwejg,'
# ]
for i in range(1, 2):
# zl = random.choice(['捡漏', '实时预定', '即时预订', '实时预订', '即时预定', 'jl', 'ssyd', 'jsyd', 'realtime',
# '抢座', '抢座位', '抢坐', '#抢坐', '抢位置', 'grab_seat', '#抢座', 'qz', '#qz']) + \
# ' bjtu ' + \
# ' ' + random.choice(['323 ', '324 ']) + random.choice([str(_) for _ in range(1, 100)]) + \
# ' ' + random.choice(['323 ', '324 ']) + random.choice([str(_) for _ in range(1, 100)]) + \
# ' wechatSESS_ID=ssid'+random.choice([str(_) for _ in range(111, 999)]) + \
# ' SERVERID=serid|1231232321|1321234' + random.choice([str(_) for _ in range(111, 999)]) + \
# ' -- ' + \
# random.choice(['开抢时间', '时间', 't', 'T', 'time'])+'' \
# '='+str(random.randint(6,23))+':'+str(random.randint(0,59))+':'+str(random.randint(0,59))+' ' + \
# random.choice(['预约模式', '今明', '哪天', '模式'])+'='+random.choice(['pre', '明', '明天','today', '今', '今天']) + ' ' + \
# random.choice(['平台', '公众号'])+'='+random.choice(['我去图书馆', 'igtl', 'wqtsg','来选座', 'lxz']) + ' '
zl = 'jl;bjtu;323;1 323 0 ,,;;' \
'SERVERID=d3936289adfff6c3874a2579058ac651|1570612694|1570612692 ' \
'wechatSESS_ID=5ef6f21dde35722c92e4595b2100b6fef8f08f50adfe6cb3;' \
' -- 时间=12:00;模式=明;平台=我去图书馆'
zl = '抢座;ycgxy;1234;355;' \
'wechatSESS_ID=672c5459adb7c20f3a3f64e677dfdfebac2455b49c34e280;SERVERID=b9fc7bd86d2eed91b23d7347e0ee995e|1570632661|1570631371' \
';—-;时间=6:00;模式=明;平台=我去图书馆'
zl = '捡漏, bjtu,0,0 wechatSESS_ID=14a69992ca6af9a2e11b4c3ba270a752a6d28a49fc116272'
zl = '#抢座; bjtu; 0; 046; 0; 045; ' \
'wechatSESS_ID=d251fce0daa72515a1d71eefb5b55debc1cbae9d1a32d721; ' \
'SERVERID=d3936289adfff6c3874a2579058ac651|1570707938|1570707927 ' \
'-- t=17:20 模式=今'
zl = 'test 捡漏, tyut, 323, 0, 324,0, wechatSESS_ID=0db7db1b5250d65e4d1c2af0a707296c0f689afc5f901273 SERVERID=b9fc7bd86d2eed91b23d7347e0ee995e|1570926044|1570924907 -- 时间=08:40, 模式=今天'
#
# zl = '添加学校;sxau;wechatSESS_ID=65dece8f05041ee8c849e5ec5c622a14 -- pt=lxz'
# 'SERVERID=b9fc7bd86d2eed91b23d7347e0ee995e|1570237808|1570237801 ' + \
# ' SERVERID=d3936289adfff6c3874a2579058ac651|1570237808|1570237801 ' + \
# zl = '添加; ycgxy; wechat_sess_id=672c5459adb7c20f3a3f64e677dfdfebac2455b49c34e280;'
# zl = '抢座;bjtu;324;10;323;85;SERVERID=b9fc7bd86d2eed91b23d7347e0ee995e|1570448431|1570448430;wechatSESS_ID=65bf8d12c374bf3b1fc466a279bd5ba04f2d9fe375ee717f;'
# zl = '#jl; tyut; 311; 100; 313; 91;' + \
# ' wechatSESS_ID=ed024e28d954710784abf2f385eb9ee1d7de4c53bfdfd898; SERVERID=d3936289adfff6c3874a2579058ac651|1570400154|1570400153;' +\
# '-- t=07:00 平台=wqtsg; 今明=j'
# zl = 'jljg'
# zl = '''
# GET /index.php/url/auth.html?r=%2Findex.php%2Freserve%2Findex.html%3Ff%3Dwechat%26n%3D5d9bd23e7dc9a&code=081elvY90k3kSy1WSDW90ZsgY90elvY6&state=1 HTTP/1.1 Host: wechat.laixuanzuo.com Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Linux; Android 7.0; PRO 7 Plus Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044904 Mobile Safari/537.36 MMWEBID/4071 MicroMessenger/7.0.7.1521(0x27000736) Process/tools NetType/4G Language/zh_CN Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,image/wxpic,image/sharpp,image/apng,image/tpg,*/*;q=0.8 Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,en-US;q=0.9 Cookie: FROM_TYPE=weixin; Hm_lvt_7838cef374eb966ae9ff502c68d6f098=1570464181; Hm_lpvt_7838cef374eb966ae9ff502c68d6f098=1570489433; wechatSESS_ID=85807fb3863be66e8b868e4dfce18da0
# '''
# zl = 'test 捡漏 sxau; 10281, 0; 0,0; wechatSESS_ID=89040c2998084ed651a8a7991ce11264 -- 时间=21:40 模式=今天 平台=来选座'
# zl = 'test tj sxau; wechatSESS_ID=89040c2998084ed651a8a7991ce11264 -- 时间=21:40 模式=今天 平台=来选座'
# zl = 'test jl, bjtu 323, 0, 323, 1 wechatSESS_ID=de2e1d47c50c59709ebb5ee102ea6f738092499495a61e5e SERVERID=b9fc7bd86d2eed91b23d7347e0ee995e|1572577791|1572577787 -- 模式=今天'
zl = 'test tj, sxau wechatSESS_ID=0d9a58a026826c2f6aebb2d3926eb01d -- 平台=来选座'
# zl = 'test cx, wnsfxy'
# zl = 'test jl,wnsfxy, 10110, 0, 0 ,0, wechatSESS_ID=35ed243f92be7b748a21d53cce7179b9 -- 平台=来选座 模式=今天'
zl = 'test jl;sxau;10238;086;10238;004;wechatSESS_ID=0d9a58a026826c2f6aebb2d3926eb01d -- 平台=来选座'
res = handle_msg(userid='userid_test_' + str(i), content=zl, my_id='my_id_' + str(i), LOCAL=LOCAL)
mc.client_close()
debug_p('complete!\n', res)
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
13,
29937,
448,
29930,
29899,
14137,
29901,
18351,
29899,
29947,
448,
29930,
29899,
13,
29937,
732,
9507,
29901,
29885,
8411,
29918,
3051,
29889,
2272,
13,
29937,
732,
8921,
29901,
21266,
3905,
29914,
29939,
29885,
407,
29920,
13,
29937,
732,
2230,
29901,
29906,
29900,
29896,
29929,
29900,
29955,
29900,
29929,
13,
29937,
732,
8216,
29901,
29871,
4386,
10191,
29892,
3017,
29941,
13,
13,
5215,
2295,
16680,
13,
5215,
931,
13,
5215,
4036,
13,
5215,
4390,
13,
5215,
2897,
13,
5215,
337,
13,
5215,
7274,
13,
13,
5215,
10876,
13,
29937,
10876,
29889,
2084,
29889,
4397,
703,
6995,
636,
1159,
13,
29937,
1053,
8919,
327,
324,
6357,
29889,
29885,
8411,
29918,
3051,
408,
1243,
29918,
29885,
8411,
29918,
3051,
13,
13,
5215,
3667,
29879,
13,
5215,
29349,
430,
532,
13,
13,
12008,
13,
5527,
363,
445,
11451,
934,
13,
22379,
937,
931,
13,
12008,
13,
29937,
402,
5371,
29943,
353,
3667,
29879,
29889,
29954,
5371,
29943,
13,
29874,
29918,
7662,
353,
3667,
29879,
29889,
4178,
1278,
580,
13,
13,
9207,
353,
3667,
29879,
29889,
29954,
5371,
29943,
580,
13,
13,
29937,
788,
995,
13,
9207,
29889,
7662,
29918,
333,
353,
938,
29898,
13239,
29889,
657,
29918,
1256,
2141,
5451,
877,
29918,
29861,
29900,
2314,
448,
29871,
29906,
29900,
29896,
29947,
29900,
29900,
29900,
29900,
718,
313,
29896,
29900,
29900,
565,
938,
29898,
13239,
29889,
657,
29918,
1256,
2141,
5451,
877,
29918,
29861,
29900,
2314,
1273,
29871,
29906,
1275,
29871,
29900,
1683,
448,
29896,
29900,
29900,
29897,
718,
29871,
29896,
29896,
29896,
29900,
13,
24830,
29889,
328,
481,
2153,
29889,
23397,
29918,
1525,
29911,
3960,
2890,
353,
29871,
29945,
13,
9207,
29889,
29879,
404,
353,
7274,
29889,
7317,
580,
13,
9207,
29889,
29879,
404,
29889,
17462,
29918,
284,
573,
353,
7700,
13,
29937,
4576,
3158,
13,
3044,
433,
312,
353,
3667,
29879,
29889,
10520,
2865,
580,
13,
29937,
2626,
8173,
13,
14047,
353,
3667,
29879,
29889,
3421,
11442,
8173,
580,
13,
13,
29937,
4744,
1596,
13,
8382,
29918,
29886,
353,
3667,
29879,
29889,
8382,
29918,
29886,
13,
13,
13,
12008,
13,
657,
29918,
3445,
368,
29918,
7645,
515,
19964,
13,
12008,
13,
13,
13,
1753,
679,
29918,
3445,
368,
29918,
7645,
29898,
710,
29918,
3888,
29892,
851,
29918,
1579,
29887,
2433,
1672,
29933,
2891,
742,
27937,
29922,
3318,
1125,
13,
1678,
565,
851,
29918,
1579,
29887,
1275,
376,
1672,
29933,
2891,
1115,
13,
4706,
396,
565,
851,
29918,
3888,
29889,
2886,
703,
233,
141,
165,
31780,
1159,
6736,
29871,
29900,
470,
851,
29918,
3888,
29889,
2886,
703,
232,
187,
177,
31931,
1159,
6736,
29871,
29900,
29871,
584,
13,
4706,
396,
268,
736,
525,
525,
13,
4706,
396,
260,
3864,
19964,
13,
4706,
7882,
29918,
2271,
353,
525,
1124,
597,
3150,
2754,
29889,
29873,
19478,
29896,
29906,
29941,
29889,
510,
29914,
3150,
2754,
29914,
2754,
29914,
29894,
29906,
29915,
13,
4706,
848,
353,
426,
13,
9651,
376,
7971,
1542,
1115,
29871,
29900,
29892,
29871,
396,
29871,
31573,
30752,
30832,
30883,
29871,
29900,
29899,
30333,
30346,
29892,
29871,
29896,
29899,
30861,
31122,
29892,
29871,
29906,
29899,
30941,
236,
165,
148,
13,
9651,
376,
546,
1441,
1115,
29871,
396,
29871,
30689,
31021,
31125,
30354,
13,
9651,
426,
13,
18884,
376,
2080,
1626,
1115,
29871,
396,
29871,
30333,
30346,
30689,
31021,
13,
18884,
426,
13,
462,
1678,
376,
726,
1115,
851,
29918,
3888,
13,
18884,
2981,
13,
13,
18884,
376,
1311,
3401,
1115,
29871,
396,
29871,
30406,
31229,
31125,
30354,
13,
18884,
426,
13,
13,
18884,
500,
13,
9651,
2981,
13,
9651,
376,
1792,
3401,
1115,
13,
9651,
426,
13,
18884,
376,
2754,
2558,
1115,
6796,
29966,
10818,
28341,
9872,
10818,
28341,
9872,
10818,
29958,
3108,
29961,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29871,
29941,
29897,
1402,
13,
18884,
396,
29871,
31264,
30573,
30688,
232,
186,
180,
234,
151,
182,
31088,
30210,
1989,
13,
18884,
376,
29721,
1115,
376,
29900,
29900,
29900,
29896,
29908,
29871,
396,
29871,
30406,
31229,
232,
151,
178,
30287,
31062,
235,
178,
137,
29898,
236,
157,
146,
231,
193,
194,
232,
164,
174,
29892,
29871,
31838,
31461,
236,
149,
168,
29897,
13,
9651,
500,
13,
4706,
500,
13,
4706,
848,
353,
4390,
29889,
29881,
17204,
29898,
1272,
467,
12508,
877,
9420,
29947,
1495,
13,
13,
4706,
2933,
353,
7274,
29889,
2490,
29898,
2754,
29918,
2271,
29892,
848,
29922,
1272,
29892,
9066,
3790,
29915,
3051,
29899,
1853,
2396,
525,
6214,
29914,
3126,
29915,
1800,
13,
13,
4706,
8908,
29879,
353,
4390,
29889,
18132,
29898,
5327,
29889,
726,
29892,
8025,
543,
10496,
29899,
29947,
1159,
13,
13,
4706,
736,
8908,
29879,
13,
1678,
25342,
851,
29918,
1579,
29887,
1275,
376,
22789,
3912,
1115,
13,
4706,
736,
851,
29918,
3888,
13,
1678,
25342,
851,
29918,
1579,
29887,
1275,
376,
11432,
1115,
13,
4706,
736,
851,
29918,
3888,
13,
1678,
1683,
29901,
13,
4706,
736,
12305,
29961,
29923,
5387,
29871,
235,
138,
183,
31237,
31745,
235,
178,
178,
3850,
13,
13,
13,
12008,
13,
1990,
363,
9920,
10944,
2910,
304,
740,
13,
12008,
13,
13,
13,
1990,
315,
3487,
6678,
7295,
13,
13,
1678,
315,
5773,
29918,
29950,
10192,
353,
426,
13,
4706,
525,
29950,
6670,
29925,
2396,
525,
31088,
30742,
31810,
3583,
29876,
29905,
29876,
31084,
31650,
232,
187,
177,
31931,
29905,
29876,
29905,
29876,
742,
13,
4706,
525,
29907,
5773,
29918,
29950,
6670,
29925,
2396,
525,
31478,
233,
141,
165,
31780,
31084,
31650,
31472,
31088,
31590,
30847,
30557,
31168,
30607,
30910,
31545,
31084,
31650,
3583,
29876,
29937,
233,
141,
165,
31780,
29936,
29871,
30415,
31071,
31144,
30333,
234,
177,
131,
31685,
29936,
29871,
30688,
231,
188,
163,
232,
177,
167,
333,
29936,
31780,
30956,
30850,
29936,
29871,
30688,
231,
188,
163,
232,
177,
167,
333,
29936,
31780,
30956,
30850,
29936,
591,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
29936,
742,
13,
4706,
525,
29907,
5773,
29918,
3210,
16658,
2396,
525,
525,
13,
1678,
500,
13,
13,
1678,
379,
6670,
29925,
29918,
11690,
353,
426,
13,
13,
1678,
500,
13,
13,
1678,
3700,
29918,
1417,
353,
426,
13,
4706,
525,
1066,
3321,
2396,
6024,
243,
162,
155,
134,
13420,
525,
243,
162,
155,
146,
13420,
525,
243,
162,
155,
132,
13420,
525,
243,
162,
155,
143,
13420,
525,
243,
162,
155,
159,
13420,
525,
243,
162,
155,
160,
742,
525,
243,
162,
155,
133,
525,
1402,
13,
4706,
525,
331,
4317,
2396,
6024,
243,
162,
155,
133,
7464,
13,
4706,
525,
22198,
2396,
6024,
243,
162,
155,
133,
742,
525,
243,
162,
155,
179,
13420,
525,
243,
162,
155,
176,
13420,
525,
243,
162,
155,
180,
13420,
525,
243,
162,
155,
171,
13420,
525,
243,
162,
155,
186,
13420,
525,
243,
162,
155,
151,
2033,
13,
1678,
500,
13,
13,
1678,
822,
679,
1417,
29898,
15581,
2433,
331,
4317,
29374,
13,
4706,
565,
7353,
1275,
448,
29896,
29901,
13,
9651,
7353,
353,
525,
22198,
29915,
13,
4706,
25342,
7353,
1275,
29871,
29896,
29901,
13,
9651,
7353,
353,
525,
1066,
3321,
29915,
13,
4706,
25342,
7353,
1275,
29871,
29900,
29901,
13,
9651,
7353,
353,
525,
331,
4317,
29915,
13,
4706,
736,
4036,
29889,
16957,
29898,
23651,
6678,
29889,
2161,
29918,
1417,
29961,
15581,
2314,
13,
13,
1678,
14550,
13,
1678,
6623,
29918,
459,
296,
603,
13,
1678,
14550,
13,
1678,
396,
732,
13239,
29889,
12510,
29918,
11739,
13,
1678,
822,
6623,
29918,
459,
296,
603,
29898,
1792,
333,
29892,
2793,
1125,
13,
4706,
396,
921,
29887,
29939,
22381,
29926,
29892,
289,
29926,
9161,
29892,
29871,
29906,
29900,
29901,
29941,
29945,
13,
4706,
396,
1015,
296,
603,
584,
29871,
29906,
29900,
29901,
29941,
29945,
13,
4706,
17117,
1364,
29880,
29918,
370,
1182,
29892,
1015,
296,
603,
353,
2793,
29889,
5451,
29898,
9207,
29889,
11889,
29918,
29907,
5773,
29918,
5550,
5850,
3210,
29897,
13,
4706,
1015,
296,
603,
353,
1015,
296,
603,
29889,
5451,
877,
29899,
29861,
29900,
1822,
6506,
12839,
742,
525,
29901,
1495,
13,
13,
4706,
396,
29871,
29953,
29901,
29900,
29900,
6660,
29871,
29900,
29953,
29901,
29900,
29900,
13,
4706,
565,
7431,
29898,
459,
296,
603,
29889,
5451,
877,
29901,
29861,
29900,
2314,
1275,
29871,
29896,
29901,
13,
9651,
1015,
296,
603,
353,
525,
29900,
29915,
718,
1015,
296,
603,
13,
4706,
396,
29871,
29906,
29900,
29901,
29896,
29900,
29871,
6660,
29871,
29906,
29900,
29901,
29896,
29900,
29901,
29900,
29900,
13,
4706,
565,
1015,
296,
603,
29889,
2798,
877,
29901,
1495,
1275,
29871,
29896,
29901,
13,
9651,
1015,
296,
603,
4619,
525,
29901,
29900,
29900,
29915,
13,
13,
4706,
565,
451,
1364,
29880,
29918,
370,
1182,
470,
451,
1015,
296,
603,
470,
1015,
296,
603,
29889,
2798,
877,
29901,
1495,
529,
29871,
29896,
29901,
13,
9651,
736,
525,
1545,
1598,
29918,
459,
296,
603,
5229,
29915,
13,
4706,
396,
16924,
1364,
29880,
29918,
1982,
29918,
303,
1526,
11368,
1722,
29918,
2230,
353,
525,
29900,
29900,
29901,
29900,
29900,
29915,
5754,
1364,
29880,
29918,
370,
1182,
763,
29871,
525,
29890,
29926,
9161,
2670,
13,
4706,
4576,
29918,
5504,
353,
525,
14474,
525,
718,
18074,
433,
312,
29889,
22625,
29918,
816,
29880,
29918,
1982,
29918,
303,
1526,
718,
525,
11368,
1722,
29918,
2230,
353,
320,
4907,
718,
1015,
296,
603,
718,
11297,
29915,
29871,
5754,
1364,
29880,
29918,
370,
1182,
763,
320,
4907,
718,
1364,
29880,
29918,
370,
1182,
29889,
13609,
580,
718,
11297,
2670,
29915,
13,
4706,
18074,
433,
312,
29889,
2764,
29889,
7978,
29898,
2850,
29918,
5504,
29897,
13,
4706,
18074,
433,
312,
29889,
13082,
29889,
15060,
580,
13,
13,
4706,
736,
525,
1545,
1598,
29918,
459,
296,
603,
8348,
29915,
13,
13,
1678,
14550,
13,
1678,
1423,
3762,
5235,
565,
1863,
13,
1678,
14550,
13,
1678,
822,
1423,
29918,
27041,
29898,
1792,
333,
29892,
2793,
1125,
13,
4706,
1423,
29918,
9006,
29918,
710,
353,
16321,
31213,
235,
178,
165,
29936,
29871,
30415,
31071,
31144,
30333,
234,
177,
131,
31685,
29915,
13,
4706,
5235,
353,
426,
13,
9651,
525,
27902,
29918,
26061,
29918,
4830,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
525,
31904,
30732,
31369,
31955,
29901,
31478,
31084,
31650,
31168,
30607,
30682,
30815,
30417,
235,
178,
178,
31472,
29936,
31088,
31590,
30847,
30557,
31084,
31650,
31213,
235,
178,
165,
30415,
31071,
30689,
31021,
3583,
29876,
29905,
29876,
29915,
718,
1423,
29918,
9006,
29918,
710,
29892,
13,
9651,
525,
816,
29880,
29918,
3888,
29918,
1333,
29918,
11940,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
525,
233,
157,
133,
31352,
15974,
27041,
29918,
3888,
6525,
29871,
30210,
30688,
231,
188,
163,
232,
177,
167,
30689,
31021,
30214,
31088,
30910,
31545,
31478,
31538,
30666,
31472,
31084,
31650,
31174,
30448,
30415,
31071,
30689,
31021,
31538,
30666,
31608,
31168,
30607,
30847,
30557,
3583,
29876,
29905,
29876,
29937,
31538,
30666,
30415,
31071,
29936,
29871,
30415,
31071,
31144,
30333,
234,
177,
131,
31685,
29936,
591,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
742,
13,
9651,
525,
3198,
29918,
2146,
617,
2396,
315,
3487,
6678,
29889,
657,
1417,
29898,
29896,
29897,
718,
525,
31213,
235,
178,
165,
30494,
31134,
30214,
19660,
27041,
29918,
978,
7402,
29912,
816,
29880,
29918,
370,
1182,
6525,
30688,
231,
188,
163,
232,
177,
167,
30689,
31021,
30847,
30557,
3583,
29876,
29905,
29876,
29912,
1990,
1758,
29918,
1982,
333,
1012,
29876,
31026,
31182,
233,
141,
165,
31780,
30594,
31016,
30383,
29912,
3150,
29918,
2230,
10162,
13,
4706,
500,
13,
4706,
3653,
29918,
978,
353,
525,
29961,
3198,
29918,
27041,
29962,
29915,
13,
4706,
13128,
29918,
3137,
353,
2793,
29889,
5451,
29898,
9207,
29889,
11889,
29918,
29907,
5773,
29918,
5550,
5850,
3210,
29897,
13,
4706,
565,
7431,
29898,
7050,
29918,
3137,
29897,
529,
29871,
29906,
29901,
13,
9651,
736,
5235,
1839,
27902,
29918,
26061,
29918,
4830,
2033,
13,
4706,
17117,
1364,
29880,
29918,
370,
1182,
353,
13128,
29918,
3137,
7503,
29906,
29962,
13,
13,
4706,
396,
1423,
518,
27041,
29918,
978,
29962,
12949,
1958,
848,
1863,
470,
451,
29936,
396,
426,
1792,
29918,
978,
11283,
742,
816,
29880,
29918,
370,
1182,
11283,
742,
525,
3150,
29918,
2230,
22099,
742,
3762,
29918,
978,
11283,
742,
770,
8345,
10834,
10998,
1990,
8345,
29918,
978,
2396,
1990,
8345,
29918,
978,
5501,
1982,
333,
2396,
1982,
333,
29892,
525,
2084,
2396,
1990,
8345,
29918,
2084,
5501,
344,
271,
29918,
1958,
2396,
4907,
29087,
1118,
8875,
856,
12258,
13,
4706,
1404,
29918,
5527,
29918,
8977,
353,
18074,
433,
312,
29889,
1972,
29918,
27041,
29918,
3888,
29898,
816,
29880,
29918,
370,
1182,
29922,
816,
29880,
29918,
370,
1182,
29897,
29871,
396,
1919,
4303,
333,
29896,
2433,
742,
4303,
333,
29906,
29922,
1982,
333,
29906,
29897,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
1972,
29918,
27041,
29918,
3888,
580,
742,
1404,
29918,
5527,
29918,
8977,
29897,
13,
4706,
565,
451,
1404,
29918,
5527,
29918,
8977,
29901,
13,
9651,
396,
1364,
29880,
29918,
3888,
29918,
1333,
29918,
11940,
13,
9651,
8908,
29918,
726,
353,
5235,
1839,
816,
29880,
29918,
3888,
29918,
1333,
29918,
11940,
13359,
6506,
877,
29912,
27041,
29918,
3888,
29913,
742,
1364,
29880,
29918,
370,
1182,
29897,
13,
9651,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
9651,
736,
8908,
29918,
726,
13,
4706,
1683,
29901,
13,
9651,
3762,
29918,
978,
353,
1404,
29918,
5527,
29918,
8977,
29889,
657,
877,
27041,
29918,
978,
742,
525,
27041,
29918,
978,
1495,
13,
9651,
396,
1364,
29880,
29918,
3888,
29918,
11940,
13,
9651,
8908,
29918,
726,
353,
5235,
1839,
3198,
29918,
2146,
617,
13359,
6506,
877,
29912,
27041,
29918,
978,
29913,
742,
3762,
29918,
978,
467,
6506,
877,
29912,
816,
29880,
29918,
370,
1182,
29913,
742,
1364,
29880,
29918,
370,
1182,
467,
6506,
877,
29912,
3150,
29918,
2230,
29913,
742,
1404,
29918,
5527,
29918,
8977,
29889,
657,
877,
3150,
29918,
2230,
742,
525,
489,
20296,
1495,
467,
6506,
877,
29912,
1990,
1758,
29918,
1982,
333,
29913,
742,
11297,
29876,
4286,
7122,
4197,
29872,
1839,
1990,
8345,
29918,
978,
2033,
718,
17411,
333,
2433,
718,
851,
29898,
29872,
1839,
1982,
333,
11287,
363,
321,
297,
1404,
29918,
5527,
29918,
8977,
1839,
1990,
8345,
2033,
12622,
13,
9651,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
9651,
736,
8908,
29918,
726,
13,
13,
1678,
14550,
13,
1678,
4889,
29918,
1202,
29918,
27041,
29918,
3888,
13,
1678,
14550,
13,
1678,
822,
4889,
29918,
1202,
29918,
27041,
29918,
3888,
29898,
1792,
333,
29892,
2793,
1125,
13,
4706,
3653,
29918,
978,
353,
525,
29961,
10118,
29918,
1202,
29918,
27041,
29918,
3888,
29962,
29915,
13,
4706,
4744,
29918,
29886,
29898,
9891,
29918,
978,
29892,
525,
3051,
29922,
742,
2793,
29897,
13,
4706,
736,
315,
3487,
6678,
29889,
1202,
29918,
27041,
29918,
3888,
29898,
1792,
333,
29922,
1792,
333,
29892,
2793,
29922,
3051,
29892,
4889,
29922,
5574,
29897,
13,
13,
1678,
14550,
13,
1678,
788,
3762,
29871,
5235,
13,
1678,
14550,
13,
1678,
822,
788,
29918,
27041,
29918,
3888,
29898,
1792,
333,
29892,
2793,
29892,
4889,
29922,
8824,
1125,
13,
4706,
14550,
13,
4706,
396,
31538,
30666,
30415,
31071,
29936,
289,
5838,
29883,
29936,
591,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
13,
4706,
14550,
13,
4706,
3653,
29918,
978,
353,
525,
29961,
1202,
29918,
27041,
29918,
3888,
29962,
29915,
13,
4706,
5235,
353,
426,
13,
9651,
525,
27902,
29918,
26061,
29918,
4830,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
525,
31904,
30732,
31369,
31955,
29901,
31478,
31538,
30666,
31084,
31650,
31168,
30607,
30682,
30815,
30417,
235,
178,
178,
31472,
31608,
29905,
29876,
30505,
30688,
31687,
31423,
30417,
236,
165,
135,
234,
189,
169,
31780,
30956,
30503,
30688,
231,
188,
163,
232,
177,
167,
31026,
31182,
30210,
31531,
31613,
30557,
30214,
31538,
30666,
31084,
31650,
31979,
30815,
30417,
31944,
31608,
31088,
31590,
30847,
30557,
31084,
31650,
31538,
30666,
30415,
31071,
30689,
31021,
3583,
29876,
29905,
29876,
29937,
31538,
30666,
30415,
31071,
29936,
29871,
30415,
31071,
31144,
30333,
234,
177,
131,
31685,
29936,
591,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
742,
13,
9651,
525,
27902,
29918,
26061,
29918,
705,
13496,
29918,
29879,
404,
29918,
333,
29918,
20965,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
525,
31904,
30732,
31369,
31955,
29901,
31478,
705,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
30682,
30815,
31369,
31944,
31472,
10436,
29876,
705,
13496,
29918,
29879,
404,
29918,
333,
30330,
2974,
333,
30392,
31383,
30698,
30688,
232,
186,
180,
31475,
233,
141,
150,
31473,
31024,
30683,
30210,
30214,
30413,
30392,
30858,
31507,
30755,
30806,
30210,
29939,
556,
1017,
14633,
30214,
232,
136,
186,
30988,
31024,
30683,
30525,
30545,
31088,
31811,
31084,
31650,
232,
187,
177,
31931,
30333,
233,
164,
166,
30267,
742,
13,
9651,
525,
26061,
29918,
1202,
29918,
27041,
29918,
19499,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
525,
31904,
30732,
31369,
31955,
29901,
31478,
232,
179,
160,
31787,
31024,
30683,
30688,
231,
188,
163,
232,
177,
167,
30689,
31021,
31369,
31955,
31472,
29905,
29876,
29871,
30505,
30688,
31687,
31423,
30417,
236,
165,
135,
234,
189,
169,
31780,
30956,
30503,
30688,
231,
188,
163,
232,
177,
167,
31026,
31182,
30210,
31531,
31613,
30557,
30214,
31538,
30666,
31084,
31650,
31979,
30815,
30417,
31944,
31608,
30923,
30936,
30544,
31745,
31088,
31986,
31185,
31624,
30687,
31911,
742,
13,
9651,
525,
284,
2040,
29918,
28997,
2396,
315,
3487,
6678,
29889,
657,
1417,
29898,
29896,
29897,
718,
525,
31904,
30732,
30494,
31134,
29901,
31478,
30415,
31071,
15974,
816,
29880,
29918,
370,
1182,
6525,
29871,
30210,
30688,
231,
188,
163,
232,
177,
167,
30689,
31021,
31290,
31412,
30946,
30505,
31472,
29936,
30688,
231,
188,
163,
232,
177,
167,
30689,
31021,
30847,
30557,
3583,
29876,
29905,
29876,
29912,
1990,
1758,
29918,
1982,
333,
1012,
29876,
31026,
31182,
233,
141,
165,
31780,
30594,
31016,
30383,
29912,
3150,
29918,
2230,
3400,
29905,
29876,
232,
194,
174,
30785,
30406,
233,
141,
165,
31780,
31084,
31650,
31538,
30666,
31450,
31358,
232,
147,
170,
30584,
29905,
29876,
30688,
231,
188,
163,
232,
177,
167,
30210,
30354,
31180,
1178,
29871,
30594,
31016,
30413,
30724,
31835,
31088,
31908,
236,
169,
139,
31624,
30687,
31911,
742,
13,
9651,
525,
2146,
617,
29918,
1202,
29918,
27041,
29918,
3888,
2396,
315,
3487,
6678,
29889,
657,
1417,
29898,
29896,
29897,
718,
525,
31904,
30732,
30494,
31134,
29901,
31478,
30494,
31134,
31538,
30666,
30415,
31071,
15974,
27041,
29918,
978,
7402,
29912,
816,
29880,
29918,
370,
1182,
6525,
29871,
30210,
30688,
231,
188,
163,
232,
177,
167,
30689,
31021,
31472,
29936,
30689,
31021,
30847,
30557,
3583,
29876,
29905,
29876,
29912,
1990,
1758,
29918,
1982,
333,
1012,
29876,
31026,
31182,
233,
141,
165,
31780,
30594,
31016,
30383,
29912,
3150,
29918,
2230,
1012,
29876,
30688,
231,
188,
163,
232,
177,
167,
30210,
30354,
31180,
1178,
29871,
30594,
31016,
30413,
30724,
31835,
31088,
31908,
236,
169,
139,
31624,
30687,
31911,
29915,
13,
13,
4706,
500,
13,
4706,
396,
396,
31538,
30666,
30415,
31071,
29892,
1364,
29880,
29918,
370,
1182,
29892,
27937,
29918,
333,
29892,
448,
29871,
30606,
31037,
29922,
30805,
31333,
31780,
13,
4706,
13128,
29918,
3137,
353,
2793,
29889,
5451,
29898,
9207,
29889,
11889,
29918,
29907,
5773,
29918,
5550,
5850,
3210,
29897,
13,
4706,
396,
565,
7431,
29898,
7050,
29918,
3137,
29897,
529,
29871,
29946,
29901,
13,
4706,
565,
7431,
29898,
7050,
29918,
3137,
29897,
529,
29871,
29941,
29901,
13,
9651,
736,
5235,
1839,
27902,
29918,
26061,
29918,
4830,
2033,
13,
4706,
396,
17117,
1364,
29880,
29918,
370,
1182,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29892,
1923,
333,
353,
13128,
29918,
3137,
7503,
29946,
29962,
13,
4706,
17117,
1364,
29880,
29918,
370,
1182,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
353,
13128,
29918,
3137,
7503,
29941,
29962,
13,
13,
4706,
9920,
29918,
8977,
353,
3667,
29879,
29889,
5510,
29918,
17833,
29918,
9006,
29898,
17833,
29918,
9006,
29922,
3051,
29897,
13,
4706,
396,
2069,
263,
29918,
7662,
13,
4706,
396,
565,
9920,
29918,
8977,
29889,
657,
877,
12120,
1495,
1275,
525,
1783,
12445,
2396,
13,
4706,
263,
29918,
7662,
353,
3667,
29879,
29889,
4178,
1278,
29898,
12120,
29922,
9006,
29918,
8977,
29889,
657,
877,
12120,
742,
17861,
29889,
7390,
1299,
19094,
1839,
6259,
14632,
25901,
13,
13,
4706,
396,
1364,
29880,
29918,
370,
1182,
6782,
304,
29871,
5224,
13,
4706,
1364,
29880,
29918,
370,
1182,
353,
851,
29898,
816,
29880,
29918,
370,
1182,
467,
6506,
877,
29961,
742,
525,
2824,
6506,
877,
29962,
742,
525,
2824,
13609,
580,
13,
13,
4706,
396,
11539,
29918,
1989,
353,
525,
233,
133,
171,
31076,
29915,
13,
4706,
396,
3142,
29918,
5184,
3488,
353,
525,
991,
597,
705,
13496,
29889,
29894,
29906,
29889,
15003,
524,
29889,
510,
29914,
2248,
29889,
1961,
29914,
690,
7143,
29914,
2248,
29889,
1420,
29973,
29888,
29922,
705,
13496,
29915,
13,
4706,
396,
396,
5445,
21046,
13,
4706,
396,
565,
1923,
333,
29889,
5451,
877,
29989,
1495,
2804,
29871,
29941,
29901,
13,
4706,
396,
268,
1923,
333,
353,
1923,
333,
29889,
5451,
877,
29989,
29861,
29900,
29962,
718,
525,
29989,
29915,
718,
525,
29896,
29906,
29941,
29946,
29945,
29953,
29955,
29947,
29929,
29900,
29915,
718,
525,
29989,
29915,
718,
263,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
1839,
18603,
1367,
13359,
5451,
877,
29989,
1495,
14352,
29896,
29962,
13,
4706,
396,
263,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
353,
3667,
29879,
29889,
5589,
29918,
15108,
583,
29898,
15108,
583,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
1923,
333,
29922,
2974,
333,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29922,
705,
13496,
29918,
29879,
404,
29918,
333,
29897,
13,
4706,
263,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
353,
3667,
29879,
29889,
5589,
29918,
15108,
583,
29898,
15108,
583,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29922,
705,
13496,
29918,
29879,
404,
29918,
333,
29892,
7481,
29922,
29874,
29918,
7662,
29889,
12120,
29897,
13,
4706,
396,
6251,
3271,
3488,
13,
4706,
3271,
3488,
29918,
5327,
353,
3667,
29879,
29889,
657,
29918,
5327,
29898,
2271,
29922,
29874,
29918,
7662,
29889,
22484,
29450,
29918,
4219,
1839,
5184,
29918,
3488,
7464,
13,
462,
462,
1669,
27937,
29922,
9207,
29889,
29879,
404,
29892,
13,
462,
462,
1669,
286,
29918,
13662,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
23252,
23598,
29892,
13,
462,
462,
1669,
286,
29918,
15108,
583,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
13,
462,
462,
1669,
11539,
29918,
1989,
29922,
29874,
29918,
7662,
29889,
5348,
6545,
29979,
10818,
29918,
9800,
29918,
17353,
7228,
1692,
29897,
13,
4706,
565,
451,
3271,
3488,
29918,
5327,
29901,
13,
9651,
396,
11539,
5229,
29936,
9920,
338,
8340,
13,
9651,
736,
5235,
1839,
27902,
29918,
26061,
29918,
705,
13496,
29918,
29879,
404,
29918,
333,
29918,
20965,
2033,
13,
4706,
4744,
29918,
29886,
877,
5184,
3488,
29918,
5327,
29922,
742,
3271,
3488,
29918,
5327,
7503,
29906,
29900,
29900,
2314,
13,
4706,
396,
6088,
3271,
3488,
29918,
5327,
679,
1404,
29918,
978,
29892,
3762,
29918,
978,
13,
4706,
1404,
29918,
978,
29892,
3762,
29918,
978,
353,
29349,
430,
532,
29889,
657,
29918,
978,
29898,
5184,
3488,
29918,
5327,
29897,
13,
13,
4706,
396,
1423,
518,
27041,
29918,
978,
29962,
12949,
1958,
848,
1863,
470,
451,
29936,
396,
426,
1792,
29918,
978,
11283,
742,
816,
29880,
29918,
370,
1182,
11283,
742,
3762,
29918,
978,
11283,
742,
525,
3150,
29918,
2230,
22099,
742,
770,
8345,
10834,
10998,
1990,
8345,
29918,
978,
2396,
1990,
8345,
29918,
978,
5501,
1982,
333,
2396,
1982,
333,
29892,
525,
2084,
2396,
1990,
8345,
29918,
2084,
5501,
344,
271,
29918,
1958,
2396,
4907,
29087,
1118,
8875,
856,
12258,
13,
4706,
1404,
29918,
5527,
29918,
8977,
353,
18074,
433,
312,
29889,
1972,
29918,
27041,
29918,
3888,
29898,
816,
29880,
29918,
370,
1182,
29922,
816,
29880,
29918,
370,
1182,
29892,
4303,
333,
29896,
2433,
742,
4303,
333,
29906,
2433,
1495,
13,
13,
4706,
396,
565,
2346,
5229,
29892,
11086,
3762,
5235,
13,
4706,
565,
4889,
1275,
5852,
470,
451,
1404,
29918,
5527,
29918,
8977,
29901,
13,
9651,
396,
3762,
5235,
451,
1863,
29892,
11086,
445,
3762,
29936,
268,
396,
426,
1792,
29918,
978,
11283,
742,
816,
29880,
29918,
370,
1182,
11283,
742,
3762,
29918,
978,
11283,
742,
525,
3150,
29918,
2230,
22099,
742,
770,
8345,
10834,
10998,
1990,
8345,
29918,
978,
2396,
1990,
8345,
29918,
978,
5501,
1982,
333,
2396,
1982,
333,
29892,
525,
2084,
2396,
1990,
8345,
29918,
2084,
5501,
344,
271,
29918,
1958,
2396,
4907,
29087,
1118,
8875,
856,
12258,
13,
9651,
396,
1404,
29918,
5527,
29918,
8977,
353,
29349,
430,
532,
29889,
22379,
29918,
27041,
29918,
3888,
29898,
5184,
3488,
29918,
2271,
2433,
742,
3271,
3488,
29918,
5327,
29922,
5184,
3488,
29918,
5327,
29892,
13,
9651,
396,
462,
462,
18884,
27937,
29922,
9207,
29889,
29879,
404,
29892,
286,
29918,
13662,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
23252,
23598,
29892,
13,
9651,
396,
462,
462,
18884,
286,
29918,
15108,
583,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
13,
9651,
396,
462,
462,
18884,
11539,
29918,
1989,
2433,
742,
13,
9651,
396,
462,
462,
18884,
1364,
29880,
29918,
370,
1182,
29922,
816,
29880,
29918,
370,
1182,
29892,
13,
9651,
396,
462,
462,
18884,
7481,
29922,
29874,
29918,
7662,
29889,
12120,
29892,
13,
9651,
396,
462,
462,
18884,
4576,
29918,
13082,
29922,
3044,
433,
312,
29889,
13082,
13,
9651,
396,
462,
462,
18884,
1723,
13,
9651,
1404,
29918,
5527,
29918,
8977,
353,
29349,
430,
532,
29889,
22379,
29918,
27041,
29918,
3888,
29898,
5184,
3488,
29918,
5327,
29922,
5184,
3488,
29918,
5327,
29892,
13,
462,
462,
462,
965,
263,
29918,
7662,
29922,
29874,
29918,
7662,
29892,
13,
462,
462,
462,
965,
1364,
29880,
29918,
370,
1182,
29922,
816,
29880,
29918,
370,
1182,
29892,
13,
462,
462,
462,
965,
27937,
29922,
9207,
29889,
29879,
404,
29892,
286,
29918,
13662,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
23252,
23598,
29892,
13,
462,
462,
462,
965,
286,
29918,
15108,
583,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
13,
462,
462,
462,
965,
4576,
29918,
13082,
29922,
3044,
433,
312,
29889,
13082,
13,
462,
462,
462,
965,
1723,
13,
4706,
1683,
29901,
13,
9651,
396,
2307,
1863,
13,
9651,
8908,
29918,
726,
353,
5235,
1839,
284,
2040,
29918,
28997,
13359,
6506,
877,
29912,
816,
29880,
29918,
370,
1182,
29913,
742,
1364,
29880,
29918,
370,
1182,
467,
6506,
877,
29912,
3150,
29918,
2230,
29913,
742,
1404,
29918,
5527,
29918,
8977,
29889,
657,
877,
3150,
29918,
2230,
742,
525,
489,
20296,
1495,
467,
6506,
877,
29912,
1990,
1758,
29918,
1982,
333,
29913,
742,
11297,
29876,
4286,
7122,
4197,
29872,
1839,
1990,
8345,
29918,
978,
2033,
718,
17411,
333,
2433,
718,
851,
29898,
29872,
1839,
1982,
333,
11287,
363,
321,
297,
1404,
29918,
5527,
29918,
8977,
1839,
1990,
8345,
2033,
12622,
13,
9651,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
9651,
736,
8908,
29918,
726,
13,
4706,
565,
451,
1404,
29918,
5527,
29918,
8977,
29889,
657,
877,
1990,
8345,
742,
5159,
1125,
13,
9651,
736,
5235,
1839,
26061,
29918,
1202,
29918,
27041,
29918,
19499,
2033,
13,
13,
4706,
8908,
29918,
726,
353,
5235,
1839,
2146,
617,
29918,
1202,
29918,
27041,
29918,
3888,
13359,
6506,
877,
29912,
27041,
29918,
978,
29913,
742,
1404,
29918,
5527,
29918,
8977,
29889,
657,
877,
27041,
29918,
978,
742,
525,
27041,
29918,
978,
1495,
467,
6506,
877,
29912,
816,
29880,
29918,
370,
1182,
29913,
742,
1364,
29880,
29918,
370,
1182,
467,
6506,
877,
29912,
3150,
29918,
2230,
29913,
742,
1404,
29918,
5527,
29918,
8977,
29889,
657,
877,
3150,
29918,
2230,
742,
525,
489,
20296,
1495,
467,
6506,
877,
29912,
1990,
1758,
29918,
1982,
333,
29913,
742,
11297,
29876,
4286,
7122,
4197,
29872,
1839,
1990,
8345,
29918,
978,
2033,
718,
17411,
333,
2433,
718,
851,
29898,
29872,
1839,
1982,
333,
11287,
363,
321,
297,
1404,
29918,
5527,
29918,
8977,
1839,
1990,
8345,
2033,
12622,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
4706,
736,
8908,
29918,
726,
13,
13,
1678,
14550,
13,
1678,
6088,
9637,
29892,
2457,
1923,
333,
591,
13496,
29918,
29879,
404,
29918,
333,
29871,
396,
322,
1023,
931,
995,
13,
1678,
14550,
13,
1678,
822,
6088,
29918,
15003,
29898,
1792,
333,
29892,
2793,
1125,
13,
4706,
396,
11539,
2793,
3402,
13,
4706,
5235,
353,
426,
13,
9651,
525,
27902,
29918,
26061,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
525,
233,
133,
171,
30910,
31545,
30210,
9637,
29871,
31071,
236,
173,
143,
31168,
30607,
30413,
30768,
31138,
30214,
31088,
30908,
30374,
31024,
30683,
30822,
31733,
232,
179,
160,
31787,
30584,
29915,
13,
13,
4706,
500,
13,
13,
4706,
565,
7431,
29898,
3051,
29897,
529,
29871,
29896,
29900,
29900,
29901,
13,
9651,
736,
5235,
1839,
27902,
29918,
26061,
2033,
13,
4706,
565,
2793,
29889,
2886,
877,
705,
13496,
1660,
1799,
29918,
1367,
1495,
529,
29871,
29900,
29901,
13,
9651,
736,
5235,
1839,
27902,
29918,
26061,
2033,
718,
11297,
29876,
29915,
718,
525,
31423,
30417,
233,
140,
193,
31201,
233,
161,
147,
30544,
591,
13496,
1660,
1799,
29918,
1367,
29871,
30578,
31559,
29915,
13,
4706,
396,
25342,
2793,
29889,
2886,
877,
18603,
1367,
1495,
29966,
29900,
29901,
13,
4706,
396,
268,
736,
5235,
1839,
27902,
29918,
26061,
2033,
29974,
12764,
29876,
18717,
29915,
31423,
30417,
233,
140,
193,
31201,
233,
161,
147,
30544,
26996,
5348,
1367,
29871,
30578,
31559,
29915,
13,
13,
4706,
1018,
29901,
13,
9651,
2793,
4619,
525,
2056,
29915,
13,
9651,
396,
4766,
353,
337,
29889,
12198,
29898,
29878,
29915,
18603,
1367,
29905,
2013,
29893,
3124,
4295,
29881,
29912,
29896,
29900,
1012,
4295,
29881,
29912,
29896,
29900,
29913,
1495,
13,
9651,
396,
26996,
5348,
1367,
353,
4766,
29889,
4478,
29898,
3051,
467,
2972,
29898,
29900,
29897,
13,
13,
9651,
4766,
353,
337,
29889,
12198,
29898,
29878,
29915,
705,
13496,
1660,
1799,
29918,
1367,
29905,
2013,
29893,
29974,
10780,
29922,
7110,
29879,
29936,
2314,
1495,
13,
9651,
591,
13496,
1660,
1799,
29918,
1367,
353,
4766,
29889,
4478,
29898,
3051,
467,
2972,
29898,
29900,
29897,
13,
13,
9651,
396,
4766,
353,
337,
29889,
12198,
29898,
29878,
29915,
10780,
14065,
29950,
29885,
29918,
29880,
21908,
3187,
29893,
29912,
29941,
29906,
1012,
29922,
2144,
29881,
29912,
29896,
29900,
2119,
29973,
29922,
7110,
29879,
29936,
2314,
1495,
13,
9651,
396,
379,
29885,
29918,
29880,
21908,
29918,
2230,
353,
4766,
29889,
4478,
29898,
3051,
467,
2972,
29898,
29900,
29897,
13,
9651,
396,
13,
9651,
396,
26996,
5348,
1367,
29918,
2230,
29918,
29906,
353,
337,
29889,
12198,
29898,
29878,
29915,
10780,
14065,
18603,
1367,
29905,
2013,
29893,
29912,
29941,
29906,
1012,
4295,
29881,
29912,
29896,
29900,
1012,
29989,
2144,
29881,
29912,
29896,
29900,
2119,
29973,
29922,
7110,
29879,
29936,
2314,
1495,
13,
9651,
396,
26996,
5348,
1367,
29918,
2230,
29918,
29906,
353,
4766,
29889,
4478,
29898,
3051,
467,
2972,
29898,
29900,
29897,
13,
13,
9651,
736,
11297,
29876,
29915,
718,
591,
13496,
1660,
1799,
29918,
1367,
718,
11297,
29876,
29915,
29871,
396,
718,
18603,
1367,
13,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
4744,
29918,
29886,
877,
29961,
29923,
5387,
3158,
518,
29995,
29879,
29962,
5229,
29892,
3682,
338,
1273,
29879,
29915,
1273,
6702,
5510,
29918,
15003,
742,
2062,
29898,
29872,
4961,
13,
9651,
736,
5235,
1839,
27902,
29918,
26061,
2033,
718,
525,
29961,
705,
13496,
1660,
1799,
29918,
1367,
29871,
31423,
30417,
233,
140,
193,
30780,
29962,
29915,
13,
13,
1678,
14550,
13,
1678,
1855,
2230,
13,
1678,
14550,
13,
1678,
822,
1855,
2230,
29898,
1792,
333,
29892,
2793,
1125,
13,
4706,
3653,
29918,
978,
353,
16321,
276,
1997,
603,
29915,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
1792,
333,
29892,
2793,
742,
1404,
333,
29892,
2793,
29897,
13,
4706,
736,
315,
3487,
6678,
29889,
3874,
29890,
29918,
344,
271,
29898,
1792,
333,
29892,
2793,
29892,
3414,
29918,
14380,
29922,
9207,
29889,
29911,
3289,
29968,
29918,
29968,
22255,
1839,
276,
1997,
603,
11287,
13,
13,
1678,
14550,
13,
1678,
17229,
29918,
344,
271,
13,
1678,
14550,
13,
1678,
822,
17229,
29918,
344,
271,
29898,
1792,
333,
29892,
2793,
29892,
3414,
29918,
14380,
29922,
9207,
29889,
29911,
3289,
29968,
29918,
29968,
22255,
1839,
690,
7143,
2033,
1125,
13,
4706,
14550,
13,
308,
31195,
30594,
236,
165,
135,
30495,
891,
29871,
233,
144,
164,
233,
191,
146,
891,
432,
29880,
891,
396,
29606,
891,
29871,
30592,
30325,
236,
165,
135,
234,
189,
169,
891,
29871,
233,
141,
165,
31780,
891,
396,
29939,
29920,
891,
3855,
29920,
268,
31608,
13,
308,
30415,
31071,
31144,
30333,
234,
177,
131,
31685,
891,
29871,
31688,
233,
142,
191,
31608,
13,
308,
30688,
231,
188,
163,
232,
177,
167,
333,
29896,
31608,
31780,
30956,
30850,
29896,
31608,
30688,
231,
188,
163,
232,
177,
167,
333,
29906,
30214,
31780,
30956,
30850,
29906,
31608,
13,
4706,
1923,
333,
31608,
705,
13496,
29918,
29879,
404,
29918,
333,
13,
4706,
4805,
29918,
3888,
29901,
13,
4706,
429,
5410,
259,
31688,
30936,
233,
140,
170,
30448,
30594,
31016,
891,
29871,
31026,
233,
141,
165,
30594,
31016,
29936,
13,
4706,
758,
29918,
27765,
29871,
30948,
30325,
232,
144,
182,
30594,
236,
165,
135,
235,
177,
165,
891,
29871,
30592,
30325,
236,
165,
135,
234,
189,
169,
29936,
13,
4706,
301,
4141,
29880,
29918,
272,
29918,
312,
2288,
29871,
30672,
31475,
30861,
31900,
236,
169,
137,
29871,
891,
259,
30805,
31333,
31780,
29936,
13,
4706,
9815,
29918,
9006,
29871,
233,
140,
172,
31599,
31084,
31650,
13,
4706,
14550,
13,
4706,
3653,
29918,
978,
353,
16321,
3874,
29890,
29918,
344,
271,
29915,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
1792,
333,
29892,
2793,
742,
1404,
333,
29892,
2793,
29897,
13,
4706,
3414,
29918,
14380,
29918,
710,
353,
525,
29961,
232,
138,
137,
30940,
233,
141,
165,
31780,
29962,
525,
565,
3414,
29918,
14380,
1275,
17861,
29889,
29911,
3289,
29968,
29918,
29968,
22255,
1839,
690,
7143,
2033,
1683,
525,
29961,
31195,
30594,
233,
144,
164,
233,
191,
146,
29962,
29871,
525,
13,
4706,
5235,
353,
426,
13,
9651,
525,
3874,
29890,
29918,
9006,
29918,
8477,
2396,
525,
8477,
5235,
742,
13,
9651,
525,
27902,
29918,
26061,
29918,
4830,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
3414,
29918,
14380,
29918,
710,
718,
29915,
7662,
31302,
31398,
31369,
31955,
29901,
31478,
233,
141,
165,
31780,
31084,
31650,
31168,
30607,
30682,
30815,
30417,
235,
178,
178,
31472,
29905,
29876,
31088,
231,
190,
151,
234,
190,
137,
233,
166,
131,
31213,
31666,
31590,
30847,
30557,
236,
164,
189,
31463,
30908,
30374,
31795,
235,
193,
148,
30910,
31545,
3583,
29876,
29905,
29876,
29937,
233,
141,
165,
31780,
29936,
29871,
30415,
31071,
31144,
30333,
234,
177,
131,
31685,
29936,
29871,
30688,
231,
188,
163,
232,
177,
167,
333,
29936,
31780,
30956,
30850,
29936,
30688,
231,
188,
163,
232,
177,
167,
333,
29936,
31780,
30956,
30850,
29936,
591,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
742,
13,
9651,
525,
27902,
29918,
26061,
29918,
705,
13496,
29918,
29879,
404,
29918,
333,
29918,
20965,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
3414,
29918,
14380,
29918,
710,
718,
525,
7662,
31302,
31398,
31369,
31955,
29901,
31478,
705,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
30682,
30815,
31369,
31944,
31472,
29905,
29876,
705,
13496,
29918,
29879,
404,
29918,
333,
30330,
2974,
333,
30392,
31383,
30698,
30688,
232,
186,
180,
31475,
233,
141,
150,
31473,
31024,
30683,
30210,
30214,
30413,
30392,
30858,
31507,
30755,
30806,
30210,
29939,
556,
1017,
14633,
30214,
31100,
30413,
30392,
705,
13496,
29918,
29879,
404,
29918,
333,
30214,
2974,
333,
30810,
31977,
30502,
31166,
235,
178,
144,
31608,
232,
136,
186,
30988,
31024,
30683,
30525,
30545,
31088,
31811,
31084,
31650,
232,
187,
177,
31931,
30333,
233,
164,
166,
30267,
742,
13,
9651,
525,
27902,
29918,
26061,
29918,
657,
29918,
27041,
29918,
3888,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
3414,
29918,
14380,
29918,
710,
718,
525,
7662,
31302,
31398,
31369,
31955,
29901,
31478,
31780,
30956,
30746,
30689,
31021,
30413,
232,
143,
188,
31361,
31472,
31088,
31835,
31439,
30688,
231,
188,
163,
232,
177,
167,
30689,
31021,
30946,
30505,
231,
187,
151,
30688,
231,
188,
163,
232,
177,
167,
333,
30724,
31835,
29905,
29876,
30847,
31383,
232,
187,
177,
31931,
31088,
31986,
31185,
31624,
30687,
31911,
31548,
30687,
742,
13,
9651,
525,
27902,
29918,
26061,
29918,
344,
271,
1949,
29918,
1333,
29918,
11940,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
3414,
29918,
14380,
29918,
710,
718,
525,
7662,
31302,
31398,
31369,
31955,
29901,
31478,
30688,
231,
188,
163,
232,
177,
167,
333,
30413,
232,
143,
188,
31361,
31391,
30413,
30946,
30505,
31389,
31780,
30956,
30850,
31472,
31088,
233,
166,
131,
31213,
30822,
31733,
31787,
29905,
29876,
31541,
31695,
30210,
30688,
231,
188,
163,
232,
177,
167,
30210,
333,
30689,
31021,
26254,
1990,
1758,
29918,
1982,
333,
29913,
742,
13,
13,
9651,
525,
26690,
29918,
2704,
2396,
315,
3487,
6678,
29889,
657,
1417,
6278,
29896,
29897,
718,
3414,
29918,
14380,
29918,
710,
718,
525,
7662,
31302,
31398,
31369,
31955,
31608,
31295,
31043,
31745,
235,
178,
178,
31608,
29905,
29876,
31088,
31986,
31185,
31624,
30687,
31911,
31666,
31302,
231,
193,
158,
30847,
30557,
30689,
31021,
3583,
29876,
29905,
29876,
29912,
26690,
29918,
2704,
29913,
742,
13,
13,
9651,
525,
27902,
29918,
2146,
617,
2396,
315,
3487,
6678,
29889,
657,
1417,
29898,
29896,
29897,
718,
3414,
29918,
14380,
29918,
710,
718,
525,
7662,
31302,
31398,
30494,
31134,
29901,
7662,
29918,
333,
3790,
7662,
29918,
333,
29913,
31608,
29905,
29876,
233,
133,
171,
30210,
31450,
31358,
30689,
31021,
30847,
30557,
3583,
29876,
29912,
7662,
29918,
3888,
29913,
742,
13,
13,
4706,
500,
13,
4706,
565,
451,
2793,
29901,
13,
9651,
8908,
29918,
726,
353,
5235,
1839,
8477,
29918,
3888,
2033,
13,
9651,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
9651,
736,
8908,
29918,
726,
13,
13,
4706,
396,
9920,
1134,
353,
1404,
13,
4706,
396,
11539,
3402,
29892,
9920,
29918,
8977,
584,
396,
426,
816,
29880,
29918,
370,
1182,
29901,
15516,
4303,
333,
29896,
29901,
15516,
12949,
29918,
1949,
29896,
29901,
15516,
4303,
333,
29906,
29901,
15516,
12949,
29918,
1949,
29906,
29901,
15516,
2974,
333,
11283,
742,
591,
13496,
29918,
29879,
404,
29918,
333,
29901,
4907,
29913,
13,
4706,
9920,
29918,
8977,
353,
3667,
29879,
29889,
5510,
29918,
3874,
29890,
29918,
344,
271,
29918,
9006,
29898,
6519,
29922,
3051,
29897,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
5510,
29918,
3874,
29890,
29918,
344,
271,
29918,
9006,
580,
742,
9920,
29918,
8977,
29897,
13,
13,
4706,
565,
451,
9920,
29918,
8977,
29901,
13,
9651,
8908,
29918,
726,
353,
5235,
1839,
27902,
29918,
26061,
29918,
4830,
2033,
13,
9651,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
9651,
736,
8908,
29918,
726,
13,
13,
4706,
396,
4226,
9920,
13,
4706,
396,
1364,
29880,
29918,
370,
1182,
29892,
4303,
333,
29896,
29892,
12949,
29918,
1949,
29896,
29892,
4303,
333,
29906,
29892,
12949,
29918,
1949,
29906,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29892,
1923,
333,
353,
9920,
29918,
8977,
1839,
816,
29880,
29918,
370,
1182,
7464,
9920,
29918,
8977,
1839,
1982,
333,
29896,
7464,
9920,
29918,
8977,
1839,
344,
271,
29918,
1949,
29896,
7464,
9920,
29918,
8977,
1839,
1982,
333,
29906,
7464,
9920,
29918,
8977,
1839,
344,
271,
29918,
1949,
29906,
7464,
9920,
29918,
8977,
1839,
705,
13496,
29918,
29879,
404,
29918,
333,
7464,
9920,
29918,
8977,
1839,
2974,
333,
2033,
13,
4706,
1364,
29880,
29918,
370,
1182,
29892,
4303,
333,
29896,
29892,
12949,
29918,
1949,
29896,
29892,
4303,
333,
29906,
29892,
12949,
29918,
1949,
29906,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29892,
353,
9920,
29918,
8977,
1839,
816,
29880,
29918,
370,
1182,
7464,
9920,
29918,
8977,
1839,
1982,
333,
29896,
7464,
9920,
29918,
8977,
1839,
344,
271,
29918,
1949,
29896,
7464,
9920,
29918,
8977,
1839,
1982,
333,
29906,
7464,
9920,
29918,
8977,
1839,
344,
271,
29918,
1949,
29906,
7464,
9920,
29918,
8977,
1839,
705,
13496,
29918,
29879,
404,
29918,
333,
2033,
29871,
396,
1919,
9920,
29918,
8977,
1839,
2974,
333,
2033,
13,
4706,
396,
9920,
13,
4706,
429,
29872,
29918,
2230,
353,
9920,
29918,
8977,
29889,
657,
877,
8097,
29918,
2230,
742,
27255,
29871,
396,
1722,
29918,
2230,
13,
4706,
396,
4766,
353,
9920,
29918,
8977,
29889,
657,
877,
11037,
742,
17861,
29889,
29925,
1299,
4945,
29940,
1839,
15094,
11287,
29871,
396,
758,
13,
13,
4706,
396,
263,
3414,
1919,
263,
2180,
1278,
29892,
2069,
13,
4706,
263,
29918,
7662,
353,
3667,
29879,
29889,
4178,
1278,
29898,
12120,
29922,
9006,
29918,
8977,
29889,
657,
877,
12120,
742,
17861,
29889,
7390,
1299,
19094,
1839,
6259,
14632,
2033,
511,
13,
462,
632,
4766,
29922,
9006,
29918,
8977,
29889,
657,
877,
11037,
742,
17861,
29889,
29925,
1299,
4945,
29940,
1839,
4986,
28658,
25901,
13,
13,
4706,
396,
11539,
1923,
333,
322,
591,
13496,
29918,
29879,
404,
29918,
333,
13,
4706,
396,
5445,
21046,
13,
4706,
396,
263,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
353,
3667,
29879,
29889,
5589,
29918,
15108,
583,
29898,
15108,
583,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
1923,
333,
29922,
2974,
333,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29922,
705,
13496,
29918,
29879,
404,
29918,
333,
29892,
7481,
29922,
29874,
29918,
7662,
29889,
12120,
29897,
13,
4706,
263,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
353,
3667,
29879,
29889,
5589,
29918,
15108,
583,
29898,
15108,
583,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29922,
705,
13496,
29918,
29879,
404,
29918,
333,
29892,
7481,
29922,
29874,
29918,
7662,
29889,
12120,
29897,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
5589,
29918,
15108,
583,
580,
742,
263,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29897,
13,
4706,
396,
6251,
3271,
3488,
13,
4706,
396,
1243,
13,
4706,
3271,
3488,
29918,
5327,
353,
3667,
29879,
29889,
657,
29918,
5327,
29898,
2271,
29922,
29874,
29918,
7662,
29889,
22484,
29450,
29918,
4219,
1839,
5184,
29918,
3488,
7464,
27937,
29922,
9207,
29889,
29879,
404,
29892,
13,
462,
462,
462,
462,
18884,
286,
29918,
13662,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
23252,
23598,
29892,
13,
462,
462,
462,
462,
18884,
286,
29918,
15108,
583,
29922,
29874,
29918,
7662,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
13,
462,
462,
462,
462,
18884,
11539,
29918,
1989,
29922,
29874,
29918,
7662,
29889,
5348,
6545,
29979,
10818,
29918,
9800,
29918,
17353,
7228,
1692,
29897,
13,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
657,
29918,
5327,
580,
742,
3271,
3488,
29918,
5327,
7503,
29941,
29900,
29900,
2314,
13,
4706,
565,
451,
3271,
3488,
29918,
5327,
29901,
13,
9651,
396,
11539,
5229,
29936,
9920,
338,
8340,
13,
9651,
8908,
29918,
726,
353,
5235,
1839,
27902,
29918,
26061,
29918,
705,
13496,
29918,
29879,
404,
29918,
333,
29918,
20965,
2033,
13,
9651,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
9651,
736,
8908,
29918,
726,
13,
4706,
396,
4744,
29918,
29886,
877,
5184,
3488,
29918,
5327,
29922,
742,
3271,
3488,
29918,
5327,
29897,
13,
4706,
396,
6088,
3271,
3488,
29918,
5327,
679,
1404,
29918,
978,
29892,
3762,
29918,
978,
13,
13,
4706,
1404,
29918,
978,
29892,
3762,
29918,
978,
353,
29349,
430,
532,
29889,
657,
29918,
978,
29898,
5184,
3488,
29918,
5327,
29897,
13,
13,
4706,
396,
1423,
518,
27041,
29918,
978,
29962,
12949,
1958,
848,
1863,
470,
451,
29936,
396,
426,
1792,
29918,
978,
11283,
742,
816,
29880,
29918,
370,
1182,
11283,
742,
525,
3150,
29918,
2230,
22099,
742,
3762,
29918,
978,
11283,
742,
770,
8345,
10834,
10998,
1990,
8345,
29918,
978,
2396,
1990,
8345,
29918,
978,
5501,
1982,
333,
2396,
1982,
333,
29892,
525,
2084,
2396,
1990,
8345,
29918,
2084,
5501,
344,
271,
29918,
1958,
2396,
4907,
29087,
1118,
8875,
856,
12258,
13,
4706,
1404,
29918,
5527,
29918,
8977,
353,
18074,
433,
312,
29889,
1972,
29918,
27041,
29918,
3888,
29898,
816,
29880,
29918,
370,
1182,
29922,
816,
29880,
29918,
370,
1182,
29897,
29871,
396,
1919,
4303,
333,
29896,
2433,
742,
4303,
333,
29906,
29922,
1982,
333,
29906,
29897,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
1972,
29918,
27041,
29918,
3888,
580,
742,
851,
29898,
1792,
29918,
5527,
29918,
8977,
29897,
7503,
29946,
29900,
29900,
2314,
13,
13,
4706,
396,
396,
565,
2346,
5229,
29892,
11086,
3762,
5235,
13,
4706,
396,
565,
451,
1404,
29918,
5527,
29918,
8977,
29901,
13,
4706,
396,
268,
396,
3762,
5235,
451,
1863,
29892,
11086,
445,
3762,
29936,
268,
396,
426,
1792,
29918,
978,
11283,
742,
816,
29880,
29918,
370,
1182,
11283,
742,
525,
3150,
29918,
2230,
22099,
742,
3762,
29918,
978,
11283,
742,
770,
8345,
10834,
10998,
1990,
8345,
29918,
978,
2396,
1990,
8345,
29918,
978,
5501,
1982,
333,
2396,
1982,
333,
29892,
525,
2084,
2396,
1990,
8345,
29918,
2084,
5501,
344,
271,
29918,
1958,
2396,
4907,
29087,
1118,
8875,
856,
12258,
13,
4706,
396,
268,
1404,
29918,
5527,
29918,
8977,
353,
29349,
430,
532,
29889,
22379,
29918,
27041,
29918,
3888,
29898,
5184,
3488,
29918,
2271,
2433,
742,
3271,
3488,
29918,
5327,
29922,
5184,
3488,
29918,
5327,
29892,
13,
4706,
396,
462,
462,
462,
1678,
27937,
29922,
9207,
29889,
29879,
404,
29892,
286,
29918,
13662,
29922,
9207,
29889,
29924,
29918,
23252,
23598,
29892,
286,
29918,
15108,
583,
29922,
9207,
29889,
29924,
29918,
3217,
8949,
29059,
29892,
13,
4706,
396,
462,
462,
462,
1678,
11539,
29918,
1989,
2433,
742,
13,
4706,
396,
462,
462,
462,
1678,
1364,
29880,
29918,
370,
1182,
29922,
816,
29880,
29918,
370,
1182,
29892,
13,
4706,
396,
462,
462,
462,
1678,
4576,
29918,
13082,
29922,
3044,
433,
312,
29889,
13082,
13,
4706,
396,
462,
462,
462,
1678,
1723,
13,
4706,
396,
268,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
22379,
29918,
27041,
29918,
3888,
580,
742,
1404,
29918,
5527,
29918,
8977,
29897,
13,
13,
4706,
396,
3158,
2346,
322,
11086,
1716,
5229,
13,
4706,
565,
451,
1404,
29918,
5527,
29918,
8977,
29901,
13,
9651,
8908,
29918,
726,
353,
5235,
1839,
27902,
29918,
26061,
29918,
657,
29918,
27041,
29918,
3888,
2033,
13,
9651,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
9651,
736,
8908,
29918,
726,
13,
13,
4706,
396,
679,
3762,
5235,
8348,
322,
769,
3386,
518,
276,
29918,
690,
7143,
29918,
9006,
29962,
848,
29901,
3414,
29918,
333,
29936,
1792,
333,
29936,
29871,
29941,
29906,
29941,
29936,
29906,
29896,
29892,
29941,
29896,
29936,
29871,
29941,
29906,
29946,
29936,
29946,
29896,
29892,
29945,
29896,
29936,
591,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
29936,
3440,
29918,
3888,
13,
4706,
1404,
29918,
5527,
29918,
8977,
1839,
1792,
29918,
978,
2033,
353,
1404,
29918,
978,
13,
4706,
396,
679,
12949,
14821,
322,
770,
8345,
29918,
978,
13,
13,
4706,
396,
599,
29918,
1982,
29918,
695,
893,
1758,
9657,
29912,
1982,
333,
29901,
1067,
893,
1758,
29913,
13,
4706,
599,
29918,
1982,
29918,
695,
893,
1758,
353,
9657,
4197,
29898,
1990,
8345,
1839,
1982,
333,
7464,
770,
8345,
1839,
1990,
8345,
29918,
978,
11287,
363,
770,
8345,
297,
1404,
29918,
5527,
29918,
8977,
1839,
1990,
8345,
2033,
2314,
13,
4706,
4303,
29918,
344,
271,
29918,
3137,
353,
17288,
1982,
333,
29896,
29892,
12949,
29918,
1949,
29896,
511,
313,
1982,
333,
29906,
29892,
12949,
29918,
1949,
29906,
4638,
13,
4706,
1067,
893,
1758,
29918,
29883,
5499,
593,
353,
315,
3487,
6678,
29889,
27902,
29918,
344,
271,
29898,
1982,
29918,
344,
271,
29918,
3137,
29892,
1404,
29918,
5527,
29918,
8977,
29897,
13,
13,
4706,
396,
565,
14821,
451,
1993,
29892,
3682,
13,
4706,
565,
451,
1067,
893,
1758,
29918,
29883,
5499,
593,
29901,
13,
9651,
8908,
29918,
726,
353,
5235,
1839,
27902,
29918,
26061,
29918,
344,
271,
1949,
29918,
1333,
29918,
11940,
13359,
6506,
877,
29912,
1990,
1758,
29918,
1982,
333,
29913,
742,
11297,
29876,
4286,
7122,
4197,
29872,
1839,
1990,
8345,
29918,
978,
2033,
718,
17411,
333,
2433,
718,
851,
29898,
29872,
1839,
1982,
333,
11287,
363,
321,
297,
1404,
29918,
5527,
29918,
8977,
1839,
1990,
8345,
2033,
12622,
13,
9651,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
3445,
368,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
9651,
736,
8908,
29918,
726,
13,
13,
4706,
770,
8345,
29918,
978,
29896,
29892,
14821,
29896,
353,
1067,
893,
1758,
29918,
29883,
5499,
593,
29961,
29900,
29962,
13,
4706,
770,
8345,
29918,
978,
29906,
29892,
14821,
29906,
353,
1067,
893,
1758,
29918,
29883,
5499,
593,
29961,
29896,
29962,
13,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
657,
14821,
29896,
322,
14821,
29906,
742,
525,
1990,
8345,
29918,
978,
29896,
29922,
742,
770,
8345,
29918,
978,
29896,
29892,
13,
18884,
525,
29302,
29896,
29922,
742,
13,
18884,
14821,
29896,
29892,
525,
1990,
8345,
29918,
978,
29906,
29922,
742,
770,
8345,
29918,
978,
29906,
29892,
525,
29302,
29906,
29922,
742,
14821,
29906,
29897,
13,
13,
4706,
396,
3386,
29961,
276,
29918,
690,
7143,
29918,
9006,
29962,
3414,
29918,
333,
29936,
1404,
333,
29936,
1404,
29918,
978,
29936,
3762,
29918,
978,
29936,
770,
8345,
29918,
978,
29896,
29936,
29941,
29906,
29941,
29936,
344,
271,
29918,
1949,
29936,
29871,
29906,
29896,
29892,
29941,
29896,
29936,
770,
8345,
29918,
978,
29906,
29936,
29871,
29941,
29906,
29946,
29936,
12949,
29918,
1949,
29906,
29936,
29871,
29946,
29896,
29892,
29945,
29896,
29936,
591,
13496,
29918,
29879,
404,
29918,
333,
29936,
1923,
333,
29936,
3440,
29918,
3888,
13,
4706,
1722,
29918,
2230,
353,
1404,
29918,
5527,
29918,
8977,
29889,
657,
877,
3150,
29918,
2230,
742,
525,
29900,
29900,
29901,
29900,
29900,
29899,
29900,
29900,
29901,
29900,
29900,
1495,
565,
3414,
29918,
14380,
1275,
17861,
29889,
29911,
3289,
29968,
29918,
29968,
22255,
1839,
690,
7143,
2033,
1683,
3667,
29879,
29889,
657,
29918,
1256,
29898,
4830,
543,
29995,
29950,
16664,
29924,
16664,
29903,
1159,
13,
4706,
9752,
29918,
2230,
353,
3667,
29879,
29889,
657,
29918,
1256,
29898,
4830,
2433,
29995,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
1495,
13,
13,
4706,
1722,
29918,
2230,
353,
429,
29872,
29918,
2230,
565,
429,
29872,
29918,
2230,
1683,
1722,
29918,
2230,
13,
4706,
591,
13496,
29918,
29879,
404,
29918,
333,
353,
591,
13496,
29918,
29879,
404,
29918,
333,
13,
4706,
8348,
29918,
26061,
29892,
9493,
29918,
3888,
29892,
4045,
29918,
2914,
29918,
3888,
353,
15516,
15516,
6629,
13,
4706,
3414,
29918,
333,
353,
17861,
29889,
29911,
3289,
29968,
29918,
1367,
13,
13,
4706,
396,
4045,
29918,
3888,
338,
4390,
3402,
13,
4706,
4045,
29918,
3888,
353,
6571,
13,
4706,
4045,
29918,
3888,
1839,
497,
29918,
1982,
29918,
695,
893,
1758,
2033,
353,
599,
29918,
1982,
29918,
695,
893,
1758,
13,
13,
4706,
3440,
29918,
3888,
353,
6629,
13,
4706,
1923,
333,
353,
17861,
29889,
18603,
1367,
565,
263,
29918,
7662,
29889,
12120,
1275,
17861,
29889,
7390,
1299,
19094,
1839,
6259,
14632,
2033,
1683,
6629,
13,
4706,
396,
1596,
877,
2974,
333,
742,
1923,
333,
29897,
13,
4706,
1828,
353,
313,
13,
9651,
1404,
333,
29892,
3414,
29918,
14380,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29892,
8348,
29918,
26061,
29892,
9493,
29918,
3888,
29892,
4045,
29918,
2914,
29918,
3888,
29892,
3414,
29918,
333,
29892,
13,
9651,
1404,
29918,
978,
29892,
3762,
29918,
978,
29892,
1364,
29880,
29918,
370,
1182,
29892,
1722,
29918,
2230,
29892,
770,
8345,
29918,
978,
29896,
29892,
4303,
333,
29896,
29892,
12949,
29918,
1949,
29896,
29892,
14821,
29896,
29892,
13,
9651,
770,
8345,
29918,
978,
29906,
29892,
4303,
333,
29906,
29892,
12949,
29918,
1949,
29906,
29892,
14821,
29906,
29892,
1923,
333,
29892,
3440,
29918,
3888,
29892,
9752,
29918,
2230,
29892,
13,
9651,
263,
29918,
7662,
29889,
11037,
29892,
263,
29918,
7662,
29889,
12120,
29892,
4390,
29889,
29881,
17204,
29898,
720,
414,
29918,
3888,
29897,
13,
4706,
1723,
13,
13,
4706,
396,
13,
4706,
260,
29890,
29918,
27765,
29918,
7662,
353,
525,
27765,
29918,
7662,
29915,
13,
13,
4706,
396,
5191,
674,
5217,
278,
1863,
9637,
322,
4635,
263,
716,
9637,
29892,
769,
278,
1178,
674,
1735,
13,
4706,
396,
4635,
964,
260,
29890,
29918,
27765,
29918,
7662,
13,
4706,
396,
5195,
7390,
11538,
964,
9826,
29918,
7662,
29871,
313,
1792,
333,
29892,
3414,
29918,
14380,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29892,
8348,
29918,
26061,
29892,
9493,
29918,
3888,
29892,
4045,
29918,
2914,
29918,
3888,
1919,
3414,
29918,
333,
29892,
1404,
29918,
978,
29892,
3762,
29918,
978,
29892,
1364,
29880,
29918,
370,
1182,
29892,
1722,
29918,
2230,
29892,
770,
8345,
29918,
978,
29896,
29892,
4303,
333,
29896,
29892,
12949,
29918,
1949,
29896,
29892,
14821,
29896,
29892,
770,
8345,
29918,
978,
29906,
29892,
29871,
4303,
333,
29906,
29892,
12949,
29918,
1949,
29906,
29892,
14821,
29906,
29892,
1923,
333,
29892,
3440,
29918,
3888,
29892,
9752,
29918,
2230,
29892,
4766,
29892,
7481,
29892,
4045,
29918,
3888,
1723,
13,
13,
4706,
4576,
29918,
27765,
29918,
7662,
353,
525,
1525,
7390,
11538,
11646,
525,
718,
260,
29890,
29918,
27765,
29918,
7662,
718,
320,
13,
462,
308,
525,
29898,
1792,
333,
29892,
3414,
29918,
14380,
29892,
591,
13496,
29918,
29879,
404,
29918,
333,
29892,
8348,
29918,
26061,
29892,
9493,
29918,
3888,
29892,
4045,
29918,
2914,
29918,
3888,
29892,
3414,
29918,
333,
5501,
320,
13,
9651,
525,
1792,
29918,
978,
29892,
3762,
29918,
978,
29892,
1364,
29880,
29918,
370,
1182,
29892,
1722,
29918,
2230,
29892,
770,
8345,
29918,
978,
29896,
29892,
4303,
333,
29896,
29892,
12949,
29918,
1949,
29896,
29892,
14821,
29896,
5501,
320,
13,
9651,
525,
1990,
8345,
29918,
978,
29906,
29892,
4303,
333,
29906,
29892,
12949,
29918,
1949,
29906,
29892,
14821,
29906,
29892,
1923,
333,
29892,
3440,
29918,
3888,
29892,
9752,
29918,
2230,
5501,
320,
13,
9651,
525,
11037,
29892,
7481,
29892,
4045,
29918,
3888,
29897,
525,
718,
320,
13,
462,
308,
525,
15673,
877,
718,
525,
29973,
5501,
334,
313,
2435,
29898,
3207,
29897,
448,
29871,
29896,
29897,
718,
525,
7897,
29915,
13,
13,
4706,
18074,
433,
312,
29889,
2764,
29889,
7978,
29898,
2850,
29918,
27765,
29918,
7662,
29892,
1828,
29897,
13,
4706,
18074,
433,
312,
29889,
13082,
29889,
15060,
580,
13,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
1525,
7390,
11538,
322,
14482,
3158,
29936,
1828,
29922,
742,
1828,
29897,
13,
13,
4706,
8908,
29918,
726,
353,
5235,
1839,
27902,
29918,
2146,
617,
13359,
6506,
877,
29912,
7662,
29918,
333,
29913,
742,
851,
29898,
9207,
29889,
29911,
3289,
29968,
29918,
1367,
8106,
6506,
877,
29912,
7662,
29918,
3888,
29913,
742,
11297,
29876,
1839,
718,
3762,
29918,
978,
718,
17411,
29915,
718,
1364,
29880,
29918,
370,
1182,
718,
525,
29962,
29915,
718,
13,
462,
462,
462,
259,
525,
30210,
29905,
29876,
1839,
718,
770,
8345,
29918,
978,
29896,
718,
17411,
333,
2433,
718,
4303,
333,
29896,
718,
525,
29962,
30210,
1839,
718,
851,
29898,
344,
271,
29918,
1949,
29896,
29897,
718,
525,
29962,
30850,
31780,
30956,
29905,
29876,
29915,
718,
13,
462,
462,
462,
259,
525,
1839,
718,
770,
8345,
29918,
978,
29906,
718,
17411,
333,
2433,
718,
4303,
333,
29906,
718,
525,
29962,
30210,
1839,
718,
851,
29898,
344,
271,
29918,
1949,
29906,
29897,
718,
525,
29962,
30850,
31780,
30956,
29905,
29876,
233,
140,
170,
30448,
30594,
31016,
11283,
718,
1722,
29918,
2230,
718,
27255,
718,
320,
13,
462,
462,
462,
259,
11297,
29876,
31382,
30607,
11283,
718,
6702,
236,
165,
135,
30495,
30948,
30325,
243,
162,
149,
189,
29915,
565,
263,
29918,
7662,
29889,
11037,
1275,
17861,
29889,
29925,
1299,
4945,
29940,
1839,
4986,
28658,
2033,
1683,
525,
236,
165,
135,
234,
189,
169,
30592,
30408,
243,
162,
149,
189,
1495,
718,
11297,
29876,
30606,
31037,
11283,
718,
6702,
29966,
30672,
31475,
30861,
31900,
236,
169,
137,
16299,
565,
263,
29918,
7662,
29889,
12120,
1275,
17861,
29889,
7390,
1299,
19094,
1839,
6259,
14632,
2033,
1683,
12801,
30805,
31333,
31780,
29958,
1495,
13,
4706,
17861,
29889,
29911,
3289,
29968,
29918,
1367,
4619,
29871,
29896,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
29911,
3289,
29968,
29918,
1367,
29922,
742,
17861,
29889,
29911,
3289,
29968,
29918,
1367,
29892,
525,
3874,
29890,
29918,
344,
271,
3158,
975,
29892,
8908,
29918,
726,
29922,
742,
8908,
29918,
726,
29897,
13,
4706,
736,
8908,
29918,
726,
13,
13,
1678,
14550,
13,
1678,
2346,
29918,
276,
1997,
603,
29918,
2914,
13,
1678,
14550,
13,
1678,
822,
2346,
29918,
276,
1997,
603,
29918,
2914,
29898,
1792,
333,
29892,
2793,
1125,
13,
4706,
3653,
29918,
978,
353,
525,
29961,
1972,
29918,
276,
1997,
603,
29918,
2914,
29962,
29915,
13,
4706,
4744,
29918,
29886,
29898,
9891,
29918,
978,
29892,
525,
1792,
333,
29892,
2793,
742,
1404,
333,
29892,
2793,
29897,
13,
4706,
736,
315,
3487,
6678,
29889,
1972,
29918,
2914,
29898,
1792,
333,
29892,
2793,
29892,
3414,
29918,
14380,
29922,
9207,
29889,
29911,
3289,
29968,
29918,
29968,
22255,
1839,
276,
1997,
603,
11287,
13,
13,
1678,
14550,
13,
1678,
6088,
278,
9657,
515,
2626,
8173,
13,
1678,
736,
8908,
851,
13,
13,
1678,
14550,
13,
1678,
822,
6088,
29918,
29881,
312,
29918,
3166,
29918,
14047,
29898,
2914,
29918,
29881,
312,
3790,
1118,
1373,
29918,
13400,
29922,
9207,
29889,
11282,
29918,
5265,
26349,
1125,
13,
4706,
396,
429,
29872,
9637,
3402,
13,
4706,
396,
10014,
11538,
29918,
19094,
1299,
353,
426,
13,
4706,
396,
268,
525,
2813,
2396,
525,
31531,
31613,
26254,
4882,
1012,
29876,
19660,
27041,
29918,
978,
7402,
29912,
816,
29880,
29918,
370,
1182,
3227,
7662,
29918,
333,
6525,
29905,
29876,
29912,
7892,
29918,
2230,
29913,
29871,
31302,
31398,
29905,
29876,
742,
13,
4706,
396,
268,
525,
8097,
29918,
15003,
2396,
22372,
15810,
2397,
1157,
2202,
29918,
20047,
1836,
426,
8097,
29918,
2230,
29913,
15974,
1990,
8345,
29918,
978,
6525,
29899,
19660,
344,
271,
29918,
1949,
6525,
30850,
31780,
30956,
26254,
18798,
1627,
1012,
29876,
742,
13,
4706,
396,
500,
13,
4706,
2322,
29918,
1767,
353,
6629,
13,
4706,
7353,
353,
426,
13,
9651,
525,
14605,
4174,
2396,
525,
31681,
742,
13,
9651,
525,
4519,
29902,
20566,
2396,
525,
229,
160,
143,
742,
13,
9651,
396,
525,
29949,
865,
29877,
292,
2396,
525,
243,
162,
151,
135,
742,
13,
9651,
525,
29949,
865,
29877,
292,
2396,
525,
243,
162,
143,
131,
742,
13,
9651,
396,
525,
8097,
29918,
15003,
29918,
26061,
2396,
525,
229,
146,
175,
29915,
13,
9651,
525,
8097,
29918,
15003,
29918,
26061,
2396,
525,
243,
162,
151,
187,
29915,
13,
4706,
500,
13,
4706,
4660,
353,
525,
29949,
865,
29877,
292,
29915,
13,
4706,
8908,
29918,
710,
353,
525,
856,
29905,
29876,
29915,
13,
4706,
8908,
29918,
710,
4619,
17861,
29889,
5659,
11538,
29918,
19094,
1299,
1839,
2813,
13359,
4830,
29898,
4882,
29922,
15581,
29961,
4882,
29962,
718,
4660,
29892,
3762,
29918,
978,
29922,
2914,
29918,
29881,
312,
29889,
657,
877,
27041,
29918,
978,
742,
2322,
29918,
1767,
511,
13,
462,
462,
462,
1678,
1364,
29880,
29918,
370,
1182,
29922,
2914,
29918,
29881,
312,
29889,
657,
877,
816,
29880,
29918,
370,
1182,
742,
2322,
29918,
1767,
511,
3414,
29918,
333,
29922,
2914,
29918,
29881,
312,
29889,
657,
877,
7662,
29918,
333,
742,
2322,
29918,
1767,
511,
13,
462,
462,
462,
1678,
9752,
29918,
2230,
29922,
2914,
29918,
29881,
312,
29889,
657,
877,
7892,
29918,
2230,
742,
2322,
29918,
1767,
876,
13,
4706,
565,
7431,
29898,
2914,
29918,
29881,
312,
1839,
8097,
29918,
15003,
11287,
529,
29871,
29896,
29901,
13,
9651,
736,
8908,
29918,
710,
13,
4706,
775,
353,
1121,
29918,
29881,
312,
1839,
8097,
29918,
15003,
2033,
14352,
29896,
1822,
657,
877,
401,
742,
2322,
29918,
1767,
29897,
13,
4706,
8676,
29918,
15581,
353,
1121,
29918,
29881,
312,
1839,
8097,
29918,
15003,
2033,
14352,
29896,
1822,
657,
877,
5729,
9446,
29918,
15581,
742,
2322,
29918,
1767,
29897,
13,
4706,
565,
8676,
29918,
15581,
1275,
525,
5729,
9446,
2396,
13,
9651,
4660,
353,
525,
14605,
4174,
29915,
565,
851,
29898,
401,
29897,
1275,
525,
29900,
29915,
1683,
525,
4519,
29902,
20566,
29915,
13,
13,
4706,
363,
474,
29892,
9637,
297,
26985,
29898,
2914,
29918,
29881,
312,
1839,
8097,
29918,
15003,
2033,
1125,
13,
9651,
8908,
29918,
710,
4619,
17861,
29889,
5659,
11538,
29918,
19094,
1299,
1839,
8097,
29918,
15003,
13359,
4830,
29898,
13,
18884,
953,
29877,
2397,
29922,
15581,
1839,
8097,
29918,
15003,
29918,
26061,
2033,
565,
851,
29898,
15003,
29889,
657,
877,
401,
742,
2322,
29918,
1767,
876,
2804,
525,
29900,
29915,
1683,
7353,
1839,
14605,
4174,
7464,
13,
18884,
1018,
29918,
20047,
29922,
29875,
29892,
429,
29872,
29918,
2230,
29922,
15003,
29889,
657,
877,
8097,
29918,
2230,
742,
2322,
29918,
1767,
511,
13,
18884,
770,
8345,
29918,
978,
29922,
15003,
29889,
657,
877,
695,
893,
1758,
742,
2322,
29918,
1767,
511,
13,
18884,
12949,
29918,
1949,
29922,
15003,
29889,
657,
877,
344,
271,
29918,
1949,
742,
2322,
29918,
1767,
511,
16705,
29922,
15003,
29889,
657,
877,
7645,
742,
2322,
29918,
1767,
876,
13,
4706,
736,
8908,
29918,
710,
14352,
29896,
29930,
3090,
29918,
13400,
17531,
13,
13,
1678,
14550,
13,
1678,
2346,
3414,
1121,
13,
1678,
14550,
13,
1678,
822,
2346,
29918,
2914,
29898,
1792,
333,
29892,
2793,
29892,
3414,
29918,
14380,
29922,
9207,
29889,
29911,
3289,
29968,
29918,
29968,
22255,
1839,
690,
7143,
2033,
1125,
13,
4706,
3653,
29918,
978,
353,
525,
29961,
1972,
29918,
2914,
29962,
29915,
13,
4706,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
1792,
333,
29892,
2793,
742,
1404,
333,
29892,
2793,
29897,
13,
4706,
5235,
353,
426,
13,
9651,
525,
4381,
2396,
525,
31423,
30417,
31213,
235,
178,
165,
30780,
30878,
31830,
30810,
31559,
30594,
31016,
233,
141,
165,
31780,
31450,
31358,
233,
140,
170,
30448,
31531,
31613,
30689,
31021,
742,
13,
4706,
500,
13,
13,
4706,
8908,
29918,
710,
353,
5235,
1839,
4381,
2033,
13,
13,
4706,
1121,
353,
286,
29883,
29889,
657,
29918,
1767,
29898,
1989,
29922,
7662,
29918,
14380,
718,
22868,
29915,
718,
1404,
333,
29892,
2322,
2433,
1495,
13,
4706,
565,
1121,
29901,
13,
9651,
8908,
29918,
710,
353,
315,
3487,
6678,
29889,
5510,
29918,
29881,
312,
29918,
3166,
29918,
14047,
29898,
2914,
29897,
13,
4706,
396,
6088,
278,
9657,
515,
2626,
8173,
13,
4706,
4744,
29918,
29886,
29898,
9891,
29918,
978,
29892,
525,
7662,
1121,
8908,
29918,
710,
29922,
742,
8908,
29918,
710,
29897,
13,
13,
4706,
396,
736,
11117,
14380,
2396,
525,
1217,
29918,
13506,
742,
525,
3445,
368,
29918,
710,
2396,
8908,
29918,
710,
29913,
13,
4706,
736,
8908,
29918,
710,
13,
13,
1678,
14550,
13,
1678,
383,
28700,
29918,
23827,
13,
1678,
14550,
13,
1678,
383,
28700,
29918,
23827,
353,
426,
13,
4706,
16321,
3198,
29918,
816,
29880,
2396,
1423,
29918,
27041,
29892,
13,
4706,
16321,
1202,
29918,
27041,
29918,
3888,
2396,
788,
29918,
27041,
29918,
3888,
29892,
13,
4706,
16321,
10118,
29918,
1202,
29918,
27041,
29918,
3888,
2396,
4889,
29918,
1202,
29918,
27041,
29918,
3888,
29892,
13,
4706,
16321,
5510,
29918,
15003,
2396,
6088,
29918,
15003,
29892,
13,
4706,
16321,
3874,
29890,
29918,
344,
271,
2396,
17229,
29918,
344,
271,
29892,
13,
4706,
16321,
1545,
1598,
29918,
459,
296,
603,
2396,
6623,
29918,
459,
296,
603,
29892,
13,
4706,
396,
16321,
26180,
8477,
2396,
817,
8477,
29892,
13,
4706,
16321,
1972,
29918,
2914,
2396,
2346,
29918,
2914,
29892,
13,
4706,
16321,
276,
1997,
603,
2396,
1855,
2230,
29892,
13,
4706,
16321,
1972,
29918,
276,
1997,
603,
29918,
2914,
2396,
2346,
29918,
276,
1997,
603,
29918,
2914,
29892,
13,
13,
1678,
500,
13,
13,
1678,
396,
11539,
29918,
344,
271,
29892,
736,
1067,
893,
1758,
29918,
29883,
5499,
593,
11759,
29898,
1990,
8345,
29918,
978,
29892,
14821,
511,
3861,
2023,
4514,
13,
1678,
822,
11539,
29918,
344,
271,
29898,
1982,
29918,
344,
271,
29918,
3137,
29892,
1404,
29918,
5527,
29918,
8977,
29892,
954,
29918,
29900,
29918,
1767,
2433,
31450,
31474,
29374,
13,
4706,
1067,
893,
1758,
29918,
29883,
5499,
593,
353,
5159,
13,
4706,
363,
4303,
333,
29892,
12949,
1949,
297,
4303,
29918,
344,
271,
29918,
3137,
29901,
13,
9651,
565,
938,
29898,
1982,
333,
29897,
5277,
29871,
29900,
29901,
13,
18884,
12949,
1949,
353,
525,
29900,
29915,
13,
13,
9651,
396,
1404,
29918,
5527,
29918,
8977,
1839,
1990,
8345,
2033,
10834,
10998,
1990,
8345,
29918,
978,
2396,
1990,
8345,
29918,
978,
5501,
1982,
333,
2396,
1982,
333,
29892,
525,
2084,
2396,
1990,
8345,
29918,
2084,
5501,
344,
271,
29918,
1958,
2396,
4907,
29913,
13,
9651,
396,
565,
4303,
333,
1275,
29871,
29900,
29901,
13,
9651,
770,
8345,
29918,
978,
29892,
14821,
353,
954,
29918,
29900,
29918,
1767,
29892,
525,
29900,
29915,
13,
9651,
363,
770,
8345,
297,
1404,
29918,
5527,
29918,
8977,
1839,
1990,
8345,
2033,
29901,
13,
18884,
396,
565,
938,
29898,
1982,
333,
29897,
1275,
29871,
29900,
29901,
770,
8345,
29918,
978,
353,
376,
31450,
31474,
1769,
14821,
353,
525,
29900,
2670,
2867,
13,
18884,
565,
938,
29898,
1982,
333,
29897,
2804,
29871,
29900,
322,
14821,
1275,
525,
29900,
29915,
322,
770,
8345,
1839,
1982,
333,
2033,
1275,
4303,
333,
29889,
6506,
877,
29899,
742,
6629,
1125,
13,
462,
1678,
770,
8345,
29918,
978,
353,
770,
8345,
1839,
1990,
8345,
29918,
978,
2033,
13,
462,
1678,
565,
12949,
1949,
1275,
525,
29900,
2396,
13,
462,
4706,
14821,
353,
525,
29900,
29915,
13,
462,
4706,
2867,
13,
462,
1678,
363,
758,
29918,
29900,
297,
6024,
742,
525,
29900,
742,
525,
29900,
29900,
742,
525,
29900,
29900,
29900,
2033,
29901,
13,
462,
4706,
14821,
353,
770,
8345,
1839,
344,
271,
29918,
1958,
13359,
657,
29898,
1457,
29918,
29900,
718,
12949,
1949,
29892,
14821,
29897,
13,
9651,
565,
4303,
333,
2804,
525,
29900,
29915,
322,
770,
8345,
29918,
978,
1275,
954,
29918,
29900,
29918,
1767,
29901,
13,
18884,
396,
1059,
29901,
4303,
333,
451,
1476,
13,
18884,
736,
5159,
13,
13,
9651,
1067,
893,
1758,
29918,
29883,
5499,
593,
29889,
4397,
3552,
1990,
8345,
29918,
978,
29892,
14821,
876,
13,
13,
4706,
736,
1067,
893,
1758,
29918,
29883,
5499,
593,
13,
13,
13,
12008,
13,
17833,
1371,
5235,
13,
12008,
13,
13,
13,
1990,
7338,
336,
3401,
29898,
3318,
1125,
13,
1678,
10944,
353,
11297,
29876,
29905,
29876,
229,
135,
188,
30598,
236,
157,
146,
31429,
232,
187,
177,
31931,
30689,
31021,
229,
135,
188,
30598,
29905,
29876,
29915,
13,
1678,
306,
353,
426,
13,
4706,
396,
525,
8477,
2396,
525,
232,
191,
189,
31268,
30383,
705,
13496,
29918,
29879,
404,
29918,
333,
30503,
2974,
333,
30392,
31383,
30698,
30688,
232,
186,
180,
233,
141,
150,
31473,
31024,
30683,
30210,
30214,
30413,
30392,
30858,
31507,
30755,
30806,
30210,
29939,
556,
1017,
12353,
30214,
31088,
231,
190,
151,
234,
190,
137,
236,
155,
136,
235,
178,
190,
31639,
30592,
29905,
29876,
30573,
30743,
236,
132,
194,
232,
136,
144,
333,
31369,
31944,
30214,
233,
141,
165,
31780,
31450,
31358,
31088,
232,
179,
192,
31180,
30505,
31026,
233,
141,
165,
30658,
30210,
29945,
29899,
29941,
29900,
30748,
236,
149,
162,
30594,
31016,
31559,
30728,
31302,
31398,
29905,
865,
2985,
29901,
991,
597,
3292,
29889,
510,
29914,
29939,
29885,
407,
29920,
29914,
335,
327,
324,
6357,
742,
13,
4706,
396,
525,
6406,
2132,
1061,
29918,
3888,
2396,
525,
30847,
30801,
30544,
31424,
31084,
31650,
31352,
232,
150,
144,
31370,
31352,
31908,
236,
169,
139,
30330,
31538,
30666,
30415,
31071,
31369,
31955,
30330,
30923,
30936,
31450,
31358,
31369,
31955,
856,
31184,
31184,
233,
148,
187,
30413,
234,
160,
131,
31584,
235,
135,
148,
30210,
31658,
31596,
31088,
31986,
31185,
31624,
30687,
31911,
31548,
30687,
30267,
29905,
29876,
23310,
29901,
260,
3864,
29918,
29900,
29896,
29896,
29896,
29900,
29896,
29900,
29896,
742,
13,
1678,
500,
13,
1678,
4045,
353,
6024,
31213,
31811,
29966,
30573,
30743,
30415,
231,
188,
163,
29958,
233,
141,
165,
31780,
31041,
31101,
30210,
31100,
30374,
31174,
30898,
30503,
232,
144,
182,
30594,
30768,
31043,
30214,
31088,
31811,
31624,
30687,
31911,
233,
159,
142,
31373,
232,
159,
139,
30267,
23310,
29901,
260,
3864,
29918,
29900,
29896,
29896,
29896,
29900,
29896,
29900,
29896,
742,
13,
795,
12801,
30573,
30743,
30415,
231,
188,
163,
29958,
31290,
31412,
31331,
29966,
30672,
31475,
30861,
31900,
236,
169,
137,
29958,
31694,
30525,
31908,
236,
169,
139,
30743,
233,
141,
165,
31780,
233,
191,
146,
31886,
30214,
31694,
30525,
234,
176,
151,
31810,
29901,
30724,
30505,
31273,
31810,
30275,
30267,
742,
13,
795,
525,
705,
13496,
29918,
29879,
404,
29918,
333,
30330,
2974,
333,
30392,
31383,
30698,
30688,
232,
186,
180,
31475,
233,
141,
150,
31473,
31024,
30683,
30210,
30214,
30413,
30392,
30858,
31507,
30755,
30806,
30210,
29939,
556,
1017,
14633,
30214,
232,
136,
186,
30988,
31024,
30683,
30525,
30545,
31088,
31811,
31084,
31650,
232,
187,
177,
31931,
30333,
233,
164,
166,
742,
13,
795,
525,
31084,
31650,
30748,
236,
157,
151,
31277,
30682,
30651,
30392,
236,
131,
154,
30850,
31391,
232,
146,
168,
30850,
31391,
30748,
30850,
31391,
30816,
31168,
31391,
30742,
235,
192,
169,
30214,
30267,
31608,
7671,
29936,
29871,
231,
187,
151,
31541,
31695,
30275,
30333,
31277,
30850,
30503,
31144,
30333,
31277,
30850,
30267,
742,
13,
795,
12801,
30573,
30743,
30415,
231,
188,
163,
29958,
31041,
31101,
233,
141,
165,
31780,
30667,
30687,
31290,
31412,
31026,
31193,
30214,
231,
187,
151,
31352,
31997,
235,
183,
188,
30210,
31520,
31358,
30330,
30413,
231,
188,
179,
232,
144,
153,
31101,
31463,
29991,
31557,
30573,
31838,
31466,
31565,
31429,
30210,
30980,
30415,
31302,
231,
193,
158,
31830,
231,
191,
191,
30539,
30606,
30210,
233,
141,
165,
31780,
30267,
742,
13,
795,
525,
31520,
31358,
30943,
31290,
31412,
232,
144,
138,
234,
189,
170,
30214,
233,
141,
165,
31780,
7662,
31195,
236,
156,
136,
31851,
31787,
31859,
30898,
31302,
232,
144,
138,
30592,
31542,
30267,
742,
13,
795,
525,
31520,
31358,
30943,
31084,
31650,
31201,
233,
161,
147,
31383,
30698,
30594,
31016,
30214,
31088,
31184,
232,
193,
136,
232,
138,
163,
234,
170,
149,
236,
149,
162,
30267,
742,
13,
795,
525,
30417,
231,
190,
131,
31882,
31474,
235,
170,
132,
31391,
30767,
30886,
235,
177,
177,
31088,
31331,
31624,
30687,
31911,
31908,
236,
169,
139,
30267,
742,
13,
795,
525,
31084,
31650,
30275,
30210,
29961,
30415,
31071,
234,
177,
131,
31685,
29962,
30392,
31144,
30333,
234,
177,
131,
31685,
30214,
31325,
30413,
30392,
30415,
31071,
30548,
30578,
30210,
31688,
233,
142,
191,
30267,
29915,
13,
795,
525,
30573,
236,
132,
194,
232,
136,
144,
233,
141,
150,
31473,
31024,
30683,
30210,
2974,
333,
31369,
31944,
30651,
31436,
233,
141,
165,
31780,
31450,
31358,
236,
132,
154,
233,
191,
146,
30214,
31088,
30505,
31026,
233,
141,
165,
30658,
29945,
29899,
29941,
29900,
30748,
236,
149,
162,
30594,
31016,
31559,
31302,
31398,
233,
141,
165,
31780,
31450,
31358,
30267,
742,
13,
795,
525,
30847,
30801,
30544,
31424,
31084,
31650,
31352,
232,
150,
144,
31370,
31352,
31908,
236,
169,
139,
30330,
31538,
30666,
30415,
31071,
31369,
31955,
30330,
30923,
30936,
31450,
31358,
31369,
31955,
856,
31184,
31184,
233,
148,
187,
30413,
234,
160,
131,
31584,
235,
135,
148,
30210,
31658,
31596,
31088,
31986,
31185,
31624,
30687,
31911,
30267,
742,
13,
795,
525,
31368,
31474,
30413,
30698,
233,
141,
141,
233,
141,
150,
31473,
31024,
30683,
30780,
30210,
15003,
30910,
30780,
29966,
30672,
31475,
30861,
31900,
236,
169,
137,
29958,
856,
31088,
31439,
232,
138,
137,
29966,
30573,
30743,
30415,
231,
188,
163,
29958,
742,
13,
795,
525,
30822,
31037,
31276,
31021,
31138,
30923,
30214,
31908,
236,
169,
139,
31658,
31596,
31391,
30767,
30886,
235,
177,
177,
31474,
235,
170,
132,
31088,
30910,
31545,
30780,
31624,
30687,
31911,
30210,
31935,
30689,
260,
3864,
29918,
29900,
29896,
29896,
29896,
29900,
29896,
29900,
29896,
742,
13,
795,
525,
233,
141,
150,
31473,
30210,
31474,
31579,
31238,
30392,
31174,
30448,
31222,
234,
190,
159,
234,
158,
148,
232,
147,
175,
31666,
30998,
31088,
31376,
30210,
30354,
30763,
31410,
31283,
31542,
30858,
30544,
30805,
30214,
30744,
30651,
31026,
232,
147,
178,
233,
141,
150,
31473,
235,
192,
178,
30631,
30210,
30594,
31974,
30880,
31429,
30437,
30417,
236,
166,
145,
236,
156,
172,
31302,
30858,
742,
13,
795,
525,
30785,
30406,
29961,
31538,
30666,
31084,
31650,
29962,
31383,
30698,
233,
190,
164,
31722,
29901,
29896,
29892,
29871,
30505,
30688,
31687,
31423,
30417,
236,
165,
135,
30495,
31780,
30956,
30210,
31531,
31613,
30557,
29936,
29871,
29906,
29892,
29871,
30688,
231,
188,
163,
232,
177,
167,
30769,
31026,
31182,
30210,
31531,
31613,
30557,
742,
13,
795,
525,
30688,
231,
188,
163,
232,
177,
167,
30354,
31180,
30330,
31026,
233,
141,
165,
30594,
31016,
31184,
30413,
30724,
31835,
31088,
31908,
236,
169,
139,
31624,
30687,
31911,
23310,
29901,
29873,
3864,
29918,
29900,
29896,
29896,
29896,
29900,
29896,
29900,
29896,
742,
13,
795,
525,
233,
141,
165,
31780,
31450,
31358,
30505,
31026,
233,
141,
165,
30658,
29945,
29899,
29941,
29900,
30748,
236,
149,
162,
30594,
31016,
31559,
30728,
31302,
31398,
31979,
30815,
30417,
31944,
742,
13,
795,
396,
525,
31092,
30557,
30805,
232,
179,
160,
31787,
31100,
30374,
29915,
13,
13,
795,
4514,
13,
13,
1678,
396,
9920,
29918,
8477,
353,
11297,
29876,
31084,
31650,
232,
187,
177,
31931,
30333,
233,
164,
166,
29901,
991,
597,
1526,
29889,
705,
861,
262,
29889,
24349,
29889,
510,
29914,
29879,
29914,
29896,
29943,
29963,
29911,
29606,
29928,
348,
29888,
865,
29893,
29924,
666,
29941,
8969,
557,
29909,
29915,
13,
1678,
9920,
29918,
8477,
353,
11297,
29876,
29966,
29874,
2822,
543,
991,
597,
1526,
29889,
705,
861,
262,
29889,
24349,
29889,
510,
29914,
29879,
29914,
29947,
29950,
29885,
29903,
29946,
29907,
29873,
29900,
29906,
29999,
29984,
29902,
29883,
22716,
29934,
29876,
29882,
29911,
29880,
29929,
29984,
1013,
29871,
229,
155,
161,
229,
155,
161,
31084,
31650,
232,
187,
177,
31931,
30333,
233,
164,
166,
1533,
29874,
16299,
13,
13,
1678,
396,
679,
29918,
8172,
29918,
3888,
13,
1678,
822,
679,
29918,
8172,
29918,
3888,
29898,
4716,
650,
10457,
29896,
1125,
13,
4706,
5235,
353,
1051,
29898,
18126,
3401,
29889,
29902,
29889,
5975,
3101,
718,
7338,
336,
3401,
29889,
720,
414,
13,
4706,
736,
7338,
336,
3401,
29889,
13506,
718,
4036,
29889,
16957,
29898,
3888,
29897,
718,
7338,
336,
3401,
29889,
9006,
29918,
8477,
13,
13,
13,
12008,
13,
5510,
10191,
515,
591,
13496,
4386,
29936,
11539,
565,
338,
9920,
322,
6222,
278,
29871,
9920,
29952,
29879,
740,
13,
2457,
2933,
13,
12008,
13,
29992,
13239,
29889,
12510,
29918,
11739,
13,
1753,
4386,
29918,
7645,
29898,
1792,
333,
29892,
2793,
29892,
590,
29918,
333,
29892,
11247,
29907,
1964,
29922,
8824,
1125,
13,
1678,
396,
6782,
2793,
515,
7023,
304,
851,
13,
1678,
286,
29918,
3051,
353,
2793,
13,
1678,
565,
338,
8758,
29898,
3051,
29892,
6262,
1125,
13,
4706,
286,
29918,
3051,
353,
2793,
29889,
13808,
29898,
22331,
2433,
9420,
29899,
29947,
1495,
13,
1678,
3653,
29918,
978,
353,
16321,
8411,
29918,
7645,
29915,
13,
1678,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
1792,
333,
29922,
742,
1404,
333,
29892,
525,
3051,
29922,
742,
2793,
29897,
13,
13,
1678,
14550,
13,
1678,
1423,
565,
338,
1243,
29892,
2313,
538,
1243,
7353,
13,
1678,
14550,
13,
1678,
565,
851,
29898,
29885,
29918,
3051,
7503,
29946,
1822,
5451,
580,
29961,
29900,
14664,
13609,
580,
297,
11117,
1688,
742,
525,
30728,
31851,
742,
525,
31851,
31787,
29915,
6177,
13,
4706,
286,
29918,
3051,
353,
286,
29918,
3051,
7503,
29946,
1822,
6506,
877,
1688,
742,
525,
2824,
6506,
877,
30728,
31851,
742,
525,
2824,
6506,
877,
31851,
31787,
742,
27255,
17501,
13,
9651,
286,
29918,
3051,
29961,
29946,
17531,
13,
1678,
396,
1683,
29901,
13,
1678,
396,
268,
396,
2030,
1873,
19546,
740,
13,
1678,
396,
268,
736,
2030,
29918,
3259,
29918,
296,
11115,
29898,
1792,
333,
29892,
2793,
29892,
590,
29918,
333,
29897,
13,
13,
1678,
396,
2793,
338,
5642,
13,
1678,
2793,
353,
286,
29918,
3051,
13,
1678,
565,
451,
2793,
29901,
13,
4706,
396,
736,
679,
29918,
3445,
368,
29918,
7645,
29898,
710,
29918,
3888,
29922,
3051,
29897,
13,
4706,
8908,
29918,
726,
353,
315,
3487,
6678,
29889,
657,
1417,
29898,
29896,
29897,
718,
11297,
29876,
29915,
13,
4706,
736,
8908,
29918,
726,
718,
7338,
336,
3401,
29889,
657,
29918,
8172,
29918,
3888,
580,
13,
13,
1678,
396,
6088,
29892,
565,
29871,
1899,
13,
1678,
9920,
29918,
1457,
29918,
15581,
353,
426,
13,
4706,
396,
525,
335,
327,
324,
6357,
2396,
11117,
30672,
31475,
30861,
31900,
236,
169,
137,
742,
525,
30805,
31333,
31780,
16675,
13,
4706,
396,
3855,
29875,
574,
6951,
29877,
3414,
13,
4706,
16321,
3874,
29890,
29918,
344,
271,
2396,
11117,
233,
141,
165,
31780,
742,
525,
30592,
30325,
236,
165,
135,
234,
189,
169,
742,
525,
236,
165,
135,
234,
189,
169,
31780,
30956,
742,
525,
233,
141,
165,
31780,
30956,
742,
525,
233,
141,
165,
232,
160,
147,
742,
16321,
233,
141,
165,
232,
160,
147,
742,
525,
233,
141,
165,
30956,
30669,
742,
525,
3874,
29890,
29918,
344,
271,
742,
16321,
233,
141,
165,
31780,
742,
525,
29939,
29920,
742,
16321,
29939,
29920,
16675,
13,
4706,
396,
1855,
2230,
1395,
29890,
12949,
13,
4706,
16321,
276,
1997,
603,
2396,
11117,
233,
144,
164,
233,
191,
146,
742,
525,
31195,
30594,
236,
165,
135,
30495,
742,
525,
232,
144,
182,
30594,
236,
165,
135,
235,
177,
165,
742,
525,
31195,
30594,
236,
165,
135,
235,
177,
165,
742,
525,
232,
144,
182,
30594,
236,
165,
135,
30495,
742,
525,
29606,
742,
525,
893,
2941,
742,
525,
1315,
2941,
742,
525,
276,
1997,
603,
16675,
13,
4706,
16321,
3198,
29918,
816,
29880,
2396,
11117,
31213,
235,
178,
165,
742,
16321,
31213,
235,
178,
165,
742,
525,
18904,
742,
16321,
18904,
742,
525,
305,
1165,
348,
742,
16321,
31213,
235,
178,
165,
30415,
31071,
742,
525,
31213,
235,
178,
165,
30415,
31071,
16675,
13,
4706,
396,
6088,
9637,
13,
4706,
16321,
5510,
29918,
15003,
2396,
11117,
29926,
29916,
742,
16321,
29926,
29916,
742,
525,
31201,
233,
161,
147,
742,
16321,
31201,
233,
161,
147,
742,
525,
705,
305,
1446,
404,
29918,
333,
29922,
742,
525,
657,
16675,
13,
4706,
396,
4660,
2346,
13,
4706,
16321,
1202,
29918,
27041,
29918,
3888,
2396,
11117,
29937,
31538,
30666,
30415,
31071,
742,
525,
31538,
30666,
30415,
31071,
742,
525,
29873,
29926,
742,
16321,
29873,
29926,
742,
16321,
31538,
30666,
742,
525,
31538,
30666,
16675,
13,
4706,
396,
4889,
788,
3762,
13,
4706,
16321,
10118,
29918,
1202,
29918,
27041,
29918,
3888,
2396,
11117,
232,
191,
189,
31072,
31538,
30666,
742,
525,
232,
191,
189,
31072,
31538,
30666,
30415,
31071,
742,
525,
232,
191,
189,
31072,
31538,
30666,
30415,
31071,
30689,
31021,
742,
525,
29939,
2065,
29926,
742,
525,
29939,
2065,
29926,
14633,
16675,
13,
4706,
396,
16321,
26180,
8477,
2396,
10998,
232,
187,
177,
31931,
742,
525,
8477,
742,
525,
29890,
29920,
742,
525,
232,
187,
177,
31931,
30689,
31021,
742,
525,
31302,
30858,
16675,
13,
4706,
396,
4113,
9920,
13,
4706,
16321,
29887,
996,
29916,
262,
2396,
24335,
13,
4706,
396,
6623,
1015,
296,
603,
13,
4706,
16321,
1545,
1598,
29918,
459,
296,
603,
2396,
11117,
31273,
31264,
233,
141,
165,
31780,
30594,
31016,
742,
525,
29916,
29887,
29939,
22381,
29926,
742,
525,
31273,
31264,
31026,
233,
141,
165,
30594,
31016,
742,
525,
29916,
29887,
29895,
29939,
29879,
29926,
16675,
13,
4706,
396,
2346,
23986,
1121,
13,
4706,
16321,
1972,
29918,
2914,
2396,
11117,
31213,
235,
178,
165,
31320,
30801,
742,
525,
31320,
30801,
742,
525,
29926,
29887,
742,
525,
18904,
29926,
29887,
742,
525,
233,
141,
165,
31780,
31320,
30801,
742,
525,
29939,
29920,
29926,
29887,
742,
525,
31213,
235,
178,
165,
233,
141,
165,
31780,
31320,
30801,
742,
525,
31213,
235,
178,
165,
233,
141,
165,
31780,
16675,
13,
4706,
396,
2346,
1855,
2230,
1121,
13,
4706,
16321,
1972,
29918,
276,
1997,
603,
29918,
2914,
2396,
11117,
31213,
235,
178,
165,
233,
144,
164,
233,
191,
146,
31320,
30801,
742,
525,
233,
144,
164,
233,
191,
146,
31320,
30801,
742,
525,
29926,
14042,
29887,
742,
525,
18904,
29926,
14042,
29887,
742,
525,
29606,
29939,
29920,
29926,
29887,
742,
525,
29606,
31320,
30801,
742,
525,
31195,
30594,
236,
165,
135,
30495,
31320,
30801,
742,
525,
31195,
30594,
236,
165,
135,
235,
177,
165,
31320,
30801,
10827,
13,
13,
1678,
500,
13,
1678,
396,
15998,
6219,
29918,
305,
304,
9654,
13,
1678,
1424,
4378,
29918,
3051,
353,
337,
29889,
1491,
29898,
29878,
29915,
15625,
30419,
30409,
29897,
30214,
31608,
30267,
29936,
2053,
5586,
742,
525,
13420,
2793,
29889,
6506,
29898,
29884,
29915,
242,
191,
134,
742,
27255,
13,
462,
3986,
869,
6506,
29898,
29884,
29915,
29937,
742,
27255,
13,
462,
3986,
869,
6506,
29898,
29884,
29915,
31583,
742,
17411,
2824,
6506,
29898,
29884,
29915,
31779,
742,
17411,
2824,
6506,
877,
29899,
448,
742,
29871,
525,
489,
1495,
13,
462,
3986,
869,
6506,
877,
242,
191,
160,
742,
525,
29922,
1495,
13,
462,
3986,
869,
6506,
28909,
29876,
742,
17861,
29889,
11889,
29918,
29907,
5773,
29918,
5550,
5850,
3210,
29897,
13,
462,
3986,
1723,
13,
1678,
396,
628,
599,
320,
29876,
320,
29878,
322,
9654,
13,
1678,
1424,
4378,
29918,
3051,
353,
337,
29889,
1491,
29898,
29878,
12764,
29879,
29974,
742,
17861,
29889,
11889,
29918,
29907,
5773,
29918,
5550,
5850,
3210,
29892,
1424,
4378,
29918,
3051,
29889,
17010,
3101,
13,
13,
1678,
2793,
353,
1424,
4378,
29918,
3051,
13,
1678,
396,
16833,
607,
2924,
9920,
515,
2380,
29871,
29900,
13,
1678,
9920,
29918,
3137,
353,
2793,
29889,
5451,
29898,
9207,
29889,
11889,
29918,
29907,
5773,
29918,
5550,
5850,
3210,
29897,
13,
1678,
9920,
29918,
14380,
353,
6629,
13,
1678,
363,
758,
29918,
15581,
297,
9920,
29918,
1457,
29918,
15581,
29889,
8149,
7295,
13,
4706,
565,
9920,
29918,
3137,
29961,
29900,
1822,
13609,
2141,
6506,
14237,
742,
525,
2824,
17010,
580,
297,
9920,
29918,
1457,
29918,
15581,
29961,
1457,
29918,
15581,
5387,
13,
9651,
9920,
29918,
14380,
353,
758,
29918,
15581,
13,
9651,
2867,
13,
1678,
565,
451,
9920,
29918,
14380,
29901,
13,
4706,
396,
6084,
6088,
9637,
13,
4706,
565,
7431,
29898,
3051,
29897,
1405,
29871,
29896,
29900,
29900,
322,
2793,
29889,
2886,
877,
705,
13496,
1660,
1799,
29918,
1367,
1495,
6736,
29871,
29900,
29901,
29871,
396,
322,
2793,
29889,
2886,
877,
18603,
1367,
1495,
6736,
29871,
29900,
29901,
13,
9651,
396,
6088,
9637,
13,
9651,
9920,
29918,
14380,
353,
16321,
5510,
29918,
15003,
29915,
13,
4706,
1683,
29901,
13,
9651,
396,
2793,
338,
451,
9920,
13,
9651,
694,
29918,
4352,
29918,
9006,
29918,
3445,
368,
353,
6024,
31423,
30417,
232,
143,
188,
31361,
30780,
31084,
31650,
856,
30413,
31043,
30397,
31751,
30742,
31370,
231,
190,
131,
31882,
742,
13,
462,
462,
29871,
525,
31423,
30417,
232,
143,
188,
31361,
30780,
31084,
31650,
856,
31908,
236,
169,
139,
31658,
31596,
31088,
31986,
31185,
31624,
30687,
31911,
2033,
13,
9651,
8908,
29918,
726,
353,
315,
3487,
6678,
29889,
657,
1417,
29898,
29896,
29897,
334,
29871,
29941,
718,
4036,
29889,
16957,
29898,
1217,
29918,
4352,
29918,
9006,
29918,
3445,
368,
29897,
718,
11297,
29876,
29915,
13,
9651,
736,
8908,
29918,
726,
718,
7338,
336,
3401,
29889,
657,
29918,
8172,
29918,
3888,
580,
13,
13,
1678,
396,
17945,
591,
13496,
1660,
1799,
29918,
1367,
322,
26996,
5348,
1367,
304,
2023,
29936,
705,
13496,
1660,
1799,
29918,
1367,
29936,
26996,
5348,
1367,
13,
1678,
396,
565,
7431,
29898,
9006,
29918,
3137,
29897,
1405,
29871,
29906,
322,
9920,
29918,
3137,
14352,
29896,
1822,
2886,
877,
705,
13496,
1660,
1799,
29918,
1367,
1495,
6736,
29871,
29900,
322,
9920,
29918,
3137,
14352,
29906,
1822,
2886,
877,
18603,
1367,
1495,
6736,
29871,
29900,
29901,
13,
1678,
396,
268,
9920,
29918,
3137,
14352,
29896,
1402,
9920,
29918,
3137,
14352,
29906,
29962,
353,
9920,
29918,
3137,
14352,
29906,
1402,
9920,
29918,
3137,
14352,
29896,
29962,
13,
1678,
396,
268,
2793,
353,
17861,
29889,
11889,
29918,
29907,
5773,
29918,
5550,
5850,
3210,
29889,
7122,
29898,
9006,
29918,
3137,
29897,
13,
13,
1678,
396,
1596,
877,
9006,
29918,
3137,
29922,
742,
9920,
29918,
3137,
29897,
13,
1678,
396,
2793,
338,
9920,
769,
4078,
9920,
1480,
13,
1678,
263,
29918,
9006,
29918,
1188,
353,
3667,
29879,
29889,
657,
29918,
1256,
580,
718,
525,
29989,
3166,
29918,
1792,
2433,
718,
1404,
333,
718,
525,
29989,
9006,
29918,
14380,
2433,
718,
9920,
29918,
14380,
718,
525,
29989,
3051,
2433,
718,
2793,
718,
11297,
29876,
29915,
13,
1678,
4744,
29918,
29886,
877,
9891,
29918,
978,
29922,
742,
3653,
29918,
978,
29892,
525,
9006,
29918,
14380,
29922,
742,
9920,
29918,
14380,
29892,
525,
29874,
29918,
9006,
29918,
1188,
29922,
742,
263,
29918,
9006,
29918,
1188,
29897,
13,
13,
1678,
396,
2793,
338,
9920,
769,
429,
29872,
9920,
740,
13,
1678,
8908,
29918,
726,
353,
315,
3487,
6678,
29889,
29943,
28700,
29918,
23827,
29961,
9006,
29918,
14380,
850,
1792,
333,
29892,
2793,
29897,
13,
13,
1678,
396,
736,
8908,
1426,
13,
1678,
565,
8908,
29918,
726,
29889,
2886,
877,
31531,
31613,
1495,
529,
29871,
29900,
29901,
13,
4706,
8908,
29918,
726,
353,
8908,
29918,
726,
718,
7338,
336,
3401,
29889,
657,
29918,
8172,
29918,
3888,
580,
565,
9920,
29918,
14380,
2804,
16321,
5510,
29918,
15003,
29915,
1683,
8908,
29918,
726,
13,
1678,
736,
8908,
29918,
726,
13,
13,
13,
12008,
13,
1688,
13,
12008,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
11247,
29907,
1964,
353,
3667,
29879,
29889,
16652,
1964,
13,
1678,
396,
503,
29880,
29918,
3137,
353,
518,
13,
1678,
396,
268,
396,
16321,
233,
141,
165,
31780,
29936,
289,
29926,
9161,
29936,
29871,
29941,
29906,
29941,
29936,
29947,
29896,
29936,
29871,
29941,
29906,
29946,
29936,
29947,
29900,
29936,
29871,
270,
29941,
29929,
29941,
29953,
29906,
29947,
29929,
328,
18725,
29953,
29883,
29941,
29947,
29955,
29946,
29874,
29906,
29945,
29955,
29929,
29900,
29945,
29947,
562,
29953,
29945,
29896,
29989,
29896,
29945,
29953,
29941,
29900,
29906,
29947,
29953,
29929,
29945,
29989,
29896,
29945,
29953,
29941,
29900,
29906,
29947,
29953,
29929,
29900,
29936,
29871,
29896,
29906,
10702,
29896,
29874,
29900,
774,
2585,
29946,
29888,
29946,
29906,
29953,
29900,
29872,
29946,
29881,
29906,
29945,
29906,
29955,
29896,
29896,
29900,
29874,
29906,
29929,
29945,
29929,
29946,
29929,
29896,
29883,
29906,
29946,
29872,
617,
29888,
29906,
29947,
29955,
29881,
29955,
29945,
742,
13,
1678,
396,
268,
396,
16321,
233,
141,
165,
31780,
29936,
289,
5838,
29883,
29936,
29871,
29941,
29906,
29941,
29936,
29947,
29896,
29936,
29871,
29941,
29906,
29946,
29936,
29947,
29900,
29936,
29871,
270,
29941,
29929,
29941,
29953,
29906,
29947,
29929,
328,
18725,
29953,
29883,
29941,
29947,
29955,
29946,
29874,
29906,
29945,
29955,
29929,
29900,
29945,
29947,
562,
29953,
29945,
29896,
29989,
29896,
29945,
29953,
29941,
29900,
29906,
29947,
29953,
29929,
29945,
29989,
29896,
29945,
29953,
29941,
29900,
29906,
29947,
29953,
29929,
29900,
29936,
29871,
29896,
29906,
10702,
29896,
29874,
29900,
774,
2585,
29946,
29888,
29946,
29906,
29953,
29900,
29872,
29946,
29881,
29906,
29945,
29906,
29955,
29896,
29896,
29900,
29874,
29906,
29929,
29945,
29929,
29946,
29929,
29896,
29883,
29906,
29946,
29872,
617,
29888,
29906,
29947,
29955,
29881,
29955,
29945,
742,
13,
1678,
396,
268,
396,
16321,
233,
141,
165,
31780,
29936,
282,
2120,
29936,
29871,
29941,
29906,
29941,
29936,
29947,
29896,
29936,
29871,
29941,
29906,
29946,
29936,
29947,
29900,
29936,
29871,
270,
29941,
29929,
29941,
29953,
29906,
29947,
29929,
328,
18725,
29953,
29883,
29941,
29947,
29955,
29946,
29874,
29906,
29945,
29955,
29929,
29900,
29945,
29947,
562,
29953,
29945,
29896,
29989,
29896,
29945,
29953,
29941,
29900,
29906,
29947,
29953,
29929,
29945,
29989,
29896,
29945,
29953,
29941,
29900,
29906,
29947,
29953,
29929,
29900,
29936,
29871,
29896,
29906,
10702,
29896,
29874,
29900,
774,
2585,
29946,
29888,
29946,
29906,
29953,
29900,
29872,
29946,
29881,
29906,
29945,
29906,
29955,
29896,
29896,
29900,
29874,
29906,
29929,
29945,
29929,
29946,
29929,
29896,
29883,
29906,
29946,
29872,
617,
29888,
29906,
29947,
29955,
29881,
29955,
29945,
742,
13,
1678,
396,
268,
396,
29871,
525,
31213,
235,
178,
165,
31608,
1327,
14047,
742,
13,
1678,
396,
13,
1678,
396,
268,
396,
525,
31538,
30666,
31608,
29882,
29890,
1682,
29885,
29936,
591,
13496,
1660,
1799,
29918,
1367,
29922,
29945,
29883,
29946,
29890,
29941,
29941,
29890,
29941,
29946,
29874,
29906,
29900,
29872,
29900,
29872,
29900,
1725,
29874,
29929,
29947,
29953,
29946,
29874,
29906,
29945,
29941,
6448,
29941,
29945,
29955,
29945,
29881,
6854,
29945,
29946,
29945,
29953,
29947,
29929,
346,
29929,
29883,
29900,
29872,
26996,
5348,
1367,
29922,
29890,
29929,
13801,
29955,
6448,
29947,
29953,
29881,
29906,
12613,
29929,
29896,
29890,
29906,
29941,
29881,
29955,
29941,
29946,
29955,
29872,
29900,
3905,
29929,
29929,
29945,
29872,
29989,
29896,
29945,
29953,
29945,
29946,
29946,
29941,
29946,
29955,
29906,
29989,
29896,
29945,
29953,
29945,
29946,
29946,
29941,
29946,
29955,
29900,
29915,
13,
1678,
396,
13,
1678,
396,
268,
396,
525,
242,
191,
134,
29916,
29887,
29939,
22381,
29926,
29892,
289,
29926,
9161,
29892,
29906,
29896,
29901,
29906,
29906,
29915,
13,
1678,
396,
268,
525,
29606,
29892,
289,
29926,
9161,
29892,
29871,
29941,
29906,
29941,
29892,
29871,
29955,
29892,
259,
29941,
29906,
29946,
259,
29955,
29955,
525,
718,
320,
13,
1678,
396,
268,
396,
525,
29873,
29926,
29892,
289,
29926,
9161,
525,
718,
320,
13,
1678,
396,
268,
525,
705,
13496,
1660,
1799,
29918,
1367,
29922,
29906,
29953,
29946,
29946,
29941,
29888,
29955,
1289,
29883,
29946,
29947,
29900,
29906,
29955,
29906,
29929,
29955,
346,
29900,
29872,
29946,
29941,
29941,
29900,
29941,
29900,
29947,
29881,
29896,
29955,
29888,
29946,
29890,
29955,
29881,
29953,
29906,
29946,
3470,
29955,
29890,
29946,
29896,
29953,
525,
718,
320,
13,
1678,
396,
268,
525,
18603,
1367,
29922,
29890,
29929,
13801,
29955,
6448,
29947,
29953,
29881,
29906,
12613,
29929,
29896,
29890,
29906,
29941,
29881,
29955,
29941,
29946,
29955,
29872,
29900,
3905,
29929,
29929,
29945,
29872,
29989,
29896,
29945,
29955,
29900,
29906,
29941,
29955,
29947,
29900,
29947,
29989,
29896,
29945,
29955,
29900,
29906,
29941,
29955,
29947,
29900,
29896,
259,
525,
718,
320,
13,
1678,
396,
268,
525,
489,
260,
29922,
29900,
29955,
29901,
29900,
29900,
29889,
29871,
30606,
31037,
29922,
29880,
29916,
29920,
29936,
29871,
31482,
30592,
29922,
30592,
29915,
13,
1678,
396,
13,
1678,
396,
268,
396,
525,
18904,
29939,
705,
29926,
29887,
5501,
13,
1678,
396,
268,
4514,
13,
13,
1678,
363,
474,
297,
3464,
29898,
29896,
29892,
29871,
29906,
1125,
13,
4706,
396,
503,
29880,
353,
4036,
29889,
16957,
18959,
233,
144,
164,
233,
191,
146,
742,
525,
31195,
30594,
236,
165,
135,
30495,
742,
525,
232,
144,
182,
30594,
236,
165,
135,
235,
177,
165,
742,
525,
31195,
30594,
236,
165,
135,
235,
177,
165,
742,
525,
232,
144,
182,
30594,
236,
165,
135,
30495,
742,
525,
29606,
742,
525,
893,
2941,
742,
525,
1315,
2941,
742,
525,
276,
1997,
603,
742,
13,
4706,
396,
462,
268,
525,
233,
141,
165,
31780,
742,
525,
233,
141,
165,
31780,
30956,
742,
525,
233,
141,
165,
232,
160,
147,
742,
16321,
233,
141,
165,
232,
160,
147,
742,
525,
233,
141,
165,
30956,
30669,
742,
525,
3874,
29890,
29918,
344,
271,
742,
16321,
233,
141,
165,
31780,
742,
525,
29939,
29920,
742,
16321,
29939,
29920,
11287,
718,
320,
13,
4706,
396,
268,
525,
289,
29926,
9161,
525,
718,
320,
13,
4706,
396,
268,
525,
525,
718,
4036,
29889,
16957,
18959,
29941,
29906,
29941,
13420,
525,
29941,
29906,
29946,
525,
2314,
718,
4036,
29889,
16957,
4197,
710,
7373,
29897,
363,
903,
297,
3464,
29898,
29896,
29892,
29871,
29896,
29900,
29900,
29897,
2314,
718,
320,
13,
4706,
396,
268,
525,
525,
718,
4036,
29889,
16957,
18959,
29941,
29906,
29941,
13420,
525,
29941,
29906,
29946,
525,
2314,
718,
4036,
29889,
16957,
4197,
710,
7373,
29897,
363,
903,
297,
3464,
29898,
29896,
29892,
29871,
29896,
29900,
29900,
29897,
2314,
718,
320,
13,
4706,
396,
268,
525,
591,
13496,
1660,
1799,
29918,
1367,
29922,
893,
333,
18717,
8172,
29889,
16957,
4197,
710,
7373,
29897,
363,
903,
297,
3464,
29898,
29896,
29896,
29896,
29892,
29871,
29929,
29929,
29929,
29897,
2314,
718,
320,
13,
4706,
396,
268,
525,
26996,
5348,
1367,
29922,
643,
333,
29989,
29896,
29906,
29941,
29896,
29906,
29941,
29906,
29941,
29906,
29896,
29989,
29896,
29941,
29906,
29896,
29906,
29941,
29946,
29915,
718,
4036,
29889,
16957,
4197,
710,
7373,
29897,
363,
903,
297,
3464,
29898,
29896,
29896,
29896,
29892,
29871,
29929,
29929,
29929,
29897,
2314,
718,
320,
13,
4706,
396,
268,
525,
1192,
525,
718,
320,
13,
4706,
396,
268,
4036,
29889,
16957,
18959,
31026,
233,
141,
165,
30594,
31016,
742,
525,
30594,
31016,
742,
525,
29873,
742,
525,
29911,
742,
525,
2230,
2033,
7240,
4907,
320,
13,
4706,
396,
308,
525,
2433,
29974,
710,
29898,
8172,
29889,
9502,
524,
29898,
29953,
29892,
29906,
29941,
876,
29974,
2396,
18717,
710,
29898,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29945,
29929,
876,
29974,
2396,
18717,
710,
29898,
8172,
29889,
9502,
524,
29898,
29900,
29892,
29945,
29929,
876,
23097,
525,
718,
320,
13,
4706,
396,
268,
4036,
29889,
16957,
18959,
236,
165,
135,
234,
189,
169,
31382,
30607,
742,
525,
31482,
30592,
742,
525,
232,
150,
173,
30408,
742,
525,
31382,
30607,
2033,
7240,
29915,
2433,
29974,
8172,
29889,
16957,
18959,
1457,
742,
525,
30592,
742,
525,
30592,
30408,
3788,
27765,
742,
525,
31482,
742,
525,
31482,
30408,
11287,
718,
525,
525,
718,
320,
13,
4706,
396,
268,
4036,
29889,
16957,
18959,
30606,
31037,
742,
525,
30539,
231,
191,
154,
30850,
2033,
7240,
29915,
2433,
29974,
8172,
29889,
16957,
18959,
30672,
31475,
30861,
31900,
236,
169,
137,
742,
525,
5523,
29880,
742,
525,
29893,
29939,
1372,
29887,
3788,
30805,
31333,
31780,
742,
525,
29880,
29916,
29920,
11287,
718,
525,
525,
13,
13,
4706,
503,
29880,
353,
525,
29606,
29936,
29890,
29926,
9161,
29936,
29941,
29906,
29941,
29936,
29896,
29871,
29941,
29906,
29941,
29871,
29900,
29871,
1919,
29892,
7859,
29915,
320,
13,
632,
525,
18603,
1367,
29922,
29881,
29941,
29929,
29941,
29953,
29906,
29947,
29929,
328,
18725,
29953,
29883,
29941,
29947,
29955,
29946,
29874,
29906,
29945,
29955,
29929,
29900,
29945,
29947,
562,
29953,
29945,
29896,
29989,
29896,
29945,
29955,
29900,
29953,
29896,
29906,
29953,
29929,
29946,
29989,
29896,
29945,
29955,
29900,
29953,
29896,
29906,
29953,
29929,
29906,
525,
320,
13,
632,
525,
705,
13496,
1660,
1799,
29918,
1367,
29922,
29945,
1389,
29953,
29888,
29906,
29896,
29881,
311,
29941,
29945,
29955,
29906,
29906,
29883,
29929,
29906,
29872,
29946,
29945,
29929,
29945,
29890,
29906,
29896,
29900,
29900,
29890,
29953,
29888,
1389,
29947,
29888,
29900,
29947,
29888,
29945,
29900,
328,
1725,
29953,
10702,
29941,
29936,
29915,
320,
13,
632,
525,
1192,
29871,
30594,
31016,
29922,
29896,
29906,
29901,
29900,
29900,
29936,
31382,
30607,
29922,
30592,
29936,
30606,
31037,
29922,
30672,
31475,
30861,
31900,
236,
169,
137,
29915,
13,
4706,
503,
29880,
353,
525,
233,
141,
165,
31780,
29936,
11078,
29887,
3594,
29936,
29896,
29906,
29941,
29946,
29936,
29941,
29945,
29945,
29936,
29915,
320,
13,
632,
525,
705,
13496,
1660,
1799,
29918,
1367,
29922,
29953,
29955,
29906,
29883,
29945,
29946,
29945,
29929,
328,
29890,
29955,
29883,
29906,
29900,
29888,
29941,
29874,
29941,
29888,
29953,
29946,
29872,
29953,
29955,
29955,
2176,
2176,
774,
562,
29906,
29946,
29945,
29945,
29890,
29946,
29929,
29883,
29941,
29946,
29872,
29906,
29947,
29900,
29936,
18603,
1367,
29922,
29890,
29929,
13801,
29955,
6448,
29947,
29953,
29881,
29906,
12613,
29929,
29896,
29890,
29906,
29941,
29881,
29955,
29941,
29946,
29955,
29872,
29900,
3905,
29929,
29929,
29945,
29872,
29989,
29896,
29945,
29955,
29900,
29953,
29941,
29906,
29953,
29953,
29896,
29989,
29896,
29945,
29955,
29900,
29953,
29941,
29896,
29941,
29955,
29896,
29915,
320,
13,
632,
21921,
30003,
29899,
29936,
30594,
31016,
29922,
29953,
29901,
29900,
29900,
29936,
31382,
30607,
29922,
30592,
29936,
30606,
31037,
29922,
30672,
31475,
30861,
31900,
236,
169,
137,
29915,
13,
13,
4706,
503,
29880,
353,
525,
233,
144,
164,
233,
191,
146,
29892,
289,
29926,
9161,
29892,
29900,
29892,
29900,
591,
13496,
1660,
1799,
29918,
1367,
29922,
29896,
29946,
29874,
29953,
29929,
29929,
29929,
29906,
1113,
29953,
2142,
29929,
29874,
29906,
29872,
29896,
29896,
29890,
29946,
29883,
29941,
2291,
29906,
29955,
29900,
29874,
29955,
29945,
29906,
29874,
29953,
29881,
29906,
29947,
29874,
29946,
29929,
13801,
29896,
29896,
29953,
29906,
29955,
29906,
29915,
13,
4706,
503,
29880,
353,
16321,
233,
141,
165,
31780,
29936,
289,
29926,
9161,
29936,
29871,
29900,
29936,
29871,
29900,
29946,
29953,
29936,
29871,
29900,
29936,
29871,
29900,
29946,
29945,
29936,
525,
320,
13,
632,
525,
705,
13496,
1660,
1799,
29918,
1367,
29922,
29881,
29906,
29945,
29896,
29888,
346,
29900,
1388,
29874,
29955,
29906,
29945,
29896,
29945,
29874,
29896,
29881,
29955,
29896,
29872,
1389,
29890,
29945,
29890,
29945,
29945,
311,
12328,
29896,
29883,
2291,
29872,
29929,
29881,
29896,
29874,
29941,
29906,
29881,
29955,
29906,
29896,
29936,
525,
320,
13,
632,
525,
18603,
1367,
29922,
29881,
29941,
29929,
29941,
29953,
29906,
29947,
29929,
328,
18725,
29953,
29883,
29941,
29947,
29955,
29946,
29874,
29906,
29945,
29955,
29929,
29900,
29945,
29947,
562,
29953,
29945,
29896,
29989,
29896,
29945,
29955,
29900,
29955,
29900,
29955,
29929,
29941,
29947,
29989,
29896,
29945,
29955,
29900,
29955,
29900,
29955,
29929,
29906,
29955,
525,
320,
13,
632,
525,
489,
260,
29922,
29896,
29955,
29901,
29906,
29900,
29871,
31382,
30607,
29922,
31482,
29915,
13,
13,
13,
4706,
503,
29880,
353,
525,
1688,
29871,
233,
144,
164,
233,
191,
146,
29892,
1678,
7911,
329,
29892,
259,
29941,
29906,
29941,
29892,
29871,
29900,
29892,
1678,
29941,
29906,
29946,
29892,
29900,
29892,
1678,
591,
13496,
1660,
1799,
29918,
1367,
29922,
29900,
2585,
29955,
2585,
29896,
29890,
29945,
29906,
29945,
29900,
29881,
29953,
29945,
29872,
29946,
29881,
29896,
29883,
29906,
2142,
29900,
29874,
29955,
29900,
29955,
29906,
29929,
29953,
29883,
29900,
29888,
29953,
29947,
29929,
2142,
29883,
29945,
29888,
29929,
29900,
29896,
29906,
29955,
29941,
29871,
26996,
5348,
1367,
29922,
29890,
29929,
13801,
29955,
6448,
29947,
29953,
29881,
29906,
12613,
29929,
29896,
29890,
29906,
29941,
29881,
29955,
29941,
29946,
29955,
29872,
29900,
3905,
29929,
29929,
29945,
29872,
29989,
29896,
29945,
29955,
29900,
29929,
29906,
29953,
29900,
29946,
29946,
29989,
29896,
29945,
29955,
29900,
29929,
29906,
29946,
29929,
29900,
29955,
1192,
259,
30594,
31016,
29922,
29900,
29947,
29901,
29946,
29900,
29892,
29871,
31382,
30607,
29922,
31482,
30408,
29915,
13,
4706,
396,
13,
4706,
396,
503,
29880,
353,
525,
31538,
30666,
30415,
31071,
29936,
29879,
29916,
585,
29936,
705,
13496,
1660,
1799,
29918,
1367,
29922,
29953,
29945,
311,
346,
29947,
29888,
29900,
29945,
29900,
29946,
29896,
3905,
29947,
29883,
29947,
29946,
29929,
29872,
29945,
687,
29945,
29883,
29953,
29906,
29906,
29874,
29896,
29946,
1192,
19592,
29922,
29880,
29916,
29920,
29915,
13,
4706,
396,
525,
18603,
1367,
29922,
29890,
29929,
13801,
29955,
6448,
29947,
29953,
29881,
29906,
12613,
29929,
29896,
29890,
29906,
29941,
29881,
29955,
29941,
29946,
29955,
29872,
29900,
3905,
29929,
29929,
29945,
29872,
29989,
29896,
29945,
29955,
29900,
29906,
29941,
29955,
29947,
29900,
29947,
29989,
29896,
29945,
29955,
29900,
29906,
29941,
29955,
29947,
29900,
29896,
259,
525,
718,
320,
13,
4706,
396,
525,
26996,
5348,
1367,
29922,
29881,
29941,
29929,
29941,
29953,
29906,
29947,
29929,
328,
18725,
29953,
29883,
29941,
29947,
29955,
29946,
29874,
29906,
29945,
29955,
29929,
29900,
29945,
29947,
562,
29953,
29945,
29896,
29989,
29896,
29945,
29955,
29900,
29906,
29941,
29955,
29947,
29900,
29947,
29989,
29896,
29945,
29955,
29900,
29906,
29941,
29955,
29947,
29900,
29896,
259,
525,
718,
320,
13,
13,
4706,
396,
503,
29880,
353,
525,
31538,
30666,
31608,
1678,
343,
29883,
29887,
3594,
29936,
4706,
591,
13496,
29918,
29879,
404,
29918,
333,
29922,
29953,
29955,
29906,
29883,
29945,
29946,
29945,
29929,
328,
29890,
29955,
29883,
29906,
29900,
29888,
29941,
29874,
29941,
29888,
29953,
29946,
29872,
29953,
29955,
29955,
2176,
2176,
774,
562,
29906,
29946,
29945,
29945,
29890,
29946,
29929,
29883,
29941,
29946,
29872,
29906,
29947,
29900,
29936,
29915,
13,
13,
4706,
396,
503,
29880,
353,
525,
233,
141,
165,
31780,
31608,
29890,
29926,
9161,
31608,
29941,
29906,
29946,
31608,
29896,
29900,
31608,
29941,
29906,
29941,
31608,
29947,
29945,
31608,
18603,
1367,
29922,
29890,
29929,
13801,
29955,
6448,
29947,
29953,
29881,
29906,
12613,
29929,
29896,
29890,
29906,
29941,
29881,
29955,
29941,
29946,
29955,
29872,
29900,
3905,
29929,
29929,
29945,
29872,
29989,
29896,
29945,
29955,
29900,
29946,
29946,
29947,
29946,
29941,
29896,
29989,
29896,
29945,
29955,
29900,
29946,
29946,
29947,
29946,
29941,
29900,
31608,
705,
13496,
1660,
1799,
29918,
1367,
29922,
29953,
29945,
1635,
29947,
29881,
29896,
29906,
29883,
29941,
29955,
29946,
1635,
29941,
29890,
29896,
13801,
29946,
29953,
29953,
29874,
29906,
29955,
29929,
6448,
29945,
2291,
29900,
29946,
29888,
29906,
29881,
29929,
1725,
29941,
29955,
29945,
3905,
29955,
29896,
29955,
29888,
29936,
29915,
13,
13,
4706,
396,
503,
29880,
353,
16321,
29606,
29936,
7911,
329,
29936,
29871,
29941,
29896,
29896,
29936,
29871,
29896,
29900,
29900,
29936,
29871,
29941,
29896,
29941,
29936,
29871,
29929,
29896,
29936,
29915,
718,
320,
13,
4706,
396,
418,
525,
591,
13496,
1660,
1799,
29918,
1367,
29922,
287,
29900,
29906,
29946,
29872,
29906,
29947,
29881,
29929,
29945,
29946,
29955,
29896,
29900,
29955,
29947,
29946,
370,
29888,
29906,
29888,
29941,
29947,
29945,
774,
29929,
3905,
29896,
29881,
29955,
311,
29946,
29883,
29945,
29941,
1635,
2176,
29881,
29947,
29929,
29947,
29936,
26996,
5348,
1367,
29922,
29881,
29941,
29929,
29941,
29953,
29906,
29947,
29929,
328,
18725,
29953,
29883,
29941,
29947,
29955,
29946,
29874,
29906,
29945,
29955,
29929,
29900,
29945,
29947,
562,
29953,
29945,
29896,
29989,
29896,
29945,
29955,
29900,
29946,
29900,
29900,
29896,
29945,
29946,
29989,
29896,
29945,
29955,
29900,
29946,
29900,
29900,
29896,
29945,
29941,
29936,
29915,
17501,
13,
4706,
396,
525,
489,
260,
29922,
29900,
29955,
29901,
29900,
29900,
29871,
30606,
31037,
29922,
29893,
29939,
1372,
29887,
29936,
29871,
31482,
30592,
29922,
29926,
29915,
13,
4706,
396,
503,
29880,
353,
525,
29926,
14042,
29887,
29915,
13,
13,
4706,
396,
503,
29880,
353,
14550,
13,
4706,
396,
12354,
847,
2248,
29889,
1961,
29914,
2271,
29914,
5150,
29889,
1420,
29973,
29878,
16328,
29906,
29943,
2248,
29889,
1961,
29995,
29906,
29943,
690,
7143,
29995,
29906,
29943,
2248,
29889,
1420,
29995,
29941,
29943,
29888,
29995,
29941,
29928,
705,
13496,
29995,
29906,
29953,
29876,
29995,
29941,
29928,
29945,
29881,
29929,
6448,
29906,
29941,
29872,
29955,
13891,
29929,
29874,
29987,
401,
29922,
29900,
29947,
29896,
295,
29894,
29979,
29929,
29900,
29895,
29941,
29895,
29903,
29891,
29896,
29956,
7230,
29956,
29929,
29900,
29999,
5311,
29979,
29929,
29900,
295,
29894,
29979,
29953,
29987,
3859,
29922,
29896,
7331,
29914,
29896,
29889,
29896,
16956,
29901,
591,
13496,
29889,
433,
861,
29884,
4096,
25608,
29889,
510,
15160,
29901,
3013,
29899,
284,
573,
5020,
8228,
29899,
797,
24216,
29899,
3089,
29879,
29901,
29871,
29896,
4911,
29899,
19661,
29901,
18129,
2911,
29914,
29945,
29889,
29900,
313,
24085,
29936,
5669,
29871,
29955,
29889,
29900,
29936,
13756,
29871,
29955,
15113,
8878,
29914,
16514,
29928,
29929,
29900,
29924,
29936,
281,
29894,
29897,
12113,
3609,
13117,
29914,
29945,
29941,
29955,
29889,
29941,
29953,
313,
29968,
7020,
29892,
763,
1879,
27604,
29897,
10079,
29914,
29946,
29889,
29900,
10228,
29914,
29953,
29953,
29889,
29900,
29889,
29941,
29941,
29945,
29929,
29889,
29896,
29906,
29953,
341,
29984,
29984,
21537,
29914,
29953,
29889,
29906,
323,
9851,
29914,
29900,
29946,
29946,
29929,
29900,
29946,
21600,
24544,
29914,
29945,
29941,
29955,
29889,
29941,
29953,
28880,
8851,
29933,
1367,
29914,
29946,
29900,
29955,
29896,
20140,
29924,
9957,
914,
29914,
29955,
29889,
29900,
29889,
29955,
29889,
29896,
29945,
29906,
29896,
29898,
29900,
29916,
29906,
29955,
29900,
29900,
29900,
29955,
29941,
29953,
29897,
10554,
29914,
8504,
12670,
1542,
29914,
29946,
29954,
17088,
29914,
17599,
29918,
13778,
29848,
29901,
1426,
29914,
1420,
29892,
6214,
29914,
28392,
29974,
3134,
29892,
6214,
29914,
3134,
29936,
29939,
29922,
29900,
29889,
29929,
29892,
3027,
29914,
2676,
29886,
29892,
3027,
29914,
481,
865,
29892,
3027,
29914,
23310,
16447,
29892,
3027,
29914,
845,
279,
407,
29892,
3027,
29914,
481,
865,
29892,
3027,
29914,
29873,
4061,
29892,
3877,
29930,
29936,
29939,
29922,
29900,
29889,
29947,
29848,
29899,
14934,
29901,
330,
7554,
29892,
822,
9632,
29892,
1506,
29848,
29899,
21233,
29901,
503,
29882,
29899,
13778,
29892,
264,
29899,
3308,
29936,
29939,
29922,
29900,
29889,
29929,
17278,
347,
29901,
3895,
29918,
11116,
29922,
705,
861,
262,
29936,
379,
29885,
29918,
29880,
21908,
29918,
29955,
29947,
29941,
29947,
346,
29888,
29941,
29955,
29946,
774,
29929,
29953,
29953,
3660,
29929,
600,
29945,
29900,
29906,
29883,
29953,
29947,
29881,
29953,
29888,
29900,
29929,
29947,
29922,
29896,
29945,
29955,
29900,
29946,
29953,
29946,
29896,
29947,
29896,
29936,
379,
29885,
29918,
22833,
21908,
29918,
29955,
29947,
29941,
29947,
346,
29888,
29941,
29955,
29946,
774,
29929,
29953,
29953,
3660,
29929,
600,
29945,
29900,
29906,
29883,
29953,
29947,
29881,
29953,
29888,
29900,
29929,
29947,
29922,
29896,
29945,
29955,
29900,
29946,
29947,
29929,
29946,
29941,
29941,
29936,
591,
13496,
1660,
1799,
29918,
1367,
29922,
29947,
29945,
29947,
29900,
29955,
14943,
29941,
29947,
29953,
29941,
915,
29953,
29953,
29872,
29947,
29890,
29947,
29953,
29947,
29872,
29946,
2176,
346,
29896,
29947,
1388,
29900,
13,
4706,
396,
14550,
13,
13,
4706,
396,
503,
29880,
353,
525,
1688,
29871,
233,
144,
164,
233,
191,
146,
269,
29916,
585,
29936,
268,
29896,
29900,
29906,
29947,
29896,
29892,
29871,
29900,
29936,
539,
29900,
29892,
29900,
29936,
1678,
591,
13496,
1660,
1799,
29918,
1367,
29922,
29947,
29929,
29900,
29946,
29900,
29883,
29906,
29929,
29929,
29947,
29900,
29947,
29946,
287,
29953,
29945,
29896,
29874,
29947,
29874,
29955,
29929,
29929,
29896,
346,
29896,
29896,
29906,
29953,
29946,
1192,
29871,
30594,
31016,
29922,
29906,
29896,
29901,
29946,
29900,
29871,
31382,
30607,
29922,
31482,
30408,
29871,
30606,
31037,
29922,
30805,
31333,
31780,
29915,
13,
4706,
396,
503,
29880,
353,
525,
1688,
260,
29926,
269,
29916,
585,
29936,
1678,
591,
13496,
1660,
1799,
29918,
1367,
29922,
29947,
29929,
29900,
29946,
29900,
29883,
29906,
29929,
29929,
29947,
29900,
29947,
29946,
287,
29953,
29945,
29896,
29874,
29947,
29874,
29955,
29929,
29929,
29896,
346,
29896,
29896,
29906,
29953,
29946,
1192,
29871,
30594,
31016,
29922,
29906,
29896,
29901,
29946,
29900,
29871,
31382,
30607,
29922,
31482,
30408,
29871,
30606,
31037,
29922,
30805,
31333,
31780,
29915,
13,
4706,
396,
503,
29880,
353,
525,
1688,
29871,
432,
29880,
29892,
289,
29926,
9161,
29871,
29941,
29906,
29941,
29892,
29871,
29900,
29892,
29871,
29941,
29906,
29941,
29892,
29871,
29896,
591,
13496,
1660,
1799,
29918,
1367,
29922,
311,
29906,
29872,
29896,
29881,
29946,
29955,
29883,
29945,
29900,
29883,
29945,
29929,
29955,
29900,
29929,
27885,
29945,
3905,
29896,
29900,
29906,
11248,
29953,
29888,
29955,
29941,
29947,
29900,
29929,
29906,
29946,
29929,
29929,
29946,
29929,
29945,
29874,
29953,
29896,
29872,
29945,
29872,
29871,
26996,
5348,
1367,
29922,
29890,
29929,
13801,
29955,
6448,
29947,
29953,
29881,
29906,
12613,
29929,
29896,
29890,
29906,
29941,
29881,
29955,
29941,
29946,
29955,
29872,
29900,
3905,
29929,
29929,
29945,
29872,
29989,
29896,
29945,
29955,
29906,
29945,
29955,
29955,
29955,
29929,
29896,
29989,
29896,
29945,
29955,
29906,
29945,
29955,
29955,
29955,
29947,
29955,
1192,
29871,
31382,
30607,
29922,
31482,
30408,
29915,
13,
4706,
503,
29880,
353,
525,
1688,
29871,
260,
29926,
29892,
269,
29916,
585,
29871,
591,
13496,
1660,
1799,
29918,
1367,
29922,
29900,
29881,
29929,
29874,
29945,
29947,
29874,
29900,
29906,
29953,
29947,
29906,
29953,
29883,
29906,
29888,
29953,
29874,
27885,
29906,
29881,
29941,
29929,
29906,
29953,
774,
29900,
29896,
29881,
1192,
29871,
30606,
31037,
29922,
30805,
31333,
31780,
29915,
13,
4706,
396,
503,
29880,
353,
525,
1688,
28232,
29892,
281,
1983,
29888,
3594,
29915,
13,
4706,
396,
503,
29880,
353,
525,
1688,
29871,
432,
29880,
29892,
1233,
4668,
3594,
29892,
259,
29896,
29900,
29896,
29896,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1919,
29900,
29892,
591,
13496,
1660,
1799,
29918,
1367,
29922,
29941,
29945,
287,
29906,
29946,
29941,
29888,
29929,
29906,
915,
29955,
29890,
29955,
29946,
29947,
29874,
29906,
29896,
29881,
29945,
29941,
29883,
346,
29955,
29896,
29955,
29929,
29890,
29929,
1192,
29871,
30606,
31037,
29922,
30805,
31333,
31780,
29871,
31382,
30607,
29922,
31482,
30408,
29915,
13,
4706,
503,
29880,
353,
525,
1688,
432,
29880,
31608,
29879,
29916,
585,
31608,
29896,
29900,
29906,
29941,
29947,
31608,
29900,
29947,
29953,
31608,
29896,
29900,
29906,
29941,
29947,
31608,
29900,
29900,
29946,
31608,
705,
13496,
1660,
1799,
29918,
1367,
29922,
29900,
29881,
29929,
29874,
29945,
29947,
29874,
29900,
29906,
29953,
29947,
29906,
29953,
29883,
29906,
29888,
29953,
29874,
27885,
29906,
29881,
29941,
29929,
29906,
29953,
774,
29900,
29896,
29881,
1192,
29871,
30606,
31037,
29922,
30805,
31333,
31780,
29915,
13,
4706,
620,
353,
4386,
29918,
7645,
29898,
1792,
333,
2433,
1792,
333,
29918,
1688,
29918,
29915,
718,
851,
29898,
29875,
511,
2793,
29922,
29920,
29880,
29892,
590,
29918,
333,
2433,
1357,
29918,
333,
29918,
29915,
718,
851,
29898,
29875,
511,
11247,
29907,
1964,
29922,
16652,
1964,
29897,
13,
13,
1678,
286,
29883,
29889,
4645,
29918,
5358,
580,
13,
13,
1678,
4744,
29918,
29886,
877,
8835,
9903,
29876,
742,
620,
29897,
13,
2
] |
vespa/simulation/auto_gui/calculate_add_sub.py | vespa-mrs/vespa | 0 | 143845 | # -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.9.3 on Wed Sep 11 13:49:50 2019
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class MyDialog(wx.Dialog):
def __init__(self, *args, **kwds):
# begin wxGlade: MyDialog.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
wx.Dialog.__init__(self, *args, **kwds)
self.LabelInstructions = wx.StaticText(self, wx.ID_ANY, "Instructions\n\nSelect the experiment dimension (by Loop name) that contains the Off/On states \nof the Edited pulse seqeunce Experiment. \n\nNote that the Loop dimension size must be at least two and that the Off state \nis expected to be the first entry in the Loop followed by the On state in the\nsecond entry in this Loop.\n\nIf a Loop selection does not have a dimension of at leas two, then the widget \nwill reset to the first dimension that does.")
self.ChoiceLoop = wx.Choice(self, wx.ID_ANY, choices=["Loop 1", "Loop 2", "Loop 3"])
self.label_1 = wx.StaticText(self, wx.ID_ANY, "Comment - will be appended to new Add/Sub Experiment comment:")
self.TextComment = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.LabelStatus = wx.StaticText(self, wx.ID_ANY, "Welcome")
self.LabelOkCancelPlaceholder = wx.StaticText(self, wx.ID_ANY, "LabelOkCancelPlaceholder", style=wx.ALIGN_RIGHT)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_CHOICE, self.on_loop, self.ChoiceLoop)
# end wxGlade
def __set_properties(self):
# begin wxGlade: MyDialog.__set_properties
self.SetTitle("Calculate Add/Sub to New Tab")
self.ChoiceLoop.SetSelection(0)
self.TextComment.SetMinSize((640, 90))
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyDialog.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
sizer_1_copy = wx.BoxSizer(wx.VERTICAL)
sizer_2 = wx.BoxSizer(wx.VERTICAL)
sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
sizer_3.Add(self.LabelInstructions, 0, wx.EXPAND, 0)
sizer_1_copy.Add(sizer_3, 0, wx.ALL | wx.EXPAND, 4)
sizer_1_copy.Add(self.ChoiceLoop, 0, wx.ALL | wx.EXPAND, 8)
sizer_2.Add(self.label_1, 0, wx.BOTTOM | wx.TOP, 4)
sizer_2.Add(self.TextComment, 0, wx.EXPAND, 0)
sizer_1_copy.Add(sizer_2, 0, wx.ALL | wx.EXPAND, 4)
sizer_1.Add(sizer_1_copy, 0, wx.EXPAND, 0)
sizer_5.Add(self.LabelStatus, 1, wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.LEFT | wx.TOP, 10)
sizer_5.Add(self.LabelOkCancelPlaceholder, 0, wx.ALIGN_CENTER_VERTICAL, 0)
sizer_1.Add(sizer_5, 0, wx.BOTTOM | wx.EXPAND | wx.RIGHT | wx.TOP, 10)
self.SetSizer(sizer_1)
sizer_1.Fit(self)
self.Layout()
# end wxGlade
def on_loop(self, event): # wxGlade: MyDialog.<event_handler>
print("Event handler 'on_loop' not implemented!")
event.Skip()
# end of class MyDialog
| [
1,
396,
448,
29930,
29899,
14137,
29901,
18351,
29899,
29947,
448,
29930,
29899,
13,
29937,
13,
29937,
5759,
491,
26437,
29954,
23373,
29871,
29900,
29889,
29929,
29889,
29941,
373,
15050,
29639,
29871,
29896,
29896,
29871,
29896,
29941,
29901,
29946,
29929,
29901,
29945,
29900,
29871,
29906,
29900,
29896,
29929,
13,
29937,
13,
13,
5215,
26437,
13,
13,
29937,
3380,
26437,
29954,
23373,
29901,
9962,
13,
29937,
1095,
26437,
29954,
23373,
13,
13,
29937,
3380,
26437,
29954,
23373,
29901,
4805,
401,
13,
29937,
1095,
26437,
29954,
23373,
13,
13,
13,
1990,
1619,
7647,
29898,
23310,
29889,
7647,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
11022,
6289,
1125,
13,
4706,
396,
3380,
26437,
29954,
23373,
29901,
1619,
7647,
17255,
2344,
1649,
13,
4706,
9049,
6289,
3366,
3293,
3108,
353,
9049,
6289,
29889,
657,
703,
3293,
613,
29871,
29900,
29897,
891,
26437,
29889,
23397,
29918,
4571,
1964,
29949,
29954,
29918,
1254,
29979,
1307,
891,
26437,
29889,
1525,
14226,
29918,
29933,
22364,
13,
4706,
26437,
29889,
7647,
17255,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
11022,
6289,
29897,
13,
4706,
1583,
29889,
4775,
3379,
582,
1953,
353,
26437,
29889,
17046,
1626,
29898,
1311,
29892,
26437,
29889,
1367,
29918,
2190,
29979,
29892,
376,
3379,
582,
1953,
29905,
29876,
29905,
29876,
3549,
278,
7639,
9927,
313,
1609,
21493,
1024,
29897,
393,
3743,
278,
5947,
29914,
2951,
5922,
320,
3998,
278,
2155,
1573,
9505,
344,
19359,
29872,
348,
346,
1222,
15362,
29889,
320,
29876,
29905,
29876,
9842,
393,
278,
21493,
9927,
2159,
1818,
367,
472,
3203,
1023,
322,
393,
278,
5947,
2106,
320,
6994,
3806,
304,
367,
278,
937,
6251,
297,
278,
21493,
5643,
491,
278,
1551,
2106,
297,
278,
29905,
29876,
7496,
6251,
297,
445,
21493,
7790,
29876,
29905,
29876,
3644,
263,
21493,
9262,
947,
451,
505,
263,
9927,
310,
472,
454,
294,
1023,
29892,
769,
278,
11109,
320,
29876,
14043,
10092,
304,
278,
937,
9927,
393,
947,
23157,
13,
4706,
1583,
29889,
29620,
18405,
353,
26437,
29889,
29620,
29898,
1311,
29892,
26437,
29889,
1367,
29918,
2190,
29979,
29892,
19995,
29922,
3366,
18405,
29871,
29896,
613,
376,
18405,
29871,
29906,
613,
376,
18405,
29871,
29941,
20068,
13,
4706,
1583,
29889,
1643,
29918,
29896,
353,
26437,
29889,
17046,
1626,
29898,
1311,
29892,
26437,
29889,
1367,
29918,
2190,
29979,
29892,
376,
20001,
448,
674,
367,
623,
2760,
304,
716,
3462,
29914,
4035,
1222,
15362,
3440,
29901,
1159,
13,
4706,
1583,
29889,
1626,
20001,
353,
26437,
29889,
1626,
18069,
29898,
1311,
29892,
26437,
29889,
1367,
29918,
2190,
29979,
29892,
12633,
3114,
29922,
23310,
29889,
4330,
29918,
29924,
8647,
6227,
8895,
29897,
13,
4706,
1583,
29889,
4775,
5709,
353,
26437,
29889,
17046,
1626,
29898,
1311,
29892,
26437,
29889,
1367,
29918,
2190,
29979,
29892,
376,
28862,
2763,
1159,
13,
4706,
1583,
29889,
4775,
20434,
19420,
22150,
7694,
353,
26437,
29889,
17046,
1626,
29898,
1311,
29892,
26437,
29889,
1367,
29918,
2190,
29979,
29892,
376,
4775,
20434,
19420,
22150,
7694,
613,
3114,
29922,
23310,
29889,
1964,
17298,
29918,
22789,
3912,
29897,
13,
13,
4706,
1583,
17255,
842,
29918,
11330,
580,
13,
4706,
1583,
17255,
1867,
29918,
2680,
580,
13,
13,
4706,
1583,
29889,
15708,
29898,
23310,
29889,
22240,
29911,
29918,
3210,
29949,
12107,
29892,
1583,
29889,
265,
29918,
7888,
29892,
1583,
29889,
29620,
18405,
29897,
13,
4706,
396,
1095,
26437,
29954,
23373,
13,
13,
1678,
822,
4770,
842,
29918,
11330,
29898,
1311,
1125,
13,
4706,
396,
3380,
26437,
29954,
23373,
29901,
1619,
7647,
17255,
842,
29918,
11330,
13,
4706,
1583,
29889,
2697,
7030,
703,
27065,
403,
3462,
29914,
4035,
304,
1570,
11090,
1159,
13,
4706,
1583,
29889,
29620,
18405,
29889,
2697,
15097,
29898,
29900,
29897,
13,
4706,
1583,
29889,
1626,
20001,
29889,
2697,
8140,
3505,
3552,
29953,
29946,
29900,
29892,
29871,
29929,
29900,
876,
13,
4706,
396,
1095,
26437,
29954,
23373,
13,
13,
1678,
822,
4770,
1867,
29918,
2680,
29898,
1311,
1125,
13,
4706,
396,
3380,
26437,
29954,
23373,
29901,
1619,
7647,
17255,
1867,
29918,
2680,
13,
4706,
269,
3950,
29918,
29896,
353,
26437,
29889,
3313,
29903,
3950,
29898,
23310,
29889,
5348,
29911,
2965,
1964,
29897,
13,
4706,
269,
3950,
29918,
29945,
353,
26437,
29889,
3313,
29903,
3950,
29898,
23310,
29889,
29950,
1955,
26664,
1164,
29911,
1964,
29897,
13,
4706,
269,
3950,
29918,
29896,
29918,
8552,
353,
26437,
29889,
3313,
29903,
3950,
29898,
23310,
29889,
5348,
29911,
2965,
1964,
29897,
13,
4706,
269,
3950,
29918,
29906,
353,
26437,
29889,
3313,
29903,
3950,
29898,
23310,
29889,
5348,
29911,
2965,
1964,
29897,
13,
4706,
269,
3950,
29918,
29941,
353,
26437,
29889,
3313,
29903,
3950,
29898,
23310,
29889,
29950,
1955,
26664,
1164,
29911,
1964,
29897,
13,
4706,
269,
3950,
29918,
29941,
29889,
2528,
29898,
1311,
29889,
4775,
3379,
582,
1953,
29892,
29871,
29900,
29892,
26437,
29889,
5746,
29925,
9468,
29892,
29871,
29900,
29897,
13,
4706,
269,
3950,
29918,
29896,
29918,
8552,
29889,
2528,
29898,
29879,
3950,
29918,
29941,
29892,
29871,
29900,
29892,
26437,
29889,
9818,
891,
26437,
29889,
5746,
29925,
9468,
29892,
29871,
29946,
29897,
13,
4706,
269,
3950,
29918,
29896,
29918,
8552,
29889,
2528,
29898,
1311,
29889,
29620,
18405,
29892,
29871,
29900,
29892,
26437,
29889,
9818,
891,
26437,
29889,
5746,
29925,
9468,
29892,
29871,
29947,
29897,
13,
4706,
269,
3950,
29918,
29906,
29889,
2528,
29898,
1311,
29889,
1643,
29918,
29896,
29892,
29871,
29900,
29892,
26437,
29889,
29933,
2891,
4986,
29924,
891,
26437,
29889,
29911,
4590,
29892,
29871,
29946,
29897,
13,
4706,
269,
3950,
29918,
29906,
29889,
2528,
29898,
1311,
29889,
1626,
20001,
29892,
29871,
29900,
29892,
26437,
29889,
5746,
29925,
9468,
29892,
29871,
29900,
29897,
13,
4706,
269,
3950,
29918,
29896,
29918,
8552,
29889,
2528,
29898,
29879,
3950,
29918,
29906,
29892,
29871,
29900,
29892,
26437,
29889,
9818,
891,
26437,
29889,
5746,
29925,
9468,
29892,
29871,
29946,
29897,
13,
4706,
269,
3950,
29918,
29896,
29889,
2528,
29898,
29879,
3950,
29918,
29896,
29918,
8552,
29892,
29871,
29900,
29892,
26437,
29889,
5746,
29925,
9468,
29892,
29871,
29900,
29897,
13,
4706,
269,
3950,
29918,
29945,
29889,
2528,
29898,
1311,
29889,
4775,
5709,
29892,
29871,
29896,
29892,
26437,
29889,
1964,
17298,
29918,
29907,
3919,
1001,
29918,
5348,
29911,
2965,
1964,
891,
26437,
29889,
29933,
2891,
4986,
29924,
891,
26437,
29889,
28024,
891,
26437,
29889,
29911,
4590,
29892,
29871,
29896,
29900,
29897,
13,
4706,
269,
3950,
29918,
29945,
29889,
2528,
29898,
1311,
29889,
4775,
20434,
19420,
22150,
7694,
29892,
29871,
29900,
29892,
26437,
29889,
1964,
17298,
29918,
29907,
3919,
1001,
29918,
5348,
29911,
2965,
1964,
29892,
29871,
29900,
29897,
13,
4706,
269,
3950,
29918,
29896,
29889,
2528,
29898,
29879,
3950,
29918,
29945,
29892,
29871,
29900,
29892,
26437,
29889,
29933,
2891,
4986,
29924,
891,
26437,
29889,
5746,
29925,
9468,
891,
26437,
29889,
22789,
3912,
891,
26437,
29889,
29911,
4590,
29892,
29871,
29896,
29900,
29897,
13,
4706,
1583,
29889,
2697,
29903,
3950,
29898,
29879,
3950,
29918,
29896,
29897,
13,
4706,
269,
3950,
29918,
29896,
29889,
29943,
277,
29898,
1311,
29897,
13,
4706,
1583,
29889,
3453,
580,
13,
4706,
396,
1095,
26437,
29954,
23373,
13,
13,
1678,
822,
373,
29918,
7888,
29898,
1311,
29892,
1741,
1125,
29871,
396,
26437,
29954,
23373,
29901,
1619,
7647,
19423,
3696,
29918,
13789,
29958,
13,
4706,
1596,
703,
2624,
7834,
525,
265,
29918,
7888,
29915,
451,
8762,
29991,
1159,
13,
4706,
1741,
29889,
15797,
666,
580,
13,
13,
29937,
1095,
310,
770,
1619,
7647,
13,
2
] |
tests/py/test_state_chain.py | devmiyax/liberapay.com | 1 | 77662 | <filename>tests/py/test_state_chain.py
# coding: utf8
from __future__ import absolute_import, division, print_function, unicode_literals
from base64 import b64encode
import json
from pando.exceptions import MalformedBody, UnknownBodyType
from pando.http.request import Request
from pando.http.response import Response
from liberapay.constants import SESSION
from liberapay.security import csrf
from liberapay.testing import Harness
class Tests(Harness):
def setUp(self):
Harness.setUp(self)
self.client.website.canonical_scheme = 'https'
self.client.website.canonical_host = 'example.com'
self._cookie_domain = self.client.website.cookie_domain
self.client.website.cookie_domain = b'.example.com'
def tearDown(self):
Harness.tearDown(self)
website = self.client.website
website.canonical_scheme = website.env.canonical_scheme
website.canonical_host = website.env.canonical_host
website.cookie_domain = self._cookie_domain
def test_canonize_canonizes(self):
response = self.client.GxT("/",
HTTP_HOST=b'example.com',
HTTP_X_FORWARDED_PROTO=b'http',
)
assert response.code == 302
assert response.headers[b'Location'] == b'https://example.com/'
assert response.headers[b'Cache-Control'] == b'public, max-age=86400'
def test_no_cookies_over_http(self):
"""
We don't want to send cookies over HTTP, especially not CSRF and
session cookies, for obvious security reasons.
"""
alice = self.make_participant('alice')
redirect = self.client.GET("/",
auth_as=alice,
HTTP_X_FORWARDED_PROTO=b'http',
HTTP_HOST=b'example.com',
raise_immediately=False,
)
assert redirect.code == 302
assert not redirect.headers.cookie
def test_early_failures_dont_break_everything(self):
old_from_wsgi = Request.from_wsgi
def broken_from_wsgi(*a, **kw):
raise Response(400)
try:
Request.from_wsgi = classmethod(broken_from_wsgi)
assert self.client.GET("/", raise_immediately=False).code == 400
finally:
Request.from_wsgi = old_from_wsgi
def test_i18n_subdomain_works(self):
r = self.client.GET(
'/',
HTTP_X_FORWARDED_PROTO=b'https', HTTP_HOST=b'fr.example.com',
raise_immediately=False,
)
assert r.code == 200
assert '<html lang="fr">' in r.text
assert 'À propos' in r.text
def test_i18n_subdomain_is_redirected_to_https(self):
r = self.client.GET(
'/',
HTTP_X_FORWARDED_PROTO=b'http', HTTP_HOST=b'en.example.com',
raise_immediately=False,
)
assert r.code == 302
assert not r.headers.cookie
assert r.headers[b'Location'] == b'https://en.example.com/'
def test_csrf_cookie_properties(self):
r = self.client.GET(
'/',
HTTP_X_FORWARDED_PROTO=b'https', HTTP_HOST=b'en.example.com',
csrf_token=None, raise_immediately=False,
)
assert r.code == 200
cookie = r.headers.cookie[csrf.CSRF_TOKEN]
assert cookie[str('domain')] == str('.example.com')
assert cookie[str('expires')][-4:] == str(' GMT')
assert cookie[str('path')] == str('/')
assert cookie[str('secure')] is True
class Tests2(Harness):
def test_basic_auth_works_and_doesnt_return_a_session_cookie(self):
alice = self.make_participant('alice')
password = 'password'
alice.update_password(password)
auth_header = b'Basic ' + b64encode(('%s:%s' % (alice.id, password)).encode('ascii'))
r = self.client.GET('/', HTTP_AUTHORIZATION=auth_header)
assert r.code == 200
assert SESSION not in r.headers.cookie
def test_basic_auth_malformed_header_returns_400(self):
auth_header = b'Basic ' + b64encode(b'bad')
r = self.client.GxT('/', HTTP_AUTHORIZATION=auth_header)
assert r.code == 400
assert r.text == 'Malformed "Authorization" header'
def test_basic_auth_bad_userid_returns_401(self):
auth_header = b'Basic ' + b64encode(b'admin:admin')
r = self.client.GxT('/', HTTP_AUTHORIZATION=auth_header)
assert r.code == 401
def test_basic_auth_no_password_returns_401(self):
alice = self.make_participant('alice')
assert alice.id == 1
auth_header = b'Basic ' + b64encode(b'1:')
r = self.client.GxT('/', HTTP_AUTHORIZATION=auth_header)
assert r.code == 401
def test_accept_header_is_respected(self):
r = self.client.GET('/about/stats', HTTP_ACCEPT=b'application/json')
assert r.headers[b'Content-Type'] == b'application/json; charset=UTF-8'
json.loads(r.text)
def test_error_spt_works(self):
r = self.client.POST('/', csrf_token=False, raise_immediately=False)
assert r.code == 403
def test_cors_is_not_allowed_by_default(self):
r = self.client.GET('/')
assert b'Access-Control-Allow-Origin' not in r.headers
def test_cors_is_allowed_for_assets(self):
r = self.client.GET('/assets/jquery.min.js')
assert r.code == 200
assert r.headers[b'Access-Control-Allow-Origin'] == b'*'
def test_caching_of_assets(self):
r = self.client.GET('/assets/jquery.min.js')
assert r.headers[b'Cache-Control'] == b'public, max-age=3600'
assert b'Vary' not in r.headers
assert not r.headers.cookie
def test_caching_of_assets_with_etag(self):
r = self.client.GET(self.client.website.asset('jquery.min.js'))
assert r.headers[b'Cache-Control'] == b'public, max-age=31536000'
assert b'Vary' not in r.headers
assert not r.headers.cookie
def test_caching_of_simplates(self):
r = self.client.GET('/')
assert r.headers[b'Cache-Control'] == b'no-cache'
assert b'Vary' not in r.headers
def test_no_csrf_cookie(self):
r = self.client.POST('/', csrf_token=False, raise_immediately=False)
assert r.code == 403
assert "Bad CSRF cookie" in r.text
assert csrf.CSRF_TOKEN in r.headers.cookie
def test_no_csrf_cookie_unknown_method_on_asset(self):
r = self.client.hit('UNKNOWN', '/assets/base.css', csrf_token=False,
raise_immediately=False)
assert r.code == 200 # this should be a 405, that's a "bug" in aspen
def test_bad_csrf_cookie(self):
r = self.client.POST('/', csrf_token='bad_<PASSWORD>', raise_immediately=False)
assert r.code == 403
assert "Bad CSRF cookie" in r.text
assert r.headers.cookie[csrf.CSRF_TOKEN].value != 'bad_token'
def test_csrf_cookie_set_for_most_requests(self):
r = self.client.GET('/')
assert csrf.CSRF_TOKEN in r.headers.cookie
def test_no_csrf_cookie_set_for_assets(self):
r = self.client.GET('/assets/base.css')
assert csrf.CSRF_TOKEN not in r.headers.cookie
def test_sanitize_token_passes_through_good_token(self):
token = '<PASSWORD>'
assert csrf._sanitize_token(token) == token
def test_sanitize_token_rejects_overlong_token(self):
token = 'ddd<PASSWORD>'
assert csrf._sanitize_token(token) is None
def test_sanitize_token_rejects_underlong_token(self):
token = 'ddd<PASSWORD>'
assert csrf._sanitize_token(token) is None
def test_sanitize_token_rejects_goofy_token(self):
token = '<PASSWORD>'
assert csrf._sanitize_token(token) is None
def test_malformed_body(self):
with self.assertRaises(MalformedBody):
self.client.POST('/', body=b'a', content_type=b'application/json')
def test_unknown_body_type(self):
with self.assertRaises(UnknownBodyType):
self.client.POST('/', body=b'x', content_type=b'unknown/x')
def test_non_dict_body(self):
r = self.client.POST('/', body=b'[]', content_type=b'application/json')
assert r.code == 200
def test_no_trailing_slash_redirects(self):
r = self.client.GET('/foo', raise_immediately=False)
assert r.code == 404, r.text
def test_null_byte_results_in_400(self):
r = self.client.GET('/foo%00', raise_immediately=False)
assert r.code == 400, r.text
| [
1,
529,
9507,
29958,
21150,
29914,
2272,
29914,
1688,
29918,
3859,
29918,
14153,
29889,
2272,
13,
29937,
14137,
29901,
23616,
29947,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
8542,
29892,
1596,
29918,
2220,
29892,
29104,
29918,
20889,
1338,
13,
13,
3166,
2967,
29953,
29946,
1053,
289,
29953,
29946,
12508,
13,
5215,
4390,
13,
13,
3166,
282,
1743,
29889,
11739,
29879,
1053,
3792,
15628,
8434,
29892,
853,
5203,
8434,
1542,
13,
3166,
282,
1743,
29889,
1124,
29889,
3827,
1053,
10729,
13,
3166,
282,
1743,
29889,
1124,
29889,
5327,
1053,
13291,
13,
13,
3166,
7866,
481,
388,
29889,
3075,
1934,
1053,
3725,
13507,
13,
3166,
7866,
481,
388,
29889,
8926,
1053,
5939,
9600,
13,
3166,
7866,
481,
388,
29889,
13424,
1053,
3536,
2264,
13,
13,
13,
1990,
4321,
29879,
29898,
21972,
2264,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
3536,
2264,
29889,
842,
3373,
29898,
1311,
29897,
13,
4706,
1583,
29889,
4645,
29889,
22942,
29889,
3068,
265,
936,
29918,
816,
2004,
353,
525,
991,
29915,
13,
4706,
1583,
29889,
4645,
29889,
22942,
29889,
3068,
265,
936,
29918,
3069,
353,
525,
4773,
29889,
510,
29915,
13,
4706,
1583,
3032,
21509,
29918,
7247,
353,
1583,
29889,
4645,
29889,
22942,
29889,
21509,
29918,
7247,
13,
4706,
1583,
29889,
4645,
29889,
22942,
29889,
21509,
29918,
7247,
353,
289,
4286,
4773,
29889,
510,
29915,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
3536,
2264,
29889,
371,
279,
6767,
29898,
1311,
29897,
13,
4706,
4700,
353,
1583,
29889,
4645,
29889,
22942,
13,
4706,
4700,
29889,
3068,
265,
936,
29918,
816,
2004,
353,
4700,
29889,
6272,
29889,
3068,
265,
936,
29918,
816,
2004,
13,
4706,
4700,
29889,
3068,
265,
936,
29918,
3069,
353,
4700,
29889,
6272,
29889,
3068,
265,
936,
29918,
3069,
13,
4706,
4700,
29889,
21509,
29918,
7247,
353,
1583,
3032,
21509,
29918,
7247,
13,
13,
1678,
822,
1243,
29918,
3068,
265,
675,
29918,
3068,
265,
7093,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
29954,
29916,
29911,
11974,
613,
13,
462,
462,
259,
7331,
29918,
20832,
29922,
29890,
29915,
4773,
29889,
510,
742,
13,
462,
462,
259,
7331,
29918,
29990,
29918,
22051,
29956,
1718,
2287,
29928,
29918,
8618,
4986,
29922,
29890,
29915,
1124,
742,
13,
462,
462,
259,
1723,
13,
4706,
4974,
2933,
29889,
401,
1275,
29871,
29941,
29900,
29906,
13,
4706,
4974,
2933,
29889,
13662,
29961,
29890,
29915,
6508,
2033,
1275,
289,
29915,
991,
597,
4773,
29889,
510,
22208,
13,
4706,
4974,
2933,
29889,
13662,
29961,
29890,
29915,
10408,
29899,
4809,
2033,
1275,
289,
29915,
3597,
29892,
4236,
29899,
482,
29922,
29947,
29953,
29946,
29900,
29900,
29915,
13,
13,
1678,
822,
1243,
29918,
1217,
29918,
15108,
583,
29918,
957,
29918,
1124,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
1334,
1016,
29915,
29873,
864,
304,
3638,
21046,
975,
7331,
29892,
7148,
451,
315,
14098,
29943,
322,
13,
4706,
4867,
21046,
29892,
363,
6924,
6993,
9590,
29889,
13,
4706,
9995,
13,
4706,
394,
625,
353,
1583,
29889,
5675,
29918,
1595,
12654,
424,
877,
284,
625,
1495,
13,
4706,
6684,
353,
1583,
29889,
4645,
29889,
7194,
11974,
613,
13,
462,
462,
259,
4817,
29918,
294,
29922,
284,
625,
29892,
13,
462,
462,
259,
7331,
29918,
29990,
29918,
22051,
29956,
1718,
2287,
29928,
29918,
8618,
4986,
29922,
29890,
29915,
1124,
742,
13,
462,
462,
259,
7331,
29918,
20832,
29922,
29890,
29915,
4773,
29889,
510,
742,
13,
462,
462,
259,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29892,
13,
462,
462,
259,
1723,
13,
4706,
4974,
6684,
29889,
401,
1275,
29871,
29941,
29900,
29906,
13,
4706,
4974,
451,
6684,
29889,
13662,
29889,
21509,
13,
13,
1678,
822,
1243,
29918,
799,
368,
29918,
14057,
1973,
29918,
29881,
609,
29918,
8690,
29918,
17991,
1918,
29898,
1311,
1125,
13,
4706,
2030,
29918,
3166,
29918,
5652,
3146,
353,
10729,
29889,
3166,
29918,
5652,
3146,
13,
4706,
822,
9391,
29918,
3166,
29918,
5652,
3146,
10456,
29874,
29892,
3579,
11022,
1125,
13,
9651,
12020,
13291,
29898,
29946,
29900,
29900,
29897,
13,
4706,
1018,
29901,
13,
9651,
10729,
29889,
3166,
29918,
5652,
3146,
353,
770,
5696,
29898,
6729,
1717,
29918,
3166,
29918,
5652,
3146,
29897,
13,
9651,
4974,
1583,
29889,
4645,
29889,
7194,
11974,
613,
12020,
29918,
326,
4210,
2486,
29922,
8824,
467,
401,
1275,
29871,
29946,
29900,
29900,
13,
4706,
7146,
29901,
13,
9651,
10729,
29889,
3166,
29918,
5652,
3146,
353,
2030,
29918,
3166,
29918,
5652,
3146,
13,
13,
1678,
822,
1243,
29918,
29875,
29896,
29947,
29876,
29918,
1491,
7247,
29918,
13129,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
29898,
13,
9651,
8207,
742,
13,
9651,
7331,
29918,
29990,
29918,
22051,
29956,
1718,
2287,
29928,
29918,
8618,
4986,
29922,
29890,
29915,
991,
742,
7331,
29918,
20832,
29922,
29890,
29915,
1341,
29889,
4773,
29889,
510,
742,
13,
9651,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29892,
13,
4706,
1723,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29906,
29900,
29900,
13,
4706,
4974,
12801,
1420,
6361,
543,
1341,
1013,
29915,
297,
364,
29889,
726,
13,
4706,
4974,
525,
30113,
9551,
29915,
297,
364,
29889,
726,
13,
13,
1678,
822,
1243,
29918,
29875,
29896,
29947,
29876,
29918,
1491,
7247,
29918,
275,
29918,
17886,
287,
29918,
517,
29918,
991,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
29898,
13,
9651,
8207,
742,
13,
9651,
7331,
29918,
29990,
29918,
22051,
29956,
1718,
2287,
29928,
29918,
8618,
4986,
29922,
29890,
29915,
1124,
742,
7331,
29918,
20832,
29922,
29890,
29915,
264,
29889,
4773,
29889,
510,
742,
13,
9651,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29892,
13,
4706,
1723,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29941,
29900,
29906,
13,
4706,
4974,
451,
364,
29889,
13662,
29889,
21509,
13,
4706,
4974,
364,
29889,
13662,
29961,
29890,
29915,
6508,
2033,
1275,
289,
29915,
991,
597,
264,
29889,
4773,
29889,
510,
22208,
13,
13,
1678,
822,
1243,
29918,
2395,
9600,
29918,
21509,
29918,
11330,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
29898,
13,
9651,
8207,
742,
13,
9651,
7331,
29918,
29990,
29918,
22051,
29956,
1718,
2287,
29928,
29918,
8618,
4986,
29922,
29890,
29915,
991,
742,
7331,
29918,
20832,
29922,
29890,
29915,
264,
29889,
4773,
29889,
510,
742,
13,
9651,
5939,
9600,
29918,
6979,
29922,
8516,
29892,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29892,
13,
4706,
1723,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29906,
29900,
29900,
13,
4706,
15327,
353,
364,
29889,
13662,
29889,
21509,
29961,
2395,
9600,
29889,
9295,
29934,
29943,
29918,
4986,
29968,
1430,
29962,
13,
4706,
4974,
15327,
29961,
710,
877,
7247,
1495,
29962,
1275,
851,
12839,
4773,
29889,
510,
1495,
13,
4706,
4974,
15327,
29961,
710,
877,
4548,
2658,
1495,
3816,
29899,
29946,
17531,
1275,
851,
877,
402,
11490,
1495,
13,
4706,
4974,
15327,
29961,
710,
877,
2084,
1495,
29962,
1275,
851,
11219,
1495,
13,
4706,
4974,
15327,
29961,
710,
877,
24216,
1495,
29962,
338,
5852,
13,
13,
13,
1990,
4321,
29879,
29906,
29898,
21972,
2264,
1125,
13,
13,
1678,
822,
1243,
29918,
16121,
29918,
5150,
29918,
13129,
29918,
392,
29918,
13221,
593,
29918,
2457,
29918,
29874,
29918,
7924,
29918,
21509,
29898,
1311,
1125,
13,
4706,
394,
625,
353,
1583,
29889,
5675,
29918,
1595,
12654,
424,
877,
284,
625,
1495,
13,
4706,
4800,
353,
525,
5630,
29915,
13,
4706,
394,
625,
29889,
5504,
29918,
5630,
29898,
5630,
29897,
13,
4706,
4817,
29918,
6672,
353,
289,
29915,
16616,
525,
718,
289,
29953,
29946,
12508,
29898,
877,
29995,
29879,
16664,
29879,
29915,
1273,
313,
284,
625,
29889,
333,
29892,
4800,
8106,
12508,
877,
294,
18869,
8785,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
742,
7331,
29918,
20656,
29950,
1955,
26664,
8098,
29922,
5150,
29918,
6672,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29906,
29900,
29900,
13,
4706,
4974,
3725,
13507,
451,
297,
364,
29889,
13662,
29889,
21509,
13,
13,
1678,
822,
1243,
29918,
16121,
29918,
5150,
29918,
5156,
15628,
29918,
6672,
29918,
18280,
29918,
29946,
29900,
29900,
29898,
1311,
1125,
13,
4706,
4817,
29918,
6672,
353,
289,
29915,
16616,
525,
718,
289,
29953,
29946,
12508,
29898,
29890,
29915,
12313,
1495,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
29954,
29916,
29911,
11219,
742,
7331,
29918,
20656,
29950,
1955,
26664,
8098,
29922,
5150,
29918,
6672,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29946,
29900,
29900,
13,
4706,
4974,
364,
29889,
726,
1275,
525,
22995,
15628,
376,
25471,
29908,
4839,
29915,
13,
13,
1678,
822,
1243,
29918,
16121,
29918,
5150,
29918,
12313,
29918,
1792,
333,
29918,
18280,
29918,
29946,
29900,
29896,
29898,
1311,
1125,
13,
4706,
4817,
29918,
6672,
353,
289,
29915,
16616,
525,
718,
289,
29953,
29946,
12508,
29898,
29890,
29915,
6406,
29901,
6406,
1495,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
29954,
29916,
29911,
11219,
742,
7331,
29918,
20656,
29950,
1955,
26664,
8098,
29922,
5150,
29918,
6672,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29946,
29900,
29896,
13,
13,
1678,
822,
1243,
29918,
16121,
29918,
5150,
29918,
1217,
29918,
5630,
29918,
18280,
29918,
29946,
29900,
29896,
29898,
1311,
1125,
13,
4706,
394,
625,
353,
1583,
29889,
5675,
29918,
1595,
12654,
424,
877,
284,
625,
1495,
13,
4706,
4974,
394,
625,
29889,
333,
1275,
29871,
29896,
13,
4706,
4817,
29918,
6672,
353,
289,
29915,
16616,
525,
718,
289,
29953,
29946,
12508,
29898,
29890,
29915,
29896,
29901,
1495,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
29954,
29916,
29911,
11219,
742,
7331,
29918,
20656,
29950,
1955,
26664,
8098,
29922,
5150,
29918,
6672,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29946,
29900,
29896,
13,
13,
1678,
822,
1243,
29918,
16044,
29918,
6672,
29918,
275,
29918,
690,
6021,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
12717,
29914,
16202,
742,
7331,
29918,
2477,
4741,
7982,
29922,
29890,
29915,
6214,
29914,
3126,
1495,
13,
4706,
4974,
364,
29889,
13662,
29961,
29890,
29915,
3916,
29899,
1542,
2033,
1275,
289,
29915,
6214,
29914,
3126,
29936,
17425,
29922,
10496,
29899,
29947,
29915,
13,
4706,
4390,
29889,
18132,
29898,
29878,
29889,
726,
29897,
13,
13,
1678,
822,
1243,
29918,
2704,
29918,
29879,
415,
29918,
13129,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
5438,
11219,
742,
5939,
9600,
29918,
6979,
29922,
8824,
29892,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29946,
29900,
29941,
13,
13,
1678,
822,
1243,
29918,
29883,
943,
29918,
275,
29918,
1333,
29918,
24622,
29918,
1609,
29918,
4381,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
1495,
13,
4706,
4974,
289,
29915,
6638,
29899,
4809,
29899,
15930,
29899,
23182,
29915,
451,
297,
364,
29889,
13662,
13,
13,
1678,
822,
1243,
29918,
29883,
943,
29918,
275,
29918,
24622,
29918,
1454,
29918,
16596,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
16596,
29914,
5880,
29889,
1195,
29889,
1315,
1495,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29906,
29900,
29900,
13,
4706,
4974,
364,
29889,
13662,
29961,
29890,
29915,
6638,
29899,
4809,
29899,
15930,
29899,
23182,
2033,
1275,
289,
29915,
29930,
29915,
13,
13,
1678,
822,
1243,
29918,
29883,
9733,
29918,
974,
29918,
16596,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
16596,
29914,
5880,
29889,
1195,
29889,
1315,
1495,
13,
4706,
4974,
364,
29889,
13662,
29961,
29890,
29915,
10408,
29899,
4809,
2033,
1275,
289,
29915,
3597,
29892,
4236,
29899,
482,
29922,
29941,
29953,
29900,
29900,
29915,
13,
4706,
4974,
289,
29915,
29963,
653,
29915,
451,
297,
364,
29889,
13662,
13,
4706,
4974,
451,
364,
29889,
13662,
29889,
21509,
13,
13,
1678,
822,
1243,
29918,
29883,
9733,
29918,
974,
29918,
16596,
29918,
2541,
29918,
300,
351,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
29898,
1311,
29889,
4645,
29889,
22942,
29889,
24129,
877,
5880,
29889,
1195,
29889,
1315,
8785,
13,
4706,
4974,
364,
29889,
13662,
29961,
29890,
29915,
10408,
29899,
4809,
2033,
1275,
289,
29915,
3597,
29892,
4236,
29899,
482,
29922,
29941,
29896,
29945,
29941,
29953,
29900,
29900,
29900,
29915,
13,
4706,
4974,
289,
29915,
29963,
653,
29915,
451,
297,
364,
29889,
13662,
13,
4706,
4974,
451,
364,
29889,
13662,
29889,
21509,
13,
13,
1678,
822,
1243,
29918,
29883,
9733,
29918,
974,
29918,
3601,
9884,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
1495,
13,
4706,
4974,
364,
29889,
13662,
29961,
29890,
29915,
10408,
29899,
4809,
2033,
1275,
289,
29915,
1217,
29899,
8173,
29915,
13,
4706,
4974,
289,
29915,
29963,
653,
29915,
451,
297,
364,
29889,
13662,
13,
13,
1678,
822,
1243,
29918,
1217,
29918,
2395,
9600,
29918,
21509,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
5438,
11219,
742,
5939,
9600,
29918,
6979,
29922,
8824,
29892,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29946,
29900,
29941,
13,
4706,
4974,
376,
22050,
315,
14098,
29943,
15327,
29908,
297,
364,
29889,
726,
13,
4706,
4974,
5939,
9600,
29889,
9295,
29934,
29943,
29918,
4986,
29968,
1430,
297,
364,
29889,
13662,
29889,
21509,
13,
13,
1678,
822,
1243,
29918,
1217,
29918,
2395,
9600,
29918,
21509,
29918,
26690,
29918,
5696,
29918,
265,
29918,
24129,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
27342,
877,
3904,
29968,
6632,
16048,
742,
8207,
16596,
29914,
3188,
29889,
4268,
742,
5939,
9600,
29918,
6979,
29922,
8824,
29892,
13,
462,
9651,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29906,
29900,
29900,
29871,
396,
445,
881,
367,
263,
29871,
29946,
29900,
29945,
29892,
393,
29915,
29879,
263,
376,
6152,
29908,
297,
408,
2238,
13,
13,
1678,
822,
1243,
29918,
12313,
29918,
2395,
9600,
29918,
21509,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
5438,
11219,
742,
5939,
9600,
29918,
6979,
2433,
12313,
29918,
29966,
25711,
17013,
29958,
742,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29946,
29900,
29941,
13,
4706,
4974,
376,
22050,
315,
14098,
29943,
15327,
29908,
297,
364,
29889,
726,
13,
4706,
4974,
364,
29889,
13662,
29889,
21509,
29961,
2395,
9600,
29889,
9295,
29934,
29943,
29918,
4986,
29968,
1430,
1822,
1767,
2804,
525,
12313,
29918,
6979,
29915,
13,
13,
1678,
822,
1243,
29918,
2395,
9600,
29918,
21509,
29918,
842,
29918,
1454,
29918,
3242,
29918,
24830,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
1495,
13,
4706,
4974,
5939,
9600,
29889,
9295,
29934,
29943,
29918,
4986,
29968,
1430,
297,
364,
29889,
13662,
29889,
21509,
13,
13,
1678,
822,
1243,
29918,
1217,
29918,
2395,
9600,
29918,
21509,
29918,
842,
29918,
1454,
29918,
16596,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
16596,
29914,
3188,
29889,
4268,
1495,
13,
4706,
4974,
5939,
9600,
29889,
9295,
29934,
29943,
29918,
4986,
29968,
1430,
451,
297,
364,
29889,
13662,
29889,
21509,
13,
13,
1678,
822,
1243,
29918,
28455,
277,
675,
29918,
6979,
29918,
3364,
267,
29918,
20678,
29918,
16773,
29918,
6979,
29898,
1311,
1125,
13,
4706,
5993,
353,
12801,
25711,
17013,
16299,
13,
4706,
4974,
5939,
9600,
3032,
28455,
277,
675,
29918,
6979,
29898,
6979,
29897,
1275,
5993,
13,
13,
1678,
822,
1243,
29918,
28455,
277,
675,
29918,
6979,
29918,
276,
622,
29879,
29918,
957,
5426,
29918,
6979,
29898,
1311,
1125,
13,
4706,
5993,
353,
525,
1289,
29881,
29966,
25711,
17013,
16299,
13,
4706,
4974,
5939,
9600,
3032,
28455,
277,
675,
29918,
6979,
29898,
6979,
29897,
338,
6213,
13,
13,
1678,
822,
1243,
29918,
28455,
277,
675,
29918,
6979,
29918,
276,
622,
29879,
29918,
5062,
5426,
29918,
6979,
29898,
1311,
1125,
13,
4706,
5993,
353,
525,
1289,
29881,
29966,
25711,
17013,
16299,
13,
4706,
4974,
5939,
9600,
3032,
28455,
277,
675,
29918,
6979,
29898,
6979,
29897,
338,
6213,
13,
13,
1678,
822,
1243,
29918,
28455,
277,
675,
29918,
6979,
29918,
276,
622,
29879,
29918,
1484,
974,
29891,
29918,
6979,
29898,
1311,
1125,
13,
4706,
5993,
353,
12801,
25711,
17013,
16299,
13,
4706,
4974,
5939,
9600,
3032,
28455,
277,
675,
29918,
6979,
29898,
6979,
29897,
338,
6213,
13,
13,
1678,
822,
1243,
29918,
5156,
15628,
29918,
2587,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
22995,
15628,
8434,
1125,
13,
9651,
1583,
29889,
4645,
29889,
5438,
11219,
742,
3573,
29922,
29890,
29915,
29874,
742,
2793,
29918,
1853,
29922,
29890,
29915,
6214,
29914,
3126,
1495,
13,
13,
1678,
822,
1243,
29918,
26690,
29918,
2587,
29918,
1853,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
14148,
8434,
1542,
1125,
13,
9651,
1583,
29889,
4645,
29889,
5438,
11219,
742,
3573,
29922,
29890,
29915,
29916,
742,
2793,
29918,
1853,
29922,
29890,
29915,
26690,
29914,
29916,
1495,
13,
13,
1678,
822,
1243,
29918,
5464,
29918,
8977,
29918,
2587,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
5438,
11219,
742,
3573,
29922,
29890,
29915,
2636,
742,
2793,
29918,
1853,
29922,
29890,
29915,
6214,
29914,
3126,
1495,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29906,
29900,
29900,
13,
13,
1678,
822,
1243,
29918,
1217,
29918,
3018,
6504,
29918,
17057,
29918,
17886,
29879,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
5431,
742,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29946,
29900,
29946,
29892,
364,
29889,
726,
13,
13,
1678,
822,
1243,
29918,
4304,
29918,
10389,
29918,
9902,
29918,
262,
29918,
29946,
29900,
29900,
29898,
1311,
1125,
13,
4706,
364,
353,
1583,
29889,
4645,
29889,
7194,
11219,
5431,
29995,
29900,
29900,
742,
12020,
29918,
326,
4210,
2486,
29922,
8824,
29897,
13,
4706,
4974,
364,
29889,
401,
1275,
29871,
29946,
29900,
29900,
29892,
364,
29889,
726,
13,
2
] |
problems/ic_45_graph_coloring.py | gregdferrell/algo | 0 | 94273 | <reponame>gregdferrell/algo
#
# Problem: Given an undirected graph with maximum degree, find a graph coloring using at most D+1 colors.
#
def color_graph_first_available(graph, colors):
"""
Solution: For each graph node, assign to it the first color not in the list of neighbor colors.
Complexity: (where n is # nodes, d is max degrees)
Time: O(n * (d + d+1 + 1)) -> O(n * d)
Space: O(g) -> size of graph
"""
# For every node
for node in graph:
if node in node.neighbors:
raise ValueError('cannot color graph with node loops')
# Look at each neighbor and create a set of their colors
neighbor_colors = set([neighbor.color for neighbor in node.neighbors if neighbor.color])
# Look at each color and create a set of available colors not in the neighbor colors set
available_colors = [color for color in colors if color not in neighbor_colors]
# Take the first available
node.color = available_colors[0]
def color_graph_first_available_slightly_faster(graph, colors):
"""
Solution: For each graph node, assign to it the first available color not used by one of its neighbors.
Complexity: (where n is # nodes, d is max degrees)
Time: O(n * d)
Space: O(g) -> size of graph
"""
for node in graph:
if node in node.neighbors:
raise ValueError('cannot color graph with node loops')
# Look at each neighbor and create a set of their colors
neighbor_colors = set([neighbor.color for neighbor in node.neighbors if neighbor.color])
for color in colors:
if color not in neighbor_colors:
node.color = color
break
| [
1,
529,
276,
1112,
420,
29958,
7642,
29881,
571,
15044,
29914,
284,
1484,
13,
29937,
13,
29937,
11583,
29901,
11221,
385,
563,
1088,
287,
3983,
411,
7472,
7426,
29892,
1284,
263,
3983,
2927,
292,
773,
472,
1556,
360,
29974,
29896,
11955,
29889,
13,
29937,
13,
13,
13,
1753,
2927,
29918,
4262,
29918,
4102,
29918,
16515,
29898,
4262,
29892,
11955,
1125,
13,
12,
15945,
29908,
13,
12,
13296,
918,
29901,
1152,
1269,
3983,
2943,
29892,
3566,
304,
372,
278,
937,
2927,
451,
297,
278,
1051,
310,
12307,
11955,
29889,
13,
12,
8909,
29916,
537,
29901,
313,
3062,
302,
338,
396,
7573,
29892,
270,
338,
4236,
14496,
29897,
13,
12,
12,
2481,
29901,
438,
29898,
29876,
334,
313,
29881,
718,
270,
29974,
29896,
718,
29871,
29896,
876,
1599,
438,
29898,
29876,
334,
270,
29897,
13,
12,
12,
14936,
29901,
438,
29898,
29887,
29897,
1599,
2159,
310,
3983,
13,
12,
15945,
29908,
13,
12,
29937,
1152,
1432,
2943,
13,
12,
1454,
2943,
297,
3983,
29901,
13,
12,
12,
361,
2943,
297,
2943,
29889,
484,
1141,
29890,
943,
29901,
13,
12,
12,
12,
22692,
7865,
2392,
877,
29883,
6735,
2927,
3983,
411,
2943,
12104,
1495,
13,
13,
12,
12,
29937,
7419,
472,
1269,
12307,
322,
1653,
263,
731,
310,
1009,
11955,
13,
12,
12,
484,
1141,
4089,
29918,
27703,
353,
731,
4197,
484,
1141,
4089,
29889,
2780,
363,
12307,
297,
2943,
29889,
484,
1141,
29890,
943,
565,
12307,
29889,
2780,
2314,
13,
12,
12,
29937,
7419,
472,
1269,
2927,
322,
1653,
263,
731,
310,
3625,
11955,
451,
297,
278,
12307,
11955,
731,
13,
12,
12,
16515,
29918,
27703,
353,
518,
2780,
363,
2927,
297,
11955,
565,
2927,
451,
297,
12307,
29918,
27703,
29962,
13,
12,
12,
29937,
11190,
278,
937,
3625,
13,
12,
12,
3177,
29889,
2780,
353,
3625,
29918,
27703,
29961,
29900,
29962,
13,
13,
13,
1753,
2927,
29918,
4262,
29918,
4102,
29918,
16515,
29918,
2536,
523,
368,
29918,
29888,
1901,
29898,
4262,
29892,
11955,
1125,
13,
12,
15945,
29908,
13,
12,
13296,
918,
29901,
1152,
1269,
3983,
2943,
29892,
3566,
304,
372,
278,
937,
3625,
2927,
451,
1304,
491,
697,
310,
967,
22092,
943,
29889,
13,
12,
8909,
29916,
537,
29901,
313,
3062,
302,
338,
396,
7573,
29892,
270,
338,
4236,
14496,
29897,
13,
12,
12,
2481,
29901,
438,
29898,
29876,
334,
270,
29897,
13,
12,
12,
14936,
29901,
438,
29898,
29887,
29897,
1599,
2159,
310,
3983,
13,
12,
15945,
29908,
13,
12,
1454,
2943,
297,
3983,
29901,
13,
12,
12,
361,
2943,
297,
2943,
29889,
484,
1141,
29890,
943,
29901,
13,
12,
12,
12,
22692,
7865,
2392,
877,
29883,
6735,
2927,
3983,
411,
2943,
12104,
1495,
13,
13,
12,
12,
29937,
7419,
472,
1269,
12307,
322,
1653,
263,
731,
310,
1009,
11955,
13,
12,
12,
484,
1141,
4089,
29918,
27703,
353,
731,
4197,
484,
1141,
4089,
29889,
2780,
363,
12307,
297,
2943,
29889,
484,
1141,
29890,
943,
565,
12307,
29889,
2780,
2314,
13,
13,
12,
12,
1454,
2927,
297,
11955,
29901,
13,
12,
12,
12,
361,
2927,
451,
297,
12307,
29918,
27703,
29901,
13,
12,
12,
12,
12,
3177,
29889,
2780,
353,
2927,
13,
12,
12,
12,
12,
8690,
13,
2
] |
script/testing/reporting/parsers/oltpbench/res_parser.py | weijietong/noisepage | 2 | 83861 | import csv
import json
from reporting.utils import get_value_by_pattern
from reporting.constants import LATENCY_ATTRIBUTE_MAPPING
def parse_res_file(path):
"""Read data from file ends with ".res".
Args:
path (str): The position of the res file.
Returns:
incremental_metrics (list, json array): The throughput at different time.
"""
with open(path) as csvfile:
reader = csv.DictReader(csvfile, delimiter=',')
incremental_metrics = []
for row in reader:
metrics_instance = {
"time": float(get_value_by_pattern(row, 'time', None)),
"throughput": float(get_value_by_pattern(row, 'throughput', None))
}
latency = {}
for key, pattern in LATENCY_ATTRIBUTE_MAPPING:
value = get_value_by_pattern(row, pattern, None)
latency[key] = float("{:.4}".format(value)) if value else value
metrics_instance['latency'] = latency
incremental_metrics.append(metrics_instance)
return incremental_metrics
| [
1,
1053,
11799,
13,
5215,
4390,
13,
13,
3166,
23415,
29889,
13239,
1053,
679,
29918,
1767,
29918,
1609,
29918,
11037,
13,
3166,
23415,
29889,
3075,
1934,
1053,
365,
1299,
1430,
29907,
29979,
29918,
1299,
29911,
3960,
29933,
26027,
29918,
1529,
18009,
4214,
13,
13,
13,
1753,
6088,
29918,
690,
29918,
1445,
29898,
2084,
1125,
13,
1678,
9995,
6359,
848,
515,
934,
10614,
411,
11393,
690,
1642,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
2224,
313,
710,
1125,
450,
2602,
310,
278,
620,
934,
29889,
13,
13,
1678,
16969,
29901,
13,
4706,
11924,
284,
29918,
2527,
10817,
313,
1761,
29892,
4390,
1409,
1125,
450,
1549,
649,
472,
1422,
931,
29889,
13,
13,
1678,
9995,
13,
1678,
411,
1722,
29898,
2084,
29897,
408,
11799,
1445,
29901,
13,
4706,
9591,
353,
11799,
29889,
21533,
6982,
29898,
7638,
1445,
29892,
28552,
29922,
742,
1495,
13,
4706,
11924,
284,
29918,
2527,
10817,
353,
5159,
13,
4706,
363,
1948,
297,
9591,
29901,
13,
9651,
21556,
29918,
8758,
353,
426,
13,
18884,
376,
2230,
1115,
5785,
29898,
657,
29918,
1767,
29918,
1609,
29918,
11037,
29898,
798,
29892,
525,
2230,
742,
6213,
8243,
13,
18884,
376,
20678,
649,
1115,
5785,
29898,
657,
29918,
1767,
29918,
1609,
29918,
11037,
29898,
798,
29892,
525,
20678,
649,
742,
6213,
876,
13,
9651,
500,
13,
9651,
23316,
1270,
353,
6571,
13,
9651,
363,
1820,
29892,
4766,
297,
365,
1299,
1430,
29907,
29979,
29918,
1299,
29911,
3960,
29933,
26027,
29918,
1529,
18009,
4214,
29901,
13,
18884,
995,
353,
679,
29918,
1767,
29918,
1609,
29918,
11037,
29898,
798,
29892,
4766,
29892,
6213,
29897,
13,
18884,
23316,
1270,
29961,
1989,
29962,
353,
5785,
703,
25641,
29889,
29946,
29913,
1642,
4830,
29898,
1767,
876,
565,
995,
1683,
995,
13,
9651,
21556,
29918,
8758,
1839,
29880,
2579,
1270,
2033,
353,
23316,
1270,
13,
9651,
11924,
284,
29918,
2527,
10817,
29889,
4397,
29898,
2527,
10817,
29918,
8758,
29897,
13,
4706,
736,
11924,
284,
29918,
2527,
10817,
13,
2
] |
planbee/tracking/planbee_models/bee_tracking_object.py | Plan-Bee/planbee_yolov5 | 0 | 43254 | import math
from .hive_position import HivePosition
from .bee_movement import BeeMovement
class BeeTrackingObject:
object_id: int
start_frame_id: int
end_frame_id: int
end_age: int
position_estimates: [(int, int)]
angle: int = -1 # 0° is if the bee flies "to the right on the x-axis". Angle turns clockwise
flight_distance: float
flies_out_of_frame: bool
bee_movement: BeeMovement
def __init__(self, object_id: int, start_frame_id: int, age: int, initial_estimate: tuple):
self.object_id = object_id
self.start_frame_id = start_frame_id
self.end_frame_id = start_frame_id
self.end_age = age
self.position_estimates = [initial_estimate]
def _calculate_directions(self, hive_position: HivePosition, moving_offset: int):
"""
Calculates where the bee is going to
Args:
hive_position: The position of the hive in the frame
moving_offset: In pixels on the frame. Has to be calculated based on the image resolution!
"""
# Check if the bee moves more than the required offset
if self.flight_distance < moving_offset:
self.bee_movement = BeeMovement.NO_MOVEMENT
return
# Calculate angles
greater_than_angle = (hive_position.value - 90) % 360
smaller_than_angle = (hive_position.value + 90) % 360
start_coordinates = self.position_estimates[0]
end_coordinates = self.position_estimates[-1]
x_difference = end_coordinates[0] - start_coordinates[0]
y_difference = end_coordinates[1] - start_coordinates[1]
self.angle = int(math.degrees(math.atan2(y_difference, x_difference)) % 360)
if greater_than_angle < smaller_than_angle:
# HivePos.LEFT: greater than: 90, smaller than: 270
# Bee: 300 Deg
# Bee flies away -> is between angles has to be FALSE
is_between_angles = self.angle in range(greater_than_angle, smaller_than_angle)
else:
# HivePos.RIGHT: greater than: 270, smaller than: 90
# Bee: 300 Deg
# Bee flies to hive -> is between angles has to be TRUE
is_between_angles = self.angle not in range(smaller_than_angle, greater_than_angle)
if self.flies_out_of_frame and is_between_angles:
self.bee_movement = BeeMovement.TO_HIVE
elif self.flies_out_of_frame:
self.bee_movement = BeeMovement.FROM_HIVE
else:
self.bee_movement = BeeMovement.NO_MOVEMENT
# print(f'{self.object_id}: {self.angle} ({x_difference}, {y_difference}), to: {flies_to}')
def _calculate_distances(self):
start_coordinates = self.position_estimates[0]
end_coordinates = self.position_estimates[-1]
x_difference = end_coordinates[0] - start_coordinates[0]
y_difference = end_coordinates[1] - start_coordinates[1]
hypo = math.sqrt(x_difference ** 2 + y_difference ** 2)
self.flight_distance = hypo
def determine_movement(self, hive_position, moving_offset):
self._calculate_distances()
self._calculate_directions(hive_position, moving_offset)
def get_attribute_dict(self) -> dict:
return {
'object_id': self.object_id,
'start_frame_id': self.start_frame_id,
'end_frame_id': self.end_frame_id,
'end_age': self.end_age,
'estimates': self.position_estimates,
'angle': self.angle,
'flight_distance': self.flight_distance,
'flies_out_of_frame': self.flies_out_of_frame,
'bee_movement': self.bee_movement.name
}
| [
1,
1053,
5844,
13,
13,
3166,
869,
29882,
573,
29918,
3283,
1053,
379,
573,
8003,
13,
3166,
869,
915,
29872,
29918,
13529,
882,
1053,
1522,
29872,
29924,
586,
882,
13,
13,
13,
1990,
1522,
29872,
17936,
292,
2061,
29901,
13,
12,
3318,
29918,
333,
29901,
938,
13,
12,
2962,
29918,
2557,
29918,
333,
29901,
938,
13,
12,
355,
29918,
2557,
29918,
333,
29901,
938,
13,
12,
355,
29918,
482,
29901,
938,
13,
12,
3283,
29918,
342,
326,
1078,
29901,
17288,
524,
29892,
938,
4638,
13,
12,
2521,
29901,
938,
353,
448,
29896,
29871,
396,
29871,
29900,
30073,
338,
565,
278,
367,
29872,
285,
3687,
376,
517,
278,
1492,
373,
278,
921,
29899,
8990,
1642,
3218,
280,
12169,
12006,
3538,
13,
12,
1579,
523,
29918,
19244,
29901,
5785,
13,
12,
29888,
3687,
29918,
449,
29918,
974,
29918,
2557,
29901,
6120,
13,
12,
915,
29872,
29918,
13529,
882,
29901,
1522,
29872,
29924,
586,
882,
13,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
1203,
29918,
333,
29901,
938,
29892,
1369,
29918,
2557,
29918,
333,
29901,
938,
29892,
5046,
29901,
938,
29892,
2847,
29918,
342,
6490,
29901,
18761,
1125,
13,
12,
12,
1311,
29889,
3318,
29918,
333,
353,
1203,
29918,
333,
13,
12,
12,
1311,
29889,
2962,
29918,
2557,
29918,
333,
353,
1369,
29918,
2557,
29918,
333,
13,
12,
12,
1311,
29889,
355,
29918,
2557,
29918,
333,
353,
1369,
29918,
2557,
29918,
333,
13,
12,
12,
1311,
29889,
355,
29918,
482,
353,
5046,
13,
12,
12,
1311,
29889,
3283,
29918,
342,
326,
1078,
353,
518,
11228,
29918,
342,
6490,
29962,
13,
13,
12,
1753,
903,
15807,
403,
29918,
20146,
1953,
29898,
1311,
29892,
298,
573,
29918,
3283,
29901,
379,
573,
8003,
29892,
8401,
29918,
10289,
29901,
938,
1125,
13,
12,
12,
15945,
29908,
13,
12,
12,
27065,
1078,
988,
278,
367,
29872,
338,
2675,
304,
13,
13,
12,
12,
7883,
29901,
13,
12,
12,
12,
29882,
573,
29918,
3283,
29901,
450,
2602,
310,
278,
298,
573,
297,
278,
3515,
13,
12,
12,
12,
13529,
292,
29918,
10289,
29901,
512,
17036,
373,
278,
3515,
29889,
11699,
304,
367,
12833,
2729,
373,
278,
1967,
10104,
29991,
13,
12,
12,
15945,
29908,
13,
12,
12,
29937,
5399,
565,
278,
367,
29872,
16229,
901,
1135,
278,
3734,
9210,
13,
12,
12,
361,
1583,
29889,
1579,
523,
29918,
19244,
529,
8401,
29918,
10289,
29901,
13,
12,
12,
12,
1311,
29889,
915,
29872,
29918,
13529,
882,
353,
1522,
29872,
29924,
586,
882,
29889,
6632,
29918,
6720,
12064,
13780,
13,
12,
12,
12,
2457,
13,
13,
12,
12,
29937,
20535,
403,
23619,
13,
12,
12,
7979,
1008,
29918,
27603,
29918,
2521,
353,
313,
29882,
573,
29918,
3283,
29889,
1767,
448,
29871,
29929,
29900,
29897,
1273,
29871,
29941,
29953,
29900,
13,
12,
12,
9278,
261,
29918,
27603,
29918,
2521,
353,
313,
29882,
573,
29918,
3283,
29889,
1767,
718,
29871,
29929,
29900,
29897,
1273,
29871,
29941,
29953,
29900,
13,
13,
12,
12,
2962,
29918,
1111,
24266,
353,
1583,
29889,
3283,
29918,
342,
326,
1078,
29961,
29900,
29962,
13,
12,
12,
355,
29918,
1111,
24266,
353,
1583,
29889,
3283,
29918,
342,
326,
1078,
14352,
29896,
29962,
13,
13,
12,
12,
29916,
29918,
29881,
17678,
353,
1095,
29918,
1111,
24266,
29961,
29900,
29962,
448,
1369,
29918,
1111,
24266,
29961,
29900,
29962,
13,
12,
12,
29891,
29918,
29881,
17678,
353,
1095,
29918,
1111,
24266,
29961,
29896,
29962,
448,
1369,
29918,
1111,
24266,
29961,
29896,
29962,
13,
13,
12,
12,
1311,
29889,
2521,
353,
938,
29898,
755,
29889,
311,
7979,
267,
29898,
755,
29889,
23402,
29906,
29898,
29891,
29918,
29881,
17678,
29892,
921,
29918,
29881,
17678,
876,
1273,
29871,
29941,
29953,
29900,
29897,
13,
13,
12,
12,
361,
7621,
29918,
27603,
29918,
2521,
529,
7968,
29918,
27603,
29918,
2521,
29901,
13,
12,
12,
12,
29937,
379,
573,
9135,
29889,
28024,
29901,
7621,
1135,
29901,
29871,
29929,
29900,
29892,
7968,
1135,
29901,
29871,
29906,
29955,
29900,
13,
12,
12,
12,
29937,
1522,
29872,
29901,
29871,
29941,
29900,
29900,
360,
387,
13,
12,
12,
12,
29937,
1522,
29872,
285,
3687,
3448,
1599,
338,
1546,
23619,
756,
304,
367,
17131,
13,
12,
12,
12,
275,
29918,
14811,
29918,
19536,
353,
1583,
29889,
2521,
297,
3464,
29898,
7979,
1008,
29918,
27603,
29918,
2521,
29892,
7968,
29918,
27603,
29918,
2521,
29897,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
29937,
379,
573,
9135,
29889,
22789,
3912,
29901,
7621,
1135,
29901,
29871,
29906,
29955,
29900,
29892,
7968,
1135,
29901,
29871,
29929,
29900,
13,
12,
12,
12,
29937,
1522,
29872,
29901,
29871,
29941,
29900,
29900,
360,
387,
13,
12,
12,
12,
29937,
1522,
29872,
285,
3687,
304,
298,
573,
1599,
338,
1546,
23619,
756,
304,
367,
15676,
13,
12,
12,
12,
275,
29918,
14811,
29918,
19536,
353,
1583,
29889,
2521,
451,
297,
3464,
29898,
9278,
261,
29918,
27603,
29918,
2521,
29892,
7621,
29918,
27603,
29918,
2521,
29897,
13,
13,
12,
12,
361,
1583,
29889,
29888,
3687,
29918,
449,
29918,
974,
29918,
2557,
322,
338,
29918,
14811,
29918,
19536,
29901,
13,
12,
12,
12,
1311,
29889,
915,
29872,
29918,
13529,
882,
353,
1522,
29872,
29924,
586,
882,
29889,
4986,
29918,
29950,
18474,
13,
12,
12,
23681,
1583,
29889,
29888,
3687,
29918,
449,
29918,
974,
29918,
2557,
29901,
13,
12,
12,
12,
1311,
29889,
915,
29872,
29918,
13529,
882,
353,
1522,
29872,
29924,
586,
882,
29889,
21482,
29918,
29950,
18474,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
1311,
29889,
915,
29872,
29918,
13529,
882,
353,
1522,
29872,
29924,
586,
882,
29889,
6632,
29918,
6720,
12064,
13780,
13,
13,
12,
29937,
1596,
29898,
29888,
29915,
29912,
1311,
29889,
3318,
29918,
333,
6177,
426,
1311,
29889,
2521,
29913,
21313,
29916,
29918,
29881,
17678,
1118,
426,
29891,
29918,
29881,
17678,
9594,
304,
29901,
426,
29888,
3687,
29918,
517,
29913,
1495,
13,
13,
12,
1753,
903,
15807,
403,
29918,
5721,
2925,
29898,
1311,
1125,
13,
12,
12,
2962,
29918,
1111,
24266,
353,
1583,
29889,
3283,
29918,
342,
326,
1078,
29961,
29900,
29962,
13,
12,
12,
355,
29918,
1111,
24266,
353,
1583,
29889,
3283,
29918,
342,
326,
1078,
14352,
29896,
29962,
13,
13,
12,
12,
29916,
29918,
29881,
17678,
353,
1095,
29918,
1111,
24266,
29961,
29900,
29962,
448,
1369,
29918,
1111,
24266,
29961,
29900,
29962,
13,
12,
12,
29891,
29918,
29881,
17678,
353,
1095,
29918,
1111,
24266,
29961,
29896,
29962,
448,
1369,
29918,
1111,
24266,
29961,
29896,
29962,
13,
13,
12,
12,
5819,
1129,
353,
5844,
29889,
3676,
29898,
29916,
29918,
29881,
17678,
3579,
29871,
29906,
718,
343,
29918,
29881,
17678,
3579,
29871,
29906,
29897,
13,
13,
12,
12,
1311,
29889,
1579,
523,
29918,
19244,
353,
7498,
1129,
13,
13,
12,
1753,
8161,
29918,
13529,
882,
29898,
1311,
29892,
298,
573,
29918,
3283,
29892,
8401,
29918,
10289,
1125,
13,
12,
12,
1311,
3032,
15807,
403,
29918,
5721,
2925,
580,
13,
12,
12,
1311,
3032,
15807,
403,
29918,
20146,
1953,
29898,
29882,
573,
29918,
3283,
29892,
8401,
29918,
10289,
29897,
13,
13,
12,
1753,
679,
29918,
12715,
29918,
8977,
29898,
1311,
29897,
1599,
9657,
29901,
13,
12,
12,
2457,
426,
13,
12,
12,
12,
29915,
3318,
29918,
333,
2396,
1583,
29889,
3318,
29918,
333,
29892,
13,
12,
12,
12,
29915,
2962,
29918,
2557,
29918,
333,
2396,
1583,
29889,
2962,
29918,
2557,
29918,
333,
29892,
13,
12,
12,
12,
29915,
355,
29918,
2557,
29918,
333,
2396,
1583,
29889,
355,
29918,
2557,
29918,
333,
29892,
13,
12,
12,
12,
29915,
355,
29918,
482,
2396,
1583,
29889,
355,
29918,
482,
29892,
13,
12,
12,
12,
29915,
342,
326,
1078,
2396,
1583,
29889,
3283,
29918,
342,
326,
1078,
29892,
13,
12,
12,
12,
29915,
2521,
2396,
1583,
29889,
2521,
29892,
13,
12,
12,
12,
29915,
1579,
523,
29918,
19244,
2396,
1583,
29889,
1579,
523,
29918,
19244,
29892,
13,
12,
12,
12,
29915,
29888,
3687,
29918,
449,
29918,
974,
29918,
2557,
2396,
1583,
29889,
29888,
3687,
29918,
449,
29918,
974,
29918,
2557,
29892,
13,
12,
12,
12,
29915,
915,
29872,
29918,
13529,
882,
2396,
1583,
29889,
915,
29872,
29918,
13529,
882,
29889,
978,
13,
12,
12,
29913,
13,
2
] |
calculator/operations/calculation.py | jharilal/calculator_assignment | 0 | 194341 | """This is the calculation class / abstraction class"""
class Calculation:
"""Creates the Calculation parent class for the arithmetic subclasses"""
# pylint: disable=bad-option-value, too-few-public-methods
def __init__(self, values: tuple):
"""Constructor Method"""
self.values = Calculation.convert_to_float(values)
@classmethod
def create(cls, values: tuple):
"""Creates an object"""
return cls(values)
@staticmethod
def convert_to_float(values):
"""Converts the values passed to function into float values in a list"""
list_of_floats = []
for item in values:
list_of_floats.append(float(item))
return tuple(list_of_floats)
| [
1,
9995,
4013,
338,
278,
13944,
770,
847,
27086,
428,
770,
15945,
29908,
13,
13,
13,
1990,
20535,
362,
29901,
13,
1678,
9995,
9832,
1078,
278,
20535,
362,
3847,
770,
363,
278,
23342,
1014,
13203,
15945,
29908,
13,
1678,
396,
282,
2904,
524,
29901,
11262,
29922,
12313,
29899,
3385,
29899,
1767,
29892,
2086,
29899,
29888,
809,
29899,
3597,
29899,
23515,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1819,
29901,
18761,
1125,
13,
4706,
9995,
23770,
8108,
15945,
29908,
13,
4706,
1583,
29889,
5975,
353,
20535,
362,
29889,
13441,
29918,
517,
29918,
7411,
29898,
5975,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1653,
29898,
25932,
29892,
1819,
29901,
18761,
1125,
13,
4706,
9995,
9832,
1078,
385,
1203,
15945,
29908,
13,
4706,
736,
1067,
29879,
29898,
5975,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
3588,
29918,
517,
29918,
7411,
29898,
5975,
1125,
13,
4706,
9995,
1168,
369,
1372,
278,
1819,
4502,
304,
740,
964,
5785,
1819,
297,
263,
1051,
15945,
29908,
13,
4706,
1051,
29918,
974,
29918,
29888,
417,
1446,
353,
5159,
13,
4706,
363,
2944,
297,
1819,
29901,
13,
9651,
1051,
29918,
974,
29918,
29888,
417,
1446,
29889,
4397,
29898,
7411,
29898,
667,
876,
13,
4706,
736,
18761,
29898,
1761,
29918,
974,
29918,
29888,
417,
1446,
29897,
13,
13,
13,
2
] |
Tests/test_hook_manager.py | joshuaboniface/kalliope | 1 | 137430 | import unittest
import os
import mock as mock
import inspect
import shutil
from kalliope.core.Models import Singleton
from kalliope.core.ConfigurationManager import SettingLoader
from kalliope.core import HookManager
from kalliope.core.Models.Settings import Settings
class TestInit(unittest.TestCase):
def setUp(self):
# Init the folders, otherwise it raises an exceptions
os.makedirs("/tmp/kalliope/tests/kalliope_resources_dir/neurons")
os.makedirs("/tmp/kalliope/tests/kalliope_resources_dir/stt")
os.makedirs("/tmp/kalliope/tests/kalliope_resources_dir/tts")
os.makedirs("/tmp/kalliope/tests/kalliope_resources_dir/trigger")
# get current script directory path. We are in /an/unknown/path/kalliope/core/tests
cur_script_directory = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
# get parent dir. Now we are in /an/unknown/path/kalliope
root_dir = os.path.normpath(cur_script_directory + os.sep + os.pardir)
self.settings_file_to_test = root_dir + os.sep + "Tests/settings/settings_test.yml"
self.settings = SettingLoader(file_path=self.settings_file_to_test)
def tearDown(self):
# Cleanup
shutil.rmtree('/tmp/kalliope/tests/kalliope_resources_dir')
Singleton._instances = {}
def test_on_start(self):
"""
test list of synapse
"""
with mock.patch("kalliope.core.SynapseLauncher.start_synapse_by_list_name") as mock_synapse_launcher:
HookManager.on_start()
mock_synapse_launcher.assert_called_with(["on-start-synapse", "bring-led-on"], new_lifo=True)
mock_synapse_launcher.reset_mock()
def test_on_waiting_for_trigger(self):
"""
test with single synapse
"""
with mock.patch("kalliope.core.SynapseLauncher.start_synapse_by_name") as mock_synapse_launcher:
HookManager.on_waiting_for_trigger()
mock_synapse_launcher.assert_called_with("test", new_lifo=True)
mock_synapse_launcher.reset_mock()
def test_on_triggered(self):
with mock.patch("kalliope.core.SynapseLauncher.start_synapse_by_list_name") as mock_synapse_launcher:
HookManager.on_triggered()
mock_synapse_launcher.assert_called_with(["on-triggered-synapse"], new_lifo=True)
mock_synapse_launcher.reset_mock()
def test_on_start_listening(self):
self.assertIsNone(HookManager.on_start_listening())
def test_on_stop_listening(self):
self.assertIsNone(HookManager.on_stop_listening())
def test_on_order_found(self):
self.assertIsNone(HookManager.on_order_found())
def test_on_order_not_found(self):
with mock.patch("kalliope.core.SynapseLauncher.start_synapse_by_list_name") as mock_synapse_launcher:
HookManager.on_order_not_found()
mock_synapse_launcher.assert_called_with(["order-not-found-synapse"], new_lifo=True)
mock_synapse_launcher.reset_mock()
def test_on_mute(self):
"""
test that empty list of synapse return none
"""
self.assertIsNone(HookManager.on_mute())
if __name__ == '__main__':
unittest.main()
# suite = unittest.TestSuite()
# suite.addTest(TestInit("test_main"))
# runner = unittest.TextTestRunner()
# runner.run(suite)
| [
1,
1053,
443,
27958,
13,
5215,
2897,
13,
5215,
11187,
408,
11187,
13,
5215,
16096,
13,
5215,
528,
4422,
13,
13,
3166,
25364,
492,
2300,
29889,
3221,
29889,
23785,
1053,
6106,
11285,
13,
13,
3166,
25364,
492,
2300,
29889,
3221,
29889,
8614,
3260,
1053,
21605,
10036,
13,
13,
3166,
25364,
492,
2300,
29889,
3221,
1053,
29612,
3260,
13,
3166,
25364,
492,
2300,
29889,
3221,
29889,
23785,
29889,
9585,
1053,
19215,
13,
13,
13,
1990,
4321,
6644,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
396,
10886,
278,
16495,
29892,
6467,
372,
1153,
4637,
385,
15283,
13,
4706,
2897,
29889,
29885,
12535,
12935,
11974,
7050,
29914,
11311,
492,
2300,
29914,
21150,
29914,
11311,
492,
2300,
29918,
13237,
29918,
3972,
29914,
16115,
787,
1159,
13,
4706,
2897,
29889,
29885,
12535,
12935,
11974,
7050,
29914,
11311,
492,
2300,
29914,
21150,
29914,
11311,
492,
2300,
29918,
13237,
29918,
3972,
29914,
303,
29873,
1159,
13,
4706,
2897,
29889,
29885,
12535,
12935,
11974,
7050,
29914,
11311,
492,
2300,
29914,
21150,
29914,
11311,
492,
2300,
29918,
13237,
29918,
3972,
29914,
698,
29879,
1159,
13,
4706,
2897,
29889,
29885,
12535,
12935,
11974,
7050,
29914,
11311,
492,
2300,
29914,
21150,
29914,
11311,
492,
2300,
29918,
13237,
29918,
3972,
29914,
21001,
1159,
13,
13,
4706,
396,
679,
1857,
2471,
3884,
2224,
29889,
1334,
526,
297,
847,
273,
29914,
26690,
29914,
2084,
29914,
11311,
492,
2300,
29914,
3221,
29914,
21150,
13,
4706,
3151,
29918,
2154,
29918,
12322,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
29898,
1144,
1103,
29889,
657,
1445,
29898,
1144,
1103,
29889,
3784,
2557,
580,
4961,
13,
4706,
396,
679,
3847,
4516,
29889,
2567,
591,
526,
297,
847,
273,
29914,
26690,
29914,
2084,
29914,
11311,
492,
2300,
13,
4706,
3876,
29918,
3972,
353,
2897,
29889,
2084,
29889,
12324,
2084,
29898,
2764,
29918,
2154,
29918,
12322,
718,
2897,
29889,
19570,
718,
2897,
29889,
29886,
538,
381,
29897,
13,
13,
4706,
1583,
29889,
11027,
29918,
1445,
29918,
517,
29918,
1688,
353,
3876,
29918,
3972,
718,
2897,
29889,
19570,
718,
376,
24376,
29914,
11027,
29914,
11027,
29918,
1688,
29889,
21053,
29908,
13,
4706,
1583,
29889,
11027,
353,
21605,
10036,
29898,
1445,
29918,
2084,
29922,
1311,
29889,
11027,
29918,
1445,
29918,
517,
29918,
1688,
29897,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
396,
315,
14044,
786,
13,
4706,
528,
4422,
29889,
1758,
8336,
11219,
7050,
29914,
11311,
492,
2300,
29914,
21150,
29914,
11311,
492,
2300,
29918,
13237,
29918,
3972,
1495,
13,
13,
4706,
6106,
11285,
3032,
2611,
2925,
353,
6571,
13,
13,
1678,
822,
1243,
29918,
265,
29918,
2962,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
1243,
1051,
310,
5222,
481,
344,
13,
4706,
9995,
13,
4706,
411,
11187,
29889,
5041,
703,
11311,
492,
2300,
29889,
3221,
29889,
29216,
481,
344,
17641,
261,
29889,
2962,
29918,
19274,
481,
344,
29918,
1609,
29918,
1761,
29918,
978,
1159,
408,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29901,
13,
9651,
29612,
3260,
29889,
265,
29918,
2962,
580,
13,
9651,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29889,
9294,
29918,
13998,
29918,
2541,
29898,
3366,
265,
29899,
2962,
29899,
19274,
481,
344,
613,
376,
1182,
292,
29899,
839,
29899,
265,
12436,
716,
29918,
29880,
361,
29877,
29922,
5574,
29897,
13,
9651,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29889,
12071,
29918,
17640,
580,
13,
13,
1678,
822,
1243,
29918,
265,
29918,
10685,
292,
29918,
1454,
29918,
21001,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
1243,
411,
2323,
5222,
481,
344,
29871,
13,
4706,
9995,
13,
4706,
411,
11187,
29889,
5041,
703,
11311,
492,
2300,
29889,
3221,
29889,
29216,
481,
344,
17641,
261,
29889,
2962,
29918,
19274,
481,
344,
29918,
1609,
29918,
978,
1159,
408,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29901,
13,
9651,
29612,
3260,
29889,
265,
29918,
10685,
292,
29918,
1454,
29918,
21001,
580,
13,
9651,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29889,
9294,
29918,
13998,
29918,
2541,
703,
1688,
613,
716,
29918,
29880,
361,
29877,
29922,
5574,
29897,
13,
9651,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29889,
12071,
29918,
17640,
580,
13,
13,
1678,
822,
1243,
29918,
265,
29918,
21001,
287,
29898,
1311,
1125,
13,
4706,
411,
11187,
29889,
5041,
703,
11311,
492,
2300,
29889,
3221,
29889,
29216,
481,
344,
17641,
261,
29889,
2962,
29918,
19274,
481,
344,
29918,
1609,
29918,
1761,
29918,
978,
1159,
408,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29901,
13,
9651,
29612,
3260,
29889,
265,
29918,
21001,
287,
580,
13,
9651,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29889,
9294,
29918,
13998,
29918,
2541,
29898,
3366,
265,
29899,
21001,
287,
29899,
19274,
481,
344,
12436,
716,
29918,
29880,
361,
29877,
29922,
5574,
29897,
13,
9651,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29889,
12071,
29918,
17640,
580,
13,
13,
1678,
822,
1243,
29918,
265,
29918,
2962,
29918,
1761,
8333,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
3624,
8516,
29898,
29950,
2550,
3260,
29889,
265,
29918,
2962,
29918,
1761,
8333,
3101,
13,
13,
1678,
822,
1243,
29918,
265,
29918,
9847,
29918,
1761,
8333,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
3624,
8516,
29898,
29950,
2550,
3260,
29889,
265,
29918,
9847,
29918,
1761,
8333,
3101,
13,
13,
1678,
822,
1243,
29918,
265,
29918,
2098,
29918,
11940,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
3624,
8516,
29898,
29950,
2550,
3260,
29889,
265,
29918,
2098,
29918,
11940,
3101,
13,
13,
1678,
822,
1243,
29918,
265,
29918,
2098,
29918,
1333,
29918,
11940,
29898,
1311,
1125,
13,
4706,
411,
11187,
29889,
5041,
703,
11311,
492,
2300,
29889,
3221,
29889,
29216,
481,
344,
17641,
261,
29889,
2962,
29918,
19274,
481,
344,
29918,
1609,
29918,
1761,
29918,
978,
1159,
408,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29901,
13,
9651,
29612,
3260,
29889,
265,
29918,
2098,
29918,
1333,
29918,
11940,
580,
13,
9651,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29889,
9294,
29918,
13998,
29918,
2541,
29898,
3366,
2098,
29899,
1333,
29899,
11940,
29899,
19274,
481,
344,
12436,
716,
29918,
29880,
361,
29877,
29922,
5574,
29897,
13,
9651,
11187,
29918,
19274,
481,
344,
29918,
15343,
261,
29889,
12071,
29918,
17640,
580,
13,
13,
1678,
822,
1243,
29918,
265,
29918,
29885,
1082,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
1243,
393,
4069,
1051,
310,
5222,
481,
344,
736,
5642,
13,
4706,
9995,
13,
4706,
1583,
29889,
9294,
3624,
8516,
29898,
29950,
2550,
3260,
29889,
265,
29918,
29885,
1082,
3101,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
13,
1678,
396,
9460,
353,
443,
27958,
29889,
3057,
5091,
568,
580,
13,
1678,
396,
9460,
29889,
1202,
3057,
29898,
3057,
6644,
703,
1688,
29918,
3396,
5783,
13,
1678,
396,
28877,
353,
443,
27958,
29889,
1626,
3057,
16802,
580,
13,
1678,
396,
28877,
29889,
3389,
29898,
13495,
29897,
13,
2
] |
app/__init__.py | ecsnavarretemit/cmsc265-image-search-engine-skin | 0 | 89373 | <filename>app/__init__.py
# __init__.py
#
# Author(s):
# <NAME> <<EMAIL>>
#
# Licensed under MIT
# Version 1.0.0
import os
import sys
from flask import Flask
from flask_caching import Cache
# instantiate the application
app = Flask(__name__, instance_relative_config=True)
# initialize application configuration
app.config.from_object('app.default_settings')
# use the instance configuration
app.config.from_pyfile('application.cfg', silent=True)
# load the file specified by the APP_CONFIG_FILE environment variable
# variables defined here will override those in the default configuration
app.config.from_envvar('APP_CONFIG_FILE', silent=True)
# setup caching
cache = Cache(app, config={
'CACHE_TYPE': app.config['CACHE_TYPE'],
'CACHE_DIR': app.config['CACHE_DIRECTORY']
})
# Register views from here
from .views.home import home
# Register application blueprints
app.register_blueprint(home)
| [
1,
529,
9507,
29958,
932,
29914,
1649,
2344,
26914,
2272,
13,
29937,
4770,
2344,
26914,
2272,
13,
29937,
13,
29937,
13361,
29898,
29879,
1125,
13,
29937,
259,
529,
5813,
29958,
3532,
26862,
6227,
6778,
13,
29937,
13,
29937,
10413,
21144,
1090,
341,
1806,
13,
29937,
10079,
29871,
29896,
29889,
29900,
29889,
29900,
13,
13,
5215,
2897,
13,
5215,
10876,
13,
3166,
29784,
1053,
2379,
1278,
13,
3166,
29784,
29918,
29883,
9733,
1053,
28540,
13,
13,
29937,
25112,
278,
2280,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29892,
2777,
29918,
22925,
29918,
2917,
29922,
5574,
29897,
13,
13,
29937,
11905,
2280,
5285,
13,
932,
29889,
2917,
29889,
3166,
29918,
3318,
877,
932,
29889,
4381,
29918,
11027,
1495,
13,
13,
29937,
671,
278,
2777,
5285,
13,
932,
29889,
2917,
29889,
3166,
29918,
2272,
1445,
877,
6214,
29889,
16859,
742,
17436,
29922,
5574,
29897,
13,
13,
29937,
2254,
278,
934,
6790,
491,
278,
12279,
29925,
29918,
25903,
29918,
7724,
5177,
2286,
13,
29937,
3651,
3342,
1244,
674,
5712,
1906,
297,
278,
2322,
5285,
13,
932,
29889,
2917,
29889,
3166,
29918,
6272,
1707,
877,
20576,
29918,
25903,
29918,
7724,
742,
17436,
29922,
5574,
29897,
13,
13,
29937,
6230,
22488,
13,
8173,
353,
28540,
29898,
932,
29892,
2295,
3790,
13,
29871,
525,
29907,
2477,
9606,
29918,
11116,
2396,
623,
29889,
2917,
1839,
29907,
2477,
9606,
29918,
11116,
7464,
13,
29871,
525,
29907,
2477,
9606,
29918,
9464,
2396,
623,
29889,
2917,
1839,
29907,
2477,
9606,
29918,
4571,
26282,
18929,
2033,
13,
1800,
13,
13,
29937,
12577,
8386,
515,
1244,
13,
3166,
869,
7406,
29889,
5184,
1053,
3271,
13,
13,
29937,
12577,
2280,
7254,
2158,
29879,
13,
932,
29889,
9573,
29918,
9539,
2158,
29898,
5184,
29897,
13,
13,
13,
2
] |
isotope/run_tests.py | daixiang0/tools | 264 | 79576 | #!/usr/bin/env python3
# Copyright Istio 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.
import argparse
import logging
from runner import cluster, config as cfg, consts, entrypoint, mesh, pipeline
def main(args: argparse.Namespace) -> None:
log_level = getattr(logging, args.log_level)
logging.basicConfig(level=log_level, format='%(levelname)s\t> %(message)s')
config = cfg.from_toml_file(args.config_path)
cluster.set_up_if_not_exists(
config.cluster_project_id, config.cluster_name, config.cluster_zones,
config.cluster_version, config.server_machine_type,
config.server_disk_size_gb, config.server_num_nodes,
config.client_machine_type, config.client_disk_size_gb)
for topology_path in config.topology_paths:
for env_name in config.environments:
entrypoint_service_name = entrypoint.extract_name(topology_path)
mesh_environment = mesh.for_state(
env_name, entrypoint_service_name,
consts.SERVICE_GRAPH_NAMESPACE, config, args.helm_values)
pipeline.run(topology_path, mesh_environment, config.server_image,
config.client_image, config.istio_archive_url,
config.client_qps, config.client_duration,
config.client_num_conc_conns, config.labels())
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser()
parser.add_argument('config_path', type=str)
parser.add_argument('helm_values', type=str)
parser.add_argument(
'--log_level',
type=str,
choices=['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'],
default='DEBUG')
return parser.parse_args()
if __name__ == '__main__':
args = parse_args()
main(args)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
29937,
14187,
1266,
11066,
601,
13189,
943,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
1678,
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,
5215,
1852,
5510,
13,
5215,
12183,
13,
13,
3166,
28877,
1053,
9867,
29892,
2295,
408,
274,
16434,
29892,
1040,
29879,
29892,
6251,
3149,
29892,
27716,
29892,
16439,
13,
13,
13,
1753,
1667,
29898,
5085,
29901,
1852,
5510,
29889,
23335,
29897,
1599,
6213,
29901,
13,
1678,
1480,
29918,
5563,
353,
679,
5552,
29898,
21027,
29892,
6389,
29889,
1188,
29918,
5563,
29897,
13,
1678,
12183,
29889,
16121,
3991,
29898,
5563,
29922,
1188,
29918,
5563,
29892,
3402,
2433,
29995,
29898,
5563,
978,
29897,
29879,
29905,
29873,
29958,
1273,
29898,
4906,
29897,
29879,
1495,
13,
13,
1678,
2295,
353,
274,
16434,
29889,
3166,
29918,
15135,
29880,
29918,
1445,
29898,
5085,
29889,
2917,
29918,
2084,
29897,
13,
13,
1678,
9867,
29889,
842,
29918,
786,
29918,
361,
29918,
1333,
29918,
9933,
29898,
13,
4706,
2295,
29889,
19594,
29918,
4836,
29918,
333,
29892,
2295,
29889,
19594,
29918,
978,
29892,
2295,
29889,
19594,
29918,
29920,
2873,
29892,
13,
4706,
2295,
29889,
19594,
29918,
3259,
29892,
2295,
29889,
2974,
29918,
23523,
29918,
1853,
29892,
13,
4706,
2295,
29889,
2974,
29918,
20960,
29918,
2311,
29918,
26300,
29892,
2295,
29889,
2974,
29918,
1949,
29918,
18010,
29892,
13,
4706,
2295,
29889,
4645,
29918,
23523,
29918,
1853,
29892,
2295,
29889,
4645,
29918,
20960,
29918,
2311,
29918,
26300,
29897,
13,
13,
1678,
363,
20159,
29918,
2084,
297,
2295,
29889,
3332,
3002,
29918,
24772,
29901,
13,
4706,
363,
8829,
29918,
978,
297,
2295,
29889,
21813,
1860,
29901,
13,
9651,
6251,
3149,
29918,
5509,
29918,
978,
353,
6251,
3149,
29889,
21111,
29918,
978,
29898,
3332,
3002,
29918,
2084,
29897,
13,
9651,
27716,
29918,
20944,
353,
27716,
29889,
1454,
29918,
3859,
29898,
13,
18884,
8829,
29918,
978,
29892,
6251,
3149,
29918,
5509,
29918,
978,
29892,
13,
18884,
1040,
29879,
29889,
6304,
19059,
29918,
14345,
3301,
29950,
29918,
5813,
5550,
11538,
29892,
2295,
29892,
6389,
29889,
9421,
29918,
5975,
29897,
13,
9651,
16439,
29889,
3389,
29898,
3332,
3002,
29918,
2084,
29892,
27716,
29918,
20944,
29892,
2295,
29889,
2974,
29918,
3027,
29892,
13,
462,
308,
2295,
29889,
4645,
29918,
3027,
29892,
2295,
29889,
391,
601,
29918,
10867,
29918,
2271,
29892,
13,
462,
308,
2295,
29889,
4645,
29918,
29939,
567,
29892,
2295,
29889,
4645,
29918,
19708,
29892,
13,
462,
308,
2295,
29889,
4645,
29918,
1949,
29918,
535,
29883,
29918,
535,
1983,
29892,
2295,
29889,
21134,
3101,
13,
13,
13,
1753,
6088,
29918,
5085,
580,
1599,
1852,
5510,
29889,
23335,
29901,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
2917,
29918,
2084,
742,
1134,
29922,
710,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
9421,
29918,
5975,
742,
1134,
29922,
710,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
525,
489,
1188,
29918,
5563,
742,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
19995,
29922,
1839,
11341,
1806,
2965,
1964,
742,
525,
11432,
742,
525,
29956,
25614,
742,
525,
11690,
742,
525,
18525,
7464,
13,
4706,
2322,
2433,
18525,
1495,
13,
1678,
736,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
6389,
353,
6088,
29918,
5085,
580,
13,
1678,
1667,
29898,
5085,
29897,
13,
2
] |
bank_account_app/bank_account/migrations/0007_transaction_status.py | Gogee90/Bank-account | 0 | 154028 | # Generated by Django 4.0.3 on 2022-03-22 15:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bank_account', '0006_transaction_recipient_bank_account'),
]
operations = [
migrations.AddField(
model_name='transaction',
name='status',
field=models.BooleanField(default=True),
),
]
| [
1,
396,
3251,
630,
491,
15337,
29871,
29946,
29889,
29900,
29889,
29941,
373,
29871,
29906,
29900,
29906,
29906,
29899,
29900,
29941,
29899,
29906,
29906,
29871,
29896,
29945,
29901,
29906,
29941,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
9157,
29918,
10149,
742,
525,
29900,
29900,
29900,
29953,
29918,
20736,
29918,
4361,
29886,
993,
29918,
9157,
29918,
10149,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
20736,
742,
13,
9651,
1024,
2433,
4882,
742,
13,
9651,
1746,
29922,
9794,
29889,
18146,
3073,
29898,
4381,
29922,
5574,
511,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
rfdesigner/__main__.py | fronzbot/python-rfdesigner | 1 | 77933 | """Main CLI entry point for RFDesigner."""
import sys
from rfdesigner.cli import RFcli
from rfdesigner.options import entry_arguments
from rfdesigner.netlist import parse_netlist, IMPLEMENTED_BLOCKS
def display_implemented():
"""Display implemented variables."""
implemented_string = "Available blocks for netlisting:"
for block in IMPLEMENTED_BLOCKS:
implemented_string += f"\n - {block}"
implemented_string += "\n"
return implemented_string
def display_properties(props):
"""Display supported properties for a block."""
prop_string = "Available properties:\n"
for prop in props:
prop_string += f" - <block>.{prop[0]:<14}units={prop[2]:<6}{prop[1]}\n"
return prop_string
def main():
"""CLI handler."""
parser = entry_arguments()
args = parser.parse_args()
if args.implemented:
print(display_implemented())
sys.exit(0)
if args.properties:
cls = IMPLEMENTED_BLOCKS[args.properties]()
print(display_properties(cls.supported))
sys.exit(0)
if args.validate:
netlist = args.validate
result = parse_netlist(netlist)
if not result:
print("Netlist incorrect.")
sys.exit(1)
print(result)
sys.exit(0)
rfcli = RFcli()
sys.exit(rfcli.cmdloop())
if __name__ == "__main__":
main()
| [
1,
9995,
6330,
24492,
6251,
1298,
363,
390,
29943,
4002,
21216,
1213,
15945,
13,
5215,
10876,
13,
3166,
364,
29888,
13892,
261,
29889,
11303,
1053,
390,
29943,
11303,
13,
3166,
364,
29888,
13892,
261,
29889,
6768,
1053,
6251,
29918,
25699,
13,
3166,
364,
29888,
13892,
261,
29889,
1212,
1761,
1053,
6088,
29918,
1212,
1761,
29892,
306,
3580,
1307,
13780,
3352,
29918,
29933,
21339,
29903,
13,
13,
13,
1753,
2479,
29918,
326,
2037,
287,
7295,
13,
1678,
9995,
9323,
8762,
3651,
1213,
15945,
13,
1678,
8762,
29918,
1807,
353,
376,
27635,
10930,
363,
7787,
1761,
292,
6160,
13,
1678,
363,
2908,
297,
306,
3580,
1307,
13780,
3352,
29918,
29933,
21339,
29903,
29901,
13,
4706,
8762,
29918,
1807,
4619,
285,
26732,
29876,
29871,
448,
426,
1271,
5038,
13,
1678,
8762,
29918,
1807,
4619,
6634,
29876,
29908,
13,
1678,
736,
8762,
29918,
1807,
13,
13,
13,
1753,
2479,
29918,
11330,
29898,
11030,
1125,
13,
1678,
9995,
9323,
6969,
4426,
363,
263,
2908,
1213,
15945,
13,
1678,
3107,
29918,
1807,
353,
376,
27635,
4426,
3583,
29876,
29908,
13,
1678,
363,
3107,
297,
17761,
29901,
13,
4706,
3107,
29918,
1807,
4619,
285,
29908,
29871,
448,
529,
1271,
15513,
29912,
7728,
29961,
29900,
5387,
29966,
29896,
29946,
29913,
348,
1169,
3790,
7728,
29961,
29906,
5387,
29966,
29953,
1157,
7728,
29961,
29896,
29962,
1012,
29876,
29908,
13,
1678,
736,
3107,
29918,
1807,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
9995,
27205,
7834,
1213,
15945,
13,
1678,
13812,
353,
6251,
29918,
25699,
580,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
565,
6389,
29889,
326,
2037,
287,
29901,
13,
4706,
1596,
29898,
4990,
29918,
326,
2037,
287,
3101,
13,
4706,
10876,
29889,
13322,
29898,
29900,
29897,
13,
1678,
565,
6389,
29889,
11330,
29901,
13,
4706,
1067,
29879,
353,
306,
3580,
1307,
13780,
3352,
29918,
29933,
21339,
29903,
29961,
5085,
29889,
11330,
29962,
580,
13,
4706,
1596,
29898,
4990,
29918,
11330,
29898,
25932,
29889,
23765,
876,
13,
4706,
10876,
29889,
13322,
29898,
29900,
29897,
13,
1678,
565,
6389,
29889,
15480,
29901,
13,
4706,
7787,
1761,
353,
6389,
29889,
15480,
13,
4706,
1121,
353,
6088,
29918,
1212,
1761,
29898,
1212,
1761,
29897,
13,
4706,
565,
451,
1121,
29901,
13,
9651,
1596,
703,
6779,
1761,
10240,
23157,
13,
9651,
10876,
29889,
13322,
29898,
29896,
29897,
13,
4706,
1596,
29898,
2914,
29897,
13,
4706,
10876,
29889,
13322,
29898,
29900,
29897,
13,
1678,
364,
29888,
11303,
353,
390,
29943,
11303,
580,
13,
1678,
10876,
29889,
13322,
29898,
9600,
11303,
29889,
9006,
7888,
3101,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
2
] |
source/server/annotation/migrations/0002_auto_20200622_0656.py | shizacat/shanno | 1 | 37648 | <reponame>shizacat/shanno
# Generated by Django 3.0.7 on 2020-06-22 06:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('annotation', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='projects',
name='type',
field=models.CharField(choices=[('text_label', 'Text Labeling'), ('document_classificaton', 'Document classification')], max_length=50),
),
migrations.CreateModel(
name='DCDocLabel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dl_doc', to='annotation.Documents')),
('label', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dl_label', to='annotation.TlLabels')),
],
options={
'unique_together': {('document', 'label')},
},
),
]
| [
1,
529,
276,
1112,
420,
29958,
845,
466,
562,
271,
29914,
845,
7665,
13,
29937,
3251,
630,
491,
15337,
29871,
29941,
29889,
29900,
29889,
29955,
373,
29871,
29906,
29900,
29906,
29900,
29899,
29900,
29953,
29899,
29906,
29906,
29871,
29900,
29953,
29901,
29945,
29953,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
5215,
9557,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
18317,
742,
525,
29900,
29900,
29900,
29896,
29918,
11228,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
16418,
742,
13,
9651,
1024,
2433,
1853,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
1859,
1575,
11759,
877,
726,
29918,
1643,
742,
525,
1626,
15796,
292,
5477,
6702,
3225,
29918,
1990,
928,
14114,
742,
525,
6268,
12965,
1495,
1402,
4236,
29918,
2848,
29922,
29945,
29900,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
29928,
6530,
542,
4775,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
3225,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
11671,
29918,
1514,
742,
304,
2433,
18317,
29889,
20128,
1495,
511,
13,
18884,
6702,
1643,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
11671,
29918,
1643,
742,
304,
2433,
18317,
29889,
29911,
29880,
4775,
29879,
1495,
511,
13,
9651,
21251,
13,
9651,
3987,
3790,
13,
18884,
525,
13092,
29918,
29873,
12966,
2396,
426,
877,
3225,
742,
525,
1643,
1495,
1118,
13,
9651,
2981,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
src/data_handlers/data_containers.py | Maxim-Mushizky/aws_data_collector | 1 | 129429 | from dataclasses import dataclass, field
from datetime import datetime
from typing import (
List,
Optional,
Dict
)
@dataclass(frozen=True)
class Ids:
image_id: Optional[str] = field(default_factory=str)
instance_id: Optional[str] = field(default_factory=str)
reservation_id: Optional[str] = field(default_factory=str)
@dataclass(frozen=True)
class NetworkSettings:
ip6_address: List = field(default_factory=list)
private_dns_name: str = field(default_factory=str)
private_ip_address: str = field(default_factory=str)
subnet_id: Optional[str] = field(default_factory=str)
interface_type: Optional[str] = field(default_factory=str)
status: Optional[str] = field(default_factory=str)
@dataclass(frozen=True)
class Tags:
tags: Dict = field(default_factory=dict)
@dataclass(frozen=True)
class PlatformDetails:
os: str = field(default_factory=str)
@dataclass(frozen=True)
class Specs:
cpu: Dict = field(default_factory=dict)
memory: int = field(default_factory=int)
instance_type: str = field(default_factory=str)
@dataclass(frozen=True)
class Times:
launch_time: Optional[datetime] = field(default=None)
usage_operation_update_time: Optional[datetime] = field(default=None)
@dataclass(frozen=True)
class SecurityGroups:
groups: List[Dict] = field(default_factory=list)
@dataclass(frozen=True)
class Placement:
availability_zone: str = field(default_factory=str)
@dataclass(frozen=True)
class Token:
access_key_id: str = field(default="default")
secret_access_key: str = field(default="default")
@dataclass(frozen=True)
class EC2Data:
token: Token = field(default_factory=Token)
ids: Optional[Ids] = field(default=None)
network_settings: Optional[NetworkSettings] = field(default=None)
platform_details: Optional[PlatformDetails] = field(default=None)
tags: Optional[Tags] = field(default=None)
times: Optional[Times] = field(default=None)
security_groups: Optional[SecurityGroups] = field(default=None)
specs: Optional[Specs] = field(default=None)
placement: Optional[Placement] = field(default=None)
| [
1,
515,
848,
13203,
1053,
848,
1990,
29892,
1746,
13,
3166,
12865,
1053,
12865,
13,
3166,
19229,
1053,
313,
13,
1678,
2391,
29892,
13,
1678,
28379,
29892,
13,
1678,
360,
919,
13,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
5163,
29879,
29901,
13,
1678,
1967,
29918,
333,
29901,
28379,
29961,
710,
29962,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
1678,
2777,
29918,
333,
29901,
28379,
29961,
710,
29962,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
1678,
620,
20525,
29918,
333,
29901,
28379,
29961,
710,
29962,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
8527,
9585,
29901,
13,
1678,
10377,
29953,
29918,
7328,
29901,
2391,
353,
1746,
29898,
4381,
29918,
14399,
29922,
1761,
29897,
13,
1678,
2024,
29918,
29881,
1983,
29918,
978,
29901,
851,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
1678,
2024,
29918,
666,
29918,
7328,
29901,
851,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
1678,
1014,
1212,
29918,
333,
29901,
28379,
29961,
710,
29962,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
1678,
5067,
29918,
1853,
29901,
28379,
29961,
710,
29962,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
1678,
4660,
29901,
28379,
29961,
710,
29962,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
917,
29901,
13,
1678,
8282,
29901,
360,
919,
353,
1746,
29898,
4381,
29918,
14399,
29922,
8977,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
28096,
10602,
29901,
13,
1678,
2897,
29901,
851,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
5013,
2395,
29901,
13,
1678,
26403,
29901,
360,
919,
353,
1746,
29898,
4381,
29918,
14399,
29922,
8977,
29897,
13,
1678,
3370,
29901,
938,
353,
1746,
29898,
4381,
29918,
14399,
29922,
524,
29897,
13,
1678,
2777,
29918,
1853,
29901,
851,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
10277,
29901,
13,
1678,
6826,
29918,
2230,
29901,
28379,
29961,
12673,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
1678,
8744,
29918,
16453,
29918,
5504,
29918,
2230,
29901,
28379,
29961,
12673,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
14223,
24020,
29901,
13,
1678,
6471,
29901,
2391,
29961,
21533,
29962,
353,
1746,
29898,
4381,
29918,
14399,
29922,
1761,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
349,
9552,
29901,
13,
1678,
20847,
3097,
29918,
8028,
29901,
851,
353,
1746,
29898,
4381,
29918,
14399,
29922,
710,
29897,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
25159,
29901,
13,
1678,
2130,
29918,
1989,
29918,
333,
29901,
851,
353,
1746,
29898,
4381,
543,
4381,
1159,
13,
1678,
7035,
29918,
5943,
29918,
1989,
29901,
851,
353,
1746,
29898,
4381,
543,
4381,
1159,
13,
13,
13,
29992,
1272,
1990,
29898,
29888,
307,
2256,
29922,
5574,
29897,
13,
1990,
17522,
29906,
1469,
29901,
13,
1678,
5993,
29901,
25159,
353,
1746,
29898,
4381,
29918,
14399,
29922,
6066,
29897,
13,
1678,
18999,
29901,
28379,
29961,
21943,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
1678,
3564,
29918,
11027,
29901,
28379,
29961,
13724,
9585,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
1678,
7481,
29918,
14144,
29901,
28379,
29961,
21889,
10602,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
1678,
8282,
29901,
28379,
29961,
28089,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
1678,
3064,
29901,
28379,
29961,
29164,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
1678,
6993,
29918,
13155,
29901,
28379,
29961,
13228,
24020,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
1678,
1580,
29879,
29901,
28379,
29961,
10649,
2395,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
1678,
2174,
13561,
29901,
28379,
29961,
29925,
9552,
29962,
353,
1746,
29898,
4381,
29922,
8516,
29897,
13,
2
] |
kryptobot/ta/pyti_average_true_range.py | eristoddle/Kryptobot | 24 | 137265 | from .generic_indicator import GenericIndicator
from pyti.average_true_range import average_true_range as atr
# params: period
# https://github.com/kylejusticemagnuson/pyti/blob/master/pyti/average_true_range.py
class PytiAverageTrueRange(GenericIndicator):
def __init__(self, market, interval, periods, params=None):
super().__init__(market, interval, periods, None, None, params)
def get_analysis(self, data):
return atr(data, self.params['period'])[-1]
def next_calculation(self, candle):
if self.get_datawindow() is not None:
self.value = self.get_analysis(self.get_close())
| [
1,
515,
869,
19206,
29918,
513,
20485,
1053,
3251,
293,
28013,
13,
3166,
11451,
2034,
29889,
12483,
482,
29918,
3009,
29918,
3881,
1053,
6588,
29918,
3009,
29918,
3881,
408,
472,
29878,
13,
13,
13,
29937,
8636,
29901,
3785,
13,
29937,
2045,
597,
3292,
29889,
510,
29914,
29895,
1508,
5143,
293,
331,
4211,
375,
265,
29914,
2272,
2034,
29914,
10054,
29914,
6207,
29914,
2272,
2034,
29914,
12483,
482,
29918,
3009,
29918,
3881,
29889,
2272,
13,
1990,
10772,
2034,
29909,
19698,
5574,
6069,
29898,
15809,
28013,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
9999,
29892,
7292,
29892,
23704,
29892,
8636,
29922,
8516,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
28549,
29892,
7292,
29892,
23704,
29892,
6213,
29892,
6213,
29892,
8636,
29897,
13,
13,
1678,
822,
679,
29918,
15916,
29898,
1311,
29892,
848,
1125,
13,
4706,
736,
472,
29878,
29898,
1272,
29892,
1583,
29889,
7529,
1839,
19145,
2033,
9601,
29899,
29896,
29962,
13,
13,
1678,
822,
2446,
29918,
15807,
362,
29898,
1311,
29892,
23794,
280,
1125,
13,
4706,
565,
1583,
29889,
657,
29918,
1272,
7165,
580,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
1767,
353,
1583,
29889,
657,
29918,
15916,
29898,
1311,
29889,
657,
29918,
5358,
3101,
13,
2
] |
datageneration/dbmake_h264hits.py | utlive/VIDMAP | 1 | 34454 | <reponame>utlive/VIDMAP<filename>datageneration/dbmake_h264hits.py
import skimage.io
import skvideo.io
import os
import h5py
from sklearn.externals import joblib
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import f1_score
import scipy.misc
import scipy.signal
import numpy as np
from sporco import util
import matplotlib.pyplot as plt
import pylab as py
import glob
from PIL import Image
import cv2
import sys
def get_postrainpatches(hdf5_im, hdf5_lab, hdf5_trainset, offsets, idx=0, traintest=0):
return genericpospatcher(hdf5_im, hdf5_lab, hdf5_trainset, offsets, idx=idx, traintest=traintest)
def genericpospatcher(hdf5_im, hdf5_lab, hdf5_trainset, offsets, idx=0, traintest=0):
width = 256
height = 256
lst480p = np.array(glob.glob("/mnt/hd3/scenes/480p/*avi"))
lst1080p = np.array(glob.glob("/mnt/hd3/scenes/1080p/*avi"))
lst480p = np.sort(lst480p)
lst1080p = np.sort(lst1080p)
if traintest == 0:
lst = np.hstack((lst480p[:575], lst1080p[:215]))
else:
lst = np.hstack((lst480p[575:], lst1080p[215:]))
for repeates in [1, 2]:
n_samples = len(lst)
for fidx, fname in enumerate(lst):
print fidx, n_samples, fname
#vid = skvideo.io.vread(fname, as_grey=True).astype(np.float32)
cmd = "ffmpeg -y -nostats -loglevel 0 -i %s -codec:v libx264 -g 50 -mpv_flags +strict_gop -bsf noise=2000000 -b:v 40000k /tmp/test_distorted.mp4" % (fname,)
os.system(cmd)
cmd = "ffmpeg -y -nostats -loglevel 0 -ec 0 -i /tmp/test_distorted.mp4 -vcodec rawvideo -pix_fmt yuv420p /tmp/test_distorted.avi"
os.system(cmd)
cmd = "ffmpeg -y -nostats -loglevel 0 -i %s -codec:v mpeg2video -b:v 40000k /tmp/test_pristine.mp4" % (fname,)
os.system(cmd)
cmd = "ffmpeg -y -nostats -loglevel 0 -ec 0 -i /tmp/test_pristine.mp4 -vcodec rawvideo -pix_fmt yuv420p /tmp/test_pristine.avi"
os.system(cmd)
vid_dis = skvideo.io.vread("/tmp/test_distorted.avi", as_grey=True).astype(np.float32)
vid_pris = skvideo.io.vread("/tmp/test_pristine.avi", as_grey=True).astype(np.float32)
os.remove("/tmp/test_distorted.mp4")
os.remove("/tmp/test_pristine.mp4")
os.remove("/tmp/test_distorted.avi")
os.remove("/tmp/test_pristine.avi")
T, H, W, C = vid_dis.shape
adj_h = H - height
adj_w = W - width
iv, jv = np.meshgrid(np.arange(adj_h), np.arange(adj_w), sparse=False, indexing='ij')
iv = iv.reshape(-1)
jv = jv.reshape(-1)
jdx = np.random.permutation(adj_h*adj_w)
iv = iv[jdx]
jv = jv[jdx]
tv = np.arange(1, T-1)
limit = 0
for (y, x) in zip(iv, jv):
np.random.shuffle(tv)
t = tv[0]
goodpatch = vid_pris[t-1:t+2, y:y+height, x:x+width, 0]
badpatch = vid_dis[t-1:t+2, y:y+height, x:x+width, 0]
# difference the magntudes, so we don't worry about phase shifts
if badpatch.shape[0] == goodpatch.shape[0]:
diff = np.mean(np.abs(badpatch[1, 30:-30, 30:-30] - goodpatch[1, 30:-30, 30:-30])**2)
if diff < 50:
continue
# check that either the previous frame or next frame match exactly, except where the middle frame doesn't match
# this ensures that the difference measured is not because of frame mis-alignment
error1 = np.sum((goodpatch[0] - badpatch[0])**2)
error2 = np.sum((goodpatch[2] - badpatch[2])**2)
print error1, error2
else:
continue
# check for no variance img
if np.std(badpatch[0, 30:-30, 30:-30]) < 10:
continue
if np.std(badpatch[1, 30:-30, 30:-30]) < 10:
continue
if np.std(badpatch[2, 30:-30, 30:-30]) < 10:
continue
#goodpatch = goodpatch.astype(np.uint8)
#badpatch = badpatch.astype(np.uint8)
#badimg = badpatch[0].astype(np.uint8)
#skimage.io.imsave("dump/patch_%d.png" % (idx,), badimg)
#print diff
#skimage.io.imsave("/tmp/test_%d.png" % (limit,), np.hstack((goodpatch.astype(np.uint8), badpatch.astype(np.uint8))))
#preprocess = preprocess[:, 5:-5, 5:-5]
hdf5_im[idx] = badpatch
hdf5_lab[idx] = 1
hdf5_trainset[idx] = traintest
offsets[idx] = [y, x]
#skimage.io.imsave("extract/%d.png" % (idx,), patch)
limit += 1
idx += 1
if limit >= 10:
break
return idx
def get_negtrainpatches(image_patches, labels, hdf5_traintest, offsets, idx=0, traintest=0):
return genericnegpatcher(image_patches, labels, hdf5_traintest, offsets, idx=idx, traintest=traintest)
def genericnegpatcher(hdf5_im, hdf5_lab, hdf5_traintest, offsets, idx=0, traintest=0):
width = 256
height = 256
#lst = glob.glob("/mnt/hd3/databases/video/film_pristine/480p/*/*mpg")
lst480p = np.array(glob.glob("/mnt/hd3/scenes/480p/*avi"))
lst1080p = np.array(glob.glob("/mnt/hd3/scenes/1080p/*avi"))
lst480p = np.sort(lst480p)
lst1080p = np.sort(lst1080p)
if traintest == 0:
lst = np.hstack((lst480p[:575], lst1080p[:215]))
else:
lst = np.hstack((lst480p[575:], lst1080p[215:]))
n_samples = len(lst)
for fidx, fname in enumerate(lst):
print fidx, n_samples, fname
#vid = skvideo.io.vread(fname, as_grey=True).astype(np.float32)
cmd = "ffmpeg -y -nostats -loglevel 0 -i %s -codec:v h264 -b:v 40000k /tmp/test_pristine.mp4" % (fname,)
os.system(cmd)
vid_pris = skvideo.io.vread("/tmp/test_pristine.mp4", inputdict={'-ec': '0'}, as_grey=True).astype(np.float32)
T, H, W, C = vid_pris.shape
adj_h = H - height
adj_w = W - width
iv, jv = np.meshgrid(np.arange(adj_h), np.arange(adj_w), sparse=False, indexing='ij')
iv = iv.reshape(-1)
jv = jv.reshape(-1)
jdx = np.random.permutation(adj_h*adj_w)
iv = iv[jdx]
jv = jv[jdx]
tv = np.arange(1, T-1)
limit = 0
for (y, x) in zip(iv, jv):
np.random.shuffle(tv)
t = tv[0]
goodpatch = vid_pris[t-1:t+2, y:y+height, x:x+width, 0]
#print diff
#skimage.io.imsave("/tmp/test_%d.png" % (limit,), np.hstack((goodpatch.astype(np.uint8), badpatch.astype(np.uint8))))
hdf5_im[idx] = goodpatch
hdf5_lab[idx] = 0
hdf5_traintest[idx] = traintest
offsets[idx] = [y, x]
#skimage.io.imsave("extract/%d.png" % (idx,), patch)
limit += 1
idx += 1
if limit >= 20:
break
return idx
# get the number of patches
np.random.seed(12345)
n_total_images = 62417
patch_height = 256
patch_width = 256
n_channels = 3
# sf = single frame
# fd = frame diff
f = h5py.File('/mnt/hd2/hitsdataset_sf_h264_2.hdf5', mode='w')
image_patches = f.create_dataset('image_patches', (n_total_images, n_channels, patch_height, patch_width), dtype='float')
image_patches.dims[0].label = 'batch'
image_patches.dims[1].label = 'channel'
image_patches.dims[2].label = 'height'
image_patches.dims[3].label = 'width'
labels = f.create_dataset('labels', (n_total_images,), dtype='uint8')
trainset = f.create_dataset('set', (n_total_images,), dtype='uint8')
offsets = f.create_dataset('offsets', (n_total_images, 2), dtype='int32')
n_idx = 0
n_idx = get_postrainpatches(image_patches, labels, trainset, offsets, n_idx, traintest=0)
n_idx = get_negtrainpatches(image_patches, labels, trainset, offsets, n_idx, traintest=0)
n_idx = get_postrainpatches(image_patches, labels, trainset, offsets, n_idx, traintest=1)
n_idx = get_negtrainpatches(image_patches, labels, trainset, offsets, n_idx, traintest=1)
print n_idx, n_total_images
#n_idx = get_negtestpatches(image_patches, labels, trainset, n_idx)
#n_idx = get_postestpatches(image_patches, labels, trainset, n_idx)
f.flush()
f.close()
| [
1,
529,
276,
1112,
420,
29958,
329,
9258,
29914,
13044,
23827,
29966,
9507,
29958,
4130,
351,
759,
362,
29914,
2585,
5675,
29918,
29882,
29906,
29953,
29946,
29882,
1169,
29889,
2272,
13,
5215,
2071,
3027,
29889,
601,
13,
5215,
2071,
9641,
29889,
601,
13,
5215,
2897,
13,
5215,
298,
29945,
2272,
13,
3166,
2071,
19668,
29889,
735,
725,
1338,
1053,
4982,
1982,
13,
3166,
2071,
19668,
29889,
10660,
29918,
4299,
1053,
22985,
4597,
23881,
13,
3166,
2071,
19668,
29889,
24031,
1053,
16968,
2831,
342,
4597,
1253,
272,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
285,
29896,
29918,
13628,
13,
5215,
4560,
2272,
29889,
29885,
10669,
13,
5215,
4560,
2272,
29889,
25436,
13,
5215,
12655,
408,
7442,
13,
3166,
805,
272,
1111,
1053,
3667,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
282,
2904,
370,
408,
11451,
13,
5215,
13149,
13,
3166,
349,
6227,
1053,
7084,
29871,
13,
5215,
13850,
29906,
13,
5215,
10876,
13,
13,
1753,
679,
29918,
2490,
6038,
5041,
267,
29898,
29882,
2176,
29945,
29918,
326,
29892,
298,
2176,
29945,
29918,
8205,
29892,
298,
2176,
29945,
29918,
14968,
842,
29892,
1283,
7224,
29892,
22645,
29922,
29900,
29892,
1020,
524,
342,
29922,
29900,
1125,
13,
29871,
736,
10035,
1066,
5041,
261,
29898,
29882,
2176,
29945,
29918,
326,
29892,
298,
2176,
29945,
29918,
8205,
29892,
298,
2176,
29945,
29918,
14968,
842,
29892,
1283,
7224,
29892,
22645,
29922,
13140,
29892,
1020,
524,
342,
29922,
3018,
524,
342,
29897,
13,
13,
1753,
10035,
1066,
5041,
261,
29898,
29882,
2176,
29945,
29918,
326,
29892,
298,
2176,
29945,
29918,
8205,
29892,
298,
2176,
29945,
29918,
14968,
842,
29892,
1283,
7224,
29892,
22645,
29922,
29900,
29892,
1020,
524,
342,
29922,
29900,
1125,
13,
29871,
2920,
353,
29871,
29906,
29945,
29953,
13,
29871,
3171,
353,
29871,
29906,
29945,
29953,
13,
13,
29871,
24471,
29946,
29947,
29900,
29886,
353,
7442,
29889,
2378,
29898,
23705,
29889,
23705,
11974,
29885,
593,
29914,
16440,
29941,
29914,
1557,
25487,
29914,
29946,
29947,
29900,
29886,
5515,
17345,
5783,
13,
29871,
24471,
29896,
29900,
29947,
29900,
29886,
353,
7442,
29889,
2378,
29898,
23705,
29889,
23705,
11974,
29885,
593,
29914,
16440,
29941,
29914,
1557,
25487,
29914,
29896,
29900,
29947,
29900,
29886,
5515,
17345,
5783,
13,
29871,
24471,
29946,
29947,
29900,
29886,
353,
7442,
29889,
6605,
29898,
20155,
29946,
29947,
29900,
29886,
29897,
13,
29871,
24471,
29896,
29900,
29947,
29900,
29886,
353,
7442,
29889,
6605,
29898,
20155,
29896,
29900,
29947,
29900,
29886,
29897,
13,
13,
29871,
565,
1020,
524,
342,
1275,
29871,
29900,
29901,
13,
1678,
24471,
353,
7442,
29889,
29882,
1429,
3552,
20155,
29946,
29947,
29900,
29886,
7503,
29945,
29955,
29945,
1402,
24471,
29896,
29900,
29947,
29900,
29886,
7503,
29906,
29896,
29945,
12622,
13,
29871,
1683,
29901,
13,
1678,
24471,
353,
7442,
29889,
29882,
1429,
3552,
20155,
29946,
29947,
29900,
29886,
29961,
29945,
29955,
29945,
29901,
1402,
24471,
29896,
29900,
29947,
29900,
29886,
29961,
29906,
29896,
29945,
29901,
12622,
13,
13,
29871,
363,
5565,
1078,
29871,
297,
518,
29896,
29892,
29871,
29906,
5387,
13,
1678,
302,
29918,
27736,
353,
7431,
29898,
20155,
29897,
13,
1678,
363,
285,
13140,
29892,
285,
978,
297,
26985,
29898,
20155,
1125,
13,
418,
1596,
285,
13140,
29892,
302,
29918,
27736,
29892,
285,
978,
13,
418,
396,
8590,
353,
2071,
9641,
29889,
601,
29889,
29894,
949,
29898,
29888,
978,
29892,
408,
29918,
7979,
29891,
29922,
5574,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
418,
9920,
353,
376,
600,
20856,
448,
29891,
448,
6582,
1446,
448,
1188,
5563,
29871,
29900,
448,
29875,
1273,
29879,
448,
401,
29883,
29901,
29894,
4303,
29916,
29906,
29953,
29946,
448,
29887,
29871,
29945,
29900,
448,
1526,
29894,
29918,
15764,
718,
710,
919,
29918,
29887,
459,
448,
29890,
4668,
11462,
29922,
29906,
29900,
29900,
29900,
29900,
29900,
29900,
448,
29890,
29901,
29894,
29871,
29946,
29900,
29900,
29900,
29900,
29895,
847,
7050,
29914,
1688,
29918,
5721,
18054,
29889,
1526,
29946,
29908,
1273,
313,
29888,
978,
29892,
29897,
13,
418,
2897,
29889,
5205,
29898,
9006,
29897,
13,
13,
418,
9920,
353,
376,
600,
20856,
448,
29891,
448,
6582,
1446,
448,
1188,
5563,
29871,
29900,
448,
687,
29871,
29900,
448,
29875,
847,
7050,
29914,
1688,
29918,
5721,
18054,
29889,
1526,
29946,
448,
29894,
401,
29883,
10650,
9641,
448,
29886,
861,
29918,
23479,
343,
4090,
29946,
29906,
29900,
29886,
847,
7050,
29914,
1688,
29918,
5721,
18054,
29889,
17345,
29908,
13,
418,
2897,
29889,
5205,
29898,
9006,
29897,
13,
13,
418,
9920,
353,
376,
600,
20856,
448,
29891,
448,
6582,
1446,
448,
1188,
5563,
29871,
29900,
448,
29875,
1273,
29879,
448,
401,
29883,
29901,
29894,
22326,
387,
29906,
9641,
448,
29890,
29901,
29894,
29871,
29946,
29900,
29900,
29900,
29900,
29895,
847,
7050,
29914,
1688,
29918,
558,
391,
457,
29889,
1526,
29946,
29908,
1273,
313,
29888,
978,
29892,
29897,
13,
418,
2897,
29889,
5205,
29898,
9006,
29897,
13,
13,
418,
9920,
353,
376,
600,
20856,
448,
29891,
448,
6582,
1446,
448,
1188,
5563,
29871,
29900,
448,
687,
29871,
29900,
448,
29875,
847,
7050,
29914,
1688,
29918,
558,
391,
457,
29889,
1526,
29946,
448,
29894,
401,
29883,
10650,
9641,
448,
29886,
861,
29918,
23479,
343,
4090,
29946,
29906,
29900,
29886,
847,
7050,
29914,
1688,
29918,
558,
391,
457,
29889,
17345,
29908,
13,
418,
2897,
29889,
5205,
29898,
9006,
29897,
13,
13,
418,
7840,
29918,
2218,
353,
2071,
9641,
29889,
601,
29889,
29894,
949,
11974,
7050,
29914,
1688,
29918,
5721,
18054,
29889,
17345,
613,
408,
29918,
7979,
29891,
29922,
5574,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
418,
7840,
29918,
558,
275,
353,
2071,
9641,
29889,
601,
29889,
29894,
949,
11974,
7050,
29914,
1688,
29918,
558,
391,
457,
29889,
17345,
613,
408,
29918,
7979,
29891,
29922,
5574,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
13,
418,
2897,
29889,
5992,
11974,
7050,
29914,
1688,
29918,
5721,
18054,
29889,
1526,
29946,
1159,
13,
418,
2897,
29889,
5992,
11974,
7050,
29914,
1688,
29918,
558,
391,
457,
29889,
1526,
29946,
1159,
13,
418,
2897,
29889,
5992,
11974,
7050,
29914,
1688,
29918,
5721,
18054,
29889,
17345,
1159,
13,
418,
2897,
29889,
5992,
11974,
7050,
29914,
1688,
29918,
558,
391,
457,
29889,
17345,
1159,
13,
13,
418,
323,
29892,
379,
29892,
399,
29892,
315,
353,
7840,
29918,
2218,
29889,
12181,
13,
13,
418,
12109,
29918,
29882,
353,
379,
448,
3171,
13,
418,
12109,
29918,
29893,
353,
399,
448,
2920,
13,
418,
20444,
29892,
432,
29894,
353,
7442,
29889,
4467,
29882,
7720,
29898,
9302,
29889,
279,
927,
29898,
26859,
29918,
29882,
511,
7442,
29889,
279,
927,
29898,
26859,
29918,
29893,
511,
29234,
29922,
8824,
29892,
26190,
2433,
823,
1495,
13,
418,
20444,
353,
20444,
29889,
690,
14443,
6278,
29896,
29897,
13,
418,
432,
29894,
353,
432,
29894,
29889,
690,
14443,
6278,
29896,
29897,
13,
13,
418,
432,
8235,
353,
7442,
29889,
8172,
29889,
546,
6149,
362,
29898,
26859,
29918,
29882,
29930,
26859,
29918,
29893,
29897,
13,
13,
418,
20444,
353,
20444,
29961,
29926,
8235,
29962,
13,
418,
432,
29894,
353,
432,
29894,
29961,
29926,
8235,
29962,
13,
418,
9631,
353,
7442,
29889,
279,
927,
29898,
29896,
29892,
323,
29899,
29896,
29897,
13,
13,
418,
4046,
353,
29871,
29900,
13,
418,
363,
313,
29891,
29892,
921,
29897,
297,
14319,
29898,
440,
29892,
432,
29894,
1125,
13,
4706,
7442,
29889,
8172,
29889,
845,
21897,
29898,
12427,
29897,
13,
4706,
260,
353,
9631,
29961,
29900,
29962,
13,
4706,
1781,
5041,
353,
7840,
29918,
558,
275,
29961,
29873,
29899,
29896,
29901,
29873,
29974,
29906,
29892,
343,
29901,
29891,
29974,
3545,
29892,
921,
29901,
29916,
29974,
2103,
29892,
29871,
29900,
29962,
13,
4706,
4319,
5041,
353,
7840,
29918,
2218,
29961,
29873,
29899,
29896,
29901,
29873,
29974,
29906,
29892,
343,
29901,
29891,
29974,
3545,
29892,
921,
29901,
29916,
29974,
2103,
29892,
29871,
29900,
29962,
13,
13,
4706,
396,
4328,
278,
2320,
593,
8192,
29892,
577,
591,
1016,
29915,
29873,
15982,
1048,
8576,
528,
17741,
13,
4706,
565,
4319,
5041,
29889,
12181,
29961,
29900,
29962,
1275,
1781,
5041,
29889,
12181,
29961,
29900,
5387,
13,
3986,
2923,
353,
7442,
29889,
12676,
29898,
9302,
29889,
6897,
29898,
12313,
5041,
29961,
29896,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
29962,
448,
1781,
5041,
29961,
29896,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
2314,
1068,
29906,
29897,
13,
3986,
565,
2923,
529,
29871,
29945,
29900,
29901,
13,
9651,
6773,
13,
13,
3986,
396,
1423,
393,
2845,
278,
3517,
3515,
470,
2446,
3515,
1993,
3721,
29892,
5174,
988,
278,
7256,
3515,
1838,
29915,
29873,
1993,
13,
3986,
396,
445,
5662,
1973,
393,
278,
4328,
17005,
338,
451,
1363,
310,
3515,
3984,
29899,
2520,
358,
13,
3986,
1059,
29896,
353,
7442,
29889,
2083,
3552,
16773,
5041,
29961,
29900,
29962,
448,
4319,
5041,
29961,
29900,
2314,
1068,
29906,
29897,
13,
3986,
1059,
29906,
353,
7442,
29889,
2083,
3552,
16773,
5041,
29961,
29906,
29962,
448,
4319,
5041,
29961,
29906,
2314,
1068,
29906,
29897,
13,
3986,
1596,
1059,
29896,
29892,
1059,
29906,
13,
13,
4706,
1683,
29901,
13,
3986,
6773,
13,
13,
4706,
396,
1423,
363,
694,
20162,
10153,
13,
4706,
565,
7442,
29889,
4172,
29898,
12313,
5041,
29961,
29900,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
2314,
529,
29871,
29896,
29900,
29901,
13,
3986,
6773,
13,
4706,
565,
7442,
29889,
4172,
29898,
12313,
5041,
29961,
29896,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
2314,
529,
29871,
29896,
29900,
29901,
13,
3986,
6773,
13,
4706,
565,
7442,
29889,
4172,
29898,
12313,
5041,
29961,
29906,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
29892,
29871,
29941,
29900,
13018,
29941,
29900,
2314,
529,
29871,
29896,
29900,
29901,
13,
3986,
6773,
13,
13,
4706,
396,
16773,
5041,
353,
1781,
5041,
29889,
579,
668,
29898,
9302,
29889,
13470,
29947,
29897,
13,
4706,
396,
12313,
5041,
353,
4319,
5041,
29889,
579,
668,
29898,
9302,
29889,
13470,
29947,
29897,
13,
4706,
396,
12313,
2492,
353,
4319,
5041,
29961,
29900,
1822,
579,
668,
29898,
9302,
29889,
13470,
29947,
29897,
13,
4706,
396,
808,
3027,
29889,
601,
29889,
326,
7620,
703,
15070,
29914,
5041,
29918,
29995,
29881,
29889,
2732,
29908,
1273,
313,
13140,
29892,
511,
4319,
2492,
29897,
13,
13,
4706,
396,
2158,
2923,
13,
4706,
396,
808,
3027,
29889,
601,
29889,
326,
7620,
11974,
7050,
29914,
1688,
29918,
29995,
29881,
29889,
2732,
29908,
1273,
313,
13400,
29892,
511,
7442,
29889,
29882,
1429,
3552,
16773,
5041,
29889,
579,
668,
29898,
9302,
29889,
13470,
29947,
511,
4319,
5041,
29889,
579,
668,
29898,
9302,
29889,
13470,
29947,
13697,
13,
4706,
396,
1457,
5014,
353,
758,
5014,
7503,
29892,
29871,
29945,
13018,
29945,
29892,
29871,
29945,
13018,
29945,
29962,
13,
4706,
298,
2176,
29945,
29918,
326,
29961,
13140,
29962,
353,
4319,
5041,
13,
4706,
298,
2176,
29945,
29918,
8205,
29961,
13140,
29962,
353,
29871,
29896,
13,
4706,
298,
2176,
29945,
29918,
14968,
842,
29961,
13140,
29962,
353,
1020,
524,
342,
13,
4706,
1283,
7224,
29961,
13140,
29962,
353,
518,
29891,
29892,
921,
29962,
13,
4706,
396,
808,
3027,
29889,
601,
29889,
326,
7620,
703,
21111,
22584,
29881,
29889,
2732,
29908,
1273,
313,
13140,
29892,
511,
13261,
29897,
13,
4706,
4046,
4619,
29871,
29896,
13,
4706,
22645,
4619,
29871,
29896,
13,
4706,
565,
4046,
6736,
29871,
29896,
29900,
29901,
13,
3986,
2867,
13,
13,
29871,
736,
22645,
13,
13,
1753,
679,
29918,
10052,
14968,
5041,
267,
29898,
3027,
29918,
5041,
267,
29892,
11073,
29892,
298,
2176,
29945,
29918,
3018,
524,
342,
29892,
1283,
7224,
29892,
22645,
29922,
29900,
29892,
1020,
524,
342,
29922,
29900,
1125,
13,
29871,
736,
10035,
10052,
5041,
261,
29898,
3027,
29918,
5041,
267,
29892,
11073,
29892,
298,
2176,
29945,
29918,
3018,
524,
342,
29892,
1283,
7224,
29892,
22645,
29922,
13140,
29892,
1020,
524,
342,
29922,
3018,
524,
342,
29897,
13,
13,
13,
1753,
10035,
10052,
5041,
261,
29898,
29882,
2176,
29945,
29918,
326,
29892,
298,
2176,
29945,
29918,
8205,
29892,
298,
2176,
29945,
29918,
3018,
524,
342,
29892,
1283,
7224,
29892,
22645,
29922,
29900,
29892,
1020,
524,
342,
29922,
29900,
1125,
13,
13,
29871,
2920,
353,
29871,
29906,
29945,
29953,
13,
29871,
3171,
353,
29871,
29906,
29945,
29953,
13,
13,
29871,
396,
20155,
353,
13149,
29889,
23705,
11974,
29885,
593,
29914,
16440,
29941,
29914,
29503,
2129,
29914,
9641,
29914,
9663,
29918,
558,
391,
457,
29914,
29946,
29947,
29900,
29886,
29914,
3877,
29930,
1526,
29887,
1159,
13,
29871,
24471,
29946,
29947,
29900,
29886,
353,
7442,
29889,
2378,
29898,
23705,
29889,
23705,
11974,
29885,
593,
29914,
16440,
29941,
29914,
1557,
25487,
29914,
29946,
29947,
29900,
29886,
5515,
17345,
5783,
13,
29871,
24471,
29896,
29900,
29947,
29900,
29886,
353,
7442,
29889,
2378,
29898,
23705,
29889,
23705,
11974,
29885,
593,
29914,
16440,
29941,
29914,
1557,
25487,
29914,
29896,
29900,
29947,
29900,
29886,
5515,
17345,
5783,
13,
29871,
24471,
29946,
29947,
29900,
29886,
353,
7442,
29889,
6605,
29898,
20155,
29946,
29947,
29900,
29886,
29897,
13,
29871,
24471,
29896,
29900,
29947,
29900,
29886,
353,
7442,
29889,
6605,
29898,
20155,
29896,
29900,
29947,
29900,
29886,
29897,
13,
13,
29871,
565,
1020,
524,
342,
1275,
29871,
29900,
29901,
13,
1678,
24471,
353,
7442,
29889,
29882,
1429,
3552,
20155,
29946,
29947,
29900,
29886,
7503,
29945,
29955,
29945,
1402,
24471,
29896,
29900,
29947,
29900,
29886,
7503,
29906,
29896,
29945,
12622,
13,
29871,
1683,
29901,
13,
1678,
24471,
353,
7442,
29889,
29882,
1429,
3552,
20155,
29946,
29947,
29900,
29886,
29961,
29945,
29955,
29945,
29901,
1402,
24471,
29896,
29900,
29947,
29900,
29886,
29961,
29906,
29896,
29945,
29901,
12622,
13,
13,
29871,
302,
29918,
27736,
353,
7431,
29898,
20155,
29897,
13,
29871,
363,
285,
13140,
29892,
285,
978,
297,
26985,
29898,
20155,
1125,
13,
1678,
1596,
285,
13140,
29892,
302,
29918,
27736,
29892,
285,
978,
13,
1678,
396,
8590,
353,
2071,
9641,
29889,
601,
29889,
29894,
949,
29898,
29888,
978,
29892,
408,
29918,
7979,
29891,
29922,
5574,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
9920,
353,
376,
600,
20856,
448,
29891,
448,
6582,
1446,
448,
1188,
5563,
29871,
29900,
448,
29875,
1273,
29879,
448,
401,
29883,
29901,
29894,
298,
29906,
29953,
29946,
448,
29890,
29901,
29894,
29871,
29946,
29900,
29900,
29900,
29900,
29895,
847,
7050,
29914,
1688,
29918,
558,
391,
457,
29889,
1526,
29946,
29908,
1273,
313,
29888,
978,
29892,
29897,
13,
1678,
2897,
29889,
5205,
29898,
9006,
29897,
13,
13,
1678,
7840,
29918,
558,
275,
353,
2071,
9641,
29889,
601,
29889,
29894,
949,
11974,
7050,
29914,
1688,
29918,
558,
391,
457,
29889,
1526,
29946,
613,
1881,
8977,
3790,
28560,
687,
2396,
525,
29900,
16675,
408,
29918,
7979,
29891,
29922,
5574,
467,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
13,
1678,
323,
29892,
379,
29892,
399,
29892,
315,
353,
7840,
29918,
558,
275,
29889,
12181,
13,
13,
1678,
12109,
29918,
29882,
353,
379,
448,
3171,
13,
1678,
12109,
29918,
29893,
353,
399,
448,
2920,
13,
1678,
20444,
29892,
432,
29894,
353,
7442,
29889,
4467,
29882,
7720,
29898,
9302,
29889,
279,
927,
29898,
26859,
29918,
29882,
511,
7442,
29889,
279,
927,
29898,
26859,
29918,
29893,
511,
29234,
29922,
8824,
29892,
26190,
2433,
823,
1495,
13,
1678,
20444,
353,
20444,
29889,
690,
14443,
6278,
29896,
29897,
13,
1678,
432,
29894,
353,
432,
29894,
29889,
690,
14443,
6278,
29896,
29897,
13,
13,
1678,
432,
8235,
353,
7442,
29889,
8172,
29889,
546,
6149,
362,
29898,
26859,
29918,
29882,
29930,
26859,
29918,
29893,
29897,
13,
13,
1678,
20444,
353,
20444,
29961,
29926,
8235,
29962,
13,
1678,
432,
29894,
353,
432,
29894,
29961,
29926,
8235,
29962,
13,
1678,
9631,
353,
7442,
29889,
279,
927,
29898,
29896,
29892,
323,
29899,
29896,
29897,
13,
13,
1678,
4046,
353,
29871,
29900,
13,
1678,
363,
313,
29891,
29892,
921,
29897,
297,
14319,
29898,
440,
29892,
432,
29894,
1125,
13,
418,
7442,
29889,
8172,
29889,
845,
21897,
29898,
12427,
29897,
13,
418,
260,
353,
9631,
29961,
29900,
29962,
13,
418,
1781,
5041,
353,
7840,
29918,
558,
275,
29961,
29873,
29899,
29896,
29901,
29873,
29974,
29906,
29892,
343,
29901,
29891,
29974,
3545,
29892,
921,
29901,
29916,
29974,
2103,
29892,
29871,
29900,
29962,
13,
13,
418,
396,
2158,
2923,
13,
418,
396,
808,
3027,
29889,
601,
29889,
326,
7620,
11974,
7050,
29914,
1688,
29918,
29995,
29881,
29889,
2732,
29908,
1273,
313,
13400,
29892,
511,
7442,
29889,
29882,
1429,
3552,
16773,
5041,
29889,
579,
668,
29898,
9302,
29889,
13470,
29947,
511,
4319,
5041,
29889,
579,
668,
29898,
9302,
29889,
13470,
29947,
13697,
13,
13,
418,
298,
2176,
29945,
29918,
326,
29961,
13140,
29962,
353,
1781,
5041,
13,
418,
298,
2176,
29945,
29918,
8205,
29961,
13140,
29962,
353,
29871,
29900,
13,
418,
298,
2176,
29945,
29918,
3018,
524,
342,
29961,
13140,
29962,
353,
1020,
524,
342,
13,
418,
1283,
7224,
29961,
13140,
29962,
353,
518,
29891,
29892,
921,
29962,
13,
13,
418,
396,
808,
3027,
29889,
601,
29889,
326,
7620,
703,
21111,
22584,
29881,
29889,
2732,
29908,
1273,
313,
13140,
29892,
511,
13261,
29897,
13,
418,
4046,
4619,
29871,
29896,
13,
418,
22645,
4619,
29871,
29896,
13,
418,
565,
4046,
6736,
29871,
29906,
29900,
29901,
13,
4706,
2867,
13,
13,
29871,
736,
22645,
13,
13,
29937,
679,
278,
1353,
310,
13261,
267,
13,
9302,
29889,
8172,
29889,
26776,
29898,
29896,
29906,
29941,
29946,
29945,
29897,
13,
13,
29876,
29918,
7827,
29918,
8346,
353,
29871,
29953,
29906,
29946,
29896,
29955,
13,
5041,
29918,
3545,
353,
29871,
29906,
29945,
29953,
13,
5041,
29918,
2103,
353,
29871,
29906,
29945,
29953,
13,
29876,
29918,
305,
12629,
353,
29871,
29941,
13,
13,
29937,
18668,
353,
2323,
3515,
13,
29937,
285,
29881,
353,
3515,
2923,
13,
29888,
353,
298,
29945,
2272,
29889,
2283,
11219,
29885,
593,
29914,
16440,
29906,
29914,
29882,
1169,
24713,
29918,
4668,
29918,
29882,
29906,
29953,
29946,
29918,
29906,
29889,
29882,
2176,
29945,
742,
4464,
2433,
29893,
1495,
13,
13,
3027,
29918,
5041,
267,
353,
285,
29889,
3258,
29918,
24713,
877,
3027,
29918,
5041,
267,
742,
313,
29876,
29918,
7827,
29918,
8346,
29892,
302,
29918,
305,
12629,
29892,
13261,
29918,
3545,
29892,
13261,
29918,
2103,
511,
26688,
2433,
7411,
1495,
13,
3027,
29918,
5041,
267,
29889,
6229,
29879,
29961,
29900,
1822,
1643,
353,
525,
16175,
29915,
13,
3027,
29918,
5041,
267,
29889,
6229,
29879,
29961,
29896,
1822,
1643,
353,
525,
12719,
29915,
13,
3027,
29918,
5041,
267,
29889,
6229,
29879,
29961,
29906,
1822,
1643,
353,
525,
3545,
29915,
13,
3027,
29918,
5041,
267,
29889,
6229,
29879,
29961,
29941,
1822,
1643,
353,
525,
2103,
29915,
13,
13,
21134,
353,
285,
29889,
3258,
29918,
24713,
877,
21134,
742,
313,
29876,
29918,
7827,
29918,
8346,
29892,
511,
26688,
2433,
13470,
29947,
1495,
13,
14968,
842,
353,
285,
29889,
3258,
29918,
24713,
877,
842,
742,
313,
29876,
29918,
7827,
29918,
8346,
29892,
511,
26688,
2433,
13470,
29947,
1495,
13,
2696,
7224,
353,
285,
29889,
3258,
29918,
24713,
877,
2696,
7224,
742,
313,
29876,
29918,
7827,
29918,
8346,
29892,
29871,
29906,
511,
26688,
2433,
524,
29941,
29906,
1495,
13,
13,
29876,
29918,
13140,
353,
29871,
29900,
13,
29876,
29918,
13140,
353,
679,
29918,
2490,
6038,
5041,
267,
29898,
3027,
29918,
5041,
267,
29892,
11073,
29892,
7945,
842,
29892,
1283,
7224,
29892,
302,
29918,
13140,
29892,
1020,
524,
342,
29922,
29900,
29897,
13,
29876,
29918,
13140,
353,
679,
29918,
10052,
14968,
5041,
267,
29898,
3027,
29918,
5041,
267,
29892,
11073,
29892,
7945,
842,
29892,
1283,
7224,
29892,
302,
29918,
13140,
29892,
1020,
524,
342,
29922,
29900,
29897,
13,
29876,
29918,
13140,
353,
679,
29918,
2490,
6038,
5041,
267,
29898,
3027,
29918,
5041,
267,
29892,
11073,
29892,
7945,
842,
29892,
1283,
7224,
29892,
302,
29918,
13140,
29892,
1020,
524,
342,
29922,
29896,
29897,
13,
29876,
29918,
13140,
353,
679,
29918,
10052,
14968,
5041,
267,
29898,
3027,
29918,
5041,
267,
29892,
11073,
29892,
7945,
842,
29892,
1283,
7224,
29892,
302,
29918,
13140,
29892,
1020,
524,
342,
29922,
29896,
29897,
13,
2158,
302,
29918,
13140,
29892,
302,
29918,
7827,
29918,
8346,
13,
13,
29937,
29876,
29918,
13140,
353,
679,
29918,
10052,
1688,
5041,
267,
29898,
3027,
29918,
5041,
267,
29892,
11073,
29892,
7945,
842,
29892,
302,
29918,
13140,
29897,
13,
13,
29937,
29876,
29918,
13140,
353,
679,
29918,
2490,
342,
5041,
267,
29898,
3027,
29918,
5041,
267,
29892,
11073,
29892,
7945,
842,
29892,
302,
29918,
13140,
29897,
13,
13,
29888,
29889,
23126,
580,
13,
29888,
29889,
5358,
580,
13,
2
] |
fringes/python_zwoasi/zwoasi/examples/zwoasi_demo.py | drs251/fringes | 2 | 141054 | #!/usr/bin/env python
import argparse
import os
import sys
import time
import zwoasi as asi
__author__ = '<NAME>'
__version__ = '0.0.22'
__license__ = 'MIT'
def save_control_values(filename, settings):
filename += '.txt'
with open(filename, 'w') as f:
for k in sorted(settings.keys()):
f.write('%s: %s\n' % (k, str(settings[k])))
print('Camera settings saved to %s' % filename)
env_filename = os.getenv('ZWO_ASI_LIB')
parser = argparse.ArgumentParser(description='Process and save images from a camera')
parser.add_argument('filename',
nargs='?',
help='SDK library filename')
args = parser.parse_args()
# Initialize zwoasi with the name of the SDK library
if args.filename:
asi.init(args.filename)
elif env_filename:
asi.init(env_filename)
else:
print('The filename of the SDK library is required (or set ZWO_ASI_LIB environment variable with the filename)')
sys.exit(1)
num_cameras = asi.get_num_cameras()
if num_cameras == 0:
print('No cameras found')
sys.exit(0)
cameras_found = asi.list_cameras() # Models names of the connected cameras
if num_cameras == 1:
camera_id = 0
print('Found one camera: %s' % cameras_found[0])
else:
print('Found %d cameras' % num_cameras)
for n in range(num_cameras):
print(' %d: %s' % (n, cameras_found[n]))
# TO DO: allow user to select a camera
camera_id = 0
print('Using #%d: %s' % (camera_id, cameras_found[camera_id]))
camera = asi.Camera(camera_id)
camera_info = camera.get_camera_property()
# Get all of the camera controls
print('')
print('Camera controls:')
controls = camera.get_controls()
for cn in sorted(controls.keys()):
print(' %s:' % cn)
for k in sorted(controls[cn].keys()):
print(' %s: %s' % (k, repr(controls[cn][k])))
# Use minimum USB bandwidth permitted
camera.set_control_value(asi.ASI_BANDWIDTHOVERLOAD, camera.get_controls()['BandWidth']['MinValue'])
# Set some sensible defaults. They will need adjusting depending upon
# the sensitivity, lens and lighting conditions used.
camera.disable_dark_subtract()
camera.set_control_value(asi.ASI_GAIN, 150)
camera.set_control_value(asi.ASI_EXPOSURE, 30000)
camera.set_control_value(asi.ASI_WB_B, 99)
camera.set_control_value(asi.ASI_WB_R, 75)
camera.set_control_value(asi.ASI_GAMMA, 50)
camera.set_control_value(asi.ASI_BRIGHTNESS, 50)
camera.set_control_value(asi.ASI_FLIP, 0)
print('Enabling stills mode')
try:
# Force any single exposure to be halted
camera.stop_video_capture()
camera.stop_exposure()
except (KeyboardInterrupt, SystemExit):
raise
except:
pass
print('Capturing a single 8-bit mono image')
filename = 'image_mono.jpg'
camera.set_image_type(asi.ASI_IMG_RAW8)
camera.capture(filename=filename)
print('Saved to %s' % filename)
save_control_values(filename, camera.get_control_values())
print('Capturing a single 16-bit mono image')
filename = 'image_mono16.tiff'
camera.set_image_type(asi.ASI_IMG_RAW16)
camera.capture(filename=filename)
print('Saved to %s' % filename)
save_control_values(filename, camera.get_control_values())
if camera_info['IsColorCam']:
filename = 'image_color.jpg'
camera.set_image_type(asi.ASI_IMG_RGB24)
print('Capturing a single, color image')
camera.capture(filename=filename)
print('Saved to %s' % filename)
save_control_values(filename, camera.get_control_values())
else:
print('Color image not available with this camera')
# Enable video mode
try:
# Force any single exposure to be halted
camera.stop_exposure()
except (KeyboardInterrupt, SystemExit):
raise
except:
pass
print('Enabling video mode')
camera.start_video_capture()
# Restore all controls to default values except USB bandwidth
for c in controls:
if controls[c]['ControlType'] == asi.ASI_BANDWIDTHOVERLOAD:
continue
camera.set_control_value(controls[c]['ControlType'], controls[c]['DefaultValue'])
# Can autoexposure be used?
k = 'Exposure'
if 'Exposure' in controls and controls['Exposure']['IsAutoSupported']:
print('Enabling auto-exposure mode')
camera.set_control_value(asi.ASI_EXPOSURE,
controls['Exposure']['DefaultValue'],
auto=True)
if 'Gain' in controls and controls['Gain']['IsAutoSupported']:
print('Enabling automatic gain setting')
camera.set_control_value(asi.ASI_GAIN,
controls['Gain']['DefaultValue'],
auto=True)
# Keep max gain to the default but allow exposure to be increased to its maximum value if necessary
camera.set_control_value(controls['AutoExpMaxExp']['ControlType'], controls['AutoExpMaxExp']['MaxValue'])
print('Waiting for auto-exposure to compute correct settings ...')
sleep_interval = 0.100
df_last = None
gain_last = None
exposure_last = None
matches = 0
while True:
time.sleep(sleep_interval)
settings = camera.get_control_values()
df = camera.get_dropped_frames()
gain = settings['Gain']
exposure = settings['Exposure']
if df != df_last:
print(' Gain {gain:d} Exposure: {exposure:f} Dropped frames: {df:d}'
.format(gain=settings['Gain'],
exposure=settings['Exposure'],
df=df))
if gain == gain_last and exposure == exposure_last:
matches += 1
else:
matches = 0
if matches >= 5:
break
df_last = df
gain_last = gain
exposure_last = exposure
# Set the timeout, units are ms
timeout = (camera.get_control_value(asi.ASI_EXPOSURE)[0] / 1000) * 2 + 500
camera.default_timeout = timeout
if camera_info['IsColorCam']:
print('Capturing a single color frame')
filename = 'image_video_color.jpg'
camera.set_image_type(asi.ASI_IMG_RGB24)
camera.capture_video_frame(filename=filename)
else:
print('Capturing a single 8-bit mono frame')
filename = 'image_video_mono.jpg'
camera.set_image_type(asi.ASI_IMG_RAW8)
camera.capture_video_frame(filename=filename)
print('Saved to %s' % filename)
save_control_values(filename, camera.get_control_values())
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
5215,
1852,
5510,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
931,
13,
5215,
503,
827,
6840,
408,
28278,
13,
13,
13,
1649,
8921,
1649,
353,
12801,
5813,
16299,
13,
1649,
3259,
1649,
353,
525,
29900,
29889,
29900,
29889,
29906,
29906,
29915,
13,
1649,
506,
1947,
1649,
353,
525,
26349,
29915,
13,
13,
13,
1753,
4078,
29918,
6451,
29918,
5975,
29898,
9507,
29892,
6055,
1125,
13,
1678,
10422,
4619,
15300,
3945,
29915,
13,
1678,
411,
1722,
29898,
9507,
29892,
525,
29893,
1495,
408,
285,
29901,
13,
4706,
363,
413,
297,
12705,
29898,
11027,
29889,
8149,
580,
1125,
13,
9651,
285,
29889,
3539,
877,
29995,
29879,
29901,
1273,
29879,
29905,
29876,
29915,
1273,
313,
29895,
29892,
851,
29898,
11027,
29961,
29895,
29962,
4961,
13,
1678,
1596,
877,
20717,
6055,
7160,
304,
1273,
29879,
29915,
1273,
10422,
29897,
13,
13,
13,
6272,
29918,
9507,
353,
2897,
29889,
657,
6272,
877,
29999,
29956,
29949,
29918,
3289,
29902,
29918,
5265,
29933,
1495,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
7032,
322,
4078,
4558,
515,
263,
10656,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
9507,
742,
13,
462,
1678,
302,
5085,
2433,
29973,
742,
13,
462,
1678,
1371,
2433,
26912,
3489,
10422,
1495,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
29937,
25455,
503,
827,
6840,
411,
278,
1024,
310,
278,
12967,
3489,
13,
361,
6389,
29889,
9507,
29901,
13,
1678,
28278,
29889,
2344,
29898,
5085,
29889,
9507,
29897,
13,
23681,
8829,
29918,
9507,
29901,
13,
1678,
28278,
29889,
2344,
29898,
6272,
29918,
9507,
29897,
13,
2870,
29901,
13,
1678,
1596,
877,
1576,
10422,
310,
278,
12967,
3489,
338,
3734,
313,
272,
731,
796,
29956,
29949,
29918,
3289,
29902,
29918,
5265,
29933,
5177,
2286,
411,
278,
10422,
29897,
1495,
13,
1678,
10876,
29889,
13322,
29898,
29896,
29897,
13,
13,
1949,
29918,
29883,
4183,
294,
353,
28278,
29889,
657,
29918,
1949,
29918,
29883,
4183,
294,
580,
13,
361,
954,
29918,
29883,
4183,
294,
1275,
29871,
29900,
29901,
13,
1678,
1596,
877,
3782,
3949,
18464,
1476,
1495,
13,
1678,
10876,
29889,
13322,
29898,
29900,
29897,
13,
13,
29883,
4183,
294,
29918,
11940,
353,
28278,
29889,
1761,
29918,
29883,
4183,
294,
580,
29871,
396,
3382,
1379,
2983,
310,
278,
6631,
3949,
18464,
13,
13,
361,
954,
29918,
29883,
4183,
294,
1275,
29871,
29896,
29901,
13,
1678,
10656,
29918,
333,
353,
29871,
29900,
13,
1678,
1596,
877,
9692,
697,
10656,
29901,
1273,
29879,
29915,
1273,
3949,
18464,
29918,
11940,
29961,
29900,
2314,
13,
2870,
29901,
13,
1678,
1596,
877,
9692,
1273,
29881,
3949,
18464,
29915,
1273,
954,
29918,
29883,
4183,
294,
29897,
13,
1678,
363,
302,
297,
3464,
29898,
1949,
29918,
29883,
4183,
294,
1125,
13,
4706,
1596,
877,
1678,
1273,
29881,
29901,
1273,
29879,
29915,
1273,
313,
29876,
29892,
3949,
18464,
29918,
11940,
29961,
29876,
12622,
13,
1678,
396,
7495,
11662,
29901,
2758,
1404,
304,
1831,
263,
10656,
13,
1678,
10656,
29918,
333,
353,
29871,
29900,
13,
1678,
1596,
877,
15156,
396,
29995,
29881,
29901,
1273,
29879,
29915,
1273,
313,
26065,
29918,
333,
29892,
3949,
18464,
29918,
11940,
29961,
26065,
29918,
333,
12622,
13,
13,
26065,
353,
28278,
29889,
20717,
29898,
26065,
29918,
333,
29897,
13,
26065,
29918,
3888,
353,
10656,
29889,
657,
29918,
26065,
29918,
6799,
580,
13,
13,
29937,
3617,
599,
310,
278,
10656,
11761,
13,
2158,
877,
1495,
13,
2158,
877,
20717,
11761,
29901,
1495,
13,
26255,
353,
10656,
29889,
657,
29918,
26255,
580,
13,
1454,
274,
29876,
297,
12705,
29898,
26255,
29889,
8149,
580,
1125,
13,
1678,
1596,
877,
1678,
1273,
29879,
11283,
1273,
274,
29876,
29897,
13,
1678,
363,
413,
297,
12705,
29898,
26255,
29961,
18038,
1822,
8149,
580,
1125,
13,
4706,
1596,
877,
4706,
1273,
29879,
29901,
1273,
29879,
29915,
1273,
313,
29895,
29892,
2062,
29898,
26255,
29961,
18038,
3816,
29895,
29962,
4961,
13,
13,
13,
29937,
4803,
9212,
12951,
3719,
2103,
21905,
13,
26065,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
29933,
9468,
22574,
29949,
5348,
29428,
29892,
10656,
29889,
657,
29918,
26255,
580,
1839,
29933,
392,
6110,
16215,
8140,
1917,
11287,
13,
13,
29937,
3789,
777,
25182,
21274,
29889,
2688,
674,
817,
10365,
292,
8679,
2501,
13,
29937,
278,
4771,
24858,
29892,
301,
575,
322,
3578,
292,
5855,
1304,
29889,
13,
26065,
29889,
20472,
29918,
26031,
29918,
1491,
29873,
1461,
580,
13,
13,
26065,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
12739,
1177,
29892,
29871,
29896,
29945,
29900,
29897,
13,
26065,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
5746,
24815,
11499,
29892,
29871,
29941,
29900,
29900,
29900,
29900,
29897,
13,
26065,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
29956,
29933,
29918,
29933,
29892,
29871,
29929,
29929,
29897,
13,
26065,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
29956,
29933,
29918,
29934,
29892,
29871,
29955,
29945,
29897,
13,
26065,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
29954,
5194,
1529,
29892,
29871,
29945,
29900,
29897,
13,
26065,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
29933,
22789,
3912,
8186,
1799,
29892,
29871,
29945,
29900,
29897,
13,
26065,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
29943,
5265,
29925,
29892,
29871,
29900,
29897,
13,
13,
13,
2158,
877,
2369,
17961,
1603,
29879,
4464,
1495,
13,
2202,
29901,
13,
1678,
396,
11004,
738,
2323,
14060,
545,
304,
367,
25212,
287,
13,
1678,
10656,
29889,
9847,
29918,
9641,
29918,
17885,
545,
580,
13,
1678,
10656,
29889,
9847,
29918,
735,
1066,
545,
580,
13,
19499,
313,
2558,
3377,
4074,
6685,
29892,
2184,
24365,
1125,
13,
1678,
12020,
13,
19499,
29901,
13,
1678,
1209,
13,
13,
2158,
877,
21133,
3864,
263,
2323,
29871,
29947,
29899,
2966,
1601,
29877,
1967,
1495,
13,
9507,
353,
525,
3027,
29918,
29885,
3231,
29889,
6173,
29915,
13,
26065,
29889,
842,
29918,
3027,
29918,
1853,
29898,
6840,
29889,
3289,
29902,
29918,
7833,
29954,
29918,
4717,
29956,
29947,
29897,
13,
26065,
29889,
17885,
545,
29898,
9507,
29922,
9507,
29897,
13,
2158,
877,
29903,
10511,
304,
1273,
29879,
29915,
1273,
10422,
29897,
13,
7620,
29918,
6451,
29918,
5975,
29898,
9507,
29892,
10656,
29889,
657,
29918,
6451,
29918,
5975,
3101,
13,
13,
13,
2158,
877,
21133,
3864,
263,
2323,
29871,
29896,
29953,
29899,
2966,
1601,
29877,
1967,
1495,
13,
9507,
353,
525,
3027,
29918,
29885,
3231,
29896,
29953,
29889,
29873,
2593,
29915,
13,
26065,
29889,
842,
29918,
3027,
29918,
1853,
29898,
6840,
29889,
3289,
29902,
29918,
7833,
29954,
29918,
4717,
29956,
29896,
29953,
29897,
13,
26065,
29889,
17885,
545,
29898,
9507,
29922,
9507,
29897,
13,
2158,
877,
29903,
10511,
304,
1273,
29879,
29915,
1273,
10422,
29897,
13,
7620,
29918,
6451,
29918,
5975,
29898,
9507,
29892,
10656,
29889,
657,
29918,
6451,
29918,
5975,
3101,
13,
13,
361,
10656,
29918,
3888,
1839,
3624,
3306,
14353,
2033,
29901,
13,
1678,
10422,
353,
525,
3027,
29918,
2780,
29889,
6173,
29915,
13,
1678,
10656,
29889,
842,
29918,
3027,
29918,
1853,
29898,
6840,
29889,
3289,
29902,
29918,
7833,
29954,
29918,
28212,
29906,
29946,
29897,
13,
1678,
1596,
877,
21133,
3864,
263,
2323,
29892,
2927,
1967,
1495,
13,
1678,
10656,
29889,
17885,
545,
29898,
9507,
29922,
9507,
29897,
13,
1678,
1596,
877,
29903,
10511,
304,
1273,
29879,
29915,
1273,
10422,
29897,
13,
1678,
4078,
29918,
6451,
29918,
5975,
29898,
9507,
29892,
10656,
29889,
657,
29918,
6451,
29918,
5975,
3101,
13,
2870,
29901,
13,
1678,
1596,
877,
3306,
1967,
451,
3625,
411,
445,
10656,
1495,
13,
268,
13,
29937,
1174,
519,
4863,
4464,
13,
2202,
29901,
13,
1678,
396,
11004,
738,
2323,
14060,
545,
304,
367,
25212,
287,
13,
1678,
10656,
29889,
9847,
29918,
735,
1066,
545,
580,
13,
19499,
313,
2558,
3377,
4074,
6685,
29892,
2184,
24365,
1125,
13,
1678,
12020,
13,
19499,
29901,
13,
1678,
1209,
13,
13,
2158,
877,
2369,
17961,
4863,
4464,
1495,
13,
26065,
29889,
2962,
29918,
9641,
29918,
17885,
545,
580,
13,
13,
29937,
11654,
487,
599,
11761,
304,
2322,
1819,
5174,
12951,
3719,
2103,
13,
1454,
274,
297,
11761,
29901,
13,
1678,
565,
11761,
29961,
29883,
22322,
4809,
1542,
2033,
1275,
28278,
29889,
3289,
29902,
29918,
29933,
9468,
22574,
29949,
5348,
29428,
29901,
13,
4706,
6773,
13,
1678,
10656,
29889,
842,
29918,
6451,
29918,
1767,
29898,
26255,
29961,
29883,
22322,
4809,
1542,
7464,
11761,
29961,
29883,
22322,
4592,
1917,
11287,
13,
13,
29937,
1815,
4469,
735,
1066,
545,
367,
1304,
29973,
13,
29895,
353,
525,
1252,
1066,
545,
29915,
13,
361,
525,
1252,
1066,
545,
29915,
297,
11761,
322,
11761,
1839,
1252,
1066,
545,
16215,
3624,
12300,
14039,
287,
2033,
29901,
13,
1678,
1596,
877,
2369,
17961,
4469,
29899,
735,
1066,
545,
4464,
1495,
13,
1678,
10656,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
5746,
24815,
11499,
29892,
13,
462,
632,
11761,
1839,
1252,
1066,
545,
16215,
4592,
1917,
7464,
13,
462,
632,
4469,
29922,
5574,
29897,
13,
13,
1678,
565,
525,
29954,
475,
29915,
297,
11761,
322,
11761,
1839,
29954,
475,
16215,
3624,
12300,
14039,
287,
2033,
29901,
13,
4706,
1596,
877,
2369,
17961,
18428,
11581,
4444,
1495,
13,
4706,
10656,
29889,
842,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
12739,
1177,
29892,
13,
462,
462,
11761,
1839,
29954,
475,
16215,
4592,
1917,
7464,
13,
462,
462,
4469,
29922,
5574,
29897,
13,
13,
1678,
396,
19152,
4236,
11581,
304,
278,
2322,
541,
2758,
14060,
545,
304,
367,
11664,
304,
967,
7472,
995,
565,
5181,
13,
1678,
10656,
29889,
842,
29918,
6451,
29918,
1767,
29898,
26255,
1839,
12300,
9544,
7976,
9544,
16215,
4809,
1542,
7464,
11761,
1839,
12300,
9544,
7976,
9544,
16215,
7976,
1917,
11287,
13,
13,
1678,
1596,
877,
15716,
292,
363,
4469,
29899,
735,
1066,
545,
304,
10272,
1959,
6055,
2023,
1495,
13,
1678,
8709,
29918,
19207,
353,
29871,
29900,
29889,
29896,
29900,
29900,
13,
1678,
4489,
29918,
4230,
353,
6213,
13,
1678,
11581,
29918,
4230,
353,
6213,
13,
1678,
14060,
545,
29918,
4230,
353,
6213,
13,
1678,
7087,
353,
29871,
29900,
13,
1678,
1550,
5852,
29901,
13,
4706,
931,
29889,
17059,
29898,
17059,
29918,
19207,
29897,
13,
4706,
6055,
353,
10656,
29889,
657,
29918,
6451,
29918,
5975,
580,
13,
4706,
4489,
353,
10656,
29889,
657,
29918,
26419,
2986,
29918,
19935,
580,
13,
4706,
11581,
353,
6055,
1839,
29954,
475,
2033,
13,
4706,
14060,
545,
353,
6055,
1839,
1252,
1066,
545,
2033,
13,
4706,
565,
4489,
2804,
4489,
29918,
4230,
29901,
13,
9651,
1596,
877,
259,
402,
475,
426,
29887,
475,
29901,
29881,
29913,
29871,
1222,
1066,
545,
29901,
426,
735,
1066,
545,
29901,
29888,
29913,
22938,
2986,
16608,
29901,
426,
2176,
29901,
29881,
10162,
13,
462,
29871,
869,
4830,
29898,
29887,
475,
29922,
11027,
1839,
29954,
475,
7464,
13,
462,
3986,
14060,
545,
29922,
11027,
1839,
1252,
1066,
545,
7464,
13,
462,
3986,
4489,
29922,
2176,
876,
13,
9651,
565,
11581,
1275,
11581,
29918,
4230,
322,
14060,
545,
1275,
14060,
545,
29918,
4230,
29901,
13,
18884,
7087,
4619,
29871,
29896,
13,
9651,
1683,
29901,
13,
18884,
7087,
353,
29871,
29900,
13,
9651,
565,
7087,
6736,
29871,
29945,
29901,
13,
18884,
2867,
13,
9651,
4489,
29918,
4230,
353,
4489,
13,
9651,
11581,
29918,
4230,
353,
11581,
13,
9651,
14060,
545,
29918,
4230,
353,
14060,
545,
13,
13,
29937,
3789,
278,
11815,
29892,
10340,
526,
10887,
13,
15619,
353,
313,
26065,
29889,
657,
29918,
6451,
29918,
1767,
29898,
6840,
29889,
3289,
29902,
29918,
5746,
24815,
11499,
9601,
29900,
29962,
847,
29871,
29896,
29900,
29900,
29900,
29897,
334,
29871,
29906,
718,
29871,
29945,
29900,
29900,
13,
26065,
29889,
4381,
29918,
15619,
353,
11815,
13,
13,
361,
10656,
29918,
3888,
1839,
3624,
3306,
14353,
2033,
29901,
13,
1678,
1596,
877,
21133,
3864,
263,
2323,
2927,
3515,
1495,
13,
1678,
10422,
353,
525,
3027,
29918,
9641,
29918,
2780,
29889,
6173,
29915,
13,
1678,
10656,
29889,
842,
29918,
3027,
29918,
1853,
29898,
6840,
29889,
3289,
29902,
29918,
7833,
29954,
29918,
28212,
29906,
29946,
29897,
13,
1678,
10656,
29889,
17885,
545,
29918,
9641,
29918,
2557,
29898,
9507,
29922,
9507,
29897,
13,
2870,
29901,
13,
1678,
1596,
877,
21133,
3864,
263,
2323,
29871,
29947,
29899,
2966,
1601,
29877,
3515,
1495,
13,
1678,
10422,
353,
525,
3027,
29918,
9641,
29918,
29885,
3231,
29889,
6173,
29915,
13,
1678,
10656,
29889,
842,
29918,
3027,
29918,
1853,
29898,
6840,
29889,
3289,
29902,
29918,
7833,
29954,
29918,
4717,
29956,
29947,
29897,
13,
1678,
10656,
29889,
17885,
545,
29918,
9641,
29918,
2557,
29898,
9507,
29922,
9507,
29897,
13,
13,
2158,
877,
29903,
10511,
304,
1273,
29879,
29915,
1273,
10422,
29897,
13,
7620,
29918,
6451,
29918,
5975,
29898,
9507,
29892,
10656,
29889,
657,
29918,
6451,
29918,
5975,
3101,
13,
2
] |
detect.py | tranbamanh229289/Facenet | 0 | 163201 | <filename>detect.py
from os import listdir
from PIL import Image
import numpy
from numpy import asarray
from numpy import savez_compressed
from matplotlib import pyplot as plt
from tensorflow.keras.models import load_model
#detection
def extract_face(filename ) :
image = Image.open(filename)
image = image.convert('RGB')
pixel = asarray(image)
image = Image.fromarray(pixel)
image = image.resize((160,160))
face_array = asarray(image)
return face_array
def load_face(link):
faces= list()
for i in listdir(link ):
path = link +i
face= extract_face (path )
faces.append(face)
return faces
def load_data(link ):
X=list()
Y=list()
for i in listdir (link ):
path = link+i+'/'
faces= load_face(path)
label = [i for _ in range (len(faces))]
X.extend(faces)
Y.extend(label)
return X,Y
link_train ='/home/face_id/Facenet/VN_train/'
link_test='/home/face_id/Facenet/VN_test/'
train_x ,train_y= load_data(link_train)
test_x,test_y=load_data(link_test)
savez_compressed('/home/face_id/Facenet/data.npz',train_x,train_y,test_x,test_y)
data=numpy.load('/home/face_id/Facenet/data.npz') | [
1,
529,
9507,
29958,
4801,
522,
29889,
2272,
13,
3166,
2897,
1053,
1051,
3972,
30004,
13,
3166,
349,
6227,
1053,
7084,
30004,
13,
5215,
12655,
30004,
13,
3166,
12655,
1053,
408,
2378,
30004,
13,
3166,
12655,
1053,
4078,
29920,
29918,
510,
13120,
30004,
13,
3166,
22889,
1053,
11451,
5317,
408,
14770,
30004,
13,
3166,
26110,
29889,
3946,
294,
29889,
9794,
1053,
2254,
29918,
4299,
30004,
13,
30004,
13,
30004,
13,
29937,
29881,
2650,
428,
30004,
13,
1753,
6597,
29918,
2161,
29898,
9507,
1723,
584,
30004,
13,
1678,
1967,
353,
7084,
29889,
3150,
29898,
9507,
8443,
13,
1678,
1967,
353,
1967,
29889,
13441,
877,
28212,
1495,
30004,
13,
1678,
15526,
353,
408,
2378,
29898,
3027,
8443,
13,
1678,
1967,
353,
7084,
29889,
3166,
2378,
29898,
29886,
15711,
8443,
13,
1678,
1967,
353,
1967,
29889,
21476,
3552,
29896,
29953,
29900,
29892,
29896,
29953,
29900,
876,
30004,
13,
1678,
3700,
29918,
2378,
353,
408,
2378,
29898,
3027,
8443,
13,
1678,
736,
3700,
29918,
2378,
30004,
13,
1753,
2254,
29918,
2161,
29898,
2324,
1125,
30004,
13,
1678,
17240,
29922,
1051,
26471,
13,
1678,
363,
474,
297,
1051,
3972,
29898,
2324,
29871,
1125,
30004,
13,
4706,
2224,
353,
1544,
718,
29875,
30004,
13,
4706,
3700,
29922,
6597,
29918,
2161,
313,
2084,
1723,
30004,
13,
4706,
17240,
29889,
4397,
29898,
2161,
8443,
13,
1678,
736,
17240,
30004,
13,
1753,
2254,
29918,
1272,
29898,
2324,
29871,
1125,
30004,
13,
1678,
1060,
29922,
1761,
26471,
13,
1678,
612,
29922,
1761,
26471,
13,
1678,
363,
474,
297,
1051,
3972,
313,
2324,
29871,
1125,
30004,
13,
4706,
2224,
353,
1544,
29974,
29875,
23097,
22208,
30004,
13,
4706,
17240,
29922,
2254,
29918,
2161,
29898,
2084,
8443,
13,
4706,
3858,
353,
518,
29875,
363,
903,
297,
3464,
313,
2435,
29898,
8726,
28166,
30004,
13,
4706,
1060,
29889,
21843,
29898,
8726,
8443,
13,
4706,
612,
29889,
21843,
29898,
1643,
8443,
13,
1678,
736,
1060,
29892,
29979,
30004,
13,
30004,
13,
2324,
29918,
14968,
353,
29915,
29914,
5184,
29914,
2161,
29918,
333,
29914,
29943,
562,
264,
300,
29914,
29963,
29940,
29918,
14968,
22208,
30004,
13,
2324,
29918,
1688,
2433,
29914,
5184,
29914,
2161,
29918,
333,
29914,
29943,
562,
264,
300,
29914,
29963,
29940,
29918,
1688,
22208,
30004,
13,
14968,
29918,
29916,
1919,
14968,
29918,
29891,
29922,
2254,
29918,
1272,
29898,
2324,
29918,
14968,
8443,
13,
1688,
29918,
29916,
29892,
1688,
29918,
29891,
29922,
1359,
29918,
1272,
29898,
2324,
29918,
1688,
8443,
13,
7620,
29920,
29918,
510,
13120,
11219,
5184,
29914,
2161,
29918,
333,
29914,
29943,
562,
264,
300,
29914,
1272,
29889,
9302,
29920,
742,
14968,
29918,
29916,
29892,
14968,
29918,
29891,
29892,
1688,
29918,
29916,
29892,
1688,
29918,
29891,
8443,
13,
1272,
29922,
23749,
29889,
1359,
11219,
5184,
29914,
2161,
29918,
333,
29914,
29943,
562,
264,
300,
29914,
1272,
29889,
9302,
29920,
1495,
2
] |
loadtest/example3.py | elyssonmr/loadtest-TDC-POA2018 | 2 | 177676 | from random import randint
import os
from locust import HttpLocust, TaskSet, task
MAX_TIME = int(os.environ.get("MAX_TIME", 2000))
print(f"Response time should not be higher than {MAX_TIME} ms")
class APITasks(TaskSet):
def on_start(self):
for i in range(1, 6):
book = {
"Title": f"My Little Book {i}",
"ID": f"{i}"
}
self.client.post("/api/books", json=book)
def _check_response_time(self, resp):
elapsed = resp.elapsed.microseconds / 1000
if resp.status_code == 200 and elapsed > MAX_TIME:
resp.failure(
"Response time is bigger than expected. "
f"Got: {resp.elapsed}, expected: {MAX_TIME}")
@task(10)
def allBooks(self):
with self.client.get("/api/books", catch_response=True) as resp:
self._check_response_time(resp)
@task(5)
def especificBook(self):
seed = randint(1, 5)
with self.client.get(
f"/api/books/{seed}", name="/api/books/ID",
catch_response=True) as resp:
self._check_response_time(resp)
class APIUser(HttpLocust):
task_set = APITasks
min_wait = 5000
max_wait = 15000
host = "https://fakerestapi.azurewebsites.net"
| [
1,
515,
4036,
1053,
20088,
524,
13,
5215,
2897,
13,
13,
3166,
1180,
504,
1053,
9056,
3524,
504,
29892,
9330,
2697,
29892,
3414,
13,
13,
13,
12648,
29918,
15307,
353,
938,
29898,
359,
29889,
21813,
29889,
657,
703,
12648,
29918,
15307,
613,
29871,
29906,
29900,
29900,
29900,
876,
13,
2158,
29898,
29888,
29908,
5103,
931,
881,
451,
367,
6133,
1135,
426,
12648,
29918,
15307,
29913,
10887,
1159,
13,
13,
13,
1990,
12279,
1806,
1278,
29879,
29898,
5398,
2697,
1125,
13,
1678,
822,
373,
29918,
2962,
29898,
1311,
1125,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
29871,
29953,
1125,
13,
9651,
3143,
353,
426,
13,
18884,
376,
7030,
1115,
285,
29908,
3421,
11143,
6726,
426,
29875,
17671,
13,
18884,
376,
1367,
1115,
285,
29908,
29912,
29875,
5038,
13,
9651,
500,
13,
9651,
1583,
29889,
4645,
29889,
2490,
11974,
2754,
29914,
12733,
613,
4390,
29922,
2909,
29897,
13,
13,
1678,
822,
903,
3198,
29918,
5327,
29918,
2230,
29898,
1311,
29892,
4613,
1125,
13,
4706,
560,
28170,
353,
4613,
29889,
295,
28170,
29889,
29885,
2357,
23128,
847,
29871,
29896,
29900,
29900,
29900,
13,
4706,
565,
4613,
29889,
4882,
29918,
401,
1275,
29871,
29906,
29900,
29900,
322,
560,
28170,
1405,
18134,
29918,
15307,
29901,
13,
9651,
4613,
29889,
14057,
545,
29898,
13,
18884,
376,
5103,
931,
338,
16600,
1135,
3806,
29889,
376,
13,
18884,
285,
29908,
29954,
327,
29901,
426,
13713,
29889,
295,
28170,
1118,
3806,
29901,
426,
12648,
29918,
15307,
27195,
13,
13,
1678,
732,
7662,
29898,
29896,
29900,
29897,
13,
1678,
822,
599,
10967,
29879,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
4645,
29889,
657,
11974,
2754,
29914,
12733,
613,
4380,
29918,
5327,
29922,
5574,
29897,
408,
4613,
29901,
13,
9651,
1583,
3032,
3198,
29918,
5327,
29918,
2230,
29898,
13713,
29897,
13,
13,
1678,
732,
7662,
29898,
29945,
29897,
13,
1678,
822,
13894,
928,
10967,
29898,
1311,
1125,
13,
4706,
16717,
353,
20088,
524,
29898,
29896,
29892,
29871,
29945,
29897,
13,
4706,
411,
1583,
29889,
4645,
29889,
657,
29898,
13,
18884,
285,
23901,
2754,
29914,
12733,
19248,
26776,
17671,
1024,
13802,
2754,
29914,
12733,
29914,
1367,
613,
13,
18884,
4380,
29918,
5327,
29922,
5574,
29897,
408,
4613,
29901,
13,
9651,
1583,
3032,
3198,
29918,
5327,
29918,
2230,
29898,
13713,
29897,
13,
13,
1990,
3450,
2659,
29898,
5506,
3524,
504,
1125,
13,
1678,
3414,
29918,
842,
353,
12279,
1806,
1278,
29879,
13,
1678,
1375,
29918,
10685,
353,
29871,
29945,
29900,
29900,
29900,
13,
1678,
4236,
29918,
10685,
353,
29871,
29896,
29945,
29900,
29900,
29900,
13,
1678,
3495,
353,
376,
991,
597,
29888,
5790,
342,
2754,
29889,
17688,
2676,
16315,
29889,
1212,
29908,
13,
2
] |
RecoLocalCalo/Configuration/python/ecalLocalRecoSequenceCosmics_cff.py | Purva-Chaudhari/cmssw | 852 | 41439 | <reponame>Purva-Chaudhari/cmssw
import FWCore.ParameterSet.Config as cms
# Calo geometry service model
#
# removed by tommaso
#
#ECAL conditions
# include "CalibCalorimetry/EcalTrivialCondModules/data/EcalTrivialCondRetriever.cfi"
#
#TPG condition needed by ecalRecHit producer if TT recovery is ON
from RecoLocalCalo.EcalRecProducers.ecalRecHitTPGConditions_cff import *
#ECAL reconstruction
from RecoLocalCalo.EcalRecProducers.ecalWeightUncalibRecHit_cfi import *
from RecoLocalCalo.EcalRecProducers.ecalFixedAlphaBetaFitUncalibRecHit_cfi import *
from RecoLocalCalo.EcalRecProducers.ecalRecHit_cff import *
ecalRecHit.cpu.EBuncalibRecHitCollection = 'ecalFixedAlphaBetaFitUncalibRecHit:EcalUncalibRecHitsEB'
ecalRecHit.cpu.EEuncalibRecHitCollection = 'ecalFixedAlphaBetaFitUncalibRecHit:EcalUncalibRecHitsEE'
ecalRecHit.cpu.ChannelStatusToBeExcluded = [
'kDAC',
'kNoLaser',
'kNoisy',
'kNNoisy',
'kFixedG6',
'kFixedG1',
'kFixedG0',
'kNonRespondingIsolated',
'kDeadVFE',
'kDeadFE',
'kNoDataNoTP'
]
from RecoLocalCalo.EcalRecProducers.ecalPreshowerRecHit_cfi import *
from RecoLocalCalo.EcalRecProducers.ecalDetIdToBeRecovered_cfi import *
ecalLocalRecoTaskCosmics = cms.Task(
ecalFixedAlphaBetaFitUncalibRecHit,
ecalWeightUncalibRecHit,
ecalDetIdToBeRecovered,
ecalCalibratedRecHitTask,
ecalPreshowerRecHit
)
ecalLocalRecoSequenceCosmics = cms.Sequence(ecalLocalRecoTaskCosmics)
| [
1,
529,
276,
1112,
420,
29958,
29925,
332,
1564,
29899,
1451,
15052,
29882,
1306,
29914,
4912,
893,
29893,
13,
5215,
383,
29956,
9203,
29889,
9329,
2697,
29889,
3991,
408,
274,
1516,
13,
13,
29937,
3037,
29877,
16303,
2669,
1904,
13,
29937,
13,
29937,
6206,
491,
260,
3011,
17764,
13,
29937,
13,
29937,
11206,
1964,
5855,
13,
29937,
29871,
3160,
376,
7856,
747,
7856,
272,
17528,
719,
29914,
29923,
1052,
29911,
9473,
10983,
2111,
2540,
29914,
1272,
29914,
29923,
1052,
29911,
9473,
10983,
8015,
2546,
369,
29889,
6854,
29875,
29908,
13,
29937,
13,
29937,
3557,
29954,
4195,
4312,
491,
321,
1052,
4789,
29950,
277,
14297,
565,
323,
29911,
24205,
338,
6732,
13,
3166,
3599,
29877,
7717,
29907,
7003,
29889,
29923,
1052,
4789,
23665,
22543,
29889,
687,
284,
4789,
29950,
277,
3557,
8766,
898,
2187,
29918,
29883,
600,
1053,
334,
13,
29937,
11206,
1964,
17789,
4080,
13,
3166,
3599,
29877,
7717,
29907,
7003,
29889,
29923,
1052,
4789,
23665,
22543,
29889,
687,
284,
22676,
2525,
1052,
747,
4789,
29950,
277,
29918,
6854,
29875,
1053,
334,
13,
3166,
3599,
29877,
7717,
29907,
7003,
29889,
29923,
1052,
4789,
23665,
22543,
29889,
687,
284,
26262,
28630,
29933,
1187,
29943,
277,
2525,
1052,
747,
4789,
29950,
277,
29918,
6854,
29875,
1053,
334,
13,
3166,
3599,
29877,
7717,
29907,
7003,
29889,
29923,
1052,
4789,
23665,
22543,
29889,
687,
284,
4789,
29950,
277,
29918,
29883,
600,
1053,
334,
13,
687,
284,
4789,
29950,
277,
29889,
21970,
29889,
25752,
348,
1052,
747,
4789,
29950,
277,
7196,
353,
525,
687,
284,
26262,
28630,
29933,
1187,
29943,
277,
2525,
1052,
747,
4789,
29950,
277,
29901,
29923,
1052,
2525,
1052,
747,
4789,
29950,
1169,
25752,
29915,
13,
687,
284,
4789,
29950,
277,
29889,
21970,
29889,
17896,
348,
1052,
747,
4789,
29950,
277,
7196,
353,
525,
687,
284,
26262,
28630,
29933,
1187,
29943,
277,
2525,
1052,
747,
4789,
29950,
277,
29901,
29923,
1052,
2525,
1052,
747,
4789,
29950,
1169,
17896,
29915,
13,
687,
284,
4789,
29950,
277,
29889,
21970,
29889,
13599,
5709,
1762,
3629,
1252,
13347,
353,
518,
13,
1678,
525,
29895,
29928,
2477,
742,
13,
1678,
525,
29895,
3782,
29931,
29440,
742,
13,
1678,
525,
29895,
3782,
13344,
742,
13,
1678,
525,
29895,
29940,
3782,
13344,
742,
259,
13,
1678,
525,
29895,
26262,
29954,
29953,
742,
13,
1678,
525,
29895,
26262,
29954,
29896,
742,
13,
1678,
525,
29895,
26262,
29954,
29900,
742,
13,
1678,
525,
29895,
12283,
1666,
2818,
292,
29902,
2929,
630,
742,
13,
1678,
525,
29895,
29928,
1479,
29963,
16359,
742,
13,
1678,
525,
29895,
29928,
1479,
16359,
742,
13,
1678,
525,
29895,
3782,
1469,
3782,
3557,
29915,
13,
29962,
13,
3166,
3599,
29877,
7717,
29907,
7003,
29889,
29923,
1052,
4789,
23665,
22543,
29889,
687,
284,
29925,
3781,
1680,
4789,
29950,
277,
29918,
6854,
29875,
1053,
334,
13,
3166,
3599,
29877,
7717,
29907,
7003,
29889,
29923,
1052,
4789,
23665,
22543,
29889,
687,
284,
6362,
1204,
1762,
3629,
4789,
957,
287,
29918,
6854,
29875,
1053,
334,
13,
13,
687,
284,
7717,
4789,
29877,
5398,
29907,
359,
29885,
1199,
353,
274,
1516,
29889,
5398,
29898,
13,
1678,
321,
1052,
26262,
28630,
29933,
1187,
29943,
277,
2525,
1052,
747,
4789,
29950,
277,
29892,
13,
1678,
321,
1052,
22676,
2525,
1052,
747,
4789,
29950,
277,
29892,
13,
1678,
321,
1052,
6362,
1204,
1762,
3629,
4789,
957,
287,
29892,
13,
1678,
321,
1052,
7856,
4626,
630,
4789,
29950,
277,
5398,
29892,
13,
1678,
321,
1052,
29925,
3781,
1680,
4789,
29950,
277,
13,
29897,
13,
687,
284,
7717,
4789,
29877,
20529,
29907,
359,
29885,
1199,
353,
274,
1516,
29889,
20529,
29898,
687,
284,
7717,
4789,
29877,
5398,
29907,
359,
29885,
1199,
29897,
13,
2
] |
moya/tests/test_expose.py | moyaproject/moya | 129 | 172028 | <reponame>moyaproject/moya
from __future__ import unicode_literals
from __future__ import print_function
import unittest
import os
from moya import db
from moya import pilot
from moya.wsgi import WSGIApplication
from moya.console import Console
from moya.context import Context
from moya.context.tools import set_dynamic
class TestExpose(unittest.TestCase):
"""Test exposed Python code in a project."""
def setUp(self):
_path = os.path.abspath(os.path.dirname(__file__))
path = os.path.join(_path, "testproject")
self.application = WSGIApplication(
path,
"settings.ini",
strict=True,
validate_db=False,
disable_autoreload=True,
)
console = Console()
self.archive = self.application.archive
db.sync_all(self.archive, console)
self.context = context = Context()
self.archive.populate_context(context)
self.application.populate_context(context)
set_dynamic(context)
context[".console"] = console
def tearDown(self):
del self.archive
del self.application
def test_macros(self):
app = self.archive.apps["site"]
self.assertEqual(6, self.archive("macro.expose.double", self.context, app, n=3))
self.assertEqual(
21, self.archive("macro.expose.tripple", self.context, app, n=7)
)
def test_filters(self):
app = self.archive.apps["site"]
self.context[".app"] = app
with pilot.manage(self.context):
self.assertEqual(1000, self.context.eval("10|'cube'"))
self.assertEqual(1000, self.context.eval("10|'cube from site'"))
self.assertEqual(1000, self.context.eval("10|.app.filters.cube"))
| [
1,
529,
276,
1112,
420,
29958,
4346,
29891,
481,
307,
622,
29914,
4346,
3761,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
13,
5215,
443,
27958,
13,
5215,
2897,
13,
13,
3166,
2730,
3761,
1053,
4833,
13,
3166,
2730,
3761,
1053,
19840,
13,
3166,
2730,
3761,
29889,
5652,
3146,
1053,
399,
26016,
29902,
4873,
13,
3166,
2730,
3761,
29889,
11058,
1053,
9405,
13,
3166,
2730,
3761,
29889,
4703,
1053,
15228,
13,
3166,
2730,
3761,
29889,
4703,
29889,
8504,
1053,
731,
29918,
16626,
13,
13,
13,
1990,
4321,
1252,
4220,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
9995,
3057,
19884,
5132,
775,
297,
263,
2060,
1213,
15945,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
903,
2084,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
876,
13,
4706,
2224,
353,
2897,
29889,
2084,
29889,
7122,
7373,
2084,
29892,
376,
1688,
4836,
1159,
13,
4706,
1583,
29889,
6214,
353,
399,
26016,
29902,
4873,
29898,
13,
9651,
2224,
29892,
13,
9651,
376,
11027,
29889,
2172,
613,
13,
9651,
9406,
29922,
5574,
29892,
13,
9651,
12725,
29918,
2585,
29922,
8824,
29892,
13,
9651,
11262,
29918,
8309,
7078,
328,
29922,
5574,
29892,
13,
4706,
1723,
13,
4706,
2991,
353,
9405,
580,
13,
4706,
1583,
29889,
10867,
353,
1583,
29889,
6214,
29889,
10867,
13,
4706,
4833,
29889,
16593,
29918,
497,
29898,
1311,
29889,
10867,
29892,
2991,
29897,
13,
4706,
1583,
29889,
4703,
353,
3030,
353,
15228,
580,
13,
13,
4706,
1583,
29889,
10867,
29889,
7323,
5987,
29918,
4703,
29898,
4703,
29897,
13,
4706,
1583,
29889,
6214,
29889,
7323,
5987,
29918,
4703,
29898,
4703,
29897,
13,
4706,
731,
29918,
16626,
29898,
4703,
29897,
13,
4706,
3030,
29961,
1642,
11058,
3108,
353,
2991,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
628,
1583,
29889,
10867,
13,
4706,
628,
1583,
29889,
6214,
13,
13,
1678,
822,
1243,
29918,
8628,
1883,
29898,
1311,
1125,
13,
4706,
623,
353,
1583,
29889,
10867,
29889,
13371,
3366,
2746,
3108,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29953,
29892,
1583,
29889,
10867,
703,
25254,
29889,
735,
4220,
29889,
8896,
613,
1583,
29889,
4703,
29892,
623,
29892,
302,
29922,
29941,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
632,
29906,
29896,
29892,
1583,
29889,
10867,
703,
25254,
29889,
735,
4220,
29889,
3626,
407,
280,
613,
1583,
29889,
4703,
29892,
623,
29892,
302,
29922,
29955,
29897,
13,
4706,
1723,
13,
13,
1678,
822,
1243,
29918,
26705,
29898,
1311,
1125,
13,
4706,
623,
353,
1583,
29889,
10867,
29889,
13371,
3366,
2746,
3108,
13,
4706,
1583,
29889,
4703,
29961,
1642,
932,
3108,
353,
623,
13,
4706,
411,
19840,
29889,
1171,
482,
29898,
1311,
29889,
4703,
1125,
13,
9651,
1583,
29889,
9294,
9843,
29898,
29896,
29900,
29900,
29900,
29892,
1583,
29889,
4703,
29889,
14513,
703,
29896,
29900,
29989,
29915,
29883,
4003,
29915,
5783,
13,
9651,
1583,
29889,
9294,
9843,
29898,
29896,
29900,
29900,
29900,
29892,
1583,
29889,
4703,
29889,
14513,
703,
29896,
29900,
29989,
29915,
29883,
4003,
515,
3268,
29915,
5783,
13,
9651,
1583,
29889,
9294,
9843,
29898,
29896,
29900,
29900,
29900,
29892,
1583,
29889,
4703,
29889,
14513,
703,
29896,
29900,
29989,
29889,
932,
29889,
26705,
29889,
29883,
4003,
5783,
13,
2
] |
split_test_train.py | malfonso0/mmdetection_object_detection_demo | 0 | 60868 | import random
import os
files= os.listdir("data/VOC2007/Annotations")
files = [os.path.splitext(file)[0] for file in files]
random.shuffle(files)
train_perc = .8
thres = int(len(files) * train_perc)
train=files[:thres]
test=files[thres+1:]
outfolder = "data/VOC2007/ImageSets/Main"
with open(os.path.join(outfolder, 'test.txt'), "w") as f:
f.write('\n'.join(test))
with open(os.path.join(outfolder, 'trainval.txt'), "w") as f:
f.write('\n'.join(train))
| [
1,
1053,
4036,
13,
5215,
2897,
13,
13,
5325,
29922,
2897,
29889,
1761,
3972,
703,
1272,
29914,
29963,
20166,
29906,
29900,
29900,
29955,
29914,
2744,
1333,
800,
1159,
13,
13,
5325,
353,
518,
359,
29889,
2084,
29889,
23579,
568,
486,
29898,
1445,
9601,
29900,
29962,
363,
934,
297,
2066,
29962,
13,
8172,
29889,
845,
21897,
29898,
5325,
29897,
13,
13,
13,
14968,
29918,
546,
29883,
353,
869,
29947,
13,
13,
386,
690,
353,
938,
29898,
2435,
29898,
5325,
29897,
334,
7945,
29918,
546,
29883,
29897,
13,
14968,
29922,
5325,
7503,
386,
690,
29962,
13,
1688,
29922,
5325,
29961,
386,
690,
29974,
29896,
17531,
13,
13,
449,
12083,
353,
376,
1272,
29914,
29963,
20166,
29906,
29900,
29900,
29955,
29914,
2940,
29903,
1691,
29914,
6330,
29908,
13,
2541,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
449,
12083,
29892,
525,
1688,
29889,
3945,
5477,
376,
29893,
1159,
408,
285,
29901,
13,
1678,
285,
29889,
3539,
28909,
29876,
4286,
7122,
29898,
1688,
876,
13,
2541,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
449,
12083,
29892,
525,
14968,
791,
29889,
3945,
5477,
376,
29893,
1159,
408,
285,
29901,
13,
1678,
285,
29889,
3539,
28909,
29876,
4286,
7122,
29898,
14968,
876,
13,
2
] |
Discord Gamesense/botcommands.py | ATSchell/Discord-Gamesense | 1 | 77788 | <reponame>ATSchell/Discord-Gamesense
import discord
import GameSenseLinker as gsl
from discord.ext import commands
import time
tracker=discord.client()
config=gsl.loadConfig()
#setup Gamesense using loaded config data
@tracker.event
async def on_ready():
gsl.setup(config)
#main method to check various conditions of a message
@tracker.event
async def on_message(collect):
#Ignore if the message comes from you
if collect.author.id != config["User_Id"] :
#Find member info based off User_Id
user=tracker.get_member(config["User_Id"])
if user.mentioned_in(collect):
gsl.mentionEvent(config)
while user.status == 'idle':
time.sleep(15)
gsl.mentionEvent()
elif config["Alert_on_active"]:
gsl.messageEvent(config)
while user.status == 'idle':
time.sleep(15)
gsl.messageEvent()
tracker.run(config["token"])
| [
1,
529,
276,
1112,
420,
29958,
1299,
4504,
514,
29914,
4205,
16090,
29899,
29954,
1280,
1947,
13,
5215,
2313,
536,
30004,
13,
5215,
8448,
29903,
1947,
6595,
261,
408,
330,
2536,
30004,
13,
3166,
2313,
536,
29889,
1062,
1053,
8260,
30004,
13,
5215,
931,
30004,
13,
30004,
13,
30004,
13,
3018,
4937,
29922,
2218,
16090,
29889,
4645,
26471,
13,
2917,
29922,
29887,
2536,
29889,
1359,
3991,
26471,
13,
29937,
14669,
12482,
1947,
773,
7500,
2295,
848,
30004,
13,
29992,
3018,
4937,
29889,
3696,
30004,
13,
12674,
822,
373,
29918,
2040,
7295,
30004,
13,
1678,
330,
2536,
29889,
14669,
29898,
2917,
8443,
13,
29937,
3396,
1158,
304,
1423,
5164,
5855,
310,
263,
2643,
30004,
13,
29992,
3018,
4937,
29889,
3696,
30004,
13,
12674,
822,
373,
29918,
4906,
29898,
15914,
1125,
30004,
13,
1678,
396,
23805,
565,
278,
2643,
5304,
515,
366,
30004,
13,
1678,
565,
6314,
29889,
8921,
29889,
333,
2804,
2295,
3366,
2659,
29918,
1204,
3108,
584,
30004,
13,
4706,
396,
12542,
4509,
5235,
2729,
1283,
4911,
29918,
1204,
30004,
13,
4706,
1404,
29922,
3018,
4937,
29889,
657,
29918,
14242,
29898,
2917,
3366,
2659,
29918,
1204,
20068,
30004,
13,
4706,
565,
1404,
29889,
358,
28487,
29918,
262,
29898,
15914,
1125,
30004,
13,
9651,
330,
2536,
29889,
358,
291,
2624,
29898,
2917,
8443,
13,
9651,
1550,
1404,
29889,
4882,
1275,
525,
333,
280,
2396,
30004,
13,
18884,
931,
29889,
17059,
29898,
29896,
29945,
8443,
13,
18884,
330,
2536,
29889,
358,
291,
2624,
26471,
13,
4706,
25342,
2295,
3366,
16649,
29918,
265,
29918,
4925,
3108,
29901,
30004,
13,
9651,
330,
2536,
29889,
4906,
2624,
29898,
2917,
8443,
13,
9651,
1550,
1404,
29889,
4882,
1275,
525,
333,
280,
2396,
30004,
13,
18884,
931,
29889,
17059,
29898,
29896,
29945,
8443,
13,
18884,
330,
2536,
29889,
4906,
2624,
26471,
13,
30004,
13,
3018,
4937,
29889,
3389,
29898,
2917,
3366,
6979,
20068,
30004,
13,
2
] |
quarkchain/evm/tests/new_statetest_utils.py | QuarkChain/pyquarkchain | 237 | 46755 | <reponame>QuarkChain/pyquarkchain
import sys
from quarkchain.evm.state import State
from quarkchain.evm.common import FakeHeader
from quarkchain.evm.utils import (
decode_hex,
parse_int_or_hex,
sha3,
to_string,
remove_0x_head,
encode_hex,
big_endian_to_int,
)
from quarkchain.evm.config import default_config, Env
from quarkchain.config import get_default_evm_config
from quarkchain.evm.exceptions import InvalidTransaction
import quarkchain.evm.transactions as transactions
from quarkchain.evm.messages import apply_transaction
from quarkchain.evm.specials import specials, configure_special_contract_ts
import copy
import os
from quarkchain.db import InMemoryDb
from quarkchain.utils import token_id_encode
config_string = ":info,eth.vm.log:trace,eth.vm.op:trace,eth.vm.stack:trace,eth.vm.exit:trace,eth.pb.msg:trace,eth.pb.tx:debug"
konfig = copy.copy(default_config)
# configure_logging(config_string=config_string)
fixture_path = os.path.join(os.path.dirname(__file__), "../..", "fixtures")
fake_headers = {}
def mk_fake_header(blknum):
if blknum not in fake_headers:
fake_headers[blknum] = FakeHeader(sha3(to_string(blknum)))
return fake_headers[blknum]
basic_env = {
"currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty": "0x020000",
"currentGasLimit": "0x7fffffffffffffff",
"currentNumber": "0x01",
"currentTimestamp": "0x03e8",
"previousHash": "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6",
}
evm_config = get_default_evm_config()
network_to_test = {"ConstantinopleFix"}
# Makes a diff between a prev and post state
def mk_state_diff(prev, post):
o = {}
for k in prev.keys():
if k not in post:
o[k] = ["-", prev[k]]
for k in post.keys():
if k not in prev:
o[k] = ["+", post[k]]
elif prev[k] != post[k]:
ok = {}
for key in ("nonce", "token_balances", "code"):
if prev[k][key] != post[k][key]:
ok[key] = [prev[k][key], "->", post[k][key]]
if prev[k]["storage"] != post[k]["storage"]:
ok["storage"] = {}
for sk in prev[k]["storage"].keys():
if sk not in post[k]["storage"]:
ok["storage"][sk] = ["-", prev[k]["storage"][sk]]
for sk in post[k]["storage"].keys():
if sk not in prev[k]["storage"]:
ok["storage"][sk] = ["+", post[k]["storage"][sk]]
else:
ok["storage"][sk] = [
prev[k]["storage"][sk],
"->",
post[k]["storage"][sk],
]
o[k] = ok
return o
# Compute a single unit of a state test
def compute_state_test_unit(state, txdata, indices, konfig, is_qkc_state, qkc_env=None):
state.env.config = konfig
s = state.snapshot()
if "transferTokenId" in txdata:
transfer_token_id = parse_int_or_hex(
txdata["transferTokenId"][indices["transferTokenId"]]
)
else:
transfer_token_id = token_id_encode("QKC")
try:
# Create the transaction
tx = transactions.Transaction(
nonce=parse_int_or_hex(txdata["nonce"] or b"0"),
gasprice=parse_int_or_hex(txdata["gasPrice"] or b"0"),
startgas=parse_int_or_hex(txdata["gasLimit"][indices["gas"]] or b"0"),
to=decode_hex(remove_0x_head(txdata["to"])),
value=parse_int_or_hex(txdata["value"][indices["value"]] or b"0"),
data=decode_hex(remove_0x_head(txdata["data"][indices["data"]])),
gas_token_id=token_id_encode("QKC"),
transfer_token_id=transfer_token_id,
# Should not set testing flag if testing QuarkChain state
is_testing=not is_qkc_state,
)
tx.set_quark_chain_config(qkc_env.quark_chain_config)
if "secretKey" in txdata:
tx.sign(decode_hex(remove_0x_head(txdata["secretKey"])))
else:
tx._in_mutable_context = True
tx.v = parse_int_or_hex(txdata["v"])
tx._in_mutable_context = False
# Run it
prev = copy.deepcopy(state.to_dict())
success, output = apply_transaction(state, tx, tx_wrapper_hash=bytes(32))
except InvalidTransaction as e:
print("Exception: %r" % e)
success, output = False, b""
# touch coinbase, make behavior consistent with go-ethereum
state.delta_token_balance(state.block_coinbase, token_id_encode("QKC"), 0)
state.commit()
post = state.to_dict()
output_decl = {
"hash": "0x" + encode_hex(state.trie.root_hash),
"indexes": indices,
"diff": mk_state_diff(prev, post),
}
state.revert(s)
return output_decl
# Initialize the state for state tests
def init_state(env, pre, is_qkc_state, qkc_env=None):
# Setup env
db = InMemoryDb()
state_env = Env(config=konfig)
state_env.db = db
state = State(
env=state_env,
block_prevhash=decode_hex(remove_0x_head(env["previousHash"])),
prev_headers=[
mk_fake_header(i)
for i in range(
parse_int_or_hex(env["currentNumber"]) - 1,
max(-1, parse_int_or_hex(env["currentNumber"]) - 257),
-1,
)
],
block_number=parse_int_or_hex(env["currentNumber"]),
block_coinbase=decode_hex(remove_0x_head(env["currentCoinbase"])),
block_difficulty=parse_int_or_hex(env["currentDifficulty"]),
gas_limit=parse_int_or_hex(env["currentGasLimit"]),
timestamp=parse_int_or_hex(env["currentTimestamp"]),
qkc_config=qkc_env.quark_chain_config,
# If testing QuarkChain states, should not use mock account
use_mock_evm_account=not is_qkc_state,
)
if "overrides" in env:
if "specialContractTimestamp" in env["overrides"]:
for overrides in env["overrides"]["specialContractTimestamp"]:
configure_special_contract_ts(
specials,
bytes.fromhex(overrides["address"]),
overrides["timestamp"],
)
seen_token_ids = set()
# Fill up pre
for address, h in list(pre.items()):
assert len(address) in (40, 42)
address = decode_hex(remove_0x_head(address))
state.set_nonce(address, parse_int_or_hex(h["nonce"]))
if is_qkc_state and "balances" in h:
# In QuarkChain state tests, can either specify balance map or single balance
for token_id, balance in h["balances"].items():
parsed_token_id = parse_int_or_hex(token_id)
state.set_token_balance(
address, parsed_token_id, parse_int_or_hex(balance)
)
seen_token_ids.add(parsed_token_id)
else:
state.set_balance(address, parse_int_or_hex(h["balance"]))
state.set_code(address, decode_hex(remove_0x_head(h["code"])))
for k, v in h["storage"].items():
state.set_storage_data(
address,
big_endian_to_int(decode_hex(k[2:])),
big_endian_to_int(decode_hex(v[2:])),
)
# Update allowed token IDs
if seen_token_ids:
state.qkc_config._allowed_token_ids = seen_token_ids
state.commit(allow_empties=True)
return state
class EnvNotFoundException(Exception):
pass
def verify_state_test(test):
print("Verifying state test")
if "env" not in test:
raise EnvNotFoundException("Env not found")
_state = init_state(test["env"], test["pre"], test["qkcstate"], qkc_env=test["qkc"])
for config_name, results in test["post"].items():
# Old protocol versions may not be supported
if config_name not in network_to_test:
continue
print("Testing for %s" % config_name)
for result in results:
data = test["transaction"]["data"][result["indexes"]["data"]]
if len(data) > 2000:
data = "data<%d>" % (len(data) // 2 - 1)
print(
"Checking for values: g %d v %d d %s (indexes g %d v %d d %d)"
% (
parse_int_or_hex(
test["transaction"]["gasLimit"][result["indexes"]["gas"]]
),
parse_int_or_hex(
test["transaction"]["value"][result["indexes"]["value"]]
),
data,
result["indexes"]["gas"],
result["indexes"]["value"],
result["indexes"]["data"],
)
)
computed = compute_state_test_unit(
_state,
test["transaction"],
result["indexes"],
evm_config,
test["qkcstate"],
qkc_env=test["qkc"],
)
if computed["hash"][-64:] != result["hash"][-64:]:
for k in computed["diff"]:
print(k, computed["diff"][k], file=sys.stderr)
print(test["filename"], test["testname"], file=sys.stderr)
raise Exception(
"Hash mismatch, computed: %s, supplied: %s"
% (computed["hash"], result["hash"])
)
else:
for k in computed["diff"]:
print(k, computed["diff"][k])
print("Hash matched!: %s" % computed["hash"])
return True
| [
1,
529,
276,
1112,
420,
29958,
2182,
935,
14688,
29914,
2272,
339,
935,
14153,
13,
5215,
10876,
13,
13,
3166,
439,
935,
14153,
29889,
5750,
29885,
29889,
3859,
1053,
4306,
13,
3166,
439,
935,
14153,
29889,
5750,
29885,
29889,
9435,
1053,
383,
1296,
7850,
13,
3166,
439,
935,
14153,
29889,
5750,
29885,
29889,
13239,
1053,
313,
13,
1678,
21822,
29918,
20970,
29892,
13,
1678,
6088,
29918,
524,
29918,
272,
29918,
20970,
29892,
13,
1678,
528,
29874,
29941,
29892,
13,
1678,
304,
29918,
1807,
29892,
13,
1678,
3349,
29918,
29900,
29916,
29918,
2813,
29892,
13,
1678,
19750,
29918,
20970,
29892,
13,
1678,
4802,
29918,
355,
713,
29918,
517,
29918,
524,
29892,
13,
29897,
13,
3166,
439,
935,
14153,
29889,
5750,
29885,
29889,
2917,
1053,
2322,
29918,
2917,
29892,
1174,
29894,
13,
3166,
439,
935,
14153,
29889,
2917,
1053,
679,
29918,
4381,
29918,
5750,
29885,
29918,
2917,
13,
3166,
439,
935,
14153,
29889,
5750,
29885,
29889,
11739,
29879,
1053,
21403,
12460,
13,
5215,
439,
935,
14153,
29889,
5750,
29885,
29889,
3286,
7387,
408,
22160,
13,
3166,
439,
935,
14153,
29889,
5750,
29885,
29889,
19158,
1053,
3394,
29918,
20736,
13,
3166,
439,
935,
14153,
29889,
5750,
29885,
29889,
5965,
455,
1338,
1053,
961,
455,
1338,
29892,
10822,
29918,
18732,
29918,
1285,
1461,
29918,
1372,
13,
5215,
3509,
13,
5215,
2897,
13,
3166,
439,
935,
14153,
29889,
2585,
1053,
512,
16015,
10234,
13,
3166,
439,
935,
14153,
29889,
13239,
1053,
5993,
29918,
333,
29918,
12508,
13,
13,
2917,
29918,
1807,
353,
29242,
3888,
29892,
621,
29889,
6925,
29889,
1188,
29901,
15003,
29892,
621,
29889,
6925,
29889,
459,
29901,
15003,
29892,
621,
29889,
6925,
29889,
1429,
29901,
15003,
29892,
621,
29889,
6925,
29889,
13322,
29901,
15003,
29892,
621,
29889,
24381,
29889,
7645,
29901,
15003,
29892,
621,
29889,
24381,
29889,
7508,
29901,
8382,
29908,
13,
13,
8077,
1003,
353,
3509,
29889,
8552,
29898,
4381,
29918,
2917,
29897,
13,
13,
29937,
10822,
29918,
21027,
29898,
2917,
29918,
1807,
29922,
2917,
29918,
1807,
29897,
13,
13,
7241,
15546,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
376,
6995,
636,
613,
376,
7241,
486,
1973,
1159,
13,
13,
29888,
1296,
29918,
13662,
353,
6571,
13,
13,
13,
1753,
14690,
29918,
29888,
1296,
29918,
6672,
29898,
2204,
29895,
1949,
1125,
13,
1678,
565,
1999,
29895,
1949,
451,
297,
25713,
29918,
13662,
29901,
13,
4706,
25713,
29918,
13662,
29961,
2204,
29895,
1949,
29962,
353,
383,
1296,
7850,
29898,
17051,
29941,
29898,
517,
29918,
1807,
29898,
2204,
29895,
1949,
4961,
13,
1678,
736,
25713,
29918,
13662,
29961,
2204,
29895,
1949,
29962,
13,
13,
13,
16121,
29918,
6272,
353,
426,
13,
1678,
376,
3784,
7967,
262,
3188,
1115,
376,
29900,
29916,
29906,
328,
29883,
29906,
29945,
29953,
29953,
29945,
29900,
29896,
29947,
7340,
29896,
1725,
29900,
29872,
29953,
12328,
29953,
29953,
29953,
29881,
562,
29947,
13801,
29906,
29953,
29929,
29955,
600,
29929,
2291,
613,
13,
1678,
376,
3784,
26023,
3953,
29891,
1115,
376,
29900,
29916,
29900,
29906,
29900,
29900,
29900,
29900,
613,
13,
1678,
376,
3784,
29954,
294,
24445,
1115,
376,
29900,
29916,
29955,
17156,
17156,
17156,
18725,
613,
13,
1678,
376,
3784,
4557,
1115,
376,
29900,
29916,
29900,
29896,
613,
13,
1678,
376,
3784,
27939,
1115,
376,
29900,
29916,
29900,
29941,
29872,
29947,
613,
13,
1678,
376,
24957,
10438,
1115,
376,
29900,
29916,
29945,
29872,
29906,
29900,
29874,
29900,
29946,
29945,
29941,
346,
2252,
29900,
29953,
29945,
11248,
29945,
29929,
29883,
29941,
29955,
562,
29953,
29941,
29872,
29900,
29955,
29929,
3905,
29900,
29947,
29929,
29929,
29947,
29890,
29953,
29900,
29946,
29945,
29896,
29941,
29953,
29874,
29947,
346,
29953,
29953,
29941,
29945,
29883,
29955,
29929,
29896,
29906,
687,
29900,
29890,
29953,
613,
13,
29913,
13,
13,
13,
5750,
29885,
29918,
2917,
353,
679,
29918,
4381,
29918,
5750,
29885,
29918,
2917,
580,
13,
11618,
29918,
517,
29918,
1688,
353,
8853,
12075,
13027,
1991,
29943,
861,
9092,
13,
13,
29937,
341,
6926,
263,
2923,
1546,
263,
12379,
322,
1400,
2106,
13,
13,
13,
1753,
14690,
29918,
3859,
29918,
12765,
29898,
16304,
29892,
1400,
1125,
13,
1678,
288,
353,
6571,
13,
1678,
363,
413,
297,
12379,
29889,
8149,
7295,
13,
4706,
565,
413,
451,
297,
1400,
29901,
13,
9651,
288,
29961,
29895,
29962,
353,
6796,
29899,
613,
12379,
29961,
29895,
5262,
13,
1678,
363,
413,
297,
1400,
29889,
8149,
7295,
13,
4706,
565,
413,
451,
297,
12379,
29901,
13,
9651,
288,
29961,
29895,
29962,
353,
6796,
29974,
613,
1400,
29961,
29895,
5262,
13,
4706,
25342,
12379,
29961,
29895,
29962,
2804,
1400,
29961,
29895,
5387,
13,
9651,
3431,
353,
6571,
13,
9651,
363,
1820,
297,
4852,
5464,
346,
613,
376,
6979,
29918,
5521,
2925,
613,
376,
401,
29908,
1125,
13,
18884,
565,
12379,
29961,
29895,
3816,
1989,
29962,
2804,
1400,
29961,
29895,
3816,
1989,
5387,
13,
462,
1678,
3431,
29961,
1989,
29962,
353,
518,
16304,
29961,
29895,
3816,
1989,
1402,
376,
976,
613,
1400,
29961,
29895,
3816,
1989,
5262,
13,
9651,
565,
12379,
29961,
29895,
29962,
3366,
12925,
3108,
2804,
1400,
29961,
29895,
29962,
3366,
12925,
3108,
29901,
13,
18884,
3431,
3366,
12925,
3108,
353,
6571,
13,
18884,
363,
2071,
297,
12379,
29961,
29895,
29962,
3366,
12925,
16862,
8149,
7295,
13,
462,
1678,
565,
2071,
451,
297,
1400,
29961,
29895,
29962,
3366,
12925,
3108,
29901,
13,
462,
4706,
3431,
3366,
12925,
3108,
29961,
808,
29962,
353,
6796,
29899,
613,
12379,
29961,
29895,
29962,
3366,
12925,
3108,
29961,
808,
5262,
13,
18884,
363,
2071,
297,
1400,
29961,
29895,
29962,
3366,
12925,
16862,
8149,
7295,
13,
462,
1678,
565,
2071,
451,
297,
12379,
29961,
29895,
29962,
3366,
12925,
3108,
29901,
13,
462,
4706,
3431,
3366,
12925,
3108,
29961,
808,
29962,
353,
6796,
29974,
613,
1400,
29961,
29895,
29962,
3366,
12925,
3108,
29961,
808,
5262,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
3431,
3366,
12925,
3108,
29961,
808,
29962,
353,
518,
13,
462,
9651,
12379,
29961,
29895,
29962,
3366,
12925,
3108,
29961,
808,
1402,
13,
462,
9651,
376,
976,
613,
13,
462,
9651,
1400,
29961,
29895,
29962,
3366,
12925,
3108,
29961,
808,
1402,
13,
462,
4706,
4514,
13,
9651,
288,
29961,
29895,
29962,
353,
3431,
13,
1678,
736,
288,
13,
13,
13,
29937,
11796,
29872,
263,
2323,
5190,
310,
263,
2106,
1243,
13,
13,
13,
1753,
10272,
29918,
3859,
29918,
1688,
29918,
5441,
29898,
3859,
29892,
25568,
1272,
29892,
16285,
29892,
4139,
1003,
29892,
338,
29918,
29939,
12192,
29918,
3859,
29892,
3855,
12192,
29918,
6272,
29922,
8516,
1125,
13,
1678,
2106,
29889,
6272,
29889,
2917,
353,
4139,
1003,
13,
1678,
269,
353,
2106,
29889,
29879,
14551,
580,
13,
1678,
565,
376,
3286,
571,
6066,
1204,
29908,
297,
25568,
1272,
29901,
13,
4706,
6782,
29918,
6979,
29918,
333,
353,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
13,
9651,
25568,
1272,
3366,
3286,
571,
6066,
1204,
3108,
29961,
513,
1575,
3366,
3286,
571,
6066,
1204,
3108,
29962,
13,
4706,
1723,
13,
1678,
1683,
29901,
13,
4706,
6782,
29918,
6979,
29918,
333,
353,
5993,
29918,
333,
29918,
12508,
703,
29984,
29968,
29907,
1159,
13,
1678,
1018,
29901,
13,
4706,
396,
6204,
278,
10804,
13,
4706,
25568,
353,
22160,
29889,
12460,
29898,
13,
9651,
1661,
346,
29922,
5510,
29918,
524,
29918,
272,
29918,
20970,
29898,
7508,
1272,
3366,
5464,
346,
3108,
470,
289,
29908,
29900,
4968,
13,
9651,
10489,
9175,
29922,
5510,
29918,
524,
29918,
272,
29918,
20970,
29898,
7508,
1272,
3366,
25496,
13026,
3108,
470,
289,
29908,
29900,
4968,
13,
9651,
1369,
25496,
29922,
5510,
29918,
524,
29918,
272,
29918,
20970,
29898,
7508,
1272,
3366,
25496,
24445,
3108,
29961,
513,
1575,
3366,
25496,
3108,
29962,
470,
289,
29908,
29900,
4968,
13,
9651,
304,
29922,
13808,
29918,
20970,
29898,
5992,
29918,
29900,
29916,
29918,
2813,
29898,
7508,
1272,
3366,
517,
20068,
511,
13,
9651,
995,
29922,
5510,
29918,
524,
29918,
272,
29918,
20970,
29898,
7508,
1272,
3366,
1767,
3108,
29961,
513,
1575,
3366,
1767,
3108,
29962,
470,
289,
29908,
29900,
4968,
13,
9651,
848,
29922,
13808,
29918,
20970,
29898,
5992,
29918,
29900,
29916,
29918,
2813,
29898,
7508,
1272,
3366,
1272,
3108,
29961,
513,
1575,
3366,
1272,
3108,
2314,
511,
13,
9651,
10489,
29918,
6979,
29918,
333,
29922,
6979,
29918,
333,
29918,
12508,
703,
29984,
29968,
29907,
4968,
13,
9651,
6782,
29918,
6979,
29918,
333,
29922,
3286,
571,
29918,
6979,
29918,
333,
29892,
13,
9651,
396,
10575,
451,
731,
6724,
7353,
565,
6724,
751,
935,
14688,
2106,
13,
9651,
338,
29918,
13424,
29922,
1333,
338,
29918,
29939,
12192,
29918,
3859,
29892,
13,
4706,
1723,
13,
4706,
25568,
29889,
842,
29918,
339,
935,
29918,
14153,
29918,
2917,
29898,
29939,
12192,
29918,
6272,
29889,
339,
935,
29918,
14153,
29918,
2917,
29897,
13,
4706,
565,
376,
19024,
2558,
29908,
297,
25568,
1272,
29901,
13,
9651,
25568,
29889,
4530,
29898,
13808,
29918,
20970,
29898,
5992,
29918,
29900,
29916,
29918,
2813,
29898,
7508,
1272,
3366,
19024,
2558,
3108,
4961,
13,
4706,
1683,
29901,
13,
9651,
25568,
3032,
262,
29918,
23975,
29918,
4703,
353,
5852,
13,
9651,
25568,
29889,
29894,
353,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
7508,
1272,
3366,
29894,
20068,
13,
9651,
25568,
3032,
262,
29918,
23975,
29918,
4703,
353,
7700,
13,
4706,
396,
7525,
372,
13,
4706,
12379,
353,
3509,
29889,
24535,
8552,
29898,
3859,
29889,
517,
29918,
8977,
3101,
13,
4706,
2551,
29892,
1962,
353,
3394,
29918,
20736,
29898,
3859,
29892,
25568,
29892,
25568,
29918,
17699,
29918,
8568,
29922,
13193,
29898,
29941,
29906,
876,
13,
1678,
5174,
21403,
12460,
408,
321,
29901,
13,
4706,
1596,
703,
2451,
29901,
1273,
29878,
29908,
1273,
321,
29897,
13,
4706,
2551,
29892,
1962,
353,
7700,
29892,
289,
15945,
13,
1678,
396,
6023,
19480,
3188,
29892,
1207,
6030,
13747,
411,
748,
29899,
621,
406,
398,
13,
1678,
2106,
29889,
4181,
29918,
6979,
29918,
5521,
749,
29898,
3859,
29889,
1271,
29918,
1111,
262,
3188,
29892,
5993,
29918,
333,
29918,
12508,
703,
29984,
29968,
29907,
4968,
29871,
29900,
29897,
13,
1678,
2106,
29889,
15060,
580,
13,
1678,
1400,
353,
2106,
29889,
517,
29918,
8977,
580,
13,
1678,
1962,
29918,
27787,
353,
426,
13,
4706,
376,
8568,
1115,
376,
29900,
29916,
29908,
718,
19750,
29918,
20970,
29898,
3859,
29889,
509,
347,
29889,
4632,
29918,
8568,
511,
13,
4706,
376,
2248,
267,
1115,
16285,
29892,
13,
4706,
376,
12765,
1115,
14690,
29918,
3859,
29918,
12765,
29898,
16304,
29892,
1400,
511,
13,
1678,
500,
13,
1678,
2106,
29889,
276,
1765,
29898,
29879,
29897,
13,
1678,
736,
1962,
29918,
27787,
13,
13,
13,
29937,
25455,
278,
2106,
363,
2106,
6987,
13,
1753,
2069,
29918,
3859,
29898,
6272,
29892,
758,
29892,
338,
29918,
29939,
12192,
29918,
3859,
29892,
3855,
12192,
29918,
6272,
29922,
8516,
1125,
13,
1678,
396,
3789,
786,
8829,
13,
1678,
4833,
353,
512,
16015,
10234,
580,
13,
1678,
2106,
29918,
6272,
353,
1174,
29894,
29898,
2917,
29922,
8077,
1003,
29897,
13,
1678,
2106,
29918,
6272,
29889,
2585,
353,
4833,
13,
1678,
2106,
353,
4306,
29898,
13,
4706,
8829,
29922,
3859,
29918,
6272,
29892,
13,
4706,
2908,
29918,
16304,
8568,
29922,
13808,
29918,
20970,
29898,
5992,
29918,
29900,
29916,
29918,
2813,
29898,
6272,
3366,
24957,
10438,
20068,
511,
13,
4706,
12379,
29918,
13662,
11759,
13,
9651,
14690,
29918,
29888,
1296,
29918,
6672,
29898,
29875,
29897,
13,
9651,
363,
474,
297,
3464,
29898,
13,
18884,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
6272,
3366,
3784,
4557,
20068,
448,
29871,
29896,
29892,
13,
18884,
4236,
6278,
29896,
29892,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
6272,
3366,
3784,
4557,
20068,
448,
29871,
29906,
29945,
29955,
511,
13,
18884,
448,
29896,
29892,
13,
9651,
1723,
13,
4706,
21251,
13,
4706,
2908,
29918,
4537,
29922,
5510,
29918,
524,
29918,
272,
29918,
20970,
29898,
6272,
3366,
3784,
4557,
3108,
511,
13,
4706,
2908,
29918,
1111,
262,
3188,
29922,
13808,
29918,
20970,
29898,
5992,
29918,
29900,
29916,
29918,
2813,
29898,
6272,
3366,
3784,
7967,
262,
3188,
20068,
511,
13,
4706,
2908,
29918,
12765,
3953,
29891,
29922,
5510,
29918,
524,
29918,
272,
29918,
20970,
29898,
6272,
3366,
3784,
26023,
3953,
29891,
3108,
511,
13,
4706,
10489,
29918,
13400,
29922,
5510,
29918,
524,
29918,
272,
29918,
20970,
29898,
6272,
3366,
3784,
29954,
294,
24445,
3108,
511,
13,
4706,
14334,
29922,
5510,
29918,
524,
29918,
272,
29918,
20970,
29898,
6272,
3366,
3784,
27939,
3108,
511,
13,
4706,
3855,
12192,
29918,
2917,
29922,
29939,
12192,
29918,
6272,
29889,
339,
935,
29918,
14153,
29918,
2917,
29892,
13,
4706,
396,
960,
6724,
751,
935,
14688,
5922,
29892,
881,
451,
671,
11187,
3633,
13,
4706,
671,
29918,
17640,
29918,
5750,
29885,
29918,
10149,
29922,
1333,
338,
29918,
29939,
12192,
29918,
3859,
29892,
13,
1678,
1723,
13,
13,
1678,
565,
376,
957,
24040,
29908,
297,
8829,
29901,
13,
4706,
565,
376,
18732,
21263,
27939,
29908,
297,
8829,
3366,
957,
24040,
3108,
29901,
13,
9651,
363,
975,
24040,
297,
8829,
3366,
957,
24040,
3108,
3366,
18732,
21263,
27939,
3108,
29901,
13,
18884,
10822,
29918,
18732,
29918,
1285,
1461,
29918,
1372,
29898,
13,
462,
1678,
961,
455,
1338,
29892,
13,
462,
1678,
6262,
29889,
3166,
20970,
29898,
957,
24040,
3366,
7328,
3108,
511,
13,
462,
1678,
975,
24040,
3366,
16394,
12436,
13,
18884,
1723,
13,
13,
1678,
3595,
29918,
6979,
29918,
4841,
353,
731,
580,
13,
1678,
396,
383,
453,
701,
758,
13,
1678,
363,
3211,
29892,
298,
297,
1051,
29898,
1457,
29889,
7076,
580,
1125,
13,
4706,
4974,
7431,
29898,
7328,
29897,
297,
313,
29946,
29900,
29892,
29871,
29946,
29906,
29897,
13,
4706,
3211,
353,
21822,
29918,
20970,
29898,
5992,
29918,
29900,
29916,
29918,
2813,
29898,
7328,
876,
13,
4706,
2106,
29889,
842,
29918,
5464,
346,
29898,
7328,
29892,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
29882,
3366,
5464,
346,
3108,
876,
13,
4706,
565,
338,
29918,
29939,
12192,
29918,
3859,
322,
376,
5521,
2925,
29908,
297,
298,
29901,
13,
9651,
396,
512,
751,
935,
14688,
2106,
6987,
29892,
508,
2845,
6084,
17346,
2910,
470,
2323,
17346,
13,
9651,
363,
5993,
29918,
333,
29892,
17346,
297,
298,
3366,
5521,
2925,
16862,
7076,
7295,
13,
18884,
21213,
29918,
6979,
29918,
333,
353,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
6979,
29918,
333,
29897,
13,
18884,
2106,
29889,
842,
29918,
6979,
29918,
5521,
749,
29898,
13,
462,
1678,
3211,
29892,
21213,
29918,
6979,
29918,
333,
29892,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
5521,
749,
29897,
13,
18884,
1723,
13,
18884,
3595,
29918,
6979,
29918,
4841,
29889,
1202,
29898,
862,
8485,
29918,
6979,
29918,
333,
29897,
13,
4706,
1683,
29901,
13,
9651,
2106,
29889,
842,
29918,
5521,
749,
29898,
7328,
29892,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
29882,
3366,
5521,
749,
3108,
876,
13,
4706,
2106,
29889,
842,
29918,
401,
29898,
7328,
29892,
21822,
29918,
20970,
29898,
5992,
29918,
29900,
29916,
29918,
2813,
29898,
29882,
3366,
401,
3108,
4961,
13,
4706,
363,
413,
29892,
325,
297,
298,
3366,
12925,
16862,
7076,
7295,
13,
9651,
2106,
29889,
842,
29918,
12925,
29918,
1272,
29898,
13,
18884,
3211,
29892,
13,
18884,
4802,
29918,
355,
713,
29918,
517,
29918,
524,
29898,
13808,
29918,
20970,
29898,
29895,
29961,
29906,
29901,
2314,
511,
13,
18884,
4802,
29918,
355,
713,
29918,
517,
29918,
524,
29898,
13808,
29918,
20970,
29898,
29894,
29961,
29906,
29901,
2314,
511,
13,
9651,
1723,
13,
13,
1678,
396,
10318,
6068,
5993,
23481,
13,
1678,
565,
3595,
29918,
6979,
29918,
4841,
29901,
13,
4706,
2106,
29889,
29939,
12192,
29918,
2917,
3032,
24622,
29918,
6979,
29918,
4841,
353,
3595,
29918,
6979,
29918,
4841,
13,
13,
1678,
2106,
29889,
15060,
29898,
9536,
29918,
3456,
583,
29922,
5574,
29897,
13,
1678,
736,
2106,
13,
13,
13,
1990,
1174,
29894,
17413,
2451,
29898,
2451,
1125,
13,
1678,
1209,
13,
13,
13,
1753,
11539,
29918,
3859,
29918,
1688,
29898,
1688,
1125,
13,
1678,
1596,
703,
6565,
9215,
2106,
1243,
1159,
13,
1678,
565,
376,
6272,
29908,
451,
297,
1243,
29901,
13,
4706,
12020,
1174,
29894,
17413,
2451,
703,
21745,
451,
1476,
1159,
13,
1678,
903,
3859,
353,
2069,
29918,
3859,
29898,
1688,
3366,
6272,
12436,
1243,
3366,
1457,
12436,
1243,
3366,
29939,
12192,
3859,
12436,
3855,
12192,
29918,
6272,
29922,
1688,
3366,
29939,
12192,
20068,
13,
1678,
363,
2295,
29918,
978,
29892,
2582,
297,
1243,
3366,
2490,
16862,
7076,
7295,
13,
4706,
396,
8198,
9608,
6910,
1122,
451,
367,
6969,
13,
4706,
565,
2295,
29918,
978,
451,
297,
3564,
29918,
517,
29918,
1688,
29901,
13,
9651,
6773,
13,
4706,
1596,
703,
3057,
292,
363,
1273,
29879,
29908,
1273,
2295,
29918,
978,
29897,
13,
4706,
363,
1121,
297,
2582,
29901,
13,
9651,
848,
353,
1243,
3366,
20736,
3108,
3366,
1272,
3108,
29961,
2914,
3366,
2248,
267,
3108,
3366,
1272,
3108,
29962,
13,
9651,
565,
7431,
29898,
1272,
29897,
1405,
29871,
29906,
29900,
29900,
29900,
29901,
13,
18884,
848,
353,
376,
1272,
29966,
29995,
29881,
11903,
1273,
313,
2435,
29898,
1272,
29897,
849,
29871,
29906,
448,
29871,
29896,
29897,
13,
9651,
1596,
29898,
13,
18884,
376,
5596,
292,
363,
1819,
29901,
330,
1273,
29881,
325,
1273,
29881,
270,
1273,
29879,
313,
2248,
267,
330,
1273,
29881,
325,
1273,
29881,
270,
1273,
29881,
5513,
13,
18884,
1273,
313,
13,
462,
1678,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
13,
462,
4706,
1243,
3366,
20736,
3108,
3366,
25496,
24445,
3108,
29961,
2914,
3366,
2248,
267,
3108,
3366,
25496,
3108,
29962,
13,
462,
1678,
10353,
13,
462,
1678,
6088,
29918,
524,
29918,
272,
29918,
20970,
29898,
13,
462,
4706,
1243,
3366,
20736,
3108,
3366,
1767,
3108,
29961,
2914,
3366,
2248,
267,
3108,
3366,
1767,
3108,
29962,
13,
462,
1678,
10353,
13,
462,
1678,
848,
29892,
13,
462,
1678,
1121,
3366,
2248,
267,
3108,
3366,
25496,
12436,
13,
462,
1678,
1121,
3366,
2248,
267,
3108,
3366,
1767,
12436,
13,
462,
1678,
1121,
3366,
2248,
267,
3108,
3366,
1272,
12436,
13,
18884,
1723,
13,
9651,
1723,
13,
9651,
15712,
353,
10272,
29918,
3859,
29918,
1688,
29918,
5441,
29898,
13,
18884,
903,
3859,
29892,
13,
18884,
1243,
3366,
20736,
12436,
13,
18884,
1121,
3366,
2248,
267,
12436,
13,
18884,
3415,
29885,
29918,
2917,
29892,
13,
18884,
1243,
3366,
29939,
12192,
3859,
12436,
13,
18884,
3855,
12192,
29918,
6272,
29922,
1688,
3366,
29939,
12192,
12436,
13,
9651,
1723,
13,
9651,
565,
15712,
3366,
8568,
3108,
14352,
29953,
29946,
17531,
2804,
1121,
3366,
8568,
3108,
14352,
29953,
29946,
29901,
5387,
13,
18884,
363,
413,
297,
15712,
3366,
12765,
3108,
29901,
13,
462,
1678,
1596,
29898,
29895,
29892,
15712,
3366,
12765,
3108,
29961,
29895,
1402,
934,
29922,
9675,
29889,
303,
20405,
29897,
13,
18884,
1596,
29898,
1688,
3366,
9507,
12436,
1243,
3366,
1688,
978,
12436,
934,
29922,
9675,
29889,
303,
20405,
29897,
13,
18884,
12020,
8960,
29898,
13,
462,
1678,
376,
10438,
29635,
29892,
15712,
29901,
1273,
29879,
29892,
19056,
29901,
1273,
29879,
29908,
13,
462,
1678,
1273,
313,
12097,
287,
3366,
8568,
12436,
1121,
3366,
8568,
20068,
13,
18884,
1723,
13,
9651,
1683,
29901,
13,
18884,
363,
413,
297,
15712,
3366,
12765,
3108,
29901,
13,
462,
1678,
1596,
29898,
29895,
29892,
15712,
3366,
12765,
3108,
29961,
29895,
2314,
13,
18884,
1596,
703,
10438,
19228,
29991,
29901,
1273,
29879,
29908,
1273,
15712,
3366,
8568,
20068,
13,
1678,
736,
5852,
13,
2
] |
scripts/mercedes_api_connector_bootstrap.py | eccenca/DataspaceConnector | 0 | 24332 |
import requests
import pprint
import json
# Suppress ssl verification warning
requests.packages.urllib3.disable_warnings()
s = requests.Session()
s.auth = ("user", "password")
s.verify = False
host = "localhost"
apis = ["https://api.mercedes-benz.com/vehicledata/v2/vehicles", "https://api.mercedes-benz.com/vehicledata/v2/vehicles" , "https://api.mercedes-benz.com/hazard_warnings/v2", "https://api.mercedes-benz.com/vehicledata_tryout/v2/vehicles", "https://api.mercedes-benz.com/vehicledata_tryout/v2/vehicles"]
licenses = [["Fuel Status", "https://developer.mercedes-benz.com/products/hazard_warnings/details" ],
["Electric Vehicle Status", "https://developer.mercedes-benz.com/products/electric_vehicle_status/details" ],
["Hazard Warnings", "https://developer.mercedes-benz.com/products/hazard_warnings/details" ],
["Fuel Status Tryout", "https://api.mercedes-benz.com/vehicledata_tryout/v2/vehicles" ],
["Electric Vehicle Status Tryout", "https://api.mercedes-benz.com/vehicledata_tryout/v2/vehicles" ]]
offers = [
{
"title": "Fuel Status",
"description": "The Fuel Status data set provides fuel level and the remaining vehicle range of connected vehicles. Applications from fuel suppliers could give Mercedes-Benz drivers individual offers at the right time.",
"keywords": [
"Fuel Status"
],
"publisher": "https://mercedes-benz.com",
"language": "EN",
"license": "https://developer.mercedes-benz.com/products/fuel_status/details",
"sovereign": "https://mercedes-benz.com",
"endpointDocumentation": "https://developer.mercedes-benz.com/products/fuel_status",
"Mantainer": "http://eccenca.com",
"Contact": "ed<EMAIL>"
},
{
"title": "Electric Vehicle Status",
"description": "The Electric Vehicle Status data set provides charge and remaining range of a specific electric vehicle. Knowing these current values, the next charging stop can be predicted.",
"keywords": [
"Electric Vehicle Status"
],
"publisher": "https://mercedes-benz.com",
"language": "EN",
"license": "https://developer.mercedes-benz.com/products/electric_vehicle_status/details",
"sovereign": "https://mercedes-benz.com",
"endpointDocumentation": "https://developer.mercedes-benz.com/products/electric_vehicle_status",
"Mantainer": "http://eccenca.com",
"Contact": "<EMAIL>"
},
{
"title": "Hazard Warnings",
"description": "Benefit from aggregated event data from our connected vehicle fleet to alert your drivers ahead of any dangerous situation. The data set consists of different types of safety-related events, ranging from dangerous traffic events to weather conditions.",
"keywords": [
"Hazard Warnings"
],
"publisher": "https://mercedes-benz.com",
"language": "EN",
"license": "https://developer.mercedes-benz.com/products/hazard_warnings/details",
"sovereign": "https://mercedes-benz.com",
"endpointDocumentation": "https://developer.mercedes-benz.com/products/hazard_warnings",
"Mantainer": "http://eccenca.com",
"Contact": "<EMAIL>"
},
{
"title": "Fuel Status Tryout",
"description": "This is a sandbox for Fuel Status data set provides fuel level and the remaining vehicle range of connected vehicles. Applications from fuel suppliers could give Mercedes-Benz drivers individual offers at the right time.",
"keywords": [
"Fuel Status"
],
"publisher": "https://mercedes-benz.com",
"language": "EN",
"license": "https://developer.mercedes-benz.com/products/fuel_status/details",
"sovereign": "https://mercedes-benz.com",
"endpointDocumentation": "https://developer.mercedes-benz.com/products/fuel_status",
"Mantainer": "http://eccenca.com",
"Contact": "<EMAIL>"
},
{
"title": "Electric Vehicle Status Tryout",
"description": "This is a sandbox for Electric Vehicle Status data set provides charge and remaining range of a specific electric vehicle. Knowing these current values, the next charging stop can be predicted.",
"keywords": [
"Electric Vehicle Status"
],
"publisher": "https://mercedes-benz.com",
"language": "EN",
"license": "https://developer.mercedes-benz.com/products/electric_vehicle_status/details",
"sovereign": "https://mercedes-benz.com",
"endpointDocumentation": "https://developer.mercedes-benz.com/products/electric_vehicle_status",
"Mantainer": "http://eccenca.com",
"Contact": "<EMAIL>"
}
]
representations = [{
"title": "Fuel Status",
"description": "Data representation of Fuel Status data.",
"mediaType": "JSON",
"language": "EN",
"example": "https://github.com/eccenca/DaimlerDataspaceSharedData/blob/main/fuel-status.json"
},
{
"title": "Electric Vehicle Status",
"description": "Data representation of Electric Vehicle Status.",
"mediaType": "JSON",
"language": "EN",
"example": "https://github.com/eccenca/DaimlerDataspaceSharedData/blob/main/electric-vehicle-status.json"
},
{
"title": "Hazard Warnings",
"description": "Data representation of Hazard Warnings data.",
"mediaType": "JSON",
"language": "EN",
"example": "https://github.com/eccenca/DaimlerDataspaceSharedData/blob/main/harzard-warnings.json"
},
{
"title": "Fuel Status Tyout",
"description": "Data representation of Fuel Status data.",
"mediaType": "JSON",
"language": "EN",
"example": "https://github.com/eccenca/DaimlerDataspaceSharedData/blob/main/fuel-status.json"
},
{
"title": "Electric Vehicle Status Tryout",
"description": "Data representation of Electric Vehicle Status.",
"mediaType": "JSON",
"language": "EN",
"example": "https://github.com/eccenca/DaimlerDataspaceSharedData/blob/main/electric-vehicle-status.json"
}
]
def create_policy(title, desc):
value = f'''{{
"@context" : {{
"ids" : "http://w3id.org/idsa/core/",
"idsc" : "http://w3id.org/idsa/code/"
}},
"@type": "ids:Permission",
"@id": "http://w3id.org/idsa/autogen/permission/c0bdb9d5-e86a-4bb3-86d2-2b1dc9d226f5",
"ids:description": [
{{
"@value": "This polcy allows the usage of the API under the respective ",
"@type": "http://www.w3.org/2001/XMLSchema#string"
}}
],
"ids:title": [
{{
"@value": "Free for usage",
"@type": "http://www.w3.org/2001/XMLSchema#string"
}}
],
"ids:action": [
{{
"@id": "idsc:USE"
}}
]
}}'''
svalue = {
"value": """{
"@context" : {
"ids" : "https://w3id.org/idsa/core/",
"idsc" : "https://w3id.org/idsa/code/"
},
"@type": "ids:Permission",
"@id": "https://w3id.org/idsa/autogen/permission/154df1cf-557b-4f44-b839-4b68056606a2",
"ids:description": [
{
"@value": "Free for Usage",
"@type": "http://www.w3.org/2001/XMLSchema#string"
}
],
"ids:title": [
{
"@value": "This policy allows the data set usage by any third-party under the restrictions pre-established by the data provider Mercedes-Benz.",
"@type": "http://www.w3.org/2001/XMLSchema#string"
}
],
"ids:action": [
{
"@id": "idsc:USE"
}
]
}"""
}
parsedJSON = json.loads(value)
return s.post(
"https://" + host + "/api/rules",
json=svalue
).headers["Location"]
def get_objects(object):
return s.get(
"https://" + host + "/api/" + object + "s?page=0&size=30"
)
def create_remote_artifact(endpoint):
return s.post(
"https://" + host + "/api/artifacts",
json={"accessUrl": endpoint }
).headers["Location"]
def create_offered_resource(resource):
return s.post("https://" + host + "/api/offers", json=resource).headers["Location"]
def add_resource_to_catalog(catalog, resource):
s.post(catalog + "/offers", json=[resource])
def add_catalog_to_resource(resource, catalog):
s.post(resource + "/catalogs", json=[catalog])
def add_representation_to_resource(resource, representation):
s.post(resource + "/representations", json=[representation])
def add_artifact_to_representation(representation, artifact):
s.post(representation + "/artifacts", json=[artifact])
def add_contract_to_resource(resource, contract):
s.post(resource + "/contracts", json=[contract])
def add_rule_to_contract(contract, rule):
s.post(contract + "/rules", json=[rule])
def create_offered_resource(resource):
return s.post("https://" + host + "/api/offers", json=resource).headers["Location"]
def create_representation(representation):
return s.post("https://" + host + "/api/representations", json=representation).headers[
"Location"
]
def create_contract():
return s.post("https://" + host + "/api/contracts", json={}).headers["Location"]
def create_catalog():
return s.post("https://" + host + "/api/catalogs", json={}).headers["Location"]
def remove(object_href):
return s.delete(object_href)
def remove_uuid(offer_href, uuid):
return s.delete(offer_href, json={'id' : uuid})
def remove(object, objects):
current_objects = json.loads(objects.text)
for current_object in current_objects["_embedded"][object + 's']:
object_href = current_object["_links"]["self"]["href"]
print("Removing " + object + " " + object_href)
remove(object_href)
def remove_object_uuid(object, objects):
current_objects = json.loads(objects.text)
for current_object in current_objects["_embedded"][object + 's']:
object_href = current_object["_links"]["self"]["href"]
print("Removing " + object + " " + object_href)
uuid = object_href.rindex("/",1)
remove_uuid(object_href, uuid)
# Cleaning dataset
object_response = get_objects("catalog")
remove_object_uuid("catalog", object_response)
object_response = get_objects("offer")
remove_object_uuid("resource", object_response)
object_response = get_objects("artifact")
remove_object_uuid("artifact", object_response)
object_response = get_objects("representation")
remove_object_uuid("representation", object_response)
object_response = get_objects("contract")
remove_object_uuid("contract", object_response)
i = 0
catalog = create_catalog()
policy = create_policy(licenses[i][0] + " Usage Policy", "For more details visit " + licenses[i][1])
contract = create_contract()
print("Adding APIS to IDS Catalog:" + catalog)
for api in apis:
offer = create_offered_resource(offers[i])
representation = create_representation(representations[i])
artifact = create_remote_artifact(api)
add_resource_to_catalog(catalog, offer)
add_representation_to_resource(offer, representation)
add_artifact_to_representation(representation, artifact)
add_contract_to_resource(offer, contract)
add_rule_to_contract(contract, policy)
print("Registering " + licenses[i][0] + " in " + artifact )
i = i + 1
| [
1,
29871,
13,
5215,
7274,
13,
5215,
282,
2158,
13,
5215,
4390,
13,
13,
29937,
9179,
1253,
24250,
1147,
2450,
9177,
13,
24830,
29889,
8318,
29889,
2271,
1982,
29941,
29889,
20472,
29918,
25442,
886,
580,
13,
13,
29879,
353,
7274,
29889,
7317,
580,
13,
29879,
29889,
5150,
353,
4852,
1792,
613,
376,
5630,
1159,
13,
29879,
29889,
27902,
353,
7700,
13,
13,
3069,
353,
376,
7640,
29908,
13,
11355,
353,
6796,
991,
597,
2754,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
345,
29882,
293,
839,
532,
29914,
29894,
29906,
29914,
345,
29882,
4027,
613,
376,
991,
597,
2754,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
345,
29882,
293,
839,
532,
29914,
29894,
29906,
29914,
345,
29882,
4027,
29908,
1919,
376,
991,
597,
2754,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
29882,
834,
538,
29918,
25442,
886,
29914,
29894,
29906,
613,
376,
991,
597,
2754,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
345,
29882,
293,
839,
532,
29918,
2202,
449,
29914,
29894,
29906,
29914,
345,
29882,
4027,
613,
376,
991,
597,
2754,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
345,
29882,
293,
839,
532,
29918,
2202,
449,
29914,
29894,
29906,
29914,
345,
29882,
4027,
3108,
13,
13,
506,
11259,
353,
518,
3366,
29943,
2491,
16034,
613,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
29882,
834,
538,
29918,
25442,
886,
29914,
14144,
29908,
21251,
29871,
13,
9651,
6796,
29923,
781,
2200,
8980,
29882,
2512,
16034,
613,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
15436,
2200,
29918,
345,
29882,
2512,
29918,
4882,
29914,
14144,
29908,
21251,
29871,
13,
9651,
6796,
29950,
834,
538,
399,
2753,
886,
613,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
29882,
834,
538,
29918,
25442,
886,
29914,
14144,
29908,
21251,
13,
9651,
6796,
29943,
2491,
16034,
3967,
449,
613,
376,
991,
597,
2754,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
345,
29882,
293,
839,
532,
29918,
2202,
449,
29914,
29894,
29906,
29914,
345,
29882,
4027,
29908,
21251,
13,
9651,
6796,
29923,
781,
2200,
8980,
29882,
2512,
16034,
3967,
449,
613,
376,
991,
597,
2754,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
345,
29882,
293,
839,
532,
29918,
2202,
449,
29914,
29894,
29906,
29914,
345,
29882,
4027,
29908,
29588,
13,
2696,
414,
353,
518,
13,
4706,
426,
13,
9651,
376,
3257,
1115,
376,
29943,
2491,
16034,
613,
13,
9651,
376,
8216,
1115,
376,
1576,
383,
2491,
16034,
848,
731,
8128,
26413,
3233,
322,
278,
9886,
19716,
3464,
310,
6631,
24413,
29889,
2401,
5795,
515,
26413,
1462,
27801,
1033,
2367,
4702,
28352,
29899,
29933,
4666,
18563,
5375,
16688,
472,
278,
1492,
931,
19602,
13,
9651,
376,
1989,
9303,
1115,
518,
13,
18884,
376,
29943,
2491,
16034,
29908,
13,
9651,
21251,
13,
9651,
376,
23679,
261,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
11675,
1115,
376,
1430,
613,
13,
9651,
376,
506,
1947,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
29888,
2491,
29918,
4882,
29914,
14144,
613,
13,
9651,
376,
578,
369,
7577,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
29734,
6268,
362,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
29888,
2491,
29918,
4882,
613,
13,
9651,
376,
29924,
424,
4008,
1115,
376,
1124,
597,
29872,
617,
264,
1113,
29889,
510,
613,
13,
9651,
376,
13443,
1115,
376,
287,
29966,
26862,
6227,
11903,
13,
4706,
2981,
13,
4706,
426,
13,
9651,
376,
3257,
1115,
376,
29923,
781,
2200,
8980,
29882,
2512,
16034,
613,
13,
9651,
376,
8216,
1115,
376,
1576,
26953,
8980,
29882,
2512,
16034,
848,
731,
8128,
8323,
322,
9886,
3464,
310,
263,
2702,
12646,
19716,
29889,
19320,
292,
1438,
1857,
1819,
29892,
278,
2446,
9151,
292,
5040,
508,
367,
25383,
19602,
13,
9651,
376,
1989,
9303,
1115,
518,
13,
18884,
376,
29923,
781,
2200,
8980,
29882,
2512,
16034,
29908,
13,
9651,
21251,
13,
9651,
376,
23679,
261,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
11675,
1115,
376,
1430,
613,
13,
9651,
376,
506,
1947,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
15436,
2200,
29918,
345,
29882,
2512,
29918,
4882,
29914,
14144,
613,
13,
9651,
376,
578,
369,
7577,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
29734,
6268,
362,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
15436,
2200,
29918,
345,
29882,
2512,
29918,
4882,
613,
13,
9651,
376,
29924,
424,
4008,
1115,
376,
1124,
597,
29872,
617,
264,
1113,
29889,
510,
613,
13,
9651,
376,
13443,
1115,
9872,
26862,
6227,
11903,
13,
4706,
2981,
13,
4706,
426,
13,
9651,
376,
3257,
1115,
376,
29950,
834,
538,
399,
2753,
886,
613,
13,
9651,
376,
8216,
1115,
376,
20841,
1389,
277,
515,
11404,
630,
1741,
848,
515,
1749,
6631,
19716,
22338,
304,
6655,
596,
18563,
14432,
310,
738,
18215,
6434,
29889,
450,
848,
731,
11624,
310,
1422,
4072,
310,
15332,
29899,
12817,
4959,
29892,
364,
9776,
515,
18215,
12469,
4959,
304,
14826,
5855,
19602,
13,
9651,
376,
1989,
9303,
1115,
518,
13,
18884,
376,
29950,
834,
538,
399,
2753,
886,
29908,
13,
9651,
21251,
13,
9651,
376,
23679,
261,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
11675,
1115,
376,
1430,
613,
13,
9651,
376,
506,
1947,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
29882,
834,
538,
29918,
25442,
886,
29914,
14144,
613,
13,
9651,
376,
578,
369,
7577,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
29734,
6268,
362,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
29882,
834,
538,
29918,
25442,
886,
613,
13,
9651,
376,
29924,
424,
4008,
1115,
376,
1124,
597,
29872,
617,
264,
1113,
29889,
510,
613,
13,
9651,
376,
13443,
1115,
9872,
26862,
6227,
11903,
13,
4706,
2981,
13,
4706,
426,
13,
9651,
376,
3257,
1115,
376,
29943,
2491,
16034,
3967,
449,
613,
13,
9651,
376,
8216,
1115,
376,
4013,
338,
263,
11982,
1884,
363,
383,
2491,
16034,
848,
731,
8128,
26413,
3233,
322,
278,
9886,
19716,
3464,
310,
6631,
24413,
29889,
2401,
5795,
515,
26413,
1462,
27801,
1033,
2367,
4702,
28352,
29899,
29933,
4666,
18563,
5375,
16688,
472,
278,
1492,
931,
19602,
13,
9651,
376,
1989,
9303,
1115,
518,
13,
18884,
376,
29943,
2491,
16034,
29908,
13,
9651,
21251,
13,
9651,
376,
23679,
261,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
11675,
1115,
376,
1430,
613,
13,
9651,
376,
506,
1947,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
29888,
2491,
29918,
4882,
29914,
14144,
613,
13,
9651,
376,
578,
369,
7577,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
29734,
6268,
362,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
29888,
2491,
29918,
4882,
613,
13,
9651,
376,
29924,
424,
4008,
1115,
376,
1124,
597,
29872,
617,
264,
1113,
29889,
510,
613,
13,
9651,
376,
13443,
1115,
9872,
26862,
6227,
11903,
13,
4706,
2981,
13,
4706,
426,
13,
9651,
376,
3257,
1115,
376,
29923,
781,
2200,
8980,
29882,
2512,
16034,
3967,
449,
613,
13,
9651,
376,
8216,
1115,
376,
4013,
338,
263,
11982,
1884,
363,
26953,
8980,
29882,
2512,
16034,
848,
731,
8128,
8323,
322,
9886,
3464,
310,
263,
2702,
12646,
19716,
29889,
19320,
292,
1438,
1857,
1819,
29892,
278,
2446,
9151,
292,
5040,
508,
367,
25383,
19602,
13,
9651,
376,
1989,
9303,
1115,
518,
13,
18884,
376,
29923,
781,
2200,
8980,
29882,
2512,
16034,
29908,
13,
9651,
21251,
13,
9651,
376,
23679,
261,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
11675,
1115,
376,
1430,
613,
13,
9651,
376,
506,
1947,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
15436,
2200,
29918,
345,
29882,
2512,
29918,
4882,
29914,
14144,
613,
13,
9651,
376,
578,
369,
7577,
1115,
376,
991,
597,
1050,
28352,
29899,
1785,
29920,
29889,
510,
613,
13,
9651,
376,
29734,
6268,
362,
1115,
376,
991,
597,
6734,
29889,
1050,
28352,
29899,
1785,
29920,
29889,
510,
29914,
14456,
29914,
15436,
2200,
29918,
345,
29882,
2512,
29918,
4882,
613,
13,
9651,
376,
29924,
424,
4008,
1115,
376,
1124,
597,
29872,
617,
264,
1113,
29889,
510,
613,
13,
9651,
376,
13443,
1115,
9872,
26862,
6227,
11903,
13,
4706,
500,
13,
259,
4514,
13,
13,
276,
6338,
800,
353,
15974,
13,
462,
4706,
376,
3257,
1115,
376,
29943,
2491,
16034,
613,
13,
462,
4706,
376,
8216,
1115,
376,
1469,
8954,
310,
383,
2491,
16034,
848,
19602,
13,
462,
4706,
376,
9799,
1542,
1115,
376,
7249,
613,
13,
462,
4706,
376,
11675,
1115,
376,
1430,
613,
13,
462,
4706,
376,
4773,
1115,
376,
991,
597,
3292,
29889,
510,
29914,
29872,
617,
264,
1113,
29914,
27838,
326,
1358,
16390,
294,
3535,
21741,
1469,
29914,
10054,
29914,
3396,
29914,
29888,
2491,
29899,
4882,
29889,
3126,
29908,
13,
462,
1678,
2981,
13,
462,
1678,
426,
13,
462,
4706,
376,
3257,
1115,
376,
29923,
781,
2200,
8980,
29882,
2512,
16034,
613,
13,
462,
4706,
376,
8216,
1115,
376,
1469,
8954,
310,
26953,
8980,
29882,
2512,
16034,
19602,
13,
462,
4706,
376,
9799,
1542,
1115,
376,
7249,
613,
13,
462,
4706,
376,
11675,
1115,
376,
1430,
613,
13,
462,
4706,
376,
4773,
1115,
376,
991,
597,
3292,
29889,
510,
29914,
29872,
617,
264,
1113,
29914,
27838,
326,
1358,
16390,
294,
3535,
21741,
1469,
29914,
10054,
29914,
3396,
29914,
15436,
2200,
29899,
345,
29882,
2512,
29899,
4882,
29889,
3126,
29908,
13,
462,
1678,
2981,
13,
462,
1678,
426,
13,
462,
4706,
376,
3257,
1115,
376,
29950,
834,
538,
399,
2753,
886,
613,
13,
462,
4706,
376,
8216,
1115,
376,
1469,
8954,
310,
25606,
538,
399,
2753,
886,
848,
19602,
13,
462,
4706,
376,
9799,
1542,
1115,
376,
7249,
613,
13,
462,
4706,
376,
11675,
1115,
376,
1430,
613,
13,
462,
4706,
376,
4773,
1115,
376,
991,
597,
3292,
29889,
510,
29914,
29872,
617,
264,
1113,
29914,
27838,
326,
1358,
16390,
294,
3535,
21741,
1469,
29914,
10054,
29914,
3396,
29914,
8222,
29920,
538,
29899,
25442,
886,
29889,
3126,
29908,
13,
462,
1678,
2981,
13,
462,
1678,
426,
13,
462,
4706,
376,
3257,
1115,
376,
29943,
2491,
16034,
9656,
449,
613,
13,
462,
4706,
376,
8216,
1115,
376,
1469,
8954,
310,
383,
2491,
16034,
848,
19602,
13,
462,
4706,
376,
9799,
1542,
1115,
376,
7249,
613,
13,
462,
4706,
376,
11675,
1115,
376,
1430,
613,
13,
462,
4706,
376,
4773,
1115,
376,
991,
597,
3292,
29889,
510,
29914,
29872,
617,
264,
1113,
29914,
27838,
326,
1358,
16390,
294,
3535,
21741,
1469,
29914,
10054,
29914,
3396,
29914,
29888,
2491,
29899,
4882,
29889,
3126,
29908,
13,
462,
1678,
2981,
13,
462,
1678,
426,
13,
462,
4706,
376,
3257,
1115,
376,
29923,
781,
2200,
8980,
29882,
2512,
16034,
3967,
449,
613,
13,
462,
4706,
376,
8216,
1115,
376,
1469,
8954,
310,
26953,
8980,
29882,
2512,
16034,
19602,
13,
462,
4706,
376,
9799,
1542,
1115,
376,
7249,
613,
13,
462,
4706,
376,
11675,
1115,
376,
1430,
613,
13,
462,
4706,
376,
4773,
1115,
376,
991,
597,
3292,
29889,
510,
29914,
29872,
617,
264,
1113,
29914,
27838,
326,
1358,
16390,
294,
3535,
21741,
1469,
29914,
10054,
29914,
3396,
29914,
15436,
2200,
29899,
345,
29882,
2512,
29899,
4882,
29889,
3126,
29908,
13,
462,
1678,
500,
13,
18884,
4514,
13,
13,
1753,
1653,
29918,
22197,
29898,
3257,
29892,
5153,
1125,
13,
1678,
995,
353,
285,
12008,
6224,
13,
9651,
17962,
4703,
29908,
584,
8620,
13,
18884,
376,
4841,
29908,
584,
376,
1124,
597,
29893,
29941,
333,
29889,
990,
29914,
4841,
29874,
29914,
3221,
29914,
613,
13,
18884,
376,
333,
1557,
29908,
584,
376,
1124,
597,
29893,
29941,
333,
29889,
990,
29914,
4841,
29874,
29914,
401,
12975,
13,
9651,
500,
1118,
13,
9651,
17962,
1853,
1115,
376,
4841,
29901,
27293,
613,
13,
9651,
17962,
333,
1115,
376,
1124,
597,
29893,
29941,
333,
29889,
990,
29914,
4841,
29874,
29914,
1300,
6352,
29914,
16074,
29914,
29883,
29900,
29890,
2585,
29929,
29881,
29945,
29899,
29872,
29947,
29953,
29874,
29899,
29946,
1327,
29941,
29899,
29947,
29953,
29881,
29906,
29899,
29906,
29890,
29896,
13891,
29929,
29881,
29906,
29906,
29953,
29888,
29945,
613,
13,
9651,
376,
4841,
29901,
8216,
1115,
518,
13,
795,
8620,
13,
18884,
17962,
1767,
1115,
376,
4013,
1248,
1270,
6511,
278,
8744,
310,
278,
3450,
1090,
278,
18067,
9162,
13,
18884,
17962,
1853,
1115,
376,
1124,
597,
1636,
29889,
29893,
29941,
29889,
990,
29914,
29906,
29900,
29900,
29896,
29914,
9165,
12763,
29937,
1807,
29908,
13,
795,
9156,
13,
9651,
21251,
13,
9651,
376,
4841,
29901,
3257,
1115,
518,
13,
795,
8620,
13,
18884,
17962,
1767,
1115,
376,
20475,
363,
8744,
613,
13,
18884,
17962,
1853,
1115,
376,
1124,
597,
1636,
29889,
29893,
29941,
29889,
990,
29914,
29906,
29900,
29900,
29896,
29914,
9165,
12763,
29937,
1807,
29908,
13,
795,
9156,
13,
9651,
21251,
13,
9651,
376,
4841,
29901,
2467,
1115,
518,
13,
795,
8620,
13,
18884,
17962,
333,
1115,
376,
333,
1557,
29901,
17171,
29908,
13,
795,
9156,
13,
9651,
4514,
13,
3986,
9156,
12008,
13,
13,
1678,
269,
1767,
353,
426,
13,
3986,
376,
1767,
1115,
9995,
29912,
13,
3986,
17962,
4703,
29908,
584,
426,
13,
795,
376,
4841,
29908,
584,
376,
991,
597,
29893,
29941,
333,
29889,
990,
29914,
4841,
29874,
29914,
3221,
29914,
613,
13,
795,
376,
333,
1557,
29908,
584,
376,
991,
597,
29893,
29941,
333,
29889,
990,
29914,
4841,
29874,
29914,
401,
12975,
13,
3986,
2981,
13,
4706,
17962,
1853,
1115,
376,
4841,
29901,
27293,
613,
13,
4706,
17962,
333,
1115,
376,
991,
597,
29893,
29941,
333,
29889,
990,
29914,
4841,
29874,
29914,
1300,
6352,
29914,
16074,
29914,
29896,
29945,
29946,
2176,
29896,
6854,
29899,
29945,
29945,
29955,
29890,
29899,
29946,
29888,
29946,
29946,
29899,
29890,
29947,
29941,
29929,
29899,
29946,
29890,
29953,
29947,
29900,
29945,
29953,
29953,
29900,
29953,
29874,
29906,
613,
13,
4706,
376,
4841,
29901,
8216,
1115,
518,
13,
3986,
426,
13,
9651,
17962,
1767,
1115,
376,
20475,
363,
10783,
482,
613,
13,
9651,
17962,
1853,
1115,
376,
1124,
597,
1636,
29889,
29893,
29941,
29889,
990,
29914,
29906,
29900,
29900,
29896,
29914,
9165,
12763,
29937,
1807,
29908,
13,
3986,
500,
13,
4706,
21251,
13,
4706,
376,
4841,
29901,
3257,
1115,
518,
13,
3986,
426,
13,
9651,
17962,
1767,
1115,
376,
4013,
8898,
6511,
278,
848,
731,
8744,
491,
738,
4654,
29899,
22633,
1090,
278,
25091,
758,
29899,
342,
370,
3726,
491,
278,
848,
13113,
4702,
28352,
29899,
29933,
4666,
19602,
13,
9651,
17962,
1853,
1115,
376,
1124,
597,
1636,
29889,
29893,
29941,
29889,
990,
29914,
29906,
29900,
29900,
29896,
29914,
9165,
12763,
29937,
1807,
29908,
13,
3986,
500,
13,
4706,
21251,
13,
4706,
376,
4841,
29901,
2467,
1115,
518,
13,
3986,
426,
13,
9651,
17962,
333,
1115,
376,
333,
1557,
29901,
17171,
29908,
13,
3986,
500,
13,
4706,
4514,
13,
418,
500,
15945,
29908,
13,
1678,
500,
13,
1678,
21213,
7249,
353,
4390,
29889,
18132,
29898,
1767,
29897,
13,
1678,
736,
269,
29889,
2490,
29898,
13,
4706,
376,
991,
597,
29908,
718,
3495,
718,
5591,
2754,
29914,
19238,
613,
13,
4706,
4390,
29922,
29879,
1767,
13,
1678,
13742,
13662,
3366,
6508,
3108,
13,
13,
1753,
679,
29918,
12650,
29898,
3318,
1125,
13,
1678,
736,
269,
29889,
657,
29898,
13,
4706,
376,
991,
597,
29908,
718,
3495,
718,
5591,
2754,
12975,
718,
1203,
718,
376,
29879,
29973,
3488,
29922,
29900,
29987,
2311,
29922,
29941,
29900,
29908,
13,
1678,
1723,
13,
13,
1753,
1653,
29918,
16674,
29918,
8813,
29898,
29734,
1125,
13,
1678,
736,
269,
29889,
2490,
29898,
13,
4706,
376,
991,
597,
29908,
718,
3495,
718,
5591,
2754,
29914,
8813,
29879,
613,
13,
4706,
4390,
3790,
29908,
5943,
5983,
1115,
16248,
500,
13,
1678,
13742,
13662,
3366,
6508,
3108,
13,
13,
1753,
1653,
29918,
974,
571,
287,
29918,
10314,
29898,
10314,
1125,
13,
1678,
736,
269,
29889,
2490,
703,
991,
597,
29908,
718,
3495,
718,
5591,
2754,
29914,
2696,
414,
613,
4390,
29922,
10314,
467,
13662,
3366,
6508,
3108,
13,
13,
1753,
788,
29918,
10314,
29918,
517,
29918,
28045,
29898,
28045,
29892,
6503,
1125,
13,
1678,
269,
29889,
2490,
29898,
28045,
718,
5591,
2696,
414,
613,
4390,
11759,
10314,
2314,
13,
13,
1753,
788,
29918,
28045,
29918,
517,
29918,
10314,
29898,
10314,
29892,
16653,
1125,
13,
1678,
269,
29889,
2490,
29898,
10314,
718,
5591,
28045,
29879,
613,
4390,
11759,
28045,
2314,
13,
13,
1753,
788,
29918,
276,
26081,
29918,
517,
29918,
10314,
29898,
10314,
29892,
8954,
1125,
13,
1678,
269,
29889,
2490,
29898,
10314,
718,
5591,
276,
6338,
800,
613,
4390,
11759,
276,
26081,
2314,
13,
13,
1753,
788,
29918,
8813,
29918,
517,
29918,
276,
26081,
29898,
276,
26081,
29892,
24238,
1125,
13,
1678,
269,
29889,
2490,
29898,
276,
26081,
718,
5591,
8813,
29879,
613,
4390,
11759,
8813,
2314,
13,
13,
1753,
788,
29918,
1285,
1461,
29918,
517,
29918,
10314,
29898,
10314,
29892,
8078,
1125,
13,
1678,
269,
29889,
2490,
29898,
10314,
718,
5591,
1285,
1461,
29879,
613,
4390,
11759,
1285,
1461,
2314,
13,
13,
1753,
788,
29918,
7491,
29918,
517,
29918,
1285,
1461,
29898,
1285,
1461,
29892,
5751,
1125,
13,
1678,
269,
29889,
2490,
29898,
1285,
1461,
718,
5591,
19238,
613,
4390,
11759,
7491,
2314,
13,
13,
1753,
1653,
29918,
974,
571,
287,
29918,
10314,
29898,
10314,
1125,
13,
1678,
736,
269,
29889,
2490,
703,
991,
597,
29908,
718,
3495,
718,
5591,
2754,
29914,
2696,
414,
613,
4390,
29922,
10314,
467,
13662,
3366,
6508,
3108,
13,
13,
1753,
1653,
29918,
276,
26081,
29898,
276,
26081,
1125,
13,
1678,
736,
269,
29889,
2490,
703,
991,
597,
29908,
718,
3495,
718,
5591,
2754,
29914,
276,
6338,
800,
613,
4390,
29922,
276,
26081,
467,
13662,
29961,
13,
4706,
376,
6508,
29908,
13,
1678,
4514,
13,
13,
1753,
1653,
29918,
1285,
1461,
7295,
13,
1678,
736,
269,
29889,
2490,
703,
991,
597,
29908,
718,
3495,
718,
5591,
2754,
29914,
1285,
1461,
29879,
613,
4390,
3790,
7690,
13662,
3366,
6508,
3108,
13,
13,
1753,
1653,
29918,
28045,
7295,
13,
1678,
736,
269,
29889,
2490,
703,
991,
597,
29908,
718,
3495,
718,
5591,
2754,
29914,
28045,
29879,
613,
4390,
3790,
7690,
13662,
3366,
6508,
3108,
13,
13,
1753,
3349,
29898,
3318,
29918,
12653,
1125,
13,
1678,
736,
269,
29889,
8143,
29898,
3318,
29918,
12653,
29897,
13,
13,
1753,
3349,
29918,
25118,
29898,
974,
571,
29918,
12653,
29892,
318,
5416,
1125,
13,
1678,
736,
269,
29889,
8143,
29898,
974,
571,
29918,
12653,
29892,
4390,
3790,
29915,
333,
29915,
584,
318,
5416,
1800,
13,
13,
1753,
3349,
29898,
3318,
29892,
3618,
1125,
13,
29871,
1857,
29918,
12650,
353,
4390,
29889,
18132,
29898,
12650,
29889,
726,
29897,
13,
29871,
363,
1857,
29918,
3318,
297,
1857,
29918,
12650,
3366,
29918,
17987,
7176,
3108,
29961,
3318,
718,
525,
29879,
2033,
29901,
13,
1678,
1203,
29918,
12653,
353,
1857,
29918,
3318,
3366,
29918,
4965,
3108,
3366,
1311,
3108,
3366,
12653,
3108,
13,
1678,
1596,
703,
7301,
21081,
376,
718,
1203,
718,
376,
376,
718,
1203,
29918,
12653,
29897,
13,
1678,
3349,
29898,
3318,
29918,
12653,
29897,
13,
13,
1753,
3349,
29918,
3318,
29918,
25118,
29898,
3318,
29892,
3618,
1125,
13,
29871,
1857,
29918,
12650,
353,
4390,
29889,
18132,
29898,
12650,
29889,
726,
29897,
13,
29871,
363,
1857,
29918,
3318,
297,
1857,
29918,
12650,
3366,
29918,
17987,
7176,
3108,
29961,
3318,
718,
525,
29879,
2033,
29901,
13,
1678,
1203,
29918,
12653,
353,
1857,
29918,
3318,
3366,
29918,
4965,
3108,
3366,
1311,
3108,
3366,
12653,
3108,
13,
1678,
1596,
703,
7301,
21081,
376,
718,
1203,
718,
376,
376,
718,
1203,
29918,
12653,
29897,
13,
1678,
318,
5416,
353,
1203,
29918,
12653,
29889,
29878,
2248,
11974,
613,
29896,
29897,
13,
1678,
3349,
29918,
25118,
29898,
3318,
29918,
12653,
29892,
318,
5416,
29897,
13,
13,
29937,
315,
14044,
292,
8783,
13,
13,
3318,
29918,
5327,
353,
679,
29918,
12650,
703,
28045,
1159,
13,
5992,
29918,
3318,
29918,
25118,
703,
28045,
613,
1203,
29918,
5327,
29897,
13,
13,
3318,
29918,
5327,
353,
679,
29918,
12650,
703,
974,
571,
1159,
13,
5992,
29918,
3318,
29918,
25118,
703,
10314,
613,
1203,
29918,
5327,
29897,
13,
13,
3318,
29918,
5327,
353,
679,
29918,
12650,
703,
8813,
1159,
13,
5992,
29918,
3318,
29918,
25118,
703,
8813,
613,
1203,
29918,
5327,
29897,
13,
13,
3318,
29918,
5327,
353,
679,
29918,
12650,
703,
276,
26081,
1159,
13,
5992,
29918,
3318,
29918,
25118,
703,
276,
26081,
613,
1203,
29918,
5327,
29897,
13,
13,
3318,
29918,
5327,
353,
679,
29918,
12650,
703,
1285,
1461,
1159,
13,
5992,
29918,
3318,
29918,
25118,
703,
1285,
1461,
613,
1203,
29918,
5327,
29897,
13,
13,
29875,
353,
29871,
29900,
13,
28045,
353,
1653,
29918,
28045,
580,
13,
22197,
353,
1653,
29918,
22197,
29898,
506,
11259,
29961,
29875,
3816,
29900,
29962,
718,
376,
10783,
482,
25219,
613,
376,
2831,
901,
4902,
6493,
376,
718,
7794,
11259,
29961,
29875,
3816,
29896,
2314,
13,
1285,
1461,
353,
1653,
29918,
1285,
1461,
580,
13,
13,
2158,
703,
2528,
292,
3450,
29903,
304,
3553,
29903,
5725,
6160,
718,
16653,
29897,
13,
1454,
7882,
297,
3095,
275,
29901,
268,
13,
1678,
5957,
353,
1653,
29918,
974,
571,
287,
29918,
10314,
29898,
2696,
414,
29961,
29875,
2314,
13,
1678,
8954,
353,
1653,
29918,
276,
26081,
29898,
276,
6338,
800,
29961,
29875,
2314,
13,
1678,
24238,
353,
1653,
29918,
16674,
29918,
8813,
29898,
2754,
29897,
13,
13,
1678,
788,
29918,
10314,
29918,
517,
29918,
28045,
29898,
28045,
29892,
5957,
29897,
13,
1678,
788,
29918,
276,
26081,
29918,
517,
29918,
10314,
29898,
974,
571,
29892,
8954,
29897,
13,
1678,
788,
29918,
8813,
29918,
517,
29918,
276,
26081,
29898,
276,
26081,
29892,
24238,
29897,
13,
1678,
788,
29918,
1285,
1461,
29918,
517,
29918,
10314,
29898,
974,
571,
29892,
8078,
29897,
13,
1678,
788,
29918,
7491,
29918,
517,
29918,
1285,
1461,
29898,
1285,
1461,
29892,
8898,
29897,
13,
13,
1678,
1596,
703,
15213,
292,
376,
718,
7794,
11259,
29961,
29875,
3816,
29900,
29962,
29871,
718,
376,
297,
376,
718,
24238,
1723,
13,
1678,
474,
353,
474,
718,
29871,
29896,
13,
2
] |
main.py | verdoSee/AnticheatBypassFor10fingers | 2 | 1615969 | import cv2
import pytesseract
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
Uemail = "" #Your email of the account you wish to pass the anticheat test
Upasswd = "" ##Your password of the account you wish to pass the anticheat test
PATH = "C:\Program Files (x86)\chromedriver.exe"
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(executable_path = PATH, options=options)
driver.get("https://10fastfingers.com/typing-test/english")
sleep(2.5) #If you have slow internet please make this a little higher like 3-4 seconds.
driver.find_element_by_id('CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll').click()
driver.find_element_by_xpath('/html/body/div[3]/div/nav/div[2]/ul[4]/li[2]/a').click()
sleep(1)
email = driver.find_element_by_id("UserEmail")
email.send_keys(Uemail)
passwd = driver.find_element_by_id("<PASSWORD>")
passwd.send_keys(<PASSWORD>)
loginButton = driver.find_element_by_id('login-form-submit').click()
sleep(1)
driver.get("https://10fastfingers.com/anticheat/view/1/1") #change this with the link of the typing test you want to pass.
driver.find_element_by_id("start-btn").click()
sleep(0.5) #If you have slow internet please make this a little higher like 2 seconds.
TextImage = driver.find_element_by_xpath('/html/body/div[4]/div[1]/div[4]/div/div/div[3]/div[1]/img')
TextImage.screenshot("C:\\Users\\user\\scripts\\anticheatBypass\\text.png") #change this to your path where you saved
pytesseract.pytesseract.tesseract_cmd = (r'C:\\Program Files\\Tesseract-OCR\\tesseract.exe')
img = cv2.imread("C:\\Users\\user\\scripts\\anticheatBypass\\text.png") #change this to your path where you saved
text = pytesseract.image_to_string(img) #converting the img to string so we can use it
input = driver.find_element_by_id("word-input")
for words in text.split(): #writing the words
input.send_keys(words)
input.send_keys(Keys.SPACE)
sleep(0.5) #lower than 0.3 might get you banned
submit = driver.find_element_by_id("submit-anticheat").click()
| [
1,
1053,
13850,
29906,
13,
5215,
282,
3637,
16136,
627,
13,
3166,
931,
1053,
8709,
13,
3166,
18866,
1053,
1856,
9465,
13,
3166,
18866,
29889,
29813,
29889,
9435,
29889,
8149,
1053,
4813,
952,
13,
13,
29965,
5269,
353,
5124,
396,
10858,
4876,
310,
278,
3633,
366,
6398,
304,
1209,
278,
3677,
4070,
271,
1243,
13,
29965,
3364,
9970,
353,
5124,
444,
10858,
4800,
310,
278,
3633,
366,
6398,
304,
1209,
278,
3677,
4070,
271,
1243,
13,
13,
10145,
353,
376,
29907,
3583,
9283,
12745,
313,
29916,
29947,
29953,
2144,
27433,
287,
3511,
29889,
8097,
29908,
13,
6768,
353,
1856,
9465,
29889,
1451,
4871,
5856,
580,
13,
6768,
29889,
1202,
29918,
735,
27910,
29918,
3385,
877,
735,
2325,
24995,
267,
742,
6024,
12007,
29899,
21027,
11287,
13,
9465,
353,
1856,
9465,
29889,
1451,
4871,
29898,
4258,
9246,
29918,
2084,
353,
23611,
29892,
3987,
29922,
6768,
29897,
13,
9465,
29889,
657,
703,
991,
597,
29896,
29900,
11255,
29888,
19936,
29889,
510,
29914,
1017,
15702,
29899,
1688,
29914,
996,
1674,
1159,
13,
17059,
29898,
29906,
29889,
29945,
29897,
396,
3644,
366,
505,
5232,
8986,
3113,
1207,
445,
263,
2217,
6133,
763,
29871,
29941,
29899,
29946,
6923,
29889,
13,
9465,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
877,
29733,
7451,
24914,
7451,
7647,
8434,
10108,
3125,
10108,
20624,
262,
15930,
3596,
2824,
3808,
580,
13,
9465,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
11219,
1420,
29914,
2587,
29914,
4563,
29961,
29941,
16261,
4563,
29914,
6654,
29914,
4563,
29961,
29906,
16261,
352,
29961,
29946,
16261,
492,
29961,
29906,
16261,
29874,
2824,
3808,
580,
13,
17059,
29898,
29896,
29897,
13,
13,
5269,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
2659,
9823,
1159,
13,
5269,
29889,
6717,
29918,
8149,
29898,
29965,
5269,
29897,
13,
3364,
9970,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
28945,
25711,
17013,
29958,
1159,
13,
3364,
9970,
29889,
6717,
29918,
8149,
29898,
29966,
25711,
17013,
12948,
13,
7507,
3125,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
877,
7507,
29899,
689,
29899,
7892,
2824,
3808,
580,
13,
17059,
29898,
29896,
29897,
13,
13,
9465,
29889,
657,
703,
991,
597,
29896,
29900,
11255,
29888,
19936,
29889,
510,
29914,
424,
4070,
271,
29914,
1493,
29914,
29896,
29914,
29896,
1159,
396,
3167,
445,
411,
278,
1544,
310,
278,
19229,
1243,
366,
864,
304,
1209,
29889,
13,
9465,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
2962,
29899,
7290,
2564,
3808,
580,
13,
17059,
29898,
29900,
29889,
29945,
29897,
396,
3644,
366,
505,
5232,
8986,
3113,
1207,
445,
263,
2217,
6133,
763,
29871,
29906,
6923,
29889,
13,
13,
1626,
2940,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
11219,
1420,
29914,
2587,
29914,
4563,
29961,
29946,
16261,
4563,
29961,
29896,
16261,
4563,
29961,
29946,
16261,
4563,
29914,
4563,
29914,
4563,
29961,
29941,
16261,
4563,
29961,
29896,
16261,
2492,
1495,
13,
1626,
2940,
29889,
29879,
24546,
8711,
703,
29907,
22298,
5959,
1966,
1792,
1966,
16713,
1966,
424,
4070,
271,
29933,
1478,
465,
1966,
726,
29889,
2732,
1159,
396,
3167,
445,
304,
596,
2224,
988,
366,
7160,
13,
13,
2272,
29873,
16136,
627,
29889,
2272,
29873,
16136,
627,
29889,
29873,
16136,
627,
29918,
9006,
353,
313,
29878,
29915,
29907,
22298,
9283,
12745,
1966,
29911,
16136,
627,
29899,
29949,
11341,
1966,
29873,
16136,
627,
29889,
8097,
1495,
13,
2492,
353,
13850,
29906,
29889,
326,
949,
703,
29907,
22298,
5959,
1966,
1792,
1966,
16713,
1966,
424,
4070,
271,
29933,
1478,
465,
1966,
726,
29889,
2732,
1159,
396,
3167,
445,
304,
596,
2224,
988,
366,
7160,
29871,
13,
726,
353,
282,
3637,
16136,
627,
29889,
3027,
29918,
517,
29918,
1807,
29898,
2492,
29897,
396,
535,
369,
1259,
278,
10153,
304,
1347,
577,
591,
508,
671,
372,
13,
13,
2080,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
1742,
29899,
2080,
1159,
259,
13,
1454,
3838,
297,
1426,
29889,
5451,
7295,
396,
16554,
278,
3838,
13,
1678,
1881,
29889,
6717,
29918,
8149,
29898,
9303,
29897,
13,
1678,
1881,
29889,
6717,
29918,
8149,
29898,
15506,
29889,
5550,
11538,
29897,
13,
1678,
8709,
29898,
29900,
29889,
29945,
29897,
396,
13609,
1135,
29871,
29900,
29889,
29941,
1795,
679,
366,
289,
11310,
13,
7892,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
333,
703,
7892,
29899,
424,
4070,
271,
2564,
3808,
580,
13,
2
] |
agro_site/orders/migrations/0001_initial.py | LukoninDmitryPy/agro_site-2 | 0 | 7698 | <reponame>LukoninDmitryPy/agro_site-2<filename>agro_site/orders/migrations/0001_initial.py
# Generated by Django 2.2.16 on 2022-04-12 13:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.expressions
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('sales_backend', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Chat',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.CharField(choices=[('D', 'Dialog'), ('C', 'Chat')], default='D', max_length=1, verbose_name='Тип')),
('members', models.ManyToManyField(to=settings.AUTH_USER_MODEL, verbose_name='Участник')),
],
),
migrations.CreateModel(
name='Order',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('address', models.CharField(max_length=250)),
('postal_code', models.CharField(max_length=20)),
('city', models.CharField(max_length=100)),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)),
('paid', models.BooleanField(default=False)),
('status_order', models.CharField(choices=[('В обработке', 'В обработке'), ('Заказ собран', 'Заказ собран'), ('Заказ отправлен', 'Заказ отправлен')], default='В обработке', max_length=20)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name_plural': 'Заказы',
'ordering': ('-created',),
},
),
migrations.CreateModel(
name='OrderItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('price', models.DecimalField(decimal_places=2, max_digits=10)),
('quantity', models.PositiveIntegerField(default=1)),
('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='orders.Order')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_items', to='sales_backend.Product')),
('seller', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seller', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_users', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Message',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('message', models.TextField(verbose_name='Сообщение')),
('pub_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Дата сообщения')),
('is_readed', models.BooleanField(default=False, verbose_name='Прочитано')),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь')),
('chat', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='orders.Chat', verbose_name='Чат')),
],
options={
'ordering': ['pub_date'],
},
),
migrations.AddConstraint(
model_name='orderitem',
constraint=models.CheckConstraint(check=models.Q(_negated=True, user=django.db.models.expressions.F('seller')), name='dont_buy_yourself'),
),
]
| [
1,
529,
276,
1112,
420,
29958,
29931,
2679,
265,
262,
29928,
2415,
719,
19737,
29914,
351,
307,
29918,
2746,
29899,
29906,
29966,
9507,
29958,
351,
307,
29918,
2746,
29914,
20488,
29914,
26983,
800,
29914,
29900,
29900,
29900,
29896,
29918,
11228,
29889,
2272,
13,
29937,
3251,
630,
491,
15337,
29871,
29906,
29889,
29906,
29889,
29896,
29953,
373,
29871,
29906,
29900,
29906,
29906,
29899,
29900,
29946,
29899,
29896,
29906,
29871,
29896,
29941,
29901,
29906,
29947,
13,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
5215,
9557,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
13,
5215,
9557,
29889,
2585,
29889,
9794,
29889,
17073,
1080,
13,
5215,
9557,
29889,
13239,
29889,
2230,
8028,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
2847,
353,
5852,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
29879,
2122,
29918,
27852,
742,
525,
29900,
29900,
29900,
29896,
29918,
11228,
5477,
13,
4706,
9725,
800,
29889,
2774,
932,
519,
29918,
10836,
29898,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
511,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
1451,
271,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
1853,
742,
4733,
29889,
27890,
29898,
1859,
1575,
11759,
877,
29928,
742,
525,
7647,
5477,
6702,
29907,
742,
525,
1451,
271,
1495,
1402,
2322,
2433,
29928,
742,
4236,
29918,
2848,
29922,
29896,
29892,
26952,
29918,
978,
2433,
30041,
29917,
29964,
1495,
511,
13,
18884,
6702,
28109,
742,
4733,
29889,
14804,
1762,
14804,
3073,
29898,
517,
29922,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
29892,
26952,
29918,
978,
2433,
30053,
1282,
464,
3316,
1495,
511,
13,
9651,
21251,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
7514,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
7328,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29900,
8243,
13,
18884,
6702,
2490,
284,
29918,
401,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29900,
8243,
13,
18884,
6702,
12690,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29896,
29900,
29900,
8243,
13,
18884,
6702,
11600,
742,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
8243,
13,
18884,
6702,
21402,
742,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29922,
5574,
8243,
13,
18884,
6702,
3274,
333,
742,
4733,
29889,
18146,
3073,
29898,
4381,
29922,
8824,
8243,
13,
18884,
6702,
4882,
29918,
2098,
742,
4733,
29889,
27890,
29898,
1859,
1575,
11759,
877,
30012,
9111,
1782,
29932,
2476,
742,
525,
30012,
9111,
1782,
29932,
2476,
5477,
6702,
15578,
16602,
21291,
3048,
742,
525,
15578,
16602,
21291,
3048,
5477,
6702,
15578,
16602,
1685,
6842,
2510,
742,
525,
15578,
16602,
1685,
6842,
2510,
1495,
1402,
2322,
2433,
30012,
9111,
1782,
29932,
2476,
742,
4236,
29918,
2848,
29922,
29906,
29900,
8243,
13,
18884,
6702,
1792,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
1792,
742,
304,
29922,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
8243,
13,
9651,
21251,
13,
9651,
3987,
3790,
13,
18884,
525,
369,
15828,
29918,
978,
29918,
572,
3631,
2396,
525,
15578,
642,
4536,
742,
13,
18884,
525,
2098,
292,
2396,
6702,
29899,
11600,
742,
511,
13,
9651,
2981,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
7514,
2001,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
9175,
742,
4733,
29889,
23307,
3073,
29898,
7099,
3039,
29918,
29886,
6048,
29922,
29906,
29892,
4236,
29918,
7501,
1169,
29922,
29896,
29900,
8243,
13,
18884,
6702,
22640,
742,
4733,
29889,
9135,
3321,
7798,
3073,
29898,
4381,
29922,
29896,
8243,
13,
18884,
6702,
2098,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
7076,
742,
304,
2433,
20488,
29889,
7514,
1495,
511,
13,
18884,
6702,
4704,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
2098,
29918,
7076,
742,
304,
2433,
29879,
2122,
29918,
27852,
29889,
7566,
1495,
511,
13,
18884,
6702,
29879,
4539,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
29879,
4539,
742,
304,
29922,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
8243,
13,
18884,
6702,
1792,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
2433,
2098,
29918,
7193,
742,
304,
29922,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
8243,
13,
9651,
21251,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
3728,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
4906,
742,
4733,
29889,
15778,
29898,
369,
15828,
29918,
978,
2433,
30008,
29904,
4389,
24849,
1495,
511,
13,
18884,
6702,
5467,
29918,
1256,
742,
4733,
29889,
11384,
3073,
29898,
4381,
29922,
14095,
29889,
13239,
29889,
2230,
8028,
29889,
3707,
29892,
26952,
29918,
978,
2433,
30032,
29910,
676,
25032,
14483,
1495,
511,
13,
18884,
6702,
275,
29918,
949,
287,
742,
4733,
29889,
18146,
3073,
29898,
4381,
29922,
8824,
29892,
26952,
29918,
978,
2433,
30013,
576,
18790,
570,
1495,
511,
13,
18884,
6702,
8921,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
304,
29922,
11027,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
29892,
26952,
29918,
978,
2433,
20093,
693,
9718,
2584,
1495,
511,
13,
18884,
6702,
13496,
742,
4733,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
304,
2433,
20488,
29889,
1451,
271,
742,
26952,
29918,
978,
2433,
30076,
12174,
1495,
511,
13,
9651,
21251,
13,
9651,
3987,
3790,
13,
18884,
525,
2098,
292,
2396,
6024,
5467,
29918,
1256,
7464,
13,
9651,
2981,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
21529,
29898,
13,
9651,
1904,
29918,
978,
2433,
2098,
667,
742,
13,
9651,
7276,
29922,
9794,
29889,
5596,
21529,
29898,
3198,
29922,
9794,
29889,
29984,
7373,
10052,
630,
29922,
5574,
29892,
1404,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
17073,
1080,
29889,
29943,
877,
29879,
4539,
1495,
511,
1024,
2433,
29881,
609,
29918,
2423,
29891,
29918,
8066,
1311,
5477,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
test/pandas/1_select.py | wull566/tensorflow_demo | 2 | 102283 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pandas 学习
字典形式的numpy
"""
from __future__ import print_function
import numpy as np
import pandas as pd
dates = pd.date_range('20130101', periods=6)
df = pd.DataFrame(np.arange(24).reshape((6,4)),index=dates, columns=['A','B','C','D'])
"""
A B C D
2013-01-01 0 1 2 3
2013-01-02 4 5 6 7
2013-01-03 8 9 10 11
2013-01-04 12 13 14 15
2013-01-05 16 17 18 19
2013-01-06 20 21 22 23
"""
# print(df['A'])
print(df.A)
print(df[0:3])
"""
A B C D
2013-01-01 0 1 2 3
2013-01-02 4 5 6 7
2013-01-03 8 9 10 11
"""
print(df['20130102':'20130104'])
"""
A B C D
2013-01-02 4 5 6 7
2013-01-03 8 9 10 11
2013-01-04 12 13 14 15
"""
print(df.loc['20130102'])
"""
A 4
B 5
C 6
D 7
Name: 2013-01-02 00:00:00, dtype: int64
"""
print(df.loc[:,['A','B']])
"""
A B
2013-01-01 0 1
2013-01-02 4 5
2013-01-03 8 9
2013-01-04 12 13
2013-01-05 16 17
2013-01-06 20 21
"""
print(df.loc['20130102',['A','B']])
"""
A 4
B 5
Name: 2013-01-02 00:00:00, dtype: int64
"""
print(df.iloc[3,1])
# 13
print(df.iloc[3:5,1:3])
"""
B C
2013-01-04 13 14
2013-01-05 17 18
"""
print(df.iloc[[1,3,5],1:3])
"""
B C
2013-01-02 5 6
2013-01-04 13 14
2013-01-06 21 22
"""
# 根据混合的这两种 ix
print(df.ix[:3,['A','C']])
"""
A C
2013-01-01 0 2
2013-01-02 4 6
2013-01-03 8 10
"""
print(df[df.A>8])
"""
A B C D
2013-01-04 12 13 14 15
2013-01-05 16 17 18 19
2013-01-06 20 21 22 23
"""
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
15945,
29908,
13,
15112,
29871,
30415,
231,
188,
163,
13,
13,
30578,
31259,
31305,
30607,
30210,
23749,
13,
13,
15945,
29908,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
11701,
408,
10518,
13,
13,
15190,
353,
10518,
29889,
1256,
29918,
3881,
877,
29906,
29900,
29896,
29941,
29900,
29896,
29900,
29896,
742,
23704,
29922,
29953,
29897,
13,
2176,
353,
10518,
29889,
17271,
29898,
9302,
29889,
279,
927,
29898,
29906,
29946,
467,
690,
14443,
3552,
29953,
29892,
29946,
8243,
2248,
29922,
15190,
29892,
4341,
29922,
1839,
29909,
3788,
29933,
3788,
29907,
3788,
29928,
11287,
13,
13,
15945,
29908,
13,
632,
319,
259,
350,
259,
315,
259,
360,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29896,
1678,
29900,
1678,
29896,
1678,
29906,
1678,
29941,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29906,
1678,
29946,
1678,
29945,
1678,
29953,
1678,
29955,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29941,
1678,
29947,
1678,
29929,
259,
29896,
29900,
259,
29896,
29896,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29946,
259,
29896,
29906,
259,
29896,
29941,
259,
29896,
29946,
259,
29896,
29945,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29945,
259,
29896,
29953,
259,
29896,
29955,
259,
29896,
29947,
259,
29896,
29929,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29953,
259,
29906,
29900,
259,
29906,
29896,
259,
29906,
29906,
259,
29906,
29941,
13,
15945,
29908,
13,
13,
29937,
1596,
29898,
2176,
1839,
29909,
11287,
13,
2158,
29898,
2176,
29889,
29909,
29897,
13,
13,
2158,
29898,
2176,
29961,
29900,
29901,
29941,
2314,
13,
13,
15945,
29908,
13,
9651,
319,
29871,
350,
259,
315,
259,
360,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29896,
259,
29900,
259,
29896,
1678,
29906,
1678,
29941,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29906,
259,
29946,
259,
29945,
1678,
29953,
1678,
29955,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29941,
259,
29947,
259,
29929,
259,
29896,
29900,
259,
29896,
29896,
13,
15945,
29908,
13,
2158,
29898,
2176,
1839,
29906,
29900,
29896,
29941,
29900,
29896,
29900,
29906,
22099,
29906,
29900,
29896,
29941,
29900,
29896,
29900,
29946,
11287,
13,
13,
15945,
29908,
13,
29909,
259,
350,
259,
315,
259,
360,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29906,
1678,
29946,
1678,
29945,
1678,
29953,
1678,
29955,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29941,
1678,
29947,
1678,
29929,
259,
29896,
29900,
259,
29896,
29896,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29946,
259,
29896,
29906,
259,
29896,
29941,
259,
29896,
29946,
259,
29896,
29945,
13,
15945,
29908,
13,
13,
13,
2158,
29898,
2176,
29889,
2029,
1839,
29906,
29900,
29896,
29941,
29900,
29896,
29900,
29906,
11287,
13,
15945,
29908,
13,
29909,
268,
29946,
13,
29933,
268,
29945,
13,
29907,
268,
29953,
13,
29928,
268,
29955,
13,
1170,
29901,
29871,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29906,
29871,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29900,
29892,
26688,
29901,
938,
29953,
29946,
13,
15945,
29908,
13,
13,
2158,
29898,
2176,
29889,
2029,
7503,
29892,
1839,
29909,
3788,
29933,
2033,
2314,
13,
15945,
29908,
13,
632,
319,
259,
350,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29896,
1678,
29900,
1678,
29896,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29906,
1678,
29946,
1678,
29945,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29941,
1678,
29947,
1678,
29929,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29946,
259,
29896,
29906,
259,
29896,
29941,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29945,
259,
29896,
29953,
259,
29896,
29955,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29953,
259,
29906,
29900,
259,
29906,
29896,
13,
15945,
29908,
13,
13,
2158,
29898,
2176,
29889,
2029,
1839,
29906,
29900,
29896,
29941,
29900,
29896,
29900,
29906,
742,
1839,
29909,
3788,
29933,
2033,
2314,
13,
15945,
29908,
13,
29909,
268,
29946,
13,
29933,
268,
29945,
13,
1170,
29901,
29871,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29906,
29871,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29900,
29892,
26688,
29901,
938,
29953,
29946,
13,
15945,
29908,
13,
13,
13,
2158,
29898,
2176,
29889,
309,
542,
29961,
29941,
29892,
29896,
2314,
13,
29937,
29871,
29896,
29941,
13,
13,
2158,
29898,
2176,
29889,
309,
542,
29961,
29941,
29901,
29945,
29892,
29896,
29901,
29941,
2314,
13,
15945,
29908,
13,
632,
350,
259,
315,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29946,
259,
29896,
29941,
259,
29896,
29946,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29945,
259,
29896,
29955,
259,
29896,
29947,
13,
15945,
29908,
13,
13,
2158,
29898,
2176,
29889,
309,
542,
8999,
29896,
29892,
29941,
29892,
29945,
1402,
29896,
29901,
29941,
2314,
13,
15945,
29908,
13,
632,
350,
259,
315,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29906,
1678,
29945,
1678,
29953,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29946,
259,
29896,
29941,
259,
29896,
29946,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29953,
259,
29906,
29896,
259,
29906,
29906,
13,
13,
15945,
29908,
13,
13,
29937,
29871,
31393,
30763,
233,
186,
186,
30733,
30210,
30810,
31977,
31893,
474,
29916,
13,
13,
2158,
29898,
2176,
29889,
861,
7503,
29941,
29892,
1839,
29909,
3788,
29907,
2033,
2314,
13,
15945,
29908,
13,
9651,
319,
259,
315,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29896,
259,
29900,
1678,
29906,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29906,
259,
29946,
1678,
29953,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29941,
259,
29947,
259,
29896,
29900,
13,
15945,
29908,
13,
13,
2158,
29898,
2176,
29961,
2176,
29889,
29909,
29958,
29947,
2314,
13,
15945,
29908,
13,
632,
319,
259,
350,
259,
315,
259,
360,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29946,
259,
29896,
29906,
259,
29896,
29941,
259,
29896,
29946,
259,
29896,
29945,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29945,
259,
29896,
29953,
259,
29896,
29955,
259,
29896,
29947,
259,
29896,
29929,
13,
29906,
29900,
29896,
29941,
29899,
29900,
29896,
29899,
29900,
29953,
259,
29906,
29900,
259,
29906,
29896,
259,
29906,
29906,
259,
29906,
29941,
13,
15945,
29908,
13,
13,
13,
2
] |
Tests/test_genericmeth.py | aisk/ironpython3 | 1,872 | 197027 | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import os
import unittest
from iptest import IronPythonTestCase, is_cli, run_test, skipUnlessIronPython
@skipUnlessIronPython()
class GenericMethTest(IronPythonTestCase):
def setUp(self):
super(GenericMethTest, self).setUp()
self.load_iron_python_test()
def assertDocEqual(self, received, expected):
expected = expected.split(os.linesep)
received = received.split(os.linesep)
for x in received:
if not x in expected:
self.fail('Extra doc string: ' + x)
index = expected.index(x)
del expected[index]
if expected: self.fail('Missing doc strings: ' + expected.join(', '))
def test_generic_method_binding(self):
from IronPythonTest import GenMeth
# Create an instance of the generic method provider class.
gm = GenMeth()
# Check that the documentation strings for all the instance methods (they all have the same name) is as expected.
expected = os.linesep.join([
'InstMeth[T](self: GenMeth) -> str',
'InstMeth[(T, U)](self: GenMeth) -> str',
'InstMeth[T](self: GenMeth, arg1: int) -> str',
'InstMeth[T](self: GenMeth, arg1: str) -> str',
'InstMeth[(T, U)](self: GenMeth, arg1: int) -> str',
'InstMeth[T](self: GenMeth, arg1: T) -> str',
'InstMeth[(T, U)](self: GenMeth, arg1: T, arg2: U) -> str',
'InstMeth(self: GenMeth) -> str',
'InstMeth(self: GenMeth, arg1: int) -> str',
'InstMeth(self: GenMeth, arg1: str) -> str']) + os.linesep
self.assertDocEqual(gm.InstMeth.__doc__, expected)
# And the same for the static methods.
expected_static_methods = os.linesep.join([
'StaticMeth[T]() -> str' ,
'StaticMeth[(T, U)]() -> str' ,
'StaticMeth[T](arg1: int) -> str' ,
'StaticMeth[T](arg1: str) -> str' ,
'StaticMeth[(T, U)](arg1: int) -> str' ,
'StaticMeth[T](arg1: T) -> str' ,
'StaticMeth[(T, U)](arg1: T, arg2: U) -> str' ,
'StaticMeth() -> str' ,
'StaticMeth(arg1: int) -> str' ,
'StaticMeth(arg1: str) -> str']) + os.linesep
self.assertDocEqual(GenMeth.StaticMeth.__doc__, expected_static_methods)
# Check that we bind to the correct method based on type and call arguments for each of our instance methods. We can validate this
# because each target method returns a unique string we can compare.
self.assertEqual(gm.InstMeth(), "InstMeth()")
self.assertEqual(gm.InstMeth[str](), "InstMeth<String>()")
self.assertEqual(gm.InstMeth[(int, str)](), "InstMeth<Int32, String>()")
self.assertEqual(gm.InstMeth(1), "InstMeth(Int32)")
self.assertEqual(gm.InstMeth(""), "InstMeth(String)")
#This ordering never worked, but new method binding rules reveal the bug. Open a new bug here.
#self.assertEqual(gm.InstMeth[int](1), "InstMeth<Int32>(Int32)")
#self.assertEqual(gm.InstMeth[str](""), "InstMeth<String>(String)")
self.assertEqual(gm.InstMeth[(str, int)](1), "InstMeth<String, Int32>(Int32)")
self.assertEqual(gm.InstMeth[GenMeth](gm), "InstMeth<GenMeth>(GenMeth)")
self.assertEqual(gm.InstMeth[(str, int)]("", 1), "InstMeth<String, Int32>(String, Int32)")
# And the same for the static methods.
self.assertEqual(GenMeth.StaticMeth(), "StaticMeth()")
self.assertEqual(GenMeth.StaticMeth[str](), "StaticMeth<String>()")
self.assertEqual(GenMeth.StaticMeth[(int, str)](), "StaticMeth<Int32, String>()")
self.assertEqual(GenMeth.StaticMeth(1), "StaticMeth(Int32)")
self.assertEqual(GenMeth.StaticMeth(""), "StaticMeth(String)")
#self.assertEqual(GenMeth.StaticMeth[int](1), "StaticMeth<Int32>(Int32)")
#self.assertEqual(GenMeth.StaticMeth[str](""), "StaticMeth<String>(String)")
self.assertEqual(GenMeth.StaticMeth[(str, int)](1), "StaticMeth<String, Int32>(Int32)")
self.assertEqual(GenMeth.StaticMeth[GenMeth](gm), "StaticMeth<GenMeth>(GenMeth)")
self.assertEqual(GenMeth.StaticMeth[(str, int)]("", 1), "StaticMeth<String, Int32>(String, Int32)")
run_test(__name__)
| [
1,
396,
10413,
21144,
304,
278,
869,
6006,
10606,
1090,
697,
470,
901,
8571,
4110,
29889,
13,
29937,
450,
869,
6006,
10606,
7794,
11259,
445,
934,
304,
366,
1090,
278,
13380,
29871,
29906,
29889,
29900,
19245,
29889,
13,
29937,
2823,
278,
365,
2965,
1430,
1660,
934,
297,
278,
2060,
3876,
363,
901,
2472,
29889,
13,
13,
5215,
2897,
13,
5215,
443,
27958,
13,
13,
3166,
474,
415,
342,
1053,
20492,
11980,
3057,
8259,
29892,
338,
29918,
11303,
29892,
1065,
29918,
1688,
29892,
14383,
2525,
2222,
29902,
1617,
11980,
13,
13,
29992,
11014,
2525,
2222,
29902,
1617,
11980,
580,
13,
1990,
3251,
293,
29924,
621,
3057,
29898,
29902,
1617,
11980,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
2428,
29898,
15809,
29924,
621,
3057,
29892,
1583,
467,
842,
3373,
580,
13,
13,
4706,
1583,
29889,
1359,
29918,
381,
265,
29918,
4691,
29918,
1688,
580,
13,
13,
1678,
822,
4974,
14526,
9843,
29898,
1311,
29892,
4520,
29892,
3806,
1125,
13,
4706,
3806,
353,
3806,
29889,
5451,
29898,
359,
29889,
1915,
968,
29886,
29897,
13,
4706,
4520,
353,
4520,
29889,
5451,
29898,
359,
29889,
1915,
968,
29886,
29897,
13,
4706,
363,
921,
297,
4520,
29901,
13,
9651,
565,
451,
921,
297,
3806,
29901,
13,
18884,
1583,
29889,
14057,
877,
18126,
1574,
1347,
29901,
525,
718,
921,
29897,
13,
9651,
2380,
353,
3806,
29889,
2248,
29898,
29916,
29897,
13,
9651,
628,
3806,
29961,
2248,
29962,
13,
13,
4706,
565,
3806,
29901,
1583,
29889,
14057,
877,
18552,
292,
1574,
6031,
29901,
525,
718,
3806,
29889,
7122,
29317,
525,
876,
13,
13,
1678,
822,
1243,
29918,
19206,
29918,
5696,
29918,
19672,
29898,
1311,
1125,
13,
4706,
515,
20492,
11980,
3057,
1053,
5739,
29924,
621,
13,
13,
4706,
396,
6204,
385,
2777,
310,
278,
10035,
1158,
13113,
770,
29889,
13,
4706,
330,
29885,
353,
5739,
29924,
621,
580,
13,
13,
4706,
396,
5399,
393,
278,
5106,
6031,
363,
599,
278,
2777,
3519,
313,
19562,
599,
505,
278,
1021,
1024,
29897,
338,
408,
3806,
29889,
13,
4706,
3806,
353,
2897,
29889,
1915,
968,
29886,
29889,
7122,
4197,
13,
9651,
525,
3379,
29924,
621,
29961,
29911,
850,
1311,
29901,
5739,
29924,
621,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
15625,
29911,
29892,
501,
23192,
1311,
29901,
5739,
29924,
621,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
29961,
29911,
850,
1311,
29901,
5739,
29924,
621,
29892,
1852,
29896,
29901,
938,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
29961,
29911,
850,
1311,
29901,
5739,
29924,
621,
29892,
1852,
29896,
29901,
851,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
15625,
29911,
29892,
501,
23192,
1311,
29901,
5739,
29924,
621,
29892,
1852,
29896,
29901,
938,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
29961,
29911,
850,
1311,
29901,
5739,
29924,
621,
29892,
1852,
29896,
29901,
323,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
15625,
29911,
29892,
501,
23192,
1311,
29901,
5739,
29924,
621,
29892,
1852,
29896,
29901,
323,
29892,
1852,
29906,
29901,
501,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
29898,
1311,
29901,
5739,
29924,
621,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
29898,
1311,
29901,
5739,
29924,
621,
29892,
1852,
29896,
29901,
938,
29897,
1599,
851,
742,
13,
9651,
525,
3379,
29924,
621,
29898,
1311,
29901,
5739,
29924,
621,
29892,
1852,
29896,
29901,
851,
29897,
1599,
851,
11287,
718,
2897,
29889,
1915,
968,
29886,
13,
632,
13,
4706,
1583,
29889,
9294,
14526,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
17255,
1514,
1649,
29892,
3806,
29897,
13,
13,
4706,
396,
1126,
278,
1021,
363,
278,
2294,
3519,
29889,
13,
4706,
3806,
29918,
7959,
29918,
23515,
353,
2897,
29889,
1915,
968,
29886,
29889,
7122,
4197,
13,
18884,
525,
17046,
29924,
621,
29961,
29911,
29962,
580,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
15625,
29911,
29892,
501,
4638,
580,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
29961,
29911,
850,
1191,
29896,
29901,
938,
29897,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
29961,
29911,
850,
1191,
29896,
29901,
851,
29897,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
15625,
29911,
29892,
501,
23192,
1191,
29896,
29901,
938,
29897,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
29961,
29911,
850,
1191,
29896,
29901,
323,
29897,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
15625,
29911,
29892,
501,
23192,
1191,
29896,
29901,
323,
29892,
1852,
29906,
29901,
501,
29897,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
580,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
29898,
1191,
29896,
29901,
938,
29897,
1599,
851,
29915,
1919,
29871,
13,
18884,
525,
17046,
29924,
621,
29898,
1191,
29896,
29901,
851,
29897,
1599,
851,
11287,
718,
2897,
29889,
1915,
968,
29886,
13,
308,
13,
4706,
1583,
29889,
9294,
14526,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
17255,
1514,
1649,
29892,
3806,
29918,
7959,
29918,
23515,
29897,
13,
13,
4706,
396,
5399,
393,
591,
7868,
304,
278,
1959,
1158,
2729,
373,
1134,
322,
1246,
6273,
363,
1269,
310,
1749,
2777,
3519,
29889,
1334,
508,
12725,
445,
13,
4706,
396,
1363,
1269,
3646,
1158,
3639,
263,
5412,
1347,
591,
508,
7252,
29889,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
3285,
376,
3379,
29924,
621,
580,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
29961,
710,
850,
511,
376,
3379,
29924,
621,
29966,
1231,
16917,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
15625,
524,
29892,
851,
23192,
511,
376,
3379,
29924,
621,
29966,
2928,
29941,
29906,
29892,
1714,
16917,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
29898,
29896,
511,
376,
3379,
29924,
621,
29898,
2928,
29941,
29906,
25760,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
703,
4968,
376,
3379,
29924,
621,
29898,
1231,
25760,
13,
4706,
396,
4013,
20520,
2360,
3796,
29892,
541,
716,
1158,
9956,
6865,
10320,
284,
278,
6494,
29889,
29871,
4673,
263,
716,
6494,
1244,
29889,
13,
4706,
396,
1311,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
29961,
524,
850,
29896,
511,
376,
3379,
29924,
621,
29966,
2928,
29941,
29906,
5961,
2928,
29941,
29906,
25760,
13,
4706,
396,
1311,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
29961,
710,
29962,
703,
4968,
376,
3379,
29924,
621,
29966,
1231,
5961,
1231,
25760,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
15625,
710,
29892,
938,
23192,
29896,
511,
376,
3379,
29924,
621,
29966,
1231,
29892,
3159,
29941,
29906,
5961,
2928,
29941,
29906,
25760,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
29961,
15462,
29924,
621,
850,
29887,
29885,
511,
376,
3379,
29924,
621,
29966,
15462,
29924,
621,
5961,
15462,
29924,
621,
25760,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29887,
29885,
29889,
3379,
29924,
621,
15625,
710,
29892,
938,
4638,
703,
613,
29871,
29896,
511,
376,
3379,
29924,
621,
29966,
1231,
29892,
3159,
29941,
29906,
5961,
1231,
29892,
3159,
29941,
29906,
25760,
13,
13,
4706,
396,
1126,
278,
1021,
363,
278,
2294,
3519,
29889,
13,
4706,
1583,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
3285,
376,
17046,
29924,
621,
580,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
29961,
710,
850,
511,
376,
17046,
29924,
621,
29966,
1231,
16917,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
15625,
524,
29892,
851,
23192,
511,
376,
17046,
29924,
621,
29966,
2928,
29941,
29906,
29892,
1714,
16917,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
29898,
29896,
511,
376,
17046,
29924,
621,
29898,
2928,
29941,
29906,
25760,
13,
4706,
1583,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
703,
4968,
376,
17046,
29924,
621,
29898,
1231,
25760,
13,
4706,
396,
1311,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
29961,
524,
850,
29896,
511,
376,
17046,
29924,
621,
29966,
2928,
29941,
29906,
5961,
2928,
29941,
29906,
25760,
13,
4706,
396,
1311,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
29961,
710,
29962,
703,
4968,
376,
17046,
29924,
621,
29966,
1231,
5961,
1231,
25760,
13,
4706,
1583,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
15625,
710,
29892,
938,
23192,
29896,
511,
376,
17046,
29924,
621,
29966,
1231,
29892,
3159,
29941,
29906,
5961,
2928,
29941,
29906,
25760,
13,
4706,
1583,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
29961,
15462,
29924,
621,
850,
29887,
29885,
511,
376,
17046,
29924,
621,
29966,
15462,
29924,
621,
5961,
15462,
29924,
621,
25760,
13,
4706,
1583,
29889,
9294,
9843,
29898,
15462,
29924,
621,
29889,
17046,
29924,
621,
15625,
710,
29892,
938,
4638,
703,
613,
29871,
29896,
511,
376,
17046,
29924,
621,
29966,
1231,
29892,
3159,
29941,
29906,
5961,
1231,
29892,
3159,
29941,
29906,
25760,
13,
13,
3389,
29918,
1688,
22168,
978,
1649,
29897,
13,
2
] |
inversor/train/models.py | aasensio/DeepLearning | 0 | 101537 | <filename>inversor/train/models.py
from keras.layers import Input, Conv1D, BatchNormalization, Dense, LSTM, TimeDistributed, Flatten, Bidirectional
from keras.models import Model
from keras.regularizers import l2
def zdi(n_lambda, noise, activation='relu', n_filters=64, l2_reg=1e-7):
"""
Deep residual recurrent network for the inversion of stellar spectra
"""
st = Input(shape=(None, n_lambda, 1), name='stokes_input')
x = BatchNormalization()(st)
x = TimeDistributed(Conv1D(n_filters, 3, activation=activation, padding='same', strides=1, kernel_initializer='he_normal',
kernel_regularizer=l2(l2_reg)), name='conv_1')(x)
x = BatchNormalization()(x)
x = TimeDistributed(Conv1D(2*n_filters, 3, activation=activation, padding='same', strides=2, kernel_initializer='he_normal',
kernel_regularizer=l2(l2_reg)), name='conv_2')(x)
x = BatchNormalization()(x)
x = TimeDistributed(Conv1D(4*n_filters, 3, activation=activation, padding='same', strides=2, kernel_initializer='he_normal',
kernel_regularizer=l2(l2_reg)), name='conv_3')(x)
x = BatchNormalization()(x)
x = TimeDistributed(Flatten(), name='flatten')(x)
# x_modulus = LSTM(64)(x)
# output_modulus = Dense(1, name='modulus')(x_modulus)
# x_alpha = LSTM(128, return_sequences=True)(x)
x = Bidirectional(LSTM(128))(x)
# x = Dense(128, kernel_initializer='he_normal')(x)
output_alpha = Dense(5, name='alpha')(x)
# x_beta = LSTM(128)(x)
# output_beta = Dense(121, name='beta')(x_beta)
# x_gamma = LSTM(128)(x)
# output_gamma = Dense(121, name='gamma')(x_gamma)
# return Model(inputs=stokes_input, outputs=[output_modulus, output_alpha, output_beta, output_gamma])
return Model(inputs=st, outputs=output_alpha)
| [
1,
529,
9507,
29958,
262,
874,
272,
29914,
14968,
29914,
9794,
29889,
2272,
13,
3166,
13023,
294,
29889,
29277,
1053,
10567,
29892,
1281,
29894,
29896,
29928,
29892,
350,
905,
19077,
2133,
29892,
360,
1947,
29892,
365,
1254,
29924,
29892,
5974,
13398,
7541,
29892,
2379,
8606,
29892,
350,
333,
8684,
284,
13,
3166,
13023,
294,
29889,
9794,
1053,
8125,
13,
3166,
13023,
294,
29889,
15227,
19427,
1053,
301,
29906,
13,
13,
1753,
503,
6051,
29898,
29876,
29918,
2892,
29892,
11462,
29892,
26229,
2433,
2674,
29884,
742,
302,
29918,
26705,
29922,
29953,
29946,
29892,
301,
29906,
29918,
1727,
29922,
29896,
29872,
29899,
29955,
1125,
13,
1678,
9995,
13,
1678,
21784,
10995,
950,
1162,
1264,
3564,
363,
278,
297,
3259,
310,
14781,
279,
6683,
336,
13,
1678,
9995,
13,
1678,
380,
353,
10567,
29898,
12181,
7607,
8516,
29892,
302,
29918,
2892,
29892,
29871,
29896,
511,
1024,
2433,
303,
23195,
29918,
2080,
1495,
13,
1678,
921,
353,
350,
905,
19077,
2133,
580,
29898,
303,
29897,
13,
13,
1678,
921,
353,
5974,
13398,
7541,
29898,
1168,
29894,
29896,
29928,
29898,
29876,
29918,
26705,
29892,
29871,
29941,
29892,
26229,
29922,
11236,
362,
29892,
7164,
2433,
17642,
742,
851,
2247,
29922,
29896,
29892,
8466,
29918,
11228,
3950,
2433,
354,
29918,
8945,
742,
29871,
13,
965,
8466,
29918,
15227,
3950,
29922,
29880,
29906,
29898,
29880,
29906,
29918,
1727,
8243,
1024,
2433,
20580,
29918,
29896,
1495,
29898,
29916,
29897,
13,
1678,
921,
353,
350,
905,
19077,
2133,
580,
29898,
29916,
29897,
13,
268,
13,
1678,
921,
353,
5974,
13398,
7541,
29898,
1168,
29894,
29896,
29928,
29898,
29906,
29930,
29876,
29918,
26705,
29892,
29871,
29941,
29892,
26229,
29922,
11236,
362,
29892,
7164,
2433,
17642,
742,
851,
2247,
29922,
29906,
29892,
8466,
29918,
11228,
3950,
2433,
354,
29918,
8945,
742,
29871,
13,
3986,
8466,
29918,
15227,
3950,
29922,
29880,
29906,
29898,
29880,
29906,
29918,
1727,
8243,
1024,
2433,
20580,
29918,
29906,
1495,
29898,
29916,
29897,
13,
1678,
921,
353,
350,
905,
19077,
2133,
580,
29898,
29916,
29897,
13,
13,
1678,
921,
353,
5974,
13398,
7541,
29898,
1168,
29894,
29896,
29928,
29898,
29946,
29930,
29876,
29918,
26705,
29892,
29871,
29941,
29892,
26229,
29922,
11236,
362,
29892,
7164,
2433,
17642,
742,
851,
2247,
29922,
29906,
29892,
8466,
29918,
11228,
3950,
2433,
354,
29918,
8945,
742,
29871,
13,
308,
8466,
29918,
15227,
3950,
29922,
29880,
29906,
29898,
29880,
29906,
29918,
1727,
8243,
1024,
2433,
20580,
29918,
29941,
1495,
29898,
29916,
29897,
13,
1678,
921,
353,
350,
905,
19077,
2133,
580,
29898,
29916,
29897,
13,
268,
13,
1678,
921,
353,
5974,
13398,
7541,
29898,
29943,
5066,
841,
3285,
1024,
2433,
1579,
8606,
1495,
29898,
29916,
29897,
13,
13,
1678,
396,
921,
29918,
1545,
14999,
353,
365,
1254,
29924,
29898,
29953,
29946,
5033,
29916,
29897,
13,
1678,
396,
1962,
29918,
1545,
14999,
353,
360,
1947,
29898,
29896,
29892,
1024,
2433,
1545,
14999,
1495,
29898,
29916,
29918,
1545,
14999,
29897,
13,
13,
1678,
396,
921,
29918,
2312,
353,
365,
1254,
29924,
29898,
29896,
29906,
29947,
29892,
736,
29918,
6831,
2063,
29922,
5574,
5033,
29916,
29897,
13,
1678,
921,
353,
350,
333,
8684,
284,
29898,
29931,
1254,
29924,
29898,
29896,
29906,
29947,
876,
29898,
29916,
29897,
13,
1678,
396,
921,
353,
360,
1947,
29898,
29896,
29906,
29947,
29892,
8466,
29918,
11228,
3950,
2433,
354,
29918,
8945,
1495,
29898,
29916,
29897,
13,
1678,
1962,
29918,
2312,
353,
360,
1947,
29898,
29945,
29892,
1024,
2433,
2312,
1495,
29898,
29916,
29897,
13,
13,
1678,
396,
921,
29918,
3571,
353,
365,
1254,
29924,
29898,
29896,
29906,
29947,
5033,
29916,
29897,
13,
1678,
396,
1962,
29918,
3571,
353,
360,
1947,
29898,
29896,
29906,
29896,
29892,
1024,
2433,
3571,
1495,
29898,
29916,
29918,
3571,
29897,
13,
13,
1678,
396,
921,
29918,
4283,
353,
365,
1254,
29924,
29898,
29896,
29906,
29947,
5033,
29916,
29897,
13,
1678,
396,
1962,
29918,
4283,
353,
360,
1947,
29898,
29896,
29906,
29896,
29892,
1024,
2433,
4283,
1495,
29898,
29916,
29918,
4283,
29897,
13,
13,
1678,
396,
736,
8125,
29898,
2080,
29879,
29922,
303,
23195,
29918,
2080,
29892,
14391,
11759,
4905,
29918,
1545,
14999,
29892,
1962,
29918,
2312,
29892,
1962,
29918,
3571,
29892,
1962,
29918,
4283,
2314,
13,
1678,
736,
8125,
29898,
2080,
29879,
29922,
303,
29892,
14391,
29922,
4905,
29918,
2312,
29897,
13,
2
] |
examples/basic_auth.py | hibellm/jira | 3 | 64616 | # This script shows how to connect to a JIRA instance with a
# username and password over HTTP BASIC authentication.
from collections import Counter
from jira import JIRA
# By default, the client will connect to a JIRA instance started from the Atlassian Plugin SDK.
# See
# https://developer.atlassian.com/display/DOCS/Installing+the+Atlassian+Plugin+SDK
# for details.
jira = JIRA(basic_auth=('admin', 'admin')) # a username/password tuple
# Get the mutable application properties for this server (requires
# jira-system-administrators permission)
props = jira.application_properties()
# Find all issues reported by the admin
issues = jira.search_issues('assignee=admin')
# Find the top three projects containing issues reported by admin
top_three = Counter(
[issue.fields.project.key for issue in issues]).most_common(3)
| [
1,
396,
910,
2471,
3697,
920,
304,
4511,
304,
263,
435,
29902,
4717,
2777,
411,
263,
13,
29937,
8952,
322,
4800,
975,
7331,
350,
3289,
2965,
10760,
29889,
13,
13,
3166,
16250,
1053,
315,
5336,
13,
3166,
432,
3055,
1053,
435,
29902,
4717,
13,
13,
29937,
2648,
2322,
29892,
278,
3132,
674,
4511,
304,
263,
435,
29902,
4717,
2777,
4687,
515,
278,
2180,
605,
713,
1858,
3851,
12967,
29889,
13,
29937,
2823,
13,
29937,
2045,
597,
6734,
29889,
271,
605,
713,
29889,
510,
29914,
4990,
29914,
3970,
9295,
29914,
23271,
292,
29974,
1552,
29974,
4178,
605,
713,
29974,
16288,
29974,
26912,
13,
29937,
363,
4902,
29889,
13,
2397,
336,
353,
435,
29902,
4717,
29898,
16121,
29918,
5150,
29922,
877,
6406,
742,
525,
6406,
8785,
1678,
396,
263,
8952,
29914,
5630,
18761,
13,
13,
29937,
3617,
278,
26691,
2280,
4426,
363,
445,
1923,
313,
276,
339,
2658,
13,
29937,
432,
3055,
29899,
5205,
29899,
6406,
2132,
4097,
10751,
29897,
13,
11030,
353,
432,
3055,
29889,
6214,
29918,
11330,
580,
13,
13,
29937,
10987,
599,
5626,
8967,
491,
278,
4113,
13,
12175,
353,
432,
3055,
29889,
4478,
29918,
12175,
877,
465,
4895,
29872,
29922,
6406,
1495,
13,
13,
29937,
10987,
278,
2246,
2211,
9279,
6943,
5626,
8967,
491,
4113,
13,
3332,
29918,
17536,
353,
315,
5336,
29898,
13,
1678,
518,
15118,
29889,
9621,
29889,
4836,
29889,
1989,
363,
2228,
297,
5626,
14664,
3242,
29918,
9435,
29898,
29941,
29897,
13,
2
] |
examples/maml_toy.py | Brikwerk/learn2learn | 1,774 | 77655 | #!/usr/bin/env python3
"""
This script demonstrates how to use the MAML implementation of L2L.
Each task i consists of learning the parameters of a Normal distribution N(mu_i, sigma_i).
The parameters mu_i, sigma_i are themselves sampled from a distribution N(mu, sigma).
"""
import torch as th
from torch import nn, optim, distributions as dist
import learn2learn as l2l
DIM = 5
TIMESTEPS = 1000
TASKS_PER_STEP = 50
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.mu = nn.Parameter(th.randn(DIM))
self.sigma = nn.Parameter(th.randn(DIM))
def forward(self, x=None):
return dist.Normal(self.mu, self.sigma)
def main():
task_dist = dist.Normal(th.zeros(2 * DIM), th.ones(2 * DIM))
model = Model()
maml = l2l.algorithms.MAML(model, lr=1e-2)
opt = optim.Adam(maml.parameters())
for i in range(TIMESTEPS):
step_loss = 0.0
for t in range(TASKS_PER_STEP):
# Sample a task
task_params = task_dist.sample()
mu_i, sigma_i = task_params[:DIM], task_params[DIM:]
# Adaptation: Instanciate a copy of model
learner = maml.clone()
proposal = learner()
# Adaptation: Compute and adapt to task loss
loss = (mu_i - proposal.mean).pow(2).sum() + (sigma_i - proposal.variance).pow(2).sum()
learner.adapt(loss)
# Adaptation: Evaluate the effectiveness of adaptation
adapt_loss = (mu_i - proposal.mean).pow(2).sum() + (sigma_i - proposal.variance).pow(2).sum()
# Accumulate the error over all tasks
step_loss += adapt_loss
# Meta-learning step: compute gradient through the adaptation step, automatically.
step_loss = step_loss / TASKS_PER_STEP
print(i, step_loss.item())
opt.zero_grad()
step_loss.backward()
opt.step()
if __name__ == '__main__':
main()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
15945,
29908,
13,
4013,
2471,
9004,
1078,
920,
304,
671,
278,
14861,
1988,
5314,
310,
365,
29906,
29931,
29889,
13,
13,
9760,
3414,
474,
11624,
310,
6509,
278,
4128,
310,
263,
21981,
4978,
405,
29898,
2589,
29918,
29875,
29892,
269,
2934,
29918,
29875,
467,
13,
1576,
4128,
3887,
29918,
29875,
29892,
269,
2934,
29918,
29875,
526,
6053,
4559,
29881,
515,
263,
4978,
405,
29898,
2589,
29892,
269,
2934,
467,
13,
15945,
29908,
13,
13,
5215,
4842,
305,
408,
266,
13,
3166,
4842,
305,
1053,
302,
29876,
29892,
5994,
29892,
18822,
408,
1320,
13,
13,
5215,
5110,
29906,
19668,
408,
301,
29906,
29880,
13,
13,
4571,
29924,
353,
29871,
29945,
13,
15307,
1254,
29923,
7024,
353,
29871,
29896,
29900,
29900,
29900,
13,
29911,
3289,
17557,
29918,
13171,
29918,
1254,
15488,
353,
29871,
29945,
29900,
13,
13,
13,
1990,
8125,
29898,
15755,
29889,
7355,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
29898,
3195,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
2589,
353,
302,
29876,
29889,
9329,
29898,
386,
29889,
9502,
29876,
29898,
4571,
29924,
876,
13,
4706,
1583,
29889,
3754,
353,
302,
29876,
29889,
9329,
29898,
386,
29889,
9502,
29876,
29898,
4571,
29924,
876,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
29922,
8516,
1125,
13,
4706,
736,
1320,
29889,
19077,
29898,
1311,
29889,
2589,
29892,
1583,
29889,
3754,
29897,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
3414,
29918,
5721,
353,
1320,
29889,
19077,
29898,
386,
29889,
3298,
359,
29898,
29906,
334,
360,
7833,
511,
266,
29889,
2873,
29898,
29906,
334,
360,
7833,
876,
13,
1678,
1904,
353,
8125,
580,
13,
1678,
286,
8807,
353,
301,
29906,
29880,
29889,
9564,
12404,
29889,
1529,
1988,
29898,
4299,
29892,
301,
29878,
29922,
29896,
29872,
29899,
29906,
29897,
13,
1678,
3523,
353,
5994,
29889,
3253,
314,
29898,
29885,
8807,
29889,
16744,
3101,
13,
13,
1678,
363,
474,
297,
3464,
29898,
15307,
1254,
29923,
7024,
1125,
13,
4706,
4331,
29918,
6758,
353,
29871,
29900,
29889,
29900,
13,
4706,
363,
260,
297,
3464,
29898,
29911,
3289,
17557,
29918,
13171,
29918,
1254,
15488,
1125,
13,
9651,
396,
21029,
263,
3414,
13,
9651,
3414,
29918,
7529,
353,
3414,
29918,
5721,
29889,
11249,
580,
13,
9651,
3887,
29918,
29875,
29892,
269,
2934,
29918,
29875,
353,
3414,
29918,
7529,
7503,
4571,
29924,
1402,
3414,
29918,
7529,
29961,
4571,
29924,
17531,
13,
13,
9651,
396,
23255,
415,
362,
29901,
2799,
8463,
403,
263,
3509,
310,
1904,
13,
9651,
24298,
1089,
353,
286,
8807,
29889,
16513,
580,
13,
9651,
24963,
353,
24298,
1089,
580,
13,
13,
9651,
396,
23255,
415,
362,
29901,
11796,
29872,
322,
7744,
304,
3414,
6410,
13,
9651,
6410,
353,
313,
2589,
29918,
29875,
448,
24963,
29889,
12676,
467,
12248,
29898,
29906,
467,
2083,
580,
718,
313,
3754,
29918,
29875,
448,
24963,
29889,
1707,
8837,
467,
12248,
29898,
29906,
467,
2083,
580,
13,
9651,
24298,
1089,
29889,
1114,
415,
29898,
6758,
29897,
13,
13,
9651,
396,
23255,
415,
362,
29901,
382,
4387,
403,
278,
2779,
20193,
310,
28206,
13,
9651,
7744,
29918,
6758,
353,
313,
2589,
29918,
29875,
448,
24963,
29889,
12676,
467,
12248,
29898,
29906,
467,
2083,
580,
718,
313,
3754,
29918,
29875,
448,
24963,
29889,
1707,
8837,
467,
12248,
29898,
29906,
467,
2083,
580,
13,
13,
9651,
396,
4831,
398,
5987,
278,
1059,
975,
599,
9595,
13,
9651,
4331,
29918,
6758,
4619,
7744,
29918,
6758,
13,
13,
4706,
396,
20553,
29899,
21891,
4331,
29901,
10272,
16030,
1549,
278,
28206,
4331,
29892,
6336,
29889,
13,
4706,
4331,
29918,
6758,
353,
4331,
29918,
6758,
847,
323,
3289,
17557,
29918,
13171,
29918,
1254,
15488,
13,
4706,
1596,
29898,
29875,
29892,
4331,
29918,
6758,
29889,
667,
3101,
13,
4706,
3523,
29889,
9171,
29918,
5105,
580,
13,
4706,
4331,
29918,
6758,
29889,
1627,
1328,
580,
13,
4706,
3523,
29889,
10568,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
examples/hello.py | ridgek/iscli | 0 | 147985 | <gh_stars>0
from iscli.cli import CommandSet, Cli
hello = CommandSet()
@hello.install('hello world')
def cmd_hello_world(cli, args):
print 'Hello World!'
if __name__ == '__main__':
cli = Cli('> ')
cli.load(hello)
cli.commandloop()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
338,
11303,
29889,
11303,
1053,
10516,
2697,
29892,
315,
492,
13,
13,
13,
12199,
353,
10516,
2697,
580,
13,
13,
13,
29992,
12199,
29889,
6252,
877,
12199,
3186,
1495,
13,
1753,
9920,
29918,
12199,
29918,
11526,
29898,
11303,
29892,
6389,
1125,
13,
1678,
1596,
525,
10994,
2787,
20714,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
9335,
353,
315,
492,
877,
29958,
25710,
13,
1678,
9335,
29889,
1359,
29898,
12199,
29897,
13,
1678,
9335,
29889,
6519,
7888,
580,
13,
2
] |
updaters/updater.py | tatsukawa/GAN_arbitrary_viewpoint | 0 | 150270 | # -*- coding: utf-8 -*-
# !/usr/bin/env python
from __future__ import print_function
import chainer
import chainer.functions as F
from chainer import Variable
import numpy as np
import cupy as cp
def loss_dcgan_dis(dis_fake, dis_real):
L1 = F.mean(F.softplus(-dis_real))
L2 = F.mean(F.softplus(dis_fake))
loss = L1 + L2
return loss
def loss_dcgan_gen(dis_fake):
loss = F.mean(F.softplus(-dis_fake))
return loss
def loss_hinge_dis(dis_fake, dis_real):
loss = F.mean(F.relu(1. - dis_real))
loss += F.mean(F.relu(1. + dis_fake))
return loss
def loss_hinge_gen(dis_fake):
loss = -F.mean(dis_fake)
return loss
def loss_mse_gen(x_gen, x_real):
loss = F.mean_squared_error(x_gen, x_real)
return loss
class Updater(chainer.training.StandardUpdater):
def __init__(self, *args, **kwargs):
self.gen, self.dis = kwargs.pop('models')
self.img_size = kwargs.pop('img_size')
self.loss_type = kwargs.pop('loss_type')
self.dim_noise = kwargs.pop('dim_noise')
self.dif_index = kwargs.pop('dif_index')
self.n_dis = kwargs.pop('n_dis')
self.dataset = kwargs.pop('dataset')
if self.loss_type == 'dcgan':
self.loss_gen = loss_dcgan_gen
self.loss_dis = loss_dcgan_dis
elif self.loss_type == 'hinge':
self.loss_gen = loss_hinge_gen
self.loss_dis = loss_hinge_dis
elif self.loss_type == 'mse':
self.loss_gen = loss_mse_gen
if self.dataset == 'mnist':
from datasets.mnist.loader import get_ref_and_real_data
self.get_data = get_ref_and_real_data
elif self.dataset == 'coil20':
from datasets.coil20.loader import get_ref_and_real_data
self.get_data = get_ref_and_real_data
elif self.dataset == 'coil100':
from datasets.coil100.loader import get_ref_and_real_data
self.get_data = get_ref_and_real_data
else:
print('please select dataset')
exit(1)
super(Updater, self).__init__(*args, **kwargs)
def get_batch(self):
batch = self.get_iterator('main').next()
batch_size = len(batch)
if self.dataset == 'mnist':
ref_images, rot_images, eps = self.get_data(
batch,
0.4,
20
)
elif self.dataset == 'coil20':
ref_images, rot_images, eps = self.get_data(
batch,
img_size=self.img_size,
dim_noise=self.dim_noise,
dif_index=self.dif_index
)
elif self.dataset == 'coil100':
ref_images, rot_images, eps = self.get_data(
batch,
img_size=self.img_size,
dim_noise=self.dim_noise,
dif_index=self.dif_index
)
else:
exit(0)
x_real = Variable(self.converter(rot_images, self.device))
x_ref = Variable(self.converter(ref_images, self.device))
eps = Variable(self.converter(eps, self.device))
x_real = Variable(x_real.data.astype(np.float32)) / 255.
x_ref= Variable(x_ref.data.astype(np.float32)) / 255.
eps = Variable(eps.data.astype(np.float32))
return x_ref, x_real, eps
def calc_acc(self, dis_out, label=0, plot_name='acc'):
prob = F.sigmoid(dis_out)
label = cp.array([[label] for i in range(len(dis_out))])
label = Variable(self.converter(label, self.device))
label = Variable(label.data.astype(int))
acc_real = F.binary_accuracy(prob - 0.5, label)
chainer.report({plot_name: acc_real}, self.dis)
def update_core(self):
gen_optimizer = self.get_optimizer('gen')
dis_optimizer = self.get_optimizer('dis')
gen, dis = self.gen, self.dis
if self.loss_type == 'mse':
x_ref, x_real, eps = self.get_batch()
H, W = x_ref.shape[2], x_ref.shape[3]
_z = F.broadcast_to(
F.reshape(eps, (eps.shape[0], eps.shape[1], 1, 1)),
(eps.shape[0], eps.shape[1], H, W)
)
x_gen = gen(x=x_ref, z=eps)
loss_gen = self.loss_gen(x_gen, x_real)
gen.cleargrads()
loss_gen.backward()
gen_optimizer.update()
chainer.report({'loss': loss_gen}, gen)
else:
for i in range(self.n_dis):
x_ref, x_real, eps = self.get_batch()
H, W = x_ref.shape[2], x_ref.shape[3]
_z = F.broadcast_to(
F.reshape(eps, (eps.shape[0], eps.shape[1], 1, 1)),
(eps.shape[0], eps.shape[1], H, W)
)
if i == 0:
x_gen = gen(x=x_ref, z=eps)
dis_fake = dis(x_gen, x_ref, eps)
loss_gen = self.loss_gen(dis_fake=dis_fake)
gen.cleargrads()
loss_gen.backward()
gen_optimizer.update()
chainer.report({'loss': loss_gen}, gen)
dis_real= dis(x_real, x_ref, eps)
self.calc_acc(dis_real, label=1, plot_name='acc_real')
x_gen = gen(x=x_ref, z=eps)
dis_fake = dis(x_gen, x_ref, eps)
self.calc_acc(dis_fake, label=0, plot_name='acc_fake')
x_gen.unchain_backward()
loss_dis = self.loss_dis(dis_fake=dis_fake, dis_real=dis_real)
dis.cleargrads()
loss_dis.backward()
dis_optimizer.update()
chainer.report({'loss': loss_dis}, dis)
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
1738,
29914,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
5215,
521,
4008,
13,
5215,
521,
4008,
29889,
12171,
408,
383,
13,
3166,
521,
4008,
1053,
28736,
13,
5215,
12655,
408,
7442,
13,
5215,
18002,
29891,
408,
21447,
13,
13,
1753,
6410,
29918,
13891,
6249,
29918,
2218,
29898,
2218,
29918,
29888,
1296,
29892,
766,
29918,
6370,
1125,
13,
1678,
365,
29896,
353,
383,
29889,
12676,
29898,
29943,
29889,
2695,
11242,
6278,
2218,
29918,
6370,
876,
13,
1678,
365,
29906,
353,
383,
29889,
12676,
29898,
29943,
29889,
2695,
11242,
29898,
2218,
29918,
29888,
1296,
876,
13,
1678,
6410,
353,
365,
29896,
718,
365,
29906,
13,
1678,
736,
6410,
13,
13,
1753,
6410,
29918,
13891,
6249,
29918,
1885,
29898,
2218,
29918,
29888,
1296,
1125,
13,
1678,
6410,
353,
383,
29889,
12676,
29898,
29943,
29889,
2695,
11242,
6278,
2218,
29918,
29888,
1296,
876,
13,
1678,
736,
6410,
13,
13,
1753,
6410,
29918,
2790,
29872,
29918,
2218,
29898,
2218,
29918,
29888,
1296,
29892,
766,
29918,
6370,
1125,
13,
1678,
6410,
353,
383,
29889,
12676,
29898,
29943,
29889,
2674,
29884,
29898,
29896,
29889,
448,
766,
29918,
6370,
876,
13,
1678,
6410,
4619,
383,
29889,
12676,
29898,
29943,
29889,
2674,
29884,
29898,
29896,
29889,
718,
766,
29918,
29888,
1296,
876,
13,
1678,
736,
6410,
13,
13,
1753,
6410,
29918,
2790,
29872,
29918,
1885,
29898,
2218,
29918,
29888,
1296,
1125,
13,
1678,
6410,
353,
448,
29943,
29889,
12676,
29898,
2218,
29918,
29888,
1296,
29897,
13,
1678,
736,
6410,
13,
13,
1753,
6410,
29918,
29885,
344,
29918,
1885,
29898,
29916,
29918,
1885,
29892,
921,
29918,
6370,
1125,
13,
1678,
6410,
353,
383,
29889,
12676,
29918,
26613,
1965,
29918,
2704,
29898,
29916,
29918,
1885,
29892,
921,
29918,
6370,
29897,
13,
1678,
736,
6410,
13,
13,
13,
1990,
5020,
29881,
1008,
29898,
305,
4008,
29889,
26495,
29889,
15449,
3373,
29881,
1008,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
1583,
29889,
1885,
29892,
1583,
29889,
2218,
353,
9049,
5085,
29889,
7323,
877,
9794,
1495,
13,
4706,
1583,
29889,
2492,
29918,
2311,
353,
9049,
5085,
29889,
7323,
877,
2492,
29918,
2311,
1495,
13,
4706,
1583,
29889,
6758,
29918,
1853,
353,
9049,
5085,
29889,
7323,
877,
6758,
29918,
1853,
1495,
13,
4706,
1583,
29889,
6229,
29918,
1217,
895,
353,
9049,
5085,
29889,
7323,
877,
6229,
29918,
1217,
895,
1495,
13,
4706,
1583,
29889,
29881,
361,
29918,
2248,
353,
9049,
5085,
29889,
7323,
877,
29881,
361,
29918,
2248,
1495,
13,
4706,
1583,
29889,
29876,
29918,
2218,
353,
9049,
5085,
29889,
7323,
877,
29876,
29918,
2218,
1495,
13,
4706,
1583,
29889,
24713,
353,
9049,
5085,
29889,
7323,
877,
24713,
1495,
13,
13,
4706,
565,
1583,
29889,
6758,
29918,
1853,
1275,
525,
13891,
6249,
2396,
13,
9651,
1583,
29889,
6758,
29918,
1885,
353,
6410,
29918,
13891,
6249,
29918,
1885,
13,
9651,
1583,
29889,
6758,
29918,
2218,
353,
6410,
29918,
13891,
6249,
29918,
2218,
13,
4706,
25342,
1583,
29889,
6758,
29918,
1853,
1275,
525,
2790,
29872,
2396,
13,
9651,
1583,
29889,
6758,
29918,
1885,
353,
6410,
29918,
2790,
29872,
29918,
1885,
13,
9651,
1583,
29889,
6758,
29918,
2218,
353,
6410,
29918,
2790,
29872,
29918,
2218,
13,
4706,
25342,
1583,
29889,
6758,
29918,
1853,
1275,
525,
29885,
344,
2396,
13,
9651,
1583,
29889,
6758,
29918,
1885,
353,
6410,
29918,
29885,
344,
29918,
1885,
13,
13,
4706,
565,
1583,
29889,
24713,
1275,
525,
23521,
391,
2396,
13,
9651,
515,
20035,
29889,
23521,
391,
29889,
12657,
1053,
679,
29918,
999,
29918,
392,
29918,
6370,
29918,
1272,
13,
9651,
1583,
29889,
657,
29918,
1272,
353,
679,
29918,
999,
29918,
392,
29918,
6370,
29918,
1272,
13,
4706,
25342,
1583,
29889,
24713,
1275,
525,
1111,
309,
29906,
29900,
2396,
13,
9651,
515,
20035,
29889,
1111,
309,
29906,
29900,
29889,
12657,
1053,
679,
29918,
999,
29918,
392,
29918,
6370,
29918,
1272,
13,
9651,
1583,
29889,
657,
29918,
1272,
353,
679,
29918,
999,
29918,
392,
29918,
6370,
29918,
1272,
13,
4706,
25342,
1583,
29889,
24713,
1275,
525,
1111,
309,
29896,
29900,
29900,
2396,
13,
9651,
515,
20035,
29889,
1111,
309,
29896,
29900,
29900,
29889,
12657,
1053,
679,
29918,
999,
29918,
392,
29918,
6370,
29918,
1272,
13,
9651,
1583,
29889,
657,
29918,
1272,
353,
679,
29918,
999,
29918,
392,
29918,
6370,
29918,
1272,
13,
4706,
1683,
29901,
13,
9651,
1596,
877,
552,
559,
1831,
8783,
1495,
13,
9651,
6876,
29898,
29896,
29897,
13,
13,
4706,
2428,
29898,
3373,
29881,
1008,
29892,
1583,
467,
1649,
2344,
1649,
10456,
5085,
29892,
3579,
19290,
29897,
13,
13,
13,
1678,
822,
679,
29918,
16175,
29898,
1311,
1125,
13,
4706,
9853,
353,
1583,
29889,
657,
29918,
17609,
877,
3396,
2824,
4622,
580,
13,
4706,
9853,
29918,
2311,
353,
7431,
29898,
16175,
29897,
13,
13,
4706,
565,
1583,
29889,
24713,
1275,
525,
23521,
391,
2396,
13,
9651,
2143,
29918,
8346,
29892,
5731,
29918,
8346,
29892,
321,
567,
353,
1583,
29889,
657,
29918,
1272,
29898,
13,
18884,
9853,
29892,
13,
462,
29900,
29889,
29946,
29892,
13,
462,
29906,
29900,
13,
9651,
1723,
13,
4706,
25342,
1583,
29889,
24713,
1275,
525,
1111,
309,
29906,
29900,
2396,
13,
9651,
2143,
29918,
8346,
29892,
5731,
29918,
8346,
29892,
321,
567,
353,
1583,
29889,
657,
29918,
1272,
29898,
13,
18884,
9853,
29892,
13,
18884,
10153,
29918,
2311,
29922,
1311,
29889,
2492,
29918,
2311,
29892,
13,
18884,
3964,
29918,
1217,
895,
29922,
1311,
29889,
6229,
29918,
1217,
895,
29892,
13,
18884,
958,
29918,
2248,
29922,
1311,
29889,
29881,
361,
29918,
2248,
13,
9651,
1723,
13,
4706,
25342,
1583,
29889,
24713,
1275,
525,
1111,
309,
29896,
29900,
29900,
2396,
13,
632,
2143,
29918,
8346,
29892,
5731,
29918,
8346,
29892,
321,
567,
353,
1583,
29889,
657,
29918,
1272,
29898,
13,
18884,
9853,
29892,
13,
18884,
10153,
29918,
2311,
29922,
1311,
29889,
2492,
29918,
2311,
29892,
13,
18884,
3964,
29918,
1217,
895,
29922,
1311,
29889,
6229,
29918,
1217,
895,
29892,
13,
18884,
958,
29918,
2248,
29922,
1311,
29889,
29881,
361,
29918,
2248,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
6876,
29898,
29900,
29897,
13,
13,
4706,
921,
29918,
6370,
353,
28736,
29898,
1311,
29889,
535,
13549,
29898,
5450,
29918,
8346,
29892,
1583,
29889,
10141,
876,
13,
4706,
921,
29918,
999,
353,
28736,
29898,
1311,
29889,
535,
13549,
29898,
999,
29918,
8346,
29892,
1583,
29889,
10141,
876,
13,
4706,
321,
567,
353,
28736,
29898,
1311,
29889,
535,
13549,
29898,
8961,
29892,
1583,
29889,
10141,
876,
13,
13,
4706,
921,
29918,
6370,
353,
28736,
29898,
29916,
29918,
6370,
29889,
1272,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
876,
847,
29871,
29906,
29945,
29945,
29889,
13,
4706,
921,
29918,
999,
29922,
28736,
29898,
29916,
29918,
999,
29889,
1272,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
876,
847,
29871,
29906,
29945,
29945,
29889,
13,
4706,
321,
567,
353,
28736,
29898,
8961,
29889,
1272,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
876,
13,
13,
4706,
736,
921,
29918,
999,
29892,
921,
29918,
6370,
29892,
321,
567,
13,
13,
1678,
822,
22235,
29918,
5753,
29898,
1311,
29892,
766,
29918,
449,
29892,
3858,
29922,
29900,
29892,
6492,
29918,
978,
2433,
5753,
29374,
13,
4706,
2070,
353,
383,
29889,
18816,
29885,
3398,
29898,
2218,
29918,
449,
29897,
13,
13,
4706,
3858,
353,
21447,
29889,
2378,
4197,
29961,
1643,
29962,
363,
474,
297,
3464,
29898,
2435,
29898,
2218,
29918,
449,
876,
2314,
13,
4706,
3858,
353,
28736,
29898,
1311,
29889,
535,
13549,
29898,
1643,
29892,
1583,
29889,
10141,
876,
13,
4706,
3858,
353,
28736,
29898,
1643,
29889,
1272,
29889,
579,
668,
29898,
524,
876,
13,
4706,
1035,
29918,
6370,
353,
383,
29889,
19541,
29918,
562,
2764,
4135,
29898,
22795,
448,
29871,
29900,
29889,
29945,
29892,
3858,
29897,
13,
4706,
521,
4008,
29889,
12276,
3319,
5317,
29918,
978,
29901,
1035,
29918,
6370,
1118,
1583,
29889,
2218,
29897,
13,
13,
1678,
822,
2767,
29918,
3221,
29898,
1311,
1125,
13,
4706,
2531,
29918,
20640,
3950,
353,
1583,
29889,
657,
29918,
20640,
3950,
877,
1885,
1495,
13,
4706,
766,
29918,
20640,
3950,
353,
1583,
29889,
657,
29918,
20640,
3950,
877,
2218,
1495,
13,
4706,
2531,
29892,
766,
353,
1583,
29889,
1885,
29892,
1583,
29889,
2218,
13,
13,
4706,
565,
1583,
29889,
6758,
29918,
1853,
1275,
525,
29885,
344,
2396,
13,
632,
921,
29918,
999,
29892,
921,
29918,
6370,
29892,
321,
567,
353,
1583,
29889,
657,
29918,
16175,
580,
13,
632,
379,
29892,
399,
353,
921,
29918,
999,
29889,
12181,
29961,
29906,
1402,
921,
29918,
999,
29889,
12181,
29961,
29941,
29962,
13,
632,
903,
29920,
353,
383,
29889,
6729,
328,
4384,
29918,
517,
29898,
13,
18884,
383,
29889,
690,
14443,
29898,
8961,
29892,
313,
8961,
29889,
12181,
29961,
29900,
1402,
321,
567,
29889,
12181,
29961,
29896,
1402,
29871,
29896,
29892,
29871,
29896,
8243,
13,
18884,
313,
8961,
29889,
12181,
29961,
29900,
1402,
321,
567,
29889,
12181,
29961,
29896,
1402,
379,
29892,
399,
29897,
13,
632,
1723,
13,
13,
632,
921,
29918,
1885,
353,
2531,
29898,
29916,
29922,
29916,
29918,
999,
29892,
503,
29922,
8961,
29897,
13,
632,
6410,
29918,
1885,
353,
1583,
29889,
6758,
29918,
1885,
29898,
29916,
29918,
1885,
29892,
921,
29918,
6370,
29897,
13,
632,
2531,
29889,
8551,
5105,
29879,
580,
13,
632,
6410,
29918,
1885,
29889,
1627,
1328,
580,
13,
632,
2531,
29918,
20640,
3950,
29889,
5504,
580,
13,
632,
521,
4008,
29889,
12276,
3319,
29915,
6758,
2396,
6410,
29918,
1885,
1118,
2531,
29897,
13,
4706,
1683,
29901,
13,
9651,
363,
474,
297,
3464,
29898,
1311,
29889,
29876,
29918,
2218,
1125,
13,
18884,
921,
29918,
999,
29892,
921,
29918,
6370,
29892,
321,
567,
353,
1583,
29889,
657,
29918,
16175,
580,
13,
18884,
379,
29892,
399,
353,
921,
29918,
999,
29889,
12181,
29961,
29906,
1402,
921,
29918,
999,
29889,
12181,
29961,
29941,
29962,
13,
13,
18884,
903,
29920,
353,
383,
29889,
6729,
328,
4384,
29918,
517,
29898,
13,
462,
1678,
383,
29889,
690,
14443,
29898,
8961,
29892,
313,
8961,
29889,
12181,
29961,
29900,
1402,
321,
567,
29889,
12181,
29961,
29896,
1402,
29871,
29896,
29892,
29871,
29896,
8243,
13,
462,
1678,
313,
8961,
29889,
12181,
29961,
29900,
1402,
321,
567,
29889,
12181,
29961,
29896,
1402,
379,
29892,
399,
29897,
13,
18884,
1723,
13,
13,
18884,
565,
474,
1275,
29871,
29900,
29901,
13,
462,
1678,
921,
29918,
1885,
353,
2531,
29898,
29916,
29922,
29916,
29918,
999,
29892,
503,
29922,
8961,
29897,
13,
462,
1678,
766,
29918,
29888,
1296,
353,
766,
29898,
29916,
29918,
1885,
29892,
921,
29918,
999,
29892,
321,
567,
29897,
13,
462,
1678,
6410,
29918,
1885,
353,
1583,
29889,
6758,
29918,
1885,
29898,
2218,
29918,
29888,
1296,
29922,
2218,
29918,
29888,
1296,
29897,
13,
462,
1678,
2531,
29889,
8551,
5105,
29879,
580,
13,
462,
1678,
6410,
29918,
1885,
29889,
1627,
1328,
580,
13,
462,
1678,
2531,
29918,
20640,
3950,
29889,
5504,
580,
13,
462,
1678,
521,
4008,
29889,
12276,
3319,
29915,
6758,
2396,
6410,
29918,
1885,
1118,
2531,
29897,
13,
13,
18884,
766,
29918,
6370,
29922,
766,
29898,
29916,
29918,
6370,
29892,
921,
29918,
999,
29892,
321,
567,
29897,
13,
18884,
1583,
29889,
28667,
29918,
5753,
29898,
2218,
29918,
6370,
29892,
3858,
29922,
29896,
29892,
6492,
29918,
978,
2433,
5753,
29918,
6370,
1495,
13,
13,
18884,
921,
29918,
1885,
353,
2531,
29898,
29916,
29922,
29916,
29918,
999,
29892,
503,
29922,
8961,
29897,
13,
18884,
766,
29918,
29888,
1296,
353,
766,
29898,
29916,
29918,
1885,
29892,
921,
29918,
999,
29892,
321,
567,
29897,
13,
13,
18884,
1583,
29889,
28667,
29918,
5753,
29898,
2218,
29918,
29888,
1296,
29892,
3858,
29922,
29900,
29892,
6492,
29918,
978,
2433,
5753,
29918,
29888,
1296,
1495,
13,
18884,
921,
29918,
1885,
29889,
3322,
475,
29918,
1627,
1328,
580,
13,
13,
18884,
6410,
29918,
2218,
353,
1583,
29889,
6758,
29918,
2218,
29898,
2218,
29918,
29888,
1296,
29922,
2218,
29918,
29888,
1296,
29892,
766,
29918,
6370,
29922,
2218,
29918,
6370,
29897,
13,
18884,
766,
29889,
8551,
5105,
29879,
580,
13,
18884,
6410,
29918,
2218,
29889,
1627,
1328,
580,
13,
18884,
766,
29918,
20640,
3950,
29889,
5504,
580,
13,
18884,
521,
4008,
29889,
12276,
3319,
29915,
6758,
2396,
6410,
29918,
2218,
1118,
766,
29897,
13,
2
] |
test/IECore/TypedDataAsObject.py | bradleyhenke/cortex | 386 | 109226 | ##########################################################################
#
# Copyright (c) 2007, Image Engine Design Inc. 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 Image Engine Design nor the names of any
# other contributors to this software 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 unittest
import IECore
class TestTypedDataAsObject( unittest.TestCase ) :
def testSimpleCopy( self ) :
o = IECore.IntData( 1 )
self.assertEqual( o.value, 1 )
self.assertEqual( o, o )
o.value = 2
self.assertEqual( o.value, 2 )
oo = o.copy()
self.assertEqual( oo.value, 2 )
self.assertEqual( o, oo )
o.value = 3
self.assertEqual( o.value, 3 )
self.assertEqual( oo.value, 2 )
self.assertNotEqual( o, oo )
oo.value = 4
self.assertEqual( o.value, 3 )
self.assertEqual( oo.value, 4 )
self.assertNotEqual( o, oo )
def testCompoundCopy( self ) :
"""CompoundData must specialise the copyFrom() method
to ensure that a genuine deep copy of the data is produced.
This tests that."""
a = IECore.IntData( 2 )
self.assertEqual( a.value, 2 )
self.assertEqual( a, a )
c = IECore.CompoundData()
c["A"] = a
self.assertEqual( c["A"].value, 2 )
a.value = 3
self.assertEqual( a.value, 3 )
self.assertEqual( c["A"].value, 3 )
self.assertTrue( a.isSame( c["A"] ) )
cc = c.copy()
self.assertTrue( a.isSame( c["A"] ) )
self.assertTrue( not a.isSame( cc["A"] ) )
self.assertEqual( c, cc )
a.value = 10
self.assertEqual( a.value, 10 )
self.assertEqual( c["A"].value, 10 )
self.assertEqual( cc["A"].value, 3 )
self.assertNotEqual( c, cc )
cc["A"].value = 100
self.assertEqual( cc["A"].value, 100 )
self.assertEqual( c["A"].value, 10 )
self.assertEqual( a.value, 10 )
self.assertNotEqual( c, cc )
a.value = 100
self.assertEqual( c, cc )
if __name__ == "__main__":
unittest.main()
| [
1,
835,
13383,
13383,
13383,
13383,
4136,
2277,
29937,
13,
29937,
13,
29937,
29871,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29900,
29955,
29892,
7084,
10863,
12037,
9266,
29889,
2178,
10462,
21676,
29889,
13,
29937,
13,
29937,
29871,
4367,
391,
3224,
322,
671,
297,
2752,
322,
7581,
7190,
29892,
411,
470,
1728,
13,
29937,
29871,
21733,
29892,
526,
21905,
4944,
393,
278,
1494,
5855,
526,
13,
29937,
29871,
1539,
29901,
13,
29937,
13,
29937,
268,
334,
4367,
391,
3224,
29879,
310,
2752,
775,
1818,
11551,
278,
2038,
3509,
1266,
13,
29937,
539,
8369,
29892,
445,
1051,
310,
5855,
322,
278,
1494,
2313,
433,
4193,
29889,
13,
29937,
13,
29937,
268,
334,
4367,
391,
3224,
29879,
297,
7581,
883,
1818,
18532,
278,
2038,
3509,
1266,
13,
29937,
539,
8369,
29892,
445,
1051,
310,
5855,
322,
278,
1494,
2313,
433,
4193,
297,
278,
13,
29937,
539,
5106,
322,
29914,
272,
916,
17279,
4944,
411,
278,
4978,
29889,
13,
29937,
13,
29937,
268,
334,
2448,
2121,
278,
1024,
310,
7084,
10863,
12037,
3643,
278,
2983,
310,
738,
13,
29937,
539,
916,
17737,
29560,
304,
445,
7047,
1122,
367,
1304,
304,
1095,
272,
344,
470,
13,
29937,
539,
27391,
9316,
10723,
515,
445,
7047,
1728,
2702,
7536,
13,
29937,
539,
3971,
10751,
29889,
13,
29937,
13,
29937,
29871,
3446,
3235,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
6770,
6093,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
5300,
8707,
29911,
3960,
29933,
2692,
24125,
376,
3289,
13,
29937,
29871,
8519,
29908,
5300,
13764,
29979,
8528,
15094,
1799,
6323,
306,
3580,
5265,
3352,
399,
1718,
29934,
13566,
29059,
29892,
2672,
6154,
15789,
4214,
29892,
350,
2692,
6058,
27848,
3352,
7495,
29892,
13,
29937,
29871,
6093,
306,
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,
13,
29937,
29871,
349,
4574,
13152,
1660,
319,
1525,
28657,
13875,
8890,
29928,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
315,
4590,
29979,
22789,
3912,
438,
29956,
13865,
6323,
13,
29937,
29871,
8707,
29911,
3960,
29933,
2692,
24125,
20700,
17705,
6181,
15842,
13764,
29979,
22471,
26282,
29892,
2672,
4571,
26282,
29892,
2672,
29907,
1367,
3919,
1964,
29892,
317,
4162,
8426,
1964,
29892,
13,
29937,
29871,
8528,
29923,
3580,
29931,
19926,
29892,
6323,
8707,
1660,
13356,
3919,
25758,
21330,
1529,
1692,
29903,
313,
1177,
6154,
15789,
4214,
29892,
350,
2692,
6058,
27848,
3352,
7495,
29892,
13,
29937,
29871,
13756,
29907,
11499,
13780,
8079,
27092,
1254,
1806,
26027,
21947,
29949,
8452,
6323,
26996,
29963,
2965,
2890,
29936,
11247,
1799,
8079,
501,
1660,
29892,
360,
8254,
29892,
6323,
13,
29937,
29871,
13756,
29943,
1806,
29903,
29936,
6323,
350,
3308,
8895,
1799,
2672,
4945,
29934,
4897,
29911,
2725,
29897,
29832,
8851,
5348,
12766,
17171,
29928,
5300,
6732,
13764,
29979,
6093,
18929,
8079,
13,
29937,
29871,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
8707,
29911,
4717,
1783,
29892,
6850,
3960,
1783,
17705,
2882,
6227,
11937,
29892,
6323,
323,
8476,
313,
1177,
6154,
15789,
4214,
13,
29937,
29871,
405,
11787,
5265,
24647,
4741,
6323,
438,
29911,
4448,
22119,
1660,
29897,
9033,
3235,
4214,
2672,
13764,
29979,
399,
29909,
29979,
19474,
8079,
6093,
501,
1660,
8079,
3446,
3235,
13,
29937,
29871,
7791,
7818,
12982,
1525,
29892,
382,
29963,
1430,
10762,
11033,
18118,
1660,
29928,
8079,
6093,
21521,
1799,
8979,
6227,
11937,
8079,
20134,
3210,
21330,
1529,
1692,
29889,
13,
29937,
13,
13383,
13383,
13383,
13383,
7346,
2277,
13,
13,
5215,
443,
27958,
13,
5215,
7159,
9203,
13,
13,
1990,
4321,
24933,
287,
1469,
2887,
2061,
29898,
443,
27958,
29889,
3057,
8259,
1723,
584,
13,
13,
12,
1753,
1243,
15427,
11882,
29898,
1583,
1723,
584,
13,
13,
12,
12,
29877,
353,
7159,
9203,
29889,
2928,
1469,
29898,
29871,
29896,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29889,
1767,
29892,
29871,
29896,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29892,
288,
1723,
13,
12,
12,
29877,
29889,
1767,
353,
29871,
29906,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29889,
1767,
29892,
29871,
29906,
1723,
13,
13,
12,
12,
3634,
353,
288,
29889,
8552,
580,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29877,
29889,
1767,
29892,
29871,
29906,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29892,
288,
29877,
1723,
13,
13,
12,
12,
29877,
29889,
1767,
353,
29871,
29941,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29889,
1767,
29892,
29871,
29941,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29877,
29889,
1767,
29892,
29871,
29906,
1723,
13,
12,
12,
1311,
29889,
9294,
3664,
9843,
29898,
288,
29892,
288,
29877,
1723,
13,
13,
12,
12,
3634,
29889,
1767,
353,
29871,
29946,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29889,
1767,
29892,
29871,
29941,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
288,
29877,
29889,
1767,
29892,
29871,
29946,
1723,
13,
12,
12,
1311,
29889,
9294,
3664,
9843,
29898,
288,
29892,
288,
29877,
1723,
13,
13,
12,
1753,
1243,
6843,
618,
11882,
29898,
1583,
1723,
584,
13,
13,
12,
12,
15945,
29908,
6843,
618,
1469,
1818,
4266,
895,
278,
3509,
4591,
580,
1158,
13,
12,
12,
517,
9801,
393,
263,
29120,
457,
6483,
3509,
310,
278,
848,
338,
7371,
29889,
13,
12,
12,
4013,
6987,
393,
1213,
15945,
13,
13,
12,
12,
29874,
353,
7159,
9203,
29889,
2928,
1469,
29898,
29871,
29906,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
263,
29889,
1767,
29892,
29871,
29906,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
263,
29892,
263,
1723,
13,
13,
12,
12,
29883,
353,
7159,
9203,
29889,
6843,
618,
1469,
580,
13,
12,
12,
29883,
3366,
29909,
3108,
353,
263,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
274,
3366,
29909,
16862,
1767,
29892,
29871,
29906,
1723,
13,
13,
12,
12,
29874,
29889,
1767,
353,
29871,
29941,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
263,
29889,
1767,
29892,
29871,
29941,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
274,
3366,
29909,
16862,
1767,
29892,
29871,
29941,
1723,
13,
13,
12,
12,
1311,
29889,
9294,
5574,
29898,
263,
29889,
275,
29903,
420,
29898,
274,
3366,
29909,
3108,
1723,
1723,
13,
13,
12,
12,
617,
353,
274,
29889,
8552,
580,
13,
13,
12,
12,
1311,
29889,
9294,
5574,
29898,
263,
29889,
275,
29903,
420,
29898,
274,
3366,
29909,
3108,
1723,
1723,
13,
12,
12,
1311,
29889,
9294,
5574,
29898,
451,
263,
29889,
275,
29903,
420,
29898,
21759,
3366,
29909,
3108,
1723,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
274,
29892,
21759,
1723,
13,
13,
12,
12,
29874,
29889,
1767,
353,
29871,
29896,
29900,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
263,
29889,
1767,
29892,
29871,
29896,
29900,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
274,
3366,
29909,
16862,
1767,
29892,
29871,
29896,
29900,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
21759,
3366,
29909,
16862,
1767,
29892,
29871,
29941,
1723,
13,
12,
12,
1311,
29889,
9294,
3664,
9843,
29898,
274,
29892,
21759,
1723,
13,
13,
12,
12,
617,
3366,
29909,
16862,
1767,
353,
29871,
29896,
29900,
29900,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
21759,
3366,
29909,
16862,
1767,
29892,
29871,
29896,
29900,
29900,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
274,
3366,
29909,
16862,
1767,
29892,
29871,
29896,
29900,
1723,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
263,
29889,
1767,
29892,
29871,
29896,
29900,
1723,
13,
12,
12,
1311,
29889,
9294,
3664,
9843,
29898,
274,
29892,
21759,
1723,
13,
13,
12,
12,
29874,
29889,
1767,
353,
29871,
29896,
29900,
29900,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
274,
29892,
21759,
1723,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
lib/datatools/build_evaluate.py | JokerWDL/PyAnomaly | 1 | 181554 | from lib.datatools.evaluate.eval_function import eval_functions
class EvaluateAPI(object):
def __init__(self, cfg, logger):
self.cfg = cfg
self.logger = logger
def __call__(self, eval_function_type):
assert eval_function_type in eval_functions, f'there is no type of evaluation {eval_function_type}, please check {eval_functions.keys()}'
self.logger.info(f'==> Using the eval function: {eval_function_type}')
t = eval_functions[eval_function_type]
return t
| [
1,
515,
4303,
29889,
4130,
1219,
3775,
29889,
24219,
403,
29889,
14513,
29918,
2220,
1053,
19745,
29918,
12171,
30004,
13,
30004,
13,
1990,
382,
4387,
403,
8787,
29898,
3318,
1125,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
274,
16434,
29892,
17927,
1125,
30004,
13,
4706,
1583,
29889,
16859,
353,
274,
16434,
30004,
13,
4706,
1583,
29889,
21707,
353,
17927,
30004,
13,
1678,
6756,
13,
1678,
822,
4770,
4804,
12035,
1311,
29892,
19745,
29918,
2220,
29918,
1853,
1125,
30004,
13,
4706,
4974,
19745,
29918,
2220,
29918,
1853,
297,
19745,
29918,
12171,
29892,
285,
29915,
12711,
338,
694,
1134,
310,
17983,
426,
14513,
29918,
2220,
29918,
1853,
1118,
3113,
1423,
426,
14513,
29918,
12171,
29889,
8149,
580,
10162,
30004,
13,
4706,
1583,
29889,
21707,
29889,
3888,
29898,
29888,
29915,
1360,
29958,
5293,
278,
19745,
740,
29901,
426,
14513,
29918,
2220,
29918,
1853,
29913,
1495,
30004,
13,
4706,
260,
353,
19745,
29918,
12171,
29961,
14513,
29918,
2220,
29918,
1853,
29962,
30004,
13,
4706,
736,
260,
30004,
13,
30004,
13,
308,
2
] |
spInDP/SensorDataProvider.py | henkmollema/spInDP | 0 | 133917 | import math
import threading
import time
import smbus
import Adafruit_ADS1x15
class SensorDataProvider(object):
"""Provides data from sensors attached to the spider."""
_bus = None
_adc = None
# Choose a gain of 1 for reading voltages from 0 to 4.09V.
# Or pick a different gain to change the range of voltages that are read:
# - 2/3 = +/-6.144V
# - 1 = +/-4.096V
# - 2 = +/-2.048V
# - 4 = +/-1.024V
# - 8 = +/-0.512V
# - 16 = +/-0.256V
# See table 3 in the ADS1015/ADS1115 datasheet for more info on gain.
GAIN = 1
# Power management registers
POWER_MGMT_1 = 0x6b
# POWER_MGMT_2 = 0x6c
BUS_ADDRESS = 0x68 # This is the address value read via the i2cdetect command
"""
x / 16384 = x * 0.00006103515 to scale the accelerometer values from -1 to 1
"""
ACL_SCALE = 0.00006103515
"""
x / 131 = x * 0.00763358778 to scale gyro values to deg/second
"""
GYRO_SCALE = 0.00763358778
"""Used for averaging"""
_windowSize = 10 # Number of readings to average over
_accelWindow = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0],
[0, 0, 0]]
_cAccelIndex = 0
_measureInterval = 0.1 # increase this if reading fails
_shouldMeasure = False
_smoothAccelX = 0.0
_smoothAccelY = 0.0
_smoothAccelZ = 0.0
_lastUpdate = 0.0
def __init__(self):
"""Initializes the SensorDataProvider."""
print ("Init sensordataprovider")
# Now wake the 6050 up as it starts in sleep mode
try:
self._bus = smbus.SMBus(1)
self._bus.write_byte_data(SensorDataProvider.BUS_ADDRESS, SensorDataProvider.POWER_MGMT_1, 0)
except BaseException as ex:
print("Waking up gyro sensor failed: " + str(ex))
# Create ADS1015 ADC (12-bit) instance.
try:
self._adc = Adafruit_ADS1x15.ADS1015()
except BaseException as ex:
print("Initializing ADC failed: " + str(ex))
def stopMeasuring(self):
"""Stop measuring the sensors."""
self._shouldMeasure = False
def startMeasuring(self):
"""Starts measuring the sensors."""
if (not self._shouldMeasure):
self._shouldMeasure = True
self._lastUpdate = time.time()
t = threading.Thread(target=self._measureCycle)
t.start()
def _measureCycle(self):
"""The measure loop."""
while (self._shouldMeasure):
accelVal = self.getAccelerometer()
gyroVal = self.getGyro()
yDeg = self._getXRotation(accelVal[0], accelVal[1], accelVal[2])
gyroY = float(gyroVal[0])
# print "yDeg: " + str(yDeg)
"""
Complementary filter, we take gyroBias(0.98) parts from the gyro data and multiply it by delta T in seconds
and accelBias(0.02) parts from accelerometer data to compensate for drift
"""
deltaT = float(time.time() - self._lastUpdate)
if (abs(gyroY * deltaT) < 0.05):
gyroY = 0
self._smoothAccelY = float(0.7 * float(self._smoothAccelY + gyroY * deltaT) - 0.3 * yDeg)
# self.smoothAccelY = float(self.smoothAccelY + gyroY*deltaT)
# self.smoothAccelY = float(self.smoothAccelY + gyroY*deltaT)
print ("gyroY: " + str(self._smoothAccelY) + " delta: " + str(yDeg))
self._lastUpdate = time.time()
time.sleep(0.0032) # Update at 30hz
def readADC(self):
"""Start reading ADC values"""
'''
print('Reading ADS1x15 values, press Ctrl-C to quit...')
# Print nice channel column headers.
print('| {0:>6} | {1:>6} | {2:>6} | {3:>6} |'.format(*range(4)))
print('-' * 37)
# Main loop.
while (self._shouldMeasure):
# Read all the ADC channel values in a list.
values = [0]*4
for i in range(4):
values[i] = adc.read_adc(i, gain=GAIN)
# Print the ADC values.
print('| {0:>6} | {1:>6} | {2:>6} | {3:>6} |'.format(*values))
# Pause for half a second.
time.sleep(0.5)
'''
lightSensorR = self._adc.read_adc(2, gain=SensorDataProvider.GAIN)
lightSensorL = self._adc.read_adc(3, gain=SensorDataProvider.GAIN)
return lightSensorR, lightSensorL
def getSmoothAccelerometer(self):
"""Gets the smoothed accelerometer value."""
return self._smoothAccelX, self._smoothAccelY, self._smoothAccelZ
def getGyro(self):
"""Gets the raw gyro sensor values."""
gyro_xout = float(self._readWord2c(0x43))
gyro_yout = float(self._readWord2c(0x45))
gyro_zout = float(self._readWord2c(0x47))
return (gyro_xout *
SensorDataProvider.GYRO_SCALE, gyro_yout *
SensorDataProvider.GYRO_SCALE, gyro_zout *
SensorDataProvider.GYRO_SCALE)
def getAccelerometer(self):
"""Gets the raw accelerometer sensor values."""
accel_xout = float(self._readWord2c(0x3b))
accel_yout = float(self._readWord2c(0x3d))
accel_zout = float(self._readWord2c(0x3f))
return accel_xout * \
SensorDataProvider.ACL_SCALE, accel_yout * \
SensorDataProvider.ACL_SCALE, accel_zout * \
SensorDataProvider.ACL_SCALE
def _readByte(self, adr):
"""Reads a byte from the sensor bus."""
return self._bus.read_byte_data(SensorDataProvider.BUS_ADDRESS, adr)
def _readWord(self, adr):
"""Reads a word from the sensor bus."""
high = self._bus.read_byte_data(SensorDataProvider.BUS_ADDRESS, adr)
low = self._bus.read_byte_data(SensorDataProvider.BUS_ADDRESS, adr + 1)
val = (high << 8) + low
return val
def _readWord2c(self, adr):
"""Reads a word from the sensor bus."""
val = self._readWord(adr)
if (val >= 0x8000):
return -((65535 - val) + 1)
else:
return val
def _dist(self, a, b):
"""Calculates the length between two points on a triangle."""
return math.sqrt((a * a) + (b * b))
def _getYRotation(self, x, y, z):
"""Gets the Y rotation of the specified X, Y and Z."""
radians = math.atan2(x, self._dist(y, z))
return -math.degrees(radians)
def _getXRotation(self, x, y, z):
"""Gets the X rotation of the specified X, Y and Z."""
radians = math.atan2(y, self._dist(x, z))
return math.degrees(radians)
| [
1,
1053,
5844,
13,
5215,
3244,
292,
13,
5215,
931,
13,
13,
5215,
1560,
8262,
13,
5215,
23255,
29888,
9216,
29918,
3035,
29903,
29896,
29916,
29896,
29945,
13,
13,
13,
1990,
317,
6073,
1469,
6980,
29898,
3318,
1125,
13,
1678,
9995,
1184,
29894,
2247,
848,
515,
4771,
943,
10959,
304,
278,
805,
1241,
1213,
15945,
13,
13,
1678,
903,
8262,
353,
6213,
13,
1678,
903,
328,
29883,
353,
6213,
13,
13,
1678,
396,
14542,
852,
263,
11581,
310,
29871,
29896,
363,
5183,
5583,
1179,
515,
29871,
29900,
304,
29871,
29946,
29889,
29900,
29929,
29963,
29889,
13,
1678,
396,
1394,
5839,
263,
1422,
11581,
304,
1735,
278,
3464,
310,
5583,
1179,
393,
526,
1303,
29901,
13,
1678,
396,
29871,
448,
29871,
29906,
29914,
29941,
353,
718,
24028,
29953,
29889,
29896,
29946,
29946,
29963,
13,
1678,
396,
29871,
448,
1678,
29896,
353,
718,
24028,
29946,
29889,
29900,
29929,
29953,
29963,
13,
1678,
396,
29871,
448,
1678,
29906,
353,
718,
24028,
29906,
29889,
29900,
29946,
29947,
29963,
13,
1678,
396,
29871,
448,
1678,
29946,
353,
718,
24028,
29896,
29889,
29900,
29906,
29946,
29963,
13,
1678,
396,
29871,
448,
1678,
29947,
353,
718,
24028,
29900,
29889,
29945,
29896,
29906,
29963,
13,
1678,
396,
29871,
448,
259,
29896,
29953,
353,
718,
24028,
29900,
29889,
29906,
29945,
29953,
29963,
13,
1678,
396,
2823,
1591,
29871,
29941,
297,
278,
319,
8452,
29896,
29900,
29896,
29945,
29914,
3035,
29903,
29896,
29896,
29896,
29945,
6155,
4155,
363,
901,
5235,
373,
11581,
29889,
13,
1678,
402,
29909,
1177,
353,
29871,
29896,
13,
13,
1678,
396,
9206,
10643,
28975,
13,
1678,
349,
9806,
1001,
29918,
29924,
29954,
11490,
29918,
29896,
353,
29871,
29900,
29916,
29953,
29890,
13,
1678,
396,
349,
9806,
1001,
29918,
29924,
29954,
11490,
29918,
29906,
353,
29871,
29900,
29916,
29953,
29883,
13,
13,
1678,
350,
3308,
29918,
17744,
26785,
353,
29871,
29900,
29916,
29953,
29947,
29871,
396,
910,
338,
278,
3211,
995,
1303,
3025,
278,
474,
29906,
2252,
300,
522,
1899,
13,
13,
1678,
9995,
13,
1678,
921,
847,
29871,
29896,
29953,
29941,
29947,
29946,
353,
921,
334,
29871,
29900,
29889,
29900,
29900,
29900,
29900,
29953,
29896,
29900,
29941,
29945,
29896,
29945,
304,
6287,
278,
15592,
8328,
1819,
515,
448,
29896,
304,
29871,
29896,
13,
1678,
9995,
13,
1678,
319,
6154,
29918,
29903,
5454,
1307,
353,
29871,
29900,
29889,
29900,
29900,
29900,
29900,
29953,
29896,
29900,
29941,
29945,
29896,
29945,
13,
13,
1678,
9995,
13,
1678,
921,
847,
29871,
29896,
29941,
29896,
353,
921,
334,
29871,
29900,
29889,
29900,
29900,
29955,
29953,
29941,
29941,
29945,
29947,
29955,
29955,
29947,
304,
6287,
10966,
307,
1819,
304,
3587,
29914,
7496,
13,
1678,
9995,
13,
1678,
402,
29979,
1672,
29918,
29903,
5454,
1307,
353,
29871,
29900,
29889,
29900,
29900,
29955,
29953,
29941,
29941,
29945,
29947,
29955,
29955,
29947,
13,
13,
1678,
9995,
29965,
8485,
363,
4759,
6751,
15945,
29908,
13,
1678,
903,
7165,
3505,
353,
29871,
29896,
29900,
29871,
396,
9681,
310,
1303,
886,
304,
6588,
975,
13,
1678,
903,
562,
2242,
5907,
353,
5519,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
13,
462,
1678,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
5262,
13,
1678,
903,
29883,
7504,
295,
3220,
353,
29871,
29900,
13,
13,
1678,
903,
26658,
12506,
353,
29871,
29900,
29889,
29896,
29871,
396,
7910,
445,
565,
5183,
8465,
13,
1678,
903,
9344,
6816,
3745,
353,
7700,
13,
13,
1678,
903,
3844,
6983,
7504,
295,
29990,
353,
29871,
29900,
29889,
29900,
13,
1678,
903,
3844,
6983,
7504,
295,
29979,
353,
29871,
29900,
29889,
29900,
13,
1678,
903,
3844,
6983,
7504,
295,
29999,
353,
29871,
29900,
29889,
29900,
13,
13,
1678,
903,
4230,
6422,
353,
29871,
29900,
29889,
29900,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
9995,
15514,
7093,
278,
317,
6073,
1469,
6980,
1213,
15945,
13,
4706,
1596,
4852,
6644,
4771,
536,
271,
481,
307,
5489,
1159,
13,
4706,
396,
2567,
281,
1296,
278,
29871,
29953,
29900,
29945,
29900,
701,
408,
372,
8665,
297,
8709,
4464,
13,
4706,
1018,
29901,
13,
9651,
1583,
3032,
8262,
353,
1560,
8262,
29889,
29903,
9486,
375,
29898,
29896,
29897,
13,
9651,
1583,
3032,
8262,
29889,
3539,
29918,
10389,
29918,
1272,
29898,
29903,
6073,
1469,
6980,
29889,
29933,
3308,
29918,
17744,
26785,
29892,
317,
6073,
1469,
6980,
29889,
29925,
9806,
1001,
29918,
29924,
29954,
11490,
29918,
29896,
29892,
29871,
29900,
29897,
13,
4706,
5174,
7399,
2451,
408,
429,
29901,
13,
9651,
1596,
703,
29956,
5086,
701,
10966,
307,
23530,
5229,
29901,
376,
718,
851,
29898,
735,
876,
13,
13,
4706,
396,
6204,
319,
8452,
29896,
29900,
29896,
29945,
11033,
29907,
313,
29896,
29906,
29899,
2966,
29897,
2777,
29889,
13,
4706,
1018,
29901,
13,
9651,
1583,
3032,
328,
29883,
353,
23255,
29888,
9216,
29918,
3035,
29903,
29896,
29916,
29896,
29945,
29889,
3035,
29903,
29896,
29900,
29896,
29945,
580,
13,
4706,
5174,
7399,
2451,
408,
429,
29901,
13,
9651,
1596,
703,
15514,
5281,
11033,
29907,
5229,
29901,
376,
718,
851,
29898,
735,
876,
13,
13,
1678,
822,
5040,
6816,
294,
3864,
29898,
1311,
1125,
13,
4706,
9995,
16329,
7540,
3864,
278,
4771,
943,
1213,
15945,
13,
13,
4706,
1583,
3032,
9344,
6816,
3745,
353,
7700,
13,
13,
1678,
822,
1369,
6816,
294,
3864,
29898,
1311,
1125,
13,
4706,
9995,
4763,
29879,
7540,
3864,
278,
4771,
943,
1213,
15945,
13,
13,
4706,
565,
313,
1333,
1583,
3032,
9344,
6816,
3745,
1125,
13,
9651,
1583,
3032,
9344,
6816,
3745,
353,
5852,
13,
9651,
1583,
3032,
4230,
6422,
353,
931,
29889,
2230,
580,
13,
13,
9651,
260,
353,
3244,
292,
29889,
4899,
29898,
5182,
29922,
1311,
3032,
26658,
29907,
13317,
29897,
13,
9651,
260,
29889,
2962,
580,
13,
13,
1678,
822,
903,
26658,
29907,
13317,
29898,
1311,
1125,
13,
4706,
9995,
1576,
5645,
2425,
1213,
15945,
13,
13,
4706,
1550,
313,
1311,
3032,
9344,
6816,
3745,
1125,
13,
13,
9651,
1035,
295,
1440,
353,
1583,
29889,
657,
7504,
7367,
8328,
580,
13,
9651,
10966,
307,
1440,
353,
1583,
29889,
657,
29954,
29891,
307,
580,
13,
13,
9651,
343,
29928,
387,
353,
1583,
3032,
657,
29990,
21281,
362,
29898,
562,
2242,
1440,
29961,
29900,
1402,
1035,
295,
1440,
29961,
29896,
1402,
1035,
295,
1440,
29961,
29906,
2314,
13,
9651,
10966,
307,
29979,
353,
5785,
29898,
1927,
307,
1440,
29961,
29900,
2314,
13,
9651,
396,
1596,
376,
29891,
29928,
387,
29901,
376,
718,
851,
29898,
29891,
29928,
387,
29897,
13,
13,
9651,
9995,
13,
9651,
422,
2037,
653,
4175,
29892,
591,
2125,
10966,
307,
29933,
3173,
29898,
29900,
29889,
29929,
29947,
29897,
5633,
515,
278,
10966,
307,
848,
322,
22932,
372,
491,
19471,
323,
297,
6923,
13,
9651,
322,
1035,
295,
29933,
3173,
29898,
29900,
29889,
29900,
29906,
29897,
5633,
515,
15592,
8328,
848,
304,
22874,
403,
363,
4192,
2027,
13,
9651,
9995,
13,
13,
9651,
19471,
29911,
353,
5785,
29898,
2230,
29889,
2230,
580,
448,
1583,
3032,
4230,
6422,
29897,
13,
9651,
565,
313,
6897,
29898,
1927,
307,
29979,
334,
19471,
29911,
29897,
529,
29871,
29900,
29889,
29900,
29945,
1125,
13,
18884,
10966,
307,
29979,
353,
29871,
29900,
13,
9651,
1583,
3032,
3844,
6983,
7504,
295,
29979,
353,
5785,
29898,
29900,
29889,
29955,
334,
5785,
29898,
1311,
3032,
3844,
6983,
7504,
295,
29979,
718,
10966,
307,
29979,
334,
19471,
29911,
29897,
448,
29871,
29900,
29889,
29941,
334,
343,
29928,
387,
29897,
13,
9651,
396,
1583,
29889,
3844,
6983,
7504,
295,
29979,
353,
5785,
29898,
1311,
29889,
3844,
6983,
7504,
295,
29979,
718,
10966,
307,
29979,
29930,
4181,
29911,
29897,
13,
13,
9651,
396,
1583,
29889,
3844,
6983,
7504,
295,
29979,
353,
5785,
29898,
1311,
29889,
3844,
6983,
7504,
295,
29979,
718,
10966,
307,
29979,
29930,
4181,
29911,
29897,
13,
9651,
1596,
4852,
1927,
307,
29979,
29901,
376,
718,
851,
29898,
1311,
3032,
3844,
6983,
7504,
295,
29979,
29897,
718,
376,
19471,
29901,
376,
718,
851,
29898,
29891,
29928,
387,
876,
13,
9651,
1583,
3032,
4230,
6422,
353,
931,
29889,
2230,
580,
13,
9651,
931,
29889,
17059,
29898,
29900,
29889,
29900,
29900,
29941,
29906,
29897,
29871,
396,
10318,
472,
29871,
29941,
29900,
29882,
29920,
13,
13,
1678,
822,
1303,
3035,
29907,
29898,
1311,
1125,
13,
4706,
9995,
4763,
5183,
11033,
29907,
1819,
15945,
29908,
13,
4706,
14550,
13,
4706,
1596,
877,
6359,
292,
319,
8452,
29896,
29916,
29896,
29945,
1819,
29892,
3965,
315,
11742,
29899,
29907,
304,
23283,
856,
1495,
13,
4706,
396,
13905,
7575,
8242,
1897,
9066,
29889,
13,
4706,
1596,
877,
29989,
426,
29900,
29901,
29958,
29953,
29913,
891,
426,
29896,
29901,
29958,
29953,
29913,
891,
426,
29906,
29901,
29958,
29953,
29913,
891,
426,
29941,
29901,
29958,
29953,
29913,
891,
4286,
4830,
10456,
3881,
29898,
29946,
4961,
13,
4706,
1596,
877,
29899,
29915,
334,
29871,
29941,
29955,
29897,
13,
4706,
396,
4241,
2425,
29889,
13,
4706,
1550,
313,
1311,
3032,
9344,
6816,
3745,
1125,
13,
9651,
396,
7523,
599,
278,
11033,
29907,
8242,
1819,
297,
263,
1051,
29889,
13,
9651,
1819,
353,
518,
29900,
14178,
29946,
13,
9651,
363,
474,
297,
3464,
29898,
29946,
1125,
13,
18884,
1819,
29961,
29875,
29962,
353,
594,
29883,
29889,
949,
29918,
328,
29883,
29898,
29875,
29892,
11581,
29922,
12739,
1177,
29897,
13,
9651,
396,
13905,
278,
11033,
29907,
1819,
29889,
13,
9651,
1596,
877,
29989,
426,
29900,
29901,
29958,
29953,
29913,
891,
426,
29896,
29901,
29958,
29953,
29913,
891,
426,
29906,
29901,
29958,
29953,
29913,
891,
426,
29941,
29901,
29958,
29953,
29913,
891,
4286,
4830,
10456,
5975,
876,
13,
9651,
396,
349,
1071,
363,
4203,
263,
1473,
29889,
13,
9651,
931,
29889,
17059,
29898,
29900,
29889,
29945,
29897,
13,
4706,
14550,
13,
4706,
3578,
29903,
6073,
29934,
353,
1583,
3032,
328,
29883,
29889,
949,
29918,
328,
29883,
29898,
29906,
29892,
11581,
29922,
29903,
6073,
1469,
6980,
29889,
12739,
1177,
29897,
13,
4706,
3578,
29903,
6073,
29931,
353,
1583,
3032,
328,
29883,
29889,
949,
29918,
328,
29883,
29898,
29941,
29892,
11581,
29922,
29903,
6073,
1469,
6980,
29889,
12739,
1177,
29897,
13,
13,
4706,
736,
3578,
29903,
6073,
29934,
29892,
3578,
29903,
6073,
29931,
13,
13,
1678,
822,
679,
29903,
4346,
720,
7504,
7367,
8328,
29898,
1311,
1125,
13,
4706,
9995,
29954,
1691,
278,
10597,
287,
15592,
8328,
995,
1213,
15945,
13,
13,
4706,
736,
1583,
3032,
3844,
6983,
7504,
295,
29990,
29892,
1583,
3032,
3844,
6983,
7504,
295,
29979,
29892,
1583,
3032,
3844,
6983,
7504,
295,
29999,
13,
13,
1678,
822,
679,
29954,
29891,
307,
29898,
1311,
1125,
13,
4706,
9995,
29954,
1691,
278,
10650,
10966,
307,
23530,
1819,
1213,
15945,
13,
13,
4706,
10966,
307,
29918,
29916,
449,
353,
5785,
29898,
1311,
3032,
949,
14463,
29906,
29883,
29898,
29900,
29916,
29946,
29941,
876,
13,
4706,
10966,
307,
29918,
29891,
449,
353,
5785,
29898,
1311,
3032,
949,
14463,
29906,
29883,
29898,
29900,
29916,
29946,
29945,
876,
13,
4706,
10966,
307,
29918,
29920,
449,
353,
5785,
29898,
1311,
3032,
949,
14463,
29906,
29883,
29898,
29900,
29916,
29946,
29955,
876,
13,
4706,
736,
313,
1927,
307,
29918,
29916,
449,
334,
13,
18884,
317,
6073,
1469,
6980,
29889,
29954,
29979,
1672,
29918,
29903,
5454,
1307,
29892,
10966,
307,
29918,
29891,
449,
334,
13,
18884,
317,
6073,
1469,
6980,
29889,
29954,
29979,
1672,
29918,
29903,
5454,
1307,
29892,
10966,
307,
29918,
29920,
449,
334,
13,
18884,
317,
6073,
1469,
6980,
29889,
29954,
29979,
1672,
29918,
29903,
5454,
1307,
29897,
13,
13,
1678,
822,
679,
7504,
7367,
8328,
29898,
1311,
1125,
13,
4706,
9995,
29954,
1691,
278,
10650,
15592,
8328,
23530,
1819,
1213,
15945,
13,
13,
4706,
1035,
295,
29918,
29916,
449,
353,
5785,
29898,
1311,
3032,
949,
14463,
29906,
29883,
29898,
29900,
29916,
29941,
29890,
876,
13,
4706,
1035,
295,
29918,
29891,
449,
353,
5785,
29898,
1311,
3032,
949,
14463,
29906,
29883,
29898,
29900,
29916,
29941,
29881,
876,
13,
4706,
1035,
295,
29918,
29920,
449,
353,
5785,
29898,
1311,
3032,
949,
14463,
29906,
29883,
29898,
29900,
29916,
29941,
29888,
876,
13,
4706,
736,
1035,
295,
29918,
29916,
449,
334,
320,
13,
1669,
317,
6073,
1469,
6980,
29889,
2477,
29931,
29918,
29903,
5454,
1307,
29892,
1035,
295,
29918,
29891,
449,
334,
320,
13,
1669,
317,
6073,
1469,
6980,
29889,
2477,
29931,
29918,
29903,
5454,
1307,
29892,
1035,
295,
29918,
29920,
449,
334,
320,
13,
1669,
317,
6073,
1469,
6980,
29889,
2477,
29931,
29918,
29903,
5454,
1307,
13,
13,
1678,
822,
903,
949,
12901,
29898,
1311,
29892,
594,
29878,
1125,
13,
4706,
9995,
6359,
29879,
263,
7023,
515,
278,
23530,
3593,
1213,
15945,
13,
13,
4706,
736,
1583,
3032,
8262,
29889,
949,
29918,
10389,
29918,
1272,
29898,
29903,
6073,
1469,
6980,
29889,
29933,
3308,
29918,
17744,
26785,
29892,
594,
29878,
29897,
13,
13,
1678,
822,
903,
949,
14463,
29898,
1311,
29892,
594,
29878,
1125,
13,
4706,
9995,
6359,
29879,
263,
1734,
515,
278,
23530,
3593,
1213,
15945,
13,
13,
4706,
1880,
353,
1583,
3032,
8262,
29889,
949,
29918,
10389,
29918,
1272,
29898,
29903,
6073,
1469,
6980,
29889,
29933,
3308,
29918,
17744,
26785,
29892,
594,
29878,
29897,
13,
4706,
4482,
353,
1583,
3032,
8262,
29889,
949,
29918,
10389,
29918,
1272,
29898,
29903,
6073,
1469,
6980,
29889,
29933,
3308,
29918,
17744,
26785,
29892,
594,
29878,
718,
29871,
29896,
29897,
13,
4706,
659,
353,
313,
9812,
3532,
29871,
29947,
29897,
718,
4482,
13,
4706,
736,
659,
13,
13,
1678,
822,
903,
949,
14463,
29906,
29883,
29898,
1311,
29892,
594,
29878,
1125,
13,
4706,
9995,
6359,
29879,
263,
1734,
515,
278,
23530,
3593,
1213,
15945,
13,
13,
4706,
659,
353,
1583,
3032,
949,
14463,
29898,
7887,
29897,
13,
4706,
565,
313,
791,
6736,
29871,
29900,
29916,
29947,
29900,
29900,
29900,
1125,
13,
9651,
736,
448,
3552,
29953,
29945,
29945,
29941,
29945,
448,
659,
29897,
718,
29871,
29896,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
659,
13,
13,
1678,
822,
903,
5721,
29898,
1311,
29892,
263,
29892,
289,
1125,
13,
4706,
9995,
27065,
1078,
278,
3309,
1546,
1023,
3291,
373,
263,
17205,
1213,
15945,
13,
13,
4706,
736,
5844,
29889,
3676,
3552,
29874,
334,
263,
29897,
718,
313,
29890,
334,
289,
876,
13,
13,
1678,
822,
903,
657,
29979,
21281,
362,
29898,
1311,
29892,
921,
29892,
343,
29892,
503,
1125,
13,
4706,
9995,
29954,
1691,
278,
612,
13733,
310,
278,
6790,
1060,
29892,
612,
322,
796,
1213,
15945,
13,
13,
4706,
2971,
5834,
353,
5844,
29889,
23402,
29906,
29898,
29916,
29892,
1583,
3032,
5721,
29898,
29891,
29892,
503,
876,
13,
4706,
736,
448,
755,
29889,
311,
7979,
267,
29898,
3665,
5834,
29897,
13,
13,
1678,
822,
903,
657,
29990,
21281,
362,
29898,
1311,
29892,
921,
29892,
343,
29892,
503,
1125,
13,
4706,
9995,
29954,
1691,
278,
1060,
13733,
310,
278,
6790,
1060,
29892,
612,
322,
796,
1213,
15945,
13,
13,
4706,
2971,
5834,
353,
5844,
29889,
23402,
29906,
29898,
29891,
29892,
1583,
3032,
5721,
29898,
29916,
29892,
503,
876,
13,
4706,
736,
5844,
29889,
311,
7979,
267,
29898,
3665,
5834,
29897,
13,
2
] |
src/falconpy/quick_scan.py | CrowdStrike/falconpy | 111 | 22906 | """Falcon Quick Scan API Interface Class
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | |: 1 |
|::.. . | CROWDSTRIKE FALCON |::.. . | FalconPy
`-------' `-------'
OAuth2 API - Customer SDK
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
"""
from ._util import force_default, process_service_request, handle_single_argument
from ._payload import generic_payload_list, aggregate_payload
from ._service_class import ServiceClass
from ._endpoint._quick_scan import _quick_scan_endpoints as Endpoints
class QuickScan(ServiceClass):
"""The only requirement to instantiate an instance of this class is one of the following:
- a valid client_id and client_secret provided as keywords.
- a credential dictionary with client_id and client_secret containing valid API credentials
{
"client_id": "CLIENT_ID_HERE",
"client_secret": "CLIENT_SECRET_HERE"
}
- a previously-authenticated instance of the authentication service class (oauth2.py)
- a valid token provided by the authentication service class (oauth2.py)
"""
@force_default(defaults=["body"], default_types=["dict"])
def get_scans_aggregates(self: object, body: dict = None, **kwargs) -> dict:
"""Get scans aggregations as specified via json in request body.
Keyword arguments:
body -- full body payload, not required when using other keywords.
{
"date_ranges": [
{
"from": "string",
"to": "string"
}
],
"field": "string",
"filter": "string",
"interval": "string",
"min_doc_count": 0,
"missing": "string",
"name": "string",
"q": "string",
"ranges": [
{
"From": 0,
"To": 0
}
],
"size": 0,
"sort": "string",
"sub_aggregates": [
null
],
"time_zone": "string",
"type": "string"
}
date_ranges -- List of dictionaries.
field -- String.
filter -- FQL syntax. String.
interval -- String.
min_doc_count -- Minimum number of documents required to match. Integer.
missing -- String.
name -- Scan name. String.
q -- FQL syntax. String.
ranges -- List of dictionaries.
size -- Integer.
sort -- FQL syntax. String.
sub_aggregates -- List of strings.
time_zone -- String.
type -- String.
This method only supports keywords for providing arguments.
This method does not support body payload validation.
Returns: dict object containing API response.
HTTP Method: POST
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/quick-scan/GetScansAggregates
"""
if not body:
body = aggregate_payload(submitted_keywords=kwargs)
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="GetScansAggregates",
body=body
)
@force_default(defaults=["parameters"], default_types=["dict"])
def get_scans(self: object, *args, parameters: dict = None, **kwargs) -> dict:
"""Check the status of a volume scan. Time required for
analysis increases with the number of samples in a volume
but usually it should take less than 1 minute.
Keyword arguments:
ids -- One or more remediation IDs. String or list of strings.
parameters - full parameters payload, not required if ids is provided as a keyword.
Arguments: When not specified, the first argument to this method is assumed to be 'ids'.
All others are ignored.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/quick-scan/GetScans
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="GetScans",
keywords=kwargs,
params=handle_single_argument(args, parameters, "ids")
)
@force_default(defaults=["body"], default_types=["dict"])
def scan_samples(self: object, *args, body: dict = None, **kwargs) -> dict:
"""Get scans aggregations as specified via json in request body.
Keyword arguments:
body -- full body payload, not required when samples keyword is provided.
{
"samples": [
"string"
]
}
samples -- SHA256(s) of the samples to scan. Must have been previously submitted using
SampleUploadV3 (SampleUploads class). String or list of strings.
Arguments: When not specified, the first argument to this method is assumed to be
'samples'. All others are ignored.
Returns: dict object containing API response.
HTTP Method: POST
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/quick-scan/ScanSamples
"""
if not body:
body = generic_payload_list(submitted_arguments=args,
submitted_keywords=kwargs,
payload_value="samples"
)
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="ScanSamples",
body=body,
body_validator={"samples": list} if self.validate_payloads else None,
body_required=["samples"] if self.validate_payloads else None
)
@force_default(defaults=["parameters"], default_types=["dict"])
def query_submissions(self: object, parameters: dict = None, **kwargs) -> dict:
"""Find IDs for submitted scans by providing an FQL filter and paging details.
Returns a set of volume IDs that match your criteria.
Keyword arguments:
filter -- The filter expression that should be used to limit the results. FQL syntax.
limit -- The maximum number of records to return. [integer, 1-5000]
offset -- The integer offset to start retrieving records from.
parameters - full parameters payload, not required if using other keywords.
sort -- The property to sort by. FQL syntax.
This method only supports keywords for providing arguments.
Returns: dict object containing API response.
HTTP Method: GET
Swagger URL
https://assets.falcon.crowdstrike.com/support/api/swagger.html#/quick-scan/QuerySubmissionsMixin0
"""
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="QuerySubmissionsMixin0",
keywords=kwargs,
params=parameters
)
# These method names align to the operation IDs in the API but
# do not conform to snake_case / PEP8 and are defined here for
# backwards compatibility / ease of use purposes
GetScansAggregates = get_scans_aggregates
GetScans = get_scans
ScanSamples = scan_samples
QuerySubmissionsMixin0 = query_submissions
# The legacy name for this class does not conform to PascalCase / PEP8
# It is defined here for backwards compatibility purposes only.
Quick_Scan = QuickScan # pylint: disable=C0103
| [
1,
9995,
29943,
284,
535,
26141,
2522,
273,
3450,
25796,
4134,
13,
13,
903,
7652,
1649,
462,
4706,
4770,
903,
7652,
1649,
4770,
4706,
4770,
4770,
13,
29989,
259,
903,
259,
869,
807,
29889,
23648,
7703,
7703,
7703,
7703,
29989,
29871,
891,
259,
903,
259,
891,
29871,
891,
5396,
807,
29989,
1649,
29989,
29871,
891,
489,
29889,
23648,
29889,
13,
29989,
29889,
259,
29896,
22359,
29989,
259,
903,
29989,
29871,
903,
29871,
891,
29871,
891,
29871,
891,
29871,
891,
29871,
903,
29871,
891,
1678,
29896,
22359,
29989,
259,
903,
29989,
259,
903,
29989,
29871,
891,
1678,
529,
29989,
29871,
448,
1649,
29989,
13,
29989,
29889,
29871,
891,
22359,
29989,
1649,
29989,
891,
7652,
29918,
29989,
14365,
29989,
7652,
29918,
29989,
7652,
259,
891,
7652,
29989,
1649,
29989,
891,
1649,
29989,
1649,
29989,
1649,
29989,
7652,
29918,
29989,
13,
29989,
29901,
259,
29896,
259,
891,
462,
308,
891,
29901,
259,
29896,
259,
891,
13,
29989,
1057,
636,
869,
891,
259,
315,
1672,
24668,
1254,
3960,
6059,
383,
1964,
6007,
1678,
891,
1057,
636,
869,
891,
1678,
12941,
535,
19737,
13,
29952,
26589,
29915,
462,
308,
421,
26589,
29915,
13,
13,
29949,
6444,
29906,
3450,
448,
21886,
12967,
13,
13,
4013,
338,
3889,
322,
443,
3977,
2807,
287,
7047,
5492,
964,
278,
970,
5354,
29889,
13,
13,
10773,
650,
338,
3889,
304,
3509,
29892,
6623,
29892,
9805,
29892,
671,
29892,
6633,
29892,
19417,
29892,
470,
13,
5721,
2666,
445,
7047,
29892,
2845,
297,
2752,
775,
883,
470,
408,
263,
13126,
13,
19541,
29892,
363,
738,
6437,
29892,
12128,
470,
1661,
29899,
510,
1050,
1455,
29892,
322,
491,
738,
13,
1004,
550,
29889,
13,
13,
797,
24894,
8977,
1080,
393,
18720,
3509,
1266,
14243,
29892,
278,
4148,
470,
15717,
13,
974,
445,
7047,
8856,
403,
738,
322,
599,
3509,
1266,
4066,
297,
278,
13,
20415,
304,
278,
970,
5354,
29889,
1334,
1207,
445,
8856,
362,
363,
278,
14169,
13,
974,
278,
970,
472,
2919,
322,
304,
278,
1439,
29878,
2073,
310,
1749,
540,
12935,
322,
13,
8698,
943,
29889,
1334,
24042,
445,
8856,
362,
304,
367,
385,
975,
29873,
1044,
310,
13,
276,
1915,
339,
18310,
297,
25722,
29884,
537,
310,
599,
2198,
322,
5434,
10462,
304,
445,
13,
20415,
1090,
3509,
1266,
4307,
29889,
13,
13,
28350,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
13,
5746,
15094,
1799,
6323,
306,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
13,
29924,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
13,
1177,
11698,
382,
29963,
3919,
24972,
9818,
6093,
26524,
29950,
24125,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
13,
2891,
4448,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
13,
1718,
3235,
4214,
3895,
29892,
19474,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
13,
2891,
4448,
5012,
1964,
4214,
29903,
2672,
6093,
7791,
7818,
12982,
1525,
29889,
13,
13,
2831,
901,
2472,
29892,
3113,
2737,
304,
529,
991,
597,
348,
506,
1947,
29889,
990,
29958,
13,
15945,
29908,
13,
3166,
869,
29918,
4422,
1053,
4889,
29918,
4381,
29892,
1889,
29918,
5509,
29918,
3827,
29892,
4386,
29918,
14369,
29918,
23516,
13,
3166,
869,
29918,
23813,
1053,
10035,
29918,
23813,
29918,
1761,
29892,
20431,
29918,
23813,
13,
3166,
869,
29918,
5509,
29918,
1990,
1053,
6692,
2385,
13,
3166,
869,
29918,
29734,
3032,
24561,
29918,
16192,
1053,
903,
24561,
29918,
16192,
29918,
355,
9748,
408,
2796,
9748,
13,
13,
13,
1990,
26141,
29083,
29898,
3170,
2385,
1125,
13,
1678,
9995,
1576,
871,
11809,
304,
25112,
385,
2777,
310,
445,
770,
338,
697,
310,
278,
1494,
29901,
13,
13,
1678,
448,
263,
2854,
3132,
29918,
333,
322,
3132,
29918,
19024,
4944,
408,
29361,
29889,
13,
1678,
448,
263,
6625,
2556,
8600,
411,
3132,
29918,
333,
322,
3132,
29918,
19024,
6943,
2854,
3450,
16140,
13,
418,
426,
13,
3986,
376,
4645,
29918,
333,
1115,
376,
27205,
3919,
29918,
1367,
29918,
5006,
613,
13,
3986,
376,
4645,
29918,
19024,
1115,
376,
27205,
3919,
29918,
1660,
22245,
29911,
29918,
5006,
29908,
13,
418,
500,
13,
1678,
448,
263,
9251,
29899,
27218,
630,
2777,
310,
278,
10760,
2669,
770,
313,
23106,
29906,
29889,
2272,
29897,
13,
1678,
448,
263,
2854,
5993,
4944,
491,
278,
10760,
2669,
770,
313,
23106,
29906,
29889,
2272,
29897,
13,
1678,
9995,
13,
1678,
732,
10118,
29918,
4381,
29898,
4381,
29879,
29922,
3366,
2587,
12436,
2322,
29918,
8768,
29922,
3366,
8977,
20068,
13,
1678,
822,
679,
29918,
1557,
550,
29918,
26193,
1078,
29898,
1311,
29901,
1203,
29892,
3573,
29901,
9657,
353,
6213,
29892,
3579,
19290,
29897,
1599,
9657,
29901,
13,
4706,
9995,
2577,
885,
550,
11404,
800,
408,
6790,
3025,
4390,
297,
2009,
3573,
29889,
13,
13,
4706,
7670,
1742,
6273,
29901,
13,
4706,
3573,
1192,
2989,
3573,
20092,
29892,
451,
3734,
746,
773,
916,
29361,
29889,
13,
18884,
426,
13,
462,
1678,
376,
1256,
29918,
29878,
6916,
1115,
518,
13,
462,
4706,
426,
13,
462,
9651,
376,
3166,
1115,
376,
1807,
613,
13,
462,
9651,
376,
517,
1115,
376,
1807,
29908,
13,
462,
4706,
500,
13,
462,
1678,
21251,
13,
462,
1678,
376,
2671,
1115,
376,
1807,
613,
13,
462,
1678,
376,
4572,
1115,
376,
1807,
613,
13,
462,
1678,
376,
19207,
1115,
376,
1807,
613,
13,
462,
1678,
376,
1195,
29918,
1514,
29918,
2798,
1115,
29871,
29900,
29892,
13,
462,
1678,
376,
27259,
1115,
376,
1807,
613,
13,
462,
1678,
376,
978,
1115,
376,
1807,
613,
13,
462,
1678,
376,
29939,
1115,
376,
1807,
613,
13,
462,
1678,
376,
29878,
6916,
1115,
518,
13,
462,
4706,
426,
13,
462,
9651,
376,
4591,
1115,
29871,
29900,
29892,
13,
462,
9651,
376,
1762,
1115,
29871,
29900,
13,
462,
4706,
500,
13,
462,
1678,
21251,
13,
462,
1678,
376,
2311,
1115,
29871,
29900,
29892,
13,
462,
1678,
376,
6605,
1115,
376,
1807,
613,
13,
462,
1678,
376,
1491,
29918,
26193,
1078,
1115,
518,
13,
462,
4706,
1870,
13,
462,
1678,
21251,
13,
462,
1678,
376,
2230,
29918,
8028,
1115,
376,
1807,
613,
13,
462,
1678,
376,
1853,
1115,
376,
1807,
29908,
13,
18884,
500,
13,
4706,
2635,
29918,
29878,
6916,
1192,
2391,
310,
21503,
4314,
29889,
13,
4706,
1746,
1192,
1714,
29889,
13,
4706,
4175,
1192,
383,
2239,
5877,
29889,
1714,
29889,
13,
4706,
7292,
1192,
1714,
29889,
13,
4706,
1375,
29918,
1514,
29918,
2798,
1192,
3080,
12539,
1353,
310,
10701,
3734,
304,
1993,
29889,
8102,
29889,
13,
4706,
4567,
1192,
1714,
29889,
13,
4706,
1024,
1192,
2522,
273,
1024,
29889,
1714,
29889,
13,
4706,
3855,
1192,
383,
2239,
5877,
29889,
1714,
29889,
13,
4706,
20238,
1192,
2391,
310,
21503,
4314,
29889,
13,
4706,
2159,
1192,
8102,
29889,
13,
4706,
2656,
1192,
383,
2239,
5877,
29889,
1714,
29889,
13,
4706,
1014,
29918,
26193,
1078,
1192,
2391,
310,
6031,
29889,
13,
4706,
931,
29918,
8028,
1192,
1714,
29889,
13,
4706,
1134,
1192,
1714,
29889,
13,
13,
4706,
910,
1158,
871,
11286,
29361,
363,
13138,
6273,
29889,
13,
13,
4706,
910,
1158,
947,
451,
2304,
3573,
20092,
8845,
29889,
13,
13,
4706,
16969,
29901,
9657,
1203,
6943,
3450,
2933,
29889,
13,
13,
4706,
7331,
8108,
29901,
11971,
13,
13,
4706,
3925,
9921,
3988,
13,
4706,
2045,
597,
16596,
29889,
18263,
535,
29889,
29883,
798,
22992,
20995,
29889,
510,
29914,
5924,
29914,
2754,
29914,
2774,
9921,
29889,
1420,
29937,
29914,
24561,
29899,
16192,
29914,
2577,
4421,
550,
29909,
26127,
1078,
13,
4706,
9995,
13,
4706,
565,
451,
3573,
29901,
13,
9651,
3573,
353,
20431,
29918,
23813,
29898,
1491,
29885,
4430,
29918,
1989,
9303,
29922,
19290,
29897,
13,
13,
4706,
736,
1889,
29918,
5509,
29918,
3827,
29898,
13,
9651,
5432,
29918,
3318,
29922,
1311,
29892,
13,
9651,
1095,
9748,
29922,
5044,
9748,
29892,
13,
9651,
5858,
29918,
333,
543,
2577,
4421,
550,
29909,
26127,
1078,
613,
13,
9651,
3573,
29922,
2587,
13,
9651,
1723,
13,
13,
1678,
732,
10118,
29918,
4381,
29898,
4381,
29879,
29922,
3366,
16744,
12436,
2322,
29918,
8768,
29922,
3366,
8977,
20068,
13,
1678,
822,
679,
29918,
1557,
550,
29898,
1311,
29901,
1203,
29892,
334,
5085,
29892,
4128,
29901,
9657,
353,
6213,
29892,
3579,
19290,
29897,
1599,
9657,
29901,
13,
4706,
9995,
5596,
278,
4660,
310,
263,
7977,
12812,
29889,
5974,
3734,
363,
13,
4706,
7418,
16415,
411,
278,
1353,
310,
11916,
297,
263,
7977,
13,
4706,
541,
5491,
372,
881,
2125,
3109,
1135,
29871,
29896,
11015,
29889,
13,
13,
4706,
7670,
1742,
6273,
29901,
13,
4706,
18999,
1192,
3118,
470,
901,
1083,
287,
11685,
23481,
29889,
1714,
470,
1051,
310,
6031,
29889,
13,
4706,
4128,
448,
2989,
4128,
20092,
29892,
451,
3734,
565,
18999,
338,
4944,
408,
263,
13553,
29889,
13,
13,
4706,
11842,
9331,
29901,
1932,
451,
6790,
29892,
278,
937,
2980,
304,
445,
1158,
338,
12023,
304,
367,
525,
4841,
4286,
13,
462,
259,
2178,
4045,
526,
17262,
29889,
13,
13,
4706,
16969,
29901,
9657,
1203,
6943,
3450,
2933,
29889,
13,
13,
4706,
7331,
8108,
29901,
12354,
13,
13,
4706,
3925,
9921,
3988,
13,
4706,
2045,
597,
16596,
29889,
18263,
535,
29889,
29883,
798,
22992,
20995,
29889,
510,
29914,
5924,
29914,
2754,
29914,
2774,
9921,
29889,
1420,
29937,
29914,
24561,
29899,
16192,
29914,
2577,
4421,
550,
13,
4706,
9995,
13,
4706,
736,
1889,
29918,
5509,
29918,
3827,
29898,
13,
9651,
5432,
29918,
3318,
29922,
1311,
29892,
13,
9651,
1095,
9748,
29922,
5044,
9748,
29892,
13,
9651,
5858,
29918,
333,
543,
2577,
4421,
550,
613,
13,
9651,
29361,
29922,
19290,
29892,
13,
9651,
8636,
29922,
8411,
29918,
14369,
29918,
23516,
29898,
5085,
29892,
4128,
29892,
376,
4841,
1159,
13,
9651,
1723,
13,
13,
1678,
732,
10118,
29918,
4381,
29898,
4381,
29879,
29922,
3366,
2587,
12436,
2322,
29918,
8768,
29922,
3366,
8977,
20068,
13,
1678,
822,
12812,
29918,
27736,
29898,
1311,
29901,
1203,
29892,
334,
5085,
29892,
3573,
29901,
9657,
353,
6213,
29892,
3579,
19290,
29897,
1599,
9657,
29901,
13,
4706,
9995,
2577,
885,
550,
11404,
800,
408,
6790,
3025,
4390,
297,
2009,
3573,
29889,
13,
13,
4706,
7670,
1742,
6273,
29901,
13,
4706,
3573,
1192,
2989,
3573,
20092,
29892,
451,
3734,
746,
11916,
13553,
338,
4944,
29889,
13,
18884,
426,
13,
462,
1678,
376,
27736,
1115,
518,
13,
462,
4706,
376,
1807,
29908,
13,
462,
1678,
4514,
13,
18884,
500,
13,
4706,
11916,
1192,
317,
15715,
29906,
29945,
29953,
29898,
29879,
29897,
310,
278,
11916,
304,
12812,
29889,
19928,
505,
1063,
9251,
18397,
773,
13,
462,
259,
21029,
17553,
29963,
29941,
313,
17708,
17553,
29879,
770,
467,
1714,
470,
1051,
310,
6031,
29889,
13,
13,
4706,
11842,
9331,
29901,
1932,
451,
6790,
29892,
278,
937,
2980,
304,
445,
1158,
338,
12023,
304,
367,
13,
462,
259,
525,
27736,
4286,
2178,
4045,
526,
17262,
29889,
13,
13,
4706,
16969,
29901,
9657,
1203,
6943,
3450,
2933,
29889,
13,
13,
4706,
7331,
8108,
29901,
11971,
13,
13,
4706,
3925,
9921,
3988,
13,
4706,
2045,
597,
16596,
29889,
18263,
535,
29889,
29883,
798,
22992,
20995,
29889,
510,
29914,
5924,
29914,
2754,
29914,
2774,
9921,
29889,
1420,
29937,
29914,
24561,
29899,
16192,
29914,
29083,
29903,
9422,
13,
4706,
9995,
13,
4706,
565,
451,
3573,
29901,
13,
9651,
3573,
353,
10035,
29918,
23813,
29918,
1761,
29898,
1491,
29885,
4430,
29918,
25699,
29922,
5085,
29892,
13,
462,
462,
4706,
18397,
29918,
1989,
9303,
29922,
19290,
29892,
13,
462,
462,
4706,
20092,
29918,
1767,
543,
27736,
29908,
13,
462,
462,
4706,
1723,
13,
13,
4706,
736,
1889,
29918,
5509,
29918,
3827,
29898,
13,
9651,
5432,
29918,
3318,
29922,
1311,
29892,
13,
9651,
1095,
9748,
29922,
5044,
9748,
29892,
13,
9651,
5858,
29918,
333,
543,
29083,
29903,
9422,
613,
13,
9651,
3573,
29922,
2587,
29892,
13,
9651,
3573,
29918,
3084,
1061,
3790,
29908,
27736,
1115,
1051,
29913,
565,
1583,
29889,
15480,
29918,
10472,
18132,
1683,
6213,
29892,
13,
9651,
3573,
29918,
12403,
29922,
3366,
27736,
3108,
565,
1583,
29889,
15480,
29918,
10472,
18132,
1683,
6213,
13,
9651,
1723,
13,
13,
1678,
732,
10118,
29918,
4381,
29898,
4381,
29879,
29922,
3366,
16744,
12436,
2322,
29918,
8768,
29922,
3366,
8977,
20068,
13,
1678,
822,
2346,
29918,
1491,
29885,
6847,
29898,
1311,
29901,
1203,
29892,
4128,
29901,
9657,
353,
6213,
29892,
3579,
19290,
29897,
1599,
9657,
29901,
13,
4706,
9995,
12542,
23481,
363,
18397,
885,
550,
491,
13138,
385,
383,
2239,
4175,
322,
282,
6751,
4902,
29889,
13,
4706,
16969,
263,
731,
310,
7977,
23481,
393,
1993,
596,
16614,
29889,
13,
13,
4706,
7670,
1742,
6273,
29901,
13,
4706,
4175,
1192,
450,
4175,
4603,
393,
881,
367,
1304,
304,
4046,
278,
2582,
29889,
383,
2239,
5877,
29889,
13,
4706,
4046,
1192,
450,
7472,
1353,
310,
6475,
304,
736,
29889,
518,
16031,
29892,
29871,
29896,
29899,
29945,
29900,
29900,
29900,
29962,
13,
4706,
9210,
1192,
450,
6043,
9210,
304,
1369,
5663,
15387,
6475,
515,
29889,
13,
4706,
4128,
448,
2989,
4128,
20092,
29892,
451,
3734,
565,
773,
916,
29361,
29889,
13,
4706,
2656,
1192,
450,
2875,
304,
2656,
491,
29889,
383,
2239,
5877,
29889,
13,
13,
4706,
910,
1158,
871,
11286,
29361,
363,
13138,
6273,
29889,
13,
13,
4706,
16969,
29901,
9657,
1203,
6943,
3450,
2933,
29889,
13,
13,
4706,
7331,
8108,
29901,
12354,
13,
13,
4706,
3925,
9921,
3988,
13,
4706,
2045,
597,
16596,
29889,
18263,
535,
29889,
29883,
798,
22992,
20995,
29889,
510,
29914,
5924,
29914,
2754,
29914,
2774,
9921,
29889,
1420,
29937,
29914,
24561,
29899,
16192,
29914,
3010,
4035,
29885,
6847,
29924,
861,
262,
29900,
13,
4706,
9995,
13,
4706,
736,
1889,
29918,
5509,
29918,
3827,
29898,
13,
9651,
5432,
29918,
3318,
29922,
1311,
29892,
13,
9651,
1095,
9748,
29922,
5044,
9748,
29892,
13,
9651,
5858,
29918,
333,
543,
3010,
4035,
29885,
6847,
29924,
861,
262,
29900,
613,
13,
9651,
29361,
29922,
19290,
29892,
13,
9651,
8636,
29922,
16744,
13,
9651,
1723,
13,
13,
1678,
396,
4525,
1158,
2983,
7595,
304,
278,
5858,
23481,
297,
278,
3450,
541,
13,
1678,
396,
437,
451,
14670,
304,
269,
21040,
29918,
4878,
847,
349,
15488,
29947,
322,
526,
3342,
1244,
363,
13,
1678,
396,
28953,
24521,
847,
16326,
310,
671,
11976,
13,
1678,
3617,
4421,
550,
29909,
26127,
1078,
353,
679,
29918,
1557,
550,
29918,
26193,
1078,
13,
1678,
3617,
4421,
550,
353,
679,
29918,
1557,
550,
13,
1678,
2522,
273,
29903,
9422,
353,
12812,
29918,
27736,
13,
1678,
13641,
4035,
29885,
6847,
29924,
861,
262,
29900,
353,
2346,
29918,
1491,
29885,
6847,
13,
13,
13,
29937,
450,
25000,
1024,
363,
445,
770,
947,
451,
14670,
304,
29671,
8259,
847,
349,
15488,
29947,
13,
29937,
739,
338,
3342,
1244,
363,
28953,
24521,
11976,
871,
29889,
13,
2182,
860,
29918,
29083,
353,
26141,
29083,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
29907,
29900,
29896,
29900,
29941,
13,
2
] |
backend/backend/algorithms/trend_follow.py | vbyravarasu/alpharithmic-trading | 22 | 1607598 | # Zipline API
from zipline.api import attach_pipeline, pipeline_output, schedule_function, get_open_orders, order_target_percent
from zipline.pipeline import Pipeline
from zipline.utils.events import date_rules, time_rules
from zipline.pipeline.factors import AverageDollarVolume
from zipline import run_algorithm
# Data frame
import numpy as np
import pandas as pd
import statsmodels.api as sm
# Logging
from websocket import create_connection
# Data frame to JSON
from ..api.create_response import create_json_response
def trend_follow_run(start_date, end_date, capital_base, log_channel):
ws = create_connection("ws://alpharithmic.herokuapp.com/ws/logs/%s/" % log_channel)
msg_placeholder = "{\"message\": \"%s\"}"
ws.send(msg_placeholder % "Link Start")
def initialize(context):
ws.send(msg_placeholder % "Simulation Start")
context.lookback = 252 # Period to calculate slope and drawdown
context.max_leverage = 1.0 # Leverage
context.profit_take = 1.96 # 95% of bollinger band
context.minimum_return = 0.1 # Enter if and only if annualized slope exceeds this level
context.max_drawdown = 0.10 # Avoid if too much drawdown
context.market_impact = 0.2 # Max order is 10% of market trading volume
context.weights = {} # Slope at time of entry
context.drawdown = {} # Drawdown at time of entry
context.shares = {} # Daily target share
schedule_function(func=stop_loss, date_rule=date_rules.every_day(),
time_rule=time_rules.market_open(minutes=30))
ws.send(msg_placeholder % "Execution of stop loss scheduled at 30 minutes after market open")
schedule_function(func=regression, date_rule=date_rules.every_day(),
time_rule=time_rules.market_open(minutes=50))
ws.send(msg_placeholder % "Execution of regression computation scheduled at 50 minutes after market open")
schedule_function(func=trade, date_rule=date_rules.every_day(),
time_rule=time_rules.market_open(minutes=100))
ws.send(msg_placeholder % "Execution of transaction planner scheduled at 100 minutes after market open")
for thirty_minute_interval in range(30, 391, 30):
schedule_function(execute_transactions, date_rules.every_day(),
time_rules.market_open(minutes=thirty_minute_interval)) # execute every 30 minutes
ws.send(msg_placeholder % "Execution of transactions scheduled at every 30 minutes")
attach_pipeline(create_high_dollar_volume_pipeline(), 'top_dollar_volume')
ws.send(msg_placeholder % "High Dollar Volume pipeline filter attached")
def create_high_dollar_volume_pipeline():
pipe = Pipeline()
dollar_volume = AverageDollarVolume(window_length=63) # 63 days = 1 quarter
pipe.add(dollar_volume, 'dollar_volume')
high_dollar_volume = dollar_volume.percentile_between(95, 100) # top 5% by dollar volume
pipe.set_screen(high_dollar_volume)
return pipe
def before_trading_start(context, data):
context.pipe_output = pipeline_output('top_dollar_volume')
context.security_list = context.pipe_output.index
def regression(context, data):
prices = data.history(context.security_list, 'open', context.lookback, '1d')
X = range(len(prices))
# Add constant to ensure intercept
A = sm.add_constant(X)
for s in context.security_list:
# Price movement standard deviation
sd = prices[s].std()
# Price points to run regression
Y = prices[s].values
if np.isnan(Y).any():
continue
# y = ax + b
results = sm.OLS(Y, A).fit()
(b, a) = results.params
slope = a / Y[-1] * 252 # Daily return regression * 1 year
global dd
if slope > 0:
dd = drawdown(Y)
elif slope < 0:
dd = drawdown(-Y)
# How far are we from regression line?
delta = Y - (np.dot(a, X) + b)
slope_min = max(dd, context.minimum_return)
gain = get_gain(context, s)
# Exit
if s in context.weights and context.weights[s] != 0:
# Long but slope turns down
if context.weights[s] > 0 and slope < 0:
context.weights[s] = 0
ws.send(msg_placeholder % ('Gained %+2d%% for %s, exited from long because slope turns bull'
% (gain*100, str(s))))
# Short but slope turns up
elif context.weights[s] < 0 and slope > 0:
context.weights[s] = 0
ws.send(msg_placeholder % ('Gained %+2d%% for %s, exited from short because slope turns bear'
% (gain*100, str(s))))
# Profit take reaches top 95% bollinger band
elif delta[-1] > context.profit_take * sd and s in context.weights and context.weights[s] > 0:
context.weights[s] = 0
ws.send(msg_placeholder %
('Gained %+2d%% for %s, exited from long because profit take at top 95%% of bollinger band'
% (gain * 100, str(s))))
elif delta[-1] < -context.profit_take * sd and context.weights[s] < 0:
context.weights[s] = 0
ws.send(msg_placeholder %
('Gained %+2d%% for %s, exited from long because profit take at top 95%% of bollinger band'
% (gain * 100, str(s))))
# Enter
else:
# Trend is up and price crosses the regression line
if slope > slope_min and delta[-1] > 0 and delta[-2] < 0 and dd < context.max_drawdown:
context.weights[s] = slope
context.drawdown[s] = slope_min
ws.send(msg_placeholder %
('Bought %s because trend is up and price crosses regression line' % (str(s))))
# Trend is down and price crosses the regression line
if slope < -slope_min and delta[-1] < 0 and delta[-2] > 0 and dd < context.max_drawdown:
context.weights[s] = slope
context.drawdown[s] = slope_min
ws.send(msg_placeholder %
('Shorted %s because trend is down and price crosses regression line' % (str(s))))
def execute_transactions(context, data):
open_orders = get_open_orders()
for s in context.shares:
if not data.can_trade(s) or s in open_orders:
continue
pct_shares = context.shares[s]
order_target_percent(s, pct_shares)
def trade(context, data):
weights = context.weights
positions = sum(weights[weight] != 0 for weight in weights)
held_positions = [p for p in context.portfolio.positions if context.portfolio.positions[p].amount != 0]
context.securities = context.security_list.tolist() + held_positions
for security in context.securities:
if security not in weights:
context.shares.pop(security, 0)
context.drawdown.pop(security, 0)
elif weights[security] == 0:
context.shares.pop(security, 0)
context.drawdown.pop(security, 0)
elif weights[security] > 0:
context.shares[security] = context.max_leverage / positions
elif weights[security] < 0:
context.shares[security] = -(context.max_leverage / positions)
def stop_loss(context, data):
prices = data.history(list(context.portfolio.positions), 'price', context.lookback, '1d')
for s in context.portfolio.positions:
if s not in context.weights or context.weights[s] == 0:
context.shares[s] = 0
continue
if s not in prices or s in get_open_orders():
continue
gain = get_gain(context, s)
if context.portfolio.positions[s].amount > 0 and drawdown(prices[s].values) > context.drawdown[s]:
context.weights[s] = 0
context.shares[s] = 0 # stop loss
ws.send(msg_placeholder %
('Exited from long because of stop loss with change of %+2d%% for %s,'
% (gain * 100, str(s))))
elif context.portfolio.positions[s].amount < 0 and drawdown(- prices[s].values) > context.drawdown[s]:
context.weights[s] = 0
context.shares[s] = 0
ws.send(msg_placeholder %
('Exited from short because of stop loss with change of %+2d%% for %s,'
% (gain * 100, str(s))))
def drawdown(xs):
if len(xs) == 0:
return 0
period_end = np.argmax(np.maximum.accumulate(xs) - xs)
if len(xs[:period_end]) == 0:
return 0
period_start = np.argmax(xs[:period_end])
return abs((xs[period_start] - xs[period_end]) / xs[period_end])
def get_gain(context, s):
gain = 0
if s in context.portfolio.positions:
cost = context.portfolio.positions[s].cost_basis
amount = context.portfolio.positions[s].amount
price = context.portfolio.positions[s].last_sale_price
if cost == 0:
return 0
if amount > 0:
gain = price / cost - 1
elif amount < 0:
gain = 1 - price / cost
return gain
start = pd.to_datetime(start_date).tz_localize('US/Eastern')
end = pd.to_datetime(end_date).tz_localize('US/Eastern')
result = run_algorithm(start, end,
initialize=initialize, before_trading_start=before_trading_start,
capital_base=capital_base,
bundle="quandl")
ws.send(msg_placeholder % "Simulation End")
ws.send(msg_placeholder % "Fetching backtest results from Redis Queue...")
result.dropna(inplace=True)
ws.close()
return create_json_response(result)
| [
1,
396,
796,
29875,
572,
457,
3450,
13,
3166,
503,
29875,
572,
457,
29889,
2754,
1053,
10641,
29918,
13096,
5570,
29892,
16439,
29918,
4905,
29892,
20410,
29918,
2220,
29892,
679,
29918,
3150,
29918,
20488,
29892,
1797,
29918,
5182,
29918,
25376,
13,
3166,
503,
29875,
572,
457,
29889,
13096,
5570,
1053,
349,
23828,
13,
3166,
503,
29875,
572,
457,
29889,
13239,
29889,
13604,
1053,
2635,
29918,
19238,
29892,
931,
29918,
19238,
13,
3166,
503,
29875,
572,
457,
29889,
13096,
5570,
29889,
17028,
943,
1053,
319,
19698,
29928,
26810,
24679,
13,
3166,
503,
29875,
572,
457,
1053,
1065,
29918,
20567,
13,
13,
29937,
3630,
3515,
13,
5215,
12655,
408,
7442,
13,
5215,
11701,
408,
10518,
13,
5215,
22663,
9794,
29889,
2754,
408,
1560,
13,
13,
29937,
4522,
3460,
13,
3166,
1856,
11514,
1053,
1653,
29918,
9965,
13,
13,
29937,
3630,
3515,
304,
4663,
13,
3166,
6317,
2754,
29889,
3258,
29918,
5327,
1053,
1653,
29918,
3126,
29918,
5327,
13,
13,
13,
1753,
534,
355,
29918,
23031,
29918,
3389,
29898,
2962,
29918,
1256,
29892,
1095,
29918,
1256,
29892,
7483,
29918,
3188,
29892,
1480,
29918,
12719,
1125,
13,
13,
1678,
16904,
353,
1653,
29918,
9965,
703,
5652,
597,
19712,
23830,
13076,
29889,
2276,
9154,
932,
29889,
510,
29914,
5652,
29914,
20756,
22584,
29879,
12975,
1273,
1480,
29918,
12719,
29897,
13,
1678,
10191,
29918,
27074,
353,
376,
741,
29908,
4906,
16203,
13218,
29995,
29879,
5931,
5038,
13,
13,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
6595,
7370,
1159,
13,
13,
1678,
822,
11905,
29898,
4703,
1125,
13,
13,
4706,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
8942,
2785,
7370,
1159,
13,
13,
4706,
3030,
29889,
6914,
1627,
353,
29871,
29906,
29945,
29906,
4706,
396,
29498,
304,
8147,
24968,
322,
4216,
3204,
13,
4706,
3030,
29889,
3317,
29918,
280,
19698,
353,
29871,
29896,
29889,
29900,
1678,
396,
951,
19698,
13,
4706,
3030,
29889,
771,
9202,
29918,
19730,
353,
29871,
29896,
29889,
29929,
29953,
1678,
396,
29871,
29929,
29945,
29995,
310,
15772,
1847,
261,
3719,
13,
4706,
3030,
29889,
1195,
12539,
29918,
2457,
353,
29871,
29900,
29889,
29896,
29871,
396,
9041,
565,
322,
871,
565,
17568,
1891,
24968,
13461,
29879,
445,
3233,
13,
4706,
3030,
29889,
3317,
29918,
4012,
3204,
353,
29871,
29900,
29889,
29896,
29900,
259,
396,
319,
5405,
565,
2086,
1568,
4216,
3204,
13,
4706,
3030,
29889,
28549,
29918,
6574,
627,
353,
29871,
29900,
29889,
29906,
259,
396,
5918,
1797,
338,
29871,
29896,
29900,
29995,
310,
9999,
3534,
292,
7977,
13,
13,
4706,
3030,
29889,
705,
5861,
353,
6571,
3986,
396,
16275,
412,
472,
931,
310,
6251,
13,
4706,
3030,
29889,
4012,
3204,
353,
6571,
308,
396,
18492,
3204,
472,
931,
310,
6251,
13,
4706,
3030,
29889,
845,
5114,
353,
6571,
965,
396,
23331,
3646,
6232,
13,
13,
4706,
20410,
29918,
2220,
29898,
9891,
29922,
9847,
29918,
6758,
29892,
2635,
29918,
7491,
29922,
1256,
29918,
19238,
29889,
17991,
29918,
3250,
3285,
13,
462,
3986,
931,
29918,
7491,
29922,
2230,
29918,
19238,
29889,
28549,
29918,
3150,
29898,
1195,
2667,
29922,
29941,
29900,
876,
13,
13,
4706,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
20418,
310,
5040,
6410,
21467,
472,
29871,
29941,
29900,
6233,
1156,
9999,
1722,
1159,
13,
13,
4706,
20410,
29918,
2220,
29898,
9891,
29922,
276,
11476,
29892,
2635,
29918,
7491,
29922,
1256,
29918,
19238,
29889,
17991,
29918,
3250,
3285,
13,
462,
3986,
931,
29918,
7491,
29922,
2230,
29918,
19238,
29889,
28549,
29918,
3150,
29898,
1195,
2667,
29922,
29945,
29900,
876,
13,
13,
4706,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
20418,
310,
17855,
16287,
21467,
472,
29871,
29945,
29900,
6233,
1156,
9999,
1722,
1159,
13,
13,
4706,
20410,
29918,
2220,
29898,
9891,
29922,
3018,
311,
29892,
2635,
29918,
7491,
29922,
1256,
29918,
19238,
29889,
17991,
29918,
3250,
3285,
13,
462,
3986,
931,
29918,
7491,
29922,
2230,
29918,
19238,
29889,
28549,
29918,
3150,
29898,
1195,
2667,
29922,
29896,
29900,
29900,
876,
13,
13,
4706,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
20418,
310,
10804,
715,
7310,
21467,
472,
29871,
29896,
29900,
29900,
6233,
1156,
9999,
1722,
1159,
13,
13,
4706,
363,
17058,
29918,
1195,
1082,
29918,
19207,
297,
3464,
29898,
29941,
29900,
29892,
29871,
29941,
29929,
29896,
29892,
29871,
29941,
29900,
1125,
13,
9651,
20410,
29918,
2220,
29898,
7978,
29918,
3286,
7387,
29892,
2635,
29918,
19238,
29889,
17991,
29918,
3250,
3285,
13,
462,
795,
931,
29918,
19238,
29889,
28549,
29918,
3150,
29898,
1195,
2667,
29922,
386,
13163,
29918,
1195,
1082,
29918,
19207,
876,
29871,
396,
6222,
1432,
29871,
29941,
29900,
6233,
13,
13,
4706,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
20418,
310,
22160,
21467,
472,
1432,
29871,
29941,
29900,
6233,
1159,
13,
13,
4706,
10641,
29918,
13096,
5570,
29898,
3258,
29918,
9812,
29918,
29881,
26810,
29918,
24623,
29918,
13096,
5570,
3285,
525,
3332,
29918,
29881,
26810,
29918,
24623,
1495,
13,
13,
4706,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
16382,
360,
26810,
16934,
16439,
4175,
10959,
1159,
13,
13,
1678,
822,
1653,
29918,
9812,
29918,
29881,
26810,
29918,
24623,
29918,
13096,
5570,
7295,
13,
4706,
14282,
353,
349,
23828,
580,
13,
13,
4706,
11232,
279,
29918,
24623,
353,
319,
19698,
29928,
26810,
24679,
29898,
7165,
29918,
2848,
29922,
29953,
29941,
29897,
29871,
396,
29871,
29953,
29941,
3841,
353,
29871,
29896,
12616,
13,
4706,
14282,
29889,
1202,
29898,
29881,
26810,
29918,
24623,
29892,
525,
29881,
26810,
29918,
24623,
1495,
13,
13,
4706,
1880,
29918,
29881,
26810,
29918,
24623,
353,
11232,
279,
29918,
24623,
29889,
25376,
488,
29918,
14811,
29898,
29929,
29945,
29892,
29871,
29896,
29900,
29900,
29897,
29871,
396,
2246,
29871,
29945,
29995,
491,
11232,
279,
7977,
13,
4706,
14282,
29889,
842,
29918,
10525,
29898,
9812,
29918,
29881,
26810,
29918,
24623,
29897,
13,
13,
4706,
736,
14282,
13,
13,
1678,
822,
1434,
29918,
509,
9382,
29918,
2962,
29898,
4703,
29892,
848,
1125,
13,
4706,
3030,
29889,
17760,
29918,
4905,
353,
16439,
29918,
4905,
877,
3332,
29918,
29881,
26810,
29918,
24623,
1495,
13,
13,
4706,
3030,
29889,
8926,
29918,
1761,
353,
3030,
29889,
17760,
29918,
4905,
29889,
2248,
13,
13,
1678,
822,
17855,
29898,
4703,
29892,
848,
1125,
13,
4706,
26094,
353,
848,
29889,
18434,
29898,
4703,
29889,
8926,
29918,
1761,
29892,
525,
3150,
742,
3030,
29889,
6914,
1627,
29892,
525,
29896,
29881,
1495,
13,
13,
4706,
1060,
353,
3464,
29898,
2435,
29898,
558,
1575,
876,
13,
13,
4706,
396,
3462,
4868,
304,
9801,
23404,
13,
4706,
319,
353,
1560,
29889,
1202,
29918,
23362,
29898,
29990,
29897,
13,
13,
4706,
363,
269,
297,
3030,
29889,
8926,
29918,
1761,
29901,
13,
13,
9651,
396,
20743,
10298,
3918,
29522,
13,
9651,
28972,
353,
26094,
29961,
29879,
1822,
4172,
580,
13,
13,
9651,
396,
20743,
3291,
304,
1065,
17855,
13,
9651,
612,
353,
26094,
29961,
29879,
1822,
5975,
13,
13,
9651,
565,
7442,
29889,
275,
13707,
29898,
29979,
467,
1384,
7295,
13,
18884,
6773,
13,
13,
9651,
396,
343,
353,
4853,
718,
289,
13,
9651,
2582,
353,
1560,
29889,
5607,
29903,
29898,
29979,
29892,
319,
467,
9202,
580,
13,
9651,
313,
29890,
29892,
263,
29897,
353,
2582,
29889,
7529,
13,
13,
9651,
24968,
353,
263,
847,
612,
14352,
29896,
29962,
334,
29871,
29906,
29945,
29906,
29871,
396,
23331,
736,
17855,
334,
29871,
29896,
1629,
13,
13,
9651,
5534,
24488,
13,
13,
9651,
565,
24968,
1405,
29871,
29900,
29901,
13,
18884,
24488,
353,
4216,
3204,
29898,
29979,
29897,
13,
9651,
25342,
24968,
529,
29871,
29900,
29901,
13,
18884,
24488,
353,
4216,
3204,
6278,
29979,
29897,
13,
13,
9651,
396,
1128,
2215,
526,
591,
515,
17855,
1196,
29973,
13,
9651,
19471,
353,
612,
448,
313,
9302,
29889,
6333,
29898,
29874,
29892,
1060,
29897,
718,
289,
29897,
13,
13,
9651,
24968,
29918,
1195,
353,
4236,
29898,
1289,
29892,
3030,
29889,
1195,
12539,
29918,
2457,
29897,
13,
13,
9651,
11581,
353,
679,
29918,
29887,
475,
29898,
4703,
29892,
269,
29897,
13,
13,
9651,
396,
25954,
13,
9651,
565,
269,
297,
3030,
29889,
705,
5861,
322,
3030,
29889,
705,
5861,
29961,
29879,
29962,
2804,
29871,
29900,
29901,
13,
13,
18884,
396,
6242,
541,
24968,
12169,
1623,
13,
18884,
565,
3030,
29889,
705,
5861,
29961,
29879,
29962,
1405,
29871,
29900,
322,
24968,
529,
29871,
29900,
29901,
13,
462,
1678,
3030,
29889,
705,
5861,
29961,
29879,
29962,
353,
29871,
29900,
13,
462,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
6702,
29954,
7114,
1273,
29974,
29906,
29881,
7686,
363,
1273,
29879,
29892,
429,
1573,
515,
1472,
1363,
24968,
12169,
289,
913,
29915,
13,
462,
462,
1669,
1273,
313,
29887,
475,
29930,
29896,
29900,
29900,
29892,
851,
29898,
29879,
13697,
13,
13,
18884,
396,
13899,
541,
24968,
12169,
701,
13,
18884,
25342,
3030,
29889,
705,
5861,
29961,
29879,
29962,
529,
29871,
29900,
322,
24968,
1405,
29871,
29900,
29901,
13,
462,
1678,
3030,
29889,
705,
5861,
29961,
29879,
29962,
353,
29871,
29900,
13,
462,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
6702,
29954,
7114,
1273,
29974,
29906,
29881,
7686,
363,
1273,
29879,
29892,
429,
1573,
515,
3273,
1363,
24968,
12169,
11460,
29915,
13,
462,
462,
1669,
1273,
313,
29887,
475,
29930,
29896,
29900,
29900,
29892,
851,
29898,
29879,
13697,
13,
13,
18884,
396,
6175,
277,
2125,
22170,
2246,
29871,
29929,
29945,
29995,
15772,
1847,
261,
3719,
13,
18884,
25342,
19471,
14352,
29896,
29962,
1405,
3030,
29889,
771,
9202,
29918,
19730,
334,
28972,
322,
269,
297,
3030,
29889,
705,
5861,
322,
3030,
29889,
705,
5861,
29961,
29879,
29962,
1405,
29871,
29900,
29901,
13,
462,
1678,
3030,
29889,
705,
5861,
29961,
29879,
29962,
353,
29871,
29900,
13,
462,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
13,
462,
9651,
6702,
29954,
7114,
1273,
29974,
29906,
29881,
7686,
363,
1273,
29879,
29892,
429,
1573,
515,
1472,
1363,
21665,
2125,
472,
2246,
29871,
29929,
29945,
7686,
310,
15772,
1847,
261,
3719,
29915,
13,
462,
632,
1273,
313,
29887,
475,
334,
29871,
29896,
29900,
29900,
29892,
851,
29898,
29879,
13697,
13,
13,
18884,
25342,
19471,
14352,
29896,
29962,
529,
448,
4703,
29889,
771,
9202,
29918,
19730,
334,
28972,
322,
3030,
29889,
705,
5861,
29961,
29879,
29962,
529,
29871,
29900,
29901,
13,
462,
1678,
3030,
29889,
705,
5861,
29961,
29879,
29962,
353,
29871,
29900,
13,
462,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
13,
462,
9651,
6702,
29954,
7114,
1273,
29974,
29906,
29881,
7686,
363,
1273,
29879,
29892,
429,
1573,
515,
1472,
1363,
21665,
2125,
472,
2246,
29871,
29929,
29945,
7686,
310,
15772,
1847,
261,
3719,
29915,
13,
462,
632,
1273,
313,
29887,
475,
334,
29871,
29896,
29900,
29900,
29892,
851,
29898,
29879,
13697,
13,
13,
9651,
396,
9041,
13,
9651,
1683,
29901,
13,
13,
18884,
396,
1605,
355,
338,
701,
322,
8666,
4891,
267,
278,
17855,
1196,
13,
18884,
565,
24968,
1405,
24968,
29918,
1195,
322,
19471,
14352,
29896,
29962,
1405,
29871,
29900,
322,
19471,
14352,
29906,
29962,
529,
29871,
29900,
322,
24488,
529,
3030,
29889,
3317,
29918,
4012,
3204,
29901,
13,
462,
1678,
3030,
29889,
705,
5861,
29961,
29879,
29962,
353,
24968,
13,
462,
1678,
3030,
29889,
4012,
3204,
29961,
29879,
29962,
353,
24968,
29918,
1195,
13,
13,
462,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
13,
462,
9651,
6702,
29933,
1774,
1273,
29879,
1363,
534,
355,
338,
701,
322,
8666,
4891,
267,
17855,
1196,
29915,
1273,
313,
710,
29898,
29879,
13697,
13,
13,
18884,
396,
1605,
355,
338,
1623,
322,
8666,
4891,
267,
278,
17855,
1196,
13,
18884,
565,
24968,
529,
448,
29879,
417,
412,
29918,
1195,
322,
19471,
14352,
29896,
29962,
529,
29871,
29900,
322,
19471,
14352,
29906,
29962,
1405,
29871,
29900,
29871,
322,
24488,
529,
3030,
29889,
3317,
29918,
4012,
3204,
29901,
13,
462,
1678,
3030,
29889,
705,
5861,
29961,
29879,
29962,
353,
24968,
13,
462,
1678,
3030,
29889,
4012,
3204,
29961,
29879,
29962,
353,
24968,
29918,
1195,
13,
13,
462,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
13,
462,
9651,
6702,
2713,
18054,
1273,
29879,
1363,
534,
355,
338,
1623,
322,
8666,
4891,
267,
17855,
1196,
29915,
1273,
313,
710,
29898,
29879,
13697,
13,
13,
1678,
822,
6222,
29918,
3286,
7387,
29898,
4703,
29892,
848,
1125,
13,
4706,
1722,
29918,
20488,
353,
679,
29918,
3150,
29918,
20488,
580,
13,
13,
4706,
363,
269,
297,
3030,
29889,
845,
5114,
29901,
13,
9651,
565,
451,
848,
29889,
3068,
29918,
3018,
311,
29898,
29879,
29897,
470,
269,
297,
1722,
29918,
20488,
29901,
13,
18884,
6773,
13,
13,
9651,
282,
312,
29918,
845,
5114,
353,
3030,
29889,
845,
5114,
29961,
29879,
29962,
13,
13,
9651,
1797,
29918,
5182,
29918,
25376,
29898,
29879,
29892,
282,
312,
29918,
845,
5114,
29897,
13,
13,
1678,
822,
11302,
29898,
4703,
29892,
848,
1125,
13,
4706,
18177,
353,
3030,
29889,
705,
5861,
13,
13,
4706,
11909,
353,
2533,
29898,
705,
5861,
29961,
7915,
29962,
2804,
29871,
29900,
363,
7688,
297,
18177,
29897,
13,
4706,
4934,
29918,
1066,
2187,
353,
518,
29886,
363,
282,
297,
3030,
29889,
637,
25648,
29889,
1066,
2187,
565,
3030,
29889,
637,
25648,
29889,
1066,
2187,
29961,
29886,
1822,
14506,
2804,
29871,
29900,
29962,
13,
13,
4706,
3030,
29889,
344,
2764,
1907,
353,
3030,
29889,
8926,
29918,
1761,
29889,
25027,
391,
580,
718,
4934,
29918,
1066,
2187,
13,
13,
4706,
363,
6993,
297,
3030,
29889,
344,
2764,
1907,
29901,
13,
13,
9651,
565,
6993,
451,
297,
18177,
29901,
13,
18884,
3030,
29889,
845,
5114,
29889,
7323,
29898,
8926,
29892,
29871,
29900,
29897,
13,
18884,
3030,
29889,
4012,
3204,
29889,
7323,
29898,
8926,
29892,
29871,
29900,
29897,
13,
13,
9651,
25342,
18177,
29961,
8926,
29962,
1275,
29871,
29900,
29901,
13,
18884,
3030,
29889,
845,
5114,
29889,
7323,
29898,
8926,
29892,
29871,
29900,
29897,
13,
18884,
3030,
29889,
4012,
3204,
29889,
7323,
29898,
8926,
29892,
29871,
29900,
29897,
13,
13,
9651,
25342,
18177,
29961,
8926,
29962,
1405,
29871,
29900,
29901,
13,
18884,
3030,
29889,
845,
5114,
29961,
8926,
29962,
353,
3030,
29889,
3317,
29918,
280,
19698,
847,
11909,
13,
13,
9651,
25342,
18177,
29961,
8926,
29962,
529,
29871,
29900,
29901,
13,
18884,
3030,
29889,
845,
5114,
29961,
8926,
29962,
353,
19691,
4703,
29889,
3317,
29918,
280,
19698,
847,
11909,
29897,
13,
13,
1678,
822,
5040,
29918,
6758,
29898,
4703,
29892,
848,
1125,
13,
13,
4706,
26094,
353,
848,
29889,
18434,
29898,
1761,
29898,
4703,
29889,
637,
25648,
29889,
1066,
2187,
511,
525,
9175,
742,
3030,
29889,
6914,
1627,
29892,
525,
29896,
29881,
1495,
13,
13,
4706,
363,
269,
297,
3030,
29889,
637,
25648,
29889,
1066,
2187,
29901,
13,
13,
9651,
565,
269,
451,
297,
3030,
29889,
705,
5861,
470,
3030,
29889,
705,
5861,
29961,
29879,
29962,
1275,
29871,
29900,
29901,
13,
18884,
3030,
29889,
845,
5114,
29961,
29879,
29962,
353,
29871,
29900,
13,
18884,
6773,
13,
13,
9651,
565,
269,
451,
297,
26094,
470,
269,
297,
679,
29918,
3150,
29918,
20488,
7295,
13,
18884,
6773,
13,
13,
9651,
11581,
353,
679,
29918,
29887,
475,
29898,
4703,
29892,
269,
29897,
13,
13,
9651,
565,
3030,
29889,
637,
25648,
29889,
1066,
2187,
29961,
29879,
1822,
14506,
1405,
29871,
29900,
322,
4216,
3204,
29898,
558,
1575,
29961,
29879,
1822,
5975,
29897,
1405,
3030,
29889,
4012,
3204,
29961,
29879,
5387,
13,
18884,
3030,
29889,
705,
5861,
29961,
29879,
29962,
353,
29871,
29900,
13,
18884,
3030,
29889,
845,
5114,
29961,
29879,
29962,
353,
29871,
29900,
29871,
396,
5040,
6410,
13,
13,
18884,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
13,
462,
4706,
6702,
1252,
1573,
515,
1472,
1363,
310,
5040,
6410,
411,
1735,
310,
1273,
29974,
29906,
29881,
7686,
363,
1273,
29879,
5501,
13,
462,
308,
1273,
313,
29887,
475,
334,
29871,
29896,
29900,
29900,
29892,
851,
29898,
29879,
13697,
13,
13,
9651,
25342,
3030,
29889,
637,
25648,
29889,
1066,
2187,
29961,
29879,
1822,
14506,
529,
29871,
29900,
322,
4216,
3204,
6278,
26094,
29961,
29879,
1822,
5975,
29897,
1405,
3030,
29889,
4012,
3204,
29961,
29879,
5387,
13,
18884,
3030,
29889,
705,
5861,
29961,
29879,
29962,
353,
29871,
29900,
13,
18884,
3030,
29889,
845,
5114,
29961,
29879,
29962,
353,
29871,
29900,
13,
13,
18884,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
13,
462,
4706,
6702,
1252,
1573,
515,
3273,
1363,
310,
5040,
6410,
411,
1735,
310,
1273,
29974,
29906,
29881,
7686,
363,
1273,
29879,
5501,
13,
462,
308,
1273,
313,
29887,
475,
334,
29871,
29896,
29900,
29900,
29892,
851,
29898,
29879,
13697,
13,
13,
1678,
822,
4216,
3204,
29898,
10351,
1125,
13,
4706,
565,
7431,
29898,
10351,
29897,
1275,
29871,
29900,
29901,
13,
9651,
736,
29871,
29900,
13,
13,
4706,
3785,
29918,
355,
353,
7442,
29889,
1191,
3317,
29898,
9302,
29889,
27525,
398,
29889,
5753,
398,
5987,
29898,
10351,
29897,
448,
14492,
29897,
13,
13,
4706,
565,
7431,
29898,
10351,
7503,
19145,
29918,
355,
2314,
1275,
29871,
29900,
29901,
13,
9651,
736,
29871,
29900,
13,
13,
4706,
3785,
29918,
2962,
353,
7442,
29889,
1191,
3317,
29898,
10351,
7503,
19145,
29918,
355,
2314,
13,
4706,
736,
6425,
3552,
10351,
29961,
19145,
29918,
2962,
29962,
448,
14492,
29961,
19145,
29918,
355,
2314,
847,
14492,
29961,
19145,
29918,
355,
2314,
13,
13,
1678,
822,
679,
29918,
29887,
475,
29898,
4703,
29892,
269,
1125,
13,
13,
4706,
11581,
353,
29871,
29900,
13,
13,
4706,
565,
269,
297,
3030,
29889,
637,
25648,
29889,
1066,
2187,
29901,
13,
9651,
3438,
353,
3030,
29889,
637,
25648,
29889,
1066,
2187,
29961,
29879,
1822,
18253,
29918,
6500,
275,
13,
9651,
5253,
353,
3030,
29889,
637,
25648,
29889,
1066,
2187,
29961,
29879,
1822,
14506,
13,
9651,
8666,
353,
3030,
29889,
637,
25648,
29889,
1066,
2187,
29961,
29879,
1822,
4230,
29918,
29879,
744,
29918,
9175,
13,
13,
9651,
565,
3438,
1275,
29871,
29900,
29901,
13,
18884,
736,
29871,
29900,
13,
13,
9651,
565,
5253,
1405,
29871,
29900,
29901,
13,
18884,
11581,
353,
8666,
847,
3438,
448,
29871,
29896,
13,
13,
9651,
25342,
5253,
529,
29871,
29900,
29901,
13,
18884,
11581,
353,
29871,
29896,
448,
8666,
847,
3438,
13,
13,
4706,
736,
11581,
13,
13,
1678,
1369,
353,
10518,
29889,
517,
29918,
12673,
29898,
2962,
29918,
1256,
467,
17559,
29918,
2997,
675,
877,
3308,
29914,
29923,
11530,
1495,
13,
1678,
1095,
353,
10518,
29889,
517,
29918,
12673,
29898,
355,
29918,
1256,
467,
17559,
29918,
2997,
675,
877,
3308,
29914,
29923,
11530,
1495,
13,
13,
1678,
1121,
353,
1065,
29918,
20567,
29898,
2962,
29892,
1095,
29892,
13,
462,
965,
11905,
29922,
24926,
29892,
1434,
29918,
509,
9382,
29918,
2962,
29922,
11083,
29918,
509,
9382,
29918,
2962,
29892,
13,
462,
965,
7483,
29918,
3188,
29922,
5030,
2410,
29918,
3188,
29892,
13,
462,
965,
11846,
543,
339,
392,
29880,
1159,
13,
13,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
8942,
2785,
2796,
1159,
13,
1678,
16904,
29889,
6717,
29898,
7645,
29918,
27074,
1273,
376,
20927,
292,
1250,
1688,
2582,
515,
4367,
275,
5462,
434,
856,
1159,
13,
13,
1678,
1121,
29889,
8865,
1056,
29898,
262,
6689,
29922,
5574,
29897,
13,
1678,
16904,
29889,
5358,
580,
13,
13,
1678,
736,
1653,
29918,
3126,
29918,
5327,
29898,
2914,
29897,
13,
13,
2
] |
paper/F3/D_fixed_points.py | FedeClaudi/manyfolds | 3 | 36632 | <reponame>FedeClaudi/manyfolds<filename>paper/F3/D_fixed_points.py
import sys
import numpy as np
sys.path.append("./")
from vedo import screenshot
from vedo.shapes import Tube
from myterial import salmon
from manifold import embeddings, Plane
from manifold.visualize import Visualizer
from manifold import visualize
from manifold.rnn import RNN
"""
3D viisualization of an RNN's dynamics over time fitted
to the plane with a single fixed point attractor
at the center.
"""
visualize.reco_surface_radius = 0.5
visualize.point_size = 0.03
visualize.tangent_vector_radius = 0.015
visualize.rnn_trace_alpha = 0.62
N = 64
K = 12
def vfield(point):
# fixed point at center
p0, p1 = point.coordinates
return ((0.5 - p0) * 3, (0.5 - p1) * 3)
M = Plane(embeddings.plane_to_rn_flat, n_sample_points=12)
M.vectors_field = vfield
# fit and run RNN
rnn = RNN(M, n_units=N)
rnn.build_W(k=K, scale=1)
rnn.run_points(n_seconds=60, cut=False)
# visualize vector field
viz = Visualizer(M, rnn=None, axes=0, manifold_alpha=1, pca_sample_points=100)
cam = dict(
pos=(-7.84, -8.65, 3.76),
focalPoint=(2.38e-7, 0, 1.49),
viewup=(0.0954, 0.171, 0.981),
distance=11.9,
clippingRange=(6.02, 19.3),
)
for trace in rnn.traces:
trace_pc = viz.pca.transform(trace.trace)
coords = trace_pc.copy()
coords[:, 2] = np.linspace(0, 3, len(coords))
tube = Tube(coords, c=salmon, r=0.01, alpha=1)
viz.actors.append(tube)
viz._add_silhouette(tube)
# show vector field
viz.show(scale=0.15, show_points=True, camera=cam)
screenshot(f"./paper/images/3D_vfield_.png")
| [
1,
529,
276,
1112,
420,
29958,
29943,
2742,
20216,
4749,
29914,
13011,
29888,
3361,
29966,
9507,
29958,
19773,
29914,
29943,
29941,
29914,
29928,
29918,
20227,
29918,
9748,
29889,
2272,
13,
5215,
10876,
13,
5215,
12655,
408,
7442,
13,
13,
9675,
29889,
2084,
29889,
4397,
703,
6904,
1159,
13,
3166,
11016,
29877,
1053,
17286,
13,
3166,
11016,
29877,
29889,
845,
11603,
1053,
323,
4003,
13,
13,
3166,
590,
357,
616,
1053,
4497,
3712,
13,
13,
3166,
25941,
1053,
8297,
29881,
886,
29892,
1858,
1662,
13,
3166,
25941,
29889,
20119,
675,
1053,
9249,
3950,
13,
3166,
25941,
1053,
7604,
675,
13,
3166,
25941,
29889,
29878,
15755,
1053,
390,
10262,
13,
13,
13,
15945,
29908,
13,
268,
29941,
29928,
3516,
275,
950,
2133,
310,
385,
390,
10262,
29915,
29879,
19753,
975,
931,
25890,
13,
1678,
304,
278,
10694,
411,
263,
2323,
4343,
1298,
13978,
272,
13,
1678,
472,
278,
4818,
29889,
13,
15945,
29908,
13,
13,
20119,
675,
29889,
276,
1111,
29918,
7610,
2161,
29918,
13471,
353,
29871,
29900,
29889,
29945,
13,
20119,
675,
29889,
3149,
29918,
2311,
353,
29871,
29900,
29889,
29900,
29941,
13,
20119,
675,
29889,
29873,
574,
296,
29918,
8111,
29918,
13471,
353,
29871,
29900,
29889,
29900,
29896,
29945,
13,
20119,
675,
29889,
29878,
15755,
29918,
15003,
29918,
2312,
353,
29871,
29900,
29889,
29953,
29906,
13,
13,
13,
29940,
353,
29871,
29953,
29946,
13,
29968,
353,
29871,
29896,
29906,
13,
13,
13,
1753,
325,
2671,
29898,
3149,
1125,
13,
1678,
396,
4343,
1298,
472,
4818,
13,
1678,
282,
29900,
29892,
282,
29896,
353,
1298,
29889,
1111,
24266,
13,
1678,
736,
5135,
29900,
29889,
29945,
448,
282,
29900,
29897,
334,
29871,
29941,
29892,
313,
29900,
29889,
29945,
448,
282,
29896,
29897,
334,
29871,
29941,
29897,
13,
13,
13,
29924,
353,
1858,
1662,
29898,
17987,
29881,
886,
29889,
22116,
29918,
517,
29918,
27539,
29918,
20620,
29892,
302,
29918,
11249,
29918,
9748,
29922,
29896,
29906,
29897,
13,
29924,
29889,
345,
14359,
29918,
2671,
353,
325,
2671,
13,
13,
13,
29937,
6216,
322,
1065,
390,
10262,
13,
29878,
15755,
353,
390,
10262,
29898,
29924,
29892,
302,
29918,
348,
1169,
29922,
29940,
29897,
13,
29878,
15755,
29889,
4282,
29918,
29956,
29898,
29895,
29922,
29968,
29892,
6287,
29922,
29896,
29897,
13,
29878,
15755,
29889,
3389,
29918,
9748,
29898,
29876,
29918,
23128,
29922,
29953,
29900,
29892,
5700,
29922,
8824,
29897,
13,
13,
13,
29937,
7604,
675,
4608,
1746,
13,
29894,
466,
353,
9249,
3950,
29898,
29924,
29892,
364,
15755,
29922,
8516,
29892,
27815,
29922,
29900,
29892,
25941,
29918,
2312,
29922,
29896,
29892,
282,
1113,
29918,
11249,
29918,
9748,
29922,
29896,
29900,
29900,
29897,
13,
11108,
353,
9657,
29898,
13,
1678,
926,
29922,
6278,
29955,
29889,
29947,
29946,
29892,
448,
29947,
29889,
29953,
29945,
29892,
29871,
29941,
29889,
29955,
29953,
511,
13,
1678,
12789,
284,
5228,
7607,
29906,
29889,
29941,
29947,
29872,
29899,
29955,
29892,
29871,
29900,
29892,
29871,
29896,
29889,
29946,
29929,
511,
13,
1678,
1776,
786,
7607,
29900,
29889,
29900,
29929,
29945,
29946,
29892,
29871,
29900,
29889,
29896,
29955,
29896,
29892,
29871,
29900,
29889,
29929,
29947,
29896,
511,
13,
1678,
5418,
29922,
29896,
29896,
29889,
29929,
29892,
13,
1678,
9335,
3262,
6069,
7607,
29953,
29889,
29900,
29906,
29892,
29871,
29896,
29929,
29889,
29941,
511,
13,
29897,
13,
13,
1454,
9637,
297,
364,
15755,
29889,
3018,
778,
29901,
13,
1678,
9637,
29918,
6739,
353,
25294,
29889,
29886,
1113,
29889,
9067,
29898,
15003,
29889,
15003,
29897,
13,
1678,
1302,
4339,
353,
9637,
29918,
6739,
29889,
8552,
580,
13,
1678,
1302,
4339,
7503,
29892,
29871,
29906,
29962,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
29871,
29941,
29892,
7431,
29898,
1111,
4339,
876,
13,
1678,
260,
4003,
353,
323,
4003,
29898,
1111,
4339,
29892,
274,
29922,
19585,
3712,
29892,
364,
29922,
29900,
29889,
29900,
29896,
29892,
15595,
29922,
29896,
29897,
13,
1678,
25294,
29889,
627,
943,
29889,
4397,
29898,
29873,
4003,
29897,
13,
1678,
25294,
3032,
1202,
29918,
25590,
10774,
2353,
29898,
29873,
4003,
29897,
13,
13,
29937,
1510,
4608,
1746,
13,
29894,
466,
29889,
4294,
29898,
7052,
29922,
29900,
29889,
29896,
29945,
29892,
1510,
29918,
9748,
29922,
5574,
29892,
10656,
29922,
11108,
29897,
13,
29879,
24546,
8711,
29898,
29888,
1642,
29914,
19773,
29914,
8346,
29914,
29941,
29928,
29918,
29894,
2671,
5396,
2732,
1159,
13,
2
] |
database/models.py | SebastjanLeskovar/thundergames | 0 | 60535 | <reponame>SebastjanLeskovar/thundergames
from django.db import models
from django.urls import reverse
class TimeStampedModel(models.Model):
"""An abstract base class model that provides self-updating 'created' and 'modified' fields.
"""
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
class MainGenre(TimeStampedModel):
"""Model to create MainGenre objects."""
name = models.CharField("Name", max_length=50)
image = models.ImageField("Image", upload_to='main_genre', blank=True, default='default.png')
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('database:main-genre', kwargs={'pk': self.pk})
class Subgenre(TimeStampedModel):
"""Model to create Subgenre objects."""
name = models.CharField("Name", max_length=50)
main_genre = models.ForeignKey(MainGenre, verbose_name="main genre", on_delete=models.SET("Please select main genre."))
image = models.ImageField("Image", upload_to='subgenre', blank=True, default='default.png')
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('database:subgenre', kwargs={'pk': self.pk})
class Game(TimeStampedModel):
"""Model to create Game objects."""
name = models.CharField("Name", max_length=50)
main_genre = models.ForeignKey(MainGenre, verbose_name="main genre", blank=True, on_delete=models.SET("Please select main genre."))
subgenres = models.ManyToManyField(Subgenre, verbose_name="Subgenre", blank=True)
image = models.ImageField("Image", upload_to='game', blank=True, default='default.png')
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('database:game', kwargs={'pk': self.pk})
| [
1,
529,
276,
1112,
420,
29958,
29903,
774,
579,
8931,
29931,
8488,
586,
279,
29914,
386,
5062,
29887,
1280,
13,
3166,
9557,
29889,
2585,
1053,
4733,
13,
3166,
9557,
29889,
26045,
1053,
11837,
13,
13,
1990,
5974,
855,
1160,
287,
3195,
29898,
9794,
29889,
3195,
1125,
13,
1678,
9995,
2744,
9846,
2967,
770,
1904,
393,
8128,
1583,
29899,
786,
26747,
525,
11600,
29915,
322,
525,
1545,
2164,
29915,
4235,
29889,
13,
1678,
9995,
13,
1678,
2825,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29918,
1202,
29922,
5574,
29897,
13,
1678,
9120,
353,
4733,
29889,
11384,
3073,
29898,
6921,
29918,
3707,
29922,
5574,
29897,
13,
13,
13,
1990,
4241,
15462,
276,
29898,
2481,
855,
1160,
287,
3195,
1125,
13,
1678,
9995,
3195,
304,
1653,
4241,
15462,
276,
3618,
1213,
15945,
13,
1678,
1024,
353,
4733,
29889,
27890,
703,
1170,
613,
4236,
29918,
2848,
29922,
29945,
29900,
29897,
13,
1678,
1967,
353,
4733,
29889,
2940,
3073,
703,
2940,
613,
6441,
29918,
517,
2433,
3396,
29918,
1885,
276,
742,
9654,
29922,
5574,
29892,
2322,
2433,
4381,
29889,
2732,
1495,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
978,
13,
13,
1678,
822,
679,
29918,
23552,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
877,
9803,
29901,
3396,
29899,
1885,
276,
742,
9049,
5085,
3790,
29915,
20571,
2396,
1583,
29889,
20571,
1800,
13,
13,
1990,
3323,
1885,
276,
29898,
2481,
855,
1160,
287,
3195,
1125,
13,
1678,
9995,
3195,
304,
1653,
3323,
1885,
276,
3618,
1213,
15945,
13,
1678,
1024,
353,
4733,
29889,
27890,
703,
1170,
613,
4236,
29918,
2848,
29922,
29945,
29900,
29897,
13,
1678,
1667,
29918,
1885,
276,
353,
4733,
29889,
27755,
2558,
29898,
6330,
15462,
276,
29892,
26952,
29918,
978,
543,
3396,
16151,
613,
373,
29918,
8143,
29922,
9794,
29889,
10490,
703,
12148,
1831,
1667,
16151,
1213,
876,
13,
1678,
1967,
353,
4733,
29889,
2940,
3073,
703,
2940,
613,
6441,
29918,
517,
2433,
1491,
1885,
276,
742,
9654,
29922,
5574,
29892,
2322,
2433,
4381,
29889,
2732,
1495,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
978,
13,
13,
1678,
822,
679,
29918,
23552,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
877,
9803,
29901,
1491,
1885,
276,
742,
9049,
5085,
3790,
29915,
20571,
2396,
1583,
29889,
20571,
1800,
13,
13,
13,
1990,
8448,
29898,
2481,
855,
1160,
287,
3195,
1125,
13,
1678,
9995,
3195,
304,
1653,
8448,
3618,
1213,
15945,
13,
1678,
1024,
353,
4733,
29889,
27890,
703,
1170,
613,
4236,
29918,
2848,
29922,
29945,
29900,
29897,
13,
1678,
1667,
29918,
1885,
276,
353,
4733,
29889,
27755,
2558,
29898,
6330,
15462,
276,
29892,
26952,
29918,
978,
543,
3396,
16151,
613,
9654,
29922,
5574,
29892,
373,
29918,
8143,
29922,
9794,
29889,
10490,
703,
12148,
1831,
1667,
16151,
1213,
876,
13,
1678,
1014,
1885,
690,
353,
4733,
29889,
14804,
1762,
14804,
3073,
29898,
4035,
1885,
276,
29892,
26952,
29918,
978,
543,
4035,
1885,
276,
613,
9654,
29922,
5574,
29897,
13,
1678,
1967,
353,
4733,
29889,
2940,
3073,
703,
2940,
613,
6441,
29918,
517,
2433,
11802,
742,
9654,
29922,
5574,
29892,
2322,
2433,
4381,
29889,
2732,
1495,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
978,
13,
13,
1678,
822,
679,
29918,
23552,
29918,
2271,
29898,
1311,
1125,
13,
4706,
736,
11837,
877,
9803,
29901,
11802,
742,
9049,
5085,
3790,
29915,
20571,
2396,
1583,
29889,
20571,
1800,
13,
2
] |
chibi_django/snippet/url.py | dem4ply/chibi_django | 0 | 111943 | <reponame>dem4ply/chibi_django<gh_stars>0
def show_urls( urllist, depth=0 ):
for entry in urllist:
if ( hasattr( entry, 'namespace' ) ):
print( "\t" * depth, entry.pattern.regex.pattern,
"[%s]" % entry.namespace )
else:
print( "\t" * depth, entry.pattern.regex.pattern,
"[%s]" % entry.name )
if hasattr( entry, 'url_patterns' ):
show_urls( entry.url_patterns, depth + 1 )
| [
1,
529,
276,
1112,
420,
29958,
2310,
29946,
17632,
29914,
305,
747,
29875,
29918,
14095,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
1753,
1510,
29918,
26045,
29898,
5065,
645,
391,
29892,
10809,
29922,
29900,
29871,
1125,
13,
1678,
363,
6251,
297,
5065,
645,
391,
29901,
13,
4706,
565,
313,
756,
5552,
29898,
6251,
29892,
525,
22377,
29915,
1723,
29871,
1125,
13,
9651,
1596,
29898,
6634,
29873,
29908,
334,
10809,
29892,
6251,
29889,
11037,
29889,
13087,
29889,
11037,
29892,
13,
462,
259,
14704,
29995,
29879,
18017,
1273,
6251,
29889,
22377,
1723,
13,
4706,
1683,
29901,
13,
9651,
1596,
29898,
6634,
29873,
29908,
334,
10809,
29892,
6251,
29889,
11037,
29889,
13087,
29889,
11037,
29892,
13,
462,
259,
14704,
29995,
29879,
18017,
1273,
6251,
29889,
978,
1723,
13,
4706,
565,
756,
5552,
29898,
6251,
29892,
525,
2271,
29918,
11037,
29879,
29915,
29871,
1125,
13,
9651,
1510,
29918,
26045,
29898,
6251,
29889,
2271,
29918,
11037,
29879,
29892,
10809,
718,
29871,
29896,
1723,
13,
2
] |
betterthanbackprop/feedbackLearners/learningViz/OptimTrajViz.py | conradliste/SmarterThanBackProp | 0 | 30942 | import os
import torch
import numpy as np
import torch.nn as nn
import matplotlib.pyplot as plt
def get_param_matrix(model_prefix, model_dir):
"""
Grabs the parameters of a saved model and returns them as a matrix
"""
# Load and combine the parameters
param_matrix = []
for file in os.listdir(model_dir):
if file.startswith(model_prefix):
model_path = os.path.join(model_dir, file)
state_dict = torch.load(model_path)
# Grab all params in state dict
params = [state_dict[param].data.float() for param in state_dict]
# Reshape to one long parameter vector
params = nn.utils.parameters_to_vector(params)
param_matrix.append(params.cpu().numpy())
params_matrix = np.array(param_matrix)
return params_matrix
def plot_trajectory(projected_params):
# Separate components
x = projected_params[:, 0]
y = projected_params[:, 1]
z = projected_params[:, 2]
# Creating figure
fig = plt.figure(figsize = (10, 7))
ax = plt.axes(projection ="3d")
# Creating plot
ax.scatter3D(x, y, z, color="green")
plt.title("Projected Learning Trajectory")
| [
1,
1053,
2897,
13,
5215,
4842,
305,
13,
5215,
12655,
408,
7442,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
13,
1753,
679,
29918,
3207,
29918,
5344,
29898,
4299,
29918,
13506,
29892,
1904,
29918,
3972,
1125,
13,
1678,
9995,
13,
1678,
22351,
29879,
278,
4128,
310,
263,
7160,
1904,
322,
3639,
963,
408,
263,
4636,
13,
13,
13,
1678,
9995,
13,
1678,
396,
16012,
322,
14405,
278,
4128,
13,
1678,
1828,
29918,
5344,
353,
5159,
13,
1678,
363,
934,
297,
2897,
29889,
1761,
3972,
29898,
4299,
29918,
3972,
1125,
13,
4706,
565,
934,
29889,
27382,
2541,
29898,
4299,
29918,
13506,
1125,
13,
9651,
1904,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4299,
29918,
3972,
29892,
934,
29897,
13,
9651,
2106,
29918,
8977,
353,
4842,
305,
29889,
1359,
29898,
4299,
29918,
2084,
29897,
13,
9651,
396,
22351,
599,
8636,
297,
2106,
9657,
13,
9651,
8636,
353,
518,
3859,
29918,
8977,
29961,
3207,
1822,
1272,
29889,
7411,
580,
363,
1828,
297,
2106,
29918,
8977,
29962,
259,
13,
9651,
396,
2538,
14443,
304,
697,
1472,
3443,
4608,
13,
9651,
8636,
353,
302,
29876,
29889,
13239,
29889,
16744,
29918,
517,
29918,
8111,
29898,
7529,
29897,
13,
9651,
1828,
29918,
5344,
29889,
4397,
29898,
7529,
29889,
21970,
2141,
23749,
3101,
13,
1678,
8636,
29918,
5344,
353,
7442,
29889,
2378,
29898,
3207,
29918,
5344,
29897,
13,
1678,
736,
8636,
29918,
5344,
13,
13,
1753,
6492,
29918,
3018,
622,
706,
29898,
4836,
287,
29918,
7529,
1125,
13,
1678,
396,
922,
862,
403,
7117,
13,
1678,
921,
353,
2060,
287,
29918,
7529,
7503,
29892,
29871,
29900,
29962,
13,
1678,
343,
353,
2060,
287,
29918,
7529,
7503,
29892,
29871,
29896,
29962,
13,
1678,
503,
353,
2060,
287,
29918,
7529,
7503,
29892,
29871,
29906,
29962,
13,
1678,
396,
26221,
4377,
13,
1678,
2537,
353,
14770,
29889,
4532,
29898,
1003,
2311,
353,
313,
29896,
29900,
29892,
29871,
29955,
876,
13,
1678,
4853,
353,
14770,
29889,
1165,
267,
29898,
771,
6929,
29465,
29941,
29881,
1159,
13,
1678,
396,
26221,
6492,
13,
1678,
4853,
29889,
1557,
2620,
29941,
29928,
29898,
29916,
29892,
343,
29892,
503,
29892,
2927,
543,
12692,
1159,
13,
1678,
14770,
29889,
3257,
703,
7653,
287,
29257,
3201,
622,
706,
1159,
13,
2
] |
agenda/core/views.py | EderReisS/Django-DIO | 0 | 126585 | from django.shortcuts import render
from core.models import Evento
# Create your views here.
def lista_eventos(request):
evento = Evento.objects.all()
dados = {'evento' : evento}
return render(request,'agenda.html', dados) | [
1,
515,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
13,
3166,
7136,
29889,
9794,
1053,
6864,
29877,
13,
13,
29937,
6204,
596,
8386,
1244,
29889,
13,
13,
1753,
15023,
29918,
3696,
359,
29898,
3827,
1125,
13,
1678,
1741,
29877,
353,
6864,
29877,
29889,
12650,
29889,
497,
580,
13,
1678,
270,
2255,
353,
11117,
3696,
29877,
29915,
584,
1741,
29877,
29913,
13,
1678,
736,
4050,
29898,
3827,
5501,
351,
8395,
29889,
1420,
742,
270,
2255,
29897,
2
] |
checkerapp/apps.py | sahilr05/sitechecker | 2 | 105815 | <reponame>sahilr05/sitechecker<filename>checkerapp/apps.py
from django.apps import AppConfig
class CheckerappConfig(AppConfig):
name = "checkerapp"
| [
1,
529,
276,
1112,
420,
29958,
29879,
801,
309,
29878,
29900,
29945,
29914,
2746,
3198,
261,
29966,
9507,
29958,
3198,
261,
932,
29914,
13371,
29889,
2272,
13,
3166,
9557,
29889,
13371,
1053,
2401,
3991,
13,
13,
13,
1990,
5399,
261,
932,
3991,
29898,
2052,
3991,
1125,
13,
1678,
1024,
353,
376,
3198,
261,
932,
29908,
13,
2
] |
vision/scraper.py | nabsabraham/amplify-hackathon | 0 | 120588 | <filename>vision/scraper.py
from selenium import webdriver
import time
import requests
import shutil
import os
user = os.getlogin()
driver = webdriver.Chrome()
#directory = 'C:\\Users'+'\\'+user+'\Desktop'
directory = os.path.join(os.getcwd(), 'data')
inp = input("ripe bananas")
url = 'https://www.google.com/search?q='+str(inp)+'&source=lnms&tbm=isch&sa=X&ved=2ahUKEwie44_AnqLpAhUhBWMBHUFGD90Q_AUoAXoECBUQAw&biw=1920&bih=947'
iterate = int(input("Enter how many pics?"))
def save_img(inp,img,i):
try:
filename = inp+str(i)+'.jpg'
response = requests.get(img,stream=True)
image_path = os.path.join(directory, filename)
with open(image_path, 'wb') as file:
shutil.copyfileobj(response.raw, file)
except Exception:
pass
def find_urls(inp,url,driver,iterate):
driver.get(url)
time.sleep(3)
for j in range (1,iterate+1):
imgurl = driver.find_element_by_xpath('//div//div//div//div//div//div//div//div//div//div['+str(j)+']//a[1]//div[1]//img[1]')
imgurl.click()
time.sleep(15)
img = driver.find_element_by_xpath('//body/div[2]/c-wiz/div[3]/div[2]/div[3]/div/div/div[3]/div[2]/c-wiz/div[1]/div[1]/div/div[2]/a/img').get_attribute("src")
save_img(inp,img,j)
find_urls(inp,url,driver,iterate)
| [
1,
529,
9507,
29958,
4924,
29914,
1557,
336,
546,
29889,
2272,
13,
3166,
18866,
1053,
1856,
9465,
13,
5215,
931,
13,
5215,
7274,
13,
5215,
528,
4422,
13,
5215,
2897,
13,
13,
1792,
353,
2897,
29889,
657,
7507,
580,
13,
9465,
353,
1856,
9465,
29889,
1451,
4871,
580,
13,
29937,
12322,
353,
525,
29907,
22298,
5959,
18717,
29915,
1966,
18717,
1792,
29974,
12764,
17600,
29915,
13,
12322,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
3285,
525,
1272,
1495,
13,
262,
29886,
353,
1881,
703,
374,
412,
9892,
16397,
1159,
13,
2271,
353,
525,
991,
597,
1636,
29889,
3608,
29889,
510,
29914,
4478,
29973,
29939,
2433,
29974,
710,
29898,
262,
29886,
7240,
29915,
29987,
4993,
29922,
3083,
1516,
29987,
29873,
5838,
29922,
783,
29987,
4977,
29922,
29990,
29987,
1490,
29922,
29906,
801,
29965,
6059,
7804,
29946,
29946,
29918,
2744,
29939,
29931,
29886,
17565,
29965,
29882,
29933,
29956,
9486,
29950,
29965,
29943,
29954,
29928,
29929,
29900,
29984,
29918,
25951,
29877,
6604,
29877,
11206,
7838,
29984,
29909,
29893,
29987,
5365,
29893,
29922,
29896,
29929,
29906,
29900,
29987,
29890,
4861,
29922,
29929,
29946,
29955,
29915,
13,
1524,
403,
353,
938,
29898,
2080,
703,
10399,
920,
1784,
282,
1199,
3026,
876,
13,
13,
1753,
4078,
29918,
2492,
29898,
262,
29886,
29892,
2492,
29892,
29875,
1125,
13,
1678,
1018,
29901,
13,
4706,
10422,
353,
297,
29886,
29974,
710,
29898,
29875,
7240,
4286,
6173,
29915,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
2492,
29892,
5461,
29922,
5574,
29897,
13,
4706,
1967,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
12322,
29892,
10422,
29897,
13,
4706,
411,
1722,
29898,
3027,
29918,
2084,
29892,
525,
29893,
29890,
1495,
408,
934,
29901,
13,
9651,
528,
4422,
29889,
8552,
1445,
5415,
29898,
5327,
29889,
1610,
29892,
934,
29897,
13,
1678,
5174,
8960,
29901,
13,
4706,
1209,
13,
13,
13,
1753,
1284,
29918,
26045,
29898,
262,
29886,
29892,
2271,
29892,
9465,
29892,
1524,
403,
1125,
13,
1678,
7156,
29889,
657,
29898,
2271,
29897,
13,
1678,
931,
29889,
17059,
29898,
29941,
29897,
13,
1678,
363,
432,
297,
3464,
313,
29896,
29892,
1524,
403,
29974,
29896,
1125,
13,
4706,
10153,
2271,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
877,
458,
4563,
458,
4563,
458,
4563,
458,
4563,
458,
4563,
458,
4563,
458,
4563,
458,
4563,
458,
4563,
458,
4563,
1839,
29974,
710,
29898,
29926,
7240,
2033,
458,
29874,
29961,
29896,
29962,
458,
4563,
29961,
29896,
29962,
458,
2492,
29961,
29896,
29962,
1495,
13,
4706,
10153,
2271,
29889,
3808,
580,
13,
4706,
931,
29889,
17059,
29898,
29896,
29945,
29897,
13,
4706,
10153,
353,
7156,
29889,
2886,
29918,
5029,
29918,
1609,
29918,
23635,
877,
458,
2587,
29914,
4563,
29961,
29906,
16261,
29883,
29899,
29893,
466,
29914,
4563,
29961,
29941,
16261,
4563,
29961,
29906,
16261,
4563,
29961,
29941,
16261,
4563,
29914,
4563,
29914,
4563,
29961,
29941,
16261,
4563,
29961,
29906,
16261,
29883,
29899,
29893,
466,
29914,
4563,
29961,
29896,
16261,
4563,
29961,
29896,
16261,
4563,
29914,
4563,
29961,
29906,
16261,
29874,
29914,
2492,
2824,
657,
29918,
12715,
703,
4351,
1159,
13,
4706,
4078,
29918,
2492,
29898,
262,
29886,
29892,
2492,
29892,
29926,
29897,
13,
13,
2886,
29918,
26045,
29898,
262,
29886,
29892,
2271,
29892,
9465,
29892,
1524,
403,
29897,
13,
2
] |
pipenv/cmdparse.py | sthagen/pipenv | 23 | 17247 | <reponame>sthagen/pipenv<filename>pipenv/cmdparse.py
import itertools
import re
import shlex
class ScriptEmptyError(ValueError):
pass
def _quote_if_contains(value, pattern):
if next(iter(re.finditer(pattern, value)), None):
return '"{0}"'.format(re.sub(r'(\\*)"', r'\1\1\\"', value))
return value
class Script(object):
"""Parse a script line (in Pipfile's [scripts] section).
This always works in POSIX mode, even on Windows.
"""
def __init__(self, command, args=None):
self._parts = [command]
if args:
self._parts.extend(args)
@classmethod
def parse(cls, value):
if isinstance(value, str):
value = shlex.split(value)
if not value:
raise ScriptEmptyError(value)
return cls(value[0], value[1:])
def __repr__(self):
return "Script({0!r})".format(self._parts)
@property
def command(self):
return self._parts[0]
@property
def args(self):
return self._parts[1:]
@property
def cmd_args(self):
return self._parts
def extend(self, extra_args):
self._parts.extend(extra_args)
def cmdify(self):
"""Encode into a cmd-executable string.
This re-implements CreateProcess's quoting logic to turn a list of
arguments into one single string for the shell to interpret.
* All double quotes are escaped with a backslash.
* Existing backslashes before a quote are doubled, so they are all
escaped properly.
* Backslashes elsewhere are left as-is; cmd will interpret them
literally.
The result is then quoted into a pair of double quotes to be grouped.
An argument is intentionally not quoted if it does not contain
foul characters. This is done to be compatible with Windows built-in
commands that don't work well with quotes, e.g. everything with `echo`,
and DOS-style (forward slash) switches.
Foul characters include:
* Whitespaces.
* Carets (^). (pypa/pipenv#3307)
* Parentheses in the command. (pypa/pipenv#3168)
Carets introduce a difficult situation since they are essentially
"lossy" when parsed. Consider this in cmd.exe::
> echo "foo^bar"
"foo^bar"
> echo foo^^bar
foo^bar
The two commands produce different results, but are both parsed by the
shell as `foo^bar`, and there's essentially no sensible way to tell
what was actually passed in. This implementation assumes the quoted
variation (the first) since it is easier to implement, and arguably
the more common case.
The intended use of this function is to pre-process an argument list
before passing it into ``subprocess.Popen(..., shell=True)``.
See also: https://docs.python.org/3/library/subprocess.html#converting-argument-sequence
"""
return " ".join(
itertools.chain(
[_quote_if_contains(self.command, r"[\s^()]")],
(_quote_if_contains(arg, r"[\s^]") for arg in self.args),
)
)
| [
1,
529,
276,
1112,
420,
29958,
303,
25771,
29914,
13096,
6272,
29966,
9507,
29958,
13096,
6272,
29914,
9006,
5510,
29889,
2272,
13,
5215,
4256,
8504,
13,
5215,
337,
13,
5215,
528,
2506,
13,
13,
13,
1990,
14415,
8915,
2392,
29898,
1917,
2392,
1125,
13,
1678,
1209,
13,
13,
13,
1753,
903,
1396,
29918,
361,
29918,
11516,
29898,
1767,
29892,
4766,
1125,
13,
1678,
565,
2446,
29898,
1524,
29898,
276,
29889,
2886,
1524,
29898,
11037,
29892,
995,
8243,
6213,
1125,
13,
4706,
736,
18793,
29912,
29900,
5038,
4286,
4830,
29898,
276,
29889,
1491,
29898,
29878,
29915,
1194,
29905,
29930,
5513,
742,
364,
12764,
29896,
29905,
29896,
1966,
29908,
742,
995,
876,
13,
1678,
736,
995,
13,
13,
13,
1990,
14415,
29898,
3318,
1125,
13,
1678,
9995,
12914,
263,
2471,
1196,
313,
262,
349,
666,
1445,
29915,
29879,
518,
16713,
29962,
4004,
467,
13,
13,
1678,
910,
2337,
1736,
297,
349,
3267,
6415,
4464,
29892,
1584,
373,
3852,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1899,
29892,
6389,
29922,
8516,
1125,
13,
4706,
1583,
3032,
20895,
353,
518,
6519,
29962,
13,
4706,
565,
6389,
29901,
13,
9651,
1583,
3032,
20895,
29889,
21843,
29898,
5085,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
6088,
29898,
25932,
29892,
995,
1125,
13,
4706,
565,
338,
8758,
29898,
1767,
29892,
851,
1125,
13,
9651,
995,
353,
528,
2506,
29889,
5451,
29898,
1767,
29897,
13,
4706,
565,
451,
995,
29901,
13,
9651,
12020,
14415,
8915,
2392,
29898,
1767,
29897,
13,
4706,
736,
1067,
29879,
29898,
1767,
29961,
29900,
1402,
995,
29961,
29896,
29901,
2314,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
376,
4081,
3319,
29900,
29991,
29878,
1800,
1642,
4830,
29898,
1311,
3032,
20895,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1899,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
20895,
29961,
29900,
29962,
13,
13,
1678,
732,
6799,
13,
1678,
822,
6389,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
20895,
29961,
29896,
17531,
13,
13,
1678,
732,
6799,
13,
1678,
822,
9920,
29918,
5085,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
20895,
13,
13,
1678,
822,
10985,
29898,
1311,
29892,
4805,
29918,
5085,
1125,
13,
4706,
1583,
3032,
20895,
29889,
21843,
29898,
17833,
29918,
5085,
29897,
13,
13,
1678,
822,
9920,
1598,
29898,
1311,
1125,
13,
4706,
9995,
2369,
401,
964,
263,
9920,
29899,
4258,
9246,
1347,
29889,
13,
13,
4706,
910,
337,
29899,
326,
9711,
6204,
7032,
29915,
29879,
439,
11427,
5900,
304,
2507,
263,
1051,
310,
13,
4706,
6273,
964,
697,
2323,
1347,
363,
278,
6473,
304,
6613,
29889,
13,
13,
4706,
334,
2178,
3765,
11839,
526,
19824,
411,
263,
1250,
17057,
29889,
13,
4706,
334,
1222,
15423,
1250,
17057,
267,
1434,
263,
14978,
526,
3765,
29881,
29892,
577,
896,
526,
599,
13,
3986,
19824,
6284,
29889,
13,
4706,
334,
7437,
17057,
267,
17551,
526,
2175,
408,
29899,
275,
29936,
9920,
674,
6613,
963,
13,
3986,
22830,
29889,
13,
13,
4706,
450,
1121,
338,
769,
23153,
964,
263,
5101,
310,
3765,
11839,
304,
367,
27831,
29889,
13,
13,
4706,
530,
2980,
338,
16392,
635,
451,
23153,
565,
372,
947,
451,
1712,
13,
4706,
285,
5059,
4890,
29889,
910,
338,
2309,
304,
367,
15878,
411,
3852,
4240,
29899,
262,
13,
4706,
8260,
393,
1016,
29915,
29873,
664,
1532,
411,
11839,
29892,
321,
29889,
29887,
29889,
4129,
411,
421,
8057,
1673,
13,
4706,
322,
360,
3267,
29899,
3293,
313,
11333,
24765,
29897,
4607,
267,
29889,
13,
13,
4706,
383,
5059,
4890,
3160,
29901,
13,
13,
4706,
334,
806,
3246,
22459,
29889,
13,
4706,
334,
10057,
1372,
313,
29985,
467,
313,
29886,
1478,
29874,
29914,
13096,
6272,
29937,
29941,
29941,
29900,
29955,
29897,
13,
4706,
334,
1459,
9097,
21523,
297,
278,
1899,
29889,
313,
29886,
1478,
29874,
29914,
13096,
6272,
29937,
29941,
29896,
29953,
29947,
29897,
13,
13,
4706,
10057,
1372,
14944,
263,
5189,
6434,
1951,
896,
526,
13674,
13,
4706,
376,
6758,
29891,
29908,
746,
21213,
29889,
10056,
445,
297,
9920,
29889,
8097,
1057,
13,
13,
9651,
1405,
2916,
376,
5431,
29985,
1646,
29908,
13,
9651,
376,
5431,
29985,
1646,
29908,
13,
9651,
1405,
2916,
7953,
16672,
1646,
13,
9651,
7953,
29985,
1646,
13,
13,
4706,
450,
1023,
8260,
7738,
1422,
2582,
29892,
541,
526,
1716,
21213,
491,
278,
13,
4706,
6473,
408,
421,
5431,
29985,
1646,
1673,
322,
727,
29915,
29879,
13674,
694,
25182,
982,
304,
2649,
13,
4706,
825,
471,
2869,
4502,
297,
29889,
910,
5314,
15894,
278,
23153,
13,
4706,
19262,
313,
1552,
937,
29897,
1951,
372,
338,
6775,
304,
2334,
29892,
322,
1852,
29884,
2197,
13,
4706,
278,
901,
3619,
1206,
29889,
13,
13,
4706,
450,
9146,
671,
310,
445,
740,
338,
304,
758,
29899,
5014,
385,
2980,
1051,
13,
4706,
1434,
6819,
372,
964,
4954,
1491,
5014,
29889,
29925,
3150,
29898,
16361,
6473,
29922,
5574,
3569,
1412,
13,
13,
4706,
2823,
884,
29901,
2045,
597,
2640,
29889,
4691,
29889,
990,
29914,
29941,
29914,
5258,
29914,
1491,
5014,
29889,
1420,
29937,
535,
369,
1259,
29899,
23516,
29899,
16506,
13,
4706,
9995,
13,
4706,
736,
376,
11393,
7122,
29898,
13,
9651,
4256,
8504,
29889,
14153,
29898,
13,
18884,
23160,
1396,
29918,
361,
29918,
11516,
29898,
1311,
29889,
6519,
29892,
364,
29908,
7110,
29879,
29985,
580,
29962,
1159,
1402,
13,
18884,
9423,
1396,
29918,
361,
29918,
11516,
29898,
1191,
29892,
364,
29908,
7110,
29879,
29985,
29962,
1159,
363,
1852,
297,
1583,
29889,
5085,
511,
13,
9651,
1723,
13,
4706,
1723,
13,
2
] |
lib/symbioticpy/symbiotic/symbiotic.py | IMULMUL/symbiotic | 0 | 37758 | <reponame>IMULMUL/symbiotic
#!/usr/bin/python
import os
import sys
import re
from . transform import SymbioticCC
from . verifier import SymbioticVerifier
from . options import SymbioticOptions
from . utils import err, dbg, print_elapsed_time, restart_counting_time
from . utils.utils import print_stdout
from . utils.process import ProcessRunner
from . exceptions import SymbioticExceptionalResult
class Symbiotic(object):
"""
Instance of symbiotic tool. Instruments, prepares, compiles and runs
symbolic execution on given source(s)
"""
def __init__(self, tool, src, opts=None, env=None):
# source file
self.sources = src
# source compiled to llvm bytecode
self.curfile = None
# environment
self.env = env
if opts is None:
self.options = SymbioticOptions()
else:
self.options = opts
# tool to use
self._tool = tool
def terminate(self):
pr = ProcessRunner()
if pr.hasProcess():
pr.terminate()
def kill(self):
pr = ProcessRunner()
if pr.hasProcess():
pr.kill()
def kill_wait(self):
pr = ProcessRunner()
if not pr.hasProcess():
return
if pr.exitStatus() is None:
from time import sleep
while pr.exitStatus() is None:
pr.kill()
print('Waiting for the child process to terminate')
sleep(0.5)
print('Killed the child process')
def replay_nonsliced(self, tool, cc):
bitcode = cc.prepare_unsliced_file()
params = []
if hasattr(tool, "replay_error_params"):
params = tool.replay_error_params(cc.curfile)
print_stdout('INFO: Replaying error path', color='WHITE')
restart_counting_time()
verifier = SymbioticVerifier(bitcode, self.sources,
tool, self.options,
self.env, params)
res, _ = verifier.run()
print_elapsed_time('INFO: Replaying error path time', color='WHITE')
return res
def _run_symbiotic(self):
options = self.options
cc = SymbioticCC(self.sources, self._tool, options, self.env)
bitcode = cc.run()
if options.no_verification:
return 'No verification'
verifier = SymbioticVerifier(bitcode, self.sources,
self._tool, options, self.env)
# result and the tool that decided this result
res, tool = verifier.run()
# if we crashed on the sliced file, try running on the unsliced file
# (do this optional, as well as for slicer and instrumentation)
resstartswith = res.lower().startswith
if (not options.noslice) and \
(options.sv_comp or options.test_comp) and \
(resstartswith('error') or resstartswith('unknown')):
print_stdout("INFO: Failed on the sliced code, trying on the unsliced code",
color="WHITE")
options.replay_error = False # now we do not need to replay the error
options.noslice = True # now we behave like without slicing
bitcode = cc.prepare_unsliced_file()
verifier = SymbioticVerifier(bitcode, self.sources,
self._tool, options, self.env)
res, tool = verifier.run()
print_elapsed_time('INFO: Running on unsliced code time', color='WHITE')
if tool and options.replay_error and not tool.can_replay():
dbg('Replay required but the tool does not support it')
has_error = res and\
(res.startswith('false') or\
(res.startswith('done') and options.property.errorcall()))
if has_error and options.replay_error and\
not options.noslice and tool.can_replay():
print_stdout("Trying to confirm the error path")
newres = self.replay_nonsliced(tool, cc)
dbg("Original result: '{0}'".format(res))
dbg("Replayed result: '{0}'".format(newres))
if res != newres:
# if we did not replay the original error, but we found a different error
# on this path, report it, since it should be real
has_error = newres and\
(newres.startswith('false') or\
(newres.startswith('done') and\
options.property.errorcall()))
if has_error:
res = newres
else:
res = 'cex not-confirmed'
has_error = False
if res == 'cex not-confirmed':
# if we failed confirming CEX, rerun on unsliced file
bitcode = cc.prepare_unsliced_file()
verifier = SymbioticVerifier(bitcode, self.sources,
self._tool, options, self.env)
res, tool = verifier.run()
has_error = res and\
(res.startswith('false') or\
(res.startswith('done') and options.property.errorcall()))
if has_error and hasattr(tool, "describe_error"):
tool.describe_error(cc.curfile)
if has_error and options.executable_witness and\
hasattr(tool, "generate_exec_witness"):
tool.generate_exec_witness(cc.curfile, self.sources)
if not options.nowitness and hasattr(tool, "generate_witness"):
tool.generate_witness(cc.curfile, self.sources, has_error)
return res
def run(self):
try:
return self._run_symbiotic()
except KeyboardInterrupt:
self.terminate()
self.kill()
print('Interrupted...')
return 'interrupted'
except SymbioticExceptionalResult as res:
# we got result from some exceptional case
return str(res)
| [
1,
529,
276,
1112,
420,
29958,
7833,
13309,
29924,
13309,
29914,
11967,
5365,
13574,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
13,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
337,
13,
13,
3166,
869,
4327,
1053,
10667,
5365,
13574,
4174,
13,
3166,
869,
1147,
3709,
1053,
10667,
5365,
13574,
6565,
3709,
13,
3166,
869,
3987,
1053,
10667,
5365,
13574,
5856,
13,
3166,
869,
3667,
29879,
1053,
4589,
29892,
4833,
29887,
29892,
1596,
29918,
295,
28170,
29918,
2230,
29892,
10715,
29918,
2798,
292,
29918,
2230,
13,
3166,
869,
3667,
29879,
29889,
13239,
1053,
1596,
29918,
25393,
13,
3166,
869,
3667,
29879,
29889,
5014,
1053,
10554,
16802,
13,
3166,
869,
15283,
1053,
10667,
5365,
13574,
2451,
284,
3591,
13,
13,
1990,
10667,
5365,
13574,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
2799,
749,
310,
5016,
5365,
13574,
5780,
29889,
2799,
582,
1860,
29892,
10223,
267,
29892,
752,
5475,
322,
6057,
13,
1678,
5829,
293,
8225,
373,
2183,
2752,
29898,
29879,
29897,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
5780,
29892,
4765,
29892,
29111,
29922,
8516,
29892,
8829,
29922,
8516,
1125,
13,
4706,
396,
2752,
934,
13,
4706,
1583,
29889,
29879,
2863,
353,
4765,
13,
4706,
396,
2752,
13126,
304,
11148,
6925,
7023,
401,
13,
4706,
1583,
29889,
2764,
1445,
353,
6213,
13,
4706,
396,
5177,
13,
4706,
1583,
29889,
6272,
353,
8829,
13,
13,
4706,
565,
29111,
338,
6213,
29901,
13,
9651,
1583,
29889,
6768,
353,
10667,
5365,
13574,
5856,
580,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
6768,
353,
29111,
13,
13,
4706,
396,
5780,
304,
671,
13,
4706,
1583,
3032,
10154,
353,
5780,
13,
13,
1678,
822,
29504,
29898,
1311,
1125,
13,
4706,
544,
353,
10554,
16802,
580,
13,
4706,
565,
544,
29889,
5349,
7032,
7295,
13,
9651,
544,
29889,
18821,
403,
580,
13,
13,
1678,
822,
12088,
29898,
1311,
1125,
13,
4706,
544,
353,
10554,
16802,
580,
13,
4706,
565,
544,
29889,
5349,
7032,
7295,
13,
9651,
544,
29889,
21174,
580,
13,
13,
1678,
822,
12088,
29918,
10685,
29898,
1311,
1125,
13,
4706,
544,
353,
10554,
16802,
580,
13,
4706,
565,
451,
544,
29889,
5349,
7032,
7295,
13,
9651,
736,
13,
13,
4706,
565,
544,
29889,
13322,
5709,
580,
338,
6213,
29901,
13,
9651,
515,
931,
1053,
8709,
13,
9651,
1550,
544,
29889,
13322,
5709,
580,
338,
6213,
29901,
13,
18884,
544,
29889,
21174,
580,
13,
13,
18884,
1596,
877,
15716,
292,
363,
278,
2278,
1889,
304,
29504,
1495,
13,
18884,
8709,
29898,
29900,
29889,
29945,
29897,
13,
13,
9651,
1596,
877,
29968,
24455,
278,
2278,
1889,
1495,
13,
13,
1678,
822,
337,
1456,
29918,
29876,
787,
506,
287,
29898,
1311,
29892,
5780,
29892,
21759,
1125,
13,
4706,
2586,
401,
353,
21759,
29889,
19125,
29918,
6948,
506,
287,
29918,
1445,
580,
13,
4706,
8636,
353,
5159,
13,
4706,
565,
756,
5552,
29898,
10154,
29892,
376,
276,
1456,
29918,
2704,
29918,
7529,
29908,
1125,
13,
9651,
8636,
353,
5780,
29889,
276,
1456,
29918,
2704,
29918,
7529,
29898,
617,
29889,
2764,
1445,
29897,
13,
13,
4706,
1596,
29918,
25393,
877,
11690,
29901,
830,
1456,
292,
1059,
2224,
742,
2927,
2433,
25039,
9094,
1495,
13,
4706,
10715,
29918,
2798,
292,
29918,
2230,
580,
13,
13,
4706,
1147,
3709,
353,
10667,
5365,
13574,
6565,
3709,
29898,
2966,
401,
29892,
1583,
29889,
29879,
2863,
29892,
13,
462,
462,
268,
5780,
29892,
1583,
29889,
6768,
29892,
13,
462,
462,
268,
1583,
29889,
6272,
29892,
8636,
29897,
13,
4706,
620,
29892,
903,
353,
1147,
3709,
29889,
3389,
580,
13,
13,
4706,
1596,
29918,
295,
28170,
29918,
2230,
877,
11690,
29901,
830,
1456,
292,
1059,
2224,
931,
742,
2927,
2433,
25039,
9094,
1495,
13,
13,
4706,
736,
620,
13,
13,
1678,
822,
903,
3389,
29918,
11967,
5365,
13574,
29898,
1311,
1125,
13,
4706,
3987,
353,
1583,
29889,
6768,
13,
4706,
21759,
353,
10667,
5365,
13574,
4174,
29898,
1311,
29889,
29879,
2863,
29892,
1583,
3032,
10154,
29892,
3987,
29892,
1583,
29889,
6272,
29897,
13,
4706,
2586,
401,
353,
21759,
29889,
3389,
580,
13,
13,
4706,
565,
3987,
29889,
1217,
29918,
369,
2450,
29901,
13,
9651,
736,
525,
3782,
1147,
2450,
29915,
13,
13,
4706,
1147,
3709,
353,
10667,
5365,
13574,
6565,
3709,
29898,
2966,
401,
29892,
1583,
29889,
29879,
2863,
29892,
13,
462,
462,
268,
1583,
3032,
10154,
29892,
3987,
29892,
1583,
29889,
6272,
29897,
13,
4706,
396,
1121,
322,
278,
5780,
393,
8459,
445,
1121,
13,
4706,
620,
29892,
5780,
353,
1147,
3709,
29889,
3389,
580,
13,
13,
4706,
396,
565,
591,
8095,
287,
373,
278,
269,
506,
287,
934,
29892,
1018,
2734,
373,
278,
9644,
506,
287,
934,
13,
4706,
396,
313,
1867,
445,
13136,
29892,
408,
1532,
408,
363,
269,
506,
261,
322,
11395,
362,
29897,
13,
4706,
620,
27382,
2541,
353,
620,
29889,
13609,
2141,
27382,
2541,
13,
4706,
565,
313,
1333,
3987,
29889,
17639,
5897,
29897,
322,
320,
13,
965,
313,
6768,
29889,
4501,
29918,
2388,
470,
3987,
29889,
1688,
29918,
2388,
29897,
322,
320,
13,
965,
313,
690,
27382,
2541,
877,
2704,
1495,
470,
620,
27382,
2541,
877,
26690,
8785,
29901,
13,
9651,
1596,
29918,
25393,
703,
11690,
29901,
18390,
373,
278,
269,
506,
287,
775,
29892,
1811,
373,
278,
9644,
506,
287,
775,
613,
13,
462,
308,
2927,
543,
25039,
9094,
1159,
13,
9651,
3987,
29889,
276,
1456,
29918,
2704,
353,
7700,
396,
1286,
591,
437,
451,
817,
304,
337,
1456,
278,
1059,
13,
9651,
3987,
29889,
17639,
5897,
353,
5852,
396,
1286,
591,
23389,
763,
1728,
269,
506,
292,
13,
9651,
2586,
401,
353,
21759,
29889,
19125,
29918,
6948,
506,
287,
29918,
1445,
580,
13,
9651,
1147,
3709,
353,
10667,
5365,
13574,
6565,
3709,
29898,
2966,
401,
29892,
1583,
29889,
29879,
2863,
29892,
13,
462,
462,
308,
1583,
3032,
10154,
29892,
3987,
29892,
1583,
29889,
6272,
29897,
13,
9651,
620,
29892,
5780,
353,
1147,
3709,
29889,
3389,
580,
13,
9651,
1596,
29918,
295,
28170,
29918,
2230,
877,
11690,
29901,
19509,
373,
9644,
506,
287,
775,
931,
742,
2927,
2433,
25039,
9094,
1495,
13,
13,
4706,
565,
5780,
322,
3987,
29889,
276,
1456,
29918,
2704,
322,
451,
5780,
29889,
3068,
29918,
276,
1456,
7295,
13,
965,
4833,
29887,
877,
1123,
1456,
3734,
541,
278,
5780,
947,
451,
2304,
372,
1495,
13,
13,
4706,
756,
29918,
2704,
353,
620,
322,
29905,
13,
462,
1678,
313,
690,
29889,
27382,
2541,
877,
4541,
1495,
470,
29905,
13,
462,
1678,
313,
690,
29889,
27382,
2541,
877,
15091,
1495,
322,
3987,
29889,
6799,
29889,
2704,
4804,
22130,
13,
4706,
565,
756,
29918,
2704,
322,
3987,
29889,
276,
1456,
29918,
2704,
322,
29905,
13,
965,
451,
3987,
29889,
17639,
5897,
322,
5780,
29889,
3068,
29918,
276,
1456,
7295,
13,
9651,
1596,
29918,
25393,
703,
15870,
292,
304,
9659,
278,
1059,
2224,
1159,
13,
9651,
716,
690,
353,
1583,
29889,
276,
1456,
29918,
29876,
787,
506,
287,
29898,
10154,
29892,
21759,
29897,
13,
13,
9651,
4833,
29887,
703,
26036,
1121,
29901,
22372,
29900,
10162,
1642,
4830,
29898,
690,
876,
13,
9651,
4833,
29887,
703,
1123,
1456,
287,
1121,
29901,
22372,
29900,
10162,
1642,
4830,
29898,
1482,
690,
876,
13,
13,
9651,
565,
620,
2804,
716,
690,
29901,
13,
18884,
396,
565,
591,
1258,
451,
337,
1456,
278,
2441,
1059,
29892,
541,
591,
1476,
263,
1422,
1059,
13,
18884,
396,
373,
445,
2224,
29892,
3461,
372,
29892,
1951,
372,
881,
367,
1855,
13,
18884,
756,
29918,
2704,
353,
716,
690,
322,
29905,
13,
462,
9651,
313,
1482,
690,
29889,
27382,
2541,
877,
4541,
1495,
470,
29905,
13,
462,
9651,
313,
1482,
690,
29889,
27382,
2541,
877,
15091,
1495,
322,
29905,
13,
462,
632,
3987,
29889,
6799,
29889,
2704,
4804,
22130,
13,
18884,
565,
756,
29918,
2704,
29901,
13,
462,
1678,
620,
353,
716,
690,
13,
18884,
1683,
29901,
13,
462,
1678,
620,
353,
525,
346,
29916,
451,
29899,
5527,
381,
2168,
29915,
13,
462,
1678,
756,
29918,
2704,
353,
7700,
13,
13,
4706,
565,
620,
1275,
525,
346,
29916,
451,
29899,
5527,
381,
2168,
2396,
13,
9651,
396,
565,
591,
5229,
9659,
292,
315,
5746,
29892,
364,
261,
348,
373,
9644,
506,
287,
934,
13,
9651,
2586,
401,
353,
21759,
29889,
19125,
29918,
6948,
506,
287,
29918,
1445,
580,
13,
9651,
1147,
3709,
353,
10667,
5365,
13574,
6565,
3709,
29898,
2966,
401,
29892,
1583,
29889,
29879,
2863,
29892,
13,
462,
462,
308,
1583,
3032,
10154,
29892,
3987,
29892,
1583,
29889,
6272,
29897,
13,
9651,
620,
29892,
5780,
353,
1147,
3709,
29889,
3389,
580,
13,
9651,
756,
29918,
2704,
353,
620,
322,
29905,
13,
462,
4706,
313,
690,
29889,
27382,
2541,
877,
4541,
1495,
470,
29905,
13,
462,
4706,
313,
690,
29889,
27382,
2541,
877,
15091,
1495,
322,
3987,
29889,
6799,
29889,
2704,
4804,
22130,
13,
29871,
13,
4706,
565,
756,
29918,
2704,
322,
756,
5552,
29898,
10154,
29892,
376,
2783,
29581,
29918,
2704,
29908,
1125,
13,
9651,
5780,
29889,
2783,
29581,
29918,
2704,
29898,
617,
29889,
2764,
1445,
29897,
13,
13,
4706,
565,
756,
29918,
2704,
322,
3987,
29889,
4258,
9246,
29918,
29893,
277,
2264,
322,
29905,
13,
965,
756,
5552,
29898,
10154,
29892,
376,
17158,
29918,
4258,
29918,
29893,
277,
2264,
29908,
1125,
13,
9651,
5780,
29889,
17158,
29918,
4258,
29918,
29893,
277,
2264,
29898,
617,
29889,
2764,
1445,
29892,
1583,
29889,
29879,
2863,
29897,
13,
13,
4706,
565,
451,
3987,
29889,
3707,
277,
2264,
322,
756,
5552,
29898,
10154,
29892,
376,
17158,
29918,
29893,
277,
2264,
29908,
1125,
13,
9651,
5780,
29889,
17158,
29918,
29893,
277,
2264,
29898,
617,
29889,
2764,
1445,
29892,
1583,
29889,
29879,
2863,
29892,
756,
29918,
2704,
29897,
13,
13,
4706,
736,
620,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
3389,
29918,
11967,
5365,
13574,
580,
13,
4706,
5174,
7670,
3377,
4074,
6685,
29901,
13,
9651,
1583,
29889,
18821,
403,
580,
13,
9651,
1583,
29889,
21174,
580,
13,
9651,
1596,
877,
4074,
14214,
856,
1495,
13,
9651,
736,
525,
1639,
14214,
29915,
13,
4706,
5174,
10667,
5365,
13574,
2451,
284,
3591,
408,
620,
29901,
13,
9651,
396,
591,
2355,
1121,
515,
777,
3682,
284,
1206,
13,
9651,
736,
851,
29898,
690,
29897,
13,
13,
2
] |
src/metarl/tf/policies/gaussian_mlp_multitask_policy.py | icml2020submission6857/metarl | 2 | 157308 | """GaussianMLPMultitaskPolicy."""
import akro
import numpy as np
import tensorflow as tf
from metarl.tf.models import GaussianMLPModel
from metarl.tf.policies.multitask_policy import StochasticMultitaskPolicy
class GaussianMLPMultitaskPolicy(StochasticMultitaskPolicy):
"""GaussianMLPMultitaskPolicy.
Args:
env_spec (metarl.envs.env_spec.EnvSpec): Environment specification.
embedding (metarl.tf.embeddings.Embedding): Embedding network.
task_space (akro.Box): Space of the task.
name (str): Model name, also the variable scope.
hidden_sizes (list[int]): Output dimension of dense layer(s) for
the MLP for mean. For example, (32, 32) means the MLP consists
of two hidden layers, each with 32 hidden units.
hidden_nonlinearity (callable): Activation function for intermediate
dense layer(s). It should return a tf.Tensor. Set it to
None to maintain a linear activation.
hidden_w_init (callable): Initializer function for the weight
of intermediate dense layer(s). The function should return a
tf.Tensor.
hidden_b_init (callable): Initializer function for the bias
of intermediate dense layer(s). The function should return a
tf.Tensor.
output_nonlinearity (callable): Activation function for output dense
layer. It should return a tf.Tensor. Set it to None to
maintain a linear activation.
output_w_init (callable): Initializer function for the weight
of output dense layer(s). The function should return a
tf.Tensor.
output_b_init (callable): Initializer function for the bias
of output dense layer(s). The function should return a
tf.Tensor.
learn_std (bool): Is std trainable.
adaptive_std (bool): Is std a neural network. If False, it will be a
parameter.
std_share_network (bool): Boolean for whether mean and std share
the same network.
init_std (float): Initial value for std.
std_hidden_sizes (list[int]): Output dimension of dense layer(s) for
the MLP for std. For example, (32, 32) means the MLP consists
of two hidden layers, each with 32 hidden units.
min_std (float): If not None, the std is at least the value of min_std,
to avoid numerical issues.
max_std (float): If not None, the std is at most the value of max_std,
to avoid numerical issues.
std_hidden_nonlinearity (callable): Nonlinearity for each hidden layer
in the std network. It should return a tf.Tensor. Set it to None to
maintain a linear activation.
std_output_nonlinearity (callable): Nonlinearity for output layer in
the std network. It should return a tf.Tensor. Set it to None to
maintain a linear activation.
std_parameterization (str): How the std should be parametrized. There
are a few options:
- exp: the logarithm of the std will be stored, and applied a
exponential transformation
- softplus: the std will be computed as log(1+exp(x))
layer_normalization (bool): Bool for using layer normalization or not.
"""
def __init__(self,
env_spec,
embedding,
task_space,
name='GaussianMLPMultitaskPolicy',
hidden_sizes=(32, 32),
hidden_nonlinearity=tf.nn.tanh,
hidden_w_init=tf.glorot_uniform_initializer(),
hidden_b_init=tf.zeros_initializer(),
output_nonlinearity=None,
output_w_init=tf.glorot_uniform_initializer(),
output_b_init=tf.zeros_initializer(),
learn_std=True,
adaptive_std=False,
std_share_network=False,
init_std=1.0,
min_std=1e-6,
max_std=None,
std_hidden_sizes=(32, 32),
std_hidden_nonlinearity=tf.nn.tanh,
std_output_nonlinearity=None,
std_parameterization='exp',
layer_normalization=False):
assert isinstance(env_spec.action_space, akro.Box)
super().__init__(env_spec, embedding, task_space, name)
self.obs_dim = env_spec.observation_space.flat_dim
self.action_dim = env_spec.action_space.flat_dim
self.model = GaussianMLPModel(
output_dim=self.action_dim,
hidden_sizes=hidden_sizes,
hidden_nonlinearity=hidden_nonlinearity,
hidden_w_init=hidden_w_init,
hidden_b_init=hidden_b_init,
output_nonlinearity=output_nonlinearity,
output_w_init=output_w_init,
output_b_init=output_b_init,
learn_std=learn_std,
adaptive_std=adaptive_std,
std_share_network=std_share_network,
init_std=init_std,
min_std=min_std,
max_std=max_std,
std_hidden_sizes=std_hidden_sizes,
std_hidden_nonlinearity=std_hidden_nonlinearity,
std_output_nonlinearity=std_output_nonlinearity,
std_parameterization=std_parameterization,
layer_normalization=layer_normalization,
name='GaussianMLPModel')
self._initialize()
def _initialize(self):
state_input = tf.compat.v1.placeholder(tf.float32,
shape=(None, self.obs_dim))
task_input = self._embedding.input
latent_input = tf.compat.v1.placeholder(
tf.float32, shape=(None, self._embedding.latent_dim))
with tf.compat.v1.variable_scope(self.name) as vs:
self._variable_scope = vs
with tf.variable_scope('concat_latent_obs'):
latent_state_input = tf.concat(
[latent_input, state_input], axis=-1)
self.model.build(latent_state_input, name='from_latent')
# Connect with embedding network's latent output
with tf.variable_scope('concat_embed_obs'):
latent_dist_info_sym = self._embedding.dist_info_sym(
task_input, name='dist_info_sym')
latent_var = self._embedding.distribution.sample_sym(
latent_dist_info_sym)
embed_state_input = tf.concat(
[latent_var, state_input], axis=-1)
self.model.build(embed_state_input, name='default')
self._f_dist_latent_obs = tf.compat.v1.get_default_session().make_callable(
[
self.model.networks['from_latent'].mean,
self.model.networks['from_latent'].log_std
],
feed_list=[latent_input, state_input])
self._f_dist_task_obs = tf.compat.v1.get_default_session().make_callable(
[
self.model.networks['default'].mean,
self.model.networks['default'].log_std,
self._embedding.latent_mean,
self._embedding.latent_std_param,
],
feed_list=[task_input, state_input])
def get_action(self, observation):
"""Get action sampled from the policy.
Args:
observation (np.ndarray): Observation from the environment.
Returns:
(np.ndarray): Action sampled from the policy.
"""
flat_task_obs = self.task_observation_space.flatten(observation)
flat_task, flat_obs = self.split_observation(flat_task_obs)
(action_mean, action_log_std, latent_mean, latent_log_std) = self._f_dist_task_obs([flat_task], [flat_obs])
rnd = np.random.normal(size=action_mean.shape)
action_sample = rnd * np.exp(action_log_std) + action_mean
action_sample = self.action_space.unflatten(action_sample[0])
action_mean = self.action_space.unflatten(action_mean[0])
action_log_std = self.action_space.unflatten(action_log_std[0])
mean = self._embedding.latent_space.unflatten(latent_mean[0])
log_std = self._embedding.latent_space.unflatten(latent_log_std[0])
latent_info = dict(mean=latent_mean, log_std=latent_log_std)
return action, dict(mean=action_mean, log_std=action_log_std, latent_info=latent_info)
def get_action_from_latent(self, latent, observation):
"""Get action sampled from the latent and observation.
Args:
latent (np.ndarray): Latent var from the policy.
observation (np.ndarray): Observation from the environment.
Returns:
(np.ndarray): Action sampled from the policy.
"""
flat_obs = self.observation_space.flatten(observation)
flat_latent = self.latent_space.flatten(latent)
mean, log_std = self._f_dist_latent_obs([flat_latent], [flat_obs])
rnd = np.random.normal(size=mean.shape)
sample = rnd * np.exp(log_std) + mean
sample = self.action_space.unflatten(sample[0])
mean = self.action_space.unflatten(mean[0])
log_std = self.action_space.unflatten(log_std[0])
return sample, dict(mean=mean, log_std=log_std)
def dist_info_sym(self, task_var, obs_var, state_info_vars=None, name='default'):
"""Build a symbolic graph of the distribution parameters.
Args:
task_var (tf.Tensor): Tensor input for symbolic graph.
obs_var (tf.Tensor): Tensor input for symbolic graph.
state_info_vars (dict): Extra state information, e.g.
previous action.
name (str): Name for symbolic graph.
Returns:
dict[tf.Tensor]: Outputs of the symbolic graph of distribution
parameters.
"""
with tf.compat.v1.variable_scope(self._variable_scope):
latent_dist_info_sym = self._embedding.dist_info_sym(
task_var, name=name)
latent = self._embedding.distribution.sample_sym(
latent_dist_info_sym)
embed_state_input = tf.concat(
[latent, obs_var], axis=-1)
mean_var, log_std_var, _, _ = self.model.build(embed_state_input, name=name)
return dict(mean=mean_var, log_std=log_std_var)
def dist_info_sym_from_latent(self, latent_var, obs_var, state_info_vars=None,
name='from_latent'):
"""Build a symbolic graph of the distribution parameters from latent.
Args:
latent_var (tf.Tensor): Tensor input for symbolic graph.
obs_var (tf.Tensor): Tensor input for symbolic graph.
state_info_vars (dict): Extra state information, e.g.
previous action.
name (str): Name for symbolic graph.
Returns:
dict[tf.Tensor]: Outputs of the symbolic graph of distribution
parameters.
"""
with tf.compat.v1.variable_scope(self._variable_scope):
embed_state_input = tf.concat([latent_var, obs_var], axis=-1)
mean_var, log_std_var, _, _ = self.model.build(embed_state_input, name=name)
return dict(mean=mean_var, log_std=log_std_var)
@property
def distribution(self):
"""Policy distribution.
Returns:
metarl.tf.distributions.DiagonalGaussian: Policy distribution.
"""
return self.model.networks['default'].dist
def get_action_from_onehot(self, observation, onehot):
"""Get action sampled from the policy based on onehot index.
Args:
observation (np.ndarray): Observation from the environment.
onehot (np.ndarray): One hot task index.
Returns:
(np.ndarray): Action sampled from the policy.
"""
raise NotImplementedError
def get_actions_from_onehots(self, observations, onehots):
"""Get actions sampled from the policy based on onehot indices.
Args:
observations (np.ndarray): Observations from the environment.
onehots (np.ndarray): One hot task indices.
Returns:
(np.ndarray): Action sampled from the policy.
"""
raise NotImplementedError
def get_actions_from_latents(self, observations, latents):
"""Get actions sampled from the policy.
Args:
observations (np.ndarray): Observations from the environment.
latents (np.ndarray): Latent.
Returns:
(np.ndarray): Actions sampled from the policy.
"""
raise NotImplementedError
def get_actions(self, observations):
"""Get action sampled from the policy.
Args:
observations (list[np.ndarray]): Observations from the environment.
Returns:
(np.ndarray): Actions sampled from the policy.
"""
raise NotImplementedError
def __getstate__(self):
"""Object.__getstate__.
Returns:
dict: the state to be pickled for the instance.
"""
new_dict = super().__getstate__()
del new_dict['_f_dist_latent_obs']
del new_dict['_f_dist_task_obs']
return new_dict
def __setstate__(self, state):
"""Object.__setstate__.
Args:
state (dict): Unpickled state.
"""
super().__setstate__(state)
self._initialize()
| [
1,
9995,
29954,
17019,
1988,
29925,
6857,
277,
1278,
15644,
1213,
15945,
13,
5215,
11208,
307,
13,
5215,
12655,
408,
7442,
13,
5215,
26110,
408,
15886,
13,
13,
3166,
1539,
279,
29880,
29889,
13264,
29889,
9794,
1053,
22477,
1988,
29925,
3195,
13,
3166,
1539,
279,
29880,
29889,
13264,
29889,
3733,
293,
583,
29889,
4713,
277,
1278,
29918,
22197,
1053,
6639,
305,
6288,
6857,
277,
1278,
15644,
13,
13,
13,
1990,
22477,
1988,
29925,
6857,
277,
1278,
15644,
29898,
20754,
305,
6288,
6857,
277,
1278,
15644,
1125,
13,
1678,
9995,
29954,
17019,
1988,
29925,
6857,
277,
1278,
15644,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
8829,
29918,
6550,
313,
2527,
279,
29880,
29889,
264,
4270,
29889,
6272,
29918,
6550,
29889,
21745,
10299,
1125,
16738,
21992,
29889,
13,
4706,
23655,
313,
2527,
279,
29880,
29889,
13264,
29889,
17987,
29881,
886,
29889,
6026,
2580,
8497,
1125,
2812,
2580,
8497,
3564,
29889,
13,
4706,
3414,
29918,
3493,
313,
557,
307,
29889,
3313,
1125,
14121,
310,
278,
3414,
29889,
13,
4706,
1024,
313,
710,
1125,
8125,
1024,
29892,
884,
278,
2286,
6874,
29889,
13,
4706,
7934,
29918,
29879,
7093,
313,
1761,
29961,
524,
29962,
1125,
10604,
9927,
310,
20619,
7546,
29898,
29879,
29897,
363,
13,
9651,
278,
341,
13208,
363,
2099,
29889,
1152,
1342,
29892,
313,
29941,
29906,
29892,
29871,
29941,
29906,
29897,
2794,
278,
341,
13208,
11624,
13,
9651,
310,
1023,
7934,
15359,
29892,
1269,
411,
29871,
29941,
29906,
7934,
10340,
29889,
13,
4706,
7934,
29918,
5464,
10660,
537,
313,
4804,
519,
1125,
21775,
362,
740,
363,
19697,
13,
9651,
20619,
7546,
29898,
29879,
467,
739,
881,
736,
263,
15886,
29889,
29911,
6073,
29889,
3789,
372,
304,
13,
9651,
6213,
304,
7344,
263,
5608,
26229,
29889,
13,
4706,
7934,
29918,
29893,
29918,
2344,
313,
4804,
519,
1125,
17250,
3950,
740,
363,
278,
7688,
13,
9651,
310,
19697,
20619,
7546,
29898,
29879,
467,
450,
740,
881,
736,
263,
13,
9651,
15886,
29889,
29911,
6073,
29889,
13,
4706,
7934,
29918,
29890,
29918,
2344,
313,
4804,
519,
1125,
17250,
3950,
740,
363,
278,
24003,
13,
9651,
310,
19697,
20619,
7546,
29898,
29879,
467,
450,
740,
881,
736,
263,
13,
9651,
15886,
29889,
29911,
6073,
29889,
13,
4706,
1962,
29918,
5464,
10660,
537,
313,
4804,
519,
1125,
21775,
362,
740,
363,
1962,
20619,
13,
9651,
7546,
29889,
739,
881,
736,
263,
15886,
29889,
29911,
6073,
29889,
3789,
372,
304,
6213,
304,
13,
9651,
7344,
263,
5608,
26229,
29889,
13,
4706,
1962,
29918,
29893,
29918,
2344,
313,
4804,
519,
1125,
17250,
3950,
740,
363,
278,
7688,
13,
9651,
310,
1962,
20619,
7546,
29898,
29879,
467,
450,
740,
881,
736,
263,
13,
9651,
15886,
29889,
29911,
6073,
29889,
13,
4706,
1962,
29918,
29890,
29918,
2344,
313,
4804,
519,
1125,
17250,
3950,
740,
363,
278,
24003,
13,
9651,
310,
1962,
20619,
7546,
29898,
29879,
467,
450,
740,
881,
736,
263,
13,
9651,
15886,
29889,
29911,
6073,
29889,
13,
4706,
5110,
29918,
4172,
313,
11227,
1125,
1317,
3659,
7945,
519,
29889,
13,
4706,
7744,
573,
29918,
4172,
313,
11227,
1125,
1317,
3659,
263,
19677,
3564,
29889,
960,
7700,
29892,
372,
674,
367,
263,
13,
9651,
3443,
29889,
13,
4706,
3659,
29918,
13653,
29918,
11618,
313,
11227,
1125,
11185,
363,
3692,
2099,
322,
3659,
6232,
13,
9651,
278,
1021,
3564,
29889,
13,
4706,
2069,
29918,
4172,
313,
7411,
1125,
17250,
995,
363,
3659,
29889,
13,
4706,
3659,
29918,
10892,
29918,
29879,
7093,
313,
1761,
29961,
524,
29962,
1125,
10604,
9927,
310,
20619,
7546,
29898,
29879,
29897,
363,
13,
9651,
278,
341,
13208,
363,
3659,
29889,
1152,
1342,
29892,
313,
29941,
29906,
29892,
29871,
29941,
29906,
29897,
2794,
278,
341,
13208,
11624,
13,
9651,
310,
1023,
7934,
15359,
29892,
1269,
411,
29871,
29941,
29906,
7934,
10340,
29889,
13,
4706,
1375,
29918,
4172,
313,
7411,
1125,
960,
451,
6213,
29892,
278,
3659,
338,
472,
3203,
278,
995,
310,
1375,
29918,
4172,
29892,
13,
9651,
304,
4772,
16259,
5626,
29889,
13,
4706,
4236,
29918,
4172,
313,
7411,
1125,
960,
451,
6213,
29892,
278,
3659,
338,
472,
1556,
278,
995,
310,
4236,
29918,
4172,
29892,
13,
9651,
304,
4772,
16259,
5626,
29889,
13,
4706,
3659,
29918,
10892,
29918,
5464,
10660,
537,
313,
4804,
519,
1125,
10050,
10660,
537,
363,
1269,
7934,
7546,
13,
9651,
297,
278,
3659,
3564,
29889,
739,
881,
736,
263,
15886,
29889,
29911,
6073,
29889,
3789,
372,
304,
6213,
304,
13,
9651,
7344,
263,
5608,
26229,
29889,
13,
4706,
3659,
29918,
4905,
29918,
5464,
10660,
537,
313,
4804,
519,
1125,
10050,
10660,
537,
363,
1962,
7546,
297,
13,
9651,
278,
3659,
3564,
29889,
739,
881,
736,
263,
15886,
29889,
29911,
6073,
29889,
3789,
372,
304,
6213,
304,
13,
9651,
7344,
263,
5608,
26229,
29889,
13,
4706,
3659,
29918,
15501,
2133,
313,
710,
1125,
1128,
278,
3659,
881,
367,
25011,
7485,
287,
29889,
1670,
13,
9651,
526,
263,
2846,
3987,
29901,
13,
9651,
448,
1518,
29901,
278,
1480,
23830,
29885,
310,
278,
3659,
674,
367,
6087,
29892,
322,
7436,
263,
13,
18884,
25658,
13852,
13,
9651,
448,
4964,
11242,
29901,
278,
3659,
674,
367,
15712,
408,
1480,
29898,
29896,
29974,
4548,
29898,
29916,
876,
13,
4706,
7546,
29918,
8945,
2133,
313,
11227,
1125,
18912,
363,
773,
7546,
4226,
2133,
470,
451,
29889,
13,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
8829,
29918,
6550,
29892,
13,
462,
23655,
29892,
13,
462,
3414,
29918,
3493,
29892,
13,
462,
1024,
2433,
29954,
17019,
1988,
29925,
6857,
277,
1278,
15644,
742,
13,
462,
7934,
29918,
29879,
7093,
7607,
29941,
29906,
29892,
29871,
29941,
29906,
511,
13,
462,
7934,
29918,
5464,
10660,
537,
29922,
13264,
29889,
15755,
29889,
13161,
29882,
29892,
13,
462,
7934,
29918,
29893,
29918,
2344,
29922,
13264,
29889,
3820,
272,
327,
29918,
29590,
29918,
11228,
3950,
3285,
13,
462,
7934,
29918,
29890,
29918,
2344,
29922,
13264,
29889,
3298,
359,
29918,
11228,
3950,
3285,
13,
462,
1962,
29918,
5464,
10660,
537,
29922,
8516,
29892,
13,
462,
1962,
29918,
29893,
29918,
2344,
29922,
13264,
29889,
3820,
272,
327,
29918,
29590,
29918,
11228,
3950,
3285,
13,
462,
1962,
29918,
29890,
29918,
2344,
29922,
13264,
29889,
3298,
359,
29918,
11228,
3950,
3285,
13,
462,
5110,
29918,
4172,
29922,
5574,
29892,
13,
462,
7744,
573,
29918,
4172,
29922,
8824,
29892,
13,
462,
3659,
29918,
13653,
29918,
11618,
29922,
8824,
29892,
13,
462,
2069,
29918,
4172,
29922,
29896,
29889,
29900,
29892,
13,
462,
1375,
29918,
4172,
29922,
29896,
29872,
29899,
29953,
29892,
13,
462,
4236,
29918,
4172,
29922,
8516,
29892,
13,
462,
3659,
29918,
10892,
29918,
29879,
7093,
7607,
29941,
29906,
29892,
29871,
29941,
29906,
511,
13,
462,
3659,
29918,
10892,
29918,
5464,
10660,
537,
29922,
13264,
29889,
15755,
29889,
13161,
29882,
29892,
13,
462,
3659,
29918,
4905,
29918,
5464,
10660,
537,
29922,
8516,
29892,
13,
462,
3659,
29918,
15501,
2133,
2433,
4548,
742,
13,
462,
7546,
29918,
8945,
2133,
29922,
8824,
1125,
13,
4706,
4974,
338,
8758,
29898,
6272,
29918,
6550,
29889,
2467,
29918,
3493,
29892,
11208,
307,
29889,
3313,
29897,
13,
4706,
2428,
2141,
1649,
2344,
12035,
6272,
29918,
6550,
29892,
23655,
29892,
3414,
29918,
3493,
29892,
1024,
29897,
13,
4706,
1583,
29889,
26290,
29918,
6229,
353,
8829,
29918,
6550,
29889,
26739,
362,
29918,
3493,
29889,
20620,
29918,
6229,
13,
4706,
1583,
29889,
2467,
29918,
6229,
353,
8829,
29918,
6550,
29889,
2467,
29918,
3493,
29889,
20620,
29918,
6229,
13,
13,
4706,
1583,
29889,
4299,
353,
22477,
1988,
29925,
3195,
29898,
13,
9651,
1962,
29918,
6229,
29922,
1311,
29889,
2467,
29918,
6229,
29892,
13,
9651,
7934,
29918,
29879,
7093,
29922,
10892,
29918,
29879,
7093,
29892,
13,
9651,
7934,
29918,
5464,
10660,
537,
29922,
10892,
29918,
5464,
10660,
537,
29892,
13,
9651,
7934,
29918,
29893,
29918,
2344,
29922,
10892,
29918,
29893,
29918,
2344,
29892,
13,
9651,
7934,
29918,
29890,
29918,
2344,
29922,
10892,
29918,
29890,
29918,
2344,
29892,
13,
9651,
1962,
29918,
5464,
10660,
537,
29922,
4905,
29918,
5464,
10660,
537,
29892,
13,
9651,
1962,
29918,
29893,
29918,
2344,
29922,
4905,
29918,
29893,
29918,
2344,
29892,
13,
9651,
1962,
29918,
29890,
29918,
2344,
29922,
4905,
29918,
29890,
29918,
2344,
29892,
13,
9651,
5110,
29918,
4172,
29922,
19668,
29918,
4172,
29892,
13,
9651,
7744,
573,
29918,
4172,
29922,
1114,
415,
573,
29918,
4172,
29892,
13,
9651,
3659,
29918,
13653,
29918,
11618,
29922,
4172,
29918,
13653,
29918,
11618,
29892,
13,
9651,
2069,
29918,
4172,
29922,
2344,
29918,
4172,
29892,
13,
9651,
1375,
29918,
4172,
29922,
1195,
29918,
4172,
29892,
13,
9651,
4236,
29918,
4172,
29922,
3317,
29918,
4172,
29892,
13,
9651,
3659,
29918,
10892,
29918,
29879,
7093,
29922,
4172,
29918,
10892,
29918,
29879,
7093,
29892,
13,
9651,
3659,
29918,
10892,
29918,
5464,
10660,
537,
29922,
4172,
29918,
10892,
29918,
5464,
10660,
537,
29892,
13,
9651,
3659,
29918,
4905,
29918,
5464,
10660,
537,
29922,
4172,
29918,
4905,
29918,
5464,
10660,
537,
29892,
13,
9651,
3659,
29918,
15501,
2133,
29922,
4172,
29918,
15501,
2133,
29892,
13,
9651,
7546,
29918,
8945,
2133,
29922,
13148,
29918,
8945,
2133,
29892,
13,
9651,
1024,
2433,
29954,
17019,
1988,
29925,
3195,
1495,
13,
13,
4706,
1583,
3032,
24926,
580,
13,
13,
1678,
822,
903,
24926,
29898,
1311,
1125,
13,
4706,
2106,
29918,
2080,
353,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
27074,
29898,
13264,
29889,
7411,
29941,
29906,
29892,
13,
462,
462,
1669,
8267,
7607,
8516,
29892,
1583,
29889,
26290,
29918,
6229,
876,
13,
4706,
3414,
29918,
2080,
353,
1583,
3032,
17987,
8497,
29889,
2080,
13,
4706,
3405,
296,
29918,
2080,
353,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
27074,
29898,
13,
9651,
15886,
29889,
7411,
29941,
29906,
29892,
8267,
7607,
8516,
29892,
1583,
3032,
17987,
8497,
29889,
5066,
296,
29918,
6229,
876,
13,
13,
4706,
411,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
11918,
29918,
6078,
29898,
1311,
29889,
978,
29897,
408,
7186,
29901,
13,
9651,
1583,
3032,
11918,
29918,
6078,
353,
7186,
13,
13,
9651,
411,
15886,
29889,
11918,
29918,
6078,
877,
17685,
29918,
5066,
296,
29918,
26290,
29374,
13,
18884,
3405,
296,
29918,
3859,
29918,
2080,
353,
15886,
29889,
17685,
29898,
13,
462,
1678,
518,
5066,
296,
29918,
2080,
29892,
2106,
29918,
2080,
1402,
9685,
10457,
29896,
29897,
13,
9651,
1583,
29889,
4299,
29889,
4282,
29898,
5066,
296,
29918,
3859,
29918,
2080,
29892,
1024,
2433,
3166,
29918,
5066,
296,
1495,
13,
13,
9651,
396,
14971,
411,
23655,
3564,
29915,
29879,
3405,
296,
1962,
13,
9651,
411,
15886,
29889,
11918,
29918,
6078,
877,
17685,
29918,
17987,
29918,
26290,
29374,
13,
18884,
3405,
296,
29918,
5721,
29918,
3888,
29918,
11967,
353,
1583,
3032,
17987,
8497,
29889,
5721,
29918,
3888,
29918,
11967,
29898,
13,
462,
1678,
3414,
29918,
2080,
29892,
1024,
2433,
5721,
29918,
3888,
29918,
11967,
1495,
13,
18884,
3405,
296,
29918,
1707,
353,
1583,
3032,
17987,
8497,
29889,
27691,
29889,
11249,
29918,
11967,
29898,
13,
462,
1678,
3405,
296,
29918,
5721,
29918,
3888,
29918,
11967,
29897,
13,
13,
18884,
8297,
29918,
3859,
29918,
2080,
353,
15886,
29889,
17685,
29898,
13,
462,
1678,
518,
5066,
296,
29918,
1707,
29892,
2106,
29918,
2080,
1402,
9685,
10457,
29896,
29897,
13,
9651,
1583,
29889,
4299,
29889,
4282,
29898,
17987,
29918,
3859,
29918,
2080,
29892,
1024,
2433,
4381,
1495,
13,
13,
4706,
1583,
3032,
29888,
29918,
5721,
29918,
5066,
296,
29918,
26290,
353,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
657,
29918,
4381,
29918,
7924,
2141,
5675,
29918,
4804,
519,
29898,
13,
9651,
518,
13,
18884,
1583,
29889,
4299,
29889,
11618,
29879,
1839,
3166,
29918,
5066,
296,
13359,
12676,
29892,
13,
18884,
1583,
29889,
4299,
29889,
11618,
29879,
1839,
3166,
29918,
5066,
296,
13359,
1188,
29918,
4172,
13,
9651,
21251,
13,
9651,
8343,
29918,
1761,
11759,
5066,
296,
29918,
2080,
29892,
2106,
29918,
2080,
2314,
13,
13,
4706,
1583,
3032,
29888,
29918,
5721,
29918,
7662,
29918,
26290,
353,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
657,
29918,
4381,
29918,
7924,
2141,
5675,
29918,
4804,
519,
29898,
13,
9651,
518,
13,
18884,
1583,
29889,
4299,
29889,
11618,
29879,
1839,
4381,
13359,
12676,
29892,
13,
18884,
1583,
29889,
4299,
29889,
11618,
29879,
1839,
4381,
13359,
1188,
29918,
4172,
29892,
13,
18884,
1583,
3032,
17987,
8497,
29889,
5066,
296,
29918,
12676,
29892,
13,
18884,
1583,
3032,
17987,
8497,
29889,
5066,
296,
29918,
4172,
29918,
3207,
29892,
13,
9651,
21251,
13,
9651,
8343,
29918,
1761,
11759,
7662,
29918,
2080,
29892,
2106,
29918,
2080,
2314,
13,
13,
1678,
822,
679,
29918,
2467,
29898,
1311,
29892,
15500,
1125,
13,
4706,
9995,
2577,
3158,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
15500,
313,
9302,
29889,
299,
2378,
1125,
21651,
362,
515,
278,
5177,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
313,
9302,
29889,
299,
2378,
1125,
9123,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
9995,
13,
4706,
12151,
29918,
7662,
29918,
26290,
353,
1583,
29889,
7662,
29918,
26739,
362,
29918,
3493,
29889,
1579,
8606,
29898,
26739,
362,
29897,
13,
4706,
12151,
29918,
7662,
29892,
12151,
29918,
26290,
353,
1583,
29889,
5451,
29918,
26739,
362,
29898,
20620,
29918,
7662,
29918,
26290,
29897,
13,
13,
4706,
313,
2467,
29918,
12676,
29892,
3158,
29918,
1188,
29918,
4172,
29892,
3405,
296,
29918,
12676,
29892,
3405,
296,
29918,
1188,
29918,
4172,
29897,
353,
1583,
3032,
29888,
29918,
5721,
29918,
7662,
29918,
26290,
4197,
20620,
29918,
7662,
1402,
518,
20620,
29918,
26290,
2314,
13,
13,
4706,
364,
299,
353,
7442,
29889,
8172,
29889,
8945,
29898,
2311,
29922,
2467,
29918,
12676,
29889,
12181,
29897,
13,
4706,
3158,
29918,
11249,
353,
364,
299,
334,
7442,
29889,
4548,
29898,
2467,
29918,
1188,
29918,
4172,
29897,
718,
3158,
29918,
12676,
13,
4706,
3158,
29918,
11249,
353,
1583,
29889,
2467,
29918,
3493,
29889,
348,
1579,
8606,
29898,
2467,
29918,
11249,
29961,
29900,
2314,
13,
4706,
3158,
29918,
12676,
353,
1583,
29889,
2467,
29918,
3493,
29889,
348,
1579,
8606,
29898,
2467,
29918,
12676,
29961,
29900,
2314,
13,
4706,
3158,
29918,
1188,
29918,
4172,
353,
1583,
29889,
2467,
29918,
3493,
29889,
348,
1579,
8606,
29898,
2467,
29918,
1188,
29918,
4172,
29961,
29900,
2314,
13,
13,
4706,
2099,
353,
1583,
3032,
17987,
8497,
29889,
5066,
296,
29918,
3493,
29889,
348,
1579,
8606,
29898,
5066,
296,
29918,
12676,
29961,
29900,
2314,
13,
4706,
1480,
29918,
4172,
353,
1583,
3032,
17987,
8497,
29889,
5066,
296,
29918,
3493,
29889,
348,
1579,
8606,
29898,
5066,
296,
29918,
1188,
29918,
4172,
29961,
29900,
2314,
13,
4706,
3405,
296,
29918,
3888,
353,
9657,
29898,
12676,
29922,
5066,
296,
29918,
12676,
29892,
1480,
29918,
4172,
29922,
5066,
296,
29918,
1188,
29918,
4172,
29897,
13,
4706,
736,
3158,
29892,
9657,
29898,
12676,
29922,
2467,
29918,
12676,
29892,
1480,
29918,
4172,
29922,
2467,
29918,
1188,
29918,
4172,
29892,
3405,
296,
29918,
3888,
29922,
5066,
296,
29918,
3888,
29897,
13,
13,
1678,
822,
679,
29918,
2467,
29918,
3166,
29918,
5066,
296,
29898,
1311,
29892,
3405,
296,
29892,
15500,
1125,
13,
4706,
9995,
2577,
3158,
4559,
29881,
515,
278,
3405,
296,
322,
15500,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
3405,
296,
313,
9302,
29889,
299,
2378,
1125,
7053,
296,
722,
515,
278,
8898,
29889,
13,
9651,
15500,
313,
9302,
29889,
299,
2378,
1125,
21651,
362,
515,
278,
5177,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
313,
9302,
29889,
299,
2378,
1125,
9123,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
9995,
13,
4706,
12151,
29918,
26290,
353,
1583,
29889,
26739,
362,
29918,
3493,
29889,
1579,
8606,
29898,
26739,
362,
29897,
13,
4706,
12151,
29918,
5066,
296,
353,
1583,
29889,
5066,
296,
29918,
3493,
29889,
1579,
8606,
29898,
5066,
296,
29897,
13,
13,
4706,
2099,
29892,
1480,
29918,
4172,
353,
1583,
3032,
29888,
29918,
5721,
29918,
5066,
296,
29918,
26290,
4197,
20620,
29918,
5066,
296,
1402,
518,
20620,
29918,
26290,
2314,
13,
4706,
364,
299,
353,
7442,
29889,
8172,
29889,
8945,
29898,
2311,
29922,
12676,
29889,
12181,
29897,
13,
4706,
4559,
353,
364,
299,
334,
7442,
29889,
4548,
29898,
1188,
29918,
4172,
29897,
718,
2099,
13,
4706,
4559,
353,
1583,
29889,
2467,
29918,
3493,
29889,
348,
1579,
8606,
29898,
11249,
29961,
29900,
2314,
13,
4706,
2099,
353,
1583,
29889,
2467,
29918,
3493,
29889,
348,
1579,
8606,
29898,
12676,
29961,
29900,
2314,
13,
4706,
1480,
29918,
4172,
353,
1583,
29889,
2467,
29918,
3493,
29889,
348,
1579,
8606,
29898,
1188,
29918,
4172,
29961,
29900,
2314,
13,
4706,
736,
4559,
29892,
9657,
29898,
12676,
29922,
12676,
29892,
1480,
29918,
4172,
29922,
1188,
29918,
4172,
29897,
13,
13,
1678,
822,
1320,
29918,
3888,
29918,
11967,
29898,
1311,
29892,
3414,
29918,
1707,
29892,
20881,
29918,
1707,
29892,
2106,
29918,
3888,
29918,
16908,
29922,
8516,
29892,
1024,
2433,
4381,
29374,
13,
4706,
9995,
8893,
263,
5829,
293,
3983,
310,
278,
4978,
4128,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
3414,
29918,
1707,
313,
13264,
29889,
29911,
6073,
1125,
323,
6073,
1881,
363,
5829,
293,
3983,
29889,
13,
9651,
20881,
29918,
1707,
313,
13264,
29889,
29911,
6073,
1125,
323,
6073,
1881,
363,
5829,
293,
3983,
29889,
13,
9651,
2106,
29918,
3888,
29918,
16908,
313,
8977,
1125,
7338,
336,
2106,
2472,
29892,
321,
29889,
29887,
29889,
13,
18884,
3517,
3158,
29889,
13,
9651,
1024,
313,
710,
1125,
4408,
363,
5829,
293,
3983,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
9657,
29961,
13264,
29889,
29911,
6073,
5387,
10604,
29879,
310,
278,
5829,
293,
3983,
310,
4978,
13,
18884,
4128,
29889,
13,
13,
4706,
9995,
13,
4706,
411,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
11918,
29918,
6078,
29898,
1311,
3032,
11918,
29918,
6078,
1125,
13,
9651,
3405,
296,
29918,
5721,
29918,
3888,
29918,
11967,
353,
1583,
3032,
17987,
8497,
29889,
5721,
29918,
3888,
29918,
11967,
29898,
13,
18884,
3414,
29918,
1707,
29892,
1024,
29922,
978,
29897,
13,
9651,
3405,
296,
353,
1583,
3032,
17987,
8497,
29889,
27691,
29889,
11249,
29918,
11967,
29898,
13,
18884,
3405,
296,
29918,
5721,
29918,
3888,
29918,
11967,
29897,
13,
9651,
8297,
29918,
3859,
29918,
2080,
353,
15886,
29889,
17685,
29898,
13,
18884,
518,
5066,
296,
29892,
20881,
29918,
1707,
1402,
9685,
10457,
29896,
29897,
13,
9651,
2099,
29918,
1707,
29892,
1480,
29918,
4172,
29918,
1707,
29892,
17117,
903,
353,
1583,
29889,
4299,
29889,
4282,
29898,
17987,
29918,
3859,
29918,
2080,
29892,
1024,
29922,
978,
29897,
13,
4706,
736,
9657,
29898,
12676,
29922,
12676,
29918,
1707,
29892,
1480,
29918,
4172,
29922,
1188,
29918,
4172,
29918,
1707,
29897,
13,
13,
1678,
822,
1320,
29918,
3888,
29918,
11967,
29918,
3166,
29918,
5066,
296,
29898,
1311,
29892,
3405,
296,
29918,
1707,
29892,
20881,
29918,
1707,
29892,
2106,
29918,
3888,
29918,
16908,
29922,
8516,
29892,
13,
462,
462,
29871,
1024,
2433,
3166,
29918,
5066,
296,
29374,
13,
4706,
9995,
8893,
263,
5829,
293,
3983,
310,
278,
4978,
4128,
515,
3405,
296,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
3405,
296,
29918,
1707,
313,
13264,
29889,
29911,
6073,
1125,
323,
6073,
1881,
363,
5829,
293,
3983,
29889,
13,
9651,
20881,
29918,
1707,
313,
13264,
29889,
29911,
6073,
1125,
323,
6073,
1881,
363,
5829,
293,
3983,
29889,
13,
9651,
2106,
29918,
3888,
29918,
16908,
313,
8977,
1125,
7338,
336,
2106,
2472,
29892,
321,
29889,
29887,
29889,
13,
18884,
3517,
3158,
29889,
13,
9651,
1024,
313,
710,
1125,
4408,
363,
5829,
293,
3983,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
9657,
29961,
13264,
29889,
29911,
6073,
5387,
10604,
29879,
310,
278,
5829,
293,
3983,
310,
4978,
13,
18884,
4128,
29889,
13,
13,
4706,
9995,
13,
4706,
411,
15886,
29889,
12667,
29889,
29894,
29896,
29889,
11918,
29918,
6078,
29898,
1311,
3032,
11918,
29918,
6078,
1125,
13,
9651,
8297,
29918,
3859,
29918,
2080,
353,
15886,
29889,
17685,
4197,
5066,
296,
29918,
1707,
29892,
20881,
29918,
1707,
1402,
9685,
10457,
29896,
29897,
13,
9651,
2099,
29918,
1707,
29892,
1480,
29918,
4172,
29918,
1707,
29892,
17117,
903,
353,
1583,
29889,
4299,
29889,
4282,
29898,
17987,
29918,
3859,
29918,
2080,
29892,
1024,
29922,
978,
29897,
13,
4706,
736,
9657,
29898,
12676,
29922,
12676,
29918,
1707,
29892,
1480,
29918,
4172,
29922,
1188,
29918,
4172,
29918,
1707,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4978,
29898,
1311,
1125,
13,
4706,
9995,
15644,
4978,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
1539,
279,
29880,
29889,
13264,
29889,
27691,
29879,
29889,
12130,
351,
7177,
29954,
17019,
29901,
25219,
4978,
29889,
13,
13,
4706,
9995,
13,
4706,
736,
1583,
29889,
4299,
29889,
11618,
29879,
1839,
4381,
13359,
5721,
13,
13,
1678,
822,
679,
29918,
2467,
29918,
3166,
29918,
650,
8711,
29898,
1311,
29892,
15500,
29892,
697,
8711,
1125,
13,
4706,
9995,
2577,
3158,
4559,
29881,
515,
278,
8898,
2729,
373,
697,
8711,
2380,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
15500,
313,
9302,
29889,
299,
2378,
1125,
21651,
362,
515,
278,
5177,
29889,
13,
9651,
697,
8711,
313,
9302,
29889,
299,
2378,
1125,
3118,
7375,
3414,
2380,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
313,
9302,
29889,
299,
2378,
1125,
9123,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
9995,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
1678,
822,
679,
29918,
7387,
29918,
3166,
29918,
650,
29882,
1862,
29898,
1311,
29892,
13917,
29892,
697,
29882,
1862,
1125,
13,
4706,
9995,
2577,
8820,
4559,
29881,
515,
278,
8898,
2729,
373,
697,
8711,
16285,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
13917,
313,
9302,
29889,
299,
2378,
1125,
21651,
800,
515,
278,
5177,
29889,
13,
9651,
697,
29882,
1862,
313,
9302,
29889,
299,
2378,
1125,
3118,
7375,
3414,
16285,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
313,
9302,
29889,
299,
2378,
1125,
9123,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
9995,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
1678,
822,
679,
29918,
7387,
29918,
3166,
29918,
5066,
1237,
29898,
1311,
29892,
13917,
29892,
3405,
1237,
1125,
13,
4706,
9995,
2577,
8820,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
13917,
313,
9302,
29889,
299,
2378,
1125,
21651,
800,
515,
278,
5177,
29889,
13,
9651,
3405,
1237,
313,
9302,
29889,
299,
2378,
1125,
7053,
296,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
313,
9302,
29889,
299,
2378,
1125,
319,
1953,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
9995,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
1678,
822,
679,
29918,
7387,
29898,
1311,
29892,
13917,
1125,
13,
4706,
9995,
2577,
3158,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
13917,
313,
1761,
29961,
9302,
29889,
299,
2378,
29962,
1125,
21651,
800,
515,
278,
5177,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
313,
9302,
29889,
299,
2378,
1125,
319,
1953,
4559,
29881,
515,
278,
8898,
29889,
13,
13,
4706,
9995,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
13,
13,
1678,
822,
4770,
657,
3859,
12035,
1311,
1125,
13,
4706,
9995,
2061,
17255,
657,
3859,
26914,
13,
13,
4706,
16969,
29901,
13,
9651,
9657,
29901,
278,
2106,
304,
367,
5839,
839,
363,
278,
2777,
29889,
13,
13,
4706,
9995,
13,
4706,
716,
29918,
8977,
353,
2428,
2141,
1649,
657,
3859,
1649,
580,
13,
4706,
628,
716,
29918,
8977,
1839,
29918,
29888,
29918,
5721,
29918,
5066,
296,
29918,
26290,
2033,
13,
4706,
628,
716,
29918,
8977,
1839,
29918,
29888,
29918,
5721,
29918,
7662,
29918,
26290,
2033,
13,
4706,
736,
716,
29918,
8977,
13,
13,
1678,
822,
4770,
842,
3859,
12035,
1311,
29892,
2106,
1125,
13,
4706,
9995,
2061,
17255,
842,
3859,
26914,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
2106,
313,
8977,
1125,
853,
23945,
839,
2106,
29889,
13,
13,
4706,
9995,
13,
4706,
2428,
2141,
1649,
842,
3859,
12035,
3859,
29897,
13,
4706,
1583,
3032,
24926,
580,
13,
13,
2
] |
sparse/coherence.py | dizcza/sparse-representation | 5 | 62509 | r"""
Mutual Coherence and Babel Function are the properties of a matrix, used to
estimate the Spark of a matrix, which in turn is used to determine the
optimality of the solution to :math:`\text{P}_0` problem.
Babel Function gives a tighter bound on the Spark of a matrix.
Spark of a matrix :math:`\boldsymbol{A}` is the size of the smallest subset of
linearly dependent columns of :math:`\boldsymbol{A}`.
.. currentmodule:: sparse.coherence
.. autosummary::
:toctree: toctree/coherence/
mutual_coherence
babel
"""
import math
from collections import namedtuple
import numpy as np
CoherenceSpark = namedtuple("CoherenceSpark", ("coherence", "spark"))
def mutual_coherence(mat):
r"""
For an arbitrary input matrix :math:`\boldsymbol{A}` of size `N` x `M`, the
mutual coherence is the maximal absolute inner-product between its
normalized columns :math:`\{ a_i \mid i=1,2,...,M \}`:
.. math::
\mu (\boldsymbol{A}) = \max_{1 \le i < j \le M}
\frac{\mid a_i^\top a_j \mid}{\|a_i\|_2 \|a_j\|_2}
:label: coh
The mutual coherence :math:`\mu` lies in range `[0, 1]`.
At the same time, the Spark lower bound of a matrix is estimated as
.. math::
\text{Spark}(\boldsymbol{A}) \ge 1 + \frac{1}{\mu(\boldsymbol{A})}
:label: spark
Parameters
----------
mat : (N, M) np.ndarray
The input matrix :math:`\boldsymbol{A}`.
Returns
-------
CoherenceSpark
A namedtuple with two attributes:
`.coherence` - mutual coherence of `mat`;
`.spark` - Spark lower bound :eq:`spark` of `mat`.
"""
mat = mat / np.linalg.norm(mat, axis=0)
gram = np.abs(mat.T.dot(mat))
np.fill_diagonal(gram, 0)
mu = gram.max()
spark = math.ceil(1 + 1 / mu)
return CoherenceSpark(mu, spark)
def babel(mat):
r"""
For an arbitrary input matrix :math:`\boldsymbol{A}` of size `N` x `M` and
normalized columns :math:`\{ a_i \mid i=1,2,...,M \}`, the Babel-Function
is defined by
.. math::
\mu_1(k) = \max_{\mid \Lambda \mid = k} \left[ \max_{j \notin \Lambda}
\sum_{i \in \Lambda}{\mid a_i^\top a_j \mid} \right]
:label: babel
If :math:`\mu_1(k-1) < 1`, this implies that any set of :math:`k` columns
from :math:`\boldsymbol{A}` are linearly dependent. In this case, the Spark
necessarily satisfies
.. math::
\text{Spark}(\boldsymbol{A}) > k = 1 + \arg \min_k
\left({\mu_1(k) > 1}\right)
:label: spark_babel
Parameters
----------
mat : (N, M) np.ndarray
The input matrix :math:`\boldsymbol{A}`.
Returns
-------
CoherenceSpark
A `namedtuple` with two attributes:
`.coherence` - a list of `M-1` elements of
:math:`\mu_1(k), \ k=1,2,...,M-1`;
`.spark` - Spark lower bound :eq:`spark_babel` of `mat`.
Notes
-----
:eq:`spark_babel` is a tighter bound on Spark than :eq:`spark`.
"""
mat = mat / np.linalg.norm(mat, axis=0)
gram = np.abs(mat.T.dot(mat))
# Gram matrix' of L2 normalized matrix entries are in range [0, 1]
# with 1s on the diagonal
gram.sort(axis=1) # sort rows
gram = gram[:, ::-1] # in descending order
gram = gram[:, 1:] # skip the first column of 1s (diagonal elements)
gram = gram.cumsum(axis=1) # cumsum rows
mu1 = gram.max(axis=0)
spark = np.nonzero(mu1 > 1)[0][0] + 2
return CoherenceSpark(mu1, spark)
def _quiz4():
mat = np.reshape([16, -2, 15, 13, 5, 6, 8, 8, 9, 4, 11, 12, 4, 12, 10, 1],
(4, 4))
print(mutual_coherence(mat))
print(babel(mat))
if __name__ == '__main__':
_quiz4()
| [
1,
364,
15945,
29908,
13,
29924,
329,
950,
315,
1148,
261,
663,
322,
350,
1107,
6680,
526,
278,
4426,
310,
263,
4636,
29892,
1304,
304,
13,
342,
6490,
278,
20814,
310,
263,
4636,
29892,
607,
297,
2507,
338,
1304,
304,
8161,
278,
13,
20640,
2877,
310,
278,
1650,
304,
584,
755,
18078,
29905,
726,
29912,
29925,
2403,
29900,
29952,
1108,
29889,
13,
13,
29933,
1107,
6680,
4076,
263,
260,
14643,
3216,
373,
278,
20814,
310,
263,
4636,
29889,
13,
13,
29903,
6378,
310,
263,
4636,
584,
755,
18078,
29905,
5916,
29912,
29909,
10114,
338,
278,
2159,
310,
278,
19087,
11306,
310,
13,
10660,
368,
14278,
4341,
310,
584,
755,
18078,
29905,
5916,
29912,
29909,
29913,
1412,
13,
13,
636,
1857,
5453,
1057,
29234,
29889,
1111,
2276,
663,
13,
13,
636,
1120,
359,
398,
5219,
1057,
13,
259,
584,
517,
312,
929,
29901,
304,
312,
929,
29914,
1111,
2276,
663,
29914,
13,
13,
259,
5478,
950,
29918,
1111,
2276,
663,
13,
259,
289,
1107,
13,
13,
15945,
29908,
13,
5215,
5844,
13,
3166,
16250,
1053,
4257,
23583,
13,
13,
5215,
12655,
408,
7442,
13,
13,
29907,
1148,
261,
663,
29903,
6378,
353,
4257,
23583,
703,
29907,
1148,
261,
663,
29903,
6378,
613,
4852,
1111,
2276,
663,
613,
376,
12597,
5783,
13,
13,
13,
1753,
5478,
950,
29918,
1111,
2276,
663,
29898,
2922,
1125,
13,
1678,
364,
15945,
29908,
13,
1678,
1152,
385,
11472,
1881,
4636,
584,
755,
18078,
29905,
5916,
29912,
29909,
10114,
310,
2159,
421,
29940,
29952,
921,
421,
29924,
1673,
278,
13,
1678,
5478,
950,
16165,
261,
663,
338,
278,
23183,
8380,
6426,
29899,
4704,
1546,
967,
13,
1678,
4226,
1891,
4341,
584,
755,
18078,
10045,
263,
29918,
29875,
320,
6563,
474,
29922,
29896,
29892,
29906,
27062,
29924,
320,
29913,
6998,
13,
13,
1678,
6317,
5844,
1057,
13,
4706,
320,
2589,
3441,
5916,
29912,
29909,
1800,
353,
320,
3317,
648,
29896,
320,
280,
474,
529,
432,
320,
280,
341,
29913,
13,
4706,
320,
1154,
741,
6563,
263,
29918,
29875,
3823,
3332,
263,
29918,
29926,
320,
6563,
3331,
29989,
29874,
29918,
29875,
7893,
29918,
29906,
12926,
29874,
29918,
29926,
7893,
29918,
29906,
29913,
13,
4706,
584,
1643,
29901,
16165,
13,
13,
1678,
450,
5478,
950,
16165,
261,
663,
584,
755,
18078,
29905,
2589,
29952,
12185,
297,
3464,
10338,
29900,
29892,
29871,
29896,
27865,
13,
13,
1678,
2180,
278,
1021,
931,
29892,
278,
20814,
5224,
3216,
310,
263,
4636,
338,
15899,
408,
13,
13,
1678,
6317,
5844,
1057,
13,
4706,
320,
726,
29912,
29903,
6378,
4678,
5916,
29912,
29909,
1800,
320,
479,
29871,
29896,
718,
320,
1154,
29912,
29896,
3331,
2589,
1194,
5916,
29912,
29909,
1800,
29913,
13,
4706,
584,
1643,
29901,
16267,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
1775,
584,
313,
29940,
29892,
341,
29897,
7442,
29889,
299,
2378,
13,
4706,
450,
1881,
4636,
584,
755,
18078,
29905,
5916,
29912,
29909,
29913,
1412,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
315,
1148,
261,
663,
29903,
6378,
13,
4706,
319,
4257,
23583,
411,
1023,
8393,
29901,
13,
3986,
5050,
1111,
2276,
663,
29952,
448,
5478,
950,
16165,
261,
663,
310,
421,
2922,
21966,
13,
13,
3986,
5050,
12597,
29952,
448,
20814,
5224,
3216,
584,
1837,
18078,
12597,
29952,
310,
421,
2922,
1412,
13,
13,
1678,
9995,
13,
1678,
1775,
353,
1775,
847,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
2922,
29892,
9685,
29922,
29900,
29897,
13,
1678,
14961,
353,
7442,
29889,
6897,
29898,
2922,
29889,
29911,
29889,
6333,
29898,
2922,
876,
13,
1678,
7442,
29889,
5589,
29918,
6051,
351,
7177,
29898,
1393,
29892,
29871,
29900,
29897,
13,
1678,
3887,
353,
14961,
29889,
3317,
580,
13,
1678,
16267,
353,
5844,
29889,
27696,
29898,
29896,
718,
29871,
29896,
847,
3887,
29897,
13,
1678,
736,
315,
1148,
261,
663,
29903,
6378,
29898,
2589,
29892,
16267,
29897,
13,
13,
13,
1753,
289,
1107,
29898,
2922,
1125,
13,
1678,
364,
15945,
29908,
13,
1678,
1152,
385,
11472,
1881,
4636,
584,
755,
18078,
29905,
5916,
29912,
29909,
10114,
310,
2159,
421,
29940,
29952,
921,
421,
29924,
29952,
322,
13,
1678,
4226,
1891,
4341,
584,
755,
18078,
10045,
263,
29918,
29875,
320,
6563,
474,
29922,
29896,
29892,
29906,
27062,
29924,
320,
29913,
1673,
278,
350,
1107,
29899,
6678,
13,
1678,
338,
3342,
491,
13,
13,
1678,
6317,
5844,
1057,
13,
4706,
320,
2589,
29918,
29896,
29898,
29895,
29897,
353,
320,
3317,
1665,
6563,
320,
9099,
320,
6563,
353,
413,
29913,
320,
1563,
29961,
320,
3317,
648,
29926,
320,
29842,
320,
9099,
29913,
13,
4706,
320,
2083,
648,
29875,
320,
262,
320,
9099,
3331,
6563,
263,
29918,
29875,
3823,
3332,
263,
29918,
29926,
320,
6563,
29913,
320,
1266,
29962,
13,
4706,
584,
1643,
29901,
289,
1107,
13,
13,
1678,
960,
584,
755,
18078,
29905,
2589,
29918,
29896,
29898,
29895,
29899,
29896,
29897,
529,
29871,
29896,
1673,
445,
10469,
393,
738,
731,
310,
584,
755,
18078,
29895,
29952,
4341,
13,
1678,
515,
584,
755,
18078,
29905,
5916,
29912,
29909,
10114,
526,
5608,
368,
14278,
29889,
512,
445,
1206,
29892,
278,
20814,
13,
1678,
12695,
17150,
13,
13,
1678,
6317,
5844,
1057,
13,
4706,
320,
726,
29912,
29903,
6378,
4678,
5916,
29912,
29909,
1800,
1405,
413,
353,
29871,
29896,
718,
320,
1191,
320,
1195,
29918,
29895,
13,
4706,
320,
1563,
13670,
2589,
29918,
29896,
29898,
29895,
29897,
1405,
29871,
29896,
1012,
1266,
29897,
13,
4706,
584,
1643,
29901,
16267,
29918,
28727,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
1775,
584,
313,
29940,
29892,
341,
29897,
7442,
29889,
299,
2378,
13,
4706,
450,
1881,
4636,
584,
755,
18078,
29905,
5916,
29912,
29909,
29913,
1412,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
315,
1148,
261,
663,
29903,
6378,
13,
4706,
319,
421,
17514,
23583,
29952,
411,
1023,
8393,
29901,
13,
3986,
5050,
1111,
2276,
663,
29952,
448,
263,
1051,
310,
421,
29924,
29899,
29896,
29952,
3161,
310,
13,
3986,
584,
755,
18078,
29905,
2589,
29918,
29896,
29898,
29895,
511,
320,
413,
29922,
29896,
29892,
29906,
27062,
29924,
29899,
29896,
21966,
13,
13,
3986,
5050,
12597,
29952,
448,
20814,
5224,
3216,
584,
1837,
18078,
12597,
29918,
28727,
29952,
310,
421,
2922,
1412,
13,
13,
1678,
8695,
13,
1678,
448,
807,
13,
1678,
584,
1837,
18078,
12597,
29918,
28727,
29952,
338,
263,
260,
14643,
3216,
373,
20814,
1135,
584,
1837,
18078,
12597,
1412,
13,
13,
1678,
9995,
13,
1678,
1775,
353,
1775,
847,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
2922,
29892,
9685,
29922,
29900,
29897,
13,
1678,
14961,
353,
7442,
29889,
6897,
29898,
2922,
29889,
29911,
29889,
6333,
29898,
2922,
876,
13,
1678,
396,
16878,
4636,
29915,
310,
365,
29906,
4226,
1891,
4636,
9976,
526,
297,
3464,
518,
29900,
29892,
29871,
29896,
29962,
13,
1678,
396,
411,
29871,
29896,
29879,
373,
278,
19640,
13,
1678,
14961,
29889,
6605,
29898,
8990,
29922,
29896,
29897,
29871,
396,
2656,
4206,
13,
1678,
14961,
353,
14961,
7503,
29892,
4761,
29899,
29896,
29962,
29871,
396,
297,
5153,
2548,
1797,
13,
1678,
14961,
353,
14961,
7503,
29892,
29871,
29896,
17531,
29871,
396,
14383,
278,
937,
1897,
310,
29871,
29896,
29879,
313,
6051,
351,
7177,
3161,
29897,
13,
1678,
14961,
353,
14961,
29889,
29883,
398,
2083,
29898,
8990,
29922,
29896,
29897,
29871,
396,
13299,
2083,
4206,
13,
1678,
3887,
29896,
353,
14961,
29889,
3317,
29898,
8990,
29922,
29900,
29897,
13,
1678,
16267,
353,
7442,
29889,
5464,
9171,
29898,
2589,
29896,
1405,
29871,
29896,
9601,
29900,
3816,
29900,
29962,
718,
29871,
29906,
13,
1678,
736,
315,
1148,
261,
663,
29903,
6378,
29898,
2589,
29896,
29892,
16267,
29897,
13,
13,
13,
1753,
903,
339,
466,
29946,
7295,
13,
1678,
1775,
353,
7442,
29889,
690,
14443,
4197,
29896,
29953,
29892,
448,
29906,
29892,
29871,
29896,
29945,
29892,
29871,
29896,
29941,
29892,
29871,
29945,
29892,
29871,
29953,
29892,
29871,
29947,
29892,
29871,
29947,
29892,
29871,
29929,
29892,
29871,
29946,
29892,
29871,
29896,
29896,
29892,
29871,
29896,
29906,
29892,
29871,
29946,
29892,
29871,
29896,
29906,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
1402,
13,
462,
268,
313,
29946,
29892,
29871,
29946,
876,
13,
1678,
1596,
29898,
6149,
950,
29918,
1111,
2276,
663,
29898,
2922,
876,
13,
1678,
1596,
29898,
28727,
29898,
2922,
876,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
903,
339,
466,
29946,
580,
13,
2
] |
aio_parallel_tools/aio_task_pool/core/mixins/queue_mixin/simpleq_mixin.py | Python-Tools/aio_parallel_tools | 0 | 1615676 | <gh_stars>0
"""Submit tasks and Send Signals using simple Q."""
import asyncio
from typing import Optional, Dict, List, Any, Callable, Union
from aio_parallel_tools.aio_task_pool.core.task import Task
from aio_parallel_tools.aio_task_pool.core.signal import WorkerCloseSignal
class SimpleQMixin:
"""Submit tasks and Send Signals using simple Q.
Requirement:
loop (Property): Event loop.
Support:
queue(Property): Event loop.
waiting_tasks_number(Property): Task size in queue.
max_tasks_number(Property): Queue's max size.
make_message (Method): Make task to message.
make_close_signal (Method): Make worker colse signal.
parser_message (Method): Parser messages from queue.
"""
def __init__(self,
queue: Optional[asyncio.Queue] = None,
queue_maxsize: int = 0) -> None:
"""Initialize Simple Queue Mixin.
Args:
queue (Optional[asyncio.Queue], optional): Using a exist queue. Defaults to None.
queue_maxsize (int, optional): Set the maxsize of a new queue. Defaults to 0.
"""
if isinstance(queue, asyncio.Queue):
self._queue = queue
else:
self._queue = asyncio.Queue(maxsize=queue_maxsize, loop=self.loop)
@property
def queue(self):
"""Queue for sending and receiving tasks."""
return self._queue
@property
def waiting_tasks_number(self) -> int:
"""Now number of the waiting tasks.
Returns:
int: The number of the waiting tasks.
"""
return self._queue.qsize()
@property
def max_tasks_number(self) -> int:
"""Maximum number of the waiting tasks.
Returns:
int: The maximum number of the waiting tasks.
"""
return self._queue.maxsize
def make_message(self, task: Task, **kwargs):
"""Make task message to send."""
return task
def make_close_signal(self):
"""Make close signal to send."""
return WorkerCloseSignal
def parser_message(self, message: Any) -> Any:
"""Parser messages from queue."""
return message
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
16228,
9595,
322,
15076,
9954,
1338,
773,
2560,
660,
1213,
15945,
13,
5215,
408,
948,
3934,
13,
3166,
19229,
1053,
28379,
29892,
360,
919,
29892,
2391,
29892,
3139,
29892,
8251,
519,
29892,
7761,
13,
3166,
263,
601,
29918,
23482,
29918,
8504,
29889,
29874,
601,
29918,
7662,
29918,
10109,
29889,
3221,
29889,
7662,
1053,
9330,
13,
3166,
263,
601,
29918,
23482,
29918,
8504,
29889,
29874,
601,
29918,
7662,
29918,
10109,
29889,
3221,
29889,
25436,
1053,
5244,
261,
11123,
10140,
284,
13,
13,
13,
1990,
12545,
29984,
29924,
861,
262,
29901,
13,
1678,
9995,
16228,
9595,
322,
15076,
9954,
1338,
773,
2560,
660,
29889,
13,
13,
1678,
830,
1548,
358,
29901,
13,
13,
4706,
2425,
313,
4854,
1125,
6864,
2425,
29889,
13,
13,
1678,
18601,
29901,
13,
13,
4706,
9521,
29898,
4854,
1125,
6864,
2425,
29889,
13,
13,
4706,
10534,
29918,
20673,
29918,
4537,
29898,
4854,
1125,
9330,
2159,
297,
9521,
29889,
13,
13,
4706,
4236,
29918,
20673,
29918,
4537,
29898,
4854,
1125,
5462,
434,
29915,
29879,
4236,
2159,
29889,
13,
13,
4706,
1207,
29918,
4906,
313,
4062,
1125,
8561,
3414,
304,
2643,
29889,
13,
13,
4706,
1207,
29918,
5358,
29918,
25436,
313,
4062,
1125,
8561,
15645,
784,
344,
7182,
29889,
13,
13,
4706,
13812,
29918,
4906,
313,
4062,
1125,
1459,
643,
7191,
515,
9521,
29889,
13,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
9521,
29901,
28379,
29961,
294,
948,
3934,
29889,
10620,
29962,
353,
6213,
29892,
13,
462,
9521,
29918,
3317,
2311,
29901,
938,
353,
29871,
29900,
29897,
1599,
6213,
29901,
13,
4706,
9995,
6644,
6646,
12545,
5462,
434,
23478,
262,
29889,
13,
13,
4706,
826,
3174,
29901,
13,
9651,
9521,
313,
27636,
29961,
294,
948,
3934,
29889,
10620,
1402,
13136,
1125,
5293,
263,
1863,
9521,
29889,
13109,
29879,
304,
6213,
29889,
13,
9651,
9521,
29918,
3317,
2311,
313,
524,
29892,
13136,
1125,
3789,
278,
4236,
2311,
310,
263,
716,
9521,
29889,
13109,
29879,
304,
29871,
29900,
29889,
13,
13,
4706,
9995,
13,
4706,
565,
338,
8758,
29898,
9990,
29892,
408,
948,
3934,
29889,
10620,
1125,
13,
9651,
1583,
3032,
9990,
353,
9521,
13,
4706,
1683,
29901,
13,
9651,
1583,
3032,
9990,
353,
408,
948,
3934,
29889,
10620,
29898,
3317,
2311,
29922,
9990,
29918,
3317,
2311,
29892,
2425,
29922,
1311,
29889,
7888,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
9521,
29898,
1311,
1125,
13,
4706,
9995,
10620,
363,
9348,
322,
13442,
9595,
1213,
15945,
13,
4706,
736,
1583,
3032,
9990,
13,
13,
1678,
732,
6799,
13,
1678,
822,
10534,
29918,
20673,
29918,
4537,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
9995,
10454,
1353,
310,
278,
10534,
9595,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
938,
29901,
450,
1353,
310,
278,
10534,
9595,
29889,
13,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
9990,
29889,
29939,
2311,
580,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4236,
29918,
20673,
29918,
4537,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
9995,
7976,
12539,
1353,
310,
278,
10534,
9595,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
938,
29901,
450,
7472,
1353,
310,
278,
10534,
9595,
29889,
13,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
9990,
29889,
3317,
2311,
13,
13,
1678,
822,
1207,
29918,
4906,
29898,
1311,
29892,
3414,
29901,
9330,
29892,
3579,
19290,
1125,
13,
4706,
9995,
9984,
3414,
2643,
304,
3638,
1213,
15945,
13,
4706,
736,
3414,
13,
13,
1678,
822,
1207,
29918,
5358,
29918,
25436,
29898,
1311,
1125,
13,
4706,
9995,
9984,
3802,
7182,
304,
3638,
1213,
15945,
13,
4706,
736,
5244,
261,
11123,
10140,
284,
13,
13,
1678,
822,
13812,
29918,
4906,
29898,
1311,
29892,
2643,
29901,
3139,
29897,
1599,
3139,
29901,
13,
4706,
9995,
11726,
7191,
515,
9521,
1213,
15945,
13,
4706,
736,
2643,
13,
2
] |
tests/test_utils.py | Kirembu/qpanel | 0 | 39129 | import unittest
from qpanel.utils import clean_str_to_div_id, underscore_to_camelcase, \
timedelta_from_field_dict
from qpanel.convert import convert_time_when_param
import time
import datetime
class UtilsTestClass(unittest.TestCase):
def test_clean_str_to_div(self):
div = 'ro/.d. i _@l_k/d_@'
self.assertEqual(clean_str_to_div_id(div), 'ro-_d_ i __l_k-d__')
def test_underscore_to_camelcase(self):
a = 'rodrigoRamirez'
self.assertEqual(underscore_to_camelcase(a), 'Rodrigoramirez')
a = 'rodrigo_Ramirez'
self.assertEqual(underscore_to_camelcase(a), 'RodrigoRamirez')
a = 'rodrigo_ramirez'
self.assertEqual(underscore_to_camelcase(a), 'RodrigoRamirez')
a = '_rodrigo_ramirez'
self.assertEqual(underscore_to_camelcase(a), '_RodrigoRamirez')
def test_timedelta_from_field_dict(self):
now = time.time()
d = {'time': now, 'time2': 'hola'}
self.assertEqual(timedelta_from_field_dict('time', d, now + 1),
datetime.timedelta(0, 1))
self.assertNotEqual(
timedelta_from_field_dict(
'time',
d,
now + 1),
datetime.timedelta(
0,
10))
self.assertEqual(
timedelta_from_field_dict(
'time',
d,
now + 100),
datetime.timedelta(
0,
100))
self.assertEqual(
timedelta_from_field_dict(
'timeno',
d,
now + 100),
datetime.timedelta(
0,
0))
self.assertEqual(
str(timedelta_from_field_dict('time', d, now + 1)), '0:00:01')
self.assertEqual(
timedelta_from_field_dict(
'time', d, now), datetime.timedelta(
0, 0))
self.assertEqual(
str(timedelta_from_field_dict('time', d, now)), '0:00:00')
d2 = {'time': 60, 'time2': 6001}
self.assertEqual(str(timedelta_from_field_dict(
'time', d2, None, True)), '0:01:00')
self.assertEqual(str(timedelta_from_field_dict(
'time2', d2, None, True)), '1:40:01')
def test_convert_time_when_param(self):
value = 'test1,00:00:00'
self.assertEqual(convert_time_when_param(value),
{'when': 'test1', 'hour': '00:00:00'})
value = 'test1'
self.assertEqual(convert_time_when_param(value),
{'when': 'test1', 'hour': '00:00:00'})
value = 'test1, 00:00:01'
self.assertEqual(convert_time_when_param(value),
{'when': 'test1', 'hour': '00:00:01'})
value = 'test1, string_wrong'
self.assertEqual(convert_time_when_param(value),
{'when': 'test1', 'hour': '00:00:00'})
value = 'test1; 00:00:01'
self.assertEqual(convert_time_when_param(value, splitter=';'),
{'when': 'test1', 'hour': '00:00:01'})
# runs the unit tests
if __name__ == '__main__':
unittest.main()
| [
1,
1053,
443,
27958,
13,
3166,
3855,
15119,
29889,
13239,
1053,
5941,
29918,
710,
29918,
517,
29918,
4563,
29918,
333,
29892,
23400,
3221,
29918,
517,
29918,
11108,
295,
4878,
29892,
320,
13,
1678,
5335,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
13,
3166,
3855,
15119,
29889,
13441,
1053,
3588,
29918,
2230,
29918,
8256,
29918,
3207,
13,
5215,
931,
13,
5215,
12865,
13,
13,
13,
1990,
22310,
29879,
3057,
2385,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
1243,
29918,
14941,
29918,
710,
29918,
517,
29918,
4563,
29898,
1311,
1125,
13,
4706,
1933,
353,
525,
307,
6294,
29881,
29889,
474,
903,
29992,
29880,
29918,
29895,
29914,
29881,
29918,
29992,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
14941,
29918,
710,
29918,
517,
29918,
4563,
29918,
333,
29898,
4563,
511,
525,
307,
29899,
29918,
29881,
29918,
474,
4770,
29880,
29918,
29895,
29899,
29881,
1649,
1495,
13,
13,
1678,
822,
1243,
29918,
870,
414,
3221,
29918,
517,
29918,
11108,
295,
4878,
29898,
1311,
1125,
13,
4706,
263,
353,
525,
5964,
29878,
5973,
29934,
314,
533,
29920,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
870,
414,
3221,
29918,
517,
29918,
11108,
295,
4878,
29898,
29874,
511,
525,
29934,
397,
8966,
272,
314,
533,
29920,
1495,
13,
4706,
263,
353,
525,
5964,
29878,
5973,
29918,
29934,
314,
533,
29920,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
870,
414,
3221,
29918,
517,
29918,
11108,
295,
4878,
29898,
29874,
511,
525,
29934,
397,
29878,
5973,
29934,
314,
533,
29920,
1495,
13,
4706,
263,
353,
525,
5964,
29878,
5973,
29918,
2572,
533,
29920,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
870,
414,
3221,
29918,
517,
29918,
11108,
295,
4878,
29898,
29874,
511,
525,
29934,
397,
29878,
5973,
29934,
314,
533,
29920,
1495,
13,
4706,
263,
353,
22868,
5964,
29878,
5973,
29918,
2572,
533,
29920,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
870,
414,
3221,
29918,
517,
29918,
11108,
295,
4878,
29898,
29874,
511,
22868,
29934,
397,
29878,
5973,
29934,
314,
533,
29920,
1495,
13,
13,
1678,
822,
1243,
29918,
9346,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
29898,
1311,
1125,
13,
4706,
1286,
353,
931,
29889,
2230,
580,
13,
4706,
270,
353,
11117,
2230,
2396,
1286,
29892,
525,
2230,
29906,
2396,
525,
29882,
2963,
10827,
13,
4706,
1583,
29889,
9294,
9843,
29898,
9346,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
877,
2230,
742,
270,
29892,
1286,
718,
29871,
29896,
511,
13,
462,
308,
12865,
29889,
9346,
287,
2554,
29898,
29900,
29892,
29871,
29896,
876,
13,
4706,
1583,
29889,
9294,
3664,
9843,
29898,
13,
9651,
5335,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
29898,
13,
18884,
525,
2230,
742,
13,
18884,
270,
29892,
13,
18884,
1286,
718,
29871,
29896,
511,
13,
9651,
12865,
29889,
9346,
287,
2554,
29898,
13,
462,
29900,
29892,
13,
462,
29896,
29900,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
5335,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
29898,
13,
18884,
525,
2230,
742,
13,
18884,
270,
29892,
13,
18884,
1286,
718,
29871,
29896,
29900,
29900,
511,
13,
9651,
12865,
29889,
9346,
287,
2554,
29898,
13,
462,
29900,
29892,
13,
462,
29896,
29900,
29900,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
5335,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
29898,
13,
18884,
525,
9346,
8154,
742,
13,
18884,
270,
29892,
13,
18884,
1286,
718,
29871,
29896,
29900,
29900,
511,
13,
9651,
12865,
29889,
9346,
287,
2554,
29898,
13,
462,
29900,
29892,
13,
462,
29900,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
851,
29898,
9346,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
877,
2230,
742,
270,
29892,
1286,
718,
29871,
29896,
8243,
525,
29900,
29901,
29900,
29900,
29901,
29900,
29896,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
5335,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
29898,
13,
18884,
525,
2230,
742,
270,
29892,
1286,
511,
12865,
29889,
9346,
287,
2554,
29898,
13,
462,
29900,
29892,
29871,
29900,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
851,
29898,
9346,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
877,
2230,
742,
270,
29892,
1286,
8243,
525,
29900,
29901,
29900,
29900,
29901,
29900,
29900,
1495,
13,
13,
4706,
270,
29906,
353,
11117,
2230,
2396,
29871,
29953,
29900,
29892,
525,
2230,
29906,
2396,
29871,
29953,
29900,
29900,
29896,
29913,
13,
4706,
1583,
29889,
9294,
9843,
29898,
710,
29898,
9346,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
29898,
13,
9651,
525,
2230,
742,
270,
29906,
29892,
6213,
29892,
5852,
8243,
525,
29900,
29901,
29900,
29896,
29901,
29900,
29900,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
710,
29898,
9346,
287,
2554,
29918,
3166,
29918,
2671,
29918,
8977,
29898,
13,
9651,
525,
2230,
29906,
742,
270,
29906,
29892,
6213,
29892,
5852,
8243,
525,
29896,
29901,
29946,
29900,
29901,
29900,
29896,
1495,
13,
13,
1678,
822,
1243,
29918,
13441,
29918,
2230,
29918,
8256,
29918,
3207,
29898,
1311,
1125,
13,
4706,
995,
353,
525,
1688,
29896,
29892,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29900,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13441,
29918,
2230,
29918,
8256,
29918,
3207,
29898,
1767,
511,
13,
462,
308,
11117,
8256,
2396,
525,
1688,
29896,
742,
525,
18721,
2396,
525,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29900,
29915,
1800,
13,
13,
4706,
995,
353,
525,
1688,
29896,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13441,
29918,
2230,
29918,
8256,
29918,
3207,
29898,
1767,
511,
13,
462,
308,
11117,
8256,
2396,
525,
1688,
29896,
742,
525,
18721,
2396,
525,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29900,
29915,
1800,
13,
13,
4706,
995,
353,
525,
1688,
29896,
29892,
29871,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29896,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13441,
29918,
2230,
29918,
8256,
29918,
3207,
29898,
1767,
511,
13,
462,
308,
11117,
8256,
2396,
525,
1688,
29896,
742,
525,
18721,
2396,
525,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29896,
29915,
1800,
13,
13,
4706,
995,
353,
525,
1688,
29896,
29892,
1347,
29918,
15866,
549,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13441,
29918,
2230,
29918,
8256,
29918,
3207,
29898,
1767,
511,
13,
462,
308,
11117,
8256,
2396,
525,
1688,
29896,
742,
525,
18721,
2396,
525,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29900,
29915,
1800,
13,
13,
4706,
995,
353,
525,
1688,
29896,
29936,
29871,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29896,
29915,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13441,
29918,
2230,
29918,
8256,
29918,
3207,
29898,
1767,
29892,
6219,
357,
2433,
29936,
5477,
13,
462,
308,
11117,
8256,
2396,
525,
1688,
29896,
742,
525,
18721,
2396,
525,
29900,
29900,
29901,
29900,
29900,
29901,
29900,
29896,
29915,
1800,
13,
13,
13,
29937,
6057,
278,
5190,
6987,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
wetterdienst/dwd/__init__.py | kmuehlbauer/wetterdienst | 1 | 41794 | # Load Pandas DataFrame extension.
import wetterdienst.dwd.pandas # noqa:F401
| [
1,
396,
16012,
349,
7086,
3630,
4308,
6081,
29889,
13,
5215,
7990,
357,
26293,
29889,
29881,
9970,
29889,
15112,
29871,
396,
694,
25621,
29901,
29943,
29946,
29900,
29896,
13,
2
] |
server/www/packages/packages-windows/x86/ldap3/version.py | zhoulhb/teleport | 640 | 94889 | <filename>server/www/packages/packages-windows/x86/ldap3/version.py
# THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY# version file for ldap3
# generated on 2018-08-01 17:55:24.174707
# on system uname_result(system='Windows', node='ELITE10GC', release='10', version='10.0.17134', machine='AMD64', processor='Intel64 Family 6 Model 58 Stepping 9, GenuineIntel')
# with Python 3.7.0 - ('v3.7.0:1bf9cc5093', 'Jun 27 2018 04:59:51') - MSC v.1914 64 bit (AMD64)
#
__version__ = '2.5.1'
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__url__ = 'https://github.com/cannatag/ldap3'
__description__ = 'A strictly RFC 4510 conforming LDAP V3 pure Python client library'
__status__ = '5 - Production/Stable'
__license__ = 'LGPL v3'
| [
1,
529,
9507,
29958,
2974,
29914,
1636,
29914,
8318,
29914,
8318,
29899,
10499,
29914,
29916,
29947,
29953,
29914,
430,
481,
29941,
29914,
3259,
29889,
2272,
13,
29937,
3446,
3235,
24080,
8519,
26524,
29949,
29899,
24647,
1001,
3040,
29928,
29889,
349,
14063,
11662,
6058,
16999,
4571,
29943,
29979,
29937,
1873,
934,
363,
301,
29881,
481,
29941,
30004,
13,
29937,
5759,
373,
29871,
29906,
29900,
29896,
29947,
29899,
29900,
29947,
29899,
29900,
29896,
29871,
29896,
29955,
29901,
29945,
29945,
29901,
29906,
29946,
29889,
29896,
29955,
29946,
29955,
29900,
29955,
30004,
13,
29937,
373,
1788,
443,
420,
29918,
2914,
29898,
5205,
2433,
7685,
742,
2943,
2433,
6670,
9094,
29896,
29900,
8766,
742,
6507,
2433,
29896,
29900,
742,
1873,
2433,
29896,
29900,
29889,
29900,
29889,
29896,
29955,
29896,
29941,
29946,
742,
4933,
2433,
5194,
29928,
29953,
29946,
742,
21433,
2433,
2928,
295,
29953,
29946,
14662,
29871,
29953,
8125,
29871,
29945,
29947,
2443,
3262,
29871,
29929,
29892,
402,
4814,
457,
2928,
295,
1495,
30004,
13,
29937,
411,
5132,
29871,
29941,
29889,
29955,
29889,
29900,
448,
6702,
29894,
29941,
29889,
29955,
29889,
29900,
29901,
29896,
1635,
29929,
617,
29945,
29900,
29929,
29941,
742,
525,
29967,
348,
29871,
29906,
29955,
29871,
29906,
29900,
29896,
29947,
29871,
29900,
29946,
29901,
29945,
29929,
29901,
29945,
29896,
1495,
448,
341,
7187,
325,
29889,
29896,
29929,
29896,
29946,
29871,
29953,
29946,
2586,
313,
5194,
29928,
29953,
29946,
8443,
13,
29937,
30004,
13,
1649,
3259,
1649,
353,
525,
29906,
29889,
29945,
29889,
29896,
29915,
30004,
13,
1649,
8921,
1649,
353,
12801,
5813,
16299,
30004,
13,
1649,
5269,
1649,
353,
12801,
26862,
6227,
16299,
30004,
13,
1649,
2271,
1649,
353,
525,
991,
597,
3292,
29889,
510,
29914,
29883,
812,
271,
351,
29914,
430,
481,
29941,
29915,
30004,
13,
1649,
8216,
1649,
353,
525,
29909,
18719,
390,
8610,
29871,
29946,
29945,
29896,
29900,
14670,
292,
365,
29928,
3301,
478,
29941,
8296,
5132,
3132,
3489,
29915,
30004,
13,
1649,
4882,
1649,
353,
525,
29945,
448,
19561,
29914,
855,
519,
29915,
30004,
13,
1649,
506,
1947,
1649,
353,
525,
29931,
29954,
7390,
325,
29941,
29915,
30004,
13,
2
] |
ML/linear-regression/dependent.py | PepSalehi/algorithms | 0 | 118713 | #!/usr/bin/env python
# 3rd party modules
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_absolute_error
import numpy as np
# config
n = 10**6
feature_dim = 3
# create data
x = np.random.rand(n * feature_dim).reshape(n, feature_dim)
y_true = np.random.rand(n)
# x[:, 1] = x[:, 0]
print("Frist 3 points of {} with dimension {}:".format(n, feature_dim))
print(x[:3])
# create and fit
regressor = LinearRegression()
regressor.fit(x, y_true)
# Show what it learned
print("coef_: {}".format(regressor.coef_))
print("intercept: {:.4f}".format(regressor.intercept_))
y_pred = regressor.predict(x)
print("MAE: {:.4f}".format(mean_absolute_error(y_true, y_pred)))
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
29937,
29871,
29941,
5499,
6263,
10585,
13,
3166,
2071,
19668,
29889,
10660,
29918,
4299,
1053,
22985,
4597,
23881,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
2099,
29918,
23552,
29918,
2704,
13,
5215,
12655,
408,
7442,
13,
13,
29937,
2295,
13,
29876,
353,
29871,
29896,
29900,
1068,
29953,
13,
14394,
29918,
6229,
353,
29871,
29941,
13,
13,
29937,
1653,
848,
13,
29916,
353,
7442,
29889,
8172,
29889,
9502,
29898,
29876,
334,
4682,
29918,
6229,
467,
690,
14443,
29898,
29876,
29892,
4682,
29918,
6229,
29897,
13,
29891,
29918,
3009,
353,
7442,
29889,
8172,
29889,
9502,
29898,
29876,
29897,
13,
29937,
921,
7503,
29892,
29871,
29896,
29962,
353,
921,
7503,
29892,
29871,
29900,
29962,
13,
2158,
703,
29943,
2021,
29871,
29941,
3291,
310,
6571,
411,
9927,
426,
6177,
1642,
4830,
29898,
29876,
29892,
4682,
29918,
6229,
876,
13,
2158,
29898,
29916,
7503,
29941,
2314,
13,
13,
29937,
1653,
322,
6216,
13,
276,
3663,
272,
353,
22985,
4597,
23881,
580,
13,
276,
3663,
272,
29889,
9202,
29898,
29916,
29892,
343,
29918,
3009,
29897,
13,
13,
29937,
7704,
825,
372,
10972,
13,
2158,
703,
1111,
1389,
29918,
29901,
418,
6571,
1642,
4830,
29898,
276,
3663,
272,
29889,
1111,
1389,
29918,
876,
13,
2158,
703,
1639,
1547,
29901,
29871,
12365,
29889,
29946,
29888,
29913,
1642,
4830,
29898,
276,
3663,
272,
29889,
1639,
1547,
29918,
876,
13,
29891,
29918,
11965,
353,
337,
3663,
272,
29889,
27711,
29898,
29916,
29897,
13,
2158,
703,
1529,
29923,
29901,
4706,
12365,
29889,
29946,
29888,
29913,
1642,
4830,
29898,
12676,
29918,
23552,
29918,
2704,
29898,
29891,
29918,
3009,
29892,
343,
29918,
11965,
4961,
13,
2
] |
Week 1 - Not so-simple Hello World/AhmadHelloWorld.py | Jasleenk47/BeginnerRoom-2020 | 5 | 42022 | print("Starter")
print("Ahmad")
print("Hello World")
print("Not so Simple") | [
1,
1596,
703,
855,
4254,
1159,
30004,
13,
2158,
703,
29909,
7184,
328,
1159,
30004,
13,
2158,
703,
10994,
2787,
1159,
30004,
13,
2158,
703,
3664,
577,
12545,
1159,
2
] |
src/wee/urls.py | dipkakwani/wee_app | 2 | 36004 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf.urls.static import static
from userModule.views import home
from userModule.views import userSettings
from userModule.views import logout
from groupModule.views import createGroup
from groupModule.views import group
from groupModule.views import selectgroup
from groupModule.views import groupSettings
from wee.views import *
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
import settings
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'wee.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^home/$', home),
url(r'^newsfeed/$', newsfeed),
url(r'^logout/$', logout),
url(r'^post/$', newPost),
url(r'^newgroup/$', createGroup),
url(r'^settings/$', userSettings),
url(r'^group/(?P<groupId>\d+)/$', group),
url(r'^groups/$' , selectgroup),
url(r'^group/(?P<groupId>\d+)/settings/$', groupSettings),
url(r'^friends/$' , friends) ,
url(r'^timeline/(?P<profileUserId>\d+)/(?P<change>\w)/friend/$', updateFriend),
url(r'^timeline/(?P<profileUserId>\d+)/follow/$', updateFollow),
url(r'^timeline/(?P<profileUserId>\d+)/$', timeline),
url(r'^search/$', search),
url(r'^like/(?P<postId>\d+)/$', like),
url(r'^getlike/(?P<postId>\d+)/$', getLike),
url(r'^comment/(?P<postId>\d+)/$', comment),
url(r'^getcomment/(?P<postId>\d+)/$', getComment),
url(r'^share/(?P<postId>\d+)/$', share),
url(r'^getshare/(?P<postId>\d+)/$', getShare),
)
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += patterns('', url(r'^.*/$', notfound), )
| [
1,
515,
9557,
29889,
5527,
29889,
26045,
1053,
15038,
29892,
3160,
29892,
3142,
13,
3166,
9557,
29889,
21570,
1053,
4113,
13,
3166,
9557,
29889,
5527,
29889,
26045,
29889,
7959,
1053,
2294,
13,
3166,
1404,
7355,
29889,
7406,
1053,
3271,
13,
3166,
1404,
7355,
29889,
7406,
1053,
1404,
9585,
13,
3166,
1404,
7355,
29889,
7406,
1053,
1480,
449,
13,
3166,
2318,
7355,
29889,
7406,
1053,
1653,
4782,
13,
3166,
2318,
7355,
29889,
7406,
1053,
2318,
13,
3166,
2318,
7355,
29889,
7406,
1053,
1831,
2972,
13,
3166,
2318,
7355,
29889,
7406,
1053,
2318,
9585,
13,
3166,
591,
29872,
29889,
7406,
1053,
334,
13,
3166,
9557,
29889,
21570,
29889,
7959,
5325,
29889,
26045,
1053,
2294,
5325,
29918,
2271,
11037,
29879,
13,
13,
5215,
6055,
13,
13,
2271,
11037,
29879,
353,
15038,
877,
742,
13,
1678,
396,
1222,
9422,
29901,
13,
1678,
396,
3142,
29898,
29878,
29915,
29985,
29938,
742,
525,
705,
29872,
29889,
7406,
29889,
5184,
742,
1024,
2433,
5184,
5477,
13,
1678,
396,
3142,
29898,
29878,
29915,
29985,
7312,
29914,
742,
3160,
877,
7312,
29889,
26045,
1495,
511,
13,
13,
1678,
3142,
29898,
29878,
29915,
29985,
6406,
29914,
742,
3160,
29898,
6406,
29889,
2746,
29889,
26045,
8243,
13,
1678,
3142,
29898,
29878,
29915,
29985,
5184,
13346,
742,
3271,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
15753,
18798,
13346,
742,
9763,
18798,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
1188,
449,
13346,
742,
1480,
449,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
2490,
13346,
742,
716,
6747,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
1482,
2972,
13346,
742,
1653,
4782,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
11027,
13346,
742,
1404,
9585,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
2972,
29914,
10780,
29925,
29966,
9688,
14247,
29881,
29974,
6802,
29938,
742,
2318,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
13155,
13346,
29915,
1919,
1831,
2972,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
2972,
29914,
10780,
29925,
29966,
9688,
14247,
29881,
29974,
6802,
11027,
13346,
742,
2318,
9585,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
7932,
1975,
13346,
29915,
1919,
7875,
29897,
1919,
13,
1678,
3142,
29898,
29878,
29915,
29985,
9346,
5570,
29914,
10780,
29925,
29966,
10185,
2659,
1204,
14247,
29881,
29974,
6802,
10780,
29925,
29966,
3167,
14247,
29893,
6802,
18326,
13346,
742,
2767,
27034,
355,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
9346,
5570,
29914,
10780,
29925,
29966,
10185,
2659,
1204,
14247,
29881,
29974,
6802,
23031,
13346,
742,
2767,
29943,
2952,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
9346,
5570,
29914,
10780,
29925,
29966,
10185,
2659,
1204,
14247,
29881,
29974,
6802,
29938,
742,
5335,
5570,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
4478,
13346,
742,
2740,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
4561,
29914,
10780,
29925,
29966,
2490,
1204,
14247,
29881,
29974,
6802,
29938,
742,
763,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
657,
4561,
29914,
10780,
29925,
29966,
2490,
1204,
14247,
29881,
29974,
6802,
29938,
742,
679,
27552,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
9342,
29914,
10780,
29925,
29966,
2490,
1204,
14247,
29881,
29974,
6802,
29938,
742,
3440,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
657,
9342,
29914,
10780,
29925,
29966,
2490,
1204,
14247,
29881,
29974,
6802,
29938,
742,
679,
20001,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
13653,
29914,
10780,
29925,
29966,
2490,
1204,
14247,
29881,
29974,
6802,
29938,
742,
6232,
511,
13,
1678,
3142,
29898,
29878,
29915,
29985,
657,
13653,
29914,
10780,
29925,
29966,
2490,
1204,
14247,
29881,
29974,
6802,
29938,
742,
679,
2713,
598,
511,
13,
13,
13,
29897,
13,
2271,
11037,
29879,
4619,
2294,
5325,
29918,
2271,
11037,
29879,
580,
13,
2271,
11037,
29879,
4619,
2294,
29898,
11027,
29889,
2303,
4571,
29909,
29918,
4219,
29892,
1842,
29918,
4632,
29922,
11027,
29889,
2303,
4571,
29909,
29918,
21289,
29897,
13,
2271,
11037,
29879,
4619,
15038,
877,
742,
3142,
29898,
29878,
29915,
29985,
29889,
3877,
29938,
742,
451,
11940,
511,
1723,
13,
2
] |
toy_example/data_import.py | hericonejito/health_recommendations | 0 | 176831 | <gh_stars>0
import pandas as pd
import datetime as dt
class DataImport:
def __init__(self):
self.user_ses_df = None
def import_decagon_data(self,data_path,adjust_pk_names=False,custom_user = 'U', order_by_time=True, pk_item = 'pk_article',custom_session = 'S',custom_article = 'A',seperator='\t'):
user_ses_df = pd.read_csv(data_path, sep=seperator, header=None)
print(user_ses_df)
user_ses_df.columns = ['pk_user', 'pk_session', pk_item, ]
if adjust_pk_names == True:
user_ses_df['pk_user'] = custom_user + user_ses_df['pk_user'].astype('str')
user_ses_df['pk_session'] = custom_session + user_ses_df['pk_session'].astype('str')
user_ses_df[pk_item] = custom_article + user_ses_df[pk_item].astype('str')
user_ses_df = user_ses_df.fillna(0)
self.user_ses_df = user_ses_df
def import_user_click_data(self, data_path, adjust_pk_names=False,custom_user = 'U', order_by_time=True, pk_item = 'pk_article',custom_session = 'S',custom_article = 'A',seperator='\t'):
'''
Import user click and session data from data_path and
return it in a pandas Dataframe (ordered by time if requested)
'''
self.pk_item = pk_item
user_ses_df = pd.read_csv(data_path, sep=seperator, header=None)
print(user_ses_df)
user_ses_df.columns = ['pk_user', 'pk_session', pk_item, 'timeview', 'date', 'time']
user_ses_df['date-time'] = pd.to_datetime(user_ses_df['date'] + ' ' + user_ses_df['time'],
format='%Y-%m-%d %H:%M:%S')
user_ses_df.drop(['date', 'time'], axis=1, inplace=True)
if order_by_time:
user_ses_df.sort_values('date-time', inplace=True)
if adjust_pk_names == True:
user_ses_df['pk_user'] = custom_user + user_ses_df['pk_user'].astype('str')
user_ses_df['pk_session'] = custom_session + user_ses_df['pk_session'].astype('str')
user_ses_df[pk_item] = custom_article + user_ses_df[pk_item].astype('str')
user_ses_df = user_ses_df.fillna(0)
self.user_ses_df = user_ses_df
def filter_short_sessions(self, n_items=2):
'''
From the dataframe remove those sessions that have less than 2 articles
'''
articles_per_session = self.user_ses_df.groupby(['pk_session'])[self.pk_item].nunique()
long_sessions = articles_per_session[articles_per_session >= n_items]
self.user_ses_df = self.user_ses_df[self.user_ses_df['pk_session'].isin(long_sessions.keys())]
def reduce_timeframe(self, from_date=dt.datetime(2015,1,1), to_date=dt.datetime(2018,12,31)):
'''
Reduce the dataset by filtering only the dates from the given period
'''
self.user_ses_df = self.user_ses_df[(self.user_ses_df['date-time'] >= from_date)
& (self.user_ses_df['date-time'] <= to_date)]
def import_categories_data(self, data_path):
categories_data = pd.read_csv(data_path, sep='\t',
names=['id', 'article', 'category1', 'category2', 'category3', 'category4', 'category5'])
categories_data['article'] = 'A' + categories_data['article'].astype('str')
categories_data.drop('id', 1, inplace=True)
categories_data.set_index('article', inplace=True)
# Create a dict from the dataframe
cat_dict = categories_data.to_dict('index')
# For each article assign the most probable category
# (later can be assigned several with different weights)
article_cat = dict()
for a in cat_dict:
most_probable_cat = [k for k, v in cat_dict[a].items() if v == max(cat_dict[a].values())][0]
article_cat[a] = most_probable_cat
cat_df = pd.DataFrame(list(article_cat.items()), columns=[self.pk_item, 'pk_category'])
self.user_ses_df = pd.merge(self.user_ses_df, cat_df, how='right', on=[self.pk_item, self.pk_item])
def import_video_categories(self, data_path):
video_cat_data = pd.read_csv(data_path, sep='\t', names=[self.pk_item, 'video_category_id'])
video_cat_data[self.pk_item] = 'A' + video_cat_data[self.pk_item].astype('str')
video_cat_data['video_category_id'] = 'C' + video_cat_data['video_category_id'].astype('str')
video_cat_data.set_index(self.pk_item, inplace=True)
self.video_cat_data = video_cat_data
def import_locations_data(self, data_path):
locations_data = pd.read_csv(data_path, sep='\t', names=['article', 'location'])
locations_data['article'] = 'A' + locations_data['article'].astype('str')
self.locations_data = locations_data
def remove_inactive_users(self, n_sessions=2):
sessions_per_user = self.user_ses_df.groupby(['pk_user'])['pk_session'].nunique()
active_users = sessions_per_user[sessions_per_user >= n_sessions]
self.user_ses_df = self.user_ses_df[self.user_ses_df['pk_user'].isin(active_users.keys())] | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
11701,
408,
10518,
30004,
13,
5215,
12865,
408,
11636,
30004,
13,
30004,
13,
1990,
3630,
17518,
29901,
30004,
13,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
30004,
13,
4706,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
353,
6213,
30004,
13,
30004,
13,
1678,
822,
1053,
29918,
7099,
12841,
29918,
1272,
29898,
1311,
29892,
1272,
29918,
2084,
29892,
328,
5143,
29918,
20571,
29918,
7039,
29922,
8824,
29892,
6341,
29918,
1792,
353,
525,
29965,
742,
1797,
29918,
1609,
29918,
2230,
29922,
5574,
29892,
282,
29895,
29918,
667,
353,
525,
20571,
29918,
7914,
742,
6341,
29918,
7924,
353,
525,
29903,
742,
6341,
29918,
7914,
353,
525,
29909,
742,
344,
546,
1061,
2433,
29905,
29873,
29374,
30004,
13,
4706,
1404,
29918,
29879,
267,
29918,
2176,
353,
10518,
29889,
949,
29918,
7638,
29898,
1272,
29918,
2084,
29892,
16345,
29922,
344,
546,
1061,
29892,
4839,
29922,
8516,
8443,
13,
4706,
1596,
29898,
1792,
29918,
29879,
267,
29918,
2176,
8443,
13,
4706,
1404,
29918,
29879,
267,
29918,
2176,
29889,
13099,
353,
6024,
20571,
29918,
1792,
742,
525,
20571,
29918,
7924,
742,
282,
29895,
29918,
667,
29892,
4514,
30004,
13,
30004,
13,
30004,
13,
4706,
565,
10365,
29918,
20571,
29918,
7039,
1275,
5852,
29901,
30004,
13,
9651,
1404,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
1792,
2033,
353,
2888,
29918,
1792,
718,
1404,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
1792,
13359,
579,
668,
877,
710,
1495,
30004,
13,
9651,
1404,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
7924,
2033,
353,
2888,
29918,
7924,
718,
1404,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
7924,
13359,
579,
668,
877,
710,
1495,
30004,
13,
9651,
1404,
29918,
29879,
267,
29918,
2176,
29961,
20571,
29918,
667,
29962,
353,
2888,
29918,
7914,
718,
1404,
29918,
29879,
267,
29918,
2176,
29961,
20571,
29918,
667,
1822,
579,
668,
877,
710,
1495,
30004,
13,
4706,
1404,
29918,
29879,
267,
29918,
2176,
353,
1404,
29918,
29879,
267,
29918,
2176,
29889,
5589,
1056,
29898,
29900,
8443,
13,
4706,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
353,
1404,
29918,
29879,
267,
29918,
2176,
30004,
13,
1678,
822,
1053,
29918,
1792,
29918,
3808,
29918,
1272,
29898,
1311,
29892,
848,
29918,
2084,
29892,
10365,
29918,
20571,
29918,
7039,
29922,
8824,
29892,
6341,
29918,
1792,
353,
525,
29965,
742,
1797,
29918,
1609,
29918,
2230,
29922,
5574,
29892,
282,
29895,
29918,
667,
353,
525,
20571,
29918,
7914,
742,
6341,
29918,
7924,
353,
525,
29903,
742,
6341,
29918,
7914,
353,
525,
29909,
742,
344,
546,
1061,
2433,
29905,
29873,
29374,
30004,
13,
4706,
14550,
30004,
13,
4706,
16032,
1404,
2828,
322,
4867,
848,
515,
848,
29918,
2084,
322,
30004,
13,
4706,
736,
372,
297,
263,
11701,
3630,
2557,
313,
21693,
491,
931,
565,
13877,
8443,
13,
4706,
14550,
30004,
13,
30004,
13,
4706,
1583,
29889,
20571,
29918,
667,
353,
282,
29895,
29918,
667,
30004,
13,
30004,
13,
4706,
1404,
29918,
29879,
267,
29918,
2176,
353,
10518,
29889,
949,
29918,
7638,
29898,
1272,
29918,
2084,
29892,
16345,
29922,
344,
546,
1061,
29892,
4839,
29922,
8516,
8443,
13,
4706,
1596,
29898,
1792,
29918,
29879,
267,
29918,
2176,
8443,
13,
4706,
1404,
29918,
29879,
267,
29918,
2176,
29889,
13099,
353,
6024,
20571,
29918,
1792,
742,
525,
20571,
29918,
7924,
742,
282,
29895,
29918,
667,
29892,
525,
2230,
1493,
742,
525,
1256,
742,
525,
2230,
2033,
30004,
13,
4706,
1404,
29918,
29879,
267,
29918,
2176,
1839,
1256,
29899,
2230,
2033,
353,
10518,
29889,
517,
29918,
12673,
29898,
1792,
29918,
29879,
267,
29918,
2176,
1839,
1256,
2033,
718,
525,
525,
718,
1404,
29918,
29879,
267,
29918,
2176,
1839,
2230,
7464,
30004,
13,
462,
462,
462,
29871,
3402,
2433,
29995,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
1495,
30004,
13,
4706,
1404,
29918,
29879,
267,
29918,
2176,
29889,
8865,
18959,
1256,
742,
525,
2230,
7464,
9685,
29922,
29896,
29892,
297,
6689,
29922,
5574,
8443,
13,
4706,
565,
1797,
29918,
1609,
29918,
2230,
29901,
30004,
13,
9651,
1404,
29918,
29879,
267,
29918,
2176,
29889,
6605,
29918,
5975,
877,
1256,
29899,
2230,
742,
297,
6689,
29922,
5574,
8443,
13,
30004,
13,
4706,
565,
10365,
29918,
20571,
29918,
7039,
1275,
5852,
29901,
30004,
13,
9651,
1404,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
1792,
2033,
353,
2888,
29918,
1792,
718,
1404,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
1792,
13359,
579,
668,
877,
710,
1495,
30004,
13,
9651,
1404,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
7924,
2033,
353,
2888,
29918,
7924,
718,
1404,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
7924,
13359,
579,
668,
877,
710,
1495,
30004,
13,
9651,
1404,
29918,
29879,
267,
29918,
2176,
29961,
20571,
29918,
667,
29962,
353,
2888,
29918,
7914,
718,
1404,
29918,
29879,
267,
29918,
2176,
29961,
20571,
29918,
667,
1822,
579,
668,
877,
710,
1495,
30004,
13,
4706,
1404,
29918,
29879,
267,
29918,
2176,
353,
1404,
29918,
29879,
267,
29918,
2176,
29889,
5589,
1056,
29898,
29900,
8443,
13,
4706,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
353,
1404,
29918,
29879,
267,
29918,
2176,
30004,
13,
30004,
13,
30004,
13,
1678,
822,
4175,
29918,
12759,
29918,
29879,
10964,
29898,
1311,
29892,
302,
29918,
7076,
29922,
29906,
1125,
30004,
13,
4706,
14550,
30004,
13,
4706,
3645,
278,
12205,
3349,
1906,
21396,
393,
505,
3109,
1135,
29871,
29906,
7456,
30004,
13,
4706,
14550,
30004,
13,
4706,
7456,
29918,
546,
29918,
7924,
353,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
29889,
27789,
18959,
20571,
29918,
7924,
2033,
9601,
1311,
29889,
20571,
29918,
667,
1822,
29876,
13092,
26471,
13,
4706,
1472,
29918,
29879,
10964,
353,
7456,
29918,
546,
29918,
7924,
29961,
18569,
29918,
546,
29918,
7924,
6736,
302,
29918,
7076,
29962,
30004,
13,
30004,
13,
4706,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
353,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
29961,
1311,
29889,
1792,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
7924,
13359,
275,
262,
29898,
5426,
29918,
29879,
10964,
29889,
8149,
3101,
29962,
30004,
13,
30004,
13,
30004,
13,
1678,
822,
10032,
29918,
2230,
2557,
29898,
1311,
29892,
515,
29918,
1256,
29922,
6008,
29889,
12673,
29898,
29906,
29900,
29896,
29945,
29892,
29896,
29892,
29896,
511,
304,
29918,
1256,
29922,
6008,
29889,
12673,
29898,
29906,
29900,
29896,
29947,
29892,
29896,
29906,
29892,
29941,
29896,
22164,
30004,
13,
4706,
14550,
30004,
13,
4706,
4367,
24551,
278,
8783,
491,
21166,
871,
278,
10116,
515,
278,
2183,
3785,
30004,
13,
4706,
14550,
30004,
13,
4706,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
353,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
15625,
1311,
29889,
1792,
29918,
29879,
267,
29918,
2176,
1839,
1256,
29899,
2230,
2033,
6736,
515,
29918,
1256,
8443,
13,
462,
462,
9651,
669,
313,
1311,
29889,
1792,
29918,
29879,
267,
29918,
2176,
1839,
1256,
29899,
2230,
2033,
5277,
304,
29918,
1256,
4638,
30004,
13,
30004,
13,
30004,
13,
1678,
822,
1053,
29918,
20683,
29918,
1272,
29898,
1311,
29892,
848,
29918,
2084,
1125,
30004,
13,
30004,
13,
4706,
13997,
29918,
1272,
353,
10518,
29889,
949,
29918,
7638,
29898,
1272,
29918,
2084,
29892,
16345,
2433,
29905,
29873,
23592,
13,
462,
462,
418,
2983,
29922,
1839,
333,
742,
525,
7914,
742,
525,
7320,
29896,
742,
525,
7320,
29906,
742,
525,
7320,
29941,
742,
525,
7320,
29946,
742,
525,
7320,
29945,
2033,
8443,
13,
4706,
13997,
29918,
1272,
1839,
7914,
2033,
353,
525,
29909,
29915,
718,
13997,
29918,
1272,
1839,
7914,
13359,
579,
668,
877,
710,
1495,
30004,
13,
4706,
13997,
29918,
1272,
29889,
8865,
877,
333,
742,
29871,
29896,
29892,
297,
6689,
29922,
5574,
8443,
13,
4706,
13997,
29918,
1272,
29889,
842,
29918,
2248,
877,
7914,
742,
297,
6689,
29922,
5574,
8443,
13,
30004,
13,
4706,
396,
6204,
263,
9657,
515,
278,
12205,
30004,
13,
4706,
6635,
29918,
8977,
353,
13997,
29918,
1272,
29889,
517,
29918,
8977,
877,
2248,
1495,
30004,
13,
30004,
13,
4706,
396,
1152,
1269,
4274,
3566,
278,
1556,
16269,
7663,
30004,
13,
4706,
396,
313,
29880,
1008,
508,
367,
9859,
3196,
411,
1422,
18177,
8443,
13,
4706,
4274,
29918,
4117,
353,
9657,
26471,
13,
4706,
363,
263,
297,
6635,
29918,
8977,
29901,
30004,
13,
9651,
1556,
29918,
22795,
519,
29918,
4117,
353,
518,
29895,
363,
413,
29892,
325,
297,
6635,
29918,
8977,
29961,
29874,
1822,
7076,
580,
565,
325,
1275,
4236,
29898,
4117,
29918,
8977,
29961,
29874,
1822,
5975,
3101,
3816,
29900,
29962,
30004,
13,
9651,
4274,
29918,
4117,
29961,
29874,
29962,
353,
1556,
29918,
22795,
519,
29918,
4117,
30004,
13,
30004,
13,
4706,
6635,
29918,
2176,
353,
10518,
29889,
17271,
29898,
1761,
29898,
7914,
29918,
4117,
29889,
7076,
25739,
4341,
11759,
1311,
29889,
20571,
29918,
667,
29892,
525,
20571,
29918,
7320,
2033,
8443,
13,
30004,
13,
4706,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
353,
10518,
29889,
14634,
29898,
1311,
29889,
1792,
29918,
29879,
267,
29918,
2176,
29892,
6635,
29918,
2176,
29892,
920,
2433,
1266,
742,
373,
11759,
1311,
29889,
20571,
29918,
667,
29892,
1583,
29889,
20571,
29918,
667,
2314,
30004,
13,
30004,
13,
30004,
13,
1678,
822,
1053,
29918,
9641,
29918,
20683,
29898,
1311,
29892,
848,
29918,
2084,
1125,
30004,
13,
30004,
13,
4706,
4863,
29918,
4117,
29918,
1272,
353,
10518,
29889,
949,
29918,
7638,
29898,
1272,
29918,
2084,
29892,
16345,
2433,
29905,
29873,
742,
2983,
11759,
1311,
29889,
20571,
29918,
667,
29892,
525,
9641,
29918,
7320,
29918,
333,
2033,
8443,
13,
4706,
4863,
29918,
4117,
29918,
1272,
29961,
1311,
29889,
20571,
29918,
667,
29962,
353,
525,
29909,
29915,
718,
4863,
29918,
4117,
29918,
1272,
29961,
1311,
29889,
20571,
29918,
667,
1822,
579,
668,
877,
710,
1495,
30004,
13,
4706,
4863,
29918,
4117,
29918,
1272,
1839,
9641,
29918,
7320,
29918,
333,
2033,
353,
525,
29907,
29915,
718,
4863,
29918,
4117,
29918,
1272,
1839,
9641,
29918,
7320,
29918,
333,
13359,
579,
668,
877,
710,
1495,
30004,
13,
4706,
4863,
29918,
4117,
29918,
1272,
29889,
842,
29918,
2248,
29898,
1311,
29889,
20571,
29918,
667,
29892,
297,
6689,
29922,
5574,
8443,
13,
30004,
13,
4706,
1583,
29889,
9641,
29918,
4117,
29918,
1272,
353,
4863,
29918,
4117,
29918,
1272,
30004,
13,
30004,
13,
30004,
13,
1678,
822,
1053,
29918,
2029,
800,
29918,
1272,
29898,
1311,
29892,
848,
29918,
2084,
1125,
30004,
13,
30004,
13,
4706,
14354,
29918,
1272,
353,
10518,
29889,
949,
29918,
7638,
29898,
1272,
29918,
2084,
29892,
16345,
2433,
29905,
29873,
742,
2983,
29922,
1839,
7914,
742,
525,
5479,
2033,
8443,
13,
4706,
14354,
29918,
1272,
1839,
7914,
2033,
353,
525,
29909,
29915,
718,
14354,
29918,
1272,
1839,
7914,
13359,
579,
668,
877,
710,
1495,
30004,
13,
30004,
13,
4706,
1583,
29889,
2029,
800,
29918,
1272,
353,
14354,
29918,
1272,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
1678,
822,
3349,
29918,
262,
4925,
29918,
7193,
29898,
1311,
29892,
302,
29918,
29879,
10964,
29922,
29906,
1125,
30004,
13,
30004,
13,
4706,
21396,
29918,
546,
29918,
1792,
353,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
29889,
27789,
18959,
20571,
29918,
1792,
11287,
1839,
20571,
29918,
7924,
13359,
29876,
13092,
26471,
13,
4706,
6136,
29918,
7193,
353,
21396,
29918,
546,
29918,
1792,
29961,
29879,
10964,
29918,
546,
29918,
1792,
6736,
302,
29918,
29879,
10964,
29962,
30004,
13,
30004,
13,
4706,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
353,
1583,
29889,
1792,
29918,
29879,
267,
29918,
2176,
29961,
1311,
29889,
1792,
29918,
29879,
267,
29918,
2176,
1839,
20571,
29918,
1792,
13359,
275,
262,
29898,
4925,
29918,
7193,
29889,
8149,
3101,
29962,
2
] |
festival/management/commands/export_artists.py | mykonosbiennale/mykonosbiennale.github.io | 0 | 85845 | <filename>festival/management/commands/export_artists.py
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import time, traceback
import collections
import re
import os
import sys
import csv
import pprint, json
import optparse
from django.core.files.base import ContentFile
from nameparser import HumanName
from django.core.serializers import serialize
from django.core.management.base import BaseCommand
from django.conf import settings
from django.utils.text import slugify
from festivaly import models as festivaly_models
from festival import models as festival_models
from filmfestival import models as filmffestival_models
class Command(BaseCommand):
help = '''rename all images'''
def handle(self, *args, **kwargs):
artists = {}
for artist in json.loads(serialize('json', festival_models.Artist.objects.all())):
artist['fields']['headshot'] = 'https://s3.amazonaws.com/com.mykonosbiennale.static/' + artist['fields'][
'headshot']
artists[artist['pk']] = artist
festivals = dict([(x['pk'], x) for x in json.loads(serialize('json', festival_models.Festival.objects.all()))])
projects = dict([(x['pk'], x['fields']) for x in json.loads(serialize('json', festival_models.Project.objects.all()))])
project_art = collections.defaultdict(list)
for artwork in json.loads(serialize('json', festival_models.Art.objects.all())):
artwork['fields']['photo'] = 'https://s3.amazonaws.com/com.mykonosbiennale.static/'+ artwork['fields']['photo']
artwork['fields']['artist_name'] = artists[artwork['fields']['artist']]['fields']['name']
project_art[artwork['fields']['project']].append(artwork)
festivals_projects = collections.defaultdict(list)
for project in json.loads(serialize('json', festival_models.Project.objects.all())):
festivals_projects[project['fields']['festival']].append(project)
project['art'] = project_art[project['pk']]
for festival in festivals.itervalues():
festival['projects'] = festivals_projects[festival['pk']]
mb = {
'festivals':festivals,
'artists': artists
}
with open('mb.json','wb') as mb_json:
json.dump(mb, mb_json)
# artist_project = collections.defaultdict(list)
# art = {}
# for artwork in json.loads(serialize('json', festival_models.Art.objects.all())):
# art[artwork['pk']] = art
# artist_project[(artwork['fields']['artist'], artwork['fields']['project'])].append(artwork)
# pprint.pprint(dict(artist_project))
#
#
# # self.rename_poster(film)
# self.rename_stills(film)
#
# def rename_poster(self, film):
# year = film.project.festival.year
# festival = film.project.festival.slug
# if film.poster:
# print film.poster.name
# ext = os.path.splitext(film.poster.name)[-1]
# poster_name = "images/mykonos-biennale-{}-{}-{}-{}-poster{}".format(
# year,
# festival,
# film.project.slug,
# film.slug.strip('-'),
# ext
# )
# poster = ContentFile(film.poster.read())
# poster.name = poster_name
# film.poster = poster
# film.save()
# print film.poster.name
#
# def rename_stills(self, film):
# print film.slug
# for i, image in enumerate(film.filmfestival_image_related.all()):
# print i, image.image.name
#
#
#
# # # for festival in festivaly_models.Festival.objects.all():
# # # print (festival, festival.slug, festival.get_absolute_url())
# # # for project in festivaly_models.Project.objects.all():
# # # print (project, project.slug, project.get_absolute_url())
# # # for festival_project in festivaly_models.FestivalProject.objects.all():
# # # festival_project.save()
# # # print (festival_project, festival_project.slug, festival_project.get_absolute_url())
# #
# # # f_2017 = festivaly_models.Festival.objects.get(year=2017)
# # # for project in festivaly_models.Project.objects.all():
# # # festival_project,_ = festivaly_models.FestivalProject.objects.get_or_create(
# # # festival= f_2017,
# # # project = project,
# # # name = project.name,
# # # text = project.text)
# #
# # # for festival in festival_models.Festival.objects.all():
# # # for projectx in festival.projectx_set.all():
# # # print festival, projectx
# #
# # def rec_2(self):
# # for artist in festival_models.Artist.objects.all():
# # try:
# # festivaly_models.Participant.objects.get(name=artist.name)
# # except:
# # self.mirgate_artist(artist)
# #
# # # for festival_project in festivaly_models.FestivalProject.objects.filter(festival__year=2015):
# # # ps = festival_models.ProjectSeason.objects.filter(project__title = festival_project.name).first()
# # # if ps:
# # # print('found', ps, 'matches',festival_project)
# #
# # # for artist in set([art.artist for art in ps.art_set.all()]):
# #
# # def purge(self):
# # print festivaly_models.FilmDirector.objects.count()
# # pees = [fd.participant for fd in festivaly_models.FilmDirector.objects.all()]
# # map(lambda x: x.delete(), pees)
# #
# # def process_names(self, text):
# # for name in re.split("\s*[\/&,]\s*", text):
# # yield HumanName(name)
# #
# # # build album for each art piece
# #
# # # album = {
# # # 'festivalproject':festivalproject,
# # # 'name': '{} - {}'.format(artist.name, work),
# # # 'text': (works[work][0].description + '\n\n'+ works[work][0].text).strip(),
# # # 'media':[]
# # # }
# # # artwork = festivaly_models.Art.objects.create(
# # # name = album['name'],
# # # text = album['text']
# # # )
# #
# # def migrate_film(self, old_film):
# # # image = ContentFile(old_film.poster.read())
# # dir_list = [str(name) for name in self.process_names(old_film.dir_by)]
# # slug = slugify(old_film.title + '-' + ' '.join(dir_list))
# # festivalproject = festivaly_models.FestivalProject.objects.get(festival__year=2015, project__name={
# # 'Dramatic Nights': 'Dramatic Nights',
# # 'Video Graffiti': 'Video Graffiti',
# # 'Dance': 'Video Graffiti',
# # 'Video Grafitti': 'Video Graffiti',
# # 'Documentary': 'Dramatic Nights',
# # }[old_film.film_type])
# # poster = None
# # if old_film.poster:
# # poster = ContentFile(old_film.poster.read())
# # poster_name = 'mykonos-biennale-{}-{}-{}-post{}'.format(
# # festivalproject.festival.slug,
# # festivalproject.project.slug,
# # old_film.slug,
# # os.path.splitext(old_film.poster.name)[1]
# # )
# #
# # # if old_film.trailer_video:
# # # #trailer_video = ContentFile(old_film.trailer_video.read())
# # # trailer_video_name = 'mykonos-biennale-{}-{}-{}-trailer{}'.format(
# # # festivalproject.festival.slug,
# # # festivalproject.project.slug,
# # # old_film.slug,
# # # os.path.splitext(old_film.poster.name)[1]
# # # )
# # def synopsis(film):
# # if film.log_line:
# # return film.log_line
# # elif film.synopsis_125:
# # return film.synopsis_125
# # elif film.synopsis_250:
# # return film.synopsis_250
# # else:
# # return film.synopsis
# #
# # stills, _ = festivaly_models.Album.objects.get_or_create(
# # name="{} dir. by {}".format(old_film.title, ', '.join(dir_list)),
# # defaults=dict(
# # text=synopsis(old_film),
# # )
# # )
# #
# # film, created = festivaly_models.Film.objects.get_or_create(ref=old_film.ref,
# # defaults=dict(
# # film_source=old_film.source.lower(),
# # ref=old_film.ref,
# # entry_status=old_film.status.lower(),
# # film_type={
# # 'Dramatic Nights': 'short',
# # 'Video Graffiti': 'art_video',
# # 'Video Grafitti': 'art_video',
# # 'Dance': 'dance',
# # 'Documentary': 'documentary',
# # }.get(old_film.film_type),
# # name=old_film.title,
# # original_title=old_film.original_title,
# # sub_by=old_film.sub_by,
# # contact_email=old_film.contact_email,
# # contact_phone=old_film.contact_phone,
# # posted_on_facebook=old_film.posted_on_facebook,
# # subtitles=old_film.subtitles,
# # language=old_film.language,
# # actors=old_film.actors,
# # year=old_film.year,
# # runtime=old_film.runtime,
# # country=old_film.country,
# # projection_copy=old_film.projection_copy,
# # projection_copy_url=old_film.projection_copy_url,
# # coming=False,
# # present=old_film.present,
# # when=old_film.when,
# # log_line=old_film.log_line,
# # synopsis=old_film.synopsis,
# # synopsis_125=old_film.synopsis_125,
# # synopsis_250=old_film.synopsis_250,
# # first_time=old_film.first_time,
# # twitter=old_film.twitter,
# # facebook=old_film.facebook,
# # other_social_media=old_film.other_social_media,
# # url=old_film.url,
# # screenwriters=old_film.screenwriters,
# # producers=old_film.producers,
# # exec_producers=old_film.exec_producers,
# # co_producers=old_film.co_producers,
# # cinematographers=old_film.cinematographers,
# # product_designers=old_film.product_designers,
# # art_directors=old_film.art_directors,
# # editors=old_film.editors,
# # sound_editors=old_film.sound_editors,
# # composers=old_film.composers,
# # crew=old_film.crew,
# # screenings=old_film.screenings,
# # genres=old_film.genres,
# # niches=old_film.niches,
# # info=old_film.info,
# # directors_statement=old_film.directors_statement,
# # production_notes=old_film.production_notes,
# # poster=poster,
# # trailer_url=old_film.trailer_url,
# # trailer_embed=old_film.trailer_embed,
# # stills=stills
# # )
# # )
# #
# # for i, image in enumerate(old_film.filmfestival_image_related.all()):
# #
# # new_image = ContentFile(image.image.read())
# # image_name = 'mykonos-biennale-{}-{}-{}-still{}{}'.format(
# # festivalproject.festival.slug,
# # festivalproject.project.slug,
# # old_film.slug,
# # ('-%d' % i) if i else '',
# # os.path.splitext(image.image.name)[1]
# # )
# # media, created = festivaly_models.Media.objects.get_or_create(
# # name='still of {}{}'.format(film.name, (' (%d)' % i) if i else ''),
# # defaults=dict(
# # text=stills.text,
# # image=new_image,
# # )
# # )
# # if created: film.stills.media.add(media)
# # return film
# #
# # def process_films(self):
# # for director in festivaly_models.FilmDirector.objects.all():
# # print director.participant.name
# #
# # def process_filmdirectors(self):
# # def process_names(text):
# # for name in re.split("\s*[\/&,]\s*", text):
# # yield HumanName(name)
# #
# # for film in filmffestival_models.Film.objects.filter(status=filmffestival_models.Film.SELECTED):
# # if festivaly_models.Film.objects.filter(ref=film.ref).first():
# # continue
# # print film, film.film_type, film.dir_by
# # new_film = self.migrate_film(film)
# # file_type = 'Video Graffiti' if film.film_type == 'Video Grafitti' else 'Dramatic Nights'
# #
# # festivalproject = festivaly_models.FestivalProject.objects.get(festival__year=2015, project__name=file_type)
# # directors = [str(name) for name in process_names(film.dir_by)]
# # # print '\t directors:', map(str, directors)
# # submitter = HumanName(film.sub_by) if film.sub_by.strip() else None
# # director_submitter = None
# # if not submitter:
# # director_submitter = directors[0]
# # elif submitter in directors:
# # # print 'MATCH'
# # director_submitter = directors[directors.index(submitter)]
# # else:
# # pass # print 'NO MATCH', submitter
# # if director_submitter:
# # pass
# # # print '\t\t director submitted', director_submitter
# # # print '\t\t ', film.contact_email
# # # print '\t\t ', film.contact_phone
# # for director in directors:
# # if director == director_submitter:
# # participant, _ = festivaly_models.Participant.objects.get_or_create(name=str(director),
# # defaults=dict(
# # phone=film.contact_phone,
# # email=film.contact_email
# # ))
# # else:
# # participant, _ = festivaly_models.Participant.objects.get_or_create(name=str(director))
# # film_director, created = festivaly_models.FilmDirector.objects.get_or_create(participant=participant,
# # festival_project=festivalproject)
# # film_director.films.add(new_film)
# # # return
# #
# # # if film.actors: print '\t actors:', [str(name) for name in process_names(film.actors)]
# # # if film.producers: print '\t producers:', [str(name) for name in process_names(film.producers)]
# # # if film.exec_producers: print '\t exec_producers:', [str(name) for name in process_names(film.exec_producers)]
# # # if film.co_producers: print '\t co_producers:', [str(name) for name in process_names(film.co_producers)]
# # # if film.cinematographers: print '\t cinematographers:', [str(name) for name in process_names(film.cinematographers)]
# # # if film.screenwriters: print '\t screenwriters:', [str(name) for name in process_names(film.screenwriters)]
# # # if film.editors: print '\t editors:', [str(name) for name in process_names(film.editors)]
# # # if film.sound_editors: print '\t sound_editors:', [str(name) for name in process_names(film.sound_editors)]
# # # if film.composers: print '\t composers:', [str(name) for name in process_names(film.composers)]
# # # if film.art_directors: print '\t art_directors:', [str(name) for name in process_names(film.art_directors)]
# # # if film.crew: print '\t crew:', [str(name) for name in process_names(film.crew)]
# #
# # def list_festivals(self):
# # for festival in festivaly_models.Festival.objects.all():
# # print (festival)
# #
# # def mirgate_artist(self, old_artist):
# # participant = self.add_participant(old_artist)
# # print participant
# # artworks = collections.defaultdict(list)
# # # collect the art by project
# # for art in old_artist.art_set.all():
# # festivalproject = festivaly_models.FestivalProject.objects.get(festival__year=2015,
# # project__name=art.project_x.project.title)
# # artworks[festivalproject].append(art)
# # for festivalproject in artworks:
# # participation, _ = festivaly_models.Artist.objects.get_or_create(festival_project=festivalproject,
# # participant=participant)
# # # collect the images by art piece
# # works = collections.defaultdict(list)
# # for photo in artworks[festivalproject]:
# # works[photo.title].append(photo)
# # # create album for each art piece
# # for work in works:
# # print '{} - {}'.format(participant.name, work)
# # artwork, created = festivaly_models.Art.objects.get_or_create(
# # name='{} - {}'.format(participant.name, work),
# # text=(works[work][0].description + '\n\n' + works[work][0].text).strip(),
# # )
# # print artwork, created
# # if created:
# # participation.artwork.add(artwork)
# # for i, photo in enumerate(works[work]):
# # image = ContentFile(photo.photo.read())
# # image.name = 'mykonos-biennale-{}-{}-{}-{}{}{}'.format(
# # festivalproject.festival.slug,
# # festivalproject.project.slug,
# # photo.artist.slug,
# # photo.slug,
# # ('-%d' % i) if i else '',
# # os.path.splitext(photo.photo.name)[1]
# # )
# # media, created = festivaly_models.Media.objects.get_or_create(
# # name='{} - {}{}'.format(participant.name, photo.title, ('(%d)' % i) if i else ''),
# # defaults=dict(
# # image=image,
# # text=(photo.description + '\n\n' + photo.text).strip(),
# # )
# # )
# # print media, created
# # if created: artwork.media.add(media)
# #
# # # def rec_art(self):
# # # for artist in festivaly_models.Artist.objects.all():
# # # if artist.artwork.first() == None:
# # # print artist
# # # old_artist = festival_models.Artist.objects.get(name=artist.participant.name)
# # # print 'old_artist:', old_artist
# # # projects = collections.defaultdict(list)
# # # for art in old_artist.art_set.all():
# # # projects[art.project_x].append(art)
# # # for project in projects:
# # # old_festival = project.festival
# # # festivalproject = festivaly_models.FestivalProject.objects.get(festival__year=old_festival.year, project__name=project.project.title)
# # # works = collections.defaultdict(list)
# # # for work in projects[project]:
# # # works[work.title].append(work)
# # # for work in works:
# #
# # # album = {
# # # 'festivalproject':festivalproject,
# # # 'name': '{} - {}'.format(artist.name, work),
# # # 'text': (works[work][0].description + '\n\n'+ works[work][0].text).strip(),
# # # 'media':[]
# # # }
# # # artwork = festivaly_models.Art.objects.create(
# # # name = album['name'],
# # # text = album['text']
# # # )
# # # artist.artwork.add(artwork)
# # # print 'artwork', artwork.pk
# # # for i,p in enumerate(works[work]):
# # # image = ContentFile(p.photo.read())
# # # image.name = 'mykonos-biennale-{}-{}-{}-{}{}{}'.format(
# # # festivalproject.festival.slug,
# # # festivalproject.project.slug,
# # # p.artist.slug,
# # # p.slug,
# # # ('-%d' % i) if i else '',
# # # os.path.splitext(p.photo.name)[1]
# # # )
# # # media = festivaly_models.Media.objects.create(
# # # image = image,
# # # name = '{} - {}'.format(artist.name, p.title),
# # # text = (p.description + '\n\n'+ p.text).strip(),
# # # )
# # # artwork.media.add(media)
# # # print 'media', media.pk
# # # print 'album', album
# #
# # # print 'project- art:', project, projects[project]
# # # print '\t old project:', art, art.project_x
# # # festival = art.project_x.festival
# # # print '\t new project:', festivaly_models.FestivalProject.objects.get(festival__year=festival.year, project__name=art.project_x.project.title)
# #
# # # break
# #
# # # for i, art in enumerate(festivaly_models.Art.objects.all()):
# # # print i, 'art', art, 'artist', [a.participant.name for a in art.artist.all()]
# #
# # # def migrate_2015_art(self):
# # # artists = collections.defaultdict(list)
# # # for ps in festival_models.ProjectSeason.objects.all():
# # # for art in ps.art_set.all():
# # # artists[art.artist.name].append((ps, art))
# # # for a in artists:
# # # print a, len(artists[a])
# # # work = {}
# # # work_images = collections.defaultdict(list)
# # # if 'XXVenieri' not in a:
# # # for ips, art in artists[a]:
# #
# # # # print """
# # # # title: {title}
# # # # slug: {slug}
# # # # show: {show}
# # # # leader: {leader}
# # # # description: {description}
# # # # text: {text}
# # # # photo: {photo}
# # # # """.format(**vars(art))
# # # fp = festivaly_models.FestivalProject.objects.get(festival__year=2015, name=ips.project.title)
# # # participant = festivaly_models.Participant.objects.get(name=a)
# # # artistp,_ = festivaly_models.Artist.objects.get_or_create(festival_project=fp, participant=participant)
# # # work[(artistp, art.title)] = art
# # # work_images[(artistp, art.title)].append(art)
# # # #continue
# # # for k in work:
# # # artistp = k[0]
# # # art = work[k]
# # # text = art.description + '\n\n'+ art.text
# # # artwork,created = festivaly_models.Art.objects.get_or_create(
# # # name=art.title,
# # # defaults={ 'text': text.strip()}
# # # )
# # # print artwork,created
# # # if created:
# # # artistp.artwork.add(artwork)
# # # for i, img in enumerate(work_images[k]):
# # # image = ContentFile(img.photo.read())
# # # image.name = 'mykonos-biennale-{}-{}-{}-{}{}{}'.format(
# # # k[0].festival_project.festival.slug,
# # # k[0].festival_project.project.slug,
# # # art.artist.slug,
# # # art.slug,
# # # ('-%d' % i) if i else '',
# # # os.path.splitext(img.photo.name)[1]
# # # )
# # # media = festivaly_models.Media.objects.create(
# # # image = image,
# # # name = artwork.name,
# # # text = artwork.text
# # # )
# # # artwork.media.add(media)
# #
# # # def rec_2015_artists(self):
# # # for artist in festival_models.Artist.objects.filter(visible=True):
# # # try:
# # # found = festivaly_models.Participant.objects.get(name=artist.name)
# # # except:
# # # print "not Found", artist.name
# # # for art in artist.art_set.all():
# # # print '\t', art, art.project_x.pk
# # # if not 'Lommel' in artist.name:
# # # self.add_participant(artist)
# #
# # def add_participant(self, artist):
# # print ('\t %s' % artist)
# # if "The" in artist.name:
# # sort_by = artist.name[4:].strip()
# # else:
# # name = HumanName(artist.name)
# # sort_by = "{} {}".format(name.last, name.first).strip()
# # headshot = artist.headshot
# # participant, created = festivaly_models.Participant.objects.get_or_create(
# # name=artist.name,
# # defaults=dict(
# # sort_by=sort_by,
# # text=artist.bio,
# # statement=artist.statement,
# # email=artist.email,
# # country=artist.country,
# # phone=artist.phone,
# # homepage=artist.homepage,
# # )
# # )
# # if created:
# # if artist.headshot:
# # participant.headshot = ContentFile(artist.headshot.read())
# # participant.headshot.name = 'mykonos-biennale-artist-{}{}'.format(artist.slug, os.path.splitext(
# # artist.headshot.name)[1])
# # participant.save()
# # print participant
# # return participant
# #
# # # def add_artist(self, artist):
# # # print ('\t %s' % artist)
# # # if "The" in artist.name:
# # # sort_by = artist.name[4:].strip()
# # # else:
# # # name = HumanName(artist.name)
# # # sort_by = "{} {}".format(name.last, name.first).strip()
# # # headshot = artist.headshot
# # # if artist.headshot:
# # # headshot = ContentFile(artist.headshot.read())
# # # headshot.name = 'mykonos-biennale-artist-{}{}'.format(artist.slug, os.path.splitext(artist.headshot.name)[1])
# # # new_artist = festivaly_models.Artist.objects.get_or_create(
# # # festival_project = festival_project,
# # # participant = festivaly_models.Participant.objects.get_or_create(
# # # name = artist.name,
# # # defaults = dict(
# # # sort_by = sort_by,
# # # text = artist.bio,
# # # statement = artist.statement,
# # # email = artist.email,
# # # country = artist.country,
# # # phone = artist.phone,
# # # homepage = artist.homepage,
# # # headshot = headshot
# # # )
# # # )[0]
# # # )
# # # print new_artist
# # # return new_artist
# #
# # # def mirgate_2015_artists(self):
# # # for festival_project in festivaly_models.FestivalProject.objects.filter(festival__year=2015):
# # # ps = festival_models.ProjectSeason.objects.filter(project__title = festival_project.name).first()
# # # if ps:
# # # print('found', ps, 'matches',festival_project)
# #
# # # for artist in set([art.artist for art in ps.art_set.all()]):
# # # print ('\t %s' % artist)
# # # if "The" in artist.name:
# # # sort_by = artist.name[4:].strip()
# # # else:
# # # name = HumanName(artist.name)
# # # sort_by = "{} {}".format(name.last, name.first).strip()
# # # headshot = artist.headshot
# # # if artist.headshot:
# # # headshot = ContentFile(artist.headshot.read())
# # # headshot.name = 'mykonos-biennale-artist-{}{}'.format(artist.slug, os.path.splitext(artist.headshot.name)[1])
# # # artist = festivaly_models.Artist.objects.get_or_create(
# # # festival_project = festival_project,
# # # participant = festivaly_models.Participant.objects.get_or_create(
# # # name = artist.name,
# # # defaults = dict(
# # # sort_by = sort_by,
# # # text = artist.bio,
# # # statement = artist.statement,
# # # email = artist.email,
# # # country = artist.country,
# # # phone = artist.phone,
# # # homepage = artist.homepage,
# # # headshot = headshot
# # # )
# # # )[0]
# # # )
# # # print artist
# # # else:
# # # print('no match for',festival_project)
# #
# #
# #
| [
1,
529,
9507,
29958,
29888,
6074,
29914,
21895,
29914,
26381,
29914,
15843,
29918,
442,
2879,
29889,
2272,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
325,
326,
29901,
4434,
9847,
29922,
29947,
7985,
3891,
9500,
2103,
29922,
29946,
4964,
3891,
9847,
29922,
29946,
13,
5215,
931,
29892,
9637,
1627,
13,
5215,
16250,
13,
5215,
337,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
11799,
13,
5215,
282,
2158,
29892,
4390,
13,
5215,
3523,
5510,
13,
3166,
9557,
29889,
3221,
29889,
5325,
29889,
3188,
1053,
10576,
2283,
13,
3166,
1024,
16680,
1053,
12968,
1170,
13,
3166,
9557,
29889,
3221,
29889,
15550,
19427,
1053,
28755,
13,
13,
3166,
9557,
29889,
3221,
29889,
21895,
29889,
3188,
1053,
7399,
6255,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
13,
3166,
9557,
29889,
13239,
29889,
726,
1053,
2243,
688,
1598,
13,
13,
3166,
16005,
29891,
1053,
4733,
408,
16005,
29891,
29918,
9794,
13,
3166,
16005,
1053,
4733,
408,
16005,
29918,
9794,
13,
3166,
2706,
29888,
6074,
1053,
4733,
408,
2706,
600,
6074,
29918,
9794,
13,
13,
13,
1990,
10516,
29898,
5160,
6255,
1125,
13,
1678,
1371,
353,
14550,
1267,
420,
599,
4558,
12008,
13,
13,
1678,
822,
4386,
29898,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
17906,
353,
6571,
13,
4706,
363,
7664,
297,
4390,
29889,
18132,
29898,
643,
6646,
877,
3126,
742,
16005,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
497,
22130,
29901,
13,
9651,
7664,
1839,
9621,
16215,
2813,
8962,
2033,
353,
525,
991,
597,
29879,
29941,
29889,
17260,
10467,
29889,
510,
29914,
510,
29889,
1357,
8077,
359,
29890,
17810,
744,
29889,
7959,
22208,
718,
7664,
1839,
9621,
2033,
29961,
13,
18884,
525,
2813,
8962,
2033,
13,
9651,
17906,
29961,
442,
391,
1839,
20571,
2033,
29962,
353,
7664,
13,
4706,
29482,
1338,
353,
9657,
4197,
29898,
29916,
1839,
20571,
7464,
921,
29897,
363,
921,
297,
4390,
29889,
18132,
29898,
643,
6646,
877,
3126,
742,
16005,
29918,
9794,
29889,
29943,
6074,
29889,
12650,
29889,
497,
22130,
2314,
13,
4706,
9279,
353,
9657,
4197,
29898,
29916,
1839,
20571,
7464,
921,
1839,
9621,
11287,
363,
921,
297,
4390,
29889,
18132,
29898,
643,
6646,
877,
3126,
742,
16005,
29918,
9794,
29889,
7653,
29889,
12650,
29889,
497,
22130,
2314,
13,
4706,
2060,
29918,
442,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
4706,
363,
1616,
1287,
297,
4390,
29889,
18132,
29898,
643,
6646,
877,
3126,
742,
16005,
29918,
9794,
29889,
9986,
29889,
12650,
29889,
497,
22130,
29901,
13,
9651,
1616,
1287,
1839,
9621,
16215,
21596,
2033,
29871,
353,
525,
991,
597,
29879,
29941,
29889,
17260,
10467,
29889,
510,
29914,
510,
29889,
1357,
8077,
359,
29890,
17810,
744,
29889,
7959,
29914,
18717,
29871,
1616,
1287,
1839,
9621,
16215,
21596,
2033,
13,
9651,
1616,
1287,
1839,
9621,
16215,
442,
391,
29918,
978,
2033,
353,
17906,
29961,
442,
1287,
1839,
9621,
16215,
442,
391,
2033,
22322,
9621,
16215,
978,
2033,
13,
9651,
2060,
29918,
442,
29961,
442,
1287,
1839,
9621,
16215,
4836,
2033,
1822,
4397,
29898,
442,
1287,
29897,
13,
13,
4706,
29482,
1338,
29918,
16418,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
4706,
363,
2060,
297,
4390,
29889,
18132,
29898,
643,
6646,
877,
3126,
742,
16005,
29918,
9794,
29889,
7653,
29889,
12650,
29889,
497,
22130,
29901,
13,
9651,
29482,
1338,
29918,
16418,
29961,
4836,
1839,
9621,
16215,
29888,
6074,
2033,
1822,
4397,
29898,
4836,
29897,
13,
9651,
2060,
1839,
442,
2033,
353,
2060,
29918,
442,
29961,
4836,
1839,
20571,
2033,
29962,
13,
13,
4706,
363,
16005,
297,
29482,
1338,
29889,
1524,
5975,
7295,
13,
9651,
16005,
1839,
16418,
2033,
353,
29482,
1338,
29918,
16418,
29961,
29888,
6074,
1839,
20571,
2033,
29962,
13,
13,
13,
4706,
286,
29890,
353,
426,
13,
9651,
525,
29613,
440,
1338,
2396,
29613,
440,
1338,
29892,
13,
9651,
525,
442,
2879,
2396,
17906,
13,
4706,
500,
13,
4706,
411,
1722,
877,
8337,
29889,
3126,
3788,
29893,
29890,
1495,
408,
286,
29890,
29918,
3126,
29901,
13,
9651,
4390,
29889,
15070,
29898,
8337,
29892,
286,
29890,
29918,
3126,
29897,
13,
13,
4706,
396,
7664,
29918,
4836,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
4706,
396,
1616,
353,
6571,
13,
4706,
396,
363,
1616,
1287,
297,
4390,
29889,
18132,
29898,
643,
6646,
877,
3126,
742,
16005,
29918,
9794,
29889,
9986,
29889,
12650,
29889,
497,
22130,
29901,
13,
4706,
396,
268,
1616,
29961,
442,
1287,
1839,
20571,
2033,
29962,
353,
1616,
13,
4706,
396,
268,
7664,
29918,
4836,
15625,
442,
1287,
1839,
9621,
16215,
442,
391,
7464,
1616,
1287,
1839,
9621,
16215,
4836,
11287,
1822,
4397,
29898,
442,
1287,
29897,
13,
4706,
396,
282,
2158,
29889,
407,
29878,
524,
29898,
8977,
29898,
442,
391,
29918,
4836,
876,
13,
13,
13,
4706,
396,
13,
29937,
13,
29937,
632,
396,
1583,
29889,
1267,
420,
29918,
2490,
261,
29898,
9663,
29897,
13,
29937,
632,
1583,
29889,
1267,
420,
29918,
303,
6090,
29898,
9663,
29897,
13,
29937,
13,
29937,
268,
822,
19508,
29918,
2490,
261,
29898,
1311,
29892,
2706,
1125,
13,
29937,
308,
1629,
353,
2706,
29889,
4836,
29889,
29888,
6074,
29889,
6360,
13,
29937,
308,
16005,
353,
2706,
29889,
4836,
29889,
29888,
6074,
29889,
29517,
13,
29937,
308,
565,
2706,
29889,
2490,
261,
29901,
13,
29937,
632,
1596,
2706,
29889,
2490,
261,
29889,
978,
13,
29937,
632,
1294,
353,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
9663,
29889,
2490,
261,
29889,
978,
9601,
29899,
29896,
29962,
13,
29937,
632,
10368,
29918,
978,
353,
29871,
376,
8346,
29914,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
29912,
7402,
29912,
7402,
29912,
7402,
29912,
7402,
2490,
261,
8875,
1642,
4830,
29898,
13,
29937,
462,
1629,
29892,
13,
29937,
462,
16005,
29892,
13,
29937,
462,
2706,
29889,
4836,
29889,
29517,
29892,
13,
29937,
462,
2706,
29889,
29517,
29889,
17010,
877,
29899,
5477,
13,
29937,
462,
1294,
13,
29937,
632,
1723,
13,
29937,
632,
10368,
353,
10576,
2283,
29898,
9663,
29889,
2490,
261,
29889,
949,
3101,
13,
29937,
632,
10368,
29889,
978,
353,
10368,
29918,
978,
13,
29937,
632,
2706,
29889,
2490,
261,
353,
10368,
13,
29937,
632,
2706,
29889,
7620,
580,
13,
29937,
632,
1596,
2706,
29889,
2490,
261,
29889,
978,
13,
29937,
13,
29937,
268,
822,
19508,
29918,
303,
6090,
29898,
1311,
29892,
2706,
1125,
13,
29937,
308,
1596,
2706,
29889,
29517,
13,
29937,
308,
363,
474,
29892,
1967,
297,
26985,
29898,
9663,
29889,
9663,
29888,
6074,
29918,
3027,
29918,
12817,
29889,
497,
580,
1125,
13,
29937,
632,
1596,
474,
29892,
1967,
29889,
3027,
29889,
978,
13,
29937,
13,
29937,
13,
29937,
13,
29937,
396,
268,
396,
308,
363,
16005,
297,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
268,
396,
632,
1596,
313,
29888,
6074,
29892,
16005,
29889,
29517,
29892,
16005,
29889,
657,
29918,
23552,
29918,
2271,
3101,
13,
29937,
396,
268,
396,
308,
363,
2060,
297,
16005,
29891,
29918,
9794,
29889,
7653,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
268,
396,
632,
1596,
313,
4836,
29892,
2060,
29889,
29517,
29892,
2060,
29889,
657,
29918,
23552,
29918,
2271,
3101,
13,
29937,
396,
268,
396,
308,
363,
16005,
29918,
4836,
297,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
268,
396,
632,
16005,
29918,
4836,
29889,
7620,
580,
13,
29937,
396,
268,
396,
632,
1596,
313,
29888,
6074,
29918,
4836,
29892,
16005,
29918,
4836,
29889,
29517,
29892,
16005,
29918,
4836,
29889,
657,
29918,
23552,
29918,
2271,
3101,
13,
29937,
396,
13,
29937,
396,
268,
396,
308,
285,
29918,
29906,
29900,
29896,
29955,
353,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
29889,
12650,
29889,
657,
29898,
6360,
29922,
29906,
29900,
29896,
29955,
29897,
13,
29937,
396,
268,
396,
308,
363,
2060,
297,
16005,
29891,
29918,
9794,
29889,
7653,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
268,
396,
632,
16005,
29918,
4836,
29892,
29918,
353,
29871,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
268,
396,
462,
268,
16005,
29922,
285,
29918,
29906,
29900,
29896,
29955,
29892,
13,
29937,
396,
268,
396,
462,
268,
2060,
353,
2060,
29892,
13,
29937,
396,
268,
396,
462,
268,
1024,
353,
2060,
29889,
978,
29892,
13,
29937,
396,
268,
396,
462,
268,
1426,
353,
2060,
29889,
726,
29897,
13,
29937,
396,
13,
29937,
396,
268,
396,
308,
363,
16005,
297,
16005,
29918,
9794,
29889,
29943,
6074,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
268,
396,
632,
363,
2060,
29916,
297,
16005,
29889,
4836,
29916,
29918,
842,
29889,
497,
7295,
13,
29937,
396,
268,
396,
462,
1596,
16005,
29892,
2060,
29916,
13,
29937,
396,
13,
29937,
396,
268,
822,
1162,
29918,
29906,
29898,
1311,
1125,
13,
29937,
396,
308,
363,
7664,
297,
16005,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
632,
1018,
29901,
13,
29937,
396,
462,
16005,
29891,
29918,
9794,
29889,
7439,
12654,
424,
29889,
12650,
29889,
657,
29898,
978,
29922,
442,
391,
29889,
978,
29897,
13,
29937,
396,
632,
5174,
29901,
13,
29937,
396,
462,
1583,
29889,
11038,
17062,
29918,
442,
391,
29898,
442,
391,
29897,
13,
29937,
396,
13,
29937,
396,
268,
396,
308,
363,
16005,
29918,
4836,
297,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
4572,
29898,
29888,
6074,
1649,
6360,
29922,
29906,
29900,
29896,
29945,
1125,
13,
29937,
396,
268,
396,
632,
6529,
353,
16005,
29918,
9794,
29889,
7653,
2008,
1658,
29889,
12650,
29889,
4572,
29898,
4836,
1649,
3257,
353,
16005,
29918,
4836,
29889,
978,
467,
4102,
580,
13,
29937,
396,
268,
396,
632,
565,
6529,
29901,
13,
29937,
396,
268,
396,
462,
1596,
877,
11940,
742,
6529,
29892,
525,
20317,
742,
29888,
6074,
29918,
4836,
29897,
13,
29937,
396,
13,
29937,
396,
268,
396,
462,
363,
7664,
297,
731,
4197,
442,
29889,
442,
391,
363,
1616,
297,
6529,
29889,
442,
29918,
842,
29889,
497,
580,
29962,
1125,
13,
29937,
396,
13,
29937,
396,
268,
822,
3708,
479,
29898,
1311,
1125,
13,
29937,
396,
308,
1596,
16005,
29891,
29918,
9794,
29889,
3434,
29885,
17392,
272,
29889,
12650,
29889,
2798,
580,
13,
29937,
396,
308,
1236,
267,
353,
518,
11512,
29889,
1595,
12654,
424,
363,
285,
29881,
297,
16005,
29891,
29918,
9794,
29889,
3434,
29885,
17392,
272,
29889,
12650,
29889,
497,
580,
29962,
13,
29937,
396,
308,
2910,
29898,
2892,
921,
29901,
921,
29889,
8143,
3285,
1236,
267,
29897,
13,
29937,
396,
13,
29937,
396,
268,
822,
1889,
29918,
7039,
29898,
1311,
29892,
1426,
1125,
13,
29937,
396,
308,
363,
1024,
297,
337,
29889,
5451,
14182,
29879,
29930,
7110,
29914,
29987,
29892,
10725,
29879,
29930,
613,
1426,
1125,
13,
29937,
396,
632,
7709,
12968,
1170,
29898,
978,
29897,
13,
29937,
396,
13,
29937,
396,
632,
396,
2048,
3769,
363,
1269,
1616,
8424,
13,
29937,
396,
13,
29937,
396,
268,
396,
632,
3769,
353,
426,
13,
29937,
396,
268,
396,
462,
632,
525,
29888,
6074,
4836,
2396,
29888,
6074,
4836,
29892,
13,
29937,
396,
268,
396,
462,
632,
525,
978,
2396,
525,
8875,
448,
6571,
4286,
4830,
29898,
442,
391,
29889,
978,
29892,
664,
511,
13,
29937,
396,
268,
396,
462,
632,
525,
726,
2396,
313,
13129,
29961,
1287,
3816,
29900,
1822,
8216,
718,
11297,
29876,
29905,
29876,
18717,
1736,
29961,
1287,
3816,
29900,
1822,
726,
467,
17010,
3285,
13,
29937,
396,
268,
396,
462,
632,
525,
9799,
2396,
2636,
13,
29937,
396,
268,
396,
462,
308,
500,
13,
29937,
396,
268,
396,
462,
308,
1616,
1287,
353,
29871,
16005,
29891,
29918,
9794,
29889,
9986,
29889,
12650,
29889,
3258,
29898,
13,
29937,
396,
268,
396,
462,
632,
1024,
353,
3769,
1839,
978,
7464,
13,
29937,
396,
268,
396,
462,
632,
1426,
353,
3769,
1839,
726,
2033,
13,
29937,
396,
268,
396,
462,
308,
1723,
13,
29937,
396,
13,
29937,
396,
268,
822,
9725,
403,
29918,
9663,
29898,
1311,
29892,
2030,
29918,
9663,
1125,
13,
29937,
396,
308,
396,
1967,
353,
10576,
2283,
29898,
1025,
29918,
9663,
29889,
2490,
261,
29889,
949,
3101,
13,
29937,
396,
308,
4516,
29918,
1761,
353,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1583,
29889,
5014,
29918,
7039,
29898,
1025,
29918,
9663,
29889,
3972,
29918,
1609,
4638,
13,
29937,
396,
308,
2243,
688,
353,
2243,
688,
1598,
29898,
1025,
29918,
9663,
29889,
3257,
718,
17411,
29915,
718,
525,
15300,
7122,
29898,
3972,
29918,
1761,
876,
13,
29937,
396,
308,
16005,
4836,
353,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
657,
29898,
29888,
6074,
1649,
6360,
29922,
29906,
29900,
29896,
29945,
29892,
2060,
1649,
978,
3790,
13,
29937,
396,
632,
525,
29928,
2572,
2454,
405,
5861,
2396,
525,
29928,
2572,
2454,
405,
5861,
742,
13,
29937,
396,
632,
525,
15167,
4989,
600,
4812,
2396,
525,
15167,
4989,
600,
4812,
742,
13,
29937,
396,
632,
525,
29928,
749,
2396,
525,
15167,
4989,
600,
4812,
742,
13,
29937,
396,
632,
525,
15167,
13721,
986,
29875,
2396,
525,
15167,
4989,
600,
4812,
742,
13,
29937,
396,
632,
525,
6268,
653,
2396,
525,
29928,
2572,
2454,
405,
5861,
742,
13,
29937,
396,
308,
500,
29961,
1025,
29918,
9663,
29889,
9663,
29918,
1853,
2314,
13,
29937,
396,
308,
10368,
353,
6213,
13,
29937,
396,
308,
565,
2030,
29918,
9663,
29889,
2490,
261,
29901,
13,
29937,
396,
632,
10368,
353,
10576,
2283,
29898,
1025,
29918,
9663,
29889,
2490,
261,
29889,
949,
3101,
13,
29937,
396,
632,
10368,
29918,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
29912,
7402,
29912,
7402,
29912,
7402,
2490,
8875,
4286,
4830,
29898,
13,
29937,
396,
462,
16005,
4836,
29889,
29888,
6074,
29889,
29517,
29892,
13,
29937,
396,
462,
16005,
4836,
29889,
4836,
29889,
29517,
29892,
13,
29937,
396,
462,
2030,
29918,
9663,
29889,
29517,
29892,
13,
29937,
396,
462,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
1025,
29918,
9663,
29889,
2490,
261,
29889,
978,
9601,
29896,
29962,
13,
29937,
396,
632,
1723,
13,
29937,
396,
13,
29937,
396,
308,
396,
308,
565,
2030,
29918,
9663,
29889,
3018,
3955,
29918,
9641,
29901,
13,
29937,
396,
308,
396,
1669,
396,
3018,
3955,
29918,
9641,
353,
10576,
2283,
29898,
1025,
29918,
9663,
29889,
3018,
3955,
29918,
9641,
29889,
949,
3101,
13,
29937,
396,
308,
396,
632,
1020,
3955,
29918,
9641,
29918,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
29912,
7402,
29912,
7402,
29912,
7402,
3018,
3955,
8875,
4286,
4830,
29898,
13,
29937,
396,
308,
396,
462,
462,
308,
16005,
4836,
29889,
29888,
6074,
29889,
29517,
29892,
13,
29937,
396,
308,
396,
462,
462,
308,
16005,
4836,
29889,
4836,
29889,
29517,
29892,
13,
29937,
396,
308,
396,
462,
462,
308,
2030,
29918,
9663,
29889,
29517,
29892,
13,
29937,
396,
308,
396,
462,
462,
308,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
1025,
29918,
9663,
29889,
2490,
261,
29889,
978,
9601,
29896,
29962,
13,
29937,
396,
308,
396,
462,
462,
1678,
1723,
13,
29937,
396,
308,
822,
5222,
15368,
29898,
9663,
1125,
13,
29937,
396,
632,
565,
2706,
29889,
1188,
29918,
1220,
29901,
13,
29937,
396,
462,
736,
2706,
29889,
1188,
29918,
1220,
13,
29937,
396,
632,
25342,
2706,
29889,
19274,
15368,
29918,
29896,
29906,
29945,
29901,
13,
29937,
396,
462,
736,
2706,
29889,
19274,
15368,
29918,
29896,
29906,
29945,
13,
29937,
396,
632,
25342,
2706,
29889,
19274,
15368,
29918,
29906,
29945,
29900,
29901,
13,
29937,
396,
462,
736,
2706,
29889,
19274,
15368,
29918,
29906,
29945,
29900,
13,
29937,
396,
632,
1683,
29901,
13,
29937,
396,
462,
736,
2706,
29889,
19274,
15368,
13,
29937,
396,
13,
29937,
396,
308,
1603,
29879,
29892,
903,
353,
16005,
29891,
29918,
9794,
29889,
2499,
2404,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
632,
1024,
543,
8875,
4516,
29889,
491,
6571,
1642,
4830,
29898,
1025,
29918,
9663,
29889,
3257,
29892,
13420,
15300,
7122,
29898,
3972,
29918,
1761,
8243,
13,
29937,
396,
632,
21274,
29922,
8977,
29898,
13,
29937,
396,
462,
1426,
29922,
19274,
15368,
29898,
1025,
29918,
9663,
511,
13,
29937,
396,
632,
1723,
13,
29937,
396,
308,
1723,
13,
29937,
396,
13,
29937,
396,
308,
2706,
29892,
2825,
353,
16005,
29891,
29918,
9794,
29889,
3434,
29885,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
999,
29922,
1025,
29918,
9663,
29889,
999,
29892,
13,
29937,
396,
462,
462,
462,
462,
268,
21274,
29922,
8977,
29898,
13,
29937,
396,
462,
462,
462,
462,
308,
2706,
29918,
4993,
29922,
1025,
29918,
9663,
29889,
4993,
29889,
13609,
3285,
13,
29937,
396,
462,
462,
462,
462,
308,
2143,
29922,
1025,
29918,
9663,
29889,
999,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
6251,
29918,
4882,
29922,
1025,
29918,
9663,
29889,
4882,
29889,
13609,
3285,
13,
29937,
396,
462,
462,
462,
462,
308,
2706,
29918,
1853,
3790,
13,
29937,
396,
462,
462,
462,
462,
632,
525,
29928,
2572,
2454,
405,
5861,
2396,
525,
12759,
742,
13,
29937,
396,
462,
462,
462,
462,
632,
525,
15167,
4989,
600,
4812,
2396,
525,
442,
29918,
9641,
742,
13,
29937,
396,
462,
462,
462,
462,
632,
525,
15167,
13721,
986,
29875,
2396,
525,
442,
29918,
9641,
742,
13,
29937,
396,
462,
462,
462,
462,
632,
525,
29928,
749,
2396,
525,
29881,
749,
742,
13,
29937,
396,
462,
462,
462,
462,
632,
525,
6268,
653,
2396,
525,
3225,
653,
742,
13,
29937,
396,
462,
462,
462,
462,
308,
500,
29889,
657,
29898,
1025,
29918,
9663,
29889,
9663,
29918,
1853,
511,
13,
29937,
396,
462,
462,
462,
462,
308,
1024,
29922,
1025,
29918,
9663,
29889,
3257,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
2441,
29918,
3257,
29922,
1025,
29918,
9663,
29889,
13492,
29918,
3257,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1014,
29918,
1609,
29922,
1025,
29918,
9663,
29889,
1491,
29918,
1609,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
6958,
29918,
5269,
29922,
1025,
29918,
9663,
29889,
12346,
29918,
5269,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
6958,
29918,
6710,
29922,
1025,
29918,
9663,
29889,
12346,
29918,
6710,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
8059,
29918,
265,
29918,
15445,
29922,
1025,
29918,
9663,
29889,
2490,
287,
29918,
265,
29918,
15445,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
12059,
277,
793,
29922,
1025,
29918,
9663,
29889,
1491,
23545,
793,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
4086,
29922,
1025,
29918,
9663,
29889,
11675,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
29701,
29922,
1025,
29918,
9663,
29889,
627,
943,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1629,
29922,
1025,
29918,
9663,
29889,
6360,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
10073,
29922,
1025,
29918,
9663,
29889,
15634,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
4234,
29922,
1025,
29918,
9663,
29889,
13509,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
18246,
29918,
8552,
29922,
1025,
29918,
9663,
29889,
771,
6929,
29918,
8552,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
18246,
29918,
8552,
29918,
2271,
29922,
1025,
29918,
9663,
29889,
771,
6929,
29918,
8552,
29918,
2271,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
6421,
29922,
8824,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
2198,
29922,
1025,
29918,
9663,
29889,
6338,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
746,
29922,
1025,
29918,
9663,
29889,
8256,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1480,
29918,
1220,
29922,
1025,
29918,
9663,
29889,
1188,
29918,
1220,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
5222,
15368,
29922,
1025,
29918,
9663,
29889,
19274,
15368,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
5222,
15368,
29918,
29896,
29906,
29945,
29922,
1025,
29918,
9663,
29889,
19274,
15368,
29918,
29896,
29906,
29945,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
5222,
15368,
29918,
29906,
29945,
29900,
29922,
1025,
29918,
9663,
29889,
19274,
15368,
29918,
29906,
29945,
29900,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
937,
29918,
2230,
29922,
1025,
29918,
9663,
29889,
4102,
29918,
2230,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
23394,
29922,
1025,
29918,
9663,
29889,
24946,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
18335,
29922,
1025,
29918,
9663,
29889,
15445,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
916,
29918,
24911,
29918,
9799,
29922,
1025,
29918,
9663,
29889,
1228,
29918,
24911,
29918,
9799,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
3142,
29922,
1025,
29918,
9663,
29889,
2271,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
4315,
8231,
414,
29922,
1025,
29918,
9663,
29889,
10525,
8231,
414,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1391,
22543,
29922,
1025,
29918,
9663,
29889,
5498,
22543,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
2279,
29918,
5498,
22543,
29922,
1025,
29918,
9663,
29889,
4258,
29918,
5498,
22543,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1302,
29918,
5498,
22543,
29922,
1025,
29918,
9663,
29889,
1111,
29918,
5498,
22543,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
25955,
1946,
414,
29922,
1025,
29918,
9663,
29889,
16381,
4579,
1946,
414,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
3234,
29918,
13892,
414,
29922,
1025,
29918,
9663,
29889,
4704,
29918,
13892,
414,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1616,
29918,
11851,
943,
29922,
1025,
29918,
9663,
29889,
442,
29918,
11851,
943,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
3863,
943,
29922,
1025,
29918,
9663,
29889,
5628,
943,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
6047,
29918,
5628,
943,
29922,
1025,
29918,
9663,
29889,
29802,
29918,
5628,
943,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
5541,
414,
29922,
1025,
29918,
9663,
29889,
22410,
414,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
17616,
29922,
1025,
29918,
9663,
29889,
1037,
29893,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
4315,
886,
29922,
1025,
29918,
9663,
29889,
10525,
886,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
2531,
690,
29922,
1025,
29918,
9663,
29889,
1885,
690,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
25090,
267,
29922,
1025,
29918,
9663,
29889,
29876,
436,
267,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
5235,
29922,
1025,
29918,
9663,
29889,
3888,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1513,
943,
29918,
20788,
29922,
1025,
29918,
9663,
29889,
11851,
943,
29918,
20788,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
5802,
29918,
16953,
29922,
1025,
29918,
9663,
29889,
24601,
29918,
16953,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
10368,
29922,
2490,
261,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1020,
3955,
29918,
2271,
29922,
1025,
29918,
9663,
29889,
3018,
3955,
29918,
2271,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1020,
3955,
29918,
17987,
29922,
1025,
29918,
9663,
29889,
3018,
3955,
29918,
17987,
29892,
13,
29937,
396,
462,
462,
462,
462,
308,
1603,
29879,
29922,
303,
6090,
13,
29937,
396,
462,
462,
462,
462,
268,
1723,
13,
29937,
396,
462,
462,
462,
462,
268,
1723,
13,
29937,
396,
13,
29937,
396,
308,
363,
474,
29892,
1967,
297,
26985,
29898,
1025,
29918,
9663,
29889,
9663,
29888,
6074,
29918,
3027,
29918,
12817,
29889,
497,
580,
1125,
13,
29937,
396,
13,
29937,
396,
632,
716,
29918,
3027,
353,
10576,
2283,
29898,
3027,
29889,
3027,
29889,
949,
3101,
13,
29937,
396,
632,
1967,
29918,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
29912,
7402,
29912,
7402,
29912,
7402,
303,
453,
29912,
1157,
29913,
4286,
4830,
29898,
13,
29937,
396,
462,
16005,
4836,
29889,
29888,
6074,
29889,
29517,
29892,
13,
29937,
396,
462,
16005,
4836,
29889,
4836,
29889,
29517,
29892,
13,
29937,
396,
462,
2030,
29918,
9663,
29889,
29517,
29892,
13,
29937,
396,
462,
6702,
19222,
29881,
29915,
1273,
474,
29897,
565,
474,
1683,
15516,
13,
29937,
396,
462,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
3027,
29889,
3027,
29889,
978,
9601,
29896,
29962,
13,
29937,
396,
632,
1723,
13,
29937,
396,
632,
5745,
29892,
2825,
353,
16005,
29891,
29918,
9794,
29889,
10572,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
462,
1024,
2433,
303,
453,
310,
426,
1157,
29913,
4286,
4830,
29898,
9663,
29889,
978,
29892,
6702,
313,
29995,
29881,
16029,
1273,
474,
29897,
565,
474,
1683,
525,
5477,
13,
29937,
396,
462,
21274,
29922,
8977,
29898,
13,
29937,
396,
462,
268,
1426,
29922,
303,
6090,
29889,
726,
29892,
13,
29937,
396,
462,
268,
1967,
29922,
1482,
29918,
3027,
29892,
13,
29937,
396,
462,
1723,
13,
29937,
396,
632,
1723,
13,
29937,
396,
632,
565,
2825,
29901,
2706,
29889,
303,
6090,
29889,
9799,
29889,
1202,
29898,
9799,
29897,
13,
29937,
396,
308,
736,
2706,
13,
29937,
396,
13,
29937,
396,
268,
822,
1889,
29918,
1777,
1516,
29898,
1311,
1125,
13,
29937,
396,
308,
363,
8881,
297,
16005,
29891,
29918,
9794,
29889,
3434,
29885,
17392,
272,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
632,
1596,
8881,
29889,
1595,
12654,
424,
29889,
978,
13,
29937,
396,
13,
29937,
396,
268,
822,
1889,
29918,
1777,
3487,
1088,
943,
29898,
1311,
1125,
13,
29937,
396,
308,
822,
1889,
29918,
7039,
29898,
726,
1125,
13,
29937,
396,
632,
363,
1024,
297,
337,
29889,
5451,
14182,
29879,
29930,
7110,
29914,
29987,
29892,
10725,
29879,
29930,
613,
1426,
1125,
13,
29937,
396,
462,
7709,
12968,
1170,
29898,
978,
29897,
13,
29937,
396,
13,
29937,
396,
308,
363,
2706,
297,
2706,
600,
6074,
29918,
9794,
29889,
3434,
29885,
29889,
12650,
29889,
4572,
29898,
4882,
29922,
9663,
600,
6074,
29918,
9794,
29889,
3434,
29885,
29889,
6404,
3352,
1125,
13,
29937,
396,
632,
565,
16005,
29891,
29918,
9794,
29889,
3434,
29885,
29889,
12650,
29889,
4572,
29898,
999,
29922,
9663,
29889,
999,
467,
4102,
7295,
13,
29937,
396,
462,
6773,
13,
29937,
396,
632,
1596,
2706,
29892,
2706,
29889,
9663,
29918,
1853,
29892,
2706,
29889,
3972,
29918,
1609,
13,
29937,
396,
632,
716,
29918,
9663,
353,
1583,
29889,
26983,
403,
29918,
9663,
29898,
9663,
29897,
13,
29937,
396,
632,
934,
29918,
1853,
353,
525,
15167,
4989,
600,
4812,
29915,
565,
2706,
29889,
9663,
29918,
1853,
1275,
525,
15167,
13721,
986,
29875,
29915,
1683,
525,
29928,
2572,
2454,
405,
5861,
29915,
13,
29937,
396,
13,
29937,
396,
632,
16005,
4836,
353,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
657,
29898,
29888,
6074,
1649,
6360,
29922,
29906,
29900,
29896,
29945,
29892,
2060,
1649,
978,
29922,
1445,
29918,
1853,
29897,
13,
29937,
396,
632,
1513,
943,
353,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
3972,
29918,
1609,
4638,
13,
29937,
396,
632,
396,
1596,
11297,
29873,
1513,
943,
29901,
742,
2910,
29898,
710,
29892,
1513,
943,
29897,
13,
29937,
396,
632,
9752,
357,
353,
12968,
1170,
29898,
9663,
29889,
1491,
29918,
1609,
29897,
565,
2706,
29889,
1491,
29918,
1609,
29889,
17010,
580,
1683,
6213,
13,
29937,
396,
632,
8881,
29918,
7892,
357,
353,
6213,
13,
29937,
396,
632,
565,
451,
9752,
357,
29901,
13,
29937,
396,
462,
8881,
29918,
7892,
357,
353,
1513,
943,
29961,
29900,
29962,
13,
29937,
396,
632,
25342,
9752,
357,
297,
1513,
943,
29901,
13,
29937,
396,
462,
396,
1596,
525,
29924,
14789,
29915,
13,
29937,
396,
462,
8881,
29918,
7892,
357,
353,
1513,
943,
29961,
11851,
943,
29889,
2248,
29898,
7892,
357,
4638,
13,
29937,
396,
632,
1683,
29901,
13,
29937,
396,
462,
1209,
29871,
396,
1596,
525,
6632,
341,
14789,
742,
9752,
357,
13,
29937,
396,
632,
565,
8881,
29918,
7892,
357,
29901,
13,
29937,
396,
462,
1209,
13,
29937,
396,
462,
396,
1596,
11297,
29873,
29905,
29873,
8881,
18397,
742,
8881,
29918,
7892,
357,
13,
29937,
396,
462,
396,
1596,
11297,
29873,
29905,
29873,
13420,
2706,
29889,
12346,
29918,
5269,
13,
29937,
396,
462,
396,
1596,
11297,
29873,
29905,
29873,
13420,
2706,
29889,
12346,
29918,
6710,
13,
29937,
396,
632,
363,
8881,
297,
1513,
943,
29901,
13,
29937,
396,
462,
565,
8881,
1275,
8881,
29918,
7892,
357,
29901,
13,
29937,
396,
462,
268,
5221,
424,
29892,
903,
353,
16005,
29891,
29918,
9794,
29889,
7439,
12654,
424,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
978,
29922,
710,
29898,
11851,
272,
511,
13,
29937,
396,
462,
462,
462,
462,
462,
308,
21274,
29922,
8977,
29898,
13,
29937,
396,
462,
462,
462,
462,
462,
632,
9008,
29922,
9663,
29889,
12346,
29918,
6710,
29892,
13,
29937,
396,
462,
462,
462,
462,
462,
632,
4876,
29922,
9663,
29889,
12346,
29918,
5269,
13,
29937,
396,
462,
462,
462,
462,
462,
3986,
876,
13,
29937,
396,
462,
1683,
29901,
13,
29937,
396,
462,
268,
5221,
424,
29892,
903,
353,
16005,
29891,
29918,
9794,
29889,
7439,
12654,
424,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
978,
29922,
710,
29898,
11851,
272,
876,
13,
29937,
396,
462,
2706,
29918,
11851,
272,
29892,
2825,
353,
16005,
29891,
29918,
9794,
29889,
3434,
29885,
17392,
272,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
1595,
12654,
424,
29922,
1595,
12654,
424,
29892,
13,
29937,
396,
462,
462,
462,
462,
462,
795,
16005,
29918,
4836,
29922,
29888,
6074,
4836,
29897,
13,
29937,
396,
462,
2706,
29918,
11851,
272,
29889,
1777,
1516,
29889,
1202,
29898,
1482,
29918,
9663,
29897,
13,
29937,
396,
462,
396,
736,
13,
29937,
396,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
627,
943,
29901,
1596,
11297,
29873,
29701,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
627,
943,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
5498,
22543,
29901,
1596,
11297,
29873,
1391,
22543,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
5498,
22543,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
4258,
29918,
5498,
22543,
29901,
1596,
11297,
29873,
2279,
29918,
5498,
22543,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
4258,
29918,
5498,
22543,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
1111,
29918,
5498,
22543,
29901,
1596,
11297,
29873,
1302,
29918,
5498,
22543,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
1111,
29918,
5498,
22543,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
16381,
4579,
1946,
414,
29901,
1596,
11297,
29873,
25955,
1946,
414,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
16381,
4579,
1946,
414,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
10525,
8231,
414,
29901,
1596,
11297,
29873,
4315,
8231,
414,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
10525,
8231,
414,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
5628,
943,
29901,
1596,
11297,
29873,
3863,
943,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
5628,
943,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
29802,
29918,
5628,
943,
29901,
1596,
11297,
29873,
6047,
29918,
5628,
943,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
29802,
29918,
5628,
943,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
22410,
414,
29901,
1596,
11297,
29873,
5541,
414,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
22410,
414,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
442,
29918,
11851,
943,
29901,
1596,
11297,
29873,
1616,
29918,
11851,
943,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
442,
29918,
11851,
943,
4638,
13,
29937,
396,
268,
396,
632,
565,
2706,
29889,
1037,
29893,
29901,
1596,
11297,
29873,
17616,
29901,
742,
518,
710,
29898,
978,
29897,
363,
1024,
297,
1889,
29918,
7039,
29898,
9663,
29889,
1037,
29893,
4638,
13,
29937,
396,
13,
29937,
396,
268,
822,
1051,
29918,
29613,
440,
1338,
29898,
1311,
1125,
13,
29937,
396,
308,
363,
16005,
297,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
632,
1596,
313,
29888,
6074,
29897,
13,
29937,
396,
13,
29937,
396,
268,
822,
10078,
17062,
29918,
442,
391,
29898,
1311,
29892,
2030,
29918,
442,
391,
1125,
13,
29937,
396,
308,
5221,
424,
353,
1583,
29889,
1202,
29918,
1595,
12654,
424,
29898,
1025,
29918,
442,
391,
29897,
13,
29937,
396,
308,
1596,
5221,
424,
13,
29937,
396,
308,
1616,
13129,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
29937,
396,
308,
396,
6314,
278,
1616,
491,
2060,
13,
29937,
396,
308,
363,
1616,
297,
2030,
29918,
442,
391,
29889,
442,
29918,
842,
29889,
497,
7295,
13,
29937,
396,
632,
16005,
4836,
353,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
657,
29898,
29888,
6074,
1649,
6360,
29922,
29906,
29900,
29896,
29945,
29892,
13,
29937,
396,
462,
462,
462,
462,
9651,
2060,
1649,
978,
29922,
442,
29889,
4836,
29918,
29916,
29889,
4836,
29889,
3257,
29897,
13,
29937,
396,
632,
1616,
13129,
29961,
29888,
6074,
4836,
1822,
4397,
29898,
442,
29897,
13,
29937,
396,
308,
363,
16005,
4836,
297,
1616,
13129,
29901,
13,
29937,
396,
632,
27577,
29892,
903,
353,
16005,
29891,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
29888,
6074,
29918,
4836,
29922,
29888,
6074,
4836,
29892,
13,
29937,
396,
462,
462,
462,
462,
795,
5221,
424,
29922,
1595,
12654,
424,
29897,
13,
29937,
396,
632,
396,
6314,
278,
4558,
491,
1616,
8424,
13,
29937,
396,
632,
1736,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
29937,
396,
632,
363,
15373,
297,
1616,
13129,
29961,
29888,
6074,
4836,
5387,
13,
29937,
396,
462,
1736,
29961,
21596,
29889,
3257,
1822,
4397,
29898,
21596,
29897,
13,
29937,
396,
632,
396,
1653,
3769,
363,
1269,
1616,
8424,
13,
29937,
396,
632,
363,
664,
297,
1736,
29901,
13,
29937,
396,
462,
1596,
525,
8875,
448,
6571,
4286,
4830,
29898,
1595,
12654,
424,
29889,
978,
29892,
664,
29897,
13,
29937,
396,
462,
1616,
1287,
29892,
2825,
353,
16005,
29891,
29918,
9794,
29889,
9986,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
462,
268,
1024,
2433,
8875,
448,
6571,
4286,
4830,
29898,
1595,
12654,
424,
29889,
978,
29892,
664,
511,
13,
29937,
396,
462,
268,
1426,
7607,
13129,
29961,
1287,
3816,
29900,
1822,
8216,
718,
11297,
29876,
29905,
29876,
29915,
718,
1736,
29961,
1287,
3816,
29900,
1822,
726,
467,
17010,
3285,
13,
29937,
396,
462,
1723,
13,
29937,
396,
462,
1596,
1616,
1287,
29892,
2825,
13,
29937,
396,
462,
565,
2825,
29901,
13,
29937,
396,
462,
268,
27577,
29889,
442,
1287,
29889,
1202,
29898,
442,
1287,
29897,
13,
29937,
396,
462,
268,
363,
474,
29892,
15373,
297,
26985,
29898,
13129,
29961,
1287,
29962,
1125,
13,
29937,
396,
462,
308,
1967,
353,
10576,
2283,
29898,
21596,
29889,
21596,
29889,
949,
3101,
13,
29937,
396,
462,
308,
1967,
29889,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
29912,
7402,
29912,
7402,
29912,
7402,
29912,
1157,
1157,
29913,
4286,
4830,
29898,
13,
29937,
396,
462,
632,
16005,
4836,
29889,
29888,
6074,
29889,
29517,
29892,
13,
29937,
396,
462,
632,
16005,
4836,
29889,
4836,
29889,
29517,
29892,
13,
29937,
396,
462,
632,
15373,
29889,
442,
391,
29889,
29517,
29892,
13,
29937,
396,
462,
632,
15373,
29889,
29517,
29892,
13,
29937,
396,
462,
632,
6702,
19222,
29881,
29915,
1273,
474,
29897,
565,
474,
1683,
15516,
13,
29937,
396,
462,
632,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
21596,
29889,
21596,
29889,
978,
9601,
29896,
29962,
13,
29937,
396,
462,
308,
1723,
13,
29937,
396,
462,
308,
5745,
29892,
2825,
353,
16005,
29891,
29918,
9794,
29889,
10572,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
462,
632,
1024,
2433,
8875,
448,
426,
1157,
29913,
4286,
4830,
29898,
1595,
12654,
424,
29889,
978,
29892,
15373,
29889,
3257,
29892,
6702,
29414,
29881,
16029,
1273,
474,
29897,
565,
474,
1683,
525,
5477,
13,
29937,
396,
462,
632,
21274,
29922,
8977,
29898,
13,
29937,
396,
462,
462,
1967,
29922,
3027,
29892,
13,
29937,
396,
462,
462,
1426,
7607,
21596,
29889,
8216,
718,
11297,
29876,
29905,
29876,
29915,
718,
15373,
29889,
726,
467,
17010,
3285,
13,
29937,
396,
462,
632,
1723,
13,
29937,
396,
462,
308,
1723,
13,
29937,
396,
462,
308,
1596,
5745,
29892,
2825,
13,
29937,
396,
462,
308,
565,
2825,
29901,
1616,
1287,
29889,
9799,
29889,
1202,
29898,
9799,
29897,
13,
29937,
396,
13,
29937,
396,
268,
396,
268,
822,
1162,
29918,
442,
29898,
1311,
1125,
13,
29937,
396,
268,
396,
308,
363,
7664,
297,
16005,
29891,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
268,
396,
632,
565,
7664,
29889,
442,
1287,
29889,
4102,
580,
1275,
6213,
29901,
13,
29937,
396,
268,
396,
462,
1596,
7664,
13,
29937,
396,
268,
396,
462,
2030,
29918,
442,
391,
353,
16005,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
657,
29898,
978,
29922,
442,
391,
29889,
1595,
12654,
424,
29889,
978,
29897,
13,
29937,
396,
268,
396,
462,
1596,
525,
1025,
29918,
442,
391,
29901,
742,
2030,
29918,
442,
391,
13,
29937,
396,
268,
396,
462,
9279,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
29937,
396,
268,
396,
462,
363,
1616,
297,
2030,
29918,
442,
391,
29889,
442,
29918,
842,
29889,
497,
7295,
13,
29937,
396,
268,
396,
462,
268,
9279,
29961,
442,
29889,
4836,
29918,
29916,
1822,
4397,
29898,
442,
29897,
13,
29937,
396,
268,
396,
462,
363,
2060,
297,
9279,
29901,
13,
29937,
396,
268,
396,
462,
268,
2030,
29918,
29888,
6074,
353,
2060,
29889,
29888,
6074,
13,
29937,
396,
268,
396,
462,
268,
16005,
4836,
353,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
657,
29898,
29888,
6074,
1649,
6360,
29922,
1025,
29918,
29888,
6074,
29889,
6360,
29892,
2060,
1649,
978,
29922,
4836,
29889,
4836,
29889,
3257,
29897,
13,
29937,
396,
268,
396,
462,
268,
1736,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
29937,
396,
268,
396,
462,
268,
363,
664,
297,
9279,
29961,
4836,
5387,
13,
29937,
396,
268,
396,
462,
308,
1736,
29961,
1287,
29889,
3257,
1822,
4397,
29898,
1287,
29897,
13,
29937,
396,
268,
396,
462,
268,
363,
664,
297,
1736,
29901,
13,
29937,
396,
13,
29937,
396,
268,
396,
462,
308,
3769,
353,
426,
13,
29937,
396,
268,
396,
462,
632,
525,
29888,
6074,
4836,
2396,
29888,
6074,
4836,
29892,
13,
29937,
396,
268,
396,
462,
632,
525,
978,
2396,
525,
8875,
448,
6571,
4286,
4830,
29898,
442,
391,
29889,
978,
29892,
664,
511,
13,
29937,
396,
268,
396,
462,
632,
525,
726,
2396,
313,
13129,
29961,
1287,
3816,
29900,
1822,
8216,
718,
11297,
29876,
29905,
29876,
18717,
1736,
29961,
1287,
3816,
29900,
1822,
726,
467,
17010,
3285,
13,
29937,
396,
268,
396,
462,
632,
525,
9799,
2396,
2636,
13,
29937,
396,
268,
396,
462,
308,
500,
13,
29937,
396,
268,
396,
462,
308,
1616,
1287,
353,
29871,
16005,
29891,
29918,
9794,
29889,
9986,
29889,
12650,
29889,
3258,
29898,
13,
29937,
396,
268,
396,
462,
632,
1024,
353,
3769,
1839,
978,
7464,
13,
29937,
396,
268,
396,
462,
632,
1426,
353,
3769,
1839,
726,
2033,
13,
29937,
396,
268,
396,
462,
308,
1723,
13,
29937,
396,
268,
396,
462,
308,
7664,
29889,
442,
1287,
29889,
1202,
29898,
442,
1287,
29897,
13,
29937,
396,
268,
396,
462,
308,
1596,
525,
442,
1287,
742,
1616,
1287,
29889,
20571,
13,
29937,
396,
268,
396,
462,
308,
363,
29871,
474,
29892,
29886,
297,
26985,
29898,
13129,
29961,
1287,
29962,
1125,
13,
29937,
396,
268,
396,
462,
632,
1967,
353,
10576,
2283,
29898,
29886,
29889,
21596,
29889,
949,
3101,
13,
29937,
396,
268,
396,
462,
632,
1967,
29889,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
29912,
7402,
29912,
7402,
29912,
7402,
29912,
1157,
1157,
29913,
4286,
4830,
29898,
13,
29937,
396,
268,
396,
462,
462,
268,
16005,
4836,
29889,
29888,
6074,
29889,
29517,
29892,
13,
29937,
396,
268,
396,
462,
462,
268,
16005,
4836,
29889,
4836,
29889,
29517,
29892,
13,
29937,
396,
268,
396,
462,
462,
268,
282,
29889,
442,
391,
29889,
29517,
29892,
13,
29937,
396,
268,
396,
462,
462,
268,
282,
29889,
29517,
29892,
13,
29937,
396,
268,
396,
462,
462,
268,
6702,
19222,
29881,
29915,
1273,
474,
29897,
565,
474,
1683,
15516,
13,
29937,
396,
268,
396,
462,
462,
268,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
29886,
29889,
21596,
29889,
978,
9601,
29896,
29962,
13,
29937,
396,
268,
396,
462,
462,
1723,
13,
29937,
396,
268,
396,
462,
632,
5745,
353,
16005,
29891,
29918,
9794,
29889,
10572,
29889,
12650,
29889,
3258,
29898,
13,
29937,
396,
268,
396,
462,
462,
1967,
353,
29871,
1967,
29892,
13,
29937,
396,
268,
396,
462,
462,
1024,
353,
29871,
525,
8875,
448,
6571,
4286,
4830,
29898,
442,
391,
29889,
978,
29892,
282,
29889,
3257,
511,
13,
29937,
396,
268,
396,
462,
462,
1426,
353,
29871,
313,
29886,
29889,
8216,
718,
11297,
29876,
29905,
29876,
18717,
282,
29889,
726,
467,
17010,
3285,
13,
29937,
396,
268,
396,
462,
632,
1723,
13,
29937,
396,
268,
396,
462,
632,
1616,
1287,
29889,
9799,
29889,
1202,
29898,
9799,
29897,
13,
29937,
396,
268,
396,
462,
632,
1596,
525,
9799,
742,
5745,
29889,
20571,
13,
29937,
396,
268,
396,
462,
308,
1596,
525,
10336,
742,
3769,
13,
29937,
396,
13,
29937,
396,
268,
396,
462,
268,
1596,
525,
4836,
29899,
1616,
29901,
742,
2060,
29892,
9279,
29961,
4836,
29962,
13,
29937,
396,
268,
396,
462,
268,
1596,
11297,
29873,
2030,
2060,
29901,
742,
1616,
29892,
1616,
29889,
4836,
29918,
29916,
13,
29937,
396,
268,
396,
462,
268,
16005,
353,
1616,
29889,
4836,
29918,
29916,
29889,
29888,
6074,
13,
29937,
396,
268,
396,
462,
268,
1596,
11297,
29873,
716,
2060,
29901,
742,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
657,
29898,
29888,
6074,
1649,
6360,
29922,
29888,
6074,
29889,
6360,
29892,
2060,
1649,
978,
29922,
442,
29889,
4836,
29918,
29916,
29889,
4836,
29889,
3257,
29897,
13,
29937,
396,
13,
29937,
396,
268,
396,
2867,
13,
29937,
396,
13,
29937,
396,
268,
396,
308,
363,
474,
29892,
1616,
297,
26985,
29898,
29888,
6074,
29891,
29918,
9794,
29889,
9986,
29889,
12650,
29889,
497,
580,
1125,
13,
29937,
396,
268,
396,
632,
1596,
474,
29892,
525,
442,
742,
1616,
29892,
525,
442,
391,
742,
518,
29874,
29889,
1595,
12654,
424,
29889,
978,
363,
263,
297,
1616,
29889,
442,
391,
29889,
497,
580,
29962,
13,
29937,
396,
13,
29937,
396,
268,
396,
268,
822,
9725,
403,
29918,
29906,
29900,
29896,
29945,
29918,
442,
29898,
1311,
1125,
13,
29937,
396,
268,
396,
308,
17906,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
29937,
396,
268,
396,
308,
363,
6529,
297,
16005,
29918,
9794,
29889,
7653,
2008,
1658,
29889,
12650,
29889,
497,
7295,
13,
29937,
396,
268,
396,
632,
363,
1616,
297,
29871,
6529,
29889,
442,
29918,
842,
29889,
497,
7295,
13,
29937,
396,
268,
396,
462,
17906,
29961,
442,
29889,
442,
391,
29889,
978,
1822,
4397,
3552,
567,
29892,
1616,
876,
13,
29937,
396,
268,
396,
308,
363,
263,
297,
17906,
29901,
13,
29937,
396,
268,
396,
632,
1596,
263,
29892,
7431,
29898,
442,
2879,
29961,
29874,
2314,
13,
29937,
396,
268,
396,
632,
664,
353,
6571,
13,
29937,
396,
268,
396,
632,
664,
29918,
8346,
353,
16250,
29889,
4381,
8977,
29898,
1761,
29897,
13,
29937,
396,
268,
396,
632,
565,
525,
6247,
29963,
264,
13972,
29915,
451,
297,
263,
29901,
13,
29937,
396,
268,
396,
462,
363,
474,
567,
29892,
1616,
297,
17906,
29961,
29874,
5387,
13,
29937,
396,
13,
29937,
396,
268,
396,
396,
462,
268,
1596,
9995,
13,
29937,
396,
268,
396,
396,
462,
308,
3611,
29901,
426,
3257,
29913,
13,
29937,
396,
268,
396,
396,
462,
308,
2243,
688,
29901,
426,
29517,
29913,
13,
29937,
396,
268,
396,
396,
462,
308,
1510,
29901,
426,
4294,
29913,
13,
29937,
396,
268,
396,
396,
462,
308,
11822,
29901,
426,
280,
1664,
29913,
13,
29937,
396,
268,
396,
396,
462,
308,
6139,
29901,
426,
8216,
29913,
13,
29937,
396,
268,
396,
396,
462,
308,
1426,
29901,
426,
726,
29913,
13,
29937,
396,
268,
396,
396,
462,
308,
15373,
29901,
426,
21596,
29913,
13,
29937,
396,
268,
396,
396,
462,
268,
5124,
1642,
4830,
29898,
1068,
16908,
29898,
442,
876,
13,
29937,
396,
268,
396,
462,
268,
285,
29886,
353,
29871,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
657,
29898,
29888,
6074,
1649,
6360,
29922,
29906,
29900,
29896,
29945,
29892,
1024,
29922,
4512,
29889,
4836,
29889,
3257,
29897,
13,
29937,
396,
268,
396,
462,
268,
5221,
424,
353,
16005,
29891,
29918,
9794,
29889,
7439,
12654,
424,
29889,
12650,
29889,
657,
29898,
978,
29922,
29874,
29897,
13,
29937,
396,
268,
396,
462,
268,
7664,
29886,
29892,
29918,
353,
29871,
16005,
29891,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
29888,
6074,
29918,
4836,
29922,
18091,
29892,
5221,
424,
29922,
1595,
12654,
424,
29897,
13,
29937,
396,
268,
396,
462,
268,
664,
15625,
442,
391,
29886,
29892,
1616,
29889,
3257,
4638,
353,
1616,
13,
29937,
396,
268,
396,
462,
268,
664,
29918,
8346,
15625,
442,
391,
29886,
29892,
1616,
29889,
3257,
29897,
1822,
4397,
29898,
442,
29897,
13,
29937,
396,
268,
396,
462,
396,
19878,
13,
29937,
396,
268,
396,
462,
363,
413,
297,
29871,
664,
29901,
13,
29937,
396,
268,
396,
462,
268,
7664,
29886,
353,
413,
29961,
29900,
29962,
13,
29937,
396,
268,
396,
462,
268,
1616,
353,
664,
29961,
29895,
29962,
13,
29937,
396,
268,
396,
462,
268,
1426,
353,
1616,
29889,
8216,
718,
11297,
29876,
29905,
29876,
18717,
1616,
29889,
726,
13,
29937,
396,
268,
396,
462,
268,
1616,
1287,
29892,
11600,
29871,
353,
29871,
16005,
29891,
29918,
9794,
29889,
9986,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
268,
396,
462,
4706,
1024,
29922,
442,
29889,
3257,
29892,
13,
29937,
396,
268,
396,
462,
4706,
21274,
3790,
525,
726,
2396,
1426,
29889,
17010,
28296,
13,
29937,
396,
268,
396,
462,
268,
1723,
13,
29937,
396,
268,
396,
462,
268,
1596,
1616,
1287,
29892,
11600,
13,
29937,
396,
268,
396,
462,
268,
565,
2825,
29901,
13,
29937,
396,
268,
396,
462,
308,
7664,
29886,
29889,
442,
1287,
29889,
1202,
29898,
442,
1287,
29897,
13,
29937,
396,
268,
396,
462,
268,
363,
474,
29892,
10153,
297,
26985,
29898,
1287,
29918,
8346,
29961,
29895,
29962,
1125,
13,
29937,
396,
268,
396,
462,
308,
1967,
353,
10576,
2283,
29898,
2492,
29889,
21596,
29889,
949,
3101,
13,
29937,
396,
268,
396,
462,
308,
1967,
29889,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
29912,
7402,
29912,
7402,
29912,
7402,
29912,
1157,
1157,
29913,
4286,
4830,
29898,
13,
29937,
396,
268,
396,
462,
632,
413,
29961,
29900,
1822,
29888,
6074,
29918,
4836,
29889,
29888,
6074,
29889,
29517,
29892,
13,
29937,
396,
268,
396,
462,
632,
413,
29961,
29900,
1822,
29888,
6074,
29918,
4836,
29889,
4836,
29889,
29517,
29892,
13,
29937,
396,
268,
396,
462,
632,
1616,
29889,
442,
391,
29889,
29517,
29892,
13,
29937,
396,
268,
396,
462,
632,
1616,
29889,
29517,
29892,
13,
29937,
396,
268,
396,
462,
632,
6702,
19222,
29881,
29915,
1273,
474,
29897,
565,
474,
1683,
15516,
13,
29937,
396,
268,
396,
462,
632,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
2492,
29889,
21596,
29889,
978,
9601,
29896,
29962,
13,
29937,
396,
268,
396,
462,
308,
1723,
13,
29937,
396,
268,
396,
462,
308,
5745,
353,
16005,
29891,
29918,
9794,
29889,
10572,
29889,
12650,
29889,
3258,
29898,
13,
29937,
396,
268,
396,
462,
632,
1967,
353,
29871,
1967,
29892,
13,
29937,
396,
268,
396,
462,
632,
1024,
353,
29871,
1616,
1287,
29889,
978,
29892,
13,
29937,
396,
268,
396,
462,
632,
1426,
353,
29871,
1616,
1287,
29889,
726,
13,
29937,
396,
268,
396,
462,
308,
1723,
13,
29937,
396,
268,
396,
462,
308,
1616,
1287,
29889,
9799,
29889,
1202,
29898,
9799,
29897,
13,
29937,
396,
13,
29937,
396,
268,
396,
268,
822,
1162,
29918,
29906,
29900,
29896,
29945,
29918,
442,
2879,
29898,
1311,
1125,
13,
29937,
396,
268,
396,
308,
363,
7664,
297,
16005,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
4572,
29898,
12872,
29922,
5574,
1125,
13,
29937,
396,
268,
396,
632,
1018,
29901,
13,
29937,
396,
268,
396,
462,
1476,
353,
16005,
29891,
29918,
9794,
29889,
7439,
12654,
424,
29889,
12650,
29889,
657,
29898,
978,
29922,
442,
391,
29889,
978,
29897,
13,
29937,
396,
268,
396,
632,
5174,
29901,
13,
29937,
396,
268,
396,
462,
1596,
376,
1333,
7460,
613,
7664,
29889,
978,
13,
29937,
396,
268,
396,
462,
363,
1616,
297,
7664,
29889,
442,
29918,
842,
29889,
497,
7295,
13,
29937,
396,
268,
396,
462,
268,
1596,
11297,
29873,
742,
1616,
29892,
1616,
29889,
4836,
29918,
29916,
29889,
20571,
13,
29937,
396,
268,
396,
462,
565,
451,
525,
29931,
3011,
295,
29915,
29871,
297,
7664,
29889,
978,
29901,
13,
29937,
396,
268,
396,
462,
268,
1583,
29889,
1202,
29918,
1595,
12654,
424,
29898,
442,
391,
29897,
13,
29937,
396,
13,
29937,
396,
268,
822,
788,
29918,
1595,
12654,
424,
29898,
1311,
29892,
7664,
1125,
13,
29937,
396,
308,
1596,
6702,
29905,
29873,
1273,
29879,
29915,
1273,
7664,
29897,
13,
29937,
396,
308,
565,
376,
1576,
29908,
297,
7664,
29889,
978,
29901,
13,
29937,
396,
632,
2656,
29918,
1609,
353,
7664,
29889,
978,
29961,
29946,
29901,
1822,
17010,
580,
13,
29937,
396,
308,
1683,
29901,
13,
29937,
396,
632,
1024,
353,
12968,
1170,
29898,
442,
391,
29889,
978,
29897,
13,
29937,
396,
632,
2656,
29918,
1609,
353,
376,
8875,
6571,
1642,
4830,
29898,
978,
29889,
4230,
29892,
1024,
29889,
4102,
467,
17010,
580,
13,
29937,
396,
308,
2343,
8962,
353,
7664,
29889,
2813,
8962,
13,
29937,
396,
308,
5221,
424,
29892,
2825,
353,
16005,
29891,
29918,
9794,
29889,
7439,
12654,
424,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
632,
1024,
29922,
442,
391,
29889,
978,
29892,
13,
29937,
396,
632,
21274,
29922,
8977,
29898,
13,
29937,
396,
462,
2656,
29918,
1609,
29922,
6605,
29918,
1609,
29892,
13,
29937,
396,
462,
1426,
29922,
442,
391,
29889,
24840,
29892,
13,
29937,
396,
462,
3229,
29922,
442,
391,
29889,
20788,
29892,
13,
29937,
396,
462,
4876,
29922,
442,
391,
29889,
5269,
29892,
13,
29937,
396,
462,
4234,
29922,
442,
391,
29889,
13509,
29892,
13,
29937,
396,
462,
9008,
29922,
442,
391,
29889,
6710,
29892,
13,
29937,
396,
462,
3271,
3488,
29922,
442,
391,
29889,
5184,
3488,
29892,
13,
29937,
396,
632,
1723,
13,
29937,
396,
308,
1723,
13,
29937,
396,
308,
565,
2825,
29901,
13,
29937,
396,
632,
565,
7664,
29889,
2813,
8962,
29901,
13,
29937,
396,
462,
5221,
424,
29889,
2813,
8962,
353,
10576,
2283,
29898,
442,
391,
29889,
2813,
8962,
29889,
949,
3101,
13,
29937,
396,
462,
5221,
424,
29889,
2813,
8962,
29889,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
442,
391,
29899,
29912,
1157,
29913,
4286,
4830,
29898,
442,
391,
29889,
29517,
29892,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
13,
29937,
396,
462,
268,
7664,
29889,
2813,
8962,
29889,
978,
9601,
29896,
2314,
13,
29937,
396,
462,
5221,
424,
29889,
7620,
580,
13,
29937,
396,
308,
1596,
5221,
424,
13,
29937,
396,
308,
736,
5221,
424,
13,
29937,
396,
13,
29937,
396,
396,
268,
822,
788,
29918,
442,
391,
29898,
1311,
29892,
7664,
1125,
13,
29937,
396,
396,
308,
1596,
6702,
29905,
29873,
1273,
29879,
29915,
1273,
7664,
29897,
13,
29937,
396,
396,
308,
565,
376,
1576,
29908,
297,
7664,
29889,
978,
29901,
13,
29937,
396,
396,
632,
2656,
29918,
1609,
353,
7664,
29889,
978,
29961,
29946,
29901,
1822,
17010,
580,
13,
29937,
396,
396,
308,
1683,
29901,
13,
29937,
396,
396,
632,
1024,
353,
12968,
1170,
29898,
442,
391,
29889,
978,
29897,
13,
29937,
396,
396,
632,
2656,
29918,
1609,
353,
376,
8875,
6571,
1642,
4830,
29898,
978,
29889,
4230,
29892,
1024,
29889,
4102,
467,
17010,
580,
13,
29937,
396,
396,
308,
2343,
8962,
353,
7664,
29889,
2813,
8962,
13,
29937,
396,
396,
308,
565,
7664,
29889,
2813,
8962,
29901,
13,
29937,
396,
396,
632,
2343,
8962,
353,
10576,
2283,
29898,
442,
391,
29889,
2813,
8962,
29889,
949,
3101,
13,
29937,
396,
396,
632,
2343,
8962,
29889,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
442,
391,
29899,
29912,
1157,
29913,
4286,
4830,
29898,
442,
391,
29889,
29517,
29892,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
442,
391,
29889,
2813,
8962,
29889,
978,
9601,
29896,
2314,
13,
29937,
396,
396,
308,
716,
29918,
442,
391,
29871,
353,
16005,
29891,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
396,
462,
16005,
29918,
4836,
353,
16005,
29918,
4836,
29892,
13,
29937,
396,
396,
462,
5221,
424,
353,
16005,
29891,
29918,
9794,
29889,
7439,
12654,
424,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
396,
462,
268,
1024,
353,
7664,
29889,
978,
29892,
13,
29937,
396,
396,
462,
268,
21274,
353,
9657,
29898,
13,
29937,
396,
396,
462,
632,
2656,
29918,
1609,
353,
2656,
29918,
1609,
29892,
13,
29937,
396,
396,
462,
632,
1426,
353,
7664,
29889,
24840,
29892,
13,
29937,
396,
396,
462,
632,
3229,
353,
7664,
29889,
20788,
29892,
13,
29937,
396,
396,
462,
632,
4876,
353,
7664,
29889,
5269,
29892,
13,
29937,
396,
396,
462,
632,
4234,
353,
7664,
29889,
13509,
29892,
13,
29937,
396,
396,
462,
632,
9008,
353,
7664,
29889,
6710,
29892,
13,
29937,
396,
396,
462,
632,
3271,
3488,
353,
7664,
29889,
5184,
3488,
29892,
13,
29937,
396,
396,
462,
632,
2343,
8962,
353,
2343,
8962,
13,
29937,
396,
396,
462,
462,
1723,
13,
29937,
396,
396,
462,
259,
1723,
29961,
29900,
29962,
13,
29937,
396,
396,
308,
1723,
13,
29937,
396,
396,
308,
1596,
716,
29918,
442,
391,
13,
29937,
396,
396,
308,
736,
716,
29918,
442,
391,
13,
29937,
396,
13,
29937,
396,
396,
268,
822,
10078,
17062,
29918,
29906,
29900,
29896,
29945,
29918,
442,
2879,
29898,
1311,
1125,
13,
29937,
396,
396,
308,
363,
16005,
29918,
4836,
297,
16005,
29891,
29918,
9794,
29889,
29943,
6074,
7653,
29889,
12650,
29889,
4572,
29898,
29888,
6074,
1649,
6360,
29922,
29906,
29900,
29896,
29945,
1125,
13,
29937,
396,
396,
632,
6529,
353,
16005,
29918,
9794,
29889,
7653,
2008,
1658,
29889,
12650,
29889,
4572,
29898,
4836,
1649,
3257,
353,
16005,
29918,
4836,
29889,
978,
467,
4102,
580,
13,
29937,
396,
396,
632,
565,
6529,
29901,
13,
29937,
396,
396,
462,
1596,
877,
11940,
742,
6529,
29892,
525,
20317,
742,
29888,
6074,
29918,
4836,
29897,
13,
29937,
396,
13,
29937,
396,
396,
462,
363,
7664,
297,
731,
4197,
442,
29889,
442,
391,
363,
1616,
297,
6529,
29889,
442,
29918,
842,
29889,
497,
580,
29962,
1125,
13,
29937,
396,
396,
462,
268,
1596,
6702,
29905,
29873,
1273,
29879,
29915,
1273,
7664,
29897,
13,
29937,
396,
396,
462,
268,
565,
376,
1576,
29908,
297,
7664,
29889,
978,
29901,
13,
29937,
396,
396,
462,
308,
2656,
29918,
1609,
353,
7664,
29889,
978,
29961,
29946,
29901,
1822,
17010,
580,
13,
29937,
396,
396,
462,
268,
1683,
29901,
13,
29937,
396,
396,
462,
308,
1024,
353,
12968,
1170,
29898,
442,
391,
29889,
978,
29897,
13,
29937,
396,
396,
462,
308,
2656,
29918,
1609,
353,
376,
8875,
6571,
1642,
4830,
29898,
978,
29889,
4230,
29892,
1024,
29889,
4102,
467,
17010,
580,
13,
29937,
396,
396,
462,
268,
2343,
8962,
353,
7664,
29889,
2813,
8962,
13,
29937,
396,
396,
462,
268,
565,
7664,
29889,
2813,
8962,
29901,
13,
29937,
396,
396,
462,
308,
2343,
8962,
353,
10576,
2283,
29898,
442,
391,
29889,
2813,
8962,
29889,
949,
3101,
13,
29937,
396,
396,
462,
308,
2343,
8962,
29889,
978,
353,
525,
1357,
8077,
359,
29899,
29890,
17810,
744,
29899,
442,
391,
29899,
29912,
1157,
29913,
4286,
4830,
29898,
442,
391,
29889,
29517,
29892,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
442,
391,
29889,
2813,
8962,
29889,
978,
9601,
29896,
2314,
13,
29937,
396,
396,
462,
268,
7664,
29871,
353,
16005,
29891,
29918,
9794,
29889,
9986,
391,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
396,
462,
632,
16005,
29918,
4836,
353,
16005,
29918,
4836,
29892,
13,
29937,
396,
396,
462,
632,
5221,
424,
353,
16005,
29891,
29918,
9794,
29889,
7439,
12654,
424,
29889,
12650,
29889,
657,
29918,
272,
29918,
3258,
29898,
13,
29937,
396,
396,
462,
462,
1024,
353,
7664,
29889,
978,
29892,
13,
29937,
396,
396,
462,
462,
21274,
353,
9657,
29898,
13,
29937,
396,
396,
462,
462,
308,
2656,
29918,
1609,
353,
2656,
29918,
1609,
29892,
13,
29937,
396,
396,
462,
462,
308,
1426,
353,
7664,
29889,
24840,
29892,
13,
29937,
396,
396,
462,
462,
308,
3229,
353,
7664,
29889,
20788,
29892,
13,
29937,
396,
396,
462,
462,
308,
4876,
353,
7664,
29889,
5269,
29892,
13,
29937,
396,
396,
462,
462,
308,
4234,
353,
7664,
29889,
13509,
29892,
13,
29937,
396,
396,
462,
462,
308,
9008,
353,
7664,
29889,
6710,
29892,
13,
29937,
396,
396,
462,
462,
308,
3271,
3488,
353,
7664,
29889,
5184,
3488,
29892,
13,
29937,
396,
396,
462,
462,
308,
2343,
8962,
353,
2343,
8962,
13,
29937,
396,
396,
462,
462,
632,
1723,
13,
29937,
396,
396,
462,
1669,
1723,
29961,
29900,
29962,
13,
29937,
396,
396,
462,
268,
1723,
13,
29937,
396,
396,
462,
268,
1596,
7664,
13,
29937,
396,
396,
632,
1683,
29901,
13,
29937,
396,
396,
462,
29871,
1596,
877,
1217,
1993,
363,
742,
29888,
6074,
29918,
4836,
29897,
13,
29937,
396,
13,
29937,
396,
13,
29937,
396,
13,
2
] |
htdfsdk/web3/_utils/threads.py | youngqqcn/htdfsdk | 2 | 193473 | """
A minimal implementation of the various gevent APIs used within this codebase.
"""
import threading
import time
from types import (
TracebackType,
)
from typing import (
Any,
Callable,
Generic,
Type,
)
from htdfsdk.web3._utils.compat import (
Literal,
)
from htdfsdk.web3.types import (
TReturn,
)
class Timeout(Exception):
"""
A limited subset of the `gevent.Timeout` context manager.
"""
seconds = None
exception = None
begun_at = None
is_running = None
def __init__(
self, seconds: float = None, exception: Type[BaseException] = None, *args: Any,
**kwargs: Any
) -> None:
self.seconds = seconds
self.exception = exception
def __enter__(self) -> 'Timeout':
self.start()
return self
def __exit__(
self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: TracebackType
) -> Literal[False]:
return False
def __str__(self) -> str:
if self.seconds is None:
return ''
return "{0} seconds".format(self.seconds)
@property
def expire_at(self) -> int:
if self.seconds is None:
raise ValueError("Timeouts with `seconds == None` do not have an expiration time")
elif self.begun_at is None:
raise ValueError("Timeout has not been started")
return self.begun_at + self.seconds
def start(self) -> None:
if self.is_running is not None:
raise ValueError("Timeout has already been started")
self.begun_at = time.time()
self.is_running = True
def check(self) -> None:
if self.is_running is None:
raise ValueError("Timeout has not been started")
elif self.is_running is False:
raise ValueError("Timeout has already been cancelled")
elif self.seconds is None:
return
elif time.time() > self.expire_at:
self.is_running = False
if isinstance(self.exception, type):
raise self.exception(str(self))
elif isinstance(self.exception, Exception):
raise self.exception
else:
raise self
def cancel(self) -> None:
self.is_running = False
def sleep(self, seconds: float) -> None:
time.sleep(seconds)
self.check()
class ThreadWithReturn(threading.Thread, Generic[TReturn]):
def __init__(
self, target: Callable[..., TReturn] = None, args: Any = None, kwargs: Any = None
) -> None:
super().__init__(
target=target,
args=args or tuple(),
kwargs=kwargs or {},
)
self.target = target
self.args = args
self.kwargs = kwargs
def run(self) -> None:
self._return = self.target(*self.args, **self.kwargs)
def get(self, timeout: float = None) -> TReturn:
self.join(timeout)
try:
return self._return
except AttributeError:
raise RuntimeError("Something went wrong. No `_return` property was set")
class TimerClass(threading.Thread):
def __init__(self, interval: int, callback: Callable[..., Any], *args: Any) -> None:
threading.Thread.__init__(self)
self.callback = callback
self.terminate_event = threading.Event()
self.interval = interval
self.args = args
def run(self) -> None:
while not self.terminate_event.is_set():
self.callback(*self.args)
self.terminate_event.wait(self.interval)
def stop(self) -> None:
self.terminate_event.set()
def spawn(
target: Callable[..., TReturn],
*args: Any,
thread_class: Type[ThreadWithReturn[TReturn]] = ThreadWithReturn,
**kwargs: Any,
) -> ThreadWithReturn[TReturn]:
thread = thread_class(
target=target,
args=args,
kwargs=kwargs,
)
thread.daemon = True
thread.start()
return thread
| [
1,
9995,
13,
29909,
13114,
5314,
310,
278,
5164,
1737,
794,
23649,
1304,
2629,
445,
775,
3188,
29889,
13,
15945,
29908,
13,
5215,
3244,
292,
13,
5215,
931,
13,
3166,
4072,
1053,
313,
13,
1678,
29243,
1542,
29892,
13,
29897,
13,
3166,
19229,
1053,
313,
13,
1678,
3139,
29892,
13,
1678,
8251,
519,
29892,
13,
1678,
3251,
293,
29892,
13,
1678,
5167,
29892,
13,
29897,
13,
13,
3166,
298,
1594,
29888,
15348,
29889,
2676,
29941,
3032,
13239,
29889,
12667,
1053,
313,
13,
1678,
5449,
284,
29892,
13,
29897,
13,
3166,
298,
1594,
29888,
15348,
29889,
2676,
29941,
29889,
8768,
1053,
313,
13,
1678,
323,
11609,
29892,
13,
29897,
13,
13,
13,
1990,
5974,
449,
29898,
2451,
1125,
13,
1678,
9995,
13,
1678,
319,
9078,
11306,
310,
278,
421,
479,
794,
29889,
10851,
29952,
3030,
8455,
29889,
13,
1678,
9995,
13,
1678,
6923,
353,
6213,
13,
1678,
3682,
353,
6213,
13,
1678,
23580,
29918,
271,
353,
6213,
13,
1678,
338,
29918,
21094,
353,
6213,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
6923,
29901,
5785,
353,
6213,
29892,
3682,
29901,
5167,
29961,
5160,
2451,
29962,
353,
6213,
29892,
334,
5085,
29901,
3139,
29892,
13,
4706,
3579,
19290,
29901,
3139,
13,
1678,
1723,
1599,
6213,
29901,
13,
4706,
1583,
29889,
23128,
353,
6923,
13,
4706,
1583,
29889,
11739,
353,
3682,
13,
13,
1678,
822,
4770,
5893,
12035,
1311,
29897,
1599,
525,
10851,
2396,
13,
4706,
1583,
29889,
2962,
580,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4770,
13322,
12035,
13,
4706,
1583,
29892,
5566,
29918,
1853,
29901,
5167,
29961,
5160,
2451,
1402,
5566,
29918,
791,
29901,
7399,
2451,
29892,
5566,
29918,
22625,
29901,
29243,
1542,
13,
1678,
1723,
1599,
5449,
284,
29961,
8824,
5387,
13,
4706,
736,
7700,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
565,
1583,
29889,
23128,
338,
6213,
29901,
13,
9651,
736,
6629,
13,
4706,
736,
29850,
29900,
29913,
6923,
1642,
4830,
29898,
1311,
29889,
23128,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1518,
533,
29918,
271,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
565,
1583,
29889,
23128,
338,
6213,
29901,
13,
9651,
12020,
7865,
2392,
703,
10851,
29879,
411,
421,
23128,
1275,
6213,
29952,
437,
451,
505,
385,
1518,
12232,
931,
1159,
13,
4706,
25342,
1583,
29889,
28060,
348,
29918,
271,
338,
6213,
29901,
13,
9651,
12020,
7865,
2392,
703,
10851,
756,
451,
1063,
4687,
1159,
13,
4706,
736,
1583,
29889,
28060,
348,
29918,
271,
718,
1583,
29889,
23128,
13,
13,
1678,
822,
1369,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
565,
1583,
29889,
275,
29918,
21094,
338,
451,
6213,
29901,
13,
9651,
12020,
7865,
2392,
703,
10851,
756,
2307,
1063,
4687,
1159,
13,
4706,
1583,
29889,
28060,
348,
29918,
271,
353,
931,
29889,
2230,
580,
13,
4706,
1583,
29889,
275,
29918,
21094,
353,
5852,
13,
13,
1678,
822,
1423,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
565,
1583,
29889,
275,
29918,
21094,
338,
6213,
29901,
13,
9651,
12020,
7865,
2392,
703,
10851,
756,
451,
1063,
4687,
1159,
13,
4706,
25342,
1583,
29889,
275,
29918,
21094,
338,
7700,
29901,
13,
9651,
12020,
7865,
2392,
703,
10851,
756,
2307,
1063,
12611,
839,
1159,
13,
4706,
25342,
1583,
29889,
23128,
338,
6213,
29901,
13,
9651,
736,
13,
4706,
25342,
931,
29889,
2230,
580,
1405,
1583,
29889,
4548,
533,
29918,
271,
29901,
13,
9651,
1583,
29889,
275,
29918,
21094,
353,
7700,
13,
9651,
565,
338,
8758,
29898,
1311,
29889,
11739,
29892,
1134,
1125,
13,
18884,
12020,
1583,
29889,
11739,
29898,
710,
29898,
1311,
876,
13,
9651,
25342,
338,
8758,
29898,
1311,
29889,
11739,
29892,
8960,
1125,
13,
18884,
12020,
1583,
29889,
11739,
13,
9651,
1683,
29901,
13,
18884,
12020,
1583,
13,
13,
1678,
822,
12611,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
275,
29918,
21094,
353,
7700,
13,
13,
1678,
822,
8709,
29898,
1311,
29892,
6923,
29901,
5785,
29897,
1599,
6213,
29901,
13,
4706,
931,
29889,
17059,
29898,
23128,
29897,
13,
4706,
1583,
29889,
3198,
580,
13,
13,
13,
1990,
10480,
3047,
11609,
29898,
7097,
292,
29889,
4899,
29892,
3251,
293,
29961,
5659,
300,
595,
29962,
1125,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
3646,
29901,
8251,
519,
29961,
16361,
323,
11609,
29962,
353,
6213,
29892,
6389,
29901,
3139,
353,
6213,
29892,
9049,
5085,
29901,
3139,
353,
6213,
13,
1678,
1723,
1599,
6213,
29901,
13,
4706,
2428,
2141,
1649,
2344,
12035,
13,
9651,
3646,
29922,
5182,
29892,
13,
9651,
6389,
29922,
5085,
470,
18761,
3285,
13,
9651,
9049,
5085,
29922,
19290,
470,
24335,
13,
4706,
1723,
13,
4706,
1583,
29889,
5182,
353,
3646,
13,
4706,
1583,
29889,
5085,
353,
6389,
13,
4706,
1583,
29889,
19290,
353,
9049,
5085,
13,
13,
1678,
822,
1065,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1583,
3032,
2457,
353,
1583,
29889,
5182,
10456,
1311,
29889,
5085,
29892,
3579,
1311,
29889,
19290,
29897,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
11815,
29901,
5785,
353,
6213,
29897,
1599,
323,
11609,
29901,
13,
4706,
1583,
29889,
7122,
29898,
15619,
29897,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
3032,
2457,
13,
4706,
5174,
23833,
2392,
29901,
13,
9651,
12020,
24875,
2392,
703,
16804,
3512,
2743,
29889,
29871,
1939,
19392,
2457,
29952,
2875,
471,
731,
1159,
13,
13,
13,
1990,
29168,
2385,
29898,
7097,
292,
29889,
4899,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
7292,
29901,
938,
29892,
6939,
29901,
8251,
519,
29961,
16361,
3139,
1402,
334,
5085,
29901,
3139,
29897,
1599,
6213,
29901,
13,
4706,
3244,
292,
29889,
4899,
17255,
2344,
12035,
1311,
29897,
13,
4706,
1583,
29889,
14035,
353,
6939,
13,
4706,
1583,
29889,
18821,
403,
29918,
3696,
353,
3244,
292,
29889,
2624,
580,
13,
4706,
1583,
29889,
19207,
353,
7292,
13,
4706,
1583,
29889,
5085,
353,
6389,
13,
13,
1678,
822,
1065,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1550,
451,
1583,
29889,
18821,
403,
29918,
3696,
29889,
275,
29918,
842,
7295,
13,
9651,
1583,
29889,
14035,
10456,
1311,
29889,
5085,
29897,
13,
9651,
1583,
29889,
18821,
403,
29918,
3696,
29889,
10685,
29898,
1311,
29889,
19207,
29897,
13,
13,
1678,
822,
5040,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
18821,
403,
29918,
3696,
29889,
842,
580,
13,
13,
13,
1753,
29178,
29898,
13,
1678,
3646,
29901,
8251,
519,
29961,
16361,
323,
11609,
1402,
13,
1678,
334,
5085,
29901,
3139,
29892,
13,
1678,
3244,
29918,
1990,
29901,
5167,
29961,
4899,
3047,
11609,
29961,
5659,
300,
595,
5262,
353,
10480,
3047,
11609,
29892,
13,
1678,
3579,
19290,
29901,
3139,
29892,
13,
29897,
1599,
10480,
3047,
11609,
29961,
5659,
300,
595,
5387,
13,
1678,
3244,
353,
3244,
29918,
1990,
29898,
13,
4706,
3646,
29922,
5182,
29892,
13,
4706,
6389,
29922,
5085,
29892,
13,
4706,
9049,
5085,
29922,
19290,
29892,
13,
1678,
1723,
13,
1678,
3244,
29889,
1388,
9857,
353,
5852,
13,
1678,
3244,
29889,
2962,
580,
13,
1678,
736,
3244,
13,
2
] |
qalqulus/test.py | FlyOrBoom/QuintessentialQuackbotsWithQuestionableQueryingQualifications | 0 | 128861 | <filename>qalqulus/test.py
import argparse, cv2 # image recognition stuff
# load the input image and convert it to grayscale
image = cv2.cvtColor(cv2.imread('resources/leithold-11.jpg'), cv2.COLOR_BGR2GRAY)
template = cv2.cvtColor(cv2.imread('resources/leithold-n-8.png'), cv2.COLOR_BGR2GRAY)
img = image.copy()
method = cv2.TM_SQDIFF_NORMED
# Apply template Matching
res = cv2.matchTemplate(image,template,method)
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res)
print(min_val, max_val, min_loc, max_loc)
top_left = min_loc
bottom_right = (top_left[0] + 64, top_left[1] + 32)
cv2.rectangle(img,top_left, bottom_right, 128, 2)
cv2.imwrite('out.png',img)
| [
1,
529,
9507,
29958,
29939,
284,
339,
12160,
29914,
1688,
29889,
2272,
13,
13,
5215,
1852,
5510,
29892,
13850,
29906,
396,
1967,
19679,
6433,
13,
13,
29937,
2254,
278,
1881,
1967,
322,
3588,
372,
304,
16749,
7052,
13,
3027,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
11023,
29906,
29889,
326,
949,
877,
13237,
29914,
280,
389,
1025,
29899,
29896,
29896,
29889,
6173,
5477,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
29954,
22800,
29897,
13,
6886,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
11023,
29906,
29889,
326,
949,
877,
13237,
29914,
280,
389,
1025,
29899,
29876,
29899,
29947,
29889,
2732,
5477,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
29954,
22800,
29897,
13,
13,
2492,
353,
1967,
29889,
8552,
580,
13,
5696,
353,
13850,
29906,
29889,
23081,
29918,
29903,
29984,
4571,
4198,
29918,
29940,
1955,
2303,
29928,
13,
13,
29937,
2401,
368,
4472,
14514,
292,
13,
690,
353,
13850,
29906,
29889,
4352,
6733,
29898,
3027,
29892,
6886,
29892,
5696,
29897,
13,
1195,
29918,
791,
29892,
4236,
29918,
791,
29892,
1375,
29918,
2029,
29892,
4236,
29918,
2029,
353,
13850,
29906,
29889,
1195,
7976,
3524,
29898,
690,
29897,
13,
2158,
29898,
1195,
29918,
791,
29892,
4236,
29918,
791,
29892,
1375,
29918,
2029,
29892,
4236,
29918,
2029,
29897,
13,
13,
3332,
29918,
1563,
353,
1375,
29918,
2029,
13,
8968,
29918,
1266,
353,
313,
3332,
29918,
1563,
29961,
29900,
29962,
718,
29871,
29953,
29946,
29892,
2246,
29918,
1563,
29961,
29896,
29962,
718,
29871,
29941,
29906,
29897,
13,
13,
11023,
29906,
29889,
1621,
2521,
29898,
2492,
29892,
3332,
29918,
1563,
29892,
5970,
29918,
1266,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29906,
29897,
13,
11023,
29906,
29889,
326,
3539,
877,
449,
29889,
2732,
742,
2492,
29897,
13,
2
] |
scripts/prediction_and_evaluting.py | pradeepsuyal/classifying_disease_with-chest_xray | 0 | 179637 | # EVALUATING TRAINED DEEP LEARNING MODEL
# In[ ]:
history.history.keys()
# In[ ]:
plt.plot(history.history['accuracy'])
plt.plot(history.history['loss'])
plt.title('Model Loss and Accuracy Progress During Training')
plt.xlabel('Epoch')
plt.ylabel('Training Accuracy and Loss')
plt.legend(['Training Accuracy', 'Training Loss'])
# In[ ]:
plt.plot(history.history['val_loss'])
plt.title('Model Loss During Cross-Validation')
plt.xlabel('Epoch')
plt.ylabel('Validation Loss')
plt.legend(['Validation Loss'])
# In[ ]:
plt.plot(history.history['val_accuracy'])
plt.title('Model Accuracy Progress During Cross-Validation')
plt.xlabel('Epoch')
plt.ylabel('Validation Accuracy')
plt.legend(['Validation Accuracy'])
# In[ ]:
test_directory = 'Test'
# In[ ]:
test_gen = ImageDataGenerator(rescale = 1./255)
test_generator = test_gen.flow_from_directory(batch_size = 40, directory= test_directory, shuffle= True, target_size=(256,256), class_mode= 'categorical')
evaluate = model.evaluate_generator(test_generator, steps = test_generator.n // 4, verbose =1)
print('Accuracy Test : {}'.format(evaluate[1]))
# In[ ]:
from sklearn.metrics import confusion_matrix, classification_report, accuracy_score
prediction = []
original = []
image = []
for i in range(len(os.listdir(test_directory))):
for item in os.listdir(os.path.join(test_directory,str(i))):
img= cv2.imread(os.path.join(test_directory,str(i),item))
img = cv2.resize(img,(256,256))
image.append(img)
img = img / 255
img = img.reshape(-1,256,256,3)
predict = model.predict(img)
predict = np.argmax(predict)
prediction.append(predict)
original.append(i)
# In[ ]:
len(original)
# In[ ]:
score = accuracy_score(original,prediction)
print("Test Accuracy : {}".format(score))
# In[ ]:
L = 5
W = 5
fig, axes = plt.subplots(L, W, figsize = (12, 12))
axes = axes.ravel()
for i in np.arange(0, L*W):
axes[i].imshow(image[i])
axes[i].set_title('Guess={}\nTrue={}'.format(str(label_names[prediction[i]]), str(label_names[original[i]])))
axes[i].axis('off')
plt.subplots_adjust(wspace = 1.2)
# In[ ]:
print(classification_report(np.asarray(original), np.asarray(prediction)))
# In[ ]:
cm = confusion_matrix(np.asarray(original), np.asarray(prediction))
ax = plt.subplot()
sns.heatmap(cm, annot = True, ax = ax)
ax.set_xlabel('Predicted')
ax.set_ylabel('Original')
ax.set_title('Confusion_matrix')
| [
1,
396,
382,
8932,
29965,
1299,
4214,
323,
4717,
1177,
3352,
5012,
15488,
11060,
25614,
16999,
2287,
29931,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
18434,
29889,
18434,
29889,
8149,
26471,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
572,
29873,
29889,
5317,
29898,
18434,
29889,
18434,
1839,
562,
2764,
4135,
2033,
8443,
13,
572,
29873,
29889,
5317,
29898,
18434,
29889,
18434,
1839,
6758,
2033,
8443,
13,
30004,
13,
572,
29873,
29889,
3257,
877,
3195,
365,
2209,
322,
4831,
332,
4135,
20018,
7133,
26101,
1495,
30004,
13,
572,
29873,
29889,
29916,
1643,
877,
29923,
1129,
305,
1495,
30004,
13,
572,
29873,
29889,
29891,
1643,
877,
5323,
2827,
4831,
332,
4135,
322,
365,
2209,
1495,
30004,
13,
572,
29873,
29889,
26172,
18959,
5323,
2827,
4831,
332,
4135,
742,
525,
5323,
2827,
365,
2209,
2033,
8443,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
572,
29873,
29889,
5317,
29898,
18434,
29889,
18434,
1839,
791,
29918,
6758,
2033,
8443,
13,
572,
29873,
29889,
3257,
877,
3195,
365,
2209,
7133,
11189,
29899,
19448,
1495,
30004,
13,
572,
29873,
29889,
29916,
1643,
877,
29923,
1129,
305,
1495,
30004,
13,
572,
29873,
29889,
29891,
1643,
877,
19448,
365,
2209,
1495,
30004,
13,
572,
29873,
29889,
26172,
18959,
19448,
365,
2209,
2033,
8443,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
572,
29873,
29889,
5317,
29898,
18434,
29889,
18434,
1839,
791,
29918,
562,
2764,
4135,
2033,
8443,
13,
572,
29873,
29889,
3257,
877,
3195,
4831,
332,
4135,
20018,
7133,
11189,
29899,
19448,
1495,
30004,
13,
572,
29873,
29889,
29916,
1643,
877,
29923,
1129,
305,
1495,
30004,
13,
572,
29873,
29889,
29891,
1643,
877,
19448,
4831,
332,
4135,
1495,
30004,
13,
572,
29873,
29889,
26172,
18959,
19448,
4831,
332,
4135,
2033,
8443,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
1688,
29918,
12322,
353,
525,
3057,
29915,
30004,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
1688,
29918,
1885,
353,
7084,
1469,
21575,
29898,
690,
29883,
744,
353,
29871,
29896,
6904,
29906,
29945,
29945,
8443,
13,
30004,
13,
1688,
29918,
27959,
353,
1243,
29918,
1885,
29889,
1731,
29918,
3166,
29918,
12322,
29898,
16175,
29918,
2311,
353,
29871,
29946,
29900,
29892,
3884,
29922,
1243,
29918,
12322,
29892,
528,
21897,
29922,
5852,
29892,
3646,
29918,
2311,
7607,
29906,
29945,
29953,
29892,
29906,
29945,
29953,
511,
770,
29918,
8513,
29922,
525,
29883,
20440,
936,
1495,
30004,
13,
30004,
13,
24219,
403,
353,
1904,
29889,
24219,
403,
29918,
27959,
29898,
1688,
29918,
27959,
29892,
6576,
353,
1243,
29918,
27959,
29889,
29876,
849,
29871,
29946,
29892,
26952,
353,
29896,
8443,
13,
30004,
13,
2158,
877,
7504,
332,
4135,
4321,
584,
6571,
4286,
4830,
29898,
24219,
403,
29961,
29896,
12622,
30004,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
14679,
29918,
5344,
29892,
12965,
29918,
12276,
29892,
13600,
29918,
13628,
30004,
13,
30004,
13,
11965,
2463,
353,
5159,
30004,
13,
13492,
353,
5159,
30004,
13,
3027,
353,
5159,
30004,
13,
30004,
13,
1454,
474,
297,
3464,
29898,
2435,
29898,
359,
29889,
1761,
3972,
29898,
1688,
29918,
12322,
876,
1125,
30004,
13,
1678,
363,
2944,
297,
2897,
29889,
1761,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
12322,
29892,
710,
29898,
29875,
876,
1125,
30004,
13,
4706,
10153,
29922,
13850,
29906,
29889,
326,
949,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
12322,
29892,
710,
29898,
29875,
511,
667,
876,
30004,
13,
4706,
10153,
353,
13850,
29906,
29889,
21476,
29898,
2492,
22657,
29906,
29945,
29953,
29892,
29906,
29945,
29953,
876,
30004,
13,
4706,
1967,
29889,
4397,
29898,
2492,
8443,
13,
4706,
10153,
353,
10153,
847,
29871,
29906,
29945,
29945,
30004,
13,
4706,
10153,
353,
10153,
29889,
690,
14443,
6278,
29896,
29892,
29906,
29945,
29953,
29892,
29906,
29945,
29953,
29892,
29941,
8443,
13,
4706,
8500,
353,
1904,
29889,
27711,
29898,
2492,
8443,
13,
4706,
8500,
353,
7442,
29889,
1191,
3317,
29898,
27711,
8443,
13,
4706,
18988,
29889,
4397,
29898,
27711,
8443,
13,
4706,
2441,
29889,
4397,
29898,
29875,
8443,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
2435,
29898,
13492,
8443,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
13628,
353,
13600,
29918,
13628,
29898,
13492,
29892,
11965,
2463,
8443,
13,
2158,
703,
3057,
4831,
332,
4135,
584,
6571,
1642,
4830,
29898,
13628,
876,
30004,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
29931,
353,
29871,
29945,
30004,
13,
29956,
353,
29871,
29945,
30004,
13,
30004,
13,
1003,
29892,
27815,
353,
14770,
29889,
1491,
26762,
29898,
29931,
29892,
399,
29892,
2537,
2311,
353,
313,
29896,
29906,
29892,
29871,
29896,
29906,
876,
30004,
13,
1165,
267,
353,
27815,
29889,
336,
955,
26471,
13,
30004,
13,
1454,
474,
297,
7442,
29889,
279,
927,
29898,
29900,
29892,
365,
29930,
29956,
1125,
30004,
13,
1678,
27815,
29961,
29875,
1822,
326,
4294,
29898,
3027,
29961,
29875,
2314,
30004,
13,
1678,
27815,
29961,
29875,
1822,
842,
29918,
3257,
877,
9485,
404,
3790,
1012,
29876,
5574,
3790,
29913,
4286,
4830,
29898,
710,
29898,
1643,
29918,
7039,
29961,
11965,
2463,
29961,
29875,
5262,
511,
851,
29898,
1643,
29918,
7039,
29961,
13492,
29961,
29875,
5262,
4961,
30004,
13,
1678,
27815,
29961,
29875,
1822,
8990,
877,
2696,
1495,
30004,
13,
30004,
13,
572,
29873,
29889,
1491,
26762,
29918,
328,
5143,
29898,
29893,
3493,
353,
29871,
29896,
29889,
29906,
29897,
6756,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
2158,
29898,
1990,
2450,
29918,
12276,
29898,
9302,
29889,
294,
2378,
29898,
13492,
511,
7442,
29889,
294,
2378,
29898,
11965,
2463,
4961,
30004,
13,
30004,
13,
30004,
13,
29937,
512,
29961,
4514,
29901,
30004,
13,
30004,
13,
30004,
13,
4912,
353,
14679,
29918,
5344,
29898,
9302,
29889,
294,
2378,
29898,
13492,
511,
7442,
29889,
294,
2378,
29898,
11965,
2463,
876,
30004,
13,
1165,
353,
14770,
29889,
1491,
5317,
26471,
13,
29879,
1983,
29889,
354,
271,
1958,
29898,
4912,
29892,
9732,
353,
5852,
29892,
4853,
353,
4853,
8443,
13,
30004,
13,
1165,
29889,
842,
29918,
29916,
1643,
877,
23084,
18186,
1495,
30004,
13,
1165,
29889,
842,
29918,
29891,
1643,
877,
26036,
1495,
30004,
13,
1165,
29889,
842,
29918,
3257,
877,
16376,
3958,
29918,
5344,
1495,
30004,
13,
2
] |
pype/plugins/maya/publish/collect_mayaascii.py | kalisp/pype | 0 | 54595 | from maya import cmds
import pyblish.api
class CollectMayaAscii(pyblish.api.InstancePlugin):
"""Collect May Ascii Data
"""
order = pyblish.api.CollectorOrder + 0.2
label = 'Collect Model Data'
families = ["mayaAscii"]
def process(self, instance):
# Extract only current frame (override)
frame = cmds.currentTime(query=True)
instance.data["frameStart"] = frame
instance.data["frameEnd"] = frame
# make ftrack publishable
if instance.data.get('families'):
instance.data['families'].append('ftrack')
else:
instance.data['families'] = ['ftrack']
| [
1,
515,
1122,
29874,
1053,
9920,
29879,
13,
13,
5215,
11451,
29890,
1674,
29889,
2754,
13,
13,
13,
1990,
24930,
29924,
9010,
2887,
18869,
29898,
2272,
29890,
1674,
29889,
2754,
29889,
4998,
16288,
1125,
13,
1678,
9995,
28916,
2610,
1094,
18869,
3630,
13,
13,
1678,
9995,
13,
13,
1678,
1797,
353,
11451,
29890,
1674,
29889,
2754,
29889,
28916,
272,
7514,
718,
29871,
29900,
29889,
29906,
13,
1678,
3858,
353,
525,
28916,
8125,
3630,
29915,
13,
1678,
13175,
353,
6796,
29885,
9010,
2887,
18869,
3108,
13,
13,
1678,
822,
1889,
29898,
1311,
29892,
2777,
1125,
13,
4706,
396,
7338,
1461,
871,
1857,
3515,
313,
15752,
29897,
13,
4706,
3515,
353,
9920,
29879,
29889,
3784,
2481,
29898,
1972,
29922,
5574,
29897,
13,
4706,
2777,
29889,
1272,
3366,
2557,
4763,
3108,
353,
3515,
13,
4706,
2777,
29889,
1272,
3366,
2557,
5044,
3108,
353,
3515,
13,
13,
4706,
396,
1207,
285,
11294,
9805,
519,
13,
4706,
565,
2777,
29889,
1272,
29889,
657,
877,
8302,
583,
29374,
13,
9651,
2777,
29889,
1272,
1839,
8302,
583,
13359,
4397,
877,
615,
22282,
1495,
13,
4706,
1683,
29901,
13,
9651,
2777,
29889,
1272,
1839,
8302,
583,
2033,
353,
6024,
615,
22282,
2033,
13,
2
] |
Stock_Analysis/pivot_points.py | vhn0912/Finance | 441 | 192956 | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import yfinance as yf
yf.pdr_override()
import datetime as dt
symbol = 'AMD'
market = 'SPY'
num_of_years = 1
start = dt.date.today() - dt.timedelta(days=365*num_of_years)
end = dt.date.today()
dataset = yf.download(symbol,start,end)
benchmark = yf.download(market,start,end)
dataset['Returns'] = dataset['Adj Close'].pct_change().dropna()
PP = pd.Series((dataset['High'] + dataset['Low'] + dataset['Close']) / 3)
R1 = pd.Series(2 * PP - dataset['Low'])
S1 = pd.Series(2 * PP - dataset['High'])
R2 = pd.Series(PP + dataset['High'] - dataset['Low'])
S2 = pd.Series(PP - dataset['High'] + dataset['Low'])
R3 = pd.Series(dataset['High'] + 2 * (PP - dataset['Low']))
S3 = pd.Series(dataset['Low'] - 2 * (dataset['High'] - PP))
R4 = pd.Series(dataset['High'] + 3 * (PP - dataset['Low']))
S4 = pd.Series(dataset['Low'] - 3 * (dataset['High'] - PP))
R5 = pd.Series(dataset['High'] + 4 * (PP - dataset['Low']))
S5 = pd.Series(dataset['Low'] - 4 * (dataset['High'] - PP))
P = pd.Series((dataset['Open'] + (dataset['High'] + dataset['Low'] + dataset['Close'])) / 4) # Opening Price Formula
psr = {'P':P, 'R1':R1, 'S1':S1, 'R2':R2, 'S2':S2, 'R3':R3, 'S3':S3,'R4':R4, 'S4':S4,'R5':R5, 'S5':S5}
PSR = pd.DataFrame(psr)
dataset = dataset.join(PSR)
print(dataset.head())
pivot_point = pd.concat([dataset['Adj Close'],P,R1,S1,R2,S2,R3,S3],axis=1).plot(figsize=(18,12),grid=True)
plt.title('Stock Pivot Point')
plt.legend(['Price','P','R1','S1','R2','S2','R3','S3'], loc=0)
plt.show()
dataset['Adj Close']['2018-05-01':'2018-06-01']
date_range = dataset[['Adj Close','P','R1','S1','R2','S2','R3','S3']]['2018-05-01':'2018-06-01']# Pick Date Ranges
P = pd.Series((dataset['High'] + dataset['Low'] + 2*dataset['Close']) / 4)
R1 = pd.Series(2 * P - dataset['Low'])
S1 = pd.Series(2 * P - dataset['High'])
R2 = pd.Series(P + dataset['High'] - dataset['Low'])
S2 = pd.Series(P - dataset['High'] + dataset['Low'])
wpp = {'P':P, 'R1':R1, 'S1':S1, 'R2':R2, 'S2':S2}
WPP = pd.DataFrame(wpp)
print(WPP.head())
R1 = pd.Series((dataset['High'] - dataset['Low']) * 1.1 / (2+dataset['Close']))
R2 = pd.Series((dataset['High'] - dataset['Low']) * 1.1 / (4+dataset['Close']))
R3 = pd.Series((dataset['High'] - dataset['Low']) * 1.1 / (6+dataset['Close']))
R4 = pd.Series((dataset['High'] - dataset['Low']) * 1.1 / (12+dataset['Close']))
S1 = pd.Series((dataset['Close'] - (dataset['High']-dataset['Low']) * 1.1)/12)
S2 = pd.Series((dataset['Close'] - (dataset['High']-dataset['Low']) * 1.1)/6)
S3 = pd.Series((dataset['Close'] - (dataset['High']-dataset['Low']) * 1.1)/4)
S4 = pd.Series((dataset['Close'] - (dataset['High']-dataset['Low']) * 1.1)/2)
cpp = {'R1':R1, 'S1':S1, 'R2':R2, 'S2':S2, 'R3':R3, 'S3':S3,'R4':R4, 'S4':S4}
CPP = pd.DataFrame(cpp)
print(CPP.head())
dataset = yf.download(symbol,start,end)
h_l_c = dataset['Close'] < dataset['Open']
h_lc = dataset['Close'] > dataset['Open']
hl_c = dataset['Close'] == dataset['Open']
P = np.zeros(len(dataset['Close']))
P[h_l_c] = dataset['High'][h_l_c] + 2.0 * dataset['Low'][h_l_c] + dataset['Close'][h_l_c]
P[h_lc] = 2.0 * dataset['High'][h_lc] + dataset['Low'][h_lc] + dataset['Close'][h_lc]
P[hl_c] = dataset['High'][hl_c] + dataset['Low'][hl_c] + 2.0 * dataset['Close'][hl_c]
S1 = P / 2.0 - dataset['High']
R1 = P / 2.0 - dataset['Low']
P = P / 4.0
tdm = {'P': P, 'S1': S1, 'R1': R1}
TDM = pd.DataFrame(tdm)
print(TDM.head())
PP = pd.Series((dataset['High'] + dataset['Low'] + dataset['Close']) / 3)
R1 = pd.Series((PP + (dataset['High'] - dataset['Low']) * 0.382))
R2 = pd.Series((PP + (dataset['High'] - dataset['Low']) * 0.618))
R3 = pd.Series((PP + (dataset['High'] - dataset['Low']) * 1.000))
S1 = pd.Series((PP - (dataset['High'] - dataset['Low']) * 0.382))
S2 = pd.Series((PP - (dataset['High'] - dataset['Low']) * 0.618))
S3 = pd.Series((PP - (dataset['High'] - dataset['Low']) * 1.000))
fpp = {'PP':PP, 'R1':R1, 'S1':S1, 'R2':R2, 'S2':S2, 'R3':R3, 'S3':S3}
FPP = pd.DataFrame(fpp)
print(FPP.head()) | [
1,
1053,
12655,
408,
7442,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
409,
370,
1398,
408,
269,
1983,
13,
5215,
11701,
408,
10518,
13,
5215,
18116,
13,
25442,
886,
29889,
4572,
25442,
886,
703,
17281,
1159,
29871,
13,
5215,
343,
4951,
749,
408,
343,
29888,
13,
29891,
29888,
29889,
29886,
7707,
29918,
15752,
580,
13,
5215,
12865,
408,
11636,
13,
13,
18098,
353,
525,
5194,
29928,
29915,
13,
28549,
353,
525,
5550,
29979,
29915,
13,
13,
1949,
29918,
974,
29918,
6360,
29879,
353,
29871,
29896,
13,
2962,
353,
11636,
29889,
1256,
29889,
27765,
580,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29941,
29953,
29945,
29930,
1949,
29918,
974,
29918,
6360,
29879,
29897,
13,
355,
353,
11636,
29889,
1256,
29889,
27765,
580,
13,
13,
24713,
353,
343,
29888,
29889,
10382,
29898,
18098,
29892,
2962,
29892,
355,
29897,
13,
1785,
16580,
353,
343,
29888,
29889,
10382,
29898,
28549,
29892,
2962,
29892,
355,
29897,
13,
13,
24713,
1839,
11609,
29879,
2033,
353,
8783,
1839,
3253,
29926,
23186,
13359,
29886,
312,
29918,
3167,
2141,
8865,
1056,
580,
13,
13,
18009,
353,
10518,
29889,
19204,
3552,
24713,
1839,
16382,
2033,
718,
8783,
1839,
29931,
340,
2033,
718,
8783,
1839,
11123,
11287,
847,
29871,
29941,
29897,
259,
13,
29934,
29896,
353,
10518,
29889,
19204,
29898,
29906,
334,
349,
29925,
448,
8783,
1839,
29931,
340,
11287,
259,
13,
29903,
29896,
353,
10518,
29889,
19204,
29898,
29906,
334,
349,
29925,
448,
8783,
1839,
16382,
11287,
259,
13,
29934,
29906,
353,
10518,
29889,
19204,
29898,
18009,
718,
8783,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
259,
13,
29903,
29906,
353,
10518,
29889,
19204,
29898,
18009,
448,
8783,
1839,
16382,
2033,
718,
8783,
1839,
29931,
340,
11287,
259,
13,
29934,
29941,
353,
10518,
29889,
19204,
29898,
24713,
1839,
16382,
2033,
718,
29871,
29906,
334,
313,
18009,
448,
8783,
1839,
29931,
340,
25901,
259,
13,
29903,
29941,
353,
10518,
29889,
19204,
29898,
24713,
1839,
29931,
340,
2033,
448,
29871,
29906,
334,
313,
24713,
1839,
16382,
2033,
448,
349,
29925,
876,
13,
29934,
29946,
353,
10518,
29889,
19204,
29898,
24713,
1839,
16382,
2033,
718,
29871,
29941,
334,
313,
18009,
448,
8783,
1839,
29931,
340,
25901,
259,
13,
29903,
29946,
353,
10518,
29889,
19204,
29898,
24713,
1839,
29931,
340,
2033,
448,
29871,
29941,
334,
313,
24713,
1839,
16382,
2033,
448,
349,
29925,
876,
13,
29934,
29945,
353,
10518,
29889,
19204,
29898,
24713,
1839,
16382,
2033,
718,
29871,
29946,
334,
313,
18009,
448,
8783,
1839,
29931,
340,
25901,
259,
13,
29903,
29945,
353,
10518,
29889,
19204,
29898,
24713,
1839,
29931,
340,
2033,
448,
29871,
29946,
334,
313,
24713,
1839,
16382,
2033,
448,
349,
29925,
876,
13,
29925,
353,
10518,
29889,
19204,
3552,
24713,
1839,
6585,
2033,
718,
313,
24713,
1839,
16382,
2033,
718,
8783,
1839,
29931,
340,
2033,
718,
8783,
1839,
11123,
25901,
847,
29871,
29946,
29897,
396,
4673,
292,
20743,
25515,
13,
567,
29878,
353,
11117,
29925,
2396,
29925,
29892,
525,
29934,
29896,
2396,
29934,
29896,
29892,
525,
29903,
29896,
2396,
29903,
29896,
29892,
525,
29934,
29906,
2396,
29934,
29906,
29892,
525,
29903,
29906,
2396,
29903,
29906,
29892,
525,
29934,
29941,
2396,
29934,
29941,
29892,
525,
29903,
29941,
2396,
29903,
29941,
5501,
29934,
29946,
2396,
29934,
29946,
29892,
525,
29903,
29946,
2396,
29903,
29946,
5501,
29934,
29945,
2396,
29934,
29945,
29892,
525,
29903,
29945,
2396,
29903,
29945,
29913,
259,
13,
7024,
29934,
353,
10518,
29889,
17271,
29898,
567,
29878,
29897,
259,
13,
24713,
353,
8783,
29889,
7122,
29898,
7024,
29934,
29897,
13,
2158,
29898,
24713,
29889,
2813,
3101,
13,
13,
29886,
11002,
29918,
3149,
353,
10518,
29889,
17685,
4197,
24713,
1839,
3253,
29926,
23186,
7464,
29925,
29892,
29934,
29896,
29892,
29903,
29896,
29892,
29934,
29906,
29892,
29903,
29906,
29892,
29934,
29941,
29892,
29903,
29941,
1402,
8990,
29922,
29896,
467,
5317,
29898,
1003,
2311,
7607,
29896,
29947,
29892,
29896,
29906,
511,
7720,
29922,
5574,
29897,
13,
572,
29873,
29889,
3257,
877,
20754,
384,
349,
11002,
8984,
1495,
13,
572,
29873,
29889,
26172,
18959,
13026,
3788,
29925,
3788,
29934,
29896,
3788,
29903,
29896,
3788,
29934,
29906,
3788,
29903,
29906,
3788,
29934,
29941,
3788,
29903,
29941,
7464,
1180,
29922,
29900,
29897,
13,
572,
29873,
29889,
4294,
580,
13,
13,
24713,
1839,
3253,
29926,
23186,
16215,
29906,
29900,
29896,
29947,
29899,
29900,
29945,
29899,
29900,
29896,
22099,
29906,
29900,
29896,
29947,
29899,
29900,
29953,
29899,
29900,
29896,
2033,
13,
1256,
29918,
3881,
353,
8783,
29961,
1839,
3253,
29926,
23186,
3788,
29925,
3788,
29934,
29896,
3788,
29903,
29896,
3788,
29934,
29906,
3788,
29903,
29906,
3788,
29934,
29941,
3788,
29903,
29941,
2033,
22322,
29906,
29900,
29896,
29947,
29899,
29900,
29945,
29899,
29900,
29896,
22099,
29906,
29900,
29896,
29947,
29899,
29900,
29953,
29899,
29900,
29896,
2033,
29937,
23868,
4712,
390,
6916,
13,
13,
29925,
353,
10518,
29889,
19204,
3552,
24713,
1839,
16382,
2033,
718,
8783,
1839,
29931,
340,
2033,
718,
29871,
29906,
29930,
24713,
1839,
11123,
11287,
847,
29871,
29946,
29897,
259,
13,
29934,
29896,
353,
10518,
29889,
19204,
29898,
29906,
334,
349,
448,
8783,
1839,
29931,
340,
11287,
259,
13,
29903,
29896,
353,
10518,
29889,
19204,
29898,
29906,
334,
349,
448,
8783,
1839,
16382,
11287,
259,
13,
29934,
29906,
353,
10518,
29889,
19204,
29898,
29925,
718,
8783,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
259,
13,
29903,
29906,
353,
10518,
29889,
19204,
29898,
29925,
448,
8783,
1839,
16382,
2033,
718,
8783,
1839,
29931,
340,
11287,
259,
13,
29893,
407,
353,
11117,
29925,
2396,
29925,
29892,
525,
29934,
29896,
2396,
29934,
29896,
29892,
525,
29903,
29896,
2396,
29903,
29896,
29892,
525,
29934,
29906,
2396,
29934,
29906,
29892,
525,
29903,
29906,
2396,
29903,
29906,
29913,
259,
13,
29956,
18009,
353,
10518,
29889,
17271,
29898,
29893,
407,
29897,
13,
2158,
29898,
29956,
18009,
29889,
2813,
3101,
13,
13,
29934,
29896,
353,
10518,
29889,
19204,
3552,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29896,
847,
313,
29906,
29974,
24713,
1839,
11123,
25901,
259,
13,
29934,
29906,
353,
10518,
29889,
19204,
3552,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29896,
847,
313,
29946,
29974,
24713,
1839,
11123,
25901,
259,
13,
29934,
29941,
353,
10518,
29889,
19204,
3552,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29896,
847,
313,
29953,
29974,
24713,
1839,
11123,
25901,
259,
13,
29934,
29946,
353,
10518,
29889,
19204,
3552,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29896,
847,
313,
29896,
29906,
29974,
24713,
1839,
11123,
25901,
268,
13,
29903,
29896,
353,
10518,
29889,
19204,
3552,
24713,
1839,
11123,
2033,
448,
313,
24713,
1839,
16382,
2033,
29899,
24713,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29896,
6802,
29896,
29906,
29897,
259,
13,
29903,
29906,
353,
10518,
29889,
19204,
3552,
24713,
1839,
11123,
2033,
448,
313,
24713,
1839,
16382,
2033,
29899,
24713,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29896,
6802,
29953,
29897,
29871,
13,
29903,
29941,
353,
10518,
29889,
19204,
3552,
24713,
1839,
11123,
2033,
448,
313,
24713,
1839,
16382,
2033,
29899,
24713,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29896,
6802,
29946,
29897,
259,
13,
29903,
29946,
353,
10518,
29889,
19204,
3552,
24713,
1839,
11123,
2033,
448,
313,
24713,
1839,
16382,
2033,
29899,
24713,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29896,
6802,
29906,
29897,
29871,
13,
8223,
353,
11117,
29934,
29896,
2396,
29934,
29896,
29892,
525,
29903,
29896,
2396,
29903,
29896,
29892,
525,
29934,
29906,
2396,
29934,
29906,
29892,
525,
29903,
29906,
2396,
29903,
29906,
29892,
525,
29934,
29941,
2396,
29934,
29941,
29892,
525,
29903,
29941,
2396,
29903,
29941,
5501,
29934,
29946,
2396,
29934,
29946,
29892,
525,
29903,
29946,
2396,
29903,
29946,
29913,
259,
13,
6271,
29925,
353,
10518,
29889,
17271,
29898,
8223,
29897,
259,
13,
2158,
29898,
6271,
29925,
29889,
2813,
3101,
13,
13,
24713,
353,
343,
29888,
29889,
10382,
29898,
18098,
29892,
2962,
29892,
355,
29897,
13,
29882,
29918,
29880,
29918,
29883,
353,
8783,
1839,
11123,
2033,
529,
8783,
1839,
6585,
2033,
13,
29882,
29918,
29880,
29883,
353,
8783,
1839,
11123,
2033,
1405,
8783,
1839,
6585,
2033,
13,
4415,
29918,
29883,
353,
8783,
1839,
11123,
2033,
1275,
8783,
1839,
6585,
2033,
13,
29925,
353,
7442,
29889,
3298,
359,
29898,
2435,
29898,
24713,
1839,
11123,
25901,
13,
29925,
29961,
29882,
29918,
29880,
29918,
29883,
29962,
353,
8783,
1839,
16382,
2033,
29961,
29882,
29918,
29880,
29918,
29883,
29962,
718,
29871,
29906,
29889,
29900,
334,
8783,
1839,
29931,
340,
2033,
29961,
29882,
29918,
29880,
29918,
29883,
29962,
718,
8783,
1839,
11123,
2033,
29961,
29882,
29918,
29880,
29918,
29883,
29962,
13,
29925,
29961,
29882,
29918,
29880,
29883,
29962,
353,
29871,
29906,
29889,
29900,
334,
8783,
1839,
16382,
2033,
29961,
29882,
29918,
29880,
29883,
29962,
718,
8783,
1839,
29931,
340,
2033,
29961,
29882,
29918,
29880,
29883,
29962,
718,
8783,
1839,
11123,
2033,
29961,
29882,
29918,
29880,
29883,
29962,
13,
29925,
29961,
4415,
29918,
29883,
29962,
353,
8783,
1839,
16382,
2033,
29961,
4415,
29918,
29883,
29962,
718,
8783,
1839,
29931,
340,
2033,
29961,
4415,
29918,
29883,
29962,
718,
29871,
29906,
29889,
29900,
334,
8783,
1839,
11123,
2033,
29961,
4415,
29918,
29883,
29962,
13,
29903,
29896,
353,
349,
847,
29871,
29906,
29889,
29900,
448,
8783,
1839,
16382,
2033,
13,
29934,
29896,
353,
349,
847,
29871,
29906,
29889,
29900,
448,
8783,
1839,
29931,
340,
2033,
13,
29925,
353,
349,
847,
29871,
29946,
29889,
29900,
13,
1594,
29885,
353,
11117,
29925,
2396,
349,
29892,
525,
29903,
29896,
2396,
317,
29896,
29892,
525,
29934,
29896,
2396,
390,
29896,
29913,
13,
29911,
23560,
353,
10518,
29889,
17271,
29898,
1594,
29885,
29897,
13,
2158,
29898,
29911,
23560,
29889,
2813,
3101,
13,
13,
18009,
353,
10518,
29889,
19204,
3552,
24713,
1839,
16382,
2033,
718,
8783,
1839,
29931,
340,
2033,
718,
8783,
1839,
11123,
11287,
847,
29871,
29941,
29897,
259,
13,
29934,
29896,
353,
10518,
29889,
19204,
3552,
18009,
718,
313,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29900,
29889,
29941,
29947,
29906,
876,
13,
29934,
29906,
353,
10518,
29889,
19204,
3552,
18009,
718,
313,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29900,
29889,
29953,
29896,
29947,
876,
259,
13,
29934,
29941,
353,
10518,
29889,
19204,
3552,
18009,
718,
313,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29900,
29900,
29900,
876,
13,
29903,
29896,
353,
10518,
29889,
19204,
3552,
18009,
448,
313,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29900,
29889,
29941,
29947,
29906,
876,
13,
29903,
29906,
353,
10518,
29889,
19204,
3552,
18009,
448,
313,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29900,
29889,
29953,
29896,
29947,
876,
259,
13,
29903,
29941,
353,
10518,
29889,
19204,
3552,
18009,
448,
313,
24713,
1839,
16382,
2033,
448,
8783,
1839,
29931,
340,
11287,
334,
29871,
29896,
29889,
29900,
29900,
29900,
876,
13,
29888,
407,
353,
11117,
18009,
2396,
18009,
29892,
525,
29934,
29896,
2396,
29934,
29896,
29892,
525,
29903,
29896,
2396,
29903,
29896,
29892,
525,
29934,
29906,
2396,
29934,
29906,
29892,
525,
29903,
29906,
2396,
29903,
29906,
29892,
525,
29934,
29941,
2396,
29934,
29941,
29892,
525,
29903,
29941,
2396,
29903,
29941,
29913,
259,
13,
29943,
18009,
353,
10518,
29889,
17271,
29898,
29888,
407,
29897,
259,
13,
2158,
29898,
29943,
18009,
29889,
2813,
3101,
2
] |
scripts/mgear/synoptic/utils.py | marza-animation-planet/mgear_synoptic | 72 | 91401 | import traceback
import pymel.core as pm
import mgear
from mgear.vendor.Qt import QtCore
from mgear.core.anim_utils import *
# =============================================================================
# constants
# =============================================================================
SYNOPTIC_WIDGET_NAME = "synoptic_view"
##################################################
#
##################################################
def getSynopticWidget(widget, max_iter=20):
"""Return the widget where the synoptic panel is attach
Arguments:
widget (QWidget): The widget to get the parent
max_iter (int, optional): Iteration limit to find the paretn widget
Returns:
widget: The Parent widget
"""
parent = widget.parentWidget()
for i in range(max_iter):
if parent.objectName() == SYNOPTIC_WIDGET_NAME:
return parent
parent = parent.parentWidget()
return False
def getModel(widget):
"""Get the model Name
Args:
widget (QWidget): Synoptic widget
Returns:
PyNode: The rig model name
"""
syn_widget = getSynopticWidget(widget, max_iter=20)
model_name = syn_widget.model_list.currentText()
if not pm.ls(model_name):
return None
try:
model = pm.PyNode(model_name)
except pm.general.MayaNodeError:
mes = traceback.format_exc()
mes = "Can't find model {0} for widget: {1}\n{2}".format(
model_name, widget, mes)
mgear.log(mes, mgear.sev_error)
return None
return model
##################################################
# SELECT
##################################################
# ================================================
def selectObj(model, object_names, mouse_button, key_modifier):
"""Select an object
Args:
model (PyNode): The rig top node
object_names (list): The names of the objects to select
mouse_button (QtSignal): Clicked mouse button signal
key_modifier (QtSignal): Modifier button signal
Returns:
None
"""
if not model:
return
nameSpace = getNamespace(model)
with pm.UndoChunk():
nodes = []
for name in object_names:
if nameSpace:
node = getNode(nameSpace + ":" + name)
else:
node = getNode(name)
if not node:
continue
if not node and nameSpace:
mgear.log("Can't find object : %s:%s" % (nameSpace, name),
mgear.sev_error)
elif not node:
mgear.log("Can't find object : %s" % (name), mgear.sev_error)
nodes.append(node)
if not nodes:
return
if mouse_button == QtCore.Qt.RightButton:
mirrorPose(False, nodes)
return
if mouse_button == QtCore.Qt.MiddleButton:
mirrorPose(True, nodes)
return
# Key pressed
if key_modifier is None:
pm.select(nodes)
elif key_modifier == QtCore.Qt.NoModifier: # No Key
pm.select(nodes)
elif key_modifier == QtCore.Qt.ControlModifier: # ctrl
pm.select(nodes, deselect=True)
elif key_modifier == QtCore.Qt.ShiftModifier: # shift
pm.select(nodes, toggle=True)
elif int(key_modifier) == (QtCore.Qt.ControlModifier
| QtCore.Qt.ShiftModifier): # ctrl + shift
pm.select(nodes, add=True)
elif key_modifier == QtCore.Qt.AltModifier: # alt
pm.select(nodes)
elif int(key_modifier) == (QtCore.Qt.ControlModifier
| QtCore.Qt.AltModifier): # ctrl + alt
pm.select(nodes, deselect=True)
elif int(key_modifier) == (QtCore.Qt.ShiftModifier
| QtCore.Qt.AltModifier): # shift + alt
pm.select(nodes, toggle=True)
# Ctrl + alt + shift
elif int(key_modifier) == (QtCore.Qt.ControlModifier
| QtCore.Qt.AltModifier
| QtCore.Qt.ShiftModifier):
pm.select(nodes, add=True)
else:
pm.select(nodes)
| [
1,
1053,
9637,
1627,
13,
13,
13,
5215,
282,
962,
295,
29889,
3221,
408,
26354,
13,
13,
5215,
286,
479,
279,
13,
13,
3166,
286,
479,
279,
29889,
19167,
29889,
17303,
1053,
14705,
9203,
13,
13,
3166,
286,
479,
279,
29889,
3221,
29889,
11576,
29918,
13239,
1053,
334,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
13,
29937,
17727,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
13,
13,
14816,
29940,
14094,
2965,
29918,
19292,
7194,
29918,
5813,
353,
376,
19274,
3670,
293,
29918,
1493,
29908,
13,
13,
13,
13383,
13383,
13383,
2277,
13,
29937,
13,
13383,
13383,
13383,
2277,
13,
13,
1753,
679,
29216,
3670,
293,
8801,
29898,
8030,
29892,
4236,
29918,
1524,
29922,
29906,
29900,
1125,
13,
1678,
9995,
11609,
278,
11109,
988,
278,
5222,
3670,
293,
9451,
338,
10641,
13,
13,
1678,
11842,
9331,
29901,
13,
4706,
11109,
313,
29984,
8801,
1125,
450,
11109,
304,
679,
278,
3847,
13,
4706,
4236,
29918,
1524,
313,
524,
29892,
13136,
1125,
20504,
362,
4046,
304,
1284,
278,
9541,
6277,
11109,
13,
13,
1678,
16969,
29901,
13,
4706,
11109,
29901,
450,
22280,
11109,
13,
1678,
9995,
13,
1678,
3847,
353,
11109,
29889,
3560,
8801,
580,
13,
1678,
363,
474,
297,
3464,
29898,
3317,
29918,
1524,
1125,
13,
4706,
565,
3847,
29889,
3318,
1170,
580,
1275,
28962,
29940,
14094,
2965,
29918,
19292,
7194,
29918,
5813,
29901,
13,
9651,
736,
3847,
13,
4706,
3847,
353,
3847,
29889,
3560,
8801,
580,
13,
13,
1678,
736,
7700,
13,
13,
13,
1753,
679,
3195,
29898,
8030,
1125,
13,
1678,
9995,
2577,
278,
1904,
4408,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
11109,
313,
29984,
8801,
1125,
10829,
3670,
293,
11109,
13,
13,
1678,
16969,
29901,
13,
4706,
10772,
4247,
29901,
450,
12912,
1904,
1024,
13,
1678,
9995,
13,
1678,
5222,
29918,
8030,
353,
679,
29216,
3670,
293,
8801,
29898,
8030,
29892,
4236,
29918,
1524,
29922,
29906,
29900,
29897,
13,
1678,
1904,
29918,
978,
353,
5222,
29918,
8030,
29889,
4299,
29918,
1761,
29889,
3784,
1626,
580,
13,
13,
1678,
565,
451,
26354,
29889,
3137,
29898,
4299,
29918,
978,
1125,
13,
4706,
736,
6213,
13,
13,
1678,
1018,
29901,
13,
4706,
1904,
353,
26354,
29889,
19737,
4247,
29898,
4299,
29918,
978,
29897,
13,
13,
1678,
5174,
26354,
29889,
17492,
29889,
29924,
9010,
4247,
2392,
29901,
13,
4706,
4883,
353,
9637,
1627,
29889,
4830,
29918,
735,
29883,
580,
13,
4706,
4883,
353,
376,
6028,
29915,
29873,
1284,
1904,
426,
29900,
29913,
363,
11109,
29901,
426,
29896,
1012,
29876,
29912,
29906,
29913,
1642,
4830,
29898,
13,
9651,
1904,
29918,
978,
29892,
11109,
29892,
4883,
29897,
13,
4706,
286,
479,
279,
29889,
1188,
29898,
4467,
29892,
286,
479,
279,
29889,
344,
29894,
29918,
2704,
29897,
13,
4706,
736,
6213,
13,
13,
1678,
736,
1904,
13,
13,
13,
13383,
13383,
13383,
2277,
13,
29937,
5097,
13,
13383,
13383,
13383,
2277,
13,
29937,
1275,
9166,
9166,
4936,
2751,
1360,
13,
1753,
1831,
9930,
29898,
4299,
29892,
1203,
29918,
7039,
29892,
9495,
29918,
3092,
29892,
1820,
29918,
26625,
1125,
13,
1678,
9995,
3549,
385,
1203,
13,
13,
1678,
826,
3174,
29901,
13,
4706,
1904,
313,
19737,
4247,
1125,
450,
12912,
2246,
2943,
13,
4706,
1203,
29918,
7039,
313,
1761,
1125,
450,
2983,
310,
278,
3618,
304,
1831,
13,
4706,
9495,
29918,
3092,
313,
17303,
10140,
284,
1125,
16297,
287,
9495,
2826,
7182,
13,
4706,
1820,
29918,
26625,
313,
17303,
10140,
284,
1125,
3382,
3709,
2826,
7182,
13,
13,
1678,
16969,
29901,
13,
4706,
6213,
13,
1678,
9995,
13,
1678,
565,
451,
1904,
29901,
13,
4706,
736,
13,
13,
1678,
1024,
14936,
353,
679,
23335,
29898,
4299,
29897,
13,
13,
1678,
411,
26354,
29889,
25263,
29877,
1451,
2960,
7295,
13,
4706,
7573,
353,
5159,
13,
4706,
363,
1024,
297,
1203,
29918,
7039,
29901,
13,
9651,
565,
1024,
14936,
29901,
13,
18884,
2943,
353,
679,
4247,
29898,
978,
14936,
718,
376,
6160,
718,
1024,
29897,
13,
9651,
1683,
29901,
13,
18884,
2943,
353,
679,
4247,
29898,
978,
29897,
13,
13,
9651,
565,
451,
2943,
29901,
13,
18884,
6773,
13,
13,
9651,
565,
451,
2943,
322,
1024,
14936,
29901,
13,
18884,
286,
479,
279,
29889,
1188,
703,
6028,
29915,
29873,
1284,
1203,
584,
1273,
29879,
16664,
29879,
29908,
1273,
313,
978,
14936,
29892,
1024,
511,
13,
462,
3986,
286,
479,
279,
29889,
344,
29894,
29918,
2704,
29897,
13,
9651,
25342,
451,
2943,
29901,
13,
18884,
286,
479,
279,
29889,
1188,
703,
6028,
29915,
29873,
1284,
1203,
584,
1273,
29879,
29908,
1273,
313,
978,
511,
286,
479,
279,
29889,
344,
29894,
29918,
2704,
29897,
13,
9651,
7573,
29889,
4397,
29898,
3177,
29897,
13,
13,
4706,
565,
451,
7573,
29901,
13,
9651,
736,
13,
4706,
565,
9495,
29918,
3092,
1275,
14705,
9203,
29889,
17303,
29889,
7341,
3125,
29901,
13,
9651,
19571,
29925,
852,
29898,
8824,
29892,
7573,
29897,
13,
9651,
736,
13,
4706,
565,
9495,
29918,
3092,
1275,
14705,
9203,
29889,
17303,
29889,
25411,
3125,
29901,
13,
9651,
19571,
29925,
852,
29898,
5574,
29892,
7573,
29897,
13,
9651,
736,
13,
4706,
396,
7670,
15385,
13,
4706,
565,
1820,
29918,
26625,
338,
6213,
29901,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29897,
13,
4706,
25342,
1820,
29918,
26625,
1275,
14705,
9203,
29889,
17303,
29889,
3782,
2111,
3709,
29901,
29871,
396,
1939,
7670,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29897,
13,
4706,
25342,
1820,
29918,
26625,
1275,
14705,
9203,
29889,
17303,
29889,
4809,
2111,
3709,
29901,
29871,
396,
274,
11742,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29892,
553,
15436,
29922,
5574,
29897,
13,
4706,
25342,
1820,
29918,
26625,
1275,
14705,
9203,
29889,
17303,
29889,
29657,
2111,
3709,
29901,
29871,
396,
9500,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29892,
20429,
29922,
5574,
29897,
13,
4706,
25342,
938,
29898,
1989,
29918,
26625,
29897,
1275,
313,
17303,
9203,
29889,
17303,
29889,
4809,
2111,
3709,
13,
462,
462,
259,
891,
14705,
9203,
29889,
17303,
29889,
29657,
2111,
3709,
1125,
29871,
396,
274,
11742,
718,
9500,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29892,
788,
29922,
5574,
29897,
13,
4706,
25342,
1820,
29918,
26625,
1275,
14705,
9203,
29889,
17303,
29889,
24528,
2111,
3709,
29901,
29871,
396,
5272,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29897,
13,
4706,
25342,
938,
29898,
1989,
29918,
26625,
29897,
1275,
313,
17303,
9203,
29889,
17303,
29889,
4809,
2111,
3709,
13,
462,
462,
259,
891,
14705,
9203,
29889,
17303,
29889,
24528,
2111,
3709,
1125,
29871,
396,
274,
11742,
718,
5272,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29892,
553,
15436,
29922,
5574,
29897,
13,
4706,
25342,
938,
29898,
1989,
29918,
26625,
29897,
1275,
313,
17303,
9203,
29889,
17303,
29889,
29657,
2111,
3709,
13,
462,
462,
259,
891,
14705,
9203,
29889,
17303,
29889,
24528,
2111,
3709,
1125,
29871,
396,
9500,
718,
5272,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29892,
20429,
29922,
5574,
29897,
13,
13,
9651,
396,
315,
11742,
718,
5272,
718,
9500,
13,
4706,
25342,
938,
29898,
1989,
29918,
26625,
29897,
1275,
313,
17303,
9203,
29889,
17303,
29889,
4809,
2111,
3709,
13,
462,
462,
259,
891,
14705,
9203,
29889,
17303,
29889,
24528,
2111,
3709,
13,
462,
462,
259,
891,
14705,
9203,
29889,
17303,
29889,
29657,
2111,
3709,
1125,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29892,
788,
29922,
5574,
29897,
13,
4706,
1683,
29901,
13,
9651,
26354,
29889,
2622,
29898,
18010,
29897,
13,
2
] |
firebaseClient/gpioTest.py | tabris2015/personCounter | 0 | 99758 | <gh_stars>0
from gpiozero import Button
from time import sleep
##### pin definitions
IN1 = 6
OUT1 = 13
IN2 = 19
OUT2 = 26
def in1():
print("in1!")
def out1():
print("out1!")
def in2():
print("in2!")
def out2():
print("out2!")
in1_button = Button(IN1, pull_up=False)
out1_button = Button(OUT1, pull_up=False)
in2_button = Button(IN2, pull_up=False)
out2_button = Button(OUT2, pull_up=False)
in1_button.when_pressed = in1
out1_button.when_pressed = out1
in2_button.when_pressed = in2
out2_button.when_pressed = out2
while True:
sleep(0.2)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
13,
3166,
330,
16168,
9171,
1053,
11025,
13,
3166,
931,
1053,
8709,
13,
13,
4136,
29937,
12534,
15848,
13,
13,
1177,
29896,
353,
29871,
29953,
13,
12015,
29896,
353,
29871,
29896,
29941,
13,
1177,
29906,
353,
29871,
29896,
29929,
13,
12015,
29906,
353,
29871,
29906,
29953,
13,
13,
1753,
297,
29896,
7295,
13,
1678,
1596,
703,
262,
29896,
29991,
1159,
13,
13,
1753,
714,
29896,
7295,
13,
1678,
1596,
703,
449,
29896,
29991,
1159,
13,
13,
1753,
297,
29906,
7295,
13,
1678,
1596,
703,
262,
29906,
29991,
1159,
13,
13,
1753,
714,
29906,
7295,
13,
1678,
1596,
703,
449,
29906,
29991,
1159,
13,
13,
13,
262,
29896,
29918,
3092,
353,
11025,
29898,
1177,
29896,
29892,
8206,
29918,
786,
29922,
8824,
29897,
13,
449,
29896,
29918,
3092,
353,
11025,
29898,
12015,
29896,
29892,
8206,
29918,
786,
29922,
8824,
29897,
13,
262,
29906,
29918,
3092,
353,
11025,
29898,
1177,
29906,
29892,
8206,
29918,
786,
29922,
8824,
29897,
13,
449,
29906,
29918,
3092,
353,
11025,
29898,
12015,
29906,
29892,
8206,
29918,
786,
29922,
8824,
29897,
13,
13,
13,
262,
29896,
29918,
3092,
29889,
8256,
29918,
13120,
353,
297,
29896,
13,
449,
29896,
29918,
3092,
29889,
8256,
29918,
13120,
353,
714,
29896,
13,
262,
29906,
29918,
3092,
29889,
8256,
29918,
13120,
353,
297,
29906,
13,
449,
29906,
29918,
3092,
29889,
8256,
29918,
13120,
353,
714,
29906,
13,
13,
13,
8000,
5852,
29901,
13,
1678,
8709,
29898,
29900,
29889,
29906,
29897,
13,
2
] |
mirari/TCS/migrations/0032_auto_20190308_1454.py | gcastellan0s/mirariapp | 0 | 140919 | # Generated by Django 2.0.5 on 2019-03-08 20:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('TCS', '0031_auto_20190228_1417'),
]
operations = [
migrations.AddField(
model_name='orderservice',
name='brandName',
field=models.CharField(blank=True, max_length=250),
),
migrations.AddField(
model_name='orderservice',
name='companyName',
field=models.CharField(blank=True, max_length=250),
),
migrations.AddField(
model_name='orderservice',
name='modeloName',
field=models.CharField(blank=True, max_length=250),
),
migrations.AddField(
model_name='orderservice',
name='storeName',
field=models.CharField(blank=True, max_length=250),
),
]
| [
1,
396,
3251,
630,
491,
15337,
29871,
29906,
29889,
29900,
29889,
29945,
373,
29871,
29906,
29900,
29896,
29929,
29899,
29900,
29941,
29899,
29900,
29947,
29871,
29906,
29900,
29901,
29945,
29946,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
29911,
9295,
742,
525,
29900,
29900,
29941,
29896,
29918,
6921,
29918,
29906,
29900,
29896,
29929,
29900,
29906,
29906,
29947,
29918,
29896,
29946,
29896,
29955,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
20488,
261,
1087,
742,
13,
9651,
1024,
2433,
16472,
1170,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
19465,
29922,
5574,
29892,
4236,
29918,
2848,
29922,
29906,
29945,
29900,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
20488,
261,
1087,
742,
13,
9651,
1024,
2433,
14518,
1170,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
19465,
29922,
5574,
29892,
4236,
29918,
2848,
29922,
29906,
29945,
29900,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
20488,
261,
1087,
742,
13,
9651,
1024,
2433,
4299,
29877,
1170,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
19465,
29922,
5574,
29892,
4236,
29918,
2848,
29922,
29906,
29945,
29900,
511,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
20488,
261,
1087,
742,
13,
9651,
1024,
2433,
8899,
1170,
742,
13,
9651,
1746,
29922,
9794,
29889,
27890,
29898,
19465,
29922,
5574,
29892,
4236,
29918,
2848,
29922,
29906,
29945,
29900,
511,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
chapter-6/holdings/holdings/clients.py | wallacei/microservices-in-action-copy | 115 | 66568 | import logging
import requests
from tenacity import before_log, retry, stop_after_attempt
class MarketDataClient(object):
logger = logging.getLogger(__name__)
base_url = 'http://market-data:8000'
def _make_request(self, url):
response = requests.get(
f"{self.base_url}/{url}", headers={'content-type': 'application/json'})
return response.json()
@retry(stop=stop_after_attempt(3),
before=before_log(logger, logging.DEBUG))
def all_prices(self):
return self._make_request("prices")
def price(self, code):
return self._make_request(f"prices/{code}")
| [
1,
1053,
12183,
13,
13,
5215,
7274,
13,
3166,
3006,
5946,
1053,
1434,
29918,
1188,
29892,
337,
2202,
29892,
5040,
29918,
7045,
29918,
1131,
3456,
13,
13,
13,
1990,
28794,
1469,
4032,
29898,
3318,
1125,
13,
1678,
17927,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
1678,
2967,
29918,
2271,
353,
525,
1124,
597,
28549,
29899,
1272,
29901,
29947,
29900,
29900,
29900,
29915,
13,
13,
1678,
822,
903,
5675,
29918,
3827,
29898,
1311,
29892,
3142,
1125,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
13,
9651,
285,
29908,
29912,
1311,
29889,
3188,
29918,
2271,
6822,
29912,
2271,
17671,
9066,
3790,
29915,
3051,
29899,
1853,
2396,
525,
6214,
29914,
3126,
29915,
1800,
13,
4706,
736,
2933,
29889,
3126,
580,
13,
13,
1678,
732,
276,
2202,
29898,
9847,
29922,
9847,
29918,
7045,
29918,
1131,
3456,
29898,
29941,
511,
13,
965,
1434,
29922,
11083,
29918,
1188,
29898,
21707,
29892,
12183,
29889,
18525,
876,
13,
1678,
822,
599,
29918,
558,
1575,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
5675,
29918,
3827,
703,
558,
1575,
1159,
13,
13,
1678,
822,
8666,
29898,
1311,
29892,
775,
1125,
13,
4706,
736,
1583,
3032,
5675,
29918,
3827,
29898,
29888,
29908,
558,
1575,
19248,
401,
27195,
13,
2
] |
sourcecode/Lab02_1/main.py | anhquannguyen21/Knowledge-Based | 0 | 81445 | import sys, getopt
import knowledgeBase
import sentence
def addNegativeAlphaToKb(kb, alpha):
for s in alpha:
kb.append(sentence.Sentence([-s]))
def pl_resolution(kb, alpha):
# store existed sentences hashes
hashSet = set()
# store existed sentences
base = knowledgeBase.KnowledgeBase([])
# new store new sentences created after a loop
# initialized with the given sentences and negative alpha
addNegativeAlphaToKb(kb, alpha)
newBase = knowledgeBase.KnowledgeBase(kb)
newBase.addToSet(hashSet)
# result of kb entials alpha
res = None
# loop until result is comfirmed
while res is None:
# resolve return new sentences created with
# sentences in base1 resolve sentences in base2
# and a boolean check if empty sentence exists
new, hasEmpty1 = base.resolve(newBase, hashSet)
new2, hasEmpty2 = newBase.resolve(newBase, hashSet)
# concat new sentences
new += new2
# if exist an empty sentence, result is true
if hasEmpty1 or hasEmpty2:
res = True
# if no new sentence is created, result if false
if len(new) == 0:
res = False
# push previous new sentences to knowledgebase
base.push(newBase)
# new sentences base is newly created sentences
newBase = knowledgeBase.KnowledgeBase(new)
base.push(newBase)
return res, base
def handleArgv(argv):
inputfile = ''
outputfile = ''
try:
opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
except getopt.GetoptError:
print 'main.py -i <inputfile> -o <outputfile>'
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print 'main.py -i <inputfile> -o <outputfile>'
sys.exit()
elif opt in ("-i", "--ifile"):
inputfile = arg
elif opt in ("-o", "--ofile"):
outputfile = arg
if inputfile == '' or outputfile == '':
print 'main.py -i <inputfile> -o <outputfile>'
sys.exit()
return inputfile, outputfile
def number(str):
str = str.strip()
n = ord(str[-1])
return n if len(str) == 1 else -n
def input(inputfile):
kb = []
with open(inputfile) as f:
alpha = [number(x) for x in next(f).split('OR')]
n = int(next(f))
for line in f:
clause = [number(x) for x in line.split('OR')]
kb.append(sentence.Sentence(clause))
return kb, alpha
def output(outputfile, res, base):
base.printChunksToFile(outputfile, 1)
with open(outputfile, "a") as f:
if res == True:
f.write("YES")
else:
f.write("NO")
def main(argv):
inputfile, outputfile = handleArgv(argv)
kb, alpha = input(inputfile)
res, base = pl_resolution(kb, alpha)
output(outputfile, res, base)
if __name__ == '__main__':
main(sys.argv[1:]) | [
1,
1053,
10876,
29892,
679,
3670,
13,
13,
5215,
7134,
5160,
13,
5215,
10541,
13,
13,
13,
1753,
788,
29940,
387,
1230,
28630,
1762,
29968,
29890,
29898,
21066,
29892,
15595,
1125,
13,
12,
1454,
269,
297,
15595,
29901,
13,
12,
12,
21066,
29889,
4397,
29898,
18616,
663,
29889,
29903,
296,
663,
4197,
29899,
29879,
12622,
13,
13,
13,
1753,
715,
29918,
9778,
918,
29898,
21066,
29892,
15595,
1125,
13,
12,
29937,
3787,
22856,
25260,
6608,
267,
13,
12,
8568,
2697,
353,
731,
580,
13,
12,
29937,
3787,
22856,
25260,
13,
12,
3188,
353,
7134,
5160,
29889,
29968,
3707,
5485,
5160,
4197,
2314,
13,
12,
29937,
716,
3787,
716,
25260,
2825,
1156,
263,
2425,
13,
12,
29937,
16601,
411,
278,
2183,
25260,
322,
8178,
15595,
13,
12,
1202,
29940,
387,
1230,
28630,
1762,
29968,
29890,
29898,
21066,
29892,
15595,
29897,
13,
12,
1482,
5160,
353,
7134,
5160,
29889,
29968,
3707,
5485,
5160,
29898,
21066,
29897,
13,
12,
1482,
5160,
29889,
1202,
1762,
2697,
29898,
8568,
2697,
29897,
13,
12,
29937,
1121,
310,
413,
29890,
875,
616,
29879,
15595,
13,
12,
690,
353,
6213,
13,
12,
29937,
2425,
2745,
1121,
338,
419,
28034,
2168,
13,
12,
8000,
620,
338,
6213,
29901,
13,
12,
12,
29937,
8814,
736,
716,
25260,
2825,
411,
13,
12,
12,
29937,
25260,
297,
2967,
29896,
8814,
25260,
297,
2967,
29906,
13,
12,
12,
29937,
322,
263,
7223,
1423,
565,
4069,
10541,
4864,
13,
12,
12,
1482,
29892,
756,
8915,
29896,
353,
2967,
29889,
17863,
29898,
1482,
5160,
29892,
6608,
2697,
29897,
13,
12,
12,
1482,
29906,
29892,
756,
8915,
29906,
353,
716,
5160,
29889,
17863,
29898,
1482,
5160,
29892,
6608,
2697,
29897,
13,
12,
12,
29937,
3022,
271,
716,
25260,
13,
12,
12,
1482,
4619,
716,
29906,
13,
12,
12,
29937,
565,
1863,
385,
4069,
10541,
29892,
1121,
338,
1565,
13,
12,
12,
361,
756,
8915,
29896,
470,
756,
8915,
29906,
29901,
13,
12,
12,
12,
690,
353,
5852,
13,
12,
12,
29937,
565,
694,
716,
10541,
338,
2825,
29892,
1121,
565,
2089,
13,
12,
12,
361,
7431,
29898,
1482,
29897,
1275,
29871,
29900,
29901,
13,
12,
12,
12,
690,
353,
7700,
13,
12,
12,
29937,
5503,
3517,
716,
25260,
304,
7134,
3188,
13,
12,
12,
3188,
29889,
5910,
29898,
1482,
5160,
29897,
13,
12,
12,
29937,
716,
25260,
2967,
338,
15141,
2825,
25260,
13,
12,
12,
1482,
5160,
353,
7134,
5160,
29889,
29968,
3707,
5485,
5160,
29898,
1482,
29897,
13,
13,
12,
3188,
29889,
5910,
29898,
1482,
5160,
29897,
13,
12,
2457,
620,
29892,
2967,
13,
13,
13,
1753,
4386,
8559,
29894,
29898,
19218,
1125,
13,
12,
2080,
1445,
353,
6629,
13,
1678,
12,
4905,
1445,
353,
6629,
13,
1678,
12,
13,
1678,
12,
2202,
29901,
13,
12,
259,
12,
25707,
29892,
6389,
353,
679,
3670,
29889,
657,
3670,
29898,
19218,
1699,
2918,
29901,
29877,
29901,
613,
3366,
361,
488,
543,
1699,
974,
488,
543,
2314,
13,
1678,
12,
19499,
679,
3670,
29889,
2577,
3670,
2392,
29901,
13,
12,
12,
2158,
525,
3396,
29889,
2272,
448,
29875,
529,
2080,
1445,
29958,
448,
29877,
529,
4905,
1445,
16299,
13,
12,
12,
9675,
29889,
13322,
29898,
29906,
29897,
13,
1678,
12,
1454,
3523,
29892,
1852,
297,
29111,
29901,
13,
12,
12,
361,
3523,
1275,
17411,
29882,
2396,
13,
12,
12,
12,
2158,
525,
3396,
29889,
2272,
448,
29875,
529,
2080,
1445,
29958,
448,
29877,
529,
4905,
1445,
16299,
13,
12,
12,
12,
9675,
29889,
13322,
580,
13,
12,
12,
23681,
3523,
297,
4852,
29899,
29875,
613,
376,
489,
361,
488,
29908,
1125,
13,
12,
12,
12,
2080,
1445,
353,
1852,
13,
12,
12,
23681,
3523,
297,
4852,
29899,
29877,
613,
376,
489,
974,
488,
29908,
1125,
13,
12,
12,
12,
4905,
1445,
353,
1852,
13,
13,
12,
361,
1881,
1445,
1275,
6629,
470,
1962,
1445,
1275,
525,
2396,
13,
12,
12,
2158,
525,
3396,
29889,
2272,
448,
29875,
529,
2080,
1445,
29958,
448,
29877,
529,
4905,
1445,
16299,
13,
12,
12,
9675,
29889,
13322,
580,
13,
13,
12,
2457,
1881,
1445,
29892,
1962,
1445,
13,
13,
13,
1753,
1353,
29898,
710,
1125,
13,
12,
710,
353,
851,
29889,
17010,
580,
13,
12,
29876,
353,
4356,
29898,
710,
14352,
29896,
2314,
13,
12,
2457,
302,
565,
7431,
29898,
710,
29897,
1275,
29871,
29896,
1683,
448,
29876,
13,
13,
13,
1753,
1881,
29898,
2080,
1445,
1125,
13,
12,
21066,
353,
5159,
13,
12,
2541,
1722,
29898,
2080,
1445,
29897,
408,
285,
29901,
13,
12,
12,
2312,
353,
518,
4537,
29898,
29916,
29897,
363,
921,
297,
2446,
29898,
29888,
467,
5451,
877,
1955,
1495,
29962,
13,
12,
12,
29876,
353,
938,
29898,
4622,
29898,
29888,
876,
13,
12,
12,
1454,
1196,
297,
285,
29901,
13,
12,
12,
12,
16398,
1509,
353,
518,
4537,
29898,
29916,
29897,
363,
921,
297,
1196,
29889,
5451,
877,
1955,
1495,
29962,
13,
12,
12,
12,
21066,
29889,
4397,
29898,
18616,
663,
29889,
29903,
296,
663,
29898,
16398,
1509,
876,
13,
12,
2457,
413,
29890,
29892,
15595,
13,
13,
13,
1753,
1962,
29898,
4905,
1445,
29892,
620,
29892,
2967,
1125,
13,
12,
3188,
29889,
2158,
1451,
18801,
1762,
2283,
29898,
4905,
1445,
29892,
29871,
29896,
29897,
13,
13,
12,
2541,
1722,
29898,
4905,
1445,
29892,
376,
29874,
1159,
408,
285,
29901,
13,
12,
12,
361,
620,
1275,
5852,
29901,
13,
12,
12,
12,
29888,
29889,
3539,
703,
21143,
1159,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
29888,
29889,
3539,
703,
6632,
1159,
13,
13,
13,
1753,
1667,
29898,
19218,
1125,
13,
12,
2080,
1445,
29892,
1962,
1445,
353,
4386,
8559,
29894,
29898,
19218,
29897,
13,
12,
13,
12,
21066,
29892,
15595,
353,
1881,
29898,
2080,
1445,
29897,
13,
12,
13,
12,
690,
29892,
2967,
353,
715,
29918,
9778,
918,
29898,
21066,
29892,
15595,
29897,
13,
13,
12,
4905,
29898,
4905,
1445,
29892,
620,
29892,
2967,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
12,
3396,
29898,
9675,
29889,
19218,
29961,
29896,
29901,
2314,
2
] |
palor/tests.py | Kizito-Alberrt/gallery-palor | 0 | 122869 | <reponame>Kizito-Alberrt/gallery-palor<filename>palor/tests.py
from django.forms.fields import ImageField
from django.test import TestCase
from .models import Editor, Article,tags
# Create your tests here.
class imageTestClass(TestCase):
def setUp(self):
self.gallery= ImageField(first_name = 'James', last_name ='Muriuki', email ='<EMAIL>')
| [
1,
529,
276,
1112,
420,
29958,
29968,
466,
2049,
29899,
2499,
495,
2273,
29914,
29887,
23365,
29899,
7830,
272,
29966,
9507,
29958,
7830,
272,
29914,
21150,
29889,
2272,
13,
3166,
9557,
29889,
9514,
29889,
9621,
1053,
7084,
3073,
13,
3166,
9557,
29889,
1688,
1053,
4321,
8259,
13,
3166,
869,
9794,
1053,
14059,
29892,
21746,
29892,
11338,
29871,
13,
13,
29937,
6204,
596,
6987,
1244,
29889,
13,
1990,
1967,
3057,
2385,
29898,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29887,
23365,
29922,
7084,
3073,
29898,
4102,
29918,
978,
353,
525,
29470,
742,
1833,
29918,
978,
353,
29915,
29924,
5338,
19267,
742,
4876,
353,
29915,
29966,
26862,
6227,
29958,
1495,
13,
2
] |
tests/test_kafka_integration.py | W1ckedS1ck/website-metric-producer | 0 | 69486 | import unittest
from tests import app_factory
from config import integration_mode
from datetime import datetime, timezone
class MyKafkaConsumerTest(unittest.TestCase):
my_kafka_p = None
my_kafka_c = None
def setUp(self):
if integration_mode is False:
self.assertTrue(True)
return
self.assertTrue(self.my_kafka_p is None)
self.my_kafka_p = app_factory.build_kafka_producer(True)
# Make sure app is passed in correctly and has correct type
self.assertTrue(self.my_kafka_p is not None)
self.assertTrue(self.my_kafka_c is None)
self.my_kafka_c = app_factory.build_kafka_consumer(True)
# Make sure app is passed in correctly and has correct type
self.assertTrue(self.my_kafka_c is not None)
def tearDown(self):
if integration_mode is False:
self.assertTrue(True)
return
# Make sure app is passed in correctly and has correct type
self.assertTrue(self.my_kafka_p is not None)
self.assertTrue(self.my_kafka_c is not None)
def test_instance_type(self):
if integration_mode is False:
self.assertTrue(True)
return
self.assertTrue(isinstance(self.my_kafka_p, app_factory.MyKafkaProducer))
self.assertTrue(isinstance(self.my_kafka_c, app_factory.MyKafkaConsumer))
def test_ping_pong(self):
if integration_mode is False:
self.assertTrue(True)
return
messages = [[1, datetime.now(timezone.utc).__str__(), 200, 23.23, True]]
self.my_kafka_p.send_measurements(messages)
isSuccessful, measurement_results = self.my_kafka_c.receive_messages()
self.assertTrue(isSuccessful)
self.assertEqual(messages, measurement_results)
if __name__ == '__main__':
unittest.main()
| [
1,
1053,
443,
27958,
13,
3166,
6987,
1053,
623,
29918,
14399,
13,
3166,
2295,
1053,
13465,
29918,
8513,
13,
3166,
12865,
1053,
12865,
29892,
29431,
13,
13,
13,
1990,
1619,
29968,
20817,
13696,
4680,
3057,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
590,
29918,
28510,
29918,
29886,
353,
6213,
13,
1678,
590,
29918,
28510,
29918,
29883,
353,
6213,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
565,
13465,
29918,
8513,
338,
7700,
29901,
13,
9651,
1583,
29889,
9294,
5574,
29898,
5574,
29897,
13,
9651,
736,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
1357,
29918,
28510,
29918,
29886,
338,
6213,
29897,
13,
4706,
1583,
29889,
1357,
29918,
28510,
29918,
29886,
353,
623,
29918,
14399,
29889,
4282,
29918,
28510,
29918,
5498,
2265,
29898,
5574,
29897,
13,
4706,
396,
8561,
1854,
623,
338,
4502,
297,
5149,
322,
756,
1959,
1134,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
1357,
29918,
28510,
29918,
29886,
338,
451,
6213,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
1357,
29918,
28510,
29918,
29883,
338,
6213,
29897,
13,
4706,
1583,
29889,
1357,
29918,
28510,
29918,
29883,
353,
623,
29918,
14399,
29889,
4282,
29918,
28510,
29918,
25978,
261,
29898,
5574,
29897,
13,
4706,
396,
8561,
1854,
623,
338,
4502,
297,
5149,
322,
756,
1959,
1134,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
1357,
29918,
28510,
29918,
29883,
338,
451,
6213,
29897,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
565,
13465,
29918,
8513,
338,
7700,
29901,
13,
9651,
1583,
29889,
9294,
5574,
29898,
5574,
29897,
13,
9651,
736,
13,
4706,
396,
8561,
1854,
623,
338,
4502,
297,
5149,
322,
756,
1959,
1134,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
1357,
29918,
28510,
29918,
29886,
338,
451,
6213,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
1357,
29918,
28510,
29918,
29883,
338,
451,
6213,
29897,
13,
13,
1678,
822,
1243,
29918,
8758,
29918,
1853,
29898,
1311,
1125,
13,
4706,
565,
13465,
29918,
8513,
338,
7700,
29901,
13,
9651,
1583,
29889,
9294,
5574,
29898,
5574,
29897,
13,
9651,
736,
13,
4706,
1583,
29889,
9294,
5574,
29898,
275,
8758,
29898,
1311,
29889,
1357,
29918,
28510,
29918,
29886,
29892,
623,
29918,
14399,
29889,
3421,
29968,
20817,
23665,
2265,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
275,
8758,
29898,
1311,
29889,
1357,
29918,
28510,
29918,
29883,
29892,
623,
29918,
14399,
29889,
3421,
29968,
20817,
13696,
4680,
876,
13,
13,
1678,
822,
1243,
29918,
15702,
29918,
29886,
549,
29898,
1311,
1125,
13,
4706,
565,
13465,
29918,
8513,
338,
7700,
29901,
13,
9651,
1583,
29889,
9294,
5574,
29898,
5574,
29897,
13,
9651,
736,
13,
4706,
7191,
353,
5519,
29896,
29892,
12865,
29889,
3707,
29898,
2230,
8028,
29889,
329,
29883,
467,
1649,
710,
1649,
3285,
29871,
29906,
29900,
29900,
29892,
29871,
29906,
29941,
29889,
29906,
29941,
29892,
5852,
5262,
13,
4706,
1583,
29889,
1357,
29918,
28510,
29918,
29886,
29889,
6717,
29918,
26658,
1860,
29898,
19158,
29897,
13,
4706,
338,
14191,
1319,
29892,
20039,
29918,
9902,
353,
1583,
29889,
1357,
29918,
28510,
29918,
29883,
29889,
13556,
573,
29918,
19158,
580,
13,
4706,
1583,
29889,
9294,
5574,
29898,
275,
14191,
1319,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
19158,
29892,
20039,
29918,
9902,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
googledataprocauthenticator/tests/test_dataprocmagic.py | mollypi/dataprocmagic | 2 | 36665 | <filename>googledataprocauthenticator/tests/test_dataprocmagic.py
# Copyright 2020 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
#
# https://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.
"""Tests the `%manage_dataproc` and `%spark` magics"""
from mock import patch, MagicMock, PropertyMock
from nose.tools import raises, assert_equals, with_setup
from google.oauth2 import credentials
import googledataprocauthenticator
from googledataprocauthenticator.google import GoogleAuth
from googledataprocauthenticator.magics.dataprocmagics import DataprocMagics
from sparkmagic.livyclientlib.endpoint import Endpoint
from sparkmagic.livyclientlib.livysession import LivySession
from sparkmagic.livyclientlib.exceptions import BadUserConfigurationException
from sparkmagic.utils.utils import parse_argstring_or_throw, initialize_auth
from sparkmagic.utils.constants import SESSION_KIND_SPARK
magic = None
spark_controller = None
shell = None
ipython_display = None
def _setup():
with patch('googledataprocauthenticator.magics.dataprocmagics.DataprocMagics.self.db', new_callable=PropertyMock,
return_value=mocked_db):
global magic, spark_controller, shell, ipython_display
magic = DataprocMagics(shell=None, widget=MagicMock())
magic.shell = shell = MagicMock()
magic.ipython_display = ipython_display = MagicMock()
magic.spark_controller = spark_controller = MagicMock()
def _teardown():
pass
stored_endpoints = ("http://url.com", Endpoint("http://url.com", "default-credentials"))
get_session_id_to_name = {1234: 'my_session'}
sessions_mock = {'my_session': LivySession(http_client=MagicMock(), properties={"kind":SESSION_KIND_SPARK, \
"heartbeatTimeoutInSecond": 60}, ipython_display=ipython_display, session_id=1234)}
sessions_list_mock = [LivySession(http_client=MagicMock(), properties={"kind":SESSION_KIND_SPARK,\
"heartbeatTimeoutInSecond": 60}, ipython_display=ipython_display, session_id=1234)]
mocked_db = {'autorestore/stored_endpoints': stored_endpoints, 'autorestore/get_session_id_to_name': get_session_id_to_name,}
def make_credentials():
return credentials.Credentials(
token=None,
refresh_token='refresh',
token_uri='token_uri',
client_id='client_id',
client_secret='client_secret',
)
creds = make_credentials()
mock_credentialed_accounts_valid_accounts = ({'<EMAIL>'}, '<EMAIL>')
AUTH_DESCRIBE_USER = '{"client_id": "client_id", \
"client_secret": "secret", "refresh_token": "refresh","type": "authorized_user"}'
@with_setup(_setup, _teardown)
def test_session_command_parses():
print_info_mock = MagicMock()
magic._print_local_info = print_info_mock
command = "session"
magic.spark(command)
print_info_mock.assert_called_once_with()
@with_setup(_setup, _teardown)
def test_session_endpoint_command_parses():
print_info_mock = MagicMock()
magic._print_endpoint_info = print_info_mock
command = "session -u http://url.com -i 1234"
spark_controller.get_all_sessions_endpoint_info = MagicMock(return_value=None)
magic.spark(command)
print_info_mock.assert_called_once_with(None, 1234)
@with_setup(_setup, _teardown)
def test_add_sessions_command_parses_google_default_credentials():
with patch('google.auth.default', return_value=(creds, 'project'), \
autospec=True):
add_sessions_mock = MagicMock()
spark_controller.add_session = add_sessions_mock
command = "add"
name = "-s name"
language = "-l python"
account = "-g default-credentials"
connection_string = "-u http://url.com -t Google"
line = " ".join([command, name, language, connection_string, account])
magic.spark(line)
args = parse_argstring_or_throw(DataprocMagics.spark, line)
auth_instance = initialize_auth(args)
add_sessions_mock.assert_called_once_with("name", Endpoint("http://url.com", initialize_auth(args)),
False, {"kind": "pyspark"})
assert_equals(auth_instance.url, "http://url.com")
isinstance(auth_instance, GoogleAuth)
assert_equals(auth_instance.active_credentials, 'default-credentials')
@with_setup(_setup, _teardown)
def test_add_sessions_command_parses_google_user_credentials():
with patch('sparkmagic.auth.google.list_credentialed_user_accounts', \
return_value=mock_credentialed_accounts_valid_accounts), patch('subprocess.check_output',\
return_value=AUTH_DESCRIBE_USER):
add_sessions_mock = MagicMock()
spark_controller.add_session = add_sessions_mock
command = "add"
name = "-s name"
language = "-l python"
account = "-g <EMAIL>"
connection_string = "-u http://url.com -t Google"
line = " ".join([command, name, language, connection_string, account])
magic.spark(line)
args = parse_argstring_or_throw(DataprocMagics.spark, line)
auth_instance = initialize_auth(args)
add_sessions_mock.assert_called_once_with("name", Endpoint("http://url.com", initialize_auth(args)),
False, {"kind": "pyspark"})
assert_equals(auth_instance.url, "http://url.com")
isinstance(auth_instance, GoogleAuth)
assert_equals(auth_instance.active_credentials, '<EMAIL>')
@with_setup(_setup, _teardown)
def test_add_sessions_command_parses_session_already_exists():
spark_controller.get_all_sessions_endpoint = MagicMock(return_value=sessions_list_mock)
get_managed_clients_mock = MagicMock(return_value=sessions_mock)
spark_controller.get_managed_clients = get_managed_clients_mock
add_sessions_mock = MagicMock()
spark_controller.session_manager.add_session = add_sessions_mock
command = "add"
name = "-s my_session"
language = "-l python"
connection_string = "-u http://url.com -t {} -g <EMAIL>".format('Google')
line = " ".join([command, name, language, connection_string])
magic.spark(line)
assert_equals(magic.db['autorestore/stored_endpoints'], stored_endpoints)
assert_equals(magic.db['autorestore/get_session_id_to_name'], get_session_id_to_name)
add_sessions_mock.assert_not_called()
@raises(BadUserConfigurationException)
@with_setup(_setup, _teardown)
def test_add_sessions_command_raises_google_no_account():
with patch('google.auth.default', return_value=(creds, 'project'), \
autospec=True):
add_sessions_mock = MagicMock()
spark_controller.add_session = add_sessions_mock
command = "add"
name = "-s name"
language = "-l python"
connection_string = "-u http://url.com -t Google"
line = " ".join([command, name, language, connection_string])
magic.spark(line)
args = parse_argstring_or_throw(DataprocMagics.spark, line)
initialize_auth(args)
@with_setup(_setup, _teardown)
def test_restore_endpoints():
with patch('google.auth.default', return_value=(creds, 'project'),\
autospec=True):
assert_equals(magic.endpoints, stored_endpoints)
@with_setup(_setup, _teardown)
def test_restore_sessions():
with patch('google.auth.default', return_value=(creds, 'project'),\
autospec=True):
spark_controller.get_all_sessions_endpoint = MagicMock(return_value=sessions_list_mock)
spark_controller.get_managed_clients = []
add_sessions_mock = MagicMock()
spark_controller.session_manager.add_session = add_sessions_mock
add_sessions_mock.assert_called_once_with("my_session", LivySession(http_client=MagicMock(),\
properties={"kind":SESSION_KIND_SPARK, "heartbeatTimeoutInSecond": 60}, ipython_display=ipython_display, session_id=12345))
assert_equals(spark_controller, stored_endpoints)
| [
1,
529,
9507,
29958,
1484,
468,
839,
271,
481,
307,
1113,
2806,
4173,
1061,
29914,
21150,
29914,
1688,
29918,
4130,
481,
307,
4912,
351,
293,
29889,
2272,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29900,
5087,
365,
12182,
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,
2045,
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,
13,
15945,
29908,
24376,
278,
22570,
1171,
482,
29918,
4130,
481,
10198,
29952,
322,
22570,
12597,
29952,
2320,
1199,
15945,
29908,
13,
13,
13,
3166,
11187,
1053,
13261,
29892,
26494,
18680,
29892,
9079,
18680,
13,
3166,
26414,
29889,
8504,
1053,
1153,
4637,
29892,
4974,
29918,
10954,
29892,
411,
29918,
14669,
13,
3166,
5386,
29889,
23106,
29906,
1053,
16140,
13,
5215,
27304,
839,
271,
481,
307,
1113,
2806,
4173,
1061,
13,
3166,
27304,
839,
271,
481,
307,
1113,
2806,
4173,
1061,
29889,
3608,
1053,
5087,
6444,
13,
3166,
27304,
839,
271,
481,
307,
1113,
2806,
4173,
1061,
29889,
11082,
1199,
29889,
4130,
481,
307,
4912,
351,
1199,
1053,
13373,
481,
10198,
19095,
1199,
13,
3166,
16267,
11082,
293,
29889,
17843,
29891,
4645,
1982,
29889,
29734,
1053,
2796,
3149,
13,
3166,
16267,
11082,
293,
29889,
17843,
29891,
4645,
1982,
29889,
17843,
952,
1211,
1053,
16238,
29891,
7317,
13,
3166,
16267,
11082,
293,
29889,
17843,
29891,
4645,
1982,
29889,
11739,
29879,
1053,
9178,
2659,
8614,
2451,
13,
3166,
16267,
11082,
293,
29889,
13239,
29889,
13239,
1053,
6088,
29918,
1191,
1807,
29918,
272,
29918,
20539,
29892,
11905,
29918,
5150,
13,
3166,
16267,
11082,
293,
29889,
13239,
29889,
3075,
1934,
1053,
3725,
13507,
29918,
29968,
22255,
29918,
5550,
1718,
29968,
13,
13,
13,
13,
11082,
293,
353,
6213,
13,
12597,
29918,
8299,
353,
6213,
13,
15903,
353,
6213,
13,
666,
1656,
29918,
4990,
353,
6213,
13,
13,
13,
1753,
903,
14669,
7295,
13,
1678,
411,
13261,
877,
1484,
468,
839,
271,
481,
307,
1113,
2806,
4173,
1061,
29889,
11082,
1199,
29889,
4130,
481,
307,
4912,
351,
1199,
29889,
16390,
481,
10198,
19095,
1199,
29889,
1311,
29889,
2585,
742,
716,
29918,
4804,
519,
29922,
4854,
18680,
29892,
13,
965,
736,
29918,
1767,
29922,
17640,
287,
29918,
2585,
1125,
13,
4706,
5534,
15709,
29892,
16267,
29918,
8299,
29892,
6473,
29892,
474,
4691,
29918,
4990,
13,
4706,
15709,
353,
13373,
481,
10198,
19095,
1199,
29898,
15903,
29922,
8516,
29892,
11109,
29922,
19095,
293,
18680,
3101,
13,
4706,
15709,
29889,
15903,
353,
6473,
353,
26494,
18680,
580,
13,
4706,
15709,
29889,
666,
1656,
29918,
4990,
353,
474,
4691,
29918,
4990,
353,
26494,
18680,
580,
13,
4706,
15709,
29889,
12597,
29918,
8299,
353,
16267,
29918,
8299,
353,
26494,
18680,
580,
13,
13,
1753,
903,
371,
538,
776,
7295,
13,
1678,
1209,
13,
13,
303,
4395,
29918,
355,
9748,
353,
4852,
1124,
597,
2271,
29889,
510,
613,
2796,
3149,
703,
1124,
597,
2271,
29889,
510,
613,
376,
4381,
29899,
11944,
9409,
5783,
13,
657,
29918,
7924,
29918,
333,
29918,
517,
29918,
978,
353,
426,
29896,
29906,
29941,
29946,
29901,
525,
1357,
29918,
7924,
10827,
13,
29879,
10964,
29918,
17640,
353,
11117,
1357,
29918,
7924,
2396,
16238,
29891,
7317,
29898,
1124,
29918,
4645,
29922,
19095,
293,
18680,
3285,
4426,
3790,
29908,
14380,
1115,
17493,
29918,
29968,
22255,
29918,
5550,
1718,
29968,
29892,
320,
13,
1678,
376,
23057,
915,
271,
10851,
797,
11863,
1115,
29871,
29953,
29900,
1118,
474,
4691,
29918,
4990,
29922,
666,
1656,
29918,
4990,
29892,
4867,
29918,
333,
29922,
29896,
29906,
29941,
29946,
2915,
13,
29879,
10964,
29918,
1761,
29918,
17640,
353,
518,
29931,
440,
29891,
7317,
29898,
1124,
29918,
4645,
29922,
19095,
293,
18680,
3285,
4426,
3790,
29908,
14380,
1115,
17493,
29918,
29968,
22255,
29918,
5550,
1718,
29968,
2053,
13,
1678,
376,
23057,
915,
271,
10851,
797,
11863,
1115,
29871,
29953,
29900,
1118,
474,
4691,
29918,
4990,
29922,
666,
1656,
29918,
4990,
29892,
4867,
29918,
333,
29922,
29896,
29906,
29941,
29946,
4638,
13,
17640,
287,
29918,
2585,
353,
11117,
8309,
22818,
29914,
303,
4395,
29918,
355,
9748,
2396,
6087,
29918,
355,
9748,
29892,
525,
8309,
22818,
29914,
657,
29918,
7924,
29918,
333,
29918,
517,
29918,
978,
2396,
679,
29918,
7924,
29918,
333,
29918,
517,
29918,
978,
29892,
29913,
13,
13,
1753,
1207,
29918,
11944,
9409,
7295,
13,
1678,
736,
16140,
29889,
28037,
29898,
13,
4706,
5993,
29922,
8516,
29892,
13,
4706,
11086,
29918,
6979,
2433,
22379,
742,
13,
4706,
5993,
29918,
5338,
2433,
6979,
29918,
5338,
742,
13,
4706,
3132,
29918,
333,
2433,
4645,
29918,
333,
742,
13,
4706,
3132,
29918,
19024,
2433,
4645,
29918,
19024,
742,
13,
1678,
1723,
13,
13,
1037,
6289,
353,
1207,
29918,
11944,
9409,
580,
13,
17640,
29918,
11944,
296,
423,
839,
29918,
10149,
29879,
29918,
3084,
29918,
10149,
29879,
353,
313,
10998,
29966,
26862,
6227,
16299,
1118,
12801,
26862,
6227,
29958,
1495,
13,
20656,
29950,
29918,
2287,
7187,
3960,
15349,
29918,
11889,
353,
525,
6377,
4645,
29918,
333,
1115,
376,
4645,
29918,
333,
613,
320,
13,
268,
376,
4645,
29918,
19024,
1115,
376,
19024,
613,
376,
22379,
29918,
6979,
1115,
376,
22379,
3284,
1853,
1115,
376,
8921,
1891,
29918,
1792,
9092,
29915,
13,
13,
29992,
2541,
29918,
14669,
7373,
14669,
29892,
903,
371,
538,
776,
29897,
13,
1753,
1243,
29918,
7924,
29918,
6519,
29918,
862,
29879,
267,
7295,
13,
1678,
1596,
29918,
3888,
29918,
17640,
353,
26494,
18680,
580,
13,
1678,
15709,
3032,
2158,
29918,
2997,
29918,
3888,
353,
1596,
29918,
3888,
29918,
17640,
13,
1678,
1899,
353,
376,
7924,
29908,
13,
1678,
15709,
29889,
12597,
29898,
6519,
29897,
13,
1678,
1596,
29918,
3888,
29918,
17640,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
580,
13,
13,
29992,
2541,
29918,
14669,
7373,
14669,
29892,
903,
371,
538,
776,
29897,
13,
1753,
1243,
29918,
7924,
29918,
29734,
29918,
6519,
29918,
862,
29879,
267,
7295,
13,
1678,
1596,
29918,
3888,
29918,
17640,
353,
26494,
18680,
580,
13,
1678,
15709,
3032,
2158,
29918,
29734,
29918,
3888,
353,
1596,
29918,
3888,
29918,
17640,
13,
1678,
1899,
353,
376,
7924,
448,
29884,
1732,
597,
2271,
29889,
510,
448,
29875,
29871,
29896,
29906,
29941,
29946,
29908,
13,
1678,
16267,
29918,
8299,
29889,
657,
29918,
497,
29918,
29879,
10964,
29918,
29734,
29918,
3888,
353,
26494,
18680,
29898,
2457,
29918,
1767,
29922,
8516,
29897,
13,
1678,
15709,
29889,
12597,
29898,
6519,
29897,
13,
1678,
1596,
29918,
3888,
29918,
17640,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
8516,
29892,
29871,
29896,
29906,
29941,
29946,
29897,
13,
13,
29992,
2541,
29918,
14669,
7373,
14669,
29892,
903,
371,
538,
776,
29897,
13,
1753,
1243,
29918,
1202,
29918,
29879,
10964,
29918,
6519,
29918,
862,
29879,
267,
29918,
3608,
29918,
4381,
29918,
11944,
9409,
7295,
13,
1678,
411,
13261,
877,
3608,
29889,
5150,
29889,
4381,
742,
736,
29918,
1767,
7607,
1037,
6289,
29892,
525,
4836,
5477,
320,
13,
1678,
1120,
359,
3135,
29922,
5574,
1125,
13,
4706,
788,
29918,
29879,
10964,
29918,
17640,
353,
26494,
18680,
580,
13,
4706,
16267,
29918,
8299,
29889,
1202,
29918,
7924,
353,
788,
29918,
29879,
10964,
29918,
17640,
13,
4706,
1899,
353,
376,
1202,
29908,
13,
4706,
1024,
353,
11663,
29879,
1024,
29908,
13,
4706,
4086,
353,
11663,
29880,
3017,
29908,
13,
4706,
3633,
353,
11663,
29887,
2322,
29899,
11944,
9409,
29908,
13,
4706,
3957,
29918,
1807,
353,
11663,
29884,
1732,
597,
2271,
29889,
510,
448,
29873,
5087,
29908,
13,
4706,
1196,
353,
376,
11393,
7122,
4197,
6519,
29892,
1024,
29892,
4086,
29892,
3957,
29918,
1807,
29892,
3633,
2314,
13,
4706,
15709,
29889,
12597,
29898,
1220,
29897,
13,
4706,
6389,
353,
6088,
29918,
1191,
1807,
29918,
272,
29918,
20539,
29898,
16390,
481,
10198,
19095,
1199,
29889,
12597,
29892,
1196,
29897,
13,
4706,
4817,
29918,
8758,
353,
11905,
29918,
5150,
29898,
5085,
29897,
13,
4706,
788,
29918,
29879,
10964,
29918,
17640,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
703,
978,
613,
2796,
3149,
703,
1124,
597,
2271,
29889,
510,
613,
11905,
29918,
5150,
29898,
5085,
8243,
13,
462,
462,
462,
29871,
7700,
29892,
8853,
14380,
1115,
376,
29886,
952,
6378,
29908,
1800,
13,
4706,
4974,
29918,
10954,
29898,
5150,
29918,
8758,
29889,
2271,
29892,
376,
1124,
597,
2271,
29889,
510,
1159,
13,
4706,
338,
8758,
29898,
5150,
29918,
8758,
29892,
5087,
6444,
29897,
13,
4706,
4974,
29918,
10954,
29898,
5150,
29918,
8758,
29889,
4925,
29918,
11944,
9409,
29892,
525,
4381,
29899,
11944,
9409,
1495,
13,
13,
29992,
2541,
29918,
14669,
7373,
14669,
29892,
903,
371,
538,
776,
29897,
13,
1753,
1243,
29918,
1202,
29918,
29879,
10964,
29918,
6519,
29918,
862,
29879,
267,
29918,
3608,
29918,
1792,
29918,
11944,
9409,
7295,
13,
1678,
411,
13261,
877,
12597,
11082,
293,
29889,
5150,
29889,
3608,
29889,
1761,
29918,
11944,
296,
423,
839,
29918,
1792,
29918,
10149,
29879,
742,
320,
13,
1678,
736,
29918,
1767,
29922,
17640,
29918,
11944,
296,
423,
839,
29918,
10149,
29879,
29918,
3084,
29918,
10149,
29879,
511,
13261,
877,
1491,
5014,
29889,
3198,
29918,
4905,
742,
29905,
13,
1678,
736,
29918,
1767,
29922,
20656,
29950,
29918,
2287,
7187,
3960,
15349,
29918,
11889,
1125,
13,
4706,
788,
29918,
29879,
10964,
29918,
17640,
353,
26494,
18680,
580,
13,
4706,
16267,
29918,
8299,
29889,
1202,
29918,
7924,
353,
788,
29918,
29879,
10964,
29918,
17640,
13,
4706,
1899,
353,
376,
1202,
29908,
13,
4706,
1024,
353,
11663,
29879,
1024,
29908,
13,
4706,
4086,
353,
11663,
29880,
3017,
29908,
13,
4706,
3633,
353,
11663,
29887,
529,
26862,
6227,
11903,
13,
4706,
3957,
29918,
1807,
353,
11663,
29884,
1732,
597,
2271,
29889,
510,
448,
29873,
5087,
29908,
13,
4706,
1196,
353,
376,
11393,
7122,
4197,
6519,
29892,
1024,
29892,
4086,
29892,
3957,
29918,
1807,
29892,
3633,
2314,
13,
4706,
15709,
29889,
12597,
29898,
1220,
29897,
13,
4706,
6389,
353,
6088,
29918,
1191,
1807,
29918,
272,
29918,
20539,
29898,
16390,
481,
10198,
19095,
1199,
29889,
12597,
29892,
1196,
29897,
13,
4706,
4817,
29918,
8758,
353,
11905,
29918,
5150,
29898,
5085,
29897,
13,
4706,
788,
29918,
29879,
10964,
29918,
17640,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
703,
978,
613,
2796,
3149,
703,
1124,
597,
2271,
29889,
510,
613,
11905,
29918,
5150,
29898,
5085,
8243,
13,
462,
462,
462,
29871,
7700,
29892,
8853,
14380,
1115,
376,
29886,
952,
6378,
29908,
1800,
13,
4706,
4974,
29918,
10954,
29898,
5150,
29918,
8758,
29889,
2271,
29892,
376,
1124,
597,
2271,
29889,
510,
1159,
13,
4706,
338,
8758,
29898,
5150,
29918,
8758,
29892,
5087,
6444,
29897,
13,
4706,
4974,
29918,
10954,
29898,
5150,
29918,
8758,
29889,
4925,
29918,
11944,
9409,
29892,
12801,
26862,
6227,
29958,
1495,
13,
13,
29992,
2541,
29918,
14669,
7373,
14669,
29892,
903,
371,
538,
776,
29897,
13,
1753,
1243,
29918,
1202,
29918,
29879,
10964,
29918,
6519,
29918,
862,
29879,
267,
29918,
7924,
29918,
284,
2040,
29918,
9933,
7295,
13,
1678,
16267,
29918,
8299,
29889,
657,
29918,
497,
29918,
29879,
10964,
29918,
29734,
353,
26494,
18680,
29898,
2457,
29918,
1767,
29922,
29879,
10964,
29918,
1761,
29918,
17640,
29897,
13,
1678,
679,
29918,
25240,
29918,
11303,
1237,
29918,
17640,
353,
26494,
18680,
29898,
2457,
29918,
1767,
29922,
29879,
10964,
29918,
17640,
29897,
13,
1678,
16267,
29918,
8299,
29889,
657,
29918,
25240,
29918,
11303,
1237,
353,
679,
29918,
25240,
29918,
11303,
1237,
29918,
17640,
13,
1678,
788,
29918,
29879,
10964,
29918,
17640,
353,
26494,
18680,
580,
13,
1678,
16267,
29918,
8299,
29889,
7924,
29918,
12847,
29889,
1202,
29918,
7924,
353,
788,
29918,
29879,
10964,
29918,
17640,
13,
1678,
1899,
353,
376,
1202,
29908,
13,
1678,
1024,
353,
11663,
29879,
590,
29918,
7924,
29908,
13,
1678,
4086,
353,
11663,
29880,
3017,
29908,
13,
1678,
3957,
29918,
1807,
353,
11663,
29884,
1732,
597,
2271,
29889,
510,
448,
29873,
6571,
448,
29887,
529,
26862,
6227,
29958,
1642,
4830,
877,
14207,
1495,
13,
1678,
1196,
353,
376,
11393,
7122,
4197,
6519,
29892,
1024,
29892,
4086,
29892,
3957,
29918,
1807,
2314,
13,
1678,
15709,
29889,
12597,
29898,
1220,
29897,
13,
1678,
4974,
29918,
10954,
29898,
11082,
293,
29889,
2585,
1839,
8309,
22818,
29914,
303,
4395,
29918,
355,
9748,
7464,
6087,
29918,
355,
9748,
29897,
13,
1678,
4974,
29918,
10954,
29898,
11082,
293,
29889,
2585,
1839,
8309,
22818,
29914,
657,
29918,
7924,
29918,
333,
29918,
517,
29918,
978,
7464,
679,
29918,
7924,
29918,
333,
29918,
517,
29918,
978,
29897,
13,
1678,
788,
29918,
29879,
10964,
29918,
17640,
29889,
9294,
29918,
1333,
29918,
13998,
580,
13,
268,
13,
29992,
336,
4637,
29898,
22050,
2659,
8614,
2451,
29897,
13,
29992,
2541,
29918,
14669,
7373,
14669,
29892,
903,
371,
538,
776,
29897,
13,
1753,
1243,
29918,
1202,
29918,
29879,
10964,
29918,
6519,
29918,
336,
4637,
29918,
3608,
29918,
1217,
29918,
10149,
7295,
13,
1678,
411,
13261,
877,
3608,
29889,
5150,
29889,
4381,
742,
736,
29918,
1767,
7607,
1037,
6289,
29892,
525,
4836,
5477,
320,
13,
1678,
1120,
359,
3135,
29922,
5574,
1125,
13,
4706,
788,
29918,
29879,
10964,
29918,
17640,
353,
26494,
18680,
580,
13,
4706,
16267,
29918,
8299,
29889,
1202,
29918,
7924,
353,
788,
29918,
29879,
10964,
29918,
17640,
13,
4706,
1899,
353,
376,
1202,
29908,
13,
4706,
1024,
353,
11663,
29879,
1024,
29908,
13,
4706,
4086,
353,
11663,
29880,
3017,
29908,
13,
4706,
3957,
29918,
1807,
353,
11663,
29884,
1732,
597,
2271,
29889,
510,
448,
29873,
5087,
29908,
13,
4706,
1196,
353,
376,
11393,
7122,
4197,
6519,
29892,
1024,
29892,
4086,
29892,
3957,
29918,
1807,
2314,
13,
4706,
15709,
29889,
12597,
29898,
1220,
29897,
13,
4706,
6389,
353,
6088,
29918,
1191,
1807,
29918,
272,
29918,
20539,
29898,
16390,
481,
10198,
19095,
1199,
29889,
12597,
29892,
1196,
29897,
13,
4706,
11905,
29918,
5150,
29898,
5085,
29897,
13,
13,
29992,
2541,
29918,
14669,
7373,
14669,
29892,
903,
371,
538,
776,
29897,
13,
1753,
1243,
29918,
5060,
487,
29918,
355,
9748,
7295,
13,
1678,
411,
13261,
877,
3608,
29889,
5150,
29889,
4381,
742,
736,
29918,
1767,
7607,
1037,
6289,
29892,
525,
4836,
5477,
29905,
13,
1678,
1120,
359,
3135,
29922,
5574,
1125,
13,
4706,
4974,
29918,
10954,
29898,
11082,
293,
29889,
355,
9748,
29892,
6087,
29918,
355,
9748,
29897,
13,
308,
13,
29992,
2541,
29918,
14669,
7373,
14669,
29892,
903,
371,
538,
776,
29897,
13,
1753,
1243,
29918,
5060,
487,
29918,
29879,
10964,
7295,
13,
1678,
411,
13261,
877,
3608,
29889,
5150,
29889,
4381,
742,
736,
29918,
1767,
7607,
1037,
6289,
29892,
525,
4836,
5477,
29905,
13,
1678,
1120,
359,
3135,
29922,
5574,
1125,
13,
4706,
16267,
29918,
8299,
29889,
657,
29918,
497,
29918,
29879,
10964,
29918,
29734,
353,
26494,
18680,
29898,
2457,
29918,
1767,
29922,
29879,
10964,
29918,
1761,
29918,
17640,
29897,
13,
4706,
16267,
29918,
8299,
29889,
657,
29918,
25240,
29918,
11303,
1237,
353,
5159,
13,
4706,
788,
29918,
29879,
10964,
29918,
17640,
353,
26494,
18680,
580,
13,
4706,
16267,
29918,
8299,
29889,
7924,
29918,
12847,
29889,
1202,
29918,
7924,
353,
788,
29918,
29879,
10964,
29918,
17640,
13,
4706,
788,
29918,
29879,
10964,
29918,
17640,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
703,
1357,
29918,
7924,
613,
16238,
29891,
7317,
29898,
1124,
29918,
4645,
29922,
19095,
293,
18680,
3285,
29905,
13,
1678,
4426,
3790,
29908,
14380,
1115,
17493,
29918,
29968,
22255,
29918,
5550,
1718,
29968,
29892,
376,
23057,
915,
271,
10851,
797,
11863,
1115,
29871,
29953,
29900,
1118,
474,
4691,
29918,
4990,
29922,
666,
1656,
29918,
4990,
29892,
4867,
29918,
333,
29922,
29896,
29906,
29941,
29946,
29945,
876,
13,
4706,
4974,
29918,
10954,
29898,
12597,
29918,
8299,
29892,
6087,
29918,
355,
9748,
29897,
13,
2
] |
CIM14/ENTSOE/Dynamics/IEC61970/Dynamics/ExcitationSystems/ExcitationSystemsExcST4B.py | MaximeBaudette/PyCIM | 58 | 180601 | <reponame>MaximeBaudette/PyCIM
# Copyright (C) 2010-2011 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from CIM14.ENTSOE.Dynamics.IEC61970.Core.CorePowerSystemResource import CorePowerSystemResource
class ExcitationSystemsExcST4B(CorePowerSystemResource):
def __init__(self, kp=0.0, xl=0.0, vbmax=0.0, ki=0.0, kir=0.0, vrmin=0.0, vmmin=0.0, kim=0.0, ta=0.0, kg=0.0, tr=0.0, kc=0.0, vrmax=0.0, angp=0.0, kpr=0.0, vgmax=0.0, kpm=0.0, vmmax=0.0, *args, **kw_args):
"""Initialises a new 'ExcitationSystemsExcST4B' instance.
@param kp:
@param xl:
@param vbmax:
@param ki:
@param kir:
@param vrmin:
@param vmmin:
@param kim:
@param ta:
@param kg:
@param tr:
@param kc:
@param vrmax:
@param angp:
@param kpr:
@param vgmax:
@param kpm:
@param vmmax:
"""
self.kp = kp
self.xl = xl
self.vbmax = vbmax
self.ki = ki
self.kir = kir
self.vrmin = vrmin
self.vmmin = vmmin
self.kim = kim
self.ta = ta
self.kg = kg
self.tr = tr
self.kc = kc
self.vrmax = vrmax
self.angp = angp
self.kpr = kpr
self.vgmax = vgmax
self.kpm = kpm
self.vmmax = vmmax
super(ExcitationSystemsExcST4B, self).__init__(*args, **kw_args)
_attrs = ["kp", "xl", "vbmax", "ki", "kir", "vrmin", "vmmin", "kim", "ta", "kg", "tr", "kc", "vrmax", "angp", "kpr", "vgmax", "kpm", "vmmax"]
_attr_types = {"kp": float, "xl": float, "vbmax": float, "ki": float, "kir": float, "vrmin": float, "vmmin": float, "kim": float, "ta": float, "kg": float, "tr": float, "kc": float, "vrmax": float, "angp": float, "kpr": float, "vgmax": float, "kpm": float, "vmmax": float}
_defaults = {"kp": 0.0, "xl": 0.0, "vbmax": 0.0, "ki": 0.0, "kir": 0.0, "vrmin": 0.0, "vmmin": 0.0, "kim": 0.0, "ta": 0.0, "kg": 0.0, "tr": 0.0, "kc": 0.0, "vrmax": 0.0, "angp": 0.0, "kpr": 0.0, "vgmax": 0.0, "kpm": 0.0, "vmmax": 0.0}
_enums = {}
_refs = []
_many_refs = []
| [
1,
529,
276,
1112,
420,
29958,
7976,
603,
29933,
15052,
2353,
29914,
19737,
29907,
7833,
13,
29937,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29900,
29899,
29906,
29900,
29896,
29896,
529,
5813,
29958,
13,
29937,
13,
29937,
20894,
2333,
338,
1244,
1609,
16896,
29892,
3889,
310,
8323,
29892,
304,
738,
2022,
4017,
292,
263,
3509,
13,
29937,
310,
445,
7047,
322,
6942,
5106,
2066,
313,
1552,
376,
6295,
14093,
4968,
304,
13,
29937,
5376,
297,
278,
18540,
1728,
24345,
29892,
3704,
1728,
29485,
278,
13,
29937,
10462,
304,
671,
29892,
3509,
29892,
6623,
29892,
10366,
29892,
9805,
29892,
1320,
2666,
29892,
269,
803,
1947,
29892,
322,
29914,
272,
13,
29937,
19417,
14591,
310,
278,
18540,
29892,
322,
304,
14257,
12407,
304,
6029,
278,
18540,
338,
13,
29937,
15252,
3276,
304,
437,
577,
29892,
4967,
304,
278,
1494,
5855,
29901,
13,
29937,
13,
29937,
450,
2038,
3509,
1266,
8369,
322,
445,
10751,
8369,
4091,
367,
5134,
297,
13,
29937,
599,
14591,
470,
23228,
2011,
1080,
310,
278,
18540,
29889,
13,
29937,
13,
29937,
6093,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
8528,
15094,
1799,
6323,
13,
29937,
306,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
13,
29937,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
13,
29937,
26524,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
13,
29937,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
13,
29937,
3895,
29892,
19474,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
13,
29937,
2672,
6093,
7791,
7818,
12982,
1525,
29889,
13,
13,
3166,
315,
7833,
29896,
29946,
29889,
3919,
6156,
29923,
29889,
29928,
2926,
1199,
29889,
8673,
29907,
29953,
29896,
29929,
29955,
29900,
29889,
9203,
29889,
9203,
21472,
3924,
6848,
1053,
10239,
21472,
3924,
6848,
13,
13,
1990,
1222,
29883,
7018,
3924,
29879,
1252,
29883,
1254,
29946,
29933,
29898,
9203,
21472,
3924,
6848,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
413,
29886,
29922,
29900,
29889,
29900,
29892,
921,
29880,
29922,
29900,
29889,
29900,
29892,
16822,
3317,
29922,
29900,
29889,
29900,
29892,
8506,
29922,
29900,
29889,
29900,
29892,
18990,
29922,
29900,
29889,
29900,
29892,
11723,
1195,
29922,
29900,
29889,
29900,
29892,
22419,
1195,
29922,
29900,
29889,
29900,
29892,
413,
326,
29922,
29900,
29889,
29900,
29892,
11062,
29922,
29900,
29889,
29900,
29892,
12118,
29922,
29900,
29889,
29900,
29892,
534,
29922,
29900,
29889,
29900,
29892,
413,
29883,
29922,
29900,
29889,
29900,
29892,
11723,
3317,
29922,
29900,
29889,
29900,
29892,
2614,
29886,
29922,
29900,
29889,
29900,
29892,
413,
558,
29922,
29900,
29889,
29900,
29892,
325,
29887,
3317,
29922,
29900,
29889,
29900,
29892,
413,
3358,
29922,
29900,
29889,
29900,
29892,
22419,
3317,
29922,
29900,
29889,
29900,
29892,
334,
5085,
29892,
3579,
11022,
29918,
5085,
1125,
13,
4706,
9995,
15514,
4637,
263,
716,
525,
1252,
29883,
7018,
3924,
29879,
1252,
29883,
1254,
29946,
29933,
29915,
2777,
29889,
13,
13,
4706,
732,
3207,
413,
29886,
29901,
29871,
13,
4706,
732,
3207,
921,
29880,
29901,
29871,
13,
4706,
732,
3207,
16822,
3317,
29901,
29871,
13,
4706,
732,
3207,
8506,
29901,
29871,
13,
4706,
732,
3207,
18990,
29901,
29871,
13,
4706,
732,
3207,
11723,
1195,
29901,
29871,
13,
4706,
732,
3207,
22419,
1195,
29901,
29871,
13,
4706,
732,
3207,
413,
326,
29901,
29871,
13,
4706,
732,
3207,
11062,
29901,
29871,
13,
4706,
732,
3207,
12118,
29901,
29871,
13,
4706,
732,
3207,
534,
29901,
29871,
13,
4706,
732,
3207,
413,
29883,
29901,
29871,
13,
4706,
732,
3207,
11723,
3317,
29901,
29871,
13,
4706,
732,
3207,
2614,
29886,
29901,
29871,
13,
4706,
732,
3207,
413,
558,
29901,
29871,
13,
4706,
732,
3207,
325,
29887,
3317,
29901,
29871,
13,
4706,
732,
3207,
413,
3358,
29901,
29871,
13,
4706,
732,
3207,
22419,
3317,
29901,
29871,
13,
4706,
9995,
13,
13,
4706,
1583,
29889,
29895,
29886,
353,
413,
29886,
13,
13,
13,
4706,
1583,
29889,
15524,
353,
921,
29880,
13,
13,
13,
4706,
1583,
29889,
24666,
3317,
353,
16822,
3317,
13,
13,
13,
4706,
1583,
29889,
1984,
353,
8506,
13,
13,
13,
4706,
1583,
29889,
14166,
353,
18990,
13,
13,
13,
4706,
1583,
29889,
13416,
1195,
353,
11723,
1195,
13,
13,
13,
4706,
1583,
29889,
6925,
1195,
353,
22419,
1195,
13,
13,
13,
4706,
1583,
29889,
20903,
353,
413,
326,
13,
13,
13,
4706,
1583,
29889,
941,
353,
11062,
13,
13,
13,
4706,
1583,
29889,
9415,
353,
12118,
13,
13,
13,
4706,
1583,
29889,
509,
353,
534,
13,
13,
13,
4706,
1583,
29889,
12192,
353,
413,
29883,
13,
13,
13,
4706,
1583,
29889,
13416,
3317,
353,
11723,
3317,
13,
13,
13,
4706,
1583,
29889,
574,
29886,
353,
2614,
29886,
13,
13,
13,
4706,
1583,
29889,
29895,
558,
353,
413,
558,
13,
13,
13,
4706,
1583,
29889,
29894,
29887,
3317,
353,
325,
29887,
3317,
13,
13,
13,
4706,
1583,
29889,
29895,
3358,
353,
413,
3358,
13,
13,
13,
4706,
1583,
29889,
6925,
3317,
353,
22419,
3317,
13,
13,
4706,
2428,
29898,
1252,
29883,
7018,
3924,
29879,
1252,
29883,
1254,
29946,
29933,
29892,
1583,
467,
1649,
2344,
1649,
10456,
5085,
29892,
3579,
11022,
29918,
5085,
29897,
13,
13,
1678,
903,
5552,
29879,
353,
6796,
29895,
29886,
613,
376,
15524,
613,
376,
24666,
3317,
613,
376,
1984,
613,
376,
14166,
613,
376,
13416,
1195,
613,
376,
6925,
1195,
613,
376,
20903,
613,
376,
941,
613,
376,
9415,
613,
376,
509,
613,
376,
12192,
613,
376,
13416,
3317,
613,
376,
574,
29886,
613,
376,
29895,
558,
613,
376,
29894,
29887,
3317,
613,
376,
29895,
3358,
613,
376,
6925,
3317,
3108,
13,
1678,
903,
5552,
29918,
8768,
353,
8853,
29895,
29886,
1115,
5785,
29892,
376,
15524,
1115,
5785,
29892,
376,
24666,
3317,
1115,
5785,
29892,
376,
1984,
1115,
5785,
29892,
376,
14166,
1115,
5785,
29892,
376,
13416,
1195,
1115,
5785,
29892,
376,
6925,
1195,
1115,
5785,
29892,
376,
20903,
1115,
5785,
29892,
376,
941,
1115,
5785,
29892,
376,
9415,
1115,
5785,
29892,
376,
509,
1115,
5785,
29892,
376,
12192,
1115,
5785,
29892,
376,
13416,
3317,
1115,
5785,
29892,
376,
574,
29886,
1115,
5785,
29892,
376,
29895,
558,
1115,
5785,
29892,
376,
29894,
29887,
3317,
1115,
5785,
29892,
376,
29895,
3358,
1115,
5785,
29892,
376,
6925,
3317,
1115,
5785,
29913,
13,
1678,
903,
4381,
29879,
353,
8853,
29895,
29886,
1115,
29871,
29900,
29889,
29900,
29892,
376,
15524,
1115,
29871,
29900,
29889,
29900,
29892,
376,
24666,
3317,
1115,
29871,
29900,
29889,
29900,
29892,
376,
1984,
1115,
29871,
29900,
29889,
29900,
29892,
376,
14166,
1115,
29871,
29900,
29889,
29900,
29892,
376,
13416,
1195,
1115,
29871,
29900,
29889,
29900,
29892,
376,
6925,
1195,
1115,
29871,
29900,
29889,
29900,
29892,
376,
20903,
1115,
29871,
29900,
29889,
29900,
29892,
376,
941,
1115,
29871,
29900,
29889,
29900,
29892,
376,
9415,
1115,
29871,
29900,
29889,
29900,
29892,
376,
509,
1115,
29871,
29900,
29889,
29900,
29892,
376,
12192,
1115,
29871,
29900,
29889,
29900,
29892,
376,
13416,
3317,
1115,
29871,
29900,
29889,
29900,
29892,
376,
574,
29886,
1115,
29871,
29900,
29889,
29900,
29892,
376,
29895,
558,
1115,
29871,
29900,
29889,
29900,
29892,
376,
29894,
29887,
3317,
1115,
29871,
29900,
29889,
29900,
29892,
376,
29895,
3358,
1115,
29871,
29900,
29889,
29900,
29892,
376,
6925,
3317,
1115,
29871,
29900,
29889,
29900,
29913,
13,
1678,
903,
264,
6762,
353,
6571,
13,
1678,
903,
24539,
353,
5159,
13,
1678,
903,
13011,
29918,
24539,
353,
5159,
13,
13,
2
] |
pyMIDICapSense.py | midilab/pyMIDICapSense | 2 | 26610 | <filename>pyMIDICapSense.py
import wiringpi2
import rtmidi
from defines import *
from config import *
#import config
# config.TIMEOUT
def Setup(outPin, inPin, ledPin):
# set Send Pin Register
wiringpi2.pinMode(outPin, OUTPUT)
# set receivePin Register low to make sure pullups are off
wiringpi2.pinMode(inPin, OUTPUT)
wiringpi2.digitalWrite(inPin, LOW)
wiringpi2.pinMode(inPin, INPUT)
# set ledPin
wiringpi2.pinMode(ledPin, OUTPUT)
wiringpi2.digitalWrite(ledPin, LOW)
def CapRead(outPin, inPin, total=0, cycles=CYCLES):
# set Send Pin Register low
wiringpi2.digitalWrite(outPin, LOW)
# set send Pin High
wiringpi2.digitalWrite(outPin, HIGH)
# while receive pin is LOW AND total is positive value
while( wiringpi2.digitalRead(inPin) == LOW and total < TIMEOUT ):
total+=1
if ( total > TIMEOUT ):
return -2 # total variable over TIMEOUT
# set receive pin HIGH briefly to charge up fully - because the while loop above will exit when pin is ~ 2.5V
wiringpi2.digitalWrite(inPin, HIGH)
# set send Pin LOW
wiringpi2.digitalWrite(outPin, LOW)
# while receive pin is HIGH AND total is less than TIMEOUT
while( wiringpi2.digitalRead(inPin) == HIGH and total < TIMEOUT) :
total+=1
if ( total >= TIMEOUT ):
return -2
# decrement cycles counting
cycles-=1
# if we reach the end of cycles, then...
if (cycles == 0):
if DEBUG:
print("total unit count: %d" % total)
# get the average of values over the cycles
total = round(total/CYCLES)
# if the average total is greater of equal to TRIGGER value
if ( total >= TRIGGER ):
return 1
else:
return 0
return CapRead(outPin, inPin, total, cycles)
def ChangeBank():
global BANK
# increment bank number
BANK += 1
# check for bank boundaries
if ( BANK > BANK_MAX ):
BANK = 1
print("BANK: %d selected" % BANK)
# blink the led x times followed by BANK number
#i = 0
#while ( i < BANK ):
# wiringpi2.delay(500)
# wiringpi2.digitalWrite(SENSORS[7]['led'], HIGH)
# wiringpi2.delay(500)
# wiringpi2.digitalWrite(SENSORS[7]['led'], LOW)
# i += 1
# Initial definitions
note = 0;
# setup sensor input and output pins
for sensor in SENSORS:
Setup(sensor['output'], sensor['input'], sensor['led'])
# Init virtual midi port
midi_out = rtmidi.MidiOut()
midi_out.open_virtual_port()
# loop
while True:
for sensor in SENSORS:
if (DEBUG):
print("############ %s" % sensor['name'])
value = CapRead(sensor['output'], sensor['input'])
if ( value and ( value != sensor['last_value'] ) ):
print("############ %s" % sensor['name'])
#if (sensor['note'][BANK-1] == 0):
if (sensor['type'] == BANK_CHANGE):
# change bank request
ChangeBank()
note = 0
elif (sensor['type'] == BANK_SELECT):
note = sensor['note'][BANK-1]
elif (sensor['type'] == RANDOM):
# stuff for ramdom type
note = note
elif (sensor['type'] == SEQUENTIAL):
# stuff for sequential sensor type
sensor['seq_next'] += 1
if ( sensor['seq_next'] >= len(sensor['note']) ):
sensor['seq_next'] = 0
note = sensor['note'][sensor['seq_next']]
print ('Send Note ON: %d' % note)
midi_out.send_message([0x90, note, 100]) # Note on
# set sensor led ON
wiringpi2.digitalWrite(sensor['led'], HIGH)
elif ( value != sensor['last_value'] ):
#if (sensor['note'][BANK-1] != 0):
print("############ %s" % sensor['name'])
if (sensor['type'] == BANK_SELECT):
note = sensor['note'][BANK-1]
elif (sensor['type'] == RANDOM):
# stuff for ramdom type
note = note
elif (sensor['type'] == SEQUENTIAL):
# stuff for sequential sensor type
note = sensor['note'][sensor['seq_next']]
print ('Send Note OFF: %d' % note)
midi_out.send_message([0x80, note, 100]) # Note off
# set sensor led Off
wiringpi2.digitalWrite(sensor['led'], LOW)
sensor['last_value'] = value
| [
1,
529,
9507,
29958,
2272,
29924,
1367,
2965,
481,
29903,
1947,
29889,
2272,
13,
5215,
281,
8491,
1631,
29906,
13,
5215,
364,
29873,
6563,
29875,
13,
13,
3166,
17645,
1053,
334,
13,
13,
13,
3166,
2295,
1053,
334,
13,
29937,
5215,
2295,
13,
29937,
2295,
29889,
15307,
12015,
13,
13,
1753,
3789,
786,
29898,
449,
29925,
262,
29892,
297,
29925,
262,
29892,
5331,
29925,
262,
1125,
13,
12,
29937,
731,
15076,
17434,
12577,
13,
12,
29893,
8491,
1631,
29906,
29889,
12687,
6818,
29898,
449,
29925,
262,
29892,
19474,
12336,
29897,
13,
13,
12,
29937,
731,
7150,
29925,
262,
12577,
4482,
304,
1207,
1854,
8206,
14340,
526,
1283,
13,
12,
29893,
8491,
1631,
29906,
29889,
12687,
6818,
29898,
262,
29925,
262,
29892,
19474,
12336,
29897,
13,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
262,
29925,
262,
29892,
365,
9806,
29897,
13,
12,
29893,
8491,
1631,
29906,
29889,
12687,
6818,
29898,
262,
29925,
262,
29892,
2672,
12336,
29897,
13,
12,
13,
12,
29937,
731,
5331,
29925,
262,
13,
12,
29893,
8491,
1631,
29906,
29889,
12687,
6818,
29898,
839,
29925,
262,
29892,
19474,
12336,
29897,
13,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
839,
29925,
262,
29892,
365,
9806,
29897,
13,
13,
1753,
5915,
6359,
29898,
449,
29925,
262,
29892,
297,
29925,
262,
29892,
3001,
29922,
29900,
29892,
25785,
29922,
29907,
29979,
29907,
17101,
1125,
13,
12,
29937,
731,
15076,
17434,
12577,
4482,
13,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
449,
29925,
262,
29892,
365,
9806,
29897,
13,
13,
12,
29937,
731,
3638,
17434,
5057,
13,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
449,
29925,
262,
29892,
379,
6259,
29950,
29897,
1678,
13,
29871,
13,
12,
29937,
1550,
7150,
12534,
338,
365,
9806,
5300,
3001,
338,
6374,
995,
13,
12,
8000,
29898,
281,
8491,
1631,
29906,
29889,
7501,
2410,
6359,
29898,
262,
29925,
262,
29897,
1275,
365,
9806,
322,
3001,
529,
323,
8890,
12015,
29871,
1125,
13,
12,
12,
7827,
23661,
29896,
13,
268,
13,
12,
361,
313,
3001,
1405,
323,
8890,
12015,
29871,
1125,
13,
12,
12,
2457,
448,
29906,
396,
3001,
2286,
975,
323,
8890,
12015,
13,
308,
13,
12,
29937,
731,
7150,
12534,
379,
6259,
29950,
23359,
304,
8323,
701,
8072,
448,
1363,
278,
1550,
2425,
2038,
674,
6876,
746,
12534,
338,
3695,
29871,
29906,
29889,
29945,
29963,
29871,
13,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
262,
29925,
262,
29892,
379,
6259,
29950,
29897,
13,
29871,
13,
12,
29937,
731,
3638,
17434,
365,
9806,
13,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
449,
29925,
262,
29892,
365,
9806,
29897,
13,
13,
12,
29937,
1550,
7150,
12534,
338,
379,
6259,
29950,
29871,
5300,
3001,
338,
3109,
1135,
323,
8890,
12015,
13,
12,
8000,
29898,
281,
8491,
1631,
29906,
29889,
7501,
2410,
6359,
29898,
262,
29925,
262,
29897,
1275,
379,
6259,
29950,
322,
3001,
529,
323,
8890,
12015,
29897,
584,
13,
12,
12,
7827,
23661,
29896,
13,
268,
13,
12,
361,
313,
3001,
6736,
323,
8890,
12015,
29871,
1125,
13,
12,
12,
2457,
448,
29906,
13,
13,
12,
29937,
9263,
358,
25785,
21248,
13,
12,
1270,
7799,
29899,
29922,
29896,
13,
13,
12,
29937,
565,
591,
6159,
278,
1095,
310,
25785,
29892,
769,
856,
13,
12,
361,
313,
1270,
7799,
1275,
29871,
29900,
1125,
13,
12,
12,
361,
21681,
29901,
13,
12,
12,
12,
2158,
703,
7827,
5190,
2302,
29901,
1273,
29881,
29908,
1273,
3001,
29897,
13,
12,
12,
29937,
679,
278,
6588,
310,
1819,
975,
278,
25785,
13,
12,
12,
7827,
353,
4513,
29898,
7827,
29914,
29907,
29979,
29907,
17101,
29897,
13,
12,
12,
29937,
565,
278,
6588,
3001,
338,
7621,
310,
5186,
304,
323,
22789,
17070,
995,
13,
12,
12,
361,
313,
3001,
6736,
323,
22789,
17070,
29871,
1125,
13,
12,
12,
12,
2457,
29871,
29896,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
2457,
29871,
29900,
13,
13,
12,
2457,
5915,
6359,
29898,
449,
29925,
262,
29892,
297,
29925,
262,
29892,
3001,
29892,
25785,
29897,
13,
13,
1753,
10726,
29933,
804,
7295,
13,
12,
10945,
350,
2190,
29968,
13,
13,
12,
29937,
11924,
9124,
1353,
13,
12,
29933,
2190,
29968,
4619,
29871,
29896,
13,
13,
12,
29937,
1423,
363,
9124,
24371,
13,
12,
361,
313,
350,
2190,
29968,
1405,
350,
2190,
29968,
29918,
12648,
29871,
1125,
13,
12,
12,
29933,
2190,
29968,
353,
29871,
29896,
13,
13,
12,
2158,
703,
29933,
2190,
29968,
29901,
1273,
29881,
4629,
29908,
1273,
350,
2190,
29968,
29897,
13,
13,
12,
29937,
1999,
682,
278,
5331,
921,
3064,
5643,
491,
350,
2190,
29968,
1353,
13,
12,
29937,
29875,
353,
29871,
29900,
13,
12,
29937,
8000,
313,
474,
529,
350,
2190,
29968,
29871,
1125,
13,
12,
29937,
12,
29893,
8491,
1631,
29906,
29889,
18829,
29898,
29945,
29900,
29900,
29897,
13,
12,
29937,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
29903,
1430,
29903,
24125,
29961,
29955,
22322,
839,
7464,
379,
6259,
29950,
29897,
13,
12,
29937,
12,
29893,
8491,
1631,
29906,
29889,
18829,
29898,
29945,
29900,
29900,
29897,
13,
12,
29937,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
29903,
1430,
29903,
24125,
29961,
29955,
22322,
839,
7464,
365,
9806,
29897,
13,
12,
29937,
12,
29875,
4619,
29871,
29896,
13,
13,
29937,
17250,
15848,
13,
6812,
353,
29871,
29900,
29936,
13,
13,
29937,
6230,
23530,
1881,
322,
1962,
282,
1144,
13,
1454,
23530,
297,
317,
1430,
29903,
24125,
29901,
13,
12,
26947,
29898,
29879,
6073,
1839,
4905,
7464,
23530,
1839,
2080,
7464,
23530,
1839,
839,
11287,
13,
13,
29937,
10886,
6901,
7145,
29875,
2011,
13,
6563,
29875,
29918,
449,
353,
364,
29873,
6563,
29875,
29889,
29924,
8819,
3744,
580,
13,
6563,
29875,
29918,
449,
29889,
3150,
29918,
18714,
29918,
637,
580,
13,
13,
29937,
2425,
13,
8000,
5852,
29901,
13,
12,
13,
12,
1454,
23530,
297,
317,
1430,
29903,
24125,
29901,
13,
13,
12,
12,
361,
313,
18525,
1125,
13,
12,
12,
12,
2158,
703,
7346,
4136,
1273,
29879,
29908,
1273,
23530,
1839,
978,
11287,
13,
13,
12,
12,
1767,
353,
5915,
6359,
29898,
29879,
6073,
1839,
4905,
7464,
23530,
1839,
2080,
11287,
13,
12,
12,
13,
12,
12,
361,
313,
995,
322,
313,
995,
2804,
23530,
1839,
4230,
29918,
1767,
2033,
1723,
29871,
1125,
13,
12,
12,
12,
13,
12,
12,
12,
2158,
703,
7346,
4136,
1273,
29879,
29908,
1273,
23530,
1839,
978,
11287,
13,
12,
12,
12,
29937,
361,
313,
29879,
6073,
1839,
6812,
2033,
29961,
29933,
2190,
29968,
29899,
29896,
29962,
1275,
29871,
29900,
1125,
13,
12,
12,
12,
361,
313,
29879,
6073,
1839,
1853,
2033,
1275,
350,
2190,
29968,
29918,
3210,
24336,
1125,
13,
12,
12,
12,
12,
29937,
1735,
9124,
2009,
13,
12,
12,
12,
12,
7277,
29933,
804,
580,
13,
12,
12,
12,
12,
6812,
353,
29871,
29900,
13,
12,
12,
12,
23681,
313,
29879,
6073,
1839,
1853,
2033,
1275,
350,
2190,
29968,
29918,
6404,
1125,
13,
12,
12,
12,
12,
6812,
353,
23530,
1839,
6812,
2033,
29961,
29933,
2190,
29968,
29899,
29896,
29962,
13,
12,
12,
12,
23681,
313,
29879,
6073,
1839,
1853,
2033,
1275,
390,
2190,
22141,
1125,
13,
12,
12,
12,
12,
29937,
6433,
363,
13472,
3129,
1134,
13,
12,
12,
12,
12,
6812,
353,
4443,
13,
12,
12,
12,
23681,
313,
29879,
6073,
1839,
1853,
2033,
1275,
3725,
13356,
3919,
25758,
1125,
13,
12,
12,
12,
12,
29937,
6433,
363,
8617,
2556,
23530,
1134,
13,
12,
12,
12,
12,
29879,
6073,
1839,
11762,
29918,
4622,
2033,
4619,
29871,
29896,
13,
12,
12,
12,
12,
361,
313,
23530,
1839,
11762,
29918,
4622,
2033,
6736,
7431,
29898,
29879,
6073,
1839,
6812,
11287,
29871,
1125,
13,
12,
12,
12,
12,
12,
29879,
6073,
1839,
11762,
29918,
4622,
2033,
353,
29871,
29900,
13,
12,
12,
12,
12,
6812,
353,
23530,
1839,
6812,
2033,
29961,
29879,
6073,
1839,
11762,
29918,
4622,
2033,
29962,
13,
12,
12,
12,
2158,
6702,
12600,
3940,
6732,
29901,
1273,
29881,
29915,
1273,
4443,
29897,
13,
12,
12,
12,
6563,
29875,
29918,
449,
29889,
6717,
29918,
4906,
4197,
29900,
29916,
29929,
29900,
29892,
4443,
29892,
29871,
29896,
29900,
29900,
2314,
396,
3940,
373,
13,
13,
12,
12,
12,
29937,
731,
23530,
5331,
6732,
13,
12,
12,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
29879,
6073,
1839,
839,
7464,
379,
6259,
29950,
29897,
13,
13,
13,
12,
12,
23681,
313,
995,
2804,
23530,
1839,
4230,
29918,
1767,
2033,
259,
1125,
13,
12,
12,
12,
29937,
361,
313,
29879,
6073,
1839,
6812,
2033,
29961,
29933,
2190,
29968,
29899,
29896,
29962,
2804,
29871,
29900,
1125,
13,
12,
12,
12,
2158,
703,
7346,
4136,
1273,
29879,
29908,
1273,
23530,
1839,
978,
11287,
13,
13,
12,
12,
12,
361,
313,
29879,
6073,
1839,
1853,
2033,
1275,
350,
2190,
29968,
29918,
6404,
1125,
13,
12,
12,
12,
12,
6812,
353,
23530,
1839,
6812,
2033,
29961,
29933,
2190,
29968,
29899,
29896,
29962,
13,
12,
12,
12,
23681,
313,
29879,
6073,
1839,
1853,
2033,
1275,
390,
2190,
22141,
1125,
13,
12,
12,
12,
12,
29937,
6433,
363,
13472,
3129,
1134,
13,
12,
12,
12,
12,
6812,
353,
4443,
13,
12,
12,
12,
23681,
313,
29879,
6073,
1839,
1853,
2033,
1275,
3725,
13356,
3919,
25758,
1125,
13,
12,
12,
12,
12,
29937,
6433,
363,
8617,
2556,
23530,
1134,
13,
12,
12,
12,
12,
6812,
353,
23530,
1839,
6812,
2033,
29961,
29879,
6073,
1839,
11762,
29918,
4622,
2033,
29962,
13,
13,
12,
12,
12,
2158,
6702,
12600,
3940,
438,
4198,
29901,
1273,
29881,
29915,
1273,
4443,
29897,
13,
12,
12,
12,
6563,
29875,
29918,
449,
29889,
6717,
29918,
4906,
4197,
29900,
29916,
29947,
29900,
29892,
4443,
29892,
29871,
29896,
29900,
29900,
2314,
396,
3940,
1283,
13,
12,
12,
12,
29937,
731,
23530,
5331,
5947,
13,
12,
12,
12,
29893,
8491,
1631,
29906,
29889,
7501,
2410,
6113,
29898,
29879,
6073,
1839,
839,
7464,
365,
9806,
29897,
13,
12,
12,
12,
13,
13,
12,
12,
29879,
6073,
1839,
4230,
29918,
1767,
2033,
353,
995,
13,
13,
2
] |
openpype/hosts/houdini/vendor/husdoutputprocessors/stagingdir_processor.py | jonclothcat/OpenPype | 87 | 45073 | import hou
import husdoutputprocessors.base as base
import os
class StagingDirOutputProcessor(base.OutputProcessorBase):
"""Output all USD Rop file nodes into the Staging Directory
Ignore any folders and paths set in the Configured Layers
and USD Rop node, just take the filename and save into a
single directory.
"""
theParameters = None
parameter_prefix = "stagingdiroutputprocessor_"
stagingdir_parm_name = parameter_prefix + "stagingDir"
def __init__(self):
self.staging_dir = None
def displayName(self):
return 'StagingDir Output Processor'
def parameters(self):
if not self.theParameters:
parameters = hou.ParmTemplateGroup()
rootdirparm = hou.StringParmTemplate(
self.stagingdir_parm_name,
'Staging Directory', 1,
string_type=hou.stringParmType.FileReference,
file_type=hou.fileType.Directory
)
parameters.append(rootdirparm)
self.theParameters = parameters.asDialogScript()
return self.theParameters
def beginSave(self, config_node, t):
# Use the Root Directory parameter if it is set.
root_dir_parm = config_node.parm(self.stagingdir_parm_name)
if root_dir_parm:
self.staging_dir = root_dir_parm.evalAtTime(t)
if not self.staging_dir:
out_file_parm = config_node.parm('lopoutput')
if out_file_parm:
self.staging_dir = out_file_parm.evalAtTime(t)
if self.staging_dir:
(self.staging_dir, filename) = os.path.split(self.staging_dir)
def endSave(self):
self.staging_dir = None
def processAsset(self, asset_path,
asset_path_for_save,
referencing_layer_path,
asset_is_layer,
for_save):
"""
Args:
asset_path (str): The incoming file path you want to alter or not.
asset_path_for_save (bool): Whether the current path is a
referenced path in the USD file. When True, return the path
you want inside USD file.
referencing_layer_path (str): ???
asset_is_layer (bool): Whether this asset is a USD layer file.
If this is False, the asset is something else (for example,
a texture or volume file).
for_save (bool): Whether the asset path is for a file to be saved
out. If so, then return actual written filepath.
Returns:
The refactored asset path.
"""
# Treat save paths as being relative to the output path.
if for_save and self.staging_dir:
# Whenever we're processing a Save Path make sure to
# resolve it to the Staging Directory
filename = os.path.basename(asset_path)
return os.path.join(self.staging_dir, filename)
return asset_path
output_processor = StagingDirOutputProcessor()
def usdOutputProcessor():
return output_processor
| [
1,
1053,
298,
283,
13,
5215,
8646,
29881,
4905,
5014,
943,
29889,
3188,
408,
2967,
13,
5215,
2897,
13,
13,
13,
1990,
624,
6751,
9170,
6466,
18689,
29898,
3188,
29889,
6466,
18689,
5160,
1125,
13,
1678,
9995,
6466,
599,
3148,
29928,
390,
459,
934,
7573,
964,
278,
624,
6751,
18862,
13,
13,
1678,
18076,
487,
738,
16495,
322,
10898,
731,
297,
278,
12782,
2955,
365,
388,
414,
13,
1678,
322,
3148,
29928,
390,
459,
2943,
29892,
925,
2125,
278,
10422,
322,
4078,
964,
263,
13,
1678,
2323,
3884,
29889,
13,
13,
1678,
9995,
13,
1678,
278,
11507,
353,
6213,
13,
1678,
3443,
29918,
13506,
353,
376,
303,
6751,
3972,
4905,
26482,
27508,
13,
1678,
380,
6751,
3972,
29918,
862,
29885,
29918,
978,
353,
3443,
29918,
13506,
718,
376,
303,
6751,
9170,
29908,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
303,
6751,
29918,
3972,
353,
6213,
13,
13,
1678,
822,
2479,
1170,
29898,
1311,
1125,
13,
4706,
736,
525,
855,
6751,
9170,
10604,
10554,
272,
29915,
13,
13,
1678,
822,
4128,
29898,
1311,
1125,
13,
4706,
565,
451,
1583,
29889,
1552,
11507,
29901,
13,
9651,
4128,
353,
298,
283,
29889,
2177,
29885,
6733,
4782,
580,
13,
9651,
3876,
3972,
862,
29885,
353,
298,
283,
29889,
1231,
2177,
29885,
6733,
29898,
13,
18884,
1583,
29889,
303,
6751,
3972,
29918,
862,
29885,
29918,
978,
29892,
13,
18884,
525,
855,
6751,
18862,
742,
29871,
29896,
29892,
13,
18884,
1347,
29918,
1853,
29922,
10774,
29889,
1807,
2177,
29885,
1542,
29889,
2283,
7422,
29892,
13,
18884,
934,
29918,
1853,
29922,
10774,
29889,
1445,
1542,
29889,
9882,
13,
9651,
1723,
13,
9651,
4128,
29889,
4397,
29898,
4632,
3972,
862,
29885,
29897,
13,
9651,
1583,
29889,
1552,
11507,
353,
4128,
29889,
294,
7647,
4081,
580,
13,
4706,
736,
1583,
29889,
1552,
11507,
13,
13,
1678,
822,
3380,
11371,
29898,
1311,
29892,
2295,
29918,
3177,
29892,
260,
1125,
13,
13,
4706,
396,
4803,
278,
28272,
18862,
3443,
565,
372,
338,
731,
29889,
13,
4706,
3876,
29918,
3972,
29918,
862,
29885,
353,
2295,
29918,
3177,
29889,
862,
29885,
29898,
1311,
29889,
303,
6751,
3972,
29918,
862,
29885,
29918,
978,
29897,
13,
4706,
565,
3876,
29918,
3972,
29918,
862,
29885,
29901,
13,
9651,
1583,
29889,
303,
6751,
29918,
3972,
353,
3876,
29918,
3972,
29918,
862,
29885,
29889,
14513,
4178,
2481,
29898,
29873,
29897,
13,
13,
4706,
565,
451,
1583,
29889,
303,
6751,
29918,
3972,
29901,
13,
9651,
714,
29918,
1445,
29918,
862,
29885,
353,
2295,
29918,
3177,
29889,
862,
29885,
877,
4757,
4905,
1495,
13,
9651,
565,
714,
29918,
1445,
29918,
862,
29885,
29901,
13,
18884,
1583,
29889,
303,
6751,
29918,
3972,
353,
714,
29918,
1445,
29918,
862,
29885,
29889,
14513,
4178,
2481,
29898,
29873,
29897,
13,
9651,
565,
1583,
29889,
303,
6751,
29918,
3972,
29901,
13,
18884,
313,
1311,
29889,
303,
6751,
29918,
3972,
29892,
10422,
29897,
353,
2897,
29889,
2084,
29889,
5451,
29898,
1311,
29889,
303,
6751,
29918,
3972,
29897,
13,
13,
1678,
822,
1095,
11371,
29898,
1311,
1125,
13,
4706,
1583,
29889,
303,
6751,
29918,
3972,
353,
6213,
13,
13,
1678,
822,
1889,
26405,
29898,
1311,
29892,
24342,
29918,
2084,
29892,
13,
9651,
24342,
29918,
2084,
29918,
1454,
29918,
7620,
29892,
13,
9651,
29371,
29918,
13148,
29918,
2084,
29892,
13,
9651,
24342,
29918,
275,
29918,
13148,
29892,
13,
9651,
363,
29918,
7620,
1125,
13,
4706,
9995,
13,
4706,
826,
3174,
29901,
13,
9651,
24342,
29918,
2084,
313,
710,
1125,
450,
23235,
934,
2224,
366,
864,
304,
10551,
470,
451,
29889,
13,
9651,
24342,
29918,
2084,
29918,
1454,
29918,
7620,
313,
11227,
1125,
26460,
278,
1857,
2224,
338,
263,
13,
18884,
16180,
2224,
297,
278,
3148,
29928,
934,
29889,
1932,
5852,
29892,
736,
278,
2224,
13,
18884,
366,
864,
2768,
3148,
29928,
934,
29889,
13,
9651,
29371,
29918,
13148,
29918,
2084,
313,
710,
1125,
1577,
8773,
13,
9651,
24342,
29918,
275,
29918,
13148,
313,
11227,
1125,
26460,
445,
24342,
338,
263,
3148,
29928,
7546,
934,
29889,
13,
18884,
960,
445,
338,
7700,
29892,
278,
24342,
338,
1554,
1683,
313,
1454,
1342,
29892,
13,
18884,
263,
18459,
470,
7977,
934,
467,
13,
9651,
363,
29918,
7620,
313,
11227,
1125,
26460,
278,
24342,
2224,
338,
363,
263,
934,
304,
367,
7160,
13,
18884,
714,
29889,
960,
577,
29892,
769,
736,
3935,
3971,
934,
2084,
29889,
13,
13,
4706,
16969,
29901,
13,
9651,
450,
2143,
627,
4395,
24342,
2224,
29889,
13,
13,
4706,
9995,
13,
13,
4706,
396,
6479,
271,
4078,
10898,
408,
1641,
6198,
304,
278,
1962,
2224,
29889,
13,
4706,
565,
363,
29918,
7620,
322,
1583,
29889,
303,
6751,
29918,
3972,
29901,
13,
9651,
396,
1932,
1310,
591,
29915,
276,
9068,
263,
16913,
10802,
1207,
1854,
304,
13,
9651,
396,
8814,
372,
304,
278,
624,
6751,
18862,
13,
9651,
10422,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
24129,
29918,
2084,
29897,
13,
9651,
736,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
303,
6751,
29918,
3972,
29892,
10422,
29897,
13,
13,
4706,
736,
24342,
29918,
2084,
13,
13,
13,
4905,
29918,
26482,
353,
624,
6751,
9170,
6466,
18689,
580,
13,
1753,
502,
29881,
6466,
18689,
7295,
13,
1678,
736,
1962,
29918,
26482,
13,
13,
2
] |
ufora/FORA/python/PurePython/FunctionTestCases.py | ufora/ufora | 571 | 1615394 | <filename>ufora/FORA/python/PurePython/FunctionTestCases.py
# Copyright 2015 Ufora Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import pyfora.pyAst.PyAstUtil as PyAstUtil
class FunctionTestCases(object):
"""Test cases for pyfora functions"""
def test_nested_function_arguments(self):
def c(v1, v2):
return v1 + v2
def b(v, f):
return f(v, 8)
def a(v):
return b(v, c)
self.equivalentEvaluationTest(a, 10)
def test_default_arguments_1(self):
def f(a=None):
return a
self.equivalentEvaluationTest(f, 0)
self.equivalentEvaluationTest(f, None)
self.equivalentEvaluationTest(f, -3.3)
self.equivalentEvaluationTest(f, "testing")
def test_default_arguments_2(self):
def f(a, b=1, c=None):
return (a, b, c)
self.equivalentEvaluationTest(f, 0, None)
self.equivalentEvaluationTest(f, None, 2)
self.equivalentEvaluationTest(f, None, "test")
self.equivalentEvaluationTest(f, -3.3)
self.equivalentEvaluationTest(f, "test", "test")
def test_define_function(self):
def f(x):
return x+1
arg = 4
with self.create_executor() as executor:
f_proxy = executor.define(f).result()
arg_proxy = executor.define(arg).result()
res_proxy = f_proxy(arg_proxy).result()
self.assertEqual(res_proxy.toLocal().result(), 5)
def test_returnFunctions(self):
y = 2
def toReturn(x):
return x * y
def f():
return toReturn
shouldBeToReturn = self.evaluateWithExecutor(f)
self.assertEqual(shouldBeToReturn(10), toReturn(10))
self.assertEqual(str(shouldBeToReturn.__name__), str(toReturn.__name__))
self.assertEqual(
PyAstUtil.getSourceText(shouldBeToReturn), PyAstUtil.getSourceText(toReturn)
)
def test_define_complicated_function(self):
with self.create_executor() as executor:
y = 1
z = 2
w = 3
def h(x):
return w + 2 * x
def f(x):
if x < 0:
return x
return y + g(x - 1) + h(x)
def g(x):
if x < 0:
return x
return z * f(x - 1) + h(x - 1)
arg = 4
res_proxy = executor.submit(f, arg).result()
self.assertEqual(res_proxy.toLocal().result(), f(arg))
def test_run_off_end_of_function_returns_None(self):
with self.create_executor() as executor:
def f():
x = 10
self.assertIs(self.evaluateWithExecutor(f), None)
def test_empty_return_returns_None(self):
with self.create_executor() as executor:
def f():
return
self.assertIs(self.evaluateWithExecutor(f), None)
def test_free_function_is_pyfora_object(self):
def g():
return 10
def f():
return g.__is_pyfora__
self.assertIs(self.evaluateWithExecutor(f), True)
def test_local_function_is_pyfora_object(self):
def f():
def g():
pass
return g.__is_pyfora__
self.assertIs(self.evaluateWithExecutor(f), True)
def test_functions_1(self):
def f(x):
return x + 1
for ix in range(3):
self.equivalentEvaluationTest(f, ix)
def test_functions_2(self):
y = 3
def f(x):
return x + y
for ix in range(3):
self.equivalentEvaluationTest(f, ix)
def test_functions_4(self):
def f(x):
if x < 0:
return x
return x + g(x - 1)
def g(x):
if x < 0:
return x
return x * f(x - 1)
for ix in range(10):
self.equivalentEvaluationTest(f, ix)
def test_functions_mutual_recursion_across_modules(self):
import ufora.FORA.python.PurePython.testModules.MutualRecursionAcrossModules.A as A
for ix in range(4):
self.equivalentEvaluationTest(A.f, ix)
def test_functions_5(self):
def f(x):
def g():
return 1 + x
return g()
for ix in range(-3,0):
self.equivalentEvaluationTest(f, ix)
def test_functions_7(self):
w = 3
def h(x):
return w + 2 * x
def f(x):
if x < 0:
return x
return g(x - 1) + h(x)
def g(x):
if x < 0:
return x
return f(x - 1) + h(x - 1)
for ix in range(10):
self.equivalentEvaluationTest(f, ix)
def test_functions_8(self):
y = 1
z = 2
w = 3
def h(x):
return w + 2 * x
def f(x):
if x < 0:
return x
return y + g(x - 1) + h(x)
def g(x):
if x < 0:
return x
return z * f(x - 1) + h(x - 1)
for ix in range(10):
self.equivalentEvaluationTest(f, ix)
def test_functions_9(self):
y = 2
def h(x, fn):
if x < 0:
return x
return x + y * fn(x - 1)
def f(x):
def g(arg):
if arg < 0:
return x + arg
return x * h(arg - 1, g)
return g
for ix in range(10):
self.equivalentEvaluationTest(f(2), ix)
def test_functions_10(self):
y = 3
def f(x):
if x <= 0:
return x
return x + g(x - 1)
def g(x):
if x <= 0:
return x
return y + f(x - 2) + h(x - 3)
def h(x):
return x + 1
arg = 10
self.equivalentEvaluationTest(f, arg)
self.equivalentEvaluationTest(g, arg)
self.equivalentEvaluationTest(h, arg)
def test_inlineFunction(self):
def inlineFunction(x):
def z(y):
return x+y
return z(10)
for ix in range(4):
self.equivalentEvaluationTest(inlineFunction, ix)
def test_lambdaFunction(self):
def lambdaFunction(x):
z = lambda y: x + y
return z(10)
for ix in range(4):
self.equivalentEvaluationTest(lambdaFunction, ix)
def test_isPrime(self):
def isPrime(p):
x = 2
while x * x <= p:
if p % x == 0:
return 0
x = x + 1
return 0
for ix in range(10):
self.equivalentEvaluationTest(isPrime, ix)
def test_recursiveFunctions_1(self):
def fact(n):
if n == 0:
return 1
return n * fact(n - 1)
for ix in range(5):
self.equivalentEvaluationTest(fact, ix)
def test_recursiveFunctions_2(self):
def fib(n):
if n <= 1:
return n
return fib(n - 1) + fib(n - 2)
for ix in range(5):
self.equivalentEvaluationTest(fib, ix)
def test_functionsWithTheSameName(self):
# inspect, from the python std library, which we use,
# does the right thing for functions.
# the corresponding test for classes fails
def f1():
def f():
return 1
return f
def f2():
def f():
return -1
return f
self.equivalentEvaluationTest(f1())
self.equivalentEvaluationTest(f2())
def test_mutual_recursion(self):
def f(n):
if n < 0:
return n
return g(n - 1)
def g(n):
if n < -1:
return n
return f(n - 2)
self.equivalentEvaluationTest(f, 4)
def test_convert_lambda_external(self):
g = lambda: 10
def f():
return g()
self.equivalentEvaluationTest(f)
def test_convert_lambda_internal(self):
def f():
g = lambda: 10
return g()
self.equivalentEvaluationTest(f)
def test_evaluate_lambda_directly(self):
self.equivalentEvaluationTest(lambda x,y: x+y, 10, 20)
def test_return_lambda(self):
def f():
return lambda: 10
self.assertEqual(self.evaluateWithExecutor(f)(), 10)
def test_member_access(self):
def g():
return 10
def f():
return g().__str__()
self.equivalentEvaluationTest(f)
def test_loopsum(self):
def loopSum(x):
y = 0
while x > 0:
y = y + x
x = x - 1
return y
for ix in range(3):
self.equivalentEvaluationTest(loopSum, ix)
def test_new_calling_convention_1(self):
def f(x):
return x + 1
with self.create_executor() as ufora:
with ufora.remotely.downloadAll():
res = f(2)
self.assertEqual(res, 3)
def test_new_calling_convention_2(self):
def f(x):
return x + 1
with self.create_executor() as ufora:
with ufora.remotely.downloadAll():
res = f(x=2)
self.assertEqual(res, 3)
def test_new_calling_convention_3(self):
def f(x, y, z):
return (x, y, z)
with self.create_executor() as ufora:
with ufora.remotely.downloadAll():
res = f(z=1, y=2, x=3)
self.assertEqual(res, (3,2,1))
def test_new_calling_convention_4(self):
def f(x, y, z):
return (x, y, z)
with self.create_executor() as ufora:
with ufora.remotely.downloadAll():
res = f(3, z=1, y=2)
self.assertEqual(res, (3,2,1))
def test_new_calling_convention_5(self):
def f(x, y, z=1):
return (x, y, z)
with self.create_executor() as ufora:
with ufora.remotely.downloadAll():
res = f(y=2, x=3)
self.assertEqual(res, (3,2,1))
def test_new_calling_convention_6(self):
def f(x, (y, z)):
return (x, y, z)
with self.create_executor() as ufora:
with ufora.remotely.downloadAll():
res = f(3, (2, 1))
self.assertEqual(res, (3,2,1))
def test_new_calling_convention_7(self):
def f(x, y):
return x + y
def h():
return f(y=3,x=1)
self.equivalentEvaluationTest(h)
def test_new_calling_convention_8(self):
def f(x, y=1):
return x + y
def h():
return f(y=3,x=1)
self.equivalentEvaluationTest(h)
| [
1,
529,
9507,
29958,
1137,
2207,
29914,
22051,
29909,
29914,
4691,
29914,
29925,
545,
11980,
29914,
6678,
3057,
29907,
2129,
29889,
2272,
13,
29937,
259,
14187,
1266,
29871,
29906,
29900,
29896,
29945,
501,
1454,
29874,
9266,
29889,
13,
29937,
13,
29937,
259,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
259,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
259,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
539,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
259,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
259,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
259,
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,
259,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
259,
27028,
1090,
278,
19245,
29889,
13,
13,
13,
5215,
11451,
1454,
29874,
29889,
2272,
29909,
303,
29889,
19737,
29909,
303,
7270,
408,
10772,
29909,
303,
7270,
13,
13,
1990,
6680,
3057,
29907,
2129,
29898,
3318,
1125,
13,
1678,
9995,
3057,
4251,
363,
11451,
1454,
29874,
3168,
15945,
29908,
13,
13,
1678,
822,
1243,
29918,
27420,
29918,
2220,
29918,
25699,
29898,
1311,
1125,
13,
4706,
822,
274,
29898,
29894,
29896,
29892,
325,
29906,
1125,
13,
9651,
736,
325,
29896,
718,
325,
29906,
13,
4706,
822,
289,
29898,
29894,
29892,
285,
1125,
13,
9651,
736,
285,
29898,
29894,
29892,
29871,
29947,
29897,
13,
4706,
822,
263,
29898,
29894,
1125,
13,
9651,
736,
289,
29898,
29894,
29892,
274,
29897,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29874,
29892,
29871,
29896,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
4381,
29918,
25699,
29918,
29896,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29874,
29922,
8516,
1125,
13,
9651,
736,
263,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
29871,
29900,
29897,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
6213,
29897,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
448,
29941,
29889,
29941,
29897,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
376,
13424,
1159,
13,
13,
1678,
822,
1243,
29918,
4381,
29918,
25699,
29918,
29906,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29874,
29892,
289,
29922,
29896,
29892,
274,
29922,
8516,
1125,
13,
9651,
736,
313,
29874,
29892,
289,
29892,
274,
29897,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
29871,
29900,
29892,
6213,
29897,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
6213,
29892,
29871,
29906,
29897,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
6213,
29892,
376,
1688,
1159,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
448,
29941,
29889,
29941,
29897,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
376,
1688,
613,
376,
1688,
1159,
13,
13,
13,
1678,
822,
1243,
29918,
7922,
29918,
2220,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
736,
921,
29974,
29896,
13,
4706,
1852,
353,
29871,
29946,
13,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
2279,
3406,
29901,
13,
9651,
285,
29918,
14701,
353,
2279,
3406,
29889,
7922,
29898,
29888,
467,
2914,
580,
13,
9651,
1852,
29918,
14701,
353,
2279,
3406,
29889,
7922,
29898,
1191,
467,
2914,
580,
13,
13,
9651,
620,
29918,
14701,
353,
285,
29918,
14701,
29898,
1191,
29918,
14701,
467,
2914,
580,
13,
9651,
1583,
29889,
9294,
9843,
29898,
690,
29918,
14701,
29889,
517,
7717,
2141,
2914,
3285,
29871,
29945,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
2457,
6678,
29879,
29898,
1311,
1125,
13,
4706,
343,
353,
29871,
29906,
13,
4706,
822,
304,
11609,
29898,
29916,
1125,
13,
9651,
736,
921,
334,
343,
13,
13,
4706,
822,
285,
7295,
13,
9651,
736,
304,
11609,
13,
13,
4706,
881,
3629,
1762,
11609,
353,
1583,
29889,
24219,
403,
3047,
13366,
29898,
29888,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
9344,
3629,
1762,
11609,
29898,
29896,
29900,
511,
304,
11609,
29898,
29896,
29900,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
710,
29898,
9344,
3629,
1762,
11609,
17255,
978,
1649,
511,
851,
29898,
517,
11609,
17255,
978,
1649,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
10772,
29909,
303,
7270,
29889,
657,
4435,
1626,
29898,
9344,
3629,
1762,
11609,
511,
10772,
29909,
303,
7270,
29889,
657,
4435,
1626,
29898,
517,
11609,
29897,
13,
9651,
1723,
13,
13,
13,
1678,
822,
1243,
29918,
7922,
29918,
2388,
9169,
29918,
2220,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
2279,
3406,
29901,
13,
9651,
343,
353,
29871,
29896,
13,
9651,
503,
353,
29871,
29906,
13,
9651,
281,
353,
29871,
29941,
13,
9651,
822,
298,
29898,
29916,
1125,
13,
18884,
736,
281,
718,
29871,
29906,
334,
921,
13,
9651,
822,
285,
29898,
29916,
1125,
13,
18884,
565,
921,
529,
29871,
29900,
29901,
13,
462,
1678,
736,
921,
13,
18884,
736,
343,
718,
330,
29898,
29916,
448,
29871,
29896,
29897,
718,
298,
29898,
29916,
29897,
13,
9651,
822,
330,
29898,
29916,
1125,
13,
18884,
565,
921,
529,
29871,
29900,
29901,
13,
462,
1678,
736,
921,
13,
18884,
736,
503,
334,
285,
29898,
29916,
448,
29871,
29896,
29897,
718,
298,
29898,
29916,
448,
29871,
29896,
29897,
13,
13,
9651,
1852,
353,
29871,
29946,
13,
9651,
620,
29918,
14701,
353,
2279,
3406,
29889,
7892,
29898,
29888,
29892,
1852,
467,
2914,
580,
13,
9651,
1583,
29889,
9294,
9843,
29898,
690,
29918,
14701,
29889,
517,
7717,
2141,
2914,
3285,
285,
29898,
1191,
876,
13,
13,
13,
1678,
822,
1243,
29918,
3389,
29918,
2696,
29918,
355,
29918,
974,
29918,
2220,
29918,
18280,
29918,
8516,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
2279,
3406,
29901,
13,
9651,
822,
285,
7295,
13,
18884,
921,
353,
29871,
29896,
29900,
13,
13,
9651,
1583,
29889,
9294,
3624,
29898,
1311,
29889,
24219,
403,
3047,
13366,
29898,
29888,
511,
6213,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
6310,
29918,
2457,
29918,
18280,
29918,
8516,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
2279,
3406,
29901,
13,
9651,
822,
285,
7295,
13,
18884,
736,
13,
13,
9651,
1583,
29889,
9294,
3624,
29898,
1311,
29889,
24219,
403,
3047,
13366,
29898,
29888,
511,
6213,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
9021,
29918,
2220,
29918,
275,
29918,
2272,
1454,
29874,
29918,
3318,
29898,
1311,
1125,
13,
4706,
822,
330,
7295,
13,
9651,
736,
29871,
29896,
29900,
13,
4706,
822,
285,
7295,
13,
9651,
736,
330,
17255,
275,
29918,
2272,
1454,
29874,
1649,
13,
13,
4706,
1583,
29889,
9294,
3624,
29898,
1311,
29889,
24219,
403,
3047,
13366,
29898,
29888,
511,
5852,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
2997,
29918,
2220,
29918,
275,
29918,
2272,
1454,
29874,
29918,
3318,
29898,
1311,
1125,
13,
4706,
822,
285,
7295,
13,
9651,
822,
330,
7295,
13,
18884,
1209,
13,
9651,
736,
330,
17255,
275,
29918,
2272,
1454,
29874,
1649,
13,
13,
4706,
1583,
29889,
9294,
3624,
29898,
1311,
29889,
24219,
403,
3047,
13366,
29898,
29888,
511,
5852,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
29896,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
736,
921,
718,
29871,
29896,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29941,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
29906,
29898,
1311,
1125,
13,
4706,
343,
353,
29871,
29941,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
736,
921,
718,
343,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29941,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
29946,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
565,
921,
529,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
921,
718,
330,
29898,
29916,
448,
29871,
29896,
29897,
13,
4706,
822,
330,
29898,
29916,
1125,
13,
9651,
565,
921,
529,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
921,
334,
285,
29898,
29916,
448,
29871,
29896,
29897,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29896,
29900,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
6149,
950,
29918,
3757,
1295,
291,
29918,
562,
2124,
29918,
7576,
29898,
1311,
1125,
13,
4706,
1053,
318,
1454,
29874,
29889,
22051,
29909,
29889,
4691,
29889,
29925,
545,
11980,
29889,
1688,
2111,
2540,
29889,
29924,
329,
950,
4789,
1295,
291,
10644,
2124,
2111,
2540,
29889,
29909,
408,
319,
13,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29946,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29909,
29889,
29888,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
29945,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
822,
330,
7295,
13,
18884,
736,
29871,
29896,
718,
921,
13,
9651,
736,
330,
580,
13,
13,
4706,
363,
474,
29916,
297,
3464,
6278,
29941,
29892,
29900,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
29955,
29898,
1311,
1125,
13,
4706,
281,
353,
29871,
29941,
13,
4706,
822,
298,
29898,
29916,
1125,
13,
9651,
736,
281,
718,
29871,
29906,
334,
921,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
565,
921,
529,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
330,
29898,
29916,
448,
29871,
29896,
29897,
718,
298,
29898,
29916,
29897,
13,
4706,
822,
330,
29898,
29916,
1125,
13,
9651,
565,
921,
529,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
285,
29898,
29916,
448,
29871,
29896,
29897,
718,
298,
29898,
29916,
448,
29871,
29896,
29897,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29896,
29900,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
29947,
29898,
1311,
1125,
13,
4706,
343,
353,
29871,
29896,
13,
4706,
503,
353,
29871,
29906,
13,
4706,
281,
353,
29871,
29941,
13,
4706,
822,
298,
29898,
29916,
1125,
13,
9651,
736,
281,
718,
29871,
29906,
334,
921,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
565,
921,
529,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
343,
718,
330,
29898,
29916,
448,
29871,
29896,
29897,
718,
298,
29898,
29916,
29897,
13,
4706,
822,
330,
29898,
29916,
1125,
13,
9651,
565,
921,
529,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
503,
334,
285,
29898,
29916,
448,
29871,
29896,
29897,
718,
298,
29898,
29916,
448,
29871,
29896,
29897,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29896,
29900,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
29929,
29898,
1311,
1125,
13,
4706,
343,
353,
29871,
29906,
13,
4706,
822,
298,
29898,
29916,
29892,
7876,
1125,
13,
9651,
565,
921,
529,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
921,
718,
343,
334,
7876,
29898,
29916,
448,
29871,
29896,
29897,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
822,
330,
29898,
1191,
1125,
13,
18884,
565,
1852,
529,
29871,
29900,
29901,
13,
462,
1678,
736,
921,
718,
1852,
13,
18884,
736,
921,
334,
298,
29898,
1191,
448,
29871,
29896,
29892,
330,
29897,
13,
9651,
736,
330,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29896,
29900,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29898,
29906,
511,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
12171,
29918,
29896,
29900,
29898,
1311,
1125,
13,
4706,
343,
353,
29871,
29941,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
565,
921,
5277,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
921,
718,
330,
29898,
29916,
448,
29871,
29896,
29897,
13,
4706,
822,
330,
29898,
29916,
1125,
13,
9651,
565,
921,
5277,
29871,
29900,
29901,
13,
18884,
736,
921,
13,
9651,
736,
343,
718,
285,
29898,
29916,
448,
29871,
29906,
29897,
718,
298,
29898,
29916,
448,
29871,
29941,
29897,
13,
4706,
822,
298,
29898,
29916,
1125,
13,
9651,
736,
921,
718,
29871,
29896,
13,
13,
4706,
1852,
353,
29871,
29896,
29900,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
1852,
29897,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29887,
29892,
1852,
29897,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29882,
29892,
1852,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
14764,
6678,
29898,
1311,
1125,
13,
4706,
822,
10583,
6678,
29898,
29916,
1125,
13,
9651,
822,
503,
29898,
29891,
1125,
13,
18884,
736,
921,
29974,
29891,
13,
9651,
736,
503,
29898,
29896,
29900,
29897,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29946,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
14764,
6678,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
2892,
6678,
29898,
1311,
1125,
13,
4706,
822,
14013,
6678,
29898,
29916,
1125,
13,
9651,
503,
353,
14013,
343,
29901,
921,
718,
343,
13,
9651,
736,
503,
29898,
29896,
29900,
29897,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29946,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
2892,
6678,
29892,
474,
29916,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
275,
4040,
603,
29898,
1311,
1125,
13,
4706,
822,
338,
4040,
603,
29898,
29886,
1125,
13,
9651,
921,
353,
29871,
29906,
13,
9651,
1550,
921,
334,
921,
5277,
282,
29901,
13,
18884,
565,
282,
1273,
921,
1275,
29871,
29900,
29901,
13,
462,
1678,
736,
29871,
29900,
13,
18884,
921,
353,
921,
718,
29871,
29896,
13,
9651,
736,
29871,
29900,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29896,
29900,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
275,
4040,
603,
29892,
474,
29916,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3757,
25397,
6678,
29879,
29918,
29896,
29898,
1311,
1125,
13,
4706,
822,
2114,
29898,
29876,
1125,
13,
9651,
565,
302,
1275,
29871,
29900,
29901,
13,
18884,
736,
29871,
29896,
13,
9651,
736,
302,
334,
2114,
29898,
29876,
448,
29871,
29896,
29897,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29945,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
17028,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
3757,
25397,
6678,
29879,
29918,
29906,
29898,
1311,
1125,
13,
4706,
822,
18755,
29898,
29876,
1125,
13,
9651,
565,
302,
5277,
29871,
29896,
29901,
13,
18884,
736,
302,
13,
13,
9651,
736,
18755,
29898,
29876,
448,
29871,
29896,
29897,
718,
18755,
29898,
29876,
448,
29871,
29906,
29897,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29945,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
747,
29892,
474,
29916,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
12171,
3047,
1576,
29903,
420,
1170,
29898,
1311,
1125,
13,
4706,
396,
16096,
29892,
515,
278,
3017,
3659,
3489,
29892,
607,
591,
671,
29892,
13,
4706,
396,
947,
278,
1492,
2655,
363,
3168,
29889,
13,
4706,
396,
278,
6590,
1243,
363,
4413,
8465,
13,
4706,
822,
285,
29896,
7295,
13,
9651,
822,
285,
7295,
13,
18884,
736,
29871,
29896,
13,
9651,
736,
285,
13,
4706,
822,
285,
29906,
7295,
13,
9651,
822,
285,
7295,
13,
18884,
736,
448,
29896,
13,
9651,
736,
285,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29896,
3101,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29906,
3101,
13,
13,
13,
1678,
822,
1243,
29918,
6149,
950,
29918,
3757,
1295,
291,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29876,
1125,
13,
9651,
565,
302,
529,
29871,
29900,
29901,
13,
18884,
736,
302,
13,
9651,
736,
330,
29898,
29876,
448,
29871,
29896,
29897,
13,
4706,
822,
330,
29898,
29876,
1125,
13,
9651,
565,
302,
529,
448,
29896,
29901,
13,
18884,
736,
302,
13,
9651,
736,
285,
29898,
29876,
448,
29871,
29906,
29897,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29892,
29871,
29946,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
13441,
29918,
2892,
29918,
23176,
29898,
1311,
1125,
13,
4706,
330,
353,
14013,
29901,
29871,
29896,
29900,
13,
4706,
822,
285,
7295,
13,
9651,
736,
330,
580,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29897,
13,
13,
1678,
822,
1243,
29918,
13441,
29918,
2892,
29918,
7564,
29898,
1311,
1125,
13,
4706,
822,
285,
7295,
13,
9651,
330,
353,
14013,
29901,
29871,
29896,
29900,
13,
9651,
736,
330,
580,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29897,
13,
13,
1678,
822,
1243,
29918,
24219,
403,
29918,
2892,
29918,
11851,
368,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
2892,
921,
29892,
29891,
29901,
921,
29974,
29891,
29892,
29871,
29896,
29900,
29892,
29871,
29906,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
2457,
29918,
2892,
29898,
1311,
1125,
13,
4706,
822,
285,
7295,
13,
9651,
736,
14013,
29901,
29871,
29896,
29900,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
24219,
403,
3047,
13366,
29898,
29888,
29897,
3285,
29871,
29896,
29900,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
14242,
29918,
5943,
29898,
1311,
1125,
13,
4706,
822,
330,
7295,
13,
9651,
736,
29871,
29896,
29900,
13,
4706,
822,
285,
7295,
13,
9651,
736,
330,
2141,
1649,
710,
1649,
580,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29888,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7888,
2083,
29898,
1311,
1125,
13,
4706,
822,
2425,
11139,
29898,
29916,
1125,
13,
9651,
343,
353,
29871,
29900,
13,
9651,
1550,
921,
1405,
29871,
29900,
29901,
13,
18884,
343,
353,
343,
718,
921,
13,
18884,
921,
353,
921,
448,
29871,
29896,
13,
9651,
736,
343,
13,
13,
4706,
363,
474,
29916,
297,
3464,
29898,
29941,
1125,
13,
9651,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
7888,
11139,
29892,
474,
29916,
29897,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
4804,
292,
29918,
535,
7316,
29918,
29896,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
736,
921,
718,
29871,
29896,
13,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
318,
1454,
29874,
29901,
13,
9651,
411,
318,
1454,
29874,
29889,
1745,
327,
873,
29889,
10382,
3596,
7295,
13,
18884,
620,
353,
285,
29898,
29906,
29897,
13,
13,
9651,
1583,
29889,
9294,
9843,
29898,
690,
29892,
29871,
29941,
29897,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
4804,
292,
29918,
535,
7316,
29918,
29906,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
1125,
13,
9651,
736,
921,
718,
29871,
29896,
13,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
318,
1454,
29874,
29901,
13,
9651,
411,
318,
1454,
29874,
29889,
1745,
327,
873,
29889,
10382,
3596,
7295,
13,
18884,
620,
353,
285,
29898,
29916,
29922,
29906,
29897,
13,
13,
9651,
1583,
29889,
9294,
9843,
29898,
690,
29892,
29871,
29941,
29897,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
4804,
292,
29918,
535,
7316,
29918,
29941,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
29892,
343,
29892,
503,
1125,
13,
9651,
736,
313,
29916,
29892,
343,
29892,
503,
29897,
13,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
318,
1454,
29874,
29901,
13,
9651,
411,
318,
1454,
29874,
29889,
1745,
327,
873,
29889,
10382,
3596,
7295,
13,
18884,
620,
353,
285,
29898,
29920,
29922,
29896,
29892,
343,
29922,
29906,
29892,
921,
29922,
29941,
29897,
13,
13,
9651,
1583,
29889,
9294,
9843,
29898,
690,
29892,
313,
29941,
29892,
29906,
29892,
29896,
876,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
4804,
292,
29918,
535,
7316,
29918,
29946,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
29892,
343,
29892,
503,
1125,
13,
9651,
736,
313,
29916,
29892,
343,
29892,
503,
29897,
13,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
318,
1454,
29874,
29901,
13,
9651,
411,
318,
1454,
29874,
29889,
1745,
327,
873,
29889,
10382,
3596,
7295,
13,
18884,
620,
353,
285,
29898,
29941,
29892,
503,
29922,
29896,
29892,
343,
29922,
29906,
29897,
13,
13,
9651,
1583,
29889,
9294,
9843,
29898,
690,
29892,
313,
29941,
29892,
29906,
29892,
29896,
876,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
4804,
292,
29918,
535,
7316,
29918,
29945,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
29892,
343,
29892,
503,
29922,
29896,
1125,
13,
9651,
736,
313,
29916,
29892,
343,
29892,
503,
29897,
13,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
318,
1454,
29874,
29901,
13,
9651,
411,
318,
1454,
29874,
29889,
1745,
327,
873,
29889,
10382,
3596,
7295,
13,
18884,
620,
353,
285,
29898,
29891,
29922,
29906,
29892,
921,
29922,
29941,
29897,
13,
13,
9651,
1583,
29889,
9294,
9843,
29898,
690,
29892,
313,
29941,
29892,
29906,
29892,
29896,
876,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
4804,
292,
29918,
535,
7316,
29918,
29953,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
29892,
313,
29891,
29892,
503,
22164,
13,
9651,
736,
313,
29916,
29892,
343,
29892,
503,
29897,
13,
13,
4706,
411,
1583,
29889,
3258,
29918,
4258,
3406,
580,
408,
318,
1454,
29874,
29901,
13,
9651,
411,
318,
1454,
29874,
29889,
1745,
327,
873,
29889,
10382,
3596,
7295,
13,
18884,
620,
353,
285,
29898,
29941,
29892,
313,
29906,
29892,
29871,
29896,
876,
13,
13,
9651,
1583,
29889,
9294,
9843,
29898,
690,
29892,
313,
29941,
29892,
29906,
29892,
29896,
876,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
4804,
292,
29918,
535,
7316,
29918,
29955,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
29892,
343,
1125,
13,
9651,
736,
921,
718,
343,
13,
13,
4706,
822,
298,
7295,
13,
9651,
736,
285,
29898,
29891,
29922,
29941,
29892,
29916,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29882,
29897,
13,
13,
1678,
822,
1243,
29918,
1482,
29918,
4804,
292,
29918,
535,
7316,
29918,
29947,
29898,
1311,
1125,
13,
4706,
822,
285,
29898,
29916,
29892,
343,
29922,
29896,
1125,
13,
9651,
736,
921,
718,
343,
13,
13,
4706,
822,
298,
7295,
13,
9651,
736,
285,
29898,
29891,
29922,
29941,
29892,
29916,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
1686,
27445,
29923,
4387,
362,
3057,
29898,
29882,
29897,
13,
2
] |
tests/test_cmake_parser.py | RichardRohac/bdemeta | 0 | 134003 | # tests.test_cmake_parser
from io import StringIO
from unittest import TestCase
from tests.cmake_parser import lex, find_command, parse_if, parse
def mk_cmd(command, *args):
return (command, list(args))
def call_parse_if(predicate, *cmds):
return parse_if(predicate, iter(cmds))
def call_parse(*cmds):
return parse(iter(cmds))
class TestLex(TestCase):
def test_nested_command_error(self):
text = StringIO("if(if())")
with self.assertRaises(RuntimeError):
list(lex(text)) # consume the generator
def test_unmatched_close_paren_error(self):
text = StringIO("if)")
with self.assertRaises(RuntimeError):
list(lex(text)) # consume the generator
class TestFindCommand(TestCase):
def test_command_not_found_error(self):
text = StringIO("if()")
commands = lex(text)
with self.assertRaises(LookupError):
find_command(commands, "add_library")
def test_ambiguous_command_error(self):
text = StringIO("if()\nif()")
commands = lex(text)
with self.assertRaises(RuntimeError):
find_command(commands, "if")
class TestParseIf(TestCase):
def test_empty_if(self):
node = call_parse_if('check', mk_cmd('endif'))
assert(('check', [], []) == node)
def test_one_command(self):
add_lib = mk_cmd('add_library')
node = call_parse_if('check', add_lib, mk_cmd('endif'))
assert(('check', [add_lib], []) == node)
def test_empty_with_empty_else(self):
node = call_parse_if('check', mk_cmd('else'), mk_cmd('endif'))
assert(('check', [], []) == node)
def test_if_else(self):
add_lib = mk_cmd('add_library')
add_exe = mk_cmd('add_executable')
node = call_parse_if('check',
add_lib,
mk_cmd('else'),
add_exe,
mk_cmd('endif'))
assert(('check', [add_lib], [add_exe]) == node)
def test_nested_if(self):
foo = mk_cmd('foo')
bar = mk_cmd('bar')
bam = mk_cmd('bam')
baz = mk_cmd('baz')
node = call_parse_if('check',
foo,
mk_cmd('if'),
bar,
mk_cmd('else'),
bam,
mk_cmd('endif'),
baz,
mk_cmd('endif'))
assert(('check', [foo, ([], [bar], [bam]), baz], []) == node)
def test_unmatched_endif_error(self):
with self.assertRaises(RuntimeError):
call_parse_if('check', mk_cmd('add_library'))
class TestParse(TestCase):
def test_empty(self):
node = call_parse()
assert([] == node)
def test_one_non_if_command(self):
add_lib = mk_cmd('add_library')
node = call_parse(add_lib)
assert([add_lib] == node)
def test_two_non_if_commands(self):
add_lib = mk_cmd('add_library')
add_exe = mk_cmd('add_executable')
node = call_parse(add_lib, add_exe)
assert([add_lib, add_exe] == node)
def test_command_with_if(self):
add_lib = mk_cmd('add_library')
add_exe = mk_cmd('add_executable')
node = call_parse(add_lib,
mk_cmd('if', 'c'),
add_exe,
mk_cmd('endif'))
assert([add_lib, (['c'], [add_exe], [])] == node)
def test_command_with_if_else(self):
add_lib = mk_cmd('add_library')
add_exe = mk_cmd('add_executable')
include = mk_cmd('include')
node = call_parse(add_lib,
mk_cmd('if', 'c'),
add_exe,
mk_cmd('else'),
include,
mk_cmd('endif'))
assert([add_lib, (['c'], [add_exe], [include])] == node)
| [
1,
396,
6987,
29889,
1688,
29918,
29883,
5675,
29918,
16680,
13,
13,
3166,
12013,
539,
1053,
1714,
5971,
13,
3166,
443,
27958,
1053,
4321,
8259,
13,
13,
3166,
6987,
29889,
29883,
5675,
29918,
16680,
1053,
19566,
29892,
1284,
29918,
6519,
29892,
6088,
29918,
361,
29892,
6088,
13,
13,
1753,
14690,
29918,
9006,
29898,
6519,
29892,
334,
5085,
1125,
13,
1678,
736,
313,
6519,
29892,
1051,
29898,
5085,
876,
13,
13,
1753,
1246,
29918,
5510,
29918,
361,
29898,
11965,
9593,
29892,
334,
9006,
29879,
1125,
13,
1678,
736,
6088,
29918,
361,
29898,
11965,
9593,
29892,
4256,
29898,
9006,
29879,
876,
13,
13,
1753,
1246,
29918,
5510,
10456,
9006,
29879,
1125,
13,
1678,
736,
6088,
29898,
1524,
29898,
9006,
29879,
876,
13,
13,
1990,
4321,
29931,
735,
29898,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
27420,
29918,
6519,
29918,
2704,
29898,
1311,
1125,
13,
4706,
1426,
353,
1714,
5971,
703,
361,
29898,
361,
3101,
1159,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
7944,
2392,
1125,
13,
9651,
1051,
29898,
2506,
29898,
726,
876,
396,
29151,
278,
15299,
13,
13,
1678,
822,
1243,
29918,
348,
4352,
287,
29918,
5358,
29918,
862,
264,
29918,
2704,
29898,
1311,
1125,
13,
4706,
1426,
353,
1714,
5971,
703,
361,
25760,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
7944,
2392,
1125,
13,
9651,
1051,
29898,
2506,
29898,
726,
876,
396,
29151,
278,
15299,
13,
13,
1990,
4321,
12542,
6255,
29898,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
6519,
29918,
1333,
29918,
11940,
29918,
2704,
29898,
1311,
1125,
13,
4706,
1426,
353,
1714,
5971,
703,
361,
580,
1159,
13,
4706,
8260,
353,
19566,
29898,
726,
29897,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
14959,
786,
2392,
1125,
13,
9651,
1284,
29918,
6519,
29898,
26381,
29892,
376,
1202,
29918,
5258,
1159,
13,
13,
1678,
822,
1243,
29918,
14727,
681,
29918,
6519,
29918,
2704,
29898,
1311,
1125,
13,
4706,
1426,
353,
1714,
5971,
703,
361,
580,
29905,
29876,
361,
580,
1159,
13,
4706,
8260,
353,
19566,
29898,
726,
29897,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
7944,
2392,
1125,
13,
9651,
1284,
29918,
6519,
29898,
26381,
29892,
376,
361,
1159,
13,
13,
1990,
4321,
12914,
3644,
29898,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
6310,
29918,
361,
29898,
1311,
1125,
13,
4706,
2943,
353,
1246,
29918,
5510,
29918,
361,
877,
3198,
742,
14690,
29918,
9006,
877,
15224,
8785,
13,
4706,
4974,
29898,
877,
3198,
742,
19997,
518,
2314,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
650,
29918,
6519,
29898,
1311,
1125,
13,
4706,
788,
29918,
1982,
353,
14690,
29918,
9006,
877,
1202,
29918,
5258,
1495,
13,
4706,
2943,
1678,
353,
1246,
29918,
5510,
29918,
361,
877,
3198,
742,
788,
29918,
1982,
29892,
14690,
29918,
9006,
877,
15224,
8785,
13,
4706,
4974,
29898,
877,
3198,
742,
518,
1202,
29918,
1982,
1402,
518,
2314,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
6310,
29918,
2541,
29918,
6310,
29918,
2870,
29898,
1311,
1125,
13,
4706,
2943,
1678,
353,
1246,
29918,
5510,
29918,
361,
877,
3198,
742,
14690,
29918,
9006,
877,
2870,
5477,
14690,
29918,
9006,
877,
15224,
8785,
13,
4706,
4974,
29898,
877,
3198,
742,
19997,
518,
2314,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
361,
29918,
2870,
29898,
1311,
1125,
13,
4706,
788,
29918,
1982,
353,
14690,
29918,
9006,
877,
1202,
29918,
5258,
1495,
13,
4706,
788,
29918,
8097,
353,
14690,
29918,
9006,
877,
1202,
29918,
4258,
9246,
1495,
13,
4706,
2943,
1678,
353,
1246,
29918,
5510,
29918,
361,
877,
3198,
742,
13,
462,
18884,
788,
29918,
1982,
29892,
13,
462,
18884,
14690,
29918,
9006,
877,
2870,
5477,
13,
462,
18884,
788,
29918,
8097,
29892,
13,
462,
18884,
14690,
29918,
9006,
877,
15224,
8785,
13,
4706,
4974,
29898,
877,
3198,
742,
518,
1202,
29918,
1982,
1402,
518,
1202,
29918,
8097,
2314,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
27420,
29918,
361,
29898,
1311,
1125,
13,
4706,
7953,
29871,
353,
14690,
29918,
9006,
877,
5431,
1495,
13,
4706,
2594,
29871,
353,
14690,
29918,
9006,
877,
1646,
1495,
13,
4706,
289,
314,
29871,
353,
14690,
29918,
9006,
877,
29890,
314,
1495,
13,
4706,
12741,
29871,
353,
14690,
29918,
9006,
877,
27975,
1495,
13,
4706,
2943,
353,
1246,
29918,
5510,
29918,
361,
877,
3198,
742,
13,
462,
632,
7953,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
361,
5477,
13,
462,
632,
2594,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
2870,
5477,
13,
462,
632,
289,
314,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
15224,
5477,
13,
462,
632,
12741,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
15224,
8785,
13,
4706,
4974,
29898,
877,
3198,
742,
518,
5431,
29892,
9310,
1402,
518,
1646,
1402,
518,
29890,
314,
11724,
12741,
1402,
518,
2314,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
348,
4352,
287,
29918,
15224,
29918,
2704,
29898,
1311,
1125,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
7944,
2392,
1125,
13,
9651,
1246,
29918,
5510,
29918,
361,
877,
3198,
742,
14690,
29918,
9006,
877,
1202,
29918,
5258,
8785,
13,
13,
1990,
4321,
12914,
29898,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
6310,
29898,
1311,
1125,
13,
4706,
2943,
353,
1246,
29918,
5510,
580,
13,
4706,
4974,
29898,
2636,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
650,
29918,
5464,
29918,
361,
29918,
6519,
29898,
1311,
1125,
13,
4706,
788,
29918,
1982,
353,
14690,
29918,
9006,
877,
1202,
29918,
5258,
1495,
13,
4706,
2943,
1678,
353,
1246,
29918,
5510,
29898,
1202,
29918,
1982,
29897,
13,
4706,
4974,
4197,
1202,
29918,
1982,
29962,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
10184,
29918,
5464,
29918,
361,
29918,
26381,
29898,
1311,
1125,
13,
4706,
788,
29918,
1982,
353,
14690,
29918,
9006,
877,
1202,
29918,
5258,
1495,
13,
4706,
788,
29918,
8097,
353,
14690,
29918,
9006,
877,
1202,
29918,
4258,
9246,
1495,
13,
4706,
2943,
1678,
353,
1246,
29918,
5510,
29898,
1202,
29918,
1982,
29892,
788,
29918,
8097,
29897,
13,
4706,
4974,
4197,
1202,
29918,
1982,
29892,
788,
29918,
8097,
29962,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
6519,
29918,
2541,
29918,
361,
29898,
1311,
1125,
13,
4706,
788,
29918,
1982,
353,
14690,
29918,
9006,
877,
1202,
29918,
5258,
1495,
13,
4706,
788,
29918,
8097,
353,
14690,
29918,
9006,
877,
1202,
29918,
4258,
9246,
1495,
13,
4706,
2943,
1678,
353,
1246,
29918,
5510,
29898,
1202,
29918,
1982,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
361,
742,
525,
29883,
5477,
13,
462,
632,
788,
29918,
8097,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
15224,
8785,
13,
4706,
4974,
4197,
1202,
29918,
1982,
29892,
313,
1839,
29883,
7464,
518,
1202,
29918,
8097,
1402,
518,
2314,
29962,
1275,
2943,
29897,
13,
13,
1678,
822,
1243,
29918,
6519,
29918,
2541,
29918,
361,
29918,
2870,
29898,
1311,
1125,
13,
4706,
788,
29918,
1982,
353,
14690,
29918,
9006,
877,
1202,
29918,
5258,
1495,
13,
4706,
788,
29918,
8097,
353,
14690,
29918,
9006,
877,
1202,
29918,
4258,
9246,
1495,
13,
4706,
3160,
353,
14690,
29918,
9006,
877,
2856,
1495,
13,
4706,
2943,
1678,
353,
1246,
29918,
5510,
29898,
1202,
29918,
1982,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
361,
742,
525,
29883,
5477,
13,
462,
632,
788,
29918,
8097,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
2870,
5477,
13,
462,
632,
3160,
29892,
13,
462,
632,
14690,
29918,
9006,
877,
15224,
8785,
13,
4706,
4974,
4197,
1202,
29918,
1982,
29892,
313,
1839,
29883,
7464,
518,
1202,
29918,
8097,
1402,
518,
2856,
2314,
29962,
1275,
2943,
29897,
13,
13,
2
] |
Programmers/Lv.1/Lotto_best_worst.py | kangjunseo/C- | 2 | 69655 | def solution(lottos, win_nums):
answer = []
zeros=0
for i in lottos:
if(i==0) : zeros+=1
correct = list(set(lottos).intersection(set(win_nums)))
_dict = {6:1,5:2,4:3,3:4,2:5,1:6,0:6}
answer.append(_dict[len(correct)+zeros])
answer.append(_dict[len(correct)])
return answer
| [
1,
822,
1650,
29898,
29880,
1501,
359,
29892,
5401,
29918,
1949,
29879,
1125,
13,
1678,
1234,
353,
5159,
13,
1678,
24786,
29922,
29900,
13,
1678,
363,
474,
297,
301,
1501,
359,
29901,
13,
4706,
565,
29898,
29875,
1360,
29900,
29897,
584,
24786,
23661,
29896,
13,
1678,
1959,
353,
1051,
29898,
842,
29898,
29880,
1501,
359,
467,
1639,
2042,
29898,
842,
29898,
5080,
29918,
1949,
29879,
4961,
13,
13,
1678,
903,
8977,
353,
426,
29953,
29901,
29896,
29892,
29945,
29901,
29906,
29892,
29946,
29901,
29941,
29892,
29941,
29901,
29946,
29892,
29906,
29901,
29945,
29892,
29896,
29901,
29953,
29892,
29900,
29901,
29953,
29913,
13,
1678,
1234,
29889,
4397,
7373,
8977,
29961,
2435,
29898,
15728,
7240,
3298,
359,
2314,
13,
1678,
1234,
29889,
4397,
7373,
8977,
29961,
2435,
29898,
15728,
29897,
2314,
13,
1678,
736,
1234,
13,
268,
13,
2
] |
NoChannelBot/core/models/user.py | tolbiluha/NoChannelBot | 7 | 196654 | from typing import Optional
from pydantic import BaseModel
class UserModel(BaseModel):
id: int
first_name: str
last_name: Optional[str]
username: Optional[str]
language_code: Optional[str]
| [
1,
515,
19229,
1053,
28379,
13,
13,
3166,
282,
2941,
7716,
1053,
7399,
3195,
13,
13,
13,
1990,
4911,
3195,
29898,
5160,
3195,
1125,
13,
1678,
1178,
29901,
938,
13,
1678,
937,
29918,
978,
29901,
851,
13,
1678,
1833,
29918,
978,
29901,
28379,
29961,
710,
29962,
13,
1678,
8952,
29901,
28379,
29961,
710,
29962,
13,
1678,
4086,
29918,
401,
29901,
28379,
29961,
710,
29962,
13,
2
] |
0063.unqiue_paths_II/solution.py | WZMJ/Algorithms | 5 | 163074 | from typing import List
class Solution:
def unique_paths_with_obstacle(self, obstacle_grid: List[List[int]]) -> int:
"""
二维数组 关键点在于 obstacle_grid[i][j] = obstacle_grid[i-1][j] + obstacle_grid[i][j-1]
如果遇到障碍1,后续都为0
"""
if obstacle_grid[0][0]: # 出发点是障碍
return 0
down = len(obstacle_grid)
right = len(obstacle_grid[0])
obstacle_grid[0][0] = 1
# 判断第一行的情况
for i in range(1, right):
obstacle_grid[0][i] = obstacle_grid[0][i - 1] if obstacle_grid[0][i] == 0 else 0
# 判断第一列的情况
for i in range(1, down):
obstacle_grid[i][0] = obstacle_grid[i - 1][0] if obstacle_grid[i][0] == 0 else 0
# 从(1,1)开始将上和左的次数相加
for i in range(1, down):
for j in range(1, right):
if obstacle_grid[i][j] == 1:
obstacle_grid[i][j] = 0
else:
obstacle_grid[i][j] = obstacle_grid[i][j - 1] + obstacle_grid[i - 1][j]
return obstacle_grid[down - 1][right - 1]
if __name__ == "__main__":
grid = [[0, 0, 0], [0, 1, 0], [0, 0, 0]]
assert Solution().unique_paths_with_obstacle(grid) == 2
grid = [[0, 0, 0, 1], [0, 1, 0, 0], [0, 0, 0, 0]]
assert Solution().unique_paths_with_obstacle(grid) == 3
| [
1,
515,
19229,
1053,
2391,
13,
13,
13,
1990,
24380,
29901,
13,
1678,
822,
5412,
29918,
24772,
29918,
2541,
29918,
711,
303,
6436,
29898,
1311,
29892,
14979,
6436,
29918,
7720,
29901,
2391,
29961,
1293,
29961,
524,
24960,
1599,
938,
29901,
13,
4706,
9995,
13,
308,
30685,
234,
190,
183,
30354,
31263,
29871,
31057,
236,
151,
177,
30940,
30505,
30909,
14979,
6436,
29918,
7720,
29961,
29875,
3816,
29926,
29962,
353,
14979,
6436,
29918,
7720,
29961,
29875,
29899,
29896,
3816,
29926,
29962,
718,
14979,
6436,
29918,
7720,
29961,
29875,
3816,
29926,
29899,
29896,
29962,
13,
308,
30847,
30801,
236,
132,
138,
30780,
236,
157,
159,
234,
165,
144,
29896,
30214,
30822,
234,
190,
176,
30769,
30573,
29900,
13,
4706,
9995,
13,
4706,
565,
14979,
6436,
29918,
7720,
29961,
29900,
3816,
29900,
5387,
29871,
396,
29871,
30544,
30910,
30940,
30392,
236,
157,
159,
234,
165,
144,
13,
9651,
736,
29871,
29900,
13,
13,
4706,
1623,
353,
7431,
29898,
711,
303,
6436,
29918,
7720,
29897,
13,
4706,
1492,
353,
7431,
29898,
711,
303,
6436,
29918,
7720,
29961,
29900,
2314,
13,
13,
4706,
14979,
6436,
29918,
7720,
29961,
29900,
3816,
29900,
29962,
353,
29871,
29896,
13,
13,
4706,
396,
29871,
31791,
31683,
30622,
30287,
30448,
30210,
30993,
232,
137,
184,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
1492,
1125,
13,
9651,
14979,
6436,
29918,
7720,
29961,
29900,
3816,
29875,
29962,
353,
14979,
6436,
29918,
7720,
29961,
29900,
3816,
29875,
448,
29871,
29896,
29962,
565,
14979,
6436,
29918,
7720,
29961,
29900,
3816,
29875,
29962,
1275,
29871,
29900,
1683,
29871,
29900,
13,
13,
4706,
396,
29871,
31791,
31683,
30622,
30287,
31025,
30210,
30993,
232,
137,
184,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
1623,
1125,
13,
9651,
14979,
6436,
29918,
7720,
29961,
29875,
3816,
29900,
29962,
353,
14979,
6436,
29918,
7720,
29961,
29875,
448,
29871,
29896,
3816,
29900,
29962,
565,
14979,
6436,
29918,
7720,
29961,
29875,
3816,
29900,
29962,
1275,
29871,
29900,
1683,
29871,
29900,
13,
13,
4706,
396,
29871,
31594,
29898,
29896,
29892,
29896,
29897,
31026,
31020,
30998,
30429,
30503,
31651,
30210,
30936,
30354,
30990,
30666,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
1623,
1125,
13,
9651,
363,
432,
297,
3464,
29898,
29896,
29892,
1492,
1125,
13,
18884,
565,
14979,
6436,
29918,
7720,
29961,
29875,
3816,
29926,
29962,
1275,
29871,
29896,
29901,
13,
462,
1678,
14979,
6436,
29918,
7720,
29961,
29875,
3816,
29926,
29962,
353,
29871,
29900,
13,
18884,
1683,
29901,
13,
462,
1678,
14979,
6436,
29918,
7720,
29961,
29875,
3816,
29926,
29962,
353,
14979,
6436,
29918,
7720,
29961,
29875,
3816,
29926,
448,
29871,
29896,
29962,
718,
14979,
6436,
29918,
7720,
29961,
29875,
448,
29871,
29896,
3816,
29926,
29962,
13,
13,
4706,
736,
14979,
6436,
29918,
7720,
29961,
3204,
448,
29871,
29896,
3816,
1266,
448,
29871,
29896,
29962,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
6856,
353,
5519,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
5262,
13,
1678,
4974,
24380,
2141,
13092,
29918,
24772,
29918,
2541,
29918,
711,
303,
6436,
29898,
7720,
29897,
1275,
29871,
29906,
13,
13,
1678,
6856,
353,
5519,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
1402,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
5262,
13,
1678,
4974,
24380,
2141,
13092,
29918,
24772,
29918,
2541,
29918,
711,
303,
6436,
29898,
7720,
29897,
1275,
29871,
29941,
13,
2
] |
blog/migrations/0007_articlephotoreport_main.py | gda2048/thefirst | 5 | 69947 | # Generated by Django 2.2.3 on 2019-07-24 10:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0006_auto_20190723_1502'),
]
operations = [
migrations.AddField(
model_name='articlephotoreport',
name='main',
field=models.BooleanField(default=False, help_text='Если отмечено несколько картинок, то выбирается любая',
verbose_name='Отображать в preview'),
),
]
| [
1,
396,
3251,
630,
491,
15337,
29871,
29906,
29889,
29906,
29889,
29941,
373,
29871,
29906,
29900,
29896,
29929,
29899,
29900,
29955,
29899,
29906,
29946,
29871,
29896,
29900,
29901,
29896,
29906,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
7312,
742,
525,
29900,
29900,
29900,
29953,
29918,
6921,
29918,
29906,
29900,
29896,
29929,
29900,
29955,
29906,
29941,
29918,
29896,
29945,
29900,
29906,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
7914,
561,
327,
487,
637,
742,
13,
9651,
1024,
2433,
3396,
742,
13,
9651,
1746,
29922,
9794,
29889,
18146,
3073,
29898,
4381,
29922,
8824,
29892,
1371,
29918,
726,
2433,
30070,
12068,
28032,
1093,
570,
20846,
10766,
811,
13738,
29892,
2721,
2771,
20338,
4364,
6331,
3102,
29970,
742,
13,
462,
462,
418,
26952,
29918,
978,
2433,
30038,
702,
8355,
2711,
1413,
490,
25267,
5477,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
examples/evaluate_sequence_labelling.py | CLARIN-PL/embeddings | 33 | 61697 | import pprint
from pathlib import Path
from typing import Optional
import typer
from embeddings.defaults import RESULTS_PATH
from embeddings.evaluator.sequence_labeling_evaluator import SequenceLabelingEvaluator
from embeddings.pipeline.flair_sequence_labeling import FlairSequenceLabelingPipeline
app = typer.Typer()
def run(
embedding_name: str = typer.Option(
"allegro/herbert-base-cased", help="Hugging Face embedding model name or path."
),
dataset_name: str = typer.Option(
"clarin-pl/kpwr-ner", help="Hugging Face dataset name or path."
),
input_column_name: str = typer.Option(
"tokens", help="Column name that contains text to classify."
),
target_column_name: str = typer.Option(
"ner", help="Column name that contains tag labels for POS tagging."
),
root: str = typer.Option(RESULTS_PATH.joinpath("pos_tagging")),
hidden_size: int = typer.Option(256, help="Number of hidden states in RNN."),
evaluation_mode: SequenceLabelingEvaluator.EvaluationMode = typer.Option(
SequenceLabelingEvaluator.EvaluationMode.CONLL,
help="Evaluation mode. Supported modes: [unit, conll, strict].",
),
tagging_scheme: Optional[SequenceLabelingEvaluator.TaggingScheme] = typer.Option(
None, help="Tagging scheme. Supported schemes: [IOB1, IOB2, IOE1, IOE2, IOBES, BILOU]"
),
) -> None:
typer.echo(pprint.pformat(locals()))
output_path = Path(root, embedding_name, dataset_name)
output_path.mkdir(parents=True, exist_ok=True)
pipeline = FlairSequenceLabelingPipeline(
embedding_name,
dataset_name,
input_column_name,
target_column_name,
output_path,
hidden_size,
evaluation_mode,
tagging_scheme,
)
result = pipeline.run()
typer.echo(pprint.pformat(result))
typer.run(run)
| [
1,
1053,
282,
2158,
13,
3166,
2224,
1982,
1053,
10802,
13,
3166,
19229,
1053,
28379,
13,
13,
5215,
7911,
546,
13,
13,
3166,
8297,
29881,
886,
29889,
4381,
29879,
1053,
390,
2890,
8647,
29903,
29918,
10145,
13,
3166,
8297,
29881,
886,
29889,
24219,
1061,
29889,
16506,
29918,
1643,
292,
29918,
24219,
1061,
1053,
922,
3910,
4775,
292,
29923,
4387,
1061,
13,
3166,
8297,
29881,
886,
29889,
13096,
5570,
29889,
29888,
433,
381,
29918,
16506,
29918,
1643,
292,
1053,
383,
433,
381,
20529,
4775,
292,
29925,
23828,
13,
13,
932,
353,
7911,
546,
29889,
21314,
546,
580,
13,
13,
13,
1753,
1065,
29898,
13,
1678,
23655,
29918,
978,
29901,
851,
353,
7911,
546,
29889,
8375,
29898,
13,
4706,
376,
284,
1397,
307,
29914,
2276,
2151,
29899,
3188,
29899,
29883,
1463,
613,
1371,
543,
29950,
688,
3460,
10635,
23655,
1904,
1024,
470,
2224,
1213,
13,
1678,
10353,
13,
1678,
8783,
29918,
978,
29901,
851,
353,
7911,
546,
29889,
8375,
29898,
13,
4706,
376,
16544,
262,
29899,
572,
29914,
29895,
29886,
15866,
29899,
1089,
613,
1371,
543,
29950,
688,
3460,
10635,
8783,
1024,
470,
2224,
1213,
13,
1678,
10353,
13,
1678,
1881,
29918,
4914,
29918,
978,
29901,
851,
353,
7911,
546,
29889,
8375,
29898,
13,
4706,
376,
517,
12360,
613,
1371,
543,
4409,
1024,
393,
3743,
1426,
304,
770,
1598,
1213,
13,
1678,
10353,
13,
1678,
3646,
29918,
4914,
29918,
978,
29901,
851,
353,
7911,
546,
29889,
8375,
29898,
13,
4706,
376,
1089,
613,
1371,
543,
4409,
1024,
393,
3743,
4055,
11073,
363,
349,
3267,
4055,
3460,
1213,
13,
1678,
10353,
13,
1678,
3876,
29901,
851,
353,
7911,
546,
29889,
8375,
29898,
15989,
8647,
29903,
29918,
10145,
29889,
7122,
2084,
703,
1066,
29918,
4039,
3460,
1159,
511,
13,
1678,
7934,
29918,
2311,
29901,
938,
353,
7911,
546,
29889,
8375,
29898,
29906,
29945,
29953,
29892,
1371,
543,
4557,
310,
7934,
5922,
297,
390,
10262,
1213,
511,
13,
1678,
17983,
29918,
8513,
29901,
922,
3910,
4775,
292,
29923,
4387,
1061,
29889,
29923,
4387,
362,
6818,
353,
7911,
546,
29889,
8375,
29898,
13,
4706,
922,
3910,
4775,
292,
29923,
4387,
1061,
29889,
29923,
4387,
362,
6818,
29889,
6007,
2208,
29892,
13,
4706,
1371,
543,
29923,
4387,
362,
4464,
29889,
18601,
287,
18893,
29901,
518,
5441,
29892,
378,
645,
29892,
9406,
1822,
613,
13,
1678,
10353,
13,
1678,
4055,
3460,
29918,
816,
2004,
29901,
28379,
29961,
20529,
4775,
292,
29923,
4387,
1061,
29889,
8176,
3460,
4504,
2004,
29962,
353,
7911,
546,
29889,
8375,
29898,
13,
4706,
6213,
29892,
1371,
543,
8176,
3460,
11380,
29889,
18601,
287,
27715,
29901,
518,
5971,
29933,
29896,
29892,
10663,
29933,
29906,
29892,
10663,
29923,
29896,
29892,
10663,
29923,
29906,
29892,
10663,
29933,
2890,
29892,
350,
29902,
3927,
29965,
18017,
13,
1678,
10353,
13,
29897,
1599,
6213,
29901,
13,
1678,
7911,
546,
29889,
8057,
29898,
407,
29878,
524,
29889,
29886,
4830,
29898,
2997,
29879,
22130,
13,
13,
1678,
1962,
29918,
2084,
353,
10802,
29898,
4632,
29892,
23655,
29918,
978,
29892,
8783,
29918,
978,
29897,
13,
1678,
1962,
29918,
2084,
29889,
11256,
3972,
29898,
862,
1237,
29922,
5574,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
13,
1678,
16439,
353,
383,
433,
381,
20529,
4775,
292,
29925,
23828,
29898,
13,
4706,
23655,
29918,
978,
29892,
13,
4706,
8783,
29918,
978,
29892,
13,
4706,
1881,
29918,
4914,
29918,
978,
29892,
13,
4706,
3646,
29918,
4914,
29918,
978,
29892,
13,
4706,
1962,
29918,
2084,
29892,
13,
4706,
7934,
29918,
2311,
29892,
13,
4706,
17983,
29918,
8513,
29892,
13,
4706,
4055,
3460,
29918,
816,
2004,
29892,
13,
1678,
1723,
13,
1678,
1121,
353,
16439,
29889,
3389,
580,
13,
1678,
7911,
546,
29889,
8057,
29898,
407,
29878,
524,
29889,
29886,
4830,
29898,
2914,
876,
13,
13,
13,
1017,
546,
29889,
3389,
29898,
3389,
29897,
13,
2
] |
src/bot.py | Teazane/NewCthulhuBot | 0 | 1603570 | <reponame>Teazane/NewCthulhuBot<filename>src/bot.py
import discord, random, time
from src.reactions import Reactions
class Bot(discord.Client):
# Explication du mécanisme asynchrone Python : https://stackabuse.com/python-async-await-tutorial/
async def on_ready(self):
"""
Log un message quand le bot est prêt.
"""
print("Cthulhu bot is now ready as " + str(self.user))
async def on_connect(self):
"""
Log un message quand le bot est connecté.
"""
print("Cthulhu bot is now connected as " + str(self.user))
print("Cthulhu has access to the following servers:")
for guild in self.guilds:
print("> " + str(guild.name) + "(" + str(guild.id) + ") containing channels: ")
for chan in guild.text_channels:
print("\t - " + chan.name)
async def on_message(self, message):
"""
Traite un message quand le bot en reçoit un.
"""
# Si l'auteur est un bot, on ne répond pas
if message.author.bot:
return
else:
print("The bot has received a message from " + message.author.name + ": " + message.content)
reactions = Reactions()
you_are_taunt = random.randint(0,50)
if you_are_taunt == 0:
await message.channel.send(reactions.toi_meme_repeat(message.content))
else:
response_msg = reactions.search_key_word(message.content)
if response_msg is not None:
await message.channel.send(reactions.search_key_word(message.content))
else:
pass
async def on_disconnect(self):
"""
Log un message quand le bot se déconnecte.
"""
print("Cthulhu bot has been disconnected") | [
1,
529,
276,
1112,
420,
29958,
7141,
834,
1662,
29914,
4373,
29907,
386,
352,
6905,
29933,
327,
29966,
9507,
29958,
4351,
29914,
7451,
29889,
2272,
13,
5215,
2313,
536,
29892,
4036,
29892,
931,
13,
3166,
4765,
29889,
5638,
1953,
1053,
830,
7387,
13,
13,
1990,
11273,
29898,
2218,
16090,
29889,
4032,
1125,
13,
1678,
396,
12027,
1414,
868,
8774,
3068,
6386,
408,
948,
22495,
650,
5132,
584,
2045,
597,
1429,
370,
1509,
29889,
510,
29914,
4691,
29899,
12674,
29899,
20675,
29899,
12631,
29914,
13,
13,
1678,
7465,
822,
373,
29918,
2040,
29898,
1311,
1125,
13,
4706,
9995,
13,
9651,
4522,
443,
2643,
18097,
454,
9225,
707,
544,
11992,
29889,
13,
4706,
9995,
13,
4706,
1596,
703,
29907,
386,
352,
6905,
9225,
338,
1286,
7960,
408,
376,
718,
851,
29898,
1311,
29889,
1792,
876,
13,
268,
13,
1678,
7465,
822,
373,
29918,
6915,
29898,
1311,
1125,
13,
4706,
9995,
13,
9651,
4522,
443,
2643,
18097,
454,
9225,
707,
4511,
29948,
29889,
13,
4706,
9995,
13,
4706,
1596,
703,
29907,
386,
352,
6905,
9225,
338,
1286,
6631,
408,
376,
718,
851,
29898,
1311,
29889,
1792,
876,
13,
4706,
1596,
703,
29907,
386,
352,
6905,
756,
2130,
304,
278,
1494,
12424,
29901,
1159,
13,
4706,
363,
1410,
789,
297,
1583,
29889,
2543,
789,
29879,
29901,
13,
9651,
1596,
703,
29958,
376,
718,
851,
29898,
2543,
789,
29889,
978,
29897,
718,
376,
703,
718,
851,
29898,
2543,
789,
29889,
333,
29897,
718,
29871,
16521,
6943,
18196,
29901,
16521,
13,
9651,
363,
521,
273,
297,
1410,
789,
29889,
726,
29918,
305,
12629,
29901,
13,
18884,
1596,
14182,
29873,
448,
376,
718,
521,
273,
29889,
978,
29897,
13,
13,
1678,
7465,
822,
373,
29918,
4906,
29898,
1311,
29892,
2643,
1125,
13,
4706,
9995,
13,
9651,
3201,
568,
443,
2643,
18097,
454,
9225,
427,
337,
28671,
443,
29889,
13,
4706,
9995,
13,
4706,
396,
6101,
301,
29915,
29874,
19072,
707,
443,
9225,
29892,
373,
452,
25497,
2331,
13,
4706,
565,
2643,
29889,
8921,
29889,
7451,
29901,
13,
9651,
736,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
1576,
9225,
756,
4520,
263,
2643,
515,
376,
718,
2643,
29889,
8921,
29889,
978,
718,
29242,
376,
718,
2643,
29889,
3051,
29897,
13,
9651,
337,
7387,
353,
830,
7387,
580,
13,
9651,
366,
29918,
598,
29918,
941,
1657,
353,
4036,
29889,
9502,
524,
29898,
29900,
29892,
29945,
29900,
29897,
13,
9651,
565,
366,
29918,
598,
29918,
941,
1657,
1275,
29871,
29900,
29901,
13,
18884,
7272,
2643,
29889,
12719,
29889,
6717,
29898,
5638,
1953,
29889,
517,
29875,
29918,
29885,
2004,
29918,
14358,
29898,
4906,
29889,
3051,
876,
13,
9651,
1683,
29901,
13,
18884,
2933,
29918,
7645,
353,
337,
7387,
29889,
4478,
29918,
1989,
29918,
1742,
29898,
4906,
29889,
3051,
29897,
13,
18884,
565,
2933,
29918,
7645,
338,
451,
6213,
29901,
13,
462,
1678,
7272,
2643,
29889,
12719,
29889,
6717,
29898,
5638,
1953,
29889,
4478,
29918,
1989,
29918,
1742,
29898,
4906,
29889,
3051,
876,
13,
18884,
1683,
29901,
13,
462,
1678,
1209,
13,
13,
1678,
7465,
822,
373,
29918,
2218,
6915,
29898,
1311,
1125,
13,
4706,
9995,
13,
9651,
4522,
443,
2643,
18097,
454,
9225,
409,
1437,
6915,
29872,
29889,
13,
4706,
9995,
13,
4706,
1596,
703,
29907,
386,
352,
6905,
9225,
756,
1063,
766,
18045,
1159,
2
] |
neko3/pagination/factory/basefactory.py | Natsurii/nicabot-monkee | 0 | 179867 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Nekozilla is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Nekozilla 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 Nekozilla. If not, see <https://www.gnu.org/licenses/>.
"""
Base factory ABC.
"""
__all__ = ("BaseFactory",)
import abc
class BaseFactory(abc.ABC):
"""Base class for a factory."""
pass
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
405,
1416,
2112,
2911,
338,
3889,
7047,
29901,
366,
508,
2654,
391,
2666,
372,
322,
29914,
272,
6623,
13,
29937,
372,
1090,
278,
4958,
310,
278,
15143,
4593,
5236,
19245,
408,
6369,
491,
13,
29937,
278,
12362,
18540,
10606,
29892,
2845,
1873,
29871,
29941,
310,
278,
19245,
29892,
470,
13,
29937,
313,
271,
596,
2984,
29897,
738,
2678,
1873,
29889,
13,
29937,
13,
29937,
405,
1416,
2112,
2911,
338,
13235,
297,
278,
4966,
393,
372,
674,
367,
5407,
29892,
13,
29937,
541,
399,
1806,
8187,
2692,
13764,
29979,
399,
1718,
29934,
13566,
29979,
29936,
1728,
1584,
278,
2411,
2957,
1370,
21867,
29891,
310,
13,
29937,
341,
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,
29937,
15143,
4593,
5236,
19245,
363,
901,
4902,
29889,
13,
29937,
13,
29937,
887,
881,
505,
4520,
263,
3509,
310,
278,
15143,
4593,
5236,
19245,
13,
29937,
3412,
411,
405,
1416,
2112,
2911,
29889,
29871,
960,
451,
29892,
1074,
529,
991,
597,
1636,
29889,
18713,
29889,
990,
29914,
506,
11259,
3779,
29889,
13,
13,
13,
15945,
29908,
13,
5160,
12529,
16417,
29889,
13,
15945,
29908,
13,
1649,
497,
1649,
353,
4852,
5160,
5126,
613,
29897,
13,
13,
5215,
25638,
13,
13,
13,
1990,
7399,
5126,
29898,
10736,
29889,
19658,
1125,
13,
1678,
9995,
5160,
770,
363,
263,
12529,
1213,
15945,
13,
13,
1678,
1209,
13,
2
] |
interface.py | MichaelWilly15/OrganizadorDeProjetos | 0 | 78157 | from time import sleep
def lin(tam=42):
print('-' * tam)
def cabecalho(msg):
lin()
print(msg)
lin()
def limpa_tela():
from sys import platform
from os import system
if platform == 'win32':
system('cls')
else:
system('clear')
def leiaint(txt):
try:
num = int(input(txt))
except ValueError:
print('\033[31;1mSó aceitamos inteiros!\033[m')
sleep(1.5)
limpa_tela()
return None
else:
return num
def carrega(msg, salto):
print(msg, end='', flush=True)
sleep(salto)
print('.', end='', flush=True)
sleep(salto)
print('.', end='', flush=True)
sleep(salto)
print('.')
sleep(salto)
def menu(*itens, titulo_menu):
while True:
cabecalho(titulo_menu)
for idx, item in enumerate(itens):
print(f'\033[33;1m {idx + 1} \033[m - \033[34;1m {item} \033[m')
lin()
opcao = leiaint('\033[34;1mSua opção: \033[m')
if opcao:
return opcao
def confirma_opcao(msg):
while True:
pergunta = str(input(msg)).lower().lstrip()[0]
if pergunta in 'sn':
return pergunta
else:
print('\033[31;1mResposta inválida\033[m')
sleep(1)
limpa_tela() | [
1,
515,
931,
1053,
8709,
13,
13,
13,
1753,
6276,
29898,
29873,
314,
29922,
29946,
29906,
1125,
13,
1678,
1596,
877,
29899,
29915,
334,
21308,
29897,
13,
13,
13,
1753,
7776,
687,
284,
1251,
29898,
7645,
1125,
13,
1678,
6276,
580,
13,
1678,
1596,
29898,
7645,
29897,
13,
1678,
6276,
580,
13,
13,
13,
1753,
2485,
3274,
29918,
29873,
3100,
7295,
13,
1678,
515,
10876,
1053,
7481,
13,
1678,
515,
2897,
1053,
1788,
13,
13,
1678,
565,
7481,
1275,
525,
5080,
29941,
29906,
2396,
13,
4706,
1788,
877,
25932,
1495,
13,
1678,
1683,
29901,
13,
4706,
1788,
877,
8551,
1495,
13,
13,
13,
1753,
454,
423,
524,
29898,
3945,
1125,
13,
4706,
1018,
29901,
13,
9651,
954,
353,
938,
29898,
2080,
29898,
3945,
876,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
1596,
28909,
29900,
29941,
29941,
29961,
29941,
29896,
29936,
29896,
29885,
29903,
29980,
21643,
277,
14054,
2293,
17177,
9903,
29900,
29941,
29941,
29961,
29885,
1495,
13,
9651,
8709,
29898,
29896,
29889,
29945,
29897,
13,
9651,
2485,
3274,
29918,
29873,
3100,
580,
13,
13,
9651,
736,
6213,
13,
4706,
1683,
29901,
13,
9651,
736,
954,
13,
13,
13,
1753,
1559,
1727,
29874,
29898,
7645,
29892,
4497,
517,
1125,
13,
1678,
1596,
29898,
7645,
29892,
1095,
2433,
742,
28371,
29922,
5574,
29897,
13,
13,
1678,
8709,
29898,
19585,
517,
29897,
13,
1678,
1596,
12839,
742,
1095,
2433,
742,
28371,
29922,
5574,
29897,
13,
13,
1678,
8709,
29898,
19585,
517,
29897,
13,
1678,
1596,
12839,
742,
1095,
2433,
742,
28371,
29922,
5574,
29897,
13,
13,
1678,
8709,
29898,
19585,
517,
29897,
13,
1678,
1596,
12839,
1495,
13,
13,
1678,
8709,
29898,
19585,
517,
29897,
13,
13,
13,
1753,
6143,
10456,
277,
575,
29892,
4329,
7207,
29918,
6510,
1125,
13,
1678,
1550,
5852,
29901,
13,
4706,
7776,
687,
284,
1251,
29898,
23545,
7207,
29918,
6510,
29897,
13,
13,
4706,
363,
22645,
29892,
2944,
297,
26985,
29898,
277,
575,
1125,
13,
9651,
1596,
29898,
29888,
12764,
29900,
29941,
29941,
29961,
29941,
29941,
29936,
29896,
29885,
426,
13140,
718,
29871,
29896,
29913,
320,
29900,
29941,
29941,
29961,
29885,
448,
320,
29900,
29941,
29941,
29961,
29941,
29946,
29936,
29896,
29885,
426,
667,
29913,
320,
29900,
29941,
29941,
29961,
29885,
1495,
13,
4706,
6276,
580,
13,
13,
4706,
1015,
1113,
29877,
353,
454,
423,
524,
28909,
29900,
29941,
29941,
29961,
29941,
29946,
29936,
29896,
29885,
29903,
3357,
1015,
2340,
29901,
320,
29900,
29941,
29941,
29961,
29885,
1495,
13,
13,
4706,
565,
1015,
1113,
29877,
29901,
13,
9651,
736,
1015,
1113,
29877,
13,
13,
13,
1753,
12388,
655,
29918,
459,
1113,
29877,
29898,
7645,
1125,
13,
1678,
1550,
5852,
29901,
13,
4706,
639,
29887,
16138,
353,
851,
29898,
2080,
29898,
7645,
8106,
13609,
2141,
29880,
17010,
580,
29961,
29900,
29962,
13,
13,
4706,
565,
639,
29887,
16138,
297,
525,
16586,
2396,
13,
9651,
736,
639,
29887,
16138,
13,
4706,
1683,
29901,
13,
9651,
1596,
28909,
29900,
29941,
29941,
29961,
29941,
29896,
29936,
29896,
29885,
1666,
27363,
2437,
2464,
1458,
29905,
29900,
29941,
29941,
29961,
29885,
1495,
13,
9651,
8709,
29898,
29896,
29897,
13,
13,
9651,
2485,
3274,
29918,
29873,
3100,
580,
2
] |
sample_problems/problems_with_solution21.py | adi01trip01/adi_workspace | 0 | 138034 | <gh_stars>0
# Write a Python program to find whether a given number (accept from the user) is even or odd,
# prints True if its even and False if its odd.
n = int(input("Enter a number: "))
print(n % 2 == 0)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14350,
263,
5132,
1824,
304,
1284,
3692,
263,
2183,
1353,
313,
16044,
515,
278,
1404,
29897,
338,
1584,
470,
7736,
29892,
13,
29937,
14677,
5852,
565,
967,
1584,
322,
7700,
565,
967,
7736,
29889,
13,
13,
29876,
353,
938,
29898,
2080,
703,
10399,
263,
1353,
29901,
376,
876,
13,
13,
2158,
29898,
29876,
1273,
29871,
29906,
1275,
29871,
29900,
29897,
13,
2
] |
resume/api/urls.py | jamedadi/jobnet | 3 | 50780 | <reponame>jamedadi/jobnet
from django.urls import path, include
from rest_framework import routers
from resume.api.views import ResumeModelViewSetApi
app_name = 'resume'
router = routers.SimpleRouter()
router.register('', ResumeModelViewSetApi)
urlpatterns = [
path('', include(router.urls)),
]
| [
1,
529,
276,
1112,
420,
29958,
29926,
2795,
10129,
29914,
9057,
1212,
13,
3166,
9557,
29889,
26045,
1053,
2224,
29892,
3160,
13,
13,
3166,
1791,
29918,
4468,
1053,
16053,
2153,
13,
13,
3166,
620,
2017,
29889,
2754,
29889,
7406,
1053,
2538,
2017,
3195,
1043,
2697,
11713,
13,
13,
932,
29918,
978,
353,
525,
690,
2017,
29915,
13,
13,
15140,
353,
16053,
2153,
29889,
15427,
23971,
580,
13,
15140,
29889,
9573,
877,
742,
2538,
2017,
3195,
1043,
2697,
11713,
29897,
13,
13,
2271,
11037,
29879,
353,
518,
13,
1678,
2224,
877,
742,
3160,
29898,
15140,
29889,
26045,
8243,
13,
29962,
13,
2
] |
gui/capture.py | mokojm/townshell | 34 | 114011 | <gh_stars>10-100
from os import getcwd
from kivy.app import App
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
Builder.load_file(r"gui\capture.kv")
class CaptureScreen(Screen):
def __init__(self, **kwargs):
self.util = App.get_running_app().util
super(CaptureScreen, self).__init__(**kwargs)
def durShowcasable(self, *args):
duration = int(self.box_dur.dur.value)
pixels = int(self.box_dist.dist.value)
answer = self.util.isShowcasable(pixels, duration, 'duration')
if answer is True:
pass
else:
myPopUp = Factory.NotifPopUp()
myPopUp.title = "Capture"
myPopUp.level = "ERROR"
myPopUp.mytext = answer
myPopUp.open()
def disShowcasable(self, *args):
duration = int(self.box_dur.dur.value)
pixels = int(self.box_dist.dist.value)
answer = self.util.isShowcasable(pixels, duration, 'distance')
if answer is True:
pass
else:
myPopUp = Factory.NotifPopUp()
myPopUp.title = "Capture"
myPopUp.level = "ERROR"
myPopUp.mytext = answer
myPopUp.open()
def reset(self):
self.box_fps.fps.value = 30
self.box_butt.butt.text = self.box_butt.butt.values[0]
self.box_dur.dur.value = 5
self.box_dist.dist.value = 500
self.box_ang.ang.value = 0
self.box_ryt.ryth.text = self.box_ryt.ryth.values[0]
self.box_spos.spos.text = self.box_spos.spos.values[0]
def capture(self, dryrun=False):
target_fps = int(self.box_fps.fps.value)
settings = {
"fps": target_fps,
"button": self.box_butt.butt.text,
"duration": int(self.box_dur.dur.value),
"pixels": int(self.box_dist.dist.value),
"angle": int(self.box_ang.ang.value),
"rythm": self.box_ryt.ryth.text,
"start": self.box_spos.spos.text,
"dirname": getcwd(), # temporary
"cqueue": self.util.captureQueue,
"mqueue": self.util.mainQueue,
"synchro": self.util.synchro,
"dryrun": dryrun,
}
# Call the capture method of self.util
answer = self.util.capture(**settings)
if dryrun:
if answer is True:
level = "INFO"
mytext = "Move successfully performed"
else:
level = "ERROR"
mytext = answer
else:
# Good FPS
if isinstance(answer, int) and abs(answer - target_fps) < 5:
level = "INFO"
mytext = f"File created. Good FPS : {answer}"
# Unexpected FPS
elif isinstance(answer, int):
level = "WARNING"
mytext = f"File Created. Unexpected FPS : {answer}"
# Error during process
else:
level = "ERROR"
mytext = f"Something went wrong : {answer}"
myPopUp = Factory.NotifPopUp()
myPopUp.title = "Capture"
myPopUp.level = level
myPopUp.mytext = mytext
myPopUp.open()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
3166,
2897,
1053,
679,
29883,
9970,
13,
13,
3166,
413,
440,
29891,
29889,
932,
1053,
2401,
13,
3166,
413,
440,
29891,
29889,
14399,
1053,
27561,
13,
3166,
413,
440,
29891,
29889,
3893,
1053,
5373,
2700,
13,
3166,
413,
440,
29891,
29889,
29884,
861,
29889,
10525,
12847,
1053,
22666,
13,
13,
5627,
29889,
1359,
29918,
1445,
29898,
29878,
29908,
23569,
29905,
17885,
545,
29889,
27049,
1159,
13,
13,
13,
1990,
8868,
545,
11357,
29898,
11357,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3579,
19290,
1125,
13,
13,
4706,
1583,
29889,
4422,
353,
2401,
29889,
657,
29918,
21094,
29918,
932,
2141,
4422,
13,
4706,
2428,
29898,
21133,
545,
11357,
29892,
1583,
467,
1649,
2344,
12035,
1068,
19290,
29897,
13,
13,
13,
1678,
822,
1411,
8964,
9398,
519,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
14385,
353,
938,
29898,
1311,
29889,
1884,
29918,
29881,
332,
29889,
29881,
332,
29889,
1767,
29897,
13,
4706,
17036,
353,
938,
29898,
1311,
29889,
1884,
29918,
5721,
29889,
5721,
29889,
1767,
29897,
13,
13,
4706,
1234,
353,
1583,
29889,
4422,
29889,
275,
8964,
9398,
519,
29898,
29886,
861,
1379,
29892,
14385,
29892,
525,
19708,
1495,
13,
4706,
565,
1234,
338,
5852,
29901,
13,
9651,
1209,
13,
4706,
1683,
29901,
13,
9651,
590,
12310,
3373,
353,
27561,
29889,
3664,
361,
12310,
3373,
580,
13,
9651,
590,
12310,
3373,
29889,
3257,
353,
376,
21133,
545,
29908,
13,
9651,
590,
12310,
3373,
29889,
5563,
353,
376,
11432,
29908,
13,
9651,
590,
12310,
3373,
29889,
1357,
726,
353,
1234,
13,
9651,
590,
12310,
3373,
29889,
3150,
580,
13,
13,
1678,
822,
766,
8964,
9398,
519,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
14385,
353,
938,
29898,
1311,
29889,
1884,
29918,
29881,
332,
29889,
29881,
332,
29889,
1767,
29897,
13,
4706,
17036,
353,
938,
29898,
1311,
29889,
1884,
29918,
5721,
29889,
5721,
29889,
1767,
29897,
13,
13,
4706,
1234,
353,
1583,
29889,
4422,
29889,
275,
8964,
9398,
519,
29898,
29886,
861,
1379,
29892,
14385,
29892,
525,
19244,
1495,
13,
4706,
565,
1234,
338,
5852,
29901,
13,
9651,
1209,
13,
4706,
1683,
29901,
13,
9651,
590,
12310,
3373,
353,
27561,
29889,
3664,
361,
12310,
3373,
580,
13,
9651,
590,
12310,
3373,
29889,
3257,
353,
376,
21133,
545,
29908,
13,
9651,
590,
12310,
3373,
29889,
5563,
353,
376,
11432,
29908,
13,
9651,
590,
12310,
3373,
29889,
1357,
726,
353,
1234,
13,
9651,
590,
12310,
3373,
29889,
3150,
580,
13,
13,
1678,
822,
10092,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1884,
29918,
29888,
567,
29889,
29888,
567,
29889,
1767,
353,
29871,
29941,
29900,
13,
4706,
1583,
29889,
1884,
29918,
4187,
29873,
29889,
4187,
29873,
29889,
726,
353,
1583,
29889,
1884,
29918,
4187,
29873,
29889,
4187,
29873,
29889,
5975,
29961,
29900,
29962,
13,
4706,
1583,
29889,
1884,
29918,
29881,
332,
29889,
29881,
332,
29889,
1767,
353,
29871,
29945,
13,
4706,
1583,
29889,
1884,
29918,
5721,
29889,
5721,
29889,
1767,
353,
29871,
29945,
29900,
29900,
13,
4706,
1583,
29889,
1884,
29918,
574,
29889,
574,
29889,
1767,
353,
29871,
29900,
13,
4706,
1583,
29889,
1884,
29918,
719,
29873,
29889,
719,
386,
29889,
726,
353,
1583,
29889,
1884,
29918,
719,
29873,
29889,
719,
386,
29889,
5975,
29961,
29900,
29962,
13,
4706,
1583,
29889,
1884,
29918,
1028,
359,
29889,
1028,
359,
29889,
726,
353,
1583,
29889,
1884,
29918,
1028,
359,
29889,
1028,
359,
29889,
5975,
29961,
29900,
29962,
13,
13,
1678,
822,
10446,
29898,
1311,
29892,
15589,
3389,
29922,
8824,
1125,
13,
13,
4706,
3646,
29918,
29888,
567,
353,
938,
29898,
1311,
29889,
1884,
29918,
29888,
567,
29889,
29888,
567,
29889,
1767,
29897,
13,
4706,
6055,
353,
426,
13,
9651,
376,
29888,
567,
1115,
3646,
29918,
29888,
567,
29892,
13,
9651,
376,
3092,
1115,
1583,
29889,
1884,
29918,
4187,
29873,
29889,
4187,
29873,
29889,
726,
29892,
13,
9651,
376,
19708,
1115,
938,
29898,
1311,
29889,
1884,
29918,
29881,
332,
29889,
29881,
332,
29889,
1767,
511,
13,
9651,
376,
29886,
861,
1379,
1115,
938,
29898,
1311,
29889,
1884,
29918,
5721,
29889,
5721,
29889,
1767,
511,
13,
9651,
376,
2521,
1115,
938,
29898,
1311,
29889,
1884,
29918,
574,
29889,
574,
29889,
1767,
511,
13,
9651,
376,
719,
12743,
1115,
1583,
29889,
1884,
29918,
719,
29873,
29889,
719,
386,
29889,
726,
29892,
13,
9651,
376,
2962,
1115,
1583,
29889,
1884,
29918,
1028,
359,
29889,
1028,
359,
29889,
726,
29892,
13,
9651,
376,
25721,
1115,
679,
29883,
9970,
3285,
29871,
396,
13201,
13,
9651,
376,
29883,
9990,
1115,
1583,
29889,
4422,
29889,
17885,
545,
10620,
29892,
13,
9651,
376,
29885,
9990,
1115,
1583,
29889,
4422,
29889,
3396,
10620,
29892,
13,
9651,
376,
19274,
305,
307,
1115,
1583,
29889,
4422,
29889,
19274,
305,
307,
29892,
13,
9651,
376,
29881,
719,
3389,
1115,
15589,
3389,
29892,
13,
4706,
500,
13,
13,
4706,
396,
8251,
278,
10446,
1158,
310,
1583,
29889,
4422,
13,
4706,
1234,
353,
1583,
29889,
4422,
29889,
17885,
545,
29898,
1068,
11027,
29897,
13,
13,
4706,
565,
15589,
3389,
29901,
13,
9651,
565,
1234,
338,
5852,
29901,
13,
18884,
3233,
353,
376,
11690,
29908,
13,
18884,
590,
726,
353,
376,
16619,
8472,
8560,
29908,
13,
9651,
1683,
29901,
13,
18884,
3233,
353,
376,
11432,
29908,
13,
18884,
590,
726,
353,
1234,
13,
13,
4706,
1683,
29901,
13,
9651,
396,
7197,
383,
7024,
13,
9651,
565,
338,
8758,
29898,
12011,
29892,
938,
29897,
322,
6425,
29898,
12011,
448,
3646,
29918,
29888,
567,
29897,
529,
29871,
29945,
29901,
13,
18884,
3233,
353,
376,
11690,
29908,
13,
18884,
590,
726,
353,
285,
29908,
2283,
2825,
29889,
7197,
383,
7024,
584,
426,
12011,
5038,
13,
13,
9651,
396,
10016,
29916,
6021,
383,
7024,
13,
9651,
25342,
338,
8758,
29898,
12011,
29892,
938,
1125,
13,
18884,
3233,
353,
376,
29956,
25614,
29908,
13,
18884,
590,
726,
353,
285,
29908,
2283,
6760,
630,
29889,
10016,
29916,
6021,
383,
7024,
584,
426,
12011,
5038,
13,
13,
9651,
396,
4829,
2645,
1889,
13,
9651,
1683,
29901,
13,
18884,
3233,
353,
376,
11432,
29908,
13,
18884,
590,
726,
353,
285,
29908,
16804,
3512,
2743,
584,
426,
12011,
5038,
13,
13,
4706,
590,
12310,
3373,
353,
27561,
29889,
3664,
361,
12310,
3373,
580,
13,
4706,
590,
12310,
3373,
29889,
3257,
353,
376,
21133,
545,
29908,
13,
4706,
590,
12310,
3373,
29889,
5563,
353,
3233,
13,
4706,
590,
12310,
3373,
29889,
1357,
726,
353,
590,
726,
13,
4706,
590,
12310,
3373,
29889,
3150,
580,
13,
2
] |
openmdao.lib/src/openmdao/lib/drivers/cobyladriver.py | mjfwest/OpenMDAO-Framework | 69 | 75752 | """
cobyladriver.py - Contains a driver that wraps the cobyla
optimizer as used in pyOpt:
Minimize a function using the Constrained Optimization BY Linear
Approximation (COBYLA) method.
COBYLA is gradient-free and can handle inequality constraints.
"""
from math import isnan
from numpy import zeros, array, hstack
from cobyla.cobyla import cobyla, closeunit
from openmdao.main.datatypes.api import Enum, Float, Int, Str
from openmdao.main.driver import Driver
from openmdao.main.hasparameters import HasParameters
from openmdao.main.hasconstraints import HasIneqConstraints
from openmdao.main.hasobjective import HasObjective
from openmdao.main.interfaces import IHasParameters, IHasIneqConstraints, \
IHasObjective, implements, IOptimizer
from openmdao.util.decorators import add_delegate
@add_delegate(HasParameters, HasIneqConstraints, HasObjective)
class COBYLAdriver(Driver):
"""Minimize a function using the Constrained Optimization BY Linear
Approximation (COBYLA) method.
COBYLA is gradient-free and can handle inequality constraints.
Note: Constraints should be added using the OpenMDAO convention
(positive = violated).
"""
implements(IHasParameters, IHasIneqConstraints, IHasObjective, IOptimizer)
# pylint: disable-msg=E1101
rhobeg = Float(1.0, iotype='in',
desc='Reasonable initial changes to the variables.')
rhoend = Float(1e-4, iotype='in',
desc='Final accuracy in the optimization'
' (not precisely guaranteed).')
iprint = Enum(1, [0, 1, 2, 3], iotype='in',
desc='Controls the frequency of output: 0 (no output),1,2,3.')
maxfun = Int(1000, iotype='in',
desc='Maximum number of function evaluations.')
iout = Int(6, iotype='in',
desc='Fortran output unit. Leave this at 6 for STDOUT.')
output_filename = Str('cobyla.out', iotype='in',
desc='Name of output file (if iout not 6).')
error_code = Int(0, iotype='out',
desc='Error code returned from COBYLA.')
def __init__(self):
super(COBYLAdriver, self).__init__()
self.error_messages = {
1 : 'Max. number of function evaluations reached',
2 : 'Rounding errors are becoming damaging'
}
self.x = zeros(0, 'd')
self.work_vector = zeros(0, 'd')
self.gg = zeros(0, 'd')
self.iact = zeros(0, 'd')
self.g = zeros(0, 'd')
self.ff = 0
self.nfvals = 0
self.nparam = 0
self.ncon = 0
self.upper = None
self.lower = None
self._continue = None
def start_iteration(self):
"""Perform initial setup before iteration loop begins."""
# Inital run to make sure the workflow executes
super(COBYLAdriver, self).run_iteration()
self.nparam = self.total_parameters()
self.ncon = self.total_ineq_constraints()
self.ncon += 2*self.nparam
self.g = zeros(self.ncon, 'd')
self.work_vector = zeros(self.ncon, 'd')
# get the initial values of the parameters
self.x = self.eval_parameters(self.parent)
self.upper = self.get_upper_bounds()
self.lower = self.get_lower_bounds()
n = self.nparam
m = self.ncon
self.work_vector = zeros([n*(3*n+2*m+11)+4*m+6], 'd')
self.iact = zeros([m+1], 'i')
self.gg = zeros([m], 'd')
self._continue = True
def run_iteration(self):
""" Note: cobyla controls the looping."""
try:
self.iact, self.error_code, self.nfvals = \
cobyla(self._func, self.nparam, self.ncon, self.x,
self.rhobeg, self.rhoend, self.iprint, self.maxfun,
self.work_vector, self.iact, self.error_code, self.nfvals,
self.iout, self.output_filename, self.ff, self.gg)
except Exception as err:
self._logger.error(str(err))
raise
if self.iprint > 0:
closeunit(self.iout)
# Log any errors
if self.error_code != 0:
self._logger.warning(self.error_messages[self.error_code])
# Iteration is complete
self._continue = False
def _func(self, n, m, xnew, f, g):
""" Return ndarrays containing the function and constraint
evaluations.
Note: n, m, f, and g are unused inputs."""
self.set_parameters(xnew)
super(COBYLAdriver, self).run_iteration()
f = self.eval_objective()
if isnan(f):
msg = "Numerical overflow in the objective"
self.raise_exception(msg, RuntimeError)
# Constraints (COBYLA defines positive as satisfied)
cons = -1. * array(self.eval_ineq_constraints())
# Side Constraints
vals = self.eval_parameters(self.parent)
g = hstack([cons, (vals - self.lower), (self.upper - vals)])
return f, g
| [
1,
9995,
13,
29883,
711,
2904,
328,
3511,
29889,
2272,
448,
2866,
2708,
263,
7156,
393,
11463,
567,
278,
274,
18711,
433,
13,
20640,
3950,
408,
1304,
297,
11451,
20624,
29901,
13,
13,
8140,
326,
675,
263,
740,
773,
278,
1281,
4151,
1312,
20693,
326,
2133,
6770,
22985,
13,
2052,
307,
2657,
362,
313,
3217,
22716,
4375,
29897,
1158,
29889,
13,
13,
3217,
22716,
4375,
338,
16030,
29899,
9021,
322,
508,
4386,
14585,
11938,
29889,
13,
15945,
29908,
13,
13,
3166,
5844,
1053,
3508,
273,
13,
13,
3166,
12655,
1053,
24786,
29892,
1409,
29892,
298,
1429,
13,
13,
3166,
274,
18711,
433,
29889,
29883,
18711,
433,
1053,
274,
18711,
433,
29892,
3802,
5441,
13,
13,
3166,
1722,
29885,
1388,
29877,
29889,
3396,
29889,
4130,
271,
7384,
29889,
2754,
1053,
1174,
398,
29892,
27842,
29892,
3159,
29892,
3767,
13,
3166,
1722,
29885,
1388,
29877,
29889,
3396,
29889,
9465,
1053,
26391,
13,
3166,
1722,
29885,
1388,
29877,
29889,
3396,
29889,
5349,
16744,
1053,
11699,
11507,
13,
3166,
1722,
29885,
1388,
29877,
29889,
3396,
29889,
5349,
13646,
29879,
1053,
11699,
29902,
10743,
27427,
13,
3166,
1722,
29885,
1388,
29877,
29889,
3396,
29889,
5349,
3318,
573,
1053,
11699,
2061,
573,
13,
3166,
1722,
29885,
1388,
29877,
29889,
3396,
29889,
1639,
8726,
1053,
306,
14510,
11507,
29892,
306,
14510,
29902,
10743,
27427,
29892,
320,
13,
462,
462,
268,
306,
14510,
2061,
573,
29892,
10703,
29892,
10663,
415,
326,
3950,
13,
3166,
1722,
29885,
1388,
29877,
29889,
4422,
29889,
19557,
4097,
1053,
788,
29918,
21234,
13,
13,
13,
29992,
1202,
29918,
21234,
29898,
14510,
11507,
29892,
11699,
29902,
10743,
27427,
29892,
11699,
2061,
573,
29897,
13,
1990,
4810,
22716,
29931,
3253,
3511,
29898,
12376,
1125,
13,
1678,
9995,
8140,
326,
675,
263,
740,
773,
278,
1281,
4151,
1312,
20693,
326,
2133,
6770,
22985,
13,
1678,
28268,
2657,
362,
313,
3217,
22716,
4375,
29897,
1158,
29889,
13,
13,
1678,
4810,
22716,
4375,
338,
16030,
29899,
9021,
322,
508,
4386,
14585,
11938,
29889,
13,
13,
1678,
3940,
29901,
1281,
4151,
9466,
881,
367,
2715,
773,
278,
4673,
5773,
29909,
29949,
15687,
13,
1678,
313,
1066,
3321,
353,
5537,
630,
467,
13,
1678,
9995,
13,
13,
1678,
10703,
29898,
29902,
14510,
11507,
29892,
306,
14510,
29902,
10743,
27427,
29892,
306,
14510,
2061,
573,
29892,
10663,
415,
326,
3950,
29897,
13,
13,
1678,
396,
282,
2904,
524,
29901,
11262,
29899,
7645,
29922,
29923,
29896,
29896,
29900,
29896,
13,
1678,
18178,
711,
387,
353,
27842,
29898,
29896,
29889,
29900,
29892,
474,
327,
668,
2433,
262,
742,
13,
462,
259,
5153,
2433,
1123,
1658,
519,
2847,
3620,
304,
278,
3651,
29889,
1495,
13,
13,
1678,
364,
1251,
355,
353,
27842,
29898,
29896,
29872,
29899,
29946,
29892,
474,
327,
668,
2433,
262,
742,
13,
462,
259,
5153,
2433,
15790,
13600,
297,
278,
13883,
29915,
13,
462,
4706,
525,
313,
1333,
17503,
22688,
467,
1495,
13,
13,
1678,
474,
2158,
353,
1174,
398,
29898,
29896,
29892,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
1402,
474,
327,
668,
2433,
262,
742,
13,
462,
29871,
5153,
2433,
17825,
278,
10868,
310,
1962,
29901,
29871,
29900,
313,
1217,
1962,
511,
29896,
29892,
29906,
29892,
29941,
29889,
1495,
13,
13,
1678,
4236,
7692,
353,
3159,
29898,
29896,
29900,
29900,
29900,
29892,
474,
327,
668,
2433,
262,
742,
13,
462,
5153,
2433,
7976,
12539,
1353,
310,
740,
6161,
800,
29889,
1495,
13,
13,
1678,
474,
449,
353,
3159,
29898,
29953,
29892,
474,
327,
668,
2433,
262,
742,
13,
1669,
5153,
2433,
29943,
441,
661,
1962,
5190,
29889,
951,
1351,
445,
472,
29871,
29953,
363,
6850,
3970,
2692,
29889,
1495,
13,
13,
1678,
1962,
29918,
9507,
353,
3767,
877,
29883,
18711,
433,
29889,
449,
742,
474,
327,
668,
2433,
262,
742,
13,
462,
3986,
5153,
2433,
1170,
310,
1962,
934,
313,
361,
474,
449,
451,
29871,
29953,
467,
1495,
13,
13,
1678,
1059,
29918,
401,
353,
3159,
29898,
29900,
29892,
474,
327,
668,
2433,
449,
742,
13,
462,
268,
5153,
2433,
2392,
775,
4133,
515,
4810,
22716,
4375,
29889,
1495,
13,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
13,
4706,
2428,
29898,
3217,
22716,
29931,
3253,
3511,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
1583,
29889,
2704,
29918,
19158,
353,
426,
13,
632,
29896,
584,
525,
7976,
29889,
1353,
310,
740,
6161,
800,
7450,
742,
13,
632,
29906,
584,
525,
29934,
12449,
4436,
526,
14171,
5625,
6751,
29915,
13,
4706,
500,
13,
13,
4706,
1583,
29889,
29916,
353,
24786,
29898,
29900,
29892,
525,
29881,
1495,
13,
4706,
1583,
29889,
1287,
29918,
8111,
353,
24786,
29898,
29900,
29892,
525,
29881,
1495,
13,
4706,
1583,
29889,
1505,
353,
24786,
29898,
29900,
29892,
525,
29881,
1495,
13,
4706,
1583,
29889,
423,
312,
353,
24786,
29898,
29900,
29892,
525,
29881,
1495,
13,
4706,
1583,
29889,
29887,
353,
24786,
29898,
29900,
29892,
525,
29881,
1495,
13,
13,
4706,
1583,
29889,
600,
353,
29871,
29900,
13,
4706,
1583,
29889,
29876,
29888,
791,
29879,
353,
29871,
29900,
13,
4706,
1583,
29889,
29876,
3207,
353,
29871,
29900,
13,
4706,
1583,
29889,
29876,
535,
353,
29871,
29900,
13,
13,
4706,
1583,
29889,
21064,
353,
6213,
13,
4706,
1583,
29889,
13609,
353,
6213,
13,
4706,
1583,
3032,
19878,
353,
6213,
13,
13,
1678,
822,
1369,
29918,
1524,
362,
29898,
1311,
1125,
13,
4706,
9995,
5894,
689,
2847,
6230,
1434,
12541,
2425,
16410,
1213,
15945,
13,
13,
4706,
396,
512,
2410,
1065,
304,
1207,
1854,
278,
27321,
24138,
13,
4706,
2428,
29898,
3217,
22716,
29931,
3253,
3511,
29892,
1583,
467,
3389,
29918,
1524,
362,
580,
13,
13,
4706,
1583,
29889,
29876,
3207,
353,
1583,
29889,
7827,
29918,
16744,
580,
13,
4706,
1583,
29889,
29876,
535,
353,
1583,
29889,
7827,
29918,
457,
29939,
29918,
13646,
29879,
580,
13,
4706,
1583,
29889,
29876,
535,
4619,
29871,
29906,
29930,
1311,
29889,
29876,
3207,
13,
4706,
1583,
29889,
29887,
353,
24786,
29898,
1311,
29889,
29876,
535,
29892,
525,
29881,
1495,
13,
4706,
1583,
29889,
1287,
29918,
8111,
353,
24786,
29898,
1311,
29889,
29876,
535,
29892,
525,
29881,
1495,
13,
13,
4706,
396,
679,
278,
2847,
1819,
310,
278,
4128,
13,
4706,
1583,
29889,
29916,
353,
1583,
29889,
14513,
29918,
16744,
29898,
1311,
29889,
3560,
29897,
13,
13,
4706,
1583,
29889,
21064,
353,
1583,
29889,
657,
29918,
21064,
29918,
23687,
580,
13,
4706,
1583,
29889,
13609,
353,
1583,
29889,
657,
29918,
13609,
29918,
23687,
580,
13,
13,
4706,
302,
353,
1583,
29889,
29876,
3207,
13,
4706,
286,
353,
1583,
29889,
29876,
535,
13,
4706,
1583,
29889,
1287,
29918,
8111,
353,
24786,
4197,
29876,
16395,
29941,
29930,
29876,
29974,
29906,
29930,
29885,
29974,
29896,
29896,
7240,
29946,
29930,
29885,
29974,
29953,
1402,
525,
29881,
1495,
13,
4706,
1583,
29889,
423,
312,
353,
24786,
4197,
29885,
29974,
29896,
1402,
525,
29875,
1495,
13,
4706,
1583,
29889,
1505,
353,
24786,
4197,
29885,
1402,
525,
29881,
1495,
13,
13,
4706,
1583,
3032,
19878,
353,
5852,
13,
13,
1678,
822,
1065,
29918,
1524,
362,
29898,
1311,
1125,
13,
4706,
9995,
3940,
29901,
274,
18711,
433,
11761,
278,
26113,
1213,
15945,
13,
13,
4706,
1018,
29901,
13,
9651,
1583,
29889,
423,
312,
29892,
1583,
29889,
2704,
29918,
401,
29892,
1583,
29889,
29876,
29888,
791,
29879,
353,
320,
13,
795,
274,
18711,
433,
29898,
1311,
3032,
9891,
29892,
1583,
29889,
29876,
3207,
29892,
1583,
29889,
29876,
535,
29892,
1583,
29889,
29916,
29892,
13,
462,
259,
1583,
29889,
19046,
711,
387,
29892,
1583,
29889,
4650,
355,
29892,
1583,
29889,
29875,
2158,
29892,
1583,
29889,
3317,
7692,
29892,
13,
462,
259,
1583,
29889,
1287,
29918,
8111,
29892,
1583,
29889,
423,
312,
29892,
1583,
29889,
2704,
29918,
401,
29892,
1583,
29889,
29876,
29888,
791,
29879,
29892,
13,
462,
259,
1583,
29889,
29875,
449,
29892,
1583,
29889,
4905,
29918,
9507,
29892,
1583,
29889,
600,
29892,
1583,
29889,
1505,
29897,
13,
13,
4706,
5174,
8960,
408,
4589,
29901,
13,
9651,
1583,
3032,
21707,
29889,
2704,
29898,
710,
29898,
3127,
876,
13,
9651,
12020,
13,
13,
4706,
565,
1583,
29889,
29875,
2158,
1405,
29871,
29900,
29901,
13,
9651,
3802,
5441,
29898,
1311,
29889,
29875,
449,
29897,
13,
13,
4706,
396,
4522,
738,
4436,
13,
4706,
565,
1583,
29889,
2704,
29918,
401,
2804,
29871,
29900,
29901,
13,
9651,
1583,
3032,
21707,
29889,
27392,
29898,
1311,
29889,
2704,
29918,
19158,
29961,
1311,
29889,
2704,
29918,
401,
2314,
13,
13,
4706,
396,
20504,
362,
338,
4866,
13,
4706,
1583,
3032,
19878,
353,
7700,
13,
13,
1678,
822,
903,
9891,
29898,
1311,
29892,
302,
29892,
286,
29892,
921,
1482,
29892,
285,
29892,
330,
1125,
13,
4706,
9995,
7106,
29871,
299,
2378,
29879,
6943,
278,
740,
322,
7276,
13,
4706,
6161,
800,
29889,
13,
13,
4706,
3940,
29901,
302,
29892,
286,
29892,
285,
29892,
322,
330,
526,
443,
3880,
10970,
1213,
15945,
13,
13,
4706,
1583,
29889,
842,
29918,
16744,
29898,
29916,
1482,
29897,
13,
4706,
2428,
29898,
3217,
22716,
29931,
3253,
3511,
29892,
1583,
467,
3389,
29918,
1524,
362,
580,
13,
4706,
285,
353,
1583,
29889,
14513,
29918,
3318,
573,
580,
13,
13,
4706,
565,
3508,
273,
29898,
29888,
1125,
13,
9651,
10191,
353,
376,
29940,
4680,
936,
11969,
297,
278,
12091,
29908,
13,
9651,
1583,
29889,
22692,
29918,
11739,
29898,
7645,
29892,
24875,
2392,
29897,
13,
13,
4706,
396,
1281,
4151,
9466,
313,
3217,
22716,
4375,
17645,
6374,
408,
15787,
29897,
13,
4706,
1136,
353,
448,
29896,
29889,
334,
1409,
29898,
1311,
29889,
14513,
29918,
457,
29939,
29918,
13646,
29879,
3101,
13,
13,
4706,
396,
19160,
1281,
4151,
9466,
13,
4706,
659,
29879,
353,
1583,
29889,
14513,
29918,
16744,
29898,
1311,
29889,
3560,
29897,
13,
4706,
330,
353,
298,
1429,
4197,
3200,
29892,
313,
791,
29879,
448,
1583,
29889,
13609,
511,
313,
1311,
29889,
21064,
448,
659,
29879,
29897,
2314,
13,
13,
4706,
736,
285,
29892,
330,
13,
13,
2
] |
main.py | basakstuff/PI_Works | 0 | 173264 | <filename>main.py
def isPrime(number):
if number > 1:
for i in range(2, number):
if (number % i) == 0:
return False
else:
return True
else:
return False
inputFile = open('test.txt')
lines = inputFile.readlines()
inputFile.close()
pyramid = []
for i in lines:
print(i)
for line in lines:
pyramid.append(line.split())
for i in range(0,len(pyramid)):
for j in range(0,len(pyramid[i])):
pyramid[i][j] = int(pyramid[i][j])
for i in range(len(pyramid)-2, -1, -1):
for j in range(0, len(pyramid[i])):
if isPrime(pyramid[i][j]) == False:
pyramid[i][j] += max(pyramid[i+1][j], pyramid[i+1][j+1])
print('\nThe maximum sum of the numbers is',max(pyramid)[0]) | [
1,
529,
9507,
29958,
3396,
29889,
2272,
13,
1753,
338,
4040,
603,
29898,
4537,
1125,
13,
1678,
565,
1353,
1405,
29871,
29896,
29901,
13,
4706,
363,
474,
297,
3464,
29898,
29906,
29892,
1353,
1125,
13,
9651,
565,
313,
4537,
1273,
474,
29897,
1275,
29871,
29900,
29901,
13,
18884,
736,
7700,
13,
4706,
1683,
29901,
13,
9651,
736,
5852,
13,
1678,
1683,
29901,
13,
4706,
736,
7700,
13,
13,
2080,
2283,
353,
1722,
877,
1688,
29889,
3945,
1495,
13,
9012,
353,
1881,
2283,
29889,
949,
9012,
580,
13,
2080,
2283,
29889,
5358,
580,
13,
2272,
2572,
333,
353,
5159,
13,
1454,
474,
297,
3454,
29901,
13,
1678,
1596,
29898,
29875,
29897,
13,
13,
13,
1454,
1196,
297,
3454,
29901,
13,
1678,
11451,
2572,
333,
29889,
4397,
29898,
1220,
29889,
5451,
3101,
13,
1454,
474,
297,
3464,
29898,
29900,
29892,
2435,
29898,
2272,
2572,
333,
22164,
13,
1678,
363,
432,
297,
3464,
29898,
29900,
29892,
2435,
29898,
2272,
2572,
333,
29961,
29875,
12622,
29901,
13,
4706,
11451,
2572,
333,
29961,
29875,
3816,
29926,
29962,
353,
938,
29898,
2272,
2572,
333,
29961,
29875,
3816,
29926,
2314,
13,
13,
13,
1454,
474,
297,
3464,
29898,
2435,
29898,
2272,
2572,
333,
6817,
29906,
29892,
448,
29896,
29892,
448,
29896,
1125,
13,
1678,
363,
432,
297,
3464,
29898,
29900,
29892,
7431,
29898,
2272,
2572,
333,
29961,
29875,
12622,
29901,
13,
4706,
565,
338,
4040,
603,
29898,
2272,
2572,
333,
29961,
29875,
3816,
29926,
2314,
1275,
7700,
29901,
13,
9651,
11451,
2572,
333,
29961,
29875,
3816,
29926,
29962,
4619,
4236,
29898,
2272,
2572,
333,
29961,
29875,
29974,
29896,
3816,
29926,
1402,
11451,
2572,
333,
29961,
29875,
29974,
29896,
3816,
29926,
29974,
29896,
2314,
13,
13,
2158,
28909,
29876,
1576,
7472,
2533,
310,
278,
3694,
338,
742,
3317,
29898,
2272,
2572,
333,
9601,
29900,
2314,
2
] |
ppr-api/tests/unit/api/test_change.py | thorwolpert/ppr | 0 | 173228 | # Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests to verify the financing-statement changes endpoint.
Test-Suite to ensure that the /financing-statement/registrationNum/changes endpoint is working as expected.
"""
import copy
from http import HTTPStatus
import pytest
from registry_schemas.example_data.ppr import CHANGE_STATEMENT
from ppr_api.services.authz import COLIN_ROLE, PPR_ROLE, STAFF_ROLE, SBC_OFFICE, BCOL_HELP
from tests.unit.services.utils import create_header, create_header_account, create_header_account_report
MOCK_PAY_URL = 'https://bcregistry-bcregistry-mock.apigee.net/mockTarget/pay/api/v1/'
# prep sample post change statement data
SAMPLE_JSON = copy.deepcopy(CHANGE_STATEMENT)
STATEMENT_VALID = {
'baseRegistrationNumber': 'TEST0001',
'debtorName': {
'businessName': 'TEST BUS 2 DEBTOR'
},
'authorizationReceived': True,
'registeringParty': {
'businessName': 'ABC SEARCHING COMPANY',
'address': {
'street': '222 SUMMER STREET',
'city': 'VICTORIA',
'region': 'BC',
'country': 'CA',
'postalCode': 'V8W 2V8'
},
'emailAddress': '<EMAIL>'
},
'changeType': 'AC',
'addVehicleCollateral': [
{
'type': 'MV',
'serialNumber': 'KM8J3CA46JU724994',
'year': 2018,
'make': 'HYUNDAI',
'model': 'TUCSON'
}
],
'payment': {
'receipt': '/pay/api/v1/payment-requests/2199700/receipts',
'invoiceId': '2199700'
}
}
INVALID_REG_NUM = {
'baseRegistrationNumber': 'TESTXXX1',
'debtorName': {
'businessName': 'TEST BUS 2 DEBTOR'
},
'authorizationReceived': True,
'registeringParty': {
'businessName': 'ABC SEARCHING COMPANY',
'address': {
'street': '222 SUMMER STREET',
'city': 'VICTORIA',
'region': 'BC',
'country': 'CA',
'postalCode': 'V8W 2V8'
},
'emailAddress': '<EMAIL>'
},
'changeType': 'AC',
'addVehicleCollateral': [
{
'type': 'MV',
'serialNumber': 'KM8J3CA46JU724994',
'year': 2018,
'make': 'HYUNDAI',
'model': 'TUCSON'
}
]
}
MISSING_BASE_DEBTOR = {
'baseRegistrationNumber': 'TEST0001',
'authorizationReceived': True,
'registeringParty': {
'businessName': 'ABC SEARCHING COMPANY',
'address': {
'street': '222 SUMMER STREET',
'city': 'VICTORIA',
'region': 'BC',
'country': 'CA',
'postalCode': 'V8W 2V8'
},
'emailAddress': '<EMAIL>'
},
'changeType': 'AC',
'addVehicleCollateral': [
{
'type': 'MV',
'serialNumber': 'KM8J3CA46JU724994',
'year': 2018,
'make': 'HYUNDAI',
'model': 'TUCSON'
}
]
}
INVALID_BASE_DEBTOR = {
'baseRegistrationNumber': 'TEST0001',
'debtorName': {
'businessName': 'TEXT BUS 3 DEBTOR'
},
'authorizationReceived': True,
'registeringParty': {
'businessName': 'ABC SEARCHING COMPANY',
'address': {
'street': '222 SUMMER STREET',
'city': 'VICTORIA',
'region': 'BC',
'country': 'CA',
'postalCode': 'V8W 2V8'
},
'emailAddress': '<EMAIL>'
},
'changeType': 'AC',
'addVehicleCollateral': [
{
'type': 'MV',
'serialNumber': 'KM8J3CA46JU724994',
'year': 2018,
'make': 'HYUNDAI',
'model': 'TUCSON'
}
]
}
INVALID_HISTORICAL = {
'baseRegistrationNumber': 'TEST0003',
'debtorName': {
'businessName': 'TEST BUS 2 DEBTOR'
},
'authorizationReceived': True,
'registeringParty': {
'businessName': 'ABC SEARCHING COMPANY',
'address': {
'street': '222 SUMMER STREET',
'city': 'VICTORIA',
'region': 'BC',
'country': 'CA',
'postalCode': 'V8W 2V8'
},
'emailAddress': '<EMAIL>'
},
'changeType': 'AC',
'addVehicleCollateral': [
{
'type': 'MV',
'serialNumber': 'KM8J3CA46JU724994',
'year': 2018,
'make': 'HYUNDAI',
'model': 'TUCSON'
}
]
}
INVALID_CODE = {
'baseRegistrationNumber': 'TEST0001',
'debtorName': {
'businessName': 'TEST BUS 2 DEBTOR'
},
'authorizationReceived': True,
'registeringParty': {
'code': '300000000'
},
'changeType': 'AC',
'addVehicleCollateral': [
{
'type': 'MV',
'serialNumber': 'KM8J3CA46JU724994',
'year': 2018,
'make': 'HYUNDAI',
'model': 'TUCSON'
}
]
}
INVALID_ADDRESS = {
'baseRegistrationNumber': 'TEST0001',
'debtorName': {
'businessName': 'TEST BUS 2 DEBTOR'
},
'authorizationReceived': True,
'registeringParty': {
'businessName': 'ABC SEARCHING COMPANY',
'address': {
'street': '222 SUMMER STREET',
'city': 'VICTORIA',
'region': 'XX',
'country': 'CA',
'postalCode': 'V8W 2V8'
},
'emailAddress': '<EMAIL>'
},
'changeType': 'AC',
'addVehicleCollateral': [
{
'type': 'MV',
'serialNumber': 'KM8J3CA46JU724994',
'year': 2018,
'make': 'HYUNDAI',
'model': 'TUCSON'
}
]
}
# testdata pattern is ({description}, {roles}, {status}, {has_account}, {reg_num}, {base_reg_num})
TEST_GET_STATEMENT = [
('Missing account', [PPR_ROLE], HTTPStatus.BAD_REQUEST, False, 'TEST0009', 'TEST0001'),
('Invalid role', [COLIN_ROLE], HTTPStatus.UNAUTHORIZED, True, 'TEST0009', 'TEST0001'),
('Valid Request', [PPR_ROLE], HTTPStatus.OK, True, 'TEST0009', 'TEST0001'),
('Invalid Registration Number', [PPR_ROLE], HTTPStatus.NOT_FOUND, True, 'TESTXXXX', 'TEST0001'),
('Mismatch registrations non-staff', [PPR_ROLE], HTTPStatus.BAD_REQUEST, True, 'TEST0009', 'TEST0002'),
('Mismatch registrations staff', [PPR_ROLE, STAFF_ROLE], HTTPStatus.OK, True, 'TEST0009', 'TEST0002'),
('Missing account staff', [PPR_ROLE, STAFF_ROLE], HTTPStatus.BAD_REQUEST, False, 'TEST0009', 'TEST0001')
]
@pytest.mark.parametrize('desc,roles,status,has_account,reg_num,base_reg_num', TEST_GET_STATEMENT)
def test_get_change(session, client, jwt, desc, roles, status, has_account, reg_num, base_reg_num):
"""Assert that a get change registration statement works as expected."""
headers = None
# setup
if status == HTTPStatus.UNAUTHORIZED and desc.startswith('Report'):
headers = create_header_account_report(jwt, roles)
elif has_account and BCOL_HELP in roles:
headers = create_header_account(jwt, roles, 'test-user', BCOL_HELP)
elif has_account and STAFF_ROLE in roles:
headers = create_header_account(jwt, roles, 'test-user', STAFF_ROLE)
elif has_account and SBC_OFFICE in roles:
headers = create_header_account(jwt, roles, 'test-user', SBC_OFFICE)
elif has_account:
headers = create_header_account(jwt, roles)
else:
headers = create_header(jwt, roles)
# test
response = client.get('/api/v1/financing-statements/' + base_reg_num + '/changes/' + reg_num,
headers=headers)
# check
assert response.status_code == status
# basic verification statement data check
if status == HTTPStatus.OK:
json_data = response.json
assert json_data['changeRegistrationNumber'] == reg_num
assert len(json_data['changes']) >= 1
assert json_data['changes'][0]['changeRegistrationNumber'] == reg_num
if desc != 'Mismatch registrations staff':
assert json_data['baseRegistrationNumber'] == base_reg_num
assert json_data['changes'][0]['baseRegistrationNumber'] == base_reg_num
| [
1,
396,
14187,
1266,
29871,
30211,
29871,
29906,
29900,
29896,
29929,
17325,
310,
4908,
15411,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
15945,
29908,
24376,
304,
11539,
278,
11782,
3277,
29899,
20788,
3620,
16248,
29889,
13,
13,
3057,
29899,
5091,
568,
304,
9801,
393,
278,
847,
4951,
19985,
29899,
20788,
29914,
1727,
8306,
8009,
29914,
25990,
16248,
338,
1985,
408,
3806,
29889,
13,
15945,
29908,
13,
5215,
3509,
13,
3166,
1732,
1053,
7331,
5709,
13,
13,
5215,
11451,
1688,
13,
3166,
21235,
29918,
11993,
29889,
4773,
29918,
1272,
29889,
407,
29878,
1053,
5868,
24336,
29918,
19713,
13780,
13,
13,
3166,
282,
558,
29918,
2754,
29889,
9916,
29889,
5150,
29920,
1053,
4810,
23714,
29918,
1672,
1307,
29892,
349,
10593,
29918,
1672,
1307,
29892,
317,
6040,
4198,
29918,
1672,
1307,
29892,
317,
5371,
29918,
27681,
12107,
29892,
350,
15032,
29918,
29950,
6670,
29925,
13,
3166,
6987,
29889,
5441,
29889,
9916,
29889,
13239,
1053,
1653,
29918,
6672,
29892,
1653,
29918,
6672,
29918,
10149,
29892,
1653,
29918,
6672,
29918,
10149,
29918,
12276,
13,
13,
13,
6720,
7077,
29918,
7228,
29979,
29918,
4219,
353,
525,
991,
597,
29890,
1037,
29887,
6020,
29899,
29890,
1037,
29887,
6020,
29899,
17640,
29889,
481,
2231,
29872,
29889,
1212,
29914,
17640,
8667,
29914,
10472,
29914,
2754,
29914,
29894,
29896,
22208,
13,
29937,
8273,
4559,
1400,
1735,
3229,
848,
13,
8132,
3580,
1307,
29918,
7249,
353,
3509,
29889,
24535,
8552,
29898,
3210,
24336,
29918,
19713,
13780,
29897,
13,
19713,
13780,
29918,
26707,
353,
426,
13,
29871,
525,
3188,
4597,
8306,
4557,
2396,
525,
18267,
29900,
29900,
29900,
29896,
742,
13,
29871,
525,
311,
3116,
272,
1170,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
18267,
350,
3308,
29871,
29906,
5012,
29933,
29911,
1955,
29915,
13,
29871,
2981,
13,
29871,
525,
8921,
2133,
29816,
2396,
5852,
29892,
13,
29871,
525,
9573,
292,
7439,
29891,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
19658,
3725,
1718,
3210,
4214,
4810,
3580,
2190,
29979,
742,
13,
418,
525,
7328,
2396,
426,
13,
3986,
525,
29352,
2396,
525,
29906,
29906,
29906,
22753,
29924,
1001,
6850,
1525,
2544,
742,
13,
3986,
525,
12690,
2396,
525,
18118,
1783,
1955,
10764,
742,
13,
3986,
525,
12803,
2396,
525,
5371,
742,
13,
3986,
525,
13509,
2396,
525,
5454,
742,
13,
3986,
525,
2490,
284,
3399,
2396,
525,
29963,
29947,
29956,
29871,
29906,
29963,
29947,
29915,
13,
418,
2981,
13,
418,
525,
5269,
7061,
2396,
12801,
26862,
6227,
16299,
13,
29871,
2981,
13,
29871,
525,
3167,
1542,
2396,
525,
2477,
742,
13,
29871,
525,
1202,
29963,
14797,
2512,
28377,
1008,
284,
2396,
518,
13,
418,
426,
13,
3986,
525,
1853,
2396,
525,
29924,
29963,
742,
13,
3986,
525,
15550,
4557,
2396,
525,
29968,
29924,
29947,
29967,
29941,
5454,
29946,
29953,
29967,
29965,
29955,
29906,
29946,
29929,
29929,
29946,
742,
13,
3986,
525,
6360,
2396,
29871,
29906,
29900,
29896,
29947,
29892,
13,
3986,
525,
5675,
2396,
525,
29950,
29979,
18783,
23869,
742,
13,
3986,
525,
4299,
2396,
525,
29911,
23129,
3094,
29915,
13,
418,
500,
13,
29871,
21251,
13,
29871,
525,
27825,
2396,
426,
13,
418,
525,
13556,
21278,
2396,
8207,
10472,
29914,
2754,
29914,
29894,
29896,
29914,
27825,
29899,
24830,
29914,
29906,
29896,
29929,
29929,
29955,
29900,
29900,
29914,
13556,
29875,
16485,
742,
13,
418,
525,
262,
14917,
1204,
2396,
525,
29906,
29896,
29929,
29929,
29955,
29900,
29900,
29915,
13,
29871,
500,
13,
29913,
13,
1177,
26707,
29918,
18166,
29918,
13967,
353,
426,
13,
29871,
525,
3188,
4597,
8306,
4557,
2396,
525,
18267,
22791,
29896,
742,
13,
29871,
525,
311,
3116,
272,
1170,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
18267,
350,
3308,
29871,
29906,
5012,
29933,
29911,
1955,
29915,
13,
29871,
2981,
13,
29871,
525,
8921,
2133,
29816,
2396,
5852,
29892,
13,
29871,
525,
9573,
292,
7439,
29891,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
19658,
3725,
1718,
3210,
4214,
4810,
3580,
2190,
29979,
742,
13,
418,
525,
7328,
2396,
426,
13,
3986,
525,
29352,
2396,
525,
29906,
29906,
29906,
22753,
29924,
1001,
6850,
1525,
2544,
742,
13,
3986,
525,
12690,
2396,
525,
18118,
1783,
1955,
10764,
742,
13,
3986,
525,
12803,
2396,
525,
5371,
742,
13,
3986,
525,
13509,
2396,
525,
5454,
742,
13,
3986,
525,
2490,
284,
3399,
2396,
525,
29963,
29947,
29956,
29871,
29906,
29963,
29947,
29915,
13,
418,
2981,
13,
418,
525,
5269,
7061,
2396,
12801,
26862,
6227,
16299,
13,
29871,
2981,
13,
29871,
525,
3167,
1542,
2396,
525,
2477,
742,
13,
29871,
525,
1202,
29963,
14797,
2512,
28377,
1008,
284,
2396,
518,
13,
418,
426,
13,
3986,
525,
1853,
2396,
525,
29924,
29963,
742,
13,
3986,
525,
15550,
4557,
2396,
525,
29968,
29924,
29947,
29967,
29941,
5454,
29946,
29953,
29967,
29965,
29955,
29906,
29946,
29929,
29929,
29946,
742,
13,
3986,
525,
6360,
2396,
29871,
29906,
29900,
29896,
29947,
29892,
13,
3986,
525,
5675,
2396,
525,
29950,
29979,
18783,
23869,
742,
13,
3986,
525,
4299,
2396,
525,
29911,
23129,
3094,
29915,
13,
418,
500,
13,
29871,
4514,
13,
29913,
13,
10403,
1799,
4214,
29918,
25416,
29918,
2287,
29933,
29911,
1955,
353,
426,
13,
29871,
525,
3188,
4597,
8306,
4557,
2396,
525,
18267,
29900,
29900,
29900,
29896,
742,
13,
29871,
525,
8921,
2133,
29816,
2396,
5852,
29892,
13,
29871,
525,
9573,
292,
7439,
29891,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
19658,
3725,
1718,
3210,
4214,
4810,
3580,
2190,
29979,
742,
13,
418,
525,
7328,
2396,
426,
13,
3986,
525,
29352,
2396,
525,
29906,
29906,
29906,
22753,
29924,
1001,
6850,
1525,
2544,
742,
13,
3986,
525,
12690,
2396,
525,
18118,
1783,
1955,
10764,
742,
13,
3986,
525,
12803,
2396,
525,
5371,
742,
13,
3986,
525,
13509,
2396,
525,
5454,
742,
13,
3986,
525,
2490,
284,
3399,
2396,
525,
29963,
29947,
29956,
29871,
29906,
29963,
29947,
29915,
13,
418,
2981,
13,
418,
525,
5269,
7061,
2396,
12801,
26862,
6227,
16299,
13,
29871,
2981,
13,
29871,
525,
3167,
1542,
2396,
525,
2477,
742,
13,
29871,
525,
1202,
29963,
14797,
2512,
28377,
1008,
284,
2396,
518,
13,
418,
426,
13,
3986,
525,
1853,
2396,
525,
29924,
29963,
742,
13,
3986,
525,
15550,
4557,
2396,
525,
29968,
29924,
29947,
29967,
29941,
5454,
29946,
29953,
29967,
29965,
29955,
29906,
29946,
29929,
29929,
29946,
742,
13,
3986,
525,
6360,
2396,
29871,
29906,
29900,
29896,
29947,
29892,
13,
3986,
525,
5675,
2396,
525,
29950,
29979,
18783,
23869,
742,
13,
3986,
525,
4299,
2396,
525,
29911,
23129,
3094,
29915,
13,
418,
500,
13,
29871,
4514,
13,
29913,
13,
1177,
26707,
29918,
25416,
29918,
2287,
29933,
29911,
1955,
353,
426,
13,
29871,
525,
3188,
4597,
8306,
4557,
2396,
525,
18267,
29900,
29900,
29900,
29896,
742,
13,
29871,
525,
311,
3116,
272,
1170,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
16975,
350,
3308,
29871,
29941,
5012,
29933,
29911,
1955,
29915,
13,
29871,
2981,
13,
29871,
525,
8921,
2133,
29816,
2396,
5852,
29892,
13,
29871,
525,
9573,
292,
7439,
29891,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
19658,
3725,
1718,
3210,
4214,
4810,
3580,
2190,
29979,
742,
13,
418,
525,
7328,
2396,
426,
13,
3986,
525,
29352,
2396,
525,
29906,
29906,
29906,
22753,
29924,
1001,
6850,
1525,
2544,
742,
13,
3986,
525,
12690,
2396,
525,
18118,
1783,
1955,
10764,
742,
13,
3986,
525,
12803,
2396,
525,
5371,
742,
13,
3986,
525,
13509,
2396,
525,
5454,
742,
13,
3986,
525,
2490,
284,
3399,
2396,
525,
29963,
29947,
29956,
29871,
29906,
29963,
29947,
29915,
13,
418,
2981,
13,
418,
525,
5269,
7061,
2396,
12801,
26862,
6227,
16299,
13,
29871,
2981,
13,
29871,
525,
3167,
1542,
2396,
525,
2477,
742,
13,
29871,
525,
1202,
29963,
14797,
2512,
28377,
1008,
284,
2396,
518,
13,
418,
426,
13,
3986,
525,
1853,
2396,
525,
29924,
29963,
742,
13,
3986,
525,
15550,
4557,
2396,
525,
29968,
29924,
29947,
29967,
29941,
5454,
29946,
29953,
29967,
29965,
29955,
29906,
29946,
29929,
29929,
29946,
742,
13,
3986,
525,
6360,
2396,
29871,
29906,
29900,
29896,
29947,
29892,
13,
3986,
525,
5675,
2396,
525,
29950,
29979,
18783,
23869,
742,
13,
3986,
525,
4299,
2396,
525,
29911,
23129,
3094,
29915,
13,
418,
500,
13,
29871,
4514,
13,
29913,
13,
1177,
26707,
29918,
29950,
9047,
1955,
2965,
1964,
353,
426,
13,
29871,
525,
3188,
4597,
8306,
4557,
2396,
525,
18267,
29900,
29900,
29900,
29941,
742,
13,
29871,
525,
311,
3116,
272,
1170,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
18267,
350,
3308,
29871,
29906,
5012,
29933,
29911,
1955,
29915,
13,
29871,
2981,
13,
29871,
525,
8921,
2133,
29816,
2396,
5852,
29892,
13,
29871,
525,
9573,
292,
7439,
29891,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
19658,
3725,
1718,
3210,
4214,
4810,
3580,
2190,
29979,
742,
13,
418,
525,
7328,
2396,
426,
13,
3986,
525,
29352,
2396,
525,
29906,
29906,
29906,
22753,
29924,
1001,
6850,
1525,
2544,
742,
13,
3986,
525,
12690,
2396,
525,
18118,
1783,
1955,
10764,
742,
13,
3986,
525,
12803,
2396,
525,
5371,
742,
13,
3986,
525,
13509,
2396,
525,
5454,
742,
13,
3986,
525,
2490,
284,
3399,
2396,
525,
29963,
29947,
29956,
29871,
29906,
29963,
29947,
29915,
13,
418,
2981,
13,
418,
525,
5269,
7061,
2396,
12801,
26862,
6227,
16299,
13,
29871,
2981,
13,
29871,
525,
3167,
1542,
2396,
525,
2477,
742,
13,
29871,
525,
1202,
29963,
14797,
2512,
28377,
1008,
284,
2396,
518,
13,
418,
426,
13,
3986,
525,
1853,
2396,
525,
29924,
29963,
742,
13,
3986,
525,
15550,
4557,
2396,
525,
29968,
29924,
29947,
29967,
29941,
5454,
29946,
29953,
29967,
29965,
29955,
29906,
29946,
29929,
29929,
29946,
742,
13,
3986,
525,
6360,
2396,
29871,
29906,
29900,
29896,
29947,
29892,
13,
3986,
525,
5675,
2396,
525,
29950,
29979,
18783,
23869,
742,
13,
3986,
525,
4299,
2396,
525,
29911,
23129,
3094,
29915,
13,
418,
500,
13,
29871,
4514,
13,
29913,
13,
1177,
26707,
29918,
16524,
353,
426,
13,
29871,
525,
3188,
4597,
8306,
4557,
2396,
525,
18267,
29900,
29900,
29900,
29896,
742,
13,
29871,
525,
311,
3116,
272,
1170,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
18267,
350,
3308,
29871,
29906,
5012,
29933,
29911,
1955,
29915,
13,
29871,
2981,
13,
29871,
525,
8921,
2133,
29816,
2396,
5852,
29892,
13,
29871,
525,
9573,
292,
7439,
29891,
2396,
426,
13,
418,
525,
401,
2396,
525,
29941,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29915,
13,
29871,
2981,
13,
29871,
525,
3167,
1542,
2396,
525,
2477,
742,
13,
29871,
525,
1202,
29963,
14797,
2512,
28377,
1008,
284,
2396,
518,
13,
418,
426,
13,
3986,
525,
1853,
2396,
525,
29924,
29963,
742,
13,
3986,
525,
15550,
4557,
2396,
525,
29968,
29924,
29947,
29967,
29941,
5454,
29946,
29953,
29967,
29965,
29955,
29906,
29946,
29929,
29929,
29946,
742,
13,
3986,
525,
6360,
2396,
29871,
29906,
29900,
29896,
29947,
29892,
13,
3986,
525,
5675,
2396,
525,
29950,
29979,
18783,
23869,
742,
13,
3986,
525,
4299,
2396,
525,
29911,
23129,
3094,
29915,
13,
418,
500,
13,
29871,
4514,
13,
29913,
13,
1177,
26707,
29918,
17744,
26785,
353,
426,
13,
29871,
525,
3188,
4597,
8306,
4557,
2396,
525,
18267,
29900,
29900,
29900,
29896,
742,
13,
29871,
525,
311,
3116,
272,
1170,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
18267,
350,
3308,
29871,
29906,
5012,
29933,
29911,
1955,
29915,
13,
29871,
2981,
13,
29871,
525,
8921,
2133,
29816,
2396,
5852,
29892,
13,
29871,
525,
9573,
292,
7439,
29891,
2396,
426,
13,
418,
525,
8262,
3335,
1170,
2396,
525,
19658,
3725,
1718,
3210,
4214,
4810,
3580,
2190,
29979,
742,
13,
418,
525,
7328,
2396,
426,
13,
3986,
525,
29352,
2396,
525,
29906,
29906,
29906,
22753,
29924,
1001,
6850,
1525,
2544,
742,
13,
3986,
525,
12690,
2396,
525,
18118,
1783,
1955,
10764,
742,
13,
3986,
525,
12803,
2396,
525,
6247,
742,
13,
3986,
525,
13509,
2396,
525,
5454,
742,
13,
3986,
525,
2490,
284,
3399,
2396,
525,
29963,
29947,
29956,
29871,
29906,
29963,
29947,
29915,
13,
418,
2981,
13,
418,
525,
5269,
7061,
2396,
12801,
26862,
6227,
16299,
13,
29871,
2981,
13,
29871,
525,
3167,
1542,
2396,
525,
2477,
742,
13,
29871,
525,
1202,
29963,
14797,
2512,
28377,
1008,
284,
2396,
518,
13,
418,
426,
13,
3986,
525,
1853,
2396,
525,
29924,
29963,
742,
13,
3986,
525,
15550,
4557,
2396,
525,
29968,
29924,
29947,
29967,
29941,
5454,
29946,
29953,
29967,
29965,
29955,
29906,
29946,
29929,
29929,
29946,
742,
13,
3986,
525,
6360,
2396,
29871,
29906,
29900,
29896,
29947,
29892,
13,
3986,
525,
5675,
2396,
525,
29950,
29979,
18783,
23869,
742,
13,
3986,
525,
4299,
2396,
525,
29911,
23129,
3094,
29915,
13,
418,
500,
13,
29871,
4514,
13,
29913,
13,
13,
29937,
1243,
1272,
4766,
338,
21313,
8216,
1118,
426,
307,
793,
1118,
426,
4882,
1118,
426,
5349,
29918,
10149,
1118,
426,
1727,
29918,
1949,
1118,
426,
3188,
29918,
1727,
29918,
1949,
1800,
13,
18267,
29918,
7194,
29918,
19713,
13780,
353,
518,
13,
1678,
6702,
18552,
292,
3633,
742,
518,
29925,
10593,
29918,
1672,
1307,
1402,
7331,
5709,
29889,
29933,
3035,
29918,
16244,
29892,
7700,
29892,
525,
18267,
29900,
29900,
29900,
29929,
742,
525,
18267,
29900,
29900,
29900,
29896,
5477,
13,
1678,
6702,
13919,
6297,
742,
518,
15032,
1177,
29918,
1672,
1307,
1402,
7331,
5709,
29889,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
29892,
5852,
29892,
525,
18267,
29900,
29900,
29900,
29929,
742,
525,
18267,
29900,
29900,
29900,
29896,
5477,
13,
1678,
6702,
7211,
10729,
742,
518,
29925,
10593,
29918,
1672,
1307,
1402,
7331,
5709,
29889,
8949,
29892,
5852,
29892,
525,
18267,
29900,
29900,
29900,
29929,
742,
525,
18267,
29900,
29900,
29900,
29896,
5477,
13,
1678,
6702,
13919,
2169,
8306,
9681,
742,
518,
29925,
10593,
29918,
1672,
1307,
1402,
7331,
5709,
29889,
12256,
29918,
5800,
18783,
29892,
5852,
29892,
525,
18267,
19165,
742,
525,
18267,
29900,
29900,
29900,
29896,
5477,
13,
1678,
6702,
29924,
1608,
905,
21557,
800,
1661,
29899,
303,
3470,
742,
518,
29925,
10593,
29918,
1672,
1307,
1402,
7331,
5709,
29889,
29933,
3035,
29918,
16244,
29892,
5852,
29892,
525,
18267,
29900,
29900,
29900,
29929,
742,
525,
18267,
29900,
29900,
29900,
29906,
5477,
13,
1678,
6702,
29924,
1608,
905,
21557,
800,
13925,
742,
518,
29925,
10593,
29918,
1672,
1307,
29892,
317,
6040,
4198,
29918,
1672,
1307,
1402,
7331,
5709,
29889,
8949,
29892,
5852,
29892,
525,
18267,
29900,
29900,
29900,
29929,
742,
525,
18267,
29900,
29900,
29900,
29906,
5477,
13,
1678,
6702,
18552,
292,
3633,
13925,
742,
518,
29925,
10593,
29918,
1672,
1307,
29892,
317,
6040,
4198,
29918,
1672,
1307,
1402,
7331,
5709,
29889,
29933,
3035,
29918,
16244,
29892,
7700,
29892,
525,
18267,
29900,
29900,
29900,
29929,
742,
525,
18267,
29900,
29900,
29900,
29896,
1495,
13,
29962,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
877,
14273,
29892,
307,
793,
29892,
4882,
29892,
5349,
29918,
10149,
29892,
1727,
29918,
1949,
29892,
3188,
29918,
1727,
29918,
1949,
742,
17067,
1254,
29918,
7194,
29918,
19713,
13780,
29897,
13,
1753,
1243,
29918,
657,
29918,
3167,
29898,
7924,
29892,
3132,
29892,
432,
14554,
29892,
5153,
29892,
16178,
29892,
4660,
29892,
756,
29918,
10149,
29892,
1072,
29918,
1949,
29892,
2967,
29918,
1727,
29918,
1949,
1125,
13,
1678,
9995,
14697,
393,
263,
679,
1735,
22583,
3229,
1736,
408,
3806,
1213,
15945,
13,
1678,
9066,
353,
6213,
13,
1678,
396,
6230,
13,
1678,
565,
4660,
1275,
7331,
5709,
29889,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
322,
5153,
29889,
27382,
2541,
877,
13020,
29374,
13,
4706,
9066,
353,
1653,
29918,
6672,
29918,
10149,
29918,
12276,
29898,
29926,
14554,
29892,
16178,
29897,
13,
1678,
25342,
756,
29918,
10149,
322,
350,
15032,
29918,
29950,
6670,
29925,
297,
16178,
29901,
13,
4706,
9066,
353,
1653,
29918,
6672,
29918,
10149,
29898,
29926,
14554,
29892,
16178,
29892,
525,
1688,
29899,
1792,
742,
350,
15032,
29918,
29950,
6670,
29925,
29897,
13,
1678,
25342,
756,
29918,
10149,
322,
317,
6040,
4198,
29918,
1672,
1307,
297,
16178,
29901,
13,
4706,
9066,
353,
1653,
29918,
6672,
29918,
10149,
29898,
29926,
14554,
29892,
16178,
29892,
525,
1688,
29899,
1792,
742,
317,
6040,
4198,
29918,
1672,
1307,
29897,
13,
1678,
25342,
756,
29918,
10149,
322,
317,
5371,
29918,
27681,
12107,
297,
16178,
29901,
13,
4706,
9066,
353,
1653,
29918,
6672,
29918,
10149,
29898,
29926,
14554,
29892,
16178,
29892,
525,
1688,
29899,
1792,
742,
317,
5371,
29918,
27681,
12107,
29897,
13,
1678,
25342,
756,
29918,
10149,
29901,
13,
4706,
9066,
353,
1653,
29918,
6672,
29918,
10149,
29898,
29926,
14554,
29892,
16178,
29897,
13,
1678,
1683,
29901,
13,
4706,
9066,
353,
1653,
29918,
6672,
29898,
29926,
14554,
29892,
16178,
29897,
13,
13,
1678,
396,
1243,
13,
1678,
2933,
353,
3132,
29889,
657,
11219,
2754,
29914,
29894,
29896,
29914,
4951,
19985,
29899,
6112,
4110,
22208,
718,
2967,
29918,
1727,
29918,
1949,
718,
8207,
25990,
22208,
718,
1072,
29918,
1949,
29892,
13,
462,
3986,
9066,
29922,
13662,
29897,
13,
13,
1678,
396,
1423,
13,
1678,
4974,
2933,
29889,
4882,
29918,
401,
1275,
4660,
13,
1678,
396,
6996,
1147,
2450,
3229,
848,
1423,
13,
1678,
565,
4660,
1275,
7331,
5709,
29889,
8949,
29901,
13,
4706,
4390,
29918,
1272,
353,
2933,
29889,
3126,
13,
4706,
4974,
4390,
29918,
1272,
1839,
3167,
4597,
8306,
4557,
2033,
1275,
1072,
29918,
1949,
13,
4706,
4974,
7431,
29898,
3126,
29918,
1272,
1839,
25990,
11287,
6736,
29871,
29896,
13,
4706,
4974,
4390,
29918,
1272,
1839,
25990,
2033,
29961,
29900,
22322,
3167,
4597,
8306,
4557,
2033,
1275,
1072,
29918,
1949,
13,
4706,
565,
5153,
2804,
525,
29924,
1608,
905,
21557,
800,
13925,
2396,
13,
9651,
4974,
4390,
29918,
1272,
1839,
3188,
4597,
8306,
4557,
2033,
1275,
2967,
29918,
1727,
29918,
1949,
13,
9651,
4974,
4390,
29918,
1272,
1839,
25990,
2033,
29961,
29900,
22322,
3188,
4597,
8306,
4557,
2033,
1275,
2967,
29918,
1727,
29918,
1949,
13,
2
] |
swappingFiles.py | anudhatgithub/Functions | 0 | 59100 | <gh_stars>0
def changecode():
file1=input("Enter your file name1")
file2=input("Enter your file name2")
with open(file1,"r") as a:
data_a = a.read()
with open(file2,"r") as b:
data_b = b.read()
with open(file1,"w") as a:
a.write(data_b)
with open(file2,"w") as b:
b.write(data_a)
changecode()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
1753,
1735,
401,
7295,
13,
268,
13,
1678,
934,
29896,
29922,
2080,
703,
10399,
596,
934,
1024,
29896,
1159,
13,
1678,
934,
29906,
29922,
2080,
703,
10399,
596,
934,
1024,
29906,
1159,
13,
268,
13,
1678,
411,
1722,
29898,
1445,
29896,
1699,
29878,
1159,
408,
263,
29901,
13,
4706,
848,
29918,
29874,
353,
263,
29889,
949,
580,
13,
1678,
411,
1722,
29898,
1445,
29906,
1699,
29878,
1159,
408,
289,
29901,
13,
4706,
848,
29918,
29890,
353,
289,
29889,
949,
580,
13,
1678,
411,
1722,
29898,
1445,
29896,
1699,
29893,
1159,
408,
263,
29901,
13,
4706,
263,
29889,
3539,
29898,
1272,
29918,
29890,
29897,
13,
1678,
411,
1722,
29898,
1445,
29906,
1699,
29893,
1159,
408,
289,
29901,
13,
4706,
289,
29889,
3539,
29898,
1272,
29918,
29874,
29897,
13,
13,
308,
13,
3167,
401,
580,
13,
13,
2
] |
plotly/validators/scatter/_mode.py | faezs/plotly.py | 2 | 136891 | import _plotly_utils.basevalidators
class ModeValidator(_plotly_utils.basevalidators.FlaglistValidator):
def __init__(self, plotly_name='mode', parent_name='scatter', **kwargs):
super(ModeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type='calc',
extras=['none'],
flags=['lines', 'markers', 'text'],
role='info',
**kwargs
)
| [
1,
1053,
903,
5317,
368,
29918,
13239,
29889,
3188,
3084,
4097,
13,
13,
13,
1990,
21864,
24204,
7373,
5317,
368,
29918,
13239,
29889,
3188,
3084,
4097,
29889,
21979,
1761,
24204,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
6492,
368,
29918,
978,
2433,
8513,
742,
3847,
29918,
978,
2433,
1557,
2620,
742,
3579,
19290,
1125,
13,
4706,
2428,
29898,
6818,
24204,
29892,
1583,
467,
1649,
2344,
12035,
13,
9651,
6492,
368,
29918,
978,
29922,
5317,
368,
29918,
978,
29892,
13,
9651,
3847,
29918,
978,
29922,
3560,
29918,
978,
29892,
13,
9651,
3863,
29918,
1853,
2433,
28667,
742,
13,
9651,
429,
10678,
29922,
1839,
9290,
7464,
13,
9651,
13449,
29922,
1839,
9012,
742,
525,
3502,
414,
742,
525,
726,
7464,
13,
9651,
6297,
2433,
3888,
742,
13,
9651,
3579,
19290,
13,
4706,
1723,
13,
2
] |
eden/cli/doctor/test/disk_usage_test.py | jmswen/eden | 0 | 178628 | #!/usr/bin/env python3
#
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import collections
import typing
from typing import List, Optional
from unittest.mock import patch
import eden.cli.doctor as doctor
from eden.cli.config import EdenInstance
from eden.cli.doctor.problem import ProblemBase, ProblemTracker
from eden.cli.doctor.test.lib.fake_eden_instance import FakeEdenInstance
from eden.cli.doctor.test.lib.testcase import DoctorTestBase
class DiskUsageTest(DoctorTestBase):
def _mock_disk_usage(self, blocks, avail, frsize=1024) -> None:
"""Mock test for disk usage."""
mock_statvfs_patcher = patch("eden.cli.doctor.os.statvfs")
mock_statvfs = mock_statvfs_patcher.start()
self.addCleanup(lambda: mock_statvfs.stop())
statvfs_tuple = collections.namedtuple("statvfs", "f_blocks f_bavail f_frsize")
mock_statvfs.return_value = statvfs_tuple(blocks, avail, frsize)
mock_getmountpt_and_deviceid_patcher = patch(
"eden.cli.doctor.check_filesystems.get_mountpt"
)
mock_getmountpt_and_deviceid = mock_getmountpt_and_deviceid_patcher.start()
self.addCleanup(lambda: mock_getmountpt_and_deviceid.stop())
mock_getmountpt_and_deviceid.return_value = "/"
def _check_disk_usage(
self, instance: Optional[FakeEdenInstance] = None
) -> List[ProblemBase]:
problem_collector = ProblemCollector()
if instance is None:
instance = FakeEdenInstance(self.make_temporary_directory())
doctor.check_filesystems.check_disk_usage(
tracker=problem_collector,
mount_paths=["/"],
instance=typing.cast(EdenInstance, instance),
)
return problem_collector.problems
def test_low_free_absolute_disk_is_major(self):
self._mock_disk_usage(blocks=100000000, avail=500000)
problems = self._check_disk_usage()
self.assertEqual(
problems[0].description(),
"/ has only 512000000 bytes available. "
"Eden lazily loads your files and needs enough disk "
"space to store these files when loaded.",
)
self.assertEqual(problems[0].severity(), doctor.ProblemSeverity.ERROR)
def test_low_percentage_free_but_high_absolute_free_disk_is_minor(self):
self._mock_disk_usage(blocks=100000000, avail=2000000)
problems = self._check_disk_usage()
self.assertEqual(
problems[0].description(),
"/ is 98.00% full. "
"Eden lazily loads your files and needs enough disk "
"space to store these files when loaded.",
)
self.assertEqual(problems[0].severity(), doctor.ProblemSeverity.ADVICE)
def test_high_percentage_free_but_small_disk_is_major(self):
self._mock_disk_usage(blocks=800000, avail=500000)
problems = self._check_disk_usage()
self.assertEqual(
problems[0].description(),
"/ has only 512000000 bytes available. "
"Eden lazily loads your files and needs enough disk "
"space to store these files when loaded.",
)
self.assertEqual(problems[0].severity(), doctor.ProblemSeverity.ERROR)
def test_disk_usage_normal(self):
self._mock_disk_usage(blocks=100000000, avail=50000000)
problems = self._check_disk_usage()
self.assertEqual(len(problems), 0)
def test_issue_includes_custom_message_from_config(self) -> None:
self._mock_disk_usage(blocks=100000000, avail=500000)
instance = FakeEdenInstance(
self.make_temporary_directory(),
config={
"doctor.low-disk-space-message": "Ask your administrator for help."
},
)
problems = self._check_disk_usage(instance=instance)
self.assertEqual(
problems[0].description(),
"/ has only 512000000 bytes available. "
"Eden lazily loads your files and needs enough disk "
"space to store these files when loaded. Ask your administrator "
"for help.",
)
self._mock_disk_usage(blocks=100000000, avail=2000000)
instance = FakeEdenInstance(
self.make_temporary_directory(),
config={
"doctor.low-disk-space-message": "Ask your administrator for help."
},
)
problems = self._check_disk_usage(instance=instance)
self.assertEqual(
problems[0].description(),
"/ is 98.00% full. "
"Eden lazily loads your files and needs enough disk "
"space to store these files when loaded. Ask your administrator "
"for help.",
)
class ProblemCollector(ProblemTracker):
problems: List[ProblemBase]
def __init__(self) -> None:
super().__init__()
self.problems = []
def add_problem(self, problem: ProblemBase) -> None:
self.problems.append(problem)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29929,
29899,
6338,
29892,
13327,
29892,
9266,
29889,
13,
29937,
2178,
10462,
21676,
29889,
13,
29937,
13,
29937,
910,
2752,
775,
338,
7794,
21144,
1090,
278,
350,
7230,
29899,
3293,
19405,
1476,
297,
278,
13,
29937,
365,
2965,
1430,
1660,
934,
297,
278,
3876,
3884,
310,
445,
2752,
5447,
29889,
530,
5684,
16690,
13,
29937,
310,
2373,
296,
10462,
508,
367,
1476,
297,
278,
349,
1299,
3919,
29903,
934,
297,
278,
1021,
3884,
29889,
13,
13,
5215,
16250,
13,
5215,
19229,
13,
3166,
19229,
1053,
2391,
29892,
28379,
13,
3166,
443,
27958,
29889,
17640,
1053,
13261,
13,
13,
5215,
1226,
264,
29889,
11303,
29889,
1867,
2801,
408,
11619,
13,
3166,
1226,
264,
29889,
11303,
29889,
2917,
1053,
382,
1145,
4998,
13,
3166,
1226,
264,
29889,
11303,
29889,
1867,
2801,
29889,
17199,
1053,
11583,
5160,
29892,
11583,
5323,
4937,
13,
3166,
1226,
264,
29889,
11303,
29889,
1867,
2801,
29889,
1688,
29889,
1982,
29889,
29888,
1296,
29918,
6424,
29918,
8758,
1053,
383,
1296,
29923,
1145,
4998,
13,
3166,
1226,
264,
29889,
11303,
29889,
1867,
2801,
29889,
1688,
29889,
1982,
29889,
1688,
4878,
1053,
15460,
3057,
5160,
13,
13,
13,
1990,
20579,
27573,
3057,
29898,
6132,
2801,
3057,
5160,
1125,
13,
1678,
822,
903,
17640,
29918,
20960,
29918,
21125,
29898,
1311,
29892,
10930,
29892,
20847,
29892,
1424,
2311,
29922,
29896,
29900,
29906,
29946,
29897,
1599,
6213,
29901,
13,
4706,
9995,
18680,
1243,
363,
8086,
8744,
1213,
15945,
13,
4706,
11187,
29918,
6112,
29894,
5847,
29918,
5041,
261,
353,
13261,
703,
6424,
29889,
11303,
29889,
1867,
2801,
29889,
359,
29889,
6112,
29894,
5847,
1159,
13,
4706,
11187,
29918,
6112,
29894,
5847,
353,
11187,
29918,
6112,
29894,
5847,
29918,
5041,
261,
29889,
2962,
580,
13,
4706,
1583,
29889,
1202,
29907,
14044,
786,
29898,
2892,
29901,
11187,
29918,
6112,
29894,
5847,
29889,
9847,
3101,
13,
4706,
1002,
29894,
5847,
29918,
23583,
353,
16250,
29889,
17514,
23583,
703,
6112,
29894,
5847,
613,
376,
29888,
29918,
1271,
29879,
285,
29918,
29890,
485,
737,
285,
29918,
1341,
2311,
1159,
13,
4706,
11187,
29918,
6112,
29894,
5847,
29889,
2457,
29918,
1767,
353,
1002,
29894,
5847,
29918,
23583,
29898,
1271,
29879,
29892,
20847,
29892,
1424,
2311,
29897,
13,
13,
4706,
11187,
29918,
657,
16476,
415,
29918,
392,
29918,
10141,
333,
29918,
5041,
261,
353,
13261,
29898,
13,
9651,
376,
6424,
29889,
11303,
29889,
1867,
2801,
29889,
3198,
29918,
5325,
973,
29879,
29889,
657,
29918,
16476,
415,
29908,
13,
4706,
1723,
13,
4706,
11187,
29918,
657,
16476,
415,
29918,
392,
29918,
10141,
333,
353,
11187,
29918,
657,
16476,
415,
29918,
392,
29918,
10141,
333,
29918,
5041,
261,
29889,
2962,
580,
13,
4706,
1583,
29889,
1202,
29907,
14044,
786,
29898,
2892,
29901,
11187,
29918,
657,
16476,
415,
29918,
392,
29918,
10141,
333,
29889,
9847,
3101,
13,
4706,
11187,
29918,
657,
16476,
415,
29918,
392,
29918,
10141,
333,
29889,
2457,
29918,
1767,
353,
5591,
29908,
13,
13,
1678,
822,
903,
3198,
29918,
20960,
29918,
21125,
29898,
13,
4706,
1583,
29892,
2777,
29901,
28379,
29961,
29943,
1296,
29923,
1145,
4998,
29962,
353,
6213,
13,
1678,
1723,
1599,
2391,
29961,
26604,
5160,
5387,
13,
4706,
1108,
29918,
15914,
272,
353,
11583,
28916,
272,
580,
13,
4706,
565,
2777,
338,
6213,
29901,
13,
9651,
2777,
353,
383,
1296,
29923,
1145,
4998,
29898,
1311,
29889,
5675,
29918,
1356,
1971,
653,
29918,
12322,
3101,
13,
13,
4706,
11619,
29889,
3198,
29918,
5325,
973,
29879,
29889,
3198,
29918,
20960,
29918,
21125,
29898,
13,
9651,
1020,
4937,
29922,
17199,
29918,
15914,
272,
29892,
13,
9651,
5766,
29918,
24772,
29922,
3366,
29914,
12436,
13,
9651,
2777,
29922,
1017,
15702,
29889,
4384,
29898,
29923,
1145,
4998,
29892,
2777,
511,
13,
4706,
1723,
13,
4706,
736,
1108,
29918,
15914,
272,
29889,
17199,
29879,
13,
13,
1678,
822,
1243,
29918,
677,
29918,
9021,
29918,
23552,
29918,
20960,
29918,
275,
29918,
21355,
29898,
1311,
1125,
13,
4706,
1583,
3032,
17640,
29918,
20960,
29918,
21125,
29898,
1271,
29879,
29922,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
20847,
29922,
29945,
29900,
29900,
29900,
29900,
29900,
29897,
13,
4706,
4828,
353,
1583,
3032,
3198,
29918,
20960,
29918,
21125,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
4828,
29961,
29900,
1822,
8216,
3285,
13,
9651,
5591,
756,
871,
29871,
29945,
29896,
29906,
29900,
29900,
29900,
29900,
29900,
29900,
6262,
3625,
29889,
376,
13,
9651,
376,
29923,
1145,
425,
29920,
2354,
15376,
596,
2066,
322,
4225,
3307,
8086,
376,
13,
9651,
376,
3493,
304,
3787,
1438,
2066,
746,
7500,
19602,
13,
4706,
1723,
13,
4706,
1583,
29889,
9294,
9843,
29898,
17199,
29879,
29961,
29900,
1822,
344,
369,
537,
3285,
11619,
29889,
26604,
29903,
1310,
537,
29889,
11432,
29897,
13,
13,
1678,
822,
1243,
29918,
677,
29918,
25376,
482,
29918,
9021,
29918,
4187,
29918,
9812,
29918,
23552,
29918,
9021,
29918,
20960,
29918,
275,
29918,
1195,
272,
29898,
1311,
1125,
13,
4706,
1583,
3032,
17640,
29918,
20960,
29918,
21125,
29898,
1271,
29879,
29922,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
20847,
29922,
29906,
29900,
29900,
29900,
29900,
29900,
29900,
29897,
13,
4706,
4828,
353,
1583,
3032,
3198,
29918,
20960,
29918,
21125,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
4828,
29961,
29900,
1822,
8216,
3285,
13,
9651,
5591,
338,
29871,
29929,
29947,
29889,
29900,
29900,
29995,
2989,
29889,
376,
13,
9651,
376,
29923,
1145,
425,
29920,
2354,
15376,
596,
2066,
322,
4225,
3307,
8086,
376,
13,
9651,
376,
3493,
304,
3787,
1438,
2066,
746,
7500,
19602,
13,
4706,
1723,
13,
4706,
1583,
29889,
9294,
9843,
29898,
17199,
29879,
29961,
29900,
1822,
344,
369,
537,
3285,
11619,
29889,
26604,
29903,
1310,
537,
29889,
3035,
19059,
29897,
13,
13,
1678,
822,
1243,
29918,
9812,
29918,
25376,
482,
29918,
9021,
29918,
4187,
29918,
9278,
29918,
20960,
29918,
275,
29918,
21355,
29898,
1311,
1125,
13,
4706,
1583,
3032,
17640,
29918,
20960,
29918,
21125,
29898,
1271,
29879,
29922,
29947,
29900,
29900,
29900,
29900,
29900,
29892,
20847,
29922,
29945,
29900,
29900,
29900,
29900,
29900,
29897,
13,
4706,
4828,
353,
1583,
3032,
3198,
29918,
20960,
29918,
21125,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
4828,
29961,
29900,
1822,
8216,
3285,
13,
9651,
5591,
756,
871,
29871,
29945,
29896,
29906,
29900,
29900,
29900,
29900,
29900,
29900,
6262,
3625,
29889,
376,
13,
9651,
376,
29923,
1145,
425,
29920,
2354,
15376,
596,
2066,
322,
4225,
3307,
8086,
376,
13,
9651,
376,
3493,
304,
3787,
1438,
2066,
746,
7500,
19602,
13,
4706,
1723,
13,
4706,
1583,
29889,
9294,
9843,
29898,
17199,
29879,
29961,
29900,
1822,
344,
369,
537,
3285,
11619,
29889,
26604,
29903,
1310,
537,
29889,
11432,
29897,
13,
13,
1678,
822,
1243,
29918,
20960,
29918,
21125,
29918,
8945,
29898,
1311,
1125,
13,
4706,
1583,
3032,
17640,
29918,
20960,
29918,
21125,
29898,
1271,
29879,
29922,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
20847,
29922,
29945,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29897,
13,
4706,
4828,
353,
1583,
3032,
3198,
29918,
20960,
29918,
21125,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
17199,
29879,
511,
29871,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
15118,
29918,
24572,
29918,
6341,
29918,
4906,
29918,
3166,
29918,
2917,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1583,
3032,
17640,
29918,
20960,
29918,
21125,
29898,
1271,
29879,
29922,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
20847,
29922,
29945,
29900,
29900,
29900,
29900,
29900,
29897,
13,
4706,
2777,
353,
383,
1296,
29923,
1145,
4998,
29898,
13,
9651,
1583,
29889,
5675,
29918,
1356,
1971,
653,
29918,
12322,
3285,
13,
9651,
2295,
3790,
13,
18884,
376,
1867,
2801,
29889,
677,
29899,
20960,
29899,
3493,
29899,
4906,
1115,
376,
29909,
808,
596,
27443,
363,
1371,
1213,
13,
9651,
2981,
13,
4706,
1723,
13,
4706,
4828,
353,
1583,
3032,
3198,
29918,
20960,
29918,
21125,
29898,
8758,
29922,
8758,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
4828,
29961,
29900,
1822,
8216,
3285,
13,
9651,
5591,
756,
871,
29871,
29945,
29896,
29906,
29900,
29900,
29900,
29900,
29900,
29900,
6262,
3625,
29889,
376,
13,
9651,
376,
29923,
1145,
425,
29920,
2354,
15376,
596,
2066,
322,
4225,
3307,
8086,
376,
13,
9651,
376,
3493,
304,
3787,
1438,
2066,
746,
7500,
29889,
26579,
596,
27443,
376,
13,
9651,
376,
1454,
1371,
19602,
13,
4706,
1723,
13,
13,
4706,
1583,
3032,
17640,
29918,
20960,
29918,
21125,
29898,
1271,
29879,
29922,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
20847,
29922,
29906,
29900,
29900,
29900,
29900,
29900,
29900,
29897,
13,
4706,
2777,
353,
383,
1296,
29923,
1145,
4998,
29898,
13,
9651,
1583,
29889,
5675,
29918,
1356,
1971,
653,
29918,
12322,
3285,
13,
9651,
2295,
3790,
13,
18884,
376,
1867,
2801,
29889,
677,
29899,
20960,
29899,
3493,
29899,
4906,
1115,
376,
29909,
808,
596,
27443,
363,
1371,
1213,
13,
9651,
2981,
13,
4706,
1723,
13,
4706,
4828,
353,
1583,
3032,
3198,
29918,
20960,
29918,
21125,
29898,
8758,
29922,
8758,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13,
9651,
4828,
29961,
29900,
1822,
8216,
3285,
13,
9651,
5591,
338,
29871,
29929,
29947,
29889,
29900,
29900,
29995,
2989,
29889,
376,
13,
9651,
376,
29923,
1145,
425,
29920,
2354,
15376,
596,
2066,
322,
4225,
3307,
8086,
376,
13,
9651,
376,
3493,
304,
3787,
1438,
2066,
746,
7500,
29889,
26579,
596,
27443,
376,
13,
9651,
376,
1454,
1371,
19602,
13,
4706,
1723,
13,
13,
13,
1990,
11583,
28916,
272,
29898,
26604,
5323,
4937,
1125,
13,
1678,
4828,
29901,
2391,
29961,
26604,
5160,
29962,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29897,
1599,
6213,
29901,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
17199,
29879,
353,
5159,
13,
13,
1678,
822,
788,
29918,
17199,
29898,
1311,
29892,
1108,
29901,
11583,
5160,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
17199,
29879,
29889,
4397,
29898,
17199,
29897,
13,
2
] |
providers/brewerslab.py | allena29/brewerslabng | 1 | 170620 | #!/usr/bin/python3
import dataprovider
class brewerslab(dataprovider.DataProvider):
MODULE_NAME = "brewerslab"
DEBUG = True
def process_path(self, dry_run, xpath, oper, old_val, new_val):
print(xpath)
dp = brewerslab()
dp.connect()
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
29941,
13,
13,
5215,
1418,
481,
307,
5489,
13,
13,
1990,
2078,
17538,
8205,
29898,
4130,
481,
307,
5489,
29889,
1469,
6980,
1125,
13,
13,
1678,
341,
13668,
29965,
1307,
29918,
5813,
353,
376,
1030,
17538,
8205,
29908,
13,
1678,
21681,
353,
5852,
13,
13,
1678,
822,
1889,
29918,
2084,
29898,
1311,
29892,
15589,
29918,
3389,
29892,
921,
2084,
29892,
1751,
29892,
2030,
29918,
791,
29892,
716,
29918,
791,
1125,
13,
4706,
1596,
29898,
23635,
29897,
13,
13,
13,
6099,
353,
2078,
17538,
8205,
580,
13,
6099,
29889,
6915,
580,
13,
2
] |
flaskr/services/file_to_db_service.py | baloo1379/db_aspell | 0 | 147808 | <reponame>baloo1379/db_aspell<filename>flaskr/services/file_to_db_service.py
import os
import re
from flaskr.models.file import createFile
from flaskr.models.word import createOrUpdateWord
class FileToDBService:
file_name = None
file_content = None
word_list = []
def setFileName(self, file_name):
self.file_name = file_name
def setFileContent(self, content):
self.file_content = content
def setWords(self):
if self.file_content is not None:
self.parseFileContent()
self.createDB()
def saveFromFile(self):
if self.file_name is not None:
self.readFile()
self.setWords()
self.removeFile()
def readFile(self):
file = open(self.file_name, "r")
self.file_content = file.read()
file.close()
def removeFile(self):
os.remove(self.file_name)
def parseFileContent(self):
self.word_list = re.sub(r'[^a-ząćęłńóśźżĄĆĘŁŃÓŚŹŻA-Z0-9\n ]', r'', self.file_content).split()
def createDB(self):
file = createFile(self.file_name)
for word in self.word_list:
if len(word) >= 2:
createOrUpdateWord(word=word, file=file)
| [
1,
529,
276,
1112,
420,
29958,
5521,
3634,
29896,
29941,
29955,
29929,
29914,
2585,
29918,
4692,
514,
29966,
9507,
29958,
1579,
1278,
29878,
29914,
9916,
29914,
1445,
29918,
517,
29918,
2585,
29918,
5509,
29889,
2272,
13,
5215,
2897,
13,
5215,
337,
13,
13,
3166,
29784,
29878,
29889,
9794,
29889,
1445,
1053,
1653,
2283,
13,
3166,
29784,
29878,
29889,
9794,
29889,
1742,
1053,
1653,
2816,
6422,
14463,
13,
13,
13,
1990,
3497,
1762,
4051,
3170,
29901,
13,
1678,
934,
29918,
978,
353,
6213,
13,
1678,
934,
29918,
3051,
353,
6213,
13,
1678,
1734,
29918,
1761,
353,
5159,
13,
13,
1678,
822,
731,
17020,
29898,
1311,
29892,
934,
29918,
978,
1125,
13,
4706,
1583,
29889,
1445,
29918,
978,
353,
934,
29918,
978,
13,
13,
1678,
822,
731,
2283,
3916,
29898,
1311,
29892,
2793,
1125,
13,
4706,
1583,
29889,
1445,
29918,
3051,
353,
2793,
13,
13,
1678,
822,
731,
29956,
4339,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
1445,
29918,
3051,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
5510,
2283,
3916,
580,
13,
9651,
1583,
29889,
3258,
4051,
580,
13,
13,
1678,
822,
4078,
4591,
2283,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
1445,
29918,
978,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
949,
2283,
580,
13,
9651,
1583,
29889,
842,
29956,
4339,
580,
13,
9651,
1583,
29889,
5992,
2283,
580,
13,
13,
1678,
822,
1303,
2283,
29898,
1311,
1125,
13,
4706,
934,
353,
1722,
29898,
1311,
29889,
1445,
29918,
978,
29892,
376,
29878,
1159,
13,
4706,
1583,
29889,
1445,
29918,
3051,
353,
934,
29889,
949,
580,
13,
4706,
934,
29889,
5358,
580,
13,
13,
1678,
822,
3349,
2283,
29898,
1311,
1125,
13,
4706,
2897,
29889,
5992,
29898,
1311,
29889,
1445,
29918,
978,
29897,
13,
13,
1678,
822,
6088,
2283,
3916,
29898,
1311,
1125,
13,
4706,
1583,
29889,
1742,
29918,
1761,
353,
337,
29889,
1491,
29898,
29878,
29915,
22896,
29874,
29899,
6429,
30063,
30023,
30006,
30066,
29980,
30045,
30109,
30042,
199,
135,
30479,
199,
155,
30153,
200,
134,
30178,
30127,
30464,
30157,
29909,
29899,
29999,
29900,
29899,
29929,
29905,
29876,
4514,
742,
364,
29915,
742,
1583,
29889,
1445,
29918,
3051,
467,
5451,
580,
13,
13,
1678,
822,
1653,
4051,
29898,
1311,
1125,
13,
4706,
934,
353,
1653,
2283,
29898,
1311,
29889,
1445,
29918,
978,
29897,
13,
13,
4706,
363,
1734,
297,
1583,
29889,
1742,
29918,
1761,
29901,
13,
9651,
565,
7431,
29898,
1742,
29897,
6736,
29871,
29906,
29901,
13,
18884,
1653,
2816,
6422,
14463,
29898,
1742,
29922,
1742,
29892,
934,
29922,
1445,
29897,
13,
2
] |
pdfreader/types/objects.py | tmcclintock/pdfreader | 0 | 38535 | <gh_stars>0
from ..utils import cached_property
from ..pillow import PILImageMixin
from .native import Stream, Dictionary, Array, Name
class StartXRef(object):
""" startxref
123
Pseudo object. Can be between indirect objects if any incremental updates.
"""
def __init__(self, offset):
self.offset = offset
def __repr__(self):
return "<StartXRef: {}>".format(self.offset)
def __eq__(self, other):
return self.offset == other.offset
class Trailer(object):
""" trailer
<<< ... .>>
endtrailer
Pseudo object. Can be between indirect objects if any incremental updates.
"""
def __init__(self, params):
self.params = params
def __repr__(self):
return "<Trailer: {}>".format(self.params)
def __eq__(self, other):
return self.params == other.params
class StreamBasedObject(Stream):
""" Stream-based object.
Automatically resolves indirect references on attributes access """
def __init__(self, doc, stream):
super(StreamBasedObject, self).__init__(stream.dictionary, stream.stream)
self.doc = doc
self._cache = dict()
@classmethod
def from_stream(cls, other):
obj = super(StreamBasedObject, StreamBasedObject).from_stream(other)
obj.doc = other.doc
def __getattr__(self, item):
if item in self._cache:
return self._cache[item]
obj = super(StreamBasedObject, self).__getattr__(item)
obj = self.doc.build(obj, lazy=True)
self._cache[item] = obj
return self._cache[item]
class ArrayBasedObject(Array):
""" Array-based object.
Automatically resolves indirect references on items access """
def __init__(self, doc, lst):
self.doc = doc
# ToDo: this must be lazier thing.
# Need to build objects only on access attempt only. For example: a.index, a[i], a[1:2] etc.
lst = [self.doc.build(obj, lazy=True) for obj in lst]
super(ArrayBasedObject, self).__init__(lst)
class DictBasedObject(Dictionary):
""" Dictionary-based object.
Automatically resolves indirect references on attributes/items access """
def __init__(self, doc, *args, **kwargs):
super(DictBasedObject, self).__init__(*args, **kwargs)
self.doc = doc
self._cache = dict()
def __getattr__(self, item):
return self.get(item)
def __getitem__(self, item):
if item in self._cache:
return self._cache[item]
obj = super(DictBasedObject, self).__getitem__(item)
obj = self.doc.build(obj, lazy=True)
self._cache[item] = obj
return self._cache[item]
def __delitem__(self, item): # real signature unknown
""" Delete self[key]. """
del self._cache[item]
def get(self, item, default=None):
try:
val = self[item]
except KeyError:
val = default
return val
# override defaults to build Dictionary values before returning
def keys(self):
return [k for k in super(DictBasedObject, self).keys()]
def values(self):
return [self[k] for k in super(DictBasedObject, self).keys()]
def items(self):
return [(k, self[k]) for k in super(DictBasedObject, self).keys()]
def pop(self, i, **kwargs):
if i in self:
res = self[i]
_ = super(DictBasedObject, self).pop(i)
else:
res = super(DictBasedObject, self).pop(i, **kwargs)
return res
def popitem(self):
if not self:
raise KeyError()
k = next(iter(super(DictBasedObject, self).keys()))
return k, self.pop(k)
def obj_factory(doc, obj):
klass = None
if isinstance(obj, Stream):
if obj.Type == 'XObject':
klass = XOBJECTS.get(obj.Subtype, XObject)
else:
klass = STREAM_BASED_OBJECTS.get(obj.Type, StreamBasedObject)
elif isinstance(obj, Dictionary):
klass = DICT_OBJECTS.get(obj.get('Type'), DictBasedObject)
elif isinstance(obj, list):
klass = ArrayBasedObject
return klass(doc, obj) if klass else obj
class ObjectStream(StreamBasedObject):
""" Type = ObjStm
"""
pass
class Catalog(DictBasedObject):
"""
Dictionary based object. (Type = Catalog)
See PDF 1.7 specification `sec. 7.7.2 - DocumentCatalog <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=71>`_
"""
pass
class PageTreeNode(DictBasedObject):
"""
Dictionary based object. (Type = Pages)
See PDF 1.7 specification `sec. 7.7.3.2 - Page Tree Nodes <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=76>`_
"""
def pages(self, node=None):
"""
Yields tree node pages one by one.
:return: :class:`~pdfreader.types.objects.Page` generator.
"""
if node is None:
node = self
for child in node.Kids:
if isinstance(child, Page):
yield child
else:
for page in self.pages(child):
yield page
class Page(DictBasedObject):
"""
Dictionary based Page object. (Type = Page)
See PDF 1.7 specification `sec. 7.7.3.3 - Page Objects <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=77>`_
"""
class XObject(StreamBasedObject):
"""
Stream based XObject object. (Type = XObject)
See PDF 1.7 specification `sec. 8.8 - External Objects <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=201>`_
"""
class CMap(StreamBasedObject):
""" Type = CMap
"""
class Metadata(StreamBasedObject):
""" Type = Metadata
Subtype = XML
"""
class Image(PILImageMixin, XObject):
"""
Stream based XObject object. (Type = XObject, Subtype = Image)
See PDF 1.7 specification `sec. 8.9 - Images <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=203>`_
"""
class Form(XObject):
"""
Stream based XObject object. (Type = XObject, Subtype = Form)
See PDF 1.7 specification `sec. 8.10 - Form XObjects <https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=217>`_
"""
stream_content = XObject.filtered
class Group(XObject):
""" Type = XObject
Subtype = Group
"""
class OCG(DictBasedObject):
""" Type = OCG
Optional Content Group
"""
class OCMD(DictBasedObject):
""" Type = OCMD
Optional Content Membership Directory
"""
class Font(DictBasedObject):
""" Type = Font
"""
class Encoding(DictBasedObject):
""" Type = Encoding
"""
class CIDFont(DictBasedObject):
""" Type = CIDFont
"""
class FontDescriptior(DictBasedObject):
""" Type = FontDescriptior
"""
class Halftone(DictBasedObject):
""" Type = Halftone
"""
class Outlines(DictBasedObject):
""" Type = Outlines
"""
class Collection(DictBasedObject):
""" Type = Collection
"""
class CollectionField(DictBasedObject):
""" Type = CollectionField
"""
class CollectionSort(DictBasedObject):
""" Type = CollectionSort
"""
class CollectionSchema(DictBasedObject):
""" Type = CollectionSchema
"""
class PageLabel(DictBasedObject):
""" Type = PageLabel
"""
class Bread(DictBasedObject):
""" Type = Bread
"""
class Thread(DictBasedObject):
""" Type = Thread
"""
class Trans(DictBasedObject):
""" Type = Trans
"""
class NavNode(DictBasedObject):
""" Type = NavNode
"""
class Annot(DictBasedObject):
""" Type = Annot
"""
class Border(DictBasedObject):
""" Type = Border
"""
class Action(DictBasedObject):
""" Type = Action
"""
class Sig(DictBasedObject):
""" Type = Sig
"""
class SigRef(DictBasedObject):
""" Type = SigRef
"""
class TransformParams(DictBasedObject):
""" Type = TransformParams
"""
class Requirement(DictBasedObject):
""" Type = Requirement
"""
class ReqHandler(DictBasedObject):
""" Type = ReqHandler
"""
class Rendition(DictBasedObject):
""" Type = Rendition
"""
class MediaCriteria(DictBasedObject):
""" Type = MediaCriteria
"""
class MinBitDepth(DictBasedObject):
""" Type = MinBitDepth
"""
class MinScreenSize(DictBasedObject):
""" Type = MinScreenSize
"""
class MediaClip(DictBasedObject):
""" Type = MediaClip
"""
class MediaPermissions(DictBasedObject):
""" Type = MediaPermissions
"""
class MediaDuration(DictBasedObject):
""" Type = MediaDuration
"""
class MediaScreenParams(DictBasedObject):
""" Type = MediaScreenParams
"""
class FWParams(DictBasedObject):
""" Type = FWParams
"""
class MediaOffset(DictBasedObject):
""" Type = MediaOffset
"""
class Timespan(DictBasedObject):
""" Type = Timespan
"""
class MediaPlayers(DictBasedObject):
""" Type = MediaPlayers
"""
class MediaPlayerInfo(DictBasedObject):
""" Type = MediaPlayerInfo
"""
class SoftwareIdentifier(DictBasedObject):
""" Type = SoftwareIdentifier
"""
class Sound(DictBasedObject):
""" Type = Sound
"""
class SlideShow(DictBasedObject):
""" Type = SlideShow
"""
class LastModified(DictBasedObject):
""" Type = LastModified
"""
class StructTreeRoot(DictBasedObject):
""" Type = StructTreeRoot
"""
class StructElem(DictBasedObject):
""" Type = StructElem
"""
class MCR(DictBasedObject):
""" Type = MCR
Marked Content Reference
"""
class OBJR(DictBasedObject):
""" Type = OBJR
Object Reference
"""
STREAM_BASED_OBJECTS = {
'ObjectStream': ObjectStream,
'XObject': XObject,
'CMap': CMap,
'Metadata': Metadata
}
XOBJECTS = {'Image': Image,
'Form': Form,
'Group': Group}
DICT_OBJECTS = {
'Catalog': Catalog,
'Pages': PageTreeNode,
'Page': Page,
'OCG': OCG,
'OCMD': OCMD,
'Font': Font,
'Encoding': Encoding,
'CIDFont': CIDFont,
'FontDescriptior': FontDescriptior,
'Halftone': Halftone,
'Outlines': Outlines,
'Collection': Collection,
'CollectionField': CollectionField,
'CollectionSort': CollectionSort,
'CollectionSchema': CollectionSchema,
'PageLabel': PageLabel,
'Bread': Bread,
'Thread': Thread,
'Trans': Trans,
'NavNode': NavNode,
'Annot': Annot,
'Border': Border,
'Action': Action,
'Sig': Sig,
'SigRef': SigRef,
'TransformParams': TransformParams,
'Requirement': Requirement,
'ReqHandler': ReqHandler,
'Rendition': Rendition,
'MediaCriteria': MediaCriteria,
'MinBitDepth': MinBitDepth,
'MinScreenSize': MinScreenSize,
'MediaClip': MediaClip,
'MediaPermissions': MediaPermissions,
'MediaDuration': MediaDuration,
'MediaScreenParams': MediaScreenParams,
'FWParams': FWParams,
'MediaOffset': MediaOffset,
'Timespan': Timespan,
'MediaPlayers': MediaPlayers,
'MediaPlayerInfo': MediaPlayerInfo,
'SoftwareIdentifier': SoftwareIdentifier,
'Sound': Sound,
'SlideShow': SlideShow,
'LastModified': LastModified,
'StructTreeRoot': StructTreeRoot,
'StructElem': StructElem,
'MCR': MCR,
'OBJR': OBJR
}
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
6317,
13239,
1053,
22152,
29918,
6799,
13,
3166,
6317,
29886,
453,
340,
1053,
349,
6227,
2940,
29924,
861,
262,
13,
3166,
869,
11487,
1053,
13763,
29892,
13343,
29892,
4398,
29892,
4408,
13,
13,
13,
1990,
7370,
29990,
5620,
29898,
3318,
1125,
13,
1678,
9995,
1369,
29916,
999,
13,
308,
29896,
29906,
29941,
13,
13,
4706,
17646,
5333,
1203,
29889,
1815,
367,
1546,
26377,
3618,
565,
738,
11924,
284,
11217,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
9210,
1125,
13,
4706,
1583,
29889,
10289,
353,
9210,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
9872,
4763,
29990,
5620,
29901,
6571,
29958,
1642,
4830,
29898,
1311,
29889,
10289,
29897,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
13,
4706,
736,
1583,
29889,
10289,
1275,
916,
29889,
10289,
13,
13,
13,
1990,
3201,
3955,
29898,
3318,
1125,
13,
1678,
9995,
1020,
3955,
13,
9651,
3532,
29966,
2023,
869,
6778,
13,
4706,
1095,
3018,
3955,
13,
13,
4706,
17646,
5333,
1203,
29889,
1815,
367,
1546,
26377,
3618,
565,
738,
11924,
284,
11217,
29889,
13,
4706,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
8636,
1125,
13,
4706,
1583,
29889,
7529,
353,
8636,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
9872,
5323,
3955,
29901,
6571,
29958,
1642,
4830,
29898,
1311,
29889,
7529,
29897,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
13,
4706,
736,
1583,
29889,
7529,
1275,
916,
29889,
7529,
13,
13,
13,
1990,
13763,
29933,
1463,
2061,
29898,
3835,
1125,
13,
1678,
9995,
13763,
29899,
6707,
1203,
29889,
13,
4706,
15854,
19574,
3770,
1960,
26377,
9282,
373,
8393,
2130,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1574,
29892,
4840,
1125,
13,
4706,
2428,
29898,
3835,
29933,
1463,
2061,
29892,
1583,
467,
1649,
2344,
12035,
5461,
29889,
27126,
29892,
4840,
29889,
5461,
29897,
13,
4706,
1583,
29889,
1514,
353,
1574,
13,
4706,
1583,
3032,
8173,
353,
9657,
580,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
5461,
29898,
25932,
29892,
916,
1125,
13,
4706,
5446,
353,
2428,
29898,
3835,
29933,
1463,
2061,
29892,
13763,
29933,
1463,
2061,
467,
3166,
29918,
5461,
29898,
1228,
29897,
13,
4706,
5446,
29889,
1514,
353,
916,
29889,
1514,
13,
13,
1678,
822,
4770,
657,
5552,
12035,
1311,
29892,
2944,
1125,
13,
4706,
565,
2944,
297,
1583,
3032,
8173,
29901,
13,
9651,
736,
1583,
3032,
8173,
29961,
667,
29962,
13,
4706,
5446,
353,
2428,
29898,
3835,
29933,
1463,
2061,
29892,
1583,
467,
1649,
657,
5552,
12035,
667,
29897,
13,
4706,
5446,
353,
1583,
29889,
1514,
29889,
4282,
29898,
5415,
29892,
17366,
29922,
5574,
29897,
13,
4706,
1583,
3032,
8173,
29961,
667,
29962,
353,
5446,
13,
4706,
736,
1583,
3032,
8173,
29961,
667,
29962,
13,
13,
13,
1990,
4398,
29933,
1463,
2061,
29898,
2588,
1125,
13,
1678,
9995,
4398,
29899,
6707,
1203,
29889,
13,
4706,
15854,
19574,
3770,
1960,
26377,
9282,
373,
4452,
2130,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1574,
29892,
24471,
1125,
13,
4706,
1583,
29889,
1514,
353,
1574,
13,
4706,
396,
1763,
6132,
29901,
445,
1818,
367,
425,
29920,
631,
2655,
29889,
13,
4706,
396,
20768,
304,
2048,
3618,
871,
373,
2130,
4218,
871,
29889,
1152,
1342,
29901,
263,
29889,
2248,
29892,
263,
29961,
29875,
1402,
263,
29961,
29896,
29901,
29906,
29962,
2992,
29889,
13,
4706,
24471,
353,
518,
1311,
29889,
1514,
29889,
4282,
29898,
5415,
29892,
17366,
29922,
5574,
29897,
363,
5446,
297,
24471,
29962,
13,
4706,
2428,
29898,
2588,
29933,
1463,
2061,
29892,
1583,
467,
1649,
2344,
12035,
20155,
29897,
13,
13,
13,
1990,
360,
919,
29933,
1463,
2061,
29898,
11513,
1125,
13,
1678,
9995,
13343,
29899,
6707,
1203,
29889,
13,
4706,
15854,
19574,
3770,
1960,
26377,
9282,
373,
8393,
29914,
7076,
2130,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1574,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
2428,
29898,
21533,
29933,
1463,
2061,
29892,
1583,
467,
1649,
2344,
1649,
10456,
5085,
29892,
3579,
19290,
29897,
13,
4706,
1583,
29889,
1514,
353,
1574,
13,
4706,
1583,
3032,
8173,
353,
9657,
580,
13,
13,
1678,
822,
4770,
657,
5552,
12035,
1311,
29892,
2944,
1125,
13,
4706,
736,
1583,
29889,
657,
29898,
667,
29897,
13,
13,
1678,
822,
4770,
657,
667,
12035,
1311,
29892,
2944,
1125,
13,
4706,
565,
2944,
297,
1583,
3032,
8173,
29901,
13,
9651,
736,
1583,
3032,
8173,
29961,
667,
29962,
13,
4706,
5446,
353,
2428,
29898,
21533,
29933,
1463,
2061,
29892,
1583,
467,
1649,
657,
667,
12035,
667,
29897,
13,
4706,
5446,
353,
1583,
29889,
1514,
29889,
4282,
29898,
5415,
29892,
17366,
29922,
5574,
29897,
13,
4706,
1583,
3032,
8173,
29961,
667,
29962,
353,
5446,
13,
4706,
736,
1583,
3032,
8173,
29961,
667,
29962,
13,
13,
1678,
822,
4770,
6144,
667,
12035,
1311,
29892,
2944,
1125,
396,
1855,
12608,
9815,
13,
4706,
9995,
21267,
1583,
29961,
1989,
1822,
9995,
13,
4706,
628,
1583,
3032,
8173,
29961,
667,
29962,
13,
13,
1678,
822,
679,
29898,
1311,
29892,
2944,
29892,
2322,
29922,
8516,
1125,
13,
4706,
1018,
29901,
13,
9651,
659,
353,
1583,
29961,
667,
29962,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
659,
353,
2322,
13,
4706,
736,
659,
13,
13,
1678,
396,
5712,
21274,
304,
2048,
13343,
1819,
1434,
7863,
13,
13,
1678,
822,
6611,
29898,
1311,
1125,
13,
4706,
736,
518,
29895,
363,
413,
297,
2428,
29898,
21533,
29933,
1463,
2061,
29892,
1583,
467,
8149,
580,
29962,
13,
13,
1678,
822,
1819,
29898,
1311,
1125,
13,
4706,
736,
518,
1311,
29961,
29895,
29962,
363,
413,
297,
2428,
29898,
21533,
29933,
1463,
2061,
29892,
1583,
467,
8149,
580,
29962,
13,
13,
1678,
822,
4452,
29898,
1311,
1125,
13,
4706,
736,
17288,
29895,
29892,
1583,
29961,
29895,
2314,
363,
413,
297,
2428,
29898,
21533,
29933,
1463,
2061,
29892,
1583,
467,
8149,
580,
29962,
13,
13,
1678,
822,
1835,
29898,
1311,
29892,
474,
29892,
3579,
19290,
1125,
13,
4706,
565,
474,
297,
1583,
29901,
13,
9651,
620,
353,
1583,
29961,
29875,
29962,
13,
9651,
903,
353,
2428,
29898,
21533,
29933,
1463,
2061,
29892,
1583,
467,
7323,
29898,
29875,
29897,
13,
4706,
1683,
29901,
13,
9651,
620,
353,
2428,
29898,
21533,
29933,
1463,
2061,
29892,
1583,
467,
7323,
29898,
29875,
29892,
3579,
19290,
29897,
13,
4706,
736,
620,
13,
13,
1678,
822,
1835,
667,
29898,
1311,
1125,
13,
4706,
565,
451,
1583,
29901,
13,
9651,
12020,
7670,
2392,
580,
13,
4706,
413,
353,
2446,
29898,
1524,
29898,
9136,
29898,
21533,
29933,
1463,
2061,
29892,
1583,
467,
8149,
22130,
13,
4706,
736,
413,
29892,
1583,
29889,
7323,
29898,
29895,
29897,
13,
13,
13,
1753,
5446,
29918,
14399,
29898,
1514,
29892,
5446,
1125,
13,
1678,
22902,
353,
6213,
13,
1678,
565,
338,
8758,
29898,
5415,
29892,
13763,
1125,
13,
4706,
565,
5446,
29889,
1542,
1275,
525,
29990,
2061,
2396,
13,
9651,
22902,
353,
1060,
14824,
17637,
29903,
29889,
657,
29898,
5415,
29889,
4035,
1853,
29892,
1060,
2061,
29897,
13,
4706,
1683,
29901,
13,
9651,
22902,
353,
6850,
1525,
5194,
29918,
25416,
29928,
29918,
14824,
17637,
29903,
29889,
657,
29898,
5415,
29889,
1542,
29892,
13763,
29933,
1463,
2061,
29897,
13,
1678,
25342,
338,
8758,
29898,
5415,
29892,
13343,
1125,
13,
4706,
22902,
353,
22471,
1783,
29918,
14824,
17637,
29903,
29889,
657,
29898,
5415,
29889,
657,
877,
1542,
5477,
360,
919,
29933,
1463,
2061,
29897,
13,
1678,
25342,
338,
8758,
29898,
5415,
29892,
1051,
1125,
13,
4706,
22902,
353,
4398,
29933,
1463,
2061,
13,
13,
1678,
736,
22902,
29898,
1514,
29892,
5446,
29897,
565,
22902,
1683,
5446,
13,
308,
13,
13,
1990,
4669,
3835,
29898,
3835,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
4250,
29926,
855,
29885,
13,
1678,
9995,
13,
1678,
1209,
13,
13,
13,
1990,
5725,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
13,
1678,
13343,
2729,
1203,
29889,
313,
1542,
353,
5725,
29897,
13,
1678,
2823,
11328,
29871,
29896,
29889,
29955,
21992,
421,
3471,
29889,
29871,
29955,
29889,
29955,
29889,
29906,
448,
10854,
29907,
3968,
529,
991,
597,
1636,
29889,
328,
16945,
29889,
510,
29914,
3051,
29914,
16846,
29914,
29874,
510,
29914,
264,
29914,
3359,
1212,
29914,
5140,
29914,
5140,
29879,
29914,
8493,
29941,
29906,
29900,
29900,
29900,
29918,
29906,
29900,
29900,
29947,
29889,
5140,
29937,
3488,
29922,
29955,
29896,
13885,
29918,
13,
1678,
9995,
13,
1678,
1209,
13,
13,
13,
1990,
9305,
9643,
4247,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
13,
4706,
13343,
2729,
1203,
29889,
313,
1542,
353,
349,
1179,
29897,
13,
4706,
2823,
11328,
29871,
29896,
29889,
29955,
21992,
421,
3471,
29889,
29871,
29955,
29889,
29955,
29889,
29941,
29889,
29906,
448,
9305,
15472,
405,
2631,
529,
991,
597,
1636,
29889,
328,
16945,
29889,
510,
29914,
3051,
29914,
16846,
29914,
29874,
510,
29914,
264,
29914,
3359,
1212,
29914,
5140,
29914,
5140,
29879,
29914,
8493,
29941,
29906,
29900,
29900,
29900,
29918,
29906,
29900,
29900,
29947,
29889,
5140,
29937,
3488,
29922,
29955,
29953,
13885,
29918,
13,
1678,
9995,
13,
13,
1678,
822,
6515,
29898,
1311,
29892,
2943,
29922,
8516,
1125,
13,
4706,
9995,
13,
4706,
612,
969,
29879,
5447,
2943,
6515,
697,
491,
697,
29889,
13,
13,
4706,
584,
2457,
29901,
29871,
584,
1990,
18078,
30022,
5140,
16950,
29889,
8768,
29889,
12650,
29889,
5074,
29952,
15299,
29889,
13,
4706,
9995,
13,
4706,
565,
2943,
338,
6213,
29901,
13,
9651,
2943,
353,
1583,
13,
4706,
363,
2278,
297,
2943,
29889,
29968,
4841,
29901,
13,
9651,
565,
338,
8758,
29898,
5145,
29892,
9305,
1125,
13,
18884,
7709,
2278,
13,
9651,
1683,
29901,
13,
18884,
363,
1813,
297,
1583,
29889,
12292,
29898,
5145,
1125,
13,
462,
1678,
7709,
1813,
13,
13,
13,
1990,
9305,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
13,
1678,
13343,
2729,
9305,
1203,
29889,
313,
1542,
353,
9305,
29897,
13,
1678,
2823,
11328,
29871,
29896,
29889,
29955,
21992,
421,
3471,
29889,
29871,
29955,
29889,
29955,
29889,
29941,
29889,
29941,
448,
9305,
4669,
29879,
529,
991,
597,
1636,
29889,
328,
16945,
29889,
510,
29914,
3051,
29914,
16846,
29914,
29874,
510,
29914,
264,
29914,
3359,
1212,
29914,
5140,
29914,
5140,
29879,
29914,
8493,
29941,
29906,
29900,
29900,
29900,
29918,
29906,
29900,
29900,
29947,
29889,
5140,
29937,
3488,
29922,
29955,
29955,
13885,
29918,
13,
1678,
9995,
13,
13,
13,
1990,
1060,
2061,
29898,
3835,
29933,
1463,
2061,
1125,
13,
1678,
9995,
13,
1678,
13763,
2729,
1060,
2061,
1203,
29889,
313,
1542,
353,
1060,
2061,
29897,
13,
1678,
2823,
11328,
29871,
29896,
29889,
29955,
21992,
421,
3471,
29889,
29871,
29947,
29889,
29947,
448,
3985,
4669,
29879,
529,
991,
597,
1636,
29889,
328,
16945,
29889,
510,
29914,
3051,
29914,
16846,
29914,
29874,
510,
29914,
264,
29914,
3359,
1212,
29914,
5140,
29914,
5140,
29879,
29914,
8493,
29941,
29906,
29900,
29900,
29900,
29918,
29906,
29900,
29900,
29947,
29889,
5140,
29937,
3488,
29922,
29906,
29900,
29896,
13885,
29918,
13,
1678,
9995,
13,
13,
13,
1990,
315,
3388,
29898,
3835,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
315,
3388,
13,
1678,
9995,
13,
13,
13,
1990,
4737,
7221,
29898,
3835,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
4737,
7221,
13,
4706,
3323,
1853,
353,
6560,
13,
1678,
9995,
13,
13,
13,
1990,
7084,
29898,
2227,
29931,
2940,
29924,
861,
262,
29892,
1060,
2061,
1125,
13,
1678,
9995,
13,
1678,
13763,
2729,
1060,
2061,
1203,
29889,
313,
1542,
353,
1060,
2061,
29892,
3323,
1853,
353,
7084,
29897,
13,
1678,
2823,
11328,
29871,
29896,
29889,
29955,
21992,
421,
3471,
29889,
29871,
29947,
29889,
29929,
448,
1954,
1179,
529,
991,
597,
1636,
29889,
328,
16945,
29889,
510,
29914,
3051,
29914,
16846,
29914,
29874,
510,
29914,
264,
29914,
3359,
1212,
29914,
5140,
29914,
5140,
29879,
29914,
8493,
29941,
29906,
29900,
29900,
29900,
29918,
29906,
29900,
29900,
29947,
29889,
5140,
29937,
3488,
29922,
29906,
29900,
29941,
13885,
29918,
13,
1678,
9995,
13,
13,
13,
1990,
3812,
29898,
29990,
2061,
1125,
13,
1678,
9995,
13,
1678,
13763,
2729,
1060,
2061,
1203,
29889,
313,
1542,
353,
1060,
2061,
29892,
3323,
1853,
353,
3812,
29897,
13,
1678,
2823,
11328,
29871,
29896,
29889,
29955,
21992,
421,
3471,
29889,
29871,
29947,
29889,
29896,
29900,
448,
3812,
1060,
12724,
529,
991,
597,
1636,
29889,
328,
16945,
29889,
510,
29914,
3051,
29914,
16846,
29914,
29874,
510,
29914,
264,
29914,
3359,
1212,
29914,
5140,
29914,
5140,
29879,
29914,
8493,
29941,
29906,
29900,
29900,
29900,
29918,
29906,
29900,
29900,
29947,
29889,
5140,
29937,
3488,
29922,
29906,
29896,
29955,
13885,
29918,
13,
1678,
9995,
13,
13,
1678,
4840,
29918,
3051,
353,
1060,
2061,
29889,
4572,
287,
13,
13,
13,
1990,
6431,
29898,
29990,
2061,
1125,
13,
1678,
9995,
5167,
353,
1060,
2061,
13,
4706,
3323,
1853,
353,
6431,
13,
1678,
9995,
13,
13,
13,
1990,
438,
11135,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
438,
11135,
13,
4706,
28379,
10576,
6431,
13,
1678,
9995,
13,
13,
13,
1990,
438,
29907,
5773,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
438,
29907,
5773,
13,
4706,
28379,
10576,
341,
1590,
10475,
18862,
13,
1678,
9995,
13,
13,
13,
1990,
10928,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
10928,
13,
1678,
9995,
13,
13,
13,
1990,
11346,
3689,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
11346,
3689,
13,
1678,
9995,
13,
13,
13,
1990,
315,
1367,
9824,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
315,
1367,
9824,
13,
1678,
9995,
13,
13,
13,
1990,
10928,
4002,
924,
1611,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
10928,
4002,
924,
1611,
13,
1678,
9995,
13,
13,
13,
1990,
8142,
615,
650,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8142,
615,
650,
13,
1678,
9995,
13,
13,
13,
1990,
4451,
9012,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
4451,
9012,
13,
1678,
9995,
13,
13,
13,
1990,
14348,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
14348,
13,
1678,
9995,
13,
13,
13,
1990,
14348,
3073,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
14348,
3073,
13,
1678,
9995,
13,
13,
13,
1990,
14348,
13685,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
14348,
13685,
13,
1678,
9995,
13,
13,
13,
1990,
14348,
12763,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
14348,
12763,
13,
1678,
9995,
13,
13,
13,
1990,
9305,
4775,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
9305,
4775,
13,
1678,
9995,
13,
13,
13,
1990,
350,
949,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
350,
949,
13,
1678,
9995,
13,
13,
13,
1990,
10480,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
10480,
13,
1678,
9995,
13,
13,
13,
1990,
4103,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
4103,
13,
1678,
9995,
13,
13,
13,
1990,
13132,
4247,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
13132,
4247,
13,
1678,
9995,
13,
13,
13,
1990,
530,
1333,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
530,
1333,
13,
1678,
9995,
13,
13,
13,
1990,
20830,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
20830,
13,
1678,
9995,
13,
13,
13,
1990,
9123,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
9123,
13,
1678,
9995,
13,
13,
13,
1990,
15861,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
15861,
13,
1678,
9995,
13,
13,
13,
1990,
15861,
5620,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
15861,
5620,
13,
1678,
9995,
13,
13,
13,
1990,
4103,
689,
9629,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
4103,
689,
9629,
13,
1678,
9995,
13,
13,
13,
1990,
830,
1548,
358,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
830,
1548,
358,
13,
1678,
9995,
13,
13,
13,
1990,
830,
29939,
4598,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
830,
29939,
4598,
13,
1678,
9995,
13,
13,
13,
1990,
390,
355,
654,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
390,
355,
654,
13,
1678,
9995,
13,
13,
13,
1990,
8213,
29907,
21977,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8213,
29907,
21977,
13,
1678,
9995,
13,
13,
13,
1990,
3080,
21591,
8498,
386,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
3080,
21591,
8498,
386,
13,
1678,
9995,
13,
13,
13,
1990,
3080,
11357,
3505,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
3080,
11357,
3505,
13,
1678,
9995,
13,
13,
13,
1990,
8213,
29907,
3466,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8213,
29907,
3466,
13,
1678,
9995,
13,
13,
13,
1990,
8213,
15737,
6847,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8213,
15737,
6847,
13,
1678,
9995,
13,
13,
13,
1990,
8213,
18984,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8213,
18984,
13,
1678,
9995,
13,
13,
13,
1990,
8213,
11357,
9629,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8213,
11357,
9629,
13,
1678,
9995,
13,
13,
13,
1990,
383,
29956,
9629,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
383,
29956,
9629,
13,
1678,
9995,
13,
13,
13,
1990,
8213,
10302,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8213,
10302,
13,
1678,
9995,
13,
13,
1990,
10277,
8357,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
10277,
8357,
13,
1678,
9995,
13,
13,
13,
1990,
8213,
13454,
414,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8213,
13454,
414,
13,
1678,
9995,
13,
13,
13,
1990,
8213,
9075,
3401,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
8213,
9075,
3401,
13,
1678,
9995,
13,
13,
13,
1990,
18540,
12889,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
18540,
12889,
13,
1678,
9995,
13,
13,
13,
1990,
14976,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
14976,
13,
1678,
9995,
13,
13,
13,
1990,
317,
7459,
8964,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
317,
7459,
8964,
13,
1678,
9995,
13,
13,
13,
1990,
9208,
2111,
2164,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
9208,
2111,
2164,
13,
1678,
9995,
13,
13,
13,
1990,
28771,
9643,
10303,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
28771,
9643,
10303,
13,
1678,
9995,
13,
13,
13,
1990,
28771,
29923,
2409,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
28771,
29923,
2409,
13,
1678,
9995,
13,
13,
13,
1990,
341,
11341,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
341,
11341,
13,
4706,
4485,
287,
10576,
12105,
13,
1678,
9995,
13,
13,
13,
1990,
438,
29933,
29967,
29934,
29898,
21533,
29933,
1463,
2061,
1125,
13,
1678,
9995,
5167,
353,
438,
29933,
29967,
29934,
13,
4706,
4669,
12105,
13,
1678,
9995,
13,
13,
13,
1254,
1525,
5194,
29918,
25416,
29928,
29918,
14824,
17637,
29903,
353,
426,
13,
1678,
525,
2061,
3835,
2396,
4669,
3835,
29892,
13,
1678,
525,
29990,
2061,
2396,
1060,
2061,
29892,
13,
1678,
525,
29907,
3388,
2396,
315,
3388,
29892,
13,
1678,
525,
18417,
2396,
4737,
7221,
13,
29913,
13,
13,
29990,
14824,
17637,
29903,
353,
11117,
2940,
2396,
7084,
29892,
13,
9651,
525,
2500,
2396,
3812,
29892,
13,
9651,
525,
4782,
2396,
6431,
29913,
29871,
13,
13,
4571,
1783,
29918,
14824,
17637,
29903,
353,
426,
13,
1678,
525,
29907,
3968,
2396,
5725,
29892,
13,
1678,
525,
27514,
2396,
9305,
9643,
4247,
29892,
13,
1678,
525,
5074,
2396,
9305,
29892,
13,
1678,
525,
29949,
11135,
2396,
438,
11135,
29892,
13,
1678,
525,
20166,
5773,
2396,
438,
29907,
5773,
29892,
13,
1678,
525,
9824,
2396,
10928,
29892,
13,
1678,
525,
14934,
2396,
11346,
3689,
29892,
13,
1678,
525,
29907,
1367,
9824,
2396,
315,
1367,
9824,
29892,
13,
1678,
525,
9824,
4002,
924,
1611,
2396,
10928,
4002,
924,
1611,
29892,
13,
1678,
525,
29950,
284,
615,
650,
2396,
8142,
615,
650,
29892,
13,
1678,
525,
3744,
9012,
2396,
4451,
9012,
29892,
13,
1678,
525,
7196,
2396,
14348,
29892,
13,
1678,
525,
7196,
3073,
2396,
14348,
3073,
29892,
13,
1678,
525,
7196,
13685,
2396,
14348,
13685,
29892,
13,
1678,
525,
7196,
12763,
2396,
14348,
12763,
29892,
13,
1678,
525,
5074,
4775,
2396,
9305,
4775,
29892,
13,
1678,
525,
29933,
949,
2396,
350,
949,
29892,
13,
1678,
525,
4899,
2396,
10480,
29892,
13,
1678,
525,
4300,
2396,
4103,
29892,
13,
1678,
525,
22107,
4247,
2396,
13132,
4247,
29892,
13,
1678,
525,
2744,
1333,
2396,
530,
1333,
29892,
13,
1678,
525,
17025,
2396,
20830,
29892,
13,
1678,
525,
4276,
2396,
9123,
29892,
13,
1678,
525,
29903,
335,
2396,
15861,
29892,
13,
1678,
525,
29903,
335,
5620,
2396,
15861,
5620,
29892,
13,
1678,
525,
13372,
9629,
2396,
4103,
689,
9629,
29892,
13,
1678,
525,
1123,
1548,
358,
2396,
830,
1548,
358,
29892,
13,
1678,
525,
1123,
29939,
4598,
2396,
830,
29939,
4598,
29892,
13,
1678,
525,
29934,
355,
654,
2396,
390,
355,
654,
29892,
13,
1678,
525,
10572,
29907,
21977,
2396,
8213,
29907,
21977,
29892,
13,
1678,
525,
8140,
21591,
8498,
386,
2396,
3080,
21591,
8498,
386,
29892,
13,
1678,
525,
8140,
11357,
3505,
2396,
3080,
11357,
3505,
29892,
13,
1678,
525,
10572,
29907,
3466,
2396,
8213,
29907,
3466,
29892,
13,
1678,
525,
10572,
15737,
6847,
2396,
8213,
15737,
6847,
29892,
13,
1678,
525,
10572,
18984,
2396,
8213,
18984,
29892,
13,
1678,
525,
10572,
11357,
9629,
2396,
8213,
11357,
9629,
29892,
13,
1678,
525,
29943,
29956,
9629,
2396,
383,
29956,
9629,
29892,
13,
1678,
525,
10572,
10302,
2396,
8213,
10302,
29892,
13,
1678,
525,
29164,
8357,
2396,
10277,
8357,
29892,
13,
1678,
525,
10572,
13454,
414,
2396,
8213,
13454,
414,
29892,
13,
1678,
525,
10572,
9075,
3401,
2396,
8213,
9075,
3401,
29892,
13,
1678,
525,
6295,
14093,
12889,
2396,
18540,
12889,
29892,
13,
1678,
525,
29456,
2396,
14976,
29892,
13,
1678,
525,
29903,
7459,
8964,
2396,
317,
7459,
8964,
29892,
13,
1678,
525,
8897,
2111,
2164,
2396,
9208,
2111,
2164,
29892,
13,
1678,
525,
19560,
9643,
10303,
2396,
28771,
9643,
10303,
29892,
13,
1678,
525,
19560,
29923,
2409,
2396,
28771,
29923,
2409,
29892,
13,
1678,
525,
29924,
11341,
2396,
341,
11341,
29892,
13,
1678,
525,
14824,
29967,
29934,
2396,
438,
29933,
29967,
29934,
13,
29913,
13,
2
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.