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
fairseq/tasks/audio_pretraining.py
yyeboah/fairseq
11
194329
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the 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 os import sys import torch from argparse import Namespace from dataclasses import dataclass, field from typing import Optional, Any from omegaconf import MISSING from fairseq.data import AddTargetDataset, Dictionary, FileAudioDataset, encoders from fairseq.data.data_utils import post_process from fairseq.dataclass import FairseqDataclass from fairseq.dataclass.configs import GenerationConfig from . import FairseqTask, register_task from .. import utils from ..logging import metrics class LabelEncoder(object): def __init__(self, dictionary): self.dictionary = dictionary def __call__(self, label): return self.dictionary.encode_line( label, append_eos=False, add_if_not_exist=False ) @dataclass class AudioPretrainingConfig(FairseqDataclass): data: str = field(default=MISSING, metadata={"help": "path to data directory"}) labels: Optional[str] = field( default=None, metadata={"help": "extension of the label file to load, used for fine-tuning"}, ) sample_rate: int = field( default=16_000, metadata={ "help": "target sample rate. audio files will be up/down sampled to this rate" }, ) normalize: bool = field( default=False, metadata={"help": "if set, normalizes input to have 0 mean and unit variance"}, ) enable_padding: bool = field( default=False, metadata={"help": "pad shorter samples instead of cropping"} ) max_sample_size: Optional[int] = field( default=None, metadata={"help": "max sample size to crop to for batching"} ) min_sample_size: Optional[int] = field( default=None, metadata={"help": "min sample size to crop to for batching"} ) # Options for reporting WER metrics during validation. Only applicable to # Seq2Seq models during fine-tuning eval_wer: bool = field( default=False, metadata={"help": "compute WER for Seq2Seq models"} ) eval_wer_config: GenerationConfig = field( default_factory=lambda: GenerationConfig(), metadata={"help": "beam search config for evaluating wer during training"}, ) eval_wer_tokenizer: Any = field( default=None, metadata={"help": "tokenizer config for evaluating wer during training"}, ) eval_wer_post_process: str = field( default="letter", metadata={ "help": "remove BPE tokens before scoring (can be sentencepiece, letter, and more)" }, ) autoregressive: bool = field( default=False, metadata={ "help": "required for autoregressive decoders (like seq2seq models); " "adds 'prev_output_tokens' to input and appends eos to target" }, ) @register_task("audio_pretraining", dataclass=AudioPretrainingConfig) class AudioPretrainingTask(FairseqTask): """""" cfg: AudioPretrainingConfig def __init__( self, cfg: AudioPretrainingConfig, source_dictionary=None, target_dictionary=None, ): super().__init__(cfg) self._target_dictionary = target_dictionary self._source_dictionary = source_dictionary if cfg.eval_wer: assert cfg.labels is not None, "eval_wer can only be set during fine-tuning" self.blank_symbol = "<s>" @classmethod def setup_task(cls, cfg: AudioPretrainingConfig, **kwargs): """Setup the task (e.g., load dictionaries). Args: cfg (AudioPretrainingConfig): configuration of this task """ if cfg.labels: dict_path = os.path.join(cfg.data, f"dict.{cfg.labels}.txt") target_dictionary = Dictionary.load(dict_path) else: target_dictionary = None return cls(cfg, target_dictionary=target_dictionary) def load_dataset(self, split: str, task_cfg: FairseqDataclass = None, **kwargs): data_path = self.cfg.data task_cfg = task_cfg or self.cfg # upgrade old task if isinstance(task_cfg, Namespace): if not hasattr(task_cfg, "autoregressive"): task_cfg.autoregressive = not task_cfg.criterion == 'ctc' manifest = os.path.join(data_path, "{}.tsv".format(split)) self.datasets[split] = FileAudioDataset( manifest, sample_rate=task_cfg.sample_rate, max_sample_size=self.cfg.max_sample_size, min_sample_size=self.cfg.max_sample_size, min_length=self.cfg.min_sample_size, pad=task_cfg.labels is not None or task_cfg.enable_padding, normalize=task_cfg.normalize, ) if task_cfg.labels: label_path = os.path.join(data_path, f"{split}.{task_cfg.labels}") labels = [] with open(label_path, "r") as f: labels = [ line for i, line in enumerate(f) if i in self.datasets[split].line_inds ] assert len(labels) == len(self.datasets[split]), ( f"labels length ({len(labels)}) and dataset length " f"({len(self.datasets[split])}) do not match") process_label = LabelEncoder(self.target_dictionary) self.datasets[split] = AddTargetDataset( self.datasets[split], labels, pad=self.target_dictionary.pad(), eos=self.target_dictionary.eos(), batch_targets=True, process_label=process_label, add_to_input=task_cfg.autoregressive, ) @property def source_dictionary(self): return self._source_dictionary @property def target_dictionary(self): """Return the :class:`~fairseq.data.Dictionary` for the language model.""" return self._target_dictionary def max_positions(self): """Maximum input length supported by the encoder.""" return (sys.maxsize, sys.maxsize) def filter_indices_by_size( self, indices, dataset, max_positions=None, ignore_invalid_inputs=False, ): # we do not need to filter by size in this task as dataloaders take care of this return indices def valid_step(self, sample, model, criterion): loss, sample_size, logging_output = super().valid_step(sample, model, criterion) if self.cfg.eval_wer and self.cfg.autoregressive: metrics = self._inference_with_wer(self.sequence_generator, sample, model) logging_output["_num_char_errors"] = metrics["num_char_errors"] logging_output["_num_chars"] = metrics["num_chars"] logging_output["_num_word_errors"] = metrics["num_word_errors"] logging_output["_num_words"] = metrics["num_words"] return loss, sample_size, logging_output def build_model(self, model_cfg: FairseqDataclass): model = super().build_model(model_cfg) if self.cfg.eval_wer and self.cfg.autoregressive: self.sequence_generator = self.build_generator( [model], self.cfg.eval_wer_config, ) if self.cfg.eval_wer_tokenizer: self.tokenizer = encoders.build_tokenizer(self.cfg.eval_wer_tokenizer) else: self.tokenizer = None return model def _inference_with_wer(self, generator, sample, model): import editdistance def decode(toks): s = self.target_dictionary.string( toks.int().cpu(), self.cfg.eval_wer_post_process, escape_unk=True, ) if self.tokenizer: s = self.tokenizer.decode(s) return s num_word_errors, num_char_errors = 0, 0 num_chars, num_words = 0, 0 gen_out = self.inference_step(generator, [model], sample, None) for i in range(len(gen_out)): hyp = decode(gen_out[i][0]["tokens"]) ref = decode( utils.strip_pad(sample["target"][i], self.target_dictionary.pad()), ) num_char_errors += editdistance.eval(hyp, ref) num_chars += len(ref) hyp_words = hyp.split() ref_words = ref.split() num_word_errors += editdistance.eval(hyp_words, ref_words) num_words += len(ref_words) return { "num_char_errors": num_char_errors, "num_chars": num_chars, "num_word_errors": num_word_errors, "num_words": num_words, } def reduce_metrics(self, logging_outputs, criterion): super().reduce_metrics(logging_outputs, criterion) zero = torch.scalar_tensor(0.0) num_char_errors = sum( log.get("_num_char_errors", zero) for log in logging_outputs ) num_chars = sum(log.get("_num_chars", zero) for log in logging_outputs) num_word_errors = sum( log.get("_num_word_errors", zero) for log in logging_outputs ) num_words = sum(log.get("_num_words", zero) for log in logging_outputs) metrics.log_scalar("_num_char_errors", num_char_errors) metrics.log_scalar("_num_chars", num_chars) metrics.log_scalar("_num_word_errors", num_word_errors) metrics.log_scalar("_num_words", num_words) if num_words > 0: metrics.log_derived( "uer", lambda meters: meters["_num_char_errors"].sum * 100.0 / meters["_num_chars"].sum if meters["_num_chars"].sum > 0 else float("nan"), ) metrics.log_derived( "wer", lambda meters: meters["_num_word_errors"].sum * 100.0 / meters["_num_words"].sum if meters["_num_words"].sum > 0 else float("nan"), )
[ 1, 396, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29955, 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, 19405, 1476, 297, 278, 365, 2965, 1430, 1660, 934, 297, 13, 29937, 278, 3876, 3884, 310, 445, 2752, 5447, 29889, 530, 5684, 16690, 310, 2373, 296, 10462, 13, 29937, 508, 367, 1476, 297, 278, 349, 1299, 3919, 29903, 934, 297, 278, 1021, 3884, 29889, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 4842, 305, 13, 13, 3166, 1852, 5510, 1053, 14706, 3535, 13, 3166, 848, 13203, 1053, 848, 1990, 29892, 1746, 13, 3166, 19229, 1053, 28379, 29892, 3139, 13, 3166, 2703, 2442, 5527, 1053, 341, 29902, 1799, 4214, 13, 13, 3166, 6534, 11762, 29889, 1272, 1053, 3462, 8667, 16390, 24541, 29892, 13343, 29892, 3497, 17111, 16390, 24541, 29892, 2094, 397, 414, 13, 3166, 6534, 11762, 29889, 1272, 29889, 1272, 29918, 13239, 1053, 1400, 29918, 5014, 13, 3166, 6534, 11762, 29889, 1272, 1990, 1053, 13822, 11762, 1469, 1990, 13, 3166, 6534, 11762, 29889, 1272, 1990, 29889, 2917, 29879, 1053, 28203, 3991, 13, 13, 3166, 869, 1053, 13822, 11762, 5398, 29892, 6036, 29918, 7662, 13, 3166, 6317, 1053, 3667, 29879, 13, 3166, 6317, 21027, 1053, 21556, 13, 13, 13, 1990, 15796, 8566, 6119, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 8600, 1125, 13, 4706, 1583, 29889, 27126, 353, 8600, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 3858, 1125, 13, 4706, 736, 1583, 29889, 27126, 29889, 12508, 29918, 1220, 29898, 13, 9651, 3858, 29892, 9773, 29918, 29872, 359, 29922, 8824, 29892, 788, 29918, 361, 29918, 1333, 29918, 28997, 29922, 8824, 13, 4706, 1723, 13, 13, 13, 29992, 1272, 1990, 13, 1990, 21764, 29925, 2267, 336, 2827, 3991, 29898, 29943, 1466, 11762, 1469, 1990, 1125, 13, 1678, 848, 29901, 851, 353, 1746, 29898, 4381, 29922, 10403, 1799, 4214, 29892, 15562, 3790, 29908, 8477, 1115, 376, 2084, 304, 848, 3884, 29908, 1800, 13, 1678, 11073, 29901, 28379, 29961, 710, 29962, 353, 1746, 29898, 13, 4706, 2322, 29922, 8516, 29892, 13, 4706, 15562, 3790, 29908, 8477, 1115, 376, 17588, 310, 278, 3858, 934, 304, 2254, 29892, 1304, 363, 2691, 29899, 29873, 27964, 10758, 13, 1678, 1723, 13, 1678, 4559, 29918, 10492, 29901, 938, 353, 1746, 29898, 13, 4706, 2322, 29922, 29896, 29953, 29918, 29900, 29900, 29900, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 8477, 1115, 376, 5182, 4559, 6554, 29889, 10348, 2066, 674, 367, 701, 29914, 3204, 4559, 29881, 304, 445, 6554, 29908, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 4226, 675, 29901, 6120, 353, 1746, 29898, 13, 4706, 2322, 29922, 8824, 29892, 13, 4706, 15562, 3790, 29908, 8477, 1115, 376, 361, 731, 29892, 4226, 7093, 1881, 304, 505, 29871, 29900, 2099, 322, 5190, 20162, 10758, 13, 1678, 1723, 13, 1678, 9025, 29918, 12791, 29901, 6120, 353, 1746, 29898, 13, 4706, 2322, 29922, 8824, 29892, 15562, 3790, 29908, 8477, 1115, 376, 8305, 20511, 11916, 2012, 310, 8182, 3262, 9092, 13, 1678, 1723, 13, 1678, 4236, 29918, 11249, 29918, 2311, 29901, 28379, 29961, 524, 29962, 353, 1746, 29898, 13, 4706, 2322, 29922, 8516, 29892, 15562, 3790, 29908, 8477, 1115, 376, 3317, 4559, 2159, 304, 274, 1336, 304, 363, 9853, 292, 9092, 13, 1678, 1723, 13, 1678, 1375, 29918, 11249, 29918, 2311, 29901, 28379, 29961, 524, 29962, 353, 1746, 29898, 13, 4706, 2322, 29922, 8516, 29892, 15562, 3790, 29908, 8477, 1115, 376, 1195, 4559, 2159, 304, 274, 1336, 304, 363, 9853, 292, 9092, 13, 1678, 1723, 13, 13, 1678, 396, 25186, 363, 23415, 399, 1001, 21556, 2645, 8845, 29889, 9333, 22903, 304, 13, 1678, 396, 25981, 29906, 23718, 4733, 2645, 2691, 29899, 29873, 27964, 13, 1678, 19745, 29918, 556, 29901, 6120, 353, 1746, 29898, 13, 4706, 2322, 29922, 8824, 29892, 15562, 3790, 29908, 8477, 1115, 376, 26017, 399, 1001, 363, 25981, 29906, 23718, 4733, 9092, 13, 1678, 1723, 13, 1678, 19745, 29918, 556, 29918, 2917, 29901, 28203, 3991, 353, 1746, 29898, 13, 4706, 2322, 29918, 14399, 29922, 2892, 29901, 28203, 3991, 3285, 13, 4706, 15562, 3790, 29908, 8477, 1115, 376, 915, 314, 2740, 2295, 363, 6161, 1218, 2949, 2645, 6694, 10758, 13, 1678, 1723, 13, 1678, 19745, 29918, 556, 29918, 6979, 3950, 29901, 3139, 353, 1746, 29898, 13, 4706, 2322, 29922, 8516, 29892, 13, 4706, 15562, 3790, 29908, 8477, 1115, 376, 6979, 3950, 2295, 363, 6161, 1218, 2949, 2645, 6694, 10758, 13, 1678, 1723, 13, 1678, 19745, 29918, 556, 29918, 2490, 29918, 5014, 29901, 851, 353, 1746, 29898, 13, 4706, 2322, 543, 15670, 613, 13, 4706, 15562, 3790, 13, 9651, 376, 8477, 1115, 376, 5992, 350, 4162, 18897, 1434, 26654, 313, 3068, 367, 10541, 12343, 346, 29892, 5497, 29892, 322, 901, 5513, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 8478, 387, 1253, 573, 29901, 6120, 353, 1746, 29898, 13, 4706, 2322, 29922, 8824, 29892, 13, 4706, 15562, 3790, 13, 9651, 376, 8477, 1115, 376, 12403, 363, 8478, 387, 1253, 573, 1602, 397, 414, 313, 4561, 19359, 29906, 11762, 4733, 416, 376, 13, 9651, 376, 1202, 29879, 525, 16304, 29918, 4905, 29918, 517, 12360, 29915, 304, 1881, 322, 623, 1975, 321, 359, 304, 3646, 29908, 13, 4706, 2981, 13, 1678, 1723, 13, 13, 13, 29992, 9573, 29918, 7662, 703, 18494, 29918, 1457, 26495, 613, 848, 1990, 29922, 17111, 29925, 2267, 336, 2827, 3991, 29897, 13, 1990, 21764, 29925, 2267, 336, 2827, 5398, 29898, 29943, 1466, 11762, 5398, 1125, 13, 1678, 9995, 15945, 29908, 13, 13, 1678, 274, 16434, 29901, 21764, 29925, 2267, 336, 2827, 3991, 13, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 274, 16434, 29901, 21764, 29925, 2267, 336, 2827, 3991, 29892, 13, 4706, 2752, 29918, 27126, 29922, 8516, 29892, 13, 4706, 3646, 29918, 27126, 29922, 8516, 29892, 13, 268, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 16859, 29897, 13, 4706, 1583, 3032, 5182, 29918, 27126, 353, 3646, 29918, 27126, 13, 4706, 1583, 3032, 4993, 29918, 27126, 353, 2752, 29918, 27126, 13, 4706, 565, 274, 16434, 29889, 14513, 29918, 556, 29901, 13, 9651, 4974, 274, 16434, 29889, 21134, 338, 451, 6213, 29892, 376, 14513, 29918, 556, 508, 871, 367, 731, 2645, 2691, 29899, 29873, 27964, 29908, 13, 4706, 1583, 29889, 19465, 29918, 18098, 353, 376, 1, 376, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 6230, 29918, 7662, 29898, 25932, 29892, 274, 16434, 29901, 21764, 29925, 2267, 336, 2827, 3991, 29892, 3579, 19290, 1125, 13, 4706, 9995, 26947, 278, 3414, 313, 29872, 29889, 29887, 1696, 2254, 21503, 4314, 467, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 274, 16434, 313, 17111, 29925, 2267, 336, 2827, 3991, 1125, 5285, 310, 445, 3414, 13, 4706, 9995, 13, 13, 4706, 565, 274, 16434, 29889, 21134, 29901, 13, 9651, 9657, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 16859, 29889, 1272, 29892, 285, 29908, 8977, 29889, 29912, 16859, 29889, 21134, 1836, 3945, 1159, 13, 9651, 3646, 29918, 27126, 353, 13343, 29889, 1359, 29898, 8977, 29918, 2084, 29897, 13, 4706, 1683, 29901, 13, 9651, 3646, 29918, 27126, 353, 6213, 13, 13, 4706, 736, 1067, 29879, 29898, 16859, 29892, 3646, 29918, 27126, 29922, 5182, 29918, 27126, 29897, 13, 13, 1678, 822, 2254, 29918, 24713, 29898, 1311, 29892, 6219, 29901, 851, 29892, 3414, 29918, 16859, 29901, 13822, 11762, 1469, 1990, 353, 6213, 29892, 3579, 19290, 1125, 13, 4706, 848, 29918, 2084, 353, 1583, 29889, 16859, 29889, 1272, 13, 4706, 3414, 29918, 16859, 353, 3414, 29918, 16859, 470, 1583, 29889, 16859, 13, 13, 4706, 396, 14955, 2030, 3414, 13, 4706, 565, 338, 8758, 29898, 7662, 29918, 16859, 29892, 14706, 3535, 1125, 13, 9651, 565, 451, 756, 5552, 29898, 7662, 29918, 16859, 29892, 376, 8309, 387, 1253, 573, 29908, 1125, 13, 18884, 3414, 29918, 16859, 29889, 8309, 387, 1253, 573, 353, 451, 3414, 29918, 16859, 29889, 29883, 5385, 291, 1275, 525, 312, 29883, 29915, 13, 13, 4706, 10419, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 2084, 29892, 29850, 1836, 1372, 29894, 1642, 4830, 29898, 5451, 876, 13, 4706, 1583, 29889, 14538, 1691, 29961, 5451, 29962, 353, 3497, 17111, 16390, 24541, 29898, 13, 9651, 10419, 29892, 13, 9651, 4559, 29918, 10492, 29922, 7662, 29918, 16859, 29889, 11249, 29918, 10492, 29892, 13, 9651, 4236, 29918, 11249, 29918, 2311, 29922, 1311, 29889, 16859, 29889, 3317, 29918, 11249, 29918, 2311, 29892, 13, 9651, 1375, 29918, 11249, 29918, 2311, 29922, 1311, 29889, 16859, 29889, 3317, 29918, 11249, 29918, 2311, 29892, 13, 9651, 1375, 29918, 2848, 29922, 1311, 29889, 16859, 29889, 1195, 29918, 11249, 29918, 2311, 29892, 13, 9651, 17132, 29922, 7662, 29918, 16859, 29889, 21134, 338, 451, 6213, 470, 3414, 29918, 16859, 29889, 12007, 29918, 12791, 29892, 13, 9651, 4226, 675, 29922, 7662, 29918, 16859, 29889, 8945, 675, 29892, 13, 4706, 1723, 13, 13, 4706, 565, 3414, 29918, 16859, 29889, 21134, 29901, 13, 9651, 3858, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1272, 29918, 2084, 29892, 285, 29908, 29912, 5451, 1836, 29912, 7662, 29918, 16859, 29889, 21134, 27195, 13, 9651, 11073, 353, 5159, 13, 9651, 411, 1722, 29898, 1643, 29918, 2084, 29892, 376, 29878, 1159, 408, 285, 29901, 13, 18884, 11073, 353, 518, 13, 462, 1678, 1196, 363, 474, 29892, 1196, 297, 26985, 29898, 29888, 29897, 13, 462, 1678, 565, 474, 297, 1583, 29889, 14538, 1691, 29961, 5451, 1822, 1220, 29918, 12772, 13, 18884, 4514, 13, 13, 9651, 4974, 7431, 29898, 21134, 29897, 1275, 7431, 29898, 1311, 29889, 14538, 1691, 29961, 5451, 11724, 313, 13, 462, 1678, 285, 29908, 21134, 3309, 21313, 2435, 29898, 21134, 26972, 322, 8783, 3309, 376, 13, 462, 1678, 285, 29908, 3319, 2435, 29898, 1311, 29889, 14538, 1691, 29961, 5451, 2314, 1800, 437, 451, 1993, 1159, 13, 13, 9651, 1889, 29918, 1643, 353, 15796, 8566, 6119, 29898, 1311, 29889, 5182, 29918, 27126, 29897, 13, 13, 9651, 1583, 29889, 14538, 1691, 29961, 5451, 29962, 353, 3462, 8667, 16390, 24541, 29898, 13, 18884, 1583, 29889, 14538, 1691, 29961, 5451, 1402, 13, 18884, 11073, 29892, 13, 18884, 17132, 29922, 1311, 29889, 5182, 29918, 27126, 29889, 8305, 3285, 13, 18884, 321, 359, 29922, 1311, 29889, 5182, 29918, 27126, 29889, 29872, 359, 3285, 13, 18884, 9853, 29918, 5182, 29879, 29922, 5574, 29892, 13, 18884, 1889, 29918, 1643, 29922, 5014, 29918, 1643, 29892, 13, 18884, 788, 29918, 517, 29918, 2080, 29922, 7662, 29918, 16859, 29889, 8309, 387, 1253, 573, 29892, 13, 9651, 1723, 13, 13, 1678, 732, 6799, 13, 1678, 822, 2752, 29918, 27126, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 4993, 29918, 27126, 13, 13, 1678, 732, 6799, 13, 1678, 822, 3646, 29918, 27126, 29898, 1311, 1125, 13, 4706, 9995, 11609, 278, 584, 1990, 18078, 30022, 29888, 1466, 11762, 29889, 1272, 29889, 11513, 29952, 363, 278, 4086, 13, 4706, 1904, 1213, 15945, 13, 4706, 736, 1583, 3032, 5182, 29918, 27126, 13, 13, 1678, 822, 4236, 29918, 1066, 2187, 29898, 1311, 1125, 13, 4706, 9995, 7976, 12539, 1881, 3309, 6969, 491, 278, 2094, 6119, 1213, 15945, 13, 4706, 736, 313, 9675, 29889, 3317, 2311, 29892, 10876, 29889, 3317, 2311, 29897, 13, 13, 1678, 822, 4175, 29918, 513, 1575, 29918, 1609, 29918, 2311, 29898, 13, 4706, 1583, 29892, 13, 4706, 16285, 29892, 13, 4706, 8783, 29892, 13, 4706, 4236, 29918, 1066, 2187, 29922, 8516, 29892, 13, 4706, 11455, 29918, 20965, 29918, 2080, 29879, 29922, 8824, 29892, 13, 268, 1125, 13, 4706, 396, 591, 437, 451, 817, 304, 4175, 491, 2159, 297, 445, 3414, 408, 1418, 7003, 24574, 2125, 2562, 310, 445, 13, 4706, 736, 16285, 13, 13, 1678, 822, 2854, 29918, 10568, 29898, 1311, 29892, 4559, 29892, 1904, 29892, 28770, 291, 1125, 13, 4706, 6410, 29892, 4559, 29918, 2311, 29892, 12183, 29918, 4905, 353, 2428, 2141, 3084, 29918, 10568, 29898, 11249, 29892, 1904, 29892, 28770, 291, 29897, 13, 4706, 565, 1583, 29889, 16859, 29889, 14513, 29918, 556, 322, 1583, 29889, 16859, 29889, 8309, 387, 1253, 573, 29901, 13, 9651, 21556, 353, 1583, 3032, 262, 1659, 29918, 2541, 29918, 556, 29898, 1311, 29889, 16506, 29918, 27959, 29892, 4559, 29892, 1904, 29897, 13, 9651, 12183, 29918, 4905, 3366, 29918, 1949, 29918, 3090, 29918, 12523, 3108, 353, 21556, 3366, 1949, 29918, 3090, 29918, 12523, 3108, 13, 9651, 12183, 29918, 4905, 3366, 29918, 1949, 29918, 305, 1503, 3108, 353, 21556, 3366, 1949, 29918, 305, 1503, 3108, 13, 9651, 12183, 29918, 4905, 3366, 29918, 1949, 29918, 1742, 29918, 12523, 3108, 353, 21556, 3366, 1949, 29918, 1742, 29918, 12523, 3108, 13, 9651, 12183, 29918, 4905, 3366, 29918, 1949, 29918, 9303, 3108, 353, 21556, 3366, 1949, 29918, 9303, 3108, 13, 4706, 736, 6410, 29892, 4559, 29918, 2311, 29892, 12183, 29918, 4905, 13, 13, 1678, 822, 2048, 29918, 4299, 29898, 1311, 29892, 1904, 29918, 16859, 29901, 13822, 11762, 1469, 1990, 1125, 13, 4706, 1904, 353, 2428, 2141, 4282, 29918, 4299, 29898, 4299, 29918, 16859, 29897, 13, 13, 4706, 565, 1583, 29889, 16859, 29889, 14513, 29918, 556, 322, 1583, 29889, 16859, 29889, 8309, 387, 1253, 573, 29901, 13, 9651, 1583, 29889, 16506, 29918, 27959, 353, 1583, 29889, 4282, 29918, 27959, 29898, 13, 18884, 518, 4299, 1402, 13, 18884, 1583, 29889, 16859, 29889, 14513, 29918, 556, 29918, 2917, 29892, 13, 9651, 1723, 13, 9651, 565, 1583, 29889, 16859, 29889, 14513, 29918, 556, 29918, 6979, 3950, 29901, 13, 18884, 1583, 29889, 6979, 3950, 353, 2094, 397, 414, 29889, 4282, 29918, 6979, 3950, 29898, 1311, 29889, 16859, 29889, 14513, 29918, 556, 29918, 6979, 3950, 29897, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 6979, 3950, 353, 6213, 13, 4706, 736, 1904, 13, 13, 1678, 822, 903, 262, 1659, 29918, 2541, 29918, 556, 29898, 1311, 29892, 15299, 29892, 4559, 29892, 1904, 1125, 13, 4706, 1053, 3863, 19244, 13, 13, 4706, 822, 21822, 29898, 517, 2039, 1125, 13, 9651, 269, 353, 1583, 29889, 5182, 29918, 27126, 29889, 1807, 29898, 13, 18884, 304, 2039, 29889, 524, 2141, 21970, 3285, 13, 18884, 1583, 29889, 16859, 29889, 14513, 29918, 556, 29918, 2490, 29918, 5014, 29892, 13, 18884, 10169, 29918, 2960, 29922, 5574, 29892, 13, 9651, 1723, 13, 9651, 565, 1583, 29889, 6979, 3950, 29901, 13, 18884, 269, 353, 1583, 29889, 6979, 3950, 29889, 13808, 29898, 29879, 29897, 13, 9651, 736, 269, 13, 13, 4706, 954, 29918, 1742, 29918, 12523, 29892, 954, 29918, 3090, 29918, 12523, 353, 29871, 29900, 29892, 29871, 29900, 13, 4706, 954, 29918, 305, 1503, 29892, 954, 29918, 9303, 353, 29871, 29900, 29892, 29871, 29900, 13, 4706, 2531, 29918, 449, 353, 1583, 29889, 262, 1659, 29918, 10568, 29898, 27959, 29892, 518, 4299, 1402, 4559, 29892, 6213, 29897, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1885, 29918, 449, 22164, 13, 9651, 10163, 353, 21822, 29898, 1885, 29918, 449, 29961, 29875, 3816, 29900, 29962, 3366, 517, 12360, 20068, 13, 9651, 2143, 353, 21822, 29898, 13, 18884, 3667, 29879, 29889, 17010, 29918, 8305, 29898, 11249, 3366, 5182, 3108, 29961, 29875, 1402, 1583, 29889, 5182, 29918, 27126, 29889, 8305, 25739, 13, 9651, 1723, 13, 9651, 954, 29918, 3090, 29918, 12523, 4619, 3863, 19244, 29889, 14513, 29898, 29882, 1478, 29892, 2143, 29897, 13, 9651, 954, 29918, 305, 1503, 4619, 7431, 29898, 999, 29897, 13, 9651, 10163, 29918, 9303, 353, 10163, 29889, 5451, 580, 13, 9651, 2143, 29918, 9303, 353, 2143, 29889, 5451, 580, 13, 9651, 954, 29918, 1742, 29918, 12523, 4619, 3863, 19244, 29889, 14513, 29898, 29882, 1478, 29918, 9303, 29892, 2143, 29918, 9303, 29897, 13, 9651, 954, 29918, 9303, 4619, 7431, 29898, 999, 29918, 9303, 29897, 13, 13, 4706, 736, 426, 13, 9651, 376, 1949, 29918, 3090, 29918, 12523, 1115, 954, 29918, 3090, 29918, 12523, 29892, 13, 9651, 376, 1949, 29918, 305, 1503, 1115, 954, 29918, 305, 1503, 29892, 13, 9651, 376, 1949, 29918, 1742, 29918, 12523, 1115, 954, 29918, 1742, 29918, 12523, 29892, 13, 9651, 376, 1949, 29918, 9303, 1115, 954, 29918, 9303, 29892, 13, 4706, 500, 13, 13, 1678, 822, 10032, 29918, 2527, 10817, 29898, 1311, 29892, 12183, 29918, 4905, 29879, 29892, 28770, 291, 1125, 13, 4706, 2428, 2141, 17469, 29918, 2527, 10817, 29898, 21027, 29918, 4905, 29879, 29892, 28770, 291, 29897, 13, 13, 4706, 5225, 353, 4842, 305, 29889, 19529, 279, 29918, 20158, 29898, 29900, 29889, 29900, 29897, 13, 4706, 954, 29918, 3090, 29918, 12523, 353, 2533, 29898, 13, 9651, 1480, 29889, 657, 703, 29918, 1949, 29918, 3090, 29918, 12523, 613, 5225, 29897, 363, 1480, 297, 12183, 29918, 4905, 29879, 13, 4706, 1723, 13, 4706, 954, 29918, 305, 1503, 353, 2533, 29898, 1188, 29889, 657, 703, 29918, 1949, 29918, 305, 1503, 613, 5225, 29897, 363, 1480, 297, 12183, 29918, 4905, 29879, 29897, 13, 4706, 954, 29918, 1742, 29918, 12523, 353, 2533, 29898, 13, 9651, 1480, 29889, 657, 703, 29918, 1949, 29918, 1742, 29918, 12523, 613, 5225, 29897, 363, 1480, 297, 12183, 29918, 4905, 29879, 13, 4706, 1723, 13, 4706, 954, 29918, 9303, 353, 2533, 29898, 1188, 29889, 657, 703, 29918, 1949, 29918, 9303, 613, 5225, 29897, 363, 1480, 297, 12183, 29918, 4905, 29879, 29897, 13, 4706, 21556, 29889, 1188, 29918, 19529, 279, 703, 29918, 1949, 29918, 3090, 29918, 12523, 613, 954, 29918, 3090, 29918, 12523, 29897, 13, 4706, 21556, 29889, 1188, 29918, 19529, 279, 703, 29918, 1949, 29918, 305, 1503, 613, 954, 29918, 305, 1503, 29897, 13, 4706, 21556, 29889, 1188, 29918, 19529, 279, 703, 29918, 1949, 29918, 1742, 29918, 12523, 613, 954, 29918, 1742, 29918, 12523, 29897, 13, 4706, 21556, 29889, 1188, 29918, 19529, 279, 703, 29918, 1949, 29918, 9303, 613, 954, 29918, 9303, 29897, 13, 4706, 565, 954, 29918, 9303, 1405, 29871, 29900, 29901, 13, 9651, 21556, 29889, 1188, 29918, 672, 2347, 29898, 13, 18884, 376, 2853, 613, 13, 18884, 14013, 27881, 29901, 27881, 3366, 29918, 1949, 29918, 3090, 29918, 12523, 16862, 2083, 13, 18884, 334, 29871, 29896, 29900, 29900, 29889, 29900, 13, 18884, 847, 27881, 3366, 29918, 1949, 29918, 305, 1503, 16862, 2083, 13, 18884, 565, 27881, 3366, 29918, 1949, 29918, 305, 1503, 16862, 2083, 1405, 29871, 29900, 13, 18884, 1683, 5785, 703, 13707, 4968, 13, 9651, 1723, 13, 9651, 21556, 29889, 1188, 29918, 672, 2347, 29898, 13, 18884, 376, 556, 613, 13, 18884, 14013, 27881, 29901, 27881, 3366, 29918, 1949, 29918, 1742, 29918, 12523, 16862, 2083, 13, 18884, 334, 29871, 29896, 29900, 29900, 29889, 29900, 13, 18884, 847, 27881, 3366, 29918, 1949, 29918, 9303, 16862, 2083, 13, 18884, 565, 27881, 3366, 29918, 1949, 29918, 9303, 16862, 2083, 1405, 29871, 29900, 13, 18884, 1683, 5785, 703, 13707, 4968, 13, 9651, 1723, 13, 2 ]
pykintone/account.py
hykw/pykintone
0
1615577
from datetime import datetime import yaml import pytz class Account(object): def __init__(self, domain, login_id="", login_password="", basic_id="", basic_password=""): self.domain = domain self.login_id = login_id self.login_password = <PASSWORD> self.basic_id = basic_id self.basic_password = <PASSWORD> def to_header(self, api_token="", with_content_type=True): header = {} header["Host"] = "{0}.cybozu.com:443".format(self.domain) def encode(user_id, password): import base64 return base64.b64encode("{0}:{1}".format(user_id, password).encode(kintoneService.ENCODE)) if self.basic_id: auth = encode(self.basic_id, self.basic_password) header["Authorization"] = "Basic {0}".format(auth) if api_token: header["X-Cybozu-API-Token"] = api_token elif self.login_id: auth = encode(self.login_id, self.login_password) header["X-Cybozu-Authorization"] = auth if with_content_type: header["Content-Type"] = "application/json" return header def kintone(self): return kintoneService(self) @classmethod def load(cls, path): apps = None with open(path, "rb") as f: a_dict = yaml.safe_load(f) apps = cls.loads(a_dict) return apps @classmethod def loads(cls, account_dict): account = None # create account args = { "domain": account_dict["domain"] } for k in ["login", "basic"]: if k in account_dict: args[k + "_id"] = account_dict[k]["id"] args[k + "_password"] = account_dict[k]["password"] account = Account(**args) kintone = kintoneService(account) # load kintone apps apps = [] for name in account_dict["apps"]: _a = account_dict["apps"][name] token = "" if "token" not in _a else _a["token"] kintone.app(int(_a["id"]), token, name) return kintone def __str__(self): infos = [] infos.append("domain:\t {0}".format(self.domain)) infos.append("login:\t {0} / {1}".format(self.login_id, self.login_password)) infos.append("basic:\t {0} / {1}".format(self.basic_id, self.basic_password)) return "\n".join(infos) class kintoneService(object): ENCODE = "utf-8" SELECT_LIMIT = 500 UPDATE_LIMIT = 100 DATE_FORMAT = "%Y-%m-%d" TIME_FORMAT = "%H:%M" DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ" from tzlocal import get_localzone __TIME_ZONE = get_localzone() def __init__(self, account): self.account = account self.__apps = [] def __len__(self): return len(self.__apps) def app(self, app_id="", api_token="", app_name=""): from pykintone.application import Application if not app_id: return self.__apps[0] else: existed = [a for a in self.__apps if a.app_id == app_id] # register if not exist if len(existed) > 0: return existed[0] else: _a = Application(self.account, app_id, api_token, app_name) self.__apps.append(_a) return _a def administration(self,requests_options=()): from pykintone.application_settings.administrator import Administrator return Administrator(self.account, requests_options=requests_options) def user_api(self, requests_options=()): from pykintone.user_api import UserAPI api = UserAPI(self.account, requests_options) return api @classmethod def value_to_date(cls, value): return value if not value else datetime.strptime(value, cls.DATE_FORMAT) @classmethod def value_to_time(cls, value): return value if not value else datetime.strptime(value, cls.TIME_FORMAT) @classmethod def value_to_datetime(cls, value): if value: d = datetime.strptime(value, cls.DATETIME_FORMAT) return cls._to_local(d) else: return None @classmethod def value_to_timestamp(cls, value): if value: d = datetime.strptime(value, cls.TIMESTAMP_FORMAT) return cls._to_local(d) else: return None @classmethod def _to_local(cls, d): utc = d.replace(tzinfo=pytz.utc) # configure timezone (on kintone, time is utc) local = utc.astimezone(cls.__TIME_ZONE).replace(tzinfo=None) # to local, and to native return local @classmethod def date_to_value(cls, date): return date.strftime(cls.DATE_FORMAT) @classmethod def time_to_value(cls, time): return time.strftime(cls.TIME_FORMAT) @classmethod def datetime_to_value(cls, dt): local = dt.replace(tzinfo=cls.__TIME_ZONE) utc = local.astimezone(pytz.utc) value = utc.strftime(cls.DATETIME_FORMAT) return value @classmethod def get_default_field_list(cls, as_str=False): from pykintone.structure import FieldType fields = [ FieldType.CATEGORY, FieldType.STATUS, FieldType.RECORD_NUMBER, FieldType.CREATED_TIME, FieldType.CREATOR, FieldType.STATUS_ASSIGNEE, FieldType.UPDATED_TIME, FieldType.MODIFIER ] if as_str: str_fields = [f.value for f in fields] return str_fields else: return fields
[ 1, 515, 12865, 1053, 12865, 13, 5215, 343, 8807, 13, 5215, 282, 3637, 29920, 13, 13, 13, 1990, 16535, 29898, 3318, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 5354, 29892, 13, 462, 6464, 29918, 333, 543, 613, 6464, 29918, 5630, 543, 613, 13, 462, 6996, 29918, 333, 543, 613, 6996, 29918, 5630, 13776, 1125, 13, 4706, 1583, 29889, 7247, 353, 5354, 13, 4706, 1583, 29889, 7507, 29918, 333, 353, 6464, 29918, 333, 13, 4706, 1583, 29889, 7507, 29918, 5630, 353, 529, 25711, 17013, 29958, 13, 4706, 1583, 29889, 16121, 29918, 333, 353, 6996, 29918, 333, 13, 4706, 1583, 29889, 16121, 29918, 5630, 353, 529, 25711, 17013, 29958, 13, 13, 1678, 822, 304, 29918, 6672, 29898, 1311, 29892, 7882, 29918, 6979, 543, 613, 411, 29918, 3051, 29918, 1853, 29922, 5574, 1125, 13, 4706, 4839, 353, 6571, 13, 4706, 4839, 3366, 8514, 3108, 353, 29850, 29900, 1836, 1270, 833, 6951, 29889, 510, 29901, 29946, 29946, 29941, 1642, 4830, 29898, 1311, 29889, 7247, 29897, 13, 13, 4706, 822, 19750, 29898, 1792, 29918, 333, 29892, 4800, 1125, 13, 9651, 1053, 2967, 29953, 29946, 13, 9651, 736, 2967, 29953, 29946, 29889, 29890, 29953, 29946, 12508, 703, 29912, 29900, 6177, 29912, 29896, 29913, 1642, 4830, 29898, 1792, 29918, 333, 29892, 4800, 467, 12508, 29898, 29895, 524, 650, 3170, 29889, 1430, 16524, 876, 13, 13, 4706, 565, 1583, 29889, 16121, 29918, 333, 29901, 13, 9651, 4817, 353, 19750, 29898, 1311, 29889, 16121, 29918, 333, 29892, 1583, 29889, 16121, 29918, 5630, 29897, 13, 9651, 4839, 3366, 25471, 3108, 353, 376, 16616, 426, 29900, 29913, 1642, 4830, 29898, 5150, 29897, 13, 13, 4706, 565, 7882, 29918, 6979, 29901, 13, 9651, 4839, 3366, 29990, 29899, 29733, 833, 6951, 29899, 8787, 29899, 6066, 3108, 353, 7882, 29918, 6979, 13, 4706, 25342, 1583, 29889, 7507, 29918, 333, 29901, 13, 9651, 4817, 353, 19750, 29898, 1311, 29889, 7507, 29918, 333, 29892, 1583, 29889, 7507, 29918, 5630, 29897, 13, 9651, 4839, 3366, 29990, 29899, 29733, 833, 6951, 29899, 25471, 3108, 353, 4817, 13, 13, 4706, 565, 411, 29918, 3051, 29918, 1853, 29901, 13, 9651, 4839, 3366, 3916, 29899, 1542, 3108, 353, 376, 6214, 29914, 3126, 29908, 13, 13, 4706, 736, 4839, 13, 13, 1678, 822, 413, 524, 650, 29898, 1311, 1125, 13, 4706, 736, 413, 524, 650, 3170, 29898, 1311, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 2254, 29898, 25932, 29892, 2224, 1125, 13, 4706, 11446, 353, 6213, 13, 13, 4706, 411, 1722, 29898, 2084, 29892, 376, 6050, 1159, 408, 285, 29901, 13, 9651, 263, 29918, 8977, 353, 343, 8807, 29889, 11177, 29918, 1359, 29898, 29888, 29897, 13, 9651, 11446, 353, 1067, 29879, 29889, 18132, 29898, 29874, 29918, 8977, 29897, 13, 13, 4706, 736, 11446, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 15376, 29898, 25932, 29892, 3633, 29918, 8977, 1125, 13, 4706, 3633, 353, 6213, 13, 13, 4706, 396, 1653, 3633, 13, 4706, 6389, 353, 426, 13, 9651, 376, 7247, 1115, 3633, 29918, 8977, 3366, 7247, 3108, 13, 4706, 500, 13, 4706, 363, 413, 297, 6796, 7507, 613, 376, 16121, 3108, 29901, 13, 9651, 565, 413, 297, 3633, 29918, 8977, 29901, 13, 18884, 6389, 29961, 29895, 718, 11119, 333, 3108, 353, 3633, 29918, 8977, 29961, 29895, 29962, 3366, 333, 3108, 13, 18884, 6389, 29961, 29895, 718, 11119, 5630, 3108, 353, 3633, 29918, 8977, 29961, 29895, 29962, 3366, 5630, 3108, 13, 13, 4706, 3633, 353, 16535, 29898, 1068, 5085, 29897, 13, 4706, 413, 524, 650, 353, 413, 524, 650, 3170, 29898, 10149, 29897, 13, 13, 4706, 396, 2254, 413, 524, 650, 11446, 13, 4706, 11446, 353, 5159, 13, 4706, 363, 1024, 297, 3633, 29918, 8977, 3366, 13371, 3108, 29901, 13, 9651, 903, 29874, 353, 3633, 29918, 8977, 3366, 13371, 3108, 29961, 978, 29962, 13, 9651, 5993, 353, 5124, 565, 376, 6979, 29908, 451, 297, 903, 29874, 1683, 903, 29874, 3366, 6979, 3108, 13, 9651, 413, 524, 650, 29889, 932, 29898, 524, 7373, 29874, 3366, 333, 3108, 511, 5993, 29892, 1024, 29897, 13, 13, 4706, 736, 413, 524, 650, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 3041, 359, 353, 5159, 13, 4706, 3041, 359, 29889, 4397, 703, 7247, 3583, 29873, 426, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 7247, 876, 13, 4706, 3041, 359, 29889, 4397, 703, 7507, 3583, 29873, 426, 29900, 29913, 847, 426, 29896, 29913, 1642, 4830, 29898, 1311, 29889, 7507, 29918, 333, 29892, 1583, 29889, 7507, 29918, 5630, 876, 13, 4706, 3041, 359, 29889, 4397, 703, 16121, 3583, 29873, 426, 29900, 29913, 847, 426, 29896, 29913, 1642, 4830, 29898, 1311, 29889, 16121, 29918, 333, 29892, 1583, 29889, 16121, 29918, 5630, 876, 13, 13, 4706, 736, 6634, 29876, 1642, 7122, 29898, 7192, 359, 29897, 13, 13, 13, 1990, 413, 524, 650, 3170, 29898, 3318, 1125, 13, 1678, 12524, 16524, 353, 376, 9420, 29899, 29947, 29908, 13, 1678, 5097, 29918, 5265, 26349, 353, 29871, 29945, 29900, 29900, 13, 1678, 16924, 29918, 5265, 26349, 353, 29871, 29896, 29900, 29900, 13, 13, 1678, 20231, 29918, 19094, 1299, 353, 11860, 29979, 19222, 29885, 19222, 29881, 29908, 13, 1678, 323, 8890, 29918, 19094, 1299, 353, 11860, 29950, 16664, 29924, 29908, 13, 1678, 27640, 2544, 8890, 29918, 19094, 1299, 353, 11860, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 16664, 29903, 29999, 29908, 13, 1678, 323, 8890, 1254, 19297, 29918, 19094, 1299, 353, 11860, 29979, 19222, 29885, 19222, 29881, 29911, 29995, 29950, 16664, 29924, 16664, 29903, 29889, 29995, 29888, 29999, 29908, 13, 1678, 515, 260, 29920, 2997, 1053, 679, 29918, 2997, 8028, 13, 1678, 4770, 15307, 29918, 29999, 12413, 353, 679, 29918, 2997, 8028, 580, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3633, 1125, 13, 4706, 1583, 29889, 10149, 353, 3633, 13, 4706, 1583, 17255, 13371, 353, 5159, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 736, 7431, 29898, 1311, 17255, 13371, 29897, 13, 13, 1678, 822, 623, 29898, 1311, 29892, 623, 29918, 333, 543, 613, 7882, 29918, 6979, 543, 613, 623, 29918, 978, 13776, 1125, 13, 4706, 515, 11451, 29895, 524, 650, 29889, 6214, 1053, 8427, 13, 4706, 565, 451, 623, 29918, 333, 29901, 13, 9651, 736, 1583, 17255, 13371, 29961, 29900, 29962, 13, 4706, 1683, 29901, 13, 9651, 22856, 353, 518, 29874, 363, 263, 297, 1583, 17255, 13371, 565, 263, 29889, 932, 29918, 333, 1275, 623, 29918, 333, 29962, 13, 9651, 396, 6036, 565, 451, 1863, 13, 9651, 565, 7431, 29898, 735, 12652, 29897, 1405, 29871, 29900, 29901, 13, 18884, 736, 22856, 29961, 29900, 29962, 13, 9651, 1683, 29901, 13, 18884, 903, 29874, 353, 8427, 29898, 1311, 29889, 10149, 29892, 623, 29918, 333, 29892, 7882, 29918, 6979, 29892, 623, 29918, 978, 29897, 13, 18884, 1583, 17255, 13371, 29889, 4397, 7373, 29874, 29897, 13, 18884, 736, 903, 29874, 13, 13, 1678, 822, 17517, 29898, 1311, 29892, 24830, 29918, 6768, 29922, 580, 1125, 13, 4706, 515, 11451, 29895, 524, 650, 29889, 6214, 29918, 11027, 29889, 6406, 2132, 1061, 1053, 24510, 1061, 13, 4706, 736, 24510, 1061, 29898, 1311, 29889, 10149, 29892, 7274, 29918, 6768, 29922, 24830, 29918, 6768, 29897, 13, 13, 1678, 822, 1404, 29918, 2754, 29898, 1311, 29892, 7274, 29918, 6768, 29922, 580, 1125, 13, 4706, 515, 11451, 29895, 524, 650, 29889, 1792, 29918, 2754, 1053, 4911, 8787, 13, 4706, 7882, 353, 4911, 8787, 29898, 1311, 29889, 10149, 29892, 7274, 29918, 6768, 29897, 13, 4706, 736, 7882, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 995, 29918, 517, 29918, 1256, 29898, 25932, 29892, 995, 1125, 13, 4706, 736, 995, 565, 451, 995, 1683, 12865, 29889, 710, 415, 603, 29898, 1767, 29892, 1067, 29879, 29889, 6248, 29918, 19094, 1299, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 995, 29918, 517, 29918, 2230, 29898, 25932, 29892, 995, 1125, 13, 4706, 736, 995, 565, 451, 995, 1683, 12865, 29889, 710, 415, 603, 29898, 1767, 29892, 1067, 29879, 29889, 15307, 29918, 19094, 1299, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 995, 29918, 517, 29918, 12673, 29898, 25932, 29892, 995, 1125, 13, 4706, 565, 995, 29901, 13, 9651, 270, 353, 12865, 29889, 710, 415, 603, 29898, 1767, 29892, 1067, 29879, 29889, 25832, 2544, 8890, 29918, 19094, 1299, 29897, 13, 9651, 736, 1067, 29879, 3032, 517, 29918, 2997, 29898, 29881, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 6213, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 995, 29918, 517, 29918, 16394, 29898, 25932, 29892, 995, 1125, 13, 4706, 565, 995, 29901, 13, 9651, 270, 353, 12865, 29889, 710, 415, 603, 29898, 1767, 29892, 1067, 29879, 29889, 15307, 1254, 19297, 29918, 19094, 1299, 29897, 13, 9651, 736, 1067, 29879, 3032, 517, 29918, 2997, 29898, 29881, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 6213, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 903, 517, 29918, 2997, 29898, 25932, 29892, 270, 1125, 13, 4706, 3477, 29883, 353, 270, 29889, 6506, 29898, 17559, 3888, 29922, 2272, 17559, 29889, 329, 29883, 29897, 29871, 396, 10822, 29431, 313, 265, 413, 524, 650, 29892, 931, 338, 3477, 29883, 29897, 13, 4706, 1887, 353, 3477, 29883, 29889, 579, 603, 8028, 29898, 25932, 17255, 15307, 29918, 29999, 12413, 467, 6506, 29898, 17559, 3888, 29922, 8516, 29897, 29871, 396, 304, 1887, 29892, 322, 304, 7531, 13, 4706, 736, 1887, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 2635, 29918, 517, 29918, 1767, 29898, 25932, 29892, 2635, 1125, 13, 4706, 736, 2635, 29889, 710, 615, 603, 29898, 25932, 29889, 6248, 29918, 19094, 1299, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 931, 29918, 517, 29918, 1767, 29898, 25932, 29892, 931, 1125, 13, 4706, 736, 931, 29889, 710, 615, 603, 29898, 25932, 29889, 15307, 29918, 19094, 1299, 29897, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 12865, 29918, 517, 29918, 1767, 29898, 25932, 29892, 11636, 1125, 13, 4706, 1887, 353, 11636, 29889, 6506, 29898, 17559, 3888, 29922, 25932, 17255, 15307, 29918, 29999, 12413, 29897, 13, 4706, 3477, 29883, 353, 1887, 29889, 579, 603, 8028, 29898, 2272, 17559, 29889, 329, 29883, 29897, 13, 4706, 995, 353, 3477, 29883, 29889, 710, 615, 603, 29898, 25932, 29889, 25832, 2544, 8890, 29918, 19094, 1299, 29897, 13, 4706, 736, 995, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 679, 29918, 4381, 29918, 2671, 29918, 1761, 29898, 25932, 29892, 408, 29918, 710, 29922, 8824, 1125, 13, 4706, 515, 11451, 29895, 524, 650, 29889, 23905, 1053, 8989, 1542, 13, 4706, 4235, 353, 518, 13, 9651, 8989, 1542, 29889, 29907, 3040, 29954, 18929, 29892, 13, 9651, 8989, 1542, 29889, 27047, 29892, 13, 9651, 8989, 1542, 29889, 1525, 29907, 25593, 29918, 23207, 29892, 13, 9651, 8989, 1542, 29889, 27045, 29928, 29918, 15307, 29892, 13, 9651, 8989, 1542, 29889, 22245, 1299, 1955, 29892, 13, 9651, 8989, 1542, 29889, 27047, 29918, 22933, 6259, 8186, 29923, 29892, 13, 9651, 8989, 1542, 29889, 14474, 29928, 29918, 15307, 29892, 13, 9651, 8989, 1542, 29889, 6720, 4571, 3738, 1001, 13, 4706, 4514, 13, 4706, 565, 408, 29918, 710, 29901, 13, 9651, 851, 29918, 9621, 353, 518, 29888, 29889, 1767, 363, 285, 297, 4235, 29962, 13, 9651, 736, 851, 29918, 9621, 13, 4706, 1683, 29901, 13, 9651, 736, 4235, 13, 13, 2 ]
web_frameworks/resources/forms.py
Minkov/python-web-frameworks-2020-11
4
108577
from django import forms from resources.models import Pet class PetForm(forms.ModelForm): class Meta: model = Pet fields = '__all__'
[ 1, 515, 9557, 1053, 7190, 13, 13, 3166, 7788, 29889, 9794, 1053, 5879, 13, 13, 13, 1990, 5879, 2500, 29898, 9514, 29889, 3195, 2500, 1125, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 5879, 13, 4706, 4235, 353, 525, 1649, 497, 1649, 29915, 13, 2 ]
beginner/sum-of-all-numbers_ChingLingYeung.py
garvitsharma05/hacktoberithms
16
36254
def sum_all(ls): sum = 0 if(len(ls) != 2): print("Invalid input") else: ls.sort() start = ls[0] end = ls[1] if(start == end): sum = 2 * start else: for i in range(start, end+1): sum += i return sum
[ 1, 29871, 13, 1753, 2533, 29918, 497, 29898, 3137, 1125, 13, 1678, 2533, 353, 29871, 29900, 13, 13, 1678, 565, 29898, 2435, 29898, 3137, 29897, 2804, 29871, 29906, 1125, 13, 4706, 1596, 703, 13919, 1881, 1159, 13, 13, 1678, 1683, 29901, 13, 4706, 19375, 29889, 6605, 580, 13, 4706, 1369, 353, 19375, 29961, 29900, 29962, 13, 4706, 1095, 353, 19375, 29961, 29896, 29962, 13, 308, 13, 4706, 565, 29898, 2962, 1275, 1095, 1125, 13, 9651, 2533, 353, 29871, 29906, 334, 1369, 13, 308, 13, 4706, 1683, 29901, 13, 9651, 363, 474, 297, 3464, 29898, 2962, 29892, 1095, 29974, 29896, 1125, 13, 18884, 2533, 4619, 474, 13, 268, 13, 1678, 736, 2533, 13, 2 ]
src/hypertrace/agent/autoinstrumentation/sitecustomize.py
hypertrace/pythonagent
4
101737
<gh_stars>1-10 '''Enable instrumentationon all supported modules.''' # pylint: disable=R0401 import logging from hypertrace.agent import Agent from hypertrace.env_var_settings import get_env_value # Initialize logger logger = logging.getLogger(__name__) # pylint: disable=C0103 skip_modules = get_env_value('SKIP_MODULES') if skip_modules: logger.debug("[env] Loaded SKIP_MODULES from env") if len(skip_modules) > 0: skip_modules = skip_modules.replace(' ', '') skip_modules = skip_modules.split(',') else: skip_modules = [] # Create Hypertrace agent agent = Agent() agent.instrument(None, skip_modules, auto_instrument=True)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 12008, 20701, 11395, 362, 265, 599, 6969, 10585, 29889, 12008, 396, 282, 2904, 524, 29901, 11262, 29922, 29934, 29900, 29946, 29900, 29896, 13, 5215, 12183, 13, 3166, 11266, 15003, 29889, 14748, 1053, 28330, 13, 3166, 11266, 15003, 29889, 6272, 29918, 1707, 29918, 11027, 1053, 679, 29918, 6272, 29918, 1767, 13, 13, 29937, 25455, 17927, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 29907, 29900, 29896, 29900, 29941, 13, 13, 11014, 29918, 7576, 353, 679, 29918, 6272, 29918, 1767, 877, 16033, 5690, 29918, 6720, 14849, 17101, 1495, 13, 361, 14383, 29918, 7576, 29901, 13, 1678, 17927, 29889, 8382, 703, 29961, 6272, 29962, 4309, 11932, 18581, 5690, 29918, 6720, 14849, 17101, 515, 8829, 1159, 13, 1678, 565, 7431, 29898, 11014, 29918, 7576, 29897, 1405, 29871, 29900, 29901, 13, 4706, 14383, 29918, 7576, 353, 14383, 29918, 7576, 29889, 6506, 877, 13420, 27255, 13, 4706, 14383, 29918, 7576, 353, 14383, 29918, 7576, 29889, 5451, 29317, 1495, 13, 2870, 29901, 13, 1678, 14383, 29918, 7576, 353, 5159, 13, 13, 29937, 6204, 26078, 15003, 10823, 13, 14748, 353, 28330, 580, 13, 14748, 29889, 2611, 15461, 29898, 8516, 29892, 14383, 29918, 7576, 29892, 4469, 29918, 2611, 15461, 29922, 5574, 29897, 13, 2 ]
dash/admin.py
ravshansk/ajans
0
163566
from django.contrib import admin from .models import Actor # Register your models here. @admin.register(Actor) class ActorAdmin(admin.ModelAdmin): pass
[ 1, 515, 9557, 29889, 21570, 1053, 4113, 13, 3166, 869, 9794, 1053, 319, 2801, 13, 13, 29937, 12577, 596, 4733, 1244, 29889, 13, 13, 29992, 6406, 29889, 9573, 29898, 29909, 2801, 29897, 13, 1990, 319, 2801, 12754, 29898, 6406, 29889, 3195, 12754, 1125, 13, 12, 3364, 13, 13, 2 ]
writer1.py
mahongquan/ipy_rtf
0
59369
/// <summary> /// RTF文档书写器 /// </summary> /// <remarks> /// 本书写器对生成RTF文档提供了基础的支持 /// 编制 袁永福 http://www.xdesigner.cn /// </remarks> public class RTFWriter : System.IDisposable { #region 测试代码 ****************************************************** [System.STAThread] static void Main() { TestWriteFile(); TestClipboard(); } /// <summary> /// 测试生成RTF文件 /// 执行这个函数后可以使用 MS Word 打开文件 c:\a.rtf /// </summary> internal static void TestWriteFile( ) { RTFWriter w = new RTFWriter( "c:\\a.rtf" ) ; TestBuildRTF( w ); w.Close(); System.Windows.Forms.MessageBox.Show("好了,你可以打开文件 c:\\a.rtf 了."); } /// <summary> /// 测试生成RTF文档并设置到系统剪切板中 /// 执行这个函数后就可以在 MS Word中使用粘贴操作来显示程序生成的文档了 /// </summary> internal static void TestClipboard() { System.IO.StringWriter myStr = new System.IO.StringWriter(); RTFWriter w = new RTFWriter( myStr ); TestBuildRTF( w ); w.Close(); System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject(); data.SetData( System.Windows.Forms.DataFormats.Rtf , myStr.ToString()); System.Windows.Forms.Clipboard.SetDataObject( data , true ); System.Windows.Forms.MessageBox.Show("好了,你可以在MS Word 中粘贴文本了."); } /// <summary> /// 测试生成RTF文档 /// </summary> /// <param name="w">RTF文档书写器</param> private static void TestBuildRTF( RTFWriter w ) { w.Encoding = System.Text.Encoding.GetEncoding( 936 ); // 输出文件头 w.WriteStartGroup(); w.WriteKeyword("rtf1"); w.WriteKeyword("ansi"); w.WriteKeyword("ansicpg" + w.Encoding.CodePage ); // 输出字体表 w.WriteStartGroup(); w.WriteKeyword("fonttbl"); w.WriteStartGroup(); w.WriteKeyword("f0"); w.WriteText("隶书;"); w.WriteEndGroup(); w.WriteStartGroup(); w.WriteKeyword("f1"); w.WriteText("宋体;"); w.WriteEndGroup(); w.WriteEndGroup(); // 输出颜色表 w.WriteStartGroup(); w.WriteKeyword("colortbl"); w.WriteText(";"); w.WriteKeyword("red0"); w.WriteKeyword("green0"); w.WriteKeyword("blue255"); w.WriteText(";"); w.WriteEndGroup(); // 输出正文 w.WriteKeyword("qc"); // 设置居中对齐 w.WriteKeyword("f0"); // 设置字体 w.WriteKeyword("fs30"); // 字体大小 w.WriteText("这是第一段文本 "); w.WriteKeyword("cf1"); // 设置颜色 w.WriteText("隶书 "); w.WriteKeyword("cf0"); // 设置为默认颜色 w.WriteKeyword("f1"); // 设置字体 w.WriteText("居中对齐 ABC12345"); w.WriteKeyword("par"); // 开始新的段落 w.WriteKeyword("pard"); // 清除居中对齐 w.WriteKeyword("f1"); // 设置字体 w.WriteKeyword("fs20"); // 字体大小 w.WriteKeyword("cf1"); w.WriteText("这是第二段文本 宋体 左对齐 ABC12345"); // 结束输出 w.WriteEndGroup(); } #endregion /// <summary> /// 初始化对象 /// </summary> /// <param name="w">文本书写器</param> public RTFWriter( System.IO.TextWriter w ) { myWriter = w ; } /// <summary> /// 初始化对象 /// </summary> /// <param name="strFileName">文件名</param> public RTFWriter( string strFileName ) { myWriter = new System.IO.StreamWriter( strFileName , false , System.Text.Encoding.ASCII ); } private System.Text.Encoding myEncoding = System.Text.Encoding.GetEncoding( 936 ) ; /// <summary> /// 字符编码格式 /// </summary> public System.Text.Encoding Encoding { get{ return myEncoding ;} set{ myEncoding = value;} } /// <summary> /// 内置的文本书写器 /// </summary> private System.IO.TextWriter myWriter = null; private bool bolIndent = false; /// <summary> /// 是否使用缩进 /// </summary> /// <remarks> /// RTF文档内部不能随便缩进,提供此选项只是用于生成便于阅读的RTF文档,便于程序的调试, /// 在开发调试中可以设置该属性为true,方便开发者能直接查看生成的RTF文档,但在生成最终运行的 /// 程序时应当设置该属性为 false . /// </remarks> public bool Indent { get{ return bolIndent ;} set{ bolIndent = value;} } private string strIndentString = " "; /// <summary> /// 缩进字符串 /// </summary> public string IndentString { get{ return strIndentString ;} set{ strIndentString = value;} } /// <summary> /// 当前缩进层次 /// </summary> private int intGroupLevel = 0 ; /// <summary> /// 关闭对象 /// </summary> public void Close() { if(this.intGroupLevel > 0 ) throw new System.Exception("还有组未写完"); if( myWriter != null ) { myWriter.Close(); myWriter = null; } } /// <summary> /// 输出一个组 /// </summary> /// <param name="KeyWord">关键字</param> public void WriteGroup( string KeyWord ) { this.WriteStartGroup(); this.WriteKeyword( KeyWord ); this.WriteEndGroup(); } /// <summary> /// 开始输出组 /// </summary> public void WriteStartGroup( ) { if( bolIndent ) { InnerWriteNewLine(); myWriter.Write("{"); } else myWriter.Write("{"); intGroupLevel ++ ; } /// <summary> /// 结束输出组 /// </summary> public void WriteEndGroup() { intGroupLevel -- ; if( intGroupLevel < 0 ) throw new System.Exception("组不匹配"); if( bolIndent ) { InnerWriteNewLine(); InnerWrite("}"); } else InnerWrite("}"); } /// <summary> /// 输出原始文本 /// </summary> /// <param name="txt">文本值</param> public void WriteRaw( string txt ) { if( txt != null && txt.Length > 0 ) { InnerWrite( txt ); } } /// <summary> /// 输出关键字 /// </summary> /// <param name="Keyword">关键字值</param> public void WriteKeyword( string Keyword ) { WriteKeyword( Keyword , false ); } /// <summary> /// 输出关键字 /// </summary> /// <param name="Keyword">关键字值</param> /// <param name="Ext">是否是扩展关键字</param> public void WriteKeyword( string Keyword , bool Ext) { if( Keyword == null || Keyword.Length == 0) throw new System.ArgumentNullException("值不得为空"); if( bolIndent == false && ( Keyword == "par" || Keyword == "pard" ) ) { // par 或 pard 前可以输出空白行,不影响RTF文档显示 InnerWrite( System.Environment.NewLine ); } if( this.bolIndent ) { if( Keyword == "par" || Keyword == "pard" ) { this.InnerWriteNewLine(); } } if( Ext ) InnerWrite("\\*\\"); else InnerWrite("\\"); InnerWrite( Keyword ); } public void WriteText( string Text ) { if( Text == null || Text.Length == 0 ) return ; InnerWrite(' '); for( int iCount = 0 ; iCount < Text.Length ; iCount ++ ) { char c = Text[ iCount ] ; if( c == '\t') { this.WriteKeyword("tab"); InnerWrite(' '); } else if( c < 256 ) { if( c > 32 && c < 127 ) { // 出现特殊字符,需要斜线转义 if( c == '\\' || c == '{' || c == '}' ) InnerWrite( '\\'); InnerWrite( c ); } else { InnerWrite("\\\'"); WriteByte( ( byte ) c ); } } else { byte[] bs = myEncoding.GetBytes( c.ToString()); for(int iCount2 = 0 ; iCount2 < bs.Length ; iCount2 ++ ) { InnerWrite("\\\'"); WriteByte( bs[ iCount2 ] ); } } }//for( int iCount = 0 ; iCount < Text.Length ; iCount ++ ) } /// <summary> /// 当前位置 /// </summary> private int intPosition = 0 ; /// <summary> /// 当前行的位置 /// </summary> private int intLineHead = 0 ; /// <summary> /// 16进制字符组 /// </summary> private const string Hexs = "0123456789abcdef"; /// <summary> /// 输出字节数组 /// </summary> /// <param name="bs">字节数组</param> public void WriteBytes( byte[] bs ) { if( bs == null || bs.Length == 0 ) return ; WriteRaw( " " ); for( int iCount = 0 ; iCount < bs.Length ; iCount ++ ) { if( ( iCount % 32 ) == 0 ) { this.WriteRaw( System.Environment.NewLine ); this.WriteIndent(); } else if( ( iCount % 8 ) == 0 ) { this.WriteRaw(" "); } byte b = bs[ iCount ] ; int h = ( b & 0xf0 ) >> 4 ; int l = b & 0xf ; myWriter.Write( Hexs[ h ] ); myWriter.Write( Hexs[ l ] ); intPosition += 2 ; } } /// <summary> /// 输出一个字节数据 /// </summary> /// <param name="b">字节数据</param> public void WriteByte( byte b ) { int h = ( b & 0xf0 ) >> 4 ; int l = b & 0xf ; myWriter.Write( Hexs[ h ] ); myWriter.Write( Hexs[ l ] ); intPosition += 2 ; //FixIndent(); } #region 内部成员 ****************************************************** private void InnerWrite( char c ) { intPosition ++ ; myWriter.Write( c ); } private void InnerWrite( string txt ) { intPosition += txt.Length ; myWriter.Write( txt ); } private void FixIndent() { if( this.bolIndent ) { if( intPosition - intLineHead > 100 ) InnerWriteNewLine(); } } private void InnerWriteNewLine() { if( this.bolIndent ) { if( intPosition > 0 ) { InnerWrite( System.Environment.NewLine ); intLineHead = intPosition ; WriteIndent(); } } } private void WriteIndent( ) { if( bolIndent ) { for( int iCount = 0 ; iCount < intGroupLevel ; iCount ++ ) { InnerWrite( this.strIndentString ); } } } #endregion /// <summary> /// 销毁对象 /// </summary> public void Dispose() { this.Close(); } }
[ 1, 29871, 4363, 529, 7727, 29958, 13, 6658, 390, 8969, 30333, 233, 164, 166, 31900, 31479, 30943, 13, 6658, 1533, 7727, 29958, 13, 6658, 529, 1745, 17862, 29958, 13, 6658, 29871, 30346, 31900, 31479, 30943, 30783, 30486, 30494, 29934, 8969, 30333, 233, 164, 166, 31302, 231, 193, 158, 30743, 31359, 234, 164, 131, 30210, 31541, 31695, 13, 6658, 29871, 31795, 31072, 29871, 235, 165, 132, 31156, 31121, 1732, 597, 1636, 29889, 29916, 13892, 261, 29889, 18038, 13, 6658, 1533, 1745, 17862, 29958, 13, 3597, 770, 390, 8969, 10507, 584, 2184, 29889, 1367, 275, 1066, 519, 13, 29912, 13, 13, 1678, 396, 12803, 29871, 31851, 31787, 30690, 31183, 334, 7775, 7775, 7775, 2328, 29930, 13, 13, 1678, 518, 3924, 29889, 17816, 29882, 949, 29962, 13, 1678, 2294, 1780, 4241, 580, 13, 1678, 426, 13, 4706, 4321, 6113, 2283, 890, 13, 4706, 4321, 29907, 3466, 3377, 890, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31851, 31787, 30486, 30494, 29934, 8969, 30333, 30631, 13, 1678, 4363, 29871, 233, 140, 170, 30448, 30810, 30502, 31629, 30354, 30822, 30682, 30651, 30785, 30406, 10888, 10803, 29871, 31656, 31026, 30333, 30631, 274, 3583, 29874, 29889, 2273, 29888, 29871, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 7463, 2294, 1780, 4321, 6113, 2283, 29898, 1723, 13, 1678, 426, 13, 4706, 390, 8969, 10507, 281, 353, 716, 390, 8969, 10507, 29898, 376, 29883, 22298, 29874, 29889, 2273, 29888, 29908, 1723, 2056, 13, 4706, 4321, 8893, 29934, 8969, 29898, 281, 3482, 13, 4706, 281, 29889, 11123, 890, 13, 4706, 2184, 29889, 7685, 29889, 12605, 29889, 3728, 3313, 29889, 8964, 703, 31076, 30743, 29892, 30919, 30682, 30651, 31656, 31026, 30333, 30631, 274, 22298, 29874, 29889, 2273, 29888, 29871, 30743, 18327, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31851, 31787, 30486, 30494, 29934, 8969, 30333, 233, 164, 166, 31666, 30872, 30669, 30780, 31185, 31675, 232, 140, 173, 31757, 233, 160, 194, 30275, 13, 1678, 4363, 29871, 233, 140, 170, 30448, 30810, 30502, 31629, 30354, 30822, 31238, 30682, 30651, 30505, 10888, 10803, 30275, 30785, 30406, 234, 181, 155, 235, 183, 183, 31904, 30732, 30805, 31542, 30858, 31101, 31463, 30486, 30494, 30210, 30333, 233, 164, 166, 30743, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 7463, 2294, 1780, 4321, 29907, 3466, 3377, 580, 13, 1678, 426, 13, 4706, 2184, 29889, 5971, 29889, 1231, 10507, 590, 5015, 353, 716, 2184, 29889, 5971, 29889, 1231, 10507, 890, 13, 4706, 390, 8969, 10507, 281, 353, 716, 390, 8969, 10507, 29898, 590, 5015, 3482, 13, 4706, 4321, 8893, 29934, 8969, 29898, 281, 3482, 13, 4706, 281, 29889, 11123, 890, 13, 4706, 2184, 29889, 7685, 29889, 12605, 29889, 1469, 2061, 848, 353, 716, 2184, 29889, 7685, 29889, 12605, 29889, 1469, 2061, 890, 13, 4706, 848, 29889, 2697, 1469, 29898, 2184, 29889, 7685, 29889, 12605, 29889, 1469, 2500, 1446, 29889, 29934, 13264, 1919, 590, 5015, 29889, 8246, 3310, 13, 4706, 2184, 29889, 7685, 29889, 12605, 29889, 29907, 3466, 3377, 29889, 2697, 1469, 2061, 29898, 848, 1919, 1565, 3482, 13, 4706, 2184, 29889, 7685, 29889, 12605, 29889, 3728, 3313, 29889, 8964, 703, 31076, 30743, 29892, 30919, 30682, 30651, 30505, 4345, 10803, 29871, 30275, 234, 181, 155, 235, 183, 183, 30333, 30346, 30743, 18327, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31851, 31787, 30486, 30494, 29934, 8969, 30333, 233, 164, 166, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 29893, 1013, 29934, 8969, 30333, 233, 164, 166, 31900, 31479, 30943, 829, 3207, 29958, 13, 1678, 2024, 2294, 1780, 4321, 8893, 29934, 8969, 29898, 390, 8969, 10507, 281, 1723, 13, 1678, 426, 13, 4706, 281, 29889, 14934, 353, 2184, 29889, 1626, 29889, 14934, 29889, 2577, 14934, 29898, 29871, 29929, 29941, 29953, 3482, 13, 4706, 849, 29871, 31573, 30544, 30333, 30631, 31584, 13, 4706, 281, 29889, 6113, 4763, 4782, 890, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 2273, 29888, 29896, 1496, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 550, 29875, 1496, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 550, 293, 4061, 29908, 718, 281, 29889, 14934, 29889, 3399, 5074, 3482, 13, 4706, 849, 29871, 31573, 30544, 30578, 30988, 30746, 13, 4706, 281, 29889, 6113, 4763, 4782, 890, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 5657, 16400, 1496, 13, 4706, 281, 29889, 6113, 4763, 4782, 890, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 29888, 29900, 1496, 13, 4706, 281, 29889, 6113, 1626, 703, 236, 157, 185, 31900, 29936, 1496, 13, 4706, 281, 29889, 6113, 5044, 4782, 890, 13, 4706, 281, 29889, 6113, 4763, 4782, 890, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 29888, 29896, 1496, 13, 4706, 281, 29889, 6113, 1626, 703, 232, 177, 142, 30988, 29936, 1496, 13, 4706, 281, 29889, 6113, 5044, 4782, 890, 13, 4706, 281, 29889, 6113, 5044, 4782, 890, 13, 4706, 849, 29871, 31573, 30544, 236, 165, 159, 31085, 30746, 13, 4706, 281, 29889, 6113, 4763, 4782, 890, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 1054, 441, 2204, 1496, 13, 4706, 281, 29889, 6113, 1626, 703, 29936, 1496, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 1127, 29900, 1496, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 12692, 29900, 1496, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 9539, 29906, 29945, 29945, 1496, 13, 4706, 281, 29889, 6113, 1626, 703, 29936, 1496, 13, 4706, 281, 29889, 6113, 5044, 4782, 890, 13, 4706, 849, 29871, 31573, 30544, 30724, 30333, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 29939, 29883, 1496, 1678, 849, 29871, 30872, 30669, 31924, 30275, 30783, 236, 192, 147, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 29888, 29900, 1496, 1678, 849, 29871, 30872, 30669, 30578, 30988, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 5847, 29941, 29900, 1496, 1678, 849, 29871, 30578, 30988, 30257, 30446, 13, 4706, 281, 29889, 6113, 1626, 703, 30810, 30392, 30622, 30287, 31559, 30333, 30346, 14796, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 6854, 29896, 1496, 1678, 849, 29871, 30872, 30669, 236, 165, 159, 31085, 13, 4706, 281, 29889, 6113, 1626, 703, 236, 157, 185, 31900, 14796, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 6854, 29900, 1496, 1678, 849, 29871, 30872, 30669, 30573, 31735, 31439, 236, 165, 159, 31085, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 29888, 29896, 1496, 1678, 849, 29871, 30872, 30669, 30578, 30988, 13, 4706, 281, 29889, 6113, 1626, 703, 31924, 30275, 30783, 236, 192, 147, 16417, 29896, 29906, 29941, 29946, 29945, 1496, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 862, 1496, 1678, 849, 29871, 31026, 31020, 30374, 30210, 31559, 235, 147, 192, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 29886, 538, 1496, 1678, 849, 29871, 30989, 31152, 31924, 30275, 30783, 236, 192, 147, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 29888, 29896, 1496, 1678, 849, 29871, 30872, 30669, 30578, 30988, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 5847, 29906, 29900, 1496, 1678, 849, 29871, 30578, 30988, 30257, 30446, 13, 4706, 281, 29889, 6113, 2558, 1742, 703, 6854, 29896, 1496, 13, 4706, 281, 29889, 6113, 1626, 703, 30810, 30392, 30622, 30685, 31559, 30333, 30346, 29871, 232, 177, 142, 30988, 29871, 31651, 30783, 236, 192, 147, 16417, 29896, 29906, 29941, 29946, 29945, 1496, 13, 4706, 849, 29871, 31320, 233, 160, 162, 31573, 30544, 13, 4706, 281, 29889, 6113, 5044, 4782, 890, 13, 1678, 500, 13, 13, 1678, 396, 355, 12803, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31120, 31020, 30705, 30783, 31133, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 29893, 1013, 30333, 30346, 31900, 31479, 30943, 829, 3207, 29958, 13, 1678, 970, 390, 8969, 10507, 29898, 2184, 29889, 5971, 29889, 1626, 10507, 281, 1723, 13, 1678, 426, 13, 4706, 590, 10507, 353, 281, 2056, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31120, 31020, 30705, 30783, 31133, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 710, 17020, 1013, 30333, 30631, 30548, 829, 3207, 29958, 13, 1678, 970, 390, 8969, 10507, 29898, 1347, 851, 17020, 1723, 13, 1678, 426, 13, 4706, 590, 10507, 353, 716, 2184, 29889, 5971, 29889, 3835, 10507, 29898, 13, 9651, 851, 17020, 1919, 29871, 13, 9651, 2089, 1919, 29871, 13, 9651, 2184, 29889, 1626, 29889, 14934, 29889, 28599, 2687, 3482, 13, 1678, 500, 13, 13, 1678, 2024, 2184, 29889, 1626, 29889, 14934, 590, 14934, 353, 2184, 29889, 1626, 29889, 14934, 29889, 2577, 14934, 29898, 29871, 29929, 29941, 29953, 1723, 2056, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 30578, 31277, 31795, 31183, 31168, 30607, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 970, 2184, 29889, 1626, 29889, 14934, 11346, 3689, 13, 1678, 426, 13, 4706, 679, 29912, 736, 590, 14934, 2056, 29913, 13, 4706, 731, 29912, 590, 14934, 353, 995, 13951, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 30728, 30669, 30210, 30333, 30346, 31900, 31479, 30943, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 2024, 2184, 29889, 5971, 29889, 1626, 10507, 590, 10507, 353, 1870, 29936, 13, 13, 1678, 2024, 6120, 15772, 2568, 296, 353, 2089, 29936, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 30392, 31191, 30785, 30406, 234, 191, 172, 31174, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 1745, 17862, 29958, 13, 1678, 4363, 390, 8969, 30333, 233, 164, 166, 30728, 30636, 30413, 30815, 236, 157, 146, 231, 193, 194, 234, 191, 172, 31174, 30214, 31302, 231, 193, 158, 31389, 31333, 31888, 31557, 30392, 30406, 30909, 30486, 30494, 231, 193, 194, 30909, 236, 155, 136, 235, 178, 190, 30210, 29934, 8969, 30333, 233, 164, 166, 30214, 231, 193, 194, 30909, 31101, 31463, 30210, 31268, 31787, 30214, 13, 1678, 4363, 29871, 30505, 31026, 30910, 31268, 31787, 30275, 30682, 30651, 30872, 30669, 31751, 31360, 30952, 30573, 3009, 29892, 30525, 231, 193, 194, 31026, 30910, 30767, 30815, 31157, 31092, 31213, 31811, 30486, 30494, 30210, 29934, 8969, 30333, 233, 164, 166, 30214, 231, 192, 137, 30505, 30486, 30494, 30878, 234, 190, 139, 31894, 30448, 30210, 13, 1678, 4363, 29871, 31101, 31463, 30594, 31370, 30948, 30872, 30669, 31751, 31360, 30952, 30573, 2089, 869, 13, 1678, 4363, 1533, 1745, 17862, 29958, 13, 1678, 970, 6120, 1894, 296, 13, 1678, 426, 13, 4706, 679, 29912, 736, 15772, 2568, 296, 2056, 29913, 13, 4706, 731, 29912, 15772, 2568, 296, 353, 995, 13951, 13, 1678, 500, 13, 13, 1678, 2024, 1347, 851, 2568, 296, 1231, 353, 376, 259, 12159, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 234, 191, 172, 31174, 30578, 31277, 31767, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 970, 1347, 1894, 296, 1231, 13, 1678, 426, 13, 4706, 679, 29912, 736, 851, 2568, 296, 1231, 2056, 29913, 13, 4706, 731, 29912, 851, 2568, 296, 1231, 353, 995, 13951, 13, 1678, 500, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 30948, 30658, 234, 191, 172, 31174, 232, 180, 133, 30936, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 2024, 938, 938, 4782, 10108, 353, 29871, 29900, 2056, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31057, 236, 154, 176, 30783, 31133, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 970, 1780, 23186, 580, 13, 1678, 426, 13, 4706, 565, 29898, 1366, 29889, 524, 4782, 10108, 1405, 29871, 29900, 1723, 13, 9651, 3183, 716, 2184, 29889, 2451, 703, 31994, 30417, 31263, 31295, 31479, 31366, 1496, 13, 4706, 565, 29898, 590, 10507, 2804, 1870, 1723, 13, 4706, 426, 13, 9651, 590, 10507, 29889, 11123, 890, 13, 9651, 590, 10507, 353, 1870, 29936, 13, 4706, 500, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31573, 30544, 30287, 30502, 31263, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 2558, 14463, 1013, 31057, 236, 151, 177, 30578, 829, 3207, 29958, 13, 1678, 970, 1780, 14350, 4782, 29898, 1347, 7670, 14463, 1723, 13, 1678, 426, 13, 4706, 445, 29889, 6113, 4763, 4782, 890, 13, 4706, 445, 29889, 6113, 2558, 1742, 29898, 7670, 14463, 3482, 13, 4706, 445, 29889, 6113, 5044, 4782, 890, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31026, 31020, 31573, 30544, 31263, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 970, 1780, 14350, 4763, 4782, 29898, 1723, 13, 1678, 426, 13, 4706, 565, 29898, 15772, 2568, 296, 1723, 13, 4706, 426, 13, 9651, 25665, 6113, 4373, 3542, 890, 13, 9651, 590, 10507, 29889, 6113, 703, 29912, 1496, 13, 4706, 500, 13, 4706, 1683, 13, 9651, 590, 10507, 29889, 6113, 703, 29912, 1496, 13, 4706, 938, 4782, 10108, 8445, 2056, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31320, 233, 160, 162, 31573, 30544, 31263, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 970, 1780, 14350, 5044, 4782, 580, 13, 1678, 426, 13, 4706, 938, 4782, 10108, 1192, 2056, 13, 4706, 565, 29898, 938, 4782, 10108, 529, 29871, 29900, 1723, 13, 9651, 3183, 716, 2184, 29889, 2451, 703, 31263, 30413, 232, 143, 188, 31361, 1496, 13, 4706, 565, 29898, 15772, 2568, 296, 1723, 13, 4706, 426, 13, 9651, 25665, 6113, 4373, 3542, 890, 13, 9651, 25665, 6113, 703, 29913, 1496, 13, 4706, 500, 13, 4706, 1683, 13, 9651, 25665, 6113, 703, 29913, 1496, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31573, 30544, 30667, 31020, 30333, 30346, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 3945, 1013, 30333, 30346, 30959, 829, 3207, 29958, 13, 1678, 970, 1780, 14350, 22131, 29898, 1347, 13872, 1723, 13, 1678, 426, 13, 4706, 565, 29898, 13872, 2804, 1870, 2607, 13872, 29889, 6513, 1405, 29871, 29900, 1723, 13, 4706, 426, 13, 9651, 25665, 6113, 29898, 13872, 3482, 13, 4706, 500, 13, 1678, 500, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31573, 30544, 31057, 236, 151, 177, 30578, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 2558, 1742, 1013, 31057, 236, 151, 177, 30578, 30959, 829, 3207, 29958, 13, 1678, 970, 1780, 14350, 2558, 1742, 29898, 1347, 7670, 1742, 1723, 13, 1678, 426, 13, 4706, 14350, 2558, 1742, 29898, 7670, 1742, 1919, 2089, 3482, 13, 1678, 500, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31573, 30544, 31057, 236, 151, 177, 30578, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 2558, 1742, 1013, 31057, 236, 151, 177, 30578, 30959, 829, 3207, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 5647, 1013, 30392, 31191, 30392, 233, 140, 172, 31599, 31057, 236, 151, 177, 30578, 829, 3207, 29958, 13, 1678, 970, 1780, 14350, 2558, 1742, 29898, 1347, 7670, 1742, 1919, 6120, 7338, 29897, 13, 1678, 426, 13, 4706, 565, 29898, 7670, 1742, 1275, 1870, 3830, 7670, 1742, 29889, 6513, 1275, 29871, 29900, 29897, 13, 9651, 3183, 716, 2184, 29889, 15730, 7327, 2451, 703, 30959, 30413, 31050, 30573, 30816, 1496, 13, 4706, 565, 29898, 15772, 2568, 296, 1275, 2089, 2607, 313, 7670, 1742, 1275, 376, 862, 29908, 3830, 7670, 1742, 1275, 376, 29886, 538, 29908, 1723, 1723, 13, 4706, 426, 13, 9651, 849, 610, 29871, 31391, 282, 538, 29871, 30658, 30682, 30651, 31573, 30544, 30816, 30868, 30448, 30214, 30413, 31619, 232, 150, 144, 29934, 8969, 30333, 233, 164, 166, 31542, 30858, 13, 9651, 25665, 6113, 29898, 2184, 29889, 18649, 29889, 4373, 3542, 3482, 13, 4706, 500, 13, 4706, 565, 29898, 445, 29889, 2095, 2568, 296, 1723, 13, 4706, 426, 13, 9651, 565, 29898, 7670, 1742, 1275, 376, 862, 29908, 3830, 7670, 1742, 1275, 376, 29886, 538, 29908, 1723, 13, 9651, 426, 13, 18884, 445, 29889, 27748, 6113, 4373, 3542, 890, 13, 9651, 500, 13, 4706, 500, 13, 4706, 565, 29898, 7338, 1723, 13, 9651, 25665, 6113, 703, 1966, 29930, 1966, 1496, 13, 4706, 1683, 13, 9651, 25665, 6113, 703, 1966, 1496, 13, 4706, 25665, 6113, 29898, 7670, 1742, 3482, 13, 1678, 500, 13, 13, 13, 1678, 970, 1780, 14350, 1626, 29898, 1347, 3992, 1723, 13, 1678, 426, 13, 4706, 565, 29898, 3992, 1275, 1870, 3830, 3992, 29889, 6513, 1275, 29871, 29900, 1723, 13, 9651, 736, 2056, 13, 13, 4706, 25665, 6113, 877, 525, 416, 13, 308, 13, 4706, 363, 29898, 938, 474, 3981, 353, 29871, 29900, 2056, 474, 3981, 529, 3992, 29889, 6513, 2056, 474, 3981, 8445, 1723, 13, 4706, 426, 13, 9651, 1373, 274, 353, 3992, 29961, 474, 3981, 4514, 2056, 13, 9651, 565, 29898, 274, 1275, 11297, 29873, 1495, 13, 9651, 426, 13, 18884, 445, 29889, 6113, 2558, 1742, 703, 3891, 1496, 13, 18884, 25665, 6113, 877, 525, 416, 13, 9651, 500, 13, 9651, 1683, 565, 29898, 274, 529, 29871, 29906, 29945, 29953, 1723, 13, 9651, 426, 13, 18884, 565, 29898, 274, 1405, 29871, 29941, 29906, 2607, 274, 529, 29871, 29896, 29906, 29955, 1723, 13, 18884, 426, 13, 462, 1678, 849, 29871, 30544, 31424, 31141, 233, 177, 141, 30578, 31277, 30214, 31383, 30698, 233, 153, 159, 31532, 31415, 31349, 13, 462, 1678, 565, 29898, 274, 1275, 525, 1966, 29915, 3830, 274, 1275, 525, 10998, 3830, 274, 1275, 525, 10162, 1723, 13, 462, 4706, 25665, 6113, 29898, 525, 1966, 2157, 13, 462, 1678, 25665, 6113, 29898, 274, 3482, 13, 18884, 500, 13, 18884, 1683, 13, 18884, 426, 13, 462, 1678, 25665, 6113, 703, 1966, 20333, 1496, 13, 462, 1678, 14350, 12901, 29898, 313, 7023, 1723, 274, 3482, 13, 18884, 500, 13, 9651, 500, 13, 9651, 1683, 13, 9651, 426, 13, 18884, 7023, 2636, 24512, 353, 590, 14934, 29889, 2577, 11207, 29898, 274, 29889, 8246, 3310, 13, 18884, 363, 29898, 524, 474, 3981, 29906, 353, 29871, 29900, 2056, 474, 3981, 29906, 529, 24512, 29889, 6513, 2056, 474, 3981, 29906, 8445, 1723, 13, 18884, 426, 13, 462, 1678, 25665, 6113, 703, 1966, 20333, 1496, 13, 462, 1678, 14350, 12901, 29898, 24512, 29961, 474, 3981, 29906, 4514, 3482, 13, 18884, 500, 13, 9651, 500, 13, 4706, 500, 458, 1454, 29898, 938, 474, 3981, 353, 29871, 29900, 2056, 474, 3981, 529, 3992, 29889, 6513, 2056, 474, 3981, 8445, 1723, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 30948, 30658, 30956, 30669, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 2024, 938, 938, 8003, 353, 29871, 29900, 2056, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 30948, 30658, 30448, 30210, 30956, 30669, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 2024, 938, 938, 3542, 5494, 353, 29871, 29900, 2056, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 29896, 29953, 31174, 31072, 30578, 31277, 31263, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 2024, 1040, 1347, 379, 735, 29879, 353, 376, 29900, 29896, 29906, 29941, 29946, 29945, 29953, 29955, 29947, 29929, 10736, 1753, 1769, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31573, 30544, 30578, 31669, 30354, 31263, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 5824, 1013, 30578, 31669, 30354, 31263, 829, 3207, 29958, 13, 1678, 970, 1780, 14350, 11207, 29898, 7023, 2636, 24512, 1723, 13, 1678, 426, 13, 4706, 565, 29898, 24512, 1275, 1870, 3830, 24512, 29889, 6513, 1275, 29871, 29900, 1723, 13, 9651, 736, 2056, 13, 4706, 14350, 22131, 29898, 376, 376, 3482, 13, 4706, 363, 29898, 938, 474, 3981, 353, 29871, 29900, 2056, 474, 3981, 529, 24512, 29889, 6513, 2056, 474, 3981, 8445, 1723, 13, 4706, 426, 13, 9651, 565, 29898, 313, 474, 3981, 1273, 29871, 29941, 29906, 1723, 1275, 29871, 29900, 1723, 13, 9651, 426, 13, 18884, 445, 29889, 6113, 22131, 29898, 2184, 29889, 18649, 29889, 4373, 3542, 3482, 13, 18884, 445, 29889, 6113, 2568, 296, 890, 13, 9651, 500, 13, 9651, 1683, 565, 29898, 313, 474, 3981, 1273, 29871, 29947, 1723, 1275, 29871, 29900, 1723, 13, 9651, 426, 13, 18884, 445, 29889, 6113, 22131, 703, 14796, 13, 9651, 500, 13, 9651, 7023, 289, 353, 24512, 29961, 474, 3981, 4514, 2056, 13, 9651, 938, 298, 353, 313, 289, 669, 29871, 29900, 24660, 29900, 1723, 5099, 29871, 29946, 29871, 2056, 13, 9651, 938, 301, 353, 289, 669, 29871, 29900, 24660, 2056, 13, 9651, 590, 10507, 29889, 6113, 29898, 379, 735, 29879, 29961, 298, 4514, 3482, 13, 9651, 590, 10507, 29889, 6113, 29898, 379, 735, 29879, 29961, 301, 4514, 3482, 13, 9651, 938, 8003, 4619, 29871, 29906, 2056, 13, 4706, 500, 13, 1678, 500, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 31573, 30544, 30287, 30502, 30578, 31669, 30354, 30763, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 4363, 529, 3207, 1024, 543, 29890, 1013, 30578, 31669, 30354, 30763, 829, 3207, 29958, 13, 1678, 970, 1780, 14350, 12901, 29898, 7023, 289, 1723, 13, 1678, 426, 13, 4706, 938, 298, 353, 313, 289, 669, 29871, 29900, 24660, 29900, 1723, 5099, 29871, 29946, 2056, 13, 4706, 938, 301, 353, 289, 669, 29871, 29900, 24660, 2056, 13, 4706, 590, 10507, 29889, 6113, 29898, 379, 735, 29879, 29961, 298, 4514, 3482, 13, 4706, 590, 10507, 29889, 6113, 29898, 379, 735, 29879, 29961, 301, 4514, 3482, 13, 4706, 938, 8003, 4619, 29871, 29906, 2056, 13, 4706, 849, 29943, 861, 2568, 296, 890, 13, 1678, 500, 13, 13, 1678, 396, 12803, 29871, 30728, 30636, 30494, 31911, 334, 7775, 7775, 7775, 2328, 29930, 13, 13, 1678, 2024, 1780, 25665, 6113, 29898, 1373, 274, 1723, 13, 1678, 426, 13, 4706, 938, 8003, 8445, 2056, 13, 4706, 590, 10507, 29889, 6113, 29898, 274, 3482, 13, 1678, 500, 13, 1678, 2024, 1780, 25665, 6113, 29898, 1347, 13872, 1723, 13, 1678, 426, 13, 4706, 938, 8003, 4619, 13872, 29889, 6513, 2056, 13, 4706, 590, 10507, 29889, 6113, 29898, 13872, 3482, 13, 1678, 500, 13, 13, 1678, 2024, 1780, 24778, 2568, 296, 580, 13, 1678, 426, 13, 4706, 565, 29898, 445, 29889, 2095, 2568, 296, 1723, 13, 4706, 426, 13, 9651, 565, 29898, 938, 8003, 448, 938, 3542, 5494, 1405, 29871, 29896, 29900, 29900, 1723, 13, 18884, 25665, 6113, 4373, 3542, 890, 13, 4706, 500, 13, 1678, 500, 13, 13, 1678, 2024, 1780, 25665, 6113, 4373, 3542, 580, 13, 1678, 426, 13, 4706, 565, 29898, 445, 29889, 2095, 2568, 296, 1723, 13, 4706, 426, 13, 9651, 565, 29898, 938, 8003, 1405, 29871, 29900, 1723, 13, 9651, 426, 13, 18884, 25665, 6113, 29898, 2184, 29889, 18649, 29889, 4373, 3542, 3482, 13, 18884, 938, 3542, 5494, 353, 938, 8003, 2056, 13, 18884, 14350, 2568, 296, 890, 13, 9651, 500, 13, 4706, 500, 13, 1678, 500, 13, 13, 1678, 2024, 1780, 14350, 2568, 296, 29898, 1723, 13, 1678, 426, 13, 4706, 565, 29898, 15772, 2568, 296, 1723, 13, 4706, 426, 13, 9651, 363, 29898, 938, 474, 3981, 353, 29871, 29900, 2056, 474, 3981, 529, 938, 4782, 10108, 2056, 474, 3981, 8445, 1723, 13, 9651, 426, 13, 18884, 25665, 6113, 29898, 445, 29889, 710, 2568, 296, 1231, 3482, 13, 9651, 500, 13, 4706, 500, 13, 1678, 500, 13, 13, 1678, 396, 355, 12803, 29871, 13, 13, 1678, 4363, 529, 7727, 29958, 13, 1678, 4363, 29871, 236, 151, 131, 233, 178, 132, 30783, 31133, 13, 1678, 4363, 1533, 7727, 29958, 13, 1678, 970, 1780, 3295, 4220, 580, 13, 1678, 426, 13, 4706, 445, 29889, 11123, 890, 13, 1678, 500, 13, 29913, 2 ]
docs/examples/pyplot/tick-position.py
tdegeus/pyplot_ext
0
1602765
<reponame>tdegeus/pyplot_ext import matplotlib.pyplot as plt import numpy as np plt.style.use(["goose", "goose-latex"]) n = 5 x = np.arange(n) y = np.sin(np.linspace(-3, 3, n)) xlabels = ["Long ticklabel %i" % i for i in range(n)] fig, ax = plt.subplots() ax.plot(x, y, "o-") ax.set_xticks(x) labels = ax.set_xticklabels(xlabels) for i, label in enumerate(labels): label.set_y(label.get_position()[1] - (i % 2) * 0.075) plt.savefig("tick-position.svg") plt.close()
[ 1, 529, 276, 1112, 420, 29958, 29873, 311, 479, 375, 29914, 2272, 5317, 29918, 1062, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 12655, 408, 7442, 13, 13, 572, 29873, 29889, 3293, 29889, 1509, 29898, 3366, 1484, 852, 613, 376, 1484, 852, 29899, 25694, 20068, 13, 13, 29876, 353, 29871, 29945, 13, 29916, 353, 7442, 29889, 279, 927, 29898, 29876, 29897, 13, 29891, 353, 7442, 29889, 5223, 29898, 9302, 29889, 1915, 3493, 6278, 29941, 29892, 29871, 29941, 29892, 302, 876, 13, 29916, 21134, 353, 6796, 8208, 16892, 1643, 1273, 29875, 29908, 1273, 474, 363, 474, 297, 3464, 29898, 29876, 4638, 13, 13, 1003, 29892, 4853, 353, 14770, 29889, 1491, 26762, 580, 13, 13, 1165, 29889, 5317, 29898, 29916, 29892, 343, 29892, 376, 29877, 29899, 1159, 13, 13, 1165, 29889, 842, 29918, 486, 7358, 29898, 29916, 29897, 13, 13, 21134, 353, 4853, 29889, 842, 29918, 486, 860, 21134, 29898, 29916, 21134, 29897, 13, 13, 1454, 474, 29892, 3858, 297, 26985, 29898, 21134, 1125, 13, 1678, 3858, 29889, 842, 29918, 29891, 29898, 1643, 29889, 657, 29918, 3283, 580, 29961, 29896, 29962, 448, 313, 29875, 1273, 29871, 29906, 29897, 334, 29871, 29900, 29889, 29900, 29955, 29945, 29897, 13, 13, 572, 29873, 29889, 7620, 1003, 703, 24667, 29899, 3283, 29889, 15120, 1159, 13, 572, 29873, 29889, 5358, 580, 13, 2 ]
Tests/Test_FetchUserStatuses.py
rohitgs28/FindMyEmployer
0
103943
<reponame>rohitgs28/FindMyEmployer import unittest import mock from mock import MagicMock,patch import os.path import logging import sys,os from Test_Config import * from MockData import Emailid,Password,statusData,Messages2 import sys import sys, os sys.path.append(os.path.abspath(os.path.join('..', 'extensions/'))) import extensions sys.path.append(os.path.abspath(os.path.join('..', 'LoggingDatabase/'))) import LoggingErrorsinDatabase sys.path.append(os.path.abspath(os.path.join('..', 'Databaselayer/'))) import FetchUserStatuses class Test_FetchUserStatuses(unittest.TestCase): def test_getUserStatuses_1(self): statusData = ['My first status', 'felling thoughtful'] fetchuserstatuses = FetchUserStatuses.FetchUserStatuses(mysql,statusData,Messages2[0]) statusData,result = fetchuserstatuses.getUserStatuses() #assert result == "pass" def test_getUserStatuses_2(self): statusData = [] fetchuserstatuses = FetchUserStatuses.FetchUserStatuses(mysql,statusData,Messages2[1]) statusData,result = fetchuserstatuses.getUserStatuses() #assert result == "fail" if __name__ == '__main__': unittest.main()
[ 1, 529, 276, 1112, 420, 29958, 307, 27342, 3174, 29906, 29947, 29914, 12542, 3421, 10495, 2376, 261, 13, 13, 5215, 443, 27958, 13, 5215, 11187, 13, 3166, 11187, 1053, 26494, 18680, 29892, 5041, 13, 5215, 2897, 29889, 2084, 13, 5215, 12183, 13, 5215, 10876, 29892, 359, 13, 3166, 4321, 29918, 3991, 1053, 334, 13, 3166, 26297, 1469, 1053, 22608, 333, 29892, 10048, 29892, 4882, 1469, 29892, 25510, 29906, 13, 5215, 10876, 13, 5215, 10876, 29892, 2897, 13, 9675, 29889, 2084, 29889, 4397, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 877, 636, 742, 525, 24299, 22208, 4961, 13, 5215, 17752, 13, 9675, 29889, 2084, 29889, 4397, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 877, 636, 742, 525, 3403, 3460, 9112, 22208, 4961, 13, 5215, 4522, 3460, 2392, 5223, 9112, 13, 9675, 29889, 2084, 29889, 4397, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 877, 636, 742, 525, 16390, 370, 294, 295, 2747, 22208, 4961, 13, 5215, 383, 3486, 2659, 5709, 267, 13, 13, 13, 13, 1990, 4321, 29918, 20927, 2659, 5709, 267, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 13, 29871, 822, 1243, 29918, 657, 2659, 5709, 267, 29918, 29896, 29898, 1311, 1125, 13, 4706, 4660, 1469, 353, 6024, 3421, 937, 4660, 742, 525, 29888, 7807, 2714, 1319, 2033, 13, 4706, 6699, 1792, 4882, 267, 353, 383, 3486, 2659, 5709, 267, 29889, 20927, 2659, 5709, 267, 29898, 7938, 29892, 4882, 1469, 29892, 25510, 29906, 29961, 29900, 2314, 13, 4706, 4660, 1469, 29892, 2914, 353, 6699, 1792, 4882, 267, 29889, 657, 2659, 5709, 267, 580, 13, 4706, 396, 9294, 1121, 1275, 376, 3364, 29908, 13, 13, 29871, 822, 1243, 29918, 657, 2659, 5709, 267, 29918, 29906, 29898, 1311, 1125, 13, 4706, 4660, 1469, 353, 5159, 13, 4706, 6699, 1792, 4882, 267, 353, 383, 3486, 2659, 5709, 267, 29889, 20927, 2659, 5709, 267, 29898, 7938, 29892, 4882, 1469, 29892, 25510, 29906, 29961, 29896, 2314, 13, 4706, 4660, 1469, 29892, 2914, 353, 6699, 1792, 4882, 267, 29889, 657, 2659, 5709, 267, 580, 13, 4706, 396, 9294, 1121, 1275, 376, 14057, 29908, 13, 13, 13, 13, 13, 13, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 443, 27958, 29889, 3396, 580, 13, 2 ]
MachineLearning/TP3/lrCostFunction.py
piwithy/ENSTA_MACHINE_LEARNING
0
1603636
<gh_stars>0 import numpy as np from sigmoid import sigmoid def lrCostFunction(theta, X, y, Lambda): """computes the cost of using theta as the parameter for regularized logistic regression. """ # preambule m, n = X.shape # 5,4 theta = theta.reshape((n, 1)) # (4,1) # ====================== YOUR CODE HERE ====================== # Instructions: Compute the cost of a particular choice of theta. # You should set J to the cost. # # Hint: The computation of the cost function and gradients can be # efficiently vectorized. For example, consider the computation # # sigmoid(X @ theta) or np.dot(X, theta) # # Each row of the resulting matrix will contain the value of the # prediction for that example. You can make use of this to vectorize # the cost function and gradient computations. # term1 = -(y.T @ (np.log(sigmoid(X @ theta)))) term2 = (1 - y).T @ (np.log(1 - sigmoid(X @ theta))) term3 = (np.linalg.norm(theta[1:]) ** 2) * (Lambda / (2 * m)) J = (1 / m) * (term1 - term2) + term3 # ============================================================= return J
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 12655, 408, 7442, 13, 3166, 4365, 29885, 3398, 1053, 4365, 29885, 3398, 13, 13, 13, 1753, 301, 29878, 25733, 6678, 29898, 3416, 29892, 1060, 29892, 343, 29892, 365, 2269, 1125, 13, 1678, 9995, 12097, 267, 278, 3438, 310, 773, 13, 1678, 278, 941, 408, 278, 3443, 363, 4943, 1891, 1480, 4695, 17855, 29889, 13, 1678, 9995, 13, 13, 1678, 396, 758, 1117, 1297, 13, 1678, 286, 29892, 302, 353, 1060, 29889, 12181, 29871, 396, 29871, 29945, 29892, 29946, 13, 1678, 278, 941, 353, 278, 941, 29889, 690, 14443, 3552, 29876, 29892, 29871, 29896, 876, 29871, 396, 313, 29946, 29892, 29896, 29897, 13, 13, 1678, 396, 1275, 9166, 2751, 612, 22970, 4810, 2287, 379, 27267, 1275, 9166, 2751, 13, 1678, 396, 2799, 582, 1953, 29901, 11796, 29872, 278, 3438, 310, 263, 3153, 7348, 310, 278, 941, 29889, 13, 1678, 396, 1669, 887, 881, 731, 435, 304, 278, 3438, 29889, 13, 1678, 396, 13, 1678, 396, 379, 524, 29901, 450, 16287, 310, 278, 3438, 740, 322, 4656, 10070, 508, 367, 13, 1678, 396, 539, 29497, 4608, 1891, 29889, 1152, 1342, 29892, 2050, 278, 16287, 13, 1678, 396, 13, 1678, 396, 965, 4365, 29885, 3398, 29898, 29990, 732, 278, 941, 29897, 470, 7442, 29889, 6333, 29898, 29990, 29892, 278, 941, 29897, 13, 1678, 396, 13, 1678, 396, 539, 7806, 1948, 310, 278, 9819, 4636, 674, 1712, 278, 995, 310, 278, 13, 1678, 396, 539, 18988, 363, 393, 1342, 29889, 887, 508, 1207, 671, 310, 445, 304, 4608, 675, 13, 1678, 396, 539, 278, 3438, 740, 322, 16030, 2912, 800, 29889, 29871, 13, 1678, 396, 13, 1678, 1840, 29896, 353, 19691, 29891, 29889, 29911, 732, 313, 9302, 29889, 1188, 29898, 18816, 29885, 3398, 29898, 29990, 732, 278, 941, 13697, 13, 1678, 1840, 29906, 353, 313, 29896, 448, 343, 467, 29911, 732, 313, 9302, 29889, 1188, 29898, 29896, 448, 4365, 29885, 3398, 29898, 29990, 732, 278, 941, 4961, 13, 1678, 1840, 29941, 353, 313, 9302, 29889, 29880, 979, 29887, 29889, 12324, 29898, 3416, 29961, 29896, 29901, 2314, 3579, 29871, 29906, 29897, 334, 313, 9099, 847, 313, 29906, 334, 286, 876, 13, 1678, 435, 353, 313, 29896, 847, 286, 29897, 334, 313, 8489, 29896, 448, 1840, 29906, 29897, 718, 1840, 29941, 13, 13, 1678, 396, 1275, 9166, 9166, 9166, 4936, 25512, 13, 13, 1678, 736, 435, 13, 2 ]
polling_stations/apps/data_collection/management/commands/import_tower_hamlets.py
mtravis/UK-Polling-Stations
0
20332
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = "E09000030" addresses_name = "local.2018-05-03/Version 2/Democracy_Club__03May2018.tsv" stations_name = "local.2018-05-03/Version 2/Democracy_Club__03May2018.tsv" elections = ["local.2018-05-03"] csv_delimiter = "\t" csv_encoding = "windows-1252" def address_record_to_dict(self, record): uprn = record.property_urn.strip().lstrip("0") if uprn == "6198433": rec = super().address_record_to_dict(record) rec["postcode"] = "E2 9DG" return rec if record.addressline6 == "E3 2LB" or record.addressline6 == "E3 5EG": return None return super().address_record_to_dict(record)
[ 1, 515, 848, 29918, 10855, 29889, 21895, 29889, 26381, 1053, 7399, 29990, 2139, 29928, 331, 25804, 6821, 431, 29907, 4501, 24192, 9555, 13, 13, 13, 1990, 10516, 29898, 5160, 29990, 2139, 29928, 331, 25804, 6821, 431, 29907, 4501, 24192, 9555, 1125, 13, 1678, 18701, 29918, 333, 353, 376, 29923, 29900, 29929, 29900, 29900, 29900, 29900, 29941, 29900, 29908, 13, 1678, 14157, 29918, 978, 353, 376, 2997, 29889, 29906, 29900, 29896, 29947, 29899, 29900, 29945, 29899, 29900, 29941, 29914, 6594, 29871, 29906, 29914, 29928, 331, 25804, 29918, 6821, 431, 1649, 29900, 29941, 12703, 29906, 29900, 29896, 29947, 29889, 1372, 29894, 29908, 13, 1678, 16355, 29918, 978, 353, 376, 2997, 29889, 29906, 29900, 29896, 29947, 29899, 29900, 29945, 29899, 29900, 29941, 29914, 6594, 29871, 29906, 29914, 29928, 331, 25804, 29918, 6821, 431, 1649, 29900, 29941, 12703, 29906, 29900, 29896, 29947, 29889, 1372, 29894, 29908, 13, 1678, 20209, 353, 6796, 2997, 29889, 29906, 29900, 29896, 29947, 29899, 29900, 29945, 29899, 29900, 29941, 3108, 13, 1678, 11799, 29918, 6144, 19657, 353, 6634, 29873, 29908, 13, 1678, 11799, 29918, 22331, 353, 376, 10499, 29899, 29896, 29906, 29945, 29906, 29908, 13, 13, 1678, 822, 3211, 29918, 11651, 29918, 517, 29918, 8977, 29898, 1311, 29892, 2407, 1125, 13, 4706, 318, 558, 29876, 353, 2407, 29889, 6799, 29918, 595, 29889, 17010, 2141, 29880, 17010, 703, 29900, 1159, 13, 13, 4706, 565, 318, 558, 29876, 1275, 376, 29953, 29896, 29929, 29947, 29946, 29941, 29941, 1115, 13, 9651, 1162, 353, 2428, 2141, 7328, 29918, 11651, 29918, 517, 29918, 8977, 29898, 11651, 29897, 13, 9651, 1162, 3366, 2490, 401, 3108, 353, 376, 29923, 29906, 29871, 29929, 29928, 29954, 29908, 13, 9651, 736, 1162, 13, 13, 4706, 565, 2407, 29889, 7328, 1220, 29953, 1275, 376, 29923, 29941, 29871, 29906, 29931, 29933, 29908, 470, 2407, 29889, 7328, 1220, 29953, 1275, 376, 29923, 29941, 29871, 29945, 11787, 1115, 13, 9651, 736, 6213, 13, 13, 4706, 736, 2428, 2141, 7328, 29918, 11651, 29918, 517, 29918, 8977, 29898, 11651, 29897, 13, 2 ]
omega_miya/plugins/maybe/__init__.py
rinrini001/omega-miya
120
150698
import datetime import random from nonebot import CommandGroup, logger from nonebot.plugin.export import export from nonebot.typing import T_State from nonebot.adapters.cqhttp.bot import Bot from nonebot.adapters.cqhttp.event import GroupMessageEvent from nonebot.adapters.cqhttp.permission import GROUP from nonebot.adapters.cqhttp.message import Message, MessageSegment from omega_miya.utils.omega_plugin_utils import init_export, init_processor_state from .utils import maybe, sp, sp_event # from ._oldalmanac import old_almanac # Custom plugin usage text __plugin_custom_name__ = '求签' __plugin_usage__ = r'''【求签】 求签, 求运势, 包括且不限于抽卡、吃饭、睡懒觉、DD 每个人每天求同一个东西的结果是一样的啦! 不要不信邪重新抽啦! 仅限群聊使用 **Permission** Command & Lv.10 or AuthNode **AuthNode** basic **Usage** /求签 [所求之事] /帮我选 [选项1 选项2 ...]''' # Init plugin export init_export(export(), __plugin_custom_name__, __plugin_usage__) # 注册事件响应器 Maybe = CommandGroup( 'maybe', # 使用run_preprocessor拦截权限管理, 在default_state初始化所需权限 state=init_processor_state( name='maybe', command=True, level=10), permission=GROUP, priority=10, block=True) luck = Maybe.command('luck', aliases={'求签'}) # 修改默认参数处理 @luck.args_parser async def parse(bot: Bot, event: GroupMessageEvent, state: T_State): args = str(event.get_plaintext()).strip().split() if not args: await luck.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:') state[state["_current_key"]] = args[0] if state[state["_current_key"]] == '取消': await luck.finish('操作已取消') @luck.handle() async def handle_first_receive(bot: Bot, event: GroupMessageEvent, state: T_State): args = str(event.get_plaintext()).strip().split() if not args: pass elif args and len(args) == 1: state['draw'] = args[0] else: await luck.finish('参数错误QAQ') @luck.got('draw', prompt='你想问什么事呢?') async def handle_luck(bot: Bot, event: GroupMessageEvent, state: T_State): user_id = event.user_id _draw = state['draw'] # 求签者昵称, 优先使用群昵称 draw_user = event.sender.card if not draw_user: draw_user = event.sender.nickname # 判断特殊事件 if _draw in sp.keys(): draw_result = sp_event(_draw) else: draw_result = maybe(draw=_draw, user_id=user_id) # 向用户发送结果 today = datetime.date.today().strftime('%Y年%m月%d日') msg = f'今天是{today}\n{draw_user}{draw_result}' logger.info(f'{event.group_id}/{event.user_id} 进行了一次求签') await luck.finish(msg) help_choice = Maybe.command('choice', aliases={'帮我选', '选择困难症'}) # 修改默认参数处理 @help_choice.args_parser async def parse(bot: Bot, event: GroupMessageEvent, state: T_State): args = str(event.get_plaintext()).strip() if not args: await help_choice.reject('你似乎没有发送有效的参数呢QAQ, 请重新发送:') state[state["_current_key"]] = args if state[state["_current_key"]] == '取消': await help_choice.finish('操作已取消') @help_choice.handle() async def handle_first_receive(bot: Bot, event: GroupMessageEvent, state: T_State): args = str(event.get_plaintext()).strip() if not args: pass else: state['choices'] = args @help_choice.got('choices', prompt='有啥选项, 发来我帮你选~') async def handle_help_choice(bot: Bot, event: GroupMessageEvent, state: T_State): choices = state['choices'] result = random.choice(str(choices).split()) result_text = f'''帮你从“{'”,“'.join(str(choices).split())}”中选择了:\n\n“{result}”''' msg = Message(MessageSegment.at(user_id=event.user_id)).append(result_text) await help_choice.finish(msg) # almanac = Maybe.command('almanac', aliases={'DD老黄历', 'dd老黄历'}) # # # @almanac.handle() # async def handle_first_receive(bot: Bot, event: GroupMessageEvent, state: T_State): # args = str(event.get_plaintext()).strip().lower().split() # if not args: # pass # else: # await almanac.finish('参数错误QAQ') # # user_id = event.user_id # # # 求签者昵称, 优先使用群昵称 # draw_user = event.sender.card # if not draw_user: # draw_user = event.sender.nickname # # draw_result = old_almanac(user_id=user_id) # # # 向用户发送结果 # today = datetime.date.today().strftime('%Y年%m月%d日') # msg = f"今天是{today}\n{draw_user}今日:\n{'='*12}\n{draw_result}" # logger.info(f'{event.group_id}/{event.user_id} 进行了一次dd老黄历查询') # await almanac.finish(msg)
[ 1, 1053, 12865, 13, 5215, 4036, 13, 3166, 5642, 7451, 1053, 10516, 4782, 29892, 17927, 13, 3166, 5642, 7451, 29889, 8582, 29889, 15843, 1053, 5609, 13, 3166, 5642, 7451, 29889, 1017, 15702, 1053, 323, 29918, 2792, 13, 3166, 5642, 7451, 29889, 328, 481, 2153, 29889, 29883, 29939, 1124, 29889, 7451, 1053, 11273, 13, 3166, 5642, 7451, 29889, 328, 481, 2153, 29889, 29883, 29939, 1124, 29889, 3696, 1053, 6431, 3728, 2624, 13, 3166, 5642, 7451, 29889, 328, 481, 2153, 29889, 29883, 29939, 1124, 29889, 16074, 1053, 15345, 13, 3166, 5642, 7451, 29889, 328, 481, 2153, 29889, 29883, 29939, 1124, 29889, 4906, 1053, 7777, 29892, 7777, 17669, 358, 13, 3166, 2703, 2442, 29918, 2460, 3761, 29889, 13239, 29889, 4787, 29918, 8582, 29918, 13239, 1053, 2069, 29918, 15843, 29892, 2069, 29918, 26482, 29918, 3859, 13, 3166, 869, 13239, 1053, 5505, 29892, 805, 29892, 29871, 805, 29918, 3696, 13, 29937, 515, 869, 29918, 1025, 284, 1171, 562, 1053, 2030, 29918, 284, 1171, 562, 13, 13, 13, 29937, 8701, 7079, 8744, 1426, 13, 1649, 8582, 29918, 6341, 29918, 978, 1649, 353, 525, 31376, 234, 176, 193, 29915, 13, 1649, 8582, 29918, 21125, 1649, 353, 364, 12008, 31478, 31376, 234, 176, 193, 31472, 13, 31376, 234, 176, 193, 29892, 29871, 31376, 31894, 232, 141, 194, 29892, 29871, 31473, 233, 142, 175, 231, 187, 151, 30413, 31175, 30909, 233, 141, 192, 232, 144, 164, 30330, 232, 147, 134, 236, 168, 176, 30330, 234, 160, 164, 233, 138, 149, 235, 170, 140, 30330, 7858, 13, 31951, 30502, 30313, 31951, 30408, 31376, 30980, 30287, 30502, 30979, 30602, 30210, 31320, 30801, 30392, 30287, 31819, 30210, 232, 152, 169, 29991, 13, 30413, 30698, 30413, 30689, 236, 133, 173, 30908, 30374, 233, 141, 192, 232, 152, 169, 29991, 13, 231, 190, 136, 31175, 31829, 235, 132, 141, 30785, 30406, 13, 13, 1068, 27293, 1068, 13, 6255, 669, 365, 29894, 29889, 29896, 29900, 13, 272, 13189, 4247, 13, 13, 1068, 6444, 4247, 1068, 13, 16121, 13, 13, 1068, 27573, 1068, 13, 29914, 31376, 234, 176, 193, 518, 30744, 31376, 30577, 30745, 29962, 13, 29914, 232, 187, 177, 30672, 31333, 518, 31333, 31888, 29896, 29871, 31333, 31888, 29906, 2023, 29962, 12008, 13, 13, 13, 29937, 10886, 7079, 5609, 13, 2344, 29918, 15843, 29898, 15843, 3285, 4770, 8582, 29918, 6341, 29918, 978, 1649, 29892, 4770, 8582, 29918, 21125, 1649, 29897, 13, 13, 13, 29937, 29871, 31368, 232, 137, 143, 30745, 30631, 232, 150, 144, 31370, 30943, 13, 22762, 353, 10516, 4782, 29898, 13, 1678, 525, 26026, 742, 13, 1678, 396, 29871, 30785, 30406, 3389, 29918, 1457, 26482, 233, 142, 169, 233, 139, 173, 233, 160, 134, 31175, 31624, 30687, 29892, 29871, 30505, 4381, 29918, 3859, 31120, 31020, 30705, 30744, 31383, 233, 160, 134, 31175, 13, 1678, 2106, 29922, 2344, 29918, 26482, 29918, 3859, 29898, 13, 4706, 1024, 2433, 26026, 742, 13, 4706, 1899, 29922, 5574, 29892, 13, 4706, 3233, 29922, 29896, 29900, 511, 13, 1678, 10751, 29922, 26284, 29892, 13, 1678, 20136, 29922, 29896, 29900, 29892, 13, 1678, 2908, 29922, 5574, 29897, 13, 13, 29880, 2707, 353, 7198, 29889, 6519, 877, 29880, 2707, 742, 14430, 2129, 3790, 29915, 31376, 234, 176, 193, 29915, 1800, 13, 13, 13, 29937, 29871, 31273, 31264, 31735, 31439, 31125, 30354, 31548, 30687, 13, 29992, 29880, 2707, 29889, 5085, 29918, 16680, 13, 12674, 822, 6088, 29898, 7451, 29901, 11273, 29892, 1741, 29901, 6431, 3728, 2624, 29892, 2106, 29901, 323, 29918, 2792, 1125, 13, 1678, 6389, 353, 851, 29898, 3696, 29889, 657, 29918, 24595, 726, 16655, 17010, 2141, 5451, 580, 13, 1678, 565, 451, 6389, 29901, 13, 4706, 7272, 9885, 29889, 276, 622, 877, 30919, 231, 191, 191, 231, 188, 145, 31423, 30417, 30910, 31545, 30417, 31944, 30210, 31125, 30354, 232, 148, 165, 29984, 29909, 29984, 29892, 29871, 31088, 30908, 30374, 30910, 31545, 29901, 1495, 13, 1678, 2106, 29961, 3859, 3366, 29918, 3784, 29918, 1989, 3108, 29962, 353, 6389, 29961, 29900, 29962, 13, 1678, 565, 2106, 29961, 3859, 3366, 29918, 3784, 29918, 1989, 3108, 29962, 1275, 525, 30683, 31276, 2396, 13, 4706, 7272, 9885, 29889, 4951, 728, 877, 31904, 30732, 31290, 30683, 31276, 1495, 13, 13, 13, 29992, 29880, 2707, 29889, 8411, 580, 13, 12674, 822, 4386, 29918, 4102, 29918, 13556, 573, 29898, 7451, 29901, 11273, 29892, 1741, 29901, 6431, 3728, 2624, 29892, 2106, 29901, 323, 29918, 2792, 1125, 13, 1678, 6389, 353, 851, 29898, 3696, 29889, 657, 29918, 24595, 726, 16655, 17010, 2141, 5451, 580, 13, 1678, 565, 451, 6389, 29901, 13, 4706, 1209, 13, 1678, 25342, 6389, 322, 7431, 29898, 5085, 29897, 1275, 29871, 29896, 29901, 13, 4706, 2106, 1839, 4012, 2033, 353, 6389, 29961, 29900, 29962, 13, 1678, 1683, 29901, 13, 4706, 7272, 9885, 29889, 4951, 728, 877, 31125, 30354, 31745, 235, 178, 178, 29984, 29909, 29984, 1495, 13, 13, 13, 29992, 29880, 2707, 29889, 7085, 877, 4012, 742, 9508, 2433, 30919, 31522, 31658, 231, 190, 131, 31882, 30745, 232, 148, 165, 29973, 1495, 13, 12674, 822, 4386, 29918, 29880, 2707, 29898, 7451, 29901, 11273, 29892, 1741, 29901, 6431, 3728, 2624, 29892, 2106, 29901, 323, 29918, 2792, 1125, 13, 1678, 1404, 29918, 333, 353, 1741, 29889, 1792, 29918, 333, 13, 1678, 903, 4012, 353, 2106, 1839, 4012, 2033, 13, 1678, 396, 29871, 31376, 234, 176, 193, 30767, 233, 155, 184, 31685, 29892, 29871, 231, 191, 155, 31244, 30785, 30406, 31829, 233, 155, 184, 31685, 13, 1678, 4216, 29918, 1792, 353, 1741, 29889, 15452, 29889, 7543, 13, 1678, 565, 451, 4216, 29918, 1792, 29901, 13, 4706, 4216, 29918, 1792, 353, 1741, 29889, 15452, 29889, 19254, 978, 13, 13, 1678, 396, 29871, 31791, 31683, 31141, 233, 177, 141, 30745, 30631, 13, 1678, 565, 903, 4012, 297, 805, 29889, 8149, 7295, 13, 4706, 4216, 29918, 2914, 353, 805, 29918, 3696, 7373, 4012, 29897, 13, 1678, 1683, 29901, 13, 4706, 4216, 29918, 2914, 353, 5505, 29898, 4012, 29922, 29918, 4012, 29892, 1404, 29918, 333, 29922, 1792, 29918, 333, 29897, 13, 13, 1678, 396, 29871, 31331, 30406, 31229, 30910, 31545, 31320, 30801, 13, 1678, 9826, 353, 12865, 29889, 1256, 29889, 27765, 2141, 710, 615, 603, 877, 29995, 29979, 30470, 29995, 29885, 30534, 29995, 29881, 30325, 1495, 13, 1678, 10191, 353, 285, 29915, 31482, 30408, 30392, 29912, 27765, 1012, 29876, 29912, 4012, 29918, 1792, 1157, 4012, 29918, 2914, 10162, 13, 1678, 17927, 29889, 3888, 29898, 29888, 29915, 29912, 3696, 29889, 2972, 29918, 333, 6822, 29912, 3696, 29889, 1792, 29918, 333, 29913, 29871, 31174, 30448, 30743, 30287, 30936, 31376, 234, 176, 193, 1495, 13, 1678, 7272, 9885, 29889, 4951, 728, 29898, 7645, 29897, 13, 13, 13, 8477, 29918, 16957, 353, 7198, 29889, 6519, 877, 16957, 742, 14430, 2129, 3790, 29915, 232, 187, 177, 30672, 31333, 742, 525, 31333, 233, 142, 172, 232, 158, 179, 236, 157, 193, 234, 154, 138, 29915, 1800, 13, 13, 13, 29937, 29871, 31273, 31264, 31735, 31439, 31125, 30354, 31548, 30687, 13, 29992, 8477, 29918, 16957, 29889, 5085, 29918, 16680, 13, 12674, 822, 6088, 29898, 7451, 29901, 11273, 29892, 1741, 29901, 6431, 3728, 2624, 29892, 2106, 29901, 323, 29918, 2792, 1125, 13, 1678, 6389, 353, 851, 29898, 3696, 29889, 657, 29918, 24595, 726, 16655, 17010, 580, 13, 1678, 565, 451, 6389, 29901, 13, 4706, 7272, 1371, 29918, 16957, 29889, 276, 622, 877, 30919, 231, 191, 191, 231, 188, 145, 31423, 30417, 30910, 31545, 30417, 31944, 30210, 31125, 30354, 232, 148, 165, 29984, 29909, 29984, 29892, 29871, 31088, 30908, 30374, 30910, 31545, 29901, 1495, 13, 1678, 2106, 29961, 3859, 3366, 29918, 3784, 29918, 1989, 3108, 29962, 353, 6389, 13, 1678, 565, 2106, 29961, 3859, 3366, 29918, 3784, 29918, 1989, 3108, 29962, 1275, 525, 30683, 31276, 2396, 13, 4706, 7272, 1371, 29918, 16957, 29889, 4951, 728, 877, 31904, 30732, 31290, 30683, 31276, 1495, 13, 13, 13, 29992, 8477, 29918, 16957, 29889, 8411, 580, 13, 12674, 822, 4386, 29918, 4102, 29918, 13556, 573, 29898, 7451, 29901, 11273, 29892, 1741, 29901, 6431, 3728, 2624, 29892, 2106, 29901, 323, 29918, 2792, 1125, 13, 1678, 6389, 353, 851, 29898, 3696, 29889, 657, 29918, 24595, 726, 16655, 17010, 580, 13, 1678, 565, 451, 6389, 29901, 13, 4706, 1209, 13, 1678, 1683, 29901, 13, 4706, 2106, 1839, 1859, 1575, 2033, 353, 6389, 13, 13, 13, 29992, 8477, 29918, 16957, 29889, 7085, 877, 1859, 1575, 742, 9508, 2433, 30417, 232, 152, 168, 31333, 31888, 29892, 29871, 30910, 30805, 30672, 232, 187, 177, 30919, 31333, 30022, 1495, 13, 12674, 822, 4386, 29918, 8477, 29918, 16957, 29898, 7451, 29901, 11273, 29892, 1741, 29901, 6431, 3728, 2624, 29892, 2106, 29901, 323, 29918, 2792, 1125, 13, 1678, 19995, 353, 2106, 1839, 1859, 1575, 2033, 13, 1678, 1121, 353, 4036, 29889, 16957, 29898, 710, 29898, 1859, 1575, 467, 5451, 3101, 13, 1678, 1121, 29918, 726, 353, 285, 12008, 232, 187, 177, 30919, 31594, 30015, 10998, 30024, 30214, 30015, 4286, 7122, 29898, 710, 29898, 1859, 1575, 467, 5451, 580, 2915, 30024, 30275, 31333, 233, 142, 172, 30743, 30383, 29905, 29876, 29905, 29876, 30015, 29912, 2914, 29913, 30024, 12008, 13, 1678, 10191, 353, 7777, 29898, 3728, 17669, 358, 29889, 271, 29898, 1792, 29918, 333, 29922, 3696, 29889, 1792, 29918, 333, 8106, 4397, 29898, 2914, 29918, 726, 29897, 13, 1678, 7272, 1371, 29918, 16957, 29889, 4951, 728, 29898, 7645, 29897, 13, 13, 13, 29937, 394, 1171, 562, 353, 7198, 29889, 6519, 877, 284, 1171, 562, 742, 14430, 2129, 3790, 29915, 7858, 31506, 31491, 232, 145, 137, 742, 525, 1289, 31506, 31491, 232, 145, 137, 29915, 1800, 13, 29937, 13, 29937, 13, 29937, 732, 284, 1171, 562, 29889, 8411, 580, 13, 29937, 7465, 822, 4386, 29918, 4102, 29918, 13556, 573, 29898, 7451, 29901, 11273, 29892, 1741, 29901, 6431, 3728, 2624, 29892, 2106, 29901, 323, 29918, 2792, 1125, 13, 29937, 268, 6389, 353, 851, 29898, 3696, 29889, 657, 29918, 24595, 726, 16655, 17010, 2141, 13609, 2141, 5451, 580, 13, 29937, 268, 565, 451, 6389, 29901, 13, 29937, 308, 1209, 13, 29937, 268, 1683, 29901, 13, 29937, 308, 7272, 394, 1171, 562, 29889, 4951, 728, 877, 31125, 30354, 31745, 235, 178, 178, 29984, 29909, 29984, 1495, 13, 29937, 13, 29937, 268, 1404, 29918, 333, 353, 1741, 29889, 1792, 29918, 333, 13, 29937, 13, 29937, 268, 396, 29871, 31376, 234, 176, 193, 30767, 233, 155, 184, 31685, 29892, 29871, 231, 191, 155, 31244, 30785, 30406, 31829, 233, 155, 184, 31685, 13, 29937, 268, 4216, 29918, 1792, 353, 1741, 29889, 15452, 29889, 7543, 13, 29937, 268, 565, 451, 4216, 29918, 1792, 29901, 13, 29937, 308, 4216, 29918, 1792, 353, 1741, 29889, 15452, 29889, 19254, 978, 13, 29937, 13, 29937, 268, 4216, 29918, 2914, 353, 2030, 29918, 284, 1171, 562, 29898, 1792, 29918, 333, 29922, 1792, 29918, 333, 29897, 13, 29937, 13, 29937, 268, 396, 29871, 31331, 30406, 31229, 30910, 31545, 31320, 30801, 13, 29937, 268, 9826, 353, 12865, 29889, 1256, 29889, 27765, 2141, 710, 615, 603, 877, 29995, 29979, 30470, 29995, 29885, 30534, 29995, 29881, 30325, 1495, 13, 29937, 268, 10191, 353, 285, 29908, 31482, 30408, 30392, 29912, 27765, 1012, 29876, 29912, 4012, 29918, 1792, 29913, 31482, 30325, 3583, 29876, 10998, 2433, 29930, 29896, 29906, 1012, 29876, 29912, 4012, 29918, 2914, 5038, 13, 29937, 268, 17927, 29889, 3888, 29898, 29888, 29915, 29912, 3696, 29889, 2972, 29918, 333, 6822, 29912, 3696, 29889, 1792, 29918, 333, 29913, 29871, 31174, 30448, 30743, 30287, 30936, 1289, 31506, 31491, 232, 145, 137, 31213, 235, 178, 165, 1495, 13, 29937, 268, 7272, 394, 1171, 562, 29889, 4951, 728, 29898, 7645, 29897, 13, 2 ]
hard-gists/7578539/snippet.py
jjhenkel/dockerizeme
21
3630
from pylab import * from numpy import * from numpy.linalg import solve from scipy.integrate import odeint from scipy.stats import norm, uniform, beta from scipy.special import jacobi a = 0.0 b = 3.0 theta=1.0 sigma=sqrt(theta/(2*(a+b+2))) tscale = 0.05 invariant_distribution = poly1d( [-1 for x in range(int(a))], True)*poly1d( [1 for x in range(int(b))], True) def eigenvalue(n): return theta*n*(n+a+b+1)/(a+b+2) gaussian_var = norm() def dW(dt): return norm.rvs() / sqrt(dt) def random_walk(y0, tmax, dt, times = None): dt = dt * tscale def rhs(y,t): return -theta*(y-(a-b)/(a+b+2)) + sqrt(2*theta*(1-y*y)/(a+b+2))*dW(dt/tscale) if (times is None): times = arange(0,tmax,dt) y = zeros(shape=times.shape, dtype=float) y[0] = y0 for i in range(1,y.shape[0]): y[i] = y[i-1] + rhs(y[i-1], times[i])*dt if abs(y[i]) > 1: y[i] = y[i] / abs(y[i]) return (times, y) def beta_prior(s, f): return poly1d(ones(shape=(s,)), True)*poly1d(-1*ones(shape=(f,)), True) def poly_to_jacobi(x): """x is a poly1d object""" xc = x.coeffs N = x.order+1 matrix = zeros(shape=(N,N), dtype=float) for i in range(N): matrix[N-i-1:N, i] = jacobi(i,a,b).coeffs return solve(matrix, xc) def jacobi_to_poly(x): result = poly1d([0]) for i in range(x.shape[0]): result = result + (jacobi(i,a,b)*invariant_distribution)*x[i] return result def jacobi_to_poly_no_invariant(x): result = poly1d([0]) for i in range(x.shape[0]): result = result + jacobi(i,a,b)*x[i] return result def propagate_jacobi(pc, t): """Takes jacobi coefficients and propagates them""" n = arange(pc.shape[0], dtype=float) l = theta*n*(n+a+b+1.0)/(a+b+2.0)*tscale return exp(-l*t)*pc def truncate_unnecessary_jacobi(p): p_normalized = p / (abs(p).sum()) cs = cumsum(abs(p_normalized[::-1]))[::-1] return p_normalized[where(abs(cs) > 1e-4)] def pde_solve(prior, t): result = zeros(shape=(t.shape[0], prior.shape[0]), dtype=float) result[0,:] = prior for i in range(1,t.shape[0]): result[i,:] = propagate_jacobi(result[i-1,:], t[i]-t[i-1]) return result def transform_to_x(pdf, x): result = zeros(shape=(pdf.shape[0], x.shape[0]), dtype=float) for i in range(0, pdf.shape[0]): p = jacobi_to_poly(pdf[i,:]) result[i,:] = p(x) result[i,:] /= result[i,:].sum() return result tmax = 4 prior = beta_prior(40, 20) prior_in_jacobi = poly_to_jacobi(prior) dt = 0.1 times = arange(0,tmax,dt) x = arange(-1,1,0.01) rw_dt = 0.01 t, y = random_walk(0.35*2-1, tmax, rw_dt) solution_as_x = zeros(shape=(times.size, x.size), dtype=float) solution_as_jacobi = None empirical_ctr = zeros(shape=(4,), dtype=float) for i in range(0,4): nt = int(1.0/dt) prior = prior_in_jacobi rnd = uniform(0,1) if (i > 0): nsamples = 40 r = rnd.rvs(nsamples) ctr = (y[i/rw_dt]+1)/2.0 print "CTR: " + str(ctr) success = (r < ctr).sum() print "Empirical: " + str(success / float(nsamples)) evidence = beta_prior( nsamples - success, success) prior = None j = truncate_unnecessary_jacobi(solution_as_jacobi[int(1/dt)-1]) prior = poly_to_jacobi(evidence * jacobi_to_poly_no_invariant(j)) empirical_ctr[i] = success / float(nsamples) solution_as_jacobi = pde_solve(prior, times[i*nt:(i+1)*nt]) solution_as_x[i*nt:(i+1)*nt] = transform_to_x(solution_as_jacobi, x) plot(arange(0,4), empirical_ctr, 'go') plot(t, (y+1)/2.0, 'k') imshow(solution_as_x.transpose(), origin='lower', extent=[0,tmax,0,1]) xlabel("time") ylabel("CTR") title("Bayesian Estimate of CTR") colorbar() show()
[ 1, 515, 282, 2904, 370, 1053, 334, 13, 3166, 12655, 1053, 334, 13, 3166, 12655, 29889, 29880, 979, 29887, 1053, 4505, 13, 3166, 4560, 2272, 29889, 14146, 403, 1053, 288, 311, 524, 13, 3166, 4560, 2272, 29889, 16202, 1053, 6056, 29892, 9090, 29892, 21762, 13, 3166, 4560, 2272, 29889, 18732, 1053, 432, 562, 15647, 13, 13, 13, 13, 29874, 353, 29871, 29900, 29889, 29900, 13, 29890, 353, 29871, 29941, 29889, 29900, 13, 3416, 29922, 29896, 29889, 29900, 13, 3754, 29922, 3676, 29898, 3416, 14571, 29906, 16395, 29874, 29974, 29890, 29974, 29906, 4961, 13, 13, 1372, 29883, 744, 353, 29871, 29900, 29889, 29900, 29945, 13, 13, 262, 19365, 29918, 27691, 353, 15680, 29896, 29881, 29898, 21069, 29896, 363, 921, 297, 3464, 29898, 524, 29898, 29874, 876, 1402, 5852, 11877, 22678, 29896, 29881, 29898, 518, 29896, 363, 921, 297, 3464, 29898, 524, 29898, 29890, 876, 1402, 5852, 29897, 13, 13, 1753, 7388, 1767, 29898, 29876, 1125, 13, 1678, 736, 278, 941, 29930, 29876, 16395, 29876, 29974, 29874, 29974, 29890, 29974, 29896, 6802, 29898, 29874, 29974, 29890, 29974, 29906, 29897, 13, 13, 29887, 17019, 29918, 1707, 353, 6056, 580, 13, 1753, 270, 29956, 29898, 6008, 1125, 13, 1678, 736, 6056, 29889, 29878, 4270, 580, 847, 18074, 2273, 29898, 6008, 29897, 13, 13, 1753, 4036, 29918, 20919, 29898, 29891, 29900, 29892, 260, 3317, 29892, 11636, 29892, 3064, 353, 6213, 1125, 13, 1678, 11636, 353, 11636, 334, 260, 7052, 13, 1678, 822, 29365, 29898, 29891, 29892, 29873, 1125, 13, 4706, 736, 448, 3416, 16395, 29891, 17722, 29874, 29899, 29890, 6802, 29898, 29874, 29974, 29890, 29974, 29906, 876, 718, 18074, 2273, 29898, 29906, 29930, 3416, 16395, 29896, 29899, 29891, 29930, 29891, 6802, 29898, 29874, 29974, 29890, 29974, 29906, 876, 29930, 29881, 29956, 29898, 6008, 29914, 1372, 29883, 744, 29897, 13, 1678, 565, 313, 3706, 338, 6213, 1125, 13, 4706, 3064, 353, 564, 927, 29898, 29900, 29892, 29873, 3317, 29892, 6008, 29897, 13, 1678, 343, 353, 24786, 29898, 12181, 29922, 3706, 29889, 12181, 29892, 26688, 29922, 7411, 29897, 13, 1678, 343, 29961, 29900, 29962, 353, 343, 29900, 13, 1678, 363, 474, 297, 3464, 29898, 29896, 29892, 29891, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 343, 29961, 29875, 29962, 353, 343, 29961, 29875, 29899, 29896, 29962, 718, 29365, 29898, 29891, 29961, 29875, 29899, 29896, 1402, 3064, 29961, 29875, 2314, 29930, 6008, 13, 4706, 565, 6425, 29898, 29891, 29961, 29875, 2314, 1405, 29871, 29896, 29901, 13, 9651, 343, 29961, 29875, 29962, 353, 343, 29961, 29875, 29962, 847, 6425, 29898, 29891, 29961, 29875, 2314, 13, 1678, 736, 313, 3706, 29892, 343, 29897, 13, 13, 1753, 21762, 29918, 29886, 13479, 29898, 29879, 29892, 285, 1125, 13, 1678, 736, 15680, 29896, 29881, 29898, 2873, 29898, 12181, 7607, 29879, 29892, 8243, 5852, 11877, 22678, 29896, 29881, 6278, 29896, 29930, 2873, 29898, 12181, 7607, 29888, 29892, 8243, 5852, 29897, 13, 13, 1753, 15680, 29918, 517, 29918, 29926, 562, 15647, 29898, 29916, 1125, 13, 1678, 9995, 29916, 338, 263, 15680, 29896, 29881, 1203, 15945, 29908, 13, 1678, 921, 29883, 353, 921, 29889, 1111, 12352, 29879, 13, 1678, 405, 353, 921, 29889, 2098, 29974, 29896, 13, 1678, 4636, 353, 24786, 29898, 12181, 7607, 29940, 29892, 29940, 511, 26688, 29922, 7411, 29897, 13, 1678, 363, 474, 297, 3464, 29898, 29940, 1125, 13, 4706, 4636, 29961, 29940, 29899, 29875, 29899, 29896, 29901, 29940, 29892, 474, 29962, 353, 432, 562, 15647, 29898, 29875, 29892, 29874, 29892, 29890, 467, 1111, 12352, 29879, 13, 1678, 736, 4505, 29898, 5344, 29892, 921, 29883, 29897, 13, 13, 1753, 432, 562, 15647, 29918, 517, 29918, 22678, 29898, 29916, 1125, 13, 1678, 1121, 353, 15680, 29896, 29881, 4197, 29900, 2314, 13, 1678, 363, 474, 297, 3464, 29898, 29916, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 1121, 353, 1121, 718, 313, 29926, 562, 15647, 29898, 29875, 29892, 29874, 29892, 29890, 11877, 262, 19365, 29918, 27691, 11877, 29916, 29961, 29875, 29962, 13, 1678, 736, 1121, 13, 13, 1753, 432, 562, 15647, 29918, 517, 29918, 22678, 29918, 1217, 29918, 262, 19365, 29898, 29916, 1125, 13, 1678, 1121, 353, 15680, 29896, 29881, 4197, 29900, 2314, 13, 1678, 363, 474, 297, 3464, 29898, 29916, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 1121, 353, 1121, 718, 432, 562, 15647, 29898, 29875, 29892, 29874, 29892, 29890, 11877, 29916, 29961, 29875, 29962, 13, 1678, 736, 1121, 13, 13, 1753, 13089, 403, 29918, 29926, 562, 15647, 29898, 6739, 29892, 260, 1125, 13, 1678, 9995, 29911, 6926, 432, 562, 15647, 16127, 322, 13089, 1078, 963, 15945, 29908, 13, 1678, 302, 353, 564, 927, 29898, 6739, 29889, 12181, 29961, 29900, 1402, 26688, 29922, 7411, 29897, 13, 1678, 301, 353, 278, 941, 29930, 29876, 16395, 29876, 29974, 29874, 29974, 29890, 29974, 29896, 29889, 29900, 6802, 29898, 29874, 29974, 29890, 29974, 29906, 29889, 29900, 11877, 1372, 29883, 744, 13, 1678, 736, 1518, 6278, 29880, 29930, 29873, 11877, 6739, 13, 13, 1753, 21022, 403, 29918, 348, 15107, 653, 29918, 29926, 562, 15647, 29898, 29886, 1125, 13, 1678, 282, 29918, 8945, 1891, 353, 282, 847, 313, 6897, 29898, 29886, 467, 2083, 3101, 13, 1678, 5939, 353, 13299, 2083, 29898, 6897, 29898, 29886, 29918, 8945, 1891, 29961, 1057, 29899, 29896, 12622, 29961, 1057, 29899, 29896, 29962, 13, 1678, 736, 282, 29918, 8945, 1891, 29961, 3062, 29898, 6897, 29898, 2395, 29897, 1405, 29871, 29896, 29872, 29899, 29946, 4638, 13, 13, 1753, 282, 311, 29918, 2929, 345, 29898, 29886, 13479, 29892, 260, 1125, 13, 1678, 1121, 353, 24786, 29898, 12181, 7607, 29873, 29889, 12181, 29961, 29900, 1402, 7536, 29889, 12181, 29961, 29900, 11724, 26688, 29922, 7411, 29897, 13, 1678, 1121, 29961, 29900, 29892, 17531, 353, 7536, 13, 1678, 363, 474, 297, 3464, 29898, 29896, 29892, 29873, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 1121, 29961, 29875, 29892, 17531, 353, 13089, 403, 29918, 29926, 562, 15647, 29898, 2914, 29961, 29875, 29899, 29896, 29892, 29901, 1402, 260, 29961, 29875, 29962, 29899, 29873, 29961, 29875, 29899, 29896, 2314, 13, 1678, 736, 1121, 13, 13, 1753, 4327, 29918, 517, 29918, 29916, 29898, 5140, 29892, 921, 1125, 13, 1678, 1121, 353, 24786, 29898, 12181, 7607, 5140, 29889, 12181, 29961, 29900, 1402, 921, 29889, 12181, 29961, 29900, 11724, 26688, 29922, 7411, 29897, 13, 1678, 363, 474, 297, 3464, 29898, 29900, 29892, 13552, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 282, 353, 432, 562, 15647, 29918, 517, 29918, 22678, 29898, 5140, 29961, 29875, 29892, 29901, 2314, 13, 4706, 1121, 29961, 29875, 29892, 17531, 353, 282, 29898, 29916, 29897, 13, 4706, 1121, 29961, 29875, 29892, 17531, 847, 29922, 1121, 29961, 29875, 29892, 29901, 1822, 2083, 580, 13, 1678, 736, 1121, 13, 13, 29873, 3317, 353, 29871, 29946, 13, 29886, 13479, 353, 21762, 29918, 29886, 13479, 29898, 29946, 29900, 29892, 29871, 29906, 29900, 29897, 13, 29886, 13479, 29918, 262, 29918, 29926, 562, 15647, 353, 15680, 29918, 517, 29918, 29926, 562, 15647, 29898, 29886, 13479, 29897, 13, 13, 6008, 353, 29871, 29900, 29889, 29896, 13, 3706, 353, 564, 927, 29898, 29900, 29892, 29873, 3317, 29892, 6008, 29897, 13, 29916, 353, 564, 927, 6278, 29896, 29892, 29896, 29892, 29900, 29889, 29900, 29896, 29897, 13, 13, 13975, 29918, 6008, 353, 29871, 29900, 29889, 29900, 29896, 13, 29873, 29892, 343, 353, 4036, 29918, 20919, 29898, 29900, 29889, 29941, 29945, 29930, 29906, 29899, 29896, 29892, 260, 3317, 29892, 364, 29893, 29918, 6008, 29897, 13, 13, 2929, 918, 29918, 294, 29918, 29916, 353, 24786, 29898, 12181, 7607, 3706, 29889, 2311, 29892, 921, 29889, 2311, 511, 26688, 29922, 7411, 29897, 13, 2929, 918, 29918, 294, 29918, 29926, 562, 15647, 353, 6213, 13, 3451, 381, 936, 29918, 9988, 353, 24786, 29898, 12181, 7607, 29946, 29892, 511, 26688, 29922, 7411, 29897, 13, 1454, 474, 297, 3464, 29898, 29900, 29892, 29946, 1125, 13, 1678, 302, 29873, 353, 938, 29898, 29896, 29889, 29900, 29914, 6008, 29897, 13, 1678, 7536, 353, 7536, 29918, 262, 29918, 29926, 562, 15647, 13, 1678, 364, 299, 353, 9090, 29898, 29900, 29892, 29896, 29897, 13, 1678, 565, 313, 29875, 1405, 29871, 29900, 1125, 13, 4706, 17534, 9422, 353, 29871, 29946, 29900, 13, 4706, 364, 353, 364, 299, 29889, 29878, 4270, 29898, 1983, 9422, 29897, 13, 4706, 274, 509, 353, 313, 29891, 29961, 29875, 29914, 13975, 29918, 6008, 10062, 29896, 6802, 29906, 29889, 29900, 13, 4706, 1596, 376, 1783, 29934, 29901, 376, 718, 851, 29898, 9988, 29897, 13, 4706, 2551, 353, 313, 29878, 529, 274, 509, 467, 2083, 580, 13, 4706, 1596, 376, 10495, 381, 936, 29901, 376, 718, 851, 29898, 8698, 847, 5785, 29898, 1983, 9422, 876, 13, 4706, 10757, 353, 21762, 29918, 29886, 13479, 29898, 17534, 9422, 448, 2551, 29892, 2551, 29897, 13, 4706, 7536, 353, 6213, 13, 4706, 432, 353, 21022, 403, 29918, 348, 15107, 653, 29918, 29926, 562, 15647, 29898, 2929, 918, 29918, 294, 29918, 29926, 562, 15647, 29961, 524, 29898, 29896, 29914, 6008, 6817, 29896, 2314, 13, 4706, 7536, 353, 15680, 29918, 517, 29918, 29926, 562, 15647, 29898, 5750, 5084, 334, 432, 562, 15647, 29918, 517, 29918, 22678, 29918, 1217, 29918, 262, 19365, 29898, 29926, 876, 13, 4706, 29190, 936, 29918, 9988, 29961, 29875, 29962, 353, 2551, 847, 5785, 29898, 1983, 9422, 29897, 13, 13, 1678, 1650, 29918, 294, 29918, 29926, 562, 15647, 353, 282, 311, 29918, 2929, 345, 29898, 29886, 13479, 29892, 3064, 29961, 29875, 29930, 593, 5919, 29875, 29974, 29896, 11877, 593, 2314, 13, 13, 1678, 1650, 29918, 294, 29918, 29916, 29961, 29875, 29930, 593, 5919, 29875, 29974, 29896, 11877, 593, 29962, 353, 4327, 29918, 517, 29918, 29916, 29898, 2929, 918, 29918, 294, 29918, 29926, 562, 15647, 29892, 921, 29897, 13, 13, 13, 5317, 29898, 279, 927, 29898, 29900, 29892, 29946, 511, 29190, 936, 29918, 9988, 29892, 525, 1484, 1495, 13, 5317, 29898, 29873, 29892, 313, 29891, 29974, 29896, 6802, 29906, 29889, 29900, 29892, 525, 29895, 1495, 13, 13, 326, 4294, 29898, 2929, 918, 29918, 294, 29918, 29916, 29889, 3286, 4220, 3285, 3978, 2433, 13609, 742, 15834, 11759, 29900, 29892, 29873, 3317, 29892, 29900, 29892, 29896, 2314, 13, 29916, 1643, 703, 2230, 1159, 13, 29891, 1643, 703, 1783, 29934, 1159, 13, 3257, 703, 29933, 388, 18970, 2661, 6490, 310, 315, 5659, 1159, 13, 2780, 1646, 580, 13, 13, 13, 13, 4294, 580, 13, 2 ]
src/omlt/neuralnet/__init__.py
jalving/OMLT
115
165613
<gh_stars>100-1000 r""" We use the following notation to describe layer and activation functions: .. math:: \begin{align*} N &:= \text{Set of nodes (i.e. neurons in the neural network)}\\ M_i &:= \text{Number of inputs to node $i$}\\ \hat z_i &:= \text{pre-activation value on node $i$}\\ z_i &:= \text{post-activation value on node $i$}\\ w_{ij} &:= \text{weight from input $j$ to node $i$}\\ b_i &:= \text{bias value for node $i$} \end{align*} """ from omlt.neuralnet.network_definition import NetworkDefinition from omlt.neuralnet.nn_formulation import (FullSpaceNNFormulation, ReducedSpaceNNFormulation, FullSpaceSmoothNNFormulation, ReducedSpaceSmoothNNFormulation, ReluBigMFormulation, ReluComplementarityFormulation, ReluPartitionFormulation)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29900, 29899, 29896, 29900, 29900, 29900, 13, 29878, 15945, 29908, 13, 4806, 671, 278, 1494, 12640, 304, 8453, 7546, 322, 26229, 3168, 29901, 13, 13, 636, 5844, 1057, 13, 13, 1678, 320, 463, 29912, 2520, 4044, 13, 1678, 405, 669, 9361, 320, 726, 29912, 2697, 310, 7573, 313, 29875, 29889, 29872, 29889, 26808, 787, 297, 278, 19677, 3564, 29897, 9952, 13, 1678, 341, 29918, 29875, 669, 9361, 320, 726, 29912, 4557, 310, 10970, 304, 2943, 395, 29875, 29938, 9952, 13, 1678, 320, 2455, 503, 29918, 29875, 669, 9361, 320, 726, 29912, 1457, 29899, 11236, 362, 995, 373, 2943, 395, 29875, 29938, 9952, 13, 1678, 503, 29918, 29875, 669, 9361, 320, 726, 29912, 2490, 29899, 11236, 362, 995, 373, 2943, 395, 29875, 29938, 9952, 13, 1678, 281, 648, 823, 29913, 669, 9361, 320, 726, 29912, 7915, 515, 1881, 395, 29926, 29938, 304, 2943, 395, 29875, 29938, 9952, 13, 1678, 289, 29918, 29875, 669, 9361, 320, 726, 29912, 29890, 3173, 995, 363, 2943, 395, 29875, 17133, 13, 1678, 320, 355, 29912, 2520, 4044, 13, 15945, 29908, 13, 3166, 288, 828, 29873, 29889, 484, 3631, 1212, 29889, 11618, 29918, 16553, 1053, 8527, 14683, 13, 3166, 288, 828, 29873, 29889, 484, 3631, 1212, 29889, 15755, 29918, 689, 2785, 1053, 313, 13658, 14936, 10262, 2500, 2785, 29892, 4367, 29884, 1133, 14936, 10262, 2500, 2785, 29892, 13, 462, 462, 965, 14846, 14936, 29903, 4346, 720, 10262, 2500, 2785, 29892, 4367, 29884, 1133, 14936, 29903, 4346, 720, 10262, 2500, 2785, 29892, 13, 462, 462, 965, 6376, 29884, 6970, 29924, 2500, 2785, 29892, 6376, 29884, 1523, 2037, 279, 537, 2500, 2785, 29892, 13, 462, 462, 965, 6376, 29884, 7439, 654, 2500, 2785, 29897, 2 ]
cminx/parser/aggregator.py
AutonomicPerfectionist/CMakeDoc
0
155300
import sys from antlr4 import * #FIXME Remove unused imports from enum import Enum from collections import namedtuple #Annoyingly, the Antl4 Python libraries use camelcase since it was originally Java, so we have convention inconsistencies here from .CMakeParser import CMakeParser from .CMakeListener import CMakeListener """ This module interfaces with the generated CMake parser. It also subclasses CMakeListener to aggregate and further process documented commands on-the-fly. Processed documentation is stored in two different types of named tuples depending on the type being documented. VariableDocumentation also stores what type the variable is, either String or List for most purposes but also supports Unset in case someone wants to document why something is unset. :Author: <NAME> :License: Apache 2.0 """ FunctionDocumentation = namedtuple('FunctionDocumentation', 'function params doc') MacroDocumentation = namedtuple("MacroDocumentation", "macro params doc") VariableDocumentation = namedtuple('VariableDocumentation', 'varname type value doc') TestDocumentation = namedtuple('TestDocumentation', 'name expect_fail doc') SectionDocumentation = namedtuple('SectionDocumentation', 'name expect_fail doc') DOC_TYPES = (FunctionDocumentation, MacroDocumentation, VariableDocumentation, TestDocumentation, SectionDocumentation) VarType = Enum("VarType", "String List Unset") class DocumentationAggregator(CMakeListener): """ Processes all docstrings and their associated commands, aggregating them in a list. """ def __init__(self): self.documented = [] """All current documented commands""" def process_function(self, ctx:CMakeParser.Documented_commandContext, docstring: str): """ Extracts function name and declared parameters. :param ctx: Documented command context. Constructed by the Antlr4 parser. :param docstring: Cleaned docstring. """ params = [param.Identifier().getText() for param in ctx.command_invocation().single_argument()[1:]] #Extract declared function parameters self.documented.append(FunctionDocumentation(ctx.command_invocation().single_argument()[0].Identifier().getText(), params, docstring)) #Extracts function name and adds the completed function documentation to the 'documented' list def process_macro(self, ctx:CMakeParser.Documented_commandContext, docstring: str): """ Extracts macro name and declared parameters. :param ctx: Documented command context. Constructed by the Antlr4 parser. :param docstring: Cleaned docstring. """ params = [param.Identifier().getText() for param in ctx.command_invocation().single_argument()[1:]] #Extract declared macro parameters self.documented.append(MacroDocumentation(ctx.command_invocation().single_argument()[0].Identifier().getText(), params, docstring)) #Extracts macro name and adds the completed macro documentation to the 'documented' list def process_ct_add_test(self, ctx:CMakeParser.Documented_commandContext, docstring: str): """ Extracts test name and declared parameters. :param ctx: Documented command context. Constructed by the Antlr4 parser. :param docstring: Cleaned docstring. """ params = [param.Identifier().getText() for param in ctx.command_invocation().single_argument()] #Extract parameters name = "" expect_fail = False for i in range(0, len(params)): param = params[i] if param.upper() == "NAME": try: name = params[i + 1] except IndexError: pretty_text = '\n'.join(ctx.Bracket_doccomment().getText().split('\n')) pretty_text += f"\n{ctx.command_invocation().getText()}" print(f"ct_add_test() called with incorrect parameters: {params}\n\n{pretty_text}", file=sys.stderr) return if param.upper() == "EXPECTFAIL": expect_fail = True self.documented.append(TestDocumentation(name, expect_fail, docstring)) def process_ct_add_section(self, ctx:CMakeParser.Documented_commandContext, docstring: str): """ Extracts section name and declared parameters. :param ctx: Documented command context. Constructed by the Antlr4 parser. :param docstring: Cleaned docstring. """ params = [param.Identifier().getText() for param in ctx.command_invocation().single_argument()] #Extract parameters name = "" expect_fail = False for i in range(0, len(params)): param = params[i] if param.upper() == "NAME": try: name = params[i + 1] except IndexError: pretty_text = '\n'.join(ctx.Bracket_doccomment().getText().split('\n')) pretty_text += f"\n{ctx.command_invocation().getText()}" print(f"ct_add_section() called with incorrect parameters: {params}\n\n{pretty_text}", file=sys.stderr) return if param.upper() == "EXPECTFAIL": expect_fail = True self.documented.append(SectionDocumentation(name, expect_fail, docstring)) def process_set(self, ctx:CMakeParser.Documented_commandContext, docstring: str): """ Extracts variable name and values from the documented set command. Also determines the type of set command/variable: String, List, or Unset. :param ctx: Documented command context. Constructed by the Antlr4 parser. :param docstring: Cleaned docstring. """ varname = ctx.command_invocation().single_argument()[0].Identifier().getText() arg_len = len(ctx.command_invocation().single_argument()) - 1 #First argument is name of variable so ignore that if arg_len > 1: #List values = [val.getText() for val in ctx.command_invocation().single_argument()[1:]] self.documented.append(VariableDocumentation(varname, VarType.List, values, docstring)) elif arg_len == 1: #String value = ctx.command_invocation().single_argument()[1].getText() #Includes the quote marks, need to remove them to get just the raw string if value[0] == '"': value = value[1:] if value[-1] == '"': value = value[:-1] self.documented.append(VariableDocumentation(varname, VarType.String, value, docstring)) else: #Unset self.documented.append(VariableDocumentation(varname, VarType.Unset, None, docstring)) def enterDocumented_command(self, ctx:CMakeParser.Documented_commandContext): """ Main entrypoint into the documentation processor and aggregator. Called by ParseTreeWalker whenever encountering a documented command. Cleans the docstring and dispatches ctx to other functions for additional processing (process_{command}(), i.e. process_function()) :param ctx: Documented command context, constructed by the Antlr4 parser. :raise NotImplementedError: If no processor can be found for the command that was documented. """ text = ctx.Bracket_doccomment().getText() lines = text.split("\n") # If last line starts with leading spaces or tabs, count how many and remove from all lines num_spaces = 0 for i in range(0, len(lines[-1])): if lines[-1][i] != "#": num_spaces = num_spaces + 1 else: break cleaned_lines = [] for line in lines: cleaned_line = line[num_spaces:] #Remove global indent from left side cleaned_line = cleaned_line.lstrip("#[]") #Remove all hash marks and brackets from the left side only if cleaned_line and cleaned_line[0] == " ": #String is not empty and first character is a space cleaned_line = cleaned_line[1:] #Cleans optional singular space cleaned_lines.append(cleaned_line) cleaned_lines[-1] = cleaned_lines[-1].rstrip("#]") cleaned_doc = "\n".join(cleaned_lines) command = ctx.command_invocation().Identifier().getText().lower() if f"process_{command}" in dir(self): getattr(self, f"process_{command}")(ctx, cleaned_doc) else: pretty_text = '\n'.join(ctx.Bracket_doccomment().getText().split('\n')) pretty_text += f"\n{ctx.command_invocation().getText()}" raise NotImplementedError(f"Documentation cannot be generated for:\n{pretty_text}")
[ 1, 1053, 10876, 13, 13, 3166, 3677, 29212, 29946, 1053, 334, 396, 25634, 2303, 15154, 443, 3880, 24802, 13, 3166, 14115, 1053, 1174, 398, 13, 3166, 16250, 1053, 4257, 23583, 13, 13, 29937, 2744, 1217, 5414, 368, 29892, 278, 5459, 29880, 29946, 5132, 9562, 671, 3949, 295, 4878, 1951, 372, 471, 10437, 3355, 29892, 577, 591, 505, 15687, 22435, 8244, 2478, 1244, 13, 3166, 869, 29907, 9984, 11726, 1053, 315, 9984, 11726, 13, 3166, 869, 29907, 9984, 3962, 1053, 315, 9984, 3962, 13, 13, 13, 13, 15945, 29908, 13, 4013, 3883, 19510, 411, 278, 5759, 315, 9984, 13812, 29889, 13, 3112, 884, 1014, 13203, 315, 9984, 3962, 304, 20431, 322, 4340, 13, 5014, 23531, 8260, 373, 29899, 1552, 29899, 17652, 29889, 13, 13, 7032, 287, 5106, 338, 6087, 297, 1023, 1422, 4072, 310, 4257, 5291, 2701, 13, 2716, 2548, 373, 278, 1134, 1641, 23531, 29889, 28736, 6268, 362, 884, 14422, 13, 5816, 1134, 278, 2286, 338, 29892, 2845, 1714, 470, 2391, 363, 1556, 11976, 541, 884, 13, 5924, 29879, 853, 842, 297, 1206, 4856, 10753, 304, 1842, 2020, 1554, 338, 443, 842, 29889, 13, 13, 29901, 13720, 29901, 529, 5813, 29958, 13, 29901, 29931, 293, 1947, 29901, 13380, 29871, 29906, 29889, 29900, 13, 15945, 29908, 13, 13, 13, 13, 6678, 6268, 362, 353, 4257, 23583, 877, 6678, 6268, 362, 742, 525, 2220, 8636, 1574, 1495, 13, 15735, 307, 6268, 362, 353, 4257, 23583, 703, 15735, 307, 6268, 362, 613, 376, 25254, 8636, 1574, 1159, 13, 16174, 6268, 362, 353, 4257, 23583, 877, 16174, 6268, 362, 742, 525, 1707, 978, 1134, 995, 1574, 1495, 13, 3057, 6268, 362, 353, 4257, 23583, 877, 3057, 6268, 362, 742, 525, 978, 2149, 29918, 14057, 1574, 1495, 13, 13438, 6268, 362, 353, 4257, 23583, 877, 13438, 6268, 362, 742, 525, 978, 2149, 29918, 14057, 1574, 1495, 13, 13, 28665, 29918, 15631, 29925, 2890, 353, 313, 6678, 6268, 362, 29892, 4326, 307, 6268, 362, 29892, 28736, 6268, 362, 29892, 4321, 6268, 362, 29892, 9779, 6268, 362, 29897, 13, 13, 9037, 1542, 353, 1174, 398, 703, 9037, 1542, 613, 376, 1231, 2391, 853, 842, 1159, 13, 13, 1990, 10854, 362, 29909, 26127, 1061, 29898, 29907, 9984, 3962, 1125, 13, 1678, 9995, 13, 1678, 10554, 267, 599, 1574, 19651, 322, 1009, 6942, 8260, 29892, 11404, 1218, 963, 297, 263, 1051, 29889, 13, 1678, 9995, 13, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 308, 1583, 29889, 3225, 287, 353, 5159, 13, 308, 9995, 3596, 1857, 23531, 8260, 15945, 29908, 13, 13, 1678, 822, 1889, 29918, 2220, 29898, 1311, 29892, 12893, 29901, 29907, 9984, 11726, 29889, 6268, 287, 29918, 6519, 2677, 29892, 1574, 1807, 29901, 851, 1125, 13, 308, 9995, 13, 308, 7338, 1461, 29879, 740, 1024, 322, 8052, 4128, 29889, 13, 13, 308, 584, 3207, 12893, 29901, 10854, 287, 1899, 3030, 29889, 1281, 4984, 287, 491, 278, 5459, 29212, 29946, 13812, 29889, 13, 13, 308, 584, 3207, 1574, 1807, 29901, 315, 14044, 287, 1574, 1807, 29889, 13, 308, 9995, 13, 308, 8636, 353, 518, 3207, 29889, 12889, 2141, 18516, 580, 363, 1828, 297, 12893, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29961, 29896, 29901, 5262, 396, 5647, 1461, 8052, 740, 4128, 13, 308, 1583, 29889, 3225, 287, 29889, 4397, 29898, 6678, 6268, 362, 29898, 13073, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29961, 29900, 1822, 12889, 2141, 18516, 3285, 8636, 29892, 1574, 1807, 876, 396, 5647, 1461, 29879, 740, 1024, 322, 12778, 278, 8676, 740, 5106, 304, 278, 525, 3225, 287, 29915, 1051, 13, 13, 1678, 822, 1889, 29918, 25254, 29898, 1311, 29892, 12893, 29901, 29907, 9984, 11726, 29889, 6268, 287, 29918, 6519, 2677, 29892, 1574, 1807, 29901, 851, 1125, 13, 308, 9995, 13, 308, 7338, 1461, 29879, 11758, 1024, 322, 8052, 4128, 29889, 13, 13, 308, 584, 3207, 12893, 29901, 10854, 287, 1899, 3030, 29889, 1281, 4984, 287, 491, 278, 5459, 29212, 29946, 13812, 29889, 13, 13, 308, 584, 3207, 1574, 1807, 29901, 315, 14044, 287, 1574, 1807, 29889, 13, 308, 9995, 13, 308, 8636, 353, 518, 3207, 29889, 12889, 2141, 18516, 580, 363, 1828, 297, 12893, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29961, 29896, 29901, 5262, 396, 5647, 1461, 8052, 11758, 4128, 13, 308, 1583, 29889, 3225, 287, 29889, 4397, 29898, 15735, 307, 6268, 362, 29898, 13073, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29961, 29900, 1822, 12889, 2141, 18516, 3285, 8636, 29892, 1574, 1807, 876, 396, 5647, 1461, 29879, 11758, 1024, 322, 12778, 278, 8676, 11758, 5106, 304, 278, 525, 3225, 287, 29915, 1051, 13, 13, 1678, 822, 1889, 29918, 312, 29918, 1202, 29918, 1688, 29898, 1311, 29892, 12893, 29901, 29907, 9984, 11726, 29889, 6268, 287, 29918, 6519, 2677, 29892, 1574, 1807, 29901, 851, 1125, 13, 308, 9995, 13, 308, 7338, 1461, 29879, 1243, 1024, 322, 8052, 4128, 29889, 13, 13, 308, 584, 3207, 12893, 29901, 10854, 287, 1899, 3030, 29889, 1281, 4984, 287, 491, 278, 5459, 29212, 29946, 13812, 29889, 13, 13, 308, 584, 3207, 1574, 1807, 29901, 315, 14044, 287, 1574, 1807, 29889, 13, 308, 9995, 13, 308, 8636, 353, 518, 3207, 29889, 12889, 2141, 18516, 580, 363, 1828, 297, 12893, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29962, 396, 5647, 1461, 4128, 13, 308, 1024, 353, 5124, 13, 308, 2149, 29918, 14057, 353, 7700, 13, 308, 363, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 7529, 22164, 13, 795, 1828, 353, 8636, 29961, 29875, 29962, 13, 795, 565, 1828, 29889, 21064, 580, 1275, 376, 5813, 1115, 13, 462, 259, 1018, 29901, 13, 462, 4706, 1024, 353, 8636, 29961, 29875, 718, 29871, 29896, 29962, 13, 462, 259, 5174, 11374, 2392, 29901, 13, 462, 4706, 5051, 29918, 726, 353, 11297, 29876, 4286, 7122, 29898, 13073, 29889, 28183, 3522, 29918, 1514, 9342, 2141, 18516, 2141, 5451, 28909, 29876, 8785, 13, 462, 4706, 5051, 29918, 726, 4619, 285, 26732, 29876, 29912, 13073, 29889, 6519, 29918, 11569, 10610, 2141, 18516, 580, 5038, 13, 13, 462, 4706, 1596, 29898, 29888, 29908, 312, 29918, 1202, 29918, 1688, 580, 2000, 411, 10240, 4128, 29901, 426, 7529, 1012, 29876, 29905, 29876, 29912, 1457, 4349, 29918, 726, 17671, 934, 29922, 9675, 29889, 303, 20405, 29897, 13, 462, 4706, 736, 13, 13, 795, 565, 1828, 29889, 21064, 580, 1275, 376, 5746, 4162, 1783, 4519, 6227, 1115, 13, 462, 259, 2149, 29918, 14057, 353, 5852, 13, 13, 308, 1583, 29889, 3225, 287, 29889, 4397, 29898, 3057, 6268, 362, 29898, 978, 29892, 2149, 29918, 14057, 29892, 1574, 1807, 876, 13, 13, 1678, 822, 1889, 29918, 312, 29918, 1202, 29918, 2042, 29898, 1311, 29892, 12893, 29901, 29907, 9984, 11726, 29889, 6268, 287, 29918, 6519, 2677, 29892, 1574, 1807, 29901, 851, 1125, 13, 308, 9995, 13, 308, 7338, 1461, 29879, 4004, 1024, 322, 8052, 4128, 29889, 13, 13, 308, 584, 3207, 12893, 29901, 10854, 287, 1899, 3030, 29889, 1281, 4984, 287, 491, 278, 5459, 29212, 29946, 13812, 29889, 13, 13, 308, 584, 3207, 1574, 1807, 29901, 315, 14044, 287, 1574, 1807, 29889, 13, 308, 9995, 13, 308, 8636, 353, 518, 3207, 29889, 12889, 2141, 18516, 580, 363, 1828, 297, 12893, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29962, 396, 5647, 1461, 4128, 13, 308, 1024, 353, 5124, 13, 308, 2149, 29918, 14057, 353, 7700, 13, 308, 363, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 7529, 22164, 13, 795, 1828, 353, 8636, 29961, 29875, 29962, 13, 795, 565, 1828, 29889, 21064, 580, 1275, 376, 5813, 1115, 13, 462, 259, 1018, 29901, 13, 462, 4706, 1024, 353, 8636, 29961, 29875, 718, 29871, 29896, 29962, 13, 462, 259, 5174, 11374, 2392, 29901, 13, 462, 4706, 5051, 29918, 726, 353, 11297, 29876, 4286, 7122, 29898, 13073, 29889, 28183, 3522, 29918, 1514, 9342, 2141, 18516, 2141, 5451, 28909, 29876, 8785, 13, 462, 4706, 5051, 29918, 726, 4619, 285, 26732, 29876, 29912, 13073, 29889, 6519, 29918, 11569, 10610, 2141, 18516, 580, 5038, 13, 13, 462, 4706, 1596, 29898, 29888, 29908, 312, 29918, 1202, 29918, 2042, 580, 2000, 411, 10240, 4128, 29901, 426, 7529, 1012, 29876, 29905, 29876, 29912, 1457, 4349, 29918, 726, 17671, 934, 29922, 9675, 29889, 303, 20405, 29897, 13, 462, 4706, 736, 13, 13, 795, 565, 1828, 29889, 21064, 580, 1275, 376, 5746, 4162, 1783, 4519, 6227, 1115, 13, 462, 259, 2149, 29918, 14057, 353, 5852, 13, 13, 308, 1583, 29889, 3225, 287, 29889, 4397, 29898, 13438, 6268, 362, 29898, 978, 29892, 2149, 29918, 14057, 29892, 1574, 1807, 876, 13, 13, 13, 1678, 822, 1889, 29918, 842, 29898, 1311, 29892, 12893, 29901, 29907, 9984, 11726, 29889, 6268, 287, 29918, 6519, 2677, 29892, 1574, 1807, 29901, 851, 1125, 13, 4706, 9995, 13, 4706, 7338, 1461, 29879, 2286, 1024, 322, 1819, 515, 278, 23531, 731, 1899, 29889, 13, 4706, 3115, 3683, 1475, 278, 1134, 310, 731, 1899, 29914, 11918, 29901, 1714, 29892, 2391, 29892, 470, 853, 842, 29889, 13, 13, 4706, 584, 3207, 12893, 29901, 10854, 287, 1899, 3030, 29889, 1281, 4984, 287, 491, 278, 5459, 29212, 29946, 13812, 29889, 13, 13, 4706, 584, 3207, 1574, 1807, 29901, 315, 14044, 287, 1574, 1807, 29889, 13, 4706, 9995, 13, 4706, 722, 978, 353, 12893, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29961, 29900, 1822, 12889, 2141, 18516, 580, 13, 4706, 1852, 29918, 2435, 353, 7431, 29898, 13073, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 3101, 448, 29871, 29896, 396, 6730, 2980, 338, 1024, 310, 2286, 577, 11455, 393, 13, 13, 4706, 565, 1852, 29918, 2435, 1405, 29871, 29896, 29901, 396, 1293, 13, 632, 1819, 353, 518, 791, 29889, 18516, 580, 363, 659, 297, 12893, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29961, 29896, 29901, 5262, 13, 632, 1583, 29889, 3225, 287, 29889, 4397, 29898, 16174, 6268, 362, 29898, 1707, 978, 29892, 11681, 1542, 29889, 1293, 29892, 1819, 29892, 1574, 1807, 876, 13, 4706, 25342, 1852, 29918, 2435, 1275, 29871, 29896, 29901, 396, 1231, 13, 632, 995, 353, 12893, 29889, 6519, 29918, 11569, 10610, 2141, 14369, 29918, 23516, 580, 29961, 29896, 1822, 18516, 580, 13, 13, 632, 396, 797, 27722, 278, 14978, 17997, 29892, 817, 304, 3349, 963, 304, 679, 925, 278, 10650, 1347, 13, 632, 565, 995, 29961, 29900, 29962, 1275, 18793, 2396, 13, 462, 995, 353, 995, 29961, 29896, 17531, 13, 632, 565, 995, 14352, 29896, 29962, 1275, 18793, 2396, 13, 462, 995, 353, 995, 7503, 29899, 29896, 29962, 13, 632, 1583, 29889, 3225, 287, 29889, 4397, 29898, 16174, 6268, 362, 29898, 1707, 978, 29892, 11681, 1542, 29889, 1231, 29892, 995, 29892, 1574, 1807, 876, 13, 4706, 1683, 29901, 396, 2525, 842, 13, 632, 1583, 29889, 3225, 287, 29889, 4397, 29898, 16174, 6268, 362, 29898, 1707, 978, 29892, 11681, 1542, 29889, 2525, 842, 29892, 6213, 29892, 1574, 1807, 876, 13, 13, 1678, 822, 3896, 6268, 287, 29918, 6519, 29898, 1311, 29892, 12893, 29901, 29907, 9984, 11726, 29889, 6268, 287, 29918, 6519, 2677, 1125, 13, 308, 9995, 13, 308, 4241, 6251, 3149, 964, 278, 5106, 21433, 322, 11404, 1061, 29889, 3037, 839, 491, 20969, 9643, 29956, 2235, 261, 10940, 11735, 292, 263, 23531, 1899, 29889, 13, 308, 21386, 550, 278, 1574, 1807, 322, 13916, 267, 12893, 304, 916, 3168, 363, 5684, 9068, 313, 5014, 648, 6519, 2119, 511, 474, 29889, 29872, 29889, 1889, 29918, 2220, 3101, 13, 13, 308, 584, 3207, 12893, 29901, 10854, 287, 1899, 3030, 29892, 13319, 491, 278, 5459, 29212, 29946, 13812, 29889, 13, 13, 308, 584, 22692, 2216, 1888, 2037, 287, 2392, 29901, 960, 694, 21433, 508, 367, 1476, 363, 278, 1899, 393, 471, 23531, 29889, 13, 308, 9995, 13, 308, 1426, 353, 12893, 29889, 28183, 3522, 29918, 1514, 9342, 2141, 18516, 580, 13, 308, 3454, 353, 1426, 29889, 5451, 14182, 29876, 1159, 13, 13, 308, 396, 960, 1833, 1196, 8665, 411, 8236, 8162, 470, 18859, 29892, 2302, 920, 1784, 322, 3349, 515, 599, 3454, 13, 308, 954, 29918, 22854, 353, 29871, 29900, 13, 308, 363, 474, 297, 3464, 29898, 29900, 29892, 7431, 29898, 9012, 14352, 29896, 12622, 29901, 13, 795, 565, 3454, 14352, 29896, 3816, 29875, 29962, 2804, 12305, 1115, 13, 462, 259, 954, 29918, 22854, 353, 954, 29918, 22854, 718, 29871, 29896, 13, 795, 1683, 29901, 13, 462, 259, 2867, 13, 13, 308, 5941, 287, 29918, 9012, 353, 5159, 13, 308, 363, 1196, 297, 3454, 29901, 13, 795, 5941, 287, 29918, 1220, 353, 1196, 29961, 1949, 29918, 22854, 17531, 396, 15941, 5534, 29536, 515, 2175, 2625, 13, 795, 5941, 287, 29918, 1220, 353, 5941, 287, 29918, 1220, 29889, 29880, 17010, 14822, 2636, 1159, 396, 15941, 599, 6608, 17997, 322, 20476, 515, 278, 2175, 2625, 871, 13, 795, 565, 5941, 287, 29918, 1220, 322, 5941, 287, 29918, 1220, 29961, 29900, 29962, 1275, 376, 29242, 396, 1231, 338, 451, 4069, 322, 937, 2931, 338, 263, 2913, 13, 462, 259, 5941, 287, 29918, 1220, 353, 5941, 287, 29918, 1220, 29961, 29896, 17531, 396, 29907, 25210, 13136, 13512, 2913, 13, 795, 5941, 287, 29918, 9012, 29889, 4397, 29898, 14941, 287, 29918, 1220, 29897, 13, 308, 5941, 287, 29918, 9012, 14352, 29896, 29962, 353, 5941, 287, 29918, 9012, 14352, 29896, 1822, 29878, 17010, 14822, 29962, 1159, 13, 308, 5941, 287, 29918, 1514, 353, 6634, 29876, 1642, 7122, 29898, 14941, 287, 29918, 9012, 29897, 13, 308, 1899, 353, 12893, 29889, 6519, 29918, 11569, 10610, 2141, 12889, 2141, 18516, 2141, 13609, 580, 13, 308, 565, 285, 29908, 5014, 648, 6519, 5038, 297, 4516, 29898, 1311, 1125, 13, 795, 679, 5552, 29898, 1311, 29892, 285, 29908, 5014, 648, 6519, 27195, 29898, 13073, 29892, 5941, 287, 29918, 1514, 29897, 13, 308, 1683, 29901, 13, 795, 5051, 29918, 726, 353, 11297, 29876, 4286, 7122, 29898, 13073, 29889, 28183, 3522, 29918, 1514, 9342, 2141, 18516, 2141, 5451, 28909, 29876, 8785, 13, 795, 5051, 29918, 726, 4619, 285, 26732, 29876, 29912, 13073, 29889, 6519, 29918, 11569, 10610, 2141, 18516, 580, 5038, 13, 795, 12020, 2216, 1888, 2037, 287, 2392, 29898, 29888, 29908, 6268, 362, 2609, 367, 5759, 363, 3583, 29876, 29912, 1457, 4349, 29918, 726, 27195, 13, 13, 2 ]
jsConsole/__init__.py
Animenosekai/jsConsole
0
18483
""" pyJsConsole wrapper. © <NAME> - 2020 """ from .internal.javascript import classes as JSClass console = JSClass._Console() document = JSClass._Document() history = JSClass._History() Math = JSClass._Math() navigator = JSClass._Navigator() screen = JSClass._Screen() window = JSClass._Window() browser = JSClass.BrowserObject ''' import threading from lifeeasy import sleep def reloadElements(): global document global window lastURL = 'data:,' while True: sleep(0.1) try: if JSClass.evaluate('window.location.href') != lastURL: document = JSClass._Document() window = JSClass._Window() lastURL = JSClass.evaluate('window.location.href') except: break thread = threading.Thread(target=reloadElements) thread.daemon = True thread.start() ''' def newDocument(): return JSClass._Document() def newWindow(): return JSClass._Window() def newHistory(): return JSClass._History() def fresh(): return (JSClass._Document(), JSClass._Window(), JSClass._History()) def clearInterval(intervalID): JSClass.clearInterval(intervalID) def clearTimeout(timeoutID): JSClass.clearTimeout(timeoutID) def evaluate(code_to_execute, return_value=False): return JSClass.evaluate(code_to_execute, return_value=return_value) def setInterval(function, milliseconds): return JSClass.setInterval(function, milliseconds) def setTimeout(function, milliseconds): return JSClass.setTimeout(function, milliseconds)
[ 1, 9995, 13, 2272, 25498, 20008, 14476, 29889, 13, 13, 30211, 529, 5813, 29958, 448, 29871, 29906, 29900, 29906, 29900, 13, 15945, 29908, 13, 13, 3166, 869, 7564, 29889, 7729, 1053, 4413, 408, 7649, 2385, 13, 13, 11058, 353, 7649, 2385, 3032, 20008, 580, 13, 3225, 353, 7649, 2385, 3032, 6268, 580, 13, 18434, 353, 7649, 2385, 3032, 20570, 580, 13, 11309, 353, 7649, 2385, 3032, 11309, 580, 13, 29876, 25521, 353, 7649, 2385, 3032, 29940, 25521, 580, 13, 10525, 353, 7649, 2385, 3032, 11357, 580, 13, 7165, 353, 7649, 2385, 3032, 5907, 580, 13, 15965, 353, 7649, 2385, 29889, 21537, 2061, 13, 13, 12008, 13, 5215, 3244, 292, 13, 3166, 2834, 29872, 8995, 1053, 8709, 13, 13, 1753, 19763, 18868, 7295, 13, 1678, 5534, 1842, 13, 1678, 5534, 3474, 13, 1678, 1833, 4219, 353, 525, 1272, 29901, 5501, 13, 1678, 1550, 5852, 29901, 13, 4706, 8709, 29898, 29900, 29889, 29896, 29897, 13, 4706, 1018, 29901, 13, 9651, 565, 7649, 2385, 29889, 24219, 403, 877, 7165, 29889, 5479, 29889, 12653, 1495, 2804, 1833, 4219, 29901, 13, 18884, 1842, 353, 7649, 2385, 3032, 6268, 580, 13, 18884, 3474, 353, 7649, 2385, 3032, 5907, 580, 13, 18884, 1833, 4219, 353, 7649, 2385, 29889, 24219, 403, 877, 7165, 29889, 5479, 29889, 12653, 1495, 13, 4706, 5174, 29901, 13, 9651, 2867, 13, 13, 7097, 353, 3244, 292, 29889, 4899, 29898, 5182, 29922, 28120, 18868, 29897, 13, 7097, 29889, 1388, 9857, 353, 5852, 13, 7097, 29889, 2962, 580, 13, 12008, 13, 13, 1753, 716, 6268, 7295, 13, 1678, 736, 7649, 2385, 3032, 6268, 580, 13, 13, 1753, 716, 5907, 7295, 13, 1678, 736, 7649, 2385, 3032, 5907, 580, 13, 13, 1753, 716, 20570, 7295, 13, 1678, 736, 7649, 2385, 3032, 20570, 580, 13, 13, 1753, 10849, 7295, 13, 1678, 736, 313, 8700, 2385, 3032, 6268, 3285, 7649, 2385, 3032, 5907, 3285, 7649, 2385, 3032, 20570, 3101, 13, 13, 1753, 2821, 12506, 29898, 19207, 1367, 1125, 13, 1678, 7649, 2385, 29889, 8551, 12506, 29898, 19207, 1367, 29897, 13, 13, 1753, 2821, 10851, 29898, 15619, 1367, 1125, 13, 1678, 7649, 2385, 29889, 8551, 10851, 29898, 15619, 1367, 29897, 13, 13, 1753, 14707, 29898, 401, 29918, 517, 29918, 7978, 29892, 736, 29918, 1767, 29922, 8824, 1125, 13, 1678, 736, 7649, 2385, 29889, 24219, 403, 29898, 401, 29918, 517, 29918, 7978, 29892, 736, 29918, 1767, 29922, 2457, 29918, 1767, 29897, 13, 13, 1753, 731, 12506, 29898, 2220, 29892, 3533, 21462, 1125, 13, 1678, 736, 7649, 2385, 29889, 842, 12506, 29898, 2220, 29892, 3533, 21462, 29897, 13, 13, 1753, 23597, 29898, 2220, 29892, 3533, 21462, 1125, 13, 1678, 736, 7649, 2385, 29889, 842, 10851, 29898, 2220, 29892, 3533, 21462, 29897, 13, 2 ]
tools/generator/__init__.py
Dev00355/fundamental-tools-copy-from-sap
0
37490
# SPDX-FileCopyrightText: 2014 SAP SE <NAME> <<EMAIL>> # # SPDX-License-Identifier: Apache-2.0 # -*- coding: utf-8 -*- from .business_objects import catalog, rfm_sets VERSION = "0.2" # T002, T002C all_languages = { # iso2 "ar": "AR - عربي", "bg": "BG - Български", "ca": "CA - Català", "cs": "CS - Čeština", "da": "DA - Dansk", "de": "DE - Deutsch", "el": "EL - Ελληνικά", "en": "EN - English", "es": "ES - Español", "et": "ET - Eesti", "fi": "FI - Suomi", "fr": "FR - Français", "he": "HE - עברית", "hi": "HI - हिंदी", "hr": "HR - Hrvatski", "hu": "HU - Magyar", "it": "IT - Italiano", "ja": "JA - 日本語", "kk": "KK - Қазақ", "ko": "KO - 한국어", "lt": "LT - Lietuvių", "lv": "LV - Latviešu", "nl": "NL - Nederlands", "no": "NO - Norsk", "pl": "PL - polski", "pt": "PT - Português", "ro": "RO - Română", "ru": "RU - Русский", "sh": "SH - Srpski (Lat.)", "sk": "SK - Slovenčina", "sl": "SL - Slovenščina", "sv": "SV - Svenska", "th": "TH - Thai", "tr": "TR - Türkçe", "uk": "UK - Українська", "vi": "VI - Việt Nam", "zf": "ZF - 繁體中文", "zh": "ZH - 中文", }
[ 1, 396, 10937, 29928, 29990, 29899, 2283, 11882, 1266, 1626, 29901, 29871, 29906, 29900, 29896, 29946, 317, 3301, 3725, 529, 5813, 29958, 3532, 26862, 6227, 6778, 13, 29937, 13, 29937, 10937, 29928, 29990, 29899, 29931, 293, 1947, 29899, 12889, 29901, 13380, 29899, 29906, 29889, 29900, 13, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 869, 8262, 3335, 29918, 12650, 1053, 16653, 29892, 364, 24826, 29918, 7224, 13, 13, 16358, 353, 376, 29900, 29889, 29906, 29908, 13, 13, 29937, 323, 29900, 29900, 29906, 29892, 323, 29900, 29900, 29906, 29907, 13, 497, 29918, 29880, 8737, 353, 426, 13, 1678, 396, 338, 29877, 29906, 13, 1678, 376, 279, 1115, 376, 1718, 448, 29871, 30218, 30156, 30177, 30163, 613, 13, 1678, 376, 16264, 1115, 376, 29933, 29954, 448, 1386, 29713, 1305, 613, 13, 1678, 376, 1113, 1115, 376, 5454, 448, 11732, 30001, 613, 13, 1678, 376, 2395, 1115, 376, 9295, 448, 7696, 29872, 8925, 1099, 613, 13, 1678, 376, 1388, 1115, 376, 7698, 448, 9353, 29895, 613, 13, 1678, 376, 311, 1115, 376, 2287, 448, 4493, 613, 13, 1678, 376, 295, 1115, 376, 6670, 448, 29871, 30311, 30142, 30142, 30183, 30133, 30136, 30173, 30216, 613, 13, 1678, 376, 264, 1115, 376, 1430, 448, 4223, 613, 13, 1678, 376, 267, 1115, 376, 2890, 448, 29046, 324, 613, 13, 1678, 376, 300, 1115, 376, 2544, 448, 382, 11521, 613, 13, 1678, 376, 7241, 1115, 376, 3738, 448, 2166, 21019, 613, 13, 1678, 376, 1341, 1115, 376, 15860, 448, 1352, 6899, 613, 13, 1678, 376, 354, 1115, 376, 9606, 448, 29871, 30324, 30276, 30236, 30196, 30286, 613, 13, 1678, 376, 2918, 1115, 376, 17628, 448, 29871, 30714, 30436, 30757, 30694, 30580, 613, 13, 1678, 376, 1092, 1115, 376, 20938, 448, 26399, 9046, 2574, 613, 13, 1678, 376, 6905, 1115, 376, 29950, 29965, 448, 15910, 613, 13, 1678, 376, 277, 1115, 376, 1806, 448, 4041, 3328, 613, 13, 1678, 376, 1764, 1115, 376, 29967, 29909, 448, 29871, 30325, 30346, 30968, 613, 13, 1678, 376, 6859, 1115, 376, 29968, 29968, 448, 29871, 30925, 29910, 1902, 30609, 613, 13, 1678, 376, 2901, 1115, 376, 29968, 29949, 448, 29871, 30877, 31293, 31129, 613, 13, 1678, 376, 1896, 1115, 376, 5850, 448, 365, 2035, 29884, 1403, 30440, 613, 13, 1678, 376, 28463, 1115, 376, 29931, 29963, 448, 7053, 25965, 30039, 29884, 613, 13, 1678, 376, 12938, 1115, 376, 25103, 448, 10584, 5252, 613, 13, 1678, 376, 1217, 1115, 376, 6632, 448, 4186, 808, 613, 13, 1678, 376, 572, 1115, 376, 7390, 448, 26685, 613, 13, 1678, 376, 415, 1115, 376, 7982, 448, 8451, 29884, 8769, 613, 13, 1678, 376, 307, 1115, 376, 1672, 448, 6033, 29218, 613, 13, 1678, 376, 582, 1115, 376, 28283, 448, 29006, 2542, 613, 13, 1678, 376, 845, 1115, 376, 7068, 448, 26250, 567, 1984, 313, 13992, 1846, 613, 13, 1678, 376, 808, 1115, 376, 16033, 448, 24917, 30026, 1099, 613, 13, 1678, 376, 2536, 1115, 376, 12750, 448, 24917, 24832, 1099, 613, 13, 1678, 376, 4501, 1115, 376, 7597, 448, 25742, 1335, 613, 13, 1678, 376, 386, 1115, 376, 4690, 448, 498, 1794, 613, 13, 1678, 376, 509, 1115, 376, 5659, 448, 25424, 29895, 30019, 29872, 613, 13, 1678, 376, 2679, 1115, 376, 19960, 448, 8138, 29921, 7909, 613, 13, 1678, 376, 1403, 1115, 376, 18118, 448, 10630, 30529, 29873, 13041, 613, 13, 1678, 376, 29920, 29888, 1115, 376, 29999, 29943, 448, 29871, 234, 188, 132, 236, 174, 151, 30275, 30333, 613, 13, 1678, 376, 17599, 1115, 376, 29999, 29950, 448, 29871, 30275, 30333, 613, 13, 29913, 13, 2 ]
flask_ncov.py
ausk/ncov2020
2
149968
<reponame>ausk/ncov2020<gh_stars>1-10 # 2020/02/15 by ausk # 从百度疫情获取数据,并使用 flask 搭建后台。 """ # 使用 Flask + ECharts 实现疫情展示。 1)从疫情网站抓取疫情数据,保存为离线数据; 2) 启动 flask 后台,可实时更新数据祸加载离线数据,然后以 json 格式返回查询数据;同时返回渲染的网页。 3) 编写 html 页面,前台(浏览器)通过 ajax 请求指定路由异步加载数据,绘制疫情地图和疫情趋势图。 """ from flask import Flask, render_template, jsonify from baidu_ncov import update, query app = Flask(__name__) app.config['JSON_AS_ASCII'] = False ## 注册 flask 路由 @app.route('/<fname>.html') def hello(fname): return render_template(fname+".html") ## 主页 @app.route('/') def index(): return render_template('flask_ncov.html') # 更新 @app.route("/update", methods=["GET"]) def update_data(): data = update() return jsonify(data) # 查询确诊 @app.route("/query_confirm", methods=["GET"]) def query_confirm(): data = query("confirm") return jsonify(data) # 查询趋势 @app.route("/query_trend", methods=["GET"]) def query_trend(): data = query("trend") return jsonify(data) if __name__ == '__main__': update() app.run(debug=False)
[ 1, 529, 276, 1112, 420, 29958, 1485, 29895, 29914, 17608, 586, 29906, 29900, 29906, 29900, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 29871, 29906, 29900, 29906, 29900, 29914, 29900, 29906, 29914, 29896, 29945, 491, 1770, 29895, 13, 29937, 29871, 31594, 31047, 30898, 234, 153, 174, 30993, 31024, 30683, 30354, 30763, 30214, 31666, 30785, 30406, 29784, 29871, 233, 147, 176, 30886, 30822, 31037, 30267, 13, 13, 15945, 29908, 13, 29937, 29871, 30785, 30406, 2379, 1278, 718, 382, 1451, 5708, 29871, 31195, 31424, 234, 153, 174, 30993, 31599, 30858, 30267, 13, 29896, 29897, 31594, 234, 153, 174, 30993, 31222, 31433, 233, 141, 150, 30683, 234, 153, 174, 30993, 30354, 30763, 30214, 30982, 30946, 30573, 234, 169, 190, 31532, 30354, 30763, 31608, 13, 29906, 29897, 29871, 232, 147, 178, 30846, 29784, 29871, 30822, 31037, 30214, 30682, 31195, 30594, 31100, 30374, 30354, 30763, 234, 168, 187, 30666, 31526, 234, 169, 190, 31532, 30354, 30763, 30214, 31516, 30822, 30651, 4390, 29871, 31168, 30607, 31086, 30742, 31213, 235, 178, 165, 30354, 30763, 31608, 30980, 30594, 31086, 30742, 233, 187, 181, 233, 162, 150, 30210, 31222, 31610, 30267, 13, 29941, 29897, 29871, 31795, 31479, 3472, 29871, 31610, 30806, 30214, 30658, 31037, 29898, 233, 184, 146, 235, 170, 139, 30943, 29897, 30768, 31138, 9349, 29871, 31088, 31376, 31084, 30495, 30874, 31272, 232, 191, 133, 233, 176, 168, 30666, 31526, 30354, 30763, 30214, 234, 190, 155, 31072, 234, 153, 174, 30993, 30533, 30861, 30503, 234, 153, 174, 30993, 235, 185, 142, 232, 141, 194, 30861, 30267, 13, 15945, 29908, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4050, 29918, 6886, 29892, 4390, 1598, 13, 3166, 9922, 333, 29884, 29918, 17608, 586, 1053, 2767, 29892, 2346, 13, 13, 932, 353, 2379, 1278, 22168, 978, 1649, 29897, 13, 932, 29889, 2917, 1839, 7249, 29918, 3289, 29918, 28599, 2687, 2033, 353, 7700, 13, 13, 2277, 29871, 31368, 232, 137, 143, 29784, 29871, 30874, 31272, 13, 29992, 932, 29889, 13134, 11219, 29966, 29888, 978, 15513, 1420, 1495, 13, 1753, 22172, 29898, 29888, 978, 1125, 13, 1678, 736, 4050, 29918, 6886, 29898, 29888, 978, 29974, 1642, 1420, 1159, 13, 13, 2277, 29871, 30888, 31610, 13, 29992, 932, 29889, 13134, 11219, 1495, 13, 1753, 2380, 7295, 13, 1678, 736, 4050, 29918, 6886, 877, 1579, 1278, 29918, 17608, 586, 29889, 1420, 1495, 13, 13, 29937, 29871, 31100, 30374, 13, 29992, 932, 29889, 13134, 11974, 5504, 613, 3519, 29922, 3366, 7194, 20068, 13, 1753, 2767, 29918, 1272, 7295, 13, 1678, 848, 353, 2767, 580, 13, 1678, 736, 4390, 1598, 29898, 1272, 29897, 13, 13, 29937, 29871, 31213, 235, 178, 165, 31835, 235, 178, 141, 13, 29992, 932, 29889, 13134, 11974, 1972, 29918, 26897, 613, 3519, 29922, 3366, 7194, 20068, 13, 1753, 2346, 29918, 26897, 7295, 13, 1678, 848, 353, 2346, 703, 26897, 1159, 13, 1678, 736, 4390, 1598, 29898, 1272, 29897, 13, 13, 29937, 29871, 31213, 235, 178, 165, 235, 185, 142, 232, 141, 194, 13, 29992, 932, 29889, 13134, 11974, 1972, 29918, 509, 355, 613, 3519, 29922, 3366, 7194, 20068, 13, 1753, 2346, 29918, 509, 355, 7295, 13, 1678, 848, 353, 2346, 703, 509, 355, 1159, 13, 1678, 736, 4390, 1598, 29898, 1272, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 2767, 580, 13, 1678, 623, 29889, 3389, 29898, 8382, 29922, 8824, 29897, 13, 2 ]
yibai-sms-python-sdk-1.0.0/yibai/api/Yibai.py
100sms/yibai-python-sdk
0
18731
# encoding=utf8 import HttpUtils class YibaiApiError(Exception): def __init__(self, code, message): super(YibaiApiError, self).__init__(message) self.code = code class YibaiClient(object): def __init__(self, server_url, apikey): self.serverUrl = server_url self.apikey = apikey def sms_batch_submit(self, submits): return self.__execute({'submits': submits}, '/sms/batchSubmit') def sms_pull_status_report(self): return self.__execute({}, '/sms/pullStatusReport') def sms_pull_reply_message(self): return self.__execute({}, '/sms/pullReply') def user_info(self): return self.__execute({}, '/user/info') def __execute(self, request, url_path): request['apikey'] = self.apikey req_url = self.serverUrl + url_path res = HttpUtils.post_json(req_url, request) if res['code'] == 200: return res['response'] raise YibaiApiError(res['code'], res['message'])
[ 1, 396, 8025, 29922, 9420, 29947, 30004, 13, 30004, 13, 5215, 9056, 12177, 30004, 13, 30004, 13, 30004, 13, 1990, 612, 747, 1794, 11713, 2392, 29898, 2451, 1125, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 775, 29892, 2643, 1125, 30004, 13, 4706, 2428, 29898, 29979, 747, 1794, 11713, 2392, 29892, 1583, 467, 1649, 2344, 12035, 4906, 8443, 13, 4706, 1583, 29889, 401, 353, 775, 30004, 13, 30004, 13, 30004, 13, 1990, 612, 747, 1794, 4032, 29898, 3318, 1125, 30004, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1923, 29918, 2271, 29892, 7882, 1989, 1125, 30004, 13, 4706, 1583, 29889, 2974, 5983, 353, 1923, 29918, 2271, 30004, 13, 4706, 1583, 29889, 2754, 1989, 353, 7882, 1989, 30004, 13, 30004, 13, 1678, 822, 269, 1516, 29918, 16175, 29918, 7892, 29898, 1311, 29892, 11834, 1169, 1125, 30004, 13, 4706, 736, 1583, 17255, 7978, 3319, 29915, 1491, 29885, 1169, 2396, 11834, 1169, 1118, 8207, 29879, 1516, 29914, 16175, 16228, 1495, 30004, 13, 30004, 13, 1678, 822, 269, 1516, 29918, 26746, 29918, 4882, 29918, 12276, 29898, 1311, 1125, 30004, 13, 4706, 736, 1583, 17255, 7978, 3319, 1118, 8207, 29879, 1516, 29914, 26746, 5709, 13020, 1495, 30004, 13, 30004, 13, 1678, 822, 269, 1516, 29918, 26746, 29918, 3445, 368, 29918, 4906, 29898, 1311, 1125, 30004, 13, 4706, 736, 1583, 17255, 7978, 3319, 1118, 8207, 29879, 1516, 29914, 26746, 5612, 368, 1495, 30004, 13, 30004, 13, 1678, 822, 1404, 29918, 3888, 29898, 1311, 1125, 30004, 13, 4706, 736, 1583, 17255, 7978, 3319, 1118, 8207, 1792, 29914, 3888, 1495, 30004, 13, 30004, 13, 1678, 822, 4770, 7978, 29898, 1311, 29892, 2009, 29892, 3142, 29918, 2084, 1125, 30004, 13, 4706, 2009, 1839, 2754, 1989, 2033, 353, 1583, 29889, 2754, 1989, 30004, 13, 4706, 12428, 29918, 2271, 353, 1583, 29889, 2974, 5983, 718, 3142, 29918, 2084, 30004, 13, 4706, 620, 353, 9056, 12177, 29889, 2490, 29918, 3126, 29898, 7971, 29918, 2271, 29892, 2009, 8443, 13, 4706, 565, 620, 1839, 401, 2033, 1275, 29871, 29906, 29900, 29900, 29901, 30004, 13, 9651, 736, 620, 1839, 5327, 2033, 30004, 13, 4706, 12020, 612, 747, 1794, 11713, 2392, 29898, 690, 1839, 401, 7464, 620, 1839, 4906, 2033, 8443, 13, 2 ]
Fortgeschrittenenpraktikum/Protokolle/V18_Germaniumdetektor/Python/unbekannt2.py
smjhnits/Praktikum
2
158350
import numpy as np import matplotlib.pyplot as plt import uncertainties from scipy.signal import find_peaks from scipy.optimize import curve_fit import scipy.constants as sc import scipy.integrate as integrate from uncertainties import ufloat from uncertainties import unumpy as unp from uncertainties.unumpy import nominal_values as nomval from uncertainties.unumpy import std_devs as std # Loading experimental data and results of further calculations r = 0.5*45*10**(-3) L = (73.5+15)*10**(-3) Omega = 0.5 * ( 1- L/np.sqrt(L**2+r**2)) C_u2 = np.genfromtxt('2018-12-10_Nitschke_Pape/Probe_21.Spe', unpack = True) Peaks_Eu, Q_Eu = np.genfromtxt('EuropiumQ.txt', unpack = True) Channels = np.linspace(0,len(C_u2[:4000])-1, len(C_u2[:4000])) params_energy, covariance_energy_0, covariance_energy_1, params_Q, covariance_Q_0, covariance_Q_1= np.genfromtxt('Europium.txt', unpack = True) covariance_energy = np.array([covariance_energy_0, covariance_energy_1]) errors_energy = np.sqrt(np.diag(covariance_energy)) covariance_Q = np.array([covariance_Q_0,covariance_Q_1]) errors_Q = np.sqrt(np.diag(covariance_Q)) def Energy(C): return ufloat(params_energy[0], errors_energy[0])*C + ufloat(params_energy[1], errors_energy[1]) def Gauss(x, A, xmu, sigma, B): return A * np.exp(-0.5*(x-xmu)**2/sigma**2) + B def Gauss_Ufloat(x, A, xmu, sigma): return A * unp.exp(-0.5*(x-xmu)**2/sigma**2) def AreaGaus(A, sigma): return np.sqrt(2*np.pi)*sigma*A def Efficiency(E): return ufloat(params_Q[0], errors_Q[0])*E**ufloat(params_Q[1], errors_Q[1]) Spektrum = C_u2[:4000] tges = 4046 Peaks = find_peaks(Spektrum, height = 120) plt.clf() plt.hist(unp.nominal_values(Energy(np.arange(0, len(Spektrum[0:4000]), 1))), bins=unp.nominal_values(Energy(np.linspace(0, len(Spektrum[0:4000]), len(Spektrum[0:4000])))), weights=Spektrum[0:4000], label='Spektrum') plt.yscale('log') plt.plot(nomval(Energy(Peaks[0][:])), Spektrum[Peaks[0][:]], '.', markersize=4, label='Gauß-Peaks', color='C1', alpha=0.8) plt.xlim(0,1500) plt.ylabel('Zählungen pro Energie') plt.xlabel('E / keV') plt.legend() #plt.show() plt.savefig('Plots/unbekannt2.pdf') Peaks_Energy = Energy(Peaks[0][:]) Energy_co = np.array([1173.237, 1332.501]) Params_u2 = [] errors_u2 = [] for n in Peaks[0]: Params, covariance = curve_fit(Gauss, Channels[n-30:n+30], Spektrum[n-30:n+30], p0 = [C_u2[n], n, 1, 0]) Params_u2.append(Params.tolist()) errors = np.sqrt(np.diag(covariance)) errors_u2.append(errors.tolist()) for i,n in enumerate(Peaks[0]): l_u = np.int(Channels[n-30]) l_o = np.int(Channels[n+30]) plt.clf() plt.hist(unp.nominal_values(Energy(np.arange(l_u, l_o, 1))), bins=unp.nominal_values(Energy(np.linspace(l_u, l_o, len(Spektrum[n-30:n+30])))), weights=Spektrum[n-30:n+30], label='Spektrum') Channel_Gauss = np.linspace(n-30,n+30,1000) plt.plot(unp.nominal_values(Energy(Channel_Gauss)), Gauss(Channel_Gauss,*Params_u2[i])) #plt.show() Peaks_mittel = np.round(np.asarray(Params_u2)[:,1],0) Amplitudes = np.asarray(Params_u2)[:,0] Amplitudes_ufloat = np.asarray([ufloat(n, np.asarray(errors_u2)[i,0]) for i,n in enumerate(np.asarray(Params_u2)[:,0])]) Means_ufloat = np.asarray([ufloat(n, np.asarray(errors_u2)[i,1]) for i,n in enumerate(np.asarray(Params_u2)[:,1])]) sigmas = np.asarray(Params_u2)[:,2] sigmas_ufloat = np.asarray([ufloat(n, np.asarray(errors_u2)[i,2]) for i,n in enumerate(np.asarray(Params_u2)[:,2])]) Area_Params = np.array([[n,sigmas[i]] for i,n in enumerate(Amplitudes)]) Area_params_ufloat = np.array([[n,sigmas_ufloat[i]] for i,n in enumerate(Amplitudes_ufloat)]) Constants_ufloat = np.asarray([ufloat(n, np.asarray(errors_u2)[i,3]) for i,n in enumerate(np.asarray(Params_u2)[:,3])]) print("--- Find Peaks and gaussian fit---") print(f"Channel Peaks: {np.round(Peaks_mittel,0)}") #print(f"Energy Peaks: {Energy(np.round(Peaks_mittel,0))}") print(f"Energy Literature: {Energy_co}", '\n') Area = AreaGaus(Area_Params[:,0], Area_Params[:,1]) Area_ufloat = AreaGaus(Area_params_ufloat[:,0], Area_params_ufloat[:,1]) Area_norm = Area/tges Area_norm_ufloat = Area_ufloat/tges print("-- Fit Parameter --") print(f"Amplituden: {Amplitudes_ufloat}") print(f"Means: {Energy(Means_ufloat)}") print(f"Sigmas: {sigmas_ufloat}") print(f"Constants: {Constants_ufloat}", '\n') print("--- Calculating the activity ---") r = 0.5*45*10**(-3) L = (73.5+15)*10**(-3) Omega = 0.5 * ( 1- L/np.sqrt(L**2+r**2)) W = np.asarray([0.999736, 0.999856]) Q = Efficiency(Peaks_Energy) Aktivität = np.array([Area_norm[i]/(W[i]*n*Omega) for i,n in enumerate(Q)]) print(f"emission probability: {W}") print(f"Area under Gaussian Fit: {Area_ufloat}") print(f"Efficiency: {Q}", '\n') print(f"resulting acitivity: {Aktivität}") A_all = sum(Aktivität)/len(Aktivität)#ufloat(np.mean(nomval(Aktivität)),np.std(std(Aktivität))) print(f"Mean with all values: {nomval(A_all)}, {std(A_all)}")
[ 1, 1053, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 443, 6327, 2365, 583, 13, 3166, 4560, 2272, 29889, 25436, 1053, 1284, 29918, 412, 10327, 13, 3166, 4560, 2272, 29889, 20640, 675, 1053, 11672, 29918, 9202, 13, 5215, 4560, 2272, 29889, 3075, 1934, 408, 885, 13, 5215, 4560, 2272, 29889, 14146, 403, 408, 22782, 13, 3166, 443, 6327, 2365, 583, 1053, 318, 7411, 13, 3166, 443, 6327, 2365, 583, 1053, 443, 398, 2272, 408, 443, 29886, 13, 3166, 443, 6327, 2365, 583, 29889, 348, 398, 2272, 1053, 2245, 979, 29918, 5975, 408, 2245, 791, 13, 3166, 443, 6327, 2365, 583, 29889, 348, 398, 2272, 1053, 3659, 29918, 3359, 29879, 408, 3659, 13, 29937, 4309, 9382, 17986, 848, 322, 2582, 310, 4340, 17203, 13, 13, 29878, 353, 29871, 29900, 29889, 29945, 29930, 29946, 29945, 29930, 29896, 29900, 1068, 6278, 29941, 29897, 13, 29931, 353, 313, 29955, 29941, 29889, 29945, 29974, 29896, 29945, 11877, 29896, 29900, 1068, 6278, 29941, 29897, 13, 5981, 353, 29871, 29900, 29889, 29945, 334, 313, 29871, 29896, 29899, 365, 29914, 9302, 29889, 3676, 29898, 29931, 1068, 29906, 29974, 29878, 1068, 29906, 876, 13, 13, 29907, 29918, 29884, 29906, 353, 7442, 29889, 1885, 3166, 3945, 877, 29906, 29900, 29896, 29947, 29899, 29896, 29906, 29899, 29896, 29900, 29918, 29940, 20641, 446, 29918, 29925, 4085, 29914, 1184, 915, 29918, 29906, 29896, 29889, 10649, 742, 443, 4058, 353, 5852, 29897, 13, 15666, 10327, 29918, 29923, 29884, 29892, 660, 29918, 29923, 29884, 353, 7442, 29889, 1885, 3166, 3945, 877, 29923, 4131, 1974, 29984, 29889, 3945, 742, 443, 4058, 353, 5852, 29897, 13, 1451, 12629, 353, 7442, 29889, 1915, 3493, 29898, 29900, 29892, 2435, 29898, 29907, 29918, 29884, 29906, 7503, 29946, 29900, 29900, 29900, 2314, 29899, 29896, 29892, 7431, 29898, 29907, 29918, 29884, 29906, 7503, 29946, 29900, 29900, 29900, 12622, 13, 7529, 29918, 27548, 29892, 18838, 279, 8837, 29918, 27548, 29918, 29900, 29892, 18838, 279, 8837, 29918, 27548, 29918, 29896, 29892, 8636, 29918, 29984, 29892, 18838, 279, 8837, 29918, 29984, 29918, 29900, 29892, 18838, 279, 8837, 29918, 29984, 29918, 29896, 29922, 7442, 29889, 1885, 3166, 3945, 877, 29923, 4131, 1974, 29889, 3945, 742, 443, 4058, 353, 5852, 29897, 13, 13, 24542, 279, 8837, 29918, 27548, 353, 7442, 29889, 2378, 4197, 24542, 279, 8837, 29918, 27548, 29918, 29900, 29892, 18838, 279, 8837, 29918, 27548, 29918, 29896, 2314, 13, 12523, 29918, 27548, 353, 7442, 29889, 3676, 29898, 9302, 29889, 6051, 351, 29898, 24542, 279, 8837, 29918, 27548, 876, 13, 24542, 279, 8837, 29918, 29984, 353, 7442, 29889, 2378, 4197, 24542, 279, 8837, 29918, 29984, 29918, 29900, 29892, 24542, 279, 8837, 29918, 29984, 29918, 29896, 2314, 13, 12523, 29918, 29984, 353, 7442, 29889, 3676, 29898, 9302, 29889, 6051, 351, 29898, 24542, 279, 8837, 29918, 29984, 876, 13, 13, 1753, 24836, 29898, 29907, 1125, 13, 1678, 736, 318, 7411, 29898, 7529, 29918, 27548, 29961, 29900, 1402, 4436, 29918, 27548, 29961, 29900, 2314, 29930, 29907, 718, 318, 7411, 29898, 7529, 29918, 27548, 29961, 29896, 1402, 4436, 29918, 27548, 29961, 29896, 2314, 13, 13, 1753, 402, 11214, 29898, 29916, 29892, 319, 29892, 921, 2589, 29892, 269, 2934, 29892, 350, 1125, 13, 1678, 736, 319, 334, 7442, 29889, 4548, 6278, 29900, 29889, 29945, 16395, 29916, 29899, 29916, 2589, 29897, 1068, 29906, 29914, 3754, 1068, 29906, 29897, 718, 350, 13, 13, 1753, 402, 11214, 29918, 29965, 7411, 29898, 29916, 29892, 319, 29892, 921, 2589, 29892, 269, 2934, 1125, 13, 1678, 736, 319, 334, 443, 29886, 29889, 4548, 6278, 29900, 29889, 29945, 16395, 29916, 29899, 29916, 2589, 29897, 1068, 29906, 29914, 3754, 1068, 29906, 29897, 13, 13, 1753, 18320, 29954, 1485, 29898, 29909, 29892, 269, 2934, 1125, 13, 1678, 736, 7442, 29889, 3676, 29898, 29906, 29930, 9302, 29889, 1631, 11877, 3754, 29930, 29909, 13, 13, 1753, 382, 2416, 13396, 29898, 29923, 1125, 13, 1678, 736, 318, 7411, 29898, 7529, 29918, 29984, 29961, 29900, 1402, 4436, 29918, 29984, 29961, 29900, 2314, 29930, 29923, 1068, 1137, 3071, 29898, 7529, 29918, 29984, 29961, 29896, 1402, 4436, 29918, 29984, 29961, 29896, 2314, 13, 13, 10649, 12947, 398, 353, 315, 29918, 29884, 29906, 7503, 29946, 29900, 29900, 29900, 29962, 13, 29873, 2710, 353, 29871, 29946, 29900, 29946, 29953, 13, 15666, 10327, 353, 1284, 29918, 412, 10327, 29898, 10649, 12947, 398, 29892, 3171, 353, 29871, 29896, 29906, 29900, 29897, 13, 13, 572, 29873, 29889, 695, 29888, 580, 13, 572, 29873, 29889, 29882, 391, 29898, 348, 29886, 29889, 11522, 979, 29918, 5975, 29898, 29923, 1089, 1927, 29898, 9302, 29889, 279, 927, 29898, 29900, 29892, 7431, 29898, 10649, 12947, 398, 29961, 29900, 29901, 29946, 29900, 29900, 29900, 11724, 29871, 29896, 876, 511, 13, 308, 289, 1144, 29922, 348, 29886, 29889, 11522, 979, 29918, 5975, 29898, 29923, 1089, 1927, 29898, 9302, 29889, 1915, 3493, 29898, 29900, 29892, 7431, 29898, 10649, 12947, 398, 29961, 29900, 29901, 29946, 29900, 29900, 29900, 11724, 7431, 29898, 10649, 12947, 398, 29961, 29900, 29901, 29946, 29900, 29900, 29900, 29962, 4961, 511, 13, 308, 18177, 29922, 10649, 12947, 398, 29961, 29900, 29901, 29946, 29900, 29900, 29900, 1402, 3858, 2433, 10649, 12947, 398, 1495, 13, 572, 29873, 29889, 952, 29883, 744, 877, 1188, 1495, 13, 572, 29873, 29889, 5317, 29898, 11522, 791, 29898, 29923, 1089, 1927, 29898, 15666, 10327, 29961, 29900, 3816, 29901, 2314, 511, 5013, 12947, 398, 29961, 15666, 10327, 29961, 29900, 3816, 17531, 1402, 15300, 742, 13, 308, 29320, 675, 29922, 29946, 29892, 3858, 2433, 29954, 585, 30034, 29899, 15666, 10327, 742, 2927, 2433, 29907, 29896, 742, 15595, 29922, 29900, 29889, 29947, 29897, 13, 572, 29873, 29889, 29916, 2576, 29898, 29900, 29892, 29896, 29945, 29900, 29900, 29897, 13, 572, 29873, 29889, 29891, 1643, 877, 29999, 15275, 2469, 410, 15163, 12053, 1495, 13, 572, 29873, 29889, 29916, 1643, 877, 29923, 847, 1589, 29963, 1495, 13, 572, 29873, 29889, 26172, 580, 13, 29937, 572, 29873, 29889, 4294, 580, 13, 572, 29873, 29889, 7620, 1003, 877, 3247, 1862, 29914, 348, 16863, 5805, 29906, 29889, 5140, 1495, 13, 13, 15666, 10327, 29918, 29923, 1089, 1927, 353, 24836, 29898, 15666, 10327, 29961, 29900, 3816, 29901, 2314, 13, 29923, 1089, 1927, 29918, 1111, 353, 7442, 29889, 2378, 4197, 29896, 29896, 29955, 29941, 29889, 29906, 29941, 29955, 29892, 29871, 29896, 29941, 29941, 29906, 29889, 29945, 29900, 29896, 2314, 13, 13, 9629, 29918, 29884, 29906, 353, 5159, 13, 12523, 29918, 29884, 29906, 353, 5159, 13, 13, 1454, 302, 297, 3938, 10327, 29961, 29900, 5387, 13, 1678, 1459, 2232, 29892, 18838, 279, 8837, 353, 11672, 29918, 9202, 29898, 29954, 11214, 29892, 678, 12629, 29961, 29876, 29899, 29941, 29900, 29901, 29876, 29974, 29941, 29900, 1402, 5013, 12947, 398, 29961, 29876, 29899, 29941, 29900, 29901, 29876, 29974, 29941, 29900, 1402, 282, 29900, 353, 518, 29907, 29918, 29884, 29906, 29961, 29876, 1402, 302, 29892, 29871, 29896, 29892, 29871, 29900, 2314, 13, 1678, 1459, 2232, 29918, 29884, 29906, 29889, 4397, 29898, 9629, 29889, 25027, 391, 3101, 13, 1678, 4436, 353, 7442, 29889, 3676, 29898, 9302, 29889, 6051, 351, 29898, 24542, 279, 8837, 876, 13, 1678, 4436, 29918, 29884, 29906, 29889, 4397, 29898, 12523, 29889, 25027, 391, 3101, 13, 13, 1454, 474, 29892, 29876, 297, 26985, 29898, 15666, 10327, 29961, 29900, 29962, 1125, 13, 1678, 301, 29918, 29884, 353, 7442, 29889, 524, 29898, 1451, 12629, 29961, 29876, 29899, 29941, 29900, 2314, 13, 1678, 301, 29918, 29877, 353, 7442, 29889, 524, 29898, 1451, 12629, 29961, 29876, 29974, 29941, 29900, 2314, 13, 1678, 14770, 29889, 695, 29888, 580, 13, 1678, 14770, 29889, 29882, 391, 29898, 348, 29886, 29889, 11522, 979, 29918, 5975, 29898, 29923, 1089, 1927, 29898, 9302, 29889, 279, 927, 29898, 29880, 29918, 29884, 29892, 301, 29918, 29877, 29892, 29871, 29896, 876, 511, 13, 9651, 289, 1144, 29922, 348, 29886, 29889, 11522, 979, 29918, 5975, 29898, 29923, 1089, 1927, 29898, 9302, 29889, 1915, 3493, 29898, 29880, 29918, 29884, 29892, 301, 29918, 29877, 29892, 7431, 29898, 10649, 12947, 398, 29961, 29876, 29899, 29941, 29900, 29901, 29876, 29974, 29941, 29900, 29962, 4961, 511, 13, 9651, 18177, 29922, 10649, 12947, 398, 29961, 29876, 29899, 29941, 29900, 29901, 29876, 29974, 29941, 29900, 1402, 3858, 2433, 10649, 12947, 398, 1495, 13, 1678, 17368, 29918, 29954, 11214, 353, 7442, 29889, 1915, 3493, 29898, 29876, 29899, 29941, 29900, 29892, 29876, 29974, 29941, 29900, 29892, 29896, 29900, 29900, 29900, 29897, 13, 1678, 14770, 29889, 5317, 29898, 348, 29886, 29889, 11522, 979, 29918, 5975, 29898, 29923, 1089, 1927, 29898, 13599, 29918, 29954, 11214, 8243, 402, 11214, 29898, 13599, 29918, 29954, 11214, 29892, 29930, 9629, 29918, 29884, 29906, 29961, 29875, 12622, 13, 1678, 396, 572, 29873, 29889, 4294, 580, 13, 13, 15666, 10327, 29918, 20664, 353, 7442, 29889, 14486, 29898, 9302, 29889, 294, 2378, 29898, 9629, 29918, 29884, 29906, 29897, 7503, 29892, 29896, 1402, 29900, 29897, 13, 6833, 2830, 8192, 353, 7442, 29889, 294, 2378, 29898, 9629, 29918, 29884, 29906, 29897, 7503, 29892, 29900, 29962, 13, 6833, 2830, 8192, 29918, 1137, 3071, 353, 7442, 29889, 294, 2378, 4197, 1137, 3071, 29898, 29876, 29892, 7442, 29889, 294, 2378, 29898, 12523, 29918, 29884, 29906, 9601, 29875, 29892, 29900, 2314, 363, 474, 29892, 29876, 297, 26985, 29898, 9302, 29889, 294, 2378, 29898, 9629, 29918, 29884, 29906, 29897, 7503, 29892, 29900, 2314, 2314, 13, 6816, 550, 29918, 1137, 3071, 353, 7442, 29889, 294, 2378, 4197, 1137, 3071, 29898, 29876, 29892, 7442, 29889, 294, 2378, 29898, 12523, 29918, 29884, 29906, 9601, 29875, 29892, 29896, 2314, 363, 474, 29892, 29876, 297, 26985, 29898, 9302, 29889, 294, 2378, 29898, 9629, 29918, 29884, 29906, 29897, 7503, 29892, 29896, 2314, 2314, 13, 18816, 8247, 353, 7442, 29889, 294, 2378, 29898, 9629, 29918, 29884, 29906, 29897, 7503, 29892, 29906, 29962, 13, 18816, 8247, 29918, 1137, 3071, 353, 29871, 7442, 29889, 294, 2378, 4197, 1137, 3071, 29898, 29876, 29892, 7442, 29889, 294, 2378, 29898, 12523, 29918, 29884, 29906, 9601, 29875, 29892, 29906, 2314, 363, 474, 29892, 29876, 297, 26985, 29898, 9302, 29889, 294, 2378, 29898, 9629, 29918, 29884, 29906, 29897, 7503, 29892, 29906, 2314, 2314, 13, 13799, 29918, 9629, 353, 7442, 29889, 2378, 4197, 29961, 29876, 29892, 18816, 8247, 29961, 29875, 5262, 363, 474, 29892, 29876, 297, 26985, 29898, 6833, 2830, 8192, 29897, 2314, 13, 13799, 29918, 7529, 29918, 1137, 3071, 353, 7442, 29889, 2378, 4197, 29961, 29876, 29892, 18816, 8247, 29918, 1137, 3071, 29961, 29875, 5262, 363, 474, 29892, 29876, 297, 26985, 29898, 6833, 2830, 8192, 29918, 1137, 3071, 29897, 2314, 13, 26570, 29918, 1137, 3071, 353, 7442, 29889, 294, 2378, 4197, 1137, 3071, 29898, 29876, 29892, 7442, 29889, 294, 2378, 29898, 12523, 29918, 29884, 29906, 9601, 29875, 29892, 29941, 2314, 363, 474, 29892, 29876, 297, 26985, 29898, 9302, 29889, 294, 2378, 29898, 9629, 29918, 29884, 29906, 29897, 7503, 29892, 29941, 2314, 2314, 13, 13, 2158, 703, 5634, 10987, 3938, 10327, 322, 330, 17019, 6216, 5634, 1159, 13, 2158, 29898, 29888, 29908, 13599, 3938, 10327, 29901, 426, 9302, 29889, 14486, 29898, 15666, 10327, 29918, 20664, 29892, 29900, 2915, 1159, 13, 29937, 2158, 29898, 29888, 29908, 29923, 1089, 1927, 3938, 10327, 29901, 426, 29923, 1089, 1927, 29898, 9302, 29889, 14486, 29898, 15666, 10327, 29918, 20664, 29892, 29900, 876, 27195, 13, 2158, 29898, 29888, 29908, 29923, 1089, 1927, 5449, 1535, 29901, 426, 29923, 1089, 1927, 29918, 1111, 17671, 11297, 29876, 1495, 13, 13, 13799, 353, 18320, 29954, 1485, 29898, 13799, 29918, 9629, 7503, 29892, 29900, 1402, 18320, 29918, 9629, 7503, 29892, 29896, 2314, 13, 13799, 29918, 1137, 3071, 353, 18320, 29954, 1485, 29898, 13799, 29918, 7529, 29918, 1137, 3071, 7503, 29892, 29900, 1402, 18320, 29918, 7529, 29918, 1137, 3071, 7503, 29892, 29896, 2314, 13, 13799, 29918, 12324, 353, 18320, 29914, 29873, 2710, 13, 13799, 29918, 12324, 29918, 1137, 3071, 353, 18320, 29918, 1137, 3071, 29914, 29873, 2710, 13, 13, 2158, 703, 489, 383, 277, 24953, 1192, 1159, 13, 2158, 29898, 29888, 29908, 6833, 2830, 27336, 29901, 426, 6833, 2830, 8192, 29918, 1137, 3071, 27195, 13, 2158, 29898, 29888, 29908, 6816, 550, 29901, 426, 29923, 1089, 1927, 29898, 6816, 550, 29918, 1137, 3071, 2915, 1159, 13, 2158, 29898, 29888, 29908, 29903, 335, 8247, 29901, 426, 18816, 8247, 29918, 1137, 3071, 27195, 13, 2158, 29898, 29888, 29908, 26570, 29901, 426, 26570, 29918, 1137, 3071, 17671, 11297, 29876, 1495, 13, 13, 2158, 703, 5634, 20535, 1218, 278, 6354, 11474, 1159, 13, 13, 29878, 353, 29871, 29900, 29889, 29945, 29930, 29946, 29945, 29930, 29896, 29900, 1068, 6278, 29941, 29897, 13, 29931, 353, 313, 29955, 29941, 29889, 29945, 29974, 29896, 29945, 11877, 29896, 29900, 1068, 6278, 29941, 29897, 13, 5981, 353, 29871, 29900, 29889, 29945, 334, 313, 29871, 29896, 29899, 365, 29914, 9302, 29889, 3676, 29898, 29931, 1068, 29906, 29974, 29878, 1068, 29906, 876, 13, 13, 29956, 353, 7442, 29889, 294, 2378, 4197, 29900, 29889, 29929, 29929, 29929, 29955, 29941, 29953, 29892, 29871, 29900, 29889, 29929, 29929, 29929, 29947, 29945, 29953, 2314, 13, 29984, 353, 382, 2416, 13396, 29898, 15666, 10327, 29918, 29923, 1089, 1927, 29897, 13, 29909, 21371, 7033, 353, 7442, 29889, 2378, 4197, 13799, 29918, 12324, 29961, 29875, 29962, 14571, 29956, 29961, 29875, 14178, 29876, 29930, 5981, 29897, 363, 474, 29892, 29876, 297, 26985, 29898, 29984, 29897, 2314, 13, 13, 2158, 29898, 29888, 29908, 331, 2333, 6976, 29901, 426, 29956, 27195, 13, 2158, 29898, 29888, 29908, 13799, 1090, 22477, 383, 277, 29901, 426, 13799, 29918, 1137, 3071, 27195, 13, 2158, 29898, 29888, 29908, 29923, 2416, 13396, 29901, 426, 29984, 17671, 11297, 29876, 1495, 13, 2158, 29898, 29888, 29908, 2914, 292, 1274, 24858, 29901, 426, 29909, 21371, 7033, 27195, 13, 13, 29909, 29918, 497, 353, 2533, 29898, 29909, 21371, 7033, 6802, 2435, 29898, 29909, 21371, 7033, 29897, 29937, 1137, 3071, 29898, 9302, 29889, 12676, 29898, 11522, 791, 29898, 29909, 21371, 7033, 8243, 9302, 29889, 4172, 29898, 4172, 29898, 29909, 21371, 7033, 4961, 13, 13, 2158, 29898, 29888, 29908, 6816, 273, 411, 599, 1819, 29901, 426, 11522, 791, 29898, 29909, 29918, 497, 19230, 426, 4172, 29898, 29909, 29918, 497, 2915, 1159, 13, 2 ]
validator/proxy_validator/client.py
ezirmusitua/proxies
0
57712
# -*- coding: utf-8 -*- import requests from proxy_validator import config Default_UA = config['CLIENT_UA'] Default_Timeout = config['CLIENT_TIMEOUT'] class Client(object): def __init__(self, headers=None, proxies=None): self.headers = headers if headers is not None else {} self.headers['User-Agent'] = Default_UA self.proxies = proxies if proxies is not None else {} self.session = requests.Session() def get(self, url=None): if url is None: raise Exception('Need Url. ') response = self.session.get(url, headers=self.headers, proxies=self.proxies, timeout=Default_Timeout) if response.status_code != 200: return None return response.text def set_proxies(self, proxy_str, ptype='http'): self.proxies = { 'http': (ptype if ptype is not None else 'http') + '://' + proxy_str, 'https': (ptype if ptype is not None else 'https') + '://' + proxy_str, }
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 7274, 13, 3166, 10166, 29918, 3084, 1061, 1053, 2295, 13, 13, 4592, 29918, 29965, 29909, 353, 2295, 1839, 27205, 3919, 29918, 29965, 29909, 2033, 13, 4592, 29918, 10851, 353, 2295, 1839, 27205, 3919, 29918, 15307, 12015, 2033, 13, 13, 13, 1990, 12477, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 9066, 29922, 8516, 29892, 410, 29916, 583, 29922, 8516, 1125, 13, 4706, 1583, 29889, 13662, 353, 9066, 565, 9066, 338, 451, 6213, 1683, 6571, 13, 4706, 1583, 29889, 13662, 1839, 2659, 29899, 19661, 2033, 353, 13109, 29918, 29965, 29909, 13, 4706, 1583, 29889, 771, 29916, 583, 353, 410, 29916, 583, 565, 410, 29916, 583, 338, 451, 6213, 1683, 6571, 13, 4706, 1583, 29889, 7924, 353, 7274, 29889, 7317, 580, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 3142, 29922, 8516, 1125, 13, 4706, 565, 3142, 338, 6213, 29901, 13, 9651, 12020, 8960, 877, 8139, 287, 501, 2096, 29889, 25710, 13, 4706, 2933, 353, 1583, 29889, 7924, 29889, 657, 29898, 2271, 29892, 9066, 29922, 1311, 29889, 13662, 29892, 410, 29916, 583, 29922, 1311, 29889, 771, 29916, 583, 29892, 11815, 29922, 4592, 29918, 10851, 29897, 13, 4706, 565, 2933, 29889, 4882, 29918, 401, 2804, 29871, 29906, 29900, 29900, 29901, 13, 9651, 736, 6213, 13, 4706, 736, 2933, 29889, 726, 13, 13, 1678, 822, 731, 29918, 771, 29916, 583, 29898, 1311, 29892, 10166, 29918, 710, 29892, 282, 1853, 2433, 1124, 29374, 13, 4706, 1583, 29889, 771, 29916, 583, 353, 426, 13, 9651, 525, 1124, 2396, 313, 415, 668, 565, 282, 1853, 338, 451, 6213, 1683, 525, 1124, 1495, 718, 525, 597, 29915, 718, 10166, 29918, 710, 29892, 13, 9651, 525, 991, 2396, 313, 415, 668, 565, 282, 1853, 338, 451, 6213, 1683, 525, 991, 1495, 718, 525, 597, 29915, 718, 10166, 29918, 710, 29892, 13, 4706, 500, 13, 2 ]
__main__.py
miezebieze/scott-launcher
1
1826
from enum import Enum from window import Window D = Enum ('Directions','N NE E SE S SW W NW') selector_map = { D.NW: [0.5,0.5], D.N: [1.5,0], D.NE: [2.5,0.5], D.W: [0,1.5], D.E: [3,1.5], D.SW: [0.5,2.5], D.S: [1.5,3], D.SE: [2.5,2.5], } selector_size = 100 window_size = selector_size*4 window = Window (window_size,window_size,selector_map,selector_size,selector_size) # set actions here from functools import partial def say (something): print (''.join (('Me: "',something,'"'))) window.actions[D.NW] = partial (say,'northwast') window.actions[D.N] = partial (say,'north') window.actions[D.NE] = partial (say,'neorthest') window.actions[D.W] = partial (say,'western') window.actions[D.E] = partial (say,'easy') window.actions[D.SW] = partial (say,'suess whest') window.actions[D.S] = partial (say,'sissy') window.actions[D.SE] = partial (say,'seoul') window.go ()
[ 1, 515, 14115, 1053, 1174, 398, 13, 3166, 3474, 1053, 18379, 13, 13, 29928, 353, 1174, 398, 6702, 29928, 533, 1953, 3788, 29940, 14693, 382, 3725, 317, 25289, 399, 405, 29956, 1495, 13, 13, 14357, 29918, 1958, 353, 426, 13, 4706, 360, 29889, 29940, 29956, 29901, 518, 29900, 29889, 29945, 29892, 29900, 29889, 29945, 1402, 360, 29889, 29940, 29901, 518, 29896, 29889, 29945, 29892, 29900, 1402, 360, 29889, 8186, 29901, 518, 29906, 29889, 29945, 29892, 29900, 29889, 29945, 1402, 13, 4706, 360, 29889, 29956, 29901, 518, 29900, 29892, 29896, 29889, 29945, 1402, 462, 1678, 360, 29889, 29923, 29901, 518, 29941, 29892, 29896, 29889, 29945, 1402, 13, 4706, 360, 29889, 23066, 29901, 518, 29900, 29889, 29945, 29892, 29906, 29889, 29945, 1402, 360, 29889, 29903, 29901, 518, 29896, 29889, 29945, 29892, 29941, 1402, 360, 29889, 1660, 29901, 518, 29906, 29889, 29945, 29892, 29906, 29889, 29945, 1402, 13, 4706, 500, 13, 13, 14357, 29918, 2311, 353, 29871, 29896, 29900, 29900, 13, 7165, 29918, 2311, 353, 11764, 29918, 2311, 29930, 29946, 13, 13, 7165, 353, 18379, 313, 7165, 29918, 2311, 29892, 7165, 29918, 2311, 29892, 14357, 29918, 1958, 29892, 14357, 29918, 2311, 29892, 14357, 29918, 2311, 29897, 13, 13, 29937, 731, 8820, 1244, 13, 3166, 2090, 312, 8789, 1053, 7687, 13, 1753, 1827, 313, 14481, 1125, 13, 1678, 1596, 6702, 4286, 7122, 313, 877, 6816, 29901, 376, 742, 14481, 5501, 29908, 29915, 4961, 13, 13, 7165, 29889, 7387, 29961, 29928, 29889, 29940, 29956, 29962, 353, 7687, 313, 20834, 5501, 29876, 2072, 29893, 579, 1495, 13, 7165, 29889, 7387, 29961, 29928, 29889, 29940, 29962, 353, 7687, 313, 20834, 5501, 29876, 2072, 1495, 13, 7165, 29889, 7387, 29961, 29928, 29889, 8186, 29962, 353, 7687, 313, 20834, 5501, 484, 2072, 342, 1495, 13, 7165, 29889, 7387, 29961, 29928, 29889, 29956, 29962, 353, 7687, 313, 20834, 5501, 22741, 1495, 13, 7165, 29889, 7387, 29961, 29928, 29889, 29923, 29962, 353, 7687, 313, 20834, 5501, 29872, 8995, 1495, 13, 7165, 29889, 7387, 29961, 29928, 29889, 23066, 29962, 353, 7687, 313, 20834, 5501, 2146, 404, 377, 342, 1495, 13, 7165, 29889, 7387, 29961, 29928, 29889, 29903, 29962, 353, 7687, 313, 20834, 5501, 29879, 790, 29891, 1495, 13, 7165, 29889, 7387, 29961, 29928, 29889, 1660, 29962, 353, 7687, 313, 20834, 5501, 344, 5059, 1495, 13, 13, 7165, 29889, 1484, 3861, 13, 2 ]
Libraries/Python/CommonEnvironment/v1.0/CommonEnvironment/TypeInfo/FundamentalTypes/Serialization/UnitTests/StringSerialization_UnitTest.py
davidbrownell/v3-Common_Environment
0
161260
# ---------------------------------------------------------------------- # | # | StringSerialization_UnitTest.py # | # | <NAME> <<EMAIL>> # | 2018-04-26 22:06:18 # | # ---------------------------------------------------------------------- # | # | Copyright <NAME> 2018-22. # | Distributed under the Boost Software License, Version 1.0. # | (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # | # ---------------------------------------------------------------------- # """Unit test for StringSerialization.py""" import datetime import os import re import sys import unittest import uuid import CommonEnvironment from CommonEnvironment.TypeInfo.FundamentalTypes.All import * from CommonEnvironment.TypeInfo.FundamentalTypes.Serialization.StringSerialization import RegularExpressionVisitor, \ StringSerialization, \ ValidationException # ---------------------------------------------------------------------- _script_fullpath = CommonEnvironment.ThisFullpath() _script_dir, _script_name = os.path.split(_script_fullpath) # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- class RegularExpressionVisitorSuite(unittest.TestCase): # ---------------------------------------------------------------------- def test_Standard(self): # ---------------------------------------------------------------------- def Test(method, to_match, regex_index=0): if not isinstance(to_match, list): to_match = [ to_match, ] regex_string = method()[regex_index] if isinstance(regex_string, tuple): regex_string, regex_options = regex_string else: regex_options = 0 regex = re.compile("^{}$".format(regex_string), regex_options) for index, query in enumerate(to_match): self.assertTrue(regex.match(query), "{} did not match {} ({})".format(query, regex_string, index)) # ---------------------------------------------------------------------- Test(lambda: RegularExpressionVisitor.OnBool(None), [ "True", "T", "t", "Yes", "yes", "Y", "y", "1", "False", "false", "F", "f", "No", "no", "N", "n", "0", ]) Test(lambda: RegularExpressionVisitor.OnDateTime(None), [ "2018-04-26 22:29:00", "2018-04-26T22:29:00", "2018-04-26T22:29:00Z", "2018-04-26T22:29:00+08:00", "2018-04-26T22:29:00-10:34", ]) Test(lambda: RegularExpressionVisitor.OnDate(None), [ "2018-04-26", "2018/04/26", "2018.04.26", ], regex_index=0) Test(lambda: RegularExpressionVisitor.OnDate(None), [ "04-26-2018", "04/26/2018", "04.26.2018", ], regex_index=1) Test(lambda: RegularExpressionVisitor.OnDate(None), [ "18-04-26", "18/04/26", "18.04.26", ], regex_index=2) Test(lambda: RegularExpressionVisitor.OnDate(None), [ "04-26-18", "04/26/18", "04.26.18", ], regex_index=3) Test(lambda: RegularExpressionVisitor.OnDirectory(None), "anything") Test(lambda: RegularExpressionVisitor.OnDuration(None), [ "1.0:00:00.0", "1:0:00:00.0", "1.00:00:00", "1:00:00.0", "23:22:21", "23:22:21.20", ], regex_index=0) Test(lambda: RegularExpressionVisitor.OnDuration(None), [ "P1Y", "P1MT2H", "PT1M", ], regex_index=1) Test(lambda: RegularExpressionVisitor.OnDuration(None), [ "1", "1.2345", "3.4", ], regex_index=2) Test(lambda: RegularExpressionVisitor.OnEnum(EnumTypeInfo([ "one", "two", ])), [ "one", "two", ]) Test(lambda: RegularExpressionVisitor.OnFilename(None), "anything") Test(lambda: RegularExpressionVisitor.OnFloat(FloatTypeInfo()), [ "0.0", "10.2", "-3.14", ]) Test(lambda: RegularExpressionVisitor.OnGuid(None), "{54465641-ADF2-43B1-98EB-66BBD208622C}", regex_index=0) Test(lambda: RegularExpressionVisitor.OnGuid(None), "54465641-ADF2-43B1-98EB-66BBD208622C", regex_index=1) Test(lambda: RegularExpressionVisitor.OnGuid(None), "{54465641ADF243B198EB66BBD208622C}", regex_index=2) Test(lambda: RegularExpressionVisitor.OnGuid(None), "54465641ADF243B198EB66BBD208622C", regex_index=3) Test(lambda: RegularExpressionVisitor.OnInt(IntTypeInfo()), [ "-10", "10", "0", "20", ]) Test(lambda: RegularExpressionVisitor.OnString(StringTypeInfo()), [ "test", "again", "and another", ]) Test(lambda: RegularExpressionVisitor.OnTime(None), [ "11:22:33", "11:22:33.44", "11:22:33", ]) Test(lambda: RegularExpressionVisitor.OnUri(None), "http://one.two.three") # ---------------------------------------------------------------------- def test_Float(self): self.assertFalse(re.match("^{}$".format(RegularExpressionVisitor.OnFloat(FloatTypeInfo(min=0))[0]), "-3.0")) self.assertFalse(re.match("^{}$".format(RegularExpressionVisitor.OnFloat(FloatTypeInfo(max=0))[0]), "3.0")) self.assertFalse(re.match("^{}$".format(RegularExpressionVisitor.OnFloat(FloatTypeInfo(min=0, max=10))[0]), "130.01234")) # ---------------------------------------------------------------------- def test_Int(self): self.assertFalse(re.match("^{}$".format(RegularExpressionVisitor.OnInt(IntTypeInfo(min=0))[0]), "-3")) self.assertFalse(re.match("^{}$".format(RegularExpressionVisitor.OnInt(IntTypeInfo(max=0))[0]), "3")) self.assertFalse(re.match("^{}$".format(RegularExpressionVisitor.OnInt(IntTypeInfo(min=0, max=9))[0]), "130")) # ---------------------------------------------------------------------- def test_String(self): regex = re.compile("^{}$".format(RegularExpressionVisitor.OnString(StringTypeInfo(min_length=2))[0])) self.assertTrue(regex.match("123")) self.assertTrue(regex.match("12")) self.assertFalse(regex.match("1")) regex = re.compile("^{}$".format(RegularExpressionVisitor.OnString(StringTypeInfo(max_length=2))[0])) self.assertTrue(regex.match("12")) self.assertFalse(regex.match("123")) regex = re.compile("^{}$".format(RegularExpressionVisitor.OnString(StringTypeInfo(min_length=2, max_length=3))[0])) self.assertTrue(regex.match("123")) self.assertTrue(regex.match("12")) self.assertFalse(regex.match("1234")) self.assertFalse(regex.match("1")) regex = re.compile("^{}$".format(RegularExpressionVisitor.OnString(StringTypeInfo(validation_expression=".est"))[0])) self.assertTrue(regex.match("test")) self.assertTrue(regex.match("Test")) self.assertTrue(regex.match("jest")) self.assertFalse(regex.match("tEst")) # ---------------------------------------------------------------------- class SerializationSuite(unittest.TestCase): # ---------------------------------------------------------------------- def test_Bool(self): self.assertEqual(StringSerialization.SerializeItem(BoolTypeInfo(), True), "True") self.assertEqual(StringSerialization.SerializeItem(BoolTypeInfo(), False), "False") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(BoolTypeInfo(), "this is not a bool")) # ---------------------------------------------------------------------- def test_DateTime(self): self.assertEqual(StringSerialization.SerializeItem(DateTimeTypeInfo(), datetime.datetime(year=2018, month=4, day=28, hour=14, minute=46, second=12)), "2018-04-28 14:46:12") self.assertEqual(StringSerialization.SerializeItem(DateTimeTypeInfo(), datetime.datetime(year=2018, month=4, day=28, hour=14, minute=46, second=12), sep='T'), "2018-04-28T14:46:12") self.assertEqual(StringSerialization.SerializeItem(DateTimeTypeInfo(), datetime.datetime(year=2018, month=4, day=28, hour=14, minute=46, second=12, microsecond=3939)), "2018-04-28 14:46:12.003939") self.assertEqual(StringSerialization.SerializeItem(DateTimeTypeInfo(), datetime.datetime(year=2018, month=4, day=28, hour=14, minute=46, second=12, microsecond=3939), microseconds=False), "2018-04-28 14:46:12") self.assertEqual(StringSerialization.SerializeItem(DateTimeTypeInfo(), datetime.datetime(year=2018, month=4, day=28, hour=14, minute=46, second=12), regex_index=1), "@1524951972.0 00:00") self.assertEqual(StringSerialization.SerializeItem(DateTimeTypeInfo(), datetime.datetime(year=2018, month=4, day=28, hour=14, minute=46, second=12), regex_index=2), "1524951972.0") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(DateTimeTypeInfo(), "this is not a datetime")) # ---------------------------------------------------------------------- def test_Date(self): self.assertEqual(StringSerialization.SerializeItem(DateTypeInfo(), datetime.date(year=2018, month=4, day=28)), "2018-04-28") self.assertEqual(StringSerialization.SerializeItem(DateTypeInfo(), datetime.date(year=2018, month=4, day=28), regex_index=1), "04-28-2018") self.assertEqual(StringSerialization.SerializeItem(DateTypeInfo(), datetime.date(year=2018, month=4, day=28), regex_index=2), "18-04-28") self.assertEqual(StringSerialization.SerializeItem(DateTypeInfo(), datetime.date(year=2018, month=4, day=28), regex_index=3), "04-28-18") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(DateTypeInfo(), "this is not a valid date")) # ---------------------------------------------------------------------- def test_Directory(self): self.assertEqual(StringSerialization.SerializeItem(DirectoryTypeInfo(ensure_exists=False), os.path.join("foo", "bar")), "foo/bar") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(DirectoryTypeInfo(), os.path.join("foo", "bar"))) # ---------------------------------------------------------------------- def test_Duration(self): self.assertEqual(StringSerialization.SerializeItem(DurationTypeInfo(), datetime.timedelta(hours=2)), "2:00:00") self.assertEqual(StringSerialization.SerializeItem(DurationTypeInfo(), datetime.timedelta(days=1, hours=2)), "1.02:00:00") self.assertEqual(StringSerialization.SerializeItem(DurationTypeInfo(), datetime.timedelta(days=1, hours=2), regex_index=1), "P1DT2H0M0S") self.assertEqual(StringSerialization.SerializeItem(DurationTypeInfo(), datetime.timedelta(days=1, hours=2), sep=':'), "1:02:00:00") self.assertEqual(StringSerialization.SerializeItem(DurationTypeInfo(), datetime.timedelta(days=1, hours=2, microseconds=3456)), "1.02:00:00.003456") self.assertEqual(StringSerialization.SerializeItem(DurationTypeInfo(), datetime.timedelta(hours=2), regex_index=2), "7200") self.assertEqual(StringSerialization.SerializeItem(DurationTypeInfo(), datetime.timedelta(hours=2, microseconds=3456), regex_index=2), "7200.003456") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(DurationTypeInfo(), "this is not a valid duration")) # ---------------------------------------------------------------------- def test_Enum(self): self.assertEqual(StringSerialization.SerializeItem(EnumTypeInfo([ "one", "two", ]), "one"), "one") self.assertEqual(StringSerialization.SerializeItem(EnumTypeInfo([ "one", "two", ]), "two"), "two") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(EnumTypeInfo([ "one", "two", ]), "three")) # ---------------------------------------------------------------------- def test_Filename(self): self.assertEqual(StringSerialization.SerializeItem(FilenameTypeInfo(ensure_exists=False), os.path.join("foo", "bar")), "foo/bar") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(FilenameTypeInfo(), os.path.join("foo", "bar"))) # ---------------------------------------------------------------------- def test_Float(self): self.assertEqual(StringSerialization.SerializeItem(FloatTypeInfo(), -10.5), "-10.5") self.assertEqual(StringSerialization.SerializeItem(FloatTypeInfo(), 10), "10") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(FloatTypeInfo(), "this is not a valid float")) self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(FloatTypeInfo(min=0), -10)) self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(FloatTypeInfo(max=10), 20)) # ---------------------------------------------------------------------- def test_Guid(self): self.assertEqual(StringSerialization.SerializeItem(GuidTypeInfo(), uuid.UUID("363D3427-1871-40C5-83DF-3C9D5CE7B60D")), "{363D3427-1871-40C5-83DF-3C9D5CE7B60D}".lower()) self.assertEqual(StringSerialization.SerializeItem(GuidTypeInfo(), uuid.UUID("363D3427-1871-40C5-83DF-3C9D5CE7B60D"), regex_index=1), "363D3427-1871-40C5-83DF-3C9D5CE7B60D".lower()) self.assertEqual(StringSerialization.SerializeItem(GuidTypeInfo(), uuid.UUID("363D3427-1871-40C5-83DF-3C9D5CE7B60D"), regex_index=2), "{363D3427187140C583DF3C9D5CE7B60D}".lower()) self.assertEqual(StringSerialization.SerializeItem(GuidTypeInfo(), uuid.UUID("363D3427-1871-40C5-83DF-3C9D5CE7B60D"), regex_index=3), "363D3427187140C583DF3C9D5CE7B60D".lower()) self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(GuidTypeInfo(), "this is not a valid guid")) # ---------------------------------------------------------------------- def test_Int(self): self.assertEqual(StringSerialization.SerializeItem(IntTypeInfo(), 20), "20") self.assertEqual(StringSerialization.SerializeItem(IntTypeInfo(), -20), "-20") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(IntTypeInfo(), "this is not a valid int")) self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(IntTypeInfo(min=0), -10)) self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(IntTypeInfo(max=10), 20)) # ---------------------------------------------------------------------- def test_String(self): self.assertEqual(StringSerialization.SerializeItem(StringTypeInfo(), "test"), "test") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(StringTypeInfo(), 10)) self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(StringTypeInfo(min_length=2), "1")) self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(StringTypeInfo(max_length=2), "123")) self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(StringTypeInfo(validation_expression="test"), "TEST")) # ---------------------------------------------------------------------- def test_Time(self): self.assertEqual(StringSerialization.SerializeItem(TimeTypeInfo(), datetime.time(hour=15, minute=15, second=12)), "15:15:12") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(TimeTypeInfo(), "this is not a valid time")) # ---------------------------------------------------------------------- def test_Uri(self): self.assertEqual(StringSerialization.SerializeItem(UriTypeInfo(), Uri.FromString("https://foo.bar.baz")), "https://foo.bar.baz") self.assertRaises(ValidationException, lambda: StringSerialization.SerializeItem(UriTypeInfo(), "this is not a valid uri")) # ---------------------------------------------------------------------- class DeserializationSuite(unittest.TestCase): # ---------------------------------------------------------------------- def test_Bool(self): self.assertTrue(StringSerialization.DeserializeItem(BoolTypeInfo(), "true")) self.assertTrue(StringSerialization.DeserializeItem(BoolTypeInfo(), "t")) self.assertTrue(StringSerialization.DeserializeItem(BoolTypeInfo(), "yes")) self.assertTrue(StringSerialization.DeserializeItem(BoolTypeInfo(), "y")) self.assertTrue(StringSerialization.DeserializeItem(BoolTypeInfo(), "1")) self.assertFalse(StringSerialization.DeserializeItem(BoolTypeInfo(), "false")) self.assertFalse(StringSerialization.DeserializeItem(BoolTypeInfo(), "f")) self.assertFalse(StringSerialization.DeserializeItem(BoolTypeInfo(), "no")) self.assertFalse(StringSerialization.DeserializeItem(BoolTypeInfo(), "n")) self.assertFalse(StringSerialization.DeserializeItem(BoolTypeInfo(), "0")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(BoolTypeInfo(), "not_valid")) # ---------------------------------------------------------------------- def test_DateTime(self): self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04-28 10:05:00"), datetime.datetime(year=2018, month=4, day=28, hour=10, minute=5, second=0)) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04-28T10:05:00"), datetime.datetime(year=2018, month=4, day=28, hour=10, minute=5, second=0)) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "1528171793"), datetime.datetime(2018, 6, 5, 4, 9, 53)) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "@1528171793 -0700"), datetime.datetime(2018, 6, 5, 11, 9, 53)) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "@1528171793 +0700"), datetime.datetime(2018, 6, 4, 21, 9, 53)) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "@1528171793 0700"), datetime.datetime(2018, 6, 4, 21, 9, 53)) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "1528171793.0"), datetime.datetime(2018, 6, 5, 4, 9, 53)) # python2 doesn't support deserialization with non-UTC time zones if sys.version_info[0] == 2: self.assertRaises( ValueError, # "'z' is a bad directive in format.+", lambda: StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04-28T10:05:00-0700"), ) else: self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04-28T10:05:31.00Z"), datetime.datetime(year=2018, month=4, day=28, hour=10, minute=5, second=31, tzinfo=datetime.timezone.utc)) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04-28T10:05:31.0000Z"), datetime.datetime(year=2018, month=4, day=28, hour=10, minute=5, second=31, tzinfo=datetime.timezone.utc)) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04-28T10:05:00-0700"), datetime.datetime(year=2018, month=4, day=28, hour=10, minute=5, second=0, tzinfo=datetime.timezone(datetime.timedelta(hours=-7)))) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04-28T10:05:00-07:00"), datetime.datetime(year=2018, month=4, day=28, hour=10, minute=5, second=0, tzinfo=datetime.timezone(datetime.timedelta(hours=-7)))) self.assertEqual(StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04-28T10:05:31.000-07:00"), datetime.datetime(year=2018, month=4, day=28, hour=10, minute=5, second=31, tzinfo=datetime.timezone(datetime.timedelta(hours=-7)))) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(DateTimeTypeInfo(), "not a valid datetime")) # ---------------------------------------------------------------------- def test_Date(self): self.assertEqual(StringSerialization.DeserializeItem(DateTypeInfo(), "2018-04-28"), datetime.date(year=2018, month=4, day=28)) self.assertEqual(StringSerialization.DeserializeItem(DateTypeInfo(), "04-28-2018"), datetime.date(year=2018, month=4, day=28)) self.assertEqual(StringSerialization.DeserializeItem(DateTypeInfo(), "18-04-28"), datetime.date(year=2018, month=4, day=28)) self.assertEqual(StringSerialization.DeserializeItem(DateTypeInfo(), "04-28-18"), datetime.date(year=2018, month=4, day=28)) self.assertEqual(StringSerialization.DeserializeItem(DateTypeInfo(), "2018.04.28"), datetime.date(year=2018, month=4, day=28)) self.assertEqual(StringSerialization.DeserializeItem(DateTypeInfo(), "04.28.2018"), datetime.date(year=2018, month=4, day=28)) self.assertEqual(StringSerialization.DeserializeItem(DateTypeInfo(), "18.04.28"), datetime.date(year=2018, month=4, day=28)) self.assertEqual(StringSerialization.DeserializeItem(DateTypeInfo(), "04.28.18"), datetime.date(year=2018, month=4, day=28)) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(DateTimeTypeInfo(), "2018-04.28")) # ---------------------------------------------------------------------- def test_Directory(self): self.assertEqual(StringSerialization.DeserializeItem(DirectoryTypeInfo(ensure_exists=False), "foo/bar"), os.path.realpath(os.path.normpath(os.path.join("foo", "bar")))) self.assertEqual(StringSerialization.DeserializeItem(DirectoryTypeInfo(ensure_exists=False), "foo/bar", normalize=False), os.path.join("foo", "bar")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(DirectoryTypeInfo(), '')) # ---------------------------------------------------------------------- def test_Duration(self): self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "1.02:03:04"), datetime.timedelta(days=1, hours=2, minutes=3, seconds=4)) self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "1:02:03:04"), datetime.timedelta(days=1, hours=2, minutes=3, seconds=4)) self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "02:03:04"), datetime.timedelta(hours=2, minutes=3, seconds=4)) self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "1.02:03:04.5"), datetime.timedelta(days=1, hours=2, minutes=3, seconds=4, microseconds=5)) self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "1:02:03:04.5"), datetime.timedelta(days=1, hours=2, minutes=3, seconds=4, microseconds=5)) self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "02:03:04.5"), datetime.timedelta(hours=2, minutes=3, seconds=4, microseconds=5)) self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "P2DT3M21S"), datetime.timedelta(days=2, minutes=3, seconds=21)) self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "5"), datetime.timedelta(seconds=5)) self.assertEqual(StringSerialization.DeserializeItem(DurationTypeInfo(), "1.234"), datetime.timedelta(seconds=1, microseconds=234)) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(DurationTypeInfo(), "not a valid duration")) # ---------------------------------------------------------------------- def test_Enum(self): self.assertEqual(StringSerialization.DeserializeItem(EnumTypeInfo([ "one", "two", ]), "one"), "one") self.assertEqual(StringSerialization.DeserializeItem(EnumTypeInfo([ "one", "two", ]), "two"), "two") self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(EnumTypeInfo([ "one", "two", ]), "three")) # ---------------------------------------------------------------------- def test_Filename(self): self.assertEqual(StringSerialization.DeserializeItem(FilenameTypeInfo(ensure_exists=False), "foo/bar"), os.path.realpath(os.path.normpath(os.path.join("foo", "bar")))) self.assertEqual(StringSerialization.DeserializeItem(FilenameTypeInfo(ensure_exists=False), "foo/bar", normalize=False), os.path.join("foo", "bar")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(DirectoryTypeInfo(), '')) # ---------------------------------------------------------------------- def test_Float(self): self.assertEqual(StringSerialization.DeserializeItem(FloatTypeInfo(), "10.5"), 10.5) self.assertEqual(StringSerialization.DeserializeItem(FloatTypeInfo(), "10"), 10.0) self.assertEqual(StringSerialization.DeserializeItem(FloatTypeInfo(), "-10.5"), -10.5) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(FloatTypeInfo(), "not a valid float")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(FloatTypeInfo(min=0), "-10.5")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(FloatTypeInfo(max=10), "100.5")) # ---------------------------------------------------------------------- def test_Guid(self): self.assertEqual(StringSerialization.DeserializeItem(GuidTypeInfo(), "{9A3A5A9A-0755-4FAC-9019-176C609665C5}"), uuid.UUID("9A3A5A9A-0755-4FAC-9019-176C609665C5")) self.assertEqual(StringSerialization.DeserializeItem(GuidTypeInfo(), "9A3A5A9A-0755-4FAC-9019-176C609665C5"), uuid.UUID("9A3A5A9A-0755-4FAC-9019-176C609665C5")) self.assertEqual(StringSerialization.DeserializeItem(GuidTypeInfo(), "{9A3A5A9A07554FAC9019176C609665C5}"), uuid.UUID("9A3A5A9A-0755-4FAC-9019-176C609665C5")) self.assertEqual(StringSerialization.DeserializeItem(GuidTypeInfo(), "9A3A5A9A07554FAC9019176C609665C5"), uuid.UUID("9A3A5A9A-0755-4FAC-9019-176C609665C5")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(GuidTypeInfo(), "not a valid guid")) # ---------------------------------------------------------------------- def test_Int(self): self.assertEqual(StringSerialization.DeserializeItem(IntTypeInfo(), "10"), 10) self.assertEqual(StringSerialization.DeserializeItem(IntTypeInfo(), "-10"), -10) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(IntTypeInfo(), "not a valid int")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(IntTypeInfo(min=0), "-10")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(IntTypeInfo(max=10), "100")) # ---------------------------------------------------------------------- def test_String(self): self.assertEqual(StringSerialization.DeserializeItem(StringTypeInfo(), "foo"), "foo") self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(StringTypeInfo(), "")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(StringTypeInfo(min_length=2), "1")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(StringTypeInfo(max_length=2), "123")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(StringTypeInfo(validation_expression="test"), "not test")) # ---------------------------------------------------------------------- def test_Time(self): self.assertEqual(StringSerialization.DeserializeItem(TimeTypeInfo(), "10:15:01"), datetime.time(hour=10, minute=15, second=1)) self.assertEqual(StringSerialization.DeserializeItem(TimeTypeInfo(), "10:15:01.678"), datetime.time(hour=10, minute=15, second=1, microsecond=678000)) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(TimeTypeInfo(), "not a valid time")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(TimeTypeInfo(), "10:15:01+10:30")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(TimeTypeInfo(), "10:15:01-03:13")) # ---------------------------------------------------------------------- def test_Uri(self): self.assertEqual(StringSerialization.DeserializeItem(UriTypeInfo(), "https://foo.bar.baz"), Uri.FromString("https://foo.bar.baz")) self.assertRaises(ValidationException, lambda: StringSerialization.DeserializeItem(UriTypeInfo(), "not a valid uri")) # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- if __name__ == "__main__": try: sys.exit(unittest.main(verbosity=2)) except KeyboardInterrupt: pass
[ 1, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 29937, 891, 30004, 13, 29937, 891, 29871, 1714, 9125, 2133, 29918, 8325, 3057, 29889, 2272, 30004, 13, 29937, 891, 30004, 13, 29937, 891, 29871, 529, 5813, 29958, 3532, 26862, 6227, 29958, 3238, 13, 29937, 891, 539, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29953, 29871, 29906, 29906, 29901, 29900, 29953, 29901, 29896, 29947, 30004, 13, 29937, 891, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 29937, 891, 30004, 13, 29937, 891, 29871, 14187, 1266, 529, 5813, 29958, 29871, 29906, 29900, 29896, 29947, 29899, 29906, 29906, 22993, 13, 29937, 891, 29871, 6652, 7541, 1090, 278, 1952, 520, 18540, 19245, 29892, 10079, 29871, 29896, 29889, 29900, 22993, 13, 29937, 891, 29871, 313, 13393, 10259, 1384, 292, 934, 365, 2965, 1430, 1660, 29918, 29896, 29918, 29900, 29889, 3945, 470, 3509, 472, 1732, 597, 1636, 29889, 17079, 29889, 990, 29914, 27888, 1430, 1660, 29918, 29896, 29918, 29900, 29889, 3945, 8443, 13, 29937, 891, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 29937, 9995, 8325, 1243, 363, 1714, 9125, 2133, 29889, 2272, 15945, 19451, 13, 30004, 13, 5215, 12865, 30004, 13, 5215, 2897, 30004, 13, 5215, 337, 30004, 13, 5215, 10876, 30004, 13, 5215, 443, 27958, 30004, 13, 5215, 318, 5416, 30004, 13, 30004, 13, 5215, 13103, 18649, 30004, 13, 3166, 13103, 18649, 29889, 1542, 3401, 29889, 29943, 870, 11491, 10562, 29889, 3596, 1053, 334, 30004, 13, 3166, 13103, 18649, 29889, 1542, 3401, 29889, 29943, 870, 11491, 10562, 29889, 9125, 2133, 29889, 1231, 9125, 2133, 1053, 2169, 1070, 10960, 6116, 2105, 29892, 320, 30004, 13, 462, 462, 462, 462, 462, 3986, 1714, 9125, 2133, 29892, 320, 30004, 13, 462, 462, 462, 462, 462, 3986, 15758, 362, 2451, 30004, 13, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 29918, 2154, 29918, 8159, 2084, 353, 13103, 18649, 29889, 4013, 13658, 2084, 26471, 13, 29918, 2154, 29918, 3972, 29892, 903, 2154, 29918, 978, 353, 2897, 29889, 2084, 29889, 5451, 7373, 2154, 29918, 8159, 2084, 8443, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1990, 2169, 1070, 10960, 6116, 2105, 5091, 568, 29898, 348, 27958, 29889, 3057, 8259, 1125, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 15449, 29898, 1311, 1125, 30004, 13, 4706, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 4706, 822, 4321, 29898, 5696, 29892, 304, 29918, 4352, 29892, 6528, 29918, 2248, 29922, 29900, 1125, 30004, 13, 9651, 565, 451, 338, 8758, 29898, 517, 29918, 4352, 29892, 1051, 1125, 30004, 13, 18884, 304, 29918, 4352, 353, 518, 304, 29918, 4352, 29892, 4514, 30004, 13, 30004, 13, 9651, 6528, 29918, 1807, 353, 1158, 580, 29961, 13087, 29918, 2248, 29962, 30004, 13, 30004, 13, 9651, 565, 338, 8758, 29898, 13087, 29918, 1807, 29892, 18761, 1125, 30004, 13, 18884, 6528, 29918, 1807, 29892, 6528, 29918, 6768, 353, 6528, 29918, 1807, 30004, 13, 9651, 1683, 29901, 30004, 13, 18884, 6528, 29918, 6768, 353, 29871, 29900, 30004, 13, 30004, 13, 9651, 6528, 353, 337, 29889, 12198, 703, 998, 1042, 1642, 4830, 29898, 13087, 29918, 1807, 511, 6528, 29918, 6768, 8443, 13, 30004, 13, 9651, 363, 2380, 29892, 2346, 297, 26985, 29898, 517, 29918, 4352, 1125, 30004, 13, 18884, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 29898, 1972, 511, 376, 8875, 1258, 451, 1993, 6571, 21313, 1800, 1642, 4830, 29898, 1972, 29892, 6528, 29918, 1807, 29892, 2380, 876, 30004, 13, 30004, 13, 4706, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 24693, 29898, 8516, 511, 518, 376, 5574, 613, 376, 29911, 613, 376, 29873, 613, 376, 8241, 613, 376, 3582, 613, 376, 29979, 613, 376, 29891, 613, 376, 29896, 613, 376, 8824, 613, 376, 4541, 613, 376, 29943, 613, 376, 29888, 613, 376, 3782, 613, 376, 1217, 613, 376, 29940, 613, 376, 29876, 613, 376, 29900, 613, 29871, 2314, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 11384, 29898, 8516, 511, 518, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29953, 29871, 29906, 29906, 29901, 29906, 29929, 29901, 29900, 29900, 613, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29953, 29911, 29906, 29906, 29901, 29906, 29929, 29901, 29900, 29900, 613, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29953, 29911, 29906, 29906, 29901, 29906, 29929, 29901, 29900, 29900, 29999, 613, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29953, 29911, 29906, 29906, 29901, 29906, 29929, 29901, 29900, 29900, 29974, 29900, 29947, 29901, 29900, 29900, 613, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29953, 29911, 29906, 29906, 29901, 29906, 29929, 29901, 29900, 29900, 29899, 29896, 29900, 29901, 29941, 29946, 613, 29871, 2314, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 2539, 29898, 8516, 511, 518, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29953, 613, 376, 29906, 29900, 29896, 29947, 29914, 29900, 29946, 29914, 29906, 29953, 613, 376, 29906, 29900, 29896, 29947, 29889, 29900, 29946, 29889, 29906, 29953, 613, 21251, 6528, 29918, 2248, 29922, 29900, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 2539, 29898, 8516, 511, 518, 376, 29900, 29946, 29899, 29906, 29953, 29899, 29906, 29900, 29896, 29947, 613, 376, 29900, 29946, 29914, 29906, 29953, 29914, 29906, 29900, 29896, 29947, 613, 376, 29900, 29946, 29889, 29906, 29953, 29889, 29906, 29900, 29896, 29947, 613, 21251, 6528, 29918, 2248, 29922, 29896, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 2539, 29898, 8516, 511, 518, 376, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29953, 613, 376, 29896, 29947, 29914, 29900, 29946, 29914, 29906, 29953, 613, 376, 29896, 29947, 29889, 29900, 29946, 29889, 29906, 29953, 613, 21251, 6528, 29918, 2248, 29922, 29906, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 2539, 29898, 8516, 511, 518, 376, 29900, 29946, 29899, 29906, 29953, 29899, 29896, 29947, 613, 376, 29900, 29946, 29914, 29906, 29953, 29914, 29896, 29947, 613, 376, 29900, 29946, 29889, 29906, 29953, 29889, 29896, 29947, 613, 21251, 6528, 29918, 2248, 29922, 29941, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 9882, 29898, 8516, 511, 376, 1384, 1918, 1159, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 18984, 29898, 8516, 511, 518, 376, 29896, 29889, 29900, 29901, 29900, 29900, 29901, 29900, 29900, 29889, 29900, 613, 376, 29896, 29901, 29900, 29901, 29900, 29900, 29901, 29900, 29900, 29889, 29900, 613, 376, 29896, 29889, 29900, 29900, 29901, 29900, 29900, 29901, 29900, 29900, 613, 376, 29896, 29901, 29900, 29900, 29901, 29900, 29900, 29889, 29900, 613, 376, 29906, 29941, 29901, 29906, 29906, 29901, 29906, 29896, 613, 376, 29906, 29941, 29901, 29906, 29906, 29901, 29906, 29896, 29889, 29906, 29900, 613, 21251, 6528, 29918, 2248, 29922, 29900, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 18984, 29898, 8516, 511, 518, 376, 29925, 29896, 29979, 613, 376, 29925, 29896, 11490, 29906, 29950, 613, 376, 7982, 29896, 29924, 613, 21251, 6528, 29918, 2248, 29922, 29896, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 18984, 29898, 8516, 511, 518, 376, 29896, 613, 376, 29896, 29889, 29906, 29941, 29946, 29945, 613, 376, 29941, 29889, 29946, 613, 21251, 6528, 29918, 2248, 29922, 29906, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 16854, 29898, 16854, 1542, 3401, 4197, 376, 650, 613, 376, 10184, 613, 29871, 2314, 511, 518, 376, 650, 613, 376, 10184, 613, 29871, 2314, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 3434, 3871, 29898, 8516, 511, 376, 1384, 1918, 1159, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 11031, 29898, 11031, 1542, 3401, 25739, 518, 376, 29900, 29889, 29900, 613, 376, 29896, 29900, 29889, 29906, 613, 11663, 29941, 29889, 29896, 29946, 613, 29871, 2314, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 29954, 5416, 29898, 8516, 511, 29850, 29945, 29946, 29946, 29953, 29945, 29953, 29946, 29896, 29899, 3035, 29943, 29906, 29899, 29946, 29941, 29933, 29896, 29899, 29929, 29947, 25752, 29899, 29953, 29953, 14388, 29928, 29906, 29900, 29947, 29953, 29906, 29906, 29907, 17671, 6528, 29918, 2248, 29922, 29900, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 29954, 5416, 29898, 8516, 511, 376, 29945, 29946, 29946, 29953, 29945, 29953, 29946, 29896, 29899, 3035, 29943, 29906, 29899, 29946, 29941, 29933, 29896, 29899, 29929, 29947, 25752, 29899, 29953, 29953, 14388, 29928, 29906, 29900, 29947, 29953, 29906, 29906, 29907, 613, 6528, 29918, 2248, 29922, 29896, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 29954, 5416, 29898, 8516, 511, 29850, 29945, 29946, 29946, 29953, 29945, 29953, 29946, 29896, 3035, 29943, 29906, 29946, 29941, 29933, 29896, 29929, 29947, 25752, 29953, 29953, 14388, 29928, 29906, 29900, 29947, 29953, 29906, 29906, 29907, 17671, 6528, 29918, 2248, 29922, 29906, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 29954, 5416, 29898, 8516, 511, 376, 29945, 29946, 29946, 29953, 29945, 29953, 29946, 29896, 3035, 29943, 29906, 29946, 29941, 29933, 29896, 29929, 29947, 25752, 29953, 29953, 14388, 29928, 29906, 29900, 29947, 29953, 29906, 29906, 29907, 613, 6528, 29918, 2248, 29922, 29941, 8443, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 2928, 29898, 2928, 1542, 3401, 25739, 518, 11663, 29896, 29900, 613, 376, 29896, 29900, 613, 376, 29900, 613, 376, 29906, 29900, 613, 29871, 2314, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 1231, 29898, 1231, 1542, 3401, 25739, 518, 376, 1688, 613, 376, 351, 475, 613, 376, 392, 1790, 613, 29871, 2314, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 2481, 29898, 8516, 511, 518, 376, 29896, 29896, 29901, 29906, 29906, 29901, 29941, 29941, 613, 376, 29896, 29896, 29901, 29906, 29906, 29901, 29941, 29941, 29889, 29946, 29946, 613, 376, 29896, 29896, 29901, 29906, 29906, 29901, 29941, 29941, 613, 29871, 2314, 30004, 13, 4706, 4321, 29898, 2892, 29901, 2169, 1070, 10960, 6116, 2105, 29889, 2951, 14702, 29898, 8516, 511, 376, 1124, 597, 650, 29889, 10184, 29889, 17536, 1159, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 11031, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 276, 29889, 4352, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 11031, 29898, 11031, 1542, 3401, 29898, 1195, 29922, 29900, 876, 29961, 29900, 11724, 11663, 29941, 29889, 29900, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 276, 29889, 4352, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 11031, 29898, 11031, 1542, 3401, 29898, 3317, 29922, 29900, 876, 29961, 29900, 11724, 376, 29941, 29889, 29900, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 276, 29889, 4352, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 11031, 29898, 11031, 1542, 3401, 29898, 1195, 29922, 29900, 29892, 4236, 29922, 29896, 29900, 876, 29961, 29900, 11724, 376, 29896, 29941, 29900, 29889, 29900, 29896, 29906, 29941, 29946, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 2928, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 276, 29889, 4352, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 2928, 29898, 2928, 1542, 3401, 29898, 1195, 29922, 29900, 876, 29961, 29900, 11724, 11663, 29941, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 276, 29889, 4352, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 2928, 29898, 2928, 1542, 3401, 29898, 3317, 29922, 29900, 876, 29961, 29900, 11724, 376, 29941, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 276, 29889, 4352, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 2928, 29898, 2928, 1542, 3401, 29898, 1195, 29922, 29900, 29892, 4236, 29922, 29929, 876, 29961, 29900, 11724, 376, 29896, 29941, 29900, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 1231, 29898, 1311, 1125, 30004, 13, 4706, 6528, 353, 337, 29889, 12198, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 1231, 29898, 1231, 1542, 3401, 29898, 1195, 29918, 2848, 29922, 29906, 876, 29961, 29900, 12622, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 703, 29896, 29906, 29941, 5783, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 703, 29896, 29906, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 13087, 29889, 4352, 703, 29896, 5783, 30004, 13, 30004, 13, 4706, 6528, 353, 337, 29889, 12198, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 1231, 29898, 1231, 1542, 3401, 29898, 3317, 29918, 2848, 29922, 29906, 876, 29961, 29900, 12622, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 703, 29896, 29906, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 13087, 29889, 4352, 703, 29896, 29906, 29941, 5783, 30004, 13, 30004, 13, 4706, 6528, 353, 337, 29889, 12198, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 1231, 29898, 1231, 1542, 3401, 29898, 1195, 29918, 2848, 29922, 29906, 29892, 4236, 29918, 2848, 29922, 29941, 876, 29961, 29900, 12622, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 703, 29896, 29906, 29941, 5783, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 703, 29896, 29906, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 13087, 29889, 4352, 703, 29896, 29906, 29941, 29946, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 13087, 29889, 4352, 703, 29896, 5783, 30004, 13, 30004, 13, 4706, 6528, 353, 337, 29889, 12198, 703, 998, 1042, 1642, 4830, 29898, 4597, 1070, 10960, 6116, 2105, 29889, 2951, 1231, 29898, 1231, 1542, 3401, 29898, 18157, 29918, 17471, 29569, 342, 5783, 29961, 29900, 12622, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 703, 1688, 5783, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 703, 3057, 5783, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 13087, 29889, 4352, 703, 29618, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 13087, 29889, 4352, 703, 29873, 12787, 5783, 30004, 13, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1990, 18896, 2133, 5091, 568, 29898, 348, 27958, 29889, 3057, 8259, 1125, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 24693, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 5852, 511, 376, 5574, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 7700, 511, 376, 8824, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 6120, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 11384, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29946, 29892, 11015, 29922, 29946, 29953, 29892, 1473, 29922, 29896, 29906, 8243, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29871, 29896, 29946, 29901, 29946, 29953, 29901, 29896, 29906, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29946, 29892, 11015, 29922, 29946, 29953, 29892, 1473, 29922, 29896, 29906, 511, 16345, 2433, 29911, 5477, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29911, 29896, 29946, 29901, 29946, 29953, 29901, 29896, 29906, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29946, 29892, 11015, 29922, 29946, 29953, 29892, 1473, 29922, 29896, 29906, 29892, 9200, 7496, 29922, 29941, 29929, 29941, 29929, 8243, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29871, 29896, 29946, 29901, 29946, 29953, 29901, 29896, 29906, 29889, 29900, 29900, 29941, 29929, 29941, 29929, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29946, 29892, 11015, 29922, 29946, 29953, 29892, 1473, 29922, 29896, 29906, 29892, 9200, 7496, 29922, 29941, 29929, 29941, 29929, 511, 9200, 23128, 29922, 8824, 511, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29871, 29896, 29946, 29901, 29946, 29953, 29901, 29896, 29906, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29946, 29892, 11015, 29922, 29946, 29953, 29892, 1473, 29922, 29896, 29906, 511, 6528, 29918, 2248, 29922, 29896, 511, 17962, 29896, 29945, 29906, 29946, 29929, 29945, 29896, 29929, 29955, 29906, 29889, 29900, 29871, 29900, 29900, 29901, 29900, 29900, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29946, 29892, 11015, 29922, 29946, 29953, 29892, 1473, 29922, 29896, 29906, 511, 6528, 29918, 2248, 29922, 29906, 511, 376, 29896, 29945, 29906, 29946, 29929, 29945, 29896, 29929, 29955, 29906, 29889, 29900, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 12865, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 2539, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 8243, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 511, 6528, 29918, 2248, 29922, 29896, 511, 376, 29900, 29946, 29899, 29906, 29947, 29899, 29906, 29900, 29896, 29947, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 511, 6528, 29918, 2248, 29922, 29906, 511, 376, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 511, 6528, 29918, 2248, 29922, 29941, 511, 376, 29900, 29946, 29899, 29906, 29947, 29899, 29896, 29947, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 2854, 2635, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 9882, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 9882, 1542, 3401, 29898, 7469, 29918, 9933, 29922, 8824, 511, 2897, 29889, 2084, 29889, 7122, 703, 5431, 613, 376, 1646, 1159, 511, 376, 5431, 29914, 1646, 1159, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 9882, 1542, 3401, 3285, 2897, 29889, 2084, 29889, 7122, 703, 5431, 613, 376, 1646, 29908, 4961, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 18984, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29906, 8243, 376, 29906, 29901, 29900, 29900, 29901, 29900, 29900, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29896, 29892, 6199, 29922, 29906, 8243, 376, 29896, 29889, 29900, 29906, 29901, 29900, 29900, 29901, 29900, 29900, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29896, 29892, 6199, 29922, 29906, 511, 6528, 29918, 2248, 29922, 29896, 511, 376, 29925, 29896, 12972, 29906, 29950, 29900, 29924, 29900, 29903, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29896, 29892, 6199, 29922, 29906, 511, 16345, 29922, 2396, 5477, 376, 29896, 29901, 29900, 29906, 29901, 29900, 29900, 29901, 29900, 29900, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29896, 29892, 6199, 29922, 29906, 29892, 9200, 23128, 29922, 29941, 29946, 29945, 29953, 8243, 376, 29896, 29889, 29900, 29906, 29901, 29900, 29900, 29901, 29900, 29900, 29889, 29900, 29900, 29941, 29946, 29945, 29953, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29906, 511, 6528, 29918, 2248, 29922, 29906, 511, 376, 29955, 29906, 29900, 29900, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29906, 29892, 9200, 23128, 29922, 29941, 29946, 29945, 29953, 511, 6528, 29918, 2248, 29922, 29906, 511, 376, 29955, 29906, 29900, 29900, 29889, 29900, 29900, 29941, 29946, 29945, 29953, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 2854, 14385, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 16854, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 16854, 1542, 3401, 4197, 376, 650, 613, 376, 10184, 613, 4514, 511, 376, 650, 4968, 376, 650, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 16854, 1542, 3401, 4197, 376, 650, 613, 376, 10184, 613, 4514, 511, 376, 10184, 4968, 376, 10184, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 16854, 1542, 3401, 4197, 376, 650, 613, 376, 10184, 613, 4514, 511, 376, 17536, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 3434, 3871, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 3434, 3871, 1542, 3401, 29898, 7469, 29918, 9933, 29922, 8824, 511, 2897, 29889, 2084, 29889, 7122, 703, 5431, 613, 376, 1646, 1159, 511, 376, 5431, 29914, 1646, 1159, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 3434, 3871, 1542, 3401, 3285, 2897, 29889, 2084, 29889, 7122, 703, 5431, 613, 376, 1646, 29908, 4961, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 11031, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11031, 1542, 3401, 3285, 448, 29896, 29900, 29889, 29945, 511, 11663, 29896, 29900, 29889, 29945, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11031, 1542, 3401, 3285, 29871, 29896, 29900, 511, 376, 29896, 29900, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11031, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 2854, 5785, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11031, 1542, 3401, 29898, 1195, 29922, 29900, 511, 448, 29896, 29900, 876, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 11031, 1542, 3401, 29898, 3317, 29922, 29896, 29900, 511, 29871, 29906, 29900, 876, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 29954, 5416, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 318, 5416, 29889, 29965, 11150, 703, 29941, 29953, 29941, 29928, 29941, 29946, 29906, 29955, 29899, 29896, 29947, 29955, 29896, 29899, 29946, 29900, 29907, 29945, 29899, 29947, 29941, 4037, 29899, 29941, 29907, 29929, 29928, 29945, 4741, 29955, 29933, 29953, 29900, 29928, 1159, 511, 29850, 29941, 29953, 29941, 29928, 29941, 29946, 29906, 29955, 29899, 29896, 29947, 29955, 29896, 29899, 29946, 29900, 29907, 29945, 29899, 29947, 29941, 4037, 29899, 29941, 29907, 29929, 29928, 29945, 4741, 29955, 29933, 29953, 29900, 29928, 29913, 1642, 13609, 3101, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 318, 5416, 29889, 29965, 11150, 703, 29941, 29953, 29941, 29928, 29941, 29946, 29906, 29955, 29899, 29896, 29947, 29955, 29896, 29899, 29946, 29900, 29907, 29945, 29899, 29947, 29941, 4037, 29899, 29941, 29907, 29929, 29928, 29945, 4741, 29955, 29933, 29953, 29900, 29928, 4968, 6528, 29918, 2248, 29922, 29896, 511, 376, 29941, 29953, 29941, 29928, 29941, 29946, 29906, 29955, 29899, 29896, 29947, 29955, 29896, 29899, 29946, 29900, 29907, 29945, 29899, 29947, 29941, 4037, 29899, 29941, 29907, 29929, 29928, 29945, 4741, 29955, 29933, 29953, 29900, 29928, 1642, 13609, 3101, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 318, 5416, 29889, 29965, 11150, 703, 29941, 29953, 29941, 29928, 29941, 29946, 29906, 29955, 29899, 29896, 29947, 29955, 29896, 29899, 29946, 29900, 29907, 29945, 29899, 29947, 29941, 4037, 29899, 29941, 29907, 29929, 29928, 29945, 4741, 29955, 29933, 29953, 29900, 29928, 4968, 6528, 29918, 2248, 29922, 29906, 511, 29850, 29941, 29953, 29941, 29928, 29941, 29946, 29906, 29955, 29896, 29947, 29955, 29896, 29946, 29900, 29907, 29945, 29947, 29941, 4037, 29941, 29907, 29929, 29928, 29945, 4741, 29955, 29933, 29953, 29900, 29928, 29913, 1642, 13609, 3101, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 318, 5416, 29889, 29965, 11150, 703, 29941, 29953, 29941, 29928, 29941, 29946, 29906, 29955, 29899, 29896, 29947, 29955, 29896, 29899, 29946, 29900, 29907, 29945, 29899, 29947, 29941, 4037, 29899, 29941, 29907, 29929, 29928, 29945, 4741, 29955, 29933, 29953, 29900, 29928, 4968, 6528, 29918, 2248, 29922, 29941, 511, 376, 29941, 29953, 29941, 29928, 29941, 29946, 29906, 29955, 29896, 29947, 29955, 29896, 29946, 29900, 29907, 29945, 29947, 29941, 4037, 29941, 29907, 29929, 29928, 29945, 4741, 29955, 29933, 29953, 29900, 29928, 1642, 13609, 3101, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 2854, 16605, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 2928, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2928, 1542, 3401, 3285, 29871, 29906, 29900, 511, 376, 29906, 29900, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2928, 1542, 3401, 3285, 448, 29906, 29900, 511, 11663, 29906, 29900, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2928, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 2854, 938, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2928, 1542, 3401, 29898, 1195, 29922, 29900, 511, 448, 29896, 29900, 876, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2928, 1542, 3401, 29898, 3317, 29922, 29896, 29900, 511, 29871, 29906, 29900, 876, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 1231, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 1231, 1542, 3401, 3285, 376, 1688, 4968, 376, 1688, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 1231, 1542, 3401, 3285, 29871, 29896, 29900, 876, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 1231, 1542, 3401, 29898, 1195, 29918, 2848, 29922, 29906, 511, 376, 29896, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 1231, 1542, 3401, 29898, 3317, 29918, 2848, 29922, 29906, 511, 376, 29896, 29906, 29941, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 1231, 1542, 3401, 29898, 18157, 29918, 17471, 543, 1688, 4968, 376, 18267, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 2481, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2481, 1542, 3401, 3285, 12865, 29889, 2230, 29898, 18721, 29922, 29896, 29945, 29892, 11015, 29922, 29896, 29945, 29892, 1473, 29922, 29896, 29906, 8243, 376, 29896, 29945, 29901, 29896, 29945, 29901, 29896, 29906, 1159, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 2481, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 2854, 931, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 14702, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 14702, 1542, 3401, 3285, 21670, 29889, 4591, 1231, 703, 991, 597, 5431, 29889, 1646, 29889, 27975, 1159, 511, 376, 991, 597, 5431, 29889, 1646, 29889, 27975, 1159, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 1748, 6646, 2001, 29898, 14702, 1542, 3401, 3285, 376, 1366, 338, 451, 263, 2854, 21333, 5783, 30004, 13, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1990, 2726, 261, 616, 2133, 5091, 568, 29898, 348, 27958, 29889, 3057, 8259, 1125, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 24693, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 3009, 5783, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 29873, 5783, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 3582, 5783, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 29891, 5783, 30004, 13, 4706, 1583, 29889, 9294, 5574, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 29896, 5783, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 4541, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 29888, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 1217, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 29876, 5783, 30004, 13, 4706, 1583, 29889, 9294, 8824, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 29900, 5783, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 24693, 1542, 3401, 3285, 376, 1333, 29918, 3084, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 11384, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29871, 29896, 29900, 29901, 29900, 29945, 29901, 29900, 29900, 4968, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29900, 29892, 11015, 29922, 29945, 29892, 1473, 29922, 29900, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29911, 29896, 29900, 29901, 29900, 29945, 29901, 29900, 29900, 4968, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29900, 29892, 11015, 29922, 29945, 29892, 1473, 29922, 29900, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29896, 29945, 29906, 29947, 29896, 29955, 29896, 29955, 29929, 29941, 4968, 12865, 29889, 12673, 29898, 29906, 29900, 29896, 29947, 29892, 29871, 29953, 29892, 29871, 29945, 29892, 29871, 29946, 29892, 29871, 29929, 29892, 29871, 29945, 29941, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 17962, 29896, 29945, 29906, 29947, 29896, 29955, 29896, 29955, 29929, 29941, 448, 29900, 29955, 29900, 29900, 4968, 12865, 29889, 12673, 29898, 29906, 29900, 29896, 29947, 29892, 29871, 29953, 29892, 29871, 29945, 29892, 29871, 29896, 29896, 29892, 29871, 29929, 29892, 29871, 29945, 29941, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 17962, 29896, 29945, 29906, 29947, 29896, 29955, 29896, 29955, 29929, 29941, 718, 29900, 29955, 29900, 29900, 4968, 12865, 29889, 12673, 29898, 29906, 29900, 29896, 29947, 29892, 29871, 29953, 29892, 29871, 29946, 29892, 29871, 29906, 29896, 29892, 29871, 29929, 29892, 29871, 29945, 29941, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 17962, 29896, 29945, 29906, 29947, 29896, 29955, 29896, 29955, 29929, 29941, 29871, 29900, 29955, 29900, 29900, 4968, 12865, 29889, 12673, 29898, 29906, 29900, 29896, 29947, 29892, 29871, 29953, 29892, 29871, 29946, 29892, 29871, 29906, 29896, 29892, 29871, 29929, 29892, 29871, 29945, 29941, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29896, 29945, 29906, 29947, 29896, 29955, 29896, 29955, 29929, 29941, 29889, 29900, 4968, 12865, 29889, 12673, 29898, 29906, 29900, 29896, 29947, 29892, 29871, 29953, 29892, 29871, 29945, 29892, 29871, 29946, 29892, 29871, 29929, 29892, 29871, 29945, 29941, 876, 30004, 13, 30004, 13, 4706, 396, 3017, 29906, 1838, 29915, 29873, 2304, 16964, 616, 2133, 411, 1661, 29899, 26913, 931, 20542, 30004, 13, 4706, 565, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 1275, 29871, 29906, 29901, 30004, 13, 9651, 1583, 29889, 9294, 29934, 1759, 267, 29898, 30004, 13, 18884, 7865, 2392, 29892, 462, 396, 13577, 29920, 29915, 338, 263, 4319, 17041, 297, 3402, 29889, 29974, 15231, 13, 18884, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29911, 29896, 29900, 29901, 29900, 29945, 29901, 29900, 29900, 29899, 29900, 29955, 29900, 29900, 4968, 30004, 13, 9651, 1723, 30004, 13, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29911, 29896, 29900, 29901, 29900, 29945, 29901, 29941, 29896, 29889, 29900, 29900, 29999, 4968, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29900, 29892, 11015, 29922, 29945, 29892, 1473, 29922, 29941, 29896, 29892, 260, 29920, 3888, 29922, 12673, 29889, 2230, 8028, 29889, 329, 29883, 876, 30004, 13, 9651, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29911, 29896, 29900, 29901, 29900, 29945, 29901, 29941, 29896, 29889, 29900, 29900, 29900, 29900, 29999, 4968, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29900, 29892, 11015, 29922, 29945, 29892, 1473, 29922, 29941, 29896, 29892, 260, 29920, 3888, 29922, 12673, 29889, 2230, 8028, 29889, 329, 29883, 876, 30004, 13, 30004, 13, 9651, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29911, 29896, 29900, 29901, 29900, 29945, 29901, 29900, 29900, 29899, 29900, 29955, 29900, 29900, 4968, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29900, 29892, 11015, 29922, 29945, 29892, 1473, 29922, 29900, 29892, 260, 29920, 3888, 29922, 12673, 29889, 2230, 8028, 29898, 12673, 29889, 9346, 287, 2554, 29898, 29882, 2470, 10457, 29955, 13697, 30004, 13, 9651, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29911, 29896, 29900, 29901, 29900, 29945, 29901, 29900, 29900, 29899, 29900, 29955, 29901, 29900, 29900, 4968, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29900, 29892, 11015, 29922, 29945, 29892, 1473, 29922, 29900, 29892, 260, 29920, 3888, 29922, 12673, 29889, 2230, 8028, 29898, 12673, 29889, 9346, 287, 2554, 29898, 29882, 2470, 10457, 29955, 13697, 30004, 13, 9651, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 29911, 29896, 29900, 29901, 29900, 29945, 29901, 29941, 29896, 29889, 29900, 29900, 29900, 29899, 29900, 29955, 29901, 29900, 29900, 4968, 12865, 29889, 12673, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 29892, 7234, 29922, 29896, 29900, 29892, 11015, 29922, 29945, 29892, 1473, 29922, 29941, 29896, 29892, 260, 29920, 3888, 29922, 12673, 29889, 2230, 8028, 29898, 12673, 29889, 9346, 287, 2554, 29898, 29882, 2470, 10457, 29955, 13697, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 1333, 263, 2854, 12865, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 2539, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 4968, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 29900, 29946, 29899, 29906, 29947, 29899, 29906, 29900, 29896, 29947, 4968, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 29896, 29947, 29899, 29900, 29946, 29899, 29906, 29947, 4968, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 29900, 29946, 29899, 29906, 29947, 29899, 29896, 29947, 4968, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 876, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29889, 29900, 29946, 29889, 29906, 29947, 4968, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 29900, 29946, 29889, 29906, 29947, 29889, 29906, 29900, 29896, 29947, 4968, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 29896, 29947, 29889, 29900, 29946, 29889, 29906, 29947, 4968, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2539, 1542, 3401, 3285, 376, 29900, 29946, 29889, 29906, 29947, 29889, 29896, 29947, 4968, 12865, 29889, 1256, 29898, 6360, 29922, 29906, 29900, 29896, 29947, 29892, 4098, 29922, 29946, 29892, 2462, 29922, 29906, 29947, 876, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11384, 1542, 3401, 3285, 376, 29906, 29900, 29896, 29947, 29899, 29900, 29946, 29889, 29906, 29947, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 9882, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 9882, 1542, 3401, 29898, 7469, 29918, 9933, 29922, 8824, 511, 376, 5431, 29914, 1646, 4968, 2897, 29889, 2084, 29889, 6370, 2084, 29898, 359, 29889, 2084, 29889, 12324, 2084, 29898, 359, 29889, 2084, 29889, 7122, 703, 5431, 613, 376, 1646, 5783, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 9882, 1542, 3401, 29898, 7469, 29918, 9933, 29922, 8824, 511, 376, 5431, 29914, 1646, 613, 4226, 675, 29922, 8824, 511, 2897, 29889, 2084, 29889, 7122, 703, 5431, 613, 376, 1646, 5783, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 9882, 1542, 3401, 3285, 6629, 876, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 18984, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29896, 29889, 29900, 29906, 29901, 29900, 29941, 29901, 29900, 29946, 4968, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29896, 29892, 6199, 29922, 29906, 29892, 6233, 29922, 29941, 29892, 6923, 29922, 29946, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29896, 29901, 29900, 29906, 29901, 29900, 29941, 29901, 29900, 29946, 4968, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29896, 29892, 6199, 29922, 29906, 29892, 6233, 29922, 29941, 29892, 6923, 29922, 29946, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29900, 29906, 29901, 29900, 29941, 29901, 29900, 29946, 4968, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29906, 29892, 6233, 29922, 29941, 29892, 6923, 29922, 29946, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29896, 29889, 29900, 29906, 29901, 29900, 29941, 29901, 29900, 29946, 29889, 29945, 4968, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29896, 29892, 6199, 29922, 29906, 29892, 6233, 29922, 29941, 29892, 6923, 29922, 29946, 29892, 9200, 23128, 29922, 29945, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29896, 29901, 29900, 29906, 29901, 29900, 29941, 29901, 29900, 29946, 29889, 29945, 4968, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29896, 29892, 6199, 29922, 29906, 29892, 6233, 29922, 29941, 29892, 6923, 29922, 29946, 29892, 9200, 23128, 29922, 29945, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29900, 29906, 29901, 29900, 29941, 29901, 29900, 29946, 29889, 29945, 4968, 12865, 29889, 9346, 287, 2554, 29898, 29882, 2470, 29922, 29906, 29892, 6233, 29922, 29941, 29892, 6923, 29922, 29946, 29892, 9200, 23128, 29922, 29945, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29925, 29906, 12972, 29941, 29924, 29906, 29896, 29903, 4968, 12865, 29889, 9346, 287, 2554, 29898, 16700, 29922, 29906, 29892, 6233, 29922, 29941, 29892, 6923, 29922, 29906, 29896, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29945, 4968, 12865, 29889, 9346, 287, 2554, 29898, 23128, 29922, 29945, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 29896, 29889, 29906, 29941, 29946, 4968, 12865, 29889, 9346, 287, 2554, 29898, 23128, 29922, 29896, 29892, 9200, 23128, 29922, 29906, 29941, 29946, 876, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 18984, 1542, 3401, 3285, 376, 1333, 263, 2854, 14385, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 16854, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 16854, 1542, 3401, 4197, 376, 650, 613, 376, 10184, 613, 4514, 511, 376, 650, 4968, 376, 650, 1159, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 16854, 1542, 3401, 4197, 376, 650, 613, 376, 10184, 613, 4514, 511, 376, 10184, 4968, 376, 10184, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 16854, 1542, 3401, 4197, 376, 650, 613, 376, 10184, 613, 4514, 511, 376, 17536, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 3434, 3871, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 3434, 3871, 1542, 3401, 29898, 7469, 29918, 9933, 29922, 8824, 511, 376, 5431, 29914, 1646, 4968, 2897, 29889, 2084, 29889, 6370, 2084, 29898, 359, 29889, 2084, 29889, 12324, 2084, 29898, 359, 29889, 2084, 29889, 7122, 703, 5431, 613, 376, 1646, 5783, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 3434, 3871, 1542, 3401, 29898, 7469, 29918, 9933, 29922, 8824, 511, 376, 5431, 29914, 1646, 613, 4226, 675, 29922, 8824, 511, 2897, 29889, 2084, 29889, 7122, 703, 5431, 613, 376, 1646, 5783, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 9882, 1542, 3401, 3285, 6629, 876, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 11031, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11031, 1542, 3401, 3285, 376, 29896, 29900, 29889, 29945, 4968, 29871, 29896, 29900, 29889, 29945, 8443, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11031, 1542, 3401, 3285, 376, 29896, 29900, 4968, 29871, 29896, 29900, 29889, 29900, 8443, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11031, 1542, 3401, 3285, 11663, 29896, 29900, 29889, 29945, 4968, 448, 29896, 29900, 29889, 29945, 8443, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11031, 1542, 3401, 3285, 376, 1333, 263, 2854, 5785, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11031, 1542, 3401, 29898, 1195, 29922, 29900, 511, 11663, 29896, 29900, 29889, 29945, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 11031, 1542, 3401, 29898, 3317, 29922, 29896, 29900, 511, 376, 29896, 29900, 29900, 29889, 29945, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 29954, 5416, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 29850, 29929, 29909, 29941, 29909, 29945, 29909, 29929, 29909, 29899, 29900, 29955, 29945, 29945, 29899, 29946, 29943, 2477, 29899, 29929, 29900, 29896, 29929, 29899, 29896, 29955, 29953, 29907, 29953, 29900, 29929, 29953, 29953, 29945, 29907, 29945, 29913, 4968, 318, 5416, 29889, 29965, 11150, 703, 29929, 29909, 29941, 29909, 29945, 29909, 29929, 29909, 29899, 29900, 29955, 29945, 29945, 29899, 29946, 29943, 2477, 29899, 29929, 29900, 29896, 29929, 29899, 29896, 29955, 29953, 29907, 29953, 29900, 29929, 29953, 29953, 29945, 29907, 29945, 5783, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 376, 29929, 29909, 29941, 29909, 29945, 29909, 29929, 29909, 29899, 29900, 29955, 29945, 29945, 29899, 29946, 29943, 2477, 29899, 29929, 29900, 29896, 29929, 29899, 29896, 29955, 29953, 29907, 29953, 29900, 29929, 29953, 29953, 29945, 29907, 29945, 4968, 318, 5416, 29889, 29965, 11150, 703, 29929, 29909, 29941, 29909, 29945, 29909, 29929, 29909, 29899, 29900, 29955, 29945, 29945, 29899, 29946, 29943, 2477, 29899, 29929, 29900, 29896, 29929, 29899, 29896, 29955, 29953, 29907, 29953, 29900, 29929, 29953, 29953, 29945, 29907, 29945, 5783, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 29850, 29929, 29909, 29941, 29909, 29945, 29909, 29929, 29909, 29900, 29955, 29945, 29945, 29946, 29943, 2477, 29929, 29900, 29896, 29929, 29896, 29955, 29953, 29907, 29953, 29900, 29929, 29953, 29953, 29945, 29907, 29945, 29913, 4968, 318, 5416, 29889, 29965, 11150, 703, 29929, 29909, 29941, 29909, 29945, 29909, 29929, 29909, 29899, 29900, 29955, 29945, 29945, 29899, 29946, 29943, 2477, 29899, 29929, 29900, 29896, 29929, 29899, 29896, 29955, 29953, 29907, 29953, 29900, 29929, 29953, 29953, 29945, 29907, 29945, 5783, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 376, 29929, 29909, 29941, 29909, 29945, 29909, 29929, 29909, 29900, 29955, 29945, 29945, 29946, 29943, 2477, 29929, 29900, 29896, 29929, 29896, 29955, 29953, 29907, 29953, 29900, 29929, 29953, 29953, 29945, 29907, 29945, 4968, 318, 5416, 29889, 29965, 11150, 703, 29929, 29909, 29941, 29909, 29945, 29909, 29929, 29909, 29899, 29900, 29955, 29945, 29945, 29899, 29946, 29943, 2477, 29899, 29929, 29900, 29896, 29929, 29899, 29896, 29955, 29953, 29907, 29953, 29900, 29929, 29953, 29953, 29945, 29907, 29945, 5783, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 29954, 5416, 1542, 3401, 3285, 376, 1333, 263, 2854, 16605, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 2928, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2928, 1542, 3401, 3285, 376, 29896, 29900, 4968, 29871, 29896, 29900, 8443, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2928, 1542, 3401, 3285, 11663, 29896, 29900, 4968, 448, 29896, 29900, 8443, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2928, 1542, 3401, 3285, 376, 1333, 263, 2854, 938, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2928, 1542, 3401, 29898, 1195, 29922, 29900, 511, 11663, 29896, 29900, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2928, 1542, 3401, 29898, 3317, 29922, 29896, 29900, 511, 376, 29896, 29900, 29900, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 1231, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 1231, 1542, 3401, 3285, 376, 5431, 4968, 376, 5431, 1159, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 1231, 1542, 3401, 3285, 5124, 876, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 1231, 1542, 3401, 29898, 1195, 29918, 2848, 29922, 29906, 511, 376, 29896, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 1231, 1542, 3401, 29898, 3317, 29918, 2848, 29922, 29906, 511, 376, 29896, 29906, 29941, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 1231, 1542, 3401, 29898, 18157, 29918, 17471, 543, 1688, 4968, 376, 1333, 1243, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 2481, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2481, 1542, 3401, 3285, 376, 29896, 29900, 29901, 29896, 29945, 29901, 29900, 29896, 4968, 12865, 29889, 2230, 29898, 18721, 29922, 29896, 29900, 29892, 11015, 29922, 29896, 29945, 29892, 1473, 29922, 29896, 876, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2481, 1542, 3401, 3285, 376, 29896, 29900, 29901, 29896, 29945, 29901, 29900, 29896, 29889, 29953, 29955, 29947, 4968, 12865, 29889, 2230, 29898, 18721, 29922, 29896, 29900, 29892, 11015, 29922, 29896, 29945, 29892, 1473, 29922, 29896, 29892, 9200, 7496, 29922, 29953, 29955, 29947, 29900, 29900, 29900, 876, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2481, 1542, 3401, 3285, 376, 1333, 263, 2854, 931, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2481, 1542, 3401, 3285, 376, 29896, 29900, 29901, 29896, 29945, 29901, 29900, 29896, 29974, 29896, 29900, 29901, 29941, 29900, 5783, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 2481, 1542, 3401, 3285, 376, 29896, 29900, 29901, 29896, 29945, 29901, 29900, 29896, 29899, 29900, 29941, 29901, 29896, 29941, 5783, 30004, 13, 30004, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 1678, 822, 1243, 29918, 14702, 29898, 1311, 1125, 30004, 13, 4706, 1583, 29889, 9294, 9843, 29898, 1231, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 14702, 1542, 3401, 3285, 376, 991, 597, 5431, 29889, 1646, 29889, 27975, 4968, 21670, 29889, 4591, 1231, 703, 991, 597, 5431, 29889, 1646, 29889, 27975, 5783, 30004, 13, 30004, 13, 4706, 1583, 29889, 9294, 29934, 1759, 267, 29898, 19448, 2451, 29892, 14013, 29901, 1714, 9125, 2133, 29889, 4002, 261, 6646, 2001, 29898, 14702, 1542, 3401, 3285, 376, 1333, 263, 2854, 21333, 5783, 30004, 13, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 29937, 448, 2683, 2683, 2683, 2683, 23648, 30004, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 30004, 13, 1678, 1018, 29901, 10876, 29889, 13322, 29898, 348, 27958, 29889, 3396, 29898, 18248, 359, 537, 29922, 29906, 876, 30004, 13, 1678, 5174, 7670, 3377, 4074, 6685, 29901, 1209, 30004, 13, 2 ]
Kivy2.py
mcvenkat/Python-Programs
0
170428
<filename>Kivy2.py<gh_stars>0 import kivy from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import ObjectProperty from kivy.uix.label import Label from kivy.uix.floatlayout import FloatLayout from kivy.uix.popup import Popup class Widgets(Widget): def btn(self): show_popup() class P(FloatLayout): pass class MyApp(App): def build(self): return Widgets() def show_popup(): show = P() popupWindow = Popup(title="Popup Window", content=show, size_hint=(None,None),size=(400,400)) popupWindow.open() if __name__ == "__main__": MyApp().run() <Widgets>: Button: text: "Press me" on_release: root.btn() <P>: Label: text: "You pressed the button" size_hint: 0.6, 0.2 pos_hint: {"x":0.2, "top":1} Button: text: "You pressed the button" size_hint: 0.8, 0.2 pos_hint: {"x":0.1, "y":0.1}
[ 1, 529, 9507, 29958, 29968, 440, 29891, 29906, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 413, 440, 29891, 30004, 13, 3166, 413, 440, 29891, 29889, 932, 1053, 2401, 30004, 13, 3166, 413, 440, 29891, 29889, 29884, 861, 29889, 8030, 1053, 27080, 30004, 13, 3166, 413, 440, 29891, 29889, 11330, 1053, 4669, 4854, 30004, 13, 3166, 413, 440, 29891, 29889, 29884, 861, 29889, 1643, 1053, 15796, 30004, 13, 3166, 413, 440, 29891, 29889, 29884, 861, 29889, 7411, 2680, 1053, 27842, 3453, 30004, 13, 3166, 413, 440, 29891, 29889, 29884, 861, 29889, 7323, 786, 1053, 6977, 786, 30004, 13, 30004, 13, 30004, 13, 1990, 27080, 29879, 29898, 8801, 1125, 30004, 13, 1678, 822, 9503, 29898, 1311, 1125, 30004, 13, 4706, 1510, 29918, 7323, 786, 26471, 13, 30004, 13, 1990, 349, 29898, 11031, 3453, 1125, 30004, 13, 1678, 1209, 30004, 13, 30004, 13, 30004, 13, 1990, 1619, 2052, 29898, 2052, 1125, 30004, 13, 1678, 822, 2048, 29898, 1311, 1125, 30004, 13, 4706, 736, 27080, 29879, 26471, 13, 30004, 13, 30004, 13, 1753, 1510, 29918, 7323, 786, 7295, 30004, 13, 1678, 1510, 353, 349, 26471, 13, 30004, 13, 1678, 18218, 5907, 353, 6977, 786, 29898, 3257, 543, 12310, 786, 18379, 613, 2793, 29922, 4294, 29892, 2159, 29918, 29882, 524, 7607, 8516, 29892, 8516, 511, 2311, 7607, 29946, 29900, 29900, 29892, 29946, 29900, 29900, 876, 30004, 13, 30004, 13, 1678, 18218, 5907, 29889, 3150, 26471, 13, 30004, 13, 30004, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 30004, 13, 1678, 1619, 2052, 2141, 3389, 26471, 13, 30004, 13, 1678, 529, 8801, 29879, 23917, 30004, 13, 4706, 11025, 29901, 30004, 13, 9651, 1426, 29901, 376, 10923, 592, 19451, 13, 9651, 373, 29918, 14096, 29901, 3876, 29889, 7290, 26471, 13, 30004, 13, 1678, 529, 29925, 23917, 30004, 13, 4706, 15796, 29901, 30004, 13, 9651, 1426, 29901, 376, 3492, 15385, 278, 2826, 19451, 13, 9651, 2159, 29918, 29882, 524, 29901, 29871, 29900, 29889, 29953, 29892, 29871, 29900, 29889, 29906, 30004, 13, 9651, 926, 29918, 29882, 524, 29901, 8853, 29916, 1115, 29900, 29889, 29906, 29892, 376, 3332, 1115, 29896, 8117, 13, 30004, 13, 4706, 11025, 29901, 30004, 13, 9651, 1426, 29901, 376, 3492, 15385, 278, 2826, 19451, 13, 9651, 2159, 29918, 29882, 524, 29901, 29871, 29900, 29889, 29947, 29892, 29871, 29900, 29889, 29906, 30004, 13, 9651, 926, 29918, 29882, 524, 29901, 8853, 29916, 1115, 29900, 29889, 29896, 29892, 376, 29891, 1115, 29900, 29889, 29896, 8117, 13, 2 ]
common.py
mroja/kuramoto
1
117345
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import struct import numpy as np import subprocess import matplotlib.pyplot as plt from collections import namedtuple # N - number of oscillators # freq - oscillator frequency (N elements) # phase - oscillator phases (N elements) # k - coupling coefficients (NxN matrix) DataPreset = namedtuple('DataPreset', ['N', 'k', 'freq', 'phase']) class KuramotoSimulation(object): def __init__(self): self.N_steps = 0 self.dt = 0.01 self.noise = 0.0 self.dump_interval = 0 self.coupling_type = 'kuramoto' self.forcing_strength = 0.0 self.forcing_freq = 0.0 self.freq_modulation_enabled = False self.k_modulation_enabled = False def run(self, preset_name, r_file=None, mean_file=None, mean_vel_file=None): cmd = ['kuramoto_simulation', '--quiet', '--preset', preset_name, '--steps', str(self.N_steps), '--dump-interval', str(self.dump_interval), '--dt', str(self.dt), '--noise', str(self.noise), '--coupling', self.coupling_type, '--forcing-strength', str(self.forcing_strength), '--forcing-freq', str(self.forcing_freq)] if r_file is not None: cmd.append('--r-file') if type(r_file) is str and r_file: cmd.append(r_file) if mean_file is not None: cmd.append('--mean-phase-file') if type(mean_file) is str and mean_file: cmd.append(mean_file) if mean_vel_file is not None: cmd.append('--mean-vel-file') if type(mean_vel_file) is str and mean_vel_file: cmd.append(mean_vel_file) if self.k_modulation_enabled: cmd.append('--enable-k-modulation') if self.freq_modulation_enabled: cmd.append('--enable-freq-modulation') # print cmd subprocess.call(cmd) ''' def write_to_file(self, preset_name): conf_str = \ '{N_steps:d}\n' + \ '{dt:f}\n' + \ '{noise:f}\n' + \ '{dump_interval:d}\n' + \ '{coupling_type}\n' + \ '{forcing_strength:f}\n' + \ '{forcing_freq:f}\n' + \ '{freq_modulation_enabled}\n' + \ '{k_modulation_enabled}' args = { 'N_steps': self.N_steps, 'dt': self.dt, 'noise': self.noise, 'dump_interval': self.dump_interval, 'coupling_type': self.coupling_type, 'forcing_strength': self.forcing_strength, 'forcing_freq': self.forcing_freq, 'freq_modulation_enabled': 'freq_modulation' if self.freq_modulation_enabled else 'no_freq_modulation', 'k_modulation_enabled': 'k_modulation' if self.k_modulation_enabled else 'no_k_modulation', } conf = conf_str.format(**args) with open(preset_name + '.conf.txt', 'w') as f: f.write(conf) def read_from_file(self, preset_name): with open(preset_name + '.conf.txt', 'r') as f: lines = f.readlines() self.N_steps = int(lines[0]) delf.dt = float(lines[1]) self.noise = float(lines[2]) self.dump_interval = int(lines[3]) self.coupling_type = lines[4] self.forcing_strength = float(lines[5]) self.forcing_freq = float(lines[6]) self.freq_modulation_enabled = True if lines[7] == 'freq_modulation' else False self.k_modulation_enabled = True if lines[11] == 'k_modulation' else False ''' def load_preset_from_file(name): with open(name + '.preset', 'rb') as f: N = struct.unpack('I', f.read(4))[0] freq = np.fromfile(f, dtype=np.float64, count=N) phase = np.fromfile(f, dtype=np.float64, count=N) k = np.fromfile(f, dtype=np.float64, count=N*N) return DataPreset(N, k, freq, phase) def write_preset_to_file(preset_name, preset): preset_file_name = preset_name + '.preset' try: os.remove(preset_file_name) except Exception: pass with open(preset_file_name, 'wb') as f: f.write(struct.pack('I', preset.N)) preset.freq.astype(np.float64).tofile(f) preset.phase.astype(np.float64).tofile(f) preset.k.astype(np.float64).tofile(f) def write_freq_modul_data_to_file(file_name, freq_ampl, freq_freq, freq_offset): with open(file_name + '.fm.preset', 'wb') as f: freq_ampl.astype(np.float64).tofile(f) freq_freq.astype(np.float64).tofile(f) freq_offset.astype(np.float64).tofile(f) def write_k_modul_data_to_file(file_name, k_ampl, k_freq, k_offset): with open(file_name + '.km.preset', 'wb') as f: k_ampl.astype(np.float64).tofile(f) k_freq.astype(np.float64).tofile(f) k_offset.astype(np.float64).tofile(f) def save_plot(path, ext='png', close=True): directory = os.path.split(path)[0] filename = "%s.%s" % (os.path.split(path)[1], ext) if directory == '': directory = '.' if not os.path.exists(directory): os.makedirs(directory) savepath = os.path.join(directory, filename) # print("Saving figure to '%s'" % savepath) plt.savefig(savepath) if close: plt.close()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 5215, 2897, 13, 5215, 2281, 13, 5215, 12655, 408, 7442, 13, 5215, 1014, 5014, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 16250, 1053, 4257, 23583, 13, 13, 29937, 405, 268, 448, 1353, 310, 21519, 4097, 13, 29937, 3005, 29939, 29871, 448, 21519, 1061, 10868, 313, 29940, 3161, 29897, 13, 29937, 8576, 448, 21519, 1061, 29540, 313, 29940, 3161, 29897, 13, 29937, 413, 268, 448, 23638, 16127, 313, 29940, 29916, 29940, 4636, 29897, 13, 1469, 29925, 12071, 353, 4257, 23583, 877, 1469, 29925, 12071, 742, 6024, 29940, 742, 525, 29895, 742, 525, 29888, 7971, 742, 525, 21646, 11287, 13, 13, 13, 1990, 9742, 314, 3747, 8942, 2785, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 29940, 29918, 24530, 353, 29871, 29900, 13, 4706, 1583, 29889, 6008, 353, 29871, 29900, 29889, 29900, 29896, 13, 4706, 1583, 29889, 1217, 895, 353, 29871, 29900, 29889, 29900, 13, 4706, 1583, 29889, 15070, 29918, 19207, 353, 29871, 29900, 13, 4706, 1583, 29889, 16589, 10335, 29918, 1853, 353, 525, 23843, 314, 3747, 29915, 13, 4706, 1583, 29889, 1454, 3277, 29918, 710, 1477, 353, 29871, 29900, 29889, 29900, 13, 4706, 1583, 29889, 1454, 3277, 29918, 29888, 7971, 353, 29871, 29900, 29889, 29900, 13, 4706, 1583, 29889, 29888, 7971, 29918, 1545, 2785, 29918, 17590, 353, 7700, 13, 4706, 1583, 29889, 29895, 29918, 1545, 2785, 29918, 17590, 353, 7700, 13, 13, 1678, 822, 1065, 29898, 1311, 29892, 2225, 300, 29918, 978, 29892, 364, 29918, 1445, 29922, 8516, 29892, 2099, 29918, 1445, 29922, 8516, 29892, 2099, 29918, 955, 29918, 1445, 29922, 8516, 1125, 13, 4706, 9920, 353, 6024, 23843, 314, 3747, 29918, 3601, 2785, 742, 13, 1669, 525, 489, 339, 2035, 742, 13, 1669, 525, 489, 4569, 300, 742, 2225, 300, 29918, 978, 29892, 13, 1669, 525, 489, 24530, 742, 851, 29898, 1311, 29889, 29940, 29918, 24530, 511, 13, 1669, 525, 489, 15070, 29899, 19207, 742, 851, 29898, 1311, 29889, 15070, 29918, 19207, 511, 13, 1669, 525, 489, 6008, 742, 851, 29898, 1311, 29889, 6008, 511, 13, 1669, 525, 489, 1217, 895, 742, 851, 29898, 1311, 29889, 1217, 895, 511, 13, 1669, 525, 489, 16589, 10335, 742, 1583, 29889, 16589, 10335, 29918, 1853, 29892, 13, 1669, 525, 489, 1454, 3277, 29899, 710, 1477, 742, 851, 29898, 1311, 29889, 1454, 3277, 29918, 710, 1477, 511, 29871, 13, 1669, 525, 489, 1454, 3277, 29899, 29888, 7971, 742, 851, 29898, 1311, 29889, 1454, 3277, 29918, 29888, 7971, 4638, 13, 13, 4706, 565, 364, 29918, 1445, 338, 451, 6213, 29901, 13, 9651, 9920, 29889, 4397, 877, 489, 29878, 29899, 1445, 1495, 13, 9651, 565, 1134, 29898, 29878, 29918, 1445, 29897, 338, 851, 322, 364, 29918, 1445, 29901, 13, 18884, 9920, 29889, 4397, 29898, 29878, 29918, 1445, 29897, 13, 13, 4706, 565, 2099, 29918, 1445, 338, 451, 6213, 29901, 13, 9651, 9920, 29889, 4397, 877, 489, 12676, 29899, 21646, 29899, 1445, 1495, 13, 9651, 565, 1134, 29898, 12676, 29918, 1445, 29897, 338, 851, 322, 2099, 29918, 1445, 29901, 13, 18884, 9920, 29889, 4397, 29898, 12676, 29918, 1445, 29897, 13, 13, 4706, 565, 2099, 29918, 955, 29918, 1445, 338, 451, 6213, 29901, 13, 9651, 9920, 29889, 4397, 877, 489, 12676, 29899, 955, 29899, 1445, 1495, 13, 9651, 565, 1134, 29898, 12676, 29918, 955, 29918, 1445, 29897, 338, 851, 322, 2099, 29918, 955, 29918, 1445, 29901, 13, 18884, 9920, 29889, 4397, 29898, 12676, 29918, 955, 29918, 1445, 29897, 13, 13, 4706, 565, 1583, 29889, 29895, 29918, 1545, 2785, 29918, 17590, 29901, 13, 9651, 9920, 29889, 4397, 877, 489, 12007, 29899, 29895, 29899, 1545, 2785, 1495, 13, 13, 4706, 565, 1583, 29889, 29888, 7971, 29918, 1545, 2785, 29918, 17590, 29901, 13, 9651, 9920, 29889, 4397, 877, 489, 12007, 29899, 29888, 7971, 29899, 1545, 2785, 1495, 13, 13, 4706, 396, 1596, 9920, 13, 13, 4706, 1014, 5014, 29889, 4804, 29898, 9006, 29897, 13, 13, 13, 1678, 14550, 13, 1678, 822, 2436, 29918, 517, 29918, 1445, 29898, 1311, 29892, 2225, 300, 29918, 978, 1125, 13, 4706, 1970, 29918, 710, 353, 320, 13, 9651, 22372, 29940, 29918, 24530, 29901, 29881, 1012, 29876, 29915, 718, 320, 13, 9651, 22372, 6008, 29901, 29888, 1012, 29876, 29915, 718, 29871, 320, 13, 9651, 22372, 1217, 895, 29901, 29888, 1012, 29876, 29915, 718, 320, 13, 9651, 22372, 15070, 29918, 19207, 29901, 29881, 1012, 29876, 29915, 718, 320, 13, 9651, 22372, 16589, 10335, 29918, 1853, 1012, 29876, 29915, 718, 320, 13, 9651, 22372, 1454, 3277, 29918, 710, 1477, 29901, 29888, 1012, 29876, 29915, 718, 320, 13, 9651, 22372, 1454, 3277, 29918, 29888, 7971, 29901, 29888, 1012, 29876, 29915, 718, 320, 13, 9651, 22372, 29888, 7971, 29918, 1545, 2785, 29918, 17590, 1012, 29876, 29915, 718, 320, 13, 9651, 22372, 29895, 29918, 1545, 2785, 29918, 17590, 10162, 13, 4706, 6389, 353, 426, 13, 965, 525, 29940, 29918, 24530, 2396, 462, 1583, 29889, 29940, 29918, 24530, 29892, 13, 965, 525, 6008, 2396, 462, 418, 1583, 29889, 6008, 29892, 13, 965, 525, 1217, 895, 2396, 462, 259, 1583, 29889, 1217, 895, 29892, 13, 965, 525, 15070, 29918, 19207, 2396, 965, 1583, 29889, 15070, 29918, 19207, 29892, 13, 965, 525, 16589, 10335, 29918, 1853, 2396, 965, 1583, 29889, 16589, 10335, 29918, 1853, 29892, 13, 965, 525, 1454, 3277, 29918, 710, 1477, 2396, 4706, 1583, 29889, 1454, 3277, 29918, 710, 1477, 29892, 13, 965, 525, 1454, 3277, 29918, 29888, 7971, 2396, 9651, 1583, 29889, 1454, 3277, 29918, 29888, 7971, 29892, 13, 965, 525, 29888, 7971, 29918, 1545, 2785, 29918, 17590, 2396, 525, 29888, 7971, 29918, 1545, 2785, 29915, 565, 1583, 29889, 29888, 7971, 29918, 1545, 2785, 29918, 17590, 1683, 525, 1217, 29918, 29888, 7971, 29918, 1545, 2785, 742, 13, 965, 525, 29895, 29918, 1545, 2785, 29918, 17590, 2396, 1678, 525, 29895, 29918, 1545, 2785, 29915, 565, 1583, 29889, 29895, 29918, 1545, 2785, 29918, 17590, 1683, 525, 1217, 29918, 29895, 29918, 1545, 2785, 742, 13, 4706, 500, 13, 4706, 1970, 353, 1970, 29918, 710, 29889, 4830, 29898, 1068, 5085, 29897, 13, 4706, 411, 1722, 29898, 4569, 300, 29918, 978, 718, 15300, 5527, 29889, 3945, 742, 525, 29893, 1495, 408, 285, 29901, 13, 9651, 285, 29889, 3539, 29898, 5527, 29897, 13, 13, 1678, 822, 1303, 29918, 3166, 29918, 1445, 29898, 1311, 29892, 2225, 300, 29918, 978, 1125, 13, 4706, 411, 1722, 29898, 4569, 300, 29918, 978, 718, 15300, 5527, 29889, 3945, 742, 525, 29878, 1495, 408, 285, 29901, 13, 9651, 3454, 353, 285, 29889, 949, 9012, 580, 13, 9651, 1583, 29889, 29940, 29918, 24530, 353, 938, 29898, 9012, 29961, 29900, 2314, 13, 9651, 628, 29888, 29889, 6008, 353, 5785, 29898, 9012, 29961, 29896, 2314, 13, 9651, 1583, 29889, 1217, 895, 353, 5785, 29898, 9012, 29961, 29906, 2314, 13, 9651, 1583, 29889, 15070, 29918, 19207, 353, 938, 29898, 9012, 29961, 29941, 2314, 13, 9651, 1583, 29889, 16589, 10335, 29918, 1853, 353, 3454, 29961, 29946, 29962, 13, 9651, 1583, 29889, 1454, 3277, 29918, 710, 1477, 353, 5785, 29898, 9012, 29961, 29945, 2314, 13, 9651, 1583, 29889, 1454, 3277, 29918, 29888, 7971, 353, 5785, 29898, 9012, 29961, 29953, 2314, 13, 9651, 1583, 29889, 29888, 7971, 29918, 1545, 2785, 29918, 17590, 353, 5852, 565, 3454, 29961, 29955, 29962, 1275, 525, 29888, 7971, 29918, 1545, 2785, 29915, 1683, 7700, 13, 9651, 1583, 29889, 29895, 29918, 1545, 2785, 29918, 17590, 353, 5852, 565, 3454, 29961, 29896, 29896, 29962, 1275, 525, 29895, 29918, 1545, 2785, 29915, 1683, 7700, 13, 1678, 14550, 13, 13, 13, 1753, 2254, 29918, 4569, 300, 29918, 3166, 29918, 1445, 29898, 978, 1125, 13, 1678, 411, 1722, 29898, 978, 718, 15300, 4569, 300, 742, 525, 6050, 1495, 408, 285, 29901, 13, 4706, 405, 353, 2281, 29889, 348, 4058, 877, 29902, 742, 285, 29889, 949, 29898, 29946, 876, 29961, 29900, 29962, 13, 4706, 3005, 29939, 353, 7442, 29889, 3166, 1445, 29898, 29888, 29892, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 29892, 2302, 29922, 29940, 29897, 13, 4706, 8576, 353, 7442, 29889, 3166, 1445, 29898, 29888, 29892, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 29892, 2302, 29922, 29940, 29897, 13, 4706, 413, 353, 7442, 29889, 3166, 1445, 29898, 29888, 29892, 26688, 29922, 9302, 29889, 7411, 29953, 29946, 29892, 2302, 29922, 29940, 29930, 29940, 29897, 13, 1678, 736, 3630, 29925, 12071, 29898, 29940, 29892, 413, 29892, 3005, 29939, 29892, 8576, 29897, 13, 13, 13, 1753, 2436, 29918, 4569, 300, 29918, 517, 29918, 1445, 29898, 4569, 300, 29918, 978, 29892, 2225, 300, 1125, 13, 1678, 2225, 300, 29918, 1445, 29918, 978, 353, 2225, 300, 29918, 978, 718, 15300, 4569, 300, 29915, 13, 268, 13, 1678, 1018, 29901, 13, 4706, 2897, 29889, 5992, 29898, 4569, 300, 29918, 1445, 29918, 978, 29897, 13, 1678, 5174, 8960, 29901, 13, 4706, 1209, 268, 13, 268, 13, 1678, 411, 1722, 29898, 4569, 300, 29918, 1445, 29918, 978, 29892, 525, 29893, 29890, 1495, 408, 285, 29901, 13, 4706, 285, 29889, 3539, 29898, 4984, 29889, 4058, 877, 29902, 742, 2225, 300, 29889, 29940, 876, 13, 4706, 2225, 300, 29889, 29888, 7971, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 4706, 2225, 300, 29889, 21646, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 4706, 2225, 300, 29889, 29895, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 13, 13, 1753, 2436, 29918, 29888, 7971, 29918, 1545, 352, 29918, 1272, 29918, 517, 29918, 1445, 29898, 1445, 29918, 978, 29892, 3005, 29939, 29918, 314, 572, 29892, 3005, 29939, 29918, 29888, 7971, 29892, 3005, 29939, 29918, 10289, 1125, 13, 1678, 411, 1722, 29898, 1445, 29918, 978, 718, 15300, 24826, 29889, 4569, 300, 742, 525, 29893, 29890, 1495, 408, 285, 29901, 13, 4706, 3005, 29939, 29918, 314, 572, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 4706, 3005, 29939, 29918, 29888, 7971, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 4706, 3005, 29939, 29918, 10289, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 13, 13, 1753, 2436, 29918, 29895, 29918, 1545, 352, 29918, 1272, 29918, 517, 29918, 1445, 29898, 1445, 29918, 978, 29892, 413, 29918, 314, 572, 29892, 413, 29918, 29888, 7971, 29892, 413, 29918, 10289, 1125, 13, 1678, 411, 1722, 29898, 1445, 29918, 978, 718, 15300, 8848, 29889, 4569, 300, 742, 525, 29893, 29890, 1495, 408, 285, 29901, 13, 4706, 413, 29918, 314, 572, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 4706, 413, 29918, 29888, 7971, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 4706, 413, 29918, 10289, 29889, 579, 668, 29898, 9302, 29889, 7411, 29953, 29946, 467, 517, 1445, 29898, 29888, 29897, 13, 13, 13, 1753, 4078, 29918, 5317, 29898, 2084, 29892, 1294, 2433, 2732, 742, 3802, 29922, 5574, 1125, 13, 1678, 3884, 353, 2897, 29889, 2084, 29889, 5451, 29898, 2084, 9601, 29900, 29962, 13, 1678, 10422, 353, 11860, 29879, 29889, 29995, 29879, 29908, 1273, 313, 359, 29889, 2084, 29889, 5451, 29898, 2084, 9601, 29896, 1402, 1294, 29897, 13, 1678, 565, 3884, 1275, 525, 2396, 13, 4706, 3884, 353, 525, 6169, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 12322, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 12322, 29897, 13, 1678, 4078, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 12322, 29892, 10422, 29897, 13, 1678, 396, 1596, 703, 29903, 5555, 4377, 304, 14210, 29879, 11838, 1273, 4078, 2084, 29897, 13, 1678, 14770, 29889, 7620, 1003, 29898, 7620, 2084, 29897, 13, 1678, 565, 3802, 29901, 13, 4706, 14770, 29889, 5358, 580, 13, 2 ]
Arrays/Find_common_elements_in_three_sorted_arrays/solution.py
abhaydhiman/Pyalgo
1
191603
<reponame>abhaydhiman/Pyalgo def my_func(arr1, arr2, arr3): ln1 = len(arr1) ln2 = len(arr2) ln3 = len(arr3) ptr1 = 0 ptr2 = 0 ptr3 = 0 while ptr1 < ln1 and ptr2 < ln2 and ptr3 < ln3: if arr1[ptr1] < arr2[ptr2]: if arr3[ptr3] < arr2[ptr2]: arr1[ptr1] = -1 arr3[ptr3] = -1 ptr3 += 1 ptr1 += 1 else: arr1[ptr1] = -1 ptr1 += 1 elif arr2[ptr2] < arr3[ptr3]: if arr1[ptr1] < arr3[ptr3]: arr1[ptr1] = -1 arr2[ptr2] = -1 ptr1 += 1 ptr2 += 1 else: arr2[ptr2] = -1 ptr2 += 1 elif arr3[ptr3] < arr1[ptr1]: if arr2[ptr2] < arr1[ptr1]: arr2[ptr2] = -1 arr3[ptr3] = -1 ptr2 += 1 ptr3 += 1 else: arr3[ptr3] = -1 ptr3 += 1 else: ptr1 += 1 ptr2 += 1 ptr3 += 1 for i in arr1: if i != -1: print(i, end=' ') ls1 = [1, 5, 5] ls2 = [3, 4, 5, 5, 10] ls3 = [5, 5, 10, 20] my_func(ls1, ls2, ls3)
[ 1, 529, 276, 1112, 420, 29958, 370, 29882, 388, 12744, 25895, 29914, 29925, 4605, 1484, 13, 1753, 590, 29918, 9891, 29898, 2749, 29896, 29892, 3948, 29906, 29892, 3948, 29941, 1125, 13, 1678, 301, 29876, 29896, 353, 7431, 29898, 2749, 29896, 29897, 13, 1678, 301, 29876, 29906, 353, 7431, 29898, 2749, 29906, 29897, 13, 1678, 301, 29876, 29941, 353, 7431, 29898, 2749, 29941, 29897, 13, 1678, 23246, 29896, 353, 29871, 29900, 13, 1678, 23246, 29906, 353, 29871, 29900, 13, 1678, 23246, 29941, 353, 29871, 29900, 13, 268, 13, 1678, 1550, 23246, 29896, 529, 301, 29876, 29896, 322, 23246, 29906, 529, 301, 29876, 29906, 322, 23246, 29941, 529, 301, 29876, 29941, 29901, 13, 4706, 565, 3948, 29896, 29961, 7414, 29896, 29962, 529, 3948, 29906, 29961, 7414, 29906, 5387, 13, 9651, 565, 3948, 29941, 29961, 7414, 29941, 29962, 529, 3948, 29906, 29961, 7414, 29906, 5387, 13, 18884, 3948, 29896, 29961, 7414, 29896, 29962, 353, 448, 29896, 13, 18884, 3948, 29941, 29961, 7414, 29941, 29962, 353, 448, 29896, 13, 18884, 23246, 29941, 4619, 29871, 29896, 13, 18884, 23246, 29896, 4619, 29871, 29896, 13, 9651, 1683, 29901, 13, 18884, 3948, 29896, 29961, 7414, 29896, 29962, 353, 448, 29896, 13, 18884, 23246, 29896, 4619, 29871, 29896, 13, 308, 13, 4706, 25342, 3948, 29906, 29961, 7414, 29906, 29962, 529, 3948, 29941, 29961, 7414, 29941, 5387, 13, 9651, 565, 3948, 29896, 29961, 7414, 29896, 29962, 529, 3948, 29941, 29961, 7414, 29941, 5387, 13, 18884, 3948, 29896, 29961, 7414, 29896, 29962, 353, 448, 29896, 13, 18884, 3948, 29906, 29961, 7414, 29906, 29962, 353, 448, 29896, 13, 18884, 23246, 29896, 4619, 29871, 29896, 13, 18884, 23246, 29906, 4619, 29871, 29896, 13, 9651, 1683, 29901, 13, 18884, 3948, 29906, 29961, 7414, 29906, 29962, 353, 448, 29896, 13, 18884, 23246, 29906, 4619, 29871, 29896, 13, 308, 13, 4706, 25342, 3948, 29941, 29961, 7414, 29941, 29962, 529, 3948, 29896, 29961, 7414, 29896, 5387, 13, 9651, 565, 3948, 29906, 29961, 7414, 29906, 29962, 529, 3948, 29896, 29961, 7414, 29896, 5387, 13, 18884, 3948, 29906, 29961, 7414, 29906, 29962, 353, 448, 29896, 13, 18884, 3948, 29941, 29961, 7414, 29941, 29962, 353, 448, 29896, 13, 18884, 23246, 29906, 4619, 29871, 29896, 13, 18884, 23246, 29941, 4619, 29871, 29896, 13, 9651, 1683, 29901, 13, 18884, 3948, 29941, 29961, 7414, 29941, 29962, 353, 448, 29896, 13, 18884, 23246, 29941, 4619, 29871, 29896, 13, 308, 13, 4706, 1683, 29901, 13, 9651, 23246, 29896, 4619, 29871, 29896, 13, 9651, 23246, 29906, 4619, 29871, 29896, 13, 9651, 23246, 29941, 4619, 29871, 29896, 13, 308, 13, 1678, 363, 474, 297, 3948, 29896, 29901, 13, 4706, 565, 474, 2804, 448, 29896, 29901, 13, 9651, 1596, 29898, 29875, 29892, 1095, 2433, 25710, 13, 268, 13, 13, 3137, 29896, 353, 518, 29896, 29892, 29871, 29945, 29892, 29871, 29945, 29962, 13, 3137, 29906, 353, 518, 29941, 29892, 29871, 29946, 29892, 29871, 29945, 29892, 29871, 29945, 29892, 29871, 29896, 29900, 29962, 13, 3137, 29941, 353, 518, 29945, 29892, 29871, 29945, 29892, 29871, 29896, 29900, 29892, 29871, 29906, 29900, 29962, 13, 1357, 29918, 9891, 29898, 3137, 29896, 29892, 19375, 29906, 29892, 19375, 29941, 29897, 13, 2 ]
WhatsAppManifest/automator/android/__init__.py
riquedev/WhatsAppManifest
15
32917
""" Module responsible for all automation related to the device """ __author__ = '<NAME>' __copyright__ = 'Copyright 2020, WhatsAppManifest' from WhatsAppManifest.automator.android.phone import AndroidPhone from WhatsAppManifest.automator.android.contacts import AndroidContacts
[ 1, 9995, 13, 7355, 14040, 363, 599, 3345, 362, 4475, 304, 278, 4742, 13, 15945, 29908, 13, 13, 1649, 8921, 1649, 353, 12801, 5813, 16299, 13, 1649, 8552, 1266, 1649, 353, 525, 11882, 1266, 29871, 29906, 29900, 29906, 29900, 29892, 806, 1446, 2052, 2517, 7004, 29915, 13, 13, 13, 3166, 806, 1446, 2052, 2517, 7004, 29889, 17405, 1061, 29889, 2843, 29889, 6710, 1053, 5669, 9861, 13, 3166, 806, 1446, 2052, 2517, 7004, 29889, 17405, 1061, 29889, 2843, 29889, 12346, 29879, 1053, 5669, 13443, 29879, 13, 2 ]
option_c.py
wrosecrans/colormap
231
4210
from matplotlib.colors import LinearSegmentedColormap from numpy import nan, inf # Used to reconstruct the colormap in viscm parameters = {'xp': [-5.4895292543686764, 14.790571669586654, 82.5546687431056, 29.15531114139253, -4.1316769886951761, -13.002076438907238], 'yp': [-35.948168839230306, -42.273376159885785, -28.845467523197698, 52.03426124197, 36.832712600868973, 40.792291220556734], 'min_JK': 16.8314150305, 'max_JK': 95} cm_data = [[ 5.03832136e-02, 2.98028976e-02, 5.27974883e-01], [ 6.35363639e-02, 2.84259729e-02, 5.33123681e-01], [ 7.53531234e-02, 2.72063728e-02, 5.38007001e-01], [ 8.62217979e-02, 2.61253206e-02, 5.42657691e-01], [ 9.63786097e-02, 2.51650976e-02, 5.47103487e-01], [ 1.05979704e-01, 2.43092436e-02, 5.51367851e-01], [ 1.15123641e-01, 2.35562500e-02, 5.55467728e-01], [ 1.23902903e-01, 2.28781011e-02, 5.59423480e-01], [ 1.32380720e-01, 2.22583774e-02, 5.63250116e-01], [ 1.40603076e-01, 2.16866674e-02, 5.66959485e-01], [ 1.48606527e-01, 2.11535876e-02, 5.70561711e-01], [ 1.56420649e-01, 2.06507174e-02, 5.74065446e-01], [ 1.64069722e-01, 2.01705326e-02, 5.77478074e-01], [ 1.71573925e-01, 1.97063415e-02, 5.80805890e-01], [ 1.78950212e-01, 1.92522243e-02, 5.84054243e-01], [ 1.86212958e-01, 1.88029767e-02, 5.87227661e-01], [ 1.93374449e-01, 1.83540593e-02, 5.90329954e-01], [ 2.00445260e-01, 1.79015512e-02, 5.93364304e-01], [ 2.07434551e-01, 1.74421086e-02, 5.96333341e-01], [ 2.14350298e-01, 1.69729276e-02, 5.99239207e-01], [ 2.21196750e-01, 1.64970484e-02, 6.02083323e-01], [ 2.27982971e-01, 1.60071509e-02, 6.04867403e-01], [ 2.34714537e-01, 1.55015065e-02, 6.07592438e-01], [ 2.41396253e-01, 1.49791041e-02, 6.10259089e-01], [ 2.48032377e-01, 1.44393586e-02, 6.12867743e-01], [ 2.54626690e-01, 1.38820918e-02, 6.15418537e-01], [ 2.61182562e-01, 1.33075156e-02, 6.17911385e-01], [ 2.67702993e-01, 1.27162163e-02, 6.20345997e-01], [ 2.74190665e-01, 1.21091423e-02, 6.22721903e-01], [ 2.80647969e-01, 1.14875915e-02, 6.25038468e-01], [ 2.87076059e-01, 1.08554862e-02, 6.27294975e-01], [ 2.93477695e-01, 1.02128849e-02, 6.29490490e-01], [ 2.99855122e-01, 9.56079551e-03, 6.31623923e-01], [ 3.06209825e-01, 8.90185346e-03, 6.33694102e-01], [ 3.12543124e-01, 8.23900704e-03, 6.35699759e-01], [ 3.18856183e-01, 7.57551051e-03, 6.37639537e-01], [ 3.25150025e-01, 6.91491734e-03, 6.39512001e-01], [ 3.31425547e-01, 6.26107379e-03, 6.41315649e-01], [ 3.37683446e-01, 5.61830889e-03, 6.43048936e-01], [ 3.43924591e-01, 4.99053080e-03, 6.44710195e-01], [ 3.50149699e-01, 4.38202557e-03, 6.46297711e-01], [ 3.56359209e-01, 3.79781761e-03, 6.47809772e-01], [ 3.62553473e-01, 3.24319591e-03, 6.49244641e-01], [ 3.68732762e-01, 2.72370721e-03, 6.50600561e-01], [ 3.74897270e-01, 2.24514897e-03, 6.51875762e-01], [ 3.81047116e-01, 1.81356205e-03, 6.53068467e-01], [ 3.87182639e-01, 1.43446923e-03, 6.54176761e-01], [ 3.93304010e-01, 1.11388259e-03, 6.55198755e-01], [ 3.99410821e-01, 8.59420809e-04, 6.56132835e-01], [ 4.05502914e-01, 6.78091517e-04, 6.56977276e-01], [ 4.11580082e-01, 5.77101735e-04, 6.57730380e-01], [ 4.17642063e-01, 5.63847476e-04, 6.58390492e-01], [ 4.23688549e-01, 6.45902780e-04, 6.58956004e-01], [ 4.29719186e-01, 8.31008207e-04, 6.59425363e-01], [ 4.35733575e-01, 1.12705875e-03, 6.59797077e-01], [ 4.41732123e-01, 1.53984779e-03, 6.60069009e-01], [ 4.47713600e-01, 2.07954744e-03, 6.60240367e-01], [ 4.53677394e-01, 2.75470302e-03, 6.60309966e-01], [ 4.59622938e-01, 3.57374415e-03, 6.60276655e-01], [ 4.65549631e-01, 4.54518084e-03, 6.60139383e-01], [ 4.71456847e-01, 5.67758762e-03, 6.59897210e-01], [ 4.77343929e-01, 6.97958743e-03, 6.59549311e-01], [ 4.83210198e-01, 8.45983494e-03, 6.59094989e-01], [ 4.89054951e-01, 1.01269996e-02, 6.58533677e-01], [ 4.94877466e-01, 1.19897486e-02, 6.57864946e-01], [ 5.00677687e-01, 1.40550640e-02, 6.57087561e-01], [ 5.06454143e-01, 1.63333443e-02, 6.56202294e-01], [ 5.12206035e-01, 1.88332232e-02, 6.55209222e-01], [ 5.17932580e-01, 2.15631918e-02, 6.54108545e-01], [ 5.23632990e-01, 2.45316468e-02, 6.52900629e-01], [ 5.29306474e-01, 2.77468735e-02, 6.51586010e-01], [ 5.34952244e-01, 3.12170300e-02, 6.50165396e-01], [ 5.40569510e-01, 3.49501310e-02, 6.48639668e-01], [ 5.46157494e-01, 3.89540334e-02, 6.47009884e-01], [ 5.51715423e-01, 4.31364795e-02, 6.45277275e-01], [ 5.57242538e-01, 4.73307585e-02, 6.43443250e-01], [ 5.62738096e-01, 5.15448092e-02, 6.41509389e-01], [ 5.68201372e-01, 5.57776706e-02, 6.39477440e-01], [ 5.73631859e-01, 6.00281369e-02, 6.37348841e-01], [ 5.79028682e-01, 6.42955547e-02, 6.35126108e-01], [ 5.84391137e-01, 6.85790261e-02, 6.32811608e-01], [ 5.89718606e-01, 7.28775875e-02, 6.30407727e-01], [ 5.95010505e-01, 7.71902878e-02, 6.27916992e-01], [ 6.00266283e-01, 8.15161895e-02, 6.25342058e-01], [ 6.05485428e-01, 8.58543713e-02, 6.22685703e-01], [ 6.10667469e-01, 9.02039303e-02, 6.19950811e-01], [ 6.15811974e-01, 9.45639838e-02, 6.17140367e-01], [ 6.20918555e-01, 9.89336721e-02, 6.14257440e-01], [ 6.25986869e-01, 1.03312160e-01, 6.11305174e-01], [ 6.31016615e-01, 1.07698641e-01, 6.08286774e-01], [ 6.36007543e-01, 1.12092335e-01, 6.05205491e-01], [ 6.40959444e-01, 1.16492495e-01, 6.02064611e-01], [ 6.45872158e-01, 1.20898405e-01, 5.98867442e-01], [ 6.50745571e-01, 1.25309384e-01, 5.95617300e-01], [ 6.55579615e-01, 1.29724785e-01, 5.92317494e-01], [ 6.60374266e-01, 1.34143997e-01, 5.88971318e-01], [ 6.65129493e-01, 1.38566428e-01, 5.85582301e-01], [ 6.69845385e-01, 1.42991540e-01, 5.82153572e-01], [ 6.74522060e-01, 1.47418835e-01, 5.78688247e-01], [ 6.79159664e-01, 1.51847851e-01, 5.75189431e-01], [ 6.83758384e-01, 1.56278163e-01, 5.71660158e-01], [ 6.88318440e-01, 1.60709387e-01, 5.68103380e-01], [ 6.92840088e-01, 1.65141174e-01, 5.64521958e-01], [ 6.97323615e-01, 1.69573215e-01, 5.60918659e-01], [ 7.01769334e-01, 1.74005236e-01, 5.57296144e-01], [ 7.06177590e-01, 1.78437000e-01, 5.53656970e-01], [ 7.10548747e-01, 1.82868306e-01, 5.50003579e-01], [ 7.14883195e-01, 1.87298986e-01, 5.46338299e-01], [ 7.19181339e-01, 1.91728906e-01, 5.42663338e-01], [ 7.23443604e-01, 1.96157962e-01, 5.38980786e-01], [ 7.27670428e-01, 2.00586086e-01, 5.35292612e-01], [ 7.31862231e-01, 2.05013174e-01, 5.31600995e-01], [ 7.36019424e-01, 2.09439071e-01, 5.27908434e-01], [ 7.40142557e-01, 2.13863965e-01, 5.24215533e-01], [ 7.44232102e-01, 2.18287899e-01, 5.20523766e-01], [ 7.48288533e-01, 2.22710942e-01, 5.16834495e-01], [ 7.52312321e-01, 2.27133187e-01, 5.13148963e-01], [ 7.56303937e-01, 2.31554749e-01, 5.09468305e-01], [ 7.60263849e-01, 2.35975765e-01, 5.05793543e-01], [ 7.64192516e-01, 2.40396394e-01, 5.02125599e-01], [ 7.68090391e-01, 2.44816813e-01, 4.98465290e-01], [ 7.71957916e-01, 2.49237220e-01, 4.94813338e-01], [ 7.75795522e-01, 2.53657797e-01, 4.91170517e-01], [ 7.79603614e-01, 2.58078397e-01, 4.87539124e-01], [ 7.83382636e-01, 2.62499662e-01, 4.83917732e-01], [ 7.87132978e-01, 2.66921859e-01, 4.80306702e-01], [ 7.90855015e-01, 2.71345267e-01, 4.76706319e-01], [ 7.94549101e-01, 2.75770179e-01, 4.73116798e-01], [ 7.98215577e-01, 2.80196901e-01, 4.69538286e-01], [ 8.01854758e-01, 2.84625750e-01, 4.65970871e-01], [ 8.05466945e-01, 2.89057057e-01, 4.62414580e-01], [ 8.09052419e-01, 2.93491117e-01, 4.58869577e-01], [ 8.12611506e-01, 2.97927865e-01, 4.55337565e-01], [ 8.16144382e-01, 3.02368130e-01, 4.51816385e-01], [ 8.19651255e-01, 3.06812282e-01, 4.48305861e-01], [ 8.23132309e-01, 3.11260703e-01, 4.44805781e-01], [ 8.26587706e-01, 3.15713782e-01, 4.41315901e-01], [ 8.30017584e-01, 3.20171913e-01, 4.37835947e-01], [ 8.33422053e-01, 3.24635499e-01, 4.34365616e-01], [ 8.36801237e-01, 3.29104836e-01, 4.30905052e-01], [ 8.40155276e-01, 3.33580106e-01, 4.27454836e-01], [ 8.43484103e-01, 3.38062109e-01, 4.24013059e-01], [ 8.46787726e-01, 3.42551272e-01, 4.20579333e-01], [ 8.50066132e-01, 3.47048028e-01, 4.17153264e-01], [ 8.53319279e-01, 3.51552815e-01, 4.13734445e-01], [ 8.56547103e-01, 3.56066072e-01, 4.10322469e-01], [ 8.59749520e-01, 3.60588229e-01, 4.06916975e-01], [ 8.62926559e-01, 3.65119408e-01, 4.03518809e-01], [ 8.66077920e-01, 3.69660446e-01, 4.00126027e-01], [ 8.69203436e-01, 3.74211795e-01, 3.96738211e-01], [ 8.72302917e-01, 3.78773910e-01, 3.93354947e-01], [ 8.75376149e-01, 3.83347243e-01, 3.89975832e-01], [ 8.78422895e-01, 3.87932249e-01, 3.86600468e-01], [ 8.81442916e-01, 3.92529339e-01, 3.83228622e-01], [ 8.84435982e-01, 3.97138877e-01, 3.79860246e-01], [ 8.87401682e-01, 4.01761511e-01, 3.76494232e-01], [ 8.90339687e-01, 4.06397694e-01, 3.73130228e-01], [ 8.93249647e-01, 4.11047871e-01, 3.69767893e-01], [ 8.96131191e-01, 4.15712489e-01, 3.66406907e-01], [ 8.98983931e-01, 4.20391986e-01, 3.63046965e-01], [ 9.01807455e-01, 4.25086807e-01, 3.59687758e-01], [ 9.04601295e-01, 4.29797442e-01, 3.56328796e-01], [ 9.07364995e-01, 4.34524335e-01, 3.52969777e-01], [ 9.10098088e-01, 4.39267908e-01, 3.49610469e-01], [ 9.12800095e-01, 4.44028574e-01, 3.46250656e-01], [ 9.15470518e-01, 4.48806744e-01, 3.42890148e-01], [ 9.18108848e-01, 4.53602818e-01, 3.39528771e-01], [ 9.20714383e-01, 4.58417420e-01, 3.36165582e-01], [ 9.23286660e-01, 4.63250828e-01, 3.32800827e-01], [ 9.25825146e-01, 4.68103387e-01, 3.29434512e-01], [ 9.28329275e-01, 4.72975465e-01, 3.26066550e-01], [ 9.30798469e-01, 4.77867420e-01, 3.22696876e-01], [ 9.33232140e-01, 4.82779603e-01, 3.19325444e-01], [ 9.35629684e-01, 4.87712357e-01, 3.15952211e-01], [ 9.37990034e-01, 4.92666544e-01, 3.12575440e-01], [ 9.40312939e-01, 4.97642038e-01, 3.09196628e-01], [ 9.42597771e-01, 5.02639147e-01, 3.05815824e-01], [ 9.44843893e-01, 5.07658169e-01, 3.02433101e-01], [ 9.47050662e-01, 5.12699390e-01, 2.99048555e-01], [ 9.49217427e-01, 5.17763087e-01, 2.95662308e-01], [ 9.51343530e-01, 5.22849522e-01, 2.92274506e-01], [ 9.53427725e-01, 5.27959550e-01, 2.88883445e-01], [ 9.55469640e-01, 5.33093083e-01, 2.85490391e-01], [ 9.57468770e-01, 5.38250172e-01, 2.82096149e-01], [ 9.59424430e-01, 5.43431038e-01, 2.78700990e-01], [ 9.61335930e-01, 5.48635890e-01, 2.75305214e-01], [ 9.63202573e-01, 5.53864931e-01, 2.71909159e-01], [ 9.65023656e-01, 5.59118349e-01, 2.68513200e-01], [ 9.66798470e-01, 5.64396327e-01, 2.65117752e-01], [ 9.68525639e-01, 5.69699633e-01, 2.61721488e-01], [ 9.70204593e-01, 5.75028270e-01, 2.58325424e-01], [ 9.71835007e-01, 5.80382015e-01, 2.54931256e-01], [ 9.73416145e-01, 5.85761012e-01, 2.51539615e-01], [ 9.74947262e-01, 5.91165394e-01, 2.48151200e-01], [ 9.76427606e-01, 5.96595287e-01, 2.44766775e-01], [ 9.77856416e-01, 6.02050811e-01, 2.41387186e-01], [ 9.79232922e-01, 6.07532077e-01, 2.38013359e-01], [ 9.80556344e-01, 6.13039190e-01, 2.34646316e-01], [ 9.81825890e-01, 6.18572250e-01, 2.31287178e-01], [ 9.83040742e-01, 6.24131362e-01, 2.27937141e-01], [ 9.84198924e-01, 6.29717516e-01, 2.24595006e-01], [ 9.85300760e-01, 6.35329876e-01, 2.21264889e-01], [ 9.86345421e-01, 6.40968508e-01, 2.17948456e-01], [ 9.87332067e-01, 6.46633475e-01, 2.14647532e-01], [ 9.88259846e-01, 6.52324832e-01, 2.11364122e-01], [ 9.89127893e-01, 6.58042630e-01, 2.08100426e-01], [ 9.89935328e-01, 6.63786914e-01, 2.04858855e-01], [ 9.90681261e-01, 6.69557720e-01, 2.01642049e-01], [ 9.91364787e-01, 6.75355082e-01, 1.98452900e-01], [ 9.91984990e-01, 6.81179025e-01, 1.95294567e-01], [ 9.92540939e-01, 6.87029567e-01, 1.92170500e-01], [ 9.93031693e-01, 6.92906719e-01, 1.89084459e-01], [ 9.93456302e-01, 6.98810484e-01, 1.86040537e-01], [ 9.93813802e-01, 7.04740854e-01, 1.83043180e-01], [ 9.94103226e-01, 7.10697814e-01, 1.80097207e-01], [ 9.94323596e-01, 7.16681336e-01, 1.77207826e-01], [ 9.94473934e-01, 7.22691379e-01, 1.74380656e-01], [ 9.94553260e-01, 7.28727890e-01, 1.71621733e-01], [ 9.94560594e-01, 7.34790799e-01, 1.68937522e-01], [ 9.94494964e-01, 7.40880020e-01, 1.66334918e-01], [ 9.94355411e-01, 7.46995448e-01, 1.63821243e-01], [ 9.94140989e-01, 7.53136955e-01, 1.61404226e-01], [ 9.93850778e-01, 7.59304390e-01, 1.59091984e-01], [ 9.93482190e-01, 7.65498551e-01, 1.56890625e-01], [ 9.93033251e-01, 7.71719833e-01, 1.54807583e-01], [ 9.92505214e-01, 7.77966775e-01, 1.52854862e-01], [ 9.91897270e-01, 7.84239120e-01, 1.51041581e-01], [ 9.91208680e-01, 7.90536569e-01, 1.49376885e-01], [ 9.90438793e-01, 7.96858775e-01, 1.47869810e-01], [ 9.89587065e-01, 8.03205337e-01, 1.46529128e-01], [ 9.88647741e-01, 8.09578605e-01, 1.45357284e-01], [ 9.87620557e-01, 8.15977942e-01, 1.44362644e-01], [ 9.86509366e-01, 8.22400620e-01, 1.43556679e-01], [ 9.85314198e-01, 8.28845980e-01, 1.42945116e-01], [ 9.84031139e-01, 8.35315360e-01, 1.42528388e-01], [ 9.82652820e-01, 8.41811730e-01, 1.42302653e-01], [ 9.81190389e-01, 8.48328902e-01, 1.42278607e-01], [ 9.79643637e-01, 8.54866468e-01, 1.42453425e-01], [ 9.77994918e-01, 8.61432314e-01, 1.42808191e-01], [ 9.76264977e-01, 8.68015998e-01, 1.43350944e-01], [ 9.74443038e-01, 8.74622194e-01, 1.44061156e-01], [ 9.72530009e-01, 8.81250063e-01, 1.44922913e-01], [ 9.70532932e-01, 8.87896125e-01, 1.45918663e-01], [ 9.68443477e-01, 8.94563989e-01, 1.47014438e-01], [ 9.66271225e-01, 9.01249365e-01, 1.48179639e-01], [ 9.64021057e-01, 9.07950379e-01, 1.49370428e-01], [ 9.61681481e-01, 9.14672479e-01, 1.50520343e-01], [ 9.59275646e-01, 9.21406537e-01, 1.51566019e-01], [ 9.56808068e-01, 9.28152065e-01, 1.52409489e-01], [ 9.54286813e-01, 9.34907730e-01, 1.52921158e-01], [ 9.51726083e-01, 9.41670605e-01, 1.52925363e-01], [ 9.49150533e-01, 9.48434900e-01, 1.52177604e-01], [ 9.46602270e-01, 9.55189860e-01, 1.50327944e-01], [ 9.44151742e-01, 9.61916487e-01, 1.46860789e-01], [ 9.41896120e-01, 9.68589814e-01, 1.40955606e-01], [ 9.40015097e-01, 9.75158357e-01, 1.31325517e-01]] test_cm = LinearSegmentedColormap.from_list(__file__, cm_data) if __name__ == "__main__": import matplotlib.pyplot as plt import numpy as np try: from viscm import viscm viscm(test_cm) except ImportError: print("viscm not found, falling back on simple display") plt.imshow(np.linspace(0, 100, 256)[None, :], aspect='auto', cmap=test_cm) plt.show()
[ 1, 29871, 13, 3166, 22889, 29889, 27703, 1053, 22985, 17669, 358, 287, 1625, 555, 481, 13, 3166, 12655, 1053, 23432, 29892, 3041, 13, 13, 29937, 501, 8485, 304, 337, 11433, 278, 784, 555, 481, 297, 1998, 4912, 13, 16744, 353, 11117, 26330, 2396, 21069, 29945, 29889, 29946, 29947, 29929, 29945, 29906, 29929, 29906, 29945, 29946, 29941, 29953, 29947, 29953, 29955, 29953, 29946, 29892, 29871, 29896, 29946, 29889, 29955, 29929, 29900, 29945, 29955, 29896, 29953, 29953, 29929, 29945, 29947, 29953, 29953, 29945, 29946, 29892, 29871, 29947, 29906, 29889, 29945, 29945, 29946, 29953, 29953, 29947, 29955, 29946, 29941, 29896, 29900, 29945, 29953, 29892, 29871, 29906, 29929, 29889, 29896, 29945, 29945, 29941, 29896, 29896, 29896, 29946, 29896, 29941, 29929, 29906, 29945, 29941, 29892, 448, 29946, 29889, 29896, 29941, 29896, 29953, 29955, 29953, 29929, 29947, 29947, 29953, 29929, 29945, 29896, 29955, 29953, 29896, 29892, 448, 29896, 29941, 29889, 29900, 29900, 29906, 29900, 29955, 29953, 29946, 29941, 29947, 29929, 29900, 29955, 29906, 29941, 29947, 1402, 13, 795, 525, 1478, 2396, 21069, 29941, 29945, 29889, 29929, 29946, 29947, 29896, 29953, 29947, 29947, 29941, 29929, 29906, 29941, 29900, 29941, 29900, 29953, 29892, 448, 29946, 29906, 29889, 29906, 29955, 29941, 29941, 29955, 29953, 29896, 29945, 29929, 29947, 29947, 29945, 29955, 29947, 29945, 29892, 448, 29906, 29947, 29889, 29947, 29946, 29945, 29946, 29953, 29955, 29945, 29906, 29941, 29896, 29929, 29955, 29953, 29929, 29947, 29892, 29871, 29945, 29906, 29889, 29900, 29941, 29946, 29906, 29953, 29896, 29906, 29946, 29896, 29929, 29955, 29892, 29871, 29941, 29953, 29889, 29947, 29941, 29906, 29955, 29896, 29906, 29953, 29900, 29900, 29947, 29953, 29947, 29929, 29955, 29941, 29892, 29871, 29946, 29900, 29889, 29955, 29929, 29906, 29906, 29929, 29896, 29906, 29906, 29900, 29945, 29945, 29953, 29955, 29941, 29946, 1402, 13, 795, 525, 1195, 29918, 29967, 29968, 2396, 29871, 29896, 29953, 29889, 29947, 29941, 29896, 29946, 29896, 29945, 29900, 29941, 29900, 29945, 29892, 13, 795, 525, 3317, 29918, 29967, 29968, 2396, 29871, 29929, 29945, 29913, 13, 13, 4912, 29918, 1272, 353, 5519, 259, 29945, 29889, 29900, 29941, 29947, 29941, 29906, 29896, 29941, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29906, 29889, 29929, 29947, 29900, 29906, 29947, 29929, 29955, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29906, 29955, 29929, 29955, 29946, 29947, 29947, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29941, 29945, 29941, 29953, 29941, 29953, 29941, 29929, 29872, 29899, 29900, 29906, 29892, 1678, 29906, 29889, 29947, 29946, 29906, 29945, 29929, 29955, 29906, 29929, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29941, 29941, 29896, 29906, 29941, 29953, 29947, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29945, 29941, 29945, 29941, 29896, 29906, 29941, 29946, 29872, 29899, 29900, 29906, 29892, 1678, 29906, 29889, 29955, 29906, 29900, 29953, 29941, 29955, 29906, 29947, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29941, 29947, 29900, 29900, 29955, 29900, 29900, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29953, 29906, 29906, 29896, 29955, 29929, 29955, 29929, 29872, 29899, 29900, 29906, 29892, 1678, 29906, 29889, 29953, 29896, 29906, 29945, 29941, 29906, 29900, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29946, 29906, 29953, 29945, 29955, 29953, 29929, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29941, 29955, 29947, 29953, 29900, 29929, 29955, 29872, 29899, 29900, 29906, 29892, 1678, 29906, 29889, 29945, 29896, 29953, 29945, 29900, 29929, 29955, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29946, 29955, 29896, 29900, 29941, 29946, 29947, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29900, 29945, 29929, 29955, 29929, 29955, 29900, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29946, 29941, 29900, 29929, 29906, 29946, 29941, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29945, 29896, 29941, 29953, 29955, 29947, 29945, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29896, 29945, 29896, 29906, 29941, 29953, 29946, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29941, 29945, 29945, 29953, 29906, 29945, 29900, 29900, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29945, 29945, 29946, 29953, 29955, 29955, 29906, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29906, 29941, 29929, 29900, 29906, 29929, 29900, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29906, 29947, 29955, 29947, 29896, 29900, 29896, 29896, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29945, 29929, 29946, 29906, 29941, 29946, 29947, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29941, 29906, 29941, 29947, 29900, 29955, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29906, 29906, 29945, 29947, 29941, 29955, 29955, 29946, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29953, 29941, 29906, 29945, 29900, 29896, 29896, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29946, 29900, 29953, 29900, 29941, 29900, 29955, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29896, 29953, 29947, 29953, 29953, 29953, 29955, 29946, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29953, 29953, 29929, 29945, 29929, 29946, 29947, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29946, 29947, 29953, 29900, 29953, 29945, 29906, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29896, 29896, 29945, 29941, 29945, 29947, 29955, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29955, 29900, 29945, 29953, 29896, 29955, 29896, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29945, 29953, 29946, 29906, 29900, 29953, 29946, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29953, 29945, 29900, 29955, 29896, 29955, 29946, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29955, 29946, 29900, 29953, 29945, 29946, 29946, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29953, 29946, 29900, 29953, 29929, 29955, 29906, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29896, 29955, 29900, 29945, 29941, 29906, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29955, 29955, 29946, 29955, 29947, 29900, 29955, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29955, 29896, 29945, 29955, 29941, 29929, 29906, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29929, 29955, 29900, 29953, 29941, 29946, 29896, 29945, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29947, 29900, 29947, 29900, 29945, 29947, 29929, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29955, 29947, 29929, 29945, 29900, 29906, 29896, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29929, 29906, 29945, 29906, 29906, 29906, 29946, 29941, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29947, 29946, 29900, 29945, 29946, 29906, 29946, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29947, 29953, 29906, 29896, 29906, 29929, 29945, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29947, 29900, 29906, 29929, 29955, 29953, 29955, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29947, 29955, 29906, 29906, 29955, 29953, 29953, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29896, 29889, 29929, 29941, 29941, 29955, 29946, 29946, 29946, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29941, 29945, 29946, 29900, 29945, 29929, 29941, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29929, 29900, 29941, 29906, 29929, 29929, 29945, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29900, 29900, 29946, 29946, 29945, 29906, 29953, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29955, 29929, 29900, 29896, 29945, 29945, 29896, 29906, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29929, 29941, 29941, 29953, 29946, 29941, 29900, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29900, 29955, 29946, 29941, 29946, 29945, 29945, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29955, 29946, 29946, 29906, 29896, 29900, 29947, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29929, 29953, 29941, 29941, 29941, 29941, 29946, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29896, 29946, 29941, 29945, 29900, 29906, 29929, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29929, 29955, 29906, 29929, 29906, 29955, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29945, 29889, 29929, 29929, 29906, 29941, 29929, 29906, 29900, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29906, 29896, 29896, 29929, 29953, 29955, 29945, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29946, 29929, 29955, 29900, 29946, 29947, 29946, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29900, 29906, 29900, 29947, 29941, 29941, 29906, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29906, 29955, 29929, 29947, 29906, 29929, 29955, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29900, 29900, 29955, 29896, 29945, 29900, 29929, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29900, 29946, 29947, 29953, 29955, 29946, 29900, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29941, 29946, 29955, 29896, 29946, 29945, 29941, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29945, 29900, 29896, 29945, 29900, 29953, 29945, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29900, 29955, 29945, 29929, 29906, 29946, 29941, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29946, 29896, 29941, 29929, 29953, 29906, 29945, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29929, 29955, 29929, 29896, 29900, 29946, 29896, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29896, 29900, 29906, 29945, 29929, 29900, 29947, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29946, 29947, 29900, 29941, 29906, 29941, 29955, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29946, 29941, 29929, 29941, 29945, 29947, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29896, 29906, 29947, 29953, 29955, 29955, 29946, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29945, 29946, 29953, 29906, 29953, 29953, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29941, 29947, 29947, 29906, 29900, 29929, 29896, 29947, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29896, 29945, 29946, 29896, 29947, 29945, 29941, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29953, 29896, 29896, 29947, 29906, 29945, 29953, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29941, 29941, 29900, 29955, 29945, 29896, 29945, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29896, 29955, 29929, 29896, 29896, 29941, 29947, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29953, 29955, 29955, 29900, 29906, 29929, 29929, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29906, 29955, 29896, 29953, 29906, 29896, 29953, 29941, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29906, 29900, 29941, 29946, 29945, 29929, 29929, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29955, 29946, 29896, 29929, 29900, 29953, 29953, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29906, 29896, 29900, 29929, 29896, 29946, 29906, 29941, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29906, 29906, 29955, 29906, 29896, 29929, 29900, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29947, 29900, 29953, 29946, 29955, 29929, 29953, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29896, 29946, 29947, 29955, 29945, 29929, 29896, 29945, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29906, 29945, 29900, 29941, 29947, 29946, 29953, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29947, 29955, 29900, 29955, 29953, 29900, 29945, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29900, 29947, 29945, 29945, 29946, 29947, 29953, 29906, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29906, 29955, 29906, 29929, 29946, 29929, 29955, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29929, 29941, 29946, 29955, 29955, 29953, 29929, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29900, 29906, 29896, 29906, 29947, 29947, 29946, 29929, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29906, 29929, 29946, 29929, 29900, 29946, 29929, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29906, 29889, 29929, 29929, 29947, 29945, 29945, 29896, 29906, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29945, 29953, 29900, 29955, 29929, 29945, 29945, 29896, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29941, 29896, 29953, 29906, 29941, 29929, 29906, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29900, 29953, 29906, 29900, 29929, 29947, 29906, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29929, 29900, 29896, 29947, 29945, 29941, 29946, 29953, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29941, 29941, 29953, 29929, 29946, 29896, 29900, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29896, 29906, 29945, 29946, 29941, 29896, 29906, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29906, 29941, 29929, 29900, 29900, 29955, 29900, 29946, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29941, 29945, 29953, 29929, 29929, 29955, 29945, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29896, 29947, 29947, 29945, 29953, 29896, 29947, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29945, 29955, 29945, 29945, 29896, 29900, 29945, 29896, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29941, 29955, 29953, 29941, 29929, 29945, 29941, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29906, 29945, 29896, 29945, 29900, 29900, 29906, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29929, 29896, 29946, 29929, 29896, 29955, 29941, 29946, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29941, 29929, 29945, 29896, 29906, 29900, 29900, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29941, 29896, 29946, 29906, 29945, 29945, 29946, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29906, 29953, 29896, 29900, 29955, 29941, 29955, 29929, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29946, 29896, 29941, 29896, 29945, 29953, 29946, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29941, 29955, 29953, 29947, 29941, 29946, 29946, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29953, 29896, 29947, 29941, 29900, 29947, 29947, 29929, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29946, 29941, 29900, 29946, 29947, 29929, 29941, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29946, 29941, 29929, 29906, 29946, 29945, 29929, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29929, 29929, 29900, 29945, 29941, 29900, 29947, 29900, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29946, 29946, 29955, 29896, 29900, 29896, 29929, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29945, 29900, 29896, 29946, 29929, 29953, 29929, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29941, 29947, 29906, 29900, 29906, 29945, 29945, 29955, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29946, 29953, 29906, 29929, 29955, 29955, 29896, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29945, 29953, 29941, 29945, 29929, 29906, 29900, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29955, 29929, 29955, 29947, 29896, 29955, 29953, 29896, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29946, 29955, 29947, 29900, 29929, 29955, 29955, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29953, 29906, 29945, 29945, 29941, 29946, 29955, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29906, 29946, 29941, 29896, 29929, 29945, 29929, 29896, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29946, 29929, 29906, 29946, 29946, 29953, 29946, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29953, 29947, 29955, 29941, 29906, 29955, 29953, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29955, 29906, 29941, 29955, 29900, 29955, 29906, 29896, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29900, 29953, 29900, 29900, 29945, 29953, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29955, 29946, 29947, 29929, 29955, 29906, 29955, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29906, 29946, 29945, 29896, 29946, 29947, 29929, 29955, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29896, 29947, 29955, 29945, 29955, 29953, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29947, 29896, 29900, 29946, 29955, 29896, 29896, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29896, 29941, 29945, 29953, 29906, 29900, 29945, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29941, 29900, 29953, 29947, 29946, 29953, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29947, 29955, 29896, 29947, 29906, 29953, 29941, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29941, 29946, 29946, 29953, 29929, 29906, 29941, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29946, 29896, 29955, 29953, 29955, 29953, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29929, 29941, 29941, 29900, 29946, 29900, 29896, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29896, 29896, 29941, 29947, 29947, 29906, 29945, 29929, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29945, 29896, 29929, 29947, 29955, 29945, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29941, 29889, 29929, 29929, 29946, 29896, 29900, 29947, 29906, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29945, 29929, 29946, 29906, 29900, 29947, 29900, 29929, 29872, 29899, 29900, 29946, 29892, 1678, 29953, 29889, 29945, 29953, 29896, 29941, 29906, 29947, 29941, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29900, 29945, 29945, 29900, 29906, 29929, 29896, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29955, 29947, 29900, 29929, 29896, 29945, 29896, 29955, 29872, 29899, 29900, 29946, 29892, 1678, 29953, 29889, 29945, 29953, 29929, 29955, 29955, 29906, 29955, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29896, 29896, 29945, 29947, 29900, 29900, 29947, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29955, 29955, 29896, 29900, 29896, 29955, 29941, 29945, 29872, 29899, 29900, 29946, 29892, 1678, 29953, 29889, 29945, 29955, 29955, 29941, 29900, 29941, 29947, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29896, 29955, 29953, 29946, 29906, 29900, 29953, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29953, 29941, 29947, 29946, 29955, 29946, 29955, 29953, 29872, 29899, 29900, 29946, 29892, 1678, 29953, 29889, 29945, 29947, 29941, 29929, 29900, 29946, 29929, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29906, 29941, 29953, 29947, 29947, 29945, 29946, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29946, 29945, 29929, 29900, 29906, 29955, 29947, 29900, 29872, 29899, 29900, 29946, 29892, 1678, 29953, 29889, 29945, 29947, 29929, 29945, 29953, 29900, 29900, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29906, 29929, 29955, 29896, 29929, 29896, 29947, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29941, 29896, 29900, 29900, 29947, 29906, 29900, 29955, 29872, 29899, 29900, 29946, 29892, 1678, 29953, 29889, 29945, 29929, 29946, 29906, 29945, 29941, 29953, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29941, 29945, 29955, 29941, 29941, 29945, 29955, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29896, 29906, 29955, 29900, 29945, 29947, 29955, 29945, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29929, 29955, 29929, 29955, 29900, 29955, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29946, 29896, 29955, 29941, 29906, 29896, 29906, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29941, 29929, 29947, 29946, 29955, 29955, 29929, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29953, 29900, 29900, 29953, 29929, 29900, 29900, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29946, 29955, 29955, 29896, 29941, 29953, 29900, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29955, 29929, 29945, 29946, 29955, 29946, 29946, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29953, 29900, 29906, 29946, 29900, 29941, 29953, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29945, 29941, 29953, 29955, 29955, 29941, 29929, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29955, 29945, 29946, 29955, 29900, 29941, 29900, 29906, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29953, 29900, 29941, 29900, 29929, 29929, 29953, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29945, 29929, 29953, 29906, 29906, 29929, 29941, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29945, 29955, 29941, 29955, 29946, 29946, 29896, 29945, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29953, 29900, 29906, 29955, 29953, 29953, 29945, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29953, 29945, 29945, 29946, 29929, 29953, 29941, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29945, 29946, 29945, 29896, 29947, 29900, 29947, 29946, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29953, 29900, 29896, 29941, 29929, 29941, 29947, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29955, 29896, 29946, 29945, 29953, 29947, 29946, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29953, 29955, 29955, 29945, 29947, 29955, 29953, 29906, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29929, 29947, 29929, 29955, 29906, 29896, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29955, 29955, 29941, 29946, 29941, 29929, 29906, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29929, 29955, 29929, 29945, 29947, 29955, 29946, 29941, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29929, 29945, 29946, 29929, 29941, 29896, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29947, 29941, 29906, 29896, 29900, 29896, 29929, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29946, 29945, 29929, 29947, 29941, 29946, 29929, 29946, 29872, 29899, 29900, 29941, 29892, 1678, 29953, 29889, 29945, 29929, 29900, 29929, 29946, 29929, 29947, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29947, 29929, 29900, 29945, 29946, 29929, 29945, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29900, 29896, 29906, 29953, 29929, 29929, 29929, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29947, 29945, 29941, 29941, 29953, 29955, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29946, 29889, 29929, 29946, 29947, 29955, 29955, 29946, 29953, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29896, 29929, 29947, 29929, 29955, 29946, 29947, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29955, 29947, 29953, 29946, 29929, 29946, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29900, 29900, 29953, 29955, 29955, 29953, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29900, 29945, 29945, 29900, 29953, 29946, 29900, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29955, 29900, 29947, 29955, 29945, 29953, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29900, 29953, 29946, 29945, 29946, 29896, 29946, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29941, 29941, 29941, 29941, 29946, 29946, 29941, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29953, 29906, 29900, 29906, 29906, 29929, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29896, 29906, 29906, 29900, 29953, 29900, 29941, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29947, 29941, 29941, 29906, 29906, 29941, 29906, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29945, 29906, 29900, 29929, 29906, 29906, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29896, 29955, 29929, 29941, 29906, 29945, 29947, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29896, 29945, 29953, 29941, 29896, 29929, 29896, 29947, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29946, 29896, 29900, 29947, 29945, 29946, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29906, 29941, 29953, 29941, 29906, 29929, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29946, 29945, 29941, 29896, 29953, 29946, 29953, 29947, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29906, 29929, 29900, 29900, 29953, 29906, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29906, 29929, 29941, 29900, 29953, 29946, 29955, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29955, 29955, 29946, 29953, 29947, 29955, 29941, 29945, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29896, 29945, 29947, 29953, 29900, 29896, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29941, 29946, 29929, 29945, 29906, 29906, 29946, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29896, 29906, 29896, 29955, 29900, 29941, 29900, 29900, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29945, 29900, 29896, 29953, 29945, 29941, 29929, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29946, 29900, 29945, 29953, 29929, 29945, 29896, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29946, 29929, 29945, 29900, 29896, 29941, 29896, 29900, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29946, 29947, 29953, 29941, 29929, 29953, 29953, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29946, 29953, 29896, 29945, 29955, 29946, 29929, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29947, 29929, 29945, 29946, 29900, 29941, 29941, 29946, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29946, 29955, 29900, 29900, 29929, 29947, 29947, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29945, 29896, 29955, 29896, 29945, 29946, 29906, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29941, 29896, 29941, 29953, 29946, 29955, 29929, 29945, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29946, 29945, 29906, 29955, 29955, 29906, 29955, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29945, 29955, 29906, 29946, 29906, 29945, 29941, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29955, 29941, 29941, 29900, 29955, 29945, 29947, 29945, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29946, 29941, 29946, 29946, 29941, 29906, 29945, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29953, 29906, 29955, 29941, 29947, 29900, 29929, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29896, 29945, 29946, 29946, 29947, 29900, 29929, 29906, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29946, 29896, 29945, 29900, 29929, 29941, 29947, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29953, 29947, 29906, 29900, 29896, 29941, 29955, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29945, 29955, 29955, 29955, 29953, 29955, 29900, 29953, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29941, 29929, 29946, 29955, 29955, 29946, 29946, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29955, 29941, 29953, 29941, 29896, 29947, 29945, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29900, 29900, 29906, 29947, 29896, 29941, 29953, 29929, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29941, 29955, 29941, 29946, 29947, 29947, 29946, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29955, 29929, 29900, 29906, 29947, 29953, 29947, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29946, 29906, 29929, 29945, 29945, 29945, 29946, 29955, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29941, 29945, 29896, 29906, 29953, 29896, 29900, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29947, 29946, 29941, 29929, 29896, 29896, 29941, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29947, 29945, 29955, 29929, 29900, 29906, 29953, 29896, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29941, 29906, 29947, 29896, 29896, 29953, 29900, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29947, 29929, 29955, 29896, 29947, 29953, 29900, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29906, 29947, 29955, 29955, 29945, 29947, 29955, 29945, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29941, 29900, 29946, 29900, 29955, 29955, 29906, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29945, 29889, 29929, 29945, 29900, 29896, 29900, 29945, 29900, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29955, 29896, 29929, 29900, 29906, 29947, 29955, 29947, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29906, 29955, 29929, 29896, 29953, 29929, 29929, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29900, 29900, 29906, 29953, 29953, 29906, 29947, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29896, 29945, 29896, 29953, 29896, 29947, 29929, 29945, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29906, 29945, 29941, 29946, 29906, 29900, 29945, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29900, 29945, 29946, 29947, 29945, 29946, 29906, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29945, 29947, 29945, 29946, 29941, 29955, 29896, 29941, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29906, 29906, 29953, 29947, 29945, 29955, 29900, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29896, 29900, 29953, 29953, 29955, 29946, 29953, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29900, 29906, 29900, 29941, 29929, 29941, 29900, 29941, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29896, 29929, 29929, 29945, 29900, 29947, 29896, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29896, 29945, 29947, 29896, 29896, 29929, 29955, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29946, 29945, 29953, 29941, 29929, 29947, 29941, 29947, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29896, 29955, 29896, 29946, 29900, 29941, 29953, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29906, 29900, 29929, 29896, 29947, 29945, 29945, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29947, 29929, 29941, 29941, 29953, 29955, 29906, 29896, 29872, 29899, 29900, 29906, 29892, 1678, 29953, 29889, 29896, 29946, 29906, 29945, 29955, 29946, 29946, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29906, 29945, 29929, 29947, 29953, 29947, 29953, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29900, 29941, 29941, 29896, 29906, 29896, 29953, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29896, 29896, 29941, 29900, 29945, 29896, 29955, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29941, 29896, 29900, 29896, 29953, 29953, 29896, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29900, 29955, 29953, 29929, 29947, 29953, 29946, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29900, 29947, 29906, 29947, 29953, 29955, 29955, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29941, 29953, 29900, 29900, 29955, 29945, 29946, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29896, 29906, 29900, 29929, 29906, 29941, 29941, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29900, 29945, 29906, 29900, 29945, 29946, 29929, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29946, 29900, 29929, 29945, 29929, 29946, 29946, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29896, 29953, 29946, 29929, 29906, 29946, 29929, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29900, 29906, 29900, 29953, 29946, 29953, 29896, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29946, 29945, 29947, 29955, 29906, 29896, 29945, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29906, 29900, 29947, 29929, 29947, 29946, 29900, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29929, 29947, 29947, 29953, 29955, 29946, 29946, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29945, 29900, 29955, 29946, 29945, 29945, 29955, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29906, 29945, 29941, 29900, 29929, 29941, 29947, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29929, 29945, 29953, 29896, 29955, 29941, 29900, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29945, 29945, 29945, 29955, 29929, 29953, 29896, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29906, 29929, 29955, 29906, 29946, 29955, 29947, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29929, 29906, 29941, 29896, 29955, 29946, 29929, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29953, 29900, 29941, 29955, 29946, 29906, 29953, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29941, 29946, 29896, 29946, 29941, 29929, 29929, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29947, 29947, 29929, 29955, 29896, 29941, 29896, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29953, 29945, 29896, 29906, 29929, 29946, 29929, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29941, 29947, 29945, 29953, 29953, 29946, 29906, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29947, 29945, 29945, 29947, 29906, 29941, 29900, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29953, 29929, 29947, 29946, 29945, 29941, 29947, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29906, 29929, 29929, 29896, 29945, 29946, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29947, 29906, 29896, 29945, 29941, 29945, 29955, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29955, 29946, 29945, 29906, 29906, 29900, 29953, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29955, 29946, 29896, 29947, 29947, 29941, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29955, 29947, 29953, 29947, 29947, 29906, 29946, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29955, 29929, 29896, 29945, 29929, 29953, 29953, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29896, 29947, 29946, 29955, 29947, 29945, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29955, 29945, 29896, 29947, 29929, 29946, 29941, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29947, 29941, 29955, 29945, 29947, 29941, 29947, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29953, 29906, 29955, 29947, 29896, 29953, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29955, 29896, 29953, 29953, 29900, 29896, 29945, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29947, 29947, 29941, 29896, 29947, 29946, 29946, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29900, 29955, 29900, 29929, 29941, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29953, 29947, 29896, 29900, 29941, 29941, 29947, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29929, 29906, 29947, 29946, 29900, 29900, 29947, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29945, 29896, 29946, 29896, 29896, 29955, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29953, 29946, 29945, 29906, 29896, 29929, 29945, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29953, 29889, 29929, 29955, 29941, 29906, 29941, 29953, 29896, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29929, 29945, 29955, 29941, 29906, 29896, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29953, 29900, 29929, 29896, 29947, 29953, 29945, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29900, 29896, 29955, 29953, 29929, 29941, 29941, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29955, 29946, 29900, 29900, 29945, 29906, 29941, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29945, 29955, 29906, 29929, 29953, 29896, 29946, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29900, 29953, 29896, 29955, 29955, 29945, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29955, 29947, 29946, 29941, 29955, 29900, 29900, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29945, 29941, 29953, 29945, 29953, 29929, 29955, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29896, 29900, 29945, 29946, 29947, 29955, 29946, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29906, 29947, 29953, 29947, 29941, 29900, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29945, 29900, 29900, 29900, 29941, 29945, 29955, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29896, 29946, 29947, 29947, 29941, 29896, 29929, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29955, 29906, 29929, 29947, 29929, 29947, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29946, 29953, 29941, 29941, 29947, 29906, 29929, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29896, 29929, 29896, 29947, 29896, 29941, 29941, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29929, 29896, 29955, 29906, 29947, 29929, 29900, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29946, 29906, 29953, 29953, 29941, 29941, 29941, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29906, 29941, 29946, 29946, 29941, 29953, 29900, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29929, 29953, 29896, 29945, 29955, 29929, 29953, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29941, 29947, 29929, 29947, 29900, 29955, 29947, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29906, 29955, 29953, 29955, 29900, 29946, 29906, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29900, 29945, 29947, 29953, 29900, 29947, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29941, 29945, 29906, 29929, 29906, 29953, 29896, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29941, 29896, 29947, 29953, 29906, 29906, 29941, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29945, 29900, 29896, 29941, 29896, 29955, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29941, 29896, 29953, 29900, 29900, 29929, 29929, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29941, 29953, 29900, 29896, 29929, 29946, 29906, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29929, 29946, 29941, 29929, 29900, 29955, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29906, 29955, 29929, 29900, 29947, 29946, 29941, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29946, 29900, 29896, 29946, 29906, 29945, 29945, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29896, 29941, 29947, 29953, 29941, 29929, 29953, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29906, 29946, 29906, 29896, 29945, 29945, 29941, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29946, 29946, 29906, 29941, 29906, 29896, 29900, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29896, 29947, 29906, 29947, 29955, 29947, 29929, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29906, 29900, 29945, 29906, 29941, 29955, 29953, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29946, 29947, 29906, 29947, 29947, 29945, 29941, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29906, 29906, 29955, 29896, 29900, 29929, 29946, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29896, 29953, 29947, 29941, 29946, 29946, 29929, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29945, 29906, 29941, 29896, 29906, 29941, 29906, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29906, 29955, 29896, 29941, 29941, 29896, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29896, 29941, 29896, 29946, 29947, 29929, 29953, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29945, 29953, 29941, 29900, 29941, 29929, 29941, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29941, 29896, 29945, 29945, 29946, 29955, 29946, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29900, 29929, 29946, 29953, 29947, 29941, 29900, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29953, 29900, 29906, 29953, 29941, 29947, 29946, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29941, 29945, 29929, 29955, 29945, 29955, 29953, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29900, 29945, 29955, 29929, 29941, 29945, 29946, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29953, 29946, 29896, 29929, 29906, 29945, 29896, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29946, 29900, 29941, 29929, 29953, 29941, 29929, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29900, 29906, 29896, 29906, 29945, 29945, 29929, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29953, 29947, 29900, 29929, 29900, 29941, 29929, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29946, 29946, 29947, 29896, 29953, 29947, 29896, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29929, 29947, 29946, 29953, 29945, 29906, 29929, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29955, 29896, 29929, 29945, 29955, 29929, 29896, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29946, 29929, 29906, 29941, 29955, 29906, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29929, 29946, 29947, 29896, 29941, 29941, 29941, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29955, 29945, 29955, 29929, 29945, 29945, 29906, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29945, 29941, 29953, 29945, 29955, 29955, 29929, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29929, 29896, 29896, 29955, 29900, 29945, 29896, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29955, 29929, 29953, 29900, 29941, 29953, 29896, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29945, 29947, 29900, 29955, 29947, 29941, 29929, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29947, 29955, 29945, 29941, 29929, 29896, 29906, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29947, 29941, 29941, 29947, 29906, 29953, 29941, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29953, 29906, 29946, 29929, 29929, 29953, 29953, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29947, 29941, 29929, 29896, 29955, 29955, 29941, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29947, 29955, 29896, 29941, 29906, 29929, 29955, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29953, 29953, 29929, 29906, 29896, 29947, 29945, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29947, 29900, 29941, 29900, 29953, 29955, 29900, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29929, 29900, 29947, 29945, 29945, 29900, 29896, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29955, 29896, 29941, 29946, 29945, 29906, 29953, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29955, 29953, 29955, 29900, 29953, 29941, 29896, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29929, 29946, 29945, 29946, 29929, 29896, 29900, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29955, 29945, 29955, 29955, 29900, 29896, 29955, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29955, 29941, 29896, 29896, 29953, 29955, 29929, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29955, 29889, 29929, 29947, 29906, 29896, 29945, 29945, 29955, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29947, 29900, 29896, 29929, 29953, 29929, 29900, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29953, 29929, 29945, 29941, 29947, 29906, 29947, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29900, 29896, 29947, 29945, 29946, 29955, 29945, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29947, 29946, 29953, 29906, 29945, 29955, 29945, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29953, 29945, 29929, 29955, 29900, 29947, 29955, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29900, 29945, 29946, 29953, 29953, 29929, 29946, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29947, 29929, 29900, 29945, 29955, 29900, 29945, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29953, 29906, 29946, 29896, 29946, 29945, 29947, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29900, 29929, 29900, 29945, 29906, 29946, 29896, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29929, 29941, 29946, 29929, 29896, 29896, 29896, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29945, 29947, 29947, 29953, 29929, 29945, 29955, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29896, 29906, 29953, 29896, 29896, 29945, 29900, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29929, 29955, 29929, 29906, 29955, 29947, 29953, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29945, 29945, 29941, 29941, 29955, 29945, 29953, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29896, 29953, 29896, 29946, 29946, 29941, 29947, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29900, 29906, 29941, 29953, 29947, 29896, 29941, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29945, 29896, 29947, 29896, 29953, 29941, 29947, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29896, 29929, 29953, 29945, 29896, 29906, 29945, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29900, 29953, 29947, 29896, 29906, 29906, 29947, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29946, 29947, 29941, 29900, 29945, 29947, 29953, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29906, 29941, 29896, 29941, 29906, 29941, 29900, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29896, 29896, 29906, 29953, 29900, 29955, 29900, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29946, 29946, 29947, 29900, 29945, 29955, 29947, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29906, 29953, 29945, 29947, 29955, 29955, 29900, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29896, 29945, 29955, 29896, 29941, 29955, 29947, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29946, 29896, 29941, 29896, 29945, 29929, 29900, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29941, 29900, 29900, 29896, 29955, 29945, 29947, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29906, 29900, 29896, 29955, 29896, 29929, 29896, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29941, 29955, 29947, 29941, 29945, 29929, 29946, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29941, 29941, 29946, 29906, 29906, 29900, 29945, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29906, 29946, 29953, 29941, 29945, 29946, 29929, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29941, 29946, 29941, 29953, 29945, 29953, 29896, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29941, 29953, 29947, 29900, 29896, 29906, 29941, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29906, 29929, 29896, 29900, 29946, 29947, 29941, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29941, 29900, 29929, 29900, 29945, 29900, 29945, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29946, 29900, 29896, 29945, 29945, 29906, 29955, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29941, 29941, 29945, 29947, 29900, 29896, 29900, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29906, 29955, 29946, 29945, 29946, 29947, 29941, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29946, 29941, 29946, 29947, 29946, 29896, 29900, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29941, 29947, 29900, 29953, 29906, 29896, 29900, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29906, 29946, 29900, 29896, 29941, 29900, 29945, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29946, 29953, 29955, 29947, 29955, 29955, 29906, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29946, 29906, 29945, 29945, 29896, 29906, 29955, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29906, 29900, 29945, 29955, 29929, 29941, 29941, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29945, 29900, 29900, 29953, 29953, 29896, 29941, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29946, 29955, 29900, 29946, 29947, 29900, 29906, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29896, 29955, 29896, 29945, 29941, 29906, 29953, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29945, 29941, 29941, 29896, 29929, 29906, 29955, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29945, 29896, 29945, 29945, 29906, 29947, 29896, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29896, 29941, 29955, 29941, 29946, 29946, 29946, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29945, 29953, 29945, 29946, 29955, 29896, 29900, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29945, 29953, 29900, 29953, 29953, 29900, 29955, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29896, 29900, 29941, 29906, 29906, 29946, 29953, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29945, 29929, 29955, 29946, 29929, 29945, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29953, 29900, 29945, 29947, 29947, 29906, 29906, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29900, 29953, 29929, 29896, 29953, 29929, 29955, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29953, 29906, 29929, 29906, 29953, 29945, 29945, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29953, 29945, 29896, 29896, 29929, 29946, 29900, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29900, 29941, 29945, 29896, 29947, 29947, 29900, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29953, 29953, 29900, 29955, 29955, 29929, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29953, 29929, 29953, 29953, 29900, 29946, 29946, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29900, 29900, 29896, 29906, 29953, 29900, 29906, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29953, 29929, 29906, 29900, 29941, 29946, 29941, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29955, 29946, 29906, 29896, 29896, 29955, 29929, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29929, 29953, 29955, 29941, 29947, 29906, 29896, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29955, 29906, 29941, 29900, 29906, 29929, 29896, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29955, 29947, 29955, 29955, 29941, 29929, 29896, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29929, 29941, 29941, 29945, 29946, 29929, 29946, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29955, 29945, 29941, 29955, 29953, 29896, 29946, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29947, 29941, 29941, 29946, 29955, 29906, 29946, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29947, 29929, 29929, 29955, 29945, 29947, 29941, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29955, 29947, 29946, 29906, 29906, 29947, 29929, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29947, 29955, 29929, 29941, 29906, 29906, 29946, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29947, 29953, 29953, 29900, 29900, 29946, 29953, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29947, 29896, 29946, 29946, 29906, 29929, 29896, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29929, 29906, 29945, 29906, 29929, 29941, 29941, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29947, 29941, 29906, 29906, 29947, 29953, 29906, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29947, 29946, 29946, 29941, 29945, 29929, 29947, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29929, 29955, 29896, 29941, 29947, 29947, 29955, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29955, 29929, 29947, 29953, 29900, 29906, 29946, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29947, 29955, 29946, 29900, 29896, 29953, 29947, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29900, 29896, 29955, 29953, 29896, 29945, 29896, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29955, 29953, 29946, 29929, 29946, 29906, 29941, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29929, 29900, 29941, 29941, 29929, 29953, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29900, 29953, 29941, 29929, 29955, 29953, 29929, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29955, 29941, 29896, 29941, 29900, 29906, 29906, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29929, 29941, 29906, 29946, 29929, 29953, 29946, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29896, 29896, 29900, 29946, 29955, 29947, 29955, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29953, 29929, 29955, 29953, 29955, 29947, 29929, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29929, 29953, 29896, 29941, 29896, 29896, 29929, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29896, 29945, 29955, 29896, 29906, 29946, 29947, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29953, 29953, 29946, 29900, 29953, 29929, 29900, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29947, 29889, 29929, 29947, 29929, 29947, 29941, 29929, 29941, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29906, 29900, 29941, 29929, 29896, 29929, 29947, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29953, 29941, 29900, 29946, 29953, 29929, 29953, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29900, 29896, 29947, 29900, 29955, 29946, 29945, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29906, 29945, 29900, 29947, 29953, 29947, 29900, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29945, 29929, 29953, 29947, 29955, 29955, 29945, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29900, 29946, 29953, 29900, 29896, 29906, 29929, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29906, 29929, 29955, 29929, 29955, 29946, 29946, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29945, 29953, 29941, 29906, 29947, 29955, 29929, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29900, 29955, 29941, 29953, 29946, 29929, 29929, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29941, 29946, 29945, 29906, 29946, 29941, 29941, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29945, 29906, 29929, 29953, 29929, 29955, 29955, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29896, 29900, 29900, 29929, 29947, 29900, 29947, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29941, 29929, 29906, 29953, 29955, 29929, 29900, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29946, 29929, 29953, 29896, 29900, 29946, 29953, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29896, 29906, 29947, 29900, 29900, 29900, 29929, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29946, 29946, 29900, 29906, 29947, 29945, 29955, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29946, 29953, 29906, 29945, 29900, 29953, 29945, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29896, 29945, 29946, 29955, 29900, 29945, 29896, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29946, 29947, 29947, 29900, 29953, 29955, 29946, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29946, 29906, 29947, 29929, 29900, 29896, 29946, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29896, 29947, 29896, 29900, 29947, 29947, 29946, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29945, 29941, 29953, 29900, 29906, 29947, 29896, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29941, 29929, 29945, 29906, 29947, 29955, 29955, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29906, 29900, 29955, 29896, 29946, 29941, 29947, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29945, 29947, 29946, 29896, 29955, 29946, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29941, 29953, 29896, 29953, 29945, 29945, 29947, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29906, 29941, 29906, 29947, 29953, 29953, 29953, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29953, 29941, 29906, 29945, 29900, 29947, 29906, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29941, 29906, 29947, 29900, 29900, 29947, 29906, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29906, 29945, 29947, 29906, 29945, 29896, 29946, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29953, 29947, 29896, 29900, 29941, 29941, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29906, 29929, 29946, 29941, 29946, 29945, 29896, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29906, 29947, 29941, 29906, 29929, 29906, 29955, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29955, 29906, 29929, 29955, 29945, 29946, 29953, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29906, 29953, 29900, 29953, 29953, 29945, 29945, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29941, 29900, 29955, 29929, 29947, 29946, 29953, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29955, 29955, 29947, 29953, 29955, 29946, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29906, 29906, 29953, 29929, 29953, 29947, 29955, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29941, 29941, 29906, 29941, 29906, 29896, 29946, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29947, 29906, 29955, 29955, 29929, 29953, 29900, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29896, 29929, 29941, 29906, 29945, 29946, 29946, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29941, 29945, 29953, 29906, 29929, 29953, 29947, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29947, 29955, 29955, 29896, 29906, 29941, 29945, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29896, 29945, 29929, 29945, 29906, 29906, 29896, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29941, 29955, 29929, 29929, 29900, 29900, 29941, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29929, 29906, 29953, 29953, 29953, 29945, 29946, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29896, 29906, 29945, 29955, 29945, 29946, 29946, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29900, 29941, 29896, 29906, 29929, 29941, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29946, 29889, 29929, 29955, 29953, 29946, 29906, 29900, 29941, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29900, 29929, 29896, 29929, 29953, 29953, 29906, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29906, 29945, 29929, 29955, 29955, 29955, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29900, 29906, 29953, 29941, 29929, 29896, 29946, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29900, 29945, 29947, 29896, 29945, 29947, 29906, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29946, 29947, 29946, 29941, 29947, 29929, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29900, 29955, 29953, 29945, 29947, 29896, 29953, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29941, 29889, 29900, 29906, 29946, 29941, 29941, 29896, 29900, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29955, 29900, 29945, 29900, 29953, 29953, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29896, 29906, 29953, 29929, 29929, 29941, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29929, 29929, 29900, 29946, 29947, 29945, 29945, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29929, 29906, 29896, 29955, 29946, 29906, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29896, 29955, 29955, 29953, 29941, 29900, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29929, 29945, 29953, 29953, 29906, 29941, 29900, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29896, 29941, 29946, 29941, 29945, 29941, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29906, 29906, 29947, 29946, 29929, 29945, 29906, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29929, 29906, 29906, 29955, 29946, 29945, 29900, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29941, 29946, 29906, 29955, 29955, 29906, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29906, 29955, 29929, 29945, 29929, 29945, 29945, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29947, 29947, 29947, 29947, 29941, 29946, 29946, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29945, 29946, 29953, 29929, 29953, 29946, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29941, 29941, 29900, 29929, 29941, 29900, 29947, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29947, 29945, 29946, 29929, 29900, 29941, 29929, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29955, 29946, 29953, 29947, 29955, 29955, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29941, 29947, 29906, 29945, 29900, 29896, 29955, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29947, 29906, 29900, 29929, 29953, 29896, 29946, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29929, 29946, 29906, 29946, 29946, 29941, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29946, 29941, 29946, 29941, 29896, 29900, 29941, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29955, 29947, 29955, 29900, 29900, 29929, 29929, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29896, 29941, 29941, 29945, 29929, 29941, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29946, 29947, 29953, 29941, 29945, 29947, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29955, 29945, 29941, 29900, 29945, 29906, 29896, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29941, 29906, 29900, 29906, 29945, 29955, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29945, 29941, 29947, 29953, 29946, 29929, 29941, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29955, 29896, 29929, 29900, 29929, 29896, 29945, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29945, 29900, 29906, 29941, 29953, 29945, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29945, 29929, 29896, 29896, 29947, 29941, 29946, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29953, 29947, 29945, 29896, 29941, 29906, 29900, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29953, 29955, 29929, 29947, 29946, 29955, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29953, 29946, 29941, 29929, 29953, 29941, 29906, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29953, 29945, 29896, 29896, 29955, 29955, 29945, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29947, 29945, 29906, 29945, 29953, 29941, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29953, 29929, 29953, 29929, 29929, 29953, 29941, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29953, 29896, 29955, 29906, 29896, 29946, 29947, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29900, 29906, 29900, 29946, 29945, 29929, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29955, 29945, 29900, 29906, 29947, 29906, 29955, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29945, 29947, 29941, 29906, 29945, 29946, 29906, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29896, 29947, 29941, 29945, 29900, 29900, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29947, 29900, 29941, 29947, 29906, 29900, 29896, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29945, 29946, 29929, 29941, 29896, 29906, 29945, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29941, 29946, 29896, 29953, 29896, 29946, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29947, 29945, 29955, 29953, 29896, 29900, 29896, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29945, 29896, 29945, 29941, 29929, 29953, 29896, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29946, 29929, 29946, 29955, 29906, 29953, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29929, 29896, 29896, 29953, 29945, 29941, 29929, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29946, 29947, 29896, 29945, 29896, 29906, 29900, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29953, 29946, 29906, 29955, 29953, 29900, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29945, 29889, 29929, 29953, 29945, 29929, 29945, 29906, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29946, 29946, 29955, 29953, 29953, 29955, 29955, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29955, 29947, 29945, 29953, 29946, 29896, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29900, 29906, 29900, 29945, 29900, 29947, 29896, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29946, 29896, 29941, 29947, 29955, 29896, 29947, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29929, 29906, 29941, 29906, 29929, 29906, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29900, 29955, 29945, 29941, 29906, 29900, 29955, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29941, 29947, 29900, 29896, 29941, 29941, 29945, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29900, 29945, 29945, 29953, 29941, 29946, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29896, 29941, 29900, 29941, 29929, 29896, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29941, 29946, 29953, 29946, 29953, 29941, 29896, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29896, 29947, 29906, 29945, 29947, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29896, 29947, 29945, 29955, 29906, 29906, 29945, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29941, 29896, 29906, 29947, 29955, 29896, 29955, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29941, 29900, 29946, 29900, 29955, 29946, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29906, 29946, 29896, 29941, 29896, 29941, 29953, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29906, 29955, 29929, 29941, 29955, 29896, 29946, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29946, 29896, 29929, 29947, 29929, 29906, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29906, 29929, 29955, 29896, 29955, 29945, 29896, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29906, 29946, 29945, 29929, 29945, 29900, 29900, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29945, 29941, 29900, 29900, 29955, 29953, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29941, 29945, 29941, 29906, 29929, 29947, 29955, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29906, 29896, 29906, 29953, 29946, 29947, 29947, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29953, 29941, 29946, 29945, 29946, 29906, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29946, 29900, 29929, 29953, 29947, 29945, 29900, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29896, 29955, 29929, 29946, 29947, 29946, 29945, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29955, 29941, 29941, 29906, 29900, 29953, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29946, 29953, 29953, 29941, 29941, 29946, 29955, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29896, 29946, 29953, 29946, 29955, 29945, 29941, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29947, 29906, 29945, 29929, 29947, 29946, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29945, 29906, 29941, 29906, 29946, 29947, 29941, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29896, 29896, 29941, 29953, 29946, 29896, 29906, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29929, 29896, 29906, 29955, 29947, 29929, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29945, 29947, 29900, 29946, 29906, 29953, 29941, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29947, 29896, 29900, 29900, 29946, 29906, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29929, 29929, 29941, 29945, 29941, 29906, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29953, 29941, 29955, 29947, 29953, 29929, 29896, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29946, 29947, 29945, 29947, 29947, 29945, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29900, 29953, 29947, 29896, 29906, 29953, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29953, 29929, 29945, 29945, 29955, 29955, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29906, 29889, 29900, 29896, 29953, 29946, 29906, 29900, 29946, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29896, 29941, 29953, 29946, 29955, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29955, 29945, 29941, 29945, 29945, 29900, 29947, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29929, 29947, 29946, 29945, 29906, 29929, 29900, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29896, 29929, 29947, 29946, 29929, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29947, 29896, 29896, 29955, 29929, 29900, 29906, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29929, 29945, 29906, 29929, 29946, 29945, 29953, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29906, 29945, 29946, 29900, 29929, 29941, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29947, 29955, 29900, 29906, 29929, 29945, 29953, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29929, 29906, 29896, 29955, 29900, 29945, 29900, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29941, 29900, 29941, 29896, 29953, 29929, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29929, 29906, 29929, 29900, 29953, 29955, 29896, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29929, 29900, 29947, 29946, 29946, 29945, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29941, 29946, 29945, 29953, 29941, 29900, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29953, 29889, 29929, 29947, 29947, 29896, 29900, 29946, 29947, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29953, 29900, 29946, 29900, 29945, 29941, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29941, 29947, 29896, 29941, 29947, 29900, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29900, 29946, 29955, 29946, 29900, 29947, 29945, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29941, 29900, 29946, 29941, 29896, 29947, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29946, 29896, 29900, 29941, 29906, 29906, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29896, 29900, 29953, 29929, 29955, 29947, 29896, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29947, 29900, 29900, 29929, 29955, 29906, 29900, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29946, 29941, 29906, 29941, 29945, 29929, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29896, 29953, 29953, 29947, 29896, 29941, 29941, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29955, 29955, 29906, 29900, 29955, 29947, 29906, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29946, 29946, 29955, 29941, 29929, 29941, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29906, 29906, 29953, 29929, 29896, 29941, 29955, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29955, 29946, 29941, 29947, 29900, 29953, 29945, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29946, 29945, 29945, 29941, 29906, 29953, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29906, 29947, 29955, 29906, 29955, 29947, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29955, 29896, 29953, 29906, 29896, 29955, 29941, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29946, 29945, 29953, 29900, 29945, 29929, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29941, 29946, 29955, 29929, 29900, 29955, 29929, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29947, 29929, 29941, 29955, 29945, 29906, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29946, 29946, 29929, 29946, 29929, 29953, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29946, 29900, 29947, 29947, 29900, 29900, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29953, 29941, 29941, 29946, 29929, 29896, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29946, 29941, 29945, 29945, 29946, 29896, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29946, 29953, 29929, 29929, 29945, 29946, 29946, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29941, 29947, 29906, 29896, 29906, 29946, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29946, 29896, 29946, 29900, 29929, 29947, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29945, 29941, 29896, 29941, 29953, 29929, 29945, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29953, 29896, 29946, 29900, 29946, 29906, 29906, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29941, 29947, 29945, 29900, 29955, 29955, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29945, 29929, 29941, 29900, 29946, 29941, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29929, 29900, 29929, 29896, 29929, 29947, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29941, 29946, 29947, 29906, 29896, 29929, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29953, 29945, 29946, 29929, 29947, 29945, 29945, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29953, 29947, 29929, 29900, 29953, 29906, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29941, 29900, 29941, 29941, 29906, 29945, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29955, 29896, 29955, 29896, 29929, 29947, 29941, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29946, 29947, 29900, 29955, 29945, 29947, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29906, 29945, 29900, 29945, 29906, 29896, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29955, 29955, 29929, 29953, 29953, 29955, 29955, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29906, 29947, 29945, 29946, 29947, 29953, 29906, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29896, 29947, 29929, 29955, 29906, 29955, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29947, 29946, 29906, 29941, 29929, 29896, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29896, 29900, 29946, 29896, 29945, 29947, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29896, 29906, 29900, 29947, 29953, 29947, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29929, 29900, 29945, 29941, 29953, 29945, 29953, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29929, 29941, 29955, 29953, 29947, 29947, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29929, 29900, 29946, 29941, 29947, 29955, 29929, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29955, 29889, 29929, 29953, 29947, 29945, 29947, 29955, 29955, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29955, 29947, 29953, 29929, 29947, 29896, 29900, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29929, 29945, 29947, 29955, 29900, 29953, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29900, 29941, 29906, 29900, 29945, 29941, 29941, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29953, 29945, 29906, 29929, 29896, 29906, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29947, 29953, 29946, 29955, 29955, 29946, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29900, 29929, 29945, 29955, 29947, 29953, 29900, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29945, 29941, 29945, 29955, 29906, 29947, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29955, 29953, 29906, 29900, 29945, 29945, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29896, 29945, 29929, 29955, 29955, 29929, 29946, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29946, 29941, 29953, 29906, 29953, 29946, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29953, 29945, 29900, 29929, 29941, 29953, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29906, 29906, 29946, 29900, 29900, 29953, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29941, 29945, 29945, 29953, 29953, 29955, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29945, 29941, 29896, 29946, 29896, 29929, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29906, 29947, 29947, 29946, 29945, 29929, 29947, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29906, 29929, 29946, 29945, 29896, 29896, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29946, 29900, 29941, 29896, 29896, 29941, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29941, 29945, 29941, 29896, 29945, 29941, 29953, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29906, 29945, 29906, 29947, 29941, 29947, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29906, 29953, 29945, 29906, 29947, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29946, 29896, 29947, 29896, 29896, 29955, 29941, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29906, 29941, 29900, 29906, 29953, 29945, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29947, 29896, 29896, 29929, 29900, 29941, 29947, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29946, 29947, 29941, 29906, 29947, 29929, 29900, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29906, 29906, 29955, 29947, 29953, 29900, 29955, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29929, 29953, 29946, 29941, 29953, 29941, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29945, 29946, 29947, 29953, 29953, 29946, 29953, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29906, 29946, 29945, 29941, 29946, 29906, 29945, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29955, 29929, 29929, 29946, 29929, 29896, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29953, 29896, 29946, 29941, 29906, 29941, 29896, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29906, 29947, 29900, 29947, 29896, 29929, 29896, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29953, 29906, 29953, 29946, 29929, 29955, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29953, 29947, 29900, 29896, 29945, 29929, 29929, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29941, 29941, 29945, 29900, 29929, 29946, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29946, 29946, 29946, 29941, 29900, 29941, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29955, 29946, 29953, 29906, 29906, 29896, 29929, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29946, 29900, 29953, 29896, 29896, 29945, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29906, 29945, 29941, 29900, 29900, 29900, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29947, 29896, 29906, 29945, 29900, 29900, 29953, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29946, 29929, 29906, 29906, 29929, 29896, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29955, 29900, 29945, 29941, 29906, 29929, 29941, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29947, 29955, 29947, 29929, 29953, 29896, 29906, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29945, 29929, 29896, 29947, 29953, 29953, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29947, 29946, 29946, 29941, 29946, 29955, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29947, 29889, 29929, 29946, 29945, 29953, 29941, 29929, 29947, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29955, 29900, 29896, 29946, 29946, 29941, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29953, 29906, 29955, 29896, 29906, 29906, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29900, 29896, 29906, 29946, 29929, 29941, 29953, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29947, 29896, 29955, 29929, 29953, 29941, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29946, 29900, 29906, 29896, 29900, 29945, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29900, 29955, 29929, 29945, 29900, 29941, 29955, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29929, 29941, 29955, 29900, 29946, 29906, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29953, 29896, 29953, 29947, 29896, 29946, 29947, 29896, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29896, 29946, 29953, 29955, 29906, 29946, 29955, 29929, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29900, 29945, 29906, 29900, 29941, 29946, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29929, 29906, 29955, 29945, 29953, 29946, 29953, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29906, 29896, 29946, 29900, 29953, 29945, 29941, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29896, 29945, 29953, 29953, 29900, 29896, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29953, 29947, 29900, 29947, 29900, 29953, 29947, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29906, 29947, 29896, 29945, 29906, 29900, 29953, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29906, 29946, 29900, 29929, 29946, 29947, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29946, 29906, 29947, 29953, 29947, 29896, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29941, 29946, 29929, 29900, 29955, 29955, 29941, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29906, 29929, 29906, 29896, 29896, 29945, 29947, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29945, 29896, 29955, 29906, 29953, 29900, 29947, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29946, 29896, 29953, 29955, 29900, 29953, 29900, 29945, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29906, 29929, 29906, 29945, 29941, 29953, 29941, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29929, 29896, 29945, 29900, 29945, 29941, 29941, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29946, 29947, 29946, 29941, 29946, 29929, 29900, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29906, 29896, 29955, 29955, 29953, 29900, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29953, 29953, 29900, 29906, 29906, 29955, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29945, 29945, 29896, 29947, 29929, 29947, 29953, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29945, 29900, 29941, 29906, 29955, 29929, 29946, 29946, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29946, 29896, 29945, 29896, 29955, 29946, 29906, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29953, 29896, 29929, 29896, 29953, 29946, 29947, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29953, 29947, 29953, 29900, 29955, 29947, 29929, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29896, 29947, 29929, 29953, 29896, 29906, 29900, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29953, 29947, 29945, 29947, 29929, 29947, 29896, 29946, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29946, 29900, 29929, 29945, 29945, 29953, 29900, 29953, 29872, 29899, 29900, 29896, 1402, 13, 539, 518, 259, 29929, 29889, 29946, 29900, 29900, 29896, 29945, 29900, 29929, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29929, 29889, 29955, 29945, 29896, 29945, 29947, 29941, 29945, 29955, 29872, 29899, 29900, 29896, 29892, 1678, 29896, 29889, 29941, 29896, 29941, 29906, 29945, 29945, 29896, 29955, 29872, 29899, 29900, 29896, 5262, 13, 13, 1688, 29918, 4912, 353, 22985, 17669, 358, 287, 1625, 555, 481, 29889, 3166, 29918, 1761, 22168, 1445, 1649, 29892, 7477, 29918, 1272, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1053, 22889, 29889, 2272, 5317, 408, 14770, 13, 1678, 1053, 12655, 408, 7442, 13, 13, 1678, 1018, 29901, 13, 4706, 515, 1998, 4912, 1053, 1998, 4912, 13, 4706, 1998, 4912, 29898, 1688, 29918, 4912, 29897, 13, 1678, 5174, 16032, 2392, 29901, 13, 4706, 1596, 703, 1730, 4912, 451, 1476, 29892, 20327, 1250, 373, 2560, 2479, 1159, 13, 4706, 14770, 29889, 326, 4294, 29898, 9302, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29896, 29900, 29900, 29892, 29871, 29906, 29945, 29953, 9601, 8516, 29892, 584, 1402, 9565, 2433, 6921, 742, 13, 462, 259, 274, 1958, 29922, 1688, 29918, 4912, 29897, 13, 1678, 14770, 29889, 4294, 580, 13, 2 ]
normal_forms/examples/normal_form/07.py
joepatmckenna/normal_forms
0
35474
<reponame>joepatmckenna/normal_forms from normal_forms import normal_form import sympy # Murdock, Normal Forms and Unfoldings of Local Dynamical Systems, Example 4.5.24 def f(x, y, z): f1 = 6 * x + x**2 + x * y + x * z + y**2 + y * z + z**2 f2 = 2 * y + x**2 + x * y + x * z + y**2 + y * z + z**2 f3 = 3 * z + x**2 + x * y + x * z + y**2 + y * z + z**2 return f1, f2, f3 h = normal_form(f, (0, 0, 0), 2) # coeff of z**2 print h.fun[0].coeff(h.jet.var[2]**2)
[ 1, 529, 276, 1112, 420, 29958, 2212, 1022, 271, 29885, 8916, 1056, 29914, 8945, 29918, 9514, 13, 3166, 4226, 29918, 9514, 1053, 4226, 29918, 689, 13, 5215, 5016, 2272, 13, 13, 13, 29937, 7487, 29881, 1698, 29892, 21981, 3812, 29879, 322, 853, 8771, 886, 310, 9959, 22554, 936, 23985, 29892, 8741, 29871, 29946, 29889, 29945, 29889, 29906, 29946, 13, 1753, 285, 29898, 29916, 29892, 343, 29892, 503, 1125, 13, 1678, 285, 29896, 353, 29871, 29953, 334, 921, 718, 921, 1068, 29906, 718, 921, 334, 343, 718, 921, 334, 503, 718, 343, 1068, 29906, 718, 343, 334, 503, 718, 503, 1068, 29906, 13, 1678, 285, 29906, 353, 29871, 29906, 334, 343, 718, 921, 1068, 29906, 718, 921, 334, 343, 718, 921, 334, 503, 718, 343, 1068, 29906, 718, 343, 334, 503, 718, 503, 1068, 29906, 13, 1678, 285, 29941, 353, 29871, 29941, 334, 503, 718, 921, 1068, 29906, 718, 921, 334, 343, 718, 921, 334, 503, 718, 343, 1068, 29906, 718, 343, 334, 503, 718, 503, 1068, 29906, 13, 1678, 736, 285, 29896, 29892, 285, 29906, 29892, 285, 29941, 13, 13, 13, 29882, 353, 4226, 29918, 689, 29898, 29888, 29892, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 511, 29871, 29906, 29897, 13, 29937, 1302, 12352, 310, 503, 1068, 29906, 13, 2158, 298, 29889, 7692, 29961, 29900, 1822, 1111, 12352, 29898, 29882, 29889, 4026, 29889, 1707, 29961, 29906, 29962, 1068, 29906, 29897, 13, 2 ]
lib/viscoelasticity.py
mforstenhaeusler/AFMviscoelastic
2
55445
<gh_stars>1-10 """ Created on Wed Jun 10th 2020 @author: <NAME> Description: This library contains core algorithms to analyse and fit viscoelstic models to different AFM data. """ import numpy as np from lmfit import Parameters, minimize, report_fit def G_storage(omega, Ge, G, tau): """ Description: The function calculates the Storage Modulus G' using G as input. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param omega: array of float array of Frequency values :param Ge: float equilibrium G :param G: array of loats Relaxance values :param tau: array of floats characteristic time - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function output: :return: G_prime: array of loats array of Storage Modulus G' """ G_prime = np.zeros(len(omega)) for i in range(len(omega)): G_prime[i] = Ge + sum((G[:] * pow(omega[:], 2) * pow(tau[:], 2)) / (1.0 + (pow(omega[i], 2) * pow(tau[:], 2)))) return G_prime def J_storage(omega, Jg, J, tau): """ Description: The function calculates the Storage Modulus using J as input. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param omega: array of floats array of Frequency values :param Jg: float classy compliance :param J: array of floats Compliance values :param tau: array of floats characteristic time - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: J_prime: array of floats Storage Modulus J' """ J_prime = np.zeros(len(omega)) for i in range(len(omega)): if len(J) > 1: J_prime[i] = Jg + sum(J[:] / (1.0 + (pow(omega[i], 2) * pow(tau[:], 2)))) else: J_prime[i] = Jg + (J / (1.0 + (pow(omega[i], 2) * pow(tau, 2)))) return J_prime def G_loss(omega, Ge, G, tau): """ Description: The function calculates the Loss Modulus using G as input. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param omega: array of floats array of Frequency values :param Ge: float equilibrium G :param G: array of floats Relaxance values :param tau: array of floats characteristic time - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: G_dprime: array of floats Loss Modulus G'' """ G_dprime = np.zeros(len(omega)) for i in range(len(omega)): G_dprime[i] = Ge + sum((G[:]*omega[:]*tau[:])/(1.0 + (pow(omega[i], 2) * pow(tau, 2)))) return G_dprime def J_loss(omega, Jg, J, tau, phi=0): """ Description: The function calculates the Loss Modulus using J as input. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param omega: array of floats array of Frequency values :param Jg: float classy compliance :param J: array of floats Compliance values :param tau: array of floats characteristic time :param phi: float steady-state/ stead-flow fluidity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: J_dprime: array of floats Loss Modulus J'' """ J_dprime = np.zeros(len(omega)) for i in range(len(omega)): # for Gen. Kelvin-Voigt with arbitrary number of arms if len(J) > 1: J_dprime[i] = sum(J[:] * omega[i] * tau[:] / (1.0 + (pow(omega[i], 2) * pow(tau[:], 2)))) + phi / omega[i] else: # for SLS J_dprime[i] = (J * omega[i] * tau / (1.0 + (pow(omega[i], 2) * pow(tau, 2)))) + phi / omega[i] return J_dprime def theta_loss(input_param, omega, p1, p2, p3, phi=0): """ Description: The function calculates the Loss Angle, theta, using J oro G as input. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param input_param: string either 'G' or 'J' :param omega: array of floats array of Frequency values :param p1: float placeholder variable for classy compliance or equivalent G :param p2: array of floats placeholder variable for Compliance or Relaxance values :param p3: array of floats placeholder variable fot characteristic time :param phi: float steady-state/steady-flow fluidity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: theta: array of floats Loss Modulus theta """ if input_param == 'G': Gloss = G_loss(omega, p1, p2, p3) Gstorage = G_storage(omega, p1, p2, p3) theta = np.arctan(Gloss / Gstorage) * 180 / np.pi if input_param == 'J': Jloss = J_loss(omega, p1, p2, p3, phi=0) Jstorage = J_storage(omega, p1, p2, p3) theta = np.arctan(Jloss / Jstorage) * 180 / np.pi return theta def response(model, t, p1, p2, p3, phi = 0.0): """ Description: The function calculates the Relaxance, Comppliance or Retardance in time. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param model: string indicate either what to return, either 'Relaxance', 'Comppliance' or ’Retardance' :param t: array of floats time array :param p1: float placeholder variable for classy compliance or equivalent G :param p2: array of floats placeholder variable for Compliance or Relaxance values :param p3: array of floats placeholder variable fot characteristic time :param phi: float steady-state/steady-flow fluidity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: res: array of floats Relaxation, Comppliance or Retardance Modulus in time """ if model == 'Relaxances': res = np.zeros(np.size(t)) if np.size(p2) == 1: # SLS for i in range(np.size(t)): res[i] = p1 + p2*np.exp(-t[i]/p3) else: # Gen. Maxwell with arbitrary number of arms for i in range(np.size(t)): res[i] = p1 + sum(p2[:]*np.exp(-t[i]/p3[:])) if model == 'Compliance': res = np.zeros(np.size(t)) if np.size(p2) == 1: # SLS for i in range(np.size(t)): res[i] = p1 + p2*(1 - np.exp(-t[i]/p3)) + (phi*t[i]) else: # Gen. Kelvin-Voigt with arbitrary number of arms for i in range(np.size(t)): res[i] = p1 + sum(p2[:]*(1 - np.exp(-p2[i]/p3[:]))) + phi*t[i] if model == 'Retardance': res = np.zeros(np.size(t)) if np.size(p2) == 1: # SLS for i in range(np.size(t)): res[i] = p1 + p2/p3*np.exp(-t[i]/p3) + (phi) else: # Gen. Kelvin Voigt with arbitrary number of arms for i in range(np.size(t)): res[i] = p1 + sum(p2[:]/p3[:]*(np.exp(-p2[i]/p3[:]))) + phi return res def log_scale(x, t, tr=0.1, st=1.0, nn = 10): """ Description: The function scales an array equally in each decade, weighting it in logarithmic scale. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param x: array of floats fitst array to be scaled :param t: array of floats time array to be scaled :param tr: :param st: :param nn: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: np.array(x_log): array of floats first array scaled in logaritmic scale np.array(t_log): array of floats time array scaled in logaritmic scale """ prints = 1 nt = len(t) i =0 x_log = [] t_log = [] while i < nt-1: if t[i] >= prints*tr and t[i]<=st : x_log.append(x[i]) t_log.append(t[i]) prints = prints + 1 i = i + 1 if prints == nn: tr = tr*10 prints = 1 return np.array(x_log), np.array(t_log) def time_step(t): """ Description: This function creates a time step from a time array. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param t: array of floats time array - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: dt: float time step dt """ dt = t[-1]/len(t) return dt def conv(model, t, F, p1, p2, p3): """ Description: This function calculates the convolution of the retardance, U, or relaxance, Q, and the force, F, used to verifiy the RHS to LHS side of Equ. 13 from Calculation of Standard Viscoelastic..... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param model: string state Viscoelastic model used, e.g. 'Gen. Kelvin-Voigt', 'Gen. Maxwell' :param t: array of floats time array :param F: array of floats Force array :param p1: float placeholder variable for Ge or Jg :param p2: array of floats placeholder variable for G or J :param p3: array of floats placeholder variable for charactersitic time, tau - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: c: array of float Returns convolution U*F of retardance, U and force, F or the convolution Q*F of relaxance, Q and force, F """ dt = time_step(t) # calculated delta from time array to pass into discrete convolution to give # it information about the timestep if model == 'Gen. Kelvin-Voigt': U = np.zeros(len(t)) for i in range(len(t)): # Retardance function (Equ 12) from Calculation of Standard... U[i] = sum(p2[:] / p3[:] * np.exp(-t[i] / p3[:])) c = np.convolve(U, F, mode='full') * dt # calculates convolution, dt adjust for timestep c = c[range(len(F))] + p1 * F # only use range of given data adds Jg*F # if model == 'Gen. Maxwell': # convolutioin needs to be solved # U = np.zeros(len(t)) # for i in range(len(t)): # U[i] = sum((*np.exp(-t[i]/tau_v[:])) # c = np.convolve(U, F, mode='full')*dt # calculates convolution, dt adjust for timestep # c = c[range(len(F))] + Jg*F # only use range of given data adds Jg*F return c def conv_fitting_log(params, t, F, tip, arms, dt): """ Description: The function is the residual function of the tip data and the convolution function used for the NLS fitting procedure using logarithmic scaled data in time. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param params: dict file Dictionary file storing the parameters :param t: array of floats time array scaled in logarithmic scale :param F: array of floats Force array sclaed in logarithmic scale :param tip: array of floats Tip position or deformation array scaled in logarithmic scale :param arms: int Number of amrs :param dt: float time step of logarithmic sclaed time array - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: residual: array of float Returns the residual of the the experimental/simulated deformation data and the convolution which is minimized by the lmfit algorithm minimize in the NLS_fit algoritm """ J = np.zeros(arms) # initialize J array tau = np.zeros(arms) # initialize tau array # loads oarameters from dictionary file into J and tau array p = params.valuesdict() Jg = p['Jg'] J[0] = p['J1'] tau[0] = p['tau1'] if arms > 1: J[1] = p['J2'] tau[1] = p['tau2'] if arms > 2: J[2] = p['J3'] tau[2] = p['tau3'] if arms > 3: J[3] = p['J4'] tau[3] = p['tau4'] if arms > 4: J[4] = p['J5'] tau[4] = p['tau5'] U = np.zeros(len(t)) for i in range(len(t)): # Retardance function (Equ 12) from Calculation of Standard... U[i] = sum(J[:] / tau[:] * np.exp(-t[i] / tau[:])) model = np.convolve(U, F, mode='full') * dt # convolves retardance with F and indicates # time step to discrete convolution model = model[range(np.size(F))] + Jg * F # selects range of data of size of force array # and adds the product of classy compliance # and force array residual = (tip - model) / tip # calculates the residual to be minimized by teh NLS_fit # algorithm return residual def conv_fitting_time(params, t, F, tip, arms, dt): """ Description: The function is the residual function of the tip data and the convolution function used for the NLS fitting procedure using scaled data in time. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param params: dict file Dictionary file storing the parameters :param t: array of floats time array scaled :param F: array of floats Force array sclaed :param tip: array of floats Tip position or deformation array :param arms: int Number of amrs :param dt: float time step sclaed time array - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function ouput: :return: residual: array of float Returns the residual of the the experimental/simulated deformation data and the convolution which is minimized by the lmfit algorithm minimize in the NLS_fit algoritm """ J = np.zeros(arms) # initialize J array tau = np.zeros(arms) # initialize tau array # loads oarameters from dictionary file into J and tau array p = params.valuesdict() Jg = p['Jg'] J[0] = p['J1'] tau[0] = p['tau1'] if arms > 1: J[1] = p['J2'] tau[1] = p['tau2'] if arms > 2: J[2] = p['J3'] tau[2] = p['tau3'] if arms > 3: J[3] = p['J4'] tau[3] = p['tau4'] if arms > 4: J[4] = p['J5'] tau[4] = p['tau5'] U = np.zeros(len(t)) for i in range(len(t)): # Retardance function (Equ 12) from Calculation of Standard... U[i] = sum(J[:] / tau[:] * np.exp(-t[i] / tau[:])) model = np.convolve(U, F, mode='full') * dt # convolves retardance with F and indicates # time step to discrete convolution model = model[range(np.size(F))] + Jg * F # selects range of data of size of force array # and adds the product of classy compliance # and force array residual = (tip - model) / tip # calculates the residual to be minimized by teh NLS_fit # algorithm return residual def NLS_fit(technique, Jg, J, tau, arms, t, tip, F, alfa, t_res, t_exp): """ Descripition: Nonlinear Least Sqaure Fitting algorithm used to fit viscoelastic model parameter to experimental or simulated data/AFM data. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parameters: :param technique: string using Log sclaed or time scaled data :param Jg: float classy compliance :param J: array of floats Compliance :param tau: array of floats characteristic time :param arms: int number of model arms :param t: array of floats time array :param tip: array of floats tip position over time :param F: array of floats tip position over time :param alfa: float Constant converting stress/strain to force/defromation by adjusting for tip geometry :param t_res: float time resolution of experiment, used to log scale the data :param t_exp: float final time of experiment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return, function outout: :return: Jg_fit: float classy compliance fitted J_fit: float fitted complince terms tau_fit: float fitted characteristic time """ params = Parameters() # initializes Parameters dictionary file # algorthimen initialzes parameters dictionary with viscoelastic model parameters params.add('Jg', value=Jg, min=0) if arms > 0: params.add('J1', value=J[0], min=0) params.add('tau1', value=tau[0], min=0) if arms > 1: params.add('J2', value=J[1], min=0) params.add('tau2', value=tau[1], min=0) if arms > 2: params.add('J3', value=J[2], min=0) params.add('tau3', value=tau[2], min=0) if arms > 3: params.add('J4', value=J[3], min=0) params.add('tau4', value=tau[3], min=0) if arms > 4: params.add('J5', value=J[4], min=0) params.add('tau5', value=tau[4], min=0) if technique == 0: # log scale tip_norm = alfa * tip ** 1.5 # RHS of equation ..., underlying fitting data tip_norm_log, t_log = log_scale(tip_norm, t, t_res, t_exp) # normalized tip position scaled equally in per decade F_log, _ = log_scale(F, t, t_res, t_exp) # tip-sample Force scaled scaled equally in per decad dt = time_step(t_log) # calculated time step from input time array, necessary for discrete convolution result = minimize(conv_fitting_log, params, args=(t_log, F_log, tip_norm_log, arms, dt), method='leastsq') # non-linear least sqaure fitting procedure minimizing the convolution function print(report_fit(result)) # prints the fit report if technique == 1: # time scale tip_norm = alfa * tip ** 1.5 dt = time_step(t) result = minimize(conv_fitting_time, params, args=(t, F, tip_norm, arms, dt), method='leastsq') print(report_fit(result)) # stores fitted parameters Jg_fit = result.params['Jg'].value J_fit = np.zeros(arms) tau_fit = np.zeros(arms) J_fit[0] = result.params['J1'].value tau_fit[0] = result.params['tau1'].value if arms > 1: J_fit[1] = result.params['J2'].value tau_fit[1] = result.params['tau2'].value if arms > 2: J_fit[2] = result.params['J3'].value tau_fit[2] = result.params['tau3'].value if arms > 3: J_fit[3] = result.params['J4'].value tau_fit[3] = result.params['tau4'].value if arms > 4: J_fit[4] = result.params['J5'].value tau_fit[4] = result.params['tau5'].value return Jg_fit, J_fit, tau_fit
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 13, 20399, 373, 15050, 8378, 29871, 29896, 29900, 386, 29871, 29906, 29900, 29906, 29900, 13, 13, 29992, 8921, 29901, 529, 5813, 29958, 13, 9868, 29901, 910, 3489, 3743, 7136, 14009, 304, 16455, 344, 322, 6216, 1998, 1111, 295, 303, 293, 4733, 304, 1422, 319, 22192, 848, 29889, 13, 15945, 29908, 13, 13, 5215, 12655, 408, 7442, 13, 3166, 301, 29885, 9202, 1053, 12662, 2699, 29892, 6260, 675, 29892, 3461, 29918, 9202, 13, 13, 13, 1753, 402, 29918, 12925, 29898, 4787, 29892, 1879, 29892, 402, 29892, 260, 585, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 3408, 1078, 278, 26162, 3382, 14999, 402, 29915, 773, 402, 408, 1881, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 2703, 2442, 29901, 1409, 310, 5785, 13, 462, 29871, 1409, 310, 3878, 23860, 1819, 13, 268, 13, 1678, 584, 3207, 1879, 29901, 1678, 5785, 13, 462, 29871, 26440, 402, 13, 268, 13, 1678, 584, 3207, 402, 29901, 268, 1409, 310, 658, 1446, 13, 462, 29871, 6376, 1165, 749, 1819, 13, 268, 13, 1678, 584, 3207, 260, 585, 29901, 259, 1409, 310, 5685, 1446, 13, 462, 29871, 17443, 931, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 1962, 29901, 13, 1678, 584, 2457, 29901, 418, 402, 29918, 10080, 29901, 29871, 1409, 310, 658, 1446, 13, 462, 9651, 1409, 310, 26162, 3382, 14999, 402, 29915, 13, 1678, 9995, 13, 1678, 402, 29918, 10080, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 4787, 876, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 4787, 22164, 13, 4706, 402, 29918, 10080, 29961, 29875, 29962, 353, 1879, 718, 2533, 3552, 29954, 7503, 29962, 334, 4764, 29898, 4787, 7503, 1402, 29871, 29906, 29897, 334, 4764, 29898, 4722, 7503, 1402, 29871, 29906, 876, 847, 313, 29896, 29889, 29900, 718, 313, 12248, 29898, 4787, 29961, 29875, 1402, 29871, 29906, 29897, 334, 4764, 29898, 4722, 7503, 1402, 29871, 29906, 13697, 13, 13, 1678, 736, 402, 29918, 10080, 13, 13, 13, 1753, 435, 29918, 12925, 29898, 4787, 29892, 435, 29887, 29892, 435, 29892, 260, 585, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 3408, 1078, 278, 26162, 3382, 14999, 773, 435, 408, 1881, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 2703, 2442, 29901, 1409, 310, 5685, 1446, 13, 462, 29871, 1409, 310, 3878, 23860, 1819, 13, 268, 13, 1678, 584, 3207, 435, 29887, 29901, 1678, 5785, 13, 462, 29871, 770, 29891, 752, 13036, 13, 268, 13, 1678, 584, 3207, 435, 29901, 268, 1409, 310, 5685, 1446, 13, 462, 29871, 3831, 13036, 1819, 13, 268, 13, 1678, 584, 3207, 260, 585, 29901, 259, 1409, 310, 5685, 1446, 13, 462, 29871, 17443, 931, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 418, 435, 29918, 10080, 29901, 29871, 1409, 310, 5685, 1446, 13, 462, 9651, 26162, 3382, 14999, 435, 29915, 13, 1678, 9995, 13, 1678, 435, 29918, 10080, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 4787, 876, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 4787, 22164, 13, 4706, 565, 7431, 29898, 29967, 29897, 1405, 29871, 29896, 29901, 13, 9651, 435, 29918, 10080, 29961, 29875, 29962, 353, 435, 29887, 718, 2533, 29898, 29967, 7503, 29962, 847, 313, 29896, 29889, 29900, 718, 313, 12248, 29898, 4787, 29961, 29875, 1402, 29871, 29906, 29897, 334, 4764, 29898, 4722, 7503, 1402, 29871, 29906, 13697, 13, 4706, 1683, 29901, 13, 9651, 435, 29918, 10080, 29961, 29875, 29962, 353, 435, 29887, 718, 313, 29967, 847, 313, 29896, 29889, 29900, 718, 313, 12248, 29898, 4787, 29961, 29875, 1402, 29871, 29906, 29897, 334, 4764, 29898, 4722, 29892, 29871, 29906, 13697, 13, 13, 1678, 736, 435, 29918, 10080, 13, 13, 13, 1753, 402, 29918, 6758, 29898, 4787, 29892, 1879, 29892, 402, 29892, 260, 585, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 3408, 1078, 278, 365, 2209, 3382, 14999, 773, 402, 408, 1881, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 2703, 2442, 29901, 1409, 310, 5685, 1446, 13, 462, 29871, 1409, 310, 3878, 23860, 1819, 13, 268, 13, 1678, 584, 3207, 1879, 29901, 1678, 5785, 13, 462, 29871, 26440, 402, 13, 268, 13, 1678, 584, 3207, 402, 29901, 268, 1409, 310, 5685, 1446, 13, 462, 29871, 6376, 1165, 749, 1819, 13, 268, 13, 1678, 584, 3207, 260, 585, 29901, 259, 1409, 310, 5685, 1446, 13, 462, 29871, 17443, 931, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 418, 402, 29918, 29881, 10080, 29901, 1409, 310, 5685, 1446, 13, 462, 9651, 365, 2209, 3382, 14999, 402, 4907, 13, 1678, 9995, 13, 1678, 402, 29918, 29881, 10080, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 4787, 876, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 4787, 22164, 13, 4706, 402, 29918, 29881, 10080, 29961, 29875, 29962, 353, 1879, 718, 2533, 3552, 29954, 7503, 14178, 4787, 7503, 14178, 4722, 7503, 2314, 14571, 29896, 29889, 29900, 718, 313, 12248, 29898, 4787, 29961, 29875, 1402, 29871, 29906, 29897, 334, 4764, 29898, 4722, 29892, 29871, 29906, 13697, 13, 13, 1678, 736, 402, 29918, 29881, 10080, 13, 13, 13, 1753, 435, 29918, 6758, 29898, 4787, 29892, 435, 29887, 29892, 435, 29892, 260, 585, 29892, 1374, 29875, 29922, 29900, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 3408, 1078, 278, 365, 2209, 3382, 14999, 773, 435, 408, 1881, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 2703, 2442, 29901, 1409, 310, 5685, 1446, 13, 462, 29871, 1409, 310, 3878, 23860, 1819, 13, 268, 13, 1678, 584, 3207, 435, 29887, 29901, 1678, 5785, 13, 462, 29871, 770, 29891, 752, 13036, 13, 268, 13, 1678, 584, 3207, 435, 29901, 268, 1409, 310, 5685, 1446, 13, 462, 29871, 3831, 13036, 1819, 13, 268, 13, 1678, 584, 3207, 260, 585, 29901, 259, 1409, 310, 5685, 1446, 13, 462, 29871, 17443, 931, 13, 268, 13, 1678, 584, 3207, 1374, 29875, 29901, 259, 5785, 13, 462, 29871, 27357, 29899, 3859, 29914, 28325, 29899, 1731, 22576, 537, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 418, 435, 29918, 29881, 10080, 29901, 1409, 310, 5685, 1446, 13, 462, 9651, 365, 2209, 3382, 14999, 435, 4907, 13, 1678, 9995, 13, 1678, 435, 29918, 29881, 10080, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 4787, 876, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 4787, 22164, 29871, 396, 363, 5739, 29889, 27326, 3845, 29899, 29963, 29877, 5523, 411, 11472, 1353, 310, 10188, 13, 4706, 565, 7431, 29898, 29967, 29897, 1405, 29871, 29896, 29901, 13, 9651, 435, 29918, 29881, 10080, 29961, 29875, 29962, 353, 2533, 29898, 29967, 7503, 29962, 334, 2703, 2442, 29961, 29875, 29962, 334, 260, 585, 7503, 29962, 847, 313, 29896, 29889, 29900, 718, 313, 12248, 29898, 4787, 29961, 29875, 1402, 29871, 29906, 29897, 334, 4764, 29898, 4722, 7503, 1402, 29871, 29906, 13697, 718, 1374, 29875, 847, 2703, 2442, 29961, 29875, 29962, 13, 4706, 1683, 29901, 29871, 396, 363, 317, 8547, 13, 9651, 435, 29918, 29881, 10080, 29961, 29875, 29962, 353, 313, 29967, 334, 2703, 2442, 29961, 29875, 29962, 334, 260, 585, 847, 313, 29896, 29889, 29900, 718, 313, 12248, 29898, 4787, 29961, 29875, 1402, 29871, 29906, 29897, 334, 4764, 29898, 4722, 29892, 29871, 29906, 13697, 718, 1374, 29875, 847, 2703, 2442, 29961, 29875, 29962, 13, 13, 1678, 736, 435, 29918, 29881, 10080, 13, 13, 13, 1753, 278, 941, 29918, 6758, 29898, 2080, 29918, 3207, 29892, 2703, 2442, 29892, 282, 29896, 29892, 282, 29906, 29892, 282, 29941, 29892, 1374, 29875, 29922, 29900, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 3408, 1078, 278, 365, 2209, 3218, 280, 29892, 278, 941, 29892, 773, 435, 28979, 402, 408, 1881, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 1881, 29918, 3207, 29901, 1347, 13, 462, 4706, 2845, 525, 29954, 29915, 470, 525, 29967, 29915, 13, 268, 13, 1678, 584, 3207, 2703, 2442, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 4706, 1409, 310, 3878, 23860, 1819, 13, 268, 13, 1678, 584, 3207, 282, 29896, 29901, 3986, 5785, 13, 462, 4706, 12983, 2286, 363, 770, 29891, 752, 13036, 470, 7126, 402, 13, 268, 13, 1678, 584, 3207, 282, 29906, 29901, 3986, 1409, 310, 5685, 1446, 13, 462, 4706, 12983, 2286, 363, 3831, 13036, 470, 6376, 1165, 749, 1819, 13, 268, 13, 1678, 584, 3207, 282, 29941, 29901, 3986, 1409, 310, 5685, 1446, 13, 462, 4706, 12983, 2286, 10105, 17443, 931, 13, 268, 13, 1678, 584, 3207, 1374, 29875, 29901, 308, 5785, 13, 462, 4706, 27357, 29899, 3859, 29914, 303, 1479, 29891, 29899, 1731, 22576, 537, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 418, 278, 941, 29901, 1678, 1409, 310, 5685, 1446, 13, 462, 9651, 365, 2209, 3382, 14999, 278, 941, 13, 1678, 9995, 13, 1678, 565, 1881, 29918, 3207, 1275, 525, 29954, 2396, 13, 4706, 402, 6758, 353, 402, 29918, 6758, 29898, 4787, 29892, 282, 29896, 29892, 282, 29906, 29892, 282, 29941, 29897, 13, 4706, 402, 12925, 353, 402, 29918, 12925, 29898, 4787, 29892, 282, 29896, 29892, 282, 29906, 29892, 282, 29941, 29897, 13, 4706, 278, 941, 353, 7442, 29889, 27014, 273, 29898, 29954, 6758, 847, 402, 12925, 29897, 334, 29871, 29896, 29947, 29900, 847, 7442, 29889, 1631, 13, 13, 1678, 565, 1881, 29918, 3207, 1275, 525, 29967, 2396, 13, 4706, 435, 6758, 353, 435, 29918, 6758, 29898, 4787, 29892, 282, 29896, 29892, 282, 29906, 29892, 282, 29941, 29892, 1374, 29875, 29922, 29900, 29897, 13, 4706, 435, 12925, 353, 435, 29918, 12925, 29898, 4787, 29892, 282, 29896, 29892, 282, 29906, 29892, 282, 29941, 29897, 13, 4706, 278, 941, 353, 7442, 29889, 27014, 273, 29898, 29967, 6758, 847, 435, 12925, 29897, 334, 29871, 29896, 29947, 29900, 847, 7442, 29889, 1631, 13, 13, 1678, 736, 278, 941, 13, 13, 13, 1753, 2933, 29898, 4299, 29892, 260, 29892, 282, 29896, 29892, 282, 29906, 29892, 282, 29941, 29892, 1374, 29875, 353, 29871, 29900, 29889, 29900, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 3408, 1078, 278, 6376, 1165, 749, 29892, 422, 407, 13036, 470, 4649, 538, 749, 297, 931, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 1904, 29901, 1347, 13, 462, 29871, 12266, 2845, 825, 304, 736, 29892, 2845, 525, 9662, 1165, 749, 742, 525, 1523, 407, 13036, 29915, 470, 16156, 8015, 538, 749, 29915, 13, 268, 13, 1678, 584, 3207, 260, 29901, 268, 1409, 310, 5685, 1446, 13, 462, 29871, 931, 1409, 13, 268, 13, 1678, 584, 3207, 282, 29896, 29901, 1678, 5785, 13, 462, 29871, 12983, 2286, 363, 770, 29891, 752, 13036, 470, 7126, 402, 13, 268, 13, 1678, 584, 3207, 282, 29906, 29901, 1678, 1409, 310, 5685, 1446, 13, 462, 29871, 12983, 2286, 363, 3831, 13036, 470, 6376, 1165, 749, 1819, 13, 268, 13, 1678, 584, 3207, 282, 29941, 29901, 1678, 1409, 310, 5685, 1446, 13, 462, 29871, 12983, 2286, 10105, 17443, 931, 13, 268, 13, 1678, 584, 3207, 1374, 29875, 29901, 259, 5785, 13, 462, 29871, 27357, 29899, 3859, 29914, 303, 1479, 29891, 29899, 1731, 22576, 537, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 418, 620, 29901, 29871, 1409, 310, 5685, 1446, 13, 462, 4706, 6376, 1165, 362, 29892, 422, 407, 13036, 470, 4649, 538, 749, 3382, 14999, 297, 931, 13, 1678, 9995, 13, 1678, 565, 1904, 1275, 525, 9662, 1165, 2925, 2396, 13, 4706, 620, 353, 7442, 29889, 3298, 359, 29898, 9302, 29889, 2311, 29898, 29873, 876, 13, 4706, 565, 7442, 29889, 2311, 29898, 29886, 29906, 29897, 1275, 29871, 29896, 29901, 29871, 396, 317, 8547, 13, 9651, 363, 474, 297, 3464, 29898, 9302, 29889, 2311, 29898, 29873, 22164, 13, 18884, 620, 29961, 29875, 29962, 353, 282, 29896, 718, 282, 29906, 29930, 9302, 29889, 4548, 6278, 29873, 29961, 29875, 16261, 29886, 29941, 29897, 13, 4706, 1683, 29901, 29871, 396, 5739, 29889, 5918, 5872, 411, 11472, 1353, 310, 10188, 13, 9651, 363, 474, 297, 3464, 29898, 9302, 29889, 2311, 29898, 29873, 22164, 13, 18884, 620, 29961, 29875, 29962, 353, 282, 29896, 718, 2533, 29898, 29886, 29906, 7503, 14178, 9302, 29889, 4548, 6278, 29873, 29961, 29875, 16261, 29886, 29941, 7503, 12622, 13, 13, 1678, 565, 1904, 1275, 525, 6843, 13036, 2396, 13, 4706, 620, 353, 7442, 29889, 3298, 359, 29898, 9302, 29889, 2311, 29898, 29873, 876, 13, 4706, 565, 7442, 29889, 2311, 29898, 29886, 29906, 29897, 1275, 29871, 29896, 29901, 29871, 396, 317, 8547, 13, 9651, 363, 474, 297, 3464, 29898, 9302, 29889, 2311, 29898, 29873, 22164, 13, 18884, 620, 29961, 29875, 29962, 353, 282, 29896, 718, 282, 29906, 16395, 29896, 448, 7442, 29889, 4548, 6278, 29873, 29961, 29875, 16261, 29886, 29941, 876, 718, 313, 2876, 29930, 29873, 29961, 29875, 2314, 13, 4706, 1683, 29901, 29871, 396, 5739, 29889, 27326, 3845, 29899, 29963, 29877, 5523, 411, 11472, 1353, 310, 10188, 13, 9651, 363, 474, 297, 3464, 29898, 9302, 29889, 2311, 29898, 29873, 22164, 13, 18884, 620, 29961, 29875, 29962, 353, 282, 29896, 718, 2533, 29898, 29886, 29906, 7503, 14178, 29898, 29896, 448, 7442, 29889, 4548, 6278, 29886, 29906, 29961, 29875, 16261, 29886, 29941, 7503, 29962, 4961, 718, 1374, 29875, 29930, 29873, 29961, 29875, 29962, 13, 13, 1678, 565, 1904, 1275, 525, 8015, 538, 749, 2396, 13, 4706, 620, 353, 7442, 29889, 3298, 359, 29898, 9302, 29889, 2311, 29898, 29873, 876, 13, 4706, 565, 7442, 29889, 2311, 29898, 29886, 29906, 29897, 1275, 29871, 29896, 29901, 29871, 396, 317, 8547, 13, 9651, 363, 474, 297, 3464, 29898, 9302, 29889, 2311, 29898, 29873, 22164, 13, 18884, 620, 29961, 29875, 29962, 353, 282, 29896, 718, 282, 29906, 29914, 29886, 29941, 29930, 9302, 29889, 4548, 6278, 29873, 29961, 29875, 16261, 29886, 29941, 29897, 718, 313, 2876, 29897, 13, 4706, 1683, 29901, 29871, 396, 5739, 29889, 27326, 3845, 4785, 5523, 411, 11472, 1353, 310, 10188, 13, 9651, 363, 474, 297, 3464, 29898, 9302, 29889, 2311, 29898, 29873, 22164, 13, 18884, 620, 29961, 29875, 29962, 353, 282, 29896, 718, 2533, 29898, 29886, 29906, 7503, 16261, 29886, 29941, 7503, 14178, 29898, 9302, 29889, 4548, 6278, 29886, 29906, 29961, 29875, 16261, 29886, 29941, 7503, 29962, 4961, 718, 1374, 29875, 13, 13, 1678, 736, 620, 13, 13, 13, 1753, 1480, 29918, 7052, 29898, 29916, 29892, 260, 29892, 534, 29922, 29900, 29889, 29896, 29892, 380, 29922, 29896, 29889, 29900, 29892, 302, 29876, 353, 29871, 29896, 29900, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 23431, 385, 1409, 18018, 297, 1269, 316, 6332, 29892, 7688, 292, 372, 297, 1480, 23830, 13076, 6287, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 921, 29901, 259, 1409, 310, 5685, 1446, 13, 18884, 6216, 303, 1409, 304, 367, 6287, 29881, 13, 268, 13, 1678, 584, 3207, 260, 29901, 259, 1409, 310, 5685, 1446, 13, 18884, 931, 1409, 304, 367, 6287, 29881, 13, 268, 13, 1678, 584, 3207, 534, 29901, 13, 13, 268, 13, 1678, 584, 3207, 380, 29901, 13, 13, 268, 13, 1678, 584, 3207, 302, 29876, 29901, 13, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 1678, 7442, 29889, 2378, 29898, 29916, 29918, 1188, 1125, 1678, 1409, 310, 5685, 1446, 13, 462, 462, 1678, 937, 1409, 6287, 29881, 297, 1480, 279, 277, 13076, 6287, 13, 18884, 7442, 29889, 2378, 29898, 29873, 29918, 1188, 1125, 1678, 1409, 310, 5685, 1446, 13, 462, 462, 1678, 931, 1409, 6287, 29881, 297, 1480, 279, 277, 13076, 6287, 13, 1678, 9995, 13, 1678, 14677, 353, 29871, 29896, 13, 1678, 302, 29873, 353, 7431, 29898, 29873, 29897, 13, 1678, 474, 353, 29900, 13, 1678, 921, 29918, 1188, 353, 5159, 13, 1678, 260, 29918, 1188, 353, 5159, 13, 1678, 1550, 474, 529, 302, 29873, 29899, 29896, 29901, 13, 4706, 565, 260, 29961, 29875, 29962, 6736, 14677, 29930, 509, 322, 260, 29961, 29875, 29962, 14065, 303, 584, 13, 9651, 921, 29918, 1188, 29889, 4397, 29898, 29916, 29961, 29875, 2314, 13, 9651, 260, 29918, 1188, 29889, 4397, 29898, 29873, 29961, 29875, 2314, 13, 9651, 14677, 353, 14677, 718, 29871, 29896, 13, 4706, 474, 353, 474, 718, 29871, 29896, 13, 4706, 565, 14677, 1275, 302, 29876, 29901, 13, 9651, 534, 353, 534, 29930, 29896, 29900, 13, 9651, 14677, 353, 29871, 29896, 13, 13, 1678, 736, 7442, 29889, 2378, 29898, 29916, 29918, 1188, 511, 7442, 29889, 2378, 29898, 29873, 29918, 1188, 29897, 13, 13, 13, 1753, 931, 29918, 10568, 29898, 29873, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 910, 740, 10017, 263, 931, 4331, 515, 263, 931, 1409, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 260, 29901, 259, 1409, 310, 5685, 1446, 13, 18884, 931, 1409, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 1678, 11636, 29901, 268, 5785, 13, 462, 4706, 931, 4331, 11636, 13, 1678, 9995, 13, 1678, 11636, 353, 260, 14352, 29896, 16261, 2435, 29898, 29873, 29897, 13, 1678, 736, 11636, 13, 13, 13, 1753, 7602, 29898, 4299, 29892, 260, 29892, 383, 29892, 282, 29896, 29892, 282, 29906, 29892, 282, 29941, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 910, 740, 3408, 1078, 278, 26851, 310, 278, 3240, 538, 749, 29892, 501, 29892, 470, 26681, 749, 29892, 660, 29892, 322, 278, 4889, 29892, 383, 29892, 1304, 304, 1147, 6832, 29891, 13, 1678, 278, 390, 14851, 304, 365, 14851, 2625, 310, 11243, 29889, 29871, 29896, 29941, 515, 20535, 362, 310, 10117, 5741, 1111, 295, 6288, 18598, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 1904, 29901, 259, 1347, 13, 462, 1678, 2106, 5741, 1111, 295, 6288, 1904, 1304, 29892, 321, 29889, 29887, 29889, 525, 15462, 29889, 27326, 3845, 29899, 29963, 29877, 5523, 742, 525, 15462, 29889, 5918, 5872, 29915, 13, 268, 13, 1678, 584, 3207, 260, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 1678, 931, 1409, 13, 268, 13, 1678, 584, 3207, 383, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 1678, 11004, 1409, 13, 268, 13, 1678, 584, 3207, 282, 29896, 29901, 418, 5785, 13, 462, 1678, 12983, 2286, 363, 1879, 470, 435, 29887, 13, 268, 13, 1678, 584, 3207, 282, 29906, 29901, 418, 1409, 310, 5685, 1446, 13, 462, 1678, 12983, 2286, 363, 402, 470, 435, 13, 268, 13, 1678, 584, 3207, 282, 29941, 29901, 418, 1409, 310, 5685, 1446, 13, 462, 1678, 12983, 2286, 363, 4890, 277, 293, 931, 29892, 260, 585, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 4706, 274, 29901, 29871, 1409, 310, 5785, 13, 462, 4706, 16969, 26851, 501, 29930, 29943, 310, 3240, 538, 749, 29892, 501, 322, 4889, 29892, 383, 470, 278, 26851, 660, 29930, 29943, 13, 462, 4706, 310, 26681, 749, 29892, 660, 322, 4889, 29892, 383, 13, 1678, 9995, 13, 1678, 11636, 353, 931, 29918, 10568, 29898, 29873, 29897, 29871, 396, 12833, 19471, 515, 931, 1409, 304, 1209, 964, 19554, 26851, 304, 2367, 13, 462, 539, 396, 372, 2472, 1048, 278, 5335, 342, 1022, 13, 1678, 565, 1904, 1275, 525, 15462, 29889, 27326, 3845, 29899, 29963, 29877, 5523, 2396, 13, 4706, 501, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 29873, 876, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 29873, 22164, 29871, 396, 4649, 538, 749, 740, 313, 6108, 29871, 29896, 29906, 29897, 515, 20535, 362, 310, 10117, 856, 13, 9651, 501, 29961, 29875, 29962, 353, 2533, 29898, 29886, 29906, 7503, 29962, 847, 282, 29941, 7503, 29962, 334, 7442, 29889, 4548, 6278, 29873, 29961, 29875, 29962, 847, 282, 29941, 7503, 12622, 13, 13, 4706, 274, 353, 7442, 29889, 535, 1555, 345, 29898, 29965, 29892, 383, 29892, 4464, 2433, 8159, 1495, 334, 11636, 29871, 396, 3408, 1078, 26851, 29892, 11636, 10365, 363, 5335, 342, 1022, 13, 4706, 274, 353, 274, 29961, 3881, 29898, 2435, 29898, 29943, 28166, 718, 282, 29896, 334, 383, 29871, 396, 871, 671, 3464, 310, 2183, 848, 12778, 435, 29887, 29930, 29943, 13, 13, 1678, 396, 565, 1904, 1275, 525, 15462, 29889, 5918, 5872, 2396, 29871, 396, 378, 1555, 329, 601, 262, 4225, 304, 367, 7484, 13, 1678, 396, 1678, 501, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 29873, 876, 13, 1678, 396, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 29873, 22164, 13, 1678, 396, 4706, 501, 29961, 29875, 29962, 353, 2533, 3552, 29930, 9302, 29889, 4548, 6278, 29873, 29961, 29875, 16261, 4722, 29918, 29894, 7503, 12622, 13, 13, 1678, 396, 1678, 274, 353, 7442, 29889, 535, 1555, 345, 29898, 29965, 29892, 383, 29892, 4464, 2433, 8159, 1495, 29930, 6008, 29871, 396, 3408, 1078, 26851, 29892, 11636, 10365, 363, 5335, 342, 1022, 13, 1678, 396, 1678, 274, 353, 274, 29961, 3881, 29898, 2435, 29898, 29943, 28166, 718, 435, 29887, 29930, 29943, 29871, 396, 871, 671, 3464, 310, 2183, 848, 12778, 435, 29887, 29930, 29943, 13, 13, 1678, 736, 274, 13, 13, 13, 1753, 7602, 29918, 29888, 5367, 29918, 1188, 29898, 7529, 29892, 260, 29892, 383, 29892, 6872, 29892, 10188, 29892, 11636, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 338, 278, 10995, 950, 740, 310, 278, 6872, 848, 322, 278, 26851, 740, 1304, 363, 278, 13, 1678, 405, 8547, 28221, 8792, 773, 1480, 23830, 13076, 6287, 29881, 848, 297, 931, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 8636, 29901, 29871, 9657, 934, 13, 462, 1678, 13343, 934, 15446, 278, 4128, 13, 268, 13, 1678, 584, 3207, 260, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 1678, 931, 1409, 6287, 29881, 297, 1480, 23830, 13076, 6287, 13, 268, 13, 1678, 584, 3207, 383, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 1678, 11004, 1409, 885, 433, 287, 297, 1480, 23830, 13076, 6287, 13, 268, 13, 1678, 584, 3207, 6872, 29901, 268, 1409, 310, 5685, 1446, 13, 462, 1678, 323, 666, 2602, 470, 316, 5404, 1409, 6287, 29881, 297, 1480, 23830, 13076, 6287, 13, 268, 13, 1678, 584, 3207, 10188, 29901, 1678, 938, 13, 462, 1678, 9681, 310, 626, 2288, 13, 268, 13, 1678, 584, 3207, 11636, 29901, 418, 5785, 13, 462, 1678, 931, 4331, 310, 1480, 23830, 13076, 885, 433, 287, 931, 1409, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 4706, 10995, 950, 29901, 259, 1409, 310, 5785, 13, 462, 18884, 16969, 278, 10995, 950, 310, 278, 278, 17986, 29914, 3601, 7964, 316, 5404, 848, 13, 462, 18884, 322, 278, 26851, 607, 338, 6260, 1891, 491, 278, 301, 29885, 9202, 5687, 6260, 675, 13, 462, 18884, 297, 278, 405, 8547, 29918, 9202, 3093, 272, 277, 29885, 13, 1678, 9995, 13, 1678, 435, 353, 7442, 29889, 3298, 359, 29898, 279, 1516, 29897, 29871, 396, 11905, 435, 1409, 13, 1678, 260, 585, 353, 7442, 29889, 3298, 359, 29898, 279, 1516, 29897, 29871, 396, 11905, 260, 585, 1409, 13, 13, 1678, 396, 15376, 288, 11269, 2699, 515, 8600, 934, 964, 435, 322, 260, 585, 1409, 13, 1678, 282, 353, 8636, 29889, 5975, 8977, 580, 13, 1678, 435, 29887, 353, 282, 1839, 29967, 29887, 2033, 13, 1678, 435, 29961, 29900, 29962, 353, 282, 1839, 29967, 29896, 2033, 13, 1678, 260, 585, 29961, 29900, 29962, 353, 282, 1839, 4722, 29896, 2033, 13, 1678, 565, 10188, 1405, 29871, 29896, 29901, 13, 4706, 435, 29961, 29896, 29962, 353, 282, 1839, 29967, 29906, 2033, 13, 4706, 260, 585, 29961, 29896, 29962, 353, 282, 1839, 4722, 29906, 2033, 13, 4706, 565, 10188, 1405, 29871, 29906, 29901, 13, 9651, 435, 29961, 29906, 29962, 353, 282, 1839, 29967, 29941, 2033, 13, 9651, 260, 585, 29961, 29906, 29962, 353, 282, 1839, 4722, 29941, 2033, 13, 9651, 565, 10188, 1405, 29871, 29941, 29901, 13, 18884, 435, 29961, 29941, 29962, 353, 282, 1839, 29967, 29946, 2033, 13, 18884, 260, 585, 29961, 29941, 29962, 353, 282, 1839, 4722, 29946, 2033, 13, 18884, 565, 10188, 1405, 29871, 29946, 29901, 13, 462, 1678, 435, 29961, 29946, 29962, 353, 282, 1839, 29967, 29945, 2033, 13, 462, 1678, 260, 585, 29961, 29946, 29962, 353, 282, 1839, 4722, 29945, 2033, 13, 13, 1678, 501, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 29873, 876, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 29873, 22164, 29871, 396, 4649, 538, 749, 740, 313, 6108, 29871, 29896, 29906, 29897, 515, 20535, 362, 310, 10117, 856, 13, 4706, 501, 29961, 29875, 29962, 353, 2533, 29898, 29967, 7503, 29962, 847, 260, 585, 7503, 29962, 334, 7442, 29889, 4548, 6278, 29873, 29961, 29875, 29962, 847, 260, 585, 7503, 12622, 13, 13, 1678, 1904, 353, 7442, 29889, 535, 1555, 345, 29898, 29965, 29892, 383, 29892, 4464, 2433, 8159, 1495, 334, 11636, 29871, 396, 378, 1555, 1960, 3240, 538, 749, 411, 383, 322, 14088, 13, 462, 462, 462, 396, 931, 4331, 304, 19554, 26851, 13, 1678, 1904, 353, 1904, 29961, 3881, 29898, 9302, 29889, 2311, 29898, 29943, 28166, 718, 435, 29887, 334, 383, 29871, 396, 27778, 3464, 310, 848, 310, 2159, 310, 4889, 1409, 13, 462, 462, 1669, 396, 322, 12778, 278, 3234, 310, 770, 29891, 752, 13036, 13, 462, 462, 1669, 396, 322, 4889, 1409, 13, 1678, 10995, 950, 353, 313, 12632, 448, 1904, 29897, 847, 6872, 29871, 396, 3408, 1078, 278, 10995, 950, 304, 367, 6260, 1891, 491, 734, 29882, 405, 8547, 29918, 9202, 13, 462, 462, 1678, 396, 5687, 13, 1678, 736, 10995, 950, 13, 13, 13, 1753, 7602, 29918, 29888, 5367, 29918, 2230, 29898, 7529, 29892, 260, 29892, 383, 29892, 6872, 29892, 10188, 29892, 11636, 1125, 13, 1678, 9995, 13, 1678, 12953, 29901, 13, 1678, 450, 740, 338, 278, 10995, 950, 740, 310, 278, 6872, 848, 322, 278, 26851, 740, 1304, 363, 278, 13, 1678, 405, 8547, 28221, 8792, 773, 6287, 29881, 848, 297, 931, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 8636, 29901, 29871, 9657, 934, 13, 462, 1678, 13343, 934, 15446, 278, 4128, 13, 268, 13, 1678, 584, 3207, 260, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 1678, 931, 1409, 6287, 29881, 13, 268, 13, 1678, 584, 3207, 383, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 1678, 11004, 1409, 885, 433, 287, 13, 268, 13, 1678, 584, 3207, 6872, 29901, 268, 1409, 310, 5685, 1446, 13, 462, 1678, 323, 666, 2602, 470, 316, 5404, 1409, 13, 268, 13, 1678, 584, 3207, 10188, 29901, 1678, 938, 13, 462, 1678, 9681, 310, 626, 2288, 13, 268, 13, 1678, 584, 3207, 11636, 29901, 418, 5785, 13, 462, 1678, 931, 4331, 885, 433, 287, 931, 1409, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 2123, 649, 29901, 13, 1678, 584, 2457, 29901, 4706, 10995, 950, 29901, 259, 1409, 310, 5785, 13, 462, 18884, 16969, 278, 10995, 950, 310, 278, 278, 17986, 29914, 3601, 7964, 316, 5404, 848, 13, 462, 18884, 322, 278, 26851, 607, 338, 6260, 1891, 491, 278, 301, 29885, 9202, 5687, 6260, 675, 13, 462, 18884, 297, 278, 405, 8547, 29918, 9202, 3093, 272, 277, 29885, 13, 1678, 9995, 13, 1678, 435, 353, 7442, 29889, 3298, 359, 29898, 279, 1516, 29897, 29871, 396, 11905, 435, 1409, 13, 1678, 260, 585, 353, 7442, 29889, 3298, 359, 29898, 279, 1516, 29897, 29871, 396, 11905, 260, 585, 1409, 13, 13, 1678, 396, 15376, 288, 11269, 2699, 515, 8600, 934, 964, 435, 322, 260, 585, 1409, 13, 1678, 282, 353, 8636, 29889, 5975, 8977, 580, 13, 1678, 435, 29887, 353, 282, 1839, 29967, 29887, 2033, 13, 1678, 435, 29961, 29900, 29962, 353, 282, 1839, 29967, 29896, 2033, 13, 1678, 260, 585, 29961, 29900, 29962, 353, 282, 1839, 4722, 29896, 2033, 13, 1678, 565, 10188, 1405, 29871, 29896, 29901, 13, 4706, 435, 29961, 29896, 29962, 353, 282, 1839, 29967, 29906, 2033, 13, 4706, 260, 585, 29961, 29896, 29962, 353, 282, 1839, 4722, 29906, 2033, 13, 4706, 565, 10188, 1405, 29871, 29906, 29901, 13, 9651, 435, 29961, 29906, 29962, 353, 282, 1839, 29967, 29941, 2033, 13, 9651, 260, 585, 29961, 29906, 29962, 353, 282, 1839, 4722, 29941, 2033, 13, 9651, 565, 10188, 1405, 29871, 29941, 29901, 13, 18884, 435, 29961, 29941, 29962, 353, 282, 1839, 29967, 29946, 2033, 13, 18884, 260, 585, 29961, 29941, 29962, 353, 282, 1839, 4722, 29946, 2033, 13, 18884, 565, 10188, 1405, 29871, 29946, 29901, 13, 462, 1678, 435, 29961, 29946, 29962, 353, 282, 1839, 29967, 29945, 2033, 13, 462, 1678, 260, 585, 29961, 29946, 29962, 353, 282, 1839, 4722, 29945, 2033, 13, 13, 1678, 501, 353, 7442, 29889, 3298, 359, 29898, 2435, 29898, 29873, 876, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 29873, 22164, 29871, 396, 4649, 538, 749, 740, 313, 6108, 29871, 29896, 29906, 29897, 515, 20535, 362, 310, 10117, 856, 13, 4706, 501, 29961, 29875, 29962, 353, 2533, 29898, 29967, 7503, 29962, 847, 260, 585, 7503, 29962, 334, 7442, 29889, 4548, 6278, 29873, 29961, 29875, 29962, 847, 260, 585, 7503, 12622, 13, 13, 1678, 1904, 353, 7442, 29889, 535, 1555, 345, 29898, 29965, 29892, 383, 29892, 4464, 2433, 8159, 1495, 334, 11636, 29871, 396, 378, 1555, 1960, 3240, 538, 749, 411, 383, 322, 14088, 13, 462, 462, 462, 396, 931, 4331, 304, 19554, 26851, 13, 1678, 1904, 353, 1904, 29961, 3881, 29898, 9302, 29889, 2311, 29898, 29943, 28166, 718, 435, 29887, 334, 383, 29871, 396, 27778, 3464, 310, 848, 310, 2159, 310, 4889, 1409, 13, 462, 462, 1669, 396, 322, 12778, 278, 3234, 310, 770, 29891, 752, 13036, 13, 462, 462, 1669, 396, 322, 4889, 1409, 13, 1678, 10995, 950, 353, 313, 12632, 448, 1904, 29897, 847, 6872, 29871, 396, 3408, 1078, 278, 10995, 950, 304, 367, 6260, 1891, 491, 734, 29882, 405, 8547, 29918, 9202, 13, 462, 462, 1678, 396, 5687, 13, 1678, 736, 10995, 950, 13, 13, 13, 1753, 405, 8547, 29918, 9202, 29898, 371, 6387, 802, 29892, 435, 29887, 29892, 435, 29892, 260, 585, 29892, 10188, 29892, 260, 29892, 6872, 29892, 383, 29892, 394, 5444, 29892, 260, 29918, 690, 29892, 260, 29918, 4548, 1125, 13, 1678, 9995, 13, 1678, 20355, 29886, 654, 29901, 13, 1678, 10050, 10660, 951, 579, 317, 25621, 545, 383, 5367, 5687, 1304, 304, 6216, 1998, 1111, 295, 6288, 1904, 3443, 304, 17986, 470, 1027, 7964, 13, 1678, 848, 29914, 5098, 29924, 848, 29889, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 12662, 2699, 29901, 13, 1678, 584, 3207, 11043, 29901, 1347, 13, 462, 418, 773, 4522, 885, 433, 287, 470, 931, 6287, 29881, 848, 13, 268, 13, 1678, 584, 3207, 435, 29887, 29901, 4706, 5785, 13, 462, 418, 770, 29891, 752, 13036, 13, 268, 13, 1678, 584, 3207, 435, 29901, 308, 1409, 310, 5685, 1446, 13, 462, 418, 3831, 13036, 13, 268, 13, 1678, 584, 3207, 260, 585, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 418, 17443, 931, 13, 268, 13, 1678, 584, 3207, 10188, 29901, 418, 938, 13, 462, 418, 1353, 310, 1904, 10188, 13, 268, 13, 1678, 584, 3207, 260, 29901, 308, 1409, 310, 5685, 1446, 13, 462, 418, 931, 1409, 13, 268, 13, 1678, 584, 3207, 6872, 29901, 539, 1409, 310, 5685, 1446, 13, 462, 418, 6872, 2602, 975, 931, 13, 268, 13, 1678, 584, 3207, 383, 29901, 308, 1409, 310, 5685, 1446, 13, 462, 418, 6872, 2602, 975, 931, 13, 268, 13, 1678, 584, 3207, 394, 5444, 29901, 418, 5785, 13, 462, 418, 28601, 17415, 22884, 29914, 4151, 262, 304, 4889, 29914, 1753, 456, 362, 491, 10365, 292, 363, 6872, 16303, 13, 268, 13, 1678, 584, 3207, 260, 29918, 690, 29901, 268, 5785, 13, 462, 418, 931, 10104, 310, 7639, 29892, 1304, 304, 1480, 6287, 278, 848, 13, 268, 13, 1678, 584, 3207, 260, 29918, 4548, 29901, 268, 5785, 13, 462, 418, 2186, 931, 310, 7639, 13, 1678, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 13, 1678, 7106, 29892, 740, 714, 449, 29901, 13, 1678, 584, 2457, 29901, 3986, 435, 29887, 29918, 9202, 29901, 259, 5785, 13, 462, 18884, 770, 29891, 752, 13036, 25890, 13, 462, 539, 13, 462, 418, 435, 29918, 9202, 29901, 1678, 5785, 13, 462, 18884, 25890, 13162, 1239, 4958, 13, 462, 539, 13, 462, 418, 260, 585, 29918, 9202, 29901, 29871, 5785, 13, 462, 18884, 25890, 17443, 931, 13, 1678, 9995, 13, 1678, 8636, 353, 12662, 2699, 580, 29871, 396, 2847, 7093, 12662, 2699, 8600, 934, 13, 1678, 396, 3093, 2072, 19933, 2847, 10947, 4128, 8600, 411, 1998, 1111, 295, 6288, 1904, 4128, 13, 1678, 8636, 29889, 1202, 877, 29967, 29887, 742, 995, 29922, 29967, 29887, 29892, 1375, 29922, 29900, 29897, 13, 1678, 565, 10188, 1405, 29871, 29900, 29901, 13, 4706, 8636, 29889, 1202, 877, 29967, 29896, 742, 995, 29922, 29967, 29961, 29900, 1402, 1375, 29922, 29900, 29897, 13, 4706, 8636, 29889, 1202, 877, 4722, 29896, 742, 995, 29922, 4722, 29961, 29900, 1402, 1375, 29922, 29900, 29897, 13, 4706, 565, 10188, 1405, 29871, 29896, 29901, 13, 9651, 8636, 29889, 1202, 877, 29967, 29906, 742, 995, 29922, 29967, 29961, 29896, 1402, 1375, 29922, 29900, 29897, 13, 9651, 8636, 29889, 1202, 877, 4722, 29906, 742, 995, 29922, 4722, 29961, 29896, 1402, 1375, 29922, 29900, 29897, 13, 9651, 565, 10188, 1405, 29871, 29906, 29901, 13, 18884, 8636, 29889, 1202, 877, 29967, 29941, 742, 995, 29922, 29967, 29961, 29906, 1402, 1375, 29922, 29900, 29897, 13, 18884, 8636, 29889, 1202, 877, 4722, 29941, 742, 995, 29922, 4722, 29961, 29906, 1402, 1375, 29922, 29900, 29897, 13, 18884, 565, 10188, 1405, 29871, 29941, 29901, 13, 462, 1678, 8636, 29889, 1202, 877, 29967, 29946, 742, 995, 29922, 29967, 29961, 29941, 1402, 1375, 29922, 29900, 29897, 13, 462, 1678, 8636, 29889, 1202, 877, 4722, 29946, 742, 995, 29922, 4722, 29961, 29941, 1402, 1375, 29922, 29900, 29897, 13, 462, 1678, 565, 10188, 1405, 29871, 29946, 29901, 13, 462, 4706, 8636, 29889, 1202, 877, 29967, 29945, 742, 995, 29922, 29967, 29961, 29946, 1402, 1375, 29922, 29900, 29897, 13, 462, 4706, 8636, 29889, 1202, 877, 4722, 29945, 742, 995, 29922, 4722, 29961, 29946, 1402, 1375, 29922, 29900, 29897, 13, 1678, 565, 11043, 1275, 29871, 29900, 29901, 29871, 396, 1480, 6287, 13, 13, 4706, 6872, 29918, 12324, 353, 394, 5444, 334, 6872, 3579, 29871, 29896, 29889, 29945, 29871, 396, 390, 14851, 310, 6306, 2023, 29892, 14407, 28221, 848, 13, 4706, 6872, 29918, 12324, 29918, 1188, 29892, 260, 29918, 1188, 353, 1480, 29918, 7052, 29898, 12632, 29918, 12324, 29892, 260, 29892, 260, 29918, 690, 29892, 260, 29918, 4548, 29897, 29871, 396, 4226, 1891, 6872, 2602, 6287, 29881, 18018, 297, 639, 316, 6332, 13, 4706, 383, 29918, 1188, 29892, 903, 353, 1480, 29918, 7052, 29898, 29943, 29892, 260, 29892, 260, 29918, 690, 29892, 260, 29918, 4548, 29897, 259, 396, 6872, 29899, 11249, 11004, 6287, 29881, 6287, 29881, 18018, 297, 639, 1602, 328, 13, 4706, 11636, 353, 931, 29918, 10568, 29898, 29873, 29918, 1188, 29897, 29871, 396, 12833, 931, 4331, 515, 1881, 931, 1409, 29892, 5181, 363, 19554, 26851, 13, 13, 4706, 1121, 353, 6260, 675, 29898, 20580, 29918, 29888, 5367, 29918, 1188, 29892, 8636, 29892, 6389, 7607, 29873, 29918, 1188, 29892, 383, 29918, 1188, 29892, 6872, 29918, 12324, 29918, 1188, 29892, 10188, 29892, 11636, 511, 1158, 2433, 280, 579, 3044, 1495, 29871, 396, 1661, 29899, 10660, 3203, 18074, 29874, 545, 28221, 8792, 6260, 5281, 278, 26851, 740, 13, 4706, 1596, 29898, 12276, 29918, 9202, 29898, 2914, 876, 29871, 396, 14677, 278, 6216, 3461, 13, 13, 1678, 565, 11043, 1275, 29871, 29896, 29901, 29871, 396, 931, 6287, 13, 4706, 6872, 29918, 12324, 353, 394, 5444, 334, 6872, 3579, 29871, 29896, 29889, 29945, 13, 4706, 11636, 353, 931, 29918, 10568, 29898, 29873, 29897, 13, 4706, 1121, 353, 6260, 675, 29898, 20580, 29918, 29888, 5367, 29918, 2230, 29892, 8636, 29892, 6389, 7607, 29873, 29892, 383, 29892, 6872, 29918, 12324, 29892, 10188, 29892, 11636, 511, 1158, 2433, 280, 579, 3044, 1495, 13, 4706, 1596, 29898, 12276, 29918, 9202, 29898, 2914, 876, 13, 13, 1678, 396, 14422, 25890, 4128, 13, 1678, 435, 29887, 29918, 9202, 353, 1121, 29889, 7529, 1839, 29967, 29887, 13359, 1767, 13, 1678, 435, 29918, 9202, 353, 7442, 29889, 3298, 359, 29898, 279, 1516, 29897, 13, 1678, 260, 585, 29918, 9202, 353, 7442, 29889, 3298, 359, 29898, 279, 1516, 29897, 13, 1678, 435, 29918, 9202, 29961, 29900, 29962, 353, 1121, 29889, 7529, 1839, 29967, 29896, 13359, 1767, 13, 1678, 260, 585, 29918, 9202, 29961, 29900, 29962, 353, 1121, 29889, 7529, 1839, 4722, 29896, 13359, 1767, 13, 1678, 565, 10188, 1405, 29871, 29896, 29901, 13, 4706, 435, 29918, 9202, 29961, 29896, 29962, 353, 1121, 29889, 7529, 1839, 29967, 29906, 13359, 1767, 13, 4706, 260, 585, 29918, 9202, 29961, 29896, 29962, 353, 1121, 29889, 7529, 1839, 4722, 29906, 13359, 1767, 13, 4706, 565, 10188, 1405, 29871, 29906, 29901, 13, 9651, 435, 29918, 9202, 29961, 29906, 29962, 353, 1121, 29889, 7529, 1839, 29967, 29941, 13359, 1767, 13, 9651, 260, 585, 29918, 9202, 29961, 29906, 29962, 353, 1121, 29889, 7529, 1839, 4722, 29941, 13359, 1767, 13, 9651, 565, 10188, 1405, 29871, 29941, 29901, 13, 18884, 435, 29918, 9202, 29961, 29941, 29962, 353, 1121, 29889, 7529, 1839, 29967, 29946, 13359, 1767, 13, 18884, 260, 585, 29918, 9202, 29961, 29941, 29962, 353, 1121, 29889, 7529, 1839, 4722, 29946, 13359, 1767, 13, 18884, 565, 10188, 1405, 29871, 29946, 29901, 13, 462, 1678, 435, 29918, 9202, 29961, 29946, 29962, 353, 1121, 29889, 7529, 1839, 29967, 29945, 13359, 1767, 13, 462, 1678, 260, 585, 29918, 9202, 29961, 29946, 29962, 353, 1121, 29889, 7529, 1839, 4722, 29945, 13359, 1767, 13, 13, 1678, 736, 435, 29887, 29918, 9202, 29892, 435, 29918, 9202, 29892, 260, 585, 29918, 9202, 13, 2 ]
application/utils/globals.py
topix-hackademy/social-listener
12
164224
<reponame>topix-hackademy/social-listener configuration = None def init(): global configuration configuration = None
[ 1, 529, 276, 1112, 420, 29958, 3332, 861, 29899, 29882, 547, 1943, 1357, 29914, 24911, 29899, 25894, 13, 13305, 353, 6213, 13, 13, 13, 1753, 2069, 7295, 13, 1678, 5534, 5285, 13, 1678, 5285, 353, 6213, 13, 2 ]
AutoGraphModel.py
shiqitao/AutoGraph
0
26332
<filename>AutoGraphModel.py import argparse import os import time import torch from filelock import FileLock from ModelAPPNP import main_model_appnp from ModelAPPNP2 import main_model_appnp as main_model_appnp_2 from ModelAPPNP3 import main_model_appnp as main_model_appnp_3 from ModelAPPNP4 import main_model_appnp as main_model_appnp_4 from ModelGAT import main_model_gat from ModelGAT2 import main_model_gat as main_model_gat_2 from ModelGAT3 import main_model_gat as main_model_gat_3 from ModelGAT4 import main_model_gat as main_model_gat_4 from ModelGCN import main_model_gcn from ModelGCN2 import main_model_gcn as main_model_gcn_2 from ModelGCN3 import main_model_gcn as main_model_gcn_3 from ModelGCN4 import main_model_gcn as main_model_gcn_4 from ModelGCNOld import main_model_gcn_old from Result import Result from tools import save_data, load_data, file_path if __name__ == "__main__": start_time = time.time() time_budget = float("inf") parser = argparse.ArgumentParser() parser.add_argument("--index", type=int) parser.add_argument("--file_param", type=str) parser.add_argument("--file_ready", type=str) parser.add_argument("--file_result", type=str) parser.add_argument("--file_lock", type=str) parser.add_argument("--if_kill", type=int) args = parser.parse_args() if torch.cuda.is_available(): torch.zeros(1).cuda() with FileLock(args.file_lock): save_data(args.file_ready, os.getpid()) aoe_data = None while True: if aoe_data is None and os.path.exists(file_path("AOE.data")): with FileLock(file_path("AOE.ready")): aoe_data = load_data(file_path("AOE.data")) if os.path.exists(args.file_param): if aoe_data is None and os.path.exists(file_path("AOE.data")): with FileLock(file_path("AOE.ready")): aoe_data = load_data(file_path("AOE.data")) start_time = time.time() # 重置开始时间 with FileLock(args.file_lock): param = load_data(args.file_param) if param.time_budget is not None: time_budget = param.time_budget # 重置时间限制 try: if param.model == "ModelGCNOld": result = main_model_gcn_old( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): # 一定要按这个顺序 save -> remove save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelGAT": result = main_model_gat( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): # 一定要按这个顺序 save -> remove save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelGCN": result = main_model_gcn( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelAPPNP": result = main_model_appnp( data=aoe_data, K=param.param[0], alpha=param.param[1], hidden=param.param[2], activation=param.param[3], if_all=True ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelGAT2": result = main_model_gat_2( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): # 一定要按这个顺序 save -> remove save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelGCN2": result = main_model_gcn_2( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelAPPNP2": result = main_model_appnp_2( data=aoe_data, K=param.param[0], alpha=param.param[1], hidden=param.param[2], activation=param.param[3], if_all=True ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelGAT3": result = main_model_gat_3( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): # 一定要按这个顺序 save -> remove save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelGCN3": result = main_model_gcn_3( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelAPPNP3": result = main_model_appnp_3( data=aoe_data, K=param.param[0], alpha=param.param[1], hidden=param.param[2], activation=param.param[3], if_all=True ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelGAT4": result = main_model_gat_4( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): # 一定要按这个顺序 save -> remove save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelGCN4": result = main_model_gcn_4( data=aoe_data, num_layers=param.param[0], hidden_list=param.param[1], activation=param.param[2], if_all=True ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) elif param.model == "ModelAPPNP4": result = main_model_appnp_4( data=aoe_data, K=param.param[0], alpha=param.param[1], hidden=param.param[2], activation=param.param[3], if_all=True ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) else: raise ValueError("Model name error: {0}".format(param[0])) except RuntimeError: if args.if_kill == 1: break else: result = Result( result=None, loss_train=None, loss_valid=None, acc_train=None, acc_valid=None, epoch=None, ) with FileLock(args.file_lock): save_data(args.file_result, result) os.remove(args.file_param) if time.time() - start_time >= time_budget: break
[ 1, 529, 9507, 29958, 12300, 9527, 3195, 29889, 2272, 13, 5215, 1852, 5510, 13, 5215, 2897, 13, 5215, 931, 13, 13, 5215, 4842, 305, 13, 3166, 934, 908, 1053, 3497, 16542, 13, 13, 3166, 8125, 3301, 15695, 29925, 1053, 1667, 29918, 4299, 29918, 932, 9302, 13, 3166, 8125, 3301, 15695, 29925, 29906, 1053, 1667, 29918, 4299, 29918, 932, 9302, 408, 1667, 29918, 4299, 29918, 932, 9302, 29918, 29906, 13, 3166, 8125, 3301, 15695, 29925, 29941, 1053, 1667, 29918, 4299, 29918, 932, 9302, 408, 1667, 29918, 4299, 29918, 932, 9302, 29918, 29941, 13, 3166, 8125, 3301, 15695, 29925, 29946, 1053, 1667, 29918, 4299, 29918, 932, 9302, 408, 1667, 29918, 4299, 29918, 932, 9302, 29918, 29946, 13, 3166, 8125, 29954, 1299, 1053, 1667, 29918, 4299, 29918, 28818, 13, 3166, 8125, 29954, 1299, 29906, 1053, 1667, 29918, 4299, 29918, 28818, 408, 1667, 29918, 4299, 29918, 28818, 29918, 29906, 13, 3166, 8125, 29954, 1299, 29941, 1053, 1667, 29918, 4299, 29918, 28818, 408, 1667, 29918, 4299, 29918, 28818, 29918, 29941, 13, 3166, 8125, 29954, 1299, 29946, 1053, 1667, 29918, 4299, 29918, 28818, 408, 1667, 29918, 4299, 29918, 28818, 29918, 29946, 13, 3166, 8125, 8766, 29940, 1053, 1667, 29918, 4299, 29918, 29887, 18038, 13, 3166, 8125, 8766, 29940, 29906, 1053, 1667, 29918, 4299, 29918, 29887, 18038, 408, 1667, 29918, 4299, 29918, 29887, 18038, 29918, 29906, 13, 3166, 8125, 8766, 29940, 29941, 1053, 1667, 29918, 4299, 29918, 29887, 18038, 408, 1667, 29918, 4299, 29918, 29887, 18038, 29918, 29941, 13, 3166, 8125, 8766, 29940, 29946, 1053, 1667, 29918, 4299, 29918, 29887, 18038, 408, 1667, 29918, 4299, 29918, 29887, 18038, 29918, 29946, 13, 3166, 8125, 8766, 6632, 430, 1053, 1667, 29918, 4299, 29918, 29887, 18038, 29918, 1025, 13, 3166, 7867, 1053, 7867, 13, 3166, 8492, 1053, 4078, 29918, 1272, 29892, 2254, 29918, 1272, 29892, 934, 29918, 2084, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 1369, 29918, 2230, 353, 931, 29889, 2230, 580, 13, 1678, 931, 29918, 15841, 657, 353, 5785, 703, 7192, 1159, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 2248, 613, 1134, 29922, 524, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 1445, 29918, 3207, 613, 1134, 29922, 710, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 1445, 29918, 2040, 613, 1134, 29922, 710, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 1445, 29918, 2914, 613, 1134, 29922, 710, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 1445, 29918, 908, 613, 1134, 29922, 710, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 703, 489, 361, 29918, 21174, 613, 1134, 29922, 524, 29897, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 1678, 565, 4842, 305, 29889, 29883, 6191, 29889, 275, 29918, 16515, 7295, 13, 4706, 4842, 305, 29889, 3298, 359, 29898, 29896, 467, 29883, 6191, 580, 13, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2040, 29892, 2897, 29889, 657, 5935, 3101, 13, 1678, 5017, 29872, 29918, 1272, 353, 6213, 13, 1678, 1550, 5852, 29901, 13, 4706, 565, 5017, 29872, 29918, 1272, 338, 6213, 322, 2897, 29889, 2084, 29889, 9933, 29898, 1445, 29918, 2084, 703, 29909, 29949, 29923, 29889, 1272, 5783, 29901, 13, 9651, 411, 3497, 16542, 29898, 1445, 29918, 2084, 703, 29909, 29949, 29923, 29889, 2040, 5783, 29901, 13, 18884, 5017, 29872, 29918, 1272, 353, 2254, 29918, 1272, 29898, 1445, 29918, 2084, 703, 29909, 29949, 29923, 29889, 1272, 5783, 13, 4706, 565, 2897, 29889, 2084, 29889, 9933, 29898, 5085, 29889, 1445, 29918, 3207, 1125, 13, 9651, 565, 5017, 29872, 29918, 1272, 338, 6213, 322, 2897, 29889, 2084, 29889, 9933, 29898, 1445, 29918, 2084, 703, 29909, 29949, 29923, 29889, 1272, 5783, 29901, 13, 18884, 411, 3497, 16542, 29898, 1445, 29918, 2084, 703, 29909, 29949, 29923, 29889, 2040, 5783, 29901, 13, 462, 1678, 5017, 29872, 29918, 1272, 353, 2254, 29918, 1272, 29898, 1445, 29918, 2084, 703, 29909, 29949, 29923, 29889, 1272, 5783, 13, 9651, 1369, 29918, 2230, 353, 931, 29889, 2230, 580, 29871, 396, 29871, 30908, 30669, 31026, 31020, 30594, 31016, 13, 9651, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 18884, 1828, 353, 2254, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 9651, 565, 1828, 29889, 2230, 29918, 15841, 657, 338, 451, 6213, 29901, 13, 18884, 931, 29918, 15841, 657, 353, 1828, 29889, 2230, 29918, 15841, 657, 29871, 396, 29871, 30908, 30669, 30594, 31016, 31175, 31072, 13, 9651, 1018, 29901, 13, 18884, 565, 1828, 29889, 4299, 1275, 376, 3195, 8766, 6632, 430, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 29887, 18038, 29918, 1025, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 396, 29871, 30287, 30495, 30698, 31590, 30810, 30502, 236, 164, 189, 31463, 4078, 1599, 3349, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 29954, 1299, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 28818, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 396, 29871, 30287, 30495, 30698, 31590, 30810, 30502, 236, 164, 189, 31463, 4078, 1599, 3349, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 8766, 29940, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 29887, 18038, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 3301, 15695, 29925, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 932, 9302, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 476, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 15595, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 7934, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29941, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 29954, 1299, 29906, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 28818, 29918, 29906, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 396, 29871, 30287, 30495, 30698, 31590, 30810, 30502, 236, 164, 189, 31463, 4078, 1599, 3349, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 8766, 29940, 29906, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 29887, 18038, 29918, 29906, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 3301, 15695, 29925, 29906, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 932, 9302, 29918, 29906, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 476, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 15595, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 7934, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29941, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 29954, 1299, 29941, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 28818, 29918, 29941, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 396, 29871, 30287, 30495, 30698, 31590, 30810, 30502, 236, 164, 189, 31463, 4078, 1599, 3349, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 8766, 29940, 29941, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 29887, 18038, 29918, 29941, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 3301, 15695, 29925, 29941, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 932, 9302, 29918, 29941, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 476, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 15595, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 7934, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29941, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 29954, 1299, 29946, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 28818, 29918, 29946, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 396, 29871, 30287, 30495, 30698, 31590, 30810, 30502, 236, 164, 189, 31463, 4078, 1599, 3349, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 8766, 29940, 29946, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 29887, 18038, 29918, 29946, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 954, 29918, 29277, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 7934, 29918, 1761, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 25342, 1828, 29889, 4299, 1275, 376, 3195, 3301, 15695, 29925, 29946, 1115, 13, 462, 1678, 1121, 353, 1667, 29918, 4299, 29918, 932, 9302, 29918, 29946, 29898, 13, 462, 4706, 848, 29922, 6241, 29872, 29918, 1272, 29892, 13, 462, 4706, 476, 29922, 3207, 29889, 3207, 29961, 29900, 1402, 13, 462, 4706, 15595, 29922, 3207, 29889, 3207, 29961, 29896, 1402, 13, 462, 4706, 7934, 29922, 3207, 29889, 3207, 29961, 29906, 1402, 13, 462, 4706, 26229, 29922, 3207, 29889, 3207, 29961, 29941, 1402, 13, 462, 4706, 565, 29918, 497, 29922, 5574, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 12020, 7865, 2392, 703, 3195, 1024, 1059, 29901, 426, 29900, 29913, 1642, 4830, 29898, 3207, 29961, 29900, 12622, 13, 9651, 5174, 24875, 2392, 29901, 13, 18884, 565, 6389, 29889, 361, 29918, 21174, 1275, 29871, 29896, 29901, 13, 462, 1678, 2867, 13, 18884, 1683, 29901, 13, 462, 1678, 1121, 353, 7867, 29898, 13, 462, 4706, 1121, 29922, 8516, 29892, 13, 462, 4706, 6410, 29918, 14968, 29922, 8516, 29892, 13, 462, 4706, 6410, 29918, 3084, 29922, 8516, 29892, 13, 462, 4706, 1035, 29918, 14968, 29922, 8516, 29892, 13, 462, 4706, 1035, 29918, 3084, 29922, 8516, 29892, 13, 462, 4706, 21502, 305, 29922, 8516, 29892, 13, 462, 1678, 1723, 13, 462, 1678, 411, 3497, 16542, 29898, 5085, 29889, 1445, 29918, 908, 1125, 13, 462, 4706, 4078, 29918, 1272, 29898, 5085, 29889, 1445, 29918, 2914, 29892, 1121, 29897, 13, 462, 4706, 2897, 29889, 5992, 29898, 5085, 29889, 1445, 29918, 3207, 29897, 13, 13, 4706, 565, 931, 29889, 2230, 580, 448, 1369, 29918, 2230, 6736, 931, 29918, 15841, 657, 29901, 13, 9651, 2867, 13, 2 ]
laaso/command.py
srrao-git/amlFilesystem-hydrator
2
1607175
# # laaso/command.py # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # ''' Implement the Command class which handles @command decorators. ''' import functools import inspect import logging import pprint import sys import laaso.output from laaso.util import expand_item_pformat class Command(): ''' Manage decorators for an application. These decorators enable exposing actions through the command line by defining and decorating the handler without touching other argument parsing. ''' def __init__(self): self._commands = dict() # key=name value=_Item RESERVED_NAMES = ('actions', 'can_handle', 'commands', 'handle', 'print', ) @property def actions(self): ''' Getter that returns a lexically-sorted list of handler names. ''' return sorted(self._commands.keys()) @classmethod def _name_valid(cls, name): ''' Return whether name is usable as a decoration. Example: command = Command() @command._some_func That is not valid, because '_some_func' begins with '_'. We do not allow leading underscores to avoid exposing class internals and to easily avoid accidently exposing or shading the internals of this class. Similarly, all public methods and attributes must be enumerated in RESERVED_NAMES. See __getattr__() for this in action. ''' if not isinstance(name, str): return False if not name: return False if name.startswith('_'): return False if name in cls.RESERVED_NAMES: return False return True def __getattr__(self, name): ''' If name is not internal to this class, treat it as a decorator. ''' if not self._name_valid(name): # Not a decoration raise AttributeError("'%s' object has no attribute '%s'" % (type(self).__name__, name)) return functools.partial(self._decorate, name) def _decorate(self, decorator, func): ''' Decorate the named func. decorator is the name of the decoration - eg: command = Command() @command.simple def some_func(): generates _decorate('simple', 'some_func', some_func) ''' printable = decorator.startswith('printable') printable_raw = decorator.endswith('_raw') or ('_raw_' in decorator) ci = _Item(decorator, func, printable=printable, printable_raw=printable_raw) if not self._name_valid(ci.name): raise ValueError("may not decorate using reserved name %r" % ci.name) if ci.name in self._commands: raise ValueError("duplicate command %r" % ci.name) self._commands[ci.name] = ci return ci.func def _handle(self, doit, name, decorators, *args, **kwargs): ''' Try provided decorators until one is found or there is nothing left to try. ''' if isinstance(decorators, str): return self._handle_one(doit, name, decorators, *args, **kwargs) for decorator in decorators: ret = self._handle_one(doit, name, decorator, *args, **kwargs) if ret: return ret return False def _handle_one(self, doit, name, decorator, *args, **kwargs): ''' Invoke the registered handler for name. If no handler is registered, return False. If a handler is registered, return True. ''' ci = self._commands.get(name, None) if not (ci and ci.decorator == decorator): return False if args: kls = ci.getclass() if kls: # We could check: if not isinstance(args[0], (kls,)) # here. That would allow decorating method X in a class C1 # and then executing X on class C2 which is a subclass of C1. # The behavior there could be unexpected; even if C2 overloads X, # C1.X is executed on the object. We already prevent redecorating # an inherited method through the name collision check, so # here we simply restrict the check to be exactly the # target class rather than allowing subclasses. if type(args[0]) is not kls: # pylint: disable=unidiomatic-typecheck return False if doit: ret = ci.func(*args, **kwargs) if ci.printable_raw: laaso.output.capture() if isinstance(ret, (list, set, tuple)): for x in ret: if isinstance(x, str): sys.stdout.laaso_rawwrite(x+'\n') else: sys.stdout.laaso_rawwrite(expand_item_pformat(x, prefix='')+'\n') else: if isinstance(ret, str): sys.stdout.laaso_rawwrite(ret+'\n') else: sys.stdout.laaso_rawwrite(expand_item_pformat(ret, prefix='')+'\n') elif ci.printable: if isinstance(ret, (list, set, tuple)): for x in ret: if isinstance(x, str): print(x) else: print(expand_item_pformat(x, prefix='')) else: if isinstance(ret, str): print(ret) else: print(expand_item_pformat(ret, prefix='')) return True @staticmethod def print(item): ''' print() the given item ''' if isinstance(item, (list, set, tuple)): for x in item: if isinstance(x, str): print(x) else: print(expand_item_pformat(x, prefix='')) else: if isinstance(item, str): print(item) else: print(expand_item_pformat(item, prefix='')) def handle(self, name, decorators, *args, **kwargs): ''' Invoke the registered handler for name. decorators may be a single string or something iterable. If no handler is registered, return False. If a handler is registered, return True. If more than one decorator is provided, decorators are tried in that order until a match is found. A return of False indicates no match. ''' return self._handle(True, name, decorators, *args, **kwargs) def can_handle(self, name, decorators, *args, **kwargs): ''' Like handle, but only returns whether the action would be handled. ''' return self._handle(False, name, decorators, *args, **kwargs) def commands(self, decorators=None): ''' Return a dict of name:func pairs. If decorators is None, returns everything. If decorators is a string, returns only those items decorated with that string. Otherwise, returns items whose decorators are in the given decorators (assumes something like list, set, tuple, etc). ''' ret = dict() for name, ci in self._commands.items(): if decorators is None: pass elif isinstance(decorators, str): if ci.decorator != decorators: continue else: if ci.decorator not in decorators: continue ret[name] = ci.func return ret def itemfuncs(self): ''' Return a dict of item_name : func ''' return {ci.decorator : ci.func for ci in self._commands.values()} class _Item(): ''' A single decorated call managed by Command ''' def __init__(self, decorator, func, printable=False, printable_raw=False): self.decorator = decorator self.func = func self.printable = printable self.printable_raw = printable_raw self.name = self.func.__name__ def __repr__(self): return "%s(%r, %r, printable=%r, printable_raw=%r)" % (type(self).__name__, self.decorator, self.func, self.printable, self.printable_raw) DEBUG_NAMESPACE = False def getclass(self): ''' Return the class of the decorated func. Returns None if this is a top-level function. ''' kls = None members = inspect.getmembers(self.func) g = dict() # global namespace in which self.func was defined for m in members: if m[0] == '__globals__': g = m[1] break qns = self.func.__qualname__.split('.') if len(qns) > 1: kls = [g[qns[0]]] # use a list for debugging if not isinstance(kls[0], (type,)): raise RuntimeError("attempt to perform decorated handle on item not in the global namespace") for qn in qns[1:-1]: try: kls.append(getattr(kls[-1], qn)) if not isinstance(kls[-1], (type,)): raise RuntimeError("attempt to perform decorated handle on item not in the global namespace") except AttributeError as exc: if self.DEBUG_NAMESPACE: logging.basicConfig(format="%(message)s", stream=sys.stderr) logger = logging.getLogger() logger.error("ERROR: %s.getclass\n" " members\n%s\n" " qns %s\n" " qn %s\n" " kls %s\n%s", type(self).__name__, '\n'.join([' '+x for x in pprint.pformat(members).splitlines()]), qns, qn, kls, '\n'.join([' '+x for x in pprint.pformat(inspect.getmembers(kls[-1])).splitlines()])) raise RuntimeError("attempt to perform decorated handle on item not in the global namespace") from exc return kls[-1] return None
[ 1, 396, 13, 29937, 425, 17764, 29914, 6519, 29889, 2272, 13, 29937, 13, 29937, 14187, 1266, 313, 29883, 29897, 7783, 15025, 29889, 2178, 10462, 21676, 29889, 13, 29937, 10413, 21144, 1090, 278, 341, 1806, 19245, 29889, 13, 29937, 13, 12008, 13, 1888, 2037, 278, 10516, 770, 607, 17766, 732, 6519, 10200, 4097, 29889, 13, 12008, 13, 5215, 2090, 312, 8789, 13, 5215, 16096, 13, 5215, 12183, 13, 5215, 282, 2158, 13, 5215, 10876, 13, 13, 5215, 425, 17764, 29889, 4905, 13, 3166, 425, 17764, 29889, 4422, 1053, 7985, 29918, 667, 29918, 29886, 4830, 13, 13, 1990, 10516, 7295, 13, 1678, 14550, 13, 1678, 2315, 482, 10200, 4097, 363, 385, 2280, 29889, 13, 1678, 4525, 10200, 4097, 9025, 14060, 292, 8820, 1549, 13, 1678, 278, 1899, 1196, 491, 16184, 322, 10200, 1218, 278, 13, 1678, 7834, 1728, 6023, 292, 916, 2980, 13755, 29889, 13, 1678, 14550, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 3032, 26381, 353, 9657, 580, 396, 1820, 29922, 978, 995, 29922, 29918, 2001, 13, 13, 1678, 390, 2890, 1001, 29963, 3352, 29918, 5813, 29903, 353, 6702, 7387, 742, 13, 462, 418, 525, 3068, 29918, 8411, 742, 13, 462, 418, 525, 26381, 742, 13, 462, 418, 525, 8411, 742, 13, 462, 418, 525, 2158, 742, 13, 462, 268, 1723, 13, 13, 1678, 732, 6799, 13, 1678, 822, 8820, 29898, 1311, 1125, 13, 4706, 14550, 13, 4706, 3617, 357, 393, 3639, 263, 19566, 1711, 29899, 24582, 1051, 310, 13, 4706, 7834, 2983, 29889, 13, 4706, 14550, 13, 4706, 736, 12705, 29898, 1311, 3032, 26381, 29889, 8149, 3101, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 903, 978, 29918, 3084, 29898, 25932, 29892, 1024, 1125, 13, 4706, 14550, 13, 4706, 7106, 3692, 1024, 338, 502, 519, 408, 263, 10200, 362, 29889, 13, 4706, 8741, 29901, 13, 9651, 1899, 353, 10516, 580, 13, 9651, 732, 6519, 3032, 5372, 29918, 9891, 13, 3986, 2193, 338, 451, 2854, 29892, 1363, 22868, 5372, 29918, 9891, 29915, 16410, 411, 22868, 4286, 13, 3986, 1334, 437, 451, 2758, 8236, 23400, 29883, 2361, 304, 4772, 14060, 292, 13, 3986, 770, 2836, 1338, 322, 304, 5948, 4772, 11423, 368, 14060, 292, 13, 3986, 470, 528, 9382, 278, 2836, 1338, 310, 445, 770, 29889, 20175, 29892, 13, 3986, 599, 970, 3519, 322, 8393, 1818, 367, 22447, 630, 13, 3986, 297, 390, 2890, 1001, 29963, 3352, 29918, 5813, 29903, 29889, 2823, 4770, 657, 5552, 1649, 580, 363, 445, 297, 3158, 29889, 13, 4706, 14550, 13, 4706, 565, 451, 338, 8758, 29898, 978, 29892, 851, 1125, 13, 9651, 736, 7700, 13, 4706, 565, 451, 1024, 29901, 13, 9651, 736, 7700, 13, 4706, 565, 1024, 29889, 27382, 2541, 877, 29918, 29374, 13, 9651, 736, 7700, 13, 4706, 565, 1024, 297, 1067, 29879, 29889, 1525, 6304, 29963, 3352, 29918, 5813, 29903, 29901, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 4770, 657, 5552, 12035, 1311, 29892, 1024, 1125, 13, 4706, 14550, 13, 4706, 960, 1024, 338, 451, 7463, 304, 445, 770, 29892, 7539, 372, 408, 263, 10200, 1061, 29889, 13, 4706, 14550, 13, 4706, 565, 451, 1583, 3032, 978, 29918, 3084, 29898, 978, 1125, 13, 9651, 396, 2216, 263, 10200, 362, 13, 9651, 12020, 23833, 2392, 703, 29915, 29995, 29879, 29915, 1203, 756, 694, 5352, 14210, 29879, 11838, 1273, 313, 1853, 29898, 1311, 467, 1649, 978, 1649, 29892, 1024, 876, 13, 4706, 736, 2090, 312, 8789, 29889, 3846, 29898, 1311, 3032, 19557, 403, 29892, 1024, 29897, 13, 13, 1678, 822, 903, 19557, 403, 29898, 1311, 29892, 10200, 1061, 29892, 3653, 1125, 13, 4706, 14550, 13, 4706, 3826, 272, 403, 278, 4257, 3653, 29889, 10200, 1061, 338, 278, 1024, 310, 278, 13, 4706, 10200, 362, 448, 8087, 29901, 13, 9651, 1899, 353, 10516, 580, 13, 9651, 732, 6519, 29889, 12857, 13, 9651, 822, 777, 29918, 9891, 7295, 13, 4706, 16785, 903, 19557, 403, 877, 12857, 742, 525, 5372, 29918, 9891, 742, 777, 29918, 9891, 29897, 13, 4706, 14550, 13, 4706, 1596, 519, 353, 10200, 1061, 29889, 27382, 2541, 877, 2158, 519, 1495, 13, 4706, 1596, 519, 29918, 1610, 353, 10200, 1061, 29889, 1975, 2541, 877, 29918, 1610, 1495, 470, 6702, 29918, 1610, 29918, 29915, 297, 10200, 1061, 29897, 13, 4706, 4583, 353, 903, 2001, 29898, 19557, 1061, 29892, 3653, 29892, 1596, 519, 29922, 2158, 519, 29892, 1596, 519, 29918, 1610, 29922, 2158, 519, 29918, 1610, 29897, 13, 4706, 565, 451, 1583, 3032, 978, 29918, 3084, 29898, 455, 29889, 978, 1125, 13, 9651, 12020, 7865, 2392, 703, 13029, 451, 10200, 403, 773, 21676, 1024, 1273, 29878, 29908, 1273, 4583, 29889, 978, 29897, 13, 4706, 565, 4583, 29889, 978, 297, 1583, 3032, 26381, 29901, 13, 9651, 12020, 7865, 2392, 703, 20908, 5926, 1899, 1273, 29878, 29908, 1273, 4583, 29889, 978, 29897, 13, 4706, 1583, 3032, 26381, 29961, 455, 29889, 978, 29962, 353, 4583, 13, 4706, 736, 4583, 29889, 9891, 13, 13, 1678, 822, 903, 8411, 29898, 1311, 29892, 16374, 29892, 1024, 29892, 10200, 4097, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 14550, 13, 4706, 3967, 4944, 10200, 4097, 2745, 697, 338, 1476, 470, 727, 338, 3078, 2175, 304, 1018, 29889, 13, 4706, 14550, 13, 4706, 565, 338, 8758, 29898, 19557, 4097, 29892, 851, 1125, 13, 9651, 736, 1583, 3032, 8411, 29918, 650, 29898, 1867, 277, 29892, 1024, 29892, 10200, 4097, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 4706, 363, 10200, 1061, 297, 10200, 4097, 29901, 13, 9651, 3240, 353, 1583, 3032, 8411, 29918, 650, 29898, 1867, 277, 29892, 1024, 29892, 10200, 1061, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 9651, 565, 3240, 29901, 13, 18884, 736, 3240, 13, 4706, 736, 7700, 13, 13, 1678, 822, 903, 8411, 29918, 650, 29898, 1311, 29892, 16374, 29892, 1024, 29892, 10200, 1061, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 14550, 13, 4706, 512, 5744, 278, 15443, 7834, 363, 1024, 29889, 13, 4706, 960, 694, 7834, 338, 15443, 29892, 736, 7700, 29889, 13, 4706, 960, 263, 7834, 338, 15443, 29892, 736, 5852, 29889, 13, 4706, 14550, 13, 4706, 4583, 353, 1583, 3032, 26381, 29889, 657, 29898, 978, 29892, 6213, 29897, 13, 4706, 565, 451, 313, 455, 322, 4583, 29889, 19557, 1061, 1275, 10200, 1061, 1125, 13, 9651, 736, 7700, 13, 4706, 565, 6389, 29901, 13, 9651, 413, 3137, 353, 4583, 29889, 657, 1990, 580, 13, 9651, 565, 413, 3137, 29901, 13, 18884, 396, 1334, 1033, 1423, 29901, 565, 451, 338, 8758, 29898, 5085, 29961, 29900, 1402, 313, 29895, 3137, 29892, 876, 13, 18884, 396, 1244, 29889, 2193, 723, 2758, 10200, 1218, 1158, 1060, 297, 263, 770, 315, 29896, 13, 18884, 396, 322, 769, 14012, 1060, 373, 770, 315, 29906, 607, 338, 263, 19481, 310, 315, 29896, 29889, 13, 18884, 396, 450, 6030, 727, 1033, 367, 15668, 29936, 1584, 565, 315, 29906, 975, 18132, 1060, 29892, 13, 18884, 396, 315, 29896, 29889, 29990, 338, 8283, 373, 278, 1203, 29889, 1334, 2307, 5557, 337, 19557, 1218, 13, 18884, 396, 385, 23878, 1158, 1549, 278, 1024, 22369, 1423, 29892, 577, 13, 18884, 396, 1244, 591, 3763, 9250, 278, 1423, 304, 367, 3721, 278, 13, 18884, 396, 3646, 770, 3265, 1135, 14372, 1014, 13203, 29889, 13, 18884, 565, 1134, 29898, 5085, 29961, 29900, 2314, 338, 451, 413, 3137, 29901, 396, 282, 2904, 524, 29901, 11262, 29922, 348, 8819, 290, 2454, 29899, 1853, 3198, 13, 462, 1678, 736, 7700, 13, 4706, 565, 16374, 29901, 13, 9651, 3240, 353, 4583, 29889, 9891, 10456, 5085, 29892, 3579, 19290, 29897, 13, 9651, 565, 4583, 29889, 2158, 519, 29918, 1610, 29901, 13, 18884, 425, 17764, 29889, 4905, 29889, 17885, 545, 580, 13, 18884, 565, 338, 8758, 29898, 2267, 29892, 313, 1761, 29892, 731, 29892, 18761, 22164, 13, 462, 1678, 363, 921, 297, 3240, 29901, 13, 462, 4706, 565, 338, 8758, 29898, 29916, 29892, 851, 1125, 13, 462, 9651, 10876, 29889, 25393, 29889, 433, 17764, 29918, 1610, 3539, 29898, 29916, 29974, 12764, 29876, 1495, 13, 462, 4706, 1683, 29901, 13, 462, 9651, 10876, 29889, 25393, 29889, 433, 17764, 29918, 1610, 3539, 29898, 18837, 29918, 667, 29918, 29886, 4830, 29898, 29916, 29892, 10944, 2433, 1495, 29974, 12764, 29876, 1495, 13, 18884, 1683, 29901, 13, 462, 1678, 565, 338, 8758, 29898, 2267, 29892, 851, 1125, 13, 462, 4706, 10876, 29889, 25393, 29889, 433, 17764, 29918, 1610, 3539, 29898, 2267, 29974, 12764, 29876, 1495, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 10876, 29889, 25393, 29889, 433, 17764, 29918, 1610, 3539, 29898, 18837, 29918, 667, 29918, 29886, 4830, 29898, 2267, 29892, 10944, 2433, 1495, 29974, 12764, 29876, 1495, 13, 9651, 25342, 4583, 29889, 2158, 519, 29901, 13, 18884, 565, 338, 8758, 29898, 2267, 29892, 313, 1761, 29892, 731, 29892, 18761, 22164, 13, 462, 1678, 363, 921, 297, 3240, 29901, 13, 462, 4706, 565, 338, 8758, 29898, 29916, 29892, 851, 1125, 13, 462, 9651, 1596, 29898, 29916, 29897, 13, 462, 4706, 1683, 29901, 13, 462, 9651, 1596, 29898, 18837, 29918, 667, 29918, 29886, 4830, 29898, 29916, 29892, 10944, 2433, 8785, 13, 18884, 1683, 29901, 13, 462, 1678, 565, 338, 8758, 29898, 2267, 29892, 851, 1125, 13, 462, 4706, 1596, 29898, 2267, 29897, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1596, 29898, 18837, 29918, 667, 29918, 29886, 4830, 29898, 2267, 29892, 10944, 2433, 8785, 13, 4706, 736, 5852, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1596, 29898, 667, 1125, 13, 4706, 14550, 13, 4706, 1596, 580, 278, 2183, 2944, 13, 4706, 14550, 13, 4706, 565, 338, 8758, 29898, 667, 29892, 313, 1761, 29892, 731, 29892, 18761, 22164, 13, 9651, 363, 921, 297, 2944, 29901, 13, 18884, 565, 338, 8758, 29898, 29916, 29892, 851, 1125, 13, 462, 1678, 1596, 29898, 29916, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 1596, 29898, 18837, 29918, 667, 29918, 29886, 4830, 29898, 29916, 29892, 10944, 2433, 8785, 13, 4706, 1683, 29901, 13, 9651, 565, 338, 8758, 29898, 667, 29892, 851, 1125, 13, 18884, 1596, 29898, 667, 29897, 13, 9651, 1683, 29901, 13, 18884, 1596, 29898, 18837, 29918, 667, 29918, 29886, 4830, 29898, 667, 29892, 10944, 2433, 8785, 13, 13, 1678, 822, 4386, 29898, 1311, 29892, 1024, 29892, 10200, 4097, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 14550, 13, 4706, 512, 5744, 278, 15443, 7834, 363, 1024, 29889, 13, 4706, 10200, 4097, 1122, 367, 263, 2323, 1347, 470, 1554, 4256, 519, 29889, 13, 4706, 960, 694, 7834, 338, 15443, 29892, 736, 7700, 29889, 13, 4706, 960, 263, 7834, 338, 15443, 29892, 736, 5852, 29889, 13, 4706, 960, 901, 1135, 697, 10200, 1061, 338, 4944, 29892, 10200, 4097, 526, 1898, 13, 4706, 297, 393, 1797, 2745, 263, 1993, 338, 1476, 29889, 319, 736, 13, 4706, 310, 7700, 14088, 694, 1993, 29889, 13, 4706, 14550, 13, 4706, 736, 1583, 3032, 8411, 29898, 5574, 29892, 1024, 29892, 10200, 4097, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 822, 508, 29918, 8411, 29898, 1311, 29892, 1024, 29892, 10200, 4097, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 14550, 13, 4706, 8502, 4386, 29892, 541, 871, 3639, 3692, 278, 3158, 723, 367, 16459, 29889, 13, 4706, 14550, 13, 4706, 736, 1583, 3032, 8411, 29898, 8824, 29892, 1024, 29892, 10200, 4097, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 822, 8260, 29898, 1311, 29892, 10200, 4097, 29922, 8516, 1125, 13, 4706, 14550, 13, 4706, 7106, 263, 9657, 310, 1024, 29901, 9891, 11000, 29889, 960, 10200, 4097, 338, 6213, 29892, 13, 4706, 3639, 4129, 29889, 960, 10200, 4097, 338, 263, 1347, 29892, 3639, 13, 4706, 871, 1906, 4452, 10200, 630, 411, 393, 1347, 29889, 13466, 29892, 13, 4706, 3639, 4452, 5069, 10200, 4097, 526, 297, 278, 2183, 10200, 4097, 13, 4706, 313, 465, 9351, 1554, 763, 1051, 29892, 731, 29892, 18761, 29892, 2992, 467, 13, 4706, 14550, 13, 4706, 3240, 353, 9657, 580, 13, 4706, 363, 1024, 29892, 4583, 297, 1583, 3032, 26381, 29889, 7076, 7295, 13, 9651, 565, 10200, 4097, 338, 6213, 29901, 13, 18884, 1209, 13, 9651, 25342, 338, 8758, 29898, 19557, 4097, 29892, 851, 1125, 13, 18884, 565, 4583, 29889, 19557, 1061, 2804, 10200, 4097, 29901, 13, 462, 1678, 6773, 13, 9651, 1683, 29901, 13, 18884, 565, 4583, 29889, 19557, 1061, 451, 297, 10200, 4097, 29901, 13, 462, 1678, 6773, 13, 9651, 3240, 29961, 978, 29962, 353, 4583, 29889, 9891, 13, 4706, 736, 3240, 13, 13, 1678, 822, 2944, 7692, 2395, 29898, 1311, 1125, 13, 4706, 14550, 13, 4706, 7106, 263, 9657, 310, 2944, 29918, 978, 584, 3653, 13, 4706, 14550, 13, 4706, 736, 426, 455, 29889, 19557, 1061, 584, 4583, 29889, 9891, 363, 4583, 297, 1583, 3032, 26381, 29889, 5975, 28296, 13, 13, 1990, 903, 2001, 7295, 13, 1678, 14550, 13, 1678, 319, 2323, 10200, 630, 1246, 8745, 491, 10516, 13, 1678, 14550, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 10200, 1061, 29892, 3653, 29892, 1596, 519, 29922, 8824, 29892, 1596, 519, 29918, 1610, 29922, 8824, 1125, 13, 4706, 1583, 29889, 19557, 1061, 353, 10200, 1061, 13, 4706, 1583, 29889, 9891, 353, 3653, 13, 4706, 1583, 29889, 2158, 519, 353, 1596, 519, 13, 4706, 1583, 29889, 2158, 519, 29918, 1610, 353, 1596, 519, 29918, 1610, 13, 4706, 1583, 29889, 978, 353, 1583, 29889, 9891, 17255, 978, 1649, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 13, 4706, 736, 11860, 29879, 29414, 29878, 29892, 1273, 29878, 29892, 1596, 519, 16328, 29878, 29892, 1596, 519, 29918, 1610, 16328, 29878, 5513, 1273, 313, 1853, 29898, 1311, 467, 1649, 978, 1649, 29892, 1583, 29889, 19557, 1061, 29892, 1583, 29889, 9891, 29892, 1583, 29889, 2158, 519, 29892, 1583, 29889, 2158, 519, 29918, 1610, 29897, 13, 13, 1678, 21681, 29918, 5813, 5550, 11538, 353, 7700, 13, 13, 1678, 822, 679, 1990, 29898, 1311, 1125, 13, 4706, 14550, 13, 4706, 7106, 278, 770, 310, 278, 10200, 630, 3653, 29889, 16969, 6213, 565, 13, 4706, 445, 338, 263, 2246, 29899, 5563, 740, 29889, 13, 4706, 14550, 13, 4706, 413, 3137, 353, 6213, 13, 4706, 5144, 353, 16096, 29889, 657, 28109, 29898, 1311, 29889, 9891, 29897, 13, 4706, 330, 353, 9657, 580, 396, 5534, 7397, 297, 607, 1583, 29889, 9891, 471, 3342, 13, 4706, 363, 286, 297, 5144, 29901, 13, 9651, 565, 286, 29961, 29900, 29962, 1275, 525, 1649, 23705, 1338, 1649, 2396, 13, 18884, 330, 353, 286, 29961, 29896, 29962, 13, 18884, 2867, 13, 4706, 3855, 1983, 353, 1583, 29889, 9891, 17255, 15380, 978, 26914, 5451, 12839, 1495, 13, 4706, 565, 7431, 29898, 29939, 1983, 29897, 1405, 29871, 29896, 29901, 13, 9651, 413, 3137, 353, 518, 29887, 29961, 29939, 1983, 29961, 29900, 5262, 29962, 396, 671, 263, 1051, 363, 13490, 13, 9651, 565, 451, 338, 8758, 29898, 29895, 3137, 29961, 29900, 1402, 313, 1853, 29892, 22164, 13, 18884, 12020, 24875, 2392, 703, 1131, 3456, 304, 2189, 10200, 630, 4386, 373, 2944, 451, 297, 278, 5534, 7397, 1159, 13, 9651, 363, 3855, 29876, 297, 3855, 1983, 29961, 29896, 13018, 29896, 5387, 13, 18884, 1018, 29901, 13, 462, 1678, 413, 3137, 29889, 4397, 29898, 657, 5552, 29898, 29895, 3137, 14352, 29896, 1402, 3855, 29876, 876, 13, 462, 1678, 565, 451, 338, 8758, 29898, 29895, 3137, 14352, 29896, 1402, 313, 1853, 29892, 22164, 13, 462, 4706, 12020, 24875, 2392, 703, 1131, 3456, 304, 2189, 10200, 630, 4386, 373, 2944, 451, 297, 278, 5534, 7397, 1159, 13, 18884, 5174, 23833, 2392, 408, 5566, 29901, 13, 462, 1678, 565, 1583, 29889, 18525, 29918, 5813, 5550, 11538, 29901, 13, 462, 4706, 12183, 29889, 16121, 3991, 29898, 4830, 543, 29995, 29898, 4906, 29897, 29879, 613, 4840, 29922, 9675, 29889, 303, 20405, 29897, 13, 462, 4706, 17927, 353, 12183, 29889, 657, 16363, 580, 13, 462, 4706, 17927, 29889, 2704, 703, 11432, 29901, 1273, 29879, 29889, 657, 1990, 29905, 29876, 29908, 13, 462, 462, 268, 376, 5144, 29905, 29876, 29995, 29879, 29905, 29876, 29908, 13, 462, 462, 268, 376, 3855, 1983, 1273, 29879, 29905, 29876, 29908, 13, 462, 462, 268, 376, 3855, 29876, 1273, 29879, 29905, 29876, 29908, 13, 462, 462, 268, 376, 413, 3137, 1273, 29879, 29905, 29876, 29995, 29879, 613, 13, 462, 462, 268, 1134, 29898, 1311, 467, 1649, 978, 1649, 29892, 13, 462, 462, 268, 11297, 29876, 4286, 7122, 18959, 259, 525, 29974, 29916, 363, 921, 297, 282, 2158, 29889, 29886, 4830, 29898, 28109, 467, 5451, 9012, 580, 11724, 13, 462, 462, 268, 3855, 1983, 29892, 13, 462, 462, 268, 3855, 29876, 29892, 13, 462, 462, 268, 413, 3137, 29892, 11297, 29876, 4286, 7122, 18959, 259, 525, 29974, 29916, 363, 921, 297, 282, 2158, 29889, 29886, 4830, 29898, 1144, 1103, 29889, 657, 28109, 29898, 29895, 3137, 14352, 29896, 2314, 467, 5451, 9012, 580, 12622, 13, 462, 1678, 12020, 24875, 2392, 703, 1131, 3456, 304, 2189, 10200, 630, 4386, 373, 2944, 451, 297, 278, 5534, 7397, 1159, 515, 5566, 13, 9651, 736, 413, 3137, 14352, 29896, 29962, 13, 4706, 736, 6213, 13, 2 ]
2021/solutions/d8.py
phenom4n4n/advent-of-code-21
1
185938
from typing import Dict, List, FrozenSet from utils import run len_to_num = { 2: 1, 4: 4, 3: 7, 7: 8, } Key = Dict[FrozenSet[str], int] @run("\n") def part1(data: List[str]) -> int: total = 0 for line in data: _, o = line.split(" | ", 2) for n in o.split(): if len_to_num.get(len(n)): total += 1 return total def decode_line(line: str) -> Key: i, _ = line.split(" | ", 2) key = {} reverse_key = {} for sig in i.split(): if n := len_to_num.get(len(sig)): frozen = frozenset(sig) key[frozen] = n reverse_key[n] = frozen for sig in i.split(): frozen = frozenset(sig) if frozen in key: continue if len(sig) == 5: if frozen.issuperset(reverse_key[1]): key[frozen] = 3 elif len(frozen.intersection(reverse_key[4])) == 3: key[frozen] = 5 else: key[frozen] = 2 elif len(sig) == 6: if frozen.issuperset(reverse_key[4]): key[frozen] = 9 elif frozen.issuperset(reverse_key[1]): key[frozen] = 0 else: key[frozen] = 6 return key @run("\n") def part2(data: List[str]) -> int: total = [] for line in data: key = decode_line(line) _, o = line.split(" | ", 2) nums = [] for sig in o.split(): num = str(key.get(frozenset(sig))) nums.append(num) final = int("".join(nums)) total.append(final) return sum(total)
[ 1, 515, 19229, 1053, 360, 919, 29892, 2391, 29892, 25022, 2256, 2697, 13, 13, 3166, 3667, 29879, 1053, 1065, 13, 13, 2435, 29918, 517, 29918, 1949, 353, 426, 13, 268, 29906, 29901, 29871, 29896, 29892, 13, 268, 29946, 29901, 29871, 29946, 29892, 13, 268, 29941, 29901, 29871, 29955, 29892, 13, 268, 29955, 29901, 29871, 29947, 29892, 13, 29913, 13, 2558, 353, 360, 919, 29961, 29943, 307, 2256, 2697, 29961, 710, 1402, 938, 29962, 13, 13, 13, 29992, 3389, 14182, 29876, 1159, 13, 1753, 760, 29896, 29898, 1272, 29901, 2391, 29961, 710, 2314, 1599, 938, 29901, 13, 1678, 3001, 353, 29871, 29900, 13, 1678, 363, 1196, 297, 848, 29901, 13, 4706, 17117, 288, 353, 1196, 29889, 5451, 703, 891, 9162, 29871, 29906, 29897, 13, 4706, 363, 302, 297, 288, 29889, 5451, 7295, 13, 9651, 565, 7431, 29918, 517, 29918, 1949, 29889, 657, 29898, 2435, 29898, 29876, 22164, 13, 18884, 3001, 4619, 29871, 29896, 13, 1678, 736, 3001, 13, 13, 13, 1753, 21822, 29918, 1220, 29898, 1220, 29901, 851, 29897, 1599, 7670, 29901, 13, 1678, 474, 29892, 903, 353, 1196, 29889, 5451, 703, 891, 9162, 29871, 29906, 29897, 13, 1678, 1820, 353, 6571, 13, 1678, 11837, 29918, 1989, 353, 6571, 13, 13, 1678, 363, 4365, 297, 474, 29889, 5451, 7295, 13, 4706, 565, 302, 3490, 7431, 29918, 517, 29918, 1949, 29889, 657, 29898, 2435, 29898, 18816, 22164, 13, 9651, 14671, 2256, 353, 14671, 29920, 575, 300, 29898, 18816, 29897, 13, 9651, 1820, 29961, 29888, 307, 2256, 29962, 353, 302, 13, 9651, 11837, 29918, 1989, 29961, 29876, 29962, 353, 14671, 2256, 13, 13, 1678, 363, 4365, 297, 474, 29889, 5451, 7295, 13, 4706, 14671, 2256, 353, 14671, 29920, 575, 300, 29898, 18816, 29897, 13, 4706, 565, 14671, 2256, 297, 1820, 29901, 13, 9651, 6773, 13, 4706, 565, 7431, 29898, 18816, 29897, 1275, 29871, 29945, 29901, 13, 9651, 565, 14671, 2256, 29889, 790, 786, 24197, 29898, 24244, 29918, 1989, 29961, 29896, 29962, 1125, 13, 18884, 1820, 29961, 29888, 307, 2256, 29962, 353, 29871, 29941, 13, 9651, 25342, 7431, 29898, 29888, 307, 2256, 29889, 1639, 2042, 29898, 24244, 29918, 1989, 29961, 29946, 12622, 1275, 29871, 29941, 29901, 13, 18884, 1820, 29961, 29888, 307, 2256, 29962, 353, 29871, 29945, 13, 9651, 1683, 29901, 13, 18884, 1820, 29961, 29888, 307, 2256, 29962, 353, 29871, 29906, 13, 4706, 25342, 7431, 29898, 18816, 29897, 1275, 29871, 29953, 29901, 13, 9651, 565, 14671, 2256, 29889, 790, 786, 24197, 29898, 24244, 29918, 1989, 29961, 29946, 29962, 1125, 13, 18884, 1820, 29961, 29888, 307, 2256, 29962, 353, 29871, 29929, 13, 9651, 25342, 14671, 2256, 29889, 790, 786, 24197, 29898, 24244, 29918, 1989, 29961, 29896, 29962, 1125, 13, 18884, 1820, 29961, 29888, 307, 2256, 29962, 353, 29871, 29900, 13, 9651, 1683, 29901, 13, 18884, 1820, 29961, 29888, 307, 2256, 29962, 353, 29871, 29953, 13, 1678, 736, 1820, 13, 13, 13, 29992, 3389, 14182, 29876, 1159, 13, 1753, 760, 29906, 29898, 1272, 29901, 2391, 29961, 710, 2314, 1599, 938, 29901, 13, 1678, 3001, 353, 5159, 13, 1678, 363, 1196, 297, 848, 29901, 13, 4706, 1820, 353, 21822, 29918, 1220, 29898, 1220, 29897, 13, 4706, 17117, 288, 353, 1196, 29889, 5451, 703, 891, 9162, 29871, 29906, 29897, 13, 4706, 954, 29879, 353, 5159, 13, 4706, 363, 4365, 297, 288, 29889, 5451, 7295, 13, 9651, 954, 353, 851, 29898, 1989, 29889, 657, 29898, 29888, 16997, 575, 300, 29898, 18816, 4961, 13, 9651, 954, 29879, 29889, 4397, 29898, 1949, 29897, 13, 4706, 2186, 353, 938, 703, 1642, 7122, 29898, 1949, 29879, 876, 13, 4706, 3001, 29889, 4397, 29898, 8394, 29897, 13, 1678, 736, 2533, 29898, 7827, 29897, 13, 2 ]
stubs.min/System/Windows/Interop_parts/HwndSourceParameters.py
ricardyn/ironpython-stubs
1
154570
class HwndSourceParameters(object): """ Contains the parameters that are used to create an System.Windows.Interop.HwndSource object using the System.Windows.Interop.HwndSource.#ctor(System.Windows.Interop.HwndSourceParameters) constructor. HwndSourceParameters(name: str) HwndSourceParameters(name: str,width: int,height: int) """ def Equals(self,obj): """ Equals(self: HwndSourceParameters,obj: HwndSourceParameters) -> bool Determines whether this structure is equal to a specified System.Windows.Interop.HwndSourceParameters structure. obj: The structure to be tested for equality. Returns: true if the structures are equal; otherwise,false. Equals(self: HwndSourceParameters,obj: object) -> bool Determines whether this structure is equal to a specified object. obj: The objects to be tested for equality. Returns: true if the comparison is equal; otherwise,false. """ pass def GetHashCode(self): """ GetHashCode(self: HwndSourceParameters) -> int Returns the hash code for this System.Windows.Interop.HwndSourceParameters instance. Returns: A 32-bit signed integer hash code. """ pass def SetPosition(self,x,y): """ SetPosition(self: HwndSourceParameters,x: int,y: int) Sets the values that are used for the screen position of the window for the System.Windows.Interop.HwndSource. x: The position of the left edge of the window. y: The position of the upper edge of the window. """ pass def SetSize(self,width,height): """ SetSize(self: HwndSourceParameters,width: int,height: int) Sets the values that are used for the window size of the System.Windows.Interop.HwndSource. width: The width of the window,in device pixels. height: The height of the window,in device pixels. """ pass def __eq__(self,*args): """ x.__eq__(y) <==> x==y """ pass @staticmethod def __new__(self,name,width=None,height=None): """ __new__[HwndSourceParameters]() -> HwndSourceParameters __new__(cls: type,name: str) __new__(cls: type,name: str,width: int,height: int) """ pass def __ne__(self,*args): pass AcquireHwndFocusInMenuMode=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the value that determines whether to acquire Win32 focus for the WPF containing window when an System.Windows.Interop.HwndSource is created. Get: AcquireHwndFocusInMenuMode(self: HwndSourceParameters) -> bool Set: AcquireHwndFocusInMenuMode(self: HwndSourceParameters)=value """ AdjustSizingForNonClientArea=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets a value that indicates whether to include the nonclient area for sizing. Get: AdjustSizingForNonClientArea(self: HwndSourceParameters) -> bool Set: AdjustSizingForNonClientArea(self: HwndSourceParameters)=value """ ExtendedWindowStyle=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the extended Microsoft Windows styles for the window. Get: ExtendedWindowStyle(self: HwndSourceParameters) -> int Set: ExtendedWindowStyle(self: HwndSourceParameters)=value """ HasAssignedSize=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets a value that indicates whether a size was assigned. Get: HasAssignedSize(self: HwndSourceParameters) -> bool """ Height=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets a value that indicates the height of the window. Get: Height(self: HwndSourceParameters) -> int Set: Height(self: HwndSourceParameters)=value """ HwndSourceHook=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the message hook for the window. Get: HwndSourceHook(self: HwndSourceParameters) -> HwndSourceHook Set: HwndSourceHook(self: HwndSourceParameters)=value """ ParentWindow=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the window handle (HWND) of the parent for the created window. Get: ParentWindow(self: HwndSourceParameters) -> IntPtr Set: ParentWindow(self: HwndSourceParameters)=value """ PositionX=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the left-edge position of the window. Get: PositionX(self: HwndSourceParameters) -> int Set: PositionX(self: HwndSourceParameters)=value """ PositionY=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the upper-edge position of the window. Get: PositionY(self: HwndSourceParameters) -> int Set: PositionY(self: HwndSourceParameters)=value """ RestoreFocusMode=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets how WPF handles restoring focus to the window. Get: RestoreFocusMode(self: HwndSourceParameters) -> RestoreFocusMode Set: RestoreFocusMode(self: HwndSourceParameters)=value """ TreatAncestorsAsNonClientArea=property(lambda self: object(),lambda self,v: None,lambda self: None) """Get: TreatAncestorsAsNonClientArea(self: HwndSourceParameters) -> bool Set: TreatAncestorsAsNonClientArea(self: HwndSourceParameters)=value """ TreatAsInputRoot=property(lambda self: object(),lambda self,v: None,lambda self: None) """Get: TreatAsInputRoot(self: HwndSourceParameters) -> bool Set: TreatAsInputRoot(self: HwndSourceParameters)=value """ UsesPerPixelOpacity=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets a value that declares whether the per-pixel opacity of the source window content is respected. Get: UsesPerPixelOpacity(self: HwndSourceParameters) -> bool Set: UsesPerPixelOpacity(self: HwndSourceParameters)=value """ UsesPerPixelTransparency=property(lambda self: object(),lambda self,v: None,lambda self: None) """Get: UsesPerPixelTransparency(self: HwndSourceParameters) -> bool Set: UsesPerPixelTransparency(self: HwndSourceParameters)=value """ Width=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets a value that indicates the width of the window. Get: Width(self: HwndSourceParameters) -> int Set: Width(self: HwndSourceParameters)=value """ WindowClassStyle=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the Microsoft Windows class style for the window. Get: WindowClassStyle(self: HwndSourceParameters) -> int Set: WindowClassStyle(self: HwndSourceParameters)=value """ WindowName=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the name of the window. Get: WindowName(self: HwndSourceParameters) -> str Set: WindowName(self: HwndSourceParameters)=value """ WindowStyle=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the style for the window. Get: WindowStyle(self: HwndSourceParameters) -> int Set: WindowStyle(self: HwndSourceParameters)=value """
[ 1, 770, 379, 29893, 299, 4435, 11507, 29898, 3318, 1125, 30004, 13, 9995, 30004, 13, 2866, 2708, 278, 4128, 393, 526, 1304, 304, 1653, 385, 2184, 29889, 7685, 29889, 4074, 459, 29889, 29950, 29893, 299, 4435, 1203, 773, 278, 2184, 29889, 7685, 29889, 4074, 459, 29889, 29950, 29893, 299, 4435, 29889, 29937, 2801, 29898, 3924, 29889, 7685, 29889, 4074, 459, 29889, 29950, 29893, 299, 4435, 11507, 29897, 5823, 22993, 30004, 13, 6756, 30004, 13, 379, 29893, 299, 4435, 11507, 29898, 978, 29901, 851, 8443, 30004, 13, 379, 29893, 299, 4435, 11507, 29898, 978, 29901, 851, 29892, 2103, 29901, 938, 29892, 3545, 29901, 938, 8443, 13, 9995, 30004, 13, 822, 11243, 1338, 29898, 1311, 29892, 5415, 1125, 30004, 13, 29871, 9995, 30004, 13, 29871, 11243, 1338, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29892, 5415, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 6120, 30004, 30004, 13, 29871, 6756, 30004, 13, 259, 5953, 837, 1475, 3692, 445, 3829, 338, 5186, 304, 263, 6790, 6756, 30004, 13, 1678, 2184, 29889, 7685, 29889, 4074, 459, 29889, 29950, 29893, 299, 4435, 11507, 3829, 22993, 30004, 13, 29871, 6756, 30004, 13, 29871, 6756, 30004, 13, 259, 5446, 29901, 450, 3829, 304, 367, 9528, 363, 17193, 22993, 30004, 13, 259, 16969, 29901, 1565, 565, 278, 12286, 526, 5186, 29936, 6467, 29892, 4541, 22993, 30004, 13, 29871, 11243, 1338, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29892, 5415, 29901, 1203, 29897, 1599, 6120, 30004, 30004, 13, 29871, 6756, 30004, 13, 259, 5953, 837, 1475, 3692, 445, 3829, 338, 5186, 304, 263, 6790, 1203, 22993, 30004, 13, 29871, 6756, 30004, 13, 259, 5446, 29901, 450, 3618, 304, 367, 9528, 363, 17193, 22993, 30004, 13, 259, 16969, 29901, 1565, 565, 278, 10230, 338, 5186, 29936, 6467, 29892, 4541, 22993, 13, 29871, 9995, 30004, 13, 29871, 1209, 30004, 13, 822, 3617, 10438, 3399, 29898, 1311, 1125, 30004, 13, 29871, 9995, 30004, 13, 29871, 3617, 10438, 3399, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 938, 30004, 30004, 13, 29871, 6756, 30004, 13, 259, 16969, 278, 6608, 775, 363, 445, 2184, 29889, 7685, 29889, 4074, 459, 29889, 29950, 29893, 299, 4435, 11507, 6756, 30004, 13, 1678, 2777, 22993, 30004, 13, 29871, 6756, 30004, 13, 259, 16969, 29901, 319, 29871, 29941, 29906, 29899, 2966, 8794, 6043, 6608, 775, 22993, 13, 29871, 9995, 30004, 13, 29871, 1209, 30004, 13, 822, 3789, 8003, 29898, 1311, 29892, 29916, 29892, 29891, 1125, 30004, 13, 29871, 9995, 30004, 13, 29871, 3789, 8003, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29892, 29916, 29901, 938, 29892, 29891, 29901, 938, 8443, 30004, 13, 259, 317, 1691, 278, 1819, 393, 526, 1304, 363, 278, 4315, 2602, 310, 278, 3474, 363, 278, 6756, 30004, 13, 1678, 2184, 29889, 7685, 29889, 4074, 459, 29889, 29950, 29893, 299, 4435, 22993, 30004, 13, 29871, 6756, 30004, 13, 29871, 6756, 30004, 13, 259, 921, 29901, 450, 2602, 310, 278, 2175, 7636, 310, 278, 3474, 22993, 30004, 13, 259, 343, 29901, 450, 2602, 310, 278, 7568, 7636, 310, 278, 3474, 22993, 13, 29871, 9995, 30004, 13, 29871, 1209, 30004, 13, 822, 3789, 3505, 29898, 1311, 29892, 2103, 29892, 3545, 1125, 30004, 13, 29871, 9995, 30004, 13, 29871, 3789, 3505, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29892, 2103, 29901, 938, 29892, 3545, 29901, 938, 8443, 30004, 13, 259, 317, 1691, 278, 1819, 393, 526, 1304, 363, 278, 3474, 2159, 310, 278, 6756, 30004, 13, 1678, 2184, 29889, 7685, 29889, 4074, 459, 29889, 29950, 29893, 299, 4435, 22993, 30004, 13, 29871, 6756, 30004, 13, 29871, 6756, 30004, 13, 259, 2920, 29901, 450, 2920, 310, 278, 3474, 29892, 262, 4742, 17036, 22993, 30004, 13, 259, 3171, 29901, 450, 3171, 310, 278, 3474, 29892, 262, 4742, 17036, 22993, 13, 29871, 9995, 30004, 13, 29871, 1209, 30004, 13, 822, 4770, 1837, 12035, 1311, 29892, 29930, 5085, 1125, 30004, 13, 29871, 9995, 921, 17255, 1837, 12035, 29891, 29897, 529, 1360, 29958, 921, 1360, 29891, 9995, 30004, 13, 29871, 1209, 30004, 13, 732, 7959, 5696, 30004, 13, 822, 4770, 1482, 12035, 1311, 29892, 978, 29892, 2103, 29922, 8516, 29892, 3545, 29922, 8516, 1125, 30004, 13, 29871, 9995, 30004, 13, 29871, 4770, 1482, 1649, 29961, 29950, 29893, 299, 4435, 11507, 29962, 580, 1599, 379, 29893, 299, 4435, 11507, 30004, 30004, 13, 29871, 6756, 30004, 13, 29871, 4770, 1482, 12035, 25932, 29901, 1134, 29892, 978, 29901, 851, 8443, 30004, 13, 29871, 4770, 1482, 12035, 25932, 29901, 1134, 29892, 978, 29901, 851, 29892, 2103, 29901, 938, 29892, 3545, 29901, 938, 8443, 13, 29871, 9995, 30004, 13, 29871, 1209, 30004, 13, 822, 4770, 484, 12035, 1311, 29892, 29930, 5085, 1125, 30004, 13, 29871, 1209, 30004, 13, 7255, 1548, 29950, 29893, 299, 20560, 797, 6823, 6818, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 995, 393, 3683, 1475, 3692, 304, 1274, 1548, 8892, 29941, 29906, 8569, 363, 278, 23678, 6943, 3474, 746, 385, 2184, 29889, 7685, 29889, 4074, 459, 29889, 29950, 29893, 299, 4435, 338, 2825, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 7255, 1548, 29950, 29893, 299, 20560, 797, 6823, 6818, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 6120, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 7255, 1548, 29950, 29893, 299, 20560, 797, 6823, 6818, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 2087, 5143, 29903, 5281, 2831, 12283, 4032, 13799, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 263, 995, 393, 14088, 3692, 304, 3160, 278, 1661, 4645, 4038, 363, 269, 5281, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 2087, 5143, 29903, 5281, 2831, 12283, 4032, 13799, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 6120, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 2087, 5143, 29903, 5281, 2831, 12283, 4032, 13799, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 7338, 2760, 5907, 5568, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 10410, 7783, 3852, 11949, 363, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 7338, 2760, 5907, 5568, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 938, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 7338, 2760, 5907, 5568, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 11699, 7900, 12961, 3505, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 263, 995, 393, 14088, 3692, 263, 2159, 471, 9859, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 11699, 7900, 12961, 3505, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 6120, 30004, 30004, 13, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 22907, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 263, 995, 393, 14088, 278, 3171, 310, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 22907, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 938, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 22907, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 379, 29893, 299, 4435, 29950, 2550, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 2643, 12422, 363, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 379, 29893, 299, 4435, 29950, 2550, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 379, 29893, 299, 4435, 29950, 2550, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 379, 29893, 299, 4435, 29950, 2550, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 22280, 5907, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 3474, 4386, 313, 29950, 29956, 2797, 29897, 310, 278, 3847, 363, 278, 2825, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 22280, 5907, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 3159, 12058, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 22280, 5907, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 20627, 29990, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 2175, 29899, 12864, 2602, 310, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 20627, 29990, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 938, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 20627, 29990, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 20627, 29979, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 7568, 29899, 12864, 2602, 310, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 20627, 29979, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 938, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 20627, 29979, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 11654, 487, 20560, 6818, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 920, 23678, 17766, 1791, 8253, 8569, 304, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 11654, 487, 20560, 6818, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 11654, 487, 20560, 6818, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 11654, 487, 20560, 6818, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 6479, 271, 2744, 29883, 342, 943, 2887, 12283, 4032, 13799, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 2577, 29901, 6479, 271, 2744, 29883, 342, 943, 2887, 12283, 4032, 13799, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 6120, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 6479, 271, 2744, 29883, 342, 943, 2887, 12283, 4032, 13799, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 6479, 271, 2887, 4290, 10303, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 2577, 29901, 6479, 271, 2887, 4290, 10303, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 6120, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 6479, 271, 2887, 4290, 10303, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 10783, 267, 5894, 29637, 11746, 5946, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 263, 995, 393, 4845, 5114, 3692, 278, 639, 29899, 29886, 15711, 17012, 310, 278, 2752, 3474, 2793, 338, 3390, 287, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 10783, 267, 5894, 29637, 11746, 5946, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 6120, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 10783, 267, 5894, 29637, 11746, 5946, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 10783, 267, 5894, 29637, 4300, 862, 3819, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 2577, 29901, 10783, 267, 5894, 29637, 4300, 862, 3819, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 6120, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 10783, 267, 5894, 29637, 4300, 862, 3819, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 21485, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 263, 995, 393, 14088, 278, 2920, 310, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 21485, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 938, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 21485, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 18379, 2385, 5568, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 7783, 3852, 770, 3114, 363, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 18379, 2385, 5568, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 938, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 18379, 2385, 5568, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 18379, 1170, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 1024, 310, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 18379, 1170, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 851, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 18379, 1170, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 18379, 5568, 29922, 6799, 29898, 2892, 1583, 29901, 1203, 3285, 2892, 1583, 29892, 29894, 29901, 6213, 29892, 2892, 1583, 29901, 6213, 8443, 13, 9995, 29954, 1691, 470, 6166, 278, 3114, 363, 278, 3474, 22993, 30004, 13, 30004, 30004, 13, 2577, 29901, 18379, 5568, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 29897, 1599, 938, 30004, 30004, 13, 30004, 30004, 13, 2697, 29901, 18379, 5568, 29898, 1311, 29901, 379, 29893, 299, 4435, 11507, 3892, 1767, 30004, 30004, 13, 15945, 19451, 13, 30004, 13, 30004, 13, 2 ]
kinematics/Trajectory.py
lovelykite/COSRA
0
88539
import numpy as np class Trajectory: def __init__(self): pass @classmethod def LSPB(cls, q0, qf, tf, tb, t_step=0.07): q0 = np.array(q0) qf = np.array(qf) if np.allclose(q0, qf): t = [0.0] q_pos = [qf] return q_pos, t # Define coefficients ab = (q0 - qf) / (tb - tf) / tb A = np.array([[tb, -tb, 0.0, 1.0, -1.0, 0.0], [0.0, -(tf - tb), tf - tb, 0.0, -1.0, 1.0], [1.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0, 0.0, 0.0], [0.0, 0.0, tf, 0.0, 0.0, 1.0]]) b = np.block([[-ab * tb ** 2 / 2], [ab * (tf - tb) ** 2 / 2], [np.zeros_like(q0)], [q0], [ab * tf], [qf + ab * tf ** 2 / 2]]) coeff = np.linalg.inv(A).dot(b) C1 = coeff[0] C2 = coeff[1] C3 = coeff[2] C4 = coeff[3] C5 = coeff[4] C6 = coeff[5] # Calculate trajectories t = np.arange(start=0.0, stop=tf, step=t_step) t1 = t[t < tb].reshape(-1, 1) t2 = t[(tb <= t) & (t < tf - tb)].reshape(-1, 1) t3 = t[tf - tb <= t].reshape(-1, 1) # Combine joint trajectories traj1 = ab / 2 * t1 ** 2 + C1 * t1 + C4 traj2 = C2 * t2 + C5 traj3 = -ab / 2 * t3 ** 2 + C3 * t3 + C6 q_pos = np.concatenate((traj1, traj2, traj3)) assert ~np.isnan(t).any() assert ~np.isnan(q_pos).any() return q_pos, t if __name__ == '__main__': pass
[ 1, 1053, 12655, 408, 7442, 13, 13, 13, 1990, 3201, 622, 706, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 365, 5550, 29933, 29898, 25932, 29892, 3855, 29900, 29892, 3855, 29888, 29892, 15886, 29892, 260, 29890, 29892, 260, 29918, 10568, 29922, 29900, 29889, 29900, 29955, 1125, 13, 4706, 3855, 29900, 353, 7442, 29889, 2378, 29898, 29939, 29900, 29897, 13, 4706, 3855, 29888, 353, 7442, 29889, 2378, 29898, 29939, 29888, 29897, 13, 4706, 565, 7442, 29889, 497, 5358, 29898, 29939, 29900, 29892, 3855, 29888, 1125, 13, 9651, 260, 353, 518, 29900, 29889, 29900, 29962, 13, 9651, 3855, 29918, 1066, 353, 518, 29939, 29888, 29962, 13, 9651, 736, 3855, 29918, 1066, 29892, 260, 13, 13, 4706, 396, 22402, 16127, 13, 4706, 633, 353, 313, 29939, 29900, 448, 3855, 29888, 29897, 847, 313, 22625, 448, 15886, 29897, 847, 260, 29890, 13, 4706, 319, 353, 7442, 29889, 2378, 4197, 29961, 22625, 29892, 448, 22625, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 13, 462, 418, 518, 29900, 29889, 29900, 29892, 19691, 13264, 448, 260, 29890, 511, 15886, 448, 260, 29890, 29892, 29871, 29900, 29889, 29900, 29892, 448, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 1402, 13, 462, 418, 518, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 13, 462, 418, 518, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 13, 462, 418, 518, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 1402, 13, 462, 418, 518, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 15886, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 24960, 13, 4706, 289, 353, 7442, 29889, 1271, 4197, 14352, 370, 334, 260, 29890, 3579, 29871, 29906, 847, 29871, 29906, 1402, 518, 370, 334, 313, 13264, 448, 260, 29890, 29897, 3579, 29871, 29906, 847, 29871, 29906, 1402, 518, 9302, 29889, 3298, 359, 29918, 4561, 29898, 29939, 29900, 29897, 1402, 518, 29939, 29900, 1402, 518, 370, 334, 15886, 1402, 13, 462, 418, 518, 29939, 29888, 718, 633, 334, 15886, 3579, 29871, 29906, 847, 29871, 29906, 24960, 13, 4706, 1302, 12352, 353, 7442, 29889, 29880, 979, 29887, 29889, 11569, 29898, 29909, 467, 6333, 29898, 29890, 29897, 13, 4706, 315, 29896, 353, 1302, 12352, 29961, 29900, 29962, 13, 4706, 315, 29906, 353, 1302, 12352, 29961, 29896, 29962, 13, 4706, 315, 29941, 353, 1302, 12352, 29961, 29906, 29962, 13, 4706, 315, 29946, 353, 1302, 12352, 29961, 29941, 29962, 13, 4706, 315, 29945, 353, 1302, 12352, 29961, 29946, 29962, 13, 4706, 315, 29953, 353, 1302, 12352, 29961, 29945, 29962, 13, 13, 4706, 396, 20535, 403, 23324, 3842, 13, 4706, 260, 353, 7442, 29889, 279, 927, 29898, 2962, 29922, 29900, 29889, 29900, 29892, 5040, 29922, 13264, 29892, 4331, 29922, 29873, 29918, 10568, 29897, 13, 4706, 260, 29896, 353, 260, 29961, 29873, 529, 260, 29890, 1822, 690, 14443, 6278, 29896, 29892, 29871, 29896, 29897, 13, 4706, 260, 29906, 353, 260, 15625, 22625, 5277, 260, 29897, 669, 313, 29873, 529, 15886, 448, 260, 29890, 29897, 1822, 690, 14443, 6278, 29896, 29892, 29871, 29896, 29897, 13, 4706, 260, 29941, 353, 260, 29961, 13264, 448, 260, 29890, 5277, 260, 1822, 690, 14443, 6278, 29896, 29892, 29871, 29896, 29897, 13, 13, 4706, 396, 422, 26062, 14002, 23324, 3842, 13, 4706, 1020, 29926, 29896, 353, 633, 847, 29871, 29906, 334, 260, 29896, 3579, 29871, 29906, 718, 315, 29896, 334, 260, 29896, 718, 315, 29946, 13, 4706, 1020, 29926, 29906, 353, 315, 29906, 334, 260, 29906, 718, 315, 29945, 13, 4706, 1020, 29926, 29941, 353, 448, 370, 847, 29871, 29906, 334, 260, 29941, 3579, 29871, 29906, 718, 315, 29941, 334, 260, 29941, 718, 315, 29953, 13, 4706, 3855, 29918, 1066, 353, 7442, 29889, 535, 29883, 2579, 403, 3552, 3018, 29926, 29896, 29892, 1020, 29926, 29906, 29892, 1020, 29926, 29941, 876, 13, 4706, 4974, 3695, 9302, 29889, 275, 13707, 29898, 29873, 467, 1384, 580, 13, 4706, 4974, 3695, 9302, 29889, 275, 13707, 29898, 29939, 29918, 1066, 467, 1384, 580, 13, 4706, 736, 3855, 29918, 1066, 29892, 260, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1209, 13, 2 ]
src/kotify/fabric/__init__.py
kotify/kotify.fabric
0
134663
from ._core import Collection, local, task __all__ = ["task", "Collection", "local"]
[ 1, 515, 869, 29918, 3221, 1053, 14348, 29892, 1887, 29892, 3414, 13, 13, 1649, 497, 1649, 353, 6796, 7662, 613, 376, 7196, 613, 376, 2997, 3108, 13, 2 ]
sdk/eventhub/azure-eventhubs/azure/eventhub/eventprocessor/utils.py
gautam714/azure-sdk-for-python
0
19017
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ----------------------------------------------------------------------------------- import asyncio def get_running_loop(): try: return asyncio.get_running_loop() except AttributeError: # 3.5 / 3.6 loop = asyncio._get_running_loop() # pylint: disable=protected-access if loop is None: raise RuntimeError('No running event loop') return loop
[ 1, 396, 448, 2683, 2683, 2683, 2683, 2683, 1378, 5634, 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, 19405, 2472, 29889, 13, 29937, 448, 2683, 2683, 2683, 2683, 2683, 489, 13, 13, 5215, 408, 948, 3934, 13, 13, 13, 1753, 679, 29918, 21094, 29918, 7888, 7295, 13, 1678, 1018, 29901, 13, 4706, 736, 408, 948, 3934, 29889, 657, 29918, 21094, 29918, 7888, 580, 13, 1678, 5174, 23833, 2392, 29901, 29871, 396, 29871, 29941, 29889, 29945, 847, 29871, 29941, 29889, 29953, 13, 4706, 2425, 353, 408, 948, 3934, 3032, 657, 29918, 21094, 29918, 7888, 580, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 24681, 29899, 5943, 13, 4706, 565, 2425, 338, 6213, 29901, 13, 9651, 12020, 24875, 2392, 877, 3782, 2734, 1741, 2425, 1495, 13, 4706, 736, 2425, 13, 2 ]
cmdb/hosts/models.py
fox0014/cmdb
0
94772
<filename>cmdb/hosts/models.py # This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table # Feel free to rename the models, but don't rename db_table values or field names. from django.db import models class Asset(models.Model): id = models.CharField(max_length=32, primary_key=True) dc_id = models.CharField(max_length=32) hard_type = models.IntegerField() hard_name = models.CharField(max_length=100, blank=True, null=True) hard_info = models.CharField(max_length=255, blank=True, null=True) asset_tag = models.CharField(max_length=100, blank=True, null=True) class Meta: managed = False db_table = 'asset'
[ 1, 529, 9507, 29958, 4912, 2585, 29914, 23525, 29914, 9794, 29889, 2272, 13, 29937, 910, 338, 385, 4469, 29899, 13525, 15337, 1904, 3883, 29889, 13, 29937, 887, 29915, 645, 505, 304, 437, 278, 1494, 7522, 304, 5941, 445, 701, 29901, 13, 29937, 259, 334, 390, 799, 3881, 4733, 29915, 1797, 13, 29937, 259, 334, 8561, 1854, 1269, 1904, 756, 697, 1746, 411, 7601, 29918, 1989, 29922, 5574, 13, 29937, 259, 334, 8561, 1854, 1269, 19358, 2558, 322, 3118, 1762, 6716, 3073, 756, 421, 265, 29918, 8143, 29952, 731, 304, 278, 7429, 6030, 13, 29937, 259, 334, 15154, 421, 25240, 353, 7700, 29952, 3454, 565, 366, 6398, 304, 2758, 15337, 304, 1653, 29892, 6623, 29892, 322, 5217, 278, 1591, 13, 29937, 5169, 295, 3889, 304, 19508, 278, 4733, 29892, 541, 1016, 29915, 29873, 19508, 4833, 29918, 2371, 1819, 470, 1746, 2983, 29889, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 13, 13, 1990, 1094, 842, 29898, 9794, 29889, 3195, 1125, 13, 1678, 1178, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29941, 29906, 29892, 7601, 29918, 1989, 29922, 5574, 29897, 13, 1678, 270, 29883, 29918, 333, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29941, 29906, 29897, 13, 1678, 2898, 29918, 1853, 353, 4733, 29889, 7798, 3073, 580, 13, 1678, 2898, 29918, 978, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 2898, 29918, 3888, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 1678, 24342, 29918, 4039, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29892, 9654, 29922, 5574, 29892, 1870, 29922, 5574, 29897, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 8745, 353, 7700, 13, 4706, 4833, 29918, 2371, 353, 525, 24129, 29915, 13, 2 ]
demo/Drain_openstack.py
hcgcarry/logparser
1
113134
#!/usr/bin/env python import sys import os sys.path.append('../') from logparser import Drain from createSessonLog.createSessionLog import LogParser from shutil import copyfile from preprocess.preprocessLog import preprocess type = sys.argv[1] if len(sys.argv) < 2: print("usage:python Drain_openstack.py {normal|abnormal}") if type == "normal": curIndex = 0 else: curIndex = 1 output_dir = 'Drain_result_openstack/' # The output directory of parsing results input_path_list = ['../logs/openstack_label/openstack_normal1.log_preprocess', '../logs/openstack_label/openstack_abnormal.log_preprocess'] print("path:",os.path.split(input_path_list[curIndex])) input_dir ,log_file= os.path.split(input_path_list[curIndex]) copyfile(input_path_list[curIndex], output_dir+log_file) #log format log_format = '<Logrecord> <Date> <Time> <Pid> <Level> <Component> \[<ADDR>\] <Instance> <Content>' # Regular expression list for optional preprocessing (default: []) regex = [ r'((\d+\.){3}\d+,?)+', r'/.+?\s', r'\d+' , r'\d' ] #instance: 0f079bdd-4117-4f6a-8b49-f3fb720b483c] st = 0.5 # Similarity threshold depth = 5 # Depth of all leaf nodes parser = Drain.LogParser(log_format, indir=input_dir, outdir=output_dir, depth=depth, st=st, rex=regex,keep_para=False) parser.parse(log_file) print("output_dir:",output_dir) ''' log_format_list = ['<LineId> <Time> <Id> <Command> <Content> <EventId> <EventTemplate>'] logfilePath = output_dir createSessionLogparser = LogParser(log_format, indir=output_dir, outdir=output_dir, depth=depth, st=st, rex=regex,keep_para=False) createSessionLogparser.parse(log_file+'_structured.csv') '''
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 5215, 10876, 13, 5215, 2897, 13, 9675, 29889, 2084, 29889, 4397, 877, 6995, 1495, 13, 3166, 1480, 16680, 1053, 360, 6038, 13, 3166, 1653, 29903, 404, 265, 3403, 29889, 3258, 7317, 3403, 29871, 1053, 4522, 11726, 13, 3166, 528, 4422, 1053, 3509, 1445, 13, 3166, 758, 5014, 29889, 1457, 5014, 3403, 1053, 758, 5014, 13, 1853, 353, 10876, 29889, 19218, 29961, 29896, 29962, 13, 361, 7431, 29898, 9675, 29889, 19218, 29897, 529, 29871, 29906, 29901, 13, 1678, 1596, 703, 21125, 29901, 4691, 360, 6038, 29918, 3150, 1429, 29889, 2272, 426, 8945, 29989, 370, 8945, 27195, 13, 361, 1134, 1275, 376, 8945, 1115, 13, 1678, 3151, 3220, 353, 29871, 29900, 13, 2870, 29901, 13, 1678, 3151, 3220, 353, 29871, 29896, 13, 13, 13, 4905, 29918, 3972, 353, 525, 29928, 6038, 29918, 2914, 29918, 3150, 1429, 22208, 29871, 396, 450, 1962, 3884, 310, 13755, 2582, 13, 2080, 29918, 2084, 29918, 1761, 29871, 353, 6024, 6995, 20756, 29914, 3150, 1429, 29918, 1643, 29914, 3150, 1429, 29918, 8945, 29896, 29889, 1188, 29918, 1457, 5014, 742, 525, 6995, 20756, 29914, 3150, 1429, 29918, 1643, 29914, 3150, 1429, 29918, 370, 8945, 29889, 1188, 29918, 1457, 5014, 2033, 13, 13, 13, 2158, 703, 2084, 29901, 613, 359, 29889, 2084, 29889, 5451, 29898, 2080, 29918, 2084, 29918, 1761, 29961, 2764, 3220, 12622, 13, 2080, 29918, 3972, 1919, 1188, 29918, 1445, 29922, 2897, 29889, 2084, 29889, 5451, 29898, 2080, 29918, 2084, 29918, 1761, 29961, 2764, 3220, 2314, 13, 8552, 1445, 29898, 2080, 29918, 2084, 29918, 1761, 29961, 2764, 3220, 1402, 1962, 29918, 3972, 29974, 1188, 29918, 1445, 29897, 13, 13, 13, 396, 1188, 3402, 13, 1188, 29918, 4830, 353, 12801, 3403, 11651, 29958, 529, 2539, 29958, 529, 2481, 29958, 529, 29925, 333, 29958, 529, 10108, 29958, 529, 5308, 29958, 5539, 29966, 3035, 8353, 14247, 29962, 529, 4998, 29958, 529, 3916, 16299, 13, 13, 13, 29937, 2169, 1070, 4603, 1051, 363, 13136, 758, 19170, 313, 4381, 29901, 518, 2314, 13, 13087, 418, 353, 518, 13, 4706, 364, 12215, 1194, 29881, 3124, 1846, 29912, 29941, 1012, 29881, 29974, 29892, 29973, 7240, 742, 364, 29915, 6294, 29974, 29973, 29905, 29879, 742, 364, 12764, 29881, 23097, 1919, 364, 12764, 29881, 29915, 13, 29962, 13, 29937, 8758, 29901, 29871, 29900, 29888, 29900, 29955, 29929, 29890, 1289, 29899, 29946, 29896, 29896, 29955, 29899, 29946, 29888, 29953, 29874, 29899, 29947, 29890, 29946, 29929, 29899, 29888, 29941, 14943, 29955, 29906, 29900, 29890, 29946, 29947, 29941, 29883, 29962, 13, 303, 308, 353, 29871, 29900, 29889, 29945, 29871, 396, 13999, 537, 16897, 13, 19488, 418, 353, 29871, 29945, 29871, 396, 10034, 386, 310, 599, 20447, 7573, 13, 13, 13, 16680, 353, 360, 6038, 29889, 3403, 11726, 29898, 1188, 29918, 4830, 29892, 1399, 381, 29922, 2080, 29918, 3972, 29892, 714, 3972, 29922, 4905, 29918, 3972, 29892, 29871, 10809, 29922, 19488, 29892, 380, 29922, 303, 29892, 337, 29916, 29922, 13087, 29892, 17462, 29918, 22752, 29922, 8824, 29897, 13, 16680, 29889, 5510, 29898, 1188, 29918, 1445, 29897, 13, 2158, 703, 4905, 29918, 3972, 29901, 613, 4905, 29918, 3972, 29897, 13, 13, 13, 12008, 13, 1188, 29918, 4830, 29918, 1761, 353, 6024, 29966, 3542, 1204, 29958, 529, 2481, 29958, 529, 1204, 29958, 529, 6255, 29958, 529, 3916, 29958, 529, 2624, 1204, 29958, 529, 2624, 6733, 29958, 2033, 13, 1188, 1445, 2605, 353, 1962, 29918, 3972, 29871, 13, 3258, 7317, 3403, 16680, 353, 4522, 11726, 29898, 1188, 29918, 4830, 29892, 1399, 381, 29922, 4905, 29918, 3972, 29892, 714, 3972, 29922, 4905, 29918, 3972, 29892, 29871, 10809, 29922, 19488, 29892, 380, 29922, 303, 29892, 337, 29916, 29922, 13087, 29892, 17462, 29918, 22752, 29922, 8824, 29897, 13, 3258, 7317, 3403, 16680, 29889, 5510, 29898, 1188, 29918, 1445, 29974, 15972, 4984, 2955, 29889, 7638, 1495, 13, 12008, 13, 13, 2 ]
stick_mouse_pos.py
sevenjames/fpie-scripts
0
55621
""" Script to control mouse cursor with gamepad stick. Specifically: right stick x axis controls mouse x position. Requires FreePIE: https://github.com/AndersMalmgren/FreePIE 2020-06-11 JAO """ if starting: """This block only runs once.""" import time joy_id = 0 # gamepad device number x_axis_mult = 0.25 # pos mode movement multiplier def axis_to_mouse_pos(axis): """Position Mode. Stick deflection sets relative mouse cursor position.""" return filters.delta(axis) * x_axis_mult frame_start = time.time() # setup frame limiter mouse.deltaX = axis_to_mouse_pos(axis=joystick[joy_id].xRotation) time.sleep(max(1./60 - (time.time() - frame_start), 0)) # frame limiter
[ 1, 9995, 13, 4081, 304, 2761, 9495, 10677, 411, 3748, 8305, 12070, 29889, 13, 10299, 928, 635, 29901, 1492, 12070, 921, 9685, 11761, 9495, 921, 2602, 29889, 13, 1123, 339, 2658, 12362, 2227, 29923, 29901, 2045, 597, 3292, 29889, 510, 29914, 2855, 414, 29924, 17120, 20378, 29914, 20475, 2227, 29923, 13, 29906, 29900, 29906, 29900, 29899, 29900, 29953, 29899, 29896, 29896, 435, 29909, 29949, 13, 15945, 29908, 13, 13, 361, 6257, 29901, 13, 1678, 9995, 4013, 2908, 871, 6057, 2748, 1213, 15945, 13, 1678, 1053, 931, 13, 1678, 15331, 29918, 333, 353, 29871, 29900, 396, 3748, 8305, 4742, 1353, 13, 1678, 921, 29918, 8990, 29918, 4713, 353, 29871, 29900, 29889, 29906, 29945, 396, 926, 4464, 10298, 6674, 4926, 13, 13, 1753, 9685, 29918, 517, 29918, 15769, 29918, 1066, 29898, 8990, 1125, 13, 1678, 9995, 8003, 21864, 29889, 624, 860, 822, 1464, 6166, 6198, 9495, 10677, 2602, 1213, 15945, 13, 1678, 736, 18094, 29889, 4181, 29898, 8990, 29897, 334, 921, 29918, 8990, 29918, 4713, 13, 13, 2557, 29918, 2962, 353, 931, 29889, 2230, 580, 396, 6230, 3515, 2485, 1524, 13, 15769, 29889, 4181, 29990, 353, 9685, 29918, 517, 29918, 15769, 29918, 1066, 29898, 8990, 29922, 2212, 858, 860, 29961, 2212, 29891, 29918, 333, 1822, 29916, 21281, 362, 29897, 13, 2230, 29889, 17059, 29898, 3317, 29898, 29896, 6904, 29953, 29900, 448, 313, 2230, 29889, 2230, 580, 448, 3515, 29918, 2962, 511, 29871, 29900, 876, 396, 3515, 2485, 1524, 13, 2 ]
app/__init__.py
Jotasenpai/DigitalMediaStoreRESTfull
0
1540
import logging import os from flask import Flask from flask_cors import CORS from app.extensions import api from app.extensions.database import db from app.extensions.schema import ma from app.views import albums, artists, hello, tracks def create_app(config, **kwargs): logging.basicConfig(level=logging.INFO) app = Flask(__name__, **kwargs) CORS(app, resources={r"/api/*": {"origins": "*"}}) app.config.from_object(config) # app.url_map.strict_slashes = False with app.app_context(): api.init_app(app) db.init_app(app) db.create_all() ma.init_app(app) api.register_blueprint(hello.blp) api.register_blueprint(artists.blp) api.register_blueprint(albums.blp) api.register_blueprint(tracks.blp) try: os.makedirs(app.instance_path) except OSError: pass return app
[ 1, 1053, 12183, 13, 5215, 2897, 13, 13, 3166, 29784, 1053, 2379, 1278, 13, 3166, 29784, 29918, 29883, 943, 1053, 315, 24125, 13, 13, 3166, 623, 29889, 24299, 1053, 7882, 13, 3166, 623, 29889, 24299, 29889, 9803, 1053, 4833, 13, 3166, 623, 29889, 24299, 29889, 11010, 1053, 611, 13, 3166, 623, 29889, 7406, 1053, 20618, 29892, 17906, 29892, 22172, 29892, 16257, 13, 13, 13, 1753, 1653, 29918, 932, 29898, 2917, 29892, 3579, 19290, 1125, 13, 13, 1678, 12183, 29889, 16121, 3991, 29898, 5563, 29922, 21027, 29889, 11690, 29897, 13, 13, 1678, 623, 353, 2379, 1278, 22168, 978, 1649, 29892, 3579, 19290, 29897, 13, 1678, 315, 24125, 29898, 932, 29892, 7788, 3790, 29878, 23901, 2754, 5515, 1115, 8853, 12683, 1144, 1115, 376, 20605, 24289, 13, 13, 1678, 623, 29889, 2917, 29889, 3166, 29918, 3318, 29898, 2917, 29897, 13, 1678, 396, 623, 29889, 2271, 29918, 1958, 29889, 710, 919, 29918, 17057, 267, 353, 7700, 13, 13, 1678, 411, 623, 29889, 932, 29918, 4703, 7295, 13, 4706, 7882, 29889, 2344, 29918, 932, 29898, 932, 29897, 13, 13, 4706, 4833, 29889, 2344, 29918, 932, 29898, 932, 29897, 13, 4706, 4833, 29889, 3258, 29918, 497, 580, 13, 13, 4706, 611, 29889, 2344, 29918, 932, 29898, 932, 29897, 13, 13, 4706, 7882, 29889, 9573, 29918, 9539, 2158, 29898, 12199, 29889, 2204, 29886, 29897, 13, 4706, 7882, 29889, 9573, 29918, 9539, 2158, 29898, 442, 2879, 29889, 2204, 29886, 29897, 13, 4706, 7882, 29889, 9573, 29918, 9539, 2158, 29898, 10336, 29879, 29889, 2204, 29886, 29897, 13, 4706, 7882, 29889, 9573, 29918, 9539, 2158, 29898, 3018, 4684, 29889, 2204, 29886, 29897, 13, 13, 1678, 1018, 29901, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 932, 29889, 8758, 29918, 2084, 29897, 13, 1678, 5174, 438, 29173, 29901, 13, 4706, 1209, 13, 13, 1678, 736, 623, 13, 2 ]
src/phl_budget_data/utils.py
PhilaController/phl-budget-data
1
133150
<reponame>PhilaController/phl-budget-data import inspect from functools import wraps import pandas as pd from . import DATA_DIR def determine_file_name(f, **kwargs): """Given a function, determine the matching file name.""" # The parts name = f.__name__ tag = f.__module__.split(".")[-1] # The base of the file name filename_base = "-".join(name.split("_")[1:]) # The output folder output_folder = DATA_DIR / "historical" / tag # Required params if hasattr(f, "model"): # Get the params schema = f.model.schema() # Do all iterations of params param_values = [kwargs.get(k) for k in schema["required"]] if any(value is None for value in param_values): raise ValueError("Missing required params") # The filename filename = filename_base + "-" + "-".join(param_values) + ".csv" output_file = output_folder / filename else: filename = "-".join(name.split("_")[1:]) + ".csv" output_file = output_folder / filename return output_file def optional_from_cache(f): """Decorator to check if ETL is installed and load from cache.""" @wraps(f) def wrapper(*args, **kwargs): # Get the function signature sig = inspect.signature(f).bind(*args, **kwargs) # If development if not ETL_VERSION: filename = determine_file_name(f, **sig.arguments) return pd.read_csv(filename) else: return f(*args, **kwargs) return wrapper
[ 1, 529, 276, 1112, 420, 29958, 4819, 4233, 2956, 29914, 561, 29880, 29899, 15841, 657, 29899, 1272, 13, 5215, 16096, 13, 3166, 2090, 312, 8789, 1053, 11463, 567, 13, 13, 5215, 11701, 408, 10518, 13, 13, 3166, 869, 1053, 360, 8254, 29918, 9464, 13, 13, 13, 1753, 8161, 29918, 1445, 29918, 978, 29898, 29888, 29892, 3579, 19290, 1125, 13, 1678, 9995, 29954, 5428, 263, 740, 29892, 8161, 278, 9686, 934, 1024, 1213, 15945, 13, 13, 1678, 396, 450, 5633, 13, 1678, 1024, 353, 285, 17255, 978, 1649, 13, 1678, 4055, 353, 285, 17255, 5453, 26914, 5451, 17350, 1159, 14352, 29896, 29962, 13, 13, 1678, 396, 450, 2967, 310, 278, 934, 1024, 13, 1678, 10422, 29918, 3188, 353, 11663, 1642, 7122, 29898, 978, 29889, 5451, 703, 29918, 1159, 29961, 29896, 29901, 2314, 13, 13, 1678, 396, 450, 1962, 4138, 13, 1678, 1962, 29918, 12083, 353, 360, 8254, 29918, 9464, 847, 376, 16211, 936, 29908, 847, 4055, 13, 13, 1678, 396, 830, 5958, 8636, 13, 1678, 565, 756, 5552, 29898, 29888, 29892, 376, 4299, 29908, 1125, 13, 13, 4706, 396, 3617, 278, 8636, 13, 4706, 10938, 353, 285, 29889, 4299, 29889, 11010, 580, 13, 13, 4706, 396, 1938, 599, 24372, 310, 8636, 13, 4706, 1828, 29918, 5975, 353, 518, 19290, 29889, 657, 29898, 29895, 29897, 363, 413, 297, 10938, 3366, 12403, 3108, 29962, 13, 4706, 565, 738, 29898, 1767, 338, 6213, 363, 995, 297, 1828, 29918, 5975, 1125, 13, 9651, 12020, 7865, 2392, 703, 18552, 292, 3734, 8636, 1159, 13, 13, 4706, 396, 450, 10422, 13, 4706, 10422, 353, 10422, 29918, 3188, 718, 11663, 29908, 718, 11663, 1642, 7122, 29898, 3207, 29918, 5975, 29897, 718, 11393, 7638, 29908, 13, 4706, 1962, 29918, 1445, 353, 1962, 29918, 12083, 847, 10422, 13, 1678, 1683, 29901, 13, 4706, 10422, 353, 11663, 1642, 7122, 29898, 978, 29889, 5451, 703, 29918, 1159, 29961, 29896, 29901, 2314, 718, 11393, 7638, 29908, 13, 4706, 1962, 29918, 1445, 353, 1962, 29918, 12083, 847, 10422, 13, 13, 1678, 736, 1962, 29918, 1445, 13, 13, 13, 1753, 13136, 29918, 3166, 29918, 8173, 29898, 29888, 1125, 13, 1678, 9995, 6185, 272, 1061, 304, 1423, 565, 382, 14632, 338, 5130, 322, 2254, 515, 7090, 1213, 15945, 13, 13, 1678, 732, 29893, 336, 567, 29898, 29888, 29897, 13, 1678, 822, 14476, 10456, 5085, 29892, 3579, 19290, 1125, 13, 13, 4706, 396, 3617, 278, 740, 12608, 13, 4706, 4365, 353, 16096, 29889, 4530, 1535, 29898, 29888, 467, 5355, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 4706, 396, 960, 5849, 29871, 13, 4706, 565, 451, 382, 14632, 29918, 16358, 29901, 13, 9651, 10422, 353, 8161, 29918, 1445, 29918, 978, 29898, 29888, 29892, 3579, 18816, 29889, 25699, 29897, 13, 9651, 736, 10518, 29889, 949, 29918, 7638, 29898, 9507, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 285, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 736, 14476, 13, 2 ]
Day2/python-exercises-02-answers/preparing_dataset/category_dataset_debug.py
klimpie94/Python-training
0
35092
import pandas as pd import os from pathlib import Path import warnings warnings.filterwarnings('ignore') DATA_PATH = os.path.join( os.fspath(Path(__file__).parents[1]), "data") IMDB_DATA_PATH = os.path.join(DATA_PATH, "imdb_category.csv") EXPORT_PATH = os.path.join(DATA_PATH, "imdb_category_binary.csv") categories_df = pd.read_csv(IMDB_DATA_PATH) cols_category = categories_df.iloc[:, 1:29].columns categories_df_tmp = categories_df.copy(deep=True) categories_df_tmp["film_category"] = (categories_df_tmp .loc[:, cols_category] .idxmax(axis=1) .values) columns_to_drop = [col for idx, col in enumerate(categories_df_tmp.columns) if idx in range(1, 29)] categories_df_tmp.drop(columns_to_drop, axis=1, inplace=True) categories_binary = categories_df_tmp.join( pd.get_dummies( data=categories_df_tmp.film_category, prefix=None)) categories_binary.drop("film_category", axis=1, inplace=True) categories_binary.to_csv(EXPORT_PATH, sep=",", index=False)
[ 1, 1053, 11701, 408, 10518, 13, 5215, 2897, 13, 3166, 2224, 1982, 1053, 10802, 13, 13, 5215, 18116, 13, 25442, 886, 29889, 4572, 25442, 886, 877, 17281, 1495, 13, 13, 13, 14573, 29918, 10145, 353, 2897, 29889, 2084, 29889, 7122, 29898, 13, 1678, 2897, 29889, 29888, 1028, 493, 29898, 2605, 22168, 1445, 1649, 467, 862, 1237, 29961, 29896, 11724, 13, 1678, 376, 1272, 1159, 13, 7833, 4051, 29918, 14573, 29918, 10145, 353, 2897, 29889, 2084, 29889, 7122, 29898, 14573, 29918, 10145, 29892, 376, 326, 2585, 29918, 7320, 29889, 7638, 1159, 13, 5746, 15082, 29918, 10145, 353, 2897, 29889, 2084, 29889, 7122, 29898, 14573, 29918, 10145, 29892, 376, 326, 2585, 29918, 7320, 29918, 19541, 29889, 7638, 1159, 13, 13, 13, 20683, 29918, 2176, 353, 10518, 29889, 949, 29918, 7638, 29898, 7833, 4051, 29918, 14573, 29918, 10145, 29897, 13, 22724, 29918, 7320, 353, 13997, 29918, 2176, 29889, 309, 542, 7503, 29892, 29871, 29896, 29901, 29906, 29929, 1822, 13099, 13, 20683, 29918, 2176, 29918, 7050, 353, 13997, 29918, 2176, 29889, 8552, 29898, 24535, 29922, 5574, 29897, 13, 20683, 29918, 2176, 29918, 7050, 3366, 9663, 29918, 7320, 3108, 353, 313, 20683, 29918, 2176, 29918, 7050, 13, 462, 462, 418, 869, 2029, 7503, 29892, 28730, 29918, 7320, 29962, 13, 462, 462, 418, 869, 13140, 3317, 29898, 8990, 29922, 29896, 29897, 13, 462, 462, 418, 869, 5975, 29897, 13, 13, 13099, 29918, 517, 29918, 8865, 353, 518, 1054, 13, 462, 259, 363, 22645, 29892, 784, 297, 26985, 29898, 20683, 29918, 2176, 29918, 7050, 29889, 13099, 29897, 13, 462, 259, 565, 22645, 297, 3464, 29898, 29896, 29892, 29871, 29906, 29929, 4638, 13, 20683, 29918, 2176, 29918, 7050, 29889, 8865, 29898, 13099, 29918, 517, 29918, 8865, 29892, 9685, 29922, 29896, 29892, 297, 6689, 29922, 5574, 29897, 13, 13, 20683, 29918, 19541, 353, 13997, 29918, 2176, 29918, 7050, 29889, 7122, 29898, 13, 1678, 10518, 29889, 657, 29918, 29881, 23824, 583, 29898, 13, 4706, 848, 29922, 20683, 29918, 2176, 29918, 7050, 29889, 9663, 29918, 7320, 29892, 13, 4706, 10944, 29922, 8516, 876, 13, 13, 20683, 29918, 19541, 29889, 8865, 703, 9663, 29918, 7320, 613, 9685, 29922, 29896, 29892, 297, 6689, 29922, 5574, 29897, 13, 13, 20683, 29918, 19541, 29889, 517, 29918, 7638, 29898, 5746, 15082, 29918, 10145, 29892, 16345, 543, 29892, 613, 2380, 29922, 8824, 29897, 13, 2 ]
apigw/schema.py
theztd/flaskapp-prom
2
185830
import json from os import path, getenv, uname from requests import get try: import graphene #from graphene_sqlalchemy import SQLAlchemyObjectType, SQLAlchemyConnectionField except ImportError as err: print("Install dependencies!!!") print(err) exit(22) ENV = getenv("ENV", "devel") VERSION = "unknown" INSTANCE = uname()[1] try: with open("./VERSION") as ver: VERSION = ver.read().strip() except IOError as err: print("Unable to find VERSION file, but continue...") DATA = get("http://localhost:5001/api/user/list.json").json() print(DATA) class Person(graphene.ObjectType): name = graphene.String(value = graphene.String(default_value="<NAME>")) key_length = graphene.Int() key = graphene.String() # register all queries class Query(graphene.ObjectType): users = graphene.List(Person, size=graphene.Int(default_value=1)) version = graphene.String() instance = graphene.String() env = graphene.String() def resolve_users(root, info, size): return DATA[:size] def resolve_version(root, info): return VERSION def resolve_instance(root, info): return INSTANCE def resolve_env(root, info): return ENV SCHEMA = graphene.Schema(query=Query) # --------- TEST ------ if __name__ == "__main__": from pprint import pprint print(SCHEMA) cq1 = ''' query myquery { name: name (value: "karlik") age } ''' cq2 = ''' query myquery { array (size:5){ name age } } ''' r = schema.execute(cq2) pprint(r.data)
[ 1, 1053, 4390, 13, 3166, 2897, 1053, 2224, 29892, 679, 6272, 29892, 443, 420, 13, 3166, 7274, 1053, 679, 13, 13, 2202, 29901, 13, 1678, 1053, 3983, 1600, 13, 1678, 396, 3166, 3983, 1600, 29918, 2850, 284, 305, 6764, 1053, 3758, 2499, 305, 6764, 2061, 1542, 29892, 3758, 2499, 305, 6764, 5350, 3073, 13, 13, 19499, 16032, 2392, 408, 4589, 29901, 13, 1678, 1596, 703, 23271, 9962, 21004, 1159, 13, 1678, 1596, 29898, 3127, 29897, 13, 1678, 6876, 29898, 29906, 29906, 29897, 13, 13, 25838, 353, 679, 6272, 703, 25838, 613, 376, 311, 955, 1159, 13, 16358, 353, 376, 26690, 29908, 13, 25580, 23219, 353, 443, 420, 580, 29961, 29896, 29962, 13, 13, 2202, 29901, 13, 1678, 411, 1722, 703, 6904, 16358, 1159, 408, 1147, 29901, 13, 4706, 478, 1001, 13381, 353, 1147, 29889, 949, 2141, 17010, 580, 13, 13, 19499, 10663, 2392, 408, 4589, 29901, 13, 1678, 1596, 703, 2525, 519, 304, 1284, 478, 1001, 13381, 934, 29892, 541, 6773, 856, 1159, 13, 13, 13, 14573, 353, 679, 703, 1124, 597, 7640, 29901, 29945, 29900, 29900, 29896, 29914, 2754, 29914, 1792, 29914, 1761, 29889, 3126, 2564, 3126, 580, 13, 2158, 29898, 14573, 29897, 13, 13, 13, 1990, 5196, 29898, 4262, 1600, 29889, 2061, 1542, 1125, 13, 1678, 1024, 353, 3983, 1600, 29889, 1231, 29898, 1767, 353, 3983, 1600, 29889, 1231, 29898, 4381, 29918, 1767, 543, 29966, 5813, 29958, 5783, 13, 1678, 1820, 29918, 2848, 353, 3983, 1600, 29889, 2928, 580, 13, 1678, 1820, 353, 3983, 1600, 29889, 1231, 580, 13, 13, 13, 29937, 6036, 599, 9365, 13, 1990, 13641, 29898, 4262, 1600, 29889, 2061, 1542, 1125, 13, 1678, 4160, 353, 3983, 1600, 29889, 1293, 29898, 7435, 29892, 2159, 29922, 4262, 1600, 29889, 2928, 29898, 4381, 29918, 1767, 29922, 29896, 876, 13, 1678, 1873, 353, 3983, 1600, 29889, 1231, 580, 13, 1678, 2777, 353, 3983, 1600, 29889, 1231, 580, 13, 1678, 8829, 353, 3983, 1600, 29889, 1231, 580, 13, 13, 1678, 822, 8814, 29918, 7193, 29898, 4632, 29892, 5235, 29892, 2159, 1125, 13, 4706, 736, 360, 8254, 7503, 2311, 29962, 13, 13, 1678, 822, 8814, 29918, 3259, 29898, 4632, 29892, 5235, 1125, 13, 4706, 736, 478, 1001, 13381, 13, 13, 1678, 822, 8814, 29918, 8758, 29898, 4632, 29892, 5235, 1125, 13, 4706, 736, 2672, 1254, 23219, 13, 13, 1678, 822, 8814, 29918, 6272, 29898, 4632, 29892, 5235, 1125, 13, 4706, 736, 12524, 29963, 13, 13, 29903, 3210, 26862, 353, 3983, 1600, 29889, 12763, 29898, 1972, 29922, 3010, 29897, 13, 13, 13, 29937, 448, 1378, 259, 17067, 1254, 259, 448, 23648, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 515, 282, 2158, 1053, 282, 2158, 13, 13, 1678, 1596, 29898, 29903, 3210, 26862, 29897, 13, 1678, 274, 29939, 29896, 353, 14550, 13, 1972, 590, 1972, 426, 13, 1678, 1024, 29901, 1024, 313, 1767, 29901, 376, 5689, 5081, 1159, 13, 1678, 5046, 13, 29913, 13, 12008, 13, 13, 1678, 274, 29939, 29906, 353, 14550, 13, 1972, 590, 1972, 426, 13, 1678, 1409, 313, 2311, 29901, 29945, 2597, 13, 4706, 1024, 13, 4706, 5046, 13, 1678, 500, 13, 29913, 13, 12008, 13, 13, 1678, 364, 353, 10938, 29889, 7978, 29898, 29883, 29939, 29906, 29897, 13, 1678, 282, 2158, 29898, 29878, 29889, 1272, 29897, 13, 2 ]
income_expense_tracker/authentication/views.py
gokul-sarath07/Nymblelabs-Expence-Tracker
0
50805
<reponame>gokul-sarath07/Nymblelabs-Expence-Tracker<filename>income_expense_tracker/authentication/views.py from django.views import View from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.shortcuts import render, redirect from django.http import JsonResponse from validate_email import validate_email import json class RegistrationView(View): """This class provides functions to work with registration.""" def get(self, request): """This function renders the registration page.""" return render(request, 'authentication/register.html') def post(self, request): """This function accepts the registration form data.""" username = request.POST['username'] email = request.POST['email'] password = request.POST['password'] # variable value mapping that is passed to the registration template. context = { "fieldValues": request.POST } # Checks if user has all fields filled. if username and email and password: # Checks if username already exists in database. if not User.objects.filter(username=username).exists(): # Checks if email already exists in database. if not User.objects.filter(email=email).exists(): # Checks if password length is less than 6 characters. if len(password) < 6: # Sends error message to user for short password. messages.error(request, "Password must be atleast 6 characters") # Returns the registration page. return render(request, 'authentication/register.html', context) # Creates a user object to be saved in database. user = User.objects.create_user(username=username, email=email) # Sets the user password. user.set_password(password) # Saves the user to database. user.save() # Sends success message to user for account created. messages.success(request, "Account successfully created") # Directs to login page. return render(request, 'authentication/login.html') else: # Sends error message to user for empty fields. messages.error(request, "Please fill all fields.") # Returns the registration page. return render(request, 'authentication/register.html', context) class UsernameValidationView(View): """This class is an API View for username validation.""" def post(self, request): """ - Checks if username is alphanumeric and it doesn't exists in database. """ data = json.loads(request.body) # gets data from request. username = data['username'] # gets username from data. # Checks if username is not alphanumeric. if not username.isalnum(): return JsonResponse({ 'username_error': 'Username should only contain alphanumeric characters' }, status=400) # Checks if username already exists in database. if User.objects.filter(username=username).exists(): return JsonResponse({ 'username_error': "Sorry, that username's taken. Try another?" }, status=409) # Returns valid username response. return JsonResponse({'username_valid': True}, status=200) class EmailValidationView(View): """This class is an API View for email validation.""" def post(self, request): """ - Checks if email is valid and it doesn't exists in database. """ data = json.loads(request.body) # gets data from request. email = data['email'] # gets email from data. # Checks if email is not valid. if not validate_email(email): return JsonResponse({ 'email_error': 'This email is invalid' }, status=400) # Checks if email doesn't already exists in database. if User.objects.filter(email=email).exists(): return JsonResponse({ 'email_error': 'This email already exists, Please login.' }, status=409) # Returns valid email response. return JsonResponse({'email_valid': True}, status=200) class PasswordValidationView(View): """This class is an API View for password validation.""" def post(self, request): """ - Checks if password is atleast 6 characters. """ data = json.loads(request.body) # gets the data from request. password = data['password'] # gets password from data. # Checks if password length is less than 6 characters. if len(password) < 6: return JsonResponse({ 'password_error': 'Passwords must be atleast 6 characters.' }, status=400) # Returns valid password response. return JsonResponse({'password_error': True}, status=200) class LoginView(View): """This class provides functions to work with login.""" def get(self, request): """This function renders the login page.""" return render(request, 'authentication/login.html') def post(self, request): """This function accepts the login form data.""" username = request.POST['username'] # gets username from request. password = request.POST['password'] # gets password from request. # Checks if both fields are filled. if username and password: # Creates user object with given credentials. user = authenticate(username=username, password=password) # Checks if password is valid for the given user. if user: # Logs in the user. login(request, user) # Sends success message to user. messages.success(request, "You are now logged in.") # redirects them to the home page. return redirect('home') # Sends error message to user for invalid credentials. messages.error(request, "Incorrect credentials, Try again.") return render(request, 'authentication/login.html') # Sends error message to user for empty fields. messages.error(request, "Please fill all fields.") return render(request, 'authentication/login.html') # This view can be accessed only after logging in. class LogoutView(LoginRequiredMixin, View): """This class provides function to work with logout.""" def post(self, request): """Logs out the current user.""" logout(request) # Logs out current user. # Sends success message to user for successfully logout. messages.success(request, "You have successfully logged out.") return redirect('login')
[ 1, 529, 276, 1112, 420, 29958, 29887, 554, 352, 29899, 29879, 279, 493, 29900, 29955, 29914, 29940, 962, 569, 29880, 6897, 29899, 9544, 663, 29899, 5323, 4937, 29966, 9507, 29958, 262, 2763, 29918, 4548, 1947, 29918, 3018, 4937, 29914, 23055, 29914, 7406, 29889, 2272, 13, 3166, 9557, 29889, 7406, 1053, 4533, 13, 3166, 9557, 29889, 21570, 1053, 7191, 13, 3166, 9557, 29889, 21570, 29889, 5150, 1053, 15585, 403, 29892, 6464, 29892, 1480, 449, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 28084, 1144, 1053, 19130, 19347, 29924, 861, 262, 13, 3166, 9557, 29889, 21570, 29889, 5150, 29889, 9794, 1053, 4911, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 4050, 29892, 6684, 13, 3166, 9557, 29889, 1124, 1053, 14355, 5103, 13, 3166, 12725, 29918, 5269, 1053, 12725, 29918, 5269, 13, 5215, 4390, 13, 13, 13, 1990, 2169, 8306, 1043, 29898, 1043, 1125, 13, 1678, 9995, 4013, 770, 8128, 3168, 304, 664, 411, 22583, 1213, 15945, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 4013, 740, 7697, 414, 278, 22583, 1813, 1213, 15945, 13, 13, 4706, 736, 4050, 29898, 3827, 29892, 525, 23055, 29914, 9573, 29889, 1420, 1495, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 4013, 740, 21486, 278, 22583, 883, 848, 1213, 15945, 13, 13, 4706, 8952, 353, 2009, 29889, 5438, 1839, 6786, 2033, 13, 4706, 4876, 353, 2009, 29889, 5438, 1839, 5269, 2033, 13, 4706, 4800, 353, 2009, 29889, 5438, 1839, 5630, 2033, 13, 13, 4706, 396, 2286, 995, 10417, 393, 338, 4502, 304, 278, 22583, 4472, 29889, 13, 4706, 3030, 353, 426, 13, 9651, 376, 2671, 9065, 1115, 2009, 29889, 5438, 13, 4706, 500, 13, 13, 4706, 396, 5399, 29879, 565, 1404, 756, 599, 4235, 10423, 29889, 13, 4706, 565, 8952, 322, 4876, 322, 4800, 29901, 13, 9651, 396, 5399, 29879, 565, 8952, 2307, 4864, 297, 2566, 29889, 13, 9651, 565, 451, 4911, 29889, 12650, 29889, 4572, 29898, 6786, 29922, 6786, 467, 9933, 7295, 13, 18884, 396, 5399, 29879, 565, 4876, 2307, 4864, 297, 2566, 29889, 13, 18884, 565, 451, 4911, 29889, 12650, 29889, 4572, 29898, 5269, 29922, 5269, 467, 9933, 7295, 13, 462, 1678, 396, 5399, 29879, 565, 4800, 3309, 338, 3109, 1135, 29871, 29953, 4890, 29889, 13, 462, 1678, 565, 7431, 29898, 5630, 29897, 529, 29871, 29953, 29901, 13, 462, 4706, 396, 317, 1975, 1059, 2643, 304, 1404, 363, 3273, 4800, 29889, 13, 462, 4706, 7191, 29889, 2704, 29898, 3827, 29892, 13, 462, 462, 539, 376, 10048, 1818, 367, 472, 280, 579, 29871, 29953, 4890, 1159, 13, 462, 4706, 396, 16969, 278, 22583, 1813, 29889, 13, 462, 4706, 736, 4050, 29898, 3827, 29892, 525, 23055, 29914, 9573, 29889, 1420, 742, 13, 462, 462, 418, 3030, 29897, 13, 13, 462, 1678, 396, 6760, 1078, 263, 1404, 1203, 304, 367, 7160, 297, 2566, 29889, 13, 462, 1678, 1404, 353, 4911, 29889, 12650, 29889, 3258, 29918, 1792, 29898, 6786, 29922, 6786, 29892, 13, 462, 462, 462, 1678, 4876, 29922, 5269, 29897, 13, 462, 1678, 396, 317, 1691, 278, 1404, 4800, 29889, 13, 462, 1678, 1404, 29889, 842, 29918, 5630, 29898, 5630, 29897, 13, 462, 1678, 396, 317, 5989, 278, 1404, 304, 2566, 29889, 13, 462, 1678, 1404, 29889, 7620, 580, 13, 462, 1678, 396, 317, 1975, 2551, 2643, 304, 1404, 363, 3633, 2825, 29889, 13, 462, 1678, 7191, 29889, 8698, 29898, 3827, 29892, 376, 10601, 8472, 2825, 1159, 13, 462, 1678, 396, 8797, 29879, 304, 6464, 1813, 29889, 13, 462, 1678, 736, 4050, 29898, 3827, 29892, 525, 23055, 29914, 7507, 29889, 1420, 1495, 13, 4706, 1683, 29901, 13, 9651, 396, 317, 1975, 1059, 2643, 304, 1404, 363, 4069, 4235, 29889, 13, 9651, 7191, 29889, 2704, 29898, 3827, 29892, 376, 12148, 5445, 599, 4235, 23157, 13, 9651, 396, 16969, 278, 22583, 1813, 29889, 13, 9651, 736, 4050, 29898, 3827, 29892, 525, 23055, 29914, 9573, 29889, 1420, 742, 3030, 29897, 13, 13, 13, 1990, 4911, 978, 19448, 1043, 29898, 1043, 1125, 13, 1678, 9995, 4013, 770, 338, 385, 3450, 4533, 363, 8952, 8845, 1213, 15945, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 13, 4706, 448, 5399, 29879, 565, 8952, 338, 394, 16711, 25099, 322, 372, 1838, 29915, 29873, 4864, 297, 2566, 29889, 13, 4706, 9995, 13, 13, 4706, 848, 353, 4390, 29889, 18132, 29898, 3827, 29889, 2587, 29897, 29871, 396, 4947, 848, 515, 2009, 29889, 13, 4706, 8952, 353, 848, 1839, 6786, 2033, 29871, 396, 4947, 8952, 515, 848, 29889, 13, 13, 4706, 396, 5399, 29879, 565, 8952, 338, 451, 394, 16711, 25099, 29889, 13, 4706, 565, 451, 8952, 29889, 275, 284, 1949, 7295, 13, 9651, 736, 14355, 5103, 3319, 13, 18884, 525, 6786, 29918, 2704, 2396, 13, 462, 1678, 525, 20249, 881, 871, 1712, 394, 16711, 25099, 4890, 29915, 13, 9651, 2981, 4660, 29922, 29946, 29900, 29900, 29897, 13, 13, 4706, 396, 5399, 29879, 565, 8952, 2307, 4864, 297, 2566, 29889, 13, 4706, 565, 4911, 29889, 12650, 29889, 4572, 29898, 6786, 29922, 6786, 467, 9933, 7295, 13, 9651, 736, 14355, 5103, 3319, 13, 18884, 525, 6786, 29918, 2704, 2396, 376, 29903, 3818, 29892, 393, 8952, 29915, 29879, 4586, 29889, 3967, 1790, 3026, 13, 9651, 2981, 4660, 29922, 29946, 29900, 29929, 29897, 13, 13, 4706, 396, 16969, 2854, 8952, 2933, 29889, 13, 4706, 736, 14355, 5103, 3319, 29915, 6786, 29918, 3084, 2396, 5852, 1118, 4660, 29922, 29906, 29900, 29900, 29897, 13, 13, 13, 1990, 22608, 19448, 1043, 29898, 1043, 1125, 13, 1678, 9995, 4013, 770, 338, 385, 3450, 4533, 363, 4876, 8845, 1213, 15945, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 13, 4706, 448, 5399, 29879, 565, 4876, 338, 2854, 322, 372, 1838, 29915, 29873, 4864, 297, 2566, 29889, 13, 4706, 9995, 13, 13, 4706, 848, 353, 4390, 29889, 18132, 29898, 3827, 29889, 2587, 29897, 29871, 396, 4947, 848, 515, 2009, 29889, 13, 4706, 4876, 353, 848, 1839, 5269, 2033, 29871, 396, 4947, 4876, 515, 848, 29889, 13, 13, 4706, 396, 5399, 29879, 565, 4876, 338, 451, 2854, 29889, 13, 4706, 565, 451, 12725, 29918, 5269, 29898, 5269, 1125, 13, 9651, 736, 14355, 5103, 3319, 13, 18884, 525, 5269, 29918, 2704, 2396, 525, 4013, 4876, 338, 8340, 29915, 13, 9651, 2981, 4660, 29922, 29946, 29900, 29900, 29897, 13, 13, 4706, 396, 5399, 29879, 565, 4876, 1838, 29915, 29873, 2307, 4864, 297, 2566, 29889, 13, 4706, 565, 4911, 29889, 12650, 29889, 4572, 29898, 5269, 29922, 5269, 467, 9933, 7295, 13, 9651, 736, 14355, 5103, 3319, 13, 18884, 525, 5269, 29918, 2704, 2396, 525, 4013, 4876, 2307, 4864, 29892, 3529, 6464, 6169, 13, 9651, 2981, 4660, 29922, 29946, 29900, 29929, 29897, 13, 13, 4706, 396, 16969, 2854, 4876, 2933, 29889, 13, 4706, 736, 14355, 5103, 3319, 29915, 5269, 29918, 3084, 2396, 5852, 1118, 4660, 29922, 29906, 29900, 29900, 29897, 13, 13, 13, 1990, 25280, 19448, 1043, 29898, 1043, 1125, 13, 1678, 9995, 4013, 770, 338, 385, 3450, 4533, 363, 4800, 8845, 1213, 15945, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 13, 4706, 448, 5399, 29879, 565, 4800, 338, 472, 280, 579, 29871, 29953, 4890, 29889, 13, 4706, 9995, 13, 13, 4706, 848, 353, 4390, 29889, 18132, 29898, 3827, 29889, 2587, 29897, 29871, 396, 4947, 278, 848, 515, 2009, 29889, 13, 4706, 4800, 353, 848, 1839, 5630, 2033, 29871, 396, 4947, 4800, 515, 848, 29889, 13, 13, 4706, 396, 5399, 29879, 565, 4800, 3309, 338, 3109, 1135, 29871, 29953, 4890, 29889, 13, 4706, 565, 7431, 29898, 5630, 29897, 529, 29871, 29953, 29901, 13, 9651, 736, 14355, 5103, 3319, 13, 18884, 525, 5630, 29918, 2704, 2396, 525, 7129, 9303, 1818, 367, 472, 280, 579, 29871, 29953, 4890, 6169, 13, 9651, 2981, 4660, 29922, 29946, 29900, 29900, 29897, 13, 13, 4706, 396, 16969, 2854, 4800, 2933, 29889, 13, 4706, 736, 14355, 5103, 3319, 29915, 5630, 29918, 2704, 2396, 5852, 1118, 4660, 29922, 29906, 29900, 29900, 29897, 13, 13, 13, 1990, 19130, 1043, 29898, 1043, 1125, 13, 1678, 9995, 4013, 770, 8128, 3168, 304, 664, 411, 6464, 1213, 15945, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 4013, 740, 7697, 414, 278, 6464, 1813, 1213, 15945, 13, 13, 4706, 736, 4050, 29898, 3827, 29892, 525, 23055, 29914, 7507, 29889, 1420, 1495, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 4013, 740, 21486, 278, 6464, 883, 848, 1213, 15945, 13, 13, 4706, 8952, 353, 2009, 29889, 5438, 1839, 6786, 2033, 29871, 396, 4947, 8952, 515, 2009, 29889, 13, 4706, 4800, 353, 2009, 29889, 5438, 1839, 5630, 2033, 29871, 396, 4947, 4800, 515, 2009, 29889, 13, 13, 4706, 396, 5399, 29879, 565, 1716, 4235, 526, 10423, 29889, 13, 4706, 565, 8952, 322, 4800, 29901, 13, 9651, 396, 6760, 1078, 1404, 1203, 411, 2183, 16140, 29889, 13, 9651, 1404, 353, 15585, 403, 29898, 6786, 29922, 6786, 29892, 4800, 29922, 5630, 29897, 13, 9651, 396, 5399, 29879, 565, 4800, 338, 2854, 363, 278, 2183, 1404, 29889, 13, 9651, 565, 1404, 29901, 13, 18884, 396, 4522, 29879, 297, 278, 1404, 29889, 13, 18884, 6464, 29898, 3827, 29892, 1404, 29897, 13, 18884, 396, 317, 1975, 2551, 2643, 304, 1404, 29889, 13, 18884, 7191, 29889, 8698, 29898, 3827, 29892, 376, 3492, 526, 1286, 13817, 297, 23157, 13, 18884, 396, 28937, 963, 304, 278, 3271, 1813, 29889, 13, 18884, 736, 6684, 877, 5184, 1495, 13, 13, 9651, 396, 317, 1975, 1059, 2643, 304, 1404, 363, 8340, 16140, 29889, 13, 9651, 7191, 29889, 2704, 29898, 3827, 29892, 376, 797, 15728, 16140, 29892, 3967, 1449, 23157, 13, 9651, 736, 4050, 29898, 3827, 29892, 525, 23055, 29914, 7507, 29889, 1420, 1495, 13, 13, 4706, 396, 317, 1975, 1059, 2643, 304, 1404, 363, 4069, 4235, 29889, 13, 4706, 7191, 29889, 2704, 29898, 3827, 29892, 376, 12148, 5445, 599, 4235, 23157, 13, 4706, 736, 4050, 29898, 3827, 29892, 525, 23055, 29914, 7507, 29889, 1420, 1495, 13, 13, 13, 29937, 910, 1776, 508, 367, 20592, 871, 1156, 12183, 297, 29889, 13, 1990, 4522, 449, 1043, 29898, 11049, 19347, 29924, 861, 262, 29892, 4533, 1125, 13, 1678, 9995, 4013, 770, 8128, 740, 304, 664, 411, 1480, 449, 1213, 15945, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 1125, 13, 4706, 9995, 3403, 29879, 714, 278, 1857, 1404, 1213, 15945, 13, 13, 4706, 1480, 449, 29898, 3827, 29897, 29871, 396, 4522, 29879, 714, 1857, 1404, 29889, 13, 4706, 396, 317, 1975, 2551, 2643, 304, 1404, 363, 8472, 1480, 449, 29889, 13, 4706, 7191, 29889, 8698, 29898, 3827, 29892, 376, 3492, 505, 8472, 13817, 714, 23157, 13, 4706, 736, 6684, 877, 7507, 1495, 13, 2 ]
tests/test_core/test_graph_objs/test_instantiate_hierarchy.py
wwwidonja/changed_plotly
0
6603
from __future__ import absolute_import from unittest import TestCase import os import importlib import inspect from plotly.basedatatypes import BasePlotlyType, BaseFigure datatypes_root = "new_plotly/graph_objs" datatype_modules = [ dirpath.replace("/", ".") for dirpath, _, _ in os.walk(datatypes_root) if not dirpath.endswith("__pycache__") ] class HierarchyTest(TestCase): def test_construct_datatypes(self): for datatypes_module in datatype_modules: module = importlib.import_module(datatypes_module) for name in getattr(module, "__all__", []): if name.startswith("_") or name[0].islower() or name == "FigureWidget": continue obj = getattr(module, name) try: v = obj() except Exception: print( "Failed to construct {obj} in module {module}".format( obj=obj, module=datatypes_module ) ) raise if obj.__module__ == "new_plotly.graph_objs._deprecations": self.assertTrue(isinstance(v, list) or isinstance(v, dict)) obj() elif name in ("Figure", "FigureWidget"): self.assertIsInstance(v, BaseFigure) else: self.assertIsInstance(v, BasePlotlyType)
[ 1, 515, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 443, 27958, 1053, 4321, 8259, 13, 5215, 2897, 13, 5215, 1053, 1982, 13, 5215, 16096, 13, 13, 3166, 6492, 368, 29889, 6707, 271, 271, 7384, 1053, 7399, 20867, 368, 1542, 29892, 7399, 13080, 545, 13, 13, 4130, 271, 7384, 29918, 4632, 353, 376, 1482, 29918, 5317, 368, 29914, 4262, 29918, 711, 1315, 29908, 13, 4130, 23179, 29918, 7576, 353, 518, 13, 1678, 4516, 2084, 29889, 6506, 11974, 613, 11393, 1159, 13, 1678, 363, 4516, 2084, 29892, 17117, 903, 297, 2897, 29889, 20919, 29898, 4130, 271, 7384, 29918, 4632, 29897, 13, 1678, 565, 451, 4516, 2084, 29889, 1975, 2541, 703, 1649, 2272, 8173, 1649, 1159, 13, 29962, 13, 13, 13, 1990, 12433, 12040, 3057, 29898, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 11433, 29918, 4130, 271, 7384, 29898, 1311, 1125, 13, 4706, 363, 1418, 271, 7384, 29918, 5453, 297, 1418, 23179, 29918, 7576, 29901, 13, 9651, 3883, 353, 1053, 1982, 29889, 5215, 29918, 5453, 29898, 4130, 271, 7384, 29918, 5453, 29897, 13, 9651, 363, 1024, 297, 679, 5552, 29898, 5453, 29892, 376, 1649, 497, 1649, 613, 5159, 1125, 13, 18884, 565, 1024, 29889, 27382, 2541, 703, 29918, 1159, 470, 1024, 29961, 29900, 1822, 275, 13609, 580, 470, 1024, 1275, 376, 13080, 545, 8801, 1115, 13, 462, 1678, 6773, 13, 18884, 5446, 353, 679, 5552, 29898, 5453, 29892, 1024, 29897, 13, 18884, 1018, 29901, 13, 462, 1678, 325, 353, 5446, 580, 13, 18884, 5174, 8960, 29901, 13, 462, 1678, 1596, 29898, 13, 462, 4706, 376, 17776, 304, 3386, 426, 5415, 29913, 297, 3883, 426, 5453, 29913, 1642, 4830, 29898, 13, 462, 9651, 5446, 29922, 5415, 29892, 3883, 29922, 4130, 271, 7384, 29918, 5453, 13, 462, 4706, 1723, 13, 462, 1678, 1723, 13, 462, 1678, 12020, 13, 13, 18884, 565, 5446, 17255, 5453, 1649, 1275, 376, 1482, 29918, 5317, 368, 29889, 4262, 29918, 711, 1315, 3032, 311, 17990, 800, 1115, 13, 462, 1678, 1583, 29889, 9294, 5574, 29898, 275, 8758, 29898, 29894, 29892, 1051, 29897, 470, 338, 8758, 29898, 29894, 29892, 9657, 876, 13, 462, 1678, 5446, 580, 13, 18884, 25342, 1024, 297, 4852, 13080, 545, 613, 376, 13080, 545, 8801, 29908, 1125, 13, 462, 1678, 1583, 29889, 9294, 3624, 4998, 29898, 29894, 29892, 7399, 13080, 545, 29897, 13, 18884, 1683, 29901, 13, 462, 1678, 1583, 29889, 9294, 3624, 4998, 29898, 29894, 29892, 7399, 20867, 368, 1542, 29897, 13, 2 ]
conway.py
cmr/piday-automata
0
179804
from world import World from pygame import draw class Cell(object): def __init__(self, state): self.state = state @classmethod def initial(cls): return Cell(0) def is_alive(self): return self.state == 1 def render(self, x, y, width, surf): col = (0,0,0) if self.state == 1: col = (255, 255, 255) surf.fill(col, (x*width, y*width, width, width)) def toggle(self): if self.state == 1: self.state = 0 else: self.state = 1 def conway(world): w = world.copy() for x, y in w: live = len(filter(Cell.is_alive, w.neighbors(x, y))) if live < 2: # die of under-population world[x, y] = Cell(0) elif live == 2: # no change pass elif live == 3: # reproduce world[x, y] = Cell(1) else: # die of overcrowding world[x, y] = Cell(0)
[ 1, 515, 3186, 1053, 2787, 13, 13, 3166, 22028, 1053, 4216, 13, 13, 1990, 19413, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2106, 1125, 13, 4706, 1583, 29889, 3859, 353, 2106, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 2847, 29898, 25932, 1125, 13, 4706, 736, 19413, 29898, 29900, 29897, 13, 13, 1678, 822, 338, 29918, 284, 573, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 3859, 1275, 29871, 29896, 13, 13, 1678, 822, 4050, 29898, 1311, 29892, 921, 29892, 343, 29892, 2920, 29892, 1190, 29888, 1125, 13, 4706, 784, 353, 313, 29900, 29892, 29900, 29892, 29900, 29897, 13, 13, 4706, 565, 1583, 29889, 3859, 1275, 29871, 29896, 29901, 13, 9651, 784, 353, 313, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 29897, 13, 13, 4706, 1190, 29888, 29889, 5589, 29898, 1054, 29892, 313, 29916, 29930, 2103, 29892, 343, 29930, 2103, 29892, 2920, 29892, 2920, 876, 13, 13, 1678, 822, 20429, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 3859, 1275, 29871, 29896, 29901, 13, 9651, 1583, 29889, 3859, 353, 29871, 29900, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 3859, 353, 29871, 29896, 13, 13, 1753, 378, 1582, 29898, 11526, 1125, 13, 1678, 281, 353, 3186, 29889, 8552, 580, 13, 1678, 363, 921, 29892, 343, 297, 281, 29901, 13, 4706, 5735, 353, 7431, 29898, 4572, 29898, 4617, 29889, 275, 29918, 284, 573, 29892, 281, 29889, 484, 1141, 29890, 943, 29898, 29916, 29892, 343, 4961, 13, 4706, 565, 5735, 529, 29871, 29906, 29901, 13, 9651, 396, 762, 310, 1090, 29899, 7323, 2785, 13, 9651, 3186, 29961, 29916, 29892, 343, 29962, 353, 19413, 29898, 29900, 29897, 13, 4706, 25342, 5735, 1275, 29871, 29906, 29901, 13, 9651, 396, 694, 1735, 13, 9651, 1209, 13, 4706, 25342, 5735, 1275, 29871, 29941, 29901, 13, 9651, 396, 18532, 13, 9651, 3186, 29961, 29916, 29892, 343, 29962, 353, 19413, 29898, 29896, 29897, 13, 4706, 1683, 29901, 13, 9651, 396, 762, 310, 975, 29883, 798, 8497, 13, 9651, 3186, 29961, 29916, 29892, 343, 29962, 353, 19413, 29898, 29900, 29897, 13, 2 ]
ext/ANTsPyNet/antspynet/utilities/mixture_density_utilities.py
tsmonteiro/fmri_proc
2
16131
<reponame>tsmonteiro/fmri_proc<gh_stars>1-10 import keras.backend as K from keras.engine import Layer, InputSpec from keras.layers import Concatenate from keras import initializers import numpy as np import tensorflow as tf import tensorflow_probability as tfp class MixtureDensityLayer(Layer): """ Layer for modeling arbitrary functions using neural networks. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- Layer A keras layer """ def __init__(self, output_dimension, number_of_mixtures, **kwargs): if K.backend() != 'tensorflow': raise ValueError("Tensorflow required as the backend.") self.output_dimension = output_dimension self.number_of_mixtures = number_of_mixtures super(MixtureDensityLayer, self).__init__(**kwargs) def build(self, input_shape): input_dimension = input_shape[-1] units1 = self.output_dimension * self.number_of_mixtures self.mu_kernel = self.add_weight(name="mu_kernel", shape = shape(input_dimension, units1), initializer=initializers.random_normal(), trainable=True) self.mu_bias = self.add_weight(name="mu_bias", shape = shape(units1), initializer=initializers.zeros(), trainable=True) self.sigma_kernel = self.add_weight(name="sigma_kernel", shape = shape(input_dimension, units1), initializer=initializers.random_normal(), trainable=True) self.sigma_bias = self.add_weight(name="sigma_bias", shape = shape(units1), initializer=initializers.zeros(), trainable=True) units2 = self.number_of_mixtures self.pi_kernel = self.add_weight(name="pi_kernel", shape = shape(input_dimension, units2), initializer=initializers.random_normal(), trainable=True) self.pi_bias = self.add_weight(name="pi_bias", shape = shape(units2), initializer=initializers.zeros(), trainable=True) def call(self, inputs, mask=None): # dense layer for mu (mean) of the gaussians mu_output = K.dot(inputs, self.mu_kernel) mu_output = K.bias_add(mu_output, self.mu_bias, data_format='channels_last') # dense layer for sigma (variance) of the gaussians sigma_output = K.dot(inputs, self.sigma_kernel) sigma_output = K.bias_add(sigma_output, self.sigma_bias, data_format='channels_last') # Avoid NaN's by pushing sigma through the following custom activation sigma_output = K.elu(sigma_output) + 1 + K.epsilon() # dense layer for pi (amplitude) of the gaussians pi_output = K.dot( inputs, self.pi_kernel) pi_output = K.bias_add(pi_output, self.pi_bias, data_format='channels_last') output = Concatenate()([mu_output, sigma_output, pi_output], name="mdn_outputs") return(output) def compute_output_shape(input_shape): units = self.number_of_mixtures * (2 * self.output_dimension + 1) return((input_shape[0], units)) def get_config(self): config = {"output_dimension": self.output_dimension, "axis": self.number_of_mixtures} base_config = super(MixtureDensityLayer, self).get_config() return dict(list(base_config.items()) + list(config.items())) def get_mixture_density_loss_function(output_dimension, number_of_mixtures): """ Returns a loss function for the mixture density. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- Function A function providing the mean square error accuracy """ def loss_function(y_true, y_pred): dimension = number_of_mixtures * output_dimension y_pred = tf.reshape(y_pred, [-1, 2 * dimension + number_of_mixtures], name='reshape_ypred_loss') y_true = tf.reshape(y_true, [-1, 2 * dimension + number_of_mixtures], name='reshape_ytrue_loss') output_mu, output_sigma, output_pi = tf.split(y_pred, axis=-1, name='mdn_coef_split', num_or_size_splits=[dimension, dimension, number_of_mixtures]) # Construct the mixture models tfd = tfp.distributions categorical_distribution = tfd.Categorical(logits=output_pi) component_splits = [output_dimension] * number_of_mixtures mu = tf.split(output_mu, num_or_size_splits=component_splits, axis=1) sigma = tf.split(output_sigma, num_or_size_splits=component_splits, axis=1) components = [] for i in range(len(mu)): components.append(tfd.MultivariateNormalDiag(loc = mu[i], scale_diag=sigma[i])) mixture = tfd.Mixture(cat=categorical_distribution, components=components) loss = mixture.log_prob(y_true) loss = tf.negative(loss) loss = tf.reduce_mean(loss) return(loss) with tf.name_scope("MixtureDensityNetwork"): return(loss_function) def get_mixture_density_sampling_function(output_dimension, number_of_mixtures): """ Returns a sampling function for the mixture density. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- Function A function providing the mean square error accuracy """ def sampling_function(y_pred): dimension = number_of_mixtures * output_dimension y_pred = tf.reshape(y_pred, [-1, 2 * dimension + number_of_mixtures], name='reshape_ypred') output_mu, output_sigma, output_pi = tf.split(y_pred, axis=-1, name='mdn_coef_split', num_or_size_splits=[dimension, dimension, number_of_mixtures]) # Construct the mixture models tfd = tfp.distributions categorical_distribution = tfd.Categorical(logits=output_pi) component_splits = [output_dimension] * number_of_mixtures mu = tf.split(output_mu, num_or_size_splits=component_splits, axis=1) sigma = tf.split(output_sigma, num_or_size_splits=component_splits, axis=1) components = [] for i in range(len(mu)): components.append(tfd.MultivariateNormalDiag(loc = mu[i], scale_diag=sigma[i])) mixture = tfd.Mixture(cat=categorical_distribution, components=components) sample = mixture.sample() return(sample) with tf.name_scope("MixtureDensityNetwork"): return(sampling_function) def get_mixture_density_mse_function(output_dimension, number_of_mixtures): """ Returns a mse function for the mixture density. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- Function A function providing the mean square error accuracy """ def mse_accuracy_function(y_true, y_pred): dimension = number_of_mixtures * output_dimension y_pred = tf.reshape(y_pred, [-1, 2 * dimension + number_of_mixtures], name='reshape_ypred_mse') y_true = tf.reshape(y_true, [-1, output_dimension], name='reshape_ytrue_mse') output_mu, output_sigma, output_pi = tf.split(y_pred, axis=-1, name='mdn_coef_split', num_or_size_splits=[dimension, dimension, number_of_mixtures]) # Construct the mixture models tfd = tfp.distributions categorical_distribution = tfd.Categorical(logits=output_pi) component_splits = [output_dimension] * number_of_mixtures mu = tf.split(output_mu, num_or_size_splits=component_splits, axis=1) sigma = tf.split(output_sigma, num_or_size_splits=component_splits, axis=1) components = [] for i in range(len(mu)): components.append(tfd.MultivariateNormalDiag(loc = mu[i], scale_diag=sigma[i])) mixture = tfd.Mixture(cat=categorical_distribution, components=components) sample = mixture.sample() mse = tf.reduce_mean(tf.square(sample-y_true), axis=-1) return(mse) with tf.name_scope("MixtureDensityNetwork"): return(mse_accuracy_function) def split_mixture_parameters(parameters, output_dimension, number_of_mixtures): """ Splits the mixture parameters. Arguments --------- parameters : tuple Parameter to split output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. Returns ------- List of arrays Separate mixture parameters """ dimension = number_of_mixtures * output_dimension mu = parameters[:dimension] sigma = parameters[dimension:(2 * dimension)] pi_logits = parameters[-number_of_mixtures:] return([mu, sigma, pi_logits]) def mixture_density_software_max(logits, temperature=1.0): """ Softmax function for mixture density with temperature adjustment. Arguments --------- logits : list or numpy array input temperature : The temperature for to adjust the distribution (default 1.0) Returns ------- Scalar Softmax loss value. """ e = np.array(logits) / temperature e -= np.max(e) e = np.exp(e) distribution = e / np.sum(e) return(distribution) def sample_from_categorical_distribution(distribution): """ Softmax function for mixture density with temperature adjustment. Arguments --------- distribution : input categorical distribution from which to sample. Returns ------- Scalar A single sample. """ r = np.random.rand(1) accumulate = 0 for i in range(len(distribution)): accumulate += distribution[i] if accumulate >= r: return(i) tf.logging.info('Error: sampling categorical model.') return(-1) def sample_from_output(parameters, output_dimension, number_of_mixtures, temperature=1.0, sigma_temperature=1.0): """ Softmax function for mixture density with temperature adjustment. Arguments --------- output_dimension : integer Dimensionality of the output. number_of_mixtures : integer Number of gaussians used. temperature : The temperature for to adjust the distribution (default 1.0) sigma_temperature : The temperature for to adjust the distribution (default 1.0) Returns ------- Scalar A single sample. """ mu, sigma, pi = split_mixture_parameters(parameters, output_dimension, number_of_mixtures) pi_softmax = mixture_density_software_max(pi, temperature=temperature) m = sample_from_categorical_distribution(pi_softmax) mu_vector = mu[m * output_dimension:(m + 1) * output_dimension] sigma_vector = sigma[m * output_dimension:(m + 1) * output_dimension] * sigma_temperature covariance_matrix = np.identity(output_dimension) * sigma_vector sample = np.random.multivariate_normal(mu_vector, covariance_matrix, 1) return(sample)
[ 1, 529, 276, 1112, 420, 29958, 1372, 3712, 371, 3350, 29914, 24826, 374, 29918, 15439, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 13, 5215, 13023, 294, 29889, 27852, 408, 476, 13, 3166, 13023, 294, 29889, 10599, 1053, 365, 2747, 29892, 10567, 10299, 13, 3166, 13023, 294, 29889, 29277, 1053, 23924, 2579, 403, 13, 3166, 13023, 294, 1053, 2847, 19427, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 26110, 408, 15886, 13, 5215, 26110, 29918, 22795, 3097, 408, 15886, 29886, 13, 13, 1990, 5493, 15546, 29928, 575, 537, 14420, 29898, 14420, 1125, 13, 13, 1678, 9995, 13, 1678, 365, 2747, 363, 1904, 292, 11472, 3168, 773, 19677, 14379, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 13, 1678, 1962, 29918, 6229, 2673, 584, 6043, 13, 4706, 4792, 8180, 537, 310, 278, 1962, 29889, 13, 13, 1678, 1353, 29918, 974, 29918, 2460, 486, 1973, 584, 6043, 13, 4706, 9681, 310, 330, 1485, 1039, 550, 1304, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 365, 2747, 13, 4706, 319, 13023, 294, 7546, 13, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1962, 29918, 6229, 2673, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 29892, 3579, 19290, 1125, 13, 4706, 565, 476, 29889, 27852, 580, 2804, 525, 29056, 2396, 13, 9651, 12020, 7865, 2392, 703, 29911, 6073, 1731, 3734, 408, 278, 14998, 23157, 13, 13, 4706, 1583, 29889, 4905, 29918, 6229, 2673, 353, 1962, 29918, 6229, 2673, 13, 4706, 1583, 29889, 4537, 29918, 974, 29918, 2460, 486, 1973, 353, 1353, 29918, 974, 29918, 2460, 486, 1973, 13, 13, 4706, 2428, 29898, 29924, 29875, 15546, 29928, 575, 537, 14420, 29892, 1583, 467, 1649, 2344, 12035, 1068, 19290, 29897, 13, 13, 1678, 822, 2048, 29898, 1311, 29892, 1881, 29918, 12181, 1125, 13, 13, 4706, 1881, 29918, 6229, 2673, 353, 1881, 29918, 12181, 14352, 29896, 29962, 13, 13, 4706, 10340, 29896, 353, 1583, 29889, 4905, 29918, 6229, 2673, 334, 1583, 29889, 4537, 29918, 974, 29918, 2460, 486, 1973, 13, 13, 4706, 1583, 29889, 2589, 29918, 17460, 353, 1583, 29889, 1202, 29918, 7915, 29898, 978, 543, 2589, 29918, 17460, 613, 13, 462, 462, 308, 8267, 353, 8267, 29898, 2080, 29918, 6229, 2673, 29892, 10340, 29896, 511, 13, 462, 462, 308, 2847, 3950, 29922, 11228, 19427, 29889, 8172, 29918, 8945, 3285, 13, 462, 462, 308, 7945, 519, 29922, 5574, 29897, 13, 4706, 1583, 29889, 2589, 29918, 29890, 3173, 353, 1583, 29889, 1202, 29918, 7915, 29898, 978, 543, 2589, 29918, 29890, 3173, 613, 13, 462, 462, 539, 8267, 353, 8267, 29898, 348, 1169, 29896, 511, 13, 462, 462, 539, 2847, 3950, 29922, 11228, 19427, 29889, 3298, 359, 3285, 13, 462, 462, 539, 7945, 519, 29922, 5574, 29897, 13, 13, 4706, 1583, 29889, 3754, 29918, 17460, 353, 1583, 29889, 1202, 29918, 7915, 29898, 978, 543, 3754, 29918, 17460, 613, 13, 462, 462, 9651, 8267, 353, 8267, 29898, 2080, 29918, 6229, 2673, 29892, 10340, 29896, 511, 13, 462, 462, 9651, 2847, 3950, 29922, 11228, 19427, 29889, 8172, 29918, 8945, 3285, 13, 462, 462, 9651, 7945, 519, 29922, 5574, 29897, 13, 4706, 1583, 29889, 3754, 29918, 29890, 3173, 353, 1583, 29889, 1202, 29918, 7915, 29898, 978, 543, 3754, 29918, 29890, 3173, 613, 13, 462, 462, 3986, 8267, 353, 8267, 29898, 348, 1169, 29896, 511, 13, 462, 462, 3986, 2847, 3950, 29922, 11228, 19427, 29889, 3298, 359, 3285, 13, 462, 462, 3986, 7945, 519, 29922, 5574, 29897, 13, 13, 4706, 10340, 29906, 353, 1583, 29889, 4537, 29918, 974, 29918, 2460, 486, 1973, 13, 13, 4706, 1583, 29889, 1631, 29918, 17460, 353, 1583, 29889, 1202, 29918, 7915, 29898, 978, 543, 1631, 29918, 17460, 613, 13, 462, 462, 308, 8267, 353, 8267, 29898, 2080, 29918, 6229, 2673, 29892, 10340, 29906, 511, 13, 462, 462, 308, 2847, 3950, 29922, 11228, 19427, 29889, 8172, 29918, 8945, 3285, 13, 462, 462, 308, 7945, 519, 29922, 5574, 29897, 13, 4706, 1583, 29889, 1631, 29918, 29890, 3173, 353, 1583, 29889, 1202, 29918, 7915, 29898, 978, 543, 1631, 29918, 29890, 3173, 613, 13, 462, 462, 539, 8267, 353, 8267, 29898, 348, 1169, 29906, 511, 13, 462, 462, 539, 2847, 3950, 29922, 11228, 19427, 29889, 3298, 359, 3285, 13, 462, 462, 539, 7945, 519, 29922, 5574, 29897, 13, 13, 1678, 822, 1246, 29898, 1311, 29892, 10970, 29892, 11105, 29922, 8516, 1125, 13, 13, 4706, 396, 20619, 7546, 363, 3887, 313, 12676, 29897, 310, 278, 330, 1485, 1039, 550, 13, 4706, 3887, 29918, 4905, 353, 476, 29889, 6333, 29898, 2080, 29879, 29892, 1583, 29889, 2589, 29918, 17460, 29897, 13, 4706, 3887, 29918, 4905, 353, 476, 29889, 29890, 3173, 29918, 1202, 29898, 2589, 29918, 4905, 29892, 1583, 29889, 2589, 29918, 29890, 3173, 29892, 848, 29918, 4830, 2433, 305, 12629, 29918, 4230, 1495, 13, 13, 4706, 396, 20619, 7546, 363, 269, 2934, 313, 1707, 8837, 29897, 310, 278, 330, 1485, 1039, 550, 13, 4706, 269, 2934, 29918, 4905, 353, 476, 29889, 6333, 29898, 2080, 29879, 29892, 1583, 29889, 3754, 29918, 17460, 29897, 13, 4706, 269, 2934, 29918, 4905, 353, 476, 29889, 29890, 3173, 29918, 1202, 29898, 3754, 29918, 4905, 29892, 1583, 29889, 3754, 29918, 29890, 3173, 29892, 848, 29918, 4830, 2433, 305, 12629, 29918, 4230, 1495, 13, 13, 4706, 396, 319, 5405, 18780, 29915, 29879, 491, 27556, 269, 2934, 1549, 278, 1494, 2888, 26229, 13, 4706, 269, 2934, 29918, 4905, 353, 476, 29889, 295, 29884, 29898, 3754, 29918, 4905, 29897, 718, 29871, 29896, 718, 476, 29889, 5463, 580, 13, 13, 4706, 396, 20619, 7546, 363, 2930, 313, 314, 2830, 1151, 29897, 310, 278, 330, 1485, 1039, 550, 13, 4706, 2930, 29918, 4905, 353, 476, 29889, 6333, 29898, 10970, 29892, 1583, 29889, 1631, 29918, 17460, 29897, 13, 4706, 2930, 29918, 4905, 353, 476, 29889, 29890, 3173, 29918, 1202, 29898, 1631, 29918, 4905, 29892, 1583, 29889, 1631, 29918, 29890, 3173, 29892, 848, 29918, 4830, 2433, 305, 12629, 29918, 4230, 1495, 13, 13, 4706, 1962, 353, 23924, 2579, 403, 580, 4197, 2589, 29918, 4905, 29892, 269, 2934, 29918, 4905, 29892, 2930, 29918, 4905, 1402, 1024, 543, 3487, 29876, 29918, 4905, 29879, 1159, 13, 4706, 736, 29898, 4905, 29897, 13, 13, 1678, 822, 10272, 29918, 4905, 29918, 12181, 29898, 2080, 29918, 12181, 1125, 13, 4706, 10340, 353, 1583, 29889, 4537, 29918, 974, 29918, 2460, 486, 1973, 334, 313, 29906, 334, 1583, 29889, 4905, 29918, 6229, 2673, 718, 29871, 29896, 29897, 13, 4706, 736, 3552, 2080, 29918, 12181, 29961, 29900, 1402, 10340, 876, 13, 13, 1678, 822, 679, 29918, 2917, 29898, 1311, 1125, 13, 4706, 2295, 353, 8853, 4905, 29918, 6229, 2673, 1115, 1583, 29889, 4905, 29918, 6229, 2673, 29892, 13, 462, 29871, 376, 8990, 1115, 1583, 29889, 4537, 29918, 974, 29918, 2460, 486, 1973, 29913, 13, 4706, 2967, 29918, 2917, 353, 2428, 29898, 29924, 29875, 15546, 29928, 575, 537, 14420, 29892, 1583, 467, 657, 29918, 2917, 580, 13, 4706, 736, 9657, 29898, 1761, 29898, 3188, 29918, 2917, 29889, 7076, 3101, 718, 1051, 29898, 2917, 29889, 7076, 22130, 13, 13, 1753, 679, 29918, 2460, 15546, 29918, 21518, 537, 29918, 6758, 29918, 2220, 29898, 4905, 29918, 6229, 2673, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 1125, 13, 13, 1678, 9995, 13, 1678, 16969, 263, 6410, 740, 363, 278, 29544, 9027, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 13, 1678, 1962, 29918, 6229, 2673, 584, 6043, 13, 4706, 4792, 8180, 537, 310, 278, 1962, 29889, 13, 13, 1678, 1353, 29918, 974, 29918, 2460, 486, 1973, 584, 6043, 13, 4706, 9681, 310, 330, 1485, 1039, 550, 1304, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 6680, 13, 4706, 319, 740, 13138, 278, 2099, 6862, 1059, 13600, 13, 13, 1678, 9995, 13, 13, 1678, 822, 6410, 29918, 2220, 29898, 29891, 29918, 3009, 29892, 343, 29918, 11965, 1125, 13, 13, 4706, 9927, 353, 1353, 29918, 974, 29918, 2460, 486, 1973, 334, 1962, 29918, 6229, 2673, 13, 13, 4706, 343, 29918, 11965, 353, 15886, 29889, 690, 14443, 29898, 29891, 29918, 11965, 29892, 21069, 29896, 29892, 29871, 29906, 334, 9927, 718, 1353, 29918, 974, 29918, 2460, 486, 1973, 1402, 13, 462, 9651, 1024, 2433, 690, 14443, 29918, 1478, 1127, 29918, 6758, 1495, 13, 4706, 343, 29918, 3009, 353, 15886, 29889, 690, 14443, 29898, 29891, 29918, 3009, 29892, 21069, 29896, 29892, 29871, 29906, 334, 9927, 718, 1353, 29918, 974, 29918, 2460, 486, 1973, 1402, 13, 462, 9651, 1024, 2433, 690, 14443, 29918, 29891, 3009, 29918, 6758, 1495, 13, 13, 4706, 1962, 29918, 2589, 29892, 1962, 29918, 3754, 29892, 1962, 29918, 1631, 353, 15886, 29889, 5451, 29898, 29891, 29918, 11965, 29892, 9685, 10457, 29896, 29892, 1024, 2433, 3487, 29876, 29918, 1111, 1389, 29918, 5451, 742, 13, 462, 259, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 11759, 6229, 2673, 29892, 9927, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 2314, 13, 13, 4706, 396, 1281, 4984, 278, 29544, 4733, 13, 13, 4706, 260, 11512, 353, 15886, 29886, 29889, 27691, 29879, 13, 13, 4706, 11608, 936, 29918, 27691, 353, 260, 11512, 29889, 29907, 20440, 936, 29898, 1188, 1169, 29922, 4905, 29918, 1631, 29897, 13, 4706, 4163, 29918, 23579, 1169, 353, 518, 4905, 29918, 6229, 2673, 29962, 334, 1353, 29918, 974, 29918, 2460, 486, 1973, 13, 4706, 3887, 353, 15886, 29889, 5451, 29898, 4905, 29918, 2589, 29892, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 29922, 9700, 29918, 23579, 1169, 29892, 9685, 29922, 29896, 29897, 13, 4706, 269, 2934, 353, 15886, 29889, 5451, 29898, 4905, 29918, 3754, 29892, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 29922, 9700, 29918, 23579, 1169, 29892, 9685, 29922, 29896, 29897, 13, 13, 4706, 7117, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 2589, 22164, 13, 9651, 7117, 29889, 4397, 29898, 29873, 11512, 29889, 6857, 27432, 403, 19077, 12130, 351, 29898, 2029, 353, 3887, 29961, 29875, 1402, 6287, 29918, 6051, 351, 29922, 3754, 29961, 29875, 12622, 13, 13, 4706, 29544, 353, 260, 11512, 29889, 29924, 29875, 15546, 29898, 4117, 29922, 29883, 20440, 936, 29918, 27691, 29892, 7117, 29922, 14036, 29897, 13, 13, 4706, 6410, 353, 29544, 29889, 1188, 29918, 22795, 29898, 29891, 29918, 3009, 29897, 13, 4706, 6410, 353, 15886, 29889, 22198, 29898, 6758, 29897, 13, 4706, 6410, 353, 15886, 29889, 17469, 29918, 12676, 29898, 6758, 29897, 13, 13, 4706, 736, 29898, 6758, 29897, 13, 13, 1678, 411, 15886, 29889, 978, 29918, 6078, 703, 29924, 29875, 15546, 29928, 575, 537, 13724, 29908, 1125, 13, 4706, 736, 29898, 6758, 29918, 2220, 29897, 13, 13, 1753, 679, 29918, 2460, 15546, 29918, 21518, 537, 29918, 13445, 10335, 29918, 2220, 29898, 4905, 29918, 6229, 2673, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 1125, 13, 13, 1678, 9995, 13, 1678, 16969, 263, 23460, 740, 363, 278, 29544, 9027, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 13, 1678, 1962, 29918, 6229, 2673, 584, 6043, 13, 4706, 4792, 8180, 537, 310, 278, 1962, 29889, 13, 13, 1678, 1353, 29918, 974, 29918, 2460, 486, 1973, 584, 6043, 13, 4706, 9681, 310, 330, 1485, 1039, 550, 1304, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 6680, 13, 4706, 319, 740, 13138, 278, 2099, 6862, 1059, 13600, 13, 13, 1678, 9995, 13, 13, 1678, 822, 23460, 29918, 2220, 29898, 29891, 29918, 11965, 1125, 13, 13, 4706, 9927, 353, 1353, 29918, 974, 29918, 2460, 486, 1973, 334, 1962, 29918, 6229, 2673, 13, 13, 4706, 343, 29918, 11965, 353, 15886, 29889, 690, 14443, 29898, 29891, 29918, 11965, 29892, 21069, 29896, 29892, 29871, 29906, 334, 9927, 718, 1353, 29918, 974, 29918, 2460, 486, 1973, 1402, 13, 462, 9651, 1024, 2433, 690, 14443, 29918, 1478, 1127, 1495, 13, 13, 4706, 1962, 29918, 2589, 29892, 1962, 29918, 3754, 29892, 1962, 29918, 1631, 353, 15886, 29889, 5451, 29898, 29891, 29918, 11965, 29892, 9685, 10457, 29896, 29892, 1024, 2433, 3487, 29876, 29918, 1111, 1389, 29918, 5451, 742, 13, 462, 259, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 11759, 6229, 2673, 29892, 9927, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 2314, 13, 13, 4706, 396, 1281, 4984, 278, 29544, 4733, 13, 13, 4706, 260, 11512, 353, 15886, 29886, 29889, 27691, 29879, 13, 13, 4706, 11608, 936, 29918, 27691, 353, 260, 11512, 29889, 29907, 20440, 936, 29898, 1188, 1169, 29922, 4905, 29918, 1631, 29897, 13, 4706, 4163, 29918, 23579, 1169, 353, 518, 4905, 29918, 6229, 2673, 29962, 334, 1353, 29918, 974, 29918, 2460, 486, 1973, 13, 4706, 3887, 353, 15886, 29889, 5451, 29898, 4905, 29918, 2589, 29892, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 29922, 9700, 29918, 23579, 1169, 29892, 9685, 29922, 29896, 29897, 13, 4706, 269, 2934, 353, 15886, 29889, 5451, 29898, 4905, 29918, 3754, 29892, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 29922, 9700, 29918, 23579, 1169, 29892, 9685, 29922, 29896, 29897, 13, 13, 4706, 7117, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 2589, 22164, 13, 9651, 7117, 29889, 4397, 29898, 29873, 11512, 29889, 6857, 27432, 403, 19077, 12130, 351, 29898, 2029, 353, 3887, 29961, 29875, 1402, 6287, 29918, 6051, 351, 29922, 3754, 29961, 29875, 12622, 13, 13, 4706, 29544, 353, 260, 11512, 29889, 29924, 29875, 15546, 29898, 4117, 29922, 29883, 20440, 936, 29918, 27691, 29892, 7117, 29922, 14036, 29897, 13, 13, 4706, 4559, 353, 29544, 29889, 11249, 580, 13, 13, 4706, 736, 29898, 11249, 29897, 13, 13, 1678, 411, 15886, 29889, 978, 29918, 6078, 703, 29924, 29875, 15546, 29928, 575, 537, 13724, 29908, 1125, 13, 4706, 736, 29898, 13445, 10335, 29918, 2220, 29897, 13, 13, 13, 1753, 679, 29918, 2460, 15546, 29918, 21518, 537, 29918, 29885, 344, 29918, 2220, 29898, 4905, 29918, 6229, 2673, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 1125, 13, 13, 1678, 9995, 13, 1678, 16969, 263, 286, 344, 740, 363, 278, 29544, 9027, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 13, 1678, 1962, 29918, 6229, 2673, 584, 6043, 13, 4706, 4792, 8180, 537, 310, 278, 1962, 29889, 13, 13, 1678, 1353, 29918, 974, 29918, 2460, 486, 1973, 584, 6043, 13, 4706, 9681, 310, 330, 1485, 1039, 550, 1304, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 6680, 13, 4706, 319, 740, 13138, 278, 2099, 6862, 1059, 13600, 13, 13, 1678, 9995, 13, 13, 1678, 822, 286, 344, 29918, 562, 2764, 4135, 29918, 2220, 29898, 29891, 29918, 3009, 29892, 343, 29918, 11965, 1125, 13, 13, 4706, 9927, 353, 1353, 29918, 974, 29918, 2460, 486, 1973, 334, 1962, 29918, 6229, 2673, 13, 13, 4706, 343, 29918, 11965, 353, 15886, 29889, 690, 14443, 29898, 29891, 29918, 11965, 29892, 21069, 29896, 29892, 29871, 29906, 334, 9927, 718, 1353, 29918, 974, 29918, 2460, 486, 1973, 1402, 13, 462, 9651, 1024, 2433, 690, 14443, 29918, 1478, 1127, 29918, 29885, 344, 1495, 13, 4706, 343, 29918, 3009, 353, 15886, 29889, 690, 14443, 29898, 29891, 29918, 3009, 29892, 21069, 29896, 29892, 1962, 29918, 6229, 2673, 1402, 13, 462, 9651, 1024, 2433, 690, 14443, 29918, 29891, 3009, 29918, 29885, 344, 1495, 13, 13, 4706, 1962, 29918, 2589, 29892, 1962, 29918, 3754, 29892, 1962, 29918, 1631, 353, 15886, 29889, 5451, 29898, 29891, 29918, 11965, 29892, 9685, 10457, 29896, 29892, 1024, 2433, 3487, 29876, 29918, 1111, 1389, 29918, 5451, 742, 13, 462, 259, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 11759, 6229, 2673, 29892, 9927, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 2314, 13, 13, 4706, 396, 1281, 4984, 278, 29544, 4733, 13, 13, 4706, 260, 11512, 353, 15886, 29886, 29889, 27691, 29879, 13, 13, 4706, 11608, 936, 29918, 27691, 353, 260, 11512, 29889, 29907, 20440, 936, 29898, 1188, 1169, 29922, 4905, 29918, 1631, 29897, 13, 4706, 4163, 29918, 23579, 1169, 353, 518, 4905, 29918, 6229, 2673, 29962, 334, 1353, 29918, 974, 29918, 2460, 486, 1973, 13, 4706, 3887, 353, 15886, 29889, 5451, 29898, 4905, 29918, 2589, 29892, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 29922, 9700, 29918, 23579, 1169, 29892, 9685, 29922, 29896, 29897, 13, 4706, 269, 2934, 353, 15886, 29889, 5451, 29898, 4905, 29918, 3754, 29892, 954, 29918, 272, 29918, 2311, 29918, 23579, 1169, 29922, 9700, 29918, 23579, 1169, 29892, 9685, 29922, 29896, 29897, 13, 13, 4706, 7117, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 2589, 22164, 13, 9651, 7117, 29889, 4397, 29898, 29873, 11512, 29889, 6857, 27432, 403, 19077, 12130, 351, 29898, 2029, 353, 3887, 29961, 29875, 1402, 6287, 29918, 6051, 351, 29922, 3754, 29961, 29875, 12622, 13, 13, 4706, 29544, 353, 260, 11512, 29889, 29924, 29875, 15546, 29898, 4117, 29922, 29883, 20440, 936, 29918, 27691, 29892, 7117, 29922, 14036, 29897, 13, 13, 4706, 4559, 353, 29544, 29889, 11249, 580, 13, 4706, 286, 344, 353, 15886, 29889, 17469, 29918, 12676, 29898, 13264, 29889, 17619, 29898, 11249, 29899, 29891, 29918, 3009, 511, 9685, 10457, 29896, 29897, 13, 13, 4706, 736, 29898, 29885, 344, 29897, 13, 13, 1678, 411, 15886, 29889, 978, 29918, 6078, 703, 29924, 29875, 15546, 29928, 575, 537, 13724, 29908, 1125, 13, 4706, 736, 29898, 29885, 344, 29918, 562, 2764, 4135, 29918, 2220, 29897, 13, 13, 1753, 6219, 29918, 2460, 15546, 29918, 16744, 29898, 16744, 29892, 1962, 29918, 6229, 2673, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 1125, 13, 13, 1678, 9995, 13, 1678, 317, 572, 1169, 278, 29544, 4128, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 13, 13, 1678, 4128, 584, 18761, 13, 4706, 24953, 304, 6219, 13, 13, 1678, 1962, 29918, 6229, 2673, 584, 6043, 13, 4706, 4792, 8180, 537, 310, 278, 1962, 29889, 13, 13, 1678, 1353, 29918, 974, 29918, 2460, 486, 1973, 584, 6043, 13, 4706, 9681, 310, 330, 1485, 1039, 550, 1304, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 2391, 310, 7049, 13, 4706, 922, 862, 403, 29544, 4128, 13, 13, 1678, 9995, 13, 13, 1678, 9927, 353, 1353, 29918, 974, 29918, 2460, 486, 1973, 334, 1962, 29918, 6229, 2673, 13, 1678, 3887, 353, 4128, 7503, 6229, 2673, 29962, 13, 1678, 269, 2934, 353, 4128, 29961, 6229, 2673, 5919, 29906, 334, 9927, 4638, 13, 1678, 2930, 29918, 1188, 1169, 353, 4128, 14352, 4537, 29918, 974, 29918, 2460, 486, 1973, 17531, 13, 1678, 736, 4197, 2589, 29892, 269, 2934, 29892, 2930, 29918, 1188, 1169, 2314, 13, 13, 1753, 29544, 29918, 21518, 537, 29918, 20415, 29918, 3317, 29898, 1188, 1169, 29892, 10430, 29922, 29896, 29889, 29900, 1125, 13, 13, 1678, 9995, 13, 1678, 1105, 615, 3317, 740, 363, 29544, 9027, 411, 10430, 10365, 358, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 13, 13, 1678, 1480, 1169, 584, 1051, 470, 12655, 1409, 13, 4706, 1881, 13, 13, 1678, 10430, 584, 13, 4706, 450, 10430, 363, 304, 10365, 278, 4978, 313, 4381, 29871, 29896, 29889, 29900, 29897, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 317, 1052, 279, 13, 4706, 1105, 615, 3317, 6410, 995, 29889, 13, 13, 1678, 9995, 13, 13, 1678, 321, 353, 7442, 29889, 2378, 29898, 1188, 1169, 29897, 847, 10430, 13, 1678, 321, 22361, 7442, 29889, 3317, 29898, 29872, 29897, 13, 1678, 321, 353, 7442, 29889, 4548, 29898, 29872, 29897, 13, 13, 1678, 4978, 353, 321, 847, 7442, 29889, 2083, 29898, 29872, 29897, 13, 13, 1678, 736, 29898, 27691, 29897, 13, 13, 1753, 4559, 29918, 3166, 29918, 29883, 20440, 936, 29918, 27691, 29898, 27691, 1125, 13, 13, 1678, 9995, 13, 1678, 1105, 615, 3317, 740, 363, 29544, 9027, 411, 10430, 10365, 358, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 13, 13, 1678, 4978, 584, 13, 4706, 1881, 11608, 936, 4978, 515, 607, 304, 4559, 29889, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 317, 1052, 279, 13, 4706, 319, 2323, 4559, 29889, 13, 13, 1678, 9995, 13, 13, 1678, 364, 353, 7442, 29889, 8172, 29889, 9502, 29898, 29896, 29897, 13, 13, 1678, 18414, 5987, 353, 29871, 29900, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 27691, 22164, 13, 4706, 18414, 5987, 4619, 4978, 29961, 29875, 29962, 13, 4706, 565, 18414, 5987, 6736, 364, 29901, 13, 9651, 736, 29898, 29875, 29897, 13, 13, 1678, 15886, 29889, 21027, 29889, 3888, 877, 2392, 29901, 23460, 11608, 936, 1904, 29889, 1495, 13, 1678, 736, 6278, 29896, 29897, 13, 13, 1753, 4559, 29918, 3166, 29918, 4905, 29898, 16744, 29892, 1962, 29918, 6229, 2673, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 29892, 13, 462, 539, 10430, 29922, 29896, 29889, 29900, 29892, 269, 2934, 29918, 12863, 1535, 29922, 29896, 29889, 29900, 1125, 13, 13, 1678, 9995, 13, 1678, 1105, 615, 3317, 740, 363, 29544, 9027, 411, 10430, 10365, 358, 29889, 13, 13, 1678, 11842, 9331, 13, 1678, 448, 1378, 13, 1678, 1962, 29918, 6229, 2673, 584, 6043, 13, 4706, 4792, 8180, 537, 310, 278, 1962, 29889, 13, 13, 1678, 1353, 29918, 974, 29918, 2460, 486, 1973, 584, 6043, 13, 4706, 9681, 310, 330, 1485, 1039, 550, 1304, 29889, 13, 13, 1678, 10430, 584, 13, 4706, 450, 10430, 363, 304, 10365, 278, 4978, 313, 4381, 29871, 29896, 29889, 29900, 29897, 13, 13, 1678, 269, 2934, 29918, 12863, 1535, 584, 13, 4706, 450, 10430, 363, 304, 10365, 278, 4978, 313, 4381, 29871, 29896, 29889, 29900, 29897, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 317, 1052, 279, 13, 4706, 319, 2323, 4559, 29889, 13, 13, 1678, 9995, 13, 13, 1678, 3887, 29892, 269, 2934, 29892, 2930, 353, 6219, 29918, 2460, 15546, 29918, 16744, 29898, 16744, 29892, 1962, 29918, 6229, 2673, 29892, 1353, 29918, 974, 29918, 2460, 486, 1973, 29897, 13, 1678, 2930, 29918, 2695, 3317, 353, 29544, 29918, 21518, 537, 29918, 20415, 29918, 3317, 29898, 1631, 29892, 10430, 29922, 12863, 1535, 29897, 13, 1678, 286, 353, 4559, 29918, 3166, 29918, 29883, 20440, 936, 29918, 27691, 29898, 1631, 29918, 2695, 3317, 29897, 13, 13, 1678, 3887, 29918, 8111, 353, 3887, 29961, 29885, 334, 1962, 29918, 6229, 2673, 5919, 29885, 718, 29871, 29896, 29897, 334, 1962, 29918, 6229, 2673, 29962, 13, 1678, 269, 2934, 29918, 8111, 353, 269, 2934, 29961, 29885, 334, 1962, 29918, 6229, 2673, 5919, 29885, 718, 29871, 29896, 29897, 334, 1962, 29918, 6229, 2673, 29962, 334, 269, 2934, 29918, 12863, 1535, 13, 1678, 18838, 279, 8837, 29918, 5344, 353, 7442, 29889, 22350, 29898, 4905, 29918, 6229, 2673, 29897, 334, 269, 2934, 29918, 8111, 13, 1678, 4559, 353, 7442, 29889, 8172, 29889, 4713, 27432, 403, 29918, 8945, 29898, 2589, 29918, 8111, 29892, 18838, 279, 8837, 29918, 5344, 29892, 29871, 29896, 29897, 13, 1678, 736, 29898, 11249, 29897, 13, 2 ]
tests.py
hephzaron/EMG_ANN
0
124462
<reponame>hephzaron/EMG_ANN<gh_stars>0 import unittest from tests.dataloader import DataloaderTestCase scale_test_suite = unittest.TestSuite([ unittest.TestLoader().loadTestsFromTestCase(DataloaderTestCase) ]) def test_scale_suite(): result = unittest.TestResult() runner = unittest.TextTestRunner() print(runner.run(scale_test_suite)) if __name__ == '__main__': test_scale_suite()
[ 1, 529, 276, 1112, 420, 29958, 354, 561, 29920, 5022, 29914, 12665, 29954, 29918, 2190, 29940, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 443, 27958, 13, 13, 3166, 6987, 29889, 29881, 2075, 29877, 1664, 1053, 360, 2075, 29877, 1664, 3057, 8259, 13, 13, 7052, 29918, 1688, 29918, 13495, 353, 443, 27958, 29889, 3057, 5091, 568, 4197, 13, 1678, 443, 27958, 29889, 3057, 10036, 2141, 1359, 24376, 4591, 3057, 8259, 29898, 29928, 2075, 29877, 1664, 3057, 8259, 29897, 13, 268, 2314, 13, 13, 1753, 1243, 29918, 7052, 29918, 13495, 7295, 13, 1678, 1121, 353, 443, 27958, 29889, 3057, 3591, 580, 13, 1678, 28877, 353, 443, 27958, 29889, 1626, 3057, 16802, 580, 13, 1678, 1596, 29898, 27492, 29889, 3389, 29898, 7052, 29918, 1688, 29918, 13495, 876, 13, 268, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1243, 29918, 7052, 29918, 13495, 580, 2 ]
tests/test.py
speer-kinjo/ro.py
28
162599
<gh_stars>10-100 """ Tests ro.py functionality. It is not possible to fully test ro.py as it relies on external conditions, so this test mostly checks parity and cannot be fully relied upon. Certain methods have been intentionally left out. """ import os import asyncio from typing import Optional from loguru import logger from roblox import Client from roblox.users import User from roblox.utilities.exceptions import Unauthorized client = Client(os.getenv("ROBLOX_TOKEN")) async def test_user_id(user_id: int): """ Tests get_users, get_user, and get_base_user on this user ID. """ user = await client.get_user(user_id) alt_user = (await client.get_users([user_id]))[0] base_user = client.get_base_user(user_id) return user.id == alt_user.id == base_user.id async def test_user_id_name(user_id: int): """ Tests to see if get_user(user.id) == get_user_by_username(user.name) """ user = await client.get_user(user_id) user2 = await client.get_user_by_username(user.name) return user.id == user2.id async def test_user_name_id(name: str): """ Tests to see if get_user(user.id) == get_user_by_username(user.name) in reverse """ user = await client.get_user_by_username(name) user2 = await client.get_user(user.id) return user.id == user2.id async def main(): """ 🥺 """ # set up basic authentication is_authenticated: bool = False authenticated_user: Optional[User] try: authenticated_user = await client.get_authenticated_user() except Unauthorized: authenticated_user = None if authenticated_user: is_authenticated = True # basic logging if not is_authenticated: logger.warning("Not all checks can complete because ro.py can't authenticate.") # users assert await test_user_id(1) # Roblox assert await test_user_id(2) # <NAME> assert await test_user_id(3) # <NAME> assert await test_user_id(968108160) # jmk (@local_ip) assert await test_user_id(111179700) # Iron_Legion assert await test_user_id_name(1) assert await test_user_id_name(2) assert await test_user_id_name(3) assert await test_user_name_id("Roblox") assert await test_user_name_id("<NAME>") assert await test_user_name_id("<NAME>") assert await test_user_name_id("local_ip") assert await test_user_name_id("Iron_Legion") if __name__ == '__main__': asyncio.get_event_loop().run_until_complete(main())
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29900, 29899, 29896, 29900, 29900, 13, 15945, 29908, 13, 13, 24376, 696, 29889, 2272, 9863, 29889, 13, 3112, 338, 451, 1950, 304, 8072, 1243, 696, 29889, 2272, 408, 372, 337, 3687, 373, 7029, 5855, 29892, 577, 445, 1243, 11149, 12747, 610, 537, 322, 2609, 13, 915, 8072, 337, 2957, 2501, 29889, 315, 13946, 3519, 505, 1063, 16392, 635, 2175, 714, 29889, 13, 13, 15945, 29908, 13, 13, 5215, 2897, 13, 5215, 408, 948, 3934, 13, 13, 3166, 19229, 1053, 28379, 13, 13, 3166, 1480, 20144, 1053, 17927, 13, 13, 3166, 10832, 417, 29916, 1053, 12477, 13, 3166, 10832, 417, 29916, 29889, 7193, 1053, 4911, 13, 3166, 10832, 417, 29916, 29889, 4422, 1907, 29889, 11739, 29879, 1053, 853, 8921, 1891, 13, 13, 4645, 353, 12477, 29898, 359, 29889, 657, 6272, 703, 1672, 29933, 3927, 29990, 29918, 4986, 29968, 1430, 5783, 13, 13, 13, 12674, 822, 1243, 29918, 1792, 29918, 333, 29898, 1792, 29918, 333, 29901, 938, 1125, 13, 1678, 9995, 13, 1678, 4321, 29879, 679, 29918, 7193, 29892, 679, 29918, 1792, 29892, 322, 679, 29918, 3188, 29918, 1792, 373, 445, 1404, 3553, 29889, 13, 1678, 9995, 13, 1678, 1404, 353, 7272, 3132, 29889, 657, 29918, 1792, 29898, 1792, 29918, 333, 29897, 13, 1678, 5272, 29918, 1792, 353, 313, 20675, 3132, 29889, 657, 29918, 7193, 4197, 1792, 29918, 333, 12622, 29961, 29900, 29962, 13, 1678, 2967, 29918, 1792, 353, 3132, 29889, 657, 29918, 3188, 29918, 1792, 29898, 1792, 29918, 333, 29897, 13, 1678, 736, 1404, 29889, 333, 1275, 5272, 29918, 1792, 29889, 333, 1275, 2967, 29918, 1792, 29889, 333, 13, 13, 13, 12674, 822, 1243, 29918, 1792, 29918, 333, 29918, 978, 29898, 1792, 29918, 333, 29901, 938, 1125, 13, 1678, 9995, 13, 1678, 4321, 29879, 304, 1074, 565, 679, 29918, 1792, 29898, 1792, 29889, 333, 29897, 1275, 679, 29918, 1792, 29918, 1609, 29918, 6786, 29898, 1792, 29889, 978, 29897, 13, 1678, 9995, 13, 1678, 1404, 353, 7272, 3132, 29889, 657, 29918, 1792, 29898, 1792, 29918, 333, 29897, 13, 1678, 1404, 29906, 353, 7272, 3132, 29889, 657, 29918, 1792, 29918, 1609, 29918, 6786, 29898, 1792, 29889, 978, 29897, 13, 1678, 736, 1404, 29889, 333, 1275, 1404, 29906, 29889, 333, 13, 13, 13, 12674, 822, 1243, 29918, 1792, 29918, 978, 29918, 333, 29898, 978, 29901, 851, 1125, 13, 1678, 9995, 13, 1678, 4321, 29879, 304, 1074, 565, 679, 29918, 1792, 29898, 1792, 29889, 333, 29897, 1275, 679, 29918, 1792, 29918, 1609, 29918, 6786, 29898, 1792, 29889, 978, 29897, 297, 11837, 13, 1678, 9995, 13, 1678, 1404, 353, 7272, 3132, 29889, 657, 29918, 1792, 29918, 1609, 29918, 6786, 29898, 978, 29897, 13, 1678, 1404, 29906, 353, 7272, 3132, 29889, 657, 29918, 1792, 29898, 1792, 29889, 333, 29897, 13, 1678, 736, 1404, 29889, 333, 1275, 1404, 29906, 29889, 333, 13, 13, 13, 12674, 822, 1667, 7295, 13, 1678, 9995, 13, 268, 243, 162, 168, 189, 13, 1678, 9995, 13, 1678, 396, 731, 701, 6996, 10760, 13, 1678, 338, 29918, 27218, 630, 29901, 6120, 353, 7700, 13, 1678, 15585, 630, 29918, 1792, 29901, 28379, 29961, 2659, 29962, 13, 13, 1678, 1018, 29901, 13, 4706, 15585, 630, 29918, 1792, 353, 7272, 3132, 29889, 657, 29918, 27218, 630, 29918, 1792, 580, 13, 1678, 5174, 853, 8921, 1891, 29901, 13, 4706, 15585, 630, 29918, 1792, 353, 6213, 13, 13, 1678, 565, 15585, 630, 29918, 1792, 29901, 13, 4706, 338, 29918, 27218, 630, 353, 5852, 13, 13, 1678, 396, 6996, 12183, 13, 1678, 565, 451, 338, 29918, 27218, 630, 29901, 13, 4706, 17927, 29889, 27392, 703, 3664, 599, 12747, 508, 4866, 1363, 696, 29889, 2272, 508, 29915, 29873, 15585, 403, 23157, 13, 13, 1678, 396, 4160, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 333, 29898, 29896, 29897, 29871, 396, 6417, 417, 29916, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 333, 29898, 29906, 29897, 29871, 396, 529, 5813, 29958, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 333, 29898, 29941, 29897, 29871, 396, 529, 5813, 29958, 13, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 333, 29898, 29929, 29953, 29947, 29896, 29900, 29947, 29896, 29953, 29900, 29897, 29871, 396, 432, 11256, 20164, 2997, 29918, 666, 29897, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 333, 29898, 29896, 29896, 29896, 29896, 29955, 29929, 29955, 29900, 29900, 29897, 29871, 396, 20492, 29918, 22988, 291, 13, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 333, 29918, 978, 29898, 29896, 29897, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 333, 29918, 978, 29898, 29906, 29897, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 333, 29918, 978, 29898, 29941, 29897, 13, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 978, 29918, 333, 703, 21860, 417, 29916, 1159, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 978, 29918, 333, 28945, 5813, 29958, 1159, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 978, 29918, 333, 28945, 5813, 29958, 1159, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 978, 29918, 333, 703, 2997, 29918, 666, 1159, 13, 1678, 4974, 7272, 1243, 29918, 1792, 29918, 978, 29918, 333, 703, 29902, 1617, 29918, 22988, 291, 1159, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 408, 948, 3934, 29889, 657, 29918, 3696, 29918, 7888, 2141, 3389, 29918, 29305, 29918, 8835, 29898, 3396, 3101, 13, 2 ]
src/djanban/apps/repositories/migrations/0014_auto_20161006_0143.py
diegojromerolopez/djanban
33
54561
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-10-05 23:43 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('boards', '0030_auto_20160925_1843'), ('repositories', '0013_auto_20160927_1935'), ] operations = [ migrations.AlterIndexTogether( name='pylintmessage', index_together=set([('board', 'repository', 'commit', 'commit_file', 'type'), ('board', 'commit', 'type'), ('board', 'type'), ('board', 'repository', 'type', 'commit', 'commit_file'), ('commit', 'type', 'commit_file'), ('commit', 'type'), ('commit', 'commit_file', 'type')]), ), ]
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 3251, 630, 491, 15337, 29871, 29896, 29889, 29896, 29900, 373, 29871, 29906, 29900, 29896, 29953, 29899, 29896, 29900, 29899, 29900, 29945, 29871, 29906, 29941, 29901, 29946, 29941, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 24691, 742, 525, 29900, 29900, 29941, 29900, 29918, 6921, 29918, 29906, 29900, 29896, 29953, 29900, 29929, 29906, 29945, 29918, 29896, 29947, 29946, 29941, 5477, 13, 4706, 6702, 276, 1066, 20106, 742, 525, 29900, 29900, 29896, 29941, 29918, 6921, 29918, 29906, 29900, 29896, 29953, 29900, 29929, 29906, 29955, 29918, 29896, 29929, 29941, 29945, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 2499, 357, 3220, 29911, 12966, 29898, 13, 9651, 1024, 2433, 2272, 27854, 4906, 742, 13, 9651, 2380, 29918, 29873, 12966, 29922, 842, 4197, 877, 3377, 742, 525, 19033, 742, 525, 15060, 742, 525, 15060, 29918, 1445, 742, 525, 1853, 5477, 6702, 3377, 742, 525, 15060, 742, 525, 1853, 5477, 6702, 3377, 742, 525, 1853, 5477, 6702, 3377, 742, 525, 19033, 742, 525, 1853, 742, 525, 15060, 742, 525, 15060, 29918, 1445, 5477, 6702, 15060, 742, 525, 1853, 742, 525, 15060, 29918, 1445, 5477, 6702, 15060, 742, 525, 1853, 5477, 6702, 15060, 742, 525, 15060, 29918, 1445, 742, 525, 1853, 1495, 11724, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
3.Pandas/4_plotting.py
utkrist-karky/Deep-Learning-Prerequisite
1
78960
<gh_stars>1-10 import pandas as pd import os import matplotlib.pyplot as plt from pandas.plotting import scatter_matrix def date_to_year(row): return int(row['date'].split('-')[0]) # from data frame row get date that is split with - and take the 0th item #Get the data frame and assign df to it os.system("wget https://raw.githubusercontent.com/lazyprogrammer/machine_learning_examples/master/tf2.0/sbux.csv") df = pd.read_csv('sbux.csv', error_bad_lines=False) os.system("clear") #-------------------------------------- #create a histogram df['open'].hist() plt.show() #create a linegraph df['open'].plot() plt.show() #box plot df[['open', 'high', 'low', 'close']].plot.box() plt.show() #scatter matrix scatter_matrix(df[['open', 'high', 'low', 'close']], alpha = 0.2, figsize=(6,6)); #alpha = 0.2 makes the dots have transpirancy and figsize makes the plot a little bigger plt.show() os.system("rm sbux.csv")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 11701, 408, 10518, 13, 5215, 2897, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 11701, 29889, 5317, 1259, 1053, 14801, 29918, 5344, 13, 13, 13, 1753, 2635, 29918, 517, 29918, 6360, 29898, 798, 1125, 29871, 13, 1678, 736, 938, 29898, 798, 1839, 1256, 13359, 5451, 877, 29899, 29861, 29900, 2314, 13, 1678, 396, 515, 848, 3515, 1948, 679, 2635, 393, 338, 6219, 411, 448, 322, 2125, 278, 29871, 29900, 386, 2944, 13, 13, 29937, 2577, 278, 848, 3515, 322, 3566, 4489, 304, 372, 13, 359, 29889, 5205, 703, 29893, 657, 2045, 597, 1610, 29889, 3292, 1792, 3051, 29889, 510, 29914, 433, 1537, 8860, 1050, 29914, 23523, 29918, 21891, 29918, 19057, 29914, 6207, 29914, 13264, 29906, 29889, 29900, 29914, 20778, 1314, 29889, 7638, 1159, 13, 13, 2176, 353, 10518, 29889, 949, 29918, 7638, 877, 20778, 1314, 29889, 7638, 742, 1059, 29918, 12313, 29918, 9012, 29922, 8824, 29897, 13, 359, 29889, 5205, 703, 8551, 1159, 13, 29937, 2683, 2683, 22158, 13, 13, 29937, 3258, 263, 9825, 13342, 13, 2176, 1839, 3150, 13359, 29882, 391, 580, 13, 572, 29873, 29889, 4294, 580, 13, 13, 29937, 3258, 263, 6276, 387, 1140, 13, 2176, 1839, 3150, 13359, 5317, 580, 13, 572, 29873, 29889, 4294, 580, 13, 13, 29937, 1884, 6492, 13, 2176, 29961, 1839, 3150, 742, 525, 9812, 742, 525, 677, 742, 525, 5358, 2033, 1822, 5317, 29889, 1884, 580, 13, 572, 29873, 29889, 4294, 580, 13, 13, 29937, 1557, 2620, 4636, 13, 1557, 2620, 29918, 5344, 29898, 2176, 29961, 1839, 3150, 742, 525, 9812, 742, 525, 677, 742, 525, 5358, 2033, 1402, 13, 1669, 15595, 353, 29871, 29900, 29889, 29906, 29892, 2537, 2311, 7607, 29953, 29892, 29953, 2483, 13, 29937, 2312, 353, 29871, 29900, 29889, 29906, 3732, 278, 270, 1862, 505, 1301, 29886, 381, 6906, 322, 2537, 2311, 3732, 278, 6492, 263, 2217, 16600, 13, 572, 29873, 29889, 4294, 580, 13, 13, 359, 29889, 5205, 703, 1758, 17444, 1314, 29889, 7638, 1159, 2 ]
07-Array-Oriented-Programming-with-NumPy/7-4-Array-from-List-of-Lists.py
rajevac/deitel-intro-to-python-exercises
0
114366
import numpy as np arr_1 = [2, 3, 5, 7, 11] arr_2 = [13, 17, 19, 23, 29] arr_3 = np.array([arr_1, arr_2]) print(arr_3)
[ 1, 1053, 12655, 408, 7442, 13, 13, 2749, 29918, 29896, 353, 518, 29906, 29892, 29871, 29941, 29892, 29871, 29945, 29892, 29871, 29955, 29892, 29871, 29896, 29896, 29962, 13, 2749, 29918, 29906, 353, 518, 29896, 29941, 29892, 29871, 29896, 29955, 29892, 29871, 29896, 29929, 29892, 29871, 29906, 29941, 29892, 29871, 29906, 29929, 29962, 13, 13, 2749, 29918, 29941, 353, 7442, 29889, 2378, 4197, 2749, 29918, 29896, 29892, 3948, 29918, 29906, 2314, 13, 2158, 29898, 2749, 29918, 29941, 29897, 13, 2 ]
coding_test_with_python/greedy/t5.py
mrbartrns/swacademy_structure
0
97401
import sys sys.stdin = open('../input.txt', 'r') si = sys.stdin.readline n, m = map(int, si().split()) arr = list(map(int, si().split())) dp = [0] * 11 answer = 0 for i in range(n): dp[arr[i]] += 1 for i in range(m): n -= dp[i] answer += dp[i] * n print(answer)
[ 1, 1053, 10876, 13, 13, 9675, 29889, 4172, 262, 353, 1722, 877, 6995, 2080, 29889, 3945, 742, 525, 29878, 1495, 13, 1039, 353, 10876, 29889, 4172, 262, 29889, 949, 1220, 13, 13, 29876, 29892, 286, 353, 2910, 29898, 524, 29892, 1354, 2141, 5451, 3101, 13, 2749, 353, 1051, 29898, 1958, 29898, 524, 29892, 1354, 2141, 5451, 22130, 13, 6099, 353, 518, 29900, 29962, 334, 29871, 29896, 29896, 13, 12011, 353, 29871, 29900, 13, 1454, 474, 297, 3464, 29898, 29876, 1125, 13, 1678, 270, 29886, 29961, 2749, 29961, 29875, 5262, 4619, 29871, 29896, 13, 13, 1454, 474, 297, 3464, 29898, 29885, 1125, 13, 1678, 302, 22361, 270, 29886, 29961, 29875, 29962, 13, 1678, 1234, 4619, 270, 29886, 29961, 29875, 29962, 334, 302, 13, 2158, 29898, 12011, 29897, 13, 2 ]
0278_FirstBadVersion/python/test_solution.py
jeffvswanson/LeetCode
0
155156
<filename>0278_FirstBadVersion/python/test_solution.py<gh_stars>0 import pytest import solution @pytest.mark.parametrize("num_versions,bad_version", [(10, 1), (10, 8), (1, 1), (10, 10), (10, 5)]) def test_initial_pass(num_versions, bad_version): got = solution.initial_pass(num_versions, bad_version) assert got == bad_version @pytest.mark.parametrize("num_versions,bad_version", [(10, 1), (10, 8), (1, 1), (10, 10), (10, 5)]) def test_optimized_pass(num_versions, bad_version): got = solution.optimized_pass(num_versions, bad_version) assert got == bad_version
[ 1, 529, 9507, 29958, 29900, 29906, 29955, 29947, 29918, 6730, 22050, 6594, 29914, 4691, 29914, 1688, 29918, 2929, 918, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 11451, 1688, 13, 13, 5215, 1650, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 703, 1949, 29918, 26100, 29892, 12313, 29918, 3259, 613, 17288, 29896, 29900, 29892, 29871, 29896, 511, 313, 29896, 29900, 29892, 29871, 29947, 511, 313, 29896, 29892, 29871, 29896, 511, 313, 29896, 29900, 29892, 29871, 29896, 29900, 511, 313, 29896, 29900, 29892, 29871, 29945, 29897, 2314, 13, 1753, 1243, 29918, 11228, 29918, 3364, 29898, 1949, 29918, 26100, 29892, 4319, 29918, 3259, 1125, 13, 1678, 2355, 353, 1650, 29889, 11228, 29918, 3364, 29898, 1949, 29918, 26100, 29892, 4319, 29918, 3259, 29897, 13, 1678, 4974, 2355, 1275, 4319, 29918, 3259, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 703, 1949, 29918, 26100, 29892, 12313, 29918, 3259, 613, 17288, 29896, 29900, 29892, 29871, 29896, 511, 313, 29896, 29900, 29892, 29871, 29947, 511, 313, 29896, 29892, 29871, 29896, 511, 313, 29896, 29900, 29892, 29871, 29896, 29900, 511, 313, 29896, 29900, 29892, 29871, 29945, 29897, 2314, 13, 1753, 1243, 29918, 20640, 1891, 29918, 3364, 29898, 1949, 29918, 26100, 29892, 4319, 29918, 3259, 1125, 13, 1678, 2355, 353, 1650, 29889, 20640, 1891, 29918, 3364, 29898, 1949, 29918, 26100, 29892, 4319, 29918, 3259, 29897, 13, 1678, 4974, 2355, 1275, 4319, 29918, 3259, 13, 2 ]
ed/ai/ml/kubeflow/examples/out.file_outputs.py
cn007b/stash
0
1607995
<gh_stars>0 import kfp import kfp.dsl as dsl from kubernetes import client from kubernetes.client.models import V1EnvVar @kfp.dsl.pipeline(name='check x', description='') def check_x(): op1 = dsl.ContainerOp( name='write log', image='cn007b/alpine', command=['sh', '-c'], arguments=['echo ok > /tmp/x.log'], file_outputs={'x': '/tmp/x.log'} ) op2 = dsl.ContainerOp( name='read log', image='cn007b/alpine', command=['sh', '-c'], arguments=['echo %s ' %op1.output] ) p = check_x pod_node_selector = 'kubeflow' pipeline_conf = dsl.PipelineConf() pipeline_conf.set_image_pull_secrets([client.V1LocalObjectReference(name="x")]) pipeline_conf.set_default_pod_node_selector(label_name="kubernetes.io/instancegroup", value=pod_node_selector) pipeline = kfp.Client().create_run_from_pipeline_func(p, arguments={}, pipeline_conf=pipeline_conf)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 413, 18091, 13, 5215, 413, 18091, 29889, 29881, 2536, 408, 270, 2536, 13, 3166, 413, 17547, 1053, 3132, 13, 3166, 413, 17547, 29889, 4645, 29889, 9794, 1053, 478, 29896, 21745, 9037, 13, 13, 13, 29992, 29895, 18091, 29889, 29881, 2536, 29889, 13096, 5570, 29898, 978, 2433, 3198, 921, 742, 6139, 2433, 1495, 13, 1753, 1423, 29918, 29916, 7295, 13, 29871, 1015, 29896, 353, 270, 2536, 29889, 7895, 11746, 29898, 13, 1678, 1024, 2433, 3539, 1480, 742, 13, 1678, 1967, 2433, 18038, 29900, 29900, 29955, 29890, 29914, 284, 26215, 742, 13, 1678, 1899, 29922, 1839, 845, 742, 17411, 29883, 7464, 13, 1678, 6273, 29922, 1839, 8057, 3431, 1405, 847, 7050, 29914, 29916, 29889, 1188, 7464, 13, 1678, 934, 29918, 4905, 29879, 3790, 29915, 29916, 2396, 8207, 7050, 29914, 29916, 29889, 1188, 10827, 13, 29871, 1723, 13, 29871, 1015, 29906, 353, 270, 2536, 29889, 7895, 11746, 29898, 13, 1678, 1024, 2433, 949, 1480, 742, 13, 1678, 1967, 2433, 18038, 29900, 29900, 29955, 29890, 29914, 284, 26215, 742, 13, 1678, 1899, 29922, 1839, 845, 742, 17411, 29883, 7464, 13, 1678, 6273, 29922, 1839, 8057, 1273, 29879, 525, 1273, 459, 29896, 29889, 4905, 29962, 13, 29871, 1723, 13, 13, 13, 29886, 353, 1423, 29918, 29916, 13, 15334, 29918, 3177, 29918, 14357, 353, 525, 29895, 431, 1389, 677, 29915, 13, 13096, 5570, 29918, 5527, 353, 270, 2536, 29889, 29925, 23828, 16376, 580, 13, 13096, 5570, 29918, 5527, 29889, 842, 29918, 3027, 29918, 26746, 29918, 344, 1037, 1372, 4197, 4645, 29889, 29963, 29896, 7717, 2061, 7422, 29898, 978, 543, 29916, 1159, 2314, 13, 13096, 5570, 29918, 5527, 29889, 842, 29918, 4381, 29918, 15334, 29918, 3177, 29918, 14357, 29898, 1643, 29918, 978, 543, 29895, 17547, 29889, 601, 29914, 8758, 2972, 613, 995, 29922, 15334, 29918, 3177, 29918, 14357, 29897, 13, 13096, 5570, 353, 413, 18091, 29889, 4032, 2141, 3258, 29918, 3389, 29918, 3166, 29918, 13096, 5570, 29918, 9891, 29898, 29886, 29892, 6273, 3790, 1118, 16439, 29918, 5527, 29922, 13096, 5570, 29918, 5527, 29897, 13, 2 ]
channels/views/channels.py
mitodl/open-discussions
12
139212
"""Views for REST APIs for channels""" from django.shortcuts import get_object_or_404 from rest_framework.generics import ListCreateAPIView, RetrieveUpdateAPIView from rest_framework.response import Response from rest_framework.exceptions import PermissionDenied from rest_framework import status from channels.api import Api from channels.models import Channel from channels.serializers.channels import ChannelSerializer from channels.utils import translate_praw_exceptions from open_discussions.permissions import ( AnonymousAccessReadonlyPermission, IsStaffOrReadonlyPermission, IsStaffModeratorOrReadonlyPermission, ) class ChannelListView(ListCreateAPIView): """ View for listing and creating channels """ permission_classes = ( AnonymousAccessReadonlyPermission, IsStaffOrReadonlyPermission, ) serializer_class = ChannelSerializer def get_serializer_context(self): """Context for the request and view""" channels = {channel.name: channel for channel in Channel.objects.all()} return { "channel_api": self.request.channel_api, "channels": channels, "view": self, } def get_queryset(self): """Get generator for channels list""" api = Api(user=self.request.user) return api.list_channels() def list(self, request, *args, **kwargs): """Return the channels list in alphabetical order""" queryset = self.get_queryset() serializer = ChannelSerializer(queryset, many=True) return Response( sorted(serializer.data, key=lambda channel: channel["title"].lower()) ) def post(self, request, *args, **kwargs): with translate_praw_exceptions(request.user): return super().post(request, *args, **kwargs) class ChannelDetailView(RetrieveUpdateAPIView): """ View for getting information about or updating a specific channel """ permission_classes = ( AnonymousAccessReadonlyPermission, IsStaffModeratorOrReadonlyPermission, ) serializer_class = ChannelSerializer def get_serializer_context(self): """Context for the request and view""" return { "channel_api": self.request.channel_api, "channels": { self.kwargs["channel_name"]: get_object_or_404( Channel, name=self.kwargs["channel_name"] ) }, "view": self, } def get_object(self): """Get channel referenced by API""" return self.request.channel_api.get_channel(self.kwargs["channel_name"]) def get(self, request, *args, **kwargs): # we don't want to let this through to Reddit, because it blows up :/ if len(kwargs["channel_name"]) == 1: return Response({}, status=status.HTTP_404_NOT_FOUND) with translate_praw_exceptions(request.user): return super().get(request, *args, **kwargs) def patch(self, request, *args, **kwargs): # Deny permission if the user is not a superuser and is attempting to update the channel title. if not self.request.user.is_superuser and "title" in self.request.data: raise PermissionDenied() with translate_praw_exceptions(request.user): return super().patch(request, *args, **kwargs) def put(self, request, *args, **kwargs): # Deny permission if the user is not a superuser and is attempting to update the channel title. channel = self.get_object() if ( not self.request.user.is_superuser and self.request.data.get("title") != channel.title ): raise PermissionDenied() with translate_praw_exceptions(request.user): return super().put(request, *args, **kwargs)
[ 1, 9995, 23825, 363, 16759, 23649, 363, 18196, 15945, 29908, 13, 3166, 9557, 29889, 12759, 7582, 29879, 1053, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 13, 3166, 1791, 29918, 4468, 29889, 4738, 1199, 1053, 2391, 4391, 8787, 1043, 29892, 4649, 29878, 2418, 6422, 8787, 1043, 13, 3166, 1791, 29918, 4468, 29889, 5327, 1053, 13291, 13, 3166, 1791, 29918, 4468, 29889, 11739, 29879, 1053, 20894, 2333, 29315, 1000, 13, 3166, 1791, 29918, 4468, 1053, 4660, 13, 13, 3166, 18196, 29889, 2754, 1053, 29749, 13, 3166, 18196, 29889, 9794, 1053, 17368, 13, 3166, 18196, 29889, 15550, 19427, 29889, 305, 12629, 1053, 17368, 17679, 13, 3166, 18196, 29889, 13239, 1053, 14240, 29918, 29886, 1610, 29918, 11739, 29879, 13, 3166, 1722, 29918, 2218, 13571, 1080, 29889, 17858, 6847, 1053, 313, 13, 1678, 530, 11428, 6638, 6359, 6194, 27293, 29892, 13, 1678, 1317, 855, 3470, 2816, 6359, 6194, 27293, 29892, 13, 1678, 1317, 855, 3470, 2111, 261, 1061, 2816, 6359, 6194, 27293, 29892, 13, 29897, 13, 13, 13, 1990, 17368, 15660, 29898, 1293, 4391, 8787, 1043, 1125, 13, 1678, 9995, 13, 1678, 4533, 363, 18028, 322, 4969, 18196, 13, 1678, 9995, 13, 13, 1678, 10751, 29918, 13203, 353, 313, 13, 4706, 530, 11428, 6638, 6359, 6194, 27293, 29892, 13, 4706, 1317, 855, 3470, 2816, 6359, 6194, 27293, 29892, 13, 1678, 1723, 13, 1678, 7797, 3950, 29918, 1990, 353, 17368, 17679, 13, 13, 1678, 822, 679, 29918, 15550, 3950, 29918, 4703, 29898, 1311, 1125, 13, 4706, 9995, 2677, 363, 278, 2009, 322, 1776, 15945, 29908, 13, 4706, 18196, 353, 426, 12719, 29889, 978, 29901, 8242, 363, 8242, 297, 17368, 29889, 12650, 29889, 497, 28296, 13, 13, 4706, 736, 426, 13, 9651, 376, 12719, 29918, 2754, 1115, 1583, 29889, 3827, 29889, 12719, 29918, 2754, 29892, 13, 9651, 376, 305, 12629, 1115, 18196, 29892, 13, 9651, 376, 1493, 1115, 1583, 29892, 13, 4706, 500, 13, 13, 1678, 822, 679, 29918, 1972, 842, 29898, 1311, 1125, 13, 4706, 9995, 2577, 15299, 363, 18196, 1051, 15945, 29908, 13, 4706, 7882, 353, 29749, 29898, 1792, 29922, 1311, 29889, 3827, 29889, 1792, 29897, 13, 4706, 736, 7882, 29889, 1761, 29918, 305, 12629, 580, 13, 13, 1678, 822, 1051, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 9995, 11609, 278, 18196, 1051, 297, 22968, 936, 1797, 15945, 29908, 13, 4706, 2346, 842, 353, 1583, 29889, 657, 29918, 1972, 842, 580, 13, 4706, 7797, 3950, 353, 17368, 17679, 29898, 1972, 842, 29892, 1784, 29922, 5574, 29897, 13, 4706, 736, 13291, 29898, 13, 9651, 12705, 29898, 15550, 3950, 29889, 1272, 29892, 1820, 29922, 2892, 8242, 29901, 8242, 3366, 3257, 16862, 13609, 3101, 13, 4706, 1723, 13, 13, 1678, 822, 1400, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 411, 14240, 29918, 29886, 1610, 29918, 11739, 29879, 29898, 3827, 29889, 1792, 1125, 13, 9651, 736, 2428, 2141, 2490, 29898, 3827, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 13, 1990, 17368, 16570, 1043, 29898, 8015, 29878, 2418, 6422, 8787, 1043, 1125, 13, 1678, 9995, 13, 1678, 4533, 363, 2805, 2472, 1048, 470, 13271, 263, 2702, 8242, 13, 1678, 9995, 13, 13, 1678, 10751, 29918, 13203, 353, 313, 13, 4706, 530, 11428, 6638, 6359, 6194, 27293, 29892, 13, 4706, 1317, 855, 3470, 2111, 261, 1061, 2816, 6359, 6194, 27293, 29892, 13, 1678, 1723, 13, 1678, 7797, 3950, 29918, 1990, 353, 17368, 17679, 13, 13, 1678, 822, 679, 29918, 15550, 3950, 29918, 4703, 29898, 1311, 1125, 13, 4706, 9995, 2677, 363, 278, 2009, 322, 1776, 15945, 29908, 13, 4706, 736, 426, 13, 9651, 376, 12719, 29918, 2754, 1115, 1583, 29889, 3827, 29889, 12719, 29918, 2754, 29892, 13, 9651, 376, 305, 12629, 1115, 426, 13, 18884, 1583, 29889, 19290, 3366, 12719, 29918, 978, 3108, 29901, 679, 29918, 3318, 29918, 272, 29918, 29946, 29900, 29946, 29898, 13, 462, 1678, 17368, 29892, 1024, 29922, 1311, 29889, 19290, 3366, 12719, 29918, 978, 3108, 13, 18884, 1723, 13, 9651, 2981, 13, 9651, 376, 1493, 1115, 1583, 29892, 13, 4706, 500, 13, 13, 1678, 822, 679, 29918, 3318, 29898, 1311, 1125, 13, 4706, 9995, 2577, 8242, 16180, 491, 3450, 15945, 29908, 13, 4706, 736, 1583, 29889, 3827, 29889, 12719, 29918, 2754, 29889, 657, 29918, 12719, 29898, 1311, 29889, 19290, 3366, 12719, 29918, 978, 20068, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 396, 591, 1016, 29915, 29873, 864, 304, 1235, 445, 1549, 304, 4367, 27423, 29892, 1363, 372, 13031, 29879, 701, 584, 29914, 13, 4706, 565, 7431, 29898, 19290, 3366, 12719, 29918, 978, 20068, 1275, 29871, 29896, 29901, 13, 9651, 736, 13291, 3319, 1118, 4660, 29922, 4882, 29889, 10493, 29918, 29946, 29900, 29946, 29918, 12256, 29918, 5800, 18783, 29897, 13, 13, 4706, 411, 14240, 29918, 29886, 1610, 29918, 11739, 29879, 29898, 3827, 29889, 1792, 1125, 13, 9651, 736, 2428, 2141, 657, 29898, 3827, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 822, 13261, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 396, 3384, 29891, 10751, 565, 278, 1404, 338, 451, 263, 2428, 1792, 322, 338, 15661, 304, 2767, 278, 8242, 3611, 29889, 13, 4706, 565, 451, 1583, 29889, 3827, 29889, 1792, 29889, 275, 29918, 9136, 1792, 322, 376, 3257, 29908, 297, 1583, 29889, 3827, 29889, 1272, 29901, 13, 9651, 12020, 20894, 2333, 29315, 1000, 580, 13, 4706, 411, 14240, 29918, 29886, 1610, 29918, 11739, 29879, 29898, 3827, 29889, 1792, 1125, 13, 9651, 736, 2428, 2141, 5041, 29898, 3827, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 822, 1925, 29898, 1311, 29892, 2009, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 396, 3384, 29891, 10751, 565, 278, 1404, 338, 451, 263, 2428, 1792, 322, 338, 15661, 304, 2767, 278, 8242, 3611, 29889, 13, 4706, 8242, 353, 1583, 29889, 657, 29918, 3318, 580, 13, 4706, 565, 313, 13, 9651, 451, 1583, 29889, 3827, 29889, 1792, 29889, 275, 29918, 9136, 1792, 13, 9651, 322, 1583, 29889, 3827, 29889, 1272, 29889, 657, 703, 3257, 1159, 2804, 8242, 29889, 3257, 13, 308, 1125, 13, 9651, 12020, 20894, 2333, 29315, 1000, 580, 13, 4706, 411, 14240, 29918, 29886, 1610, 29918, 11739, 29879, 29898, 3827, 29889, 1792, 1125, 13, 9651, 736, 2428, 2141, 649, 29898, 3827, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 2 ]
mainapp/migrations/0007_auto_20190114_0854.py
tum0xa/geekbrains-django2-homework
0
133698
<filename>mainapp/migrations/0007_auto_20190114_0854.py # Generated by Django 2.1 on 2019-01-14 03:54 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('mainapp', '0006_productcategory_is_active'), ] operations = [ migrations.CreateModel( name='Address', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=255, verbose_name='Название')), ('city', models.CharField(max_length=50, verbose_name='Город')), ('street', models.CharField(max_length=50, verbose_name='Улица')), ('building', models.SmallIntegerField(verbose_name='Номер здания, дома')), ('office', models.SmallIntegerField(blank=True, verbose_name='Номер офиса')), ], ), migrations.CreateModel( name='Company', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=255, unique=True, verbose_name='Название организации')), ], ), migrations.CreateModel( name='Contact', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=50, unique=True, verbose_name='Имя')), ('number', models.CharField(blank=True, default='-', max_length=20, verbose_name='Номер телефона')), ('email', models.EmailField(blank=True, default='-', max_length=254, verbose_name='E-mail')), ('is_main', models.BooleanField(default=False, verbose_name='Основной')), ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Company')), ], ), migrations.AddField( model_name='address', name='company', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Company'), ), ]
[ 1, 529, 9507, 29958, 3396, 932, 29914, 26983, 800, 29914, 29900, 29900, 29900, 29955, 29918, 6921, 29918, 29906, 29900, 29896, 29929, 29900, 29896, 29896, 29946, 29918, 29900, 29947, 29945, 29946, 29889, 2272, 13, 29937, 3251, 630, 491, 15337, 29871, 29906, 29889, 29896, 373, 29871, 29906, 29900, 29896, 29929, 29899, 29900, 29896, 29899, 29896, 29946, 29871, 29900, 29941, 29901, 29945, 29946, 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, 3396, 932, 742, 525, 29900, 29900, 29900, 29953, 29918, 4704, 7320, 29918, 275, 29918, 4925, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 7061, 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, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 26952, 29918, 978, 2433, 19193, 7617, 1755, 1495, 511, 13, 18884, 6702, 12690, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29945, 29900, 29892, 26952, 29918, 978, 2433, 30040, 29904, 3463, 1495, 511, 13, 18884, 6702, 29352, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29945, 29900, 29892, 26952, 29918, 978, 2433, 30053, 644, 3432, 1495, 511, 13, 18884, 6702, 25237, 742, 4733, 29889, 12636, 497, 7798, 3073, 29898, 369, 15828, 29918, 978, 2433, 30029, 29904, 5508, 23304, 1587, 29892, 19794, 1495, 511, 13, 18884, 6702, 20205, 742, 4733, 29889, 12636, 497, 7798, 3073, 29898, 19465, 29922, 5574, 29892, 26952, 29918, 978, 2433, 30029, 29904, 5508, 614, 2885, 2019, 1495, 511, 13, 9651, 21251, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 21410, 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, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29906, 29945, 29945, 29892, 5412, 29922, 5574, 29892, 26952, 29918, 978, 2433, 19193, 7617, 1755, 17289, 3540, 1495, 511, 13, 9651, 21251, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 4391, 3195, 29898, 13, 9651, 1024, 2433, 13443, 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, 978, 742, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29945, 29900, 29892, 5412, 29922, 5574, 29892, 26952, 29918, 978, 2433, 30054, 5010, 1495, 511, 13, 18884, 6702, 4537, 742, 4733, 29889, 27890, 29898, 19465, 29922, 5574, 29892, 2322, 2433, 29899, 742, 4236, 29918, 2848, 29922, 29906, 29900, 29892, 26952, 29918, 978, 2433, 30029, 29904, 5508, 13947, 30011, 2953, 1495, 511, 13, 18884, 6702, 5269, 742, 4733, 29889, 9823, 3073, 29898, 19465, 29922, 5574, 29892, 2322, 2433, 29899, 742, 4236, 29918, 2848, 29922, 29906, 29945, 29946, 29892, 26952, 29918, 978, 2433, 29923, 29899, 2549, 1495, 511, 13, 18884, 6702, 275, 29918, 3396, 742, 4733, 29889, 18146, 3073, 29898, 4381, 29922, 8824, 29892, 26952, 29918, 978, 2433, 30038, 29935, 2835, 2082, 1495, 511, 13, 18884, 6702, 14518, 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, 3396, 932, 29889, 21410, 1495, 511, 13, 9651, 21251, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2528, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 7328, 742, 13, 9651, 1024, 2433, 14518, 742, 13, 9651, 1746, 29922, 9794, 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, 3396, 932, 29889, 21410, 5477, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
scicite/compute_features.py
allenai/scicite
89
154984
<filename>scicite/compute_features.py """ Module for computing features """ import re from collections import Counter, defaultdict from typing import List, Optional, Tuple, Type import functools from spacy.tokens.token import Token as SpacyToken import scicite.constants as constants from scicite.constants import CITATION_TOKEN from scicite.resources.lexicons import (AGENT_PATTERNS, ALL_ACTION_LEXICONS, ALL_CONCEPT_LEXICONS, FORMULAIC_PATTERNS) from scicite.data import Citation import logging logger = logging.getLogger('classifier') NETWORK_WEIGHTS_FILE = constants.root_path + '/resources/arc-network-weights.tsv' def load_patterns(filename, p_dict, label): with open(filename) as f: class_counts = Counter() for line in f: if not '@' in line: continue cols = line.split("\t") pattern = cols[0].replace("-lrb-", "(").replace('-rrb-', ')') category = cols[1] if category == 'Background': continue class_counts[category] += 1 p_dict[category + '_' + label + '_' + str(class_counts[category])] \ = pattern.split() # p_dict[clazz + '_' + label].append(pattern.split()) def get_values_from_list(inplst, key, is_class=True): """ gets a value of an obj for a list of dicts (inplst) Args: inplst: list of objects key: key of interest is_class: ist the input object a class or a dictionary obj """ return [getattr(elem, key) for elem in inplst] if is_class \ else [elem[key] for elem in inplst] def is_in_lexicon(lexicon: dict, sentence: str, count: Optional[bool] = False) -> Tuple[List[str], List[str]]: """ checks if the words in a lexicon exist in the sentence """ features = [] feature_names = [] if count: cnt = 0 for key, word_list in lexicon.items(): exists = False for word in word_list: if word in sentence: if not count: exists = True break else: cnt += 1 if not count: features.append(exists) else: features.append(cnt) feature_names.append(key) return features, feature_names
[ 1, 529, 9507, 29958, 1557, 293, 568, 29914, 26017, 29918, 22100, 29889, 2272, 13, 15945, 29908, 15591, 363, 20602, 5680, 9995, 13, 5215, 337, 13, 3166, 16250, 1053, 315, 5336, 29892, 2322, 8977, 13, 3166, 19229, 1053, 2391, 29892, 28379, 29892, 12603, 552, 29892, 5167, 13, 13, 5215, 2090, 312, 8789, 13, 3166, 805, 4135, 29889, 517, 12360, 29889, 6979, 1053, 25159, 408, 1706, 4135, 6066, 13, 13, 5215, 885, 293, 568, 29889, 3075, 1934, 408, 17727, 13, 3166, 885, 293, 568, 29889, 3075, 1934, 1053, 315, 1806, 8098, 29918, 4986, 29968, 1430, 13, 3166, 885, 293, 568, 29889, 13237, 29889, 2506, 27078, 1053, 313, 10051, 3919, 29918, 29925, 1299, 4945, 3059, 29892, 15149, 29918, 24705, 29918, 1307, 29990, 2965, 1164, 29903, 29892, 13, 462, 462, 4706, 15149, 29918, 6007, 4741, 7982, 29918, 1307, 29990, 2965, 1164, 29903, 29892, 383, 12054, 29965, 4375, 2965, 29918, 29925, 1299, 4945, 3059, 29897, 13, 3166, 885, 293, 568, 29889, 1272, 1053, 315, 7018, 13, 5215, 12183, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 877, 1990, 3709, 1495, 13, 13, 6006, 11686, 29968, 29918, 8851, 22530, 29903, 29918, 7724, 353, 17727, 29889, 4632, 29918, 2084, 718, 8207, 13237, 29914, 5666, 29899, 11618, 29899, 705, 5861, 29889, 1372, 29894, 29915, 13, 13, 13, 1753, 2254, 29918, 11037, 29879, 29898, 9507, 29892, 282, 29918, 8977, 29892, 3858, 1125, 13, 1678, 411, 1722, 29898, 9507, 29897, 408, 285, 29901, 13, 4706, 770, 29918, 2798, 29879, 353, 315, 5336, 580, 13, 4706, 363, 1196, 297, 285, 29901, 13, 9651, 565, 451, 18803, 29915, 297, 1196, 29901, 13, 18884, 6773, 13, 9651, 28730, 353, 1196, 29889, 5451, 14182, 29873, 1159, 13, 9651, 4766, 353, 28730, 29961, 29900, 1822, 6506, 703, 29899, 29880, 6050, 29899, 613, 376, 703, 467, 6506, 877, 29899, 29878, 6050, 29899, 742, 25710, 1495, 13, 9651, 7663, 353, 28730, 29961, 29896, 29962, 13, 9651, 565, 7663, 1275, 525, 10581, 2396, 13, 18884, 6773, 13, 9651, 770, 29918, 2798, 29879, 29961, 7320, 29962, 4619, 29871, 29896, 13, 9651, 282, 29918, 8977, 29961, 7320, 718, 22868, 29915, 718, 3858, 718, 22868, 29915, 718, 851, 29898, 1990, 29918, 2798, 29879, 29961, 7320, 2314, 29962, 320, 13, 18884, 353, 4766, 29889, 5451, 580, 13, 9651, 396, 282, 29918, 8977, 29961, 16398, 5617, 718, 22868, 29915, 718, 3858, 1822, 4397, 29898, 11037, 29889, 5451, 3101, 13, 13, 13, 1753, 679, 29918, 5975, 29918, 3166, 29918, 1761, 29898, 262, 572, 303, 29892, 1820, 29892, 338, 29918, 1990, 29922, 5574, 1125, 13, 1678, 9995, 4947, 263, 995, 310, 385, 5446, 363, 263, 1051, 310, 9657, 29879, 313, 262, 572, 303, 29897, 13, 1678, 826, 3174, 29901, 13, 4706, 297, 572, 303, 29901, 1051, 310, 3618, 13, 4706, 1820, 29901, 1820, 310, 4066, 13, 4706, 338, 29918, 1990, 29901, 1752, 278, 1881, 1203, 263, 770, 470, 263, 8600, 5446, 13, 1678, 9995, 13, 1678, 736, 518, 657, 5552, 29898, 20461, 29892, 1820, 29897, 363, 21268, 297, 297, 572, 303, 29962, 565, 338, 29918, 1990, 320, 13, 4706, 1683, 518, 20461, 29961, 1989, 29962, 363, 21268, 297, 297, 572, 303, 29962, 13, 13, 13, 1753, 338, 29918, 262, 29918, 2506, 4144, 29898, 2506, 4144, 29901, 9657, 29892, 13, 462, 29871, 10541, 29901, 851, 29892, 13, 462, 29871, 2302, 29901, 28379, 29961, 11227, 29962, 353, 7700, 29897, 1599, 12603, 552, 29961, 1293, 29961, 710, 1402, 2391, 29961, 710, 5262, 29901, 13, 1678, 9995, 12747, 565, 278, 3838, 297, 263, 19566, 4144, 1863, 297, 278, 10541, 9995, 13, 1678, 5680, 353, 5159, 13, 1678, 4682, 29918, 7039, 353, 5159, 13, 1678, 565, 2302, 29901, 13, 4706, 274, 593, 353, 29871, 29900, 13, 1678, 363, 1820, 29892, 1734, 29918, 1761, 297, 19566, 4144, 29889, 7076, 7295, 13, 4706, 4864, 353, 7700, 13, 4706, 363, 1734, 297, 1734, 29918, 1761, 29901, 13, 9651, 565, 1734, 297, 10541, 29901, 13, 18884, 565, 451, 2302, 29901, 13, 462, 1678, 4864, 353, 5852, 13, 462, 1678, 2867, 13, 18884, 1683, 29901, 13, 462, 1678, 274, 593, 4619, 29871, 29896, 13, 4706, 565, 451, 2302, 29901, 13, 9651, 5680, 29889, 4397, 29898, 9933, 29897, 13, 4706, 1683, 29901, 13, 9651, 5680, 29889, 4397, 29898, 20047, 29897, 13, 4706, 4682, 29918, 7039, 29889, 4397, 29898, 1989, 29897, 13, 1678, 736, 5680, 29892, 4682, 29918, 7039, 13, 2 ]
IdleThing.py
drdread987/IdleThing
0
75637
<gh_stars>0 from Scenes.TitleScreen import TitleScene import pygame import Tools.Images import datetime def run_game(width, height, fps, starting_scene): pygame.init() screen = pygame.display.set_mode((width, height)) clock = pygame.time.Clock() current_time = datetime.datetime.now() time_passed = datetime.datetime.now() - current_time active_scene = starting_scene pressed_keys = [] frames = 0 while active_scene is not None: new_time = datetime.datetime.now() time_passed += new_time - current_time current_time = new_time frames += 1 if time_passed > datetime.timedelta(seconds=1): print("FPS: " + str(frames)) frames = 0 time_passed = datetime.timedelta(seconds=0) # event filtering filtered_events = [] for event in pygame.event.get(): quit_attempt = False if event.type == pygame.QUIT: quit_attempt = True elif event.type == pygame.KEYDOWN: alt_pressed = pygame.K_LALT in pressed_keys or pygame.K_RALT in pressed_keys if event.key == pygame.K_ESCAPE: quit_attempt = True elif event.key == pygame.K_F4 and alt_pressed: quit_attempt = True elif event.key not in pressed_keys: pressed_keys.append(event.key) elif event.type == pygame.KEYUP: if event.key in pressed_keys: pressed_keys.remove(event.key) if quit_attempt: active_scene.terminate() else: filtered_events.append(event) active_scene.process_input(filtered_events, pressed_keys) active_scene.update(screen) active_scene.render(screen) active_scene = active_scene.next pygame.display.flip() clock.tick(fps) il = Tools.Images.ImageLoader() run_game(1200, 800, 60, TitleScene(il))
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 2522, 25487, 29889, 7030, 11357, 1053, 18527, 23472, 13, 5215, 22028, 13, 5215, 27564, 29889, 20163, 13, 5215, 12865, 13, 13, 13, 1753, 1065, 29918, 11802, 29898, 2103, 29892, 3171, 29892, 285, 567, 29892, 6257, 29918, 24645, 1125, 13, 1678, 22028, 29889, 2344, 580, 13, 1678, 4315, 353, 22028, 29889, 4990, 29889, 842, 29918, 8513, 3552, 2103, 29892, 3171, 876, 13, 1678, 12006, 353, 22028, 29889, 2230, 29889, 29907, 908, 580, 13, 1678, 1857, 29918, 2230, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 1678, 931, 29918, 3364, 287, 353, 12865, 29889, 12673, 29889, 3707, 580, 448, 1857, 29918, 2230, 13, 1678, 6136, 29918, 24645, 353, 6257, 29918, 24645, 13, 1678, 15385, 29918, 8149, 353, 5159, 13, 1678, 16608, 353, 29871, 29900, 13, 1678, 1550, 6136, 29918, 24645, 338, 451, 6213, 29901, 13, 13, 4706, 716, 29918, 2230, 353, 12865, 29889, 12673, 29889, 3707, 580, 13, 4706, 931, 29918, 3364, 287, 4619, 716, 29918, 2230, 448, 1857, 29918, 2230, 13, 4706, 1857, 29918, 2230, 353, 716, 29918, 2230, 13, 4706, 16608, 4619, 29871, 29896, 13, 4706, 565, 931, 29918, 3364, 287, 1405, 12865, 29889, 9346, 287, 2554, 29898, 23128, 29922, 29896, 1125, 13, 9651, 1596, 703, 29943, 7024, 29901, 376, 718, 851, 29898, 19935, 876, 13, 9651, 16608, 353, 29871, 29900, 13, 9651, 931, 29918, 3364, 287, 353, 12865, 29889, 9346, 287, 2554, 29898, 23128, 29922, 29900, 29897, 13, 4706, 396, 1741, 21166, 13, 4706, 22289, 29918, 13604, 353, 5159, 13, 4706, 363, 1741, 297, 22028, 29889, 3696, 29889, 657, 7295, 13, 9651, 23283, 29918, 1131, 3456, 353, 7700, 13, 9651, 565, 1741, 29889, 1853, 1275, 22028, 29889, 13356, 1806, 29901, 13, 18884, 23283, 29918, 1131, 3456, 353, 5852, 13, 9651, 25342, 1741, 29889, 1853, 1275, 22028, 29889, 10818, 3970, 16048, 29901, 13, 18884, 5272, 29918, 13120, 353, 22028, 29889, 29968, 29918, 29931, 1964, 29911, 297, 15385, 29918, 8149, 470, 22028, 29889, 29968, 29918, 29934, 1964, 29911, 297, 15385, 29918, 8149, 13, 18884, 565, 1741, 29889, 1989, 1275, 22028, 29889, 29968, 29918, 2890, 29907, 3301, 29923, 29901, 13, 462, 1678, 23283, 29918, 1131, 3456, 353, 5852, 13, 18884, 25342, 1741, 29889, 1989, 1275, 22028, 29889, 29968, 29918, 29943, 29946, 322, 5272, 29918, 13120, 29901, 13, 462, 1678, 23283, 29918, 1131, 3456, 353, 5852, 13, 18884, 25342, 1741, 29889, 1989, 451, 297, 15385, 29918, 8149, 29901, 13, 462, 1678, 15385, 29918, 8149, 29889, 4397, 29898, 3696, 29889, 1989, 29897, 13, 9651, 25342, 1741, 29889, 1853, 1275, 22028, 29889, 10818, 4897, 29901, 13, 18884, 565, 1741, 29889, 1989, 297, 15385, 29918, 8149, 29901, 13, 462, 1678, 15385, 29918, 8149, 29889, 5992, 29898, 3696, 29889, 1989, 29897, 13, 13, 9651, 565, 23283, 29918, 1131, 3456, 29901, 13, 18884, 6136, 29918, 24645, 29889, 18821, 403, 580, 13, 9651, 1683, 29901, 13, 18884, 22289, 29918, 13604, 29889, 4397, 29898, 3696, 29897, 13, 13, 4706, 6136, 29918, 24645, 29889, 5014, 29918, 2080, 29898, 4572, 287, 29918, 13604, 29892, 15385, 29918, 8149, 29897, 13, 4706, 6136, 29918, 24645, 29889, 5504, 29898, 10525, 29897, 13, 4706, 6136, 29918, 24645, 29889, 9482, 29898, 10525, 29897, 13, 13, 4706, 6136, 29918, 24645, 353, 6136, 29918, 24645, 29889, 4622, 13, 13, 4706, 22028, 29889, 4990, 29889, 29888, 3466, 580, 13, 4706, 12006, 29889, 24667, 29898, 29888, 567, 29897, 13, 13, 13, 309, 353, 27564, 29889, 20163, 29889, 2940, 10036, 580, 13, 3389, 29918, 11802, 29898, 29896, 29906, 29900, 29900, 29892, 29871, 29947, 29900, 29900, 29892, 29871, 29953, 29900, 29892, 18527, 23472, 29898, 309, 876, 13, 2 ]
python_project/mfresh_project/mfresh_api/mfresh_api/urls.py
452366we/python_web
0
178248
<filename>python_project/mfresh_project/mfresh_api/mfresh_api/urls.py<gh_stars>0 """mfresh_api URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ #from django.contrib import admin from django.urls import path from django.http import HttpResponse from user.views import userLogin,userRegister,userCheckUname,userCheckPhone from news.views import newsList,newsDetail from product.views import productList,productDetail from cart.views import cartDetailAdd,cartDetailList,cartDetailDelete,cartDetailUpdate from user.models import MfUser def handleHome(req): res=HttpResponse('<h1>welcome to mfresh!</h1><hr>') return res urlpatterns = [ path('',handleHome), path('user/login',userLogin), path('user/register',userRegister), path('user/check/uname',userCheckUname), path('user/check/phone',userCheckPhone), path('news/list',newsList), path('news/detail',newsDetail), path('product/list',productList), path('product/detail',productDetail) ]
[ 1, 529, 9507, 29958, 4691, 29918, 4836, 29914, 29885, 29888, 3781, 29918, 4836, 29914, 29885, 29888, 3781, 29918, 2754, 29914, 29885, 29888, 3781, 29918, 2754, 29914, 26045, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 29885, 29888, 3781, 29918, 2754, 3988, 20999, 13, 13, 1576, 421, 2271, 11037, 29879, 29952, 1051, 12049, 24295, 304, 8386, 29889, 1152, 901, 2472, 3113, 1074, 29901, 13, 1678, 2045, 597, 2640, 29889, 19776, 574, 26555, 622, 29889, 510, 29914, 264, 29914, 29906, 29889, 29906, 29914, 3332, 1199, 29914, 1124, 29914, 26045, 29914, 13, 1252, 9422, 29901, 13, 6678, 8386, 13, 268, 29896, 29889, 3462, 385, 1053, 29901, 29871, 515, 590, 29918, 932, 1053, 8386, 13, 268, 29906, 29889, 3462, 263, 3988, 304, 3142, 11037, 29879, 29901, 29871, 2224, 877, 742, 8386, 29889, 5184, 29892, 1024, 2433, 5184, 1495, 13, 2385, 29899, 6707, 8386, 13, 268, 29896, 29889, 3462, 385, 1053, 29901, 29871, 515, 916, 29918, 932, 29889, 7406, 1053, 8778, 13, 268, 29906, 29889, 3462, 263, 3988, 304, 3142, 11037, 29879, 29901, 29871, 2224, 877, 742, 8778, 29889, 294, 29918, 1493, 3285, 1024, 2433, 5184, 1495, 13, 797, 22368, 1790, 3988, 5527, 13, 268, 29896, 29889, 16032, 278, 3160, 580, 740, 29901, 515, 9557, 29889, 26045, 1053, 3160, 29892, 2224, 13, 268, 29906, 29889, 3462, 263, 3988, 304, 3142, 11037, 29879, 29901, 29871, 2224, 877, 7312, 29914, 742, 3160, 877, 7312, 29889, 26045, 8785, 13, 15945, 29908, 13, 29937, 3166, 9557, 29889, 21570, 1053, 4113, 13, 3166, 9557, 29889, 26045, 1053, 2224, 13, 3166, 9557, 29889, 1124, 1053, 9056, 5103, 13, 13, 3166, 1404, 29889, 7406, 1053, 1404, 11049, 29892, 1792, 15213, 29892, 1792, 5596, 29965, 978, 29892, 1792, 5596, 9861, 13, 3166, 9763, 29889, 7406, 1053, 9763, 1293, 29892, 15753, 16570, 13, 3166, 3234, 29889, 7406, 1053, 3234, 1293, 29892, 4704, 16570, 13, 3166, 7774, 29889, 7406, 1053, 7774, 16570, 2528, 29892, 13823, 16570, 1293, 29892, 13823, 16570, 12498, 29892, 13823, 16570, 6422, 13, 13, 3166, 1404, 29889, 9794, 1053, 341, 29888, 2659, 13, 13, 1753, 4386, 11184, 29898, 7971, 1125, 13, 1678, 620, 29922, 5506, 5103, 877, 29966, 29882, 29896, 29958, 20466, 2763, 304, 286, 29888, 3781, 29991, 829, 29882, 29896, 5299, 1092, 29958, 1495, 13, 1678, 736, 620, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 2224, 877, 742, 8411, 11184, 511, 13, 1678, 2224, 877, 1792, 29914, 7507, 742, 1792, 11049, 511, 13, 1678, 2224, 877, 1792, 29914, 9573, 742, 1792, 15213, 511, 13, 1678, 2224, 877, 1792, 29914, 3198, 29914, 348, 420, 742, 1792, 5596, 29965, 978, 511, 13, 1678, 2224, 877, 1792, 29914, 3198, 29914, 6710, 742, 1792, 5596, 9861, 511, 13, 1678, 2224, 877, 15753, 29914, 1761, 742, 15753, 1293, 511, 13, 1678, 2224, 877, 15753, 29914, 16432, 742, 15753, 16570, 511, 13, 1678, 2224, 877, 4704, 29914, 1761, 742, 4704, 1293, 511, 13, 1678, 2224, 877, 4704, 29914, 16432, 742, 4704, 16570, 29897, 13, 29962, 13, 2 ]
analytics/notebooks/lib/run_definition.py
solace-iot-team/az-use-case-perf-tests
5
63143
# --------------------------------------------------------------------------------------------- # MIT License # Copyright (c) 2020, Solace Corporation, <NAME> (<EMAIL>) # Copyright (c) 2020, Solace Corporation, <NAME> (<EMAIL>) # --------------------------------------------------------------------------------------------- import glob import os.path from os import path from .common_base import CommonBase from .constants import * from .perf_error import PerfError from .run import Run from .run_result_location import RunResultLocation class RunDefinition(CommonBase): def __init__(self, location: RunResultLocation): """ RunDefinition triggers processing all runs within RunResultLocation and provides functions to extract data ++ :param location: """ CommonBase.__init__(self) self._location = location self._list_runs = list() self._process_distinct_latency_samples=True #just metadata read self._processed_samples = False def process_run_samples(self, process_distinct_latency_samples:bool=True): rootExists = self._check_root_folder_in_run_location() self._process_distinct_latency_samples = process_distinct_latency_samples if not rootExists: raise SystemExit(f'[ERROR] [EXITING] Root folder does not exist:{self._location.root_folder}') for run_dir in self._read_list_runs(): self._list_runs.append(Run(self,run_dir)) self._processed_samples = True def _file_path_in_run_location(self, filename: str) -> str: return self._location.root_folder + "/" + filename def _check_file_in_run_location(self, filename: str) -> bool: return path.exists(self._file_path_in_run_location(filename)) def _check_root_folder_in_run_location(self) -> bool: return path.exists(self._location.root_folder) def _files_in_run_location(self, pattern): return glob.glob(self._file_path_in_run_location(perf_pattern_run_dir)) def _dirs_in_run_location(self, pattern): candidates = glob.glob(self._file_path_in_run_location(perf_pattern_run_dir)) return list(filter(lambda file: os.path.isdir(file), candidates)) def _check_processed_sampled(self): if not self._processed_samples: raise SystemExit(f'[ERROR] [EXITING] RunDefinition not initialized. Execute >process_run_samples() once to read all sample data.<') def _read_list_runs(self) -> list: return self._dirs_in_run_location(perf_pattern_run_dir) def all_runs(self) -> list: """ All runs :return: list of all runs """ self._check_processed_sampled() return self._list_runs def find_run(self, run_id, read_samples:bool=True): """ Searches for run with run_id :param run_id: :param read_samples: read also the latencies before handing over the run :return: Run :raise: PerfError: if run_id was not found """ self._check_processed_sampled() try: run = next(filter(lambda item: item.run_meta.run_id==run_id, self._list_runs)) if read_samples: #idempotent - samples will be read just once run.read_samples() return run except StopIteration: raise PerfError(f'run_id: {run_id} not found') def find_sample(self,run_id, metrics_type, sample_num): """ Searches for specific sample :param run_id: :param metrics_type: {c_sample_metric_type_latency_node | c_sample_metric_type_latency_broker | c_sample_metric_type_ping | c_sample_metric_vpn} :param sample_num: :return: sample :raises PerfError """ self._check_processed_sampled() run = self.find_run(run_id) #idempotent - samples will be read just once run.read_samples() if (metrics_type==c_sample_metric_type_latency_node): return run.latency_node_latency_series.find_sample(sample_num) if (metrics_type==c_sample_metric_type_latency_broker): return run.broker_node_latency_series.find_sample(sample_num) if (metrics_type==c_sample_metric_type_ping): return run.ping_series.find_sample(sample_num) if (metrics_type==c_sample_metric_vpn): return run.broker_series.find_sample(sample_num) raise PerfError(f'Unsupported metric_type: {metrics_type}')
[ 1, 396, 448, 2683, 2683, 2683, 2683, 2683, 9072, 13, 29937, 341, 1806, 19245, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29900, 29892, 4956, 815, 15025, 29892, 529, 5813, 29958, 313, 29966, 26862, 6227, 12948, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29906, 29900, 29892, 4956, 815, 15025, 29892, 529, 5813, 29958, 313, 29966, 26862, 6227, 12948, 13, 29937, 448, 2683, 2683, 2683, 2683, 2683, 9072, 13, 13, 13, 5215, 13149, 13, 5215, 2897, 29889, 2084, 13, 3166, 2897, 1053, 2224, 13, 13, 3166, 869, 9435, 29918, 3188, 1053, 13103, 5160, 13, 3166, 869, 3075, 1934, 1053, 334, 13, 3166, 869, 546, 29888, 29918, 2704, 1053, 2431, 29888, 2392, 13, 3166, 869, 3389, 1053, 7525, 13, 3166, 869, 3389, 29918, 2914, 29918, 5479, 1053, 7525, 3591, 6508, 13, 13, 13, 1990, 7525, 14683, 29898, 18877, 5160, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4423, 29901, 7525, 3591, 6508, 1125, 13, 4706, 9995, 13, 4706, 7525, 14683, 23660, 9068, 599, 6057, 2629, 7525, 3591, 6508, 322, 8128, 3168, 304, 6597, 848, 13, 4706, 8445, 13, 4706, 584, 3207, 4423, 29901, 13, 4706, 9995, 13, 4706, 13103, 5160, 17255, 2344, 12035, 1311, 29897, 13, 4706, 1583, 3032, 5479, 353, 4423, 13, 4706, 1583, 3032, 1761, 29918, 3389, 29879, 353, 1051, 580, 13, 4706, 1583, 3032, 5014, 29918, 5721, 5562, 29918, 29880, 2579, 1270, 29918, 27736, 29922, 5574, 13, 4706, 396, 5143, 15562, 1303, 13, 4706, 1583, 3032, 5014, 287, 29918, 27736, 353, 7700, 13, 13, 1678, 822, 1889, 29918, 3389, 29918, 27736, 29898, 1311, 29892, 1889, 29918, 5721, 5562, 29918, 29880, 2579, 1270, 29918, 27736, 29901, 11227, 29922, 5574, 1125, 13, 4706, 3876, 24217, 353, 1583, 3032, 3198, 29918, 4632, 29918, 12083, 29918, 262, 29918, 3389, 29918, 5479, 580, 13, 4706, 1583, 3032, 5014, 29918, 5721, 5562, 29918, 29880, 2579, 1270, 29918, 27736, 353, 1889, 29918, 5721, 5562, 29918, 29880, 2579, 1270, 29918, 27736, 13, 4706, 565, 451, 3876, 24217, 29901, 13, 9651, 12020, 2184, 24365, 29898, 29888, 29915, 29961, 11432, 29962, 518, 5746, 1806, 4214, 29962, 28272, 4138, 947, 451, 1863, 26254, 1311, 3032, 5479, 29889, 4632, 29918, 12083, 29913, 1495, 13, 4706, 363, 1065, 29918, 3972, 297, 1583, 3032, 949, 29918, 1761, 29918, 3389, 29879, 7295, 13, 9651, 1583, 3032, 1761, 29918, 3389, 29879, 29889, 4397, 29898, 6558, 29898, 1311, 29892, 3389, 29918, 3972, 876, 13, 4706, 1583, 3032, 5014, 287, 29918, 27736, 353, 5852, 13, 13, 1678, 822, 903, 1445, 29918, 2084, 29918, 262, 29918, 3389, 29918, 5479, 29898, 1311, 29892, 10422, 29901, 851, 29897, 1599, 851, 29901, 13, 4706, 736, 1583, 3032, 5479, 29889, 4632, 29918, 12083, 718, 5591, 29908, 718, 10422, 13, 13, 1678, 822, 903, 3198, 29918, 1445, 29918, 262, 29918, 3389, 29918, 5479, 29898, 1311, 29892, 10422, 29901, 851, 29897, 1599, 6120, 29901, 13, 4706, 736, 2224, 29889, 9933, 29898, 1311, 3032, 1445, 29918, 2084, 29918, 262, 29918, 3389, 29918, 5479, 29898, 9507, 876, 13, 13, 1678, 822, 903, 3198, 29918, 4632, 29918, 12083, 29918, 262, 29918, 3389, 29918, 5479, 29898, 1311, 29897, 1599, 6120, 29901, 13, 4706, 736, 2224, 29889, 9933, 29898, 1311, 3032, 5479, 29889, 4632, 29918, 12083, 29897, 13, 13, 1678, 822, 903, 5325, 29918, 262, 29918, 3389, 29918, 5479, 29898, 1311, 29892, 4766, 1125, 13, 4706, 736, 13149, 29889, 23705, 29898, 1311, 3032, 1445, 29918, 2084, 29918, 262, 29918, 3389, 29918, 5479, 29898, 546, 29888, 29918, 11037, 29918, 3389, 29918, 3972, 876, 13, 13, 1678, 822, 903, 3972, 29879, 29918, 262, 29918, 3389, 29918, 5479, 29898, 1311, 29892, 4766, 1125, 13, 4706, 21669, 353, 13149, 29889, 23705, 29898, 1311, 3032, 1445, 29918, 2084, 29918, 262, 29918, 3389, 29918, 5479, 29898, 546, 29888, 29918, 11037, 29918, 3389, 29918, 3972, 876, 13, 4706, 736, 1051, 29898, 4572, 29898, 2892, 934, 29901, 2897, 29889, 2084, 29889, 275, 3972, 29898, 1445, 511, 21669, 876, 13, 13, 1678, 822, 903, 3198, 29918, 5014, 287, 29918, 11249, 29881, 29898, 1311, 1125, 13, 4706, 565, 451, 1583, 3032, 5014, 287, 29918, 27736, 29901, 13, 9651, 12020, 2184, 24365, 29898, 29888, 29915, 29961, 11432, 29962, 518, 5746, 1806, 4214, 29962, 7525, 14683, 451, 16601, 29889, 11080, 1082, 1405, 5014, 29918, 3389, 29918, 27736, 580, 2748, 304, 1303, 599, 4559, 848, 19423, 1495, 13, 13, 1678, 822, 903, 949, 29918, 1761, 29918, 3389, 29879, 29898, 1311, 29897, 1599, 1051, 29901, 13, 4706, 736, 1583, 3032, 3972, 29879, 29918, 262, 29918, 3389, 29918, 5479, 29898, 546, 29888, 29918, 11037, 29918, 3389, 29918, 3972, 29897, 13, 13, 13, 1678, 822, 599, 29918, 3389, 29879, 29898, 1311, 29897, 1599, 1051, 29901, 13, 4706, 9995, 13, 4706, 2178, 6057, 13, 4706, 584, 2457, 29901, 1051, 310, 599, 6057, 13, 4706, 9995, 13, 4706, 1583, 3032, 3198, 29918, 5014, 287, 29918, 11249, 29881, 580, 13, 4706, 736, 1583, 3032, 1761, 29918, 3389, 29879, 13, 13, 1678, 822, 1284, 29918, 3389, 29898, 1311, 29892, 1065, 29918, 333, 29892, 1303, 29918, 27736, 29901, 11227, 29922, 5574, 1125, 13, 4706, 9995, 13, 4706, 11856, 267, 363, 1065, 411, 1065, 29918, 333, 13, 13, 4706, 584, 3207, 1065, 29918, 333, 29901, 13, 4706, 584, 3207, 1303, 29918, 27736, 29901, 1303, 884, 278, 23316, 2478, 1434, 1361, 292, 975, 278, 1065, 13, 4706, 584, 2457, 29901, 7525, 13, 4706, 584, 22692, 29901, 2431, 29888, 2392, 29901, 565, 1065, 29918, 333, 471, 451, 1476, 13, 4706, 9995, 13, 4706, 1583, 3032, 3198, 29918, 5014, 287, 29918, 11249, 29881, 580, 13, 4706, 1018, 29901, 13, 9651, 1065, 353, 29871, 2446, 29898, 4572, 29898, 2892, 2944, 29901, 2944, 29889, 3389, 29918, 7299, 29889, 3389, 29918, 333, 1360, 3389, 29918, 333, 29892, 1583, 3032, 1761, 29918, 3389, 29879, 876, 13, 9651, 565, 1303, 29918, 27736, 29901, 13, 18884, 396, 680, 1526, 327, 296, 448, 11916, 674, 367, 1303, 925, 2748, 13, 18884, 1065, 29889, 949, 29918, 27736, 580, 13, 9651, 736, 1065, 13, 4706, 5174, 22303, 13463, 362, 29901, 13, 9651, 12020, 2431, 29888, 2392, 29898, 29888, 29915, 3389, 29918, 333, 29901, 426, 3389, 29918, 333, 29913, 451, 1476, 1495, 13, 13, 13, 1678, 822, 1284, 29918, 11249, 29898, 1311, 29892, 3389, 29918, 333, 29892, 21556, 29918, 1853, 29892, 4559, 29918, 1949, 1125, 13, 4706, 9995, 13, 4706, 11856, 267, 363, 2702, 4559, 13, 13, 4706, 584, 3207, 1065, 29918, 333, 29901, 13, 4706, 584, 3207, 21556, 29918, 1853, 29901, 426, 29883, 29918, 11249, 29918, 16414, 29918, 1853, 29918, 29880, 2579, 1270, 29918, 3177, 891, 274, 29918, 11249, 29918, 16414, 29918, 1853, 29918, 29880, 2579, 1270, 29918, 6729, 3946, 891, 274, 29918, 11249, 29918, 16414, 29918, 1853, 29918, 15702, 891, 274, 29918, 11249, 29918, 16414, 29918, 29894, 21257, 29913, 13, 4706, 584, 3207, 4559, 29918, 1949, 29901, 13, 4706, 584, 2457, 29901, 4559, 13, 4706, 584, 336, 4637, 2431, 29888, 2392, 13, 4706, 9995, 13, 4706, 1583, 3032, 3198, 29918, 5014, 287, 29918, 11249, 29881, 580, 13, 4706, 1065, 353, 1583, 29889, 2886, 29918, 3389, 29898, 3389, 29918, 333, 29897, 13, 4706, 396, 680, 1526, 327, 296, 448, 11916, 674, 367, 1303, 925, 2748, 13, 4706, 1065, 29889, 949, 29918, 27736, 580, 13, 4706, 565, 313, 2527, 10817, 29918, 1853, 1360, 29883, 29918, 11249, 29918, 16414, 29918, 1853, 29918, 29880, 2579, 1270, 29918, 3177, 1125, 13, 9651, 736, 1065, 29889, 29880, 2579, 1270, 29918, 3177, 29918, 29880, 2579, 1270, 29918, 13757, 29889, 2886, 29918, 11249, 29898, 11249, 29918, 1949, 29897, 13, 4706, 565, 313, 2527, 10817, 29918, 1853, 1360, 29883, 29918, 11249, 29918, 16414, 29918, 1853, 29918, 29880, 2579, 1270, 29918, 6729, 3946, 1125, 13, 9651, 736, 1065, 29889, 6729, 3946, 29918, 3177, 29918, 29880, 2579, 1270, 29918, 13757, 29889, 2886, 29918, 11249, 29898, 11249, 29918, 1949, 29897, 13, 4706, 565, 313, 2527, 10817, 29918, 1853, 1360, 29883, 29918, 11249, 29918, 16414, 29918, 1853, 29918, 15702, 1125, 13, 9651, 736, 1065, 29889, 15702, 29918, 13757, 29889, 2886, 29918, 11249, 29898, 11249, 29918, 1949, 29897, 13, 4706, 565, 313, 2527, 10817, 29918, 1853, 1360, 29883, 29918, 11249, 29918, 16414, 29918, 29894, 21257, 1125, 13, 9651, 736, 1065, 29889, 6729, 3946, 29918, 13757, 29889, 2886, 29918, 11249, 29898, 11249, 29918, 1949, 29897, 13, 4706, 12020, 2431, 29888, 2392, 29898, 29888, 29915, 25807, 29884, 3016, 287, 12714, 29918, 1853, 29901, 426, 2527, 10817, 29918, 1853, 29913, 1495, 2 ]
back/config.py
aninstein/sex_code_blog
116
163414
#!/usr/bin/env python # -*- coding: utf-8 -*- """ http://www.pythondoc.com/flask/config.html#id6 """ import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = os.getenv('SECRET_KEY') or 'MPk2WlUArcLeeU_iohzT' ''' # 旧版本 import random import string ''.join(random.choices(string.ascii_letters + string.digits, k=15)) # py3.6+ import secrets secrets.token_urlsafe(nbytes=15) ''' SQLALCHEMY_COMMIT_ON_TEARDOWN = True SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_RECORD_QUERIES = True # 分页 FLASKY_POSTS_PER_PAGE = 10 # 上传图片 UPLOADED_IMAGES_DEST = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static/images') MAX_CONTENT_LENGTH = 10 * 1024 * 1024 # 邮件服务器设置 MAIL_SERVER = os.getenv('MAIL_SERVER') # 163不支持STARTTLS MAIL_PORT = 465 MAIL_USE_SSL = True MAIL_USERNAME = os.getenv('MAIL_USERNAME') MAIL_PASSWORD = os.getenv('MAIL_PASSWORD') MAIL_DEFAULT_SENDER = ('别院牧志', os.getenv('MAIL_USERNAME')) # redis 配置 # REDIS_URL = "redis://:password@localhost:6379/0" REDIS_URL = "redis://localhost:6379/0" def __init__(self): pass @staticmethod def init_app(app): pass class MySQLConfig: MYSQL_USERNAME = os.getenv('MYSQL_USER') MYSQL_PASSWORD = os.getenv('MYSQL_PASSWORD') MYSQL_DB = os.getenv('MYSQL_DB') MYSQL_HOST = 'localhost:3306' MYSQL_CHARSET = 'utf8mb4' # 为了支持 emoji 显示,需要设置为 utf8mb4 编码 class DevelopmentConfig(Config): DEBUG = True database = MySQLConfig.MYSQL_DB or 'iyblog_dev' SQLALCHEMY_DATABASE_URI = f'mysql+pymysql://{MySQLConfig.MYSQL_USERNAME}:{MySQLConfig.MYSQL_PASSWORD}' \ f'@{MySQLConfig.MYSQL_HOST}/{database}?charset={MySQLConfig.MYSQL_CHARSET}' class TestingConfig(Config): TESTING = True database = MySQLConfig.MYSQL_DB or 'iyblog_test' SQLALCHEMY_DATABASE_URI = f'mysql+pymysql://{MySQLConfig.MYSQL_USERNAME}:{MySQLConfig.MYSQL_PASSWORD}' \ f'@{MySQLConfig.MYSQL_HOST}/{database}?charset={MySQLConfig.MYSQL_CHARSET}' class ProductionConfig(Config): database = MySQLConfig.MYSQL_DB or 'iyblog_product' SQLALCHEMY_DATABASE_URI = f'mysql+pymysql://{MySQLConfig.MYSQL_USERNAME}:{MySQLConfig.MYSQL_PASSWORD}' \ f'@{MySQLConfig.MYSQL_HOST}/{database}?charset={MySQLConfig.MYSQL_CHARSET}' config = { 'development': DevelopmentConfig, 'testing': TestingConfig, 'production': ProductionConfig, 'default': DevelopmentConfig }
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 13, 1124, 597, 1636, 29889, 29886, 1541, 898, 542, 29889, 510, 29914, 1579, 1278, 29914, 2917, 29889, 1420, 29937, 333, 29953, 13, 15945, 29908, 13, 5215, 2897, 13, 13, 6707, 381, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 876, 13, 13, 13, 1990, 12782, 29901, 13, 1678, 3725, 22245, 29911, 29918, 10818, 353, 2897, 29889, 657, 6272, 877, 1660, 22245, 29911, 29918, 10818, 1495, 470, 525, 3580, 29895, 29906, 29956, 29880, 29965, 1433, 29883, 3226, 29872, 29965, 29918, 601, 29882, 29920, 29911, 29915, 13, 13, 1678, 14550, 13, 1678, 396, 29871, 233, 154, 170, 30845, 30346, 13, 1678, 1053, 4036, 13, 1678, 1053, 1347, 13, 1678, 525, 4286, 7122, 29898, 8172, 29889, 1859, 1575, 29898, 1807, 29889, 294, 18869, 29918, 1026, 2153, 718, 1347, 29889, 7501, 1169, 29892, 413, 29922, 29896, 29945, 876, 13, 1678, 396, 11451, 29941, 29889, 29953, 29974, 13, 1678, 1053, 22183, 1372, 13, 1678, 22183, 1372, 29889, 6979, 29918, 2271, 11177, 29898, 29876, 13193, 29922, 29896, 29945, 29897, 13, 1678, 14550, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 3217, 7428, 1806, 29918, 1164, 29918, 4330, 1718, 3970, 16048, 353, 5852, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 5659, 11375, 29918, 6720, 4571, 29943, 28541, 29903, 353, 7700, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 1525, 29907, 25593, 29918, 13356, 1001, 29059, 353, 5852, 13, 1678, 396, 29871, 30748, 31610, 13, 1678, 383, 29931, 3289, 29968, 29979, 29918, 5438, 29903, 29918, 13171, 29918, 7228, 1692, 353, 29871, 29896, 29900, 13, 1678, 396, 29871, 30429, 31471, 30861, 31122, 13, 1678, 11901, 3927, 29909, 2287, 29928, 29918, 2382, 29903, 29918, 2287, 1254, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 22168, 1445, 1649, 8243, 525, 7959, 29914, 8346, 1495, 13, 1678, 18134, 29918, 22412, 3919, 29918, 19433, 353, 29871, 29896, 29900, 334, 29871, 29896, 29900, 29906, 29946, 334, 29871, 29896, 29900, 29906, 29946, 13, 1678, 396, 29871, 236, 133, 177, 30631, 31520, 31358, 30943, 30872, 30669, 13, 1678, 14861, 6227, 29918, 18603, 353, 2897, 29889, 657, 6272, 877, 1529, 6227, 29918, 18603, 1495, 13, 1678, 396, 29871, 29896, 29953, 29941, 30413, 31541, 31695, 25826, 29911, 8547, 13, 1678, 14861, 6227, 29918, 15082, 353, 29871, 29946, 29953, 29945, 13, 1678, 14861, 6227, 29918, 17171, 29918, 18641, 353, 5852, 13, 1678, 14861, 6227, 29918, 11889, 5813, 353, 2897, 29889, 657, 6272, 877, 1529, 6227, 29918, 11889, 5813, 1495, 13, 1678, 14861, 6227, 29918, 25711, 17013, 353, 2897, 29889, 657, 6272, 877, 1529, 6227, 29918, 25711, 17013, 1495, 13, 1678, 14861, 6227, 29918, 23397, 29918, 29903, 1430, 8032, 353, 6702, 232, 139, 174, 30963, 234, 140, 170, 31096, 742, 2897, 29889, 657, 6272, 877, 1529, 6227, 29918, 11889, 5813, 8785, 13, 1678, 396, 29825, 29871, 31361, 30669, 13, 1678, 396, 390, 3352, 3235, 29918, 4219, 353, 376, 1127, 275, 597, 29901, 5630, 29992, 7640, 29901, 29953, 29941, 29955, 29929, 29914, 29900, 29908, 13, 1678, 390, 3352, 3235, 29918, 4219, 353, 376, 1127, 275, 597, 7640, 29901, 29953, 29941, 29955, 29929, 29914, 29900, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1209, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2069, 29918, 932, 29898, 932, 1125, 13, 4706, 1209, 13, 13, 13, 1990, 9254, 3991, 29901, 13, 1678, 19519, 4176, 29918, 11889, 5813, 353, 2897, 29889, 657, 6272, 877, 17870, 4176, 29918, 11889, 1495, 13, 1678, 19519, 4176, 29918, 25711, 17013, 353, 2897, 29889, 657, 6272, 877, 17870, 4176, 29918, 25711, 17013, 1495, 13, 1678, 19519, 4176, 29918, 4051, 353, 2897, 29889, 657, 6272, 877, 17870, 4176, 29918, 4051, 1495, 13, 1678, 19519, 4176, 29918, 20832, 353, 525, 7640, 29901, 29941, 29941, 29900, 29953, 29915, 13, 1678, 19519, 4176, 29918, 11282, 10490, 353, 525, 9420, 29947, 8337, 29946, 29915, 29871, 396, 29871, 30573, 30743, 31541, 31695, 953, 29877, 2397, 29871, 31542, 30858, 30214, 31383, 30698, 30872, 30669, 30573, 23616, 29947, 8337, 29946, 29871, 31795, 31183, 13, 13, 13, 1990, 14650, 3991, 29898, 3991, 1125, 13, 1678, 21681, 353, 5852, 13, 1678, 2566, 353, 9254, 3991, 29889, 17870, 4176, 29918, 4051, 470, 525, 19881, 7312, 29918, 3359, 29915, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 285, 29915, 7938, 29974, 29886, 962, 952, 1519, 597, 29912, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 11889, 5813, 6177, 29912, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 25711, 17013, 10162, 320, 13, 462, 795, 285, 29915, 28312, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 20832, 6822, 29912, 9803, 29913, 29973, 3090, 842, 3790, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 11282, 10490, 10162, 13, 13, 13, 1990, 4321, 292, 3991, 29898, 3991, 1125, 13, 1678, 17067, 1254, 4214, 353, 5852, 13, 1678, 2566, 353, 9254, 3991, 29889, 17870, 4176, 29918, 4051, 470, 525, 19881, 7312, 29918, 1688, 29915, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 285, 29915, 7938, 29974, 29886, 962, 952, 1519, 597, 29912, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 11889, 5813, 6177, 29912, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 25711, 17013, 10162, 320, 13, 462, 795, 285, 29915, 28312, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 20832, 6822, 29912, 9803, 29913, 29973, 3090, 842, 3790, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 11282, 10490, 10162, 13, 13, 13, 1990, 19561, 3991, 29898, 3991, 1125, 13, 1678, 2566, 353, 9254, 3991, 29889, 17870, 4176, 29918, 4051, 470, 525, 19881, 7312, 29918, 4704, 29915, 13, 1678, 3758, 1964, 3210, 12665, 29979, 29918, 25832, 27982, 29918, 15551, 353, 285, 29915, 7938, 29974, 29886, 962, 952, 1519, 597, 29912, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 11889, 5813, 6177, 29912, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 25711, 17013, 10162, 320, 13, 462, 795, 285, 29915, 28312, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 20832, 6822, 29912, 9803, 29913, 29973, 3090, 842, 3790, 3421, 4176, 3991, 29889, 17870, 4176, 29918, 11282, 10490, 10162, 13, 13, 13, 2917, 353, 426, 13, 1678, 525, 25431, 2396, 14650, 3991, 29892, 13, 1678, 525, 13424, 2396, 4321, 292, 3991, 29892, 13, 1678, 525, 24601, 2396, 19561, 3991, 29892, 13, 1678, 525, 4381, 2396, 14650, 3991, 13, 29913, 13, 2 ]
pytglib/api/types/rich_text_phone_number.py
iTeam-co/pytglib
6
23650
<filename>pytglib/api/types/rich_text_phone_number.py from ..utils import Object class RichTextPhoneNumber(Object): """ A rich text phone number Attributes: ID (:obj:`str`): ``RichTextPhoneNumber`` Args: text (:class:`telegram.api.types.RichText`): Text phone_number (:obj:`str`): Phone number Returns: RichText Raises: :class:`telegram.Error` """ ID = "richTextPhoneNumber" def __init__(self, text, phone_number, **kwargs): self.text = text # RichText self.phone_number = phone_number # str @staticmethod def read(q: dict, *args) -> "RichTextPhoneNumber": text = Object.read(q.get('text')) phone_number = q.get('phone_number') return RichTextPhoneNumber(text, phone_number)
[ 1, 529, 9507, 29958, 2272, 29873, 29887, 1982, 29914, 2754, 29914, 8768, 29914, 4018, 29918, 726, 29918, 6710, 29918, 4537, 29889, 2272, 13, 13, 13, 3166, 6317, 13239, 1053, 4669, 13, 13, 13, 1990, 4385, 1626, 9861, 4557, 29898, 2061, 1125, 13, 1678, 9995, 13, 1678, 319, 8261, 1426, 9008, 1353, 29871, 13, 13, 1678, 6212, 5026, 29901, 13, 4706, 3553, 13940, 5415, 18078, 710, 29952, 1125, 4954, 25627, 1626, 9861, 4557, 16159, 13, 13, 1678, 826, 3174, 29901, 13, 4706, 1426, 13940, 1990, 18078, 15494, 1393, 29889, 2754, 29889, 8768, 29889, 25627, 1626, 29952, 1125, 13, 9651, 3992, 29871, 13, 4706, 9008, 29918, 4537, 13940, 5415, 18078, 710, 29952, 1125, 13, 9651, 24323, 1353, 13, 13, 1678, 16969, 29901, 13, 4706, 4385, 1626, 13, 13, 1678, 390, 1759, 267, 29901, 13, 4706, 584, 1990, 18078, 15494, 1393, 29889, 2392, 29952, 13, 1678, 9995, 13, 1678, 3553, 353, 376, 4018, 1626, 9861, 4557, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1426, 29892, 9008, 29918, 4537, 29892, 3579, 19290, 1125, 13, 308, 13, 4706, 1583, 29889, 726, 353, 1426, 29871, 396, 4385, 1626, 13, 4706, 1583, 29889, 6710, 29918, 4537, 353, 9008, 29918, 4537, 29871, 396, 851, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1303, 29898, 29939, 29901, 9657, 29892, 334, 5085, 29897, 1599, 376, 25627, 1626, 9861, 4557, 1115, 13, 4706, 1426, 353, 4669, 29889, 949, 29898, 29939, 29889, 657, 877, 726, 8785, 13, 4706, 9008, 29918, 4537, 353, 3855, 29889, 657, 877, 6710, 29918, 4537, 1495, 13, 4706, 736, 4385, 1626, 9861, 4557, 29898, 726, 29892, 9008, 29918, 4537, 29897, 13, 2 ]
bin/bin/music_parse.py
anthonynguyen/dotfiles
0
188686
#!/usr/bin/env python3 import subprocess o = subprocess.check_output(["mpc", "-f", "%title%"]).decode() if "[playing]" in o: #p = o.split("\n") #print("{} {}".format(u"\uf001", p[0])) print(u"\uf001") else: print(u"\uf04c")
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 1014, 5014, 13, 13, 29877, 353, 1014, 5014, 29889, 3198, 29918, 4905, 29898, 3366, 1526, 29883, 613, 11663, 29888, 613, 11860, 3257, 29995, 3108, 467, 13808, 580, 13, 13, 361, 14704, 1456, 292, 18017, 297, 288, 29901, 13, 12, 29937, 29886, 353, 288, 29889, 5451, 14182, 29876, 1159, 13, 12, 29937, 2158, 703, 8875, 29871, 6571, 1642, 4830, 29898, 29884, 26732, 1137, 29900, 29900, 29896, 613, 282, 29961, 29900, 12622, 13, 12, 2158, 29898, 29884, 26732, 1137, 29900, 29900, 29896, 1159, 13, 2870, 29901, 13, 12, 2158, 29898, 29884, 26732, 1137, 29900, 29946, 29883, 1159, 2 ]
split.py
HieuNT1998/BraTS-DMFNet
0
165112
# """ # The code will split the training set into k-fold for cross-validation # """ # import os # import numpy as np # from sklearn.model_selection import StratifiedKFold # root = './data/2018/MICCAI_BraTS_2018_Data_Training' # valid_data_dir = './data/2018/MICCAI_BraTS_2018_Data_Validation' # def write(data, fname, root=root): # fname = os.path.join(root, fname) # with open(fname, 'w') as f: # f.write('\n'.join(data)) # hgg = os.listdir(os.path.join(root, 'HGG')) # hgg = [os.path.join('HGG', f) for f in hgg] # lgg = os.listdir(os.path.join(root, 'LGG')) # lgg = [os.path.join('LGG', f) for f in lgg] # X = hgg + lgg # Y = [1] * len(hgg) + [0] * len(lgg) # write(X, 'all.txt') # X, Y = np.array(X), np.array(Y) # skf = StratifiedKFold(n_splits=5, shuffle=True, random_state=2018) # for k, (train_index, valid_index) in enumerate(skf.split(Y, Y)): # train_list = list(X[train_index]) # valid_list = list(X[valid_index]) # write(train_list, 'train_{}.txt'.format(k)) # write(valid_list, 'valid_{}.txt'.format(k)) # valid = os.listdir(os.path.join(valid_data_dir)) # valid = [f for f in valid if not (f.endswith('.csv') or f.endswith('.txt'))] # write(valid, 'valid.txt', root=valid_data_dir) """ The code will split the training set into k-fold for cross-validation """ import os import sys import numpy as np from sklearn.model_selection import StratifiedKFold import shutil root = './data/2018/MICCAI_BraTS_2018_Data_Training' valid_data_dir = './data/2018/MICCAI_BraTS_2018_Data_Validation' backup = './2018/datasets' backup_files = os.listdir(backup) if len(backup_files) != 0: print("Copy from backup") for file in backup_files: shutil.copy(os.path.join(backup, file), os.path.join(root, file)) count=0 with open(os.path.join(root, file), 'r') as f: for line in f: count += 1 print("File {} has {} lines.".format(file, count)) sys.exit() def write(data, fname, root=root): fname = os.path.join(root, fname) with open(fname, 'w') as f: f.write('\n'.join(data)) limit = float(sys.argv[1]) hgg = os.listdir(os.path.join(root, 'HGG')) hgg = [os.path.join('HGG', f) for f in hgg] lgg = os.listdir(os.path.join(root, 'LGG')) lgg = [os.path.join('LGG', f) for f in lgg] print("Original size: HGG:{}, LGG:{}, Total:{}".format(len(hgg), len(lgg), len(hgg) + len(lgg))) hgg = hgg[:int(limit*len(hgg))] lgg = lgg[:int(limit*len(lgg))] print("Limited size: HGG:{}, LGG:{}, Total:{}".format(len(hgg), len(lgg), len(hgg) + len(lgg))) X = hgg + lgg Y = [1] * len(hgg) + [0] * len(lgg) write(X, 'all.txt') shutil.copy(os.path.join(root,'all.txt'), os.path.join(backup, 'all.txt')) X, Y = np.array(X), np.array(Y) skf = StratifiedKFold(n_splits=5, shuffle=True, random_state=2018) for k, (train_index, valid_index) in enumerate(skf.split(Y, Y)): train_list = list(X[train_index]) valid_list = list(X[valid_index]) write(train_list, 'train_{}.txt'.format(k)) write(valid_list, 'valid_{}.txt'.format(k)) shutil.copy(os.path.join(root,'train_{}.txt'.format(k)), os.path.join(backup, 'train_{}.txt'.format(k))) shutil.copy(os.path.join(root,'valid_{}.txt'.format(k)), os.path.join(backup, 'valid_{}.txt'.format(k))) valid = os.listdir(os.path.join(valid_data_dir)) valid = [f for f in valid if not (f.endswith('.csv') or f.endswith('.txt'))] write(valid, 'valid.txt', root=valid_data_dir)
[ 1, 396, 9995, 30004, 13, 29937, 450, 775, 674, 6219, 278, 6694, 731, 964, 413, 29899, 8771, 363, 4891, 29899, 18157, 30004, 13, 29937, 9995, 30004, 13, 30004, 13, 29937, 1053, 2897, 30004, 13, 30004, 13, 29937, 1053, 12655, 408, 7442, 30004, 13, 29937, 515, 2071, 19668, 29889, 4299, 29918, 21731, 1053, 3767, 271, 2164, 29968, 29943, 1025, 30004, 13, 30004, 13, 29937, 3876, 353, 19283, 1272, 29914, 29906, 29900, 29896, 29947, 29914, 29924, 2965, 5454, 29902, 29918, 28183, 9375, 29918, 29906, 29900, 29896, 29947, 29918, 1469, 29918, 5323, 2827, 29915, 30004, 13, 29937, 2854, 29918, 1272, 29918, 3972, 353, 19283, 1272, 29914, 29906, 29900, 29896, 29947, 29914, 29924, 2965, 5454, 29902, 29918, 28183, 9375, 29918, 29906, 29900, 29896, 29947, 29918, 1469, 29918, 19448, 29915, 30004, 13, 30004, 13, 30004, 13, 29937, 822, 2436, 29898, 1272, 29892, 285, 978, 29892, 3876, 29922, 4632, 1125, 30004, 13, 29937, 268, 285, 978, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 285, 978, 8443, 13, 29937, 268, 411, 1722, 29898, 29888, 978, 29892, 525, 29893, 1495, 408, 285, 29901, 30004, 13, 29937, 308, 285, 29889, 3539, 28909, 29876, 4286, 7122, 29898, 1272, 876, 30004, 13, 30004, 13, 30004, 13, 29937, 298, 1505, 353, 2897, 29889, 1761, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 525, 29950, 26788, 8785, 30004, 13, 29937, 298, 1505, 353, 518, 359, 29889, 2084, 29889, 7122, 877, 29950, 26788, 742, 285, 29897, 363, 285, 297, 298, 1505, 29962, 30004, 13, 29937, 301, 1505, 353, 2897, 29889, 1761, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 525, 29931, 26788, 8785, 30004, 13, 29937, 301, 1505, 353, 518, 359, 29889, 2084, 29889, 7122, 877, 29931, 26788, 742, 285, 29897, 363, 285, 297, 301, 1505, 29962, 30004, 13, 30004, 13, 29937, 1060, 353, 298, 1505, 718, 301, 1505, 30004, 13, 29937, 612, 353, 518, 29896, 29962, 334, 7431, 29898, 29882, 1505, 29897, 718, 518, 29900, 29962, 334, 7431, 29898, 29880, 1505, 8443, 13, 30004, 13, 29937, 2436, 29898, 29990, 29892, 525, 497, 29889, 3945, 1495, 30004, 13, 30004, 13, 29937, 1060, 29892, 612, 353, 7442, 29889, 2378, 29898, 29990, 511, 7442, 29889, 2378, 29898, 29979, 8443, 13, 30004, 13, 29937, 2071, 29888, 353, 3767, 271, 2164, 29968, 29943, 1025, 29898, 29876, 29918, 23579, 1169, 29922, 29945, 29892, 528, 21897, 29922, 5574, 29892, 4036, 29918, 3859, 29922, 29906, 29900, 29896, 29947, 8443, 13, 30004, 13, 29937, 363, 413, 29892, 313, 14968, 29918, 2248, 29892, 2854, 29918, 2248, 29897, 297, 26985, 29898, 808, 29888, 29889, 5451, 29898, 29979, 29892, 612, 22164, 30004, 13, 29937, 268, 7945, 29918, 1761, 353, 1051, 29898, 29990, 29961, 14968, 29918, 2248, 2314, 30004, 13, 29937, 268, 2854, 29918, 1761, 353, 1051, 29898, 29990, 29961, 3084, 29918, 2248, 2314, 30004, 13, 30004, 13, 29937, 268, 2436, 29898, 14968, 29918, 1761, 29892, 525, 14968, 648, 1836, 3945, 4286, 4830, 29898, 29895, 876, 30004, 13, 29937, 268, 2436, 29898, 3084, 29918, 1761, 29892, 525, 3084, 648, 1836, 3945, 4286, 4830, 29898, 29895, 876, 30004, 13, 30004, 13, 29937, 2854, 353, 2897, 29889, 1761, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 3084, 29918, 1272, 29918, 3972, 876, 30004, 13, 29937, 2854, 353, 518, 29888, 363, 285, 297, 2854, 565, 451, 313, 29888, 29889, 1975, 2541, 12839, 7638, 1495, 470, 285, 29889, 1975, 2541, 12839, 3945, 8785, 29962, 30004, 13, 29937, 2436, 29898, 3084, 29892, 525, 3084, 29889, 3945, 742, 3876, 29922, 3084, 29918, 1272, 29918, 3972, 8443, 13, 30004, 13, 30004, 13, 30004, 13, 15945, 19451, 13, 1576, 775, 674, 6219, 278, 6694, 731, 964, 413, 29899, 8771, 363, 4891, 29899, 18157, 30004, 13, 15945, 19451, 13, 30004, 13, 5215, 2897, 30004, 13, 5215, 10876, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 3166, 2071, 19668, 29889, 4299, 29918, 21731, 1053, 3767, 271, 2164, 29968, 29943, 1025, 30004, 13, 5215, 528, 4422, 30004, 13, 30004, 13, 4632, 353, 19283, 1272, 29914, 29906, 29900, 29896, 29947, 29914, 29924, 2965, 5454, 29902, 29918, 28183, 9375, 29918, 29906, 29900, 29896, 29947, 29918, 1469, 29918, 5323, 2827, 29915, 30004, 13, 3084, 29918, 1272, 29918, 3972, 353, 19283, 1272, 29914, 29906, 29900, 29896, 29947, 29914, 29924, 2965, 5454, 29902, 29918, 28183, 9375, 29918, 29906, 29900, 29896, 29947, 29918, 1469, 29918, 19448, 29915, 30004, 13, 30004, 13, 1627, 786, 353, 19283, 29906, 29900, 29896, 29947, 29914, 14538, 1691, 29915, 30004, 13, 1627, 786, 29918, 5325, 353, 2897, 29889, 1761, 3972, 29898, 1627, 786, 8443, 13, 361, 7431, 29898, 1627, 786, 29918, 5325, 29897, 2804, 29871, 29900, 29901, 30004, 13, 1678, 1596, 703, 11882, 515, 16199, 1159, 30004, 13, 1678, 363, 934, 297, 16199, 29918, 5325, 29901, 30004, 13, 4706, 528, 4422, 29889, 8552, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1627, 786, 29892, 934, 511, 2897, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 934, 876, 30004, 13, 4706, 2302, 29922, 29900, 30004, 13, 4706, 411, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 934, 511, 525, 29878, 1495, 408, 285, 29901, 30004, 13, 9651, 363, 1196, 297, 285, 29901, 30004, 13, 18884, 2302, 4619, 29871, 29896, 30004, 13, 9651, 1596, 703, 2283, 6571, 756, 6571, 3454, 1213, 29889, 4830, 29898, 1445, 29892, 2302, 876, 30004, 13, 1678, 10876, 29889, 13322, 26471, 13, 30004, 13, 1753, 2436, 29898, 1272, 29892, 285, 978, 29892, 3876, 29922, 4632, 1125, 30004, 13, 1678, 285, 978, 353, 2897, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 285, 978, 8443, 13, 1678, 411, 1722, 29898, 29888, 978, 29892, 525, 29893, 1495, 408, 285, 29901, 30004, 13, 4706, 285, 29889, 3539, 28909, 29876, 4286, 7122, 29898, 1272, 876, 30004, 13, 30004, 13, 13400, 353, 5785, 29898, 9675, 29889, 19218, 29961, 29896, 2314, 30004, 13, 30004, 13, 29882, 1505, 353, 2897, 29889, 1761, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 525, 29950, 26788, 8785, 30004, 13, 29882, 1505, 353, 518, 359, 29889, 2084, 29889, 7122, 877, 29950, 26788, 742, 285, 29897, 363, 285, 297, 298, 1505, 29962, 30004, 13, 29880, 1505, 353, 2897, 29889, 1761, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 29892, 525, 29931, 26788, 8785, 30004, 13, 29880, 1505, 353, 518, 359, 29889, 2084, 29889, 7122, 877, 29931, 26788, 742, 285, 29897, 363, 285, 297, 301, 1505, 29962, 30004, 13, 30004, 13, 2158, 703, 26036, 2159, 29901, 379, 26788, 26254, 1118, 365, 26788, 26254, 1118, 14990, 29901, 8875, 1642, 4830, 29898, 2435, 29898, 29882, 1505, 511, 7431, 29898, 29880, 1505, 511, 7431, 29898, 29882, 1505, 29897, 718, 7431, 29898, 29880, 1505, 4961, 30004, 13, 29882, 1505, 353, 298, 1505, 7503, 524, 29898, 13400, 29930, 2435, 29898, 29882, 1505, 28166, 30004, 13, 29880, 1505, 353, 301, 1505, 7503, 524, 29898, 13400, 29930, 2435, 29898, 29880, 1505, 28166, 30004, 13, 2158, 703, 29931, 326, 1573, 2159, 29901, 379, 26788, 26254, 1118, 365, 26788, 26254, 1118, 14990, 29901, 8875, 1642, 4830, 29898, 2435, 29898, 29882, 1505, 511, 7431, 29898, 29880, 1505, 511, 7431, 29898, 29882, 1505, 29897, 718, 7431, 29898, 29880, 1505, 4961, 30004, 13, 29990, 353, 298, 1505, 718, 301, 1505, 30004, 13, 29979, 353, 518, 29896, 29962, 334, 7431, 29898, 29882, 1505, 29897, 718, 518, 29900, 29962, 334, 7431, 29898, 29880, 1505, 8443, 13, 30004, 13, 3539, 29898, 29990, 29892, 525, 497, 29889, 3945, 1495, 30004, 13, 845, 4422, 29889, 8552, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 5501, 497, 29889, 3945, 5477, 2897, 29889, 2084, 29889, 7122, 29898, 1627, 786, 29892, 525, 497, 29889, 3945, 8785, 30004, 13, 29990, 29892, 612, 353, 7442, 29889, 2378, 29898, 29990, 511, 7442, 29889, 2378, 29898, 29979, 8443, 13, 30004, 13, 808, 29888, 353, 3767, 271, 2164, 29968, 29943, 1025, 29898, 29876, 29918, 23579, 1169, 29922, 29945, 29892, 528, 21897, 29922, 5574, 29892, 4036, 29918, 3859, 29922, 29906, 29900, 29896, 29947, 8443, 13, 30004, 13, 1454, 413, 29892, 313, 14968, 29918, 2248, 29892, 2854, 29918, 2248, 29897, 297, 26985, 29898, 808, 29888, 29889, 5451, 29898, 29979, 29892, 612, 22164, 30004, 13, 1678, 7945, 29918, 1761, 353, 1051, 29898, 29990, 29961, 14968, 29918, 2248, 2314, 30004, 13, 1678, 2854, 29918, 1761, 353, 1051, 29898, 29990, 29961, 3084, 29918, 2248, 2314, 30004, 13, 30004, 13, 1678, 2436, 29898, 14968, 29918, 1761, 29892, 525, 14968, 648, 1836, 3945, 4286, 4830, 29898, 29895, 876, 30004, 13, 1678, 2436, 29898, 3084, 29918, 1761, 29892, 525, 3084, 648, 1836, 3945, 4286, 4830, 29898, 29895, 876, 30004, 13, 30004, 13, 1678, 528, 4422, 29889, 8552, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 5501, 14968, 648, 1836, 3945, 4286, 4830, 29898, 29895, 8243, 30004, 13, 462, 9651, 2897, 29889, 2084, 29889, 7122, 29898, 1627, 786, 29892, 525, 14968, 648, 1836, 3945, 4286, 4830, 29898, 29895, 4961, 30004, 13, 1678, 528, 4422, 29889, 8552, 29898, 359, 29889, 2084, 29889, 7122, 29898, 4632, 5501, 3084, 648, 1836, 3945, 4286, 4830, 29898, 29895, 8243, 6756, 13, 462, 9651, 2897, 29889, 2084, 29889, 7122, 29898, 1627, 786, 29892, 525, 3084, 648, 1836, 3945, 4286, 4830, 29898, 29895, 4961, 30004, 13, 30004, 13, 3084, 353, 2897, 29889, 1761, 3972, 29898, 359, 29889, 2084, 29889, 7122, 29898, 3084, 29918, 1272, 29918, 3972, 876, 30004, 13, 3084, 353, 518, 29888, 363, 285, 297, 2854, 565, 451, 313, 29888, 29889, 1975, 2541, 12839, 7638, 1495, 470, 285, 29889, 1975, 2541, 12839, 3945, 8785, 29962, 30004, 13, 3539, 29898, 3084, 29892, 525, 3084, 29889, 3945, 742, 3876, 29922, 3084, 29918, 1272, 29918, 3972, 29897, 2 ]
day10/day10.py
KohlhaseJ/adventofcode2021
0
1610692
legalPairs = { '(': ')', '[': ']', '{': '}', '<': '>' } illegalCharacterScores = { ')': 3, ']': 57, '}': 1197, '>': 25137 } completedCharacterScores = { ')': 1, ']': 2, '}': 3, '>': 4 } def isLegalPair(opensWith, closesWith): return legalPairs.get(opensWith, 'invalid') == closesWith def isOpeningBracket(character): return character in ['(', '[', '{', '<'] def isClosingBracket(character): return character in [')', ']', '}', '>'] def getMiddleElement(list): return list[len(list)//2] with open("input.txt") as f: lines = [line.rstrip('\n') for line in f.readlines()] syntaxErrorScore = 0 autocompletionScores = [] for line in lines: openingCharacters = [] autocompletionScore = 0 isIncompleteLine = True for character in line: if isOpeningBracket(character): openingCharacters.append(character) elif isClosingBracket(character): lastOpeningCharacter = openingCharacters.pop() if not isLegalPair(lastOpeningCharacter, character): print("Syntax error: expected {} got {}!".format(legalPairs.get(lastOpeningCharacter), character)) syntaxErrorScore += illegalCharacterScores.get(character, 0) isIncompleteLine = False break if isIncompleteLine: while len(openingCharacters) > 0: autocompletionCharacter = legalPairs.get(openingCharacters.pop()) autocompletionScore *= 5 autocompletionScore += completedCharacterScores.get(autocompletionCharacter, 0) line += autocompletionCharacter if autocompletionScore > 0: autocompletionScores.append(autocompletionScore) autocompletionScores.sort() print("What is the total syntax error score?: {}".format(syntaxErrorScore)) print("What is the middle score?: {}".format(getMiddleElement(autocompletionScores)))
[ 1, 11706, 29925, 7121, 353, 426, 13, 29871, 525, 877, 29901, 25710, 742, 13, 29871, 525, 1839, 29901, 525, 29962, 742, 13, 29871, 22372, 2396, 525, 29913, 742, 13, 29871, 12801, 2396, 525, 16299, 13, 29913, 13, 13, 309, 12018, 20755, 4421, 2361, 353, 426, 13, 29871, 25710, 2396, 29871, 29941, 29892, 13, 29871, 525, 29962, 2396, 29871, 29945, 29955, 29892, 13, 29871, 525, 29913, 2396, 29871, 29896, 29896, 29929, 29955, 29892, 13, 29871, 525, 29958, 2396, 29871, 29906, 29945, 29896, 29941, 29955, 13, 29913, 13, 13, 5729, 9446, 20755, 4421, 2361, 353, 426, 13, 29871, 25710, 2396, 29871, 29896, 29892, 13, 29871, 525, 29962, 2396, 29871, 29906, 29892, 13, 29871, 525, 29913, 2396, 29871, 29941, 29892, 13, 29871, 525, 29958, 2396, 29871, 29946, 13, 29913, 13, 13, 1753, 338, 22988, 284, 20547, 29898, 22156, 3047, 29892, 4694, 267, 3047, 1125, 13, 29871, 736, 11706, 29925, 7121, 29889, 657, 29898, 22156, 3047, 29892, 525, 20965, 1495, 1275, 4694, 267, 3047, 13, 13, 1753, 338, 6585, 292, 28183, 3522, 29898, 18609, 1125, 13, 29871, 736, 2931, 297, 6024, 29317, 525, 29961, 742, 22372, 742, 12801, 2033, 13, 13, 1753, 338, 29907, 5409, 292, 28183, 3522, 29898, 18609, 1125, 13, 29871, 736, 2931, 297, 518, 1495, 742, 525, 29962, 742, 525, 29913, 742, 525, 29958, 2033, 13, 13, 1753, 679, 25411, 2642, 29898, 1761, 1125, 13, 29871, 736, 1051, 29961, 2435, 29898, 1761, 29897, 458, 29906, 29962, 13, 13, 2541, 1722, 703, 2080, 29889, 3945, 1159, 408, 285, 29901, 13, 29871, 3454, 353, 518, 1220, 29889, 29878, 17010, 28909, 29876, 1495, 363, 1196, 297, 285, 29889, 949, 9012, 580, 29962, 13, 13, 29562, 2392, 20097, 353, 29871, 29900, 13, 6921, 5729, 12757, 4421, 2361, 353, 5159, 13, 13, 1454, 1196, 297, 3454, 29901, 13, 29871, 8718, 5914, 21706, 353, 5159, 13, 29871, 4469, 5729, 12757, 20097, 353, 29871, 29900, 13, 29871, 338, 797, 8835, 3542, 353, 5852, 13, 29871, 363, 2931, 297, 1196, 29901, 13, 1678, 565, 338, 6585, 292, 28183, 3522, 29898, 18609, 1125, 13, 418, 8718, 5914, 21706, 29889, 4397, 29898, 18609, 29897, 13, 1678, 25342, 338, 29907, 5409, 292, 28183, 3522, 29898, 18609, 1125, 13, 418, 1833, 6585, 292, 20755, 353, 8718, 5914, 21706, 29889, 7323, 580, 13, 418, 565, 451, 338, 22988, 284, 20547, 29898, 4230, 6585, 292, 20755, 29892, 2931, 1125, 13, 4706, 1596, 703, 16676, 1059, 29901, 3806, 6571, 2355, 6571, 29991, 1642, 4830, 29898, 12018, 29925, 7121, 29889, 657, 29898, 4230, 6585, 292, 20755, 511, 2931, 876, 13, 4706, 5877, 2392, 20097, 4619, 27302, 20755, 4421, 2361, 29889, 657, 29898, 18609, 29892, 29871, 29900, 29897, 13, 4706, 338, 797, 8835, 3542, 353, 7700, 13, 4706, 2867, 13, 13, 29871, 565, 338, 797, 8835, 3542, 29901, 13, 1678, 1550, 7431, 29898, 3150, 292, 5914, 21706, 29897, 1405, 29871, 29900, 29901, 13, 418, 4469, 5729, 12757, 20755, 353, 11706, 29925, 7121, 29889, 657, 29898, 3150, 292, 5914, 21706, 29889, 7323, 3101, 13, 418, 4469, 5729, 12757, 20097, 334, 29922, 29871, 29945, 13, 418, 4469, 5729, 12757, 20097, 4619, 8676, 20755, 4421, 2361, 29889, 657, 29898, 6921, 5729, 12757, 20755, 29892, 29871, 29900, 29897, 13, 418, 1196, 4619, 4469, 5729, 12757, 20755, 13, 13, 1678, 565, 4469, 5729, 12757, 20097, 1405, 29871, 29900, 29901, 13, 418, 4469, 5729, 12757, 4421, 2361, 29889, 4397, 29898, 6921, 5729, 12757, 20097, 29897, 13, 13, 6921, 5729, 12757, 4421, 2361, 29889, 6605, 580, 13, 13, 2158, 703, 5618, 338, 278, 3001, 5877, 1059, 8158, 25825, 6571, 1642, 4830, 29898, 29562, 2392, 20097, 876, 13, 2158, 703, 5618, 338, 278, 7256, 8158, 25825, 6571, 1642, 4830, 29898, 657, 25411, 2642, 29898, 6921, 5729, 12757, 4421, 2361, 4961, 2 ]
utilities/hdri_to_cubemap/hdri_to_cubemap.py
wezu/p3d_samples
15
191294
<filename>utilities/hdri_to_cubemap/hdri_to_cubemap.py import os from panda3d.core import * loadPrcFileData("", "framebuffer-multisample 1") loadPrcFileData("", "multisamples 8") from direct.showbase import ShowBase base=ShowBase.ShowBase() render.setAntialias(AntialiasAttrib.MMultisample) sky_box=loader.load_model('box') sky_box.reparent_to(render) sky_box.set_scale(10) sky_box.set_shader(Shader.load(Shader.SLGLSL, 'shaders/skybox_v.glsl', 'shaders/skybox_f.glsl'), 1) sky_box.set_shader_input('noise_tex', loader.load_texture('blue_noise.png', minfilter = SamplerState.FT_nearest, magfilter = SamplerState.FT_nearest)) sky_box.set_bin('background', 100) sky_box.set_depth_test(False) sky_box.set_depth_write(False) for filename in os.listdir('hdri'): source = filename[:-4] print(source) sky_map=loader.load_texture('hdri/'+source+'.png') sky_map.set_magfilter(SamplerState.FT_linear_mipmap_linear) sky_map.set_minfilter(SamplerState.FT_linear_mipmap_linear) sky_box.set_shader_input('sky_map', sky_map) sky_box.set_shader_input('sky_lod', 0.0) sky_box.set_shader_input('value', 0.0) lod=0 resolution = 1024 while resolution >= 1: base.saveCubeMap('temp/'+source+'_'+str(lod)+'_#.png', size = resolution) resolution=resolution//2 lod+=1 sky_box.set_shader_input('sky_lod', float(lod*1.5)) sky_box.set_shader_input('value', lod*0.04) base.graphicsEngine.renderFrame() base.graphicsEngine.renderFrame() base.graphicsEngine.renderFrame() cubemap=loader.loadCubeMap('temp/'+source+'_#_#.png', readMipmaps = True, minfilter = SamplerState.FT_linear_mipmap_linear, magfilter = SamplerState.FT_linear_mipmap_linear) cubemap.set_compression(Texture.CM_dxt1) cubemap.write('cubemap/'+source+'.txo') #base.run()
[ 1, 529, 9507, 29958, 4422, 1907, 29914, 16440, 374, 29918, 517, 29918, 29883, 431, 331, 481, 29914, 16440, 374, 29918, 517, 29918, 29883, 431, 331, 481, 29889, 2272, 13, 5215, 2897, 13, 3166, 282, 5863, 29941, 29881, 29889, 3221, 1053, 334, 13, 1359, 29925, 2214, 2283, 1469, 703, 613, 376, 2557, 9040, 29899, 4713, 275, 981, 29871, 29896, 1159, 13, 1359, 29925, 2214, 2283, 1469, 703, 613, 376, 4713, 275, 9422, 29871, 29947, 1159, 13, 3166, 1513, 29889, 4294, 3188, 1053, 7704, 5160, 13, 13, 3188, 29922, 8964, 5160, 29889, 8964, 5160, 580, 13, 9482, 29889, 842, 13448, 616, 3173, 29898, 13448, 616, 3173, 4165, 1091, 29889, 29924, 6857, 275, 981, 29897, 13, 13, 7912, 29918, 1884, 29922, 12657, 29889, 1359, 29918, 4299, 877, 1884, 1495, 13, 7912, 29918, 1884, 29889, 276, 3560, 29918, 517, 29898, 9482, 29897, 13, 7912, 29918, 1884, 29889, 842, 29918, 7052, 29898, 29896, 29900, 29897, 13, 7912, 29918, 1884, 29889, 842, 29918, 845, 1664, 29898, 2713, 1664, 29889, 1359, 29898, 2713, 1664, 29889, 12750, 7239, 12750, 29892, 525, 845, 24574, 29914, 7912, 1884, 29918, 29894, 29889, 3820, 2536, 742, 525, 845, 24574, 29914, 7912, 1884, 29918, 29888, 29889, 3820, 2536, 5477, 29871, 29896, 29897, 13, 7912, 29918, 1884, 29889, 842, 29918, 845, 1664, 29918, 2080, 877, 1217, 895, 29918, 4776, 742, 23466, 29889, 1359, 29918, 726, 545, 877, 9539, 29918, 1217, 895, 29889, 2732, 742, 1375, 4572, 353, 3685, 20069, 2792, 29889, 7818, 29918, 28502, 342, 29892, 2320, 4572, 353, 3685, 20069, 2792, 29889, 7818, 29918, 28502, 342, 876, 13, 7912, 29918, 1884, 29889, 842, 29918, 2109, 877, 7042, 742, 29871, 29896, 29900, 29900, 29897, 13, 7912, 29918, 1884, 29889, 842, 29918, 19488, 29918, 1688, 29898, 8824, 29897, 13, 7912, 29918, 1884, 29889, 842, 29918, 19488, 29918, 3539, 29898, 8824, 29897, 13, 13, 1454, 10422, 297, 2897, 29889, 1761, 3972, 877, 16440, 374, 29374, 13, 1678, 2752, 353, 10422, 7503, 29899, 29946, 29962, 13, 1678, 1596, 29898, 4993, 29897, 13, 1678, 14744, 29918, 1958, 29922, 12657, 29889, 1359, 29918, 726, 545, 877, 16440, 374, 29914, 18717, 4993, 29974, 4286, 2732, 1495, 13, 1678, 14744, 29918, 1958, 29889, 842, 29918, 11082, 4572, 29898, 22966, 20069, 2792, 29889, 7818, 29918, 10660, 29918, 29885, 666, 1958, 29918, 10660, 29897, 13, 1678, 14744, 29918, 1958, 29889, 842, 29918, 1195, 4572, 29898, 22966, 20069, 2792, 29889, 7818, 29918, 10660, 29918, 29885, 666, 1958, 29918, 10660, 29897, 13, 1678, 14744, 29918, 1884, 29889, 842, 29918, 845, 1664, 29918, 2080, 877, 7912, 29918, 1958, 742, 14744, 29918, 1958, 29897, 13, 1678, 14744, 29918, 1884, 29889, 842, 29918, 845, 1664, 29918, 2080, 877, 7912, 29918, 29880, 397, 742, 29871, 29900, 29889, 29900, 29897, 13, 1678, 14744, 29918, 1884, 29889, 842, 29918, 845, 1664, 29918, 2080, 877, 1767, 742, 29871, 29900, 29889, 29900, 29897, 13, 13, 1678, 21896, 29922, 29900, 13, 1678, 10104, 353, 259, 29896, 29900, 29906, 29946, 13, 1678, 1550, 10104, 6736, 29871, 29896, 29901, 13, 4706, 2967, 29889, 7620, 29907, 4003, 3388, 877, 7382, 29914, 18717, 4993, 29974, 15972, 18717, 710, 29898, 29880, 397, 7240, 15972, 29937, 29889, 2732, 742, 2159, 353, 10104, 29897, 13, 4706, 10104, 29922, 9778, 918, 458, 29906, 13, 4706, 21896, 23661, 29896, 13, 4706, 14744, 29918, 1884, 29889, 842, 29918, 845, 1664, 29918, 2080, 877, 7912, 29918, 29880, 397, 742, 5785, 29898, 29880, 397, 29930, 29896, 29889, 29945, 876, 13, 4706, 14744, 29918, 1884, 29889, 842, 29918, 845, 1664, 29918, 2080, 877, 1767, 742, 21896, 29930, 29900, 29889, 29900, 29946, 29897, 13, 4706, 2967, 29889, 6420, 12412, 29889, 9482, 4308, 580, 13, 4706, 2967, 29889, 6420, 12412, 29889, 9482, 4308, 580, 13, 4706, 2967, 29889, 6420, 12412, 29889, 9482, 4308, 580, 13, 13, 1678, 13630, 331, 481, 29922, 12657, 29889, 1359, 29907, 4003, 3388, 877, 7382, 29914, 18717, 4993, 29974, 15972, 29937, 29918, 29937, 29889, 2732, 742, 1303, 29924, 666, 10339, 353, 5852, 29892, 1375, 4572, 353, 3685, 20069, 2792, 29889, 7818, 29918, 10660, 29918, 29885, 666, 1958, 29918, 10660, 29892, 2320, 4572, 353, 3685, 20069, 2792, 29889, 7818, 29918, 10660, 29918, 29885, 666, 1958, 29918, 10660, 29897, 13, 1678, 13630, 331, 481, 29889, 842, 29918, 510, 2590, 29898, 21898, 29889, 24494, 29918, 29881, 486, 29896, 29897, 13, 1678, 13630, 331, 481, 29889, 3539, 877, 29883, 431, 331, 481, 29914, 18717, 4993, 29974, 4286, 7508, 29877, 1495, 13, 13, 29937, 3188, 29889, 3389, 580, 13, 2 ]
mac/pyobjc-framework-Quartz/Examples/Programming with Quartz/BasicDrawing/ColorAndGState.py
albertz/music-player
132
54514
import sys from Quartz import * import Utilities import array def doColorSpaceFillAndStroke(context): theColorSpace = Utilities.getTheCalibratedRGBColorSpace() opaqueRed = ( 0.663, 0.0, 0.031, 1.0 ) # red,green,blue,alpha aBlue = ( 0.482, 0.62, 0.871, 1.0 ) # red,green,blue,alpha # Set the fill color space to be the generic calibrated RGB color space. CGContextSetFillColorSpace(context, theColorSpace) # Set the fill color to opaque red. The number of elements in the # array passed to this function must be the number of color # components in the current fill color space plus 1 for alpha. CGContextSetFillColor(context, opaqueRed) # Set the stroke color space to be the generic calibrated RGB color space. CGContextSetStrokeColorSpace(context, theColorSpace) # Set the stroke color to opaque blue. The number of elements # in the array passed to this function must be the number of color # components in the current stroke color space plus 1 for alpha. CGContextSetStrokeColor(context, aBlue) CGContextSetLineWidth(context, 8.0) # Rectangle 1. CGContextBeginPath(context) CGContextAddRect(context, CGRectMake(20.0, 20.0, 100.0, 100.0)) CGContextDrawPath(context, kCGPathFillStroke) # Continue to use the stroke colorspace already set # but change the stroke alpha value to a semitransparent blue. aBlue = list(aBlue) aBlue[3] = 0.5 CGContextSetStrokeColor(context, aBlue) # Rectangle 2. CGContextBeginPath(context) CGContextAddRect(context, CGRectMake(140.0, 20.0, 100.0, 100.0)) CGContextDrawPath(context, kCGPathFillStroke) # Don't release the color space since this routine # didn't create it. _opaqueRedColor = None _opaqueBlueColor = None _transparentBlueColor = None def drawWithColorRefs(context): global _opaqueRedColor global _opaqueBlueColor global _transparentBlueColor # Initialize the CGColorRefs if necessary if _opaqueRedColor is None: # Initialize the color array to an opaque red # in the generic calibrated RGB color space. color = (0.663, 0.0, 0.031, 1.0) theColorSpace = Utilities.getTheCalibratedRGBColorSpace() # Create a CGColorRef for opaque red. _opaqueRedColor = CGColorCreate(theColorSpace, color) # Make the color array correspond to an opaque blue color. color = (0.482, 0.62, 0.87, 1.0) # Create another CGColorRef for opaque blue. _opaqueBlueColor = CGColorCreate(theColorSpace, color) # Create a new CGColorRef from the opaqueBlue CGColorRef # but with a different alpha value. _transparentBlueColor = CGColorCreateCopyWithAlpha( _opaqueBlueColor, 0.5) if _opaqueRedColor is None or _opaqueBlueColor is None or _transparentBlueColor is None: print >>sys.stderr, "Couldn't create one of the CGColorRefs!!!" return # Set the fill color to the opaque red CGColor object. CGContextSetFillColorWithColor(context, _opaqueRedColor) # Set the stroke color to the opaque blue CGColor object. CGContextSetStrokeColorWithColor(context, _opaqueBlueColor) CGContextSetLineWidth(context, 8.0) # Draw the first rectangle. CGContextBeginPath(context) CGContextAddRect(context, CGRectMake(20.0, 20.0, 100.0, 100.0)) CGContextDrawPath(context, kCGPathFillStroke) # Set the stroke color to be that of the transparent blue # CGColor object. CGContextSetStrokeColorWithColor(context, _transparentBlueColor) # Draw a second rectangle to the right of the first one. CGContextBeginPath(context) CGContextAddRect(context, CGRectMake(140.0, 20.0, 100.0, 100.0)) CGContextDrawPath(context, kCGPathFillStroke) def doIndexedColorDrawGraphics(context): theBaseRGBSpace = Utilities.getTheCalibratedRGBColorSpace() lookupTable = array.array('B', (0,)*6) opaqueRed = (0, 1) # index, alpha aBlue = (1, 1) # index, alpha # Set the first 3 values in the lookup table to a red of # 169/255 = 0.663, no green, and blue = 8/255 = 0.031. This makes # the first entry in the lookup table a shade of red. lookupTable[0] = 169; lookupTable[1] = 0; lookupTable[2] = 8 # Set the second 3 values in the lookup table to a red value # of 123/255 = 0.482, a green value of 158/255 = 0.62, and # a blue value of 222/255 = 0.871. This makes the second entry # in the lookup table a shade of blue. lookupTable[3] = 123; lookupTable[4] = 158; lookupTable[5] = 222 # Create the indexed color space with this color lookup table, # using the RGB color space as the base color space and a 2 element # color lookup table to characterize the indexed color space. theIndexedSpace = CGColorSpaceCreateIndexed(theBaseRGBSpace, 1, lookupTable) if theIndexedSpace is not None: CGContextSetStrokeColorSpace(context, theIndexedSpace) CGContextSetFillColorSpace(context, theIndexedSpace) # Set the stroke color to an opaque blue. CGContextSetStrokeColor(context, aBlue) # Set the fill color to an opaque red. CGContextSetFillColor(context, opaqueRed) CGContextSetLineWidth(context, 8.0) # Draw the first rectangle. CGContextBeginPath(context) CGContextAddRect(context, CGRectMake(20.0, 20.0, 100.0, 100.0)) CGContextDrawPath(context, kCGPathFillStroke) # Continue to use the stroke colorspace already set # but change the stroke alpha value to a semitransparent value # while leaving the index value unchanged. aBlue = list(aBlue) aBlue[1] = 0.5 CGContextSetStrokeColor(context, aBlue) # Draw another rectangle to the right of the first one. CGContextBeginPath(context) CGContextAddRect(context, CGRectMake(140.0, 20.0, 100.0, 100.0)) CGContextDrawPath(context, kCGPathFillStroke) else: print >>sys.stderr, "Couldn't make the indexed color space!" def drawWithGlobalAlpha(context): rect = CGRectMake(40.0, 210.0, 100.0, 100.0) color = [1.0, 0.0, 0.0, 1.0] # opaque red # Set the fill color space to that returned by getTheCalibratedRGBColorSpace. CGContextSetFillColorSpace(context, Utilities.getTheCalibratedRGBColorSpace()) CGContextSetFillColor(context, color) for i in range(2): CGContextSaveGState(context) # Paint the leftmost rect on this row with 100% opaque red. CGContextFillRect(context, rect) CGContextTranslateCTM(context, rect.size.width + 70.0, 0.0) # Set the alpha value of this rgba color to 0.5. color[3] = 0.5 # Use the new color as the fill color in the graphics state. CGContextSetFillColor(context, color) # Paint the center rect on this row with 50% opaque red. CGContextFillRect(context, rect) CGContextTranslateCTM(context, rect.size.width + 70.0, 0.0) # Set the alpha value of this rgba color to 0.25. color[3] = 0.25 # Use the new color as the fill color in the graphics state. CGContextSetFillColor(context, color) # Paint the rightmost rect on this row with 25% opaque red. CGContextFillRect(context, rect) CGContextRestoreGState(context) # After restoring the graphics state, the fill color is set to # that prior to calling CGContextSaveGState, that is, opaque # red. The coordinate system is also restored. # Now set the context global alpha value to 50% opaque. CGContextSetAlpha(context, 0.5) # Translate down for a second row of rectangles. CGContextTranslateCTM(context, 0.0, -(rect.size.height + 70.0)) # Reset the alpha value of the color array to fully opaque. color[3] = 1.0 def drawWithColorBlendMode(context, url): # A pleasant green color. green = [0.584, 0.871, 0.318, 1.0] # Create a CGPDFDocument object from the URL. pdfDoc = CGPDFDocumentCreateWithURL(url) if pdfDoc is None: print >>sys.stderr, "Couldn't create CGPDFDocument from URL!" return # Obtain the media box for page 1 of the PDF document. pdfRect = CGPDFDocumentGetMediaBox(pdfDoc, 1) # Set the origin of the rectangle to (0,0). pdfRect.origin.x = pdfRect.origin.y = 0 # Graphic 1, the left portion of the figure. CGContextTranslateCTM(context, 20, 10 + CGRectGetHeight(pdfRect)/2) # Draw the PDF document. CGContextDrawPDFDocument(context, pdfRect, pdfDoc, 1) # Set the fill color space to that returned by getTheCalibratedRGBColorSpace. CGContextSetFillColorSpace(context, Utilities.getTheCalibratedRGBColorSpace()) # Set the fill color to green. CGContextSetFillColor(context, green) # Graphic 2, the top-right portion of the figure. CGContextTranslateCTM(context, CGRectGetWidth(pdfRect) + 10, CGRectGetHeight(pdfRect)/2 + 10) # Draw the PDF document again. CGContextDrawPDFDocument(context, pdfRect, pdfDoc, 1) # Make a fill rectangle that is the same size as the PDF document # but inset each side by 80 units in x and 20 units in y. insetRect = CGRectInset(pdfRect, 80, 20) # Fill the rectangle with green. Because the fill color is opaque and # the blend mode is Normal, this obscures the drawing underneath. CGContextFillRect(context, insetRect) # Graphic 3, the bottom-right portion of the figure. CGContextTranslateCTM(context, 0, -(10 + CGRectGetHeight(pdfRect))) # Draw the PDF document again. CGContextDrawPDFDocument(context, pdfRect, pdfDoc, 1) # Set the blend mode to kCGBlendModeColor which will # colorize the destination with subsequent drawing. CGContextSetBlendMode(context, kCGBlendModeColor) # Draw the rectangle on top of the PDF document. The portion of the # background that is covered by the rectangle is colorized # with the fill color. CGContextFillRect(context, insetRect) def createEllipsePath(context, center, ellipseSize): CGContextSaveGState(context) # Translate the coordinate origin to the center point. CGContextTranslateCTM(context, center.x, center.y) # Scale the coordinate system to half the width and height # of the ellipse. CGContextScaleCTM(context, ellipseSize.width/2, ellipseSize.height/2) CGContextBeginPath(context) # Add a circular arc to the path, centered at the origin and # with a radius of 1.0. This radius, together with the # scaling above for the width and height, produces an ellipse # of the correct size. CGContextAddArc(context, 0.0, 0.0, 1.0, 0.0, Utilities.DEGREES_TO_RADIANS(360.0), 0.0) # Close the path so that this path is suitable for stroking, # should that be desired. CGContextClosePath(context) CGContextRestoreGState(context) _opaqueBrownColor = None _opaqueOrangeColor = None def doClippedEllipse(context): global _opaqueBrownColor, _opaqueOrangeColor theCenterPoint = CGPoint(120.0, 120.0) theEllipseSize = CGSize(100.0, 200.0) dash = [ 2.0 ] # Initialize the CGColorRefs if necessary. if _opaqueBrownColor is None: # The initial value of the color array is an # opaque brown in an RGB color space. color = [0.325, 0.208, 0.157, 1.0] theColorSpace = Utilities.getTheCalibratedRGBColorSpace() # Create a CGColorRef for opaque brown. _opaqueBrownColor = CGColorCreate(theColorSpace, color) # Make the color array correspond to an opaque orange. color = [0.965, 0.584, 0.059, 1.0 ] # Create another CGColorRef for opaque orange. _opaqueOrangeColor = CGColorCreate(theColorSpace, color) # Draw two ellipses centered about the same point, one # rotated 45 degrees from the other. CGContextSaveGState(context) # Ellipse 1 createEllipsePath(context, theCenterPoint, theEllipseSize) CGContextSetFillColorWithColor(context, _opaqueBrownColor) CGContextFillPath(context) # Translate and rotate about the center point of the ellipse. CGContextTranslateCTM(context, theCenterPoint.x, theCenterPoint.y) # Rotate by 45 degrees. CGContextRotateCTM(context, Utilities.DEGREES_TO_RADIANS(45)) # Ellipse 2 # CGPointZero is a pre-defined Quartz point corresponding to # the coordinate (0,0). createEllipsePath(context, CGPointZero, theEllipseSize) CGContextSetFillColorWithColor(context, _opaqueOrangeColor) CGContextFillPath(context) CGContextRestoreGState(context) CGContextTranslateCTM(context, 170.0, 0.0) # Now use the first ellipse as a clipping area prior to # painting the second ellipse. CGContextSaveGState(context) # Ellipse 3 createEllipsePath(context, theCenterPoint, theEllipseSize) CGContextSetStrokeColorWithColor(context, _opaqueBrownColor) CGContextSetLineDash(context, 0, dash, 1) # Stroke the path with a dash. CGContextStrokePath(context) # Ellipse 4 createEllipsePath(context, theCenterPoint, theEllipseSize) # Clip to the elliptical path. CGContextClip(context) CGContextTranslateCTM(context, theCenterPoint.x, theCenterPoint.y) # Rotate by 45 degrees. CGContextRotateCTM(context, Utilities.DEGREES_TO_RADIANS(45)) # Ellipse 5 createEllipsePath(context, CGPointZero, theEllipseSize) CGContextSetFillColorWithColor(context, _opaqueOrangeColor) CGContextFillPath(context) CGContextRestoreGState(context)
[ 1, 1053, 10876, 13, 13, 3166, 24664, 29920, 1053, 334, 13, 13, 5215, 22310, 1907, 13, 5215, 1409, 13, 13, 1753, 437, 3306, 14936, 20876, 2855, 855, 10946, 29898, 4703, 1125, 13, 1678, 278, 3306, 14936, 353, 22310, 1907, 29889, 657, 1576, 7856, 4626, 630, 28212, 3306, 14936, 580, 13, 1678, 1015, 19772, 9039, 353, 313, 29871, 29900, 29889, 29953, 29953, 29941, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29941, 29896, 29892, 29871, 29896, 29889, 29900, 1723, 396, 2654, 29892, 12692, 29892, 9539, 29892, 2312, 13, 1678, 263, 21319, 353, 313, 29871, 29900, 29889, 29946, 29947, 29906, 29892, 29871, 29900, 29889, 29953, 29906, 29892, 29871, 29900, 29889, 29947, 29955, 29896, 29892, 29871, 29896, 29889, 29900, 1723, 268, 396, 2654, 29892, 12692, 29892, 9539, 29892, 2312, 13, 13, 1678, 396, 3789, 278, 5445, 2927, 2913, 304, 367, 278, 10035, 1208, 4626, 630, 390, 7210, 2927, 2913, 29889, 13, 1678, 8446, 2677, 2697, 20876, 3306, 14936, 29898, 4703, 29892, 278, 3306, 14936, 29897, 13, 1678, 396, 3789, 278, 5445, 2927, 304, 1015, 19772, 2654, 29889, 450, 1353, 310, 3161, 297, 278, 13, 1678, 396, 1409, 4502, 304, 445, 740, 1818, 367, 278, 1353, 310, 2927, 13, 1678, 396, 7117, 297, 278, 1857, 5445, 2927, 2913, 2298, 29871, 29896, 363, 15595, 29889, 13, 1678, 8446, 2677, 2697, 20876, 3306, 29898, 4703, 29892, 1015, 19772, 9039, 29897, 13, 13, 1678, 396, 3789, 278, 19782, 2927, 2913, 304, 367, 278, 10035, 1208, 4626, 630, 390, 7210, 2927, 2913, 29889, 13, 1678, 8446, 2677, 2697, 855, 10946, 3306, 14936, 29898, 4703, 29892, 278, 3306, 14936, 29897, 13, 1678, 396, 3789, 278, 19782, 2927, 304, 1015, 19772, 7254, 29889, 450, 1353, 310, 3161, 13, 1678, 396, 297, 278, 1409, 4502, 304, 445, 740, 1818, 367, 278, 1353, 310, 2927, 13, 1678, 396, 7117, 297, 278, 1857, 19782, 2927, 2913, 2298, 29871, 29896, 363, 15595, 29889, 13, 1678, 8446, 2677, 2697, 855, 10946, 3306, 29898, 4703, 29892, 263, 21319, 29897, 13, 13, 1678, 8446, 2677, 2697, 3542, 6110, 29898, 4703, 29892, 29871, 29947, 29889, 29900, 29897, 13, 1678, 396, 22914, 2521, 29871, 29896, 29889, 13, 1678, 8446, 2677, 17946, 2605, 29898, 4703, 29897, 13, 1678, 8446, 2677, 2528, 7364, 29898, 4703, 29892, 26064, 9984, 29898, 29906, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 876, 13, 1678, 8446, 2677, 8537, 2605, 29898, 4703, 29892, 413, 11135, 2605, 20876, 855, 10946, 29897, 13, 13, 1678, 396, 2866, 14150, 304, 671, 278, 19782, 11955, 3535, 2307, 731, 13, 1678, 396, 541, 1735, 278, 19782, 15595, 995, 304, 263, 3031, 277, 29878, 550, 3560, 7254, 29889, 13, 1678, 263, 21319, 353, 1051, 29898, 29874, 21319, 29897, 13, 1678, 263, 21319, 29961, 29941, 29962, 353, 29871, 29900, 29889, 29945, 13, 1678, 8446, 2677, 2697, 855, 10946, 3306, 29898, 4703, 29892, 263, 21319, 29897, 13, 1678, 396, 22914, 2521, 29871, 29906, 29889, 13, 1678, 8446, 2677, 17946, 2605, 29898, 4703, 29897, 13, 1678, 8446, 2677, 2528, 7364, 29898, 4703, 29892, 26064, 9984, 29898, 29896, 29946, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 876, 13, 1678, 8446, 2677, 8537, 2605, 29898, 4703, 29892, 413, 11135, 2605, 20876, 855, 10946, 29897, 13, 13, 1678, 396, 3872, 29915, 29873, 6507, 278, 2927, 2913, 1951, 445, 26529, 13, 1678, 396, 3282, 29915, 29873, 1653, 372, 29889, 13, 13, 29918, 459, 19772, 9039, 3306, 353, 6213, 13, 29918, 459, 19772, 21319, 3306, 353, 6213, 13, 29918, 3286, 3560, 21319, 3306, 353, 6213, 13, 13, 1753, 4216, 3047, 3306, 5620, 29879, 29898, 4703, 1125, 13, 1678, 5534, 903, 459, 19772, 9039, 3306, 13, 1678, 5534, 903, 459, 19772, 21319, 3306, 13, 1678, 5534, 903, 3286, 3560, 21319, 3306, 13, 13, 1678, 396, 25455, 278, 8446, 3306, 5620, 29879, 565, 5181, 13, 1678, 565, 903, 459, 19772, 9039, 3306, 338, 6213, 29901, 13, 4706, 396, 25455, 278, 2927, 1409, 304, 385, 1015, 19772, 2654, 13, 4706, 396, 297, 278, 10035, 1208, 4626, 630, 390, 7210, 2927, 2913, 29889, 13, 4706, 2927, 353, 313, 29900, 29889, 29953, 29953, 29941, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29941, 29896, 29892, 29871, 29896, 29889, 29900, 29897, 13, 4706, 278, 3306, 14936, 353, 22310, 1907, 29889, 657, 1576, 7856, 4626, 630, 28212, 3306, 14936, 580, 13, 4706, 396, 6204, 263, 8446, 3306, 5620, 363, 1015, 19772, 2654, 29889, 13, 4706, 903, 459, 19772, 9039, 3306, 353, 8446, 3306, 4391, 29898, 1552, 3306, 14936, 29892, 2927, 29897, 13, 4706, 396, 8561, 278, 2927, 1409, 3928, 304, 385, 1015, 19772, 7254, 2927, 29889, 13, 4706, 2927, 353, 313, 29900, 29889, 29946, 29947, 29906, 29892, 29871, 29900, 29889, 29953, 29906, 29892, 29871, 29900, 29889, 29947, 29955, 29892, 29871, 29896, 29889, 29900, 29897, 13, 4706, 396, 6204, 1790, 8446, 3306, 5620, 363, 1015, 19772, 7254, 29889, 13, 4706, 903, 459, 19772, 21319, 3306, 353, 8446, 3306, 4391, 29898, 1552, 3306, 14936, 29892, 2927, 29897, 13, 4706, 396, 6204, 263, 716, 8446, 3306, 5620, 515, 278, 1015, 19772, 21319, 8446, 3306, 5620, 13, 4706, 396, 541, 411, 263, 1422, 15595, 995, 29889, 13, 4706, 903, 3286, 3560, 21319, 3306, 353, 8446, 3306, 4391, 11882, 3047, 28630, 29898, 13, 18884, 903, 459, 19772, 21319, 3306, 29892, 29871, 29900, 29889, 29945, 29897, 13, 4706, 565, 903, 459, 19772, 9039, 3306, 338, 6213, 470, 903, 459, 19772, 21319, 3306, 338, 6213, 470, 903, 3286, 3560, 21319, 3306, 338, 6213, 29901, 13, 9651, 1596, 5099, 9675, 29889, 303, 20405, 29892, 376, 23323, 29876, 29915, 29873, 1653, 697, 310, 278, 8446, 3306, 5620, 29879, 6824, 3850, 13, 9651, 736, 13, 13, 1678, 396, 3789, 278, 5445, 2927, 304, 278, 1015, 19772, 2654, 8446, 3306, 1203, 29889, 13, 1678, 8446, 2677, 2697, 20876, 3306, 3047, 3306, 29898, 4703, 29892, 903, 459, 19772, 9039, 3306, 29897, 13, 1678, 396, 3789, 278, 19782, 2927, 304, 278, 1015, 19772, 7254, 8446, 3306, 1203, 29889, 13, 1678, 8446, 2677, 2697, 855, 10946, 3306, 3047, 3306, 29898, 4703, 29892, 903, 459, 19772, 21319, 3306, 29897, 13, 13, 1678, 8446, 2677, 2697, 3542, 6110, 29898, 4703, 29892, 29871, 29947, 29889, 29900, 29897, 13, 1678, 396, 18492, 278, 937, 16701, 29889, 13, 1678, 8446, 2677, 17946, 2605, 29898, 4703, 29897, 13, 1678, 8446, 2677, 2528, 7364, 29898, 4703, 29892, 26064, 9984, 29898, 29906, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 876, 13, 1678, 8446, 2677, 8537, 2605, 29898, 4703, 29892, 413, 11135, 2605, 20876, 855, 10946, 29897, 13, 13, 1678, 396, 3789, 278, 19782, 2927, 304, 367, 393, 310, 278, 17772, 7254, 13, 1678, 396, 8446, 3306, 1203, 29889, 13, 1678, 8446, 2677, 2697, 855, 10946, 3306, 3047, 3306, 29898, 4703, 29892, 903, 3286, 3560, 21319, 3306, 29897, 13, 1678, 396, 18492, 263, 1473, 16701, 304, 278, 1492, 310, 278, 937, 697, 29889, 13, 1678, 8446, 2677, 17946, 2605, 29898, 4703, 29897, 13, 1678, 8446, 2677, 2528, 7364, 29898, 4703, 29892, 26064, 9984, 29898, 29896, 29946, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 876, 13, 1678, 8446, 2677, 8537, 2605, 29898, 4703, 29892, 413, 11135, 2605, 20876, 855, 10946, 29897, 13, 13, 1753, 437, 3220, 287, 3306, 8537, 17290, 29898, 4703, 1125, 13, 1678, 278, 5160, 28212, 14936, 353, 22310, 1907, 29889, 657, 1576, 7856, 4626, 630, 28212, 3306, 14936, 580, 13, 1678, 16280, 3562, 353, 1409, 29889, 2378, 877, 29933, 742, 313, 29900, 29892, 11877, 29953, 29897, 13, 1678, 1015, 19772, 9039, 353, 313, 29900, 29892, 29871, 29896, 29897, 396, 2380, 29892, 15595, 13, 1678, 263, 21319, 353, 313, 29896, 29892, 29871, 29896, 29897, 268, 396, 2380, 29892, 15595, 13, 13, 1678, 396, 3789, 278, 937, 29871, 29941, 1819, 297, 278, 16280, 1591, 304, 263, 2654, 310, 13, 1678, 396, 29871, 29896, 29953, 29929, 29914, 29906, 29945, 29945, 353, 29871, 29900, 29889, 29953, 29953, 29941, 29892, 694, 7933, 29892, 322, 7254, 353, 29871, 29947, 29914, 29906, 29945, 29945, 353, 29871, 29900, 29889, 29900, 29941, 29896, 29889, 910, 3732, 13, 1678, 396, 278, 937, 6251, 297, 278, 16280, 1591, 263, 528, 1943, 310, 2654, 29889, 13, 1678, 16280, 3562, 29961, 29900, 29962, 353, 29871, 29896, 29953, 29929, 29936, 16280, 3562, 29961, 29896, 29962, 353, 29871, 29900, 29936, 16280, 3562, 29961, 29906, 29962, 353, 29871, 29947, 13, 13, 1678, 396, 3789, 278, 1473, 29871, 29941, 1819, 297, 278, 16280, 1591, 304, 263, 2654, 995, 13, 1678, 396, 310, 29871, 29896, 29906, 29941, 29914, 29906, 29945, 29945, 353, 29871, 29900, 29889, 29946, 29947, 29906, 29892, 263, 7933, 995, 310, 29871, 29896, 29945, 29947, 29914, 29906, 29945, 29945, 353, 29871, 29900, 29889, 29953, 29906, 29892, 322, 13, 1678, 396, 263, 7254, 995, 310, 29871, 29906, 29906, 29906, 29914, 29906, 29945, 29945, 353, 29871, 29900, 29889, 29947, 29955, 29896, 29889, 910, 3732, 278, 1473, 6251, 13, 1678, 396, 297, 278, 16280, 1591, 263, 528, 1943, 310, 7254, 29889, 13, 1678, 16280, 3562, 29961, 29941, 29962, 353, 29871, 29896, 29906, 29941, 29936, 16280, 3562, 29961, 29946, 29962, 353, 29871, 29896, 29945, 29947, 29936, 16280, 3562, 29961, 29945, 29962, 353, 29871, 29906, 29906, 29906, 13, 13, 1678, 396, 6204, 278, 27541, 2927, 2913, 411, 445, 2927, 16280, 1591, 29892, 13, 1678, 396, 773, 278, 390, 7210, 2927, 2913, 408, 278, 2967, 2927, 2913, 322, 263, 29871, 29906, 1543, 13, 1678, 396, 2927, 16280, 1591, 304, 2931, 675, 278, 27541, 2927, 2913, 29889, 13, 1678, 278, 3220, 287, 14936, 353, 8446, 3306, 14936, 4391, 3220, 287, 29898, 1552, 5160, 28212, 14936, 29892, 29871, 29896, 29892, 16280, 3562, 29897, 13, 1678, 565, 278, 3220, 287, 14936, 338, 451, 6213, 29901, 13, 4706, 8446, 2677, 2697, 855, 10946, 3306, 14936, 29898, 4703, 29892, 278, 3220, 287, 14936, 29897, 13, 4706, 8446, 2677, 2697, 20876, 3306, 14936, 29898, 4703, 29892, 278, 3220, 287, 14936, 29897, 13, 13, 4706, 396, 3789, 278, 19782, 2927, 304, 385, 1015, 19772, 7254, 29889, 13, 4706, 8446, 2677, 2697, 855, 10946, 3306, 29898, 4703, 29892, 263, 21319, 29897, 13, 4706, 396, 3789, 278, 5445, 2927, 304, 385, 1015, 19772, 2654, 29889, 13, 4706, 8446, 2677, 2697, 20876, 3306, 29898, 4703, 29892, 1015, 19772, 9039, 29897, 13, 13, 4706, 8446, 2677, 2697, 3542, 6110, 29898, 4703, 29892, 29871, 29947, 29889, 29900, 29897, 13, 4706, 396, 18492, 278, 937, 16701, 29889, 13, 4706, 8446, 2677, 17946, 2605, 29898, 4703, 29897, 13, 4706, 8446, 2677, 2528, 7364, 29898, 4703, 29892, 26064, 9984, 29898, 29906, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 876, 13, 4706, 8446, 2677, 8537, 2605, 29898, 4703, 29892, 413, 11135, 2605, 20876, 855, 10946, 29897, 13, 13, 4706, 396, 2866, 14150, 304, 671, 278, 19782, 11955, 3535, 2307, 731, 13, 4706, 396, 541, 1735, 278, 19782, 15595, 995, 304, 263, 3031, 277, 29878, 550, 3560, 995, 13, 4706, 396, 1550, 10124, 278, 2380, 995, 443, 15033, 29889, 13, 4706, 263, 21319, 353, 1051, 29898, 29874, 21319, 29897, 13, 4706, 263, 21319, 29961, 29896, 29962, 353, 29871, 29900, 29889, 29945, 13, 4706, 8446, 2677, 2697, 855, 10946, 3306, 29898, 4703, 29892, 263, 21319, 29897, 13, 4706, 396, 18492, 1790, 16701, 304, 278, 1492, 310, 278, 937, 697, 29889, 13, 4706, 8446, 2677, 17946, 2605, 29898, 4703, 29897, 13, 4706, 8446, 2677, 2528, 7364, 29898, 4703, 29892, 26064, 9984, 29898, 29896, 29946, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 876, 13, 4706, 8446, 2677, 8537, 2605, 29898, 4703, 29892, 413, 11135, 2605, 20876, 855, 10946, 29897, 13, 1678, 1683, 29901, 13, 4706, 1596, 5099, 9675, 29889, 303, 20405, 29892, 376, 23323, 29876, 29915, 29873, 1207, 278, 27541, 2927, 2913, 3850, 13, 13, 1753, 4216, 3047, 12756, 28630, 29898, 4703, 1125, 13, 1678, 7705, 353, 26064, 9984, 29898, 29946, 29900, 29889, 29900, 29892, 29871, 29906, 29896, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29896, 29900, 29900, 29889, 29900, 29897, 13, 1678, 2927, 353, 518, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29962, 396, 1015, 19772, 2654, 13, 1678, 396, 3789, 278, 5445, 2927, 2913, 304, 393, 4133, 491, 679, 1576, 7856, 4626, 630, 28212, 3306, 14936, 29889, 13, 1678, 8446, 2677, 2697, 20876, 3306, 14936, 29898, 4703, 29892, 22310, 1907, 29889, 657, 1576, 7856, 4626, 630, 28212, 3306, 14936, 3101, 13, 13, 1678, 8446, 2677, 2697, 20876, 3306, 29898, 4703, 29892, 2927, 29897, 13, 1678, 363, 474, 297, 3464, 29898, 29906, 1125, 13, 4706, 8446, 2677, 11371, 29954, 2792, 29898, 4703, 29897, 13, 4706, 396, 349, 2365, 278, 2175, 3242, 7705, 373, 445, 1948, 411, 29871, 29896, 29900, 29900, 29995, 1015, 19772, 2654, 29889, 13, 4706, 8446, 2677, 20876, 7364, 29898, 4703, 29892, 7705, 29897, 13, 13, 4706, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 7705, 29889, 2311, 29889, 2103, 718, 29871, 29955, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29897, 13, 4706, 396, 3789, 278, 15595, 995, 310, 445, 24979, 2927, 304, 29871, 29900, 29889, 29945, 29889, 13, 4706, 2927, 29961, 29941, 29962, 353, 29871, 29900, 29889, 29945, 13, 4706, 396, 4803, 278, 716, 2927, 408, 278, 5445, 2927, 297, 278, 18533, 2106, 29889, 13, 4706, 8446, 2677, 2697, 20876, 3306, 29898, 4703, 29892, 2927, 29897, 13, 4706, 396, 349, 2365, 278, 4818, 7705, 373, 445, 1948, 411, 29871, 29945, 29900, 29995, 1015, 19772, 2654, 29889, 13, 4706, 8446, 2677, 20876, 7364, 29898, 4703, 29892, 7705, 29897, 13, 13, 4706, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 7705, 29889, 2311, 29889, 2103, 718, 29871, 29955, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29897, 13, 4706, 396, 3789, 278, 15595, 995, 310, 445, 24979, 2927, 304, 29871, 29900, 29889, 29906, 29945, 29889, 13, 4706, 2927, 29961, 29941, 29962, 353, 29871, 29900, 29889, 29906, 29945, 13, 4706, 396, 4803, 278, 716, 2927, 408, 278, 5445, 2927, 297, 278, 18533, 2106, 29889, 13, 4706, 8446, 2677, 2697, 20876, 3306, 29898, 4703, 29892, 2927, 29897, 13, 4706, 396, 349, 2365, 278, 1492, 3242, 7705, 373, 445, 1948, 411, 29871, 29906, 29945, 29995, 1015, 19772, 2654, 29889, 13, 4706, 8446, 2677, 20876, 7364, 29898, 4703, 29892, 7705, 29897, 13, 4706, 8446, 2677, 15078, 487, 29954, 2792, 29898, 4703, 29897, 13, 4706, 396, 2860, 1791, 8253, 278, 18533, 2106, 29892, 278, 5445, 2927, 338, 731, 304, 13, 4706, 396, 393, 7536, 304, 5432, 8446, 2677, 11371, 29954, 2792, 29892, 393, 338, 29892, 1015, 19772, 13, 4706, 396, 2654, 29889, 450, 14821, 1788, 338, 884, 23119, 29889, 13, 13, 4706, 396, 2567, 731, 278, 3030, 5534, 15595, 995, 304, 29871, 29945, 29900, 29995, 1015, 19772, 29889, 13, 4706, 8446, 2677, 2697, 28630, 29898, 4703, 29892, 29871, 29900, 29889, 29945, 29897, 13, 4706, 396, 4103, 9632, 1623, 363, 263, 1473, 1948, 310, 7705, 19536, 29889, 13, 4706, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 29871, 29900, 29889, 29900, 29892, 19691, 1621, 29889, 2311, 29889, 3545, 718, 29871, 29955, 29900, 29889, 29900, 876, 13, 4706, 396, 2538, 300, 278, 15595, 995, 310, 278, 2927, 1409, 304, 8072, 1015, 19772, 29889, 13, 4706, 2927, 29961, 29941, 29962, 353, 29871, 29896, 29889, 29900, 13, 13, 1753, 4216, 3047, 3306, 10358, 355, 6818, 29898, 4703, 29892, 3142, 1125, 13, 1678, 396, 319, 21246, 7933, 2927, 29889, 13, 1678, 7933, 353, 518, 29900, 29889, 29945, 29947, 29946, 29892, 29871, 29900, 29889, 29947, 29955, 29896, 29892, 29871, 29900, 29889, 29941, 29896, 29947, 29892, 29871, 29896, 29889, 29900, 29962, 13, 13, 1678, 396, 6204, 263, 8446, 8493, 6268, 1203, 515, 278, 3988, 29889, 13, 1678, 13552, 14526, 353, 8446, 8493, 6268, 4391, 3047, 4219, 29898, 2271, 29897, 13, 1678, 565, 13552, 14526, 338, 6213, 29901, 13, 4706, 1596, 5099, 9675, 29889, 303, 20405, 29892, 376, 23323, 29876, 29915, 29873, 1653, 8446, 8493, 6268, 515, 3988, 3850, 13, 4706, 736, 13, 13, 1678, 396, 4250, 2408, 278, 5745, 3800, 363, 1813, 29871, 29896, 310, 278, 11328, 1842, 29889, 13, 1678, 13552, 7364, 353, 8446, 8493, 6268, 2577, 10572, 3313, 29898, 5140, 14526, 29892, 29871, 29896, 29897, 13, 1678, 396, 3789, 278, 3978, 310, 278, 16701, 304, 313, 29900, 29892, 29900, 467, 13, 1678, 13552, 7364, 29889, 12574, 29889, 29916, 353, 13552, 7364, 29889, 12574, 29889, 29891, 353, 29871, 29900, 13, 13, 1678, 396, 12367, 293, 29871, 29896, 29892, 278, 2175, 11910, 310, 278, 4377, 29889, 13, 1678, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 29871, 29906, 29900, 29892, 29871, 29896, 29900, 718, 26064, 2577, 7011, 29898, 5140, 7364, 6802, 29906, 29897, 13, 13, 1678, 396, 18492, 278, 11328, 1842, 29889, 13, 1678, 8446, 2677, 8537, 8493, 6268, 29898, 4703, 29892, 13552, 7364, 29892, 13552, 14526, 29892, 29871, 29896, 29897, 13, 13, 1678, 396, 3789, 278, 5445, 2927, 2913, 304, 393, 4133, 491, 679, 1576, 7856, 4626, 630, 28212, 3306, 14936, 29889, 13, 1678, 8446, 2677, 2697, 20876, 3306, 14936, 29898, 4703, 29892, 22310, 1907, 29889, 657, 1576, 7856, 4626, 630, 28212, 3306, 14936, 3101, 13, 1678, 396, 3789, 278, 5445, 2927, 304, 7933, 29889, 13, 1678, 8446, 2677, 2697, 20876, 3306, 29898, 4703, 29892, 7933, 29897, 13, 13, 1678, 396, 12367, 293, 29871, 29906, 29892, 278, 2246, 29899, 1266, 11910, 310, 278, 4377, 29889, 13, 1678, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 26064, 2577, 6110, 29898, 5140, 7364, 29897, 718, 29871, 29896, 29900, 29892, 13, 462, 462, 1678, 26064, 2577, 7011, 29898, 5140, 7364, 6802, 29906, 718, 29871, 29896, 29900, 29897, 13, 13, 1678, 396, 18492, 278, 11328, 1842, 1449, 29889, 13, 1678, 8446, 2677, 8537, 8493, 6268, 29898, 4703, 29892, 13552, 7364, 29892, 13552, 14526, 29892, 29871, 29896, 29897, 13, 13, 1678, 396, 8561, 263, 5445, 16701, 393, 338, 278, 1021, 2159, 408, 278, 11328, 1842, 13, 1678, 396, 541, 297, 842, 1269, 2625, 491, 29871, 29947, 29900, 10340, 297, 921, 322, 29871, 29906, 29900, 10340, 297, 343, 29889, 13, 1678, 297, 842, 7364, 353, 26064, 797, 842, 29898, 5140, 7364, 29892, 29871, 29947, 29900, 29892, 29871, 29906, 29900, 29897, 13, 1678, 396, 383, 453, 278, 16701, 411, 7933, 29889, 7311, 278, 5445, 2927, 338, 1015, 19772, 322, 13, 1678, 396, 278, 1999, 355, 4464, 338, 21981, 29892, 445, 19726, 1973, 278, 11580, 1090, 484, 493, 29889, 13, 1678, 8446, 2677, 20876, 7364, 29898, 4703, 29892, 297, 842, 7364, 29897, 13, 13, 1678, 396, 12367, 293, 29871, 29941, 29892, 278, 5970, 29899, 1266, 11910, 310, 278, 4377, 29889, 13, 1678, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 29871, 29900, 29892, 19691, 29896, 29900, 718, 26064, 2577, 7011, 29898, 5140, 7364, 4961, 13, 13, 1678, 396, 18492, 278, 11328, 1842, 1449, 29889, 13, 1678, 8446, 2677, 8537, 8493, 6268, 29898, 4703, 29892, 13552, 7364, 29892, 13552, 14526, 29892, 29871, 29896, 29897, 13, 13, 1678, 396, 3789, 278, 1999, 355, 4464, 304, 413, 29907, 7210, 29880, 355, 6818, 3306, 607, 674, 13, 1678, 396, 2927, 675, 278, 12551, 411, 15352, 11580, 29889, 13, 1678, 8446, 2677, 2697, 10358, 355, 6818, 29898, 4703, 29892, 413, 29907, 7210, 29880, 355, 6818, 3306, 29897, 13, 1678, 396, 18492, 278, 16701, 373, 2246, 310, 278, 11328, 1842, 29889, 450, 11910, 310, 278, 13, 1678, 396, 3239, 393, 338, 10664, 491, 278, 16701, 338, 2927, 1891, 13, 1678, 396, 411, 278, 5445, 2927, 29889, 13, 1678, 8446, 2677, 20876, 7364, 29898, 4703, 29892, 297, 842, 7364, 29897, 13, 13, 13, 1753, 1653, 6489, 5843, 2605, 29898, 4703, 29892, 4818, 29892, 560, 5843, 3505, 1125, 13, 1678, 8446, 2677, 11371, 29954, 2792, 29898, 4703, 29897, 13, 1678, 396, 4103, 9632, 278, 14821, 3978, 304, 278, 4818, 1298, 29889, 13, 1678, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 4818, 29889, 29916, 29892, 4818, 29889, 29891, 29897, 13, 1678, 396, 2522, 744, 278, 14821, 1788, 304, 4203, 278, 2920, 322, 3171, 13, 1678, 396, 310, 278, 560, 5843, 29889, 13, 1678, 8446, 2677, 17185, 1783, 29924, 29898, 4703, 29892, 560, 5843, 3505, 29889, 2103, 29914, 29906, 29892, 560, 5843, 3505, 29889, 3545, 29914, 29906, 29897, 13, 1678, 8446, 2677, 17946, 2605, 29898, 4703, 29897, 13, 1678, 396, 3462, 263, 19308, 15232, 304, 278, 2224, 29892, 24764, 472, 278, 3978, 322, 13, 1678, 396, 411, 263, 11855, 310, 29871, 29896, 29889, 29900, 29889, 910, 11855, 29892, 4208, 411, 278, 13, 1678, 396, 21640, 2038, 363, 278, 2920, 322, 3171, 29892, 13880, 385, 560, 5843, 13, 1678, 396, 310, 278, 1959, 2159, 29889, 13, 1678, 8446, 2677, 2528, 1433, 29883, 29898, 4703, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29892, 22310, 1907, 29889, 2287, 29954, 1525, 2890, 29918, 4986, 29918, 29934, 3035, 29902, 2190, 29903, 29898, 29941, 29953, 29900, 29889, 29900, 511, 29871, 29900, 29889, 29900, 29897, 13, 1678, 396, 23186, 278, 2224, 577, 393, 445, 2224, 338, 13907, 363, 23351, 9292, 29892, 13, 1678, 396, 881, 393, 367, 7429, 29889, 13, 1678, 8446, 2677, 11123, 2605, 29898, 4703, 29897, 13, 1678, 8446, 2677, 15078, 487, 29954, 2792, 29898, 4703, 29897, 13, 13, 29918, 459, 19772, 29933, 4708, 3306, 353, 6213, 13, 29918, 459, 19772, 29949, 3881, 3306, 353, 6213, 13, 1753, 437, 29907, 492, 2986, 6489, 5843, 29898, 4703, 1125, 13, 1678, 5534, 903, 459, 19772, 29933, 4708, 3306, 29892, 903, 459, 19772, 29949, 3881, 3306, 13, 13, 1678, 278, 13409, 5228, 353, 8446, 5228, 29898, 29896, 29906, 29900, 29889, 29900, 29892, 29871, 29896, 29906, 29900, 29889, 29900, 29897, 13, 1678, 278, 6489, 5843, 3505, 353, 8446, 3505, 29898, 29896, 29900, 29900, 29889, 29900, 29892, 29871, 29906, 29900, 29900, 29889, 29900, 29897, 13, 1678, 12569, 353, 518, 29871, 29906, 29889, 29900, 4514, 13, 13, 1678, 396, 25455, 278, 8446, 3306, 5620, 29879, 565, 5181, 29889, 13, 1678, 565, 903, 459, 19772, 29933, 4708, 3306, 338, 6213, 29901, 13, 4706, 396, 450, 2847, 995, 310, 278, 2927, 1409, 338, 385, 13, 4706, 396, 1015, 19772, 17354, 297, 385, 390, 7210, 2927, 2913, 29889, 13, 4706, 2927, 353, 518, 29900, 29889, 29941, 29906, 29945, 29892, 29871, 29900, 29889, 29906, 29900, 29947, 29892, 29871, 29900, 29889, 29896, 29945, 29955, 29892, 29871, 29896, 29889, 29900, 29962, 13, 4706, 278, 3306, 14936, 353, 22310, 1907, 29889, 657, 1576, 7856, 4626, 630, 28212, 3306, 14936, 580, 13, 4706, 396, 6204, 263, 8446, 3306, 5620, 363, 1015, 19772, 17354, 29889, 13, 4706, 903, 459, 19772, 29933, 4708, 3306, 353, 8446, 3306, 4391, 29898, 1552, 3306, 14936, 29892, 2927, 29897, 13, 4706, 396, 8561, 278, 2927, 1409, 3928, 304, 385, 1015, 19772, 24841, 29889, 13, 4706, 2927, 353, 518, 29900, 29889, 29929, 29953, 29945, 29892, 29871, 29900, 29889, 29945, 29947, 29946, 29892, 29871, 29900, 29889, 29900, 29945, 29929, 29892, 29871, 29896, 29889, 29900, 4514, 13, 4706, 396, 6204, 1790, 8446, 3306, 5620, 363, 1015, 19772, 24841, 29889, 13, 4706, 903, 459, 19772, 29949, 3881, 3306, 353, 8446, 3306, 4391, 29898, 1552, 3306, 14936, 29892, 2927, 29897, 13, 13, 1678, 396, 18492, 1023, 22434, 567, 267, 24764, 1048, 278, 1021, 1298, 29892, 697, 13, 1678, 396, 5731, 630, 29871, 29946, 29945, 14496, 515, 278, 916, 29889, 13, 1678, 8446, 2677, 11371, 29954, 2792, 29898, 4703, 29897, 13, 1678, 396, 1260, 5843, 29871, 29896, 13, 1678, 1653, 6489, 5843, 2605, 29898, 4703, 29892, 278, 13409, 5228, 29892, 278, 6489, 5843, 3505, 29897, 13, 1678, 8446, 2677, 2697, 20876, 3306, 3047, 3306, 29898, 4703, 29892, 903, 459, 19772, 29933, 4708, 3306, 29897, 13, 1678, 8446, 2677, 20876, 2605, 29898, 4703, 29897, 13, 1678, 396, 4103, 9632, 322, 16734, 1048, 278, 4818, 1298, 310, 278, 560, 5843, 29889, 13, 1678, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 278, 13409, 5228, 29889, 29916, 29892, 278, 13409, 5228, 29889, 29891, 29897, 13, 1678, 396, 9664, 403, 491, 29871, 29946, 29945, 14496, 29889, 13, 1678, 8446, 2677, 21281, 403, 1783, 29924, 29898, 4703, 29892, 22310, 1907, 29889, 2287, 29954, 1525, 2890, 29918, 4986, 29918, 29934, 3035, 29902, 2190, 29903, 29898, 29946, 29945, 876, 13, 1678, 396, 1260, 5843, 29871, 29906, 13, 1678, 396, 8446, 5228, 24214, 338, 263, 758, 29899, 12119, 24664, 29920, 1298, 6590, 304, 13, 1678, 396, 278, 14821, 313, 29900, 29892, 29900, 467, 13, 1678, 1653, 6489, 5843, 2605, 29898, 4703, 29892, 8446, 5228, 24214, 29892, 278, 6489, 5843, 3505, 29897, 13, 1678, 8446, 2677, 2697, 20876, 3306, 3047, 3306, 29898, 4703, 29892, 903, 459, 19772, 29949, 3881, 3306, 29897, 13, 1678, 8446, 2677, 20876, 2605, 29898, 4703, 29897, 13, 1678, 8446, 2677, 15078, 487, 29954, 2792, 29898, 4703, 29897, 13, 13, 1678, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 29871, 29896, 29955, 29900, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29897, 13, 1678, 396, 2567, 671, 278, 937, 560, 5843, 408, 263, 9335, 3262, 4038, 7536, 304, 13, 1678, 396, 20413, 278, 1473, 560, 5843, 29889, 13, 1678, 8446, 2677, 11371, 29954, 2792, 29898, 4703, 29897, 13, 1678, 396, 1260, 5843, 29871, 29941, 13, 1678, 1653, 6489, 5843, 2605, 29898, 4703, 29892, 278, 13409, 5228, 29892, 278, 6489, 5843, 3505, 29897, 13, 1678, 8446, 2677, 2697, 855, 10946, 3306, 3047, 3306, 29898, 4703, 29892, 903, 459, 19772, 29933, 4708, 3306, 29897, 13, 1678, 8446, 2677, 2697, 3542, 29928, 1161, 29898, 4703, 29892, 29871, 29900, 29892, 12569, 29892, 29871, 29896, 29897, 13, 1678, 396, 624, 10946, 278, 2224, 411, 263, 12569, 29889, 13, 1678, 8446, 2677, 855, 10946, 2605, 29898, 4703, 29897, 13, 1678, 396, 1260, 5843, 29871, 29946, 13, 1678, 1653, 6489, 5843, 2605, 29898, 4703, 29892, 278, 13409, 5228, 29892, 278, 6489, 5843, 3505, 29897, 13, 1678, 396, 315, 3466, 304, 278, 22434, 415, 936, 2224, 29889, 13, 1678, 8446, 2677, 29907, 3466, 29898, 4703, 29897, 13, 1678, 8446, 2677, 4300, 9632, 1783, 29924, 29898, 4703, 29892, 278, 13409, 5228, 29889, 29916, 29892, 278, 13409, 5228, 29889, 29891, 29897, 13, 1678, 396, 9664, 403, 491, 29871, 29946, 29945, 14496, 29889, 13, 1678, 8446, 2677, 21281, 403, 1783, 29924, 29898, 4703, 29892, 22310, 1907, 29889, 2287, 29954, 1525, 2890, 29918, 4986, 29918, 29934, 3035, 29902, 2190, 29903, 29898, 29946, 29945, 876, 13, 1678, 396, 1260, 5843, 29871, 29945, 13, 1678, 1653, 6489, 5843, 2605, 29898, 4703, 29892, 8446, 5228, 24214, 29892, 278, 6489, 5843, 3505, 29897, 13, 1678, 8446, 2677, 2697, 20876, 3306, 3047, 3306, 29898, 4703, 29892, 903, 459, 19772, 29949, 3881, 3306, 29897, 13, 1678, 8446, 2677, 20876, 2605, 29898, 4703, 29897, 13, 1678, 8446, 2677, 15078, 487, 29954, 2792, 29898, 4703, 29897, 13, 2 ]
apps/lectures/serializers.py
csilouanos/student-management-system
0
15291
<filename>apps/lectures/serializers.py from rest_framework import serializers from .models import Lecture class LectureSerializer(serializers.ModelSerializer): class Meta: model = Lecture fields = ('id', 'title', 'lecturer_name', 'date', 'duration', 'slides_url', 'is_required')
[ 1, 529, 9507, 29958, 13371, 29914, 781, 1973, 29914, 15550, 19427, 29889, 2272, 13, 3166, 1791, 29918, 4468, 1053, 7797, 19427, 13, 3166, 869, 9794, 1053, 365, 522, 545, 13, 13, 1990, 365, 522, 545, 17679, 29898, 15550, 19427, 29889, 3195, 17679, 1125, 13, 1678, 770, 20553, 29901, 13, 4706, 1904, 353, 365, 522, 545, 13, 4706, 4235, 353, 6702, 333, 742, 525, 3257, 742, 525, 781, 9945, 29918, 978, 742, 525, 1256, 742, 525, 19708, 742, 29871, 13, 462, 1678, 525, 2536, 2247, 29918, 2271, 742, 525, 275, 29918, 12403, 1495, 13, 2 ]
LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Medium/template.py
Sycamore-City-passerby/ML
0
109596
""" Time Complexity = O(log(N)) Space Complexity = O(1) Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an integer, the decimal digits are truncated and only the integer part of the result is returned. Example: Input: 8 Output: 2 Explanation: The square root of 8 is 2.82842..., and since the decimal part is truncated, 2 is returned. """
[ 1, 9995, 13, 1678, 5974, 26596, 537, 353, 438, 29898, 1188, 29898, 29940, 876, 13, 1678, 14121, 26596, 537, 353, 438, 29898, 29896, 29897, 13, 13, 1678, 1954, 2037, 938, 18074, 2273, 29898, 524, 921, 467, 13, 1678, 11796, 29872, 322, 736, 278, 6862, 3876, 310, 921, 29892, 988, 921, 338, 22688, 304, 367, 263, 1661, 29899, 22198, 6043, 29889, 13, 1678, 4001, 278, 736, 1134, 338, 385, 6043, 29892, 278, 13677, 13340, 526, 21022, 630, 322, 871, 278, 6043, 760, 13, 1678, 310, 278, 1121, 338, 4133, 29889, 13, 13, 1678, 8741, 29901, 13, 1678, 10567, 29901, 29871, 29947, 13, 1678, 10604, 29901, 29871, 29906, 13, 1678, 1222, 9018, 362, 29901, 450, 6862, 3876, 310, 29871, 29947, 338, 29871, 29906, 29889, 29947, 29906, 29947, 29946, 29906, 16361, 322, 1951, 13, 462, 278, 13677, 760, 338, 21022, 630, 29892, 29871, 29906, 338, 4133, 29889, 13, 15945, 29908, 13, 2 ]
lamson/utils.py
medecau/lamson
0
99886
""" Mostly utility functions Lamson uses internally that don't really belong anywhere else in the modules. This module is kind of a dumping ground, so if you find something that can be improved feel free to work up a patch. """ from lamson import server, routing import sys, os import logging import daemon try: from daemon import pidlockfile except: from lockfile import pidlockfile import imp import signal def import_settings(boot_also, from_dir=None, boot_module="config.boot"): """Used to import the settings in a Lamson project.""" if from_dir: sys.path.append(from_dir) settings = __import__("config.settings", globals(), locals()).settings if boot_also: __import__(boot_module, globals(), locals()) return settings def daemonize(pid, chdir, chroot, umask, files_preserve=None, do_open=True): """ Uses python-daemonize to do all the junk needed to make a server a server. It supports all the features daemonize has, except that chroot probably won't work at all without some serious configuration on the system. """ context = daemon.DaemonContext() context.pidfile = pidlockfile.PIDLockFile(pid) context.stdout = open(os.path.join(chdir, "logs/lamson.out"),"a+") context.stderr = open(os.path.join(chdir, "logs/lamson.err"),"a+") context.files_preserve = files_preserve or [] context.working_directory = os.path.expanduser(chdir) if chroot: context.chroot_directory = os.path.expanduser(chroot) if umask != False: context.umask = umask if do_open: context.open() return context def drop_priv(uid, gid): """ Changes the uid/gid to the two given, you should give utils.daemonize 0,0 for the uid,gid so that it becomes root, which will allow you to then do this. """ logging.debug("Dropping to uid=%d, gid=%d", uid, gid) daemon.daemon.change_process_owner(uid, gid) logging.debug("Now running as uid=%d, gid=%d", os.getgid(), os.getuid()) def make_fake_settings(host, port): """ When running as a logging server we need a fake settings module to work with since the logging server can be run in any directory, so there may not be a config/settings.py file to import. """ logging.basicConfig(filename="logs/logger.log", level=logging.DEBUG) routing.Router.load(['lamson.handlers.log', 'lamson.handlers.queue']) settings = imp.new_module('settings') settings.receiver = server.SMTPReceiver(host, port) settings.relay = None logging.info("Logging mode enabled, will not send email to anyone, just log.") return settings def check_for_pid(pid, force): """Checks if a pid file is there, and if it is sys.exit. If force given then it will remove the file and not exit if it's there.""" if os.path.exists(pid): if not force: print "PID file %s exists, so assuming Lamson is running. Give -FORCE to force it to start." % pid sys.exit(1) return # for unit tests mocking sys.exit else: os.unlink(pid) def start_server(pid, force, chroot, chdir, uid, gid, umask, settings_loader, debug): """ Starts the server by doing a daemonize and then dropping priv accordingly. It will only drop to the uid/gid given if both are given. """ check_for_pid(pid, force) if not debug: daemonize(pid, chdir, chroot, umask, files_preserve=[]) sys.path.append(os.getcwd()) settings = settings_loader() if uid and gid: drop_priv(uid, gid) elif uid or gid: logging.warning("You probably meant to give a uid and gid, but you gave: uid=%r, gid=%r. Will not change to any user.", uid, gid) settings.receiver.start() if debug: print "Lamson started in debug mode. ctrl-c to quit..." import time try: while True: time.sleep(100000) except KeyboardInterrupt: # hard quit, since receiver starts a new thread. dirty but works os._exit(1)
[ 1, 9995, 13, 29924, 520, 368, 19725, 3168, 12718, 1100, 3913, 25106, 393, 1016, 29915, 29873, 13, 276, 635, 6852, 12214, 1683, 297, 278, 10585, 29889, 29871, 910, 3883, 13, 275, 2924, 310, 263, 16766, 292, 5962, 29892, 577, 565, 366, 1284, 1554, 393, 13, 3068, 367, 16710, 4459, 3889, 304, 664, 701, 263, 13261, 29889, 13, 15945, 29908, 13, 13, 3166, 301, 314, 1100, 1053, 1923, 29892, 21398, 13, 5215, 10876, 29892, 2897, 13, 5215, 12183, 13, 5215, 1146, 9857, 13, 13, 2202, 29901, 13, 1678, 515, 1146, 9857, 1053, 23107, 908, 1445, 29871, 13, 19499, 29901, 13, 1678, 515, 7714, 1445, 1053, 23107, 908, 1445, 29871, 13, 13, 5215, 2411, 13, 5215, 7182, 13, 13, 13, 1753, 1053, 29918, 11027, 29898, 4777, 29918, 15189, 29892, 515, 29918, 3972, 29922, 8516, 29892, 6579, 29918, 5453, 543, 2917, 29889, 4777, 29908, 1125, 13, 1678, 9995, 29965, 8485, 304, 1053, 278, 6055, 297, 263, 12718, 1100, 2060, 1213, 15945, 13, 1678, 565, 515, 29918, 3972, 29901, 13, 4706, 10876, 29889, 2084, 29889, 4397, 29898, 3166, 29918, 3972, 29897, 13, 13, 1678, 6055, 353, 4770, 5215, 1649, 703, 2917, 29889, 11027, 613, 13149, 1338, 3285, 1180, 1338, 16655, 11027, 13, 13, 1678, 565, 6579, 29918, 15189, 29901, 13, 4706, 4770, 5215, 12035, 4777, 29918, 5453, 29892, 13149, 1338, 3285, 1180, 1338, 3101, 13, 13, 1678, 736, 6055, 13, 13, 13, 1753, 1146, 9857, 675, 29898, 5935, 29892, 521, 3972, 29892, 521, 4632, 29892, 1922, 1278, 29892, 2066, 29918, 4569, 7143, 29922, 8516, 29892, 437, 29918, 3150, 29922, 5574, 1125, 13, 1678, 9995, 13, 1678, 10783, 267, 3017, 29899, 1388, 9857, 675, 304, 437, 599, 278, 432, 2960, 4312, 304, 1207, 263, 13, 1678, 1923, 263, 1923, 29889, 29871, 739, 11286, 599, 278, 5680, 1146, 9857, 675, 13, 1678, 756, 29892, 5174, 393, 521, 4632, 3117, 2113, 29915, 29873, 664, 472, 599, 1728, 13, 1678, 777, 10676, 5285, 373, 278, 1788, 29889, 13, 1678, 9995, 13, 1678, 3030, 353, 1146, 9857, 29889, 27838, 9857, 2677, 580, 13, 1678, 3030, 29889, 5935, 1445, 353, 23107, 908, 1445, 29889, 29925, 1367, 16542, 2283, 29898, 5935, 29897, 13, 1678, 3030, 29889, 25393, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 305, 3972, 29892, 376, 20756, 29914, 5288, 1100, 29889, 449, 4968, 29908, 29874, 29974, 1159, 462, 462, 462, 462, 462, 462, 4706, 13, 1678, 3030, 29889, 303, 20405, 353, 1722, 29898, 359, 29889, 2084, 29889, 7122, 29898, 305, 3972, 29892, 376, 20756, 29914, 5288, 1100, 29889, 3127, 4968, 29908, 29874, 29974, 1159, 462, 462, 462, 462, 462, 462, 4706, 13, 1678, 3030, 29889, 5325, 29918, 4569, 7143, 353, 2066, 29918, 4569, 7143, 470, 5159, 13, 1678, 3030, 29889, 22899, 29918, 12322, 353, 2897, 29889, 2084, 29889, 18837, 1792, 29898, 305, 3972, 29897, 13, 13, 1678, 565, 521, 4632, 29901, 29871, 13, 4706, 3030, 29889, 305, 4632, 29918, 12322, 353, 2897, 29889, 2084, 29889, 18837, 1792, 29898, 305, 4632, 29897, 13, 1678, 565, 1922, 1278, 2804, 7700, 29901, 13, 4706, 3030, 29889, 398, 1278, 353, 1922, 1278, 13, 13, 1678, 565, 437, 29918, 3150, 29901, 13, 4706, 3030, 29889, 3150, 580, 13, 13, 1678, 736, 3030, 13, 13, 1753, 5768, 29918, 22534, 29898, 5416, 29892, 330, 333, 1125, 13, 1678, 9995, 13, 1678, 678, 6916, 278, 318, 333, 29914, 29887, 333, 304, 278, 1023, 2183, 29892, 366, 881, 2367, 3667, 29879, 29889, 1388, 9857, 675, 13, 268, 29900, 29892, 29900, 363, 278, 318, 333, 29892, 29887, 333, 577, 393, 372, 7415, 3876, 29892, 607, 674, 2758, 366, 304, 769, 13, 1678, 437, 445, 29889, 13, 1678, 9995, 13, 1678, 12183, 29889, 8382, 703, 29928, 307, 3262, 304, 318, 333, 16328, 29881, 29892, 330, 333, 16328, 29881, 613, 318, 333, 29892, 330, 333, 29897, 13, 1678, 1146, 9857, 29889, 1388, 9857, 29889, 3167, 29918, 5014, 29918, 20348, 29898, 5416, 29892, 330, 333, 29897, 13, 1678, 12183, 29889, 8382, 703, 10454, 2734, 408, 318, 333, 16328, 29881, 29892, 330, 333, 16328, 29881, 613, 2897, 29889, 657, 29887, 333, 3285, 2897, 29889, 657, 5416, 3101, 13, 13, 13, 13, 1753, 1207, 29918, 29888, 1296, 29918, 11027, 29898, 3069, 29892, 2011, 1125, 13, 1678, 9995, 13, 1678, 1932, 2734, 408, 263, 12183, 1923, 591, 817, 263, 25713, 6055, 3883, 304, 664, 411, 13, 1678, 1951, 278, 12183, 1923, 508, 367, 1065, 297, 738, 3884, 29892, 577, 727, 1122, 451, 367, 13, 1678, 263, 2295, 29914, 11027, 29889, 2272, 934, 304, 1053, 29889, 13, 1678, 9995, 13, 1678, 12183, 29889, 16121, 3991, 29898, 9507, 543, 20756, 29914, 21707, 29889, 1188, 613, 3233, 29922, 21027, 29889, 18525, 29897, 13, 1678, 21398, 29889, 23971, 29889, 1359, 18959, 5288, 1100, 29889, 3179, 9306, 29889, 1188, 742, 525, 5288, 1100, 29889, 3179, 9306, 29889, 9990, 11287, 13, 1678, 6055, 353, 2411, 29889, 1482, 29918, 5453, 877, 11027, 1495, 13, 1678, 6055, 29889, 13556, 2147, 353, 1923, 29889, 17061, 3557, 22068, 29898, 3069, 29892, 2011, 29897, 13, 1678, 6055, 29889, 2674, 388, 353, 6213, 13, 1678, 12183, 29889, 3888, 703, 3403, 3460, 4464, 9615, 29892, 674, 451, 3638, 4876, 304, 5019, 29892, 925, 1480, 23157, 13, 13, 1678, 736, 6055, 13, 13, 1753, 1423, 29918, 1454, 29918, 5935, 29898, 5935, 29892, 4889, 1125, 13, 1678, 9995, 5596, 29879, 565, 263, 23107, 934, 338, 727, 29892, 322, 565, 372, 338, 10876, 29889, 13322, 29889, 29871, 960, 4889, 2183, 13, 1678, 769, 372, 674, 3349, 278, 934, 322, 451, 6876, 565, 372, 29915, 29879, 727, 1213, 15945, 13, 1678, 565, 2897, 29889, 2084, 29889, 9933, 29898, 5935, 1125, 13, 4706, 565, 451, 4889, 29901, 13, 9651, 1596, 376, 29925, 1367, 934, 1273, 29879, 4864, 29892, 577, 10241, 12718, 1100, 338, 2734, 29889, 29871, 25538, 448, 22051, 4741, 304, 4889, 372, 304, 1369, 1213, 1273, 23107, 13, 9651, 10876, 29889, 13322, 29898, 29896, 29897, 13, 9651, 736, 396, 363, 5190, 6987, 11187, 292, 10876, 29889, 13322, 13, 4706, 1683, 29901, 13, 9651, 2897, 29889, 348, 2324, 29898, 5935, 29897, 13, 13, 13, 1753, 1369, 29918, 2974, 29898, 5935, 29892, 4889, 29892, 521, 4632, 29892, 521, 3972, 29892, 318, 333, 29892, 330, 333, 29892, 1922, 1278, 29892, 6055, 29918, 12657, 29892, 4744, 1125, 13, 1678, 9995, 13, 1678, 624, 5708, 278, 1923, 491, 2599, 263, 1146, 9857, 675, 322, 769, 4441, 3262, 5999, 13, 1678, 16205, 29889, 29871, 739, 674, 871, 5768, 304, 278, 318, 333, 29914, 29887, 333, 2183, 565, 1716, 526, 2183, 29889, 13, 1678, 9995, 13, 1678, 1423, 29918, 1454, 29918, 5935, 29898, 5935, 29892, 4889, 29897, 13, 13, 1678, 565, 451, 4744, 29901, 13, 4706, 1146, 9857, 675, 29898, 5935, 29892, 521, 3972, 29892, 521, 4632, 29892, 1922, 1278, 29892, 2066, 29918, 4569, 7143, 11759, 2314, 13, 13, 1678, 10876, 29889, 2084, 29889, 4397, 29898, 359, 29889, 657, 29883, 9970, 3101, 13, 13, 1678, 6055, 353, 6055, 29918, 12657, 580, 13, 13, 1678, 565, 318, 333, 322, 330, 333, 29901, 13, 4706, 5768, 29918, 22534, 29898, 5416, 29892, 330, 333, 29897, 29871, 13, 1678, 25342, 318, 333, 470, 330, 333, 29901, 13, 4706, 12183, 29889, 27392, 703, 3492, 3117, 6839, 304, 2367, 263, 318, 333, 322, 330, 333, 29892, 541, 366, 4846, 29901, 318, 333, 16328, 29878, 29892, 330, 333, 16328, 29878, 29889, 29871, 2811, 451, 1735, 304, 738, 1404, 19602, 318, 333, 29892, 330, 333, 29897, 13, 13, 1678, 6055, 29889, 13556, 2147, 29889, 2962, 580, 13, 13, 1678, 565, 4744, 29901, 13, 4706, 1596, 376, 29931, 314, 1100, 4687, 297, 4744, 4464, 29889, 274, 11742, 29899, 29883, 304, 23283, 17794, 13, 4706, 1053, 931, 13, 4706, 1018, 29901, 13, 9651, 1550, 5852, 29901, 13, 18884, 931, 29889, 17059, 29898, 29896, 29900, 29900, 29900, 29900, 29900, 29897, 13, 4706, 5174, 7670, 3377, 4074, 6685, 29901, 13, 9651, 396, 2898, 23283, 29892, 1951, 19870, 8665, 263, 716, 3244, 29889, 26616, 541, 1736, 13, 9651, 2897, 3032, 13322, 29898, 29896, 29897, 13, 2 ]
docs/startdocs.py
philippeitis/justpy
1
156386
<filename>docs/startdocs.py import http.server import socketserver PORT = 8080 Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(("", PORT), Handler) as httpd: print(f"Serving docs at http://localhost:{PORT}") httpd.serve_forever()
[ 1, 529, 9507, 29958, 2640, 29914, 2962, 2640, 29889, 2272, 13, 5215, 1732, 29889, 2974, 13, 5215, 9909, 2974, 13, 13, 13, 15082, 353, 29871, 29947, 29900, 29947, 29900, 13, 13, 4598, 353, 1732, 29889, 2974, 29889, 15427, 10493, 3089, 4598, 13, 13, 2541, 9909, 2974, 29889, 29911, 6271, 6004, 29898, 703, 613, 349, 8476, 511, 5166, 1358, 29897, 408, 1732, 29881, 29901, 13, 1678, 1596, 29898, 29888, 29908, 1748, 1747, 10561, 472, 1732, 597, 7640, 26254, 15082, 27195, 13, 1678, 1732, 29881, 29889, 16349, 29918, 1079, 369, 580, 13, 13, 2 ]
not_tf_opt/__init__.py
gergely-flamich/not-tf-opt
0
37241
from .variables import * from .optimize import * from .utils import *
[ 1, 515, 869, 20897, 1053, 334, 13, 3166, 869, 20640, 675, 1053, 334, 13, 3166, 869, 13239, 1053, 334, 13, 2 ]
old/pro/src/lofarSun/lofarJ2000xySun.py
peijin94/LOFAR-Sun-tools
0
172868
""" A script to convert between the J2000 and the sun. """ from sunpy.coordinates.sun import sky_position as sun_position import sunpy.coordinates.sun as sun_coord import numpy as np def j2000xy(RA,DEC,t_sun): [RA_sun, DEC_sun] = sun_position(t_sun,False) rotate_angel = sun_coord.P(t_sun) # shift the center and transfer into arcsec x_shift = -(RA - RA_sun.degree) * 3600 y_shift = (DEC - DEC_sun.degree) * 3600 # rotate xy according to the position angle xx = x_shift * np.cos(-rotate_angel.rad) - y_shift * np.sin(-rotate_angel.rad) yy = x_shift * np.sin(-rotate_angel.rad) + y_shift * np.cos(-rotate_angel.rad) return [xx,yy]
[ 1, 29871, 13, 15945, 29908, 13, 29909, 2471, 304, 3588, 1546, 278, 435, 29906, 29900, 29900, 29900, 322, 278, 6575, 29889, 13, 15945, 29908, 13, 13, 3166, 6575, 2272, 29889, 1111, 24266, 29889, 11445, 1053, 14744, 29918, 3283, 408, 6575, 29918, 3283, 13, 5215, 6575, 2272, 29889, 1111, 24266, 29889, 11445, 408, 6575, 29918, 1111, 536, 13, 5215, 12655, 408, 7442, 13, 13, 1753, 432, 29906, 29900, 29900, 29900, 3594, 29898, 4717, 29892, 2287, 29907, 29892, 29873, 29918, 11445, 1125, 13, 1678, 518, 4717, 29918, 11445, 29892, 5012, 29907, 29918, 11445, 29962, 353, 6575, 29918, 3283, 29898, 29873, 29918, 11445, 29892, 8824, 29897, 13, 1678, 16734, 29918, 9477, 353, 6575, 29918, 1111, 536, 29889, 29925, 29898, 29873, 29918, 11445, 29897, 13, 13, 1678, 396, 9500, 278, 4818, 322, 6782, 964, 15232, 3471, 13, 1678, 921, 29918, 10889, 353, 19691, 4717, 29871, 448, 18865, 29918, 11445, 29889, 12163, 929, 29897, 29871, 334, 29871, 29941, 29953, 29900, 29900, 13, 1678, 343, 29918, 10889, 353, 313, 2287, 29907, 448, 5012, 29907, 29918, 11445, 29889, 12163, 929, 29897, 334, 29871, 29941, 29953, 29900, 29900, 13, 13, 1678, 396, 16734, 921, 29891, 5034, 304, 278, 2602, 10696, 13, 1678, 15473, 353, 921, 29918, 10889, 334, 7442, 29889, 3944, 6278, 23361, 29918, 9477, 29889, 3665, 29897, 448, 343, 29918, 10889, 334, 7442, 29889, 5223, 6278, 23361, 29918, 9477, 29889, 3665, 29897, 13, 1678, 343, 29891, 353, 921, 29918, 10889, 334, 7442, 29889, 5223, 6278, 23361, 29918, 9477, 29889, 3665, 29897, 718, 343, 29918, 10889, 334, 7442, 29889, 3944, 6278, 23361, 29918, 9477, 29889, 3665, 29897, 13, 1678, 736, 518, 4419, 29892, 8071, 29962, 13, 13, 2 ]
python/ee/tests/imagecollection_test.py
jsta/earthengine-api
1,909
144023
#!/usr/bin/env python """Test for the ee.imagecollection module.""" from unittest import mock import unittest import ee from ee import apitestcase class ImageCollectionTestCase(apitestcase.ApiTestCase): def testImageCollectionConstructors(self): """Verifies that constructors understand valid parameters.""" from_id = ee.ImageCollection('abcd') self.assertEqual( ee.ApiFunction.lookup('ImageCollection.load'), from_id.func) self.assertEqual({'id': 'abcd'}, from_id.args) from_images = ee.ImageCollection([ee.Image(1), ee.Image(2)]) self.assertEqual( ee.ApiFunction.lookup('ImageCollection.fromImages'), from_images.func) self.assertEqual({'images': [ee.Image(1), ee.Image(2)]}, from_images.args) self.assertEqual( ee.ImageCollection([ee.Image(1)]), ee.ImageCollection(ee.Image(1))) original = ee.ImageCollection('foo') from_other_image_collection = ee.ImageCollection(original) self.assertEqual(from_other_image_collection, original) l = ee.List([ee.Image(1)]).slice(0) from_list = ee.ImageCollection(l) self.assertEqual({'images': l}, from_list.args) from_computed_object = ee.ImageCollection( ee.ComputedObject(None, {'x': 'y'})) self.assertEqual({'x': 'y'}, from_computed_object.args) def testImperativeFunctions(self): """Verifies that imperative functions return ready values.""" image_collection = ee.ImageCollection(ee.Image(1)) self.assertEqual({'value': 'fakeValue'}, image_collection.getInfo()) self.assertEqual('fakeMapId', image_collection.getMapId()['mapid']) def testFilter(self): """Verifies that filtering an ImageCollection wraps the result.""" collection = ee.ImageCollection(ee.Image(1)) noop_filter = ee.Filter() filtered = collection.filter(noop_filter) self.assertIsInstance(filtered, ee.ImageCollection) self.assertEqual(ee.ApiFunction.lookup('Collection.filter'), filtered.func) self.assertEqual({ 'collection': collection, 'filter': noop_filter }, filtered.args) def testFirst(self): """Verifies that first gets promoted properly.""" first = ee.ImageCollection(ee.Image(1)).first() self.assertIsInstance(first, ee.Image) self.assertEqual(ee.ApiFunction.lookup('Collection.first'), first.func) def testPrepareForExport(self): """Verifies proper handling of export-related parameters.""" with apitestcase.UsingCloudApi(): base_collection = ee.ImageCollection(ee.Image(1)) collection, params = base_collection.prepare_for_export( {'something': 'else'}) self.assertEqual(base_collection, collection) self.assertEqual({'something': 'else'}, params) collection, params = base_collection.prepare_for_export({ 'crs': 'ABCD', 'crs_transform': '1,2,3,4,5,6' }) # Need to do a serialized comparison for the collection because # custom functions don't implement equality comparison. def expected_preparation_function(img): return img.reproject( crs='ABCD', crsTransform=[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]) expected_collection = base_collection.map(expected_preparation_function) self.assertEqual( expected_collection.serialize(for_cloud_api=True), collection.serialize(for_cloud_api=True)) self.assertEqual({}, params) if __name__ == '__main__': unittest.main()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 3057, 363, 278, 321, 29872, 29889, 3027, 10855, 3883, 1213, 15945, 13, 13, 13, 13, 3166, 443, 27958, 1053, 11187, 13, 13, 5215, 443, 27958, 13, 5215, 321, 29872, 13, 3166, 321, 29872, 1053, 3095, 277, 342, 4878, 13, 13, 13, 1990, 7084, 7196, 3057, 8259, 29898, 481, 277, 342, 4878, 29889, 11713, 3057, 8259, 1125, 13, 13, 29871, 822, 1243, 2940, 7196, 1168, 4984, 943, 29898, 1311, 1125, 13, 1678, 9995, 6565, 11057, 393, 3386, 943, 2274, 2854, 4128, 1213, 15945, 13, 1678, 515, 29918, 333, 353, 321, 29872, 29889, 2940, 7196, 877, 370, 2252, 1495, 13, 1678, 1583, 29889, 9294, 9843, 29898, 13, 4706, 321, 29872, 29889, 11713, 6678, 29889, 20401, 877, 2940, 7196, 29889, 1359, 5477, 515, 29918, 333, 29889, 9891, 29897, 13, 1678, 1583, 29889, 9294, 9843, 3319, 29915, 333, 2396, 525, 370, 2252, 16675, 515, 29918, 333, 29889, 5085, 29897, 13, 13, 1678, 515, 29918, 8346, 353, 321, 29872, 29889, 2940, 7196, 4197, 3905, 29889, 2940, 29898, 29896, 511, 321, 29872, 29889, 2940, 29898, 29906, 29897, 2314, 13, 1678, 1583, 29889, 9294, 9843, 29898, 13, 4706, 321, 29872, 29889, 11713, 6678, 29889, 20401, 877, 2940, 7196, 29889, 3166, 20163, 5477, 515, 29918, 8346, 29889, 9891, 29897, 13, 1678, 1583, 29889, 9294, 9843, 3319, 29915, 8346, 2396, 518, 3905, 29889, 2940, 29898, 29896, 511, 321, 29872, 29889, 2940, 29898, 29906, 4638, 1118, 515, 29918, 8346, 29889, 5085, 29897, 13, 13, 1678, 1583, 29889, 9294, 9843, 29898, 13, 4706, 321, 29872, 29889, 2940, 7196, 4197, 3905, 29889, 2940, 29898, 29896, 4638, 511, 321, 29872, 29889, 2940, 7196, 29898, 3905, 29889, 2940, 29898, 29896, 4961, 13, 13, 1678, 2441, 353, 321, 29872, 29889, 2940, 7196, 877, 5431, 1495, 13, 1678, 515, 29918, 1228, 29918, 3027, 29918, 10855, 353, 321, 29872, 29889, 2940, 7196, 29898, 13492, 29897, 13, 1678, 1583, 29889, 9294, 9843, 29898, 3166, 29918, 1228, 29918, 3027, 29918, 10855, 29892, 2441, 29897, 13, 13, 1678, 301, 353, 321, 29872, 29889, 1293, 4197, 3905, 29889, 2940, 29898, 29896, 4638, 467, 18337, 29898, 29900, 29897, 13, 1678, 515, 29918, 1761, 353, 321, 29872, 29889, 2940, 7196, 29898, 29880, 29897, 13, 1678, 1583, 29889, 9294, 9843, 3319, 29915, 8346, 2396, 301, 1118, 515, 29918, 1761, 29889, 5085, 29897, 13, 13, 1678, 515, 29918, 12097, 287, 29918, 3318, 353, 321, 29872, 29889, 2940, 7196, 29898, 13, 4706, 321, 29872, 29889, 20606, 287, 2061, 29898, 8516, 29892, 11117, 29916, 2396, 525, 29891, 10827, 876, 13, 1678, 1583, 29889, 9294, 9843, 3319, 29915, 29916, 2396, 525, 29891, 16675, 515, 29918, 12097, 287, 29918, 3318, 29889, 5085, 29897, 13, 13, 29871, 822, 1243, 1888, 546, 1230, 6678, 29879, 29898, 1311, 1125, 13, 1678, 9995, 6565, 11057, 393, 10112, 1230, 3168, 736, 7960, 1819, 1213, 15945, 13, 1678, 1967, 29918, 10855, 353, 321, 29872, 29889, 2940, 7196, 29898, 3905, 29889, 2940, 29898, 29896, 876, 13, 1678, 1583, 29889, 9294, 9843, 3319, 29915, 1767, 2396, 525, 29888, 1296, 1917, 16675, 1967, 29918, 10855, 29889, 657, 3401, 3101, 13, 1678, 1583, 29889, 9294, 9843, 877, 29888, 1296, 3388, 1204, 742, 1967, 29918, 10855, 29889, 657, 3388, 1204, 580, 1839, 1958, 333, 11287, 13, 13, 29871, 822, 1243, 5072, 29898, 1311, 1125, 13, 1678, 9995, 6565, 11057, 393, 21166, 385, 7084, 7196, 11463, 567, 278, 1121, 1213, 15945, 13, 1678, 4333, 353, 321, 29872, 29889, 2940, 7196, 29898, 3905, 29889, 2940, 29898, 29896, 876, 13, 1678, 694, 459, 29918, 4572, 353, 321, 29872, 29889, 5072, 580, 13, 1678, 22289, 353, 4333, 29889, 4572, 29898, 1217, 459, 29918, 4572, 29897, 13, 1678, 1583, 29889, 9294, 3624, 4998, 29898, 4572, 287, 29892, 321, 29872, 29889, 2940, 7196, 29897, 13, 1678, 1583, 29889, 9294, 9843, 29898, 3905, 29889, 11713, 6678, 29889, 20401, 877, 7196, 29889, 4572, 5477, 22289, 29889, 9891, 29897, 13, 1678, 1583, 29889, 9294, 9843, 3319, 13, 4706, 525, 10855, 2396, 4333, 29892, 13, 4706, 525, 4572, 2396, 694, 459, 29918, 4572, 13, 1678, 2981, 22289, 29889, 5085, 29897, 13, 13, 29871, 822, 1243, 6730, 29898, 1311, 1125, 13, 1678, 9995, 6565, 11057, 393, 937, 4947, 21201, 6284, 1213, 15945, 13, 1678, 937, 353, 321, 29872, 29889, 2940, 7196, 29898, 3905, 29889, 2940, 29898, 29896, 8106, 4102, 580, 13, 1678, 1583, 29889, 9294, 3624, 4998, 29898, 4102, 29892, 321, 29872, 29889, 2940, 29897, 13, 1678, 1583, 29889, 9294, 9843, 29898, 3905, 29889, 11713, 6678, 29889, 20401, 877, 7196, 29889, 4102, 5477, 937, 29889, 9891, 29897, 13, 13, 29871, 822, 1243, 29925, 3445, 598, 2831, 26382, 29898, 1311, 1125, 13, 1678, 9995, 6565, 11057, 1571, 11415, 310, 5609, 29899, 12817, 4128, 1213, 15945, 13, 1678, 411, 3095, 277, 342, 4878, 29889, 15156, 20442, 11713, 7295, 13, 418, 2967, 29918, 10855, 353, 321, 29872, 29889, 2940, 7196, 29898, 3905, 29889, 2940, 29898, 29896, 876, 13, 13, 418, 4333, 29892, 8636, 353, 2967, 29918, 10855, 29889, 19125, 29918, 1454, 29918, 15843, 29898, 13, 3986, 11117, 14481, 2396, 525, 2870, 29915, 1800, 13, 418, 1583, 29889, 9294, 9843, 29898, 3188, 29918, 10855, 29892, 4333, 29897, 13, 418, 1583, 29889, 9294, 9843, 3319, 29915, 14481, 2396, 525, 2870, 16675, 8636, 29897, 13, 13, 418, 4333, 29892, 8636, 353, 2967, 29918, 10855, 29889, 19125, 29918, 1454, 29918, 15843, 3319, 13, 3986, 525, 29883, 2288, 2396, 525, 2882, 6530, 742, 13, 3986, 525, 29883, 2288, 29918, 9067, 2396, 525, 29896, 29892, 29906, 29892, 29941, 29892, 29946, 29892, 29945, 29892, 29953, 29915, 13, 418, 5615, 13, 13, 418, 396, 20768, 304, 437, 263, 7797, 1891, 10230, 363, 278, 4333, 1363, 13, 418, 396, 2888, 3168, 1016, 29915, 29873, 2334, 17193, 10230, 29889, 13, 418, 822, 3806, 29918, 1457, 862, 362, 29918, 2220, 29898, 2492, 1125, 13, 4706, 736, 10153, 29889, 276, 4836, 29898, 13, 9651, 2181, 29879, 2433, 2882, 6530, 742, 2181, 29879, 13372, 11759, 29896, 29889, 29900, 29892, 29871, 29906, 29889, 29900, 29892, 29871, 29941, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 29892, 29871, 29945, 29889, 29900, 29892, 29871, 29953, 29889, 29900, 2314, 13, 13, 418, 3806, 29918, 10855, 353, 2967, 29918, 10855, 29889, 1958, 29898, 9684, 29918, 1457, 862, 362, 29918, 2220, 29897, 13, 418, 1583, 29889, 9294, 9843, 29898, 13, 3986, 3806, 29918, 10855, 29889, 643, 6646, 29898, 1454, 29918, 9274, 29918, 2754, 29922, 5574, 511, 13, 3986, 4333, 29889, 643, 6646, 29898, 1454, 29918, 9274, 29918, 2754, 29922, 5574, 876, 13, 418, 1583, 29889, 9294, 9843, 3319, 1118, 8636, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 29871, 443, 27958, 29889, 3396, 580, 13, 2 ]
DEAP_GP.py
iskaj/GeneticProgrammingExpression
1
65051
<filename>DEAP_GP.py from deap import base, creator, gp, tools, algorithms import math, operator, numpy import seaborn as sns import matplotlib.pyplot as plt import matplotlib.patches as mpatches # Because division is scary def protectedDiv(left, right): try: return left / right except ZeroDivisionError: return 1 # Because log is scary def protectedLog(x): try: return math.log(x) except ValueError: return 1 dataset = [[-1.0, 0.0000], [-0.9,-0.1629], [-0.8, -0.2624], [-0.7, -0.3129], [-0.6, -0.3264], [-0.5, -0.3125], [-0.4, -0.2784], [-0.3, -0.2289], [-0.2, -0.1664], [-0.1, -0.0909], [0.0, -0.0], [0.1, 0.1111], [0.2, 0.2496], [0.3, 0.4251], [0.4, 0.6496], [0.5, 0.9375], [0.6, 1.3056], [0.7, 1.7731], [0.8, 2.3616], [0.9, 3.0951], [1.0, 4.0000]] # Create the primitives set pset = gp.PrimitiveSet("MAIN", 1) pset.addPrimitive(operator.add, 2) pset.addPrimitive(operator.sub, 2) pset.addPrimitive(operator.mul, 2) pset.addPrimitive(protectedDiv, 2) pset.addPrimitive(math.cos, 1) pset.addPrimitive(math.sin, 1) pset.addPrimitive(protectedLog, 1) pset.addPrimitive(math.exp, 1) # Rename argument to simply x pset.renameArguments(ARG0='x') # Define genotype and fitness creator.create("FitnessMin", base.Fitness, weights=(-1.0,)) creator.create("Individual", gp.PrimitiveTree, fitness=creator.FitnessMin) # Define the toolbox toolbox = base.Toolbox() toolbox.register("expr", gp.genHalfAndHalf, pset=pset, min_=1, max_=2) toolbox.register("individual", tools.initIterate, creator.Individual, toolbox.expr) toolbox.register("population", tools.initRepeat, list, toolbox.individual) toolbox.register("compile", gp.compile, pset=pset) def evalSymbReg(individual, points): # Transform the tree expression in a callable function func = toolbox.compile(expr=individual) # MSE errors = (abs(func(point[0]) - point[1]) for point in dataset) return math.fsum(errors), # Squared Errors sqerrors = ((func(point[0]) - point[1])**2 for point in dataset) return math.fsum(sqerrors) / len(points), toolbox.register("evaluate", evalSymbReg, points=dataset) # toolbox.register("evaluate", evalSymbReg, points=[x/10. for x in range(-10,10)]) toolbox.register("select", tools.selTournament, tournsize=3) toolbox.register("mate", gp.cxOnePoint) toolbox.register("expr_mut", gp.genFull, min_=0, max_=2) toolbox.register("mutate", gp.mutUniform, expr=toolbox.expr_mut, pset=pset) toolbox.decorate("mate", gp.staticLimit(key=operator.attrgetter("height"), max_value=17)) toolbox.decorate("mutate", gp.staticLimit(key=operator.attrgetter("height"), max_value=17)) # Hold some statistics stats_fit = tools.Statistics(lambda ind: ind.fitness.values) stats_size = tools.Statistics(len) mstats = tools.MultiStatistics(fitness=stats_fit, size=stats_size) # mstats = tools.Statistics(lambda ind: ind.fitness.values) mstats.register("avg", numpy.mean) mstats.register("std", numpy.std) mstats.register("min", numpy.min) mstats.register("max", numpy.max) # Launching the evolution def evolution(): pop = toolbox.population(n=1000) hof = tools.HallOfFame(1) pop, log = algorithms.eaSimple(pop, toolbox, 0.7, 0.0, 50, stats=mstats, halloffame=hof, verbose=True) return pop, log, hof pop, log, hof = evolution() # Print info for best solution found: best = hof.items[0] print("-- Best Individual = ", best) print("-- Best Fitness = ", best.fitness.values[0]) # extract statistics: # print(log.chapters['fit'].select('min')) # print(log.chapters['fitness']) minFitnessValues = log.chapters['fitness'].select("min") minSizeValues = log.chapters['size'].select("min") print("MIN FITNESS: ", minFitnessValues) # # plot statistics: # sns.set_style("whitegrid") # plt.plot(minFitnessValues, color='red') # plt.plot(minSizeValues, color='green') # red_patch = mpatches.Patch(color='red', label='Best Fitness') # green_patch = mpatches.Patch(color='green', label='Size') # plt.legend(handles=[red_patch, green_patch]) # plt.xlabel('Generation') # plt.ylabel('Best Fitness & Size') # plt.title('Best fitness over generations') # plt.show() # plot statistics: sns.set_style("whitegrid") plt.plot(minFitnessValues, color='red') plt.xlabel('Generation') plt.ylabel('Best Fitness') plt.title('Fitness of best individual over generations') plt.show() plt.plot(minSizeValues, color='green') plt.xlabel('Generation') plt.ylabel('Size') plt.title('Size of best individual over generations') plt.show()
[ 1, 529, 9507, 29958, 2287, 3301, 29918, 19903, 29889, 2272, 13, 3166, 316, 481, 1053, 2967, 29892, 907, 1061, 29892, 330, 29886, 29892, 8492, 29892, 14009, 30004, 13, 5215, 5844, 29892, 5455, 29892, 12655, 30004, 13, 5215, 409, 370, 1398, 408, 269, 1983, 30004, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 30004, 13, 5215, 22889, 29889, 5041, 267, 408, 286, 5041, 267, 30004, 13, 30004, 13, 29937, 7311, 8542, 338, 885, 653, 30004, 13, 1753, 6364, 12596, 29898, 1563, 29892, 1492, 1125, 30004, 13, 1678, 1018, 29901, 30004, 13, 4706, 736, 2175, 847, 1492, 30004, 13, 1678, 5174, 28933, 12596, 2459, 2392, 29901, 30004, 13, 4706, 736, 29871, 29896, 30004, 13, 30004, 13, 29937, 7311, 1480, 338, 885, 653, 30004, 13, 1753, 6364, 3403, 29898, 29916, 1125, 30004, 13, 1678, 1018, 29901, 30004, 13, 4706, 736, 5844, 29889, 1188, 29898, 29916, 8443, 13, 1678, 5174, 7865, 2392, 29901, 30004, 13, 4706, 736, 29871, 29896, 30004, 13, 30004, 13, 24713, 353, 5519, 29899, 29896, 29889, 29900, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29900, 1402, 259, 21069, 29900, 29889, 29929, 6653, 29900, 29889, 29896, 29953, 29906, 29929, 1402, 1678, 21069, 29900, 29889, 29947, 29892, 448, 29900, 29889, 29906, 29953, 29906, 29946, 1402, 30004, 13, 965, 21069, 29900, 29889, 29955, 29892, 448, 29900, 29889, 29941, 29896, 29906, 29929, 1402, 29871, 21069, 29900, 29889, 29953, 29892, 448, 29900, 29889, 29941, 29906, 29953, 29946, 1402, 259, 21069, 29900, 29889, 29945, 29892, 448, 29900, 29889, 29941, 29896, 29906, 29945, 1402, 30004, 13, 965, 21069, 29900, 29889, 29946, 29892, 448, 29900, 29889, 29906, 29955, 29947, 29946, 1402, 29871, 21069, 29900, 29889, 29941, 29892, 448, 29900, 29889, 29906, 29906, 29947, 29929, 1402, 259, 21069, 29900, 29889, 29906, 29892, 448, 29900, 29889, 29896, 29953, 29953, 29946, 1402, 30004, 13, 965, 21069, 29900, 29889, 29896, 29892, 448, 29900, 29889, 29900, 29929, 29900, 29929, 1402, 29871, 518, 29900, 29889, 29900, 29892, 448, 29900, 29889, 29900, 1402, 539, 518, 29900, 29889, 29896, 29892, 29871, 29900, 29889, 29896, 29896, 29896, 29896, 1402, 30004, 13, 965, 518, 29900, 29889, 29906, 29892, 29871, 29900, 29889, 29906, 29946, 29929, 29953, 1402, 1678, 518, 29900, 29889, 29941, 29892, 29871, 29900, 29889, 29946, 29906, 29945, 29896, 1402, 268, 518, 29900, 29889, 29946, 29892, 29871, 29900, 29889, 29953, 29946, 29929, 29953, 1402, 30004, 13, 965, 518, 29900, 29889, 29945, 29892, 29871, 29900, 29889, 29929, 29941, 29955, 29945, 1402, 1678, 518, 29900, 29889, 29953, 29892, 29871, 29896, 29889, 29941, 29900, 29945, 29953, 1402, 268, 518, 29900, 29889, 29955, 29892, 29871, 29896, 29889, 29955, 29955, 29941, 29896, 1402, 30004, 13, 965, 518, 29900, 29889, 29947, 29892, 29871, 29906, 29889, 29941, 29953, 29896, 29953, 1402, 1678, 518, 29900, 29889, 29929, 29892, 29871, 29941, 29889, 29900, 29929, 29945, 29896, 1402, 268, 518, 29896, 29889, 29900, 29892, 29871, 29946, 29889, 29900, 29900, 29900, 29900, 5262, 30004, 13, 30004, 13, 29937, 6204, 278, 28147, 3145, 731, 30004, 13, 567, 300, 353, 330, 29886, 29889, 18213, 3321, 2697, 703, 29032, 613, 29871, 29896, 8443, 13, 567, 300, 29889, 1202, 18213, 3321, 29898, 6891, 29889, 1202, 29892, 29871, 29906, 8443, 13, 567, 300, 29889, 1202, 18213, 3321, 29898, 6891, 29889, 1491, 29892, 29871, 29906, 8443, 13, 567, 300, 29889, 1202, 18213, 3321, 29898, 6891, 29889, 16109, 29892, 29871, 29906, 8443, 13, 567, 300, 29889, 1202, 18213, 3321, 29898, 24681, 12596, 29892, 29871, 29906, 8443, 13, 567, 300, 29889, 1202, 18213, 3321, 29898, 755, 29889, 3944, 29892, 29871, 29896, 8443, 13, 567, 300, 29889, 1202, 18213, 3321, 29898, 755, 29889, 5223, 29892, 29871, 29896, 8443, 13, 567, 300, 29889, 1202, 18213, 3321, 29898, 24681, 3403, 29892, 29871, 29896, 8443, 13, 567, 300, 29889, 1202, 18213, 3321, 29898, 755, 29889, 4548, 29892, 29871, 29896, 8443, 13, 30004, 13, 29937, 390, 3871, 2980, 304, 3763, 921, 30004, 13, 567, 300, 29889, 1267, 420, 26915, 29898, 1718, 29954, 29900, 2433, 29916, 1495, 30004, 13, 30004, 13, 29937, 22402, 2531, 327, 668, 322, 6216, 2264, 30004, 13, 1037, 1061, 29889, 3258, 703, 29943, 277, 2264, 8140, 613, 2967, 29889, 29943, 277, 2264, 29892, 18177, 29922, 6278, 29896, 29889, 29900, 29892, 876, 30004, 13, 1037, 1061, 29889, 3258, 703, 2568, 23352, 613, 330, 29886, 29889, 18213, 3321, 9643, 29892, 6216, 2264, 29922, 1037, 1061, 29889, 29943, 277, 2264, 8140, 8443, 13, 30004, 13, 29937, 22402, 278, 5780, 1884, 30004, 13, 10154, 1884, 353, 2967, 29889, 12229, 1884, 26471, 13, 10154, 1884, 29889, 9573, 703, 13338, 613, 330, 29886, 29889, 1885, 29950, 3131, 2855, 29950, 3131, 29892, 282, 842, 29922, 567, 300, 29892, 1375, 29918, 29922, 29896, 29892, 4236, 29918, 29922, 29906, 8443, 13, 10154, 1884, 29889, 9573, 703, 513, 23352, 613, 8492, 29889, 2344, 13463, 403, 29892, 907, 1061, 29889, 2568, 23352, 29892, 5780, 1884, 29889, 13338, 8443, 13, 10154, 1884, 29889, 9573, 703, 7323, 2785, 613, 8492, 29889, 2344, 1123, 11666, 29892, 1051, 29892, 5780, 1884, 29889, 513, 23352, 8443, 13, 10154, 1884, 29889, 9573, 703, 12198, 613, 330, 29886, 29889, 12198, 29892, 282, 842, 29922, 567, 300, 8443, 13, 30004, 13, 1753, 19745, 25548, 29890, 4597, 29898, 513, 23352, 29892, 3291, 1125, 30004, 13, 1678, 396, 4103, 689, 278, 5447, 4603, 297, 263, 1246, 519, 740, 30004, 13, 1678, 3653, 353, 5780, 1884, 29889, 12198, 29898, 13338, 29922, 513, 23352, 8443, 13, 1678, 396, 341, 1660, 30004, 13, 1678, 4436, 353, 313, 6897, 29898, 9891, 29898, 3149, 29961, 29900, 2314, 448, 1298, 29961, 29896, 2314, 363, 1298, 297, 8783, 8443, 13, 1678, 736, 5844, 29889, 29888, 2083, 29898, 12523, 511, 30004, 13, 1678, 396, 317, 339, 1965, 4829, 29879, 30004, 13, 1678, 18074, 12523, 353, 5135, 9891, 29898, 3149, 29961, 29900, 2314, 448, 1298, 29961, 29896, 2314, 1068, 29906, 363, 1298, 297, 8783, 8443, 13, 1678, 736, 5844, 29889, 29888, 2083, 29898, 3044, 12523, 29897, 847, 7431, 29898, 9748, 511, 30004, 13, 30004, 13, 30004, 13, 10154, 1884, 29889, 9573, 703, 24219, 403, 613, 19745, 25548, 29890, 4597, 29892, 3291, 29922, 24713, 8443, 13, 29937, 5780, 1884, 29889, 9573, 703, 24219, 403, 613, 19745, 25548, 29890, 4597, 29892, 3291, 11759, 29916, 29914, 29896, 29900, 29889, 363, 921, 297, 3464, 6278, 29896, 29900, 29892, 29896, 29900, 29897, 2314, 30004, 13, 10154, 1884, 29889, 9573, 703, 2622, 613, 8492, 29889, 2838, 29911, 2905, 1166, 29892, 6282, 1983, 675, 29922, 29941, 8443, 13, 10154, 1884, 29889, 9573, 703, 25046, 613, 330, 29886, 29889, 18904, 6716, 5228, 8443, 13, 10154, 1884, 29889, 9573, 703, 13338, 29918, 6149, 613, 330, 29886, 29889, 1885, 13658, 29892, 1375, 29918, 29922, 29900, 29892, 4236, 29918, 29922, 29906, 8443, 13, 10154, 1884, 29889, 9573, 703, 6149, 403, 613, 330, 29886, 29889, 6149, 2525, 5560, 29892, 22010, 29922, 10154, 1884, 29889, 13338, 29918, 6149, 29892, 282, 842, 29922, 567, 300, 8443, 13, 30004, 13, 10154, 1884, 29889, 19557, 403, 703, 25046, 613, 330, 29886, 29889, 7959, 24445, 29898, 1989, 29922, 6891, 29889, 5552, 657, 357, 703, 3545, 4968, 4236, 29918, 1767, 29922, 29896, 29955, 876, 30004, 13, 10154, 1884, 29889, 19557, 403, 703, 6149, 403, 613, 330, 29886, 29889, 7959, 24445, 29898, 1989, 29922, 6891, 29889, 5552, 657, 357, 703, 3545, 4968, 4236, 29918, 1767, 29922, 29896, 29955, 876, 30004, 13, 30004, 13, 29937, 21771, 777, 13964, 30004, 13, 16202, 29918, 9202, 353, 8492, 29889, 9513, 6765, 29898, 2892, 1399, 29901, 1399, 29889, 9202, 2264, 29889, 5975, 8443, 13, 16202, 29918, 2311, 353, 8492, 29889, 9513, 6765, 29898, 2435, 8443, 13, 29885, 16202, 353, 8492, 29889, 15329, 9513, 6765, 29898, 9202, 2264, 29922, 16202, 29918, 9202, 29892, 2159, 29922, 16202, 29918, 2311, 8443, 13, 29937, 286, 16202, 353, 8492, 29889, 9513, 6765, 29898, 2892, 1399, 29901, 1399, 29889, 9202, 2264, 29889, 5975, 8443, 13, 29885, 16202, 29889, 9573, 703, 485, 29887, 613, 12655, 29889, 12676, 8443, 13, 29885, 16202, 29889, 9573, 703, 4172, 613, 12655, 29889, 4172, 8443, 13, 29885, 16202, 29889, 9573, 703, 1195, 613, 12655, 29889, 1195, 8443, 13, 29885, 16202, 29889, 9573, 703, 3317, 613, 12655, 29889, 3317, 8443, 13, 30004, 13, 29937, 997, 3322, 292, 278, 14675, 30004, 13, 1753, 14675, 7295, 30004, 13, 1678, 1835, 353, 5780, 1884, 29889, 7323, 2785, 29898, 29876, 29922, 29896, 29900, 29900, 29900, 8443, 13, 1678, 298, 974, 353, 8492, 29889, 29950, 497, 2776, 29943, 420, 29898, 29896, 8443, 13, 1678, 1835, 29892, 1480, 353, 14009, 29889, 11248, 15427, 29898, 7323, 29892, 5780, 1884, 29892, 29871, 29900, 29889, 29955, 29892, 29871, 29900, 29889, 29900, 29892, 29871, 29945, 29900, 29892, 22663, 29922, 29885, 16202, 11167, 13, 462, 462, 259, 8870, 417, 600, 420, 29922, 8782, 29892, 26952, 29922, 5574, 8443, 13, 1678, 736, 1835, 29892, 1480, 29892, 298, 974, 30004, 13, 30004, 13, 7323, 29892, 1480, 29892, 298, 974, 353, 14675, 26471, 13, 30004, 13, 29937, 13905, 5235, 363, 1900, 1650, 1476, 29901, 30004, 13, 13318, 353, 298, 974, 29889, 7076, 29961, 29900, 29962, 30004, 13, 2158, 703, 489, 6407, 1894, 23352, 353, 9162, 1900, 8443, 13, 2158, 703, 489, 6407, 383, 277, 2264, 353, 9162, 1900, 29889, 9202, 2264, 29889, 5975, 29961, 29900, 2314, 30004, 13, 30004, 13, 29937, 6597, 13964, 29901, 30004, 13, 29937, 1596, 29898, 1188, 29889, 305, 481, 2153, 1839, 9202, 13359, 2622, 877, 1195, 8785, 30004, 13, 29937, 1596, 29898, 1188, 29889, 305, 481, 2153, 1839, 9202, 2264, 2033, 8443, 13, 1195, 29943, 277, 2264, 9065, 353, 1480, 29889, 305, 481, 2153, 1839, 9202, 2264, 13359, 2622, 703, 1195, 1159, 30004, 13, 1195, 3505, 9065, 353, 1480, 29889, 305, 481, 2153, 1839, 2311, 13359, 2622, 703, 1195, 1159, 30004, 13, 2158, 703, 16173, 383, 1806, 8186, 1799, 29901, 9162, 1375, 29943, 277, 2264, 9065, 8443, 13, 30004, 13, 29937, 396, 6492, 13964, 29901, 30004, 13, 29937, 269, 1983, 29889, 842, 29918, 3293, 703, 1332, 277, 387, 2429, 1159, 30004, 13, 29937, 14770, 29889, 5317, 29898, 1195, 29943, 277, 2264, 9065, 29892, 2927, 2433, 1127, 1495, 30004, 13, 29937, 14770, 29889, 5317, 29898, 1195, 3505, 9065, 29892, 2927, 2433, 12692, 1495, 30004, 13, 29937, 2654, 29918, 5041, 353, 286, 5041, 267, 29889, 29925, 905, 29898, 2780, 2433, 1127, 742, 3858, 2433, 25353, 383, 277, 2264, 1495, 30004, 13, 29937, 7933, 29918, 5041, 353, 286, 5041, 267, 29889, 29925, 905, 29898, 2780, 2433, 12692, 742, 3858, 2433, 3505, 1495, 30004, 13, 29937, 14770, 29889, 26172, 29898, 3179, 793, 11759, 1127, 29918, 5041, 29892, 7933, 29918, 5041, 2314, 30004, 13, 29937, 14770, 29889, 29916, 1643, 877, 5631, 362, 1495, 30004, 13, 29937, 14770, 29889, 29891, 1643, 877, 25353, 383, 277, 2264, 669, 21179, 1495, 30004, 13, 29937, 14770, 29889, 3257, 877, 25353, 6216, 2264, 975, 1176, 800, 1495, 30004, 13, 29937, 14770, 29889, 4294, 26471, 13, 30004, 13, 29937, 6492, 13964, 29901, 30004, 13, 29879, 1983, 29889, 842, 29918, 3293, 703, 1332, 277, 387, 2429, 1159, 30004, 13, 572, 29873, 29889, 5317, 29898, 1195, 29943, 277, 2264, 9065, 29892, 2927, 2433, 1127, 1495, 30004, 13, 572, 29873, 29889, 29916, 1643, 877, 5631, 362, 1495, 30004, 13, 572, 29873, 29889, 29891, 1643, 877, 25353, 383, 277, 2264, 1495, 30004, 13, 572, 29873, 29889, 3257, 877, 29943, 277, 2264, 310, 1900, 5375, 975, 1176, 800, 1495, 30004, 13, 572, 29873, 29889, 4294, 26471, 13, 30004, 13, 572, 29873, 29889, 5317, 29898, 1195, 3505, 9065, 29892, 2927, 2433, 12692, 1495, 30004, 13, 572, 29873, 29889, 29916, 1643, 877, 5631, 362, 1495, 30004, 13, 572, 29873, 29889, 29891, 1643, 877, 3505, 1495, 30004, 13, 572, 29873, 29889, 3257, 877, 3505, 310, 1900, 5375, 975, 1176, 800, 1495, 30004, 13, 572, 29873, 29889, 4294, 580, 2 ]
makahiki/apps/widgets/ask_admin/tests.py
justinslee/Wai-Not-Makahiki
1
148025
<filename>makahiki/apps/widgets/ask_admin/tests.py<gh_stars>1-10 """ ask admin tests. """ from django.test import TransactionTestCase from django.core.urlresolvers import reverse from apps.utils import test_utils class AskAdminFunctionalTests(TransactionTestCase): """AskAdmin test cases.""" def setUp(self): """setup""" self.user = test_utils.setup_user(username="user", password="<PASSWORD>") self.client.login(username="user", password="<PASSWORD>") def testAjaxPost(self): """ Test that an AJAX post to ask an admin sends an email. """ response = self.client.post(reverse('ask_admin_feedback'), { 'url': 'http://localhost:8000/test/', 'question': 'question', }, HTTP_X_REQUESTED_WITH='XMLHttpRequest') self.failUnlessEqual(response.status_code, 200) #self.assertEqual(len(mail.outbox), 1) #self.assertTrue(mail.outbox[0].subject.find(self.user.get_profile().name) > 0)
[ 1, 529, 9507, 29958, 29885, 557, 801, 10058, 29914, 13371, 29914, 8030, 29879, 29914, 1278, 29918, 6406, 29914, 21150, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 15945, 29908, 13, 1278, 4113, 6987, 29889, 13, 15945, 29908, 13, 3166, 9557, 29889, 1688, 1053, 4103, 2467, 3057, 8259, 13, 3166, 9557, 29889, 3221, 29889, 2271, 9778, 874, 1053, 11837, 13, 13, 3166, 11446, 29889, 13239, 1053, 1243, 29918, 13239, 13, 13, 13, 1990, 26579, 12754, 6678, 284, 24376, 29898, 12460, 3057, 8259, 1125, 13, 1678, 9995, 29909, 808, 12754, 1243, 4251, 1213, 15945, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 9995, 14669, 15945, 29908, 13, 4706, 1583, 29889, 1792, 353, 1243, 29918, 13239, 29889, 14669, 29918, 1792, 29898, 6786, 543, 1792, 613, 13, 462, 462, 3986, 4800, 543, 29966, 25711, 17013, 29958, 1159, 13, 4706, 1583, 29889, 4645, 29889, 7507, 29898, 6786, 543, 1792, 613, 4800, 543, 29966, 25711, 17013, 29958, 1159, 13, 13, 1678, 822, 1243, 29909, 6487, 6747, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 4321, 393, 385, 18891, 1400, 304, 2244, 385, 4113, 16003, 385, 4876, 29889, 13, 4706, 9995, 13, 13, 4706, 2933, 353, 1583, 29889, 4645, 29889, 2490, 29898, 24244, 877, 1278, 29918, 6406, 29918, 18798, 1627, 5477, 426, 13, 9651, 525, 2271, 2396, 525, 1124, 597, 7640, 29901, 29947, 29900, 29900, 29900, 29914, 1688, 29914, 742, 13, 9651, 525, 12470, 2396, 525, 12470, 742, 13, 9651, 2981, 7331, 29918, 29990, 29918, 16244, 3352, 29918, 29956, 13054, 2433, 9165, 26021, 1495, 13, 13, 4706, 1583, 29889, 14057, 2525, 2222, 9843, 29898, 5327, 29889, 4882, 29918, 401, 29892, 29871, 29906, 29900, 29900, 29897, 13, 4706, 396, 1311, 29889, 9294, 9843, 29898, 2435, 29898, 2549, 29889, 449, 1884, 511, 29871, 29896, 29897, 13, 4706, 396, 1311, 29889, 9294, 5574, 29898, 2549, 29889, 449, 1884, 29961, 29900, 1822, 16009, 29889, 2886, 29898, 1311, 29889, 1792, 29889, 657, 29918, 10185, 2141, 978, 29897, 1405, 29871, 29900, 29897, 13, 2 ]
wafhelpers/rtems_trace.py
fakecoinbase/ntpsecslashntpsec
201
143010
<reponame>fakecoinbase/ntpsecslashntpsec from waflib.TaskGen import feature, after_method @feature("rtems_trace") @after_method('apply_link') def rtems_trace(self): if self.env.RTEMS_TEST_ENABLE: self.link_task.env.LINK_CC = self.env.BIN_RTEMS_TLD \ + self.env.RTEMS_TEST_FLAGS + ['--']
[ 1, 529, 276, 1112, 420, 29958, 29888, 1296, 1111, 262, 3188, 29914, 593, 27358, 2395, 29880, 1161, 593, 29886, 3471, 13, 3166, 281, 2142, 1982, 29889, 5398, 15462, 1053, 4682, 29892, 1156, 29918, 5696, 13, 13, 13, 29992, 14394, 703, 29878, 1356, 29879, 29918, 15003, 1159, 13, 29992, 7045, 29918, 5696, 877, 7302, 29918, 2324, 1495, 13, 1753, 364, 1356, 29879, 29918, 15003, 29898, 1311, 1125, 13, 1678, 565, 1583, 29889, 6272, 29889, 29934, 4330, 4345, 29918, 18267, 29918, 1430, 6181, 29901, 13, 4706, 1583, 29889, 2324, 29918, 7662, 29889, 6272, 29889, 23714, 29968, 29918, 4174, 353, 1583, 29889, 6272, 29889, 29933, 1177, 29918, 29934, 4330, 4345, 29918, 29911, 10249, 320, 13, 9651, 718, 1583, 29889, 6272, 29889, 29934, 4330, 4345, 29918, 18267, 29918, 18823, 10749, 718, 6024, 489, 2033, 13, 2 ]
{{cookiecutter.project_slug}}/core/exceptions/__init__.py
teamhide/cookiecutter-sanic
2
126113
from sanic.exceptions import SanicException, add_status_code class CustomException(SanicException): def __init__(self, message: str, code: int): super().__init__(message=message, status_code=code) @add_status_code(401) class ValidationErrorException(SanicException): def __init__(self): message = 'Validation error exception' super().__init__(message)
[ 1, 515, 9753, 293, 29889, 11739, 29879, 1053, 3087, 293, 2451, 29892, 788, 29918, 4882, 29918, 401, 13, 13, 13, 1990, 8701, 2451, 29898, 22509, 293, 2451, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2643, 29901, 851, 29892, 775, 29901, 938, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 4906, 29922, 4906, 29892, 4660, 29918, 401, 29922, 401, 29897, 13, 13, 13, 29992, 1202, 29918, 4882, 29918, 401, 29898, 29946, 29900, 29896, 29897, 13, 1990, 15758, 362, 2392, 2451, 29898, 22509, 293, 2451, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2643, 353, 525, 19448, 1059, 3682, 29915, 13, 4706, 2428, 2141, 1649, 2344, 12035, 4906, 29897, 13, 2 ]
tinynumpy/benchmark.py
Kramer84/tinynumpy
168
54556
<reponame>Kramer84/tinynumpy<filename>tinynumpy/benchmark.py # -*- coding: utf-8 -*- # Copyright (c) 2014, <NAME> and <NAME> # tinynumpy is distributed under the terms of the MIT License. """ Benchmarks for tinynumpy Findings: * A list of floats costs about 33 bytes per float * A list if ints costs anout 41 bytes per int * A huge list of ints 0-255, costs about 1 byter per int * Python list takes about 5-6 times as much memory than array for 64bit data types. Up to 40 times as much for uint8, unless Python can reuse values. * __slots__ help reduce the size of custom classes * tinynumpy is about 100 times slower than numpy * using _toflatlist instead of flat taks 50-60% of time (but more memory) """ from __future__ import division import os import sys import time import subprocess import numpy as np import tinynumpy as tnp def _prettymem(n): if n > 2**20: return '%1.2f MiB' % (n / 2**20) elif n > 2**10: return '%1.2f KiB' % (n / 2**10) else: return '%1.0f B' % n def _prettysec(n): if n < 0.0001: return '%1.2f us' % (n * 1000000) elif n < 0.1: return '%1.2f ms' % (n * 1000) else: return '%1.2f s' % n code_template = """ import psutil import os import random import numpy as np import tinynumpy as tnp N = 100 * 1000 M = 1000 * 1000 class A(object): def __init__(self): self.foo = 8 self.bar = 3.3 class B(object): __slots__ = ['foo', 'bar'] def __init__(self): self.foo = 8 self.bar = 3.3 def getmem(): process = psutil.Process(os.getpid()) return process.get_memory_info()[0] M0 = getmem() %s M1 = getmem() print(M1-M0) """ def measure_mem(what, code, divide=1): cmd = [sys.executable, '-c', code_template % code] res = subprocess.check_output(cmd, cwd=os.getcwd()).decode('utf-8') m = int(res) / divide print('Memory for %s:%s%s' % (what, ' '*(22-len(what)), _prettymem(m))) def measure_speed(what, func, *args, **kwargs): N = 1 t0 = time.perf_counter() func(*args, **kwargs) t1 = time.perf_counter() while (t1 - t0) < 0.2: N *= 10 t0 = time.perf_counter() for i in range(N): func(*args, **kwargs) t1 = time.perf_counter() te = t1 - t0 print('Time for %s:%s%s (%i iters)' % (what, ' '*(22-len(what)), _prettysec(te/N), N)) if __name__ == '__main__': N = 100 * 1000 M = 1000 * 1000 print('=== MEMORY ====') measure_mem('floats 0-M', 'L = [i*1.0 for i in range(N)]', N) measure_mem('ints 0-M', 'L = [i for i in range(N)]', N) measure_mem('ints 0-255', 'L = [int(random.uniform(0, 255)) for i in range(N)]', N) measure_mem('regular object', 'L = [A() for i in range(N)]', N) measure_mem('object with slots', 'L = [B() for i in range(N)]', N) measure_mem(' Numpy arr size 1', 'L = [np.ones((1,)) for i in range(N)]', N) measure_mem('Tinynumpy arr size 1', 'L = [tnp.ones((1,)) for i in range(N)]', N) measure_mem(' Numpy arr size M', 'a = np.ones((M,))') measure_mem('Tinynumpy arr size M', 'a = tnp.ones((M,))') print('=== SPEED ====') a1 = np.ones((100, 100)) a2 = tnp.ones((100, 100)) measure_speed(' numpy sum 10k', a1.sum) measure_speed('tinynumpy sum 10k', a2.sum) measure_speed(' numpy max 10k', a1.max) measure_speed('tinynumpy max 10k', a2.max) a1 = np.ones((1000, 1000)) a2 = tnp.ones((1000, 1000)) measure_speed(' numpy sum 1M', a1.sum) measure_speed('tinynumpy sum 1M', a2.sum) measure_speed(' numpy max 1M', a1.max) measure_speed('tinynumpy max 1M', a2.max)
[ 1, 529, 276, 1112, 420, 29958, 29968, 2572, 261, 29947, 29946, 29914, 29873, 262, 948, 398, 2272, 29966, 9507, 29958, 29873, 262, 948, 398, 2272, 29914, 1785, 16580, 29889, 2272, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29946, 29892, 529, 5813, 29958, 322, 529, 5813, 29958, 13, 29937, 27773, 948, 398, 2272, 338, 13235, 1090, 278, 4958, 310, 278, 341, 1806, 19245, 29889, 13, 13, 15945, 29908, 4111, 16580, 29879, 363, 27773, 948, 398, 2272, 13, 13, 12542, 886, 29901, 13, 13, 29930, 319, 1051, 310, 5685, 1446, 21544, 1048, 29871, 29941, 29941, 6262, 639, 5785, 13, 29930, 319, 1051, 565, 938, 29879, 21544, 385, 449, 29871, 29946, 29896, 6262, 639, 938, 13, 29930, 319, 12176, 1051, 310, 938, 29879, 29871, 29900, 29899, 29906, 29945, 29945, 29892, 21544, 1048, 29871, 29896, 491, 357, 639, 938, 13, 29930, 5132, 1051, 4893, 1048, 29871, 29945, 29899, 29953, 3064, 408, 1568, 3370, 1135, 1409, 363, 29871, 29953, 29946, 2966, 29871, 13, 29871, 848, 4072, 29889, 5020, 304, 29871, 29946, 29900, 3064, 408, 1568, 363, 13122, 29947, 29892, 6521, 5132, 508, 24270, 13, 29871, 1819, 29889, 13, 29930, 4770, 2536, 1862, 1649, 1371, 10032, 278, 2159, 310, 2888, 4413, 13, 29930, 27773, 948, 398, 2272, 338, 1048, 29871, 29896, 29900, 29900, 3064, 20312, 1135, 12655, 13, 29930, 773, 903, 517, 20620, 1761, 2012, 310, 12151, 1850, 29879, 29871, 29945, 29900, 29899, 29953, 29900, 29995, 310, 931, 313, 4187, 901, 3370, 29897, 13, 13, 15945, 29908, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 931, 13, 5215, 1014, 5014, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 27773, 948, 398, 2272, 408, 260, 9302, 13, 13, 13, 1753, 903, 1457, 698, 962, 331, 29898, 29876, 1125, 13, 1678, 565, 302, 1405, 29871, 29906, 1068, 29906, 29900, 29901, 13, 4706, 736, 14210, 29896, 29889, 29906, 29888, 5493, 29933, 29915, 1273, 313, 29876, 847, 29871, 29906, 1068, 29906, 29900, 29897, 13, 1678, 25342, 302, 1405, 29871, 29906, 1068, 29896, 29900, 29901, 13, 4706, 736, 14210, 29896, 29889, 29906, 29888, 16540, 29933, 29915, 1273, 313, 29876, 847, 29871, 29906, 1068, 29896, 29900, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 14210, 29896, 29889, 29900, 29888, 350, 29915, 1273, 302, 13, 13, 1753, 903, 1457, 4349, 3471, 29898, 29876, 1125, 13, 1678, 565, 302, 529, 29871, 29900, 29889, 29900, 29900, 29900, 29896, 29901, 13, 4706, 736, 14210, 29896, 29889, 29906, 29888, 502, 29915, 1273, 313, 29876, 334, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29900, 29897, 13, 1678, 25342, 302, 529, 29871, 29900, 29889, 29896, 29901, 13, 4706, 736, 14210, 29896, 29889, 29906, 29888, 10887, 29915, 1273, 313, 29876, 334, 29871, 29896, 29900, 29900, 29900, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 14210, 29896, 29889, 29906, 29888, 269, 29915, 1273, 302, 13, 13, 13, 401, 29918, 6886, 353, 9995, 13, 5215, 6529, 4422, 13, 5215, 2897, 13, 5215, 4036, 13, 5215, 12655, 408, 7442, 13, 5215, 27773, 948, 398, 2272, 408, 260, 9302, 13, 13, 29940, 353, 29871, 29896, 29900, 29900, 334, 29871, 29896, 29900, 29900, 29900, 13, 29924, 353, 29871, 29896, 29900, 29900, 29900, 334, 29871, 29896, 29900, 29900, 29900, 13, 13, 1990, 319, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 5431, 353, 29871, 29947, 13, 4706, 1583, 29889, 1646, 353, 29871, 29941, 29889, 29941, 13, 13, 1990, 350, 29898, 3318, 1125, 13, 1678, 4770, 2536, 1862, 1649, 353, 6024, 5431, 742, 525, 1646, 2033, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 5431, 353, 29871, 29947, 13, 4706, 1583, 29889, 1646, 353, 29871, 29941, 29889, 29941, 13, 13, 1753, 679, 6954, 7295, 13, 1678, 1889, 353, 6529, 4422, 29889, 7032, 29898, 359, 29889, 657, 5935, 3101, 13, 1678, 736, 1889, 29889, 657, 29918, 14834, 29918, 3888, 580, 29961, 29900, 29962, 13, 13, 29924, 29900, 353, 679, 6954, 580, 13, 29995, 29879, 13, 29924, 29896, 353, 679, 6954, 580, 13, 2158, 29898, 29924, 29896, 29899, 29924, 29900, 29897, 13, 15945, 29908, 13, 13, 1753, 5645, 29918, 6954, 29898, 5816, 29892, 775, 29892, 16429, 29922, 29896, 1125, 13, 268, 13, 1678, 9920, 353, 518, 9675, 29889, 4258, 9246, 29892, 17411, 29883, 742, 29871, 775, 29918, 6886, 1273, 775, 29962, 13, 1678, 620, 353, 1014, 5014, 29889, 3198, 29918, 4905, 29898, 9006, 29892, 274, 9970, 29922, 359, 29889, 657, 29883, 9970, 16655, 13808, 877, 9420, 29899, 29947, 1495, 13, 1678, 286, 353, 938, 29898, 690, 29897, 847, 16429, 13, 268, 13, 1678, 1596, 877, 16015, 363, 1273, 29879, 16664, 29879, 29995, 29879, 29915, 1273, 29871, 13, 3986, 313, 5816, 29892, 525, 525, 16395, 29906, 29906, 29899, 2435, 29898, 5816, 8243, 903, 1457, 698, 962, 331, 29898, 29885, 4961, 13, 13, 13, 1753, 5645, 29918, 19322, 29898, 5816, 29892, 3653, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 268, 13, 268, 13, 1678, 405, 353, 29871, 29896, 13, 1678, 260, 29900, 353, 931, 29889, 546, 29888, 29918, 11808, 580, 13, 1678, 3653, 10456, 5085, 29892, 3579, 19290, 29897, 13, 1678, 260, 29896, 353, 931, 29889, 546, 29888, 29918, 11808, 580, 13, 1678, 1550, 313, 29873, 29896, 448, 260, 29900, 29897, 529, 29871, 29900, 29889, 29906, 29901, 13, 4706, 405, 334, 29922, 29871, 29896, 29900, 13, 4706, 260, 29900, 353, 931, 29889, 546, 29888, 29918, 11808, 580, 13, 4706, 363, 474, 297, 3464, 29898, 29940, 1125, 13, 9651, 3653, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 260, 29896, 353, 931, 29889, 546, 29888, 29918, 11808, 580, 13, 268, 13, 1678, 734, 353, 260, 29896, 448, 260, 29900, 13, 1678, 1596, 877, 2481, 363, 1273, 29879, 16664, 29879, 29995, 29879, 29871, 313, 29995, 29875, 372, 414, 16029, 1273, 29871, 13, 3986, 313, 5816, 29892, 525, 525, 16395, 29906, 29906, 29899, 2435, 29898, 5816, 8243, 903, 1457, 4349, 3471, 29898, 371, 29914, 29940, 511, 405, 876, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 405, 353, 29871, 29896, 29900, 29900, 334, 29871, 29896, 29900, 29900, 29900, 13, 1678, 341, 353, 29871, 29896, 29900, 29900, 29900, 334, 29871, 29896, 29900, 29900, 29900, 13, 268, 13, 1678, 1596, 877, 25512, 341, 12665, 18929, 1275, 1360, 1495, 13, 1678, 5645, 29918, 6954, 877, 29888, 417, 1446, 29871, 29900, 29899, 29924, 742, 525, 29931, 353, 518, 29875, 29930, 29896, 29889, 29900, 363, 474, 297, 3464, 29898, 29940, 4638, 742, 405, 29897, 13, 1678, 5645, 29918, 6954, 877, 9466, 29871, 29900, 29899, 29924, 742, 525, 29931, 353, 518, 29875, 363, 474, 297, 3464, 29898, 29940, 4638, 742, 405, 29897, 13, 1678, 5645, 29918, 6954, 877, 9466, 29871, 29900, 29899, 29906, 29945, 29945, 742, 525, 29931, 353, 518, 524, 29898, 8172, 29889, 29590, 29898, 29900, 29892, 29871, 29906, 29945, 29945, 876, 363, 474, 297, 3464, 29898, 29940, 4638, 742, 405, 29897, 13, 268, 13, 1678, 5645, 29918, 6954, 877, 15227, 1203, 742, 525, 29931, 353, 518, 29909, 580, 363, 474, 297, 3464, 29898, 29940, 4638, 742, 405, 29897, 13, 1678, 5645, 29918, 6954, 877, 3318, 411, 2243, 1862, 742, 525, 29931, 353, 518, 29933, 580, 363, 474, 297, 3464, 29898, 29940, 4638, 742, 405, 29897, 13, 268, 13, 1678, 5645, 29918, 6954, 877, 1678, 11848, 2272, 3948, 2159, 29871, 29896, 742, 525, 29931, 353, 518, 9302, 29889, 2873, 3552, 29896, 29892, 876, 363, 474, 297, 3464, 29898, 29940, 4638, 742, 405, 29897, 13, 1678, 5645, 29918, 6954, 877, 29911, 262, 948, 398, 2272, 3948, 2159, 29871, 29896, 742, 525, 29931, 353, 518, 6277, 29886, 29889, 2873, 3552, 29896, 29892, 876, 363, 474, 297, 3464, 29898, 29940, 4638, 742, 405, 29897, 13, 268, 13, 1678, 5645, 29918, 6954, 877, 1678, 11848, 2272, 3948, 2159, 341, 742, 525, 29874, 353, 7442, 29889, 2873, 3552, 29924, 29892, 876, 1495, 13, 1678, 5645, 29918, 6954, 877, 29911, 262, 948, 398, 2272, 3948, 2159, 341, 742, 525, 29874, 353, 260, 9302, 29889, 2873, 3552, 29924, 29892, 876, 1495, 13, 268, 13, 1678, 1596, 877, 25512, 317, 4162, 3352, 1275, 1360, 1495, 13, 268, 13, 1678, 263, 29896, 353, 7442, 29889, 2873, 3552, 29896, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 876, 13, 1678, 263, 29906, 353, 260, 9302, 29889, 2873, 3552, 29896, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 876, 13, 1678, 5645, 29918, 19322, 877, 1678, 12655, 2533, 29871, 29896, 29900, 29895, 742, 263, 29896, 29889, 2083, 29897, 13, 1678, 5645, 29918, 19322, 877, 29873, 262, 948, 398, 2272, 2533, 29871, 29896, 29900, 29895, 742, 263, 29906, 29889, 2083, 29897, 13, 1678, 5645, 29918, 19322, 877, 1678, 12655, 4236, 29871, 29896, 29900, 29895, 742, 263, 29896, 29889, 3317, 29897, 13, 1678, 5645, 29918, 19322, 877, 29873, 262, 948, 398, 2272, 4236, 29871, 29896, 29900, 29895, 742, 263, 29906, 29889, 3317, 29897, 13, 268, 13, 1678, 263, 29896, 353, 7442, 29889, 2873, 3552, 29896, 29900, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 876, 13, 1678, 263, 29906, 353, 260, 9302, 29889, 2873, 3552, 29896, 29900, 29900, 29900, 29892, 29871, 29896, 29900, 29900, 29900, 876, 13, 1678, 5645, 29918, 19322, 877, 1678, 12655, 2533, 29871, 29896, 29924, 742, 263, 29896, 29889, 2083, 29897, 13, 1678, 5645, 29918, 19322, 877, 29873, 262, 948, 398, 2272, 2533, 29871, 29896, 29924, 742, 263, 29906, 29889, 2083, 29897, 13, 1678, 5645, 29918, 19322, 877, 1678, 12655, 4236, 29871, 29896, 29924, 742, 263, 29896, 29889, 3317, 29897, 13, 1678, 5645, 29918, 19322, 877, 29873, 262, 948, 398, 2272, 4236, 29871, 29896, 29924, 742, 263, 29906, 29889, 3317, 29897, 13, 2 ]
ragpicker/reporting/mysql.py
K4lium/Snakepit
7
62951
<gh_stars>1-10 # Copyright (C) 2013-2015 Ragpicker Developers. # This file is part of Ragpicker Malware Crawler - http://code.google.com/p/malware-crawler/ from yapsy.IPlugin import IPlugin from core.abstracts import Report class MySQL(IPlugin, Report): """Stores data from long-run analysis in MySQL.""" def run(self, results, objfile): # Import muss hier stehen, sonst kommt es bei Konfiguration ohne Mysql zum Fehler from core.databaseMysql import DatabaseMySQL """Writes report. @param results: analysis results dictionary. @param objfile: file object """ database = DatabaseMySQL() print "mysql.py Methode Run" """ # Count query using URL hash and file hash count = database.countRagpickerDB(results["Info"]["file"]["md5"], results["Info"]["url"]["md5"]) # If report available for the file and url -> not insert if count == 0: # Create a copy of the dictionary. This is done in order to not modify # the original dictionary and possibly compromise the following # reporting modules. report = dict(results) # Store the report database.insertRagpickerDB(report) """ def deleteAll(self): """Deletes all reports. """ print "mysql.py Methode DeleteAll" """ # Alle Ragpicker-Daten aus der MongoDB loeschen count = Database().deleteRagpickerDB() print "*** MongoDB (Ragpicker)***" print "deleted documents:" + str(count) print "" """
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29941, 29899, 29906, 29900, 29896, 29945, 390, 351, 13908, 10682, 414, 29889, 13, 29937, 910, 934, 338, 760, 310, 390, 351, 13908, 3792, 2519, 315, 1610, 1358, 448, 1732, 597, 401, 29889, 3608, 29889, 510, 29914, 29886, 29914, 5156, 2519, 29899, 29883, 1610, 1358, 29914, 13, 13, 3166, 343, 2547, 29891, 29889, 29902, 16288, 1053, 306, 16288, 13, 13, 3166, 7136, 29889, 16595, 29879, 1053, 13969, 13, 13, 1990, 9254, 29898, 29902, 16288, 29892, 13969, 1125, 13, 1678, 9995, 855, 2361, 848, 515, 1472, 29899, 3389, 7418, 297, 9254, 1213, 15945, 13, 13, 1678, 822, 1065, 29898, 1311, 29892, 2582, 29892, 5446, 1445, 1125, 13, 4706, 396, 16032, 23885, 6128, 27565, 29892, 1487, 303, 21848, 831, 2862, 5250, 1003, 2633, 14233, 28924, 1519, 3356, 5169, 29882, 1358, 13, 4706, 515, 7136, 29889, 9803, 29924, 952, 1519, 1053, 5470, 3421, 4176, 13, 4706, 9995, 29956, 768, 267, 3461, 29889, 13, 4706, 732, 3207, 2582, 29901, 7418, 2582, 8600, 29889, 13, 4706, 732, 3207, 5446, 1445, 29901, 934, 1203, 13, 4706, 9995, 13, 4706, 2566, 353, 5470, 3421, 4176, 580, 13, 308, 13, 4706, 1596, 376, 7938, 29889, 2272, 341, 621, 356, 7525, 29908, 13, 4706, 9995, 13, 4706, 396, 3917, 2346, 773, 3988, 6608, 322, 934, 6608, 13, 4706, 2302, 353, 2566, 29889, 2798, 29934, 351, 13908, 4051, 29898, 9902, 3366, 3401, 3108, 3366, 1445, 3108, 3366, 3487, 29945, 12436, 2582, 3366, 3401, 3108, 3366, 2271, 3108, 3366, 3487, 29945, 20068, 13, 308, 13, 4706, 396, 960, 3461, 3625, 363, 278, 934, 322, 3142, 1599, 451, 4635, 13, 4706, 565, 2302, 1275, 29871, 29900, 29901, 13, 9651, 396, 6204, 263, 3509, 310, 278, 8600, 29889, 910, 338, 2309, 297, 1797, 304, 451, 6623, 13, 9651, 396, 278, 2441, 8600, 322, 10075, 19632, 895, 278, 1494, 13, 9651, 396, 23415, 10585, 29889, 13, 9651, 3461, 353, 9657, 29898, 9902, 29897, 13, 9651, 396, 14491, 278, 3461, 13, 9651, 2566, 29889, 7851, 29934, 351, 13908, 4051, 29898, 12276, 29897, 13, 4706, 9995, 13, 1678, 822, 5217, 3596, 29898, 1311, 1125, 259, 13, 4706, 9995, 2772, 1026, 267, 599, 13676, 29889, 13, 4706, 9995, 29871, 13, 4706, 1596, 376, 7938, 29889, 2272, 341, 621, 356, 21267, 3596, 29908, 13, 4706, 9995, 29871, 13, 4706, 396, 20615, 390, 351, 13908, 29899, 29928, 2579, 1770, 589, 29004, 658, 1968, 264, 13, 4706, 2302, 353, 5470, 2141, 8143, 29934, 351, 13908, 4051, 580, 13, 308, 13, 4706, 1596, 376, 17435, 29004, 313, 29934, 351, 13908, 29897, 17435, 29908, 13, 4706, 1596, 376, 311, 22742, 10701, 6160, 718, 851, 29898, 2798, 29897, 13, 4706, 1596, 5124, 13, 4706, 9995, 2 ]
tools/training.py
aglgit/python-md
0
158658
<reponame>aglgit/python-md import os import numpy as np import pandas as pd from amp import Amp from amp.utilities import TrainingConvergenceError from amp.analysis import calculate_rmses from amp.descriptor.cutoffs import Cosine, Polynomial from amp.descriptor.gaussian import Gaussian, make_symmetry_functions from amp.model.neuralnetwork import NeuralNetwork from amp.model import LossFunction class Trainer: def __init__( self, convergence=None, energy_coefficient=1.0, force_coefficient=None, overfit=1e-8, hidden_layers=(10, 10), activation="tanh", cutoff=Cosine(6.0), Gs=None, calc_dir="calcs", ): if convergence is None: self.convergence = { "energy_rmse": 1e-3, "force_rmse": None, "max_steps": int(1e3), } else: self.convergence = convergence self.energy_coefficient = energy_coefficient self.force_coefficient = force_coefficient self.overfit = overfit self.hidden_layers = hidden_layers self.activation = activation self.cutoff = cutoff self.Gs = Gs if not os.path.exists(calc_dir): os.mkdir(calc_dir) self.calc_dir = calc_dir def create_Gs( self, elements, num_radial_etas, num_angular_etas, num_zetas, angular_type ): uncentered_etas = np.linspace(1.0, 20.0, num_radial_etas) centers = np.zeros(num_radial_etas) G2_uncentered = make_symmetry_functions( elements=elements, type="G2", etas=uncentered_etas, centers=centers ) centered_etas = 5.0 * np.ones(num_radial_etas) centers = np.linspace(0.5, self.cutoff.Rc - 0.5, num_radial_etas) G2_centered = make_symmetry_functions( elements=elements, type="G2", etas=centered_etas, centers=centers ) angular_etas = np.linspace(0.01, 3.0, num_angular_etas) zetas = [2 ** i for i in range(num_zetas)] G_ang = make_symmetry_functions( elements=elements, type=angular_type, etas=angular_etas, zetas=zetas, gammas=[1.0, -1.0], ) self.Gs = G2_uncentered + G2_centered + G_ang def create_calc(self, label, dblabel): amp_label = os.path.join(self.calc_dir, label) amp_dblabel = os.path.join(self.calc_dir, dblabel) amp_name = amp_label + ".amp" if not os.path.exists(amp_name): print("Creating calculator {}...".format(amp_name)) loss_function = LossFunction( convergence=self.convergence, energy_coefficient=self.energy_coefficient, force_coefficient=self.force_coefficient, overfit=self.overfit, ) model = NeuralNetwork( hiddenlayers=self.hidden_layers, activation=self.activation, lossfunction=loss_function, weights=None, scalings=None, prescale=True, ) descriptor = Gaussian(cutoff=self.cutoff, Gs=self.Gs, fortran=True) calc = Amp( descriptor=descriptor, model=model, label=amp_label, dblabel=amp_dblabel ) return calc else: print("Calculator {} already exists!".format(amp_name)) calc = Amp.load(amp_name, label=amp_label, dblabel=amp_dblabel) return calc def train_calc(self, calc, traj_file): label = calc.label amp_name = label + ".amp" if not os.path.exists(amp_name): print( "Training calculator {} from trajectory {}...".format( amp_name, traj_file ) ) try: calc.train(traj_file) except TrainingConvergenceError: calc.save(amp_name, overwrite=True) return amp_name else: print("Trained calculator {} already exists!".format(amp_name)) return amp_name def test_calculators( self, calcs, traj_file, columns, logfile="log.txt", dblabel=None ): if not os.path.exists(logfile): df = pd.DataFrame(columns=columns) for i, (label, amp_name) in enumerate(calcs.items()): print( "Testing calculator {} on trajectory {}...".format( amp_name, traj_file ) ) amp_label = os.path.join(self.calc_dir, label) if dblabel is None: amp_dblabel = amp_label + "-test" else: amp_dblabel = os.path.join(self.calc_dir, dblabel) energy_rmse, force_rmse = calculate_rmses( amp_name, traj_file, label=amp_label, dblabel=amp_dblabel ) row = [label, energy_rmse, force_rmse] df.loc[i] = row df.to_csv(logfile, index=False) else: print("Logfile {} already exists!".format(logfile)) df = pd.read_csv( logfile, dtype={"Energy RMSE": np.float64, "Force RMSE": np.float} ) print(df.to_latex(float_format="{:.2E}".format, index=False))
[ 1, 529, 276, 1112, 420, 29958, 351, 29880, 5559, 29914, 4691, 29899, 3487, 13, 5215, 2897, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 3166, 21332, 1053, 319, 1526, 13, 3166, 21332, 29889, 4422, 1907, 1053, 26101, 1168, 369, 10238, 2392, 13, 3166, 21332, 29889, 15916, 1053, 8147, 29918, 29878, 1516, 267, 13, 3166, 21332, 29889, 2783, 11709, 29889, 7582, 22450, 1053, 13526, 457, 29892, 2043, 9222, 13, 3166, 21332, 29889, 2783, 11709, 29889, 29887, 17019, 1053, 22477, 29892, 1207, 29918, 11967, 2527, 719, 29918, 12171, 13, 3166, 21332, 29889, 4299, 29889, 484, 3631, 11618, 1053, 2448, 3631, 13724, 13, 3166, 21332, 29889, 4299, 1053, 365, 2209, 6678, 13, 13, 13, 1990, 3201, 4983, 29901, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 17221, 29922, 8516, 29892, 13, 4706, 5864, 29918, 1111, 8462, 29922, 29896, 29889, 29900, 29892, 13, 4706, 4889, 29918, 1111, 8462, 29922, 8516, 29892, 13, 4706, 975, 9202, 29922, 29896, 29872, 29899, 29947, 29892, 13, 4706, 7934, 29918, 29277, 7607, 29896, 29900, 29892, 29871, 29896, 29900, 511, 13, 4706, 26229, 543, 13161, 29882, 613, 13, 4706, 5700, 2696, 29922, 29907, 359, 457, 29898, 29953, 29889, 29900, 511, 13, 4706, 402, 29879, 29922, 8516, 29892, 13, 4706, 22235, 29918, 3972, 543, 1052, 2395, 613, 13, 268, 1125, 13, 4706, 565, 17221, 338, 6213, 29901, 13, 9651, 1583, 29889, 535, 369, 10238, 353, 426, 13, 18884, 376, 27548, 29918, 1758, 344, 1115, 29871, 29896, 29872, 29899, 29941, 29892, 13, 18884, 376, 10118, 29918, 1758, 344, 1115, 6213, 29892, 13, 18884, 376, 3317, 29918, 24530, 1115, 938, 29898, 29896, 29872, 29941, 511, 13, 9651, 500, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 535, 369, 10238, 353, 17221, 13, 13, 4706, 1583, 29889, 27548, 29918, 1111, 8462, 353, 5864, 29918, 1111, 8462, 13, 4706, 1583, 29889, 10118, 29918, 1111, 8462, 353, 4889, 29918, 1111, 8462, 13, 4706, 1583, 29889, 957, 9202, 353, 975, 9202, 13, 4706, 1583, 29889, 10892, 29918, 29277, 353, 7934, 29918, 29277, 13, 4706, 1583, 29889, 11236, 362, 353, 26229, 13, 4706, 1583, 29889, 7582, 2696, 353, 5700, 2696, 13, 4706, 1583, 29889, 29954, 29879, 353, 402, 29879, 13, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 28667, 29918, 3972, 1125, 13, 9651, 2897, 29889, 11256, 3972, 29898, 28667, 29918, 3972, 29897, 13, 4706, 1583, 29889, 28667, 29918, 3972, 353, 22235, 29918, 3972, 13, 13, 1678, 822, 1653, 29918, 29954, 29879, 29898, 13, 4706, 1583, 29892, 3161, 29892, 954, 29918, 3665, 616, 29918, 300, 294, 29892, 954, 29918, 6825, 29918, 300, 294, 29892, 954, 29918, 4975, 294, 29892, 6401, 29918, 1853, 13, 268, 1125, 13, 4706, 443, 5064, 287, 29918, 300, 294, 353, 7442, 29889, 1915, 3493, 29898, 29896, 29889, 29900, 29892, 29871, 29906, 29900, 29889, 29900, 29892, 954, 29918, 3665, 616, 29918, 300, 294, 29897, 13, 4706, 1644, 414, 353, 7442, 29889, 3298, 359, 29898, 1949, 29918, 3665, 616, 29918, 300, 294, 29897, 13, 4706, 402, 29906, 29918, 348, 5064, 287, 353, 1207, 29918, 11967, 2527, 719, 29918, 12171, 29898, 13, 9651, 3161, 29922, 17664, 29892, 1134, 543, 29954, 29906, 613, 634, 294, 29922, 348, 5064, 287, 29918, 300, 294, 29892, 1644, 414, 29922, 1760, 414, 13, 4706, 1723, 13, 13, 4706, 24764, 29918, 300, 294, 353, 29871, 29945, 29889, 29900, 334, 7442, 29889, 2873, 29898, 1949, 29918, 3665, 616, 29918, 300, 294, 29897, 13, 4706, 1644, 414, 353, 7442, 29889, 1915, 3493, 29898, 29900, 29889, 29945, 29892, 1583, 29889, 7582, 2696, 29889, 29934, 29883, 448, 29871, 29900, 29889, 29945, 29892, 954, 29918, 3665, 616, 29918, 300, 294, 29897, 13, 4706, 402, 29906, 29918, 5064, 287, 353, 1207, 29918, 11967, 2527, 719, 29918, 12171, 29898, 13, 9651, 3161, 29922, 17664, 29892, 1134, 543, 29954, 29906, 613, 634, 294, 29922, 5064, 287, 29918, 300, 294, 29892, 1644, 414, 29922, 1760, 414, 13, 4706, 1723, 13, 13, 4706, 6401, 29918, 300, 294, 353, 7442, 29889, 1915, 3493, 29898, 29900, 29889, 29900, 29896, 29892, 29871, 29941, 29889, 29900, 29892, 954, 29918, 6825, 29918, 300, 294, 29897, 13, 4706, 503, 300, 294, 353, 518, 29906, 3579, 474, 363, 474, 297, 3464, 29898, 1949, 29918, 4975, 294, 4638, 13, 4706, 402, 29918, 574, 353, 1207, 29918, 11967, 2527, 719, 29918, 12171, 29898, 13, 9651, 3161, 29922, 17664, 29892, 13, 9651, 1134, 29922, 6825, 29918, 1853, 29892, 13, 9651, 634, 294, 29922, 6825, 29918, 300, 294, 29892, 13, 9651, 503, 300, 294, 29922, 4975, 294, 29892, 13, 9651, 330, 4850, 294, 11759, 29896, 29889, 29900, 29892, 448, 29896, 29889, 29900, 1402, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 29954, 29879, 353, 402, 29906, 29918, 348, 5064, 287, 718, 402, 29906, 29918, 5064, 287, 718, 402, 29918, 574, 13, 13, 1678, 822, 1653, 29918, 28667, 29898, 1311, 29892, 3858, 29892, 4833, 1643, 1125, 13, 4706, 21332, 29918, 1643, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 28667, 29918, 3972, 29892, 3858, 29897, 13, 4706, 21332, 29918, 2585, 1643, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 28667, 29918, 3972, 29892, 4833, 1643, 29897, 13, 4706, 21332, 29918, 978, 353, 21332, 29918, 1643, 718, 11393, 1160, 29908, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 1160, 29918, 978, 1125, 13, 9651, 1596, 703, 9832, 1218, 3408, 1061, 6571, 856, 1642, 4830, 29898, 1160, 29918, 978, 876, 13, 9651, 6410, 29918, 2220, 353, 365, 2209, 6678, 29898, 13, 18884, 17221, 29922, 1311, 29889, 535, 369, 10238, 29892, 13, 18884, 5864, 29918, 1111, 8462, 29922, 1311, 29889, 27548, 29918, 1111, 8462, 29892, 13, 18884, 4889, 29918, 1111, 8462, 29922, 1311, 29889, 10118, 29918, 1111, 8462, 29892, 13, 18884, 975, 9202, 29922, 1311, 29889, 957, 9202, 29892, 13, 9651, 1723, 13, 9651, 1904, 353, 2448, 3631, 13724, 29898, 13, 18884, 7934, 29277, 29922, 1311, 29889, 10892, 29918, 29277, 29892, 13, 18884, 26229, 29922, 1311, 29889, 11236, 362, 29892, 13, 18884, 6410, 2220, 29922, 6758, 29918, 2220, 29892, 13, 18884, 18177, 29922, 8516, 29892, 13, 18884, 8716, 886, 29922, 8516, 29892, 13, 18884, 2225, 29883, 744, 29922, 5574, 29892, 13, 9651, 1723, 13, 9651, 553, 11709, 353, 22477, 29898, 7582, 2696, 29922, 1311, 29889, 7582, 2696, 29892, 402, 29879, 29922, 1311, 29889, 29954, 29879, 29892, 363, 509, 273, 29922, 5574, 29897, 13, 9651, 22235, 353, 319, 1526, 29898, 13, 18884, 553, 11709, 29922, 2783, 11709, 29892, 1904, 29922, 4299, 29892, 3858, 29922, 1160, 29918, 1643, 29892, 4833, 1643, 29922, 1160, 29918, 2585, 1643, 13, 9651, 1723, 13, 13, 9651, 736, 22235, 13, 4706, 1683, 29901, 13, 9651, 1596, 703, 27065, 1061, 6571, 2307, 4864, 29991, 1642, 4830, 29898, 1160, 29918, 978, 876, 13, 9651, 22235, 353, 319, 1526, 29889, 1359, 29898, 1160, 29918, 978, 29892, 3858, 29922, 1160, 29918, 1643, 29892, 4833, 1643, 29922, 1160, 29918, 2585, 1643, 29897, 13, 13, 9651, 736, 22235, 13, 13, 1678, 822, 7945, 29918, 28667, 29898, 1311, 29892, 22235, 29892, 1020, 29926, 29918, 1445, 1125, 13, 4706, 3858, 353, 22235, 29889, 1643, 13, 4706, 21332, 29918, 978, 353, 3858, 718, 11393, 1160, 29908, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 1160, 29918, 978, 1125, 13, 9651, 1596, 29898, 13, 18884, 376, 5323, 2827, 3408, 1061, 6571, 515, 23324, 706, 6571, 856, 1642, 4830, 29898, 13, 462, 1678, 21332, 29918, 978, 29892, 1020, 29926, 29918, 1445, 13, 18884, 1723, 13, 9651, 1723, 13, 9651, 1018, 29901, 13, 18884, 22235, 29889, 14968, 29898, 3018, 29926, 29918, 1445, 29897, 13, 9651, 5174, 26101, 1168, 369, 10238, 2392, 29901, 13, 18884, 22235, 29889, 7620, 29898, 1160, 29918, 978, 29892, 26556, 29922, 5574, 29897, 13, 13, 9651, 736, 21332, 29918, 978, 13, 4706, 1683, 29901, 13, 9651, 1596, 703, 5323, 1312, 3408, 1061, 6571, 2307, 4864, 29991, 1642, 4830, 29898, 1160, 29918, 978, 876, 13, 13, 9651, 736, 21332, 29918, 978, 13, 13, 1678, 822, 1243, 29918, 15807, 4097, 29898, 13, 4706, 1583, 29892, 1208, 2395, 29892, 1020, 29926, 29918, 1445, 29892, 4341, 29892, 1480, 1445, 543, 1188, 29889, 3945, 613, 4833, 1643, 29922, 8516, 13, 268, 1125, 13, 4706, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 1188, 1445, 1125, 13, 9651, 4489, 353, 10518, 29889, 17271, 29898, 13099, 29922, 13099, 29897, 13, 9651, 363, 474, 29892, 313, 1643, 29892, 21332, 29918, 978, 29897, 297, 26985, 29898, 1052, 2395, 29889, 7076, 580, 1125, 13, 18884, 1596, 29898, 13, 462, 1678, 376, 3057, 292, 3408, 1061, 6571, 373, 23324, 706, 6571, 856, 1642, 4830, 29898, 13, 462, 4706, 21332, 29918, 978, 29892, 1020, 29926, 29918, 1445, 13, 462, 1678, 1723, 13, 18884, 1723, 13, 18884, 21332, 29918, 1643, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 28667, 29918, 3972, 29892, 3858, 29897, 13, 18884, 565, 4833, 1643, 338, 6213, 29901, 13, 462, 1678, 21332, 29918, 2585, 1643, 353, 21332, 29918, 1643, 718, 11663, 1688, 29908, 13, 18884, 1683, 29901, 13, 462, 1678, 21332, 29918, 2585, 1643, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 28667, 29918, 3972, 29892, 4833, 1643, 29897, 13, 18884, 5864, 29918, 1758, 344, 29892, 4889, 29918, 1758, 344, 353, 8147, 29918, 29878, 1516, 267, 29898, 13, 462, 1678, 21332, 29918, 978, 29892, 1020, 29926, 29918, 1445, 29892, 3858, 29922, 1160, 29918, 1643, 29892, 4833, 1643, 29922, 1160, 29918, 2585, 1643, 13, 18884, 1723, 13, 13, 18884, 1948, 353, 518, 1643, 29892, 5864, 29918, 1758, 344, 29892, 4889, 29918, 1758, 344, 29962, 13, 18884, 4489, 29889, 2029, 29961, 29875, 29962, 353, 1948, 13, 18884, 4489, 29889, 517, 29918, 7638, 29898, 1188, 1445, 29892, 2380, 29922, 8824, 29897, 13, 4706, 1683, 29901, 13, 9651, 1596, 703, 3403, 1445, 6571, 2307, 4864, 29991, 1642, 4830, 29898, 1188, 1445, 876, 13, 13, 4706, 4489, 353, 10518, 29889, 949, 29918, 7638, 29898, 13, 9651, 1480, 1445, 29892, 26688, 3790, 29908, 29923, 1089, 1927, 390, 29924, 1660, 1115, 7442, 29889, 7411, 29953, 29946, 29892, 376, 2831, 346, 390, 29924, 1660, 1115, 7442, 29889, 7411, 29913, 13, 4706, 1723, 13, 4706, 1596, 29898, 2176, 29889, 517, 29918, 25694, 29898, 7411, 29918, 4830, 10724, 29901, 29889, 29906, 29923, 29913, 1642, 4830, 29892, 2380, 29922, 8824, 876, 13, 2 ]
content/test/gpu/gpu_tests/path_util.py
google-ar/chromium
777
196577
# Copyright (c) 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys def GetChromiumSrcDir(): return os.path.abspath(os.path.join( os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir)) def GetGpuTestDir(): return os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) def AddDirToPathIfNeeded(*path_parts): path = os.path.abspath(os.path.join(*path_parts)) if os.path.isdir(path) and path not in sys.path: sys.path.append(path) def SetupTelemetryPaths(): chromium_src_dir = GetChromiumSrcDir() perf_path = os.path.join(chromium_src_dir, 'tools', 'perf') absolute_perf_path = os.path.abspath(perf_path) sys.path.append(absolute_perf_path) from chrome_telemetry_build import chromium_config telemetry_path = chromium_config.GetTelemetryDir() if telemetry_path not in sys.path: sys.path.append(telemetry_path) py_utils_path = os.path.join( chromium_src_dir, 'third_party', 'catapult', 'common', 'py_utils') if py_utils_path not in sys.path: sys.path.append(py_utils_path)
[ 1, 396, 14187, 1266, 313, 29883, 29897, 29871, 29906, 29900, 29896, 29945, 450, 678, 456, 1974, 13189, 943, 29889, 2178, 10462, 21676, 29889, 13, 29937, 4803, 310, 445, 2752, 775, 338, 4095, 287, 491, 263, 350, 7230, 29899, 3293, 19405, 393, 508, 367, 13, 29937, 1476, 297, 278, 365, 2965, 1430, 1660, 934, 29889, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 13, 13, 1753, 3617, 1451, 456, 1974, 29903, 2214, 9170, 7295, 13, 29871, 736, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 13, 418, 2897, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 2897, 29889, 29886, 538, 381, 29892, 2897, 29889, 29886, 538, 381, 29892, 2897, 29889, 29886, 538, 381, 29892, 2897, 29889, 29886, 538, 381, 876, 13, 13, 13, 1753, 3617, 29954, 3746, 3057, 9170, 7295, 13, 29871, 736, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 2897, 29889, 29886, 538, 381, 876, 13, 13, 13, 1753, 3462, 9170, 1762, 2605, 3644, 8139, 19226, 10456, 2084, 29918, 20895, 1125, 13, 29871, 2224, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 10456, 2084, 29918, 20895, 876, 13, 29871, 565, 2897, 29889, 2084, 29889, 275, 3972, 29898, 2084, 29897, 322, 2224, 451, 297, 10876, 29889, 2084, 29901, 13, 1678, 10876, 29889, 2084, 29889, 4397, 29898, 2084, 29897, 13, 13, 13, 1753, 3789, 786, 7141, 2409, 27184, 2605, 29879, 7295, 13, 29871, 25173, 1974, 29918, 4351, 29918, 3972, 353, 3617, 1451, 456, 1974, 29903, 2214, 9170, 580, 13, 13, 29871, 23895, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 27433, 1974, 29918, 4351, 29918, 3972, 29892, 525, 8504, 742, 525, 546, 29888, 1495, 13, 29871, 8380, 29918, 546, 29888, 29918, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 546, 29888, 29918, 2084, 29897, 13, 13, 29871, 10876, 29889, 2084, 29889, 4397, 29898, 23552, 29918, 546, 29888, 29918, 2084, 29897, 13, 29871, 515, 16735, 29918, 371, 2409, 27184, 29918, 4282, 1053, 25173, 1974, 29918, 2917, 13, 13, 29871, 734, 2409, 27184, 29918, 2084, 353, 25173, 1974, 29918, 2917, 29889, 2577, 7141, 2409, 27184, 9170, 580, 13, 29871, 565, 734, 2409, 27184, 29918, 2084, 451, 297, 10876, 29889, 2084, 29901, 13, 1678, 10876, 29889, 2084, 29889, 4397, 29898, 371, 2409, 27184, 29918, 2084, 29897, 13, 13, 29871, 11451, 29918, 13239, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 13, 418, 25173, 1974, 29918, 4351, 29918, 3972, 29892, 525, 22585, 29918, 22633, 742, 525, 4117, 481, 499, 742, 525, 9435, 742, 525, 2272, 29918, 13239, 1495, 13, 29871, 565, 11451, 29918, 13239, 29918, 2084, 451, 297, 10876, 29889, 2084, 29901, 13, 1678, 10876, 29889, 2084, 29889, 4397, 29898, 2272, 29918, 13239, 29918, 2084, 29897, 13, 2 ]
conduit/fair/data/datamodules/tabular/law.py
predictive-analytics-lab/pal-bolts
2
146871
<reponame>predictive-analytics-lab/pal-bolts<filename>conduit/fair/data/datamodules/tabular/law.py """Law Admissions Dataset.""" from enum import Enum import attr import ethicml as em from conduit.fair.data.datamodules.tabular.base import EthicMlDataModule __all__ = ["LawDataModule", "LawSens"] class LawSens(Enum): sex = "Sex" race = "Race" sexRace = "Sex-Race" @attr.define(kw_only=True) class LawDataModule(EthicMlDataModule): """LSAC Law Admissions Dataset.""" sens_feat: LawSens = LawSens.sex disc_feats_only: bool = False @property def em_dataset(self) -> em.Dataset: return em.law( split=self.sens_feat.value, discrete_only=self.disc_feats_only, invert_s=self.invert_s )
[ 1, 529, 276, 1112, 420, 29958, 27711, 573, 29899, 7054, 22026, 29899, 8205, 29914, 7830, 29899, 2095, 1372, 29966, 9507, 29958, 535, 700, 277, 29914, 29888, 1466, 29914, 1272, 29914, 4130, 314, 397, 2540, 29914, 9456, 29914, 10653, 29889, 2272, 13, 15945, 29908, 29931, 1450, 2087, 29885, 6847, 13373, 24541, 1213, 15945, 13, 3166, 14115, 1053, 1174, 398, 13, 13, 5215, 12421, 13, 5215, 11314, 293, 828, 408, 953, 13, 13, 3166, 13417, 277, 29889, 29888, 1466, 29889, 1272, 29889, 4130, 314, 397, 2540, 29889, 9456, 29889, 3188, 1053, 13772, 293, 29924, 29880, 1469, 7355, 13, 13, 1649, 497, 1649, 353, 6796, 29931, 1450, 1469, 7355, 613, 376, 29931, 1450, 29903, 575, 3108, 13, 13, 13, 1990, 7927, 29903, 575, 29898, 16854, 1125, 13, 1678, 7916, 353, 376, 29903, 735, 29908, 13, 1678, 8175, 353, 376, 29934, 815, 29908, 13, 1678, 7916, 29934, 815, 353, 376, 29903, 735, 29899, 29934, 815, 29908, 13, 13, 13, 29992, 5552, 29889, 7922, 29898, 11022, 29918, 6194, 29922, 5574, 29897, 13, 1990, 7927, 1469, 7355, 29898, 29923, 386, 293, 29924, 29880, 1469, 7355, 1125, 13, 1678, 9995, 8547, 2477, 7927, 2087, 29885, 6847, 13373, 24541, 1213, 15945, 13, 13, 1678, 4771, 29918, 1725, 271, 29901, 7927, 29903, 575, 353, 7927, 29903, 575, 29889, 14167, 13, 1678, 2313, 29918, 1725, 1446, 29918, 6194, 29901, 6120, 353, 7700, 13, 13, 1678, 732, 6799, 13, 1678, 822, 953, 29918, 24713, 29898, 1311, 29897, 1599, 953, 29889, 16390, 24541, 29901, 13, 13, 4706, 736, 953, 29889, 10653, 29898, 13, 9651, 6219, 29922, 1311, 29889, 23149, 29918, 1725, 271, 29889, 1767, 29892, 19554, 29918, 6194, 29922, 1311, 29889, 2218, 29883, 29918, 1725, 1446, 29918, 6194, 29892, 21292, 29918, 29879, 29922, 1311, 29889, 262, 1765, 29918, 29879, 13, 4706, 1723, 13, 2 ]
var/spack/repos/builtin/packages/llvm-amdgpu/package.py
milljm/spack
0
89539
<reponame>milljm/spack # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class LlvmAmdgpu(CMakePackage): """Toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.""" homepage = "https://github.com/RadeonOpenCompute/llvm-project" url = "https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-3.5.0.tar.gz" maintainers = ['srekolam', 'arjun-raj-kuppala'] version('3.5.0', sha256='4878fa85473b24d88edcc89938441edc85d2e8a785e567b7bd7ce274ecc2fd9c') variant('build_type', default='Release', values=("Release", "Debug"), description='CMake build type') depends_on('cmake@3:', type='build') depends_on('python', type='build') depends_on('z3', type='link') depends_on('zlib', type='link') depends_on('ncurses+termlib', type='link') patch('fix-system-zlib-ncurses.patch') root_cmakelists_dir = 'llvm' install_targets = ['clang-tidy', 'install'] def cmake_args(self): args = [ '-DLLVM_ENABLE_PROJECTS=clang;lld;clang-tools-extra;compiler-rt', '-DLLVM_ENABLE_ASSERTIONS=1' ] if self.compiler.name == "gcc": gcc_prefix = ancestor(self.compiler.cc, 2) args.append("-DGCC_INSTALL_PREFIX=" + gcc_prefix) return args
[ 1, 529, 276, 1112, 420, 29958, 19958, 21231, 29914, 1028, 547, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29941, 29899, 29906, 29900, 29906, 29900, 19520, 22469, 5514, 3086, 14223, 29892, 365, 12182, 322, 916, 13, 29937, 1706, 547, 8010, 10682, 414, 29889, 2823, 278, 2246, 29899, 5563, 315, 4590, 29979, 22789, 3912, 934, 363, 4902, 29889, 13, 29937, 13, 29937, 10937, 29928, 29990, 29899, 29931, 293, 1947, 29899, 12889, 29901, 313, 17396, 1829, 29899, 29906, 29889, 29900, 6323, 341, 1806, 29897, 13, 13, 13, 3166, 805, 547, 1053, 334, 13, 13, 13, 1990, 365, 29880, 6925, 29909, 3487, 29887, 3746, 29898, 29907, 9984, 14459, 1125, 13, 1678, 9995, 12229, 7354, 363, 278, 7632, 310, 10712, 27545, 752, 22058, 29892, 13, 539, 5994, 19427, 29892, 322, 1065, 29899, 2230, 23136, 1213, 15945, 13, 13, 1678, 3271, 3488, 353, 376, 991, 597, 3292, 29889, 510, 29914, 29934, 1943, 265, 6585, 20606, 29872, 29914, 645, 6925, 29899, 4836, 29908, 13, 1678, 3142, 418, 353, 376, 991, 597, 3292, 29889, 510, 29914, 29934, 1943, 265, 6585, 20606, 29872, 29914, 645, 6925, 29899, 4836, 29914, 10867, 29914, 307, 4912, 29899, 29941, 29889, 29945, 29889, 29900, 29889, 12637, 29889, 18828, 29908, 13, 13, 1678, 7344, 414, 353, 6024, 29879, 276, 10028, 314, 742, 525, 279, 29926, 348, 29899, 10665, 29899, 2120, 407, 2883, 2033, 13, 13, 1678, 1873, 877, 29941, 29889, 29945, 29889, 29900, 742, 528, 29874, 29906, 29945, 29953, 2433, 29946, 29947, 29955, 29947, 5444, 29947, 29945, 29946, 29955, 29941, 29890, 29906, 29946, 29881, 29947, 29947, 287, 617, 29947, 29929, 29929, 29941, 29947, 29946, 29946, 29896, 287, 29883, 29947, 29945, 29881, 29906, 29872, 29947, 29874, 29955, 29947, 29945, 29872, 29945, 29953, 29955, 29890, 29955, 6448, 29955, 346, 29906, 29955, 29946, 29872, 617, 29906, 11512, 29929, 29883, 1495, 13, 13, 1678, 17305, 877, 4282, 29918, 1853, 742, 2322, 2433, 19729, 742, 1819, 29922, 703, 19729, 613, 376, 11862, 4968, 6139, 2433, 29907, 9984, 2048, 1134, 1495, 13, 13, 1678, 7111, 29918, 265, 877, 29883, 5675, 29992, 29941, 29901, 742, 1134, 2433, 4282, 1495, 13, 1678, 7111, 29918, 265, 877, 4691, 742, 1134, 2433, 4282, 1495, 13, 1678, 7111, 29918, 265, 877, 29920, 29941, 742, 1134, 2433, 2324, 1495, 13, 1678, 7111, 29918, 265, 877, 29920, 1982, 742, 1134, 2433, 2324, 1495, 13, 1678, 7111, 29918, 265, 877, 17608, 1295, 267, 29974, 8489, 1982, 742, 1134, 2433, 2324, 1495, 13, 13, 1678, 13261, 877, 5878, 29899, 5205, 29899, 29920, 1982, 29899, 17608, 1295, 267, 29889, 5041, 1495, 13, 13, 1678, 3876, 29918, 4912, 557, 295, 2879, 29918, 3972, 353, 525, 645, 6925, 29915, 13, 13, 1678, 2601, 29918, 5182, 29879, 353, 6024, 695, 574, 29899, 17681, 29891, 742, 525, 6252, 2033, 13, 13, 1678, 822, 274, 5675, 29918, 5085, 29898, 1311, 1125, 13, 4706, 6389, 353, 518, 13, 9651, 17411, 29928, 2208, 9219, 29918, 1430, 6181, 29918, 8618, 17637, 29903, 29922, 695, 574, 29936, 29880, 430, 29936, 695, 574, 29899, 8504, 29899, 17833, 29936, 21789, 29899, 2273, 742, 13, 9651, 17411, 29928, 2208, 9219, 29918, 1430, 6181, 29918, 22933, 20161, 27946, 29922, 29896, 29915, 13, 4706, 4514, 13, 13, 4706, 565, 1583, 29889, 21789, 29889, 978, 1275, 376, 19644, 1115, 13, 9651, 20243, 29918, 13506, 353, 19525, 272, 29898, 1311, 29889, 21789, 29889, 617, 29892, 29871, 29906, 29897, 13, 9651, 6389, 29889, 4397, 703, 29899, 29928, 29954, 4174, 29918, 25580, 9818, 29918, 15094, 25634, 543, 718, 20243, 29918, 13506, 29897, 13, 13, 4706, 736, 6389, 13, 2 ]
cilp/utils.py
vakker/CILP
2
116548
<gh_stars>1-10 import collections import hashlib import itertools import json import re import subprocess import time from functools import partial from multiprocessing import Pool from os import path as osp import numpy as np import pandas as pd import torch def save_params(log_dir, params): params_id = get_dict_hash(params) params_file = pjoin(log_dir, 'params.json') saved = {params_id: params} if osp.exists(params_file): saved.update(load_json(params_file)) write_json(params_file, saved) return params_id def get_dict_hash(d): return get_hash(json.dumps(d, sort_keys=True, ensure_ascii=True).encode()) def get_hash(string): if not isinstance(string, bytes): string = string.encode() return hashlib.sha256(string).hexdigest()[:8] def run_aleph(script_file): aleph_file = get_aleph() cmd = f'swipl -f {aleph_file} -l {script_file}' return execute(cmd, return_output=True) def get_aleph(): curr_dir = osp.dirname(osp.realpath(__file__)) return pjoin(curr_dir, 'aleph.pl') def aleph_settings(mode_file, bk_file, data_files={}): script_lines = [] # script_lines += [f':- set(verbosity, 0).'] script_lines += [f':- set(depth,3).'] for set_name, data_file in data_files.items(): script_lines += [f':- set({set_name}, "{data_file}").'] script_lines += [f':- read_all("{mode_file}").'] script_lines += [f':- read_all("{bk_file}").'] return script_lines def create_script(directory, script_lines): file_name = pjoin(directory, 'script.pl') with open(file_name, 'w') as f: f.writelines([l + '\n' for l in script_lines + [':- halt.']]) return file_name def call(prolog, query): return list(prolog.query(query)) def sort_file(file_in, file_out): with open(file_in, 'r') as f: lines = f.readlines() with open(file_out, 'w') as f: f.writelines(sorted(lines)) def load_examples(file_name): with open(file_name, 'r') as f: lines = [l.strip('. \n') for l in f.readlines()] return np.array(lines) def write_examples(examples, file_name): with open(file_name, 'w') as f: f.writelines([e + '.\n' for e in examples]) def find_in_line(pattern, lines): found = [re.search(pattern, l) for l in lines] return [f.groups() for f in found if f is not None] def load_json(file_name): with open(file_name, 'r') as f: return json.load(f) def write_json(file_name, d): with open(file_name, 'w') as f: json.dump(d, f) # def set_feats(bcp_features, bcp_examples): # examples = np.zeros((len(bcp_examples), len(bcp_features))) # for i, ex in enumerate(bcp_examples): # feat_idx = np.in1d(bcp_features, ex) # examples[i, feat_idx] = 1 # return examples def set_feats(bcp_features, bcp_example): feat_idx = np.in1d(bcp_features, bcp_example, assume_unique=True) example = np.zeros((len(bcp_features))) example[feat_idx] = 1 return example def get_features(bcp_examples): bcp_features = list(set(itertools.chain.from_iterable(bcp_examples))) bcp_features = sorted(bcp_features) # set_feats_v = np.vectorize(set_feats, excluded='bcp_features') # examples = np.apply_along_axis(set_feats, 0, bcp_examples, bcp_features) start_time = time.time() set_feats_p = partial(set_feats, bcp_features) with Pool(20) as p: examples = p.map(set_feats_p, bcp_examples) examples = np.stack(examples, axis=0) print('set done, took ', time.time() - start_time) # examples = np.zeros((len(examples_bcp), len(bcp_features))) # for i, ex in enumerate(examples_bcp): # feat_idx = np.in1d(bcp_features, ex) # examples[i, feat_idx] = 1 return examples, bcp_features def execute(cmd, return_output=False): popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, universal_newlines=True) if return_output: output, err = popen.communicate() else: for stdout_line in iter(popen.stdout.readline, ""): # print(stdout_line.rstrip()) print(stdout_line.rstrip()) popen.stdout.close() return_code = popen.wait() if return_code: print('Subproc error:') print(output) raise subprocess.CalledProcessError(return_code, cmd) if return_output: return output def flatten_dict(d, parent_key='', sep='_'): items = [] for k, v in d.items(): new_key = parent_key + sep + k if parent_key else k if isinstance(v, collections.MutableMapping): items.extend(flatten_dict(v, new_key, sep=sep).items()) elif isinstance(v, list): v_list = {str(i): v_ for i, v_ in enumerate(v)} items.extend(flatten_dict(v_list, new_key, sep=sep).items()) else: items.append((new_key, v)) return dict(items) def to_numpy(input_arr): if isinstance(input_arr, torch.Tensor): return input_arr.cpu().detach().numpy() if isinstance(input_arr, (pd.DataFrame, pd.Series)): return input_arr.values if isinstance(input_arr, np.ndarray): return input_arr raise ValueError("Cannot convert %s to Numpy" % (type(input_arr))) def acc_score(outputs, targets, with_logits=False): outputs = to_numpy(outputs) targets = to_numpy(targets) if with_logits: y_pred = (outputs >= 0).astype(int) else: y_pred = (outputs >= 0.5).astype(int) correct = (y_pred == targets.astype(int)).sum() total = targets.shape[0] acc = correct / total return acc def pjoin(root, file_name): # for Windows compatibility, otherwise pjoin mixes slashes if '/' in root: if '\\' in root: raise RuntimeError(f'Path has mixed delimiters: {root}') if root[-1] == '/': return root + file_name return root + '/' + file_name if root[-1] == '\\': return root + file_name return root + '\\' + file_name
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 16250, 13, 5215, 6608, 1982, 13, 5215, 4256, 8504, 13, 5215, 4390, 13, 5215, 337, 13, 5215, 1014, 5014, 13, 5215, 931, 13, 3166, 2090, 312, 8789, 1053, 7687, 13, 3166, 6674, 307, 985, 292, 1053, 28625, 13, 3166, 2897, 1053, 2224, 408, 288, 1028, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 5215, 4842, 305, 13, 13, 13, 1753, 4078, 29918, 7529, 29898, 1188, 29918, 3972, 29892, 8636, 1125, 13, 1678, 8636, 29918, 333, 353, 679, 29918, 8977, 29918, 8568, 29898, 7529, 29897, 13, 1678, 8636, 29918, 1445, 353, 282, 7122, 29898, 1188, 29918, 3972, 29892, 525, 7529, 29889, 3126, 1495, 13, 1678, 7160, 353, 426, 7529, 29918, 333, 29901, 8636, 29913, 13, 1678, 565, 288, 1028, 29889, 9933, 29898, 7529, 29918, 1445, 1125, 13, 4706, 7160, 29889, 5504, 29898, 1359, 29918, 3126, 29898, 7529, 29918, 1445, 876, 13, 1678, 2436, 29918, 3126, 29898, 7529, 29918, 1445, 29892, 7160, 29897, 13, 1678, 736, 8636, 29918, 333, 13, 13, 13, 1753, 679, 29918, 8977, 29918, 8568, 29898, 29881, 1125, 13, 1678, 736, 679, 29918, 8568, 29898, 3126, 29889, 29881, 17204, 29898, 29881, 29892, 2656, 29918, 8149, 29922, 5574, 29892, 9801, 29918, 294, 18869, 29922, 5574, 467, 12508, 3101, 13, 13, 13, 1753, 679, 29918, 8568, 29898, 1807, 1125, 13, 1678, 565, 451, 338, 8758, 29898, 1807, 29892, 6262, 1125, 13, 4706, 1347, 353, 1347, 29889, 12508, 580, 13, 1678, 736, 6608, 1982, 29889, 17051, 29906, 29945, 29953, 29898, 1807, 467, 20970, 7501, 342, 580, 7503, 29947, 29962, 13, 13, 13, 1753, 1065, 29918, 744, 561, 29898, 2154, 29918, 1445, 1125, 13, 1678, 8080, 561, 29918, 1445, 353, 679, 29918, 744, 561, 580, 13, 1678, 9920, 353, 285, 29915, 2774, 29875, 572, 448, 29888, 426, 744, 561, 29918, 1445, 29913, 448, 29880, 426, 2154, 29918, 1445, 10162, 13, 1678, 736, 6222, 29898, 9006, 29892, 736, 29918, 4905, 29922, 5574, 29897, 13, 13, 13, 1753, 679, 29918, 744, 561, 7295, 13, 1678, 16256, 29918, 3972, 353, 288, 1028, 29889, 25721, 29898, 4705, 29889, 6370, 2084, 22168, 1445, 1649, 876, 13, 1678, 736, 282, 7122, 29898, 21962, 29918, 3972, 29892, 525, 744, 561, 29889, 572, 1495, 13, 13, 13, 1753, 8080, 561, 29918, 11027, 29898, 8513, 29918, 1445, 29892, 289, 29895, 29918, 1445, 29892, 848, 29918, 5325, 3790, 29913, 1125, 13, 1678, 2471, 29918, 9012, 353, 5159, 13, 1678, 396, 2471, 29918, 9012, 4619, 518, 29888, 2396, 29899, 731, 29898, 18248, 359, 537, 29892, 29871, 29900, 467, 2033, 13, 1678, 2471, 29918, 9012, 4619, 518, 29888, 2396, 29899, 731, 29898, 19488, 29892, 29941, 467, 2033, 13, 1678, 363, 731, 29918, 978, 29892, 848, 29918, 1445, 297, 848, 29918, 5325, 29889, 7076, 7295, 13, 4706, 2471, 29918, 9012, 4619, 518, 29888, 2396, 29899, 731, 3319, 842, 29918, 978, 1118, 29850, 1272, 29918, 1445, 29913, 2564, 2033, 13, 1678, 2471, 29918, 9012, 4619, 518, 29888, 2396, 29899, 1303, 29918, 497, 703, 29912, 8513, 29918, 1445, 29913, 2564, 2033, 13, 1678, 2471, 29918, 9012, 4619, 518, 29888, 2396, 29899, 1303, 29918, 497, 703, 29912, 29890, 29895, 29918, 1445, 29913, 2564, 2033, 13, 1678, 736, 2471, 29918, 9012, 13, 13, 13, 1753, 1653, 29918, 2154, 29898, 12322, 29892, 2471, 29918, 9012, 1125, 13, 1678, 934, 29918, 978, 353, 282, 7122, 29898, 12322, 29892, 525, 2154, 29889, 572, 1495, 13, 1678, 411, 1722, 29898, 1445, 29918, 978, 29892, 525, 29893, 1495, 408, 285, 29901, 13, 4706, 285, 29889, 8231, 24210, 4197, 29880, 718, 11297, 29876, 29915, 363, 301, 297, 2471, 29918, 9012, 718, 518, 2396, 29899, 25212, 29889, 2033, 2314, 13, 1678, 736, 934, 29918, 978, 13, 13, 13, 1753, 1246, 29898, 771, 1188, 29892, 2346, 1125, 13, 1678, 736, 1051, 29898, 771, 1188, 29889, 1972, 29898, 1972, 876, 13, 13, 13, 1753, 2656, 29918, 1445, 29898, 1445, 29918, 262, 29892, 934, 29918, 449, 1125, 13, 1678, 411, 1722, 29898, 1445, 29918, 262, 29892, 525, 29878, 1495, 408, 285, 29901, 13, 4706, 3454, 353, 285, 29889, 949, 9012, 580, 13, 13, 1678, 411, 1722, 29898, 1445, 29918, 449, 29892, 525, 29893, 1495, 408, 285, 29901, 13, 4706, 285, 29889, 8231, 24210, 29898, 24582, 29898, 9012, 876, 13, 13, 13, 1753, 2254, 29918, 19057, 29898, 1445, 29918, 978, 1125, 13, 1678, 411, 1722, 29898, 1445, 29918, 978, 29892, 525, 29878, 1495, 408, 285, 29901, 13, 4706, 3454, 353, 518, 29880, 29889, 17010, 12839, 320, 29876, 1495, 363, 301, 297, 285, 29889, 949, 9012, 580, 29962, 13, 1678, 736, 7442, 29889, 2378, 29898, 9012, 29897, 13, 13, 13, 1753, 2436, 29918, 19057, 29898, 19057, 29892, 934, 29918, 978, 1125, 13, 1678, 411, 1722, 29898, 1445, 29918, 978, 29892, 525, 29893, 1495, 408, 285, 29901, 13, 4706, 285, 29889, 8231, 24210, 4197, 29872, 718, 525, 7790, 29876, 29915, 363, 321, 297, 6455, 2314, 13, 13, 13, 1753, 1284, 29918, 262, 29918, 1220, 29898, 11037, 29892, 3454, 1125, 13, 1678, 1476, 353, 518, 276, 29889, 4478, 29898, 11037, 29892, 301, 29897, 363, 301, 297, 3454, 29962, 13, 1678, 736, 518, 29888, 29889, 13155, 580, 363, 285, 297, 1476, 565, 285, 338, 451, 6213, 29962, 13, 13, 13, 1753, 2254, 29918, 3126, 29898, 1445, 29918, 978, 1125, 13, 1678, 411, 1722, 29898, 1445, 29918, 978, 29892, 525, 29878, 1495, 408, 285, 29901, 13, 4706, 736, 4390, 29889, 1359, 29898, 29888, 29897, 13, 13, 13, 1753, 2436, 29918, 3126, 29898, 1445, 29918, 978, 29892, 270, 1125, 13, 1678, 411, 1722, 29898, 1445, 29918, 978, 29892, 525, 29893, 1495, 408, 285, 29901, 13, 4706, 4390, 29889, 15070, 29898, 29881, 29892, 285, 29897, 13, 13, 13, 29937, 822, 731, 29918, 1725, 1446, 29898, 29890, 6814, 29918, 22100, 29892, 289, 6814, 29918, 19057, 1125, 13, 29937, 268, 6455, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 29890, 6814, 29918, 19057, 511, 7431, 29898, 29890, 6814, 29918, 22100, 4961, 13, 29937, 268, 363, 474, 29892, 429, 297, 26985, 29898, 29890, 6814, 29918, 19057, 1125, 13, 29937, 308, 1238, 271, 29918, 13140, 353, 7442, 29889, 262, 29896, 29881, 29898, 29890, 6814, 29918, 22100, 29892, 429, 29897, 13, 29937, 308, 6455, 29961, 29875, 29892, 1238, 271, 29918, 13140, 29962, 353, 29871, 29896, 13, 29937, 268, 736, 6455, 13, 13, 13, 1753, 731, 29918, 1725, 1446, 29898, 29890, 6814, 29918, 22100, 29892, 289, 6814, 29918, 4773, 1125, 13, 1678, 1238, 271, 29918, 13140, 353, 7442, 29889, 262, 29896, 29881, 29898, 29890, 6814, 29918, 22100, 29892, 289, 6814, 29918, 4773, 29892, 5251, 29918, 13092, 29922, 5574, 29897, 13, 1678, 1342, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 29890, 6814, 29918, 22100, 4961, 13, 1678, 1342, 29961, 1725, 271, 29918, 13140, 29962, 353, 29871, 29896, 13, 1678, 736, 1342, 13, 13, 13, 1753, 679, 29918, 22100, 29898, 29890, 6814, 29918, 19057, 1125, 13, 1678, 289, 6814, 29918, 22100, 353, 1051, 29898, 842, 29898, 1524, 8504, 29889, 14153, 29889, 3166, 29918, 1524, 519, 29898, 29890, 6814, 29918, 19057, 4961, 13, 1678, 289, 6814, 29918, 22100, 353, 12705, 29898, 29890, 6814, 29918, 22100, 29897, 13, 13, 1678, 396, 731, 29918, 1725, 1446, 29918, 29894, 353, 7442, 29889, 8111, 675, 29898, 842, 29918, 1725, 1446, 29892, 429, 13347, 2433, 29890, 6814, 29918, 22100, 1495, 13, 13, 1678, 396, 6455, 353, 7442, 29889, 7302, 29918, 284, 549, 29918, 8990, 29898, 842, 29918, 1725, 1446, 29892, 29871, 29900, 29892, 289, 6814, 29918, 19057, 29892, 289, 6814, 29918, 22100, 29897, 13, 13, 1678, 1369, 29918, 2230, 353, 931, 29889, 2230, 580, 13, 1678, 731, 29918, 1725, 1446, 29918, 29886, 353, 7687, 29898, 842, 29918, 1725, 1446, 29892, 289, 6814, 29918, 22100, 29897, 13, 1678, 411, 28625, 29898, 29906, 29900, 29897, 408, 282, 29901, 13, 4706, 6455, 353, 282, 29889, 1958, 29898, 842, 29918, 1725, 1446, 29918, 29886, 29892, 289, 6814, 29918, 19057, 29897, 13, 1678, 6455, 353, 7442, 29889, 1429, 29898, 19057, 29892, 9685, 29922, 29900, 29897, 13, 13, 1678, 1596, 877, 842, 2309, 29892, 3614, 13420, 931, 29889, 2230, 580, 448, 1369, 29918, 2230, 29897, 13, 1678, 396, 6455, 353, 7442, 29889, 3298, 359, 3552, 2435, 29898, 19057, 29918, 29890, 6814, 511, 7431, 29898, 29890, 6814, 29918, 22100, 4961, 13, 1678, 396, 363, 474, 29892, 429, 297, 26985, 29898, 19057, 29918, 29890, 6814, 1125, 13, 1678, 396, 268, 1238, 271, 29918, 13140, 353, 7442, 29889, 262, 29896, 29881, 29898, 29890, 6814, 29918, 22100, 29892, 429, 29897, 13, 1678, 396, 268, 6455, 29961, 29875, 29892, 1238, 271, 29918, 13140, 29962, 353, 29871, 29896, 13, 13, 1678, 736, 6455, 29892, 289, 6814, 29918, 22100, 13, 13, 13, 1753, 6222, 29898, 9006, 29892, 736, 29918, 4905, 29922, 8824, 1125, 13, 1678, 1835, 264, 353, 1014, 5014, 29889, 29925, 3150, 29898, 9006, 29892, 13, 462, 632, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 13, 462, 632, 380, 20405, 29922, 1491, 5014, 29889, 1254, 3970, 2692, 29892, 13, 462, 632, 6473, 29922, 5574, 29892, 13, 462, 632, 15968, 29918, 1482, 9012, 29922, 5574, 29897, 13, 13, 1678, 565, 736, 29918, 4905, 29901, 13, 4706, 1962, 29892, 4589, 353, 1835, 264, 29889, 27820, 403, 580, 13, 1678, 1683, 29901, 13, 4706, 363, 27591, 29918, 1220, 297, 4256, 29898, 29886, 3150, 29889, 25393, 29889, 949, 1220, 29892, 5124, 1125, 13, 9651, 396, 1596, 29898, 25393, 29918, 1220, 29889, 29878, 17010, 3101, 13, 9651, 1596, 29898, 25393, 29918, 1220, 29889, 29878, 17010, 3101, 13, 1678, 1835, 264, 29889, 25393, 29889, 5358, 580, 13, 1678, 736, 29918, 401, 353, 1835, 264, 29889, 10685, 580, 13, 1678, 565, 736, 29918, 401, 29901, 13, 4706, 1596, 877, 4035, 15439, 1059, 29901, 1495, 13, 4706, 1596, 29898, 4905, 29897, 13, 4706, 12020, 1014, 5014, 29889, 29907, 4212, 7032, 2392, 29898, 2457, 29918, 401, 29892, 9920, 29897, 13, 13, 1678, 565, 736, 29918, 4905, 29901, 13, 4706, 736, 1962, 13, 13, 13, 1753, 1652, 8606, 29918, 8977, 29898, 29881, 29892, 3847, 29918, 1989, 2433, 742, 16345, 2433, 29918, 29374, 13, 1678, 4452, 353, 5159, 13, 1678, 363, 413, 29892, 325, 297, 270, 29889, 7076, 7295, 13, 4706, 716, 29918, 1989, 353, 3847, 29918, 1989, 718, 16345, 718, 413, 565, 3847, 29918, 1989, 1683, 413, 13, 4706, 565, 338, 8758, 29898, 29894, 29892, 16250, 29889, 15211, 15845, 1125, 13, 9651, 4452, 29889, 21843, 29898, 1579, 8606, 29918, 8977, 29898, 29894, 29892, 716, 29918, 1989, 29892, 16345, 29922, 19570, 467, 7076, 3101, 13, 4706, 25342, 338, 8758, 29898, 29894, 29892, 1051, 1125, 13, 9651, 325, 29918, 1761, 353, 426, 710, 29898, 29875, 1125, 325, 29918, 363, 474, 29892, 325, 29918, 297, 26985, 29898, 29894, 2915, 13, 9651, 4452, 29889, 21843, 29898, 1579, 8606, 29918, 8977, 29898, 29894, 29918, 1761, 29892, 716, 29918, 1989, 29892, 16345, 29922, 19570, 467, 7076, 3101, 13, 4706, 1683, 29901, 13, 9651, 4452, 29889, 4397, 3552, 1482, 29918, 1989, 29892, 325, 876, 13, 1678, 736, 9657, 29898, 7076, 29897, 13, 13, 13, 1753, 304, 29918, 23749, 29898, 2080, 29918, 2749, 1125, 13, 1678, 565, 338, 8758, 29898, 2080, 29918, 2749, 29892, 4842, 305, 29889, 29911, 6073, 1125, 13, 4706, 736, 1881, 29918, 2749, 29889, 21970, 2141, 4801, 496, 2141, 23749, 580, 13, 1678, 565, 338, 8758, 29898, 2080, 29918, 2749, 29892, 313, 15926, 29889, 17271, 29892, 10518, 29889, 19204, 22164, 13, 4706, 736, 1881, 29918, 2749, 29889, 5975, 13, 1678, 565, 338, 8758, 29898, 2080, 29918, 2749, 29892, 7442, 29889, 299, 2378, 1125, 13, 4706, 736, 1881, 29918, 2749, 13, 13, 1678, 12020, 7865, 2392, 703, 29089, 3588, 1273, 29879, 304, 11848, 2272, 29908, 1273, 313, 1853, 29898, 2080, 29918, 2749, 4961, 13, 13, 13, 1753, 1035, 29918, 13628, 29898, 4905, 29879, 29892, 22525, 29892, 411, 29918, 1188, 1169, 29922, 8824, 1125, 13, 1678, 14391, 353, 304, 29918, 23749, 29898, 4905, 29879, 29897, 13, 1678, 22525, 353, 304, 29918, 23749, 29898, 5182, 29879, 29897, 13, 13, 1678, 565, 411, 29918, 1188, 1169, 29901, 13, 4706, 343, 29918, 11965, 353, 313, 4905, 29879, 6736, 29871, 29900, 467, 579, 668, 29898, 524, 29897, 13, 1678, 1683, 29901, 13, 4706, 343, 29918, 11965, 353, 313, 4905, 29879, 6736, 29871, 29900, 29889, 29945, 467, 579, 668, 29898, 524, 29897, 13, 1678, 1959, 353, 313, 29891, 29918, 11965, 1275, 22525, 29889, 579, 668, 29898, 524, 8106, 2083, 580, 13, 1678, 3001, 353, 22525, 29889, 12181, 29961, 29900, 29962, 13, 1678, 1035, 353, 1959, 847, 3001, 13, 1678, 736, 1035, 13, 13, 13, 1753, 282, 7122, 29898, 4632, 29892, 934, 29918, 978, 1125, 13, 1678, 396, 363, 3852, 24521, 29892, 6467, 282, 7122, 6837, 267, 24765, 267, 13, 1678, 565, 8207, 29915, 297, 3876, 29901, 13, 4706, 565, 525, 1966, 29915, 297, 3876, 29901, 13, 9651, 12020, 24875, 2392, 29898, 29888, 29915, 2605, 756, 12849, 628, 13083, 414, 29901, 426, 4632, 29913, 1495, 13, 13, 4706, 565, 3876, 14352, 29896, 29962, 1275, 8207, 2396, 13, 9651, 736, 3876, 718, 934, 29918, 978, 13, 4706, 736, 3876, 718, 8207, 29915, 718, 934, 29918, 978, 13, 13, 1678, 565, 3876, 14352, 29896, 29962, 1275, 525, 1966, 2396, 13, 4706, 736, 3876, 718, 934, 29918, 978, 13, 1678, 736, 3876, 718, 525, 1966, 29915, 718, 934, 29918, 978, 13, 2 ]
Classes/Filex.py
Ramin-RX7/RX7-Lib
6
57699
<gh_stars>1-10 ''' Filex Module is Sub-Module of rx7 library. It contains 2 classes: 1- files: Static method 2- File: create File object and use its methods. (If you are using rx7 module, don't use this and directly use rx7.files and rx7.File) (Usually I use first one when I need a file only one time in my code and use 2nd one when i'm working with a file more than 1 time.) ''' import os,shutil,subprocess from typing import Union class files: ''' (STATIC METHODS)\n Actions and information about files.\n (READ FUNCTIONS DOCSTRING) GET INFORMATION: - exists() - size() - abspath() - mdftime() - acstime() - content (read function)() - is file() - is dir() - is readonly() - is hidden() ACTIONS: - remove() - rename() - move() - copy() - hide() - read only() - write() ''' @staticmethod def size(path): ''' return size of the file in byte(s). Also work on directories. ''' return os.path.getsize(path) #rooye pooshe emtehan she @staticmethod def remove(path,force=False): ''' Use this to delete a file or a directory. If force is True it will delete non-empty directories. ''' if os.path.isfile(path): os.remove(path) else: if force: shutil.rmtree(path) else: try: os.rmdir(path) except OSError: raise OSError(f"[WinError 145] The directory is not empty: '{path}'" + '\n' + ' '*23 + '(Use force=True as an argument of remove function to remove non-empty directories.)') from None @staticmethod def rename(old_name,new_name): '''Rename files with this function.''' os.rename(old_name,new_name) @staticmethod def abspath(path): ''' return absolute path of given path. ''' return os.path.abspath(path) @staticmethod def exists(path): ''' Search for the file And Returns a boolean. if file exists: True else: False ''' return os.path.exists(path) @staticmethod def mdftime(path): ''' Get last modify time of the path. ''' return os.path.getmtime(path) @staticmethod def acstime(path): ''' Get last access time of the path. ''' return os.path.getatime(path) # change to date bayad biad @staticmethod def move(src,dst): ''' Move (cut) file/directory from crs to dst. ''' shutil.move(src,dst) #live_path= dst #Baraye folder hast ya na? @staticmethod def copy(src,dest,preserve_metadata= True): ''' Copy the file from src to destination. preserve_metadata is for preserving metadata of file when copying. (You can use it instead of rename too. e.g: copy('D:\\Test.py','E:\\Ali.py') (It copies Test.py to E drive and renames it to Ali.py) ) ''' if files.isdir(src): shutil.copytree(src,dest) else: if preserve_metadata: shutil.copy2(src,dest) else: shutil.copy(src,dest) @staticmethod def hide(path,mode=True): ''' Hide file or folder. If mode==False: makes 'not hide' (ONLY WINDOWS) ''' try: import win32api, win32con except: raise ImportError('Please install pywin32 via pip') if mode: win32api.SetFileAttributes(path,win32con.FILE_ATTRIBUTE_HIDDEN) else: win32api.SetFileAttributes(path,win32con.FILE_ATTRIBUTE_NORMAL) @staticmethod def read_only(path,mode=True): ''' Make file attribute read_only. If mode==False: makes 'not read_only' ''' if type(mode)==bool: from stat import S_IREAD,S_IWUSR if mode==True: os.chmod(path, S_IREAD) elif mode==False: os.chmod(path, S_IWUSR) else: raise Exception('Second argumant (mode) should be boolean.') @staticmethod def read(path): ''' This can help you to read your file faster. Example: read('C:\\users\\Jack\\test.txt') ==> "Content of 'test.txt' will be shown." ''' with open(path) as f: FileR= f.read() return FileR @staticmethod def write(file_path,text=None,mode='replace',start=''): ''' With this method you can change content of the file. file: File you want to change its content. content: Content you want to add to file. mode: Type of writing method. 'a' or 'continue' for add content to end of the file. 'w' or 'replace' for overwriting to file content. start: I use this when I use mode='continue' ''' if mode=='replace': op= open(file_path,mode='w') if text==None: text= input('Type what you want.\n\n') op.write(text) op.close() elif mode=='continue': '''opr= open(file,mode='r') FileR= opr.read() op= open(file,mode='w')''' op=open(file_path,'a') if text==None: text= input('Type what you want to add in the end of the file.\n\n') op.write(start+text) op.close() else: raise ValueError('mode can only be: replace(default) or continue Not "{0}"'.format(mode)) @staticmethod def isdir(path): return os.path.isdir(path) @staticmethod def isfile(path): return os.path.isfile(path) @staticmethod def is_readonly(path): ''' Return True if path is readonly else False. (May Not Work in Linux) ''' return subprocess.getoutput(f'dir /ar {path} >nul 2>nul && echo True || echo False') @staticmethod def is_hidden(path): """ Check whether a file is presumed hidden, either because the pathname starts with dot or because the platform indicates such. Return True if File or Directory is hidden. (Work on both Linux and Windows) """ import platform full_path = os.path.abspath(path) name = os.path.basename(full_path) def no(path): return False platform_hidden = globals().get('is_hidden_' + platform.system(), no) return name.startswith('.') or platform_hidden(full_path) @staticmethod def is_hidden_Windows(path): import ctypes res = ctypes.windll.kernel32.GetFileAttributesW(path) assert res != -1 return bool(res & 2) @staticmethod def search_file(pattern, path='.\\',return_mode: List['list','generator']= 'list'): ''' Search for files in path. Return list or generator. pattern: - 'x.py' : search for 'x.py' in path. - '*.py' : search for all files with .py extension in path. - '*.*' : search for all files in path - '**/*' : search for any file in path and also all sub-directories. - '**/*.py: search for all python files in path and also sub-directories. - 'mydir/**/*.py' : search for all python files in path/mydir/ and all of its sub-directories. ''' import glob if str(return_mode).lower() in ('list','generator'): if return_mode=='list': return glob.glob(pattern, recursive=True) else: return glob.iglob(pattern, recursive=True) else: if type(return_mode)==str: raise ValueError(f"return_mode van be 'list' or 'generator' not {return_mode}") else: raise TypeError(f"return_mode type should be str and it should be in ['list', 'generator']") @staticmethod def search_content(path,word): ALL= [val for sublist in [[os.path.join(i[0], j) for j in i[2]] for i in os.walk(path)] for val in sublist] '''lst=[] for file in ALL: if word in rx.read(file): lst.append(file) return lst''' return [file for file in ALL if word in open(file).read()] @staticmethod def mkdir(path): path = os.path.normpath(path) NEW= '' for FILE in path.split('\\'): NEW+= FILE+'\\' try: os.mkdir(NEW) except (FileExistsError,FileNotFoundError): pass @staticmethod def generate_tree(dir_path, level: int=-1, limit_to_directories: bool=False, length_limit: int=1000, print_info: bool=True): """Given a directory Path object return a visual tree structure""" from pathlib import Path from itertools import islice space= ' '; branch = '│ '; tee= '├── '; last= '└── ' dir_path = Path(dir_path) # accept string coerceable to Path files = 0 directories = 0 def inner(dir_path: Path, prefix: str='', level=-1): nonlocal files, directories if not level: return # 0, stop iterating if limit_to_directories: contents = [d for d in dir_path.iterdir() if d.is_dir()] else: contents = list(dir_path.iterdir()) pointers = [tee] * (len(contents) - 1) + [last] for pointer, path in zip(pointers, contents): if path.is_dir(): yield prefix + pointer + path.name directories += 1 extension = branch if pointer == tee else space yield from inner(path, prefix=prefix+extension, level=level-1) elif not limit_to_directories: yield prefix + pointer + path.name files += 1 RETURN='' RETURN+=dir_path.name+'\n' iterator = inner(dir_path, level=level) for line in islice(iterator, length_limit): RETURN+=line+'\n' if next(iterator, None): RETURN+=f'... length_limit, {length_limit}, reached, counted:' if print_info: RETURN+=f'\n{directories} directories' + (f', {files} files' if files else '') return RETURN class MEMBERS: @staticmethod def all_exactdir(dir): return os.listdir(dir) @staticmethod def all_all_sep(dir): return [i for i in os.walk(dir)] @staticmethod def files_exactdir(dir): return [i for i in os.walk(dir)][0][2] @staticmethod def files_all(dir): return [val for sublist in [[os.path.join(i[0], j) for j in i[2]] for i in os.walk(dir)] for val in sublist] @staticmethod def files_all_sep(dir): return [[os.path.join(i[0], j) for j in i[2]] for i in os.walk(dir)] @staticmethod def dirs_exactdir(dir): return sorted([i for i in os.listdir(dir) if i not in [i for i in os.walk(dir)][0][2]]) @staticmethod def dirs_all(dir): return [TPL[0] for TPL in [i for i in os.walk(dir)]]
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 12008, 13, 2283, 29916, 15591, 338, 3323, 29899, 7355, 310, 364, 29916, 29955, 3489, 29889, 13, 3112, 3743, 29871, 29906, 4413, 29901, 259, 13, 29896, 29899, 2066, 29901, 624, 2454, 1158, 13, 29906, 29899, 3497, 29901, 1653, 3497, 1203, 322, 671, 967, 3519, 29889, 259, 13, 29898, 3644, 366, 526, 773, 364, 29916, 29955, 3883, 29892, 1016, 29915, 29873, 671, 445, 322, 4153, 671, 364, 29916, 29955, 29889, 5325, 322, 364, 29916, 29955, 29889, 2283, 29897, 13, 29898, 15922, 1474, 306, 671, 937, 697, 746, 306, 817, 263, 934, 871, 697, 931, 297, 590, 775, 259, 13, 392, 671, 29871, 29906, 299, 697, 746, 474, 29915, 29885, 1985, 411, 263, 934, 901, 1135, 29871, 29896, 931, 1846, 13, 13, 12008, 13, 13, 5215, 2897, 29892, 845, 4422, 29892, 1491, 5014, 13, 3166, 19229, 1053, 7761, 13, 13, 1990, 2066, 29901, 13, 1678, 14550, 13, 1678, 313, 17816, 2965, 341, 2544, 8187, 8452, 2144, 29876, 13, 1678, 319, 1953, 322, 2472, 1048, 2066, 7790, 29876, 13, 1678, 313, 16310, 383, 28700, 29903, 11662, 29907, 20785, 29897, 13, 13, 1678, 12354, 2672, 19094, 8098, 29901, 13, 418, 448, 4864, 580, 13, 418, 448, 2159, 580, 13, 418, 448, 633, 1028, 493, 580, 13, 418, 448, 22821, 615, 603, 580, 13, 418, 448, 1274, 303, 603, 580, 13, 418, 448, 2793, 313, 949, 740, 29897, 580, 13, 418, 448, 338, 934, 580, 13, 418, 448, 338, 4516, 580, 13, 418, 448, 338, 20623, 580, 13, 418, 448, 338, 7934, 580, 13, 13, 1678, 319, 9838, 29903, 29901, 13, 418, 448, 3349, 580, 13, 418, 448, 19508, 580, 13, 418, 448, 4337, 580, 13, 418, 448, 3509, 580, 13, 418, 448, 9563, 580, 13, 418, 448, 1303, 871, 580, 13, 418, 448, 2436, 580, 13, 1678, 14550, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2159, 29898, 2084, 1125, 13, 4706, 14550, 13, 4706, 736, 2159, 310, 278, 934, 297, 7023, 29898, 29879, 467, 13, 4706, 3115, 664, 373, 17525, 29889, 13, 4706, 14550, 13, 4706, 736, 2897, 29889, 2084, 29889, 657, 2311, 29898, 2084, 29897, 13, 4706, 396, 307, 29877, 4099, 772, 359, 354, 953, 371, 5403, 1183, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 3349, 29898, 2084, 29892, 10118, 29922, 8824, 1125, 13, 4706, 14550, 13, 4706, 4803, 445, 304, 5217, 263, 934, 470, 263, 3884, 29889, 13, 4706, 960, 4889, 338, 5852, 372, 674, 5217, 1661, 29899, 6310, 17525, 29889, 13, 4706, 14550, 13, 4706, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 2084, 1125, 13, 9651, 2897, 29889, 5992, 29898, 2084, 29897, 13, 4706, 1683, 29901, 13, 9651, 565, 4889, 29901, 29871, 13, 18884, 528, 4422, 29889, 1758, 8336, 29898, 2084, 29897, 13, 9651, 1683, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 2897, 29889, 1758, 3972, 29898, 2084, 29897, 13, 18884, 5174, 438, 29173, 29901, 13, 462, 1678, 12020, 438, 29173, 29898, 29888, 29908, 29961, 17734, 2392, 29871, 29896, 29946, 29945, 29962, 450, 3884, 338, 451, 4069, 29901, 22372, 2084, 10162, 29908, 718, 11297, 29876, 29915, 718, 525, 525, 29930, 29906, 29941, 718, 29871, 13, 462, 462, 259, 525, 29898, 11403, 4889, 29922, 5574, 408, 385, 2980, 310, 3349, 740, 304, 3349, 1661, 29899, 6310, 17525, 1846, 1495, 515, 6213, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 19508, 29898, 1025, 29918, 978, 29892, 1482, 29918, 978, 1125, 13, 4706, 14550, 29934, 3871, 2066, 411, 445, 740, 29889, 12008, 13, 4706, 2897, 29889, 1267, 420, 29898, 1025, 29918, 978, 29892, 1482, 29918, 978, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 633, 1028, 493, 29898, 2084, 1125, 13, 4706, 14550, 13, 4706, 736, 8380, 2224, 310, 2183, 2224, 29889, 13, 4706, 14550, 13, 4706, 736, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 2084, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 4864, 29898, 2084, 1125, 13, 4706, 14550, 13, 4706, 11856, 363, 278, 934, 1126, 16969, 263, 7223, 29889, 13, 4706, 565, 934, 4864, 29901, 5852, 13, 4706, 1683, 29901, 7700, 13, 4706, 14550, 13, 4706, 736, 2897, 29889, 2084, 29889, 9933, 29898, 2084, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 22821, 615, 603, 29898, 2084, 1125, 13, 4706, 14550, 13, 4706, 3617, 1833, 6623, 931, 310, 278, 2224, 29889, 13, 4706, 14550, 13, 4706, 736, 2897, 29889, 2084, 29889, 657, 29885, 2230, 29898, 2084, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1274, 303, 603, 29898, 2084, 1125, 268, 13, 4706, 14550, 13, 4706, 3617, 1833, 2130, 931, 310, 278, 2224, 29889, 13, 4706, 14550, 13, 4706, 736, 2897, 29889, 2084, 29889, 657, 271, 603, 29898, 2084, 29897, 13, 4706, 396, 1735, 304, 2635, 23041, 328, 4768, 328, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 4337, 29898, 4351, 29892, 22992, 1125, 13, 4706, 14550, 13, 4706, 25249, 313, 7582, 29897, 934, 29914, 12322, 515, 2181, 29879, 304, 29743, 29889, 13, 4706, 14550, 13, 4706, 528, 4422, 29889, 11631, 29898, 4351, 29892, 22992, 29897, 13, 4706, 396, 9258, 29918, 2084, 29922, 29743, 13, 4706, 396, 4297, 15802, 4138, 14973, 9343, 1055, 29973, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 3509, 29898, 4351, 29892, 7854, 29892, 4569, 7143, 29918, 19635, 29922, 5852, 1125, 13, 4706, 14550, 13, 4706, 14187, 278, 934, 515, 4765, 304, 12551, 29889, 259, 13, 4706, 19905, 29918, 19635, 338, 363, 2225, 29530, 15562, 310, 934, 746, 17596, 29889, 13, 4706, 313, 3492, 508, 671, 372, 2012, 310, 19508, 2086, 29889, 13, 308, 321, 29889, 29887, 29901, 13, 9651, 3509, 877, 29928, 22298, 3057, 29889, 2272, 3788, 29923, 22298, 29909, 492, 29889, 2272, 1495, 13, 9651, 313, 3112, 14591, 4321, 29889, 2272, 304, 382, 7899, 322, 4325, 1280, 372, 304, 10785, 29889, 2272, 29897, 13, 308, 1723, 13, 4706, 14550, 13, 4706, 565, 2066, 29889, 275, 3972, 29898, 4351, 1125, 13, 9651, 528, 4422, 29889, 8552, 8336, 29898, 4351, 29892, 7854, 29897, 13, 4706, 1683, 29901, 13, 9651, 565, 19905, 29918, 19635, 29901, 528, 4422, 29889, 8552, 29906, 29898, 4351, 29892, 7854, 29897, 13, 9651, 1683, 29901, 528, 4422, 29889, 8552, 29898, 4351, 29892, 7854, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 9563, 29898, 2084, 29892, 8513, 29922, 5574, 1125, 13, 4706, 14550, 13, 4706, 379, 680, 934, 470, 4138, 29889, 13, 4706, 960, 4464, 1360, 8824, 29901, 3732, 525, 1333, 9563, 29915, 13, 4706, 313, 1164, 16786, 399, 1177, 3970, 7811, 29897, 13, 4706, 14550, 13, 4706, 1018, 29901, 13, 9651, 1053, 5401, 29941, 29906, 2754, 29892, 5401, 29941, 29906, 535, 13, 4706, 5174, 29901, 13, 9651, 12020, 16032, 2392, 877, 12148, 2601, 11451, 5080, 29941, 29906, 3025, 8450, 1495, 13, 4706, 565, 4464, 29901, 13, 9651, 5401, 29941, 29906, 2754, 29889, 2697, 2283, 15801, 29898, 2084, 29892, 5080, 29941, 29906, 535, 29889, 7724, 29918, 1299, 29911, 3960, 29933, 26027, 29918, 29950, 1367, 29928, 1430, 29897, 13, 4706, 1683, 29901, 13, 9651, 5401, 29941, 29906, 2754, 29889, 2697, 2283, 15801, 29898, 2084, 29892, 5080, 29941, 29906, 535, 29889, 7724, 29918, 1299, 29911, 3960, 29933, 26027, 29918, 29940, 1955, 1529, 29931, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1303, 29918, 6194, 29898, 2084, 29892, 8513, 29922, 5574, 1125, 13, 4706, 14550, 13, 4706, 8561, 934, 5352, 1303, 29918, 6194, 29889, 13, 4706, 960, 4464, 1360, 8824, 29901, 3732, 525, 1333, 1303, 29918, 6194, 29915, 13, 4706, 14550, 13, 4706, 565, 1134, 29898, 8513, 29897, 1360, 11227, 29901, 13, 9651, 515, 1002, 1053, 317, 29918, 29902, 16310, 29892, 29903, 29918, 29902, 29956, 3308, 29934, 13, 9651, 565, 4464, 1360, 5574, 29901, 13, 18884, 2897, 29889, 305, 1545, 29898, 2084, 29892, 317, 29918, 29902, 16310, 29897, 13, 9651, 25342, 4464, 1360, 8824, 29901, 13, 18884, 2897, 29889, 305, 1545, 29898, 2084, 29892, 317, 29918, 29902, 29956, 3308, 29934, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 8960, 877, 11863, 1852, 398, 424, 313, 8513, 29897, 881, 367, 7223, 29889, 1495, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 1303, 29898, 2084, 1125, 13, 4706, 14550, 13, 4706, 910, 508, 1371, 366, 304, 1303, 596, 934, 8473, 29889, 13, 4706, 8741, 29901, 13, 9651, 1303, 877, 29907, 22298, 7193, 1966, 27006, 1966, 1688, 29889, 3945, 1495, 13, 9651, 25230, 376, 3916, 310, 525, 1688, 29889, 3945, 29915, 674, 367, 4318, 1213, 13, 4706, 14550, 13, 4706, 411, 1722, 29898, 2084, 29897, 408, 285, 29901, 13, 9651, 3497, 29934, 29922, 285, 29889, 949, 580, 13, 4706, 736, 3497, 29934, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2436, 29898, 1445, 29918, 2084, 29892, 726, 29922, 8516, 29892, 8513, 2433, 6506, 742, 2962, 2433, 29374, 13, 4706, 14550, 13, 4706, 2973, 445, 1158, 366, 508, 1735, 2793, 310, 278, 934, 29889, 259, 13, 4706, 934, 29901, 259, 3497, 366, 864, 304, 1735, 967, 2793, 29889, 13, 4706, 2793, 29901, 259, 10576, 366, 864, 304, 788, 304, 934, 29889, 13, 4706, 4464, 29901, 259, 5167, 310, 5007, 1158, 29889, 13, 632, 525, 29874, 29915, 470, 525, 19878, 29915, 363, 788, 2793, 304, 1095, 310, 278, 934, 29889, 29871, 13, 632, 525, 29893, 29915, 470, 525, 6506, 29915, 29871, 363, 975, 16554, 304, 934, 2793, 29889, 13, 4706, 1369, 29901, 306, 671, 445, 746, 306, 671, 4464, 2433, 19878, 29915, 13, 4706, 14550, 259, 13, 4706, 565, 4464, 1360, 29915, 6506, 2396, 13, 9651, 1015, 29922, 1722, 29898, 1445, 29918, 2084, 29892, 8513, 2433, 29893, 1495, 13, 9651, 565, 1426, 1360, 8516, 29901, 13, 18884, 1426, 29922, 1881, 877, 1542, 825, 366, 864, 7790, 29876, 29905, 29876, 1495, 13, 9651, 1015, 29889, 3539, 29898, 726, 29897, 13, 9651, 1015, 29889, 5358, 580, 13, 4706, 25342, 4464, 1360, 29915, 19878, 2396, 13, 9651, 14550, 459, 29878, 29922, 1722, 29898, 1445, 29892, 8513, 2433, 29878, 1495, 13, 9651, 3497, 29934, 29922, 288, 558, 29889, 949, 580, 13, 9651, 1015, 29922, 1722, 29898, 1445, 29892, 8513, 2433, 29893, 1495, 12008, 13, 9651, 1015, 29922, 3150, 29898, 1445, 29918, 2084, 5501, 29874, 1495, 13, 9651, 565, 1426, 1360, 8516, 29901, 13, 18884, 1426, 29922, 1881, 877, 1542, 825, 366, 864, 304, 788, 297, 278, 1095, 310, 278, 934, 7790, 29876, 29905, 29876, 1495, 13, 9651, 1015, 29889, 3539, 29898, 2962, 29974, 726, 29897, 13, 9651, 1015, 29889, 5358, 580, 29871, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 8513, 508, 871, 367, 29901, 5191, 29898, 4381, 29897, 470, 6773, 2216, 29850, 29900, 5038, 4286, 4830, 29898, 8513, 876, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 338, 3972, 29898, 2084, 1125, 13, 4706, 736, 2897, 29889, 2084, 29889, 275, 3972, 29898, 2084, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 338, 1445, 29898, 2084, 1125, 13, 4706, 736, 2897, 29889, 2084, 29889, 275, 1445, 29898, 2084, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 338, 29918, 949, 6194, 29898, 2084, 1125, 13, 4706, 14550, 13, 4706, 7106, 5852, 565, 2224, 338, 20623, 1683, 7700, 29889, 13, 4706, 313, 12703, 2216, 5244, 297, 8074, 29897, 13, 4706, 14550, 13, 4706, 736, 1014, 5014, 29889, 657, 4905, 29898, 29888, 29915, 3972, 847, 279, 426, 2084, 29913, 1405, 29876, 352, 29871, 29906, 29958, 29876, 352, 2607, 2916, 5852, 3830, 2916, 7700, 1495, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 338, 29918, 10892, 29898, 2084, 1125, 13, 4706, 9995, 13, 4706, 5399, 3692, 263, 934, 338, 2225, 21571, 7934, 29892, 2845, 1363, 13, 4706, 278, 2224, 978, 8665, 411, 8329, 470, 1363, 278, 7481, 13, 4706, 14088, 1316, 29889, 13, 4706, 7106, 5852, 565, 3497, 470, 18862, 338, 7934, 29889, 13, 4706, 313, 5531, 373, 1716, 8074, 322, 3852, 29897, 13, 4706, 9995, 13, 4706, 1053, 7481, 13, 4706, 2989, 29918, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 2084, 29897, 13, 4706, 1024, 353, 2897, 29889, 2084, 29889, 6500, 3871, 29898, 8159, 29918, 2084, 29897, 13, 4706, 822, 694, 29898, 2084, 1125, 736, 7700, 13, 4706, 7481, 29918, 10892, 353, 13149, 1338, 2141, 657, 877, 275, 29918, 10892, 29918, 29915, 718, 7481, 29889, 5205, 3285, 694, 29897, 13, 4706, 736, 1024, 29889, 27382, 2541, 12839, 1495, 470, 7481, 29918, 10892, 29898, 8159, 29918, 2084, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 338, 29918, 10892, 29918, 7685, 29898, 2084, 1125, 13, 4706, 1053, 274, 8768, 13, 4706, 620, 353, 274, 8768, 29889, 14800, 645, 29889, 17460, 29941, 29906, 29889, 2577, 2283, 15801, 29956, 29898, 2084, 29897, 13, 4706, 4974, 620, 2804, 448, 29896, 13, 4706, 736, 6120, 29898, 690, 669, 29871, 29906, 29897, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2740, 29918, 1445, 29898, 11037, 29892, 2224, 2433, 29889, 1966, 742, 2457, 29918, 8513, 29901, 2391, 1839, 1761, 3788, 27959, 2033, 29922, 525, 1761, 29374, 13, 4706, 14550, 13, 4706, 11856, 363, 2066, 297, 2224, 29889, 13, 4706, 7106, 1051, 470, 15299, 29889, 13, 4706, 4766, 29901, 13, 4706, 448, 29871, 525, 29916, 29889, 2272, 29915, 29871, 584, 1678, 2740, 363, 525, 29916, 29889, 2272, 29915, 297, 2224, 29889, 13, 4706, 448, 29871, 525, 10521, 2272, 29915, 29871, 584, 1678, 2740, 363, 599, 2066, 411, 869, 2272, 6081, 297, 2224, 29889, 13, 4706, 448, 29871, 525, 29930, 5575, 29915, 259, 584, 1678, 2740, 363, 599, 2066, 297, 2224, 13, 4706, 448, 29871, 525, 1068, 5515, 29915, 29871, 584, 1678, 2740, 363, 738, 934, 297, 2224, 322, 884, 599, 1014, 29899, 11851, 3842, 29889, 13, 4706, 448, 29871, 525, 1068, 5515, 29889, 2272, 29901, 1678, 2740, 363, 599, 3017, 2066, 297, 2224, 322, 884, 1014, 29899, 11851, 3842, 29889, 13, 4706, 448, 29871, 525, 1357, 3972, 7918, 5515, 29889, 2272, 29915, 259, 584, 1678, 2740, 363, 599, 3017, 2066, 297, 2224, 29914, 1357, 3972, 29914, 322, 599, 310, 967, 1014, 29899, 11851, 3842, 29889, 13, 4706, 14550, 13, 4706, 1053, 13149, 13, 4706, 565, 851, 29898, 2457, 29918, 8513, 467, 13609, 580, 297, 6702, 1761, 3788, 27959, 29374, 13, 9651, 565, 736, 29918, 8513, 1360, 29915, 1761, 2396, 736, 13149, 29889, 23705, 29898, 11037, 29892, 16732, 29922, 5574, 29897, 13, 9651, 1683, 29901, 736, 13149, 29889, 335, 2127, 29898, 11037, 29892, 16732, 29922, 5574, 29897, 13, 4706, 1683, 29901, 13, 9651, 565, 1134, 29898, 2457, 29918, 8513, 29897, 1360, 710, 29901, 13, 18884, 12020, 7865, 2392, 29898, 29888, 29908, 2457, 29918, 8513, 1109, 367, 29871, 525, 1761, 29915, 29871, 470, 29871, 525, 27959, 29915, 29871, 451, 426, 2457, 29918, 8513, 27195, 13, 9651, 1683, 29901, 13, 18884, 12020, 20948, 29898, 29888, 29908, 2457, 29918, 8513, 1134, 881, 367, 851, 322, 372, 881, 367, 297, 6024, 1761, 742, 525, 27959, 2033, 1159, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2740, 29918, 3051, 29898, 2084, 29892, 1742, 1125, 13, 4706, 15149, 29922, 518, 791, 363, 1014, 1761, 297, 5519, 359, 29889, 2084, 29889, 7122, 29898, 29875, 29961, 29900, 1402, 432, 29897, 363, 432, 297, 474, 29961, 29906, 5262, 363, 474, 297, 2897, 29889, 20919, 29898, 2084, 4638, 363, 659, 297, 1014, 1761, 29962, 13, 4706, 14550, 20155, 29922, 2636, 13, 4706, 363, 934, 297, 15149, 29901, 13, 9651, 565, 1734, 297, 364, 29916, 29889, 949, 29898, 1445, 1125, 13, 18884, 24471, 29889, 4397, 29898, 1445, 29897, 13, 4706, 736, 24471, 12008, 13, 4706, 736, 518, 1445, 363, 934, 297, 15149, 565, 1734, 297, 1722, 29898, 1445, 467, 949, 580, 29962, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 29356, 29898, 2084, 1125, 13, 4706, 2224, 353, 2897, 29889, 2084, 29889, 12324, 2084, 29898, 2084, 29897, 13, 4706, 29091, 29922, 6629, 13, 4706, 363, 24080, 297, 2224, 29889, 5451, 877, 1966, 29374, 13, 9651, 29091, 23661, 24080, 23097, 1966, 29915, 13, 9651, 1018, 29901, 2897, 29889, 11256, 3972, 29898, 28577, 29897, 13, 9651, 5174, 313, 2283, 24217, 2392, 29892, 2283, 17413, 2392, 1125, 1209, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 5706, 29918, 8336, 29898, 3972, 29918, 2084, 29892, 3233, 29901, 938, 10457, 29896, 29892, 4046, 29918, 517, 29918, 11851, 3842, 29901, 6120, 29922, 8824, 29892, 13, 9651, 3309, 29918, 13400, 29901, 938, 29922, 29896, 29900, 29900, 29900, 29892, 1596, 29918, 3888, 29901, 6120, 29922, 5574, 1125, 13, 4706, 9995, 29954, 5428, 263, 3884, 10802, 1203, 736, 263, 7604, 5447, 3829, 15945, 29908, 13, 4706, 515, 2224, 1982, 1053, 10802, 13, 4706, 515, 4256, 8504, 1053, 338, 5897, 13, 4706, 2913, 29922, 525, 1678, 21921, 5443, 353, 525, 30111, 259, 21921, 734, 29872, 29922, 525, 28427, 21921, 1833, 29922, 525, 30227, 8539, 525, 13, 4706, 4516, 29918, 2084, 353, 10802, 29898, 3972, 29918, 2084, 29897, 396, 3544, 1347, 1302, 261, 346, 519, 304, 10802, 13, 4706, 2066, 353, 29871, 29900, 13, 4706, 17525, 353, 29871, 29900, 13, 4706, 822, 6426, 29898, 3972, 29918, 2084, 29901, 10802, 29892, 10944, 29901, 851, 2433, 742, 3233, 10457, 29896, 1125, 13, 9651, 1661, 2997, 2066, 29892, 17525, 13, 9651, 565, 451, 3233, 29901, 29871, 736, 396, 29871, 29900, 29892, 5040, 4256, 1218, 13, 9651, 565, 4046, 29918, 517, 29918, 11851, 3842, 29901, 8118, 353, 518, 29881, 363, 270, 297, 4516, 29918, 2084, 29889, 1524, 3972, 580, 565, 270, 29889, 275, 29918, 3972, 580, 29962, 13, 9651, 1683, 29901, 29871, 8118, 353, 1051, 29898, 3972, 29918, 2084, 29889, 1524, 3972, 3101, 13, 9651, 12589, 353, 518, 371, 29872, 29962, 334, 313, 2435, 29898, 10853, 29897, 448, 29871, 29896, 29897, 718, 518, 4230, 29962, 13, 9651, 363, 4879, 29892, 2224, 297, 14319, 29898, 17226, 29879, 29892, 8118, 1125, 13, 18884, 565, 2224, 29889, 275, 29918, 3972, 7295, 13, 462, 1678, 7709, 10944, 718, 4879, 718, 2224, 29889, 978, 13, 462, 1678, 17525, 4619, 29871, 29896, 13, 462, 1678, 6081, 353, 5443, 565, 4879, 1275, 734, 29872, 1683, 2913, 29871, 13, 462, 1678, 7709, 515, 6426, 29898, 2084, 29892, 10944, 29922, 13506, 29974, 17588, 29892, 3233, 29922, 5563, 29899, 29896, 29897, 13, 18884, 25342, 451, 4046, 29918, 517, 29918, 11851, 3842, 29901, 13, 462, 1678, 7709, 10944, 718, 4879, 718, 2224, 29889, 978, 13, 462, 1678, 2066, 4619, 29871, 29896, 13, 4706, 28081, 24015, 2433, 29915, 13, 4706, 28081, 24015, 23661, 3972, 29918, 2084, 29889, 978, 29974, 12764, 29876, 29915, 13, 4706, 20380, 353, 6426, 29898, 3972, 29918, 2084, 29892, 3233, 29922, 5563, 29897, 13, 4706, 363, 1196, 297, 338, 5897, 29898, 17609, 29892, 3309, 29918, 13400, 1125, 28081, 24015, 23661, 1220, 29974, 12764, 29876, 29915, 13, 4706, 565, 2446, 29898, 17609, 29892, 6213, 1125, 28081, 24015, 23661, 29888, 29915, 856, 3309, 29918, 13400, 29892, 426, 2848, 29918, 13400, 1118, 7450, 29892, 29115, 11283, 13, 4706, 565, 1596, 29918, 3888, 29901, 28081, 24015, 23661, 29888, 12764, 29876, 29912, 11851, 3842, 29913, 17525, 29915, 718, 313, 29888, 742, 426, 5325, 29913, 2066, 29915, 565, 2066, 1683, 27255, 13, 4706, 736, 28081, 24015, 13, 13, 1678, 770, 22986, 9486, 23598, 29901, 13, 4706, 732, 7959, 5696, 13, 4706, 822, 599, 29918, 735, 627, 3972, 29898, 3972, 1125, 13, 9651, 736, 2897, 29889, 1761, 3972, 29898, 3972, 29897, 13, 4706, 732, 7959, 5696, 13, 4706, 822, 599, 29918, 497, 29918, 19570, 29898, 3972, 1125, 13, 9651, 736, 518, 29875, 363, 474, 297, 2897, 29889, 20919, 29898, 3972, 4638, 13, 4706, 732, 7959, 5696, 13, 4706, 822, 2066, 29918, 735, 627, 3972, 29898, 3972, 1125, 13, 9651, 736, 518, 29875, 363, 474, 297, 2897, 29889, 20919, 29898, 3972, 29897, 3816, 29900, 3816, 29906, 29962, 13, 4706, 732, 7959, 5696, 13, 4706, 822, 2066, 29918, 497, 29898, 3972, 1125, 13, 9651, 736, 518, 791, 363, 1014, 1761, 297, 5519, 359, 29889, 2084, 29889, 7122, 29898, 29875, 29961, 29900, 1402, 432, 29897, 363, 432, 297, 474, 29961, 29906, 5262, 363, 474, 297, 2897, 29889, 20919, 29898, 3972, 4638, 363, 659, 297, 1014, 1761, 29962, 13, 4706, 732, 7959, 5696, 13, 4706, 822, 2066, 29918, 497, 29918, 19570, 29898, 3972, 1125, 13, 9651, 736, 5519, 359, 29889, 2084, 29889, 7122, 29898, 29875, 29961, 29900, 1402, 432, 29897, 363, 432, 297, 474, 29961, 29906, 5262, 363, 474, 297, 2897, 29889, 20919, 29898, 3972, 4638, 13, 4706, 732, 7959, 5696, 13, 4706, 822, 4516, 29879, 29918, 735, 627, 3972, 29898, 3972, 1125, 13, 9651, 736, 12705, 4197, 29875, 363, 474, 297, 2897, 29889, 1761, 3972, 29898, 3972, 29897, 565, 474, 451, 297, 518, 29875, 363, 474, 297, 2897, 29889, 20919, 29898, 3972, 29897, 3816, 29900, 3816, 29906, 24960, 13, 4706, 732, 7959, 5696, 13, 4706, 822, 4516, 29879, 29918, 497, 29898, 3972, 1125, 13, 9651, 736, 518, 3557, 29931, 29961, 29900, 29962, 363, 323, 7390, 297, 518, 29875, 363, 474, 297, 2897, 29889, 20919, 29898, 3972, 4638, 29962, 13, 13, 2 ]
Algorithms/Searching & Sorting/Exponential Search/exponential_search.py
strangestroad/interview-techdev-guide
320
161565
''' Implementation of exponential search Time Complexity: O(logn) Space Complexity: Depends on implementation of binary_search {O(logn): recursive, O(1):iterative} Used for unbounded search, when the length of array is infinite or not known ''' #iterative implementation of binary search def binary_search(arr, s, e, x): ''' #arr: the array in which we need to find an element (sorted, increasing order) #s: start index #e: end index #x: element we are looking for ''' #search until arr becomes empty [] while (e>=s): m = s + int((e-s)/2) #middle index if x==arr[m]: #if found at mid return index return m elif x>arr[m]: #if x>arr[m] search only in the right array s = m+1 elif x<arr[m]: #if x<arr[m] search only in the left array e = m-1 return -1 def exponential_search(arr, n, x): if x==arr[0]: return 0; i=1 #index #keep increasing index until the indexed element is smaller and then do binary search while i<n and x>arr[i]: i = i*2 return binary_search(arr, int(i/2), min(i, n), x) arr = [2,3,4,10,40] x = 10 index = exponential_search(arr, len(arr), x) if index==-1: print("Element not present in list") else: print("Element",x,"is present at",index)
[ 1, 14550, 13, 1888, 14607, 310, 25658, 2740, 13, 2481, 26596, 537, 29901, 438, 29898, 1188, 29876, 29897, 13, 14936, 26596, 537, 29901, 10034, 1975, 373, 5314, 310, 7581, 29918, 4478, 426, 29949, 29898, 1188, 29876, 1125, 16732, 29892, 438, 29898, 29896, 1125, 1524, 1230, 29913, 13, 13, 29965, 8485, 363, 443, 29306, 2740, 29892, 746, 278, 3309, 310, 1409, 338, 10362, 470, 451, 2998, 13, 12008, 13, 13, 29937, 1524, 1230, 5314, 310, 7581, 2740, 13, 1753, 7581, 29918, 4478, 29898, 2749, 29892, 269, 29892, 321, 29892, 921, 1125, 13, 1678, 14550, 13, 1678, 396, 2749, 29901, 278, 1409, 297, 607, 591, 817, 304, 1284, 385, 1543, 313, 24582, 29892, 10231, 1797, 29897, 13, 1678, 396, 29879, 29901, 1369, 2380, 13, 1678, 396, 29872, 29901, 1095, 2380, 13, 1678, 396, 29916, 29901, 1543, 591, 526, 3063, 363, 13, 1678, 14550, 13, 1678, 396, 4478, 2745, 3948, 7415, 4069, 5159, 13, 1678, 1550, 313, 29872, 18572, 29879, 1125, 13, 4706, 286, 353, 269, 718, 938, 3552, 29872, 29899, 29879, 6802, 29906, 29897, 396, 17662, 2380, 13, 13, 4706, 565, 921, 1360, 2749, 29961, 29885, 5387, 396, 361, 1476, 472, 7145, 736, 2380, 13, 9651, 736, 286, 13, 4706, 25342, 921, 29958, 2749, 29961, 29885, 5387, 396, 361, 921, 29958, 2749, 29961, 29885, 29962, 2740, 871, 297, 278, 1492, 1409, 13, 9651, 269, 353, 286, 29974, 29896, 13, 4706, 25342, 921, 29966, 2749, 29961, 29885, 5387, 396, 361, 921, 29966, 2749, 29961, 29885, 29962, 2740, 871, 297, 278, 2175, 1409, 13, 9651, 321, 353, 286, 29899, 29896, 13, 13, 1678, 736, 448, 29896, 13, 13, 1753, 25658, 29918, 4478, 29898, 2749, 29892, 302, 29892, 921, 1125, 13, 1678, 565, 921, 1360, 2749, 29961, 29900, 5387, 13, 4706, 736, 29871, 29900, 29936, 13, 13, 1678, 474, 29922, 29896, 396, 2248, 13, 1678, 396, 17462, 10231, 2380, 2745, 278, 27541, 1543, 338, 7968, 322, 769, 437, 7581, 2740, 13, 1678, 1550, 474, 29966, 29876, 322, 921, 29958, 2749, 29961, 29875, 5387, 13, 4706, 474, 353, 474, 29930, 29906, 13, 13, 1678, 736, 7581, 29918, 4478, 29898, 2749, 29892, 938, 29898, 29875, 29914, 29906, 511, 1375, 29898, 29875, 29892, 302, 511, 921, 29897, 13, 13, 2749, 353, 518, 29906, 29892, 29941, 29892, 29946, 29892, 29896, 29900, 29892, 29946, 29900, 29962, 13, 29916, 353, 29871, 29896, 29900, 13, 13, 2248, 353, 25658, 29918, 4478, 29898, 2749, 29892, 7431, 29898, 2749, 511, 921, 29897, 13, 361, 2380, 1360, 29899, 29896, 29901, 13, 1678, 1596, 703, 2642, 451, 2198, 297, 1051, 1159, 13, 2870, 29901, 13, 1678, 1596, 703, 2642, 613, 29916, 1699, 275, 2198, 472, 613, 2248, 29897, 13, 2 ]
utils/utils.py
miltonbd/mcs_2018_adversarial_attack
14
94789
<filename>utils/utils.py from skimage.measure import compare_ssim import numpy as np def get_ssim(original_img,changed_img): ssim = compare_ssim(np.array(original_img, dtype=np.float32), np.array(changed_img, dtype=np.float32), multichannel=True) return ssim
[ 1, 529, 9507, 29958, 13239, 29914, 13239, 29889, 2272, 13, 3166, 2071, 3027, 29889, 26658, 1053, 7252, 29918, 893, 326, 13, 5215, 12655, 408, 7442, 13, 13, 1753, 679, 29918, 893, 326, 29898, 13492, 29918, 2492, 29892, 15033, 29918, 2492, 1125, 13, 1678, 269, 3601, 353, 7252, 29918, 893, 326, 29898, 9302, 29889, 2378, 29898, 13492, 29918, 2492, 29892, 26688, 29922, 9302, 29889, 7411, 29941, 29906, 511, 13, 462, 4706, 7442, 29889, 2378, 29898, 15033, 29918, 2492, 29892, 26688, 29922, 9302, 29889, 7411, 29941, 29906, 511, 13, 462, 4706, 1773, 436, 4143, 29922, 5574, 29897, 13, 1678, 736, 269, 3601, 2 ]
versus/models.py
amin-da71/Benbb96
0
108016
<filename>versus/models.py from autoslug import AutoSlugField from django.db import models from django.urls import reverse from django.utils import timezone from django.utils.functional import cached_property from base.models import Profil class Joueur(models.Model): nom = models.CharField(max_length=100) slug = AutoSlugField(unique=True, populate_from='nom') profil = models.OneToOneField(Profil, on_delete=models.SET_NULL, null=True, blank=True) date_creation = models.DateTimeField(verbose_name="date d'ajout", auto_now_add=True) class Meta: ordering = ('nom',) def __str__(self): return self.nom def get_absolute_url(self): return reverse('versus:detail-joueur', kwargs={'slug': self.slug}) @cached_property def nb_victoire(self): nb = 0 for partiejoueur in self.partiejoueur_set.all(): if self in partiejoueur.partie.winners: nb += 1 return nb @property def ratio(self): if self.partiejoueur_set.exists(): return round(self.nb_victoire / self.partiejoueur_set.count() * 100) return None class Jeu(models.Model): nom = models.CharField(max_length=100) slug = models.SlugField(unique=True) createur = models.ForeignKey(Profil, on_delete=models.SET_NULL, null=True, blank=True) date_creation = models.DateTimeField(verbose_name="date d'ajout", auto_now_add=True) image = models.ImageField( help_text="Une image/photo pour identifier le jeu", null=True, blank=True, upload_to="jeux/" ) SCORE = 1 SCORE_INVERSE = 2 CLASSEMENT = 3 TYPES = ( (SCORE, 'Score'), (SCORE_INVERSE, 'Score inverse'), (CLASSEMENT, 'Classement'), ) type = models.PositiveSmallIntegerField( choices=TYPES, default=SCORE, help_text="Sélectionner le type de jeu qui déterminera la façon de choisir le gagnant." ) class Meta: verbose_name_plural = 'jeux' def __str__(self): return self.nom def get_absolute_url(self): return reverse('versus:detail-jeu', kwargs={'slug': self.slug}) def top_players(self): player_scores = {} for partie in self.parties.all(): for joueur in partie.winners: if joueur not in player_scores.keys(): player_scores[joueur] = 1 else: player_scores[joueur] += 1 # Tri des joueurspar nombre de parties gagnées player_scores = {k: v for k, v in sorted(player_scores.items(), key=lambda item: item[1], reverse=True)} top_players = [] i = 1 last_nb = None for joueur, nb in player_scores.items(): # Incrémente la position si le nombre de victoire est plus bas if last_nb and last_nb > nb: i += 1 top_players.append((i, joueur, nb)) last_nb = nb return top_players class Partie(models.Model): jeu = models.ForeignKey(Jeu, on_delete=models.CASCADE, related_name='parties') date = models.DateTimeField(default=timezone.now) joueurs = models.ManyToManyField(Joueur, through='PartieJoueur') class Meta: ordering = ('-date',) def __str__(self): return '%s (%s)' % (self.jeu, self.date) def classement_joueur(self): """ Retourne la liste des joueurs dans l'ordre de leur classement""" if self.jeu.type == Jeu.SCORE: return self.partiejoueur_set.order_by('-score_classement') return self.partiejoueur_set.order_by('score_classement') @cached_property def winners(self): """ Retourne le ou les gagnants de cette partie """ if self.jeu.type == self.jeu.CLASSEMENT: # On veut la ou les personnes arrivées en première place return Joueur.objects.filter(partiejoueur__partie=self, partiejoueur__score_classement=1) else: if self.jeu.type == self.jeu.SCORE: # On cherche le score maximum valeur = max(partiejoueur.score_classement for partiejoueur in self.partiejoueur_set.all()) else: # On cherche le score minimum valeur = min(partiejoueur.score_classement for partiejoueur in self.partiejoueur_set.all()) # Puis on retourne tous les joueurs ayant ce score return Joueur.objects.filter(partiejoueur__partie=self, partiejoueur__score_classement=valeur) class PartieJoueur(models.Model): partie = models.ForeignKey(Partie, on_delete=models.CASCADE) joueur = models.ForeignKey(Joueur, on_delete=models.CASCADE) score_classement = models.PositiveSmallIntegerField('score ou classement') class Meta: unique_together = (('partie', 'joueur'),)
[ 1, 529, 9507, 29958, 874, 375, 29914, 9794, 29889, 2272, 13, 3166, 1120, 359, 29880, 688, 1053, 11133, 16973, 688, 3073, 13, 3166, 9557, 29889, 2585, 1053, 4733, 13, 3166, 9557, 29889, 26045, 1053, 11837, 13, 3166, 9557, 29889, 13239, 1053, 29431, 13, 3166, 9557, 29889, 13239, 29889, 2220, 284, 1053, 22152, 29918, 6799, 13, 13, 3166, 2967, 29889, 9794, 1053, 23202, 13, 13, 13, 1990, 435, 283, 5411, 29898, 9794, 29889, 3195, 1125, 13, 1678, 2245, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29897, 13, 1678, 2243, 688, 353, 11133, 16973, 688, 3073, 29898, 13092, 29922, 5574, 29892, 19450, 29918, 3166, 2433, 11522, 1495, 13, 1678, 20077, 353, 4733, 29889, 6716, 1762, 6716, 3073, 29898, 1184, 1777, 29892, 373, 29918, 8143, 29922, 9794, 29889, 10490, 29918, 10074, 29892, 1870, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 2635, 29918, 1037, 362, 353, 4733, 29889, 11384, 3073, 29898, 369, 15828, 29918, 978, 543, 1256, 270, 29915, 1175, 449, 613, 4469, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 20520, 353, 6702, 11522, 742, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 11522, 13, 13, 1678, 822, 679, 29918, 23552, 29918, 2271, 29898, 1311, 1125, 13, 4706, 736, 11837, 877, 874, 375, 29901, 16432, 29899, 20551, 5411, 742, 9049, 5085, 3790, 29915, 29517, 2396, 1583, 29889, 29517, 1800, 13, 13, 1678, 732, 29883, 3791, 29918, 6799, 13, 1678, 822, 302, 29890, 29918, 26311, 18734, 29898, 1311, 1125, 13, 4706, 302, 29890, 353, 29871, 29900, 13, 4706, 363, 760, 8586, 283, 5411, 297, 1583, 29889, 1595, 8586, 283, 5411, 29918, 842, 29889, 497, 7295, 13, 9651, 565, 1583, 297, 760, 8586, 283, 5411, 29889, 1595, 347, 29889, 29893, 16697, 29901, 13, 18884, 302, 29890, 4619, 29871, 29896, 13, 4706, 736, 302, 29890, 13, 13, 1678, 732, 6799, 13, 1678, 822, 11959, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 1595, 8586, 283, 5411, 29918, 842, 29889, 9933, 7295, 13, 9651, 736, 4513, 29898, 1311, 29889, 9877, 29918, 26311, 18734, 847, 1583, 29889, 1595, 8586, 283, 5411, 29918, 842, 29889, 2798, 580, 334, 29871, 29896, 29900, 29900, 29897, 13, 4706, 736, 6213, 13, 13, 13, 1990, 2581, 29884, 29898, 9794, 29889, 3195, 1125, 13, 1678, 2245, 353, 4733, 29889, 27890, 29898, 3317, 29918, 2848, 29922, 29896, 29900, 29900, 29897, 13, 1678, 2243, 688, 353, 4733, 29889, 16973, 688, 3073, 29898, 13092, 29922, 5574, 29897, 13, 1678, 1653, 332, 353, 4733, 29889, 27755, 2558, 29898, 1184, 1777, 29892, 373, 29918, 8143, 29922, 9794, 29889, 10490, 29918, 10074, 29892, 1870, 29922, 5574, 29892, 9654, 29922, 5574, 29897, 13, 1678, 2635, 29918, 1037, 362, 353, 4733, 29889, 11384, 3073, 29898, 369, 15828, 29918, 978, 543, 1256, 270, 29915, 1175, 449, 613, 4469, 29918, 3707, 29918, 1202, 29922, 5574, 29897, 13, 1678, 1967, 353, 4733, 29889, 2940, 3073, 29898, 13, 4706, 1371, 29918, 726, 543, 29965, 484, 1967, 29914, 21596, 1671, 15882, 454, 18308, 613, 13, 4706, 1870, 29922, 5574, 29892, 9654, 29922, 5574, 29892, 6441, 29918, 517, 543, 1324, 1314, 12975, 13, 1678, 1723, 13, 1678, 317, 3217, 1525, 353, 29871, 29896, 13, 1678, 317, 3217, 1525, 29918, 1177, 5348, 1660, 353, 29871, 29906, 13, 1678, 17332, 3289, 1660, 13780, 353, 29871, 29941, 13, 1678, 323, 29979, 29925, 2890, 353, 313, 13, 4706, 313, 29903, 3217, 1525, 29892, 525, 20097, 5477, 13, 4706, 313, 29903, 3217, 1525, 29918, 1177, 5348, 1660, 29892, 525, 20097, 16402, 5477, 13, 4706, 313, 6154, 3289, 1660, 13780, 29892, 525, 2385, 882, 5477, 13, 1678, 1723, 13, 1678, 1134, 353, 4733, 29889, 9135, 3321, 12636, 497, 7798, 3073, 29898, 13, 4706, 19995, 29922, 15631, 29925, 2890, 29892, 13, 4706, 2322, 29922, 29903, 3217, 1525, 29892, 13, 4706, 1371, 29918, 726, 543, 29903, 29948, 1464, 1089, 454, 1134, 316, 18308, 1750, 1437, 18821, 1572, 425, 2258, 15529, 316, 3060, 275, 381, 454, 330, 4211, 424, 1213, 13, 1678, 1723, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 26952, 29918, 978, 29918, 572, 3631, 353, 525, 1324, 1314, 29915, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 1583, 29889, 11522, 13, 13, 1678, 822, 679, 29918, 23552, 29918, 2271, 29898, 1311, 1125, 13, 4706, 736, 11837, 877, 874, 375, 29901, 16432, 29899, 1324, 29884, 742, 9049, 5085, 3790, 29915, 29517, 2396, 1583, 29889, 29517, 1800, 13, 13, 1678, 822, 2246, 29918, 1456, 414, 29898, 1311, 1125, 13, 4706, 4847, 29918, 1557, 2361, 353, 6571, 13, 4706, 363, 8691, 297, 1583, 29889, 1595, 583, 29889, 497, 7295, 13, 9651, 363, 23009, 297, 8691, 29889, 29893, 16697, 29901, 13, 18884, 565, 23009, 451, 297, 4847, 29918, 1557, 2361, 29889, 8149, 7295, 13, 462, 1678, 4847, 29918, 1557, 2361, 29961, 20551, 5411, 29962, 353, 29871, 29896, 13, 18884, 1683, 29901, 13, 462, 1678, 4847, 29918, 1557, 2361, 29961, 20551, 5411, 29962, 4619, 29871, 29896, 13, 4706, 396, 8602, 553, 8121, 11620, 862, 5419, 316, 13973, 330, 4211, 2406, 13, 4706, 4847, 29918, 1557, 2361, 353, 426, 29895, 29901, 325, 363, 413, 29892, 325, 297, 12705, 29898, 9106, 29918, 1557, 2361, 29889, 7076, 3285, 1820, 29922, 2892, 2944, 29901, 2944, 29961, 29896, 1402, 11837, 29922, 5574, 2915, 13, 13, 4706, 2246, 29918, 1456, 414, 353, 5159, 13, 4706, 474, 353, 29871, 29896, 13, 4706, 1833, 29918, 9877, 353, 6213, 13, 4706, 363, 23009, 29892, 302, 29890, 297, 4847, 29918, 1557, 2361, 29889, 7076, 7295, 13, 9651, 396, 9266, 5606, 2689, 425, 2602, 1354, 454, 5419, 316, 9467, 18734, 707, 2298, 2362, 13, 9651, 565, 1833, 29918, 9877, 322, 1833, 29918, 9877, 1405, 302, 29890, 29901, 13, 18884, 474, 4619, 29871, 29896, 13, 9651, 2246, 29918, 1456, 414, 29889, 4397, 3552, 29875, 29892, 23009, 29892, 302, 29890, 876, 13, 9651, 1833, 29918, 9877, 353, 302, 29890, 13, 13, 4706, 736, 2246, 29918, 1456, 414, 13, 13, 13, 1990, 3455, 347, 29898, 9794, 29889, 3195, 1125, 13, 1678, 18308, 353, 4733, 29889, 27755, 2558, 29898, 29967, 12932, 29892, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29892, 4475, 29918, 978, 2433, 1595, 583, 1495, 13, 1678, 2635, 353, 4733, 29889, 11384, 3073, 29898, 4381, 29922, 2230, 8028, 29889, 3707, 29897, 13, 1678, 8121, 11620, 353, 4733, 29889, 14804, 1762, 14804, 3073, 29898, 29967, 283, 5411, 29892, 1549, 2433, 7439, 347, 29967, 283, 5411, 1495, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 20520, 353, 6702, 29899, 1256, 742, 29897, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 14210, 29879, 313, 29995, 29879, 16029, 1273, 313, 1311, 29889, 1324, 29884, 29892, 1583, 29889, 1256, 29897, 13, 13, 1678, 822, 770, 882, 29918, 20551, 5411, 29898, 1311, 1125, 13, 4706, 9995, 4649, 473, 484, 425, 13773, 553, 8121, 11620, 1465, 301, 29915, 19809, 316, 6267, 770, 882, 15945, 29908, 13, 4706, 565, 1583, 29889, 1324, 29884, 29889, 1853, 1275, 2581, 29884, 29889, 29903, 3217, 1525, 29901, 13, 9651, 736, 1583, 29889, 1595, 8586, 283, 5411, 29918, 842, 29889, 2098, 29918, 1609, 877, 29899, 13628, 29918, 1990, 882, 1495, 13, 4706, 736, 1583, 29889, 1595, 8586, 283, 5411, 29918, 842, 29889, 2098, 29918, 1609, 877, 13628, 29918, 1990, 882, 1495, 13, 13, 1678, 732, 29883, 3791, 29918, 6799, 13, 1678, 822, 281, 16697, 29898, 1311, 1125, 13, 4706, 9995, 4649, 473, 484, 454, 2123, 966, 330, 4211, 1934, 316, 5278, 8691, 9995, 13, 4706, 565, 1583, 29889, 1324, 29884, 29889, 1853, 1275, 1583, 29889, 1324, 29884, 29889, 6154, 3289, 1660, 13780, 29901, 13, 9651, 396, 1551, 2453, 329, 425, 2123, 966, 18554, 6974, 2406, 427, 8861, 2058, 13, 9651, 736, 435, 283, 5411, 29889, 12650, 29889, 4572, 29898, 1595, 8586, 283, 5411, 1649, 1595, 347, 29922, 1311, 29892, 760, 8586, 283, 5411, 1649, 13628, 29918, 1990, 882, 29922, 29896, 29897, 13, 4706, 1683, 29901, 13, 9651, 565, 1583, 29889, 1324, 29884, 29889, 1853, 1275, 1583, 29889, 1324, 29884, 29889, 29903, 3217, 1525, 29901, 13, 18884, 396, 1551, 14954, 1173, 454, 8158, 7472, 13, 18884, 20368, 332, 353, 4236, 29898, 1595, 8586, 283, 5411, 29889, 13628, 29918, 1990, 882, 363, 760, 8586, 283, 5411, 297, 1583, 29889, 1595, 8586, 283, 5411, 29918, 842, 29889, 497, 3101, 13, 9651, 1683, 29901, 13, 18884, 396, 1551, 14954, 1173, 454, 8158, 9212, 13, 18884, 20368, 332, 353, 1375, 29898, 1595, 8586, 283, 5411, 29889, 13628, 29918, 1990, 882, 363, 760, 8586, 283, 5411, 297, 1583, 29889, 1595, 8586, 283, 5411, 29918, 842, 29889, 497, 3101, 13, 9651, 396, 349, 4664, 373, 18948, 484, 9411, 966, 8121, 11620, 17748, 2257, 8158, 13, 9651, 736, 435, 283, 5411, 29889, 12650, 29889, 4572, 29898, 1595, 8586, 283, 5411, 1649, 1595, 347, 29922, 1311, 29892, 760, 8586, 283, 5411, 1649, 13628, 29918, 1990, 882, 29922, 29894, 744, 332, 29897, 13, 13, 13, 1990, 3455, 347, 29967, 283, 5411, 29898, 9794, 29889, 3195, 1125, 13, 1678, 8691, 353, 4733, 29889, 27755, 2558, 29898, 7439, 347, 29892, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29897, 13, 1678, 23009, 353, 4733, 29889, 27755, 2558, 29898, 29967, 283, 5411, 29892, 373, 29918, 8143, 29922, 9794, 29889, 29907, 3289, 5454, 2287, 29897, 13, 1678, 8158, 29918, 1990, 882, 353, 4733, 29889, 9135, 3321, 12636, 497, 7798, 3073, 877, 13628, 2123, 770, 882, 1495, 13, 13, 1678, 770, 20553, 29901, 13, 4706, 5412, 29918, 29873, 12966, 353, 313, 877, 1595, 347, 742, 525, 20551, 5411, 5477, 29897, 13, 2 ]
4. PruningEncodingandRescalingFeatures/9. hc2.py
michaelbwalker/Data-Cleaning-and-Exploration-with-Machine-Learning
7
128316
# import pandas, numpy, and matplotlib import pandas as pd from feature_engine.encoding import OneHotEncoder from category_encoders.hashing import HashingEncoder from sklearn.model_selection import train_test_split pd.set_option('display.width', 200) pd.set_option('display.max_columns', 20) pd.set_option('display.max_rows', 200) pd.options.display.float_format = '{:,.0f}'.format covidtotals = pd.read_csv("data/covidtotals.csv") feature_cols = ['location','population', 'aged_65_older','diabetes_prevalence','region'] covidtotals = covidtotals[['total_cases'] + feature_cols].dropna() # Separate into train and test sets X_train, X_test, y_train, y_test = \ train_test_split(covidtotals[feature_cols],\ covidtotals[['total_cases']], test_size=0.3, random_state=0) # use the one hot encoder for region X_train.region.value_counts() ohe = OneHotEncoder(top_categories=6, variables=['region']) covidtotals_ohe = ohe.fit_transform(covidtotals) covidtotals_ohe.filter(regex='location|region', axis="columns").sample(5, random_state=99).T # use the hashing encoder for region he = HashingEncoder(cols=['region'], n_components=16) covidtotals['region2'] = covidtotals.region covidtotals_enc = he.fit_transform(covidtotals) covidtotals_enc.filter(regex='col|reg', axis="columns") covidtotals_enc.groupby(['col_0','col_1','col_2','col_3','col_4','col_5','col_6','col_7','col_8','col_9','col_10','col_11','col_12','col_13','col_14','col_15','region2']).size().reset_index()
[ 1, 396, 1053, 11701, 29892, 12655, 29892, 322, 22889, 13, 5215, 11701, 408, 10518, 13, 3166, 4682, 29918, 10599, 29889, 22331, 1053, 3118, 28917, 8566, 6119, 13, 3166, 7663, 29918, 3977, 397, 414, 29889, 8568, 292, 1053, 11874, 292, 8566, 6119, 13, 3166, 2071, 19668, 29889, 4299, 29918, 21731, 1053, 7945, 29918, 1688, 29918, 5451, 13, 15926, 29889, 842, 29918, 3385, 877, 4990, 29889, 2103, 742, 29871, 29906, 29900, 29900, 29897, 13, 15926, 29889, 842, 29918, 3385, 877, 4990, 29889, 3317, 29918, 13099, 742, 29871, 29906, 29900, 29897, 13, 15926, 29889, 842, 29918, 3385, 877, 4990, 29889, 3317, 29918, 5727, 742, 29871, 29906, 29900, 29900, 29897, 13, 15926, 29889, 6768, 29889, 4990, 29889, 7411, 29918, 4830, 353, 22372, 29901, 7671, 29900, 29888, 29913, 4286, 4830, 13, 13, 24542, 333, 4260, 1338, 353, 10518, 29889, 949, 29918, 7638, 703, 1272, 29914, 24542, 333, 4260, 1338, 29889, 7638, 1159, 13, 14394, 29918, 22724, 353, 6024, 5479, 3788, 7323, 2785, 742, 13, 1678, 525, 4063, 29918, 29953, 29945, 29918, 3194, 3788, 6051, 370, 10778, 29918, 1457, 791, 663, 3788, 12803, 2033, 13, 24542, 333, 4260, 1338, 353, 18838, 333, 4260, 1338, 29961, 1839, 7827, 29918, 11436, 2033, 718, 4682, 29918, 22724, 1822, 8865, 1056, 580, 13, 13, 29937, 922, 862, 403, 964, 7945, 322, 1243, 6166, 13, 29990, 29918, 14968, 29892, 1060, 29918, 1688, 29892, 343, 29918, 14968, 29892, 343, 29918, 1688, 353, 29871, 320, 13, 29871, 7945, 29918, 1688, 29918, 5451, 29898, 24542, 333, 4260, 1338, 29961, 14394, 29918, 22724, 1402, 29905, 13, 29871, 18838, 333, 4260, 1338, 29961, 1839, 7827, 29918, 11436, 2033, 1402, 1243, 29918, 2311, 29922, 29900, 29889, 29941, 29892, 4036, 29918, 3859, 29922, 29900, 29897, 13, 13, 29937, 671, 278, 697, 7375, 2094, 6119, 363, 5120, 13, 29990, 29918, 14968, 29889, 12803, 29889, 1767, 29918, 2798, 29879, 580, 13, 29877, 354, 353, 3118, 28917, 8566, 6119, 29898, 3332, 29918, 20683, 29922, 29953, 29892, 3651, 29922, 1839, 12803, 11287, 13, 24542, 333, 4260, 1338, 29918, 29877, 354, 353, 288, 354, 29889, 9202, 29918, 9067, 29898, 24542, 333, 4260, 1338, 29897, 13, 24542, 333, 4260, 1338, 29918, 29877, 354, 29889, 4572, 29898, 13087, 2433, 5479, 29989, 12803, 742, 13, 29871, 9685, 543, 13099, 2564, 11249, 29898, 29945, 29892, 4036, 29918, 3859, 29922, 29929, 29929, 467, 29911, 13, 13, 29937, 671, 278, 756, 2790, 2094, 6119, 363, 5120, 13, 354, 353, 11874, 292, 8566, 6119, 29898, 22724, 29922, 1839, 12803, 7464, 302, 29918, 14036, 29922, 29896, 29953, 29897, 13, 24542, 333, 4260, 1338, 1839, 12803, 29906, 2033, 353, 18838, 333, 4260, 1338, 29889, 12803, 13, 24542, 333, 4260, 1338, 29918, 3977, 353, 540, 29889, 9202, 29918, 9067, 29898, 24542, 333, 4260, 1338, 29897, 13, 13, 24542, 333, 4260, 1338, 29918, 3977, 29889, 4572, 29898, 13087, 2433, 1054, 29989, 1727, 742, 9685, 543, 13099, 1159, 13, 24542, 333, 4260, 1338, 29918, 3977, 29889, 27789, 18959, 1054, 29918, 29900, 3788, 1054, 29918, 29896, 3788, 1054, 29918, 29906, 3788, 1054, 29918, 29941, 3788, 1054, 29918, 29946, 3788, 1054, 29918, 29945, 3788, 1054, 29918, 29953, 3788, 1054, 29918, 29955, 3788, 1054, 29918, 29947, 3788, 1054, 29918, 29929, 3788, 1054, 29918, 29896, 29900, 3788, 1054, 29918, 29896, 29896, 3788, 1054, 29918, 29896, 29906, 3788, 1054, 29918, 29896, 29941, 3788, 1054, 29918, 29896, 29946, 3788, 1054, 29918, 29896, 29945, 3788, 12803, 29906, 2033, 467, 2311, 2141, 12071, 29918, 2248, 580, 13, 13, 2 ]
pyzombie/handlers/HandlerInstance.py
lanhel/pyzombie
0
117643
#!/usr/bin/env python # -*- coding: UTF-8 -*- #------------------------------------------------------------------------------- """pyzombie HTTP RESTful server handler returning the representation of an executable.""" __author__ = ('<NAME>',) __version__ = '1.0.1' __copyright__ = """Copyright 2009 <NAME> (<EMAIL>)""" __license__ = """ 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. """ __docformat__ = "reStructuredText en" __all__ = ['HandlerInstance'] import sys import os import io import re import string from datetime import datetime import json import logging import cgi import mimetypes import http.client import http.server from ..Handler import Handler from ..Instance import Instance class HandlerInstance(Handler): @classmethod def dispatch(cls): cls.initdispatch(r"""^/(?P<execname>\w+)/instances/(?P<instname>\w+)/?$""", "GET,DELETE,OPTIONS,TRACE", "/help/RESTful") return cls def head(self): self.content = "Headers" self.get() def get(self): name = self.urlargs["instname"] inst = Instance.getcached(self.executable, name) if inst: buf = io.StringIO() for mediatype in self.accept: if mediatype == "text/html": reprfunc = self.representation_html break elif mediatype == "application/json": reprfunc = self.representation_json break elif mediatype == "application/yaml": reprfunc = self.representation_yaml break if mediatype: reprfunc(inst, buf) self["Content-Type"] = mediatype self.writelines(buf.getvalue()) self.status = http.client.OK self.flush() else: self.error(http.client.UNSUPPORTED_MEDIA_TYPE) else: self.error(http.client.NOT_FOUND) def delete(self): name = self.urlargs["instname"] if name in self.executable.instances: inst = self.executable.instances[name] inst.delete() self.status = http.client.OK self.flush() else: self.error(http.client.NOT_FOUND) def representation_html(self, inst, fp): """Create an HTML representation of the instance. Parameters ---------- fp Pointer to file type object to write the HTML representation. """ inststate = inst.state(self.serverurl(path=""), urlpath="instances") html = """<!DOCTYPE html> <html lang='en'> <head> <title>pyzombie: {name}</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="Contents" href="/"/> </head> <body> <h1>pyzombie</h1> <h2><a href="{self}">{name}</a></h2> <ul> <li>Result code: {returncode}</li> <li>Started: {start}</li> <li>Timeout: {timeout}</li> <li>Completed: {end}</li> <li>Remove: {remove}</li> <li><a href="{stdin}">stdin</a></li> <li><a href="{stdout}">stdout</a></li> <li><a href="{stderr}">stderr</a></li> </ul> </body> </html> """.format(**inststate) fp.write(html) def representation_json(self, inst, fp): """Create a JSON representation of the instance. Parameters ---------- fp Pointer to file type object to write the JSON representation. """ state = inst.state(self.serverurl(path=""), urlpath="instances") json.dump(state, fp, sort_keys=True, indent=4) def representation_yaml(self, inst, fp): """Create a YAML representation of the instance. Parameters ---------- fp Pointer to file type object to write the JSON representation. urlprefix The URL scheme, host, port, etc. prefix for all URLs in the representation. urlpath The additional path information between the executable name and the instance name. """ state = inst.state(self.serverurl(path=""), urlpath="instances")
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 448, 29930, 29899, 14137, 29901, 18351, 29899, 29947, 448, 29930, 29899, 13, 29937, 2683, 2683, 2683, 2683, 9072, 5634, 13, 15945, 29908, 2272, 29920, 3424, 347, 7331, 16759, 1319, 1923, 7834, 7863, 278, 8954, 310, 385, 13, 4258, 9246, 1213, 15945, 13, 1649, 8921, 1649, 353, 6702, 29966, 5813, 29958, 742, 29897, 13, 1649, 3259, 1649, 353, 525, 29896, 29889, 29900, 29889, 29896, 29915, 13, 1649, 8552, 1266, 1649, 353, 9995, 11882, 1266, 29871, 29906, 29900, 29900, 29929, 529, 5813, 29958, 313, 29966, 26862, 6227, 29958, 5513, 15945, 13, 1649, 506, 1947, 1649, 353, 9995, 13, 29931, 293, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 6293, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 3492, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 13, 1678, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 13, 2525, 2222, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 5721, 7541, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29956, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 13393, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 13400, 800, 1090, 278, 19245, 29889, 13, 15945, 29908, 13, 1649, 1514, 4830, 1649, 353, 376, 276, 19560, 2955, 1626, 427, 29908, 13, 13, 1649, 497, 1649, 353, 6024, 4598, 4998, 2033, 13, 13, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 12013, 13, 5215, 337, 13, 5215, 1347, 13, 3166, 12865, 1053, 12865, 13, 5215, 4390, 13, 5215, 12183, 13, 5215, 274, 3146, 13, 5215, 286, 17528, 7384, 13, 5215, 1732, 29889, 4645, 13, 5215, 1732, 29889, 2974, 13, 3166, 6317, 4598, 1053, 5166, 1358, 13, 3166, 6317, 4998, 1053, 2799, 749, 13, 13, 13, 1990, 5166, 1358, 4998, 29898, 4598, 1125, 268, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 13916, 29898, 25932, 1125, 13, 4706, 1067, 29879, 29889, 2344, 13369, 29898, 29878, 15945, 29908, 29985, 29914, 10780, 29925, 29966, 4258, 978, 14247, 29893, 29974, 6802, 2611, 2925, 29914, 10780, 29925, 29966, 2611, 978, 14247, 29893, 29974, 6802, 29973, 29938, 15945, 613, 13, 9651, 376, 7194, 29892, 2287, 18476, 29892, 14094, 27946, 29892, 5659, 11538, 613, 13, 9651, 5591, 8477, 29914, 1525, 1254, 1319, 1159, 13, 4706, 736, 1067, 29879, 13, 632, 13, 1678, 822, 2343, 29898, 1311, 1125, 13, 4706, 1583, 29889, 3051, 353, 376, 18163, 29908, 13, 4706, 1583, 29889, 657, 580, 13, 268, 13, 1678, 822, 679, 29898, 1311, 1125, 13, 4706, 1024, 353, 1583, 29889, 2271, 5085, 3366, 2611, 978, 3108, 13, 4706, 832, 353, 2799, 749, 29889, 657, 29883, 3791, 29898, 1311, 29889, 4258, 9246, 29892, 1024, 29897, 13, 4706, 565, 832, 29901, 13, 9651, 18392, 353, 12013, 29889, 1231, 5971, 580, 13, 9651, 363, 1612, 7163, 668, 297, 1583, 29889, 16044, 29901, 13, 18884, 565, 1612, 7163, 668, 1275, 376, 726, 29914, 1420, 1115, 13, 462, 1678, 2062, 9891, 353, 1583, 29889, 276, 26081, 29918, 1420, 13, 462, 1678, 2867, 13, 18884, 25342, 1612, 7163, 668, 1275, 376, 6214, 29914, 3126, 1115, 13, 462, 1678, 2062, 9891, 353, 1583, 29889, 276, 26081, 29918, 3126, 13, 462, 1678, 2867, 13, 18884, 25342, 1612, 7163, 668, 1275, 376, 6214, 29914, 25162, 1115, 13, 462, 1678, 2062, 9891, 353, 1583, 29889, 276, 26081, 29918, 25162, 13, 462, 1678, 2867, 13, 9651, 565, 1612, 7163, 668, 29901, 13, 18884, 2062, 9891, 29898, 2611, 29892, 18392, 29897, 13, 18884, 1583, 3366, 3916, 29899, 1542, 3108, 353, 1612, 7163, 668, 13, 18884, 1583, 29889, 8231, 24210, 29898, 9721, 29889, 657, 1767, 3101, 13, 18884, 1583, 29889, 4882, 353, 1732, 29889, 4645, 29889, 8949, 13, 18884, 1583, 29889, 23126, 580, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 2704, 29898, 1124, 29889, 4645, 29889, 29965, 3059, 4897, 15082, 3352, 29918, 2303, 4571, 29909, 29918, 11116, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 2704, 29898, 1124, 29889, 4645, 29889, 12256, 29918, 5800, 18783, 29897, 13, 308, 13, 268, 13, 1678, 822, 5217, 29898, 1311, 1125, 13, 4706, 1024, 353, 1583, 29889, 2271, 5085, 3366, 2611, 978, 3108, 13, 4706, 565, 1024, 297, 1583, 29889, 4258, 9246, 29889, 2611, 2925, 29901, 13, 9651, 832, 353, 1583, 29889, 4258, 9246, 29889, 2611, 2925, 29961, 978, 29962, 13, 9651, 832, 29889, 8143, 580, 13, 9651, 1583, 29889, 4882, 353, 1732, 29889, 4645, 29889, 8949, 13, 9651, 1583, 29889, 23126, 580, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 2704, 29898, 1124, 29889, 4645, 29889, 12256, 29918, 5800, 18783, 29897, 13, 308, 13, 268, 13, 1678, 822, 8954, 29918, 1420, 29898, 1311, 29892, 832, 29892, 285, 29886, 1125, 13, 4706, 9995, 4391, 385, 4544, 8954, 310, 278, 2777, 29889, 13, 308, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 285, 29886, 13, 9651, 3929, 1639, 304, 934, 1134, 1203, 304, 2436, 278, 4544, 8954, 29889, 13, 4706, 9995, 13, 4706, 832, 3859, 353, 832, 29889, 3859, 29898, 1311, 29889, 2974, 2271, 29898, 2084, 543, 4968, 3142, 2084, 543, 2611, 2925, 1159, 13, 4706, 3472, 353, 9995, 29966, 29991, 21300, 3472, 29958, 13, 29966, 1420, 6361, 2433, 264, 11041, 13, 29966, 2813, 29958, 13, 1678, 529, 3257, 29958, 2272, 29920, 3424, 347, 29901, 426, 978, 16040, 3257, 29958, 13, 1678, 529, 7299, 1732, 29899, 9402, 543, 3916, 29899, 1542, 29908, 2793, 543, 726, 29914, 1420, 29936, 17425, 29922, 10496, 29899, 29947, 4681, 13, 1678, 529, 2324, 1104, 543, 21002, 29908, 2822, 13802, 4681, 13, 829, 2813, 29958, 13, 29966, 2587, 29958, 13, 1678, 529, 29882, 29896, 29958, 2272, 29920, 3424, 347, 829, 29882, 29896, 29958, 13, 1678, 529, 29882, 29906, 5299, 29874, 2822, 10724, 1311, 29913, 1013, 29912, 978, 16040, 29874, 2565, 29882, 29906, 29958, 13, 1678, 529, 352, 29958, 13, 4706, 529, 492, 29958, 3591, 775, 29901, 426, 2457, 401, 16040, 492, 29958, 13, 4706, 529, 492, 29958, 4763, 287, 29901, 426, 2962, 16040, 492, 29958, 13, 4706, 529, 492, 29958, 10851, 29901, 426, 15619, 16040, 492, 29958, 13, 4706, 529, 492, 29958, 26010, 29901, 426, 355, 16040, 492, 29958, 13, 4706, 529, 492, 29958, 15941, 29901, 426, 5992, 16040, 492, 29958, 13, 4706, 529, 492, 5299, 29874, 2822, 10724, 4172, 262, 29913, 1013, 4172, 262, 829, 29874, 2565, 492, 29958, 13, 4706, 529, 492, 5299, 29874, 2822, 10724, 25393, 29913, 1013, 25393, 829, 29874, 2565, 492, 29958, 13, 4706, 529, 492, 5299, 29874, 2822, 10724, 303, 20405, 29913, 1013, 303, 20405, 829, 29874, 2565, 492, 29958, 13, 1678, 1533, 352, 29958, 13, 829, 2587, 29958, 13, 829, 1420, 29958, 13, 15945, 1642, 4830, 29898, 1068, 2611, 3859, 29897, 13, 4706, 285, 29886, 29889, 3539, 29898, 1420, 29897, 13, 268, 13, 1678, 822, 8954, 29918, 3126, 29898, 1311, 29892, 832, 29892, 285, 29886, 1125, 13, 4706, 9995, 4391, 263, 4663, 8954, 310, 278, 2777, 29889, 13, 308, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 285, 29886, 13, 9651, 3929, 1639, 304, 934, 1134, 1203, 304, 2436, 278, 4663, 8954, 29889, 13, 4706, 9995, 13, 4706, 2106, 353, 832, 29889, 3859, 29898, 1311, 29889, 2974, 2271, 29898, 2084, 543, 4968, 3142, 2084, 543, 2611, 2925, 1159, 13, 4706, 4390, 29889, 15070, 29898, 3859, 29892, 285, 29886, 29892, 2656, 29918, 8149, 29922, 5574, 29892, 29536, 29922, 29946, 29897, 13, 268, 13, 1678, 822, 8954, 29918, 25162, 29898, 1311, 29892, 832, 29892, 285, 29886, 1125, 13, 4706, 9995, 4391, 263, 612, 23956, 8954, 310, 278, 2777, 29889, 13, 308, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 285, 29886, 13, 9651, 3929, 1639, 304, 934, 1134, 1203, 304, 2436, 278, 4663, 8954, 29889, 13, 4706, 3142, 13506, 13, 9651, 450, 3988, 11380, 29892, 3495, 29892, 2011, 29892, 2992, 29889, 10944, 363, 599, 24295, 297, 278, 8954, 29889, 13, 4706, 3142, 2084, 13, 9651, 450, 5684, 2224, 2472, 1546, 278, 16813, 1024, 322, 278, 13, 9651, 2777, 1024, 29889, 13, 4706, 9995, 13, 4706, 2106, 353, 832, 29889, 3859, 29898, 1311, 29889, 2974, 2271, 29898, 2084, 543, 4968, 3142, 2084, 543, 2611, 2925, 1159, 13, 13, 2 ]
vuln/__init__.py
Maskhe/DongTai-engine
16
38522
default_app_config = 'vuln.apps.VulnConfig'
[ 1, 2322, 29918, 932, 29918, 2917, 353, 525, 29894, 352, 29876, 29889, 13371, 29889, 29963, 352, 29876, 3991, 29915, 13, 2 ]
src/models/sa_cnn1d.py
LogAnalysisTeam/methods4logfiles
0
59259
<filename>src/models/sa_cnn1d.py from __future__ import annotations import torch import torch.nn as nn from torch.utils.data import DataLoader import numpy as np import sklearn from tqdm import tqdm from typing import List import sys from src.models.utils import time_decorator, get_encoder_size from src.models.datasets import EmbeddingDataset, CroppedDataset1D SEED = 160121 np.random.seed(SEED) torch.manual_seed(SEED) class SACNN1DPyTorch(nn.Module): def __init__(self, input_dim: int, window: int, layer_configurations: List, encoder_kernel_size: int, decoder_kernel_size: int, n_encoder_heads: int, n_decoder_heads: int, dropout: float, maxpool: int = 2, upsampling_factor: int = 2): super().__init__() n_encoder_layers = get_encoder_size(layer_configurations) encoder_layers = [nn.Conv1d(input_dim, layer_configurations[0], kernel_size=encoder_kernel_size), nn.ReLU(), nn.MaxPool1d(maxpool)] for i in range(1, min(n_encoder_layers, 2)): # two CNN layers followed by self-attention encoder_layers.append( nn.Conv1d(layer_configurations[i - 1], layer_configurations[i], kernel_size=encoder_kernel_size)) encoder_layers.append(nn.ReLU()) encoder_layers.append(nn.MaxPool1d(maxpool)) # remove ReLU before self-attention, for more details see: <NAME>, <NAME>, <NAME>, <NAME> and <NAME>, # "SACNN: Self-Attention Convolutional Neural Network for Low-Dose CT Denoising With Self-Supervised Perceptual # Loss Network," in IEEE Transactions on Medical Imaging, vol. 39, no. 7, pp. 2289-2301, July 2020, # doi: 10.1109/TMI.2020.2968472. del encoder_layers[-2] self.encoder = nn.Sequential(*encoder_layers) attention_dim = layer_configurations[min(n_encoder_layers, 2) - 1] self.encoder_self_attention = nn.MultiheadAttention(attention_dim, n_encoder_heads, dropout=dropout) self.norm_layer1 = nn.LayerNorm(attention_dim) self.cnn = None if n_encoder_layers > 2: self.cnn = nn.Sequential(nn.Conv1d(attention_dim, layer_configurations[2], kernel_size=encoder_kernel_size), nn.ReLU(), nn.MaxPool1d(maxpool)) decoder_layers = [] for i in range(n_encoder_layers, len(layer_configurations)): decoder_layers.append(nn.ConvTranspose1d(layer_configurations[i - 1], layer_configurations[i], kernel_size=decoder_kernel_size)) decoder_layers.append(nn.ReLU()) decoder_layers.append(nn.Upsample(scale_factor=upsampling_factor)) self.decoder_self_attention = None if n_encoder_layers < len(layer_configurations): del decoder_layers[-2] # see explanation above self.decoder = nn.Sequential(*decoder_layers) self.decoder_self_attention = nn.MultiheadAttention(layer_configurations[-1], n_decoder_heads, dropout=dropout) self.norm_layer2 = nn.LayerNorm(layer_configurations[-1]) self.final_layers = nn.Sequential( nn.ConvTranspose1d(layer_configurations[-1], input_dim, kernel_size=decoder_kernel_size), nn.Upsample(size=window)) # it works also reversely if Tensor is greater than the window! def forward(self, x: torch.Tensor): x = self.encoder(x) x = x.permute(2, 0, 1) att_out, _ = self.encoder_self_attention(x, x, x) x = self.norm_layer1(x + att_out) x = x.permute(1, 2, 0) x = self.cnn(x) if self.cnn else x if self.decoder_self_attention: x = self.decoder(x) x = x.permute(2, 0, 1) att_out, _ = self.decoder_self_attention(x, x, x) x = self.norm_layer2(x + att_out) x = x.permute(1, 2, 0) x = self.final_layers(x) return x class SACNN1D(sklearn.base.OutlierMixin): def __init__(self, epochs: int = 1, batch_size: int = 32, optimizer: str = 'adam', loss: str = 'mean_squared_error', learning_rate: float = 0.001, dataset_type: str = 'cropped', window: int = 35, verbose: int = True): # add dictionary with architecture of the model i.e., number of layers, hidden units per layer etc. self.epochs = epochs self.batch_size = batch_size self.optimizer = optimizer self.loss = loss self.learning_rate = learning_rate self.dataset_type = dataset_type self.window = window self.verbose = verbose # internal representation of a torch model self._model = None self._device = 'cuda' if torch.cuda.is_available() else 'cpu' def fit(self, X: np.ndarray) -> SACNN1D: # 1. convert to torch Tensor train_dl = self._numpy_to_tensors(X, batch_size=self.batch_size, shuffle=True) # 2. initialize model if not self._model: self._initialize_model(X[0].shape[-1], [X[0].shape[-1]], 3, 5, 1, 1, 0.2) loss_function = self._get_loss_function() opt = self._get_optimizer() for epoch in range(self.epochs): self._model.train() loss, execution_time = self._train_epoch(train_dl, opt, loss_function) if self.verbose: digits = int(np.log10(self.epochs)) + 1 print(f'Epoch: {epoch + 1:{digits}}/{self.epochs}, loss: {loss:.5f}, time: {execution_time:.5f} s') del train_dl # free the memory return self def predict(self, X: np.ndarray) -> np.array: test_dl = self._numpy_to_tensors(X, batch_size=128, shuffle=False) loss_function = self._get_loss_function(reduction='none') self._model.eval() with torch.no_grad(): ret = [] for (batch,) in test_dl: batch = batch.to(self._device) ret.extend(torch.mean(loss_function(self._model(batch), batch), (1, 2)).tolist()) del test_dl # free the memory return np.asarray(ret) def set_params(self, **kwargs): self.epochs = kwargs['epochs'] self.batch_size = kwargs['batch_size'] self.learning_rate = kwargs['learning_rate'] self.window = kwargs['window'] self._initialize_model(kwargs['input_shape'], kwargs['layers'], kwargs['encoder_kernel_size'], kwargs['decoder_kernel_size'], kwargs['encoder_heads'], kwargs['decoder_heads'], kwargs['dropout']) def _initialize_model(self, input_shape: int, layers_out: List, encoder_kernel_size: int, decoder_kernel_size: int, n_encoder_heads: int, n_decoder_heads: int, dropout: float): self._model = SACNN1DPyTorch(input_shape, self.window, layers_out, encoder_kernel_size, decoder_kernel_size, n_encoder_heads, n_decoder_heads, dropout) self._model.to(self._device) def _get_loss_function(self, reduction: str = 'mean') -> nn.Module: if self.loss == 'mean_squared_error': return nn.MSELoss(reduction=reduction) elif self.loss == 'kullback_leibler_divergence': return nn.KLDivLoss(reduction=reduction) else: raise NotImplementedError(f'"{self.loss}" is not implemented.') def _get_optimizer(self) -> torch.optim.Optimizer: if self.optimizer == 'adam': return torch.optim.Adam(self._model.parameters(), lr=self.learning_rate) else: raise NotImplementedError(f'"{self.optimizer}" is not implemented.') @staticmethod def custom_collate(data: List): # randomly shuffle data within a batch tensor = data[0] indexes = torch.randperm(tensor.shape[0]) return [tensor[indexes]] # must stay persistent with PyTorch API def _numpy_to_tensors(self, X: np.ndarray, batch_size: int, shuffle: bool) -> DataLoader: if self.dataset_type == 'variable_sized': train_ds = EmbeddingDataset(X, batch_size=batch_size) collate_fn = self.custom_collate if shuffle else None train_dl = DataLoader(train_ds, batch_size=1, shuffle=shuffle, collate_fn=collate_fn) elif self.dataset_type == 'cropped': train_ds = CroppedDataset1D(X, window=self.window) train_dl = DataLoader(train_ds, batch_size=batch_size, shuffle=shuffle) else: raise NotImplementedError('This dataset preprocessing is not implemented yet.') del train_ds # free the memory return train_dl @time_decorator def _train_epoch(self, train_dl: DataLoader, optimizer: torch.optim.Optimizer, criterion: nn.Module) -> float: loss = 0 n_seen_examples = 0 train_dl = tqdm(train_dl, file=sys.stdout, ascii=True, unit='batch') for (batch,) in train_dl: batch = batch.to(self._device) optimizer.zero_grad() pred = self._model(batch) batch_loss = criterion(pred, batch) batch_loss.backward() torch.nn.utils.clip_grad_norm_(self._model.parameters(), 1) optimizer.step() loss += batch_loss.item() * batch.size(0) n_seen_examples += batch.size(0) train_dl.set_postfix({'loss': loss / n_seen_examples, 'curr_loss': batch_loss.item()}) return loss / n_seen_examples
[ 1, 529, 9507, 29958, 4351, 29914, 9794, 29914, 4977, 29918, 29883, 15755, 29896, 29881, 29889, 2272, 13, 3166, 4770, 29888, 9130, 1649, 1053, 25495, 13, 13, 5215, 4842, 305, 13, 5215, 4842, 305, 29889, 15755, 408, 302, 29876, 13, 3166, 4842, 305, 29889, 13239, 29889, 1272, 1053, 3630, 10036, 13, 5215, 12655, 408, 7442, 13, 5215, 2071, 19668, 13, 3166, 260, 29939, 18933, 1053, 260, 29939, 18933, 13, 3166, 19229, 1053, 2391, 13, 5215, 10876, 13, 13, 3166, 4765, 29889, 9794, 29889, 13239, 1053, 931, 29918, 19557, 1061, 29892, 679, 29918, 3977, 6119, 29918, 2311, 13, 3166, 4765, 29889, 9794, 29889, 14538, 1691, 1053, 2812, 2580, 8497, 16390, 24541, 29892, 8764, 2986, 16390, 24541, 29896, 29928, 13, 13, 1660, 3352, 353, 29871, 29896, 29953, 29900, 29896, 29906, 29896, 13, 13, 9302, 29889, 8172, 29889, 26776, 29898, 1660, 3352, 29897, 13, 7345, 305, 29889, 11288, 29918, 26776, 29898, 1660, 3352, 29897, 13, 13, 13, 1990, 317, 2477, 10262, 29896, 11191, 29891, 29911, 25350, 29898, 15755, 29889, 7355, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1881, 29918, 6229, 29901, 938, 29892, 3474, 29901, 938, 29892, 7546, 29918, 2917, 332, 800, 29901, 2391, 29892, 2094, 6119, 29918, 17460, 29918, 2311, 29901, 938, 29892, 13, 462, 1602, 6119, 29918, 17460, 29918, 2311, 29901, 938, 29892, 302, 29918, 3977, 6119, 29918, 2813, 29879, 29901, 938, 29892, 302, 29918, 7099, 6119, 29918, 2813, 29879, 29901, 938, 29892, 5768, 449, 29901, 5785, 29892, 4236, 10109, 29901, 938, 353, 29871, 29906, 29892, 13, 462, 24081, 314, 10335, 29918, 19790, 29901, 938, 353, 29871, 29906, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 13, 4706, 302, 29918, 3977, 6119, 29918, 29277, 353, 679, 29918, 3977, 6119, 29918, 2311, 29898, 13148, 29918, 2917, 332, 800, 29897, 13, 13, 4706, 2094, 6119, 29918, 29277, 353, 518, 15755, 29889, 1168, 29894, 29896, 29881, 29898, 2080, 29918, 6229, 29892, 7546, 29918, 2917, 332, 800, 29961, 29900, 1402, 8466, 29918, 2311, 29922, 3977, 6119, 29918, 17460, 29918, 2311, 511, 302, 29876, 29889, 1123, 29931, 29965, 3285, 13, 462, 3986, 302, 29876, 29889, 7976, 11426, 29896, 29881, 29898, 3317, 10109, 4638, 13, 4706, 363, 474, 297, 3464, 29898, 29896, 29892, 1375, 29898, 29876, 29918, 3977, 6119, 29918, 29277, 29892, 29871, 29906, 22164, 29871, 396, 1023, 29696, 15359, 5643, 491, 1583, 29899, 1131, 2509, 13, 9651, 2094, 6119, 29918, 29277, 29889, 4397, 29898, 13, 18884, 302, 29876, 29889, 1168, 29894, 29896, 29881, 29898, 13148, 29918, 2917, 332, 800, 29961, 29875, 448, 29871, 29896, 1402, 7546, 29918, 2917, 332, 800, 29961, 29875, 1402, 8466, 29918, 2311, 29922, 3977, 6119, 29918, 17460, 29918, 2311, 876, 13, 9651, 2094, 6119, 29918, 29277, 29889, 4397, 29898, 15755, 29889, 1123, 29931, 29965, 3101, 13, 9651, 2094, 6119, 29918, 29277, 29889, 4397, 29898, 15755, 29889, 7976, 11426, 29896, 29881, 29898, 3317, 10109, 876, 13, 13, 4706, 396, 3349, 830, 29931, 29965, 1434, 1583, 29899, 1131, 2509, 29892, 363, 901, 4902, 1074, 29901, 529, 5813, 10202, 529, 5813, 10202, 529, 5813, 10202, 529, 5813, 29958, 322, 529, 5813, 10202, 13, 4706, 396, 376, 29903, 2477, 10262, 29901, 21782, 29899, 4165, 2509, 1281, 4068, 284, 2448, 3631, 8527, 363, 17511, 29899, 29928, 852, 26637, 3384, 29877, 5921, 2973, 21782, 29899, 19111, 11292, 2431, 1547, 950, 13, 4706, 396, 365, 2209, 8527, 1699, 297, 7159, 17896, 4103, 7387, 373, 20795, 1954, 6751, 29892, 1700, 29889, 29871, 29941, 29929, 29892, 694, 29889, 29871, 29955, 29892, 6499, 29889, 29871, 29906, 29906, 29947, 29929, 29899, 29906, 29941, 29900, 29896, 29892, 5468, 29871, 29906, 29900, 29906, 29900, 29892, 13, 4706, 396, 13102, 29901, 29871, 29896, 29900, 29889, 29896, 29896, 29900, 29929, 29914, 29911, 10403, 29889, 29906, 29900, 29906, 29900, 29889, 29906, 29929, 29953, 29947, 29946, 29955, 29906, 29889, 13, 4706, 628, 2094, 6119, 29918, 29277, 14352, 29906, 29962, 13, 4706, 1583, 29889, 3977, 6119, 353, 302, 29876, 29889, 16941, 2556, 10456, 3977, 6119, 29918, 29277, 29897, 13, 13, 4706, 8570, 29918, 6229, 353, 7546, 29918, 2917, 332, 800, 29961, 1195, 29898, 29876, 29918, 3977, 6119, 29918, 29277, 29892, 29871, 29906, 29897, 448, 29871, 29896, 29962, 13, 4706, 1583, 29889, 3977, 6119, 29918, 1311, 29918, 1131, 2509, 353, 302, 29876, 29889, 15329, 2813, 4165, 2509, 29898, 1131, 2509, 29918, 6229, 29892, 302, 29918, 3977, 6119, 29918, 2813, 29879, 29892, 5768, 449, 29922, 8865, 449, 29897, 13, 4706, 1583, 29889, 12324, 29918, 13148, 29896, 353, 302, 29876, 29889, 14420, 29940, 555, 29898, 1131, 2509, 29918, 6229, 29897, 13, 13, 4706, 1583, 29889, 29883, 15755, 353, 6213, 13, 4706, 565, 302, 29918, 3977, 6119, 29918, 29277, 1405, 29871, 29906, 29901, 13, 9651, 1583, 29889, 29883, 15755, 353, 302, 29876, 29889, 16941, 2556, 29898, 15755, 29889, 1168, 29894, 29896, 29881, 29898, 1131, 2509, 29918, 6229, 29892, 7546, 29918, 2917, 332, 800, 29961, 29906, 1402, 8466, 29918, 2311, 29922, 3977, 6119, 29918, 17460, 29918, 2311, 511, 13, 462, 462, 268, 302, 29876, 29889, 1123, 29931, 29965, 3285, 302, 29876, 29889, 7976, 11426, 29896, 29881, 29898, 3317, 10109, 876, 13, 13, 4706, 1602, 6119, 29918, 29277, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 29876, 29918, 3977, 6119, 29918, 29277, 29892, 7431, 29898, 13148, 29918, 2917, 332, 800, 22164, 13, 9651, 1602, 6119, 29918, 29277, 29889, 4397, 29898, 15755, 29889, 1168, 29894, 4300, 4220, 29896, 29881, 29898, 13148, 29918, 2917, 332, 800, 29961, 29875, 448, 29871, 29896, 1402, 7546, 29918, 2917, 332, 800, 29961, 29875, 1402, 13, 462, 462, 462, 268, 8466, 29918, 2311, 29922, 7099, 6119, 29918, 17460, 29918, 2311, 876, 13, 9651, 1602, 6119, 29918, 29277, 29889, 4397, 29898, 15755, 29889, 1123, 29931, 29965, 3101, 13, 9651, 1602, 6119, 29918, 29277, 29889, 4397, 29898, 15755, 29889, 29965, 567, 981, 29898, 7052, 29918, 19790, 29922, 14340, 314, 10335, 29918, 19790, 876, 13, 13, 4706, 1583, 29889, 7099, 6119, 29918, 1311, 29918, 1131, 2509, 353, 6213, 13, 4706, 565, 302, 29918, 3977, 6119, 29918, 29277, 529, 7431, 29898, 13148, 29918, 2917, 332, 800, 1125, 13, 9651, 628, 1602, 6119, 29918, 29277, 14352, 29906, 29962, 29871, 396, 1074, 8252, 2038, 13, 9651, 1583, 29889, 7099, 6119, 353, 302, 29876, 29889, 16941, 2556, 10456, 7099, 6119, 29918, 29277, 29897, 13, 13, 9651, 1583, 29889, 7099, 6119, 29918, 1311, 29918, 1131, 2509, 353, 302, 29876, 29889, 15329, 2813, 4165, 2509, 29898, 13148, 29918, 2917, 332, 800, 14352, 29896, 1402, 302, 29918, 7099, 6119, 29918, 2813, 29879, 29892, 13, 462, 462, 462, 18884, 5768, 449, 29922, 8865, 449, 29897, 13, 9651, 1583, 29889, 12324, 29918, 13148, 29906, 353, 302, 29876, 29889, 14420, 29940, 555, 29898, 13148, 29918, 2917, 332, 800, 14352, 29896, 2314, 13, 13, 4706, 1583, 29889, 8394, 29918, 29277, 353, 302, 29876, 29889, 16941, 2556, 29898, 13, 9651, 302, 29876, 29889, 1168, 29894, 4300, 4220, 29896, 29881, 29898, 13148, 29918, 2917, 332, 800, 14352, 29896, 1402, 1881, 29918, 6229, 29892, 8466, 29918, 2311, 29922, 7099, 6119, 29918, 17460, 29918, 2311, 511, 13, 9651, 302, 29876, 29889, 29965, 567, 981, 29898, 2311, 29922, 7165, 876, 29871, 396, 372, 1736, 884, 18764, 873, 565, 323, 6073, 338, 7621, 1135, 278, 3474, 29991, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 921, 29901, 4842, 305, 29889, 29911, 6073, 1125, 13, 4706, 921, 353, 1583, 29889, 3977, 6119, 29898, 29916, 29897, 13, 13, 4706, 921, 353, 921, 29889, 17858, 1082, 29898, 29906, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 4706, 1098, 29918, 449, 29892, 903, 353, 1583, 29889, 3977, 6119, 29918, 1311, 29918, 1131, 2509, 29898, 29916, 29892, 921, 29892, 921, 29897, 13, 4706, 921, 353, 1583, 29889, 12324, 29918, 13148, 29896, 29898, 29916, 718, 1098, 29918, 449, 29897, 13, 4706, 921, 353, 921, 29889, 17858, 1082, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 29897, 13, 13, 4706, 921, 353, 1583, 29889, 29883, 15755, 29898, 29916, 29897, 565, 1583, 29889, 29883, 15755, 1683, 921, 13, 13, 4706, 565, 1583, 29889, 7099, 6119, 29918, 1311, 29918, 1131, 2509, 29901, 13, 9651, 921, 353, 1583, 29889, 7099, 6119, 29898, 29916, 29897, 13, 13, 9651, 921, 353, 921, 29889, 17858, 1082, 29898, 29906, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 9651, 1098, 29918, 449, 29892, 903, 353, 1583, 29889, 7099, 6119, 29918, 1311, 29918, 1131, 2509, 29898, 29916, 29892, 921, 29892, 921, 29897, 13, 9651, 921, 353, 1583, 29889, 12324, 29918, 13148, 29906, 29898, 29916, 718, 1098, 29918, 449, 29897, 13, 9651, 921, 353, 921, 29889, 17858, 1082, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29900, 29897, 13, 13, 4706, 921, 353, 1583, 29889, 8394, 29918, 29277, 29898, 29916, 29897, 13, 4706, 736, 921, 13, 13, 13, 1990, 317, 2477, 10262, 29896, 29928, 29898, 808, 19668, 29889, 3188, 29889, 3744, 4926, 29924, 861, 262, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 21502, 12168, 29901, 938, 353, 29871, 29896, 29892, 9853, 29918, 2311, 29901, 938, 353, 29871, 29941, 29906, 29892, 5994, 3950, 29901, 851, 353, 525, 328, 314, 742, 13, 462, 6410, 29901, 851, 353, 525, 12676, 29918, 26613, 1965, 29918, 2704, 742, 6509, 29918, 10492, 29901, 5785, 353, 29871, 29900, 29889, 29900, 29900, 29896, 29892, 8783, 29918, 1853, 29901, 851, 353, 525, 24077, 2986, 742, 13, 462, 3474, 29901, 938, 353, 29871, 29941, 29945, 29892, 26952, 29901, 938, 353, 5852, 1125, 13, 4706, 396, 788, 8600, 411, 11258, 310, 278, 1904, 474, 29889, 29872, 1696, 1353, 310, 15359, 29892, 7934, 10340, 639, 7546, 2992, 29889, 13, 4706, 1583, 29889, 1022, 2878, 29879, 353, 21502, 12168, 13, 4706, 1583, 29889, 16175, 29918, 2311, 353, 9853, 29918, 2311, 13, 4706, 1583, 29889, 20640, 3950, 353, 5994, 3950, 13, 4706, 1583, 29889, 6758, 353, 6410, 13, 4706, 1583, 29889, 21891, 29918, 10492, 353, 6509, 29918, 10492, 13, 4706, 1583, 29889, 24713, 29918, 1853, 353, 8783, 29918, 1853, 13, 4706, 1583, 29889, 7165, 353, 3474, 13, 4706, 1583, 29889, 369, 15828, 353, 26952, 13, 13, 4706, 396, 7463, 8954, 310, 263, 4842, 305, 1904, 13, 4706, 1583, 3032, 4299, 353, 6213, 13, 4706, 1583, 3032, 10141, 353, 525, 29883, 6191, 29915, 565, 4842, 305, 29889, 29883, 6191, 29889, 275, 29918, 16515, 580, 1683, 525, 21970, 29915, 13, 13, 1678, 822, 6216, 29898, 1311, 29892, 1060, 29901, 7442, 29889, 299, 2378, 29897, 1599, 317, 2477, 10262, 29896, 29928, 29901, 13, 4706, 396, 29871, 29896, 29889, 3588, 304, 4842, 305, 323, 6073, 13, 4706, 7945, 29918, 11671, 353, 1583, 3032, 23749, 29918, 517, 29918, 29873, 575, 943, 29898, 29990, 29892, 9853, 29918, 2311, 29922, 1311, 29889, 16175, 29918, 2311, 29892, 528, 21897, 29922, 5574, 29897, 13, 13, 4706, 396, 29871, 29906, 29889, 11905, 1904, 13, 4706, 565, 451, 1583, 3032, 4299, 29901, 13, 9651, 1583, 3032, 24926, 29918, 4299, 29898, 29990, 29961, 29900, 1822, 12181, 14352, 29896, 1402, 518, 29990, 29961, 29900, 1822, 12181, 14352, 29896, 20526, 29871, 29941, 29892, 29871, 29945, 29892, 29871, 29896, 29892, 29871, 29896, 29892, 29871, 29900, 29889, 29906, 29897, 13, 13, 4706, 6410, 29918, 2220, 353, 1583, 3032, 657, 29918, 6758, 29918, 2220, 580, 13, 4706, 3523, 353, 1583, 3032, 657, 29918, 20640, 3950, 580, 13, 13, 4706, 363, 21502, 305, 297, 3464, 29898, 1311, 29889, 1022, 2878, 29879, 1125, 13, 9651, 1583, 3032, 4299, 29889, 14968, 580, 13, 9651, 6410, 29892, 8225, 29918, 2230, 353, 1583, 3032, 14968, 29918, 1022, 2878, 29898, 14968, 29918, 11671, 29892, 3523, 29892, 6410, 29918, 2220, 29897, 13, 13, 9651, 565, 1583, 29889, 369, 15828, 29901, 13, 18884, 13340, 353, 938, 29898, 9302, 29889, 1188, 29896, 29900, 29898, 1311, 29889, 1022, 2878, 29879, 876, 718, 29871, 29896, 13, 18884, 1596, 29898, 29888, 29915, 29923, 1129, 305, 29901, 426, 1022, 2878, 718, 29871, 29896, 26254, 7501, 1169, 930, 19248, 1311, 29889, 1022, 2878, 29879, 1118, 6410, 29901, 426, 6758, 29901, 29889, 29945, 29888, 1118, 931, 29901, 426, 22256, 29918, 2230, 29901, 29889, 29945, 29888, 29913, 269, 1495, 13, 4706, 628, 7945, 29918, 11671, 29871, 396, 3889, 278, 3370, 13, 4706, 736, 1583, 13, 13, 1678, 822, 8500, 29898, 1311, 29892, 1060, 29901, 7442, 29889, 299, 2378, 29897, 1599, 7442, 29889, 2378, 29901, 13, 4706, 1243, 29918, 11671, 353, 1583, 3032, 23749, 29918, 517, 29918, 29873, 575, 943, 29898, 29990, 29892, 9853, 29918, 2311, 29922, 29896, 29906, 29947, 29892, 528, 21897, 29922, 8824, 29897, 13, 13, 4706, 6410, 29918, 2220, 353, 1583, 3032, 657, 29918, 6758, 29918, 2220, 29898, 9313, 428, 2433, 9290, 1495, 13, 13, 4706, 1583, 3032, 4299, 29889, 14513, 580, 13, 4706, 411, 4842, 305, 29889, 1217, 29918, 5105, 7295, 13, 9651, 3240, 353, 5159, 13, 9651, 363, 313, 16175, 29892, 29897, 297, 1243, 29918, 11671, 29901, 13, 18884, 9853, 353, 9853, 29889, 517, 29898, 1311, 3032, 10141, 29897, 13, 18884, 3240, 29889, 21843, 29898, 7345, 305, 29889, 12676, 29898, 6758, 29918, 2220, 29898, 1311, 3032, 4299, 29898, 16175, 511, 9853, 511, 313, 29896, 29892, 29871, 29906, 8106, 25027, 391, 3101, 13, 9651, 628, 1243, 29918, 11671, 29871, 396, 3889, 278, 3370, 13, 9651, 736, 7442, 29889, 294, 2378, 29898, 2267, 29897, 13, 13, 1678, 822, 731, 29918, 7529, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 1583, 29889, 1022, 2878, 29879, 353, 9049, 5085, 1839, 1022, 2878, 29879, 2033, 13, 4706, 1583, 29889, 16175, 29918, 2311, 353, 9049, 5085, 1839, 16175, 29918, 2311, 2033, 13, 4706, 1583, 29889, 21891, 29918, 10492, 353, 9049, 5085, 1839, 21891, 29918, 10492, 2033, 13, 4706, 1583, 29889, 7165, 353, 9049, 5085, 1839, 7165, 2033, 13, 4706, 1583, 3032, 24926, 29918, 4299, 29898, 19290, 1839, 2080, 29918, 12181, 7464, 9049, 5085, 1839, 29277, 7464, 9049, 5085, 1839, 3977, 6119, 29918, 17460, 29918, 2311, 7464, 13, 462, 1669, 9049, 5085, 1839, 7099, 6119, 29918, 17460, 29918, 2311, 7464, 9049, 5085, 1839, 3977, 6119, 29918, 2813, 29879, 7464, 9049, 5085, 1839, 7099, 6119, 29918, 2813, 29879, 7464, 13, 462, 1669, 9049, 5085, 1839, 8865, 449, 11287, 13, 13, 1678, 822, 903, 24926, 29918, 4299, 29898, 1311, 29892, 1881, 29918, 12181, 29901, 938, 29892, 15359, 29918, 449, 29901, 2391, 29892, 2094, 6119, 29918, 17460, 29918, 2311, 29901, 938, 29892, 1602, 6119, 29918, 17460, 29918, 2311, 29901, 938, 29892, 13, 462, 3986, 302, 29918, 3977, 6119, 29918, 2813, 29879, 29901, 938, 29892, 302, 29918, 7099, 6119, 29918, 2813, 29879, 29901, 938, 29892, 5768, 449, 29901, 5785, 1125, 13, 4706, 1583, 3032, 4299, 353, 317, 2477, 10262, 29896, 11191, 29891, 29911, 25350, 29898, 2080, 29918, 12181, 29892, 1583, 29889, 7165, 29892, 15359, 29918, 449, 29892, 2094, 6119, 29918, 17460, 29918, 2311, 29892, 1602, 6119, 29918, 17460, 29918, 2311, 29892, 13, 462, 462, 268, 302, 29918, 3977, 6119, 29918, 2813, 29879, 29892, 302, 29918, 7099, 6119, 29918, 2813, 29879, 29892, 5768, 449, 29897, 13, 4706, 1583, 3032, 4299, 29889, 517, 29898, 1311, 3032, 10141, 29897, 13, 13, 1678, 822, 903, 657, 29918, 6758, 29918, 2220, 29898, 1311, 29892, 20376, 29901, 851, 353, 525, 12676, 1495, 1599, 302, 29876, 29889, 7355, 29901, 13, 4706, 565, 1583, 29889, 6758, 1275, 525, 12676, 29918, 26613, 1965, 29918, 2704, 2396, 13, 9651, 736, 302, 29876, 29889, 29924, 1660, 29931, 2209, 29898, 9313, 428, 29922, 9313, 428, 29897, 13, 4706, 25342, 1583, 29889, 6758, 1275, 525, 29895, 913, 1627, 29918, 280, 747, 1358, 29918, 29881, 2147, 10238, 2396, 13, 9651, 736, 302, 29876, 29889, 29968, 10249, 440, 29931, 2209, 29898, 9313, 428, 29922, 9313, 428, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 2216, 1888, 2037, 287, 2392, 29898, 29888, 11838, 29912, 1311, 29889, 6758, 5038, 338, 451, 8762, 29889, 1495, 13, 13, 1678, 822, 903, 657, 29918, 20640, 3950, 29898, 1311, 29897, 1599, 4842, 305, 29889, 20640, 29889, 20624, 326, 3950, 29901, 13, 4706, 565, 1583, 29889, 20640, 3950, 1275, 525, 328, 314, 2396, 13, 9651, 736, 4842, 305, 29889, 20640, 29889, 3253, 314, 29898, 1311, 3032, 4299, 29889, 16744, 3285, 301, 29878, 29922, 1311, 29889, 21891, 29918, 10492, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 2216, 1888, 2037, 287, 2392, 29898, 29888, 11838, 29912, 1311, 29889, 20640, 3950, 5038, 338, 451, 8762, 29889, 1495, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2888, 29918, 1054, 9632, 29898, 1272, 29901, 2391, 1125, 13, 4706, 396, 20459, 528, 21897, 848, 2629, 263, 9853, 13, 4706, 12489, 353, 848, 29961, 29900, 29962, 13, 4706, 18111, 353, 4842, 305, 29889, 9502, 17858, 29898, 20158, 29889, 12181, 29961, 29900, 2314, 13, 4706, 736, 518, 20158, 29961, 2248, 267, 5262, 29871, 396, 1818, 7952, 28152, 411, 10772, 29911, 25350, 3450, 13, 13, 1678, 822, 903, 23749, 29918, 517, 29918, 29873, 575, 943, 29898, 1311, 29892, 1060, 29901, 7442, 29889, 299, 2378, 29892, 9853, 29918, 2311, 29901, 938, 29892, 528, 21897, 29901, 6120, 29897, 1599, 3630, 10036, 29901, 13, 4706, 565, 1583, 29889, 24713, 29918, 1853, 1275, 525, 11918, 29918, 29879, 1891, 2396, 13, 9651, 7945, 29918, 6289, 353, 2812, 2580, 8497, 16390, 24541, 29898, 29990, 29892, 9853, 29918, 2311, 29922, 16175, 29918, 2311, 29897, 13, 9651, 5321, 403, 29918, 9144, 353, 1583, 29889, 6341, 29918, 1054, 9632, 565, 528, 21897, 1683, 6213, 13, 9651, 7945, 29918, 11671, 353, 3630, 10036, 29898, 14968, 29918, 6289, 29892, 9853, 29918, 2311, 29922, 29896, 29892, 528, 21897, 29922, 845, 21897, 29892, 5321, 403, 29918, 9144, 29922, 1054, 9632, 29918, 9144, 29897, 13, 4706, 25342, 1583, 29889, 24713, 29918, 1853, 1275, 525, 24077, 2986, 2396, 13, 9651, 7945, 29918, 6289, 353, 8764, 2986, 16390, 24541, 29896, 29928, 29898, 29990, 29892, 3474, 29922, 1311, 29889, 7165, 29897, 13, 9651, 7945, 29918, 11671, 353, 3630, 10036, 29898, 14968, 29918, 6289, 29892, 9853, 29918, 2311, 29922, 16175, 29918, 2311, 29892, 528, 21897, 29922, 845, 21897, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 2216, 1888, 2037, 287, 2392, 877, 4013, 8783, 758, 19170, 338, 451, 8762, 3447, 29889, 1495, 13, 4706, 628, 7945, 29918, 6289, 29871, 396, 3889, 278, 3370, 13, 4706, 736, 7945, 29918, 11671, 13, 13, 1678, 732, 2230, 29918, 19557, 1061, 13, 1678, 822, 903, 14968, 29918, 1022, 2878, 29898, 1311, 29892, 7945, 29918, 11671, 29901, 3630, 10036, 29892, 5994, 3950, 29901, 4842, 305, 29889, 20640, 29889, 20624, 326, 3950, 29892, 28770, 291, 29901, 302, 29876, 29889, 7355, 29897, 1599, 5785, 29901, 13, 4706, 6410, 353, 29871, 29900, 13, 4706, 302, 29918, 28026, 29918, 19057, 353, 29871, 29900, 13, 4706, 7945, 29918, 11671, 353, 260, 29939, 18933, 29898, 14968, 29918, 11671, 29892, 934, 29922, 9675, 29889, 25393, 29892, 408, 18869, 29922, 5574, 29892, 5190, 2433, 16175, 1495, 13, 4706, 363, 313, 16175, 29892, 29897, 297, 7945, 29918, 11671, 29901, 13, 9651, 9853, 353, 9853, 29889, 517, 29898, 1311, 3032, 10141, 29897, 13, 13, 9651, 5994, 3950, 29889, 9171, 29918, 5105, 580, 13, 13, 9651, 4450, 353, 1583, 3032, 4299, 29898, 16175, 29897, 13, 9651, 9853, 29918, 6758, 353, 28770, 291, 29898, 11965, 29892, 9853, 29897, 13, 13, 9651, 9853, 29918, 6758, 29889, 1627, 1328, 580, 13, 9651, 4842, 305, 29889, 15755, 29889, 13239, 29889, 24049, 29918, 5105, 29918, 12324, 23538, 1311, 3032, 4299, 29889, 16744, 3285, 29871, 29896, 29897, 13, 9651, 5994, 3950, 29889, 10568, 580, 13, 13, 9651, 6410, 4619, 9853, 29918, 6758, 29889, 667, 580, 334, 9853, 29889, 2311, 29898, 29900, 29897, 13, 9651, 302, 29918, 28026, 29918, 19057, 4619, 9853, 29889, 2311, 29898, 29900, 29897, 13, 13, 9651, 7945, 29918, 11671, 29889, 842, 29918, 2490, 5878, 3319, 29915, 6758, 2396, 6410, 847, 302, 29918, 28026, 29918, 19057, 29892, 525, 21962, 29918, 6758, 2396, 9853, 29918, 6758, 29889, 667, 580, 1800, 13, 4706, 736, 6410, 847, 302, 29918, 28026, 29918, 19057, 13, 2 ]
python-analysers/src/test/resources/org/jetbrains/research/lupa/pythonAnalysis/imports/analysis/psi/fromImportStatementsData/in_13_absolute_from_import.py
JetBrains-Research/Lupa
16
91980
from src.tasks.task1 import utils
[ 1, 515, 4765, 29889, 20673, 29889, 7662, 29896, 1053, 3667, 29879, 13, 2 ]
warhorn_api.py
jagerkin/warbot
1
17642
<gh_stars>1-10 # Copyright 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # 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. """Warhorn GraphQL client.""" import collections.abc import datetime import logging from typing import AsyncGenerator, Dict, Optional, Sequence, Tuple, Union import pytz from gql import gql, Client from gql.transport.aiohttp import AIOHTTPTransport from gql.transport.aiohttp import log as gql_logger _QUERY = '''\ {{ eventSessions( events: ["{slug}"], startsAfter: "{startsAfter}") {{ nodes {{ status scenario {{ name }} scenarioOffering {{ customName }} signupUrl uuid slot {{ timezone startsAt endsAt }} }} }} }}''' _GQLNode = Optional[Union[str, Dict[str, '_GQLNode'], Sequence['_GQLNode']]] class GraphNode: """Wrapper for GraphQL nodes that don't make the type system (or me) cry.""" __slots__ = ('_node', ) def __init__(self, node: _GQLNode) -> None: """Init a GraphNode. Args: node: GraphQL result node. """ self._node: _GQLNode = node def path(self, *path: str) -> 'GraphNode': # pylint: disable=used-before-assignment """Resolve a path under this node. Args: path: Sequence of key values to lookup. Returns: Node navigated to, or a None node if no such node existed. """ node = self._node for p in path: if not isinstance(node, dict): return GraphNode(None) node = node.get(p) return GraphNode(node) @property def str(self) -> str: """Return the node as a string if it is one, else ''.""" if isinstance(self._node, str): return self._node return '' @property def tuple(self) -> Tuple['GraphNode', ...]: """Return the node as a Tuple of GraphNodes if it's a sequence, else an empty tuple.""" if isinstance(self._node, collections.abc.Sequence): return tuple(GraphNode(e) for e in self._node) return tuple() def _strings_exists(*strings: str) -> bool: """Check that all of the strings exist and none of them are just the str 'None'.""" for s in strings: if s in ('', 'None'): return False return True class Game: """Game holds the key information about a Warhorn D&D session.""" __slots__ = 'uuid', 'name', 'url', 'status', 'starts', 'ends' def __init__(self, session: GraphNode) -> None: """Init new Game. Args: session: Warhorn GraphQL session node to extract game data from. Throws: ValueError: in the event of key missing values, like a start time. """ self.uuid: str = session.path('uuid').str """Warhorn session UUID.""" self.name: str = ( session.path('scenarioOffering', 'customName').str or session.path('scenario', 'name').str) """Game scenario name.""" self.url = session.path('signupUrl').str """Warhorn session signup URL.""" self.status: str = session.path('status').str """Warhorn session status. (e.g. PUBLISHED, DRAFT, CANCELED)""" starts = session.path('slot', 'startsAt').str ends = session.path('slot', 'endsAt').str tz_str = session.path('slot', 'timezone').str or 'US/Pacific' if not _strings_exists(self.uuid, self.name, self.status, self.url, starts, ends, tz_str): raise ValueError(f'Missing key values for game session: {session}') tz = pytz.timezone(tz_str) self.starts: datetime.datetime = datetime.datetime.fromisoformat(starts).astimezone(tz) """Game start time.""" self.ends: datetime.datetime = datetime.datetime.fromisoformat(ends).astimezone(tz) """Game end time.""" @property def time(self) -> str: """String describing game start/end time.""" return f'{self.starts:%-I:%M%p} - {self.ends:%-I:%M%p %Z %b %d, %Y}' def __repr__(self) -> str: return f'Game("{self.name}", {self.time}, {self.status}, uuid: {self.uuid})' class WarhornAPI: # pylint: disable=too-few-public-methods """Warhorn client API.""" def __init__(self, url: str='https://warhorn.net/graphql', token: str='') -> None: """Init Warhorn client. Args: url: Warhorn GraphQL endpoint. """ headers = {} if token: headers['Authorization'] = f'Bearer {token}' self._transport = AIOHTTPTransport(url=url, headers=headers) self._client = Client(transport=self._transport, fetch_schema_from_transport=False) gql_logger.setLevel(logging.WARNING) # type: ignore async def get_games( self, slug: str, starts_after: Optional[datetime.datetime]=None ) -> AsyncGenerator[Game, None]: """Query Warhorn for games. Args: slug: identifying string for the warhorn event. starts_after: Only return Games beginning after this time. Returns: Generator of games. """ starts_after = starts_after if starts_after else datetime.datetime.now() q = _QUERY.format(slug=slug, startsAfter=starts_after.isoformat()) query = gql(q) result = GraphNode(await self._client.execute_async(query)) # type: ignore for session in result.path('eventSessions', 'nodes').tuple: status = session.path('status').str if status not in ('PUBLISHED', 'DRAFT', 'CANCELED'): logging.warn('Unexpected sessions status: %s', session) if status != 'PUBLISHED': continue yield Game(session)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29896, 529, 5813, 29958, 13, 29937, 29871, 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, 29871, 13, 29937, 268, 2045, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 29871, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 15945, 29908, 29956, 279, 25031, 12367, 2239, 3132, 1213, 15945, 13, 13, 5215, 16250, 29889, 10736, 13, 5215, 12865, 13, 5215, 12183, 13, 3166, 19229, 1053, 20688, 21575, 29892, 360, 919, 29892, 28379, 29892, 922, 3910, 29892, 12603, 552, 29892, 7761, 13, 13, 5215, 282, 3637, 29920, 13, 3166, 330, 1519, 1053, 330, 1519, 29892, 12477, 13, 3166, 330, 1519, 29889, 27882, 29889, 29874, 601, 1124, 1053, 319, 5971, 10493, 27395, 13, 3166, 330, 1519, 29889, 27882, 29889, 29874, 601, 1124, 1053, 1480, 408, 330, 1519, 29918, 21707, 13, 13, 13, 29918, 13356, 24422, 353, 14550, 29905, 13, 6224, 13, 29871, 1741, 29903, 10964, 29898, 13, 418, 4959, 29901, 6796, 29912, 29517, 5038, 1402, 13, 418, 8665, 13555, 29901, 29850, 27382, 13555, 27195, 8620, 13, 1678, 7573, 8620, 13, 418, 4660, 13, 418, 10483, 8620, 13, 4706, 1024, 13, 418, 9156, 13, 418, 10483, 2776, 571, 292, 8620, 13, 4706, 2888, 1170, 13, 418, 9156, 13, 418, 1804, 786, 5983, 13, 418, 318, 5416, 13, 418, 21497, 8620, 13, 4706, 29431, 13, 4706, 8665, 4178, 13, 4706, 10614, 4178, 13, 418, 9156, 13, 1678, 9156, 13, 29871, 9156, 13, 930, 12008, 13, 29918, 29954, 2239, 4247, 353, 28379, 29961, 19986, 29961, 710, 29892, 360, 919, 29961, 710, 29892, 22868, 29954, 2239, 4247, 7464, 922, 3910, 1839, 29918, 29954, 2239, 4247, 2033, 5262, 13, 13, 13, 1990, 12367, 4247, 29901, 13, 1678, 9995, 15646, 363, 12367, 2239, 7573, 393, 1016, 29915, 29873, 1207, 278, 1134, 1788, 313, 272, 592, 29897, 10901, 1213, 15945, 13, 13, 1678, 4770, 2536, 1862, 1649, 353, 6702, 29918, 3177, 742, 1723, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2943, 29901, 903, 29954, 2239, 4247, 29897, 1599, 6213, 29901, 13, 4706, 9995, 6644, 263, 12367, 4247, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 2943, 29901, 12367, 2239, 1121, 2943, 29889, 13, 4706, 9995, 13, 4706, 1583, 3032, 3177, 29901, 903, 29954, 2239, 4247, 353, 2943, 13, 13, 1678, 822, 2224, 29898, 1311, 29892, 334, 2084, 29901, 851, 29897, 1599, 525, 9527, 4247, 2396, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 3880, 29899, 11083, 29899, 465, 10194, 13, 4706, 9995, 12375, 345, 263, 2224, 1090, 445, 2943, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 2224, 29901, 922, 3910, 310, 1820, 1819, 304, 16280, 29889, 13, 13, 4706, 16969, 29901, 13, 9651, 9071, 12402, 630, 304, 29892, 470, 263, 6213, 2943, 565, 694, 1316, 2943, 22856, 29889, 13, 4706, 9995, 13, 4706, 2943, 353, 1583, 3032, 3177, 13, 4706, 363, 282, 297, 2224, 29901, 13, 9651, 565, 451, 338, 8758, 29898, 3177, 29892, 9657, 1125, 13, 18884, 736, 12367, 4247, 29898, 8516, 29897, 13, 9651, 2943, 353, 2943, 29889, 657, 29898, 29886, 29897, 13, 4706, 736, 12367, 4247, 29898, 3177, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 851, 29898, 1311, 29897, 1599, 851, 29901, 13, 4706, 9995, 11609, 278, 2943, 408, 263, 1347, 565, 372, 338, 697, 29892, 1683, 6629, 1213, 15945, 13, 4706, 565, 338, 8758, 29898, 1311, 3032, 3177, 29892, 851, 1125, 13, 9651, 736, 1583, 3032, 3177, 13, 4706, 736, 6629, 13, 13, 1678, 732, 6799, 13, 1678, 822, 18761, 29898, 1311, 29897, 1599, 12603, 552, 1839, 9527, 4247, 742, 2023, 5387, 13, 4706, 9995, 11609, 278, 2943, 408, 263, 12603, 552, 310, 12367, 20284, 565, 372, 29915, 29879, 263, 5665, 29892, 1683, 385, 4069, 18761, 1213, 15945, 13, 4706, 565, 338, 8758, 29898, 1311, 3032, 3177, 29892, 16250, 29889, 10736, 29889, 20529, 1125, 13, 9651, 736, 18761, 29898, 9527, 4247, 29898, 29872, 29897, 363, 321, 297, 1583, 3032, 3177, 29897, 13, 4706, 736, 18761, 580, 13, 13, 13, 1753, 903, 19651, 29918, 9933, 10456, 19651, 29901, 851, 29897, 1599, 6120, 29901, 13, 1678, 9995, 5596, 393, 599, 310, 278, 6031, 1863, 322, 5642, 310, 963, 526, 925, 278, 851, 525, 8516, 29915, 1213, 15945, 13, 1678, 363, 269, 297, 6031, 29901, 13, 4706, 565, 269, 297, 6702, 742, 525, 8516, 29374, 13, 9651, 736, 7700, 13, 1678, 736, 5852, 13, 13, 13, 1990, 8448, 29901, 13, 1678, 9995, 14199, 8640, 278, 1820, 2472, 1048, 263, 3362, 25031, 360, 29987, 29928, 4867, 1213, 15945, 13, 13, 1678, 4770, 2536, 1862, 1649, 353, 525, 25118, 742, 525, 978, 742, 525, 2271, 742, 525, 4882, 742, 525, 27382, 742, 525, 1975, 29915, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 4867, 29901, 12367, 4247, 29897, 1599, 6213, 29901, 13, 4706, 9995, 6644, 716, 8448, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 4867, 29901, 3362, 25031, 12367, 2239, 4867, 2943, 304, 6597, 3748, 848, 515, 29889, 13, 13, 4706, 498, 5727, 29901, 13, 9651, 7865, 2392, 29901, 297, 278, 1741, 310, 1820, 4567, 1819, 29892, 763, 263, 1369, 931, 29889, 13, 4706, 9995, 13, 4706, 1583, 29889, 25118, 29901, 851, 353, 4867, 29889, 2084, 877, 25118, 2824, 710, 13, 4706, 9995, 29956, 279, 25031, 4867, 501, 11150, 1213, 15945, 13, 4706, 1583, 29889, 978, 29901, 851, 353, 313, 13, 9651, 4867, 29889, 2084, 877, 1557, 24893, 2776, 571, 292, 742, 525, 6341, 1170, 2824, 710, 13, 9651, 470, 4867, 29889, 2084, 877, 1557, 24893, 742, 525, 978, 2824, 710, 29897, 13, 4706, 9995, 14199, 10483, 1024, 1213, 15945, 13, 4706, 1583, 29889, 2271, 353, 4867, 29889, 2084, 877, 4530, 786, 5983, 2824, 710, 13, 4706, 9995, 29956, 279, 25031, 4867, 1804, 786, 3988, 1213, 15945, 13, 4706, 1583, 29889, 4882, 29901, 851, 353, 4867, 29889, 2084, 877, 4882, 2824, 710, 13, 4706, 9995, 29956, 279, 25031, 4867, 4660, 29889, 313, 29872, 29889, 29887, 29889, 349, 7466, 29931, 3235, 29950, 3352, 29892, 360, 4717, 7818, 29892, 315, 23219, 20566, 5513, 15945, 13, 13, 4706, 8665, 353, 4867, 29889, 2084, 877, 2536, 327, 742, 525, 27382, 4178, 2824, 710, 13, 4706, 10614, 353, 4867, 29889, 2084, 877, 2536, 327, 742, 525, 1975, 4178, 2824, 710, 13, 4706, 260, 29920, 29918, 710, 353, 4867, 29889, 2084, 877, 2536, 327, 742, 525, 2230, 8028, 2824, 710, 470, 525, 3308, 29914, 29925, 562, 928, 29915, 13, 13, 4706, 565, 451, 903, 19651, 29918, 9933, 29898, 1311, 29889, 25118, 29892, 1583, 29889, 978, 29892, 1583, 29889, 4882, 29892, 1583, 29889, 2271, 29892, 8665, 29892, 10614, 29892, 260, 29920, 29918, 710, 1125, 13, 9651, 12020, 7865, 2392, 29898, 29888, 29915, 18552, 292, 1820, 1819, 363, 3748, 4867, 29901, 426, 7924, 29913, 1495, 13, 13, 4706, 260, 29920, 353, 282, 3637, 29920, 29889, 2230, 8028, 29898, 17559, 29918, 710, 29897, 13, 4706, 1583, 29889, 27382, 29901, 12865, 29889, 12673, 353, 12865, 29889, 12673, 29889, 3166, 10718, 4830, 29898, 27382, 467, 579, 603, 8028, 29898, 17559, 29897, 13, 4706, 9995, 14199, 1369, 931, 1213, 15945, 13, 4706, 1583, 29889, 1975, 29901, 12865, 29889, 12673, 353, 12865, 29889, 12673, 29889, 3166, 10718, 4830, 29898, 1975, 467, 579, 603, 8028, 29898, 17559, 29897, 13, 4706, 9995, 14199, 1095, 931, 1213, 15945, 13, 13, 1678, 732, 6799, 13, 1678, 822, 931, 29898, 1311, 29897, 1599, 851, 29901, 13, 4706, 9995, 1231, 20766, 3748, 1369, 29914, 355, 931, 1213, 15945, 13, 4706, 736, 285, 29915, 29912, 1311, 29889, 27382, 16664, 29899, 29902, 16664, 29924, 29995, 29886, 29913, 448, 426, 1311, 29889, 1975, 16664, 29899, 29902, 16664, 29924, 29995, 29886, 1273, 29999, 1273, 29890, 1273, 29881, 29892, 1273, 29979, 10162, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 29897, 1599, 851, 29901, 13, 4706, 736, 285, 29915, 14199, 703, 29912, 1311, 29889, 978, 17671, 426, 1311, 29889, 2230, 1118, 426, 1311, 29889, 4882, 1118, 318, 5416, 29901, 426, 1311, 29889, 25118, 1800, 29915, 13, 13, 13, 1990, 3362, 25031, 8787, 29901, 29871, 396, 282, 2904, 524, 29901, 11262, 29922, 517, 29877, 29899, 29888, 809, 29899, 3597, 29899, 23515, 13, 1678, 9995, 29956, 279, 25031, 3132, 3450, 1213, 15945, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3142, 29901, 851, 2433, 991, 597, 4495, 25031, 29889, 1212, 29914, 4262, 1519, 742, 5993, 29901, 851, 2433, 1495, 1599, 6213, 29901, 13, 4706, 9995, 6644, 3362, 25031, 3132, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 3142, 29901, 3362, 25031, 12367, 2239, 16248, 29889, 13, 4706, 9995, 13, 4706, 9066, 353, 6571, 13, 4706, 565, 5993, 29901, 13, 9651, 9066, 1839, 25471, 2033, 353, 285, 29915, 29933, 799, 261, 426, 6979, 10162, 13, 4706, 1583, 3032, 27882, 353, 319, 5971, 10493, 27395, 29898, 2271, 29922, 2271, 29892, 9066, 29922, 13662, 29897, 13, 4706, 1583, 3032, 4645, 353, 12477, 29898, 27882, 29922, 1311, 3032, 27882, 29892, 6699, 29918, 11010, 29918, 3166, 29918, 27882, 29922, 8824, 29897, 13, 4706, 330, 1519, 29918, 21707, 29889, 842, 10108, 29898, 21027, 29889, 29956, 25614, 29897, 29871, 396, 1134, 29901, 11455, 13, 13, 1678, 7465, 822, 679, 29918, 29887, 1280, 29898, 13, 9651, 1583, 29892, 2243, 688, 29901, 851, 29892, 8665, 29918, 7045, 29901, 28379, 29961, 12673, 29889, 12673, 13192, 8516, 13, 9651, 1723, 1599, 20688, 21575, 29961, 14199, 29892, 6213, 5387, 13, 4706, 9995, 3010, 3362, 25031, 363, 8090, 29889, 13, 13, 4706, 826, 3174, 29901, 13, 9651, 2243, 688, 29901, 2893, 9215, 1347, 363, 278, 1370, 25031, 1741, 29889, 13, 9651, 8665, 29918, 7045, 29901, 9333, 736, 12482, 6763, 1156, 445, 931, 29889, 13, 4706, 16969, 29901, 13, 9651, 3251, 1061, 310, 8090, 29889, 13, 4706, 9995, 13, 4706, 8665, 29918, 7045, 353, 8665, 29918, 7045, 565, 8665, 29918, 7045, 1683, 12865, 29889, 12673, 29889, 3707, 580, 13, 4706, 3855, 353, 903, 13356, 24422, 29889, 4830, 29898, 29517, 29922, 29517, 29892, 8665, 13555, 29922, 27382, 29918, 7045, 29889, 10718, 4830, 3101, 13, 4706, 2346, 353, 330, 1519, 29898, 29939, 29897, 13, 4706, 1121, 353, 12367, 4247, 29898, 20675, 1583, 3032, 4645, 29889, 7978, 29918, 12674, 29898, 1972, 876, 29871, 396, 1134, 29901, 11455, 13, 4706, 363, 4867, 297, 1121, 29889, 2084, 877, 3696, 29903, 10964, 742, 525, 18010, 2824, 23583, 29901, 13, 9651, 4660, 353, 4867, 29889, 2084, 877, 4882, 2824, 710, 13, 9651, 565, 4660, 451, 297, 6702, 7056, 13367, 3235, 29950, 3352, 742, 525, 29928, 4717, 7818, 742, 525, 29907, 23219, 20566, 29374, 13, 18884, 12183, 29889, 25442, 877, 29965, 13996, 6021, 21396, 4660, 29901, 1273, 29879, 742, 4867, 29897, 13, 9651, 565, 4660, 2804, 525, 7056, 13367, 3235, 29950, 3352, 2396, 13, 18884, 6773, 13, 9651, 7709, 8448, 29898, 7924, 29897, 13, 2 ]
ramachandran/plot.py
leimao/Ramachandran
2
174425
from typing import List, Tuple, Optional import os import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.ticker as ticker from matplotlib import cm import matplotlib.colors as mplcolors from ramachandran.io import read_residue_torsion_collection_from_file def get_coordinates_on_reference_map( phi_psi_angle: Tuple[float, float], reference_map: np.ndarray) -> Tuple[int, int]: phi = phi_psi_angle[0] psi = phi_psi_angle[1] height = reference_map.shape[0] width = reference_map.shape[1] i = int((180 - psi) / 360 * height) j = int((phi + 180) / 360 * width) # If i or j == resolution, adjust it. if i == height: i = height - 1 if j == width: j = width - 1 return (i, j) def create_ramachandran_plot(phi_psi_angles: List[Tuple[float, float]], plot_file_path: str, reference_map: Optional[np.ndarray] = None, cmap: Optional[mplcolors.ListedColormap] = None, protein_name: Optional[str] = None, rendering_interpolation: bool = True) -> None: phi_psi_angles_numpy = np.array(phi_psi_angles) x_numpy = phi_psi_angles_numpy[:, 0] y_numpy = phi_psi_angles_numpy[:, 1] fig = plt.figure(figsize=(10, 10)) ax = fig.add_subplot(111) if protein_name is not None: ax.set_title(protein_name, fontsize=24) interpolation = None if rendering_interpolation is True: interpolation = "bilinear" if reference_map is not None: percentile_1 = np.percentile(reference_map, 60) percentile_2 = np.percentile(reference_map, 90) ax.imshow(np.rot90(reference_map), interpolation=interpolation, cmap=cmap, norm=mplcolors.BoundaryNorm( boundaries=[0, percentile_1, percentile_2, 1], ncolors=cmap.N), origin="upper", extent=(-180, 180, -180, 180)) # Find outliers outliers_idx = [] for i, phi_psi_angle in enumerate(phi_psi_angles): map_i, map_j = get_coordinates_on_reference_map( phi_psi_angle=phi_psi_angle, reference_map=np.rot90(reference_map)) if np.rot90(reference_map)[map_i, map_j] < percentile_1: outliers_idx.append(i) x_outliers_numpy = x_numpy[outliers_idx] y_outliers_numpy = y_numpy[outliers_idx] x_numpy = np.delete(x_numpy, outliers_idx) y_numpy = np.delete(y_numpy, outliers_idx) ax.scatter(x_outliers_numpy, y_outliers_numpy, s=20, color="red", edgecolors="black") ax.scatter(x_numpy, y_numpy, s=20, color="blue", edgecolors="black") ax.set_xlim(-180, 180) ax.set_ylim(-180, 180) ax.xaxis.set_major_locator(ticker.MultipleLocator(45)) ax.yaxis.set_major_locator(ticker.MultipleLocator(45)) ax.xaxis.set_tick_params(labelsize=12) ax.yaxis.set_tick_params(labelsize=12) ax.plot([-180, 180], [0, 0], "--", linewidth=0.5, color="black") ax.plot([0, 0], [-180, 180], "--", linewidth=0.5, color="black") ax.set_xlabel(r"${\phi}$", fontsize=18, fontweight="bold") ax.set_ylabel(r"${\psi}$", fontsize=18, fontweight="bold") fig.savefig(plot_file_path, format="svg", dpi=600, bbox_inches="tight") plt.close() return def create_ramachandran_plots_from_file( file_path: str, save_dir_path: str, # reference_map_type: Optional[str] = "unsmoothed", protein_name: Optional[str] = None, rendering_interpolation: bool = False) -> None: if not os.path.exists(save_dir_path): os.makedirs(save_dir_path) residue_torsion_collection = read_residue_torsion_collection_from_file( file_path=file_path) phi_psi_angles_general = residue_torsion_collection.collect_torsion_angles_general( ) phi_psi_angles_gly = residue_torsion_collection.collect_torsion_angles_gly( ) phi_psi_angles_pro = residue_torsion_collection.collect_torsion_angles_pro( ) phi_psi_angles_prepro = residue_torsion_collection.collect_torsion_angles_prepro( ) phi_psi_angles_list = [ phi_psi_angles_general, phi_psi_angles_gly, phi_psi_angles_pro, phi_psi_angles_prepro ] package_dir, filename = os.path.split(__file__) # Using unsmoothed probability.npz is problematic because # many probabilities are exactly zeros and thus the many percentiles are exactly zeros. # Plotting these zero values is very problematic. # Gaussian density is fine because none of the probability density values are exactly zero. # if reference_map_type == "unsmoothed": # npz_file_path = os.path.join(package_dir, "data", "probability.npz") # npz_file = np.load(npz_file_path) # elif reference_map_type == "smoothed": # npz_file_path = os.path.join(package_dir, "data", "gaussian_density.npz") # npz_file = np.load(npz_file_path) # else: # raise RuntimeError("Unsupported reference map type.") npz_file_path = os.path.join(package_dir, "data", "gaussian_density.npz") npz_file = np.load(npz_file_path) reference_map_general = npz_file["general"] reference_map_gly = npz_file["gly"] reference_map_pro = npz_file["pro"] reference_map_prepro = npz_file["prepro"] reference_map_list = [ reference_map_general, reference_map_gly, reference_map_pro, reference_map_prepro ] # Using Erdős Gábor's cmaps. # https://github.com/gerdos/PyRAMA/blob/301df17e5f2c32544b34321c4f8b0254697183ce/pyrama/config.py cmap_general = mplcolors.ListedColormap(['#FFFFFF', '#B3E8FF', '#7FD9FF']) cmap_gly = mplcolors.ListedColormap(['#FFFFFF', '#FFE8C5', '#FFCC7F']) cmap_pro = mplcolors.ListedColormap(['#FFFFFF', '#D0FFC5', '#7FFF8C']) cmap_prepro = mplcolors.ListedColormap(['#FFFFFF', '#B3E8FF', '#7FD9FF']) cmap_list = [cmap_general, cmap_gly, cmap_pro, cmap_prepro] filename_list = ["general.svg", "gly.svg", "pro.svg", "prepro.svg"] file_path_list = [ os.path.join(save_dir_path, filename) for filename in filename_list ] for phi_psi_angles, reference_map, cmap, file_path in zip( phi_psi_angles_list, reference_map_list, cmap_list, file_path_list): create_ramachandran_plot( phi_psi_angles=phi_psi_angles, reference_map=reference_map, cmap=cmap, plot_file_path=file_path, rendering_interpolation=rendering_interpolation, protein_name=protein_name) return
[ 1, 515, 19229, 1053, 2391, 29892, 12603, 552, 29892, 28379, 13, 5215, 2897, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 13, 2922, 17357, 29889, 1509, 877, 29909, 1505, 1495, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 22889, 29889, 29873, 6541, 408, 260, 6541, 13, 3166, 22889, 1053, 7477, 13, 5215, 22889, 29889, 27703, 408, 286, 572, 27703, 13, 3166, 13472, 496, 392, 661, 29889, 601, 1053, 1303, 29918, 690, 333, 434, 29918, 29873, 943, 291, 29918, 10855, 29918, 3166, 29918, 1445, 13, 13, 13, 1753, 679, 29918, 1111, 24266, 29918, 265, 29918, 5679, 29918, 1958, 29898, 13, 4706, 1374, 29875, 29918, 6134, 29918, 2521, 29901, 12603, 552, 29961, 7411, 29892, 5785, 1402, 13, 4706, 3407, 29918, 1958, 29901, 7442, 29889, 299, 2378, 29897, 1599, 12603, 552, 29961, 524, 29892, 938, 5387, 13, 13, 1678, 1374, 29875, 353, 1374, 29875, 29918, 6134, 29918, 2521, 29961, 29900, 29962, 13, 1678, 282, 1039, 353, 1374, 29875, 29918, 6134, 29918, 2521, 29961, 29896, 29962, 13, 13, 1678, 3171, 353, 3407, 29918, 1958, 29889, 12181, 29961, 29900, 29962, 13, 1678, 2920, 353, 3407, 29918, 1958, 29889, 12181, 29961, 29896, 29962, 13, 13, 1678, 474, 353, 938, 3552, 29896, 29947, 29900, 448, 282, 1039, 29897, 847, 29871, 29941, 29953, 29900, 334, 3171, 29897, 13, 1678, 432, 353, 938, 3552, 2876, 718, 29871, 29896, 29947, 29900, 29897, 847, 29871, 29941, 29953, 29900, 334, 2920, 29897, 13, 13, 1678, 396, 960, 474, 470, 432, 1275, 10104, 29892, 10365, 372, 29889, 13, 1678, 565, 474, 1275, 3171, 29901, 13, 4706, 474, 353, 3171, 448, 29871, 29896, 13, 1678, 565, 432, 1275, 2920, 29901, 13, 4706, 432, 353, 2920, 448, 29871, 29896, 13, 13, 1678, 736, 313, 29875, 29892, 432, 29897, 13, 13, 13, 1753, 1653, 29918, 2572, 496, 392, 661, 29918, 5317, 29898, 2876, 29918, 6134, 29918, 19536, 29901, 2391, 29961, 23215, 552, 29961, 7411, 29892, 5785, 20526, 13, 462, 632, 6492, 29918, 1445, 29918, 2084, 29901, 851, 29892, 13, 462, 632, 3407, 29918, 1958, 29901, 28379, 29961, 9302, 29889, 299, 2378, 29962, 353, 6213, 29892, 13, 462, 632, 274, 1958, 29901, 28379, 29961, 29885, 572, 27703, 29889, 1293, 287, 1625, 555, 481, 29962, 353, 6213, 29892, 13, 462, 632, 26823, 29918, 978, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 462, 632, 15061, 29918, 1639, 3733, 362, 29901, 6120, 353, 5852, 29897, 1599, 6213, 29901, 13, 13, 1678, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 23749, 353, 7442, 29889, 2378, 29898, 2876, 29918, 6134, 29918, 19536, 29897, 13, 1678, 921, 29918, 23749, 353, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 23749, 7503, 29892, 29871, 29900, 29962, 13, 1678, 343, 29918, 23749, 353, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 23749, 7503, 29892, 29871, 29896, 29962, 13, 13, 1678, 2537, 353, 14770, 29889, 4532, 29898, 1003, 2311, 7607, 29896, 29900, 29892, 29871, 29896, 29900, 876, 13, 13, 1678, 4853, 353, 2537, 29889, 1202, 29918, 1491, 5317, 29898, 29896, 29896, 29896, 29897, 13, 1678, 565, 26823, 29918, 978, 338, 451, 6213, 29901, 13, 4706, 4853, 29889, 842, 29918, 3257, 29898, 14676, 262, 29918, 978, 29892, 4079, 2311, 29922, 29906, 29946, 29897, 13, 13, 1678, 29694, 353, 6213, 13, 1678, 565, 15061, 29918, 1639, 3733, 362, 338, 5852, 29901, 13, 4706, 29694, 353, 376, 18152, 457, 279, 29908, 13, 13, 1678, 565, 3407, 29918, 1958, 338, 451, 6213, 29901, 13, 13, 4706, 10151, 488, 29918, 29896, 353, 7442, 29889, 25376, 488, 29898, 5679, 29918, 1958, 29892, 29871, 29953, 29900, 29897, 13, 4706, 10151, 488, 29918, 29906, 353, 7442, 29889, 25376, 488, 29898, 5679, 29918, 1958, 29892, 29871, 29929, 29900, 29897, 13, 13, 4706, 4853, 29889, 326, 4294, 29898, 9302, 29889, 5450, 29929, 29900, 29898, 5679, 29918, 1958, 511, 13, 462, 29871, 29694, 29922, 1639, 3733, 362, 29892, 13, 462, 29871, 274, 1958, 29922, 29883, 1958, 29892, 13, 462, 29871, 6056, 29922, 29885, 572, 27703, 29889, 17109, 653, 29940, 555, 29898, 13, 462, 418, 24371, 11759, 29900, 29892, 10151, 488, 29918, 29896, 29892, 10151, 488, 29918, 29906, 29892, 29871, 29896, 1402, 13, 462, 418, 302, 27703, 29922, 29883, 1958, 29889, 29940, 511, 13, 462, 29871, 3978, 543, 21064, 613, 13, 462, 29871, 15834, 29922, 6278, 29896, 29947, 29900, 29892, 29871, 29896, 29947, 29900, 29892, 448, 29896, 29947, 29900, 29892, 29871, 29896, 29947, 29900, 876, 13, 13, 4706, 396, 10987, 714, 27801, 13, 4706, 714, 27801, 29918, 13140, 353, 5159, 13, 4706, 363, 474, 29892, 1374, 29875, 29918, 6134, 29918, 2521, 297, 26985, 29898, 2876, 29918, 6134, 29918, 19536, 1125, 13, 13, 9651, 2910, 29918, 29875, 29892, 2910, 29918, 29926, 353, 679, 29918, 1111, 24266, 29918, 265, 29918, 5679, 29918, 1958, 29898, 13, 18884, 1374, 29875, 29918, 6134, 29918, 2521, 29922, 2876, 29918, 6134, 29918, 2521, 29892, 13, 18884, 3407, 29918, 1958, 29922, 9302, 29889, 5450, 29929, 29900, 29898, 5679, 29918, 1958, 876, 13, 9651, 565, 7442, 29889, 5450, 29929, 29900, 29898, 5679, 29918, 1958, 9601, 1958, 29918, 29875, 29892, 2910, 29918, 29926, 29962, 529, 10151, 488, 29918, 29896, 29901, 13, 18884, 714, 27801, 29918, 13140, 29889, 4397, 29898, 29875, 29897, 13, 13, 4706, 921, 29918, 449, 27801, 29918, 23749, 353, 921, 29918, 23749, 29961, 449, 27801, 29918, 13140, 29962, 13, 4706, 343, 29918, 449, 27801, 29918, 23749, 353, 343, 29918, 23749, 29961, 449, 27801, 29918, 13140, 29962, 13, 13, 4706, 921, 29918, 23749, 353, 7442, 29889, 8143, 29898, 29916, 29918, 23749, 29892, 714, 27801, 29918, 13140, 29897, 13, 4706, 343, 29918, 23749, 353, 7442, 29889, 8143, 29898, 29891, 29918, 23749, 29892, 714, 27801, 29918, 13140, 29897, 13, 13, 4706, 4853, 29889, 1557, 2620, 29898, 29916, 29918, 449, 27801, 29918, 23749, 29892, 13, 462, 259, 343, 29918, 449, 27801, 29918, 23749, 29892, 13, 462, 259, 269, 29922, 29906, 29900, 29892, 13, 462, 259, 2927, 543, 1127, 613, 13, 462, 259, 7636, 27703, 543, 8517, 1159, 13, 13, 1678, 4853, 29889, 1557, 2620, 29898, 29916, 29918, 23749, 29892, 343, 29918, 23749, 29892, 269, 29922, 29906, 29900, 29892, 2927, 543, 9539, 613, 7636, 27703, 543, 8517, 1159, 13, 13, 1678, 4853, 29889, 842, 29918, 29916, 2576, 6278, 29896, 29947, 29900, 29892, 29871, 29896, 29947, 29900, 29897, 13, 1678, 4853, 29889, 842, 29918, 29891, 2576, 6278, 29896, 29947, 29900, 29892, 29871, 29896, 29947, 29900, 29897, 13, 13, 1678, 4853, 29889, 29916, 8990, 29889, 842, 29918, 21355, 29918, 2029, 1061, 29898, 29873, 6541, 29889, 15329, 552, 3524, 1061, 29898, 29946, 29945, 876, 13, 1678, 4853, 29889, 29891, 8990, 29889, 842, 29918, 21355, 29918, 2029, 1061, 29898, 29873, 6541, 29889, 15329, 552, 3524, 1061, 29898, 29946, 29945, 876, 13, 13, 1678, 4853, 29889, 29916, 8990, 29889, 842, 29918, 24667, 29918, 7529, 29898, 1643, 2311, 29922, 29896, 29906, 29897, 13, 1678, 4853, 29889, 29891, 8990, 29889, 842, 29918, 24667, 29918, 7529, 29898, 1643, 2311, 29922, 29896, 29906, 29897, 13, 13, 1678, 4853, 29889, 5317, 4197, 29899, 29896, 29947, 29900, 29892, 29871, 29896, 29947, 29900, 1402, 518, 29900, 29892, 29871, 29900, 1402, 376, 489, 613, 1196, 2103, 29922, 29900, 29889, 29945, 29892, 2927, 543, 8517, 1159, 13, 1678, 4853, 29889, 5317, 4197, 29900, 29892, 29871, 29900, 1402, 21069, 29896, 29947, 29900, 29892, 29871, 29896, 29947, 29900, 1402, 376, 489, 613, 1196, 2103, 29922, 29900, 29889, 29945, 29892, 2927, 543, 8517, 1159, 13, 13, 1678, 4853, 29889, 842, 29918, 29916, 1643, 29898, 29878, 29908, 29938, 741, 2876, 1042, 613, 4079, 2311, 29922, 29896, 29947, 29892, 4079, 7915, 543, 8934, 1159, 13, 1678, 4853, 29889, 842, 29918, 29891, 1643, 29898, 29878, 29908, 29938, 741, 6134, 1042, 613, 4079, 2311, 29922, 29896, 29947, 29892, 4079, 7915, 543, 8934, 1159, 13, 13, 1678, 2537, 29889, 7620, 1003, 29898, 5317, 29918, 1445, 29918, 2084, 29892, 3402, 543, 15120, 613, 270, 1631, 29922, 29953, 29900, 29900, 29892, 289, 1884, 29918, 262, 6609, 543, 29873, 523, 1159, 13, 1678, 14770, 29889, 5358, 580, 13, 13, 1678, 736, 13, 13, 13, 1753, 1653, 29918, 2572, 496, 392, 661, 29918, 26762, 29918, 3166, 29918, 1445, 29898, 13, 4706, 934, 29918, 2084, 29901, 851, 29892, 13, 4706, 4078, 29918, 3972, 29918, 2084, 29901, 851, 29892, 13, 4706, 396, 3407, 29918, 1958, 29918, 1853, 29901, 28379, 29961, 710, 29962, 353, 376, 348, 3844, 6983, 287, 613, 13, 4706, 26823, 29918, 978, 29901, 28379, 29961, 710, 29962, 353, 6213, 29892, 13, 4706, 15061, 29918, 1639, 3733, 362, 29901, 6120, 353, 7700, 29897, 1599, 6213, 29901, 13, 13, 1678, 565, 451, 2897, 29889, 2084, 29889, 9933, 29898, 7620, 29918, 3972, 29918, 2084, 1125, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 7620, 29918, 3972, 29918, 2084, 29897, 13, 13, 1678, 10995, 434, 29918, 29873, 943, 291, 29918, 10855, 353, 1303, 29918, 690, 333, 434, 29918, 29873, 943, 291, 29918, 10855, 29918, 3166, 29918, 1445, 29898, 13, 4706, 934, 29918, 2084, 29922, 1445, 29918, 2084, 29897, 13, 13, 1678, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 17492, 353, 10995, 434, 29918, 29873, 943, 291, 29918, 10855, 29889, 15914, 29918, 29873, 943, 291, 29918, 19536, 29918, 17492, 29898, 13, 1678, 1723, 13, 1678, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 16808, 353, 10995, 434, 29918, 29873, 943, 291, 29918, 10855, 29889, 15914, 29918, 29873, 943, 291, 29918, 19536, 29918, 16808, 29898, 13, 1678, 1723, 13, 1678, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 771, 353, 10995, 434, 29918, 29873, 943, 291, 29918, 10855, 29889, 15914, 29918, 29873, 943, 291, 29918, 19536, 29918, 771, 29898, 13, 1678, 1723, 13, 1678, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 1457, 771, 353, 10995, 434, 29918, 29873, 943, 291, 29918, 10855, 29889, 15914, 29918, 29873, 943, 291, 29918, 19536, 29918, 1457, 771, 29898, 13, 1678, 1723, 13, 13, 1678, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 1761, 353, 518, 13, 4706, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 17492, 29892, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 16808, 29892, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 771, 29892, 13, 4706, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 1457, 771, 13, 1678, 4514, 13, 13, 1678, 3577, 29918, 3972, 29892, 10422, 353, 2897, 29889, 2084, 29889, 5451, 22168, 1445, 1649, 29897, 13, 13, 1678, 396, 5293, 443, 3844, 6983, 287, 6976, 29889, 9302, 29920, 338, 1108, 2454, 1363, 13, 1678, 396, 1784, 2070, 11614, 526, 3721, 24786, 322, 4550, 278, 1784, 10151, 5475, 526, 3721, 24786, 29889, 13, 1678, 396, 18399, 1259, 1438, 5225, 1819, 338, 1407, 1108, 2454, 29889, 13, 1678, 396, 22477, 9027, 338, 2691, 1363, 5642, 310, 278, 6976, 9027, 1819, 526, 3721, 5225, 29889, 13, 13, 1678, 396, 565, 3407, 29918, 1958, 29918, 1853, 1275, 376, 348, 3844, 6983, 287, 1115, 13, 1678, 396, 268, 7442, 29920, 29918, 1445, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 5113, 29918, 3972, 29892, 376, 1272, 613, 376, 22795, 3097, 29889, 9302, 29920, 1159, 13, 1678, 396, 268, 7442, 29920, 29918, 1445, 353, 7442, 29889, 1359, 29898, 9302, 29920, 29918, 1445, 29918, 2084, 29897, 13, 1678, 396, 25342, 3407, 29918, 1958, 29918, 1853, 1275, 376, 3844, 6983, 287, 1115, 13, 1678, 396, 268, 7442, 29920, 29918, 1445, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 5113, 29918, 3972, 29892, 376, 1272, 613, 376, 29887, 17019, 29918, 21518, 537, 29889, 9302, 29920, 1159, 13, 1678, 396, 268, 7442, 29920, 29918, 1445, 353, 7442, 29889, 1359, 29898, 9302, 29920, 29918, 1445, 29918, 2084, 29897, 13, 1678, 396, 1683, 29901, 13, 1678, 396, 268, 12020, 24875, 2392, 703, 25807, 29884, 3016, 287, 3407, 2910, 1134, 23157, 13, 13, 1678, 7442, 29920, 29918, 1445, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 5113, 29918, 3972, 29892, 376, 1272, 613, 376, 29887, 17019, 29918, 21518, 537, 29889, 9302, 29920, 1159, 13, 1678, 7442, 29920, 29918, 1445, 353, 7442, 29889, 1359, 29898, 9302, 29920, 29918, 1445, 29918, 2084, 29897, 13, 13, 1678, 3407, 29918, 1958, 29918, 17492, 353, 7442, 29920, 29918, 1445, 3366, 17492, 3108, 13, 1678, 3407, 29918, 1958, 29918, 16808, 353, 7442, 29920, 29918, 1445, 3366, 16808, 3108, 13, 1678, 3407, 29918, 1958, 29918, 771, 353, 7442, 29920, 29918, 1445, 3366, 771, 3108, 13, 1678, 3407, 29918, 1958, 29918, 1457, 771, 353, 7442, 29920, 29918, 1445, 3366, 1457, 771, 3108, 13, 13, 1678, 3407, 29918, 1958, 29918, 1761, 353, 518, 13, 4706, 3407, 29918, 1958, 29918, 17492, 29892, 3407, 29918, 1958, 29918, 16808, 29892, 3407, 29918, 1958, 29918, 771, 29892, 13, 4706, 3407, 29918, 1958, 29918, 1457, 771, 13, 1678, 4514, 13, 13, 1678, 396, 5293, 29446, 14773, 402, 29976, 4089, 29915, 29879, 274, 10339, 29889, 13, 1678, 396, 2045, 597, 3292, 29889, 510, 29914, 914, 29881, 359, 29914, 19737, 4717, 1529, 29914, 10054, 29914, 29941, 29900, 29896, 2176, 29896, 29955, 29872, 29945, 29888, 29906, 29883, 29941, 29906, 29945, 29946, 29946, 29890, 29941, 29946, 29941, 29906, 29896, 29883, 29946, 29888, 29947, 29890, 29900, 29906, 29945, 29946, 29953, 29929, 29955, 29896, 29947, 29941, 346, 29914, 2272, 20556, 29914, 2917, 29889, 2272, 13, 1678, 274, 1958, 29918, 17492, 353, 286, 572, 27703, 29889, 1293, 287, 1625, 555, 481, 18959, 29937, 22098, 4198, 742, 16321, 29933, 29941, 29923, 29947, 4198, 742, 16321, 29955, 26453, 29929, 4198, 11287, 13, 1678, 274, 1958, 29918, 16808, 353, 286, 572, 27703, 29889, 1293, 287, 1625, 555, 481, 18959, 29937, 22098, 4198, 742, 16321, 4198, 29923, 29947, 29907, 29945, 742, 16321, 4198, 4174, 29955, 29943, 11287, 13, 1678, 274, 1958, 29918, 771, 353, 286, 572, 27703, 29889, 1293, 287, 1625, 555, 481, 18959, 29937, 22098, 4198, 742, 16321, 29928, 29900, 4198, 29907, 29945, 742, 16321, 29955, 4198, 29943, 29947, 29907, 11287, 13, 1678, 274, 1958, 29918, 1457, 771, 353, 286, 572, 27703, 29889, 1293, 287, 1625, 555, 481, 18959, 29937, 22098, 4198, 742, 16321, 29933, 29941, 29923, 29947, 4198, 742, 16321, 29955, 26453, 29929, 4198, 11287, 13, 13, 1678, 274, 1958, 29918, 1761, 353, 518, 29883, 1958, 29918, 17492, 29892, 274, 1958, 29918, 16808, 29892, 274, 1958, 29918, 771, 29892, 274, 1958, 29918, 1457, 771, 29962, 13, 13, 1678, 10422, 29918, 1761, 353, 6796, 17492, 29889, 15120, 613, 376, 16808, 29889, 15120, 613, 376, 771, 29889, 15120, 613, 376, 1457, 771, 29889, 15120, 3108, 13, 1678, 934, 29918, 2084, 29918, 1761, 353, 518, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 7620, 29918, 3972, 29918, 2084, 29892, 10422, 29897, 363, 10422, 297, 10422, 29918, 1761, 13, 1678, 4514, 13, 13, 1678, 363, 1374, 29875, 29918, 6134, 29918, 19536, 29892, 3407, 29918, 1958, 29892, 274, 1958, 29892, 934, 29918, 2084, 297, 14319, 29898, 13, 9651, 1374, 29875, 29918, 6134, 29918, 19536, 29918, 1761, 29892, 3407, 29918, 1958, 29918, 1761, 29892, 274, 1958, 29918, 1761, 29892, 13, 9651, 934, 29918, 2084, 29918, 1761, 1125, 13, 13, 4706, 1653, 29918, 2572, 496, 392, 661, 29918, 5317, 29898, 13, 9651, 1374, 29875, 29918, 6134, 29918, 19536, 29922, 2876, 29918, 6134, 29918, 19536, 29892, 13, 9651, 3407, 29918, 1958, 29922, 5679, 29918, 1958, 29892, 13, 9651, 274, 1958, 29922, 29883, 1958, 29892, 13, 9651, 6492, 29918, 1445, 29918, 2084, 29922, 1445, 29918, 2084, 29892, 13, 9651, 15061, 29918, 1639, 3733, 362, 29922, 9482, 292, 29918, 1639, 3733, 362, 29892, 13, 9651, 26823, 29918, 978, 29922, 14676, 262, 29918, 978, 29897, 13, 13, 1678, 736, 13, 2 ]
geocsv/coltypes.py
poliquin/geocsv-to-mysql
0
1612453
<reponame>poliquin/geocsv-to-mysql<gh_stars>0 import re """ Convert a GeoCSV column type to a suitable MySQL type. """ def parse_coltype(txt): """Parse a column specification into a type, subtype tuple.""" m = FIELD.match(txt) if m is None: raise TypeError('Invalid column type: {}'.format(txt)) coltype, subtype = m.groups() return coltype, subtype, MYSQL_TYPES[coltype](subtype) def mysql_real_type(subtype=None): """Determine real column type.""" try: return {None: 'DOUBLE', 'Float32': 'FLOAT'}[subtype] except KeyError: pass # assume subtype is a precision prec = re.match(r'([0-9]+)[.,]([0-9]+)', subtype) if prec is None: raise ValueError('Invalid subtype for Real column: {}'.format(subtype)) m, n = int(prec.group(1)), int(prec.group(2)) return 'DECIMAL({}, {})'.format(m, n) def _mysql_int_length(subtype): """Determine smallest field that can hold data with given length.""" try: length = int(subtype) except ValueError: raise ValueError( 'Invalid subtype for Integer column: {}'.format(subtype) ) if length < 3: kind = 'TINYINT' elif length < 4: kind = 'SMALLINT' elif length < 7: kind = 'MEDIUMINT' elif length <= 10: kind = 'INT' else: kind = 'BIGINT' return '{}({})'.format(kind, length) def mysql_integer_type(subtype=None): """Determine integer column type.""" try: return {None: 'INT', 'Int16': 'SMALLINT', 'Boolean': 'BOOLEAN'}[subtype] except KeyError: pass return _mysql_int_length(subtype) def mysql_string_type(subtype=None, varchar_only=False): if subtype is None: return 'VARCHAR(255)' try: length = int(subtype) except ValueError: raise ValueError( 'Invalid subtype for String column: {}'.format(subtype) ) if not varchar_only and length <= 4: return 'CHAR({})'.format(length) else: return 'VARCHAR({})'.format(length) FIELD = re.compile( r"""(WKT|Integer6?4?|Real|String|Date|Time|DateTime|Binary) (?:\(([0-9.]+|Boolean|Int16|Float32)\))? """, re.I | re.X ) MYSQL_TYPES = { 'WKT': lambda x: 'GEOMETRY', 'Integer64': lambda x: 'BIGINT', 'Integer': mysql_integer_type, 'Real': mysql_real_type, 'String': mysql_string_type, 'Date': lambda x: 'DATE', 'Time': lambda x: 'TIME', 'DateTime': lambda x: 'DATETIME', 'Binary': lambda x: 'BLOB' }
[ 1, 529, 276, 1112, 420, 29958, 3733, 8105, 262, 29914, 479, 542, 4501, 29899, 517, 29899, 7938, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 13, 5215, 337, 13, 13, 15945, 29908, 13, 18455, 263, 1879, 29877, 29907, 7597, 1897, 1134, 304, 263, 13907, 9254, 1134, 29889, 13, 15945, 29908, 13, 13, 13, 1753, 6088, 29918, 1054, 1853, 29898, 3945, 1125, 13, 1678, 9995, 12914, 263, 1897, 21992, 964, 263, 1134, 29892, 1014, 1853, 18761, 1213, 15945, 13, 13, 1678, 286, 353, 9338, 27286, 29889, 4352, 29898, 3945, 29897, 13, 1678, 565, 286, 338, 6213, 29901, 13, 4706, 12020, 20948, 877, 13919, 1897, 1134, 29901, 6571, 4286, 4830, 29898, 3945, 876, 13, 13, 1678, 784, 1853, 29892, 1014, 1853, 353, 286, 29889, 13155, 580, 13, 1678, 736, 784, 1853, 29892, 1014, 1853, 29892, 19519, 4176, 29918, 15631, 29925, 2890, 29961, 1054, 1853, 850, 1491, 1853, 29897, 13, 13, 13, 1753, 5749, 29918, 6370, 29918, 1853, 29898, 1491, 1853, 29922, 8516, 1125, 13, 1678, 9995, 6362, 837, 457, 1855, 1897, 1134, 1213, 15945, 13, 13, 1678, 1018, 29901, 13, 4706, 736, 426, 8516, 29901, 525, 3970, 7466, 1307, 742, 525, 11031, 29941, 29906, 2396, 525, 29943, 3927, 1299, 24264, 1491, 1853, 29962, 13, 1678, 5174, 7670, 2392, 29901, 13, 4706, 1209, 13, 13, 1678, 396, 5251, 1014, 1853, 338, 263, 16716, 13, 1678, 8303, 353, 337, 29889, 4352, 29898, 29878, 29915, 4197, 29900, 29899, 29929, 10062, 9601, 1696, 850, 29961, 29900, 29899, 29929, 10062, 29897, 742, 1014, 1853, 29897, 13, 1678, 565, 8303, 338, 6213, 29901, 13, 4706, 12020, 7865, 2392, 877, 13919, 1014, 1853, 363, 8195, 1897, 29901, 6571, 4286, 4830, 29898, 1491, 1853, 876, 13, 13, 1678, 286, 29892, 302, 353, 938, 29898, 17990, 29889, 2972, 29898, 29896, 8243, 938, 29898, 17990, 29889, 2972, 29898, 29906, 876, 13, 1678, 736, 525, 2287, 29907, 2260, 29931, 3319, 1118, 426, 1800, 4286, 4830, 29898, 29885, 29892, 302, 29897, 13, 13, 13, 1753, 903, 7938, 29918, 524, 29918, 2848, 29898, 1491, 1853, 1125, 13, 1678, 9995, 6362, 837, 457, 19087, 1746, 393, 508, 4808, 848, 411, 2183, 3309, 1213, 15945, 13, 13, 1678, 1018, 29901, 13, 4706, 3309, 353, 938, 29898, 1491, 1853, 29897, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 12020, 7865, 2392, 29898, 13, 9651, 525, 13919, 1014, 1853, 363, 8102, 1897, 29901, 6571, 4286, 4830, 29898, 1491, 1853, 29897, 13, 4706, 1723, 13, 13, 1678, 565, 3309, 529, 29871, 29941, 29901, 13, 4706, 2924, 353, 525, 29911, 1177, 29979, 10192, 29915, 13, 1678, 25342, 3309, 529, 29871, 29946, 29901, 13, 4706, 2924, 353, 525, 29903, 1529, 2208, 10192, 29915, 13, 1678, 25342, 3309, 529, 29871, 29955, 29901, 13, 4706, 2924, 353, 525, 2303, 4571, 5005, 10192, 29915, 13, 1678, 25342, 3309, 5277, 29871, 29896, 29900, 29901, 13, 4706, 2924, 353, 525, 10192, 29915, 13, 1678, 1683, 29901, 13, 4706, 2924, 353, 525, 29933, 6259, 10192, 29915, 13, 13, 1678, 736, 22372, 2119, 29912, 1800, 4286, 4830, 29898, 14380, 29892, 3309, 29897, 13, 13, 13, 1753, 5749, 29918, 16031, 29918, 1853, 29898, 1491, 1853, 29922, 8516, 1125, 13, 1678, 9995, 6362, 837, 457, 6043, 1897, 1134, 1213, 15945, 13, 13, 1678, 1018, 29901, 13, 4706, 736, 426, 8516, 29901, 525, 10192, 742, 525, 2928, 29896, 29953, 2396, 525, 29903, 1529, 2208, 10192, 742, 525, 18146, 2396, 525, 8456, 29949, 1307, 2190, 24264, 1491, 1853, 29962, 13, 1678, 5174, 7670, 2392, 29901, 13, 4706, 1209, 13, 13, 1678, 736, 903, 7938, 29918, 524, 29918, 2848, 29898, 1491, 1853, 29897, 13, 13, 13, 1753, 5749, 29918, 1807, 29918, 1853, 29898, 1491, 1853, 29922, 8516, 29892, 15236, 29918, 6194, 29922, 8824, 1125, 13, 13, 1678, 565, 1014, 1853, 338, 6213, 29901, 13, 4706, 736, 525, 29963, 15364, 29898, 29906, 29945, 29945, 16029, 13, 13, 1678, 1018, 29901, 13, 4706, 3309, 353, 938, 29898, 1491, 1853, 29897, 13, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 12020, 7865, 2392, 29898, 13, 9651, 525, 13919, 1014, 1853, 363, 1714, 1897, 29901, 6571, 4286, 4830, 29898, 1491, 1853, 29897, 13, 4706, 1723, 13, 13, 1678, 565, 451, 15236, 29918, 6194, 322, 3309, 5277, 29871, 29946, 29901, 13, 4706, 736, 525, 11282, 3319, 1800, 4286, 4830, 29898, 2848, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 525, 29963, 15364, 3319, 1800, 4286, 4830, 29898, 2848, 29897, 13, 13, 13, 3738, 27286, 353, 337, 29889, 12198, 29898, 13, 1678, 364, 15945, 29908, 29898, 29956, 29968, 29911, 29989, 7798, 29953, 29973, 29946, 29973, 29989, 21713, 29989, 1231, 29989, 2539, 29989, 2481, 29989, 11384, 29989, 25196, 29897, 13, 4706, 22308, 3583, 3552, 29961, 29900, 29899, 29929, 5586, 29974, 29989, 18146, 29989, 2928, 29896, 29953, 29989, 11031, 29941, 29906, 2144, 876, 29973, 13, 268, 5124, 613, 13, 1678, 337, 29889, 29902, 891, 337, 29889, 29990, 13, 29897, 13, 13, 17870, 4176, 29918, 15631, 29925, 2890, 353, 426, 13, 1678, 525, 29956, 29968, 29911, 2396, 14013, 921, 29901, 525, 1692, 29949, 2303, 5659, 29979, 742, 13, 1678, 525, 7798, 29953, 29946, 2396, 14013, 921, 29901, 525, 29933, 6259, 10192, 742, 13, 1678, 525, 7798, 2396, 5749, 29918, 16031, 29918, 1853, 29892, 13, 1678, 525, 21713, 2396, 5749, 29918, 6370, 29918, 1853, 29892, 13, 1678, 525, 1231, 2396, 5749, 29918, 1807, 29918, 1853, 29892, 13, 1678, 525, 2539, 2396, 14013, 921, 29901, 525, 6248, 742, 13, 1678, 525, 2481, 2396, 14013, 921, 29901, 525, 15307, 742, 13, 1678, 525, 11384, 2396, 14013, 921, 29901, 525, 25832, 2544, 8890, 742, 13, 1678, 525, 25196, 2396, 14013, 921, 29901, 525, 29933, 28902, 29915, 13, 29913, 13, 2 ]