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
psychic/nodes/filter.py
breuderink/psychic
3
124185
import numpy as np from scipy import signal from golem import DataSet from golem.nodes import BaseNode from psychic.utils import get_samplerate class Filter(BaseNode): def __init__(self, filt_design_func): ''' Forward-backward filtering node. filt_design_func is a function that takes the sample rate as an argument, and returns the filter coefficients (b, a). ''' BaseNode.__init__(self) self.filt_design_func = filt_design_func def train_(self, d): fs = get_samplerate(d) self.log.info('Detected sample rate of %d Hz' % fs) self.filter = self.filt_design_func(fs) def apply_(self, d): b, a = self.filter xs = np.hstack([signal.filtfilt(b, a, d.xs[:, i]).reshape(-1, 1) for i in range(d.nfeatures)]) return DataSet(xs=xs, default=d) class OnlineFilter(Filter): def __init__(self, filt_design_func): Filter.__init__(self, filt_design_func) self.zi = [] def apply_(self, d): b, a = self.filter if self.zi == []: self.zi = [signal.lfiltic(b, a, np.zeros(b.size)) for fi in range(d.nfeatures)] new_zi = [] xs = [] for i in range(d.nfeatures): xi, zii = signal.lfilter(b, a, d.xs[:, i], zi=self.zi[i]) xs.append(xi.reshape(-1, 1)) new_zi.append(zii) self.zi = new_zi return DataSet(xs=np.hstack(xs), default=d) class Winsorize(BaseNode): def __init__(self, cutoff=[.05, .95]): self.cutoff = np.atleast_1d(cutoff) assert self.cutoff.size == 2 BaseNode.__init__(self) def train_(self, d): assert len(d.feat_shape) == 1 self.lims = np.apply_along_axis(lambda x: np.interp(self.cutoff, np.linspace(0, 1, d.ninstances), np.sort(x)), 0, d.xs) def apply_(self, d): return DataSet(xs=np.clip(d.xs, self.lims[0,:], self.lims[1:]), default=d)
[ 1, 1053, 12655, 408, 7442, 13, 3166, 4560, 2272, 1053, 7182, 13, 3166, 748, 2409, 1053, 3630, 2697, 13, 3166, 748, 2409, 29889, 18010, 1053, 7399, 4247, 13, 3166, 11643, 293, 29889, 13239, 1053, 679, 29918, 13445, 20069, 403, 13, 13, 1990, 19916, 29898, 5160, 4247, 1125, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 977, 29873, 29918, 13892, 29918, 9891, 1125, 13, 1678, 14550, 13, 1678, 1152, 1328, 29899, 1627, 1328, 21166, 2943, 29889, 977, 29873, 29918, 13892, 29918, 9891, 338, 263, 740, 393, 4893, 13, 1678, 278, 4559, 6554, 408, 385, 2980, 29892, 322, 3639, 278, 4175, 16127, 313, 29890, 29892, 263, 467, 13, 1678, 14550, 13, 1678, 7399, 4247, 17255, 2344, 12035, 1311, 29897, 13, 1678, 1583, 29889, 1777, 29873, 29918, 13892, 29918, 9891, 353, 977, 29873, 29918, 13892, 29918, 9891, 13, 13, 29871, 822, 7945, 23538, 1311, 29892, 270, 1125, 13, 1678, 18920, 353, 679, 29918, 13445, 20069, 403, 29898, 29881, 29897, 13, 1678, 1583, 29889, 1188, 29889, 3888, 877, 6362, 26458, 4559, 6554, 310, 1273, 29881, 379, 29920, 29915, 1273, 18920, 29897, 13, 1678, 1583, 29889, 4572, 353, 1583, 29889, 1777, 29873, 29918, 13892, 29918, 9891, 29898, 5847, 29897, 13, 13, 29871, 822, 3394, 23538, 1311, 29892, 270, 1125, 13, 1678, 289, 29892, 263, 353, 1583, 29889, 4572, 13, 1678, 14492, 353, 7442, 29889, 29882, 1429, 4197, 25436, 29889, 1777, 29873, 1777, 29873, 29898, 29890, 29892, 263, 29892, 270, 29889, 10351, 7503, 29892, 474, 14664, 690, 14443, 6278, 29896, 29892, 29871, 29896, 29897, 29871, 13, 418, 363, 474, 297, 3464, 29898, 29881, 29889, 29876, 22100, 29897, 2314, 13, 1678, 736, 3630, 2697, 29898, 10351, 29922, 10351, 29892, 2322, 29922, 29881, 29897, 13, 13, 1990, 13542, 5072, 29898, 5072, 1125, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 977, 29873, 29918, 13892, 29918, 9891, 1125, 13, 1678, 19916, 17255, 2344, 12035, 1311, 29892, 977, 29873, 29918, 13892, 29918, 9891, 29897, 13, 1678, 1583, 29889, 2526, 353, 5159, 13, 13, 29871, 822, 3394, 23538, 1311, 29892, 270, 1125, 13, 1678, 289, 29892, 263, 353, 1583, 29889, 4572, 13, 1678, 565, 1583, 29889, 2526, 1275, 5159, 29901, 13, 418, 1583, 29889, 2526, 353, 518, 25436, 29889, 29880, 1777, 29873, 293, 29898, 29890, 29892, 263, 29892, 7442, 29889, 3298, 359, 29898, 29890, 29889, 2311, 876, 363, 5713, 297, 29871, 13, 4706, 3464, 29898, 29881, 29889, 29876, 22100, 4638, 13, 13, 1678, 716, 29918, 2526, 353, 5159, 13, 1678, 14492, 353, 5159, 13, 1678, 363, 474, 297, 3464, 29898, 29881, 29889, 29876, 22100, 1125, 13, 418, 921, 29875, 29892, 503, 2236, 353, 7182, 29889, 29880, 4572, 29898, 29890, 29892, 263, 29892, 270, 29889, 10351, 7503, 29892, 474, 1402, 503, 29875, 29922, 1311, 29889, 2526, 29961, 29875, 2314, 13, 418, 14492, 29889, 4397, 29898, 5389, 29889, 690, 14443, 6278, 29896, 29892, 29871, 29896, 876, 13, 418, 716, 29918, 2526, 29889, 4397, 29898, 29920, 2236, 29897, 13, 1678, 1583, 29889, 2526, 353, 716, 29918, 2526, 13, 13, 1678, 736, 3630, 2697, 29898, 10351, 29922, 9302, 29889, 29882, 1429, 29898, 10351, 511, 2322, 29922, 29881, 29897, 13, 13, 1990, 399, 1144, 272, 675, 29898, 5160, 4247, 1125, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 5700, 2696, 11759, 29889, 29900, 29945, 29892, 869, 29929, 29945, 29962, 1125, 13, 1678, 1583, 29889, 7582, 2696, 353, 7442, 29889, 271, 280, 579, 29918, 29896, 29881, 29898, 7582, 2696, 29897, 13, 1678, 4974, 1583, 29889, 7582, 2696, 29889, 2311, 1275, 29871, 29906, 13, 1678, 7399, 4247, 17255, 2344, 12035, 1311, 29897, 13, 13, 29871, 822, 7945, 23538, 1311, 29892, 270, 1125, 13, 1678, 4974, 7431, 29898, 29881, 29889, 1725, 271, 29918, 12181, 29897, 1275, 29871, 29896, 13, 1678, 1583, 29889, 2576, 29879, 353, 7442, 29889, 7302, 29918, 284, 549, 29918, 8990, 29898, 2892, 921, 29901, 7442, 29889, 1639, 29886, 29898, 1311, 29889, 7582, 2696, 29892, 29871, 13, 418, 7442, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29896, 29892, 270, 29889, 29876, 2611, 2925, 511, 7442, 29889, 6605, 29898, 29916, 8243, 29871, 29900, 29892, 270, 29889, 10351, 29897, 13, 268, 13, 29871, 822, 3394, 23538, 1311, 29892, 270, 1125, 13, 1678, 736, 3630, 2697, 29898, 10351, 29922, 9302, 29889, 24049, 29898, 29881, 29889, 10351, 29892, 1583, 29889, 2576, 29879, 29961, 29900, 29892, 29901, 1402, 1583, 29889, 2576, 29879, 29961, 29896, 29901, 11724, 13, 418, 2322, 29922, 29881, 29897, 13, 2 ]
src/tesk_core/helm_client.py
PlatformedTasks/PLAS-tesk-core
0
102097
<filename>src/tesk_core/helm_client.py import subprocess repo_name = "taskmaster-repo" def helm_add_repo(repo_url): try: print(f"Adding '{repo_url}' as '{repo_name}'") repo_add = subprocess.run(['helm', 'repo', 'add', repo_name, repo_url, '--force-update'], capture_output=True, text=True, check=True) print(repo_add.stdout) print(f"Updating helm repositories...") repo_update = subprocess.run(['helm', 'repo', 'update'], capture_output=True, text=True, check=True) print(repo_update.stdout) except subprocess.CalledProcessError as err: print(err.stderr) except Exception as err: print(err) def helm_install(release_name, chart_name, chart_version, chart_values, namespace="default"): try: chart = f"{repo_name}/{chart_name}" print(f"Installing '{release_name}' from '{chart}' in namespace '{namespace}'...") helm_command = ['helm', 'install', release_name, chart, f'--namespace={namespace}', '--wait'] if chart_version: helm_command.append(f'--version={chart_version}') if chart_values: for chart_file in chart_values: helm_command.append(f'-f={str(chart_file)}') release_install = subprocess.run(helm_command, capture_output=True, text=True, check=True) print(release_install.stdout) return release_install except subprocess.CalledProcessError as err: print(err.stderr) except Exception as err: print(err) def helm_uninstall(release_name, namespace="default"): try: print(f"Uninstalling '{release_name}'...") release_uninstall = subprocess.run(['helm', 'uninstall', release_name, f'--namespace={namespace}'], capture_output=True, text=True, check=True) print(release_uninstall.stdout) except subprocess.CalledProcessError as err: print(err.stderr) except Exception as err: print(err)
[ 1, 529, 9507, 29958, 4351, 29914, 2167, 29895, 29918, 3221, 29914, 9421, 29918, 4645, 29889, 2272, 13, 5215, 1014, 5014, 13, 13, 20095, 29918, 978, 353, 376, 7662, 6207, 29899, 20095, 29908, 13, 13, 1753, 1081, 29885, 29918, 1202, 29918, 20095, 29898, 20095, 29918, 2271, 1125, 13, 1678, 1018, 29901, 13, 4706, 1596, 29898, 29888, 29908, 2528, 292, 22372, 20095, 29918, 2271, 10162, 408, 22372, 20095, 29918, 978, 10162, 1159, 13, 4706, 13761, 29918, 1202, 353, 1014, 5014, 29889, 3389, 18959, 9421, 742, 525, 20095, 742, 525, 1202, 742, 13761, 29918, 978, 29892, 13761, 29918, 2271, 29892, 525, 489, 10118, 29899, 5504, 7464, 10446, 29918, 4905, 29922, 5574, 29892, 1426, 29922, 5574, 29892, 1423, 29922, 5574, 29897, 13, 4706, 1596, 29898, 20095, 29918, 1202, 29889, 25393, 29897, 13, 4706, 1596, 29898, 29888, 29908, 3373, 26747, 1081, 29885, 28914, 856, 1159, 13, 4706, 13761, 29918, 5504, 353, 1014, 5014, 29889, 3389, 18959, 9421, 742, 525, 20095, 742, 525, 5504, 7464, 10446, 29918, 4905, 29922, 5574, 29892, 1426, 29922, 5574, 29892, 1423, 29922, 5574, 29897, 13, 4706, 1596, 29898, 20095, 29918, 5504, 29889, 25393, 29897, 13, 1678, 5174, 1014, 5014, 29889, 29907, 4212, 7032, 2392, 408, 4589, 29901, 13, 4706, 1596, 29898, 3127, 29889, 303, 20405, 29897, 13, 1678, 5174, 8960, 408, 4589, 29901, 13, 4706, 1596, 29898, 3127, 29897, 13, 13, 13, 1753, 1081, 29885, 29918, 6252, 29898, 14096, 29918, 978, 29892, 8727, 29918, 978, 29892, 8727, 29918, 3259, 29892, 8727, 29918, 5975, 29892, 7397, 543, 4381, 29908, 1125, 13, 1678, 1018, 29901, 13, 4706, 8727, 353, 285, 29908, 29912, 20095, 29918, 978, 6822, 29912, 15425, 29918, 978, 5038, 13, 4706, 1596, 29898, 29888, 29908, 23271, 292, 22372, 14096, 29918, 978, 10162, 515, 22372, 15425, 10162, 297, 7397, 22372, 22377, 10162, 856, 1159, 13, 13, 4706, 1081, 29885, 29918, 6519, 353, 6024, 9421, 742, 525, 6252, 742, 6507, 29918, 978, 29892, 8727, 29892, 285, 29915, 489, 22377, 3790, 22377, 29913, 742, 525, 489, 10685, 2033, 13, 13, 4706, 565, 8727, 29918, 3259, 29901, 13, 9651, 1081, 29885, 29918, 6519, 29889, 4397, 29898, 29888, 29915, 489, 3259, 3790, 15425, 29918, 3259, 29913, 1495, 13, 4706, 565, 8727, 29918, 5975, 29901, 13, 9651, 363, 8727, 29918, 1445, 297, 8727, 29918, 5975, 29901, 13, 18884, 1081, 29885, 29918, 6519, 29889, 4397, 29898, 29888, 28560, 29888, 3790, 710, 29898, 15425, 29918, 1445, 2915, 1495, 13, 13, 4706, 6507, 29918, 6252, 353, 1014, 5014, 29889, 3389, 29898, 9421, 29918, 6519, 29892, 10446, 29918, 4905, 29922, 5574, 29892, 1426, 29922, 5574, 29892, 1423, 29922, 5574, 29897, 13, 4706, 1596, 29898, 14096, 29918, 6252, 29889, 25393, 29897, 13, 4706, 736, 6507, 29918, 6252, 13, 1678, 5174, 1014, 5014, 29889, 29907, 4212, 7032, 2392, 408, 4589, 29901, 13, 4706, 1596, 29898, 3127, 29889, 303, 20405, 29897, 13, 1678, 5174, 8960, 408, 4589, 29901, 13, 4706, 1596, 29898, 3127, 29897, 13, 13, 13, 1753, 1081, 29885, 29918, 348, 6252, 29898, 14096, 29918, 978, 29892, 7397, 543, 4381, 29908, 1125, 13, 1678, 1018, 29901, 13, 4706, 1596, 29898, 29888, 29908, 2525, 6252, 292, 22372, 14096, 29918, 978, 10162, 856, 1159, 13, 4706, 6507, 29918, 348, 6252, 353, 1014, 5014, 29889, 3389, 18959, 9421, 742, 525, 348, 6252, 742, 6507, 29918, 978, 29892, 285, 29915, 489, 22377, 3790, 22377, 29913, 7464, 10446, 29918, 4905, 29922, 5574, 29892, 1426, 29922, 5574, 29892, 1423, 29922, 5574, 29897, 13, 4706, 1596, 29898, 14096, 29918, 348, 6252, 29889, 25393, 29897, 13, 1678, 5174, 1014, 5014, 29889, 29907, 4212, 7032, 2392, 408, 4589, 29901, 13, 4706, 1596, 29898, 3127, 29889, 303, 20405, 29897, 13, 1678, 5174, 8960, 408, 4589, 29901, 13, 4706, 1596, 29898, 3127, 29897, 13, 2 ]
src/treca/data.py
evanfyang/terminus-2
0
108331
#!/usr/bin/python import os import re import platform from Bio import AlignIO from Bio.Seq import Seq from Bio.Align import AlignInfo from Bio.Align.Applications import MuscleCommandline # define constants HEADER = 1 SEQUENCE = 2 FORWARD = 1 REVERSE = 2 FA_LINES_PER_READ = 2 FQ_LINES_PER_READ = 4 class SequenceData: def __init__(self, read_type, telomeric_repeat, interleaved_read_filepath=None, r1_read_filepath=None, r2_read_filepath=None, out_directory=None): self._read_type = read_type self._interleaved_reads_filepath = interleaved_read_filepath self._r1_reads_filepath = r1_read_filepath self._r2_reads_filepath = r2_read_filepath self._out_directory = out_directory if self._out_directory == None: self._out_directory = os.path.abspath(os.path.join(os.path.expanduser('~'), 'terminus_output')) os.makedirs(os.path.dirname(self._out_directory), exist_ok=True) self._3prime_telomeric_repeat_regex = self._generate_regular_expression(telomeric_repeat, "3'") self._5prime_telomeric_repeat_regex = self._generate_regular_expression(str(Seq(telomeric_repeat).reverse_complement()), "5'") self._r1_telomeric_reads_filepath = None self._r2_telomeric_reads_filepath = None self._r1_telomeric_reads_clusters_info_filepath = None self._r2_telomeric_reads_clusters_info_filepath = None self._r1_telomeric_reads_clusters_directory = None self._r2_telomeric_reads_clusters_directory = None self._r1_telomeric_reads_clusters_alignments_directory = None self._r2_telomeric_reads_clusters_alignments_directory = None self._r1_telomeric_reads_clusters_consensus_filepath = None self._r2_telomeric_reads_clusters_consensus_filepath = None self._r1_subtelomeric_reads_filepath = None self._r2_subtelomeric_reads_filepath = None self._r1_subtelomeric_reads_clusters_info_filepath = None self._r2_subtelomeric_reads_clusters_info_filepath = None self._r1_subtelomeric_reads_clusters_directory = None self._r2_subtelomeric_reads_clusters_directory = None self._r1_subtelomeric_reads_clusters_alignments_directory = None self._r2_subtelomeric_reads_clusters_alignments_directory = None self._r1_subtelomeric_reads_clusters_consensus_filepath = None self._r2_subtelomeric_reads_clusters_consensus_filepath = None def get_read_type(self): return self._read_type def get_interleaved_reads_filepath(self): return self._interleaved_reads_filepath def get_r1_reads_filepath(self): return self._r1_reads_filepath def get_r2_reads_filepath(self): return self._r2_reads_filepath def get_out_directory(self): return self._out_directory def get_3prime_telomeric_repeat_regex(self): return self._3prime_telomeric_repeat_regex def get_5prime_telomeric_repeat_regex(self): return self._5prime_telomeric_repeat_regex def get_r1_telomeric_reads_filepath(self): return self._r1_telomeric_reads_filepath def get_r2_telomeric_reads_filepath(self): return self._r2_telomeric_reads_filepath def get_r1_telomeric_reads_clusters_info_filepath(self): return self._r1_telomeric_reads_clusters_info_filepath def get_r2_telomeric_reads_clusters_info_filepath(self): return self._r2_telomeric_reads_clusters_info_filepath def get_r1_telomeric_reads_clusters_directory(self): return self._r1_telomeric_reads_clusters_directory def get_r2_telomeric_reads_clusters_directory(self): return self._r2_telomeric_reads_clusters_directory def get_r1_telomeric_reads_clusters_alignments_directory(self): return self._r1_telomeric_reads_clusters_alignments_directory def get_r2_telomeric_reads_clusters_alignments_directory(self): return self._r2_telomeric_reads_clusters_alignments_directory def get_r1_telomeric_reads_clusters_consensus_filepath(self): return self._r1_telomeric_reads_clusters_consensus_filepath def get_r2_telomeric_reads_clusters_consensus_filepath(self): return self._r2_telomeric_reads_clusters_consensus_filepath def get_r1_subtelomeric_reads_filepath(self): return self._r1_subtelomeric_reads_filepath def get_r2_subtelomeric_reads_filepath(self): return self._r2_subtelomeric_reads_filepath def get_r1_subtelomeric_reads_clusters_info_filepath(self): return self._r1_subtelomeric_reads_clusters_info_filepath def get_r2_subtelomeric_reads_clusters_info_filepath(self): return self._r2_subtelomeric_reads_clusters_info_filepath def get_r1_subtelomeric_reads_clusters_directory(self): return self._r1_subtelomeric_reads_clusters_directory def get_r2_subtelomeric_reads_clusters_directory(self): return self._r2_subtelomeric_reads_clusters_directory def get_r1_subtelomeric_reads_clusters_alignments_directory(self): return self._r1_subtelomeric_reads_clusters_alignments_directory def get_r2_subtelomeric_reads_clusters_alignments_directory(self): return self._r2_subtelomeric_reads_clusters_alignments_directory def get_r1_subtelomeric_reads_clusters_consensus_filepath(self): return self._r1_subtelomeric_reads_clusters_consensus_filepath def get_r2_subtelomeric_reads_clusters_consensus_filepath(self): return self._r2_subtelomeric_reads_clusters_consensus_filepath def extract_telomeric_reads(self): telomeric_reads_directory = os.path.abspath(os.path.join(self._out_directory, 'telomeric_reads')) os.makedirs(telomeric_reads_directory, exist_ok=True) self._r1_telomeric_reads_filepath = os.path.abspath(os.path.join(telomeric_reads_directory, 'r1_telomeric_reads.fasta')) r1_telomeric_reads_output = open(self._r1_telomeric_reads_filepath, "w+") self._r2_telomeric_reads_filepath = os.path.abspath(os.path.join(telomeric_reads_directory, 'r2_telomeric_reads.fasta')) r2_telomeric_reads_output = open(self._r2_telomeric_reads_filepath, "w+") if self._read_type == "interleaved": print("Extracting telomeric reads from an interleaved FASTQ dataset...") self._process_reads(self._interleaved_reads_filepath, r1_telomeric_reads_output, r2_telomeric_reads_output) print("Done.\n") if self._read_type == "seperated": print("Extracting telomeric reads from R1 FASTQ dataset...") self._process_reads(input_filepath=self._r1_reads_filepath, r1_output=r1_telomeric_reads_output, r2_output=None) print("Done.\n") print("Extracting telomeric reads from R2 FASTQ dataset...") self._process_reads(input_filepath=self._r2_reads_filepath, r1_output=None, r2_output=r2_telomeric_reads_output) print("Done.\n") print("R1 telomeric reads saved to " + self._r1_telomeric_reads_filepath) print("R2 telomeric reads saved to " + self._r2_telomeric_reads_filepath) print() def cluster_telomeric_reads(self): # install and make wcd for clustering print("Installing and preparing wcdest for clustering...") os.chdir("..") os.system("git submodule update --init --recursive >/dev/null 2>&1") os.chdir("./lib/wcdest/code/") os.system("./configure >/dev/null 2>&1") # NOTE: texinfo/makeinfo must be installed for wcdest to compile correctly!! os.system("make clean -C ./ >/dev/null 2>&1") os.system("make -C ./ >/dev/null 2>&1") os.system("make install -C ./ >/dev/null 2>&1") os.chdir("../../../src") print("Done.\n") telomeric_reads_cluster_info_directory = os.path.abspath(os.path.join(self._out_directory, 'clusters', 'cluster_info', 'telomeric_reads')) os.makedirs(telomeric_reads_cluster_info_directory, exist_ok=True) self._r1_telomeric_reads_clusters_info_filepath = os.path.abspath(os.path.join(telomeric_reads_cluster_info_directory, 'r1_telomeric_reads_clusters_info.txt')) self._r2_telomeric_reads_clusters_info_filepath = os.path.abspath(os.path.join(telomeric_reads_cluster_info_directory, 'r2_telomeric_reads_clusters_info.txt')) # cluster forward telomeric reads and write results to file print("Clustering telomeric reads in '" + self._r1_telomeric_reads_filepath + "'...") os.system("../lib/wcdest/code/src/wcd -o " + self._r1_telomeric_reads_clusters_info_filepath + " -c " + self._r1_telomeric_reads_filepath + " >/dev/null 2>&1") self._r1_telomeric_reads_clusters_directory = self._generate_clustered_reads(self._r1_telomeric_reads_filepath, self._r1_telomeric_reads_clusters_info_filepath, "telomeric", "forward") print("Done.\n") # cluster reverse telomeric reads and write results to file print("Clustering telomeric reads in '" + self._r2_telomeric_reads_filepath + "'...") os.system("../lib/wcdest/code/src/wcd -o " + self._r2_telomeric_reads_clusters_info_filepath + " -c " + self._r2_telomeric_reads_filepath + " >/dev/null 2>&1") self._r2_telomeric_reads_clusters_directory = self._generate_clustered_reads(self._r2_telomeric_reads_filepath, self._r2_telomeric_reads_clusters_info_filepath, "telomeric", "reverse") print("Done.\n") print("R1 telomeric reads clustering results saved to '" + self._r1_telomeric_reads_clusters_directory) print("R2 telomeric reads clustering results saved to '" + self._r2_telomeric_reads_clusters_directory) print() def extract_subtelomeric_reads(self): # given forward telomeric clusters, retrieve the subtelomeric sequence reads # from the reverse read file print("Extracting subtelomeric reads from R2 sequence reads file for clustered R1 telomeric reads...") for reads_file in os.listdir(self._r1_telomeric_reads_clusters_directory): if reads_file.endswith(".fasta"): if self._read_type == "interleaved": self._r2_subtelomeric_reads_filepath = self._retrieve_subtelomeric_reads(self._interleaved_reads_filepath, os.path.abspath(os.path.join(self._r1_telomeric_reads_clusters_directory, reads_file)), "reverse") if self._read_type == "seperated": self._r2_subtelomeric_reads_filepath = self._retrieve_subtelomeric_reads(self._r2_reads_filepath, os.path.abspath(os.path.join(self._r1_telomeric_reads_clusters_directory, reads_file)), "reverse") print("Done.\n") # given reverse telomeric clusters, retrieve the subtelomeric sequence reads # from the forward read file print("Extracting subtelomeric reads from R1 sequence reads file for clustered R2 telomeric reads...") for reads_file in os.listdir(self._r2_telomeric_reads_clusters_directory): if reads_file.endswith(".fasta"): if self._read_type == "interleaved": self._r1_subtelomeric_reads_filepath = self._retrieve_subtelomeric_reads(self._interleaved_reads_filepath, os.path.abspath(os.path.join(self._r2_telomeric_reads_clusters_directory, reads_file)), "forward") if self._read_type == "seperated": self._r1_subtelomeric_reads_filepath = self._retrieve_subtelomeric_reads(self._r1_reads_filepath, os.path.abspath(os.path.join(self._r2_telomeric_reads_clusters_directory, reads_file)), "forward") print("Done.\n") print("R1 subtelomeric reads saved to '" + self._r1_subtelomeric_reads_filepath + "'") print("R2 subtelomeric reads saved to '" + self._r2_subtelomeric_reads_filepath + "'") print("\n") def cluster_subtelomeric_reads(self): subtelomeric_reads_cluster_info_directory = os.path.abspath(os.path.join(self._out_directory, 'clusters', 'cluster_info', 'subtelomeric_reads')) os.makedirs(subtelomeric_reads_cluster_info_directory, exist_ok=True) self._r1_subtelomeric_reads_clusters_info_filepath = os.path.abspath(os.path.join(subtelomeric_reads_cluster_info_directory, 'r1_subtelomeric_reads_clusters_info.txt')) self._r2_subtelomeric_reads_clusters_info_filepath = os.path.abspath(os.path.join(subtelomeric_reads_cluster_info_directory, 'r2_subtelomeric_reads_clusters_info.txt')) # cluster forward subtelomeric reads and write results to file print("Clustering subtelomeric reads in '" + self._r1_subtelomeric_reads_filepath + "'...") os.system("../lib/wcdest/code/src/wcd -o " + self._r1_subtelomeric_reads_clusters_info_filepath + " -c " + self._r1_subtelomeric_reads_filepath + " >/dev/null 2>&1") self._r1_subtelomeric_reads_clusters_directory = self._generate_clustered_reads(self._r1_subtelomeric_reads_filepath, self._r1_subtelomeric_reads_clusters_info_filepath, "subtelomeric", "forward") print("Done.\n") # cluster reverse subtelomeric reads and write results to file print("Clustering telomeric reads in '" + self._r2_subtelomeric_reads_filepath + "'...") os.system("../lib/wcdest/code/src/wcd -o " + self._r2_subtelomeric_reads_clusters_info_filepath + " -c " + self._r2_subtelomeric_reads_filepath + " >/dev/null 2>&1") self._r2_subtelomeric_reads_clusters_directory = self._generate_clustered_reads(self._r2_subtelomeric_reads_filepath, self._r2_subtelomeric_reads_clusters_info_filepath, "subtelomeric", "reverse") print("Done.\n") print("R1 subtelomeric reads clustering results saved to '" + self._r1_telomeric_reads_clusters_directory) print("R2 subtelomeric reads clustering results saved to '" + self._r2_telomeric_reads_clusters_directory) print() def align_clustered_reads(self): if platform.system() == "Linux": os.system("chmod u=rwx,g=rwx,o=rwx ../lib/MUSCLE/muscle3.8.31_i86linux32") muscle = r"../lib/MUSCLE/muscle3.8.31_i86linux32" if platform.system() == "Darwin": os.system("chmod u=rwx,g=rwx,o=rwx ../lib/MUSCLE/muscle3.8.31_i86darwin64") muscle = r"../lib/MUSCLE/muscle3.8.31_i86darwin64" print("Aligning clustered R1 telomeric reads in '" + self._r1_telomeric_reads_clusters_directory + "'...") self._r1_telomeric_reads_clusters_alignments_directory = os.path.abspath(os.path.join(self._out_directory, 'alignments', 'r1_telomeric_reads')) os.makedirs(self._r1_telomeric_reads_clusters_alignments_directory, exist_ok=True) self._generate_alignments(muscle, self._r1_telomeric_reads_clusters_directory, self._r1_telomeric_reads_clusters_alignments_directory) print("Done.\n") print("Aligning clustered R2 telomeric reads in '" + self._r2_telomeric_reads_clusters_directory + "'...") self._r2_telomeric_reads_clusters_alignments_directory = os.path.abspath(os.path.join(self._out_directory, 'alignments', 'r2_telomeric_reads')) os.makedirs(self._r2_telomeric_reads_clusters_alignments_directory, exist_ok=True) self._generate_alignments(muscle, self._r2_telomeric_reads_clusters_directory, self._r2_telomeric_reads_clusters_alignments_directory) print("Done.\n") print("Aligning clustered R1 subtelomeric reads in '" + self._r1_subtelomeric_reads_clusters_directory + "'...") self._r1_subtelomeric_reads_clusters_alignments_directory = os.path.abspath(os.path.join(self._out_directory, 'alignments', 'r1_subtelomeric_reads')) os.makedirs(self._r1_subtelomeric_reads_clusters_alignments_directory, exist_ok=True) self._generate_alignments(muscle, self._r1_subtelomeric_reads_clusters_directory, self._r1_subtelomeric_reads_clusters_alignments_directory) print("Done.\n") print("Aligning clustered R2 subtelomeric reads in '" + self._r2_subtelomeric_reads_clusters_directory + "'...") self._r2_subtelomeric_reads_clusters_alignments_directory = os.path.abspath(os.path.join(self._out_directory, 'alignments', 'r2_subtelomeric_reads')) os.makedirs(self._r2_subtelomeric_reads_clusters_alignments_directory, exist_ok=True) self._generate_alignments(muscle, self._r2_subtelomeric_reads_clusters_directory, self._r2_subtelomeric_reads_clusters_alignments_directory) print("Done.\n") print("Alignment results for clustered R1 telomeric reads saved to '" + self._r1_telomeric_reads_clusters_alignments_directory) print("Alignment results for clustered R2 telomeric reads saved to '" + self._r2_telomeric_reads_clusters_alignments_directory) print("Alignment results for clustered R1 subtelomeric reads saved to '" + self._r1_subtelomeric_reads_clusters_alignments_directory) print("Alignment results for clustered R2 subtelomeric reads saved to '" + self._r2_subtelomeric_reads_clusters_alignments_directory) print() def consensus(self): consensus_reads_directory = os.path.abspath(os.path.join(self._out_directory, 'consensus')) os.makedirs(consensus_reads_directory, exist_ok=True) print("Generating consensus sequences for R1 telomeric reads clusters alignments...") self._r1_telomeric_reads_clusters_consensus_filepath = os.path.abspath(os.path.join(consensus_reads_directory, 'r1_telomeric_reads_clusters_consensus.fasta')) r1_telomeric_reads_clusters_consensus_output = open(self._r1_telomeric_reads_clusters_consensus_filepath, "w+") self._generate_consensus_sequences(self._r1_telomeric_reads_clusters_alignments_directory, r1_telomeric_reads_clusters_consensus_output) print("Done.\n") print("Generating consensus sequences for R2 telomeric reads clusters alignments...") self._r2_telomeric_reads_clusters_consensus_filepath = os.path.abspath(os.path.join(consensus_reads_directory, 'r2_telomeric_reads_clusters_consensus.fasta')) r2_telomeric_reads_clusters_consensus_output = open(self._r2_telomeric_reads_clusters_consensus_filepath, "w+") self._generate_consensus_sequences(self._r2_telomeric_reads_clusters_alignments_directory, r2_telomeric_reads_clusters_consensus_output) print("Done.\n") print("Generating consensus sequences for R1 subtelomeric reads clusters alignments...") self._r1_subtelomeric_reads_clusters_consensus_filepath = os.path.abspath(os.path.join(consensus_reads_directory, 'r1_subtelomeric_reads_clusters_consensus.fasta')) r1_subtelomeric_reads_clusters_consensus_output = open(self._r1_subtelomeric_reads_clusters_consensus_filepath, "w+") self._generate_consensus_sequences(self._r1_subtelomeric_reads_clusters_alignments_directory, r1_subtelomeric_reads_clusters_consensus_output) print("Done.\n") print("Generating consensus sequences for R2 subtelomeric reads clusters alignments...") self._r2_subtelomeric_reads_clusters_consensus_filepath = os.path.abspath(os.path.join(consensus_reads_directory, 'r2_subtelomeric_reads_clusters_consensus.fasta')) r2_subtelomeric_reads_clusters_consensus_output = open(self._r2_subtelomeric_reads_clusters_consensus_filepath, "w+") self._generate_consensus_sequences(self._r2_subtelomeric_reads_clusters_alignments_directory, r2_subtelomeric_reads_clusters_consensus_output) print("Done.\n") print("Consensus sequences for clustered R1 telomeric reads saved to '" + self._r1_telomeric_reads_clusters_consensus_filepath) print("Consensus sequences for clustered R2 telomeric reads saved to '" + self._r2_telomeric_reads_clusters_consensus_filepath) print("Consensus sequences for clustered R1 subtelomeric reads saved to '" + self._r1_subtelomeric_reads_clusters_consensus_filepath) print("Consensus sequences for clustered R2 subtelomeric reads saved to '" + self._r2_subtelomeric_reads_clusters_consensus_filepath) print() def _generate_regular_expression(self, telomeric_repeat, end): body = telomeric_repeat * 3 regex = "(" + body + ")+" if end == "5'": regex = "^" + regex if end == "3'": regex = regex + "$" prefix = "" for base in reversed(telomeric_repeat[1:]): prefix = base + prefix if end == "5'": regex = regex + "|^" + prefix + "(" + body + ")+" if end == "3'": regex = regex + "|" + prefix + "(" + body + ")+$" return regex def _process_reads(self, input_filepath, r1_output, r2_output): line_counter = 0 header_line = "" with open(input_filepath) as sequence_reads: for line in sequence_reads: line_counter += 1 if line_counter % FQ_LINES_PER_READ == HEADER: header_line = line # replace for output to FASTA format header_line = header_line.replace("@", ">") if line_counter % FQ_LINES_PER_READ == SEQUENCE: start_tel_exists = re.search(self._5prime_telomeric_repeat_regex, line) end_tel_exists = re.search(self._3prime_telomeric_repeat_regex, line) if bool(start_tel_exists) ^ bool(end_tel_exists): if int(header_line.split(" ")[1].split(":")[0]) == FORWARD: r1_output.write(header_line) r1_output.write(line) if int(header_line.split(" ")[1].split(":")[0]) == REVERSE: r2_output.write(header_line) r2_output.write(line) # retrieve telomeric reads based on clustering by wcdest def _generate_clustered_reads(self, reads_path, reads_clusters_info_path, read_type, read_direction): clusters = list() rows = list() row_num = 0 # keep track of row number of each cluster with open(reads_clusters_info_path) as clusters_file: # for each line in wcdest cluster file, convert to list of ints and # remove newline and ending "." Adjust indexing. for line in clusters_file: row_num += 1 line = [int(i) for i in line.strip(".\n").split(" ")] line = [i * FA_LINES_PER_READ for i in line] # filter out singleton clusters if len(line) > 1: clusters.append(line) rows.append(row_num) row_idx = 0 # get all R1 or R2 telomeric reads reads_file = open(reads_path, "r") reads_lines = reads_file.readlines() for cluster in clusters: # specify where to save FASTA files based on read direction and the # type reads that are being clustered if read_type == "telomeric" and read_direction == "forward": clustered_reads_output_directory = os.path.abspath(os.path.join(self._out_directory, 'clusters', 'r1_telomeric_reads')) os.makedirs(clustered_reads_output_directory, exist_ok=True) clustered_reads_output_filepath = os.path.abspath(os.path.join(clustered_reads_output_directory, 'r1_telomeric_reads_cluster_' + str(rows[row_idx]) + '.fasta')) clustered_reads_output = open(clustered_reads_output_filepath, "w+") if read_type == "telomeric" and read_direction == "reverse": clustered_reads_output_directory = os.path.abspath(os.path.join(self._out_directory, 'clusters', 'r2_telomeric_reads')) os.makedirs(clustered_reads_output_directory, exist_ok=True) clustered_reads_output_filepath = os.path.abspath(os.path.join(clustered_reads_output_directory, 'r2_telomeric_reads_cluster_' + str(rows[row_idx]) + '.fasta')) clustered_reads_output = open(clustered_reads_output_filepath, "w+") if read_type == "subtelomeric" and read_direction == "forward": clustered_reads_output_directory = os.path.abspath(os.path.join(self._out_directory, 'clusters', 'r1_subtelomeric_reads')) os.makedirs(clustered_reads_output_directory, exist_ok=True) clustered_reads_output_filepath = os.path.abspath(os.path.join(clustered_reads_output_directory, 'r1_subtelomeric_reads_cluster_' + str(rows[row_idx]) + '.fasta')) clustered_reads_output = open(clustered_reads_output_filepath, "w+") if read_type == "subtelomeric" and read_direction == "reverse": clustered_reads_output_directory = os.path.abspath(os.path.join(self._out_directory, 'clusters', 'r2_subtelomeric_reads')) os.makedirs(clustered_reads_output_directory, exist_ok=True) clustered_reads_output_filepath = os.path.abspath(os.path.join(clustered_reads_output_directory, 'r2_subtelomeric_reads_cluster_' + str(rows[row_idx]) + '.fasta')) clustered_reads_output = open(clustered_reads_output_filepath, "w+") # given the list of clusters with singletons filtered out, append # cluster reads to file for i in range(len(cluster)): index = cluster[i] header_line = reads_lines[index] sequence_line = reads_lines[index + 1] # edit header to match the read direction of fastq file if read_direction == "reverse": header_line = header_line.replace(" 1:N", " 2:N") if read_direction == "forward": header_line = header_line.replace(" 2:N", " 1:N") clustered_reads_output.write(header_line) clustered_reads_output.write(sequence_line) row_idx += 1 return clustered_reads_output_directory # retrieve paired ends of a set of reads for a file with telomeric reads from # a corresponding FASTQ file containing the paired end def _retrieve_subtelomeric_reads(self, subtelomeric_reads_source_filepath, telomeric_reads_cluster_path, subtelomeric_reads_direction): subtelomeric_reads_headers = set() line_counter = 0 # store all headers from telomeric read file with open(telomeric_reads_cluster_path) as telomeric_reads_cluster: for line in telomeric_reads_cluster: line_counter += 1 if line_counter % FA_LINES_PER_READ == HEADER: # edit header to match the read direction of fastq file if subtelomeric_reads_direction == "forward": line = line.replace(" 2:N", " 1:N") if subtelomeric_reads_direction == "reverse": line = line.replace(" 1:N", " 2:N") # edit header to match FASTQ format for searching original subtelomeric_reads_headers.add(line.replace(">", "@")) # specify where to save FASTA files based on the read type if subtelomeric_reads_direction == "forward": subtelomeric_reads_output_directory = os.path.abspath(os.path.join(self._out_directory, 'subtelomeric_reads')) os.makedirs(subtelomeric_reads_output_directory, exist_ok=True) r1_subtelomeric_reads_output_filepath = os.path.abspath(os.path.join(subtelomeric_reads_output_directory, 'r1_subtelomeric_reads.fasta')) r1_subtelomeric_reads_output = open(r1_subtelomeric_reads_output_filepath , "a+") if subtelomeric_reads_direction == "reverse": subtelomeric_reads_output_directory = os.path.abspath(os.path.join(self._out_directory, 'subtelomeric_reads')) os.makedirs(subtelomeric_reads_output_directory, exist_ok=True) r2_subtelomeric_reads_output_filepath = os.path.abspath(os.path.join(subtelomeric_reads_output_directory, 'r2_subtelomeric_reads.fasta')) r2_subtelomeric_reads_output = open(r2_subtelomeric_reads_output_filepath, "a+") line_counter = 1 header_line = "" # write all paired ends to file with open(subtelomeric_reads_source_filepath) as subtelomeric_reads_source: for line in subtelomeric_reads_source: if line_counter % FQ_LINES_PER_READ == HEADER: header_line = line if line_counter % FQ_LINES_PER_READ == SEQUENCE: # write sequence from FASTQ to file if its header is specified # in the list tel_headers constructed earlier if header_line in subtelomeric_reads_headers: # edit header to match FASTA format header_line = header_line.replace("@", ">") if int(header_line.split(" ")[1].split(":")[0]) == FORWARD: r1_subtelomeric_reads_output.write(header_line) r1_subtelomeric_reads_output.write(line) if int(header_line.split(" ")[1].split(":")[0]) == REVERSE: r2_subtelomeric_reads_output.write(header_line) r2_subtelomeric_reads_output.write(line) line_counter += 1 if subtelomeric_reads_direction == "forward": return r1_subtelomeric_reads_output_filepath if subtelomeric_reads_direction == "reverse": return r2_subtelomeric_reads_output_filepath def _generate_alignments(self, muscle, clustered_reads_directory, alignment_output_directory): for cluster_reads_file in os.listdir(clustered_reads_directory): if cluster_reads_file.endswith(".fasta"): cluster_reads_filepath = os.path.abspath(os.path.join(clustered_reads_directory, cluster_reads_file)) alignment_output_filename = cluster_reads_file#.split(".")[0] + ".aln" alignment_output_filepath = os.path.abspath(os.path.join(alignment_output_directory, alignment_output_filename)) muscle_command = MuscleCommandline(muscle, input=cluster_reads_filepath, out=alignment_output_filepath) muscle_command() def _generate_consensus_sequences(self, clustered_reads_directory, clustered_reads_consensus_output): for alignment_file in os.listdir(clustered_reads_directory): if alignment_file.endswith(".fasta"): alignment_filepath = os.path.abspath(os.path.join(clustered_reads_directory, alignment_file)) header_line = ">" + "contig" + alignment_file.split(".")[0].split("_")[-1] + "\n" alignment = AlignIO.read(alignment_filepath, "fasta") alignment_summary = AlignInfo.SummaryInfo(alignment) consensus_sequence = str(alignment_summary.gap_consensus(ambiguous='N')) + "\n" clustered_reads_consensus_output.write(header_line) clustered_reads_consensus_output.write(consensus_sequence)
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 13, 13, 5215, 2897, 13, 5215, 337, 13, 5215, 7481, 13, 13, 3166, 21184, 1053, 838, 647, 5971, 13, 3166, 21184, 29889, 23718, 1053, 25981, 13, 3166, 21184, 29889, 2499, 647, 1053, 838, 647, 3401, 13, 3166, 21184, 29889, 2499, 647, 29889, 2052, 5795, 1053, 3077, 2841, 6255, 1220, 13, 13, 29937, 4529, 17727, 13, 23252, 1001, 353, 29871, 29896, 13, 1660, 13356, 1430, 4741, 353, 29871, 29906, 13, 13, 22051, 29956, 17011, 353, 29871, 29896, 13, 1525, 5348, 1660, 353, 29871, 29906, 13, 13, 4519, 29918, 23714, 2890, 29918, 13171, 29918, 16310, 353, 29871, 29906, 13, 29943, 29984, 29918, 23714, 2890, 29918, 13171, 29918, 16310, 353, 29871, 29946, 13, 1990, 922, 3910, 1469, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1303, 29918, 1853, 29892, 13547, 12392, 293, 29918, 14358, 29892, 1006, 280, 10511, 29918, 949, 29918, 1445, 2084, 29922, 8516, 29892, 364, 29896, 29918, 949, 29918, 1445, 2084, 29922, 8516, 29892, 364, 29906, 29918, 949, 29918, 1445, 2084, 29922, 8516, 29892, 714, 29918, 12322, 29922, 8516, 1125, 13, 4706, 1583, 3032, 949, 29918, 1853, 353, 1303, 29918, 1853, 13, 13, 4706, 1583, 3032, 1639, 280, 10511, 29918, 949, 29879, 29918, 1445, 2084, 353, 1006, 280, 10511, 29918, 949, 29918, 1445, 2084, 29871, 13, 4706, 1583, 3032, 29878, 29896, 29918, 949, 29879, 29918, 1445, 2084, 353, 364, 29896, 29918, 949, 29918, 1445, 2084, 29871, 13, 4706, 1583, 3032, 29878, 29906, 29918, 949, 29879, 29918, 1445, 2084, 353, 364, 29906, 29918, 949, 29918, 1445, 2084, 13, 13, 4706, 1583, 3032, 449, 29918, 12322, 353, 714, 29918, 12322, 13, 308, 13, 4706, 565, 1583, 3032, 449, 29918, 12322, 1275, 6213, 29901, 13, 9651, 1583, 3032, 449, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 18837, 1792, 877, 30022, 5477, 525, 357, 12254, 29918, 4905, 8785, 13, 9651, 2897, 29889, 29885, 12535, 12935, 29898, 359, 29889, 2084, 29889, 25721, 29898, 1311, 3032, 449, 29918, 12322, 511, 1863, 29918, 554, 29922, 5574, 29897, 13, 13, 4706, 1583, 3032, 29941, 10080, 29918, 28497, 12392, 293, 29918, 14358, 29918, 13087, 353, 1583, 3032, 17158, 29918, 15227, 29918, 17471, 29898, 28497, 12392, 293, 29918, 14358, 29892, 376, 29941, 29915, 1159, 13, 4706, 1583, 3032, 29945, 10080, 29918, 28497, 12392, 293, 29918, 14358, 29918, 13087, 353, 1583, 3032, 17158, 29918, 15227, 29918, 17471, 29898, 710, 29898, 23718, 29898, 28497, 12392, 293, 29918, 14358, 467, 24244, 29918, 510, 2037, 25739, 376, 29945, 29915, 1159, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 6213, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 353, 6213, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 353, 6213, 13, 308, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 353, 6213, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 353, 6213, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 6213, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 353, 6213, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 353, 6213, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 353, 6213, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 353, 6213, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 353, 6213, 13, 268, 13, 1678, 822, 679, 29918, 949, 29918, 1853, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 949, 29918, 1853, 13, 13, 1678, 822, 679, 29918, 1639, 280, 10511, 29918, 949, 29879, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 1639, 280, 10511, 29918, 949, 29879, 29918, 1445, 2084, 13, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 949, 29879, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 949, 29879, 29918, 1445, 2084, 13, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 949, 29879, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 949, 29879, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 679, 29918, 449, 29918, 12322, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 449, 29918, 12322, 13, 268, 13, 1678, 822, 679, 29918, 29941, 10080, 29918, 28497, 12392, 293, 29918, 14358, 29918, 13087, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29941, 10080, 29918, 28497, 12392, 293, 29918, 14358, 29918, 13087, 13, 13, 1678, 822, 679, 29918, 29945, 10080, 29918, 28497, 12392, 293, 29918, 14358, 29918, 13087, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29945, 10080, 29918, 28497, 12392, 293, 29918, 14358, 29918, 13087, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 13, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 13, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29898, 1311, 1125, 268, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 13, 308, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29898, 1311, 1125, 268, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 13, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29898, 1311, 1125, 29871, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 13, 308, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 13, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 13, 268, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 13, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29898, 1311, 1125, 268, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 13, 308, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29898, 1311, 1125, 268, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 13, 13, 1678, 822, 679, 29918, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29898, 1311, 1125, 29871, 13, 4706, 736, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 13, 308, 13, 1678, 822, 679, 29918, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 13, 268, 13, 1678, 822, 6597, 29918, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 1125, 13, 4706, 13547, 12392, 293, 29918, 949, 29879, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 28497, 12392, 293, 29918, 949, 29879, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 28497, 12392, 293, 29918, 949, 29879, 29918, 12322, 29892, 525, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29889, 29888, 5427, 8785, 13, 4706, 364, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 353, 1722, 29898, 1311, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 28497, 12392, 293, 29918, 949, 29879, 29918, 12322, 29892, 525, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29889, 29888, 5427, 8785, 13, 4706, 364, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 353, 1722, 29898, 1311, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 13, 4706, 565, 1583, 3032, 949, 29918, 1853, 1275, 376, 1639, 280, 10511, 1115, 13, 9651, 1596, 703, 5647, 1461, 292, 13547, 12392, 293, 13623, 515, 385, 1006, 280, 10511, 13515, 1254, 29984, 8783, 856, 1159, 13, 9651, 1583, 3032, 5014, 29918, 949, 29879, 29898, 1311, 3032, 1639, 280, 10511, 29918, 949, 29879, 29918, 1445, 2084, 29892, 364, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29892, 364, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29897, 308, 13, 9651, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 565, 1583, 3032, 949, 29918, 1853, 1275, 376, 344, 546, 630, 1115, 13, 9651, 1596, 703, 5647, 1461, 292, 13547, 12392, 293, 13623, 515, 390, 29896, 13515, 1254, 29984, 8783, 856, 1159, 13, 9651, 1583, 3032, 5014, 29918, 949, 29879, 29898, 2080, 29918, 1445, 2084, 29922, 1311, 3032, 29878, 29896, 29918, 949, 29879, 29918, 1445, 2084, 29892, 364, 29896, 29918, 4905, 29922, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29892, 364, 29906, 29918, 4905, 29922, 8516, 29897, 13, 9651, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 9651, 1596, 703, 5647, 1461, 292, 13547, 12392, 293, 13623, 515, 390, 29906, 13515, 1254, 29984, 8783, 856, 1159, 13, 9651, 1583, 3032, 5014, 29918, 949, 29879, 29898, 2080, 29918, 1445, 2084, 29922, 1311, 3032, 29878, 29906, 29918, 949, 29879, 29918, 1445, 2084, 29892, 364, 29896, 29918, 4905, 29922, 8516, 29892, 364, 29906, 29918, 4905, 29922, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29897, 13, 9651, 1596, 703, 25632, 7790, 29876, 1159, 4706, 13, 13, 4706, 1596, 703, 29934, 29896, 13547, 12392, 293, 13623, 7160, 304, 376, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29897, 13, 4706, 1596, 703, 29934, 29906, 13547, 12392, 293, 13623, 7160, 304, 376, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29897, 13, 4706, 1596, 580, 13, 29871, 13, 1678, 822, 9867, 29918, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 1125, 1678, 13, 4706, 396, 2601, 322, 1207, 281, 2252, 363, 16993, 3241, 13, 4706, 1596, 703, 23271, 292, 322, 10223, 292, 281, 2252, 342, 363, 16993, 3241, 856, 1159, 13, 4706, 2897, 29889, 305, 3972, 703, 636, 1159, 13, 4706, 2897, 29889, 5205, 703, 5559, 1014, 5453, 2767, 1192, 2344, 1192, 3757, 25397, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 2897, 29889, 305, 3972, 703, 6904, 1982, 29914, 29893, 2252, 342, 29914, 401, 29914, 1159, 13, 4706, 2897, 29889, 5205, 703, 6904, 17591, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 396, 6058, 29923, 29901, 19696, 3888, 29914, 5675, 3888, 1818, 367, 5130, 363, 281, 2252, 342, 304, 6633, 5149, 6824, 29871, 13, 4706, 2897, 29889, 5205, 703, 5675, 5941, 448, 29907, 11431, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 2897, 29889, 5205, 703, 5675, 448, 29907, 11431, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 2897, 29889, 5205, 703, 5675, 2601, 448, 29907, 11431, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 2897, 29889, 305, 3972, 703, 21546, 6995, 4351, 1159, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 13547, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 3888, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 695, 504, 414, 742, 525, 19594, 29918, 3888, 742, 525, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 3888, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 308, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 3888, 29918, 12322, 29892, 525, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29889, 3945, 8785, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 3888, 29918, 12322, 29892, 525, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29889, 3945, 8785, 13, 13, 4706, 396, 9867, 6375, 13547, 12392, 293, 13623, 322, 2436, 2582, 304, 934, 29871, 13, 4706, 1596, 703, 6821, 504, 3241, 13547, 12392, 293, 13623, 297, 18793, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 13577, 856, 1159, 13, 4706, 2897, 29889, 5205, 703, 6995, 1982, 29914, 29893, 2252, 342, 29914, 401, 29914, 4351, 29914, 29893, 2252, 448, 29877, 376, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 718, 376, 448, 29883, 376, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 376, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 353, 1583, 3032, 17158, 29918, 19594, 287, 29918, 949, 29879, 29898, 1311, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29892, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 29892, 376, 28497, 12392, 293, 613, 376, 11333, 1159, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 396, 9867, 11837, 13547, 12392, 293, 13623, 322, 2436, 2582, 304, 934, 29871, 13, 4706, 1596, 703, 6821, 504, 3241, 13547, 12392, 293, 13623, 297, 18793, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 13577, 856, 1159, 13, 4706, 2897, 29889, 5205, 703, 6995, 1982, 29914, 29893, 2252, 342, 29914, 401, 29914, 4351, 29914, 29893, 2252, 448, 29877, 376, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 718, 376, 448, 29883, 376, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 376, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 353, 1583, 3032, 17158, 29918, 19594, 287, 29918, 949, 29879, 29898, 1311, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29892, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 29892, 376, 28497, 12392, 293, 613, 376, 24244, 1159, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 308, 13, 4706, 1596, 703, 29934, 29896, 13547, 12392, 293, 13623, 16993, 3241, 2582, 7160, 304, 18793, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29897, 13, 4706, 1596, 703, 29934, 29906, 13547, 12392, 293, 13623, 16993, 3241, 2582, 7160, 304, 18793, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29897, 13, 4706, 1596, 580, 13, 13, 1678, 822, 6597, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 1125, 13, 4706, 396, 2183, 6375, 13547, 12392, 293, 24554, 29892, 10563, 278, 12059, 295, 12392, 293, 5665, 13623, 13, 4706, 396, 29871, 515, 278, 11837, 1303, 934, 259, 13, 4706, 1596, 703, 5647, 1461, 292, 12059, 295, 12392, 293, 13623, 515, 390, 29906, 5665, 13623, 934, 363, 9867, 287, 390, 29896, 13547, 12392, 293, 13623, 856, 1159, 13, 4706, 363, 13623, 29918, 1445, 297, 2897, 29889, 1761, 3972, 29898, 1311, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 1125, 13, 9651, 565, 13623, 29918, 1445, 29889, 1975, 2541, 17350, 29888, 5427, 29908, 1125, 13, 18884, 565, 1583, 3032, 949, 29918, 1853, 1275, 376, 1639, 280, 10511, 1115, 13, 462, 1678, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 1583, 3032, 276, 509, 2418, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 3032, 1639, 280, 10511, 29918, 949, 29879, 29918, 1445, 2084, 29892, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29892, 13623, 29918, 1445, 8243, 376, 24244, 1159, 13, 18884, 565, 1583, 3032, 949, 29918, 1853, 1275, 376, 344, 546, 630, 1115, 13, 462, 1678, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 1583, 3032, 276, 509, 2418, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 3032, 29878, 29906, 29918, 949, 29879, 29918, 1445, 2084, 29892, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29892, 13623, 29918, 1445, 8243, 376, 24244, 1159, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 396, 2183, 11837, 13547, 12392, 293, 24554, 29892, 10563, 278, 12059, 295, 12392, 293, 5665, 13623, 13, 4706, 396, 29871, 515, 278, 6375, 1303, 934, 259, 13, 4706, 1596, 703, 5647, 1461, 292, 12059, 295, 12392, 293, 13623, 515, 390, 29896, 5665, 13623, 934, 363, 9867, 287, 390, 29906, 13547, 12392, 293, 13623, 856, 1159, 13, 4706, 363, 13623, 29918, 1445, 297, 2897, 29889, 1761, 3972, 29898, 1311, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 1125, 13, 9651, 565, 13623, 29918, 1445, 29889, 1975, 2541, 17350, 29888, 5427, 29908, 1125, 29871, 13, 18884, 565, 1583, 3032, 949, 29918, 1853, 1275, 376, 1639, 280, 10511, 1115, 13, 462, 1678, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 1583, 3032, 276, 509, 2418, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 3032, 1639, 280, 10511, 29918, 949, 29879, 29918, 1445, 2084, 29892, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29892, 13623, 29918, 1445, 8243, 376, 11333, 1159, 13, 18884, 565, 1583, 3032, 949, 29918, 1853, 1275, 376, 344, 546, 630, 1115, 13, 462, 1678, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 353, 1583, 3032, 276, 509, 2418, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 3032, 29878, 29896, 29918, 949, 29879, 29918, 1445, 2084, 29892, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29892, 13623, 29918, 1445, 8243, 376, 11333, 1159, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 29934, 29896, 12059, 295, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 13577, 1159, 13, 4706, 1596, 703, 29934, 29906, 12059, 295, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 13577, 1159, 13, 4706, 1596, 14182, 29876, 1159, 13, 268, 13, 1678, 822, 9867, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 1125, 13, 4706, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 3888, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 695, 504, 414, 742, 525, 19594, 29918, 3888, 742, 525, 1491, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 3888, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 308, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 3888, 29918, 12322, 29892, 525, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29889, 3945, 8785, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 3888, 29918, 12322, 29892, 525, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29889, 3945, 8785, 13, 13, 4706, 396, 9867, 6375, 12059, 295, 12392, 293, 13623, 322, 2436, 2582, 304, 934, 29871, 13, 4706, 1596, 703, 6821, 504, 3241, 12059, 295, 12392, 293, 13623, 297, 18793, 718, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 13577, 856, 1159, 13, 4706, 2897, 29889, 5205, 703, 6995, 1982, 29914, 29893, 2252, 342, 29914, 401, 29914, 4351, 29914, 29893, 2252, 448, 29877, 376, 718, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 718, 376, 448, 29883, 376, 718, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 376, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 353, 1583, 3032, 17158, 29918, 19594, 287, 29918, 949, 29879, 29898, 1311, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29892, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 29892, 376, 1491, 28497, 12392, 293, 613, 376, 11333, 1159, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 396, 9867, 11837, 12059, 295, 12392, 293, 13623, 322, 2436, 2582, 304, 934, 29871, 13, 4706, 1596, 703, 6821, 504, 3241, 13547, 12392, 293, 13623, 297, 18793, 718, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 13577, 856, 1159, 13, 4706, 2897, 29889, 5205, 703, 6995, 1982, 29914, 29893, 2252, 342, 29914, 401, 29914, 4351, 29914, 29893, 2252, 448, 29877, 376, 718, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 718, 376, 448, 29883, 376, 718, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 718, 376, 1405, 29914, 3359, 29914, 4304, 29871, 29906, 19250, 29896, 1159, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 353, 1583, 3032, 17158, 29918, 19594, 287, 29918, 949, 29879, 29898, 1311, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 1445, 2084, 29892, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 1445, 2084, 29892, 376, 1491, 28497, 12392, 293, 613, 376, 24244, 1159, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 308, 13, 4706, 1596, 703, 29934, 29896, 12059, 295, 12392, 293, 13623, 16993, 3241, 2582, 7160, 304, 18793, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29897, 13, 4706, 1596, 703, 29934, 29906, 12059, 295, 12392, 293, 13623, 16993, 3241, 2582, 7160, 304, 18793, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29897, 13, 4706, 1596, 580, 13, 268, 13, 1678, 822, 7595, 29918, 19594, 287, 29918, 949, 29879, 29898, 1311, 1125, 13, 4706, 565, 7481, 29889, 5205, 580, 1275, 376, 24085, 1115, 13, 9651, 2897, 29889, 5205, 703, 305, 1545, 318, 29922, 13975, 29916, 29892, 29887, 29922, 13975, 29916, 29892, 29877, 29922, 13975, 29916, 29772, 1982, 29914, 29924, 3308, 29907, 1307, 29914, 8366, 2841, 29941, 29889, 29947, 29889, 29941, 29896, 29918, 29875, 29947, 29953, 9389, 29941, 29906, 1159, 13, 9651, 2301, 2841, 353, 364, 29908, 6995, 1982, 29914, 29924, 3308, 29907, 1307, 29914, 8366, 2841, 29941, 29889, 29947, 29889, 29941, 29896, 29918, 29875, 29947, 29953, 9389, 29941, 29906, 29908, 13, 4706, 565, 7481, 29889, 5205, 580, 1275, 376, 29928, 279, 5080, 1115, 13, 9651, 2897, 29889, 5205, 703, 305, 1545, 318, 29922, 13975, 29916, 29892, 29887, 29922, 13975, 29916, 29892, 29877, 29922, 13975, 29916, 29772, 1982, 29914, 29924, 3308, 29907, 1307, 29914, 8366, 2841, 29941, 29889, 29947, 29889, 29941, 29896, 29918, 29875, 29947, 29953, 16702, 5080, 29953, 29946, 1159, 13, 9651, 2301, 2841, 353, 364, 29908, 6995, 1982, 29914, 29924, 3308, 29907, 1307, 29914, 8366, 2841, 29941, 29889, 29947, 29889, 29941, 29896, 29918, 29875, 29947, 29953, 16702, 5080, 29953, 29946, 29908, 13, 13, 4706, 1596, 703, 2499, 647, 292, 9867, 287, 390, 29896, 13547, 12392, 293, 13623, 297, 18793, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 718, 13577, 856, 1159, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 2520, 1860, 742, 525, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 1311, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 4706, 1583, 3032, 17158, 29918, 2520, 1860, 29898, 8366, 2841, 29892, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29892, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29897, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 2499, 647, 292, 9867, 287, 390, 29906, 13547, 12392, 293, 13623, 297, 18793, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 718, 13577, 856, 1159, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 2520, 1860, 742, 525, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 1311, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 4706, 1583, 3032, 17158, 29918, 2520, 1860, 29898, 8366, 2841, 29892, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29892, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29897, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 2499, 647, 292, 9867, 287, 390, 29896, 12059, 295, 12392, 293, 13623, 297, 18793, 718, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 718, 13577, 856, 1159, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 2520, 1860, 742, 525, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 1311, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 4706, 1583, 3032, 17158, 29918, 2520, 1860, 29898, 8366, 2841, 29892, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29892, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29897, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 2499, 647, 292, 9867, 287, 390, 29906, 12059, 295, 12392, 293, 13623, 297, 18793, 718, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 718, 13577, 856, 1159, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 2520, 1860, 742, 525, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 1311, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 4706, 1583, 3032, 17158, 29918, 2520, 1860, 29898, 8366, 2841, 29892, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 12322, 29892, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29897, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 14658, 2582, 363, 9867, 287, 390, 29896, 13547, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29897, 13, 4706, 1596, 703, 14658, 2582, 363, 9867, 287, 390, 29906, 13547, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29897, 13, 4706, 1596, 703, 14658, 2582, 363, 9867, 287, 390, 29896, 12059, 295, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29897, 13, 4706, 1596, 703, 14658, 2582, 363, 9867, 287, 390, 29906, 12059, 295, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29897, 13, 4706, 1596, 580, 13, 13, 1678, 822, 1136, 8841, 29898, 1311, 1125, 13, 4706, 1136, 8841, 29918, 949, 29879, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 3200, 8841, 8785, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 3200, 8841, 29918, 949, 29879, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 13, 4706, 1596, 703, 5631, 1218, 1136, 8841, 15602, 363, 390, 29896, 13547, 12392, 293, 13623, 24554, 7595, 1860, 856, 1159, 13, 4706, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 3200, 8841, 29918, 949, 29879, 29918, 12322, 29892, 525, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29889, 29888, 5427, 8785, 13, 4706, 364, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 4905, 353, 1722, 29898, 1311, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 4706, 1583, 3032, 17158, 29918, 3200, 8841, 29918, 6831, 2063, 29898, 1311, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29892, 364, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 4905, 29897, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 5631, 1218, 1136, 8841, 15602, 363, 390, 29906, 13547, 12392, 293, 13623, 24554, 7595, 1860, 856, 1159, 13, 4706, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 3200, 8841, 29918, 949, 29879, 29918, 12322, 29892, 525, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29889, 29888, 5427, 8785, 13, 4706, 364, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 4905, 353, 1722, 29898, 1311, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 4706, 1583, 3032, 17158, 29918, 3200, 8841, 29918, 6831, 2063, 29898, 1311, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29892, 364, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 4905, 29897, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 5631, 1218, 1136, 8841, 15602, 363, 390, 29896, 12059, 295, 12392, 293, 13623, 24554, 7595, 1860, 856, 1159, 13, 4706, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 3200, 8841, 29918, 949, 29879, 29918, 12322, 29892, 525, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29889, 29888, 5427, 8785, 13, 4706, 364, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 4905, 353, 1722, 29898, 1311, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 4706, 1583, 3032, 17158, 29918, 3200, 8841, 29918, 6831, 2063, 29898, 1311, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29892, 364, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 4905, 29897, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 5631, 1218, 1136, 8841, 15602, 363, 390, 29906, 12059, 295, 12392, 293, 13623, 24554, 7595, 1860, 856, 1159, 13, 4706, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 3200, 8841, 29918, 949, 29879, 29918, 12322, 29892, 525, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29889, 29888, 5427, 8785, 13, 4706, 364, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 4905, 353, 1722, 29898, 1311, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 4706, 1583, 3032, 17158, 29918, 3200, 8841, 29918, 6831, 2063, 29898, 1311, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 2520, 1860, 29918, 12322, 29892, 364, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 4905, 29897, 13, 4706, 1596, 703, 25632, 7790, 29876, 1159, 13, 13, 4706, 1596, 703, 13696, 8841, 15602, 363, 9867, 287, 390, 29896, 13547, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29897, 13, 4706, 1596, 703, 13696, 8841, 15602, 363, 9867, 287, 390, 29906, 13547, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29897, 13, 4706, 1596, 703, 13696, 8841, 15602, 363, 9867, 287, 390, 29896, 12059, 295, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29897, 13, 4706, 1596, 703, 13696, 8841, 15602, 363, 9867, 287, 390, 29906, 12059, 295, 12392, 293, 13623, 7160, 304, 18793, 718, 1583, 3032, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 695, 504, 414, 29918, 3200, 8841, 29918, 1445, 2084, 29897, 13, 4706, 1596, 580, 13, 13, 1678, 822, 903, 17158, 29918, 15227, 29918, 17471, 29898, 1311, 29892, 13547, 12392, 293, 29918, 14358, 29892, 1095, 1125, 13, 4706, 3573, 353, 13547, 12392, 293, 29918, 14358, 334, 29871, 29941, 13, 4706, 6528, 353, 376, 703, 718, 3573, 718, 376, 7240, 29908, 13, 4706, 565, 1095, 1275, 376, 29945, 29915, 1115, 13, 9651, 6528, 353, 13898, 29908, 718, 6528, 13, 4706, 565, 1095, 1275, 376, 29941, 29915, 1115, 13, 9651, 6528, 353, 6528, 718, 3908, 29908, 13, 4706, 10944, 353, 5124, 13, 4706, 363, 2967, 297, 18764, 287, 29898, 28497, 12392, 293, 29918, 14358, 29961, 29896, 17531, 1125, 13, 9651, 10944, 353, 2967, 718, 10944, 13, 9651, 565, 1095, 1275, 376, 29945, 29915, 1115, 13, 18884, 6528, 353, 6528, 718, 376, 15333, 29908, 718, 10944, 718, 376, 703, 718, 3573, 718, 376, 7240, 29908, 13, 9651, 565, 1095, 1275, 376, 29941, 29915, 1115, 13, 18884, 6528, 353, 6528, 718, 376, 29989, 29908, 718, 10944, 718, 376, 703, 718, 3573, 718, 376, 7240, 29938, 29908, 13, 4706, 736, 6528, 13, 13, 1678, 822, 903, 5014, 29918, 949, 29879, 29898, 1311, 29892, 1881, 29918, 1445, 2084, 29892, 364, 29896, 29918, 4905, 29892, 364, 29906, 29918, 4905, 1125, 13, 4706, 1196, 29918, 11808, 353, 29871, 29900, 13, 4706, 4839, 29918, 1220, 353, 5124, 13, 4706, 411, 1722, 29898, 2080, 29918, 1445, 2084, 29897, 408, 5665, 29918, 949, 29879, 29901, 13, 9651, 363, 1196, 297, 5665, 29918, 949, 29879, 29901, 13, 18884, 1196, 29918, 11808, 4619, 29871, 29896, 13, 18884, 565, 1196, 29918, 11808, 1273, 383, 29984, 29918, 23714, 2890, 29918, 13171, 29918, 16310, 1275, 17714, 3035, 1001, 29901, 13, 462, 1678, 4839, 29918, 1220, 353, 1196, 13, 462, 1678, 396, 5191, 363, 1962, 304, 13515, 1254, 29909, 3402, 29871, 13, 462, 1678, 4839, 29918, 1220, 353, 4839, 29918, 1220, 29889, 6506, 703, 24695, 376, 29958, 1159, 13, 18884, 565, 1196, 29918, 11808, 1273, 383, 29984, 29918, 23714, 2890, 29918, 13171, 29918, 16310, 1275, 3725, 13356, 1430, 4741, 29901, 13, 462, 1678, 1369, 29918, 28497, 29918, 9933, 353, 337, 29889, 4478, 29898, 1311, 3032, 29945, 10080, 29918, 28497, 12392, 293, 29918, 14358, 29918, 13087, 29892, 1196, 29897, 13, 462, 1678, 1095, 29918, 28497, 29918, 9933, 353, 337, 29889, 4478, 29898, 1311, 3032, 29941, 10080, 29918, 28497, 12392, 293, 29918, 14358, 29918, 13087, 29892, 1196, 29897, 13, 462, 1678, 565, 6120, 29898, 2962, 29918, 28497, 29918, 9933, 29897, 6228, 6120, 29898, 355, 29918, 28497, 29918, 9933, 1125, 13, 462, 4706, 565, 938, 29898, 6672, 29918, 1220, 29889, 5451, 703, 376, 9601, 29896, 1822, 5451, 703, 29901, 1159, 29961, 29900, 2314, 1275, 15842, 29956, 17011, 29901, 13, 462, 9651, 364, 29896, 29918, 4905, 29889, 3539, 29898, 6672, 29918, 1220, 29897, 13, 462, 9651, 364, 29896, 29918, 4905, 29889, 3539, 29898, 1220, 29897, 13, 462, 4706, 565, 938, 29898, 6672, 29918, 1220, 29889, 5451, 703, 376, 9601, 29896, 1822, 5451, 703, 29901, 1159, 29961, 29900, 2314, 1275, 5195, 5348, 1660, 29901, 13, 462, 9651, 364, 29906, 29918, 4905, 29889, 3539, 29898, 6672, 29918, 1220, 29897, 13, 462, 9651, 364, 29906, 29918, 4905, 29889, 3539, 29898, 1220, 29897, 13, 308, 13, 1678, 396, 10563, 13547, 12392, 293, 13623, 2729, 373, 16993, 3241, 491, 281, 2252, 342, 13, 1678, 822, 903, 17158, 29918, 19594, 287, 29918, 949, 29879, 29898, 1311, 29892, 13623, 29918, 2084, 29892, 13623, 29918, 695, 504, 414, 29918, 3888, 29918, 2084, 29892, 1303, 29918, 1853, 29892, 1303, 29918, 20845, 1125, 13, 4706, 24554, 353, 1051, 580, 13, 4706, 4206, 353, 1051, 580, 13, 4706, 1948, 29918, 1949, 353, 29871, 29900, 396, 3013, 5702, 310, 1948, 1353, 310, 1269, 9867, 13, 4706, 411, 1722, 29898, 949, 29879, 29918, 695, 504, 414, 29918, 3888, 29918, 2084, 29897, 408, 24554, 29918, 1445, 29901, 13, 9651, 396, 363, 1269, 1196, 297, 281, 2252, 342, 9867, 934, 29892, 3588, 304, 1051, 310, 938, 29879, 322, 29871, 13, 9651, 396, 3349, 25899, 322, 17140, 376, 1213, 2087, 5143, 26190, 29889, 13, 9651, 363, 1196, 297, 24554, 29918, 1445, 29901, 13, 18884, 1948, 29918, 1949, 4619, 29871, 29896, 13, 18884, 1196, 353, 518, 524, 29898, 29875, 29897, 363, 474, 297, 1196, 29889, 17010, 703, 7790, 29876, 2564, 5451, 703, 376, 4638, 13, 18884, 1196, 353, 518, 29875, 334, 13515, 29918, 23714, 2890, 29918, 13171, 29918, 16310, 363, 474, 297, 1196, 29962, 13, 18884, 396, 4175, 714, 27130, 24554, 13, 18884, 565, 7431, 29898, 1220, 29897, 1405, 29871, 29896, 29901, 13, 462, 1678, 24554, 29889, 4397, 29898, 1220, 29897, 13, 462, 1678, 4206, 29889, 4397, 29898, 798, 29918, 1949, 29897, 13, 4706, 1948, 29918, 13140, 353, 29871, 29900, 13, 4706, 396, 679, 599, 390, 29896, 470, 390, 29906, 13547, 12392, 293, 13623, 29871, 13, 4706, 13623, 29918, 1445, 353, 1722, 29898, 949, 29879, 29918, 2084, 29892, 376, 29878, 1159, 13, 4706, 13623, 29918, 9012, 353, 13623, 29918, 1445, 29889, 949, 9012, 580, 13, 4706, 363, 9867, 297, 24554, 29901, 13, 9651, 396, 6084, 988, 304, 4078, 13515, 1254, 29909, 2066, 2729, 373, 1303, 5305, 322, 278, 29871, 13, 9651, 396, 1134, 13623, 393, 526, 1641, 9867, 287, 29871, 13, 9651, 565, 1303, 29918, 1853, 1275, 376, 28497, 12392, 293, 29908, 322, 1303, 29918, 20845, 1275, 376, 11333, 1115, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 695, 504, 414, 742, 525, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 18884, 2897, 29889, 29885, 12535, 12935, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 525, 29878, 29896, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 29915, 718, 851, 29898, 5727, 29961, 798, 29918, 13140, 2314, 718, 15300, 29888, 5427, 8785, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 353, 1722, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 9651, 565, 1303, 29918, 1853, 1275, 376, 28497, 12392, 293, 29908, 322, 1303, 29918, 20845, 1275, 376, 24244, 1115, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 695, 504, 414, 742, 525, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 18884, 2897, 29889, 29885, 12535, 12935, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 525, 29878, 29906, 29918, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 29915, 718, 851, 29898, 5727, 29961, 798, 29918, 13140, 2314, 718, 15300, 29888, 5427, 8785, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 353, 1722, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 9651, 565, 1303, 29918, 1853, 1275, 376, 1491, 28497, 12392, 293, 29908, 322, 1303, 29918, 20845, 1275, 376, 11333, 1115, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 695, 504, 414, 742, 525, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 8785, 29871, 13, 18884, 2897, 29889, 29885, 12535, 12935, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 525, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 29915, 718, 851, 29898, 5727, 29961, 798, 29918, 13140, 2314, 718, 15300, 29888, 5427, 8785, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 353, 1722, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 9651, 565, 1303, 29918, 1853, 1275, 376, 1491, 28497, 12392, 293, 29908, 322, 1303, 29918, 20845, 1275, 376, 24244, 1115, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 695, 504, 414, 742, 525, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 8785, 29871, 13, 18884, 2897, 29889, 29885, 12535, 12935, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 525, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 29915, 718, 851, 29898, 5727, 29961, 798, 29918, 13140, 2314, 718, 15300, 29888, 5427, 8785, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 353, 1722, 29898, 19594, 287, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 29892, 376, 29893, 29974, 1159, 13, 9651, 396, 2183, 278, 1051, 310, 24554, 411, 1809, 1026, 787, 22289, 714, 29892, 9773, 13, 9651, 396, 9867, 13623, 304, 934, 29871, 13, 9651, 363, 474, 297, 3464, 29898, 2435, 29898, 19594, 22164, 13, 18884, 2380, 353, 9867, 29961, 29875, 29962, 13, 18884, 4839, 29918, 1220, 353, 13623, 29918, 9012, 29961, 2248, 29962, 13, 18884, 5665, 29918, 1220, 353, 13623, 29918, 9012, 29961, 2248, 718, 29871, 29896, 29962, 13, 18884, 396, 3863, 4839, 304, 1993, 278, 1303, 5305, 310, 5172, 29939, 934, 29871, 13, 18884, 565, 1303, 29918, 20845, 1275, 376, 24244, 1115, 13, 462, 1678, 4839, 29918, 1220, 353, 4839, 29918, 1220, 29889, 6506, 703, 29871, 29896, 29901, 29940, 613, 376, 29871, 29906, 29901, 29940, 1159, 13, 18884, 565, 1303, 29918, 20845, 1275, 376, 11333, 1115, 13, 462, 1678, 4839, 29918, 1220, 353, 4839, 29918, 1220, 29889, 6506, 703, 29871, 29906, 29901, 29940, 613, 376, 29871, 29896, 29901, 29940, 1159, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29889, 3539, 29898, 6672, 29918, 1220, 29897, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 4905, 29889, 3539, 29898, 16506, 29918, 1220, 29897, 13, 9651, 1948, 29918, 13140, 4619, 29871, 29896, 13, 4706, 736, 9867, 287, 29918, 949, 29879, 29918, 4905, 29918, 12322, 13, 13, 1678, 396, 10563, 3300, 2859, 10614, 310, 263, 731, 310, 13623, 363, 263, 934, 411, 13547, 12392, 293, 13623, 515, 13, 1678, 396, 263, 6590, 13515, 1254, 29984, 934, 6943, 278, 3300, 2859, 1095, 13, 1678, 822, 903, 276, 509, 2418, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29898, 1311, 29892, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 4993, 29918, 1445, 2084, 29892, 13547, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 2084, 29892, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 20845, 1125, 13, 4706, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 13662, 353, 731, 580, 13, 4706, 1196, 29918, 11808, 353, 29871, 29900, 13, 4706, 396, 3787, 599, 9066, 515, 13547, 12392, 293, 1303, 934, 13, 4706, 411, 1722, 29898, 28497, 12392, 293, 29918, 949, 29879, 29918, 19594, 29918, 2084, 29897, 408, 13547, 12392, 293, 29918, 949, 29879, 29918, 19594, 29901, 13, 9651, 363, 1196, 297, 13547, 12392, 293, 29918, 949, 29879, 29918, 19594, 29901, 13, 18884, 1196, 29918, 11808, 4619, 29871, 29896, 13, 18884, 565, 1196, 29918, 11808, 1273, 13515, 29918, 23714, 2890, 29918, 13171, 29918, 16310, 1275, 17714, 3035, 1001, 29901, 13, 462, 1678, 396, 3863, 4839, 304, 1993, 278, 1303, 5305, 310, 5172, 29939, 934, 29871, 13, 462, 1678, 565, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 20845, 1275, 376, 11333, 1115, 13, 462, 4706, 1196, 353, 1196, 29889, 6506, 703, 29871, 29906, 29901, 29940, 613, 376, 29871, 29896, 29901, 29940, 1159, 13, 462, 1678, 565, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 20845, 1275, 376, 24244, 1115, 13, 462, 4706, 1196, 353, 1196, 29889, 6506, 703, 29871, 29896, 29901, 29940, 613, 376, 29871, 29906, 29901, 29940, 1159, 13, 462, 1678, 396, 3863, 4839, 304, 1993, 13515, 1254, 29984, 3402, 363, 11975, 2441, 29871, 13, 462, 1678, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 13662, 29889, 1202, 29898, 1220, 29889, 6506, 703, 28341, 376, 5507, 876, 13, 13, 4706, 396, 6084, 988, 304, 4078, 13515, 1254, 29909, 2066, 2729, 373, 278, 1303, 1134, 13, 4706, 565, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 20845, 1275, 376, 11333, 1115, 13, 9651, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 1491, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 9651, 2897, 29889, 29885, 12535, 12935, 29898, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 9651, 364, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 525, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29889, 29888, 5427, 8785, 13, 9651, 364, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 353, 1722, 29898, 29878, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 1919, 376, 29874, 29974, 1159, 13, 4706, 565, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 20845, 1275, 376, 24244, 1115, 13, 9651, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 12322, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1311, 3032, 449, 29918, 12322, 29892, 525, 1491, 28497, 12392, 293, 29918, 949, 29879, 8785, 13, 9651, 2897, 29889, 29885, 12535, 12935, 29898, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 9651, 364, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 12322, 29892, 525, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29889, 29888, 5427, 8785, 13, 9651, 364, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 353, 1722, 29898, 29878, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 29892, 376, 29874, 29974, 1159, 13, 4706, 1196, 29918, 11808, 353, 29871, 29896, 13, 4706, 4839, 29918, 1220, 353, 5124, 13, 4706, 396, 2436, 599, 3300, 2859, 10614, 304, 934, 29871, 13, 4706, 411, 1722, 29898, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4993, 29918, 1445, 2084, 29897, 408, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 4993, 29901, 13, 9651, 363, 1196, 297, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 4993, 29901, 13, 18884, 565, 1196, 29918, 11808, 1273, 383, 29984, 29918, 23714, 2890, 29918, 13171, 29918, 16310, 1275, 17714, 3035, 1001, 29901, 13, 462, 1678, 4839, 29918, 1220, 353, 1196, 13, 18884, 565, 1196, 29918, 11808, 1273, 383, 29984, 29918, 23714, 2890, 29918, 13171, 29918, 16310, 1275, 3725, 13356, 1430, 4741, 29901, 13, 462, 1678, 396, 2436, 5665, 515, 13515, 1254, 29984, 304, 934, 565, 967, 4839, 338, 6790, 29871, 13, 462, 1678, 396, 297, 278, 1051, 13547, 29918, 13662, 13319, 8859, 29871, 13, 462, 1678, 565, 4839, 29918, 1220, 297, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 13662, 29901, 13, 462, 4706, 396, 3863, 4839, 304, 1993, 13515, 1254, 29909, 3402, 13, 462, 4706, 4839, 29918, 1220, 353, 4839, 29918, 1220, 29889, 6506, 703, 24695, 376, 29958, 1159, 13, 462, 4706, 565, 938, 29898, 6672, 29918, 1220, 29889, 5451, 703, 376, 9601, 29896, 1822, 5451, 703, 29901, 1159, 29961, 29900, 2314, 1275, 15842, 29956, 17011, 29901, 13, 462, 9651, 364, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29889, 3539, 29898, 6672, 29918, 1220, 29897, 13, 462, 9651, 364, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29889, 3539, 29898, 1220, 29897, 13, 462, 4706, 565, 938, 29898, 6672, 29918, 1220, 29889, 5451, 703, 376, 9601, 29896, 1822, 5451, 703, 29901, 1159, 29961, 29900, 2314, 1275, 5195, 5348, 1660, 29901, 13, 462, 9651, 364, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29889, 3539, 29898, 6672, 29918, 1220, 29897, 13, 462, 9651, 364, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29889, 3539, 29898, 1220, 29897, 13, 18884, 1196, 29918, 11808, 4619, 29871, 29896, 13, 4706, 565, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 20845, 1275, 376, 11333, 1115, 13, 9651, 736, 364, 29896, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 13, 4706, 565, 12059, 295, 12392, 293, 29918, 949, 29879, 29918, 20845, 1275, 376, 24244, 1115, 13, 9651, 736, 364, 29906, 29918, 1491, 28497, 12392, 293, 29918, 949, 29879, 29918, 4905, 29918, 1445, 2084, 13, 13, 1678, 822, 903, 17158, 29918, 2520, 1860, 29898, 1311, 29892, 2301, 2841, 29892, 9867, 287, 29918, 949, 29879, 29918, 12322, 29892, 22239, 29918, 4905, 29918, 12322, 1125, 13, 4706, 363, 9867, 29918, 949, 29879, 29918, 1445, 297, 2897, 29889, 1761, 3972, 29898, 19594, 287, 29918, 949, 29879, 29918, 12322, 1125, 13, 9651, 565, 9867, 29918, 949, 29879, 29918, 1445, 29889, 1975, 2541, 17350, 29888, 5427, 29908, 1125, 13, 18884, 9867, 29918, 949, 29879, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 19594, 287, 29918, 949, 29879, 29918, 12322, 29892, 9867, 29918, 949, 29879, 29918, 1445, 876, 13, 18884, 22239, 29918, 4905, 29918, 9507, 353, 9867, 29918, 949, 29879, 29918, 1445, 29937, 29889, 5451, 17350, 1159, 29961, 29900, 29962, 718, 11393, 284, 29876, 29908, 13, 18884, 22239, 29918, 4905, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 2520, 358, 29918, 4905, 29918, 12322, 29892, 22239, 29918, 4905, 29918, 9507, 876, 13, 18884, 2301, 2841, 29918, 6519, 353, 3077, 2841, 6255, 1220, 29898, 8366, 2841, 29892, 1881, 29922, 19594, 29918, 949, 29879, 29918, 1445, 2084, 29892, 714, 29922, 2520, 358, 29918, 4905, 29918, 1445, 2084, 29897, 13, 18884, 2301, 2841, 29918, 6519, 580, 13, 268, 13, 1678, 822, 903, 17158, 29918, 3200, 8841, 29918, 6831, 2063, 29898, 1311, 29892, 9867, 287, 29918, 949, 29879, 29918, 12322, 29892, 9867, 287, 29918, 949, 29879, 29918, 3200, 8841, 29918, 4905, 1125, 13, 4706, 363, 22239, 29918, 1445, 297, 2897, 29889, 1761, 3972, 29898, 19594, 287, 29918, 949, 29879, 29918, 12322, 1125, 13, 9651, 565, 22239, 29918, 1445, 29889, 1975, 2541, 17350, 29888, 5427, 29908, 1125, 13, 18884, 22239, 29918, 1445, 2084, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 359, 29889, 2084, 29889, 7122, 29898, 19594, 287, 29918, 949, 29879, 29918, 12322, 29892, 22239, 29918, 1445, 876, 13, 18884, 4839, 29918, 1220, 353, 376, 11903, 718, 376, 1285, 335, 29908, 718, 22239, 29918, 1445, 29889, 5451, 17350, 1159, 29961, 29900, 1822, 5451, 703, 29918, 1159, 14352, 29896, 29962, 718, 6634, 29876, 29908, 13, 18884, 22239, 353, 838, 647, 5971, 29889, 949, 29898, 2520, 358, 29918, 1445, 2084, 29892, 376, 29888, 5427, 1159, 13, 18884, 22239, 29918, 7727, 353, 838, 647, 3401, 29889, 26289, 3401, 29898, 2520, 358, 29897, 13, 18884, 1136, 8841, 29918, 16506, 353, 851, 29898, 2520, 358, 29918, 7727, 29889, 29887, 481, 29918, 3200, 8841, 29898, 14727, 681, 2433, 29940, 8785, 718, 6634, 29876, 29908, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 3200, 8841, 29918, 4905, 29889, 3539, 29898, 6672, 29918, 1220, 29897, 13, 18884, 9867, 287, 29918, 949, 29879, 29918, 3200, 8841, 29918, 4905, 29889, 3539, 29898, 3200, 8841, 29918, 16506, 29897, 2 ]
zadanie/primer/prim 2.py
Adrenaline1a/demo-2.13
0
76345
<filename>zadanie/primer/prim 2.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import math, datetime if __name__ == '__main__': math.cos(math.pi / 4) datetime.date(2017, 3, 21)
[ 1, 529, 9507, 29958, 29920, 328, 6067, 29914, 558, 4193, 29914, 9469, 29871, 29906, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 13, 5215, 5844, 29892, 12865, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 5844, 29889, 3944, 29898, 755, 29889, 1631, 847, 29871, 29946, 29897, 13, 1678, 12865, 29889, 1256, 29898, 29906, 29900, 29896, 29955, 29892, 29871, 29941, 29892, 29871, 29906, 29896, 29897, 13, 2 ]
domoticz/plugin.py
lz129/ioplus-rpi
5
169161
<reponame>lz129/ioplus-rpi<filename>domoticz/plugin.py # IOplus # # Author: <NAME>, 2020 # # """ <plugin key="IOplus" name="Raspberry IOplus" author="<NAME>" version="0.1" externallink=""> <description> IOplus 8 relay board on raspberry </description> <params> <param field="Mode1" label="board number" width="75px" default="0"/> <param field="Mode6" label="Debug" width="75px"> <options> <option label="True" value="Debug"/> <option label="False" value="Normal" default="true" /> </options> </param> </params> </plugin> """ # units 1-8 are relays # units 9-16 are inputs import Domoticz import libioplus as ioplus class BasePlugin: board = 0 running = 0 debug = 0 def set_relay(self,Unit, val): if self.debug: Domoticz.Log("set_relay "+str(Unit)+" to "+str(val)) ioplus.setRelayCh(self.board, Unit, int(val)) def __init__(self): return def connection(self): return def onStart(self): self.board=int(Parameters["Mode1"]) self.debug=Parameters["Mode6"]=="Debug" Domoticz.Log("onStart - Plugin is starting, debug="+str(self.debug)) for x in range(1, 9): if (x not in Devices): Domoticz.Device(Name="Relay_"+str(x), Unit=x, TypeName="Switch", Used=1).Create() if (x+8 not in Devices): Domoticz.Device(Name="Input_"+str(x), Unit=x+8, TypeName="Switch", Used=1).Create() self.set_relay(x, Devices[x].nValue) Domoticz.Heartbeat(3) self.running=1 def onStop(self): Domoticz.Log("onStop - Plugin is stopping.") def onConnect(self, Connection, Status, Description): return def onMessage(self, Connection, Data): return def onCommand(self, Unit, Command, Level, Hue): val=Command=="On" and "1" or "0" if (Unit in range(1,9)): self.set_relay(Unit, Command=="On") Devices[Unit].Update(int(val),val) def onDisconnect(self, Connection): unused=0 def onHeartbeat(self): if self.running: val=ioplus.getRelays(self.board) inp=ioplus.getOpto(self.board) if (self.debug): Domoticz.Log("read relays -> %02x, inputs -> %02x" % (val,inp)) for Unit in range(1,9): val1=(val >> (Unit-1)) & 1 inp1=(inp >> (Unit-1)) & 1 if (Unit in Devices): Devices[Unit].Update(int(val1),str(val1)) if (Unit+8 in Devices): Devices[Unit+8].Update(int(inp1),str(val1)) global _plugin _plugin = BasePlugin() def onStart(): global _plugin _plugin.onStart() def onStop(): global _plugin _plugin.onStop() def onConnect(Connection, Status, Description): global _plugin _plugin.onConnect(Connection, Status, Description) def onMessage(Connection, Data): global _plugin _plugin.onMessage(Connection, Data) def onCommand(Unit, Command, Level, Hue): global _plugin _plugin.onCommand(Unit, Command, Level, Hue) def onNotification(Name, Subject, Text, Status, Priority, Sound, ImageFile): global _plugin _plugin.onNotification(Name, Subject, Text, Status, Priority, Sound, ImageFile) def onDisconnect(Connection): global _plugin _plugin.onDisconnect(Connection) def onHeartbeat(): global _plugin _plugin.onHeartbeat()
[ 1, 529, 276, 1112, 420, 29958, 29880, 29920, 29896, 29906, 29929, 29914, 29875, 17201, 29899, 29878, 1631, 29966, 9507, 29958, 3129, 327, 5175, 29914, 8582, 29889, 2272, 13, 29937, 10663, 11242, 13, 29937, 13, 29937, 13361, 29901, 529, 5813, 10202, 29871, 29906, 29900, 29906, 29900, 13, 29937, 13, 29937, 13, 15945, 29908, 13, 29966, 8582, 1820, 543, 5971, 11242, 29908, 1024, 543, 29934, 4692, 16344, 10663, 11242, 29908, 4148, 543, 29966, 5813, 11903, 1873, 543, 29900, 29889, 29896, 29908, 3622, 497, 682, 543, 1013, 13, 1678, 529, 8216, 29958, 13, 1678, 10663, 11242, 29871, 29947, 29856, 7613, 373, 364, 4692, 16344, 13, 1678, 1533, 8216, 29958, 13, 1678, 529, 7529, 29958, 13, 4706, 529, 3207, 1746, 543, 6818, 29896, 29908, 3858, 543, 3377, 1353, 29908, 2920, 543, 29955, 29945, 1756, 29908, 2322, 543, 29900, 4681, 13, 4706, 529, 3207, 1746, 543, 6818, 29953, 29908, 3858, 543, 11862, 29908, 2920, 543, 29955, 29945, 1756, 1013, 13, 3986, 529, 6768, 29958, 13, 795, 529, 3385, 3858, 543, 5574, 29908, 995, 543, 11862, 4681, 13, 795, 529, 3385, 3858, 543, 8824, 29908, 995, 543, 19077, 29908, 29871, 2322, 543, 3009, 29908, 2900, 13, 3986, 1533, 6768, 29958, 13, 418, 1533, 3207, 29958, 13, 13, 1678, 1533, 7529, 29958, 13, 829, 8582, 29958, 13, 15945, 29908, 13, 13, 29937, 10340, 29871, 29896, 29899, 29947, 526, 29871, 1104, 1036, 13, 29937, 10340, 29871, 29929, 29899, 29896, 29953, 526, 10970, 13, 13, 5215, 7809, 327, 5175, 13, 5215, 4303, 29875, 17201, 408, 474, 17201, 13, 13, 1990, 7399, 16288, 29901, 13, 1678, 7613, 353, 29871, 29900, 13, 1678, 2734, 353, 29871, 29900, 13, 1678, 4744, 353, 29871, 29900, 13, 1678, 13, 1678, 822, 731, 29918, 2674, 388, 29898, 1311, 29892, 8325, 29892, 659, 1125, 13, 4706, 565, 1583, 29889, 8382, 29901, 7809, 327, 5175, 29889, 3403, 703, 842, 29918, 2674, 388, 15691, 710, 29898, 8325, 7240, 29908, 304, 15691, 710, 29898, 791, 876, 13, 4706, 474, 17201, 29889, 842, 9662, 388, 1451, 29898, 1311, 29889, 3377, 29892, 13223, 29892, 938, 29898, 791, 876, 13, 268, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 736, 13, 13, 1678, 822, 3957, 29898, 1311, 1125, 13, 4706, 736, 29871, 13, 539, 13, 1678, 822, 373, 4763, 29898, 1311, 1125, 308, 13, 4706, 1583, 29889, 3377, 29922, 524, 29898, 11507, 3366, 6818, 29896, 20068, 13, 4706, 1583, 29889, 8382, 29922, 11507, 3366, 6818, 29953, 3108, 26359, 11862, 29908, 13, 4706, 7809, 327, 5175, 29889, 3403, 703, 265, 4763, 448, 1858, 3851, 338, 6257, 29892, 4744, 543, 29974, 710, 29898, 1311, 29889, 8382, 876, 13, 4706, 363, 921, 297, 3464, 29898, 29896, 29892, 29871, 29929, 1125, 13, 9651, 565, 313, 29916, 451, 297, 9481, 1575, 1125, 7809, 327, 5175, 29889, 11501, 29898, 1170, 543, 9662, 388, 29918, 17969, 710, 29898, 29916, 511, 13223, 29922, 29916, 29892, 5167, 1170, 543, 24995, 613, 501, 8485, 29922, 29896, 467, 4391, 580, 13, 9651, 565, 313, 29916, 29974, 29947, 451, 297, 9481, 1575, 1125, 7809, 327, 5175, 29889, 11501, 29898, 1170, 543, 4290, 29918, 17969, 710, 29898, 29916, 511, 13223, 29922, 29916, 29974, 29947, 29892, 5167, 1170, 543, 24995, 613, 501, 8485, 29922, 29896, 467, 4391, 580, 13, 9651, 1583, 29889, 842, 29918, 2674, 388, 29898, 29916, 29892, 9481, 1575, 29961, 29916, 1822, 29876, 1917, 29897, 13, 4706, 7809, 327, 5175, 29889, 3868, 442, 915, 271, 29898, 29941, 29897, 13, 4706, 1583, 29889, 21094, 29922, 29896, 13, 13, 13, 1678, 822, 373, 16329, 29898, 1311, 1125, 13, 4706, 7809, 327, 5175, 29889, 3403, 703, 265, 16329, 448, 1858, 3851, 338, 25480, 23157, 13, 13, 1678, 822, 373, 17918, 29898, 1311, 29892, 15160, 29892, 16034, 29892, 12953, 1125, 13, 4706, 736, 13, 13, 1678, 822, 373, 3728, 29898, 1311, 29892, 15160, 29892, 3630, 1125, 13, 4706, 736, 13, 539, 13, 1678, 822, 373, 6255, 29898, 1311, 29892, 13223, 29892, 10516, 29892, 21597, 29892, 379, 434, 1125, 13, 4706, 659, 29922, 6255, 26359, 2951, 29908, 322, 376, 29896, 29908, 470, 376, 29900, 29908, 13, 4706, 565, 313, 8325, 297, 3464, 29898, 29896, 29892, 29929, 22164, 29871, 13, 3986, 1583, 29889, 842, 29918, 2674, 388, 29898, 8325, 29892, 10516, 26359, 2951, 1159, 13, 3986, 9481, 1575, 29961, 8325, 1822, 6422, 29898, 524, 29898, 791, 511, 791, 29897, 13, 13, 1678, 822, 373, 4205, 6915, 29898, 1311, 29892, 15160, 1125, 13, 4706, 443, 3880, 29922, 29900, 13, 13, 1678, 822, 373, 3868, 442, 915, 271, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 21094, 29901, 13, 3986, 659, 29922, 29875, 17201, 29889, 657, 9662, 1036, 29898, 1311, 29889, 3377, 29897, 13, 3986, 297, 29886, 29922, 29875, 17201, 29889, 657, 20624, 29877, 29898, 1311, 29889, 3377, 29897, 13, 3986, 565, 313, 1311, 29889, 8382, 1125, 7809, 327, 5175, 29889, 3403, 703, 949, 1104, 1036, 1599, 1273, 29900, 29906, 29916, 29892, 10970, 1599, 1273, 29900, 29906, 29916, 29908, 1273, 313, 791, 29892, 262, 29886, 876, 13, 3986, 363, 13223, 297, 3464, 29898, 29896, 29892, 29929, 1125, 13, 9651, 659, 29896, 7607, 791, 5099, 313, 8325, 29899, 29896, 876, 669, 29871, 29896, 13, 9651, 297, 29886, 29896, 7607, 262, 29886, 5099, 313, 8325, 29899, 29896, 876, 669, 29871, 29896, 13, 9651, 565, 313, 8325, 297, 9481, 1575, 1125, 9481, 1575, 29961, 8325, 1822, 6422, 29898, 524, 29898, 791, 29896, 511, 710, 29898, 791, 29896, 876, 13, 9651, 565, 313, 8325, 29974, 29947, 297, 9481, 1575, 1125, 9481, 1575, 29961, 8325, 29974, 29947, 1822, 6422, 29898, 524, 29898, 262, 29886, 29896, 511, 710, 29898, 791, 29896, 876, 13, 13, 13, 10945, 903, 8582, 13, 29918, 8582, 353, 7399, 16288, 580, 13, 13, 1753, 373, 4763, 7295, 13, 1678, 5534, 903, 8582, 13, 1678, 903, 8582, 29889, 265, 4763, 580, 13, 13, 1753, 373, 16329, 7295, 13, 1678, 5534, 903, 8582, 13, 1678, 903, 8582, 29889, 265, 16329, 580, 13, 13, 1753, 373, 17918, 29898, 5350, 29892, 16034, 29892, 12953, 1125, 13, 1678, 5534, 903, 8582, 13, 1678, 903, 8582, 29889, 265, 17918, 29898, 5350, 29892, 16034, 29892, 12953, 29897, 13, 13, 1753, 373, 3728, 29898, 5350, 29892, 3630, 1125, 13, 1678, 5534, 903, 8582, 13, 1678, 903, 8582, 29889, 265, 3728, 29898, 5350, 29892, 3630, 29897, 13, 13, 1753, 373, 6255, 29898, 8325, 29892, 10516, 29892, 21597, 29892, 379, 434, 1125, 13, 1678, 5534, 903, 8582, 13, 1678, 903, 8582, 29889, 265, 6255, 29898, 8325, 29892, 10516, 29892, 21597, 29892, 379, 434, 29897, 13, 13, 1753, 373, 12958, 29898, 1170, 29892, 3323, 622, 29892, 3992, 29892, 16034, 29892, 22096, 537, 29892, 14976, 29892, 7084, 2283, 1125, 13, 1678, 5534, 903, 8582, 13, 1678, 903, 8582, 29889, 265, 12958, 29898, 1170, 29892, 3323, 622, 29892, 3992, 29892, 16034, 29892, 22096, 537, 29892, 14976, 29892, 7084, 2283, 29897, 13, 13, 1753, 373, 4205, 6915, 29898, 5350, 1125, 13, 1678, 5534, 903, 8582, 13, 1678, 903, 8582, 29889, 265, 4205, 6915, 29898, 5350, 29897, 13, 13, 1753, 373, 3868, 442, 915, 271, 7295, 13, 1678, 5534, 903, 8582, 13, 1678, 903, 8582, 29889, 265, 3868, 442, 915, 271, 580, 13, 13, 2 ]
scripts/makeSwappHist.py
Miedema/MCNetwork
0
133399
#!/usr/bin/python3 from tools import * from sys import argv from os.path import join import h5py import matplotlib.pylab as plt from matplotlib.patches import Wedge import numpy as np if len(argv) > 1: pathToSimFolder = argv[1] else: pathToSimFolder = "../data/" parameters, electrodes = readParameters(pathToSimFolder) electrodeNumber = len(electrodes) acceptorPos = np.zeros((int(parameters["acceptorNumber"]), 2)) try: donorPos = np.zeros((int(parameters["donorNumber"]), 2)) except KeyError: donorPos = np.zeros( (int(parameters["acceptorNumber"] * parameters["compensationFactor"]), 2) ) with open(join(pathToSimFolder, "device.txt")) as deviceFile: line = next(deviceFile) line = next(deviceFile) for i in range(acceptorPos.shape[0]): acceptorPos[i] = next(deviceFile).split(" ") line = next(deviceFile) line = next(deviceFile) for i in range(donorPos.shape[0]): donorPos[i] = next(deviceFile).split(" ") # print(acceptorPos) # print(donorPos) electrodePositions = np.empty((len(electrodes), 2)) for i in range(len(electrodes)): if parameters["geometry"] == "rect": if electrodes[i][1] == 0: electrodePositions[i] = [0, electrodes[i][0] * parameters["lenY"]] if electrodes[i][1] == 1: electrodePositions[i] = [ parameters["lenX"], electrodes[i][0] * parameters["lenY"], ] if electrodes[i][1] == 2: electrodePositions[i] = [electrodes[i][0] * parameters["lenX"], 0] if electrodes[i][1] == 3: electrodePositions[i] = [ electrodes[i][0] * parameters["lenX"], parameters["lenY"], ] elif parameters["geometry"] == "circle": electrodePositions[i] = [ parameters["radius"] * np.cos(electrodes[i][0] / 360 * 2 * np.pi), parameters["radius"] * np.sin(electrodes[i][0] / 360 * 2 * np.pi), ] # print(electrodePositions) def colorMaker(x): from matplotlib import colors from scipy.interpolate import interp1d cols = ["darkred", "darkgreen"] rgbaData = np.array([colors.to_rgba(c) for c in cols]) rInterpolater = interp1d(np.linspace(0, 1, len(cols)), rgbaData[:, 0]) gInterpolater = interp1d(np.linspace(0, 1, len(cols)), rgbaData[:, 1]) bInterpolater = interp1d(np.linspace(0, 1, len(cols)), rgbaData[:, 2]) return np.array([rInterpolater(x), gInterpolater(x), bInterpolater(x), 1]) inp = ["0_0", "0_1", "1_0", "1_1"] for fileNumber in [1, 2, 3, 4]: # for fileNumber in [1]: data = np.genfromtxt( join(pathToSimFolder, f"swapTrackFile{fileNumber}.txt"), delimiter=";", dtype=int, ) maxIndex = np.max(data) added = (maxIndex + 1) * data[:, 0] + data[:, 1] bins = np.bincount(added) bins.resize(maxIndex + 1, maxIndex + 1) absBins = bins + bins.T absBins = absBins / np.max(absBins) distances = [] swapps = [] for i in range(bins.shape[0]): if i >= parameters["acceptorNumber"]: x1, y1 = ( electrodePositions[i - int(parameters["acceptorNumber"])][0], electrodePositions[i - int(parameters["acceptorNumber"])][1], ) else: x1, y1 = acceptorPos[i, 0], acceptorPos[i, 1] for j in range(i): if j >= parameters["acceptorNumber"]: x2, y2 = ( electrodePositions[j - int(parameters["acceptorNumber"])][0], electrodePositions[j - int(parameters["acceptorNumber"])][1], ) else: x2, y2 = acceptorPos[j, 0], acceptorPos[j, 1] # ax.plot([x1,x2],[y1,y2],"k-",alpha=bins[i,j]) if (bins[i, j] + bins[j, i]) != 0: currentRatio = bins[i, j] / (bins[i, j] + bins[j, i]) distances.append(np.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)) swapps.append(absBins[i, j]) fig, ax = plt.subplots(1, 1, figsize=(4.980614173228346, 3.2)) ax.hist( distances, weights=swapps, bins=50, density=True, histtype="step", color="k", range=[0, 100], ) ax.set_xlabel(r"d [nm]") ax.set_ylabel(r"P(swapp)") plt.savefig( join(pathToSimFolder, f"swapHist_{inp[fileNumber-1]}.png"), bbox_inches="tight", dpi=300, ) # plt.show() plt.close(fig) fig, ax = plt.subplots(1, 1, figsize=(4.980614173228346, 3.2)) ax.hist( distances, weights=swapps, bins=50, density=True, histtype="step", color="k", range=[0, 100], log=True, ) ax.set_xlabel(r"d [nm]") ax.set_ylabel(r"P(swapp)") plt.savefig( join(pathToSimFolder, f"swapHist_{inp[fileNumber-1]}_log.png"), bbox_inches="tight", dpi=300, ) # plt.show() plt.close(fig)
[ 1, 18787, 4855, 29914, 2109, 29914, 4691, 29941, 13, 3166, 8492, 1053, 334, 13, 3166, 10876, 1053, 1852, 29894, 13, 3166, 2897, 29889, 2084, 1053, 5988, 13, 13, 5215, 298, 29945, 2272, 13, 5215, 22889, 29889, 2272, 8205, 408, 14770, 13, 3166, 22889, 29889, 5041, 267, 1053, 399, 12864, 13, 13, 5215, 12655, 408, 7442, 13, 13, 361, 7431, 29898, 19218, 29897, 1405, 29871, 29896, 29901, 13, 1678, 2224, 1762, 8942, 12924, 353, 1852, 29894, 29961, 29896, 29962, 13, 2870, 29901, 13, 1678, 2224, 1762, 8942, 12924, 353, 376, 6995, 1272, 12975, 13, 13, 16744, 29892, 28118, 2783, 353, 1303, 11507, 29898, 2084, 1762, 8942, 12924, 29897, 13, 15436, 307, 311, 4557, 353, 7431, 29898, 15436, 307, 2783, 29897, 13, 13, 562, 14268, 9135, 353, 7442, 29889, 3298, 359, 3552, 524, 29898, 16744, 3366, 562, 14268, 4557, 3108, 511, 29871, 29906, 876, 13, 2202, 29901, 13, 1678, 1016, 272, 9135, 353, 7442, 29889, 3298, 359, 3552, 524, 29898, 16744, 3366, 9176, 272, 4557, 3108, 511, 29871, 29906, 876, 13, 19499, 7670, 2392, 29901, 13, 1678, 1016, 272, 9135, 353, 7442, 29889, 3298, 359, 29898, 13, 4706, 313, 524, 29898, 16744, 3366, 562, 14268, 4557, 3108, 334, 4128, 3366, 2388, 575, 362, 29943, 7168, 3108, 511, 29871, 29906, 29897, 13, 1678, 1723, 13, 13, 2541, 1722, 29898, 7122, 29898, 2084, 1762, 8942, 12924, 29892, 376, 10141, 29889, 3945, 5783, 408, 4742, 2283, 29901, 13, 1678, 1196, 353, 2446, 29898, 10141, 2283, 29897, 13, 1678, 1196, 353, 2446, 29898, 10141, 2283, 29897, 13, 1678, 363, 474, 297, 3464, 29898, 562, 14268, 9135, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 3544, 272, 9135, 29961, 29875, 29962, 353, 2446, 29898, 10141, 2283, 467, 5451, 703, 16521, 13, 1678, 1196, 353, 2446, 29898, 10141, 2283, 29897, 13, 1678, 1196, 353, 2446, 29898, 10141, 2283, 29897, 13, 1678, 363, 474, 297, 3464, 29898, 9176, 272, 9135, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 1016, 272, 9135, 29961, 29875, 29962, 353, 2446, 29898, 10141, 2283, 467, 5451, 703, 16521, 13, 13, 29937, 1596, 29898, 562, 14268, 9135, 29897, 13, 29937, 1596, 29898, 9176, 272, 9135, 29897, 13, 13, 15436, 307, 311, 9135, 2187, 353, 7442, 29889, 6310, 3552, 2435, 29898, 15436, 307, 2783, 511, 29871, 29906, 876, 13, 1454, 474, 297, 3464, 29898, 2435, 29898, 15436, 307, 2783, 22164, 13, 1678, 565, 4128, 3366, 19156, 3108, 1275, 376, 1621, 1115, 13, 4706, 565, 28118, 2783, 29961, 29875, 3816, 29896, 29962, 1275, 29871, 29900, 29901, 13, 9651, 28118, 311, 9135, 2187, 29961, 29875, 29962, 353, 518, 29900, 29892, 28118, 2783, 29961, 29875, 3816, 29900, 29962, 334, 4128, 3366, 2435, 29979, 3108, 29962, 13, 4706, 565, 28118, 2783, 29961, 29875, 3816, 29896, 29962, 1275, 29871, 29896, 29901, 13, 9651, 28118, 311, 9135, 2187, 29961, 29875, 29962, 353, 518, 13, 18884, 4128, 3366, 2435, 29990, 12436, 13, 18884, 28118, 2783, 29961, 29875, 3816, 29900, 29962, 334, 4128, 3366, 2435, 29979, 12436, 13, 9651, 4514, 13, 4706, 565, 28118, 2783, 29961, 29875, 3816, 29896, 29962, 1275, 29871, 29906, 29901, 13, 9651, 28118, 311, 9135, 2187, 29961, 29875, 29962, 353, 518, 15436, 307, 2783, 29961, 29875, 3816, 29900, 29962, 334, 4128, 3366, 2435, 29990, 12436, 29871, 29900, 29962, 13, 4706, 565, 28118, 2783, 29961, 29875, 3816, 29896, 29962, 1275, 29871, 29941, 29901, 13, 9651, 28118, 311, 9135, 2187, 29961, 29875, 29962, 353, 518, 13, 18884, 28118, 2783, 29961, 29875, 3816, 29900, 29962, 334, 4128, 3366, 2435, 29990, 12436, 13, 18884, 4128, 3366, 2435, 29979, 12436, 13, 9651, 4514, 13, 1678, 25342, 4128, 3366, 19156, 3108, 1275, 376, 16622, 1115, 13, 4706, 28118, 311, 9135, 2187, 29961, 29875, 29962, 353, 518, 13, 9651, 4128, 3366, 13471, 3108, 334, 7442, 29889, 3944, 29898, 15436, 307, 2783, 29961, 29875, 3816, 29900, 29962, 847, 29871, 29941, 29953, 29900, 334, 29871, 29906, 334, 7442, 29889, 1631, 511, 13, 9651, 4128, 3366, 13471, 3108, 334, 7442, 29889, 5223, 29898, 15436, 307, 2783, 29961, 29875, 3816, 29900, 29962, 847, 29871, 29941, 29953, 29900, 334, 29871, 29906, 334, 7442, 29889, 1631, 511, 13, 4706, 4514, 13, 13, 29937, 1596, 29898, 15436, 307, 311, 9135, 2187, 29897, 13, 13, 13, 1753, 2927, 29924, 5790, 29898, 29916, 1125, 13, 1678, 515, 22889, 1053, 11955, 13, 1678, 515, 4560, 2272, 29889, 1639, 3733, 403, 1053, 1006, 29886, 29896, 29881, 13, 13, 1678, 28730, 353, 6796, 26031, 1127, 613, 376, 26031, 12692, 3108, 13, 13, 1678, 24979, 1469, 353, 7442, 29889, 2378, 4197, 27703, 29889, 517, 29918, 11007, 2291, 29898, 29883, 29897, 363, 274, 297, 28730, 2314, 13, 1678, 364, 4074, 3733, 1008, 353, 1006, 29886, 29896, 29881, 29898, 9302, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29896, 29892, 7431, 29898, 22724, 8243, 24979, 1469, 7503, 29892, 29871, 29900, 2314, 13, 1678, 330, 4074, 3733, 1008, 353, 1006, 29886, 29896, 29881, 29898, 9302, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29896, 29892, 7431, 29898, 22724, 8243, 24979, 1469, 7503, 29892, 29871, 29896, 2314, 13, 1678, 289, 4074, 3733, 1008, 353, 1006, 29886, 29896, 29881, 29898, 9302, 29889, 1915, 3493, 29898, 29900, 29892, 29871, 29896, 29892, 7431, 29898, 22724, 8243, 24979, 1469, 7503, 29892, 29871, 29906, 2314, 13, 1678, 736, 7442, 29889, 2378, 4197, 29878, 4074, 3733, 1008, 29898, 29916, 511, 330, 4074, 3733, 1008, 29898, 29916, 511, 289, 4074, 3733, 1008, 29898, 29916, 511, 29871, 29896, 2314, 13, 13, 13, 262, 29886, 353, 6796, 29900, 29918, 29900, 613, 376, 29900, 29918, 29896, 613, 376, 29896, 29918, 29900, 613, 376, 29896, 29918, 29896, 3108, 13, 1454, 934, 4557, 297, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 5387, 13, 1678, 396, 363, 934, 4557, 297, 518, 29896, 5387, 13, 13, 1678, 848, 353, 7442, 29889, 1885, 3166, 3945, 29898, 13, 4706, 5988, 29898, 2084, 1762, 8942, 12924, 29892, 285, 29908, 26276, 17936, 2283, 29912, 1445, 4557, 1836, 3945, 4968, 13, 4706, 28552, 543, 29936, 613, 13, 4706, 26688, 29922, 524, 29892, 13, 1678, 1723, 13, 13, 1678, 4236, 3220, 353, 7442, 29889, 3317, 29898, 1272, 29897, 13, 1678, 2715, 353, 313, 3317, 3220, 718, 29871, 29896, 29897, 334, 848, 7503, 29892, 29871, 29900, 29962, 718, 848, 7503, 29892, 29871, 29896, 29962, 13, 13, 1678, 289, 1144, 353, 7442, 29889, 2109, 2798, 29898, 23959, 29897, 13, 1678, 289, 1144, 29889, 21476, 29898, 3317, 3220, 718, 29871, 29896, 29892, 4236, 3220, 718, 29871, 29896, 29897, 13, 13, 1678, 6425, 29933, 1144, 353, 289, 1144, 718, 289, 1144, 29889, 29911, 13, 1678, 6425, 29933, 1144, 353, 6425, 29933, 1144, 847, 7442, 29889, 3317, 29898, 6897, 29933, 1144, 29897, 13, 13, 1678, 24610, 353, 5159, 13, 1678, 2381, 13371, 353, 5159, 13, 13, 1678, 363, 474, 297, 3464, 29898, 29890, 1144, 29889, 12181, 29961, 29900, 29962, 1125, 13, 4706, 565, 474, 6736, 4128, 3366, 562, 14268, 4557, 3108, 29901, 13, 9651, 921, 29896, 29892, 343, 29896, 353, 313, 13, 18884, 28118, 311, 9135, 2187, 29961, 29875, 448, 938, 29898, 16744, 3366, 562, 14268, 4557, 20068, 3816, 29900, 1402, 13, 18884, 28118, 311, 9135, 2187, 29961, 29875, 448, 938, 29898, 16744, 3366, 562, 14268, 4557, 20068, 3816, 29896, 1402, 13, 9651, 1723, 13, 4706, 1683, 29901, 13, 9651, 921, 29896, 29892, 343, 29896, 353, 3544, 272, 9135, 29961, 29875, 29892, 29871, 29900, 1402, 3544, 272, 9135, 29961, 29875, 29892, 29871, 29896, 29962, 13, 13, 4706, 363, 432, 297, 3464, 29898, 29875, 1125, 13, 9651, 565, 432, 6736, 4128, 3366, 562, 14268, 4557, 3108, 29901, 13, 18884, 921, 29906, 29892, 343, 29906, 353, 313, 13, 462, 1678, 28118, 311, 9135, 2187, 29961, 29926, 448, 938, 29898, 16744, 3366, 562, 14268, 4557, 20068, 3816, 29900, 1402, 13, 462, 1678, 28118, 311, 9135, 2187, 29961, 29926, 448, 938, 29898, 16744, 3366, 562, 14268, 4557, 20068, 3816, 29896, 1402, 13, 18884, 1723, 13, 9651, 1683, 29901, 13, 18884, 921, 29906, 29892, 343, 29906, 353, 3544, 272, 9135, 29961, 29926, 29892, 29871, 29900, 1402, 3544, 272, 9135, 29961, 29926, 29892, 29871, 29896, 29962, 13, 13, 9651, 396, 4853, 29889, 5317, 4197, 29916, 29896, 29892, 29916, 29906, 16272, 29891, 29896, 29892, 29891, 29906, 1402, 29908, 29895, 29899, 613, 2312, 29922, 29890, 1144, 29961, 29875, 29892, 29926, 2314, 13, 9651, 565, 313, 29890, 1144, 29961, 29875, 29892, 432, 29962, 718, 289, 1144, 29961, 29926, 29892, 474, 2314, 2804, 29871, 29900, 29901, 13, 18884, 1857, 29934, 20819, 353, 289, 1144, 29961, 29875, 29892, 432, 29962, 847, 313, 29890, 1144, 29961, 29875, 29892, 432, 29962, 718, 289, 1144, 29961, 29926, 29892, 474, 2314, 13, 13, 18884, 24610, 29889, 4397, 29898, 9302, 29889, 3676, 3552, 29916, 29906, 448, 921, 29896, 29897, 3579, 29871, 29906, 718, 313, 29891, 29906, 448, 343, 29896, 29897, 3579, 29871, 29906, 876, 13, 18884, 2381, 13371, 29889, 4397, 29898, 6897, 29933, 1144, 29961, 29875, 29892, 432, 2314, 13, 13, 1678, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 29898, 29896, 29892, 29871, 29896, 29892, 2537, 2311, 7607, 29946, 29889, 29929, 29947, 29900, 29953, 29896, 29946, 29896, 29955, 29941, 29906, 29906, 29947, 29941, 29946, 29953, 29892, 29871, 29941, 29889, 29906, 876, 13, 13, 1678, 4853, 29889, 29882, 391, 29898, 13, 4706, 24610, 29892, 13, 4706, 18177, 29922, 2774, 13371, 29892, 13, 4706, 289, 1144, 29922, 29945, 29900, 29892, 13, 4706, 9027, 29922, 5574, 29892, 13, 4706, 9825, 1853, 543, 10568, 613, 13, 4706, 2927, 543, 29895, 613, 13, 4706, 3464, 11759, 29900, 29892, 29871, 29896, 29900, 29900, 1402, 13, 1678, 1723, 13, 13, 1678, 4853, 29889, 842, 29918, 29916, 1643, 29898, 29878, 29908, 29881, 518, 22882, 29962, 1159, 13, 1678, 4853, 29889, 842, 29918, 29891, 1643, 29898, 29878, 29908, 29925, 29898, 2774, 932, 25760, 13, 13, 1678, 14770, 29889, 7620, 1003, 29898, 13, 4706, 5988, 29898, 2084, 1762, 8942, 12924, 29892, 285, 29908, 26276, 29950, 391, 648, 262, 29886, 29961, 1445, 4557, 29899, 29896, 29962, 1836, 2732, 4968, 13, 4706, 289, 1884, 29918, 262, 6609, 543, 29873, 523, 613, 13, 4706, 270, 1631, 29922, 29941, 29900, 29900, 29892, 13, 1678, 1723, 13, 13, 1678, 396, 14770, 29889, 4294, 580, 13, 1678, 14770, 29889, 5358, 29898, 1003, 29897, 13, 13, 1678, 2537, 29892, 4853, 353, 14770, 29889, 1491, 26762, 29898, 29896, 29892, 29871, 29896, 29892, 2537, 2311, 7607, 29946, 29889, 29929, 29947, 29900, 29953, 29896, 29946, 29896, 29955, 29941, 29906, 29906, 29947, 29941, 29946, 29953, 29892, 29871, 29941, 29889, 29906, 876, 13, 13, 1678, 4853, 29889, 29882, 391, 29898, 13, 4706, 24610, 29892, 13, 4706, 18177, 29922, 2774, 13371, 29892, 13, 4706, 289, 1144, 29922, 29945, 29900, 29892, 13, 4706, 9027, 29922, 5574, 29892, 13, 4706, 9825, 1853, 543, 10568, 613, 13, 4706, 2927, 543, 29895, 613, 13, 4706, 3464, 11759, 29900, 29892, 29871, 29896, 29900, 29900, 1402, 13, 4706, 1480, 29922, 5574, 29892, 13, 1678, 1723, 13, 13, 1678, 4853, 29889, 842, 29918, 29916, 1643, 29898, 29878, 29908, 29881, 518, 22882, 29962, 1159, 13, 1678, 4853, 29889, 842, 29918, 29891, 1643, 29898, 29878, 29908, 29925, 29898, 2774, 932, 25760, 13, 13, 1678, 14770, 29889, 7620, 1003, 29898, 13, 4706, 5988, 29898, 2084, 1762, 8942, 12924, 29892, 285, 29908, 26276, 29950, 391, 648, 262, 29886, 29961, 1445, 4557, 29899, 29896, 29962, 2403, 1188, 29889, 2732, 4968, 13, 4706, 289, 1884, 29918, 262, 6609, 543, 29873, 523, 613, 13, 4706, 270, 1631, 29922, 29941, 29900, 29900, 29892, 13, 1678, 1723, 13, 13, 1678, 396, 14770, 29889, 4294, 580, 13, 1678, 14770, 29889, 5358, 29898, 1003, 29897, 13, 2 ]
sandbox/apps/app.py
django-oscar/django-oscar-gocardless
3
101285
<filename>sandbox/apps/app.py from oscar.app import Shop from apps.checkout.app import application as checkout_app class GoCardlessShop(Shop): checkout_app = checkout_app shop = GoCardlessShop()
[ 1, 529, 9507, 29958, 29879, 26738, 29914, 13371, 29914, 932, 29889, 2272, 13, 3166, 288, 14494, 29889, 932, 1053, 1383, 459, 13, 3166, 11446, 29889, 3198, 449, 29889, 932, 1053, 2280, 29871, 408, 24808, 29918, 932, 13, 13, 13, 1990, 2921, 13200, 2222, 2713, 459, 29898, 2713, 459, 1125, 13, 1678, 24808, 29918, 932, 353, 24808, 29918, 932, 13, 13, 13, 19032, 353, 2921, 13200, 2222, 2713, 459, 580, 13, 2 ]
src/sources/webnovelindonesia.py
Epicpkmn11/lightnovel-crawler
1
75666
<gh_stars>1-10 # -*- coding: utf-8 -*- import logging import re from concurrent import futures from ..utils.crawler import Crawler logger = logging.getLogger('WEBNOVEL_INDONESIA') chapter_list_url = 'https://webnovelindonesia.com/wp-json/writerist/v1/chapters?category=%s&perpage=100&order=ASC&paged=%s' class WebnovelIndonesia(Crawler): base_url = 'https://webnovelindonesia.com/' def read_novel_info(self): logger.debug('Visiting %s', self.novel_url) soup = self.get_soup(self.novel_url) self.novel_title = soup.select_one('.breadcrumb .breadcrumb-item.active').text.strip() logger.info('Novel title: %s', self.novel_title) self.novel_cover = self.absolute_url( soup.select_one('.section-novel img[class*="lazy"]')['data-src']) logger.info('Novel cover: %s', self.novel_cover) self.novel_author = soup.select_one('.section-novel li a[href*="/aut/"]').text.strip() logger.info('Novel author: %s', self.novel_author) possible_chapter_pages = soup.select('#js-chpater-jump > div.jump-to') if not len(possible_chapter_pages): possible_chapter_pages = [{'data-paged': '1'}] # end if novel_id = soup.select_one('#sortable-table')['data-category'] logger.info('Downloading chapters...') futures_to_check = dict() for div in possible_chapter_pages: page = div['data-paged'] url = chapter_list_url % (novel_id, page) task = self.executor.submit(self.extract_chapter_list, url) futures_to_check[task] = page # end for temp_chapters = dict() for future in futures.as_completed(futures_to_check): page = int(futures_to_check[future]) temp_chapters[page] = future.result() # end for logger.info('Building sorted chapter list...') for page in sorted(temp_chapters.keys()): self.volumes.append({'id': page}) for chap in temp_chapters[page]: chap['volume'] = page chap['id'] = 1 + len(self.chapters) self.chapters.append(chap) # end for # end for # end def def extract_chapter_list(self, url): temp_list = [] logger.debug('Visiting: %s', url) data = self.get_json(url) for item in data: temp_list.append({ 'title': item['post_title'], 'url': self.absolute_url(item['permalink']), }) # end for return temp_list # end def def download_chapter_body(self, chapter): '''Download body of a single chapter and return as clean html format''' logger.info('Downloading %s', chapter['url']) soup = self.get_soup(chapter['url']) body = '' for p in soup.select('#content > p'): if p.text.strip(): body += str(p).strip() # end if # end for return body # end def # end class
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 12183, 13, 5215, 337, 13, 3166, 21984, 1053, 3105, 1973, 13, 3166, 6317, 13239, 29889, 29883, 1610, 1358, 1053, 315, 1610, 1358, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 877, 8851, 29933, 6632, 29963, 6670, 29918, 22255, 1164, 2890, 10764, 1495, 13, 13, 27349, 29918, 1761, 29918, 2271, 353, 525, 991, 597, 2676, 13715, 295, 513, 2873, 423, 29889, 510, 29914, 11912, 29899, 3126, 29914, 13236, 391, 29914, 29894, 29896, 29914, 305, 481, 2153, 29973, 7320, 16328, 29879, 29987, 546, 3488, 29922, 29896, 29900, 29900, 29987, 2098, 29922, 28599, 29987, 29886, 4063, 16328, 29879, 29915, 13, 13, 13, 1990, 2563, 13715, 295, 2568, 2873, 423, 29898, 29907, 1610, 1358, 1125, 13, 1678, 2967, 29918, 2271, 353, 525, 991, 597, 2676, 13715, 295, 513, 2873, 423, 29889, 510, 22208, 13, 13, 1678, 822, 1303, 29918, 13715, 295, 29918, 3888, 29898, 1311, 1125, 13, 4706, 17927, 29889, 8382, 877, 6116, 11407, 1273, 29879, 742, 1583, 29889, 13715, 295, 29918, 2271, 29897, 13, 4706, 22300, 353, 1583, 29889, 657, 29918, 29879, 1132, 29898, 1311, 29889, 13715, 295, 29918, 2271, 29897, 13, 13, 4706, 1583, 29889, 13715, 295, 29918, 3257, 353, 22300, 29889, 2622, 29918, 650, 12839, 29890, 949, 7283, 3774, 869, 29890, 949, 7283, 3774, 29899, 667, 29889, 4925, 2824, 726, 29889, 17010, 580, 13, 4706, 17927, 29889, 3888, 877, 25363, 295, 3611, 29901, 1273, 29879, 742, 1583, 29889, 13715, 295, 29918, 3257, 29897, 13, 13, 4706, 1583, 29889, 13715, 295, 29918, 11911, 353, 1583, 29889, 23552, 29918, 2271, 29898, 13, 9651, 22300, 29889, 2622, 29918, 650, 12839, 2042, 29899, 13715, 295, 10153, 29961, 1990, 29930, 543, 433, 1537, 3108, 1495, 1839, 1272, 29899, 4351, 11287, 13, 4706, 17927, 29889, 3888, 877, 25363, 295, 4612, 29901, 1273, 29879, 742, 1583, 29889, 13715, 295, 29918, 11911, 29897, 13, 13, 4706, 1583, 29889, 13715, 295, 29918, 8921, 353, 22300, 29889, 2622, 29918, 650, 12839, 2042, 29899, 13715, 295, 619, 263, 29961, 12653, 29930, 13802, 1300, 29914, 3108, 2824, 726, 29889, 17010, 580, 13, 4706, 17927, 29889, 3888, 877, 25363, 295, 4148, 29901, 1273, 29879, 742, 1583, 29889, 13715, 295, 29918, 8921, 29897, 13, 13, 4706, 1950, 29918, 27349, 29918, 12292, 353, 22300, 29889, 2622, 14237, 1315, 29899, 305, 29886, 1008, 29899, 29926, 3427, 1405, 1933, 29889, 29926, 3427, 29899, 517, 1495, 13, 13, 4706, 565, 451, 7431, 29898, 27338, 29918, 27349, 29918, 12292, 1125, 13, 9651, 1950, 29918, 27349, 29918, 12292, 353, 518, 10998, 1272, 29899, 29886, 4063, 2396, 525, 29896, 29915, 6525, 13, 4706, 396, 1095, 565, 13, 13, 4706, 9554, 29918, 333, 353, 22300, 29889, 2622, 29918, 650, 14237, 6605, 519, 29899, 2371, 1495, 1839, 1272, 29899, 7320, 2033, 13, 13, 4706, 17927, 29889, 3888, 877, 6767, 13234, 10708, 2153, 856, 1495, 13, 4706, 3105, 1973, 29918, 517, 29918, 3198, 353, 9657, 580, 13, 4706, 363, 1933, 297, 1950, 29918, 27349, 29918, 12292, 29901, 13, 9651, 1813, 353, 1933, 1839, 1272, 29899, 29886, 4063, 2033, 13, 9651, 3142, 353, 16385, 29918, 1761, 29918, 2271, 1273, 313, 13715, 295, 29918, 333, 29892, 1813, 29897, 13, 9651, 3414, 353, 1583, 29889, 4258, 3406, 29889, 7892, 29898, 1311, 29889, 21111, 29918, 27349, 29918, 1761, 29892, 3142, 29897, 13, 9651, 3105, 1973, 29918, 517, 29918, 3198, 29961, 7662, 29962, 353, 1813, 13, 4706, 396, 1095, 363, 13, 13, 4706, 5694, 29918, 305, 481, 2153, 353, 9657, 580, 13, 4706, 363, 5434, 297, 3105, 1973, 29889, 294, 29918, 5729, 9446, 29898, 29888, 329, 1973, 29918, 517, 29918, 3198, 1125, 13, 9651, 1813, 353, 938, 29898, 29888, 329, 1973, 29918, 517, 29918, 3198, 29961, 29888, 9130, 2314, 13, 9651, 5694, 29918, 305, 481, 2153, 29961, 3488, 29962, 353, 5434, 29889, 2914, 580, 13, 4706, 396, 1095, 363, 13, 13, 4706, 17927, 29889, 3888, 877, 8893, 292, 12705, 16385, 1051, 856, 1495, 13, 4706, 363, 1813, 297, 12705, 29898, 7382, 29918, 305, 481, 2153, 29889, 8149, 580, 1125, 13, 9651, 1583, 29889, 1555, 9351, 29889, 4397, 3319, 29915, 333, 2396, 1813, 1800, 13, 9651, 363, 10708, 297, 5694, 29918, 305, 481, 2153, 29961, 3488, 5387, 13, 18884, 10708, 1839, 24623, 2033, 353, 1813, 13, 18884, 10708, 1839, 333, 2033, 353, 29871, 29896, 718, 7431, 29898, 1311, 29889, 305, 481, 2153, 29897, 13, 18884, 1583, 29889, 305, 481, 2153, 29889, 4397, 29898, 305, 481, 29897, 13, 9651, 396, 1095, 363, 13, 4706, 396, 1095, 363, 13, 1678, 396, 1095, 822, 13, 13, 1678, 822, 6597, 29918, 27349, 29918, 1761, 29898, 1311, 29892, 3142, 1125, 13, 4706, 5694, 29918, 1761, 353, 5159, 13, 4706, 17927, 29889, 8382, 877, 6116, 11407, 29901, 1273, 29879, 742, 3142, 29897, 13, 4706, 848, 353, 1583, 29889, 657, 29918, 3126, 29898, 2271, 29897, 13, 4706, 363, 2944, 297, 848, 29901, 13, 9651, 5694, 29918, 1761, 29889, 4397, 3319, 13, 18884, 525, 3257, 2396, 2944, 1839, 2490, 29918, 3257, 7464, 13, 18884, 525, 2271, 2396, 1583, 29889, 23552, 29918, 2271, 29898, 667, 1839, 546, 5156, 682, 2033, 511, 13, 9651, 5615, 13, 4706, 396, 1095, 363, 13, 4706, 736, 5694, 29918, 1761, 13, 1678, 396, 1095, 822, 13, 13, 1678, 822, 5142, 29918, 27349, 29918, 2587, 29898, 1311, 29892, 16385, 1125, 13, 4706, 14550, 22954, 3573, 310, 263, 2323, 16385, 322, 736, 408, 5941, 3472, 3402, 12008, 13, 4706, 17927, 29889, 3888, 877, 6767, 13234, 1273, 29879, 742, 16385, 1839, 2271, 11287, 13, 4706, 22300, 353, 1583, 29889, 657, 29918, 29879, 1132, 29898, 27349, 1839, 2271, 11287, 13, 13, 4706, 3573, 353, 6629, 13, 4706, 363, 282, 297, 22300, 29889, 2622, 14237, 3051, 1405, 282, 29374, 13, 9651, 565, 282, 29889, 726, 29889, 17010, 7295, 13, 18884, 3573, 4619, 851, 29898, 29886, 467, 17010, 580, 13, 9651, 396, 1095, 565, 13, 4706, 396, 1095, 363, 13, 13, 4706, 736, 3573, 13, 1678, 396, 1095, 822, 13, 29937, 1095, 770, 13, 2 ]
base/server.py
memy85/2022_Federated-Learning-Base
0
58426
<reponame>memy85/2022_Federated-Learning-Base from typing import List, Dict import tensorflow as tf import tensorflow.keras as keras from tensorflow.keras import models, layers, optimizers, initializers, losses, metrics from base.networks import * from base.client import * from base.federated import * class Server(object): def __init__(self, network_config, server_config, network_module, aggregator): """ class for server """ self.num_rounds = server_config['num_rounds'] self.c_fraction = server_config['c_fraction'] self.n_clients = server_config['n_clients'] self.selected_clients_index = None self.netmodule: Network = network_module(network_config) self.init_global_network() self.aggmodule: Aggregator = aggregator() # results during a round self.selected_client_n_k_list: List = None self.selected_client_weight_list: List = None self.selected_client_loss_list: List = None # results for train self.federated_loss_per_round: List = None self.train_loss_per_round: List = None self.train_eval_metric_per_round: List = None # acc , rmse, auc .. self.valid_loss_per_round: List = None self.valid_eval_metric_per_round: List = None # acc , rmse, auc .. def learn(self, clients: List[Client], valid_data: List = None): self.federated_loss_per_round = [] self.train_loss_per_round = [] self.train_eval_metric_per_round = [] if valid_data is not None: self.valid_loss_per_round = [] self.valid_eval_metric_per_round = [] # send initialized global weights to all clients and set client's weights self.send_global_weights() for client in clients: client.receive_global_weights() client.set_global_weights(self.netmodule.network.get_weights()) # start learning round / client parally do for round in range(self.num_rounds): print("==========" * 5, f"Round {round + 1}") self.train_one_round(clients) # Valid if valid_data is not None: self.valid_one_round(valid_data) print(f"Federated loss: {np.round(self.federated_loss_per_round[-1], 4)}, " f"Train loss: {np.round(self.train_loss_per_round[-1], 4)}, " f"Train {self.netmodule.evaluate_metric().name}: " f"{np.round(self.train_eval_metric_per_round[-1], 4)}, \n" f"Valid loss: {np.round(self.valid_loss_per_round[-1], 4)}, " f"Train {self.netmodule.evaluate_metric().name}: " f"{np.round(self.valid_eval_metric_per_round[-1], 4)}, " ) # send and receive final global weights self.send_global_weights() for client in clients: client.receive_global_weights() client.set_global_weights(self.netmodule.network.get_weights()) def train_one_round(self, clients: List[Client]): # server # select clients self.select_clients() # 이 때는 client 객체 필요 없음. selected_clients = [client for client in clients if client.client_id in self.selected_clients_index] # client list n_sample = sum(client.n_k_sample for client in selected_clients) # total n # clients update parallel self.clients_update_one_round(selected_clients) self.receive_weights() # aggregate clients weights federated_weights, federated_loss = self.aggmodule.aggregate( n_sample=n_sample, selected_client_n_k_list=self.selected_client_n_k_list, selected_client_loss_list=self.selected_client_loss_list, selected_client_weight_list=self.selected_client_weight_list ) self.set_global_weights(federated_weights) # set global weights as server weights self.federated_loss_per_round.append(federated_loss) # train eval for all client's input predictions = self.netmodule.network(np.concatenate([client.input for client in selected_clients], axis=0)) labels = np.concatenate([client.label for client in selected_clients], axis=0) # train loss train_loss = (tf.reduce_sum(self.netmodule.loss_metric()(labels, predictions))).numpy() self.train_loss_per_round.append(train_loss) # train eval metric train_eval_metric = (tf.reduce_sum(self.netmodule.evaluate_metric()(labels, predictions))).numpy() self.train_eval_metric_per_round.append(train_eval_metric) def valid_one_round(self, valid_data: List): """ :param valid_data: List(input_valid, label_valid) :return: """ # valid eval for external validation dataset predictions = self.netmodule.network(valid_data[0]) labels = valid_data[1] # valid loss valid_loss = (tf.reduce_sum(self.netmodule.loss_metric()(labels, predictions))).numpy() self.valid_loss_per_round.append(valid_loss) # train eval metric valid_eval_metric = (tf.reduce_sum(self.netmodule.evaluate_metric()(labels, predictions))).numpy() self.valid_eval_metric_per_round.append(valid_eval_metric) def clients_update_one_round(self, selected_clients: List[Client]): # clients self.selected_client_n_k_list = [] self.selected_client_weight_list = [] self.selected_client_loss_list = [] for client in selected_clients: # parallel client.receive_global_weights() # receive weights from server client.set_global_weights(self.netmodule.network.get_weights()) # set global weights client.learn() # client learn # send client information to server (weights, loss, n_k_sample) client.send_weights() self.selected_client_n_k_list.append(client.n_k_sample) self.selected_client_weight_list.append(client.netmodule.network.get_weights()) self.selected_client_loss_list.append(client.netmodule.results['loss'][-1]) # TODO acc 추가? def init_global_network(self): self.netmodule.create_network() self.netmodule.network._name = 'server_network' def select_clients(self): n_selected_clients = max(int(self.n_clients * self.c_fraction), 1) self.selected_clients_index = np.random.choice(range(1, self.n_clients + 1), n_selected_clients, replace=False) print(f"{len(self.selected_clients_index)} selected clients: ", self.selected_clients_index, f"with C fraction {self.c_fraction}") def set_global_weights(self, global_weights): self.netmodule.network.set_weights(global_weights) # set global weights as server weights def send_global_weights(self): pass # not implemented, statement for client - server communication def receive_weights(self): """ receive weights from selected clients :return: """ pass # not implemented, statement for client - server communication
[ 1, 529, 276, 1112, 420, 29958, 29885, 6764, 29947, 29945, 29914, 29906, 29900, 29906, 29906, 29918, 29943, 2447, 630, 29899, 29931, 799, 1076, 29899, 5160, 13, 3166, 19229, 1053, 2391, 29892, 360, 919, 13, 5215, 26110, 408, 15886, 13, 5215, 26110, 29889, 3946, 294, 408, 13023, 294, 13, 3166, 26110, 29889, 3946, 294, 1053, 4733, 29892, 15359, 29892, 5994, 19427, 29892, 2847, 19427, 29892, 28495, 29892, 21556, 13, 3166, 2967, 29889, 11618, 29879, 1053, 334, 13, 3166, 2967, 29889, 4645, 1053, 334, 13, 3166, 2967, 29889, 29888, 2447, 630, 1053, 334, 13, 13, 13, 1990, 5656, 29898, 3318, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3564, 29918, 2917, 29892, 1923, 29918, 2917, 29892, 3564, 29918, 5453, 29892, 11404, 1061, 1125, 13, 4706, 9995, 13, 4706, 770, 363, 1923, 13, 13, 4706, 9995, 13, 4706, 1583, 29889, 1949, 29918, 29878, 3885, 353, 1923, 29918, 2917, 1839, 1949, 29918, 29878, 3885, 2033, 13, 4706, 1583, 29889, 29883, 29918, 29888, 13857, 353, 1923, 29918, 2917, 1839, 29883, 29918, 29888, 13857, 2033, 13, 4706, 1583, 29889, 29876, 29918, 11303, 1237, 353, 1923, 29918, 2917, 1839, 29876, 29918, 11303, 1237, 2033, 13, 13, 4706, 1583, 29889, 8391, 29918, 11303, 1237, 29918, 2248, 353, 6213, 13, 4706, 1583, 29889, 1212, 5453, 29901, 8527, 353, 3564, 29918, 5453, 29898, 11618, 29918, 2917, 29897, 13, 13, 4706, 1583, 29889, 2344, 29918, 10945, 29918, 11618, 580, 13, 13, 4706, 1583, 29889, 16170, 5453, 29901, 319, 26127, 1061, 353, 11404, 1061, 580, 13, 13, 4706, 396, 2582, 2645, 263, 4513, 13, 4706, 1583, 29889, 8391, 29918, 4645, 29918, 29876, 29918, 29895, 29918, 1761, 29901, 2391, 353, 6213, 13, 4706, 1583, 29889, 8391, 29918, 4645, 29918, 7915, 29918, 1761, 29901, 2391, 353, 6213, 13, 4706, 1583, 29889, 8391, 29918, 4645, 29918, 6758, 29918, 1761, 29901, 2391, 353, 6213, 13, 13, 4706, 396, 2582, 363, 7945, 13, 4706, 1583, 29889, 29888, 2447, 630, 29918, 6758, 29918, 546, 29918, 14486, 29901, 2391, 353, 6213, 13, 4706, 1583, 29889, 14968, 29918, 6758, 29918, 546, 29918, 14486, 29901, 2391, 353, 6213, 13, 4706, 1583, 29889, 14968, 29918, 14513, 29918, 16414, 29918, 546, 29918, 14486, 29901, 2391, 353, 6213, 29871, 396, 1035, 1919, 20241, 344, 29892, 20480, 6317, 13, 4706, 1583, 29889, 3084, 29918, 6758, 29918, 546, 29918, 14486, 29901, 2391, 353, 6213, 13, 4706, 1583, 29889, 3084, 29918, 14513, 29918, 16414, 29918, 546, 29918, 14486, 29901, 2391, 353, 6213, 29871, 396, 1035, 1919, 20241, 344, 29892, 20480, 6317, 13, 13, 1678, 822, 5110, 29898, 1311, 29892, 13154, 29901, 2391, 29961, 4032, 1402, 2854, 29918, 1272, 29901, 2391, 353, 6213, 1125, 13, 4706, 1583, 29889, 29888, 2447, 630, 29918, 6758, 29918, 546, 29918, 14486, 353, 5159, 13, 4706, 1583, 29889, 14968, 29918, 6758, 29918, 546, 29918, 14486, 353, 5159, 13, 4706, 1583, 29889, 14968, 29918, 14513, 29918, 16414, 29918, 546, 29918, 14486, 353, 5159, 13, 4706, 565, 2854, 29918, 1272, 338, 451, 6213, 29901, 13, 9651, 1583, 29889, 3084, 29918, 6758, 29918, 546, 29918, 14486, 353, 5159, 13, 9651, 1583, 29889, 3084, 29918, 14513, 29918, 16414, 29918, 546, 29918, 14486, 353, 5159, 13, 13, 4706, 396, 3638, 16601, 5534, 18177, 304, 599, 13154, 322, 731, 3132, 29915, 29879, 18177, 13, 4706, 1583, 29889, 6717, 29918, 10945, 29918, 705, 5861, 580, 13, 4706, 363, 3132, 297, 13154, 29901, 13, 9651, 3132, 29889, 13556, 573, 29918, 10945, 29918, 705, 5861, 580, 13, 9651, 3132, 29889, 842, 29918, 10945, 29918, 705, 5861, 29898, 1311, 29889, 1212, 5453, 29889, 11618, 29889, 657, 29918, 705, 5861, 3101, 13, 4706, 396, 1369, 6509, 4513, 847, 3132, 610, 635, 437, 13, 4706, 363, 4513, 297, 3464, 29898, 1311, 29889, 1949, 29918, 29878, 3885, 1125, 13, 9651, 1596, 703, 4936, 26359, 334, 29871, 29945, 29892, 285, 29908, 29934, 618, 426, 14486, 718, 29871, 29896, 27195, 13, 9651, 1583, 29889, 14968, 29918, 650, 29918, 14486, 29898, 11303, 1237, 29897, 13, 9651, 396, 15758, 13, 9651, 565, 2854, 29918, 1272, 338, 451, 6213, 29901, 13, 18884, 1583, 29889, 3084, 29918, 650, 29918, 14486, 29898, 3084, 29918, 1272, 29897, 13, 18884, 1596, 29898, 29888, 29908, 29943, 2447, 630, 6410, 29901, 426, 9302, 29889, 14486, 29898, 1311, 29889, 29888, 2447, 630, 29918, 6758, 29918, 546, 29918, 14486, 14352, 29896, 1402, 29871, 29946, 19230, 376, 13, 462, 418, 285, 29908, 5323, 262, 6410, 29901, 426, 9302, 29889, 14486, 29898, 1311, 29889, 14968, 29918, 6758, 29918, 546, 29918, 14486, 14352, 29896, 1402, 29871, 29946, 19230, 376, 13, 462, 418, 285, 29908, 5323, 262, 426, 1311, 29889, 1212, 5453, 29889, 24219, 403, 29918, 16414, 2141, 978, 6177, 376, 13, 462, 418, 285, 29908, 29912, 9302, 29889, 14486, 29898, 1311, 29889, 14968, 29918, 14513, 29918, 16414, 29918, 546, 29918, 14486, 14352, 29896, 1402, 29871, 29946, 19230, 320, 29876, 29908, 13, 462, 418, 285, 29908, 7211, 6410, 29901, 426, 9302, 29889, 14486, 29898, 1311, 29889, 3084, 29918, 6758, 29918, 546, 29918, 14486, 14352, 29896, 1402, 29871, 29946, 19230, 376, 13, 462, 418, 285, 29908, 5323, 262, 426, 1311, 29889, 1212, 5453, 29889, 24219, 403, 29918, 16414, 2141, 978, 6177, 376, 13, 462, 418, 285, 29908, 29912, 9302, 29889, 14486, 29898, 1311, 29889, 3084, 29918, 14513, 29918, 16414, 29918, 546, 29918, 14486, 14352, 29896, 1402, 29871, 29946, 19230, 376, 13, 462, 418, 1723, 13, 4706, 396, 3638, 322, 7150, 2186, 5534, 18177, 13, 4706, 1583, 29889, 6717, 29918, 10945, 29918, 705, 5861, 580, 13, 4706, 363, 3132, 297, 13154, 29901, 13, 9651, 3132, 29889, 13556, 573, 29918, 10945, 29918, 705, 5861, 580, 13, 9651, 3132, 29889, 842, 29918, 10945, 29918, 705, 5861, 29898, 1311, 29889, 1212, 5453, 29889, 11618, 29889, 657, 29918, 705, 5861, 3101, 13, 13, 1678, 822, 7945, 29918, 650, 29918, 14486, 29898, 1311, 29892, 13154, 29901, 2391, 29961, 4032, 29962, 1125, 29871, 396, 1923, 13, 4706, 396, 1831, 13154, 13, 4706, 1583, 29889, 2622, 29918, 11303, 1237, 580, 29871, 396, 29871, 30393, 29871, 238, 152, 143, 31081, 3132, 29871, 237, 179, 160, 239, 181, 183, 29871, 240, 152, 135, 31527, 29871, 239, 154, 137, 31966, 29889, 13, 4706, 4629, 29918, 11303, 1237, 353, 518, 4645, 363, 3132, 297, 13154, 565, 13, 462, 9651, 3132, 29889, 4645, 29918, 333, 297, 1583, 29889, 8391, 29918, 11303, 1237, 29918, 2248, 29962, 29871, 396, 3132, 1051, 13, 4706, 302, 29918, 11249, 353, 2533, 29898, 4645, 29889, 29876, 29918, 29895, 29918, 11249, 363, 3132, 297, 4629, 29918, 11303, 1237, 29897, 29871, 396, 3001, 302, 13, 13, 4706, 396, 13154, 2767, 8943, 13, 4706, 1583, 29889, 11303, 1237, 29918, 5504, 29918, 650, 29918, 14486, 29898, 8391, 29918, 11303, 1237, 29897, 13, 4706, 1583, 29889, 13556, 573, 29918, 705, 5861, 580, 13, 4706, 396, 20431, 13154, 18177, 13, 4706, 12067, 630, 29918, 705, 5861, 29892, 12067, 630, 29918, 6758, 353, 1583, 29889, 16170, 5453, 29889, 26193, 403, 29898, 13, 9651, 302, 29918, 11249, 29922, 29876, 29918, 11249, 29892, 13, 9651, 4629, 29918, 4645, 29918, 29876, 29918, 29895, 29918, 1761, 29922, 1311, 29889, 8391, 29918, 4645, 29918, 29876, 29918, 29895, 29918, 1761, 29892, 13, 9651, 4629, 29918, 4645, 29918, 6758, 29918, 1761, 29922, 1311, 29889, 8391, 29918, 4645, 29918, 6758, 29918, 1761, 29892, 13, 9651, 4629, 29918, 4645, 29918, 7915, 29918, 1761, 29922, 1311, 29889, 8391, 29918, 4645, 29918, 7915, 29918, 1761, 13, 4706, 1723, 13, 4706, 1583, 29889, 842, 29918, 10945, 29918, 705, 5861, 29898, 29888, 2447, 630, 29918, 705, 5861, 29897, 29871, 396, 731, 5534, 18177, 408, 1923, 18177, 13, 4706, 1583, 29889, 29888, 2447, 630, 29918, 6758, 29918, 546, 29918, 14486, 29889, 4397, 29898, 29888, 2447, 630, 29918, 6758, 29897, 13, 4706, 396, 7945, 19745, 363, 599, 3132, 29915, 29879, 1881, 13, 4706, 27303, 353, 1583, 29889, 1212, 5453, 29889, 11618, 29898, 9302, 29889, 535, 29883, 2579, 403, 4197, 4645, 29889, 2080, 363, 3132, 297, 4629, 29918, 11303, 1237, 1402, 9685, 29922, 29900, 876, 13, 4706, 11073, 353, 7442, 29889, 535, 29883, 2579, 403, 4197, 4645, 29889, 1643, 363, 3132, 297, 4629, 29918, 11303, 1237, 1402, 9685, 29922, 29900, 29897, 13, 4706, 396, 7945, 6410, 13, 4706, 7945, 29918, 6758, 353, 313, 13264, 29889, 17469, 29918, 2083, 29898, 1311, 29889, 1212, 5453, 29889, 6758, 29918, 16414, 580, 29898, 21134, 29892, 27303, 876, 467, 23749, 580, 13, 4706, 1583, 29889, 14968, 29918, 6758, 29918, 546, 29918, 14486, 29889, 4397, 29898, 14968, 29918, 6758, 29897, 13, 4706, 396, 7945, 19745, 12714, 13, 4706, 7945, 29918, 14513, 29918, 16414, 353, 313, 13264, 29889, 17469, 29918, 2083, 29898, 1311, 29889, 1212, 5453, 29889, 24219, 403, 29918, 16414, 580, 29898, 21134, 29892, 27303, 876, 467, 23749, 580, 13, 4706, 1583, 29889, 14968, 29918, 14513, 29918, 16414, 29918, 546, 29918, 14486, 29889, 4397, 29898, 14968, 29918, 14513, 29918, 16414, 29897, 13, 13, 1678, 822, 2854, 29918, 650, 29918, 14486, 29898, 1311, 29892, 2854, 29918, 1272, 29901, 2391, 1125, 13, 4706, 9995, 13, 13, 4706, 584, 3207, 2854, 29918, 1272, 29901, 2391, 29898, 2080, 29918, 3084, 29892, 3858, 29918, 3084, 29897, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 396, 2854, 19745, 363, 7029, 8845, 8783, 13, 4706, 27303, 353, 1583, 29889, 1212, 5453, 29889, 11618, 29898, 3084, 29918, 1272, 29961, 29900, 2314, 13, 4706, 11073, 353, 2854, 29918, 1272, 29961, 29896, 29962, 13, 4706, 396, 2854, 6410, 13, 4706, 2854, 29918, 6758, 353, 313, 13264, 29889, 17469, 29918, 2083, 29898, 1311, 29889, 1212, 5453, 29889, 6758, 29918, 16414, 580, 29898, 21134, 29892, 27303, 876, 467, 23749, 580, 13, 4706, 1583, 29889, 3084, 29918, 6758, 29918, 546, 29918, 14486, 29889, 4397, 29898, 3084, 29918, 6758, 29897, 13, 4706, 396, 7945, 19745, 12714, 13, 4706, 2854, 29918, 14513, 29918, 16414, 353, 313, 13264, 29889, 17469, 29918, 2083, 29898, 1311, 29889, 1212, 5453, 29889, 24219, 403, 29918, 16414, 580, 29898, 21134, 29892, 27303, 876, 467, 23749, 580, 13, 4706, 1583, 29889, 3084, 29918, 14513, 29918, 16414, 29918, 546, 29918, 14486, 29889, 4397, 29898, 3084, 29918, 14513, 29918, 16414, 29897, 13, 13, 1678, 822, 13154, 29918, 5504, 29918, 650, 29918, 14486, 29898, 1311, 29892, 4629, 29918, 11303, 1237, 29901, 2391, 29961, 4032, 29962, 1125, 29871, 396, 13154, 13, 4706, 1583, 29889, 8391, 29918, 4645, 29918, 29876, 29918, 29895, 29918, 1761, 353, 5159, 13, 4706, 1583, 29889, 8391, 29918, 4645, 29918, 7915, 29918, 1761, 353, 5159, 13, 4706, 1583, 29889, 8391, 29918, 4645, 29918, 6758, 29918, 1761, 353, 5159, 13, 4706, 363, 3132, 297, 4629, 29918, 11303, 1237, 29901, 29871, 396, 8943, 13, 9651, 3132, 29889, 13556, 573, 29918, 10945, 29918, 705, 5861, 580, 29871, 396, 7150, 18177, 515, 1923, 13, 9651, 3132, 29889, 842, 29918, 10945, 29918, 705, 5861, 29898, 1311, 29889, 1212, 5453, 29889, 11618, 29889, 657, 29918, 705, 5861, 3101, 29871, 396, 731, 5534, 18177, 13, 9651, 3132, 29889, 19668, 580, 29871, 396, 3132, 5110, 13, 9651, 396, 3638, 3132, 2472, 304, 1923, 313, 705, 5861, 29892, 6410, 29892, 302, 29918, 29895, 29918, 11249, 29897, 13, 9651, 3132, 29889, 6717, 29918, 705, 5861, 580, 13, 9651, 1583, 29889, 8391, 29918, 4645, 29918, 29876, 29918, 29895, 29918, 1761, 29889, 4397, 29898, 4645, 29889, 29876, 29918, 29895, 29918, 11249, 29897, 13, 9651, 1583, 29889, 8391, 29918, 4645, 29918, 7915, 29918, 1761, 29889, 4397, 29898, 4645, 29889, 1212, 5453, 29889, 11618, 29889, 657, 29918, 705, 5861, 3101, 13, 9651, 1583, 29889, 8391, 29918, 4645, 29918, 6758, 29918, 1761, 29889, 4397, 29898, 4645, 29889, 1212, 5453, 29889, 9902, 1839, 6758, 2033, 14352, 29896, 2314, 29871, 396, 14402, 1035, 29871, 239, 185, 151, 30903, 29973, 13, 13, 1678, 822, 2069, 29918, 10945, 29918, 11618, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1212, 5453, 29889, 3258, 29918, 11618, 580, 13, 4706, 1583, 29889, 1212, 5453, 29889, 11618, 3032, 978, 353, 525, 2974, 29918, 11618, 29915, 13, 13, 1678, 822, 1831, 29918, 11303, 1237, 29898, 1311, 1125, 13, 4706, 302, 29918, 8391, 29918, 11303, 1237, 353, 4236, 29898, 524, 29898, 1311, 29889, 29876, 29918, 11303, 1237, 334, 1583, 29889, 29883, 29918, 29888, 13857, 511, 29871, 29896, 29897, 13, 4706, 1583, 29889, 8391, 29918, 11303, 1237, 29918, 2248, 353, 7442, 29889, 8172, 29889, 16957, 29898, 3881, 29898, 29896, 29892, 1583, 29889, 29876, 29918, 11303, 1237, 718, 29871, 29896, 511, 302, 29918, 8391, 29918, 11303, 1237, 29892, 5191, 29922, 8824, 29897, 13, 4706, 1596, 29898, 29888, 29908, 29912, 2435, 29898, 1311, 29889, 8391, 29918, 11303, 1237, 29918, 2248, 2915, 4629, 13154, 29901, 9162, 1583, 29889, 8391, 29918, 11303, 1237, 29918, 2248, 29892, 13, 795, 285, 29908, 2541, 315, 15958, 426, 1311, 29889, 29883, 29918, 29888, 13857, 27195, 13, 13, 1678, 822, 731, 29918, 10945, 29918, 705, 5861, 29898, 1311, 29892, 5534, 29918, 705, 5861, 1125, 13, 4706, 1583, 29889, 1212, 5453, 29889, 11618, 29889, 842, 29918, 705, 5861, 29898, 10945, 29918, 705, 5861, 29897, 29871, 396, 731, 5534, 18177, 408, 1923, 18177, 13, 13, 1678, 822, 3638, 29918, 10945, 29918, 705, 5861, 29898, 1311, 1125, 13, 4706, 1209, 29871, 396, 451, 8762, 29892, 3229, 363, 3132, 448, 1923, 12084, 13, 13, 1678, 822, 7150, 29918, 705, 5861, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7150, 18177, 515, 4629, 13154, 13, 4706, 584, 2457, 29901, 13, 4706, 9995, 13, 4706, 1209, 29871, 396, 451, 8762, 29892, 3229, 363, 3132, 448, 1923, 12084, 13, 2 ]
video_capture/plotting.py
FrostyDesigner/Python_Scripts
1
46919
<reponame>FrostyDesigner/Python_Scripts from motion_capture import df from bokeh.plotting import figure, show, output_file from bokeh.models import HoverTool, ColumnDataSource #convert start and end columns to strings for easy reading df["Start_string"]=df["Start"].dt.strftime("%Y-%m-%d %H:%M:%S") df["End_string"]=df["End"].dt.strftime("%Y-%m-%d %H:%M:%S") cds=ColumnDataSource(df) #commented because "responsive" does not work #p=figure(x_axis_type='datetime', height=100, width=500, responsive=True, title="Motion Graph") p=figure(x_axis_type='datetime', height=200, width=500, title="Motion Graph") #remove ticks on y axis p.yaxis.minor_tick_line_color=None #remove grid lines from y grid p.ygrid[0].ticker.desired_num_ticks=1 #instantiate hover tool hover=HoverTool(tooltips=[("Start", "@Start_string"),("End", "@End_string")]) p.add_tools(hover) #create the quad using left, right, up, down #q=p.quad(left=df["Start"], right=df["End"], bottom=0, top=1, color="green") #notice the source is cds (ColumnDataSource) - if you use a source the dataframe is not necessary q=p.quad(left="Start", right="End", bottom=0, top=1, color="green", source=cds) output_file("Graph.html") show(p)
[ 1, 529, 276, 1112, 420, 29958, 29943, 17627, 29891, 4002, 21216, 29914, 11980, 29918, 4081, 29879, 13, 3166, 10884, 29918, 17885, 545, 1053, 4489, 13, 3166, 1045, 446, 29882, 29889, 5317, 1259, 1053, 4377, 29892, 1510, 29892, 1962, 29918, 1445, 13, 3166, 1045, 446, 29882, 29889, 9794, 1053, 379, 957, 12229, 29892, 12481, 15559, 13, 13, 29937, 13441, 1369, 322, 1095, 4341, 304, 6031, 363, 4780, 5183, 13, 2176, 3366, 4763, 29918, 1807, 3108, 29922, 2176, 3366, 4763, 16862, 6008, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 1159, 13, 2176, 3366, 5044, 29918, 1807, 3108, 29922, 2176, 3366, 5044, 16862, 6008, 29889, 710, 615, 603, 11702, 29979, 19222, 29885, 19222, 29881, 1273, 29950, 16664, 29924, 16664, 29903, 1159, 13, 29871, 13, 2252, 29879, 29922, 4409, 15559, 29898, 2176, 29897, 13, 13, 29937, 9342, 287, 1363, 376, 26679, 573, 29908, 947, 451, 664, 13, 29937, 29886, 29922, 4532, 29898, 29916, 29918, 8990, 29918, 1853, 2433, 12673, 742, 3171, 29922, 29896, 29900, 29900, 29892, 2920, 29922, 29945, 29900, 29900, 29892, 5544, 573, 29922, 5574, 29892, 3611, 543, 29924, 8194, 12367, 1159, 13, 29886, 29922, 4532, 29898, 29916, 29918, 8990, 29918, 1853, 2433, 12673, 742, 3171, 29922, 29906, 29900, 29900, 29892, 2920, 29922, 29945, 29900, 29900, 29892, 3611, 543, 29924, 8194, 12367, 1159, 13, 29937, 5992, 260, 7358, 373, 343, 9685, 13, 29886, 29889, 29891, 8990, 29889, 1195, 272, 29918, 24667, 29918, 1220, 29918, 2780, 29922, 8516, 13, 29937, 5992, 6856, 3454, 515, 343, 6856, 13, 29886, 29889, 29891, 7720, 29961, 29900, 1822, 29873, 6541, 29889, 2783, 2859, 29918, 1949, 29918, 29873, 7358, 29922, 29896, 13, 13, 29937, 2611, 3656, 403, 16758, 5780, 13, 13194, 29922, 29950, 957, 12229, 29898, 10154, 2034, 567, 11759, 703, 4763, 613, 17962, 4763, 29918, 1807, 4968, 703, 5044, 613, 17962, 5044, 29918, 1807, 1159, 2314, 13, 29886, 29889, 1202, 29918, 8504, 29898, 13194, 29897, 13, 13, 29937, 3258, 278, 18890, 773, 2175, 29892, 1492, 29892, 701, 29892, 1623, 13, 29937, 29939, 29922, 29886, 29889, 3425, 29898, 1563, 29922, 2176, 3366, 4763, 12436, 1492, 29922, 2176, 3366, 5044, 12436, 5970, 29922, 29900, 29892, 2246, 29922, 29896, 29892, 2927, 543, 12692, 1159, 13, 29937, 1333, 625, 278, 2752, 338, 274, 6289, 313, 4409, 15559, 29897, 448, 565, 366, 671, 263, 2752, 278, 12205, 338, 451, 5181, 13, 29939, 29922, 29886, 29889, 3425, 29898, 1563, 543, 4763, 613, 1492, 543, 5044, 613, 5970, 29922, 29900, 29892, 2246, 29922, 29896, 29892, 2927, 543, 12692, 613, 2752, 29922, 2252, 29879, 29897, 13, 13, 4905, 29918, 1445, 703, 9527, 29889, 1420, 1159, 13, 4294, 29898, 29886, 29897, 2 ]
src/lib/request/__init__.py
arnulfojr/simple-pos
1
60639
from src import is_json
[ 1, 29871, 13, 3166, 4765, 1053, 338, 29918, 3126, 13, 13, 2 ]
var/spack/repos/builtin/packages/r-pkgload/package.py
kkauder/spack
2,360
199910
<filename>var/spack/repos/builtin/packages/r-pkgload/package.py # Copyright 2013-2021 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 RPkgload(RPackage): """Simulate Package Installation and Attach Simulates the process of installing a package and then attaching it. This is a key part of the 'devtools' package as it allows you to rapidly iterate while developing a package.""" homepage = "https://cloud.r-project.org/package=pkgload" url = "https://cloud.r-project.org/src/contrib/pkgload_1.0.2.tar.gz" list_url = "https://cloud.r-project.org/src/contrib/Archive/pkgload/" version('1.1.0', sha256='189d460dbba2b35fa15dd59ce832df252dfa654a5acee0c9a8471b4d70477b0d') version('1.0.2', sha256='3186564e690fb05eabe76e1ac0bfd4312562c3ac8794b29f8850399515dcf27c') depends_on('r-cli', when='@1.1.0:', type=('build', 'run')) depends_on('r-crayon', when='@1.1.0:', type=('build', 'run')) depends_on('r-desc', type=('build', 'run')) depends_on('r-pkgbuild', type=('build', 'run')) depends_on('r-rlang', type=('build', 'run')) depends_on('r-rprojroot', type=('build', 'run')) depends_on('r-rstudioapi', type=('build', 'run')) depends_on('r-withr', type=('build', 'run'))
[ 1, 529, 9507, 29958, 1707, 29914, 1028, 547, 29914, 276, 1066, 29914, 16145, 262, 29914, 8318, 29914, 29878, 29899, 15865, 1359, 29914, 5113, 29889, 2272, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29941, 29899, 29906, 29900, 29906, 29896, 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, 3166, 805, 547, 1053, 334, 13, 13, 13, 1990, 390, 29925, 9415, 1359, 29898, 29934, 14459, 1125, 13, 1678, 9995, 8942, 5987, 22029, 16052, 362, 322, 6212, 496, 13, 13, 1678, 3439, 352, 1078, 278, 1889, 310, 15476, 263, 3577, 322, 769, 1098, 9733, 372, 29889, 910, 13, 1678, 338, 263, 1820, 760, 310, 278, 525, 3359, 8504, 29915, 3577, 408, 372, 6511, 366, 304, 19328, 13649, 13, 1678, 1550, 14338, 263, 3577, 1213, 15945, 13, 13, 1678, 3271, 3488, 353, 376, 991, 597, 9274, 29889, 29878, 29899, 4836, 29889, 990, 29914, 5113, 29922, 15865, 1359, 29908, 13, 1678, 3142, 418, 353, 376, 991, 597, 9274, 29889, 29878, 29899, 4836, 29889, 990, 29914, 4351, 29914, 21570, 29914, 15865, 1359, 29918, 29896, 29889, 29900, 29889, 29906, 29889, 12637, 29889, 18828, 29908, 13, 1678, 1051, 29918, 2271, 353, 376, 991, 597, 9274, 29889, 29878, 29899, 4836, 29889, 990, 29914, 4351, 29914, 21570, 29914, 13197, 573, 29914, 15865, 1359, 12975, 13, 13, 1678, 1873, 877, 29896, 29889, 29896, 29889, 29900, 742, 528, 29874, 29906, 29945, 29953, 2433, 29896, 29947, 29929, 29881, 29946, 29953, 29900, 29881, 1327, 29874, 29906, 29890, 29941, 29945, 5444, 29896, 29945, 1289, 29945, 29929, 346, 29947, 29941, 29906, 2176, 29906, 29945, 29906, 2176, 29874, 29953, 29945, 29946, 29874, 29945, 815, 29872, 29900, 29883, 29929, 29874, 29947, 29946, 29955, 29896, 29890, 29946, 29881, 29955, 29900, 29946, 29955, 29955, 29890, 29900, 29881, 1495, 13, 1678, 1873, 877, 29896, 29889, 29900, 29889, 29906, 742, 528, 29874, 29906, 29945, 29953, 2433, 29941, 29896, 29947, 29953, 29945, 29953, 29946, 29872, 29953, 29929, 29900, 14943, 29900, 29945, 29872, 4302, 29955, 29953, 29872, 29896, 562, 29900, 1635, 29881, 29946, 29941, 29896, 29906, 29945, 29953, 29906, 29883, 29941, 562, 29947, 29955, 29929, 29946, 29890, 29906, 29929, 29888, 29947, 29947, 29945, 29900, 29941, 29929, 29929, 29945, 29896, 29945, 29881, 6854, 29906, 29955, 29883, 1495, 13, 13, 1678, 7111, 29918, 265, 877, 29878, 29899, 11303, 742, 746, 2433, 29992, 29896, 29889, 29896, 29889, 29900, 29901, 742, 1134, 29922, 877, 4282, 742, 525, 3389, 8785, 13, 1678, 7111, 29918, 265, 877, 29878, 29899, 29883, 764, 265, 742, 746, 2433, 29992, 29896, 29889, 29896, 29889, 29900, 29901, 742, 1134, 29922, 877, 4282, 742, 525, 3389, 8785, 13, 1678, 7111, 29918, 265, 877, 29878, 29899, 14273, 742, 1134, 29922, 877, 4282, 742, 525, 3389, 8785, 13, 1678, 7111, 29918, 265, 877, 29878, 29899, 15865, 4282, 742, 1134, 29922, 877, 4282, 742, 525, 3389, 8785, 13, 1678, 7111, 29918, 265, 877, 29878, 29899, 2096, 574, 742, 1134, 29922, 877, 4282, 742, 525, 3389, 8785, 13, 1678, 7111, 29918, 265, 877, 29878, 29899, 29878, 20865, 4632, 742, 1134, 29922, 877, 4282, 742, 525, 3389, 8785, 13, 1678, 7111, 29918, 265, 877, 29878, 29899, 29878, 12073, 2754, 742, 1134, 29922, 877, 4282, 742, 525, 3389, 8785, 13, 1678, 7111, 29918, 265, 877, 29878, 29899, 2541, 29878, 742, 1134, 29922, 877, 4282, 742, 525, 3389, 8785, 13, 2 ]
ibmsecurity/isam/web/runtime/object.py
zone-zero/ibmsecurity
46
184941
<reponame>zone-zero/ibmsecurity import logging logger = logging.getLogger(__name__) # *** WORK IN PROGRESS - module not done yet def get_all(isamAppliance, isamUser, object='/', admin_domain='Default'): """ Retrieve a list of objects """ ret_obj = isamAppliance.invoke_post("Retrieve a list of objects", "/isam/pdadmin/objectlistandshowext/v1", { "admin_id": isamUser.username, "admin_pwd": <PASSWORD>, "admin_domain": admin_domain, "object": object }) ret_obj['changed'] = False return ret_obj def get(isamAppliance, isamUser, object, admin_domain='Default'): """ Retrieve a specific object """ ret_obj = isamAppliance.invoke_post("Retrieve a specific object", "/isam/pdadmin/objectshowext/v1", { "admin_id": isamUser.username, "admin_pwd": <PASSWORD>, "admin_domain": admin_domain, "object": object }) ret_obj['changed'] = False return ret_obj def compare(isamAppliance1, isamAppliance2, isamUser, admin_domain='Default'): """ Compare objects between two appliances """ ret_obj1 = get_all(isamAppliance1, isamUser, '/', admin_domain) ret_obj2 = get_all(isamAppliance2, isamUser, '/', admin_domain) for obj in ret_obj1['data']: ret_obj = get(isamAppliance1, isamUser=isamUser, object=obj['id'], admin_domain=admin_domain) obj['script'] = ret_obj['data']['contents'] for obj in ret_obj2['data']: ret_obj = get(isamAppliance2, isamUser=isamUser, object=obj['id'], admin_domain=admin_domain) obj['script'] = ret_obj['data']['contents'] import ibmsecurity.utilities.tools return ibmsecurity.utilities.tools.json_compare(ret_obj1, ret_obj2, deleted_keys=[])
[ 1, 529, 276, 1112, 420, 29958, 8028, 29899, 9171, 29914, 29690, 8926, 13, 5215, 12183, 13, 13, 21707, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 13, 13, 29937, 18610, 399, 1955, 29968, 2672, 13756, 29954, 26785, 448, 3883, 451, 2309, 3447, 13, 13, 1753, 679, 29918, 497, 29898, 275, 314, 2052, 13036, 29892, 338, 314, 2659, 29892, 1203, 2433, 29914, 742, 4113, 29918, 7247, 2433, 4592, 29374, 13, 1678, 9995, 13, 1678, 4649, 29878, 2418, 263, 1051, 310, 3618, 13, 1678, 9995, 13, 1678, 3240, 29918, 5415, 353, 338, 314, 2052, 13036, 29889, 9772, 29918, 2490, 703, 8015, 29878, 2418, 263, 1051, 310, 3618, 613, 13, 462, 462, 4706, 5591, 275, 314, 29914, 15926, 6406, 29914, 3318, 1761, 392, 4294, 1062, 29914, 29894, 29896, 613, 426, 13, 462, 462, 9651, 376, 6406, 29918, 333, 1115, 338, 314, 2659, 29889, 6786, 29892, 13, 462, 462, 9651, 376, 6406, 29918, 29886, 9970, 1115, 529, 25711, 17013, 10202, 13, 462, 462, 9651, 376, 6406, 29918, 7247, 1115, 4113, 29918, 7247, 29892, 13, 462, 462, 9651, 376, 3318, 1115, 1203, 13, 462, 462, 4706, 5615, 13, 1678, 3240, 29918, 5415, 1839, 15033, 2033, 353, 7700, 13, 13, 1678, 736, 3240, 29918, 5415, 13, 13, 13, 1753, 679, 29898, 275, 314, 2052, 13036, 29892, 338, 314, 2659, 29892, 1203, 29892, 4113, 29918, 7247, 2433, 4592, 29374, 13, 1678, 9995, 13, 1678, 4649, 29878, 2418, 263, 2702, 1203, 13, 1678, 9995, 13, 1678, 3240, 29918, 5415, 353, 338, 314, 2052, 13036, 29889, 9772, 29918, 2490, 703, 8015, 29878, 2418, 263, 2702, 1203, 613, 13, 462, 462, 4706, 5591, 275, 314, 29914, 15926, 6406, 29914, 3318, 4294, 1062, 29914, 29894, 29896, 613, 426, 13, 462, 462, 9651, 376, 6406, 29918, 333, 1115, 338, 314, 2659, 29889, 6786, 29892, 13, 462, 462, 9651, 376, 6406, 29918, 29886, 9970, 1115, 529, 25711, 17013, 10202, 13, 462, 462, 9651, 376, 6406, 29918, 7247, 1115, 4113, 29918, 7247, 29892, 13, 462, 462, 9651, 376, 3318, 1115, 1203, 13, 462, 462, 4706, 5615, 13, 1678, 3240, 29918, 5415, 1839, 15033, 2033, 353, 7700, 13, 13, 1678, 736, 3240, 29918, 5415, 13, 13, 13, 1753, 7252, 29898, 275, 314, 2052, 13036, 29896, 29892, 338, 314, 2052, 13036, 29906, 29892, 338, 314, 2659, 29892, 4113, 29918, 7247, 2433, 4592, 29374, 13, 1678, 9995, 13, 1678, 3831, 598, 3618, 1546, 1023, 623, 492, 2925, 13, 1678, 9995, 13, 1678, 3240, 29918, 5415, 29896, 353, 679, 29918, 497, 29898, 275, 314, 2052, 13036, 29896, 29892, 338, 314, 2659, 29892, 8207, 742, 4113, 29918, 7247, 29897, 13, 1678, 3240, 29918, 5415, 29906, 353, 679, 29918, 497, 29898, 275, 314, 2052, 13036, 29906, 29892, 338, 314, 2659, 29892, 8207, 742, 4113, 29918, 7247, 29897, 13, 13, 1678, 363, 5446, 297, 3240, 29918, 5415, 29896, 1839, 1272, 2033, 29901, 13, 4706, 3240, 29918, 5415, 353, 679, 29898, 275, 314, 2052, 13036, 29896, 29892, 338, 314, 2659, 29922, 275, 314, 2659, 29892, 1203, 29922, 5415, 1839, 333, 7464, 4113, 29918, 7247, 29922, 6406, 29918, 7247, 29897, 13, 4706, 5446, 1839, 2154, 2033, 353, 3240, 29918, 5415, 1839, 1272, 16215, 10853, 2033, 13, 1678, 363, 5446, 297, 3240, 29918, 5415, 29906, 1839, 1272, 2033, 29901, 13, 4706, 3240, 29918, 5415, 353, 679, 29898, 275, 314, 2052, 13036, 29906, 29892, 338, 314, 2659, 29922, 275, 314, 2659, 29892, 1203, 29922, 5415, 1839, 333, 7464, 4113, 29918, 7247, 29922, 6406, 29918, 7247, 29897, 13, 4706, 5446, 1839, 2154, 2033, 353, 3240, 29918, 5415, 1839, 1272, 16215, 10853, 2033, 13, 13, 1678, 1053, 474, 5838, 8926, 29889, 4422, 1907, 29889, 8504, 13, 1678, 736, 474, 5838, 8926, 29889, 4422, 1907, 29889, 8504, 29889, 3126, 29918, 18307, 29898, 2267, 29918, 5415, 29896, 29892, 3240, 29918, 5415, 29906, 29892, 11132, 29918, 8149, 11759, 2314, 13, 2 ]
cnn_training/vgg2_2_tfrecords_loose.py
bioidiap/bob.bio.face
4
57384
<filename>cnn_training/vgg2_2_tfrecords_loose.py #!/usr/bin/env python # coding: utf-8 """ Crop VGG2 with loose crop based on bounding box Usage: vgg2_2_tfrecords.py <vgg-path> <output-path> [--factor=<kn>] vgg2_2_tfrecords.py -h | --help Options: -h --help Show this screen. --factor=<kn> Crop Factor [default: 0.3] """ from docopt import docopt import numpy as np import os import bob.io.image import bob.io.base import tensorflow as tf import sys from datetime import datetime def _bytes_feature(value): return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value])) def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) def search_landmark(landmark_path, img_path): with open(landmark_path) as f: next(f) for line in f: line = line.split(",") if img_path in line[0]: landmarks = np.array([float(line[i]) for i in [1, 2, 3, 4]]) return { "topleft": (landmarks[1], landmarks[0]), "dimensions": (landmarks[3], landmarks[2]), "bottomright": ( landmarks[1] + landmarks[3], landmarks[0] + landmarks[2], ), } else: return None def extend_annotations(annotations, img_bottom_right, factor=0.3): width = annotations["dimensions"][1] height = annotations["dimensions"][0] new_annotations = {"topleft": [0, 0], "bottomright": [0, 0]} new_annotations["topleft"][0] = max(0, annotations["topleft"][0] - height * factor) new_annotations["topleft"][1] = max(0, annotations["topleft"][1] - width * factor) new_annotations["bottomright"][0] = min( img_bottom_right[1], annotations["bottomright"][0] + height * factor ) new_annotations["bottomright"][1] = min( img_bottom_right[0], annotations["bottomright"][1] + width * factor ) return new_annotations from bob.bio.face.preprocessor import FaceCrop def align(image, annotations, cropped_image_size=(126, 126), factor=0.3): cropped_image_height, cropped_image_width = cropped_image_size img_bottom_right = (image.shape[1], image.shape[2]) new_annotations = extend_annotations(annotations, img_bottom_right, factor=factor) cropped_positions = {"topleft": (0, 0), "bottomright": cropped_image_size} cropper = FaceCrop( cropped_image_size=cropped_image_size, cropped_positions=cropped_positions, color_channel="rgb", fixed_positions=None, annotator=None, ) return bob.io.image.to_matplotlib( cropper.transform([image], [new_annotations])[0] ).astype("uint8") def get_id_by_line(line): return line.split("/")[0] def generate_tfrecord( base_path, landmark_path, file_list, output_tf_record_path, indexes, factor=0.3 ): def write_single_line_tfrecord(writer, image, offset, user_id): # Serializing serialized_img = image.tobytes() # Writing feature = { "data": _bytes_feature(serialized_img), "label": _int64_feature(offset), "key": _bytes_feature(str.encode(user_id)), } example = tf.train.Example(features=tf.train.Features(feature=feature)) writer.write(example.SerializeToString()) with tf.io.TFRecordWriter(output_tf_record_path) as tf_writer: current_id = None with open(file_list) as f: for file_name in f.readlines(): user_id = get_id_by_line(file_name) if user_id in indexes: img = bob.io.base.load( os.path.join(base_path, file_name).rstrip("\n") ) l_name = file_name.rstrip(".jpg\n") if current_id != user_id: current_id = user_id sys.stdout.write( f"Writing user {current_id}. {str(datetime.now())} \n" ) sys.stdout.flush() landmarks = search_landmark(landmark_path, l_name) if landmarks is None: raise ValueError(f"Landmark for {file_name} not found!") # aligned_image = align(img, annotations) aligned_image = align( img, landmarks, factor=factor, cropped_image_size=(126, 126) ) bob.io.base.save(bob.io.image.to_bob(aligned_image), "xuucu.png") write_single_line_tfrecord( tf_writer, aligned_image, int(indexes[user_id]), user_id ) def map_indexes(image_path, n_chunks): """ Create a dictionary mapping the ID to VGG2-ID, like: {0: 'n000001'], 1: 'n000002']} """ indexes = sorted(list(set([l.split("/")[0] for l in open(image_path).readlines()]))) identities_map = {indexes[i]: i for i in range(len(indexes))} # SPLIT THE DICTIONARY IN TOTAL_CHUNKS indexes_as_list = list(identities_map.items()) dict_as_list = np.array_split(indexes_as_list, n_chunks) dicts = [dict(d) for d in dict_as_list] return dicts if __name__ == "__main__": args = docopt(__doc__) VGG2_PATH = args["<vgg-path>"] LANDMARK_PATH = os.path.join(VGG2_PATH, "bb_landmark", "loose_bb_train.csv") if "SGE_TASK_LAST" in os.environ: TOTAL_CHUNKS = int(os.environ["SGE_TASK_LAST"]) CURRENT_CHUNK = int(os.environ["SGE_TASK_ID"]) - 1 else: TOTAL_CHUNKS = 1 CURRENT_CHUNK = 0 # TOTAL_CHUNKS = 140 # CURRENT_CHUNK = 0 TRAINING_LIST = os.path.join(VGG2_PATH, "train_list.txt") # TEST_LIST = os.path.join(VGG2_PATH, "test_list.txt") # MAP ALL INDEXES indexes = map_indexes(TRAINING_LIST, TOTAL_CHUNKS) generate_tfrecord( os.path.join(VGG2_PATH, "train"), LANDMARK_PATH, TRAINING_LIST, os.path.join( args["<output-path>"], f"train_vgg2_chunk{CURRENT_CHUNK}.tfrecords" ), indexes[CURRENT_CHUNK], factor=float(args["--factor"]), )
[ 1, 529, 9507, 29958, 29883, 15755, 29918, 26495, 29914, 29894, 1505, 29906, 29918, 29906, 29918, 13264, 3757, 4339, 29918, 417, 852, 29889, 2272, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29901, 23616, 29899, 29947, 13, 13, 15945, 29908, 13, 29907, 1336, 478, 26788, 29906, 411, 23819, 274, 1336, 2729, 373, 3216, 292, 3800, 13, 13, 27573, 29901, 13, 1678, 325, 1505, 29906, 29918, 29906, 29918, 13264, 3757, 4339, 29889, 2272, 529, 29894, 1505, 29899, 2084, 29958, 529, 4905, 29899, 2084, 29958, 29871, 518, 489, 19790, 29922, 29966, 3959, 29958, 29962, 13, 1678, 325, 1505, 29906, 29918, 29906, 29918, 13264, 3757, 4339, 29889, 2272, 448, 29882, 891, 1192, 8477, 13, 13, 5856, 29901, 13, 29871, 448, 29882, 1192, 8477, 632, 7704, 445, 4315, 29889, 259, 13, 29871, 1192, 19790, 29922, 29966, 3959, 29958, 308, 315, 1336, 383, 7168, 518, 4381, 29901, 29871, 29900, 29889, 29941, 29962, 13, 13, 15945, 29908, 13, 13, 13, 3166, 437, 1111, 415, 1053, 437, 1111, 415, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 5215, 289, 711, 29889, 601, 29889, 3027, 13, 5215, 289, 711, 29889, 601, 29889, 3188, 13, 5215, 26110, 408, 15886, 13, 5215, 10876, 13, 3166, 12865, 1053, 12865, 13, 13, 13, 1753, 903, 13193, 29918, 14394, 29898, 1767, 1125, 13, 1678, 736, 15886, 29889, 14968, 29889, 19132, 29898, 13193, 29918, 1761, 29922, 13264, 29889, 14968, 29889, 11207, 1293, 29898, 1767, 11759, 1767, 12622, 13, 13, 13, 1753, 903, 524, 29953, 29946, 29918, 14394, 29898, 1767, 1125, 13, 1678, 736, 15886, 29889, 14968, 29889, 19132, 29898, 524, 29953, 29946, 29918, 1761, 29922, 13264, 29889, 14968, 29889, 2928, 29953, 29946, 1293, 29898, 1767, 11759, 1767, 12622, 13, 13, 13, 1753, 2740, 29918, 1049, 3502, 29898, 1049, 3502, 29918, 2084, 29892, 10153, 29918, 2084, 1125, 13, 1678, 411, 1722, 29898, 1049, 3502, 29918, 2084, 29897, 408, 285, 29901, 13, 4706, 2446, 29898, 29888, 29897, 13, 4706, 363, 1196, 297, 285, 29901, 13, 9651, 1196, 353, 1196, 29889, 5451, 28165, 1159, 13, 9651, 565, 10153, 29918, 2084, 297, 1196, 29961, 29900, 5387, 13, 18884, 2982, 22848, 353, 7442, 29889, 2378, 4197, 7411, 29898, 1220, 29961, 29875, 2314, 363, 474, 297, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 24960, 13, 18884, 736, 426, 13, 462, 1678, 376, 3332, 1563, 1115, 313, 1049, 22848, 29961, 29896, 1402, 2982, 22848, 29961, 29900, 11724, 13, 462, 1678, 376, 6229, 5580, 1115, 313, 1049, 22848, 29961, 29941, 1402, 2982, 22848, 29961, 29906, 11724, 13, 462, 1678, 376, 8968, 1266, 1115, 313, 13, 462, 4706, 2982, 22848, 29961, 29896, 29962, 718, 2982, 22848, 29961, 29941, 1402, 13, 462, 4706, 2982, 22848, 29961, 29900, 29962, 718, 2982, 22848, 29961, 29906, 1402, 13, 462, 1678, 10353, 13, 18884, 500, 13, 13, 4706, 1683, 29901, 13, 9651, 736, 6213, 13, 13, 13, 1753, 10985, 29918, 6735, 800, 29898, 6735, 800, 29892, 10153, 29918, 8968, 29918, 1266, 29892, 7329, 29922, 29900, 29889, 29941, 1125, 13, 1678, 2920, 353, 25495, 3366, 6229, 5580, 3108, 29961, 29896, 29962, 13, 1678, 3171, 353, 25495, 3366, 6229, 5580, 3108, 29961, 29900, 29962, 13, 13, 1678, 716, 29918, 6735, 800, 353, 8853, 3332, 1563, 1115, 518, 29900, 29892, 29871, 29900, 1402, 376, 8968, 1266, 1115, 518, 29900, 29892, 29871, 29900, 12258, 13, 13, 1678, 716, 29918, 6735, 800, 3366, 3332, 1563, 3108, 29961, 29900, 29962, 353, 4236, 29898, 29900, 29892, 25495, 3366, 3332, 1563, 3108, 29961, 29900, 29962, 448, 3171, 334, 7329, 29897, 13, 1678, 716, 29918, 6735, 800, 3366, 3332, 1563, 3108, 29961, 29896, 29962, 353, 4236, 29898, 29900, 29892, 25495, 3366, 3332, 1563, 3108, 29961, 29896, 29962, 448, 2920, 334, 7329, 29897, 13, 13, 1678, 716, 29918, 6735, 800, 3366, 8968, 1266, 3108, 29961, 29900, 29962, 353, 1375, 29898, 13, 4706, 10153, 29918, 8968, 29918, 1266, 29961, 29896, 1402, 25495, 3366, 8968, 1266, 3108, 29961, 29900, 29962, 718, 3171, 334, 7329, 13, 1678, 1723, 13, 1678, 716, 29918, 6735, 800, 3366, 8968, 1266, 3108, 29961, 29896, 29962, 353, 1375, 29898, 13, 4706, 10153, 29918, 8968, 29918, 1266, 29961, 29900, 1402, 25495, 3366, 8968, 1266, 3108, 29961, 29896, 29962, 718, 2920, 334, 7329, 13, 1678, 1723, 13, 13, 1678, 736, 716, 29918, 6735, 800, 13, 13, 13, 3166, 289, 711, 29889, 24840, 29889, 2161, 29889, 1457, 26482, 1053, 10635, 29907, 1336, 13, 13, 13, 1753, 7595, 29898, 3027, 29892, 25495, 29892, 8182, 2986, 29918, 3027, 29918, 2311, 7607, 29896, 29906, 29953, 29892, 29871, 29896, 29906, 29953, 511, 7329, 29922, 29900, 29889, 29941, 1125, 13, 13, 1678, 8182, 2986, 29918, 3027, 29918, 3545, 29892, 8182, 2986, 29918, 3027, 29918, 2103, 353, 8182, 2986, 29918, 3027, 29918, 2311, 13, 13, 1678, 10153, 29918, 8968, 29918, 1266, 353, 313, 3027, 29889, 12181, 29961, 29896, 1402, 1967, 29889, 12181, 29961, 29906, 2314, 13, 1678, 716, 29918, 6735, 800, 353, 10985, 29918, 6735, 800, 29898, 6735, 800, 29892, 10153, 29918, 8968, 29918, 1266, 29892, 7329, 29922, 19790, 29897, 13, 13, 1678, 8182, 2986, 29918, 1066, 2187, 353, 8853, 3332, 1563, 1115, 313, 29900, 29892, 29871, 29900, 511, 376, 8968, 1266, 1115, 8182, 2986, 29918, 3027, 29918, 2311, 29913, 13, 1678, 8182, 2496, 353, 10635, 29907, 1336, 29898, 13, 4706, 8182, 2986, 29918, 3027, 29918, 2311, 29922, 24077, 2986, 29918, 3027, 29918, 2311, 29892, 13, 4706, 8182, 2986, 29918, 1066, 2187, 29922, 24077, 2986, 29918, 1066, 2187, 29892, 13, 4706, 2927, 29918, 12719, 543, 23973, 613, 13, 4706, 4343, 29918, 1066, 2187, 29922, 8516, 29892, 13, 4706, 9732, 1061, 29922, 8516, 29892, 13, 1678, 1723, 13, 1678, 736, 289, 711, 29889, 601, 29889, 3027, 29889, 517, 29918, 2922, 17357, 29898, 13, 4706, 8182, 2496, 29889, 9067, 4197, 3027, 1402, 518, 1482, 29918, 6735, 800, 2314, 29961, 29900, 29962, 13, 1678, 13742, 579, 668, 703, 13470, 29947, 1159, 13, 13, 13, 1753, 679, 29918, 333, 29918, 1609, 29918, 1220, 29898, 1220, 1125, 13, 1678, 736, 1196, 29889, 5451, 11974, 1159, 29961, 29900, 29962, 13, 13, 13, 1753, 5706, 29918, 13264, 11651, 29898, 13, 1678, 2967, 29918, 2084, 29892, 2982, 3502, 29918, 2084, 29892, 934, 29918, 1761, 29892, 1962, 29918, 13264, 29918, 11651, 29918, 2084, 29892, 18111, 29892, 7329, 29922, 29900, 29889, 29941, 13, 1125, 13, 1678, 822, 2436, 29918, 14369, 29918, 1220, 29918, 13264, 11651, 29898, 13236, 29892, 1967, 29892, 9210, 29892, 1404, 29918, 333, 1125, 13, 13, 4706, 396, 18896, 5281, 13, 4706, 7797, 1891, 29918, 2492, 353, 1967, 29889, 517, 13193, 580, 13, 13, 4706, 396, 28676, 13, 4706, 4682, 353, 426, 13, 9651, 376, 1272, 1115, 903, 13193, 29918, 14394, 29898, 15550, 1891, 29918, 2492, 511, 13, 9651, 376, 1643, 1115, 903, 524, 29953, 29946, 29918, 14394, 29898, 10289, 511, 13, 9651, 376, 1989, 1115, 903, 13193, 29918, 14394, 29898, 710, 29889, 12508, 29898, 1792, 29918, 333, 8243, 13, 4706, 500, 13, 13, 4706, 1342, 353, 15886, 29889, 14968, 29889, 14023, 29898, 22100, 29922, 13264, 29889, 14968, 29889, 8263, 3698, 29898, 14394, 29922, 14394, 876, 13, 4706, 9227, 29889, 3539, 29898, 4773, 29889, 1748, 6646, 8246, 3101, 13, 13, 1678, 411, 15886, 29889, 601, 29889, 8969, 9182, 10507, 29898, 4905, 29918, 13264, 29918, 11651, 29918, 2084, 29897, 408, 15886, 29918, 13236, 29901, 13, 13, 4706, 1857, 29918, 333, 353, 6213, 13, 4706, 411, 1722, 29898, 1445, 29918, 1761, 29897, 408, 285, 29901, 13, 9651, 363, 934, 29918, 978, 297, 285, 29889, 949, 9012, 7295, 13, 13, 18884, 1404, 29918, 333, 353, 679, 29918, 333, 29918, 1609, 29918, 1220, 29898, 1445, 29918, 978, 29897, 13, 18884, 565, 1404, 29918, 333, 297, 18111, 29901, 13, 13, 462, 1678, 10153, 353, 289, 711, 29889, 601, 29889, 3188, 29889, 1359, 29898, 13, 462, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 3188, 29918, 2084, 29892, 934, 29918, 978, 467, 29878, 17010, 14182, 29876, 1159, 13, 462, 1678, 1723, 13, 462, 1678, 301, 29918, 978, 353, 934, 29918, 978, 29889, 29878, 17010, 17350, 6173, 29905, 29876, 1159, 13, 13, 462, 1678, 565, 1857, 29918, 333, 2804, 1404, 29918, 333, 29901, 13, 462, 4706, 1857, 29918, 333, 353, 1404, 29918, 333, 13, 462, 4706, 10876, 29889, 25393, 29889, 3539, 29898, 13, 462, 9651, 285, 29908, 29956, 768, 292, 1404, 426, 3784, 29918, 333, 1836, 426, 710, 29898, 12673, 29889, 3707, 580, 2915, 320, 29876, 29908, 13, 462, 4706, 1723, 13, 462, 4706, 10876, 29889, 25393, 29889, 23126, 580, 13, 13, 462, 1678, 2982, 22848, 353, 2740, 29918, 1049, 3502, 29898, 1049, 3502, 29918, 2084, 29892, 301, 29918, 978, 29897, 13, 462, 1678, 565, 2982, 22848, 338, 6213, 29901, 13, 462, 4706, 12020, 7865, 2392, 29898, 29888, 29908, 22677, 3502, 363, 426, 1445, 29918, 978, 29913, 451, 1476, 29991, 1159, 13, 13, 462, 1678, 396, 26118, 29918, 3027, 353, 7595, 29898, 2492, 29892, 25495, 29897, 13, 462, 1678, 26118, 29918, 3027, 353, 7595, 29898, 13, 462, 4706, 10153, 29892, 2982, 22848, 29892, 7329, 29922, 19790, 29892, 8182, 2986, 29918, 3027, 29918, 2311, 7607, 29896, 29906, 29953, 29892, 29871, 29896, 29906, 29953, 29897, 13, 462, 1678, 1723, 13, 462, 1678, 289, 711, 29889, 601, 29889, 3188, 29889, 7620, 29898, 29890, 711, 29889, 601, 29889, 3027, 29889, 517, 29918, 29890, 711, 29898, 13671, 29918, 3027, 511, 376, 29916, 29884, 1682, 29884, 29889, 2732, 1159, 13, 462, 1678, 2436, 29918, 14369, 29918, 1220, 29918, 13264, 11651, 29898, 13, 462, 4706, 15886, 29918, 13236, 29892, 26118, 29918, 3027, 29892, 938, 29898, 2248, 267, 29961, 1792, 29918, 333, 11724, 1404, 29918, 333, 13, 462, 1678, 1723, 13, 13, 13, 1753, 2910, 29918, 2248, 267, 29898, 3027, 29918, 2084, 29892, 302, 29918, 305, 18801, 1125, 13, 1678, 9995, 13, 1678, 6204, 263, 8600, 10417, 278, 3553, 304, 478, 26788, 29906, 29899, 1367, 29892, 763, 29901, 13, 13, 1678, 426, 29900, 29901, 525, 29876, 29900, 29900, 29900, 29900, 29900, 29896, 7464, 13, 268, 29896, 29901, 525, 29876, 29900, 29900, 29900, 29900, 29900, 29906, 2033, 29913, 13, 13, 1678, 9995, 13, 13, 1678, 18111, 353, 12705, 29898, 1761, 29898, 842, 4197, 29880, 29889, 5451, 11974, 1159, 29961, 29900, 29962, 363, 301, 297, 1722, 29898, 3027, 29918, 2084, 467, 949, 9012, 580, 29962, 4961, 13, 13, 1678, 2893, 1907, 29918, 1958, 353, 426, 2248, 267, 29961, 29875, 5387, 474, 363, 474, 297, 3464, 29898, 2435, 29898, 2248, 267, 876, 29913, 13, 13, 1678, 396, 317, 7390, 1806, 6093, 22471, 9838, 19926, 2672, 323, 2891, 1964, 29918, 3210, 3904, 17557, 13, 1678, 18111, 29918, 294, 29918, 1761, 353, 1051, 29898, 1693, 1907, 29918, 1958, 29889, 7076, 3101, 13, 1678, 9657, 29918, 294, 29918, 1761, 353, 7442, 29889, 2378, 29918, 5451, 29898, 2248, 267, 29918, 294, 29918, 1761, 29892, 302, 29918, 305, 18801, 29897, 13, 1678, 9657, 29879, 353, 518, 8977, 29898, 29881, 29897, 363, 270, 297, 9657, 29918, 294, 29918, 1761, 29962, 13, 13, 1678, 736, 9657, 29879, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 6389, 353, 437, 1111, 415, 22168, 1514, 1649, 29897, 13, 13, 1678, 478, 26788, 29906, 29918, 10145, 353, 6389, 3366, 29966, 29894, 1505, 29899, 2084, 29958, 3108, 13, 1678, 365, 9468, 1529, 29934, 29968, 29918, 10145, 353, 2897, 29889, 2084, 29889, 7122, 29898, 29963, 26788, 29906, 29918, 10145, 29892, 376, 1327, 29918, 1049, 3502, 613, 376, 417, 852, 29918, 1327, 29918, 14968, 29889, 7638, 1159, 13, 13, 1678, 565, 376, 29903, 1692, 29918, 29911, 3289, 29968, 29918, 4375, 1254, 29908, 297, 2897, 29889, 21813, 29901, 13, 4706, 323, 2891, 1964, 29918, 3210, 3904, 17557, 353, 938, 29898, 359, 29889, 21813, 3366, 29903, 1692, 29918, 29911, 3289, 29968, 29918, 4375, 1254, 20068, 13, 4706, 315, 4574, 29450, 29918, 3210, 3904, 29968, 353, 938, 29898, 359, 29889, 21813, 3366, 29903, 1692, 29918, 29911, 3289, 29968, 29918, 1367, 20068, 448, 29871, 29896, 13, 1678, 1683, 29901, 13, 4706, 323, 2891, 1964, 29918, 3210, 3904, 17557, 353, 29871, 29896, 13, 4706, 315, 4574, 29450, 29918, 3210, 3904, 29968, 353, 29871, 29900, 13, 13, 1678, 396, 323, 2891, 1964, 29918, 3210, 3904, 17557, 353, 29871, 29896, 29946, 29900, 13, 1678, 396, 315, 4574, 29450, 29918, 3210, 3904, 29968, 353, 29871, 29900, 13, 13, 1678, 323, 4717, 1177, 4214, 29918, 24360, 353, 2897, 29889, 2084, 29889, 7122, 29898, 29963, 26788, 29906, 29918, 10145, 29892, 376, 14968, 29918, 1761, 29889, 3945, 1159, 13, 1678, 396, 17067, 1254, 29918, 24360, 353, 2897, 29889, 2084, 29889, 7122, 29898, 29963, 26788, 29906, 29918, 10145, 29892, 376, 1688, 29918, 1761, 29889, 3945, 1159, 13, 13, 1678, 396, 341, 3301, 15149, 2672, 19577, 2890, 13, 13, 1678, 18111, 353, 2910, 29918, 2248, 267, 29898, 29911, 4717, 1177, 4214, 29918, 24360, 29892, 323, 2891, 1964, 29918, 3210, 3904, 17557, 29897, 13, 13, 1678, 5706, 29918, 13264, 11651, 29898, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 29963, 26788, 29906, 29918, 10145, 29892, 376, 14968, 4968, 13, 4706, 365, 9468, 1529, 29934, 29968, 29918, 10145, 29892, 13, 4706, 323, 4717, 1177, 4214, 29918, 24360, 29892, 13, 4706, 2897, 29889, 2084, 29889, 7122, 29898, 13, 9651, 6389, 3366, 29966, 4905, 29899, 2084, 11903, 1402, 285, 29908, 14968, 29918, 29894, 1505, 29906, 29918, 29812, 29912, 22484, 29450, 29918, 3210, 3904, 29968, 1836, 13264, 3757, 4339, 29908, 13, 4706, 10353, 13, 4706, 18111, 29961, 22484, 29450, 29918, 3210, 3904, 29968, 1402, 13, 4706, 7329, 29922, 7411, 29898, 5085, 3366, 489, 19790, 3108, 511, 13, 1678, 1723, 13, 13, 2 ]
450/Nagendra/greedy/Swap and Maximize .py
Nagendracse1/Competitive-Programming
3
14701
#code https://practice.geeksforgeeks.org/problems/swap-and-maximize/0 for _ in range(int(input())): n = int(input()) arr = list(map(int, input().split())) arr.sort() max = 0 for i in range(n//2): max -= 2*arr[i] max += 2*arr[n-i-1] print(max)
[ 1, 396, 401, 2045, 597, 29886, 1461, 625, 29889, 479, 14541, 20324, 14541, 29889, 990, 29914, 17199, 29879, 29914, 26276, 29899, 392, 29899, 27525, 675, 29914, 29900, 13, 13, 1454, 903, 297, 3464, 29898, 524, 29898, 2080, 22130, 29901, 13, 1678, 302, 353, 938, 29898, 2080, 3101, 13, 1678, 3948, 353, 1051, 29898, 1958, 29898, 524, 29892, 1881, 2141, 5451, 22130, 13, 1678, 3948, 29889, 6605, 580, 13, 1678, 4236, 353, 29871, 29900, 13, 268, 13, 1678, 363, 474, 297, 3464, 29898, 29876, 458, 29906, 1125, 13, 4706, 4236, 22361, 29871, 29906, 29930, 2749, 29961, 29875, 29962, 13, 4706, 4236, 4619, 29871, 29906, 29930, 2749, 29961, 29876, 29899, 29875, 29899, 29896, 29962, 13, 308, 13, 268, 13, 1678, 1596, 29898, 3317, 29897, 2 ]
its.py
rohan2546/TechArmy
1
122045
import pymongo import datetime import json from flask import Flask, render_template, request, url_for, redirect, abort, jsonify, make_response from flask_cors import CORS, cross_origin from bson import json_util from bson.json_util import dumps,ObjectId import random app=Flask(__name__) @app.route('/addProblem',methods=['POST','OPTIONS']) @cross_origin(origin='*',headers=['Content-Type','Authorization']) def addProblem(): if request.method == 'POST': post= request.json client = pymongo.MongoClient("mongodb+srv://rohansharma1606:_kwB&[email protected]/test?retryWrites=true&w=majority") db=client.hack_se posts = db.problem post_id = posts.insert_one(post) client.close() return "added" @app.route('/addContest',methods = ['POST','OPTIONS']) @cross_origin(origin='*',headers=['Content-Type','Authorization']) def addContest(): if request.method == 'POST': post = request.json client = pymongo.MongoClient("mongodb+srv://rohansharma1606:_kwB&<EMAIL>/test?retryWrites=true&w=majority") db=client.hack_se posts = db.contest posts1 = db.problem posts2 = db.user pid = post["problem_id"] em = post["user"] if (posts1.find({"problem_id":pid}) is not None) and (posts2.find({"email":em}) is not None): post_id=posts.insert_one(post) return "added" else: return "not added" client.close() else: return jsonify({}),405 @app.route('/addUser',methods= ['POST','OPTIONS']) @cross_origin(origin='*',headers=['Content-Type','Authorization']) def addUser(): if request.method == 'POST': post=request.json em = post["email"] client = pymongo.MongoClient("mongodb+srv://rohansharma1606:_kwB&<EMAIL>Zg2fA@<EMAIL>.mongodb.net/test?retryWrites=true&w=majority") db=client.hack_se posts = db.user if posts.find({"email": em}) is None: post_id = posts.insert_one(post) return "added" else: return "user exists" client.close() else: return jsonify({}),405 @app.route('/getProblemDescription',methods= ['GET','OPTIONS']) @cross_origin(origin='*',headers=['Content-Type','Authorization']) def getProblemDescription(): if request.method == 'GET': client = pymongo.MongoClient("mongodb+srv://rohansharma1606:_kwB&[email protected]/test?retryWrites=true&w=majority") db=client.hack_se pid=request.args.get('problem_id',type=str) ab=db.problem.find_one({"problem_id":pid}) ab1=json.loads(json_util.dumps(ab)) return ab1,201 else: return jsonify({}),405 @app.route('/getTestCases',methods= ['GET','OPTIONS']) @cross_origin(origin='*',headers=['Content-Type','Authorization']) def getTestCases(): if request.method == 'GET': client = pymongo.MongoClient("mongodb+srv://rohansharma1606:_kwB&<EMAIL>.net/test?retryWrites=true&w=majority") db=client.hack_se pid=request.args.get('problem_id',type=str) ab=db.problem.find_one({"problem_id":pid}) ab1 = json.loads(json_util.dumps(ab)) cd=ab1["Test_case"] return cd,201 else: return jsonify({}),405 @app.route('/getBestScore',methods= ['GET','OPTIONS']) @cross_origin(origin='*',headers=['Content-Type','Authorization']) def getBestScore(): if request.method == 'GET': client = pymongo.MongoClient("mongodb+srv://rohansharma1606:_kwB&9Q4GTZg2fA@<EMAIL>.mongodb.<EMAIL>/test?retryWrites=true&w=majority") db=client.hack_se pid=request.args.get('Contest_id',type=str) sid=request.args.get('Student_id',type=str) ab=db.contest.find_one({"Contest_id":pid}) ab1 = json.loads(json_util.dumps(ab)) cd=ab1["Student_list"] for key,val in cd.items(): if key==sid: return val["Best_score"] else: return jsonify({}),405 @app.route('/addBestCode',methods= ['PUT','OPTIONS']) @cross_origin(origin='*',headers=['Content-Type','Authorization']) def addBestCode(): if request.method == 'PUT': client = pymongo.MongoClient("mongodb+srv://rohansharma1606:_kwB&<EMAIL>/test?retryWrites=true&w=majority") db=client.hack_se post=request.json cid=post["Contest_id"] sid=post["Student_id"] ns=post["Best_score"] bc=post["Best_code"] bcl=post["Best_code_language"] ab=db.contest.find_one({"Contest_id":cid}) ab1 = json.loads(json_util.dumps(ab)) cd=ab1["Student_list"] new_val={} n_val={} for key,val in cd.items(): if key==sid and ns>val["Best_score"]: new_val={"Student_id":sid,"Best_code":bc,"Best_score":ns,"Best_code_language":bcl} old_val=val dict={"$set":new_val} myco=db.contest["Student_list"] mycol=myco[sid] db=db.contest else: return jsonify({}),405 if __name__ == '__main__': app.run(debug=True)
[ 1, 1053, 282, 962, 7443, 30004, 13, 5215, 12865, 30004, 13, 5215, 4390, 30004, 13, 3166, 29784, 1053, 2379, 1278, 29892, 4050, 29918, 6886, 29892, 2009, 29892, 3142, 29918, 1454, 29892, 6684, 29892, 27450, 29892, 4390, 1598, 29892, 1207, 29918, 5327, 30004, 13, 3166, 29784, 29918, 29883, 943, 1053, 315, 24125, 29892, 4891, 29918, 12574, 30004, 13, 3166, 289, 1100, 1053, 4390, 29918, 4422, 30004, 13, 3166, 289, 1100, 29889, 3126, 29918, 4422, 1053, 270, 17204, 29892, 2061, 1204, 30004, 13, 5215, 4036, 30004, 13, 30004, 13, 932, 29922, 8754, 1278, 22168, 978, 1649, 8443, 13, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 1202, 26604, 742, 23515, 29922, 1839, 5438, 3788, 14094, 27946, 2033, 8443, 13, 29992, 19128, 29918, 12574, 29898, 12574, 2433, 29930, 742, 13662, 29922, 1839, 3916, 29899, 1542, 3788, 25471, 2033, 8443, 13, 1753, 788, 26604, 7295, 30004, 13, 12, 361, 2009, 29889, 5696, 1275, 525, 5438, 2396, 30004, 13, 12, 12, 2490, 29922, 2009, 29889, 3126, 30004, 13, 12, 12, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 703, 23264, 29974, 29879, 15291, 597, 307, 29882, 550, 8222, 655, 29896, 29953, 29900, 29953, 29901, 29918, 11022, 29933, 29987, 29929, 29984, 29946, 23799, 29999, 29887, 29906, 29888, 29909, 29992, 344, 29899, 29953, 29895, 29881, 1631, 29889, 23264, 29889, 1212, 29914, 1688, 29973, 276, 2202, 29956, 768, 267, 29922, 3009, 29987, 29893, 29922, 21355, 537, 1159, 30004, 13, 12, 12, 2585, 29922, 4645, 29889, 29882, 547, 29918, 344, 30004, 13, 12, 12, 14080, 353, 4833, 29889, 17199, 30004, 13, 12, 12, 2490, 29918, 333, 353, 11803, 29889, 7851, 29918, 650, 29898, 2490, 8443, 13, 12, 12, 4645, 29889, 5358, 26471, 13, 12, 12, 2457, 376, 23959, 19451, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 1202, 1323, 342, 742, 23515, 353, 6024, 5438, 3788, 14094, 27946, 2033, 8443, 13, 29992, 19128, 29918, 12574, 29898, 12574, 2433, 29930, 742, 13662, 29922, 1839, 3916, 29899, 1542, 3788, 25471, 2033, 8443, 13, 1753, 788, 1323, 342, 7295, 30004, 13, 12, 361, 2009, 29889, 5696, 1275, 525, 5438, 2396, 30004, 13, 12, 12, 2490, 353, 2009, 29889, 3126, 30004, 13, 12, 12, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 703, 23264, 29974, 29879, 15291, 597, 307, 29882, 550, 8222, 655, 29896, 29953, 29900, 29953, 29901, 29918, 11022, 29933, 29987, 29966, 26862, 6227, 20690, 1688, 29973, 276, 2202, 29956, 768, 267, 29922, 3009, 29987, 29893, 29922, 21355, 537, 1159, 30004, 13, 12, 12, 2585, 29922, 4645, 29889, 29882, 547, 29918, 344, 30004, 13, 12, 12, 14080, 353, 4833, 29889, 1285, 342, 30004, 13, 12, 12, 14080, 29896, 353, 4833, 29889, 17199, 30004, 13, 12, 12, 14080, 29906, 353, 4833, 29889, 1792, 30004, 13, 12, 12, 5935, 353, 1400, 3366, 17199, 29918, 333, 3108, 30004, 13, 12, 12, 331, 353, 1400, 3366, 1792, 3108, 6756, 13, 12, 12, 361, 313, 14080, 29896, 29889, 2886, 3319, 29908, 17199, 29918, 333, 1115, 5935, 1800, 338, 451, 6213, 29897, 322, 313, 14080, 29906, 29889, 2886, 3319, 29908, 5269, 1115, 331, 1800, 338, 451, 6213, 1125, 30004, 13, 12, 12, 12, 2490, 29918, 333, 29922, 14080, 29889, 7851, 29918, 650, 29898, 2490, 8443, 13, 12, 12, 12, 2457, 376, 23959, 19451, 13, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 2457, 376, 1333, 2715, 19451, 13, 12, 12, 12, 30004, 13, 12, 12, 4645, 29889, 5358, 26471, 13, 12, 2870, 29901, 30004, 13, 12, 12, 2457, 4390, 1598, 3319, 9594, 29946, 29900, 29945, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 1202, 2659, 742, 23515, 29922, 6024, 5438, 3788, 14094, 27946, 2033, 8443, 13, 29992, 19128, 29918, 12574, 29898, 12574, 2433, 29930, 742, 13662, 29922, 1839, 3916, 29899, 1542, 3788, 25471, 2033, 8443, 13, 1753, 788, 2659, 7295, 30004, 13, 12, 361, 2009, 29889, 5696, 1275, 525, 5438, 2396, 30004, 13, 12, 12, 2490, 29922, 3827, 29889, 3126, 30004, 13, 12, 12, 331, 353, 1400, 3366, 5269, 3108, 30004, 13, 12, 12, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 703, 23264, 29974, 29879, 15291, 597, 307, 29882, 550, 8222, 655, 29896, 29953, 29900, 29953, 29901, 29918, 11022, 29933, 29987, 29966, 26862, 6227, 29958, 29999, 29887, 29906, 29888, 29909, 29992, 29966, 26862, 6227, 15513, 23264, 29889, 1212, 29914, 1688, 29973, 276, 2202, 29956, 768, 267, 29922, 3009, 29987, 29893, 29922, 21355, 537, 1159, 30004, 13, 12, 12, 2585, 29922, 4645, 29889, 29882, 547, 29918, 344, 30004, 13, 12, 12, 14080, 353, 4833, 29889, 1792, 30004, 13, 12, 12, 361, 11803, 29889, 2886, 3319, 29908, 5269, 1115, 953, 1800, 338, 6213, 29901, 12, 12, 30004, 13, 12, 12, 12, 2490, 29918, 333, 353, 11803, 29889, 7851, 29918, 650, 29898, 2490, 8443, 13, 12, 12, 12, 2457, 376, 23959, 19451, 13, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 2457, 376, 1792, 4864, 19451, 13, 12, 12, 30004, 13, 12, 12, 4645, 29889, 5358, 26471, 13, 12, 12, 30004, 13, 12, 2870, 29901, 30004, 13, 12, 12, 2457, 4390, 1598, 3319, 9594, 29946, 29900, 29945, 30004, 13, 12, 12, 30004, 13, 29992, 932, 29889, 13134, 11219, 657, 26604, 9868, 742, 23515, 29922, 6024, 7194, 3788, 14094, 27946, 2033, 8443, 13, 29992, 19128, 29918, 12574, 29898, 12574, 2433, 29930, 742, 13662, 29922, 1839, 3916, 29899, 1542, 3788, 25471, 2033, 8443, 13, 1753, 679, 26604, 9868, 7295, 30004, 13, 12, 12, 361, 2009, 29889, 5696, 1275, 525, 7194, 2396, 30004, 13, 12, 12, 12, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 703, 23264, 29974, 29879, 15291, 597, 307, 29882, 550, 8222, 655, 29896, 29953, 29900, 29953, 29901, 29918, 11022, 29933, 29987, 29929, 29984, 29946, 23799, 29999, 29887, 29906, 29888, 29909, 29992, 344, 29899, 29953, 29895, 29881, 1631, 29889, 23264, 29889, 1212, 29914, 1688, 29973, 276, 2202, 29956, 768, 267, 29922, 3009, 29987, 29893, 29922, 21355, 537, 1159, 30004, 13, 12, 12, 12, 2585, 29922, 4645, 29889, 29882, 547, 29918, 344, 30004, 13, 12, 12, 12, 5935, 29922, 3827, 29889, 5085, 29889, 657, 877, 17199, 29918, 333, 742, 1853, 29922, 710, 8443, 13, 12, 12, 12, 370, 29922, 2585, 29889, 17199, 29889, 2886, 29918, 650, 3319, 29908, 17199, 29918, 333, 1115, 5935, 1800, 30004, 13, 12, 12, 12, 370, 29896, 29922, 3126, 29889, 18132, 29898, 3126, 29918, 4422, 29889, 29881, 17204, 29898, 370, 876, 30004, 13, 12, 12, 12, 2457, 633, 29896, 29892, 29906, 29900, 29896, 30004, 13, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 2457, 4390, 1598, 3319, 9594, 29946, 29900, 29945, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 657, 3057, 29907, 2129, 742, 23515, 29922, 6024, 7194, 3788, 14094, 27946, 2033, 8443, 13, 29992, 19128, 29918, 12574, 29898, 12574, 2433, 29930, 742, 13662, 29922, 1839, 3916, 29899, 1542, 3788, 25471, 2033, 8443, 13, 1753, 679, 3057, 29907, 2129, 7295, 30004, 13, 12, 12, 361, 2009, 29889, 5696, 1275, 525, 7194, 2396, 30004, 13, 12, 12, 12, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 703, 23264, 29974, 29879, 15291, 597, 307, 29882, 550, 8222, 655, 29896, 29953, 29900, 29953, 29901, 29918, 11022, 29933, 29987, 29966, 26862, 6227, 15513, 1212, 29914, 1688, 29973, 276, 2202, 29956, 768, 267, 29922, 3009, 29987, 29893, 29922, 21355, 537, 1159, 30004, 13, 12, 12, 12, 2585, 29922, 4645, 29889, 29882, 547, 29918, 344, 30004, 13, 12, 12, 12, 5935, 29922, 3827, 29889, 5085, 29889, 657, 877, 17199, 29918, 333, 742, 1853, 29922, 710, 8443, 13, 12, 12, 12, 370, 29922, 2585, 29889, 17199, 29889, 2886, 29918, 650, 3319, 29908, 17199, 29918, 333, 1115, 5935, 1800, 30004, 13, 12, 12, 12, 370, 29896, 353, 4390, 29889, 18132, 29898, 3126, 29918, 4422, 29889, 29881, 17204, 29898, 370, 876, 30004, 13, 12, 12, 12, 2252, 29922, 370, 29896, 3366, 3057, 29918, 4878, 3108, 30004, 13, 30004, 13, 12, 12, 12, 2457, 14965, 29892, 29906, 29900, 29896, 30004, 13, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 2457, 4390, 1598, 3319, 9594, 29946, 29900, 29945, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 657, 25353, 20097, 742, 23515, 29922, 6024, 7194, 3788, 14094, 27946, 2033, 8443, 13, 29992, 19128, 29918, 12574, 29898, 12574, 2433, 29930, 742, 13662, 29922, 1839, 3916, 29899, 1542, 3788, 25471, 2033, 8443, 13, 1753, 679, 25353, 20097, 7295, 30004, 13, 12, 12, 361, 2009, 29889, 5696, 1275, 525, 7194, 2396, 30004, 13, 12, 12, 12, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 703, 23264, 29974, 29879, 15291, 597, 307, 29882, 550, 8222, 655, 29896, 29953, 29900, 29953, 29901, 29918, 11022, 29933, 29987, 29929, 29984, 29946, 23799, 29999, 29887, 29906, 29888, 29909, 29992, 29966, 26862, 6227, 15513, 23264, 19423, 26862, 6227, 20690, 1688, 29973, 276, 2202, 29956, 768, 267, 29922, 3009, 29987, 29893, 29922, 21355, 537, 1159, 30004, 13, 12, 12, 12, 2585, 29922, 4645, 29889, 29882, 547, 29918, 344, 30004, 13, 12, 12, 12, 5935, 29922, 3827, 29889, 5085, 29889, 657, 877, 1323, 342, 29918, 333, 742, 1853, 29922, 710, 8443, 13, 12, 12, 12, 29879, 333, 29922, 3827, 29889, 5085, 29889, 657, 877, 20791, 29918, 333, 742, 1853, 29922, 710, 8443, 13, 12, 12, 12, 370, 29922, 2585, 29889, 1285, 342, 29889, 2886, 29918, 650, 3319, 29908, 1323, 342, 29918, 333, 1115, 5935, 1800, 30004, 13, 12, 12, 12, 370, 29896, 353, 4390, 29889, 18132, 29898, 3126, 29918, 4422, 29889, 29881, 17204, 29898, 370, 876, 30004, 13, 12, 12, 12, 2252, 29922, 370, 29896, 3366, 20791, 29918, 1761, 3108, 30004, 13, 12, 12, 12, 1454, 1820, 29892, 791, 297, 14965, 29889, 7076, 7295, 30004, 13, 12, 12, 12, 12, 361, 1820, 1360, 29879, 333, 29901, 30004, 13, 12, 12, 12, 12, 12, 2457, 659, 3366, 25353, 29918, 13628, 3108, 30004, 13, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 2457, 4390, 1598, 3319, 9594, 29946, 29900, 29945, 30004, 13, 30004, 13, 29992, 932, 29889, 13134, 11219, 1202, 25353, 3399, 742, 23515, 29922, 6024, 12336, 3788, 14094, 27946, 2033, 8443, 13, 29992, 19128, 29918, 12574, 29898, 12574, 2433, 29930, 742, 13662, 29922, 1839, 3916, 29899, 1542, 3788, 25471, 2033, 8443, 13, 1753, 788, 25353, 3399, 7295, 30004, 13, 12, 12, 361, 2009, 29889, 5696, 1275, 525, 12336, 2396, 30004, 13, 12, 12, 12, 4645, 353, 282, 962, 7443, 29889, 29924, 7443, 4032, 703, 23264, 29974, 29879, 15291, 597, 307, 29882, 550, 8222, 655, 29896, 29953, 29900, 29953, 29901, 29918, 11022, 29933, 29987, 29966, 26862, 6227, 20690, 1688, 29973, 276, 2202, 29956, 768, 267, 29922, 3009, 29987, 29893, 29922, 21355, 537, 1159, 30004, 13, 12, 12, 12, 2585, 29922, 4645, 29889, 29882, 547, 29918, 344, 30004, 13, 12, 12, 12, 2490, 29922, 3827, 29889, 3126, 30004, 13, 12, 12, 12, 25232, 29922, 2490, 3366, 1323, 342, 29918, 333, 3108, 30004, 13, 12, 12, 12, 29879, 333, 29922, 2490, 3366, 20791, 29918, 333, 3108, 30004, 13, 12, 12, 12, 1983, 29922, 2490, 3366, 25353, 29918, 13628, 3108, 30004, 13, 12, 12, 12, 12328, 29922, 2490, 3366, 25353, 29918, 401, 3108, 30004, 13, 12, 12, 12, 29890, 695, 29922, 2490, 3366, 25353, 29918, 401, 29918, 11675, 3108, 30004, 13, 12, 12, 12, 370, 29922, 2585, 29889, 1285, 342, 29889, 2886, 29918, 650, 3319, 29908, 1323, 342, 29918, 333, 1115, 25232, 1800, 30004, 13, 12, 12, 12, 370, 29896, 353, 4390, 29889, 18132, 29898, 3126, 29918, 4422, 29889, 29881, 17204, 29898, 370, 876, 30004, 13, 12, 12, 12, 2252, 29922, 370, 29896, 3366, 20791, 29918, 1761, 3108, 30004, 13, 12, 12, 12, 1482, 29918, 791, 3790, 8117, 13, 12, 12, 12, 29876, 29918, 791, 3790, 8117, 13, 12, 12, 12, 1454, 1820, 29892, 791, 297, 14965, 29889, 7076, 7295, 30004, 13, 12, 12, 12, 12, 361, 1820, 1360, 29879, 333, 322, 17534, 29958, 791, 3366, 25353, 29918, 13628, 3108, 29901, 30004, 13, 12, 12, 12, 12, 12, 1482, 29918, 791, 3790, 29908, 20791, 29918, 333, 1115, 29879, 333, 1699, 25353, 29918, 401, 1115, 12328, 1699, 25353, 29918, 13628, 1115, 1983, 1699, 25353, 29918, 401, 29918, 11675, 1115, 29890, 695, 8117, 13, 462, 1678, 2030, 29918, 791, 29922, 791, 30004, 13, 12, 12, 12, 8977, 3790, 29908, 29938, 842, 1115, 1482, 29918, 791, 8117, 13, 12, 12, 12, 1357, 1111, 29922, 2585, 29889, 1285, 342, 3366, 20791, 29918, 1761, 3108, 30004, 13, 12, 12, 12, 1357, 1054, 29922, 1357, 1111, 29961, 29879, 333, 29962, 30004, 13, 12, 12, 12, 30004, 13, 12, 12, 12, 30004, 13, 12, 12, 12, 30004, 13, 12, 12, 12, 2585, 29922, 2585, 29889, 1285, 342, 30004, 13, 12, 12, 12, 30004, 13, 12, 12, 2870, 29901, 30004, 13, 12, 12, 12, 2457, 4390, 1598, 3319, 9594, 29946, 29900, 29945, 30004, 13, 30004, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 30004, 13, 12, 932, 29889, 3389, 29898, 8382, 29922, 5574, 29897, 2 ]
warp.py
RezaFirouzii/fum-delta-vision
0
6451
import math import imageio import cv2 as cv import numpy as np import transformer def fix_rotation(img): img_copy = img.copy() img = cv.cvtColor(img, cv.COLOR_BGR2GRAY) rows, cols = img.shape img = cv.adaptiveThreshold(img, 255, cv.ADAPTIVE_THRESH_MEAN_C, cv.THRESH_BINARY_INV, 15, 9) kernel = cv.getStructuringElement(cv.MORPH_ELLIPSE, (3, 3)) img = cv.morphologyEx(img, cv.MORPH_OPEN, kernel) img = cv.medianBlur(img, 3) contours, hierarchy = cv.findContours(img, cv.RETR_LIST, cv.CHAIN_APPROX_NONE) roi = max(contours, key=cv.contourArea) x, y, w, h = cv.boundingRect(roi) corners = [[x, y], [x + w, y], [x, y + h], [x + w, y + h]] src = np.float32(corners) # src = np.reshape(src, (len(src), 1, 2)) # perimeter = cv.arcLength(src, True) # corners = cv.approxPolyDP(src, perimeter // 10, True) # corners = np.vstack(corners) dst = np.float32([[0, 0], [cols, 0], [0, rows], [cols, rows]]) matrix = cv.getPerspectiveTransform(src, dst) rotated_img = cv.warpPerspective(img_copy, matrix, (cols, rows)) cv.imshow('', rotated_img) D1 = 105 D2 = 175 D3 = 275 if __name__ == "__main__": cap = cv.VideoCapture('samples/delta.mp4') if not cap.isOpened(): raise IOError("Video was not opened!") mse = 0 count = 0 reader = imageio.get_reader('samples/delta.mp4') fps = reader.get_meta_data()['fps'] writer = imageio.get_writer('samples/result.mp4', fps=fps) while True: res, frame = cap.read() if not res: break mean_error = 0 holes_count = 0 img = frame.copy() cv.imshow('dfa', img) frame = cv.cvtColor(frame, cv.COLOR_BGR2GRAY) frame_copy = frame.copy() # frame = cv.adaptiveThreshold(frame, 255, cv.ADAPTIVE_THRESH_MEAN_C, cv.THRESH_BINARY_INV, 15, 9) # kernel = cv.getStructuringElement(cv.MORPH_ELLIPSE, (3, 3)) # frame = cv.morphologyEx(frame, cv.MORPH_OPEN, kernel) # frame = cv.medianBlur(frame, 3) # contours, hierarchy = cv.findContours(frame, cv.RETR_LIST, cv.CHAIN_APPROX_NONE) # roi = max(contours, key=cv.contourArea) # x, y, w, h = cv.boundingRect(roi) x, y, w, h = 115, 0, 445, 360 img = img[y: y+h, x: x+w] img = transformer.rotate_along_axis(img, theta=40) frame_copy = frame_copy[y: y+h, x: x+w] frame_copy = transformer.rotate_along_axis(frame_copy, theta=40) # cv.imshow('', frame_copy) # cv.rectangle(frame_copy, (x, y), (x + w, y + h), (0, 255, 0), 2) # cv.drawContours(frame_copy, roi, -1, (0, 0, 255), 2) # res, mask = cv.threshold(frame_copy, 0, 255, cv.THRESH_BINARY) # frame_copy = cv.bitwise_and(frame_copy, frame_copy, mask=mask) # corners = cv.goodFeaturesToTrack(frame_copy, 1000, 0.0001, 1) # corners = list(sorted(corners, key=lambda x: x[0][1])) # print(corners[-1], corners[-2]) # print() # corners = np.array([[38, 293], [407, 293]]) # for item in corners: # # x, y = map(int, item.ravel()) # x, y = item # cv.circle(img, (x, y), 5, (0, 0, 255), -1) src = np.float32([[0, 0], [w, 0], [38, 293], [407, 293]]) dst = np.float32([[0, 0], [w, 0], [30, h], [w - 30, h]]) matrix = cv.getPerspectiveTransform(src, dst) img = cv.warpPerspective(img, matrix, (w, h)) cv.imshow('', img) img_copy = img.copy() img = cv.cvtColor(img, cv.COLOR_BGR2GRAY) img = cv.adaptiveThreshold(img, 255, cv.ADAPTIVE_THRESH_MEAN_C, cv.THRESH_BINARY_INV, 15, 9) kernel = cv.getStructuringElement(cv.MORPH_ELLIPSE, (3, 3)) img = cv.morphologyEx(img, cv.MORPH_OPEN, kernel) img = cv.medianBlur(img, 3) origin = (w // 2 + 4, h // 2 + 2) o1, o2 = origin r = w // 2 + 1 ORIGIN = (0, 0) R = 300 # mm contours, hierarchy = cv.findContours(img, cv.RETR_LIST, cv.CHAIN_APPROX_NONE) contours = list(filter(lambda x: 50 < cv.contourArea(x) < 175, contours)) factor = 0.1 smooth_contours = [] for i in range(len(contours)): epsilon = factor * cv.arcLength(contours[i], True) approx = cv.approxPolyDP(contours[i], epsilon, True) x, y, width, height = cv.boundingRect(approx) area = width*height if len(approx) == 4 and 75 < area < 200: smooth_contours.append(contours[i]) center, radius = cv.minEnclosingCircle(approx) radius = int(radius) center = tuple(map(int, center)) x, y = center X = ((x - o1) * R) / r Y = ((y - o2) * R) / r X, Y = round(X, 2), round(Y, 2) cv.circle(img_copy, center, radius, (0, 255, 0), 2) cv.putText(img_copy, str((X, Y)), center, cv.FONT_HERSHEY_SIMPLEX, 0.3, (255, 0, 255, 255), 1, cv.LINE_AA) e1, e2, e3 = map(lambda d: abs(math.hypot(X, Y) - d), [D1, D2, D3]) error = min(e1, e2, e3) if error < 10: mean_error += error ** 2 holes_count += 1 cv.circle(img_copy, origin, 4, (0, 0, 255), -1) # cv.line(img_copy, origin, (origin[0], origin[1]), (255, 0, 255), 2) mean_error /= holes_count mse += mean_error count += 1 cv.imshow("Final", img_copy) writer.append_data(img_copy) # cv.imshow("Chg", img) if cv.waitKey(30) == 27: break print("E:", mse / count, "N:", count) writer.close() cap.release() cv.destroyAllWindows()
[ 1, 1053, 5844, 13, 5215, 1967, 601, 13, 5215, 13850, 29906, 408, 13850, 13, 5215, 12655, 408, 7442, 13, 5215, 4327, 261, 13, 13, 1753, 2329, 29918, 5450, 362, 29898, 2492, 1125, 13, 1678, 10153, 29918, 8552, 353, 10153, 29889, 8552, 580, 13, 1678, 10153, 353, 13850, 29889, 11023, 29873, 3306, 29898, 2492, 29892, 13850, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 1678, 4206, 29892, 28730, 353, 10153, 29889, 12181, 13, 1678, 10153, 353, 13850, 29889, 1114, 415, 573, 1349, 12268, 29898, 2492, 29892, 29871, 29906, 29945, 29945, 29892, 13850, 29889, 3035, 3301, 29911, 18474, 29918, 4690, 1525, 7068, 29918, 2303, 2190, 29918, 29907, 29892, 13850, 29889, 4690, 1525, 7068, 29918, 29933, 1177, 19926, 29918, 1177, 29963, 29892, 29871, 29896, 29945, 29892, 29871, 29929, 29897, 13, 13, 1678, 8466, 353, 13850, 29889, 657, 19560, 3864, 2642, 29898, 11023, 29889, 29924, 1955, 19689, 29918, 29923, 2208, 5690, 1660, 29892, 313, 29941, 29892, 29871, 29941, 876, 13, 1678, 10153, 353, 13850, 29889, 29885, 5676, 3002, 1252, 29898, 2492, 29892, 13850, 29889, 29924, 1955, 19689, 29918, 4590, 1430, 29892, 8466, 29897, 13, 13, 1678, 10153, 353, 13850, 29889, 2168, 713, 10358, 332, 29898, 2492, 29892, 29871, 29941, 29897, 13, 13, 1678, 640, 2470, 29892, 21277, 353, 13850, 29889, 2886, 1323, 2470, 29898, 2492, 29892, 13850, 29889, 1525, 5659, 29918, 24360, 29892, 13850, 29889, 3210, 29909, 1177, 29918, 3301, 8618, 29990, 29918, 29940, 12413, 29897, 13, 1678, 14100, 353, 4236, 29898, 1285, 2470, 29892, 1820, 29922, 11023, 29889, 1285, 473, 13799, 29897, 13, 268, 13, 1678, 921, 29892, 343, 29892, 281, 29892, 298, 353, 13850, 29889, 9917, 292, 7364, 29898, 307, 29875, 29897, 13, 1678, 26995, 353, 5519, 29916, 29892, 343, 1402, 518, 29916, 718, 281, 29892, 343, 1402, 518, 29916, 29892, 343, 718, 298, 1402, 518, 29916, 718, 281, 29892, 343, 718, 298, 5262, 13, 1678, 4765, 353, 7442, 29889, 7411, 29941, 29906, 29898, 29883, 1398, 414, 29897, 13, 1678, 396, 4765, 353, 7442, 29889, 690, 14443, 29898, 4351, 29892, 313, 2435, 29898, 4351, 511, 29871, 29896, 29892, 29871, 29906, 876, 13, 13, 1678, 396, 639, 14772, 353, 13850, 29889, 5666, 6513, 29898, 4351, 29892, 5852, 29897, 13, 1678, 396, 26995, 353, 13850, 29889, 14850, 7713, 29891, 11191, 29898, 4351, 29892, 639, 14772, 849, 29871, 29896, 29900, 29892, 5852, 29897, 13, 1678, 396, 26995, 353, 7442, 29889, 29894, 1429, 29898, 29883, 1398, 414, 29897, 13, 1678, 29743, 353, 7442, 29889, 7411, 29941, 29906, 4197, 29961, 29900, 29892, 29871, 29900, 1402, 518, 22724, 29892, 29871, 29900, 1402, 518, 29900, 29892, 4206, 1402, 518, 22724, 29892, 4206, 24960, 13, 13, 1678, 4636, 353, 13850, 29889, 657, 15136, 12645, 13372, 29898, 4351, 29892, 29743, 29897, 13, 1678, 5731, 630, 29918, 2492, 353, 13850, 29889, 4495, 29886, 15136, 12645, 29898, 2492, 29918, 8552, 29892, 4636, 29892, 313, 22724, 29892, 4206, 876, 13, 1678, 13850, 29889, 326, 4294, 877, 742, 5731, 630, 29918, 2492, 29897, 13, 13, 29928, 29896, 353, 29871, 29896, 29900, 29945, 13, 29928, 29906, 353, 29871, 29896, 29955, 29945, 13, 29928, 29941, 353, 29871, 29906, 29955, 29945, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 13, 1678, 2117, 353, 13850, 29889, 15167, 21133, 545, 877, 27736, 29914, 4181, 29889, 1526, 29946, 1495, 13, 1678, 565, 451, 2117, 29889, 275, 6585, 287, 7295, 13, 4706, 12020, 10663, 2392, 703, 15167, 471, 451, 6496, 29991, 1159, 13, 13, 1678, 286, 344, 353, 29871, 29900, 13, 1678, 2302, 353, 29871, 29900, 13, 13, 1678, 9591, 353, 1967, 601, 29889, 657, 29918, 16950, 877, 27736, 29914, 4181, 29889, 1526, 29946, 1495, 13, 1678, 285, 567, 353, 9591, 29889, 657, 29918, 7299, 29918, 1272, 580, 1839, 29888, 567, 2033, 13, 1678, 9227, 353, 1967, 601, 29889, 657, 29918, 13236, 877, 27736, 29914, 2914, 29889, 1526, 29946, 742, 285, 567, 29922, 29888, 567, 29897, 13, 13, 1678, 1550, 5852, 29901, 13, 4706, 620, 29892, 3515, 353, 2117, 29889, 949, 580, 13, 4706, 565, 451, 620, 29901, 13, 9651, 2867, 13, 13, 4706, 2099, 29918, 2704, 353, 29871, 29900, 13, 4706, 26532, 29918, 2798, 353, 29871, 29900, 13, 13, 4706, 10153, 353, 3515, 29889, 8552, 580, 13, 4706, 13850, 29889, 326, 4294, 877, 2176, 29874, 742, 10153, 29897, 13, 4706, 3515, 353, 13850, 29889, 11023, 29873, 3306, 29898, 2557, 29892, 13850, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 4706, 3515, 29918, 8552, 353, 3515, 29889, 8552, 580, 13, 4706, 396, 3515, 353, 13850, 29889, 1114, 415, 573, 1349, 12268, 29898, 2557, 29892, 29871, 29906, 29945, 29945, 29892, 13850, 29889, 3035, 3301, 29911, 18474, 29918, 4690, 1525, 7068, 29918, 2303, 2190, 29918, 29907, 29892, 13850, 29889, 4690, 1525, 7068, 29918, 29933, 1177, 19926, 29918, 1177, 29963, 29892, 29871, 29896, 29945, 29892, 29871, 29929, 29897, 13, 13, 4706, 396, 8466, 353, 13850, 29889, 657, 19560, 3864, 2642, 29898, 11023, 29889, 29924, 1955, 19689, 29918, 29923, 2208, 5690, 1660, 29892, 313, 29941, 29892, 29871, 29941, 876, 13, 4706, 396, 3515, 29871, 353, 13850, 29889, 29885, 5676, 3002, 1252, 29898, 2557, 29892, 13850, 29889, 29924, 1955, 19689, 29918, 4590, 1430, 29892, 8466, 29897, 13, 13, 4706, 396, 3515, 353, 13850, 29889, 2168, 713, 10358, 332, 29898, 2557, 29892, 29871, 29941, 29897, 13, 4706, 396, 640, 2470, 29892, 21277, 353, 13850, 29889, 2886, 1323, 2470, 29898, 2557, 29892, 13850, 29889, 1525, 5659, 29918, 24360, 29892, 13850, 29889, 3210, 29909, 1177, 29918, 3301, 8618, 29990, 29918, 29940, 12413, 29897, 13, 4706, 396, 14100, 353, 4236, 29898, 1285, 2470, 29892, 1820, 29922, 11023, 29889, 1285, 473, 13799, 29897, 13, 4706, 396, 921, 29892, 343, 29892, 281, 29892, 298, 353, 13850, 29889, 9917, 292, 7364, 29898, 307, 29875, 29897, 13, 4706, 921, 29892, 343, 29892, 281, 29892, 298, 353, 29871, 29896, 29896, 29945, 29892, 29871, 29900, 29892, 29871, 29946, 29946, 29945, 29892, 29871, 29941, 29953, 29900, 13, 4706, 10153, 353, 10153, 29961, 29891, 29901, 343, 29974, 29882, 29892, 921, 29901, 921, 29974, 29893, 29962, 13, 4706, 10153, 353, 4327, 261, 29889, 23361, 29918, 284, 549, 29918, 8990, 29898, 2492, 29892, 278, 941, 29922, 29946, 29900, 29897, 13, 4706, 3515, 29918, 8552, 353, 3515, 29918, 8552, 29961, 29891, 29901, 343, 29974, 29882, 29892, 921, 29901, 921, 29974, 29893, 29962, 13, 4706, 3515, 29918, 8552, 353, 4327, 261, 29889, 23361, 29918, 284, 549, 29918, 8990, 29898, 2557, 29918, 8552, 29892, 278, 941, 29922, 29946, 29900, 29897, 13, 4706, 396, 13850, 29889, 326, 4294, 877, 742, 3515, 29918, 8552, 29897, 13, 4706, 396, 13850, 29889, 1621, 2521, 29898, 2557, 29918, 8552, 29892, 313, 29916, 29892, 343, 511, 313, 29916, 718, 281, 29892, 343, 718, 298, 511, 313, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 511, 29871, 29906, 29897, 13, 4706, 396, 13850, 29889, 4012, 1323, 2470, 29898, 2557, 29918, 8552, 29892, 14100, 29892, 448, 29896, 29892, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 511, 29871, 29906, 29897, 13, 13, 4706, 396, 620, 29892, 11105, 353, 13850, 29889, 386, 12268, 29898, 2557, 29918, 8552, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 13850, 29889, 4690, 1525, 7068, 29918, 29933, 1177, 19926, 29897, 13, 4706, 396, 3515, 29918, 8552, 353, 13850, 29889, 2966, 3538, 29918, 392, 29898, 2557, 29918, 8552, 29892, 3515, 29918, 8552, 29892, 11105, 29922, 13168, 29897, 13, 4706, 396, 26995, 353, 13850, 29889, 16773, 8263, 3698, 1762, 17936, 29898, 2557, 29918, 8552, 29892, 29871, 29896, 29900, 29900, 29900, 29892, 29871, 29900, 29889, 29900, 29900, 29900, 29896, 29892, 29871, 29896, 29897, 13, 4706, 396, 26995, 353, 1051, 29898, 24582, 29898, 29883, 1398, 414, 29892, 1820, 29922, 2892, 921, 29901, 921, 29961, 29900, 3816, 29896, 12622, 13, 4706, 396, 1596, 29898, 29883, 1398, 414, 14352, 29896, 1402, 26995, 14352, 29906, 2314, 13, 4706, 396, 1596, 580, 13, 13, 4706, 396, 26995, 353, 7442, 29889, 2378, 4197, 29961, 29941, 29947, 29892, 29871, 29906, 29929, 29941, 1402, 518, 29946, 29900, 29955, 29892, 29871, 29906, 29929, 29941, 24960, 13, 4706, 396, 363, 2944, 297, 26995, 29901, 13, 4706, 396, 268, 396, 921, 29892, 343, 353, 2910, 29898, 524, 29892, 2944, 29889, 336, 955, 3101, 13, 4706, 396, 268, 921, 29892, 343, 353, 2944, 13, 4706, 396, 268, 13850, 29889, 16622, 29898, 2492, 29892, 313, 29916, 29892, 343, 511, 29871, 29945, 29892, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 511, 448, 29896, 29897, 13, 13, 4706, 4765, 353, 7442, 29889, 7411, 29941, 29906, 4197, 29961, 29900, 29892, 29871, 29900, 1402, 518, 29893, 29892, 29871, 29900, 1402, 518, 29941, 29947, 29892, 29871, 29906, 29929, 29941, 1402, 518, 29946, 29900, 29955, 29892, 29871, 29906, 29929, 29941, 24960, 13, 4706, 29743, 353, 7442, 29889, 7411, 29941, 29906, 4197, 29961, 29900, 29892, 29871, 29900, 1402, 518, 29893, 29892, 29871, 29900, 1402, 518, 29941, 29900, 29892, 298, 1402, 518, 29893, 448, 29871, 29941, 29900, 29892, 298, 24960, 13, 4706, 4636, 353, 13850, 29889, 657, 15136, 12645, 13372, 29898, 4351, 29892, 29743, 29897, 13, 4706, 10153, 353, 13850, 29889, 4495, 29886, 15136, 12645, 29898, 2492, 29892, 4636, 29892, 313, 29893, 29892, 298, 876, 13, 4706, 13850, 29889, 326, 4294, 877, 742, 10153, 29897, 13, 13, 4706, 10153, 29918, 8552, 353, 10153, 29889, 8552, 580, 13, 4706, 10153, 353, 13850, 29889, 11023, 29873, 3306, 29898, 2492, 29892, 13850, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 4706, 10153, 353, 13850, 29889, 1114, 415, 573, 1349, 12268, 29898, 2492, 29892, 29871, 29906, 29945, 29945, 29892, 13850, 29889, 3035, 3301, 29911, 18474, 29918, 4690, 1525, 7068, 29918, 2303, 2190, 29918, 29907, 29892, 13850, 29889, 4690, 1525, 7068, 29918, 29933, 1177, 19926, 29918, 1177, 29963, 29892, 29871, 29896, 29945, 29892, 29871, 29929, 29897, 13, 13, 4706, 8466, 353, 13850, 29889, 657, 19560, 3864, 2642, 29898, 11023, 29889, 29924, 1955, 19689, 29918, 29923, 2208, 5690, 1660, 29892, 313, 29941, 29892, 29871, 29941, 876, 13, 4706, 10153, 353, 13850, 29889, 29885, 5676, 3002, 1252, 29898, 2492, 29892, 13850, 29889, 29924, 1955, 19689, 29918, 4590, 1430, 29892, 8466, 29897, 13, 4706, 10153, 353, 13850, 29889, 2168, 713, 10358, 332, 29898, 2492, 29892, 29871, 29941, 29897, 13, 13, 4706, 3978, 353, 313, 29893, 849, 29871, 29906, 718, 29871, 29946, 29892, 298, 849, 29871, 29906, 718, 29871, 29906, 29897, 13, 4706, 288, 29896, 29892, 288, 29906, 353, 3978, 13, 4706, 364, 353, 281, 849, 29871, 29906, 718, 29871, 29896, 13, 13, 4706, 438, 22789, 1177, 353, 313, 29900, 29892, 29871, 29900, 29897, 13, 4706, 390, 353, 29871, 29941, 29900, 29900, 396, 5654, 13, 13, 4706, 640, 2470, 29892, 21277, 353, 13850, 29889, 2886, 1323, 2470, 29898, 2492, 29892, 13850, 29889, 1525, 5659, 29918, 24360, 29892, 13850, 29889, 3210, 29909, 1177, 29918, 3301, 8618, 29990, 29918, 29940, 12413, 29897, 13, 4706, 640, 2470, 353, 1051, 29898, 4572, 29898, 2892, 921, 29901, 29871, 29945, 29900, 529, 13850, 29889, 1285, 473, 13799, 29898, 29916, 29897, 529, 29871, 29896, 29955, 29945, 29892, 640, 2470, 876, 13, 308, 13, 4706, 7329, 353, 29871, 29900, 29889, 29896, 13, 4706, 10597, 29918, 1285, 2470, 353, 5159, 13, 4706, 363, 474, 297, 3464, 29898, 2435, 29898, 1285, 2470, 22164, 13, 9651, 321, 3232, 353, 7329, 334, 13850, 29889, 5666, 6513, 29898, 1285, 2470, 29961, 29875, 1402, 5852, 29897, 13, 9651, 2134, 29916, 353, 13850, 29889, 14850, 7713, 29891, 11191, 29898, 1285, 2470, 29961, 29875, 1402, 321, 3232, 29892, 5852, 29897, 13, 632, 13, 9651, 921, 29892, 343, 29892, 2920, 29892, 3171, 353, 13850, 29889, 9917, 292, 7364, 29898, 14850, 29897, 13, 9651, 4038, 353, 2920, 29930, 3545, 13, 9651, 565, 7431, 29898, 14850, 29897, 1275, 29871, 29946, 322, 29871, 29955, 29945, 529, 4038, 529, 29871, 29906, 29900, 29900, 29901, 13, 18884, 10597, 29918, 1285, 2470, 29889, 4397, 29898, 1285, 2470, 29961, 29875, 2314, 13, 13, 18884, 4818, 29892, 11855, 353, 13850, 29889, 1195, 2369, 11291, 292, 23495, 280, 29898, 14850, 29897, 13, 18884, 11855, 353, 938, 29898, 13471, 29897, 13, 18884, 4818, 353, 18761, 29898, 1958, 29898, 524, 29892, 4818, 876, 13, 13, 18884, 921, 29892, 343, 353, 4818, 13, 18884, 1060, 353, 5135, 29916, 448, 288, 29896, 29897, 334, 390, 29897, 847, 364, 13, 18884, 612, 353, 5135, 29891, 448, 288, 29906, 29897, 334, 390, 29897, 847, 364, 13, 13, 18884, 1060, 29892, 612, 353, 4513, 29898, 29990, 29892, 29871, 29906, 511, 4513, 29898, 29979, 29892, 29871, 29906, 29897, 13, 13, 18884, 13850, 29889, 16622, 29898, 2492, 29918, 8552, 29892, 4818, 29892, 11855, 29892, 313, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29900, 511, 29871, 29906, 29897, 13, 18884, 13850, 29889, 649, 1626, 29898, 2492, 29918, 8552, 29892, 851, 3552, 29990, 29892, 612, 8243, 4818, 29892, 13850, 29889, 29943, 1164, 29911, 29918, 4448, 7068, 13282, 29918, 5425, 3580, 1307, 29990, 29892, 29871, 29900, 29889, 29941, 29892, 313, 29906, 29945, 29945, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 29892, 29871, 29906, 29945, 29945, 511, 29871, 29896, 29892, 13850, 29889, 18521, 29918, 6344, 29897, 13, 13, 18884, 321, 29896, 29892, 321, 29906, 29892, 321, 29941, 353, 2910, 29898, 2892, 270, 29901, 6425, 29898, 755, 29889, 29882, 1478, 327, 29898, 29990, 29892, 612, 29897, 448, 270, 511, 518, 29928, 29896, 29892, 360, 29906, 29892, 360, 29941, 2314, 13, 18884, 1059, 353, 1375, 29898, 29872, 29896, 29892, 321, 29906, 29892, 321, 29941, 29897, 13, 18884, 565, 1059, 529, 29871, 29896, 29900, 29901, 13, 462, 1678, 2099, 29918, 2704, 4619, 1059, 3579, 29871, 29906, 13, 462, 1678, 26532, 29918, 2798, 4619, 29871, 29896, 13, 13, 4706, 13850, 29889, 16622, 29898, 2492, 29918, 8552, 29892, 3978, 29892, 29871, 29946, 29892, 313, 29900, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 511, 448, 29896, 29897, 13, 4706, 396, 13850, 29889, 1220, 29898, 2492, 29918, 8552, 29892, 3978, 29892, 313, 12574, 29961, 29900, 1402, 3978, 29961, 29896, 11724, 313, 29906, 29945, 29945, 29892, 29871, 29900, 29892, 29871, 29906, 29945, 29945, 511, 29871, 29906, 29897, 13, 13, 4706, 2099, 29918, 2704, 847, 29922, 26532, 29918, 2798, 13, 4706, 286, 344, 4619, 2099, 29918, 2704, 13, 4706, 2302, 4619, 29871, 29896, 13, 4706, 13850, 29889, 326, 4294, 703, 15790, 613, 10153, 29918, 8552, 29897, 13, 4706, 9227, 29889, 4397, 29918, 1272, 29898, 2492, 29918, 8552, 29897, 13, 4706, 396, 13850, 29889, 326, 4294, 703, 1451, 29887, 613, 10153, 29897, 13, 4706, 565, 13850, 29889, 10685, 2558, 29898, 29941, 29900, 29897, 1275, 29871, 29906, 29955, 29901, 13, 9651, 2867, 13, 13, 1678, 1596, 703, 29923, 29901, 613, 286, 344, 847, 2302, 29892, 376, 29940, 29901, 613, 2302, 29897, 13, 1678, 9227, 29889, 5358, 580, 13, 1678, 2117, 29889, 14096, 580, 13, 1678, 13850, 29889, 20524, 3596, 7685, 580, 2 ]
RSA.py
SamuelBuhan/chiffrement_python
0
145890
<gh_stars>0 from Crypto.PublicKey import RSA from Crypto.Random import get_random_bytes from Crypto.Cipher import AES, PKCS1_OAEP """encrypt data """ data = "I met aliens in UFO. Here is the map.".encode("utf-8") file_out = open("encrypted_data.bin", "wb") recipient_key = RSA.import_key(open("receiver.pem").read()) session_key = get_random_bytes(16) # Encrypt the session key with the public RSA key cipher_rsa = PKCS1_OAEP.new(recipient_key) enc_session_key = cipher_rsa.encrypt(session_key) # Encrypt the data with the AES session key cipher_aes = AES.new(session_key, AES.MODE_EAX) ciphertext, tag = cipher_aes.encrypt_and_digest(data) [ file_out.write(x) for x in (enc_session_key, cipher_aes.nonce, tag, ciphertext) ] file_out.close() """decrypt data""" file_in = open("encrypted_data.bin", "rb") private_key = RSA.import_key(open("private.pem").read()) enc_session_key, nonce, tag, ciphertext = \ [ file_in.read(x) for x in (private_key.size_in_bytes(), 16, 16, -1) ] # Decrypt the session key with the private RSA key cipher_rsa = PKCS1_OAEP.new(private_key) session_key = cipher_rsa.decrypt(enc_session_key) # Decrypt the data with the AES session key cipher_aes = AES.new(session_key, AES.MODE_EAX, nonce) data = cipher_aes.decrypt_and_verify(ciphertext, tag) print(data.decode("utf-8"))
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 3166, 315, 17929, 29889, 19858, 2558, 1053, 390, 8132, 30004, 13, 3166, 315, 17929, 29889, 17875, 1053, 679, 29918, 8172, 29918, 13193, 30004, 13, 3166, 315, 17929, 29889, 29907, 29875, 8096, 1053, 319, 2890, 29892, 24457, 9295, 29896, 29918, 29949, 29909, 15488, 30004, 13, 30004, 13, 30004, 13, 15945, 29908, 3977, 4641, 848, 9995, 30004, 13, 30004, 13, 1272, 353, 376, 29902, 1539, 394, 11689, 297, 501, 5800, 29889, 2266, 338, 278, 2910, 1213, 29889, 12508, 703, 9420, 29899, 29947, 1159, 30004, 13, 1445, 29918, 449, 353, 1722, 703, 3977, 14740, 29918, 1272, 29889, 2109, 613, 376, 29893, 29890, 1159, 30004, 13, 30004, 13, 4361, 29886, 993, 29918, 1989, 353, 390, 8132, 29889, 5215, 29918, 1989, 29898, 3150, 703, 13556, 2147, 29889, 29886, 331, 2564, 949, 3101, 30004, 13, 7924, 29918, 1989, 353, 679, 29918, 8172, 29918, 13193, 29898, 29896, 29953, 8443, 13, 30004, 13, 29937, 11346, 4641, 278, 4867, 1820, 411, 278, 970, 390, 8132, 1820, 30004, 13, 455, 8096, 29918, 2288, 29874, 353, 24457, 9295, 29896, 29918, 29949, 29909, 15488, 29889, 1482, 29898, 4361, 29886, 993, 29918, 1989, 8443, 13, 3977, 29918, 7924, 29918, 1989, 353, 4583, 8096, 29918, 2288, 29874, 29889, 3977, 4641, 29898, 7924, 29918, 1989, 8443, 13, 30004, 13, 29937, 11346, 4641, 278, 848, 411, 278, 319, 2890, 4867, 1820, 30004, 13, 455, 8096, 29918, 28628, 353, 319, 2890, 29889, 1482, 29898, 7924, 29918, 1989, 29892, 319, 2890, 29889, 20387, 29918, 29923, 6604, 8443, 13, 455, 8096, 726, 29892, 4055, 353, 4583, 8096, 29918, 28628, 29889, 3977, 4641, 29918, 392, 29918, 7501, 342, 29898, 1272, 8443, 13, 29961, 934, 29918, 449, 29889, 3539, 29898, 29916, 29897, 363, 921, 297, 313, 3977, 29918, 7924, 29918, 1989, 29892, 4583, 8096, 29918, 28628, 29889, 5464, 346, 29892, 4055, 29892, 4583, 8096, 726, 29897, 4514, 30004, 13, 1445, 29918, 449, 29889, 5358, 26471, 13, 30004, 13, 15945, 29908, 7099, 4641, 848, 15945, 19451, 13, 1445, 29918, 262, 353, 1722, 703, 3977, 14740, 29918, 1272, 29889, 2109, 613, 376, 6050, 1159, 30004, 13, 30004, 13, 9053, 29918, 1989, 353, 390, 8132, 29889, 5215, 29918, 1989, 29898, 3150, 703, 9053, 29889, 29886, 331, 2564, 949, 3101, 30004, 13, 30004, 13, 3977, 29918, 7924, 29918, 1989, 29892, 1661, 346, 29892, 4055, 29892, 4583, 8096, 726, 353, 320, 30004, 13, 259, 518, 934, 29918, 262, 29889, 949, 29898, 29916, 29897, 363, 921, 297, 313, 9053, 29918, 1989, 29889, 2311, 29918, 262, 29918, 13193, 3285, 29871, 29896, 29953, 29892, 29871, 29896, 29953, 29892, 448, 29896, 29897, 4514, 30004, 13, 30004, 13, 29937, 3826, 4641, 278, 4867, 1820, 411, 278, 2024, 390, 8132, 1820, 30004, 13, 455, 8096, 29918, 2288, 29874, 353, 24457, 9295, 29896, 29918, 29949, 29909, 15488, 29889, 1482, 29898, 9053, 29918, 1989, 8443, 13, 7924, 29918, 1989, 353, 4583, 8096, 29918, 2288, 29874, 29889, 7099, 4641, 29898, 3977, 29918, 7924, 29918, 1989, 8443, 13, 30004, 13, 29937, 3826, 4641, 278, 848, 411, 278, 319, 2890, 4867, 1820, 30004, 13, 455, 8096, 29918, 28628, 353, 319, 2890, 29889, 1482, 29898, 7924, 29918, 1989, 29892, 319, 2890, 29889, 20387, 29918, 29923, 6604, 29892, 1661, 346, 8443, 13, 1272, 353, 4583, 8096, 29918, 28628, 29889, 7099, 4641, 29918, 392, 29918, 27902, 29898, 455, 8096, 726, 29892, 4055, 8443, 13, 2158, 29898, 1272, 29889, 13808, 703, 9420, 29899, 29947, 5783, 2 ]
esp_sdk/extensions/base_object.py
zimmermanc/esp-sdk-python
6
123073
class BaseObject(object): """ A base class to provide common features to all models. """
[ 1, 770, 7399, 2061, 29898, 3318, 1125, 13, 1678, 9995, 13, 1678, 319, 2967, 770, 304, 3867, 3619, 5680, 304, 599, 4733, 29889, 13, 1678, 9995, 13, 2 ]
scripts/lint.py
OwenDeng1993/Husky
117
149915
#!/usr/bin/env python import getopt import os import subprocess import sys CPPLINT_PY = os.path.dirname(os.path.abspath(__file__)) + '/cpplint.py' CPPLINT_EXTENSIONS = ['cpp', 'hpp', 'tpp'] CPPLINT_FILTERS = ['-whitespace/indent', '-runtime/references', '+build/include_alpha', '-build/c++11', '-legal/copyright', '-readability/casting'] CPPLINT_LINE_LENGTH = 120 default_dirs = [ 'base', 'core', 'io', 'lib', 'master', 'examples', ] ignored_dirs = [ 'io/input/flume_connector', ] cpp_suffix = '*.[cht]pp' husky_root = os.getenv('HUSKY_ROOT', '.') os.chdir(husky_root) def usage(): print("Run command as: $ lint.py $HUSKY_ROOT or $PATH_OF_DIR") def list_files(paths=None): dirs = None if paths is not None: dirs = paths if dirs is None: dirs, files = default_dirs, [] for d in dirs: cmd = 'find {} -name "{}"'.format(d, cpp_suffix) res = subprocess.check_output(cmd, shell=True).rstrip() files += res.split('\n') removes = [] for f in files: for d in ignored_dirs: if f.find(d) != -1: removes.append(f) for r in removes: files.remove(r) return files cmd = 'find {} -name {}'.format(' '.join(dirs), cpp_suffix) res = subprocess.check_output(cmd, shell=True).rstrip() return res.split('\n') def main(argv=None): if argv is None: argv = sys.argv try: opts, args = getopt.getopt(argv[1:], "h", ["help"]) except getopt.GetoptError as err: print(err) # will print something like "option -a not recognized" usage() return 2 for o, _ in opts: if o in ("-h", "--help"): usage() return 0 files = None if len(args) == 0: files = list_files() else: files = list_files(args) if files is None: print('[Error] Path {} does not exist'.format(args.path)) return 2 cpplint_cmd = [ CPPLINT_PY, '--linelength={}'.format(CPPLINT_LINE_LENGTH), '--extensions={}'.format(','.join(CPPLINT_EXTENSIONS)), ] if (len(CPPLINT_FILTERS) > 0): cpplint_cmd.append('--filter={}'.format(','.join(CPPLINT_FILTERS))) run_cmd = ' '.join(cpplint_cmd) + ' ' + ' '.join(files) os.system(run_cmd) if __name__ == '__main__': sys.exit(main())
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 13, 5215, 679, 3670, 13, 5215, 2897, 13, 5215, 1014, 5014, 13, 5215, 10876, 13, 13, 13, 6271, 7390, 10192, 29918, 20055, 353, 2897, 29889, 2084, 29889, 25721, 29898, 359, 29889, 2084, 29889, 370, 1028, 493, 22168, 1445, 1649, 876, 718, 8207, 8223, 27854, 29889, 2272, 29915, 13, 6271, 7390, 10192, 29918, 12194, 1430, 13381, 29903, 353, 6024, 8223, 742, 525, 29623, 742, 525, 29873, 407, 2033, 13, 6271, 7390, 10192, 29918, 3738, 29931, 4945, 29903, 353, 6024, 29899, 1332, 3246, 3535, 29914, 12860, 742, 17411, 15634, 29914, 276, 10662, 742, 525, 29974, 4282, 29914, 2856, 29918, 2312, 742, 17411, 4282, 29914, 29883, 1817, 29896, 29896, 742, 17411, 12018, 29914, 8552, 1266, 742, 17411, 949, 3097, 29914, 4384, 292, 2033, 13, 6271, 7390, 10192, 29918, 18521, 29918, 19433, 353, 29871, 29896, 29906, 29900, 13, 13, 4381, 29918, 3972, 29879, 353, 518, 13, 1678, 525, 3188, 742, 13, 1678, 525, 3221, 742, 13, 1678, 525, 601, 742, 13, 1678, 525, 1982, 742, 13, 1678, 525, 6207, 742, 13, 1678, 525, 19057, 742, 13, 29962, 13, 647, 4395, 29918, 3972, 29879, 353, 518, 13, 1678, 525, 601, 29914, 2080, 29914, 1579, 2017, 29918, 11958, 2801, 742, 13, 29962, 13, 13, 8223, 29918, 2146, 600, 861, 353, 525, 29930, 7226, 2570, 29962, 407, 29915, 13, 13, 14116, 3459, 29918, 4632, 353, 2897, 29889, 657, 6272, 877, 29950, 3308, 29968, 29979, 29918, 21289, 742, 15300, 1495, 13, 359, 29889, 305, 3972, 29898, 14116, 3459, 29918, 4632, 29897, 13, 13, 1753, 8744, 7295, 13, 1678, 1596, 703, 6558, 1899, 408, 29901, 395, 301, 524, 29889, 2272, 395, 29950, 3308, 29968, 29979, 29918, 21289, 470, 395, 10145, 29918, 9800, 29918, 9464, 1159, 13, 13, 1753, 1051, 29918, 5325, 29898, 24772, 29922, 8516, 1125, 13, 1678, 4516, 29879, 353, 6213, 13, 1678, 565, 10898, 338, 451, 6213, 29901, 13, 4706, 4516, 29879, 353, 10898, 13, 13, 1678, 565, 4516, 29879, 338, 6213, 29901, 13, 4706, 4516, 29879, 29892, 2066, 353, 2322, 29918, 3972, 29879, 29892, 5159, 13, 4706, 363, 270, 297, 4516, 29879, 29901, 13, 9651, 9920, 353, 525, 2886, 6571, 448, 978, 29850, 5038, 4286, 4830, 29898, 29881, 29892, 274, 407, 29918, 2146, 600, 861, 29897, 13, 9651, 620, 353, 1014, 5014, 29889, 3198, 29918, 4905, 29898, 9006, 29892, 6473, 29922, 5574, 467, 29878, 17010, 580, 13, 9651, 2066, 4619, 620, 29889, 5451, 28909, 29876, 1495, 13, 4706, 25388, 353, 5159, 13, 4706, 363, 285, 297, 2066, 29901, 13, 9651, 363, 270, 297, 17262, 29918, 3972, 29879, 29901, 13, 18884, 565, 285, 29889, 2886, 29898, 29881, 29897, 2804, 448, 29896, 29901, 13, 462, 1678, 25388, 29889, 4397, 29898, 29888, 29897, 13, 4706, 363, 364, 297, 25388, 29901, 13, 9651, 2066, 29889, 5992, 29898, 29878, 29897, 13, 4706, 736, 2066, 13, 13, 1678, 9920, 353, 525, 2886, 6571, 448, 978, 6571, 4286, 4830, 877, 15300, 7122, 29898, 3972, 29879, 511, 274, 407, 29918, 2146, 600, 861, 29897, 13, 1678, 620, 353, 1014, 5014, 29889, 3198, 29918, 4905, 29898, 9006, 29892, 6473, 29922, 5574, 467, 29878, 17010, 580, 13, 1678, 736, 620, 29889, 5451, 28909, 29876, 1495, 13, 13, 1753, 1667, 29898, 19218, 29922, 8516, 1125, 13, 1678, 565, 1852, 29894, 338, 6213, 29901, 13, 4706, 1852, 29894, 353, 10876, 29889, 19218, 13, 13, 1678, 1018, 29901, 13, 4706, 29111, 29892, 6389, 353, 679, 3670, 29889, 657, 3670, 29898, 19218, 29961, 29896, 29901, 1402, 376, 29882, 613, 6796, 8477, 20068, 13, 1678, 5174, 679, 3670, 29889, 2577, 3670, 2392, 408, 4589, 29901, 13, 4706, 1596, 29898, 3127, 29897, 396, 674, 1596, 1554, 763, 376, 3385, 448, 29874, 451, 14831, 29908, 13, 4706, 8744, 580, 13, 4706, 736, 29871, 29906, 13, 13, 1678, 363, 288, 29892, 903, 297, 29111, 29901, 13, 4706, 565, 288, 297, 4852, 29899, 29882, 613, 376, 489, 8477, 29908, 1125, 13, 9651, 8744, 580, 13, 9651, 736, 29871, 29900, 13, 13, 1678, 2066, 353, 6213, 13, 1678, 565, 7431, 29898, 5085, 29897, 1275, 29871, 29900, 29901, 13, 4706, 2066, 353, 1051, 29918, 5325, 580, 13, 1678, 1683, 29901, 13, 4706, 2066, 353, 1051, 29918, 5325, 29898, 5085, 29897, 13, 13, 1678, 565, 2066, 338, 6213, 29901, 13, 4706, 1596, 877, 29961, 2392, 29962, 10802, 6571, 947, 451, 1863, 4286, 4830, 29898, 5085, 29889, 2084, 876, 13, 4706, 736, 29871, 29906, 13, 13, 1678, 274, 407, 27854, 29918, 9006, 353, 518, 13, 4706, 28505, 7390, 10192, 29918, 20055, 29892, 13, 4706, 525, 489, 1915, 295, 1477, 3790, 29913, 4286, 4830, 29898, 6271, 7390, 10192, 29918, 18521, 29918, 19433, 511, 13, 4706, 525, 489, 24299, 3790, 29913, 4286, 4830, 29898, 3788, 29889, 7122, 29898, 6271, 7390, 10192, 29918, 12194, 1430, 13381, 29903, 8243, 13, 1678, 4514, 13, 1678, 565, 313, 2435, 29898, 6271, 7390, 10192, 29918, 3738, 29931, 4945, 29903, 29897, 1405, 29871, 29900, 1125, 13, 4706, 274, 407, 27854, 29918, 9006, 29889, 4397, 877, 489, 4572, 3790, 29913, 4286, 4830, 29898, 3788, 29889, 7122, 29898, 6271, 7390, 10192, 29918, 3738, 29931, 4945, 29903, 4961, 13, 13, 1678, 1065, 29918, 9006, 353, 525, 15300, 7122, 29898, 8223, 27854, 29918, 9006, 29897, 718, 525, 525, 718, 525, 15300, 7122, 29898, 5325, 29897, 13, 1678, 2897, 29889, 5205, 29898, 3389, 29918, 9006, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 10876, 29889, 13322, 29898, 3396, 3101, 13, 2 ]
sdk/python/pulumi_azure_native/authorization/v20180101preview/role_definition.py
sebtelko/pulumi-azure-native
0
194432
<filename>sdk/python/pulumi_azure_native/authorization/v20180101preview/role_definition.py<gh_stars>0 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . import outputs from ._inputs import * __all__ = ['RoleDefinitionArgs', 'RoleDefinition'] @pulumi.input_type class RoleDefinitionArgs: def __init__(__self__, *, scope: pulumi.Input[str], assignable_scopes: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, description: Optional[pulumi.Input[str]] = None, permissions: Optional[pulumi.Input[Sequence[pulumi.Input['PermissionArgs']]]] = None, role_definition_id: Optional[pulumi.Input[str]] = None, role_name: Optional[pulumi.Input[str]] = None, role_type: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a RoleDefinition resource. :param pulumi.Input[str] scope: The scope of the role definition. :param pulumi.Input[Sequence[pulumi.Input[str]]] assignable_scopes: Role definition assignable scopes. :param pulumi.Input[str] description: The role definition description. :param pulumi.Input[Sequence[pulumi.Input['PermissionArgs']]] permissions: Role definition permissions. :param pulumi.Input[str] role_definition_id: The ID of the role definition. :param pulumi.Input[str] role_name: The role name. :param pulumi.Input[str] role_type: The role type. """ pulumi.set(__self__, "scope", scope) if assignable_scopes is not None: pulumi.set(__self__, "assignable_scopes", assignable_scopes) if description is not None: pulumi.set(__self__, "description", description) if permissions is not None: pulumi.set(__self__, "permissions", permissions) if role_definition_id is not None: pulumi.set(__self__, "role_definition_id", role_definition_id) if role_name is not None: pulumi.set(__self__, "role_name", role_name) if role_type is not None: pulumi.set(__self__, "role_type", role_type) @property @pulumi.getter def scope(self) -> pulumi.Input[str]: """ The scope of the role definition. """ return pulumi.get(self, "scope") @scope.setter def scope(self, value: pulumi.Input[str]): pulumi.set(self, "scope", value) @property @pulumi.getter(name="assignableScopes") def assignable_scopes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ Role definition assignable scopes. """ return pulumi.get(self, "assignable_scopes") @assignable_scopes.setter def assignable_scopes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "assignable_scopes", value) @property @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ The role definition description. """ return pulumi.get(self, "description") @description.setter def description(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "description", value) @property @pulumi.getter def permissions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PermissionArgs']]]]: """ Role definition permissions. """ return pulumi.get(self, "permissions") @permissions.setter def permissions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['PermissionArgs']]]]): pulumi.set(self, "permissions", value) @property @pulumi.getter(name="roleDefinitionId") def role_definition_id(self) -> Optional[pulumi.Input[str]]: """ The ID of the role definition. """ return pulumi.get(self, "role_definition_id") @role_definition_id.setter def role_definition_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "role_definition_id", value) @property @pulumi.getter(name="roleName") def role_name(self) -> Optional[pulumi.Input[str]]: """ The role name. """ return pulumi.get(self, "role_name") @role_name.setter def role_name(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "role_name", value) @property @pulumi.getter(name="roleType") def role_type(self) -> Optional[pulumi.Input[str]]: """ The role type. """ return pulumi.get(self, "role_type") @role_type.setter def role_type(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "role_type", value) class RoleDefinition(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, assignable_scopes: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, description: Optional[pulumi.Input[str]] = None, permissions: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PermissionArgs']]]]] = None, role_definition_id: Optional[pulumi.Input[str]] = None, role_name: Optional[pulumi.Input[str]] = None, role_type: Optional[pulumi.Input[str]] = None, scope: Optional[pulumi.Input[str]] = None, __props__=None): """ Role definition. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[Sequence[pulumi.Input[str]]] assignable_scopes: Role definition assignable scopes. :param pulumi.Input[str] description: The role definition description. :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PermissionArgs']]]] permissions: Role definition permissions. :param pulumi.Input[str] role_definition_id: The ID of the role definition. :param pulumi.Input[str] role_name: The role name. :param pulumi.Input[str] role_type: The role type. :param pulumi.Input[str] scope: The scope of the role definition. """ ... @overload def __init__(__self__, resource_name: str, args: RoleDefinitionArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Role definition. :param str resource_name: The name of the resource. :param RoleDefinitionArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(RoleDefinitionArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, assignable_scopes: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, description: Optional[pulumi.Input[str]] = None, permissions: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['PermissionArgs']]]]] = None, role_definition_id: Optional[pulumi.Input[str]] = None, role_name: Optional[pulumi.Input[str]] = None, role_type: Optional[pulumi.Input[str]] = None, scope: Optional[pulumi.Input[str]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = RoleDefinitionArgs.__new__(RoleDefinitionArgs) __props__.__dict__["assignable_scopes"] = assignable_scopes __props__.__dict__["description"] = description __props__.__dict__["permissions"] = permissions __props__.__dict__["role_definition_id"] = role_definition_id __props__.__dict__["role_name"] = role_name __props__.__dict__["role_type"] = role_type if scope is None and not opts.urn: raise TypeError("Missing required property 'scope'") __props__.__dict__["scope"] = scope __props__.__dict__["name"] = None __props__.__dict__["type"] = None alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="azure-nextgen:authorization/v20180101preview:RoleDefinition"), pulumi.Alias(type_="azure-native:authorization:RoleDefinition"), pulumi.Alias(type_="azure-nextgen:authorization:RoleDefinition"), pulumi.Alias(type_="azure-native:authorization/v20150701:RoleDefinition"), pulumi.Alias(type_="azure-nextgen:authorization/v20150701:RoleDefinition")]) opts = pulumi.ResourceOptions.merge(opts, alias_opts) super(RoleDefinition, __self__).__init__( 'azure-native:authorization/v20180101preview:RoleDefinition', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None) -> 'RoleDefinition': """ Get an existing RoleDefinition resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = RoleDefinitionArgs.__new__(RoleDefinitionArgs) __props__.__dict__["assignable_scopes"] = None __props__.__dict__["description"] = None __props__.__dict__["name"] = None __props__.__dict__["permissions"] = None __props__.__dict__["role_name"] = None __props__.__dict__["role_type"] = None __props__.__dict__["type"] = None return RoleDefinition(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="assignableScopes") def assignable_scopes(self) -> pulumi.Output[Optional[Sequence[str]]]: """ Role definition assignable scopes. """ return pulumi.get(self, "assignable_scopes") @property @pulumi.getter def description(self) -> pulumi.Output[Optional[str]]: """ The role definition description. """ return pulumi.get(self, "description") @property @pulumi.getter def name(self) -> pulumi.Output[str]: """ The role definition name. """ return pulumi.get(self, "name") @property @pulumi.getter def permissions(self) -> pulumi.Output[Optional[Sequence['outputs.PermissionResponse']]]: """ Role definition permissions. """ return pulumi.get(self, "permissions") @property @pulumi.getter(name="roleName") def role_name(self) -> pulumi.Output[Optional[str]]: """ The role name. """ return pulumi.get(self, "role_name") @property @pulumi.getter(name="roleType") def role_type(self) -> pulumi.Output[Optional[str]]: """ The role type. """ return pulumi.get(self, "role_type") @property @pulumi.getter def type(self) -> pulumi.Output[str]: """ The role definition type. """ return pulumi.get(self, "type")
[ 1, 529, 9507, 29958, 15348, 29914, 4691, 29914, 29886, 352, 15547, 29918, 17688, 29918, 11487, 29914, 8921, 2133, 29914, 29894, 29906, 29900, 29896, 29947, 29900, 29896, 29900, 29896, 25347, 29914, 12154, 29918, 16553, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14137, 29922, 9420, 29899, 29947, 13, 29937, 18610, 399, 25614, 29901, 445, 934, 471, 5759, 491, 278, 27477, 15547, 12967, 3251, 1061, 29889, 18610, 13, 29937, 18610, 1938, 451, 3863, 491, 1361, 6521, 366, 29915, 276, 3058, 366, 1073, 825, 366, 526, 2599, 29991, 18610, 13, 13, 5215, 18116, 13, 5215, 9505, 15547, 13, 5215, 9505, 15547, 29889, 15634, 13, 3166, 19229, 1053, 3139, 29892, 341, 20304, 29892, 28379, 29892, 922, 3910, 29892, 7761, 29892, 975, 1359, 13, 3166, 2023, 1053, 903, 4422, 1907, 13, 3166, 869, 1053, 14391, 13, 3166, 869, 29918, 2080, 29879, 1053, 334, 13, 13, 1649, 497, 1649, 353, 6024, 16727, 14683, 7883, 742, 525, 16727, 14683, 2033, 13, 13, 29992, 29886, 352, 15547, 29889, 2080, 29918, 1853, 13, 1990, 1528, 280, 14683, 7883, 29901, 13, 1678, 822, 4770, 2344, 12035, 1649, 1311, 1649, 29892, 334, 29892, 13, 462, 6874, 29901, 9505, 15547, 29889, 4290, 29961, 710, 1402, 13, 462, 3566, 519, 29918, 21785, 267, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 5262, 353, 6213, 29892, 13, 462, 6139, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 11239, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 1839, 27293, 7883, 2033, 5262, 29962, 353, 6213, 29892, 13, 462, 6297, 29918, 16553, 29918, 333, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 6297, 29918, 978, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 6297, 29918, 1853, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 1125, 13, 4706, 9995, 13, 4706, 450, 731, 310, 6273, 363, 3386, 292, 263, 1528, 280, 14683, 6503, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6874, 29901, 450, 6874, 310, 278, 6297, 5023, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 29962, 3566, 519, 29918, 21785, 267, 29901, 1528, 280, 5023, 3566, 519, 16505, 267, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6139, 29901, 450, 6297, 5023, 6139, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 1839, 27293, 7883, 2033, 5262, 11239, 29901, 1528, 280, 5023, 11239, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6297, 29918, 16553, 29918, 333, 29901, 450, 3553, 310, 278, 6297, 5023, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6297, 29918, 978, 29901, 450, 6297, 1024, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6297, 29918, 1853, 29901, 450, 6297, 1134, 29889, 13, 4706, 9995, 13, 4706, 9505, 15547, 29889, 842, 22168, 1311, 1649, 29892, 376, 6078, 613, 6874, 29897, 13, 4706, 565, 3566, 519, 29918, 21785, 267, 338, 451, 6213, 29901, 13, 9651, 9505, 15547, 29889, 842, 22168, 1311, 1649, 29892, 376, 16645, 519, 29918, 21785, 267, 613, 3566, 519, 29918, 21785, 267, 29897, 13, 4706, 565, 6139, 338, 451, 6213, 29901, 13, 9651, 9505, 15547, 29889, 842, 22168, 1311, 1649, 29892, 376, 8216, 613, 6139, 29897, 13, 4706, 565, 11239, 338, 451, 6213, 29901, 13, 9651, 9505, 15547, 29889, 842, 22168, 1311, 1649, 29892, 376, 17858, 6847, 613, 11239, 29897, 13, 4706, 565, 6297, 29918, 16553, 29918, 333, 338, 451, 6213, 29901, 13, 9651, 9505, 15547, 29889, 842, 22168, 1311, 1649, 29892, 376, 12154, 29918, 16553, 29918, 333, 613, 6297, 29918, 16553, 29918, 333, 29897, 13, 4706, 565, 6297, 29918, 978, 338, 451, 6213, 29901, 13, 9651, 9505, 15547, 29889, 842, 22168, 1311, 1649, 29892, 376, 12154, 29918, 978, 613, 6297, 29918, 978, 29897, 13, 4706, 565, 6297, 29918, 1853, 338, 451, 6213, 29901, 13, 9651, 9505, 15547, 29889, 842, 22168, 1311, 1649, 29892, 376, 12154, 29918, 1853, 613, 6297, 29918, 1853, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 13, 1678, 822, 6874, 29898, 1311, 29897, 1599, 9505, 15547, 29889, 4290, 29961, 710, 5387, 13, 4706, 9995, 13, 4706, 450, 6874, 310, 278, 6297, 5023, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 6078, 1159, 13, 13, 1678, 732, 6078, 29889, 842, 357, 13, 1678, 822, 6874, 29898, 1311, 29892, 995, 29901, 9505, 15547, 29889, 4290, 29961, 710, 29962, 1125, 13, 4706, 9505, 15547, 29889, 842, 29898, 1311, 29892, 376, 6078, 613, 995, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 29898, 978, 543, 16645, 519, 4421, 459, 267, 1159, 13, 1678, 822, 3566, 519, 29918, 21785, 267, 29898, 1311, 29897, 1599, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 5262, 29901, 13, 4706, 9995, 13, 4706, 1528, 280, 5023, 3566, 519, 16505, 267, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 16645, 519, 29918, 21785, 267, 1159, 13, 13, 1678, 732, 16645, 519, 29918, 21785, 267, 29889, 842, 357, 13, 1678, 822, 3566, 519, 29918, 21785, 267, 29898, 1311, 29892, 995, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 5262, 1125, 13, 4706, 9505, 15547, 29889, 842, 29898, 1311, 29892, 376, 16645, 519, 29918, 21785, 267, 613, 995, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 13, 1678, 822, 6139, 29898, 1311, 29897, 1599, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 29901, 13, 4706, 9995, 13, 4706, 450, 6297, 5023, 6139, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 8216, 1159, 13, 13, 1678, 732, 8216, 29889, 842, 357, 13, 1678, 822, 6139, 29898, 1311, 29892, 995, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 1125, 13, 4706, 9505, 15547, 29889, 842, 29898, 1311, 29892, 376, 8216, 613, 995, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 13, 1678, 822, 11239, 29898, 1311, 29897, 1599, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 1839, 27293, 7883, 2033, 5262, 5387, 13, 4706, 9995, 13, 4706, 1528, 280, 5023, 11239, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 17858, 6847, 1159, 13, 13, 1678, 732, 17858, 6847, 29889, 842, 357, 13, 1678, 822, 11239, 29898, 1311, 29892, 995, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 1839, 27293, 7883, 2033, 5262, 29962, 1125, 13, 4706, 9505, 15547, 29889, 842, 29898, 1311, 29892, 376, 17858, 6847, 613, 995, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 29898, 978, 543, 12154, 14683, 1204, 1159, 13, 1678, 822, 6297, 29918, 16553, 29918, 333, 29898, 1311, 29897, 1599, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 29901, 13, 4706, 9995, 13, 4706, 450, 3553, 310, 278, 6297, 5023, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 12154, 29918, 16553, 29918, 333, 1159, 13, 13, 1678, 732, 12154, 29918, 16553, 29918, 333, 29889, 842, 357, 13, 1678, 822, 6297, 29918, 16553, 29918, 333, 29898, 1311, 29892, 995, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 1125, 13, 4706, 9505, 15547, 29889, 842, 29898, 1311, 29892, 376, 12154, 29918, 16553, 29918, 333, 613, 995, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 29898, 978, 543, 12154, 1170, 1159, 13, 1678, 822, 6297, 29918, 978, 29898, 1311, 29897, 1599, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 29901, 13, 4706, 9995, 13, 4706, 450, 6297, 1024, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 12154, 29918, 978, 1159, 13, 13, 1678, 732, 12154, 29918, 978, 29889, 842, 357, 13, 1678, 822, 6297, 29918, 978, 29898, 1311, 29892, 995, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 1125, 13, 4706, 9505, 15547, 29889, 842, 29898, 1311, 29892, 376, 12154, 29918, 978, 613, 995, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 29898, 978, 543, 12154, 1542, 1159, 13, 1678, 822, 6297, 29918, 1853, 29898, 1311, 29897, 1599, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 29901, 13, 4706, 9995, 13, 4706, 450, 6297, 1134, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 12154, 29918, 1853, 1159, 13, 13, 1678, 732, 12154, 29918, 1853, 29889, 842, 357, 13, 1678, 822, 6297, 29918, 1853, 29898, 1311, 29892, 995, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 1125, 13, 4706, 9505, 15547, 29889, 842, 29898, 1311, 29892, 376, 12154, 29918, 1853, 613, 995, 29897, 13, 13, 13, 1990, 1528, 280, 14683, 29898, 29886, 352, 15547, 29889, 7281, 6848, 1125, 13, 1678, 732, 957, 1359, 13, 1678, 822, 4770, 2344, 12035, 1649, 1311, 1649, 29892, 13, 462, 6503, 29918, 978, 29901, 851, 29892, 13, 462, 29111, 29901, 28379, 29961, 29886, 352, 15547, 29889, 6848, 5856, 29962, 353, 6213, 29892, 13, 462, 3566, 519, 29918, 21785, 267, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 5262, 353, 6213, 29892, 13, 462, 6139, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 11239, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 29886, 352, 15547, 29889, 4290, 1542, 1839, 27293, 7883, 2033, 5262, 5262, 353, 6213, 29892, 13, 462, 6297, 29918, 16553, 29918, 333, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 6297, 29918, 978, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 6297, 29918, 1853, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 6874, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 4770, 11030, 1649, 29922, 8516, 1125, 13, 4706, 9995, 13, 4706, 1528, 280, 5023, 29889, 13, 13, 4706, 584, 3207, 851, 6503, 29918, 978, 29901, 450, 1024, 310, 278, 6503, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 6848, 5856, 29111, 29901, 25186, 363, 278, 6503, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 29962, 3566, 519, 29918, 21785, 267, 29901, 1528, 280, 5023, 3566, 519, 16505, 267, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6139, 29901, 450, 6297, 5023, 6139, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 29886, 352, 15547, 29889, 4290, 1542, 1839, 27293, 7883, 2033, 5262, 29962, 11239, 29901, 1528, 280, 5023, 11239, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6297, 29918, 16553, 29918, 333, 29901, 450, 3553, 310, 278, 6297, 5023, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6297, 29918, 978, 29901, 450, 6297, 1024, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6297, 29918, 1853, 29901, 450, 6297, 1134, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 6874, 29901, 450, 6874, 310, 278, 6297, 5023, 29889, 13, 4706, 9995, 13, 4706, 2023, 13, 1678, 732, 957, 1359, 13, 1678, 822, 4770, 2344, 12035, 1649, 1311, 1649, 29892, 13, 462, 6503, 29918, 978, 29901, 851, 29892, 13, 462, 6389, 29901, 1528, 280, 14683, 7883, 29892, 13, 462, 29111, 29901, 28379, 29961, 29886, 352, 15547, 29889, 6848, 5856, 29962, 353, 6213, 1125, 13, 4706, 9995, 13, 4706, 1528, 280, 5023, 29889, 13, 13, 4706, 584, 3207, 851, 6503, 29918, 978, 29901, 450, 1024, 310, 278, 6503, 29889, 13, 4706, 584, 3207, 1528, 280, 14683, 7883, 6389, 29901, 450, 6273, 304, 671, 304, 19450, 445, 6503, 29915, 29879, 4426, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 6848, 5856, 29111, 29901, 25186, 363, 278, 6503, 29889, 13, 4706, 9995, 13, 4706, 2023, 13, 1678, 822, 4770, 2344, 12035, 1649, 1311, 1649, 29892, 6503, 29918, 978, 29901, 851, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 6503, 29918, 5085, 29892, 29111, 353, 903, 4422, 1907, 29889, 657, 29918, 10314, 29918, 5085, 29918, 25707, 29898, 16727, 14683, 7883, 29892, 9505, 15547, 29889, 6848, 5856, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 4706, 565, 6503, 29918, 5085, 338, 451, 6213, 29901, 13, 9651, 4770, 1311, 1649, 3032, 7564, 29918, 2344, 29898, 10314, 29918, 978, 29892, 29111, 29892, 3579, 10314, 29918, 5085, 17255, 8977, 1649, 29897, 13, 4706, 1683, 29901, 13, 9651, 4770, 1311, 1649, 3032, 7564, 29918, 2344, 29898, 10314, 29918, 978, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 822, 903, 7564, 29918, 2344, 22168, 1311, 1649, 29892, 13, 462, 6503, 29918, 978, 29901, 851, 29892, 13, 462, 29111, 29901, 28379, 29961, 29886, 352, 15547, 29889, 6848, 5856, 29962, 353, 6213, 29892, 13, 462, 3566, 519, 29918, 21785, 267, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 5262, 353, 6213, 29892, 13, 462, 6139, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 11239, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 20529, 29961, 29886, 352, 15547, 29889, 4290, 29961, 29886, 352, 15547, 29889, 4290, 1542, 1839, 27293, 7883, 2033, 5262, 5262, 353, 6213, 29892, 13, 462, 6297, 29918, 16553, 29918, 333, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 6297, 29918, 978, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 6297, 29918, 1853, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 6874, 29901, 28379, 29961, 29886, 352, 15547, 29889, 4290, 29961, 710, 5262, 353, 6213, 29892, 13, 462, 4770, 11030, 1649, 29922, 8516, 1125, 13, 4706, 565, 29111, 338, 6213, 29901, 13, 9651, 29111, 353, 9505, 15547, 29889, 6848, 5856, 580, 13, 4706, 565, 451, 338, 8758, 29898, 25707, 29892, 9505, 15547, 29889, 6848, 5856, 1125, 13, 9651, 12020, 20948, 877, 1252, 6021, 6503, 3987, 304, 367, 263, 18981, 5856, 2777, 1495, 13, 4706, 565, 29111, 29889, 3259, 338, 6213, 29901, 13, 9651, 29111, 29889, 3259, 353, 903, 4422, 1907, 29889, 657, 29918, 3259, 580, 13, 4706, 565, 29111, 29889, 333, 338, 6213, 29901, 13, 9651, 565, 4770, 11030, 1649, 338, 451, 6213, 29901, 13, 18884, 12020, 20948, 877, 1649, 11030, 1649, 338, 871, 2854, 746, 4502, 297, 10296, 411, 263, 2854, 29111, 29889, 333, 304, 679, 385, 5923, 6503, 1495, 13, 9651, 4770, 11030, 1649, 353, 1528, 280, 14683, 7883, 17255, 1482, 12035, 16727, 14683, 7883, 29897, 13, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 16645, 519, 29918, 21785, 267, 3108, 353, 3566, 519, 29918, 21785, 267, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 8216, 3108, 353, 6139, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 17858, 6847, 3108, 353, 11239, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 12154, 29918, 16553, 29918, 333, 3108, 353, 6297, 29918, 16553, 29918, 333, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 12154, 29918, 978, 3108, 353, 6297, 29918, 978, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 12154, 29918, 1853, 3108, 353, 6297, 29918, 1853, 13, 9651, 565, 6874, 338, 6213, 322, 451, 29111, 29889, 595, 29901, 13, 18884, 12020, 20948, 703, 18552, 292, 3734, 2875, 525, 6078, 29915, 1159, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 6078, 3108, 353, 6874, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 978, 3108, 353, 6213, 13, 9651, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 1853, 3108, 353, 6213, 13, 4706, 13995, 29918, 25707, 353, 9505, 15547, 29889, 6848, 5856, 29898, 2606, 2129, 11759, 29886, 352, 15547, 29889, 29909, 18849, 29898, 1853, 29918, 543, 17688, 29899, 4622, 1885, 29901, 8921, 2133, 29914, 29894, 29906, 29900, 29896, 29947, 29900, 29896, 29900, 29896, 25347, 29901, 16727, 14683, 4968, 9505, 15547, 29889, 29909, 18849, 29898, 1853, 29918, 543, 17688, 29899, 11487, 29901, 8921, 2133, 29901, 16727, 14683, 4968, 9505, 15547, 29889, 29909, 18849, 29898, 1853, 29918, 543, 17688, 29899, 4622, 1885, 29901, 8921, 2133, 29901, 16727, 14683, 4968, 9505, 15547, 29889, 29909, 18849, 29898, 1853, 29918, 543, 17688, 29899, 11487, 29901, 8921, 2133, 29914, 29894, 29906, 29900, 29896, 29945, 29900, 29955, 29900, 29896, 29901, 16727, 14683, 4968, 9505, 15547, 29889, 29909, 18849, 29898, 1853, 29918, 543, 17688, 29899, 4622, 1885, 29901, 8921, 2133, 29914, 29894, 29906, 29900, 29896, 29945, 29900, 29955, 29900, 29896, 29901, 16727, 14683, 1159, 2314, 13, 4706, 29111, 353, 9505, 15547, 29889, 6848, 5856, 29889, 14634, 29898, 25707, 29892, 13995, 29918, 25707, 29897, 13, 4706, 2428, 29898, 16727, 14683, 29892, 4770, 1311, 1649, 467, 1649, 2344, 12035, 13, 9651, 525, 17688, 29899, 11487, 29901, 8921, 2133, 29914, 29894, 29906, 29900, 29896, 29947, 29900, 29896, 29900, 29896, 25347, 29901, 16727, 14683, 742, 13, 9651, 6503, 29918, 978, 29892, 13, 9651, 4770, 11030, 1649, 29892, 13, 9651, 29111, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 679, 29898, 10314, 29918, 978, 29901, 851, 29892, 13, 9651, 1178, 29901, 9505, 15547, 29889, 4290, 29961, 710, 1402, 13, 9651, 29111, 29901, 28379, 29961, 29886, 352, 15547, 29889, 6848, 5856, 29962, 353, 6213, 29897, 1599, 525, 16727, 14683, 2396, 13, 4706, 9995, 13, 4706, 3617, 385, 5923, 1528, 280, 14683, 6503, 29915, 29879, 2106, 411, 278, 2183, 1024, 29892, 1178, 29892, 322, 13136, 4805, 13, 4706, 4426, 1304, 304, 4021, 1598, 278, 16280, 29889, 13, 13, 4706, 584, 3207, 851, 6503, 29918, 978, 29901, 450, 5412, 1024, 310, 278, 9819, 6503, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 4290, 29961, 710, 29962, 1178, 29901, 450, 5412, 13113, 3553, 310, 278, 6503, 304, 16280, 29889, 13, 4706, 584, 3207, 9505, 15547, 29889, 6848, 5856, 29111, 29901, 25186, 363, 278, 6503, 29889, 13, 4706, 9995, 13, 4706, 29111, 353, 9505, 15547, 29889, 6848, 5856, 29889, 14634, 29898, 25707, 29892, 9505, 15547, 29889, 6848, 5856, 29898, 333, 29922, 333, 876, 13, 13, 4706, 4770, 11030, 1649, 353, 1528, 280, 14683, 7883, 17255, 1482, 12035, 16727, 14683, 7883, 29897, 13, 13, 4706, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 16645, 519, 29918, 21785, 267, 3108, 353, 6213, 13, 4706, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 8216, 3108, 353, 6213, 13, 4706, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 978, 3108, 353, 6213, 13, 4706, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 17858, 6847, 3108, 353, 6213, 13, 4706, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 12154, 29918, 978, 3108, 353, 6213, 13, 4706, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 12154, 29918, 1853, 3108, 353, 6213, 13, 4706, 4770, 11030, 1649, 17255, 8977, 1649, 3366, 1853, 3108, 353, 6213, 13, 4706, 736, 1528, 280, 14683, 29898, 10314, 29918, 978, 29892, 29111, 29922, 25707, 29892, 4770, 11030, 1649, 29922, 1649, 11030, 1649, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 29898, 978, 543, 16645, 519, 4421, 459, 267, 1159, 13, 1678, 822, 3566, 519, 29918, 21785, 267, 29898, 1311, 29897, 1599, 9505, 15547, 29889, 6466, 29961, 27636, 29961, 20529, 29961, 710, 5262, 5387, 13, 4706, 9995, 13, 4706, 1528, 280, 5023, 3566, 519, 16505, 267, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 16645, 519, 29918, 21785, 267, 1159, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 13, 1678, 822, 6139, 29898, 1311, 29897, 1599, 9505, 15547, 29889, 6466, 29961, 27636, 29961, 710, 5262, 29901, 13, 4706, 9995, 13, 4706, 450, 6297, 5023, 6139, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 8216, 1159, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 13, 1678, 822, 1024, 29898, 1311, 29897, 1599, 9505, 15547, 29889, 6466, 29961, 710, 5387, 13, 4706, 9995, 13, 4706, 450, 6297, 5023, 1024, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 978, 1159, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 13, 1678, 822, 11239, 29898, 1311, 29897, 1599, 9505, 15547, 29889, 6466, 29961, 27636, 29961, 20529, 1839, 4905, 29879, 29889, 27293, 5103, 2033, 5262, 29901, 13, 4706, 9995, 13, 4706, 1528, 280, 5023, 11239, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 17858, 6847, 1159, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 29898, 978, 543, 12154, 1170, 1159, 13, 1678, 822, 6297, 29918, 978, 29898, 1311, 29897, 1599, 9505, 15547, 29889, 6466, 29961, 27636, 29961, 710, 5262, 29901, 13, 4706, 9995, 13, 4706, 450, 6297, 1024, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 12154, 29918, 978, 1159, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 29898, 978, 543, 12154, 1542, 1159, 13, 1678, 822, 6297, 29918, 1853, 29898, 1311, 29897, 1599, 9505, 15547, 29889, 6466, 29961, 27636, 29961, 710, 5262, 29901, 13, 4706, 9995, 13, 4706, 450, 6297, 1134, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 12154, 29918, 1853, 1159, 13, 13, 1678, 732, 6799, 13, 1678, 732, 29886, 352, 15547, 29889, 657, 357, 13, 1678, 822, 1134, 29898, 1311, 29897, 1599, 9505, 15547, 29889, 6466, 29961, 710, 5387, 13, 4706, 9995, 13, 4706, 450, 6297, 5023, 1134, 29889, 13, 4706, 9995, 13, 4706, 736, 9505, 15547, 29889, 657, 29898, 1311, 29892, 376, 1853, 1159, 13, 13, 2 ]
modeloMarkowitz.py
HubertRonald/ModeloMarkowitz
1
125109
import numpy as np import pandas as pd import cvxopt as opt from cvxopt import solvers #, blas from matplotlib import pyplot as plt plt.style.use('seaborn') np.random.seed(9062020) # Cargar y limpiar datos df = pd.read_csv("stocks.csv", sep=",", engine="python") #���Field 1 la columna tiene caracteres extranios df.columns = ['Field1' if i == 0 else x for i, x in enumerate(df.columns)] df.set_index(df.columns[0], inplace=True) # Seleccionamos 5 activos al azar activos = np.random.permutation(df.columns)[:5] plt.figure(figsize=(8,6)) plt.title('Historico de Algunos Activos', color='gray') for activo in activos: plt.plot(df[activo].to_numpy(), label=activo) plt.ylabel('Precio del Activo', color='gray') plt.xlabel('Observaciones', color='gray') plt.legend(loc='upper left') # Por que usar rendimiento logaritmicos # https://quantdare.com/por-que-usar-rendimientos-logaritmicos/ df = df / df.shift(1) df.dropna(inplace=True) log_df = np.log(df) print(log_df) # Grafico con Rendimientos historicos plt.figure(figsize=(8,6)) plt.title('Rendimiento de Todos los Activos', color='gray') plt.plot(df.to_numpy(), alpha=0.2) plt.ylabel('Rendimiento del Activo', color='gray') plt.xlabel('Observaciones', color='gray') def metricas_historicas_portafolio(portafolio, dias_anual): """ Da un pequenio reporte sobre las observaciones de cada activo contenido en el portafolio, para devolver finalmente dos matrices `portafolio`: es un dataframe de observaciones (filas) por activos (columnas) historico `dias_anual`: es un entero que indica cuantos dias tiene el anio, asumiendose para ellos que las observaciones contenidas en `portafolio` son diarias `return`: devuelve las matrices o arrays de rendimientos esperados y la de covarianza del portafolio historico, asi como el numero de activos """ # Metricas Historicas activos_en_portafolio = portafolio.shape[1] rendimientos_anual = dias_anual * portafolio.mean() sigma_de_rendimientos_anual = dias_anual * portafolio.std() varianza_de_rendimientos_anual = dias_anual * portafolio.std() ** 2 # diagonal de la covarianza de rendimientos covarianza_de_rendimientos_anual = dias_anual * portafolio.cov() # Reporte de Historicos print(f"\nNumero de Activos:\n{activos_en_portafolio}") print(f"\nRendimiento:\n{rendimientos_anual}") print(f"\nDesviacion Estandar:\n{sigma_de_rendimientos_anual}") print(f"\nVarianza:\n{varianza_de_rendimientos_anual}") print(f"\nCovarianza:\n{covarianza_de_rendimientos_anual}") # Matrices con las Estadisticas Hitoricas de Interes # la variable `C`es mayuscula p = np.asmatrix(rendimientos_anual.to_numpy()) C = np.asmatrix(covarianza_de_rendimientos_anual.to_numpy()) return p, C, activos_en_portafolio p, C, numero_de_activos = metricas_historicas_portafolio(log_df, 252) #print(p ,p.shape[1]) def resultados_portafolio(p,w,C): """ Dados unos pesos de colocacion para un portafolio y teniendose los rendimientos y covarianzas historicas, se obtiene el rendimiento y volatilidad del portafolio `p`: matriz con rendimientos historicos del portafolio `w`: peso que se empleara para colocar los los fondos en los activos correspondientes del portafolio `C`: matriz con la covarianza historico del portafolio `return`: el redimiento y riesgo (volatilida) del portafolio """ mu = w * p.T # Rendimiento Esperado sigma = np.sqrt(w * C * w.T) # Volatilidad return mu, sigma def simular_pesos_portafolio(numero_de_activos): """ Generar pesos aleatorios para cada activo en el portafolio `numero_de_activos`: es entero `return`:El peso de cada uno de los activos en el portafolio cuya suma es 1 como matriz """ pesos = np.random.random(numero_de_activos) pesos *= sum([np.random.binomial(1, 0.08, numero_de_activos) for _ in range(2)]) pesos = np.asmatrix(pesos / sum(pesos) ) return pesos def simular_portafolio(p, C, numero_de_activos, libre_riesgo=0, limite_volatilidad=1): """ Genera el redimiento y la desviacion estandar de una posible combinacion en la inversion de cada activo para un portafolio dado `p`: matriz con rendimientos historicos del portafolio `C`: matriz con la covarianza historico del portafolio `numero_de_activos`: entero que indica la cantidad de activos en el portafolio `libre de riesgo`: flotante que va de 0 a 1 `limite_volatilidad`: es para mantener la volatilidad hasta un tope durante la simulacion `return`: el peso de inversion, el rendimiento esperado (mu) y la desviacion estandar (sigma) tambien conocida como volatilidad para el portafolio generado así como el Sharpe Ratio todas las salidas son arrays """ # Generar una posible combinacion del portafolio p = p w = simular_pesos_portafolio(numero_de_activos) C = C mu, sigma = resultados_portafolio(p,w,C) sharpe_ratio = (mu - libre_riesgo) / sigma # Esta recursividad reduce los valores atípicos # para mantener el portafolio de interés # tambien se puede desarrollar con `while` pero # se requiere más codigo if sigma > limite_volatilidad: return simular_portafolio(p, C, numero_de_activos, libre_riesgo, limite_volatilidad) return w, mu, sigma, sharpe_ratio peso_activos, rendimiento, volatilidad, sharpe_ratio = simular_portafolio(p, C, numero_de_activos) print("-"*40) print('---- Portafolio Simulado ----') print("-"*40) print(f"\nSharpe Ratio: {sharpe_ratio}") print(f""" Pesos Del Portafolio Simulado:\n{peso_activos} \nLos Pesos Suman: {peso_activos.sum():.4f} """) print(f"\nRedimiento del Portafolio Simulado:{rendimiento}") print(f"\nVolatilidad del Portafolio Simulado:{volatilidad}\n") def simulacion_de_portafolios(numero_de_portafolios, p, C, numero_de_activos, libre_riesgo=0, limite_volatilidad=1): """ Genera los rendimientos y volatidades para un conjunto de portafolios `numero_de_portafolios`: entero que indica la cantidad de replicas o simulaciones a efectuarse `p`: matriz con rendimientos historicos del portafolio `C`: matriz con la covarianza historico del portafolio `numero_de_activos`: entero que indica la cantidad de activos en el portafolio `libre de riesgo`: flotante que va de 0 a 1 `limite_volatilidad`: es para mantener la volatilidad hasta un tope durante la simulacion `return`: los pesos, rendimientos esperados así como las volatidades `desviacion estandar` para cada uno de los portafolios simulados """ pesos, rendimientos, volatilidades, sharper_ratios = zip(*[ simular_portafolio(p, C, numero_de_activos, libre_riesgo, limite_volatilidad) for _ in range(numero_de_portafolios) ]) pesos, rendimientos, volatilidades, sharper_ratios = \ np.array(pesos), np.array(rendimientos), np.array(volatilidades), np.array(sharper_ratios) return pesos, rendimientos, volatilidades, sharper_ratios pesos, rendimientos, volatilidades, sharper_ratios = simulacion_de_portafolios( numero_de_portafolios=1000, p=p, C=C, numero_de_activos=numero_de_activos, libre_riesgo=0 ) # Metricas Sharper def rsharpe_maximo(sharper_ratios, rendimientos, volatilidades): maximo_sharpe_ratio = sharper_ratios.max() indice_maximo_sharpe_ratio = sharper_ratios.argmax() pesos_optimos_simulados = pesos[indice_maximo_sharpe_ratio, :] maximo_sharpe_ratio_rendimiento = rendimientos[indice_maximo_sharpe_ratio] maximo_sharpe_ratio_volatilidad = volatilidades[indice_maximo_sharpe_ratio] print("-" * 50) print('---- Estadisticas Sharper Ratio ----') print("-" * 50) print(f"\nMaximo Sharpe Ratio: {maximo_sharpe_ratio}") print(f"""Pesos Del Portafolio:\n{pesos_optimos_simulados} \nLos Pesos Suman: {pesos_optimos_simulados.sum():.4f} """ ) print(f"\nRedimiento del Maximo Sharpe Ratio:{maximo_sharpe_ratio_rendimiento}") print(f"\nVolatilidad del Maximo Sharpe Ratio:{maximo_sharpe_ratio_volatilidad}\n") return maximo_sharpe_ratio, maximo_sharpe_ratio_volatilidad, maximo_sharpe_ratio_rendimiento # Estadisticas de Montecarlo maximo_sharpe_ratio, maximo_sharpe_ratio_volatilidad, maximo_sharpe_ratio_rendimiento = rsharpe_maximo(sharper_ratios, rendimientos, volatilidades) plt.figure(figsize=(8,6)) plt.title('Rendimientos y Volatilidades\n Portafolios Simulados', color='gray') plt.scatter(volatilidades, rendimientos, c=sharper_ratios, cmap='cool') plt.colorbar(label=r"$Sharpe\ Ratio$") # Optimo Sharpe Ratio Simulado plt.scatter( maximo_sharpe_ratio_volatilidad, maximo_sharpe_ratio_rendimiento, c='orange', s=60, edgecolors='gray', label=f'Sharpe Ratio Optimo Simulado = {maximo_sharpe_ratio:.4f}' ) plt.ylabel(r'$Rendimiento$', color='gray') plt.xlabel(r'$Volatilidad\ \sigma$', color='gray') plt.legend(loc="upper left") # Resolviendo el modelo cuadratico # http://cvxopt.org/userguide/coneprog.html # http://cvxopt.org/examples/book/portfolio.html # http://cvxopt.org/examples/tutorial/qp.html def portafolio_optimo(p, C, numero_de_activos): """ Genera los puntos para la Frontera Eficiente `p`: matriz con rendimientos historicos del portafolio `C`: matriz con la covarianza historico del portafolio `numero_de_activos`: entero que indica la cantidad de activos en el portafolio `retorna`: arrays, de los pesos de cada portafolio correspondientes a cada punto de la frontera eficiente, siendo dichos puntos el par rendimiento y volatilidad """ # Se establece saltos discretos para hallar la # la frontera eficiente estos seran los # `targets` u objetivos que se fijan para optimizar N = 100 n = numero_de_activos #mus = np.power(10, 5 * np.arange(N) / N - 1) # tiene que ser lista tolist() mus = [ 10**(5.0*t/N-1.0) for t in range(N) ] # convertir el p y C a matrices del tipo cvxopt # en el caso de p se trabaja con su transpuesta pbar = opt.matrix(p.T) S = opt.matrix(C) # Crear las matrices de restricciones # Gx <= h G = -opt.matrix(np.eye(n)) # matriz identidad negativa n x n h = opt.matrix(0.0, (n ,1)) # Ax = b A = opt.matrix(1.0, (1, n)) b = opt.matrix(1.0) # La suma de los pesos es 1 # Calcular los pesos de la frontera eficiente # Empleando Programacion Cuadratica # Pero primero silenciamos el solver (es opcional) solvers.options['show_progress'] = False portafolios = [solvers.qp(mu*S, -pbar, G, h, A, b)['x'] for mu in mus] # Calcular los rendimientos y volatilidades o riesgos # para la frontera eficiente # Estas implementaciones funcionan... hay que importar "blas" # pero el codigo que esta fuera de este codigo # requiere que se redimensionen los rendimientos, volatilidades # para que funcionen #rendimientos = [blas.dot(pbar, x) for x in portafolios] #volatilidades = [np.sqrt(blas.dot(x, S*x)) for x in portafolios] rendimientos, volatilidades = zip(*[ resultados_portafolio(p, np.array(w).T, C) for w in portafolios ]) # Calcular el portafolio optimo #pesos = solvers.qp(opt.matrix(x1 * S), -pbar, G, h, A, b)['x'] # # No funciona para lo que se quiere hacer mas adelante pesos = [np.asarray(x) for x in portafolios] pesos = np.asarray(pesos) rendimientos = np.asarray(rendimientos) volatilidades = np.asarray(volatilidades) return pesos, rendimientos, volatilidades w_optimos, mu_optimos, sigma_optimos = portafolio_optimo(p, C, numero_de_activos) ######################################## # Frontera Eficiente y Simulacion ######################################## plt.figure(figsize=(8,6)) plt.title('Frontera eficiente', color='gray') # Frontera eficiente plt.plot(sigma_optimos.reshape((1,-1))[0], mu_optimos.reshape((1,-1))[0], 'y-o', color='gray', alpha=0.4, label='Frontera Eficiente') # Simulados plt.scatter(volatilidades, rendimientos, c=sharper_ratios, cmap='cool') plt.colorbar(label=r"$Sharpe\ Ratio$") # Optimo Sharpe Ratio Simulado plt.scatter( maximo_sharpe_ratio_volatilidad, maximo_sharpe_ratio_rendimiento, c='orange', s=60, edgecolors='gray', label=f'Sharpe Ratio Optimo Simulado = {maximo_sharpe_ratio:.4f}' ) plt.ylabel(r'$Rendimiento$', color='gray') plt.xlabel(r'$Volatilidad\ \sigma$', color='gray') plt.legend(loc="upper left") ######################################## # Ratio de Sharper ######################################## print("\nVerificar cuales suman 1: ") print(np.array([x.sum() for x in w_optimos])) filtrar_pesos_positivos = np.array([(x>=0).all() for x in w_optimos]) print("\nVerificar que todos los pesos sean >= 0: ") print(filtrar_pesos_positivos) print(w_optimos.shape, mu_optimos.shape, sigma_optimos.shape) w_optimos = w_optimos[filtrar_pesos_positivos] mu_optimos = mu_optimos [filtrar_pesos_positivos] sigma_optimos = sigma_optimos[filtrar_pesos_positivos] print("\nVerificar que todos los pesos sean >= 0: ") print(np.array([(x>=0).all() for x in w_optimos])) print(w_optimos.shape, mu_optimos.shape, sigma_optimos.shape) libre_riesgo = 0 rsharpe_optimos = (mu_optimos - libre_riesgo) / sigma_optimos rsharpe_optimos = rsharpe_optimos.reshape((1,-1)).reshape((1,-1)) # quitarle dimensiones maximo_rsharpe, maximo_rsharpe_volatilidad, maximo_rsharpe_rendimiento = rsharpe_maximo(rsharpe_optimos, mu_optimos, sigma_optimos) plt.figure(figsize=(8,6)) plt.title('Sharpers de la Frontera Eficiente\nCon Pesos no Negativos', color='gray') # Optimo Sharpe Ratio Frontera Eficiente plt.scatter( rsharpe_optimos[0].argmax(), maximo_rsharpe, c='#90ff1e', s=100, edgecolors='gray', label=f'Sharpe Ratio = {maximo_rsharpe:.4f}' ) plt.plot(rsharpe_optimos[0], 'y-o', color='dodgerblue', alpha=0.4) plt.ylabel(r'$Sharpe\ Ratio$', color='gray') plt.xlabel(r'$Observaciones$', color='gray') plt.legend(loc="upper left") ######################################## # Todo Junto: # Ratio de Sharper Optimo # Frontera Eficiente y Simulacion ######################################## w_optimos, mu_optimos, sigma_optimos = portafolio_optimo(p, C, numero_de_activos) libre_riesgo = 0 rsharpe_optimos = (mu_optimos - libre_riesgo) / sigma_optimos rsharpe_optimos = rsharpe_optimos.reshape((1,-1)).reshape((1,-1)) # quitarle dimensiones plt.figure(figsize=(8,6)) plt.title('Frontera eficiente', color='gray') # Frontera eficiente plt.plot(sigma_optimos.reshape((1,-1))[0], mu_optimos.reshape((1,-1))[0], 'y-o', color='gray', alpha=0.4, label='Frontera Eficiente') # Simulados plt.scatter(volatilidades, rendimientos, c=sharper_ratios, cmap='cool') plt.colorbar(label=r"$Sharpe\ Ratio$") # Optimo Sharpe Ratio Frontera Eficiente idx_rshape_optimo = np.where(rsharpe_optimos[0] == maximo_rsharpe) plt.scatter( sigma_optimos.reshape((1, -1))[0][idx_rshape_optimo], # eje volatilidad mu_optimos.reshape((1,-1))[0][idx_rshape_optimo], # eje rendimientos c='#90ff1e', s=100, edgecolors='gray', label=f'Sharpe Ratio Optimo = {maximo_rsharpe:.4f}' ) # Optimo Sharpe Ratio Simulado plt.scatter( maximo_sharpe_ratio_volatilidad, maximo_sharpe_ratio_rendimiento, c='orange', s=100, edgecolors='gray', label=f'Sharpe Ratio Optimo Simulado = {maximo_sharpe_ratio:.4f}' ) plt.ylabel(r'$Rendimiento$', color='gray') plt.xlabel(r'$Volatilidad\ \sigma$', color='gray') plt.legend(loc="upper left") ######################################## # Se muestran todos los lienzos ######################################## plt.show()
[ 1, 1053, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 13, 5215, 13850, 29916, 3670, 408, 3523, 13, 3166, 13850, 29916, 3670, 1053, 899, 874, 396, 29892, 1999, 294, 13, 13, 3166, 22889, 1053, 11451, 5317, 408, 14770, 13, 572, 29873, 29889, 3293, 29889, 1509, 877, 344, 370, 1398, 1495, 13, 9302, 29889, 8172, 29889, 26776, 29898, 29929, 29900, 29953, 29906, 29900, 29906, 29900, 29897, 13, 13, 13, 29937, 315, 1191, 279, 343, 2485, 1631, 279, 18683, 13, 2176, 353, 10518, 29889, 949, 29918, 7638, 703, 17712, 29879, 29889, 7638, 613, 16345, 543, 29892, 613, 6012, 543, 4691, 1159, 13, 29937, 26308, 30140, 3073, 29871, 29896, 425, 784, 398, 1056, 10258, 15215, 267, 17541, 273, 2363, 13, 2176, 29889, 13099, 353, 6024, 3073, 29896, 29915, 565, 474, 1275, 29871, 29900, 1683, 921, 363, 474, 29892, 921, 297, 26985, 29898, 2176, 29889, 13099, 4638, 13, 2176, 29889, 842, 29918, 2248, 29898, 2176, 29889, 13099, 29961, 29900, 1402, 297, 6689, 29922, 5574, 29897, 13, 13, 29937, 28051, 22643, 14054, 29871, 29945, 5039, 359, 394, 2698, 279, 13, 11236, 359, 353, 7442, 29889, 8172, 29889, 546, 6149, 362, 29898, 2176, 29889, 13099, 29897, 7503, 29945, 29962, 13, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29947, 29892, 29953, 876, 13, 572, 29873, 29889, 3257, 877, 29950, 2118, 1417, 316, 11545, 12609, 3185, 12927, 742, 2927, 2433, 21012, 1495, 13, 1454, 1044, 4243, 297, 5039, 359, 29901, 13, 1678, 14770, 29889, 5317, 29898, 2176, 29961, 627, 4243, 1822, 517, 29918, 23749, 3285, 3858, 29922, 627, 4243, 29897, 13, 572, 29873, 29889, 29891, 1643, 877, 6572, 3934, 628, 3185, 4243, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 29916, 1643, 877, 6039, 2140, 6027, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 26172, 29898, 2029, 2433, 21064, 2175, 1495, 13, 13, 29937, 7102, 712, 28336, 7697, 9043, 1480, 279, 277, 29885, 4869, 13, 29937, 2045, 597, 12150, 29881, 598, 29889, 510, 29914, 1971, 29899, 802, 29899, 375, 279, 29899, 28759, 24038, 29899, 1188, 279, 277, 29885, 4869, 29914, 13, 2176, 353, 4489, 847, 4489, 29889, 10889, 29898, 29896, 29897, 29871, 13, 2176, 29889, 8865, 1056, 29898, 262, 6689, 29922, 5574, 29897, 13, 1188, 29918, 2176, 353, 7442, 29889, 1188, 29898, 2176, 29897, 13, 2158, 29898, 1188, 29918, 2176, 29897, 13, 13, 13, 29937, 13721, 1417, 378, 390, 355, 24038, 3603, 4869, 13, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29947, 29892, 29953, 876, 13, 572, 29873, 29889, 3257, 877, 29934, 355, 9043, 316, 7561, 359, 1232, 3185, 12927, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 5317, 29898, 2176, 29889, 517, 29918, 23749, 3285, 15595, 29922, 29900, 29889, 29906, 29897, 13, 572, 29873, 29889, 29891, 1643, 877, 29934, 355, 9043, 628, 3185, 4243, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 29916, 1643, 877, 6039, 2140, 6027, 742, 2927, 2433, 21012, 1495, 13, 13, 13, 13, 1753, 12714, 294, 29918, 16211, 5070, 29918, 637, 2142, 324, 601, 29898, 637, 2142, 324, 601, 29892, 652, 294, 29918, 273, 950, 1125, 13, 1678, 9995, 13, 4706, 7266, 443, 1236, 339, 264, 601, 1634, 10069, 4166, 1869, 5820, 6027, 316, 13, 4706, 9747, 1044, 4243, 16962, 1941, 427, 560, 2011, 2142, 324, 601, 29892, 1702, 29871, 13, 4706, 316, 1555, 369, 27986, 3248, 13516, 13, 13, 4706, 421, 637, 2142, 324, 601, 6998, 831, 443, 12205, 316, 5820, 6027, 313, 1777, 294, 29897, 13, 4706, 1277, 5039, 359, 313, 4914, 294, 29897, 3603, 1417, 13, 13, 4706, 421, 29881, 3173, 29918, 273, 950, 6998, 831, 443, 875, 1489, 712, 1399, 983, 2723, 424, 359, 652, 294, 13, 4706, 10258, 560, 385, 601, 29892, 408, 15547, 355, 852, 1702, 21135, 712, 1869, 13, 4706, 5820, 6027, 16962, 8817, 427, 421, 637, 2142, 324, 601, 29952, 1487, 652, 20225, 13, 13, 4706, 421, 2457, 6998, 2906, 2491, 345, 1869, 13516, 288, 7049, 316, 7697, 24038, 13, 4706, 17451, 2255, 343, 425, 316, 18838, 13956, 1362, 628, 2011, 2142, 324, 601, 3603, 1417, 29892, 13, 4706, 28278, 1986, 560, 17910, 316, 5039, 359, 13, 1678, 9995, 13, 13, 1678, 396, 4737, 2200, 294, 4731, 5070, 13, 1678, 5039, 359, 29918, 264, 29918, 637, 2142, 324, 601, 353, 2011, 2142, 324, 601, 29889, 12181, 29961, 29896, 29962, 13, 1678, 7697, 24038, 29918, 273, 950, 353, 652, 294, 29918, 273, 950, 334, 2011, 2142, 324, 601, 29889, 12676, 580, 13, 1678, 269, 2934, 29918, 311, 29918, 28759, 24038, 29918, 273, 950, 353, 652, 294, 29918, 273, 950, 334, 2011, 2142, 324, 601, 29889, 4172, 580, 13, 1678, 722, 713, 1362, 29918, 311, 29918, 28759, 24038, 29918, 273, 950, 353, 652, 294, 29918, 273, 950, 334, 2011, 2142, 324, 601, 29889, 4172, 580, 3579, 29871, 29906, 29871, 396, 19640, 316, 425, 18838, 13956, 1362, 316, 7697, 24038, 13, 1678, 18838, 13956, 1362, 29918, 311, 29918, 28759, 24038, 29918, 273, 950, 353, 652, 294, 29918, 273, 950, 334, 2011, 2142, 324, 601, 29889, 24542, 580, 13, 13, 1678, 396, 830, 13732, 316, 4731, 4869, 13, 1678, 1596, 29898, 29888, 26732, 29876, 8009, 1489, 316, 3185, 12927, 3583, 29876, 29912, 11236, 359, 29918, 264, 29918, 637, 2142, 324, 601, 27195, 13, 1678, 1596, 29898, 29888, 26732, 29876, 29934, 355, 9043, 3583, 29876, 29912, 28759, 24038, 29918, 273, 950, 27195, 13, 1678, 1596, 29898, 29888, 26732, 29876, 4002, 6071, 12401, 382, 1689, 279, 3583, 29876, 29912, 3754, 29918, 311, 29918, 28759, 24038, 29918, 273, 950, 27195, 13, 1678, 1596, 29898, 29888, 26732, 29876, 9037, 713, 1362, 3583, 29876, 29912, 1707, 713, 1362, 29918, 311, 29918, 28759, 24038, 29918, 273, 950, 27195, 13, 1678, 1596, 29898, 29888, 26732, 29876, 29907, 586, 13956, 1362, 3583, 29876, 29912, 24542, 13956, 1362, 29918, 311, 29918, 28759, 24038, 29918, 273, 950, 27195, 13, 13, 1678, 396, 5345, 11669, 378, 1869, 22111, 4695, 294, 379, 2105, 5070, 316, 4124, 267, 13, 1678, 396, 425, 2286, 421, 29907, 29952, 267, 1122, 375, 1810, 29874, 29871, 13, 13, 1678, 282, 353, 7442, 29889, 294, 5344, 29898, 28759, 24038, 29918, 273, 950, 29889, 517, 29918, 23749, 3101, 13, 1678, 315, 353, 7442, 29889, 294, 5344, 29898, 24542, 13956, 1362, 29918, 311, 29918, 28759, 24038, 29918, 273, 950, 29889, 517, 29918, 23749, 3101, 13, 13, 1678, 736, 282, 29892, 315, 29892, 5039, 359, 29918, 264, 29918, 637, 2142, 324, 601, 13, 13, 13, 29886, 29892, 315, 29892, 17910, 29918, 311, 29918, 11236, 359, 353, 12714, 294, 29918, 16211, 5070, 29918, 637, 2142, 324, 601, 29898, 1188, 29918, 2176, 29892, 29871, 29906, 29945, 29906, 29897, 13, 29937, 2158, 29898, 29886, 1919, 29886, 29889, 12181, 29961, 29896, 2314, 13, 13, 1753, 1121, 2255, 29918, 637, 2142, 324, 601, 29898, 29886, 29892, 29893, 29892, 29907, 1125, 13, 1678, 9995, 13, 4706, 360, 2255, 22660, 8928, 359, 316, 28853, 16337, 1702, 443, 13, 4706, 2011, 2142, 324, 601, 343, 3006, 29875, 355, 852, 1232, 7697, 24038, 343, 13, 4706, 18838, 13956, 16095, 3603, 5070, 29892, 409, 14403, 3530, 560, 13, 4706, 7697, 9043, 343, 1700, 271, 309, 2368, 628, 2011, 2142, 324, 601, 13, 13, 4706, 421, 29886, 6998, 1775, 7485, 378, 7697, 24038, 3603, 4869, 628, 13, 4706, 2011, 2142, 324, 601, 13, 13, 4706, 421, 29893, 6998, 8928, 29877, 712, 409, 29593, 2518, 1702, 28853, 279, 1232, 13, 4706, 1232, 6299, 359, 427, 1232, 5039, 359, 3928, 13833, 13, 4706, 628, 2011, 2142, 324, 601, 13, 13, 539, 421, 29907, 6998, 1775, 7485, 378, 425, 18838, 13956, 1362, 3603, 1417, 628, 13, 4706, 2011, 2142, 324, 601, 13, 13, 4706, 421, 2457, 6998, 560, 2654, 9043, 343, 28201, 1484, 313, 1555, 271, 309, 1458, 29897, 13, 4706, 628, 2011, 2142, 324, 601, 13, 1678, 9995, 13, 1678, 3887, 353, 281, 334, 282, 29889, 29911, 462, 965, 396, 390, 355, 9043, 3423, 546, 912, 13, 1678, 269, 2934, 353, 7442, 29889, 3676, 29898, 29893, 334, 315, 334, 281, 29889, 29911, 29897, 965, 396, 3684, 271, 309, 2368, 13, 13, 1678, 736, 3887, 29892, 269, 2934, 13, 13, 268, 13, 13, 1753, 1027, 1070, 29918, 5547, 359, 29918, 637, 2142, 324, 601, 29898, 1949, 1489, 29918, 311, 29918, 11236, 359, 1125, 13, 1678, 9995, 29871, 13, 4706, 3251, 279, 8928, 359, 8080, 1061, 2363, 1702, 9747, 13, 4706, 1044, 4243, 427, 560, 2011, 2142, 324, 601, 13, 13, 4706, 421, 1949, 1489, 29918, 311, 29918, 11236, 359, 6998, 831, 875, 1489, 13, 13, 4706, 421, 2457, 6998, 6489, 8928, 29877, 316, 9747, 6888, 316, 1232, 29871, 13, 308, 5039, 359, 427, 560, 2011, 2142, 324, 601, 2723, 3761, 2533, 29874, 831, 29871, 29896, 13, 308, 1986, 1775, 7485, 13, 1678, 9995, 13, 1678, 8928, 359, 353, 7442, 29889, 8172, 29889, 8172, 29898, 1949, 1489, 29918, 311, 29918, 11236, 359, 29897, 13, 1678, 8928, 359, 334, 29922, 2533, 4197, 9302, 29889, 8172, 29889, 2109, 7615, 29898, 29896, 29892, 29871, 29900, 29889, 29900, 29947, 29892, 17910, 29918, 311, 29918, 11236, 359, 29897, 363, 903, 297, 3464, 29898, 29906, 29897, 2314, 13, 1678, 8928, 359, 353, 7442, 29889, 294, 5344, 29898, 5547, 359, 847, 2533, 29898, 5547, 359, 29897, 1723, 13, 13, 1678, 736, 8928, 359, 13, 13, 13, 13, 1753, 1027, 1070, 29918, 637, 2142, 324, 601, 29898, 29886, 29892, 315, 29892, 17910, 29918, 311, 29918, 11236, 359, 29892, 13220, 29918, 2722, 1484, 29922, 29900, 29892, 2485, 568, 29918, 1555, 271, 309, 2368, 29922, 29896, 1125, 13, 1678, 9995, 13, 4706, 3251, 29874, 560, 2654, 9043, 343, 425, 553, 6071, 12401, 707, 392, 279, 13, 4706, 316, 1185, 29125, 5769, 16337, 427, 425, 297, 3259, 13, 4706, 316, 9747, 1044, 4243, 1702, 443, 2011, 2142, 324, 601, 270, 912, 13, 13, 4706, 421, 29886, 6998, 1775, 7485, 378, 7697, 24038, 3603, 4869, 628, 13, 4706, 2011, 2142, 324, 601, 13, 13, 539, 421, 29907, 6998, 1775, 7485, 378, 425, 18838, 13956, 1362, 3603, 1417, 628, 13, 4706, 2011, 2142, 324, 601, 29871, 13, 13, 4706, 421, 1949, 1489, 29918, 311, 29918, 11236, 359, 6998, 875, 1489, 712, 1399, 983, 425, 5107, 2368, 13, 4706, 316, 5039, 359, 427, 560, 2011, 2142, 324, 601, 13, 13, 4706, 421, 492, 1030, 316, 28201, 1484, 6998, 1652, 327, 1647, 712, 2947, 316, 29871, 29900, 263, 29871, 29896, 13, 13, 4706, 421, 2576, 568, 29918, 1555, 271, 309, 2368, 6998, 831, 1702, 13694, 759, 425, 13, 4706, 1700, 271, 309, 2368, 8012, 443, 304, 412, 6372, 425, 13, 4706, 1027, 352, 16337, 13, 13, 4706, 421, 2457, 6998, 560, 8928, 29877, 316, 297, 3259, 29892, 560, 7697, 9043, 13, 4706, 17451, 912, 313, 2589, 29897, 343, 425, 553, 6071, 12401, 707, 392, 279, 313, 3754, 29897, 13, 4706, 3882, 819, 11515, 1458, 1986, 1700, 271, 309, 2368, 1702, 560, 29871, 13, 4706, 2011, 2142, 324, 601, 1176, 912, 12606, 1986, 560, 1383, 279, 412, 17450, 601, 13, 4706, 17824, 1869, 4497, 8817, 1487, 7049, 13, 1678, 9995, 13, 268, 13, 1678, 396, 3251, 279, 1185, 29125, 5769, 16337, 628, 2011, 2142, 324, 601, 13, 1678, 282, 353, 282, 13, 1678, 281, 353, 1027, 1070, 29918, 5547, 359, 29918, 637, 2142, 324, 601, 29898, 1949, 1489, 29918, 311, 29918, 11236, 359, 29897, 13, 1678, 315, 353, 315, 13, 13, 1678, 3887, 29892, 269, 2934, 353, 1121, 2255, 29918, 637, 2142, 324, 601, 29898, 29886, 29892, 29893, 29892, 29907, 29897, 13, 13, 268, 13, 1678, 528, 279, 412, 29918, 3605, 601, 353, 313, 2589, 448, 13220, 29918, 2722, 1484, 29897, 847, 269, 2934, 13, 1678, 396, 14192, 8304, 440, 2368, 10032, 1232, 659, 2361, 472, 28304, 4869, 13, 1678, 396, 1702, 13694, 759, 560, 2011, 2142, 324, 601, 316, 1006, 743, 13, 1678, 396, 3882, 819, 409, 11493, 25001, 279, 378, 421, 8000, 29952, 7046, 13, 1678, 396, 409, 5054, 10883, 3627, 15234, 5973, 13, 1678, 565, 269, 2934, 1405, 2485, 568, 29918, 1555, 271, 309, 2368, 29901, 13, 4706, 736, 1027, 1070, 29918, 637, 2142, 324, 601, 29898, 29886, 29892, 315, 29892, 17910, 29918, 311, 29918, 11236, 359, 29892, 13220, 29918, 2722, 1484, 29892, 2485, 568, 29918, 1555, 271, 309, 2368, 29897, 13, 268, 13, 1678, 736, 281, 29892, 3887, 29892, 269, 2934, 29892, 528, 279, 412, 29918, 3605, 601, 13, 13, 5547, 29877, 29918, 11236, 359, 29892, 7697, 9043, 29892, 1700, 271, 309, 2368, 29892, 528, 279, 412, 29918, 3605, 601, 353, 1027, 1070, 29918, 637, 2142, 324, 601, 29898, 29886, 29892, 315, 29892, 17910, 29918, 311, 29918, 11236, 359, 29897, 13, 13, 2158, 703, 29899, 29908, 29930, 29946, 29900, 29897, 13, 2158, 877, 807, 3371, 2142, 324, 601, 3439, 352, 912, 23250, 1495, 13, 2158, 703, 29899, 29908, 29930, 29946, 29900, 29897, 13, 2158, 29898, 29888, 26732, 29876, 2713, 279, 412, 17450, 601, 29901, 426, 845, 279, 412, 29918, 3605, 601, 27195, 13, 2158, 29898, 29888, 15945, 29908, 13, 29925, 267, 359, 5556, 3371, 2142, 324, 601, 3439, 352, 912, 3583, 29876, 29912, 5547, 29877, 29918, 11236, 359, 29913, 13, 320, 29876, 29286, 349, 267, 359, 6991, 273, 29901, 426, 5547, 29877, 29918, 11236, 359, 29889, 2083, 7295, 29889, 29946, 29888, 29913, 13, 15945, 1159, 13, 2158, 29898, 29888, 26732, 29876, 9039, 9043, 628, 3371, 2142, 324, 601, 3439, 352, 912, 26254, 28759, 9043, 27195, 13, 2158, 29898, 29888, 26732, 29876, 13072, 271, 309, 2368, 628, 3371, 2142, 324, 601, 3439, 352, 912, 26254, 1555, 271, 309, 2368, 1012, 29876, 1159, 13, 13, 13, 13, 1753, 1027, 352, 16337, 29918, 311, 29918, 637, 2142, 324, 2363, 29898, 1949, 1489, 29918, 311, 29918, 637, 2142, 324, 2363, 29892, 282, 29892, 315, 29892, 13, 1678, 17910, 29918, 311, 29918, 11236, 359, 29892, 13220, 29918, 2722, 1484, 29922, 29900, 29892, 2485, 568, 29918, 1555, 271, 309, 2368, 29922, 29896, 1125, 13, 13, 1678, 9995, 13, 4706, 3251, 29874, 1232, 7697, 24038, 343, 1700, 271, 7305, 1702, 443, 26949, 13, 4706, 316, 2011, 2142, 324, 2363, 13, 13, 4706, 421, 1949, 1489, 29918, 311, 29918, 637, 2142, 324, 2363, 6998, 875, 1489, 712, 1399, 983, 425, 13, 4706, 5107, 2368, 316, 1634, 506, 294, 288, 1027, 352, 6027, 263, 19208, 29884, 7989, 13, 13, 4706, 421, 29886, 6998, 1775, 7485, 378, 7697, 24038, 3603, 4869, 628, 13, 4706, 2011, 2142, 324, 601, 13, 13, 539, 421, 29907, 6998, 1775, 7485, 378, 425, 18838, 13956, 1362, 3603, 1417, 628, 13, 4706, 2011, 2142, 324, 601, 29871, 13, 13, 4706, 421, 1949, 1489, 29918, 311, 29918, 11236, 359, 6998, 875, 1489, 712, 1399, 983, 425, 5107, 2368, 13, 4706, 316, 5039, 359, 427, 560, 2011, 2142, 324, 601, 13, 13, 4706, 421, 492, 1030, 316, 28201, 1484, 6998, 1652, 327, 1647, 712, 2947, 316, 29871, 29900, 263, 29871, 29896, 13, 13, 4706, 421, 2576, 568, 29918, 1555, 271, 309, 2368, 6998, 831, 1702, 13694, 759, 425, 13, 4706, 1700, 271, 309, 2368, 8012, 443, 304, 412, 6372, 425, 13, 4706, 1027, 352, 16337, 13, 13, 4706, 421, 2457, 6998, 1232, 8928, 359, 29892, 7697, 24038, 17451, 2255, 12606, 13, 4706, 1986, 1869, 1700, 271, 7305, 421, 2783, 6071, 12401, 707, 392, 279, 29952, 13, 4706, 1702, 9747, 6888, 316, 1232, 2011, 2142, 324, 2363, 1027, 352, 2255, 13, 1678, 9995, 13, 13, 1678, 8928, 359, 29892, 7697, 24038, 29892, 1700, 271, 309, 7305, 29892, 528, 279, 546, 29918, 29878, 2219, 359, 353, 14319, 10456, 29961, 13, 4706, 1027, 1070, 29918, 637, 2142, 324, 601, 29898, 29886, 29892, 315, 29892, 17910, 29918, 311, 29918, 11236, 359, 29892, 13220, 29918, 2722, 1484, 29892, 2485, 568, 29918, 1555, 271, 309, 2368, 29897, 13, 4706, 363, 903, 297, 3464, 29898, 1949, 1489, 29918, 311, 29918, 637, 2142, 324, 2363, 29897, 13, 268, 2314, 13, 13, 1678, 8928, 359, 29892, 7697, 24038, 29892, 1700, 271, 309, 7305, 29892, 528, 279, 546, 29918, 29878, 2219, 359, 353, 320, 13, 1678, 7442, 29889, 2378, 29898, 5547, 359, 511, 7442, 29889, 2378, 29898, 28759, 24038, 511, 7442, 29889, 2378, 29898, 1555, 271, 309, 7305, 511, 7442, 29889, 2378, 29898, 845, 279, 546, 29918, 29878, 2219, 359, 29897, 13, 268, 13, 1678, 736, 8928, 359, 29892, 7697, 24038, 29892, 1700, 271, 309, 7305, 29892, 528, 279, 546, 29918, 29878, 2219, 359, 13, 13, 13, 13, 5547, 359, 29892, 7697, 24038, 29892, 1700, 271, 309, 7305, 29892, 528, 279, 546, 29918, 29878, 2219, 359, 353, 1027, 352, 16337, 29918, 311, 29918, 637, 2142, 324, 2363, 29898, 13, 1678, 17910, 29918, 311, 29918, 637, 2142, 324, 2363, 29922, 29896, 29900, 29900, 29900, 29892, 13, 1678, 282, 29922, 29886, 29892, 13, 1678, 315, 29922, 29907, 29892, 13, 1678, 17910, 29918, 311, 29918, 11236, 359, 29922, 1949, 1489, 29918, 311, 29918, 11236, 359, 29892, 13, 1678, 13220, 29918, 2722, 1484, 29922, 29900, 13, 29897, 13, 13, 29937, 4737, 2200, 294, 1383, 279, 546, 13, 1753, 364, 845, 279, 412, 29918, 27525, 29877, 29898, 845, 279, 546, 29918, 29878, 2219, 359, 29892, 7697, 24038, 29892, 1700, 271, 309, 7305, 1125, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 353, 528, 279, 546, 29918, 29878, 2219, 359, 29889, 3317, 580, 13, 1678, 1399, 625, 29918, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 353, 528, 279, 546, 29918, 29878, 2219, 359, 29889, 1191, 3317, 580, 13, 1678, 8928, 359, 29918, 3670, 18594, 29918, 3601, 352, 2255, 353, 8928, 359, 29961, 513, 625, 29918, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29892, 584, 29962, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 28759, 9043, 353, 7697, 24038, 29961, 513, 625, 29918, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29962, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 1555, 271, 309, 2368, 353, 1700, 271, 309, 7305, 29961, 513, 625, 29918, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29962, 13, 13, 1678, 1596, 703, 29899, 29908, 334, 29871, 29945, 29900, 29897, 13, 13, 1678, 1596, 877, 807, 22111, 4695, 294, 1383, 279, 546, 17450, 601, 23250, 1495, 13, 1678, 1596, 703, 29899, 29908, 334, 29871, 29945, 29900, 29897, 13, 268, 13, 1678, 1596, 29898, 29888, 26732, 29876, 7976, 4200, 1383, 279, 412, 17450, 601, 29901, 426, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 27195, 13, 13, 1678, 1596, 29898, 29888, 15945, 29908, 29925, 267, 359, 5556, 3371, 2142, 324, 601, 3583, 29876, 29912, 5547, 359, 29918, 3670, 18594, 29918, 3601, 352, 2255, 29913, 13, 1678, 320, 29876, 29286, 349, 267, 359, 6991, 273, 29901, 426, 5547, 359, 29918, 3670, 18594, 29918, 3601, 352, 2255, 29889, 2083, 7295, 29889, 29946, 29888, 29913, 13, 1678, 9995, 1723, 13, 268, 13, 1678, 1596, 29898, 29888, 26732, 29876, 9039, 9043, 628, 5918, 4200, 1383, 279, 412, 17450, 601, 26254, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 28759, 9043, 27195, 13, 1678, 1596, 29898, 29888, 26732, 29876, 13072, 271, 309, 2368, 628, 5918, 4200, 1383, 279, 412, 17450, 601, 26254, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 1555, 271, 309, 2368, 1012, 29876, 1159, 13, 13, 1678, 736, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29892, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 1555, 271, 309, 2368, 29892, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 28759, 9043, 13, 13, 13, 29937, 22111, 4695, 294, 316, 11240, 4287, 417, 13, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29892, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 1555, 271, 309, 2368, 29892, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 28759, 9043, 353, 364, 845, 279, 412, 29918, 27525, 29877, 29898, 845, 279, 546, 29918, 29878, 2219, 359, 29892, 7697, 24038, 29892, 1700, 271, 309, 7305, 29897, 13, 13, 13, 13, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29947, 29892, 29953, 876, 13, 572, 29873, 29889, 3257, 877, 29934, 355, 24038, 343, 3684, 271, 309, 7305, 29905, 29876, 3371, 2142, 324, 2363, 3439, 352, 2255, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 1557, 2620, 29898, 1555, 271, 309, 7305, 29892, 7697, 24038, 29892, 274, 29922, 845, 279, 546, 29918, 29878, 2219, 359, 29892, 274, 1958, 2433, 1111, 324, 1495, 13, 572, 29873, 29889, 2780, 1646, 29898, 1643, 29922, 29878, 29908, 29938, 2713, 279, 412, 29905, 17450, 601, 29938, 1159, 13, 13, 29937, 20693, 4200, 1383, 279, 412, 17450, 601, 3439, 352, 912, 13, 572, 29873, 29889, 1557, 2620, 29898, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 1555, 271, 309, 2368, 29892, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 28759, 9043, 29892, 13, 1678, 274, 2433, 272, 927, 742, 269, 29922, 29953, 29900, 29892, 7636, 27703, 2433, 21012, 742, 3858, 29922, 29888, 29915, 2713, 279, 412, 17450, 601, 20693, 4200, 3439, 352, 912, 353, 426, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29901, 29889, 29946, 29888, 10162, 13, 29897, 13, 13, 572, 29873, 29889, 29891, 1643, 29898, 29878, 13090, 29934, 355, 9043, 29938, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 29916, 1643, 29898, 29878, 13090, 13072, 271, 309, 2368, 29905, 320, 3754, 29938, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 26172, 29898, 2029, 543, 21064, 2175, 1159, 13, 13, 13, 13, 13, 29937, 24062, 1403, 2765, 560, 29472, 2723, 16181, 1417, 13, 29937, 1732, 597, 11023, 29916, 3670, 29889, 990, 29914, 1792, 13075, 29914, 535, 29872, 29097, 29889, 1420, 13, 29937, 1732, 597, 11023, 29916, 3670, 29889, 990, 29914, 19057, 29914, 2909, 29914, 637, 25648, 29889, 1420, 13, 29937, 1732, 597, 11023, 29916, 3670, 29889, 990, 29914, 19057, 29914, 12631, 29914, 29939, 29886, 29889, 1420, 13, 1753, 2011, 2142, 324, 601, 29918, 3670, 4200, 29898, 29886, 29892, 315, 29892, 17910, 29918, 311, 29918, 11236, 359, 1125, 13, 1678, 9995, 13, 4706, 3251, 29874, 1232, 28780, 1702, 425, 383, 1617, 10120, 382, 9639, 6759, 13, 4706, 421, 29886, 6998, 1775, 7485, 378, 7697, 24038, 3603, 4869, 628, 13, 4706, 2011, 2142, 324, 601, 13, 13, 539, 421, 29907, 6998, 1775, 7485, 378, 425, 18838, 13956, 1362, 3603, 1417, 628, 13, 4706, 2011, 2142, 324, 601, 29871, 13, 13, 4706, 421, 1949, 1489, 29918, 311, 29918, 11236, 359, 6998, 875, 1489, 712, 1399, 983, 425, 5107, 2368, 13, 4706, 316, 5039, 359, 427, 560, 2011, 2142, 324, 601, 13, 13, 4706, 421, 2267, 272, 1056, 6998, 7049, 29892, 316, 1232, 8928, 359, 316, 9747, 2011, 2142, 324, 601, 29871, 13, 4706, 3928, 13833, 263, 9747, 15978, 316, 425, 1424, 265, 10120, 29871, 13, 4706, 321, 9639, 6759, 29892, 18200, 12658, 359, 28780, 560, 610, 7697, 9043, 13, 4706, 343, 1700, 271, 309, 2368, 29871, 13, 1678, 9995, 13, 13, 1678, 396, 922, 19692, 346, 15795, 359, 766, 4838, 359, 1702, 12713, 279, 425, 13, 1678, 396, 425, 1424, 265, 10120, 321, 9639, 6759, 21010, 724, 273, 1232, 29871, 13, 1678, 396, 421, 5182, 29879, 29952, 318, 13413, 12927, 712, 409, 285, 823, 273, 1702, 5994, 15356, 13, 1678, 405, 353, 29871, 29896, 29900, 29900, 13, 1678, 302, 353, 17910, 29918, 311, 29918, 11236, 359, 13, 1678, 396, 8366, 353, 7442, 29889, 13519, 29898, 29896, 29900, 29892, 29871, 29945, 334, 7442, 29889, 279, 927, 29898, 29940, 29897, 847, 405, 448, 29871, 29896, 29897, 396, 10258, 712, 724, 15023, 304, 1761, 580, 13, 1678, 2301, 353, 518, 29871, 29896, 29900, 1068, 29898, 29945, 29889, 29900, 29930, 29873, 29914, 29940, 29899, 29896, 29889, 29900, 29897, 363, 260, 297, 3464, 29898, 29940, 29897, 4514, 13, 268, 13, 1678, 396, 3588, 381, 560, 282, 343, 315, 263, 13516, 628, 13306, 13850, 29916, 3670, 13, 1678, 396, 427, 560, 11986, 316, 282, 409, 10565, 9919, 378, 480, 1301, 28959, 13, 1678, 282, 1646, 353, 3523, 29889, 5344, 29898, 29886, 29889, 29911, 29897, 13, 1678, 317, 353, 3523, 29889, 5344, 29898, 29907, 29897, 13, 13, 1678, 396, 6760, 279, 1869, 13516, 316, 1791, 2200, 17593, 13, 1678, 396, 402, 29916, 5277, 298, 13, 1678, 402, 353, 448, 3670, 29889, 5344, 29898, 9302, 29889, 1032, 29872, 29898, 29876, 876, 259, 396, 1775, 7485, 2893, 2368, 3480, 8657, 302, 921, 302, 29871, 13, 1678, 298, 353, 3523, 29889, 5344, 29898, 29900, 29889, 29900, 29892, 313, 29876, 1919, 29896, 876, 13, 13, 1678, 396, 22523, 353, 289, 13, 1678, 319, 353, 3523, 29889, 5344, 29898, 29896, 29889, 29900, 29892, 313, 29896, 29892, 302, 876, 13, 1678, 289, 353, 3523, 29889, 5344, 29898, 29896, 29889, 29900, 29897, 308, 396, 997, 2533, 29874, 316, 1232, 8928, 359, 831, 29871, 29896, 13, 13, 13, 1678, 396, 3037, 16637, 1232, 8928, 359, 316, 425, 1424, 265, 10120, 321, 9639, 6759, 13, 1678, 396, 2812, 552, 1743, 7835, 16337, 10406, 16181, 983, 13, 1678, 396, 28608, 1903, 1489, 4047, 13640, 14054, 560, 899, 369, 313, 267, 1015, 29883, 1848, 29897, 13, 1678, 899, 874, 29889, 6768, 1839, 4294, 29918, 18035, 2033, 353, 7700, 13, 1678, 2011, 2142, 324, 2363, 353, 518, 2929, 874, 29889, 29939, 29886, 29898, 2589, 29930, 29903, 29892, 448, 29886, 1646, 29892, 402, 29892, 298, 29892, 319, 29892, 289, 29897, 1839, 29916, 2033, 363, 3887, 297, 2301, 29962, 13, 13, 1678, 396, 3037, 16637, 1232, 7697, 24038, 343, 1700, 271, 309, 7305, 288, 28201, 29887, 359, 13, 1678, 396, 1702, 425, 1424, 265, 10120, 321, 9639, 6759, 13, 1678, 396, 2661, 294, 2334, 6027, 21802, 273, 856, 14842, 712, 1053, 279, 376, 2204, 294, 29908, 13, 1678, 396, 7046, 560, 15234, 5973, 712, 7444, 28271, 316, 4404, 15234, 5973, 13, 1678, 396, 5054, 10883, 712, 409, 2654, 326, 2673, 264, 1232, 7697, 24038, 29892, 1700, 271, 309, 7305, 13, 1678, 396, 1702, 712, 3653, 17725, 13, 1678, 396, 28759, 24038, 353, 518, 2204, 294, 29889, 6333, 29898, 29886, 1646, 29892, 921, 29897, 363, 921, 297, 2011, 2142, 324, 2363, 29962, 13, 1678, 396, 1555, 271, 309, 7305, 353, 518, 9302, 29889, 3676, 29898, 2204, 294, 29889, 6333, 29898, 29916, 29892, 317, 29930, 29916, 876, 363, 921, 297, 2011, 2142, 324, 2363, 29962, 13, 13, 1678, 7697, 24038, 29892, 1700, 271, 309, 7305, 353, 14319, 10456, 29961, 13, 4706, 1121, 2255, 29918, 637, 2142, 324, 601, 29898, 29886, 29892, 7442, 29889, 2378, 29898, 29893, 467, 29911, 29892, 315, 29897, 363, 281, 297, 2011, 2142, 324, 2363, 13, 268, 2314, 13, 13, 13, 1678, 396, 3037, 16637, 560, 2011, 2142, 324, 601, 3523, 4200, 13, 1678, 396, 5547, 359, 353, 899, 874, 29889, 29939, 29886, 29898, 3670, 29889, 5344, 29898, 29916, 29896, 334, 317, 511, 448, 29886, 1646, 29892, 402, 29892, 298, 29892, 319, 29892, 289, 29897, 1839, 29916, 2033, 396, 396, 1939, 3653, 16017, 1702, 658, 712, 409, 1750, 406, 14557, 5516, 594, 295, 1647, 13, 1678, 8928, 359, 353, 518, 9302, 29889, 294, 2378, 29898, 29916, 29897, 363, 921, 297, 2011, 2142, 324, 2363, 29962, 13, 13, 1678, 8928, 359, 353, 7442, 29889, 294, 2378, 29898, 5547, 359, 29897, 13, 1678, 7697, 24038, 353, 7442, 29889, 294, 2378, 29898, 28759, 24038, 29897, 13, 1678, 1700, 271, 309, 7305, 353, 7442, 29889, 294, 2378, 29898, 1555, 271, 309, 7305, 29897, 13, 13, 1678, 736, 8928, 359, 29892, 7697, 24038, 29892, 1700, 271, 309, 7305, 13, 13, 13, 29893, 29918, 3670, 18594, 29892, 3887, 29918, 3670, 18594, 29892, 269, 2934, 29918, 3670, 18594, 353, 2011, 2142, 324, 601, 29918, 3670, 4200, 29898, 29886, 29892, 315, 29892, 17910, 29918, 311, 29918, 11236, 359, 29897, 13, 13, 13, 13, 13383, 13383, 7346, 13, 29937, 383, 1617, 10120, 382, 9639, 6759, 343, 3439, 352, 16337, 13, 13383, 13383, 7346, 13, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29947, 29892, 29953, 876, 13, 572, 29873, 29889, 3257, 877, 29943, 1617, 10120, 321, 9639, 6759, 742, 2927, 2433, 21012, 1495, 13, 13, 29937, 383, 1617, 10120, 321, 9639, 6759, 13, 572, 29873, 29889, 5317, 29898, 3754, 29918, 3670, 18594, 29889, 690, 14443, 3552, 29896, 6653, 29896, 876, 29961, 29900, 1402, 3887, 29918, 3670, 18594, 29889, 690, 14443, 3552, 29896, 6653, 29896, 876, 29961, 29900, 1402, 525, 29891, 29899, 29877, 742, 2927, 2433, 21012, 742, 15595, 29922, 29900, 29889, 29946, 29892, 3858, 2433, 29943, 1617, 10120, 382, 9639, 6759, 1495, 13, 13, 29937, 3439, 352, 2255, 13, 572, 29873, 29889, 1557, 2620, 29898, 1555, 271, 309, 7305, 29892, 7697, 24038, 29892, 274, 29922, 845, 279, 546, 29918, 29878, 2219, 359, 29892, 274, 1958, 2433, 1111, 324, 1495, 13, 572, 29873, 29889, 2780, 1646, 29898, 1643, 29922, 29878, 29908, 29938, 2713, 279, 412, 29905, 17450, 601, 29938, 1159, 13, 13, 29937, 20693, 4200, 1383, 279, 412, 17450, 601, 3439, 352, 912, 13, 572, 29873, 29889, 1557, 2620, 29898, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 1555, 271, 309, 2368, 29892, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 28759, 9043, 29892, 13, 1678, 274, 2433, 272, 927, 742, 269, 29922, 29953, 29900, 29892, 7636, 27703, 2433, 21012, 742, 3858, 29922, 29888, 29915, 2713, 279, 412, 17450, 601, 20693, 4200, 3439, 352, 912, 353, 426, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29901, 29889, 29946, 29888, 10162, 13, 29897, 13, 13, 572, 29873, 29889, 29891, 1643, 29898, 29878, 13090, 29934, 355, 9043, 29938, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 29916, 1643, 29898, 29878, 13090, 13072, 271, 309, 2368, 29905, 320, 3754, 29938, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 26172, 29898, 2029, 543, 21064, 2175, 1159, 13, 13, 13, 13, 13383, 13383, 7346, 13, 29937, 17450, 601, 316, 1383, 279, 546, 13, 13383, 13383, 7346, 13, 2158, 14182, 29876, 6565, 928, 279, 28276, 2533, 273, 29871, 29896, 29901, 16521, 13, 2158, 29898, 9302, 29889, 2378, 4197, 29916, 29889, 2083, 580, 363, 921, 297, 281, 29918, 3670, 18594, 12622, 13, 13, 1777, 509, 279, 29918, 5547, 359, 29918, 1066, 277, 12927, 353, 7442, 29889, 2378, 4197, 29898, 29916, 18572, 29900, 467, 497, 580, 363, 921, 297, 281, 29918, 3670, 18594, 2314, 13, 2158, 14182, 29876, 6565, 928, 279, 712, 10843, 1232, 8928, 359, 409, 273, 6736, 29871, 29900, 29901, 16521, 13, 2158, 29898, 1777, 509, 279, 29918, 5547, 359, 29918, 1066, 277, 12927, 29897, 13, 2158, 29898, 29893, 29918, 3670, 18594, 29889, 12181, 29892, 3887, 29918, 3670, 18594, 29889, 12181, 29892, 269, 2934, 29918, 3670, 18594, 29889, 12181, 29897, 13, 13, 13, 29893, 29918, 3670, 18594, 353, 281, 29918, 3670, 18594, 29961, 1777, 509, 279, 29918, 5547, 359, 29918, 1066, 277, 12927, 29962, 13, 2589, 29918, 3670, 18594, 353, 3887, 29918, 3670, 18594, 518, 1777, 509, 279, 29918, 5547, 359, 29918, 1066, 277, 12927, 29962, 13, 3754, 29918, 3670, 18594, 353, 269, 2934, 29918, 3670, 18594, 29961, 1777, 509, 279, 29918, 5547, 359, 29918, 1066, 277, 12927, 29962, 13, 13, 13, 2158, 14182, 29876, 6565, 928, 279, 712, 10843, 1232, 8928, 359, 409, 273, 6736, 29871, 29900, 29901, 16521, 13, 2158, 29898, 9302, 29889, 2378, 4197, 29898, 29916, 18572, 29900, 467, 497, 580, 363, 921, 297, 281, 29918, 3670, 18594, 12622, 13, 2158, 29898, 29893, 29918, 3670, 18594, 29889, 12181, 29892, 3887, 29918, 3670, 18594, 29889, 12181, 29892, 269, 2934, 29918, 3670, 18594, 29889, 12181, 29897, 13, 13, 13, 492, 1030, 29918, 2722, 1484, 353, 29871, 29900, 13, 29878, 845, 279, 412, 29918, 3670, 18594, 353, 313, 2589, 29918, 3670, 18594, 448, 13220, 29918, 2722, 1484, 29897, 847, 269, 2934, 29918, 3670, 18594, 13, 29878, 845, 279, 412, 29918, 3670, 18594, 353, 364, 845, 279, 412, 29918, 3670, 18594, 29889, 690, 14443, 3552, 29896, 6653, 29896, 8106, 690, 14443, 3552, 29896, 6653, 29896, 876, 396, 439, 3673, 280, 9927, 267, 13, 13, 13, 27525, 29877, 29918, 29878, 845, 279, 412, 29892, 5256, 29877, 29918, 29878, 845, 279, 412, 29918, 1555, 271, 309, 2368, 29892, 5256, 29877, 29918, 29878, 845, 279, 412, 29918, 28759, 9043, 353, 364, 845, 279, 412, 29918, 27525, 29877, 29898, 29878, 845, 279, 412, 29918, 3670, 18594, 29892, 3887, 29918, 3670, 18594, 29892, 269, 2934, 29918, 3670, 18594, 29897, 13, 13, 13, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29947, 29892, 29953, 876, 13, 572, 29873, 29889, 3257, 877, 2713, 279, 6774, 316, 425, 383, 1617, 10120, 382, 9639, 6759, 29905, 29876, 1168, 349, 267, 359, 694, 12610, 29002, 742, 2927, 2433, 21012, 1495, 13, 13, 29937, 20693, 4200, 1383, 279, 412, 17450, 601, 383, 1617, 10120, 382, 9639, 6759, 13, 572, 29873, 29889, 1557, 2620, 29898, 13, 1678, 364, 845, 279, 412, 29918, 3670, 18594, 29961, 29900, 1822, 1191, 3317, 3285, 13, 1678, 5256, 29877, 29918, 29878, 845, 279, 412, 29892, 13, 1678, 274, 2433, 29937, 29929, 29900, 600, 29896, 29872, 742, 269, 29922, 29896, 29900, 29900, 29892, 7636, 27703, 2433, 21012, 742, 3858, 29922, 29888, 29915, 2713, 279, 412, 17450, 601, 353, 426, 27525, 29877, 29918, 29878, 845, 279, 412, 29901, 29889, 29946, 29888, 10162, 13, 29897, 13, 13, 572, 29873, 29889, 5317, 29898, 29878, 845, 279, 412, 29918, 3670, 18594, 29961, 29900, 1402, 525, 29891, 29899, 29877, 742, 2927, 2433, 29881, 397, 914, 9539, 742, 15595, 29922, 29900, 29889, 29946, 29897, 13, 13, 572, 29873, 29889, 29891, 1643, 29898, 29878, 13090, 2713, 279, 412, 29905, 17450, 601, 29938, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 29916, 1643, 29898, 29878, 13090, 6039, 2140, 6027, 29938, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 26172, 29898, 2029, 543, 21064, 2175, 1159, 13, 13, 13, 13, 13, 13383, 13383, 7346, 13, 29937, 7561, 29877, 8378, 517, 29901, 13, 29937, 17450, 601, 316, 1383, 279, 546, 20693, 4200, 13, 29937, 383, 1617, 10120, 382, 9639, 6759, 343, 3439, 352, 16337, 13, 13383, 13383, 7346, 13, 29893, 29918, 3670, 18594, 29892, 3887, 29918, 3670, 18594, 29892, 269, 2934, 29918, 3670, 18594, 353, 2011, 2142, 324, 601, 29918, 3670, 4200, 29898, 29886, 29892, 315, 29892, 17910, 29918, 311, 29918, 11236, 359, 29897, 13, 492, 1030, 29918, 2722, 1484, 353, 29871, 29900, 13, 29878, 845, 279, 412, 29918, 3670, 18594, 353, 313, 2589, 29918, 3670, 18594, 448, 13220, 29918, 2722, 1484, 29897, 847, 269, 2934, 29918, 3670, 18594, 13, 29878, 845, 279, 412, 29918, 3670, 18594, 353, 364, 845, 279, 412, 29918, 3670, 18594, 29889, 690, 14443, 3552, 29896, 6653, 29896, 8106, 690, 14443, 3552, 29896, 6653, 29896, 876, 396, 439, 3673, 280, 9927, 267, 13, 13, 13, 13, 572, 29873, 29889, 4532, 29898, 1003, 2311, 7607, 29947, 29892, 29953, 876, 13, 572, 29873, 29889, 3257, 877, 29943, 1617, 10120, 321, 9639, 6759, 742, 2927, 2433, 21012, 1495, 13, 13, 29937, 383, 1617, 10120, 321, 9639, 6759, 13, 572, 29873, 29889, 5317, 29898, 3754, 29918, 3670, 18594, 29889, 690, 14443, 3552, 29896, 6653, 29896, 876, 29961, 29900, 1402, 3887, 29918, 3670, 18594, 29889, 690, 14443, 3552, 29896, 6653, 29896, 876, 29961, 29900, 1402, 525, 29891, 29899, 29877, 742, 2927, 2433, 21012, 742, 15595, 29922, 29900, 29889, 29946, 29892, 3858, 2433, 29943, 1617, 10120, 382, 9639, 6759, 1495, 13, 13, 29937, 3439, 352, 2255, 13, 572, 29873, 29889, 1557, 2620, 29898, 1555, 271, 309, 7305, 29892, 7697, 24038, 29892, 274, 29922, 845, 279, 546, 29918, 29878, 2219, 359, 29892, 274, 1958, 2433, 1111, 324, 1495, 13, 572, 29873, 29889, 2780, 1646, 29898, 1643, 29922, 29878, 29908, 29938, 2713, 279, 412, 29905, 17450, 601, 29938, 1159, 13, 13, 29937, 20693, 4200, 1383, 279, 412, 17450, 601, 383, 1617, 10120, 382, 9639, 6759, 13, 13140, 29918, 29878, 12181, 29918, 3670, 4200, 353, 7442, 29889, 3062, 29898, 29878, 845, 279, 412, 29918, 3670, 18594, 29961, 29900, 29962, 1275, 5256, 29877, 29918, 29878, 845, 279, 412, 29897, 13, 572, 29873, 29889, 1557, 2620, 29898, 13, 1678, 269, 2934, 29918, 3670, 18594, 29889, 690, 14443, 3552, 29896, 29892, 448, 29896, 876, 29961, 29900, 3816, 13140, 29918, 29878, 12181, 29918, 3670, 4200, 1402, 259, 396, 321, 1324, 1700, 271, 309, 2368, 13, 1678, 3887, 29918, 3670, 18594, 29889, 690, 14443, 3552, 29896, 6653, 29896, 876, 29961, 29900, 3816, 13140, 29918, 29878, 12181, 29918, 3670, 4200, 1402, 539, 396, 321, 1324, 7697, 24038, 13, 1678, 274, 2433, 29937, 29929, 29900, 600, 29896, 29872, 742, 269, 29922, 29896, 29900, 29900, 29892, 7636, 27703, 2433, 21012, 742, 3858, 29922, 29888, 29915, 2713, 279, 412, 17450, 601, 20693, 4200, 353, 426, 27525, 29877, 29918, 29878, 845, 279, 412, 29901, 29889, 29946, 29888, 10162, 13, 29897, 13, 13, 29937, 20693, 4200, 1383, 279, 412, 17450, 601, 3439, 352, 912, 13, 572, 29873, 29889, 1557, 2620, 29898, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 1555, 271, 309, 2368, 29892, 13, 1678, 5256, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29918, 28759, 9043, 29892, 13, 1678, 274, 2433, 272, 927, 742, 269, 29922, 29896, 29900, 29900, 29892, 7636, 27703, 2433, 21012, 742, 3858, 29922, 29888, 29915, 2713, 279, 412, 17450, 601, 20693, 4200, 3439, 352, 912, 353, 426, 27525, 29877, 29918, 845, 279, 412, 29918, 3605, 601, 29901, 29889, 29946, 29888, 10162, 13, 29897, 13, 13, 572, 29873, 29889, 29891, 1643, 29898, 29878, 13090, 29934, 355, 9043, 29938, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 29916, 1643, 29898, 29878, 13090, 13072, 271, 309, 2368, 29905, 320, 3754, 29938, 742, 2927, 2433, 21012, 1495, 13, 572, 29873, 29889, 26172, 29898, 2029, 543, 21064, 2175, 1159, 13, 13, 13, 13, 13383, 13383, 7346, 13, 29937, 922, 3887, 342, 661, 10843, 1232, 619, 4666, 359, 13, 13383, 13383, 7346, 13, 572, 29873, 29889, 4294, 580, 13, 2 ]
pyproteome/motifs/icelogo.py
white-lab/pyproteome
8
1602378
<reponame>white-lab/pyproteome from __future__ import division # Built-ins import logging import requests try: from IPython.display import Image except ImportError: Image = None from . import motif LOGGER = logging.getLogger('pyproteome.icelogo') ICELOGO_BASE = 'http://iomics.ugent.be/icelogoserver' def make_logo(data, f, m=None, letter_mod_types=None, **kwargs): nmer_args = motif.get_nmer_args(kwargs) fore = [ n for n in motif.generate_n_mers( data.filter(f)['Sequence'], **nmer_args ) if not m or m.match(n) ] back = [ n for n in motif.generate_n_mers( data['Sequence'], **nmer_args ) ] return icelogo( fore, back, **kwargs ) def icelogo( foreground, background, title='', width=800, height=600, pvalue=0.05, scoring='foldChange', ): ''' Wraps calls to iceLogo [1]_, returning an image showing the enrichment of a sequence in a foreground set compared to a background set. Parameters ---------- foreground : list of str background : list of str title : str, optional width : int, optional height : int, optional pval : float, optional scoring : string, optional Returns ------- fig : :class:`IPython.display.Image` Notes ----- .. [1] <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. (2009). Improved visualization of protein consensus sequences by iceLogo. Nature Methods, 6(11), 786–787. http://doi.org/10.1038/nmeth1109-786 ''' if len(foreground) < 1 or len(background) < 1: return None assert scoring in ('percentage', 'foldChange') letter_width = len(background[0]) s = requests.Session() response = s.post( '{}/data/logo'.format(ICELOGO_BASE), data={ 'positiveSequences': '\n'.join(foreground), 'reference': 'reference_set', 'negativeSequences': '\n'.join(background), 'start': -(letter_width // 2), 'visualisationType': 'iceLogo', 'species': '', 'colors[]': [ '2b00e3', 'da00ba', 'd20012', 'bcc800', 'cd6300', '0000e5', 'c9af00', 'd60064', 'cf3d00', 'd8008f', 'cb8900', 'd4003b', '8000df', 'd11500', '94c600', '5600e1', 'd200db', 'a900dd', '47c200', '21c000', '6dc400', ], 'width': width, 'height': height, 'pValue': pvalue, 'scoringSystem': scoring, 'aaMatrix': '', 'substitutionMatrix': '', }, ) response.raise_for_status() path = response.content.decode('utf-8') png = '{}/generated_images/{}.png'.format(ICELOGO_BASE, path) if Image: return Image(url=png) else: return png
[ 1, 529, 276, 1112, 420, 29958, 10921, 29899, 8205, 29914, 2272, 14676, 608, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8542, 13, 13, 29937, 5373, 2782, 29899, 1144, 13, 5215, 12183, 13, 5215, 7274, 13, 13, 2202, 29901, 13, 1678, 515, 5641, 1656, 29889, 4990, 1053, 7084, 13, 19499, 16032, 2392, 29901, 13, 1678, 7084, 353, 6213, 13, 13, 3166, 869, 1053, 3184, 361, 13, 13, 13, 14480, 17070, 353, 12183, 29889, 657, 16363, 877, 2272, 14676, 608, 29889, 293, 295, 10482, 1495, 13, 12107, 14480, 29949, 29918, 25416, 353, 525, 1124, 597, 14910, 1199, 29889, 688, 296, 29889, 915, 29914, 293, 295, 468, 22969, 369, 29915, 13, 13, 13, 1753, 1207, 29918, 14569, 29898, 1272, 29892, 285, 29892, 286, 29922, 8516, 29892, 5497, 29918, 1545, 29918, 8768, 29922, 8516, 29892, 3579, 19290, 1125, 13, 1678, 302, 1050, 29918, 5085, 353, 3184, 361, 29889, 657, 29918, 29876, 1050, 29918, 5085, 29898, 19290, 29897, 13, 13, 1678, 26839, 353, 518, 13, 4706, 302, 13, 4706, 363, 302, 297, 3184, 361, 29889, 17158, 29918, 29876, 29918, 13269, 29898, 13, 9651, 848, 29889, 4572, 29898, 29888, 29897, 1839, 20529, 7464, 13, 9651, 3579, 29876, 1050, 29918, 5085, 13, 4706, 1723, 13, 4706, 565, 451, 286, 470, 286, 29889, 4352, 29898, 29876, 29897, 13, 1678, 4514, 13, 13, 1678, 1250, 353, 518, 13, 4706, 302, 13, 4706, 363, 302, 297, 3184, 361, 29889, 17158, 29918, 29876, 29918, 13269, 29898, 13, 9651, 848, 1839, 20529, 7464, 13, 9651, 3579, 29876, 1050, 29918, 5085, 13, 4706, 1723, 13, 1678, 4514, 13, 1678, 736, 16077, 295, 10482, 29898, 13, 4706, 26839, 29892, 1250, 29892, 13, 4706, 3579, 19290, 13, 1678, 1723, 13, 13, 13, 1753, 16077, 295, 10482, 29898, 13, 1678, 363, 18128, 29892, 3239, 29892, 13, 1678, 3611, 2433, 742, 13, 1678, 2920, 29922, 29947, 29900, 29900, 29892, 13, 1678, 3171, 29922, 29953, 29900, 29900, 29892, 13, 1678, 282, 1767, 29922, 29900, 29889, 29900, 29945, 29892, 13, 1678, 26654, 2433, 8771, 7277, 742, 13, 1125, 13, 1678, 14550, 13, 1678, 399, 336, 567, 5717, 304, 14890, 3403, 29877, 518, 29896, 29962, 3383, 7863, 385, 1967, 6445, 278, 427, 4018, 358, 310, 263, 13, 1678, 5665, 297, 263, 363, 18128, 731, 9401, 304, 263, 3239, 731, 29889, 13, 13, 1678, 12662, 2699, 13, 1678, 448, 1378, 29899, 13, 1678, 363, 18128, 584, 1051, 310, 851, 13, 1678, 3239, 584, 1051, 310, 851, 13, 1678, 3611, 584, 851, 29892, 13136, 13, 1678, 2920, 584, 938, 29892, 13136, 13, 1678, 3171, 584, 938, 29892, 13136, 13, 1678, 282, 791, 584, 5785, 29892, 13136, 13, 1678, 26654, 584, 1347, 29892, 13136, 13, 13, 1678, 16969, 13, 1678, 448, 22158, 13, 1678, 2537, 584, 584, 1990, 18078, 5690, 1656, 29889, 4990, 29889, 2940, 29952, 13, 13, 1678, 8695, 13, 1678, 448, 807, 13, 1678, 6317, 518, 29896, 29962, 529, 5813, 29958, 1696, 529, 5813, 29958, 1696, 529, 5813, 29958, 1696, 529, 5813, 29958, 1696, 669, 13, 4706, 529, 5813, 15513, 313, 29906, 29900, 29900, 29929, 467, 1954, 771, 1490, 7604, 2133, 310, 26823, 1136, 8841, 13, 4706, 15602, 491, 14890, 3403, 29877, 29889, 17677, 8108, 29879, 29892, 29871, 29953, 29898, 29896, 29896, 511, 29871, 29955, 29947, 29953, 29994, 29955, 29947, 29955, 29889, 13, 4706, 1732, 597, 1867, 29875, 29889, 990, 29914, 29896, 29900, 29889, 29896, 29900, 29941, 29947, 29914, 22882, 621, 29896, 29896, 29900, 29929, 29899, 29955, 29947, 29953, 13, 1678, 14550, 13, 1678, 565, 7431, 29898, 1454, 18128, 29897, 529, 29871, 29896, 470, 7431, 29898, 7042, 29897, 529, 29871, 29896, 29901, 13, 4706, 736, 6213, 13, 13, 1678, 4974, 26654, 297, 6702, 25376, 482, 742, 525, 8771, 7277, 1495, 13, 13, 1678, 5497, 29918, 2103, 353, 7431, 29898, 7042, 29961, 29900, 2314, 13, 13, 1678, 269, 353, 7274, 29889, 7317, 580, 13, 13, 1678, 2933, 353, 269, 29889, 2490, 29898, 13, 4706, 22372, 6822, 1272, 29914, 14569, 4286, 4830, 29898, 12107, 14480, 29949, 29918, 25416, 511, 13, 4706, 848, 3790, 13, 9651, 525, 1066, 3321, 16941, 2063, 2396, 11297, 29876, 4286, 7122, 29898, 1454, 18128, 511, 13, 9651, 525, 5679, 2396, 525, 5679, 29918, 842, 742, 13, 9651, 525, 22198, 16941, 2063, 2396, 11297, 29876, 4286, 7122, 29898, 7042, 511, 13, 9651, 525, 2962, 2396, 19691, 15670, 29918, 2103, 849, 29871, 29906, 511, 13, 9651, 525, 20119, 4371, 1542, 2396, 525, 625, 3403, 29877, 742, 13, 9651, 525, 24091, 2396, 15516, 13, 9651, 525, 27703, 2636, 2396, 518, 13, 18884, 525, 29906, 29890, 29900, 29900, 29872, 29941, 742, 525, 1388, 29900, 29900, 2291, 742, 525, 29881, 29906, 29900, 29900, 29896, 29906, 742, 525, 29890, 617, 29947, 29900, 29900, 742, 525, 2252, 29953, 29941, 29900, 29900, 742, 525, 29900, 29900, 29900, 29900, 29872, 29945, 742, 13, 18884, 525, 29883, 29929, 2142, 29900, 29900, 742, 525, 29881, 29953, 29900, 29900, 29953, 29946, 742, 525, 6854, 29941, 29881, 29900, 29900, 742, 525, 29881, 29947, 29900, 29900, 29947, 29888, 742, 525, 10702, 29947, 29929, 29900, 29900, 742, 525, 29881, 29946, 29900, 29900, 29941, 29890, 742, 13, 18884, 525, 29947, 29900, 29900, 29900, 2176, 742, 525, 29881, 29896, 29896, 29945, 29900, 29900, 742, 525, 29929, 29946, 29883, 29953, 29900, 29900, 742, 525, 29945, 29953, 29900, 29900, 29872, 29896, 742, 525, 29881, 29906, 29900, 29900, 2585, 742, 525, 29874, 29929, 29900, 29900, 1289, 742, 13, 18884, 525, 29946, 29955, 29883, 29906, 29900, 29900, 742, 525, 29906, 29896, 29883, 29900, 29900, 29900, 742, 525, 29953, 13891, 29946, 29900, 29900, 742, 13, 9651, 21251, 13, 9651, 525, 2103, 2396, 2920, 29892, 13, 9651, 525, 3545, 2396, 3171, 29892, 13, 9651, 525, 29886, 1917, 2396, 282, 1767, 29892, 13, 9651, 525, 1557, 8253, 3924, 2396, 26654, 29892, 13, 9651, 525, 7340, 14609, 2396, 15516, 13, 9651, 525, 22492, 5008, 14609, 2396, 15516, 13, 4706, 2981, 13, 1678, 1723, 13, 1678, 2933, 29889, 22692, 29918, 1454, 29918, 4882, 580, 13, 1678, 2224, 353, 2933, 29889, 3051, 29889, 13808, 877, 9420, 29899, 29947, 1495, 13, 13, 1678, 282, 865, 353, 22372, 6822, 13525, 29918, 8346, 19248, 1836, 2732, 4286, 4830, 29898, 12107, 14480, 29949, 29918, 25416, 29892, 2224, 29897, 13, 13, 1678, 565, 7084, 29901, 13, 4706, 736, 7084, 29898, 2271, 29922, 2732, 29897, 13, 1678, 1683, 29901, 13, 4706, 736, 282, 865, 13, 2 ]
exceptions_and_logging/logging_settings.py
Agamiru/exceptions_and_logging
1
175362
<reponame>Agamiru/exceptions_and_logging import logging import os EXTRA_KWARGS = ["err_type"] DEFAULT_LOGGER_NAME = "default_logger" MSG_FORMAT = '%(asctime)s - APPLICATION ERROR - %(levelname)s\n' \ 'Error Type: %(err_type)s\n' \ 'Error Message: %(message)s\n' module_dir = os.path.dirname(__file__) DEFAULT_LOG_CONFIG_FILE = os.path.join(module_dir, "logging_config.yaml") class DefaultFormatter(logging.Formatter): """ Default message formatter. Adds extra double lines for readability. """ def __init__( self, fmt=MSG_FORMAT, datefmt='%m/%d/%Y %I:%M:%S %p' ): super().__init__(fmt=fmt, datefmt=datefmt) def format(self, record): s = super().format(record) return s + "\n" * 2 default_dict_config = { "version": 1, "formatters": { "default": { "()": DefaultFormatter, "format": MSG_FORMAT, } }, "handlers": { "console": { "class": 'logging.StreamHandler', "formatter": "default" }, "file": { "class": "logging.FileHandler", "formatter": "default", "filename": "application.log", "encoding": "utf-8" } }, "loggers": { DEFAULT_LOGGER_NAME: { "level": "ERROR", "handlers": ["console", "file"] }, }, 'root': { 'level': 'DEBUG', 'handlers': ["console"] }, }
[ 1, 529, 276, 1112, 420, 29958, 14769, 314, 381, 29884, 29914, 11739, 29879, 29918, 392, 29918, 21027, 13, 5215, 12183, 13, 5215, 2897, 13, 13, 12194, 4717, 29918, 29968, 29956, 1718, 10749, 353, 6796, 3127, 29918, 1853, 3108, 13, 23397, 29918, 14480, 17070, 29918, 5813, 353, 376, 4381, 29918, 21707, 29908, 13, 4345, 29954, 29918, 19094, 1299, 353, 14210, 29898, 294, 312, 603, 29897, 29879, 448, 12279, 7390, 28541, 14431, 448, 1273, 29898, 5563, 978, 29897, 29879, 29905, 29876, 29915, 320, 13, 632, 525, 2392, 5167, 29901, 1273, 29898, 3127, 29918, 1853, 29897, 29879, 29905, 29876, 29915, 320, 13, 632, 525, 2392, 7777, 29901, 1273, 29898, 4906, 29897, 29879, 29905, 29876, 29915, 13, 13, 5453, 29918, 3972, 353, 2897, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 29897, 13, 23397, 29918, 14480, 29918, 25903, 29918, 7724, 353, 2897, 29889, 2084, 29889, 7122, 29898, 5453, 29918, 3972, 29892, 376, 21027, 29918, 2917, 29889, 25162, 1159, 13, 13, 13, 1990, 13109, 18522, 29898, 21027, 29889, 18522, 1125, 13, 1678, 9995, 13, 1678, 13109, 2643, 883, 2620, 29889, 3462, 29879, 4805, 3765, 3454, 363, 1303, 3097, 29889, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 13, 9651, 1583, 29892, 19200, 29922, 4345, 29954, 29918, 19094, 1299, 29892, 13, 9651, 2635, 23479, 2433, 29995, 29885, 22584, 29881, 22584, 29979, 1273, 29902, 16664, 29924, 16664, 29903, 1273, 29886, 29915, 13, 268, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 23479, 29922, 23479, 29892, 2635, 23479, 29922, 1256, 23479, 29897, 13, 13, 1678, 822, 3402, 29898, 1311, 29892, 2407, 1125, 13, 4706, 269, 353, 2428, 2141, 4830, 29898, 11651, 29897, 13, 4706, 736, 269, 718, 6634, 29876, 29908, 334, 29871, 29906, 13, 13, 13, 4381, 29918, 8977, 29918, 2917, 353, 426, 13, 1678, 376, 3259, 1115, 29871, 29896, 29892, 13, 13, 1678, 376, 4830, 2153, 1115, 426, 13, 4706, 376, 4381, 1115, 426, 13, 9651, 376, 580, 1115, 13109, 18522, 29892, 13, 9651, 376, 4830, 1115, 10888, 29954, 29918, 19094, 1299, 29892, 13, 4706, 500, 13, 1678, 2981, 13, 1678, 376, 3179, 9306, 1115, 426, 13, 4706, 376, 11058, 1115, 426, 13, 9651, 376, 1990, 1115, 525, 21027, 29889, 3835, 4598, 742, 13, 9651, 376, 689, 2620, 1115, 376, 4381, 29908, 13, 4706, 2981, 13, 4706, 376, 1445, 1115, 426, 13, 9651, 376, 1990, 1115, 376, 21027, 29889, 2283, 4598, 613, 13, 9651, 376, 689, 2620, 1115, 376, 4381, 613, 13, 9651, 376, 9507, 1115, 376, 6214, 29889, 1188, 613, 13, 9651, 376, 22331, 1115, 376, 9420, 29899, 29947, 29908, 13, 4706, 500, 13, 1678, 2981, 13, 13, 1678, 376, 1188, 5743, 1115, 426, 13, 4706, 22236, 29918, 14480, 17070, 29918, 5813, 29901, 426, 13, 9651, 376, 5563, 1115, 376, 11432, 613, 13, 9651, 376, 3179, 9306, 1115, 6796, 11058, 613, 376, 1445, 3108, 13, 4706, 2981, 13, 1678, 2981, 13, 13, 1678, 525, 4632, 2396, 426, 13, 4706, 525, 5563, 2396, 525, 18525, 742, 13, 4706, 525, 3179, 9306, 2396, 6796, 11058, 3108, 13, 1678, 2981, 13, 29913, 13, 2 ]
core/management_utils.py
crydotsnake/djangogirls
446
28144
import djclick as click from django.conf import settings from django.utils.translation import gettext_lazy as _ from .forms import AddOrganizerForm from .slack_client import slack # "Get organizers info" functions used in 'new_event' and 'copy_event' management commands. def get_main_organizer(): """ We're asking user for name and address of main organizer, and return a list of dictionary. """ team = [] click.echo(_("Let's talk about the team. First the main organizer:")) main_name = click.prompt(click.style( "First and last name", bold=True, fg='yellow' )) main_email = click.prompt(click.style( "E-mail address", bold=True, fg='yellow' )) team.append({'name': main_name, 'email': main_email}) click.echo("All right, the main organizer is {0} ({1})".format(main_name, main_email)) return team def get_team(team): """ We're asking user for names and address of the rest of the team, and append that to a list we got from get_main_organizer """ add_team = click.confirm(click.style( "Do you want to add additional team members?", bold=True, fg='yellow' ), default=False) i = 1 while add_team: i += 1 name = click.prompt(click.style( f"First and last name of #{i} member", bold=True, fg='yellow' )) email = click.prompt(click.style( f"E-mail address of #{i} member", bold=True, fg='yellow' )) if len(name) > 0: team.append({'name': name, 'email': email}) click.echo( f"All right, the #{i} team member of Django Girls is {name} ({email})" ) add_team = click.confirm(click.style( "Do you want to add additional team members?", bold=True, fg='yellow' ), default=False) return team def create_users(team, event): """ Create or get User objects based on team list """ members = [] for member in team: member['event'] = event.pk form = AddOrganizerForm(member) user = form.save() members.append(user) return members def brag_on_slack_bang(city, country, team): """ This is posting a message about Django Girls new event to #general channel on Slack! """ if settings.ENABLE_SLACK_NOTIFICATIONS: text = f":django_pony: :zap: Woohoo! :tada: New Django Girls alert! " \ f"Welcome Django Girls {city}, {country}. " \ f"Congrats {', '.join(['{} {}'.format(x.first_name, x.last_name) for x in team])}!" slack.chat.post_message( channel='#general', text=text, username='Django Girls', icon_emoji=':django_heart:' )
[ 1, 1053, 270, 29926, 3808, 408, 2828, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 13239, 29889, 3286, 18411, 1053, 679, 726, 29918, 433, 1537, 408, 903, 13, 13, 3166, 869, 9514, 1053, 3462, 27356, 3950, 2500, 13, 3166, 869, 29879, 2364, 29918, 4645, 1053, 269, 2364, 13, 13, 29937, 376, 2577, 8674, 414, 5235, 29908, 3168, 1304, 297, 525, 1482, 29918, 3696, 29915, 322, 525, 8552, 29918, 3696, 29915, 10643, 8260, 29889, 13, 13, 13, 1753, 679, 29918, 3396, 29918, 6388, 3950, 7295, 13, 1678, 9995, 13, 1678, 1334, 29915, 276, 6721, 1404, 363, 1024, 322, 3211, 310, 1667, 2894, 3950, 29892, 322, 736, 13, 1678, 263, 1051, 310, 8600, 29889, 13, 1678, 9995, 13, 1678, 3815, 353, 5159, 13, 1678, 2828, 29889, 8057, 7373, 703, 12024, 29915, 29879, 5193, 1048, 278, 3815, 29889, 3824, 278, 1667, 2894, 3950, 29901, 5783, 13, 1678, 1667, 29918, 978, 353, 2828, 29889, 14032, 415, 29898, 3808, 29889, 3293, 29898, 13, 4706, 376, 6730, 322, 1833, 1024, 613, 14288, 29922, 5574, 29892, 285, 29887, 2433, 29136, 29915, 13, 268, 876, 13, 1678, 1667, 29918, 5269, 353, 2828, 29889, 14032, 415, 29898, 3808, 29889, 3293, 29898, 13, 4706, 376, 29923, 29899, 2549, 3211, 613, 14288, 29922, 5574, 29892, 285, 29887, 2433, 29136, 29915, 13, 268, 876, 13, 13, 1678, 3815, 29889, 4397, 3319, 29915, 978, 2396, 1667, 29918, 978, 29892, 525, 5269, 2396, 1667, 29918, 5269, 1800, 13, 13, 1678, 2828, 29889, 8057, 703, 3596, 1492, 29892, 278, 1667, 2894, 3950, 338, 426, 29900, 29913, 21313, 29896, 1800, 1642, 4830, 29898, 3396, 29918, 978, 29892, 1667, 29918, 5269, 876, 13, 13, 1678, 736, 3815, 13, 13, 13, 1753, 679, 29918, 14318, 29898, 14318, 1125, 13, 1678, 9995, 13, 4706, 1334, 29915, 276, 6721, 1404, 363, 2983, 322, 3211, 310, 278, 1791, 310, 278, 3815, 29892, 13, 4706, 322, 9773, 393, 304, 263, 1051, 591, 2355, 515, 679, 29918, 3396, 29918, 6388, 3950, 13, 1678, 9995, 13, 1678, 788, 29918, 14318, 353, 2828, 29889, 26897, 29898, 3808, 29889, 3293, 29898, 13, 4706, 376, 6132, 366, 864, 304, 788, 5684, 3815, 5144, 29973, 613, 14288, 29922, 5574, 29892, 285, 29887, 2433, 29136, 29915, 13, 1678, 10353, 2322, 29922, 8824, 29897, 13, 1678, 474, 353, 29871, 29896, 13, 1678, 1550, 788, 29918, 14318, 29901, 13, 4706, 474, 4619, 29871, 29896, 13, 4706, 1024, 353, 2828, 29889, 14032, 415, 29898, 3808, 29889, 3293, 29898, 13, 9651, 285, 29908, 6730, 322, 1833, 1024, 310, 24037, 29875, 29913, 4509, 613, 14288, 29922, 5574, 29892, 285, 29887, 2433, 29136, 29915, 13, 308, 876, 13, 4706, 4876, 353, 2828, 29889, 14032, 415, 29898, 3808, 29889, 3293, 29898, 13, 9651, 285, 29908, 29923, 29899, 2549, 3211, 310, 24037, 29875, 29913, 4509, 613, 14288, 29922, 5574, 29892, 285, 29887, 2433, 29136, 29915, 13, 308, 876, 13, 4706, 565, 7431, 29898, 978, 29897, 1405, 29871, 29900, 29901, 13, 9651, 3815, 29889, 4397, 3319, 29915, 978, 2396, 1024, 29892, 525, 5269, 2396, 4876, 1800, 13, 9651, 2828, 29889, 8057, 29898, 13, 18884, 285, 29908, 3596, 1492, 29892, 278, 24037, 29875, 29913, 3815, 4509, 310, 15337, 23992, 338, 426, 978, 29913, 21313, 5269, 1800, 29908, 13, 9651, 1723, 13, 4706, 788, 29918, 14318, 353, 2828, 29889, 26897, 29898, 3808, 29889, 3293, 29898, 13, 9651, 376, 6132, 366, 864, 304, 788, 5684, 3815, 5144, 29973, 613, 14288, 29922, 5574, 29892, 285, 29887, 2433, 29136, 29915, 13, 4706, 10353, 2322, 29922, 8824, 29897, 13, 13, 1678, 736, 3815, 13, 13, 13, 1753, 1653, 29918, 7193, 29898, 14318, 29892, 1741, 1125, 13, 1678, 9995, 13, 4706, 6204, 470, 679, 4911, 3618, 2729, 373, 3815, 1051, 13, 1678, 9995, 13, 1678, 5144, 353, 5159, 13, 1678, 363, 4509, 297, 3815, 29901, 13, 4706, 4509, 1839, 3696, 2033, 353, 1741, 29889, 20571, 13, 4706, 883, 353, 3462, 27356, 3950, 2500, 29898, 14242, 29897, 13, 4706, 1404, 353, 883, 29889, 7620, 580, 13, 4706, 5144, 29889, 4397, 29898, 1792, 29897, 13, 1678, 736, 5144, 13, 13, 13, 1753, 289, 1431, 29918, 265, 29918, 29879, 2364, 29918, 29890, 574, 29898, 12690, 29892, 4234, 29892, 3815, 1125, 13, 1678, 9995, 13, 1678, 910, 338, 16742, 263, 2643, 1048, 15337, 23992, 716, 1741, 304, 396, 17492, 8242, 373, 317, 2364, 29991, 13, 1678, 9995, 13, 1678, 565, 6055, 29889, 1430, 6181, 29918, 12750, 11375, 29918, 12256, 6545, 28541, 29903, 29901, 13, 4706, 1426, 353, 285, 1115, 14095, 29918, 1112, 29891, 29901, 584, 29920, 481, 29901, 14962, 1148, 3634, 29991, 584, 29873, 1114, 29901, 1570, 15337, 23992, 6655, 29991, 376, 320, 13, 1669, 285, 29908, 28862, 2763, 15337, 23992, 426, 12690, 1118, 426, 13509, 1836, 376, 320, 13, 1669, 285, 29908, 29907, 549, 29878, 1446, 426, 742, 15300, 7122, 18959, 8875, 6571, 4286, 4830, 29898, 29916, 29889, 4102, 29918, 978, 29892, 921, 29889, 4230, 29918, 978, 29897, 363, 921, 297, 3815, 2314, 29913, 3850, 13, 13, 4706, 269, 2364, 29889, 13496, 29889, 2490, 29918, 4906, 29898, 13, 9651, 8242, 2433, 29937, 17492, 742, 13, 9651, 1426, 29922, 726, 29892, 13, 9651, 8952, 2433, 29928, 5364, 23992, 742, 13, 9651, 9849, 29918, 15810, 2397, 29922, 2396, 14095, 29918, 23057, 11283, 13, 4706, 1723, 13, 2 ]
es_sink/es_sink/__init__.py
avmi/community
305
192747
__all__ = ['descriptor', 'es_transport', 'flushing_buffer', 'line_buffer', 'sqs_transport', 'transport_exceptions', 'transport_result', 'transport_utils']
[ 1, 4770, 497, 1649, 353, 6024, 2783, 11709, 742, 13, 965, 525, 267, 29918, 27882, 742, 13, 965, 525, 1579, 21616, 29918, 9040, 742, 13, 965, 525, 1220, 29918, 9040, 742, 13, 965, 525, 3044, 29879, 29918, 27882, 742, 13, 965, 525, 27882, 29918, 11739, 29879, 742, 13, 965, 525, 27882, 29918, 2914, 742, 13, 965, 525, 27882, 29918, 13239, 2033, 2 ]
one_off/extractor.py
snspam/sn_spam
0
162076
import re import pandas as pd import util as ut import argparse def extract(df, target_col='text', info_type='link', out_dir=''): ut.makedirs(out_dir) df = df[['com_id', target_col]] ut.out('target column: %s, info type: %s' % (target_col, info_type)) if info_type == 'text': ut.out('writing info to csv...\n') df.to_csv(out_dir + info_type + '.csv', index=None) return d, i = {}, 0 regex = _get_regex(info_type) df = df[['com_id', target_col]] for ndx, com_id, text in df.itertuples(): i += 1 if i % 100000 == 0: ut.out('(%d/%d)...' % (i, len(df))) info = _get_items(text, regex) if info != '': d[com_id] = info if len(d) > 0: info_df = pd.DataFrame.from_dict(d, orient='index').reset_index() info_df.columns = ['com_id', info_type] fname = info_type + '.csv' ut.out(str(info_df)) ut.out('writing info to csv...\n') info_df.to_csv(out_dir + fname, index=None) else: ut.out('No extractions made...') # private def _get_regex(info_type='link'): d = {} d['hashtag'] = re.compile(r'(#\w+)') d['mention'] = re.compile(r'(@\w+)') d['link'] = re.compile(r'(http[^\s]+)') return d[info_type] def _get_items(text, regex, str_form=True): items = regex.findall(str(text)) result = sorted([x.lower() for x in items]) if str_form: result = ''.join(result) return result if __name__ == '__main__': description = 'Extracts elements from strings (links, hashtags, etc.)' parser = argparse.ArgumentParser(description=description) parser.add_argument('-t', '--target_col', default='text', help='column to extract from, default: %(default)s') parser.add_argument('-i', '--info_type', default='hashtag', help='type of element to extract default: %(default)s') parser.add_argument('-d', '--domain', default='twitter', help='social network, default: %(default)s') parser.add_argument('-n', '--nrows', default=None, help='number of rows to read, default: %(default)s') args = parser.parse_args() domain = args.domain target_col = args.target_col info_type = args.info_type nrows = int(args.nrows) if args.nrows is not None else None data_dir = 'independent/data/' + domain + '/' out_dir = 'independent/data/' + domain + '/extractions/' ut.out('reading in data...') df = pd.read_csv(data_dir + 'comments.csv', nrows=nrows) extract(df, target_col=target_col, info_type=info_type, out_dir=out_dir)
[ 1, 1053, 337, 13, 5215, 11701, 408, 10518, 13, 5215, 3667, 408, 3477, 13, 5215, 1852, 5510, 13, 13, 13, 1753, 6597, 29898, 2176, 29892, 3646, 29918, 1054, 2433, 726, 742, 5235, 29918, 1853, 2433, 2324, 742, 714, 29918, 3972, 2433, 29374, 13, 1678, 3477, 29889, 29885, 12535, 12935, 29898, 449, 29918, 3972, 29897, 13, 1678, 4489, 353, 4489, 29961, 1839, 510, 29918, 333, 742, 3646, 29918, 1054, 5262, 13, 13, 1678, 3477, 29889, 449, 877, 5182, 1897, 29901, 1273, 29879, 29892, 5235, 1134, 29901, 1273, 29879, 29915, 1273, 313, 5182, 29918, 1054, 29892, 5235, 29918, 1853, 876, 13, 13, 1678, 565, 5235, 29918, 1853, 1275, 525, 726, 2396, 13, 4706, 3477, 29889, 449, 877, 16554, 5235, 304, 11799, 856, 29905, 29876, 1495, 13, 4706, 4489, 29889, 517, 29918, 7638, 29898, 449, 29918, 3972, 718, 5235, 29918, 1853, 718, 15300, 7638, 742, 2380, 29922, 8516, 29897, 13, 4706, 736, 13, 13, 1678, 270, 29892, 474, 353, 24335, 29871, 29900, 13, 1678, 6528, 353, 903, 657, 29918, 13087, 29898, 3888, 29918, 1853, 29897, 13, 13, 1678, 4489, 353, 4489, 29961, 1839, 510, 29918, 333, 742, 3646, 29918, 1054, 5262, 13, 1678, 363, 29871, 299, 29916, 29892, 419, 29918, 333, 29892, 1426, 297, 4489, 29889, 277, 814, 29884, 2701, 7295, 13, 4706, 474, 4619, 29871, 29896, 13, 4706, 565, 474, 1273, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 1275, 29871, 29900, 29901, 13, 9651, 3477, 29889, 449, 877, 29414, 29881, 22584, 29881, 467, 636, 29915, 1273, 313, 29875, 29892, 7431, 29898, 2176, 4961, 13, 13, 4706, 5235, 353, 903, 657, 29918, 7076, 29898, 726, 29892, 6528, 29897, 13, 4706, 565, 5235, 2804, 525, 2396, 13, 9651, 270, 29961, 510, 29918, 333, 29962, 353, 5235, 13, 13, 1678, 565, 7431, 29898, 29881, 29897, 1405, 29871, 29900, 29901, 13, 4706, 5235, 29918, 2176, 353, 10518, 29889, 17271, 29889, 3166, 29918, 8977, 29898, 29881, 29892, 7769, 2433, 2248, 2824, 12071, 29918, 2248, 580, 13, 4706, 5235, 29918, 2176, 29889, 13099, 353, 6024, 510, 29918, 333, 742, 5235, 29918, 1853, 29962, 13, 4706, 285, 978, 353, 5235, 29918, 1853, 718, 15300, 7638, 29915, 13, 4706, 3477, 29889, 449, 29898, 710, 29898, 3888, 29918, 2176, 876, 13, 4706, 3477, 29889, 449, 877, 16554, 5235, 304, 11799, 856, 29905, 29876, 1495, 13, 4706, 5235, 29918, 2176, 29889, 517, 29918, 7638, 29898, 449, 29918, 3972, 718, 285, 978, 29892, 2380, 29922, 8516, 29897, 13, 1678, 1683, 29901, 13, 4706, 3477, 29889, 449, 877, 3782, 4805, 1953, 1754, 856, 1495, 13, 13, 13, 29937, 2024, 13, 1753, 903, 657, 29918, 13087, 29898, 3888, 29918, 1853, 2433, 2324, 29374, 13, 1678, 270, 353, 6571, 13, 1678, 270, 1839, 5349, 400, 351, 2033, 353, 337, 29889, 12198, 29898, 29878, 12215, 29937, 29905, 29893, 28135, 1495, 13, 1678, 270, 1839, 358, 291, 2033, 353, 337, 29889, 12198, 29898, 29878, 29915, 10394, 29905, 29893, 28135, 1495, 13, 1678, 270, 1839, 2324, 2033, 353, 337, 29889, 12198, 29898, 29878, 12215, 1124, 29961, 3823, 29879, 10062, 29897, 1495, 13, 1678, 736, 270, 29961, 3888, 29918, 1853, 29962, 13, 13, 13, 1753, 903, 657, 29918, 7076, 29898, 726, 29892, 6528, 29892, 851, 29918, 689, 29922, 5574, 1125, 13, 1678, 4452, 353, 6528, 29889, 2886, 497, 29898, 710, 29898, 726, 876, 13, 1678, 1121, 353, 12705, 4197, 29916, 29889, 13609, 580, 363, 921, 297, 4452, 2314, 13, 1678, 565, 851, 29918, 689, 29901, 13, 4706, 1121, 353, 525, 4286, 7122, 29898, 2914, 29897, 13, 1678, 736, 1121, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 6139, 353, 525, 5647, 1461, 29879, 3161, 515, 6031, 313, 4965, 29892, 756, 400, 810, 29892, 2992, 1846, 29915, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 8216, 29922, 8216, 29897, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29873, 742, 525, 489, 5182, 29918, 1054, 742, 2322, 2433, 726, 742, 13, 462, 4706, 1371, 2433, 4914, 304, 6597, 515, 29892, 2322, 29901, 1273, 29898, 4381, 29897, 29879, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29875, 742, 525, 489, 3888, 29918, 1853, 742, 2322, 2433, 5349, 400, 351, 742, 13, 462, 4706, 1371, 2433, 1853, 310, 1543, 304, 6597, 2322, 29901, 1273, 29898, 4381, 29897, 29879, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29881, 742, 525, 489, 7247, 742, 2322, 2433, 24946, 742, 13, 462, 4706, 1371, 2433, 24911, 3564, 29892, 2322, 29901, 1273, 29898, 4381, 29897, 29879, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 29899, 29876, 742, 525, 489, 29876, 5727, 742, 2322, 29922, 8516, 29892, 13, 462, 4706, 1371, 2433, 4537, 310, 4206, 304, 1303, 29892, 2322, 29901, 1273, 29898, 4381, 29897, 29879, 1495, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 1678, 5354, 353, 6389, 29889, 7247, 13, 1678, 3646, 29918, 1054, 353, 6389, 29889, 5182, 29918, 1054, 13, 1678, 5235, 29918, 1853, 353, 6389, 29889, 3888, 29918, 1853, 13, 1678, 302, 5727, 353, 938, 29898, 5085, 29889, 29876, 5727, 29897, 565, 6389, 29889, 29876, 5727, 338, 451, 6213, 1683, 6213, 13, 13, 1678, 848, 29918, 3972, 353, 525, 262, 18980, 29914, 1272, 22208, 718, 5354, 718, 8207, 29915, 13, 1678, 714, 29918, 3972, 353, 525, 262, 18980, 29914, 1272, 22208, 718, 5354, 718, 8207, 17833, 1953, 22208, 13, 13, 1678, 3477, 29889, 449, 877, 19715, 297, 848, 856, 1495, 13, 1678, 4489, 353, 10518, 29889, 949, 29918, 7638, 29898, 1272, 29918, 3972, 718, 525, 21032, 29889, 7638, 742, 302, 5727, 29922, 29876, 5727, 29897, 13, 1678, 6597, 29898, 2176, 29892, 3646, 29918, 1054, 29922, 5182, 29918, 1054, 29892, 5235, 29918, 1853, 29922, 3888, 29918, 1853, 29892, 714, 29918, 3972, 29922, 449, 29918, 3972, 29897, 13, 2 ]
openconnect-cli.py
tcpipuk/OpenConnect-FE
0
26741
#!/usr/bin/env python3 import argparse, pexpect from getpass import getpass from time import sleep # Set up argument parser parser = argparse.ArgumentParser(prog='openconnect-cli', description='Automate logins to the OpenConnect SSL VPN client') # Type of VPN to initiate parser_type = parser.add_mutually_exclusive_group(required=False) parser_type.add_argument('--anyconnect', action='store_true', default=False, help='Cisco AnyConnect SSL VPN') parser_type.add_argument('--fortinet', action='store_true', default=False, help='Fortinet FortiClient SSL VPN') parser_type.add_argument('--pulsesecure', action='store_true', default=False, help='Juniper Network Connect / Pulse Secure SSL VPN') parser_type.add_argument('--paloalto', action='store_true', default=False, help='Palo Alto Networks (PAN) GlobalProtect SSL VPN') # VPN server details parser_dst = parser.add_argument_group('VPN Server Details', 'Any missing fields will be prompted on launch') parser_dst.add_argument('--host', type=str, default=False, help='DNS hostname of SSL VPN server') parser_dst.add_argument('--user', type=str, default=False, help='Username for SSL VPN account') parser_dst.add_argument('--pw', type=str, default=False, help='Password for SSL VPN account') # Import options, output help if none provided args = vars(parser.parse_args()) #args = vars(parser.parse_args(args=None if sys.argv[1:] else ['--help'])) def vpnTypePrompt(): try: print('Please enter one of the following and press enter:') print('1 for Cisco AnyConnect') print('2 for Fortinet FortiClient') print('3 for Pulse Secure or Juniper Network Connect') print('4 for Palo Alto Networks GlobalProtect') protocol = int(input('SSL VPN Type: ')) if protocol == 1: return 'anyconnect' elif protocol == 2: return 'fortinet' elif protocol == 3: return 'nc' elif protocol == 4: return 'gp' else: return False except: return False if 'anyconnect' in args and args['anyconnect']: args['protocol'] = 'anyconnect' elif 'fortinet' in args and args['fortinet']: args['protocol'] = 'fortinet' elif 'pulsesecure' in args and args['pulsesecure']: args['protocol'] = 'nc' elif 'paloalto' in args and args['paloalto']: args['protocol'] = 'gp' else: args['protocol'] = False while args['protocol'] == False: args['protocol'] = vpnTypePrompt() # Fields to prompt for when False prompt_for = { 'host': 'DNS hostname of SSL VPN server: ', 'user': 'Username for SSL VPN account: ', 'pw': 'Password for SSL VPN account: ' } # Interate through fields and prompt for missing ones if 'help' not in args: for field,prompt in prompt_for.items(): if str(field) not in args or not args[field]: while args[field] == False: try: if field == 'pw' and args['protocol'] != 'gp': args[field] = 'N/A' elif field == 'pw': args[field] = getpass(prompt) else: args[field] = input(prompt) except: pass # Collate arguments for command command = [ 'sudo openconnect', '--interface=vpn0', '--script=/usr/share/vpnc-scripts/vpnc-script', '--protocol="' + args['protocol'] + '"', '--user="' + args['user'] + '"', args['host'] ] # Compile command command = ' '.join(command) # Start process process = pexpect.spawnu('/bin/bash', ['-c', command]) # Automate login process for Palo Alto GlobalProtect if args['protocol'] == 'gp': process.expect('Password: ') process.sendline(args['pw']) process.expect('GATEWAY: ') process.sendline('Primary GP') process.expect('anything else to view:') process.sendline('yes') process.expect('Password: ') process.sendline(args['pw']) # Clear remaining private data args = None command = None # Hand over input to user, wait for process to end if interactive mode ends process.interact() while process.isalive(): sleep(5)
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 5215, 1852, 5510, 29892, 282, 17854, 13, 3166, 679, 3364, 1053, 679, 3364, 13, 3166, 931, 1053, 8709, 13, 13, 29937, 3789, 701, 2980, 13812, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 29898, 29097, 2433, 3150, 6915, 29899, 11303, 742, 6139, 2433, 28451, 403, 1480, 1144, 304, 278, 4673, 17918, 17122, 478, 15695, 3132, 1495, 13, 13, 29937, 5167, 310, 478, 15695, 304, 14511, 403, 13, 16680, 29918, 1853, 353, 13812, 29889, 1202, 29918, 6149, 1474, 29918, 735, 7009, 573, 29918, 2972, 29898, 12403, 29922, 8824, 29897, 13, 16680, 29918, 1853, 29889, 1202, 29918, 23516, 877, 489, 1384, 6915, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 1371, 2433, 29907, 275, 1111, 3139, 17918, 17122, 478, 15695, 1495, 13, 16680, 29918, 1853, 29889, 1202, 29918, 23516, 877, 489, 3921, 10157, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 1371, 2433, 29943, 441, 10157, 7236, 29875, 4032, 17122, 478, 15695, 1495, 13, 16680, 29918, 1853, 29889, 1202, 29918, 23516, 877, 489, 29886, 7273, 267, 687, 545, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 1371, 2433, 29967, 3909, 546, 8527, 14971, 847, 349, 19994, 5356, 545, 17122, 478, 15695, 1495, 13, 16680, 29918, 1853, 29889, 1202, 29918, 23516, 877, 489, 29886, 7003, 284, 517, 742, 3158, 2433, 8899, 29918, 3009, 742, 2322, 29922, 8824, 29892, 1371, 2433, 29925, 7003, 838, 517, 8527, 29879, 313, 29925, 2190, 29897, 12002, 1184, 371, 312, 17122, 478, 15695, 1495, 13, 13, 29937, 478, 15695, 1923, 4902, 13, 16680, 29918, 22992, 353, 13812, 29889, 1202, 29918, 23516, 29918, 2972, 877, 29963, 15695, 5656, 25577, 742, 525, 10773, 4567, 4235, 674, 367, 9508, 287, 373, 6826, 1495, 13, 16680, 29918, 22992, 29889, 1202, 29918, 23516, 877, 489, 3069, 742, 1134, 29922, 710, 29892, 2322, 29922, 8824, 29892, 1371, 2433, 29928, 3059, 3495, 978, 310, 17122, 478, 15695, 1923, 1495, 13, 16680, 29918, 22992, 29889, 1202, 29918, 23516, 877, 489, 1792, 742, 1134, 29922, 710, 29892, 2322, 29922, 8824, 29892, 1371, 2433, 20249, 363, 17122, 478, 15695, 3633, 1495, 13, 16680, 29918, 22992, 29889, 1202, 29918, 23516, 877, 489, 29886, 29893, 742, 1134, 29922, 710, 29892, 2322, 29922, 8824, 29892, 1371, 2433, 10048, 363, 17122, 478, 15695, 3633, 1495, 13, 13, 29937, 16032, 3987, 29892, 1962, 1371, 565, 5642, 4944, 13, 5085, 353, 24987, 29898, 16680, 29889, 5510, 29918, 5085, 3101, 13, 29937, 5085, 353, 24987, 29898, 16680, 29889, 5510, 29918, 5085, 29898, 5085, 29922, 8516, 565, 10876, 29889, 19218, 29961, 29896, 17531, 1683, 6024, 489, 8477, 25901, 13, 13, 1753, 325, 21257, 1542, 18571, 415, 7295, 13, 29871, 1018, 29901, 13, 1678, 1596, 877, 12148, 3896, 697, 310, 278, 1494, 322, 3965, 3896, 29901, 1495, 13, 1678, 1596, 877, 29896, 363, 315, 275, 1111, 3139, 17918, 1495, 13, 1678, 1596, 877, 29906, 363, 7236, 10157, 7236, 29875, 4032, 1495, 13, 1678, 1596, 877, 29941, 363, 349, 19994, 5356, 545, 470, 7452, 546, 8527, 14971, 1495, 13, 1678, 1596, 877, 29946, 363, 3793, 29877, 838, 517, 8527, 29879, 12002, 1184, 371, 312, 1495, 13, 1678, 9608, 353, 938, 29898, 2080, 877, 18641, 478, 15695, 5167, 29901, 525, 876, 13, 1678, 565, 9608, 1275, 29871, 29896, 29901, 13, 418, 736, 525, 1384, 6915, 29915, 13, 1678, 25342, 9608, 1275, 29871, 29906, 29901, 13, 418, 736, 525, 3921, 10157, 29915, 13, 1678, 25342, 9608, 1275, 29871, 29941, 29901, 13, 418, 736, 525, 17608, 29915, 13, 1678, 25342, 9608, 1275, 29871, 29946, 29901, 13, 418, 736, 525, 29887, 29886, 29915, 13, 1678, 1683, 29901, 13, 418, 736, 7700, 13, 29871, 5174, 29901, 13, 1678, 736, 7700, 13, 13, 361, 525, 1384, 6915, 29915, 297, 6389, 322, 6389, 1839, 1384, 6915, 2033, 29901, 13, 29871, 6389, 1839, 20464, 2033, 353, 525, 1384, 6915, 29915, 13, 23681, 525, 3921, 10157, 29915, 297, 6389, 322, 6389, 1839, 3921, 10157, 2033, 29901, 13, 29871, 6389, 1839, 20464, 2033, 353, 525, 3921, 10157, 29915, 13, 23681, 525, 29886, 7273, 267, 687, 545, 29915, 297, 6389, 322, 6389, 1839, 29886, 7273, 267, 687, 545, 2033, 29901, 13, 29871, 6389, 1839, 20464, 2033, 353, 525, 17608, 29915, 13, 23681, 525, 29886, 7003, 284, 517, 29915, 297, 6389, 322, 6389, 1839, 29886, 7003, 284, 517, 2033, 29901, 13, 29871, 6389, 1839, 20464, 2033, 353, 525, 29887, 29886, 29915, 13, 2870, 29901, 13, 29871, 6389, 1839, 20464, 2033, 353, 7700, 13, 29871, 1550, 6389, 1839, 20464, 2033, 1275, 7700, 29901, 13, 1678, 6389, 1839, 20464, 2033, 353, 325, 21257, 1542, 18571, 415, 580, 13, 13, 29937, 8989, 29879, 304, 9508, 363, 746, 7700, 13, 14032, 415, 29918, 1454, 353, 426, 13, 29871, 525, 3069, 2396, 525, 29928, 3059, 3495, 978, 310, 17122, 478, 15695, 1923, 29901, 13420, 13, 29871, 525, 1792, 2396, 525, 20249, 363, 17122, 478, 15695, 3633, 29901, 13420, 13, 29871, 525, 29886, 29893, 2396, 525, 10048, 363, 17122, 478, 15695, 3633, 29901, 525, 13, 29913, 13, 13, 29937, 4124, 403, 1549, 4235, 322, 9508, 363, 4567, 6743, 13, 361, 525, 8477, 29915, 451, 297, 6389, 29901, 13, 29871, 363, 1746, 29892, 14032, 415, 297, 9508, 29918, 1454, 29889, 7076, 7295, 13, 1678, 565, 851, 29898, 2671, 29897, 451, 297, 6389, 470, 451, 6389, 29961, 2671, 5387, 13, 418, 1550, 6389, 29961, 2671, 29962, 1275, 7700, 29901, 13, 4706, 1018, 29901, 13, 3986, 565, 1746, 1275, 525, 29886, 29893, 29915, 322, 6389, 1839, 20464, 2033, 2804, 525, 29887, 29886, 2396, 13, 9651, 6389, 29961, 2671, 29962, 353, 525, 29940, 29914, 29909, 29915, 13, 3986, 25342, 1746, 1275, 525, 29886, 29893, 2396, 13, 9651, 6389, 29961, 2671, 29962, 353, 679, 3364, 29898, 14032, 415, 29897, 13, 3986, 1683, 29901, 13, 9651, 6389, 29961, 2671, 29962, 353, 1881, 29898, 14032, 415, 29897, 13, 4706, 5174, 29901, 13, 3986, 1209, 13, 13, 29937, 1530, 9632, 6273, 363, 1899, 13, 6519, 353, 518, 13, 29871, 525, 15360, 1722, 6915, 742, 13, 1678, 525, 489, 13248, 29922, 29894, 21257, 29900, 742, 13, 1678, 525, 489, 2154, 14327, 4855, 29914, 13653, 29914, 29894, 29886, 17608, 29899, 16713, 29914, 29894, 29886, 17608, 29899, 2154, 742, 13, 1678, 525, 489, 20464, 543, 29915, 718, 6389, 1839, 20464, 2033, 718, 18793, 742, 13, 1678, 525, 489, 1792, 543, 29915, 718, 6389, 1839, 1792, 2033, 718, 18793, 742, 13, 1678, 6389, 1839, 3069, 2033, 13, 29962, 13, 13, 29937, 3831, 488, 1899, 13, 6519, 353, 525, 15300, 7122, 29898, 6519, 29897, 13, 13, 29937, 7370, 1889, 13, 5014, 353, 282, 17854, 29889, 1028, 18101, 29884, 11219, 2109, 29914, 13067, 742, 6024, 29899, 29883, 742, 1899, 2314, 13, 13, 29937, 15854, 403, 6464, 1889, 363, 3793, 29877, 838, 517, 12002, 1184, 371, 312, 13, 361, 6389, 1839, 20464, 2033, 1275, 525, 29887, 29886, 2396, 13, 29871, 1889, 29889, 17854, 877, 10048, 29901, 25710, 13, 29871, 1889, 29889, 6717, 1220, 29898, 5085, 1839, 29886, 29893, 11287, 13, 29871, 1889, 29889, 17854, 877, 29954, 3040, 12982, 29979, 29901, 25710, 13, 29871, 1889, 29889, 6717, 1220, 877, 26666, 28258, 1495, 13, 29871, 1889, 29889, 17854, 877, 1384, 1918, 1683, 304, 1776, 29901, 1495, 13, 29871, 1889, 29889, 6717, 1220, 877, 3582, 1495, 13, 29871, 1889, 29889, 17854, 877, 10048, 29901, 25710, 13, 29871, 1889, 29889, 6717, 1220, 29898, 5085, 1839, 29886, 29893, 11287, 13, 13, 29937, 17732, 9886, 2024, 848, 13, 5085, 353, 6213, 13, 6519, 353, 6213, 13, 13, 29937, 5166, 975, 1881, 304, 1404, 29892, 4480, 363, 1889, 304, 1095, 565, 28923, 4464, 10614, 13, 5014, 29889, 1639, 627, 580, 13, 8000, 1889, 29889, 275, 284, 573, 7295, 13, 29871, 8709, 29898, 29945, 29897, 13, 2 ]
ansible_collections/arista/cvp/plugins/module_utils/facts_tools.py
mtache/ansible-cvp
0
168348
#!/usr/bin/env python # coding: utf-8 -*- # # GNU General Public License v3.0+ # # Copyright 2022 Arista Networks AS-EMEA # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from __future__ import (absolute_import, division, print_function) __metaclass__ = type import traceback import logging import re import os from typing import List from concurrent.futures import ThreadPoolExecutor import ansible_collections.arista.cvp.plugins.module_utils.logger # noqa # pylint: disable=unused-import from ansible_collections.arista.cvp.plugins.module_utils.resources.api.fields import Api from ansible_collections.arista.cvp.plugins.module_utils.resources.modules.fields import FactsResponseFields import ansible_collections.arista.cvp.plugins.module_utils.tools_schema as schema # noqa # pylint: disable=unused-import try: from cvprac.cvp_client import CvpClient # noqa # pylint: disable=unused-import from cvprac.cvp_client_errors import CvpApiError, CvpRequestError # noqa # pylint: disable=unused-import HAS_CVPRAC = True except ImportError: HAS_CVPRAC = False CVPRAC_IMP_ERR = traceback.format_exc() try: import jsonschema # noqa # pylint: disable=unused-import HAS_JSONSCHEMA = True except ImportError: HAS_JSONSCHEMA = False MODULE_LOGGER = logging.getLogger(__name__) MODULE_LOGGER.info('Start fact_tools module execution') # ------------------------------------------ # # Class # ------------------------------------------ # class CvFactResource(): """ CvFactResource Helper to render facts based on resource type """ def __init__(self, facts_type: str = 'list'): if facts_type == 'list': self._cache = [] def __shorten_device_facts(self, device_fact: dict): """ __shorten_device_facts Filter content to return for device type resource Parameters ---------- device_fact : dict Dictionary of data provided by Cloudvision Returns ------- dict Dict with only expected fields to be compliant with resource schema """ fact = { key: device_fact[key] for key in [ Api.device.HOSTNAME, Api.device.FQDN, Api.device.SERIAL, Api.device.SYSMAC, Api.generic.CONFIGLETS, ] } fact[Api.generic.PARENT_CONTAINER_NAME] = device_fact[Api.device.CONTAINER_NAME] return fact def _get_configlet(self): """ _get_configlets Generate facts for configlets resource type EXAMPLE: -------- >>> CvFactsResource()._get_configlet() { "TEAM01-alias": "alias a1 show version", "TEAM01-another-configlet": "alias a2 show version" } Returns ------- dict dictionary of configlets. """ if isinstance(self._cache, list): return {configlet[Api.generic.NAME]: configlet[Api.generic.CONFIG] for configlet in self._cache} def _get_container(self): """ _get_container Generate facts for containers resource type EXAMPLE: -------- >>> CvFactsResource()._get_container() { "TEAM01": { "parentContainerName": "Tenant" }, "TEAM01_DC": { "parentContainerName": "TEAM01" }, "TEAM01_LEAFS": { "parentContainerName": "TEAM01_DC", "configlets": [ "GLOBAL-ALIASES" ] } } Returns ------- dict dictionary of containers """ if isinstance(self._cache, list): return {entry[Api.generic.NAME]: { Api.generic.PARENT_CONTAINER_NAME: entry[Api.container.PARENT_NAME], Api.generic.CONFIGLETS: entry[Api.generic.CONFIGLETS]} for entry in self._cache if Api.generic.NAME in entry.keys()} def _get_device(self, verbose: bool = False): """ _get_device Generate facts for devices resource type EXAMPLE: -------- >>> CvFactsResource()._get_device() [ { "fqdn": "CV-ANSIBLE-EOS01", "parentContainerName": "ANSIBLE", "configlets": [ "01TRAINING-01" ], "systemMacAddress": "50:8d:00:e3:78:aa", "serialNumber": "64793E1D3DE2240F547E5964354214A4" } ] Parameters ---------- verbose : bool, optional Trigger to include or not all fields from CV, by default False Returns ------- list List of devices """ if verbose: return self._cache else: return [self.__shorten_device_facts( device_fact=device) for device in self._cache] def add(self, data): """ add Add an entry in the list of facts Parameters ---------- data : Any Data to add as a new entry in the fact list. Should be a dict """ if isinstance(self._cache, list): self._cache.append(data) def get(self, resource_model: str, verbose: bool = False): """ get Public method to get structured fact for a given resource This method transform list of data available in its cache to be exposed using CV module schema. Resource_type input will apply correct data transformation to be compatible with cv modules. Parameters ---------- resource_model : str Name of the resource to apply correct transformation. Can be ['device', 'container', 'configlet'] verbose : bool, optional Trigger to include or not all fields from CV, by default False Returns ------- Any Facts based on resource_type data model. """ if resource_model == 'configlet': return self._get_configlet() elif resource_model == 'container': return self._get_container() elif resource_model == 'device': return self._get_device(verbose=verbose) class CvFactsTools(): """ CvFactsTools Object to operate Facts from Cloudvision """ def __init__(self, cv_connection): self.__cv_client = cv_connection self._cache = {FactsResponseFields.CACHE_CONTAINERS: None, FactsResponseFields.CACHE_MAPPERS: None} self._max_worker = min(32, (os.cpu_count() or 1) + 4) self.__init_facts() def __init_facts(self): self._facts = {FactsResponseFields.DEVICE: [], FactsResponseFields.CONFIGLET: [], FactsResponseFields.CONTAINER: []} def facts(self, scope: List[str], regex_filter: str = '.*'): """ facts Public API to collect facts from Cloudvision Examples -------- >>> result = self.inventory.facts(scope=['configlets']) { "cvp_containers": { "Tenant": { "parentContainerName": "None", "configlets": [] }, "Undefined": { "parentContainerName": "Tenant", "configlets": [] }, "EAPI": { "parentContainerName": "Tenant", "configlets": [ "demo" ] } } } Parameters ---------- scope : List[str] List of elements to get from Cloudvision server, by default ['devices', 'containers'] regex_filter: str Regular expression to filter devices and configlets. Only element with filter in their name will be exported Returns ------- dict A dictionary of information with all the data from Cloudvision """ if 'devices' in scope: self.__fact_devices(filter=regex_filter) if 'containers' in scope: self.__fact_containers() if 'configlets' in scope: self.__fact_configlets(filter=regex_filter) return self._facts def __get_container_name(self, key: str = Api.container.UNDEFINED_CONTAINER_ID): """ __get_container_name Helper to get container name from its key Send a call to CV to get name of a container key Parameters ---------- key : str, optional Container key, by default '<PASSWORD>' Returns ------- str Container name """ if self._cache[FactsResponseFields.CACHE_CONTAINERS] is None: MODULE_LOGGER.warning('Build container cache from Cloudvision') try: self._cache[FactsResponseFields.CACHE_CONTAINERS] = self.__cv_client.api.get_containers()['data'] except CvpApiError as error: MODULE_LOGGER.error('Can\'t get information from CV: %s', str(error)) return None MODULE_LOGGER.debug('Current cache data is: %s', str(self._cache[FactsResponseFields.CACHE_CONTAINERS])) for container in self._cache[FactsResponseFields.CACHE_CONTAINERS]: if key == container[Api.generic.KEY]: return container[Api.generic.NAME] return None def __device_update_info(self, device: dict): """ __device_update_info Helper to add missing information for device facts Add or update fields from CV response to make output valid with arista.cvp.cv_device_v3 schema Parameters ---------- device : dict Device data from Cloudvision Returns ------- dict Updated information """ if device['status'] != '': device[Api.generic.PARENT_CONTAINER_NAME] = self.__get_container_name(key=device[Api.device.PARENT_CONTAINER_KEY]) else: device[Api.generic.PARENT_CONTAINER_NAME] = '' return device def __configletIds_to_configletName(self, configletIds: List[str]): """ __configletIds_to_configletName Build a list of configlets name from a list of configlets ID Extract list of configlets name from CVP mappers based on a list of configlets ID provided as an input Parameters ---------- configletIds : List[str] List of configlet IDs Returns ------- List[str] List of configlets name """ if not configletIds: return [] if self._cache[FactsResponseFields.CACHE_MAPPERS] is None: MODULE_LOGGER.warning('Build configlet mappers cache from Cloudvision') self._cache[FactsResponseFields.CACHE_MAPPERS] = self.__cv_client.api.get_configlets_and_mappers()['data'] configlets = self._cache[FactsResponseFields.CACHE_MAPPERS][Api.generic.CONFIGLETS] return [configlet[Api.generic.NAME] for configlet in configlets if configlet[Api.generic.KEY] in configletIds] def __device_get_configlets(self, netid: str): # sourcery skip: class-extract-method """ __device_get_configlets Get list of attached configlets to a given device Read Configlet Mappers to build a list of configlets name attached to a device identified by is KEY Parameters ---------- netid : str CVP Key mostly sysMac Returns ------- List[str] List of configlets name """ if self._cache[FactsResponseFields.CACHE_MAPPERS] is None: MODULE_LOGGER.warning('Build configlet mappers cache from Cloudvision') self._cache[FactsResponseFields.CACHE_MAPPERS] = self.__cv_client.api.get_configlets_and_mappers()['data'] mappers = self._cache[FactsResponseFields.CACHE_MAPPERS]['configletMappers'] configletIds = [mapper[Api.configlet.ID] for mapper in mappers if mapper[Api.mappers.OBJECT_ID] == netid] MODULE_LOGGER.debug('** NetelementID is %s', str(netid)) MODULE_LOGGER.debug('** Configlet IDs are %s', str(configletIds)) return self.__configletIds_to_configletName(configletIds=configletIds) def __containers_get_configlets(self, container_id): """ __containers_get_configlets Get list of attached configlets to a given container Read Configlet Mappers to build a list of configlets name attached to a container identified by is KEY Parameters ---------- container_id : str CVP Key for the container Returns ------- List[str] List of configlets name """ if self._cache[FactsResponseFields.CACHE_MAPPERS] is None: MODULE_LOGGER.warning('Build configlet mappers cache from Cloudvision') self._cache[FactsResponseFields.CACHE_MAPPERS] = self.__cv_client.api.get_configlets_and_mappers()['data'] mappers = self._cache[FactsResponseFields.CACHE_MAPPERS]['configletMappers'] configletIds = [mapper[Api.configlet.ID] for mapper in mappers if (mapper[Api.container.ID] == container_id or mapper[Api.mappers.OBJECT_ID] == container_id) ] # Deduplicate entries as containerID is present for every inherited configlets configletIds = list(dict.fromkeys(configletIds)) MODULE_LOGGER.debug('** Container ID is %s', str(container_id)) MODULE_LOGGER.debug('** Configlet IDs are %s', str(configletIds)) return self.__configletIds_to_configletName(configletIds=configletIds) # Fact management def __fact_devices(self, filter: str = '.*', verbose: bool = False): """ __fact_devices Collect facts related to device inventory [extended_summary] Parameters ---------- filter : str, optional Regular Expression to filter device. Search is done against FQDN to allow domain filtering, by default .* verbose : str, optional Facts verbosity: full get all data from CV where short get only cv_modules data, by default 'short' """ try: cv_devices = self.__cv_client.api.get_inventory() except CvpApiError as error_msg: MODULE_LOGGER.error('Error when collecting devices facts: %s', str(error_msg)) MODULE_LOGGER.info('Extract device data using filter %s', str(filter)) facts_builder = CvFactResource() for device in cv_devices: if re.match(filter, device[Api.device.HOSTNAME]): MODULE_LOGGER.debug('Filter has been matched: %s - %s', str(filter), str(device[Api.device.HOSTNAME])) if verbose: facts_builder.add(self.__device_update_info(device=device)) else: device[Api.generic.CONFIGLETS] = self.__device_get_configlets(netid=device[Api.generic.KEY]) facts_builder.add(device) self._facts[FactsResponseFields.DEVICE] = facts_builder.get(resource_model='device', verbose=verbose) def __fact_containers(self): """ __fact_containers Collect facts related to container structure """ try: cv_containers = self.__cv_client.api.get_containers() except CvpApiError as error_msg: MODULE_LOGGER.error('Error when collecting containers facts: %s', str(error_msg)) facts_builder = CvFactResource() for container in cv_containers['data']: if container[Api.generic.NAME] != 'Tenant': MODULE_LOGGER.debug('Got following information for container: %s', str(container)) container[Api.generic.CONFIGLETS] = self.__containers_get_configlets(container_id=container[Api.container.KEY]) facts_builder.add(container) self._facts[FactsResponseFields.CONTAINER] = facts_builder.get(resource_model='container') def __fact_configlets(self, filter: str = '.*', configlets_per_call: int = 10): """ __fact_configlets Collect facts related to configlets structure Execute parallel calls to get a list of all static configlets from CVP Parameters ---------- filter : str, optional Regular Expression to filter configlets, by default .* configlets_per_call : int, optional Number of configlets to retrieve per API call, by default 10 """ max_range_calc = self.__cv_client.api.get_configlets(start=0, end=1)['total'] + 1 futures_list = [] results = [] with ThreadPoolExecutor(max_workers=self._max_worker) as executor: for configlet_index in range(0, max_range_calc, configlets_per_call): futures_list.append( executor.submit(self.__cv_client.api.get_configlets, start=configlet_index, end=configlet_index + configlets_per_call) ) for future in futures_list: try: result = future.result(timeout=60) results.append(result) except Exception as error: results.append(None) MODULE_LOGGER.critical( 'Exception in getting configlet (%s): %s', str(error), str(future.result()) ) facts_builder = CvFactResource() for future in results: for configlet in future['data']: if re.match(filter, configlet[Api.generic.NAME]): MODULE_LOGGER.debug('Adding configlet %s', str(configlet[Api.generic.NAME])) facts_builder.add(configlet) MODULE_LOGGER.debug( 'Final results for configlets: %s', str(facts_builder.get(resource_model='configlet').keys()) ) self._facts[FactsResponseFields.CONFIGLET] = facts_builder.get(resource_model='configlet')
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 13, 29937, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 29937, 13, 29937, 15143, 4593, 5236, 19245, 325, 29941, 29889, 29900, 29974, 13, 29937, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29906, 29906, 826, 2079, 8527, 29879, 3339, 29899, 29923, 2303, 29909, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 268, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 29937, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 313, 23552, 29918, 5215, 29892, 8542, 29892, 1596, 29918, 2220, 29897, 13, 1649, 2527, 562, 605, 1649, 353, 1134, 13, 13, 5215, 9637, 1627, 13, 5215, 12183, 13, 5215, 337, 13, 5215, 2897, 13, 3166, 19229, 1053, 2391, 13, 3166, 21984, 29889, 29888, 329, 1973, 1053, 10480, 11426, 13366, 13, 5215, 385, 1687, 29918, 29027, 29889, 279, 2079, 29889, 11023, 29886, 29889, 12800, 29889, 5453, 29918, 13239, 29889, 21707, 259, 396, 694, 25621, 396, 282, 2904, 524, 29901, 11262, 29922, 348, 3880, 29899, 5215, 13, 3166, 385, 1687, 29918, 29027, 29889, 279, 2079, 29889, 11023, 29886, 29889, 12800, 29889, 5453, 29918, 13239, 29889, 13237, 29889, 2754, 29889, 9621, 1053, 29749, 13, 3166, 385, 1687, 29918, 29027, 29889, 279, 2079, 29889, 11023, 29886, 29889, 12800, 29889, 5453, 29918, 13239, 29889, 13237, 29889, 7576, 29889, 9621, 1053, 26748, 29879, 5103, 14256, 13, 5215, 385, 1687, 29918, 29027, 29889, 279, 2079, 29889, 11023, 29886, 29889, 12800, 29889, 5453, 29918, 13239, 29889, 8504, 29918, 11010, 408, 10938, 259, 396, 694, 25621, 396, 282, 2904, 524, 29901, 11262, 29922, 348, 3880, 29899, 5215, 13, 2202, 29901, 13, 1678, 515, 13850, 29886, 945, 29889, 11023, 29886, 29918, 4645, 1053, 315, 29894, 29886, 4032, 29871, 396, 694, 25621, 396, 282, 2904, 524, 29901, 11262, 29922, 348, 3880, 29899, 5215, 13, 1678, 515, 13850, 29886, 945, 29889, 11023, 29886, 29918, 4645, 29918, 12523, 1053, 315, 29894, 29886, 11713, 2392, 29892, 315, 29894, 29886, 3089, 2392, 29871, 396, 694, 25621, 396, 282, 2904, 524, 29901, 11262, 29922, 348, 3880, 29899, 5215, 13, 1678, 379, 3289, 29918, 15633, 10593, 2477, 353, 5852, 13, 19499, 16032, 2392, 29901, 13, 1678, 379, 3289, 29918, 15633, 10593, 2477, 353, 7700, 13, 1678, 25778, 10593, 2477, 29918, 29902, 3580, 29918, 21662, 353, 9637, 1627, 29889, 4830, 29918, 735, 29883, 580, 13, 2202, 29901, 13, 1678, 1053, 6965, 787, 305, 2603, 29871, 396, 694, 25621, 396, 282, 2904, 524, 29901, 11262, 29922, 348, 3880, 29899, 5215, 13, 1678, 379, 3289, 29918, 7249, 29903, 3210, 26862, 353, 5852, 13, 19499, 16032, 2392, 29901, 13, 1678, 379, 3289, 29918, 7249, 29903, 3210, 26862, 353, 7700, 13, 13, 13, 6720, 14849, 1307, 29918, 14480, 17070, 353, 12183, 29889, 657, 16363, 22168, 978, 1649, 29897, 13, 6720, 14849, 1307, 29918, 14480, 17070, 29889, 3888, 877, 4763, 2114, 29918, 8504, 3883, 8225, 1495, 13, 13, 13, 29937, 448, 2683, 2683, 1378, 29899, 396, 13, 29937, 4134, 13, 29937, 448, 2683, 2683, 1378, 29899, 396, 13, 13, 1990, 315, 29894, 20738, 6848, 7295, 13, 1678, 9995, 13, 1678, 315, 29894, 20738, 6848, 6162, 546, 304, 4050, 17099, 2729, 373, 6503, 1134, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 17099, 29918, 1853, 29901, 851, 353, 525, 1761, 29374, 13, 4706, 565, 17099, 29918, 1853, 1275, 525, 1761, 2396, 13, 9651, 1583, 3032, 8173, 353, 5159, 13, 13, 1678, 822, 4770, 12759, 264, 29918, 10141, 29918, 17028, 29879, 29898, 1311, 29892, 4742, 29918, 17028, 29901, 9657, 1125, 13, 4706, 9995, 13, 4706, 4770, 12759, 264, 29918, 10141, 29918, 17028, 29879, 19916, 2793, 304, 736, 363, 4742, 1134, 6503, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 4742, 29918, 17028, 584, 9657, 13, 9651, 13343, 310, 848, 4944, 491, 14293, 4924, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 9657, 13, 9651, 360, 919, 411, 871, 3806, 4235, 304, 367, 752, 492, 424, 411, 6503, 10938, 13, 4706, 9995, 13, 4706, 2114, 353, 426, 13, 9651, 1820, 29901, 4742, 29918, 17028, 29961, 1989, 29962, 13, 9651, 363, 1820, 297, 518, 13, 18884, 29749, 29889, 10141, 29889, 20832, 5813, 29892, 13, 18884, 29749, 29889, 10141, 29889, 29943, 29984, 28307, 29892, 13, 18884, 29749, 29889, 10141, 29889, 6304, 25758, 29892, 13, 18884, 29749, 29889, 10141, 29889, 14816, 29903, 1529, 29907, 29892, 13, 18884, 29749, 29889, 19206, 29889, 25903, 1307, 9375, 29892, 13, 9651, 4514, 13, 4706, 500, 13, 4706, 2114, 29961, 11713, 29889, 19206, 29889, 16320, 3919, 29918, 6007, 6040, 1177, 1001, 29918, 5813, 29962, 353, 4742, 29918, 17028, 29961, 11713, 29889, 10141, 29889, 6007, 6040, 1177, 1001, 29918, 5813, 29962, 13, 4706, 736, 2114, 13, 13, 1678, 822, 903, 657, 29918, 2917, 1026, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 903, 657, 29918, 2917, 10376, 3251, 403, 17099, 363, 2295, 10376, 6503, 1134, 13, 13, 4706, 8528, 19297, 1307, 29901, 13, 4706, 448, 26589, 13, 4706, 8653, 315, 29894, 20738, 29879, 6848, 2141, 29918, 657, 29918, 2917, 1026, 580, 13, 4706, 426, 13, 9651, 376, 4330, 5194, 29900, 29896, 29899, 19973, 1115, 376, 19973, 263, 29896, 1510, 1873, 613, 13, 9651, 376, 4330, 5194, 29900, 29896, 29899, 23327, 29899, 2917, 1026, 1115, 376, 19973, 263, 29906, 1510, 1873, 29908, 13, 4706, 500, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 9657, 13, 9651, 8600, 310, 2295, 10376, 29889, 13, 4706, 9995, 13, 4706, 565, 338, 8758, 29898, 1311, 3032, 8173, 29892, 1051, 1125, 13, 9651, 736, 426, 2917, 1026, 29961, 11713, 29889, 19206, 29889, 5813, 5387, 2295, 1026, 29961, 11713, 29889, 19206, 29889, 25903, 29962, 363, 2295, 1026, 297, 1583, 3032, 8173, 29913, 13, 13, 1678, 822, 903, 657, 29918, 7611, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 903, 657, 29918, 7611, 3251, 403, 17099, 363, 22637, 6503, 1134, 13, 13, 4706, 8528, 19297, 1307, 29901, 13, 4706, 448, 26589, 13, 4706, 8653, 315, 29894, 20738, 29879, 6848, 2141, 29918, 657, 29918, 7611, 580, 13, 4706, 426, 13, 9651, 376, 4330, 5194, 29900, 29896, 1115, 426, 13, 18884, 376, 3560, 7895, 1170, 1115, 376, 29911, 27153, 29908, 13, 9651, 2981, 13, 9651, 376, 4330, 5194, 29900, 29896, 29918, 12696, 1115, 426, 13, 18884, 376, 3560, 7895, 1170, 1115, 376, 4330, 5194, 29900, 29896, 29908, 13, 9651, 2981, 13, 9651, 376, 4330, 5194, 29900, 29896, 29918, 1307, 5098, 29903, 1115, 426, 13, 18884, 376, 3560, 7895, 1170, 1115, 376, 4330, 5194, 29900, 29896, 29918, 12696, 613, 13, 18884, 376, 2917, 10376, 1115, 518, 13, 462, 1678, 376, 29954, 28902, 1964, 29899, 1964, 29902, 8127, 29903, 29908, 13, 18884, 4514, 13, 9651, 500, 13, 4706, 500, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 9657, 13, 9651, 8600, 310, 22637, 13, 4706, 9995, 13, 4706, 565, 338, 8758, 29898, 1311, 3032, 8173, 29892, 1051, 1125, 13, 9651, 736, 426, 8269, 29961, 11713, 29889, 19206, 29889, 5813, 5387, 426, 13, 18884, 29749, 29889, 19206, 29889, 16320, 3919, 29918, 6007, 6040, 1177, 1001, 29918, 5813, 29901, 6251, 29961, 11713, 29889, 7611, 29889, 16320, 3919, 29918, 5813, 1402, 13, 18884, 29749, 29889, 19206, 29889, 25903, 1307, 9375, 29901, 6251, 29961, 11713, 29889, 19206, 29889, 25903, 1307, 9375, 12258, 13, 18884, 363, 6251, 297, 1583, 3032, 8173, 565, 29749, 29889, 19206, 29889, 5813, 297, 6251, 29889, 8149, 28296, 13, 13, 1678, 822, 903, 657, 29918, 10141, 29898, 1311, 29892, 26952, 29901, 6120, 353, 7700, 1125, 13, 4706, 9995, 13, 4706, 903, 657, 29918, 10141, 3251, 403, 17099, 363, 9224, 6503, 1134, 13, 13, 4706, 8528, 19297, 1307, 29901, 13, 4706, 448, 26589, 13, 4706, 8653, 315, 29894, 20738, 29879, 6848, 2141, 29918, 657, 29918, 10141, 580, 13, 4706, 518, 13, 9651, 426, 13, 18884, 376, 29888, 29939, 5200, 1115, 376, 15633, 29899, 2190, 5425, 29933, 1307, 29899, 29923, 3267, 29900, 29896, 613, 13, 18884, 376, 3560, 7895, 1170, 1115, 376, 2190, 5425, 29933, 1307, 613, 13, 18884, 376, 2917, 10376, 1115, 518, 13, 462, 1678, 376, 29900, 29896, 29911, 4717, 1177, 4214, 29899, 29900, 29896, 29908, 13, 18884, 21251, 13, 18884, 376, 5205, 15735, 7061, 1115, 376, 29945, 29900, 29901, 29947, 29881, 29901, 29900, 29900, 29901, 29872, 29941, 29901, 29955, 29947, 29901, 7340, 613, 13, 18884, 376, 15550, 4557, 1115, 376, 29953, 29946, 29955, 29929, 29941, 29923, 29896, 29928, 29941, 2287, 29906, 29906, 29946, 29900, 29943, 29945, 29946, 29955, 29923, 29945, 29929, 29953, 29946, 29941, 29945, 29946, 29906, 29896, 29946, 29909, 29946, 29908, 13, 9651, 500, 13, 4706, 4514, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 26952, 584, 6120, 29892, 13136, 13, 9651, 1605, 3567, 304, 3160, 470, 451, 599, 4235, 515, 25778, 29892, 491, 2322, 7700, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 1051, 13, 9651, 2391, 310, 9224, 13, 4706, 9995, 13, 4706, 565, 26952, 29901, 13, 9651, 736, 1583, 3032, 8173, 13, 4706, 1683, 29901, 13, 9651, 736, 518, 1311, 17255, 12759, 264, 29918, 10141, 29918, 17028, 29879, 29898, 13, 18884, 4742, 29918, 17028, 29922, 10141, 29897, 363, 4742, 297, 1583, 3032, 8173, 29962, 13, 13, 1678, 822, 788, 29898, 1311, 29892, 848, 1125, 13, 4706, 9995, 13, 4706, 788, 3462, 385, 6251, 297, 278, 1051, 310, 17099, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 848, 584, 3139, 13, 9651, 3630, 304, 788, 408, 263, 716, 6251, 297, 278, 2114, 1051, 29889, 10575, 367, 263, 9657, 13, 4706, 9995, 13, 4706, 565, 338, 8758, 29898, 1311, 3032, 8173, 29892, 1051, 1125, 13, 9651, 1583, 3032, 8173, 29889, 4397, 29898, 1272, 29897, 13, 13, 1678, 822, 679, 29898, 1311, 29892, 6503, 29918, 4299, 29901, 851, 29892, 26952, 29901, 6120, 353, 7700, 1125, 13, 4706, 9995, 13, 4706, 679, 5236, 1158, 304, 679, 2281, 2955, 2114, 363, 263, 2183, 6503, 13, 13, 4706, 910, 1158, 4327, 1051, 310, 848, 3625, 297, 967, 7090, 304, 367, 19884, 773, 25778, 3883, 10938, 29889, 13, 4706, 18981, 29918, 1853, 1881, 674, 3394, 1959, 848, 13852, 304, 367, 15878, 411, 13850, 10585, 29889, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 6503, 29918, 4299, 584, 851, 13, 9651, 4408, 310, 278, 6503, 304, 3394, 1959, 13852, 29889, 1815, 367, 6024, 10141, 742, 525, 7611, 742, 525, 2917, 1026, 2033, 13, 4706, 26952, 584, 6120, 29892, 13136, 13, 9651, 1605, 3567, 304, 3160, 470, 451, 599, 4235, 515, 25778, 29892, 491, 2322, 7700, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 3139, 13, 9651, 26748, 29879, 2729, 373, 6503, 29918, 1853, 848, 1904, 29889, 13, 4706, 9995, 13, 4706, 565, 6503, 29918, 4299, 1275, 525, 2917, 1026, 2396, 13, 9651, 736, 1583, 3032, 657, 29918, 2917, 1026, 580, 13, 4706, 25342, 6503, 29918, 4299, 1275, 525, 7611, 2396, 13, 9651, 736, 1583, 3032, 657, 29918, 7611, 580, 13, 4706, 25342, 6503, 29918, 4299, 1275, 525, 10141, 2396, 13, 9651, 736, 1583, 3032, 657, 29918, 10141, 29898, 369, 15828, 29922, 369, 15828, 29897, 13, 13, 13, 1990, 315, 29894, 20738, 29879, 24183, 7295, 13, 1678, 9995, 13, 1678, 315, 29894, 20738, 29879, 24183, 4669, 304, 21994, 26748, 29879, 515, 14293, 4924, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 13850, 29918, 9965, 1125, 13, 4706, 1583, 17255, 11023, 29918, 4645, 353, 13850, 29918, 9965, 13, 4706, 1583, 3032, 8173, 353, 426, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 6007, 6040, 1177, 23598, 29901, 6213, 29892, 26748, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 29901, 6213, 29913, 13, 4706, 1583, 3032, 3317, 29918, 24602, 353, 1375, 29898, 29941, 29906, 29892, 313, 359, 29889, 21970, 29918, 2798, 580, 470, 29871, 29896, 29897, 718, 29871, 29946, 29897, 13, 4706, 1583, 17255, 2344, 29918, 17028, 29879, 580, 13, 13, 1678, 822, 4770, 2344, 29918, 17028, 29879, 29898, 1311, 1125, 13, 4706, 1583, 3032, 17028, 29879, 353, 426, 20738, 29879, 5103, 14256, 29889, 2287, 19059, 29901, 19997, 26748, 29879, 5103, 14256, 29889, 25903, 1307, 29911, 29901, 19997, 26748, 29879, 5103, 14256, 29889, 6007, 6040, 1177, 1001, 29901, 5159, 29913, 13, 13, 1678, 822, 17099, 29898, 1311, 29892, 6874, 29901, 2391, 29961, 710, 1402, 6528, 29918, 4572, 29901, 851, 353, 525, 5575, 29374, 13, 4706, 9995, 13, 4706, 17099, 5236, 3450, 304, 6314, 17099, 515, 14293, 4924, 13, 13, 4706, 1222, 9422, 13, 4706, 448, 26589, 13, 4706, 8653, 1121, 353, 1583, 29889, 262, 23886, 29889, 17028, 29879, 29898, 6078, 29922, 1839, 2917, 10376, 11287, 13, 4706, 426, 13, 9651, 376, 11023, 29886, 29918, 1285, 475, 414, 1115, 426, 13, 18884, 376, 29911, 27153, 1115, 426, 13, 462, 1678, 376, 3560, 7895, 1170, 1115, 376, 8516, 613, 13, 462, 1678, 376, 2917, 10376, 1115, 5159, 13, 18884, 2981, 13, 18884, 376, 25263, 5598, 1115, 426, 13, 462, 1678, 376, 3560, 7895, 1170, 1115, 376, 29911, 27153, 613, 13, 462, 1678, 376, 2917, 10376, 1115, 5159, 13, 18884, 2981, 13, 18884, 376, 29923, 8787, 1115, 426, 13, 462, 1678, 376, 3560, 7895, 1170, 1115, 376, 29911, 27153, 613, 13, 462, 1678, 376, 2917, 10376, 1115, 518, 13, 462, 4706, 376, 17482, 29908, 13, 462, 1678, 4514, 13, 18884, 500, 13, 9651, 500, 13, 4706, 500, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 6874, 584, 2391, 29961, 710, 29962, 13, 9651, 2391, 310, 3161, 304, 679, 515, 14293, 4924, 1923, 29892, 491, 2322, 6024, 3359, 1575, 742, 525, 1285, 475, 414, 2033, 13, 13, 4706, 6528, 29918, 4572, 29901, 851, 13, 9651, 2169, 1070, 4603, 304, 4175, 9224, 322, 2295, 10376, 29889, 9333, 1543, 411, 4175, 297, 1009, 1024, 674, 367, 5609, 287, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 9657, 13, 9651, 319, 8600, 310, 2472, 411, 599, 278, 848, 515, 14293, 4924, 13, 4706, 9995, 13, 4706, 565, 525, 3359, 1575, 29915, 297, 6874, 29901, 13, 9651, 1583, 17255, 17028, 29918, 3359, 1575, 29898, 4572, 29922, 13087, 29918, 4572, 29897, 13, 4706, 565, 525, 1285, 475, 414, 29915, 297, 6874, 29901, 13, 9651, 1583, 17255, 17028, 29918, 1285, 475, 414, 580, 13, 4706, 565, 525, 2917, 10376, 29915, 297, 6874, 29901, 13, 9651, 1583, 17255, 17028, 29918, 2917, 10376, 29898, 4572, 29922, 13087, 29918, 4572, 29897, 13, 4706, 736, 1583, 3032, 17028, 29879, 13, 13, 1678, 822, 4770, 657, 29918, 7611, 29918, 978, 29898, 1311, 29892, 1820, 29901, 851, 353, 29749, 29889, 7611, 29889, 3904, 24405, 1177, 3352, 29918, 6007, 6040, 1177, 1001, 29918, 1367, 1125, 13, 4706, 9995, 13, 4706, 4770, 657, 29918, 7611, 29918, 978, 6162, 546, 304, 679, 5639, 1024, 515, 967, 1820, 13, 13, 4706, 15076, 263, 1246, 304, 25778, 304, 679, 1024, 310, 263, 5639, 1820, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 1820, 584, 851, 29892, 13136, 13, 9651, 21679, 1820, 29892, 491, 2322, 12801, 25711, 17013, 16299, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 851, 13, 9651, 21679, 1024, 13, 4706, 9995, 13, 4706, 565, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 6007, 6040, 1177, 23598, 29962, 338, 6213, 29901, 13, 9651, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 27392, 877, 8893, 5639, 7090, 515, 14293, 4924, 1495, 13, 9651, 1018, 29901, 13, 18884, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 6007, 6040, 1177, 23598, 29962, 353, 1583, 17255, 11023, 29918, 4645, 29889, 2754, 29889, 657, 29918, 1285, 475, 414, 580, 1839, 1272, 2033, 13, 9651, 5174, 315, 29894, 29886, 11713, 2392, 408, 1059, 29901, 13, 18884, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 2704, 877, 6028, 20333, 29873, 679, 2472, 515, 25778, 29901, 1273, 29879, 742, 851, 29898, 2704, 876, 13, 18884, 736, 6213, 13, 4706, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 877, 7583, 7090, 848, 338, 29901, 1273, 29879, 742, 851, 29898, 1311, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 6007, 6040, 1177, 23598, 12622, 13, 4706, 363, 5639, 297, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 6007, 6040, 1177, 23598, 5387, 13, 9651, 565, 1820, 1275, 5639, 29961, 11713, 29889, 19206, 29889, 10818, 5387, 13, 18884, 736, 5639, 29961, 11713, 29889, 19206, 29889, 5813, 29962, 13, 4706, 736, 6213, 13, 13, 1678, 822, 4770, 10141, 29918, 5504, 29918, 3888, 29898, 1311, 29892, 4742, 29901, 9657, 1125, 13, 4706, 9995, 13, 4706, 4770, 10141, 29918, 5504, 29918, 3888, 6162, 546, 304, 788, 4567, 2472, 363, 4742, 17099, 13, 13, 4706, 3462, 470, 2767, 4235, 515, 25778, 2933, 304, 1207, 1962, 2854, 411, 564, 2079, 29889, 11023, 29886, 29889, 11023, 29918, 10141, 29918, 29894, 29941, 10938, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 4742, 584, 9657, 13, 9651, 21830, 848, 515, 14293, 4924, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 9657, 13, 9651, 25723, 2472, 13, 4706, 9995, 13, 4706, 565, 4742, 1839, 4882, 2033, 2804, 525, 2396, 13, 9651, 4742, 29961, 11713, 29889, 19206, 29889, 16320, 3919, 29918, 6007, 6040, 1177, 1001, 29918, 5813, 29962, 353, 1583, 17255, 657, 29918, 7611, 29918, 978, 29898, 1989, 29922, 10141, 29961, 11713, 29889, 10141, 29889, 16320, 3919, 29918, 6007, 6040, 1177, 1001, 29918, 10818, 2314, 13, 4706, 1683, 29901, 13, 9651, 4742, 29961, 11713, 29889, 19206, 29889, 16320, 3919, 29918, 6007, 6040, 1177, 1001, 29918, 5813, 29962, 353, 6629, 13, 4706, 736, 4742, 13, 13, 1678, 822, 4770, 2917, 1026, 21943, 29918, 517, 29918, 2917, 1026, 1170, 29898, 1311, 29892, 2295, 1026, 21943, 29901, 2391, 29961, 710, 29962, 1125, 13, 4706, 9995, 13, 4706, 4770, 2917, 1026, 21943, 29918, 517, 29918, 2917, 1026, 1170, 8878, 263, 1051, 310, 2295, 10376, 1024, 515, 263, 1051, 310, 2295, 10376, 3553, 13, 13, 4706, 7338, 1461, 1051, 310, 2295, 10376, 1024, 515, 315, 18510, 611, 22437, 2729, 373, 263, 1051, 310, 2295, 10376, 3553, 4944, 408, 385, 1881, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 2295, 1026, 21943, 584, 2391, 29961, 710, 29962, 13, 9651, 2391, 310, 2295, 1026, 23481, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 2391, 29961, 710, 29962, 13, 9651, 2391, 310, 2295, 10376, 1024, 13, 4706, 9995, 13, 4706, 565, 451, 2295, 1026, 21943, 29901, 13, 9651, 736, 5159, 13, 4706, 565, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 29962, 338, 6213, 29901, 13, 9651, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 27392, 877, 8893, 2295, 1026, 611, 22437, 7090, 515, 14293, 4924, 1495, 13, 9651, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 29962, 353, 1583, 17255, 11023, 29918, 4645, 29889, 2754, 29889, 657, 29918, 2917, 10376, 29918, 392, 29918, 655, 22437, 580, 1839, 1272, 2033, 13, 4706, 2295, 10376, 353, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 3816, 11713, 29889, 19206, 29889, 25903, 1307, 9375, 29962, 13, 4706, 736, 518, 2917, 1026, 29961, 11713, 29889, 19206, 29889, 5813, 29962, 363, 2295, 1026, 297, 2295, 10376, 565, 2295, 1026, 29961, 11713, 29889, 19206, 29889, 10818, 29962, 297, 2295, 1026, 21943, 29962, 13, 13, 1678, 822, 4770, 10141, 29918, 657, 29918, 2917, 10376, 29898, 1311, 29892, 7787, 333, 29901, 851, 1125, 13, 4706, 396, 269, 473, 29883, 708, 14383, 29901, 770, 29899, 21111, 29899, 5696, 13, 4706, 9995, 13, 4706, 4770, 10141, 29918, 657, 29918, 2917, 10376, 3617, 1051, 310, 10959, 2295, 10376, 304, 263, 2183, 4742, 13, 13, 4706, 7523, 12782, 1026, 341, 932, 414, 304, 2048, 263, 1051, 310, 2295, 10376, 1024, 10959, 304, 263, 4742, 15659, 491, 338, 14636, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 7787, 333, 584, 851, 13, 9651, 315, 18510, 7670, 11149, 10876, 15735, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 2391, 29961, 710, 29962, 13, 9651, 2391, 310, 2295, 10376, 1024, 13, 4706, 9995, 13, 4706, 565, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 29962, 338, 6213, 29901, 13, 9651, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 27392, 877, 8893, 2295, 1026, 611, 22437, 7090, 515, 14293, 4924, 1495, 13, 9651, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 29962, 353, 1583, 17255, 11023, 29918, 4645, 29889, 2754, 29889, 657, 29918, 2917, 10376, 29918, 392, 29918, 655, 22437, 580, 1839, 1272, 2033, 13, 4706, 611, 22437, 353, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 22322, 2917, 1026, 9689, 414, 2033, 13, 4706, 2295, 1026, 21943, 353, 518, 655, 2496, 29961, 11713, 29889, 2917, 1026, 29889, 1367, 29962, 363, 611, 2496, 297, 611, 22437, 565, 611, 2496, 29961, 11713, 29889, 655, 22437, 29889, 14824, 17637, 29918, 1367, 29962, 1275, 7787, 333, 29962, 13, 4706, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 877, 1068, 405, 2650, 944, 1367, 338, 1273, 29879, 742, 851, 29898, 1212, 333, 876, 13, 4706, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 877, 1068, 12782, 1026, 23481, 526, 1273, 29879, 742, 851, 29898, 2917, 1026, 21943, 876, 13, 4706, 736, 1583, 17255, 2917, 1026, 21943, 29918, 517, 29918, 2917, 1026, 1170, 29898, 2917, 1026, 21943, 29922, 2917, 1026, 21943, 29897, 13, 13, 1678, 822, 4770, 1285, 475, 414, 29918, 657, 29918, 2917, 10376, 29898, 1311, 29892, 5639, 29918, 333, 1125, 13, 4706, 9995, 13, 4706, 4770, 1285, 475, 414, 29918, 657, 29918, 2917, 10376, 3617, 1051, 310, 10959, 2295, 10376, 304, 263, 2183, 5639, 13, 13, 4706, 7523, 12782, 1026, 341, 932, 414, 304, 2048, 263, 1051, 310, 2295, 10376, 1024, 10959, 304, 263, 5639, 15659, 491, 338, 14636, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 5639, 29918, 333, 584, 851, 13, 9651, 315, 18510, 7670, 363, 278, 5639, 13, 13, 4706, 16969, 13, 4706, 448, 22158, 13, 4706, 2391, 29961, 710, 29962, 13, 9651, 2391, 310, 2295, 10376, 1024, 13, 4706, 9995, 13, 4706, 565, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 29962, 338, 6213, 29901, 13, 9651, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 27392, 877, 8893, 2295, 1026, 611, 22437, 7090, 515, 14293, 4924, 1495, 13, 9651, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 29962, 353, 1583, 17255, 11023, 29918, 4645, 29889, 2754, 29889, 657, 29918, 2917, 10376, 29918, 392, 29918, 655, 22437, 580, 1839, 1272, 2033, 13, 4706, 611, 22437, 353, 1583, 3032, 8173, 29961, 20738, 29879, 5103, 14256, 29889, 29907, 2477, 9606, 29918, 23827, 13171, 29903, 22322, 2917, 1026, 9689, 414, 2033, 13, 4706, 2295, 1026, 21943, 353, 518, 655, 2496, 29961, 11713, 29889, 2917, 1026, 29889, 1367, 29962, 13, 462, 4706, 363, 611, 2496, 297, 611, 22437, 13, 462, 4706, 565, 313, 655, 2496, 29961, 11713, 29889, 7611, 29889, 1367, 29962, 1275, 5639, 29918, 333, 470, 611, 2496, 29961, 11713, 29889, 655, 22437, 29889, 14824, 17637, 29918, 1367, 29962, 1275, 5639, 29918, 333, 29897, 13, 462, 4706, 4514, 13, 4706, 396, 360, 287, 786, 5926, 9976, 408, 5639, 1367, 338, 2198, 363, 1432, 23878, 2295, 10376, 13, 4706, 2295, 1026, 21943, 353, 1051, 29898, 8977, 29889, 3166, 8149, 29898, 2917, 1026, 21943, 876, 13, 4706, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 877, 1068, 21679, 3553, 338, 1273, 29879, 742, 851, 29898, 7611, 29918, 333, 876, 13, 4706, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 877, 1068, 12782, 1026, 23481, 526, 1273, 29879, 742, 851, 29898, 2917, 1026, 21943, 876, 13, 4706, 736, 1583, 17255, 2917, 1026, 21943, 29918, 517, 29918, 2917, 1026, 1170, 29898, 2917, 1026, 21943, 29922, 2917, 1026, 21943, 29897, 13, 13, 1678, 396, 26748, 10643, 13, 13, 1678, 822, 4770, 17028, 29918, 3359, 1575, 29898, 1311, 29892, 4175, 29901, 851, 353, 525, 5575, 742, 26952, 29901, 6120, 353, 7700, 1125, 13, 4706, 9995, 13, 4706, 4770, 17028, 29918, 3359, 1575, 24930, 17099, 4475, 304, 4742, 11817, 706, 13, 13, 4706, 518, 1062, 2760, 29918, 7727, 29962, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 4175, 584, 851, 29892, 13136, 13, 9651, 2169, 1070, 21444, 304, 4175, 4742, 29889, 11856, 338, 2309, 2750, 383, 29984, 28307, 304, 2758, 5354, 21166, 29892, 491, 2322, 869, 29930, 13, 4706, 26952, 584, 851, 29892, 13136, 13, 9651, 26748, 29879, 9750, 359, 537, 29901, 2989, 679, 599, 848, 515, 25778, 988, 3273, 679, 871, 13850, 29918, 7576, 848, 29892, 491, 2322, 525, 12759, 29915, 13, 4706, 9995, 13, 4706, 1018, 29901, 13, 9651, 13850, 29918, 3359, 1575, 353, 1583, 17255, 11023, 29918, 4645, 29889, 2754, 29889, 657, 29918, 262, 23886, 580, 13, 4706, 5174, 315, 29894, 29886, 11713, 2392, 408, 1059, 29918, 7645, 29901, 13, 9651, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 2704, 877, 2392, 746, 6314, 292, 9224, 17099, 29901, 1273, 29879, 742, 851, 29898, 2704, 29918, 7645, 876, 13, 4706, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 3888, 877, 5647, 1461, 4742, 848, 773, 4175, 1273, 29879, 742, 851, 29898, 4572, 876, 13, 4706, 17099, 29918, 16409, 353, 315, 29894, 20738, 6848, 580, 13, 4706, 363, 4742, 297, 13850, 29918, 3359, 1575, 29901, 13, 9651, 565, 337, 29889, 4352, 29898, 4572, 29892, 4742, 29961, 11713, 29889, 10141, 29889, 20832, 5813, 29962, 1125, 13, 18884, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 877, 5072, 756, 1063, 19228, 29901, 1273, 29879, 448, 1273, 29879, 742, 851, 29898, 4572, 511, 851, 29898, 10141, 29961, 11713, 29889, 10141, 29889, 20832, 5813, 12622, 13, 18884, 565, 26952, 29901, 13, 462, 1678, 17099, 29918, 16409, 29889, 1202, 29898, 1311, 17255, 10141, 29918, 5504, 29918, 3888, 29898, 10141, 29922, 10141, 876, 13, 18884, 1683, 29901, 13, 462, 1678, 4742, 29961, 11713, 29889, 19206, 29889, 25903, 1307, 9375, 29962, 353, 1583, 17255, 10141, 29918, 657, 29918, 2917, 10376, 29898, 1212, 333, 29922, 10141, 29961, 11713, 29889, 19206, 29889, 10818, 2314, 13, 462, 1678, 17099, 29918, 16409, 29889, 1202, 29898, 10141, 29897, 13, 4706, 1583, 3032, 17028, 29879, 29961, 20738, 29879, 5103, 14256, 29889, 2287, 19059, 29962, 353, 17099, 29918, 16409, 29889, 657, 29898, 10314, 29918, 4299, 2433, 10141, 742, 26952, 29922, 369, 15828, 29897, 13, 13, 1678, 822, 4770, 17028, 29918, 1285, 475, 414, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 4770, 17028, 29918, 1285, 475, 414, 24930, 17099, 4475, 304, 5639, 3829, 13, 4706, 9995, 13, 4706, 1018, 29901, 13, 9651, 13850, 29918, 1285, 475, 414, 353, 1583, 17255, 11023, 29918, 4645, 29889, 2754, 29889, 657, 29918, 1285, 475, 414, 580, 13, 4706, 5174, 315, 29894, 29886, 11713, 2392, 408, 1059, 29918, 7645, 29901, 13, 9651, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 2704, 877, 2392, 746, 6314, 292, 22637, 17099, 29901, 1273, 29879, 742, 851, 29898, 2704, 29918, 7645, 876, 13, 4706, 17099, 29918, 16409, 353, 315, 29894, 20738, 6848, 580, 13, 4706, 363, 5639, 297, 13850, 29918, 1285, 475, 414, 1839, 1272, 2033, 29901, 13, 9651, 565, 5639, 29961, 11713, 29889, 19206, 29889, 5813, 29962, 2804, 525, 29911, 27153, 2396, 13, 18884, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 877, 29954, 327, 1494, 2472, 363, 5639, 29901, 1273, 29879, 742, 851, 29898, 7611, 876, 13, 18884, 5639, 29961, 11713, 29889, 19206, 29889, 25903, 1307, 9375, 29962, 353, 1583, 17255, 1285, 475, 414, 29918, 657, 29918, 2917, 10376, 29898, 7611, 29918, 333, 29922, 7611, 29961, 11713, 29889, 7611, 29889, 10818, 2314, 13, 18884, 17099, 29918, 16409, 29889, 1202, 29898, 7611, 29897, 13, 4706, 1583, 3032, 17028, 29879, 29961, 20738, 29879, 5103, 14256, 29889, 6007, 6040, 1177, 1001, 29962, 353, 17099, 29918, 16409, 29889, 657, 29898, 10314, 29918, 4299, 2433, 7611, 1495, 13, 13, 1678, 822, 4770, 17028, 29918, 2917, 10376, 29898, 1311, 29892, 4175, 29901, 851, 353, 525, 5575, 742, 2295, 10376, 29918, 546, 29918, 4804, 29901, 938, 353, 29871, 29896, 29900, 1125, 13, 4706, 9995, 13, 4706, 4770, 17028, 29918, 2917, 10376, 24930, 17099, 4475, 304, 2295, 10376, 3829, 13, 13, 4706, 11080, 1082, 8943, 5717, 304, 679, 263, 1051, 310, 599, 2294, 2295, 10376, 515, 315, 18510, 13, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 4175, 584, 851, 29892, 13136, 13, 9651, 2169, 1070, 21444, 304, 4175, 2295, 10376, 29892, 491, 2322, 869, 29930, 13, 4706, 2295, 10376, 29918, 546, 29918, 4804, 584, 938, 29892, 13136, 13, 9651, 9681, 310, 2295, 10376, 304, 10563, 639, 3450, 1246, 29892, 491, 2322, 29871, 29896, 29900, 13, 4706, 9995, 13, 4706, 4236, 29918, 3881, 29918, 28667, 353, 1583, 17255, 11023, 29918, 4645, 29889, 2754, 29889, 657, 29918, 2917, 10376, 29898, 2962, 29922, 29900, 29892, 1095, 29922, 29896, 29897, 1839, 7827, 2033, 718, 29871, 29896, 13, 4706, 3105, 1973, 29918, 1761, 353, 5159, 13, 4706, 2582, 353, 5159, 13, 4706, 411, 10480, 11426, 13366, 29898, 3317, 29918, 1287, 414, 29922, 1311, 3032, 3317, 29918, 24602, 29897, 408, 2279, 3406, 29901, 13, 9651, 363, 2295, 1026, 29918, 2248, 297, 3464, 29898, 29900, 29892, 4236, 29918, 3881, 29918, 28667, 29892, 2295, 10376, 29918, 546, 29918, 4804, 1125, 13, 18884, 3105, 1973, 29918, 1761, 29889, 4397, 29898, 13, 462, 1678, 2279, 3406, 29889, 7892, 29898, 1311, 17255, 11023, 29918, 4645, 29889, 2754, 29889, 657, 29918, 2917, 10376, 29892, 1369, 29922, 2917, 1026, 29918, 2248, 29892, 1095, 29922, 2917, 1026, 29918, 2248, 718, 2295, 10376, 29918, 546, 29918, 4804, 29897, 13, 18884, 1723, 13, 13, 9651, 363, 5434, 297, 3105, 1973, 29918, 1761, 29901, 13, 18884, 1018, 29901, 13, 462, 1678, 1121, 353, 5434, 29889, 2914, 29898, 15619, 29922, 29953, 29900, 29897, 13, 462, 1678, 2582, 29889, 4397, 29898, 2914, 29897, 13, 18884, 5174, 8960, 408, 1059, 29901, 13, 462, 1678, 2582, 29889, 4397, 29898, 8516, 29897, 13, 462, 1678, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 9695, 936, 29898, 13, 462, 4706, 525, 2451, 297, 2805, 2295, 1026, 313, 29995, 29879, 1125, 1273, 29879, 742, 13, 462, 4706, 851, 29898, 2704, 511, 13, 462, 4706, 851, 29898, 29888, 9130, 29889, 2914, 3101, 13, 462, 1678, 1723, 13, 4706, 17099, 29918, 16409, 353, 315, 29894, 20738, 6848, 580, 13, 4706, 363, 5434, 297, 2582, 29901, 13, 9651, 363, 2295, 1026, 297, 5434, 1839, 1272, 2033, 29901, 13, 18884, 565, 337, 29889, 4352, 29898, 4572, 29892, 2295, 1026, 29961, 11713, 29889, 19206, 29889, 5813, 29962, 1125, 13, 462, 1678, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 877, 2528, 292, 2295, 1026, 1273, 29879, 742, 851, 29898, 2917, 1026, 29961, 11713, 29889, 19206, 29889, 5813, 12622, 13, 462, 1678, 17099, 29918, 16409, 29889, 1202, 29898, 2917, 1026, 29897, 13, 13, 4706, 341, 13668, 29965, 1307, 29918, 14480, 17070, 29889, 8382, 29898, 13, 9651, 525, 15790, 2582, 363, 2295, 10376, 29901, 1273, 29879, 742, 13, 9651, 851, 29898, 17028, 29879, 29918, 16409, 29889, 657, 29898, 10314, 29918, 4299, 2433, 2917, 1026, 2824, 8149, 3101, 13, 4706, 1723, 13, 4706, 1583, 3032, 17028, 29879, 29961, 20738, 29879, 5103, 14256, 29889, 25903, 1307, 29911, 29962, 353, 17099, 29918, 16409, 29889, 657, 29898, 10314, 29918, 4299, 2433, 2917, 1026, 1495, 13, 2 ]
sparclur/parsers/_pdfcpu.py
levelupresearch/sparclur
0
166182
<reponame>levelupresearch/sparclur import shutil from typing import List, Dict, Any, Union import os import re import locale import shlex import tempfile import subprocess from subprocess import DEVNULL, TimeoutExpired import yaml from sparclur._tracer import Tracer from sparclur._parser import VALID, VALID_WARNINGS, REJECTED, REJECTED_AMBIG, TRACER, TIMED_OUT from sparclur.utils import hash_file from sparclur.utils._config import _get_config_param, _load_config class PDFCPU(Tracer): """Wrapper for PDFCPU (https://pdfcpu.io/)""" def __init__(self, doc: Union[str, bytes], skip_check: Union[bool, None] = None, hash_exclude: Union[str, List[str], None] = None, binary_path: Union[str, None] = None, temp_folders_dir: Union[str, None] = None, timeout: Union[int, None] = None ): """ Parameters ---------- binary_path : str If the mutool binary is not in the system PATH, add the path to the binary here. Can also be used to trace specific versions of the binary. """ config = _load_config() skip_check = _get_config_param(PDFCPU, config, 'skip_check', skip_check, False) hash_exclude = _get_config_param(PDFCPU, config, 'hash_exclude', hash_exclude, None) binary_path = _get_config_param(PDFCPU, config, 'binary_path', binary_path, None) temp_folders_dir = _get_config_param(PDFCPU, config, 'temp_folders_dir', temp_folders_dir, None) timeout = _get_config_param(PDFCPU, config, 'timeout', timeout, None) super().__init__(doc=doc, temp_folders_dir=temp_folders_dir, skip_check=skip_check, hash_exclude=hash_exclude, timeout=timeout) self._pdfcpu_path = 'pdfcpu' if binary_path is None else os.path.join(binary_path, 'pdfcpu') self._trace_exit_code = None self._decoder = locale.getpreferredencoding() def _check_for_tracer(self) -> bool: if self._can_trace is None: try: subprocess.check_output(shlex.split(self._pdfcpu_path + " version"), shell=False) pc_present = True except Exception as e: pc_present = False self._can_trace = pc_present return self._can_trace @property def validate_tracer(self) -> Dict[str, Any]: if TRACER not in self._validity: validity_results = dict() if self._cleaned is None: self._scrub_messages() observed_messages = list(self._cleaned.keys()) if self._file_timed_out[TRACER]: validity_results['valid'] = False validity_results['status'] = TIMED_OUT validity_results['info'] = 'Timed Out: %i' % self._timeout elif self._trace_exit_code > 1: validity_results['valid'] = False validity_results['status'] = REJECTED validity_results['info'] = 'Exit code: %i' % self._trace_exit_code elif observed_messages == ['No warnings']: validity_results['valid'] = True validity_results['status'] = VALID elif len([message for message in observed_messages if 'Error' in message]) > 0: validity_results['valid'] = False validity_results['status'] = REJECTED validity_results['info'] = 'Errors returned' elif len([message for message in observed_messages if 'Warning' in message]) == len(observed_messages): validity_results['valid'] = True validity_results['status'] = VALID_WARNINGS validity_results['info'] = 'Warnings only' else: validity_results['valid'] = False validity_results['status'] = REJECTED_AMBIG validity_results['info'] = 'Unknown message type returned' self._validity[TRACER] = validity_results return self._validity[TRACER] @staticmethod def get_name(): return 'PDFCPU' def _get_num_pages(self): if not self._skip_check: assert self._check_for_tracer(), "%s not found" % self.get_name() with tempfile.TemporaryDirectory(dir=self._temp_folders_dir) as temp_path: if isinstance(self._doc, bytes): file_hash = hash_file(self._doc) doc_path = os.path.join(temp_path, file_hash) with open(doc_path+'.pdf', 'wb') as doc_out: doc_out.write(self._doc) # elif not self._doc.endswith('.pdf'): # doc_path = os.path.join(temp_path, 'infile.pdf') # shutil.copy2(self._doc, doc_path) else: doc_path = self._doc try: sp = subprocess.Popen([self._pdfcpu_path, 'info', doc_path], stdout=subprocess.PIPE, stderr=DEVNULL, shell=False) (stdout, _) = sp.communicate() stdout = stdout.decode(self._decoder) self._num_pages = [int(line.split(':')[1].strip()) for line in stdout.split('\n') if 'Page count:' in line][0] except: self._num_pages = 0 def _parse_document(self): with tempfile.TemporaryDirectory(dir=self._temp_folders_dir) as temp_path: if isinstance(self._doc, bytes): file_hash = hash_file(self._doc) doc_path = os.path.join(temp_path, file_hash + '.pdf') with open(doc_path, 'wb') as doc_out: doc_out.write(self._doc) elif not self._doc.endswith('.pdf'): doc_path = os.path.join(temp_path, 'infile.pdf') shutil.copy2(self._doc, doc_path) else: doc_path = self._doc try: strict_cmd = '%s validate -m strict %s' % (self._pdfcpu_path, doc_path) relaxed_cmd = '%s validate -m relaxed %s' % (self._pdfcpu_path, doc_path) # if self._verbose: # cmd = cmd + ' -v' strict_sp = subprocess.Popen( shlex.split(strict_cmd), stderr=subprocess.PIPE, stdout=DEVNULL, shell=False) relaxed_sp = subprocess.Popen( shlex.split(relaxed_cmd), stderr=subprocess.PIPE, stdout=DEVNULL, shell=False) (_, strict_err) = strict_sp.communicate(timeout=self._timeout or 600) strict_err = strict_err.decode(self._decoder, errors='ignore').strip() strict_err = re.sub(r" \(try -mode=relaxed\)", '', strict_err) (_, relaxed_err) = relaxed_sp.communicate(timeout=self._timeout or 600) relaxed_err = relaxed_err.decode(self._decoder, errors='ignore').strip() error_arr = [relaxed_err, strict_err] if relaxed_err not in strict_err else [relaxed_err] # error_arr = [message for message in err.split('\n') if len(message) > 0] self._trace_exit_code = max(strict_sp.returncode, relaxed_sp.returncode) self._file_timed_out[TRACER] = False except TimeoutExpired: strict_sp.kill() relaxed_sp.kill() (_, strict_err) = strict_sp.communicate() (_, relaxed_err) = relaxed_sp.communicate() strict_err = strict_err.decode(self._decoder, errors='ignore').strip() strict_err = re.sub(r" \(try -mode=relaxed\)", '', strict_err) relaxed_err = relaxed_err.decode(self._decoder, errors='ignore').strip() error_arr = [relaxed_err, strict_err] if relaxed_err not in strict_err else [relaxed_err] error_arr.insert(0, 'Error: Subprocess timed out: %i' % (self._timeout or 600)) self._trace_exit_code = 0 self._file_timed_out[TRACER] = True except Exception as e: strict_sp.kill() relaxed_sp.kill() (_, strict_err) = strict_sp.communicate() (_, relaxed_err) = relaxed_sp.communicate() strict_err = strict_err.decode(self._decoder, errors='ignore').strip() strict_err = re.sub(r" \(try -mode=relaxed\)", '', strict_err) relaxed_err = relaxed_err.decode(self._decoder, errors='ignore').strip() error_arr = str(e).split('\n') pdfcpu_errs = [relaxed_err, strict_err] if relaxed_err not in strict_err else [relaxed_err] error_arr.extend(pdfcpu_errs) self._trace_exit_code = 0 self._file_timed_out[TRACER] = False error_arr = [err for err in error_arr if len(err) > 0] self._messages = ['No warnings'] if len(error_arr) == 0 else error_arr def _scrub_messages(self): if self._messages is None: self._parse_document() scrubbed_messages = [self._clean_message(err) for err in self._messages] error_dict: Dict[str, int] = dict() for error in scrubbed_messages: error_dict[error] = error_dict.get(error, 0) + 1 self._cleaned = error_dict def _clean_message(self, err): message = err.strip() cleaned = 'runtime error' if message.startswith('runtime:') else message cleaned = re.sub(r"\<\<", "[", cleaned) cleaned = re.sub(r"\>\>", "]", cleaned) cleaned = re.sub(r"\[[^]]+\]", "<<x>>", cleaned) cleaned = re.sub(r"\(obj\#:\d+\)", "(obj#:<x>)", cleaned) cleaned = re.sub(r"\(obj\#\d+\)", "(obj#<x>)", cleaned) cleaned = re.sub(r"line = \<[^>]+\>", "line = <x>", cleaned) cleaned = re.sub(r"parsing \"[^\"]+\":", "parsing <x>:", cleaned) cleaned = re.sub(r"problem dereferencing object \d+", "problem dereferencing object <x>", cleaned) cleaned = re.sub(r"problem dereferencing stream \d+", "problem dereferencing stream <x>", cleaned) cleaned = re.sub(r"unknown PDF Header Version: .+", "unknown PDF Header Version: <x>", cleaned) cleaned = re.sub(r"\nThis file could be PDF/A compliant but pdfcpu only supports versions <= PDF V1.7", '', cleaned) cleaned = re.sub(r"validateDateEntry: .+ invalid date", "validateDateEntry: <x> invalid date", cleaned) cleaned = re.sub(r"validateDateObject: .+ invalid date", "validateDateObject: <x> invalid date", cleaned) cleaned = re.sub(r"leaf node corrupted .+", "leaf node corrupted", cleaned) return cleaned
[ 1, 529, 276, 1112, 420, 29958, 5563, 29884, 4569, 2842, 29914, 29879, 862, 695, 332, 13, 5215, 528, 4422, 13, 3166, 19229, 1053, 2391, 29892, 360, 919, 29892, 3139, 29892, 7761, 13, 5215, 2897, 13, 5215, 337, 13, 5215, 15068, 13, 5215, 528, 2506, 13, 5215, 5694, 1445, 13, 5215, 1014, 5014, 13, 3166, 1014, 5014, 1053, 5012, 29963, 10074, 29892, 5974, 449, 9544, 2859, 13, 13, 5215, 343, 8807, 13, 13, 3166, 805, 279, 695, 332, 3032, 29873, 945, 261, 1053, 323, 945, 261, 13, 3166, 805, 279, 695, 332, 3032, 16680, 1053, 12599, 1367, 29892, 12599, 1367, 29918, 29956, 25614, 29903, 29892, 5195, 17637, 3352, 29892, 5195, 17637, 3352, 29918, 5194, 29933, 6259, 29892, 10014, 2477, 1001, 29892, 323, 8890, 29928, 29918, 12015, 13, 3166, 805, 279, 695, 332, 29889, 13239, 1053, 6608, 29918, 1445, 13, 3166, 805, 279, 695, 332, 29889, 13239, 3032, 2917, 1053, 903, 657, 29918, 2917, 29918, 3207, 29892, 903, 1359, 29918, 2917, 13, 13, 13, 1990, 11328, 6271, 29965, 29898, 29911, 945, 261, 1125, 13, 1678, 9995, 15646, 363, 11328, 6271, 29965, 313, 991, 597, 5140, 21970, 29889, 601, 4551, 15945, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1574, 29901, 7761, 29961, 710, 29892, 6262, 1402, 13, 462, 14383, 29918, 3198, 29901, 7761, 29961, 11227, 29892, 6213, 29962, 353, 6213, 29892, 13, 462, 6608, 29918, 735, 2325, 29901, 7761, 29961, 710, 29892, 2391, 29961, 710, 1402, 6213, 29962, 353, 6213, 29892, 13, 462, 7581, 29918, 2084, 29901, 7761, 29961, 710, 29892, 6213, 29962, 353, 6213, 29892, 13, 462, 5694, 29918, 8771, 414, 29918, 3972, 29901, 7761, 29961, 710, 29892, 6213, 29962, 353, 6213, 29892, 13, 462, 11815, 29901, 7761, 29961, 524, 29892, 6213, 29962, 353, 6213, 13, 462, 29871, 1125, 13, 4706, 9995, 13, 4706, 12662, 2699, 13, 4706, 448, 1378, 29899, 13, 4706, 7581, 29918, 2084, 584, 851, 13, 9651, 960, 278, 5478, 1507, 7581, 338, 451, 297, 278, 1788, 23611, 29892, 788, 278, 2224, 304, 278, 7581, 1244, 29889, 1815, 884, 367, 1304, 304, 9637, 13, 9651, 2702, 6910, 310, 278, 7581, 29889, 13, 4706, 9995, 13, 4706, 2295, 353, 903, 1359, 29918, 2917, 580, 13, 4706, 14383, 29918, 3198, 353, 903, 657, 29918, 2917, 29918, 3207, 29898, 8493, 6271, 29965, 29892, 2295, 29892, 525, 11014, 29918, 3198, 742, 14383, 29918, 3198, 29892, 7700, 29897, 13, 4706, 6608, 29918, 735, 2325, 353, 903, 657, 29918, 2917, 29918, 3207, 29898, 8493, 6271, 29965, 29892, 2295, 29892, 525, 8568, 29918, 735, 2325, 742, 6608, 29918, 735, 2325, 29892, 6213, 29897, 13, 4706, 7581, 29918, 2084, 353, 903, 657, 29918, 2917, 29918, 3207, 29898, 8493, 6271, 29965, 29892, 2295, 29892, 525, 19541, 29918, 2084, 742, 7581, 29918, 2084, 29892, 6213, 29897, 13, 4706, 5694, 29918, 8771, 414, 29918, 3972, 353, 903, 657, 29918, 2917, 29918, 3207, 29898, 8493, 6271, 29965, 29892, 2295, 29892, 525, 7382, 29918, 8771, 414, 29918, 3972, 742, 5694, 29918, 8771, 414, 29918, 3972, 29892, 6213, 29897, 13, 4706, 11815, 353, 903, 657, 29918, 2917, 29918, 3207, 29898, 8493, 6271, 29965, 29892, 2295, 29892, 525, 15619, 742, 11815, 29892, 6213, 29897, 13, 13, 4706, 2428, 2141, 1649, 2344, 12035, 1514, 29922, 1514, 29892, 13, 462, 308, 5694, 29918, 8771, 414, 29918, 3972, 29922, 7382, 29918, 8771, 414, 29918, 3972, 29892, 13, 462, 308, 14383, 29918, 3198, 29922, 11014, 29918, 3198, 29892, 13, 462, 308, 6608, 29918, 735, 2325, 29922, 8568, 29918, 735, 2325, 29892, 13, 462, 308, 11815, 29922, 15619, 29897, 13, 13, 4706, 1583, 3032, 5140, 21970, 29918, 2084, 353, 525, 5140, 21970, 29915, 565, 7581, 29918, 2084, 338, 6213, 1683, 2897, 29889, 2084, 29889, 7122, 29898, 19541, 29918, 2084, 29892, 525, 5140, 21970, 1495, 13, 4706, 1583, 3032, 15003, 29918, 13322, 29918, 401, 353, 6213, 13, 4706, 1583, 3032, 7099, 6119, 353, 15068, 29889, 657, 1457, 14373, 22331, 580, 13, 13, 1678, 822, 903, 3198, 29918, 1454, 29918, 29873, 945, 261, 29898, 1311, 29897, 1599, 6120, 29901, 13, 4706, 565, 1583, 3032, 3068, 29918, 15003, 338, 6213, 29901, 13, 9651, 1018, 29901, 13, 18884, 1014, 5014, 29889, 3198, 29918, 4905, 29898, 845, 2506, 29889, 5451, 29898, 1311, 3032, 5140, 21970, 29918, 2084, 718, 376, 1873, 4968, 6473, 29922, 8824, 29897, 13, 18884, 22844, 29918, 6338, 353, 5852, 13, 9651, 5174, 8960, 408, 321, 29901, 13, 18884, 22844, 29918, 6338, 353, 7700, 13, 9651, 1583, 3032, 3068, 29918, 15003, 353, 22844, 29918, 6338, 13, 4706, 736, 1583, 3032, 3068, 29918, 15003, 13, 13, 1678, 732, 6799, 13, 1678, 822, 12725, 29918, 29873, 945, 261, 29898, 1311, 29897, 1599, 360, 919, 29961, 710, 29892, 3139, 5387, 13, 4706, 565, 10014, 2477, 1001, 451, 297, 1583, 3032, 3084, 537, 29901, 13, 9651, 2854, 537, 29918, 9902, 353, 9657, 580, 13, 9651, 565, 1583, 3032, 14941, 287, 338, 6213, 29901, 13, 18884, 1583, 3032, 10526, 431, 29918, 19158, 580, 13, 9651, 8900, 29918, 19158, 353, 1051, 29898, 1311, 3032, 14941, 287, 29889, 8149, 3101, 13, 9651, 565, 1583, 3032, 1445, 29918, 9346, 287, 29918, 449, 29961, 5659, 2477, 1001, 5387, 13, 18884, 2854, 537, 29918, 9902, 1839, 3084, 2033, 353, 7700, 13, 18884, 2854, 537, 29918, 9902, 1839, 4882, 2033, 353, 323, 8890, 29928, 29918, 12015, 13, 18884, 2854, 537, 29918, 9902, 1839, 3888, 2033, 353, 525, 13711, 287, 4451, 29901, 1273, 29875, 29915, 1273, 1583, 3032, 15619, 13, 9651, 25342, 1583, 3032, 15003, 29918, 13322, 29918, 401, 1405, 29871, 29896, 29901, 13, 18884, 2854, 537, 29918, 9902, 1839, 3084, 2033, 353, 7700, 13, 18884, 2854, 537, 29918, 9902, 1839, 4882, 2033, 353, 5195, 17637, 3352, 13, 18884, 2854, 537, 29918, 9902, 1839, 3888, 2033, 353, 525, 24365, 775, 29901, 1273, 29875, 29915, 1273, 1583, 3032, 15003, 29918, 13322, 29918, 401, 13, 9651, 25342, 8900, 29918, 19158, 1275, 6024, 3782, 18116, 2033, 29901, 13, 18884, 2854, 537, 29918, 9902, 1839, 3084, 2033, 353, 5852, 13, 18884, 2854, 537, 29918, 9902, 1839, 4882, 2033, 353, 12599, 1367, 13, 9651, 25342, 7431, 4197, 4906, 363, 2643, 297, 8900, 29918, 19158, 565, 525, 2392, 29915, 297, 2643, 2314, 1405, 29871, 29900, 29901, 13, 18884, 2854, 537, 29918, 9902, 1839, 3084, 2033, 353, 7700, 13, 18884, 2854, 537, 29918, 9902, 1839, 4882, 2033, 353, 5195, 17637, 3352, 13, 18884, 2854, 537, 29918, 9902, 1839, 3888, 2033, 353, 525, 22463, 4133, 29915, 13, 9651, 25342, 7431, 4197, 4906, 363, 2643, 297, 8900, 29918, 19158, 565, 525, 22709, 29915, 297, 2643, 2314, 1275, 7431, 29898, 711, 643, 1490, 29918, 19158, 1125, 13, 18884, 2854, 537, 29918, 9902, 1839, 3084, 2033, 353, 5852, 13, 18884, 2854, 537, 29918, 9902, 1839, 4882, 2033, 353, 12599, 1367, 29918, 29956, 25614, 29903, 13, 18884, 2854, 537, 29918, 9902, 1839, 3888, 2033, 353, 525, 29956, 2753, 886, 871, 29915, 13, 9651, 1683, 29901, 13, 18884, 2854, 537, 29918, 9902, 1839, 3084, 2033, 353, 7700, 13, 18884, 2854, 537, 29918, 9902, 1839, 4882, 2033, 353, 5195, 17637, 3352, 29918, 5194, 29933, 6259, 13, 18884, 2854, 537, 29918, 9902, 1839, 3888, 2033, 353, 525, 14148, 2643, 1134, 4133, 29915, 13, 9651, 1583, 3032, 3084, 537, 29961, 5659, 2477, 1001, 29962, 353, 2854, 537, 29918, 9902, 13, 4706, 736, 1583, 3032, 3084, 537, 29961, 5659, 2477, 1001, 29962, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 679, 29918, 978, 7295, 13, 4706, 736, 525, 8493, 6271, 29965, 29915, 13, 13, 1678, 822, 903, 657, 29918, 1949, 29918, 12292, 29898, 1311, 1125, 13, 4706, 565, 451, 1583, 3032, 11014, 29918, 3198, 29901, 13, 9651, 4974, 1583, 3032, 3198, 29918, 1454, 29918, 29873, 945, 261, 3285, 11860, 29879, 451, 1476, 29908, 1273, 1583, 29889, 657, 29918, 978, 580, 13, 4706, 411, 5694, 1445, 29889, 5776, 1971, 653, 9882, 29898, 3972, 29922, 1311, 3032, 7382, 29918, 8771, 414, 29918, 3972, 29897, 408, 5694, 29918, 2084, 29901, 13, 9651, 565, 338, 8758, 29898, 1311, 3032, 1514, 29892, 6262, 1125, 13, 18884, 934, 29918, 8568, 353, 6608, 29918, 1445, 29898, 1311, 3032, 1514, 29897, 13, 18884, 1574, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 7382, 29918, 2084, 29892, 934, 29918, 8568, 29897, 13, 18884, 411, 1722, 29898, 1514, 29918, 2084, 29974, 4286, 5140, 742, 525, 29893, 29890, 1495, 408, 1574, 29918, 449, 29901, 13, 462, 1678, 1574, 29918, 449, 29889, 3539, 29898, 1311, 3032, 1514, 29897, 13, 9651, 396, 25342, 451, 1583, 3032, 1514, 29889, 1975, 2541, 12839, 5140, 29374, 13, 9651, 396, 268, 1574, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 7382, 29918, 2084, 29892, 525, 262, 1445, 29889, 5140, 1495, 13, 9651, 396, 268, 528, 4422, 29889, 8552, 29906, 29898, 1311, 3032, 1514, 29892, 1574, 29918, 2084, 29897, 13, 9651, 1683, 29901, 13, 18884, 1574, 29918, 2084, 353, 1583, 3032, 1514, 13, 9651, 1018, 29901, 13, 18884, 805, 353, 1014, 5014, 29889, 29925, 3150, 4197, 1311, 3032, 5140, 21970, 29918, 2084, 29892, 525, 3888, 742, 1574, 29918, 2084, 1402, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 380, 20405, 29922, 2287, 29963, 10074, 29892, 13, 462, 462, 418, 6473, 29922, 8824, 29897, 13, 18884, 313, 25393, 29892, 24459, 353, 805, 29889, 27820, 403, 580, 13, 18884, 27591, 353, 27591, 29889, 13808, 29898, 1311, 3032, 7099, 6119, 29897, 13, 18884, 1583, 3032, 1949, 29918, 12292, 353, 518, 524, 29898, 1220, 29889, 5451, 877, 29901, 29861, 29896, 1822, 17010, 3101, 13, 462, 462, 259, 363, 1196, 297, 27591, 29889, 5451, 28909, 29876, 1495, 565, 525, 5074, 2302, 11283, 297, 1196, 3816, 29900, 29962, 13, 9651, 5174, 29901, 13, 18884, 1583, 3032, 1949, 29918, 12292, 353, 29871, 29900, 13, 13, 1678, 822, 903, 5510, 29918, 3225, 29898, 1311, 1125, 13, 13, 4706, 411, 5694, 1445, 29889, 5776, 1971, 653, 9882, 29898, 3972, 29922, 1311, 3032, 7382, 29918, 8771, 414, 29918, 3972, 29897, 408, 5694, 29918, 2084, 29901, 13, 9651, 565, 338, 8758, 29898, 1311, 3032, 1514, 29892, 6262, 1125, 13, 18884, 934, 29918, 8568, 353, 6608, 29918, 1445, 29898, 1311, 3032, 1514, 29897, 13, 18884, 1574, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 7382, 29918, 2084, 29892, 934, 29918, 8568, 718, 15300, 5140, 1495, 13, 18884, 411, 1722, 29898, 1514, 29918, 2084, 29892, 525, 29893, 29890, 1495, 408, 1574, 29918, 449, 29901, 13, 462, 1678, 1574, 29918, 449, 29889, 3539, 29898, 1311, 3032, 1514, 29897, 13, 9651, 25342, 451, 1583, 3032, 1514, 29889, 1975, 2541, 12839, 5140, 29374, 13, 18884, 1574, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 7382, 29918, 2084, 29892, 525, 262, 1445, 29889, 5140, 1495, 13, 18884, 528, 4422, 29889, 8552, 29906, 29898, 1311, 3032, 1514, 29892, 1574, 29918, 2084, 29897, 13, 9651, 1683, 29901, 13, 18884, 1574, 29918, 2084, 353, 1583, 3032, 1514, 13, 9651, 1018, 29901, 13, 18884, 9406, 29918, 9006, 353, 14210, 29879, 12725, 448, 29885, 9406, 1273, 29879, 29915, 1273, 313, 1311, 3032, 5140, 21970, 29918, 2084, 29892, 1574, 29918, 2084, 29897, 13, 18884, 26681, 287, 29918, 9006, 353, 14210, 29879, 12725, 448, 29885, 26681, 287, 1273, 29879, 29915, 1273, 313, 1311, 3032, 5140, 21970, 29918, 2084, 29892, 1574, 29918, 2084, 29897, 13, 18884, 396, 565, 1583, 3032, 369, 15828, 29901, 13, 18884, 396, 268, 9920, 353, 9920, 718, 525, 448, 29894, 29915, 13, 18884, 9406, 29918, 1028, 353, 1014, 5014, 29889, 29925, 3150, 29898, 13, 462, 1678, 528, 2506, 29889, 5451, 29898, 710, 919, 29918, 9006, 511, 13, 462, 1678, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 27591, 29922, 2287, 29963, 10074, 29892, 6473, 29922, 8824, 29897, 13, 18884, 26681, 287, 29918, 1028, 353, 1014, 5014, 29889, 29925, 3150, 29898, 13, 462, 1678, 528, 2506, 29889, 5451, 29898, 27480, 287, 29918, 9006, 511, 13, 462, 1678, 380, 20405, 29922, 1491, 5014, 29889, 2227, 4162, 29892, 27591, 29922, 2287, 29963, 10074, 29892, 6473, 29922, 8824, 29897, 13, 18884, 313, 3383, 9406, 29918, 3127, 29897, 353, 9406, 29918, 1028, 29889, 27820, 403, 29898, 15619, 29922, 1311, 3032, 15619, 470, 29871, 29953, 29900, 29900, 29897, 13, 18884, 9406, 29918, 3127, 353, 9406, 29918, 3127, 29889, 13808, 29898, 1311, 3032, 7099, 6119, 29892, 4436, 2433, 17281, 2824, 17010, 580, 13, 18884, 9406, 29918, 3127, 353, 337, 29889, 1491, 29898, 29878, 29908, 4269, 2202, 448, 8513, 29922, 27480, 287, 7244, 613, 15516, 9406, 29918, 3127, 29897, 13, 18884, 313, 3383, 26681, 287, 29918, 3127, 29897, 353, 26681, 287, 29918, 1028, 29889, 27820, 403, 29898, 15619, 29922, 1311, 3032, 15619, 470, 29871, 29953, 29900, 29900, 29897, 13, 18884, 26681, 287, 29918, 3127, 353, 26681, 287, 29918, 3127, 29889, 13808, 29898, 1311, 3032, 7099, 6119, 29892, 4436, 2433, 17281, 2824, 17010, 580, 13, 18884, 1059, 29918, 2749, 353, 518, 27480, 287, 29918, 3127, 29892, 9406, 29918, 3127, 29962, 565, 26681, 287, 29918, 3127, 451, 297, 9406, 29918, 3127, 1683, 518, 27480, 287, 29918, 3127, 29962, 13, 18884, 396, 1059, 29918, 2749, 353, 518, 4906, 363, 2643, 297, 4589, 29889, 5451, 28909, 29876, 1495, 565, 7431, 29898, 4906, 29897, 1405, 29871, 29900, 29962, 13, 18884, 1583, 3032, 15003, 29918, 13322, 29918, 401, 353, 4236, 29898, 710, 919, 29918, 1028, 29889, 2457, 401, 29892, 26681, 287, 29918, 1028, 29889, 2457, 401, 29897, 13, 18884, 1583, 3032, 1445, 29918, 9346, 287, 29918, 449, 29961, 5659, 2477, 1001, 29962, 353, 7700, 13, 9651, 5174, 5974, 449, 9544, 2859, 29901, 13, 18884, 9406, 29918, 1028, 29889, 21174, 580, 13, 18884, 26681, 287, 29918, 1028, 29889, 21174, 580, 13, 18884, 313, 3383, 9406, 29918, 3127, 29897, 353, 9406, 29918, 1028, 29889, 27820, 403, 580, 13, 18884, 313, 3383, 26681, 287, 29918, 3127, 29897, 353, 26681, 287, 29918, 1028, 29889, 27820, 403, 580, 13, 18884, 9406, 29918, 3127, 353, 9406, 29918, 3127, 29889, 13808, 29898, 1311, 3032, 7099, 6119, 29892, 4436, 2433, 17281, 2824, 17010, 580, 13, 18884, 9406, 29918, 3127, 353, 337, 29889, 1491, 29898, 29878, 29908, 4269, 2202, 448, 8513, 29922, 27480, 287, 7244, 613, 15516, 9406, 29918, 3127, 29897, 13, 18884, 26681, 287, 29918, 3127, 353, 26681, 287, 29918, 3127, 29889, 13808, 29898, 1311, 3032, 7099, 6119, 29892, 4436, 2433, 17281, 2824, 17010, 580, 13, 18884, 1059, 29918, 2749, 353, 518, 27480, 287, 29918, 3127, 29892, 9406, 29918, 3127, 29962, 565, 26681, 287, 29918, 3127, 451, 297, 9406, 29918, 3127, 1683, 518, 27480, 287, 29918, 3127, 29962, 13, 18884, 1059, 29918, 2749, 29889, 7851, 29898, 29900, 29892, 525, 2392, 29901, 3323, 5014, 5335, 287, 714, 29901, 1273, 29875, 29915, 1273, 313, 1311, 3032, 15619, 470, 29871, 29953, 29900, 29900, 876, 13, 18884, 1583, 3032, 15003, 29918, 13322, 29918, 401, 353, 29871, 29900, 13, 18884, 1583, 3032, 1445, 29918, 9346, 287, 29918, 449, 29961, 5659, 2477, 1001, 29962, 353, 5852, 13, 9651, 5174, 8960, 408, 321, 29901, 13, 18884, 9406, 29918, 1028, 29889, 21174, 580, 13, 18884, 26681, 287, 29918, 1028, 29889, 21174, 580, 13, 18884, 313, 3383, 9406, 29918, 3127, 29897, 353, 9406, 29918, 1028, 29889, 27820, 403, 580, 13, 18884, 313, 3383, 26681, 287, 29918, 3127, 29897, 353, 26681, 287, 29918, 1028, 29889, 27820, 403, 580, 13, 18884, 9406, 29918, 3127, 353, 9406, 29918, 3127, 29889, 13808, 29898, 1311, 3032, 7099, 6119, 29892, 4436, 2433, 17281, 2824, 17010, 580, 13, 18884, 9406, 29918, 3127, 353, 337, 29889, 1491, 29898, 29878, 29908, 4269, 2202, 448, 8513, 29922, 27480, 287, 7244, 613, 15516, 9406, 29918, 3127, 29897, 13, 18884, 26681, 287, 29918, 3127, 353, 26681, 287, 29918, 3127, 29889, 13808, 29898, 1311, 3032, 7099, 6119, 29892, 4436, 2433, 17281, 2824, 17010, 580, 13, 18884, 1059, 29918, 2749, 353, 851, 29898, 29872, 467, 5451, 28909, 29876, 1495, 13, 18884, 13552, 21970, 29918, 261, 2288, 353, 518, 27480, 287, 29918, 3127, 29892, 9406, 29918, 3127, 29962, 565, 26681, 287, 29918, 3127, 451, 297, 9406, 29918, 3127, 1683, 518, 27480, 287, 29918, 3127, 29962, 13, 18884, 1059, 29918, 2749, 29889, 21843, 29898, 5140, 21970, 29918, 261, 2288, 29897, 13, 18884, 1583, 3032, 15003, 29918, 13322, 29918, 401, 353, 29871, 29900, 13, 18884, 1583, 3032, 1445, 29918, 9346, 287, 29918, 449, 29961, 5659, 2477, 1001, 29962, 353, 7700, 13, 4706, 1059, 29918, 2749, 353, 518, 3127, 363, 4589, 297, 1059, 29918, 2749, 565, 7431, 29898, 3127, 29897, 1405, 29871, 29900, 29962, 13, 4706, 1583, 3032, 19158, 353, 6024, 3782, 18116, 2033, 565, 7431, 29898, 2704, 29918, 2749, 29897, 1275, 29871, 29900, 1683, 1059, 29918, 2749, 13, 13, 1678, 822, 903, 10526, 431, 29918, 19158, 29898, 1311, 1125, 13, 4706, 565, 1583, 3032, 19158, 338, 6213, 29901, 13, 9651, 1583, 3032, 5510, 29918, 3225, 580, 13, 4706, 14387, 431, 2580, 29918, 19158, 353, 518, 1311, 3032, 14941, 29918, 4906, 29898, 3127, 29897, 363, 4589, 297, 1583, 3032, 19158, 29962, 13, 4706, 1059, 29918, 8977, 29901, 360, 919, 29961, 710, 29892, 938, 29962, 353, 9657, 580, 13, 4706, 363, 1059, 297, 14387, 431, 2580, 29918, 19158, 29901, 13, 9651, 1059, 29918, 8977, 29961, 2704, 29962, 353, 1059, 29918, 8977, 29889, 657, 29898, 2704, 29892, 29871, 29900, 29897, 718, 29871, 29896, 13, 4706, 1583, 3032, 14941, 287, 353, 1059, 29918, 8977, 13, 13, 1678, 822, 903, 14941, 29918, 4906, 29898, 1311, 29892, 4589, 1125, 13, 4706, 2643, 353, 4589, 29889, 17010, 580, 13, 4706, 5941, 287, 353, 525, 15634, 1059, 29915, 565, 2643, 29889, 27382, 2541, 877, 15634, 29901, 1495, 1683, 2643, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 4488, 4488, 613, 14704, 613, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 26732, 14247, 28341, 376, 29962, 613, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 26732, 8999, 29985, 5262, 3124, 29962, 613, 376, 9314, 29916, 6778, 613, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 26732, 29898, 5415, 29905, 29937, 3583, 29881, 3124, 19123, 18227, 5415, 29937, 29901, 29966, 29916, 12948, 613, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 26732, 29898, 5415, 29905, 29937, 29905, 29881, 3124, 19123, 18227, 5415, 29937, 29966, 29916, 12948, 613, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 1220, 353, 3551, 22896, 29958, 29962, 3124, 28341, 376, 1220, 353, 529, 29916, 28341, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 862, 2976, 13218, 29961, 3823, 3108, 3124, 1115, 613, 376, 862, 2976, 529, 29916, 23917, 613, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 17199, 14923, 571, 16750, 1203, 320, 29881, 29974, 613, 376, 17199, 14923, 571, 16750, 1203, 529, 29916, 28341, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 17199, 14923, 571, 16750, 4840, 320, 29881, 29974, 613, 376, 17199, 14923, 571, 16750, 4840, 529, 29916, 28341, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 26690, 11328, 19345, 10079, 29901, 869, 29974, 613, 376, 26690, 11328, 19345, 10079, 29901, 529, 29916, 28341, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 26732, 29876, 4013, 934, 1033, 367, 11328, 29914, 29909, 752, 492, 424, 541, 13552, 21970, 871, 11286, 6910, 5277, 11328, 478, 29896, 29889, 29955, 613, 15516, 13, 462, 308, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 15480, 2539, 9634, 29901, 869, 29974, 8340, 2635, 613, 376, 15480, 2539, 9634, 29901, 529, 29916, 29958, 8340, 2635, 613, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 15480, 2539, 2061, 29901, 869, 29974, 8340, 2635, 613, 376, 15480, 2539, 2061, 29901, 529, 29916, 29958, 8340, 2635, 613, 5941, 287, 29897, 13, 4706, 5941, 287, 353, 337, 29889, 1491, 29898, 29878, 29908, 29500, 2943, 1034, 14214, 869, 29974, 613, 376, 29500, 2943, 1034, 14214, 613, 5941, 287, 29897, 13, 4706, 736, 5941, 287, 13, 2 ]
rsvis/tools/canvas/imgcv.py
Tom-Hirschberger/DataVisualization
0
48003
# =========================================================================== # imgcv.py ---------------------------------------------------------------- # =========================================================================== # import ------------------------------------------------------------------ # --------------------------------------------------------------------------- import rsvis.utils.imgtools as imgtools import rsvis.utils.logger import logging import numpy as np from PIL import Image, ImageTk from tkinter import Canvas, NW # class ------------------------------------------------------------------- # --------------------------------------------------------------------------- class ImgCanvas(Canvas): # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def __init__( self, parent, shift=[4,4], sensitivity = 4, logger=None, **kwargs ): super(ImgCanvas, self).__init__(parent) self.bind("<Configure>", self.resize_image) self._mask = [None] self._mask_alpha = [150] self._mask_color = [[0,0,0]] self._mask_invert = [False] self._shift = shift self._scale = [1.0, 1.0] self.set_size([self.winfo_reqwidth(), self.winfo_reqheight()]) self._parent = parent self._logger = rsvis.utils.logger.Logger(logger=logger) # key bindings ---------------------------------------------------- self._mouse_sensitivity = 4 self._mouse_box = [0, 0, 0, 0] self._mouse_point = [0, 0] self._mouse_event = [0, 0] self._mouse_img = [0, 0] self._keys = dict() self.bind("<Button-1>", self.mouse_button_1_pressed) self.bind("<ButtonRelease-1>", self.mouse_button_1_released) # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def clear(self, **kwargs): pass # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_keys(self, **kwargs): return self._keys # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_logger(self): return self._logger # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def resize_image(self, event): # determine the ratio of old width/height to new width/height event_size = [event.width, event.height] ##################### self._scale = [float(e)/s for e, s in zip(event_size, self._size)] self.set_size(event_size) # resize the canvas self.config(width=self._size[0], height=self._size[1]) ################# # rescale all the objects tagged with the "all" tag self.scale("all", 0, 0, self._scale[0], self._scale[1]) ################ self.create_image() # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def resize_boxes(self, boxes, inversion=False): scale = [float(s)/i for s, i in zip(self.get_size(), self._img_size)] if inversion: scale = [1/s for s in scale] boxes = boxes if isinstance(boxes[0], list) and len(boxes[0]) !=2 else [boxes] return [self.resize_bbox(box, scale) for box in boxes] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def resize_bbox(self, box, scale): if len(box)==4: return [ int(box[0]*scale[1]), int(box[1]*scale[1]), int(box[2]*scale[0]), int(box[3]*scale[0]) ] else: return [[int(n[0] *scale[0]), int(n[1]*scale[1])] for n in box ] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def resize_points(self, points, inversion=False): scale = [float(s)/i for s, i in zip(self.get_size(), self._img_size)] if inversion: scale = [1/s for s in scale] points = points if isinstance(points[0], list) else [points] return [self.resize_point(point, scale) for point in points] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def resize_point(self, point, scale): return [int(point[0]*scale[1]), int(point[1]*scale[0])] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def resize_event(self, event): ev = [event.y, event.x] ev[0] = ev[0] if ev[0] >= 0 else 0 ev[0] = ev[0] if ev[0] < self._img_draw.size[1] else self._img_draw.size[1]-1 ev[1] = ev[1] if ev[1] >= 0 else 0 ev[1] = ev[1] if ev[1] < self._img_draw.size[0] else self._img_draw.size[0]-1 return ev # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_event_box(self, event): return [ min([self._mouse_point[0], self._mouse_event[0]]), max([self._mouse_point[0], self._mouse_event[0]]), min([self._mouse_point[1], self._mouse_event[1]]), max([self._mouse_point[1], self._mouse_event[1]]) ] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def set_img(self, img, clear_mask=True): if not isinstance(img, np.ndarray): return self._img_size = [img.shape[1], img.shape[0]] self._data_img = imgtools.expand_image_dim(img) if not isinstance(img.dtype, np.uint8): img = imgtools.project_and_stack(img, dtype=np.uint8, factor=255) self._img = Image.fromarray(img) if clear_mask: self.set_mask(show=False) self.create_image() # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def set_mask(self, mask=None, show=True, alpha=150, color=[0,0,0], invert=False): self._mask = mask if isinstance(mask, list) else [mask] self._mask_alpha = alpha if isinstance(alpha, list) else [alpha] self._mask_color = color if isinstance(color[0], list) else [color] self._mask_invert= invert if isinstance(invert, list) else [invert] if show: self.create_image() # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_mask(self, index=None, resize=False): if index is None: mask = self._mask[0] for idx in range(1, len(self._mask)): if isinstance(self._mask[idx], np.ndarray): mask = np.where(np.logical_and(mask, self._mask[idx]), 1, 0).astype(np.uint8) return mask else: if isinstance(self._mask[index], np.ndarray): return np.asarray(Image.fromarray(self._mask[index]).resize(self.get_size())) if resize else self._mask[index] else: return self._mask[index] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def is_mouse_event(self, bbox): if not (bbox[1]-bbox[0] > self._mouse_sensitivity and bbox[3]-bbox[2] > self._mouse_sensitivity): return False return True # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_img(self, show=False): if show: return np.asarray(self._img).copy() return self._data_img.copy() # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def set_size(self, size): self._size = [s - sh for s, sh in zip(size, self._shift)] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_size(self): return [s + sh for s, sh in zip(self._size, self._shift)] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_shape(self): size = self.get_size() return (size[1], size[0], 3) # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_intial_draw_image(self): return np.zeros(self.get_shape(), dtype=np.int16) - 1 # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def create_image(self, **kwargs): self._img_draw = self._img.resize(self.get_size()) if isinstance(self._mask[0], np.ndarray): for idx, (mask, color, alpha, invert) in enumerate(zip(self._mask, self._mask_color, self._mask_alpha, self._mask_invert)): mask = self.get_mask(index=idx, resize=True) mask = mask if not invert else imgtools.invert_bool_img(mask) mask = Image.fromarray( imgtools.get_transparent_image( imgtools.bool_to_img(mask, value=-1, dtype=np.int16, color=color, factor=255), value=alpha ) ) self._img_draw.paste(mask, (0, 0), mask) image = Image.fromarray( imgtools.get_transparent_image(self.draw_image(), value=200)) self._img_draw.paste(image, (0, 0), image) self._img_canvas = ImageTk.PhotoImage(image=self._img_draw) self._img_on_canvas = super(ImgCanvas, self).create_image(0, 0, image=self._img_canvas, anchor=NW) # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def draw_image(self, **kwargs): img_assembly = self.get_intial_draw_image() return img_assembly # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def mouse_button_1_pressed(self, event): self.focus_set() self._mouse_event = self.resize_event(event) self._mouse_point = [self._mouse_event[0], self._mouse_event[1]] # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def get_roi(self): if sum(self._mouse_box): roi_xy = self.resize_boxes(self._mouse_box, inversion=True)[0] roi = [roi_xy[2], roi_xy[0], roi_xy[3]-roi_xy[2], roi_xy[1]-roi_xy[0]] else: roi = [0, 0, self._data_img.shape[1]-1, self._data_img.shape[0]-1] return roi # method -------------------------------------------------------------- # ----------------------------------------------------------------------- def mouse_button_1_released(self, event): self.focus_set() self._mouse_event = self.resize_event(event) self._mouse_box = self.get_event_box(event) self._mouse_img = self.resize_points(self._mouse_event, inversion=True)[0] self._logger("[MOUSE] Pixel: {}, Value: {}".format(self._mouse_img, self._data_img[self._mouse_img[0], self._mouse_img[1], :] ) )
[ 1, 396, 1275, 9166, 9166, 9166, 9166, 4936, 29922, 13, 29937, 259, 10153, 11023, 29889, 2272, 448, 2683, 2683, 2683, 9072, 5634, 13, 29937, 1275, 9166, 9166, 9166, 9166, 4936, 29922, 13, 13, 29937, 259, 1053, 448, 2683, 2683, 2683, 2683, 29899, 13, 29937, 448, 2683, 2683, 2683, 2683, 28400, 13, 5215, 20371, 1730, 29889, 13239, 29889, 2492, 8504, 408, 10153, 8504, 13, 5215, 20371, 1730, 29889, 13239, 29889, 21707, 13, 13, 5215, 12183, 13, 5215, 12655, 408, 7442, 13, 3166, 349, 6227, 1053, 7084, 29892, 7084, 29911, 29895, 13, 3166, 18883, 1639, 1053, 1815, 4428, 29892, 405, 29956, 13, 13, 29937, 259, 770, 448, 2683, 2683, 2683, 2683, 489, 13, 29937, 448, 2683, 2683, 2683, 2683, 28400, 13, 1990, 1954, 29887, 21960, 29898, 21960, 1125, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 4770, 2344, 12035, 13, 9651, 1583, 29892, 29871, 13, 9651, 3847, 29892, 29871, 13, 9651, 9500, 11759, 29946, 29892, 29946, 1402, 13, 9651, 4771, 24858, 353, 29871, 29946, 29892, 13, 9651, 17927, 29922, 8516, 29892, 29871, 13, 9651, 3579, 19290, 13, 308, 1125, 13, 4706, 2428, 29898, 25518, 21960, 29892, 1583, 467, 1649, 2344, 12035, 3560, 29897, 13, 4706, 1583, 29889, 5355, 28945, 3991, 545, 28341, 1583, 29889, 21476, 29918, 3027, 29897, 13, 13, 4706, 1583, 3032, 13168, 353, 518, 8516, 29962, 13, 4706, 1583, 3032, 13168, 29918, 2312, 353, 518, 29896, 29945, 29900, 29962, 13, 4706, 1583, 3032, 13168, 29918, 2780, 353, 5519, 29900, 29892, 29900, 29892, 29900, 5262, 13, 4706, 1583, 3032, 13168, 29918, 262, 1765, 353, 518, 8824, 29962, 13, 308, 13, 4706, 1583, 3032, 10889, 353, 9500, 13, 4706, 1583, 3032, 7052, 353, 518, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29962, 13, 13, 4706, 1583, 29889, 842, 29918, 2311, 4197, 1311, 29889, 29893, 3888, 29918, 7971, 2103, 3285, 1583, 29889, 29893, 3888, 29918, 7971, 3545, 580, 2314, 29871, 13, 308, 13, 4706, 1583, 3032, 3560, 353, 3847, 13, 13, 4706, 1583, 3032, 21707, 353, 20371, 1730, 29889, 13239, 29889, 21707, 29889, 16363, 29898, 21707, 29922, 21707, 29897, 13, 13, 4706, 396, 259, 1820, 7868, 886, 448, 2683, 2683, 2683, 5634, 13, 4706, 1583, 3032, 15769, 29918, 23149, 24858, 353, 29871, 29946, 13, 4706, 1583, 3032, 15769, 29918, 1884, 353, 518, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29892, 29871, 29900, 29962, 13, 4706, 1583, 3032, 15769, 29918, 3149, 353, 518, 29900, 29892, 29871, 29900, 29962, 13, 4706, 1583, 3032, 15769, 29918, 3696, 353, 518, 29900, 29892, 29871, 29900, 29962, 13, 4706, 1583, 3032, 15769, 29918, 2492, 353, 518, 29900, 29892, 29871, 29900, 29962, 13, 308, 13, 4706, 1583, 3032, 8149, 353, 9657, 580, 13, 308, 13, 4706, 1583, 29889, 5355, 28945, 3125, 29899, 29896, 28341, 1583, 29889, 15769, 29918, 3092, 29918, 29896, 29918, 13120, 29897, 13, 4706, 1583, 29889, 5355, 28945, 3125, 19729, 29899, 29896, 28341, 1583, 29889, 15769, 29918, 3092, 29918, 29896, 29918, 276, 4611, 29897, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 2821, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 1209, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 8149, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 3032, 8149, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 21707, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 21707, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 19490, 29918, 3027, 29898, 1311, 29892, 1741, 1125, 13, 4706, 396, 8161, 278, 11959, 310, 2030, 2920, 29914, 3545, 304, 716, 2920, 29914, 3545, 13, 4706, 1741, 29918, 2311, 353, 518, 3696, 29889, 2103, 29892, 1741, 29889, 3545, 29962, 835, 13383, 2277, 13, 4706, 1583, 3032, 7052, 353, 518, 7411, 29898, 29872, 6802, 29879, 363, 321, 29892, 269, 297, 14319, 29898, 3696, 29918, 2311, 29892, 1583, 3032, 2311, 4638, 13, 308, 13, 4706, 1583, 29889, 842, 29918, 2311, 29898, 3696, 29918, 2311, 29897, 13, 4706, 396, 19490, 278, 10508, 29871, 13, 4706, 1583, 29889, 2917, 29898, 2103, 29922, 1311, 3032, 2311, 29961, 29900, 1402, 3171, 29922, 1311, 3032, 2311, 29961, 29896, 2314, 835, 7346, 4136, 2277, 13, 13, 4706, 396, 620, 29883, 744, 599, 278, 3618, 4055, 3192, 411, 278, 376, 497, 29908, 4055, 13, 4706, 1583, 29889, 7052, 703, 497, 613, 29871, 29900, 29892, 29871, 29900, 29892, 1583, 3032, 7052, 29961, 29900, 1402, 1583, 3032, 7052, 29961, 29896, 2314, 835, 7346, 4136, 29937, 13, 13, 4706, 1583, 29889, 3258, 29918, 3027, 580, 13, 268, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 19490, 29918, 1884, 267, 29898, 1311, 29892, 16273, 29892, 297, 3259, 29922, 8824, 1125, 13, 4706, 6287, 353, 518, 7411, 29898, 29879, 6802, 29875, 363, 269, 29892, 474, 297, 14319, 29898, 1311, 29889, 657, 29918, 2311, 3285, 1583, 3032, 2492, 29918, 2311, 4638, 13, 13, 4706, 565, 297, 3259, 29901, 13, 9651, 6287, 353, 518, 29896, 29914, 29879, 363, 269, 297, 6287, 29962, 13, 13, 4706, 16273, 353, 16273, 565, 338, 8758, 29898, 1884, 267, 29961, 29900, 1402, 1051, 29897, 322, 7431, 29898, 1884, 267, 29961, 29900, 2314, 2804, 29906, 1683, 518, 1884, 267, 29962, 13, 4706, 736, 518, 1311, 29889, 21476, 29918, 29890, 1884, 29898, 1884, 29892, 6287, 29897, 363, 3800, 297, 16273, 29962, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 19490, 29918, 29890, 1884, 29898, 1311, 29892, 3800, 29892, 6287, 1125, 13, 4706, 565, 7431, 29898, 1884, 29897, 1360, 29946, 29901, 259, 13, 9651, 736, 518, 13, 18884, 938, 29898, 1884, 29961, 29900, 14178, 7052, 29961, 29896, 11724, 938, 29898, 1884, 29961, 29896, 14178, 7052, 29961, 29896, 11724, 29871, 13, 18884, 938, 29898, 1884, 29961, 29906, 14178, 7052, 29961, 29900, 11724, 938, 29898, 1884, 29961, 29941, 14178, 7052, 29961, 29900, 2314, 13, 9651, 4514, 13, 4706, 1683, 29901, 13, 9651, 736, 5519, 524, 29898, 29876, 29961, 29900, 29962, 334, 7052, 29961, 29900, 11724, 938, 29898, 29876, 29961, 29896, 14178, 7052, 29961, 29896, 2314, 29962, 363, 302, 297, 3800, 4514, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 19490, 29918, 9748, 29898, 1311, 29892, 3291, 29892, 297, 3259, 29922, 8824, 1125, 13, 4706, 6287, 353, 518, 7411, 29898, 29879, 6802, 29875, 363, 269, 29892, 474, 297, 14319, 29898, 1311, 29889, 657, 29918, 2311, 3285, 1583, 3032, 2492, 29918, 2311, 4638, 13, 13, 4706, 565, 297, 3259, 29901, 13, 9651, 6287, 353, 518, 29896, 29914, 29879, 363, 269, 297, 6287, 29962, 13, 13, 4706, 3291, 353, 3291, 565, 338, 8758, 29898, 9748, 29961, 29900, 1402, 1051, 29897, 1683, 518, 9748, 29962, 13, 4706, 736, 518, 1311, 29889, 21476, 29918, 3149, 29898, 3149, 29892, 6287, 29897, 363, 1298, 297, 3291, 29962, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 19490, 29918, 3149, 29898, 1311, 29892, 1298, 29892, 6287, 1125, 259, 13, 4706, 736, 518, 524, 29898, 3149, 29961, 29900, 14178, 7052, 29961, 29896, 11724, 938, 29898, 3149, 29961, 29896, 14178, 7052, 29961, 29900, 2314, 29962, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 19490, 29918, 3696, 29898, 1311, 29892, 1741, 1125, 13, 4706, 3415, 353, 518, 3696, 29889, 29891, 29892, 1741, 29889, 29916, 29962, 13, 13, 4706, 3415, 29961, 29900, 29962, 353, 3415, 29961, 29900, 29962, 565, 3415, 29961, 29900, 29962, 6736, 29871, 29900, 1683, 29871, 29900, 29871, 13, 4706, 3415, 29961, 29900, 29962, 353, 3415, 29961, 29900, 29962, 565, 3415, 29961, 29900, 29962, 529, 1583, 3032, 2492, 29918, 4012, 29889, 2311, 29961, 29896, 29962, 1683, 1583, 3032, 2492, 29918, 4012, 29889, 2311, 29961, 29896, 29962, 29899, 29896, 13, 308, 13, 4706, 3415, 29961, 29896, 29962, 353, 3415, 29961, 29896, 29962, 565, 3415, 29961, 29896, 29962, 6736, 29871, 29900, 1683, 29871, 29900, 29871, 13, 4706, 3415, 29961, 29896, 29962, 353, 3415, 29961, 29896, 29962, 565, 3415, 29961, 29896, 29962, 529, 1583, 3032, 2492, 29918, 4012, 29889, 2311, 29961, 29900, 29962, 1683, 1583, 3032, 2492, 29918, 4012, 29889, 2311, 29961, 29900, 29962, 29899, 29896, 13, 308, 13, 4706, 736, 3415, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 3696, 29918, 1884, 29898, 1311, 29892, 1741, 1125, 13, 4706, 736, 518, 29871, 13, 9651, 1375, 4197, 1311, 3032, 15769, 29918, 3149, 29961, 29900, 1402, 1583, 3032, 15769, 29918, 3696, 29961, 29900, 5262, 511, 13, 9651, 4236, 4197, 1311, 3032, 15769, 29918, 3149, 29961, 29900, 1402, 1583, 3032, 15769, 29918, 3696, 29961, 29900, 5262, 511, 13, 9651, 1375, 4197, 1311, 3032, 15769, 29918, 3149, 29961, 29896, 1402, 1583, 3032, 15769, 29918, 3696, 29961, 29896, 5262, 511, 13, 9651, 4236, 4197, 1311, 3032, 15769, 29918, 3149, 29961, 29896, 1402, 1583, 3032, 15769, 29918, 3696, 29961, 29896, 24960, 13, 4706, 4514, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 731, 29918, 2492, 29898, 1311, 29892, 10153, 29892, 2821, 29918, 13168, 29922, 5574, 1125, 13, 4706, 565, 451, 338, 8758, 29898, 2492, 29892, 7442, 29889, 299, 2378, 1125, 13, 9651, 736, 13, 13, 4706, 1583, 3032, 2492, 29918, 2311, 353, 518, 2492, 29889, 12181, 29961, 29896, 1402, 10153, 29889, 12181, 29961, 29900, 5262, 13, 4706, 1583, 3032, 1272, 29918, 2492, 353, 10153, 8504, 29889, 18837, 29918, 3027, 29918, 6229, 29898, 2492, 29897, 13, 4706, 565, 451, 338, 8758, 29898, 2492, 29889, 29881, 1853, 29892, 7442, 29889, 13470, 29947, 1125, 13, 9651, 10153, 353, 10153, 8504, 29889, 4836, 29918, 392, 29918, 1429, 29898, 2492, 29892, 26688, 29922, 9302, 29889, 13470, 29947, 29892, 7329, 29922, 29906, 29945, 29945, 29897, 13, 308, 13, 4706, 1583, 3032, 2492, 353, 7084, 29889, 3166, 2378, 29898, 2492, 29897, 13, 632, 13, 4706, 565, 2821, 29918, 13168, 29901, 13, 9651, 1583, 29889, 842, 29918, 13168, 29898, 4294, 29922, 8824, 29897, 13, 13, 4706, 1583, 29889, 3258, 29918, 3027, 580, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 731, 29918, 13168, 29898, 1311, 29892, 11105, 29922, 8516, 29892, 1510, 29922, 5574, 29892, 15595, 29922, 29896, 29945, 29900, 29892, 2927, 11759, 29900, 29892, 29900, 29892, 29900, 1402, 21292, 29922, 8824, 1125, 13, 4706, 1583, 3032, 13168, 353, 11105, 565, 338, 8758, 29898, 13168, 29892, 1051, 29897, 1683, 518, 13168, 29962, 13, 4706, 1583, 3032, 13168, 29918, 2312, 353, 15595, 29871, 565, 338, 8758, 29898, 2312, 29892, 1051, 29897, 1683, 518, 2312, 29962, 13, 4706, 1583, 3032, 13168, 29918, 2780, 353, 2927, 565, 338, 8758, 29898, 2780, 29961, 29900, 1402, 1051, 29897, 1683, 518, 2780, 29962, 13, 4706, 1583, 3032, 13168, 29918, 262, 1765, 29922, 21292, 565, 338, 8758, 29898, 262, 1765, 29892, 1051, 29897, 1683, 518, 262, 1765, 29962, 13, 4706, 565, 1510, 29901, 13, 9651, 1583, 29889, 3258, 29918, 3027, 580, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 13168, 29898, 1311, 29892, 2380, 29922, 8516, 29892, 19490, 29922, 8824, 1125, 13, 4706, 565, 2380, 338, 6213, 29901, 13, 9651, 11105, 353, 1583, 3032, 13168, 29961, 29900, 29962, 13, 9651, 363, 22645, 297, 3464, 29898, 29896, 29892, 7431, 29898, 1311, 3032, 13168, 22164, 13, 18884, 565, 338, 8758, 29898, 1311, 3032, 13168, 29961, 13140, 1402, 7442, 29889, 299, 2378, 1125, 13, 462, 1678, 11105, 353, 7442, 29889, 3062, 29898, 9302, 29889, 1188, 936, 29918, 392, 29898, 13168, 29892, 1583, 3032, 13168, 29961, 13140, 11724, 29871, 29896, 29892, 29871, 29900, 467, 579, 668, 29898, 9302, 29889, 13470, 29947, 29897, 13, 9651, 736, 11105, 13, 4706, 1683, 29901, 13, 9651, 565, 338, 8758, 29898, 1311, 3032, 13168, 29961, 2248, 1402, 7442, 29889, 299, 2378, 1125, 13, 18884, 736, 7442, 29889, 294, 2378, 29898, 2940, 29889, 3166, 2378, 29898, 1311, 3032, 13168, 29961, 2248, 14664, 21476, 29898, 1311, 29889, 657, 29918, 2311, 22130, 565, 19490, 1683, 1583, 3032, 13168, 29961, 2248, 29962, 13, 9651, 1683, 29901, 13, 18884, 736, 1583, 3032, 13168, 29961, 2248, 29962, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 338, 29918, 15769, 29918, 3696, 29898, 1311, 29892, 289, 1884, 1125, 13, 4706, 565, 451, 313, 29890, 1884, 29961, 29896, 29962, 29899, 29890, 1884, 29961, 29900, 29962, 1405, 1583, 3032, 15769, 29918, 23149, 24858, 322, 289, 1884, 29961, 29941, 29962, 29899, 29890, 1884, 29961, 29906, 29962, 1405, 1583, 3032, 15769, 29918, 23149, 24858, 1125, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 2492, 29898, 1311, 29892, 1510, 29922, 8824, 1125, 13, 4706, 565, 1510, 29901, 13, 9651, 736, 7442, 29889, 294, 2378, 29898, 1311, 3032, 2492, 467, 8552, 580, 13, 4706, 736, 1583, 3032, 1272, 29918, 2492, 29889, 8552, 580, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 731, 29918, 2311, 29898, 1311, 29892, 2159, 1125, 13, 4706, 1583, 3032, 2311, 353, 518, 29879, 448, 528, 363, 269, 29892, 528, 297, 14319, 29898, 2311, 29892, 1583, 3032, 10889, 4638, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 2311, 29898, 1311, 1125, 13, 4706, 736, 518, 29879, 718, 528, 363, 269, 29892, 528, 297, 14319, 29898, 1311, 3032, 2311, 29892, 1583, 3032, 10889, 4638, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 12181, 29898, 1311, 1125, 13, 4706, 2159, 353, 1583, 29889, 657, 29918, 2311, 580, 13, 4706, 736, 313, 2311, 29961, 29896, 1402, 2159, 29961, 29900, 1402, 29871, 29941, 29897, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 524, 616, 29918, 4012, 29918, 3027, 29898, 1311, 1125, 13, 4706, 736, 7442, 29889, 3298, 359, 29898, 1311, 29889, 657, 29918, 12181, 3285, 26688, 29922, 9302, 29889, 524, 29896, 29953, 29897, 448, 29871, 29896, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 1653, 29918, 3027, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 1583, 3032, 2492, 29918, 4012, 353, 1583, 3032, 2492, 29889, 21476, 29898, 1311, 29889, 657, 29918, 2311, 3101, 13, 13, 4706, 565, 338, 8758, 29898, 1311, 3032, 13168, 29961, 29900, 1402, 7442, 29889, 299, 2378, 1125, 13, 9651, 363, 22645, 29892, 313, 13168, 29892, 2927, 29892, 15595, 29892, 21292, 29897, 297, 26985, 29898, 7554, 29898, 1311, 3032, 13168, 29892, 1583, 3032, 13168, 29918, 2780, 29892, 1583, 3032, 13168, 29918, 2312, 29892, 1583, 3032, 13168, 29918, 262, 1765, 22164, 13, 18884, 11105, 353, 1583, 29889, 657, 29918, 13168, 29898, 2248, 29922, 13140, 29892, 19490, 29922, 5574, 29897, 13, 18884, 11105, 353, 11105, 565, 451, 21292, 1683, 10153, 8504, 29889, 262, 1765, 29918, 11227, 29918, 2492, 29898, 13168, 29897, 13, 18884, 11105, 353, 7084, 29889, 3166, 2378, 29898, 13, 462, 1678, 10153, 8504, 29889, 657, 29918, 3286, 3560, 29918, 3027, 29898, 13, 462, 4706, 10153, 8504, 29889, 11227, 29918, 517, 29918, 2492, 29898, 13168, 29892, 995, 10457, 29896, 29892, 26688, 29922, 9302, 29889, 524, 29896, 29953, 29892, 2927, 29922, 2780, 29892, 7329, 29922, 29906, 29945, 29945, 511, 13, 462, 4706, 995, 29922, 2312, 13, 462, 1678, 1723, 13, 18884, 1723, 13, 18884, 1583, 3032, 2492, 29918, 4012, 29889, 16179, 29898, 13168, 29892, 313, 29900, 29892, 29871, 29900, 511, 11105, 29897, 13, 13, 4706, 1967, 353, 7084, 29889, 3166, 2378, 29898, 13, 9651, 10153, 8504, 29889, 657, 29918, 3286, 3560, 29918, 3027, 29898, 1311, 29889, 4012, 29918, 3027, 3285, 995, 29922, 29906, 29900, 29900, 876, 13, 4706, 1583, 3032, 2492, 29918, 4012, 29889, 16179, 29898, 3027, 29892, 313, 29900, 29892, 29871, 29900, 511, 1967, 29897, 13, 308, 13, 4706, 1583, 3032, 2492, 29918, 15257, 353, 7084, 29911, 29895, 29889, 25971, 2940, 29898, 3027, 29922, 1311, 3032, 2492, 29918, 4012, 29897, 13, 4706, 1583, 3032, 2492, 29918, 265, 29918, 15257, 353, 2428, 29898, 25518, 21960, 29892, 1583, 467, 3258, 29918, 3027, 29898, 29900, 29892, 29871, 29900, 29892, 1967, 29922, 1311, 3032, 2492, 29918, 15257, 29892, 17360, 29922, 29940, 29956, 29897, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 4216, 29918, 3027, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 10153, 29918, 26936, 353, 1583, 29889, 657, 29918, 524, 616, 29918, 4012, 29918, 3027, 580, 13, 4706, 736, 10153, 29918, 26936, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 9495, 29918, 3092, 29918, 29896, 29918, 13120, 29898, 1311, 29892, 1741, 1125, 13, 4706, 1583, 29889, 18037, 29918, 842, 580, 13, 4706, 1583, 3032, 15769, 29918, 3696, 353, 1583, 29889, 21476, 29918, 3696, 29898, 3696, 29897, 13, 4706, 1583, 3032, 15769, 29918, 3149, 353, 518, 1311, 3032, 15769, 29918, 3696, 29961, 29900, 1402, 1583, 3032, 15769, 29918, 3696, 29961, 29896, 5262, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 679, 29918, 307, 29875, 29898, 1311, 1125, 13, 4706, 565, 2533, 29898, 1311, 3032, 15769, 29918, 1884, 1125, 13, 9651, 14100, 29918, 3594, 353, 1583, 29889, 21476, 29918, 1884, 267, 29898, 1311, 3032, 15769, 29918, 1884, 29892, 297, 3259, 29922, 5574, 9601, 29900, 29962, 13, 9651, 14100, 353, 518, 307, 29875, 29918, 3594, 29961, 29906, 1402, 14100, 29918, 3594, 29961, 29900, 1402, 14100, 29918, 3594, 29961, 29941, 29962, 29899, 307, 29875, 29918, 3594, 29961, 29906, 1402, 14100, 29918, 3594, 29961, 29896, 29962, 29899, 307, 29875, 29918, 3594, 29961, 29900, 5262, 13, 4706, 1683, 29901, 13, 9651, 14100, 353, 518, 29900, 29892, 29871, 29900, 29892, 1583, 3032, 1272, 29918, 2492, 29889, 12181, 29961, 29896, 29962, 29899, 29896, 29892, 1583, 3032, 1272, 29918, 2492, 29889, 12181, 29961, 29900, 29962, 29899, 29896, 29962, 13, 13, 4706, 736, 14100, 13, 13, 1678, 396, 259, 1158, 448, 2683, 2683, 2683, 9072, 29899, 13, 1678, 396, 448, 2683, 2683, 2683, 2683, 22158, 13, 1678, 822, 9495, 29918, 3092, 29918, 29896, 29918, 276, 4611, 29898, 1311, 29892, 1741, 1125, 13, 4706, 1583, 29889, 18037, 29918, 842, 580, 13, 4706, 1583, 3032, 15769, 29918, 3696, 353, 1583, 29889, 21476, 29918, 3696, 29898, 3696, 29897, 13, 4706, 1583, 3032, 15769, 29918, 1884, 353, 1583, 29889, 657, 29918, 3696, 29918, 1884, 29898, 3696, 29897, 13, 13, 4706, 1583, 3032, 15769, 29918, 2492, 353, 1583, 29889, 21476, 29918, 9748, 29898, 1311, 3032, 15769, 29918, 3696, 29892, 297, 3259, 29922, 5574, 9601, 29900, 29962, 13, 13, 4706, 1583, 3032, 21707, 703, 29961, 6720, 17171, 29962, 349, 15711, 29901, 24335, 29871, 7865, 29901, 6571, 1642, 4830, 29898, 1311, 3032, 15769, 29918, 2492, 29892, 13, 9651, 1583, 3032, 1272, 29918, 2492, 29961, 1311, 3032, 15769, 29918, 2492, 29961, 29900, 1402, 1583, 3032, 15769, 29918, 2492, 29961, 29896, 1402, 584, 29962, 13, 9651, 1723, 13, 4706, 1723, 2 ]
setup.py
understood/ytreporty
1
108733
<reponame>understood/ytreporty<gh_stars>1-10 # -*- coding: utf-8; mode: Python; -*- # # Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You may # obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. See the License for the specific language governing # permissions and limitations under the License. from setuptools import setup, find_packages import ytreporty setup( name="ytreporty", version=ytreporty.__version__, description="CLI to the YouTube Reporting API", author="<NAME>", author_email="<EMAIL>", packages=find_packages(), )
[ 1, 529, 276, 1112, 420, 29958, 5062, 9337, 29914, 29891, 2484, 637, 29891, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 29936, 4464, 29901, 5132, 29936, 448, 29930, 29899, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 366, 13, 29937, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 887, 1122, 13, 29937, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 268, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 13, 29937, 2411, 2957, 29889, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 13, 29937, 11239, 322, 27028, 1090, 278, 19245, 29889, 13, 13, 3166, 731, 21245, 8789, 1053, 6230, 29892, 1284, 29918, 8318, 13, 13, 5215, 343, 2484, 637, 29891, 13, 13, 14669, 29898, 13, 1678, 1024, 543, 29891, 2484, 637, 29891, 613, 13, 1678, 1873, 29922, 29891, 2484, 637, 29891, 17255, 3259, 1649, 29892, 13, 1678, 6139, 543, 27205, 304, 278, 14711, 13969, 292, 3450, 613, 13, 1678, 4148, 543, 29966, 5813, 28341, 13, 1678, 4148, 29918, 5269, 543, 29966, 26862, 6227, 28341, 13, 1678, 9741, 29922, 2886, 29918, 8318, 3285, 13, 29897, 13, 2 ]
program/condition/and_cond.py
probing-lab/polar
2
87229
from .condition import Condition from .true_cond import TrueCond class And(Condition): cond1: Condition cond2: Condition def __init__(self, cond1, cond2): self.cond1 = cond1 self.cond2 = cond2 def simplify(self): self.cond1 = self.cond1.simplify() self.cond2 = self.cond2.simplify() if isinstance(self.cond1, TrueCond): return self.cond2 if isinstance(self.cond2, TrueCond): return self.cond1 return self def reduce(self, store): return self.cond1.reduce(store) + self.cond2.reduce(store) def get_normalized(self, program): self.cond1, failed_atoms1 = self.cond1.get_normalized(program) self.cond2, failed_atoms2 = self.cond2.get_normalized(program) return self, failed_atoms1 + failed_atoms2 def subs(self, substitutions): self.cond1.subs(substitutions) self.cond2.subs(substitutions) def evaluate(self, state): return self.cond1.evaluate(state) and self.cond2.evaluate(state) def get_conjuncts(self): return self.cond1.get_conjuncts() + self.cond2.get_conjuncts() def to_arithm(self, p): return self.cond1.to_arithm(p) * self.cond2.to_arithm(p) def get_free_symbols(self): return self.cond1.get_free_symbols() | self.cond2.get_free_symbols() def is_implied_by_loop_guard(self): if self.is_loop_guard: return True return self.cond1.is_implied_by_loop_guard() and self.cond1.is_implied_by_loop_guard() def get_loop_guard(self): if self.is_loop_guard: return self.copy() cond1_guard = self.cond1.get_loop_guard() return cond1_guard if cond1_guard is not None else self.cond2.get_loop_guard() def __str__(self): return f"({self.cond1} ∧ {self.cond2})" def __eq__(self, obj): return isinstance(obj, And) and (self.cond1, self.cond2) == (obj.cond1, obj.cond2) def __hash__(self): return hash(("AND", self.cond1, self.cond2)) def __simple_copy__(self): return And(self.cond1.copy(), self.cond2.copy())
[ 1, 515, 869, 16122, 1053, 11790, 654, 13, 3166, 869, 3009, 29918, 1116, 1053, 5852, 10983, 13, 13, 13, 1990, 1126, 29898, 25255, 1125, 13, 1678, 2148, 29896, 29901, 11790, 654, 13, 1678, 2148, 29906, 29901, 11790, 654, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2148, 29896, 29892, 2148, 29906, 1125, 13, 4706, 1583, 29889, 1116, 29896, 353, 2148, 29896, 13, 4706, 1583, 29889, 1116, 29906, 353, 2148, 29906, 13, 13, 1678, 822, 21092, 29898, 1311, 1125, 13, 4706, 1583, 29889, 1116, 29896, 353, 1583, 29889, 1116, 29896, 29889, 3601, 572, 1598, 580, 13, 4706, 1583, 29889, 1116, 29906, 353, 1583, 29889, 1116, 29906, 29889, 3601, 572, 1598, 580, 13, 4706, 565, 338, 8758, 29898, 1311, 29889, 1116, 29896, 29892, 5852, 10983, 1125, 13, 9651, 736, 1583, 29889, 1116, 29906, 13, 4706, 565, 338, 8758, 29898, 1311, 29889, 1116, 29906, 29892, 5852, 10983, 1125, 13, 9651, 736, 1583, 29889, 1116, 29896, 13, 4706, 736, 1583, 13, 13, 1678, 822, 10032, 29898, 1311, 29892, 3787, 1125, 13, 4706, 736, 1583, 29889, 1116, 29896, 29889, 17469, 29898, 8899, 29897, 718, 1583, 29889, 1116, 29906, 29889, 17469, 29898, 8899, 29897, 13, 13, 1678, 822, 679, 29918, 8945, 1891, 29898, 1311, 29892, 1824, 1125, 13, 4706, 1583, 29889, 1116, 29896, 29892, 5229, 29918, 271, 4835, 29896, 353, 1583, 29889, 1116, 29896, 29889, 657, 29918, 8945, 1891, 29898, 8860, 29897, 13, 4706, 1583, 29889, 1116, 29906, 29892, 5229, 29918, 271, 4835, 29906, 353, 1583, 29889, 1116, 29906, 29889, 657, 29918, 8945, 1891, 29898, 8860, 29897, 13, 4706, 736, 1583, 29892, 5229, 29918, 271, 4835, 29896, 718, 5229, 29918, 271, 4835, 29906, 13, 13, 1678, 822, 11684, 29898, 1311, 29892, 23697, 29879, 1125, 13, 4706, 1583, 29889, 1116, 29896, 29889, 1491, 29879, 29898, 22492, 5008, 29879, 29897, 13, 4706, 1583, 29889, 1116, 29906, 29889, 1491, 29879, 29898, 22492, 5008, 29879, 29897, 13, 13, 1678, 822, 14707, 29898, 1311, 29892, 2106, 1125, 13, 4706, 736, 1583, 29889, 1116, 29896, 29889, 24219, 403, 29898, 3859, 29897, 322, 1583, 29889, 1116, 29906, 29889, 24219, 403, 29898, 3859, 29897, 13, 13, 1678, 822, 679, 29918, 535, 29926, 18049, 29879, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 1116, 29896, 29889, 657, 29918, 535, 29926, 18049, 29879, 580, 718, 1583, 29889, 1116, 29906, 29889, 657, 29918, 535, 29926, 18049, 29879, 580, 13, 13, 1678, 822, 304, 29918, 23830, 29885, 29898, 1311, 29892, 282, 1125, 13, 4706, 736, 1583, 29889, 1116, 29896, 29889, 517, 29918, 23830, 29885, 29898, 29886, 29897, 334, 1583, 29889, 1116, 29906, 29889, 517, 29918, 23830, 29885, 29898, 29886, 29897, 13, 13, 1678, 822, 679, 29918, 9021, 29918, 18098, 29879, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 1116, 29896, 29889, 657, 29918, 9021, 29918, 18098, 29879, 580, 891, 1583, 29889, 1116, 29906, 29889, 657, 29918, 9021, 29918, 18098, 29879, 580, 13, 13, 1678, 822, 338, 29918, 6574, 2957, 29918, 1609, 29918, 7888, 29918, 17728, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 275, 29918, 7888, 29918, 17728, 29901, 13, 9651, 736, 5852, 13, 4706, 736, 1583, 29889, 1116, 29896, 29889, 275, 29918, 6574, 2957, 29918, 1609, 29918, 7888, 29918, 17728, 580, 322, 1583, 29889, 1116, 29896, 29889, 275, 29918, 6574, 2957, 29918, 1609, 29918, 7888, 29918, 17728, 580, 13, 13, 1678, 822, 679, 29918, 7888, 29918, 17728, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 275, 29918, 7888, 29918, 17728, 29901, 13, 9651, 736, 1583, 29889, 8552, 580, 13, 4706, 2148, 29896, 29918, 17728, 353, 1583, 29889, 1116, 29896, 29889, 657, 29918, 7888, 29918, 17728, 580, 13, 4706, 736, 2148, 29896, 29918, 17728, 565, 2148, 29896, 29918, 17728, 338, 451, 6213, 1683, 1583, 29889, 1116, 29906, 29889, 657, 29918, 7888, 29918, 17728, 580, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 736, 285, 29908, 3319, 1311, 29889, 1116, 29896, 29913, 29871, 30431, 426, 1311, 29889, 1116, 29906, 1800, 29908, 13, 13, 1678, 822, 4770, 1837, 12035, 1311, 29892, 5446, 1125, 13, 4706, 736, 338, 8758, 29898, 5415, 29892, 1126, 29897, 322, 313, 1311, 29889, 1116, 29896, 29892, 1583, 29889, 1116, 29906, 29897, 1275, 313, 5415, 29889, 1116, 29896, 29892, 5446, 29889, 1116, 29906, 29897, 13, 13, 1678, 822, 4770, 8568, 12035, 1311, 1125, 13, 4706, 736, 6608, 29898, 703, 9468, 613, 1583, 29889, 1116, 29896, 29892, 1583, 29889, 1116, 29906, 876, 13, 13, 1678, 822, 4770, 12857, 29918, 8552, 12035, 1311, 1125, 13, 4706, 736, 1126, 29898, 1311, 29889, 1116, 29896, 29889, 8552, 3285, 1583, 29889, 1116, 29906, 29889, 8552, 3101, 13, 2 ]
config/__init__.py
kave/boilerplate-repo
0
104147
<reponame>kave/boilerplate-repo<gh_stars>0 import os from distutils.util import strtobool from os.path import dirname, join from dotenv import load_dotenv dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path, verbose=True) # Server HOST = os.environ.get('HOST', '0.0.0.0') PORT = int(os.environ.get('PORT', 9000)) ENV = os.environ.get('ENV') IS_LOCAL = ENV == 'local' IS_HEROKU = ENV == 'heroku' DEBUG = strtobool(os.environ.get('DEBUG')) # Databases DB_HOST = os.environ.get('DB_HOST') DB_PORT = os.environ.get('DB_PORT') DB_DATABASE = os.environ.get('DB_DATABASE') DB_USERNAME = os.environ.get('DB_USERNAME') DB_PASSWORD = os.environ.get('DB_PASSWORD')
[ 1, 529, 276, 1112, 420, 29958, 1335, 345, 29914, 833, 3955, 2341, 29899, 20095, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 3166, 1320, 13239, 29889, 4422, 1053, 851, 517, 11227, 13, 3166, 2897, 29889, 2084, 1053, 4516, 978, 29892, 5988, 13, 13, 3166, 8329, 6272, 1053, 2254, 29918, 6333, 6272, 13, 13, 6333, 6272, 29918, 2084, 353, 5988, 29898, 25721, 22168, 1445, 1649, 511, 15300, 6272, 1495, 13, 1359, 29918, 6333, 6272, 29898, 6333, 6272, 29918, 2084, 29892, 26952, 29922, 5574, 29897, 13, 13, 29937, 5656, 13, 20832, 353, 2897, 29889, 21813, 29889, 657, 877, 20832, 742, 525, 29900, 29889, 29900, 29889, 29900, 29889, 29900, 1495, 13, 15082, 353, 938, 29898, 359, 29889, 21813, 29889, 657, 877, 15082, 742, 29871, 29929, 29900, 29900, 29900, 876, 13, 25838, 353, 2897, 29889, 21813, 29889, 657, 877, 25838, 1495, 13, 3235, 29918, 16652, 1964, 353, 12524, 29963, 1275, 525, 2997, 29915, 13, 3235, 29918, 4448, 8949, 29965, 353, 12524, 29963, 1275, 525, 2276, 9154, 29915, 13, 18525, 353, 851, 517, 11227, 29898, 359, 29889, 21813, 29889, 657, 877, 18525, 8785, 13, 13, 29937, 13373, 370, 2129, 13, 4051, 29918, 20832, 353, 2897, 29889, 21813, 29889, 657, 877, 4051, 29918, 20832, 1495, 13, 4051, 29918, 15082, 353, 2897, 29889, 21813, 29889, 657, 877, 4051, 29918, 15082, 1495, 13, 4051, 29918, 25832, 27982, 353, 2897, 29889, 21813, 29889, 657, 877, 4051, 29918, 25832, 27982, 1495, 13, 4051, 29918, 11889, 5813, 353, 2897, 29889, 21813, 29889, 657, 877, 4051, 29918, 11889, 5813, 1495, 13, 4051, 29918, 25711, 17013, 353, 2897, 29889, 21813, 29889, 657, 877, 4051, 29918, 25711, 17013, 1495, 13, 2 ]
CompetitiveProgramming/CodeChef/P20_MARCHA1.py
Sahil2rick/School-PythonProject
0
161847
# In the mysterious country of Byteland, everything is quite different from what you'd normally expect. In most places, if # you were approached by two mobsters in a dark alley, they would probably tell you to give them all the money that you # have. If you refused, or didn't have any - they might even beat you up. # # In Byteland the government decided that even the slightest chance of someone getting injured has to be ruled out. So, # they introduced a strict policy. When a mobster approaches you in a dark alley, he asks you for a specific amount of # money. You are obliged to show him all the money that you have, but you only need to pay up if he can find a subset of # your banknotes whose total value matches his demand. Since banknotes in Byteland can have any positive integer value # smaller than one thousand you are quite likely to get off without paying. # # Both the citizens and the gangsters of Byteland have very positive feelings about the system. No one ever gets hurt, the # gangsters don't lose their jobs, and there are quite a few rules that minimize that probability of getting mugged (the # first one is: don't go into dark alleys - and this one is said to work in other places also). # # Input # The first line contains integer t, the number of test cases (about 100). Then t test cases follow. Each test case starts # with n, the number of banknotes in your wallet, and m, the amount of money the muggers asked of you. Then n numbers # follow, representing values of your banknotes. Your wallet does not hold more than 20 banknotes, and the value of a # single banknote is never more than 1000. # # Output # For each test case output a single line with the word 'Yes' if there is a subset of your banknotes that sums to m, and # 'No' otherwise. # # Example # Input: # 5 # 3 3 # 1 # 1 # 1 # 5 11 # 1 # 2 # 4 # 8 # 16 # 5 23 # 1 # 2 # 4 # 8 # 16 # 5 13 # 1 # 5 # 5 # 10 # 10 # 20 132 # 17 # 6 # 4 # 998 # 254 # 137 # 259 # 153 # 154 # 3 # 28 # 19 # 123 # 542 # 857 # 23 # 687 # 35 # 99 # 999 # # Output: # Yes # Yes # Yes # No # Yes from itertools import combinations def subset(a, n, m): for i in range(1, n+1): array = combinations(a, i) for j in array: if sum(j) == m: return "Yes" return "No" for _ in range(int(input())): n, m = map(int, input().split()) a = [] for i in range(n): a.append(int(input())) ans = subset(a, n, m) print(ans) #Made by <NAME>
[ 1, 396, 512, 278, 22277, 2738, 4234, 310, 2648, 29873, 14045, 29892, 4129, 338, 3755, 1422, 515, 825, 366, 29915, 29881, 12891, 2149, 29889, 512, 1556, 7600, 29892, 565, 13, 29937, 366, 892, 26733, 491, 1023, 22458, 23080, 297, 263, 6501, 394, 2330, 29892, 896, 723, 3117, 2649, 366, 304, 2367, 963, 599, 278, 6909, 393, 366, 13, 29937, 505, 29889, 960, 366, 15964, 29892, 470, 3282, 29915, 29873, 505, 738, 448, 896, 1795, 1584, 16646, 366, 701, 29889, 13, 29937, 13, 29937, 512, 2648, 29873, 14045, 278, 5874, 8459, 393, 1584, 278, 7248, 342, 8825, 310, 4856, 2805, 28606, 756, 304, 367, 29490, 714, 29889, 1105, 29892, 13, 29937, 896, 9129, 263, 9406, 8898, 29889, 1932, 263, 22458, 2475, 13501, 366, 297, 263, 6501, 394, 2330, 29892, 540, 19514, 366, 363, 263, 2702, 5253, 310, 29871, 13, 29937, 6909, 29889, 887, 526, 24474, 304, 1510, 1075, 599, 278, 6909, 393, 366, 505, 29892, 541, 366, 871, 817, 304, 5146, 701, 565, 540, 508, 1284, 263, 11306, 310, 13, 29937, 596, 9124, 16953, 5069, 3001, 995, 7087, 670, 9667, 29889, 4001, 9124, 16953, 297, 2648, 29873, 14045, 508, 505, 738, 6374, 6043, 995, 13, 29937, 7968, 1135, 697, 10405, 366, 526, 3755, 5517, 304, 679, 1283, 1728, 5146, 292, 29889, 13, 29937, 13, 29937, 9134, 278, 18363, 322, 278, 20676, 23080, 310, 2648, 29873, 14045, 505, 1407, 6374, 21737, 1048, 278, 1788, 29889, 1939, 697, 3926, 4947, 21682, 29892, 278, 13, 29937, 20676, 23080, 1016, 29915, 29873, 14074, 1009, 17643, 29892, 322, 727, 526, 3755, 263, 2846, 6865, 393, 6260, 675, 393, 6976, 310, 2805, 286, 688, 3192, 313, 1552, 13, 29937, 937, 697, 338, 29901, 1016, 29915, 29873, 748, 964, 6501, 4788, 952, 448, 322, 445, 697, 338, 1497, 304, 664, 297, 916, 7600, 884, 467, 13, 29937, 13, 29937, 10567, 13, 29937, 450, 937, 1196, 3743, 6043, 260, 29892, 278, 1353, 310, 1243, 4251, 313, 12717, 29871, 29896, 29900, 29900, 467, 1987, 260, 1243, 4251, 1101, 29889, 7806, 1243, 1206, 8665, 13, 29937, 411, 302, 29892, 278, 1353, 310, 9124, 16953, 297, 596, 17042, 1026, 29892, 322, 286, 29892, 278, 5253, 310, 6909, 278, 286, 688, 5743, 4433, 310, 366, 29889, 1987, 302, 3694, 13, 29937, 1101, 29892, 15783, 1819, 310, 596, 9124, 16953, 29889, 3575, 17042, 1026, 947, 451, 4808, 901, 1135, 29871, 29906, 29900, 9124, 16953, 29892, 322, 278, 995, 310, 263, 13, 29937, 2323, 9124, 6812, 338, 2360, 901, 1135, 29871, 29896, 29900, 29900, 29900, 29889, 13, 29937, 13, 29937, 10604, 13, 29937, 1152, 1269, 1243, 1206, 1962, 263, 2323, 1196, 411, 278, 1734, 525, 8241, 29915, 565, 727, 338, 263, 11306, 310, 596, 9124, 16953, 393, 25470, 304, 286, 29892, 322, 13, 29937, 525, 3782, 29915, 6467, 29889, 13, 29937, 13, 29937, 8741, 13, 29937, 10567, 29901, 13, 29937, 29871, 29945, 13, 29937, 29871, 29941, 29871, 29941, 13, 29937, 29871, 29896, 13, 29937, 29871, 29896, 13, 29937, 29871, 29896, 13, 29937, 29871, 29945, 29871, 29896, 29896, 13, 29937, 29871, 29896, 13, 29937, 29871, 29906, 13, 29937, 29871, 29946, 13, 29937, 29871, 29947, 13, 29937, 29871, 29896, 29953, 13, 29937, 29871, 29945, 29871, 29906, 29941, 13, 29937, 29871, 29896, 13, 29937, 29871, 29906, 13, 29937, 29871, 29946, 13, 29937, 29871, 29947, 13, 29937, 29871, 29896, 29953, 13, 29937, 29871, 29945, 29871, 29896, 29941, 13, 29937, 29871, 29896, 13, 29937, 29871, 29945, 13, 29937, 29871, 29945, 13, 29937, 29871, 29896, 29900, 13, 29937, 29871, 29896, 29900, 13, 29937, 29871, 29906, 29900, 29871, 29896, 29941, 29906, 13, 29937, 29871, 29896, 29955, 13, 29937, 29871, 29953, 13, 29937, 29871, 29946, 13, 29937, 29871, 29929, 29929, 29947, 13, 29937, 29871, 29906, 29945, 29946, 13, 29937, 29871, 29896, 29941, 29955, 13, 29937, 29871, 29906, 29945, 29929, 13, 29937, 29871, 29896, 29945, 29941, 13, 29937, 29871, 29896, 29945, 29946, 13, 29937, 29871, 29941, 13, 29937, 29871, 29906, 29947, 13, 29937, 29871, 29896, 29929, 13, 29937, 29871, 29896, 29906, 29941, 13, 29937, 29871, 29945, 29946, 29906, 13, 29937, 29871, 29947, 29945, 29955, 13, 29937, 29871, 29906, 29941, 13, 29937, 29871, 29953, 29947, 29955, 13, 29937, 29871, 29941, 29945, 13, 29937, 29871, 29929, 29929, 13, 29937, 29871, 29929, 29929, 29929, 13, 29937, 13, 29937, 10604, 29901, 13, 29937, 3869, 13, 29937, 3869, 13, 29937, 3869, 13, 29937, 1939, 13, 29937, 3869, 13, 13, 3166, 4256, 8504, 1053, 18240, 13, 13, 1753, 11306, 29898, 29874, 29892, 302, 29892, 286, 1125, 13, 1678, 363, 474, 297, 3464, 29898, 29896, 29892, 302, 29974, 29896, 1125, 13, 4706, 1409, 353, 18240, 29898, 29874, 29892, 474, 29897, 13, 4706, 363, 432, 297, 1409, 29901, 13, 9651, 565, 2533, 29898, 29926, 29897, 1275, 286, 29901, 13, 18884, 736, 376, 8241, 29908, 13, 1678, 736, 376, 3782, 29908, 13, 13, 13, 1454, 903, 297, 3464, 29898, 524, 29898, 2080, 22130, 29901, 13, 1678, 302, 29892, 286, 353, 2910, 29898, 524, 29892, 1881, 2141, 5451, 3101, 13, 1678, 263, 353, 5159, 13, 1678, 363, 474, 297, 3464, 29898, 29876, 1125, 13, 4706, 263, 29889, 4397, 29898, 524, 29898, 2080, 22130, 13, 1678, 6063, 353, 11306, 29898, 29874, 29892, 302, 29892, 286, 29897, 13, 1678, 1596, 29898, 550, 29897, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 29937, 29924, 1943, 491, 529, 5813, 29958, 2 ]
src/pymodaq_plugins_moke/mokemacro.py
CEMES-CNRS/pymodaq_plugins_moke
0
161123
import sys from qtpy import QtWidgets from pymodaq.daq_utils.gui_utils import DockArea from pymodaq.daq_viewer.daq_viewer_main import DAQ_Viewer def main(): app = QtWidgets.QApplication(sys.argv) win = QtWidgets.QMainWindow() area = DockArea() win.setCentralWidget(area) win.resize(1000, 500) win.setWindowTitle('PyMoDAQ Viewer') prog = DAQ_Viewer(area, title="MokeMacro", DAQ_type='DAQ1D') prog.detector = 'MokeMacro' prog.init_det() win.show() sys.exit(app.exec_()) if __name__ == '__main__': main()
[ 1, 1053, 10876, 13, 3166, 3855, 29873, 2272, 1053, 14705, 8801, 29879, 13, 3166, 282, 962, 8887, 29939, 29889, 1388, 29939, 29918, 13239, 29889, 23569, 29918, 13239, 1053, 360, 1698, 13799, 13, 3166, 282, 962, 8887, 29939, 29889, 1388, 29939, 29918, 29894, 15580, 29889, 1388, 29939, 29918, 29894, 15580, 29918, 3396, 1053, 21330, 29984, 29918, 29963, 15580, 13, 13, 1753, 1667, 7295, 13, 1678, 623, 353, 14705, 8801, 29879, 29889, 29984, 4873, 29898, 9675, 29889, 19218, 29897, 13, 1678, 5401, 353, 14705, 8801, 29879, 29889, 29984, 6330, 5907, 580, 13, 1678, 4038, 353, 360, 1698, 13799, 580, 13, 1678, 5401, 29889, 842, 23369, 1705, 8801, 29898, 6203, 29897, 13, 1678, 5401, 29889, 21476, 29898, 29896, 29900, 29900, 29900, 29892, 29871, 29945, 29900, 29900, 29897, 13, 1678, 5401, 29889, 842, 5907, 7030, 877, 19737, 22638, 7698, 29984, 478, 15580, 1495, 13, 1678, 410, 29887, 353, 21330, 29984, 29918, 29963, 15580, 29898, 6203, 29892, 3611, 543, 29924, 6946, 15735, 307, 613, 21330, 29984, 29918, 1853, 2433, 7698, 29984, 29896, 29928, 1495, 13, 1678, 410, 29887, 29889, 4801, 3019, 353, 525, 29924, 6946, 15735, 307, 29915, 13, 1678, 410, 29887, 29889, 2344, 29918, 4801, 580, 13, 1678, 5401, 29889, 4294, 580, 13, 1678, 10876, 29889, 13322, 29898, 932, 29889, 4258, 29918, 3101, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 2 ]
projects/api/components.py
Matheus158257/projects
0
122955
# -*- coding: utf-8 -*- """Components blueprint.""" from flask import jsonify, request from flask_smorest import Blueprint from ..controllers.components import create_component, get_component, update_component, \ delete_component, pagination_components, total_rows_components from ..utils import to_snake_case bp = Blueprint("components", __name__) @bp.route("", methods=["GET"]) @bp.paginate(page=0) def handle_list_components(pagination_parameters): name = request.args.get('name') total_rows = total_rows_components(name=name) components = pagination_components(name=name, page=pagination_parameters.page, page_size=pagination_parameters.page_size) response = { 'total': total_rows, 'components': components } return jsonify(response) @bp.route("", methods=["POST"]) def handle_post_components(): """Handles POST requests to /.""" kwargs = request.get_json(force=True) kwargs = {to_snake_case(k): v for k, v in kwargs.items()} component = create_component(**kwargs) return jsonify(component) @bp.route("<component_id>", methods=["GET"]) def handle_get_component(component_id): """Handles GET requests to /<component_id>.""" return jsonify(get_component(uuid=component_id)) @bp.route("<component_id>", methods=["PATCH"]) def handle_patch_component(component_id): """Handles PATCH requests to /<component_id>.""" kwargs = request.get_json(force=True) kwargs = {to_snake_case(k): v for k, v in kwargs.items()} component = update_component(uuid=component_id, **kwargs) return jsonify(component) @bp.route("<component_id>", methods=["DELETE"]) def handle_delete_component(component_id): """Handles DELETE requests to /<component_id>.""" return jsonify(delete_component(uuid=component_id))
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 25503, 7254, 2158, 1213, 15945, 13, 13, 3166, 29784, 1053, 4390, 1598, 29892, 2009, 13, 3166, 29784, 29918, 3844, 272, 342, 1053, 10924, 2158, 13, 13, 3166, 6317, 1285, 11897, 29889, 14036, 1053, 1653, 29918, 9700, 29892, 679, 29918, 9700, 29892, 2767, 29918, 9700, 29892, 320, 13, 268, 5217, 29918, 9700, 29892, 10203, 3381, 29918, 14036, 29892, 3001, 29918, 5727, 29918, 14036, 13, 3166, 6317, 13239, 1053, 304, 29918, 29879, 21040, 29918, 4878, 13, 13, 25288, 353, 10924, 2158, 703, 14036, 613, 4770, 978, 1649, 29897, 13, 13, 13, 29992, 25288, 29889, 13134, 703, 613, 3519, 29922, 3366, 7194, 20068, 13, 29992, 25288, 29889, 13573, 16976, 29898, 3488, 29922, 29900, 29897, 13, 1753, 4386, 29918, 1761, 29918, 14036, 29898, 13573, 3381, 29918, 16744, 1125, 13, 1678, 1024, 353, 2009, 29889, 5085, 29889, 657, 877, 978, 1495, 13, 1678, 3001, 29918, 5727, 353, 3001, 29918, 5727, 29918, 14036, 29898, 978, 29922, 978, 29897, 13, 1678, 7117, 353, 10203, 3381, 29918, 14036, 29898, 978, 29922, 978, 29892, 13, 462, 462, 539, 1813, 29922, 13573, 3381, 29918, 16744, 29889, 3488, 29892, 13, 462, 462, 539, 1813, 29918, 2311, 29922, 13573, 3381, 29918, 16744, 29889, 3488, 29918, 2311, 29897, 13, 1678, 2933, 353, 426, 13, 4706, 525, 7827, 2396, 3001, 29918, 5727, 29892, 13, 4706, 525, 14036, 2396, 7117, 13, 1678, 500, 13, 1678, 736, 4390, 1598, 29898, 5327, 29897, 13, 13, 13, 29992, 25288, 29889, 13134, 703, 613, 3519, 29922, 3366, 5438, 20068, 13, 1753, 4386, 29918, 2490, 29918, 14036, 7295, 13, 1678, 9995, 3481, 793, 11971, 7274, 304, 847, 1213, 15945, 13, 1678, 9049, 5085, 353, 2009, 29889, 657, 29918, 3126, 29898, 10118, 29922, 5574, 29897, 13, 1678, 9049, 5085, 353, 426, 517, 29918, 29879, 21040, 29918, 4878, 29898, 29895, 1125, 325, 363, 413, 29892, 325, 297, 9049, 5085, 29889, 7076, 28296, 13, 1678, 4163, 353, 1653, 29918, 9700, 29898, 1068, 19290, 29897, 13, 1678, 736, 4390, 1598, 29898, 9700, 29897, 13, 13, 13, 29992, 25288, 29889, 13134, 28945, 9700, 29918, 333, 28341, 3519, 29922, 3366, 7194, 20068, 13, 1753, 4386, 29918, 657, 29918, 9700, 29898, 9700, 29918, 333, 1125, 13, 1678, 9995, 3481, 793, 12354, 7274, 304, 847, 29966, 9700, 29918, 333, 29958, 1213, 15945, 13, 1678, 736, 4390, 1598, 29898, 657, 29918, 9700, 29898, 25118, 29922, 9700, 29918, 333, 876, 13, 13, 13, 29992, 25288, 29889, 13134, 28945, 9700, 29918, 333, 28341, 3519, 29922, 3366, 29925, 14789, 20068, 13, 1753, 4386, 29918, 5041, 29918, 9700, 29898, 9700, 29918, 333, 1125, 13, 1678, 9995, 3481, 793, 349, 14789, 7274, 304, 847, 29966, 9700, 29918, 333, 29958, 1213, 15945, 13, 1678, 9049, 5085, 353, 2009, 29889, 657, 29918, 3126, 29898, 10118, 29922, 5574, 29897, 13, 1678, 9049, 5085, 353, 426, 517, 29918, 29879, 21040, 29918, 4878, 29898, 29895, 1125, 325, 363, 413, 29892, 325, 297, 9049, 5085, 29889, 7076, 28296, 13, 1678, 4163, 353, 2767, 29918, 9700, 29898, 25118, 29922, 9700, 29918, 333, 29892, 3579, 19290, 29897, 13, 1678, 736, 4390, 1598, 29898, 9700, 29897, 13, 13, 13, 29992, 25288, 29889, 13134, 28945, 9700, 29918, 333, 28341, 3519, 29922, 3366, 2287, 18476, 20068, 13, 1753, 4386, 29918, 8143, 29918, 9700, 29898, 9700, 29918, 333, 1125, 13, 1678, 9995, 3481, 793, 5012, 18476, 7274, 304, 847, 29966, 9700, 29918, 333, 29958, 1213, 15945, 13, 1678, 736, 4390, 1598, 29898, 8143, 29918, 9700, 29898, 25118, 29922, 9700, 29918, 333, 876, 13, 2 ]
8KYU/first_non_consecutive.py
yaznasivasai/python_codewars
4
41484
def first_non_consecutive(arr: list) -> int: ''' This function returns the first element of an array that is not consecutive. ''' if len(arr) < 2: return None non_consecutive = [] for i in range(len(arr) - 1): if arr[i+1] - arr[i] != 1: non_consecutive.append(arr[i+1]) if len(non_consecutive) == 0: return None return int(''.join(map(str, non_consecutive[:1])))
[ 1, 822, 937, 29918, 5464, 29918, 535, 3471, 11067, 29898, 2749, 29901, 1051, 29897, 1599, 938, 29901, 13, 1678, 14550, 910, 740, 3639, 278, 937, 1543, 310, 385, 1409, 393, 338, 451, 18942, 29889, 14550, 13, 1678, 565, 7431, 29898, 2749, 29897, 529, 29871, 29906, 29901, 13, 4706, 736, 6213, 13, 1678, 1661, 29918, 535, 3471, 11067, 353, 5159, 13, 1678, 363, 474, 297, 3464, 29898, 2435, 29898, 2749, 29897, 448, 29871, 29896, 1125, 13, 4706, 565, 3948, 29961, 29875, 29974, 29896, 29962, 448, 3948, 29961, 29875, 29962, 2804, 29871, 29896, 29901, 13, 9651, 1661, 29918, 535, 3471, 11067, 29889, 4397, 29898, 2749, 29961, 29875, 29974, 29896, 2314, 13, 1678, 565, 7431, 29898, 5464, 29918, 535, 3471, 11067, 29897, 1275, 29871, 29900, 29901, 13, 4706, 736, 6213, 13, 1678, 736, 938, 877, 4286, 7122, 29898, 1958, 29898, 710, 29892, 1661, 29918, 535, 3471, 11067, 7503, 29896, 29962, 4961, 2 ]
commands/interactive.py
Aprelius/tplink-smart-devices
0
1616428
from tplink.discover import LoadDevices commands = { 'toggle': 'Disable the devices', 'help': 'Display this help menu', 'quit': 'Exit this interactive prompt', 'list': 'List available devices', 'use': 'Target a specific device ID or name for commands' } def IsNumber(value): try: int(value) except ValueError: return False return True def Interactive(config, args): target = None devices = LoadDevices(args.devices) if len(devices) == 1: target = devices[0] while True: try: if target is not None: print('Using device: {}'.format(target.GetAlias())) command = input('Select interactive option (help for menu): ') if command is None or len(command) == 0: continue args = command.split(' ') command = args.pop(0).lower() if command == 'q' or command == 'quit': break elif command == 'h' or command == 'help': print('Available options:\n') for option, text in commands.items(): print('{}: {}'.format(option, text)) elif command == 'l' or command == 'list': print('Available devices:\n') for i in range(len(devices)): print('{}) {} ({})'.format(i + 1, devices[i].GetAlias(), devices[i].address)) elif command == 'reboot': for i in range(len(devices)): print("Rebooting device '{}' ...".format(devices[i].GetAlias())) result = devices[i].Set('system', 'reboot', {'delay': 1}) print("device='{}' result={}".format(devices[i].GetAlias(), result)) elif command == 'toggle': for i in range(len(devices)): if devices[i].IsOn(): devices[i].Off() print("Changing active state for '{}' to 'Off'".format( devices[i].GetAlias())) elif devices[i].IsOff(): devices[i].On() print("Changing active state for '{}' to 'On'".format( devices[i].GetAlias())) elif command == 'use': if len(args) == 0: if target is not None: target = None else: print('Error: specify a device ID or name to select') elif IsNumber(args[0]): index = int(args[0]) if index > 0 and index <= len(devices): target = devices[index - 1] else: print("Error: invalid device id '{}'".format(args[0])) else: name = ' '.join(args) for device in devices: if device.GetAlias() == name: target = device break if target is None: print("Error: Unknown device '{}'".format(name)) elif command == 'set': if len(args) < 2: print('Error: invalid set parameters') else: option = args[0] value = ' '.join(args[1:]) result = False if option == 'alias': result = target.SetAlias(value) else: print("Error: invalid set-option '{}'".fomrat(option)) continue if result: print('Success') else: print('Failed') else: print('Error: unknown option: {}'.format(command)) print() except KeyboardInterrupt: print("Type 'quit' to exit the interactive utility") print() except EOFError: return False return True
[ 1, 515, 260, 572, 682, 29889, 2218, 11911, 1053, 16012, 16618, 1575, 13, 13, 26381, 353, 426, 13, 1678, 525, 13270, 2396, 525, 4205, 519, 278, 9224, 742, 13, 1678, 525, 8477, 2396, 525, 9323, 445, 1371, 6143, 742, 13, 1678, 525, 28358, 2396, 525, 24365, 445, 28923, 9508, 742, 13, 1678, 525, 1761, 2396, 525, 1293, 3625, 9224, 742, 13, 1678, 525, 1509, 2396, 525, 8667, 263, 2702, 4742, 3553, 470, 1024, 363, 8260, 29915, 13, 29913, 13, 13, 1753, 1317, 4557, 29898, 1767, 1125, 13, 1678, 1018, 29901, 13, 4706, 938, 29898, 1767, 29897, 13, 1678, 5174, 7865, 2392, 29901, 13, 4706, 736, 7700, 13, 1678, 736, 5852, 13, 13, 13, 1753, 4124, 4925, 29898, 2917, 29892, 6389, 1125, 13, 1678, 3646, 353, 6213, 13, 1678, 9224, 353, 16012, 16618, 1575, 29898, 5085, 29889, 3359, 1575, 29897, 13, 1678, 565, 7431, 29898, 3359, 1575, 29897, 1275, 29871, 29896, 29901, 13, 4706, 3646, 353, 9224, 29961, 29900, 29962, 13, 13, 1678, 1550, 5852, 29901, 13, 4706, 1018, 29901, 13, 9651, 565, 3646, 338, 451, 6213, 29901, 13, 18884, 1596, 877, 15156, 4742, 29901, 6571, 4286, 4830, 29898, 5182, 29889, 2577, 29909, 18849, 22130, 13, 13, 9651, 1899, 353, 1881, 877, 3549, 28923, 2984, 313, 8477, 363, 6143, 1125, 25710, 13, 9651, 565, 1899, 338, 6213, 470, 7431, 29898, 6519, 29897, 1275, 29871, 29900, 29901, 13, 18884, 6773, 13, 13, 9651, 6389, 353, 1899, 29889, 5451, 877, 25710, 13, 9651, 1899, 353, 6389, 29889, 7323, 29898, 29900, 467, 13609, 580, 13, 9651, 565, 1899, 1275, 525, 29939, 29915, 470, 1899, 1275, 525, 28358, 2396, 13, 18884, 2867, 13, 9651, 25342, 1899, 1275, 525, 29882, 29915, 470, 1899, 1275, 525, 8477, 2396, 13, 18884, 1596, 877, 27635, 3987, 3583, 29876, 1495, 13, 18884, 363, 2984, 29892, 1426, 297, 8260, 29889, 7076, 7295, 13, 462, 1678, 1596, 877, 29912, 6177, 6571, 4286, 4830, 29898, 3385, 29892, 1426, 876, 13, 9651, 25342, 1899, 1275, 525, 29880, 29915, 470, 1899, 1275, 525, 1761, 2396, 13, 18884, 1596, 877, 27635, 9224, 3583, 29876, 1495, 13, 18884, 363, 474, 297, 3464, 29898, 2435, 29898, 3359, 1575, 22164, 13, 462, 1678, 1596, 877, 29912, 1800, 6571, 21313, 1800, 4286, 4830, 29898, 29875, 718, 29871, 29896, 29892, 9224, 29961, 29875, 1822, 2577, 29909, 18849, 3285, 9224, 29961, 29875, 1822, 7328, 876, 13, 9651, 25342, 1899, 1275, 525, 276, 4777, 2396, 13, 18884, 363, 474, 297, 3464, 29898, 2435, 29898, 3359, 1575, 22164, 13, 462, 1678, 1596, 703, 29934, 774, 3155, 292, 4742, 525, 8875, 29915, 2023, 1642, 4830, 29898, 3359, 1575, 29961, 29875, 1822, 2577, 29909, 18849, 22130, 13, 462, 1678, 1121, 353, 9224, 29961, 29875, 1822, 2697, 877, 5205, 742, 525, 276, 4777, 742, 11117, 18829, 2396, 29871, 29896, 1800, 13, 462, 1678, 1596, 703, 10141, 2433, 8875, 29915, 1121, 3790, 29913, 1642, 4830, 29898, 3359, 1575, 29961, 29875, 1822, 2577, 29909, 18849, 3285, 1121, 876, 13, 9651, 25342, 1899, 1275, 525, 13270, 2396, 13, 18884, 363, 474, 297, 3464, 29898, 2435, 29898, 3359, 1575, 22164, 13, 462, 1678, 565, 9224, 29961, 29875, 1822, 3624, 2951, 7295, 13, 462, 4706, 9224, 29961, 29875, 1822, 6880, 580, 13, 462, 4706, 1596, 703, 1451, 9776, 6136, 2106, 363, 525, 8875, 29915, 304, 525, 6880, 29915, 1642, 4830, 29898, 13, 462, 9651, 9224, 29961, 29875, 1822, 2577, 29909, 18849, 22130, 13, 462, 1678, 25342, 9224, 29961, 29875, 1822, 3624, 6880, 7295, 13, 462, 4706, 9224, 29961, 29875, 1822, 2951, 580, 13, 462, 4706, 1596, 703, 1451, 9776, 6136, 2106, 363, 525, 8875, 29915, 304, 525, 2951, 29915, 1642, 4830, 29898, 13, 462, 9651, 9224, 29961, 29875, 1822, 2577, 29909, 18849, 22130, 13, 9651, 25342, 1899, 1275, 525, 1509, 2396, 13, 18884, 565, 7431, 29898, 5085, 29897, 1275, 29871, 29900, 29901, 13, 462, 1678, 565, 3646, 338, 451, 6213, 29901, 13, 462, 4706, 3646, 353, 6213, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1596, 877, 2392, 29901, 6084, 263, 4742, 3553, 470, 1024, 304, 1831, 1495, 13, 18884, 25342, 1317, 4557, 29898, 5085, 29961, 29900, 29962, 1125, 13, 462, 1678, 2380, 353, 938, 29898, 5085, 29961, 29900, 2314, 13, 462, 1678, 565, 2380, 1405, 29871, 29900, 322, 2380, 5277, 7431, 29898, 3359, 1575, 1125, 13, 462, 4706, 3646, 353, 9224, 29961, 2248, 448, 29871, 29896, 29962, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1596, 703, 2392, 29901, 8340, 4742, 1178, 525, 8875, 29915, 1642, 4830, 29898, 5085, 29961, 29900, 12622, 13, 18884, 1683, 29901, 13, 462, 1678, 1024, 353, 525, 15300, 7122, 29898, 5085, 29897, 13, 462, 1678, 363, 4742, 297, 9224, 29901, 13, 462, 4706, 565, 4742, 29889, 2577, 29909, 18849, 580, 1275, 1024, 29901, 13, 462, 9651, 3646, 353, 4742, 13, 462, 9651, 2867, 13, 462, 1678, 565, 3646, 338, 6213, 29901, 13, 462, 4706, 1596, 703, 2392, 29901, 853, 5203, 4742, 525, 8875, 29915, 1642, 4830, 29898, 978, 876, 13, 9651, 25342, 1899, 1275, 525, 842, 2396, 13, 18884, 565, 7431, 29898, 5085, 29897, 529, 29871, 29906, 29901, 13, 462, 1678, 1596, 877, 2392, 29901, 8340, 731, 4128, 1495, 13, 18884, 1683, 29901, 13, 462, 1678, 2984, 353, 6389, 29961, 29900, 29962, 13, 462, 1678, 995, 353, 525, 15300, 7122, 29898, 5085, 29961, 29896, 29901, 2314, 13, 462, 1678, 1121, 353, 7700, 13, 462, 1678, 565, 2984, 1275, 525, 19973, 2396, 13, 462, 4706, 1121, 353, 3646, 29889, 2697, 29909, 18849, 29898, 1767, 29897, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1596, 703, 2392, 29901, 8340, 731, 29899, 3385, 525, 8875, 29915, 1642, 29888, 290, 3605, 29898, 3385, 876, 13, 462, 4706, 6773, 13, 462, 1678, 565, 1121, 29901, 13, 462, 4706, 1596, 877, 14191, 1495, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 1596, 877, 17776, 1495, 13, 13, 9651, 1683, 29901, 13, 18884, 1596, 877, 2392, 29901, 9815, 2984, 29901, 6571, 4286, 4830, 29898, 6519, 876, 13, 9651, 1596, 580, 13, 4706, 5174, 7670, 3377, 4074, 6685, 29901, 13, 9651, 1596, 703, 1542, 525, 28358, 29915, 304, 6876, 278, 28923, 19725, 1159, 13, 9651, 1596, 580, 13, 4706, 5174, 382, 9800, 2392, 29901, 13, 9651, 736, 7700, 13, 1678, 736, 5852, 13, 2 ]
isoimage.py
nuk380y/piedpiper-pakman-faas
0
159656
import yaml import sys import os import pathlib import zipfile import shutil import tarfile import errno # Read YAML file def main(argv): command_name = 'mkisofs' target_directory = 'target' if sys.version_info[0] != 3 or sys.version_info[1] < 6: print("This script requires Python version 3.6+") sys.exit(1) with open(argv[0]) as stream: if not (does_file_exists(argv[0])): print('Can not find Yaml File :'+sys.argv[1:]) return 1 if not is_tool(command_name): print('Command '+command_name+" Not Found on this system") return 1 try: data_loaded = yaml.safe_load(stream) except yaml.YAMLError as exc: print(exc) return 1 # print the read file print(" Statred Processing :"+sys.argv[1]) # validate yaml file before processing validate_yaml_file(data_loaded) # print(data_loaded) mkdir_p(target_directory) # get_iso_package_name(data_loaded,packages); image_name = 'default.iso' # image_type = 'iso' structure = {} for row in data_loaded.get('packages'): if 'structure' in row: # image_name = row.get('name') # image_type = row.get('type') # print('Image name:', image_name) # print('Image type:', image_type) structure = row.get('structure') for files_row in structure.get('files'): if 'file' in files_row: file_name = files_row.get('file') # unarhive = files_row.get('unarchive') py = pathlib.Path().glob(file_name) for file in py: shutil.copy2(file, target_directory) for subdirs_row in structure.get('subdirs'): process_subdir(subdirs_row, None) command_name += ' -V CDNAME -J -r -o '+image_name+' ' command_name += target_directory print(" Generating Iso image", command_name) os.system(command_name) def isNotValid(file_name): print("ERROR: File:"+file_name+'is not Valid') def create_destination_directory(parent_dir, subdir): target_directory = 'target' # print('Subdirectory:',subdir) # print('Parent:',parent_dir) if(parent_dir is not None): destination = get_dest_dir_name(target_directory, parent_dir) destination = get_dest_dir_name(destination, subdir) else: destination = get_dest_dir_name(target_directory, subdir) mkdir_p(destination) return destination def process_subdir(subdirs_row, parent_dir): subdir = subdirs_row.get('subdir') # print('Subdirectory1:',subdir) # print('Parent1:',parent_dir) destination = create_destination_directory(parent_dir, subdir) # print('destination1:',destination) if "subdirs" in subdirs_row: if(subdirs_row.get('subdirs') is not None): for sub_subdirs_row in subdirs_row.get('subdirs'): # print("Processing subdirs:"+sub_subdirs_row.get('subdir')) process_subdir(sub_subdirs_row, subdir) if 'files' in subdirs_row: for files_row in subdirs_row.get('files'): file_name = files_row.get('file') unarhive = files_row.get('unarchive') # print('Processsing file_name:',file_name) # print('should Unarchive:',unarhive) if unarhive: unarchive_file_to_destination(destination, file_name) else: # print('Copy file to destination') py = pathlib.Path().glob(file_name) for file in py: shutil.copy2(file, destination) def validate_subdir(subdirs_row): # print('Validating',subdirs_row) if "subdirs" in subdirs_row: if(subdirs_row.get('subdirs') is not None): for sub_subdirs_row in subdirs_row.get('subdirs'): # print('Validating',subdirs_row.get('subdirs')) validate_subdir(sub_subdirs_row) if 'files' in subdirs_row: for files_row in subdirs_row.get('files'): file_name = files_row.get('file') # print('Validating',file_name) if not does_file_exists(file_name): print("Does not found file:", file_name) sys.exit(1) def validate_yaml_file(data_loaded): for row in data_loaded.get('packages'): if 'structure' in row: structure = row.get('structure') for files_row in structure.get('files'): if 'file' in files_row: py = pathlib.Path().glob(files_row.get('file')) for file in py: # print('Checking file:',file) if not does_file_exists(str(file)): print("Does not found file:", (str(file))) sys.exit(1) for subdirs_row in structure.get('subdirs'): validate_subdir(subdirs_row) else: print(' The file should have structure element') sys.exit(1) def unarchive_file_to_destination(destination, file_name): print('unarchive the files to destination:', destination) if (does_file_exists(file_name) and zipfile.is_zipfile(file_name)): extract_zip_file(file_name, destination) elif(does_file_exists(file_name) and tarfile.is_tarfile(file_name)): extract_tar_file(file_name, destination) else: isNotValid(file_name) def does_file_exists(name): if os.path.exists(name): return True else: return False def get_dest_dir_name(destination, subdir): return destination+str(os.sep)+subdir def extract_zip_file(file_name, destination): zip_ref = zipfile.ZipFile(file_name, 'r') zip_ref.extractall(destination) zip_ref.close() def extract_tar_file(file_name, destination): with tarfile.open(file_name) as tar: tar.extractall(path=destination) def is_tool(name): """Check whether 'name' is on PATH.""" from distutils.spawn import find_executable return find_executable(name) is not None def mkdir_p(path): try: os.makedirs(path, exist_ok=True) except OSError as exc: # Python >2.5 if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise if __name__ == "__main__": sys.exit(main(sys.argv[1:]))
[ 1, 1053, 343, 8807, 13, 5215, 10876, 13, 5215, 2897, 13, 5215, 2224, 1982, 13, 5215, 14319, 1445, 13, 5215, 528, 4422, 13, 5215, 9913, 1445, 13, 5215, 4589, 1217, 13, 13, 13, 29937, 7523, 612, 23956, 934, 13, 1753, 1667, 29898, 19218, 1125, 13, 1678, 1899, 29918, 978, 353, 525, 11256, 275, 974, 29879, 29915, 13, 1678, 3646, 29918, 12322, 353, 525, 5182, 29915, 13, 13, 1678, 565, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 2804, 29871, 29941, 470, 10876, 29889, 3259, 29918, 3888, 29961, 29896, 29962, 529, 29871, 29953, 29901, 13, 4706, 1596, 703, 4013, 2471, 6858, 5132, 1873, 29871, 29941, 29889, 29953, 29974, 1159, 13, 4706, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 1678, 411, 1722, 29898, 19218, 29961, 29900, 2314, 408, 4840, 29901, 13, 4706, 565, 451, 313, 13221, 29918, 1445, 29918, 9933, 29898, 19218, 29961, 29900, 12622, 29901, 13, 9651, 1596, 877, 6028, 451, 1284, 612, 8807, 3497, 584, 18717, 9675, 29889, 19218, 29961, 29896, 29901, 2314, 13, 9651, 736, 29871, 29896, 13, 4706, 565, 451, 338, 29918, 10154, 29898, 6519, 29918, 978, 1125, 13, 9651, 1596, 877, 6255, 525, 29974, 6519, 29918, 978, 13578, 2216, 7460, 373, 445, 1788, 1159, 13, 9651, 736, 29871, 29896, 13, 4706, 1018, 29901, 13, 9651, 848, 29918, 15638, 353, 343, 8807, 29889, 11177, 29918, 1359, 29898, 5461, 29897, 13, 4706, 5174, 343, 8807, 29889, 29979, 5194, 1307, 24616, 408, 5566, 29901, 13, 9651, 1596, 29898, 735, 29883, 29897, 13, 9651, 736, 29871, 29896, 13, 4706, 396, 1596, 278, 1303, 934, 13, 4706, 1596, 703, 6666, 1127, 10554, 292, 584, 17969, 9675, 29889, 19218, 29961, 29896, 2314, 13, 4706, 396, 12725, 343, 8807, 934, 1434, 9068, 13, 4706, 12725, 29918, 25162, 29918, 1445, 29898, 1272, 29918, 15638, 29897, 13, 4706, 396, 1596, 29898, 1272, 29918, 15638, 29897, 13, 4706, 29356, 29918, 29886, 29898, 5182, 29918, 12322, 29897, 13, 13, 4706, 396, 679, 29918, 10718, 29918, 5113, 29918, 978, 29898, 1272, 29918, 15638, 29892, 8318, 416, 13, 4706, 1967, 29918, 978, 353, 525, 4381, 29889, 10718, 29915, 13, 4706, 396, 1967, 29918, 1853, 353, 525, 10718, 29915, 13, 4706, 3829, 353, 6571, 13, 4706, 363, 1948, 297, 848, 29918, 15638, 29889, 657, 877, 8318, 29374, 13, 9651, 565, 525, 23905, 29915, 297, 1948, 29901, 13, 18884, 396, 1967, 29918, 978, 353, 1948, 29889, 657, 877, 978, 1495, 13, 18884, 396, 1967, 29918, 1853, 353, 1948, 29889, 657, 877, 1853, 1495, 13, 18884, 396, 1596, 877, 2940, 1024, 29901, 742, 1967, 29918, 978, 29897, 13, 18884, 396, 1596, 877, 2940, 1134, 29901, 742, 1967, 29918, 1853, 29897, 13, 18884, 3829, 353, 1948, 29889, 657, 877, 23905, 1495, 13, 18884, 363, 2066, 29918, 798, 297, 3829, 29889, 657, 877, 5325, 29374, 13, 462, 1678, 565, 525, 1445, 29915, 297, 2066, 29918, 798, 29901, 13, 462, 4706, 934, 29918, 978, 353, 2066, 29918, 798, 29889, 657, 877, 1445, 1495, 13, 462, 4706, 396, 443, 279, 29882, 573, 353, 2066, 29918, 798, 29889, 657, 877, 348, 10867, 1495, 13, 462, 4706, 11451, 353, 2224, 1982, 29889, 2605, 2141, 23705, 29898, 1445, 29918, 978, 29897, 13, 462, 4706, 363, 934, 297, 11451, 29901, 13, 462, 9651, 528, 4422, 29889, 8552, 29906, 29898, 1445, 29892, 3646, 29918, 12322, 29897, 13, 18884, 363, 1014, 3972, 29879, 29918, 798, 297, 3829, 29889, 657, 877, 1491, 3972, 29879, 29374, 13, 462, 1678, 1889, 29918, 1491, 3972, 29898, 1491, 3972, 29879, 29918, 798, 29892, 6213, 29897, 13, 4706, 1899, 29918, 978, 4619, 525, 29871, 448, 29963, 7307, 5813, 448, 29967, 448, 29878, 448, 29877, 525, 29974, 3027, 29918, 978, 23097, 525, 13, 4706, 1899, 29918, 978, 4619, 3646, 29918, 12322, 13, 4706, 1596, 703, 3251, 1218, 306, 578, 1967, 613, 1899, 29918, 978, 29897, 13, 4706, 2897, 29889, 5205, 29898, 6519, 29918, 978, 29897, 13, 13, 13, 1753, 338, 3664, 7211, 29898, 1445, 29918, 978, 1125, 13, 1678, 1596, 703, 11432, 29901, 3497, 6160, 29974, 1445, 29918, 978, 23097, 275, 451, 15758, 1495, 13, 13, 13, 1753, 1653, 29918, 23848, 29918, 12322, 29898, 3560, 29918, 3972, 29892, 1014, 3972, 1125, 13, 1678, 3646, 29918, 12322, 353, 525, 5182, 29915, 13, 1678, 396, 1596, 877, 4035, 12322, 29901, 742, 1491, 3972, 29897, 13, 1678, 396, 1596, 877, 9780, 29901, 742, 3560, 29918, 3972, 29897, 13, 1678, 565, 29898, 3560, 29918, 3972, 338, 451, 6213, 1125, 13, 4706, 12551, 353, 679, 29918, 7854, 29918, 3972, 29918, 978, 29898, 5182, 29918, 12322, 29892, 3847, 29918, 3972, 29897, 13, 4706, 12551, 353, 679, 29918, 7854, 29918, 3972, 29918, 978, 29898, 23848, 29892, 1014, 3972, 29897, 13, 1678, 1683, 29901, 13, 4706, 12551, 353, 679, 29918, 7854, 29918, 3972, 29918, 978, 29898, 5182, 29918, 12322, 29892, 1014, 3972, 29897, 13, 1678, 29356, 29918, 29886, 29898, 23848, 29897, 13, 1678, 736, 12551, 13, 13, 13, 1753, 1889, 29918, 1491, 3972, 29898, 1491, 3972, 29879, 29918, 798, 29892, 3847, 29918, 3972, 1125, 13, 1678, 1014, 3972, 353, 1014, 3972, 29879, 29918, 798, 29889, 657, 877, 1491, 3972, 1495, 13, 1678, 396, 1596, 877, 4035, 12322, 29896, 29901, 742, 1491, 3972, 29897, 13, 1678, 396, 1596, 877, 9780, 29896, 29901, 742, 3560, 29918, 3972, 29897, 13, 1678, 12551, 353, 1653, 29918, 23848, 29918, 12322, 29898, 3560, 29918, 3972, 29892, 1014, 3972, 29897, 13, 1678, 396, 1596, 877, 23848, 29896, 29901, 742, 23848, 29897, 13, 1678, 565, 376, 1491, 3972, 29879, 29908, 297, 1014, 3972, 29879, 29918, 798, 29901, 13, 4706, 565, 29898, 1491, 3972, 29879, 29918, 798, 29889, 657, 877, 1491, 3972, 29879, 1495, 338, 451, 6213, 1125, 13, 9651, 363, 1014, 29918, 1491, 3972, 29879, 29918, 798, 297, 1014, 3972, 29879, 29918, 798, 29889, 657, 877, 1491, 3972, 29879, 29374, 13, 18884, 396, 1596, 703, 7032, 292, 1014, 3972, 29879, 6160, 29974, 1491, 29918, 1491, 3972, 29879, 29918, 798, 29889, 657, 877, 1491, 3972, 8785, 13, 18884, 1889, 29918, 1491, 3972, 29898, 1491, 29918, 1491, 3972, 29879, 29918, 798, 29892, 1014, 3972, 29897, 13, 13, 1678, 565, 525, 5325, 29915, 297, 1014, 3972, 29879, 29918, 798, 29901, 13, 4706, 363, 2066, 29918, 798, 297, 1014, 3972, 29879, 29918, 798, 29889, 657, 877, 5325, 29374, 13, 9651, 934, 29918, 978, 353, 2066, 29918, 798, 29889, 657, 877, 1445, 1495, 13, 9651, 443, 279, 29882, 573, 353, 2066, 29918, 798, 29889, 657, 877, 348, 10867, 1495, 13, 9651, 396, 1596, 877, 7032, 2976, 934, 29918, 978, 29901, 742, 1445, 29918, 978, 29897, 13, 9651, 396, 1596, 877, 9344, 853, 10867, 29901, 742, 348, 279, 29882, 573, 29897, 13, 9651, 565, 443, 279, 29882, 573, 29901, 13, 18884, 443, 10867, 29918, 1445, 29918, 517, 29918, 23848, 29898, 23848, 29892, 934, 29918, 978, 29897, 13, 9651, 1683, 29901, 13, 18884, 396, 1596, 877, 11882, 934, 304, 12551, 1495, 13, 18884, 11451, 353, 2224, 1982, 29889, 2605, 2141, 23705, 29898, 1445, 29918, 978, 29897, 13, 18884, 363, 934, 297, 11451, 29901, 13, 462, 1678, 528, 4422, 29889, 8552, 29906, 29898, 1445, 29892, 12551, 29897, 13, 13, 13, 1753, 12725, 29918, 1491, 3972, 29898, 1491, 3972, 29879, 29918, 798, 1125, 13, 1678, 396, 1596, 877, 7211, 1218, 742, 1491, 3972, 29879, 29918, 798, 29897, 13, 1678, 565, 376, 1491, 3972, 29879, 29908, 297, 1014, 3972, 29879, 29918, 798, 29901, 13, 4706, 565, 29898, 1491, 3972, 29879, 29918, 798, 29889, 657, 877, 1491, 3972, 29879, 1495, 338, 451, 6213, 1125, 13, 9651, 363, 1014, 29918, 1491, 3972, 29879, 29918, 798, 297, 1014, 3972, 29879, 29918, 798, 29889, 657, 877, 1491, 3972, 29879, 29374, 13, 18884, 396, 1596, 877, 7211, 1218, 742, 1491, 3972, 29879, 29918, 798, 29889, 657, 877, 1491, 3972, 29879, 8785, 13, 18884, 12725, 29918, 1491, 3972, 29898, 1491, 29918, 1491, 3972, 29879, 29918, 798, 29897, 13, 13, 1678, 565, 525, 5325, 29915, 297, 1014, 3972, 29879, 29918, 798, 29901, 13, 4706, 363, 2066, 29918, 798, 297, 1014, 3972, 29879, 29918, 798, 29889, 657, 877, 5325, 29374, 13, 9651, 934, 29918, 978, 353, 2066, 29918, 798, 29889, 657, 877, 1445, 1495, 13, 9651, 396, 1596, 877, 7211, 1218, 742, 1445, 29918, 978, 29897, 13, 9651, 565, 451, 947, 29918, 1445, 29918, 9933, 29898, 1445, 29918, 978, 1125, 13, 18884, 1596, 703, 25125, 451, 1476, 934, 29901, 613, 934, 29918, 978, 29897, 13, 18884, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 13, 1753, 12725, 29918, 25162, 29918, 1445, 29898, 1272, 29918, 15638, 1125, 13, 1678, 363, 1948, 297, 848, 29918, 15638, 29889, 657, 877, 8318, 29374, 13, 4706, 565, 525, 23905, 29915, 297, 1948, 29901, 13, 9651, 3829, 353, 1948, 29889, 657, 877, 23905, 1495, 13, 9651, 363, 2066, 29918, 798, 297, 3829, 29889, 657, 877, 5325, 29374, 13, 18884, 565, 525, 1445, 29915, 297, 2066, 29918, 798, 29901, 13, 462, 1678, 11451, 353, 2224, 1982, 29889, 2605, 2141, 23705, 29898, 5325, 29918, 798, 29889, 657, 877, 1445, 8785, 13, 462, 1678, 363, 934, 297, 11451, 29901, 13, 462, 4706, 396, 1596, 877, 5596, 292, 934, 29901, 742, 1445, 29897, 13, 462, 4706, 565, 451, 947, 29918, 1445, 29918, 9933, 29898, 710, 29898, 1445, 22164, 13, 462, 9651, 1596, 703, 25125, 451, 1476, 934, 29901, 613, 313, 710, 29898, 1445, 4961, 13, 462, 9651, 10876, 29889, 13322, 29898, 29896, 29897, 13, 18884, 363, 1014, 3972, 29879, 29918, 798, 297, 3829, 29889, 657, 877, 1491, 3972, 29879, 29374, 13, 462, 1678, 12725, 29918, 1491, 3972, 29898, 1491, 3972, 29879, 29918, 798, 29897, 13, 4706, 1683, 29901, 13, 9651, 1596, 877, 450, 934, 881, 505, 3829, 1543, 1495, 13, 9651, 10876, 29889, 13322, 29898, 29896, 29897, 13, 13, 13, 1753, 443, 10867, 29918, 1445, 29918, 517, 29918, 23848, 29898, 23848, 29892, 934, 29918, 978, 1125, 13, 1678, 1596, 877, 348, 10867, 278, 2066, 304, 12551, 29901, 742, 12551, 29897, 13, 1678, 565, 313, 13221, 29918, 1445, 29918, 9933, 29898, 1445, 29918, 978, 29897, 322, 14319, 1445, 29889, 275, 29918, 7554, 1445, 29898, 1445, 29918, 978, 22164, 13, 4706, 6597, 29918, 7554, 29918, 1445, 29898, 1445, 29918, 978, 29892, 12551, 29897, 13, 1678, 25342, 29898, 13221, 29918, 1445, 29918, 9933, 29898, 1445, 29918, 978, 29897, 322, 9913, 1445, 29889, 275, 29918, 12637, 1445, 29898, 1445, 29918, 978, 22164, 13, 4706, 6597, 29918, 12637, 29918, 1445, 29898, 1445, 29918, 978, 29892, 12551, 29897, 13, 1678, 1683, 29901, 13, 4706, 338, 3664, 7211, 29898, 1445, 29918, 978, 29897, 13, 13, 13, 1753, 947, 29918, 1445, 29918, 9933, 29898, 978, 1125, 13, 1678, 565, 2897, 29889, 2084, 29889, 9933, 29898, 978, 1125, 13, 4706, 736, 5852, 13, 1678, 1683, 29901, 13, 4706, 736, 7700, 13, 13, 13, 1753, 679, 29918, 7854, 29918, 3972, 29918, 978, 29898, 23848, 29892, 1014, 3972, 1125, 13, 1678, 736, 12551, 29974, 710, 29898, 359, 29889, 19570, 7240, 1491, 3972, 13, 13, 13, 1753, 6597, 29918, 7554, 29918, 1445, 29898, 1445, 29918, 978, 29892, 12551, 1125, 13, 1678, 14319, 29918, 999, 353, 14319, 1445, 29889, 26264, 2283, 29898, 1445, 29918, 978, 29892, 525, 29878, 1495, 13, 1678, 14319, 29918, 999, 29889, 21111, 497, 29898, 23848, 29897, 13, 1678, 14319, 29918, 999, 29889, 5358, 580, 13, 13, 13, 1753, 6597, 29918, 12637, 29918, 1445, 29898, 1445, 29918, 978, 29892, 12551, 1125, 13, 1678, 411, 9913, 1445, 29889, 3150, 29898, 1445, 29918, 978, 29897, 408, 9913, 29901, 13, 4706, 9913, 29889, 21111, 497, 29898, 2084, 29922, 23848, 29897, 13, 13, 13, 1753, 338, 29918, 10154, 29898, 978, 1125, 13, 1678, 9995, 5596, 3692, 525, 978, 29915, 338, 373, 23611, 1213, 15945, 13, 1678, 515, 1320, 13239, 29889, 1028, 18101, 1053, 1284, 29918, 4258, 9246, 13, 1678, 736, 1284, 29918, 4258, 9246, 29898, 978, 29897, 338, 451, 6213, 13, 13, 13, 1753, 29356, 29918, 29886, 29898, 2084, 1125, 13, 1678, 1018, 29901, 13, 4706, 2897, 29889, 29885, 12535, 12935, 29898, 2084, 29892, 1863, 29918, 554, 29922, 5574, 29897, 13, 1678, 5174, 438, 29173, 408, 5566, 29901, 29871, 396, 5132, 1405, 29906, 29889, 29945, 13, 4706, 565, 5566, 29889, 3127, 1217, 1275, 4589, 1217, 29889, 29923, 5746, 9047, 322, 2897, 29889, 2084, 29889, 275, 3972, 29898, 2084, 1125, 13, 9651, 1209, 13, 4706, 1683, 29901, 13, 9651, 12020, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 1678, 10876, 29889, 13322, 29898, 3396, 29898, 9675, 29889, 19218, 29961, 29896, 29901, 12622, 13, 2 ]
test.py
dharshini-raman/SeniorYear
0
160824
<reponame>dharshini-raman/SeniorYear<gh_stars>0 # Importing libraries import pandas as pd import numpy as np import math import operator import matplotlib.pyplot as plt from sklearn import datasets, neighbors from mlxtend.plotting import plot_decision_regions #### Start of STEP 1 # Importing data data = pd.read_csv('artists1.csv') #Normalization #cols_to_norm = ['years', 'genre', 'nationality'] #data[cols_to_norm] = data[cols_to_norm].apply(lambda x: (x - x.min()) / (x.max()-x.min()) ) print(data.head(5)) # Defining a function which calculates euclidean distance between two data points def euclideanDistance(data1, data2, length): distance = 0 distance += np.square(data1[0] - data2[0]) distance += np.square(data1[1] - data2[1]) distance += (0.5*(np.square(data1[2] - data2[2]))) return np.sqrt(distance) # Defining a function which calculates manhattan distance between two data points def manhattanDistance(data1, data2, length): distance = 0 for x in range(length): distance += np.abs((data1[x] - data2[x])) return (distance) def L3(data1, data2, length): distance = 0 for x in range(length): distance += np.square((data1[x] - data2[x])) * (data1[x] - data2[x]) return (distance**(1/3)) # Defining our KNN model def knn(trainingSet, testInstance, k): distances = {} sort = {} length = testInstance.shape[1] #### Start of STEP 3 # Calculating euclidean distance between each row of training data and test data for x in range(len(trainingSet)): #### Start of STEP 3.1 dist = euclideanDistance(testInstance, trainingSet.iloc[x], length) distances[x] = dist[0] #### End of STEP 3.1 #### Start of STEP 3.2 # Sorting them on the basis of distance sorted_d = sorted(distances.items(), key=operator.itemgetter(1)) #### End of STEP 3.2 neighbors = [] #### Start of STEP 3.3 # Extracting top k neighbors for x in range(k): neighbors.append(sorted_d[x][0]) #### End of STEP 3.3 classVotes = {} #### Start of STEP 3.4 # Calculating the most freq class in the neighbors for x in range(len(neighbors)): response = trainingSet.iloc[neighbors[x]][-1] if response in classVotes: classVotes[response] += 1 else: classVotes[response] = 1 #### End of STEP 3.4 #### Start of STEP 3.5 sortedVotes = sorted(classVotes.items(), key=operator.itemgetter(1), reverse=True) return(sortedVotes[0][0], neighbors) #### End of STEP 3.5 testSet = [[1798, 3, 9]] test = pd.DataFrame(testSet) #### Start of STEP 2 # Setting number of neighbors = 1 print('\n\nWith 1 Nearest Neighbour \n\n') k = 1 #### End of STEP 2 # Running KNN model result,neigh = knn(data, test, k) # Predicted class print('\nPredicted Class of the datapoint = ', result) # Nearest neighbor print('\nNearest Neighbour of the datapoints = ',neigh) print('\n\nWith 3 Nearest Neighbours\n\n') # Setting number of neighbors = 3 k = 3 # Running KNN model result,neigh = knn(data, test, k) # Predicted class print('\nPredicted class of the datapoint = ',result) # Nearest neighbor print('\nNearest Neighbours of the datapoints = ',neigh) print('\n\nWith 5 Nearest Neighbours\n\n') # Setting number of neighbors = 3 k = 5 # Running KNN model result,neigh = knn(data, test, k) # Predicted class print('\nPredicted class of the datapoint = ',result) # Nearest neighbor print('\nNearest Neighbours of the datapoints = ',neigh)
[ 1, 529, 276, 1112, 420, 29958, 29881, 8222, 845, 2172, 29899, 2572, 273, 29914, 29903, 264, 1611, 12883, 29966, 12443, 29918, 303, 1503, 29958, 29900, 13, 30004, 13, 29937, 16032, 292, 9562, 30004, 13, 5215, 11701, 408, 10518, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 5215, 5844, 30004, 13, 5215, 5455, 30004, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 30004, 13, 3166, 2071, 19668, 1053, 20035, 29892, 22092, 943, 30004, 13, 3166, 286, 29880, 486, 355, 29889, 5317, 1259, 1053, 6492, 29918, 7099, 2459, 29918, 1727, 1080, 30004, 13, 30004, 13, 4136, 7370, 310, 317, 4330, 29925, 29871, 29896, 30004, 13, 29937, 16032, 292, 848, 6756, 13, 1272, 353, 10518, 29889, 949, 29918, 7638, 877, 442, 2879, 29896, 29889, 7638, 1495, 30004, 13, 29937, 19077, 2133, 30004, 13, 29937, 22724, 29918, 517, 29918, 12324, 353, 6024, 6360, 29879, 742, 525, 1885, 276, 742, 525, 29876, 1288, 537, 2033, 30004, 13, 29937, 1272, 29961, 22724, 29918, 517, 29918, 12324, 29962, 353, 848, 29961, 22724, 29918, 517, 29918, 12324, 1822, 7302, 29898, 2892, 921, 29901, 313, 29916, 448, 921, 29889, 1195, 3101, 847, 313, 29916, 29889, 3317, 580, 29899, 29916, 29889, 1195, 3101, 1723, 30004, 13, 2158, 29898, 1272, 29889, 2813, 29898, 29945, 876, 6756, 13, 30004, 13, 29937, 5282, 2827, 263, 740, 607, 3408, 1078, 321, 27511, 5418, 1546, 1023, 848, 3291, 30004, 13, 1753, 321, 27511, 27469, 29898, 1272, 29896, 29892, 848, 29906, 29892, 3309, 1125, 30004, 13, 1678, 5418, 353, 29871, 29900, 30004, 13, 1678, 5418, 4619, 7442, 29889, 17619, 29898, 1272, 29896, 29961, 29900, 29962, 448, 848, 29906, 29961, 29900, 2314, 30004, 13, 1678, 5418, 4619, 7442, 29889, 17619, 29898, 1272, 29896, 29961, 29896, 29962, 448, 848, 29906, 29961, 29896, 2314, 30004, 13, 1678, 5418, 4619, 313, 29900, 29889, 29945, 16395, 9302, 29889, 17619, 29898, 1272, 29896, 29961, 29906, 29962, 448, 848, 29906, 29961, 29906, 29962, 4961, 30004, 13, 1678, 736, 7442, 29889, 3676, 29898, 19244, 8443, 13, 30004, 13, 29937, 5282, 2827, 263, 740, 607, 3408, 1078, 767, 29882, 23586, 5418, 1546, 1023, 848, 3291, 30004, 13, 1753, 767, 29882, 23586, 27469, 29898, 1272, 29896, 29892, 848, 29906, 29892, 3309, 1125, 30004, 13, 1678, 5418, 353, 29871, 29900, 30004, 13, 1678, 363, 921, 297, 3464, 29898, 2848, 1125, 30004, 13, 4706, 5418, 4619, 7442, 29889, 6897, 3552, 1272, 29896, 29961, 29916, 29962, 448, 848, 29906, 29961, 29916, 12622, 30004, 13, 1678, 736, 313, 19244, 8443, 13, 30004, 13, 1753, 365, 29941, 29898, 1272, 29896, 29892, 848, 29906, 29892, 3309, 1125, 30004, 13, 1678, 5418, 353, 29871, 29900, 30004, 13, 1678, 363, 921, 297, 3464, 29898, 2848, 1125, 30004, 13, 4706, 5418, 4619, 7442, 29889, 17619, 3552, 1272, 29896, 29961, 29916, 29962, 448, 848, 29906, 29961, 29916, 12622, 334, 313, 1272, 29896, 29961, 29916, 29962, 448, 848, 29906, 29961, 29916, 2314, 6756, 13, 1678, 736, 313, 19244, 1068, 29898, 29896, 29914, 29941, 876, 30004, 13, 30004, 13, 29937, 5282, 2827, 1749, 476, 10262, 1904, 30004, 13, 1753, 889, 29876, 29898, 26495, 2697, 29892, 1243, 4998, 29892, 413, 1125, 30004, 13, 6756, 13, 1678, 24610, 353, 6571, 30004, 13, 1678, 2656, 353, 6571, 30004, 13, 6756, 13, 1678, 3309, 353, 1243, 4998, 29889, 12181, 29961, 29896, 29962, 30004, 13, 1678, 6756, 13, 1678, 3191, 7370, 310, 317, 4330, 29925, 29871, 29941, 30004, 13, 1678, 396, 20535, 1218, 321, 27511, 5418, 1546, 1269, 1948, 310, 6694, 848, 322, 1243, 848, 30004, 13, 1678, 363, 921, 297, 3464, 29898, 2435, 29898, 26495, 2697, 22164, 30004, 13, 4706, 6756, 13, 4706, 3191, 7370, 310, 317, 4330, 29925, 29871, 29941, 29889, 29896, 30004, 13, 4706, 1320, 353, 321, 27511, 27469, 29898, 1688, 4998, 29892, 6694, 2697, 29889, 309, 542, 29961, 29916, 1402, 3309, 8443, 13, 30004, 13, 4706, 24610, 29961, 29916, 29962, 353, 1320, 29961, 29900, 29962, 30004, 13, 4706, 3191, 2796, 310, 317, 4330, 29925, 29871, 29941, 29889, 29896, 30004, 13, 6756, 13, 1678, 3191, 7370, 310, 317, 4330, 29925, 29871, 29941, 29889, 29906, 30004, 13, 1678, 396, 20025, 292, 963, 373, 278, 8405, 310, 5418, 30004, 13, 1678, 12705, 29918, 29881, 353, 12705, 29898, 5721, 2925, 29889, 7076, 3285, 1820, 29922, 6891, 29889, 667, 657, 357, 29898, 29896, 876, 30004, 13, 1678, 3191, 2796, 310, 317, 4330, 29925, 29871, 29941, 29889, 29906, 30004, 13, 6756, 13, 1678, 22092, 943, 353, 5159, 30004, 13, 1678, 6756, 13, 1678, 3191, 7370, 310, 317, 4330, 29925, 29871, 29941, 29889, 29941, 30004, 13, 1678, 396, 7338, 1461, 292, 2246, 413, 22092, 943, 30004, 13, 1678, 363, 921, 297, 3464, 29898, 29895, 1125, 30004, 13, 4706, 22092, 943, 29889, 4397, 29898, 24582, 29918, 29881, 29961, 29916, 3816, 29900, 2314, 30004, 13, 1678, 3191, 2796, 310, 317, 4330, 29925, 29871, 29941, 29889, 29941, 30004, 13, 1678, 770, 29963, 4769, 353, 6571, 30004, 13, 1678, 6756, 13, 1678, 3191, 7370, 310, 317, 4330, 29925, 29871, 29941, 29889, 29946, 30004, 13, 1678, 396, 20535, 1218, 278, 1556, 3005, 29939, 770, 297, 278, 22092, 943, 30004, 13, 1678, 363, 921, 297, 3464, 29898, 2435, 29898, 484, 1141, 29890, 943, 22164, 30004, 13, 4706, 2933, 353, 6694, 2697, 29889, 309, 542, 29961, 484, 1141, 29890, 943, 29961, 29916, 29962, 3816, 29899, 29896, 29962, 30004, 13, 6756, 13, 4706, 565, 2933, 297, 770, 29963, 4769, 29901, 30004, 13, 9651, 770, 29963, 4769, 29961, 5327, 29962, 4619, 29871, 29896, 30004, 13, 4706, 1683, 29901, 30004, 13, 9651, 770, 29963, 4769, 29961, 5327, 29962, 353, 29871, 29896, 30004, 13, 1678, 3191, 2796, 310, 317, 4330, 29925, 29871, 29941, 29889, 29946, 30004, 13, 30004, 13, 1678, 3191, 7370, 310, 317, 4330, 29925, 29871, 29941, 29889, 29945, 30004, 13, 1678, 12705, 29963, 4769, 353, 12705, 29898, 1990, 29963, 4769, 29889, 7076, 3285, 1820, 29922, 6891, 29889, 667, 657, 357, 29898, 29896, 511, 11837, 29922, 5574, 8443, 13, 1678, 736, 29898, 24582, 29963, 4769, 29961, 29900, 3816, 29900, 1402, 22092, 943, 8443, 13, 1678, 3191, 2796, 310, 317, 4330, 29925, 29871, 29941, 29889, 29945, 30004, 13, 30004, 13, 30004, 13, 1688, 2697, 353, 5519, 29896, 29955, 29929, 29947, 29892, 29871, 29941, 29892, 29871, 29929, 5262, 30004, 13, 1688, 353, 10518, 29889, 17271, 29898, 1688, 2697, 8443, 13, 30004, 13, 30004, 13, 4136, 7370, 310, 317, 4330, 29925, 29871, 29906, 30004, 13, 29937, 21605, 1353, 310, 22092, 943, 353, 29871, 29896, 30004, 13, 30004, 13, 30004, 13, 2158, 28909, 29876, 29905, 29876, 3047, 29871, 29896, 26206, 342, 2448, 1141, 6526, 320, 29876, 29905, 29876, 1495, 30004, 13, 29895, 353, 29871, 29896, 30004, 13, 4136, 2796, 310, 317, 4330, 29925, 29871, 29906, 30004, 13, 29937, 19509, 476, 10262, 1904, 30004, 13, 2914, 29892, 484, 1141, 353, 889, 29876, 29898, 1272, 29892, 1243, 29892, 413, 8443, 13, 30004, 13, 29937, 21099, 18186, 770, 30004, 13, 2158, 28909, 29876, 23084, 18186, 4134, 310, 278, 1418, 481, 2461, 353, 13420, 1121, 8443, 13, 30004, 13, 29937, 26206, 342, 12307, 30004, 13, 2158, 28909, 29876, 29940, 799, 342, 2448, 1141, 6526, 310, 278, 1418, 481, 2461, 29879, 353, 13420, 484, 1141, 8443, 13, 30004, 13, 30004, 13, 2158, 28909, 29876, 29905, 29876, 3047, 29871, 29941, 26206, 342, 2448, 1141, 29890, 2470, 29905, 29876, 29905, 29876, 1495, 30004, 13, 29937, 21605, 1353, 310, 22092, 943, 353, 29871, 29941, 6756, 13, 29895, 353, 29871, 29941, 6756, 13, 29937, 19509, 476, 10262, 1904, 6756, 13, 2914, 29892, 484, 1141, 353, 889, 29876, 29898, 1272, 29892, 1243, 29892, 413, 29897, 6756, 13, 30004, 13, 29937, 21099, 18186, 770, 6756, 13, 2158, 28909, 29876, 23084, 18186, 770, 310, 278, 1418, 481, 2461, 353, 13420, 2914, 8443, 13, 30004, 13, 29937, 26206, 342, 12307, 30004, 13, 2158, 28909, 29876, 29940, 799, 342, 2448, 1141, 29890, 2470, 310, 278, 1418, 481, 2461, 29879, 353, 13420, 484, 1141, 8443, 13, 30004, 13, 2158, 28909, 29876, 29905, 29876, 3047, 29871, 29945, 26206, 342, 2448, 1141, 29890, 2470, 29905, 29876, 29905, 29876, 1495, 30004, 13, 29937, 21605, 1353, 310, 22092, 943, 353, 29871, 29941, 6756, 13, 29895, 353, 29871, 29945, 30004, 13, 29937, 19509, 476, 10262, 1904, 6756, 13, 2914, 29892, 484, 1141, 353, 889, 29876, 29898, 1272, 29892, 1243, 29892, 413, 29897, 6756, 13, 30004, 13, 29937, 21099, 18186, 770, 6756, 13, 2158, 28909, 29876, 23084, 18186, 770, 310, 278, 1418, 481, 2461, 353, 13420, 2914, 8443, 13, 30004, 13, 29937, 26206, 342, 12307, 30004, 13, 2158, 28909, 29876, 29940, 799, 342, 2448, 1141, 29890, 2470, 310, 278, 1418, 481, 2461, 29879, 353, 13420, 484, 1141, 8443, 13, 30004, 13, 2 ]
linkedList/143 reorder list.py
windowssocket/py_leetcode
3
86874
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def reorderList(self, head): """ :type head: ListNode :rtype: void Do not return anything, modify head in-place instead. """ # 起码需要两个点 if head == None or head.next == None: return slow, fast = head, head while fast.next != None and fast.next.next != None: fast = fast.next.next slow = slow.next # 1->2->3->4->5 # low = 3 # 1->2->3->4->5->6 # low = 3 # 1->2->3->6->5->4 prevMiddle = slow prevCurrent = prevMiddle.next while prevCurrent.next != None: current = prevCurrent.next prevCurrent.next = current.next current.next = prevMiddle.next prevMiddle.next = current # 1->6->2->5->3->4 p1 = head p2 = prevMiddle.next # 跳出条件 while p1 != prevMiddle: prevMiddle.next = p2.next p2.next = p1.next p1.next = p2 p1 = p2.next p2 = prevMiddle.next
[ 1, 396, 21940, 363, 1809, 368, 29899, 2324, 287, 1051, 29889, 13, 29937, 770, 2391, 4247, 29898, 3318, 1125, 13, 29937, 268, 822, 4770, 2344, 12035, 1311, 29892, 921, 1125, 13, 29937, 308, 1583, 29889, 791, 353, 921, 13, 29937, 308, 1583, 29889, 4622, 353, 6213, 13, 13, 1990, 24380, 29898, 3318, 1125, 13, 1678, 822, 337, 2098, 1293, 29898, 1311, 29892, 2343, 1125, 13, 4706, 9995, 13, 4706, 584, 1853, 2343, 29901, 2391, 4247, 13, 4706, 584, 29878, 1853, 29901, 1780, 1938, 451, 736, 3099, 29892, 6623, 2343, 297, 29899, 6689, 2012, 29889, 13, 4706, 9995, 13, 4706, 396, 29871, 31558, 31183, 31383, 30698, 31977, 30502, 30940, 13, 4706, 565, 2343, 1275, 6213, 470, 2343, 29889, 4622, 1275, 6213, 29901, 13, 9651, 736, 13, 4706, 5232, 29892, 5172, 353, 2343, 29892, 2343, 13, 4706, 1550, 5172, 29889, 4622, 2804, 6213, 322, 5172, 29889, 4622, 29889, 4622, 2804, 6213, 29901, 13, 9651, 5172, 353, 5172, 29889, 4622, 29889, 4622, 13, 9651, 5232, 353, 5232, 29889, 4622, 13, 4706, 396, 29871, 29896, 976, 29906, 976, 29941, 976, 29946, 976, 29945, 13, 4706, 396, 4482, 353, 29871, 29941, 13, 4706, 396, 29871, 29896, 976, 29906, 976, 29941, 976, 29946, 976, 29945, 976, 29953, 13, 4706, 396, 4482, 353, 29871, 29941, 13, 13, 4706, 396, 29871, 29896, 976, 29906, 976, 29941, 976, 29953, 976, 29945, 976, 29946, 13, 4706, 12379, 25411, 353, 5232, 13, 4706, 12379, 7583, 353, 12379, 25411, 29889, 4622, 13, 4706, 1550, 12379, 7583, 29889, 4622, 2804, 6213, 29901, 13, 9651, 1857, 353, 12379, 7583, 29889, 4622, 13, 9651, 12379, 7583, 29889, 4622, 353, 1857, 29889, 4622, 13, 9651, 1857, 29889, 4622, 353, 12379, 25411, 29889, 4622, 13, 9651, 12379, 25411, 29889, 4622, 353, 1857, 13, 13, 4706, 396, 29871, 29896, 976, 29953, 976, 29906, 976, 29945, 976, 29941, 976, 29946, 13, 4706, 282, 29896, 353, 2343, 13, 4706, 282, 29906, 353, 12379, 25411, 29889, 4622, 13, 4706, 396, 29871, 235, 186, 182, 30544, 31217, 30631, 13, 4706, 1550, 282, 29896, 2804, 12379, 25411, 29901, 13, 9651, 12379, 25411, 29889, 4622, 353, 282, 29906, 29889, 4622, 13, 9651, 282, 29906, 29889, 4622, 353, 282, 29896, 29889, 4622, 13, 9651, 282, 29896, 29889, 4622, 353, 282, 29906, 13, 9651, 282, 29896, 353, 282, 29906, 29889, 4622, 13, 9651, 282, 29906, 353, 12379, 25411, 29889, 4622, 13, 2 ]
tests/google/conftest.py
UUUM/backup-google-drive
6
1617352
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import pytest import gdsync from gdsync.google.drive import Drive TEST_FOLDER_NAME = 'gdsync-test' @pytest.fixture() def delete_db_file(request, sqlite_file): def fin(): if os.path.isfile(sqlite_file): os.unlink(sqlite_file) request.addfinalizer(fin) fin() @pytest.fixture() def sqlite_file(request): return os.path.join(gdsync.VAR_DIR, 'test.db') @pytest.fixture(scope='session') def test_folder(request): def fin(): res.delete() request.addfinalizer(fin) res = Drive().create_folder(TEST_FOLDER_NAME) return res @pytest.fixture(scope='session') def dest_folder(request, test_folder): def fin(): res.delete() request.addfinalizer(fin) res = test_folder.create_folder('バックアップ先') return res @pytest.fixture(scope='session') def src_folder(request, test_folder): def fin(): res.delete() request.addfinalizer(fin) res = test_folder.create_folder('バックアップ元') sub_folder = res.create_folder('フォルダ') sub_folder.create('テストsub', content='test') return res @pytest.fixture(scope='session') def src_file(request, src_folder): def fin(): for file in files: file.delete() request.addfinalizer(fin) files = [] files.append(src_folder.create('テスト', content='test')) files.append(src_folder.create('テスト', content='foo,bar', mime_type='text/csv')) return files[0]
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 5215, 2897, 13, 13, 5215, 11451, 1688, 13, 13, 5215, 330, 6289, 2720, 13, 3166, 330, 6289, 2720, 29889, 3608, 29889, 21594, 1053, 22850, 13, 13, 18267, 29918, 29943, 5607, 8032, 29918, 5813, 353, 525, 29887, 6289, 2720, 29899, 1688, 29915, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 580, 13, 1753, 5217, 29918, 2585, 29918, 1445, 29898, 3827, 29892, 21120, 29918, 1445, 1125, 13, 1678, 822, 1436, 7295, 13, 4706, 565, 2897, 29889, 2084, 29889, 275, 1445, 29898, 22793, 29918, 1445, 1125, 13, 9651, 2897, 29889, 348, 2324, 29898, 22793, 29918, 1445, 29897, 13, 1678, 2009, 29889, 1202, 8394, 3950, 29898, 4951, 29897, 13, 1678, 1436, 580, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 580, 13, 1753, 21120, 29918, 1445, 29898, 3827, 1125, 13, 1678, 736, 2897, 29889, 2084, 29889, 7122, 29898, 29887, 6289, 2720, 29889, 26865, 29918, 9464, 29892, 525, 1688, 29889, 2585, 1495, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 29898, 6078, 2433, 7924, 1495, 13, 1753, 1243, 29918, 12083, 29898, 3827, 1125, 13, 1678, 822, 1436, 7295, 13, 4706, 620, 29889, 8143, 580, 13, 1678, 2009, 29889, 1202, 8394, 3950, 29898, 4951, 29897, 13, 13, 1678, 620, 353, 22850, 2141, 3258, 29918, 12083, 29898, 18267, 29918, 29943, 5607, 8032, 29918, 5813, 29897, 13, 1678, 736, 620, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 29898, 6078, 2433, 7924, 1495, 13, 1753, 2731, 29918, 12083, 29898, 3827, 29892, 1243, 29918, 12083, 1125, 13, 1678, 822, 1436, 7295, 13, 4706, 620, 29889, 8143, 580, 13, 1678, 2009, 29889, 1202, 8394, 3950, 29898, 4951, 29897, 13, 13, 1678, 620, 353, 1243, 29918, 12083, 29889, 3258, 29918, 12083, 877, 30517, 30317, 30305, 30310, 30317, 30605, 31244, 1495, 13, 1678, 736, 620, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 29898, 6078, 2433, 7924, 1495, 13, 1753, 4765, 29918, 12083, 29898, 3827, 29892, 1243, 29918, 12083, 1125, 13, 1678, 822, 1436, 7295, 13, 4706, 620, 29889, 8143, 580, 13, 1678, 2009, 29889, 1202, 8394, 3950, 29898, 4951, 29897, 13, 13, 1678, 620, 353, 1243, 29918, 12083, 29889, 3258, 29918, 12083, 877, 30517, 30317, 30305, 30310, 30317, 30605, 30824, 1495, 13, 1678, 1014, 29918, 12083, 353, 620, 29889, 3258, 29918, 12083, 877, 30423, 31402, 30258, 30617, 1495, 13, 1678, 1014, 29918, 12083, 29889, 3258, 877, 30572, 30255, 30279, 1491, 742, 2793, 2433, 1688, 1495, 13, 1678, 736, 620, 13, 13, 13, 29992, 2272, 1688, 29889, 7241, 15546, 29898, 6078, 2433, 7924, 1495, 13, 1753, 4765, 29918, 1445, 29898, 3827, 29892, 4765, 29918, 12083, 1125, 13, 1678, 822, 1436, 7295, 13, 4706, 363, 934, 297, 2066, 29901, 13, 9651, 934, 29889, 8143, 580, 13, 1678, 2009, 29889, 1202, 8394, 3950, 29898, 4951, 29897, 13, 13, 1678, 2066, 353, 5159, 13, 1678, 2066, 29889, 4397, 29898, 4351, 29918, 12083, 29889, 3258, 877, 30572, 30255, 30279, 742, 2793, 2433, 1688, 8785, 13, 1678, 2066, 29889, 4397, 29898, 4351, 29918, 12083, 29889, 3258, 877, 30572, 30255, 30279, 742, 2793, 2433, 5431, 29892, 1646, 742, 286, 603, 29918, 1853, 2433, 726, 29914, 7638, 8785, 13, 1678, 736, 2066, 29961, 29900, 29962, 13, 2 ]
uzbplaces/urls.py
heykarimoff/uzbplaces
2
188414
from django.conf.urls import url from apps.address import views urlpatterns = [ url(r'^provinces/$', views.ProvinceList.as_view(), name='provinces'), url(r'^regions/(?P<province>[0-9]+)/$', views.RegionList.as_view(), name='province_regions'), url(r'^regions/(?P<province>[0-9]+)/(?P<code>[0-9]+)/$', views.RegionDetail.as_view(), name='region_detail'), ]
[ 1, 515, 9557, 29889, 5527, 29889, 26045, 1053, 3142, 13, 13, 3166, 11446, 29889, 7328, 1053, 8386, 13, 13, 2271, 11037, 29879, 353, 518, 13, 1678, 3142, 29898, 29878, 29915, 29985, 771, 3845, 778, 13346, 742, 8386, 29889, 1184, 29894, 1239, 1293, 29889, 294, 29918, 1493, 3285, 1024, 2433, 771, 3845, 778, 5477, 13, 1678, 3142, 29898, 29878, 29915, 29985, 1727, 1080, 29914, 10780, 29925, 29966, 16123, 1239, 24566, 29900, 29899, 29929, 10062, 6802, 29938, 742, 8386, 29889, 18457, 1293, 29889, 294, 29918, 1493, 3285, 1024, 2433, 16123, 1239, 29918, 1727, 1080, 5477, 13, 1678, 3142, 29898, 29878, 29915, 29985, 1727, 1080, 29914, 10780, 29925, 29966, 16123, 1239, 24566, 29900, 29899, 29929, 10062, 6802, 10780, 29925, 29966, 401, 24566, 29900, 29899, 29929, 10062, 6802, 29938, 742, 8386, 29889, 18457, 16570, 29889, 294, 29918, 1493, 3285, 1024, 2433, 12803, 29918, 16432, 5477, 13, 13, 29962, 13, 2 ]
old_stuff/serial_game/mb_control.py
jrmhaig/microbit_playground
1
69512
<gh_stars>1-10 import microbit key_delay = 100 acc = microbit.accelerometer a = microbit.button_a b = microbit.button_b img = microbit.display.image while True: microbit.display.clear() x = acc.get_x() y = acc.get_y() if x > 300: print('r') img.set_pixel_value(4, 2, 1) elif x < -300: print('l') img.set_pixel_value(0, 2, 1) if y > 300: print('d') img.set_pixel_value(2, 4, 1) elif y < -300: print('u') img.set_pixel_value(2, 0, 1) if a.is_pressed(): print('a') img.set_pixel_value(1, 2, 1) if b.is_pressed(): print('b') img.set_pixel_value(3, 2, 1) microbit.sleep(key_delay)
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 5215, 9200, 2966, 13, 13, 1989, 29918, 18829, 353, 29871, 29896, 29900, 29900, 13, 5753, 353, 9200, 2966, 29889, 562, 2242, 261, 8328, 13, 29874, 353, 9200, 2966, 29889, 3092, 29918, 29874, 13, 29890, 353, 9200, 2966, 29889, 3092, 29918, 29890, 13, 2492, 353, 9200, 2966, 29889, 4990, 29889, 3027, 13, 13, 8000, 5852, 29901, 13, 1678, 9200, 2966, 29889, 4990, 29889, 8551, 580, 13, 1678, 921, 353, 1035, 29889, 657, 29918, 29916, 580, 13, 1678, 343, 353, 1035, 29889, 657, 29918, 29891, 580, 13, 1678, 565, 921, 1405, 29871, 29941, 29900, 29900, 29901, 13, 4706, 1596, 877, 29878, 1495, 13, 4706, 10153, 29889, 842, 29918, 29886, 15711, 29918, 1767, 29898, 29946, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 1678, 25342, 921, 529, 448, 29941, 29900, 29900, 29901, 13, 4706, 1596, 877, 29880, 1495, 13, 4706, 10153, 29889, 842, 29918, 29886, 15711, 29918, 1767, 29898, 29900, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 13, 1678, 565, 343, 1405, 29871, 29941, 29900, 29900, 29901, 13, 4706, 1596, 877, 29881, 1495, 13, 4706, 10153, 29889, 842, 29918, 29886, 15711, 29918, 1767, 29898, 29906, 29892, 29871, 29946, 29892, 29871, 29896, 29897, 13, 1678, 25342, 343, 529, 448, 29941, 29900, 29900, 29901, 13, 4706, 1596, 877, 29884, 1495, 13, 4706, 10153, 29889, 842, 29918, 29886, 15711, 29918, 1767, 29898, 29906, 29892, 29871, 29900, 29892, 29871, 29896, 29897, 13, 13, 1678, 565, 263, 29889, 275, 29918, 13120, 7295, 13, 4706, 1596, 877, 29874, 1495, 13, 4706, 10153, 29889, 842, 29918, 29886, 15711, 29918, 1767, 29898, 29896, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 13, 1678, 565, 289, 29889, 275, 29918, 13120, 7295, 13, 4706, 1596, 877, 29890, 1495, 13, 4706, 10153, 29889, 842, 29918, 29886, 15711, 29918, 1767, 29898, 29941, 29892, 29871, 29906, 29892, 29871, 29896, 29897, 13, 13, 1678, 9200, 2966, 29889, 17059, 29898, 1989, 29918, 18829, 29897, 13, 2 ]
_singleActions-AsScripts/02_LoadPhotosInNewChunk.py
campbell-ja/MetashapePythonScripts
4
118196
<reponame>campbell-ja/MetashapePythonScripts # This script created by <NAME> - 03/2021 """ Set up Working Environment """ # import Metashape library module import Metashape # create a reference to the current project via Document Class doc = Metashape.app.document """ Prompt User to Select Images """ # create array/list of images via user input gui images = Metashape.app.getOpenFileNames() """ Create New Chunk and Rename It """ # create new chunk to avoid changing any currently existing chunks newChunk = doc.addChunk() # set new chunk as active chunk Metashape.app.document.chunk = newChunk # set a new reference for the new chunk activeChunk = newChunk """Rename the New Active Chunk""" # get full list of chunks chunkList = doc.chunks # rename the new chunk,but only if it exists # also add the integer position in chunks list # this ensures each time the script runs each chunk has a unique name. if activeChunk in chunkList: activeChunk.label = 'pyChunk_' + str(len(chunkList)-1) """ Add User Selected Photos to Active Chunk""" # add images to chunk from array/list created earlier activeChunk.addPhotos(images)
[ 1, 529, 276, 1112, 420, 29958, 24821, 12562, 29899, 1764, 29914, 10095, 1161, 4085, 11980, 4081, 29879, 13, 29937, 910, 2471, 2825, 491, 529, 5813, 29958, 448, 29871, 29900, 29941, 29914, 29906, 29900, 29906, 29896, 30004, 13, 30004, 13, 15945, 29908, 3789, 701, 24176, 16738, 9995, 30004, 13, 29937, 1053, 4737, 1161, 4085, 3489, 3883, 30004, 13, 5215, 4737, 1161, 4085, 30004, 13, 29937, 1653, 263, 3407, 304, 278, 1857, 2060, 3025, 10854, 4134, 30004, 13, 1514, 353, 4737, 1161, 4085, 29889, 932, 29889, 3225, 30004, 13, 30004, 13, 15945, 29908, 9705, 415, 4911, 304, 7605, 1954, 1179, 9995, 30004, 13, 29937, 1653, 1409, 29914, 1761, 310, 4558, 3025, 1404, 1881, 1410, 29875, 30004, 13, 8346, 353, 4737, 1161, 4085, 29889, 932, 29889, 657, 6585, 2283, 8659, 26471, 13, 30004, 13, 15945, 29908, 6204, 1570, 678, 2960, 322, 390, 3871, 739, 9995, 30004, 13, 29937, 1653, 716, 19875, 304, 4772, 6480, 738, 5279, 5923, 521, 18801, 30004, 13, 1482, 1451, 2960, 353, 1574, 29889, 1202, 1451, 2960, 26471, 13, 29937, 731, 716, 19875, 408, 6136, 19875, 30004, 13, 10095, 1161, 4085, 29889, 932, 29889, 3225, 29889, 29812, 353, 716, 1451, 2960, 30004, 13, 29937, 731, 263, 716, 3407, 363, 278, 716, 19875, 30004, 13, 4925, 1451, 2960, 353, 716, 1451, 2960, 30004, 13, 30004, 13, 15945, 29908, 29934, 3871, 278, 1570, 10731, 678, 2960, 15945, 19451, 13, 29937, 679, 2989, 1051, 310, 521, 18801, 30004, 13, 29812, 1293, 353, 1574, 29889, 305, 18801, 30004, 13, 29937, 19508, 278, 716, 19875, 29892, 4187, 871, 565, 372, 4864, 30004, 13, 29937, 884, 788, 278, 6043, 2602, 297, 521, 18801, 1051, 30004, 13, 29937, 445, 5662, 1973, 1269, 931, 278, 2471, 6057, 1269, 19875, 756, 263, 5412, 1024, 22993, 13, 361, 6136, 1451, 2960, 297, 19875, 1293, 29901, 30004, 13, 1678, 6136, 1451, 2960, 29889, 1643, 353, 525, 2272, 1451, 2960, 29918, 29915, 718, 851, 29898, 2435, 29898, 29812, 1293, 6817, 29896, 8443, 13, 30004, 13, 15945, 29908, 3462, 4911, 22012, 1963, 15788, 304, 10731, 678, 2960, 15945, 19451, 13, 29937, 788, 4558, 304, 19875, 515, 1409, 29914, 1761, 2825, 8859, 30004, 13, 4925, 1451, 2960, 29889, 1202, 4819, 15788, 29898, 8346, 8443, 13, 30004, 13, 30004, 13, 30004, 13, 2 ]
r-net.py
gypleon/SQuAD
0
53558
import tensorflow as tf import numpy as np from word_embedding import WORD_EMBEDDING as WE class R_NET(object): ''' refer to R-NET: Machine Reading Comprehension with Self-matching Networks Natural Language Computing Group, Microsoft Research Asia https://www.microsoft.com/en-us/research/publication/mrc/ ''' def __init__(self, path_dataset, path_vocab, batch_size = 1, train = True, dimension_word_embeddings = 300, length_gru_state = 75, length_attention_state = 75, learning_rate = 1, dropout_keep_prob = 0.8, rho = .95, epsilon = 1e-6): self.path_ds = path_dataset self.vocab = WE(path_vocab, dimension_word_embeddings) self.batch_size = batch_size self.len_gs = length_gru_state self.len_as = length_attention_state self.lr = learning_rate self.keep_prob = dropout_keep_prob self.rho = rho self.eps = epsilon self.graph = self.build() @property def answers(self): return self.answers def build(self, scope = 'rnet'): ''' build model graph input: questions: a batch of questions, [] passages: a batch of corresponding passage ids, recover passages from ids in order to reduce duplicated passage copies in memory answers: a batch of corresponding answers output: self.answers: predicted answers, [start_pointer, end_pointer] self.losses: losses between predicted and target answers ''' with tf.variable_scope(scope): # placeholders questions = tf.placeholder(tf.int32, shape=[self.batch_size, self.sequence_length, ]) passages = tf.placeholder() # question and passage encoder u_Q = self.encode(questions) u_P = self.encode(passages) # gated attention-based rnn gated_u_P = self.gated_attn(u_Q, u_P) # self-matching attention h_P = self.self_matching_attn(gated_u_P) # output layer - pointer networks self.answers = output_layer(h_P, u_Q) self.losses = tf.losses.softmax_cross_entropy(answers, self.answers) return def inference(self): ''' inference input: inputs: tuples of passage, question and answer: (passage, question, truth) output: losses: ''' passages = tf.slice(inputs, [], []) questions = tf.slice(inputs, [], []) truths = tf.slice(inputs, [], []) return self.answers, self.losses def train(self): optimizer = tf.train.AdadeltaOptimizer(learning_rate = self.lr, beta1 = self.rho, epsilon = self.eps) optimizer.minimize(self.losses) def encode(self, words): ''' encode token sequence as a list of new token representations input: words: list of tokens output: representations: list of final representations ''' # TODO: new biRNN for each word? how to batch words for embedding? # build graph for the longest word, traverse corpus in advance? sequence = [self.embedding(word) for word in words] outputs = self.bidirectionalGRU(sequence, 3) representations = tf.squeeze(outputs) return representations def gated_attn(self, seq_1, seq_2, num_units = self.len_gs, scope = 'GatedAttn'): ''' gated attention for seq_2 w.r.t seq_1 input: seq_1: query sequence in attention mechanism seq_2: encoder sequence in attention mechanism output: outputs: v_P: context: ''' u_Q = seq_1 u_P = seq_2 cell = self.GRUCellGPU(num_units) with tf.variable_scope(scope): attn_v = tf.get_variable('attn_v', [num_units]) w_u_Q = tf.get_variable('weight_ques') w_u_P = tf.get_variable('weight_pass_orig') w_v_P = tf.get_variable('weight_pass_ques') v_P = tf.get_variable('embedding_pass_ques') score = tf.reduce_sum(attn_v * tf.tanh(w_u_Q * u_Q + w_u_P * u_P + w_v_P * v_P), [2]) # scores of all tokens alignments = tf.softmax(score) alignments = tf.expand_dims(alignments, 1) u_Q = tf.expand_dims(u_Q, 1) context = tf.reduce_sum(tf.matmul(alignments, u_Q, transpose_b=True), [2]) # gate inputs = tf.concat([u_Q, context], 1) w_g = tf.get_variable('weight_gate') g = tf.sigmoid(tf.reduce_sum(w_g * inputs)) gated_inputs = g * inputs outputs, v_P = cell(gated_inputs, v_P) return outputs, v_P def self_matching_attn(self, seq, scope = 'SelfMatchAttn'): ''' self-matching attention of seq input: output: ''' v_P = seq with tf.variable_scope(scope): attn_v = tf.get_variable('attn_v') w_v_P = tf.get_variable('weight_passage') w_v_P_w = tf.get_variable('weight_passage_wave') score = tf.reduce_sum(attn_v * tf.tanh(w_v_P * v_P + w_v_P_w * v_P), [2]) # scores for all tokens alignments = tf.softmax(score) alignments = tf.expand_dims(alignments, 1) v_P = tf.expand_dims(u_Q, 1) context = tf.reduce_sum(tf.matmul(alignments, v_P, transpose_b=True), [2]) inputs = tf.concat([seq, context], 1) outputs = self.bidirectionalGRU(inputs, 1) h_P = outputs return h_P def output_layer(self, seq_1, seq_2, scope = 'PointerNetwork'): h_P = seq_1 u_Q = seq_2 cell = self.GRUCellGPU(num_units) with tf.variable_scope(scope): # initialize hidden state of answer attn_v_a = tf.get_varialbe('attn_v') w_u_Q = tf.get_varialbe('weight_passage') w_v_Q = tf.get_varialbe('weight_answer') V_Q = tf.get_varialbe('weight_answer') score_a = tf.reduce_sum(attn_v_a * tf.tanh(w_u_Q * u_Q + w_a * h_a), [2]) # scores for all tokens alignments_a = tf.softmax(score_a) r_Q = tf.reduce_sum(tf.matmul(alignments_a, u_Q, transpose_b=True), [2]) attn_v = tf.get_varialbe('attn_v') w_P = tf.get_varialbe('weight_passage') w_a = tf.get_varialbe('weight_answer') h_a = tf.get_varialbe('embedding_answer') score = tf.reduce_sum(attn_v * tf.tanh(w_P * h_P + w_a * h_a), [2]) # scores for all tokens alignments = tf.softmax(score) alignments = tf.expand_dims(alignments, 1) v_P = tf.expand_dims(u_Q, 1) context = tf.reduce_sum(tf.matmul(alignments, v_P, transpose_b=True), [2]) outputs, h_a = cell(h_a, context) self.answer = outputs return self.answer def GRUCellGPU(self, num_units = self.len_gs, gpu_num = 0, scope = 'GRUCellGPU'): ''' wrapper GRUCell with Dropout & GPU device ''' gru_cell = tf.contrib.rnn.DeviceWrapper( tf.contrib.rnn.DropoutWrapper( tf.nn.rnn_cell.GRUCell(num_units), input_keep_prob = self.keep_prob, output_keep_prob = self.keep_prob, state_keep_prob = self.keep_prob), "/device:GPU:%i" % gpu_num) return gru_cell def bidirectionalGRU(self, sequence, num_layers, num_units = self.len_gs, scope = 'bidirectionalGRU'): ''' bidirectional rnn layer using GRU cells input: sequence: sequencial token/char inputs num_layers: number of bidirectionalGRU layers num_units: number of dimension of GRU's hidden states scope: name of variable scope output: results: results of biRNN layers, (outputs, output_state_fw, output_state_bw) outputs: [batch_size, max_time, layers_output] output_state_fw: final states, one tensor per layer, of the forward rnn. output_state_bw: similiar to fw above. ''' with tf.variable_scope(scope): gru_fw = self.GRUCellGPU(num_units) gru_bw = self.GRUCellGPU(num_units) # shape: [batch_size, max_time_step, ...] # TODO: decide batch_size_word based on the batch with the largest amount of unique words. # char embedding: [batch_size_word, word_length, 300], # sentence: [batch_size, seq_len, 300+75] inputs = np.array([sequence]) # TODO: length of each sequence should be provided outputs, _, _ = tf.contrib.rnn.stack_bidirectional_dynamic_rnn([gru_fw] * num_layers, [gru_bw] * num_layers, inputs) return outputs def embedding(self, word, scope = 'embedding'): ''' input: word: tokenized word output: embed: embedding combining both word-level and character-level ''' word_embed, char_embeds = self.vocab.embedding(word) with tf.variable_scope(scope): # char_embeds: [word_length, vocab_dim] # TODO: dynamic word_length needs padding? # NO need, since dynamic rnn adopted. But length of each word should be provided. # TODO: BUT how to batch words? # MAX_TIME should be provided, traverse words of a batch to get the largest word length char_embed = self.bidirectionalGRU(char_embeds, 2) embed = tf.concat([word_embed, char_embed], axis = 0) return embed if __name__ == '__main__':
[ 1, 1053, 26110, 408, 15886, 13, 5215, 12655, 408, 7442, 13, 3166, 1734, 29918, 17987, 8497, 1053, 399, 25593, 29918, 29923, 9486, 3352, 29928, 4214, 408, 399, 29923, 13, 13, 1990, 390, 29918, 6006, 29898, 3318, 1125, 13, 29871, 14550, 13, 29871, 2737, 304, 29871, 13, 29871, 390, 29899, 6006, 29901, 6189, 21439, 422, 1457, 29882, 2673, 411, 21782, 29899, 4352, 292, 8527, 29879, 13, 29871, 18385, 17088, 11796, 292, 6431, 29892, 7783, 10550, 14325, 13, 29871, 2045, 597, 1636, 29889, 4994, 29889, 510, 29914, 264, 29899, 375, 29914, 690, 2842, 29914, 3597, 362, 29914, 29885, 2214, 29914, 13, 29871, 14550, 13, 29871, 822, 4770, 2344, 12035, 1311, 29892, 2224, 29918, 24713, 29892, 2224, 29918, 29894, 542, 370, 29892, 9853, 29918, 2311, 353, 29871, 29896, 29892, 7945, 353, 5852, 29892, 9927, 29918, 1742, 29918, 17987, 29881, 886, 353, 29871, 29941, 29900, 29900, 29892, 13, 1669, 3309, 29918, 7108, 29918, 3859, 353, 29871, 29955, 29945, 29892, 3309, 29918, 1131, 2509, 29918, 3859, 353, 29871, 29955, 29945, 29892, 6509, 29918, 10492, 353, 29871, 29896, 29892, 5768, 449, 29918, 17462, 29918, 22795, 353, 29871, 29900, 29889, 29947, 29892, 13, 1669, 364, 1251, 353, 869, 29929, 29945, 29892, 321, 3232, 353, 29871, 29896, 29872, 29899, 29953, 1125, 13, 1678, 1583, 29889, 2084, 29918, 6289, 353, 2224, 29918, 24713, 13, 1678, 1583, 29889, 29894, 542, 370, 353, 399, 29923, 29898, 2084, 29918, 29894, 542, 370, 29892, 9927, 29918, 1742, 29918, 17987, 29881, 886, 29897, 13, 1678, 1583, 29889, 16175, 29918, 2311, 353, 9853, 29918, 2311, 13, 1678, 1583, 29889, 2435, 29918, 3174, 353, 3309, 29918, 7108, 29918, 3859, 13, 1678, 1583, 29889, 2435, 29918, 294, 353, 3309, 29918, 1131, 2509, 29918, 3859, 13, 1678, 1583, 29889, 29212, 353, 6509, 29918, 10492, 13, 1678, 1583, 29889, 17462, 29918, 22795, 353, 5768, 449, 29918, 17462, 29918, 22795, 13, 1678, 1583, 29889, 4650, 353, 364, 1251, 13, 1678, 1583, 29889, 8961, 353, 321, 3232, 13, 1678, 1583, 29889, 4262, 353, 1583, 29889, 4282, 580, 13, 268, 13, 29871, 732, 6799, 13, 29871, 822, 6089, 29898, 1311, 1125, 13, 1678, 736, 1583, 29889, 550, 17538, 13, 13, 29871, 822, 2048, 29898, 1311, 29892, 6874, 353, 525, 29878, 1212, 29374, 13, 1678, 14550, 2048, 1904, 3983, 13, 1678, 1881, 29901, 13, 418, 5155, 29901, 263, 9853, 310, 5155, 29892, 5159, 13, 418, 1209, 1179, 29901, 263, 9853, 310, 6590, 13382, 18999, 29892, 9792, 1209, 1179, 515, 18999, 297, 1797, 304, 10032, 5141, 9169, 13382, 13, 4706, 14591, 297, 3370, 13, 418, 6089, 29901, 263, 9853, 310, 6590, 6089, 13, 1678, 1962, 29901, 13, 418, 1583, 29889, 550, 17538, 29901, 25383, 6089, 29892, 518, 2962, 29918, 17226, 29892, 1095, 29918, 17226, 29962, 13, 418, 1583, 29889, 6758, 267, 29901, 28495, 1546, 25383, 322, 3646, 6089, 13, 1678, 14550, 13, 1678, 411, 15886, 29889, 11918, 29918, 6078, 29898, 6078, 1125, 13, 418, 396, 2058, 8948, 414, 13, 418, 5155, 353, 15886, 29889, 27074, 29898, 13264, 29889, 524, 29941, 29906, 29892, 8267, 11759, 1311, 29889, 16175, 29918, 2311, 29892, 1583, 29889, 16506, 29918, 2848, 29892, 29871, 2314, 13, 418, 1209, 1179, 353, 15886, 29889, 27074, 580, 13, 13, 418, 396, 1139, 322, 13382, 2094, 6119, 13, 418, 318, 29918, 29984, 353, 1583, 29889, 12508, 29898, 2619, 29897, 13, 418, 318, 29918, 29925, 353, 1583, 29889, 12508, 29898, 3364, 1179, 29897, 13, 13, 418, 396, 330, 630, 8570, 29899, 6707, 364, 15755, 13, 418, 330, 630, 29918, 29884, 29918, 29925, 353, 1583, 29889, 29887, 630, 29918, 1131, 29876, 29898, 29884, 29918, 29984, 29892, 318, 29918, 29925, 29897, 13, 13, 418, 396, 1583, 29899, 4352, 292, 8570, 13, 418, 298, 29918, 29925, 353, 1583, 29889, 1311, 29918, 4352, 292, 29918, 1131, 29876, 29898, 29887, 630, 29918, 29884, 29918, 29925, 29897, 13, 13, 418, 396, 1962, 7546, 448, 4879, 14379, 13, 418, 1583, 29889, 550, 17538, 353, 1962, 29918, 13148, 29898, 29882, 29918, 29925, 29892, 318, 29918, 29984, 29897, 13, 418, 1583, 29889, 6758, 267, 353, 15886, 29889, 6758, 267, 29889, 2695, 3317, 29918, 19128, 29918, 296, 14441, 29898, 550, 17538, 29892, 1583, 29889, 550, 17538, 29897, 13, 1678, 736, 29871, 13, 13, 29871, 822, 27262, 29898, 1311, 1125, 13, 1678, 14550, 27262, 13, 1678, 1881, 29901, 13, 418, 10970, 29901, 5291, 2701, 310, 13382, 29892, 1139, 322, 1234, 29901, 313, 3364, 482, 29892, 1139, 29892, 8760, 29897, 13, 1678, 1962, 29901, 13, 418, 28495, 29901, 29871, 13, 1678, 14550, 13, 1678, 1209, 1179, 353, 15886, 29889, 18337, 29898, 2080, 29879, 29892, 19997, 518, 2314, 13, 1678, 5155, 353, 15886, 29889, 18337, 29898, 2080, 29879, 29892, 19997, 518, 2314, 13, 1678, 8760, 29879, 353, 15886, 29889, 18337, 29898, 2080, 29879, 29892, 19997, 518, 2314, 13, 1678, 736, 1583, 29889, 550, 17538, 29892, 1583, 29889, 6758, 267, 13, 13, 29871, 822, 7945, 29898, 1311, 1125, 13, 1678, 5994, 3950, 353, 15886, 29889, 14968, 29889, 3253, 328, 2554, 20624, 326, 3950, 29898, 21891, 29918, 10492, 353, 1583, 29889, 29212, 29892, 21762, 29896, 353, 1583, 29889, 4650, 29892, 321, 3232, 353, 1583, 29889, 8961, 29897, 13, 1678, 5994, 3950, 29889, 1195, 326, 675, 29898, 1311, 29889, 6758, 267, 29897, 13, 13, 29871, 822, 19750, 29898, 1311, 29892, 3838, 1125, 13, 1678, 14550, 19750, 5993, 5665, 408, 263, 1051, 310, 716, 5993, 22540, 13, 1678, 1881, 29901, 13, 418, 3838, 29901, 1051, 310, 18897, 13, 1678, 1962, 29901, 13, 418, 22540, 29901, 1051, 310, 2186, 22540, 13, 1678, 14550, 13, 1678, 396, 14402, 29901, 716, 4768, 29934, 10262, 363, 1269, 1734, 29973, 920, 304, 9853, 3838, 363, 23655, 29973, 13, 1678, 396, 2048, 3983, 363, 278, 27217, 1734, 29892, 29370, 1034, 13364, 297, 6564, 29973, 13, 1678, 5665, 353, 518, 1311, 29889, 17987, 8497, 29898, 1742, 29897, 363, 1734, 297, 3838, 29962, 13, 1678, 14391, 353, 1583, 29889, 23883, 8684, 284, 14345, 29965, 29898, 16506, 29892, 29871, 29941, 29897, 13, 1678, 22540, 353, 15886, 29889, 29879, 802, 29872, 911, 29898, 4905, 29879, 29897, 13, 1678, 736, 22540, 13, 13, 29871, 822, 330, 630, 29918, 1131, 29876, 29898, 1311, 29892, 19359, 29918, 29896, 29892, 19359, 29918, 29906, 29892, 954, 29918, 348, 1169, 353, 1583, 29889, 2435, 29918, 3174, 29892, 6874, 353, 525, 29954, 630, 4165, 29876, 29374, 13, 1678, 14550, 330, 630, 8570, 363, 19359, 29918, 29906, 281, 29889, 29878, 29889, 29873, 19359, 29918, 29896, 13, 418, 1881, 29901, 13, 4706, 19359, 29918, 29896, 29901, 2346, 5665, 297, 8570, 13336, 13, 4706, 19359, 29918, 29906, 29901, 2094, 6119, 5665, 297, 8570, 13336, 13, 418, 1962, 29901, 13, 4706, 14391, 29901, 13, 4706, 325, 29918, 29925, 29901, 13, 4706, 3030, 29901, 13, 1678, 14550, 13, 1678, 318, 29918, 29984, 353, 19359, 29918, 29896, 13, 1678, 318, 29918, 29925, 353, 19359, 29918, 29906, 13, 1678, 3038, 353, 1583, 29889, 14345, 29965, 4617, 29954, 7056, 29898, 1949, 29918, 348, 1169, 29897, 13, 1678, 411, 15886, 29889, 11918, 29918, 6078, 29898, 6078, 1125, 13, 418, 1098, 29876, 29918, 29894, 353, 15886, 29889, 657, 29918, 11918, 877, 1131, 29876, 29918, 29894, 742, 518, 1949, 29918, 348, 1169, 2314, 13, 418, 281, 29918, 29884, 29918, 29984, 353, 15886, 29889, 657, 29918, 11918, 877, 7915, 29918, 1912, 1495, 13, 418, 281, 29918, 29884, 29918, 29925, 353, 15886, 29889, 657, 29918, 11918, 877, 7915, 29918, 3364, 29918, 12683, 1495, 13, 418, 281, 29918, 29894, 29918, 29925, 353, 15886, 29889, 657, 29918, 11918, 877, 7915, 29918, 3364, 29918, 1912, 1495, 13, 418, 325, 29918, 29925, 353, 15886, 29889, 657, 29918, 11918, 877, 17987, 8497, 29918, 3364, 29918, 1912, 1495, 13, 418, 8158, 353, 15886, 29889, 17469, 29918, 2083, 29898, 1131, 29876, 29918, 29894, 334, 15886, 29889, 13161, 29882, 29898, 29893, 29918, 29884, 29918, 29984, 334, 318, 29918, 29984, 718, 281, 29918, 29884, 29918, 29925, 334, 318, 29918, 29925, 718, 281, 29918, 29894, 29918, 29925, 334, 325, 29918, 29925, 511, 518, 29906, 2314, 396, 19435, 310, 599, 18897, 13, 418, 7595, 1860, 353, 15886, 29889, 2695, 3317, 29898, 13628, 29897, 13, 418, 7595, 1860, 353, 15886, 29889, 18837, 29918, 6229, 29879, 29898, 2520, 1860, 29892, 29871, 29896, 29897, 13, 418, 318, 29918, 29984, 353, 15886, 29889, 18837, 29918, 6229, 29879, 29898, 29884, 29918, 29984, 29892, 29871, 29896, 29897, 13, 418, 3030, 353, 15886, 29889, 17469, 29918, 2083, 29898, 13264, 29889, 2922, 16109, 29898, 2520, 1860, 29892, 318, 29918, 29984, 29892, 1301, 4220, 29918, 29890, 29922, 5574, 511, 518, 29906, 2314, 13, 418, 396, 12417, 13, 418, 10970, 353, 15886, 29889, 17685, 4197, 29884, 29918, 29984, 29892, 3030, 1402, 29871, 29896, 29897, 13, 418, 281, 29918, 29887, 353, 15886, 29889, 657, 29918, 11918, 877, 7915, 29918, 17062, 1495, 13, 418, 330, 353, 15886, 29889, 18816, 29885, 3398, 29898, 13264, 29889, 17469, 29918, 2083, 29898, 29893, 29918, 29887, 334, 10970, 876, 13, 418, 330, 630, 29918, 2080, 29879, 353, 330, 334, 10970, 13, 418, 14391, 29892, 325, 29918, 29925, 353, 3038, 29898, 29887, 630, 29918, 2080, 29879, 29892, 325, 29918, 29925, 29897, 13, 1678, 736, 14391, 29892, 325, 29918, 29925, 13, 13, 29871, 822, 1583, 29918, 4352, 292, 29918, 1131, 29876, 29898, 1311, 29892, 19359, 29892, 6874, 353, 525, 24313, 9652, 4165, 29876, 29374, 13, 1678, 14550, 1583, 29899, 4352, 292, 8570, 310, 19359, 13, 418, 1881, 29901, 13, 418, 1962, 29901, 13, 1678, 14550, 13, 1678, 325, 29918, 29925, 353, 19359, 13, 1678, 411, 15886, 29889, 11918, 29918, 6078, 29898, 6078, 1125, 13, 418, 1098, 29876, 29918, 29894, 353, 15886, 29889, 657, 29918, 11918, 877, 1131, 29876, 29918, 29894, 1495, 13, 418, 281, 29918, 29894, 29918, 29925, 353, 15886, 29889, 657, 29918, 11918, 877, 7915, 29918, 3364, 482, 1495, 13, 418, 281, 29918, 29894, 29918, 29925, 29918, 29893, 353, 15886, 29889, 657, 29918, 11918, 877, 7915, 29918, 3364, 482, 29918, 27766, 1495, 13, 418, 8158, 353, 15886, 29889, 17469, 29918, 2083, 29898, 1131, 29876, 29918, 29894, 334, 15886, 29889, 13161, 29882, 29898, 29893, 29918, 29894, 29918, 29925, 334, 325, 29918, 29925, 718, 281, 29918, 29894, 29918, 29925, 29918, 29893, 334, 325, 29918, 29925, 511, 518, 29906, 2314, 396, 19435, 363, 599, 18897, 13, 418, 7595, 1860, 353, 15886, 29889, 2695, 3317, 29898, 13628, 29897, 13, 418, 7595, 1860, 353, 15886, 29889, 18837, 29918, 6229, 29879, 29898, 2520, 1860, 29892, 29871, 29896, 29897, 13, 418, 325, 29918, 29925, 353, 15886, 29889, 18837, 29918, 6229, 29879, 29898, 29884, 29918, 29984, 29892, 29871, 29896, 29897, 13, 418, 3030, 353, 15886, 29889, 17469, 29918, 2083, 29898, 13264, 29889, 2922, 16109, 29898, 2520, 1860, 29892, 325, 29918, 29925, 29892, 1301, 4220, 29918, 29890, 29922, 5574, 511, 518, 29906, 2314, 13, 418, 10970, 353, 15886, 29889, 17685, 4197, 11762, 29892, 3030, 1402, 29871, 29896, 29897, 13, 418, 14391, 353, 1583, 29889, 23883, 8684, 284, 14345, 29965, 29898, 2080, 29879, 29892, 29871, 29896, 29897, 13, 418, 298, 29918, 29925, 353, 14391, 13, 1678, 736, 298, 29918, 29925, 13, 13, 29871, 822, 1962, 29918, 13148, 29898, 1311, 29892, 19359, 29918, 29896, 29892, 19359, 29918, 29906, 29892, 6874, 353, 525, 14516, 13724, 29374, 13, 1678, 298, 29918, 29925, 353, 19359, 29918, 29896, 13, 1678, 318, 29918, 29984, 353, 19359, 29918, 29906, 13, 1678, 3038, 353, 1583, 29889, 14345, 29965, 4617, 29954, 7056, 29898, 1949, 29918, 348, 1169, 29897, 13, 1678, 411, 15886, 29889, 11918, 29918, 6078, 29898, 6078, 1125, 13, 418, 396, 11905, 7934, 2106, 310, 1234, 13, 418, 1098, 29876, 29918, 29894, 29918, 29874, 353, 15886, 29889, 657, 29918, 1707, 616, 915, 877, 1131, 29876, 29918, 29894, 1495, 13, 418, 281, 29918, 29884, 29918, 29984, 353, 15886, 29889, 657, 29918, 1707, 616, 915, 877, 7915, 29918, 3364, 482, 1495, 13, 418, 281, 29918, 29894, 29918, 29984, 353, 15886, 29889, 657, 29918, 1707, 616, 915, 877, 7915, 29918, 12011, 1495, 13, 418, 478, 29918, 29984, 353, 15886, 29889, 657, 29918, 1707, 616, 915, 877, 7915, 29918, 12011, 1495, 13, 418, 8158, 29918, 29874, 353, 15886, 29889, 17469, 29918, 2083, 29898, 1131, 29876, 29918, 29894, 29918, 29874, 334, 15886, 29889, 13161, 29882, 29898, 29893, 29918, 29884, 29918, 29984, 334, 318, 29918, 29984, 718, 281, 29918, 29874, 334, 298, 29918, 29874, 511, 518, 29906, 2314, 396, 19435, 363, 599, 18897, 13, 418, 7595, 1860, 29918, 29874, 353, 15886, 29889, 2695, 3317, 29898, 13628, 29918, 29874, 29897, 13, 418, 364, 29918, 29984, 353, 15886, 29889, 17469, 29918, 2083, 29898, 13264, 29889, 2922, 16109, 29898, 2520, 1860, 29918, 29874, 29892, 318, 29918, 29984, 29892, 1301, 4220, 29918, 29890, 29922, 5574, 511, 518, 29906, 2314, 13, 13, 418, 1098, 29876, 29918, 29894, 353, 15886, 29889, 657, 29918, 1707, 616, 915, 877, 1131, 29876, 29918, 29894, 1495, 13, 418, 281, 29918, 29925, 353, 15886, 29889, 657, 29918, 1707, 616, 915, 877, 7915, 29918, 3364, 482, 1495, 13, 418, 281, 29918, 29874, 353, 15886, 29889, 657, 29918, 1707, 616, 915, 877, 7915, 29918, 12011, 1495, 13, 418, 298, 29918, 29874, 353, 15886, 29889, 657, 29918, 1707, 616, 915, 877, 17987, 8497, 29918, 12011, 1495, 13, 418, 8158, 353, 15886, 29889, 17469, 29918, 2083, 29898, 1131, 29876, 29918, 29894, 334, 15886, 29889, 13161, 29882, 29898, 29893, 29918, 29925, 334, 298, 29918, 29925, 718, 281, 29918, 29874, 334, 298, 29918, 29874, 511, 518, 29906, 2314, 396, 19435, 363, 599, 18897, 13, 418, 7595, 1860, 353, 15886, 29889, 2695, 3317, 29898, 13628, 29897, 13, 418, 7595, 1860, 353, 15886, 29889, 18837, 29918, 6229, 29879, 29898, 2520, 1860, 29892, 29871, 29896, 29897, 13, 418, 325, 29918, 29925, 353, 15886, 29889, 18837, 29918, 6229, 29879, 29898, 29884, 29918, 29984, 29892, 29871, 29896, 29897, 13, 418, 3030, 353, 15886, 29889, 17469, 29918, 2083, 29898, 13264, 29889, 2922, 16109, 29898, 2520, 1860, 29892, 325, 29918, 29925, 29892, 1301, 4220, 29918, 29890, 29922, 5574, 511, 518, 29906, 2314, 13, 418, 14391, 29892, 298, 29918, 29874, 353, 3038, 29898, 29882, 29918, 29874, 29892, 3030, 29897, 13, 418, 1583, 29889, 12011, 353, 14391, 13, 1678, 736, 1583, 29889, 12011, 13, 13, 29871, 822, 18016, 29965, 4617, 29954, 7056, 29898, 1311, 29892, 954, 29918, 348, 1169, 353, 1583, 29889, 2435, 29918, 3174, 29892, 330, 3746, 29918, 1949, 353, 29871, 29900, 29892, 6874, 353, 525, 14345, 29965, 4617, 29954, 7056, 29374, 13, 1678, 14550, 14476, 18016, 29965, 4617, 411, 20724, 449, 669, 22796, 4742, 13, 1678, 14550, 13, 1678, 4500, 29918, 3729, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 11501, 15646, 29898, 13, 418, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 15063, 449, 15646, 29898, 13, 4706, 15886, 29889, 15755, 29889, 29878, 15755, 29918, 3729, 29889, 14345, 29965, 4617, 29898, 1949, 29918, 348, 1169, 511, 13, 4706, 1881, 29918, 17462, 29918, 22795, 353, 1583, 29889, 17462, 29918, 22795, 29892, 1962, 29918, 17462, 29918, 22795, 353, 1583, 29889, 17462, 29918, 22795, 29892, 2106, 29918, 17462, 29918, 22795, 353, 1583, 29889, 17462, 29918, 22795, 511, 13, 418, 5591, 10141, 29901, 29954, 7056, 16664, 29875, 29908, 1273, 330, 3746, 29918, 1949, 29897, 13, 1678, 736, 4500, 29918, 3729, 13, 13, 29871, 822, 21000, 8684, 284, 14345, 29965, 29898, 1311, 29892, 5665, 29892, 954, 29918, 29277, 29892, 954, 29918, 348, 1169, 353, 1583, 29889, 2435, 29918, 3174, 29892, 6874, 353, 525, 23883, 8684, 284, 14345, 29965, 29374, 13, 1678, 14550, 21000, 8684, 284, 364, 15755, 7546, 773, 18016, 29965, 9101, 13, 1678, 1881, 29901, 29871, 13, 418, 5665, 29901, 8617, 264, 1455, 5993, 29914, 3090, 10970, 13, 418, 954, 29918, 29277, 29901, 1353, 310, 21000, 8684, 284, 14345, 29965, 15359, 13, 418, 954, 29918, 348, 1169, 29901, 1353, 310, 9927, 310, 18016, 29965, 29915, 29879, 7934, 5922, 13, 418, 6874, 29901, 1024, 310, 2286, 6874, 13, 1678, 1962, 29901, 13, 418, 2582, 29901, 2582, 310, 4768, 29934, 10262, 15359, 29892, 313, 4905, 29879, 29892, 1962, 29918, 3859, 29918, 25051, 29892, 1962, 29918, 3859, 29918, 29890, 29893, 29897, 13, 4706, 14391, 29901, 518, 16175, 29918, 2311, 29892, 4236, 29918, 2230, 29892, 15359, 29918, 4905, 29962, 13, 4706, 1962, 29918, 3859, 29918, 25051, 29901, 2186, 5922, 29892, 697, 12489, 639, 7546, 29892, 310, 278, 6375, 364, 15755, 29889, 13, 4706, 1962, 29918, 3859, 29918, 29890, 29893, 29901, 1027, 2638, 279, 304, 285, 29893, 2038, 29889, 13, 1678, 14550, 13, 1678, 411, 15886, 29889, 11918, 29918, 6078, 29898, 6078, 1125, 13, 418, 4500, 29918, 25051, 353, 1583, 29889, 14345, 29965, 4617, 29954, 7056, 29898, 1949, 29918, 348, 1169, 29897, 13, 418, 4500, 29918, 29890, 29893, 353, 1583, 29889, 14345, 29965, 4617, 29954, 7056, 29898, 1949, 29918, 348, 1169, 29897, 13, 418, 396, 8267, 29901, 518, 16175, 29918, 2311, 29892, 4236, 29918, 2230, 29918, 10568, 29892, 2023, 29962, 13, 418, 396, 14402, 29901, 11097, 9853, 29918, 2311, 29918, 1742, 2729, 373, 278, 9853, 411, 278, 10150, 5253, 310, 5412, 3838, 29889, 29871, 13, 418, 396, 1373, 23655, 29901, 518, 16175, 29918, 2311, 29918, 1742, 29892, 1734, 29918, 2848, 29892, 29871, 29941, 29900, 29900, 1402, 29871, 13, 418, 396, 10541, 29901, 518, 16175, 29918, 2311, 29892, 19359, 29918, 2435, 29892, 29871, 29941, 29900, 29900, 29974, 29955, 29945, 29962, 13, 418, 10970, 353, 7442, 29889, 2378, 4197, 16506, 2314, 13, 418, 396, 14402, 29901, 3309, 310, 1269, 5665, 881, 367, 4944, 29871, 13, 418, 14391, 29892, 17117, 903, 353, 15886, 29889, 21570, 29889, 29878, 15755, 29889, 1429, 29918, 23883, 8684, 284, 29918, 16626, 29918, 29878, 15755, 4197, 7108, 29918, 25051, 29962, 334, 954, 29918, 29277, 29892, 518, 7108, 29918, 29890, 29893, 29962, 334, 954, 29918, 29277, 29892, 13, 418, 10970, 29897, 13, 1678, 736, 14391, 13, 13, 29871, 822, 23655, 29898, 1311, 29892, 1734, 29892, 6874, 353, 525, 17987, 8497, 29374, 13, 1678, 14550, 13, 1678, 1881, 29901, 13, 418, 1734, 29901, 5993, 1891, 1734, 13, 1678, 1962, 29901, 13, 418, 8297, 29901, 23655, 29299, 1716, 1734, 29899, 5563, 322, 2931, 29899, 5563, 13, 1678, 14550, 13, 1678, 1734, 29918, 17987, 29892, 1373, 29918, 1590, 5779, 353, 1583, 29889, 29894, 542, 370, 29889, 17987, 8497, 29898, 1742, 29897, 13, 1678, 411, 15886, 29889, 11918, 29918, 6078, 29898, 6078, 1125, 13, 418, 396, 1373, 29918, 1590, 5779, 29901, 518, 1742, 29918, 2848, 29892, 7931, 370, 29918, 6229, 29962, 13, 418, 396, 14402, 29901, 7343, 1734, 29918, 2848, 4225, 7164, 29973, 13, 418, 396, 11698, 817, 29892, 1951, 7343, 364, 15755, 16356, 29889, 1205, 3309, 310, 1269, 1734, 881, 367, 4944, 29889, 13, 418, 396, 14402, 29901, 350, 2692, 920, 304, 9853, 3838, 29973, 13, 418, 396, 18134, 29918, 15307, 881, 367, 4944, 29892, 29370, 3838, 310, 263, 9853, 304, 679, 278, 10150, 1734, 3309, 13, 418, 1373, 29918, 17987, 353, 1583, 29889, 23883, 8684, 284, 14345, 29965, 29898, 3090, 29918, 1590, 5779, 29892, 29871, 29906, 29897, 13, 418, 8297, 353, 15886, 29889, 17685, 4197, 1742, 29918, 17987, 29892, 1373, 29918, 17987, 1402, 9685, 353, 29871, 29900, 29897, 13, 1678, 736, 8297, 13, 268, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 2 ]
tests/io/test_processing.py
syuoni/eznlp
9
111696
<gh_stars>1-10 # -*- coding: utf-8 -*- import pytest from eznlp.io import PostIO @pytest.mark.parametrize("absorb_attr_types", [[], ['Analyzed'], ['Analyzed', 'Denied'], ['Unconfirmed', 'Analyzed', 'Denied']]) def test_absorb_attributes(absorb_attr_types, HwaMei_demo): data = HwaMei_demo post_io = PostIO() data_abs = post_io.absorb_attributes(data, absorb_attr_types=absorb_attr_types) assert all(attr_type not in absorb_attr_types for entry_abs in data_abs for attr_type, ck in entry_abs['attributes']) if len(absorb_attr_types) > 0: assert len(set(ck[0] for entry in data for ck in entry['chunks'])) < len(set(ck[0] for entry in data_abs for ck in entry['chunks'])) assert all(ck in entry['chunks'] for entry in data_abs for attr_type, ck in entry['attributes']) assert all(head in entry['chunks'] and tail in entry['chunks'] for entry in data_abs for rel_type, head, tail in entry['relations']) data_retr = post_io.exclude_attributes(data_abs) assert all(entry['tokens'] == entry_retr['tokens'] for entry, entry_retr in zip(data, data_retr)) assert all(entry['chunks'] == entry_retr['chunks'] for entry, entry_retr in zip(data, data_retr)) assert all(set(entry['attributes']) == set(entry_retr['attributes']) for entry, entry_retr in zip(data, data_retr)) assert all(entry['relations'] == entry_retr['relations'] for entry, entry_retr in zip(data, data_retr)) @pytest.mark.parametrize("group_rel_types", [[], ['Group_DS', 'Group_Test'], ['Group_DS', 'Group_Test', 'Syn_Treat']]) def test_infer_relations(group_rel_types, HwaMei_demo): data = HwaMei_demo post_io = PostIO() data_inf = post_io.infer_relations(data, group_rel_types=group_rel_types) assert all(entry['tokens'] == entry_inf['tokens'] for entry, entry_inf in zip(data, data_inf)) assert all(entry['chunks'] == entry_inf['chunks'] for entry, entry_inf in zip(data, data_inf)) assert all(entry['attributes'] == entry_inf['attributes'] for entry, entry_inf in zip(data, data_inf)) assert all(set(entry['relations']).issubset(set(entry_inf['relations'])) for entry, entry_inf in zip(data, data_inf)) if len(group_rel_types) > 0: assert sum(len(entry_inf['relations']) - len(entry['relations']) for entry, entry_inf in zip(data, data_inf)) == 14
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 5215, 11451, 1688, 13, 13, 3166, 321, 3749, 22833, 29889, 601, 1053, 4918, 5971, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 703, 6897, 11831, 29918, 5552, 29918, 8768, 613, 5519, 1402, 29871, 13, 462, 462, 1669, 6024, 21067, 12339, 287, 7464, 29871, 13, 462, 462, 1669, 6024, 21067, 12339, 287, 742, 525, 29315, 1000, 7464, 29871, 13, 462, 462, 1669, 6024, 2525, 5527, 381, 2168, 742, 525, 21067, 12339, 287, 742, 525, 29315, 1000, 2033, 2314, 13, 1753, 1243, 29918, 6897, 11831, 29918, 15697, 29898, 6897, 11831, 29918, 5552, 29918, 8768, 29892, 379, 2766, 6816, 29875, 29918, 17482, 1125, 13, 1678, 848, 353, 379, 2766, 6816, 29875, 29918, 17482, 13, 1678, 1400, 29918, 601, 353, 4918, 5971, 580, 13, 13, 1678, 848, 29918, 6897, 353, 1400, 29918, 601, 29889, 6897, 11831, 29918, 15697, 29898, 1272, 29892, 6425, 11831, 29918, 5552, 29918, 8768, 29922, 6897, 11831, 29918, 5552, 29918, 8768, 29897, 13, 1678, 4974, 599, 29898, 5552, 29918, 1853, 451, 297, 6425, 11831, 29918, 5552, 29918, 8768, 363, 6251, 29918, 6897, 297, 848, 29918, 6897, 363, 12421, 29918, 1853, 29892, 274, 29895, 297, 6251, 29918, 6897, 1839, 15697, 11287, 13, 1678, 565, 7431, 29898, 6897, 11831, 29918, 5552, 29918, 8768, 29897, 1405, 29871, 29900, 29901, 13, 4706, 4974, 7431, 29898, 842, 29898, 384, 29961, 29900, 29962, 363, 6251, 297, 848, 363, 274, 29895, 297, 6251, 1839, 305, 18801, 25901, 529, 7431, 29898, 842, 29898, 384, 29961, 29900, 29962, 363, 6251, 297, 848, 29918, 6897, 363, 274, 29895, 297, 6251, 1839, 305, 18801, 25901, 13, 1678, 4974, 599, 29898, 384, 297, 6251, 1839, 305, 18801, 2033, 363, 6251, 297, 848, 29918, 6897, 363, 12421, 29918, 1853, 29892, 274, 29895, 297, 6251, 1839, 15697, 11287, 13, 1678, 4974, 599, 29898, 2813, 297, 6251, 1839, 305, 18801, 2033, 322, 12464, 297, 6251, 1839, 305, 18801, 2033, 363, 6251, 297, 848, 29918, 6897, 363, 1104, 29918, 1853, 29892, 2343, 29892, 12464, 297, 6251, 1839, 2674, 800, 11287, 13, 13, 1678, 848, 29918, 276, 509, 353, 1400, 29918, 601, 29889, 735, 2325, 29918, 15697, 29898, 1272, 29918, 6897, 29897, 13, 1678, 4974, 599, 29898, 8269, 1839, 517, 12360, 2033, 1275, 6251, 29918, 276, 509, 1839, 517, 12360, 2033, 363, 6251, 29892, 6251, 29918, 276, 509, 297, 14319, 29898, 1272, 29892, 848, 29918, 276, 509, 876, 13, 1678, 4974, 599, 29898, 8269, 1839, 305, 18801, 2033, 1275, 6251, 29918, 276, 509, 1839, 305, 18801, 2033, 363, 6251, 29892, 6251, 29918, 276, 509, 297, 14319, 29898, 1272, 29892, 848, 29918, 276, 509, 876, 13, 1678, 4974, 599, 29898, 842, 29898, 8269, 1839, 15697, 11287, 1275, 731, 29898, 8269, 29918, 276, 509, 1839, 15697, 11287, 363, 6251, 29892, 6251, 29918, 276, 509, 297, 14319, 29898, 1272, 29892, 848, 29918, 276, 509, 876, 13, 1678, 4974, 599, 29898, 8269, 1839, 2674, 800, 2033, 1275, 6251, 29918, 276, 509, 1839, 2674, 800, 2033, 363, 6251, 29892, 6251, 29918, 276, 509, 297, 14319, 29898, 1272, 29892, 848, 29918, 276, 509, 876, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 703, 2972, 29918, 2674, 29918, 8768, 613, 5519, 1402, 29871, 13, 462, 462, 632, 6024, 4782, 29918, 8452, 742, 525, 4782, 29918, 3057, 7464, 29871, 13, 462, 462, 632, 6024, 4782, 29918, 8452, 742, 525, 4782, 29918, 3057, 742, 525, 29216, 29918, 29911, 276, 271, 2033, 2314, 13, 1753, 1243, 29918, 262, 571, 29918, 2674, 800, 29898, 2972, 29918, 2674, 29918, 8768, 29892, 379, 2766, 6816, 29875, 29918, 17482, 1125, 13, 1678, 848, 353, 379, 2766, 6816, 29875, 29918, 17482, 13, 1678, 1400, 29918, 601, 353, 4918, 5971, 580, 13, 13, 1678, 848, 29918, 7192, 353, 1400, 29918, 601, 29889, 262, 571, 29918, 2674, 800, 29898, 1272, 29892, 2318, 29918, 2674, 29918, 8768, 29922, 2972, 29918, 2674, 29918, 8768, 29897, 13, 1678, 4974, 599, 29898, 8269, 1839, 517, 12360, 2033, 1275, 6251, 29918, 7192, 1839, 517, 12360, 2033, 363, 6251, 29892, 6251, 29918, 7192, 297, 14319, 29898, 1272, 29892, 848, 29918, 7192, 876, 13, 1678, 4974, 599, 29898, 8269, 1839, 305, 18801, 2033, 1275, 6251, 29918, 7192, 1839, 305, 18801, 2033, 363, 6251, 29892, 6251, 29918, 7192, 297, 14319, 29898, 1272, 29892, 848, 29918, 7192, 876, 13, 1678, 4974, 599, 29898, 8269, 1839, 15697, 2033, 1275, 6251, 29918, 7192, 1839, 15697, 2033, 363, 6251, 29892, 6251, 29918, 7192, 297, 14319, 29898, 1272, 29892, 848, 29918, 7192, 876, 13, 1678, 4974, 599, 29898, 842, 29898, 8269, 1839, 2674, 800, 2033, 467, 790, 431, 842, 29898, 842, 29898, 8269, 29918, 7192, 1839, 2674, 800, 25901, 363, 6251, 29892, 6251, 29918, 7192, 297, 14319, 29898, 1272, 29892, 848, 29918, 7192, 876, 13, 1678, 565, 7431, 29898, 2972, 29918, 2674, 29918, 8768, 29897, 1405, 29871, 29900, 29901, 13, 4706, 4974, 2533, 29898, 2435, 29898, 8269, 29918, 7192, 1839, 2674, 800, 11287, 448, 7431, 29898, 8269, 1839, 2674, 800, 11287, 363, 6251, 29892, 6251, 29918, 7192, 297, 14319, 29898, 1272, 29892, 848, 29918, 7192, 876, 1275, 29871, 29896, 29946, 13, 2 ]
annex_counts_app/admin.py
birkin/annex_counts_project
0
165196
# -*- coding: utf-8 -*- from .models import Counter from django.contrib import admin class CounterAdmin(admin.ModelAdmin): list_display = [ 'create_datetime', 'date_key', 'hay_accessions', 'hay_refiles', 'non_hay_accessions', 'non_hay_refiles', 'notes' ] list_filter = [ 'create_datetime', 'date_key', ] ordering = [ '-date_key' ] readonly_fields = [ 'create_datetime' ] prepopulated_fields = {} save_on_top = True ## class CounterAdmin() admin.site.register( Counter, CounterAdmin )
[ 1, 396, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 3166, 869, 9794, 1053, 315, 5336, 13, 3166, 9557, 29889, 21570, 1053, 4113, 13, 13, 13, 1990, 315, 5336, 12754, 29898, 6406, 29889, 3195, 12754, 1125, 13, 13, 1678, 1051, 29918, 4990, 353, 518, 525, 3258, 29918, 12673, 742, 525, 1256, 29918, 1989, 742, 525, 29882, 388, 29918, 5943, 1080, 742, 525, 29882, 388, 29918, 999, 5475, 742, 525, 5464, 29918, 29882, 388, 29918, 5943, 1080, 742, 525, 5464, 29918, 29882, 388, 29918, 999, 5475, 742, 525, 16953, 29915, 4514, 13, 1678, 1051, 29918, 4572, 353, 518, 13, 4706, 525, 3258, 29918, 12673, 742, 13, 4706, 525, 1256, 29918, 1989, 742, 13, 1678, 4514, 13, 1678, 20520, 353, 518, 17411, 1256, 29918, 1989, 29915, 4514, 13, 13, 1678, 20623, 29918, 9621, 353, 518, 525, 3258, 29918, 12673, 29915, 4514, 13, 13, 1678, 758, 7323, 7964, 29918, 9621, 353, 6571, 13, 13, 1678, 4078, 29918, 265, 29918, 3332, 353, 5852, 13, 13, 1678, 444, 770, 315, 5336, 12754, 580, 13, 13, 13, 6406, 29889, 2746, 29889, 9573, 29898, 315, 5336, 29892, 315, 5336, 12754, 1723, 13, 2 ]
torch/jit/_fuser.py
ljhOfGithub/pytorch
1
11885
<reponame>ljhOfGithub/pytorch import contextlib import torch from typing import List, Tuple @contextlib.contextmanager def optimized_execution(should_optimize): """ A context manager that controls whether the JIT's executor will run optimizations before executing a function. """ stored_flag = torch._C._get_graph_executor_optimize() torch._C._set_graph_executor_optimize(should_optimize) try: yield finally: torch._C._set_graph_executor_optimize(stored_flag) @contextlib.contextmanager def fuser(name): """ A context manager that facilitates switching between backend fusers. Valid names: * ``fuser0`` - enables only legacy fuser * ``fuser1`` - enables only NNC * ``fuser2`` - enables only nvFuser """ old_cpu_fuse = torch._C._jit_can_fuse_on_cpu() old_gpu_fuse = torch._C._jit_can_fuse_on_gpu() old_texpr_fuser_state = torch._C._jit_texpr_fuser_enabled() old_nvfuser_state = torch._C._jit_nvfuser_enabled() if name == 'fuser0': # legacy fuser torch._C._jit_override_can_fuse_on_cpu(True) torch._C._jit_override_can_fuse_on_gpu(True) torch._C._jit_set_texpr_fuser_enabled(False) torch._C._jit_set_nvfuser_enabled(False) elif name == 'fuser1': # NNC old_profiling_executor = torch._C._jit_set_profiling_executor(True) old_profiling_mode = torch._C._jit_set_profiling_mode(True) torch._C._jit_override_can_fuse_on_cpu(True) torch._C._jit_override_can_fuse_on_gpu(True) torch._C._jit_set_texpr_fuser_enabled(True) torch._C._jit_set_nvfuser_enabled(False) elif name == 'fuser2': # nvFuser torch._C._jit_override_can_fuse_on_cpu(False) torch._C._jit_override_can_fuse_on_gpu(False) torch._C._jit_set_texpr_fuser_enabled(False) torch._C._jit_set_nvfuser_enabled(True) else: raise Exception("unrecognized fuser option") try: yield finally: if name == 'fuser1': # NNC torch._C._jit_set_profiling_executor(old_profiling_executor) torch._C._jit_set_profiling_mode(old_profiling_mode) # recover the previous values torch._C._jit_override_can_fuse_on_cpu(old_cpu_fuse) torch._C._jit_override_can_fuse_on_gpu(old_gpu_fuse) torch._C._jit_set_texpr_fuser_enabled(old_texpr_fuser_state) torch._C._jit_set_nvfuser_enabled(old_nvfuser_state) last_executed_optimized_graph = torch._C._last_executed_optimized_graph def _get_differentiable_graph_node(node, diff_node): if node.kind() == 'prim::DifferentiableGraph': diff_node.append(node) else: for block in node.blocks(): for n in block.nodes(): _get_differentiable_graph_node(n, diff_node) def _graph_for(self, *args, **kwargs): return _script_method_graph_for(self, self, *args, **kwargs) def _script_method_graph_for(self, parent, *args, **kwargs): try: dbs = parent.get_debug_state() eps = list(dbs.execution_plans.values()) assert(len(eps) == 1) graph = eps[0].graph.copy() # graph_executor_states for differentiable node fw_states = eps[0].code.differentiable_op_executor_states() diff_nodes: List[torch._C.Node] = [] for n in graph.nodes(): _get_differentiable_graph_node(n, diff_nodes) assert(len(fw_states) == len(diff_nodes)) # swap each differentiable graph with optimized graph in their execution plan for n, state in zip(diff_nodes, fw_states): fw_execution_plans = list(state.execution_plans.values()) # we can only update the subgraph when there's a unique execution # plan. Avoid assert here so we would skip the ones that can't be # updated while try the best effort to update other nodes. if len(fw_execution_plans) == 1: n.g_('Subgraph', fw_execution_plans[0].graph) return graph except Exception: # fallback approach, we just ran the graph and return the recorded optimized # graph self(*args, **kwargs) return last_executed_optimized_graph() def set_fusion_strategy(strategy: List[Tuple[str, int]]): """ Sets the type and number of specializations that can occur during fusion. Usage: provide a list of pairs (type, depth) where type is one of "STATIC" or "DYNAMIC" and depth is an integer. Behavior - static vs dynamic: In STATIC fusion, fused ops are compiled to have fixed input shapes. The shape is determined based on some initial profiling runs. In DYNAMIC fusion, fused ops are compiled to have variable input shapes, so that multiple shapes are possible. In both cases, we also recompile on new striding behavior, device, or dtype. Behavior - fallback functions & depth: When an input doesn't match the format required by the specialized compiled op, it will run a fallback function. Fallback functions are recursively be compiled and specialized based on the observed tensor shapes. Since compilation can be slow, the "depth" parameter is provided to limit the number of specializations that can be compiled, before giving up on recompiling and falling back to a completely un-fused, un-specialized implementation. The list of (type, depth) pairs controls the type of specializations and the number of specializations. For example: [("STATIC", 2), ("DYNAMIC", 2)] indicates that the first two specializations will use static fusions, the following two specializations will use dynamic fusion, and any inputs that satisfy none of the 4 options will run an unfused implementation. NB: in the future, if more as more fusion backends are added there may be more granular apis for specific fusers. """ return torch._C._jit_set_fusion_strategy(strategy)
[ 1, 529, 276, 1112, 420, 29958, 14042, 29882, 2776, 29954, 2985, 29914, 2272, 7345, 305, 13, 5215, 3030, 1982, 13, 13, 5215, 4842, 305, 13, 3166, 19229, 1053, 2391, 29892, 12603, 552, 13, 13, 29992, 4703, 1982, 29889, 4703, 12847, 13, 1753, 27545, 29918, 22256, 29898, 9344, 29918, 20640, 675, 1125, 13, 1678, 9995, 13, 1678, 319, 3030, 8455, 393, 11761, 3692, 278, 435, 1806, 29915, 29879, 2279, 3406, 674, 1065, 13, 1678, 5994, 17063, 1434, 14012, 263, 740, 29889, 13, 1678, 9995, 13, 1678, 6087, 29918, 15581, 353, 4842, 305, 3032, 29907, 3032, 657, 29918, 4262, 29918, 4258, 3406, 29918, 20640, 675, 580, 13, 1678, 4842, 305, 3032, 29907, 3032, 842, 29918, 4262, 29918, 4258, 3406, 29918, 20640, 675, 29898, 9344, 29918, 20640, 675, 29897, 13, 1678, 1018, 29901, 13, 4706, 7709, 13, 1678, 7146, 29901, 13, 4706, 4842, 305, 3032, 29907, 3032, 842, 29918, 4262, 29918, 4258, 3406, 29918, 20640, 675, 29898, 303, 4395, 29918, 15581, 29897, 13, 13, 29992, 4703, 1982, 29889, 4703, 12847, 13, 1753, 285, 1792, 29898, 978, 1125, 13, 1678, 9995, 13, 1678, 319, 3030, 8455, 393, 16089, 277, 1078, 21293, 1546, 13, 1678, 14998, 285, 7193, 29889, 13, 13, 1678, 15758, 2983, 29901, 13, 1678, 334, 4954, 29888, 1792, 29900, 16159, 448, 28936, 871, 25000, 285, 1792, 13, 1678, 334, 4954, 29888, 1792, 29896, 16159, 448, 28936, 871, 405, 15868, 13, 1678, 334, 4954, 29888, 1792, 29906, 16159, 448, 28936, 871, 302, 29894, 29943, 1792, 13, 1678, 9995, 13, 1678, 2030, 29918, 21970, 29918, 29888, 1509, 353, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 21970, 580, 13, 1678, 2030, 29918, 29887, 3746, 29918, 29888, 1509, 353, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 29887, 3746, 580, 13, 1678, 2030, 29918, 4776, 558, 29918, 29888, 1792, 29918, 3859, 353, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 4776, 558, 29918, 29888, 1792, 29918, 17590, 580, 13, 1678, 2030, 29918, 29876, 29894, 29888, 1792, 29918, 3859, 353, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 29876, 29894, 29888, 1792, 29918, 17590, 580, 13, 1678, 565, 1024, 1275, 525, 29888, 1792, 29900, 2396, 29871, 396, 25000, 285, 1792, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 15752, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 21970, 29898, 5574, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 15752, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 29887, 3746, 29898, 5574, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 4776, 558, 29918, 29888, 1792, 29918, 17590, 29898, 8824, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 29876, 29894, 29888, 1792, 29918, 17590, 29898, 8824, 29897, 13, 1678, 25342, 1024, 1275, 525, 29888, 1792, 29896, 2396, 29871, 396, 405, 15868, 13, 4706, 2030, 29918, 771, 1777, 292, 29918, 4258, 3406, 353, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 771, 1777, 292, 29918, 4258, 3406, 29898, 5574, 29897, 13, 4706, 2030, 29918, 771, 1777, 292, 29918, 8513, 353, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 771, 1777, 292, 29918, 8513, 29898, 5574, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 15752, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 21970, 29898, 5574, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 15752, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 29887, 3746, 29898, 5574, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 4776, 558, 29918, 29888, 1792, 29918, 17590, 29898, 5574, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 29876, 29894, 29888, 1792, 29918, 17590, 29898, 8824, 29897, 13, 1678, 25342, 1024, 1275, 525, 29888, 1792, 29906, 2396, 29871, 396, 302, 29894, 29943, 1792, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 15752, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 21970, 29898, 8824, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 15752, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 29887, 3746, 29898, 8824, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 4776, 558, 29918, 29888, 1792, 29918, 17590, 29898, 8824, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 29876, 29894, 29888, 1792, 29918, 17590, 29898, 5574, 29897, 13, 1678, 1683, 29901, 13, 4706, 12020, 8960, 703, 348, 29423, 1891, 285, 1792, 2984, 1159, 13, 1678, 1018, 29901, 13, 4706, 7709, 13, 1678, 7146, 29901, 13, 4706, 565, 1024, 1275, 525, 29888, 1792, 29896, 2396, 29871, 396, 405, 15868, 13, 9651, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 771, 1777, 292, 29918, 4258, 3406, 29898, 1025, 29918, 771, 1777, 292, 29918, 4258, 3406, 29897, 13, 9651, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 771, 1777, 292, 29918, 8513, 29898, 1025, 29918, 771, 1777, 292, 29918, 8513, 29897, 13, 4706, 396, 9792, 278, 3517, 1819, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 15752, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 21970, 29898, 1025, 29918, 21970, 29918, 29888, 1509, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 15752, 29918, 3068, 29918, 29888, 1509, 29918, 265, 29918, 29887, 3746, 29898, 1025, 29918, 29887, 3746, 29918, 29888, 1509, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 4776, 558, 29918, 29888, 1792, 29918, 17590, 29898, 1025, 29918, 4776, 558, 29918, 29888, 1792, 29918, 3859, 29897, 13, 4706, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 29876, 29894, 29888, 1792, 29918, 17590, 29898, 1025, 29918, 29876, 29894, 29888, 1792, 29918, 3859, 29897, 13, 13, 13, 4230, 29918, 4258, 3860, 29918, 20640, 1891, 29918, 4262, 353, 4842, 305, 3032, 29907, 3032, 4230, 29918, 4258, 3860, 29918, 20640, 1891, 29918, 4262, 13, 13, 1753, 903, 657, 29918, 29881, 8349, 7268, 519, 29918, 4262, 29918, 3177, 29898, 3177, 29892, 2923, 29918, 3177, 1125, 13, 1678, 565, 2943, 29889, 14380, 580, 1275, 525, 9469, 1057, 29928, 8349, 7268, 519, 9527, 2396, 13, 4706, 2923, 29918, 3177, 29889, 4397, 29898, 3177, 29897, 13, 1678, 1683, 29901, 13, 4706, 363, 2908, 297, 2943, 29889, 1271, 29879, 7295, 13, 9651, 363, 302, 297, 2908, 29889, 18010, 7295, 13, 18884, 903, 657, 29918, 29881, 8349, 7268, 519, 29918, 4262, 29918, 3177, 29898, 29876, 29892, 2923, 29918, 3177, 29897, 13, 13, 1753, 903, 4262, 29918, 1454, 29898, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 1678, 736, 903, 2154, 29918, 5696, 29918, 4262, 29918, 1454, 29898, 1311, 29892, 1583, 29892, 334, 5085, 29892, 3579, 19290, 29897, 13, 13, 1753, 903, 2154, 29918, 5696, 29918, 4262, 29918, 1454, 29898, 1311, 29892, 3847, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 1678, 1018, 29901, 13, 4706, 4833, 29879, 353, 3847, 29889, 657, 29918, 8382, 29918, 3859, 580, 13, 4706, 321, 567, 353, 1051, 29898, 2585, 29879, 29889, 22256, 29918, 572, 550, 29889, 5975, 3101, 13, 4706, 4974, 29898, 2435, 29898, 8961, 29897, 1275, 29871, 29896, 29897, 13, 4706, 3983, 353, 321, 567, 29961, 29900, 1822, 4262, 29889, 8552, 580, 13, 13, 4706, 396, 3983, 29918, 4258, 3406, 29918, 28631, 363, 17473, 519, 2943, 13, 4706, 285, 29893, 29918, 28631, 353, 321, 567, 29961, 29900, 1822, 401, 29889, 29881, 8349, 7268, 519, 29918, 459, 29918, 4258, 3406, 29918, 28631, 580, 13, 4706, 2923, 29918, 18010, 29901, 2391, 29961, 7345, 305, 3032, 29907, 29889, 4247, 29962, 353, 5159, 13, 4706, 363, 302, 297, 3983, 29889, 18010, 7295, 13, 9651, 903, 657, 29918, 29881, 8349, 7268, 519, 29918, 4262, 29918, 3177, 29898, 29876, 29892, 2923, 29918, 18010, 29897, 13, 13, 4706, 4974, 29898, 2435, 29898, 25051, 29918, 28631, 29897, 1275, 7431, 29898, 12765, 29918, 18010, 876, 13, 4706, 396, 17945, 1269, 17473, 519, 3983, 411, 27545, 3983, 297, 1009, 8225, 3814, 13, 4706, 363, 302, 29892, 2106, 297, 14319, 29898, 12765, 29918, 18010, 29892, 285, 29893, 29918, 28631, 1125, 13, 9651, 285, 29893, 29918, 22256, 29918, 572, 550, 353, 1051, 29898, 3859, 29889, 22256, 29918, 572, 550, 29889, 5975, 3101, 13, 9651, 396, 591, 508, 871, 2767, 278, 1014, 4262, 746, 727, 29915, 29879, 263, 5412, 8225, 13, 9651, 396, 3814, 29889, 319, 5405, 4974, 1244, 577, 591, 723, 14383, 278, 6743, 393, 508, 29915, 29873, 367, 13, 9651, 396, 4784, 1550, 1018, 278, 1900, 7225, 304, 2767, 916, 7573, 29889, 13, 9651, 565, 7431, 29898, 25051, 29918, 22256, 29918, 572, 550, 29897, 1275, 29871, 29896, 29901, 13, 18884, 302, 29889, 29887, 29918, 877, 4035, 4262, 742, 285, 29893, 29918, 22256, 29918, 572, 550, 29961, 29900, 1822, 4262, 29897, 13, 13, 4706, 736, 3983, 13, 1678, 5174, 8960, 29901, 13, 4706, 396, 6416, 1627, 2948, 29892, 591, 925, 6350, 278, 3983, 322, 736, 278, 10478, 27545, 13, 4706, 396, 3983, 13, 4706, 1583, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 736, 1833, 29918, 4258, 3860, 29918, 20640, 1891, 29918, 4262, 580, 13, 13, 1753, 731, 29918, 29888, 3958, 29918, 710, 8963, 29898, 710, 8963, 29901, 2391, 29961, 23215, 552, 29961, 710, 29892, 938, 5262, 1125, 13, 1678, 9995, 13, 1678, 317, 1691, 278, 1134, 322, 1353, 310, 4266, 17063, 393, 508, 6403, 2645, 21736, 29889, 13, 13, 1678, 10783, 482, 29901, 3867, 263, 1051, 310, 11000, 313, 1853, 29892, 10809, 29897, 988, 1134, 338, 697, 310, 376, 17816, 2965, 29908, 470, 376, 29928, 29979, 3521, 29924, 2965, 29908, 13, 1678, 322, 10809, 338, 385, 6043, 29889, 13, 13, 1678, 1522, 16300, 448, 2294, 7186, 7343, 29901, 13, 4706, 512, 6850, 1299, 2965, 21736, 29892, 285, 3880, 288, 567, 526, 13126, 304, 505, 4343, 1881, 25834, 29889, 450, 8267, 338, 10087, 13, 4706, 2729, 373, 777, 2847, 20077, 292, 6057, 29889, 13, 4706, 512, 360, 29979, 3521, 29924, 2965, 21736, 29892, 285, 3880, 288, 567, 526, 13126, 304, 505, 2286, 1881, 25834, 29892, 577, 393, 2999, 13, 4706, 25834, 526, 1950, 29889, 13, 13, 1678, 512, 1716, 4251, 29892, 591, 884, 337, 12198, 373, 716, 851, 4821, 6030, 29892, 4742, 29892, 470, 26688, 29889, 13, 13, 1678, 1522, 16300, 448, 6416, 1627, 3168, 669, 10809, 29901, 13, 4706, 1932, 385, 1881, 1838, 29915, 29873, 1993, 278, 3402, 3734, 491, 278, 4266, 1891, 13126, 1015, 29892, 372, 674, 1065, 13, 4706, 263, 6416, 1627, 740, 29889, 14053, 1627, 3168, 526, 8304, 3598, 367, 13126, 322, 4266, 1891, 2729, 13, 4706, 373, 278, 8900, 12489, 25834, 29889, 4001, 14835, 508, 367, 5232, 29892, 278, 376, 19488, 29908, 3443, 338, 4944, 304, 13, 4706, 4046, 278, 1353, 310, 4266, 17063, 393, 508, 367, 13126, 29892, 1434, 6820, 701, 373, 337, 2388, 6504, 322, 13, 4706, 20327, 1250, 304, 263, 6446, 443, 29899, 29888, 3880, 29892, 443, 29899, 18732, 1891, 5314, 29889, 13, 13, 1678, 450, 1051, 310, 313, 1853, 29892, 10809, 29897, 11000, 11761, 278, 1134, 310, 4266, 17063, 322, 278, 1353, 310, 13, 1678, 4266, 17063, 29889, 1152, 1342, 29901, 518, 703, 17816, 2965, 613, 29871, 29906, 511, 4852, 29928, 29979, 3521, 29924, 2965, 613, 29871, 29906, 4638, 14088, 393, 278, 937, 13, 1678, 1023, 4266, 17063, 674, 671, 2294, 16451, 1080, 29892, 278, 1494, 1023, 4266, 17063, 674, 671, 13, 1678, 7343, 21736, 29892, 322, 738, 10970, 393, 15523, 5642, 310, 278, 29871, 29946, 3987, 674, 1065, 385, 13, 1678, 29395, 3880, 5314, 29889, 13, 13, 1678, 405, 29933, 29901, 297, 278, 5434, 29892, 565, 901, 408, 901, 21736, 1250, 1975, 526, 2715, 727, 1122, 367, 901, 3803, 1070, 13, 1678, 3095, 275, 363, 2702, 285, 7193, 29889, 13, 1678, 9995, 13, 1678, 736, 4842, 305, 3032, 29907, 3032, 29926, 277, 29918, 842, 29918, 29888, 3958, 29918, 710, 8963, 29898, 710, 8963, 29897, 13, 2 ]
estimate.py
rxm562/SeismoPi
0
173639
""" This file to define Estimate various parameters """ import numpy as np import pandas as pd from scipy.spatial import distance import matplotlib.pyplot as plt import networkx as nx from pyproj import Proj from pyproj import Proj, transform # trasforming latlong into mercetor coordinates def tran(data): utmxy = {} rx=[] ry=[] for index, row in data.iterrows(): x = row['x'] y = row['y'] inProj = Proj(init='epsg:4326') outProj = Proj(init='epsg:3395') cz = transform(inProj,outProj,x,y) r1=cz[0] r2=cz[1] rx.append(r1) ry.append(r2) rx=np.array(rx) ry=np.array(ry) return rx,ry # data1 and data2 should be node and link, respectively def Length(data1,data2): dist=[] for index, row in data2.iterrows(): sp=data1[data1.id==row['start_node']] start_x, start_y = (list(sp.x),list(sp.y)) ep=data1[data1.id==row['end_node']] end_x,end_y=(list(ep.x),list(ep.y)) lal = distance.euclidean((start_x, start_y),(end_x,end_y)) dist.append(lal) dist=np.array(dist) return dist # data1 and data2 should be node and link, respectively def C_Check(data): maint=[] for index,row in data.iterrows(): if (row['ind']>=0.5) & (row['dl']>0): mm=2 elif (row['ind']<0.5) & (row['dl']>0): mm=1 else: mm=0 maint.append(mm) maint=np.array(maint) return maint def C_Est(data): cost=[] for index,row in data.iterrows(): if (row['MA']==1): mm=row['repair_C']*row['nNoB'] elif (row['MA']==2): mm=row['replace_C'] else: mm=0 cost.append(mm) cost=np.array(cost) return cost def T_cost(data,pipe_cost=None): """ """ nrpr = [] nrpl = [] network_cost = 0 if pipe_cost is None: diameter = [4, 6, 8, 10, 12, 14, 16, 18, 20, 24, 28, 30, 32, 34, 36] # inch rpl = [600, 630, 675, 750, 825, 1200, 1950, 2400, 2700, 3450, 4350, 4650, 5250, 5700, 6300] # replace cost/m rpr = [400, 420, 450, 500, 550, 800, 1300, 1600, 1800, 2300, 2900, 3100, 3500, 3800, 4200] # repair cost # diameter = np.array(diameter)*0.0254 # m repair_cost = pd.Series(rpr,diameter) replace_cost = pd.Series(rpl,diameter) # Pipe construction cost for index, row in data.iterrows(): dia = row['dia'] length=row['link_m'] idxrpr = np.argmin([np.abs(repair_cost.index - dia)]) idxrpl = np.argmin([np.abs(replace_cost.index - dia)]) #print(link_name, pipe_cost.iloc[idx], link.length) repair_C = network_cost + repair_cost.iloc[idxrpr] replace_C = network_cost + replace_cost.iloc[idxrpl]*length nrpr.append(repair_C) nrpl.append(replace_C) nrpr = np.array(nrpr) nrpl = np.array(nrpl) return nrpr,nrpl
[ 1, 9995, 13, 4013, 934, 304, 4529, 2661, 6490, 5164, 4128, 13, 15945, 29908, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 11701, 408, 10518, 13, 3166, 4560, 2272, 29889, 1028, 15238, 1053, 5418, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 5215, 3564, 29916, 408, 302, 29916, 13, 3166, 11451, 20865, 1053, 1019, 29926, 13, 3166, 11451, 20865, 1053, 1019, 29926, 29892, 4327, 13, 13, 13, 29937, 6809, 689, 292, 3405, 5426, 964, 16856, 300, 272, 10350, 13, 1753, 22024, 29898, 1272, 1125, 268, 13, 1678, 3477, 29885, 3594, 353, 6571, 13, 1678, 364, 29916, 29922, 2636, 13, 1678, 24721, 29922, 2636, 13, 1678, 363, 2380, 29892, 1948, 297, 848, 29889, 1524, 5727, 7295, 13, 4706, 921, 353, 1948, 1839, 29916, 2033, 13, 4706, 343, 353, 1948, 1839, 29891, 2033, 13, 4706, 297, 1184, 29926, 353, 1019, 29926, 29898, 2344, 2433, 8961, 29887, 29901, 29946, 29941, 29906, 29953, 1495, 13, 4706, 714, 1184, 29926, 353, 1019, 29926, 29898, 2344, 2433, 8961, 29887, 29901, 29941, 29941, 29929, 29945, 1495, 13, 4706, 5316, 353, 4327, 29898, 262, 1184, 29926, 29892, 449, 1184, 29926, 29892, 29916, 29892, 29891, 29897, 13, 4706, 364, 29896, 29922, 2067, 29961, 29900, 29962, 13, 4706, 364, 29906, 29922, 2067, 29961, 29896, 29962, 13, 4706, 364, 29916, 29889, 4397, 29898, 29878, 29896, 29897, 13, 4706, 24721, 29889, 4397, 29898, 29878, 29906, 29897, 13, 1678, 364, 29916, 29922, 9302, 29889, 2378, 29898, 17697, 29897, 13, 1678, 24721, 29922, 9302, 29889, 2378, 29898, 719, 29897, 13, 1678, 736, 364, 29916, 29892, 719, 13, 13, 13, 29937, 848, 29896, 322, 848, 29906, 881, 367, 2943, 322, 1544, 29892, 8307, 13, 1753, 365, 1477, 29898, 1272, 29896, 29892, 1272, 29906, 1125, 259, 13, 1678, 1320, 29922, 2636, 13, 1678, 363, 2380, 29892, 1948, 297, 848, 29906, 29889, 1524, 5727, 7295, 13, 4706, 805, 29922, 1272, 29896, 29961, 1272, 29896, 29889, 333, 1360, 798, 1839, 2962, 29918, 3177, 2033, 29962, 13, 4706, 1369, 29918, 29916, 29892, 1369, 29918, 29891, 353, 313, 1761, 29898, 1028, 29889, 29916, 511, 1761, 29898, 1028, 29889, 29891, 876, 13, 4706, 9358, 29922, 1272, 29896, 29961, 1272, 29896, 29889, 333, 1360, 798, 1839, 355, 29918, 3177, 2033, 29962, 13, 4706, 1095, 29918, 29916, 29892, 355, 29918, 29891, 7607, 1761, 29898, 1022, 29889, 29916, 511, 1761, 29898, 1022, 29889, 29891, 876, 13, 4706, 301, 284, 353, 5418, 29889, 29872, 27511, 3552, 2962, 29918, 29916, 29892, 1369, 29918, 29891, 21336, 355, 29918, 29916, 29892, 355, 29918, 29891, 876, 13, 4706, 1320, 29889, 4397, 29898, 29880, 284, 29897, 13, 1678, 1320, 29922, 9302, 29889, 2378, 29898, 5721, 29897, 13, 1678, 736, 1320, 13, 13, 13, 29937, 848, 29896, 322, 848, 29906, 881, 367, 2943, 322, 1544, 29892, 8307, 13, 1753, 315, 29918, 5596, 29898, 1272, 1125, 259, 13, 1678, 1667, 29873, 29922, 2636, 13, 1678, 363, 2380, 29892, 798, 297, 848, 29889, 1524, 5727, 7295, 13, 4706, 565, 313, 798, 1839, 513, 2033, 18572, 29900, 29889, 29945, 29897, 669, 313, 798, 1839, 11671, 2033, 29958, 29900, 1125, 13, 9651, 5654, 29922, 29906, 13, 4706, 25342, 313, 798, 1839, 513, 2033, 29966, 29900, 29889, 29945, 29897, 669, 313, 798, 1839, 11671, 2033, 29958, 29900, 1125, 13, 9651, 5654, 29922, 29896, 13, 4706, 1683, 29901, 13, 9651, 5654, 29922, 29900, 13, 4706, 1667, 29873, 29889, 4397, 29898, 4317, 29897, 13, 1678, 1667, 29873, 29922, 9302, 29889, 2378, 29898, 29885, 2365, 29897, 13, 1678, 736, 1667, 29873, 13, 13, 13, 1753, 315, 29918, 12787, 29898, 1272, 1125, 259, 13, 1678, 3438, 29922, 2636, 13, 1678, 363, 2380, 29892, 798, 297, 848, 29889, 1524, 5727, 7295, 13, 4706, 565, 313, 798, 1839, 1529, 2033, 1360, 29896, 1125, 13, 9651, 5654, 29922, 798, 1839, 3445, 1466, 29918, 29907, 2033, 29930, 798, 1839, 29876, 3782, 29933, 2033, 13, 4706, 25342, 313, 798, 1839, 1529, 2033, 1360, 29906, 1125, 13, 9651, 5654, 29922, 798, 1839, 6506, 29918, 29907, 2033, 13, 4706, 1683, 29901, 13, 9651, 5654, 29922, 29900, 13, 4706, 3438, 29889, 4397, 29898, 4317, 29897, 13, 1678, 3438, 29922, 9302, 29889, 2378, 29898, 18253, 29897, 13, 1678, 736, 3438, 13, 13, 1753, 323, 29918, 18253, 29898, 1272, 29892, 17760, 29918, 18253, 29922, 8516, 1125, 13, 1678, 9995, 29871, 13, 1678, 9995, 13, 1678, 17114, 558, 353, 5159, 13, 1678, 17114, 572, 353, 5159, 13, 13, 1678, 3564, 29918, 18253, 353, 29871, 29900, 13, 308, 13, 1678, 565, 14282, 29918, 18253, 338, 6213, 29901, 13, 4706, 24235, 353, 518, 29946, 29892, 29871, 29953, 29892, 29871, 29947, 29892, 29871, 29896, 29900, 29892, 29871, 29896, 29906, 29892, 29871, 29896, 29946, 29892, 29871, 29896, 29953, 29892, 29871, 29896, 29947, 29892, 29871, 29906, 29900, 29892, 29871, 29906, 29946, 29892, 29871, 29906, 29947, 29892, 29871, 29941, 29900, 29892, 29871, 29941, 29906, 29892, 29871, 29941, 29946, 29892, 29871, 29941, 29953, 29962, 396, 297, 305, 13, 4706, 364, 572, 353, 518, 29953, 29900, 29900, 29892, 29871, 29953, 29941, 29900, 29892, 29871, 29953, 29955, 29945, 29892, 29871, 29955, 29945, 29900, 29892, 29871, 29947, 29906, 29945, 29892, 29871, 29896, 29906, 29900, 29900, 29892, 29871, 29896, 29929, 29945, 29900, 29892, 29871, 29906, 29946, 29900, 29900, 29892, 29871, 29906, 29955, 29900, 29900, 29892, 29871, 29941, 29946, 29945, 29900, 29892, 29871, 29946, 29941, 29945, 29900, 29892, 29871, 29946, 29953, 29945, 29900, 29892, 29871, 29945, 29906, 29945, 29900, 29892, 29871, 29945, 29955, 29900, 29900, 29892, 29871, 29953, 29941, 29900, 29900, 29962, 396, 5191, 3438, 29914, 29885, 13, 4706, 364, 558, 353, 518, 29946, 29900, 29900, 29892, 29871, 29946, 29906, 29900, 29892, 29871, 29946, 29945, 29900, 29892, 29871, 29945, 29900, 29900, 29892, 29871, 29945, 29945, 29900, 29892, 29871, 29947, 29900, 29900, 29892, 29871, 29896, 29941, 29900, 29900, 29892, 29871, 29896, 29953, 29900, 29900, 29892, 29871, 29896, 29947, 29900, 29900, 29892, 29871, 29906, 29941, 29900, 29900, 29892, 29871, 29906, 29929, 29900, 29900, 29892, 29871, 29941, 29896, 29900, 29900, 29892, 29871, 29941, 29945, 29900, 29900, 29892, 29871, 29941, 29947, 29900, 29900, 29892, 29871, 29946, 29906, 29900, 29900, 29962, 396, 26032, 3438, 13, 308, 13, 29937, 308, 24235, 353, 7442, 29889, 2378, 29898, 29881, 2829, 1308, 11877, 29900, 29889, 29900, 29906, 29945, 29946, 396, 286, 13, 4706, 26032, 29918, 18253, 353, 10518, 29889, 19204, 29898, 29878, 558, 29892, 29881, 2829, 1308, 29897, 308, 13, 4706, 5191, 29918, 18253, 353, 10518, 29889, 19204, 29898, 29878, 572, 29892, 29881, 2829, 1308, 29897, 308, 13, 13, 1678, 396, 7362, 412, 7632, 3438, 13, 1678, 363, 2380, 29892, 1948, 297, 848, 29889, 1524, 5727, 7295, 13, 4706, 9766, 353, 1948, 1839, 15321, 2033, 13, 4706, 3309, 29922, 798, 1839, 2324, 29918, 29885, 2033, 13, 4706, 22645, 29878, 558, 353, 7442, 29889, 1191, 1195, 4197, 9302, 29889, 6897, 29898, 3445, 1466, 29918, 18253, 29889, 2248, 448, 9766, 29897, 2314, 13, 4706, 22645, 29878, 572, 353, 7442, 29889, 1191, 1195, 4197, 9302, 29889, 6897, 29898, 6506, 29918, 18253, 29889, 2248, 448, 9766, 29897, 2314, 13, 4706, 396, 2158, 29898, 2324, 29918, 978, 29892, 14282, 29918, 18253, 29889, 309, 542, 29961, 13140, 1402, 1544, 29889, 2848, 29897, 13, 4706, 26032, 29918, 29907, 353, 3564, 29918, 18253, 718, 26032, 29918, 18253, 29889, 309, 542, 29961, 13140, 29878, 558, 29962, 13, 4706, 5191, 29918, 29907, 353, 3564, 29918, 18253, 718, 5191, 29918, 18253, 29889, 309, 542, 29961, 13140, 29878, 572, 14178, 2848, 13, 4706, 17114, 558, 29889, 4397, 29898, 3445, 1466, 29918, 29907, 29897, 13, 4706, 17114, 572, 29889, 4397, 29898, 6506, 29918, 29907, 29897, 13, 1678, 17114, 558, 353, 7442, 29889, 2378, 29898, 22230, 558, 29897, 13, 1678, 17114, 572, 353, 7442, 29889, 2378, 29898, 22230, 572, 29897, 13, 13, 308, 13, 1678, 736, 17114, 558, 29892, 22230, 572, 13, 2 ]
tests/algorithms/test_rigid_body.py
UCL/scikit-surgeryarucotracker
0
161996
<reponame>UCL/scikit-surgeryarucotracker<filename>tests/algorithms/test_rigid_body.py # -*- coding: utf-8 -*- """Tests for the rigid body classes""" import pytest import numpy as np from cv2 import aruco import sksurgeryarucotracker.algorithms.rigid_bodies as rgbd # pylint: disable=no-member def test_rigid_body_init(): """ Test class initialises """ #pylint: disable=protected-access rigid_body = rgbd.ArUcoRigidBody(rigid_body_name = 'test') rigid_body.load_3d_points('data/reference.txt', 'DICT_ARUCO_ORIGINAL') pattern_wdth = min(np.ptp([i[:,0] for i in rigid_body._ar_board.objPoints]), np.ptp([i[:,1] for i in rigid_body._ar_board.objPoints])) assert pattern_wdth == 49.50 rigid_body.scale_3d_tags(measured_pattern_width = 10) pattern_wdth = min(np.ptp([i[:,0] for i in rigid_body._ar_board.objPoints]), np.ptp([i[:,1] for i in rigid_body._ar_board.objPoints])) assert pattern_wdth == 10.00 def test_make_aruco_no_board(): """ Test for make aruco board fails when no board entries """ with pytest.raises(ValueError): board = np.zeros((0,0),dtype = np.float64) rgbd._make_aruco_board(board, aruco.DICT_ARUCO_ORIGINAL) \ #pylint: disable=protected-access def test_make_aruco_wrong_board(): """ Test for make aruco board fails when no board is wrong shape """ with pytest.raises(ValueError): board = np.zeros((1,4),dtype = np.float64) rgbd._make_aruco_board(board, aruco.DICT_ARUCO_ORIGINAL) \ #pylint: disable=protected-access def test_configuration(): """ Tests for the configuration routine. """ #should throw a value error if there is no filename configuration = { 'rigid bodies' : [{}] } with pytest.raises(ValueError): rgbd.configure_rigid_bodies(configuration) #should throw a value error for a made up dictionary configuration = { 'rigid bodies' : [{ 'filename' : 'data/reference.txt', 'aruco dictionary' : 'made up' }] } with pytest.raises(ImportError): rgbd.configure_rigid_bodies(configuration)
[ 1, 529, 276, 1112, 420, 29958, 29965, 6154, 29914, 26167, 7354, 29899, 29879, 2007, 708, 279, 1682, 327, 336, 4937, 29966, 9507, 29958, 21150, 29914, 9564, 12404, 29914, 1688, 29918, 8966, 333, 29918, 2587, 29889, 2272, 13, 29937, 29871, 448, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 15945, 29908, 24376, 363, 278, 12912, 333, 3573, 4413, 15945, 29908, 13, 5215, 11451, 1688, 13, 5215, 12655, 408, 7442, 13, 3166, 13850, 29906, 1053, 564, 29884, 1111, 13, 5215, 269, 2039, 2007, 708, 279, 1682, 327, 336, 4937, 29889, 9564, 12404, 29889, 8966, 333, 29918, 29890, 397, 583, 408, 15552, 6448, 13, 13, 29937, 282, 2904, 524, 29901, 11262, 29922, 1217, 29899, 14242, 13, 13, 1753, 1243, 29918, 8966, 333, 29918, 2587, 29918, 2344, 7295, 13, 1678, 9995, 13, 1678, 4321, 770, 2847, 4637, 13, 1678, 9995, 13, 1678, 396, 2272, 27854, 29901, 11262, 29922, 24681, 29899, 5943, 13, 1678, 12912, 333, 29918, 2587, 353, 15552, 6448, 29889, 1433, 29965, 1111, 29934, 335, 333, 8434, 29898, 8966, 333, 29918, 2587, 29918, 978, 353, 525, 1688, 1495, 13, 13, 1678, 12912, 333, 29918, 2587, 29889, 1359, 29918, 29941, 29881, 29918, 9748, 877, 1272, 29914, 5679, 29889, 3945, 742, 525, 4571, 1783, 29918, 1718, 29965, 3217, 29918, 1955, 6259, 1177, 1964, 1495, 13, 1678, 4766, 29918, 9970, 386, 353, 1375, 29898, 9302, 29889, 415, 29886, 4197, 29875, 7503, 29892, 29900, 29962, 363, 474, 297, 12912, 333, 29918, 2587, 3032, 279, 29918, 3377, 29889, 5415, 20325, 11724, 13, 462, 539, 7442, 29889, 415, 29886, 4197, 29875, 7503, 29892, 29896, 29962, 363, 474, 297, 12912, 333, 29918, 2587, 3032, 279, 29918, 3377, 29889, 5415, 20325, 12622, 13, 1678, 4974, 4766, 29918, 9970, 386, 1275, 29871, 29946, 29929, 29889, 29945, 29900, 13, 13, 1678, 12912, 333, 29918, 2587, 29889, 7052, 29918, 29941, 29881, 29918, 11338, 29898, 1004, 294, 2955, 29918, 11037, 29918, 2103, 353, 29871, 29896, 29900, 29897, 13, 1678, 4766, 29918, 9970, 386, 353, 1375, 29898, 9302, 29889, 415, 29886, 4197, 29875, 7503, 29892, 29900, 29962, 363, 474, 297, 12912, 333, 29918, 2587, 3032, 279, 29918, 3377, 29889, 5415, 20325, 11724, 13, 462, 539, 7442, 29889, 415, 29886, 4197, 29875, 7503, 29892, 29896, 29962, 363, 474, 297, 12912, 333, 29918, 2587, 3032, 279, 29918, 3377, 29889, 5415, 20325, 12622, 13, 1678, 4974, 4766, 29918, 9970, 386, 1275, 29871, 29896, 29900, 29889, 29900, 29900, 13, 13, 13, 1753, 1243, 29918, 5675, 29918, 18071, 1111, 29918, 1217, 29918, 3377, 7295, 13, 1678, 9995, 13, 1678, 4321, 363, 1207, 564, 29884, 1111, 7613, 8465, 746, 694, 7613, 9976, 13, 1678, 9995, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 7613, 353, 7442, 29889, 3298, 359, 3552, 29900, 29892, 29900, 511, 29881, 1853, 353, 7442, 29889, 7411, 29953, 29946, 29897, 13, 4706, 15552, 6448, 3032, 5675, 29918, 18071, 1111, 29918, 3377, 29898, 3377, 29892, 564, 29884, 1111, 29889, 4571, 1783, 29918, 1718, 29965, 3217, 29918, 1955, 6259, 1177, 1964, 29897, 320, 13, 462, 4706, 396, 2272, 27854, 29901, 11262, 29922, 24681, 29899, 5943, 13, 13, 1753, 1243, 29918, 5675, 29918, 18071, 1111, 29918, 15866, 549, 29918, 3377, 7295, 13, 1678, 9995, 13, 1678, 4321, 363, 1207, 564, 29884, 1111, 7613, 8465, 746, 694, 7613, 338, 2743, 8267, 13, 1678, 9995, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 7613, 353, 7442, 29889, 3298, 359, 3552, 29896, 29892, 29946, 511, 29881, 1853, 353, 7442, 29889, 7411, 29953, 29946, 29897, 13, 4706, 15552, 6448, 3032, 5675, 29918, 18071, 1111, 29918, 3377, 29898, 3377, 29892, 564, 29884, 1111, 29889, 4571, 1783, 29918, 1718, 29965, 3217, 29918, 1955, 6259, 1177, 1964, 29897, 320, 13, 462, 4706, 396, 2272, 27854, 29901, 11262, 29922, 24681, 29899, 5943, 13, 13, 13, 1753, 1243, 29918, 13305, 7295, 13, 1678, 9995, 13, 1678, 4321, 29879, 363, 278, 5285, 26529, 29889, 13, 1678, 9995, 13, 1678, 396, 9344, 3183, 263, 995, 1059, 565, 727, 338, 694, 10422, 13, 1678, 5285, 353, 426, 13, 462, 4706, 525, 8966, 333, 17873, 29915, 584, 15974, 6525, 13, 462, 1678, 500, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 1917, 2392, 1125, 13, 4706, 15552, 6448, 29889, 17591, 29918, 8966, 333, 29918, 29890, 397, 583, 29898, 13305, 29897, 13, 13, 1678, 396, 9344, 3183, 263, 995, 1059, 363, 263, 1754, 701, 8600, 13, 1678, 5285, 353, 426, 13, 462, 4706, 525, 8966, 333, 17873, 29915, 584, 15974, 13, 462, 632, 525, 9507, 29915, 584, 525, 1272, 29914, 5679, 29889, 3945, 742, 13, 462, 632, 525, 18071, 1111, 8600, 29915, 584, 525, 26350, 701, 29915, 13, 462, 4706, 500, 29962, 13, 462, 1678, 500, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 17518, 2392, 1125, 13, 4706, 15552, 6448, 29889, 17591, 29918, 8966, 333, 29918, 29890, 397, 583, 29898, 13305, 29897, 13, 2 ]
ClientePY.py
G2000G/webService-java
0
95167
<filename>ClientePY.py from suds.client import Client url = "http://localhost:13000/conversor?wsdl" client = Client(url) tipo = int(input("Bem-vindo ao Conversor de Temperaturas, digite: \n1 para converter de Celsius para Kelvin: \n2 para converter de Kelvin para Celsius:\n>>> ")) temp = int(input("Digite a temperatura que deseja converter:\n>>> ")) response = client.service.conversor(tipo,temp) print(response)
[ 1, 529, 9507, 29958, 4032, 29872, 20055, 29889, 2272, 13, 3166, 5053, 29879, 29889, 4645, 1053, 12477, 30004, 13, 30004, 13, 2271, 353, 376, 1124, 597, 7640, 29901, 29896, 29941, 29900, 29900, 29900, 29914, 535, 874, 272, 29973, 29893, 29222, 19451, 13, 4645, 353, 12477, 29898, 2271, 8443, 13, 12632, 29877, 353, 938, 29898, 2080, 703, 29933, 331, 29899, 29894, 15036, 5017, 1281, 874, 272, 316, 6789, 546, 1337, 294, 29892, 4697, 568, 29901, 320, 29876, 29896, 1702, 29105, 316, 14227, 1039, 375, 1702, 27326, 3845, 29901, 320, 29876, 29906, 1702, 29105, 316, 27326, 3845, 1702, 14227, 1039, 375, 3583, 29876, 6778, 29958, 376, 876, 30004, 13, 7382, 353, 938, 29898, 2080, 703, 14991, 568, 263, 6238, 7969, 712, 553, 29872, 1764, 29105, 3583, 29876, 6778, 29958, 376, 876, 30004, 13, 5327, 353, 3132, 29889, 5509, 29889, 535, 874, 272, 29898, 12632, 29877, 29892, 7382, 8443, 13, 2158, 29898, 5327, 8443, 13, 2 ]
src/mlb_statsapi/model/api/config.py
power-edge/mlb_statsapi_etl
0
153604
<gh_stars>0 """ created by nikos at 4/26/21 """ import os.path from ..base import MLBStatsAPIEndpointModel from mlb_statsapi.utils.stats_api_object import configure_api class ConfigModel(MLBStatsAPIEndpointModel): @configure_api def awards(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def baseballStats(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def eventTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def fielderDetailTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def gameStatus(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def gameTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def gamedayTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def groupByTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def hitTrajectories(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def jobTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def languages(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def leagueLeaderTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def logicalEvents(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def metrics(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def pitchCodes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def pitchTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def platforms(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def playerStatusCodes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def positions(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def reviewReasons(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def rosterTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def runnerDetailTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def scheduleEventTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def sitCodes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def sky(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def aggregateSortEnum(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def standingsTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def statFields(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def statGroups(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def statTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def statSearchConfig(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def statSearchGroupByTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def statSearchParams(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def statSearchStats(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def transactionTypes(self, **kwargs): return self.get_api_file_object(**kwargs) @configure_api def windDirection(self, **kwargs): return self.get_api_file_object(**kwargs) @property def _methods(self): return {m.__name__: m for m in ( self.awards, self.baseballStats, self.eventTypes, self.fielderDetailTypes, self.gameStatus, self.gameTypes, self.gamedayTypes, self.groupByTypes, self.hitTrajectories, self.jobTypes, self.languages, self.leagueLeaderTypes, self.logicalEvents, self.metrics, self.pitchCodes, self.pitchTypes, self.platforms, self.playerStatusCodes, self.positions, self.reviewReasons, self.rosterTypes, self.runnerDetailTypes, self.scheduleEventTypes, self.sitCodes, self.sky, self.aggregateSortEnum, self.standingsTypes, self.statFields, self.statGroups, self.statTypes, self.statSearchConfig, self.statSearchGroupByTypes, self.statSearchParams, self.statSearchStats, self.transactionTypes, self.windDirection, )}
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 13, 11600, 491, 302, 638, 359, 472, 29871, 29946, 29914, 29906, 29953, 29914, 29906, 29896, 13, 15945, 29908, 13, 5215, 2897, 29889, 2084, 13, 13, 3166, 6317, 3188, 1053, 23158, 29933, 25060, 8787, 25602, 3195, 13, 3166, 286, 27728, 29918, 16202, 2754, 29889, 13239, 29889, 16202, 29918, 2754, 29918, 3318, 1053, 10822, 29918, 2754, 13, 13, 13, 1990, 12782, 3195, 29898, 1988, 29933, 25060, 8787, 25602, 3195, 1125, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 24441, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 21573, 25060, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 1741, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 29607, 672, 16570, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 3748, 5709, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 3748, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 330, 2795, 388, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 2318, 2059, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 7124, 5323, 622, 3842, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 4982, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 10276, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 13225, 29931, 1479, 261, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 16667, 13634, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 21556, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 15905, 29907, 2631, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 15905, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 21796, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 4847, 5709, 29907, 2631, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 11909, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 9076, 1123, 7040, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 696, 2475, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 28877, 16570, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 20410, 2624, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 7845, 29907, 2631, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 14744, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 20431, 13685, 16854, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 2317, 886, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 1002, 14256, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 1002, 24020, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 1002, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 1002, 7974, 3991, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 1002, 7974, 4782, 2059, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 1002, 7974, 9629, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 1002, 7974, 25060, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 10804, 10562, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 17591, 29918, 2754, 13, 1678, 822, 8805, 21602, 29898, 1311, 29892, 3579, 19290, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 2754, 29918, 1445, 29918, 3318, 29898, 1068, 19290, 29897, 13, 13, 1678, 732, 6799, 13, 1678, 822, 903, 23515, 29898, 1311, 1125, 736, 426, 29885, 17255, 978, 1649, 29901, 286, 363, 286, 297, 313, 13, 4706, 1583, 29889, 29874, 2935, 29892, 13, 4706, 1583, 29889, 3188, 2135, 25060, 29892, 13, 4706, 1583, 29889, 3696, 10562, 29892, 13, 4706, 1583, 29889, 29888, 709, 672, 16570, 10562, 29892, 13, 4706, 1583, 29889, 11802, 5709, 29892, 13, 4706, 1583, 29889, 11802, 10562, 29892, 13, 4706, 1583, 29889, 29887, 2795, 388, 10562, 29892, 13, 4706, 1583, 29889, 2972, 2059, 10562, 29892, 13, 4706, 1583, 29889, 27342, 5323, 622, 3842, 29892, 13, 4706, 1583, 29889, 9057, 10562, 29892, 13, 4706, 1583, 29889, 29880, 8737, 29892, 13, 4706, 1583, 29889, 280, 3437, 29931, 1479, 261, 10562, 29892, 13, 4706, 1583, 29889, 1188, 936, 13634, 29892, 13, 4706, 1583, 29889, 2527, 10817, 29892, 13, 4706, 1583, 29889, 29886, 2335, 29907, 2631, 29892, 13, 4706, 1583, 29889, 29886, 2335, 10562, 29892, 13, 4706, 1583, 29889, 12120, 29879, 29892, 13, 4706, 1583, 29889, 9106, 5709, 29907, 2631, 29892, 13, 4706, 1583, 29889, 1066, 2187, 29892, 13, 4706, 1583, 29889, 27828, 1123, 7040, 29892, 13, 4706, 1583, 29889, 307, 2475, 10562, 29892, 13, 4706, 1583, 29889, 27492, 16570, 10562, 29892, 13, 4706, 1583, 29889, 816, 11272, 2624, 10562, 29892, 13, 4706, 1583, 29889, 29879, 277, 29907, 2631, 29892, 13, 4706, 1583, 29889, 7912, 29892, 13, 4706, 1583, 29889, 26193, 403, 13685, 16854, 29892, 13, 4706, 1583, 29889, 1689, 886, 10562, 29892, 13, 4706, 1583, 29889, 6112, 14256, 29892, 13, 4706, 1583, 29889, 6112, 24020, 29892, 13, 4706, 1583, 29889, 6112, 10562, 29892, 13, 4706, 1583, 29889, 6112, 7974, 3991, 29892, 13, 4706, 1583, 29889, 6112, 7974, 4782, 2059, 10562, 29892, 13, 4706, 1583, 29889, 6112, 7974, 9629, 29892, 13, 4706, 1583, 29889, 6112, 7974, 25060, 29892, 13, 4706, 1583, 29889, 20736, 10562, 29892, 13, 4706, 1583, 29889, 14800, 21602, 29892, 13, 1678, 1723, 29913, 13, 2 ]
snoop/management/commands/doctor.py
hoover/snoop
5
92399
<filename>snoop/management/commands/doctor.py from pathlib import Path import subprocess import re import sys import urllib.request import urllib.error import json from django.core.management.base import BaseCommand from django.conf import settings from django.db import connections from django.db.utils import OperationalError ELASTICSEARCH_MIN_VERSION = (2, 0, 0) ELASTICSEARCH_MAX_VERSION = (2, 4, 4) PST_MIN_VERSION = (0, 2, 0) TIKA_MIN_VERSION = (1, 13) def path_exists(path): return Path(path).exists() def http_get_content(link): try: with urllib.request.urlopen(link) as content: return content.read() except (urllib.error.HTTPError, urllib.error.URLError): return None def get_version(exe_path, version_argument='--version', regex=r'([\d\.]+)', check_output=True, is_numeric=True): if check_output: output = subprocess.check_output([exe_path, version_argument]) else: completed = subprocess.run( [exe_path, version_argument], check=False, stderr=subprocess.STDOUT, stdout=subprocess.PIPE) output = completed.stdout string_output = str(output) matches = re.search(regex, string_output, re.MULTILINE) if not matches: return None if is_numeric: return tuple(int(x) for x in matches.group(1).split(".")) return matches.group(1) class Command(BaseCommand): help = "Sanity check for snoop. Run with no arguments." def handle(self, *args, **options): checkers = [ ('python', self.check_python, False), ('database', self.check_database, False), ('elasticsearch', self.check_es, False), ('msgconvert', self.check_msgconvert, settings.SNOOP_MSGCONVERT_SCRIPT is None), ('readpst', self.check_readpst, settings.SNOOP_READPST_BINARY is None), ('Apache Tika', self.check_tika, settings.SNOOP_TIKA_SERVER_ENDPOINT is None), ('7z', self.check_7z, settings.SNOOP_SEVENZIP_BINARY is None), ('gpg', self.check_gpg, settings.SNOOP_GPG_BINARY is None), ] have_errors = False for name, check_fun, skip in checkers: if skip: self.print_message("Skipping the check for " + name + ".") else: self.print_message("Checking " + name + ".") result = check_fun() if result: self.print_success(' ' * 9 + name + " ok.") else: have_errors = True self.print_error(name + " failed the check.") self.print_message('') if have_errors: self.print_error("The setup has failed some checks.") self.print_error("For more information please see") self.print_error("https://github.com/hoover/snoop/blob/master/Readme.md") sys.exit(1) else: self.print_success("All checks have passed.") def check_python(self): if sys.version_info[0] != 3 or sys.version_info[1] < 5: self.print_error("The Python version supplied is {}.".format(sys.version)) self.print_error("Hoover needs at least Python 3.5 to work.") self.print_error("Please use a supported version of Python.") return False return True def check_database(self): db_conn = connections['default'] try: c = db_conn.cursor() except OperationalError: self.print_error("The database settings are not valid.") self.print_error("Please check the database access data under DATABASES.") return False return True def check_msgconvert(self): msgconvert_path = settings.SNOOP_MSGCONVERT_SCRIPT if not path_exists(msgconvert_path): self.print_error("You enabled msgconvert support but") self.print_error("SNOOP_MSGCONVERT_SCRIPT is not set to a valid path.") return False version = get_version(msgconvert_path, '--help', regex='(msgconvert)', check_output=False, is_numeric=False) if not version: self.print_error("Could run the script provided in SNOOP_MSGCONVERT_SCRIPT") return False cache_dir = settings.SNOOP_MSG_CACHE if not cache_dir or not Path(cache_dir).is_dir(): self.print_error("SNOOP_MSG_CACHE does not point to a valid directory.") return False return True def check_readpst(self): readpst_path = settings.SNOOP_READPST_BINARY if not path_exists(readpst_path): self.print_error("You enabled readpst support but") self.print_error("SNOOP_READPST_BINARY is not set to a valid path.") return False version = get_version(readpst_path, '-V') if not version: self.print_error("Failed to check the readpst version.") self.print_error("Please check if SNOOP_READPST_BINARY points to a valid executable.") return False if version < PST_MIN_VERSION: self.print_error("Please install a more recent version of readpst.") return False cache_dir = settings.SNOOP_PST_CACHE_ROOT if not cache_dir or not Path(cache_dir).is_dir(): self.print_error("SNOOP_PST_CACHE_ROOT does not point to a valid directory.") return False return True def check_es(self): es_link = settings.SNOOP_ELASTICSEARCH_URL content = http_get_content(es_link) if not content: self.print_error("Could not connect to elasticsearch using") self.print_error("the link supplied in SNOOP_ELASTICSEARCH_URL.") return False try: data = json.loads(content) except json.JSONDecodeError: self.print_error("elasticsearch's response could not be decoded.") self.print_error("Please restart the elasticsearch server and try again.") return False version_string = data['version']['number'] version_string = re.sub(r'[^\d\.]+', '', version_string) version = tuple(int(x) for x in version_string.split('.')) if not ELASTICSEARCH_MIN_VERSION <= version <= ELASTICSEARCH_MAX_VERSION: self.print_error("elasticsearch is version {}, but".format(version)) self.print_error("Hoover needs elasticsearch to be in between versions") self.print_error("{} and {}".format(ELASTICSEARCH_MIN_VERSION, ELASTICSEARCH_MAX_VERSION)) return False return True def check_tika(self): tika_link = settings.SNOOP_TIKA_SERVER_ENDPOINT content = http_get_content(tika_link + "/version") if not content: self.print_error("Could not connect to Apache Tika using") self.print_error("the link supplied in SNOOP_TIKA_SERVER_ENDPOINT.") return False version_string = str(content) matches = re.search('([\d\.]+)', version_string, re.MULTILINE) if not matches: self.print_error("Apache Tika's response did not contain a valid version number.") self.print_error("Please restart the Apache Tika server and try again.") return False version_string = matches.group(1) version = tuple(int(x) for x in version_string.split('.')) if version < TIKA_MIN_VERSION: self.print_error("tika is version {}, but") self.print_error("Hoover needs tika to be at least version {}".format(TIKA_MIN_VERSION)) self.print_error("Download tika from https://tika.apache.org/download") return False return True def check_7z(self): seven_zip_path = settings.SNOOP_SEVENZIP_BINARY if not path_exists(seven_zip_path): self.print_error("You enabled 7z support but") self.print_error("SNOOP_SEVENZIP_BINARY is not set to a valid path.") return False version = get_version(seven_zip_path, '--help', r'Version +([\d\.]+)', is_numeric=False) if not version: self.print_error("Failed to check the version for 7z.") self.print_error("Please check if SNOOP_SEVENZIP_BINARY points to a valid executable.") return False cache_dir = settings.SNOOP_ARCHIVE_CACHE_ROOT if not cache_dir or not Path(cache_dir).is_dir(): self.print_error("SNOOP_ARCHIVE_CACHE_ROOT does not point to a valid directory.") return False return True def check_gpg(self): gpg_path = settings.SNOOP_GPG_BINARY if not path_exists(gpg_path): self.print_error("You enabled gpg support but") self.print_error("SNOOP_GPG_BINARY is not set to a valid path.") return False version = get_version(gpg_path) if not version: self.print_error("Failed to check the version for gpg.") self.print_error("Please check if SNOOP_GPG_BINARY points to a valid executable.") return False cache_dir = settings.SNOOP_GPG_HOME if not cache_dir or not Path(cache_dir).is_dir(): self.print_error("SNOOP_GPG_HOME does not point to a valid directory.") return False return True def print_error(self, string): self.stdout.write(self.style.ERROR(string)) def print_message(self, string): self.stdout.write(string) def print_success(self, string): self.stdout.write(self.style.SUCCESS(string))
[ 1, 529, 9507, 29958, 29879, 1217, 459, 29914, 21895, 29914, 26381, 29914, 1867, 2801, 29889, 2272, 13, 3166, 2224, 1982, 1053, 10802, 13, 5215, 1014, 5014, 13, 5215, 337, 13, 5215, 10876, 13, 5215, 3142, 1982, 29889, 3827, 13, 5215, 3142, 1982, 29889, 2704, 13, 5215, 4390, 13, 3166, 9557, 29889, 3221, 29889, 21895, 29889, 3188, 1053, 7399, 6255, 13, 3166, 9557, 29889, 5527, 1053, 6055, 13, 3166, 9557, 29889, 2585, 1053, 12368, 13, 3166, 9557, 29889, 2585, 29889, 13239, 1053, 6607, 1288, 2392, 13, 13, 29923, 4375, 1254, 2965, 1660, 1718, 3210, 29918, 16173, 29918, 16358, 353, 313, 29906, 29892, 29871, 29900, 29892, 29871, 29900, 29897, 13, 29923, 4375, 1254, 2965, 1660, 1718, 3210, 29918, 12648, 29918, 16358, 353, 313, 29906, 29892, 29871, 29946, 29892, 29871, 29946, 29897, 13, 29925, 1254, 29918, 16173, 29918, 16358, 353, 313, 29900, 29892, 29871, 29906, 29892, 29871, 29900, 29897, 13, 29911, 23328, 29909, 29918, 16173, 29918, 16358, 353, 313, 29896, 29892, 29871, 29896, 29941, 29897, 13, 13, 13, 1753, 2224, 29918, 9933, 29898, 2084, 1125, 13, 1678, 736, 10802, 29898, 2084, 467, 9933, 580, 13, 13, 13, 1753, 1732, 29918, 657, 29918, 3051, 29898, 2324, 1125, 13, 1678, 1018, 29901, 13, 4706, 411, 3142, 1982, 29889, 3827, 29889, 332, 417, 2238, 29898, 2324, 29897, 408, 2793, 29901, 13, 9651, 736, 2793, 29889, 949, 580, 13, 1678, 5174, 313, 2271, 1982, 29889, 2704, 29889, 10493, 2392, 29892, 3142, 1982, 29889, 2704, 29889, 4574, 1307, 24616, 1125, 13, 4706, 736, 6213, 13, 13, 13, 1753, 679, 29918, 3259, 29898, 8097, 29918, 2084, 29892, 1873, 29918, 23516, 2433, 489, 3259, 742, 13, 18884, 6528, 29922, 29878, 29915, 4197, 29905, 29881, 29905, 5586, 28135, 742, 1423, 29918, 4905, 29922, 5574, 29892, 13, 18884, 338, 29918, 21574, 29922, 5574, 1125, 13, 1678, 565, 1423, 29918, 4905, 29901, 13, 4706, 1962, 353, 1014, 5014, 29889, 3198, 29918, 4905, 4197, 8097, 29918, 2084, 29892, 1873, 29918, 23516, 2314, 13, 1678, 1683, 29901, 13, 4706, 8676, 353, 1014, 5014, 29889, 3389, 29898, 13, 9651, 518, 8097, 29918, 2084, 29892, 1873, 29918, 23516, 1402, 13, 9651, 1423, 29922, 8824, 29892, 13, 9651, 380, 20405, 29922, 1491, 5014, 29889, 1254, 3970, 2692, 29892, 13, 9651, 27591, 29922, 1491, 5014, 29889, 2227, 4162, 29897, 13, 4706, 1962, 353, 8676, 29889, 25393, 13, 1678, 1347, 29918, 4905, 353, 851, 29898, 4905, 29897, 13, 13, 1678, 7087, 353, 337, 29889, 4478, 29898, 13087, 29892, 1347, 29918, 4905, 29892, 337, 29889, 29924, 8647, 6227, 8895, 29897, 13, 1678, 565, 451, 7087, 29901, 13, 4706, 736, 6213, 13, 13, 1678, 565, 338, 29918, 21574, 29901, 13, 4706, 736, 18761, 29898, 524, 29898, 29916, 29897, 363, 921, 297, 7087, 29889, 2972, 29898, 29896, 467, 5451, 703, 1213, 876, 13, 1678, 736, 7087, 29889, 2972, 29898, 29896, 29897, 13, 13, 13, 1990, 10516, 29898, 5160, 6255, 1125, 13, 1678, 1371, 353, 376, 22509, 537, 1423, 363, 269, 1217, 459, 29889, 7525, 411, 694, 6273, 1213, 13, 13, 1678, 822, 4386, 29898, 1311, 29892, 334, 5085, 29892, 3579, 6768, 1125, 13, 4706, 1423, 414, 353, 518, 13, 9651, 6702, 4691, 742, 1583, 29889, 3198, 29918, 4691, 29892, 7700, 511, 13, 9651, 6702, 9803, 742, 1583, 29889, 3198, 29918, 9803, 29892, 7700, 511, 13, 9651, 6702, 295, 20291, 742, 1583, 29889, 3198, 29918, 267, 29892, 7700, 511, 13, 9651, 6702, 7645, 13441, 742, 1583, 29889, 3198, 29918, 7645, 13441, 29892, 6055, 29889, 29903, 6632, 4590, 29918, 4345, 29954, 6007, 5348, 29911, 29918, 7187, 24290, 338, 6213, 511, 13, 9651, 6702, 949, 29886, 303, 742, 1583, 29889, 3198, 29918, 949, 29886, 303, 29892, 6055, 29889, 29903, 6632, 4590, 29918, 16310, 29925, 1254, 29918, 29933, 1177, 19926, 338, 6213, 511, 13, 9651, 6702, 17396, 1829, 323, 4106, 742, 1583, 29889, 3198, 29918, 29873, 4106, 29892, 6055, 29889, 29903, 6632, 4590, 29918, 29911, 23328, 29909, 29918, 18603, 29918, 1430, 11191, 6992, 29911, 338, 6213, 511, 13, 9651, 6702, 29955, 29920, 742, 1583, 29889, 3198, 29918, 29955, 29920, 29892, 6055, 29889, 29903, 6632, 4590, 29918, 1660, 29963, 1430, 29999, 5690, 29918, 29933, 1177, 19926, 338, 6213, 511, 13, 9651, 6702, 29887, 4061, 742, 1583, 29889, 3198, 29918, 29887, 4061, 29892, 6055, 29889, 29903, 6632, 4590, 29918, 29954, 16903, 29918, 29933, 1177, 19926, 338, 6213, 511, 13, 4706, 4514, 13, 13, 4706, 505, 29918, 12523, 353, 7700, 13, 4706, 363, 1024, 29892, 1423, 29918, 7692, 29892, 14383, 297, 1423, 414, 29901, 13, 9651, 565, 14383, 29901, 13, 18884, 1583, 29889, 2158, 29918, 4906, 703, 29903, 1984, 3262, 278, 1423, 363, 376, 718, 1024, 718, 11393, 1159, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 2158, 29918, 4906, 703, 5596, 292, 376, 718, 1024, 718, 11393, 1159, 13, 18884, 1121, 353, 1423, 29918, 7692, 580, 13, 18884, 565, 1121, 29901, 13, 462, 1678, 1583, 29889, 2158, 29918, 8698, 877, 525, 334, 29871, 29929, 718, 1024, 718, 376, 3431, 23157, 13, 18884, 1683, 29901, 13, 462, 1678, 505, 29918, 12523, 353, 5852, 13, 462, 1678, 1583, 29889, 2158, 29918, 2704, 29898, 978, 718, 376, 5229, 278, 1423, 23157, 13, 9651, 1583, 29889, 2158, 29918, 4906, 877, 1495, 13, 13, 4706, 565, 505, 29918, 12523, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 1576, 6230, 756, 5229, 777, 12747, 23157, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 2831, 901, 2472, 3113, 1074, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 991, 597, 3292, 29889, 510, 29914, 1251, 957, 29914, 29879, 1217, 459, 29914, 10054, 29914, 6207, 29914, 6359, 1004, 29889, 3487, 1159, 13, 9651, 10876, 29889, 13322, 29898, 29896, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 2158, 29918, 8698, 703, 3596, 12747, 505, 4502, 23157, 13, 13, 1678, 822, 1423, 29918, 4691, 29898, 1311, 1125, 13, 4706, 565, 10876, 29889, 3259, 29918, 3888, 29961, 29900, 29962, 2804, 29871, 29941, 470, 10876, 29889, 3259, 29918, 3888, 29961, 29896, 29962, 529, 29871, 29945, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 1576, 5132, 1873, 19056, 338, 6571, 1213, 29889, 4830, 29898, 9675, 29889, 3259, 876, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29950, 29877, 957, 4225, 472, 3203, 5132, 29871, 29941, 29889, 29945, 304, 664, 23157, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 12148, 671, 263, 6969, 1873, 310, 5132, 23157, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 1423, 29918, 9803, 29898, 1311, 1125, 13, 4706, 4833, 29918, 13082, 353, 12368, 1839, 4381, 2033, 13, 4706, 1018, 29901, 13, 9651, 274, 353, 4833, 29918, 13082, 29889, 18127, 580, 13, 4706, 5174, 6607, 1288, 2392, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 1576, 2566, 6055, 526, 451, 2854, 23157, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 12148, 1423, 278, 2566, 2130, 848, 1090, 27640, 27982, 29903, 23157, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 1423, 29918, 7645, 13441, 29898, 1311, 1125, 13, 4706, 10191, 13441, 29918, 2084, 353, 6055, 29889, 29903, 6632, 4590, 29918, 4345, 29954, 6007, 5348, 29911, 29918, 7187, 24290, 13, 4706, 565, 451, 2224, 29918, 9933, 29898, 7645, 13441, 29918, 2084, 1125, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 3492, 9615, 10191, 13441, 2304, 541, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29903, 6632, 4590, 29918, 4345, 29954, 6007, 5348, 29911, 29918, 7187, 24290, 338, 451, 731, 304, 263, 2854, 2224, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 1873, 353, 679, 29918, 3259, 29898, 7645, 13441, 29918, 2084, 29892, 525, 489, 8477, 742, 6528, 2433, 29898, 7645, 13441, 29897, 742, 13, 462, 795, 1423, 29918, 4905, 29922, 8824, 29892, 338, 29918, 21574, 29922, 8824, 29897, 13, 4706, 565, 451, 1873, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 23323, 1065, 278, 2471, 4944, 297, 317, 6632, 4590, 29918, 4345, 29954, 6007, 5348, 29911, 29918, 7187, 24290, 1159, 13, 9651, 736, 7700, 13, 13, 4706, 7090, 29918, 3972, 353, 6055, 29889, 29903, 6632, 4590, 29918, 4345, 29954, 29918, 29907, 2477, 9606, 13, 4706, 565, 451, 7090, 29918, 3972, 470, 451, 10802, 29898, 8173, 29918, 3972, 467, 275, 29918, 3972, 7295, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29903, 6632, 4590, 29918, 4345, 29954, 29918, 29907, 2477, 9606, 947, 451, 1298, 304, 263, 2854, 3884, 23157, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 1423, 29918, 949, 29886, 303, 29898, 1311, 1125, 13, 4706, 1303, 29886, 303, 29918, 2084, 353, 6055, 29889, 29903, 6632, 4590, 29918, 16310, 29925, 1254, 29918, 29933, 1177, 19926, 13, 4706, 565, 451, 2224, 29918, 9933, 29898, 949, 29886, 303, 29918, 2084, 1125, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 3492, 9615, 1303, 29886, 303, 2304, 541, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29903, 6632, 4590, 29918, 16310, 29925, 1254, 29918, 29933, 1177, 19926, 338, 451, 731, 304, 263, 2854, 2224, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 1873, 353, 679, 29918, 3259, 29898, 949, 29886, 303, 29918, 2084, 29892, 17411, 29963, 1495, 13, 4706, 565, 451, 1873, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 17776, 304, 1423, 278, 1303, 29886, 303, 1873, 23157, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 12148, 1423, 565, 317, 6632, 4590, 29918, 16310, 29925, 1254, 29918, 29933, 1177, 19926, 3291, 304, 263, 2854, 16813, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 565, 1873, 529, 349, 1254, 29918, 16173, 29918, 16358, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 12148, 2601, 263, 901, 7786, 1873, 310, 1303, 29886, 303, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 7090, 29918, 3972, 353, 6055, 29889, 29903, 6632, 4590, 29918, 29925, 1254, 29918, 29907, 2477, 9606, 29918, 21289, 13, 4706, 565, 451, 7090, 29918, 3972, 470, 451, 10802, 29898, 8173, 29918, 3972, 467, 275, 29918, 3972, 7295, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29903, 6632, 4590, 29918, 29925, 1254, 29918, 29907, 2477, 9606, 29918, 21289, 947, 451, 1298, 304, 263, 2854, 3884, 23157, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 1423, 29918, 267, 29898, 1311, 1125, 13, 4706, 831, 29918, 2324, 353, 6055, 29889, 29903, 6632, 4590, 29918, 29923, 4375, 1254, 2965, 1660, 1718, 3210, 29918, 4219, 13, 4706, 2793, 353, 1732, 29918, 657, 29918, 3051, 29898, 267, 29918, 2324, 29897, 13, 13, 4706, 565, 451, 2793, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 23323, 451, 4511, 304, 560, 20291, 773, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 1552, 1544, 19056, 297, 317, 6632, 4590, 29918, 29923, 4375, 1254, 2965, 1660, 1718, 3210, 29918, 4219, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 1018, 29901, 13, 9651, 848, 353, 4390, 29889, 18132, 29898, 3051, 29897, 13, 4706, 5174, 4390, 29889, 7249, 2772, 401, 2392, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 295, 20291, 29915, 29879, 2933, 1033, 451, 367, 1602, 6797, 23157, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 12148, 10715, 278, 560, 20291, 1923, 322, 1018, 1449, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 1873, 29918, 1807, 353, 848, 1839, 3259, 16215, 4537, 2033, 13, 4706, 1873, 29918, 1807, 353, 337, 29889, 1491, 29898, 29878, 29915, 29961, 3823, 29881, 29905, 5586, 29974, 742, 15516, 1873, 29918, 1807, 29897, 13, 4706, 1873, 353, 18761, 29898, 524, 29898, 29916, 29897, 363, 921, 297, 1873, 29918, 1807, 29889, 5451, 877, 6169, 876, 13, 13, 4706, 565, 451, 382, 4375, 1254, 2965, 1660, 1718, 3210, 29918, 16173, 29918, 16358, 5277, 1873, 5277, 382, 4375, 1254, 2965, 1660, 1718, 3210, 29918, 12648, 29918, 16358, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 295, 20291, 338, 1873, 24335, 541, 1642, 4830, 29898, 3259, 876, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29950, 29877, 957, 4225, 560, 20291, 304, 367, 297, 1546, 6910, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 8875, 322, 6571, 1642, 4830, 29898, 29923, 4375, 1254, 2965, 1660, 1718, 3210, 29918, 16173, 29918, 16358, 29892, 13, 462, 462, 18884, 382, 4375, 1254, 2965, 1660, 1718, 3210, 29918, 12648, 29918, 16358, 876, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 1423, 29918, 29873, 4106, 29898, 1311, 1125, 13, 4706, 260, 4106, 29918, 2324, 353, 6055, 29889, 29903, 6632, 4590, 29918, 29911, 23328, 29909, 29918, 18603, 29918, 1430, 11191, 6992, 29911, 13, 4706, 2793, 353, 1732, 29918, 657, 29918, 3051, 29898, 29873, 4106, 29918, 2324, 718, 5591, 3259, 1159, 13, 4706, 565, 451, 2793, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 23323, 451, 4511, 304, 13380, 323, 4106, 773, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 1552, 1544, 19056, 297, 317, 6632, 4590, 29918, 29911, 23328, 29909, 29918, 18603, 29918, 1430, 11191, 6992, 29911, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 1873, 29918, 1807, 353, 851, 29898, 3051, 29897, 13, 4706, 7087, 353, 337, 29889, 4478, 877, 4197, 29905, 29881, 29905, 5586, 28135, 742, 1873, 29918, 1807, 29892, 337, 29889, 29924, 8647, 6227, 8895, 29897, 13, 4706, 565, 451, 7087, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 17396, 1829, 323, 4106, 29915, 29879, 2933, 1258, 451, 1712, 263, 2854, 1873, 1353, 23157, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 12148, 10715, 278, 13380, 323, 4106, 1923, 322, 1018, 1449, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 1873, 29918, 1807, 353, 7087, 29889, 2972, 29898, 29896, 29897, 13, 4706, 1873, 353, 18761, 29898, 524, 29898, 29916, 29897, 363, 921, 297, 1873, 29918, 1807, 29889, 5451, 877, 6169, 876, 13, 13, 4706, 565, 1873, 529, 323, 23328, 29909, 29918, 16173, 29918, 16358, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29873, 4106, 338, 1873, 24335, 541, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29950, 29877, 957, 4225, 260, 4106, 304, 367, 472, 3203, 1873, 6571, 1642, 4830, 29898, 29911, 23328, 29909, 29918, 16173, 29918, 16358, 876, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 22954, 260, 4106, 515, 2045, 597, 29873, 4106, 29889, 4288, 29889, 990, 29914, 10382, 1159, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 1423, 29918, 29955, 29920, 29898, 1311, 1125, 13, 4706, 9881, 29918, 7554, 29918, 2084, 353, 6055, 29889, 29903, 6632, 4590, 29918, 1660, 29963, 1430, 29999, 5690, 29918, 29933, 1177, 19926, 13, 4706, 565, 451, 2224, 29918, 9933, 29898, 344, 854, 29918, 7554, 29918, 2084, 1125, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 3492, 9615, 29871, 29955, 29920, 2304, 541, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29903, 6632, 4590, 29918, 1660, 29963, 1430, 29999, 5690, 29918, 29933, 1177, 19926, 338, 451, 731, 304, 263, 2854, 2224, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 1873, 353, 679, 29918, 3259, 29898, 344, 854, 29918, 7554, 29918, 2084, 29892, 525, 489, 8477, 742, 364, 29915, 6594, 718, 4197, 29905, 29881, 29905, 5586, 28135, 742, 338, 29918, 21574, 29922, 8824, 29897, 13, 4706, 565, 451, 1873, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 17776, 304, 1423, 278, 1873, 363, 29871, 29955, 29920, 23157, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 12148, 1423, 565, 317, 6632, 4590, 29918, 1660, 29963, 1430, 29999, 5690, 29918, 29933, 1177, 19926, 3291, 304, 263, 2854, 16813, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 7090, 29918, 3972, 353, 6055, 29889, 29903, 6632, 4590, 29918, 1718, 3210, 18474, 29918, 29907, 2477, 9606, 29918, 21289, 13, 4706, 565, 451, 7090, 29918, 3972, 470, 451, 10802, 29898, 8173, 29918, 3972, 467, 275, 29918, 3972, 7295, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29903, 6632, 4590, 29918, 1718, 3210, 18474, 29918, 29907, 2477, 9606, 29918, 21289, 947, 451, 1298, 304, 263, 2854, 3884, 23157, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 1423, 29918, 29887, 4061, 29898, 1311, 1125, 13, 4706, 330, 4061, 29918, 2084, 353, 6055, 29889, 29903, 6632, 4590, 29918, 29954, 16903, 29918, 29933, 1177, 19926, 13, 4706, 565, 451, 2224, 29918, 9933, 29898, 29887, 4061, 29918, 2084, 1125, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 3492, 9615, 330, 4061, 2304, 541, 1159, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29903, 6632, 4590, 29918, 29954, 16903, 29918, 29933, 1177, 19926, 338, 451, 731, 304, 263, 2854, 2224, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 1873, 353, 679, 29918, 3259, 29898, 29887, 4061, 29918, 2084, 29897, 13, 4706, 565, 451, 1873, 29901, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 17776, 304, 1423, 278, 1873, 363, 330, 4061, 23157, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 12148, 1423, 565, 317, 6632, 4590, 29918, 29954, 16903, 29918, 29933, 1177, 19926, 3291, 304, 263, 2854, 16813, 23157, 13, 9651, 736, 7700, 13, 13, 4706, 7090, 29918, 3972, 353, 6055, 29889, 29903, 6632, 4590, 29918, 29954, 16903, 29918, 17353, 13, 4706, 565, 451, 7090, 29918, 3972, 470, 451, 10802, 29898, 8173, 29918, 3972, 467, 275, 29918, 3972, 7295, 13, 9651, 1583, 29889, 2158, 29918, 2704, 703, 29903, 6632, 4590, 29918, 29954, 16903, 29918, 17353, 947, 451, 1298, 304, 263, 2854, 3884, 23157, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 13, 1678, 822, 1596, 29918, 2704, 29898, 1311, 29892, 1347, 1125, 13, 4706, 1583, 29889, 25393, 29889, 3539, 29898, 1311, 29889, 3293, 29889, 11432, 29898, 1807, 876, 13, 13, 1678, 822, 1596, 29918, 4906, 29898, 1311, 29892, 1347, 1125, 13, 4706, 1583, 29889, 25393, 29889, 3539, 29898, 1807, 29897, 13, 13, 1678, 822, 1596, 29918, 8698, 29898, 1311, 29892, 1347, 1125, 13, 4706, 1583, 29889, 25393, 29889, 3539, 29898, 1311, 29889, 3293, 29889, 14605, 26925, 29898, 1807, 876, 13, 2 ]
tests/integration/test_security.py
Rogdham/bigxml
4
105719
<reponame>Rogdham/bigxml from defusedxml import EntitiesForbidden import pytest from bigxml import Parser def handler_get_text(node): yield node.text @pytest.mark.parametrize( "xml", ( pytest.param( ( b"<!DOCTYPE foobar [\n" b' <!ENTITY a "bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig">\n' b"]>\n" b"<root>&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;</root>\n" ), id="one entity (1kb)", ), pytest.param( ( b"<!DOCTYPE foobar [\n" b' <!ENTITY a "bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig">\n' b' <!ENTITY b "&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;">\n' b' <!ENTITY c "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">\n' b' <!ENTITY d "&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">\n' b' <!ENTITY e "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">\n' b"]>\n" b"<root>&e;</root>\n" ), id="bomb (5Mb)", ), pytest.param( ( b"<!DOCTYPE foobar [\n" b' <!ENTITY a "bigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbigbig">\n' b' <!ENTITY b "&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;&a;">\n' b' <!ENTITY c "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">\n' b' <!ENTITY d "&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">\n' b' <!ENTITY e "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">\n' b' <!ENTITY f "&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;">\n' b' <!ENTITY g "&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;">\n' b' <!ENTITY h "&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;">\n' b"]>\n" b"<root>&h;</root>\n" ), id="bomb (33Gb)", ), pytest.param( ( b"<!DOCTYPE foobar [\n" b' <!ENTITY a "something &b;">\n' b' <!ENTITY b "&a;">\n' b"]>\n" b"<root>&a;</root>\n" ), id="recursive", ), pytest.param( ( b"<!DOCTYPE foobar [\n" b' <!ENTITY a SYSTEM "file:///etc/hosts">\n' b"]>\n" b"<root>&a;</root>\n" ), id="resolution (file)", ), pytest.param( ( b"<!DOCTYPE foobar [\n" b' <!ENTITY a SYSTEM "https://example.com/">\n' b"]>\n" b"<root>&a;</root>\n" ), id="resolution (http)", ), pytest.param( ( b"<!DOCTYPE foobar [\n" b' <!ENTITY a SYSTEM "expect://id">\n' b"]>\n" b"<root>&a;</root>\n" ), id="resolution (expect)", ), ), ) def test_external_entities(xml): with pytest.raises(EntitiesForbidden): Parser(xml).return_from(handler_get_text)
[ 1, 529, 276, 1112, 420, 29958, 29934, 468, 29881, 3391, 29914, 3752, 3134, 13, 3166, 822, 3880, 3134, 1053, 4284, 1907, 2831, 29890, 4215, 13, 5215, 11451, 1688, 13, 13, 3166, 4802, 3134, 1053, 1459, 643, 13, 13, 13, 1753, 7834, 29918, 657, 29918, 726, 29898, 3177, 1125, 13, 1678, 7709, 2943, 29889, 726, 13, 13, 13, 29992, 2272, 1688, 29889, 3502, 29889, 3207, 300, 374, 911, 29898, 13, 1678, 376, 3134, 613, 13, 1678, 313, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 313, 13, 18884, 289, 29908, 29966, 29991, 21300, 1701, 22872, 12452, 29876, 29908, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 263, 376, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 1013, 29905, 29876, 29915, 13, 18884, 289, 3108, 14247, 29876, 29908, 13, 18884, 289, 29908, 29966, 4632, 19250, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 14814, 4632, 14247, 29876, 29908, 13, 9651, 10353, 13, 9651, 1178, 543, 650, 7855, 313, 29896, 21066, 19123, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 313, 13, 18884, 289, 29908, 29966, 29991, 21300, 1701, 22872, 12452, 29876, 29908, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 263, 376, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 1013, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 289, 376, 29987, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 274, 376, 29987, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 270, 376, 29987, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 321, 376, 29987, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 12334, 29905, 29876, 29915, 13, 18884, 289, 3108, 14247, 29876, 29908, 13, 18884, 289, 29908, 29966, 4632, 19250, 29872, 14814, 4632, 14247, 29876, 29908, 13, 9651, 10353, 13, 9651, 1178, 543, 29890, 3424, 313, 29945, 29924, 29890, 19123, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 313, 13, 18884, 289, 29908, 29966, 29991, 21300, 1701, 22872, 12452, 29876, 29908, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 263, 376, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 3752, 1013, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 289, 376, 29987, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 25359, 29874, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 274, 376, 29987, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 25359, 29890, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 270, 376, 29987, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 25359, 29883, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 321, 376, 29987, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 25359, 29881, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 285, 376, 29987, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 25359, 29872, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 330, 376, 29987, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 25359, 29888, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 298, 376, 29987, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 25359, 29887, 12334, 29905, 29876, 29915, 13, 18884, 289, 3108, 14247, 29876, 29908, 13, 18884, 289, 29908, 29966, 4632, 19250, 29882, 14814, 4632, 14247, 29876, 29908, 13, 9651, 10353, 13, 9651, 1178, 543, 29890, 3424, 313, 29941, 29941, 29954, 29890, 19123, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 313, 13, 18884, 289, 29908, 29966, 29991, 21300, 1701, 22872, 12452, 29876, 29908, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 263, 376, 14481, 669, 29890, 12334, 29905, 29876, 29915, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 289, 376, 29987, 29874, 12334, 29905, 29876, 29915, 13, 18884, 289, 3108, 14247, 29876, 29908, 13, 18884, 289, 29908, 29966, 4632, 19250, 29874, 14814, 4632, 14247, 29876, 29908, 13, 9651, 10353, 13, 9651, 1178, 543, 3757, 25397, 613, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 313, 13, 18884, 289, 29908, 29966, 29991, 21300, 1701, 22872, 12452, 29876, 29908, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 263, 28962, 1254, 12665, 376, 1445, 597, 29914, 7070, 29914, 23525, 1013, 29905, 29876, 29915, 13, 18884, 289, 3108, 14247, 29876, 29908, 13, 18884, 289, 29908, 29966, 4632, 19250, 29874, 14814, 4632, 14247, 29876, 29908, 13, 9651, 10353, 13, 9651, 1178, 543, 9778, 918, 313, 1445, 19123, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 313, 13, 18884, 289, 29908, 29966, 29991, 21300, 1701, 22872, 12452, 29876, 29908, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 263, 28962, 1254, 12665, 376, 991, 597, 4773, 29889, 510, 29914, 1013, 29905, 29876, 29915, 13, 18884, 289, 3108, 14247, 29876, 29908, 13, 18884, 289, 29908, 29966, 4632, 19250, 29874, 14814, 4632, 14247, 29876, 29908, 13, 9651, 10353, 13, 9651, 1178, 543, 9778, 918, 313, 1124, 19123, 13, 4706, 10353, 13, 4706, 11451, 1688, 29889, 3207, 29898, 13, 9651, 313, 13, 18884, 289, 29908, 29966, 29991, 21300, 1701, 22872, 12452, 29876, 29908, 13, 18884, 289, 29915, 1678, 18252, 3919, 11937, 263, 28962, 1254, 12665, 376, 17854, 597, 333, 1013, 29905, 29876, 29915, 13, 18884, 289, 3108, 14247, 29876, 29908, 13, 18884, 289, 29908, 29966, 4632, 19250, 29874, 14814, 4632, 14247, 29876, 29908, 13, 9651, 10353, 13, 9651, 1178, 543, 9778, 918, 313, 17854, 19123, 13, 4706, 10353, 13, 1678, 10353, 13, 29897, 13, 1753, 1243, 29918, 23176, 29918, 296, 1907, 29898, 3134, 1125, 13, 1678, 411, 11451, 1688, 29889, 336, 4637, 29898, 5292, 1907, 2831, 29890, 4215, 1125, 13, 4706, 1459, 643, 29898, 3134, 467, 2457, 29918, 3166, 29898, 13789, 29918, 657, 29918, 726, 29897, 13, 2 ]
task_scripts/merge_seginfo.py
ZettaAI/Synaptor
7
49289
""" Segment Info Merging Wrapper Script - Takes an id mapping across segments as input - Merges the segment info dataframes into one for the entire dataset """ import synaptor as s import argparse parser = argparse.ArgumentParser() # Inputs & Outputs parser.add_argument("storagestr") parser.add_argument("hashval", type=int) parser.add_argument("--aux_storagestr", default=None) parser.add_argument("--timing_tag", default=None) parser.add_argument("--szthresh", type=int, default=None) args = parser.parse_args() args.storagestr = s.io.parse_storagestr(args.storagestr) args.aux_storagestr = s.io.parse_storagestr(args.aux_storagestr) print(vars(args)) s.proc.tasks_w_io.merge_seginfo_task(**vars(args))
[ 1, 9995, 13, 17669, 358, 22140, 4702, 3460, 399, 6794, 14415, 13, 13, 29899, 323, 6926, 385, 1178, 10417, 4822, 24611, 408, 1881, 13, 29899, 4702, 2710, 278, 10768, 5235, 848, 19935, 964, 697, 363, 278, 4152, 8783, 13, 15945, 29908, 13, 5215, 5222, 2156, 272, 408, 269, 13, 13, 13, 5215, 1852, 5510, 13, 16680, 353, 1852, 5510, 29889, 15730, 11726, 580, 13, 13, 29937, 10567, 29879, 669, 10604, 29879, 13, 16680, 29889, 1202, 29918, 23516, 703, 28957, 351, 16444, 1159, 13, 16680, 29889, 1202, 29918, 23516, 703, 8568, 791, 613, 1134, 29922, 524, 29897, 13, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 2993, 29918, 28957, 351, 16444, 613, 2322, 29922, 8516, 29897, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 9346, 292, 29918, 4039, 613, 2322, 29922, 8516, 29897, 13, 16680, 29889, 1202, 29918, 23516, 703, 489, 3616, 386, 3781, 613, 1134, 29922, 524, 29892, 2322, 29922, 8516, 29897, 13, 13, 13, 5085, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 5085, 29889, 28957, 351, 16444, 353, 269, 29889, 601, 29889, 5510, 29918, 28957, 351, 16444, 29898, 5085, 29889, 28957, 351, 16444, 29897, 13, 5085, 29889, 2993, 29918, 28957, 351, 16444, 353, 269, 29889, 601, 29889, 5510, 29918, 28957, 351, 16444, 29898, 5085, 29889, 2993, 29918, 28957, 351, 16444, 29897, 13, 2158, 29898, 16908, 29898, 5085, 876, 13, 13, 13, 29879, 29889, 15439, 29889, 20673, 29918, 29893, 29918, 601, 29889, 14634, 29918, 10199, 3888, 29918, 7662, 29898, 1068, 16908, 29898, 5085, 876, 13, 2 ]
tests/connect_tests.py
adyekjaer/VersionOne.SDK.Python
2
42117
<filename>tests/connect_tests.py from testtools import TestCase from testtools.assertions import assert_that from testtools.matchers import Equals from testtools.content import text_content import sys if sys.version_info >= (3,0): from urllib.error import HTTPError else: from urllib2 import HTTPError # try the old version, then fallback to the new one try: from xml.etree import ElementTree from xml.etree.ElementTree import parse, fromstring, Element except ImportError: from elementtree import ElementTree from elementtree.ElementTree import parse, fromstring, Element from v1pysdk.client import * from v1pysdk import V1Meta from .common_test_server import PublicTestServerConnection class TestV1Connection(TestCase): def test_connect(self): username = PublicTestServerConnection.username password = <PASSWORD> address = PublicTestServerConnection.address instance = PublicTestServerConnection.instance self.addDetail('URL', text_content(address + "/" + instance)) self.addDetail('username', text_content(username)) server = V1Server(address=address, username=username, password=password,instance=instance) # The story names, but limit to only the first result so we don't get inundated with results code, body = server.fetch('/rest-1.v1/Data/Story?sel=Name&page=1,0') self.addDetail('Code', text_content(str(code))) self.addDetail('Body', text_content(str(body))) elem = fromstring(body) self.assertThat(elem.tag, Equals('Assets')) def test_meta_connect_instance_url(self): v1 = None self.addDetail('URL', text_content(PublicTestServerConnection.instance_url)) self.addDetail('username', text_content(PublicTestServerConnection.username)) try: v1 = V1Meta( instance_url = PublicTestServerConnection.instance_url, username = PublicTestServerConnection.username, password = <PASSWORD>TestServerConnection.password, ) except Exception as e: assert_that(False, Equals(True), message="Error trying to create connection: " + str(e)) try: items = v1.Story.select('Name').page(size=1) items.first() #run the query except Exception as e: assert_that(False, Equals(True), message="Error running query from connection: " + str(e)) def test_meta_connect_instance_and_address(self): v1 = None self.addDetail('address', text_content(PublicTestServerConnection.address)) self.addDetail('instance', text_content(PublicTestServerConnection.instance)) self.addDetail('username', text_content(PublicTestServerConnection.username)) try: v1 = V1Meta( address = PublicTestServerConnection.address, instance = PublicTestServerConnection.instance, username = PublicTestServerConnection.username, password = <PASSWORD>, ) except Exception as e: assert_that(False, Equals(True), message="Error trying to create connection: " + str(e)) try: items = v1.Story.select('Name').page(size=1) items.first() #run the query except Exception as e: assert_that(False, Equals(True), message="Error running query from connection: " + str(e)) def test_meta_connect_instance_url_overrides_separate(self): v1 = None address = self.getUniqueString() #garbage instance = self.getUniqueString() #garbage self.addDetail('address', text_content(PublicTestServerConnection.address)) self.addDetail('instance-url', text_content(PublicTestServerConnection.instance_url)) self.addDetail('instance', text_content(address)) self.addDetail('username', text_content(instance)) try: v1 = V1Meta( instance_url = PublicTestServerConnection.instance_url, address = address, instance = instance, username = PublicTestServerConnection.username, password = <PASSWORD>, ) except Exception as e: assert_that(False, Equals(True), message="Error trying to create connection: " + str(e)) try: items = v1.Story.select('Name').page(size=1) items.first() #run the query except Exception as e: assert_that(False, Equals(True), message="Error running query from connection: " + str(e)) def test_meta_connect_oauth(self): v1 = None self.addDetail('address', text_content(PublicTestServerConnection.address)) self.addDetail('instance', text_content(PublicTestServerConnection.instance)) try: v1 = V1Meta( instance_url = PublicTestServerConnection.instance_url, #no username password = <PASSWORD>, use_password_as_token=True, ) except Exception as e: assert_that(False, Equals(True), message="Error trying to create connection: " + str(e)) try: items = v1.Story.select('Name').page(size=1) items.first() #run the query except Exception as e: assert_that(False, Equals(True), message="Error running query from connection: " + str(e)) def test_meta_connect_oauth_ignores_username(self): v1 = None username = self.getUniqueString() #garbage self.addDetail('address', text_content(PublicTestServerConnection.address)) self.addDetail('instance', text_content(PublicTestServerConnection.instance)) self.addDetail('username', text_content(username)) try: v1 = V1Meta( instance_url = PublicTestServerConnection.instance_url, username = username, password = <PASSWORD>, use_password_as_token=True, ) except Exception as e: assert_that(False, Equals(True), message="Error trying to create connection: " + str(e)) try: items = v1.Story.select('Name').page(size=1) items.first() #run the query except Exception as e: assert_that(False, Equals(True), message="Error running query from connection: " + str(e)) def test_connect_fails_when_invalid(self): v1bad = None username = self.getUniqueString() #garbage password = <PASSWORD>.getUniqueString() #garbage self.addDetail('address', text_content(PublicTestServerConnection.address)) self.addDetail('instance', text_content(PublicTestServerConnection.instance)) self.addDetail('bad-username', text_content(username)) self.addDetail('bad-password', text_content(password)) try: v1bad = V1Meta( instance_url = PublicTestServerConnection.instance_url, username = username, password = password, use_password_as_token=False, ) # we have to try to use it to get it to connect and fail items = v1bad.Story.select('Name').page(size=1) items.first() #run the query except HTTPError as e: assert_that(e.code, Equals(401), message="Connection failed for reasons other than authorization") else: assert_that(False, Equals(True), message="Connection succeeded with bad credentials") def test_reconnect_succeeds_after_invalid(self): v1bad = None username = self.getUniqueString() #garbage password = <PASSWORD>() #garbage self.addDetail('bad-username', text_content(username)) self.addDetail('bad-password', text_content(password)) try: v1bad = V1Meta( instance_url = PublicTestServerConnection.instance_url, username = username, password = password, use_password_as_token=False, ) items = v1bad.Story.select('Name').page(size=1) items.first() #run the query except HTTPError as e: assert_that(e.code, Equals(401), message="Connection failed for reasons other than authorization") else: assert_that(False, Equals(True), message="First connection succeeded with bad credentials, cannot continue test") v1good = None self.addDetail('address', text_content(PublicTestServerConnection.address)) self.addDetail('instance', text_content(PublicTestServerConnection.instance)) # Connect correctly first try: v1good = V1Meta( instance_url = PublicTestServerConnection.instance_url, password = PublicTestServerConnection.token, use_password_as_token=True, ) items = v1good.Story.select('Name').page(size=1) items.first() #run the query except Exception as e: assert_that(False, Equals(True), message="Error running query from good connection: " + str(e)) def test_reconnect_fails_when_invalid(self): v1good = None self.addDetail('address', text_content(PublicTestServerConnection.address)) self.addDetail('instance', text_content(PublicTestServerConnection.instance)) # Connect correctly first try: v1good = V1Meta( instance_url = PublicTestServerConnection.instance_url, password = <PASSWORD>, use_password_as_token=True, ) items = v1good.Story.select('Name').page(size=1) items.first() #run the query except Exception as e: assert_that(False, Equals(True), message="Error running query from good connection, cannot perform test: " + str(e)) v1bad = None username = self.getUniqueString() #garbage password = <PASSWORD>.getUniqueString() #garbage self.addDetail('bad-username', text_content(username)) self.addDetail('bad-password', text_content(password)) try: v1bad = V1Meta( instance_url = PublicTestServerConnection.instance_url, username = username, password = password, use_password_as_token=False, ) items = v1bad.Story.select('Name').page(size=1) items.first() #run the query except HTTPError as e: assert_that(e.code, Equals(401), message="Connection failed for reasons other than authorization") else: assert_that(False, Equals(True), message="Second connection succeeded with bad credentials")
[ 1, 529, 9507, 29958, 21150, 29914, 6915, 29918, 21150, 29889, 2272, 13, 3166, 1243, 8504, 1053, 4321, 8259, 13, 3166, 1243, 8504, 29889, 9294, 1080, 1053, 4974, 29918, 5747, 13, 3166, 1243, 8504, 29889, 4352, 414, 1053, 11243, 1338, 13, 3166, 1243, 8504, 29889, 3051, 1053, 1426, 29918, 3051, 13, 5215, 10876, 13, 361, 10876, 29889, 3259, 29918, 3888, 6736, 313, 29941, 29892, 29900, 1125, 13, 1678, 515, 3142, 1982, 29889, 2704, 1053, 7331, 2392, 13, 2870, 29901, 13, 1678, 515, 3142, 1982, 29906, 1053, 7331, 2392, 13, 13, 29937, 1018, 278, 2030, 1873, 29892, 769, 6416, 1627, 304, 278, 716, 697, 13, 2202, 29901, 13, 1678, 515, 4903, 29889, 300, 929, 1053, 10619, 9643, 13, 1678, 515, 4903, 29889, 300, 929, 29889, 2642, 9643, 1053, 6088, 29892, 515, 1807, 29892, 10619, 13, 19499, 16032, 2392, 29901, 13, 1678, 515, 1543, 8336, 1053, 10619, 9643, 13, 1678, 515, 1543, 8336, 29889, 2642, 9643, 1053, 6088, 29892, 515, 1807, 29892, 10619, 13, 13, 3166, 325, 29896, 29886, 952, 8181, 29889, 4645, 1053, 334, 13, 3166, 325, 29896, 29886, 952, 8181, 1053, 478, 29896, 19346, 13, 3166, 869, 9435, 29918, 1688, 29918, 2974, 1053, 5236, 3057, 6004, 5350, 13, 13, 1990, 4321, 29963, 29896, 5350, 29898, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 6915, 29898, 1311, 1125, 13, 4706, 8952, 353, 5236, 3057, 6004, 5350, 29889, 6786, 13, 4706, 4800, 353, 529, 25711, 17013, 29958, 13, 4706, 3211, 353, 5236, 3057, 6004, 5350, 29889, 7328, 13, 4706, 2777, 353, 5236, 3057, 6004, 5350, 29889, 8758, 13, 4706, 1583, 29889, 1202, 16570, 877, 4219, 742, 1426, 29918, 3051, 29898, 7328, 718, 5591, 29908, 718, 2777, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 6786, 742, 1426, 29918, 3051, 29898, 6786, 876, 13, 13, 4706, 1923, 353, 478, 29896, 6004, 29898, 7328, 29922, 7328, 29892, 8952, 29922, 6786, 29892, 4800, 29922, 5630, 29892, 8758, 29922, 8758, 29897, 13, 4706, 396, 450, 5828, 2983, 29892, 541, 4046, 304, 871, 278, 937, 1121, 577, 591, 1016, 29915, 29873, 679, 297, 870, 630, 411, 2582, 13, 4706, 775, 29892, 3573, 353, 1923, 29889, 9155, 11219, 5060, 29899, 29896, 29889, 29894, 29896, 29914, 1469, 29914, 29359, 29973, 2838, 29922, 1170, 29987, 3488, 29922, 29896, 29892, 29900, 1495, 13, 4706, 1583, 29889, 1202, 16570, 877, 3399, 742, 1426, 29918, 3051, 29898, 710, 29898, 401, 4961, 13, 4706, 1583, 29889, 1202, 16570, 877, 8434, 742, 1426, 29918, 3051, 29898, 710, 29898, 2587, 4961, 13, 13, 4706, 21268, 353, 515, 1807, 29898, 2587, 29897, 13, 4706, 1583, 29889, 9294, 7058, 29898, 20461, 29889, 4039, 29892, 11243, 1338, 877, 2887, 7224, 8785, 13, 13, 1678, 822, 1243, 29918, 7299, 29918, 6915, 29918, 8758, 29918, 2271, 29898, 1311, 1125, 13, 4706, 325, 29896, 353, 6213, 13, 4706, 1583, 29889, 1202, 16570, 877, 4219, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 6786, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 6786, 876, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 8952, 353, 5236, 3057, 6004, 5350, 29889, 6786, 29892, 13, 18884, 4800, 353, 529, 25711, 17013, 29958, 3057, 6004, 5350, 29889, 5630, 29892, 13, 18884, 1723, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 1811, 304, 1653, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 4452, 353, 325, 29896, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 2734, 2346, 515, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 1678, 822, 1243, 29918, 7299, 29918, 6915, 29918, 8758, 29918, 392, 29918, 7328, 29898, 1311, 1125, 13, 4706, 325, 29896, 353, 6213, 13, 4706, 1583, 29889, 1202, 16570, 877, 7328, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 7328, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 8758, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 8758, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 6786, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 6786, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 353, 478, 29896, 19346, 29898, 13, 18884, 3211, 353, 5236, 3057, 6004, 5350, 29889, 7328, 29892, 13, 18884, 2777, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29892, 13, 18884, 8952, 353, 5236, 3057, 6004, 5350, 29889, 6786, 29892, 13, 18884, 4800, 353, 529, 25711, 17013, 10202, 13, 18884, 1723, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 1811, 304, 1653, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 4452, 353, 325, 29896, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 2734, 2346, 515, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 1678, 822, 1243, 29918, 7299, 29918, 6915, 29918, 8758, 29918, 2271, 29918, 957, 24040, 29918, 25048, 403, 29898, 1311, 1125, 13, 4706, 325, 29896, 353, 6213, 13, 4706, 3211, 353, 1583, 29889, 657, 8110, 802, 1231, 580, 396, 5397, 17807, 13, 4706, 2777, 353, 1583, 29889, 657, 8110, 802, 1231, 580, 396, 5397, 17807, 13, 4706, 1583, 29889, 1202, 16570, 877, 7328, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 7328, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 8758, 29899, 2271, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 8758, 742, 1426, 29918, 3051, 29898, 7328, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 6786, 742, 1426, 29918, 3051, 29898, 8758, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 3211, 353, 3211, 29892, 13, 18884, 2777, 353, 2777, 29892, 13, 18884, 8952, 353, 5236, 3057, 6004, 5350, 29889, 6786, 29892, 13, 18884, 4800, 353, 529, 25711, 17013, 10202, 13, 18884, 1723, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 1811, 304, 1653, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 4452, 353, 325, 29896, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 2734, 2346, 515, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 1678, 822, 1243, 29918, 7299, 29918, 6915, 29918, 23106, 29898, 1311, 1125, 13, 4706, 325, 29896, 353, 6213, 13, 4706, 1583, 29889, 1202, 16570, 877, 7328, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 7328, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 8758, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 8758, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 396, 1217, 8952, 13, 18884, 4800, 353, 529, 25711, 17013, 10202, 13, 18884, 671, 29918, 5630, 29918, 294, 29918, 6979, 29922, 5574, 29892, 13, 18884, 1723, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 1811, 304, 1653, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 4452, 353, 325, 29896, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 2734, 2346, 515, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 1678, 822, 1243, 29918, 7299, 29918, 6915, 29918, 23106, 29918, 647, 2361, 29918, 6786, 29898, 1311, 1125, 13, 4706, 325, 29896, 353, 6213, 13, 4706, 8952, 353, 1583, 29889, 657, 8110, 802, 1231, 580, 396, 5397, 17807, 13, 4706, 1583, 29889, 1202, 16570, 877, 7328, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 7328, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 8758, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 8758, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 6786, 742, 1426, 29918, 3051, 29898, 6786, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 8952, 353, 8952, 29892, 13, 18884, 4800, 353, 529, 25711, 17013, 10202, 13, 18884, 671, 29918, 5630, 29918, 294, 29918, 6979, 29922, 5574, 29892, 13, 18884, 1723, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 1811, 304, 1653, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 4452, 353, 325, 29896, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 2734, 2346, 515, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 13, 1678, 822, 1243, 29918, 6915, 29918, 29888, 2234, 29918, 8256, 29918, 20965, 29898, 1311, 1125, 13, 4706, 325, 29896, 12313, 353, 6213, 13, 4706, 8952, 353, 1583, 29889, 657, 8110, 802, 1231, 580, 396, 5397, 17807, 13, 4706, 4800, 353, 529, 25711, 17013, 15513, 657, 8110, 802, 1231, 580, 396, 5397, 17807, 13, 4706, 1583, 29889, 1202, 16570, 877, 7328, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 7328, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 8758, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 8758, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 12313, 29899, 6786, 742, 1426, 29918, 3051, 29898, 6786, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 12313, 29899, 5630, 742, 1426, 29918, 3051, 29898, 5630, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 12313, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 8952, 353, 8952, 29892, 13, 18884, 4800, 353, 4800, 29892, 13, 18884, 671, 29918, 5630, 29918, 294, 29918, 6979, 29922, 8824, 29892, 13, 18884, 1723, 13, 9651, 396, 591, 505, 304, 1018, 304, 671, 372, 304, 679, 372, 304, 4511, 322, 4418, 13, 9651, 4452, 353, 325, 29896, 12313, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 7331, 2392, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 29872, 29889, 401, 29892, 11243, 1338, 29898, 29946, 29900, 29896, 511, 2643, 543, 5350, 5229, 363, 9590, 916, 1135, 28733, 1159, 13, 4706, 1683, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 5350, 14792, 411, 4319, 16140, 1159, 13, 13, 1678, 822, 1243, 29918, 276, 6915, 29918, 29879, 1682, 3947, 29879, 29918, 7045, 29918, 20965, 29898, 1311, 1125, 13, 4706, 325, 29896, 12313, 353, 6213, 13, 4706, 8952, 353, 1583, 29889, 657, 8110, 802, 1231, 580, 396, 5397, 17807, 13, 4706, 4800, 353, 529, 25711, 17013, 16917, 396, 5397, 17807, 13, 4706, 1583, 29889, 1202, 16570, 877, 12313, 29899, 6786, 742, 1426, 29918, 3051, 29898, 6786, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 12313, 29899, 5630, 742, 1426, 29918, 3051, 29898, 5630, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 12313, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 8952, 353, 8952, 29892, 13, 18884, 4800, 353, 4800, 29892, 13, 18884, 671, 29918, 5630, 29918, 294, 29918, 6979, 29922, 8824, 29892, 13, 18884, 1723, 13, 9651, 4452, 353, 325, 29896, 12313, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 7331, 2392, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 29872, 29889, 401, 29892, 11243, 1338, 29898, 29946, 29900, 29896, 511, 2643, 543, 5350, 5229, 363, 9590, 916, 1135, 28733, 1159, 13, 4706, 1683, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 6730, 3957, 14792, 411, 4319, 16140, 29892, 2609, 6773, 1243, 1159, 13, 13, 4706, 325, 29896, 16773, 353, 6213, 13, 4706, 1583, 29889, 1202, 16570, 877, 7328, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 7328, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 8758, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 8758, 876, 13, 13, 4706, 396, 14971, 5149, 937, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 16773, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 4800, 353, 5236, 3057, 6004, 5350, 29889, 6979, 29892, 13, 18884, 671, 29918, 5630, 29918, 294, 29918, 6979, 29922, 5574, 29892, 13, 18884, 1723, 13, 9651, 4452, 353, 325, 29896, 16773, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 2734, 2346, 515, 1781, 3957, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 1678, 822, 1243, 29918, 276, 6915, 29918, 29888, 2234, 29918, 8256, 29918, 20965, 29898, 1311, 1125, 13, 4706, 325, 29896, 16773, 353, 6213, 13, 4706, 1583, 29889, 1202, 16570, 877, 7328, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 7328, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 8758, 742, 1426, 29918, 3051, 29898, 19858, 3057, 6004, 5350, 29889, 8758, 876, 13, 13, 4706, 396, 14971, 5149, 937, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 16773, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 4800, 353, 529, 25711, 17013, 10202, 13, 18884, 671, 29918, 5630, 29918, 294, 29918, 6979, 29922, 5574, 29892, 13, 18884, 1723, 13, 9651, 4452, 353, 325, 29896, 16773, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 2392, 2734, 2346, 515, 1781, 3957, 29892, 2609, 2189, 1243, 29901, 376, 718, 851, 29898, 29872, 876, 13, 13, 4706, 325, 29896, 12313, 353, 6213, 13, 4706, 8952, 353, 1583, 29889, 657, 8110, 802, 1231, 580, 396, 5397, 17807, 13, 4706, 4800, 353, 529, 25711, 17013, 15513, 657, 8110, 802, 1231, 580, 396, 5397, 17807, 13, 4706, 1583, 29889, 1202, 16570, 877, 12313, 29899, 6786, 742, 1426, 29918, 3051, 29898, 6786, 876, 13, 4706, 1583, 29889, 1202, 16570, 877, 12313, 29899, 5630, 742, 1426, 29918, 3051, 29898, 5630, 876, 13, 13, 4706, 1018, 29901, 13, 9651, 325, 29896, 12313, 353, 478, 29896, 19346, 29898, 13, 18884, 2777, 29918, 2271, 353, 5236, 3057, 6004, 5350, 29889, 8758, 29918, 2271, 29892, 13, 18884, 8952, 353, 8952, 29892, 13, 18884, 4800, 353, 4800, 29892, 13, 18884, 671, 29918, 5630, 29918, 294, 29918, 6979, 29922, 8824, 29892, 13, 18884, 1723, 13, 9651, 4452, 353, 325, 29896, 12313, 29889, 29359, 29889, 2622, 877, 1170, 2824, 3488, 29898, 2311, 29922, 29896, 29897, 13, 9651, 4452, 29889, 4102, 580, 396, 3389, 278, 2346, 13, 4706, 5174, 7331, 2392, 408, 321, 29901, 13, 9651, 4974, 29918, 5747, 29898, 29872, 29889, 401, 29892, 11243, 1338, 29898, 29946, 29900, 29896, 511, 2643, 543, 5350, 5229, 363, 9590, 916, 1135, 28733, 1159, 13, 4706, 1683, 29901, 13, 9651, 4974, 29918, 5747, 29898, 8824, 29892, 11243, 1338, 29898, 5574, 511, 2643, 543, 11863, 3957, 14792, 411, 4319, 16140, 1159, 13, 2 ]
src/bratdb/scripts/build.py
kpwhri/bratdb
0
155368
from bratdb.reader import build_brat_dump from bratdb.logger import initialize_logging def main(): import argparse parser = argparse.ArgumentParser(fromfile_prefix_chars='@!') parser.add_argument('anndir', help='Path to directory containing brat annotation files') parser.add_argument('txtdir', default=None, help='Path to directory containing brat annotation files') parser.add_argument('outdir', default='bratdb', help='Path to output directory where brat data will be stored.') parser.add_argument('--logdir', default='.', help='Directory to place log files.') args = parser.parse_args() initialize_logging(logdir=args.logdir) build_brat_dump(args.anndir, args.txtdir, args.outdir) if __name__ == '__main__': main()
[ 1, 515, 1506, 271, 2585, 29889, 16950, 1053, 2048, 29918, 1182, 271, 29918, 15070, 13, 3166, 1506, 271, 2585, 29889, 21707, 1053, 11905, 29918, 21027, 13, 13, 13, 1753, 1667, 7295, 13, 1678, 1053, 1852, 5510, 13, 13, 1678, 13812, 353, 1852, 5510, 29889, 15730, 11726, 29898, 3166, 1445, 29918, 13506, 29918, 305, 1503, 2433, 29992, 29991, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 273, 299, 381, 742, 13, 462, 4706, 1371, 2433, 2605, 304, 3884, 6943, 1506, 271, 17195, 2066, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 3945, 3972, 742, 2322, 29922, 8516, 29892, 13, 462, 4706, 1371, 2433, 2605, 304, 3884, 6943, 1506, 271, 17195, 2066, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 449, 3972, 742, 2322, 2433, 1182, 271, 2585, 742, 13, 462, 4706, 1371, 2433, 2605, 304, 1962, 3884, 988, 1506, 271, 848, 674, 367, 6087, 29889, 1495, 13, 1678, 13812, 29889, 1202, 29918, 23516, 877, 489, 1188, 3972, 742, 2322, 2433, 29889, 742, 13, 462, 4706, 1371, 2433, 9882, 304, 2058, 1480, 2066, 29889, 1495, 13, 1678, 6389, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 13, 1678, 11905, 29918, 21027, 29898, 1188, 3972, 29922, 5085, 29889, 1188, 3972, 29897, 13, 1678, 2048, 29918, 1182, 271, 29918, 15070, 29898, 5085, 29889, 273, 299, 381, 29892, 6389, 29889, 3945, 3972, 29892, 6389, 29889, 449, 3972, 29897, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1667, 580, 13, 2 ]
{{cookiecutter.directory_name}}/config/settings/development.py
ragnarok22/cookiecutter-django
2
28724
<reponame>ragnarok22/cookiecutter-django """ This is the settings file that you use when you're working on the project locally. Local development-specific include DEBUG mode, log level, and activation of developer tools like django-debug-toolsbar """ from .base import * # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '<KEY>' ALLOWED_HOSTS = ['*'] MEDIA_ROOT = os.path.join(BASE_DIR, '{{cookiecutter.directory_name}}', 'media') # email settings EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
[ 1, 529, 276, 1112, 420, 29958, 1431, 24156, 554, 29906, 29906, 29914, 15108, 21199, 6463, 29899, 14095, 13, 15945, 29908, 13, 4013, 338, 278, 6055, 934, 393, 366, 671, 746, 366, 29915, 276, 1985, 373, 278, 2060, 12430, 29889, 13, 7717, 5849, 29899, 14940, 3160, 21681, 4464, 29892, 1480, 3233, 29892, 322, 26229, 310, 13897, 8492, 763, 9557, 29899, 8382, 29899, 8504, 1646, 13, 15945, 29908, 13, 13, 3166, 869, 3188, 1053, 334, 13, 13, 29937, 3725, 22484, 11937, 399, 25614, 29901, 1016, 29915, 29873, 1065, 411, 4744, 6077, 373, 297, 5802, 29991, 13, 18525, 353, 5852, 13, 13, 29937, 3725, 22484, 11937, 399, 25614, 29901, 3013, 278, 7035, 1820, 1304, 297, 5802, 7035, 29991, 13, 1660, 22245, 29911, 29918, 10818, 353, 12801, 10818, 16299, 13, 13, 1964, 27998, 3352, 29918, 20832, 29903, 353, 6024, 29930, 2033, 13, 13, 2303, 4571, 29909, 29918, 21289, 353, 2897, 29889, 2084, 29889, 7122, 29898, 25416, 29918, 9464, 29892, 525, 6224, 15108, 21199, 6463, 29889, 12322, 29918, 978, 930, 742, 525, 9799, 1495, 13, 13, 29937, 4876, 6055, 13, 26862, 6227, 29918, 29933, 11375, 11794, 353, 525, 14095, 29889, 3221, 29889, 2549, 29889, 1627, 1975, 29889, 11058, 29889, 9823, 5841, 355, 29915, 13, 2 ]
git_verkefni_forritun.py
JonasFreyrB/Forritun
0
14176
#<NAME> #25.01.2017 #Forritun #Liður 1 #Byð notanda um tölu 1 tala1=int(input("Sláðu inn tölu 1 ")) #Byð notanda um tölu 2 tala2=int(input("Sláðu inn tölu 2 ")) #Birti tölu 1 og 2 lagðar saman print("Tölurnar lagðar saman ",tala1+tala2) #Birti tölu 1 og 2 margfaldaðar saman print("Tölurnar margfaldaðar saman ",tala1*tala2) #Liður 2 #Byð notanda um fornafn fornafn=input("Sláðu inn fornafnið þitt ") #Byð notanda um eftirnafn eftirnafn=input("Sláðu inn eftirnafnið þitt ") #Birti skilaboð ásamt bæði nöfnin lögð saman print("Halló",fornafn,eftirnafn) #Liður 3 #Byð notanda um texta text=input("Sláðu inn texta ") #Bý til teljara fyrir lágstafi tellagstafi=0 #Bý til teljara fyrir hágstafi telhastafi=0 #Bý til teljara fyrir lágstafi á eftir hástafi tellagstafieftir=0 #Bý til for lykkju sem keyrir í gegnum textann for x in range(len(text)): #Ef stafurinn í texta er bókstafur og er í hástaf if (text[x].isalpha() and text[x].isupper()): #Bæti 1 við teljara fyrir hágstafi telhastafi=telhastafi+1 #Ef næsti stafur er lágstafur if (text[x +1].islower()): #Bæti 1 við teljara fyrir lágstafi á eftir hástafi tellagstafieftir=tellagstafieftir+1 #Ef stafurinn í texta er bókstafur og er í lágstaf elif(text[x].isalpha() and text[x].islower()): #Bæti 1 við teljara fyrir lágstafi tellagstafi=tellagstafi+1 #Birti fjölda hástafi print("Það komu",telhastafi,"hástafir") #Birti fjölda lágstafi print("Það komu",tellagstafi,"lágstafir") #Birti fjölda lágstafi á eftir hástafi print("Það komu",tellagstafieftir,"lágstafir koma strax á eftir hástaf")
[ 1, 396, 29966, 5813, 29958, 13, 29937, 29906, 29945, 29889, 29900, 29896, 29889, 29906, 29900, 29896, 29955, 13, 29937, 2831, 768, 348, 13, 13, 29937, 23410, 30189, 332, 29871, 29896, 13, 13, 29937, 2059, 30189, 451, 5863, 1922, 260, 5873, 29884, 29871, 29896, 13, 29873, 2883, 29896, 29922, 524, 29898, 2080, 703, 16973, 29976, 30189, 29884, 7622, 260, 5873, 29884, 29871, 29896, 376, 876, 13, 29937, 2059, 30189, 451, 5863, 1922, 260, 5873, 29884, 29871, 29906, 13, 29873, 2883, 29906, 29922, 524, 29898, 2080, 703, 16973, 29976, 30189, 29884, 7622, 260, 5873, 29884, 29871, 29906, 376, 876, 13, 29937, 29933, 381, 2034, 260, 5873, 29884, 29871, 29896, 3671, 29871, 29906, 11755, 30189, 279, 3514, 273, 13, 2158, 703, 29911, 5873, 595, 279, 11755, 30189, 279, 3514, 273, 9162, 29873, 2883, 29896, 29974, 29873, 2883, 29906, 29897, 13, 29937, 29933, 381, 2034, 260, 5873, 29884, 29871, 29896, 3671, 29871, 29906, 15276, 18263, 1388, 30189, 279, 3514, 273, 13, 2158, 703, 29911, 5873, 595, 279, 15276, 18263, 1388, 30189, 279, 3514, 273, 9162, 29873, 2883, 29896, 29930, 29873, 2883, 29906, 29897, 13, 13, 29937, 23410, 30189, 332, 29871, 29906, 13, 13, 29937, 2059, 30189, 451, 5863, 1922, 363, 1056, 9144, 13, 1454, 1056, 9144, 29922, 2080, 703, 16973, 29976, 30189, 29884, 7622, 363, 1056, 29888, 1240, 30189, 29871, 30340, 986, 16521, 13, 29937, 2059, 30189, 451, 5863, 1922, 321, 615, 381, 1056, 9144, 13, 9740, 381, 1056, 9144, 29922, 2080, 703, 16973, 29976, 30189, 29884, 7622, 321, 615, 381, 1056, 29888, 1240, 30189, 29871, 30340, 986, 16521, 13, 29937, 29933, 381, 2034, 2071, 309, 370, 29877, 30189, 29871, 1569, 8035, 289, 30078, 30189, 29875, 302, 29997, 9144, 262, 301, 6922, 30189, 3514, 273, 13, 2158, 703, 29950, 497, 29980, 613, 1454, 1056, 9144, 29892, 9740, 381, 1056, 9144, 29897, 13, 13, 29937, 23410, 30189, 332, 29871, 29941, 13, 13, 29937, 2059, 30189, 451, 5863, 1922, 1426, 29874, 13, 726, 29922, 2080, 703, 16973, 29976, 30189, 29884, 7622, 1426, 29874, 16521, 13, 29937, 29933, 30052, 6928, 13547, 29926, 2518, 285, 29891, 12416, 301, 4064, 303, 2142, 29875, 13, 29873, 514, 351, 303, 2142, 29875, 29922, 29900, 13, 29937, 29933, 30052, 6928, 13547, 29926, 2518, 285, 29891, 12416, 298, 4064, 303, 2142, 29875, 13, 28497, 29882, 579, 2142, 29875, 29922, 29900, 13, 29937, 29933, 30052, 6928, 13547, 29926, 2518, 285, 29891, 12416, 301, 4064, 303, 2142, 29875, 3976, 321, 615, 381, 298, 9617, 2142, 29875, 13, 29873, 514, 351, 303, 2142, 347, 615, 381, 29922, 29900, 13, 13, 29937, 29933, 30052, 6928, 363, 21261, 6859, 4900, 3031, 1820, 12416, 14468, 21598, 1949, 1426, 812, 13, 1454, 921, 297, 3464, 29898, 2435, 29898, 726, 22164, 13, 1678, 396, 29923, 29888, 380, 2142, 332, 2559, 14468, 1426, 29874, 604, 289, 15948, 303, 2142, 332, 3671, 604, 14468, 298, 9617, 2142, 13, 1678, 565, 313, 726, 29961, 29916, 1822, 275, 2312, 580, 322, 1426, 29961, 29916, 1822, 275, 21064, 580, 1125, 13, 4706, 396, 29933, 30078, 2034, 29871, 29896, 3516, 30189, 13547, 29926, 2518, 285, 29891, 12416, 298, 4064, 303, 2142, 29875, 13, 4706, 13547, 29882, 579, 2142, 29875, 29922, 28497, 29882, 579, 2142, 29875, 29974, 29896, 13, 4706, 396, 29923, 29888, 302, 30078, 303, 29875, 380, 2142, 332, 604, 301, 4064, 303, 2142, 332, 13, 4706, 565, 313, 726, 29961, 29916, 718, 29896, 1822, 275, 13609, 580, 1125, 13, 9651, 396, 29933, 30078, 2034, 29871, 29896, 3516, 30189, 13547, 29926, 2518, 285, 29891, 12416, 301, 4064, 303, 2142, 29875, 3976, 321, 615, 381, 298, 9617, 2142, 29875, 13, 9651, 2649, 351, 303, 2142, 347, 615, 381, 29922, 29873, 514, 351, 303, 2142, 347, 615, 381, 29974, 29896, 13, 1678, 396, 29923, 29888, 380, 2142, 332, 2559, 14468, 1426, 29874, 604, 289, 15948, 303, 2142, 332, 3671, 604, 14468, 301, 4064, 303, 2142, 13, 1678, 25342, 29898, 726, 29961, 29916, 1822, 275, 2312, 580, 322, 1426, 29961, 29916, 1822, 275, 13609, 580, 1125, 13, 4706, 396, 29933, 30078, 2034, 29871, 29896, 3516, 30189, 13547, 29926, 2518, 285, 29891, 12416, 301, 4064, 303, 2142, 29875, 13, 4706, 2649, 351, 303, 2142, 29875, 29922, 29873, 514, 351, 303, 2142, 29875, 29974, 29896, 13, 29937, 29933, 381, 2034, 285, 12382, 430, 29874, 298, 9617, 2142, 29875, 13, 2158, 703, 30452, 29874, 30189, 4677, 29884, 613, 28497, 29882, 579, 2142, 29875, 1699, 29882, 9617, 2142, 381, 1159, 13, 29937, 29933, 381, 2034, 285, 12382, 430, 29874, 301, 4064, 303, 2142, 29875, 13, 2158, 703, 30452, 29874, 30189, 4677, 29884, 613, 29873, 514, 351, 303, 2142, 29875, 1699, 29880, 4064, 303, 2142, 381, 1159, 13, 29937, 29933, 381, 2034, 285, 12382, 430, 29874, 301, 4064, 303, 2142, 29875, 3976, 321, 615, 381, 298, 9617, 2142, 29875, 13, 2158, 703, 30452, 29874, 30189, 4677, 29884, 613, 29873, 514, 351, 303, 2142, 347, 615, 381, 1699, 29880, 4064, 303, 2142, 381, 413, 4125, 5312, 29916, 3976, 321, 615, 381, 298, 9617, 2142, 1159, 13, 632, 13, 2 ]
application/core/factory/account_factory.py
yntonfon/dashboard-plus
0
41551
from application.core.entity.account import Account from application.core.port.create_account_port import CreateAccountPort class AccountFactory(CreateAccountPort): def create_account(self, payload: dict) -> Account: return Account(**payload)
[ 1, 515, 2280, 29889, 3221, 29889, 10041, 29889, 10149, 1053, 16535, 13, 3166, 2280, 29889, 3221, 29889, 637, 29889, 3258, 29918, 10149, 29918, 637, 1053, 6204, 10601, 2290, 13, 13, 13, 1990, 16535, 5126, 29898, 4391, 10601, 2290, 1125, 13, 13, 1678, 822, 1653, 29918, 10149, 29898, 1311, 29892, 20092, 29901, 9657, 29897, 1599, 16535, 29901, 13, 4706, 736, 16535, 29898, 1068, 23813, 29897, 13, 2 ]
nls/_speech_transcriber.py
aliyun/alibabacloud-nls-python-sdk
15
177968
""" _speech_transcriber.py Copyright 1999-present Alibaba Group Holding Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import logging import uuid import json import threading from nls._core import NlsCore from . import _logging __SPEECH_TRANSCRIBER_NAMESPACE__ = "SpeechTranscriber" __SPEECH_TRANSCRIBER_REQUEST_CMD__ = { "start": "StartTranscription", "stop": "StopTranscription", "control": "ControlTranscriber" } __URL__ = "wss://nls-gateway.cn-shanghai.aliyuncs.com/ws/v1" __all__ = ["NlsSpeechTranscriber"] class NlsSpeechTranscriber: """ Api for realtime speech transcription """ def __init__(self, url=__URL__, akid=None, aksecret=None, token=None, appkey=None, on_start=None, on_sentence_begin=None, on_sentence_end=None, on_result_changed=None, on_completed=None, on_error=None, on_close=None, callback_args=[]): """ NlsSpeechTranscriber initialization Parameters: ----------- url: str websocket url. akid: str access id from aliyun. if you provide a token, ignore this argument. aksecret: str access secret key from aliyun. if you provide a token, ignore this argument. token: str access token. if you do not have a token, provide access id and key secret from your aliyun account. appkey: str appkey from aliyun on_start: function Callback object which is called when recognition started. on_start has two arguments. The 1st argument is message which is a json format string. The 2nd argument is *args which is callback_args. on_sentence_begin: function Callback object which is called when one sentence started. on_sentence_begin has two arguments. The 1st argument is message which is a json format string. The 2nd argument is *args which is callback_args. on_sentence_end: function Callback object which is called when sentence is end. on_sentence_end has two arguments. The 1st argument is message which is a json format string. The 2nd argument is *args which is callback_args. on_result_changed: function Callback object which is called when partial recognition result arrived. on_result_changed has two arguments. The 1st argument is message which is a json format string. The 2nd argument is *args which is callback_args. on_completed: function Callback object which is called when recognition is completed. on_completed has two arguments. The 1st argument is message which is a json format string. The 2nd argument is *args which is callback_args. on_error: function Callback object which is called when any error occurs. on_error has two arguments. The 1st argument is message which is a json format string. The 2nd argument is *args which is callback_args. on_close: function Callback object which is called when connection closed. on_close has one arguments. The 1st argument is *args which is callback_args. callback_args: list callback_args will return in callbacks above for *args. """ self.__response_handler__ = { "SentenceBegin": self.__sentence_begin, "SentenceEnd": self.__sentence_end, "TranscriptionStarted": self.__transcription_started, "TranscriptionResultChanged": self.__transcription_result_changed, "TranscriptionCompleted": self.__transcription_completed, "TaskFailed": self.__task_failed } self.__callback_args = callback_args self.__url = url self.__akid = akid self.__aksecret = aksecret self.__appkey = appkey self.__token = token self.__start_cond = threading.Condition() self.__start_flag = False self.__on_start = on_start self.__on_sentence_begin = on_sentence_begin self.__on_sentence_end = on_sentence_end self.__on_result_changed = on_result_changed self.__on_completed = on_completed self.__on_error = on_error self.__on_close = on_close self.__allow_aformat = ( "pcm", "opus", "opu" ) def __handle_message(self, message): _logging.debug("__handle_message") try: __result = json.loads(message) if __result["header"]["name"] in self.__response_handler__: __handler = self.__response_handler__[ __result["header"]["name"]] __handler(message) else: _logging.error("cannot handle cmd{}".format( __result["header"]["name"])) return except json.JSONDecodeError: _logging.error("cannot parse message:{}".format(message)) return def __tr_core_on_open(self): _logging.debug("__tr_core_on_open") def __tr_core_on_msg(self, msg, *args): _logging.debug("__tr_core_on_msg:msg={} args={}".format(msg, args)) self.__handle_message(msg) def __tr_core_on_error(self, msg, *args): _logging.debug("__tr_core_on_error:msg={} args={}".format(msg, args)) def __tr_core_on_close(self): _logging.debug("__tr_core_on_close") if self.__on_close: self.__on_close(*self.__callback_args) with self.__start_cond: self.__start_flag = False self.__start_cond.notify() def __sentence_begin(self, message): _logging.debug("__sentence_begin") if self.__on_sentence_begin: self.__on_sentence_begin(message, *self.__callback_args) def __sentence_end(self, message): _logging.debug("__sentence_end") if self.__on_sentence_end: self.__on_sentence_end(message, *self.__callback_args) def __transcription_started(self, message): _logging.debug("__transcription_started") if self.__on_start: self.__on_start(message, *self.__callback_args) with self.__start_cond: self.__start_flag = True self.__start_cond.notify() def __transcription_result_changed(self, message): _logging.debug("__transcription_result_changed") if self.__on_result_changed: self.__on_result_changed(message, *self.__callback_args) def __transcription_completed(self, message): _logging.debug("__transcription_completed") self.__nls.shutdown() _logging.debug("__transcription_completed shutdown done") if self.__on_completed: self.__on_completed(message, *self.__callback_args) with self.__start_cond: self.__start_flag = False self.__start_cond.notify() def __task_failed(self, message): _logging.debug("__task_failed") with self.__start_cond: self.__start_flag = False self.__start_cond.notify() if self.__on_error: self.__on_error(message, *self.__callback_args) def start(self, aformat="pcm", sample_rate=16000, ch=1, enable_intermediate_result=False, enable_punctutation_prediction=False, enable_inverse_text_normalization=False, timeout=10, ping_interval=8, ping_timeout=None, ex={}): """ Transcription start Parameters: ----------- aformat: str audio binary format, support: "pcm", "opu", "opus", default is "pcm" sample_rate: int audio sample rate, default is 16000 ch: int audio channels, only support mono which is 1 enable_intermediate_result: bool whether enable return intermediate recognition result, default is False enable_punctutation_prediction: bool whether enable punctutation prediction, default is False enable_inverse_text_normalization: bool whether enable ITN, default is False timeout: int wait timeout for connection setup ping_interval: int send ping interval, 0 for disable ping send, default is 8 ping_timeout: int timeout after send ping and recive pong, set None for disable timeout check and default is None ex: dict dict which will merge into "payload" field in request """ self.__nls = NlsCore( url=self.__url, akid=self.__akid, aksecret=self.__aksecret, token=self.__token, on_open=self.__tr_core_on_open, on_message=self.__tr_core_on_msg, on_close=self.__tr_core_on_close, on_error=self.__tr_core_on_error, callback_args=[]) if ch != 1: raise ValueError("not support channel: {}".format(ch)) if aformat not in self.__allow_aformat: raise ValueError("format {} not support".format(aformat)) __id4 = uuid.uuid4().hex self.__task_id = uuid.uuid4().hex self.__audio_format = aformat __header = { "message_id": __id4, "task_id": self.__task_id, "namespace": __SPEECH_TRANSCRIBER_NAMESPACE__, "name": __SPEECH_TRANSCRIBER_REQUEST_CMD__["start"], "appkey": self.__appkey } __payload = { "format": aformat, "sample_rate": sample_rate, "enable_intermediate_result": enable_intermediate_result, "enable_punctuation_prediction": enable_punctutation_prediction, "enable_inverse_text_normalization": enable_inverse_text_normalization } for key in ex: __payload[key] = ex[key] __msg = { "header": __header, "payload": __payload } __jmsg = json.dumps(__msg) with self.__start_cond: if self.__start_flag: _logging.debug("already start...") return False if self.__nls.start(__jmsg, ping_interval, ping_timeout): if self.__start_flag == False: if self.__start_cond.wait(timeout): return self.__start_flag == True else: return False else: return False def stop(self, timeout=10): """ Stop transcription and mark session finished Parameters: ----------- timeout: int timeout for waiting completed message from cloud """ __id4 = uuid.uuid4().hex __header = { "message_id": __id4, "task_id": self.__task_id, "namespace": __SPEECH_TRANSCRIBER_NAMESPACE__, "name": __SPEECH_TRANSCRIBER_REQUEST_CMD__["stop"], "appkey": self.__appkey } __msg = { "header": __header } __jmsg = json.dumps(__msg) with self.__start_cond: if not self.__start_flag: _logging.debug("not start yet...") return False self.__nls.send(__jmsg, False) if self.__start_flag == True: _logging.debug("stop wait..") if self.__start_cond.wait(timeout): return self.__start_flag == False else: return False else: return True def ctrl(self, ex={}): """ Send control message to cloud Parameters: ----------- ex: dict dict which will merge into "payload" field in request """ __id4 = uuid.uuid4().hex __header = { "message_id": __id4, "task_id": self.__task_id, "namespace": __SPEECH_TRANSCRIBER_NAMESPACE__, "name": __SPEECH_TRANSCRIBER_REQUEST_CMD__["control"], "appkey": self.__appkey } __msg = { "header": __header, "payload": ex } __jmsg = json.dumps(__msg) with self.__start_cond: if not self.__start_flag: _logging.debug("not start yet...") return False self.__nls.send(__jmsg, False) return True def shutdown(self): """ Shutdown connection immediately """ self.__nls.shutdown() def send_audio(self, pcm_data): """ Send audio binary, audio size prefer 20ms length Parameters: ----------- pcm_data: bytes audio binary which format is "aformat" in start method """ __data = pcm_data with self.__start_cond: if not self.__start_flag: return False try: self.__nls.send(__data, True) except ConnectionResetError as __e: _logging.error("connection reset") self.__start_flag = False self.__nls.shutdown() raise __e return False return True
[ 1, 9995, 13, 29918, 5965, 5309, 29918, 3286, 699, 495, 29889, 2272, 13, 13, 11882, 1266, 29871, 29896, 29929, 29929, 29929, 29899, 6338, 319, 1982, 5363, 6431, 21771, 292, 19806, 29889, 13, 13, 29931, 293, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 6293, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 3492, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 13, 1124, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 13, 2525, 2222, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 5721, 7541, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29956, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 13393, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 13400, 800, 1090, 278, 19245, 29889, 13, 15945, 29908, 13, 13, 5215, 12183, 13, 5215, 318, 5416, 13, 5215, 4390, 13, 5215, 3244, 292, 13, 13, 3166, 302, 3137, 3032, 3221, 1053, 405, 3137, 9203, 13, 3166, 869, 1053, 903, 21027, 13, 13, 1649, 29903, 4162, 29923, 3210, 29918, 26813, 7187, 3960, 13635, 29918, 5813, 5550, 11538, 1649, 353, 376, 10649, 5309, 4300, 699, 495, 29908, 13, 13, 1649, 29903, 4162, 29923, 3210, 29918, 26813, 7187, 3960, 13635, 29918, 16244, 29918, 29907, 5773, 1649, 353, 426, 13, 1678, 376, 2962, 1115, 376, 4763, 4300, 3395, 613, 13, 1678, 376, 9847, 1115, 376, 16329, 4300, 3395, 613, 13, 1678, 376, 6451, 1115, 376, 4809, 4300, 699, 495, 29908, 13, 29913, 13, 13, 1649, 4219, 1649, 353, 376, 29893, 893, 597, 29876, 3137, 29899, 17062, 1582, 29889, 18038, 29899, 845, 574, 23535, 29889, 2606, 29891, 348, 2395, 29889, 510, 29914, 5652, 29914, 29894, 29896, 29908, 13, 1649, 497, 1649, 353, 6796, 29940, 3137, 10649, 5309, 4300, 699, 495, 3108, 13, 13, 13, 1990, 405, 3137, 10649, 5309, 4300, 699, 495, 29901, 13, 1678, 9995, 13, 1678, 29749, 363, 1855, 2230, 12032, 1301, 3395, 13, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3142, 29922, 1649, 4219, 1649, 29892, 13, 462, 11208, 333, 29922, 8516, 29892, 11208, 19024, 29922, 8516, 29892, 13, 462, 5993, 29922, 8516, 29892, 623, 1989, 29922, 8516, 29892, 13, 462, 373, 29918, 2962, 29922, 8516, 29892, 13, 462, 373, 29918, 18616, 663, 29918, 463, 29922, 8516, 29892, 13, 462, 373, 29918, 18616, 663, 29918, 355, 29922, 8516, 29892, 13, 462, 373, 29918, 2914, 29918, 15033, 29922, 8516, 29892, 13, 462, 373, 29918, 5729, 9446, 29922, 8516, 29892, 13, 462, 373, 29918, 2704, 29922, 8516, 29892, 373, 29918, 5358, 29922, 8516, 29892, 13, 462, 6939, 29918, 5085, 29922, 2636, 1125, 13, 4706, 9995, 13, 4706, 405, 3137, 10649, 5309, 4300, 699, 495, 17865, 13, 13, 4706, 12662, 2699, 29901, 13, 4706, 448, 28400, 13, 4706, 3142, 29901, 851, 13, 9651, 1856, 11514, 3142, 29889, 13, 4706, 11208, 333, 29901, 851, 13, 9651, 2130, 1178, 515, 14430, 29891, 348, 29889, 565, 366, 3867, 263, 5993, 29892, 11455, 445, 2980, 29889, 13, 4706, 11208, 19024, 29901, 851, 13, 9651, 2130, 7035, 1820, 515, 14430, 29891, 348, 29889, 565, 366, 3867, 263, 5993, 29892, 11455, 445, 13, 9651, 2980, 29889, 13, 4706, 5993, 29901, 851, 13, 9651, 2130, 5993, 29889, 565, 366, 437, 451, 505, 263, 5993, 29892, 3867, 2130, 1178, 322, 1820, 13, 9651, 7035, 515, 596, 14430, 29891, 348, 3633, 29889, 13, 4706, 623, 1989, 29901, 851, 13, 9651, 623, 1989, 515, 14430, 29891, 348, 13, 4706, 373, 29918, 2962, 29901, 740, 13, 9651, 8251, 1627, 1203, 607, 338, 2000, 746, 19679, 4687, 29889, 13, 9651, 373, 29918, 2962, 756, 1023, 6273, 29889, 13, 9651, 450, 29871, 29896, 303, 2980, 338, 2643, 607, 338, 263, 4390, 3402, 1347, 29889, 13, 9651, 450, 29871, 29906, 299, 2980, 338, 334, 5085, 607, 338, 6939, 29918, 5085, 29889, 13, 4706, 373, 29918, 18616, 663, 29918, 463, 29901, 740, 13, 9651, 8251, 1627, 1203, 607, 338, 2000, 746, 697, 10541, 4687, 29889, 13, 9651, 373, 29918, 18616, 663, 29918, 463, 756, 1023, 6273, 29889, 13, 9651, 450, 29871, 29896, 303, 2980, 338, 2643, 607, 338, 263, 4390, 3402, 1347, 29889, 13, 9651, 450, 29871, 29906, 299, 2980, 338, 334, 5085, 607, 338, 6939, 29918, 5085, 29889, 13, 4706, 373, 29918, 18616, 663, 29918, 355, 29901, 740, 13, 9651, 8251, 1627, 1203, 607, 338, 2000, 746, 10541, 338, 1095, 29889, 13, 9651, 373, 29918, 18616, 663, 29918, 355, 756, 1023, 6273, 29889, 13, 9651, 450, 29871, 29896, 303, 2980, 338, 2643, 607, 338, 263, 4390, 3402, 1347, 29889, 13, 9651, 450, 29871, 29906, 299, 2980, 338, 334, 5085, 607, 338, 6939, 29918, 5085, 29889, 13, 4706, 373, 29918, 2914, 29918, 15033, 29901, 740, 13, 9651, 8251, 1627, 1203, 607, 338, 2000, 746, 7687, 19679, 1121, 13, 9651, 11977, 29889, 13, 9651, 373, 29918, 2914, 29918, 15033, 756, 1023, 6273, 29889, 13, 9651, 450, 29871, 29896, 303, 2980, 338, 2643, 607, 338, 263, 4390, 3402, 1347, 29889, 13, 9651, 450, 29871, 29906, 299, 2980, 338, 334, 5085, 607, 338, 6939, 29918, 5085, 29889, 13, 4706, 373, 29918, 5729, 9446, 29901, 740, 13, 9651, 8251, 1627, 1203, 607, 338, 2000, 746, 19679, 338, 8676, 29889, 13, 9651, 373, 29918, 5729, 9446, 756, 1023, 6273, 29889, 13, 9651, 450, 29871, 29896, 303, 2980, 338, 2643, 607, 338, 263, 4390, 3402, 1347, 29889, 13, 9651, 450, 29871, 29906, 299, 2980, 338, 334, 5085, 607, 338, 6939, 29918, 5085, 29889, 13, 4706, 373, 29918, 2704, 29901, 740, 13, 9651, 8251, 1627, 1203, 607, 338, 2000, 746, 738, 1059, 10008, 29889, 13, 9651, 373, 29918, 2704, 756, 1023, 6273, 29889, 13, 9651, 450, 29871, 29896, 303, 2980, 338, 2643, 607, 338, 263, 4390, 3402, 1347, 29889, 13, 9651, 450, 29871, 29906, 299, 2980, 338, 334, 5085, 607, 338, 6939, 29918, 5085, 29889, 13, 4706, 373, 29918, 5358, 29901, 740, 13, 9651, 8251, 1627, 1203, 607, 338, 2000, 746, 3957, 5764, 29889, 13, 9651, 373, 29918, 5358, 756, 697, 6273, 29889, 13, 9651, 450, 29871, 29896, 303, 2980, 338, 334, 5085, 607, 338, 6939, 29918, 5085, 29889, 13, 4706, 6939, 29918, 5085, 29901, 1051, 13, 9651, 6939, 29918, 5085, 674, 736, 297, 6939, 29879, 2038, 363, 334, 5085, 29889, 13, 4706, 9995, 13, 4706, 1583, 17255, 5327, 29918, 13789, 1649, 353, 426, 13, 9651, 376, 29903, 296, 663, 17946, 1115, 1583, 17255, 18616, 663, 29918, 463, 29892, 13, 9651, 376, 29903, 296, 663, 5044, 1115, 1583, 17255, 18616, 663, 29918, 355, 29892, 13, 9651, 376, 4300, 3395, 4763, 287, 1115, 1583, 17255, 3286, 3395, 29918, 2962, 287, 29892, 13, 9651, 376, 4300, 3395, 3591, 7590, 1115, 1583, 17255, 3286, 3395, 29918, 2914, 29918, 15033, 29892, 13, 9651, 376, 4300, 3395, 26010, 1115, 1583, 17255, 3286, 3395, 29918, 5729, 9446, 29892, 13, 9651, 376, 5398, 17776, 1115, 1583, 17255, 7662, 29918, 26061, 13, 4706, 500, 13, 4706, 1583, 17255, 14035, 29918, 5085, 353, 6939, 29918, 5085, 13, 4706, 1583, 17255, 2271, 353, 3142, 13, 4706, 1583, 17255, 557, 333, 353, 11208, 333, 13, 4706, 1583, 17255, 557, 19024, 353, 11208, 19024, 13, 4706, 1583, 17255, 932, 1989, 353, 623, 1989, 13, 4706, 1583, 17255, 6979, 353, 5993, 13, 4706, 1583, 17255, 2962, 29918, 1116, 353, 3244, 292, 29889, 25255, 580, 13, 4706, 1583, 17255, 2962, 29918, 15581, 353, 7700, 13, 4706, 1583, 17255, 265, 29918, 2962, 353, 373, 29918, 2962, 13, 4706, 1583, 17255, 265, 29918, 18616, 663, 29918, 463, 353, 373, 29918, 18616, 663, 29918, 463, 13, 4706, 1583, 17255, 265, 29918, 18616, 663, 29918, 355, 353, 373, 29918, 18616, 663, 29918, 355, 13, 4706, 1583, 17255, 265, 29918, 2914, 29918, 15033, 353, 373, 29918, 2914, 29918, 15033, 13, 4706, 1583, 17255, 265, 29918, 5729, 9446, 353, 373, 29918, 5729, 9446, 13, 4706, 1583, 17255, 265, 29918, 2704, 353, 373, 29918, 2704, 13, 4706, 1583, 17255, 265, 29918, 5358, 353, 373, 29918, 5358, 13, 4706, 1583, 17255, 9536, 29918, 29874, 4830, 353, 313, 13, 9651, 376, 29886, 4912, 613, 376, 26466, 613, 376, 459, 29884, 29908, 13, 4706, 1723, 13, 13, 1678, 822, 4770, 8411, 29918, 4906, 29898, 1311, 29892, 2643, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 8411, 29918, 4906, 1159, 13, 4706, 1018, 29901, 13, 9651, 4770, 2914, 353, 4390, 29889, 18132, 29898, 4906, 29897, 13, 9651, 565, 4770, 2914, 3366, 6672, 3108, 3366, 978, 3108, 297, 1583, 17255, 5327, 29918, 13789, 1649, 29901, 13, 18884, 4770, 13789, 353, 1583, 17255, 5327, 29918, 13789, 1649, 29961, 13, 462, 1678, 4770, 2914, 3366, 6672, 3108, 3366, 978, 3108, 29962, 13, 18884, 4770, 13789, 29898, 4906, 29897, 13, 9651, 1683, 29901, 13, 18884, 903, 21027, 29889, 2704, 703, 29883, 6735, 4386, 9920, 8875, 1642, 4830, 29898, 13, 462, 1678, 4770, 2914, 3366, 6672, 3108, 3366, 978, 3108, 876, 13, 18884, 736, 13, 4706, 5174, 4390, 29889, 7249, 2772, 401, 2392, 29901, 13, 9651, 903, 21027, 29889, 2704, 703, 29883, 6735, 6088, 2643, 29901, 8875, 1642, 4830, 29898, 4906, 876, 13, 9651, 736, 13, 13, 1678, 822, 4770, 509, 29918, 3221, 29918, 265, 29918, 3150, 29898, 1311, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 509, 29918, 3221, 29918, 265, 29918, 3150, 1159, 13, 13, 1678, 822, 4770, 509, 29918, 3221, 29918, 265, 29918, 7645, 29898, 1311, 29892, 10191, 29892, 334, 5085, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 509, 29918, 3221, 29918, 265, 29918, 7645, 29901, 7645, 3790, 29913, 6389, 3790, 29913, 1642, 4830, 29898, 7645, 29892, 6389, 876, 13, 4706, 1583, 17255, 8411, 29918, 4906, 29898, 7645, 29897, 13, 13, 1678, 822, 4770, 509, 29918, 3221, 29918, 265, 29918, 2704, 29898, 1311, 29892, 10191, 29892, 334, 5085, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 509, 29918, 3221, 29918, 265, 29918, 2704, 29901, 7645, 3790, 29913, 6389, 3790, 29913, 1642, 4830, 29898, 7645, 29892, 6389, 876, 13, 13, 1678, 822, 4770, 509, 29918, 3221, 29918, 265, 29918, 5358, 29898, 1311, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 509, 29918, 3221, 29918, 265, 29918, 5358, 1159, 13, 4706, 565, 1583, 17255, 265, 29918, 5358, 29901, 13, 9651, 1583, 17255, 265, 29918, 5358, 10456, 1311, 17255, 14035, 29918, 5085, 29897, 13, 4706, 411, 1583, 17255, 2962, 29918, 1116, 29901, 13, 9651, 1583, 17255, 2962, 29918, 15581, 353, 7700, 13, 9651, 1583, 17255, 2962, 29918, 1116, 29889, 25140, 580, 13, 13, 1678, 822, 4770, 18616, 663, 29918, 463, 29898, 1311, 29892, 2643, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 18616, 663, 29918, 463, 1159, 13, 4706, 565, 1583, 17255, 265, 29918, 18616, 663, 29918, 463, 29901, 13, 9651, 1583, 17255, 265, 29918, 18616, 663, 29918, 463, 29898, 4906, 29892, 334, 1311, 17255, 14035, 29918, 5085, 29897, 13, 13, 1678, 822, 4770, 18616, 663, 29918, 355, 29898, 1311, 29892, 2643, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 18616, 663, 29918, 355, 1159, 13, 4706, 565, 1583, 17255, 265, 29918, 18616, 663, 29918, 355, 29901, 13, 9651, 1583, 17255, 265, 29918, 18616, 663, 29918, 355, 29898, 4906, 29892, 334, 1311, 17255, 14035, 29918, 5085, 29897, 13, 13, 1678, 822, 4770, 3286, 3395, 29918, 2962, 287, 29898, 1311, 29892, 2643, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 3286, 3395, 29918, 2962, 287, 1159, 13, 4706, 565, 1583, 17255, 265, 29918, 2962, 29901, 13, 9651, 1583, 17255, 265, 29918, 2962, 29898, 4906, 29892, 334, 1311, 17255, 14035, 29918, 5085, 29897, 13, 4706, 411, 1583, 17255, 2962, 29918, 1116, 29901, 13, 9651, 1583, 17255, 2962, 29918, 15581, 353, 5852, 13, 9651, 1583, 17255, 2962, 29918, 1116, 29889, 25140, 580, 13, 13, 1678, 822, 4770, 3286, 3395, 29918, 2914, 29918, 15033, 29898, 1311, 29892, 2643, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 3286, 3395, 29918, 2914, 29918, 15033, 1159, 13, 4706, 565, 1583, 17255, 265, 29918, 2914, 29918, 15033, 29901, 13, 9651, 1583, 17255, 265, 29918, 2914, 29918, 15033, 29898, 4906, 29892, 334, 1311, 17255, 14035, 29918, 5085, 29897, 13, 13, 1678, 822, 4770, 3286, 3395, 29918, 5729, 9446, 29898, 1311, 29892, 2643, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 3286, 3395, 29918, 5729, 9446, 1159, 13, 4706, 1583, 17255, 29876, 3137, 29889, 845, 329, 3204, 580, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 3286, 3395, 29918, 5729, 9446, 12522, 3204, 2309, 1159, 13, 4706, 565, 1583, 17255, 265, 29918, 5729, 9446, 29901, 13, 9651, 1583, 17255, 265, 29918, 5729, 9446, 29898, 4906, 29892, 334, 1311, 17255, 14035, 29918, 5085, 29897, 13, 4706, 411, 1583, 17255, 2962, 29918, 1116, 29901, 13, 9651, 1583, 17255, 2962, 29918, 15581, 353, 7700, 13, 9651, 1583, 17255, 2962, 29918, 1116, 29889, 25140, 580, 13, 13, 1678, 822, 4770, 7662, 29918, 26061, 29898, 1311, 29892, 2643, 1125, 13, 4706, 903, 21027, 29889, 8382, 703, 1649, 7662, 29918, 26061, 1159, 13, 4706, 411, 1583, 17255, 2962, 29918, 1116, 29901, 13, 9651, 1583, 17255, 2962, 29918, 15581, 353, 7700, 13, 9651, 1583, 17255, 2962, 29918, 1116, 29889, 25140, 580, 13, 4706, 565, 1583, 17255, 265, 29918, 2704, 29901, 13, 9651, 1583, 17255, 265, 29918, 2704, 29898, 4906, 29892, 334, 1311, 17255, 14035, 29918, 5085, 29897, 13, 13, 1678, 822, 1369, 29898, 1311, 29892, 263, 4830, 543, 29886, 4912, 613, 4559, 29918, 10492, 29922, 29896, 29953, 29900, 29900, 29900, 29892, 521, 29922, 29896, 29892, 13, 795, 9025, 29918, 1639, 13847, 29918, 2914, 29922, 8824, 29892, 13, 795, 9025, 29918, 29886, 18049, 329, 362, 29918, 11965, 2463, 29922, 8824, 29892, 13, 795, 9025, 29918, 262, 3901, 29918, 726, 29918, 8945, 2133, 29922, 8824, 29892, 13, 795, 11815, 29922, 29896, 29900, 29892, 13, 795, 24543, 29918, 19207, 29922, 29947, 29892, 13, 795, 24543, 29918, 15619, 29922, 8516, 29892, 13, 795, 429, 3790, 29913, 1125, 13, 4706, 9995, 13, 4706, 4103, 3395, 1369, 29871, 13, 13, 4706, 12662, 2699, 29901, 13, 4706, 448, 28400, 13, 4706, 263, 4830, 29901, 851, 13, 9651, 10348, 7581, 3402, 29892, 2304, 29901, 376, 29886, 4912, 613, 376, 459, 29884, 613, 376, 26466, 613, 2322, 338, 376, 29886, 4912, 29908, 13, 4706, 4559, 29918, 10492, 29901, 938, 13, 9651, 10348, 4559, 6554, 29892, 2322, 338, 29871, 29896, 29953, 29900, 29900, 29900, 13, 4706, 521, 29901, 938, 13, 9651, 10348, 18196, 29892, 871, 2304, 1601, 29877, 607, 338, 29871, 29896, 13, 4706, 9025, 29918, 1639, 13847, 29918, 2914, 29901, 6120, 13, 9651, 3692, 9025, 736, 19697, 19679, 1121, 29892, 2322, 338, 7700, 13, 4706, 9025, 29918, 29886, 18049, 329, 362, 29918, 11965, 2463, 29901, 6120, 13, 9651, 3692, 9025, 6035, 312, 329, 362, 18988, 29892, 2322, 338, 7700, 13, 4706, 9025, 29918, 262, 3901, 29918, 726, 29918, 8945, 2133, 29901, 6120, 13, 9651, 3692, 9025, 13315, 29940, 29892, 2322, 338, 7700, 13, 4706, 11815, 29901, 938, 13, 9651, 4480, 11815, 363, 3957, 6230, 13, 4706, 24543, 29918, 19207, 29901, 938, 13, 9651, 3638, 24543, 7292, 29892, 29871, 29900, 363, 11262, 24543, 3638, 29892, 2322, 338, 29871, 29947, 13, 4706, 24543, 29918, 15619, 29901, 938, 13, 9651, 11815, 1156, 3638, 24543, 322, 9522, 345, 282, 549, 29892, 731, 6213, 363, 11262, 11815, 1423, 322, 2322, 338, 6213, 13, 4706, 429, 29901, 9657, 13, 9651, 9657, 607, 674, 10366, 964, 376, 23813, 29908, 1746, 297, 2009, 13, 4706, 9995, 13, 4706, 1583, 17255, 29876, 3137, 353, 405, 3137, 9203, 29898, 13, 9651, 3142, 29922, 1311, 17255, 2271, 29892, 11208, 333, 29922, 1311, 17255, 557, 333, 29892, 11208, 19024, 29922, 1311, 17255, 557, 19024, 29892, 13, 9651, 5993, 29922, 1311, 17255, 6979, 29892, 13, 9651, 373, 29918, 3150, 29922, 1311, 17255, 509, 29918, 3221, 29918, 265, 29918, 3150, 29892, 13, 9651, 373, 29918, 4906, 29922, 1311, 17255, 509, 29918, 3221, 29918, 265, 29918, 7645, 29892, 13, 9651, 373, 29918, 5358, 29922, 1311, 17255, 509, 29918, 3221, 29918, 265, 29918, 5358, 29892, 13, 9651, 373, 29918, 2704, 29922, 1311, 17255, 509, 29918, 3221, 29918, 265, 29918, 2704, 29892, 13, 9651, 6939, 29918, 5085, 11759, 2314, 13, 13, 4706, 565, 521, 2804, 29871, 29896, 29901, 13, 9651, 12020, 7865, 2392, 703, 1333, 2304, 8242, 29901, 6571, 1642, 4830, 29898, 305, 876, 13, 4706, 565, 263, 4830, 451, 297, 1583, 17255, 9536, 29918, 29874, 4830, 29901, 13, 9651, 12020, 7865, 2392, 703, 4830, 6571, 451, 2304, 1642, 4830, 29898, 29874, 4830, 876, 13, 4706, 4770, 333, 29946, 353, 318, 5416, 29889, 25118, 29946, 2141, 20970, 13, 4706, 1583, 17255, 7662, 29918, 333, 353, 318, 5416, 29889, 25118, 29946, 2141, 20970, 13, 4706, 1583, 17255, 18494, 29918, 4830, 353, 263, 4830, 13, 13, 4706, 4770, 6672, 353, 426, 13, 9651, 376, 4906, 29918, 333, 1115, 4770, 333, 29946, 29892, 13, 9651, 376, 7662, 29918, 333, 1115, 1583, 17255, 7662, 29918, 333, 29892, 13, 9651, 376, 22377, 1115, 4770, 29903, 4162, 29923, 3210, 29918, 26813, 7187, 3960, 13635, 29918, 5813, 5550, 11538, 1649, 29892, 13, 9651, 376, 978, 1115, 4770, 29903, 4162, 29923, 3210, 29918, 26813, 7187, 3960, 13635, 29918, 16244, 29918, 29907, 5773, 1649, 3366, 2962, 12436, 13, 9651, 376, 932, 1989, 1115, 1583, 17255, 932, 1989, 13, 4706, 500, 13, 4706, 4770, 23813, 353, 426, 13, 9651, 376, 4830, 1115, 263, 4830, 29892, 13, 9651, 376, 11249, 29918, 10492, 1115, 4559, 29918, 10492, 29892, 13, 9651, 376, 12007, 29918, 1639, 13847, 29918, 2914, 1115, 9025, 29918, 1639, 13847, 29918, 2914, 29892, 13, 9651, 376, 12007, 29918, 29886, 18049, 29884, 362, 29918, 11965, 2463, 1115, 9025, 29918, 29886, 18049, 329, 362, 29918, 11965, 2463, 29892, 13, 9651, 376, 12007, 29918, 262, 3901, 29918, 726, 29918, 8945, 2133, 1115, 9025, 29918, 262, 3901, 29918, 726, 29918, 8945, 2133, 13, 4706, 500, 13, 13, 4706, 363, 1820, 297, 429, 29901, 13, 9651, 4770, 23813, 29961, 1989, 29962, 353, 429, 29961, 1989, 29962, 13, 13, 4706, 4770, 7645, 353, 426, 13, 9651, 376, 6672, 1115, 4770, 6672, 29892, 13, 9651, 376, 23813, 1115, 4770, 23813, 13, 4706, 500, 13, 4706, 4770, 29926, 7645, 353, 4390, 29889, 29881, 17204, 22168, 7645, 29897, 13, 4706, 411, 1583, 17255, 2962, 29918, 1116, 29901, 13, 9651, 565, 1583, 17255, 2962, 29918, 15581, 29901, 13, 18884, 903, 21027, 29889, 8382, 703, 284, 2040, 1369, 856, 1159, 13, 18884, 736, 7700, 13, 9651, 565, 1583, 17255, 29876, 3137, 29889, 2962, 22168, 29926, 7645, 29892, 24543, 29918, 19207, 29892, 24543, 29918, 15619, 1125, 13, 18884, 565, 1583, 17255, 2962, 29918, 15581, 1275, 7700, 29901, 13, 462, 1678, 565, 1583, 17255, 2962, 29918, 1116, 29889, 10685, 29898, 15619, 1125, 13, 462, 4706, 736, 1583, 17255, 2962, 29918, 15581, 1275, 5852, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 736, 7700, 13, 9651, 1683, 29901, 13, 18884, 736, 7700, 13, 13, 1678, 822, 5040, 29898, 1311, 29892, 11815, 29922, 29896, 29900, 1125, 13, 4706, 9995, 13, 4706, 22303, 1301, 3395, 322, 2791, 4867, 7743, 13, 13, 4706, 12662, 2699, 29901, 13, 4706, 448, 28400, 13, 4706, 11815, 29901, 938, 13, 9651, 11815, 363, 10534, 8676, 2643, 515, 9570, 13, 4706, 9995, 13, 4706, 4770, 333, 29946, 353, 318, 5416, 29889, 25118, 29946, 2141, 20970, 13, 4706, 4770, 6672, 353, 426, 13, 9651, 376, 4906, 29918, 333, 1115, 4770, 333, 29946, 29892, 13, 9651, 376, 7662, 29918, 333, 1115, 1583, 17255, 7662, 29918, 333, 29892, 13, 9651, 376, 22377, 1115, 4770, 29903, 4162, 29923, 3210, 29918, 26813, 7187, 3960, 13635, 29918, 5813, 5550, 11538, 1649, 29892, 13, 9651, 376, 978, 1115, 4770, 29903, 4162, 29923, 3210, 29918, 26813, 7187, 3960, 13635, 29918, 16244, 29918, 29907, 5773, 1649, 3366, 9847, 12436, 13, 9651, 376, 932, 1989, 1115, 1583, 17255, 932, 1989, 13, 4706, 500, 13, 4706, 4770, 7645, 353, 426, 13, 9651, 376, 6672, 1115, 4770, 6672, 13, 4706, 500, 13, 4706, 4770, 29926, 7645, 353, 4390, 29889, 29881, 17204, 22168, 7645, 29897, 13, 4706, 411, 1583, 17255, 2962, 29918, 1116, 29901, 13, 9651, 565, 451, 1583, 17255, 2962, 29918, 15581, 29901, 13, 18884, 903, 21027, 29889, 8382, 703, 1333, 1369, 3447, 856, 1159, 13, 18884, 736, 7700, 13, 9651, 1583, 17255, 29876, 3137, 29889, 6717, 22168, 29926, 7645, 29892, 7700, 29897, 13, 9651, 565, 1583, 17255, 2962, 29918, 15581, 1275, 5852, 29901, 13, 18884, 903, 21027, 29889, 8382, 703, 9847, 4480, 636, 1159, 13, 18884, 565, 1583, 17255, 2962, 29918, 1116, 29889, 10685, 29898, 15619, 1125, 13, 462, 1678, 736, 1583, 17255, 2962, 29918, 15581, 1275, 7700, 13, 18884, 1683, 29901, 13, 462, 1678, 736, 7700, 13, 9651, 1683, 29901, 13, 18884, 736, 5852, 13, 13, 1678, 822, 274, 11742, 29898, 1311, 29892, 429, 3790, 29913, 1125, 13, 4706, 9995, 13, 4706, 15076, 2761, 2643, 304, 9570, 13, 13, 4706, 12662, 2699, 29901, 13, 4706, 448, 28400, 13, 4706, 429, 29901, 9657, 13, 9651, 9657, 607, 674, 10366, 964, 376, 23813, 29908, 1746, 297, 2009, 13, 4706, 9995, 13, 4706, 4770, 333, 29946, 353, 318, 5416, 29889, 25118, 29946, 2141, 20970, 13, 4706, 4770, 6672, 353, 426, 13, 9651, 376, 4906, 29918, 333, 1115, 4770, 333, 29946, 29892, 13, 9651, 376, 7662, 29918, 333, 1115, 1583, 17255, 7662, 29918, 333, 29892, 13, 9651, 376, 22377, 1115, 4770, 29903, 4162, 29923, 3210, 29918, 26813, 7187, 3960, 13635, 29918, 5813, 5550, 11538, 1649, 29892, 13, 9651, 376, 978, 1115, 4770, 29903, 4162, 29923, 3210, 29918, 26813, 7187, 3960, 13635, 29918, 16244, 29918, 29907, 5773, 1649, 3366, 6451, 12436, 13, 9651, 376, 932, 1989, 1115, 1583, 17255, 932, 1989, 13, 4706, 500, 13, 4706, 4770, 7645, 353, 426, 13, 9651, 376, 6672, 1115, 4770, 6672, 29892, 13, 9651, 376, 23813, 1115, 429, 13, 4706, 500, 13, 4706, 4770, 29926, 7645, 353, 4390, 29889, 29881, 17204, 22168, 7645, 29897, 13, 4706, 411, 1583, 17255, 2962, 29918, 1116, 29901, 13, 9651, 565, 451, 1583, 17255, 2962, 29918, 15581, 29901, 13, 18884, 903, 21027, 29889, 8382, 703, 1333, 1369, 3447, 856, 1159, 13, 18884, 736, 7700, 13, 9651, 1583, 17255, 29876, 3137, 29889, 6717, 22168, 29926, 7645, 29892, 7700, 29897, 13, 9651, 736, 5852, 13, 13, 1678, 822, 12522, 3204, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 1383, 329, 3204, 3957, 7389, 13, 4706, 9995, 13, 4706, 1583, 17255, 29876, 3137, 29889, 845, 329, 3204, 580, 13, 13, 1678, 822, 3638, 29918, 18494, 29898, 1311, 29892, 282, 4912, 29918, 1272, 1125, 13, 4706, 9995, 13, 4706, 15076, 10348, 7581, 29892, 10348, 2159, 5821, 29871, 29906, 29900, 1516, 3309, 29871, 13, 13, 4706, 12662, 2699, 29901, 13, 4706, 448, 28400, 13, 4706, 282, 4912, 29918, 1272, 29901, 6262, 13, 9651, 10348, 7581, 607, 3402, 338, 376, 29874, 4830, 29908, 297, 1369, 1158, 29871, 13, 4706, 9995, 13, 13, 4706, 4770, 1272, 353, 282, 4912, 29918, 1272, 13, 4706, 411, 1583, 17255, 2962, 29918, 1116, 29901, 13, 9651, 565, 451, 1583, 17255, 2962, 29918, 15581, 29901, 13, 18884, 736, 7700, 13, 4706, 1018, 29901, 13, 9651, 1583, 17255, 29876, 3137, 29889, 6717, 22168, 1272, 29892, 5852, 29897, 13, 4706, 5174, 15160, 27175, 2392, 408, 4770, 29872, 29901, 13, 9651, 903, 21027, 29889, 2704, 703, 9965, 10092, 1159, 13, 9651, 1583, 17255, 2962, 29918, 15581, 353, 7700, 13, 9651, 1583, 17255, 29876, 3137, 29889, 845, 329, 3204, 580, 13, 9651, 12020, 4770, 29872, 13, 9651, 736, 7700, 13, 4706, 736, 5852, 13, 2 ]
hic_covid_repository/versions/002_Virology.py
LCBRU/hic_covid
0
38136
<filename>hic_covid_repository/versions/002_Virology.py from sqlalchemy import ( MetaData, Table, Column, Integer, NVARCHAR, DateTime, Date, Boolean, ) meta = MetaData() def upgrade(migrate_engine): meta.bind = migrate_engine t = Table( "virology", meta, Column("id", Integer, primary_key=True), Column("uhl_system_number", NVARCHAR(50), index=True, nullable=False), Column("test_id", Integer, nullable=False, index=True, unique=True), Column("laboratory_code", NVARCHAR(50)), Column("order_code", NVARCHAR(50)), Column("order_name", NVARCHAR(50)), Column("test_code", NVARCHAR(50)), Column("test_name", NVARCHAR(50)), Column("organism", NVARCHAR(50)), Column("test_result", NVARCHAR(50)), Column("sample_collected_date_time", DateTime), Column("sample_received_date_time", DateTime), Column("sample_available_date_time", DateTime), Column("order_status", NVARCHAR(50)), ) t.create() def downgrade(migrate_engine): meta.bind = migrate_engine t = Table("virology", meta, autoload=True) t.drop()
[ 1, 529, 9507, 29958, 29882, 293, 29918, 24542, 333, 29918, 19033, 29914, 26100, 29914, 29900, 29900, 29906, 29918, 29963, 3350, 1188, 29891, 29889, 2272, 13, 3166, 4576, 284, 305, 6764, 1053, 313, 13, 1678, 20553, 1469, 29892, 13, 1678, 6137, 29892, 13, 1678, 12481, 29892, 13, 1678, 8102, 29892, 13, 1678, 405, 29963, 15364, 29892, 13, 1678, 12315, 29892, 13, 1678, 4712, 29892, 13, 1678, 11185, 29892, 13, 29897, 13, 13, 13, 7299, 353, 20553, 1469, 580, 13, 13, 13, 1753, 14955, 29898, 26983, 403, 29918, 10599, 1125, 13, 1678, 12700, 29889, 5355, 353, 9725, 403, 29918, 10599, 13, 13, 1678, 260, 353, 6137, 29898, 13, 4706, 376, 1403, 307, 1188, 29891, 613, 13, 4706, 12700, 29892, 13, 4706, 12481, 703, 333, 613, 8102, 29892, 7601, 29918, 1989, 29922, 5574, 511, 13, 4706, 12481, 703, 29884, 4415, 29918, 5205, 29918, 4537, 613, 405, 29963, 15364, 29898, 29945, 29900, 511, 2380, 29922, 5574, 29892, 1870, 519, 29922, 8824, 511, 13, 4706, 12481, 703, 1688, 29918, 333, 613, 8102, 29892, 1870, 519, 29922, 8824, 29892, 2380, 29922, 5574, 29892, 5412, 29922, 5574, 511, 13, 4706, 12481, 703, 29880, 3717, 7606, 29918, 401, 613, 405, 29963, 15364, 29898, 29945, 29900, 8243, 13, 4706, 12481, 703, 2098, 29918, 401, 613, 405, 29963, 15364, 29898, 29945, 29900, 8243, 13, 4706, 12481, 703, 2098, 29918, 978, 613, 405, 29963, 15364, 29898, 29945, 29900, 8243, 13, 4706, 12481, 703, 1688, 29918, 401, 613, 405, 29963, 15364, 29898, 29945, 29900, 8243, 13, 4706, 12481, 703, 1688, 29918, 978, 613, 405, 29963, 15364, 29898, 29945, 29900, 8243, 13, 4706, 12481, 703, 6388, 1608, 613, 405, 29963, 15364, 29898, 29945, 29900, 8243, 13, 4706, 12481, 703, 1688, 29918, 2914, 613, 405, 29963, 15364, 29898, 29945, 29900, 8243, 13, 4706, 12481, 703, 11249, 29918, 15914, 287, 29918, 1256, 29918, 2230, 613, 12315, 511, 13, 4706, 12481, 703, 11249, 29918, 13556, 2347, 29918, 1256, 29918, 2230, 613, 12315, 511, 13, 4706, 12481, 703, 11249, 29918, 16515, 29918, 1256, 29918, 2230, 613, 12315, 511, 13, 4706, 12481, 703, 2098, 29918, 4882, 613, 405, 29963, 15364, 29898, 29945, 29900, 8243, 13, 1678, 1723, 13, 1678, 260, 29889, 3258, 580, 13, 13, 13, 1753, 1623, 8228, 29898, 26983, 403, 29918, 10599, 1125, 13, 1678, 12700, 29889, 5355, 353, 9725, 403, 29918, 10599, 13, 1678, 260, 353, 6137, 703, 1403, 307, 1188, 29891, 613, 12700, 29892, 1120, 3543, 328, 29922, 5574, 29897, 13, 1678, 260, 29889, 8865, 580, 13, 2 ]
hdp-ambari-mpack-3.1.4.0/stacks/HDP/3.0/services/OOZIE/package/scripts/oozie_client.py
dropoftruth/dfhz_hdp_mpack
3
197302
<filename>hdp-ambari-mpack-3.1.4.0/stacks/HDP/3.0/services/OOZIE/package/scripts/oozie_client.py<gh_stars>1-10 #!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import sys from resource_management.libraries.script.script import Script from resource_management.libraries.functions import stack_select from resource_management.libraries.functions.constants import StackFeature from resource_management.libraries.functions.stack_features import check_stack_feature from resource_management.core.logger import Logger from resource_management.core.exceptions import ClientComponentHasNoStatus from oozie import oozie from oozie_service import oozie_service class OozieClient(Script): def install(self, env): self.install_packages(env) self.configure(env) def configure(self, env): import params env.set_params(params) oozie(is_server=False) def status(self, env): raise ClientComponentHasNoStatus() def pre_upgrade_restart(self, env, upgrade_type=None): import params env.set_params(params) # this function should not execute if the version can't be determined or # the stack does not support rolling upgrade if not (params.version and check_stack_feature(StackFeature.ROLLING_UPGRADE, params.version)): return Logger.info("Executing Oozie Client Stack Upgrade pre-restart") stack_select.select_packages(params.version) # We substitute some configs (oozie.authentication.kerberos.principal) before generation (see oozie.py and params.py). # This function returns changed configs (it's used for config generation before config download) def generate_configs_get_xml_file_content(self, filename, dictionary): if dictionary == 'oozie-site': import params config = self.get_config() return {'configurations': params.oozie_site, 'configuration_attributes': config['configurationAttributes'][dictionary]} else: return super(OozieClient, self).generate_configs_get_xml_file_content(filename, dictionary) if __name__ == "__main__": OozieClient().execute()
[ 1, 529, 9507, 29958, 29882, 6099, 29899, 1117, 1306, 29899, 1526, 547, 29899, 29941, 29889, 29896, 29889, 29946, 29889, 29900, 29914, 1429, 29879, 29914, 29950, 11191, 29914, 29941, 29889, 29900, 29914, 9916, 29914, 29949, 29949, 29999, 8673, 29914, 5113, 29914, 16713, 29914, 29877, 2112, 347, 29918, 4645, 29889, 2272, 29966, 12443, 29918, 303, 1503, 29958, 29896, 29899, 29896, 29900, 13, 29937, 14708, 4855, 29914, 2109, 29914, 6272, 3017, 13, 15945, 29908, 13, 29931, 293, 21144, 304, 278, 13380, 18540, 10606, 313, 3289, 29943, 29897, 1090, 697, 13, 272, 901, 17737, 3406, 19405, 8571, 4110, 29889, 29871, 2823, 278, 6058, 12107, 934, 13, 5721, 7541, 411, 445, 664, 363, 5684, 2472, 13, 1727, 20272, 3509, 1266, 27428, 29889, 29871, 450, 3339, 29943, 7794, 11259, 445, 934, 13, 517, 366, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 13, 29908, 29931, 293, 1947, 1496, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 13, 2541, 278, 19245, 29889, 29871, 887, 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, 13, 15945, 29908, 13, 13, 5215, 10876, 13, 3166, 6503, 29918, 21895, 29889, 492, 8464, 29889, 2154, 29889, 2154, 1053, 14415, 13, 3166, 6503, 29918, 21895, 29889, 492, 8464, 29889, 12171, 1053, 5096, 29918, 2622, 13, 3166, 6503, 29918, 21895, 29889, 492, 8464, 29889, 12171, 29889, 3075, 1934, 1053, 10292, 19132, 13, 3166, 6503, 29918, 21895, 29889, 492, 8464, 29889, 12171, 29889, 1429, 29918, 22100, 1053, 1423, 29918, 1429, 29918, 14394, 13, 3166, 6503, 29918, 21895, 29889, 3221, 29889, 21707, 1053, 28468, 13, 3166, 6503, 29918, 21895, 29889, 3221, 29889, 11739, 29879, 1053, 12477, 5308, 14510, 3782, 5709, 13, 13, 3166, 288, 2112, 347, 1053, 288, 2112, 347, 13, 3166, 288, 2112, 347, 29918, 5509, 1053, 288, 2112, 347, 29918, 5509, 13, 13, 13, 1990, 438, 2112, 347, 4032, 29898, 4081, 1125, 13, 13, 29871, 822, 2601, 29898, 1311, 29892, 8829, 1125, 13, 1678, 1583, 29889, 6252, 29918, 8318, 29898, 6272, 29897, 13, 1678, 1583, 29889, 17591, 29898, 6272, 29897, 13, 13, 13, 29871, 822, 10822, 29898, 1311, 29892, 8829, 1125, 13, 1678, 1053, 8636, 13, 1678, 8829, 29889, 842, 29918, 7529, 29898, 7529, 29897, 13, 13, 1678, 288, 2112, 347, 29898, 275, 29918, 2974, 29922, 8824, 29897, 13, 13, 29871, 822, 4660, 29898, 1311, 29892, 8829, 1125, 13, 1678, 12020, 12477, 5308, 14510, 3782, 5709, 580, 13, 13, 13, 29871, 822, 758, 29918, 786, 8228, 29918, 5060, 442, 29898, 1311, 29892, 8829, 29892, 14955, 29918, 1853, 29922, 8516, 1125, 13, 1678, 1053, 8636, 13, 1678, 8829, 29889, 842, 29918, 7529, 29898, 7529, 29897, 13, 13, 1678, 396, 445, 740, 881, 451, 6222, 565, 278, 1873, 508, 29915, 29873, 367, 10087, 470, 13, 1678, 396, 278, 5096, 947, 451, 2304, 27777, 14955, 13, 1678, 565, 451, 313, 7529, 29889, 3259, 322, 1423, 29918, 1429, 29918, 14394, 29898, 7264, 19132, 29889, 1672, 2208, 4214, 29918, 4897, 29954, 4717, 2287, 29892, 8636, 29889, 3259, 22164, 13, 418, 736, 13, 13, 1678, 28468, 29889, 3888, 703, 5379, 17068, 438, 2112, 347, 12477, 10292, 5020, 8228, 758, 29899, 5060, 442, 1159, 13, 1678, 5096, 29918, 2622, 29889, 2622, 29918, 8318, 29898, 7529, 29889, 3259, 29897, 13, 13, 29871, 396, 1334, 23764, 777, 2295, 29879, 313, 29877, 2112, 347, 29889, 23055, 29889, 3946, 495, 359, 29889, 558, 26706, 29897, 1434, 12623, 313, 4149, 288, 2112, 347, 29889, 2272, 322, 8636, 29889, 2272, 467, 13, 29871, 396, 910, 740, 3639, 3939, 2295, 29879, 313, 277, 29915, 29879, 1304, 363, 2295, 12623, 1434, 2295, 5142, 29897, 13, 29871, 822, 5706, 29918, 2917, 29879, 29918, 657, 29918, 3134, 29918, 1445, 29918, 3051, 29898, 1311, 29892, 10422, 29892, 8600, 1125, 13, 1678, 565, 8600, 1275, 525, 29877, 2112, 347, 29899, 2746, 2396, 13, 418, 1053, 8636, 13, 418, 2295, 353, 1583, 29889, 657, 29918, 2917, 580, 13, 418, 736, 11117, 2917, 332, 800, 2396, 8636, 29889, 29877, 2112, 347, 29918, 2746, 29892, 13, 795, 525, 13305, 29918, 15697, 2396, 2295, 1839, 13305, 15801, 2033, 29961, 27126, 12258, 13, 1678, 1683, 29901, 13, 418, 736, 2428, 29898, 29949, 2112, 347, 4032, 29892, 1583, 467, 17158, 29918, 2917, 29879, 29918, 657, 29918, 3134, 29918, 1445, 29918, 3051, 29898, 9507, 29892, 8600, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 29871, 438, 2112, 347, 4032, 2141, 7978, 580, 13, 2 ]
tensorflow-example/tensor_placeholder.py
dinkar1708/machine-learning-examples
0
44922
<reponame>dinkar1708/machine-learning-examples import numpy as np import tensorflow as tf # placeholder - Inserts a placeholder for a tensor that will be always fed. # Example1- a = tf.placeholder(tf.float32) b = tf.placeholder(tf.float32) adder_node = a + b sess = tf.Session() print(sess.run(adder_node, {a: [1, 2], b: [2, 3]})) sess.close() # Example2 x = tf.placeholder(tf.float32, shape=(1024, 1024)) y = tf.matmul(x, x) with tf.Session() as sess: # print(sess.run(y)) # ERROR: will fail because x was not fed. rand_array = np.random.rand(1024, 1024) print(sess.run(y, feed_dict={x: rand_array})) # Will succeed.
[ 1, 529, 276, 1112, 420, 29958, 29881, 682, 279, 29896, 29955, 29900, 29947, 29914, 23523, 29899, 21891, 29899, 19057, 13, 5215, 12655, 408, 7442, 13, 5215, 26110, 408, 15886, 13, 13, 29937, 12983, 448, 512, 643, 1372, 263, 12983, 363, 263, 12489, 393, 674, 367, 2337, 21242, 29889, 13, 13, 29937, 8741, 29896, 29899, 13, 29874, 353, 15886, 29889, 27074, 29898, 13264, 29889, 7411, 29941, 29906, 29897, 13, 29890, 353, 15886, 29889, 27074, 29898, 13264, 29889, 7411, 29941, 29906, 29897, 13, 13, 328, 672, 29918, 3177, 353, 263, 718, 289, 13, 29879, 404, 353, 15886, 29889, 7317, 580, 13, 2158, 29898, 29879, 404, 29889, 3389, 29898, 328, 672, 29918, 3177, 29892, 426, 29874, 29901, 518, 29896, 29892, 29871, 29906, 1402, 289, 29901, 518, 29906, 29892, 29871, 29941, 12258, 876, 13, 29879, 404, 29889, 5358, 580, 13, 13, 29937, 8741, 29906, 13, 29916, 353, 15886, 29889, 27074, 29898, 13264, 29889, 7411, 29941, 29906, 29892, 8267, 7607, 29896, 29900, 29906, 29946, 29892, 29871, 29896, 29900, 29906, 29946, 876, 13, 29891, 353, 15886, 29889, 2922, 16109, 29898, 29916, 29892, 921, 29897, 13, 13, 2541, 15886, 29889, 7317, 580, 408, 27937, 29901, 13, 1678, 396, 259, 1596, 29898, 29879, 404, 29889, 3389, 29898, 29891, 876, 29871, 396, 14431, 29901, 674, 4418, 1363, 921, 471, 451, 21242, 29889, 13, 1678, 20088, 29918, 2378, 353, 7442, 29889, 8172, 29889, 9502, 29898, 29896, 29900, 29906, 29946, 29892, 29871, 29896, 29900, 29906, 29946, 29897, 13, 1678, 1596, 29898, 29879, 404, 29889, 3389, 29898, 29891, 29892, 8343, 29918, 8977, 3790, 29916, 29901, 20088, 29918, 2378, 20073, 29871, 396, 2811, 9269, 29889, 13, 2 ]
baekjoon/not-classified/1630/1630.py
honux77/algorithm
2
113811
n = input() def gcd(m, n): while True: m %= n if m == 0: return n n %= m if n == 0: return m def lcm(m, n): g = gcd(m ,n) return m * n / g def omin(n): r = n for i in range(2, n): if r % i != 0: r = lcm(r, i) return r print omin(n)
[ 1, 302, 353, 1881, 580, 13, 13, 1753, 330, 2252, 29898, 29885, 29892, 302, 1125, 13, 1678, 1550, 5852, 29901, 13, 4706, 286, 1273, 29922, 302, 13, 4706, 565, 286, 1275, 29871, 29900, 29901, 13, 9651, 736, 302, 13, 4706, 302, 1273, 29922, 286, 13, 4706, 565, 302, 1275, 29871, 29900, 29901, 13, 9651, 736, 286, 13, 13, 1753, 301, 4912, 29898, 29885, 29892, 302, 1125, 13, 1678, 330, 353, 330, 2252, 29898, 29885, 1919, 29876, 29897, 13, 1678, 736, 286, 334, 302, 847, 330, 13, 13, 1753, 288, 1195, 29898, 29876, 1125, 268, 13, 1678, 364, 353, 302, 13, 1678, 363, 474, 297, 3464, 29898, 29906, 29892, 302, 1125, 13, 4706, 565, 364, 1273, 474, 2804, 29871, 29900, 29901, 632, 13, 9651, 364, 353, 301, 4912, 29898, 29878, 29892, 474, 29897, 13, 1678, 736, 364, 13, 13, 2158, 288, 1195, 29898, 29876, 29897, 2 ]
code/pgms/merge-sort.py
souradeepta/PythonPractice
0
144110
from typing import List def merge_sort(input: List): length = len(input) for step in range(1, length): key = input[step] j = step - 1 while j >= 0 and key < input[j]: input[j+1] = input[j] j = j - 1 input[j+1] = key return input def main(): sample = [7,4,5,1,0,9,1,4] result = merge_sort(sample) print(f"output is: {result}") if __name__ =="__main__": main()
[ 1, 515, 19229, 1053, 2391, 13, 13, 1753, 10366, 29918, 6605, 29898, 2080, 29901, 2391, 1125, 13, 1678, 3309, 353, 7431, 29898, 2080, 29897, 13, 268, 13, 1678, 363, 4331, 297, 3464, 29898, 29896, 29892, 3309, 1125, 13, 4706, 1820, 353, 1881, 29961, 10568, 29962, 13, 308, 13, 4706, 432, 353, 4331, 448, 29871, 29896, 13, 308, 13, 4706, 1550, 432, 6736, 29871, 29900, 322, 1820, 529, 1881, 29961, 29926, 5387, 13, 9651, 1881, 29961, 29926, 29974, 29896, 29962, 353, 1881, 29961, 29926, 29962, 13, 9651, 432, 353, 432, 448, 29871, 29896, 13, 632, 13, 4706, 1881, 29961, 29926, 29974, 29896, 29962, 353, 1820, 308, 13, 268, 13, 1678, 736, 1881, 13, 268, 13, 1753, 1667, 7295, 13, 1678, 4559, 353, 518, 29955, 29892, 29946, 29892, 29945, 29892, 29896, 29892, 29900, 29892, 29929, 29892, 29896, 29892, 29946, 29962, 13, 1678, 1121, 353, 10366, 29918, 6605, 29898, 11249, 29897, 13, 1678, 1596, 29898, 29888, 29908, 4905, 338, 29901, 426, 2914, 27195, 13, 268, 13, 361, 4770, 978, 1649, 353, 543, 1649, 3396, 1649, 1115, 13, 1678, 1667, 580, 2 ]
codes/globo_videos_cuts/core/tests/models/processed_video_model_test_case.py
lariodiniz/teste_meta
0
135947
# coding: utf-8 __author__ = "<NAME>" from django.test import TestCase from model_mommy import mommy from core.models import ProcessedVideo class ProcessedVideoModelTestCase(TestCase): """Class Testing Model processed """ def setUp(self): """ Initial Test Settings """ self.processed_video = mommy.make(ProcessedVideo) def tearDown(self): """Final method""" self.processed_video.delete() def test_there_are_fields(self): """test the fields the model""" self.assertTrue('title' in dir(ProcessedVideo), 'Class Program does not have the field title') self.assertTrue('duration' in dir(ProcessedVideo), 'Class Program does not have the field start_time') self.assertTrue('name' in dir(ProcessedVideo), 'Class Program does not have the field end_time') def test_there_is_a_program(self): """test if you are creating a Program correctly""" self.assertEquals(ProcessedVideo.objects.count(), 1) self.assertEquals(ProcessedVideo.objects.all()[0].title, self.processed_video.title) self.assertEquals(ProcessedVideo.objects.all()[0].duration, self.processed_video.duration) self.assertEquals(ProcessedVideo.objects.all()[0].name, self.processed_video.name)
[ 1, 396, 14137, 29901, 23616, 29899, 29947, 13, 1649, 8921, 1649, 353, 9872, 5813, 11903, 13, 13, 3166, 9557, 29889, 1688, 1053, 4321, 8259, 13, 3166, 1904, 29918, 29885, 290, 1357, 1053, 16823, 1357, 13, 13, 3166, 7136, 29889, 9794, 1053, 10554, 287, 15167, 29871, 13, 13, 1990, 10554, 287, 15167, 3195, 3057, 8259, 29898, 3057, 8259, 1125, 13, 1678, 9995, 2385, 4321, 292, 8125, 19356, 9995, 13, 13, 1678, 822, 731, 3373, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 17250, 4321, 19215, 13, 4706, 9995, 268, 13, 13, 4706, 1583, 29889, 5014, 287, 29918, 9641, 353, 16823, 1357, 29889, 5675, 29898, 7032, 287, 15167, 29897, 13, 13, 1678, 822, 734, 279, 6767, 29898, 1311, 1125, 13, 4706, 9995, 15790, 1158, 15945, 29908, 13, 4706, 1583, 29889, 5014, 287, 29918, 9641, 29889, 8143, 580, 13, 13, 1678, 822, 1243, 29918, 12711, 29918, 598, 29918, 9621, 29898, 1311, 1125, 13, 4706, 9995, 1688, 278, 4235, 278, 1904, 15945, 29908, 13, 4706, 1583, 29889, 9294, 5574, 877, 3257, 29915, 297, 4516, 29898, 7032, 287, 15167, 511, 525, 2385, 7835, 947, 451, 505, 278, 1746, 3611, 1495, 13, 4706, 1583, 29889, 9294, 5574, 877, 19708, 29915, 297, 4516, 29898, 7032, 287, 15167, 511, 525, 2385, 7835, 947, 451, 505, 278, 1746, 1369, 29918, 2230, 1495, 13, 4706, 1583, 29889, 9294, 5574, 877, 978, 29915, 297, 4516, 29898, 7032, 287, 15167, 511, 525, 2385, 7835, 947, 451, 505, 278, 1746, 1095, 29918, 2230, 1495, 13, 13, 13, 1678, 822, 1243, 29918, 12711, 29918, 275, 29918, 29874, 29918, 8860, 29898, 1311, 1125, 13, 4706, 9995, 1688, 565, 366, 526, 4969, 263, 7835, 5149, 15945, 29908, 13, 13, 4706, 1583, 29889, 9294, 14776, 29898, 7032, 287, 15167, 29889, 12650, 29889, 2798, 3285, 29871, 29896, 29897, 13, 4706, 1583, 29889, 9294, 14776, 29898, 7032, 287, 15167, 29889, 12650, 29889, 497, 580, 29961, 29900, 1822, 3257, 29892, 1583, 29889, 5014, 287, 29918, 9641, 29889, 3257, 29897, 13, 4706, 1583, 29889, 9294, 14776, 29898, 7032, 287, 15167, 29889, 12650, 29889, 497, 580, 29961, 29900, 1822, 19708, 29892, 1583, 29889, 5014, 287, 29918, 9641, 29889, 19708, 29897, 13, 4706, 1583, 29889, 9294, 14776, 29898, 7032, 287, 15167, 29889, 12650, 29889, 497, 580, 29961, 29900, 1822, 978, 29892, 1583, 29889, 5014, 287, 29918, 9641, 29889, 978, 29897, 13, 2 ]
migrations/metadata.py
gntzh/fastapi-tmpl
0
169429
<filename>migrations/metadata.py from src.domain import Item, User # noqa: F401 from src.domain.mapper import mapper_registry __all__ = ["metadata"] metadata = mapper_registry.metadata
[ 1, 529, 9507, 29958, 26983, 800, 29914, 19635, 29889, 2272, 13, 3166, 4765, 29889, 7247, 1053, 10976, 29892, 4911, 29871, 396, 694, 25621, 29901, 383, 29946, 29900, 29896, 13, 3166, 4765, 29889, 7247, 29889, 655, 2496, 1053, 611, 2496, 29918, 1727, 6020, 13, 13, 1649, 497, 1649, 353, 6796, 19635, 3108, 13, 13, 19635, 353, 611, 2496, 29918, 1727, 6020, 29889, 19635, 13, 2 ]
setup.py
colincsl/StructuredModels
1
118754
''' Configure: python setup.py build StructuredModels <NAME> 2013 ''' from distutils.core import setup # from setuptools import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy as np # ext_modules = [ # Extension("pyKinectTools_algs_Dijkstras", ["pyKinectTools/algs/dijkstras.pyx"],language='c++'), # Extension("pyKinectTools_algs_local_occupancy_pattern", ["pyKinectTools/algs/LocalOccupancyPattern.pyx"],language='c++'), # ] # # for e in ext_modules: # e.pyrex_directives = { # "boundscheck": False, # "wraparound": False, # "infer_types": True # } # e.extra_compile_args = ["-w"] setup( author = '<NAME>', author_email = '<EMAIL>', description = '', license = "FreeBSD", version= "0.1", name = 'StructuredModels', cmdclass = {'build_ext': build_ext}, include_dirs = [np.get_include()], packages= [ "StructuredModels", "StructuredModels.models", ], # package_data={'':['*.xml', '*.png', '*.yml', '*.txt']}, # ext_modules = ext_modules )
[ 1, 29871, 13, 12008, 13, 3991, 545, 29901, 13, 4691, 6230, 29889, 2272, 2048, 13, 13, 19560, 2955, 23785, 13, 29966, 5813, 29958, 13, 29906, 29900, 29896, 29941, 13, 12008, 13, 13, 3166, 1320, 13239, 29889, 3221, 1053, 6230, 13, 29937, 515, 731, 21245, 8789, 1053, 6230, 13, 3166, 1320, 13239, 29889, 17588, 1053, 7338, 2673, 13, 3166, 315, 1656, 29889, 13398, 13239, 1053, 2048, 29918, 1062, 13, 5215, 12655, 408, 7442, 13, 13, 29937, 1294, 29918, 7576, 353, 518, 13, 29937, 29871, 12, 12, 12, 12, 17657, 703, 2272, 29968, 457, 312, 24183, 29918, 284, 3174, 29918, 29928, 13535, 710, 294, 613, 6796, 2272, 29968, 457, 312, 24183, 29914, 284, 3174, 29914, 29881, 13535, 710, 294, 29889, 2272, 29916, 12436, 11675, 2433, 29883, 1817, 5477, 13, 29937, 29871, 12, 12, 12, 12, 17657, 703, 2272, 29968, 457, 312, 24183, 29918, 284, 3174, 29918, 2997, 29918, 16770, 6906, 29918, 11037, 613, 6796, 2272, 29968, 457, 312, 24183, 29914, 284, 3174, 29914, 7717, 22034, 786, 6906, 17144, 29889, 2272, 29916, 12436, 11675, 2433, 29883, 1817, 5477, 13, 29937, 29871, 12, 12, 12, 12, 29962, 13, 29937, 13, 29937, 363, 321, 297, 1294, 29918, 7576, 29901, 13, 29937, 29871, 12, 29872, 29889, 2272, 276, 29916, 29918, 11851, 3145, 353, 426, 13, 29937, 29871, 12, 12, 12, 12, 12, 12, 29908, 9917, 5955, 384, 1115, 7700, 29892, 13, 29937, 29871, 12, 12, 12, 12, 12, 12, 29908, 29893, 336, 862, 618, 1115, 7700, 29892, 13, 29937, 29871, 12, 12, 12, 12, 12, 12, 29908, 262, 571, 29918, 8768, 1115, 5852, 13, 29937, 29871, 12, 12, 12, 12, 12, 12, 29913, 13, 29937, 29871, 12, 29872, 29889, 17833, 29918, 12198, 29918, 5085, 353, 6796, 29899, 29893, 3108, 13, 13, 14669, 29898, 13, 12, 8921, 353, 12801, 5813, 29958, 742, 13, 12, 8921, 29918, 5269, 353, 12801, 26862, 6227, 29958, 742, 13, 12, 8216, 353, 15516, 13, 12, 506, 1947, 353, 376, 20475, 29933, 7230, 613, 13, 12, 3259, 29922, 376, 29900, 29889, 29896, 613, 13, 12, 978, 353, 525, 19560, 2955, 23785, 742, 13, 12, 9006, 1990, 353, 11117, 4282, 29918, 1062, 2396, 2048, 29918, 1062, 1118, 13, 12, 2856, 29918, 3972, 29879, 353, 518, 9302, 29889, 657, 29918, 2856, 580, 1402, 13, 12, 8318, 29922, 518, 12, 29908, 19560, 2955, 23785, 613, 13, 12, 12, 12, 12, 29908, 19560, 2955, 23785, 29889, 9794, 613, 13, 12, 12, 12, 12, 1402, 13, 12, 29937, 3577, 29918, 1272, 3790, 29915, 2396, 1839, 10521, 3134, 742, 525, 10521, 2732, 742, 525, 10521, 21053, 742, 525, 10521, 3945, 2033, 1118, 13, 12, 29937, 1294, 29918, 7576, 353, 1294, 29918, 7576, 13, 29897, 13, 13, 2 ]
locr/constants.py
thatandromeda/locr
1
179617
TIMEOUT = 2
[ 1, 323, 8890, 12015, 353, 29871, 29906, 13, 2 ]
HW6/YuliiaKutsyk/3_ unfinished_loop_bug_fixing.py
kolyasalubov/Lv-677.PythonCore
0
2018
def create_array(n): res=[] i=1 while i<=n: res.append(i) i += 1 return res
[ 1, 822, 1653, 29918, 2378, 29898, 29876, 1125, 13, 1678, 620, 29922, 2636, 13, 1678, 474, 29922, 29896, 13, 1678, 1550, 474, 14065, 29876, 29901, 13, 4706, 620, 29889, 4397, 29898, 29875, 29897, 13, 4706, 474, 4619, 29871, 29896, 13, 1678, 736, 620, 13, 2 ]
glc/cli/subs/c_mr.py
evinoca/MyCli
1
80482
<filename>glc/cli/subs/c_mr.py from __future__ import absolute_import from __future__ import unicode_literals import click @click.group() @click.pass_obj def cli(config): """ Merge Requests. """ click.echo("calling sub cmd repo") @cli.command("ls", short_help="List MR") def ls(): click.echo("repo list") @cli.command("add", short_help="Create merge request from current repo") def add(): click.echo("repo add") @cli.command("update", short_help="update MR") def update(): click.echo("repo update") @cli.command("status", short_help="Show status repo") def status(): click.echo("repo desc")
[ 1, 529, 9507, 29958, 3820, 29883, 29914, 11303, 29914, 1491, 29879, 29914, 29883, 29918, 29885, 29878, 29889, 2272, 13, 3166, 4770, 29888, 9130, 1649, 1053, 8380, 29918, 5215, 13, 3166, 4770, 29888, 9130, 1649, 1053, 29104, 29918, 20889, 1338, 13, 13, 5215, 2828, 13, 13, 13, 29992, 3808, 29889, 2972, 580, 13, 29992, 3808, 29889, 3364, 29918, 5415, 13, 1753, 9335, 29898, 2917, 1125, 13, 1678, 9995, 13, 1678, 4702, 479, 10729, 29879, 29889, 13, 1678, 9995, 13, 1678, 2828, 29889, 8057, 703, 4804, 292, 1014, 9920, 13761, 1159, 13, 13, 13, 29992, 11303, 29889, 6519, 703, 3137, 613, 3273, 29918, 8477, 543, 1293, 29751, 1159, 13, 1753, 19375, 7295, 13, 1678, 2828, 29889, 8057, 703, 20095, 1051, 1159, 13, 13, 13, 29992, 11303, 29889, 6519, 703, 1202, 613, 3273, 29918, 8477, 543, 4391, 10366, 2009, 515, 1857, 13761, 1159, 13, 1753, 788, 7295, 13, 1678, 2828, 29889, 8057, 703, 20095, 788, 1159, 13, 13, 13, 29992, 11303, 29889, 6519, 703, 5504, 613, 3273, 29918, 8477, 543, 5504, 29751, 1159, 13, 1753, 2767, 7295, 13, 1678, 2828, 29889, 8057, 703, 20095, 2767, 1159, 13, 13, 13, 29992, 11303, 29889, 6519, 703, 4882, 613, 3273, 29918, 8477, 543, 8964, 4660, 13761, 1159, 13, 1753, 4660, 7295, 13, 1678, 2828, 29889, 8057, 703, 20095, 5153, 1159, 13, 2 ]
Bots/Python/Consumers/CodeFirst/WaterfallHostBot/dialogs/sso/sso_signin_dialog.py
gabog/BotFramework-FunctionalTests
28
49495
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from botbuilder.dialogs import ( ComponentDialog, WaterfallDialog, WaterfallStepContext, OAuthPrompt, OAuthPromptSettings, ) class SsoSignInDialog(ComponentDialog): def __init__(self, connection_name: str): super().__init__(SsoSignInDialog.__name__) self.add_dialog( OAuthPrompt( OAuthPrompt.__name__, OAuthPromptSettings( connection_name=connection_name, text=f"Sign in to the host bot using AAD for SSO and connection {connection_name}", title="Sign In", timeout=60000, ), ) ) self.add_dialog( WaterfallDialog( WaterfallDialog.__name__, [ self.signin_step, self.display_token, ], ) ) self.initial_dialog_id = WaterfallDialog.__name__ async def signin_step(self, step_context: WaterfallStepContext): return await step_context.begin_dialog(OAuthPrompt.__name__) async def display_token(self, step_context: WaterfallStepContext): sso_token = step_context.result if sso_token: if isinstance(sso_token, dict): token = sso_token.get("token") else: token = sso_token.token await step_context.context.send_activity(f"Here is your token: {token}") else: await step_context.context.send_activity("No token was provided.") return await step_context.end_dialog()
[ 1, 396, 14187, 1266, 313, 29883, 29897, 7783, 15025, 29889, 2178, 10462, 21676, 29889, 13, 29937, 10413, 21144, 1090, 278, 341, 1806, 19245, 29889, 13, 13, 3166, 9225, 16409, 29889, 15901, 29879, 1053, 313, 13, 1678, 15924, 7647, 29892, 13, 1678, 13062, 11950, 7647, 29892, 13, 1678, 13062, 11950, 14448, 2677, 29892, 13, 1678, 438, 6444, 18571, 415, 29892, 13, 1678, 438, 6444, 18571, 415, 9585, 29892, 13, 29897, 13, 13, 13, 1990, 317, 578, 10140, 797, 7647, 29898, 5308, 7647, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 3957, 29918, 978, 29901, 851, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 29903, 578, 10140, 797, 7647, 17255, 978, 1649, 29897, 13, 13, 4706, 1583, 29889, 1202, 29918, 15901, 29898, 13, 9651, 438, 6444, 18571, 415, 29898, 13, 18884, 438, 6444, 18571, 415, 17255, 978, 1649, 29892, 13, 18884, 438, 6444, 18571, 415, 9585, 29898, 13, 462, 1678, 3957, 29918, 978, 29922, 9965, 29918, 978, 29892, 13, 462, 1678, 1426, 29922, 29888, 29908, 10140, 297, 304, 278, 3495, 9225, 773, 319, 3035, 363, 5886, 29949, 322, 3957, 426, 9965, 29918, 978, 17671, 13, 462, 1678, 3611, 543, 10140, 512, 613, 13, 462, 1678, 11815, 29922, 29953, 29900, 29900, 29900, 29900, 29892, 13, 18884, 10353, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 1202, 29918, 15901, 29898, 13, 9651, 13062, 11950, 7647, 29898, 13, 18884, 13062, 11950, 7647, 17255, 978, 1649, 29892, 13, 18884, 518, 13, 462, 1678, 1583, 29889, 4530, 262, 29918, 10568, 29892, 13, 462, 1678, 1583, 29889, 4990, 29918, 6979, 29892, 13, 18884, 21251, 13, 9651, 1723, 13, 4706, 1723, 13, 13, 4706, 1583, 29889, 11228, 29918, 15901, 29918, 333, 353, 13062, 11950, 7647, 17255, 978, 1649, 13, 13, 1678, 7465, 822, 1804, 262, 29918, 10568, 29898, 1311, 29892, 4331, 29918, 4703, 29901, 13062, 11950, 14448, 2677, 1125, 13, 4706, 736, 7272, 4331, 29918, 4703, 29889, 463, 29918, 15901, 29898, 29949, 6444, 18571, 415, 17255, 978, 1649, 29897, 13, 13, 1678, 7465, 822, 2479, 29918, 6979, 29898, 1311, 29892, 4331, 29918, 4703, 29901, 13062, 11950, 14448, 2677, 1125, 13, 4706, 269, 578, 29918, 6979, 353, 4331, 29918, 4703, 29889, 2914, 13, 4706, 565, 269, 578, 29918, 6979, 29901, 13, 9651, 565, 338, 8758, 29898, 29879, 578, 29918, 6979, 29892, 9657, 1125, 13, 18884, 5993, 353, 269, 578, 29918, 6979, 29889, 657, 703, 6979, 1159, 13, 9651, 1683, 29901, 13, 18884, 5993, 353, 269, 578, 29918, 6979, 29889, 6979, 13, 13, 9651, 7272, 4331, 29918, 4703, 29889, 4703, 29889, 6717, 29918, 10072, 29898, 29888, 29908, 10605, 338, 596, 5993, 29901, 426, 6979, 27195, 13, 13, 4706, 1683, 29901, 13, 9651, 7272, 4331, 29918, 4703, 29889, 4703, 29889, 6717, 29918, 10072, 703, 3782, 5993, 471, 4944, 23157, 13, 13, 4706, 736, 7272, 4331, 29918, 4703, 29889, 355, 29918, 15901, 580, 13, 2 ]
Independent Component Analysis.py
Queen-s-Cerebral-Language-Innovation/EEG-Preprocesing
0
1600824
<filename>Independent Component Analysis.py import csv from mne.preprocessing import (ICA) from mne import Epochs, pick_types from mne.channels import make_standard_montage from mne.io import concatenate_raws, read_raw_edf from mne.datasets import eegbci import numpy as np allICAs = [] subject = [] chosen = 1 #Subject to be preprocessed def addICA(raw): ica = ICA(n_components=15, random_state=97) ica.fit(raw) global allICAs icaArray = ica.apply() global subject global choosen # if (subject == chosen): # icaArray.append(1) # else: # icaArray.append(0) allICAs.append(icaArray) print("\n ---- \n") print(allICAs) def makeArray(): global allICAs runs = [5, 6, 9, 10, 13, 14] allICAs = [] # allICAs = [[]] global chosen for subject in range(1, 110): allICAs[subject].append(1) if subject == chosen else allICAs[subject].append(0) tmin, tmax = -1., 4. event_id = dict(hands=2, feet=3) for run in runs: raw_fnames = eegbci.load_data(subject, run) raw = concatenate_raws( [read_raw_edf(f, preload=True) for f in raw_fnames]) eegbci.standardize(raw) montage = make_standard_montage('standard_1005') raw.set_montage(montage) raw.rename_channels(lambda x: x.strip('.')) raw.crop(tmax=60.) raw.filter(14., 30.) picks = pick_types(raw.info, eeg=True) # events, _ = events_from_annotations(raw, event_id=dict(T1=2, T2=3)) # 7 # epochs = Epochs(raw, events, event_id, tmin, tmax, picks=picks, preload=True) # labels = epochs.events[:, -1] - 2; # filename = "eeg" + str(i) + "-"+ str(j) +".csv" addICA(raw) with open('allICAs', 'w') as f: f_csv = csv.writer(f) f_csv.writerows(allICAs)
[ 1, 529, 9507, 29958, 2568, 1022, 3906, 15924, 24352, 29889, 2272, 13, 5215, 11799, 30004, 13, 3166, 286, 484, 29889, 1457, 19170, 1053, 313, 2965, 29909, 8443, 13, 3166, 286, 484, 1053, 382, 1129, 12168, 29892, 5839, 29918, 8768, 30004, 13, 3166, 286, 484, 29889, 305, 12629, 1053, 1207, 29918, 15770, 29918, 14132, 482, 30004, 13, 3166, 286, 484, 29889, 601, 1053, 16125, 403, 29918, 1610, 29879, 29892, 1303, 29918, 1610, 29918, 287, 29888, 30004, 13, 3166, 286, 484, 29889, 14538, 1691, 1053, 321, 387, 29890, 455, 30004, 13, 5215, 12655, 408, 7442, 30004, 13, 30004, 13, 497, 2965, 2887, 353, 5159, 30004, 13, 16009, 353, 5159, 30004, 13, 305, 7749, 353, 29871, 29896, 396, 20622, 304, 367, 758, 5014, 287, 30004, 13, 30004, 13, 30004, 13, 1753, 788, 2965, 29909, 29898, 1610, 1125, 30004, 13, 268, 983, 353, 306, 5454, 29898, 29876, 29918, 14036, 29922, 29896, 29945, 29892, 4036, 29918, 3859, 29922, 29929, 29955, 8443, 13, 268, 983, 29889, 9202, 29898, 1610, 8443, 13, 1678, 5534, 599, 2965, 2887, 30004, 13, 268, 983, 2588, 353, 29871, 983, 29889, 7302, 26471, 13, 1678, 5534, 4967, 30004, 13, 1678, 5534, 3060, 7749, 30004, 13, 1678, 396, 565, 313, 16009, 1275, 10434, 1125, 30004, 13, 1678, 396, 29871, 983, 2588, 29889, 4397, 29898, 29896, 8443, 13, 1678, 396, 1683, 29901, 30004, 13, 1678, 396, 29871, 983, 2588, 29889, 4397, 29898, 29900, 8443, 13, 1678, 599, 2965, 2887, 29889, 4397, 29898, 983, 2588, 8443, 13, 1678, 1596, 14182, 29876, 23250, 320, 29876, 1159, 30004, 13, 1678, 1596, 29898, 497, 2965, 2887, 8443, 13, 30004, 13, 30004, 13, 1753, 1207, 2588, 7295, 30004, 13, 1678, 5534, 599, 2965, 2887, 30004, 13, 1678, 6057, 353, 518, 29945, 29892, 29871, 29953, 29892, 29871, 29929, 29892, 29871, 29896, 29900, 29892, 29871, 29896, 29941, 29892, 29871, 29896, 29946, 29962, 30004, 13, 1678, 599, 2965, 2887, 353, 5159, 30004, 13, 1678, 396, 599, 2965, 2887, 353, 518, 2636, 29962, 30004, 13, 1678, 5534, 10434, 30004, 13, 1678, 363, 4967, 297, 3464, 29898, 29896, 29892, 29871, 29896, 29896, 29900, 1125, 30004, 13, 4706, 599, 2965, 2887, 29961, 16009, 1822, 4397, 29898, 29896, 29897, 565, 4967, 1275, 10434, 1683, 599, 2965, 2887, 29961, 16009, 1822, 4397, 29898, 29900, 8443, 13, 30004, 13, 1678, 260, 1195, 29892, 260, 3317, 353, 448, 29896, 1696, 29871, 29946, 22993, 13, 1678, 1741, 29918, 333, 353, 9657, 29898, 3179, 29879, 29922, 29906, 29892, 6900, 29922, 29941, 8443, 13, 1678, 363, 1065, 297, 6057, 29901, 30004, 13, 4706, 10650, 29918, 29888, 7039, 353, 321, 387, 29890, 455, 29889, 1359, 29918, 1272, 29898, 16009, 29892, 1065, 8443, 13, 4706, 10650, 353, 16125, 403, 29918, 1610, 29879, 29898, 30004, 13, 9651, 518, 949, 29918, 1610, 29918, 287, 29888, 29898, 29888, 29892, 758, 1359, 29922, 5574, 29897, 363, 285, 297, 10650, 29918, 29888, 7039, 2314, 30004, 13, 4706, 321, 387, 29890, 455, 29889, 15770, 675, 29898, 1610, 8443, 13, 4706, 7629, 482, 353, 1207, 29918, 15770, 29918, 14132, 482, 877, 15770, 29918, 29896, 29900, 29900, 29945, 1495, 30004, 13, 4706, 10650, 29889, 842, 29918, 14132, 482, 29898, 14132, 482, 8443, 13, 4706, 10650, 29889, 1267, 420, 29918, 305, 12629, 29898, 2892, 921, 29901, 921, 29889, 17010, 877, 6169, 876, 30004, 13, 4706, 10650, 29889, 29883, 1336, 29898, 29873, 3317, 29922, 29953, 29900, 1846, 30004, 13, 4706, 10650, 29889, 4572, 29898, 29896, 29946, 1696, 29871, 29941, 29900, 1846, 30004, 13, 4706, 5839, 29879, 353, 5839, 29918, 8768, 29898, 1610, 29889, 3888, 29892, 321, 387, 29922, 5574, 8443, 13, 4706, 396, 4959, 29892, 903, 353, 4959, 29918, 3166, 29918, 6735, 800, 29898, 1610, 29892, 1741, 29918, 333, 29922, 8977, 29898, 29911, 29896, 29922, 29906, 29892, 323, 29906, 29922, 29941, 876, 30004, 13, 4706, 396, 29871, 29955, 30004, 13, 4706, 396, 21502, 12168, 353, 382, 1129, 12168, 29898, 1610, 29892, 4959, 29892, 1741, 29918, 333, 29892, 260, 1195, 29892, 260, 3317, 29892, 5839, 29879, 29922, 29886, 7358, 29892, 758, 1359, 29922, 5574, 8443, 13, 4706, 396, 11073, 353, 21502, 12168, 29889, 13604, 7503, 29892, 448, 29896, 29962, 448, 29871, 29906, 2104, 13, 4706, 396, 10422, 353, 376, 29872, 387, 29908, 718, 851, 29898, 29875, 29897, 718, 11663, 17969, 851, 29898, 29926, 29897, 718, 1642, 7638, 19451, 13, 4706, 788, 2965, 29909, 29898, 1610, 8443, 13, 30004, 13, 30004, 13, 2541, 1722, 877, 497, 2965, 2887, 742, 525, 29893, 1495, 408, 285, 29901, 30004, 13, 1678, 285, 29918, 7638, 353, 11799, 29889, 13236, 29898, 29888, 8443, 13, 1678, 285, 29918, 7638, 29889, 13236, 1242, 29898, 497, 2965, 2887, 8443, 13, 30004, 13, 2 ]
kokon/utils/functions.py
KoalicjaOtwartyKrakow/backend
0
99188
import functools import json from typing import Optional from flask import Response, Request as FlaskRequest from marshmallow import ValidationError import sentry_sdk from kokon.orm import User from kokon.serializers import UUIDEncoder from .auth import upsert_user_from_jwt from .db import DB from .errors import AppError class Request(FlaskRequest): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.db: Optional[DB] = None self.user: Optional[User] = None class JSONResponse(Response): def __init__(self, response, status=200, **kwargs): if not isinstance(response, str): # The json returned here is always returned as the only part of the # response, with mimetype set to json. There is no raw interpolation # with js happening, so setting ensure_ascii is safe, no risk of XSS. # # For more context see https://v8.dev/features/subsume-json response = json.dumps(response, cls=UUIDEncoder, ensure_ascii=False) super(JSONResponse, self).__init__( response=response, status=status, mimetype="application/json", **kwargs ) def function_wrapper(func): @functools.wraps(func) def wrapper(request: FlaskRequest): try: # https://cloud.google.com/endpoints/docs/openapi/migrate-to-esp-v2#receiving_auth_results_in_your_api jwt_header_encoded = request.headers.get("X-Endpoint-API-UserInfo", "") db = DB() request.user = upsert_user_from_jwt(db, jwt_header_encoded) request.db = db return func(request) except ValidationError as e: return JSONResponse({"validationErrors": e.messages}, status=422) except AppError as e: return JSONResponse({"message": e.message}, status=e.status) except Exception as e: sentry_sdk.capture_exception(e) sentry_sdk.flush() raise e return wrapper
[ 1, 1053, 2090, 312, 8789, 13, 5215, 4390, 13, 3166, 19229, 1053, 28379, 13, 13, 3166, 29784, 1053, 13291, 29892, 10729, 408, 2379, 1278, 3089, 13, 3166, 1766, 845, 29885, 9536, 1053, 15758, 362, 2392, 13, 5215, 2665, 719, 29918, 15348, 13, 13, 3166, 413, 554, 265, 29889, 555, 1053, 4911, 13, 3166, 413, 554, 265, 29889, 15550, 19427, 1053, 501, 11150, 8566, 6119, 13, 3166, 869, 5150, 1053, 24081, 814, 29918, 1792, 29918, 3166, 29918, 29926, 14554, 13, 3166, 869, 2585, 1053, 6535, 13, 3166, 869, 12523, 1053, 2401, 2392, 13, 13, 13, 1990, 10729, 29898, 8754, 1278, 3089, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 4706, 1583, 29889, 2585, 29901, 28379, 29961, 4051, 29962, 353, 6213, 13, 4706, 1583, 29889, 1792, 29901, 28379, 29961, 2659, 29962, 353, 6213, 13, 13, 13, 1990, 4663, 5103, 29898, 5103, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2933, 29892, 4660, 29922, 29906, 29900, 29900, 29892, 3579, 19290, 1125, 13, 4706, 565, 451, 338, 8758, 29898, 5327, 29892, 851, 1125, 13, 9651, 396, 450, 4390, 4133, 1244, 338, 2337, 4133, 408, 278, 871, 760, 310, 278, 13, 9651, 396, 2933, 29892, 411, 286, 17528, 668, 731, 304, 4390, 29889, 1670, 338, 694, 10650, 29694, 13, 9651, 396, 411, 6965, 10464, 29892, 577, 4444, 9801, 29918, 294, 18869, 338, 9109, 29892, 694, 12045, 310, 1060, 1799, 29889, 13, 9651, 396, 13, 9651, 396, 1152, 901, 3030, 1074, 2045, 597, 29894, 29947, 29889, 3359, 29914, 22100, 29914, 1491, 29879, 2017, 29899, 3126, 13, 9651, 2933, 353, 4390, 29889, 29881, 17204, 29898, 5327, 29892, 1067, 29879, 29922, 29965, 11150, 8566, 6119, 29892, 9801, 29918, 294, 18869, 29922, 8824, 29897, 13, 4706, 2428, 29898, 7249, 5103, 29892, 1583, 467, 1649, 2344, 12035, 13, 9651, 2933, 29922, 5327, 29892, 4660, 29922, 4882, 29892, 286, 17528, 668, 543, 6214, 29914, 3126, 613, 3579, 19290, 13, 4706, 1723, 13, 13, 13, 1753, 740, 29918, 17699, 29898, 9891, 1125, 13, 1678, 732, 7692, 312, 8789, 29889, 29893, 336, 567, 29898, 9891, 29897, 13, 1678, 822, 14476, 29898, 3827, 29901, 2379, 1278, 3089, 1125, 13, 4706, 1018, 29901, 13, 9651, 396, 2045, 597, 9274, 29889, 3608, 29889, 510, 29914, 355, 9748, 29914, 2640, 29914, 3150, 2754, 29914, 26983, 403, 29899, 517, 29899, 9983, 29899, 29894, 29906, 29937, 13556, 4357, 29918, 5150, 29918, 9902, 29918, 262, 29918, 8066, 29918, 2754, 13, 9651, 432, 14554, 29918, 6672, 29918, 26716, 353, 2009, 29889, 13662, 29889, 657, 703, 29990, 29899, 25602, 29899, 8787, 29899, 2659, 3401, 613, 20569, 13, 9651, 4833, 353, 6535, 580, 13, 13, 9651, 2009, 29889, 1792, 353, 24081, 814, 29918, 1792, 29918, 3166, 29918, 29926, 14554, 29898, 2585, 29892, 432, 14554, 29918, 6672, 29918, 26716, 29897, 13, 9651, 2009, 29889, 2585, 353, 4833, 13, 13, 9651, 736, 3653, 29898, 3827, 29897, 13, 4706, 5174, 15758, 362, 2392, 408, 321, 29901, 13, 9651, 736, 4663, 5103, 3319, 29908, 18157, 22463, 1115, 321, 29889, 19158, 1118, 4660, 29922, 29946, 29906, 29906, 29897, 13, 4706, 5174, 2401, 2392, 408, 321, 29901, 13, 9651, 736, 4663, 5103, 3319, 29908, 4906, 1115, 321, 29889, 4906, 1118, 4660, 29922, 29872, 29889, 4882, 29897, 13, 4706, 5174, 8960, 408, 321, 29901, 13, 9651, 2665, 719, 29918, 15348, 29889, 17885, 545, 29918, 11739, 29898, 29872, 29897, 13, 9651, 2665, 719, 29918, 15348, 29889, 23126, 580, 13, 9651, 12020, 321, 13, 13, 1678, 736, 14476, 13, 2 ]
stylegan2_torch/discriminator/blocks.py
ppeetteerrs/stylegan2-torch
0
97712
<filename>stylegan2_torch/discriminator/blocks.py import math from typing import List from stylegan2_torch.equalized_lr import Blur, EqualConv2d from stylegan2_torch.op.fused_act import FusedLeakyReLU from stylegan2_torch.utils import proxy from torch import nn from torch.functional import Tensor class ConvBlock(nn.Sequential): """ Convolution in feature space EqualConv2d: 2D convolution with equalized learning rate FusedLeakyReLU: LeakyReLU with a bias added before activation """ def __init__(self, in_channel: int, out_channel: int, kernel_size: int): super().__init__( EqualConv2d( in_channel, out_channel, kernel_size, padding=kernel_size // 2, stride=1, bias=False, ), FusedLeakyReLU(out_channel, bias=True), ) def __call__(self, input: Tensor) -> Tensor: return super().__call__(input) class DownConvBlock(nn.Sequential): """ Downsampling convolution in feature space Blur: Gaussian filter as low-pass filter for anti-aliasing + adjust tensor shape to preserve downsampled tensor shape EqualConv2d: 2D (downsampling) convolution with equalized learning rate FusedLeakyReLU: LeakyReLU with a bias added before activation """ def __init__( self, in_channel: int, out_channel: int, kernel_size: int, down: int, blur_kernel: List[int], ): super().__init__( Blur(blur_kernel, -down, kernel_size), EqualConv2d( in_channel, out_channel, kernel_size, padding=0, stride=down, bias=False ), FusedLeakyReLU(out_channel, bias=True), ) def __call__(self, input: Tensor) -> Tensor: return super().__call__(input) class RGBDown(nn.Sequential): """ Downsampling convolution in RGB space, hence no need nonlinearity Blur: Gaussian filter as low-pass filter for anti-aliasing + adjust tensor shape to preserve downsampled tensor shape EqualConv2d: 2D (downsampling) convolution with equalized learning rate """ def __init__( self, in_channel: int, out_channel: int, kernel_size: int, down: int, blur_kernel: List[int], ): super().__init__( Blur(blur_kernel, -down, kernel_size), EqualConv2d( in_channel, out_channel, kernel_size, padding=0, stride=down, bias=False ), ) def __call__(self, input: Tensor) -> Tensor: return super().__call__(input) class ResBlock(nn.Module): """ Residual block ConvBlock + DownConvBlock: Convolution + downsampling RGBDown: Skip connection from higher (double) resolution RGB image """ def __init__(self, in_channel: int, out_channel: int, blur_kernel: List[int]): super().__init__() self.conv = ConvBlock(in_channel, in_channel, 3) self.down_conv = DownConvBlock( in_channel, out_channel, 3, down=2, blur_kernel=blur_kernel ) self.skip = RGBDown(in_channel, out_channel, 1, down=2, blur_kernel=blur_kernel) def forward(self, input: Tensor) -> Tensor: out = self.conv(input) out = self.down_conv(out) skip = self.skip(input) # sqrt 2 to adhere to equalized learning rate philosophy # (i.e. preserve variance in forward pass not initialization) return (out + skip) / math.sqrt(2) __call__ = proxy(forward)
[ 1, 529, 9507, 29958, 22062, 1397, 273, 29906, 29918, 7345, 305, 29914, 2218, 29883, 20386, 1061, 29914, 1271, 29879, 29889, 2272, 13, 5215, 5844, 13, 3166, 19229, 1053, 2391, 13, 13, 3166, 15877, 1397, 273, 29906, 29918, 7345, 305, 29889, 11745, 1891, 29918, 29212, 1053, 3164, 332, 29892, 11243, 284, 1168, 29894, 29906, 29881, 13, 3166, 15877, 1397, 273, 29906, 29918, 7345, 305, 29889, 459, 29889, 29888, 3880, 29918, 627, 1053, 383, 3880, 3226, 557, 29891, 1123, 29931, 29965, 13, 3166, 15877, 1397, 273, 29906, 29918, 7345, 305, 29889, 13239, 1053, 10166, 13, 3166, 4842, 305, 1053, 302, 29876, 13, 3166, 4842, 305, 29889, 2220, 284, 1053, 323, 6073, 13, 13, 13, 1990, 1281, 29894, 7445, 29898, 15755, 29889, 16941, 2556, 1125, 13, 1678, 9995, 13, 1678, 1281, 4068, 297, 4682, 2913, 13, 13, 1678, 11243, 284, 1168, 29894, 29906, 29881, 29901, 29871, 29906, 29928, 26851, 411, 5186, 1891, 6509, 6554, 13, 1678, 383, 3880, 3226, 557, 29891, 1123, 29931, 29965, 29901, 951, 557, 29891, 1123, 29931, 29965, 411, 263, 24003, 2715, 1434, 26229, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 297, 29918, 12719, 29901, 938, 29892, 714, 29918, 12719, 29901, 938, 29892, 8466, 29918, 2311, 29901, 938, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 13, 9651, 11243, 284, 1168, 29894, 29906, 29881, 29898, 13, 18884, 297, 29918, 12719, 29892, 13, 18884, 714, 29918, 12719, 29892, 13, 18884, 8466, 29918, 2311, 29892, 13, 18884, 7164, 29922, 17460, 29918, 2311, 849, 29871, 29906, 29892, 13, 18884, 380, 2426, 29922, 29896, 29892, 13, 18884, 24003, 29922, 8824, 29892, 13, 9651, 10353, 13, 9651, 383, 3880, 3226, 557, 29891, 1123, 29931, 29965, 29898, 449, 29918, 12719, 29892, 24003, 29922, 5574, 511, 13, 4706, 1723, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 1881, 29901, 323, 6073, 29897, 1599, 323, 6073, 29901, 13, 4706, 736, 2428, 2141, 1649, 4804, 12035, 2080, 29897, 13, 13, 13, 1990, 9943, 1168, 29894, 7445, 29898, 15755, 29889, 16941, 2556, 1125, 13, 1678, 9995, 13, 1678, 9943, 13445, 10335, 26851, 297, 4682, 2913, 13, 13, 1678, 3164, 332, 29901, 22477, 4175, 408, 4482, 29899, 3364, 4175, 363, 9418, 29899, 2606, 5832, 718, 10365, 12489, 8267, 304, 19905, 1623, 11249, 29881, 12489, 8267, 13, 1678, 11243, 284, 1168, 29894, 29906, 29881, 29901, 29871, 29906, 29928, 313, 3204, 13445, 10335, 29897, 26851, 411, 5186, 1891, 6509, 6554, 13, 1678, 383, 3880, 3226, 557, 29891, 1123, 29931, 29965, 29901, 951, 557, 29891, 1123, 29931, 29965, 411, 263, 24003, 2715, 1434, 26229, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 297, 29918, 12719, 29901, 938, 29892, 13, 4706, 714, 29918, 12719, 29901, 938, 29892, 13, 4706, 8466, 29918, 2311, 29901, 938, 29892, 13, 4706, 1623, 29901, 938, 29892, 13, 4706, 1999, 332, 29918, 17460, 29901, 2391, 29961, 524, 1402, 13, 268, 1125, 13, 4706, 2428, 2141, 1649, 2344, 12035, 13, 9651, 3164, 332, 29898, 2204, 332, 29918, 17460, 29892, 448, 3204, 29892, 8466, 29918, 2311, 511, 13, 9651, 11243, 284, 1168, 29894, 29906, 29881, 29898, 13, 18884, 297, 29918, 12719, 29892, 714, 29918, 12719, 29892, 8466, 29918, 2311, 29892, 7164, 29922, 29900, 29892, 380, 2426, 29922, 3204, 29892, 24003, 29922, 8824, 13, 9651, 10353, 13, 9651, 383, 3880, 3226, 557, 29891, 1123, 29931, 29965, 29898, 449, 29918, 12719, 29892, 24003, 29922, 5574, 511, 13, 4706, 1723, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 1881, 29901, 323, 6073, 29897, 1599, 323, 6073, 29901, 13, 4706, 736, 2428, 2141, 1649, 4804, 12035, 2080, 29897, 13, 13, 13, 1990, 390, 7210, 6767, 29898, 15755, 29889, 16941, 2556, 1125, 13, 1678, 9995, 13, 1678, 9943, 13445, 10335, 26851, 297, 390, 7210, 2913, 29892, 8151, 694, 817, 1661, 10660, 537, 13, 13, 1678, 3164, 332, 29901, 22477, 4175, 408, 4482, 29899, 3364, 4175, 363, 9418, 29899, 2606, 5832, 718, 10365, 12489, 8267, 304, 19905, 1623, 11249, 29881, 12489, 8267, 13, 1678, 11243, 284, 1168, 29894, 29906, 29881, 29901, 29871, 29906, 29928, 313, 3204, 13445, 10335, 29897, 26851, 411, 5186, 1891, 6509, 6554, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 13, 4706, 1583, 29892, 13, 4706, 297, 29918, 12719, 29901, 938, 29892, 13, 4706, 714, 29918, 12719, 29901, 938, 29892, 13, 4706, 8466, 29918, 2311, 29901, 938, 29892, 13, 4706, 1623, 29901, 938, 29892, 13, 4706, 1999, 332, 29918, 17460, 29901, 2391, 29961, 524, 1402, 13, 268, 1125, 13, 13, 4706, 2428, 2141, 1649, 2344, 12035, 13, 9651, 3164, 332, 29898, 2204, 332, 29918, 17460, 29892, 448, 3204, 29892, 8466, 29918, 2311, 511, 13, 9651, 11243, 284, 1168, 29894, 29906, 29881, 29898, 13, 18884, 297, 29918, 12719, 29892, 714, 29918, 12719, 29892, 8466, 29918, 2311, 29892, 7164, 29922, 29900, 29892, 380, 2426, 29922, 3204, 29892, 24003, 29922, 8824, 13, 9651, 10353, 13, 4706, 1723, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 1881, 29901, 323, 6073, 29897, 1599, 323, 6073, 29901, 13, 4706, 736, 2428, 2141, 1649, 4804, 12035, 2080, 29897, 13, 13, 13, 1990, 2538, 7445, 29898, 15755, 29889, 7355, 1125, 13, 1678, 9995, 13, 1678, 2538, 333, 950, 2908, 13, 13, 1678, 1281, 29894, 7445, 718, 9943, 1168, 29894, 7445, 29901, 1281, 4068, 718, 1623, 13445, 10335, 13, 1678, 390, 7210, 6767, 29901, 4971, 666, 3957, 515, 6133, 313, 8896, 29897, 10104, 390, 7210, 1967, 13, 1678, 9995, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 297, 29918, 12719, 29901, 938, 29892, 714, 29918, 12719, 29901, 938, 29892, 1999, 332, 29918, 17460, 29901, 2391, 29961, 524, 29962, 1125, 13, 4706, 2428, 2141, 1649, 2344, 1649, 580, 13, 13, 4706, 1583, 29889, 20580, 353, 1281, 29894, 7445, 29898, 262, 29918, 12719, 29892, 297, 29918, 12719, 29892, 29871, 29941, 29897, 13, 4706, 1583, 29889, 3204, 29918, 20580, 353, 9943, 1168, 29894, 7445, 29898, 13, 9651, 297, 29918, 12719, 29892, 714, 29918, 12719, 29892, 29871, 29941, 29892, 1623, 29922, 29906, 29892, 1999, 332, 29918, 17460, 29922, 2204, 332, 29918, 17460, 13, 4706, 1723, 13, 4706, 1583, 29889, 11014, 353, 390, 7210, 6767, 29898, 262, 29918, 12719, 29892, 714, 29918, 12719, 29892, 29871, 29896, 29892, 1623, 29922, 29906, 29892, 1999, 332, 29918, 17460, 29922, 2204, 332, 29918, 17460, 29897, 13, 13, 1678, 822, 6375, 29898, 1311, 29892, 1881, 29901, 323, 6073, 29897, 1599, 323, 6073, 29901, 13, 4706, 714, 353, 1583, 29889, 20580, 29898, 2080, 29897, 13, 4706, 714, 353, 1583, 29889, 3204, 29918, 20580, 29898, 449, 29897, 13, 4706, 14383, 353, 1583, 29889, 11014, 29898, 2080, 29897, 13, 4706, 396, 18074, 2273, 29871, 29906, 304, 594, 4150, 304, 5186, 1891, 6509, 6554, 22237, 13, 4706, 396, 313, 29875, 29889, 29872, 29889, 19905, 20162, 297, 6375, 1209, 451, 17865, 29897, 13, 4706, 736, 313, 449, 718, 14383, 29897, 847, 5844, 29889, 3676, 29898, 29906, 29897, 13, 13, 1678, 4770, 4804, 1649, 353, 10166, 29898, 11333, 29897, 13, 2 ]
mir/sre/__init__.py
darkfeline/mir.sre
2
99182
<filename>mir/sre/__init__.py # Copyright (C) 2017 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """This module implements structural regular expressions. Read <NAME>'s paper and the manual page for the sam editor for more context. Functions: x_iter() y_iter() x_join() y_join() """ __version__ = '0.1.0' import re def x_iter(pattern, string, flags=0): """Return an iterable over regexp matches.""" yield from (m.group(0) for m in re.finditer(pattern, string, flags)) def y_iter(pattern, string, flags=0): """Return an iterable over the strings around regexp matches.""" pattern = f'({pattern})' for i, substring in enumerate(re.split(pattern, string, flags)): if not i % 2: yield substring def x_join(pattern, string, func, flags=0): """Apply a function to regexp matches. Each regexp match in string is substituted with the return value of func when called with the matched substring. """ pattern = f'({pattern})' parts = [] for i, substring in enumerate(re.split(pattern, string, flags)): if i % 2: parts.append(func(substring)) else: # Includes first and last parts.append(substring) return ''.join(parts) def y_join(pattern, string, func, flags=0): """Apply a function to the strings around regexp matches. The substrings before, between, and after each regexp match in string is substituted with the return value of func when called with said substring. """ pattern = f'({pattern})' parts = [] for i, substring in enumerate(re.split(pattern, string, flags)): if i % 2: parts.append(substring) else: # Includes first and last parts.append(func(substring)) return ''.join(parts)
[ 1, 529, 9507, 29958, 11038, 29914, 29879, 276, 29914, 1649, 2344, 26914, 2272, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29955, 529, 5813, 29958, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 268, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 13, 15945, 29908, 4013, 3883, 10703, 2281, 3631, 4943, 12241, 29889, 13, 13, 6359, 529, 5813, 16299, 29879, 5650, 322, 278, 12219, 1813, 363, 278, 3514, 6920, 363, 901, 13, 4703, 29889, 13, 13, 6678, 29879, 29901, 13, 13, 29916, 29918, 1524, 580, 13, 29891, 29918, 1524, 580, 13, 29916, 29918, 7122, 580, 13, 29891, 29918, 7122, 580, 13, 15945, 29908, 13, 13, 1649, 3259, 1649, 353, 525, 29900, 29889, 29896, 29889, 29900, 29915, 13, 13, 5215, 337, 13, 13, 13, 1753, 921, 29918, 1524, 29898, 11037, 29892, 1347, 29892, 13449, 29922, 29900, 1125, 13, 1678, 9995, 11609, 385, 4256, 519, 975, 6528, 29886, 7087, 1213, 15945, 13, 1678, 7709, 515, 313, 29885, 29889, 2972, 29898, 29900, 29897, 363, 286, 297, 337, 29889, 2886, 1524, 29898, 11037, 29892, 1347, 29892, 13449, 876, 13, 13, 13, 1753, 343, 29918, 1524, 29898, 11037, 29892, 1347, 29892, 13449, 29922, 29900, 1125, 13, 1678, 9995, 11609, 385, 4256, 519, 975, 278, 6031, 2820, 6528, 29886, 7087, 1213, 15945, 13, 1678, 4766, 353, 285, 29915, 3319, 11037, 1800, 29915, 13, 1678, 363, 474, 29892, 28228, 297, 26985, 29898, 276, 29889, 5451, 29898, 11037, 29892, 1347, 29892, 13449, 22164, 13, 4706, 565, 451, 474, 1273, 29871, 29906, 29901, 13, 9651, 7709, 28228, 13, 13, 13, 1753, 921, 29918, 7122, 29898, 11037, 29892, 1347, 29892, 3653, 29892, 13449, 29922, 29900, 1125, 13, 1678, 9995, 2052, 368, 263, 740, 304, 6528, 29886, 7087, 29889, 13, 13, 1678, 7806, 6528, 29886, 1993, 297, 1347, 338, 5960, 277, 3860, 411, 278, 736, 995, 310, 13, 1678, 3653, 746, 2000, 411, 278, 19228, 28228, 29889, 13, 1678, 9995, 13, 1678, 4766, 353, 285, 29915, 3319, 11037, 1800, 29915, 13, 1678, 5633, 353, 5159, 13, 1678, 363, 474, 29892, 28228, 297, 26985, 29898, 276, 29889, 5451, 29898, 11037, 29892, 1347, 29892, 13449, 22164, 13, 4706, 565, 474, 1273, 29871, 29906, 29901, 13, 9651, 5633, 29889, 4397, 29898, 9891, 29898, 20363, 876, 13, 4706, 1683, 29901, 29871, 396, 512, 27722, 937, 322, 1833, 13, 9651, 5633, 29889, 4397, 29898, 20363, 29897, 13, 1678, 736, 525, 4286, 7122, 29898, 20895, 29897, 13, 13, 13, 1753, 343, 29918, 7122, 29898, 11037, 29892, 1347, 29892, 3653, 29892, 13449, 29922, 29900, 1125, 13, 1678, 9995, 2052, 368, 263, 740, 304, 278, 6031, 2820, 6528, 29886, 7087, 29889, 13, 13, 1678, 450, 1014, 19651, 1434, 29892, 1546, 29892, 322, 1156, 1269, 6528, 29886, 1993, 297, 13, 1678, 1347, 338, 5960, 277, 3860, 411, 278, 736, 995, 310, 3653, 746, 2000, 411, 13, 1678, 1497, 28228, 29889, 13, 1678, 9995, 13, 1678, 4766, 353, 285, 29915, 3319, 11037, 1800, 29915, 13, 1678, 5633, 353, 5159, 13, 1678, 363, 474, 29892, 28228, 297, 26985, 29898, 276, 29889, 5451, 29898, 11037, 29892, 1347, 29892, 13449, 22164, 13, 4706, 565, 474, 1273, 29871, 29906, 29901, 13, 9651, 5633, 29889, 4397, 29898, 20363, 29897, 13, 4706, 1683, 29901, 29871, 396, 512, 27722, 937, 322, 1833, 13, 9651, 5633, 29889, 4397, 29898, 9891, 29898, 20363, 876, 13, 1678, 736, 525, 4286, 7122, 29898, 20895, 29897, 13, 2 ]
openstack/telemetry/v2/alarm_change.py
sivel/python-openstacksdk
1
66602
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from openstack import resource from openstack.telemetry import telemetry_service class AlarmChange(resource.Resource): id_attribute = 'event_id' resource_key = 'alarm_change' base_path = '/v2/alarms/%(alarm_id)s/history' service = telemetry_service.TelemetryService() # Supported Operations allow_list = True # Properties alarm_id = resource.prop('alarm_id') detail = resource.prop('detail') event_id = resource.prop('event_id') on_behalf_of = resource.prop('on_behalf_of') project_id = resource.prop('project_id') triggered_at = resource.prop('timestamp') type = resource.prop('type') user_id = resource.prop('user_id') @classmethod def list(cls, session, path_args=None, **params): url = cls.base_path % path_args resp = session.get(url, service=cls.service, params=params) changes = [] for item in resp.body: changes.append(cls.existing(**item)) return changes
[ 1, 396, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 366, 1122, 13, 29937, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 887, 1122, 4017, 13, 29937, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 418, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 399, 1806, 8187, 2692, 13, 29937, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 2823, 278, 13, 29937, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 27028, 13, 29937, 1090, 278, 19245, 29889, 13, 13, 3166, 1722, 1429, 1053, 6503, 13, 3166, 1722, 1429, 29889, 371, 2409, 27184, 1053, 734, 2409, 27184, 29918, 5509, 13, 13, 13, 1990, 838, 2817, 7277, 29898, 10314, 29889, 6848, 1125, 13, 1678, 1178, 29918, 12715, 353, 525, 3696, 29918, 333, 29915, 13, 1678, 6503, 29918, 1989, 353, 525, 284, 2817, 29918, 3167, 29915, 13, 1678, 2967, 29918, 2084, 353, 8207, 29894, 29906, 29914, 284, 279, 1516, 22584, 29898, 284, 2817, 29918, 333, 29897, 29879, 29914, 18434, 29915, 13, 1678, 2669, 353, 734, 2409, 27184, 29918, 5509, 29889, 7141, 2409, 27184, 3170, 580, 13, 13, 1678, 396, 18601, 287, 6607, 800, 13, 1678, 2758, 29918, 1761, 353, 5852, 13, 13, 1678, 396, 21582, 13, 1678, 21200, 29918, 333, 353, 6503, 29889, 7728, 877, 284, 2817, 29918, 333, 1495, 13, 1678, 9493, 353, 6503, 29889, 7728, 877, 16432, 1495, 13, 1678, 1741, 29918, 333, 353, 6503, 29889, 7728, 877, 3696, 29918, 333, 1495, 13, 1678, 373, 29918, 915, 24498, 29918, 974, 353, 6503, 29889, 7728, 877, 265, 29918, 915, 24498, 29918, 974, 1495, 13, 1678, 2060, 29918, 333, 353, 6503, 29889, 7728, 877, 4836, 29918, 333, 1495, 13, 1678, 19799, 29918, 271, 353, 6503, 29889, 7728, 877, 16394, 1495, 13, 1678, 1134, 353, 6503, 29889, 7728, 877, 1853, 1495, 13, 1678, 1404, 29918, 333, 353, 6503, 29889, 7728, 877, 1792, 29918, 333, 1495, 13, 13, 1678, 732, 1990, 5696, 13, 1678, 822, 1051, 29898, 25932, 29892, 4867, 29892, 2224, 29918, 5085, 29922, 8516, 29892, 3579, 7529, 1125, 13, 4706, 3142, 353, 1067, 29879, 29889, 3188, 29918, 2084, 1273, 2224, 29918, 5085, 13, 4706, 4613, 353, 4867, 29889, 657, 29898, 2271, 29892, 2669, 29922, 25932, 29889, 5509, 29892, 8636, 29922, 7529, 29897, 13, 13, 4706, 3620, 353, 5159, 13, 4706, 363, 2944, 297, 4613, 29889, 2587, 29901, 13, 9651, 3620, 29889, 4397, 29898, 25932, 29889, 735, 15423, 29898, 1068, 667, 876, 13, 4706, 736, 3620, 13, 2 ]
uwsgiconf/options/subscriptions.py
graceshaw/uwsgiconf
0
41669
from ..base import OptionsGroup from ..exceptions import ConfigurationError from ..utils import KeyValue, filter_locals from .subscriptions_algos import * class Subscriptions(OptionsGroup): """ This allows some uWSGI instances to announce their presence to subscriptions managing server, which in its turn can address those nodes (e.g. delegate request processing to them) and automatically remove dead nodes from the pool. Some routers provide subscription server functionality. See `.routing.routers`. .. note:: Subscription system in many ways relies on Master Process. .. warning:: The subscription system is meant for "trusted" networks. All of the nodes in your network can potentially make a total mess with it. * http://uwsgi.readthedocs.io/en/latest/SubscriptionServer.html """ class algorithms: """Balancing algorithms available to use with ``subscribe``.""" ip_hash = IpHash least_reference_count = LeastReferenceCount weighted_least_reference_count = WeightedLeastReferenceCount weighted_round_robin = WeightedRoundRobin def set_server_params( self, client_notify_address=None, mountpoints_depth=None, require_vassal=None, tolerance=None, tolerance_inactive=None, key_dot_split=None): """Sets subscription server related params. :param str client_notify_address: Set the notification socket for subscriptions. When you subscribe to a server, you can ask it to "acknowledge" the acceptance of your request. pointing address (Unix socket or UDP), on which your instance will bind and the subscription server will send acknowledgements to. :param int mountpoints_depth: Enable support of mountpoints of certain depth for subscription system. * http://uwsgi-docs.readthedocs.io/en/latest/SubscriptionServer.html#mountpoints-uwsgi-2-1 :param bool require_vassal: Require a vassal field (see ``subscribe``) from each subscription. :param int tolerance: Subscription reclaim tolerance (seconds). :param int tolerance_inactive: Subscription inactivity tolerance (seconds). :param bool key_dot_split: Try to fallback to the next part in (dot based) subscription key. Used, for example, in SNI. """ # todo notify-socket (fallback) relation self._set('subscription-notify-socket', client_notify_address) self._set('subscription-mountpoint', mountpoints_depth) self._set('subscription-vassal-required', require_vassal, cast=bool) self._set('subscription-tolerance', tolerance) self._set('subscription-tolerance-inactive', tolerance_inactive) self._set('subscription-dotsplit', key_dot_split, cast=bool) return self._section def set_server_verification_params( self, digest_algo=None, dir_cert=None, tolerance=None, no_check_uid=None, dir_credentials=None, pass_unix_credentials=None): """Sets peer verification params for subscription server. These are for secured subscriptions. :param str digest_algo: Digest algorithm. Example: SHA1 .. note:: Also requires ``dir_cert`` to be set. :param str dir_cert: Certificate directory. .. note:: Also requires ``digest_algo`` to be set. :param int tolerance: Maximum tolerance (in seconds) of clock skew for secured subscription system. Default: 24h. :param str|int|list[str|int] no_check_uid: Skip signature check for the specified uids when using unix sockets credentials. :param str|list[str] dir_credentials: Directories to search for subscriptions key credentials. :param bool pass_unix_credentials: Enable management of SCM_CREDENTIALS in subscriptions UNIX sockets. """ if digest_algo and dir_cert: self._set('subscriptions-sign-check', f'{digest_algo}:{dir_cert}') self._set('subscriptions-sign-check-tolerance', tolerance) self._set('subscriptions-sign-skip-uid', no_check_uid, multi=True) self._set('subscriptions-credentials-check', dir_credentials, multi=True) self._set('subscriptions-use-credentials', pass_unix_credentials, cast=bool) return self._section def set_client_params( self, start_unsubscribed=None, clear_on_exit=None, unsubscribe_on_reload=None, announce_interval=None): """Sets subscribers related params. :param bool start_unsubscribed: Configure subscriptions but do not send them. .. note:: Useful with master FIFO. :param bool clear_on_exit: Force clear instead of unsubscribe during shutdown. :param bool unsubscribe_on_reload: Force unsubscribe request even during graceful reload. :param int announce_interval: Send subscription announce at the specified interval. Default: 10 master cycles. """ self._set('start-unsubscribed', start_unsubscribed, cast=bool) self._set('subscription-clear-on-shutdown', clear_on_exit, cast=bool) self._set('unsubscribe-on-graceful-reload', unsubscribe_on_reload, cast=bool) self._set('subscribe-freq', announce_interval) return self._section def subscribe( self, server=None, key=None, address=None, address_vassal=None, balancing_weight=None, balancing_algo=None, modifier=None, signing=None, check_file=None, protocol=None, sni_cert=None, sni_key=None, sni_client_ca=None): """Registers a subscription intent. :param str server: Subscription server address (UDP or UNIX socket). Examples: * 127.0.0.1:7171 :param str key: Key to subscribe. Generally the domain name (+ optional '/< mountpoint>'). Examples: * mydomain.it/foo * mydomain.it/foo/bar (requires ``mountpoints_depth=2``) * mydomain.it * ubuntu64.local:9090 :param str|int address: Address to subscribe (the value for the key) or zero-based internal socket number (integer). :param str address: Vassal node address. :param int balancing_weight: Load balancing value. Default: 1. :param balancing_algo: Load balancing algorithm to use. See ``balancing_algorithms`` .. note:: Since 2.1 :param Modifier modifier: Routing modifier object. See ``.routing.modifiers`` :param list|tuple signing: Signing basics, expects two elements list/tuple: (signing_algorithm, key). Examples: * SHA1:idlessh001 :param str check_file: If this file exists the subscription packet is sent, otherwise it is skipped. :param str protocol: the protocol to use, by default it is ``uwsgi``. See ``.networking.socket_types``. .. note:: Since 2.1 :param str sni_cert: Certificate file to use for SNI proxy management. * http://uwsgi.readthedocs.io/en/latest/SNI.html#subscription-system-and-sni :param str sni_key: sni_key Key file to use for SNI proxy management. * http://uwsgi.readthedocs.io/en/latest/SNI.html#subscription-system-and-sni :param str sni_client_ca: Ca file to use for SNI proxy management. * http://uwsgi.readthedocs.io/en/latest/SNI.html#subscription-system-and-sni """ # todo params: inactive (inactive slot activation) if not any((server, key)): raise ConfigurationError('Subscription requires `server` or `key` to be set.') address_key = 'addr' if isinstance(address, int): address_key = 'socket' if balancing_algo: backup = getattr(balancing_algo, 'backup_level', None) if signing: signing = ':'.join(signing) if modifier: modifier1 = modifier if modifier.submod: modifier2 = modifier.submod rule = KeyValue( filter_locals(locals(), drop=['address_key', 'modifier']), aliases={ 'address': address_key, 'address_vassal': 'vassal', 'signing': 'sign', 'check_file': 'check', 'balancing_weight': 'weight', 'balancing_algo': 'algo', 'protocol': 'proto', 'sni_cert': 'sni_crt', 'sni_client_ca': 'sni_ca', }, ) self._set('subscribe2', rule) return self._section
[ 1, 515, 6317, 3188, 1053, 25186, 4782, 13, 3166, 6317, 11739, 29879, 1053, 20999, 2392, 13, 3166, 6317, 13239, 1053, 7670, 1917, 29892, 4175, 29918, 2997, 29879, 13, 3166, 869, 1491, 7588, 1980, 29918, 9564, 359, 1053, 334, 13, 13, 13, 1990, 3323, 7588, 1980, 29898, 5856, 4782, 1125, 13, 1678, 9995, 13, 1678, 910, 6511, 777, 318, 7811, 29954, 29902, 8871, 304, 7475, 346, 1009, 10122, 304, 21696, 1980, 767, 6751, 1923, 29892, 13, 1678, 607, 297, 967, 2507, 508, 3211, 1906, 7573, 313, 29872, 29889, 29887, 29889, 13341, 2009, 9068, 304, 963, 29897, 13, 1678, 322, 6336, 3349, 7123, 7573, 515, 278, 11565, 29889, 13, 13, 1678, 3834, 16053, 2153, 3867, 25691, 1923, 9863, 29889, 2823, 5050, 14608, 292, 29889, 27537, 2153, 1412, 13, 13, 1678, 6317, 4443, 1057, 3323, 22371, 1788, 297, 1784, 5837, 337, 3687, 373, 9082, 10554, 29889, 13, 13, 1678, 6317, 9177, 1057, 450, 25691, 1788, 338, 6839, 363, 376, 509, 16656, 29908, 14379, 29889, 13, 4706, 2178, 310, 278, 7573, 297, 596, 3564, 508, 19998, 1207, 263, 3001, 4473, 411, 372, 29889, 13, 13, 1678, 334, 1732, 597, 29884, 5652, 3146, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 4035, 22371, 6004, 29889, 1420, 13, 13, 1678, 9995, 13, 13, 1678, 770, 14009, 29901, 13, 4706, 9995, 22031, 19985, 14009, 3625, 304, 671, 411, 4954, 19496, 16159, 1213, 15945, 13, 13, 4706, 10377, 29918, 8568, 353, 306, 29886, 10438, 13, 4706, 3203, 29918, 5679, 29918, 2798, 353, 951, 579, 7422, 3981, 13, 4706, 7688, 287, 29918, 280, 579, 29918, 5679, 29918, 2798, 353, 1334, 523, 287, 3226, 579, 7422, 3981, 13, 4706, 7688, 287, 29918, 14486, 29918, 307, 2109, 353, 1334, 523, 287, 29934, 618, 21860, 262, 13, 13, 1678, 822, 731, 29918, 2974, 29918, 7529, 29898, 13, 9651, 1583, 29892, 3132, 29918, 25140, 29918, 7328, 29922, 8516, 29892, 5766, 9748, 29918, 19488, 29922, 8516, 29892, 1996, 29918, 29894, 465, 284, 29922, 8516, 29892, 13, 9651, 20341, 749, 29922, 8516, 29892, 20341, 749, 29918, 262, 4925, 29922, 8516, 29892, 1820, 29918, 6333, 29918, 5451, 29922, 8516, 1125, 13, 4706, 9995, 29903, 1691, 25691, 1923, 4475, 8636, 29889, 13, 13, 4706, 584, 3207, 851, 3132, 29918, 25140, 29918, 7328, 29901, 3789, 278, 12519, 9909, 363, 21696, 1980, 29889, 13, 9651, 1932, 366, 1014, 13086, 304, 263, 1923, 29892, 366, 508, 2244, 372, 304, 376, 547, 3707, 5485, 29908, 278, 3544, 749, 310, 596, 2009, 29889, 13, 9651, 13330, 3211, 313, 2525, 861, 9909, 470, 501, 11191, 511, 373, 607, 596, 2777, 674, 7868, 322, 13, 9651, 278, 25691, 1923, 674, 3638, 24084, 29887, 4110, 304, 29889, 13, 13, 4706, 584, 3207, 938, 5766, 9748, 29918, 19488, 29901, 1174, 519, 2304, 310, 5766, 9748, 310, 3058, 10809, 363, 25691, 1788, 29889, 13, 13, 9651, 334, 1732, 597, 29884, 5652, 3146, 29899, 2640, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 4035, 22371, 6004, 29889, 1420, 29937, 16476, 9748, 29899, 29884, 5652, 3146, 29899, 29906, 29899, 29896, 13, 13, 4706, 584, 3207, 6120, 1996, 29918, 29894, 465, 284, 29901, 830, 1548, 263, 325, 465, 284, 1746, 313, 4149, 4954, 19496, 29952, 6348, 515, 1269, 25691, 29889, 13, 13, 4706, 584, 3207, 938, 20341, 749, 29901, 3323, 22371, 1162, 8342, 20341, 749, 313, 23128, 467, 13, 13, 4706, 584, 3207, 938, 20341, 749, 29918, 262, 4925, 29901, 3323, 22371, 297, 10072, 20341, 749, 313, 23128, 467, 13, 13, 4706, 584, 3207, 6120, 1820, 29918, 6333, 29918, 5451, 29901, 3967, 304, 6416, 1627, 304, 278, 2446, 760, 297, 313, 6333, 2729, 29897, 25691, 1820, 29889, 13, 9651, 501, 8485, 29892, 363, 1342, 29892, 297, 317, 12916, 29889, 13, 13, 4706, 9995, 13, 4706, 396, 10481, 26051, 29899, 11514, 313, 11950, 1627, 29897, 8220, 13, 4706, 1583, 3032, 842, 877, 1491, 22371, 29899, 25140, 29899, 11514, 742, 3132, 29918, 25140, 29918, 7328, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 22371, 29899, 16476, 3149, 742, 5766, 9748, 29918, 19488, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 22371, 29899, 29894, 465, 284, 29899, 12403, 742, 1996, 29918, 29894, 465, 284, 29892, 4320, 29922, 11227, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 22371, 29899, 25027, 261, 749, 742, 20341, 749, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 22371, 29899, 25027, 261, 749, 29899, 262, 4925, 742, 20341, 749, 29918, 262, 4925, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 22371, 29899, 7778, 2830, 742, 1820, 29918, 6333, 29918, 5451, 29892, 4320, 29922, 11227, 29897, 13, 13, 4706, 736, 1583, 3032, 2042, 13, 13, 1678, 822, 731, 29918, 2974, 29918, 369, 2450, 29918, 7529, 29898, 13, 9651, 1583, 29892, 4697, 342, 29918, 284, 1484, 29922, 8516, 29892, 4516, 29918, 6327, 29922, 8516, 29892, 20341, 749, 29922, 8516, 29892, 694, 29918, 3198, 29918, 5416, 29922, 8516, 29892, 13, 9651, 4516, 29918, 11944, 9409, 29922, 8516, 29892, 1209, 29918, 24538, 29918, 11944, 9409, 29922, 8516, 1125, 13, 4706, 9995, 29903, 1691, 23533, 1147, 2450, 8636, 363, 25691, 1923, 29889, 13, 13, 4706, 4525, 526, 363, 26130, 21696, 1980, 29889, 13, 13, 4706, 584, 3207, 851, 4697, 342, 29918, 284, 1484, 29901, 10951, 342, 5687, 29889, 8741, 29901, 317, 15715, 29896, 13, 13, 9651, 6317, 4443, 1057, 3115, 6858, 4954, 3972, 29918, 6327, 16159, 304, 367, 731, 29889, 13, 13, 4706, 584, 3207, 851, 4516, 29918, 6327, 29901, 18410, 8021, 3884, 29889, 13, 13, 9651, 6317, 4443, 1057, 3115, 6858, 4954, 7501, 342, 29918, 284, 1484, 16159, 304, 367, 731, 29889, 13, 13, 4706, 584, 3207, 938, 20341, 749, 29901, 5918, 12539, 20341, 749, 313, 262, 6923, 29897, 310, 12006, 18109, 29893, 363, 26130, 25691, 1788, 29889, 13, 9651, 13109, 29901, 29871, 29906, 29946, 29882, 29889, 13, 13, 4706, 584, 3207, 851, 29989, 524, 29989, 1761, 29961, 710, 29989, 524, 29962, 694, 29918, 3198, 29918, 5416, 29901, 4971, 666, 12608, 1423, 363, 278, 6790, 318, 4841, 13, 9651, 746, 773, 28167, 577, 9737, 16140, 29889, 13, 13, 4706, 584, 3207, 851, 29989, 1761, 29961, 710, 29962, 4516, 29918, 11944, 9409, 29901, 8797, 3842, 304, 2740, 363, 21696, 1980, 13, 9651, 1820, 16140, 29889, 13, 13, 4706, 584, 3207, 6120, 1209, 29918, 24538, 29918, 11944, 9409, 29901, 1174, 519, 10643, 310, 12314, 29924, 29918, 29907, 19386, 3919, 25758, 29903, 297, 21696, 1980, 8291, 6415, 577, 9737, 29889, 13, 13, 4706, 9995, 13, 4706, 565, 4697, 342, 29918, 284, 1484, 322, 4516, 29918, 6327, 29901, 13, 9651, 1583, 3032, 842, 877, 1491, 7588, 1980, 29899, 4530, 29899, 3198, 742, 285, 29915, 29912, 7501, 342, 29918, 284, 1484, 6177, 29912, 3972, 29918, 6327, 29913, 1495, 13, 13, 4706, 1583, 3032, 842, 877, 1491, 7588, 1980, 29899, 4530, 29899, 3198, 29899, 25027, 261, 749, 742, 20341, 749, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 7588, 1980, 29899, 4530, 29899, 11014, 29899, 5416, 742, 694, 29918, 3198, 29918, 5416, 29892, 2473, 29922, 5574, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 7588, 1980, 29899, 11944, 9409, 29899, 3198, 742, 4516, 29918, 11944, 9409, 29892, 2473, 29922, 5574, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 7588, 1980, 29899, 1509, 29899, 11944, 9409, 742, 1209, 29918, 24538, 29918, 11944, 9409, 29892, 4320, 29922, 11227, 29897, 13, 13, 4706, 736, 1583, 3032, 2042, 13, 13, 1678, 822, 731, 29918, 4645, 29918, 7529, 29898, 13, 9651, 1583, 29892, 1369, 29918, 348, 1491, 7588, 2580, 29922, 8516, 29892, 2821, 29918, 265, 29918, 13322, 29922, 8516, 29892, 443, 19496, 29918, 265, 29918, 28120, 29922, 8516, 29892, 13, 9651, 7475, 346, 29918, 19207, 29922, 8516, 1125, 13, 4706, 9995, 29903, 1691, 21696, 2596, 4475, 8636, 29889, 13, 13, 4706, 584, 3207, 6120, 1369, 29918, 348, 1491, 7588, 2580, 29901, 1281, 4532, 21696, 1980, 541, 437, 451, 3638, 963, 29889, 13, 9651, 6317, 4443, 1057, 4803, 1319, 411, 5835, 9338, 5800, 29889, 13, 13, 4706, 584, 3207, 6120, 2821, 29918, 265, 29918, 13322, 29901, 11004, 2821, 2012, 310, 443, 19496, 2645, 12522, 3204, 29889, 13, 13, 4706, 584, 3207, 6120, 443, 19496, 29918, 265, 29918, 28120, 29901, 11004, 443, 19496, 2009, 1584, 2645, 17659, 1319, 19763, 29889, 13, 13, 4706, 584, 3207, 938, 7475, 346, 29918, 19207, 29901, 15076, 25691, 7475, 346, 472, 278, 6790, 7292, 29889, 13109, 29901, 29871, 29896, 29900, 5835, 25785, 29889, 13, 13, 4706, 9995, 13, 4706, 1583, 3032, 842, 877, 2962, 29899, 348, 1491, 7588, 2580, 742, 1369, 29918, 348, 1491, 7588, 2580, 29892, 4320, 29922, 11227, 29897, 13, 4706, 1583, 3032, 842, 877, 1491, 22371, 29899, 8551, 29899, 265, 29899, 845, 329, 3204, 742, 2821, 29918, 265, 29918, 13322, 29892, 4320, 29922, 11227, 29897, 13, 4706, 1583, 3032, 842, 877, 348, 19496, 29899, 265, 29899, 3874, 346, 1319, 29899, 28120, 742, 443, 19496, 29918, 265, 29918, 28120, 29892, 4320, 29922, 11227, 29897, 13, 4706, 1583, 3032, 842, 877, 19496, 29899, 29888, 7971, 742, 7475, 346, 29918, 19207, 29897, 13, 13, 4706, 736, 1583, 3032, 2042, 13, 13, 1678, 822, 1014, 13086, 29898, 13, 9651, 1583, 29892, 1923, 29922, 8516, 29892, 1820, 29922, 8516, 29892, 3211, 29922, 8516, 29892, 3211, 29918, 29894, 465, 284, 29922, 8516, 29892, 13, 9651, 6411, 19985, 29918, 7915, 29922, 8516, 29892, 6411, 19985, 29918, 284, 1484, 29922, 8516, 29892, 878, 3709, 29922, 8516, 29892, 26188, 29922, 8516, 29892, 1423, 29918, 1445, 29922, 8516, 29892, 9608, 29922, 8516, 29892, 13, 9651, 9830, 29918, 6327, 29922, 8516, 29892, 9830, 29918, 1989, 29922, 8516, 29892, 9830, 29918, 4645, 29918, 1113, 29922, 8516, 1125, 13, 4706, 9995, 15213, 29879, 263, 25691, 7609, 29889, 13, 13, 4706, 584, 3207, 851, 1923, 29901, 3323, 22371, 1923, 3211, 313, 29965, 11191, 470, 8291, 6415, 9909, 467, 13, 13, 9651, 1222, 9422, 29901, 13, 18884, 334, 29871, 29896, 29906, 29955, 29889, 29900, 29889, 29900, 29889, 29896, 29901, 29955, 29896, 29955, 29896, 13, 13, 4706, 584, 3207, 851, 1820, 29901, 7670, 304, 1014, 13086, 29889, 3251, 635, 278, 5354, 1024, 20532, 13136, 8207, 29966, 5766, 3149, 29958, 2824, 13, 9651, 1222, 9422, 29901, 13, 18884, 334, 590, 7247, 29889, 277, 29914, 5431, 13, 18884, 334, 590, 7247, 29889, 277, 29914, 5431, 29914, 1646, 313, 276, 339, 2658, 4954, 16476, 9748, 29918, 19488, 29922, 29906, 29952, 6348, 13, 18884, 334, 590, 7247, 29889, 277, 13, 18884, 334, 16338, 29953, 29946, 29889, 2997, 29901, 29929, 29900, 29929, 29900, 13, 13, 4706, 584, 3207, 851, 29989, 524, 3211, 29901, 16428, 304, 1014, 13086, 313, 1552, 995, 363, 278, 1820, 29897, 13, 9651, 470, 5225, 29899, 6707, 7463, 9909, 1353, 313, 16031, 467, 13, 13, 4706, 584, 3207, 851, 3211, 29901, 478, 465, 284, 2943, 3211, 29889, 13, 13, 4706, 584, 3207, 938, 6411, 19985, 29918, 7915, 29901, 16012, 6411, 19985, 995, 29889, 13109, 29901, 29871, 29896, 29889, 13, 13, 4706, 584, 3207, 6411, 19985, 29918, 284, 1484, 29901, 16012, 6411, 19985, 5687, 304, 671, 29889, 2823, 4954, 5521, 19985, 29918, 9564, 12404, 16159, 13, 9651, 6317, 4443, 1057, 4001, 29871, 29906, 29889, 29896, 13, 13, 4706, 584, 3207, 3382, 3709, 878, 3709, 29901, 20829, 292, 878, 3709, 1203, 29889, 2823, 421, 1412, 14608, 292, 29889, 1545, 14903, 16159, 13, 13, 4706, 584, 3207, 1051, 29989, 23583, 26188, 29901, 29871, 9954, 292, 2362, 1199, 29892, 23347, 1023, 3161, 1051, 29914, 23583, 29901, 13, 9651, 313, 4530, 292, 29918, 20567, 29892, 1820, 467, 13, 13, 9651, 1222, 9422, 29901, 13, 18884, 334, 317, 15715, 29896, 29901, 333, 2222, 29882, 29900, 29900, 29896, 13, 13, 4706, 584, 3207, 851, 1423, 29918, 1445, 29901, 960, 445, 934, 4864, 278, 25691, 18203, 338, 2665, 29892, 13, 9651, 6467, 372, 338, 14993, 2986, 29889, 13, 13, 4706, 584, 3207, 851, 9608, 29901, 278, 9608, 304, 671, 29892, 491, 2322, 372, 338, 4954, 29884, 5652, 3146, 29952, 1412, 13, 9651, 2823, 421, 1412, 11618, 292, 29889, 11514, 29918, 8768, 29952, 1412, 13, 13, 9651, 6317, 4443, 1057, 4001, 29871, 29906, 29889, 29896, 13, 13, 4706, 584, 3207, 851, 9830, 29918, 6327, 29901, 18410, 8021, 934, 304, 671, 363, 317, 12916, 10166, 10643, 29889, 13, 9651, 334, 1732, 597, 29884, 5652, 3146, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 29903, 12916, 29889, 1420, 29937, 1491, 22371, 29899, 5205, 29899, 392, 29899, 29879, 1240, 13, 13, 4706, 584, 3207, 851, 9830, 29918, 1989, 29901, 9830, 29918, 1989, 7670, 934, 304, 671, 363, 317, 12916, 10166, 10643, 29889, 13, 9651, 334, 1732, 597, 29884, 5652, 3146, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 29903, 12916, 29889, 1420, 29937, 1491, 22371, 29899, 5205, 29899, 392, 29899, 29879, 1240, 13, 13, 4706, 584, 3207, 851, 9830, 29918, 4645, 29918, 1113, 29901, 9243, 934, 304, 671, 363, 317, 12916, 10166, 10643, 29889, 13, 9651, 334, 1732, 597, 29884, 5652, 3146, 29889, 949, 386, 287, 12332, 29889, 601, 29914, 264, 29914, 12333, 29914, 29903, 12916, 29889, 1420, 29937, 1491, 22371, 29899, 5205, 29899, 392, 29899, 29879, 1240, 13, 13, 4706, 9995, 13, 4706, 396, 10481, 8636, 29901, 297, 4925, 313, 262, 4925, 21497, 26229, 29897, 13, 13, 4706, 565, 451, 738, 3552, 2974, 29892, 1820, 22164, 13, 9651, 12020, 20999, 2392, 877, 4035, 22371, 6858, 421, 2974, 29952, 470, 421, 1989, 29952, 304, 367, 731, 29889, 1495, 13, 13, 4706, 3211, 29918, 1989, 353, 525, 10030, 29915, 13, 4706, 565, 338, 8758, 29898, 7328, 29892, 938, 1125, 13, 9651, 3211, 29918, 1989, 353, 525, 11514, 29915, 13, 13, 4706, 565, 6411, 19985, 29918, 284, 1484, 29901, 13, 9651, 16199, 353, 679, 5552, 29898, 5521, 19985, 29918, 284, 1484, 29892, 525, 1627, 786, 29918, 5563, 742, 6213, 29897, 13, 13, 4706, 565, 26188, 29901, 13, 9651, 26188, 353, 525, 29901, 4286, 7122, 29898, 4530, 292, 29897, 13, 13, 4706, 565, 878, 3709, 29901, 13, 9651, 878, 3709, 29896, 353, 878, 3709, 13, 9651, 565, 878, 3709, 29889, 1491, 1545, 29901, 13, 18884, 878, 3709, 29906, 353, 878, 3709, 29889, 1491, 1545, 13, 13, 4706, 5751, 353, 7670, 1917, 29898, 13, 9651, 4175, 29918, 2997, 29879, 29898, 2997, 29879, 3285, 5768, 29922, 1839, 7328, 29918, 1989, 742, 525, 26625, 2033, 511, 13, 9651, 14430, 2129, 3790, 13, 18884, 525, 7328, 2396, 3211, 29918, 1989, 29892, 13, 18884, 525, 7328, 29918, 29894, 465, 284, 2396, 525, 29894, 465, 284, 742, 13, 18884, 525, 4530, 292, 2396, 525, 4530, 742, 13, 18884, 525, 3198, 29918, 1445, 2396, 525, 3198, 742, 13, 18884, 525, 5521, 19985, 29918, 7915, 2396, 525, 7915, 742, 13, 18884, 525, 5521, 19985, 29918, 284, 1484, 2396, 525, 284, 1484, 742, 13, 18884, 525, 20464, 2396, 525, 17529, 742, 13, 18884, 525, 29879, 1240, 29918, 6327, 2396, 525, 29879, 1240, 29918, 29883, 2273, 742, 13, 18884, 525, 29879, 1240, 29918, 4645, 29918, 1113, 2396, 525, 29879, 1240, 29918, 1113, 742, 13, 9651, 2981, 13, 4706, 1723, 13, 13, 4706, 1583, 3032, 842, 877, 19496, 29906, 742, 5751, 29897, 13, 13, 4706, 736, 1583, 3032, 2042, 13, 2 ]
testsuite/cases/cv2.py
jcupitt/pillow-perf
0
36770
# coding: utf-8 from __future__ import print_function, unicode_literals, absolute_import import cv2 from .base import BaseTestCase, root try: cv2.setNumThreads(1) except AttributeError: print('!!! You are using OpenCV which does not allow you to set ' 'the number of threads') class Cv2TestCase(BaseTestCase): filter_ids = { cv2.INTER_AREA: 'sup', cv2.INTER_NEAREST: 'ner', cv2.INTER_LINEAR: 'bil', cv2.INTER_CUBIC: 'bic', cv2.INTER_LANCZOS4: 'lzs4', } def create_test_data(self): im = cv2.imread(root('resources', 'color_circle.png'), flags=cv2.IMREAD_UNCHANGED) if self.mode == 'RGB': im = im[:, :, :3] elif self.mode == 'RGBA': pass elif self.mode == 'L': im = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) else: raise ValueError('Unknown mode: {}'.format(self.mode)) # Fine for upscaling im = cv2.resize(im, tuple(self.size), interpolation=cv2.INTER_CUBIC) return [im]
[ 1, 396, 14137, 29901, 23616, 29899, 29947, 13, 13, 3166, 4770, 29888, 9130, 1649, 1053, 1596, 29918, 2220, 29892, 29104, 29918, 20889, 1338, 29892, 8380, 29918, 5215, 13, 13, 5215, 13850, 29906, 13, 13, 3166, 869, 3188, 1053, 7399, 3057, 8259, 29892, 3876, 13, 13, 13, 2202, 29901, 13, 1678, 13850, 29906, 29889, 842, 8009, 4899, 29879, 29898, 29896, 29897, 13, 19499, 23833, 2392, 29901, 13, 1678, 1596, 877, 21004, 887, 526, 773, 4673, 15633, 607, 947, 451, 2758, 366, 304, 731, 525, 13, 3986, 525, 1552, 1353, 310, 9717, 1495, 13, 13, 13, 1990, 315, 29894, 29906, 3057, 8259, 29898, 5160, 3057, 8259, 1125, 13, 1678, 4175, 29918, 4841, 353, 426, 13, 4706, 13850, 29906, 29889, 23845, 29918, 29909, 1525, 29909, 29901, 525, 12587, 742, 13, 4706, 13850, 29906, 29889, 23845, 29918, 8186, 29909, 1525, 1254, 29901, 525, 1089, 742, 13, 4706, 13850, 29906, 29889, 23845, 29918, 18521, 1718, 29901, 525, 18152, 742, 13, 4706, 13850, 29906, 29889, 23845, 29918, 29907, 7466, 2965, 29901, 525, 29890, 293, 742, 13, 4706, 13850, 29906, 29889, 23845, 29918, 29931, 2190, 29907, 29999, 3267, 29946, 29901, 525, 29880, 22381, 29946, 742, 13, 1678, 500, 13, 13, 1678, 822, 1653, 29918, 1688, 29918, 1272, 29898, 1311, 1125, 13, 4706, 527, 353, 13850, 29906, 29889, 326, 949, 29898, 4632, 877, 13237, 742, 525, 2780, 29918, 16622, 29889, 2732, 5477, 13, 462, 4706, 13449, 29922, 11023, 29906, 29889, 7833, 16310, 29918, 3904, 3210, 24336, 29928, 29897, 13, 4706, 565, 1583, 29889, 8513, 1275, 525, 28212, 2396, 13, 9651, 527, 353, 527, 7503, 29892, 584, 29892, 584, 29941, 29962, 13, 4706, 25342, 1583, 29889, 8513, 1275, 525, 29934, 29954, 5688, 2396, 13, 9651, 1209, 13, 4706, 25342, 1583, 29889, 8513, 1275, 525, 29931, 2396, 13, 9651, 527, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 326, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 29954, 22800, 29897, 13, 4706, 1683, 29901, 13, 9651, 12020, 7865, 2392, 877, 14148, 4464, 29901, 6571, 4286, 4830, 29898, 1311, 29889, 8513, 876, 13, 13, 4706, 396, 28896, 363, 24081, 1052, 292, 13, 4706, 527, 353, 13850, 29906, 29889, 21476, 29898, 326, 29892, 18761, 29898, 1311, 29889, 2311, 511, 29694, 29922, 11023, 29906, 29889, 23845, 29918, 29907, 7466, 2965, 29897, 13, 4706, 736, 518, 326, 29962, 13, 2 ]
config.py
PsychoBots/Kylie-Music
0
142035
<reponame>PsychoBots/Kylie-Music<filename>config.py import os import re from youtube_dl import YoutubeDL class Config: APP_ID = int(os.environ.get("APP_ID", "")) API_HASH = os.environ.get("API_HASH", "") BOT_TOKEN = os.environ.get("BOT_TOKEN", "") START_MSG = os.environ.get("START_MSG", "<b>Hi {},\nI am Kylie Simple Youtube to Mp3 Downloader Bot\nI can Download Any Music with best quality👀 Just send me name or Link with using command of `/song`</b>\nExample:/song Can we kiss Forever\n\n C R E A T O R: @Psycho_Bots") START_IMG = os.environ.get("START_IMG", "") OWNER = os.environ.get("OWNER", "Alone_loverboy") DOWNLOAD_LOCATION = os.environ.get("DOWNLOAD_LOCATION", "./DOWNLOADS/") msg = {} # Builder Pack of FFMPEG: https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest
[ 1, 529, 276, 1112, 420, 29958, 29925, 29879, 29891, 1859, 29933, 1862, 29914, 29968, 2904, 347, 29899, 21238, 29966, 9507, 29958, 2917, 29889, 2272, 13, 5215, 2897, 13, 5215, 337, 13, 3166, 366, 29873, 4003, 29918, 11671, 1053, 612, 15907, 19558, 13, 13, 1990, 12782, 29901, 13, 1678, 12279, 29925, 29918, 1367, 353, 938, 29898, 359, 29889, 21813, 29889, 657, 703, 20576, 29918, 1367, 613, 5124, 876, 13, 1678, 3450, 29918, 29950, 24943, 353, 2897, 29889, 21813, 29889, 657, 703, 8787, 29918, 29950, 24943, 613, 20569, 13, 1678, 350, 2891, 29918, 4986, 29968, 1430, 353, 2897, 29889, 21813, 29889, 657, 703, 29933, 2891, 29918, 4986, 29968, 1430, 613, 20569, 13, 1678, 6850, 8322, 29918, 4345, 29954, 353, 2897, 29889, 21813, 29889, 657, 703, 25826, 29918, 4345, 29954, 613, 9872, 29890, 29958, 18567, 426, 7570, 29876, 29902, 626, 476, 2904, 347, 12545, 612, 15907, 304, 341, 29886, 29941, 9943, 12657, 11273, 29905, 29876, 29902, 508, 25553, 3139, 6125, 411, 1900, 11029, 243, 162, 148, 131, 3387, 3638, 592, 1024, 470, 6645, 411, 773, 1899, 310, 7034, 21453, 29952, 829, 29890, 14247, 29876, 14023, 8419, 21453, 1815, 591, 20057, 28297, 369, 29905, 29876, 29905, 29876, 315, 390, 382, 319, 323, 438, 390, 29901, 732, 29925, 29879, 29891, 1859, 29918, 29933, 1862, 1159, 13, 1678, 6850, 8322, 29918, 7833, 29954, 353, 2897, 29889, 21813, 29889, 657, 703, 25826, 29918, 7833, 29954, 613, 20569, 13, 1678, 438, 29956, 13865, 353, 2897, 29889, 21813, 29889, 657, 703, 9806, 13865, 613, 376, 2499, 650, 29918, 417, 369, 19415, 1159, 29871, 13, 1678, 360, 9806, 29940, 29428, 29918, 16652, 8098, 353, 2897, 29889, 21813, 29889, 657, 703, 3970, 16048, 29428, 29918, 16652, 8098, 613, 376, 6904, 3970, 16048, 29428, 29903, 29914, 1159, 13, 1678, 10191, 353, 6571, 13, 29937, 5373, 2700, 18744, 310, 21379, 3580, 11787, 29901, 2045, 597, 3292, 29889, 510, 29914, 13022, 11385, 549, 29914, 2276, 9154, 29899, 4282, 4058, 29899, 600, 20856, 29899, 12333, 13, 2 ]
contrib/cirrus/podbot.py
juhp/libpod
2
10472
#!/usr/bin/env python3 # Simple and dumb script to send a message to the #podman IRC channel on frenode # Based on example from: https://pythonspot.com/building-an-irc-bot/ import os import time import random import errno import socket import sys class IRC: response_timeout = 10 # seconds irc = socket.socket() def __init__(self, server, nickname, channel): self.server = server self.nickname = nickname self.channel = channel self.irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def _send(self, cmdstr): self.irc.send(bytes(cmdstr + '\r\n', 'utf-8')) def message(self, msg): data = 'PRIVMSG {0} :{1}\r\n'.format(self.channel, msg) print(data) self._send(data) @staticmethod def fix_newlines(bufr): return bufr.replace('\\r\\n', '\n') def _required_response(self, needle, haystack): start = time.time() end = start + self.response_timeout while time.time() < end: if haystack.find(needle) != -1: return (False, haystack) time.sleep(0.1) try: haystack += str(self.irc.recv(4096, socket.MSG_DONTWAIT)) except socket.error as serr: if serr.errno == errno.EWOULDBLOCK: continue raise # can't handle this return (True, haystack) # Error def connect(self, username, password): # This is ugly as sin, but seems to be a working send/expect sequence print("connecting to: {0}".format(self.server)) self.irc.connect((self.server, 6667)) #connects to the server self._send("USER {0} {0} {0} :I am {0}".format(self.nickname)) self._send("NICK {0}".format(self.nickname)) err, haystack = self._required_response('End of /MOTD command.' ''.format(self.nickname), "") if err: print(self.fix_newlines(haystack)) print("Error connecting to {0}".format(self.server)) return True print("Logging in as {0}".format(username)) self._send("PRIVMSG NickServ :IDENTIFY {0} {1}".format(username, password)) err, _ = self._required_response("You are now identified for", "") if err: print("Error logging in to {0} as {1}".format(self.server, username)) return True print("Joining {0}".format(self.channel)) self._send("JOIN {0}".format(self.channel)) err, haystack = self._required_response("{0} {1} :End of /NAMES list." "".format(self.nickname, self.channel), haystack) print(self.fix_newlines(haystack)) if err: print("Error joining {0}".format(self.channel)) return True return False def quit(self): print("Quitting") self._send("QUIT :my work is done here") self.irc.close() if len(sys.argv) < 3: print("Error: Must pass desired nick and message as parameters") else: irc = IRC("irc.freenode.net", sys.argv[1], "#podman") err = irc.connect(*os.environ.get('IRCID', 'Big Bug').split(" ", 2)) if not err: irc.message(" ".join(sys.argv[2:])) time.sleep(5.0) # avoid join/quit spam irc.quit()
[ 1, 18787, 4855, 29914, 2109, 29914, 6272, 3017, 29941, 13, 13, 29937, 12545, 322, 270, 3774, 2471, 304, 3638, 263, 2643, 304, 278, 396, 15334, 1171, 306, 10363, 8242, 373, 285, 1267, 356, 13, 29937, 16564, 373, 1342, 515, 29901, 2045, 597, 29886, 1541, 787, 17765, 29889, 510, 29914, 25237, 29899, 273, 29899, 2076, 29899, 7451, 29914, 13, 13, 5215, 2897, 13, 5215, 931, 13, 5215, 4036, 13, 5215, 4589, 1217, 13, 5215, 9909, 13, 5215, 10876, 13, 13, 1990, 306, 10363, 29901, 13, 13, 1678, 2933, 29918, 15619, 353, 29871, 29896, 29900, 29871, 396, 6923, 13, 268, 2076, 353, 9909, 29889, 11514, 580, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 1923, 29892, 25985, 978, 29892, 8242, 1125, 13, 4706, 1583, 29889, 2974, 353, 1923, 13, 4706, 1583, 29889, 19254, 978, 353, 25985, 978, 13, 4706, 1583, 29889, 12719, 353, 8242, 13, 4706, 1583, 29889, 2076, 353, 9909, 29889, 11514, 29898, 11514, 29889, 5098, 29918, 1177, 2544, 29892, 9909, 29889, 6156, 7077, 29918, 1254, 1525, 5194, 29897, 13, 13, 1678, 822, 903, 6717, 29898, 1311, 29892, 9920, 710, 1125, 13, 4706, 1583, 29889, 2076, 29889, 6717, 29898, 13193, 29898, 9006, 710, 718, 11297, 29878, 29905, 29876, 742, 525, 9420, 29899, 29947, 8785, 13, 13, 1678, 822, 2643, 29898, 1311, 29892, 10191, 1125, 13, 4706, 848, 353, 525, 29829, 29963, 4345, 29954, 426, 29900, 29913, 584, 29912, 29896, 1012, 29878, 29905, 29876, 4286, 4830, 29898, 1311, 29889, 12719, 29892, 10191, 29897, 13, 4706, 1596, 29898, 1272, 29897, 13, 4706, 1583, 3032, 6717, 29898, 1272, 29897, 13, 13, 1678, 732, 7959, 5696, 13, 1678, 822, 2329, 29918, 1482, 9012, 29898, 9721, 29878, 1125, 13, 4706, 736, 18392, 29878, 29889, 6506, 877, 1966, 29878, 1966, 29876, 742, 11297, 29876, 1495, 13, 13, 1678, 822, 903, 12403, 29918, 5327, 29898, 1311, 29892, 817, 280, 29892, 14842, 1429, 1125, 13, 4706, 1369, 353, 931, 29889, 2230, 580, 13, 4706, 1095, 353, 1369, 718, 1583, 29889, 5327, 29918, 15619, 13, 4706, 1550, 931, 29889, 2230, 580, 529, 1095, 29901, 13, 9651, 565, 14842, 1429, 29889, 2886, 29898, 26180, 280, 29897, 2804, 448, 29896, 29901, 13, 18884, 736, 313, 8824, 29892, 14842, 1429, 29897, 13, 9651, 931, 29889, 17059, 29898, 29900, 29889, 29896, 29897, 13, 9651, 1018, 29901, 13, 18884, 14842, 1429, 4619, 851, 29898, 1311, 29889, 2076, 29889, 3757, 29894, 29898, 29946, 29900, 29929, 29953, 29892, 9909, 29889, 4345, 29954, 29918, 29928, 1164, 29911, 12982, 1806, 876, 13, 9651, 5174, 9909, 29889, 2704, 408, 724, 29878, 29901, 13, 18884, 565, 724, 29878, 29889, 3127, 1217, 1275, 4589, 1217, 29889, 29923, 29956, 29949, 13309, 4051, 21339, 29901, 13, 462, 1678, 6773, 13, 18884, 12020, 29871, 396, 508, 29915, 29873, 4386, 445, 13, 4706, 736, 313, 5574, 29892, 14842, 1429, 29897, 29871, 396, 4829, 13, 13, 1678, 822, 4511, 29898, 1311, 29892, 8952, 29892, 4800, 1125, 13, 4706, 396, 910, 338, 22769, 408, 4457, 29892, 541, 2444, 304, 367, 263, 1985, 3638, 29914, 17854, 5665, 13, 13, 4706, 1596, 703, 6915, 292, 304, 29901, 426, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 2974, 876, 13, 4706, 1583, 29889, 2076, 29889, 6915, 3552, 1311, 29889, 2974, 29892, 29871, 29953, 29953, 29953, 29955, 876, 29871, 396, 6915, 29879, 304, 278, 1923, 13, 4706, 1583, 3032, 6717, 703, 11889, 426, 29900, 29913, 426, 29900, 29913, 426, 29900, 29913, 584, 29902, 626, 426, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 19254, 978, 876, 13, 4706, 1583, 3032, 6717, 703, 29940, 2965, 29968, 426, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 19254, 978, 876, 13, 13, 4706, 4589, 29892, 14842, 1429, 353, 1583, 3032, 12403, 29918, 5327, 877, 5044, 310, 847, 29924, 2891, 29928, 1899, 6169, 13, 462, 462, 18884, 525, 4286, 4830, 29898, 1311, 29889, 19254, 978, 511, 20569, 13, 4706, 565, 4589, 29901, 13, 9651, 1596, 29898, 1311, 29889, 5878, 29918, 1482, 9012, 29898, 29882, 388, 1429, 876, 13, 9651, 1596, 703, 2392, 16791, 304, 426, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 2974, 876, 13, 9651, 736, 5852, 13, 13, 4706, 1596, 703, 3403, 3460, 297, 408, 426, 29900, 29913, 1642, 4830, 29898, 6786, 876, 13, 4706, 1583, 3032, 6717, 703, 29829, 29963, 4345, 29954, 13853, 6889, 584, 1367, 3919, 6545, 29979, 426, 29900, 29913, 426, 29896, 29913, 1642, 4830, 29898, 6786, 29892, 4800, 876, 13, 4706, 4589, 29892, 903, 353, 1583, 3032, 12403, 29918, 5327, 703, 3492, 526, 1286, 15659, 363, 613, 20569, 13, 4706, 565, 4589, 29901, 13, 9651, 1596, 703, 2392, 12183, 297, 304, 426, 29900, 29913, 408, 426, 29896, 29913, 1642, 4830, 29898, 1311, 29889, 2974, 29892, 8952, 876, 13, 9651, 736, 5852, 13, 13, 4706, 1596, 703, 10844, 2827, 426, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 12719, 876, 13, 4706, 1583, 3032, 6717, 703, 29967, 6992, 426, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 12719, 876, 13, 4706, 4589, 29892, 14842, 1429, 353, 1583, 3032, 12403, 29918, 5327, 703, 29912, 29900, 29913, 426, 29896, 29913, 584, 5044, 310, 847, 5813, 29903, 1051, 1213, 13, 462, 462, 18884, 376, 1642, 4830, 29898, 1311, 29889, 19254, 978, 29892, 1583, 29889, 12719, 511, 13, 462, 462, 18884, 14842, 1429, 29897, 13, 4706, 1596, 29898, 1311, 29889, 5878, 29918, 1482, 9012, 29898, 29882, 388, 1429, 876, 13, 4706, 565, 4589, 29901, 13, 9651, 1596, 703, 2392, 22960, 426, 29900, 29913, 1642, 4830, 29898, 1311, 29889, 12719, 876, 13, 9651, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 822, 23283, 29898, 1311, 1125, 13, 4706, 1596, 703, 2182, 5367, 1159, 13, 4706, 1583, 3032, 6717, 703, 13356, 1806, 584, 1357, 664, 338, 2309, 1244, 1159, 13, 4706, 1583, 29889, 2076, 29889, 5358, 580, 13, 13, 13, 361, 7431, 29898, 9675, 29889, 19218, 29897, 529, 29871, 29941, 29901, 13, 1678, 1596, 703, 2392, 29901, 19928, 1209, 7429, 25985, 322, 2643, 408, 4128, 1159, 13, 2870, 29901, 13, 268, 2076, 353, 306, 10363, 703, 2076, 29889, 29888, 2733, 356, 29889, 1212, 613, 10876, 29889, 19218, 29961, 29896, 1402, 12305, 15334, 1171, 1159, 13, 1678, 4589, 353, 29871, 2076, 29889, 6915, 10456, 359, 29889, 21813, 29889, 657, 877, 8193, 29907, 1367, 742, 525, 6970, 28209, 2824, 5451, 703, 9162, 29871, 29906, 876, 13, 1678, 565, 451, 4589, 29901, 13, 308, 2076, 29889, 4906, 703, 11393, 7122, 29898, 9675, 29889, 19218, 29961, 29906, 29901, 12622, 13, 4706, 931, 29889, 17059, 29898, 29945, 29889, 29900, 29897, 29871, 396, 4772, 5988, 29914, 28358, 805, 314, 13, 308, 2076, 29889, 28358, 580, 13, 2 ]
request.py
codeofdusk/Amanda
0
127903
<gh_stars>0 """Contains the Request class. Copyright 2018 - <NAME> <<EMAIL>>. Licensed under MIT.""" import random import components import config import utils class request(object): "Contains attributes for handling user requests and returning responses. Instantiate this class to make a request." def __init__(self, message, driver=None, *args, **kwargs): "Take a string and return a response (if available) or False for no response." self._message = message self.driver = driver self.accepted = False self.response = None self.content = None self.invocation = None # Expose extra args self.args = args self.kwargs = kwargs try: # First attempt to call plugin explicitly if config.conf['advanced']['allow_explicit'] and self._message.startswith( "!"): self.accept() # Get the plugin name and args qt = self._message[1:].split(" ") self.invocation = qt[0] self.content = ' '.join(qt[1:]) # Is the user requesting the full motd? # Note: if we need to implement another special command like this that's a core function, we should create a CorePlugin object that's always loaded and not part of the config that contains these commands. try: sendmotd = config.conf['general']['sendmotd'] if (sendmotd == 'full' or sendmotd == 'retracted') and (sendmotd == 'retracted' or self.driver.short_announcements) and self.invocation == "help": self.response = utils.build_plugin_ad() except AttributeError: pass # Search for the plugin for plugin in components.plugins: try: if self.invocation.lower() in plugin.invocations: self.response = plugin.run(self) except AttributeError: continue # Attempt to call plugin implicitly if config.conf['advanced']['allow_implicit'] and not self._message.startswith( "!"): for plugin in components.plugins: try: self.content = plugin.match(self._message) except (AttributeError, NotImplementedError): continue else: if self.content: self.accept() self.response = plugin.run(self) except BaseException: import traceback self.response = traceback.format_exc() finally: self.finalize() def __str__(self): if not self.response: # do we have huh messages? if config.conf['general']['huh_messages']: self.response = random.choice( config.conf['general']['huh_messages']) else: self.response = "I don't understand." return self.response def accept(self): try: self.driver.working(True, request=self) except (AttributeError, NotImplementedError): pass self.accepted = True def finalize(self): if self.accepted: try: self.driver.say(str(self), request=self) except (AttributeError, NotImplementedError): pass try: self.driver.working(False, request=self) except (AttributeError, NotImplementedError): pass
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 15945, 29908, 21409, 278, 10729, 770, 29889, 13, 11882, 1266, 29871, 29906, 29900, 29896, 29947, 448, 529, 5813, 29958, 3532, 26862, 6227, 6778, 29889, 10413, 21144, 1090, 341, 1806, 1213, 15945, 13, 5215, 4036, 13, 5215, 7117, 13, 5215, 2295, 13, 5215, 3667, 29879, 13, 13, 13, 1990, 2009, 29898, 3318, 1125, 13, 1678, 376, 21409, 8393, 363, 11415, 1404, 7274, 322, 7863, 20890, 29889, 2799, 3656, 403, 445, 770, 304, 1207, 263, 2009, 1213, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 2643, 29892, 7156, 29922, 8516, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 376, 26772, 263, 1347, 322, 736, 263, 2933, 313, 361, 3625, 29897, 470, 7700, 363, 694, 2933, 1213, 13, 4706, 1583, 3032, 4906, 353, 2643, 13, 4706, 1583, 29889, 9465, 353, 7156, 13, 4706, 1583, 29889, 16044, 287, 353, 7700, 13, 4706, 1583, 29889, 5327, 353, 6213, 13, 4706, 1583, 29889, 3051, 353, 6213, 13, 4706, 1583, 29889, 11569, 10610, 353, 6213, 13, 4706, 396, 1222, 4220, 4805, 6389, 13, 4706, 1583, 29889, 5085, 353, 6389, 13, 4706, 1583, 29889, 19290, 353, 9049, 5085, 13, 4706, 1018, 29901, 13, 9651, 396, 3824, 4218, 304, 1246, 7079, 9479, 13, 9651, 565, 2295, 29889, 5527, 1839, 328, 16858, 16215, 9536, 29918, 4548, 4019, 2033, 322, 1583, 3032, 4906, 29889, 27382, 2541, 29898, 13, 462, 1678, 376, 3850, 1125, 13, 18884, 1583, 29889, 16044, 580, 13, 18884, 396, 3617, 278, 7079, 1024, 322, 6389, 13, 18884, 3855, 29873, 353, 1583, 3032, 4906, 29961, 29896, 29901, 1822, 5451, 703, 16521, 13, 18884, 1583, 29889, 11569, 10610, 353, 3855, 29873, 29961, 29900, 29962, 13, 18884, 1583, 29889, 3051, 353, 525, 15300, 7122, 29898, 17915, 29961, 29896, 29901, 2314, 13, 18884, 396, 1317, 278, 1404, 2009, 292, 278, 2989, 3184, 29881, 29973, 13, 18884, 396, 3940, 29901, 565, 591, 817, 304, 2334, 1790, 4266, 1899, 763, 445, 393, 29915, 29879, 263, 7136, 740, 29892, 591, 881, 1653, 263, 10239, 16288, 1203, 393, 29915, 29879, 2337, 7500, 322, 451, 760, 310, 278, 2295, 393, 3743, 1438, 8260, 29889, 13, 18884, 1018, 29901, 13, 462, 1678, 3638, 14817, 29881, 353, 2295, 29889, 5527, 1839, 17492, 16215, 6717, 14817, 29881, 2033, 13, 462, 1678, 565, 313, 6717, 14817, 29881, 1275, 525, 8159, 29915, 470, 3638, 14817, 29881, 1275, 525, 2267, 1461, 287, 1495, 322, 313, 6717, 14817, 29881, 1275, 525, 2267, 1461, 287, 29915, 470, 1583, 29889, 9465, 29889, 12759, 29918, 812, 1309, 29883, 4110, 29897, 322, 1583, 29889, 11569, 10610, 1275, 376, 8477, 1115, 13, 462, 4706, 1583, 29889, 5327, 353, 3667, 29879, 29889, 4282, 29918, 8582, 29918, 328, 580, 13, 18884, 5174, 23833, 2392, 29901, 13, 462, 1678, 1209, 13, 18884, 396, 11856, 363, 278, 7079, 13, 18884, 363, 7079, 297, 7117, 29889, 12800, 29901, 13, 462, 1678, 1018, 29901, 13, 462, 4706, 565, 1583, 29889, 11569, 10610, 29889, 13609, 580, 297, 7079, 29889, 11569, 542, 800, 29901, 13, 462, 9651, 1583, 29889, 5327, 353, 7079, 29889, 3389, 29898, 1311, 29897, 13, 462, 1678, 5174, 23833, 2392, 29901, 13, 462, 4706, 6773, 13, 9651, 396, 6212, 3456, 304, 1246, 7079, 27063, 13, 9651, 565, 2295, 29889, 5527, 1839, 328, 16858, 16215, 9536, 29918, 6574, 4019, 2033, 322, 451, 1583, 3032, 4906, 29889, 27382, 2541, 29898, 13, 462, 1678, 376, 3850, 1125, 13, 18884, 363, 7079, 297, 7117, 29889, 12800, 29901, 13, 462, 1678, 1018, 29901, 13, 462, 4706, 1583, 29889, 3051, 353, 7079, 29889, 4352, 29898, 1311, 3032, 4906, 29897, 13, 462, 1678, 5174, 313, 6708, 2392, 29892, 2216, 1888, 2037, 287, 2392, 1125, 13, 462, 4706, 6773, 13, 462, 1678, 1683, 29901, 13, 462, 4706, 565, 1583, 29889, 3051, 29901, 13, 462, 9651, 1583, 29889, 16044, 580, 13, 462, 9651, 1583, 29889, 5327, 353, 7079, 29889, 3389, 29898, 1311, 29897, 13, 4706, 5174, 7399, 2451, 29901, 13, 9651, 1053, 9637, 1627, 13, 9651, 1583, 29889, 5327, 353, 9637, 1627, 29889, 4830, 29918, 735, 29883, 580, 13, 4706, 7146, 29901, 13, 9651, 1583, 29889, 8394, 675, 580, 13, 13, 1678, 822, 4770, 710, 12035, 1311, 1125, 13, 4706, 565, 451, 1583, 29889, 5327, 29901, 13, 9651, 396, 437, 591, 505, 298, 16099, 7191, 29973, 13, 9651, 565, 2295, 29889, 5527, 1839, 17492, 16215, 6905, 29882, 29918, 19158, 2033, 29901, 13, 18884, 1583, 29889, 5327, 353, 4036, 29889, 16957, 29898, 13, 462, 1678, 2295, 29889, 5527, 1839, 17492, 16215, 6905, 29882, 29918, 19158, 11287, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 5327, 353, 376, 29902, 1016, 29915, 29873, 2274, 1213, 13, 4706, 736, 1583, 29889, 5327, 13, 13, 1678, 822, 3544, 29898, 1311, 1125, 13, 4706, 1018, 29901, 13, 9651, 1583, 29889, 9465, 29889, 22899, 29898, 5574, 29892, 2009, 29922, 1311, 29897, 13, 4706, 5174, 313, 6708, 2392, 29892, 2216, 1888, 2037, 287, 2392, 1125, 13, 9651, 1209, 13, 4706, 1583, 29889, 16044, 287, 353, 5852, 13, 13, 1678, 822, 2186, 675, 29898, 1311, 1125, 13, 4706, 565, 1583, 29889, 16044, 287, 29901, 13, 9651, 1018, 29901, 13, 18884, 1583, 29889, 9465, 29889, 20834, 29898, 710, 29898, 1311, 511, 2009, 29922, 1311, 29897, 13, 9651, 5174, 313, 6708, 2392, 29892, 2216, 1888, 2037, 287, 2392, 1125, 13, 18884, 1209, 13, 9651, 1018, 29901, 13, 18884, 1583, 29889, 9465, 29889, 22899, 29898, 8824, 29892, 2009, 29922, 1311, 29897, 13, 9651, 5174, 313, 6708, 2392, 29892, 2216, 1888, 2037, 287, 2392, 1125, 13, 18884, 1209, 13, 2 ]
nzmath/poly/univar.py
turkeydonkey/nzmath3
1
65984
<reponame>turkeydonkey/nzmath3 """ Univariate Polynomials The polynomials are immutable data types, under the public API. If one tries to manipulate its underlying data attributes, immutability will be able to be broken. """ import warnings import nzmath.ring as _ring import nzmath.poly.formalsum as formalsum class PolynomialInterface(formalsum.FormalSumContainerInterface): """ Base class for all univariate polynomials. """ def __init__(self, coefficients, **kwds): """ For any descendants of PolynomialInterface, `coefficients' have to be given. Other arguments, if necessary, should be passed as keyword arguments. Note that in this __init__ method, no actual initialization happens. """ formalsum.FormalSumContainerInterface.__init__(self) self.number_of_variables = 1 def __eq__(self, other): """ self == other """ if not isinstance(other, PolynomialInterface): warnings.warn("comparison falls back to that of formal sum.") return formalsum.FormalSumContainerInterface.__eq__(self, other) sterms = [t for t in self.iterterms() if t[1]] sterms.sort() oterms = [t for t in other.iterterms() if t[1]] oterms.sort() return sterms == oterms def __hash__(self): val = sum([hash(t) for t in self.iterterms() if t[1]]) return val def __pow__(self, index): """ self ** index """ raise NotImplementedError("should be overridden") def ring_mul(self, other): """ Multiplication of two polynomials in the same ring. """ mul_coeff = {} for ds, cs in self: for do, co in other: term_degree = ds + do if term_degree in mul_coeff: mul_coeff[term_degree] += cs*co else: mul_coeff[term_degree] = cs*co return self.construct_with_default(sorted([(d, c) for (d, c) in mul_coeff.items() if c])) def scalar_mul(self, scale): """ Return the result of scalar multiplication. """ return self.construct_with_default([(d, c * scale) for (d, c) in self if c]) def term_mul(self, term): """ Return the result of multiplication with the given term. The term can be given as a tuple (degree, coeff) or as a Polynomial instance. """ if isinstance(term, PolynomialInterface): degree, coeff = next(iter(term)) else: degree, coeff = term return self.construct_with_default([(d + degree, c * coeff) for (d, c) in self]) def square(self): """ Return square of this polynomial. """ raise NotImplementedError("should be overridden") def differentiate(self): """ Return the formal differentiation of self. """ result = {} for d, c in self: if d > 0: dc = d * c if dc: result[d - 1] = dc return self.construct_with_default(result) def upshift_degree(self, slide): """ Return the polynomial obtained by shifting upward all terms with degrees of 'slide'. f.upshift_degree(slide) is equivalent to f.term_mul((slide, 1)). """ return self.bases_map(lambda x: x + slide) def downshift_degree(self, slide): """ Return the polynomial obtained by shifting downward all terms with degrees of 'slide'. Be careful that if the least degree term has the degree less than 'slide' then the result is not mathematically a polynomial. Even in such a case, the method does not raise an exception. f.downshift_degree(slide) is equivalent to f.upshift_degree(-slide). """ return self.bases_map(lambda x: x - slide) def terms_map(self, func): """ Create a new formal sum container by applying func to each term. func must be a function taking 2 arguments. """ terms = [] for t in self: b, c = func(*t) if c: terms.append((b, c)) return self.construct_with_default(terms) def construct_with_default(self, terms): """ Create a new univariate polynomial of the same class with self, with given only the terms and use copy of self's data if necessary. """ return self.__class__(terms, **self._init_kwds) class BasicPolynomial(PolynomialInterface): """ Basic polynomial data type ignoring a variable name and the ring. """ def __init__(self, coefficients, **kwds): """ BasicPolynomial(coefficients) coefficients can be any dict initial values. """ PolynomialInterface.__init__(self, coefficients, **kwds) self._coefficients = dict(coefficients) self._init_kwds = kwds def __add__(self, other): """ self + other """ sum_coeff = dict(iter(self)) for term, coeff in other: if term in sum_coeff: sum_coeff[term] += coeff else: sum_coeff[term] = coeff return self.construct_with_default([(d, c) for (d, c) in sum_coeff.items() if c]) def __sub__(self, other): """ self - other """ dif_coeff = dict(iter(self)) for term, coeff in other: if term in dif_coeff: dif_coeff[term] -= coeff else: dif_coeff[term] = -coeff return self.construct_with_default([(d, c) for (d, c) in dif_coeff.items() if c]) def __mul__(self, other): """ self * other If type of other is Polynomial, do multiplication in ring. Otherwise, do scalar multiplication. """ if isinstance(other, PolynomialInterface): return self.ring_mul(other) else: try: return self.scalar_mul(other) except TypeError: return NotImplemented def __rmul__(self, other): """ other * self If type of other does not support multiplication with self from left, this method is called. In the context, it is only posiible that other be a scalar. """ try: return self.scalar_mul(other) except TypeError: return NotImplemented def __neg__(self): """ -self """ return self.construct_with_default([(d, -c) for (d, c) in self]) def __pos__(self): """ +self """ return self.construct_with_default(self._coefficients) def square(self): """ Return the square of self. """ # zero if not self: return self data_length = len(self._coefficients) # monomial if data_length == 1: return self.construct_with_default([(d*2, c**2) for (d, c) in self]) # binomial if data_length == 2: (d1, c1), (d2, c2) = self.terms() return self.construct_with_default({d1*2:c1**2, d1+d2:c1*c2*2, d2*2:c2**2}) # general (inefficient) items = list(self._coefficients.items()) fst, snd = {}, {} if data_length & 1: b, c = items.pop() fst[b] = c while items: b, c = items.pop() fst[b] = c b, c = items.pop() snd[b] = c fst = self.__class__(fst, **self._init_kwds) snd = self.__class__(snd, **self._init_kwds) mid = fst.ring_mul(snd.scalar_mul(2)) return fst.square() + mid + snd.square() def __pow__(self, index): """ self ** index """ # special indices if index < 0: raise ValueError("negative index is not allowed.") elif index == 0: for c in self.itercoefficients(): if c: one = _ring.getRing(c).one break else: one = 1 return self.construct_with_default({0: one}) elif index == 1: return self elif index == 2: return self.square() # special polynomials if not self: return self elif len(self._coefficients) == 1: return self.construct_with_default([(d*index, c**index) for (d, c) in self]) # general power_product = self.construct_with_default({0: 1}) power_of_2 = self while index: if index & 1: power_product *= power_of_2 index //= 2 if index: power_of_2 = power_of_2.square() return power_product def __call__(self, val): """ substitution """ items = list(self._coefficients.items()) if not items: return 0*val d, c = items.pop() result = c * val**d for d, c in items: result += c * val**d return result def iterterms(self): """ iterator for (degree, coefficient) pairs. The iterator is equivalent to zip(self.iterbases(), self.itercoefficients()) """ return iter(self._coefficients.items()) def itercoefficients(self): """ iterator for coefficients. """ return iter(self._coefficients.values()) def iterbases(self): """ iterator for degrees. """ return iter(self._coefficients.keys()) def __getitem__(self, degree): """ Return the coefficient of specified degree. If there is no term of degree, return 0. """ return self._coefficients.get(degree, 0) def __contains__(self, degree): """ Return True if there is a term of specified degree. False otherwise. """ return degree in self._coefficients def __len__(self): """ Return the number of data entries. """ return len(self._coefficients) def __eq__(self, other): """ self == other """ if self is other: return True return PolynomialInterface.__eq__(self, other) def __hash__(self): return PolynomialInterface.__hash__(self) def __repr__(self): # for debug return "%s(%s)" % (self.__class__.__name__, repr(self._coefficients)) class SortedPolynomial (PolynomialInterface): """ SortedPolynomial stores terms of a polynomial in sorted manner. All methods and operations keep it sorted. """ def __init__(self, coefficients, _sorted=False, **kwds): """ SortedPolynomial(coefficients) 'coefficients' can be any dict initial values. Optionally '_sorted' can be True if the coefficients is already sorted. """ PolynomialInterface.__init__(self, coefficients, **kwds) self.sorted = [] if not _sorted or isinstance(coefficients, dict): for t in dict(coefficients).items(): self._insort(t) else: self.sorted = list(coefficients) self._init_kwds = kwds self._init_kwds['_sorted'] = True def _insort(self, term): """ Insert the term into self.seorted list, and keep it sorted. - This method is destructive. - This method is not in a part of the API. """ self.sorted.insert(self._bisect(term[0]), term) def _bisect(self, degree): """ Return the index where to insert term of degree. - This method is not in a part of the API. - The code is just adapting bisect.bisect_right to the context. """ lo, hi = 0, len(self.sorted) while lo < hi: mid = (lo + hi) >> 1 if degree < self.sorted[mid][0]: hi = mid else: lo = mid + 1 return lo def __pos__(self): """ +self """ return self.construct_with_default(self.sorted) def __neg__(self): """ -self """ return self.construct_with_default([(d, -c) for (d, c) in self]) def __add__(self, other): """ self + other """ if self.sorted: iter_self = iter(self.sorted) self_term = next(iter_self) else: self_term = None if other.sorted: iter_other = iter(other.sorted) other_term = next(iter_other) else: other_term = None sorted = [] while self_term and other_term: compared = cmp(self_term[0], other_term[0]) if compared < 0: sorted.append(self_term) try: self_term = next(iter_self) except StopIteration: self_term = None break elif compared == 0: c = self_term[1] + other_term[1] if c: sorted.append((self_term[0], c)) try: self_term = next(iter_self) except StopIteration: self_term = None try: other_term = next(iter_other) except StopIteration: other_term = None if self_term is None or other_term is None: break else: sorted.append(other_term) try: other_term = next(iter_other) except StopIteration: other_term = None break if other_term is None and self_term: sorted.append(self_term) for term in iter_self: sorted.append(term) elif self_term is None and other_term: sorted.append(other_term) for term in iter_other: sorted.append(term) return self.construct_with_default(sorted) def __sub__(self, other): """ self - other It is something like merge sort. """ if self.sorted: iter_self = iter(self.sorted) self_term = next(iter_self) else: self_term = None if other.sorted: iter_other = iter(other.sorted) other_term = next(iter_other) else: other_term = None sorted = [] while self_term and other_term: compared = cmp(self_term[0], other_term[0]) if compared < 0: sorted.append(self_term) try: self_term = next(iter_self) except StopIteration: self_term = None break elif compared == 0: c = self_term[1] - other_term[1] if c: sorted.append((self_term[0], c)) try: self_term = next(iter_self) except StopIteration: self_term = None try: other_term = next(iter_other) except StopIteration: other_term = None if self_term is None or other_term is None: break else: sorted.append((other_term[0], -other_term[1])) try: other_term = next(iter_other) except StopIteration: other_term = None break if other_term is None and self_term: sorted.append(self_term) for term in iter_self: sorted.append(term) elif self_term is None and other_term: sorted.append((other_term[0], -other_term[1])) for term in iter_other: sorted.append((term[0], -term[1])) return self.construct_with_default(sorted) def __mul__(self, other): """ self * other If type of other is SortedPolynomial, do multiplication in ring. Otherwise, do scalar multiplication. """ if isinstance(other, PolynomialInterface): return self.ring_mul(other) else: try: return self.scalar_mul(other) except TypeError: return NotImplemented def __rmul__(self, other): """ other * self If type of other does not support multiplication with self from left, this method is called. In the context, it is only posiible that other be a scalar. """ try: return self.scalar_mul(other) except TypeError: return NotImplemented def ring_mul_karatsuba(self, other): """ Multiplication of two polynomials in the same ring. Computation is carried out by Karatsuba method. """ polynomial = self.construct_with_default # zero if not self or not other: return polynomial(()) # monomial if len(self.sorted) == 1: return other.term_mul(self) if len(other.sorted) == 1: return self.term_mul(other) # binomial if len(self.sorted) == 2: p, q = [other.term_mul(term) for term in self] return p + q if len(other.sorted) == 2: p, q = [self.term_mul(term) for term in other] return p + q # suppose self is black and other is red. black_left_degree, black_right_degree = self.sorted[0][0], self.sorted[-1][0] red_left_degree, red_right_degree = other.sorted[0][0], other.sorted[-1][0] left_degree = min(black_left_degree, red_left_degree) right_degree = max(black_right_degree, red_right_degree) # we assert here that order is of ascending. (is it correct?) assert left_degree < right_degree half_degree = (left_degree + right_degree) >> 1 black_half_index = self._bisect(half_degree) red_half_index = other._bisect(half_degree) if not black_half_index: return (self.downshift_degree(black_left_degree).ring_mul_karatsuba(other)).upshift_degree(black_left_degree) if not red_half_index: return (self.ring_mul_karatsuba(other.downshift_degree(red_left_degree))).upshift_degree(red_left_degree) club = polynomial([(d - left_degree, c) for (d, c) in self.sorted[:black_half_index]]) spade = polynomial([(d - half_degree, c) for (d, c) in self.sorted[black_half_index:]]) dia = polynomial([(d - left_degree, c) for (d, c) in other.sorted[:red_half_index]]) heart = polynomial([(d - half_degree, c) for (d, c) in other.sorted[red_half_index:]]) weaker = club.ring_mul_karatsuba(dia) stronger = spade.ring_mul_karatsuba(heart) karatsuba = (club + spade).ring_mul_karatsuba(dia + heart) - weaker - stronger if left_degree: return (weaker.upshift_degree(left_degree * 2) + karatsuba.upshift_degree(left_degree + half_degree) + stronger.upshift_degree(half_degree * 2)) else: return (weaker + karatsuba.upshift_degree(half_degree) + stronger.upshift_degree(half_degree * 2)) def scalar_mul(self, scale): """ Return the result of scalar multiplication. """ keep_ring = True if "coeffring" in self._init_kwds: new_coeff = [] coeffring = self._init_kwds["coeffring"] for d, c in self: if c: scaled = c * scale if keep_ring and scaled not in coeffring: coeffring = coeffring.getCommonSuperring(_ring.getRing(scaled)) new_coeff.append((d, scaled)) self._init_kwds["coeffring"] = coeffring else: new_coeff = [(d, c * scale) for (d, c) in self if c] return self.construct_with_default(new_coeff) def square(self): """ Return the square of self. """ # zero if not self: return self polynomial = self.construct_with_default data_length = len(self.sorted) # monomial if data_length == 1: d, c = self.sorted[0] if d: return polynomial([(d*2, c**2)]) else: return polynomial([(0, c**2)]) # binomial if data_length == 2: (d1, c1), (d2, c2) = [(d, c) for (d, c) in self] return polynomial({d1*2:c1**2, d1+d2:c1*c2*2, d2*2:c2**2}) # general (Karatsuba) right_degree = self.sorted[-1][0] left_degree = self.sorted[0][0] half_degree = (right_degree + left_degree) >> 1 half_index = self._bisect(half_degree) fst = polynomial([(d - left_degree, c) for (d, c) in self.sorted[:half_index]]) snd = polynomial([(d - half_degree, c) for (d, c) in self.sorted[half_index:]]) fst_squared = fst.square() snd_squared = snd.square() karatsuba = (fst + snd).square() - fst_squared - snd_squared if left_degree: return (fst_squared.upshift_degree(left_degree * 2) + karatsuba.upshift_degree(left_degree + half_degree) + snd_squared.upshift_degree(half_degree * 2)) else: return (fst_squared + karatsuba.upshift_degree(half_degree) + snd_squared.upshift_degree(half_degree * 2)) def __pow__(self, index): """ self ** index No ternary powering is defined here, because there is no modulus operator defined. """ # special indices if index < 0: raise ValueError("negative index is not allowed.") elif index == 0: for c in self.itercoefficients(): if c: one = _ring.getRing(c).one break else: one = 1 return self.construct_with_default([(0, one)]) elif index == 1: return self elif index == 2: return self.square() # special polynomials if not self: return self elif len(self.sorted) == 1: return self.construct_with_default([(d*index, c**index) for (d, c) in self]) # general power_product = self.construct_with_default([(0, 1)]) power_of_2 = self while index: if index & 1: power_product *= power_of_2 index //= 2 if index: power_of_2 = power_of_2.square() return power_product def degree(self): """ Return the degree of self """ assert self.sorted == sorted(self.sorted) for d, c in self.sorted[::-1]: if c: return d return -1 def leading_coefficient(self): """ Return the leading coefficient """ assert self.sorted == sorted(self.sorted) for d, c in self.sorted[::-1]: if c: return c return 0 def leading_term(self): """ Return the leading term as a tuple (degree, coefficient). """ assert self.sorted == sorted(self.sorted) for d, c in self.sorted[::-1]: if c: return (d, c) return (-1, 0) def iterterms(self): """ iterator for (base, coefficient) pairs. The iterator is equivalent to zip(self.iterbases(), self.itercoefficients()) """ return iter(self.sorted) def iterbases(self): """ iterator for bases. """ for term in self.sorted: yield term[0] def itercoefficients(self): """ iterator for coefficients. """ for term in self.sorted: yield term[1] def __getitem__(self, degree): """ Return the coefficient of specified degree. If there is no term of degree, return 0. """ if self.sorted: rindex = self._bisect(degree) if self.sorted[rindex - 1][0] == degree: return self.sorted[rindex - 1][1] return 0 def __contains__(self, degree): """ Return True if there is a term of specified degree. False otherwise. """ rindex = self._bisect(degree) if self.sorted[rindex - 1][0] == degree: return True return False def __len__(self): """ Return the number of data entries. """ return len(self.sorted) def __eq__(self, other): """ self == other """ if self is other: return True if not isinstance(other, SortedPolynomial): return PolynomialInterface.__eq__(self, other) if [t for t in self if t[1]] == [t for t in other if t[1]]: return True return False def __hash__(self): val = sum([hash(t) for t in self if t[1]]) return val def __call__(self, val): """ substitution """ items = list(self.sorted) if not items: return 0 * val val_pow = {1:val} d, c = items.pop() result = c while len(items) > 0: (e, f) = items.pop() result = result * val_pow.setdefault(d - e, val ** (d - e)) + f d = e if d: return result * val_pow.get(d, val ** d) else: return result def __repr__(self): # debug return repr(self.sorted)
[ 1, 529, 276, 1112, 420, 29958, 29873, 332, 1989, 9176, 1989, 29914, 29876, 29920, 755, 29941, 13, 15945, 29908, 13, 2525, 27432, 403, 2043, 9222, 29879, 13, 13, 1576, 24655, 526, 5198, 9246, 848, 4072, 29892, 1090, 278, 970, 3450, 29889, 29871, 960, 13, 650, 14335, 304, 26749, 967, 14407, 848, 8393, 29892, 5198, 329, 3097, 13, 14043, 367, 2221, 304, 367, 9391, 29889, 13, 15945, 29908, 13, 13, 13, 5215, 18116, 13, 5215, 302, 29920, 755, 29889, 5393, 408, 903, 5393, 13, 5215, 302, 29920, 755, 29889, 22678, 29889, 689, 1338, 398, 408, 883, 1338, 398, 13, 13, 13, 1990, 2043, 9222, 10448, 29898, 689, 1338, 398, 29889, 2500, 284, 11139, 7895, 10448, 1125, 13, 1678, 9995, 13, 1678, 7399, 770, 363, 599, 443, 27432, 403, 24655, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 16127, 29892, 3579, 11022, 6289, 1125, 13, 4706, 9995, 13, 4706, 1152, 738, 17086, 1934, 310, 2043, 9222, 10448, 29892, 421, 1111, 8462, 29879, 29915, 13, 4706, 505, 304, 367, 2183, 29889, 29871, 5901, 6273, 29892, 565, 5181, 29892, 881, 367, 13, 4706, 4502, 408, 13553, 6273, 29889, 29871, 3940, 393, 297, 445, 4770, 2344, 1649, 13, 4706, 1158, 29892, 694, 3935, 17865, 5930, 29889, 13, 4706, 9995, 13, 4706, 883, 1338, 398, 29889, 2500, 284, 11139, 7895, 10448, 17255, 2344, 12035, 1311, 29897, 13, 4706, 1583, 29889, 4537, 29918, 974, 29918, 20897, 353, 29871, 29896, 13, 13, 1678, 822, 4770, 1837, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 1275, 916, 13, 4706, 9995, 13, 4706, 565, 451, 338, 8758, 29898, 1228, 29892, 2043, 9222, 10448, 1125, 13, 9651, 18116, 29889, 25442, 703, 510, 20941, 20074, 1250, 304, 393, 310, 11595, 2533, 23157, 13, 9651, 736, 883, 1338, 398, 29889, 2500, 284, 11139, 7895, 10448, 17255, 1837, 12035, 1311, 29892, 916, 29897, 13, 4706, 16864, 1516, 353, 518, 29873, 363, 260, 297, 1583, 29889, 1524, 357, 1516, 580, 565, 260, 29961, 29896, 5262, 13, 4706, 16864, 1516, 29889, 6605, 580, 13, 4706, 288, 357, 1516, 353, 518, 29873, 363, 260, 297, 916, 29889, 1524, 357, 1516, 580, 565, 260, 29961, 29896, 5262, 13, 4706, 288, 357, 1516, 29889, 6605, 580, 13, 4706, 736, 16864, 1516, 1275, 288, 357, 1516, 13, 13, 1678, 822, 4770, 8568, 12035, 1311, 1125, 13, 539, 659, 353, 2533, 4197, 8568, 29898, 29873, 29897, 363, 260, 297, 1583, 29889, 1524, 357, 1516, 580, 565, 260, 29961, 29896, 24960, 13, 539, 736, 659, 13, 13, 1678, 822, 4770, 12248, 12035, 1311, 29892, 2380, 1125, 13, 4706, 9995, 13, 4706, 1583, 3579, 2380, 13, 4706, 9995, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 703, 9344, 367, 20831, 1145, 1159, 13, 13, 1678, 822, 9228, 29918, 16109, 29898, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 9683, 666, 1414, 310, 1023, 24655, 297, 278, 1021, 9228, 29889, 13, 4706, 9995, 13, 4706, 15065, 29918, 1111, 12352, 353, 6571, 13, 4706, 363, 18031, 29892, 5939, 297, 1583, 29901, 13, 9651, 363, 437, 29892, 1302, 297, 916, 29901, 13, 18884, 1840, 29918, 12163, 929, 353, 18031, 718, 437, 13, 18884, 565, 1840, 29918, 12163, 929, 297, 15065, 29918, 1111, 12352, 29901, 13, 462, 1678, 15065, 29918, 1111, 12352, 29961, 8489, 29918, 12163, 929, 29962, 4619, 5939, 29930, 1111, 13, 18884, 1683, 29901, 13, 462, 1678, 15065, 29918, 1111, 12352, 29961, 8489, 29918, 12163, 929, 29962, 353, 5939, 29930, 1111, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 29898, 24582, 4197, 29898, 29881, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 15065, 29918, 1111, 12352, 29889, 7076, 580, 565, 274, 12622, 13, 13, 1678, 822, 17336, 29918, 16109, 29898, 1311, 29892, 6287, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 1121, 310, 17336, 21666, 29889, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 29892, 274, 334, 6287, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 565, 274, 2314, 13, 13, 1678, 822, 1840, 29918, 16109, 29898, 1311, 29892, 1840, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 1121, 310, 21666, 411, 278, 2183, 1840, 29889, 13, 4706, 450, 1840, 508, 367, 2183, 408, 263, 18761, 313, 12163, 929, 29892, 1302, 12352, 29897, 470, 408, 263, 13, 4706, 2043, 9222, 2777, 29889, 13, 4706, 9995, 13, 4706, 565, 338, 8758, 29898, 8489, 29892, 2043, 9222, 10448, 1125, 13, 9651, 7426, 29892, 1302, 12352, 353, 2446, 29898, 1524, 29898, 8489, 876, 13, 4706, 1683, 29901, 13, 9651, 7426, 29892, 1302, 12352, 353, 1840, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 718, 7426, 29892, 274, 334, 1302, 12352, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 2314, 13, 13, 1678, 822, 6862, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 6862, 310, 445, 10159, 29889, 13, 4706, 9995, 13, 4706, 12020, 2216, 1888, 2037, 287, 2392, 703, 9344, 367, 20831, 1145, 1159, 13, 13, 1678, 822, 17473, 403, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 11595, 1422, 11685, 310, 1583, 29889, 13, 4706, 9995, 13, 4706, 1121, 353, 6571, 13, 4706, 363, 270, 29892, 274, 297, 1583, 29901, 13, 9651, 565, 270, 1405, 29871, 29900, 29901, 13, 18884, 270, 29883, 353, 270, 334, 274, 13, 18884, 565, 270, 29883, 29901, 13, 462, 1678, 1121, 29961, 29881, 448, 29871, 29896, 29962, 353, 270, 29883, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 29898, 2914, 29897, 13, 13, 1678, 822, 24081, 29882, 2027, 29918, 12163, 929, 29898, 1311, 29892, 20343, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 10159, 7625, 491, 528, 24377, 701, 1328, 599, 4958, 13, 4706, 411, 14496, 310, 525, 19265, 4286, 13, 13, 4706, 285, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 19265, 29897, 338, 7126, 304, 13, 4706, 285, 29889, 8489, 29918, 16109, 3552, 19265, 29892, 29871, 29896, 8106, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 29890, 2129, 29918, 1958, 29898, 2892, 921, 29901, 921, 718, 20343, 29897, 13, 13, 1678, 822, 1623, 10889, 29918, 12163, 929, 29898, 1311, 29892, 20343, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 10159, 7625, 491, 528, 24377, 1623, 1328, 599, 4958, 13, 4706, 411, 14496, 310, 525, 19265, 4286, 13, 13, 4706, 1522, 16010, 393, 565, 278, 3203, 7426, 1840, 756, 278, 7426, 3109, 13, 4706, 1135, 525, 19265, 29915, 769, 278, 1121, 338, 451, 10860, 1711, 263, 13, 4706, 10159, 29889, 29871, 7753, 297, 1316, 263, 1206, 29892, 278, 1158, 947, 451, 12020, 385, 13, 4706, 3682, 29889, 13, 13, 4706, 285, 29889, 3204, 10889, 29918, 12163, 929, 29898, 19265, 29897, 338, 7126, 304, 13, 4706, 285, 29889, 14340, 29882, 2027, 29918, 12163, 929, 6278, 19265, 467, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 29890, 2129, 29918, 1958, 29898, 2892, 921, 29901, 921, 448, 20343, 29897, 13, 13, 1678, 822, 4958, 29918, 1958, 29898, 1311, 29892, 3653, 1125, 13, 4706, 9995, 13, 4706, 6204, 263, 716, 11595, 2533, 5639, 491, 15399, 3653, 304, 1269, 13, 4706, 1840, 29889, 29871, 3653, 1818, 367, 263, 740, 5622, 29871, 29906, 6273, 29889, 13, 4706, 9995, 13, 4706, 4958, 353, 5159, 13, 4706, 363, 260, 297, 1583, 29901, 13, 9651, 289, 29892, 274, 353, 3653, 10456, 29873, 29897, 13, 9651, 565, 274, 29901, 13, 18884, 4958, 29889, 4397, 3552, 29890, 29892, 274, 876, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 29898, 357, 1516, 29897, 13, 13, 1678, 822, 3386, 29918, 2541, 29918, 4381, 29898, 1311, 29892, 4958, 1125, 13, 4706, 9995, 13, 4706, 6204, 263, 716, 443, 27432, 403, 10159, 310, 278, 1021, 770, 411, 13, 4706, 1583, 29892, 411, 2183, 871, 278, 4958, 322, 671, 3509, 310, 1583, 29915, 29879, 848, 565, 13, 4706, 5181, 29889, 13, 4706, 9995, 13, 4706, 736, 1583, 17255, 1990, 12035, 357, 1516, 29892, 3579, 1311, 3032, 2344, 29918, 11022, 6289, 29897, 13, 13, 13, 1990, 19219, 7713, 9222, 29898, 7713, 9222, 10448, 1125, 13, 1678, 9995, 13, 1678, 19219, 10159, 848, 1134, 5330, 8253, 263, 2286, 1024, 322, 278, 9228, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 16127, 29892, 3579, 11022, 6289, 1125, 13, 4706, 9995, 13, 4706, 19219, 7713, 9222, 29898, 1111, 8462, 29879, 29897, 13, 13, 4706, 16127, 508, 367, 738, 9657, 2847, 1819, 29889, 13, 4706, 9995, 13, 4706, 2043, 9222, 10448, 17255, 2344, 12035, 1311, 29892, 16127, 29892, 3579, 11022, 6289, 29897, 13, 4706, 1583, 3032, 1111, 8462, 29879, 353, 9657, 29898, 1111, 8462, 29879, 29897, 13, 4706, 1583, 3032, 2344, 29918, 11022, 6289, 353, 9049, 6289, 13, 13, 1678, 822, 4770, 1202, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 718, 916, 13, 4706, 9995, 13, 4706, 2533, 29918, 1111, 12352, 353, 9657, 29898, 1524, 29898, 1311, 876, 13, 4706, 363, 1840, 29892, 1302, 12352, 297, 916, 29901, 13, 9651, 565, 1840, 297, 2533, 29918, 1111, 12352, 29901, 13, 18884, 2533, 29918, 1111, 12352, 29961, 8489, 29962, 4619, 1302, 12352, 13, 9651, 1683, 29901, 13, 18884, 2533, 29918, 1111, 12352, 29961, 8489, 29962, 353, 1302, 12352, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 2533, 29918, 1111, 12352, 29889, 7076, 580, 565, 274, 2314, 13, 13, 1678, 822, 4770, 1491, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 448, 916, 13, 4706, 9995, 13, 4706, 958, 29918, 1111, 12352, 353, 9657, 29898, 1524, 29898, 1311, 876, 13, 4706, 363, 1840, 29892, 1302, 12352, 297, 916, 29901, 13, 9651, 565, 1840, 297, 958, 29918, 1111, 12352, 29901, 13, 18884, 958, 29918, 1111, 12352, 29961, 8489, 29962, 22361, 1302, 12352, 13, 9651, 1683, 29901, 13, 18884, 958, 29918, 1111, 12352, 29961, 8489, 29962, 353, 448, 1111, 12352, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 958, 29918, 1111, 12352, 29889, 7076, 580, 565, 274, 2314, 13, 13, 1678, 822, 4770, 16109, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 334, 916, 13, 13, 4706, 960, 1134, 310, 916, 338, 2043, 9222, 29892, 437, 21666, 297, 9228, 29889, 13, 4706, 13466, 29892, 437, 17336, 21666, 29889, 13, 4706, 9995, 13, 4706, 565, 338, 8758, 29898, 1228, 29892, 2043, 9222, 10448, 1125, 13, 9651, 736, 1583, 29889, 5393, 29918, 16109, 29898, 1228, 29897, 13, 4706, 1683, 29901, 13, 9651, 1018, 29901, 13, 18884, 736, 1583, 29889, 19529, 279, 29918, 16109, 29898, 1228, 29897, 13, 9651, 5174, 20948, 29901, 13, 18884, 736, 2216, 1888, 2037, 287, 13, 13, 1678, 822, 4770, 1758, 352, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 916, 334, 1583, 13, 13, 4706, 960, 1134, 310, 916, 947, 451, 2304, 21666, 411, 1583, 13, 4706, 515, 2175, 29892, 445, 1158, 338, 2000, 29889, 29871, 512, 278, 3030, 29892, 372, 338, 871, 13, 4706, 926, 29875, 1821, 393, 916, 367, 263, 17336, 29889, 13, 4706, 9995, 13, 4706, 1018, 29901, 13, 9651, 736, 1583, 29889, 19529, 279, 29918, 16109, 29898, 1228, 29897, 13, 4706, 5174, 20948, 29901, 13, 9651, 736, 2216, 1888, 2037, 287, 13, 13, 1678, 822, 4770, 10052, 12035, 1311, 1125, 13, 4706, 9995, 13, 4706, 448, 1311, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 29892, 448, 29883, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 2314, 13, 13, 1678, 822, 4770, 1066, 12035, 1311, 1125, 13, 4706, 9995, 13, 4706, 718, 1311, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 29898, 1311, 3032, 1111, 8462, 29879, 29897, 13, 13, 1678, 822, 6862, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 6862, 310, 1583, 29889, 13, 4706, 9995, 13, 4706, 396, 5225, 13, 4706, 565, 451, 1583, 29901, 13, 9651, 736, 1583, 13, 4706, 848, 29918, 2848, 353, 7431, 29898, 1311, 3032, 1111, 8462, 29879, 29897, 13, 4706, 396, 1601, 7615, 13, 4706, 565, 848, 29918, 2848, 1275, 29871, 29896, 29901, 13, 9651, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 29930, 29906, 29892, 274, 1068, 29906, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 2314, 13, 4706, 396, 9016, 7615, 13, 4706, 565, 848, 29918, 2848, 1275, 29871, 29906, 29901, 13, 9651, 313, 29881, 29896, 29892, 274, 29896, 511, 313, 29881, 29906, 29892, 274, 29906, 29897, 353, 1583, 29889, 357, 1516, 580, 13, 9651, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 3319, 29881, 29896, 29930, 29906, 29901, 29883, 29896, 1068, 29906, 29892, 270, 29896, 29974, 29881, 29906, 29901, 29883, 29896, 29930, 29883, 29906, 29930, 29906, 29892, 270, 29906, 29930, 29906, 29901, 29883, 29906, 1068, 29906, 1800, 13, 4706, 396, 2498, 313, 457, 4543, 29897, 13, 4706, 4452, 353, 1051, 29898, 1311, 3032, 1111, 8462, 29879, 29889, 7076, 3101, 13, 4706, 285, 303, 29892, 269, 299, 353, 24335, 6571, 13, 4706, 565, 848, 29918, 2848, 669, 29871, 29896, 29901, 13, 9651, 289, 29892, 274, 353, 4452, 29889, 7323, 580, 13, 9651, 285, 303, 29961, 29890, 29962, 353, 274, 13, 4706, 1550, 4452, 29901, 13, 9651, 289, 29892, 274, 353, 4452, 29889, 7323, 580, 13, 9651, 285, 303, 29961, 29890, 29962, 353, 274, 13, 9651, 289, 29892, 274, 353, 4452, 29889, 7323, 580, 13, 9651, 269, 299, 29961, 29890, 29962, 353, 274, 13, 4706, 285, 303, 353, 1583, 17255, 1990, 12035, 29888, 303, 29892, 3579, 1311, 3032, 2344, 29918, 11022, 6289, 29897, 13, 4706, 269, 299, 353, 1583, 17255, 1990, 12035, 29879, 299, 29892, 3579, 1311, 3032, 2344, 29918, 11022, 6289, 29897, 13, 4706, 7145, 353, 285, 303, 29889, 5393, 29918, 16109, 29898, 29879, 299, 29889, 19529, 279, 29918, 16109, 29898, 29906, 876, 13, 4706, 736, 285, 303, 29889, 17619, 580, 718, 7145, 718, 269, 299, 29889, 17619, 580, 13, 13, 1678, 822, 4770, 12248, 12035, 1311, 29892, 2380, 1125, 13, 4706, 9995, 13, 4706, 1583, 3579, 2380, 13, 4706, 9995, 13, 4706, 396, 4266, 16285, 13, 4706, 565, 2380, 529, 29871, 29900, 29901, 13, 9651, 12020, 7865, 2392, 703, 22198, 2380, 338, 451, 6068, 23157, 13, 4706, 25342, 2380, 1275, 29871, 29900, 29901, 13, 9651, 363, 274, 297, 1583, 29889, 1524, 1111, 8462, 29879, 7295, 13, 18884, 565, 274, 29901, 13, 462, 1678, 697, 353, 903, 5393, 29889, 657, 29934, 292, 29898, 29883, 467, 650, 13, 462, 1678, 2867, 13, 9651, 1683, 29901, 13, 18884, 697, 353, 29871, 29896, 13, 9651, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 3319, 29900, 29901, 697, 1800, 13, 4706, 25342, 2380, 1275, 29871, 29896, 29901, 13, 9651, 736, 1583, 13, 4706, 25342, 2380, 1275, 29871, 29906, 29901, 13, 9651, 736, 1583, 29889, 17619, 580, 13, 4706, 396, 4266, 24655, 13, 4706, 565, 451, 1583, 29901, 13, 9651, 736, 1583, 13, 4706, 25342, 7431, 29898, 1311, 3032, 1111, 8462, 29879, 29897, 1275, 29871, 29896, 29901, 13, 9651, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 29930, 2248, 29892, 274, 1068, 2248, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 2314, 13, 4706, 396, 2498, 13, 4706, 3081, 29918, 4704, 353, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 3319, 29900, 29901, 29871, 29896, 1800, 13, 4706, 3081, 29918, 974, 29918, 29906, 353, 1583, 13, 4706, 1550, 2380, 29901, 13, 9651, 565, 2380, 669, 29871, 29896, 29901, 13, 18884, 3081, 29918, 4704, 334, 29922, 3081, 29918, 974, 29918, 29906, 13, 9651, 2380, 849, 29922, 29871, 29906, 13, 9651, 565, 2380, 29901, 13, 18884, 3081, 29918, 974, 29918, 29906, 353, 3081, 29918, 974, 29918, 29906, 29889, 17619, 580, 13, 4706, 736, 3081, 29918, 4704, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 659, 1125, 13, 4706, 9995, 13, 4706, 23697, 13, 4706, 9995, 13, 4706, 4452, 353, 1051, 29898, 1311, 3032, 1111, 8462, 29879, 29889, 7076, 3101, 13, 4706, 565, 451, 4452, 29901, 13, 9651, 736, 29871, 29900, 29930, 791, 13, 4706, 270, 29892, 274, 353, 4452, 29889, 7323, 580, 13, 4706, 1121, 353, 274, 334, 659, 1068, 29881, 13, 4706, 363, 270, 29892, 274, 297, 4452, 29901, 13, 9651, 1121, 4619, 274, 334, 659, 1068, 29881, 13, 4706, 736, 1121, 13, 13, 1678, 822, 4256, 357, 1516, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 20380, 363, 313, 12163, 929, 29892, 10825, 29897, 11000, 29889, 13, 4706, 450, 20380, 338, 7126, 304, 13, 3986, 14319, 29898, 1311, 29889, 1524, 29890, 2129, 3285, 1583, 29889, 1524, 1111, 8462, 29879, 3101, 13, 4706, 9995, 13, 4706, 736, 4256, 29898, 1311, 3032, 1111, 8462, 29879, 29889, 7076, 3101, 13, 13, 1678, 822, 4256, 1111, 8462, 29879, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 20380, 363, 16127, 29889, 13, 4706, 9995, 13, 4706, 736, 4256, 29898, 1311, 3032, 1111, 8462, 29879, 29889, 5975, 3101, 13, 13, 1678, 822, 4256, 29890, 2129, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 20380, 363, 14496, 29889, 13, 4706, 9995, 13, 4706, 736, 4256, 29898, 1311, 3032, 1111, 8462, 29879, 29889, 8149, 3101, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 7426, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 10825, 310, 6790, 7426, 29889, 13, 4706, 960, 727, 338, 694, 1840, 310, 7426, 29892, 736, 29871, 29900, 29889, 13, 4706, 9995, 13, 4706, 736, 1583, 3032, 1111, 8462, 29879, 29889, 657, 29898, 12163, 929, 29892, 29871, 29900, 29897, 13, 13, 1678, 822, 4770, 11516, 12035, 1311, 29892, 7426, 1125, 13, 4706, 9995, 13, 4706, 7106, 5852, 565, 727, 338, 263, 1840, 310, 6790, 7426, 29889, 13, 4706, 7700, 6467, 29889, 13, 4706, 9995, 13, 4706, 736, 7426, 297, 1583, 3032, 1111, 8462, 29879, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 1353, 310, 848, 9976, 29889, 13, 4706, 9995, 13, 4706, 736, 7431, 29898, 1311, 3032, 1111, 8462, 29879, 29897, 13, 13, 1678, 822, 4770, 1837, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 1275, 916, 13, 4706, 9995, 13, 4706, 565, 1583, 338, 916, 29901, 13, 9651, 736, 5852, 13, 4706, 736, 2043, 9222, 10448, 17255, 1837, 12035, 1311, 29892, 916, 29897, 13, 13, 1678, 822, 4770, 8568, 12035, 1311, 1125, 13, 4706, 736, 2043, 9222, 10448, 17255, 8568, 12035, 1311, 29897, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 396, 363, 4744, 13, 4706, 736, 11860, 29879, 29414, 29879, 5513, 1273, 313, 1311, 17255, 1990, 1649, 17255, 978, 1649, 29892, 2062, 29898, 1311, 3032, 1111, 8462, 29879, 876, 13, 13, 13, 1990, 317, 18054, 7713, 9222, 313, 7713, 9222, 10448, 1125, 13, 1678, 9995, 13, 1678, 317, 18054, 7713, 9222, 14422, 4958, 310, 263, 10159, 297, 12705, 8214, 29889, 13, 1678, 2178, 3519, 322, 6931, 3013, 372, 12705, 29889, 13, 1678, 9995, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 16127, 29892, 903, 24582, 29922, 8824, 29892, 3579, 11022, 6289, 1125, 13, 4706, 9995, 13, 4706, 317, 18054, 7713, 9222, 29898, 1111, 8462, 29879, 29897, 13, 13, 4706, 525, 1111, 8462, 29879, 29915, 508, 367, 738, 9657, 2847, 1819, 29889, 13, 4706, 10831, 635, 22868, 24582, 29915, 508, 367, 5852, 565, 278, 16127, 338, 13, 4706, 2307, 12705, 29889, 13, 4706, 9995, 13, 4706, 2043, 9222, 10448, 17255, 2344, 12035, 1311, 29892, 16127, 29892, 3579, 11022, 6289, 29897, 13, 4706, 1583, 29889, 24582, 353, 5159, 13, 4706, 565, 451, 903, 24582, 470, 338, 8758, 29898, 1111, 8462, 29879, 29892, 9657, 1125, 13, 9651, 363, 260, 297, 9657, 29898, 1111, 8462, 29879, 467, 7076, 7295, 13, 18884, 1583, 3032, 1144, 441, 29898, 29873, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29889, 24582, 353, 1051, 29898, 1111, 8462, 29879, 29897, 13, 4706, 1583, 3032, 2344, 29918, 11022, 6289, 353, 9049, 6289, 13, 4706, 1583, 3032, 2344, 29918, 11022, 6289, 1839, 29918, 24582, 2033, 353, 5852, 13, 13, 1678, 822, 903, 1144, 441, 29898, 1311, 29892, 1840, 1125, 13, 4706, 9995, 13, 4706, 24505, 278, 1840, 964, 1583, 29889, 344, 18054, 1051, 29892, 322, 3013, 372, 12705, 29889, 13, 13, 4706, 448, 910, 1158, 338, 17912, 573, 29889, 13, 4706, 448, 910, 1158, 338, 451, 297, 263, 760, 310, 278, 3450, 29889, 13, 4706, 9995, 13, 4706, 1583, 29889, 24582, 29889, 7851, 29898, 1311, 3032, 18809, 522, 29898, 8489, 29961, 29900, 11724, 1840, 29897, 13, 13, 1678, 822, 903, 18809, 522, 29898, 1311, 29892, 7426, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 2380, 988, 304, 4635, 1840, 310, 7426, 29889, 13, 13, 4706, 448, 910, 1158, 338, 451, 297, 263, 760, 310, 278, 3450, 29889, 13, 4706, 448, 450, 775, 338, 925, 7744, 292, 2652, 522, 29889, 18809, 522, 29918, 1266, 304, 278, 13, 3986, 3030, 29889, 13, 4706, 9995, 13, 4706, 658, 29892, 7251, 353, 29871, 29900, 29892, 7431, 29898, 1311, 29889, 24582, 29897, 13, 4706, 1550, 658, 529, 7251, 29901, 13, 9651, 7145, 353, 313, 417, 718, 7251, 29897, 5099, 29871, 29896, 13, 9651, 565, 7426, 529, 1583, 29889, 24582, 29961, 6563, 3816, 29900, 5387, 13, 18884, 7251, 353, 7145, 13, 9651, 1683, 29901, 13, 18884, 658, 353, 7145, 718, 29871, 29896, 13, 4706, 736, 658, 13, 13, 1678, 822, 4770, 1066, 12035, 1311, 1125, 13, 4706, 9995, 13, 4706, 718, 1311, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 29898, 1311, 29889, 24582, 29897, 13, 13, 1678, 822, 4770, 10052, 12035, 1311, 1125, 13, 4706, 9995, 13, 4706, 448, 1311, 13, 4706, 9995, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 29892, 448, 29883, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 2314, 13, 13, 1678, 822, 4770, 1202, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 718, 916, 13, 4706, 9995, 13, 4706, 565, 1583, 29889, 24582, 29901, 13, 9651, 4256, 29918, 1311, 353, 4256, 29898, 1311, 29889, 24582, 29897, 13, 9651, 1583, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1311, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29918, 8489, 353, 6213, 13, 4706, 565, 916, 29889, 24582, 29901, 13, 9651, 4256, 29918, 1228, 353, 4256, 29898, 1228, 29889, 24582, 29897, 13, 9651, 916, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1228, 29897, 13, 4706, 1683, 29901, 13, 9651, 916, 29918, 8489, 353, 6213, 13, 4706, 12705, 353, 5159, 13, 4706, 1550, 1583, 29918, 8489, 322, 916, 29918, 8489, 29901, 13, 9651, 9401, 353, 274, 1526, 29898, 1311, 29918, 8489, 29961, 29900, 1402, 916, 29918, 8489, 29961, 29900, 2314, 13, 9651, 565, 9401, 529, 29871, 29900, 29901, 13, 18884, 12705, 29889, 4397, 29898, 1311, 29918, 8489, 29897, 13, 18884, 1018, 29901, 13, 462, 1678, 1583, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1311, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 1583, 29918, 8489, 353, 6213, 13, 462, 1678, 2867, 13, 9651, 25342, 9401, 1275, 29871, 29900, 29901, 13, 18884, 274, 353, 1583, 29918, 8489, 29961, 29896, 29962, 718, 916, 29918, 8489, 29961, 29896, 29962, 13, 18884, 565, 274, 29901, 13, 462, 1678, 12705, 29889, 4397, 3552, 1311, 29918, 8489, 29961, 29900, 1402, 274, 876, 13, 18884, 1018, 29901, 13, 462, 1678, 1583, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1311, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 1583, 29918, 8489, 353, 6213, 13, 18884, 1018, 29901, 13, 462, 1678, 916, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1228, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 916, 29918, 8489, 353, 6213, 13, 18884, 565, 1583, 29918, 8489, 338, 6213, 470, 916, 29918, 8489, 338, 6213, 29901, 13, 462, 1678, 2867, 13, 9651, 1683, 29901, 13, 18884, 12705, 29889, 4397, 29898, 1228, 29918, 8489, 29897, 13, 18884, 1018, 29901, 13, 462, 1678, 916, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1228, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 916, 29918, 8489, 353, 6213, 13, 462, 1678, 2867, 13, 4706, 565, 916, 29918, 8489, 338, 6213, 322, 1583, 29918, 8489, 29901, 13, 9651, 12705, 29889, 4397, 29898, 1311, 29918, 8489, 29897, 13, 9651, 363, 1840, 297, 4256, 29918, 1311, 29901, 13, 18884, 12705, 29889, 4397, 29898, 8489, 29897, 13, 4706, 25342, 1583, 29918, 8489, 338, 6213, 322, 916, 29918, 8489, 29901, 13, 9651, 12705, 29889, 4397, 29898, 1228, 29918, 8489, 29897, 13, 9651, 363, 1840, 297, 4256, 29918, 1228, 29901, 13, 18884, 12705, 29889, 4397, 29898, 8489, 29897, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 29898, 24582, 29897, 13, 13, 1678, 822, 4770, 1491, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 448, 916, 13, 13, 4706, 739, 338, 1554, 763, 10366, 2656, 29889, 13, 4706, 9995, 13, 4706, 565, 1583, 29889, 24582, 29901, 13, 9651, 4256, 29918, 1311, 353, 4256, 29898, 1311, 29889, 24582, 29897, 13, 9651, 1583, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1311, 29897, 13, 4706, 1683, 29901, 13, 9651, 1583, 29918, 8489, 353, 6213, 13, 4706, 565, 916, 29889, 24582, 29901, 13, 9651, 4256, 29918, 1228, 353, 4256, 29898, 1228, 29889, 24582, 29897, 13, 9651, 916, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1228, 29897, 13, 4706, 1683, 29901, 13, 9651, 916, 29918, 8489, 353, 6213, 13, 4706, 12705, 353, 5159, 13, 4706, 1550, 1583, 29918, 8489, 322, 916, 29918, 8489, 29901, 13, 9651, 9401, 353, 274, 1526, 29898, 1311, 29918, 8489, 29961, 29900, 1402, 916, 29918, 8489, 29961, 29900, 2314, 13, 9651, 565, 9401, 529, 29871, 29900, 29901, 13, 18884, 12705, 29889, 4397, 29898, 1311, 29918, 8489, 29897, 13, 18884, 1018, 29901, 13, 462, 1678, 1583, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1311, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 1583, 29918, 8489, 353, 6213, 13, 462, 1678, 2867, 13, 9651, 25342, 9401, 1275, 29871, 29900, 29901, 13, 18884, 274, 353, 1583, 29918, 8489, 29961, 29896, 29962, 448, 916, 29918, 8489, 29961, 29896, 29962, 13, 18884, 565, 274, 29901, 13, 462, 1678, 12705, 29889, 4397, 3552, 1311, 29918, 8489, 29961, 29900, 1402, 274, 876, 13, 18884, 1018, 29901, 13, 462, 1678, 1583, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1311, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 1583, 29918, 8489, 353, 6213, 13, 18884, 1018, 29901, 13, 462, 1678, 916, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1228, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 916, 29918, 8489, 353, 6213, 13, 18884, 565, 1583, 29918, 8489, 338, 6213, 470, 916, 29918, 8489, 338, 6213, 29901, 13, 462, 1678, 2867, 13, 9651, 1683, 29901, 13, 18884, 12705, 29889, 4397, 3552, 1228, 29918, 8489, 29961, 29900, 1402, 448, 1228, 29918, 8489, 29961, 29896, 12622, 13, 18884, 1018, 29901, 13, 462, 1678, 916, 29918, 8489, 353, 2446, 29898, 1524, 29918, 1228, 29897, 13, 18884, 5174, 22303, 13463, 362, 29901, 13, 462, 1678, 916, 29918, 8489, 353, 6213, 13, 462, 1678, 2867, 13, 4706, 565, 916, 29918, 8489, 338, 6213, 322, 1583, 29918, 8489, 29901, 13, 9651, 12705, 29889, 4397, 29898, 1311, 29918, 8489, 29897, 13, 9651, 363, 1840, 297, 4256, 29918, 1311, 29901, 13, 18884, 12705, 29889, 4397, 29898, 8489, 29897, 13, 4706, 25342, 1583, 29918, 8489, 338, 6213, 322, 916, 29918, 8489, 29901, 13, 9651, 12705, 29889, 4397, 3552, 1228, 29918, 8489, 29961, 29900, 1402, 448, 1228, 29918, 8489, 29961, 29896, 12622, 13, 9651, 363, 1840, 297, 4256, 29918, 1228, 29901, 13, 18884, 12705, 29889, 4397, 3552, 8489, 29961, 29900, 1402, 448, 8489, 29961, 29896, 12622, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 29898, 24582, 29897, 13, 13, 1678, 822, 4770, 16109, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 334, 916, 13, 13, 4706, 960, 1134, 310, 916, 338, 317, 18054, 7713, 9222, 29892, 437, 21666, 13, 4706, 297, 9228, 29889, 29871, 13466, 29892, 437, 17336, 21666, 29889, 13, 4706, 9995, 13, 4706, 565, 338, 8758, 29898, 1228, 29892, 2043, 9222, 10448, 1125, 13, 9651, 736, 1583, 29889, 5393, 29918, 16109, 29898, 1228, 29897, 13, 4706, 1683, 29901, 13, 9651, 1018, 29901, 13, 18884, 736, 1583, 29889, 19529, 279, 29918, 16109, 29898, 1228, 29897, 13, 9651, 5174, 20948, 29901, 13, 18884, 736, 2216, 1888, 2037, 287, 13, 13, 1678, 822, 4770, 1758, 352, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 916, 334, 1583, 13, 13, 4706, 960, 1134, 310, 916, 947, 451, 2304, 21666, 411, 1583, 13, 4706, 515, 2175, 29892, 445, 1158, 338, 2000, 29889, 29871, 512, 278, 3030, 29892, 372, 338, 871, 13, 4706, 926, 29875, 1821, 393, 916, 367, 263, 17336, 29889, 13, 4706, 9995, 13, 4706, 1018, 29901, 13, 9651, 736, 1583, 29889, 19529, 279, 29918, 16109, 29898, 1228, 29897, 13, 4706, 5174, 20948, 29901, 13, 9651, 736, 2216, 1888, 2037, 287, 13, 13, 1678, 822, 9228, 29918, 16109, 29918, 5689, 1446, 11495, 29898, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 9683, 666, 1414, 310, 1023, 24655, 297, 278, 1021, 9228, 29889, 13, 13, 4706, 11796, 362, 338, 8988, 714, 491, 3467, 1446, 11495, 1158, 29889, 13, 4706, 9995, 13, 4706, 10159, 353, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 13, 4706, 396, 5225, 13, 4706, 565, 451, 1583, 470, 451, 916, 29901, 13, 9651, 736, 10159, 29898, 3101, 13, 4706, 396, 1601, 7615, 13, 4706, 565, 7431, 29898, 1311, 29889, 24582, 29897, 1275, 29871, 29896, 29901, 13, 9651, 736, 916, 29889, 8489, 29918, 16109, 29898, 1311, 29897, 13, 4706, 565, 7431, 29898, 1228, 29889, 24582, 29897, 1275, 29871, 29896, 29901, 13, 9651, 736, 1583, 29889, 8489, 29918, 16109, 29898, 1228, 29897, 13, 4706, 396, 9016, 7615, 13, 4706, 565, 7431, 29898, 1311, 29889, 24582, 29897, 1275, 29871, 29906, 29901, 13, 9651, 282, 29892, 3855, 353, 518, 1228, 29889, 8489, 29918, 16109, 29898, 8489, 29897, 363, 1840, 297, 1583, 29962, 13, 9651, 736, 282, 718, 3855, 13, 4706, 565, 7431, 29898, 1228, 29889, 24582, 29897, 1275, 29871, 29906, 29901, 13, 9651, 282, 29892, 3855, 353, 518, 1311, 29889, 8489, 29918, 16109, 29898, 8489, 29897, 363, 1840, 297, 916, 29962, 13, 9651, 736, 282, 718, 3855, 13, 4706, 396, 7755, 1583, 338, 4628, 322, 916, 338, 2654, 29889, 13, 4706, 4628, 29918, 1563, 29918, 12163, 929, 29892, 4628, 29918, 1266, 29918, 12163, 929, 353, 1583, 29889, 24582, 29961, 29900, 3816, 29900, 1402, 1583, 29889, 24582, 14352, 29896, 3816, 29900, 29962, 13, 4706, 2654, 29918, 1563, 29918, 12163, 929, 29892, 2654, 29918, 1266, 29918, 12163, 929, 353, 916, 29889, 24582, 29961, 29900, 3816, 29900, 1402, 916, 29889, 24582, 14352, 29896, 3816, 29900, 29962, 13, 4706, 2175, 29918, 12163, 929, 353, 1375, 29898, 8517, 29918, 1563, 29918, 12163, 929, 29892, 2654, 29918, 1563, 29918, 12163, 929, 29897, 13, 4706, 1492, 29918, 12163, 929, 353, 4236, 29898, 8517, 29918, 1266, 29918, 12163, 929, 29892, 2654, 29918, 1266, 29918, 12163, 929, 29897, 13, 4706, 396, 591, 4974, 1244, 393, 1797, 338, 310, 12066, 2548, 29889, 313, 275, 372, 1959, 7897, 13, 4706, 4974, 2175, 29918, 12163, 929, 529, 1492, 29918, 12163, 929, 13, 4706, 4203, 29918, 12163, 929, 353, 313, 1563, 29918, 12163, 929, 718, 1492, 29918, 12163, 929, 29897, 5099, 29871, 29896, 13, 4706, 4628, 29918, 24498, 29918, 2248, 353, 1583, 3032, 18809, 522, 29898, 24498, 29918, 12163, 929, 29897, 13, 4706, 2654, 29918, 24498, 29918, 2248, 353, 916, 3032, 18809, 522, 29898, 24498, 29918, 12163, 929, 29897, 13, 4706, 565, 451, 4628, 29918, 24498, 29918, 2248, 29901, 13, 9651, 736, 313, 1311, 29889, 3204, 10889, 29918, 12163, 929, 29898, 8517, 29918, 1563, 29918, 12163, 929, 467, 5393, 29918, 16109, 29918, 5689, 1446, 11495, 29898, 1228, 8106, 14340, 29882, 2027, 29918, 12163, 929, 29898, 8517, 29918, 1563, 29918, 12163, 929, 29897, 13, 4706, 565, 451, 2654, 29918, 24498, 29918, 2248, 29901, 13, 9651, 736, 313, 1311, 29889, 5393, 29918, 16109, 29918, 5689, 1446, 11495, 29898, 1228, 29889, 3204, 10889, 29918, 12163, 929, 29898, 1127, 29918, 1563, 29918, 12163, 929, 876, 467, 14340, 29882, 2027, 29918, 12163, 929, 29898, 1127, 29918, 1563, 29918, 12163, 929, 29897, 13, 4706, 4402, 353, 10159, 4197, 29898, 29881, 448, 2175, 29918, 12163, 929, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 29889, 24582, 7503, 8517, 29918, 24498, 29918, 2248, 24960, 13, 4706, 805, 1943, 353, 10159, 4197, 29898, 29881, 448, 4203, 29918, 12163, 929, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 29889, 24582, 29961, 8517, 29918, 24498, 29918, 2248, 17531, 2314, 13, 4706, 9766, 353, 10159, 4197, 29898, 29881, 448, 2175, 29918, 12163, 929, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 916, 29889, 24582, 7503, 1127, 29918, 24498, 29918, 2248, 24960, 13, 4706, 5192, 353, 10159, 4197, 29898, 29881, 448, 4203, 29918, 12163, 929, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 916, 29889, 24582, 29961, 1127, 29918, 24498, 29918, 2248, 17531, 2314, 13, 4706, 591, 5790, 353, 4402, 29889, 5393, 29918, 16109, 29918, 5689, 1446, 11495, 29898, 15321, 29897, 13, 4706, 23505, 353, 805, 1943, 29889, 5393, 29918, 16109, 29918, 5689, 1446, 11495, 29898, 23057, 29897, 13, 4706, 10856, 1446, 11495, 353, 313, 29066, 718, 805, 1943, 467, 5393, 29918, 16109, 29918, 5689, 1446, 11495, 29898, 15321, 718, 5192, 29897, 448, 591, 5790, 448, 23505, 13, 4706, 565, 2175, 29918, 12163, 929, 29901, 13, 9651, 736, 313, 705, 5790, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 1563, 29918, 12163, 929, 334, 29871, 29906, 29897, 718, 13, 462, 1678, 10856, 1446, 11495, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 1563, 29918, 12163, 929, 718, 4203, 29918, 12163, 929, 29897, 718, 13, 462, 1678, 23505, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 24498, 29918, 12163, 929, 334, 29871, 29906, 876, 13, 4706, 1683, 29901, 13, 9651, 736, 313, 705, 5790, 718, 13, 462, 1678, 10856, 1446, 11495, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 24498, 29918, 12163, 929, 29897, 718, 13, 462, 1678, 23505, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 24498, 29918, 12163, 929, 334, 29871, 29906, 876, 13, 13, 1678, 822, 17336, 29918, 16109, 29898, 1311, 29892, 6287, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 1121, 310, 17336, 21666, 29889, 13, 4706, 9995, 13, 4706, 3013, 29918, 5393, 353, 5852, 13, 4706, 565, 376, 1111, 12352, 5393, 29908, 297, 1583, 3032, 2344, 29918, 11022, 6289, 29901, 13, 9651, 716, 29918, 1111, 12352, 353, 5159, 13, 9651, 1302, 12352, 5393, 353, 1583, 3032, 2344, 29918, 11022, 6289, 3366, 1111, 12352, 5393, 3108, 13, 9651, 363, 270, 29892, 274, 297, 1583, 29901, 13, 18884, 565, 274, 29901, 13, 462, 1678, 6287, 29881, 353, 274, 334, 6287, 13, 462, 1678, 565, 3013, 29918, 5393, 322, 6287, 29881, 451, 297, 1302, 12352, 5393, 29901, 13, 462, 4706, 1302, 12352, 5393, 353, 1302, 12352, 5393, 29889, 657, 18877, 19111, 5393, 7373, 5393, 29889, 657, 29934, 292, 29898, 7052, 29881, 876, 13, 462, 1678, 716, 29918, 1111, 12352, 29889, 4397, 3552, 29881, 29892, 6287, 29881, 876, 13, 9651, 1583, 3032, 2344, 29918, 11022, 6289, 3366, 1111, 12352, 5393, 3108, 353, 1302, 12352, 5393, 13, 4706, 1683, 29901, 13, 9651, 716, 29918, 1111, 12352, 353, 17288, 29881, 29892, 274, 334, 6287, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 565, 274, 29962, 13, 4706, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 29898, 1482, 29918, 1111, 12352, 29897, 13, 13, 1678, 822, 6862, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 6862, 310, 1583, 29889, 13, 4706, 9995, 13, 4706, 396, 5225, 13, 4706, 565, 451, 1583, 29901, 13, 9651, 736, 1583, 13, 13, 4706, 10159, 353, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 13, 4706, 848, 29918, 2848, 353, 7431, 29898, 1311, 29889, 24582, 29897, 13, 4706, 396, 1601, 7615, 13, 4706, 565, 848, 29918, 2848, 1275, 29871, 29896, 29901, 13, 9651, 270, 29892, 274, 353, 1583, 29889, 24582, 29961, 29900, 29962, 13, 9651, 565, 270, 29901, 13, 18884, 736, 10159, 4197, 29898, 29881, 29930, 29906, 29892, 274, 1068, 29906, 29897, 2314, 13, 9651, 1683, 29901, 13, 18884, 736, 10159, 4197, 29898, 29900, 29892, 274, 1068, 29906, 29897, 2314, 13, 4706, 396, 9016, 7615, 13, 4706, 565, 848, 29918, 2848, 1275, 29871, 29906, 29901, 13, 9651, 313, 29881, 29896, 29892, 274, 29896, 511, 313, 29881, 29906, 29892, 274, 29906, 29897, 353, 17288, 29881, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 29962, 13, 9651, 736, 10159, 3319, 29881, 29896, 29930, 29906, 29901, 29883, 29896, 1068, 29906, 29892, 270, 29896, 29974, 29881, 29906, 29901, 29883, 29896, 29930, 29883, 29906, 29930, 29906, 29892, 270, 29906, 29930, 29906, 29901, 29883, 29906, 1068, 29906, 1800, 13, 4706, 396, 2498, 313, 24115, 1446, 11495, 29897, 13, 4706, 1492, 29918, 12163, 929, 353, 1583, 29889, 24582, 14352, 29896, 3816, 29900, 29962, 13, 4706, 2175, 29918, 12163, 929, 353, 1583, 29889, 24582, 29961, 29900, 3816, 29900, 29962, 13, 4706, 4203, 29918, 12163, 929, 353, 313, 1266, 29918, 12163, 929, 718, 2175, 29918, 12163, 929, 29897, 5099, 29871, 29896, 13, 4706, 4203, 29918, 2248, 353, 1583, 3032, 18809, 522, 29898, 24498, 29918, 12163, 929, 29897, 13, 4706, 285, 303, 353, 10159, 4197, 29898, 29881, 448, 2175, 29918, 12163, 929, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 29889, 24582, 7503, 24498, 29918, 2248, 24960, 13, 4706, 269, 299, 353, 10159, 4197, 29898, 29881, 448, 4203, 29918, 12163, 929, 29892, 274, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 29889, 24582, 29961, 24498, 29918, 2248, 17531, 2314, 13, 4706, 285, 303, 29918, 26613, 1965, 353, 285, 303, 29889, 17619, 580, 13, 4706, 269, 299, 29918, 26613, 1965, 353, 269, 299, 29889, 17619, 580, 13, 4706, 10856, 1446, 11495, 353, 313, 29888, 303, 718, 269, 299, 467, 17619, 580, 448, 285, 303, 29918, 26613, 1965, 448, 269, 299, 29918, 26613, 1965, 13, 4706, 565, 2175, 29918, 12163, 929, 29901, 13, 9651, 736, 313, 29888, 303, 29918, 26613, 1965, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 1563, 29918, 12163, 929, 334, 29871, 29906, 29897, 718, 13, 462, 1678, 10856, 1446, 11495, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 1563, 29918, 12163, 929, 718, 4203, 29918, 12163, 929, 29897, 718, 13, 462, 1678, 269, 299, 29918, 26613, 1965, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 24498, 29918, 12163, 929, 334, 29871, 29906, 876, 13, 4706, 1683, 29901, 13, 9651, 736, 313, 29888, 303, 29918, 26613, 1965, 718, 13, 462, 1678, 10856, 1446, 11495, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 24498, 29918, 12163, 929, 29897, 718, 13, 462, 1678, 269, 299, 29918, 26613, 1965, 29889, 14340, 29882, 2027, 29918, 12163, 929, 29898, 24498, 29918, 12163, 929, 334, 29871, 29906, 876, 13, 13, 1678, 822, 4770, 12248, 12035, 1311, 29892, 2380, 1125, 13, 4706, 9995, 13, 4706, 1583, 3579, 2380, 13, 13, 4706, 1939, 260, 824, 653, 3081, 292, 338, 3342, 1244, 29892, 1363, 727, 338, 694, 13, 4706, 878, 14999, 5455, 3342, 29889, 13, 4706, 9995, 13, 4706, 396, 4266, 16285, 13, 4706, 565, 2380, 529, 29871, 29900, 29901, 13, 9651, 12020, 7865, 2392, 703, 22198, 2380, 338, 451, 6068, 23157, 13, 4706, 25342, 2380, 1275, 29871, 29900, 29901, 13, 9651, 363, 274, 297, 1583, 29889, 1524, 1111, 8462, 29879, 7295, 13, 18884, 565, 274, 29901, 13, 462, 1678, 697, 353, 903, 5393, 29889, 657, 29934, 292, 29898, 29883, 467, 650, 13, 462, 1678, 2867, 13, 9651, 1683, 29901, 13, 18884, 697, 353, 29871, 29896, 13, 9651, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29900, 29892, 697, 29897, 2314, 13, 4706, 25342, 2380, 1275, 29871, 29896, 29901, 13, 9651, 736, 1583, 13, 4706, 25342, 2380, 1275, 29871, 29906, 29901, 13, 9651, 736, 1583, 29889, 17619, 580, 13, 4706, 396, 4266, 24655, 13, 4706, 565, 451, 1583, 29901, 13, 9651, 736, 1583, 13, 4706, 25342, 7431, 29898, 1311, 29889, 24582, 29897, 1275, 29871, 29896, 29901, 13, 9651, 736, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29881, 29930, 2248, 29892, 274, 1068, 2248, 29897, 363, 313, 29881, 29892, 274, 29897, 297, 1583, 2314, 13, 4706, 396, 2498, 13, 4706, 3081, 29918, 4704, 353, 1583, 29889, 11433, 29918, 2541, 29918, 4381, 4197, 29898, 29900, 29892, 29871, 29896, 29897, 2314, 13, 4706, 3081, 29918, 974, 29918, 29906, 353, 1583, 13, 4706, 1550, 2380, 29901, 13, 9651, 565, 2380, 669, 29871, 29896, 29901, 13, 18884, 3081, 29918, 4704, 334, 29922, 3081, 29918, 974, 29918, 29906, 13, 9651, 2380, 849, 29922, 29871, 29906, 13, 9651, 565, 2380, 29901, 13, 18884, 3081, 29918, 974, 29918, 29906, 353, 3081, 29918, 974, 29918, 29906, 29889, 17619, 580, 13, 4706, 736, 3081, 29918, 4704, 13, 13, 1678, 822, 7426, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 7426, 310, 1583, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 24582, 1275, 12705, 29898, 1311, 29889, 24582, 29897, 13, 4706, 363, 270, 29892, 274, 297, 1583, 29889, 24582, 29961, 1057, 29899, 29896, 5387, 13, 9651, 565, 274, 29901, 13, 18884, 736, 270, 13, 4706, 736, 448, 29896, 13, 13, 1678, 822, 8236, 29918, 1111, 8462, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 8236, 10825, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 24582, 1275, 12705, 29898, 1311, 29889, 24582, 29897, 13, 4706, 363, 270, 29892, 274, 297, 1583, 29889, 24582, 29961, 1057, 29899, 29896, 5387, 13, 9651, 565, 274, 29901, 13, 18884, 736, 274, 13, 4706, 736, 29871, 29900, 13, 13, 1678, 822, 8236, 29918, 8489, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 8236, 1840, 408, 263, 18761, 313, 12163, 929, 29892, 10825, 467, 13, 4706, 9995, 13, 4706, 4974, 1583, 29889, 24582, 1275, 12705, 29898, 1311, 29889, 24582, 29897, 13, 4706, 363, 270, 29892, 274, 297, 1583, 29889, 24582, 29961, 1057, 29899, 29896, 5387, 13, 9651, 565, 274, 29901, 13, 18884, 736, 313, 29881, 29892, 274, 29897, 13, 4706, 736, 8521, 29896, 29892, 29871, 29900, 29897, 13, 13, 1678, 822, 4256, 357, 1516, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 20380, 363, 313, 3188, 29892, 10825, 29897, 11000, 29889, 13, 4706, 450, 20380, 338, 7126, 304, 13, 3986, 14319, 29898, 1311, 29889, 1524, 29890, 2129, 3285, 1583, 29889, 1524, 1111, 8462, 29879, 3101, 13, 4706, 9995, 13, 4706, 736, 4256, 29898, 1311, 29889, 24582, 29897, 13, 13, 1678, 822, 4256, 29890, 2129, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 20380, 363, 22561, 29889, 13, 4706, 9995, 13, 4706, 363, 1840, 297, 1583, 29889, 24582, 29901, 13, 9651, 7709, 1840, 29961, 29900, 29962, 13, 13, 1678, 822, 4256, 1111, 8462, 29879, 29898, 1311, 1125, 13, 4706, 9995, 13, 4706, 20380, 363, 16127, 29889, 13, 4706, 9995, 13, 4706, 363, 1840, 297, 1583, 29889, 24582, 29901, 13, 9651, 7709, 1840, 29961, 29896, 29962, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 7426, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 10825, 310, 6790, 7426, 29889, 13, 4706, 960, 727, 338, 694, 1840, 310, 7426, 29892, 736, 29871, 29900, 29889, 13, 4706, 9995, 13, 4706, 565, 1583, 29889, 24582, 29901, 13, 9651, 364, 2248, 353, 1583, 3032, 18809, 522, 29898, 12163, 929, 29897, 13, 9651, 565, 1583, 29889, 24582, 29961, 29878, 2248, 448, 29871, 29896, 3816, 29900, 29962, 1275, 7426, 29901, 13, 18884, 736, 1583, 29889, 24582, 29961, 29878, 2248, 448, 29871, 29896, 3816, 29896, 29962, 13, 4706, 736, 29871, 29900, 13, 13, 1678, 822, 4770, 11516, 12035, 1311, 29892, 7426, 1125, 13, 4706, 9995, 13, 4706, 7106, 5852, 565, 727, 338, 263, 1840, 310, 6790, 7426, 29889, 13, 4706, 7700, 6467, 29889, 13, 4706, 9995, 13, 4706, 364, 2248, 353, 1583, 3032, 18809, 522, 29898, 12163, 929, 29897, 13, 4706, 565, 1583, 29889, 24582, 29961, 29878, 2248, 448, 29871, 29896, 3816, 29900, 29962, 1275, 7426, 29901, 13, 9651, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 9995, 13, 4706, 7106, 278, 1353, 310, 848, 9976, 29889, 13, 4706, 9995, 13, 4706, 736, 7431, 29898, 1311, 29889, 24582, 29897, 13, 13, 1678, 822, 4770, 1837, 12035, 1311, 29892, 916, 1125, 13, 4706, 9995, 13, 4706, 1583, 1275, 916, 13, 4706, 9995, 13, 4706, 565, 1583, 338, 916, 29901, 13, 9651, 736, 5852, 13, 4706, 565, 451, 338, 8758, 29898, 1228, 29892, 317, 18054, 7713, 9222, 1125, 13, 9651, 736, 2043, 9222, 10448, 17255, 1837, 12035, 1311, 29892, 916, 29897, 13, 4706, 565, 518, 29873, 363, 260, 297, 1583, 565, 260, 29961, 29896, 5262, 1275, 518, 29873, 363, 260, 297, 916, 565, 260, 29961, 29896, 5262, 29901, 13, 9651, 736, 5852, 13, 4706, 736, 7700, 13, 13, 1678, 822, 4770, 8568, 12035, 1311, 1125, 13, 4706, 659, 353, 2533, 4197, 8568, 29898, 29873, 29897, 363, 260, 297, 1583, 565, 260, 29961, 29896, 24960, 13, 4706, 736, 659, 13, 13, 1678, 822, 4770, 4804, 12035, 1311, 29892, 659, 1125, 13, 4706, 9995, 13, 4706, 23697, 13, 4706, 9995, 13, 4706, 4452, 353, 1051, 29898, 1311, 29889, 24582, 29897, 13, 4706, 565, 451, 4452, 29901, 13, 9651, 736, 29871, 29900, 334, 659, 13, 4706, 659, 29918, 12248, 353, 426, 29896, 29901, 791, 29913, 13, 4706, 270, 29892, 274, 353, 4452, 29889, 7323, 580, 13, 4706, 1121, 353, 274, 13, 4706, 1550, 7431, 29898, 7076, 29897, 1405, 29871, 29900, 29901, 13, 9651, 313, 29872, 29892, 285, 29897, 353, 4452, 29889, 7323, 580, 13, 9651, 1121, 353, 1121, 334, 659, 29918, 12248, 29889, 842, 4381, 29898, 29881, 448, 321, 29892, 659, 3579, 313, 29881, 448, 321, 876, 718, 285, 13, 9651, 270, 353, 321, 13, 4706, 565, 270, 29901, 13, 9651, 736, 1121, 334, 659, 29918, 12248, 29889, 657, 29898, 29881, 29892, 659, 3579, 270, 29897, 13, 4706, 1683, 29901, 13, 9651, 736, 1121, 13, 13, 1678, 822, 4770, 276, 558, 12035, 1311, 1125, 396, 4744, 13, 4706, 736, 2062, 29898, 1311, 29889, 24582, 29897, 13, 2 ]
mayan/apps/document_states/migrations/0020_auto_20200311_1714.py
sophiawa/Mayan-EDMS
0
1603560
# Generated by Django 2.2.10 on 2020-03-11 17:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('document_states', '0019_workflowtransition_condition'), ] operations = [ migrations.AddField( model_name='workflowstateaction', name='condition', field=models.TextField(blank=True, help_text="The condition that will determine if this state action is executed or not. The condition is evaluated against the workflow instance. Conditions that return None or an empty string ('') are considered to be logical false, any other value is considered to be the logical true.", verbose_name='Condition'), ), migrations.AlterField( model_name='workflowtransition', name='condition', field=models.TextField(blank=True, help_text="The condition that will determine if this transition is enabled or not. The condition is evaluated against the workflow instance. Conditions that return None or an empty string ('') are considered to be logical false, any other value is considered to be the logical true.", verbose_name='Condition'), ), ]
[ 1, 396, 3251, 630, 491, 15337, 29871, 29906, 29889, 29906, 29889, 29896, 29900, 373, 29871, 29906, 29900, 29906, 29900, 29899, 29900, 29941, 29899, 29896, 29896, 29871, 29896, 29955, 29901, 29896, 29946, 13, 13, 3166, 9557, 29889, 2585, 1053, 9725, 800, 29892, 4733, 13, 13, 13, 1990, 341, 16783, 29898, 26983, 800, 29889, 29924, 16783, 1125, 13, 13, 1678, 9962, 353, 518, 13, 4706, 6702, 3225, 29918, 28631, 742, 525, 29900, 29900, 29896, 29929, 29918, 1287, 1731, 20543, 29918, 16122, 5477, 13, 1678, 4514, 13, 13, 1678, 6931, 353, 518, 13, 4706, 9725, 800, 29889, 2528, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 1287, 1731, 3859, 2467, 742, 13, 9651, 1024, 2433, 16122, 742, 13, 9651, 1746, 29922, 9794, 29889, 15778, 29898, 19465, 29922, 5574, 29892, 1371, 29918, 726, 543, 1576, 4195, 393, 674, 8161, 565, 445, 2106, 3158, 338, 8283, 470, 451, 29889, 450, 4195, 338, 19030, 2750, 278, 27321, 2777, 29889, 11790, 2187, 393, 736, 6213, 470, 385, 4069, 1347, 6702, 1495, 526, 5545, 304, 367, 16667, 2089, 29892, 738, 916, 995, 338, 5545, 304, 367, 278, 16667, 1565, 19602, 26952, 29918, 978, 2433, 25255, 5477, 13, 4706, 10353, 13, 4706, 9725, 800, 29889, 2499, 357, 3073, 29898, 13, 9651, 1904, 29918, 978, 2433, 1287, 1731, 20543, 742, 13, 9651, 1024, 2433, 16122, 742, 13, 9651, 1746, 29922, 9794, 29889, 15778, 29898, 19465, 29922, 5574, 29892, 1371, 29918, 726, 543, 1576, 4195, 393, 674, 8161, 565, 445, 9558, 338, 9615, 470, 451, 29889, 450, 4195, 338, 19030, 2750, 278, 27321, 2777, 29889, 11790, 2187, 393, 736, 6213, 470, 385, 4069, 1347, 6702, 1495, 526, 5545, 304, 367, 16667, 2089, 29892, 738, 916, 995, 338, 5545, 304, 367, 278, 16667, 1565, 19602, 26952, 29918, 978, 2433, 25255, 5477, 13, 4706, 10353, 13, 1678, 4514, 13, 2 ]
tests/test_discord_pretty_help.py
zaanposni/discord-pretty-help
0
193704
import discord from discord.ext import commands from pretty_help import Navigation, PrettyHelp, __version__ def test_version(): assert __version__ == "1.2.0" # replace with your token TOKEN = "TOKEN" # ":discord:743511195197374563" is a custom discord emoji format. Adjust to match your own custom emoji. nav = Navigation(":discord:743511195197374563", "👎", "\U0001F44D") bot = commands.Bot(command_prefix="!", description="this is the bots descripton") bot.help_command = PrettyHelp(navigation=nav) @bot.event async def on_ready(): print(f"Logged in as: {bot.user.name}") print(f"With ID: {bot.user.id}") class TestCog(commands.Cog): """This is a cog for testing purposes""" @commands.command() async def testcommand(self, ctx: commands.Context): await ctx.send("This is a test command") class ACog(commands.Cog, name="Z Cog"): """This is a cog for testing purposes""" @commands.group() async def atestcommand(self, ctx: commands.Context): await ctx.send("This is a test command") @atestcommand.command() async def atestgroupcommand(self, ctx): await ctx.send("this is a subcommand") @bot.command() async def test(ctx: commands.Context): await ctx.send("this is the test command") bot.add_cog(TestCog(bot)) bot.add_cog(ACog(bot)) bot.run(TOKEN) # run !help in discord after starting the script
[ 1, 1053, 2313, 536, 30004, 13, 3166, 2313, 536, 29889, 1062, 1053, 8260, 30004, 13, 3166, 5051, 29918, 8477, 1053, 23001, 29892, 4721, 4349, 29648, 29892, 4770, 3259, 1649, 30004, 13, 30004, 13, 30004, 13, 1753, 1243, 29918, 3259, 7295, 30004, 13, 1678, 4974, 4770, 3259, 1649, 1275, 376, 29896, 29889, 29906, 29889, 29900, 19451, 13, 30004, 13, 30004, 13, 29937, 5191, 411, 596, 5993, 30004, 13, 4986, 29968, 1430, 353, 376, 4986, 29968, 1430, 19451, 13, 30004, 13, 29937, 29242, 2218, 16090, 29901, 29955, 29946, 29941, 29945, 29896, 29896, 29896, 29929, 29945, 29896, 29929, 29955, 29941, 29955, 29946, 29945, 29953, 29941, 29908, 338, 263, 2888, 2313, 536, 953, 29877, 2397, 3402, 29889, 2087, 5143, 304, 1993, 596, 1914, 2888, 953, 29877, 2397, 22993, 13, 6654, 353, 23001, 703, 29901, 2218, 16090, 29901, 29955, 29946, 29941, 29945, 29896, 29896, 29896, 29929, 29945, 29896, 29929, 29955, 29941, 29955, 29946, 29945, 29953, 29941, 613, 376, 243, 162, 148, 145, 613, 6634, 29965, 29900, 29900, 29900, 29896, 29943, 29946, 29946, 29928, 1159, 30004, 13, 30004, 13, 30004, 13, 7451, 353, 8260, 29889, 29933, 327, 29898, 6519, 29918, 13506, 543, 29991, 613, 6139, 543, 1366, 338, 278, 289, 1862, 29037, 265, 1159, 30004, 13, 7451, 29889, 8477, 29918, 6519, 353, 4721, 4349, 29648, 29898, 15466, 29922, 6654, 8443, 13, 30004, 13, 30004, 13, 29992, 7451, 29889, 3696, 30004, 13, 12674, 822, 373, 29918, 2040, 7295, 30004, 13, 1678, 1596, 29898, 29888, 29908, 3403, 3192, 297, 408, 29901, 426, 7451, 29889, 1792, 29889, 978, 27195, 30004, 13, 1678, 1596, 29898, 29888, 29908, 3047, 3553, 29901, 426, 7451, 29889, 1792, 29889, 333, 27195, 30004, 13, 30004, 13, 30004, 13, 1990, 4321, 29907, 468, 29898, 26381, 29889, 29907, 468, 1125, 30004, 13, 1678, 9995, 4013, 338, 263, 274, 468, 363, 6724, 11976, 15945, 19451, 13, 30004, 13, 1678, 732, 26381, 29889, 6519, 26471, 13, 1678, 7465, 822, 1243, 6519, 29898, 1311, 29892, 12893, 29901, 8260, 29889, 2677, 1125, 30004, 13, 4706, 7272, 12893, 29889, 6717, 703, 4013, 338, 263, 1243, 1899, 1159, 30004, 13, 30004, 13, 30004, 13, 1990, 14614, 468, 29898, 26381, 29889, 29907, 468, 29892, 1024, 543, 29999, 315, 468, 29908, 1125, 30004, 13, 1678, 9995, 4013, 338, 263, 274, 468, 363, 6724, 11976, 15945, 19451, 13, 30004, 13, 1678, 732, 26381, 29889, 2972, 26471, 13, 1678, 7465, 822, 472, 342, 6519, 29898, 1311, 29892, 12893, 29901, 8260, 29889, 2677, 1125, 30004, 13, 4706, 7272, 12893, 29889, 6717, 703, 4013, 338, 263, 1243, 1899, 1159, 30004, 13, 30004, 13, 1678, 732, 271, 342, 6519, 29889, 6519, 26471, 13, 1678, 7465, 822, 472, 342, 2972, 6519, 29898, 1311, 29892, 12893, 1125, 30004, 13, 4706, 7272, 12893, 29889, 6717, 703, 1366, 338, 263, 1014, 6519, 1159, 30004, 13, 30004, 13, 30004, 13, 29992, 7451, 29889, 6519, 26471, 13, 12674, 822, 1243, 29898, 13073, 29901, 8260, 29889, 2677, 1125, 30004, 13, 1678, 7272, 12893, 29889, 6717, 703, 1366, 338, 278, 1243, 1899, 1159, 30004, 13, 30004, 13, 30004, 13, 7451, 29889, 1202, 29918, 29883, 468, 29898, 3057, 29907, 468, 29898, 7451, 876, 30004, 13, 7451, 29889, 1202, 29918, 29883, 468, 29898, 2477, 468, 29898, 7451, 876, 30004, 13, 7451, 29889, 3389, 29898, 4986, 29968, 1430, 8443, 13, 30004, 13, 29937, 1065, 1738, 8477, 297, 2313, 536, 1156, 6257, 278, 2471, 30004, 13, 2 ]
xos/synchronizer/steps/sync_iperfserverinstance.py
cewuandy/iperfserver
0
141658
<filename>xos/synchronizer/steps/sync_iperfserverinstance.py # Copyright 2017-present Open Networking Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import sys from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible from synchronizers.new_base.modelaccessor import * from xos.logger import Logger, logging parentdir = os.path.join(os.path.dirname(__file__), "..") sys.path.insert(0, parentdir) logger = Logger(level=logging.INFO) class SyncIperfServerInstance(SyncInstanceUsingAnsible): observes = VIPSServiceInstance template_name = "iperfserverinstance_playbook.yaml" service_key_name = "/opt/xos/synchronizers/rcord/rcord_private_key" def __init__(self, *args, **kwargs): super(SyncVIPSServiceInstance, self).__init__(*args, **kwargs) def get_extra_attributes(self, o): fields = {} return fields def get_my_ip_address(self, o, network_name, parameter=None): return self.get_ip_address_from_peer_service_instance_instance(network_name, o, o, parameter) def get_ip_address_from_peer_service_instance(self, network_name, sitype, o, parameter=None): peer_si = self.get_peer_serviceinstance_of_type(sitype, o) return self.get_ip_address_from_peer_service_instance_instance(network_name, peer_si, o, parameter) def get_ip_address_from_peer_service_instance_instance(self, network_name, peer_si, o, parameter=None): try: net_id = self.get_network_id(network_name) ins_id = peer_si.leaf_model.instance_id ip_address = Port.objects.get( network_id=net_id, instance_id=ins_id).ip except Exception: self.log.error("Failed to fetch parameter", parameter=parameter, network_name=network_name) self.defer_sync(o, "Waiting for parameters to become available") return ip_address def get_peer_serviceinstance_of_type(self, sitype, o): prov_link_set = ServiceInstanceLink.objects.filter( subscriber_service_instance_id=o.id) try: peer_service = next( p.provider_service_instance for p in prov_link_set if p.provider_service_instance.leaf_model_name == sitype) except StopIteration: sub_link_set = ServiceInstanceLink.objects.filter( provider_service_instance_id=o.id) try: peer_service = next( s.subscriber_service_instance for s in sub_link_set if s.subscriber_service_instance.leaf_model_name == sitype) except StopIteration: self.log.error( 'Could not find service type in service graph', service_type=sitype, object=o) raise ServiceGraphException( "Synchronization failed due to incomplete service graph") return peer_service # To get each network id def get_network_id(self, network_name): return Network.objects.get(name=network_name).id
[ 1, 529, 9507, 29958, 29916, 359, 29914, 29879, 9524, 3950, 29914, 24530, 29914, 16593, 29918, 29875, 546, 29888, 2974, 8758, 29889, 2272, 13, 13, 29937, 14187, 1266, 29871, 29906, 29900, 29896, 29955, 29899, 6338, 4673, 8527, 292, 10606, 13, 29937, 13, 29937, 10413, 21144, 1090, 278, 13380, 19245, 29892, 10079, 29871, 29906, 29889, 29900, 313, 1552, 376, 29931, 293, 1947, 1496, 13, 29937, 366, 1122, 451, 671, 445, 934, 5174, 297, 752, 13036, 411, 278, 19245, 29889, 13, 29937, 887, 1122, 4017, 263, 3509, 310, 278, 19245, 472, 13, 29937, 13, 29937, 1732, 597, 1636, 29889, 4288, 29889, 990, 29914, 506, 11259, 29914, 27888, 1430, 1660, 29899, 29906, 29889, 29900, 13, 29937, 13, 29937, 25870, 3734, 491, 22903, 4307, 470, 15502, 304, 297, 5007, 29892, 7047, 13, 29937, 13235, 1090, 278, 19245, 338, 13235, 373, 385, 376, 3289, 8519, 29908, 350, 3289, 3235, 29892, 13, 29937, 399, 1806, 8187, 2692, 399, 1718, 29934, 13566, 29059, 6323, 8707, 29928, 22122, 29903, 8079, 13764, 29979, 476, 22255, 29892, 2845, 4653, 470, 2411, 2957, 29889, 13, 29937, 2823, 278, 19245, 363, 278, 2702, 4086, 14765, 1076, 11239, 322, 13, 29937, 27028, 1090, 278, 19245, 29889, 13, 13, 13, 5215, 2897, 13, 5215, 10876, 13, 3166, 12231, 19427, 29889, 1482, 29918, 3188, 29889, 21077, 4998, 15156, 2744, 1687, 1053, 317, 2720, 4998, 15156, 2744, 1687, 13, 3166, 12231, 19427, 29889, 1482, 29918, 3188, 29889, 4299, 5943, 272, 1053, 334, 13, 3166, 921, 359, 29889, 21707, 1053, 28468, 29892, 12183, 13, 13, 3560, 3972, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 25721, 22168, 1445, 1649, 511, 376, 636, 1159, 13, 9675, 29889, 2084, 29889, 7851, 29898, 29900, 29892, 3847, 3972, 29897, 13, 13, 21707, 353, 28468, 29898, 5563, 29922, 21027, 29889, 11690, 29897, 13, 13, 1990, 317, 2720, 29902, 546, 29888, 6004, 4998, 29898, 21077, 4998, 15156, 2744, 1687, 1125, 13, 13, 1678, 5366, 1960, 353, 5473, 7024, 3170, 4998, 13, 13, 1678, 4472, 29918, 978, 353, 376, 29875, 546, 29888, 2974, 8758, 29918, 1456, 2909, 29889, 25162, 29908, 13, 13, 1678, 2669, 29918, 1989, 29918, 978, 353, 5591, 3670, 29914, 29916, 359, 29914, 29879, 9524, 19427, 29914, 2214, 536, 29914, 2214, 536, 29918, 9053, 29918, 1989, 29908, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 334, 5085, 29892, 3579, 19290, 1125, 13, 4706, 2428, 29898, 21077, 29963, 5690, 29903, 3170, 4998, 29892, 1583, 467, 1649, 2344, 1649, 10456, 5085, 29892, 3579, 19290, 29897, 13, 13, 1678, 822, 679, 29918, 17833, 29918, 15697, 29898, 1311, 29892, 288, 1125, 13, 4706, 4235, 353, 6571, 13, 13, 4706, 736, 4235, 13, 13, 1678, 822, 679, 29918, 1357, 29918, 666, 29918, 7328, 29898, 1311, 29892, 288, 29892, 3564, 29918, 978, 29892, 3443, 29922, 8516, 1125, 13, 4706, 736, 1583, 29889, 657, 29918, 666, 29918, 7328, 29918, 3166, 29918, 412, 261, 29918, 5509, 29918, 8758, 29918, 8758, 29898, 11618, 29918, 978, 29892, 288, 29892, 288, 29892, 3443, 29897, 13, 13, 1678, 822, 679, 29918, 666, 29918, 7328, 29918, 3166, 29918, 412, 261, 29918, 5509, 29918, 8758, 29898, 1311, 29892, 3564, 29918, 978, 29892, 269, 537, 412, 29892, 288, 29892, 3443, 29922, 8516, 1125, 13, 4706, 23533, 29918, 1039, 353, 1583, 29889, 657, 29918, 412, 261, 29918, 5509, 8758, 29918, 974, 29918, 1853, 29898, 29879, 537, 412, 29892, 288, 29897, 13, 4706, 736, 1583, 29889, 657, 29918, 666, 29918, 7328, 29918, 3166, 29918, 412, 261, 29918, 5509, 29918, 8758, 29918, 8758, 29898, 11618, 29918, 978, 29892, 23533, 29918, 1039, 29892, 288, 29892, 3443, 29897, 13, 13, 1678, 822, 679, 29918, 666, 29918, 7328, 29918, 3166, 29918, 412, 261, 29918, 5509, 29918, 8758, 29918, 8758, 29898, 1311, 29892, 3564, 29918, 978, 29892, 23533, 29918, 1039, 29892, 288, 29892, 3443, 29922, 8516, 1125, 13, 4706, 1018, 29901, 13, 9651, 7787, 29918, 333, 353, 1583, 29889, 657, 29918, 11618, 29918, 333, 29898, 11618, 29918, 978, 29897, 13, 9651, 1663, 29918, 333, 353, 23533, 29918, 1039, 29889, 29500, 29918, 4299, 29889, 8758, 29918, 333, 13, 9651, 10377, 29918, 7328, 353, 3371, 29889, 12650, 29889, 657, 29898, 13, 18884, 3564, 29918, 333, 29922, 1212, 29918, 333, 29892, 2777, 29918, 333, 29922, 1144, 29918, 333, 467, 666, 13, 4706, 5174, 8960, 29901, 13, 9651, 1583, 29889, 1188, 29889, 2704, 703, 17776, 304, 6699, 3443, 613, 13, 462, 965, 3443, 29922, 15501, 29892, 13, 462, 965, 3564, 29918, 978, 29922, 11618, 29918, 978, 29897, 13, 9651, 1583, 29889, 311, 571, 29918, 16593, 29898, 29877, 29892, 376, 15716, 292, 363, 4128, 304, 4953, 3625, 1159, 13, 13, 4706, 736, 10377, 29918, 7328, 13, 13, 1678, 822, 679, 29918, 412, 261, 29918, 5509, 8758, 29918, 974, 29918, 1853, 29898, 1311, 29892, 269, 537, 412, 29892, 288, 1125, 13, 4706, 1326, 29918, 2324, 29918, 842, 353, 6692, 4998, 6595, 29889, 12650, 29889, 4572, 29898, 13, 9651, 21696, 495, 29918, 5509, 29918, 8758, 29918, 333, 29922, 29877, 29889, 333, 29897, 13, 13, 4706, 1018, 29901, 13, 9651, 23533, 29918, 5509, 353, 2446, 29898, 13, 18884, 282, 29889, 18121, 29918, 5509, 29918, 8758, 363, 282, 297, 1326, 29918, 2324, 29918, 842, 565, 282, 29889, 18121, 29918, 5509, 29918, 8758, 29889, 29500, 29918, 4299, 29918, 978, 1275, 269, 537, 412, 29897, 13, 4706, 5174, 22303, 13463, 362, 29901, 13, 9651, 1014, 29918, 2324, 29918, 842, 353, 6692, 4998, 6595, 29889, 12650, 29889, 4572, 29898, 13, 18884, 13113, 29918, 5509, 29918, 8758, 29918, 333, 29922, 29877, 29889, 333, 29897, 13, 9651, 1018, 29901, 13, 18884, 23533, 29918, 5509, 353, 2446, 29898, 13, 462, 1678, 269, 29889, 1491, 7588, 495, 29918, 5509, 29918, 8758, 363, 269, 297, 1014, 29918, 2324, 29918, 842, 565, 269, 29889, 1491, 7588, 495, 29918, 5509, 29918, 8758, 29889, 29500, 29918, 4299, 29918, 978, 1275, 269, 537, 412, 29897, 13, 9651, 5174, 22303, 13463, 362, 29901, 13, 18884, 1583, 29889, 1188, 29889, 2704, 29898, 13, 462, 1678, 525, 23323, 451, 1284, 2669, 1134, 297, 2669, 3983, 742, 2669, 29918, 1853, 29922, 29879, 537, 412, 29892, 1203, 29922, 29877, 29897, 13, 18884, 12020, 6692, 9527, 2451, 29898, 13, 462, 1678, 376, 29903, 9524, 2133, 5229, 2861, 304, 28907, 2669, 3983, 1159, 13, 13, 4706, 736, 23533, 29918, 5509, 13, 13, 1678, 396, 1763, 679, 1269, 3564, 1178, 13, 1678, 822, 679, 29918, 11618, 29918, 333, 29898, 1311, 29892, 3564, 29918, 978, 1125, 13, 4706, 736, 8527, 29889, 12650, 29889, 657, 29898, 978, 29922, 11618, 29918, 978, 467, 333, 13, 13, 2 ]
leetcode/medium/1396-Design_underground.py
shubhamoli/practice
1
49664
<filename>leetcode/medium/1396-Design_underground.py """ Leetcode #1396 """ from collections import defaultdict class UndergroundSystem: def __init__(self): self.transit = defaultdict(list) self.dest = defaultdict(list) def checkIn(self, id: int, stationName: str, t: int) -> None: self.transit[id] = [stationName, t] def checkOut(self, id: int, stationName: str, t: int) -> None: startStation, startTime = self.transit[id] route = (startStation, stationName) self.dest[route].append(t - startTime) def getAverageTime(self, startStation: str, endStation: str) -> float: route = (startStation, endStation) return sum(self.dest[route])/len(self.dest[route]) if __name__ == "__main__": # Your UndergroundSystem object will be instantiated and called as such: obj = UndergroundSystem() obj.checkIn(5,"A",8) obj.checkIn(6,"A",8) obj.checkOut(5,"C",10) obj.checkOut(6,"D",11) assert obj.getAverageTime("A","C") == 2
[ 1, 529, 9507, 29958, 280, 300, 401, 29914, 27891, 29914, 29896, 29941, 29929, 29953, 29899, 4002, 647, 29918, 5062, 2057, 29889, 2272, 13, 15945, 29908, 13, 1678, 951, 300, 401, 396, 29896, 29941, 29929, 29953, 13, 15945, 29908, 13, 13, 13, 3166, 16250, 1053, 2322, 8977, 13, 13, 1990, 7634, 2057, 3924, 29901, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 29889, 3286, 277, 353, 2322, 8977, 29898, 1761, 29897, 13, 4706, 1583, 29889, 7854, 353, 2322, 8977, 29898, 1761, 29897, 13, 13, 1678, 822, 1423, 797, 29898, 1311, 29892, 1178, 29901, 938, 29892, 5073, 1170, 29901, 851, 29892, 260, 29901, 938, 29897, 1599, 6213, 29901, 13, 4706, 1583, 29889, 3286, 277, 29961, 333, 29962, 353, 518, 19569, 1170, 29892, 260, 29962, 13, 13, 1678, 822, 1423, 3744, 29898, 1311, 29892, 1178, 29901, 938, 29892, 5073, 1170, 29901, 851, 29892, 260, 29901, 938, 29897, 1599, 6213, 29901, 13, 4706, 1369, 22814, 29892, 1369, 2481, 353, 1583, 29889, 3286, 277, 29961, 333, 29962, 13, 4706, 5782, 353, 313, 2962, 22814, 29892, 5073, 1170, 29897, 13, 4706, 1583, 29889, 7854, 29961, 13134, 1822, 4397, 29898, 29873, 448, 1369, 2481, 29897, 13, 13, 1678, 822, 679, 29909, 19698, 2481, 29898, 1311, 29892, 1369, 22814, 29901, 851, 29892, 1095, 22814, 29901, 851, 29897, 1599, 5785, 29901, 13, 4706, 5782, 353, 313, 2962, 22814, 29892, 1095, 22814, 29897, 13, 4706, 736, 2533, 29898, 1311, 29889, 7854, 29961, 13134, 2314, 29914, 2435, 29898, 1311, 29889, 7854, 29961, 13134, 2314, 13, 13, 13, 361, 4770, 978, 1649, 1275, 376, 1649, 3396, 1649, 1115, 13, 13, 1678, 396, 3575, 7634, 2057, 3924, 1203, 674, 367, 13213, 630, 322, 2000, 408, 1316, 29901, 13, 1678, 5446, 353, 7634, 2057, 3924, 580, 13, 13, 1678, 5446, 29889, 3198, 797, 29898, 29945, 1699, 29909, 613, 29947, 29897, 13, 1678, 5446, 29889, 3198, 797, 29898, 29953, 1699, 29909, 613, 29947, 29897, 13, 1678, 5446, 29889, 3198, 3744, 29898, 29945, 1699, 29907, 613, 29896, 29900, 29897, 13, 1678, 5446, 29889, 3198, 3744, 29898, 29953, 1699, 29928, 613, 29896, 29896, 29897, 13, 13, 1678, 4974, 29871, 5446, 29889, 657, 29909, 19698, 2481, 703, 29909, 3284, 29907, 1159, 1275, 29871, 29906, 13, 2 ]
test/tf/param/test_auto_save.py
jihuacao/Putil
1
1616320
# coding=utf-8 from optparse import OptionParser import Putil.loger as plog from colorama import Fore import functools import Putil.test.test_helper as th parser = OptionParser(usage='usage %prog [options] arg1 arg2') level_default = 'Debug' parser.add_option( '--level', action='store', dest='Level', type=str, default=level_default, help='specify the log level for the app' 'default: {0}'.format(level_default) ) parser.add_option( '--test_ImproveSave', action='store_true', default=False, dest='TestImproveSave', help='set this flag while you want to test ImproveSave' ) (options, args) = parser.parse_args() plog.PutilLogConfig.config_log_level(stream=plog.LogReflect(options.Level).Level) plog.PutilLogConfig.config_handler(plog.stream_method) plog.PutilLogConfig.config_format( "%(filename)s: %(lineno)d: %(levelname)s: %(name)s: %(message)s") root_logger = plog.PutilLogConfig('tf/test/tf/param/test_auto_save').logger() root_logger.setLevel(plog.DEBUG) TestImproveSaveLogger = root_logger.getChild('TestImproveSave') TestImproveSaveLogger.setLevel(plog.DEBUG) import Putil.tf.param.auto_save as auto_save class model: def __init__(self): self._auto_save = auto_save.ImproveSave(5).UseDefaultDecider(max=True).SetIndicatorGet(self.Output).CheckAutoSave() self._data = [0.0, 1.0, 1.2, 1.3, 1.4, 1.1, 1.3, 1.7, 1.9, 1.0, 1.5] self._i = -1 pass def ModelCheck(self): if self._auto_save.Save() is True: TestImproveSaveLogger.debug('save in acc: {0}'.format(self.Output())) return True else: return False pass @property def AutoSave(self): return self._auto_save def TrainCv(self): self._i += 1 pass @property def Data(self): return self._data def Output(self): return self.Data[self._i] def __test_improve_save(): print(th.information(0, 'start testing imrpove_save', Fore.GREEN) + Fore.RESET) m = model() print(m._auto_save._regular) assert m._auto_save.IndicatorGetter == m.Output assert m._auto_save.DecisionGenerator == m._auto_save._decider hit_target = [1, 2, 3, 4, 7, 8] for i in range(0, 11): m.TrainCv() if m.ModelCheck() is True: if i in hit_target: pass else: print(th.information(0, 'test improve_save failed', Fore.LIGHTRED_EX) + Fore.RESET) pass pass pass print(th.information(0, 'test improve_save successful', Fore.LIGHTGREEN_EX) + Fore.RESET) pass if __name__ == '__main__': if options.TestImproveSave: __test_improve_save()
[ 1, 396, 14137, 29922, 9420, 29899, 29947, 13, 3166, 3523, 5510, 1053, 10831, 11726, 13, 5215, 349, 4422, 29889, 417, 914, 408, 282, 1188, 13, 3166, 2927, 3304, 1053, 28297, 13, 5215, 2090, 312, 8789, 13, 5215, 349, 4422, 29889, 1688, 29889, 1688, 29918, 20907, 408, 266, 13, 16680, 353, 10831, 11726, 29898, 21125, 2433, 21125, 1273, 29097, 518, 6768, 29962, 1852, 29896, 1852, 29906, 1495, 13, 5563, 29918, 4381, 353, 525, 11862, 29915, 13, 16680, 29889, 1202, 29918, 3385, 29898, 13, 1678, 525, 489, 5563, 742, 13, 1678, 3158, 2433, 8899, 742, 13, 1678, 2731, 2433, 10108, 742, 13, 1678, 1134, 29922, 710, 29892, 13, 1678, 2322, 29922, 5563, 29918, 4381, 29892, 13, 1678, 1371, 2433, 6550, 1598, 278, 1480, 3233, 363, 278, 623, 29915, 13, 308, 525, 4381, 29901, 426, 29900, 29913, 4286, 4830, 29898, 5563, 29918, 4381, 29897, 13, 29897, 13, 16680, 29889, 1202, 29918, 3385, 29898, 13, 1678, 525, 489, 1688, 29918, 1888, 771, 345, 11371, 742, 13, 1678, 3158, 2433, 8899, 29918, 3009, 742, 13, 1678, 2322, 29922, 8824, 29892, 13, 1678, 2731, 2433, 3057, 1888, 771, 345, 11371, 742, 13, 1678, 1371, 2433, 842, 445, 7353, 1550, 366, 864, 304, 1243, 1954, 771, 345, 11371, 29915, 13, 29897, 13, 29898, 6768, 29892, 6389, 29897, 353, 13812, 29889, 5510, 29918, 5085, 580, 13, 29886, 1188, 29889, 29925, 4422, 3403, 3991, 29889, 2917, 29918, 1188, 29918, 5563, 29898, 5461, 29922, 29886, 1188, 29889, 3403, 5620, 781, 29898, 6768, 29889, 10108, 467, 10108, 29897, 13, 29886, 1188, 29889, 29925, 4422, 3403, 3991, 29889, 2917, 29918, 13789, 29898, 29886, 1188, 29889, 5461, 29918, 5696, 29897, 13, 29886, 1188, 29889, 29925, 4422, 3403, 3991, 29889, 2917, 29918, 4830, 29898, 13, 1678, 11860, 29898, 9507, 29897, 29879, 29901, 1273, 29898, 1915, 8154, 29897, 29881, 29901, 1273, 29898, 5563, 978, 29897, 29879, 29901, 1273, 29898, 978, 29897, 29879, 29901, 1273, 29898, 4906, 29897, 29879, 1159, 13, 13, 4632, 29918, 21707, 353, 282, 1188, 29889, 29925, 4422, 3403, 3991, 877, 13264, 29914, 1688, 29914, 13264, 29914, 3207, 29914, 1688, 29918, 6921, 29918, 7620, 2824, 21707, 580, 13, 4632, 29918, 21707, 29889, 842, 10108, 29898, 29886, 1188, 29889, 18525, 29897, 13, 13, 3057, 1888, 771, 345, 11371, 16363, 353, 3876, 29918, 21707, 29889, 657, 5938, 877, 3057, 1888, 771, 345, 11371, 1495, 13, 3057, 1888, 771, 345, 11371, 16363, 29889, 842, 10108, 29898, 29886, 1188, 29889, 18525, 29897, 13, 13, 5215, 349, 4422, 29889, 13264, 29889, 3207, 29889, 6921, 29918, 7620, 408, 4469, 29918, 7620, 13, 13, 13, 1990, 1904, 29901, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 1583, 3032, 6921, 29918, 7620, 353, 4469, 29918, 7620, 29889, 1888, 771, 345, 11371, 29898, 29945, 467, 11403, 4592, 6185, 1241, 29898, 3317, 29922, 5574, 467, 2697, 28013, 2577, 29898, 1311, 29889, 6466, 467, 5596, 12300, 11371, 580, 13, 4706, 1583, 3032, 1272, 353, 518, 29900, 29889, 29900, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29906, 29892, 29871, 29896, 29889, 29941, 29892, 29871, 29896, 29889, 29946, 29892, 29871, 29896, 29889, 29896, 29892, 29871, 29896, 29889, 29941, 29892, 29871, 29896, 29889, 29955, 29892, 29871, 29896, 29889, 29929, 29892, 29871, 29896, 29889, 29900, 29892, 29871, 29896, 29889, 29945, 29962, 13, 4706, 1583, 3032, 29875, 353, 448, 29896, 13, 4706, 1209, 13, 13, 1678, 822, 8125, 5596, 29898, 1311, 1125, 13, 4706, 565, 1583, 3032, 6921, 29918, 7620, 29889, 11371, 580, 338, 5852, 29901, 13, 9651, 4321, 1888, 771, 345, 11371, 16363, 29889, 8382, 877, 7620, 297, 1035, 29901, 426, 29900, 29913, 4286, 4830, 29898, 1311, 29889, 6466, 22130, 13, 9651, 736, 5852, 13, 4706, 1683, 29901, 13, 9651, 736, 7700, 13, 4706, 1209, 13, 13, 1678, 732, 6799, 13, 1678, 822, 11133, 11371, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 6921, 29918, 7620, 13, 13, 1678, 822, 28186, 29907, 29894, 29898, 1311, 1125, 13, 4706, 1583, 3032, 29875, 4619, 29871, 29896, 13, 4706, 1209, 13, 13, 1678, 732, 6799, 13, 1678, 822, 3630, 29898, 1311, 1125, 13, 4706, 736, 1583, 3032, 1272, 13, 13, 1678, 822, 10604, 29898, 1311, 1125, 13, 4706, 736, 1583, 29889, 1469, 29961, 1311, 3032, 29875, 29962, 13, 13, 13, 1753, 4770, 1688, 29918, 326, 771, 345, 29918, 7620, 7295, 13, 1678, 1596, 29898, 386, 29889, 19678, 29898, 29900, 29892, 525, 2962, 6724, 527, 19080, 994, 29918, 7620, 742, 28297, 29889, 29954, 1525, 1430, 29897, 718, 28297, 29889, 1525, 10490, 29897, 13, 1678, 286, 353, 1904, 580, 13, 1678, 1596, 29898, 29885, 3032, 6921, 29918, 7620, 3032, 15227, 29897, 13, 1678, 4974, 286, 3032, 6921, 29918, 7620, 29889, 28013, 2577, 357, 1275, 286, 29889, 6466, 13, 1678, 4974, 286, 3032, 6921, 29918, 7620, 29889, 6185, 2459, 21575, 1275, 286, 3032, 6921, 29918, 7620, 3032, 7099, 1241, 13, 1678, 7124, 29918, 5182, 353, 518, 29896, 29892, 29871, 29906, 29892, 29871, 29941, 29892, 29871, 29946, 29892, 29871, 29955, 29892, 29871, 29947, 29962, 13, 1678, 363, 474, 297, 3464, 29898, 29900, 29892, 29871, 29896, 29896, 1125, 13, 4706, 286, 29889, 5323, 262, 29907, 29894, 580, 13, 4706, 565, 286, 29889, 3195, 5596, 580, 338, 5852, 29901, 13, 9651, 565, 474, 297, 7124, 29918, 5182, 29901, 13, 18884, 1209, 13, 9651, 1683, 29901, 13, 18884, 1596, 29898, 386, 29889, 19678, 29898, 29900, 29892, 525, 1688, 11157, 29918, 7620, 5229, 742, 28297, 29889, 5265, 29954, 3912, 19386, 29918, 5746, 29897, 718, 28297, 29889, 1525, 10490, 29897, 13, 18884, 1209, 13, 9651, 1209, 13, 4706, 1209, 13, 1678, 1596, 29898, 386, 29889, 19678, 29898, 29900, 29892, 525, 1688, 11157, 29918, 7620, 9150, 742, 28297, 29889, 5265, 29954, 3912, 29954, 1525, 1430, 29918, 5746, 29897, 718, 28297, 29889, 1525, 10490, 29897, 13, 1678, 1209, 13, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 565, 3987, 29889, 3057, 1888, 771, 345, 11371, 29901, 13, 4706, 4770, 1688, 29918, 326, 771, 345, 29918, 7620, 580, 13, 13, 2 ]
setup.py
adjs/qclib
1
64856
""" pypi setup """ import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="qclib", version="0.0.8", author="<NAME>", author_email="<EMAIL>", description="A quantum computing library using qiskit", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/qclib/qclib", packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3", "Operating System :: OS Independent", ], python_requires='>=3.7', install_requires=[ 'scipy>=1.7.1', 'qiskit>=0.18.3', 'deprecation', 'graphviz' ] )
[ 1, 9995, 13, 29886, 1478, 29875, 6230, 13, 15945, 29908, 13, 13, 5215, 731, 21245, 8789, 13, 13, 2541, 1722, 703, 16310, 2303, 29889, 3487, 613, 376, 29878, 1159, 408, 285, 29882, 29901, 13, 1678, 1472, 29918, 8216, 353, 285, 29882, 29889, 949, 580, 13, 13, 842, 21245, 8789, 29889, 14669, 29898, 13, 1678, 1024, 543, 29939, 29883, 1982, 613, 13, 1678, 1873, 543, 29900, 29889, 29900, 29889, 29947, 613, 13, 1678, 4148, 543, 29966, 5813, 28341, 13, 1678, 4148, 29918, 5269, 543, 29966, 26862, 6227, 28341, 13, 1678, 6139, 543, 29909, 12101, 20602, 3489, 773, 3855, 3873, 277, 613, 13, 1678, 1472, 29918, 8216, 29922, 5426, 29918, 8216, 29892, 13, 1678, 1472, 29918, 8216, 29918, 3051, 29918, 1853, 543, 726, 29914, 3502, 3204, 613, 13, 1678, 3142, 543, 991, 597, 3292, 29889, 510, 29914, 29939, 29883, 1982, 29914, 29939, 29883, 1982, 613, 13, 1678, 9741, 29922, 842, 21245, 8789, 29889, 2886, 29918, 8318, 3285, 13, 1678, 770, 14903, 11759, 13, 4706, 376, 9283, 4056, 17088, 4761, 5132, 4761, 29871, 29941, 613, 13, 4706, 376, 7094, 1218, 2184, 4761, 6570, 25266, 613, 13, 1678, 21251, 13, 1678, 3017, 29918, 276, 339, 2658, 2433, 18572, 29941, 29889, 29955, 742, 13, 1678, 2601, 29918, 276, 339, 2658, 11759, 13, 4706, 525, 26167, 2272, 18572, 29896, 29889, 29955, 29889, 29896, 742, 13, 4706, 525, 29939, 3873, 277, 18572, 29900, 29889, 29896, 29947, 29889, 29941, 742, 13, 4706, 525, 311, 1457, 9252, 742, 13, 4706, 525, 4262, 29894, 466, 29915, 13, 1678, 4514, 13, 29897, 13, 2 ]
core/dbt/flags.py
tskleonard/dbt-core
0
12290
import os import multiprocessing if os.name != "nt": # https://bugs.python.org/issue41567 import multiprocessing.popen_spawn_posix # type: ignore from pathlib import Path from typing import Optional # PROFILES_DIR must be set before the other flags # It also gets set in main.py and in set_from_args because the rpc server # doesn't go through exactly the same main arg processing. DEFAULT_PROFILES_DIR = os.path.join(os.path.expanduser("~"), ".dbt") PROFILES_DIR = os.path.expanduser(os.getenv("DBT_PROFILES_DIR", DEFAULT_PROFILES_DIR)) STRICT_MODE = False # Only here for backwards compatibility FULL_REFRESH = False # subcommand STORE_FAILURES = False # subcommand # Global CLI commands USE_EXPERIMENTAL_PARSER = None STATIC_PARSER = None WARN_ERROR = None WRITE_JSON = None PARTIAL_PARSE = None USE_COLORS = None DEBUG = None LOG_FORMAT = None VERSION_CHECK = None FAIL_FAST = None SEND_ANONYMOUS_USAGE_STATS = None PRINTER_WIDTH = 80 WHICH = None INDIRECT_SELECTION = None LOG_CACHE_EVENTS = None EVENT_BUFFER_SIZE = 100000 QUIET = None # Global CLI defaults. These flags are set from three places: # CLI args, environment variables, and user_config (profiles.yml). # Environment variables use the pattern 'DBT_{flag name}', like DBT_PROFILES_DIR flag_defaults = { "USE_EXPERIMENTAL_PARSER": False, "STATIC_PARSER": True, "WARN_ERROR": False, "WRITE_JSON": True, "PARTIAL_PARSE": True, "USE_COLORS": True, "PROFILES_DIR": DEFAULT_PROFILES_DIR, "DEBUG": False, "LOG_FORMAT": None, "VERSION_CHECK": True, "FAIL_FAST": False, "SEND_ANONYMOUS_USAGE_STATS": True, "PRINTER_WIDTH": 80, "INDIRECT_SELECTION": "eager", "LOG_CACHE_EVENTS": False, "EVENT_BUFFER_SIZE": 100000, "QUIET": False, } def env_set_truthy(key: str) -> Optional[str]: """Return the value if it was set to a "truthy" string value, or None otherwise. """ value = os.getenv(key) if not value or value.lower() in ("0", "false", "f"): return None return value def env_set_bool(env_value): if env_value in ("1", "t", "true", "y", "yes"): return True return False def env_set_path(key: str) -> Optional[Path]: value = os.getenv(key) if value is None: return value else: return Path(value) MACRO_DEBUGGING = env_set_truthy("DBT_MACRO_DEBUGGING") DEFER_MODE = env_set_truthy("DBT_DEFER_TO_STATE") ARTIFACT_STATE_PATH = env_set_path("DBT_ARTIFACT_STATE_PATH") ENABLE_LEGACY_LOGGER = env_set_truthy("DBT_ENABLE_LEGACY_LOGGER") def _get_context(): # TODO: change this back to use fork() on linux when we have made that safe return multiprocessing.get_context("spawn") # This is not a flag, it's a place to store the lock MP_CONTEXT = _get_context() def set_from_args(args, user_config): # N.B. Multiple `globals` are purely for line length. # Because `global` is a parser directive (as opposed to a language construct) # black insists in putting them all on one line global STRICT_MODE, FULL_REFRESH, WARN_ERROR, USE_EXPERIMENTAL_PARSER, STATIC_PARSER global WRITE_JSON, PARTIAL_PARSE, USE_COLORS, STORE_FAILURES, PROFILES_DIR, DEBUG, LOG_FORMAT global INDIRECT_SELECTION, VERSION_CHECK, FAIL_FAST, SEND_ANONYMOUS_USAGE_STATS global PRINTER_WIDTH, WHICH, LOG_CACHE_EVENTS, EVENT_BUFFER_SIZE, QUIET STRICT_MODE = False # backwards compatibility # cli args without user_config or env var option FULL_REFRESH = getattr(args, "full_refresh", FULL_REFRESH) STORE_FAILURES = getattr(args, "store_failures", STORE_FAILURES) WHICH = getattr(args, "which", WHICH) # global cli flags with env var and user_config alternatives USE_EXPERIMENTAL_PARSER = get_flag_value("USE_EXPERIMENTAL_PARSER", args, user_config) STATIC_PARSER = get_flag_value("STATIC_PARSER", args, user_config) WARN_ERROR = get_flag_value("WARN_ERROR", args, user_config) WRITE_JSON = get_flag_value("WRITE_JSON", args, user_config) PARTIAL_PARSE = get_flag_value("PARTIAL_PARSE", args, user_config) USE_COLORS = get_flag_value("USE_COLORS", args, user_config) PROFILES_DIR = get_flag_value("PROFILES_DIR", args, user_config) DEBUG = get_flag_value("DEBUG", args, user_config) LOG_FORMAT = get_flag_value("LOG_FORMAT", args, user_config) VERSION_CHECK = get_flag_value("VERSION_CHECK", args, user_config) FAIL_FAST = get_flag_value("FAIL_FAST", args, user_config) SEND_ANONYMOUS_USAGE_STATS = get_flag_value("SEND_ANONYMOUS_USAGE_STATS", args, user_config) PRINTER_WIDTH = get_flag_value("PRINTER_WIDTH", args, user_config) INDIRECT_SELECTION = get_flag_value("INDIRECT_SELECTION", args, user_config) LOG_CACHE_EVENTS = get_flag_value("LOG_CACHE_EVENTS", args, user_config) EVENT_BUFFER_SIZE = get_flag_value("EVENT_BUFFER_SIZE", args, user_config) QUIET = get_flag_value("QUIET", args, user_config) def get_flag_value(flag, args, user_config): lc_flag = flag.lower() flag_value = getattr(args, lc_flag, None) if flag_value is None: # Environment variables use pattern 'DBT_{flag name}' env_flag = f"DBT_{flag}" env_value = os.getenv(env_flag) if env_value is not None and env_value != "": env_value = env_value.lower() # non Boolean values if flag in [ "LOG_FORMAT", "PRINTER_WIDTH", "PROFILES_DIR", "INDIRECT_SELECTION", "EVENT_BUFFER_SIZE", ]: flag_value = env_value else: flag_value = env_set_bool(env_value) elif user_config is not None and getattr(user_config, lc_flag, None) is not None: flag_value = getattr(user_config, lc_flag) else: flag_value = flag_defaults[flag] if flag in ["PRINTER_WIDTH", "EVENT_BUFFER_SIZE"]: # must be ints flag_value = int(flag_value) if flag == "PROFILES_DIR": flag_value = os.path.abspath(flag_value) return flag_value def get_flag_dict(): return { "use_experimental_parser": USE_EXPERIMENTAL_PARSER, "static_parser": STATIC_PARSER, "warn_error": WARN_ERROR, "write_json": WRITE_JSON, "partial_parse": PARTIAL_PARSE, "use_colors": USE_COLORS, "profiles_dir": PROFILES_DIR, "debug": DEBUG, "log_format": LOG_FORMAT, "version_check": VERSION_CHECK, "fail_fast": FAIL_FAST, "send_anonymous_usage_stats": SEND_ANONYMOUS_USAGE_STATS, "printer_width": PRINTER_WIDTH, "indirect_selection": INDIRECT_SELECTION, "log_cache_events": LOG_CACHE_EVENTS, "event_buffer_size": EVENT_BUFFER_SIZE, "quiet": QUIET, }
[ 1, 1053, 2897, 13, 5215, 6674, 307, 985, 292, 13, 13, 361, 2897, 29889, 978, 2804, 376, 593, 1115, 13, 1678, 396, 2045, 597, 6152, 29879, 29889, 4691, 29889, 990, 29914, 15118, 29946, 29896, 29945, 29953, 29955, 13, 1678, 1053, 6674, 307, 985, 292, 29889, 29886, 3150, 29918, 1028, 18101, 29918, 1066, 861, 29871, 396, 1134, 29901, 11455, 13, 3166, 2224, 1982, 1053, 10802, 13, 3166, 19229, 1053, 28379, 13, 13, 29937, 13756, 24483, 29918, 9464, 1818, 367, 731, 1434, 278, 916, 13449, 13, 29937, 739, 884, 4947, 731, 297, 1667, 29889, 2272, 322, 297, 731, 29918, 3166, 29918, 5085, 1363, 278, 364, 6739, 1923, 13, 29937, 1838, 29915, 29873, 748, 1549, 3721, 278, 1021, 1667, 1852, 9068, 29889, 13, 23397, 29918, 8618, 24483, 29918, 9464, 353, 2897, 29889, 2084, 29889, 7122, 29898, 359, 29889, 2084, 29889, 18837, 1792, 703, 30022, 4968, 11393, 2585, 29873, 1159, 13, 8618, 24483, 29918, 9464, 353, 2897, 29889, 2084, 29889, 18837, 1792, 29898, 359, 29889, 657, 6272, 703, 4051, 29911, 29918, 8618, 24483, 29918, 9464, 613, 22236, 29918, 8618, 24483, 29918, 9464, 876, 13, 13, 1254, 3960, 1783, 29918, 20387, 353, 7700, 29871, 396, 9333, 1244, 363, 28953, 24521, 13, 29943, 3299, 29918, 25866, 1525, 7068, 353, 7700, 29871, 396, 1014, 6519, 13, 1254, 29949, 1525, 29918, 4519, 6227, 11499, 29903, 353, 7700, 29871, 396, 1014, 6519, 13, 13, 29937, 12002, 24492, 8260, 13, 17171, 29918, 5746, 13171, 7833, 3919, 1964, 29918, 16320, 6304, 353, 6213, 13, 17816, 2965, 29918, 16320, 6304, 353, 6213, 13, 29956, 15249, 29918, 11432, 353, 6213, 13, 16365, 29918, 7249, 353, 6213, 13, 26092, 25758, 29918, 16320, 1660, 353, 6213, 13, 17171, 29918, 15032, 24125, 353, 6213, 13, 18525, 353, 6213, 13, 14480, 29918, 19094, 1299, 353, 6213, 13, 16358, 29918, 3210, 16658, 353, 6213, 13, 4519, 6227, 29918, 4519, 1254, 353, 6213, 13, 29903, 11794, 29918, 2190, 1164, 29979, 6720, 3308, 29918, 3308, 10461, 29918, 17816, 29903, 353, 6213, 13, 10593, 23845, 29918, 22574, 353, 29871, 29947, 29900, 13, 25039, 2965, 29950, 353, 6213, 13, 1177, 4571, 26282, 29918, 6404, 2725, 353, 6213, 13, 14480, 29918, 29907, 2477, 9606, 29918, 22240, 3919, 29903, 353, 6213, 13, 22240, 3919, 29918, 7838, 28483, 29918, 14226, 353, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 13, 29984, 3120, 2544, 353, 6213, 13, 13, 29937, 12002, 24492, 21274, 29889, 4525, 13449, 526, 731, 515, 2211, 7600, 29901, 13, 29937, 24492, 6389, 29892, 5177, 3651, 29892, 322, 1404, 29918, 2917, 313, 771, 5325, 29889, 21053, 467, 13, 29937, 16738, 3651, 671, 278, 4766, 525, 4051, 29911, 648, 15581, 1024, 29913, 742, 763, 6535, 29911, 29918, 8618, 24483, 29918, 9464, 13, 15581, 29918, 4381, 29879, 353, 426, 13, 1678, 376, 17171, 29918, 5746, 13171, 7833, 3919, 1964, 29918, 16320, 6304, 1115, 7700, 29892, 13, 1678, 376, 17816, 2965, 29918, 16320, 6304, 1115, 5852, 29892, 13, 1678, 376, 29956, 15249, 29918, 11432, 1115, 7700, 29892, 13, 1678, 376, 16365, 29918, 7249, 1115, 5852, 29892, 13, 1678, 376, 26092, 25758, 29918, 16320, 1660, 1115, 5852, 29892, 13, 1678, 376, 17171, 29918, 15032, 24125, 1115, 5852, 29892, 13, 1678, 376, 8618, 24483, 29918, 9464, 1115, 22236, 29918, 8618, 24483, 29918, 9464, 29892, 13, 1678, 376, 18525, 1115, 7700, 29892, 13, 1678, 376, 14480, 29918, 19094, 1299, 1115, 6213, 29892, 13, 1678, 376, 16358, 29918, 3210, 16658, 1115, 5852, 29892, 13, 1678, 376, 4519, 6227, 29918, 4519, 1254, 1115, 7700, 29892, 13, 1678, 376, 29903, 11794, 29918, 2190, 1164, 29979, 6720, 3308, 29918, 3308, 10461, 29918, 17816, 29903, 1115, 5852, 29892, 13, 1678, 376, 10593, 23845, 29918, 22574, 1115, 29871, 29947, 29900, 29892, 13, 1678, 376, 1177, 4571, 26282, 29918, 6404, 2725, 1115, 376, 29872, 1875, 613, 13, 1678, 376, 14480, 29918, 29907, 2477, 9606, 29918, 22240, 3919, 29903, 1115, 7700, 29892, 13, 1678, 376, 22240, 3919, 29918, 7838, 28483, 29918, 14226, 1115, 29871, 29896, 29900, 29900, 29900, 29900, 29900, 29892, 13, 1678, 376, 29984, 3120, 2544, 1115, 7700, 29892, 13, 29913, 13, 13, 13, 1753, 8829, 29918, 842, 29918, 509, 2806, 29891, 29898, 1989, 29901, 851, 29897, 1599, 28379, 29961, 710, 5387, 13, 1678, 9995, 11609, 278, 995, 565, 372, 471, 731, 304, 263, 376, 509, 2806, 29891, 29908, 1347, 995, 29892, 470, 6213, 13, 1678, 6467, 29889, 13, 1678, 9995, 13, 1678, 995, 353, 2897, 29889, 657, 6272, 29898, 1989, 29897, 13, 1678, 565, 451, 995, 470, 995, 29889, 13609, 580, 297, 4852, 29900, 613, 376, 4541, 613, 376, 29888, 29908, 1125, 13, 4706, 736, 6213, 13, 1678, 736, 995, 13, 13, 13, 1753, 8829, 29918, 842, 29918, 11227, 29898, 6272, 29918, 1767, 1125, 13, 1678, 565, 8829, 29918, 1767, 297, 4852, 29896, 613, 376, 29873, 613, 376, 3009, 613, 376, 29891, 613, 376, 3582, 29908, 1125, 13, 4706, 736, 5852, 13, 1678, 736, 7700, 13, 13, 13, 1753, 8829, 29918, 842, 29918, 2084, 29898, 1989, 29901, 851, 29897, 1599, 28379, 29961, 2605, 5387, 13, 1678, 995, 353, 2897, 29889, 657, 6272, 29898, 1989, 29897, 13, 1678, 565, 995, 338, 6213, 29901, 13, 4706, 736, 995, 13, 1678, 1683, 29901, 13, 4706, 736, 10802, 29898, 1767, 29897, 13, 13, 13, 1529, 29907, 1672, 29918, 18525, 29954, 4214, 353, 8829, 29918, 842, 29918, 509, 2806, 29891, 703, 4051, 29911, 29918, 1529, 29907, 1672, 29918, 18525, 29954, 4214, 1159, 13, 24405, 1001, 29918, 20387, 353, 8829, 29918, 842, 29918, 509, 2806, 29891, 703, 4051, 29911, 29918, 24405, 1001, 29918, 4986, 29918, 19713, 1159, 13, 8322, 29902, 4519, 1783, 29918, 19713, 29918, 10145, 353, 8829, 29918, 842, 29918, 2084, 703, 4051, 29911, 29918, 8322, 29902, 4519, 1783, 29918, 19713, 29918, 10145, 1159, 13, 1430, 6181, 29918, 1307, 29954, 2477, 29979, 29918, 14480, 17070, 353, 8829, 29918, 842, 29918, 509, 2806, 29891, 703, 4051, 29911, 29918, 1430, 6181, 29918, 1307, 29954, 2477, 29979, 29918, 14480, 17070, 1159, 13, 13, 13, 1753, 903, 657, 29918, 4703, 7295, 13, 1678, 396, 14402, 29901, 1735, 445, 1250, 304, 671, 27350, 580, 373, 10542, 746, 591, 505, 1754, 393, 9109, 13, 1678, 736, 6674, 307, 985, 292, 29889, 657, 29918, 4703, 703, 1028, 18101, 1159, 13, 13, 13, 29937, 910, 338, 451, 263, 7353, 29892, 372, 29915, 29879, 263, 2058, 304, 3787, 278, 7714, 13, 3580, 29918, 6007, 16975, 353, 903, 657, 29918, 4703, 580, 13, 13, 13, 1753, 731, 29918, 3166, 29918, 5085, 29898, 5085, 29892, 1404, 29918, 2917, 1125, 13, 1678, 396, 405, 29889, 29933, 29889, 26905, 421, 23705, 1338, 29952, 526, 24837, 363, 1196, 3309, 29889, 13, 1678, 396, 7311, 421, 10945, 29952, 338, 263, 13812, 17041, 313, 294, 15869, 304, 263, 4086, 3386, 29897, 13, 1678, 396, 4628, 1663, 2879, 297, 10594, 963, 599, 373, 697, 1196, 13, 1678, 5534, 6850, 3960, 1783, 29918, 20387, 29892, 383, 3299, 29918, 25866, 1525, 7068, 29892, 399, 15249, 29918, 11432, 29892, 501, 1660, 29918, 5746, 13171, 7833, 3919, 1964, 29918, 16320, 6304, 29892, 6850, 1299, 2965, 29918, 16320, 6304, 13, 1678, 5534, 399, 29934, 9094, 29918, 7249, 29892, 349, 8322, 25758, 29918, 16320, 1660, 29892, 501, 1660, 29918, 15032, 24125, 29892, 317, 4986, 1525, 29918, 4519, 6227, 11499, 29903, 29892, 13756, 24483, 29918, 9464, 29892, 21681, 29892, 25401, 29918, 19094, 1299, 13, 1678, 5534, 2672, 4571, 26282, 29918, 6404, 2725, 29892, 478, 1001, 13381, 29918, 3210, 16658, 29892, 13515, 6227, 29918, 4519, 1254, 29892, 317, 11794, 29918, 2190, 1164, 29979, 6720, 3308, 29918, 3308, 10461, 29918, 17816, 29903, 13, 1678, 5534, 12089, 23845, 29918, 22574, 29892, 12317, 2965, 29950, 29892, 25401, 29918, 29907, 2477, 9606, 29918, 22240, 3919, 29903, 29892, 382, 29963, 3919, 29918, 7838, 28483, 29918, 14226, 29892, 660, 3120, 2544, 13, 13, 1678, 6850, 3960, 1783, 29918, 20387, 353, 7700, 29871, 396, 28953, 24521, 13, 1678, 396, 9335, 6389, 1728, 1404, 29918, 2917, 470, 8829, 722, 2984, 13, 1678, 383, 3299, 29918, 25866, 1525, 7068, 353, 679, 5552, 29898, 5085, 29892, 376, 8159, 29918, 22379, 613, 383, 3299, 29918, 25866, 1525, 7068, 29897, 13, 1678, 317, 4986, 1525, 29918, 4519, 6227, 11499, 29903, 353, 679, 5552, 29898, 5085, 29892, 376, 8899, 29918, 14057, 1973, 613, 317, 4986, 1525, 29918, 4519, 6227, 11499, 29903, 29897, 13, 1678, 12317, 2965, 29950, 353, 679, 5552, 29898, 5085, 29892, 376, 4716, 613, 12317, 2965, 29950, 29897, 13, 13, 1678, 396, 5534, 9335, 13449, 411, 8829, 722, 322, 1404, 29918, 2917, 27809, 13, 1678, 501, 1660, 29918, 5746, 13171, 7833, 3919, 1964, 29918, 16320, 6304, 353, 679, 29918, 15581, 29918, 1767, 703, 17171, 29918, 5746, 13171, 7833, 3919, 1964, 29918, 16320, 6304, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 6850, 1299, 2965, 29918, 16320, 6304, 353, 679, 29918, 15581, 29918, 1767, 703, 17816, 2965, 29918, 16320, 6304, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 399, 15249, 29918, 11432, 353, 679, 29918, 15581, 29918, 1767, 703, 29956, 15249, 29918, 11432, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 399, 29934, 9094, 29918, 7249, 353, 679, 29918, 15581, 29918, 1767, 703, 16365, 29918, 7249, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 349, 8322, 25758, 29918, 16320, 1660, 353, 679, 29918, 15581, 29918, 1767, 703, 26092, 25758, 29918, 16320, 1660, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 501, 1660, 29918, 15032, 24125, 353, 679, 29918, 15581, 29918, 1767, 703, 17171, 29918, 15032, 24125, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 13756, 24483, 29918, 9464, 353, 679, 29918, 15581, 29918, 1767, 703, 8618, 24483, 29918, 9464, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 21681, 353, 679, 29918, 15581, 29918, 1767, 703, 18525, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 25401, 29918, 19094, 1299, 353, 679, 29918, 15581, 29918, 1767, 703, 14480, 29918, 19094, 1299, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 478, 1001, 13381, 29918, 3210, 16658, 353, 679, 29918, 15581, 29918, 1767, 703, 16358, 29918, 3210, 16658, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 13515, 6227, 29918, 4519, 1254, 353, 679, 29918, 15581, 29918, 1767, 703, 4519, 6227, 29918, 4519, 1254, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 317, 11794, 29918, 2190, 1164, 29979, 6720, 3308, 29918, 3308, 10461, 29918, 17816, 29903, 353, 679, 29918, 15581, 29918, 1767, 703, 29903, 11794, 29918, 2190, 1164, 29979, 6720, 3308, 29918, 3308, 10461, 29918, 17816, 29903, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 12089, 23845, 29918, 22574, 353, 679, 29918, 15581, 29918, 1767, 703, 10593, 23845, 29918, 22574, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 2672, 4571, 26282, 29918, 6404, 2725, 353, 679, 29918, 15581, 29918, 1767, 703, 1177, 4571, 26282, 29918, 6404, 2725, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 25401, 29918, 29907, 2477, 9606, 29918, 22240, 3919, 29903, 353, 679, 29918, 15581, 29918, 1767, 703, 14480, 29918, 29907, 2477, 9606, 29918, 22240, 3919, 29903, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 382, 29963, 3919, 29918, 7838, 28483, 29918, 14226, 353, 679, 29918, 15581, 29918, 1767, 703, 22240, 3919, 29918, 7838, 28483, 29918, 14226, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 1678, 660, 3120, 2544, 353, 679, 29918, 15581, 29918, 1767, 703, 29984, 3120, 2544, 613, 6389, 29892, 1404, 29918, 2917, 29897, 13, 13, 13, 1753, 679, 29918, 15581, 29918, 1767, 29898, 15581, 29892, 6389, 29892, 1404, 29918, 2917, 1125, 13, 1678, 301, 29883, 29918, 15581, 353, 7353, 29889, 13609, 580, 13, 1678, 7353, 29918, 1767, 353, 679, 5552, 29898, 5085, 29892, 301, 29883, 29918, 15581, 29892, 6213, 29897, 13, 1678, 565, 7353, 29918, 1767, 338, 6213, 29901, 13, 4706, 396, 16738, 3651, 671, 4766, 525, 4051, 29911, 648, 15581, 1024, 10162, 13, 4706, 8829, 29918, 15581, 353, 285, 29908, 4051, 29911, 648, 15581, 5038, 13, 4706, 8829, 29918, 1767, 353, 2897, 29889, 657, 6272, 29898, 6272, 29918, 15581, 29897, 13, 4706, 565, 8829, 29918, 1767, 338, 451, 6213, 322, 8829, 29918, 1767, 2804, 376, 1115, 13, 9651, 8829, 29918, 1767, 353, 8829, 29918, 1767, 29889, 13609, 580, 13, 9651, 396, 1661, 11185, 1819, 13, 9651, 565, 7353, 297, 518, 13, 18884, 376, 14480, 29918, 19094, 1299, 613, 13, 18884, 376, 10593, 23845, 29918, 22574, 613, 13, 18884, 376, 8618, 24483, 29918, 9464, 613, 13, 18884, 376, 1177, 4571, 26282, 29918, 6404, 2725, 613, 13, 18884, 376, 22240, 3919, 29918, 7838, 28483, 29918, 14226, 613, 13, 9651, 4514, 29901, 13, 18884, 7353, 29918, 1767, 353, 8829, 29918, 1767, 13, 9651, 1683, 29901, 13, 18884, 7353, 29918, 1767, 353, 8829, 29918, 842, 29918, 11227, 29898, 6272, 29918, 1767, 29897, 13, 4706, 25342, 1404, 29918, 2917, 338, 451, 6213, 322, 679, 5552, 29898, 1792, 29918, 2917, 29892, 301, 29883, 29918, 15581, 29892, 6213, 29897, 338, 451, 6213, 29901, 13, 9651, 7353, 29918, 1767, 353, 679, 5552, 29898, 1792, 29918, 2917, 29892, 301, 29883, 29918, 15581, 29897, 13, 4706, 1683, 29901, 13, 9651, 7353, 29918, 1767, 353, 7353, 29918, 4381, 29879, 29961, 15581, 29962, 13, 1678, 565, 7353, 297, 6796, 10593, 23845, 29918, 22574, 613, 376, 22240, 3919, 29918, 7838, 28483, 29918, 14226, 3108, 29901, 29871, 396, 1818, 367, 938, 29879, 13, 4706, 7353, 29918, 1767, 353, 938, 29898, 15581, 29918, 1767, 29897, 13, 1678, 565, 7353, 1275, 376, 8618, 24483, 29918, 9464, 1115, 13, 4706, 7353, 29918, 1767, 353, 2897, 29889, 2084, 29889, 370, 1028, 493, 29898, 15581, 29918, 1767, 29897, 13, 13, 1678, 736, 7353, 29918, 1767, 13, 13, 13, 1753, 679, 29918, 15581, 29918, 8977, 7295, 13, 1678, 736, 426, 13, 4706, 376, 1509, 29918, 735, 27910, 29918, 16680, 1115, 501, 1660, 29918, 5746, 13171, 7833, 3919, 1964, 29918, 16320, 6304, 29892, 13, 4706, 376, 7959, 29918, 16680, 1115, 6850, 1299, 2965, 29918, 16320, 6304, 29892, 13, 4706, 376, 25442, 29918, 2704, 1115, 399, 15249, 29918, 11432, 29892, 13, 4706, 376, 3539, 29918, 3126, 1115, 399, 29934, 9094, 29918, 7249, 29892, 13, 4706, 376, 3846, 29918, 5510, 1115, 349, 8322, 25758, 29918, 16320, 1660, 29892, 13, 4706, 376, 1509, 29918, 27703, 1115, 501, 1660, 29918, 15032, 24125, 29892, 13, 4706, 376, 771, 5325, 29918, 3972, 1115, 13756, 24483, 29918, 9464, 29892, 13, 4706, 376, 8382, 1115, 21681, 29892, 13, 4706, 376, 1188, 29918, 4830, 1115, 25401, 29918, 19094, 1299, 29892, 13, 4706, 376, 3259, 29918, 3198, 1115, 478, 1001, 13381, 29918, 3210, 16658, 29892, 13, 4706, 376, 14057, 29918, 11255, 1115, 13515, 6227, 29918, 4519, 1254, 29892, 13, 4706, 376, 6717, 29918, 25772, 29918, 21125, 29918, 16202, 1115, 317, 11794, 29918, 2190, 1164, 29979, 6720, 3308, 29918, 3308, 10461, 29918, 17816, 29903, 29892, 13, 4706, 376, 558, 1639, 29918, 2103, 1115, 12089, 23845, 29918, 22574, 29892, 13, 4706, 376, 513, 1088, 29918, 21731, 1115, 2672, 4571, 26282, 29918, 6404, 2725, 29892, 13, 4706, 376, 1188, 29918, 8173, 29918, 13604, 1115, 25401, 29918, 29907, 2477, 9606, 29918, 22240, 3919, 29903, 29892, 13, 4706, 376, 3696, 29918, 9040, 29918, 2311, 1115, 382, 29963, 3919, 29918, 7838, 28483, 29918, 14226, 29892, 13, 4706, 376, 339, 2035, 1115, 660, 3120, 2544, 29892, 13, 1678, 500, 13, 2 ]
Tools/Scripts/webkitpy/common/checkout/baselineoptimizer_unittest.py
quanganh2627/bytm-x64-L-w05-2015_external_chromium_org_third_party_WebKit
0
1612228
<gh_stars>0 # Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import webkitpy.thirdparty.unittest2 as unittest from webkitpy.common.checkout.baselineoptimizer import BaselineOptimizer from webkitpy.common.checkout.scm.scm_mock import MockSCM from webkitpy.common.host_mock import MockHost from webkitpy.common.webkit_finder import WebKitFinder class ExcludingMockSCM(MockSCM): def __init__(self, exclusion_list, filesystem=None, executive=None): MockSCM.__init__(self, filesystem, executive) self._exclusion_list = exclusion_list def exists(self, path): if path in self._exclusion_list: return False return MockSCM.exists(self, path) def delete(self, path): return self.delete_list([path]) def delete_list(self, paths): for path in paths: if path in self._exclusion_list: raise Exception("File is not SCM managed: " + path) return MockSCM.delete_list(self, paths) def move(self, origin, destination): if origin in self._exclusion_list: raise Exception("File is not SCM managed: " + origin) return MockSCM.move(self, origin, destination) class BaselineOptimizerTest(unittest.TestCase): def test_move_baselines(self): host = MockHost(scm=ExcludingMockSCM(['/mock-checkout/third_party/WebKit/LayoutTests/platform/mac/another/test-expected.txt'])) host.filesystem.write_binary_file('/mock-checkout/third_party/WebKit/LayoutTests/platform/win/another/test-expected.txt', 'result A') host.filesystem.write_binary_file('/mock-checkout/third_party/WebKit/LayoutTests/platform/mac/another/test-expected.txt', 'result A') host.filesystem.write_binary_file('/mock-checkout/third_party/WebKit/LayoutTests/another/test-expected.txt', 'result B') baseline_optimizer = BaselineOptimizer(host, host.port_factory.all_port_names(), skip_scm_commands=False) baseline_optimizer._move_baselines('another/test-expected.txt', { '/mock-checkout/third_party/WebKit/LayoutTests/platform/win': 'aaa', '/mock-checkout/third_party/WebKit/LayoutTests/platform/mac': 'aaa', '/mock-checkout/third_party/WebKit/LayoutTests': 'bbb', }, { '/mock-checkout/third_party/WebKit/LayoutTests': 'aaa', }) self.assertEqual(host.filesystem.read_binary_file('/mock-checkout/third_party/WebKit/LayoutTests/another/test-expected.txt'), 'result A') def test_move_baselines_skip_scm_commands(self): host = MockHost(scm=ExcludingMockSCM(['/mock-checkout/third_party/WebKit/LayoutTests/platform/mac/another/test-expected.txt'])) host.filesystem.write_binary_file('/mock-checkout/third_party/WebKit/LayoutTests/platform/win/another/test-expected.txt', 'result A') host.filesystem.write_binary_file('/mock-checkout/third_party/WebKit/LayoutTests/platform/mac/another/test-expected.txt', 'result A') host.filesystem.write_binary_file('/mock-checkout/third_party/WebKit/LayoutTests/another/test-expected.txt', 'result B') baseline_optimizer = BaselineOptimizer(host, host.port_factory.all_port_names(), skip_scm_commands=True) baseline_optimizer._move_baselines('another/test-expected.txt', { '/mock-checkout/third_party/WebKit/LayoutTests/platform/win': 'aaa', '/mock-checkout/third_party/WebKit/LayoutTests/platform/mac': 'aaa', '/mock-checkout/third_party/WebKit/LayoutTests': 'bbb', }, { '/mock-checkout/third_party/WebKit/LayoutTests/platform/linux': 'bbb', '/mock-checkout/third_party/WebKit/LayoutTests': 'aaa', }) self.assertEqual(host.filesystem.read_binary_file('/mock-checkout/third_party/WebKit/LayoutTests/another/test-expected.txt'), 'result A') self.assertEqual(baseline_optimizer._files_to_delete, [ '/mock-checkout/third_party/WebKit/LayoutTests/platform/win/another/test-expected.txt', ]) self.assertEqual(baseline_optimizer._files_to_add, [ '/mock-checkout/third_party/WebKit/LayoutTests/another/test-expected.txt', '/mock-checkout/third_party/WebKit/LayoutTests/platform/linux/another/test-expected.txt', ]) def _assertOptimization(self, results_by_directory, expected_new_results_by_directory, baseline_dirname='', expected_files_to_delete=None): host = MockHost() fs = host.filesystem webkit_base = WebKitFinder(fs).webkit_base() baseline_name = 'mock-baseline-expected.txt' for dirname, contents in results_by_directory.items(): path = fs.join(webkit_base, 'LayoutTests', dirname, baseline_name) fs.write_binary_file(path, contents) baseline_optimizer = BaselineOptimizer(host, host.port_factory.all_port_names(), skip_scm_commands=expected_files_to_delete is not None) self.assertTrue(baseline_optimizer.optimize(fs.join(baseline_dirname, baseline_name))) for dirname, contents in expected_new_results_by_directory.items(): path = fs.join(webkit_base, 'LayoutTests', dirname, baseline_name) if contents is None: self.assertTrue(not fs.exists(path) or path in baseline_optimizer._files_to_delete) else: self.assertEqual(fs.read_binary_file(path), contents) # Check that the files that were in the original set have been deleted where necessary. for dirname in results_by_directory: path = fs.join(webkit_base, 'LayoutTests', dirname, baseline_name) if not dirname in expected_new_results_by_directory: self.assertTrue(not fs.exists(path) or path in baseline_optimizer._files_to_delete) if expected_files_to_delete: self.assertEqual(baseline_optimizer._files_to_delete, expected_files_to_delete) def test_linux_redundant_with_win(self): self._assertOptimization({ 'platform/win': '1', 'platform/linux': '1', }, { 'platform/win': '1', }) def test_covers_mac_win_linux(self): self._assertOptimization({ 'platform/mac': '1', 'platform/win': '1', 'platform/linux': '1', '': None, }, { '': '1', }) def test_overwrites_root(self): self._assertOptimization({ 'platform/mac': '1', 'platform/win': '1', 'platform/linux': '1', '': '2', }, { '': '1', }) def test_no_new_common_directory(self): self._assertOptimization({ 'platform/mac': '1', 'platform/linux': '1', '': '2', }, { 'platform/mac': '1', 'platform/linux': '1', '': '2', }) def test_local_optimization(self): self._assertOptimization({ 'platform/mac': '1', 'platform/linux': '1', 'platform/linux-x86': '1', }, { 'platform/mac': '1', 'platform/linux': '1', }) def test_local_optimization_skipping_a_port_in_the_middle(self): self._assertOptimization({ 'platform/mac-snowleopard': '1', 'platform/win': '1', 'platform/linux-x86': '1', }, { 'platform/mac-snowleopard': '1', 'platform/win': '1', }) def test_baseline_redundant_with_root(self): self._assertOptimization({ 'platform/mac': '1', 'platform/win': '2', '': '2', }, { 'platform/mac': '1', '': '2', }) def test_root_baseline_unused(self): self._assertOptimization({ 'platform/mac': '1', 'platform/win': '2', '': '3', }, { 'platform/mac': '1', 'platform/win': '2', }) def test_root_baseline_unused_and_non_existant(self): self._assertOptimization({ 'platform/mac': '1', 'platform/win': '2', }, { 'platform/mac': '1', 'platform/win': '2', }) def test_virtual_root_redundant_with_actual_root(self): self._assertOptimization({ 'virtual/softwarecompositing': '2', 'compositing': '2', }, { 'virtual/softwarecompositing': None, 'compositing': '2', }, baseline_dirname='virtual/softwarecompositing') def test_virtual_root_redundant_with_ancestors(self): self._assertOptimization({ 'virtual/softwarecompositing': '2', 'platform/mac/compositing': '2', 'platform/win/compositing': '2', }, { 'virtual/softwarecompositing': None, 'compositing': '2', }, baseline_dirname='virtual/softwarecompositing') def test_virtual_root_redundant_with_ancestors_skip_scm_commands(self): self._assertOptimization({ 'virtual/softwarecompositing': '2', 'platform/mac/compositing': '2', 'platform/win/compositing': '2', }, { 'virtual/softwarecompositing': None, 'compositing': '2', }, baseline_dirname='virtual/softwarecompositing', expected_files_to_delete=[ '/mock-checkout/third_party/WebKit/LayoutTests/virtual/softwarecompositing/mock-baseline-expected.txt', '/mock-checkout/third_party/WebKit/LayoutTests/platform/mac/compositing/mock-baseline-expected.txt', '/mock-checkout/third_party/WebKit/LayoutTests/platform/win/compositing/mock-baseline-expected.txt', ]) def test_virtual_root_not_redundant_with_ancestors(self): self._assertOptimization({ 'virtual/softwarecompositing': '2', 'platform/mac/compositing': '1', }, { 'virtual/softwarecompositing': '2', 'platform/mac/compositing': '1', }, baseline_dirname='virtual/softwarecompositing')
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 29937, 14187, 1266, 313, 29907, 29897, 29871, 29906, 29900, 29896, 29896, 5087, 9266, 29889, 2178, 10462, 21676, 29889, 13, 29937, 13, 29937, 4367, 391, 3224, 322, 671, 297, 2752, 322, 7581, 7190, 29892, 411, 470, 1728, 13, 29937, 21733, 29892, 526, 21905, 4944, 393, 278, 1494, 5855, 526, 13, 29937, 1539, 29901, 13, 29937, 13, 29937, 1678, 334, 4367, 391, 3224, 29879, 310, 2752, 775, 1818, 11551, 278, 2038, 3509, 1266, 13, 29937, 8369, 29892, 445, 1051, 310, 5855, 322, 278, 1494, 2313, 433, 4193, 29889, 13, 29937, 1678, 334, 4367, 391, 3224, 29879, 297, 7581, 883, 1818, 18532, 278, 2038, 13, 29937, 3509, 1266, 8369, 29892, 445, 1051, 310, 5855, 322, 278, 1494, 2313, 433, 4193, 13, 29937, 297, 278, 5106, 322, 29914, 272, 916, 17279, 4944, 411, 278, 13, 29937, 4978, 29889, 13, 29937, 1678, 334, 2448, 2121, 278, 1024, 310, 5087, 9266, 29889, 3643, 278, 2983, 310, 967, 13, 29937, 17737, 29560, 1122, 367, 1304, 304, 1095, 272, 344, 470, 27391, 9316, 10723, 515, 13, 29937, 445, 7047, 1728, 2702, 7536, 3971, 10751, 29889, 13, 29937, 13, 29937, 3446, 3235, 7791, 7818, 12982, 1525, 8519, 13756, 13044, 3352, 6770, 6093, 315, 4590, 29979, 22789, 3912, 379, 5607, 8032, 29903, 5300, 8707, 29911, 3960, 29933, 2692, 24125, 13, 29937, 376, 3289, 8519, 29908, 5300, 13764, 29979, 8528, 15094, 1799, 6323, 306, 3580, 5265, 3352, 399, 1718, 29934, 13566, 29059, 29892, 2672, 6154, 15789, 4214, 29892, 350, 2692, 6058, 13, 29937, 27848, 3352, 7495, 29892, 6093, 306, 3580, 5265, 3352, 399, 1718, 29934, 13566, 29059, 8079, 341, 1001, 3210, 13566, 2882, 6227, 11937, 5300, 383, 1806, 8186, 1799, 15842, 13, 29937, 319, 349, 8322, 2965, 13309, 1718, 349, 4574, 13152, 1660, 319, 1525, 28657, 13875, 8890, 29928, 29889, 2672, 11698, 382, 29963, 3919, 24972, 9818, 6093, 315, 4590, 29979, 22789, 3912, 13, 29937, 438, 29956, 13865, 6323, 8707, 29911, 3960, 29933, 2692, 24125, 20700, 17705, 6181, 15842, 13764, 29979, 22471, 26282, 29892, 2672, 4571, 26282, 29892, 2672, 29907, 1367, 3919, 1964, 29892, 13, 29937, 317, 4162, 8426, 1964, 29892, 8528, 29923, 3580, 29931, 19926, 29892, 6323, 8707, 1660, 13356, 3919, 25758, 21330, 1529, 1692, 29903, 313, 1177, 6154, 15789, 4214, 29892, 350, 2692, 6058, 13, 29937, 27848, 3352, 7495, 29892, 13756, 29907, 11499, 13780, 8079, 27092, 1254, 1806, 26027, 21947, 29949, 8452, 6323, 26996, 29963, 2965, 2890, 29936, 11247, 1799, 8079, 501, 1660, 29892, 13, 29937, 360, 8254, 29892, 6323, 13756, 29943, 1806, 29903, 29936, 6323, 350, 3308, 8895, 1799, 2672, 4945, 29934, 4897, 29911, 2725, 29897, 29832, 8851, 5348, 12766, 17171, 29928, 5300, 6732, 13764, 29979, 13, 29937, 6093, 18929, 8079, 17705, 2882, 6227, 11937, 29892, 12317, 2544, 4448, 2672, 8707, 29911, 4717, 1783, 29892, 6850, 3960, 1783, 17705, 2882, 6227, 11937, 29892, 6323, 323, 8476, 13, 29937, 313, 1177, 6154, 15789, 4214, 405, 11787, 5265, 24647, 4741, 6323, 438, 29911, 4448, 22119, 1660, 29897, 9033, 3235, 4214, 2672, 13764, 29979, 399, 29909, 29979, 19474, 8079, 6093, 501, 1660, 13, 29937, 8079, 3446, 3235, 7791, 7818, 12982, 1525, 29892, 382, 29963, 1430, 10762, 11033, 18118, 1660, 29928, 8079, 6093, 21521, 1799, 8979, 6227, 11937, 8079, 20134, 3210, 21330, 1529, 1692, 29889, 13, 13, 5215, 1856, 7354, 2272, 29889, 22585, 22633, 29889, 348, 27958, 29906, 408, 443, 27958, 13, 13, 3166, 1856, 7354, 2272, 29889, 9435, 29889, 3198, 449, 29889, 6500, 5570, 20640, 3950, 1053, 4886, 5570, 20624, 326, 3950, 13, 3166, 1856, 7354, 2272, 29889, 9435, 29889, 3198, 449, 29889, 1557, 29885, 29889, 1557, 29885, 29918, 17640, 1053, 26297, 7187, 29924, 13, 3166, 1856, 7354, 2272, 29889, 9435, 29889, 3069, 29918, 17640, 1053, 26297, 8514, 13, 3166, 1856, 7354, 2272, 29889, 9435, 29889, 14085, 29918, 2886, 261, 1053, 2563, 13117, 29943, 4995, 13, 13, 13, 1990, 1222, 22368, 18680, 7187, 29924, 29898, 18680, 7187, 29924, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 429, 10085, 29918, 1761, 29892, 22101, 29922, 8516, 29892, 22760, 29922, 8516, 1125, 13, 4706, 26297, 7187, 29924, 17255, 2344, 12035, 1311, 29892, 22101, 29892, 22760, 29897, 13, 4706, 1583, 3032, 735, 10085, 29918, 1761, 353, 429, 10085, 29918, 1761, 13, 13, 1678, 822, 4864, 29898, 1311, 29892, 2224, 1125, 13, 4706, 565, 2224, 297, 1583, 3032, 735, 10085, 29918, 1761, 29901, 13, 9651, 736, 7700, 13, 4706, 736, 26297, 7187, 29924, 29889, 9933, 29898, 1311, 29892, 2224, 29897, 13, 13, 1678, 822, 5217, 29898, 1311, 29892, 2224, 1125, 13, 4706, 736, 1583, 29889, 8143, 29918, 1761, 4197, 2084, 2314, 13, 13, 1678, 822, 5217, 29918, 1761, 29898, 1311, 29892, 10898, 1125, 13, 4706, 363, 2224, 297, 10898, 29901, 13, 9651, 565, 2224, 297, 1583, 3032, 735, 10085, 29918, 1761, 29901, 13, 18884, 12020, 8960, 703, 2283, 338, 451, 12314, 29924, 8745, 29901, 376, 718, 2224, 29897, 13, 4706, 736, 26297, 7187, 29924, 29889, 8143, 29918, 1761, 29898, 1311, 29892, 10898, 29897, 13, 13, 1678, 822, 4337, 29898, 1311, 29892, 3978, 29892, 12551, 1125, 13, 4706, 565, 3978, 297, 1583, 3032, 735, 10085, 29918, 1761, 29901, 13, 9651, 12020, 8960, 703, 2283, 338, 451, 12314, 29924, 8745, 29901, 376, 718, 3978, 29897, 13, 4706, 736, 26297, 7187, 29924, 29889, 11631, 29898, 1311, 29892, 3978, 29892, 12551, 29897, 13, 13, 13, 1990, 4886, 5570, 20624, 326, 3950, 3057, 29898, 348, 27958, 29889, 3057, 8259, 1125, 13, 1678, 822, 1243, 29918, 11631, 29918, 6500, 24210, 29898, 1311, 1125, 13, 4706, 3495, 353, 26297, 8514, 29898, 1557, 29885, 29922, 1252, 22368, 18680, 7187, 29924, 18959, 29914, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 8628, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 25901, 13, 4706, 3495, 29889, 5325, 973, 29889, 3539, 29918, 19541, 29918, 1445, 11219, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 5080, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 525, 2914, 319, 1495, 13, 4706, 3495, 29889, 5325, 973, 29889, 3539, 29918, 19541, 29918, 1445, 11219, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 8628, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 525, 2914, 319, 1495, 13, 4706, 3495, 29889, 5325, 973, 29889, 3539, 29918, 19541, 29918, 1445, 11219, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 525, 2914, 350, 1495, 13, 4706, 2362, 5570, 29918, 20640, 3950, 353, 4886, 5570, 20624, 326, 3950, 29898, 3069, 29892, 3495, 29889, 637, 29918, 14399, 29889, 497, 29918, 637, 29918, 7039, 3285, 14383, 29918, 1557, 29885, 29918, 26381, 29922, 8824, 29897, 13, 4706, 2362, 5570, 29918, 20640, 3950, 3032, 11631, 29918, 6500, 24210, 877, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 426, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 5080, 2396, 525, 7340, 29874, 742, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 8628, 2396, 525, 7340, 29874, 742, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 2396, 525, 1327, 29890, 742, 13, 4706, 2981, 426, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 2396, 525, 7340, 29874, 742, 13, 4706, 5615, 13, 4706, 1583, 29889, 9294, 9843, 29898, 3069, 29889, 5325, 973, 29889, 949, 29918, 19541, 29918, 1445, 11219, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 5477, 525, 2914, 319, 1495, 13, 13, 1678, 822, 1243, 29918, 11631, 29918, 6500, 24210, 29918, 11014, 29918, 1557, 29885, 29918, 26381, 29898, 1311, 1125, 13, 4706, 3495, 353, 26297, 8514, 29898, 1557, 29885, 29922, 1252, 22368, 18680, 7187, 29924, 18959, 29914, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 8628, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 25901, 13, 4706, 3495, 29889, 5325, 973, 29889, 3539, 29918, 19541, 29918, 1445, 11219, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 5080, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 525, 2914, 319, 1495, 13, 4706, 3495, 29889, 5325, 973, 29889, 3539, 29918, 19541, 29918, 1445, 11219, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 8628, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 525, 2914, 319, 1495, 13, 4706, 3495, 29889, 5325, 973, 29889, 3539, 29918, 19541, 29918, 1445, 11219, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 525, 2914, 350, 1495, 13, 4706, 2362, 5570, 29918, 20640, 3950, 353, 4886, 5570, 20624, 326, 3950, 29898, 3069, 29892, 3495, 29889, 637, 29918, 14399, 29889, 497, 29918, 637, 29918, 7039, 3285, 14383, 29918, 1557, 29885, 29918, 26381, 29922, 5574, 29897, 13, 4706, 2362, 5570, 29918, 20640, 3950, 3032, 11631, 29918, 6500, 24210, 877, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 426, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 5080, 2396, 525, 7340, 29874, 742, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 8628, 2396, 525, 7340, 29874, 742, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 2396, 525, 1327, 29890, 742, 13, 4706, 2981, 426, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 9389, 2396, 525, 1327, 29890, 742, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 2396, 525, 7340, 29874, 742, 13, 4706, 5615, 13, 4706, 1583, 29889, 9294, 9843, 29898, 3069, 29889, 5325, 973, 29889, 949, 29918, 19541, 29918, 1445, 11219, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 5477, 525, 2914, 319, 1495, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 6500, 5570, 29918, 20640, 3950, 3032, 5325, 29918, 517, 29918, 8143, 29892, 518, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 5080, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 13, 308, 2314, 13, 13, 4706, 1583, 29889, 9294, 9843, 29898, 6500, 5570, 29918, 20640, 3950, 3032, 5325, 29918, 517, 29918, 1202, 29892, 518, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 9389, 29914, 23327, 29914, 1688, 29899, 9684, 29889, 3945, 742, 13, 308, 2314, 13, 13, 1678, 822, 903, 9294, 20624, 326, 2133, 29898, 1311, 29892, 2582, 29918, 1609, 29918, 12322, 29892, 3806, 29918, 1482, 29918, 9902, 29918, 1609, 29918, 12322, 29892, 2362, 5570, 29918, 25721, 2433, 742, 3806, 29918, 5325, 29918, 517, 29918, 8143, 29922, 8516, 1125, 13, 4706, 3495, 353, 26297, 8514, 580, 13, 4706, 18920, 353, 3495, 29889, 5325, 973, 13, 4706, 1856, 7354, 29918, 3188, 353, 2563, 13117, 29943, 4995, 29898, 5847, 467, 14085, 29918, 3188, 580, 13, 4706, 2362, 5570, 29918, 978, 353, 525, 17640, 29899, 6500, 5570, 29899, 9684, 29889, 3945, 29915, 13, 13, 4706, 363, 4516, 978, 29892, 8118, 297, 2582, 29918, 1609, 29918, 12322, 29889, 7076, 7295, 13, 9651, 2224, 353, 18920, 29889, 7122, 29898, 14085, 29918, 3188, 29892, 525, 3453, 24376, 742, 4516, 978, 29892, 2362, 5570, 29918, 978, 29897, 13, 9651, 18920, 29889, 3539, 29918, 19541, 29918, 1445, 29898, 2084, 29892, 8118, 29897, 13, 13, 4706, 2362, 5570, 29918, 20640, 3950, 353, 4886, 5570, 20624, 326, 3950, 29898, 3069, 29892, 3495, 29889, 637, 29918, 14399, 29889, 497, 29918, 637, 29918, 7039, 3285, 14383, 29918, 1557, 29885, 29918, 26381, 29922, 9684, 29918, 5325, 29918, 517, 29918, 8143, 338, 451, 6213, 29897, 13, 4706, 1583, 29889, 9294, 5574, 29898, 6500, 5570, 29918, 20640, 3950, 29889, 20640, 675, 29898, 5847, 29889, 7122, 29898, 6500, 5570, 29918, 25721, 29892, 2362, 5570, 29918, 978, 4961, 13, 13, 4706, 363, 4516, 978, 29892, 8118, 297, 3806, 29918, 1482, 29918, 9902, 29918, 1609, 29918, 12322, 29889, 7076, 7295, 13, 9651, 2224, 353, 18920, 29889, 7122, 29898, 14085, 29918, 3188, 29892, 525, 3453, 24376, 742, 4516, 978, 29892, 2362, 5570, 29918, 978, 29897, 13, 9651, 565, 8118, 338, 6213, 29901, 13, 18884, 1583, 29889, 9294, 5574, 29898, 1333, 18920, 29889, 9933, 29898, 2084, 29897, 470, 2224, 297, 2362, 5570, 29918, 20640, 3950, 3032, 5325, 29918, 517, 29918, 8143, 29897, 13, 9651, 1683, 29901, 13, 18884, 1583, 29889, 9294, 9843, 29898, 5847, 29889, 949, 29918, 19541, 29918, 1445, 29898, 2084, 511, 8118, 29897, 13, 13, 4706, 396, 5399, 393, 278, 2066, 393, 892, 297, 278, 2441, 731, 505, 1063, 11132, 988, 5181, 29889, 13, 4706, 363, 4516, 978, 297, 2582, 29918, 1609, 29918, 12322, 29901, 13, 9651, 2224, 353, 18920, 29889, 7122, 29898, 14085, 29918, 3188, 29892, 525, 3453, 24376, 742, 4516, 978, 29892, 2362, 5570, 29918, 978, 29897, 13, 9651, 565, 451, 4516, 978, 297, 3806, 29918, 1482, 29918, 9902, 29918, 1609, 29918, 12322, 29901, 13, 18884, 1583, 29889, 9294, 5574, 29898, 1333, 18920, 29889, 9933, 29898, 2084, 29897, 470, 2224, 297, 2362, 5570, 29918, 20640, 3950, 3032, 5325, 29918, 517, 29918, 8143, 29897, 13, 13, 4706, 565, 3806, 29918, 5325, 29918, 517, 29918, 8143, 29901, 13, 9651, 1583, 29889, 9294, 9843, 29898, 6500, 5570, 29918, 20640, 3950, 3032, 5325, 29918, 517, 29918, 8143, 29892, 3806, 29918, 5325, 29918, 517, 29918, 8143, 29897, 13, 13, 1678, 822, 1243, 29918, 9389, 29918, 9313, 299, 424, 29918, 2541, 29918, 5080, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 2396, 525, 29896, 742, 13, 4706, 2981, 426, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29896, 742, 13, 4706, 5615, 13, 13, 1678, 822, 1243, 29918, 1111, 874, 29918, 8628, 29918, 5080, 29918, 9389, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 2396, 525, 29896, 742, 13, 9651, 525, 2396, 6213, 29892, 13, 4706, 2981, 426, 13, 9651, 525, 2396, 525, 29896, 742, 13, 4706, 5615, 13, 13, 1678, 822, 1243, 29918, 957, 8231, 267, 29918, 4632, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 2396, 525, 29896, 742, 13, 9651, 525, 2396, 525, 29906, 742, 13, 4706, 2981, 426, 13, 9651, 525, 2396, 525, 29896, 742, 13, 4706, 5615, 13, 13, 1678, 822, 1243, 29918, 1217, 29918, 1482, 29918, 9435, 29918, 12322, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 2396, 525, 29896, 742, 13, 9651, 525, 2396, 525, 29906, 742, 13, 4706, 2981, 426, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 2396, 525, 29896, 742, 13, 9651, 525, 2396, 525, 29906, 742, 13, 4706, 5615, 13, 13, 13, 1678, 822, 1243, 29918, 2997, 29918, 20640, 2133, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 29899, 29916, 29947, 29953, 2396, 525, 29896, 742, 13, 4706, 2981, 426, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 2396, 525, 29896, 742, 13, 4706, 5615, 13, 13, 1678, 822, 1243, 29918, 2997, 29918, 20640, 2133, 29918, 2574, 3262, 29918, 29874, 29918, 637, 29918, 262, 29918, 1552, 29918, 17662, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 8628, 29899, 29879, 3707, 280, 459, 538, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 9389, 29899, 29916, 29947, 29953, 2396, 525, 29896, 742, 13, 4706, 2981, 426, 13, 9651, 525, 12120, 29914, 8628, 29899, 29879, 3707, 280, 459, 538, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29896, 742, 13, 4706, 5615, 13, 13, 1678, 822, 1243, 29918, 6500, 5570, 29918, 9313, 299, 424, 29918, 2541, 29918, 4632, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29906, 742, 13, 9651, 525, 2396, 525, 29906, 742, 13, 4706, 2981, 426, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 2396, 525, 29906, 742, 13, 4706, 5615, 13, 13, 1678, 822, 1243, 29918, 4632, 29918, 6500, 5570, 29918, 348, 3880, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29906, 742, 13, 9651, 525, 2396, 525, 29941, 742, 13, 4706, 2981, 426, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29906, 742, 13, 4706, 5615, 13, 13, 1678, 822, 1243, 29918, 4632, 29918, 6500, 5570, 29918, 348, 3880, 29918, 392, 29918, 5464, 29918, 735, 22137, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29906, 742, 13, 4706, 2981, 426, 13, 9651, 525, 12120, 29914, 8628, 2396, 525, 29896, 742, 13, 9651, 525, 12120, 29914, 5080, 2396, 525, 29906, 742, 13, 4706, 5615, 13, 13, 1678, 822, 1243, 29918, 18714, 29918, 4632, 29918, 9313, 299, 424, 29918, 2541, 29918, 19304, 29918, 4632, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 18714, 29914, 20415, 22410, 11407, 2396, 525, 29906, 742, 13, 9651, 525, 22410, 11407, 2396, 525, 29906, 742, 13, 4706, 2981, 426, 13, 9651, 525, 18714, 29914, 20415, 22410, 11407, 2396, 6213, 29892, 13, 9651, 525, 22410, 11407, 2396, 525, 29906, 742, 13, 4706, 2981, 2362, 5570, 29918, 25721, 2433, 18714, 29914, 20415, 22410, 11407, 1495, 13, 13, 1678, 822, 1243, 29918, 18714, 29918, 4632, 29918, 9313, 299, 424, 29918, 2541, 29918, 4564, 342, 943, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 18714, 29914, 20415, 22410, 11407, 2396, 525, 29906, 742, 13, 9651, 525, 12120, 29914, 8628, 29914, 22410, 11407, 2396, 525, 29906, 742, 13, 9651, 525, 12120, 29914, 5080, 29914, 22410, 11407, 2396, 525, 29906, 742, 13, 4706, 2981, 426, 13, 9651, 525, 18714, 29914, 20415, 22410, 11407, 2396, 6213, 29892, 13, 9651, 525, 22410, 11407, 2396, 525, 29906, 742, 13, 4706, 2981, 2362, 5570, 29918, 25721, 2433, 18714, 29914, 20415, 22410, 11407, 1495, 13, 13, 1678, 822, 1243, 29918, 18714, 29918, 4632, 29918, 9313, 299, 424, 29918, 2541, 29918, 4564, 342, 943, 29918, 11014, 29918, 1557, 29885, 29918, 26381, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 18714, 29914, 20415, 22410, 11407, 2396, 525, 29906, 742, 13, 9651, 525, 12120, 29914, 8628, 29914, 22410, 11407, 2396, 525, 29906, 742, 13, 9651, 525, 12120, 29914, 5080, 29914, 22410, 11407, 2396, 525, 29906, 742, 13, 4706, 2981, 426, 13, 9651, 525, 18714, 29914, 20415, 22410, 11407, 2396, 6213, 29892, 13, 9651, 525, 22410, 11407, 2396, 525, 29906, 742, 13, 4706, 2981, 13, 4706, 2362, 5570, 29918, 25721, 2433, 18714, 29914, 20415, 22410, 11407, 742, 13, 4706, 3806, 29918, 5325, 29918, 517, 29918, 8143, 11759, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 18714, 29914, 20415, 22410, 11407, 29914, 17640, 29899, 6500, 5570, 29899, 9684, 29889, 3945, 742, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 8628, 29914, 22410, 11407, 29914, 17640, 29899, 6500, 5570, 29899, 9684, 29889, 3945, 742, 13, 9651, 8207, 17640, 29899, 3198, 449, 29914, 22585, 29918, 22633, 29914, 3609, 13117, 29914, 3453, 24376, 29914, 12120, 29914, 5080, 29914, 22410, 11407, 29914, 17640, 29899, 6500, 5570, 29899, 9684, 29889, 3945, 742, 13, 308, 2314, 13, 13, 1678, 822, 1243, 29918, 18714, 29918, 4632, 29918, 1333, 29918, 9313, 299, 424, 29918, 2541, 29918, 4564, 342, 943, 29898, 1311, 1125, 13, 4706, 1583, 3032, 9294, 20624, 326, 2133, 3319, 13, 9651, 525, 18714, 29914, 20415, 22410, 11407, 2396, 525, 29906, 742, 13, 9651, 525, 12120, 29914, 8628, 29914, 22410, 11407, 2396, 525, 29896, 742, 13, 4706, 2981, 426, 13, 9651, 525, 18714, 29914, 20415, 22410, 11407, 2396, 525, 29906, 742, 13, 9651, 525, 12120, 29914, 8628, 29914, 22410, 11407, 2396, 525, 29896, 742, 13, 4706, 2981, 2362, 5570, 29918, 25721, 2433, 18714, 29914, 20415, 22410, 11407, 1495, 13, 2 ]
models/gaze_rnn77.py
yj-yu/Recurrent_Gaze_Prediction
9
34304
<reponame>yj-yu/Recurrent_Gaze_Prediction #-*- coding: utf-8 -*- """ gaze_rnn7.py Implement a simple recurrent gaze prediction model based on RNN(GRU). In this version, the gaze DIM is REDUCED to 7x7 dimension. """ # TODO separate pupil from gazemaps, AWFUL design import numpy as np import os import sys import time from PIL import Image import tensorflow as tf rnn_cell = tf.nn.rnn_cell from collections import OrderedDict import cPickle as pkl import crc_input_data_seq from util import log, override from models.base import ModelBase, BaseModelConfig from models.saliency_shallownet import SaliencyModel from models.model_util import tf_normalize_map, normalize_probability_map from models.model_util import tf_softmax_2d, tf_softmax_cross_entropy_with_logits_2d from evaluation_metrics import saliency_score, AVAILABLE_METRICS from easydict import EasyDict as E CONSTANTS = E() CONSTANTS.image_width = 98 CONSTANTS.image_height = 98 CONSTANTS.gazemap_width = 7 CONSTANTS.gazemap_height = 7 CONSTANTS.saliencymap_width = 49 CONSTANTS.saliencymap_height = 49 # config : changed as paramter later class GRUModelConfig(BaseModelConfig): def __init__(self): super(GRUModelConfig, self).__init__() self.n_lstm_steps = 35 self.batch_size = 7 # XXX XXX XXX XXX self.dim_feature = 1024 #1024 self.dim_sal = 1024*49 #196 self.dim_sal_proj = 1024 # use adam by default self.optimization_method = 'adam' self.loss_type = 'l2' from gaze_rnn import GazePredictionGRU as GazePredictionGRU4949 class GazePredictionGRU(GazePredictionGRU4949): # Does not compatible model.py yet. mount that to this model. TODO" def __init__(self, session, data_sets, config=GRUModelConfig() ): self.session = session self.data_sets = data_sets self.config = config #assert isinstance(self.config, GRUModelConfig) super(GazePredictionGRU, self).__init__(session, data_sets, config) # other configuration self.batch_size = config.batch_size self.n_lstm_steps = config.n_lstm_steps self.dim_feature = config.dim_feature self.dim_sal = config.dim_sal # 49 * 49 self.dim_sal_proj = config.dim_sal_proj # 14 * 14 = 196 self.dim_cnn_proj = 32 self.initial_learning_rate = config.initial_learning_rate self.learning_rate_decay = config.learning_rate_decay self.max_grad_norm = config.max_grad_norm self.gazemap_height = CONSTANTS.gazemap_height # 7 self.gazemap_width = CONSTANTS.gazemap_width # 7 self.image_height = CONSTANTS.image_height self.image_width = CONSTANTS.image_width # Finally, build the model and optimizer self.build_model() #self.build_generator() self.build_train_op() self.session.run(tf.initialize_all_variables())
[ 1, 529, 276, 1112, 420, 29958, 17472, 29899, 29891, 29884, 29914, 4789, 1264, 29918, 29954, 28334, 29918, 23084, 2463, 13, 29937, 29899, 29930, 29899, 14137, 29901, 23616, 29899, 29947, 448, 29930, 29899, 13, 13, 15945, 29908, 13, 29887, 28334, 29918, 29878, 15755, 29955, 29889, 2272, 13, 13, 1888, 2037, 263, 2560, 1162, 1264, 12642, 29872, 18988, 1904, 2729, 373, 390, 10262, 29898, 14345, 29965, 467, 13, 797, 445, 1873, 29892, 278, 12642, 29872, 360, 7833, 338, 390, 3352, 23129, 3352, 304, 29871, 29955, 29916, 29955, 9927, 29889, 13, 15945, 29908, 13, 13, 29937, 14402, 5004, 23449, 309, 515, 12642, 331, 2547, 29892, 319, 29686, 13309, 2874, 13, 13, 5215, 12655, 408, 7442, 13, 5215, 2897, 13, 5215, 10876, 13, 5215, 931, 13, 13, 3166, 349, 6227, 1053, 7084, 13, 5215, 26110, 408, 15886, 13, 29878, 15755, 29918, 3729, 353, 15886, 29889, 15755, 29889, 29878, 15755, 29918, 3729, 13, 13, 3166, 16250, 1053, 8170, 287, 21533, 13, 5215, 274, 29925, 860, 280, 408, 282, 6321, 13, 5215, 2181, 29883, 29918, 2080, 29918, 1272, 29918, 11762, 13, 13, 3166, 3667, 1053, 1480, 29892, 5712, 13, 3166, 4733, 29889, 3188, 1053, 8125, 5160, 29892, 7399, 3195, 3991, 13, 3166, 4733, 29889, 19585, 13396, 29918, 845, 497, 776, 300, 1053, 3956, 13396, 3195, 13, 13, 3166, 4733, 29889, 4299, 29918, 4422, 1053, 15886, 29918, 8945, 675, 29918, 1958, 29892, 4226, 675, 29918, 22795, 3097, 29918, 1958, 13, 3166, 4733, 29889, 4299, 29918, 4422, 1053, 15886, 29918, 2695, 3317, 29918, 29906, 29881, 29892, 15886, 29918, 2695, 3317, 29918, 19128, 29918, 296, 14441, 29918, 2541, 29918, 1188, 1169, 29918, 29906, 29881, 13, 3166, 17983, 29918, 2527, 10817, 1053, 4497, 13396, 29918, 13628, 29892, 16884, 29909, 6227, 6181, 29918, 2303, 5659, 2965, 29903, 13, 13, 3166, 2240, 2941, 919, 1053, 382, 8995, 21533, 408, 382, 13, 13, 6007, 1254, 2190, 9375, 353, 382, 580, 13, 6007, 1254, 2190, 9375, 29889, 3027, 29918, 2103, 353, 29871, 29929, 29947, 13, 6007, 1254, 2190, 9375, 29889, 3027, 29918, 3545, 353, 29871, 29929, 29947, 13, 6007, 1254, 2190, 9375, 29889, 29887, 834, 331, 481, 29918, 2103, 353, 29871, 29955, 13, 6007, 1254, 2190, 9375, 29889, 29887, 834, 331, 481, 29918, 3545, 353, 29871, 29955, 13, 6007, 1254, 2190, 9375, 29889, 19585, 819, 29883, 962, 481, 29918, 2103, 353, 29871, 29946, 29929, 13, 6007, 1254, 2190, 9375, 29889, 19585, 819, 29883, 962, 481, 29918, 3545, 353, 29871, 29946, 29929, 13, 13, 13, 29937, 2295, 584, 3939, 408, 1828, 357, 2678, 13, 1990, 18016, 29965, 3195, 3991, 29898, 5160, 3195, 3991, 1125, 13, 13, 1678, 822, 4770, 2344, 12035, 1311, 1125, 13, 4706, 2428, 29898, 14345, 29965, 3195, 3991, 29892, 1583, 467, 1649, 2344, 1649, 580, 13, 13, 4706, 1583, 29889, 29876, 29918, 20155, 29885, 29918, 24530, 353, 29871, 29941, 29945, 13, 4706, 1583, 29889, 16175, 29918, 2311, 353, 29871, 29955, 396, 22615, 22615, 22615, 22615, 13, 13, 4706, 1583, 29889, 6229, 29918, 14394, 353, 29871, 29896, 29900, 29906, 29946, 396, 29896, 29900, 29906, 29946, 13, 4706, 1583, 29889, 6229, 29918, 19585, 353, 29871, 29896, 29900, 29906, 29946, 29930, 29946, 29929, 29871, 396, 29896, 29929, 29953, 13, 4706, 1583, 29889, 6229, 29918, 19585, 29918, 20865, 353, 29871, 29896, 29900, 29906, 29946, 13, 13, 4706, 396, 671, 594, 314, 491, 2322, 13, 4706, 1583, 29889, 20640, 2133, 29918, 5696, 353, 525, 328, 314, 29915, 13, 13, 4706, 1583, 29889, 6758, 29918, 1853, 353, 525, 29880, 29906, 29915, 13, 13, 13, 3166, 12642, 29872, 29918, 29878, 15755, 1053, 15853, 29872, 23084, 2463, 14345, 29965, 408, 15853, 29872, 23084, 2463, 14345, 29965, 29946, 29929, 29946, 29929, 13, 13, 1990, 15853, 29872, 23084, 2463, 14345, 29965, 29898, 29954, 28334, 23084, 2463, 14345, 29965, 29946, 29929, 29946, 29929, 1125, 13, 13, 1678, 396, 5538, 451, 15878, 1904, 29889, 2272, 3447, 29889, 5766, 393, 304, 445, 1904, 29889, 14402, 29908, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 13, 462, 4867, 29892, 13, 462, 848, 29918, 7224, 29892, 13, 462, 2295, 29922, 14345, 29965, 3195, 3991, 580, 13, 462, 29871, 1125, 13, 4706, 1583, 29889, 7924, 353, 4867, 13, 4706, 1583, 29889, 1272, 29918, 7224, 353, 848, 29918, 7224, 13, 4706, 1583, 29889, 2917, 353, 2295, 13, 4706, 396, 9294, 338, 8758, 29898, 1311, 29889, 2917, 29892, 18016, 29965, 3195, 3991, 29897, 13, 13, 4706, 2428, 29898, 29954, 28334, 23084, 2463, 14345, 29965, 29892, 1583, 467, 1649, 2344, 12035, 7924, 29892, 848, 29918, 7224, 29892, 2295, 29897, 13, 13, 4706, 396, 916, 5285, 13, 4706, 1583, 29889, 16175, 29918, 2311, 353, 2295, 29889, 16175, 29918, 2311, 13, 4706, 1583, 29889, 29876, 29918, 20155, 29885, 29918, 24530, 353, 2295, 29889, 29876, 29918, 20155, 29885, 29918, 24530, 13, 4706, 1583, 29889, 6229, 29918, 14394, 353, 2295, 29889, 6229, 29918, 14394, 13, 4706, 1583, 29889, 6229, 29918, 19585, 353, 2295, 29889, 6229, 29918, 19585, 396, 29871, 29946, 29929, 334, 29871, 29946, 29929, 13, 4706, 1583, 29889, 6229, 29918, 19585, 29918, 20865, 353, 2295, 29889, 6229, 29918, 19585, 29918, 20865, 396, 29871, 29896, 29946, 334, 29871, 29896, 29946, 353, 29871, 29896, 29929, 29953, 13, 4706, 1583, 29889, 6229, 29918, 29883, 15755, 29918, 20865, 353, 29871, 29941, 29906, 13, 13, 4706, 1583, 29889, 11228, 29918, 21891, 29918, 10492, 353, 2295, 29889, 11228, 29918, 21891, 29918, 10492, 13, 4706, 1583, 29889, 21891, 29918, 10492, 29918, 7099, 388, 353, 2295, 29889, 21891, 29918, 10492, 29918, 7099, 388, 13, 4706, 1583, 29889, 3317, 29918, 5105, 29918, 12324, 353, 2295, 29889, 3317, 29918, 5105, 29918, 12324, 13, 13, 4706, 1583, 29889, 29887, 834, 331, 481, 29918, 3545, 353, 8707, 1254, 2190, 9375, 29889, 29887, 834, 331, 481, 29918, 3545, 396, 29871, 29955, 13, 4706, 1583, 29889, 29887, 834, 331, 481, 29918, 2103, 353, 8707, 1254, 2190, 9375, 29889, 29887, 834, 331, 481, 29918, 2103, 396, 29871, 29955, 13, 4706, 1583, 29889, 3027, 29918, 3545, 353, 8707, 1254, 2190, 9375, 29889, 3027, 29918, 3545, 13, 4706, 1583, 29889, 3027, 29918, 2103, 353, 8707, 1254, 2190, 9375, 29889, 3027, 29918, 2103, 13, 13, 4706, 396, 9788, 29892, 2048, 278, 1904, 322, 5994, 3950, 13, 4706, 1583, 29889, 4282, 29918, 4299, 580, 13, 4706, 396, 1311, 29889, 4282, 29918, 27959, 580, 13, 4706, 1583, 29889, 4282, 29918, 14968, 29918, 459, 580, 13, 4706, 1583, 29889, 7924, 29889, 3389, 29898, 13264, 29889, 24926, 29918, 497, 29918, 20897, 3101, 13, 13, 13, 2 ]
bspump/unittest/__init__.py
thatch/BitSwanPump
17
197200
from .pipeline import UnitTestPipeline from .sink import UnitTestSink from .source import UnitTestSource from .unit_test_case import ProcessorTestCase from .unit_test_case import TestCase __all__ = ( 'UnitTestPipeline', 'UnitTestSink', 'UnitTestSource', 'ProcessorTestCase', 'TestCase', )
[ 1, 515, 869, 13096, 5570, 1053, 13223, 3057, 29925, 23828, 13, 3166, 869, 29879, 682, 1053, 13223, 3057, 29903, 682, 13, 3166, 869, 4993, 1053, 13223, 3057, 4435, 13, 3166, 869, 5441, 29918, 1688, 29918, 4878, 1053, 10554, 272, 3057, 8259, 13, 3166, 869, 5441, 29918, 1688, 29918, 4878, 1053, 4321, 8259, 13, 13, 1649, 497, 1649, 353, 313, 13, 12, 29915, 8325, 3057, 29925, 23828, 742, 13, 12, 29915, 8325, 3057, 29903, 682, 742, 13, 12, 29915, 8325, 3057, 4435, 742, 13, 12, 29915, 18689, 3057, 8259, 742, 13, 12, 29915, 3057, 8259, 742, 13, 29897, 13, 2 ]
process_image_withTensorFlow.py
DimasVeliz/yolov4-deepsort
0
104743
<reponame>DimasVeliz/yolov4-deepsort import os import tensorflow as tf physical_devices = tf.config.experimental.list_physical_devices('GPU') if len(physical_devices) > 0: tf.config.experimental.set_memory_growth(physical_devices[0], True) from absl import app, flags, logging from absl.flags import FLAGS, Flag import core.utils as utils from core.yolov4 import filter_boxes from tensorflow.python.saved_model import tag_constants from core.config import cfg from PIL import Image import cv2 import numpy as np import matplotlib.pyplot as plt from tensorflow.compat.v1 import ConfigProto from tensorflow.compat.v1 import InteractiveSession flags.DEFINE_string('framework', 'tf', '(tf, tflite, trt') flags.DEFINE_string('weights', './checkpoints/yolov4-416','path to weights file') flags.DEFINE_integer('size', 416, 'resize images to') flags.DEFINE_boolean('tiny', False, 'yolo or yolo-tiny') flags.DEFINE_string('model', 'yolov4', 'yolov3 or yolov4') flags.DEFINE_float('iou', 0.45, 'iou threshold') flags.DEFINE_float('score', 0.50, 'score threshold') flags.DEFINE_boolean('dont_show', False, 'dont show image output') def buildObjectDetected(class_id, confidence, x, y, x_plus_w, y_plus_h, classes): label = str(classes[class_id]) obj={ } obj["class"]=label obj["confidence"]=confidence obj["x"]=x obj["y"]=y obj["height"]=y_plus_h obj["width"]=x_plus_w return obj def do_image_processing(imagePath,saved_model_loaded,infer,STRIDES, ANCHORS, NUM_CLASS, XYSCALE,input_size): frame = cv2.imread(imagePath) frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) image = Image.fromarray(frame) frame_size = frame.shape[:2] image_data = cv2.resize(frame, (input_size, input_size)) image_data = image_data / 255. image_data = image_data[np.newaxis, ...].astype(np.float32) batch_data = tf.constant(image_data) pred_bbox = infer(batch_data) for key, value in pred_bbox.items(): boxes = value[:, :, 0:4] pred_conf = value[:, :, 4:] boxes, scores, classes, valid_detections = tf.image.combined_non_max_suppression( boxes=tf.reshape(boxes, (tf.shape(boxes)[0], -1, 1, 4)), scores=tf.reshape( pred_conf, (tf.shape(pred_conf)[0], -1, tf.shape(pred_conf)[-1])), max_output_size_per_class=50, max_total_size=50, iou_threshold=FLAGS.iou, score_threshold=FLAGS.score ) # convert data to numpy arrays and slice out unused elements num_objects = valid_detections.numpy()[0] bboxes = boxes.numpy()[0] bboxes = bboxes[0:int(num_objects)] scores = scores.numpy()[0] scores = scores[0:int(num_objects)] classes = classes.numpy()[0] classes = classes[0:int(num_objects)] # format bounding boxes from normalized ymin, xmin, ymax, xmax ---> xmin, ymin, width, height original_h, original_w, _ = frame.shape bboxes = utils.format_boxes(bboxes, original_h, original_w) # store all predictions in one parameter for simplicity when calling functions pred_bbox = [bboxes, scores, classes, num_objects] # read in all class names from config class_names = utils.read_class_names(cfg.YOLO.CLASSES) # by default allow all classes in .names file allowed_classes = list(class_names.values()) # custom allowed classes (uncomment line below to customize tracker for only people) #allowed_classes = ['person'] # loop through objects and use class index to get class name, allow only classes in allowed_classes list names = [] deleted_indx = [] for i in range(num_objects): class_indx = int(classes[i]) class_name = class_names[class_indx] if class_name not in allowed_classes: deleted_indx.append(i) else: names.append(class_name) names = np.array(names) count = len(names) # delete detections that are not in allowed_classes bboxes = np.delete(bboxes, deleted_indx, axis=0) scores = np.delete(scores, deleted_indx, axis=0) response=[] for index in range(len(classes)): class_name=class_names[classes[index]] bbox=bboxes[index] col=int(bbox[0]) row=int(bbox[1]) width=col+int(bbox[2]) heigth=row+ int(bbox[3]) newObj=buildObjectDetected(classes[index], scores[i], col, row, width, heigth, class_names) response.append(newObj) #cv2.rectangle(frame, (col,row), (width, heigth), (255,0,255), 2) #cv2.putText(frame, class_name,(int(bbox[0]), int(bbox[1]-10)),0, 0.75, (255,255,255),2) #result = np.asarray(frame) #result = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR) #if not FLAGS.dont_show: #cv2.imshow("Output Video", result) # #if cv2.waitKey(0) & 0xFF == ord('q'): #cv2.destroyAllWindows() #return return response def configure(_argv): # load configuration for object detector config = ConfigProto() config.gpu_options.allow_growth = True session = InteractiveSession(config=config) STRIDES, ANCHORS, NUM_CLASS, XYSCALE = utils.load_config(FLAGS) input_size = FLAGS.size # load standard tensorflow saved model saved_model_loaded = tf.saved_model.load(FLAGS.weights, tags=[tag_constants.SERVING]) infer = saved_model_loaded.signatures['serving_default'] return saved_model_loaded,infer,input_size,STRIDES, ANCHORS, NUM_CLASS, XYSCALE def main(_argv): FLAGS.weights= "./checkpoints/yolov4-tiny-416" FLAGS.model="yolov4" FLAGS.tiny =True saved_model_loaded,infer,input_size,STRIDES, ANCHORS, NUM_CLASS, XYSCALE =configure([]) imagePath="./data/testImage.jpg" response =do_image_processing(imagePath,saved_model_loaded,infer,STRIDES, ANCHORS, NUM_CLASS, XYSCALE,input_size) print(response) if __name__ == '__main__': try: app.run(main) except SystemExit: pass
[ 1, 529, 276, 1112, 420, 29958, 16142, 294, 29963, 295, 466, 29914, 29891, 324, 586, 29946, 29899, 311, 8961, 441, 13, 5215, 2897, 13, 5215, 26110, 408, 15886, 13, 14017, 936, 29918, 3359, 1575, 353, 15886, 29889, 2917, 29889, 735, 27910, 29889, 1761, 29918, 14017, 936, 29918, 3359, 1575, 877, 29954, 7056, 1495, 13, 361, 7431, 29898, 14017, 936, 29918, 3359, 1575, 29897, 1405, 29871, 29900, 29901, 13, 1678, 15886, 29889, 2917, 29889, 735, 27910, 29889, 842, 29918, 14834, 29918, 29887, 798, 386, 29898, 14017, 936, 29918, 3359, 1575, 29961, 29900, 1402, 5852, 29897, 13, 3166, 633, 2536, 1053, 623, 29892, 13449, 29892, 12183, 13, 3166, 633, 2536, 29889, 15764, 1053, 383, 4375, 10749, 29892, 28697, 13, 5215, 7136, 29889, 13239, 408, 3667, 29879, 13, 3166, 7136, 29889, 29891, 324, 586, 29946, 1053, 4175, 29918, 1884, 267, 13, 3166, 26110, 29889, 4691, 29889, 17314, 29918, 4299, 1053, 4055, 29918, 3075, 1934, 13, 3166, 7136, 29889, 2917, 1053, 274, 16434, 13, 3166, 349, 6227, 1053, 7084, 13, 5215, 13850, 29906, 13, 5215, 12655, 408, 7442, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 26110, 29889, 12667, 29889, 29894, 29896, 1053, 12782, 1184, 517, 13, 3166, 26110, 29889, 12667, 29889, 29894, 29896, 1053, 4124, 4925, 7317, 13, 13, 13, 13, 15764, 29889, 24405, 8895, 29918, 1807, 877, 4468, 742, 525, 13264, 742, 525, 29898, 13264, 29892, 260, 1579, 568, 29892, 534, 29873, 1495, 13, 15764, 29889, 24405, 8895, 29918, 1807, 877, 705, 5861, 742, 19283, 3198, 9748, 29914, 29891, 324, 586, 29946, 29899, 29946, 29896, 29953, 3788, 2084, 304, 18177, 934, 1495, 13, 15764, 29889, 24405, 8895, 29918, 16031, 877, 2311, 742, 29871, 29946, 29896, 29953, 29892, 525, 21476, 4558, 304, 1495, 13, 15764, 29889, 24405, 8895, 29918, 20054, 877, 25649, 742, 7700, 29892, 525, 29891, 3543, 470, 343, 3543, 29899, 25649, 1495, 13, 15764, 29889, 24405, 8895, 29918, 1807, 877, 4299, 742, 525, 29891, 324, 586, 29946, 742, 525, 29891, 324, 586, 29941, 470, 343, 324, 586, 29946, 1495, 13, 13, 13, 15764, 29889, 24405, 8895, 29918, 7411, 877, 29875, 283, 742, 29871, 29900, 29889, 29946, 29945, 29892, 525, 29875, 283, 16897, 1495, 13, 15764, 29889, 24405, 8895, 29918, 7411, 877, 13628, 742, 29871, 29900, 29889, 29945, 29900, 29892, 525, 13628, 16897, 1495, 13, 15764, 29889, 24405, 8895, 29918, 20054, 877, 29881, 609, 29918, 4294, 742, 7700, 29892, 525, 29881, 609, 1510, 1967, 1962, 1495, 13, 13, 13, 1753, 2048, 2061, 6362, 26458, 29898, 1990, 29918, 333, 29892, 16420, 29892, 921, 29892, 343, 29892, 921, 29918, 11242, 29918, 29893, 29892, 343, 29918, 11242, 29918, 29882, 29892, 4413, 1125, 13, 1678, 3858, 353, 851, 29898, 13203, 29961, 1990, 29918, 333, 2314, 13, 1678, 5446, 3790, 1678, 500, 13, 1678, 5446, 3366, 1990, 3108, 29922, 1643, 13, 1678, 5446, 3366, 5527, 5084, 3108, 29922, 5527, 5084, 13, 1678, 5446, 3366, 29916, 3108, 29922, 29916, 13, 1678, 5446, 3366, 29891, 3108, 29922, 29891, 13, 1678, 5446, 3366, 3545, 3108, 29922, 29891, 29918, 11242, 29918, 29882, 13, 1678, 5446, 3366, 2103, 3108, 29922, 29916, 29918, 11242, 29918, 29893, 13, 13, 13, 1678, 736, 5446, 13, 13, 1753, 437, 29918, 3027, 29918, 19170, 29898, 3027, 2605, 29892, 17314, 29918, 4299, 29918, 15638, 29892, 262, 571, 29892, 10810, 1367, 2890, 29892, 13764, 3210, 24125, 29892, 28019, 29918, 13875, 1799, 29892, 1060, 21554, 5454, 1307, 29892, 2080, 29918, 2311, 1125, 13, 13, 268, 13, 13, 1678, 3515, 353, 13850, 29906, 29889, 326, 949, 29898, 3027, 2605, 29897, 13, 1678, 3515, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2557, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 29933, 14345, 29906, 28212, 29897, 13, 1678, 1967, 353, 7084, 29889, 3166, 2378, 29898, 2557, 29897, 13, 13, 1678, 3515, 29918, 2311, 353, 3515, 29889, 12181, 7503, 29906, 29962, 13, 1678, 1967, 29918, 1272, 353, 13850, 29906, 29889, 21476, 29898, 2557, 29892, 313, 2080, 29918, 2311, 29892, 1881, 29918, 2311, 876, 13, 1678, 1967, 29918, 1272, 353, 1967, 29918, 1272, 847, 29871, 29906, 29945, 29945, 29889, 13, 1678, 1967, 29918, 1272, 353, 1967, 29918, 1272, 29961, 9302, 29889, 1482, 8990, 29892, 2023, 1822, 579, 668, 29898, 9302, 29889, 7411, 29941, 29906, 29897, 13, 268, 13, 268, 13, 1678, 9853, 29918, 1272, 353, 15886, 29889, 23362, 29898, 3027, 29918, 1272, 29897, 13, 1678, 4450, 29918, 29890, 1884, 353, 10115, 29898, 16175, 29918, 1272, 29897, 13, 1678, 363, 1820, 29892, 995, 297, 4450, 29918, 29890, 1884, 29889, 7076, 7295, 13, 4706, 16273, 353, 995, 7503, 29892, 584, 29892, 29871, 29900, 29901, 29946, 29962, 13, 4706, 4450, 29918, 5527, 353, 995, 7503, 29892, 584, 29892, 29871, 29946, 17531, 13, 13, 1678, 16273, 29892, 19435, 29892, 4413, 29892, 2854, 29918, 29881, 2650, 1953, 353, 15886, 29889, 3027, 29889, 17743, 1312, 29918, 5464, 29918, 3317, 29918, 19303, 23881, 29898, 13, 4706, 16273, 29922, 13264, 29889, 690, 14443, 29898, 1884, 267, 29892, 313, 13264, 29889, 12181, 29898, 1884, 267, 9601, 29900, 1402, 448, 29896, 29892, 29871, 29896, 29892, 29871, 29946, 8243, 13, 4706, 19435, 29922, 13264, 29889, 690, 14443, 29898, 13, 9651, 4450, 29918, 5527, 29892, 313, 13264, 29889, 12181, 29898, 11965, 29918, 5527, 9601, 29900, 1402, 448, 29896, 29892, 15886, 29889, 12181, 29898, 11965, 29918, 5527, 9601, 29899, 29896, 2314, 511, 13, 4706, 4236, 29918, 4905, 29918, 2311, 29918, 546, 29918, 1990, 29922, 29945, 29900, 29892, 13, 4706, 4236, 29918, 7827, 29918, 2311, 29922, 29945, 29900, 29892, 13, 4706, 474, 283, 29918, 386, 12268, 29922, 18823, 10749, 29889, 29875, 283, 29892, 13, 4706, 8158, 29918, 386, 12268, 29922, 18823, 10749, 29889, 13628, 13, 1678, 1723, 13, 268, 13, 1678, 396, 3588, 848, 304, 12655, 7049, 322, 22780, 714, 443, 3880, 3161, 13, 1678, 954, 29918, 12650, 353, 2854, 29918, 29881, 2650, 1953, 29889, 23749, 580, 29961, 29900, 29962, 13, 1678, 289, 1884, 267, 353, 16273, 29889, 23749, 580, 29961, 29900, 29962, 13, 1678, 289, 1884, 267, 353, 289, 1884, 267, 29961, 29900, 29901, 524, 29898, 1949, 29918, 12650, 4638, 13, 1678, 19435, 353, 19435, 29889, 23749, 580, 29961, 29900, 29962, 13, 1678, 19435, 353, 19435, 29961, 29900, 29901, 524, 29898, 1949, 29918, 12650, 4638, 13, 1678, 4413, 353, 4413, 29889, 23749, 580, 29961, 29900, 29962, 13, 1678, 4413, 353, 4413, 29961, 29900, 29901, 524, 29898, 1949, 29918, 12650, 4638, 13, 13, 1678, 396, 3402, 3216, 292, 16273, 515, 4226, 1891, 343, 1195, 29892, 921, 1195, 29892, 343, 3317, 29892, 921, 3317, 11474, 29958, 921, 1195, 29892, 343, 1195, 29892, 2920, 29892, 3171, 13, 1678, 2441, 29918, 29882, 29892, 2441, 29918, 29893, 29892, 903, 353, 3515, 29889, 12181, 13, 1678, 289, 1884, 267, 353, 3667, 29879, 29889, 4830, 29918, 1884, 267, 29898, 29890, 1884, 267, 29892, 2441, 29918, 29882, 29892, 2441, 29918, 29893, 29897, 13, 268, 13, 1678, 396, 3787, 599, 27303, 297, 697, 3443, 363, 23205, 746, 5432, 3168, 13, 1678, 4450, 29918, 29890, 1884, 353, 518, 29890, 1884, 267, 29892, 19435, 29892, 4413, 29892, 954, 29918, 12650, 29962, 13, 268, 13, 1678, 396, 1303, 297, 599, 770, 2983, 515, 2295, 13, 1678, 770, 29918, 7039, 353, 3667, 29879, 29889, 949, 29918, 1990, 29918, 7039, 29898, 16859, 29889, 29979, 29949, 3927, 29889, 6154, 3289, 1660, 29903, 29897, 13, 268, 13, 1678, 396, 491, 2322, 2758, 599, 4413, 297, 869, 7039, 934, 13, 1678, 6068, 29918, 13203, 353, 1051, 29898, 1990, 29918, 7039, 29889, 5975, 3101, 308, 13, 268, 13, 1678, 396, 2888, 6068, 4413, 313, 348, 9342, 1196, 2400, 304, 2888, 675, 1020, 4937, 363, 871, 2305, 29897, 13, 1678, 396, 24622, 29918, 13203, 353, 6024, 10532, 2033, 13, 1678, 396, 2425, 1549, 3618, 322, 671, 770, 2380, 304, 679, 770, 1024, 29892, 2758, 871, 4413, 297, 6068, 29918, 13203, 1051, 13, 1678, 2983, 353, 5159, 13, 1678, 11132, 29918, 513, 29916, 353, 5159, 13, 1678, 363, 474, 297, 3464, 29898, 1949, 29918, 12650, 1125, 13, 4706, 770, 29918, 513, 29916, 353, 938, 29898, 13203, 29961, 29875, 2314, 13, 4706, 770, 29918, 978, 353, 770, 29918, 7039, 29961, 1990, 29918, 513, 29916, 29962, 13, 4706, 565, 770, 29918, 978, 451, 297, 6068, 29918, 13203, 29901, 13, 9651, 11132, 29918, 513, 29916, 29889, 4397, 29898, 29875, 29897, 13, 4706, 1683, 29901, 13, 9651, 2983, 29889, 4397, 29898, 1990, 29918, 978, 29897, 13, 1678, 2983, 353, 7442, 29889, 2378, 29898, 7039, 29897, 13, 1678, 2302, 353, 7431, 29898, 7039, 29897, 13, 268, 13, 1678, 396, 5217, 1439, 29872, 1953, 393, 526, 451, 297, 6068, 29918, 13203, 13, 1678, 289, 1884, 267, 353, 7442, 29889, 8143, 29898, 29890, 1884, 267, 29892, 11132, 29918, 513, 29916, 29892, 9685, 29922, 29900, 29897, 13, 1678, 19435, 353, 7442, 29889, 8143, 29898, 1557, 2361, 29892, 11132, 29918, 513, 29916, 29892, 9685, 29922, 29900, 29897, 13, 13, 268, 13, 1678, 2933, 29922, 2636, 13, 268, 13, 13, 1678, 363, 2380, 297, 3464, 29898, 2435, 29898, 13203, 22164, 13, 4706, 770, 29918, 978, 29922, 1990, 29918, 7039, 29961, 13203, 29961, 2248, 5262, 13, 4706, 289, 1884, 29922, 29890, 1884, 267, 29961, 2248, 29962, 13, 4706, 784, 29922, 524, 29898, 29890, 1884, 29961, 29900, 2314, 13, 4706, 1948, 29922, 524, 29898, 29890, 1884, 29961, 29896, 2314, 13, 4706, 2920, 29922, 1054, 29974, 524, 29898, 29890, 1884, 29961, 29906, 2314, 13, 4706, 540, 335, 386, 29922, 798, 29974, 938, 29898, 29890, 1884, 29961, 29941, 2314, 13, 4706, 716, 9930, 29922, 4282, 2061, 6362, 26458, 29898, 13203, 29961, 2248, 1402, 19435, 29961, 29875, 1402, 784, 29892, 1948, 29892, 2920, 29892, 540, 335, 386, 29892, 770, 29918, 7039, 29897, 13, 4706, 2933, 29889, 4397, 29898, 1482, 9930, 29897, 13, 4706, 396, 11023, 29906, 29889, 1621, 2521, 29898, 2557, 29892, 313, 1054, 29892, 798, 511, 313, 2103, 29892, 540, 335, 386, 511, 313, 29906, 29945, 29945, 29892, 29900, 29892, 29906, 29945, 29945, 511, 29871, 29906, 29897, 13, 418, 13, 4706, 396, 11023, 29906, 29889, 649, 1626, 29898, 2557, 29892, 770, 29918, 978, 22657, 524, 29898, 29890, 1884, 29961, 29900, 11724, 938, 29898, 29890, 1884, 29961, 29896, 29962, 29899, 29896, 29900, 8243, 29900, 29892, 29871, 29900, 29889, 29955, 29945, 29892, 313, 29906, 29945, 29945, 29892, 29906, 29945, 29945, 29892, 29906, 29945, 29945, 511, 29906, 29897, 13, 268, 13, 1678, 396, 2914, 353, 7442, 29889, 294, 2378, 29898, 2557, 29897, 13, 1678, 396, 2914, 353, 13850, 29906, 29889, 11023, 29873, 3306, 29898, 2557, 29892, 13850, 29906, 29889, 15032, 1955, 29918, 28212, 29906, 29933, 14345, 29897, 13, 268, 13, 1678, 396, 361, 451, 383, 4375, 10749, 29889, 29881, 609, 29918, 4294, 29901, 13, 4706, 396, 11023, 29906, 29889, 326, 4294, 703, 6466, 13987, 613, 1121, 29897, 308, 13, 29937, 268, 13, 1678, 396, 361, 13850, 29906, 29889, 10685, 2558, 29898, 29900, 29897, 669, 29871, 29900, 29916, 4198, 1275, 4356, 877, 29939, 29374, 29871, 13, 4706, 396, 11023, 29906, 29889, 20524, 3596, 7685, 580, 13, 4706, 396, 2457, 13, 268, 13, 1678, 736, 2933, 13, 308, 13, 1753, 10822, 7373, 19218, 1125, 13, 13, 1678, 396, 2254, 5285, 363, 1203, 1439, 3019, 13, 1678, 2295, 353, 12782, 1184, 517, 580, 13, 1678, 2295, 29889, 29887, 3746, 29918, 6768, 29889, 9536, 29918, 29887, 798, 386, 353, 5852, 13, 1678, 4867, 353, 4124, 4925, 7317, 29898, 2917, 29922, 2917, 29897, 13, 1678, 29486, 1367, 2890, 29892, 13764, 3210, 24125, 29892, 28019, 29918, 13875, 1799, 29892, 1060, 21554, 5454, 1307, 353, 3667, 29879, 29889, 1359, 29918, 2917, 29898, 18823, 10749, 29897, 13, 1678, 1881, 29918, 2311, 353, 383, 4375, 10749, 29889, 2311, 13, 268, 13, 13, 1678, 13, 1678, 396, 2254, 3918, 26110, 7160, 1904, 13, 1678, 7160, 29918, 4299, 29918, 15638, 353, 15886, 29889, 17314, 29918, 4299, 29889, 1359, 29898, 18823, 10749, 29889, 705, 5861, 29892, 8282, 11759, 4039, 29918, 3075, 1934, 29889, 6304, 29963, 4214, 2314, 13, 1678, 10115, 353, 7160, 29918, 4299, 29918, 15638, 29889, 4530, 3698, 1839, 643, 1747, 29918, 4381, 2033, 13, 13, 1678, 736, 7160, 29918, 4299, 29918, 15638, 29892, 262, 571, 29892, 2080, 29918, 2311, 29892, 10810, 1367, 2890, 29892, 13764, 3210, 24125, 29892, 28019, 29918, 13875, 1799, 29892, 1060, 21554, 5454, 1307, 13, 268, 13, 13, 1753, 1667, 7373, 19218, 1125, 13, 268, 13, 1678, 383, 4375, 10749, 29889, 705, 5861, 29922, 376, 6904, 3198, 9748, 29914, 29891, 324, 586, 29946, 29899, 25649, 29899, 29946, 29896, 29953, 29908, 13, 1678, 383, 4375, 10749, 29889, 4299, 543, 29891, 324, 586, 29946, 29908, 13, 1678, 383, 4375, 10749, 29889, 25649, 353, 5574, 13, 268, 13, 13, 1678, 7160, 29918, 4299, 29918, 15638, 29892, 262, 571, 29892, 2080, 29918, 2311, 29892, 10810, 1367, 2890, 29892, 13764, 3210, 24125, 29892, 28019, 29918, 13875, 1799, 29892, 1060, 21554, 5454, 1307, 353, 17591, 4197, 2314, 13, 1678, 1967, 2605, 543, 6904, 1272, 29914, 1688, 2940, 29889, 6173, 29908, 13, 1678, 2933, 353, 1867, 29918, 3027, 29918, 19170, 29898, 3027, 2605, 29892, 17314, 29918, 4299, 29918, 15638, 29892, 262, 571, 29892, 10810, 1367, 2890, 29892, 13764, 3210, 24125, 29892, 28019, 29918, 13875, 1799, 29892, 1060, 21554, 5454, 1307, 29892, 2080, 29918, 2311, 29897, 13, 13, 1678, 1596, 29898, 5327, 29897, 13, 13, 361, 4770, 978, 1649, 1275, 525, 1649, 3396, 1649, 2396, 13, 1678, 1018, 29901, 13, 4706, 623, 29889, 3389, 29898, 3396, 29897, 13, 1678, 5174, 2184, 24365, 29901, 13, 4706, 1209, 2 ]
dataset.py
donghankim/comma_ai_speed_challenge
0
19007
import os import pandas as pd import numpy as np import torch from torchvision import transforms from torch.utils.data import Dataset import matplotlib.pyplot as plt from skimage import io import pdb class FrameDataset(Dataset): def __init__(self, csv_file, train_dir): self.labels = pd.read_csv(csv_file) self.train_dir = train_dir self.transform = transforms.Compose([ transforms.ToPILImage(), transforms.Resize((66,220)), transforms.ToTensor(), transforms.Normalize(mean = [0.485, 0.456, 0.406], std = [0.229, 0.224, 0.225]), ]) def show_img(self, img, denormalize = True): inv_normalize = transforms.Normalize(mean=[-0.485/0.229, -0.456/0.224, -0.406/0.225], std=[1/0.229, 1/0.224, 1/0.225]) if denormalize: img = inv_normalize(img) plt.imshow(np.transpose(img.numpy(), (1,2,0))) plt.show() def __len__(self): return len(self.labels) def __getitem__(self, index): img_path = os.path.join(self.train_dir, self.labels.iloc[index][0]) image = io.imread(img_path) y_label = torch.tensor(float(self.labels.iloc[index][1])) if self.transform: image = self.transform(image) return (image, y_label)
[ 1, 1053, 2897, 13, 5215, 11701, 408, 10518, 13, 5215, 12655, 408, 7442, 13, 5215, 4842, 305, 13, 3166, 4842, 305, 4924, 1053, 4327, 29879, 13, 3166, 4842, 305, 29889, 13239, 29889, 1272, 1053, 13373, 24541, 13, 5215, 22889, 29889, 2272, 5317, 408, 14770, 13, 3166, 2071, 3027, 1053, 12013, 13, 5215, 282, 2585, 13, 13, 1990, 12218, 16390, 24541, 29898, 16390, 24541, 1125, 13, 1678, 822, 4770, 2344, 12035, 1311, 29892, 11799, 29918, 1445, 29892, 7945, 29918, 3972, 1125, 13, 4706, 1583, 29889, 21134, 353, 10518, 29889, 949, 29918, 7638, 29898, 7638, 29918, 1445, 29897, 13, 4706, 1583, 29889, 14968, 29918, 3972, 353, 7945, 29918, 3972, 13, 4706, 1583, 29889, 9067, 353, 4327, 29879, 29889, 1523, 4220, 4197, 13, 9651, 4327, 29879, 29889, 1762, 2227, 29931, 2940, 3285, 13, 9651, 4327, 29879, 29889, 1666, 675, 3552, 29953, 29953, 29892, 29906, 29906, 29900, 8243, 13, 9651, 4327, 29879, 29889, 1762, 29911, 6073, 3285, 13, 9651, 4327, 29879, 29889, 19077, 675, 29898, 12676, 353, 518, 29900, 29889, 29946, 29947, 29945, 29892, 29871, 29900, 29889, 29946, 29945, 29953, 29892, 29871, 29900, 29889, 29946, 29900, 29953, 1402, 3659, 353, 518, 29900, 29889, 29906, 29906, 29929, 29892, 29871, 29900, 29889, 29906, 29906, 29946, 29892, 29871, 29900, 29889, 29906, 29906, 29945, 11724, 13, 632, 2314, 13, 13, 1678, 822, 1510, 29918, 2492, 29898, 1311, 29892, 10153, 29892, 972, 2759, 675, 353, 5852, 1125, 13, 4706, 2437, 29918, 8945, 675, 353, 4327, 29879, 29889, 19077, 675, 29898, 12676, 11759, 29899, 29900, 29889, 29946, 29947, 29945, 29914, 29900, 29889, 29906, 29906, 29929, 29892, 448, 29900, 29889, 29946, 29945, 29953, 29914, 29900, 29889, 29906, 29906, 29946, 29892, 448, 29900, 29889, 29946, 29900, 29953, 29914, 29900, 29889, 29906, 29906, 29945, 1402, 3659, 11759, 29896, 29914, 29900, 29889, 29906, 29906, 29929, 29892, 29871, 29896, 29914, 29900, 29889, 29906, 29906, 29946, 29892, 29871, 29896, 29914, 29900, 29889, 29906, 29906, 29945, 2314, 13, 4706, 565, 972, 2759, 675, 29901, 13, 9651, 10153, 353, 2437, 29918, 8945, 675, 29898, 2492, 29897, 13, 13, 4706, 14770, 29889, 326, 4294, 29898, 9302, 29889, 3286, 4220, 29898, 2492, 29889, 23749, 3285, 313, 29896, 29892, 29906, 29892, 29900, 4961, 13, 4706, 14770, 29889, 4294, 580, 13, 13, 1678, 822, 4770, 2435, 12035, 1311, 1125, 13, 4706, 736, 7431, 29898, 1311, 29889, 21134, 29897, 13, 13, 1678, 822, 4770, 657, 667, 12035, 1311, 29892, 2380, 1125, 13, 4706, 10153, 29918, 2084, 353, 2897, 29889, 2084, 29889, 7122, 29898, 1311, 29889, 14968, 29918, 3972, 29892, 1583, 29889, 21134, 29889, 309, 542, 29961, 2248, 3816, 29900, 2314, 13, 4706, 1967, 353, 12013, 29889, 326, 949, 29898, 2492, 29918, 2084, 29897, 13, 4706, 343, 29918, 1643, 353, 4842, 305, 29889, 20158, 29898, 7411, 29898, 1311, 29889, 21134, 29889, 309, 542, 29961, 2248, 3816, 29896, 12622, 13, 13, 4706, 565, 1583, 29889, 9067, 29901, 13, 9651, 1967, 353, 1583, 29889, 9067, 29898, 3027, 29897, 13, 13, 4706, 736, 313, 3027, 29892, 343, 29918, 1643, 29897, 13, 13, 13, 13, 13, 2 ]
Python3.01.06.py
MrMontag/python_test
0
178067
<gh_stars>0 import os print("Hallo, ich habe 5 Fragen an Sie. Sie können zwischen den Fragen wählen.") punkte=0 while True: print("Geben Sie die Nummer der gewünschten Frage ein.") print("Geben Sie STOP ein, wenn Sie das Programm verlassen möchten.") nummer=input() if nummer.upper()=="STOP": print("Sie haben "+str(punkte)+" Punkt(e) erreicht.") os.system("pause") break elif nummer.isalpha() or int(nummer)>5 or int(nummer)<1: print("Es muss eine Nummer von 1 bis 5 sein!") elif nummer.lower=="ok": print("Sie haben noch einen Versuch! (Glaube ich...") else: if int(nummer)==1: print("Was ist 1+1?") print("A: 4\nB: 2\nC: 9") print("Gebe nun A, B oder C als Antwort ein.") buchstabe1=input() if buchstabe1=="A" or buchstabe1=="C": print("Falsch!") elif buchstabe1=="B": print("Richtig!") punkte+=1 else: print("Benutzen Sie einen gültigen Buchstaben! Zur Strafe müssen Sie von vorne anfangen.") if int(nummer)==2: print("Wo steht der Eifelturm von Pisa?") print("A: in Pisa\nB: in Paris\nC: Hahahahahaha!!!") print("Gebe nun A, B oder C als Antwort ein.") buchstabe2=input() if buchstabe2=="A" or buchstabe2=="B": print("Falsch!") elif buchstabe2=="C": print("Richtig!") punkte+=1 else: print("Benutzen Sie einen gültigen Buchstaben! Zur Strafe müssen Sie von vorne anfangen.") if int(nummer)==3: print("lst in diesem Satz etwas falsch geschrieben?") print("J: Ja"+"\n"+"N: Nein") print("Gebe nun J oder N als Antwort ein.") buchstabe3=input() if buchstabe3=="N": print("Falsch!") elif buchstabe3=="J": print("Richtig!") punkte+=1 else: print("Benutzen Sie einen gültigen Buchstaben! Zur Strafe müssen Sie von vorne anfangen.") if int(nummer)==4: print("Welche Aussage ist falsch?") print("A:Keine"+"\n"+"B:Ich kann lesen"+"\n"+"C:Es gibt eine") print("Gebe nun A, B oder C als Antwort ein.") buchstabe4=input() if buchstabe4=="B" or buchstabe4=="C": print("Falsch!") elif buchstabe4=="A": print("Richtig!") punkte+=1 else: print("Benutzen Sie einen gültigen Buchstaben! Zur Strafe müssen Sie von vorne anfangen.") if int(nummer)==5: print("Ein Würfel ist rund.") print("J: Ja"+"\n"+"N: Nein") print("Gebe nun J oder N als Antwort ein.") buchstabe5=input() if buchstabe5=="J": print("Falsch!") elif buchstabe5=="N": print("Richtig!") punkte+=1 else: print("Benutzen Sie einen gültigen Buchstaben! Zur Strafe müssen Sie von vorne anfangen.")
[ 1, 529, 12443, 29918, 303, 1503, 29958, 29900, 13, 5215, 2897, 13, 13, 2158, 703, 29950, 26177, 29892, 7975, 19221, 29871, 29945, 383, 12702, 385, 4073, 29889, 4073, 12238, 7831, 972, 383, 12702, 281, 7538, 2435, 23157, 13, 29886, 2960, 371, 29922, 29900, 13, 8000, 5852, 29901, 13, 1678, 1596, 703, 29954, 5154, 4073, 762, 11848, 1050, 589, 5247, 3346, 816, 841, 383, 6617, 1011, 23157, 13, 1678, 1596, 703, 29954, 5154, 4073, 6850, 4590, 1011, 29892, 13588, 4073, 1697, 7835, 29885, 1147, 19146, 286, 29997, 12385, 23157, 13, 1678, 954, 1050, 29922, 2080, 580, 13, 1678, 565, 954, 1050, 29889, 21064, 580, 26359, 1254, 4590, 1115, 13, 4706, 1596, 703, 29903, 347, 10290, 15691, 710, 29898, 29886, 2960, 371, 7240, 29908, 349, 11087, 29898, 29872, 29897, 13930, 1428, 23157, 13, 4706, 2897, 29889, 5205, 703, 29886, 1071, 1159, 13, 4706, 2867, 13, 1678, 25342, 954, 1050, 29889, 275, 2312, 580, 470, 938, 29898, 1949, 1050, 15410, 29945, 470, 938, 29898, 1949, 1050, 29897, 29966, 29896, 29901, 13, 4706, 1596, 703, 14190, 23885, 2128, 11848, 1050, 1005, 29871, 29896, 2652, 29871, 29945, 2757, 29991, 1159, 13, 1678, 25342, 954, 1050, 29889, 13609, 26359, 554, 1115, 13, 4706, 1596, 703, 29903, 347, 10290, 5440, 4596, 10138, 987, 29991, 313, 29954, 433, 4003, 7975, 856, 1159, 13, 1678, 1683, 29901, 13, 4706, 565, 938, 29898, 1949, 1050, 29897, 1360, 29896, 29901, 13, 9651, 1596, 703, 29956, 294, 1752, 29871, 29896, 29974, 29896, 29973, 1159, 13, 9651, 1596, 703, 29909, 29901, 29871, 29946, 29905, 29876, 29933, 29901, 29871, 29906, 29905, 29876, 29907, 29901, 29871, 29929, 1159, 13, 9651, 1596, 703, 29954, 774, 29872, 11923, 319, 29892, 350, 4461, 315, 1620, 5459, 17572, 1011, 23157, 13, 9651, 289, 987, 303, 4302, 29896, 29922, 2080, 580, 13, 9651, 565, 289, 987, 303, 4302, 29896, 26359, 29909, 29908, 470, 289, 987, 303, 4302, 29896, 26359, 29907, 1115, 13, 18884, 1596, 703, 29943, 284, 816, 29991, 1159, 13, 9651, 25342, 289, 987, 303, 4302, 29896, 26359, 29933, 1115, 13, 18884, 1596, 703, 29934, 1428, 335, 29991, 1159, 13, 18884, 21356, 371, 23661, 29896, 13, 9651, 1683, 29901, 13, 18884, 1596, 703, 20841, 329, 2256, 4073, 4596, 330, 12100, 2101, 10586, 303, 12792, 29991, 16318, 7357, 1725, 286, 24789, 4073, 1005, 3764, 484, 385, 11363, 264, 23157, 13, 462, 13, 4706, 565, 938, 29898, 1949, 1050, 29897, 1360, 29906, 29901, 13, 9651, 1596, 703, 29956, 29877, 16324, 589, 382, 361, 2152, 17095, 1005, 349, 8069, 29973, 1159, 13, 9651, 1596, 703, 29909, 29901, 297, 349, 8069, 29905, 29876, 29933, 29901, 297, 3681, 29905, 29876, 29907, 29901, 379, 801, 801, 801, 801, 25613, 21004, 1159, 13, 9651, 1596, 703, 29954, 774, 29872, 11923, 319, 29892, 350, 4461, 315, 1620, 5459, 17572, 1011, 23157, 13, 9651, 289, 987, 303, 4302, 29906, 29922, 2080, 580, 13, 9651, 565, 289, 987, 303, 4302, 29906, 26359, 29909, 29908, 470, 289, 987, 303, 4302, 29906, 26359, 29933, 1115, 13, 18884, 1596, 703, 29943, 284, 816, 29991, 1159, 13, 9651, 25342, 289, 987, 303, 4302, 29906, 26359, 29907, 1115, 13, 18884, 1596, 703, 29934, 1428, 335, 29991, 1159, 13, 18884, 21356, 371, 23661, 29896, 13, 9651, 1683, 29901, 13, 18884, 1596, 703, 20841, 329, 2256, 4073, 4596, 330, 12100, 2101, 10586, 303, 12792, 29991, 16318, 7357, 1725, 286, 24789, 4073, 1005, 3764, 484, 385, 11363, 264, 23157, 13, 462, 13, 4706, 565, 938, 29898, 1949, 1050, 29897, 1360, 29941, 29901, 13, 9651, 1596, 703, 20155, 297, 12909, 317, 4101, 23452, 11092, 816, 8486, 16609, 29973, 1159, 13, 9651, 1596, 703, 29967, 29901, 14021, 29908, 13578, 29905, 29876, 29908, 13578, 29940, 29901, 2448, 262, 1159, 13, 9651, 1596, 703, 29954, 774, 29872, 11923, 435, 4461, 405, 1620, 5459, 17572, 1011, 23157, 13, 9651, 289, 987, 303, 4302, 29941, 29922, 2080, 580, 13, 9651, 565, 289, 987, 303, 4302, 29941, 26359, 29940, 1115, 13, 18884, 1596, 703, 29943, 284, 816, 29991, 1159, 13, 9651, 25342, 289, 987, 303, 4302, 29941, 26359, 29967, 1115, 13, 18884, 1596, 703, 29934, 1428, 335, 29991, 1159, 13, 18884, 21356, 371, 23661, 29896, 13, 9651, 1683, 29901, 13, 18884, 1596, 703, 20841, 329, 2256, 4073, 4596, 330, 12100, 2101, 10586, 303, 12792, 29991, 16318, 7357, 1725, 286, 24789, 4073, 1005, 3764, 484, 385, 11363, 264, 23157, 13, 462, 13, 4706, 565, 938, 29898, 1949, 1050, 29897, 1360, 29946, 29901, 13, 9651, 1596, 703, 28862, 1173, 319, 1558, 482, 1752, 11092, 816, 29973, 1159, 13, 9651, 1596, 703, 29909, 29901, 9598, 457, 29908, 13578, 29905, 29876, 29908, 13578, 29933, 29901, 29902, 305, 9083, 966, 264, 29908, 13578, 29905, 29876, 29908, 13578, 29907, 29901, 14190, 13456, 2128, 1159, 13, 9651, 1596, 703, 29954, 774, 29872, 11923, 319, 29892, 350, 4461, 315, 1620, 5459, 17572, 1011, 23157, 13, 9651, 289, 987, 303, 4302, 29946, 29922, 2080, 580, 13, 9651, 565, 289, 987, 303, 4302, 29946, 26359, 29933, 29908, 470, 289, 987, 303, 4302, 29946, 26359, 29907, 1115, 13, 18884, 1596, 703, 29943, 284, 816, 29991, 1159, 13, 9651, 25342, 289, 987, 303, 4302, 29946, 26359, 29909, 1115, 13, 18884, 1596, 703, 29934, 1428, 335, 29991, 1159, 13, 18884, 21356, 371, 23661, 29896, 13, 9651, 1683, 29901, 13, 18884, 1596, 703, 20841, 329, 2256, 4073, 4596, 330, 12100, 2101, 10586, 303, 12792, 29991, 16318, 7357, 1725, 286, 24789, 4073, 1005, 3764, 484, 385, 11363, 264, 23157, 13, 462, 13, 4706, 565, 938, 29898, 1949, 1050, 29897, 1360, 29945, 29901, 13, 9651, 1596, 703, 29923, 262, 21241, 13287, 1752, 17048, 23157, 13, 9651, 1596, 703, 29967, 29901, 14021, 29908, 13578, 29905, 29876, 29908, 13578, 29940, 29901, 2448, 262, 1159, 13, 9651, 1596, 703, 29954, 774, 29872, 11923, 435, 4461, 405, 1620, 5459, 17572, 1011, 23157, 13, 9651, 289, 987, 303, 4302, 29945, 29922, 2080, 580, 13, 9651, 565, 289, 987, 303, 4302, 29945, 26359, 29967, 1115, 13, 18884, 1596, 703, 29943, 284, 816, 29991, 1159, 13, 9651, 25342, 289, 987, 303, 4302, 29945, 26359, 29940, 1115, 13, 18884, 1596, 703, 29934, 1428, 335, 29991, 1159, 13, 18884, 21356, 371, 23661, 29896, 13, 9651, 1683, 29901, 13, 18884, 1596, 703, 20841, 329, 2256, 4073, 4596, 330, 12100, 2101, 10586, 303, 12792, 29991, 16318, 7357, 1725, 286, 24789, 4073, 1005, 3764, 484, 385, 11363, 264, 23157, 13, 462, 13, 462, 2 ]
bootstrap/p1.5.0/src/common/const.py
apurwaj2/df-on-k8s
0
5526
class Constants(object): LOGGER_CONF = "common/mapr_conf/logger.yml" USERNAME = "mapr" GROUPNAME = "mapr" USERID = 5000 GROUPID = 5000 ADMIN_USERNAME = "custadmin" ADMIN_GROUPNAME = "custadmin" ADMIN_USERID = 7000 ADMIN_GROUPID = 7000 ADMIN_PASS = "<PASSWORD>" MYSQL_USER = "admin" MYSQL_PASS = "<PASSWORD>" LDAPADMIN_USER = "admin" LDAPADMIN_PASS = "<PASSWORD>" LDAPBIND_USER = "readonly" LDAPBIND_PASS = "<PASSWORD>" EXAMPLE_LDAP_NAMESPACE = "hpe-ldap" CSI_REPO = "quay.io/k8scsi" KDF_REPO = "docker.io/maprtech" #registry.hub.docker.com/maprtech KUBEFLOW_REPO = "gcr.io/mapr-252711/kf-ecp-5.3.0" OPERATOR_REPO = "gcr.io/mapr-252711" KUBELET_DIR = "/var/lib/kubelet" ECP_KUBELET_DIR = "/var/lib/docker/kubelet" LOCAL_PATH_PROVISIONER_REPO= "" KFCTL_HSP_ISTIO_REPO = "" BUSYBOX_REPO = "" def enum(**named_values): return type('Enum', (), named_values) AUTH_TYPES = enum(CUSTOM_LDAP='customLDAP', RAW_LINUX_USERS='rawLinuxUsers', EXAMPLE_LDAP='exampleLDAP') # OPEN SSL OPENSSL = '/usr/bin/openssl' KEY_SIZE = 1024 DAYS = 3650 CA_CERT = 'ca.cert' CA_KEY = 'ca.key' # http://www.openssl.org/docs/apps/openssl.html#PASS_PHRASE_ARGUMENTS X509_EXTRA_ARGS = () OPENSSL_CONFIG_TEMPLATE = """ prompt = no distinguished_name = req_distinguished_name req_extensions = v3_req [ req_distinguished_name ] C = US ST = CO L = Fort Collins O = HPE OU = HCP CN = %(service)s emailAddress = <EMAIL> [ v3_req ] # Extensions to add to a certificate request basicConstraints = CA:FALSE keyUsage = nonRepudiation, digitalSignature, keyEncipherment subjectAltName = @alt_names [ alt_names ] DNS.1 = %(service)s DNS.2 = %(service)s.%(namespace)s DNS.3 = %(service)s.%(namespace)s.svc """
[ 1, 29871, 13, 1990, 5798, 1934, 29898, 3318, 1125, 13, 1678, 25401, 17070, 29918, 6007, 29943, 353, 376, 9435, 29914, 1958, 29878, 29918, 5527, 29914, 21707, 29889, 21053, 29908, 13, 1678, 3148, 1001, 5813, 353, 376, 1958, 29878, 29908, 13, 1678, 15345, 5813, 353, 376, 1958, 29878, 29908, 13, 1678, 3148, 1001, 1367, 353, 29871, 29945, 29900, 29900, 29900, 13, 1678, 15345, 1367, 353, 29871, 29945, 29900, 29900, 29900, 13, 1678, 11033, 16173, 29918, 11889, 5813, 353, 376, 29883, 504, 6406, 29908, 13, 1678, 11033, 16173, 29918, 26284, 5813, 353, 376, 29883, 504, 6406, 29908, 13, 1678, 11033, 16173, 29918, 11889, 1367, 353, 29871, 29955, 29900, 29900, 29900, 13, 1678, 11033, 16173, 29918, 26284, 1367, 353, 29871, 29955, 29900, 29900, 29900, 13, 1678, 11033, 16173, 29918, 25711, 353, 9872, 25711, 17013, 11903, 13, 1678, 19519, 4176, 29918, 11889, 353, 376, 6406, 29908, 13, 1678, 19519, 4176, 29918, 25711, 353, 9872, 25711, 17013, 11903, 13, 1678, 365, 29928, 3301, 3035, 16173, 29918, 11889, 353, 376, 6406, 29908, 13, 1678, 365, 29928, 3301, 3035, 16173, 29918, 25711, 353, 9872, 25711, 17013, 11903, 13, 1678, 365, 29928, 3301, 29933, 22255, 29918, 11889, 353, 376, 949, 6194, 29908, 13, 1678, 365, 29928, 3301, 29933, 22255, 29918, 25711, 353, 9872, 25711, 17013, 11903, 13, 1678, 8528, 19297, 1307, 29918, 10249, 3301, 29918, 5813, 5550, 11538, 353, 376, 29882, 412, 29899, 430, 481, 29908, 13, 1678, 315, 5425, 29918, 1525, 13152, 353, 376, 339, 388, 29889, 601, 29914, 29895, 29947, 1557, 1039, 29908, 13, 1678, 476, 4037, 29918, 1525, 13152, 353, 376, 14695, 29889, 601, 29914, 1958, 29878, 11345, 29908, 396, 1727, 6020, 29889, 29882, 431, 29889, 14695, 29889, 510, 29914, 1958, 29878, 11345, 13, 1678, 476, 7466, 29638, 27998, 29918, 1525, 13152, 353, 376, 29887, 7283, 29889, 601, 29914, 1958, 29878, 29899, 29906, 29945, 29906, 29955, 29896, 29896, 29914, 29895, 29888, 29899, 687, 29886, 29899, 29945, 29889, 29941, 29889, 29900, 29908, 13, 1678, 6418, 1001, 1299, 1955, 29918, 1525, 13152, 353, 376, 29887, 7283, 29889, 601, 29914, 1958, 29878, 29899, 29906, 29945, 29906, 29955, 29896, 29896, 29908, 13, 1678, 476, 7466, 29923, 1307, 29911, 29918, 9464, 353, 5591, 1707, 29914, 1982, 29914, 29895, 4003, 1026, 29908, 13, 1678, 382, 6271, 29918, 29968, 7466, 29923, 1307, 29911, 29918, 9464, 353, 5591, 1707, 29914, 1982, 29914, 14695, 29914, 29895, 4003, 1026, 29908, 13, 1678, 11247, 29907, 1964, 29918, 10145, 29918, 8618, 28607, 2725, 1001, 29918, 1525, 13152, 29922, 5124, 13, 1678, 476, 29943, 1783, 29931, 29918, 29950, 5550, 29918, 9047, 5971, 29918, 1525, 13152, 353, 5124, 13, 1678, 350, 3308, 29979, 8456, 29990, 29918, 1525, 13152, 353, 5124, 13, 13, 1678, 822, 14115, 29898, 1068, 17514, 29918, 5975, 1125, 13, 4706, 736, 1134, 877, 16854, 742, 313, 511, 4257, 29918, 5975, 29897, 13, 13, 1678, 26524, 29950, 29918, 15631, 29925, 2890, 353, 14115, 29898, 29907, 17321, 6488, 29918, 10249, 3301, 2433, 6341, 10249, 3301, 742, 18865, 29956, 29918, 23714, 29965, 29990, 29918, 11889, 29903, 2433, 1610, 24085, 5959, 742, 8528, 19297, 1307, 29918, 10249, 3301, 2433, 4773, 10249, 3301, 1495, 13, 29937, 6418, 1430, 17122, 13, 1678, 6418, 1430, 18641, 353, 8207, 4855, 29914, 2109, 29914, 22156, 2536, 29915, 13, 1678, 14636, 29918, 14226, 353, 29871, 29896, 29900, 29906, 29946, 13, 1678, 21330, 21554, 353, 29871, 29941, 29953, 29945, 29900, 13, 1678, 12766, 29918, 29907, 20161, 353, 525, 1113, 29889, 6327, 29915, 13, 1678, 12766, 29918, 10818, 353, 525, 1113, 29889, 1989, 29915, 13, 1678, 396, 1732, 597, 1636, 29889, 22156, 2536, 29889, 990, 29914, 2640, 29914, 13371, 29914, 22156, 2536, 29889, 1420, 29937, 25711, 29918, 19689, 4717, 1660, 29918, 1718, 29954, 5005, 3919, 29903, 13, 1678, 1060, 29945, 29900, 29929, 29918, 12194, 4717, 29918, 1718, 10749, 353, 3861, 13, 13, 1678, 6418, 1430, 18641, 29918, 25903, 29918, 4330, 3580, 29931, 3040, 353, 9995, 13, 14032, 415, 353, 694, 13, 5721, 6202, 3276, 29918, 978, 353, 12428, 29918, 5721, 6202, 3276, 29918, 978, 13, 7971, 29918, 24299, 353, 325, 29941, 29918, 7971, 13, 13, 29961, 12428, 29918, 5721, 6202, 3276, 29918, 978, 4514, 13, 29907, 462, 418, 353, 3148, 13, 1254, 462, 268, 353, 4810, 13, 29931, 462, 418, 353, 7236, 26410, 13, 29949, 462, 418, 353, 379, 4162, 13, 27269, 462, 268, 353, 379, 6271, 13, 13778, 462, 268, 353, 1273, 29898, 5509, 29897, 29879, 13, 5269, 7061, 965, 353, 529, 26862, 6227, 29958, 13, 29961, 325, 29941, 29918, 7971, 4514, 13, 29937, 7338, 5580, 304, 788, 304, 263, 12289, 2009, 13, 16121, 27427, 353, 12766, 29901, 25717, 13, 1989, 27573, 353, 1661, 5612, 4749, 362, 29892, 13436, 10140, 1535, 29892, 1820, 2369, 455, 8096, 358, 13, 16009, 24528, 1170, 353, 732, 1997, 29918, 7039, 13, 29961, 5272, 29918, 7039, 4514, 13, 29928, 3059, 29889, 29896, 353, 1273, 29898, 5509, 29897, 29879, 13, 29928, 3059, 29889, 29906, 353, 1273, 29898, 5509, 29897, 29879, 29889, 29995, 29898, 22377, 29897, 29879, 13, 29928, 3059, 29889, 29941, 353, 1273, 29898, 5509, 29897, 29879, 29889, 29995, 29898, 22377, 29897, 29879, 29889, 4501, 29883, 13, 15945, 29908, 13, 2 ]