content
stringlengths 1
1.04M
| input_ids
sequencelengths 1
774k
| ratio_char_token
float64 0.38
22.9
| token_count
int64 1
774k
|
---|---|---|---|
import asyncio
import contextlib
from typing import Dict, Any, Optional
import aioboto3
import botocore
import statey as st
SubnetConfigType = st.Struct[
"vpc_id" : st.String,
"cidr_block" : st.String,
# Optional args
"ipv6_cidr_block" : ~st.String,
"map_public_ip_on_launch" : st.Boolean(default=False),
"assign_ipv6_address_on_creation" : st.Boolean(default=False),
# Missing: tags
]
SubnetType = st.Struct[
"vpc_id" : st.String,
"cidr_block" : st.String,
"ipv6_association_id" : ~st.String,
"ipv6_cidr_block" : ~st.String,
"map_public_ip_on_launch" : st.Boolean,
"assign_ipv6_address_on_creation" : st.Boolean,
# Missing: tags
"id" : st.String,
"owner_id" : st.Integer,
]
class SubnetMachine(st.SimpleMachine):
"""
Maching representing an AWS subnet
"""
UP = st.State("UP", SubnetConfigType, SubnetType)
@contextlib.asynccontextmanager
@contextlib.asynccontextmanager
@staticmethod
async def create_task(self, config: SubnetConfigType) -> SubnetType:
"""
Create a new subnet
"""
async with self.resource_ctx() as ec2, self.client_ctx() as client:
kws = {"CidrBlock": config["cidr_block"], "VpcId": config["vpc_id"]}
if config["ipv6_cidr_block"] is not None:
kws["Ipv6CidrBlock"] = config["ipv6_cidr_block"]
subnet = await ec2.create_subnet(**kws)
yield await self.convert_instance(subnet)
map_public_ip_on_launch = await subnet.map_public_ip_on_launch
if map_public_ip_on_launch != config["map_public_ip_on_launch"]:
await client.modify_subnet_attribute(
MapPublicIpOnLaunch={"Value": config["map_public_ip_on_launch"]},
SubnetId=subnet.id,
)
await subnet.load()
yield await self.convert_instance(subnet)
assign_ipv6_address_on_creation = (
await subnet.assign_ipv6_address_on_creation
)
if (
assign_ipv6_address_on_creation
!= config["assign_ipv6_address_on_creation"]
):
await client.modify_subnet_attribute(
AssignIpv6AddressOnCreation={
"Value": config["assign_ipv6_address_on_creation"]
},
SubnetId=subnet.id,
)
await subnet.load()
yield await self.convert_instance(subnet)
async def delete_task(self, current: SubnetType) -> st.EmptyType:
"""
Delete the subnet
"""
async with self.resource_ctx() as ec2:
subnet = await ec2.Subnet(current["id"])
await subnet.delete()
subnet_resource = st.MachineResource("aws_subnet", SubnetMachine)
Subnet = subnet_resource.s
RESOURCES = [subnet_resource]
def register(registry: Optional["Registry"] = None) -> None:
"""
Register resources in this module
"""
if registry is None:
registry = st.registry
for resource in RESOURCES:
registry.register(resource)
| [
11748,
30351,
952,
198,
11748,
4732,
8019,
198,
6738,
19720,
1330,
360,
713,
11,
4377,
11,
32233,
198,
198,
11748,
257,
72,
672,
2069,
18,
198,
11748,
10214,
420,
382,
198,
198,
11748,
1181,
88,
355,
336,
628,
198,
7004,
3262,
16934,
6030,
796,
336,
13,
44909,
58,
198,
220,
220,
220,
366,
85,
14751,
62,
312,
1,
1058,
336,
13,
10100,
11,
198,
220,
220,
220,
366,
66,
312,
81,
62,
9967,
1,
1058,
336,
13,
10100,
11,
198,
220,
220,
220,
1303,
32233,
26498,
198,
220,
220,
220,
366,
541,
85,
21,
62,
66,
312,
81,
62,
9967,
1,
1058,
5299,
301,
13,
10100,
11,
198,
220,
220,
220,
366,
8899,
62,
11377,
62,
541,
62,
261,
62,
35681,
1,
1058,
336,
13,
46120,
13087,
7,
12286,
28,
25101,
828,
198,
220,
220,
220,
366,
562,
570,
62,
541,
85,
21,
62,
21975,
62,
261,
62,
38793,
1,
1058,
336,
13,
46120,
13087,
7,
12286,
28,
25101,
828,
198,
220,
220,
220,
1303,
25639,
25,
15940,
198,
60,
628,
198,
7004,
3262,
6030,
796,
336,
13,
44909,
58,
198,
220,
220,
220,
366,
85,
14751,
62,
312,
1,
1058,
336,
13,
10100,
11,
198,
220,
220,
220,
366,
66,
312,
81,
62,
9967,
1,
1058,
336,
13,
10100,
11,
198,
220,
220,
220,
366,
541,
85,
21,
62,
562,
41003,
62,
312,
1,
1058,
5299,
301,
13,
10100,
11,
198,
220,
220,
220,
366,
541,
85,
21,
62,
66,
312,
81,
62,
9967,
1,
1058,
5299,
301,
13,
10100,
11,
198,
220,
220,
220,
366,
8899,
62,
11377,
62,
541,
62,
261,
62,
35681,
1,
1058,
336,
13,
46120,
13087,
11,
198,
220,
220,
220,
366,
562,
570,
62,
541,
85,
21,
62,
21975,
62,
261,
62,
38793,
1,
1058,
336,
13,
46120,
13087,
11,
198,
220,
220,
220,
1303,
25639,
25,
15940,
198,
220,
220,
220,
366,
312,
1,
1058,
336,
13,
10100,
11,
198,
220,
220,
220,
366,
18403,
62,
312,
1,
1058,
336,
13,
46541,
11,
198,
60,
628,
198,
4871,
3834,
3262,
37573,
7,
301,
13,
26437,
37573,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7080,
278,
10200,
281,
30865,
850,
3262,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
15958,
796,
336,
13,
9012,
7203,
8577,
1600,
3834,
3262,
16934,
6030,
11,
3834,
3262,
6030,
8,
628,
220,
220,
220,
2488,
22866,
8019,
13,
292,
2047,
535,
261,
5239,
37153,
628,
220,
220,
220,
2488,
22866,
8019,
13,
292,
2047,
535,
261,
5239,
37153,
628,
220,
220,
220,
2488,
12708,
24396,
628,
220,
220,
220,
30351,
825,
2251,
62,
35943,
7,
944,
11,
4566,
25,
3834,
3262,
16934,
6030,
8,
4613,
3834,
3262,
6030,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
13610,
257,
649,
850,
3262,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30351,
351,
2116,
13,
31092,
62,
49464,
3419,
355,
9940,
17,
11,
2116,
13,
16366,
62,
49464,
3419,
355,
5456,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
18504,
796,
19779,
34,
312,
81,
12235,
1298,
4566,
14692,
66,
312,
81,
62,
9967,
33116,
366,
53,
14751,
7390,
1298,
4566,
14692,
85,
14751,
62,
312,
8973,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4566,
14692,
541,
85,
21,
62,
66,
312,
81,
62,
9967,
8973,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
18504,
14692,
40,
79,
85,
21,
34,
312,
81,
12235,
8973,
796,
4566,
14692,
541,
85,
21,
62,
66,
312,
81,
62,
9967,
8973,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
3262,
796,
25507,
9940,
17,
13,
17953,
62,
7266,
3262,
7,
1174,
74,
18504,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7800,
25507,
2116,
13,
1102,
1851,
62,
39098,
7,
7266,
3262,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3975,
62,
11377,
62,
541,
62,
261,
62,
35681,
796,
25507,
850,
3262,
13,
8899,
62,
11377,
62,
541,
62,
261,
62,
35681,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3975,
62,
11377,
62,
541,
62,
261,
62,
35681,
14512,
4566,
14692,
8899,
62,
11377,
62,
541,
62,
261,
62,
35681,
1,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
5456,
13,
4666,
1958,
62,
7266,
3262,
62,
42348,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9347,
15202,
40,
79,
2202,
38296,
28,
4895,
11395,
1298,
4566,
14692,
8899,
62,
11377,
62,
541,
62,
261,
62,
35681,
8973,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3834,
3262,
7390,
28,
7266,
3262,
13,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
850,
3262,
13,
2220,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7800,
25507,
2116,
13,
1102,
1851,
62,
39098,
7,
7266,
3262,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8333,
62,
541,
85,
21,
62,
21975,
62,
261,
62,
38793,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
850,
3262,
13,
562,
570,
62,
541,
85,
21,
62,
21975,
62,
261,
62,
38793,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8333,
62,
541,
85,
21,
62,
21975,
62,
261,
62,
38793,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14512,
4566,
14692,
562,
570,
62,
541,
85,
21,
62,
21975,
62,
261,
62,
38793,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15179,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
5456,
13,
4666,
1958,
62,
7266,
3262,
62,
42348,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2195,
570,
40,
79,
85,
21,
20231,
2202,
12443,
341,
34758,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
11395,
1298,
4566,
14692,
562,
570,
62,
541,
85,
21,
62,
21975,
62,
261,
62,
38793,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3834,
3262,
7390,
28,
7266,
3262,
13,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
850,
3262,
13,
2220,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7800,
25507,
2116,
13,
1102,
1851,
62,
39098,
7,
7266,
3262,
8,
628,
220,
220,
220,
30351,
825,
12233,
62,
35943,
7,
944,
11,
1459,
25,
3834,
3262,
6030,
8,
4613,
336,
13,
40613,
6030,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
23520,
262,
850,
3262,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30351,
351,
2116,
13,
31092,
62,
49464,
3419,
355,
9940,
17,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
3262,
796,
25507,
9940,
17,
13,
7004,
3262,
7,
14421,
14692,
312,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
850,
3262,
13,
33678,
3419,
628,
198,
7266,
3262,
62,
31092,
796,
336,
13,
37573,
26198,
7203,
8356,
62,
7266,
3262,
1600,
3834,
3262,
37573,
8,
198,
198,
7004,
3262,
796,
850,
3262,
62,
31092,
13,
82,
198,
198,
19535,
2606,
7397,
1546,
796,
685,
7266,
3262,
62,
31092,
60,
628,
198,
4299,
7881,
7,
2301,
4592,
25,
32233,
14692,
8081,
4592,
8973,
796,
6045,
8,
4613,
6045,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
17296,
4133,
287,
428,
8265,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
20478,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
20478,
796,
336,
13,
2301,
4592,
628,
220,
220,
220,
329,
8271,
287,
15731,
2606,
7397,
1546,
25,
198,
220,
220,
220,
220,
220,
220,
220,
20478,
13,
30238,
7,
31092,
8,
198
] | 2.078982 | 1,532 |
class constants:
"""Class of constants for each component of detector
"""
class bgsub:
"""Background subtraction/segmentation
mod [str] the segmentation model (MOG2, KNN, GMG)
"""
mod = 'MOG2'
class HSV:
"""HSV inRange filtering
maximum values and initial values
"""
max_value = 255
max_value_H = 360//2
low_H = 40
low_S = 30
low_V = 30
high_H = 75
high_S = 255
high_V = 255
low_H_name = 'Low H'
low_S_name = 'Low S'
low_V_name = 'Low V'
high_H_name = 'High H'
high_S_name = 'High S'
high_V_name = 'High V'
class window:
"""Window control
names of windows
"""
window1 = 'Altered'
window2 = 'Original'
class asth:
"""Aesthetics
font [enum int] font used for description
text [bool] should text be imprinted on image?
"""
font = 0
text = False
class cntr:
"""Controls for program
next_k - next image
prev_k - prev image
save - save single image (in mode)
save_all - save all images (in mode)
exit_k - exit the program
dice - calculate dice value
dice_more - show all dice values based on dataset
m1_k etc. - mode selection
modes [dict] dictionary with mode names
"""
next_k = ord('m')
prev_k = ord('n')
save = ord('s')
save_all = ord('z')
exit_k = 27
dice = ord('d')
dice_more = ord('f')
m1_k = ord('1')
m2_k = ord('2')
m3_k = ord('3')
m4_k = ord('4')
m5_k = ord('5')
modes = {
0: 'original',
1: 'hsv_filter',
2: 'ws_mask',
3: 'ws_mask_bg',
4: 'fgbg_segm',
5: 'ws_fgbg_segm'
}
class xtra:
"""Ends and odds
disco [bool] random colors for masks on each loop?
show_save_all [bool] run saving all in foreground?
"""
disco = False
show_save_all = True
| [
4871,
38491,
25,
198,
220,
220,
220,
37227,
9487,
286,
38491,
329,
1123,
7515,
286,
31029,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1398,
275,
70,
7266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
21756,
13284,
7861,
14,
325,
5154,
341,
628,
220,
220,
220,
220,
220,
220,
220,
953,
685,
2536,
60,
262,
10618,
341,
2746,
357,
44,
7730,
17,
11,
509,
6144,
11,
6951,
38,
8,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
953,
796,
705,
44,
7730,
17,
6,
628,
220,
220,
220,
1398,
18070,
53,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7998,
53,
287,
17257,
25431,
628,
220,
220,
220,
220,
220,
220,
220,
5415,
3815,
290,
4238,
3815,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
8367,
796,
14280,
198,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
8367,
62,
39,
796,
11470,
1003,
17,
628,
220,
220,
220,
220,
220,
220,
220,
1877,
62,
39,
796,
2319,
198,
220,
220,
220,
220,
220,
220,
220,
1877,
62,
50,
796,
1542,
198,
220,
220,
220,
220,
220,
220,
220,
1877,
62,
53,
796,
1542,
198,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
39,
796,
5441,
198,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
50,
796,
14280,
198,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
53,
796,
14280,
628,
220,
220,
220,
220,
220,
220,
220,
1877,
62,
39,
62,
3672,
796,
705,
20535,
367,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1877,
62,
50,
62,
3672,
796,
705,
20535,
311,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1877,
62,
53,
62,
3672,
796,
705,
20535,
569,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
39,
62,
3672,
796,
705,
11922,
367,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
50,
62,
3672,
796,
705,
11922,
311,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
53,
62,
3672,
796,
705,
11922,
569,
6,
628,
220,
220,
220,
1398,
4324,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
27703,
1630,
628,
220,
220,
220,
220,
220,
220,
220,
3891,
286,
9168,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4324,
16,
796,
705,
2348,
4400,
6,
198,
220,
220,
220,
220,
220,
220,
220,
4324,
17,
796,
705,
20556,
6,
628,
220,
220,
220,
1398,
6468,
71,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
32,
395,
24965,
628,
220,
220,
220,
220,
220,
220,
220,
10369,
685,
44709,
493,
60,
10369,
973,
329,
6764,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
685,
30388,
60,
815,
2420,
307,
29122,
276,
319,
2939,
30,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
10369,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
796,
10352,
628,
220,
220,
220,
1398,
269,
429,
81,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15988,
82,
329,
1430,
628,
220,
220,
220,
220,
220,
220,
220,
1306,
62,
74,
532,
1306,
2939,
198,
220,
220,
220,
220,
220,
220,
220,
8654,
62,
74,
532,
8654,
2939,
198,
220,
220,
220,
220,
220,
220,
220,
3613,
532,
3613,
2060,
2939,
357,
259,
4235,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3613,
62,
439,
532,
3613,
477,
4263,
357,
259,
4235,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8420,
62,
74,
532,
8420,
262,
1430,
628,
220,
220,
220,
220,
220,
220,
220,
17963,
532,
15284,
17963,
1988,
198,
220,
220,
220,
220,
220,
220,
220,
17963,
62,
3549,
532,
905,
477,
17963,
3815,
1912,
319,
27039,
628,
220,
220,
220,
220,
220,
220,
220,
285,
16,
62,
74,
3503,
13,
532,
4235,
6356,
628,
220,
220,
220,
220,
220,
220,
220,
12881,
685,
11600,
60,
22155,
351,
4235,
3891,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1306,
62,
74,
796,
2760,
10786,
76,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
8654,
62,
74,
796,
2760,
10786,
77,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
3613,
796,
2760,
10786,
82,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
3613,
62,
439,
796,
2760,
10786,
89,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
8420,
62,
74,
796,
2681,
628,
220,
220,
220,
220,
220,
220,
220,
17963,
796,
2760,
10786,
67,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
17963,
62,
3549,
796,
2760,
10786,
69,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
285,
16,
62,
74,
796,
2760,
10786,
16,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
285,
17,
62,
74,
796,
2760,
10786,
17,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
285,
18,
62,
74,
796,
2760,
10786,
18,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
285,
19,
62,
74,
796,
2760,
10786,
19,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
285,
20,
62,
74,
796,
2760,
10786,
20,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
12881,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
25,
705,
14986,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
25,
705,
11994,
85,
62,
24455,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
362,
25,
705,
18504,
62,
27932,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
513,
25,
705,
18504,
62,
27932,
62,
35904,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
604,
25,
705,
69,
22296,
70,
62,
325,
39870,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
642,
25,
705,
18504,
62,
69,
22296,
70,
62,
325,
39870,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
1398,
220,
742,
430,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
12915,
82,
290,
10402,
628,
220,
220,
220,
220,
220,
220,
220,
4655,
685,
30388,
60,
4738,
7577,
329,
20680,
319,
1123,
9052,
30,
198,
220,
220,
220,
220,
220,
220,
220,
905,
62,
21928,
62,
439,
685,
30388,
60,
1057,
8914,
477,
287,
36282,
30,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4655,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
905,
62,
21928,
62,
439,
796,
6407,
198
] | 1.940179 | 1,120 |
import logging
from pathlib import Path
import time
import boto3
# This module requires a directory `.aws/` containing credentials in the home directory,
# or environment variables `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`.
logger = logging.getLogger(__name__)
| [
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
640,
198,
198,
11748,
275,
2069,
18,
198,
198,
2,
770,
8265,
4433,
257,
8619,
4600,
13,
8356,
14,
63,
7268,
18031,
287,
262,
1363,
8619,
11,
198,
2,
393,
2858,
9633,
4600,
12298,
50,
62,
26861,
7597,
62,
20373,
62,
2389,
47671,
290,
4600,
12298,
50,
62,
23683,
26087,
62,
26861,
7597,
62,
20373,
44646,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
628,
628,
628
] | 3.282353 | 85 |
import numpy as np
import cudamat as cm
| [
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
463,
321,
265,
355,
12067,
628
] | 2.8 | 15 |
from typing import Union, Dict, List, Any, Tuple, Optional
import json, tempfile, os, logging, re, shutil, mimetypes, good
from tornado import httpclient, web, queues
from storitch import utils, config
from storitch.decorators import run_on_executor
from wand import image, exceptions
@web.stream_request_body
def thumbnail(path: str) -> bool:
'''
Specify the path and add a "@" followed by the arguments.
This allows us to easily get the original file, make the changes,
save the file with the full path, so the server never has to do
the operation again, as long as the arguments are precisely the same.
Arguments can be specified as followed:
SXx - Width, keeps aspect ratio
SYx - Height, keeps aspect ration.
Ignored if SX is specified.
ROTATEx - Number of degrees you wise to
rotate the image. Supports
negative numbers.
RESx - Resolution, used for PDF
files, the higher the number,
the better the quality.
PAGEx - Page index in the PDF document.
The file format can be specified by ending the path with
E.g. .jpg, .png, .tiff, etc.
The arguments can be separated with _ or just
don't separate them. Works either way.
Example:
/foo/14bc...@SX1024_ROTATE90.png
Resizes the image to a width of 1024, rotates it 90 degrees and converts
it to a PNG file.
:param path: str
'''
p = path.split('@')
if len(p) != 2:
return False
if os.path.exists(path):
return True
size_match, rotate_match, resolution_match, \
page_match, format_match = __parse_arguments(p[1])
# a specific page in a PDF document
if page_match and page_match.group(1) != None:
page = '[{}]'.format(page_match.group(1))
else:
# Prevent a dicom file or pdf file from extracting multiple images
page = '[0]'
o = {
'filename': p[0]+page
}
if resolution_match and resolution_match.group(1) != None:
o['resolution'] = int(resolution_match.group(1))
with image.Image(**o) as img:
if size_match:
# resize, keep aspect ratio
if size_match.group(1) != None:# width
img.transform(resize=size_match.group(1))
elif size_match.group(2) != None:# height
img.transform(resize='x'+size_match.group(2))
if rotate_match:
if rotate_match.group(1) != None:
img.rotate(int(rotate_match.group(1)))
if format_match:
img.format = format_match.group(1)
img.save(filename=path)
return True | [
6738,
19720,
1330,
4479,
11,
360,
713,
11,
7343,
11,
4377,
11,
309,
29291,
11,
32233,
198,
11748,
33918,
11,
20218,
7753,
11,
28686,
11,
18931,
11,
302,
11,
4423,
346,
11,
17007,
2963,
12272,
11,
922,
198,
6738,
33718,
1330,
2638,
16366,
11,
3992,
11,
43359,
198,
6738,
336,
273,
2007,
1330,
3384,
4487,
11,
4566,
198,
6738,
336,
273,
2007,
13,
12501,
273,
2024,
1330,
1057,
62,
261,
62,
18558,
38409,
198,
6738,
11569,
1330,
2939,
11,
13269,
198,
198,
31,
12384,
13,
5532,
62,
25927,
62,
2618,
198,
198,
4299,
40901,
7,
6978,
25,
965,
8,
4613,
20512,
25,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
18291,
1958,
262,
3108,
290,
751,
257,
44212,
1,
3940,
416,
262,
7159,
13,
628,
220,
220,
220,
770,
3578,
514,
284,
3538,
651,
262,
2656,
2393,
11,
787,
262,
2458,
11,
198,
220,
220,
220,
3613,
262,
2393,
351,
262,
1336,
3108,
11,
523,
262,
4382,
1239,
468,
284,
466,
198,
220,
220,
220,
262,
4905,
757,
11,
355,
890,
355,
262,
7159,
389,
10582,
262,
976,
13,
628,
220,
220,
220,
20559,
2886,
460,
307,
7368,
355,
3940,
25,
628,
220,
220,
220,
220,
220,
220,
220,
44205,
87,
220,
220,
220,
220,
220,
220,
220,
220,
532,
38807,
11,
7622,
4843,
8064,
198,
220,
220,
220,
220,
220,
220,
220,
19704,
87,
220,
220,
220,
220,
220,
220,
220,
220,
532,
27280,
11,
7622,
4843,
36535,
13,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16583,
1850,
611,
44205,
318,
7368,
13,
198,
220,
220,
220,
220,
220,
220,
220,
371,
2394,
1404,
3109,
220,
220,
220,
220,
532,
7913,
286,
7370,
345,
10787,
284,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23064,
262,
2939,
13,
45267,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4633,
3146,
13,
198,
220,
220,
220,
220,
220,
220,
220,
15731,
87,
220,
220,
220,
220,
220,
220,
220,
532,
22406,
11,
973,
329,
12960,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
11,
262,
2440,
262,
1271,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
262,
1365,
262,
3081,
13,
198,
220,
220,
220,
220,
220,
220,
220,
350,
4760,
3109,
220,
220,
220,
220,
220,
220,
532,
7873,
6376,
287,
262,
12960,
3188,
13,
628,
220,
220,
220,
383,
2393,
5794,
460,
307,
7368,
416,
7464,
262,
3108,
351,
198,
220,
220,
220,
412,
13,
70,
13,
764,
9479,
11,
764,
11134,
11,
764,
83,
733,
11,
3503,
13,
628,
220,
220,
220,
383,
7159,
460,
307,
11266,
351,
4808,
393,
655,
198,
220,
220,
220,
836,
470,
4553,
606,
13,
10933,
2035,
835,
13,
220,
628,
220,
220,
220,
17934,
25,
628,
220,
220,
220,
220,
220,
220,
220,
1220,
21943,
14,
1415,
15630,
986,
31,
50,
55,
35500,
62,
49,
2394,
6158,
3829,
13,
11134,
628,
220,
220,
220,
1874,
4340,
262,
2939,
284,
257,
9647,
286,
28119,
11,
5724,
689,
340,
4101,
7370,
290,
26161,
220,
198,
220,
220,
220,
340,
284,
257,
36182,
2393,
13,
628,
220,
220,
220,
1058,
17143,
3108,
25,
965,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
279,
796,
3108,
13,
35312,
10786,
31,
11537,
198,
220,
220,
220,
611,
18896,
7,
79,
8,
14512,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
611,
28686,
13,
6978,
13,
1069,
1023,
7,
6978,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
198,
220,
220,
220,
2546,
62,
15699,
11,
23064,
62,
15699,
11,
6323,
62,
15699,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
2443,
62,
15699,
11,
5794,
62,
15699,
796,
11593,
29572,
62,
853,
2886,
7,
79,
58,
16,
12962,
628,
220,
220,
220,
1303,
257,
2176,
2443,
287,
257,
12960,
3188,
198,
220,
220,
220,
611,
2443,
62,
15699,
290,
2443,
62,
15699,
13,
8094,
7,
16,
8,
14512,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2443,
796,
44438,
90,
92,
60,
4458,
18982,
7,
7700,
62,
15699,
13,
8094,
7,
16,
4008,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
31572,
257,
288,
291,
296,
2393,
393,
37124,
2393,
422,
37895,
3294,
4263,
198,
220,
220,
220,
220,
220,
220,
220,
2443,
796,
44438,
15,
49946,
628,
220,
220,
220,
267,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
34345,
10354,
279,
58,
15,
48688,
7700,
198,
220,
220,
220,
1782,
198,
220,
220,
220,
611,
6323,
62,
15699,
290,
6323,
62,
15699,
13,
8094,
7,
16,
8,
14512,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
267,
17816,
29268,
20520,
796,
493,
7,
29268,
62,
15699,
13,
8094,
7,
16,
4008,
628,
220,
220,
220,
351,
2939,
13,
5159,
7,
1174,
78,
8,
355,
33705,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2546,
62,
15699,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
47558,
11,
1394,
4843,
8064,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2546,
62,
15699,
13,
8094,
7,
16,
8,
14512,
6045,
43922,
9647,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33705,
13,
35636,
7,
411,
1096,
28,
7857,
62,
15699,
13,
8094,
7,
16,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2546,
62,
15699,
13,
8094,
7,
17,
8,
14512,
6045,
43922,
6001,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33705,
13,
35636,
7,
411,
1096,
11639,
87,
6,
10,
7857,
62,
15699,
13,
8094,
7,
17,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
23064,
62,
15699,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
23064,
62,
15699,
13,
8094,
7,
16,
8,
14512,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33705,
13,
10599,
378,
7,
600,
7,
10599,
378,
62,
15699,
13,
8094,
7,
16,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
611,
5794,
62,
15699,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33705,
13,
18982,
796,
5794,
62,
15699,
13,
8094,
7,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
33705,
13,
21928,
7,
34345,
28,
6978,
8,
198,
220,
220,
220,
1441,
6407
] | 2.384749 | 1,154 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Lucas Miguel S Ponce"
__email__ = "[email protected]"
from ddf_library.bases.metadata import Status, OPTGroup
from ddf_library.bases.context_base import ContextBase
from ddf_library.ddf import DDF
from ddf_library.bases.ddf_model import ModelDDF
from ddf_library.utils import generate_info, read_stage_file, \
create_stage_files, save_stage_file
from pycompss.api.api import compss_wait_on, compss_delete_object
from pycompss.api.task import task
from pycompss.functions.reduce import merge_reduce
from pycompss.api.parameter import FILE_IN, COLLECTION_IN
import pandas as pd
import numpy as np
__all__ = ['PageRank']
# TODO: this algorithm can be optimized
class PageRank(ModelDDF):
# noinspection PyUnresolvedReferences
"""
PageRank is one of the methods Google uses to determine a page's
relevance or importance. The idea that Page Rank brought up was that, the
importance of any web page can be judged by looking at the pages that link
to it.
PageRank can be utilized in others domains. For example, may also be used
as a methodology to measure the apparent impact of a community.
.. note: This parallel implementation assumes that the list of unique
vertex can be fit in memory.
:Example:
>>> pr = PageRank(damping_factor=0.85)
>>> ddf2 = pr.transform(ddf1, inlink_col='col1', outlink_col='col2')
"""
def __init__(self, damping_factor=0.85, max_iters=100):
"""
:param damping_factor: Default damping factor is 0.85;
:param max_iters: Maximum number of iterations (default is 100).
"""
super(PageRank, self).__init__()
self.inlink_col = None
self.outlink_col = None
self.max_iters = max_iters
self.damping_factor = damping_factor
def transform(self, data, outlink_col, inlink_col):
"""
Generates the PageRank's result.
:param data: DDF
:param outlink_col: Out-link vertex;
:param inlink_col: In-link vertex;
:return: DDF with Vertex and Rank columns
"""
df, nfrag, tmp = self._ddf_initial_setup(data)
self.inlink_col = inlink_col
self.outlink_col = outlink_col
col1 = 'Vertex'
col2 = 'Rank'
"""
Load all URL's from the data and initialize their neighbors.
Initialize each page’s rank to 1.0.
"""
adj_list = [{} for _ in range(nfrag)]
rank_list = [{} for _ in range(nfrag)]
counts_in = [{} for _ in range(nfrag)]
for i in range(nfrag):
adj_list[i], rank_list[i], counts_in[i] = \
_pr_create_adjlist(df[i], inlink_col, outlink_col)
counts_in = merge_reduce(_merge_counts, counts_in)
for i in range(nfrag):
adj_list[i] = _pr_update_adjlist(adj_list[i], counts_in)
compss_delete_object(counts_in)
for iteration in range(self.max_iters):
"""Calculate the partial contribution of each vertex."""
contributions = [_calc_contribuitions(adj_list[i], rank_list[i])
for i in range(nfrag)]
merged_c = merge_reduce(_merge_counts, contributions)
"""Update each vertex rank in the fragment."""
rank_list = [_update_rank(rank_list[i], merged_c,
self.damping_factor)
for i in range(nfrag)]
merged_table = merge_ranks(rank_list, col1, col2)
result, info = _pagerank_split(merged_table, nfrag)
new_state_uuid = ContextBase\
.ddf_add_task(self.name,
status=Status.STATUS_COMPLETED,
opt=OPTGroup.OPT_OTHER,
info_data=info,
parent=[tmp.last_uuid],
result=result,
function=self.transform,
parameters=data)
return DDF(last_uuid=new_state_uuid)
@task(returns=3, data=FILE_IN)
@task(returns=1)
def _merge_counts(counts1, counts2):
"""
Merge the frequency of each vertex.
.. note:: It assumes that the frequency list can be fitted in memory.
"""
for v_out in counts2:
if v_out in counts1:
counts1[v_out] += counts2[v_out]
else:
counts1[v_out] = counts2[v_out]
return counts1
@task(returns=1)
def _pr_update_adjlist(adj1, counts_in):
"""Update the frequency of vertex in each fragment."""
for key in adj1:
adj1[key][1] = counts_in[key]
return adj1
@task(returns=1)
def _calc_contribuitions(adj, ranks):
"""Calculate the partial contribution of each vertex."""
contrib = {}
for key in adj:
urls = adj[key][0]
num_neighbors = adj[key][1]
rank = ranks[key]
for url in urls:
if url not in contrib:
# out = contrib
contrib[url] = rank/num_neighbors
else:
contrib[url] += rank/num_neighbors
return contrib
@task(returns=1)
def _update_rank(ranks, contrib, factor):
"""Update the rank of each vertex in the fragment."""
bo = 1.0 - factor
for key in contrib:
if key in ranks:
ranks[key] = bo + factor*contrib[key]
return ranks
@task(returns=1, dfs=COLLECTION_IN)
def merge_ranks(dfs, c1, c2):
"""Create the final result. Merge and remove duplicates vertex."""
dfs = [pd.DataFrame(ranks.items(), columns=[c1, c2]) for ranks in dfs]
dfs = pd.concat(dfs, ignore_index=True)\
.drop_duplicates(ignore_index=True)\
.sort_values(['Rank'], ascending=False, ignore_index=True)
return dfs
def _pagerank_split(result, nfrag):
"""Split the list of vertex into nfrag parts.
Note: the list of unique vertex and their ranks must be fit in memory.
"""
result = compss_wait_on(result)
result = np.array_split(result, nfrag)
outfiles = create_stage_files(nfrag)
info = [0] * nfrag
for f, table in enumerate(result):
save_stage_file(outfiles[f], table)
info[f] = generate_info(table, f)
return outfiles, info
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
366,
22946,
292,
29825,
311,
350,
27078,
1,
198,
834,
12888,
834,
796,
366,
75,
1229,
34432,
79,
31,
14816,
13,
785,
1,
198,
198,
6738,
288,
7568,
62,
32016,
13,
65,
1386,
13,
38993,
1330,
12678,
11,
39852,
13247,
198,
6738,
288,
7568,
62,
32016,
13,
65,
1386,
13,
22866,
62,
8692,
1330,
30532,
14881,
198,
6738,
288,
7568,
62,
32016,
13,
1860,
69,
1330,
360,
8068,
198,
6738,
288,
7568,
62,
32016,
13,
65,
1386,
13,
1860,
69,
62,
19849,
1330,
9104,
35,
8068,
198,
6738,
288,
7568,
62,
32016,
13,
26791,
1330,
7716,
62,
10951,
11,
1100,
62,
14247,
62,
7753,
11,
3467,
198,
220,
220,
220,
2251,
62,
14247,
62,
16624,
11,
3613,
62,
14247,
62,
7753,
198,
198,
6738,
12972,
5589,
824,
13,
15042,
13,
15042,
1330,
552,
824,
62,
17077,
62,
261,
11,
552,
824,
62,
33678,
62,
15252,
198,
6738,
12972,
5589,
824,
13,
15042,
13,
35943,
1330,
4876,
198,
6738,
12972,
5589,
824,
13,
12543,
2733,
13,
445,
7234,
1330,
20121,
62,
445,
7234,
198,
6738,
12972,
5589,
824,
13,
15042,
13,
17143,
2357,
1330,
45811,
62,
1268,
11,
20444,
16779,
2849,
62,
1268,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
834,
439,
834,
796,
37250,
9876,
27520,
20520,
198,
198,
2,
16926,
46,
25,
428,
11862,
460,
307,
23392,
628,
198,
4871,
7873,
27520,
7,
17633,
35,
8068,
2599,
198,
220,
220,
220,
1303,
645,
1040,
14978,
9485,
3118,
411,
5634,
19927,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7873,
27520,
318,
530,
286,
262,
5050,
3012,
3544,
284,
5004,
257,
2443,
338,
198,
220,
220,
220,
23082,
393,
6817,
13,
383,
2126,
326,
7873,
10916,
3181,
510,
373,
326,
11,
262,
198,
220,
220,
220,
6817,
286,
597,
3992,
2443,
460,
307,
19589,
416,
2045,
379,
262,
5468,
326,
2792,
198,
220,
220,
220,
284,
340,
13,
628,
220,
220,
220,
7873,
27520,
460,
307,
21487,
287,
1854,
18209,
13,
1114,
1672,
11,
743,
635,
307,
973,
198,
220,
220,
220,
355,
257,
20411,
284,
3953,
262,
4156,
2928,
286,
257,
2055,
13,
628,
220,
220,
220,
11485,
3465,
25,
770,
10730,
7822,
18533,
326,
262,
1351,
286,
3748,
198,
220,
220,
220,
220,
220,
220,
220,
37423,
460,
307,
4197,
287,
4088,
13,
628,
220,
220,
220,
1058,
16281,
25,
628,
220,
220,
220,
13163,
778,
796,
7873,
27520,
7,
67,
37843,
62,
31412,
28,
15,
13,
5332,
8,
198,
220,
220,
220,
13163,
288,
7568,
17,
796,
778,
13,
35636,
7,
1860,
69,
16,
11,
287,
8726,
62,
4033,
11639,
4033,
16,
3256,
503,
8726,
62,
4033,
11639,
4033,
17,
11537,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
21151,
278,
62,
31412,
28,
15,
13,
5332,
11,
3509,
62,
270,
364,
28,
3064,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
21151,
278,
62,
31412,
25,
15161,
21151,
278,
5766,
318,
657,
13,
5332,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
3509,
62,
270,
364,
25,
22246,
1271,
286,
34820,
357,
12286,
318,
1802,
737,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
7,
9876,
27520,
11,
2116,
737,
834,
15003,
834,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
259,
8726,
62,
4033,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
448,
8726,
62,
4033,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9806,
62,
270,
364,
796,
3509,
62,
270,
364,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
67,
37843,
62,
31412,
796,
21151,
278,
62,
31412,
628,
220,
220,
220,
825,
6121,
7,
944,
11,
1366,
11,
503,
8726,
62,
4033,
11,
287,
8726,
62,
4033,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2980,
689,
262,
7873,
27520,
338,
1255,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1366,
25,
360,
8068,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
503,
8726,
62,
4033,
25,
3806,
12,
8726,
37423,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
287,
8726,
62,
4033,
25,
554,
12,
8726,
37423,
26,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
360,
8068,
351,
4643,
16886,
290,
10916,
15180,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
47764,
11,
299,
8310,
363,
11,
45218,
796,
2116,
13557,
1860,
69,
62,
36733,
62,
40406,
7,
7890,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
259,
8726,
62,
4033,
796,
287,
8726,
62,
4033,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
448,
8726,
62,
4033,
796,
503,
8726,
62,
4033,
628,
220,
220,
220,
220,
220,
220,
220,
951,
16,
796,
705,
13414,
16886,
6,
198,
220,
220,
220,
220,
220,
220,
220,
951,
17,
796,
705,
27520,
6,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
8778,
477,
10289,
338,
422,
262,
1366,
290,
41216,
511,
12020,
13,
198,
220,
220,
220,
220,
220,
220,
220,
20768,
1096,
1123,
2443,
447,
247,
82,
4279,
284,
352,
13,
15,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
9224,
62,
4868,
796,
685,
90,
92,
329,
4808,
287,
2837,
7,
77,
8310,
363,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
4279,
62,
4868,
796,
685,
90,
92,
329,
4808,
287,
2837,
7,
77,
8310,
363,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
9853,
62,
259,
796,
685,
90,
92,
329,
4808,
287,
2837,
7,
77,
8310,
363,
15437,
628,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
77,
8310,
363,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9224,
62,
4868,
58,
72,
4357,
4279,
62,
4868,
58,
72,
4357,
9853,
62,
259,
58,
72,
60,
796,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
1050,
62,
17953,
62,
41255,
4868,
7,
7568,
58,
72,
4357,
287,
8726,
62,
4033,
11,
503,
8726,
62,
4033,
8,
628,
220,
220,
220,
220,
220,
220,
220,
9853,
62,
259,
796,
20121,
62,
445,
7234,
28264,
647,
469,
62,
9127,
82,
11,
9853,
62,
259,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
77,
8310,
363,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9224,
62,
4868,
58,
72,
60,
796,
4808,
1050,
62,
19119,
62,
41255,
4868,
7,
41255,
62,
4868,
58,
72,
4357,
9853,
62,
259,
8,
628,
220,
220,
220,
220,
220,
220,
220,
552,
824,
62,
33678,
62,
15252,
7,
9127,
82,
62,
259,
8,
628,
220,
220,
220,
220,
220,
220,
220,
329,
24415,
287,
2837,
7,
944,
13,
9806,
62,
270,
364,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
9771,
3129,
378,
262,
13027,
10156,
286,
1123,
37423,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9284,
796,
685,
62,
9948,
66,
62,
3642,
822,
84,
1756,
7,
41255,
62,
4868,
58,
72,
4357,
4279,
62,
4868,
58,
72,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
77,
8310,
363,
15437,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23791,
62,
66,
796,
20121,
62,
445,
7234,
28264,
647,
469,
62,
9127,
82,
11,
9284,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
10260,
1123,
37423,
4279,
287,
262,
24225,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4279,
62,
4868,
796,
685,
62,
19119,
62,
43027,
7,
43027,
62,
4868,
58,
72,
4357,
23791,
62,
66,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
67,
37843,
62,
31412,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
77,
8310,
363,
15437,
628,
220,
220,
220,
220,
220,
220,
220,
23791,
62,
11487,
796,
20121,
62,
81,
2283,
7,
43027,
62,
4868,
11,
951,
16,
11,
951,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
11,
7508,
796,
4808,
79,
3536,
962,
62,
35312,
7,
647,
2004,
62,
11487,
11,
299,
8310,
363,
8,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
5219,
62,
12303,
312,
796,
30532,
14881,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
1860,
69,
62,
2860,
62,
35943,
7,
944,
13,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3722,
28,
19580,
13,
35744,
2937,
62,
41335,
36493,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2172,
28,
3185,
51,
13247,
13,
3185,
51,
62,
31858,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7508,
62,
7890,
28,
10951,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2560,
41888,
22065,
13,
12957,
62,
12303,
312,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
28,
20274,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2163,
28,
944,
13,
35636,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10007,
28,
7890,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
360,
8068,
7,
12957,
62,
12303,
312,
28,
3605,
62,
5219,
62,
12303,
312,
8,
628,
198,
31,
35943,
7,
7783,
82,
28,
18,
11,
1366,
28,
25664,
62,
1268,
8,
628,
198,
31,
35943,
7,
7783,
82,
28,
16,
8,
198,
4299,
4808,
647,
469,
62,
9127,
82,
7,
9127,
82,
16,
11,
9853,
17,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
39407,
262,
8373,
286,
1123,
37423,
13,
628,
220,
220,
220,
11485,
3465,
3712,
632,
18533,
326,
262,
8373,
1351,
460,
307,
18235,
287,
4088,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
329,
410,
62,
448,
287,
9853,
17,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
410,
62,
448,
287,
9853,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9853,
16,
58,
85,
62,
448,
60,
15853,
9853,
17,
58,
85,
62,
448,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9853,
16,
58,
85,
62,
448,
60,
796,
9853,
17,
58,
85,
62,
448,
60,
198,
220,
220,
220,
1441,
9853,
16,
628,
198,
31,
35943,
7,
7783,
82,
28,
16,
8,
198,
4299,
4808,
1050,
62,
19119,
62,
41255,
4868,
7,
41255,
16,
11,
9853,
62,
259,
2599,
198,
220,
220,
220,
37227,
10260,
262,
8373,
286,
37423,
287,
1123,
24225,
526,
15931,
198,
220,
220,
220,
329,
1994,
287,
9224,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
9224,
16,
58,
2539,
7131,
16,
60,
796,
9853,
62,
259,
58,
2539,
60,
198,
220,
220,
220,
1441,
9224,
16,
628,
198,
31,
35943,
7,
7783,
82,
28,
16,
8,
198,
4299,
4808,
9948,
66,
62,
3642,
822,
84,
1756,
7,
41255,
11,
9803,
2599,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
13027,
10156,
286,
1123,
37423,
526,
15931,
198,
220,
220,
220,
542,
822,
796,
23884,
198,
220,
220,
220,
329,
1994,
287,
9224,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2956,
7278,
796,
9224,
58,
2539,
7131,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
710,
394,
32289,
796,
9224,
58,
2539,
7131,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
4279,
796,
9803,
58,
2539,
60,
198,
220,
220,
220,
220,
220,
220,
220,
329,
19016,
287,
2956,
7278,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
19016,
407,
287,
542,
822,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
503,
220,
220,
220,
220,
220,
220,
796,
220,
542,
822,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
542,
822,
58,
6371,
60,
796,
4279,
14,
22510,
62,
710,
394,
32289,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
542,
822,
58,
6371,
60,
15853,
4279,
14,
22510,
62,
710,
394,
32289,
628,
220,
220,
220,
1441,
542,
822,
628,
198,
31,
35943,
7,
7783,
82,
28,
16,
8,
198,
4299,
4808,
19119,
62,
43027,
7,
81,
2283,
11,
542,
822,
11,
5766,
2599,
198,
220,
220,
220,
37227,
10260,
262,
4279,
286,
1123,
37423,
287,
262,
24225,
526,
15931,
198,
220,
220,
220,
1489,
796,
352,
13,
15,
532,
5766,
628,
220,
220,
220,
329,
1994,
287,
542,
822,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
287,
9803,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9803,
58,
2539,
60,
796,
1489,
1343,
5766,
9,
3642,
822,
58,
2539,
60,
628,
220,
220,
220,
1441,
9803,
628,
198,
31,
35943,
7,
7783,
82,
28,
16,
11,
288,
9501,
28,
25154,
16779,
2849,
62,
1268,
8,
198,
4299,
20121,
62,
81,
2283,
7,
7568,
82,
11,
269,
16,
11,
269,
17,
2599,
198,
220,
220,
220,
37227,
16447,
262,
2457,
1255,
13,
39407,
290,
4781,
14184,
16856,
37423,
526,
15931,
198,
220,
220,
220,
288,
9501,
796,
685,
30094,
13,
6601,
19778,
7,
81,
2283,
13,
23814,
22784,
15180,
41888,
66,
16,
11,
269,
17,
12962,
329,
9803,
287,
288,
9501,
60,
628,
220,
220,
220,
288,
9501,
796,
279,
67,
13,
1102,
9246,
7,
7568,
82,
11,
8856,
62,
9630,
28,
17821,
19415,
198,
220,
220,
220,
220,
220,
220,
220,
764,
14781,
62,
646,
489,
16856,
7,
46430,
62,
9630,
28,
17821,
19415,
198,
220,
220,
220,
220,
220,
220,
220,
764,
30619,
62,
27160,
7,
17816,
27520,
6,
4357,
41988,
28,
25101,
11,
8856,
62,
9630,
28,
17821,
8,
628,
220,
220,
220,
1441,
288,
9501,
628,
198,
4299,
4808,
79,
3536,
962,
62,
35312,
7,
20274,
11,
299,
8310,
363,
2599,
198,
220,
220,
220,
37227,
41205,
262,
1351,
286,
37423,
656,
299,
8310,
363,
3354,
13,
628,
220,
220,
220,
5740,
25,
262,
1351,
286,
3748,
37423,
290,
511,
9803,
1276,
307,
4197,
287,
4088,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1255,
796,
552,
824,
62,
17077,
62,
261,
7,
20274,
8,
198,
220,
220,
220,
1255,
796,
45941,
13,
18747,
62,
35312,
7,
20274,
11,
299,
8310,
363,
8,
198,
220,
220,
220,
503,
16624,
796,
2251,
62,
14247,
62,
16624,
7,
77,
8310,
363,
8,
198,
220,
220,
220,
7508,
796,
685,
15,
60,
1635,
299,
8310,
363,
628,
220,
220,
220,
329,
277,
11,
3084,
287,
27056,
378,
7,
20274,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3613,
62,
14247,
62,
7753,
7,
448,
16624,
58,
69,
4357,
3084,
8,
198,
220,
220,
220,
220,
220,
220,
220,
7508,
58,
69,
60,
796,
7716,
62,
10951,
7,
11487,
11,
277,
8,
628,
220,
220,
220,
1441,
503,
16624,
11,
7508,
628,
628
] | 2.234832 | 2,802 |
import PySimpleGUI as sg
from uart_serial import uart
arduino = uart()
| [
11748,
9485,
26437,
40156,
355,
264,
70,
198,
6738,
334,
433,
62,
46911,
1330,
334,
433,
198,
198,
446,
84,
2879,
796,
334,
433,
3419,
628
] | 2.807692 | 26 |
# Generated by Django 2.2.6 on 2019-11-27 20:28
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
21,
319,
13130,
12,
1157,
12,
1983,
1160,
25,
2078,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from django.contrib.auth.models import User
from tinymce.models import HTMLField
from django.db import models
# Create your models here.
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
7009,
76,
344,
13,
27530,
1330,
11532,
15878,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
628
] | 3.564103 | 39 |
"""empty message
Revision ID: 6564c80d1598
Revises: c3c2dc9000d3
Create Date: 2021-06-19 17:03:45.811885
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6564c80d1598'
down_revision = 'c3c2dc9000d3'
branch_labels = None
depends_on = None
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
6135,
2414,
66,
1795,
67,
1314,
4089,
198,
18009,
2696,
25,
269,
18,
66,
17,
17896,
24,
830,
67,
18,
198,
16447,
7536,
25,
33448,
12,
3312,
12,
1129,
1596,
25,
3070,
25,
2231,
13,
23,
1157,
44230,
198,
198,
37811,
198,
6738,
31341,
2022,
291,
1330,
1034,
198,
11748,
44161,
282,
26599,
355,
473,
628,
198,
2,
18440,
42814,
11,
973,
416,
9300,
2022,
291,
13,
198,
260,
10178,
796,
705,
2996,
2414,
66,
1795,
67,
1314,
4089,
6,
198,
2902,
62,
260,
10178,
796,
705,
66,
18,
66,
17,
17896,
24,
830,
67,
18,
6,
198,
1671,
3702,
62,
23912,
1424,
796,
6045,
198,
10378,
2412,
62,
261,
796,
6045,
628,
198
] | 2.430894 | 123 |
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
with open('README.md') as f:
long_description = f.read()
from xl import __str_version__, __author__
setup(
name='xl',
version=__str_version__,
description='A nice way of generating excel formulas in python.',
long_description=long_description,
url='https://github.com/tizz98/xl',
download_url='https://github.com/tizz98/xl/tarball/%s' % (
__str_version__
),
author=__author__,
author_email='[email protected]',
license='MIT',
packages=['xl'],
keywords='xl excel formulas formula formulae',
zip_safe=True,
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
28311,
25,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
422,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
279,
4464,
392,
420,
198,
220,
220,
220,
890,
62,
11213,
796,
279,
4464,
392,
420,
13,
1102,
1851,
10786,
15675,
11682,
13,
9132,
3256,
705,
81,
301,
11537,
198,
16341,
357,
9399,
12331,
11,
17267,
12331,
2599,
198,
220,
220,
220,
351,
1280,
10786,
15675,
11682,
13,
9132,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
890,
62,
11213,
796,
277,
13,
961,
3419,
628,
198,
6738,
2124,
75,
1330,
11593,
2536,
62,
9641,
834,
11,
11593,
9800,
834,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
87,
75,
3256,
198,
220,
220,
220,
2196,
28,
834,
2536,
62,
9641,
834,
11,
198,
220,
220,
220,
6764,
11639,
32,
3621,
835,
286,
15453,
27336,
32126,
287,
21015,
2637,
11,
198,
220,
220,
220,
890,
62,
11213,
28,
6511,
62,
11213,
11,
198,
220,
220,
220,
19016,
11639,
5450,
1378,
12567,
13,
785,
14,
83,
6457,
4089,
14,
87,
75,
3256,
198,
220,
220,
220,
4321,
62,
6371,
11639,
5450,
1378,
12567,
13,
785,
14,
83,
6457,
4089,
14,
87,
75,
14,
18870,
1894,
14,
4,
82,
6,
4064,
357,
198,
220,
220,
220,
220,
220,
220,
220,
11593,
2536,
62,
9641,
834,
198,
220,
220,
220,
10612,
198,
220,
220,
220,
1772,
28,
834,
9800,
834,
11,
198,
220,
220,
220,
1772,
62,
12888,
11639,
417,
32778,
31,
417,
32778,
86,
346,
1559,
13,
1326,
3256,
198,
220,
220,
220,
5964,
11639,
36393,
3256,
198,
220,
220,
220,
10392,
28,
17816,
87,
75,
6,
4357,
198,
220,
220,
220,
26286,
11639,
87,
75,
27336,
32126,
10451,
1296,
377,
3609,
3256,
198,
220,
220,
220,
19974,
62,
21230,
28,
17821,
11,
198,
220,
220,
220,
1398,
13350,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
705,
41206,
12678,
7904,
604,
532,
17993,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
5317,
1631,
7591,
1240,
7904,
34152,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
33221,
7904,
10442,
7712,
7904,
46267,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
34156,
7904,
7294,
40,
20010,
1079,
7904,
17168,
13789,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
15167,
2229,
15417,
7904,
11361,
7904,
362,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
15167,
2229,
15417,
7904,
11361,
7904,
362,
13,
21,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
15167,
2229,
15417,
7904,
11361,
7904,
362,
13,
22,
3256,
198,
220,
220,
220,
16589,
198,
8,
198
] | 2.567391 | 460 |
# all, any for group condition check
# Manas Dash
# 22th July 2020
# think of any (or) and all (and) as series of logical or and and operators
healthy_percentage = 100
have_money = 0
no_of_friends = 5
mental_happiness = [
healthy_percentage > 50,
have_money > 0,
no_of_friends >= 1
]
if all(mental_happiness):
print('happiness inside')
if any(mental_happiness):
print('happiness outside')
# happiness outside | [
198,
2,
477,
11,
597,
329,
1448,
4006,
2198,
198,
2,
1869,
292,
16189,
198,
2,
2534,
400,
2901,
12131,
198,
2,
892,
286,
597,
357,
273,
8,
290,
477,
357,
392,
8,
355,
2168,
286,
12219,
393,
290,
290,
12879,
628,
198,
22796,
62,
25067,
496,
796,
1802,
198,
14150,
62,
26316,
796,
657,
198,
3919,
62,
1659,
62,
36154,
796,
642,
198,
198,
37098,
62,
71,
42661,
796,
685,
198,
197,
22796,
62,
25067,
496,
1875,
2026,
11,
198,
197,
14150,
62,
26316,
1875,
657,
11,
198,
197,
3919,
62,
1659,
62,
36154,
18189,
352,
198,
60,
198,
198,
361,
477,
7,
37098,
62,
71,
42661,
2599,
198,
197,
4798,
10786,
71,
42661,
2641,
11537,
198,
198,
361,
597,
7,
37098,
62,
71,
42661,
2599,
198,
197,
4798,
10786,
71,
42661,
2354,
11537,
198,
198,
2,
12157,
2354
] | 3 | 140 |
from __future__ import annotations
import abc
from typing import List, Text, TypeVar, Generic
from abc import ABC
from functools import singledispatchmethod
from dataclasses import dataclass
from zx64c.types import Type, Callable
T = TypeVar("T")
@SjasmplusSnapshotProgram.__eq__.register
@Program.__eq__.register
@dataclass
@Function.__eq__.register
@Block.__eq__.register
@If.__eq__.register
@Print.__eq__.register
@Let.__eq__.register
@Assignment.__eq__.register
@Return.__eq__.register
@Equal.__eq__.register
@NotEqual.__eq__.register
@Addition.__eq__.register
@Subtraction.__eq__.register
@Negation.__eq__.register
@FunctionCall.__eq__.register
@Identifier.__eq__.register
@Unsignedint.__eq__.register
@Bool.__eq__.register
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
450,
66,
198,
198,
6738,
19720,
1330,
7343,
11,
8255,
11,
5994,
19852,
11,
42044,
198,
6738,
450,
66,
1330,
9738,
198,
6738,
1257,
310,
10141,
1330,
31958,
8802,
963,
24396,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
1976,
87,
2414,
66,
13,
19199,
1330,
5994,
11,
4889,
540,
198,
198,
51,
796,
5994,
19852,
7203,
51,
4943,
628,
628,
628,
198,
31,
50,
73,
8597,
9541,
43826,
9442,
15167,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
15167,
13,
834,
27363,
834,
13,
30238,
628,
198,
31,
19608,
330,
31172,
628,
198,
198,
31,
22203,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
12235,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
1532,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
18557,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
5756,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
8021,
16747,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
13615,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
36,
13255,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
3673,
36,
13255,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
4550,
653,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
7004,
83,
7861,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
32863,
341,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
22203,
14134,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
33234,
7483,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
3118,
32696,
600,
13,
834,
27363,
834,
13,
30238,
628,
198,
198,
31,
33,
970,
13,
834,
27363,
834,
13,
30238,
198
] | 2.666667 | 297 |
import datetime
import logging
import os
from threading import Thread
import cv2
from lib.cleanup import SegmentCleanup
from lib.helpers import draw_objects
from lib.mqtt.camera import MQTTCamera
from lib.segments import Segments
LOGGER = logging.getLogger(__name__)
| [
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
4704,
278,
1330,
14122,
198,
198,
11748,
269,
85,
17,
198,
198,
6738,
9195,
13,
27773,
929,
1330,
1001,
5154,
32657,
929,
198,
6738,
9195,
13,
16794,
364,
1330,
3197,
62,
48205,
198,
6738,
9195,
13,
76,
80,
926,
13,
25695,
1330,
337,
48,
51,
4825,
18144,
198,
6738,
9195,
13,
325,
11726,
1330,
1001,
11726,
198,
198,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 3.26506 | 83 |
#!/usr/bin/env python
__author__ = "bt3"
if __name__ == '__main__':
test_setdef()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
834,
9800,
834,
796,
366,
18347,
18,
1,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1332,
62,
2617,
4299,
3419,
628
] | 2.214286 | 42 |
from Foundation import *
import objc
import sys
print "PyTestPlugin", __name__
print u"[inside] currentBundle %r" % (objc.currentBundle(),)
| [
6738,
5693,
1330,
1635,
198,
11748,
26181,
66,
198,
11748,
25064,
198,
198,
4798,
366,
20519,
14402,
37233,
1600,
11593,
3672,
834,
198,
4798,
334,
17912,
48787,
60,
1459,
33,
31249,
4064,
81,
1,
4064,
357,
26801,
66,
13,
14421,
33,
31249,
22784,
8,
198
] | 3.133333 | 45 |
from __future__ import annotations
from typing import Sequence, Union, Optional
from securify.grammar import abstract_production, production
@abstract_production
@abstract_production
@production
@production
@production
@production
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
45835,
11,
4479,
11,
32233,
198,
198,
6738,
792,
333,
1958,
13,
4546,
3876,
1330,
12531,
62,
25493,
11,
3227,
628,
198,
31,
397,
8709,
62,
25493,
198,
198,
31,
397,
8709,
62,
25493,
198,
198,
31,
25493,
628,
198,
31,
25493,
628,
198,
31,
25493,
628,
198,
31,
25493,
198
] | 3.919355 | 62 |
#!/usr/bin/env python3
from os import environ
from json import dumps
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
28686,
1330,
551,
2268,
198,
6738,
33918,
1330,
45514,
628,
628,
198
] | 3.083333 | 24 |
from argparse import ArgumentParser
from sys import exit, stderr
| [
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
25064,
1330,
8420,
11,
336,
1082,
81,
628
] | 4.125 | 16 |
# -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Vega's methods."""
__all__ = [
"set_backend",
"is_cpu_device", "is_gpu_device", "is_npu_device",
"is_ms_backend", "is_tf_backend", "is_torch_backend",
"get_devices",
"ClassFactory", "ClassType",
"FileOps",
"run",
"init_cluster_args",
"module_existed",
"TrialAgent",
"get_network",
"get_dataset",
"get_trainer",
"get_quota",
]
__version__ = "1.8.0"
import sys
if sys.version_info < (3, 6):
sys.exit('Sorry, Python < 3.6 is not supported.')
from .common.backend_register import set_backend, is_cpu_device, is_gpu_device, is_npu_device, \
is_ms_backend, is_tf_backend, is_torch_backend, get_devices
from .common.class_factory import ClassFactory, ClassType
from .common.file_ops import FileOps
from .core import run, init_cluster_args, module_existed
from .trainer.trial_agent import TrialAgent
from . import quota
def get_network(name, **kwargs):
"""Return network."""
return ClassFactory.get_cls(ClassType.NETWORK, name)(**kwargs)
def get_dataset(name, **kwargs):
"""Return dataset."""
return ClassFactory.get_cls(ClassType.DATASET, name)(**kwargs)
def get_trainer(name="Trainer", **kwargs):
"""Return trainer."""
return ClassFactory.get_cls(ClassType.TRAINER, name)(**kwargs)
def get_quota(**kwargs):
"""Return quota."""
return ClassFactory.get_cls(ClassType.QUOTA, "Quota")(**kwargs)
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
34,
8,
12131,
13,
43208,
21852,
1766,
1539,
12052,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
198,
37811,
53,
26470,
338,
5050,
526,
15931,
628,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
2617,
62,
1891,
437,
1600,
198,
220,
220,
220,
366,
271,
62,
36166,
62,
25202,
1600,
366,
271,
62,
46999,
62,
25202,
1600,
366,
271,
62,
77,
19944,
62,
25202,
1600,
198,
220,
220,
220,
366,
271,
62,
907,
62,
1891,
437,
1600,
366,
271,
62,
27110,
62,
1891,
437,
1600,
366,
271,
62,
13165,
354,
62,
1891,
437,
1600,
198,
220,
220,
220,
366,
1136,
62,
42034,
1600,
198,
220,
220,
220,
366,
9487,
22810,
1600,
366,
9487,
6030,
1600,
198,
220,
220,
220,
366,
8979,
41472,
1600,
198,
220,
220,
220,
366,
5143,
1600,
198,
220,
220,
220,
366,
15003,
62,
565,
5819,
62,
22046,
1600,
198,
220,
220,
220,
366,
21412,
62,
1069,
6347,
1600,
198,
220,
220,
220,
366,
51,
4454,
36772,
1600,
198,
220,
220,
220,
366,
1136,
62,
27349,
1600,
198,
220,
220,
220,
366,
1136,
62,
19608,
292,
316,
1600,
198,
220,
220,
220,
366,
1136,
62,
2213,
10613,
1600,
198,
220,
220,
220,
366,
1136,
62,
421,
4265,
1600,
198,
60,
198,
198,
834,
9641,
834,
796,
366,
16,
13,
23,
13,
15,
1,
628,
198,
11748,
25064,
198,
361,
25064,
13,
9641,
62,
10951,
1279,
357,
18,
11,
718,
2599,
198,
220,
220,
220,
25064,
13,
37023,
10786,
14385,
11,
11361,
1279,
513,
13,
21,
318,
407,
4855,
2637,
8,
628,
198,
6738,
764,
11321,
13,
1891,
437,
62,
30238,
1330,
900,
62,
1891,
437,
11,
318,
62,
36166,
62,
25202,
11,
318,
62,
46999,
62,
25202,
11,
318,
62,
77,
19944,
62,
25202,
11,
3467,
198,
220,
220,
220,
318,
62,
907,
62,
1891,
437,
11,
318,
62,
27110,
62,
1891,
437,
11,
318,
62,
13165,
354,
62,
1891,
437,
11,
651,
62,
42034,
198,
6738,
764,
11321,
13,
4871,
62,
69,
9548,
1330,
5016,
22810,
11,
5016,
6030,
198,
6738,
764,
11321,
13,
7753,
62,
2840,
1330,
9220,
41472,
198,
6738,
764,
7295,
1330,
1057,
11,
2315,
62,
565,
5819,
62,
22046,
11,
8265,
62,
1069,
6347,
198,
6738,
764,
2213,
10613,
13,
45994,
62,
25781,
1330,
21960,
36772,
198,
6738,
764,
1330,
32539,
628,
198,
4299,
651,
62,
27349,
7,
3672,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
13615,
3127,
526,
15931,
198,
220,
220,
220,
1441,
5016,
22810,
13,
1136,
62,
565,
82,
7,
9487,
6030,
13,
12884,
33249,
11,
1438,
5769,
1174,
46265,
22046,
8,
628,
198,
4299,
651,
62,
19608,
292,
316,
7,
3672,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
13615,
27039,
526,
15931,
198,
220,
220,
220,
1441,
5016,
22810,
13,
1136,
62,
565,
82,
7,
9487,
6030,
13,
35,
1404,
1921,
2767,
11,
1438,
5769,
1174,
46265,
22046,
8,
628,
198,
4299,
651,
62,
2213,
10613,
7,
3672,
2625,
2898,
10613,
1600,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
13615,
21997,
526,
15931,
198,
220,
220,
220,
1441,
5016,
22810,
13,
1136,
62,
565,
82,
7,
9487,
6030,
13,
51,
3861,
1268,
1137,
11,
1438,
5769,
1174,
46265,
22046,
8,
628,
198,
4299,
651,
62,
421,
4265,
7,
1174,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
13615,
32539,
526,
15931,
198,
220,
220,
220,
1441,
5016,
22810,
13,
1136,
62,
565,
82,
7,
9487,
6030,
13,
10917,
29009,
11,
366,
4507,
4265,
4943,
7,
1174,
46265,
22046,
8,
198
] | 2.760811 | 740 |
# -*- coding: utf-8 -*-
"""
Defines unit tests for :mod:`colour.models.cie_lab` module.
"""
from __future__ import division, unicode_literals
import numpy as np
import unittest
from itertools import permutations
from colour.models import XYZ_to_Lab, Lab_to_XYZ, Lab_to_LCHab, LCHab_to_Lab
from colour.utilities import domain_range_scale, ignore_numpy_errors
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2019 - Colour Developers'
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
__maintainer__ = 'Colour Developers'
__email__ = '[email protected]'
__status__ = 'Production'
__all__ = [
'TestXYZ_to_Lab', 'TestLab_to_XYZ', 'TestLab_to_LCHab', 'TestLCHab_to_Lab'
]
class TestXYZ_to_Lab(unittest.TestCase):
"""
Defines :func:`colour.models.cie_lab.XYZ_to_Lab` definition unit tests
methods.
"""
def test_XYZ_to_Lab(self):
"""
Tests :func:`colour.models.cie_lab.XYZ_to_Lab` definition.
"""
np.testing.assert_almost_equal(
XYZ_to_Lab(np.array([0.20654008, 0.12197225, 0.05136952])),
np.array([41.52787529, 52.63858304, 26.92317922]),
decimal=7)
np.testing.assert_almost_equal(
XYZ_to_Lab(np.array([0.14222010, 0.23042768, 0.10495772])),
np.array([55.11636304, -41.08791787, 30.91825778]),
decimal=7)
np.testing.assert_almost_equal(
XYZ_to_Lab(np.array([0.07818780, 0.06157201, 0.28099326])),
np.array([29.80565520, 20.01830466, -48.34913874]),
decimal=7)
np.testing.assert_almost_equal(
XYZ_to_Lab(
np.array([0.20654008, 0.12197225, 0.05136952]),
np.array([0.44757, 0.40745])),
np.array([41.52787529, 38.48089305, -5.73295122]),
decimal=7)
np.testing.assert_almost_equal(
XYZ_to_Lab(
np.array([0.20654008, 0.12197225, 0.05136952]),
np.array([0.34570, 0.35850])),
np.array([41.52787529, 51.19354174, 19.91843098]),
decimal=7)
np.testing.assert_almost_equal(
XYZ_to_Lab(
np.array([0.20654008, 0.12197225, 0.05136952]),
np.array([0.34570, 0.35850, 1.00000])),
np.array([41.52787529, 51.19354174, 19.91843098]),
decimal=7)
def test_n_dimensional_XYZ_to_Lab(self):
"""
Tests :func:`colour.models.cie_lab.XYZ_to_Lab` definition n-dimensional
support.
"""
XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
illuminant = np.array([0.31270, 0.32900])
Lab = XYZ_to_Lab(XYZ, illuminant)
XYZ = np.tile(XYZ, (6, 1))
Lab = np.tile(Lab, (6, 1))
np.testing.assert_almost_equal(
XYZ_to_Lab(XYZ, illuminant), Lab, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
XYZ_to_Lab(XYZ, illuminant), Lab, decimal=7)
XYZ = np.reshape(XYZ, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
Lab = np.reshape(Lab, (2, 3, 3))
np.testing.assert_almost_equal(
XYZ_to_Lab(XYZ, illuminant), Lab, decimal=7)
def test_domain_range_scale_XYZ_to_Lab(self):
"""
Tests :func:`colour.models.cie_lab.XYZ_to_Lab` definition
domain and range scale support.
"""
XYZ = np.array([0.20654008, 0.12197225, 0.05136952])
illuminant = np.array([0.31270, 0.32900])
Lab = XYZ_to_Lab(XYZ, illuminant)
d_r = (('reference', 1, 1), (1, 1, 0.01), (100, 100, 1))
for scale, factor_a, factor_b in d_r:
with domain_range_scale(scale):
np.testing.assert_almost_equal(
XYZ_to_Lab(XYZ * factor_a, illuminant),
Lab * factor_b,
decimal=7)
@ignore_numpy_errors
def test_nan_XYZ_to_Lab(self):
"""
Tests :func:`colour.models.cie_lab.XYZ_to_Lab` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = set(permutations(cases * 3, r=3))
for case in cases:
XYZ = np.array(case)
illuminant = np.array(case[0:2])
XYZ_to_Lab(XYZ, illuminant)
class TestLab_to_XYZ(unittest.TestCase):
"""
Defines :func:`colour.models.cie_lab.Lab_to_XYZ` definition unit tests
methods.
"""
def test_Lab_to_XYZ(self):
"""
Tests :func:`colour.models.cie_lab.Lab_to_XYZ` definition.
"""
np.testing.assert_almost_equal(
Lab_to_XYZ(np.array([41.52787529, 52.63858304, 26.92317922])),
np.array([0.20654008, 0.12197225, 0.05136952]),
decimal=7)
np.testing.assert_almost_equal(
Lab_to_XYZ(np.array([55.11636304, -41.08791787, 30.91825778])),
np.array([0.14222010, 0.23042768, 0.10495772]),
decimal=7)
np.testing.assert_almost_equal(
Lab_to_XYZ(np.array([29.80565520, 20.01830466, -48.34913874])),
np.array([0.07818780, 0.06157201, 0.28099326]),
decimal=7)
np.testing.assert_almost_equal(
Lab_to_XYZ(
np.array([41.52787529, 38.48089305, -5.73295122]),
np.array([0.44757, 0.40745])),
np.array([0.20654008, 0.12197225, 0.05136952]),
decimal=7)
np.testing.assert_almost_equal(
Lab_to_XYZ(
np.array([41.52787529, 51.19354174, 19.91843098]),
np.array([0.34570, 0.35850])),
np.array([0.20654008, 0.12197225, 0.05136952]),
decimal=7)
np.testing.assert_almost_equal(
Lab_to_XYZ(
np.array([41.52787529, 51.19354174, 19.91843098]),
np.array([0.34570, 0.35850, 1.00000])),
np.array([0.20654008, 0.12197225, 0.05136952]),
decimal=7)
def test_n_dimensional_Lab_to_XYZ(self):
"""
Tests :func:`colour.models.cie_lab.Lab_to_XYZ` definition n-dimensional
support.
"""
Lab = np.array([41.52787529, 52.63858304, 26.92317922])
illuminant = np.array([0.31270, 0.32900])
XYZ = Lab_to_XYZ(Lab, illuminant)
Lab = np.tile(Lab, (6, 1))
XYZ = np.tile(XYZ, (6, 1))
np.testing.assert_almost_equal(
Lab_to_XYZ(Lab, illuminant), XYZ, decimal=7)
illuminant = np.tile(illuminant, (6, 1))
np.testing.assert_almost_equal(
Lab_to_XYZ(Lab, illuminant), XYZ, decimal=7)
Lab = np.reshape(Lab, (2, 3, 3))
illuminant = np.reshape(illuminant, (2, 3, 2))
XYZ = np.reshape(XYZ, (2, 3, 3))
np.testing.assert_almost_equal(
Lab_to_XYZ(Lab, illuminant), XYZ, decimal=7)
def test_domain_range_scale_Lab_to_XYZ(self):
"""
Tests :func:`colour.models.cie_lab.Lab_to_XYZ` definition
domain and range scale support.
"""
Lab = np.array([41.52787529, 52.63858304, 26.92317922])
illuminant = np.array([0.31270, 0.32900])
XYZ = Lab_to_XYZ(Lab, illuminant)
d_r = (('reference', 1, 1), (1, 0.01, 1), (100, 1, 100))
for scale, factor_a, factor_b in d_r:
with domain_range_scale(scale):
np.testing.assert_almost_equal(
Lab_to_XYZ(Lab * factor_a, illuminant),
XYZ * factor_b,
decimal=7)
@ignore_numpy_errors
def test_nan_Lab_to_XYZ(self):
"""
Tests :func:`colour.models.cie_lab.Lab_to_XYZ` definition nan support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = set(permutations(cases * 3, r=3))
for case in cases:
Lab = np.array(case)
illuminant = np.array(case[0:2])
Lab_to_XYZ(Lab, illuminant)
class TestLab_to_LCHab(unittest.TestCase):
"""
Defines :func:`colour.models.cie_lab.Lab_to_LCHab` definition unit tests
methods.
"""
def test_Lab_to_LCHab(self):
"""
Tests :func:`colour.models.cie_lab.Lab_to_LCHab` definition.
"""
np.testing.assert_almost_equal(
Lab_to_LCHab(np.array([41.52787529, 52.63858304, 26.92317922])),
np.array([41.52787529, 59.12425901, 27.08848784]),
decimal=7)
np.testing.assert_almost_equal(
Lab_to_LCHab(np.array([55.11636304, -41.08791787, 30.91825778])),
np.array([55.11636304, 51.42135412, 143.03889556]),
decimal=7)
np.testing.assert_almost_equal(
Lab_to_LCHab(np.array([29.80565520, 20.01830466, -48.34913874])),
np.array([29.80565520, 52.32945383, 292.49133666]),
decimal=7)
def test_n_dimensional_Lab_to_LCHab(self):
"""
Tests :func:`colour.models.cie_lab.Lab_to_LCHab` definition
n-dimensional arrays support.
"""
Lab = np.array([41.52787529, 52.63858304, 26.92317922])
LCHab = Lab_to_LCHab(Lab)
Lab = np.tile(Lab, (6, 1))
LCHab = np.tile(LCHab, (6, 1))
np.testing.assert_almost_equal(Lab_to_LCHab(Lab), LCHab, decimal=7)
Lab = np.reshape(Lab, (2, 3, 3))
LCHab = np.reshape(LCHab, (2, 3, 3))
np.testing.assert_almost_equal(Lab_to_LCHab(Lab), LCHab, decimal=7)
def test_domain_range_scale_Lab_to_LCHab(self):
"""
Tests :func:`colour.models.cie_lab.Lab_to_LCHab` definition domain and
range scale support.
"""
Lab = np.array([41.52787529, 52.63858304, 26.92317922])
LCHab = Lab_to_LCHab(Lab)
d_r = (('reference', 1, 1), (1, 0.01, np.array([0.01, 0.01, 1 / 360])),
(100, 1, np.array([1, 1, 1 / 3.6])))
for scale, factor_a, factor_b in d_r:
with domain_range_scale(scale):
np.testing.assert_almost_equal(
Lab_to_LCHab(Lab * factor_a), LCHab * factor_b, decimal=7)
@ignore_numpy_errors
def test_nan_Lab_to_LCHab(self):
"""
Tests :func:`colour.models.cie_lab.Lab_to_LCHab` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = set(permutations(cases * 3, r=3))
for case in cases:
Lab = np.array(case)
Lab_to_LCHab(Lab)
class TestLCHab_to_Lab(unittest.TestCase):
"""
Defines :func:`colour.models.cie_lab.LCHab_to_Lab` definition unit tests
methods.
"""
def test_LCHab_to_Lab(self):
"""
Tests :func:`colour.models.cie_lab.LCHab_to_Lab` definition.
"""
np.testing.assert_almost_equal(
LCHab_to_Lab(np.array([41.52787529, 59.12425901, 27.08848784])),
np.array([41.52787529, 52.63858304, 26.92317922]),
decimal=7)
np.testing.assert_almost_equal(
LCHab_to_Lab(np.array([55.11636304, 51.42135412, 143.03889556])),
np.array([55.11636304, -41.08791787, 30.91825778]),
decimal=7)
np.testing.assert_almost_equal(
LCHab_to_Lab(np.array([29.80565520, 52.32945383, 292.49133666])),
np.array([29.80565520, 20.01830466, -48.34913874]),
decimal=7)
def test_n_dimensional_LCHab_to_Lab(self):
"""
Tests :func:`colour.models.cie_lab.LCHab_to_Lab` definition
n-dimensional arrays support.
"""
LCHab = np.array([41.52787529, 59.12425901, 27.08848784])
Lab = LCHab_to_Lab(LCHab)
LCHab = np.tile(LCHab, (6, 1))
Lab = np.tile(Lab, (6, 1))
np.testing.assert_almost_equal(LCHab_to_Lab(LCHab), Lab, decimal=7)
LCHab = np.reshape(LCHab, (2, 3, 3))
Lab = np.reshape(Lab, (2, 3, 3))
np.testing.assert_almost_equal(LCHab_to_Lab(LCHab), Lab, decimal=7)
def test_domain_range_scale_LCHab_to_Lab(self):
"""
Tests :func:`colour.models.cie_lab.LCHab_to_Lab` definition domain and
range scale support.
"""
LCHab = np.array([41.52787529, 59.12425901, 27.08848784])
Lab = LCHab_to_Lab(LCHab)
d_r = (('reference', 1, 1), (1, np.array([0.01, 0.01, 1 / 360]), 0.01),
(100, np.array([1, 1, 1 / 3.6]), 1))
for scale, factor_a, factor_b in d_r:
with domain_range_scale(scale):
np.testing.assert_almost_equal(
LCHab_to_Lab(LCHab * factor_a), Lab * factor_b, decimal=7)
@ignore_numpy_errors
def test_nan_LCHab_to_Lab(self):
"""
Tests :func:`colour.models.cie_lab.LCHab_to_Lab` definition nan
support.
"""
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = set(permutations(cases * 3, r=3))
for case in cases:
LCHab = np.array(case)
LCHab_to_Lab(LCHab)
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
7469,
1127,
4326,
5254,
329,
1058,
4666,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
63,
8265,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
555,
715,
395,
198,
6738,
340,
861,
10141,
1330,
9943,
32855,
198,
198,
6738,
9568,
13,
27530,
1330,
41420,
57,
62,
1462,
62,
17822,
11,
3498,
62,
1462,
62,
34278,
57,
11,
3498,
62,
1462,
62,
43,
3398,
397,
11,
406,
3398,
397,
62,
1462,
62,
17822,
198,
6738,
9568,
13,
315,
2410,
1330,
7386,
62,
9521,
62,
9888,
11,
8856,
62,
77,
32152,
62,
48277,
198,
198,
834,
9800,
834,
796,
705,
5216,
454,
34152,
6,
198,
834,
22163,
4766,
834,
796,
705,
15269,
357,
34,
8,
2211,
12,
23344,
532,
38773,
34152,
6,
198,
834,
43085,
834,
796,
705,
3791,
347,
10305,
13789,
532,
3740,
1378,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
21800,
12,
18,
12,
2601,
682,
6,
198,
834,
76,
2913,
10613,
834,
796,
705,
5216,
454,
34152,
6,
198,
834,
12888,
834,
796,
705,
49903,
12,
16244,
364,
31,
49903,
12,
16801,
13,
2398,
6,
198,
834,
13376,
834,
796,
705,
35027,
6,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
14402,
34278,
57,
62,
1462,
62,
17822,
3256,
705,
14402,
17822,
62,
1462,
62,
34278,
57,
3256,
705,
14402,
17822,
62,
1462,
62,
43,
3398,
397,
3256,
705,
14402,
43,
3398,
397,
62,
1462,
62,
17822,
6,
198,
60,
628,
198,
4871,
6208,
34278,
57,
62,
1462,
62,
17822,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2896,
1127,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
34278,
57,
62,
1462,
62,
17822,
63,
6770,
4326,
5254,
198,
220,
220,
220,
5050,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1332,
62,
34278,
57,
62,
1462,
62,
17822,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
34278,
57,
62,
1462,
62,
17822,
63,
6770,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
37659,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6740,
13,
21,
2548,
3365,
21288,
11,
2608,
13,
24,
1954,
21738,
1828,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
37659,
13,
18747,
26933,
15,
13,
1415,
1828,
10333,
11,
657,
13,
19214,
42363,
3104,
11,
657,
13,
940,
33781,
43571,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
2816,
13,
18298,
2623,
21288,
11,
532,
3901,
13,
2919,
3720,
1558,
5774,
11,
1542,
13,
24,
1507,
1495,
39761,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
37659,
13,
18747,
26933,
15,
13,
2998,
23,
23451,
1795,
11,
657,
13,
3312,
18458,
1264,
11,
657,
13,
21033,
2079,
39195,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
1959,
13,
1795,
3980,
2816,
1238,
11,
1160,
13,
29159,
21288,
2791,
11,
532,
2780,
13,
27371,
20107,
4524,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
2598,
39251,
11,
657,
13,
30120,
2231,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
4353,
13,
22148,
4531,
22515,
11,
532,
20,
13,
4790,
25710,
18376,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
27712,
2154,
11,
657,
13,
2327,
25764,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6885,
13,
1129,
32182,
22985,
11,
678,
13,
24,
22883,
1270,
4089,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
27712,
2154,
11,
657,
13,
2327,
25764,
11,
352,
13,
20483,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6885,
13,
1129,
32182,
22985,
11,
678,
13,
24,
22883,
1270,
4089,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
825,
1332,
62,
77,
62,
19577,
62,
34278,
57,
62,
1462,
62,
17822,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
34278,
57,
62,
1462,
62,
17822,
63,
6770,
299,
12,
19577,
198,
220,
220,
220,
220,
220,
220,
220,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
18747,
26933,
15,
13,
27970,
2154,
11,
657,
13,
37967,
405,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
41420,
57,
62,
1462,
62,
17822,
7,
34278,
57,
11,
2801,
7230,
415,
8,
628,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
45941,
13,
40927,
7,
34278,
57,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
40927,
7,
17822,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
34278,
57,
11,
2801,
7230,
415,
828,
3498,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
40927,
7,
359,
7230,
415,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
34278,
57,
11,
2801,
7230,
415,
828,
3498,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
45941,
13,
3447,
1758,
7,
34278,
57,
11,
357,
17,
11,
513,
11,
513,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
3447,
1758,
7,
359,
7230,
415,
11,
357,
17,
11,
513,
11,
362,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
3447,
1758,
7,
17822,
11,
357,
17,
11,
513,
11,
513,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
34278,
57,
11,
2801,
7230,
415,
828,
3498,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
825,
1332,
62,
27830,
62,
9521,
62,
9888,
62,
34278,
57,
62,
1462,
62,
17822,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
34278,
57,
62,
1462,
62,
17822,
63,
6770,
198,
220,
220,
220,
220,
220,
220,
220,
7386,
290,
2837,
5046,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
18747,
26933,
15,
13,
27970,
2154,
11,
657,
13,
37967,
405,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
41420,
57,
62,
1462,
62,
17822,
7,
34278,
57,
11,
2801,
7230,
415,
8,
628,
220,
220,
220,
220,
220,
220,
220,
288,
62,
81,
796,
357,
10786,
35790,
3256,
352,
11,
352,
828,
357,
16,
11,
352,
11,
657,
13,
486,
828,
357,
3064,
11,
1802,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
5046,
11,
5766,
62,
64,
11,
5766,
62,
65,
287,
288,
62,
81,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
7386,
62,
9521,
62,
9888,
7,
9888,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
34278,
57,
1635,
5766,
62,
64,
11,
2801,
7230,
415,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
1635,
5766,
62,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
2488,
46430,
62,
77,
32152,
62,
48277,
198,
220,
220,
220,
825,
1332,
62,
12647,
62,
34278,
57,
62,
1462,
62,
17822,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
34278,
57,
62,
1462,
62,
17822,
63,
6770,
15709,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2663,
796,
25915,
16,
13,
15,
11,
657,
13,
15,
11,
352,
13,
15,
11,
532,
37659,
13,
10745,
11,
45941,
13,
10745,
11,
45941,
13,
12647,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2663,
796,
900,
7,
16321,
32855,
7,
33964,
1635,
513,
11,
374,
28,
18,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1339,
287,
2663,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
45941,
13,
18747,
7,
7442,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
18747,
7,
7442,
58,
15,
25,
17,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
62,
1462,
62,
17822,
7,
34278,
57,
11,
2801,
7230,
415,
8,
628,
198,
4871,
6208,
17822,
62,
1462,
62,
34278,
57,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2896,
1127,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
34278,
57,
63,
6770,
4326,
5254,
198,
220,
220,
220,
5050,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1332,
62,
17822,
62,
1462,
62,
34278,
57,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
34278,
57,
63,
6770,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
37659,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6740,
13,
21,
2548,
3365,
21288,
11,
2608,
13,
24,
1954,
21738,
1828,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
37659,
13,
18747,
26933,
2816,
13,
18298,
2623,
21288,
11,
532,
3901,
13,
2919,
3720,
1558,
5774,
11,
1542,
13,
24,
1507,
1495,
39761,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
1415,
1828,
10333,
11,
657,
13,
19214,
42363,
3104,
11,
657,
13,
940,
33781,
43571,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
37659,
13,
18747,
26933,
1959,
13,
1795,
3980,
2816,
1238,
11,
1160,
13,
29159,
21288,
2791,
11,
532,
2780,
13,
27371,
20107,
4524,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
2998,
23,
23451,
1795,
11,
657,
13,
3312,
18458,
1264,
11,
657,
13,
21033,
2079,
39195,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
4353,
13,
22148,
4531,
22515,
11,
532,
20,
13,
4790,
25710,
18376,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
2598,
39251,
11,
657,
13,
30120,
2231,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6885,
13,
1129,
32182,
22985,
11,
678,
13,
24,
22883,
1270,
4089,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
27712,
2154,
11,
657,
13,
2327,
25764,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6885,
13,
1129,
32182,
22985,
11,
678,
13,
24,
22883,
1270,
4089,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
27712,
2154,
11,
657,
13,
2327,
25764,
11,
352,
13,
20483,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
15,
13,
1238,
2996,
7029,
23,
11,
657,
13,
1065,
41023,
1495,
11,
657,
13,
2713,
1485,
3388,
4309,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
825,
1332,
62,
77,
62,
19577,
62,
17822,
62,
1462,
62,
34278,
57,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
34278,
57,
63,
6770,
299,
12,
19577,
198,
220,
220,
220,
220,
220,
220,
220,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6740,
13,
21,
2548,
3365,
21288,
11,
2608,
13,
24,
1954,
21738,
1828,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
18747,
26933,
15,
13,
27970,
2154,
11,
657,
13,
37967,
405,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
3498,
62,
1462,
62,
34278,
57,
7,
17822,
11,
2801,
7230,
415,
8,
628,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
40927,
7,
17822,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
45941,
13,
40927,
7,
34278,
57,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
17822,
11,
2801,
7230,
415,
828,
41420,
57,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
40927,
7,
359,
7230,
415,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
17822,
11,
2801,
7230,
415,
828,
41420,
57,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
3447,
1758,
7,
17822,
11,
357,
17,
11,
513,
11,
513,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
3447,
1758,
7,
359,
7230,
415,
11,
357,
17,
11,
513,
11,
362,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
45941,
13,
3447,
1758,
7,
34278,
57,
11,
357,
17,
11,
513,
11,
513,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
17822,
11,
2801,
7230,
415,
828,
41420,
57,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
825,
1332,
62,
27830,
62,
9521,
62,
9888,
62,
17822,
62,
1462,
62,
34278,
57,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
34278,
57,
63,
6770,
198,
220,
220,
220,
220,
220,
220,
220,
7386,
290,
2837,
5046,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6740,
13,
21,
2548,
3365,
21288,
11,
2608,
13,
24,
1954,
21738,
1828,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
18747,
26933,
15,
13,
27970,
2154,
11,
657,
13,
37967,
405,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
796,
3498,
62,
1462,
62,
34278,
57,
7,
17822,
11,
2801,
7230,
415,
8,
628,
220,
220,
220,
220,
220,
220,
220,
288,
62,
81,
796,
357,
10786,
35790,
3256,
352,
11,
352,
828,
357,
16,
11,
657,
13,
486,
11,
352,
828,
357,
3064,
11,
352,
11,
1802,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
5046,
11,
5766,
62,
64,
11,
5766,
62,
65,
287,
288,
62,
81,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
7386,
62,
9521,
62,
9888,
7,
9888,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
17822,
1635,
5766,
62,
64,
11,
2801,
7230,
415,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41420,
57,
1635,
5766,
62,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
2488,
46430,
62,
77,
32152,
62,
48277,
198,
220,
220,
220,
825,
1332,
62,
12647,
62,
17822,
62,
1462,
62,
34278,
57,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
34278,
57,
63,
6770,
15709,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2663,
796,
25915,
16,
13,
15,
11,
657,
13,
15,
11,
352,
13,
15,
11,
532,
37659,
13,
10745,
11,
45941,
13,
10745,
11,
45941,
13,
12647,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2663,
796,
900,
7,
16321,
32855,
7,
33964,
1635,
513,
11,
374,
28,
18,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1339,
287,
2663,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
18747,
7,
7442,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2801,
7230,
415,
796,
45941,
13,
18747,
7,
7442,
58,
15,
25,
17,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
34278,
57,
7,
17822,
11,
2801,
7230,
415,
8,
628,
198,
4871,
6208,
17822,
62,
1462,
62,
43,
3398,
397,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2896,
1127,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
43,
3398,
397,
63,
6770,
4326,
5254,
198,
220,
220,
220,
5050,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1332,
62,
17822,
62,
1462,
62,
43,
3398,
397,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
43,
3398,
397,
63,
6770,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
43,
3398,
397,
7,
37659,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6740,
13,
21,
2548,
3365,
21288,
11,
2608,
13,
24,
1954,
21738,
1828,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
7863,
13,
17464,
25191,
486,
11,
2681,
13,
46556,
2780,
37688,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
43,
3398,
397,
7,
37659,
13,
18747,
26933,
2816,
13,
18298,
2623,
21288,
11,
532,
3901,
13,
2919,
3720,
1558,
5774,
11,
1542,
13,
24,
1507,
1495,
39761,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
2816,
13,
18298,
2623,
21288,
11,
6885,
13,
3682,
1485,
4051,
1065,
11,
24356,
13,
15,
2548,
4531,
37864,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
43,
3398,
397,
7,
37659,
13,
18747,
26933,
1959,
13,
1795,
3980,
2816,
1238,
11,
1160,
13,
29159,
21288,
2791,
11,
532,
2780,
13,
27371,
20107,
4524,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
1959,
13,
1795,
3980,
2816,
1238,
11,
6740,
13,
37967,
2231,
34741,
11,
41569,
13,
2920,
1485,
2623,
2791,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
825,
1332,
62,
77,
62,
19577,
62,
17822,
62,
1462,
62,
43,
3398,
397,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
43,
3398,
397,
63,
6770,
198,
220,
220,
220,
220,
220,
220,
220,
299,
12,
19577,
26515,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6740,
13,
21,
2548,
3365,
21288,
11,
2608,
13,
24,
1954,
21738,
1828,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
3498,
62,
1462,
62,
43,
3398,
397,
7,
17822,
8,
628,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
40927,
7,
17822,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
45941,
13,
40927,
7,
43,
3398,
397,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
17822,
62,
1462,
62,
43,
3398,
397,
7,
17822,
828,
406,
3398,
397,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
3447,
1758,
7,
17822,
11,
357,
17,
11,
513,
11,
513,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
45941,
13,
3447,
1758,
7,
43,
3398,
397,
11,
357,
17,
11,
513,
11,
513,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
17822,
62,
1462,
62,
43,
3398,
397,
7,
17822,
828,
406,
3398,
397,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
825,
1332,
62,
27830,
62,
9521,
62,
9888,
62,
17822,
62,
1462,
62,
43,
3398,
397,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
43,
3398,
397,
63,
6770,
7386,
290,
198,
220,
220,
220,
220,
220,
220,
220,
2837,
5046,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6740,
13,
21,
2548,
3365,
21288,
11,
2608,
13,
24,
1954,
21738,
1828,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
3498,
62,
1462,
62,
43,
3398,
397,
7,
17822,
8,
628,
220,
220,
220,
220,
220,
220,
220,
288,
62,
81,
796,
357,
10786,
35790,
3256,
352,
11,
352,
828,
357,
16,
11,
657,
13,
486,
11,
45941,
13,
18747,
26933,
15,
13,
486,
11,
657,
13,
486,
11,
352,
1220,
11470,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
3064,
11,
352,
11,
45941,
13,
18747,
26933,
16,
11,
352,
11,
352,
1220,
513,
13,
21,
60,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
329,
5046,
11,
5766,
62,
64,
11,
5766,
62,
65,
287,
288,
62,
81,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
7386,
62,
9521,
62,
9888,
7,
9888,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
43,
3398,
397,
7,
17822,
1635,
5766,
62,
64,
828,
406,
3398,
397,
1635,
5766,
62,
65,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
2488,
46430,
62,
77,
32152,
62,
48277,
198,
220,
220,
220,
825,
1332,
62,
12647,
62,
17822,
62,
1462,
62,
43,
3398,
397,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
17822,
62,
1462,
62,
43,
3398,
397,
63,
6770,
15709,
198,
220,
220,
220,
220,
220,
220,
220,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2663,
796,
25915,
16,
13,
15,
11,
657,
13,
15,
11,
352,
13,
15,
11,
532,
37659,
13,
10745,
11,
45941,
13,
10745,
11,
45941,
13,
12647,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2663,
796,
900,
7,
16321,
32855,
7,
33964,
1635,
513,
11,
374,
28,
18,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1339,
287,
2663,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
18747,
7,
7442,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3498,
62,
1462,
62,
43,
3398,
397,
7,
17822,
8,
628,
198,
4871,
6208,
43,
3398,
397,
62,
1462,
62,
17822,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2896,
1127,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
43,
3398,
397,
62,
1462,
62,
17822,
63,
6770,
4326,
5254,
198,
220,
220,
220,
5050,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1332,
62,
43,
3398,
397,
62,
1462,
62,
17822,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
43,
3398,
397,
62,
1462,
62,
17822,
63,
6770,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
62,
1462,
62,
17822,
7,
37659,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
7863,
13,
17464,
25191,
486,
11,
2681,
13,
46556,
2780,
37688,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
6740,
13,
21,
2548,
3365,
21288,
11,
2608,
13,
24,
1954,
21738,
1828,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
62,
1462,
62,
17822,
7,
37659,
13,
18747,
26933,
2816,
13,
18298,
2623,
21288,
11,
6885,
13,
3682,
1485,
4051,
1065,
11,
24356,
13,
15,
2548,
4531,
37864,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
2816,
13,
18298,
2623,
21288,
11,
532,
3901,
13,
2919,
3720,
1558,
5774,
11,
1542,
13,
24,
1507,
1495,
39761,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
62,
1462,
62,
17822,
7,
37659,
13,
18747,
26933,
1959,
13,
1795,
3980,
2816,
1238,
11,
6740,
13,
37967,
2231,
34741,
11,
41569,
13,
2920,
1485,
2623,
2791,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
18747,
26933,
1959,
13,
1795,
3980,
2816,
1238,
11,
1160,
13,
29159,
21288,
2791,
11,
532,
2780,
13,
27371,
20107,
4524,
46570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32465,
28,
22,
8,
628,
220,
220,
220,
825,
1332,
62,
77,
62,
19577,
62,
43,
3398,
397,
62,
1462,
62,
17822,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
43,
3398,
397,
62,
1462,
62,
17822,
63,
6770,
198,
220,
220,
220,
220,
220,
220,
220,
299,
12,
19577,
26515,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
7863,
13,
17464,
25191,
486,
11,
2681,
13,
46556,
2780,
37688,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
406,
3398,
397,
62,
1462,
62,
17822,
7,
43,
3398,
397,
8,
628,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
45941,
13,
40927,
7,
43,
3398,
397,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
40927,
7,
17822,
11,
357,
21,
11,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
43,
3398,
397,
62,
1462,
62,
17822,
7,
43,
3398,
397,
828,
3498,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
45941,
13,
3447,
1758,
7,
43,
3398,
397,
11,
357,
17,
11,
513,
11,
513,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
45941,
13,
3447,
1758,
7,
17822,
11,
357,
17,
11,
513,
11,
513,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
43,
3398,
397,
62,
1462,
62,
17822,
7,
43,
3398,
397,
828,
3498,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
825,
1332,
62,
27830,
62,
9521,
62,
9888,
62,
43,
3398,
397,
62,
1462,
62,
17822,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
43,
3398,
397,
62,
1462,
62,
17822,
63,
6770,
7386,
290,
198,
220,
220,
220,
220,
220,
220,
220,
2837,
5046,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
45941,
13,
18747,
26933,
3901,
13,
20,
25870,
2425,
1959,
11,
7863,
13,
17464,
25191,
486,
11,
2681,
13,
46556,
2780,
37688,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
3498,
796,
406,
3398,
397,
62,
1462,
62,
17822,
7,
43,
3398,
397,
8,
628,
220,
220,
220,
220,
220,
220,
220,
288,
62,
81,
796,
357,
10786,
35790,
3256,
352,
11,
352,
828,
357,
16,
11,
45941,
13,
18747,
26933,
15,
13,
486,
11,
657,
13,
486,
11,
352,
1220,
11470,
46570,
657,
13,
486,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
3064,
11,
45941,
13,
18747,
26933,
16,
11,
352,
11,
352,
1220,
513,
13,
21,
46570,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
5046,
11,
5766,
62,
64,
11,
5766,
62,
65,
287,
288,
62,
81,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
7386,
62,
9521,
62,
9888,
7,
9888,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
33407,
13,
30493,
62,
28177,
62,
40496,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
62,
1462,
62,
17822,
7,
43,
3398,
397,
1635,
5766,
62,
64,
828,
3498,
1635,
5766,
62,
65,
11,
32465,
28,
22,
8,
628,
220,
220,
220,
2488,
46430,
62,
77,
32152,
62,
48277,
198,
220,
220,
220,
825,
1332,
62,
12647,
62,
43,
3398,
397,
62,
1462,
62,
17822,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
30307,
1058,
20786,
25,
63,
49903,
13,
27530,
13,
66,
494,
62,
23912,
13,
43,
3398,
397,
62,
1462,
62,
17822,
63,
6770,
15709,
198,
220,
220,
220,
220,
220,
220,
220,
1104,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2663,
796,
25915,
16,
13,
15,
11,
657,
13,
15,
11,
352,
13,
15,
11,
532,
37659,
13,
10745,
11,
45941,
13,
10745,
11,
45941,
13,
12647,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2663,
796,
900,
7,
16321,
32855,
7,
33964,
1635,
513,
11,
374,
28,
18,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1339,
287,
2663,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
796,
45941,
13,
18747,
7,
7442,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
406,
3398,
397,
62,
1462,
62,
17822,
7,
43,
3398,
397,
8,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 1.871213 | 6,965 |
from delphin import tdl, itsdb
from delphin.tokens import YYTokenLattice
import glob, sys, pathlib
import json, pickle
import numpy as np
from collections import OrderedDict
import pos_map
from datetime import datetime
CONTEXT_WINDOW = 2
DEV = ['ws212', 'ecpa']
TEST = ['cb', 'ecpr', 'jhk', 'jhu', 'tgk', 'tgu', 'psk', 'psu', #'rondane',
'vm32', 'ws213', 'ws214', 'petet', 'wsj23']
IGNORE = ['ntucle', 'omw', 'wlb03', 'wnb03']
NONTRAIN = DEV + TEST + IGNORE
class LexTypeExtractor:
'''
Assume a numpy table coming in. Get e.g. tokens 2 through 5 in sentences 4 and 5,
for the test suite #20 in the data.
'''
if __name__ == "__main__":
args = sys.argv[1:]
dt_str = '-'.join(str(datetime.now()).split()).replace(':','.')
run_id = sys.argv[3] + dt_str
if len(sys.argv) > 3:
autoreg = sys.argv[4] == 'autoreg'
out_dir = './output/' + run_id
pathlib.Path(out_dir).mkdir(parents=True, exist_ok=False)
le = LexTypeExtractor()
le.parse_lexicons(args[0])
le.stats['total lextypes'] = len(le.lextypes)
if autoreg:
le.process_testsuites_autoreg(args[1],le.lextypes,out_dir)
else:
le.process_testsuites_nonautoreg(args[1],le.lextypes,out_dir)
with open(out_dir + '/lextypes','wb') as f:
lextypes = set([str(v) for v in list(le.lextypes.values())])
pickle.dump(lextypes,f)
| [
6738,
1619,
746,
259,
1330,
256,
25404,
11,
663,
9945,
198,
6738,
1619,
746,
259,
13,
83,
482,
641,
1330,
575,
56,
30642,
43,
1078,
501,
198,
11748,
15095,
11,
25064,
11,
3108,
8019,
198,
11748,
33918,
11,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
1426,
62,
8899,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
10943,
32541,
62,
28929,
3913,
796,
362,
198,
198,
39345,
796,
37250,
18504,
21777,
3256,
705,
721,
8957,
20520,
198,
51,
6465,
796,
37250,
21101,
3256,
705,
721,
1050,
3256,
705,
73,
71,
74,
3256,
705,
73,
13415,
3256,
705,
25297,
74,
3256,
705,
83,
5162,
3256,
705,
862,
74,
3256,
705,
862,
84,
3256,
1303,
6,
81,
623,
1531,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
14761,
2624,
3256,
705,
18504,
26427,
3256,
705,
18504,
22291,
3256,
705,
6449,
316,
3256,
705,
18504,
73,
1954,
20520,
198,
16284,
6965,
796,
37250,
429,
14913,
3256,
705,
296,
86,
3256,
705,
86,
23160,
3070,
3256,
705,
675,
65,
3070,
20520,
198,
45,
35830,
3861,
1268,
796,
5550,
53,
1343,
43001,
1343,
28730,
6965,
628,
198,
4871,
17210,
6030,
11627,
40450,
25,
628,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
2195,
2454,
257,
299,
32152,
3084,
2406,
287,
13,
3497,
304,
13,
70,
13,
16326,
362,
832,
642,
287,
13439,
604,
290,
642,
11,
198,
220,
220,
220,
329,
262,
1332,
18389,
1303,
1238,
287,
262,
1366,
13,
198,
220,
220,
220,
705,
7061,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
26498,
796,
25064,
13,
853,
85,
58,
16,
47715,
198,
220,
220,
220,
288,
83,
62,
2536,
796,
705,
12,
4458,
22179,
7,
2536,
7,
19608,
8079,
13,
2197,
3419,
737,
35312,
3419,
737,
33491,
7,
10354,
41707,
2637,
8,
198,
220,
220,
220,
1057,
62,
312,
796,
25064,
13,
853,
85,
58,
18,
60,
1343,
288,
83,
62,
2536,
198,
220,
220,
220,
611,
18896,
7,
17597,
13,
853,
85,
8,
1875,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1960,
382,
70,
796,
25064,
13,
853,
85,
58,
19,
60,
6624,
705,
2306,
382,
70,
6,
198,
220,
220,
220,
503,
62,
15908,
796,
705,
19571,
22915,
14,
6,
1343,
1057,
62,
312,
198,
220,
220,
220,
3108,
8019,
13,
15235,
7,
448,
62,
15908,
737,
28015,
15908,
7,
23743,
28,
17821,
11,
2152,
62,
482,
28,
25101,
8,
198,
220,
220,
220,
443,
796,
17210,
6030,
11627,
40450,
3419,
198,
220,
220,
220,
443,
13,
29572,
62,
2588,
34280,
7,
22046,
58,
15,
12962,
198,
220,
220,
220,
443,
13,
34242,
17816,
23350,
443,
742,
9497,
20520,
796,
18896,
7,
293,
13,
293,
742,
9497,
8,
198,
220,
220,
220,
611,
1960,
382,
70,
25,
198,
220,
220,
220,
220,
220,
220,
220,
443,
13,
14681,
62,
9288,
2385,
2737,
62,
2306,
382,
70,
7,
22046,
58,
16,
4357,
293,
13,
293,
742,
9497,
11,
448,
62,
15908,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
443,
13,
14681,
62,
9288,
2385,
2737,
62,
13159,
2306,
382,
70,
7,
22046,
58,
16,
4357,
293,
13,
293,
742,
9497,
11,
448,
62,
15908,
8,
198,
220,
220,
220,
351,
1280,
7,
448,
62,
15908,
1343,
31051,
293,
742,
9497,
41707,
39346,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
443,
742,
9497,
796,
900,
26933,
2536,
7,
85,
8,
329,
410,
287,
1351,
7,
293,
13,
293,
742,
9497,
13,
27160,
28955,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2298,
293,
13,
39455,
7,
293,
742,
9497,
11,
69,
8,
628
] | 2.216 | 625 |
"""Support for the Environment Canada radar imagery."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.camera import Camera
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import (
AddEntitiesCallback,
async_get_current_platform,
)
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTR_OBSERVATION_TIME, DOMAIN
SERVICE_SET_RADAR_TYPE = "set_radar_type"
SET_RADAR_TYPE_SCHEMA = {
vol.Required("radar_type"): vol.In(["Auto", "Rain", "Snow"]),
}
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add a weather entity from a config_entry."""
coordinator = hass.data[DOMAIN][config_entry.entry_id]["radar_coordinator"]
async_add_entities([ECCamera(coordinator)])
platform = async_get_current_platform()
platform.async_register_entity_service(
SERVICE_SET_RADAR_TYPE,
SET_RADAR_TYPE_SCHEMA,
"async_set_radar_type",
)
class ECCamera(CoordinatorEntity, Camera):
"""Implementation of an Environment Canada radar camera."""
def __init__(self, coordinator):
"""Initialize the camera."""
super().__init__(coordinator)
Camera.__init__(self)
self.radar_object = coordinator.ec_data
self._attr_name = f"{coordinator.config_entry.title} Radar"
self._attr_unique_id = f"{coordinator.config_entry.unique_id}-radar"
self._attr_attribution = self.radar_object.metadata["attribution"]
self._attr_entity_registry_enabled_default = False
self.content_type = "image/gif"
def camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
"""Return bytes of camera image."""
self._attr_extra_state_attributes = {
ATTR_OBSERVATION_TIME: self.radar_object.timestamp,
}
return self.radar_object.image
async def async_set_radar_type(self, radar_type: str):
"""Set the type of radar to retrieve."""
self.radar_object.precip_type = radar_type.lower()
await self.radar_object.update()
| [
37811,
15514,
329,
262,
9344,
3340,
13428,
19506,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
198,
6738,
1363,
562,
10167,
13,
5589,
3906,
13,
25695,
1330,
20432,
198,
6738,
1363,
562,
10167,
13,
11250,
62,
298,
1678,
1330,
17056,
30150,
198,
6738,
1363,
562,
10167,
13,
7295,
1330,
5995,
48902,
198,
6738,
1363,
562,
10167,
13,
16794,
364,
13,
26858,
62,
24254,
1330,
357,
198,
220,
220,
220,
3060,
14539,
871,
47258,
11,
198,
220,
220,
220,
30351,
62,
1136,
62,
14421,
62,
24254,
11,
198,
8,
198,
6738,
1363,
562,
10167,
13,
16794,
364,
13,
19119,
62,
37652,
20900,
1330,
36831,
32398,
198,
198,
6738,
764,
9979,
1330,
5161,
5446,
62,
46,
4462,
1137,
53,
6234,
62,
34694,
11,
24121,
29833,
198,
198,
35009,
27389,
62,
28480,
62,
49,
2885,
1503,
62,
25216,
796,
366,
2617,
62,
6335,
283,
62,
4906,
1,
198,
28480,
62,
49,
2885,
1503,
62,
25216,
62,
50,
3398,
27630,
796,
1391,
198,
220,
220,
220,
2322,
13,
37374,
7203,
6335,
283,
62,
4906,
1,
2599,
2322,
13,
818,
7,
14692,
27722,
1600,
366,
31443,
1600,
366,
28974,
8973,
828,
198,
92,
628,
198,
292,
13361,
825,
30351,
62,
40406,
62,
13000,
7,
198,
220,
220,
220,
468,
82,
25,
5995,
48902,
11,
198,
220,
220,
220,
4566,
62,
13000,
25,
17056,
30150,
11,
198,
220,
220,
220,
30351,
62,
2860,
62,
298,
871,
25,
3060,
14539,
871,
47258,
11,
198,
8,
4613,
6045,
25,
198,
220,
220,
220,
37227,
4550,
257,
6193,
9312,
422,
257,
4566,
62,
13000,
526,
15931,
198,
220,
220,
220,
16052,
796,
468,
82,
13,
7890,
58,
39170,
29833,
7131,
11250,
62,
13000,
13,
13000,
62,
312,
7131,
1,
6335,
283,
62,
37652,
20900,
8973,
198,
220,
220,
220,
30351,
62,
2860,
62,
298,
871,
26933,
2943,
35632,
7,
37652,
20900,
8,
12962,
628,
220,
220,
220,
3859,
796,
30351,
62,
1136,
62,
14421,
62,
24254,
3419,
198,
220,
220,
220,
3859,
13,
292,
13361,
62,
30238,
62,
26858,
62,
15271,
7,
198,
220,
220,
220,
220,
220,
220,
220,
47453,
62,
28480,
62,
49,
2885,
1503,
62,
25216,
11,
198,
220,
220,
220,
220,
220,
220,
220,
25823,
62,
49,
2885,
1503,
62,
25216,
62,
50,
3398,
27630,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
292,
13361,
62,
2617,
62,
6335,
283,
62,
4906,
1600,
198,
220,
220,
220,
1267,
628,
198,
4871,
412,
4093,
18144,
7,
7222,
585,
20900,
32398,
11,
20432,
2599,
198,
220,
220,
220,
37227,
3546,
32851,
286,
281,
9344,
3340,
13428,
4676,
526,
15931,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
16052,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
24243,
1096,
262,
4676,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
22446,
834,
15003,
834,
7,
37652,
20900,
8,
198,
220,
220,
220,
220,
220,
220,
220,
20432,
13,
834,
15003,
834,
7,
944,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6335,
283,
62,
15252,
796,
16052,
13,
721,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
35226,
62,
3672,
796,
277,
1,
90,
37652,
20900,
13,
11250,
62,
13000,
13,
7839,
92,
38426,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
35226,
62,
34642,
62,
312,
796,
277,
1,
90,
37652,
20900,
13,
11250,
62,
13000,
13,
34642,
62,
312,
92,
12,
6335,
283,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
35226,
62,
1078,
3890,
796,
2116,
13,
6335,
283,
62,
15252,
13,
38993,
14692,
1078,
3890,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
35226,
62,
26858,
62,
2301,
4592,
62,
25616,
62,
12286,
796,
10352,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
11299,
62,
4906,
796,
366,
9060,
14,
27908,
1,
628,
220,
220,
220,
825,
4676,
62,
9060,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
9647,
25,
493,
930,
6045,
796,
6045,
11,
6001,
25,
493,
930,
6045,
796,
6045,
198,
220,
220,
220,
1267,
4613,
9881,
930,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
9881,
286,
4676,
2939,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
35226,
62,
26086,
62,
5219,
62,
1078,
7657,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5161,
5446,
62,
46,
4462,
1137,
53,
6234,
62,
34694,
25,
2116,
13,
6335,
283,
62,
15252,
13,
16514,
27823,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
6335,
283,
62,
15252,
13,
9060,
628,
220,
220,
220,
30351,
825,
30351,
62,
2617,
62,
6335,
283,
62,
4906,
7,
944,
11,
13428,
62,
4906,
25,
965,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
262,
2099,
286,
13428,
284,
19818,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6335,
283,
62,
15252,
13,
3866,
66,
541,
62,
4906,
796,
13428,
62,
4906,
13,
21037,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13,
6335,
283,
62,
15252,
13,
19119,
3419,
198
] | 2.633754 | 871 |
from urllib.request import urlopen
from io import StringIO
import csv
data = urlopen("http://pythonscraping.com/files/MontyPythonAlbums.csv").read().decode('ascii', 'ignore')
dataFile = StringIO(data)
dictReader = csv.DictReader(dataFile)
print(dictReader.fieldnames)
for row in dictReader:
print(row) | [
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
6738,
33245,
1330,
10903,
9399,
198,
11748,
269,
21370,
198,
198,
7890,
796,
19016,
9654,
7203,
4023,
1378,
79,
5272,
684,
66,
2416,
278,
13,
785,
14,
16624,
14,
26031,
88,
37906,
2348,
4435,
82,
13,
40664,
11074,
961,
22446,
12501,
1098,
10786,
292,
979,
72,
3256,
705,
46430,
11537,
198,
7890,
8979,
796,
10903,
9399,
7,
7890,
8,
198,
11600,
33634,
796,
269,
21370,
13,
35,
713,
33634,
7,
7890,
8979,
8,
198,
198,
4798,
7,
11600,
33634,
13,
3245,
14933,
8,
198,
198,
1640,
5752,
287,
8633,
33634,
25,
198,
220,
220,
220,
3601,
7,
808,
8
] | 2.825688 | 109 |
# Write an algorithm such that if an element in MxN matrix is 0, it's entire row and column are set to 0.
matrix = [[1,1,1,1],[1,1,1,1],[1,1,0,1],[1,1,1,1],[1,1,1,0]]
matrixZero(matrix)
print('\n'.join(['\t'.join([str(cell) for cell in row]) for row in matrix])) | [
2,
19430,
281,
11862,
884,
326,
611,
281,
5002,
287,
337,
87,
45,
17593,
318,
657,
11,
340,
338,
2104,
5752,
290,
5721,
389,
900,
284,
657,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198,
6759,
8609,
796,
16410,
16,
11,
16,
11,
16,
11,
16,
38430,
16,
11,
16,
11,
16,
11,
16,
38430,
16,
11,
16,
11,
15,
11,
16,
38430,
16,
11,
16,
11,
16,
11,
16,
38430,
16,
11,
16,
11,
16,
11,
15,
11907,
198,
198,
6759,
8609,
28667,
7,
6759,
8609,
8,
198,
198,
4798,
10786,
59,
77,
4458,
22179,
7,
17816,
59,
83,
4458,
22179,
26933,
2536,
7,
3846,
8,
329,
2685,
287,
5752,
12962,
329,
5752,
287,
17593,
60,
4008
] | 2.222222 | 126 |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 4 18:55:46 2020
@author: Jonathan Browning
"""
import numpy as np
from scipy.stats import gaussian_kde as kdf
from scipy import special as sp
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
5267,
220,
604,
1248,
25,
2816,
25,
3510,
12131,
198,
198,
31,
9800,
25,
11232,
4373,
278,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
34242,
1330,
31986,
31562,
62,
74,
2934,
355,
479,
7568,
198,
6738,
629,
541,
88,
1330,
2041,
355,
599,
198,
220,
220,
220,
628,
628
] | 2.618421 | 76 |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Set empty next_cycle_start_date
Create Date: 2017-09-25 13:56:32.087965
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic import op
# revision identifiers, used by Alembic.
revision = '3ebe14ae9547'
down_revision = '4991c5731711'
def upgrade():
"""Upgrade database schema and/or data, creating a new revision."""
op.execute("UPDATE workflows, ( "
"SELECT w.id "
"FROM workflows AS w "
"LEFT JOIN task_groups AS tg ON tg.workflow_id = w.id "
"LEFT JOIN task_group_tasks AS t ON t.task_group_id = tg.id "
"WHERE t.id IS NULL AND w.next_cycle_start_date IS NOT NULL "
") AS t "
"SET workflows.next_cycle_start_date = NULL "
"WHERE workflows.id = t.id;")
def downgrade():
"""Downgrade database schema and/or data back to the previous revision."""
pass
| [
2,
15069,
357,
34,
8,
2177,
3012,
3457,
13,
198,
2,
49962,
739,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
1279,
3826,
38559,
24290,
2393,
29,
198,
198,
37811,
198,
7248,
6565,
1306,
62,
13696,
62,
9688,
62,
4475,
198,
198,
16447,
7536,
25,
2177,
12,
2931,
12,
1495,
1511,
25,
3980,
25,
2624,
13,
2919,
3720,
2996,
198,
37811,
198,
2,
15560,
17665,
6937,
1438,
279,
2645,
600,
6509,
329,
13677,
9300,
2022,
291,
9633,
13,
198,
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
198,
198,
6738,
31341,
2022,
291,
1330,
1034,
628,
198,
2,
18440,
42814,
11,
973,
416,
9300,
2022,
291,
13,
198,
260,
10178,
796,
705,
18,
68,
1350,
1415,
3609,
3865,
2857,
6,
198,
2902,
62,
260,
10178,
796,
705,
28324,
16,
66,
3553,
34125,
1157,
6,
628,
198,
4299,
8515,
33529,
198,
220,
37227,
44948,
6831,
32815,
290,
14,
273,
1366,
11,
4441,
257,
649,
18440,
526,
15931,
198,
220,
1034,
13,
41049,
7203,
16977,
670,
44041,
11,
357,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
46506,
266,
13,
312,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10913,
2662,
670,
44041,
7054,
266,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2538,
9792,
32357,
1268,
4876,
62,
24432,
7054,
256,
70,
6177,
256,
70,
13,
1818,
11125,
62,
312,
796,
266,
13,
312,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2538,
9792,
32357,
1268,
4876,
62,
8094,
62,
83,
6791,
7054,
256,
6177,
256,
13,
35943,
62,
8094,
62,
312,
796,
256,
70,
13,
312,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
47357,
256,
13,
312,
3180,
15697,
5357,
266,
13,
19545,
62,
13696,
62,
9688,
62,
4475,
3180,
5626,
15697,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8,
7054,
256,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
28480,
670,
44041,
13,
19545,
62,
13696,
62,
9688,
62,
4475,
796,
15697,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
47357,
670,
44041,
13,
312,
796,
256,
13,
312,
26,
4943,
628,
198,
4299,
48514,
33529,
198,
220,
37227,
8048,
9526,
6831,
32815,
290,
14,
273,
1366,
736,
284,
262,
2180,
18440,
526,
15931,
198,
220,
1208,
198
] | 2.472093 | 430 |
"""
Tests for the :class:`cpymad.madx.Madx` API.
"""
import os
import sys
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from pytest import approx, fixture, mark, raises
import cpymad
from cpymad.madx import Madx, Sequence, metadata
@fixture
@fixture
SEQU = """
! constants
QP_K1 = 2;
! elements
qp: quadrupole, k1:=QP_K1, l=1;
sb: sbend, l=2, angle=3.14/4;
dr: drift, l=1;
! sequences
s1: sequence, l=8, refer=center;
dr, at=0.5; ! dr[1] ~ betx_full1[1]
qp, at=1.5;
dr, at=2.5; ! dr[2] ~ betx_full1[3] ~ betx_range[0]
qp, at=3.5; ! ~ betx_full1[4] ~ betx_range[1]
dr, at=4.5;
sb, at=6.0; ! ~ betx_range[3]
dr, at=7.5;
endsequence;
s2: sequence, l=3, refer=entry;
qp1: qp, at=0, k1=3;
qp2: qp, at=1, l=2;
endsequence;
"""
def normalize(path):
"""Normalize path name to eliminate different spellings of the same path.
This is needed for path comparisons in tests, especially on windows where
pathes are case insensitive and allow a multitude of spellings."""
return os.path.normcase(os.path.normpath(path))
def test_version(mad):
"""Check that the Madx.version attribute can be used as expected."""
version = mad.version
# check format:
major, minor, micro = map(int, version.release.split('.'))
# We need at least MAD-X 5.05.00:
assert (major, minor, micro) >= (5, 5, 0)
# check format:
year, month, day = map(int, version.date.split('.'))
assert (year, month, day) >= (2019, 5, 10)
assert 1 <= month <= 12
assert 1 <= day <= 31
assert str(version).startswith(
'MAD-X {}'.format(version.release))
# TODO: We need to fix this on windows, but for now, I just need it to
# pass so that the CI builds the release...
@mark.xfail(
sys.platform != 'linux',
reason='Output is sometimes garbled on MacOS and windows.',
)
@mark.xfail(
sys.platform != 'linux',
reason='Output is sometimes garbled on MacOS and windows.',
)
def test_command_log():
"""Check that the command log contains all input commands."""
# create a new Madx instance that uses the history feature:
history_filename = '_test_madx.madx.tmp'
try:
# feed some input lines and compare with history file:
lines = """
l = 5;
f = 200;
fodo: sequence, refer=entry, l=100;
QF: quadrupole, l=5, at= 0, k1= 1/(f*l);
QD: quadrupole, l=5, at=50, k1=-1/(f*l);
endsequence;
beam, particle=proton, energy=2;
use, sequence=fodo;
""".splitlines()
lines = [line.strip() for line in lines if line.strip()]
with Madx(command_log=history_filename) as mad:
for line in lines:
mad.input(line)
with open(history_filename) as history_file:
history = history_file.read()
assert history.strip() == '\n'.join(lines).strip()
finally:
# remove history file
os.remove(history_filename)
def test_append_semicolon():
"""Check that semicolon is automatically appended to input() text."""
# Regression test for #73
log = []
with Madx(command_log=log.append) as mad:
mad.input('a = 0')
mad.input('b = 1')
assert log == ['a = 0;', 'b = 1;']
assert mad.globals.a == 0
assert mad.globals.b == 1
# def test_sequence_get_expanded_elements():
def test_crash(mad):
"""Check that a RuntimeError is raised in case MAD-X crashes."""
assert bool(mad)
# a.t.m. MAD-X crashes on this input, because the L (length)
# parametere is missing:
raises(RuntimeError, mad.input, 'XXX: sequence;')
assert not bool(mad)
| [
37811,
198,
51,
3558,
329,
262,
1058,
4871,
25,
63,
13155,
4948,
324,
13,
9937,
87,
13,
18454,
87,
63,
7824,
13,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
439,
19836,
11,
6818,
62,
40496,
198,
6738,
12972,
9288,
1330,
5561,
11,
29220,
11,
1317,
11,
12073,
198,
198,
11748,
31396,
4948,
324,
198,
6738,
31396,
4948,
324,
13,
9937,
87,
1330,
4627,
87,
11,
45835,
11,
20150,
628,
198,
31,
69,
9602,
628,
198,
31,
69,
9602,
628,
198,
5188,
10917,
796,
37227,
198,
0,
38491,
198,
48,
47,
62,
42,
16,
796,
362,
26,
198,
198,
0,
4847,
198,
80,
79,
25,
15094,
12618,
2305,
11,
479,
16,
25,
28,
48,
47,
62,
42,
16,
11,
300,
28,
16,
26,
198,
36299,
25,
264,
65,
437,
11,
300,
28,
17,
11,
9848,
28,
18,
13,
1415,
14,
19,
26,
198,
7109,
25,
24260,
11,
300,
28,
16,
26,
198,
198,
0,
16311,
198,
82,
16,
25,
8379,
11,
300,
28,
23,
11,
3522,
28,
16159,
26,
198,
7109,
11,
379,
28,
15,
13,
20,
26,
5145,
1553,
58,
16,
60,
5299,
731,
87,
62,
12853,
16,
58,
16,
60,
198,
80,
79,
11,
379,
28,
16,
13,
20,
26,
198,
7109,
11,
379,
28,
17,
13,
20,
26,
5145,
1553,
58,
17,
60,
5299,
731,
87,
62,
12853,
16,
58,
18,
60,
5299,
731,
87,
62,
9521,
58,
15,
60,
198,
80,
79,
11,
379,
28,
18,
13,
20,
26,
5145,
220,
220,
220,
220,
220,
220,
5299,
731,
87,
62,
12853,
16,
58,
19,
60,
5299,
731,
87,
62,
9521,
58,
16,
60,
198,
7109,
11,
379,
28,
19,
13,
20,
26,
198,
36299,
11,
379,
28,
21,
13,
15,
26,
5145,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5299,
731,
87,
62,
9521,
58,
18,
60,
198,
7109,
11,
379,
28,
22,
13,
20,
26,
198,
437,
43167,
26,
198,
198,
82,
17,
25,
8379,
11,
300,
28,
18,
11,
3522,
28,
13000,
26,
198,
80,
79,
16,
25,
10662,
79,
11,
379,
28,
15,
11,
479,
16,
28,
18,
26,
198,
80,
79,
17,
25,
10662,
79,
11,
379,
28,
16,
11,
300,
28,
17,
26,
198,
437,
43167,
26,
198,
37811,
628,
198,
4299,
3487,
1096,
7,
6978,
2599,
198,
220,
220,
220,
37227,
26447,
1096,
3108,
1438,
284,
11005,
1180,
4822,
654,
286,
262,
976,
3108,
13,
198,
220,
220,
220,
770,
318,
2622,
329,
3108,
17909,
287,
5254,
11,
2592,
319,
9168,
810,
198,
220,
220,
220,
1458,
956,
389,
1339,
41246,
290,
1249,
257,
24124,
286,
4822,
654,
526,
15931,
198,
220,
220,
220,
1441,
28686,
13,
6978,
13,
27237,
7442,
7,
418,
13,
6978,
13,
27237,
6978,
7,
6978,
4008,
628,
198,
198,
4299,
1332,
62,
9641,
7,
9937,
2599,
198,
220,
220,
220,
37227,
9787,
326,
262,
4627,
87,
13,
9641,
11688,
460,
307,
973,
355,
2938,
526,
15931,
198,
220,
220,
220,
2196,
796,
8805,
13,
9641,
198,
220,
220,
220,
1303,
2198,
5794,
25,
198,
220,
220,
220,
1688,
11,
4159,
11,
4580,
796,
3975,
7,
600,
11,
2196,
13,
20979,
13,
35312,
10786,
2637,
4008,
198,
220,
220,
220,
1303,
775,
761,
379,
1551,
45878,
12,
55,
642,
13,
2713,
13,
405,
25,
198,
220,
220,
220,
6818,
357,
22478,
11,
4159,
11,
4580,
8,
18189,
357,
20,
11,
642,
11,
657,
8,
198,
220,
220,
220,
1303,
2198,
5794,
25,
198,
220,
220,
220,
614,
11,
1227,
11,
1110,
796,
3975,
7,
600,
11,
2196,
13,
4475,
13,
35312,
10786,
2637,
4008,
198,
220,
220,
220,
6818,
357,
1941,
11,
1227,
11,
1110,
8,
18189,
357,
23344,
11,
642,
11,
838,
8,
198,
220,
220,
220,
6818,
352,
19841,
1227,
19841,
1105,
198,
220,
220,
220,
6818,
352,
19841,
1110,
19841,
3261,
198,
220,
220,
220,
6818,
965,
7,
9641,
737,
9688,
2032,
342,
7,
198,
220,
220,
220,
220,
220,
220,
220,
705,
44,
2885,
12,
55,
23884,
4458,
18982,
7,
9641,
13,
20979,
4008,
628,
628,
198,
2,
16926,
46,
25,
775,
761,
284,
4259,
428,
319,
9168,
11,
475,
329,
783,
11,
314,
655,
761,
340,
284,
198,
2,
1208,
523,
326,
262,
14514,
12188,
262,
2650,
986,
198,
31,
4102,
13,
26152,
603,
7,
198,
220,
220,
220,
25064,
13,
24254,
14512,
705,
23289,
3256,
198,
220,
220,
220,
1738,
11639,
26410,
318,
3360,
5482,
9342,
319,
4100,
2640,
290,
9168,
2637,
11,
198,
8,
628,
198,
198,
31,
4102,
13,
26152,
603,
7,
198,
220,
220,
220,
25064,
13,
24254,
14512,
705,
23289,
3256,
198,
220,
220,
220,
1738,
11639,
26410,
318,
3360,
5482,
9342,
319,
4100,
2640,
290,
9168,
2637,
11,
198,
8,
628,
198,
4299,
1332,
62,
21812,
62,
6404,
33529,
198,
220,
220,
220,
37227,
9787,
326,
262,
3141,
2604,
4909,
477,
5128,
9729,
526,
15931,
198,
220,
220,
220,
1303,
2251,
257,
649,
4627,
87,
4554,
326,
3544,
262,
2106,
3895,
25,
198,
220,
220,
220,
2106,
62,
34345,
796,
705,
62,
9288,
62,
9937,
87,
13,
9937,
87,
13,
22065,
6,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3745,
617,
5128,
3951,
290,
8996,
351,
2106,
2393,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3951,
796,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
796,
642,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
796,
939,
26,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
24313,
25,
8379,
11,
3522,
28,
13000,
11,
300,
28,
3064,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
37,
25,
15094,
12618,
2305,
11,
300,
28,
20,
11,
379,
28,
657,
11,
479,
16,
28,
352,
29006,
69,
9,
75,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
35,
25,
15094,
12618,
2305,
11,
300,
28,
20,
11,
379,
28,
1120,
11,
479,
16,
10779,
16,
29006,
69,
9,
75,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
43167,
26,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15584,
11,
18758,
28,
1676,
1122,
11,
2568,
28,
17,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
779,
11,
8379,
28,
69,
24313,
26,
198,
220,
220,
220,
220,
220,
220,
220,
13538,
1911,
35312,
6615,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3951,
796,
685,
1370,
13,
36311,
3419,
329,
1627,
287,
3951,
611,
1627,
13,
36311,
3419,
60,
198,
220,
220,
220,
220,
220,
220,
220,
351,
4627,
87,
7,
21812,
62,
6404,
28,
23569,
62,
34345,
8,
355,
8805,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1627,
287,
3951,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8805,
13,
15414,
7,
1370,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
23569,
62,
34345,
8,
355,
2106,
62,
7753,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2106,
796,
2106,
62,
7753,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
2106,
13,
36311,
3419,
6624,
705,
59,
77,
4458,
22179,
7,
6615,
737,
36311,
3419,
198,
220,
220,
220,
3443,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4781,
2106,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
28956,
7,
23569,
62,
34345,
8,
628,
198,
4299,
1332,
62,
33295,
62,
325,
9383,
43645,
33529,
198,
220,
220,
220,
37227,
9787,
326,
5026,
27045,
261,
318,
6338,
598,
1631,
284,
5128,
3419,
2420,
526,
15931,
198,
220,
220,
220,
1303,
3310,
2234,
1332,
329,
1303,
4790,
198,
220,
220,
220,
2604,
796,
17635,
198,
220,
220,
220,
351,
4627,
87,
7,
21812,
62,
6404,
28,
6404,
13,
33295,
8,
355,
8805,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8805,
13,
15414,
10786,
64,
796,
657,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
8805,
13,
15414,
10786,
65,
796,
352,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2604,
6624,
37250,
64,
796,
657,
26,
3256,
705,
65,
796,
352,
26,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
8805,
13,
4743,
672,
874,
13,
64,
6624,
657,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
8805,
13,
4743,
672,
874,
13,
65,
6624,
352,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
198,
198,
2,
825,
1332,
62,
43167,
62,
1136,
62,
11201,
12249,
62,
68,
3639,
33529,
628,
198,
4299,
1332,
62,
6098,
1077,
7,
9937,
2599,
198,
220,
220,
220,
37227,
9787,
326,
257,
43160,
12331,
318,
4376,
287,
1339,
45878,
12,
55,
17616,
526,
15931,
198,
220,
220,
220,
6818,
20512,
7,
9937,
8,
198,
220,
220,
220,
1303,
257,
13,
83,
13,
76,
13,
45878,
12,
55,
17616,
319,
428,
5128,
11,
780,
262,
406,
357,
13664,
8,
198,
220,
220,
220,
1303,
5772,
316,
567,
318,
4814,
25,
198,
220,
220,
220,
12073,
7,
41006,
12331,
11,
8805,
13,
15414,
11,
705,
43145,
25,
8379,
26,
11537,
198,
220,
220,
220,
6818,
407,
20512,
7,
9937,
8,
628,
628,
628,
628,
628,
628,
628,
628,
628,
198
] | 2.339341 | 1,609 |
"""
File: single_objective_engine.py
Author: ngocjr7
Email: [email protected]
Github: https://github.com/ngocjr7
Description:
"""
from __future__ import absolute_import
from typing import List, Union, Callable
from functools import wraps
from collections import OrderedDict
from ..geneticengine import GeneticEngine
from ...core.population import Population
from ...core.operators import Selection, Crossover, Mutation, Replacement
from ...core.individual import Individual
from ...callbacks import Callback, CallbackList
from ...callbacks import History
import math
| [
37811,
198,
8979,
25,
2060,
62,
15252,
425,
62,
18392,
13,
9078,
198,
13838,
25,
23370,
420,
73,
81,
22,
198,
15333,
25,
23370,
420,
73,
81,
22,
31,
14816,
13,
785,
198,
38,
10060,
25,
3740,
1378,
12567,
13,
785,
14,
782,
420,
73,
81,
22,
198,
11828,
25,
220,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
19720,
1330,
7343,
11,
4479,
11,
4889,
540,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
6738,
11485,
5235,
5139,
18392,
1330,
42295,
13798,
198,
6738,
2644,
7295,
13,
39748,
1330,
20133,
198,
6738,
2644,
7295,
13,
3575,
2024,
1330,
29538,
11,
327,
23954,
11,
337,
7094,
11,
43986,
198,
6738,
2644,
7295,
13,
43129,
1330,
18629,
198,
6738,
2644,
13345,
10146,
1330,
4889,
1891,
11,
4889,
1891,
8053,
198,
6738,
2644,
13345,
10146,
1330,
7443,
198,
11748,
10688,
628
] | 3.690323 | 155 |
# timing.py
import datetime, calendar
today = datetime.date.today()
yesterday = today - datetime.timedelta(days = 1)
tomorrow = today + datetime.timedelta(days = 1)
print(yesterday, today, tomorrow)
# -------------------------
'''
last_friday = datetime.date.today()
oneday = datetime.timedelta(days = 1)
while last_friday.weekday() != calendar.FRIDAY :
last_friday = oneday
print(last_friday.strftime('%A, %d-%b-%Y'))
'''
t = datetime.datetime(2012,9,3,21,30)
k = datetime.date.today()
print(t, '\n', k)
| [
2,
10576,
13,
9078,
198,
198,
11748,
4818,
8079,
11,
11845,
198,
198,
40838,
796,
4818,
8079,
13,
4475,
13,
40838,
3419,
198,
198,
8505,
6432,
796,
1909,
532,
4818,
8079,
13,
16514,
276,
12514,
7,
12545,
796,
352,
8,
198,
198,
39532,
6254,
796,
1909,
1343,
4818,
8079,
13,
16514,
276,
12514,
7,
12545,
796,
352,
8,
198,
198,
4798,
7,
8505,
6432,
11,
1909,
11,
9439,
8,
198,
198,
2,
220,
22369,
12,
198,
7061,
6,
198,
12957,
62,
8310,
2567,
796,
4818,
8079,
13,
4475,
13,
40838,
3419,
198,
12004,
323,
796,
4818,
8079,
13,
16514,
276,
12514,
7,
12545,
796,
352,
8,
198,
198,
4514,
938,
62,
8310,
2567,
13,
10464,
820,
3419,
14512,
11845,
13,
10913,
2389,
4792,
1058,
198,
220,
220,
220,
938,
62,
8310,
2567,
796,
319,
23712,
198,
198,
4798,
7,
12957,
62,
8310,
2567,
13,
2536,
31387,
10786,
4,
32,
11,
4064,
67,
12,
4,
65,
12,
4,
56,
6,
4008,
198,
7061,
6,
198,
83,
796,
4818,
8079,
13,
19608,
8079,
7,
6999,
11,
24,
11,
18,
11,
2481,
11,
1270,
8,
198,
74,
796,
4818,
8079,
13,
4475,
13,
40838,
3419,
198,
4798,
7,
83,
11,
705,
59,
77,
3256,
479,
8,
198
] | 2.534314 | 204 |
from manticore.utils.helpers import CacheDict
from .expression import *
from functools import lru_cache
import logging
import operator
logger = logging.getLogger(__name__)
class Visitor(object):
''' Class/Type Visitor
Inherit your class visitor from this one and get called on a different
visiting function for each type of expression. It will call the first
implemented method for the __mro__ class order.
For example for a BitVecAdd it will try
visit_BitVecAdd() if not defined then it will try with
visit_BitVecOperation() if not defined then it will try with
visit_BitVec() if not defined then it will try with
visit_Operation() if not defined then it will try with
visit_Expression()
Other class named visitors are:
visit_Constant()
visit_Variable()
visit_Operation()
visit_BitVec()
visit_Bool()
visit_Array()
'''
@property
def visit(self, node, use_fixed_point=False):
'''
The entry point of the visitor.
The exploration algorithm is a DFS post-order traversal
The implementation used two stacks instead of a recursion
The final result is store in self.result
:param node: Node to explore
:type node: Expression
:param use_fixed_point: if True, it runs _methods until a fixed point is found
:type use_fixed_point: Bool
'''
cache = self._cache
visited = set()
stack = []
stack.append(node)
while stack:
node = stack.pop()
if node in cache:
self.push(cache[node])
elif isinstance(node, Operation):
if node in visited:
operands = [self.pop() for _ in range(len(node.operands))]
value = self._method(node, *operands)
visited.remove(node)
self.push(value)
cache[node] = value
else:
visited.add(node)
stack.append(node)
stack.extend(node.operands)
else:
self.push(self._method(node))
if use_fixed_point:
old_value = None
new_value = self.pop()
while old_value is not new_value:
self.visit(new_value)
old_value = new_value
new_value = self.pop()
self.push(new_value)
@staticmethod
class Translator(Visitor):
''' Simple visitor to translate an expression into something else
'''
class GetDeclarations(Visitor):
''' Simple visitor to collect all variables in an expression or set of
expressions
'''
@property
class GetDepth(Translator):
''' Simple visitor to collect all variables in an expression or set of
expressions
'''
constant_folder_simplifier_cache = CacheDict(max_size=150000, flush_perc=25)
@lru_cache(maxsize=128)
arithmetic_simplifier_cache = CacheDict(max_size=150000, flush_perc=25)
@lru_cache(maxsize=128)
@lru_cache(maxsize=128)
class TranslatorSmtlib(Translator):
''' Simple visitor to translate an expression to its smtlib representation
'''
unique = 0
@property
translation_table = {
BoolNot: 'not',
BoolEq: '=',
BoolAnd: 'and',
BoolOr: 'or',
BoolXor: 'xor',
BoolITE: 'ite',
BitVecAdd: 'bvadd',
BitVecSub: 'bvsub',
BitVecMul: 'bvmul',
BitVecDiv: 'bvsdiv',
BitVecUnsignedDiv: 'bvudiv',
BitVecMod: 'bvsmod',
BitVecRem: 'bvsrem',
BitVecUnsignedRem: 'bvurem',
BitVecShiftLeft: 'bvshl',
BitVecShiftRight: 'bvlshr',
BitVecArithmeticShiftLeft: 'bvashl',
BitVecArithmeticShiftRight: 'bvashr',
BitVecAnd: 'bvand',
BitVecOr: 'bvor',
BitVecXor: 'bvxor',
BitVecNot: 'bvnot',
BitVecNeg: 'bvneg',
LessThan: 'bvslt',
LessOrEqual: 'bvsle',
Equal: '=',
GreaterThan: 'bvsgt',
GreaterOrEqual: 'bvsge',
UnsignedLessThan: 'bvult',
UnsignedLessOrEqual: 'bvule',
UnsignedGreaterThan: 'bvugt',
UnsignedGreaterOrEqual: 'bvuge',
BitVecSignExtend: '(_ sign_extend %d)',
BitVecZeroExtend: '(_ zero_extend %d)',
BitVecExtract: '(_ extract %d %d)',
BitVecConcat: 'concat',
BitVecITE: 'ite',
ArrayStore: 'store',
ArraySelect: 'select',
}
@property
@property
class Replace(Visitor):
''' Simple visitor to replaces expressions '''
| [
6738,
285,
5109,
382,
13,
26791,
13,
16794,
364,
1330,
34088,
35,
713,
198,
6738,
764,
38011,
1330,
1635,
198,
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
198,
11748,
18931,
198,
11748,
10088,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4871,
6911,
2072,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
5016,
14,
6030,
6911,
2072,
628,
220,
220,
220,
220,
220,
220,
47025,
270,
534,
1398,
21493,
422,
428,
530,
290,
651,
1444,
319,
257,
1180,
198,
220,
220,
220,
220,
220,
220,
10013,
2163,
329,
1123,
2099,
286,
5408,
13,
632,
481,
869,
262,
717,
198,
220,
220,
220,
220,
220,
220,
9177,
2446,
329,
262,
11593,
76,
305,
834,
1398,
1502,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1114,
1672,
329,
257,
4722,
53,
721,
4550,
340,
481,
1949,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
13128,
53,
721,
4550,
3419,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
5447,
788,
340,
481,
1949,
351,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
13128,
53,
721,
32180,
3419,
220,
220,
220,
611,
407,
5447,
788,
340,
481,
1949,
351,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
13128,
53,
721,
3419,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
5447,
788,
340,
481,
1949,
351,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
32180,
3419,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
5447,
788,
340,
481,
1949,
351,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
16870,
2234,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
3819,
1398,
3706,
9692,
389,
25,
628,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
3103,
18797,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
43015,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
32180,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
13128,
53,
721,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
33,
970,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3187,
62,
19182,
3419,
628,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
2488,
26745,
628,
220,
220,
220,
825,
3187,
7,
944,
11,
10139,
11,
779,
62,
34021,
62,
4122,
28,
25101,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
383,
5726,
966,
286,
262,
21493,
13,
198,
220,
220,
220,
220,
220,
220,
220,
383,
13936,
11862,
318,
257,
360,
10652,
1281,
12,
2875,
33038,
282,
198,
220,
220,
220,
220,
220,
220,
220,
383,
7822,
973,
734,
24285,
2427,
286,
257,
664,
24197,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2457,
1255,
318,
3650,
287,
2116,
13,
20274,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
10139,
25,
19081,
284,
7301,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
10139,
25,
41986,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
779,
62,
34021,
62,
4122,
25,
611,
6407,
11,
340,
4539,
4808,
24396,
82,
1566,
257,
5969,
966,
318,
1043,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
779,
62,
34021,
62,
4122,
25,
347,
970,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
12940,
796,
2116,
13557,
23870,
198,
220,
220,
220,
220,
220,
220,
220,
8672,
796,
900,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
8931,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
8931,
13,
33295,
7,
17440,
8,
198,
220,
220,
220,
220,
220,
220,
220,
981,
8931,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10139,
796,
8931,
13,
12924,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
10139,
287,
12940,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
14689,
7,
23870,
58,
17440,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
318,
39098,
7,
17440,
11,
14680,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
10139,
287,
8672,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1515,
1746,
796,
685,
944,
13,
12924,
3419,
329,
4808,
287,
2837,
7,
11925,
7,
17440,
13,
3575,
1746,
4008,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
796,
2116,
13557,
24396,
7,
17440,
11,
1635,
3575,
1746,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8672,
13,
28956,
7,
17440,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
14689,
7,
8367,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12940,
58,
17440,
60,
796,
1988,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8672,
13,
2860,
7,
17440,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8931,
13,
33295,
7,
17440,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8931,
13,
2302,
437,
7,
17440,
13,
3575,
1746,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
14689,
7,
944,
13557,
24396,
7,
17440,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
611,
779,
62,
34021,
62,
4122,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1468,
62,
8367,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
8367,
796,
2116,
13,
12924,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
1468,
62,
8367,
318,
407,
649,
62,
8367,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
4703,
270,
7,
3605,
62,
8367,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1468,
62,
8367,
796,
649,
62,
8367,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
8367,
796,
2116,
13,
12924,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
14689,
7,
3605,
62,
8367,
8,
628,
220,
220,
220,
2488,
12708,
24396,
628,
198,
4871,
3602,
41880,
7,
15854,
2072,
2599,
198,
220,
220,
220,
705,
7061,
17427,
21493,
284,
15772,
281,
5408,
656,
1223,
2073,
198,
220,
220,
220,
705,
7061,
628,
198,
4871,
3497,
37835,
24355,
7,
15854,
2072,
2599,
198,
220,
220,
220,
705,
7061,
17427,
21493,
284,
2824,
477,
9633,
287,
281,
5408,
393,
900,
286,
198,
220,
220,
220,
220,
220,
220,
220,
14700,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
2488,
26745,
628,
198,
4871,
3497,
48791,
7,
8291,
41880,
2599,
198,
220,
220,
220,
705,
7061,
17427,
21493,
284,
2824,
477,
9633,
287,
281,
5408,
393,
900,
286,
198,
220,
220,
220,
220,
220,
220,
220,
14700,
198,
220,
220,
220,
705,
7061,
628,
628,
628,
198,
9979,
415,
62,
43551,
62,
14323,
489,
7483,
62,
23870,
796,
34088,
35,
713,
7,
9806,
62,
7857,
28,
1314,
2388,
11,
24773,
62,
525,
66,
28,
1495,
8,
628,
198,
31,
75,
622,
62,
23870,
7,
9806,
7857,
28,
12762,
8,
628,
198,
198,
283,
29848,
62,
14323,
489,
7483,
62,
23870,
796,
34088,
35,
713,
7,
9806,
62,
7857,
28,
1314,
2388,
11,
24773,
62,
525,
66,
28,
1495,
8,
628,
198,
31,
75,
622,
62,
23870,
7,
9806,
7857,
28,
12762,
8,
628,
198,
198,
31,
75,
622,
62,
23870,
7,
9806,
7857,
28,
12762,
8,
628,
198,
4871,
3602,
41880,
7556,
83,
8019,
7,
8291,
41880,
2599,
198,
220,
220,
220,
705,
7061,
17427,
21493,
284,
15772,
281,
5408,
284,
663,
895,
83,
8019,
10552,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
3748,
796,
657,
628,
220,
220,
220,
2488,
26745,
628,
220,
220,
220,
11059,
62,
11487,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
347,
970,
3673,
25,
705,
1662,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
347,
970,
36,
80,
25,
705,
28,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
347,
970,
1870,
25,
705,
392,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
347,
970,
5574,
25,
705,
273,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
347,
970,
55,
273,
25,
705,
87,
273,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
347,
970,
12709,
25,
705,
578,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
4550,
25,
705,
65,
85,
2860,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
7004,
25,
705,
65,
85,
7266,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
44,
377,
25,
705,
65,
14761,
377,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
24095,
25,
705,
65,
14259,
7146,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
3118,
32696,
24095,
25,
705,
65,
85,
463,
452,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
5841,
25,
705,
65,
14259,
4666,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
8413,
25,
705,
65,
14259,
2787,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
3118,
32696,
8413,
25,
705,
65,
85,
495,
76,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
33377,
18819,
25,
705,
65,
85,
1477,
75,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
33377,
11028,
25,
705,
65,
19279,
36007,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
3163,
29848,
33377,
18819,
25,
705,
65,
85,
1077,
75,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
3163,
29848,
33377,
11028,
25,
705,
65,
85,
1077,
81,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
1870,
25,
705,
65,
85,
392,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
5574,
25,
705,
65,
20867,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
55,
273,
25,
705,
65,
85,
87,
273,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
3673,
25,
705,
65,
85,
1662,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
32863,
25,
705,
65,
85,
12480,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
12892,
817,
272,
25,
705,
65,
14259,
2528,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
12892,
5574,
36,
13255,
25,
705,
65,
14259,
293,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
28701,
25,
705,
28,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
18169,
817,
272,
25,
705,
65,
14259,
13655,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
18169,
5574,
36,
13255,
25,
705,
65,
14259,
469,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
791,
32696,
22058,
817,
272,
25,
705,
65,
85,
586,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
791,
32696,
22058,
5574,
36,
13255,
25,
705,
65,
85,
2261,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
791,
32696,
13681,
263,
817,
272,
25,
705,
65,
85,
1018,
83,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
791,
32696,
13681,
263,
5574,
36,
13255,
25,
705,
65,
85,
2217,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
11712,
11627,
437,
25,
705,
28264,
1051,
62,
2302,
437,
4064,
67,
8,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
28667,
11627,
437,
25,
705,
28264,
6632,
62,
2302,
437,
4064,
67,
8,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
11627,
974,
25,
705,
28264,
7925,
4064,
67,
4064,
67,
8,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
3103,
9246,
25,
705,
1102,
9246,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4722,
53,
721,
12709,
25,
705,
578,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
15690,
22658,
25,
705,
8095,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
15690,
17563,
25,
705,
19738,
3256,
198,
220,
220,
220,
1782,
628,
220,
220,
220,
2488,
26745,
628,
220,
220,
220,
2488,
26745,
628,
198,
198,
4871,
40177,
7,
15854,
2072,
2599,
198,
220,
220,
220,
705,
7061,
17427,
21493,
284,
24020,
14700,
705,
7061,
628,
198
] | 2.106525 | 2,253 |
from django import urls
from django.conf.urls import include, url
from django.contrib.auth.forms import AdminPasswordChangeForm
from django.urls import path
from .views import *
urlpatterns = [
path(r'user/<str:usr>/', accountView),
path('register_/', register_),
]
| [
6738,
42625,
14208,
1330,
2956,
7278,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
32053,
35215,
19400,
8479,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
1635,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
7,
81,
6,
7220,
14,
27,
2536,
25,
14629,
29,
14,
3256,
1848,
7680,
828,
198,
220,
220,
220,
3108,
10786,
30238,
62,
14,
3256,
7881,
62,
828,
220,
220,
220,
220,
198,
198,
60,
198
] | 2.857143 | 98 |
# -*- coding: utf-8 -*-
"""try:
import jieba
except:
print("please install jieba first.")
input("press any key to continue")
quit()""" | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
28311,
25,
198,
220,
220,
220,
1330,
474,
494,
7012,
198,
16341,
25,
198,
220,
220,
220,
3601,
7203,
29688,
2721,
474,
494,
7012,
717,
19570,
198,
220,
220,
220,
5128,
7203,
8439,
597,
1994,
284,
2555,
4943,
198,
220,
220,
220,
11238,
3419,
37811
] | 2.5 | 60 |
"""
This is the C{admin.py} file for C{map_annotate_app}.
For more details, see the documentation for C{map_annotate_app}.
"""
from django.contrib import admin
from .models import Crime
from .models import CrimeType
from .models import Location
from .models import Sansad
admin.site.register(Location)
admin.site.register(Crime)
admin.site.register(CrimeType)
admin.site.register(Sansad)
| [
37811,
198,
1212,
318,
262,
327,
90,
28482,
13,
9078,
92,
2393,
329,
327,
90,
8899,
62,
34574,
378,
62,
1324,
27422,
198,
1890,
517,
3307,
11,
766,
262,
10314,
329,
327,
90,
8899,
62,
34574,
378,
62,
1324,
27422,
198,
37811,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
10003,
198,
6738,
764,
27530,
1330,
10003,
6030,
198,
6738,
764,
27530,
1330,
13397,
198,
6738,
764,
27530,
1330,
20845,
324,
198,
198,
28482,
13,
15654,
13,
30238,
7,
14749,
8,
198,
28482,
13,
15654,
13,
30238,
7,
45580,
8,
198,
28482,
13,
15654,
13,
30238,
7,
45580,
6030,
8,
198,
28482,
13,
15654,
13,
30238,
7,
50,
504,
324,
8,
198
] | 3.258333 | 120 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018, University of California, Berkeley
# author: Kevin Laeufer <[email protected]>
from collections import defaultdict
if __name__ == "__main__":
g = Grammar()
S, B, D, E, F = non_term = g.non_terminal('S', 'B', 'D', 'E', 'F')
u, v, w, x, y, z = term = g.terminal('u', 'v', 'w', 'x', 'y', 'z')
g.r(S, [u, B, D, z])
g.r(B, [B, v])
g.r(B, [w])
g.r(D, [E, F])
g.r(E, [y])
g.r(E, [])
g.r(F, [x])
g.r(F, [])
for nt in non_term:
print(f"FIRST({nt}): {g.first(nt)}")
print()
for nt in non_term:
print(f"FOLLOW({nt}): {g.follow(nt)}")
print()
print(g.ll_one(check_conflicts=False)) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
2864,
11,
2059,
286,
3442,
11,
14727,
198,
2,
1772,
25,
7939,
406,
3609,
84,
2232,
1279,
75,
3609,
84,
2232,
31,
6359,
13,
527,
13490,
13,
15532,
29,
198,
198,
6738,
17268,
1330,
197,
12286,
11600,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
70,
796,
20159,
3876,
3419,
198,
197,
50,
11,
347,
11,
360,
11,
412,
11,
376,
796,
1729,
62,
4354,
796,
308,
13,
13159,
62,
23705,
282,
10786,
50,
3256,
705,
33,
3256,
705,
35,
3256,
705,
36,
3256,
705,
37,
11537,
198,
197,
84,
11,
410,
11,
266,
11,
2124,
11,
331,
11,
1976,
796,
3381,
796,
308,
13,
23705,
282,
10786,
84,
3256,
705,
85,
3256,
705,
86,
3256,
705,
87,
3256,
705,
88,
3256,
705,
89,
11537,
198,
197,
70,
13,
81,
7,
50,
11,
685,
84,
11,
347,
11,
360,
11,
1976,
12962,
198,
197,
70,
13,
81,
7,
33,
11,
685,
33,
11,
410,
12962,
198,
197,
70,
13,
81,
7,
33,
11,
685,
86,
12962,
198,
197,
70,
13,
81,
7,
35,
11,
685,
36,
11,
376,
12962,
198,
197,
70,
13,
81,
7,
36,
11,
685,
88,
12962,
198,
197,
70,
13,
81,
7,
36,
11,
685,
12962,
198,
197,
70,
13,
81,
7,
37,
11,
685,
87,
12962,
198,
197,
70,
13,
81,
7,
37,
11,
685,
12962,
628,
197,
1640,
299,
83,
287,
1729,
62,
4354,
25,
198,
197,
197,
4798,
7,
69,
1,
39776,
2257,
15090,
429,
92,
2599,
1391,
70,
13,
11085,
7,
429,
38165,
4943,
628,
197,
4798,
3419,
628,
197,
1640,
299,
83,
287,
1729,
62,
4354,
25,
198,
197,
197,
4798,
7,
69,
1,
6080,
44765,
15090,
429,
92,
2599,
1391,
70,
13,
27780,
7,
429,
38165,
4943,
628,
197,
4798,
3419,
628,
197,
4798,
7,
70,
13,
297,
62,
505,
7,
9122,
62,
10414,
42267,
28,
25101,
4008
] | 1.959302 | 344 |
import socket, threading
HOST = "127.0.0.1"
PORT = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((HOST, PORT))
server.listen()
clients = []
nicknames = []
# broadcast func
# handle func
# receive func
print("******Server is running******")
receive()
| [
11748,
17802,
11,
4704,
278,
201,
198,
201,
198,
39,
10892,
796,
366,
16799,
13,
15,
13,
15,
13,
16,
1,
201,
198,
15490,
796,
860,
17032,
201,
198,
201,
198,
15388,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
2257,
32235,
8,
201,
198,
15388,
13,
21653,
19510,
39,
10892,
11,
350,
9863,
4008,
201,
198,
201,
198,
15388,
13,
4868,
268,
3419,
201,
198,
201,
198,
565,
2334,
796,
17635,
201,
198,
17172,
14933,
796,
17635,
201,
198,
201,
198,
201,
198,
2,
7025,
25439,
201,
198,
201,
198,
2,
5412,
25439,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
2,
3328,
25439,
201,
198,
201,
198,
4798,
7203,
2466,
1174,
10697,
318,
2491,
2466,
1174,
4943,
201,
198,
260,
15164,
3419,
201,
198,
201,
198
] | 2.294964 | 139 |
#
# Copyright (c) 2015, Adam Meily <[email protected]>
# Pypsi - https://github.com/ameily/pypsi
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
'''
Base classes for developing pluggable commands and plugins.
'''
import argparse
import sys
from pypsi.ansi import AnsiCodes, AnsiCode
from pypsi.format import get_lines, wrap_line
class Plugin(object):
'''
A plugin is an object that is able to modify a
:py:class:`pypsi.shell.Shell` object's behavior. Whereas a command can be
execute from user input, the `Plugin` class does not contain a `run()`
function.
'''
def __init__(self, preprocess=None, postprocess=None):
'''
Constructor can take two parameters: `preprocess` and `postprocess`
These values determine where the plugin resides inside of the
preprocess and postprocess list. This list, inside of
:class:`pypsi.shell.Shell`, is iterated sequentially, from most
priority to least. So, the highest priority value is 0, which means it
will be the first plugin to run, and the lowest value is 100, which
means it will be the last plugin to run. If either value is `None`, the
plugin is not added to the processing list. For example, if this plugin
only provides a preprocessing functionality, then postprocess should be
set to :const:`None`.
:param int preprocess: the preprocess priority
:param int postprocess: the postprocess priority
'''
self.preprocess = preprocess
self.postprocess = postprocess
def setup(self, shell): # pylint: disable=unused-argument
'''
Called after the plugin has been registered to the active shell.
:param pypsi.shell.Shell shell: the active shell
:returns int: 0 on success, -1 on failure
'''
return 0
def on_input(self, shell, line): # pylint: disable=unused-argument
'''
Called after input from the user has been received. The return value is
the preprocessed line. This means that modifying the line argument will
not populate back. If this function does no preprocessing, return line
unmodified.
:param pypsi.shell.Shell shell: the active shell
:param str line: the current input statement string
:returns str: the preprocessed line
'''
return line
def on_tokenize(self, shell, tokens, origin): # pylint: disable=unused-argument
'''
Called after an input string has been tokenized. If this function
performs no preprocessing, return the tokens unmodified.
:param pypsi.shell.Shell shell: the active shell
:param list tokens: the list of :class:`pypsi.cmdline.Token` objects
:param str origin: the origin of the input, can be either 'input' if
received from a call to `input()` or 'prompt' if the input is the
prompt to display to the user
:returns list: the list of preprocessed :class:`pypsi.cmdline.Token`
objects
'''
return tokens
def on_input_canceled(self, shell): # pylint: disable=unused-argument
'''
Called when the user can canceled entering a statement via SIGINT
(Ctrl+C).
:param pypsi.shell.Shell shell: the active shell
:returns int: 0 on success, -1 on error
'''
return 0
def on_statement_finished(self, shell, rc): # pylint: disable=unused-argument
'''
Called when a statement has been completely executed.
:param pypsi.shell.Shell shell: the active shell
:returns int: 0 on success, -1 on error
'''
return 0
class Command(object):
'''
A pluggable command that users can execute. All commands need to derive
from this class. When a command is executed by a user, the command's
:meth:`run` method will be called. The return value of the :meth:`run`
method is used when processing forthcoming commands in the active
statement. The return value must be an :class:`int` and follows the Unix
standard: 0 on success, less than 0 on error, and greater than 0 given
invalid input or incorrect usage.
Each command has a topic associated with it. This topic can be referenced
by commands such as :class:`pypsi.commands.help.HelpCommand` to categorize
commands in help messages.
A command can be used as a fallback handler by implementing the
:meth:`fallback` method. This is similar to the :meth:`run` method, except
that is accepts one more argument: the command name to execute that wasn't
found by the shell. The return value of :meth:`fallback` holds the same
purpose as the return value of :meth:`run`.
By the time :meth:`run` is called, the system streams have been updated to
point to the current file streams issued in the statement. For example, if
the statement redirects standard out (:attr:`sys.stdout`) to a file, the
destination file is automatically opened and :attr:`sys.stdout` is
redirected to the opened file stream. Once the command has complete
execution, the redirected stream is automatically closed and
:attr:`sys.stdout` is set to its original stream.
'''
def __init__(self, name, usage=None, brief=None,
topic=None, pipe='str'):
'''
:param str name: the name of the command which the user will reference
in the shell
:param str usage: the usage message to be displayed to the user
:param str brief: a brief description of the command
:param str topic: the topic that this command belongs to
:param str pipe: the type of data that will be read from and written to
any pipes
'''
self.name = name
self.usage = usage or ''
self.brief = brief or ''
self.topic = topic or ''
self.pipe = pipe or 'str'
def complete(self, shell, args, prefix): # pylint: disable=unused-argument
'''
Called when the user attempts a tab-completion action for this command.
:param pypsi.shell.Shell shell: the active shell
:param list args: the list of arguments, the last one containing the
cursor position
:param str prefix: the prefix that all items returned must start with
:returns list: the list of strings that could complete the current
action
'''
return []
def usage_error(self, shell, *args):
'''
Display an error message that indicates incorrect usage of this
command. After the error is displayed, the usage is printed.
:param pypsi.shell.Shell shell: the active shell
:param args: list of strings that are the error message
'''
self.error(shell, *args)
print(AnsiCodes.yellow, self.usage, AnsiCodes.reset, sep='')
def error(self, shell, *args): # pylint: disable=unused-argument
'''
Display an error message to the user.
:param pypsi.shell.Shell shell: the active shell
:param args: the error message to display
'''
msg = "{}: {}".format(self.name, ''.join([str(a) for a in args]))
print(AnsiCodes.red, msg, AnsiCodes.reset, file=sys.stderr, sep='')
def run(self, shell, args):
'''
Execute the command. All commands need to implement this method.
:param pypsi.shell.Shell shell: the active shell
:param list args: list of string arguments
:returns int: 0 on success, less than 0 on error, and greater than 0 on
invalid usage
'''
raise NotImplementedError()
def setup(self, shell): # pylint: disable=unused-argument
'''
Called when the plugin has been registered to the active shell.
:param pypsi.shell.Shell shell: the active shell
:returns int: 0 on success, -1 on error
'''
return 0
def fallback(self, shell, name, args): # pylint: disable=unused-argument
'''
Called when this command was set as the fallback command. The only
difference between this and :meth:`run` is that this method accepts the
command name that was entered by the user.
:param pypsi.shell.Shell shell: the active shell
:param str name: the name of the command to run
:param list args: arguments
:returns int: 0 on success, less than 0 on error, and greater than 0 on
invalid usage
'''
return None
class CommandShortCircuit(Exception):
'''
Exception raised when the user enter invalid arguments or requests usage
information via the -h and --help flags.
'''
def __init__(self, code):
'''
:param int code: the code the command should return
'''
super().__init__(code)
self.code = code
class PypsiArgParser(argparse.ArgumentParser):
'''
Customized :class:`argparse.ArgumentParser` for use in pypsi. This class
slightly modifies the base ArgumentParser so that the following occurs:
- The whole program does not exit on printing the help message or bad
arguments
- Any error messages are intercepted and printed on the active shell's
error stream
- Adds the option to provide callbacks for tab-completing
options and parameters
'''
def get_options(self):
'''
:return: All optional arguments (ex, '-v'/'--verbose')
'''
return list(self._op_completers.keys())
def get_option_completer(self, option):
'''
Returns the callback for the specified optional argument,
Or None if one was not specified.
:param str option: The Option
:return function: The callback function or None
'''
return self._op_completers.get(option, None)
def has_value(self, arg):
'''
Check if the optional argument has a value associated with it.
:param str arg: Optional argument to check
:return: True if arg has a value, false otherwise
'''
# pylint: disable=protected-access
# _option_string_actions is a dictionary containing all of the optional
# arguments and the argparse action they should perform. Currently, the
# only two actions that store a value are _AppendAction/_StoreAction.
# These represent the value passed to 'action' in add_argument:
# parser.add_argument('-l', '--long', action='store')
action = self._option_string_actions.get(arg, None)
return isinstance(action,
(argparse._AppendAction, argparse._StoreAction))
def get_positional_completer(self, pos):
'''
Get the callback for a positional parameter
:param pos: index of the parameter - first param's index = 0
:return: The callback if it exists, else None
'''
try:
return self._pos_completers[pos]
except IndexError:
if self._repeating_cb:
# A positional parameter is set to repeat
return self._repeating_cb
return None
def get_positional_arg_index(self, args):
'''
Get the positional index of a cursor, based on
optional arguments and positional arguments
:param list args: List of str arguments from the Command Line
:return:
'''
index = 0
for token in args:
if token in self._option_string_actions:
# Token is an optional argument ( ex, '-v' / '--verbose' )
if self.has_value(token):
# Optional Argument has a value associated with it, so
# reduce index to not count it's value as a pos param
index -= 1
else:
# Is a positional param or value for an optional argument
index += 1
# return zero-based index
return index - 1
def add_argument(self, *args, completer=None, **kwargs): # pylint: disable=arguments-differ
'''
Override add_argument function of argparse.ArgumentParser to
handle callback functions.
:param args: Positional arguments to pass up to argparse
:param function completer: Optional callback function for argument
:param kwargs: Keywork arguments to pass up to argparse
:return:
'''
cb = completer
nargs = kwargs.get('nargs', None)
chars = self.prefix_chars
if not args or len(args) == 1 and args[0][0] not in chars:
# If no positional args are supplied or only one is supplied and
# it doesn't look like an option string, parse a positional
# argument ( from argparse )
if nargs and nargs in ('+', '*', argparse.REMAINDER):
# Positional param can repeat
# Currently only stores the last repeating completer specified
self._repeating_cb = cb
self._pos_completers.append(cb)
else:
# Add an optional argument
for arg in args:
self._op_completers[arg] = cb
# Call argparse.add_argument()
return super().add_argument(*args, **kwargs)
def pypsi_print(*args, sep=' ', end='\n', file=None, flush=True, width=None,
wrap=True, wrap_prefix=None, replace_errors=True):
'''
Wraps the functionality of the Python builtin `print` function. The
:meth:`pypsi.shell.Shell.bootstrap` overrides the Python :meth:`print`
function with :meth:`pypsi_print`.
:param str sep: string to print between arguments
:param str end: string to print at the end of the output
:param file file: output stream, if this is :const:`None`, the default is
:data:`sys.stdout`
:param bool flush: whether to flush the output stream
:param int width: override the stream's width
:param bool wrap: whether to word wrap the output
:param str wrap_prefix: prefix string to print prior to every new line that
is wrapped
:param bool replace_errors: replace invalid character points with the '?'
character
'''
file = file or sys.stdout
last = len(args) - 1
def write_safe(data):
'''
Write the input str to the file and, if an encoding error occurs and
replace_errors is ``True``, remove invalid code points and print again.
'''
try:
file.write(data)
except UnicodeEncodeError:
if replace_errors:
enc = getattr(file, 'encoding', sys.getdefaultencoding())
file.write(data.encode(enc, errors='replace').decode(enc))
else:
raise
if wrap and hasattr(file, 'width') and file.width:
width = width or file.width
parts = []
for arg in args:
if isinstance(arg, str):
parts.append(arg)
elif arg is None:
parts.append('')
elif isinstance(arg, AnsiCode):
if file.isatty():
parts.append(str(arg))
elif arg.s is not None:
parts.append(str(arg.s))
else:
parts.append(str(arg))
txt = sep.join(parts)
for (line, endl) in get_lines(txt):
if line:
first = True
wrapno = 0
for wrapped in wrap_line(line, width, wrap_prefix=wrap_prefix):
if not wrapped:
continue
wrapno += 1
if not first:
file.write('\n')
else:
first = False
write_safe(wrapped)
if not line or endl:
file.write('\n')
else:
last = len(args) - 1
for (i, arg) in enumerate(args):
write_safe(str(arg))
if sep and i != last:
write_safe(sep)
if end:
write_safe(end)
if flush:
file.flush()
| [
2,
198,
2,
15069,
357,
66,
8,
1853,
11,
7244,
2185,
813,
1279,
1326,
813,
13,
324,
321,
31,
14816,
13,
785,
29,
198,
2,
9485,
862,
72,
532,
3740,
1378,
12567,
13,
785,
14,
480,
813,
14,
9078,
862,
72,
198,
2,
198,
2,
2448,
3411,
284,
779,
11,
4866,
11,
13096,
11,
290,
14,
273,
14983,
428,
3788,
329,
597,
198,
2,
4007,
351,
393,
1231,
6838,
318,
29376,
7520,
11,
2810,
326,
262,
2029,
198,
2,
6634,
4003,
290,
428,
7170,
4003,
1656,
287,
477,
9088,
13,
198,
2,
198,
2,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1,
5357,
3336,
44746,
13954,
48778,
50,
11096,
34764,
11015,
198,
2,
13315,
23337,
9795,
5390,
12680,
47466,
47783,
2751,
11096,
8959,
49094,
34764,
11015,
3963,
198,
2,
34482,
3398,
1565,
5603,
25382,
5357,
376,
46144,
13,
3268,
8005,
49261,
50163,
3336,
44746,
9348,
43031,
19146,
7473,
198,
2,
15529,
38846,
11,
42242,
11,
3268,
17931,
23988,
11,
6375,
7102,
5188,
10917,
3525,
12576,
29506,
25552,
6375,
15529,
29506,
25552,
198,
2,
25003,
15821,
36,
5959,
15731,
16724,
2751,
16034,
406,
18420,
3963,
23210,
11,
42865,
6375,
4810,
19238,
29722,
11,
7655,
2767,
16879,
3268,
3537,
198,
2,
40282,
3963,
27342,
10659,
11,
399,
7156,
43,
3528,
18310,
6375,
25401,
309,
9863,
40,
20958,
40282,
11,
5923,
1797,
2751,
16289,
3963,
198,
2,
6375,
3268,
7102,
45,
24565,
13315,
3336,
23210,
6375,
19878,
13775,
10725,
5222,
3963,
12680,
47466,
13,
198,
2,
198,
198,
7061,
6,
198,
14881,
6097,
329,
5922,
6107,
70,
540,
9729,
290,
20652,
13,
198,
7061,
6,
628,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
6738,
12972,
862,
72,
13,
504,
72,
1330,
1052,
13396,
34,
4147,
11,
1052,
13396,
10669,
198,
6738,
12972,
862,
72,
13,
18982,
1330,
651,
62,
6615,
11,
14441,
62,
1370,
628,
198,
4871,
42636,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
317,
13877,
318,
281,
2134,
326,
318,
1498,
284,
13096,
257,
198,
220,
220,
220,
1058,
9078,
25,
4871,
25,
63,
9078,
862,
72,
13,
29149,
13,
23248,
63,
2134,
338,
4069,
13,
28016,
257,
3141,
460,
307,
198,
220,
220,
220,
12260,
422,
2836,
5128,
11,
262,
4600,
37233,
63,
1398,
857,
407,
3994,
257,
4600,
5143,
3419,
63,
198,
220,
220,
220,
2163,
13,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
662,
14681,
28,
14202,
11,
1281,
14681,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
28407,
273,
460,
1011,
734,
10007,
25,
4600,
3866,
14681,
63,
290,
4600,
7353,
14681,
63,
198,
220,
220,
220,
220,
220,
220,
220,
2312,
3815,
5004,
810,
262,
13877,
29076,
2641,
286,
262,
198,
220,
220,
220,
220,
220,
220,
220,
662,
14681,
290,
1281,
14681,
1351,
13,
770,
1351,
11,
2641,
286,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4871,
25,
63,
9078,
862,
72,
13,
29149,
13,
23248,
47671,
318,
11629,
515,
4726,
3746,
11,
422,
749,
198,
220,
220,
220,
220,
220,
220,
220,
8475,
284,
1551,
13,
1406,
11,
262,
4511,
8475,
1988,
318,
657,
11,
543,
1724,
340,
198,
220,
220,
220,
220,
220,
220,
220,
481,
307,
262,
717,
13877,
284,
1057,
11,
290,
262,
9016,
1988,
318,
1802,
11,
543,
198,
220,
220,
220,
220,
220,
220,
220,
1724,
340,
481,
307,
262,
938,
13877,
284,
1057,
13,
1002,
2035,
1988,
318,
4600,
14202,
47671,
262,
198,
220,
220,
220,
220,
220,
220,
220,
13877,
318,
407,
2087,
284,
262,
7587,
1351,
13,
1114,
1672,
11,
611,
428,
13877,
198,
220,
220,
220,
220,
220,
220,
220,
691,
3769,
257,
662,
36948,
11244,
11,
788,
1281,
14681,
815,
307,
198,
220,
220,
220,
220,
220,
220,
220,
900,
284,
1058,
9979,
25,
63,
14202,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
493,
662,
14681,
25,
262,
662,
14681,
8475,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
493,
1281,
14681,
25,
262,
1281,
14681,
8475,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
3866,
14681,
796,
662,
14681,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7353,
14681,
796,
1281,
14681,
628,
220,
220,
220,
825,
9058,
7,
944,
11,
7582,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
706,
262,
13877,
468,
587,
6823,
284,
262,
4075,
7582,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
493,
25,
657,
319,
1943,
11,
532,
16,
319,
5287,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
825,
319,
62,
15414,
7,
944,
11,
7582,
11,
1627,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
706,
5128,
422,
262,
2836,
468,
587,
2722,
13,
383,
1441,
1988,
318,
198,
220,
220,
220,
220,
220,
220,
220,
262,
662,
14681,
276,
1627,
13,
770,
1724,
326,
30620,
262,
1627,
4578,
481,
198,
220,
220,
220,
220,
220,
220,
220,
407,
48040,
736,
13,
1002,
428,
2163,
857,
645,
662,
36948,
11,
1441,
1627,
198,
220,
220,
220,
220,
220,
220,
220,
555,
41771,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
1627,
25,
262,
1459,
5128,
2643,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
965,
25,
262,
662,
14681,
276,
1627,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1627,
628,
220,
220,
220,
825,
319,
62,
30001,
1096,
7,
944,
11,
7582,
11,
16326,
11,
8159,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
706,
281,
5128,
4731,
468,
587,
11241,
1143,
13,
1002,
428,
2163,
198,
220,
220,
220,
220,
220,
220,
220,
17706,
645,
662,
36948,
11,
1441,
262,
16326,
555,
41771,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1351,
16326,
25,
262,
1351,
286,
1058,
4871,
25,
63,
9078,
862,
72,
13,
28758,
1370,
13,
30642,
63,
5563,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
8159,
25,
262,
8159,
286,
262,
5128,
11,
460,
307,
2035,
705,
15414,
6,
611,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2722,
422,
257,
869,
284,
4600,
15414,
3419,
63,
393,
705,
16963,
457,
6,
611,
262,
5128,
318,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6152,
284,
3359,
284,
262,
2836,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
1351,
25,
262,
1351,
286,
662,
14681,
276,
1058,
4871,
25,
63,
9078,
862,
72,
13,
28758,
1370,
13,
30642,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5563,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
16326,
628,
220,
220,
220,
825,
319,
62,
15414,
62,
66,
590,
992,
7,
944,
11,
7582,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
618,
262,
2836,
460,
19994,
8218,
257,
2643,
2884,
33993,
12394,
198,
220,
220,
220,
220,
220,
220,
220,
357,
40069,
10,
34,
737,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
493,
25,
657,
319,
1943,
11,
532,
16,
319,
4049,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
825,
319,
62,
26090,
62,
43952,
7,
944,
11,
7582,
11,
48321,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
618,
257,
2643,
468,
587,
3190,
10945,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
493,
25,
657,
319,
1943,
11,
532,
16,
319,
4049,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
198,
4871,
9455,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
317,
6107,
70,
540,
3141,
326,
2985,
460,
12260,
13,
1439,
9729,
761,
284,
27099,
198,
220,
220,
220,
422,
428,
1398,
13,
1649,
257,
3141,
318,
10945,
416,
257,
2836,
11,
262,
3141,
338,
198,
220,
220,
220,
1058,
76,
2788,
25,
63,
5143,
63,
2446,
481,
307,
1444,
13,
383,
1441,
1988,
286,
262,
1058,
76,
2788,
25,
63,
5143,
63,
198,
220,
220,
220,
2446,
318,
973,
618,
7587,
21220,
9729,
287,
262,
4075,
198,
220,
220,
220,
2643,
13,
383,
1441,
1988,
1276,
307,
281,
1058,
4871,
25,
63,
600,
63,
290,
5679,
262,
33501,
198,
220,
220,
220,
3210,
25,
657,
319,
1943,
11,
1342,
621,
657,
319,
4049,
11,
290,
3744,
621,
657,
1813,
198,
220,
220,
220,
12515,
5128,
393,
11491,
8748,
13,
628,
220,
220,
220,
5501,
3141,
468,
257,
7243,
3917,
351,
340,
13,
770,
7243,
460,
307,
20717,
198,
220,
220,
220,
416,
9729,
884,
355,
1058,
4871,
25,
63,
9078,
862,
72,
13,
9503,
1746,
13,
16794,
13,
22087,
21575,
63,
284,
17851,
1096,
198,
220,
220,
220,
9729,
287,
1037,
6218,
13,
628,
220,
220,
220,
317,
3141,
460,
307,
973,
355,
257,
2121,
1891,
21360,
416,
15427,
262,
198,
220,
220,
220,
1058,
76,
2788,
25,
63,
7207,
1891,
63,
2446,
13,
770,
318,
2092,
284,
262,
1058,
76,
2788,
25,
63,
5143,
63,
2446,
11,
2845,
198,
220,
220,
220,
326,
318,
18178,
530,
517,
4578,
25,
262,
3141,
1438,
284,
12260,
326,
2492,
470,
198,
220,
220,
220,
1043,
416,
262,
7582,
13,
383,
1441,
1988,
286,
1058,
76,
2788,
25,
63,
7207,
1891,
63,
6622,
262,
976,
198,
220,
220,
220,
4007,
355,
262,
1441,
1988,
286,
1058,
76,
2788,
25,
63,
5143,
44646,
628,
220,
220,
220,
2750,
262,
640,
1058,
76,
2788,
25,
63,
5143,
63,
318,
1444,
11,
262,
1080,
15190,
423,
587,
6153,
284,
198,
220,
220,
220,
966,
284,
262,
1459,
2393,
15190,
4884,
287,
262,
2643,
13,
1114,
1672,
11,
611,
198,
220,
220,
220,
262,
2643,
18941,
82,
3210,
503,
357,
25,
35226,
25,
63,
17597,
13,
19282,
448,
63,
8,
284,
257,
2393,
11,
262,
198,
220,
220,
220,
10965,
2393,
318,
6338,
4721,
290,
1058,
35226,
25,
63,
17597,
13,
19282,
448,
63,
318,
198,
220,
220,
220,
45158,
284,
262,
4721,
2393,
4269,
13,
4874,
262,
3141,
468,
1844,
198,
220,
220,
220,
9706,
11,
262,
45158,
4269,
318,
6338,
4838,
290,
198,
220,
220,
220,
1058,
35226,
25,
63,
17597,
13,
19282,
448,
63,
318,
900,
284,
663,
2656,
4269,
13,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1438,
11,
8748,
28,
14202,
11,
4506,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7243,
28,
14202,
11,
12656,
11639,
2536,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
1438,
25,
262,
1438,
286,
262,
3141,
543,
262,
2836,
481,
4941,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
262,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
8748,
25,
262,
8748,
3275,
284,
307,
9066,
284,
262,
2836,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4506,
25,
257,
4506,
6764,
286,
262,
3141,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
7243,
25,
262,
7243,
326,
428,
3141,
14448,
284,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
12656,
25,
262,
2099,
286,
1366,
326,
481,
307,
1100,
422,
290,
3194,
284,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
597,
19860,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
3672,
796,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
26060,
796,
8748,
393,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
65,
3796,
796,
4506,
393,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
26652,
796,
7243,
393,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
34360,
796,
12656,
393,
705,
2536,
6,
628,
220,
220,
220,
825,
1844,
7,
944,
11,
7582,
11,
26498,
11,
21231,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
618,
262,
2836,
6370,
257,
7400,
12,
785,
24547,
2223,
329,
428,
3141,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1351,
26498,
25,
262,
1351,
286,
7159,
11,
262,
938,
530,
7268,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23493,
2292,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
21231,
25,
262,
21231,
326,
477,
3709,
4504,
1276,
923,
351,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
1351,
25,
262,
1351,
286,
13042,
326,
714,
1844,
262,
1459,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2223,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
17635,
628,
220,
220,
220,
825,
8748,
62,
18224,
7,
944,
11,
7582,
11,
1635,
22046,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
16531,
281,
4049,
3275,
326,
9217,
11491,
8748,
286,
428,
198,
220,
220,
220,
220,
220,
220,
220,
3141,
13,
2293,
262,
4049,
318,
9066,
11,
262,
8748,
318,
10398,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
26498,
25,
1351,
286,
13042,
326,
389,
262,
4049,
3275,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
18224,
7,
29149,
11,
1635,
22046,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
2025,
13396,
34,
4147,
13,
36022,
11,
2116,
13,
26060,
11,
1052,
13396,
34,
4147,
13,
42503,
11,
41767,
28,
7061,
8,
628,
220,
220,
220,
825,
4049,
7,
944,
11,
7582,
11,
1635,
22046,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
16531,
281,
4049,
3275,
284,
262,
2836,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
26498,
25,
262,
4049,
3275,
284,
3359,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
45144,
38362,
23884,
1911,
18982,
7,
944,
13,
3672,
11,
705,
4458,
22179,
26933,
2536,
7,
64,
8,
329,
257,
287,
26498,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
2025,
13396,
34,
4147,
13,
445,
11,
31456,
11,
1052,
13396,
34,
4147,
13,
42503,
11,
2393,
28,
17597,
13,
301,
1082,
81,
11,
41767,
28,
7061,
8,
628,
220,
220,
220,
825,
1057,
7,
944,
11,
7582,
11,
26498,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
8393,
1133,
262,
3141,
13,
1439,
9729,
761,
284,
3494,
428,
2446,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1351,
26498,
25,
1351,
286,
4731,
7159,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
493,
25,
657,
319,
1943,
11,
1342,
621,
657,
319,
4049,
11,
290,
3744,
621,
657,
319,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12515,
8748,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
1892,
3546,
1154,
12061,
12331,
3419,
628,
220,
220,
220,
825,
9058,
7,
944,
11,
7582,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
618,
262,
13877,
468,
587,
6823,
284,
262,
4075,
7582,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
493,
25,
657,
319,
1943,
11,
532,
16,
319,
4049,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
825,
2121,
1891,
7,
944,
11,
7582,
11,
1438,
11,
26498,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
618,
428,
3141,
373,
900,
355,
262,
2121,
1891,
3141,
13,
383,
691,
198,
220,
220,
220,
220,
220,
220,
220,
3580,
1022,
428,
290,
1058,
76,
2788,
25,
63,
5143,
63,
318,
326,
428,
2446,
18178,
262,
198,
220,
220,
220,
220,
220,
220,
220,
3141,
1438,
326,
373,
5982,
416,
262,
2836,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12972,
862,
72,
13,
29149,
13,
23248,
7582,
25,
262,
4075,
7582,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
1438,
25,
262,
1438,
286,
262,
3141,
284,
1057,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1351,
26498,
25,
7159,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
493,
25,
657,
319,
1943,
11,
1342,
621,
657,
319,
4049,
11,
290,
3744,
621,
657,
319,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12515,
8748,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
198,
4871,
9455,
16438,
31560,
5013,
7,
16922,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
35528,
4376,
618,
262,
2836,
3802,
12515,
7159,
393,
7007,
8748,
198,
220,
220,
220,
1321,
2884,
262,
532,
71,
290,
1377,
16794,
9701,
13,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2438,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
493,
2438,
25,
262,
2438,
262,
3141,
815,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
220,
220,
220,
220,
2208,
22446,
834,
15003,
834,
7,
8189,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
8189,
796,
2438,
628,
198,
4871,
9485,
862,
72,
28100,
46677,
7,
853,
29572,
13,
28100,
1713,
46677,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
8562,
1143,
1058,
4871,
25,
63,
853,
29572,
13,
28100,
1713,
46677,
63,
329,
779,
287,
12972,
862,
72,
13,
770,
1398,
198,
220,
220,
220,
4622,
953,
6945,
262,
2779,
45751,
46677,
523,
326,
262,
1708,
8833,
25,
628,
220,
220,
220,
532,
383,
2187,
1430,
857,
407,
8420,
319,
13570,
262,
1037,
3275,
393,
2089,
198,
220,
220,
220,
220,
220,
7159,
198,
220,
220,
220,
532,
4377,
4049,
6218,
389,
29842,
290,
10398,
319,
262,
4075,
7582,
338,
198,
220,
220,
220,
220,
220,
4049,
4269,
198,
220,
220,
220,
532,
34333,
262,
3038,
284,
2148,
869,
10146,
329,
7400,
12,
785,
47130,
198,
220,
220,
220,
220,
220,
3689,
290,
10007,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
825,
651,
62,
25811,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
1439,
11902,
7159,
357,
1069,
11,
705,
12,
85,
26488,
6,
438,
19011,
577,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1351,
7,
944,
13557,
404,
62,
785,
1154,
1010,
13,
13083,
28955,
628,
220,
220,
220,
825,
651,
62,
18076,
62,
785,
1154,
353,
7,
944,
11,
3038,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
262,
23838,
329,
262,
7368,
11902,
4578,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1471,
6045,
611,
530,
373,
407,
7368,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
3038,
25,
383,
16018,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
2163,
25,
383,
23838,
2163,
393,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
404,
62,
785,
1154,
1010,
13,
1136,
7,
18076,
11,
6045,
8,
628,
220,
220,
220,
825,
468,
62,
8367,
7,
944,
11,
1822,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
6822,
611,
262,
11902,
4578,
468,
257,
1988,
3917,
351,
340,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
1822,
25,
32233,
4578,
284,
2198,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6407,
611,
1822,
468,
257,
1988,
11,
3991,
4306,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
279,
2645,
600,
25,
15560,
28,
24326,
12,
15526,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4808,
18076,
62,
8841,
62,
4658,
318,
257,
22155,
7268,
477,
286,
262,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7159,
290,
262,
1822,
29572,
2223,
484,
815,
1620,
13,
16888,
11,
262,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
691,
734,
4028,
326,
3650,
257,
1988,
389,
4808,
4677,
437,
12502,
47835,
22658,
12502,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2312,
2380,
262,
1988,
3804,
284,
705,
2673,
6,
287,
751,
62,
49140,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
30751,
13,
2860,
62,
49140,
10786,
12,
75,
3256,
705,
438,
6511,
3256,
2223,
11639,
8095,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2223,
796,
2116,
13557,
18076,
62,
8841,
62,
4658,
13,
1136,
7,
853,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
318,
39098,
7,
2673,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
853,
29572,
13557,
4677,
437,
12502,
11,
1822,
29572,
13557,
22658,
12502,
4008,
628,
220,
220,
220,
825,
651,
62,
1930,
1859,
62,
785,
1154,
353,
7,
944,
11,
1426,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
3497,
262,
23838,
329,
257,
45203,
11507,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1426,
25,
6376,
286,
262,
11507,
532,
717,
5772,
338,
6376,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
383,
23838,
611,
340,
7160,
11,
2073,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
1930,
62,
785,
1154,
1010,
58,
1930,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
12901,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13557,
45956,
803,
62,
21101,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
317,
45203,
11507,
318,
900,
284,
9585,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
45956,
803,
62,
21101,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
220,
220,
220,
825,
651,
62,
1930,
1859,
62,
853,
62,
9630,
7,
944,
11,
26498,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
3497,
262,
45203,
6376,
286,
257,
23493,
11,
1912,
319,
198,
220,
220,
220,
220,
220,
220,
220,
11902,
7159,
290,
45203,
7159,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1351,
26498,
25,
7343,
286,
965,
7159,
422,
262,
9455,
6910,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
6376,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
329,
11241,
287,
26498,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
11241,
287,
2116,
13557,
18076,
62,
8841,
62,
4658,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
29130,
318,
281,
11902,
4578,
357,
409,
11,
705,
12,
85,
6,
1220,
705,
438,
19011,
577,
6,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
10134,
62,
8367,
7,
30001,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
32233,
45751,
468,
257,
1988,
3917,
351,
340,
11,
523,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4646,
6376,
284,
407,
954,
340,
338,
1988,
355,
257,
1426,
5772,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
48185,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1148,
257,
45203,
5772,
393,
1988,
329,
281,
11902,
4578,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1441,
6632,
12,
3106,
6376,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6376,
532,
352,
628,
220,
220,
220,
825,
751,
62,
49140,
7,
944,
11,
1635,
22046,
11,
1224,
353,
28,
14202,
11,
12429,
46265,
22046,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
853,
2886,
12,
26069,
263,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
3827,
13154,
751,
62,
49140,
2163,
286,
1822,
29572,
13,
28100,
1713,
46677,
284,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
23838,
5499,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
26498,
25,
220,
220,
18574,
1859,
7159,
284,
1208,
510,
284,
1822,
29572,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
2163,
1224,
353,
25,
32233,
23838,
2163,
329,
4578,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
479,
86,
22046,
25,
7383,
1818,
7159,
284,
1208,
510,
284,
1822,
29572,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
796,
1224,
353,
198,
220,
220,
220,
220,
220,
220,
220,
299,
22046,
796,
479,
86,
22046,
13,
1136,
10786,
77,
22046,
3256,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
34534,
796,
2116,
13,
40290,
62,
354,
945,
628,
220,
220,
220,
220,
220,
220,
220,
611,
407,
26498,
393,
18896,
7,
22046,
8,
6624,
352,
290,
26498,
58,
15,
7131,
15,
60,
407,
287,
34534,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
645,
45203,
26498,
389,
14275,
393,
691,
530,
318,
14275,
290,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
340,
1595,
470,
804,
588,
281,
3038,
4731,
11,
21136,
257,
45203,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4578,
357,
422,
1822,
29572,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
299,
22046,
290,
299,
22046,
287,
19203,
10,
3256,
705,
9,
3256,
1822,
29572,
13,
2200,
5673,
12115,
1137,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
18574,
1859,
5772,
460,
9585,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
16888,
691,
7000,
262,
938,
20394,
1224,
353,
7368,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
45956,
803,
62,
21101,
796,
269,
65,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1930,
62,
785,
1154,
1010,
13,
33295,
7,
21101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
281,
11902,
4578,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1822,
287,
26498,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
404,
62,
785,
1154,
1010,
58,
853,
60,
796,
269,
65,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4889,
1822,
29572,
13,
2860,
62,
49140,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2208,
22446,
2860,
62,
49140,
46491,
22046,
11,
12429,
46265,
22046,
8,
628,
198,
4299,
12972,
862,
72,
62,
4798,
46491,
22046,
11,
41767,
11639,
46083,
886,
11639,
59,
77,
3256,
2393,
28,
14202,
11,
24773,
28,
17821,
11,
9647,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14441,
28,
17821,
11,
14441,
62,
40290,
28,
14202,
11,
6330,
62,
48277,
28,
17821,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
27323,
862,
262,
11244,
286,
262,
11361,
3170,
259,
4600,
4798,
63,
2163,
13,
383,
198,
220,
220,
220,
1058,
76,
2788,
25,
63,
9078,
862,
72,
13,
29149,
13,
23248,
13,
18769,
26418,
63,
23170,
1460,
262,
11361,
1058,
76,
2788,
25,
63,
4798,
63,
198,
220,
220,
220,
2163,
351,
1058,
76,
2788,
25,
63,
9078,
862,
72,
62,
4798,
44646,
628,
220,
220,
220,
1058,
17143,
965,
41767,
25,
4731,
284,
3601,
1022,
7159,
198,
220,
220,
220,
1058,
17143,
965,
886,
25,
4731,
284,
3601,
379,
262,
886,
286,
262,
5072,
198,
220,
220,
220,
1058,
17143,
2393,
2393,
25,
5072,
4269,
11,
611,
428,
318,
1058,
9979,
25,
63,
14202,
47671,
262,
4277,
318,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7890,
25,
63,
17597,
13,
19282,
448,
63,
198,
220,
220,
220,
1058,
17143,
20512,
24773,
25,
1771,
284,
24773,
262,
5072,
4269,
198,
220,
220,
220,
1058,
17143,
493,
9647,
25,
20957,
262,
4269,
338,
9647,
198,
220,
220,
220,
1058,
17143,
20512,
14441,
25,
1771,
284,
1573,
14441,
262,
5072,
198,
220,
220,
220,
1058,
17143,
965,
14441,
62,
40290,
25,
21231,
4731,
284,
3601,
3161,
284,
790,
649,
1627,
326,
198,
220,
220,
220,
220,
220,
220,
220,
318,
12908,
198,
220,
220,
220,
1058,
17143,
20512,
6330,
62,
48277,
25,
6330,
12515,
2095,
2173,
351,
262,
705,
8348,
198,
220,
220,
220,
220,
220,
220,
220,
2095,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
2393,
796,
2393,
393,
25064,
13,
19282,
448,
198,
220,
220,
220,
938,
796,
18896,
7,
22046,
8,
532,
352,
628,
220,
220,
220,
825,
3551,
62,
21230,
7,
7890,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
19430,
262,
5128,
965,
284,
262,
2393,
290,
11,
611,
281,
21004,
4049,
8833,
290,
198,
220,
220,
220,
220,
220,
220,
220,
6330,
62,
48277,
318,
7559,
17821,
15506,
11,
4781,
12515,
2438,
2173,
290,
3601,
757,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
13,
13564,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
34371,
4834,
8189,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
6330,
62,
48277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2207,
796,
651,
35226,
7,
7753,
11,
705,
12685,
7656,
3256,
25064,
13,
1136,
12286,
12685,
7656,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
13,
13564,
7,
7890,
13,
268,
8189,
7,
12685,
11,
8563,
11639,
33491,
27691,
12501,
1098,
7,
12685,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
628,
220,
220,
220,
611,
14441,
290,
468,
35226,
7,
7753,
11,
705,
10394,
11537,
290,
2393,
13,
10394,
25,
198,
220,
220,
220,
220,
220,
220,
220,
9647,
796,
9647,
393,
2393,
13,
10394,
198,
220,
220,
220,
220,
220,
220,
220,
3354,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1822,
287,
26498,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
853,
11,
965,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3354,
13,
33295,
7,
853,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
1822,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3354,
13,
33295,
7,
7061,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
318,
39098,
7,
853,
11,
1052,
13396,
10669,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2393,
13,
271,
265,
774,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3354,
13,
33295,
7,
2536,
7,
853,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
1822,
13,
82,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3354,
13,
33295,
7,
2536,
7,
853,
13,
82,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3354,
13,
33295,
7,
2536,
7,
853,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
256,
742,
796,
41767,
13,
22179,
7,
42632,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
357,
1370,
11,
886,
75,
8,
287,
651,
62,
6615,
7,
14116,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1627,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
717,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14441,
3919,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
12908,
287,
14441,
62,
1370,
7,
1370,
11,
9647,
11,
14441,
62,
40290,
28,
37150,
62,
40290,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
12908,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14441,
3919,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
717,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
13,
13564,
10786,
59,
77,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
717,
796,
10352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
62,
21230,
7,
29988,
1496,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
1627,
393,
886,
75,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
13,
13564,
10786,
59,
77,
11537,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
938,
796,
18896,
7,
22046,
8,
532,
352,
198,
220,
220,
220,
220,
220,
220,
220,
329,
357,
72,
11,
1822,
8,
287,
27056,
378,
7,
22046,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
62,
21230,
7,
2536,
7,
853,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
41767,
290,
1312,
14512,
938,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
62,
21230,
7,
325,
79,
8,
628,
220,
220,
220,
611,
886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3551,
62,
21230,
7,
437,
8,
198,
220,
220,
220,
611,
24773,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
13,
25925,
3419,
198
] | 2.532193 | 6,663 |
QUESTIONS = ['a', 'b', 'c', 'x', 'y', 'z']
if __name__ == '__main__':
with open('input') as file:
groups = []
group = []
for row in file:
row = row.strip()
if not row:
groups.append(group)
group = []
continue
group.append(row)
groups.append(group)
print(sum(map(anyone, groups)))
print(sum(map(everyone, groups)))
| [
35780,
11053,
796,
37250,
64,
3256,
705,
65,
3256,
705,
66,
3256,
705,
87,
3256,
705,
88,
3256,
705,
89,
20520,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
351,
1280,
10786,
15414,
11537,
355,
2393,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2628,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
5752,
287,
2393,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5752,
796,
5752,
13,
36311,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
5752,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2628,
13,
33295,
7,
8094,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1448,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1448,
13,
33295,
7,
808,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2628,
13,
33295,
7,
8094,
8,
628,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
16345,
7,
8899,
7,
1092,
505,
11,
2628,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
16345,
7,
8899,
7,
47057,
11,
2628,
22305,
198
] | 1.867769 | 242 |
from dataclasses import dataclass
from typing import Any, Dict, Generator, List, Optional
from .base import (
Blob,
Bucket,
BucketClient,
BucketEntry,
ClientError,
PathyScanDir,
PurePathy,
)
try:
from google.api_core import exceptions as gcs_errors # type:ignore
from google.auth.exceptions import DefaultCredentialsError # type:ignore
from google.cloud.storage import Blob as GCSNativeBlob # type:ignore
from google.cloud.storage import Bucket as GCSNativeBucket # type:ignore
from google.cloud.storage import Client as GCSNativeClient # type:ignore
has_gcs = True
except ImportError:
GCSNativeBlob = Any
DefaultCredentialsError = BaseException
gcs_errors = Any
GCSNativeBucket = Any
GCSNativeClient = Any
has_gcs = False
_MISSING_DEPS = """You are using the GCS functionality of Pathy without
having the required dependencies installed.
Please try installing them:
pip install pathy[gcs]
"""
@dataclass
@dataclass
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
35986,
11,
7343,
11,
32233,
198,
198,
6738,
764,
8692,
1330,
357,
198,
220,
220,
220,
1086,
672,
11,
198,
220,
220,
220,
48353,
11,
198,
220,
220,
220,
48353,
11792,
11,
198,
220,
220,
220,
48353,
30150,
11,
198,
220,
220,
220,
20985,
12331,
11,
198,
220,
220,
220,
350,
10036,
33351,
35277,
11,
198,
220,
220,
220,
17129,
47,
10036,
11,
198,
8,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
23645,
13,
15042,
62,
7295,
1330,
13269,
355,
308,
6359,
62,
48277,
220,
1303,
2099,
25,
46430,
198,
220,
220,
220,
422,
23645,
13,
18439,
13,
1069,
11755,
1330,
15161,
34,
445,
14817,
12331,
220,
1303,
2099,
25,
46430,
198,
220,
220,
220,
422,
23645,
13,
17721,
13,
35350,
1330,
1086,
672,
355,
402,
7902,
31272,
3629,
672,
220,
1303,
2099,
25,
46430,
198,
220,
220,
220,
422,
23645,
13,
17721,
13,
35350,
1330,
48353,
355,
402,
7902,
31272,
33,
38811,
220,
1303,
2099,
25,
46430,
198,
220,
220,
220,
422,
23645,
13,
17721,
13,
35350,
1330,
20985,
355,
402,
7902,
31272,
11792,
220,
1303,
2099,
25,
46430,
628,
220,
220,
220,
468,
62,
70,
6359,
796,
6407,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
402,
7902,
31272,
3629,
672,
796,
4377,
198,
220,
220,
220,
15161,
34,
445,
14817,
12331,
796,
7308,
16922,
198,
220,
220,
220,
308,
6359,
62,
48277,
796,
4377,
198,
220,
220,
220,
402,
7902,
31272,
33,
38811,
796,
4377,
198,
220,
220,
220,
402,
7902,
31272,
11792,
796,
4377,
198,
220,
220,
220,
468,
62,
70,
6359,
796,
10352,
198,
198,
62,
44,
16744,
2751,
62,
7206,
3705,
796,
37227,
1639,
389,
1262,
262,
402,
7902,
11244,
286,
350,
10036,
1231,
198,
40965,
262,
2672,
20086,
6589,
13,
198,
198,
5492,
1949,
15975,
606,
25,
628,
220,
220,
220,
7347,
2721,
3108,
88,
58,
70,
6359,
60,
198,
198,
37811,
628,
198,
198,
31,
19608,
330,
31172,
628,
198,
31,
19608,
330,
31172,
628,
198
] | 2.950581 | 344 |
# -*- coding: utf-8 -*-
from time import sleep
from bs4 import BeautifulSoup
import csv
import requests
links = []
items = []
for i in range(1,38):
endpoint = f"https://baby.webteb.com/baby-names/%D8%A7%D8%B3%D9%85%D8%A7%D8%A1-%D8%A7%D9%88%D9%84%D8%A7%D8%AF-%D9%88%D8%A8%D9%86%D8%A7%D8%AA?pageindex={i}"
get_response = requests.get(endpoint)
# print(get_response.content)
soup = BeautifulSoup(get_response.content, 'lxml')
# print(soup.prettify())
section = soup.find('div', {'class':'page-section'})
for li in section.find_all('li'):
links.append(li.a['href'])
print(f'{i}', li.a['href'])
for i, link in zip(range(1,len(links)+1), links):
url = f"https://baby.webteb.com{link}"
get_response = requests.get(url)
soup = BeautifulSoup(get_response.content, 'lxml')
content = soup.find('div', {'class':'section name'})
section1 = content.find('div', {'class':'section'})
name_detail = content.find('div', {'class':'name-details'})
section2 = name_detail.find('div', {'class':'section'})
span = section2.find('span', {'class':'latin'})
item = {}
if content.h1.text:
item['arabic_name'] = content.h1.text
if section1.p.text:
item['meaning'] = section1.p.text
if span.text:
item['english_name'] = span.text
print(i, content.h1.text, section1.p.text, span.text)
items.append(item)
filename = '/home/naga/dev/babyNamesScraping/project/both.csv'
with open(filename, 'w', newline='') as f:
w = csv.DictWriter(f, fieldnames=['arabic_name','meaning', 'english_name'], extrasaction='ignore' , delimiter = ';')
w.writeheader()
print(items)
for item in items:
w.writerow(item)
print(item)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
640,
1330,
3993,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
269,
21370,
198,
11748,
7007,
198,
198,
28751,
796,
17635,
198,
23814,
796,
17635,
198,
198,
1640,
1312,
287,
2837,
7,
16,
11,
2548,
2599,
198,
220,
220,
220,
36123,
796,
277,
1,
5450,
1378,
40252,
13,
12384,
660,
65,
13,
785,
14,
40252,
12,
14933,
14,
4,
35,
23,
4,
32,
22,
4,
35,
23,
4,
33,
18,
4,
35,
24,
4,
5332,
4,
35,
23,
4,
32,
22,
4,
35,
23,
4,
32,
16,
12,
4,
35,
23,
4,
32,
22,
4,
35,
24,
4,
3459,
4,
35,
24,
4,
5705,
4,
35,
23,
4,
32,
22,
4,
35,
23,
4,
8579,
12,
4,
35,
24,
4,
3459,
4,
35,
23,
4,
32,
23,
4,
35,
24,
4,
4521,
4,
35,
23,
4,
32,
22,
4,
35,
23,
4,
3838,
30,
7700,
9630,
34758,
72,
36786,
628,
220,
220,
220,
651,
62,
26209,
796,
7007,
13,
1136,
7,
437,
4122,
8,
198,
220,
220,
220,
1303,
3601,
7,
1136,
62,
26209,
13,
11299,
8,
628,
220,
220,
220,
17141,
796,
23762,
50,
10486,
7,
1136,
62,
26209,
13,
11299,
11,
705,
75,
19875,
11537,
198,
220,
220,
220,
1303,
3601,
7,
82,
10486,
13,
3866,
926,
1958,
28955,
628,
220,
220,
220,
2665,
796,
17141,
13,
19796,
10786,
7146,
3256,
1391,
6,
4871,
10354,
6,
7700,
12,
5458,
6,
30072,
628,
220,
220,
220,
329,
7649,
287,
2665,
13,
19796,
62,
439,
10786,
4528,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
6117,
13,
33295,
7,
4528,
13,
64,
17816,
33257,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
90,
72,
92,
3256,
7649,
13,
64,
17816,
33257,
6,
12962,
628,
198,
1640,
1312,
11,
2792,
287,
19974,
7,
9521,
7,
16,
11,
11925,
7,
28751,
47762,
16,
828,
6117,
2599,
198,
220,
220,
220,
19016,
796,
277,
1,
5450,
1378,
40252,
13,
12384,
660,
65,
13,
785,
90,
8726,
36786,
628,
220,
220,
220,
651,
62,
26209,
796,
7007,
13,
1136,
7,
6371,
8,
628,
220,
220,
220,
17141,
796,
23762,
50,
10486,
7,
1136,
62,
26209,
13,
11299,
11,
705,
75,
19875,
11537,
628,
220,
220,
220,
2695,
796,
17141,
13,
19796,
10786,
7146,
3256,
1391,
6,
4871,
10354,
6,
5458,
1438,
6,
30072,
198,
220,
220,
220,
2665,
16,
796,
2695,
13,
19796,
10786,
7146,
3256,
1391,
6,
4871,
10354,
6,
5458,
6,
30072,
198,
220,
220,
220,
1438,
62,
49170,
796,
2695,
13,
19796,
10786,
7146,
3256,
1391,
6,
4871,
10354,
6,
3672,
12,
36604,
6,
30072,
198,
220,
220,
220,
2665,
17,
796,
1438,
62,
49170,
13,
19796,
10786,
7146,
3256,
1391,
6,
4871,
10354,
6,
5458,
6,
30072,
198,
220,
220,
220,
11506,
796,
2665,
17,
13,
19796,
10786,
12626,
3256,
1391,
6,
4871,
10354,
6,
75,
10680,
6,
30072,
628,
220,
220,
220,
2378,
796,
23884,
198,
220,
220,
220,
611,
2695,
13,
71,
16,
13,
5239,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
17816,
283,
397,
291,
62,
3672,
20520,
796,
2695,
13,
71,
16,
13,
5239,
198,
220,
220,
220,
611,
2665,
16,
13,
79,
13,
5239,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
17816,
24815,
20520,
796,
2665,
16,
13,
79,
13,
5239,
198,
220,
220,
220,
611,
11506,
13,
5239,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
17816,
39126,
62,
3672,
20520,
796,
11506,
13,
5239,
628,
220,
220,
220,
3601,
7,
72,
11,
2695,
13,
71,
16,
13,
5239,
11,
2665,
16,
13,
79,
13,
5239,
11,
11506,
13,
5239,
8,
628,
220,
220,
220,
3709,
13,
33295,
7,
9186,
8,
628,
198,
34345,
796,
31051,
11195,
14,
77,
8126,
14,
7959,
14,
40252,
36690,
3351,
2416,
278,
14,
16302,
14,
16885,
13,
40664,
6,
198,
4480,
1280,
7,
34345,
11,
705,
86,
3256,
649,
1370,
28,
7061,
8,
355,
277,
25,
198,
220,
220,
220,
266,
796,
269,
21370,
13,
35,
713,
34379,
7,
69,
11,
2214,
14933,
28,
17816,
283,
397,
291,
62,
3672,
41707,
24815,
3256,
705,
39126,
62,
3672,
6,
4357,
33849,
2673,
11639,
46430,
6,
837,
46728,
2676,
796,
705,
26,
11537,
198,
220,
220,
220,
266,
13,
13564,
25677,
3419,
198,
220,
220,
220,
3601,
7,
23814,
8,
198,
220,
220,
220,
329,
2378,
287,
3709,
25,
198,
220,
220,
220,
220,
220,
220,
220,
266,
13,
16002,
322,
7,
9186,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
9186,
8,
198,
220,
220,
220,
220
] | 2.258065 | 775 |
from typing import Tuple
import haiku as hk
import jax.numpy as jnp
import numpyro
from absl import flags
from numpyro.distributions.continuous import MultivariateNormal
from sde import drifts, diffusions
Array = jnp.ndarray
flags.DEFINE_enum("solver", "strong_3_halfs", ["euler_maruyama", "strong_3_halfs"], "Solver to use.")
FLAGS = flags.FLAGS
solvers_dict = {
"euler_maruyama": EulerMaruyamaSolver,
"strong_3_halfs": Strong3HalfsSolver
}
| [
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
387,
28643,
355,
289,
74,
198,
11748,
474,
897,
13,
77,
32152,
355,
474,
37659,
198,
11748,
299,
32152,
305,
198,
6738,
2352,
75,
1330,
9701,
198,
6738,
299,
32152,
305,
13,
17080,
2455,
507,
13,
18487,
5623,
1330,
7854,
42524,
26447,
198,
198,
6738,
264,
2934,
1330,
1553,
19265,
11,
814,
15880,
198,
198,
19182,
796,
474,
37659,
13,
358,
18747,
198,
198,
33152,
13,
7206,
29940,
62,
44709,
7203,
82,
14375,
1600,
366,
11576,
62,
18,
62,
13959,
82,
1600,
14631,
68,
18173,
62,
3876,
4669,
1689,
1600,
366,
11576,
62,
18,
62,
13959,
82,
33116,
366,
50,
14375,
284,
779,
19570,
198,
38948,
50,
796,
9701,
13,
38948,
50,
628,
628,
198,
198,
34453,
690,
62,
11600,
796,
1391,
198,
220,
220,
220,
366,
68,
18173,
62,
3876,
4669,
1689,
1298,
412,
18173,
7676,
4669,
1689,
50,
14375,
11,
198,
220,
220,
220,
366,
11576,
62,
18,
62,
13959,
82,
1298,
13535,
18,
31305,
82,
50,
14375,
198,
92,
198
] | 2.684211 | 171 |
#
# PySNMP MIB module JUNIPER-SONET-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-SONET-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:50:16 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint")
ifIndex, ifDescr = mibBuilder.importSymbols("IF-MIB", "ifIndex", "ifDescr")
jnxMibs, jnxSonetNotifications = mibBuilder.importSymbols("JUNIPER-SMI", "jnxMibs", "jnxSonetNotifications")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibIdentifier, Gauge32, iso, ObjectIdentity, TimeTicks, ModuleIdentity, Integer32, Counter32, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Counter64, IpAddress, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "Gauge32", "iso", "ObjectIdentity", "TimeTicks", "ModuleIdentity", "Integer32", "Counter32", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Counter64", "IpAddress", "Bits")
DisplayString, DateAndTime, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "DateAndTime", "TextualConvention")
jnxSonet = ModuleIdentity((1, 3, 6, 1, 4, 1, 2636, 3, 20))
jnxSonet.setRevisions(('2002-12-12 00:00', '2002-08-08 00:00',))
if mibBuilder.loadTexts: jnxSonet.setLastUpdated('200307182154Z')
if mibBuilder.loadTexts: jnxSonet.setOrganization('Juniper Networks, Inc.')
jnxSonetAlarms = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 3, 20, 1))
jnxSonetAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 2636, 3, 20, 1, 1), )
if mibBuilder.loadTexts: jnxSonetAlarmTable.setStatus('current')
jnxSonetAlarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2636, 3, 20, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: jnxSonetAlarmEntry.setStatus('current')
jnxSonetCurrentAlarms = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 20, 1, 1, 1, 1), JnxSonetAlarmId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: jnxSonetCurrentAlarms.setStatus('current')
jnxSonetLastAlarmId = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 20, 1, 1, 1, 2), JnxSonetAlarmId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: jnxSonetLastAlarmId.setStatus('current')
jnxSonetLastAlarmTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 20, 1, 1, 1, 3), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: jnxSonetLastAlarmTime.setStatus('current')
jnxSonetLastAlarmDate = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 20, 1, 1, 1, 4), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: jnxSonetLastAlarmDate.setStatus('current')
jnxSonetLastAlarmEvent = MibTableColumn((1, 3, 6, 1, 4, 1, 2636, 3, 20, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("set", 2), ("cleared", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: jnxSonetLastAlarmEvent.setStatus('current')
jnxSonetNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 2636, 4, 6, 0))
jnxSonetAlarmSet = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 6, 0, 1)).setObjects(("IF-MIB", "ifDescr"), ("JUNIPER-SONET-MIB", "jnxSonetLastAlarmId"), ("JUNIPER-SONET-MIB", "jnxSonetCurrentAlarms"), ("JUNIPER-SONET-MIB", "jnxSonetLastAlarmDate"))
if mibBuilder.loadTexts: jnxSonetAlarmSet.setStatus('current')
jnxSonetAlarmCleared = NotificationType((1, 3, 6, 1, 4, 1, 2636, 4, 6, 0, 2)).setObjects(("IF-MIB", "ifDescr"), ("JUNIPER-SONET-MIB", "jnxSonetLastAlarmId"), ("JUNIPER-SONET-MIB", "jnxSonetCurrentAlarms"), ("JUNIPER-SONET-MIB", "jnxSonetLastAlarmDate"))
if mibBuilder.loadTexts: jnxSonetAlarmCleared.setStatus('current')
mibBuilder.exportSymbols("JUNIPER-SONET-MIB", jnxSonetAlarms=jnxSonetAlarms, jnxSonetCurrentAlarms=jnxSonetCurrentAlarms, jnxSonetLastAlarmTime=jnxSonetLastAlarmTime, jnxSonetAlarmTable=jnxSonetAlarmTable, JnxSonetAlarmId=JnxSonetAlarmId, jnxSonetLastAlarmEvent=jnxSonetLastAlarmEvent, jnxSonetAlarmSet=jnxSonetAlarmSet, PYSNMP_MODULE_ID=jnxSonet, jnxSonetNotificationPrefix=jnxSonetNotificationPrefix, jnxSonetAlarmCleared=jnxSonetAlarmCleared, jnxSonetAlarmEntry=jnxSonetAlarmEntry, jnxSonet=jnxSonet, jnxSonetLastAlarmId=jnxSonetLastAlarmId, jnxSonetLastAlarmDate=jnxSonetLastAlarmDate)
| [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
449,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
14,
67,
615,
47562,
19,
14,
13603,
14,
76,
571,
82,
13,
16184,
76,
489,
8937,
13,
785,
14,
292,
77,
16,
14,
41,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
198,
2,
21522,
771,
416,
279,
893,
11632,
12,
15,
13,
18,
13,
19,
379,
2892,
2758,
2808,
678,
25,
1120,
25,
1433,
13130,
198,
2,
1550,
2583,
42274,
54,
15567,
19,
12,
44,
12,
1415,
2425,
3859,
21450,
2196,
1248,
13,
20,
13,
15,
416,
2836,
288,
615,
47562,
19,
198,
2,
8554,
11361,
2196,
513,
13,
22,
13,
18,
357,
12286,
11,
1526,
2681,
13130,
11,
7769,
25,
1954,
25,
1314,
8,
220,
198,
2,
198,
12349,
316,
10100,
11,
9515,
33234,
7483,
11,
34142,
796,
285,
571,
32875,
13,
11748,
13940,
2022,
10220,
7203,
1921,
45,
16,
1600,
366,
12349,
316,
10100,
1600,
366,
10267,
33234,
7483,
1600,
366,
46541,
4943,
198,
45,
2434,
40161,
11,
796,
285,
571,
32875,
13,
11748,
13940,
2022,
10220,
7203,
1921,
45,
16,
12,
1677,
5883,
1137,
6234,
1600,
366,
45,
2434,
40161,
4943,
198,
11395,
17257,
3103,
2536,
2913,
11,
14206,
11395,
3103,
2536,
2913,
11,
1482,
2536,
6003,
38176,
11,
1482,
2536,
6003,
9492,
5458,
11,
11052,
10699,
3103,
2536,
2913,
796,
285,
571,
32875,
13,
11748,
13940,
2022,
10220,
7203,
1921,
45,
16,
12,
2200,
20032,
12529,
1600,
366,
11395,
17257,
3103,
2536,
2913,
1600,
366,
28008,
11395,
3103,
2536,
2913,
1600,
366,
3103,
2536,
6003,
38176,
1600,
366,
3103,
2536,
6003,
9492,
5458,
1600,
366,
11395,
10699,
3103,
2536,
2913,
4943,
198,
361,
15732,
11,
611,
24564,
81,
796,
285,
571,
32875,
13,
11748,
13940,
2022,
10220,
7203,
5064,
12,
8895,
33,
1600,
366,
361,
15732,
1600,
366,
361,
24564,
81,
4943,
198,
73,
77,
87,
44,
571,
82,
11,
474,
77,
87,
31056,
316,
3673,
6637,
796,
285,
571,
32875,
13,
11748,
13940,
2022,
10220,
7203,
41,
4944,
4061,
1137,
12,
50,
8895,
1600,
366,
73,
77,
87,
44,
571,
82,
1600,
366,
73,
77,
87,
31056,
316,
3673,
6637,
4943,
198,
3673,
2649,
13247,
11,
19937,
38143,
3610,
796,
285,
571,
32875,
13,
11748,
13940,
2022,
10220,
7203,
15571,
7378,
85,
17,
12,
10943,
37,
1600,
366,
3673,
2649,
13247,
1600,
366,
26796,
38143,
3610,
4943,
198,
44,
571,
33234,
7483,
11,
35094,
469,
2624,
11,
47279,
11,
9515,
7390,
26858,
11,
3862,
51,
3378,
11,
19937,
7390,
26858,
11,
34142,
2624,
11,
15034,
2624,
11,
791,
32696,
2624,
11,
337,
571,
3351,
282,
283,
11,
337,
571,
10962,
11,
337,
571,
10962,
25166,
11,
337,
571,
10962,
39470,
11,
42808,
6030,
11,
15034,
2414,
11,
314,
79,
20231,
11,
44733,
796,
285,
571,
32875,
13,
11748,
13940,
2022,
10220,
7203,
15571,
7378,
85,
17,
12,
50,
8895,
1600,
366,
44,
571,
33234,
7483,
1600,
366,
38,
559,
469,
2624,
1600,
366,
26786,
1600,
366,
10267,
7390,
26858,
1600,
366,
7575,
51,
3378,
1600,
366,
26796,
7390,
26858,
1600,
366,
46541,
2624,
1600,
366,
31694,
2624,
1600,
366,
3118,
32696,
2624,
1600,
366,
44,
571,
3351,
282,
283,
1600,
366,
44,
571,
10962,
1600,
366,
44,
571,
10962,
25166,
1600,
366,
44,
571,
10962,
39470,
1600,
366,
3673,
2649,
6030,
1600,
366,
31694,
2414,
1600,
366,
40,
79,
20231,
1600,
366,
33,
896,
4943,
198,
23114,
10100,
11,
7536,
1870,
7575,
11,
8255,
723,
3103,
4018,
796,
285,
571,
32875,
13,
11748,
13940,
2022,
10220,
7203,
15571,
7378,
85,
17,
12,
4825,
1600,
366,
23114,
10100,
1600,
366,
10430,
1870,
7575,
1600,
366,
8206,
723,
3103,
4018,
4943,
198,
73,
77,
87,
31056,
316,
796,
19937,
7390,
26858,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
4008,
198,
73,
77,
87,
31056,
316,
13,
2617,
18009,
3279,
7,
10786,
16942,
12,
1065,
12,
1065,
3571,
25,
405,
3256,
705,
16942,
12,
2919,
12,
2919,
3571,
25,
405,
3256,
4008,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
13,
2617,
5956,
17354,
10786,
2167,
22996,
24294,
21526,
57,
11537,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
13,
2617,
26121,
1634,
10786,
22396,
9346,
27862,
11,
3457,
2637,
8,
198,
198,
73,
77,
87,
31056,
316,
2348,
8357,
796,
337,
571,
33234,
7483,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
11,
352,
4008,
198,
73,
77,
87,
31056,
316,
2348,
1670,
10962,
796,
337,
571,
10962,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
11,
352,
11,
352,
828,
1267,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
2348,
1670,
10962,
13,
2617,
19580,
10786,
14421,
11537,
198,
73,
77,
87,
31056,
316,
2348,
1670,
30150,
796,
337,
571,
10962,
25166,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
11,
352,
11,
352,
11,
352,
828,
6739,
2617,
15732,
36690,
19510,
15,
11,
366,
5064,
12,
8895,
33,
1600,
366,
361,
15732,
48774,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
2348,
1670,
30150,
13,
2617,
19580,
10786,
14421,
11537,
198,
73,
77,
87,
31056,
316,
11297,
2348,
8357,
796,
337,
571,
10962,
39470,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
11,
352,
11,
352,
11,
352,
11,
352,
828,
449,
77,
87,
31056,
316,
2348,
1670,
7390,
3419,
737,
2617,
11518,
15457,
7203,
961,
8807,
4943,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
11297,
2348,
8357,
13,
2617,
19580,
10786,
14421,
11537,
198,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
7390,
796,
337,
571,
10962,
39470,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
11,
352,
11,
352,
11,
352,
11,
362,
828,
449,
77,
87,
31056,
316,
2348,
1670,
7390,
3419,
737,
2617,
11518,
15457,
7203,
961,
8807,
4943,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
5956,
2348,
1670,
7390,
13,
2617,
19580,
10786,
14421,
11537,
198,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
7575,
796,
337,
571,
10962,
39470,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
11,
352,
11,
352,
11,
352,
11,
513,
828,
3862,
51,
3378,
3419,
737,
2617,
11518,
15457,
7203,
961,
8807,
4943,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
5956,
2348,
1670,
7575,
13,
2617,
19580,
10786,
14421,
11537,
198,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
10430,
796,
337,
571,
10962,
39470,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
11,
352,
11,
352,
11,
352,
11,
604,
828,
7536,
1870,
7575,
3419,
737,
2617,
11518,
15457,
7203,
961,
8807,
4943,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
5956,
2348,
1670,
10430,
13,
2617,
19580,
10786,
14421,
11537,
198,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
9237,
796,
337,
571,
10962,
39470,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
513,
11,
1160,
11,
352,
11,
352,
11,
352,
11,
642,
828,
34142,
2624,
22446,
7266,
4906,
7,
7266,
4906,
22882,
28,
3103,
2536,
6003,
38176,
7,
28008,
11395,
3103,
2536,
2913,
7,
16,
11,
362,
11,
513,
4008,
737,
21018,
7,
13190,
40161,
28,
45,
2434,
40161,
7,
7203,
23108,
1600,
352,
828,
5855,
2617,
1600,
362,
828,
5855,
2375,
1144,
1600,
513,
22305,
737,
2617,
11518,
15457,
7203,
961,
8807,
4943,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
5956,
2348,
1670,
9237,
13,
2617,
19580,
10786,
14421,
11537,
198,
73,
77,
87,
31056,
316,
3673,
2649,
36698,
844,
796,
337,
571,
33234,
7483,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
604,
11,
718,
11,
657,
4008,
198,
73,
77,
87,
31056,
316,
2348,
1670,
7248,
796,
42808,
6030,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
604,
11,
718,
11,
657,
11,
352,
29720,
2617,
10267,
82,
7,
7203,
5064,
12,
8895,
33,
1600,
366,
361,
24564,
81,
12340,
5855,
41,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
1600,
366,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
7390,
12340,
5855,
41,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
1600,
366,
73,
77,
87,
31056,
316,
11297,
2348,
8357,
12340,
5855,
41,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
1600,
366,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
10430,
48774,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
2348,
1670,
7248,
13,
2617,
19580,
10786,
14421,
11537,
198,
73,
77,
87,
31056,
316,
2348,
1670,
34349,
1144,
796,
42808,
6030,
19510,
16,
11,
513,
11,
718,
11,
352,
11,
604,
11,
352,
11,
2608,
2623,
11,
604,
11,
718,
11,
657,
11,
362,
29720,
2617,
10267,
82,
7,
7203,
5064,
12,
8895,
33,
1600,
366,
361,
24564,
81,
12340,
5855,
41,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
1600,
366,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
7390,
12340,
5855,
41,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
1600,
366,
73,
77,
87,
31056,
316,
11297,
2348,
8357,
12340,
5855,
41,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
1600,
366,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
10430,
48774,
198,
361,
285,
571,
32875,
13,
2220,
8206,
82,
25,
474,
77,
87,
31056,
316,
2348,
1670,
34349,
1144,
13,
2617,
19580,
10786,
14421,
11537,
198,
76,
571,
32875,
13,
39344,
13940,
2022,
10220,
7203,
41,
4944,
4061,
1137,
12,
11782,
2767,
12,
8895,
33,
1600,
474,
77,
87,
31056,
316,
2348,
8357,
28,
73,
77,
87,
31056,
316,
2348,
8357,
11,
474,
77,
87,
31056,
316,
11297,
2348,
8357,
28,
73,
77,
87,
31056,
316,
11297,
2348,
8357,
11,
474,
77,
87,
31056,
316,
5956,
2348,
1670,
7575,
28,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
7575,
11,
474,
77,
87,
31056,
316,
2348,
1670,
10962,
28,
73,
77,
87,
31056,
316,
2348,
1670,
10962,
11,
449,
77,
87,
31056,
316,
2348,
1670,
7390,
28,
41,
77,
87,
31056,
316,
2348,
1670,
7390,
11,
474,
77,
87,
31056,
316,
5956,
2348,
1670,
9237,
28,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
9237,
11,
474,
77,
87,
31056,
316,
2348,
1670,
7248,
28,
73,
77,
87,
31056,
316,
2348,
1670,
7248,
11,
350,
56,
15571,
7378,
62,
33365,
24212,
62,
2389,
28,
73,
77,
87,
31056,
316,
11,
474,
77,
87,
31056,
316,
3673,
2649,
36698,
844,
28,
73,
77,
87,
31056,
316,
3673,
2649,
36698,
844,
11,
474,
77,
87,
31056,
316,
2348,
1670,
34349,
1144,
28,
73,
77,
87,
31056,
316,
2348,
1670,
34349,
1144,
11,
474,
77,
87,
31056,
316,
2348,
1670,
30150,
28,
73,
77,
87,
31056,
316,
2348,
1670,
30150,
11,
474,
77,
87,
31056,
316,
28,
73,
77,
87,
31056,
316,
11,
474,
77,
87,
31056,
316,
5956,
2348,
1670,
7390,
28,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
7390,
11,
474,
77,
87,
31056,
316,
5956,
2348,
1670,
10430,
28,
73,
77,
87,
31056,
316,
5956,
2348,
1670,
10430,
8,
198
] | 2.417255 | 1,982 |
from unit.applications.lang.python import TestApplicationPython
| [
6738,
4326,
13,
1324,
677,
602,
13,
17204,
13,
29412,
1330,
6208,
23416,
37906,
628
] | 4.333333 | 15 |
#!/usr/bin/env python
from batch_demographics import create_app
from config import DevConfig
app = create_app(DevConfig())
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
15458,
62,
9536,
24188,
1330,
2251,
62,
1324,
198,
6738,
4566,
1330,
6245,
16934,
198,
198,
1324,
796,
2251,
62,
1324,
7,
13603,
16934,
28955,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
598,
13,
5143,
7,
4774,
2625,
15,
13,
15,
13,
15,
13,
15,
1600,
2493,
28,
33942,
8
] | 2.753623 | 69 |
from django.contrib import admin
from .models import supeHero
# Register your models here.
admin.site.register(supeHero)
# Register your models here.
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
424,
431,
30411,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
2385,
431,
30411,
8,
198,
2,
17296,
534,
4981,
994,
13,
198
] | 3.511628 | 43 |
from easygui.boxes.choice_box import choicebox
from easygui.boxes.text_box import textbox
from phase1 import phase1
from phase2 import phase2
__author__ = 'po0ya'
choices = [
'Phase1',
'Phase2'
]
choice = choicebox(msg='Please select project phase:', choices=choices)
if choice == choices[0]:
phase1()
else:
phase2()
| [
6738,
2562,
48317,
13,
29305,
13,
25541,
62,
3524,
1330,
3572,
3524,
198,
6738,
2562,
48317,
13,
29305,
13,
5239,
62,
3524,
1330,
2420,
3524,
198,
6738,
7108,
16,
1330,
7108,
16,
198,
6738,
7108,
17,
1330,
7108,
17,
198,
198,
834,
9800,
834,
796,
705,
7501,
15,
3972,
6,
198,
198,
6679,
1063,
796,
685,
198,
220,
220,
220,
705,
35645,
16,
3256,
198,
220,
220,
220,
705,
35645,
17,
6,
198,
60,
198,
198,
25541,
796,
3572,
3524,
7,
19662,
11639,
5492,
2922,
1628,
7108,
25,
3256,
7747,
28,
6679,
1063,
8,
198,
198,
361,
3572,
6624,
7747,
58,
15,
5974,
198,
220,
220,
220,
7108,
16,
3419,
198,
17772,
25,
198,
220,
220,
220,
7108,
17,
3419,
198
] | 2.785124 | 121 |
# -*- coding: utf-8 -*-
# Copyright 2015 Donne Martin. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from __future__ import unicode_literals
from __future__ import print_function
import re
try:
from collections import OrderedDict
except:
from ordereddict import OrderedDict
class DataUtil(object):
"""Utility class to read from the data folder.
Attributes:
* None.
"""
def create_header_to_type_map(self, headers, data_type):
"""Creates a dict mapping headers to ResourceTypes.
Headers are the resource headers as they appear in the RESOURCES.txt.
Headers are mapped to their corresponding ResourceType.
Args:
* headers: A string that represents the header.
* data_type: An Enum specifying the data type.
Returns:
An OrderedDict mapping headers to ResourceTypes.
"""
command_types = []
for item in data_type:
if item != data_type.NUM_TYPES:
command_types.append(item)
return OrderedDict(zip(headers, command_types))
def get_data(self, data_file_path, header_to_type_map, data_type):
"""Gets all data from the specified data file.
Args:
* data_file_path: A string representing the full file path of
the data file.
* header_to_type_map: A dictionary mapping the data header labels
to the data types.
* data_type: An Enum specifying the data type.
Returns:
A list, where each element is a list of completions for each
data_type
"""
data_lists = [[] for x in range(data_type.NUM_TYPES.value)]
with open(data_file_path) as f:
for line in f:
line = re.sub('\n', '', line)
parsing_header = False
# Check if we are reading in a data header to determine
# which set of data we are parsing
for key, value in header_to_type_map.items():
if key in line:
data_type = value
parsing_header = True
break
if not parsing_header:
# Store the data in its associated list
if line.strip() != '':
data_lists[data_type.value].append(line)
for data_list in data_lists:
data_list.sort()
return data_lists
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
1853,
2094,
710,
5780,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
198,
2,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
317,
4866,
286,
198,
2,
262,
13789,
318,
5140,
379,
198,
2,
198,
2,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
393,
287,
262,
366,
43085,
1,
2393,
19249,
428,
2393,
13,
770,
2393,
318,
198,
2,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
198,
2,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
4091,
262,
13789,
329,
262,
2176,
198,
2,
3303,
15030,
21627,
290,
11247,
739,
262,
13789,
13,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
302,
198,
28311,
25,
198,
220,
220,
220,
422,
17268,
1330,
14230,
1068,
35,
713,
198,
16341,
25,
198,
220,
220,
220,
422,
6149,
11600,
1330,
14230,
1068,
35,
713,
628,
198,
4871,
6060,
18274,
346,
7,
15252,
2599,
198,
220,
220,
220,
37227,
18274,
879,
1398,
284,
1100,
422,
262,
1366,
9483,
13,
628,
220,
220,
220,
49213,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1635,
6045,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
2251,
62,
25677,
62,
1462,
62,
4906,
62,
8899,
7,
944,
11,
24697,
11,
1366,
62,
4906,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16719,
274,
257,
8633,
16855,
24697,
284,
20857,
31431,
13,
628,
220,
220,
220,
220,
220,
220,
220,
7123,
364,
389,
262,
8271,
24697,
355,
484,
1656,
287,
262,
15731,
2606,
7397,
1546,
13,
14116,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7123,
364,
389,
27661,
284,
511,
11188,
20857,
6030,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
24697,
25,
317,
4731,
326,
6870,
262,
13639,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
1366,
62,
4906,
25,
1052,
2039,
388,
31577,
262,
1366,
2099,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1052,
14230,
1068,
35,
713,
16855,
24697,
284,
20857,
31431,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3141,
62,
19199,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2378,
287,
1366,
62,
4906,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2378,
14512,
1366,
62,
4906,
13,
41359,
62,
9936,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3141,
62,
19199,
13,
33295,
7,
9186,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
14230,
1068,
35,
713,
7,
13344,
7,
50145,
11,
3141,
62,
19199,
4008,
628,
220,
220,
220,
825,
651,
62,
7890,
7,
944,
11,
1366,
62,
7753,
62,
6978,
11,
13639,
62,
1462,
62,
4906,
62,
8899,
11,
1366,
62,
4906,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
38,
1039,
477,
1366,
422,
262,
7368,
1366,
2393,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
1366,
62,
7753,
62,
6978,
25,
317,
4731,
10200,
262,
1336,
2393,
3108,
286,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
262,
1366,
2393,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
13639,
62,
1462,
62,
4906,
62,
8899,
25,
317,
22155,
16855,
262,
1366,
13639,
14722,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
284,
262,
1366,
3858,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
1366,
62,
4906,
25,
1052,
2039,
388,
31577,
262,
1366,
2099,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
1351,
11,
810,
1123,
5002,
318,
257,
1351,
286,
1224,
45240,
329,
1123,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
20713,
796,
16410,
60,
329,
2124,
287,
2837,
7,
7890,
62,
4906,
13,
41359,
62,
9936,
47,
1546,
13,
8367,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
7890,
62,
7753,
62,
6978,
8,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1627,
287,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1627,
796,
302,
13,
7266,
10786,
59,
77,
3256,
705,
3256,
1627,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32096,
62,
25677,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6822,
611,
356,
389,
3555,
287,
257,
1366,
13639,
284,
5004,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
543,
900,
286,
1366,
356,
389,
32096,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1988,
287,
13639,
62,
1462,
62,
4906,
62,
8899,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
287,
1627,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
4906,
796,
1988,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32096,
62,
25677,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
32096,
62,
25677,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
9363,
262,
1366,
287,
663,
3917,
1351,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1627,
13,
36311,
3419,
14512,
10148,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
20713,
58,
7890,
62,
4906,
13,
8367,
4083,
33295,
7,
1370,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1366,
62,
4868,
287,
1366,
62,
20713,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
4868,
13,
30619,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
62,
20713,
198
] | 2.345912 | 1,272 |
# Generated by Django 3.1.3 on 2021-06-23 02:36
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
18,
319,
33448,
12,
3312,
12,
1954,
7816,
25,
2623,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.818182 | 44 |
'''
33. Search in Rotated Sorted Array Medium
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
You are given a target value to search. If found in the array return its index, otherwise return -1.
You may assume no duplicate exists in the array.
Your algorithm's runtime complexity must be in the order of O(log n).
Example 1:
Input: nums = [4,5,6,7,0,1,2], target = 0
Output: 4
Example 2:
Input: nums = [4,5,6,7,0,1,2], target = 3
Output: -1
'''
| [
7061,
6,
198,
2091,
13,
11140,
287,
18481,
515,
311,
9741,
15690,
13398,
198,
198,
15979,
577,
281,
7177,
23243,
287,
41988,
1502,
318,
38375,
379,
617,
30355,
6439,
284,
345,
27091,
13,
198,
198,
7,
72,
13,
68,
1539,
685,
15,
11,
16,
11,
17,
11,
19,
11,
20,
11,
21,
11,
22,
60,
1244,
1716,
685,
19,
11,
20,
11,
21,
11,
22,
11,
15,
11,
16,
11,
17,
35944,
198,
198,
1639,
389,
1813,
257,
2496,
1988,
284,
2989,
13,
1002,
1043,
287,
262,
7177,
1441,
663,
6376,
11,
4306,
1441,
532,
16,
13,
198,
198,
1639,
743,
7048,
645,
23418,
7160,
287,
262,
7177,
13,
198,
198,
7120,
11862,
338,
19124,
13357,
1276,
307,
287,
262,
1502,
286,
440,
7,
6404,
299,
737,
198,
198,
16281,
352,
25,
198,
198,
20560,
25,
997,
82,
796,
685,
19,
11,
20,
11,
21,
11,
22,
11,
15,
11,
16,
11,
17,
4357,
2496,
796,
657,
198,
26410,
25,
604,
198,
16281,
362,
25,
198,
198,
20560,
25,
997,
82,
796,
685,
19,
11,
20,
11,
21,
11,
22,
11,
15,
11,
16,
11,
17,
4357,
2496,
796,
513,
198,
26410,
25,
532,
16,
198,
7061,
6,
198
] | 2.78392 | 199 |
"""
glashammer.bundles.contrib.auth.openidauth
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Open ID Support for Glashammer
:copyright: 2010 Glashammer Developers
:license: MIT
"""
from openid.consumer.consumer import Consumer, SUCCESS, CANCEL
from werkzeug import redirect
from glashammer.utils import sibpath, url_for, Response
from glashammer.bundles.sessions import setup_sessions, get_session
from glashammer.bundles.auth import setup_auth, login
| [
37811,
198,
4743,
1077,
321,
647,
13,
65,
917,
829,
13,
3642,
822,
13,
18439,
13,
9654,
3755,
1071,
198,
27156,
27156,
15116,
4907,
198,
198,
11505,
4522,
7929,
329,
2671,
1077,
321,
647,
198,
198,
25,
22163,
4766,
25,
3050,
2671,
1077,
321,
647,
34152,
198,
25,
43085,
25,
17168,
198,
37811,
198,
198,
6738,
1280,
312,
13,
49827,
13,
49827,
1330,
18110,
11,
13558,
4093,
7597,
11,
15628,
34,
3698,
198,
198,
6738,
266,
9587,
2736,
1018,
1330,
18941,
198,
198,
6738,
1278,
1077,
321,
647,
13,
26791,
1330,
264,
571,
6978,
11,
19016,
62,
1640,
11,
18261,
198,
198,
6738,
1278,
1077,
321,
647,
13,
65,
917,
829,
13,
82,
6202,
1330,
9058,
62,
82,
6202,
11,
651,
62,
29891,
198,
6738,
1278,
1077,
321,
647,
13,
65,
917,
829,
13,
18439,
1330,
9058,
62,
18439,
11,
17594,
628,
198
] | 3.195804 | 143 |
import pandas as pd
import numpy as np
import os
import pickle as pkl
import json
from tqdm import tqdm
single_task = ['5849', '25000', '41401', '4019']
for task in single_task:
path = 'data/preprocessed_data/baseline/' + task
if not os.path.exists(path):
os.makedirs(path)
train_data, dim = preprocess_data('data/raw_data/' + task + '/train', task)
save(train_data, 'data/preprocessed_data/baseline/' + task, 'train')
test_data, dim = preprocess_data('data/raw_data/' + task + '/test', task)
save(test_data, 'data/preprocessed_data/baseline/' + task, 'test')
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
2298,
293,
355,
279,
41582,
198,
11748,
33918,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
628,
628,
198,
198,
29762,
62,
35943,
796,
37250,
3365,
2920,
3256,
705,
1495,
830,
3256,
705,
37309,
486,
3256,
705,
21844,
24,
20520,
198,
1640,
4876,
287,
2060,
62,
35943,
25,
198,
220,
220,
220,
3108,
796,
705,
7890,
14,
3866,
14681,
276,
62,
7890,
14,
12093,
4470,
14,
6,
1343,
4876,
198,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
6978,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
76,
4335,
17062,
7,
6978,
8,
198,
220,
220,
220,
4512,
62,
7890,
11,
5391,
796,
662,
14681,
62,
7890,
10786,
7890,
14,
1831,
62,
7890,
14,
6,
1343,
4876,
1343,
31051,
27432,
3256,
4876,
8,
198,
220,
220,
220,
3613,
7,
27432,
62,
7890,
11,
705,
7890,
14,
3866,
14681,
276,
62,
7890,
14,
12093,
4470,
14,
6,
1343,
4876,
11,
705,
27432,
11537,
198,
220,
220,
220,
1332,
62,
7890,
11,
5391,
796,
662,
14681,
62,
7890,
10786,
7890,
14,
1831,
62,
7890,
14,
6,
1343,
4876,
1343,
31051,
9288,
3256,
4876,
8,
198,
220,
220,
220,
3613,
7,
9288,
62,
7890,
11,
705,
7890,
14,
3866,
14681,
276,
62,
7890,
14,
12093,
4470,
14,
6,
1343,
4876,
11,
705,
9288,
11537,
198
] | 2.518987 | 237 |
import webapp2
from webapp2_extras import jinja2
class BaseHandler(webapp2.RequestHandler):
"""Provide a cached Jinja environment to each request."""
@webapp2.cached_property
app = webapp2.WSGIApplication([("/_ah/warmup", MainPage),
('/', MainPage),
])
| [
11748,
3992,
1324,
17,
198,
6738,
3992,
1324,
17,
62,
2302,
8847,
1330,
474,
259,
6592,
17,
628,
198,
4871,
7308,
25060,
7,
12384,
1324,
17,
13,
18453,
25060,
2599,
198,
220,
37227,
15946,
485,
257,
39986,
17297,
6592,
2858,
284,
1123,
2581,
526,
15931,
198,
220,
2488,
12384,
1324,
17,
13,
66,
2317,
62,
26745,
628,
198,
198,
1324,
796,
3992,
1324,
17,
13,
19416,
38,
3539,
381,
10142,
26933,
7203,
47835,
993,
14,
31975,
929,
1600,
8774,
9876,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19203,
14,
3256,
8774,
9876,
828,
198,
12962,
198
] | 2.421488 | 121 |
import unittest
from src.choice import Choice
from src.choice.exceptions import InvalidChoiceException
class UserChoiceTests(unittest.TestCase):
"""Tests for the user choice class"""
def test_valid_choice(self):
"""Test valid user input"""
choice = Choice('r')
self.assertTrue(choice.is_valid())
self.assertEqual(choice.get_choice(), 0)
def test_invalid_choice(self):
"""Test invalid user input"""
choice = Choice('h')
self.assertFalse(choice.is_valid())
with self.assertRaises(InvalidChoiceException):
choice.get_choice()
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
12351,
13,
25541,
1330,
18502,
198,
6738,
12351,
13,
25541,
13,
1069,
11755,
1330,
17665,
46770,
16922,
628,
198,
4871,
11787,
46770,
51,
3558,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
51,
3558,
329,
262,
2836,
3572,
1398,
37811,
628,
220,
220,
220,
825,
1332,
62,
12102,
62,
25541,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
14402,
4938,
2836,
5128,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
3572,
796,
18502,
10786,
81,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
17821,
7,
25541,
13,
271,
62,
12102,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
25541,
13,
1136,
62,
25541,
22784,
657,
8,
628,
220,
220,
220,
825,
1332,
62,
259,
12102,
62,
25541,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
14402,
12515,
2836,
5128,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
3572,
796,
18502,
10786,
71,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
25101,
7,
25541,
13,
271,
62,
12102,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
44651,
46770,
16922,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3572,
13,
1136,
62,
25541,
3419,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.607843 | 255 |
#!/usr/bin/env python3
import unittest
import os
import networkit as nk
if __name__ == "__main__":
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
3127,
270,
355,
299,
74,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
403,
715,
395,
13,
12417,
3419,
198
] | 2.622222 | 45 |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 28 15:03:12 2020
@author: Ayantika
"""
# Importing necessary libraries
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
import pickle
# Reading the data
Wine = pd.read_csv("Wine.csv")
print(Wine.head())
#iris.drop("Id", axis=1, inplace = True)
y = Wine['Customer_Segment']
Wine.drop(columns='Customer_Segment',inplace=True)
X = Wine[['Alcohol', 'Malic_Acid', 'Ash', 'Ash_Alcanity', 'Magnesium', 'Total_Phenols', 'Flavanoids',
'Nonflavanoid_Phenols', 'Proanthocyanins', 'Color_Intensity', 'Hue', 'OD280', 'Proline']]
# Training the model
x_train,x_test,y_train,y_test = train_test_split(X,y, test_size=0.3)
model = LogisticRegression()
model.fit(x_train,y_train)
pickle.dump(model,open('model.pkl','wb'))
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
19480,
3158,
2579,
1315,
25,
3070,
25,
1065,
12131,
201,
198,
201,
198,
31,
9800,
25,
13709,
415,
9232,
201,
198,
37811,
201,
198,
201,
198,
2,
17267,
278,
3306,
12782,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
19798,
292,
355,
279,
67,
220,
201,
198,
6738,
19798,
292,
1330,
7171,
11,
6060,
19778,
201,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
220,
201,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
5972,
2569,
8081,
2234,
201,
198,
11748,
2298,
293,
201,
198,
201,
198,
2,
11725,
262,
1366,
201,
198,
54,
500,
796,
279,
67,
13,
961,
62,
40664,
7203,
54,
500,
13,
40664,
4943,
201,
198,
4798,
7,
54,
500,
13,
2256,
28955,
201,
198,
2,
29616,
13,
14781,
7203,
7390,
1600,
16488,
28,
16,
11,
287,
5372,
796,
6407,
8,
201,
198,
88,
796,
20447,
17816,
44939,
62,
41030,
434,
20520,
201,
198,
54,
500,
13,
14781,
7,
28665,
82,
11639,
44939,
62,
41030,
434,
3256,
259,
5372,
28,
17821,
8,
201,
198,
55,
796,
20447,
58,
17816,
2348,
4857,
3256,
705,
15029,
291,
62,
12832,
312,
3256,
705,
26754,
3256,
705,
26754,
62,
2348,
5171,
414,
3256,
705,
13436,
27619,
3256,
705,
14957,
62,
47,
831,
10220,
3256,
705,
7414,
12421,
10994,
3256,
220,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
15419,
2704,
12421,
1868,
62,
47,
831,
10220,
3256,
705,
2964,
29313,
420,
4121,
1040,
3256,
705,
10258,
62,
5317,
6377,
3256,
705,
39,
518,
3256,
705,
3727,
21033,
3256,
705,
2964,
1370,
6,
11907,
201,
198,
201,
198,
2,
13614,
262,
2746,
201,
198,
87,
62,
27432,
11,
87,
62,
9288,
11,
88,
62,
27432,
11,
88,
62,
9288,
796,
4512,
62,
9288,
62,
35312,
7,
55,
11,
88,
11,
1332,
62,
7857,
28,
15,
13,
18,
8,
201,
198,
19849,
796,
5972,
2569,
8081,
2234,
3419,
201,
198,
19849,
13,
11147,
7,
87,
62,
27432,
11,
88,
62,
27432,
8,
201,
198,
201,
198,
27729,
293,
13,
39455,
7,
19849,
11,
9654,
10786,
19849,
13,
79,
41582,
41707,
39346,
6,
4008,
201,
198
] | 2.476064 | 376 |
from app import app
from models import db, connect_db, User, Issue, Comment, Priority, Status, Category, Role
# Drop db tables and create them anew
db.drop_all()
db.create_all()
# Priority
p1 = Priority(
priority_id=0,
priority_label="Low"
)
p2 = Priority(
priority_id=1,
priority_label="Medium"
)
p3 = Priority(
priority_id=2,
priority_label="High"
)
p4 = Priority(
priority_id=3,
priority_label="Urgent"
)
# Status
s1 = Status(
status_id=0,
status_label="Submitted"
)
s2 = Status(
status_id=1,
status_label="Assigned"
)
s3 = Status(
status_id=2,
status_label="Resolved"
)
# Category
c1 = Category(
category_id=0,
category_label="Technical Issue"
)
c2 = Category(
category_id=1,
category_label="Customer Complaint"
)
c3 = Category(
category_id=2,
category_label="Product Request"
)
ro1 = Role(
role_id=0,
role_label="user"
)
ro2 = Role(
role_id=1,
role_label="assignee"
)
ro3 = Role(
role_id=2,
role_label="admin"
)
db.session.add_all([p1,p2,p3,p4,s1,s2,s3,c1,c2,c3,ro1,ro2,ro3])
db.session.commit()
# Sample users.
# u1 = User.register(
# email="[email protected]",
# first_name="Admin",
# last_name="User",
# password="password1"
# )
# u2 = User.register(
# email="[email protected]",
# first_name="Regular",
# last_name="User",
# password="password2"
# )
# u3 = User.register(
# email="[email protected]",
# first_name="Assignee",
# last_name="User",
# password="password3"
# )
# u1.role = 2
# u3.role = 1
# db.session.commit()
# # Sample issues
# i1 = Issue(
# title="Printer on fire!",
# text="Huge flames are shooting out of paper tray 1!!! Please bring fire extinguisher ASAP!!!",
# reporter=2
# )
# i2 = Issue(
# title="Computer not responding",
# text="My PC is showing the loading spinner and will not respond to keyboard or mouse input. It has been doing this for 6 weeks.",
# reporter=2
# )
# i3 = Issue(
# title="Please bring in nacho flavored Beanfields chips",
# text="We're not saying you're going to get addicted to our slamming NACHO, but we're also not going to say you won't. Nacho-lly we're biased since it is our best seller. NACHO just has unmatched taste that makes being cheesy, well, cool and vegan. The kinda vegan you want at your barbecue so you can say, 'yeah NACHO came with me. We're good like that.' Nacho average tortilla chip.",
# category=2,
# reporter=3
# )
# i4 = Issue(
# title="Clerk was rude and dismissive",
# text="She told me to wear a mask, and I don't wanna!",
# category=1,
# reporter=3
# )
# db.session.add_all([i1,i2,i3,i4])
# db.session.commit()
| [
6738,
598,
1330,
598,
198,
6738,
4981,
1330,
20613,
11,
2018,
62,
9945,
11,
11787,
11,
18232,
11,
18957,
11,
34416,
11,
12678,
11,
21743,
11,
20934,
198,
198,
2,
14258,
20613,
8893,
290,
2251,
606,
44951,
198,
9945,
13,
14781,
62,
439,
3419,
198,
9945,
13,
17953,
62,
439,
3419,
198,
198,
2,
34416,
198,
198,
79,
16,
796,
34416,
7,
198,
220,
220,
220,
8475,
62,
312,
28,
15,
11,
198,
220,
220,
220,
8475,
62,
18242,
2625,
20535,
1,
198,
8,
198,
198,
79,
17,
796,
34416,
7,
198,
220,
220,
220,
8475,
62,
312,
28,
16,
11,
198,
220,
220,
220,
8475,
62,
18242,
2625,
31205,
1,
198,
8,
198,
198,
79,
18,
796,
34416,
7,
198,
220,
220,
220,
8475,
62,
312,
28,
17,
11,
198,
220,
220,
220,
8475,
62,
18242,
2625,
11922,
1,
198,
8,
198,
198,
79,
19,
796,
34416,
7,
198,
220,
220,
220,
8475,
62,
312,
28,
18,
11,
198,
220,
220,
220,
8475,
62,
18242,
2625,
16692,
6783,
1,
198,
8,
198,
198,
2,
12678,
198,
198,
82,
16,
796,
12678,
7,
198,
220,
220,
220,
3722,
62,
312,
28,
15,
11,
198,
220,
220,
220,
3722,
62,
18242,
2625,
7004,
3291,
1,
198,
8,
198,
198,
82,
17,
796,
12678,
7,
198,
220,
220,
220,
3722,
62,
312,
28,
16,
11,
198,
220,
220,
220,
3722,
62,
18242,
2625,
8021,
3916,
1,
198,
8,
198,
198,
82,
18,
796,
12678,
7,
198,
220,
220,
220,
3722,
62,
312,
28,
17,
11,
198,
220,
220,
220,
3722,
62,
18242,
2625,
4965,
5634,
1,
198,
8,
198,
198,
2,
21743,
198,
198,
66,
16,
796,
21743,
7,
198,
220,
220,
220,
6536,
62,
312,
28,
15,
11,
198,
220,
220,
220,
6536,
62,
18242,
2625,
45638,
18232,
1,
198,
8,
198,
198,
66,
17,
796,
21743,
7,
198,
220,
220,
220,
6536,
62,
312,
28,
16,
11,
198,
220,
220,
220,
6536,
62,
18242,
2625,
44939,
20011,
2913,
1,
198,
8,
198,
198,
66,
18,
796,
21743,
7,
198,
220,
220,
220,
6536,
62,
312,
28,
17,
11,
198,
220,
220,
220,
6536,
62,
18242,
2625,
15667,
19390,
1,
198,
8,
198,
198,
305,
16,
796,
20934,
7,
198,
220,
220,
220,
2597,
62,
312,
28,
15,
11,
198,
220,
220,
220,
2597,
62,
18242,
2625,
7220,
1,
198,
8,
198,
198,
305,
17,
796,
20934,
7,
198,
220,
220,
220,
2597,
62,
312,
28,
16,
11,
198,
220,
220,
220,
2597,
62,
18242,
2625,
562,
570,
1453,
1,
198,
8,
198,
198,
305,
18,
796,
20934,
7,
198,
220,
220,
220,
2597,
62,
312,
28,
17,
11,
198,
220,
220,
220,
2597,
62,
18242,
2625,
28482,
1,
198,
8,
628,
198,
9945,
13,
29891,
13,
2860,
62,
439,
26933,
79,
16,
11,
79,
17,
11,
79,
18,
11,
79,
19,
11,
82,
16,
11,
82,
17,
11,
82,
18,
11,
66,
16,
11,
66,
17,
11,
66,
18,
11,
305,
16,
11,
305,
17,
11,
305,
18,
12962,
198,
9945,
13,
29891,
13,
41509,
3419,
198,
198,
2,
27565,
2985,
13,
198,
198,
2,
334,
16,
796,
11787,
13,
30238,
7,
198,
2,
220,
220,
220,
220,
3053,
2625,
7220,
16,
31,
20688,
13,
785,
1600,
198,
2,
220,
220,
220,
220,
717,
62,
3672,
2625,
46787,
1600,
198,
2,
220,
220,
220,
220,
938,
62,
3672,
2625,
12982,
1600,
198,
2,
220,
220,
220,
220,
9206,
2625,
28712,
16,
1,
198,
2,
1267,
198,
198,
2,
334,
17,
796,
11787,
13,
30238,
7,
198,
2,
220,
220,
220,
220,
3053,
2625,
7220,
17,
31,
20688,
13,
785,
1600,
198,
2,
220,
220,
220,
220,
717,
62,
3672,
2625,
40164,
1600,
198,
2,
220,
220,
220,
220,
938,
62,
3672,
2625,
12982,
1600,
198,
2,
220,
220,
220,
220,
9206,
2625,
28712,
17,
1,
198,
2,
1267,
198,
198,
2,
334,
18,
796,
11787,
13,
30238,
7,
198,
2,
220,
220,
220,
220,
3053,
2625,
7220,
18,
31,
20688,
13,
785,
1600,
198,
2,
220,
220,
220,
220,
717,
62,
3672,
2625,
8021,
570,
1453,
1600,
198,
2,
220,
220,
220,
220,
938,
62,
3672,
2625,
12982,
1600,
198,
2,
220,
220,
220,
220,
9206,
2625,
28712,
18,
1,
198,
2,
1267,
198,
198,
2,
334,
16,
13,
18090,
796,
362,
198,
2,
334,
18,
13,
18090,
796,
352,
198,
198,
2,
20613,
13,
29891,
13,
41509,
3419,
198,
198,
2,
1303,
27565,
2428,
198,
198,
2,
1312,
16,
796,
18232,
7,
198,
2,
220,
220,
220,
220,
3670,
2625,
6836,
3849,
319,
2046,
40754,
198,
2,
220,
220,
220,
220,
2420,
2625,
39,
2217,
16209,
389,
4395,
503,
286,
3348,
26473,
352,
10185,
4222,
2222,
2046,
24995,
4828,
46199,
10185,
1600,
198,
2,
220,
220,
220,
220,
9095,
28,
17,
198,
2,
1267,
198,
198,
2,
1312,
17,
796,
18232,
7,
198,
2,
220,
220,
220,
220,
3670,
2625,
34556,
407,
14409,
1600,
198,
2,
220,
220,
220,
220,
2420,
2625,
3666,
4217,
318,
4478,
262,
11046,
599,
5083,
290,
481,
407,
3031,
284,
10586,
393,
10211,
5128,
13,
220,
632,
468,
587,
1804,
428,
329,
718,
2745,
33283,
198,
2,
220,
220,
220,
220,
9095,
28,
17,
198,
2,
1267,
198,
198,
2,
1312,
18,
796,
18232,
7,
198,
2,
220,
220,
220,
220,
3670,
2625,
5492,
2222,
287,
299,
43703,
45613,
26510,
25747,
12014,
1600,
198,
2,
220,
220,
220,
220,
2420,
2625,
1135,
821,
407,
2282,
345,
821,
1016,
284,
651,
28357,
284,
674,
39603,
399,
16219,
46,
11,
475,
356,
821,
635,
407,
1016,
284,
910,
345,
1839,
470,
13,
399,
43703,
12,
12810,
356,
821,
21925,
1201,
340,
318,
674,
1266,
18583,
13,
399,
16219,
46,
655,
468,
48621,
6938,
326,
1838,
852,
45002,
11,
880,
11,
3608,
290,
15169,
13,
383,
17855,
15169,
345,
765,
379,
534,
36646,
523,
345,
460,
910,
11,
705,
43669,
399,
16219,
46,
1625,
351,
502,
13,
775,
821,
922,
588,
326,
2637,
399,
43703,
2811,
7619,
5049,
11594,
33283,
198,
2,
220,
220,
220,
220,
6536,
28,
17,
11,
198,
2,
220,
220,
220,
220,
9095,
28,
18,
198,
2,
1267,
198,
198,
2,
1312,
19,
796,
18232,
7,
198,
2,
220,
220,
220,
220,
3670,
2625,
34,
1754,
74,
373,
22066,
290,
49010,
1600,
198,
2,
220,
220,
220,
220,
2420,
2625,
3347,
1297,
502,
284,
5806,
257,
9335,
11,
290,
314,
836,
470,
18869,
40754,
198,
2,
220,
220,
220,
220,
6536,
28,
16,
11,
198,
2,
220,
220,
220,
220,
9095,
28,
18,
198,
2,
1267,
198,
198,
2,
20613,
13,
29891,
13,
2860,
62,
439,
26933,
72,
16,
11,
72,
17,
11,
72,
18,
11,
72,
19,
12962,
198,
2,
20613,
13,
29891,
13,
41509,
3419,
198
] | 2.454709 | 1,115 |
from main import app
app.run(host='127.0.0.1', port=8090, debug=True)
| [
6738,
1388,
1330,
598,
198,
1324,
13,
5143,
7,
4774,
11639,
16799,
13,
15,
13,
15,
13,
16,
3256,
2493,
28,
1795,
3829,
11,
14257,
28,
17821,
8,
198
] | 2.413793 | 29 |
"""
:py:mod:`pymco.ssl`
-------------------
Contains SSL security provider plugin.
"""
from __future__ import print_function
import base64
import os
try:
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA
except ImportError as exc:
print('You need install pycrypto for using SSL security provider')
raise exc
from .. import exc
from . import SecurityProvider
from .. import utils
class SSLProvider(SecurityProvider):
"""Provide SSL security provider plugin.
See
http://docs.puppetlabs.com/mcollective/reference/plugins/security_ssl.html
for further information.
"""
def sign(self, msg):
"""Implement :py:meth:`pymco.security.SecurityProvider.sign`."""
msg[':callerid'] = self.callerid
msg[':hash'] = self.get_hash(msg)
return msg
def verify(self, msg):
"""Implement :py:meth:`pymco.security.SecurityProvider.verify`."""
hash_ = SHA.new(msg[':body'].encode('utf8'))
verifier = PKCS1_v1_5.new(self.server_public_key)
signature = base64.b64decode(msg[':hash'])
if not verifier.verify(hash_, signature):
raise exc.VerificationError(
'Message {0} can\'t be verified'.format(msg))
return msg
def get_hash(self, msg):
"""Get the hash for the given message.
:arg pymco.message.Message msg: message to get hash for.
:return: message hash so the receiver can verify the message.
"""
hashed_signature = SHA.new(msg[':body'].encode('utf8'))
signer = PKCS1_v1_5.new(self.private_key)
hashed_signature = signer.sign(hashed_signature)
return base64.b64encode(hashed_signature)
@property
def callerid(self):
"""Property returning the MCollective SSL caller id.
As MCollective docs states, the caller ID will be the name of public
key filename, without the extension part.
"""
if not self._caller_id:
caller_id = os.path.basename(
self.config['plugin.ssl_client_public']).split('.')[0]
self._caller_id = 'cert={0}'.format(caller_id)
return self._caller_id
@property
def server_public_key(self):
"""Property returning the server public key after being loaded."""
return self._load_rsa_key(key='plugin.ssl_server_public',
cache=self._server_public_key)
@property
def private_key(self):
"""Property returning the private key after being loaded."""
return self._load_rsa_key(key='plugin.ssl_client_private',
cache=self._private_key)
@property
def serializer(self):
"""Property returning the serializer object.
Serailzer object should be any subclass
:py:class:`pymco.serializer.Serializer`, depending on configuration.
However, right now, only YAML serialization can be supported,
since the default serializer (Marshal) isn't portable.
"""
if not self._serializer:
self._serializer = self.config.get_serializer('plugin.ssl_serializer')
return self._serializer
| [
37811,
198,
25,
9078,
25,
4666,
25,
63,
79,
4948,
1073,
13,
45163,
63,
198,
1783,
6329,
198,
4264,
1299,
25952,
2324,
10131,
13877,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
2779,
2414,
198,
11748,
28686,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
36579,
13,
11712,
1300,
1330,
29673,
7902,
16,
62,
85,
16,
62,
20,
198,
220,
220,
220,
422,
36579,
13,
26257,
1330,
25630,
198,
16341,
17267,
12331,
355,
2859,
25,
198,
220,
220,
220,
3601,
10786,
1639,
761,
2721,
12972,
29609,
78,
329,
1262,
25952,
2324,
10131,
11537,
198,
220,
220,
220,
5298,
2859,
198,
198,
6738,
11485,
1330,
2859,
198,
6738,
764,
1330,
4765,
29495,
198,
6738,
11485,
1330,
3384,
4487,
628,
198,
4871,
25952,
29495,
7,
24074,
29495,
2599,
198,
220,
220,
220,
37227,
15946,
485,
25952,
2324,
10131,
13877,
13,
628,
220,
220,
220,
4091,
198,
220,
220,
220,
2638,
1378,
31628,
13,
79,
44933,
75,
8937,
13,
785,
14,
76,
33327,
425,
14,
35790,
14,
37390,
14,
12961,
62,
45163,
13,
6494,
198,
220,
220,
220,
329,
2252,
1321,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1051,
7,
944,
11,
31456,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3546,
26908,
1058,
9078,
25,
76,
2788,
25,
63,
79,
4948,
1073,
13,
12961,
13,
24074,
29495,
13,
12683,
63,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
58,
10354,
13345,
263,
312,
20520,
796,
2116,
13,
13345,
263,
312,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
58,
10354,
17831,
20520,
796,
2116,
13,
1136,
62,
17831,
7,
19662,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
31456,
628,
220,
220,
220,
825,
11767,
7,
944,
11,
31456,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3546,
26908,
1058,
9078,
25,
76,
2788,
25,
63,
79,
4948,
1073,
13,
12961,
13,
24074,
29495,
13,
332,
1958,
63,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
12234,
62,
796,
25630,
13,
3605,
7,
19662,
58,
10354,
2618,
6,
4083,
268,
8189,
10786,
40477,
23,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3326,
7483,
796,
29673,
7902,
16,
62,
85,
16,
62,
20,
13,
3605,
7,
944,
13,
15388,
62,
11377,
62,
2539,
8,
198,
220,
220,
220,
220,
220,
220,
220,
9877,
796,
2779,
2414,
13,
65,
2414,
12501,
1098,
7,
19662,
58,
10354,
17831,
6,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
611,
407,
3326,
7483,
13,
332,
1958,
7,
17831,
62,
11,
9877,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
2859,
13,
13414,
2649,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
12837,
1391,
15,
92,
460,
43054,
83,
307,
19000,
4458,
18982,
7,
19662,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
31456,
628,
220,
220,
220,
825,
651,
62,
17831,
7,
944,
11,
31456,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
262,
12234,
329,
262,
1813,
3275,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
853,
279,
4948,
1073,
13,
20500,
13,
12837,
31456,
25,
3275,
284,
651,
12234,
329,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
3275,
12234,
523,
262,
9733,
460,
11767,
262,
3275,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
468,
704,
62,
12683,
1300,
796,
25630,
13,
3605,
7,
19662,
58,
10354,
2618,
6,
4083,
268,
8189,
10786,
40477,
23,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1051,
263,
796,
29673,
7902,
16,
62,
85,
16,
62,
20,
13,
3605,
7,
944,
13,
19734,
62,
2539,
8,
198,
220,
220,
220,
220,
220,
220,
220,
468,
704,
62,
12683,
1300,
796,
1051,
263,
13,
12683,
7,
71,
5263,
62,
12683,
1300,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2779,
2414,
13,
65,
2414,
268,
8189,
7,
71,
5263,
62,
12683,
1300,
8,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
24955,
312,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
21746,
8024,
262,
337,
31337,
425,
25952,
24955,
4686,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1081,
337,
31337,
425,
34165,
2585,
11,
262,
24955,
4522,
481,
307,
262,
1438,
286,
1171,
198,
220,
220,
220,
220,
220,
220,
220,
1994,
29472,
11,
1231,
262,
7552,
636,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13557,
13345,
263,
62,
312,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24955,
62,
312,
796,
28686,
13,
6978,
13,
12093,
12453,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
11250,
17816,
33803,
13,
45163,
62,
16366,
62,
11377,
20520,
737,
35312,
10786,
2637,
38381,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
13345,
263,
62,
312,
796,
705,
22583,
34758,
15,
92,
4458,
18982,
7,
13345,
263,
62,
312,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
13345,
263,
62,
312,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
4382,
62,
11377,
62,
2539,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
21746,
8024,
262,
4382,
1171,
1994,
706,
852,
9639,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
2220,
62,
3808,
64,
62,
2539,
7,
2539,
11639,
33803,
13,
45163,
62,
15388,
62,
11377,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12940,
28,
944,
13557,
15388,
62,
11377,
62,
2539,
8,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
2839,
62,
2539,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
21746,
8024,
262,
2839,
1994,
706,
852,
9639,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
2220,
62,
3808,
64,
62,
2539,
7,
2539,
11639,
33803,
13,
45163,
62,
16366,
62,
19734,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12940,
28,
944,
13557,
19734,
62,
2539,
8,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
11389,
7509,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
21746,
8024,
262,
11389,
7509,
2134,
13,
628,
220,
220,
220,
220,
220,
220,
220,
2930,
603,
9107,
2134,
815,
307,
597,
47611,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
9078,
25,
4871,
25,
63,
79,
4948,
1073,
13,
46911,
7509,
13,
32634,
7509,
47671,
6906,
319,
8398,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2102,
11,
826,
783,
11,
691,
575,
2390,
43,
11389,
1634,
460,
307,
4855,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1201,
262,
4277,
11389,
7509,
357,
41984,
282,
8,
2125,
470,
17726,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13557,
46911,
7509,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
46911,
7509,
796,
2116,
13,
11250,
13,
1136,
62,
46911,
7509,
10786,
33803,
13,
45163,
62,
46911,
7509,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
46911,
7509,
198
] | 2.458398 | 1,298 |
import inspect
import pkgutil
from importlib import import_module
from pathlib import Path
from client.connection import Connection
from client.exceptions import ArkParameterException
from client.resource import Resource
| [
11748,
10104,
198,
11748,
279,
10025,
22602,
198,
6738,
1330,
8019,
1330,
1330,
62,
21412,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
5456,
13,
38659,
1330,
26923,
198,
6738,
5456,
13,
1069,
11755,
1330,
9128,
36301,
16922,
198,
6738,
5456,
13,
31092,
1330,
20857,
198
] | 4.723404 | 47 |
import avalon.api
from reveries.maya import lib, capsule
from reveries.maya.plugins import ReferenceLoader
class CameraLoader(ReferenceLoader, avalon.api.Loader):
"""Specific loader for the reveries.camera family"""
label = "Reference camera"
order = -10
icon = "code-fork"
color = "orange"
hosts = ["maya"]
families = ["reveries.camera"]
representations = [
"mayaAscii",
"Alembic",
"FBX",
]
| [
198,
11748,
37441,
261,
13,
15042,
198,
6738,
33033,
444,
13,
11261,
64,
1330,
9195,
11,
27855,
198,
6738,
33033,
444,
13,
11261,
64,
13,
37390,
1330,
20984,
17401,
628,
198,
4871,
20432,
17401,
7,
26687,
17401,
11,
37441,
261,
13,
15042,
13,
17401,
2599,
198,
220,
220,
220,
37227,
32419,
40213,
329,
262,
33033,
444,
13,
25695,
1641,
37811,
628,
220,
220,
220,
6167,
796,
366,
26687,
4676,
1,
198,
220,
220,
220,
1502,
796,
532,
940,
198,
220,
220,
220,
7196,
796,
366,
8189,
12,
32523,
1,
198,
220,
220,
220,
3124,
796,
366,
43745,
1,
628,
220,
220,
220,
11453,
796,
14631,
11261,
64,
8973,
628,
220,
220,
220,
4172,
796,
14631,
260,
332,
444,
13,
25695,
8973,
628,
220,
220,
220,
24612,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
366,
11261,
64,
1722,
979,
72,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
37474,
2022,
291,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
26001,
55,
1600,
198,
220,
220,
220,
2361,
198
] | 2.637931 | 174 |
# encoding: utf-8
# module renderdoc
# from P:\1-Scripts\_Python\Py-Autocomplete\renderdoc.pyd
# by generator 1.146
# no doc
# imports
import enum as __enum
from .SwigPyObject import SwigPyObject
class D3D12OM(SwigPyObject):
""" Describes the current state of the output-merger stage of the D3D12 pipeline. """
def __eq__(self, *args, **kwargs): # real signature unknown
""" Return self==value. """
pass
def __ge__(self, *args, **kwargs): # real signature unknown
""" Return self>=value. """
pass
def __gt__(self, *args, **kwargs): # real signature unknown
""" Return self>value. """
pass
def __hash__(self, *args, **kwargs): # real signature unknown
""" Return hash(self). """
pass
def __le__(self, *args, **kwargs): # real signature unknown
""" Return self<=value. """
pass
def __lt__(self, *args, **kwargs): # real signature unknown
""" Return self<value. """
pass
@staticmethod # known case of __new__
def __new__(*args, **kwargs): # real signature unknown
""" Create and return a new object. See help(type) for accurate signature. """
pass
def __ne__(self, *args, **kwargs): # real signature unknown
""" Return self!=value. """
pass
blendState = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""A :class:`D3D12BlendState` with the details of the blend state."""
depthReadOnly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""``True`` if depth access to the depth-stencil target is read-only."""
depthStencilState = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""A :class:`D3D12DepthStencilState` with the details of the depth-stencil state."""
depthTarget = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""A :class:`D3D12View` with details of the bound depth-stencil target."""
multiSampleCount = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""The sample count used for rendering."""
multiSampleQuality = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""The MSAA quality level used for rendering."""
renderTargets = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""A list of :class:`D3D12View` describing the bound render targets."""
stencilReadOnly = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""``True`` if stenncil access to the depth-stencil target is read-only."""
this = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
thisown = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
__dict__ = None # (!) real value is ''
| [
2,
21004,
25,
3384,
69,
12,
23,
198,
2,
8265,
8543,
15390,
198,
2,
422,
350,
7479,
16,
12,
7391,
82,
59,
62,
37906,
59,
20519,
12,
16541,
42829,
6677,
59,
13287,
15390,
13,
79,
5173,
198,
2,
416,
17301,
352,
13,
20964,
198,
2,
645,
2205,
198,
198,
2,
17944,
198,
11748,
33829,
355,
11593,
44709,
628,
198,
6738,
764,
10462,
328,
20519,
10267,
1330,
2451,
328,
20519,
10267,
198,
198,
4871,
360,
18,
35,
1065,
2662,
7,
10462,
328,
20519,
10267,
2599,
198,
220,
220,
220,
37227,
39373,
22090,
262,
1459,
1181,
286,
262,
5072,
12,
647,
1362,
3800,
286,
262,
360,
18,
35,
1065,
11523,
13,
37227,
198,
220,
220,
220,
825,
11593,
27363,
834,
7,
944,
11,
1635,
22046,
11,
12429,
46265,
22046,
2599,
1303,
1103,
9877,
6439,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8229,
2116,
855,
8367,
13,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
825,
11593,
469,
834,
7,
944,
11,
1635,
22046,
11,
12429,
46265,
22046,
2599,
1303,
1103,
9877,
6439,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8229,
2116,
29,
28,
8367,
13,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
825,
11593,
13655,
834,
7,
944,
11,
1635,
22046,
11,
12429,
46265,
22046,
2599,
1303,
1103,
9877,
6439,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8229,
2116,
29,
8367,
13,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
825,
11593,
17831,
834,
7,
944,
11,
1635,
22046,
11,
12429,
46265,
22046,
2599,
1303,
1103,
9877,
6439,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8229,
12234,
7,
944,
737,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
825,
11593,
293,
834,
7,
944,
11,
1635,
22046,
11,
12429,
46265,
22046,
2599,
1303,
1103,
9877,
6439,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8229,
2116,
27,
28,
8367,
13,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
825,
11593,
2528,
834,
7,
944,
11,
1635,
22046,
11,
12429,
46265,
22046,
2599,
1303,
1103,
9877,
6439,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8229,
2116,
27,
8367,
13,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12708,
24396,
1303,
1900,
1339,
286,
11593,
3605,
834,
198,
220,
220,
220,
825,
11593,
3605,
834,
46491,
22046,
11,
12429,
46265,
22046,
2599,
1303,
1103,
9877,
6439,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13610,
290,
1441,
257,
649,
2134,
13,
220,
4091,
1037,
7,
4906,
8,
329,
7187,
9877,
13,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
825,
11593,
710,
834,
7,
944,
11,
1635,
22046,
11,
12429,
46265,
22046,
2599,
1303,
1103,
9877,
6439,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8229,
2116,
0,
28,
8367,
13,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
13516,
9012,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
198,
220,
220,
220,
37227,
32,
1058,
4871,
25,
63,
35,
18,
35,
1065,
3629,
437,
9012,
63,
351,
262,
3307,
286,
262,
13516,
1181,
526,
15931,
628,
220,
220,
220,
6795,
5569,
10049,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
198,
220,
220,
220,
37227,
15506,
17821,
15506,
611,
6795,
1895,
284,
262,
6795,
12,
26400,
2856,
2496,
318,
1100,
12,
8807,
526,
15931,
628,
220,
220,
220,
6795,
1273,
268,
2856,
9012,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
198,
220,
220,
220,
37227,
32,
1058,
4871,
25,
63,
35,
18,
35,
1065,
48791,
1273,
268,
2856,
9012,
63,
351,
262,
3307,
286,
262,
6795,
12,
26400,
2856,
1181,
526,
15931,
628,
220,
220,
220,
6795,
21745,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
198,
220,
220,
220,
37227,
32,
1058,
4871,
25,
63,
35,
18,
35,
1065,
7680,
63,
351,
3307,
286,
262,
5421,
6795,
12,
26400,
2856,
2496,
526,
15931,
628,
220,
220,
220,
5021,
36674,
12332,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
198,
220,
220,
220,
37227,
464,
6291,
954,
973,
329,
14837,
526,
15931,
628,
220,
220,
220,
5021,
36674,
35013,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
198,
220,
220,
220,
37227,
464,
6579,
3838,
3081,
1241,
973,
329,
14837,
526,
15931,
628,
220,
220,
220,
8543,
51,
853,
1039,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
198,
220,
220,
220,
37227,
32,
1351,
286,
1058,
4871,
25,
63,
35,
18,
35,
1065,
7680,
63,
12059,
262,
5421,
8543,
6670,
526,
15931,
628,
220,
220,
220,
45219,
2856,
5569,
10049,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
198,
220,
220,
220,
37227,
15506,
17821,
15506,
611,
336,
1697,
2856,
1895,
284,
262,
6795,
12,
26400,
2856,
2496,
318,
1100,
12,
8807,
526,
15931,
628,
220,
220,
220,
428,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
628,
220,
220,
220,
428,
593,
796,
3119,
7,
50033,
2116,
25,
2134,
22784,
37456,
2116,
11,
410,
25,
6045,
11,
37456,
2116,
25,
6045,
8,
220,
1303,
4277,
628,
198,
220,
220,
220,
11593,
11600,
834,
796,
6045,
1303,
357,
8133,
1103,
1988,
318,
10148,
628,
198
] | 2.948617 | 1,012 |
/home/runner/.cache/pip/pool/85/03/a8/e8d26fae6c7b3b8548be18e886767b946dd069a8481930ee9dda2adccd | [
14,
11195,
14,
16737,
11757,
23870,
14,
79,
541,
14,
7742,
14,
5332,
14,
3070,
14,
64,
23,
14,
68,
23,
67,
2075,
69,
3609,
21,
66,
22,
65,
18,
65,
5332,
2780,
1350,
1507,
68,
3459,
3134,
3134,
65,
24,
3510,
1860,
3312,
24,
64,
23,
2780,
1129,
1270,
1453,
24,
1860,
64,
17,
324,
535,
67
] | 1.655172 | 58 |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import itertools
fonts = {"family": "serif",
"weight": "normal",
"size": "12"}
plt.rc('font', **fonts)
plt.rc('text', usetex=True)
ftc_noiseless = np.loadtxt('ftc_noiseless_case3.csv')
ftc_noise = np.loadtxt('ftc_noise_case3.csv')
no_ftc_noiseless = np.loadtxt('no_ftc_noiseless_case3.csv')
x = np.linspace(0, ftc_noiseless.shape[0], ftc_noiseless.shape[0] - 50)
with sns.cubehelix_palette(8, start=.5, rot=-.75, reverse=True):
ax = plt.subplot(111)
ax.plot(x, no_ftc_noiseless[50:, 0], label=r'$X_D$ No FTC (Noiseless)', linestyle='-.')
ax.plot(x, ftc_noise[50:, 0], label=r'$X_D$ FTC', linestyle='--')
ax.plot(x, ftc_noiseless[50:, 0], label=r'$X_D$ FTC (Noiseless)')
ax.plot(x, no_ftc_noiseless[50:, 1], linestyle='-.', label=r'$X_B$ No FTC (Noiseless)')
ax.plot(x, ftc_noise[50:, 1], linestyle='--', label=r'$X_B$ FTC')
ax.plot(x, ftc_noiseless[50:, 1], label=r'$X_B$ FTC (Noiseless)')
plt.xlabel(r'Time, \textit{t} (min)')
plt.ylabel(r'\%MeOH, $\textit{X}_D$ (wt. \%)')
handles, labels = ax.get_legend_handles_labels()
plt.legend(flip(handles, 2), flip(labels, 2), loc=6, ncol=2, prop={'size': 12}, frameon=False)
plt.savefig('Case3_Plot.eps', format='eps', dpi=1000)
plt.show()
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
340,
861,
10141,
198,
198,
10331,
82,
796,
19779,
17989,
1298,
366,
2655,
361,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
366,
6551,
1298,
366,
11265,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
366,
7857,
1298,
366,
1065,
20662,
198,
198,
489,
83,
13,
6015,
10786,
10331,
3256,
12429,
10331,
82,
8,
198,
489,
83,
13,
6015,
10786,
5239,
3256,
514,
316,
1069,
28,
17821,
8,
198,
198,
701,
66,
62,
3919,
271,
5321,
796,
45941,
13,
2220,
14116,
10786,
701,
66,
62,
3919,
271,
5321,
62,
7442,
18,
13,
40664,
11537,
198,
701,
66,
62,
3919,
786,
796,
45941,
13,
2220,
14116,
10786,
701,
66,
62,
3919,
786,
62,
7442,
18,
13,
40664,
11537,
198,
3919,
62,
701,
66,
62,
3919,
271,
5321,
796,
45941,
13,
2220,
14116,
10786,
3919,
62,
701,
66,
62,
3919,
271,
5321,
62,
7442,
18,
13,
40664,
11537,
198,
198,
87,
796,
45941,
13,
21602,
10223,
7,
15,
11,
10117,
66,
62,
3919,
271,
5321,
13,
43358,
58,
15,
4357,
10117,
66,
62,
3919,
271,
5321,
13,
43358,
58,
15,
60,
532,
2026,
8,
198,
198,
4480,
3013,
82,
13,
40296,
2978,
844,
62,
18596,
5857,
7,
23,
11,
923,
28,
13,
20,
11,
5724,
10779,
13,
2425,
11,
9575,
28,
17821,
2599,
198,
220,
220,
220,
7877,
796,
458,
83,
13,
7266,
29487,
7,
16243,
8,
198,
220,
220,
220,
7877,
13,
29487,
7,
87,
11,
645,
62,
701,
66,
62,
3919,
271,
5321,
58,
1120,
45299,
657,
4357,
6167,
28,
81,
6,
3,
55,
62,
35,
3,
1400,
35606,
357,
2949,
271,
5321,
8,
3256,
9493,
10992,
11639,
12,
2637,
8,
198,
220,
220,
220,
7877,
13,
29487,
7,
87,
11,
10117,
66,
62,
3919,
786,
58,
1120,
45299,
657,
4357,
6167,
28,
81,
6,
3,
55,
62,
35,
3,
35606,
3256,
9493,
10992,
11639,
438,
11537,
198,
220,
220,
220,
7877,
13,
29487,
7,
87,
11,
10117,
66,
62,
3919,
271,
5321,
58,
1120,
45299,
657,
4357,
6167,
28,
81,
6,
3,
55,
62,
35,
3,
35606,
357,
2949,
271,
5321,
8,
11537,
628,
220,
220,
220,
7877,
13,
29487,
7,
87,
11,
645,
62,
701,
66,
62,
3919,
271,
5321,
58,
1120,
45299,
352,
4357,
9493,
10992,
11639,
12,
2637,
11,
6167,
28,
81,
6,
3,
55,
62,
33,
3,
1400,
35606,
357,
2949,
271,
5321,
8,
11537,
198,
220,
220,
220,
7877,
13,
29487,
7,
87,
11,
10117,
66,
62,
3919,
786,
58,
1120,
45299,
352,
4357,
9493,
10992,
11639,
438,
3256,
6167,
28,
81,
6,
3,
55,
62,
33,
3,
35606,
11537,
198,
220,
220,
220,
7877,
13,
29487,
7,
87,
11,
10117,
66,
62,
3919,
271,
5321,
58,
1120,
45299,
352,
4357,
6167,
28,
81,
6,
3,
55,
62,
33,
3,
35606,
357,
2949,
271,
5321,
8,
11537,
198,
198,
489,
83,
13,
87,
18242,
7,
81,
6,
7575,
11,
3467,
5239,
270,
90,
83,
92,
357,
1084,
8,
11537,
198,
489,
83,
13,
2645,
9608,
7,
81,
6,
59,
4,
5308,
12096,
11,
39280,
5239,
270,
90,
55,
92,
62,
35,
3,
357,
46569,
13,
3467,
4407,
11537,
628,
198,
198,
4993,
829,
11,
14722,
796,
7877,
13,
1136,
62,
1455,
437,
62,
4993,
829,
62,
23912,
1424,
3419,
198,
489,
83,
13,
1455,
437,
7,
2704,
541,
7,
4993,
829,
11,
362,
828,
14283,
7,
23912,
1424,
11,
362,
828,
1179,
28,
21,
11,
299,
4033,
28,
17,
11,
2632,
34758,
6,
7857,
10354,
1105,
5512,
5739,
261,
28,
25101,
8,
198,
198,
489,
83,
13,
21928,
5647,
10786,
20448,
18,
62,
43328,
13,
25386,
3256,
5794,
11639,
25386,
3256,
288,
14415,
28,
12825,
8,
198,
198,
489,
83,
13,
12860,
3419,
198
] | 2.054688 | 640 |
import cv2
import numpy as np
if __name__ == '__main__':
main() | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419
] | 2.428571 | 28 |
'''
Encapsulates all tasks that can be run against the 'notes' endpoint
'''
| [
7061,
6,
198,
27195,
1686,
15968,
477,
8861,
326,
460,
307,
1057,
1028,
262,
705,
17815,
6,
36123,
198,
7061,
6,
628
] | 3.5 | 22 |
# Generated by Django 2.2.2 on 2019-07-03 11:05
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
17,
319,
13130,
12,
2998,
12,
3070,
1367,
25,
2713,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
'''
Program to convert any Image to Pattern
Input your Image URL or just press enter to see the default image.
Created by Sayok Dey Majumder.
Github User handle : NeilSayok
Link to profile: https://github.com/NeilSayok
'''
import cv2
import imutils
import urllib.request
import numpy as np
url = input("Enter Url to your Image or Press Enter if you want to use default image\n")
if(url == ""):
url = 'https://avatars.githubusercontent.com/u/21328143?v=4'
req = urllib.request.urlopen(url)
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
img = cv2.imdecode(arr, -1) # 'Load it as it is'
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = imutils.resize(img, width=300,height=300)
thresh = 127
im_bw = 255 - cv2.threshold(img, thresh, 255, cv2.THRESH_BINARY)[1]
print(im_bw.shape)
with open("Out.txt", "w") as fh:
for a in im_bw:
for b in a:
if(b == 255):
fh.write("*")
else:
fh.write(" ")
fh.write("\n")
| [
7061,
6,
198,
15167,
284,
10385,
597,
7412,
284,
23939,
198,
198,
20560,
534,
7412,
10289,
393,
655,
1803,
3802,
284,
766,
262,
4277,
2939,
13,
220,
220,
198,
198,
41972,
416,
13816,
482,
1024,
88,
12390,
388,
1082,
13,
198,
198,
38,
10060,
11787,
5412,
1058,
15929,
25515,
482,
198,
198,
11280,
284,
7034,
25,
3740,
1378,
12567,
13,
785,
14,
29354,
25515,
482,
198,
198,
7061,
6,
628,
198,
198,
11748,
269,
85,
17,
198,
11748,
545,
26791,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
299,
32152,
355,
45941,
628,
198,
6371,
796,
5128,
7203,
17469,
8799,
75,
284,
534,
7412,
393,
4332,
6062,
611,
345,
765,
284,
779,
4277,
2939,
59,
77,
4943,
198,
361,
7,
6371,
6624,
13538,
2599,
198,
220,
220,
220,
19016,
796,
705,
5450,
1378,
615,
40193,
13,
12567,
43667,
13,
785,
14,
84,
14,
26427,
2078,
21139,
30,
85,
28,
19,
6,
198,
42180,
796,
2956,
297,
571,
13,
25927,
13,
6371,
9654,
7,
6371,
8,
198,
3258,
796,
45941,
13,
292,
18747,
7,
1525,
83,
451,
2433,
7,
42180,
13,
961,
3419,
828,
288,
4906,
28,
37659,
13,
28611,
23,
8,
198,
9600,
796,
269,
85,
17,
13,
320,
12501,
1098,
7,
3258,
11,
532,
16,
8,
1303,
705,
8912,
340,
355,
340,
318,
6,
198,
9600,
796,
269,
85,
17,
13,
33967,
83,
10258,
7,
9600,
11,
269,
85,
17,
13,
46786,
62,
33,
10761,
17,
38,
30631,
8,
198,
198,
9600,
796,
545,
26791,
13,
411,
1096,
7,
9600,
11,
9647,
28,
6200,
11,
17015,
28,
6200,
8,
198,
198,
400,
3447,
796,
18112,
198,
320,
62,
65,
86,
796,
14280,
532,
269,
85,
17,
13,
400,
10126,
7,
9600,
11,
294,
3447,
11,
14280,
11,
269,
85,
17,
13,
4221,
19535,
39,
62,
33,
1268,
13153,
38381,
16,
60,
198,
198,
4798,
7,
320,
62,
65,
86,
13,
43358,
8,
198,
198,
4480,
1280,
7203,
7975,
13,
14116,
1600,
366,
86,
4943,
355,
277,
71,
25,
628,
220,
220,
220,
329,
257,
287,
545,
62,
65,
86,
25,
198,
220,
220,
220,
220,
220,
220,
220,
329,
275,
287,
257,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
7,
65,
6624,
14280,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
71,
13,
13564,
7203,
9,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
71,
13,
13564,
7203,
366,
8,
198,
220,
220,
220,
220,
220,
220,
220,
277,
71,
13,
13564,
7203,
59,
77,
4943,
628,
628
] | 2.239468 | 451 |
#
# Copyright (c) 2017, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
"""Functionality for analyzing buildstats"""
import json
import logging
import os
import re
from collections import namedtuple,OrderedDict
from statistics import mean
log = logging.getLogger()
taskdiff_fields = ('pkg', 'pkg_op', 'task', 'task_op', 'value1', 'value2',
'absdiff', 'reldiff')
TaskDiff = namedtuple('TaskDiff', ' '.join(taskdiff_fields))
class BSError(Exception):
"""Error handling of buildstats"""
pass
class BSTaskAggregate(object):
"""Class representing multiple runs of the same task"""
properties = ('cputime', 'walltime', 'read_bytes', 'write_bytes',
'read_ops', 'write_ops')
def append(self, task):
"""Append new task"""
# Reset pre-calculated properties
assert isinstance(task, BSTask), "Type is '{}' instead of 'BSTask'".format(type(task))
self._properties = {}
self._tasks.append(task)
class BSRecipe(object):
"""Class representing buildstats of one recipe"""
def aggregate(self, bsrecipe):
"""Aggregate data of another recipe buildstats"""
if self.nevr != bsrecipe.nevr:
raise ValueError("Refusing to aggregate buildstats, recipe version "
"differs: {} vs. {}".format(self.nevr, bsrecipe.nevr))
if set(self.tasks.keys()) != set(bsrecipe.tasks.keys()):
raise ValueError("Refusing to aggregate buildstats, set of tasks "
"in {} differ".format(self.name))
for taskname, taskdata in bsrecipe.tasks.items():
if not isinstance(self.tasks[taskname], BSTaskAggregate):
self.tasks[taskname] = BSTaskAggregate([self.tasks[taskname]])
self.tasks[taskname].append(taskdata)
@property
class BuildStats(dict):
"""Class representing buildstats of one build"""
@property
def num_tasks(self):
"""Get number of tasks"""
num = 0
for recipe in self.values():
num += len(recipe.tasks)
return num
@classmethod
def from_json(cls, bs_json):
"""Create new BuildStats object from JSON object"""
buildstats = cls()
for recipe in bs_json:
if recipe['name'] in buildstats:
raise BSError("Cannot handle multiple versions of the same "
"package ({})".format(recipe['name']))
bsrecipe = BSRecipe(recipe['name'], recipe['epoch'],
recipe['version'], recipe['revision'])
for task, data in recipe['tasks'].items():
bsrecipe.tasks[task] = BSTask(data)
buildstats[recipe['name']] = bsrecipe
return buildstats
@staticmethod
def from_file_json(path):
"""Load buildstats from a JSON file"""
with open(path) as fobj:
bs_json = json.load(fobj)
return BuildStats.from_json(bs_json)
@staticmethod
def split_nevr(nevr):
"""Split name and version information from recipe "nevr" string"""
n_e_v, revision = nevr.rsplit('-', 1)
match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[0-9]\S*)$',
n_e_v)
if not match:
# If we're not able to parse a version starting with a number, just
# take the part after last dash
match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[^-]+)$',
n_e_v)
name = match.group('name')
version = match.group('version')
epoch = match.group('epoch')
return name, epoch, version, revision
@classmethod
def from_dir(cls, path):
"""Load buildstats from a buildstats directory"""
if not os.path.isfile(os.path.join(path, 'build_stats')):
raise BSError("{} does not look like a buildstats directory".format(path))
log.debug("Reading buildstats directory %s", path)
buildstats = cls()
subdirs = os.listdir(path)
for dirname in subdirs:
recipe_dir = os.path.join(path, dirname)
if not os.path.isdir(recipe_dir):
continue
name, epoch, version, revision = cls.split_nevr(dirname)
bsrecipe = BSRecipe(name, epoch, version, revision)
for task in os.listdir(recipe_dir):
bsrecipe.tasks[task] = BSTask.from_file(
os.path.join(recipe_dir, task))
if name in buildstats:
raise BSError("Cannot handle multiple versions of the same "
"package ({})".format(name))
buildstats[name] = bsrecipe
return buildstats
def aggregate(self, buildstats):
"""Aggregate other buildstats into this"""
if set(self.keys()) != set(buildstats.keys()):
raise ValueError("Refusing to aggregate buildstats, set of "
"recipes is different")
for pkg, data in buildstats.items():
self[pkg].aggregate(data)
def diff_buildstats(bs1, bs2, stat_attr, min_val=None, min_absdiff=None):
"""Compare the tasks of two buildstats"""
tasks_diff = []
pkgs = set(bs1.keys()).union(set(bs2.keys()))
for pkg in pkgs:
tasks1 = bs1[pkg].tasks if pkg in bs1 else {}
tasks2 = bs2[pkg].tasks if pkg in bs2 else {}
if not tasks1:
pkg_op = '+'
elif not tasks2:
pkg_op = '-'
else:
pkg_op = ' '
for task in set(tasks1.keys()).union(set(tasks2.keys())):
task_op = ' '
if task in tasks1:
val1 = getattr(bs1[pkg].tasks[task], stat_attr)
else:
task_op = '+'
val1 = 0
if task in tasks2:
val2 = getattr(bs2[pkg].tasks[task], stat_attr)
else:
val2 = 0
task_op = '-'
if val1 == 0:
reldiff = float('inf')
else:
reldiff = 100 * (val2 - val1) / val1
if min_val and max(val1, val2) < min_val:
log.debug("Filtering out %s:%s (%s)", pkg, task,
max(val1, val2))
continue
if min_absdiff and abs(val2 - val1) < min_absdiff:
log.debug("Filtering out %s:%s (difference of %s)", pkg, task,
val2-val1)
continue
tasks_diff.append(TaskDiff(pkg, pkg_op, task, task_op, val1, val2,
val2-val1, reldiff))
return tasks_diff
class BSVerDiff(object):
"""Class representing recipe version differences between two buildstats"""
| [
2,
198,
2,
15069,
357,
66,
8,
2177,
11,
8180,
10501,
13,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
340,
198,
2,
739,
262,
2846,
290,
3403,
286,
262,
22961,
3611,
5094,
13789,
11,
198,
2,
2196,
362,
11,
355,
3199,
416,
262,
3232,
10442,
5693,
13,
198,
2,
198,
2,
770,
1430,
318,
9387,
287,
262,
2911,
340,
481,
307,
4465,
11,
475,
42881,
198,
2,
15529,
34764,
56,
26,
1231,
772,
262,
17142,
18215,
286,
34482,
3398,
1565,
5603,
25382,
393,
198,
2,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
13,
220,
4091,
262,
22961,
3611,
5094,
13789,
329,
198,
2,
517,
3307,
13,
198,
2,
198,
37811,
22203,
1483,
329,
22712,
1382,
34242,
37811,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
17268,
1330,
3706,
83,
29291,
11,
35422,
1068,
35,
713,
198,
6738,
7869,
1330,
1612,
628,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
3419,
628,
198,
35943,
26069,
62,
25747,
796,
19203,
35339,
3256,
705,
35339,
62,
404,
3256,
705,
35943,
3256,
705,
35943,
62,
404,
3256,
705,
8367,
16,
3256,
705,
8367,
17,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8937,
26069,
3256,
705,
260,
335,
733,
11537,
198,
25714,
28813,
796,
3706,
83,
29291,
10786,
25714,
28813,
3256,
705,
45302,
22179,
7,
35943,
26069,
62,
25747,
4008,
628,
198,
4871,
347,
5188,
81,
1472,
7,
16922,
2599,
198,
220,
220,
220,
37227,
12331,
9041,
286,
1382,
34242,
37811,
198,
220,
220,
220,
1208,
628,
198,
198,
4871,
44992,
2093,
46384,
49373,
7,
15252,
2599,
198,
220,
220,
220,
37227,
9487,
10200,
3294,
4539,
286,
262,
976,
4876,
37811,
198,
220,
220,
220,
6608,
796,
19203,
66,
1996,
524,
3256,
705,
11930,
2435,
3256,
705,
961,
62,
33661,
3256,
705,
13564,
62,
33661,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
961,
62,
2840,
3256,
705,
13564,
62,
2840,
11537,
628,
220,
220,
220,
825,
24443,
7,
944,
11,
4876,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
4677,
437,
649,
4876,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
30027,
662,
12,
9948,
49262,
6608,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
318,
39098,
7,
35943,
11,
44992,
2093,
828,
366,
6030,
318,
705,
90,
92,
6,
2427,
286,
705,
33,
2257,
2093,
6,
1911,
18982,
7,
4906,
7,
35943,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
48310,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
83,
6791,
13,
33295,
7,
35943,
8,
628,
198,
4871,
24218,
37523,
7,
15252,
2599,
198,
220,
220,
220,
37227,
9487,
10200,
1382,
34242,
286,
530,
8364,
37811,
628,
220,
220,
220,
825,
19406,
7,
944,
11,
275,
82,
29102,
431,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
46384,
49373,
1366,
286,
1194,
8364,
1382,
34242,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
710,
37020,
14512,
275,
82,
29102,
431,
13,
710,
37020,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
8134,
3500,
284,
19406,
1382,
34242,
11,
8364,
2196,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
26069,
364,
25,
23884,
3691,
13,
23884,
1911,
18982,
7,
944,
13,
710,
37020,
11,
275,
82,
29102,
431,
13,
710,
37020,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
900,
7,
944,
13,
83,
6791,
13,
13083,
28955,
14512,
900,
7,
1443,
29102,
431,
13,
83,
6791,
13,
13083,
3419,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
8134,
3500,
284,
19406,
1382,
34242,
11,
900,
286,
8861,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
259,
23884,
13238,
1911,
18982,
7,
944,
13,
3672,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
329,
4876,
3672,
11,
4876,
7890,
287,
275,
82,
29102,
431,
13,
83,
6791,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
318,
39098,
7,
944,
13,
83,
6791,
58,
35943,
3672,
4357,
44992,
2093,
46384,
49373,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
83,
6791,
58,
35943,
3672,
60,
796,
44992,
2093,
46384,
49373,
26933,
944,
13,
83,
6791,
58,
35943,
3672,
11907,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
83,
6791,
58,
35943,
3672,
4083,
33295,
7,
35943,
7890,
8,
628,
220,
220,
220,
2488,
26745,
628,
198,
4871,
10934,
29668,
7,
11600,
2599,
198,
220,
220,
220,
37227,
9487,
10200,
1382,
34242,
286,
530,
1382,
37811,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
997,
62,
83,
6791,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
1271,
286,
8861,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
997,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
329,
8364,
287,
2116,
13,
27160,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
997,
15853,
18896,
7,
29102,
431,
13,
83,
6791,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
997,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
422,
62,
17752,
7,
565,
82,
11,
275,
82,
62,
17752,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16447,
649,
10934,
29668,
2134,
422,
19449,
2134,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1382,
34242,
796,
537,
82,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
8364,
287,
275,
82,
62,
17752,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
8364,
17816,
3672,
20520,
287,
1382,
34242,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
347,
5188,
81,
1472,
7203,
34,
34574,
5412,
3294,
6300,
286,
262,
976,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
26495,
37913,
30072,
1911,
18982,
7,
29102,
431,
17816,
3672,
20520,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
82,
29102,
431,
796,
24218,
37523,
7,
29102,
431,
17816,
3672,
6,
4357,
8364,
17816,
538,
5374,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8364,
17816,
9641,
6,
4357,
8364,
17816,
260,
10178,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
4876,
11,
1366,
287,
8364,
17816,
83,
6791,
6,
4083,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
82,
29102,
431,
13,
83,
6791,
58,
35943,
60,
796,
44992,
2093,
7,
7890,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1382,
34242,
58,
29102,
431,
17816,
3672,
6,
11907,
796,
275,
82,
29102,
431,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
1382,
34242,
628,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
825,
422,
62,
7753,
62,
17752,
7,
6978,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8912,
1382,
34242,
422,
257,
19449,
2393,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
6978,
8,
355,
277,
26801,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
82,
62,
17752,
796,
33918,
13,
2220,
7,
69,
26801,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10934,
29668,
13,
6738,
62,
17752,
7,
1443,
62,
17752,
8,
628,
198,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
825,
6626,
62,
710,
37020,
7,
710,
37020,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
41205,
1438,
290,
2196,
1321,
422,
8364,
366,
710,
37020,
1,
4731,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
299,
62,
68,
62,
85,
11,
18440,
796,
497,
37020,
13,
3808,
489,
270,
10786,
12,
3256,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2872,
796,
302,
13,
15699,
7,
81,
6,
61,
7,
30,
47,
27,
3672,
29,
59,
50,
10,
13219,
19510,
30,
47,
27,
538,
5374,
36937,
15,
12,
24,
60,
90,
16,
11,
20,
30072,
62,
19427,
7,
30,
47,
27,
9641,
36937,
15,
12,
24,
60,
59,
50,
28104,
3,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
62,
68,
62,
85,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2872,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
356,
821,
407,
1498,
284,
21136,
257,
2196,
3599,
351,
257,
1271,
11,
655,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1011,
262,
636,
706,
938,
14470,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2872,
796,
302,
13,
15699,
7,
81,
6,
61,
7,
30,
47,
27,
3672,
29,
59,
50,
10,
13219,
19510,
30,
47,
27,
538,
5374,
36937,
15,
12,
24,
60,
90,
16,
11,
20,
30072,
62,
19427,
7,
30,
47,
27,
9641,
36937,
61,
12,
60,
28988,
3,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
62,
68,
62,
85,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
2872,
13,
8094,
10786,
3672,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2196,
796,
2872,
13,
8094,
10786,
9641,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
36835,
796,
2872,
13,
8094,
10786,
538,
5374,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1438,
11,
36835,
11,
2196,
11,
18440,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
422,
62,
15908,
7,
565,
82,
11,
3108,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8912,
1382,
34242,
422,
257,
1382,
34242,
8619,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
4468,
576,
7,
418,
13,
6978,
13,
22179,
7,
6978,
11,
705,
11249,
62,
34242,
11537,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
347,
5188,
81,
1472,
7203,
90,
92,
857,
407,
804,
588,
257,
1382,
34242,
8619,
1911,
18982,
7,
6978,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
2604,
13,
24442,
7203,
36120,
1382,
34242,
8619,
4064,
82,
1600,
3108,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1382,
34242,
796,
537,
82,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
850,
15908,
82,
796,
28686,
13,
4868,
15908,
7,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
26672,
3672,
287,
850,
15908,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8364,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7,
6978,
11,
26672,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
9409,
343,
7,
29102,
431,
62,
15908,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
11,
36835,
11,
2196,
11,
18440,
796,
537,
82,
13,
35312,
62,
710,
37020,
7,
15908,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
82,
29102,
431,
796,
24218,
37523,
7,
3672,
11,
36835,
11,
2196,
11,
18440,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
4876,
287,
28686,
13,
4868,
15908,
7,
29102,
431,
62,
15908,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
82,
29102,
431,
13,
83,
6791,
58,
35943,
60,
796,
44992,
2093,
13,
6738,
62,
7753,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
6978,
13,
22179,
7,
29102,
431,
62,
15908,
11,
4876,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1438,
287,
1382,
34242,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
347,
5188,
81,
1472,
7203,
34,
34574,
5412,
3294,
6300,
286,
262,
976,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
26495,
37913,
30072,
1911,
18982,
7,
3672,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1382,
34242,
58,
3672,
60,
796,
275,
82,
29102,
431,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
1382,
34242,
628,
220,
220,
220,
825,
19406,
7,
944,
11,
1382,
34242,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
46384,
49373,
584,
1382,
34242,
656,
428,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
900,
7,
944,
13,
13083,
28955,
14512,
900,
7,
11249,
34242,
13,
13083,
3419,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
8134,
3500,
284,
19406,
1382,
34242,
11,
900,
286,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8344,
18636,
318,
1180,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
329,
279,
10025,
11,
1366,
287,
1382,
34242,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
58,
35339,
4083,
9460,
49373,
7,
7890,
8,
628,
198,
4299,
814,
62,
11249,
34242,
7,
1443,
16,
11,
275,
82,
17,
11,
1185,
62,
35226,
11,
949,
62,
2100,
28,
14202,
11,
949,
62,
8937,
26069,
28,
14202,
2599,
198,
220,
220,
220,
37227,
41488,
262,
8861,
286,
734,
1382,
34242,
37811,
198,
220,
220,
220,
8861,
62,
26069,
796,
17635,
198,
220,
220,
220,
279,
10025,
82,
796,
900,
7,
1443,
16,
13,
13083,
3419,
737,
24592,
7,
2617,
7,
1443,
17,
13,
13083,
3419,
4008,
198,
220,
220,
220,
329,
279,
10025,
287,
279,
10025,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8861,
16,
796,
275,
82,
16,
58,
35339,
4083,
83,
6791,
611,
279,
10025,
287,
275,
82,
16,
2073,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
8861,
17,
796,
275,
82,
17,
58,
35339,
4083,
83,
6791,
611,
279,
10025,
287,
275,
82,
17,
2073,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
8861,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
10025,
62,
404,
796,
705,
10,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
407,
8861,
17,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
10025,
62,
404,
796,
705,
19355,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
10025,
62,
404,
796,
705,
705,
628,
220,
220,
220,
220,
220,
220,
220,
329,
4876,
287,
900,
7,
83,
6791,
16,
13,
13083,
3419,
737,
24592,
7,
2617,
7,
83,
6791,
17,
13,
13083,
28955,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4876,
62,
404,
796,
705,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4876,
287,
8861,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
16,
796,
651,
35226,
7,
1443,
16,
58,
35339,
4083,
83,
6791,
58,
35943,
4357,
1185,
62,
35226,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4876,
62,
404,
796,
705,
10,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
16,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4876,
287,
8861,
17,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
17,
796,
651,
35226,
7,
1443,
17,
58,
35339,
4083,
83,
6791,
58,
35943,
4357,
1185,
62,
35226,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
17,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4876,
62,
404,
796,
705,
19355,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1188,
16,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
302,
335,
733,
796,
12178,
10786,
10745,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
302,
335,
733,
796,
1802,
1635,
357,
2100,
17,
532,
1188,
16,
8,
1220,
1188,
16,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
949,
62,
2100,
290,
3509,
7,
2100,
16,
11,
1188,
17,
8,
1279,
949,
62,
2100,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2604,
13,
24442,
7203,
11928,
20212,
503,
4064,
82,
25,
4,
82,
37633,
82,
42501,
279,
10025,
11,
4876,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
7,
2100,
16,
11,
1188,
17,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
949,
62,
8937,
26069,
290,
2352,
7,
2100,
17,
532,
1188,
16,
8,
1279,
949,
62,
8937,
26069,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2604,
13,
24442,
7203,
11928,
20212,
503,
4064,
82,
25,
4,
82,
357,
26069,
1945,
286,
4064,
82,
42501,
279,
10025,
11,
4876,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
17,
12,
2100,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8861,
62,
26069,
13,
33295,
7,
25714,
28813,
7,
35339,
11,
279,
10025,
62,
404,
11,
4876,
11,
4876,
62,
404,
11,
1188,
16,
11,
1188,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
17,
12,
2100,
16,
11,
302,
335,
733,
4008,
198,
220,
220,
220,
1441,
8861,
62,
26069,
628,
198,
4871,
24218,
13414,
28813,
7,
15252,
2599,
198,
220,
220,
220,
37227,
9487,
10200,
8364,
2196,
5400,
1022,
734,
1382,
34242,
37811,
198
] | 2.133765 | 3,394 |
import os
import time
import random
import ast
import json
import argparse
import numpy as np
import tensorflow as tf
from style_enc_model import Style_Enc_Model
from data import CHN_Style_DataLoader
from model_utils import save_model, reset_graph
NPZ_DIR = "../WriteLikeYouData/npz_relative_dist/CASIA_rdp4.0"
assert os.path.exists(NPZ_DIR)
print("NPZ_DIR:", NPZ_DIR)
def train(sess, model, valid_model, train_dataloader, valid_dataloader, log_root):
"""Train a model."""
# Setup summary writer.
os.makedirs(log_root, exist_ok=True)
train_summary_writer = tf.summary.FileWriter(log_root + "/train_log", sess.graph)
valid_summary_writer = tf.summary.FileWriter(log_root + "/valid_log")
saver = tf.train.Saver(tf.global_variables(), max_to_keep=5)
t_vars = tf.trainable_variables()
count_t_vars = 0
for var in t_vars:
num_param = np.prod(var.get_shape().as_list())
count_t_vars += num_param
print('%s %s %d' % (var.name, str(var.get_shape()), num_param))
print('Total trainable variables %d.' % count_t_vars)
best_valid_loss = 999999.0
MIN_LR, DECAY = 0.0000001, 0.9999
for step in range(1000000):
start = time.time()
batch_zi_array, batch_len_array = train_dataloader.get_random_batch_data()
curr_learning_rate = (model.init_lr - MIN_LR) * (DECAY ** step) + MIN_LR
feed = {
model.input_data: batch_zi_array,
model.seq_lens: batch_len_array,
model.lr: curr_learning_rate,
}
# training
(_, loss, ac_loss, mhe_loss, summ_str) = sess.run([model.train_op, model.loss, model.ac_loss, model.mhe_loss, model.summ], feed)
train_summary_writer.add_summary(summ_str, step)
train_summary_writer.flush()
# log
if step % 50 == 0 and step > 0:
print("Train step %d, lr:%.6f, loss: %.4f, ac_loss: %.4f, mhe_loss: %.4f; train time: %.2fs" % (
step, curr_learning_rate, loss, ac_loss, mhe_loss, time.time() - start))
# validation
if step % 500 == 0 and step > 0:
start = time.time()
print("validating...", log_root)
valid_loss, valid_ac_loss, valid_mhe_loss = evaluate_model(sess, valid_model, valid_dataloader)
valid_loss_summ = tf.summary.Summary()
valid_loss_summ.value.add(tag='valid_loss', simple_value=float(valid_loss))
valid_loss_summ.value.add(tag='valid_ac_loss', simple_value=float(valid_ac_loss))
valid_loss_summ.value.add(tag='valid_mhe_loss', simple_value=float(valid_mhe_loss))
print("Best valid loss: %.4f, loss: %.4f, ac_loss: %.4f, mhe_loss: %.4f; valid time: %.2fs" % (
best_valid_loss, valid_loss, valid_ac_loss, valid_mhe_loss, time.time() - start))
valid_summary_writer.add_summary(valid_loss_summ, step)
valid_summary_writer.flush()
if valid_loss < best_valid_loss:
best_valid_loss = valid_loss
print("Better model, best_valid_loss: %.4f" % best_valid_loss)
save_model(sess, saver, log_root, step)
if __name__ == '__main__':
main()
| [
11748,
28686,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
6468,
198,
11748,
33918,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
3918,
62,
12685,
62,
19849,
1330,
17738,
62,
27195,
62,
17633,
198,
6738,
1366,
1330,
5870,
45,
62,
21466,
62,
6601,
17401,
198,
6738,
2746,
62,
26791,
1330,
3613,
62,
19849,
11,
13259,
62,
34960,
198,
198,
22182,
57,
62,
34720,
796,
366,
40720,
16594,
7594,
1639,
6601,
14,
37659,
89,
62,
43762,
62,
17080,
14,
34,
1921,
3539,
62,
4372,
79,
19,
13,
15,
1,
198,
198,
30493,
28686,
13,
6978,
13,
1069,
1023,
7,
22182,
57,
62,
34720,
8,
198,
4798,
7203,
22182,
57,
62,
34720,
25,
1600,
28498,
57,
62,
34720,
8,
628,
198,
4299,
4512,
7,
82,
408,
11,
2746,
11,
4938,
62,
19849,
11,
4512,
62,
67,
10254,
1170,
263,
11,
4938,
62,
67,
10254,
1170,
263,
11,
2604,
62,
15763,
2599,
198,
220,
220,
220,
37227,
44077,
257,
2746,
526,
15931,
198,
220,
220,
220,
1303,
31122,
10638,
6260,
13,
198,
220,
220,
220,
28686,
13,
76,
4335,
17062,
7,
6404,
62,
15763,
11,
2152,
62,
482,
28,
17821,
8,
198,
220,
220,
220,
4512,
62,
49736,
62,
16002,
796,
48700,
13,
49736,
13,
8979,
34379,
7,
6404,
62,
15763,
1343,
12813,
27432,
62,
6404,
1600,
264,
408,
13,
34960,
8,
198,
220,
220,
220,
4938,
62,
49736,
62,
16002,
796,
48700,
13,
49736,
13,
8979,
34379,
7,
6404,
62,
15763,
1343,
12813,
12102,
62,
6404,
4943,
198,
220,
220,
220,
473,
332,
796,
48700,
13,
27432,
13,
50,
8770,
7,
27110,
13,
20541,
62,
25641,
2977,
22784,
3509,
62,
1462,
62,
14894,
28,
20,
8,
628,
220,
220,
220,
256,
62,
85,
945,
796,
48700,
13,
27432,
540,
62,
25641,
2977,
3419,
198,
220,
220,
220,
954,
62,
83,
62,
85,
945,
796,
657,
198,
220,
220,
220,
329,
1401,
287,
256,
62,
85,
945,
25,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
17143,
796,
45941,
13,
1676,
67,
7,
7785,
13,
1136,
62,
43358,
22446,
292,
62,
4868,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
954,
62,
83,
62,
85,
945,
15853,
997,
62,
17143,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
4,
82,
4064,
82,
4064,
67,
6,
4064,
357,
7785,
13,
3672,
11,
965,
7,
7785,
13,
1136,
62,
43358,
3419,
828,
997,
62,
17143,
4008,
198,
220,
220,
220,
3601,
10786,
14957,
4512,
540,
9633,
4064,
67,
2637,
4064,
954,
62,
83,
62,
85,
945,
8,
628,
220,
220,
220,
1266,
62,
12102,
62,
22462,
796,
36006,
17032,
13,
15,
198,
220,
220,
220,
20625,
62,
35972,
11,
27196,
4792,
796,
657,
13,
2388,
8298,
11,
657,
13,
24214,
628,
220,
220,
220,
329,
2239,
287,
2837,
7,
16,
10535,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
923,
796,
640,
13,
2435,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
17027,
62,
18747,
11,
15458,
62,
11925,
62,
18747,
796,
4512,
62,
67,
10254,
1170,
263,
13,
1136,
62,
25120,
62,
43501,
62,
7890,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1090,
81,
62,
40684,
62,
4873,
796,
357,
19849,
13,
15003,
62,
14050,
532,
20625,
62,
35972,
8,
1635,
357,
41374,
4792,
12429,
2239,
8,
1343,
20625,
62,
35972,
628,
220,
220,
220,
220,
220,
220,
220,
3745,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
13,
15414,
62,
7890,
25,
15458,
62,
17027,
62,
18747,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
13,
41068,
62,
75,
641,
25,
15458,
62,
11925,
62,
18747,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
13,
14050,
25,
1090,
81,
62,
40684,
62,
4873,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3047,
198,
220,
220,
220,
220,
220,
220,
220,
44104,
11,
2994,
11,
936,
62,
22462,
11,
285,
258,
62,
22462,
11,
30114,
62,
2536,
8,
796,
264,
408,
13,
5143,
26933,
19849,
13,
27432,
62,
404,
11,
2746,
13,
22462,
11,
2746,
13,
330,
62,
22462,
11,
2746,
13,
76,
258,
62,
22462,
11,
2746,
13,
82,
13929,
4357,
3745,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
49736,
62,
16002,
13,
2860,
62,
49736,
7,
82,
13929,
62,
2536,
11,
2239,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
49736,
62,
16002,
13,
25925,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2604,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2239,
4064,
2026,
6624,
657,
290,
2239,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
44077,
2239,
4064,
67,
11,
300,
81,
25,
7225,
21,
69,
11,
2994,
25,
4064,
13,
19,
69,
11,
936,
62,
22462,
25,
4064,
13,
19,
69,
11,
285,
258,
62,
22462,
25,
4064,
13,
19,
69,
26,
4512,
640,
25,
4064,
13,
17,
9501,
1,
4064,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2239,
11,
1090,
81,
62,
40684,
62,
4873,
11,
2994,
11,
936,
62,
22462,
11,
285,
258,
62,
22462,
11,
640,
13,
2435,
3419,
532,
923,
4008,
628,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
21201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2239,
4064,
5323,
6624,
657,
290,
2239,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
796,
640,
13,
2435,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
12102,
803,
9313,
11,
2604,
62,
15763,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
62,
22462,
11,
4938,
62,
330,
62,
22462,
11,
4938,
62,
76,
258,
62,
22462,
796,
13446,
62,
19849,
7,
82,
408,
11,
4938,
62,
19849,
11,
4938,
62,
67,
10254,
1170,
263,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
62,
22462,
62,
82,
13929,
796,
48700,
13,
49736,
13,
22093,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
62,
22462,
62,
82,
13929,
13,
8367,
13,
2860,
7,
12985,
11639,
12102,
62,
22462,
3256,
2829,
62,
8367,
28,
22468,
7,
12102,
62,
22462,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
62,
22462,
62,
82,
13929,
13,
8367,
13,
2860,
7,
12985,
11639,
12102,
62,
330,
62,
22462,
3256,
2829,
62,
8367,
28,
22468,
7,
12102,
62,
330,
62,
22462,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
62,
22462,
62,
82,
13929,
13,
8367,
13,
2860,
7,
12985,
11639,
12102,
62,
76,
258,
62,
22462,
3256,
2829,
62,
8367,
28,
22468,
7,
12102,
62,
76,
258,
62,
22462,
4008,
628,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
13014,
4938,
2994,
25,
4064,
13,
19,
69,
11,
2994,
25,
4064,
13,
19,
69,
11,
936,
62,
22462,
25,
4064,
13,
19,
69,
11,
285,
258,
62,
22462,
25,
4064,
13,
19,
69,
26,
4938,
640,
25,
4064,
13,
17,
9501,
1,
4064,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
12102,
62,
22462,
11,
4938,
62,
22462,
11,
4938,
62,
330,
62,
22462,
11,
4938,
62,
76,
258,
62,
22462,
11,
640,
13,
2435,
3419,
532,
923,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
62,
49736,
62,
16002,
13,
2860,
62,
49736,
7,
12102,
62,
22462,
62,
82,
13929,
11,
2239,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
62,
49736,
62,
16002,
13,
25925,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4938,
62,
22462,
1279,
1266,
62,
12102,
62,
22462,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
12102,
62,
22462,
796,
4938,
62,
22462,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
28971,
2746,
11,
1266,
62,
12102,
62,
22462,
25,
4064,
13,
19,
69,
1,
4064,
1266,
62,
12102,
62,
22462,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3613,
62,
19849,
7,
82,
408,
11,
473,
332,
11,
2604,
62,
15763,
11,
2239,
8,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.190021 | 1,463 |
km = float(input('digite km rodados: '))
dias = float(input('total de dias: '))
total_de_km = km * 0.15
total_de_dias = dias * 60
total_a_pagar = total_de_dias + total_de_km
print(f'total a pagar e: {total_a_pagar} R$')
| [
13276,
796,
12178,
7,
15414,
10786,
12894,
578,
10571,
15299,
22484,
25,
705,
4008,
198,
67,
4448,
796,
12178,
7,
15414,
10786,
23350,
390,
2566,
292,
25,
705,
4008,
198,
198,
23350,
62,
2934,
62,
13276,
796,
10571,
1635,
657,
13,
1314,
198,
23350,
62,
2934,
62,
67,
4448,
796,
2566,
292,
1635,
3126,
198,
198,
23350,
62,
64,
62,
79,
32452,
796,
2472,
62,
2934,
62,
67,
4448,
1343,
2472,
62,
2934,
62,
13276,
198,
198,
4798,
7,
69,
470,
4997,
257,
279,
32452,
304,
25,
1391,
23350,
62,
64,
62,
79,
32452,
92,
371,
3,
11537,
628,
198
] | 2.25 | 100 |
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines
| [
2,
16529,
35937,
201,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
201,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
201,
198,
2,
5964,
1321,
13,
201,
198,
2,
201,
198,
2,
6127,
7560,
416,
5413,
357,
49,
8,
11160,
19452,
6127,
35986,
13,
201,
198,
2,
19179,
743,
2728,
11491,
4069,
290,
481,
307,
2626,
611,
262,
2438,
318,
201,
198,
2,
16935,
515,
13,
201,
198,
2,
16529,
35937,
201,
198,
2,
279,
2645,
600,
25,
15560,
28,
18820,
12,
21834,
12,
6615,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 2.5 | 266 |
from VarEvents import Property
from VarEvents import Var
from time import sleep
from xml.dom import minidom
class Climate(object):
"""
This class handles the ISY climate module.
| parent: ISY class
| xml: String of xml data containing the climate data
:ivar Gust_Speed: Watched Variable representing the gust speed.
:ivar Temperature: Watched Variable representing the temperature.
:ivar Temperature_Rate: Watched Variable representing the temperature rate.
:ivar Rain_Rate: Watched Variable representing the rain rate.
:ivar Max_Rain_Rate: Watched Variable representing the rain rate.
:ivar Temperature_High: Watched Variable representing the high temperature.
:ivar Pressure_Rate: Watched variable representing the pressure rate.
:ivar Wind_Speed: Watched Variable representing the wind speed.
:ivar Elevation: Watched Variable representing the elevation.
:ivar Dew_Point: Watched Variable representing the dew point.
:ivar Wind_Average_Speed: Watched Variable representing the avg wind speed.
:ivar Pressure: Watched Variable representing the pressure.
:ivar Gust_Direction: Watched Variable representing the gust direction.
:ivar Wind_Average_Direction: Watched Variable representing the average wind
direction.
:ivar Light: Watched Variable representing the amount of light.
:ivar Wind_Direction: Watched Variable representing the wind direction.
:ivar Humidity: Watched Variable representing the humidity.
:ivar Humidity_Rate: Watched Variable representing the humidity rate.
:ivar Rain_Today: Watched Variable representing the forcast rain today.
:ivar Light_Rate: Watched Variable representing the light rate.
:ivar Water_Deficit_Yesterday: Watched Variable representing the water
deficit yesterday.
:ivar Irrigation_Requirement: Watched Variable representing the irrigation
requirement.
:ivar Feels_Like: Watched Variable representing the feels like temperature.
:ivar Temperature_Low: Watched Variable representing the low temperature.
:ivar Evapotranspiration: Watched Variable representing the
evapotranspiration amount.
:ivar Gust_Speed_units: Gust speed units.
:ivar Temperature_units: Temperature units.
:ivar Temperature_Rate_units: Temperature rate units.
:ivar Rain_Rate_units: Rain rate units.
:ivar Max_Rain_Rate_units: Max rain rate units.
:ivar Temperature_High_units: High temperature units.
:ivar Pressure_Rate_units: Pressure rate units.
:ivar Wind_Speed_units: Wind speed units.
:ivar Elevation_units: Elevation units.
:ivar Dew_Point_units: Dew point units.
:ivar Wind_Average_Speed_units: Average wind speed units.
:ivar Pressure_units: Pressure units.
:ivar Gust_Direction_units: Gust direction units.
:ivar Wind_Average_Direction_units: Average wind direction units.
:ivar Light_units: Light amount units.
:ivar Wind_Direction_units: Wind direction units.
:ivar Humidity_units: Humidity units.
:ivar Humidity_Rate_units: Humidity rate units.
:ivar Rain_Today_units: Rain forecast units.
:ivar Light_Rate_units: Light rate units.
:ivar Water_Deficit_Yesterday_units: Water deficit units.
:ivar Irrigation_Requirement_units: Irrigation requirement units.
:ivar Feels_Like_units: Feels like temperature units.
:ivar Temperature_Low_units: Low temperature units.
:ivar Evapotranspiration_units: Evapotranspiration units.
"""
# Values
_id2name = ['Temperature', 'Temperature_High', 'Temperature_Low',
'Feels_Like', 'Temperature_Average', 'Humidity', None,
'Pressure', None, 'Dew_Point', 'Wind_Speed', None,
'Wind_Direction', None, 'Gust_Speed', None, 'Total_Rain_Today',
'Light', None, None, None, 'Evapotranspiration',
'Irrigation_Requirement', 'Water_Deficit_Yesterday',
'Elevation', None, None, None, None,
'Average_Temperature_Tomorrow', 'High_Temperature_Tomorrow',
'Low_Temperature_Tomorrow', 'Humidity_Tomorrow',
'Wind_Speed_Tomorrow', 'Gust_Speed_Tomorrow', 'Rain_Tomorrow',
'Snow_Tomorrow', None, None, None, None,
'Forecast_Average_Temperature', 'Forecast_High_Temperature',
'Forecast_Low_Temperature', 'Forecast_Humidity',
'Forecast_Rain', 'Forecast_Snow', None, None, None, None]
# value properties
Temperature = Property(0, readonly=True)
Temperature_High = Property(0, readonly=True)
Temperature_Low = Property(0, readonly=True)
Feels_Like = Property(0, readonly=True)
Temperature_Average = Property(0, readonly=True)
Humidity = Property(0, readonly=True)
Pressure = Property(0, readonly=True)
Dew_Point = Property(0, readonly=True)
Wind_Speed = Property(0, readonly=True)
Wind_Direction = Property(0, readonly=True)
Gust_Speed = Property(0, readonly=True)
Total_Rain_Today = Property(0, readonly=True)
Light = Property(0, readonly=True)
Evapotranspiration = Property(0, readonly=True)
Irrigation_Requirement = Property(0, readonly=True)
Water_Deficit_Yesterday = Property(0, readonly=True)
Elevation = Property(0, readonly=True)
# Coverage = Property(0, readonly=True)
# Intensity = Property(0, readonly=True)
# Weather_Condition = Property(0, readonly=True)
# Cloud_Condition = Property(0, readonly=True)
Average_Temperature_Tomorrow = Property(0, readonly=True)
High_Temperature_Tomorrow = Property(0, readonly=True)
Low_Temperature_Tomorrow = Property(0, readonly=True)
Humidity_Tomorrow = Property(0, readonly=True)
Wind_Speed_Tomorrow = Property(0, readonly=True)
Gust_Speed_Tomorrow = Property(0, readonly=True)
Rain_Tomorrow = Property(0, readonly=True)
Snow_Tomorrow = Property(0, readonly=True)
# Coverage_Tomorrow = Property(0, readonly=True)
# Intensity_Tomorrow = Property(0, readonly=True)
# Weather_Condition_Tomorrow = Property(0, readonly=True)
# Cloud_Condition_Tomorrow = Property(0, readonly=True)
Forecast_Average_Temperature = Property(0, readonly=True)
Forecast_High_Temperature = Property(0, readonly=True)
Forecast_Low_Temperature = Property(0, readonly=True)
Forecast_Humidity = Property(0, readonly=True)
Forecast_Rain = Property(0, readonly=True)
Forecast_Snow = Property(0, readonly=True)
# Forecast_Coverage = Property(0, readonly=True)
# Forecast_Intensity = Property(0, readonly=True)
# Forecast_Weather_Condition = Property(0, readonly=True)
# Forecast_Cloud_Condition = Property(0, readonly=True)
# unit properties
Temperature_units = ''
Temperature_High_units = ''
Temperature_Low_units = ''
Feels_Like_units = ''
Temperature_Average_units = ''
Humidity_units = ''
Pressure_units = ''
Dew_Point_units = ''
Wind_Speed_units = ''
Wind_Direction_units = ''
Gust_Speed_units = ''
Total_Rain_Today_units = ''
Light_units = ''
Evapotranspiration_units = ''
Irrigation_Requirement_units = ''
Water_Deficit_Yesterday_units = ''
Elevation_units = ''
# Coverage_units = ''
# Intensity_units = ''
# Weather_Condition_units = ''
# Cloud_Condition_units = ''
Average_Temperature_Tomorrow_units = ''
High_Temperature_Tomorrow_units = ''
Low_Temperature_Tomorrow_units = ''
Humidity_Tomorrow_units = ''
Wind_Speed_Tomorrow_units = ''
Gust_Speed_Tomorrow_units = ''
Rain_Tomorrow_units = ''
Snow_Tomorrow_units = ''
# Coverage_Tomorrow_units = ''
# Intensity_Tomorrow_units = ''
# Weather_Condition_Tomorrow_units = ''
# Cloud_Condition_Tomorrow_units = ''
Forecast_Average_Temperature_units = ''
Forecast_High_Temperature_units = ''
Forecast_Low_Temperature_units = ''
Forecast_Humidity_units = ''
Forecast_Rain_units = ''
Forecast_Snow_units = ''
# Forecast_Coverage_units = ''
# Forecast_Intensity_units = ''
# Forecast_Weather_Condition_units = ''
# Forecast_Cloud_Condition_units = ''
def __str__(self):
""" Returns a string representing the climate manager. """
return 'Climate Module'
def __repr__(self):
""" Returns a long string showing all the climate values. """
out = 'Climate Module\n'
for attr_name in dir(self):
attr = getattr(self, attr_name)
if isinstance(attr, Var):
units = getattr(self, attr_name + '_units')
out += ' ' + attr_name + ' = ' + str(attr) \
+ ' ' + units + '\n'
return out
def parse(self, xml):
"""
Parses the xml data.
xml: String of the xml data
"""
try:
xmldoc = minidom.parseString(xml)
except:
self.parent.log.error('ISY Could not parse climate, poorly '
+ 'formatted XML.')
else:
# parse definitions
feature = xmldoc.getElementsByTagName('climate')[0]
for node in feature.childNodes:
(val, unit) = self._parse_val(node.firstChild.toxml())
name = node.nodeName
try:
prop = getattr(self, name)
prop.update(val, force=True, silent=True)
setattr(self, name + '_units', unit)
except:
pass
self.parent.log.info('ISY Loaded Environment Data')
def update(self, waitTime=0):
"""
Updates the contents of the climate class
waitTime: [optional] Amount of seconds to wait before updating
"""
sleep(waitTime)
xml = self.parent.conn.getClimate()
self.parse(xml)
| [
6738,
12372,
37103,
1330,
14161,
201,
198,
6738,
12372,
37103,
1330,
12372,
201,
198,
6738,
640,
1330,
3993,
201,
198,
6738,
35555,
13,
3438,
1330,
949,
312,
296,
201,
198,
201,
198,
201,
198,
4871,
13963,
7,
15252,
2599,
201,
198,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
770,
1398,
17105,
262,
3180,
56,
4258,
8265,
13,
201,
198,
201,
198,
220,
220,
220,
930,
220,
2560,
25,
3180,
56,
1398,
201,
198,
220,
220,
220,
930,
220,
35555,
25,
10903,
286,
35555,
1366,
7268,
262,
4258,
1366,
201,
198,
201,
198,
220,
220,
220,
1058,
452,
283,
26657,
62,
22785,
25,
12242,
1740,
35748,
10200,
262,
35253,
2866,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
34467,
25,
12242,
1740,
35748,
10200,
262,
5951,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
34467,
62,
32184,
25,
12242,
1740,
35748,
10200,
262,
5951,
2494,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
10301,
62,
32184,
25,
12242,
1740,
35748,
10200,
262,
6290,
2494,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
5436,
62,
31443,
62,
32184,
25,
12242,
1740,
35748,
10200,
262,
6290,
2494,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
34467,
62,
11922,
25,
12242,
1740,
35748,
10200,
262,
1029,
5951,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
30980,
62,
32184,
25,
12242,
1740,
7885,
10200,
262,
3833,
2494,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
3086,
62,
22785,
25,
12242,
1740,
35748,
10200,
262,
2344,
2866,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
37881,
341,
25,
12242,
1740,
35748,
10200,
262,
22910,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
25075,
62,
12727,
25,
12242,
1740,
35748,
10200,
262,
390,
86,
966,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
3086,
62,
26287,
62,
22785,
25,
12242,
1740,
35748,
10200,
262,
42781,
2344,
2866,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
30980,
25,
12242,
1740,
35748,
10200,
262,
3833,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
26657,
62,
35,
4154,
25,
12242,
1740,
35748,
10200,
262,
35253,
4571,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
3086,
62,
26287,
62,
35,
4154,
25,
12242,
1740,
35748,
10200,
262,
2811,
2344,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4571,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
4401,
25,
12242,
1740,
35748,
10200,
262,
2033,
286,
1657,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
3086,
62,
35,
4154,
25,
12242,
1740,
35748,
10200,
262,
2344,
4571,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
11054,
17995,
25,
12242,
1740,
35748,
10200,
262,
27716,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
11054,
17995,
62,
32184,
25,
12242,
1740,
35748,
10200,
262,
27716,
2494,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
10301,
62,
8888,
25,
12242,
1740,
35748,
10200,
262,
329,
2701,
6290,
1909,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
4401,
62,
32184,
25,
12242,
1740,
35748,
10200,
262,
1657,
2494,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
5638,
62,
7469,
3628,
62,
28065,
25,
12242,
1740,
35748,
10200,
262,
1660,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11807,
7415,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
5686,
4359,
341,
62,
16844,
24615,
25,
12242,
1740,
35748,
10200,
262,
35425,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9079,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
5452,
1424,
62,
7594,
25,
12242,
1740,
35748,
10200,
262,
5300,
588,
5951,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
34467,
62,
20535,
25,
12242,
1740,
35748,
10200,
262,
1877,
5951,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
4319,
499,
313,
26084,
10514,
25,
12242,
1740,
35748,
10200,
262,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
819,
499,
313,
26084,
10514,
2033,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
26657,
62,
22785,
62,
41667,
25,
26657,
2866,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
34467,
62,
41667,
25,
34467,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
34467,
62,
32184,
62,
41667,
25,
34467,
2494,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
10301,
62,
32184,
62,
41667,
25,
10301,
2494,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
5436,
62,
31443,
62,
32184,
62,
41667,
25,
5436,
6290,
2494,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
34467,
62,
11922,
62,
41667,
25,
3334,
5951,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
30980,
62,
32184,
62,
41667,
25,
30980,
2494,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
3086,
62,
22785,
62,
41667,
25,
3086,
2866,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
37881,
341,
62,
41667,
25,
37881,
341,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
25075,
62,
12727,
62,
41667,
25,
25075,
966,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
3086,
62,
26287,
62,
22785,
62,
41667,
25,
13475,
2344,
2866,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
30980,
62,
41667,
25,
30980,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
26657,
62,
35,
4154,
62,
41667,
25,
26657,
4571,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
3086,
62,
26287,
62,
35,
4154,
62,
41667,
25,
13475,
2344,
4571,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
4401,
62,
41667,
25,
4401,
2033,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
3086,
62,
35,
4154,
62,
41667,
25,
3086,
4571,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
11054,
17995,
62,
41667,
25,
11054,
17995,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
11054,
17995,
62,
32184,
62,
41667,
25,
11054,
17995,
2494,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
10301,
62,
8888,
62,
41667,
25,
10301,
11092,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
4401,
62,
32184,
62,
41667,
25,
4401,
2494,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
5638,
62,
7469,
3628,
62,
28065,
62,
41667,
25,
5638,
11807,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
5686,
4359,
341,
62,
16844,
24615,
62,
41667,
25,
5686,
4359,
341,
9079,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
5452,
1424,
62,
7594,
62,
41667,
25,
5452,
1424,
588,
5951,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
34467,
62,
20535,
62,
41667,
25,
7754,
5951,
4991,
13,
201,
198,
220,
220,
220,
1058,
452,
283,
4319,
499,
313,
26084,
10514,
62,
41667,
25,
4319,
499,
313,
26084,
10514,
4991,
13,
201,
198,
220,
220,
220,
37227,
201,
198,
201,
198,
220,
220,
220,
1303,
27068,
201,
198,
220,
220,
220,
4808,
312,
17,
3672,
796,
37250,
42492,
3256,
705,
42492,
62,
11922,
3256,
705,
42492,
62,
20535,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
14304,
1424,
62,
7594,
3256,
705,
42492,
62,
26287,
3256,
705,
32661,
17995,
3256,
6045,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
13800,
495,
3256,
6045,
11,
705,
35,
413,
62,
12727,
3256,
705,
8731,
62,
22785,
3256,
6045,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8731,
62,
35,
4154,
3256,
6045,
11,
705,
38,
436,
62,
22785,
3256,
6045,
11,
705,
14957,
62,
31443,
62,
8888,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
15047,
3256,
6045,
11,
6045,
11,
6045,
11,
705,
15200,
499,
313,
26084,
10514,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
23820,
4359,
341,
62,
16844,
24615,
3256,
705,
19184,
62,
7469,
3628,
62,
28065,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
36,
2768,
341,
3256,
6045,
11,
6045,
11,
6045,
11,
6045,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
26287,
62,
42492,
62,
49488,
3256,
705,
11922,
62,
42492,
62,
49488,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
20535,
62,
42492,
62,
49488,
3256,
705,
32661,
17995,
62,
49488,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8731,
62,
22785,
62,
49488,
3256,
705,
38,
436,
62,
22785,
62,
49488,
3256,
705,
31443,
62,
49488,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
28974,
62,
49488,
3256,
6045,
11,
6045,
11,
6045,
11,
6045,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
16351,
2701,
62,
26287,
62,
42492,
3256,
705,
16351,
2701,
62,
11922,
62,
42492,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
16351,
2701,
62,
20535,
62,
42492,
3256,
705,
16351,
2701,
62,
32661,
17995,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
16351,
2701,
62,
31443,
3256,
705,
16351,
2701,
62,
28974,
3256,
6045,
11,
6045,
11,
6045,
11,
6045,
60,
201,
198,
201,
198,
220,
220,
220,
1303,
1988,
6608,
201,
198,
220,
220,
220,
34467,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
34467,
62,
11922,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
34467,
62,
20535,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
5452,
1424,
62,
7594,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
34467,
62,
26287,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
11054,
17995,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
30980,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
25075,
62,
12727,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
3086,
62,
22785,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
3086,
62,
35,
4154,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
26657,
62,
22785,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
7472,
62,
31443,
62,
8888,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
4401,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
4319,
499,
313,
26084,
10514,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
5686,
4359,
341,
62,
16844,
24615,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
5638,
62,
7469,
3628,
62,
28065,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
37881,
341,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
33998,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
2558,
6377,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
15615,
62,
48362,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
10130,
62,
48362,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
13475,
62,
42492,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
3334,
62,
42492,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
7754,
62,
42492,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
11054,
17995,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
3086,
62,
22785,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
26657,
62,
22785,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
10301,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
7967,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
33998,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
2558,
6377,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
15615,
62,
48362,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
10130,
62,
48362,
62,
49488,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
4558,
2701,
62,
26287,
62,
42492,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
4558,
2701,
62,
11922,
62,
42492,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
4558,
2701,
62,
20535,
62,
42492,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
4558,
2701,
62,
32661,
17995,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
4558,
2701,
62,
31443,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
4558,
2701,
62,
28974,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
4558,
2701,
62,
7222,
1857,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
4558,
2701,
62,
5317,
6377,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
4558,
2701,
62,
41865,
62,
48362,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
220,
220,
220,
1303,
4558,
2701,
62,
18839,
62,
48362,
796,
14161,
7,
15,
11,
1100,
8807,
28,
17821,
8,
201,
198,
201,
198,
220,
220,
220,
1303,
4326,
6608,
201,
198,
220,
220,
220,
34467,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
34467,
62,
11922,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
34467,
62,
20535,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
5452,
1424,
62,
7594,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
34467,
62,
26287,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
11054,
17995,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
30980,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
25075,
62,
12727,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
3086,
62,
22785,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
3086,
62,
35,
4154,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
26657,
62,
22785,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
7472,
62,
31443,
62,
8888,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
4401,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
4319,
499,
313,
26084,
10514,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
5686,
4359,
341,
62,
16844,
24615,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
5638,
62,
7469,
3628,
62,
28065,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
37881,
341,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
33998,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
2558,
6377,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
15615,
62,
48362,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
10130,
62,
48362,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
13475,
62,
42492,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
3334,
62,
42492,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
7754,
62,
42492,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
11054,
17995,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
3086,
62,
22785,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
26657,
62,
22785,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
10301,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
7967,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
33998,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
2558,
6377,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
15615,
62,
48362,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
10130,
62,
48362,
62,
49488,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
4558,
2701,
62,
26287,
62,
42492,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
4558,
2701,
62,
11922,
62,
42492,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
4558,
2701,
62,
20535,
62,
42492,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
4558,
2701,
62,
32661,
17995,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
4558,
2701,
62,
31443,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
4558,
2701,
62,
28974,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
4558,
2701,
62,
7222,
1857,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
4558,
2701,
62,
5317,
6377,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
4558,
2701,
62,
41865,
62,
48362,
62,
41667,
796,
10148,
201,
198,
220,
220,
220,
1303,
4558,
2701,
62,
18839,
62,
48362,
62,
41667,
796,
10148,
201,
198,
201,
198,
220,
220,
220,
825,
11593,
2536,
834,
7,
944,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16409,
257,
4731,
10200,
262,
4258,
4706,
13,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
705,
37649,
19937,
6,
201,
198,
201,
198,
220,
220,
220,
825,
11593,
260,
1050,
834,
7,
944,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16409,
257,
890,
4731,
4478,
477,
262,
4258,
3815,
13,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
503,
796,
705,
37649,
19937,
59,
77,
6,
201,
198,
220,
220,
220,
220,
220,
220,
220,
329,
708,
81,
62,
3672,
287,
26672,
7,
944,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
708,
81,
796,
651,
35226,
7,
944,
11,
708,
81,
62,
3672,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
35226,
11,
12372,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4991,
796,
651,
35226,
7,
944,
11,
708,
81,
62,
3672,
1343,
705,
62,
41667,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
503,
15853,
705,
220,
705,
1343,
708,
81,
62,
3672,
1343,
705,
796,
705,
1343,
965,
7,
35226,
8,
3467,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1343,
705,
705,
1343,
4991,
1343,
705,
59,
77,
6,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
503,
201,
198,
201,
198,
220,
220,
220,
825,
21136,
7,
944,
11,
35555,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
23042,
274,
262,
35555,
1366,
13,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
35555,
25,
10903,
286,
262,
35555,
1366,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
76,
335,
420,
796,
949,
312,
296,
13,
29572,
10100,
7,
19875,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
8000,
13,
6404,
13,
18224,
10786,
1797,
56,
10347,
407,
21136,
4258,
11,
13455,
705,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1343,
705,
687,
16898,
23735,
2637,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
21136,
17336,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3895,
796,
2124,
76,
335,
420,
13,
1136,
36,
3639,
3886,
24835,
5376,
10786,
42570,
11537,
58,
15,
60,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
10139,
287,
3895,
13,
9410,
45,
4147,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
2100,
11,
4326,
8,
796,
2116,
13557,
29572,
62,
2100,
7,
17440,
13,
11085,
16424,
13,
83,
1140,
4029,
28955,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
10139,
13,
17440,
5376,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
796,
651,
35226,
7,
944,
11,
1438,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
13,
19119,
7,
2100,
11,
2700,
28,
17821,
11,
10574,
28,
17821,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
900,
35226,
7,
944,
11,
1438,
1343,
705,
62,
41667,
3256,
4326,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
8000,
13,
6404,
13,
10951,
10786,
1797,
56,
42485,
9344,
6060,
11537,
201,
198,
201,
198,
220,
220,
220,
825,
4296,
7,
944,
11,
4043,
7575,
28,
15,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
28090,
262,
10154,
286,
262,
4258,
1398,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4043,
7575,
25,
685,
25968,
60,
26308,
286,
4201,
284,
4043,
878,
19698,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3993,
7,
17077,
7575,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
35555,
796,
2116,
13,
8000,
13,
37043,
13,
1136,
37649,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29572,
7,
19875,
8,
201,
198
] | 2.53173 | 4,034 |
from PySide2.QtCore import Qt, Slot, QDir, QSettings
from PySide2.QtWidgets import QApplication, QMainWindow, QWidget, QAction, QPushButton, QFileDialog, QInputDialog, \
QLineEdit, QHBoxLayout, QVBoxLayout, QLabel
import sys
if __name__ == "__main__":
app = QApplication(sys.argv)
widget = Application()
window = MainWindow(widget)
window.resize(800, 600)
window.show()
sys.exit(app.exec_())
| [
6738,
9485,
24819,
17,
13,
48,
83,
14055,
1330,
33734,
11,
32026,
11,
1195,
35277,
11,
1195,
26232,
198,
6738,
9485,
24819,
17,
13,
48,
83,
54,
312,
11407,
1330,
1195,
23416,
11,
1195,
13383,
27703,
11,
1195,
38300,
11,
1195,
12502,
11,
1195,
49222,
21864,
11,
1195,
8979,
44204,
11,
1195,
20560,
44204,
11,
3467,
198,
220,
220,
220,
1195,
13949,
18378,
11,
1195,
39,
14253,
32517,
11,
1195,
53,
14253,
32517,
11,
1195,
33986,
198,
198,
11748,
25064,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
598,
796,
1195,
23416,
7,
17597,
13,
853,
85,
8,
198,
220,
220,
220,
26295,
796,
15678,
3419,
198,
220,
220,
220,
4324,
796,
8774,
27703,
7,
42655,
8,
198,
220,
220,
220,
4324,
13,
411,
1096,
7,
7410,
11,
10053,
8,
198,
220,
220,
220,
4324,
13,
12860,
3419,
198,
220,
220,
220,
25064,
13,
37023,
7,
1324,
13,
18558,
62,
28955,
198
] | 2.639752 | 161 |
from __future__ import division
from __future__ import absolute_import
# PopulationSim
# See full license in LICENSE.txt.
import logging
import pandas as pd
import numpy as np
from activitysim.core import pipeline
from activitysim.core import inject
from activitysim.core.config import setting
from .helper import get_control_table
from .helper import get_weight_table
from .helper import weight_table_name
logger = logging.getLogger(__name__)
@inject.step()
def expand_households():
"""
Create a complete expanded synthetic household list with their assigned geographic zone ids.
This is the skeleton synthetic household id list with no household or person attributes,
one row per household, with geography columns and seed household table household_id.
Creates pipeline table expanded_household_ids
"""
if setting('NO_INTEGERIZATION_EVER', False):
logger.warning("skipping expand_households: NO_INTEGERIZATION_EVER")
inject.add_table('expanded_household_ids', pd.DataFrame())
return
geographies = setting('geographies')
household_id_col = setting('household_id_col')
low_geography = geographies[-1]
# only one we really need is low_geography
seed_geography = setting('seed_geography')
geography_cols = geographies[geographies.index(seed_geography):]
weights = get_weight_table(low_geography, sparse=True)
weights = weights[geography_cols + [household_id_col, 'integer_weight']]
# - expand weights table by integer_weight, so there is one row per desired hh
weight_cols = weights.columns.values
weights_np = np.repeat(weights.values, weights.integer_weight.values, axis=0)
expanded_weights = pd.DataFrame(data=weights_np, columns=weight_cols)
if setting('GROUP_BY_INCIDENCE_SIGNATURE'):
# the household_id_col is really the group_id
expanded_weights.rename(columns={household_id_col: 'group_id'}, inplace=True)
# the original incidence table with one row per hh, with index hh_id
household_groups = pipeline.get_table('household_groups')
household_groups = household_groups[[household_id_col, 'group_id', 'sample_weight']]
# for each group, lists of hh_ids and their sample_weights (as relative probabiliities)
# [ [ [<group_0_hh_id_list>], [<group_0_hh_prob_list>] ],
# [ [<group_1_hh_id_list>], [<group_1_hh_prob_list>] ], ... ]
HH_IDS = 0
HH_PROBS = 1
grouper = household_groups.groupby('group_id')
group_hh_probs = [0] * len(grouper)
for group_id, df in grouper:
hh_ids = list(df[household_id_col])
probs = list(df.sample_weight / df.sample_weight.sum())
group_hh_probs[group_id] = [hh_ids, probs]
# FIXME - should sample without replacement?
# now make a hh_id choice for each group_id in expanded_weights
expanded_weights[household_id_col] = \
expanded_weights.group_id.apply(chooser, convert_dtype=True,)
# FIXME - omit in production?
del expanded_weights['group_id']
del expanded_weights['integer_weight']
append = inject.get_step_arg('append', False)
replace = inject.get_step_arg('replace', False)
assert not (append and replace), "can't specify both append and replace for expand_households"
if append or replace:
t = inject.get_table('expanded_household_ids').to_frame()
prev_hhs = len(t.index)
added_hhs = len(expanded_weights.index)
if replace:
# FIXME - should really get from crosswalk table?
low_ids_to_replace = expanded_weights[low_geography].unique()
t = t[~t[low_geography].isin(low_ids_to_replace)]
expanded_weights = pd.concat([t, expanded_weights], ignore_index=True)
dropped_hhs = prev_hhs - len(t.index)
final_hhs = len(expanded_weights.index)
op = 'append' if append else 'replace'
logger.info("expand_households op: %s prev hh count %s dropped %s added %s final %s" %
(op, prev_hhs, dropped_hhs, added_hhs, final_hhs))
repop = inject.get_step_arg('repop', default=False)
inject.add_table('expanded_household_ids', expanded_weights, replace=repop)
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
2,
20133,
8890,
198,
2,
4091,
1336,
5964,
287,
38559,
24290,
13,
14116,
13,
198,
198,
11748,
18931,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
3842,
14323,
13,
7295,
1330,
11523,
198,
6738,
3842,
14323,
13,
7295,
1330,
8677,
198,
198,
6738,
3842,
14323,
13,
7295,
13,
11250,
1330,
4634,
198,
6738,
764,
2978,
525,
1330,
651,
62,
13716,
62,
11487,
198,
6738,
764,
2978,
525,
1330,
651,
62,
6551,
62,
11487,
198,
198,
6738,
764,
2978,
525,
1330,
3463,
62,
11487,
62,
3672,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
31,
259,
752,
13,
9662,
3419,
198,
4299,
4292,
62,
4803,
2946,
82,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13610,
257,
1844,
9902,
18512,
6641,
1351,
351,
511,
8686,
22987,
6516,
220,
2340,
13,
628,
220,
220,
220,
770,
318,
262,
18328,
18512,
6641,
4686,
1351,
351,
645,
6641,
393,
1048,
12608,
11,
198,
220,
220,
220,
530,
5752,
583,
6641,
11,
351,
27876,
15180,
290,
9403,
6641,
3084,
6641,
62,
312,
13,
628,
220,
220,
220,
7921,
274,
11523,
3084,
9902,
62,
4803,
2946,
62,
2340,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
611,
4634,
10786,
15285,
62,
12394,
7156,
1137,
14887,
6234,
62,
36,
5959,
3256,
10352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
43917,
7203,
20545,
2105,
4292,
62,
4803,
2946,
82,
25,
8005,
62,
12394,
7156,
1137,
14887,
6234,
62,
36,
5959,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
8677,
13,
2860,
62,
11487,
10786,
11201,
12249,
62,
4803,
2946,
62,
2340,
3256,
279,
67,
13,
6601,
19778,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
628,
220,
220,
220,
4903,
41480,
796,
4634,
10786,
469,
41480,
11537,
198,
220,
220,
220,
6641,
62,
312,
62,
4033,
796,
4634,
10786,
4803,
2946,
62,
312,
62,
4033,
11537,
628,
220,
220,
220,
1877,
62,
469,
4867,
796,
4903,
41480,
58,
12,
16,
60,
628,
220,
220,
220,
1303,
691,
530,
356,
1107,
761,
318,
1877,
62,
469,
4867,
198,
220,
220,
220,
9403,
62,
469,
4867,
796,
4634,
10786,
28826,
62,
469,
4867,
11537,
198,
220,
220,
220,
27876,
62,
4033,
82,
796,
4903,
41480,
58,
469,
41480,
13,
9630,
7,
28826,
62,
469,
4867,
2599,
60,
628,
220,
220,
220,
19590,
796,
651,
62,
6551,
62,
11487,
7,
9319,
62,
469,
4867,
11,
29877,
28,
17821,
8,
198,
220,
220,
220,
19590,
796,
19590,
58,
469,
4867,
62,
4033,
82,
1343,
685,
4803,
2946,
62,
312,
62,
4033,
11,
705,
41433,
62,
6551,
6,
11907,
628,
220,
220,
220,
1303,
532,
4292,
19590,
3084,
416,
18253,
62,
6551,
11,
523,
612,
318,
530,
5752,
583,
10348,
289,
71,
198,
220,
220,
220,
3463,
62,
4033,
82,
796,
19590,
13,
28665,
82,
13,
27160,
198,
220,
220,
220,
19590,
62,
37659,
796,
45941,
13,
44754,
7,
43775,
13,
27160,
11,
19590,
13,
41433,
62,
6551,
13,
27160,
11,
16488,
28,
15,
8,
198,
220,
220,
220,
9902,
62,
43775,
796,
279,
67,
13,
6601,
19778,
7,
7890,
28,
43775,
62,
37659,
11,
15180,
28,
6551,
62,
4033,
82,
8,
628,
220,
220,
220,
611,
4634,
10786,
46846,
62,
17513,
62,
30158,
2389,
18310,
62,
46224,
40086,
6,
2599,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
262,
6641,
62,
312,
62,
4033,
318,
1107,
262,
1448,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
9902,
62,
43775,
13,
918,
480,
7,
28665,
82,
34758,
4803,
2946,
62,
312,
62,
4033,
25,
705,
8094,
62,
312,
6,
5512,
287,
5372,
28,
17821,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
262,
2656,
18349,
3084,
351,
530,
5752,
583,
289,
71,
11,
351,
6376,
289,
71,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
6641,
62,
24432,
796,
11523,
13,
1136,
62,
11487,
10786,
4803,
2946,
62,
24432,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
6641,
62,
24432,
796,
6641,
62,
24432,
30109,
4803,
2946,
62,
312,
62,
4033,
11,
705,
8094,
62,
312,
3256,
705,
39873,
62,
6551,
6,
11907,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
329,
1123,
1448,
11,
8341,
286,
289,
71,
62,
2340,
290,
511,
6291,
62,
43775,
357,
292,
3585,
1861,
397,
2403,
871,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
685,
685,
685,
27,
8094,
62,
15,
62,
12337,
62,
312,
62,
4868,
29,
4357,
685,
27,
8094,
62,
15,
62,
12337,
62,
1676,
65,
62,
4868,
37981,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
685,
685,
27,
8094,
62,
16,
62,
12337,
62,
312,
62,
4868,
29,
4357,
685,
27,
8094,
62,
16,
62,
12337,
62,
1676,
65,
62,
4868,
37981,
16589,
2644,
2361,
198,
220,
220,
220,
220,
220,
220,
220,
47138,
62,
14255,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
47138,
62,
31190,
4462,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
1132,
525,
796,
6641,
62,
24432,
13,
8094,
1525,
10786,
8094,
62,
312,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
62,
12337,
62,
1676,
1443,
796,
685,
15,
60,
1635,
18896,
7,
70,
472,
525,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1448,
62,
312,
11,
47764,
287,
1132,
525,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
289,
71,
62,
2340,
796,
1351,
7,
7568,
58,
4803,
2946,
62,
312,
62,
4033,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
386,
1443,
796,
1351,
7,
7568,
13,
39873,
62,
6551,
1220,
47764,
13,
39873,
62,
6551,
13,
16345,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1448,
62,
12337,
62,
1676,
1443,
58,
8094,
62,
312,
60,
796,
685,
12337,
62,
2340,
11,
386,
1443,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
532,
815,
6291,
1231,
9014,
30,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
783,
787,
257,
289,
71,
62,
312,
3572,
329,
1123,
1448,
62,
312,
287,
9902,
62,
43775,
198,
220,
220,
220,
220,
220,
220,
220,
9902,
62,
43775,
58,
4803,
2946,
62,
312,
62,
4033,
60,
796,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9902,
62,
43775,
13,
8094,
62,
312,
13,
39014,
7,
6679,
13416,
11,
10385,
62,
67,
4906,
28,
17821,
35751,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
532,
42848,
287,
3227,
30,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
9902,
62,
43775,
17816,
8094,
62,
312,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
9902,
62,
43775,
17816,
41433,
62,
6551,
20520,
628,
220,
220,
220,
24443,
796,
8677,
13,
1136,
62,
9662,
62,
853,
10786,
33295,
3256,
10352,
8,
198,
220,
220,
220,
6330,
796,
8677,
13,
1136,
62,
9662,
62,
853,
10786,
33491,
3256,
10352,
8,
198,
220,
220,
220,
6818,
407,
357,
33295,
290,
6330,
828,
366,
5171,
470,
11986,
1111,
24443,
290,
6330,
329,
4292,
62,
4803,
2946,
82,
1,
628,
220,
220,
220,
611,
24443,
393,
6330,
25,
198,
220,
220,
220,
220,
220,
220,
220,
256,
796,
8677,
13,
1136,
62,
11487,
10786,
11201,
12249,
62,
4803,
2946,
62,
2340,
27691,
1462,
62,
14535,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
8654,
62,
71,
11994,
796,
18896,
7,
83,
13,
9630,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2087,
62,
71,
11994,
796,
18896,
7,
11201,
12249,
62,
43775,
13,
9630,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
6330,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
532,
815,
1107,
651,
422,
3272,
11152,
3084,
30,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1877,
62,
2340,
62,
1462,
62,
33491,
796,
9902,
62,
43775,
58,
9319,
62,
469,
4867,
4083,
34642,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
796,
256,
58,
93,
83,
58,
9319,
62,
469,
4867,
4083,
45763,
7,
9319,
62,
2340,
62,
1462,
62,
33491,
15437,
628,
220,
220,
220,
220,
220,
220,
220,
9902,
62,
43775,
796,
279,
67,
13,
1102,
9246,
26933,
83,
11,
9902,
62,
43775,
4357,
8856,
62,
9630,
28,
17821,
8,
628,
220,
220,
220,
220,
220,
220,
220,
5710,
62,
71,
11994,
796,
8654,
62,
71,
11994,
532,
18896,
7,
83,
13,
9630,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2457,
62,
71,
11994,
796,
18896,
7,
11201,
12249,
62,
43775,
13,
9630,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1034,
796,
705,
33295,
6,
611,
24443,
2073,
705,
33491,
6,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
11201,
392,
62,
4803,
2946,
82,
1034,
25,
4064,
82,
8654,
289,
71,
954,
4064,
82,
5710,
4064,
82,
2087,
4064,
82,
2457,
4064,
82,
1,
4064,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
404,
11,
8654,
62,
71,
11994,
11,
5710,
62,
71,
11994,
11,
2087,
62,
71,
11994,
11,
2457,
62,
71,
11994,
4008,
628,
220,
220,
220,
1128,
404,
796,
8677,
13,
1136,
62,
9662,
62,
853,
10786,
7856,
404,
3256,
4277,
28,
25101,
8,
198,
220,
220,
220,
8677,
13,
2860,
62,
11487,
10786,
11201,
12249,
62,
4803,
2946,
62,
2340,
3256,
9902,
62,
43775,
11,
6330,
28,
7856,
404,
8,
198
] | 2.632489 | 1,619 |
import os
import pickle
import os.path
import sys
import torch
import torch.utils.data as data
import torchvision.transforms as transforms
from PIL import Image, ImageDraw, ImageFont
import cv2
import numpy as np
from operator import itemgetter
from skimage.draw import polygon
if sys.version_info[0] == 2:
import xml.etree.cElementTree as ET
else:
import xml.etree.ElementTree as ET
VOC_CLASSES = ( '__background__', # always index 0
'aeroplane', 'bicycle', 'bird', 'boat',
'bottle', 'bus', 'car', 'cat', 'chair',
'cow', 'diningtable', 'dog', 'horse',
'motorbike', 'person', 'pottedplant',
'sheep', 'sofa', 'train', 'tvmonitor')
VOC_CLASSES = ( '__background__', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20')
# for making bounding boxes pretty
COLORS = ((255, 0, 0, 128), (0, 255, 0, 128), (0, 0, 255, 128),
(0, 255, 255, 128), (255, 0, 255, 128), (255, 255, 0, 128))
class AnnotationTransform(object):
"""Transforms a VOC annotation into a Tensor of bbox coords and label index
Initilized with a dictionary lookup of classnames to indexes
Arguments:
class_to_ind (dict, optional): dictionary lookup of classnames -> indexes
(default: alphabetic indexing of VOC's 20 classes)
keep_difficult (bool, optional): keep difficult instances or not
(default: False)
height (int): height
width (int): width
"""
def __call__(self, target):
"""
Arguments:
target (annotation) : the target annotation to be made usable
will be an ET.Element
Returns:
a list containing lists of bounding boxes [bbox coords, class name]
"""
res = np.empty((0,5))
for obj in target.iter('object'):
difficult = int(obj.find('difficult').text) == 1
if not self.keep_difficult and difficult:
continue
name = obj.find('name').text.lower().strip()
bbox = obj.find('bndbox')
pts = ['xmin', 'ymin', 'xmax', 'ymax']
bndbox = []
for i, pt in enumerate(pts):
cur_pt = int(bbox.find(pt).text) - 1
# scale height or width
#cur_pt = cur_pt / width if i % 2 == 0 else cur_pt / height
bndbox.append(cur_pt)
label_idx = self.class_to_ind[name]
bndbox.append(label_idx)
res = np.vstack((res,bndbox)) # [xmin, ymin, xmax, ymax, label_ind]
# img_id = target.find('filename').text[:-4]
return res # [[xmin, ymin, xmax, ymax, label_ind], ... ]
class JACQUARDDetection(data.Dataset):
"""VOC Detection Dataset Object
input is image, target is annotation
Arguments:
root (string): filepath to VOCdevkit folder.
image_set (string): imageset to use (eg. 'train', 'val', 'test')
transform (callable, optional): transformation to perform on the
input image
target_transform (callable, optional): transformation to perform on the
target `annotation`
(eg: take in caption string, return tensor of word indices)
dataset_name (string, optional): which dataset to load
(default: 'VOC2007')
"""
def pull_image(self, index):
'''Returns the original image object at index in PIL form
Note: not using self.__getitem__(), as any transformations passed in
could mess up this functionality.
Argument:
index (int): index of img to show
Return:
PIL img
'''
img_id = self.ids[index]
return cv2.imread(self._imgpath % img_id, cv2.IMREAD_COLOR)
def pull_anno(self, index):
'''Returns the original annotation of image at index
Note: not using self.__getitem__(), as any transformations passed in
could mess up this functionality.
Argument:
index (int): index of img to get annotation of
Return:
list: [img_id, [(label, bbox coords),...]]
eg: ('001718', [('dog', (96, 13, 438, 332))])
'''
img_id = self.ids[index]
anno = ET.parse(self._annopath % img_id).getroot()
# gt = self.target_transform(anno, 1, 1)
# gt = self.target_transform(anno)
# return img_id[1], gt
if self.target_transform is not None:
anno = self.target_transform(anno)
return anno
def pull_img_anno(self, index):
'''Returns the original annotation of image at index
Note: not using self.__getitem__(), as any transformations passed in
could mess up this functionality.
Argument:
index (int): index of img to get annotation of
Return:
list: [img_id, [(label, bbox coords),...]]
eg: ('001718', [('dog', (96, 13, 438, 332))])
'''
img_id = self.ids[index]
img = cv2.imread(self._imgpath % img_id, cv2.IMREAD_COLOR)
anno = ET.parse(self._annopath % img_id).getroot()
gt = self.target_transform(anno)
height, width, _ = img.shape
boxes = gt[:,:-1]
labels = gt[:,-1]
boxes[:, 0::2] /= width
boxes[:, 1::2] /= height
labels = np.expand_dims(labels,1)
targets = np.hstack((boxes,labels))
return img, targets
def pull_tensor(self, index):
'''Returns the original image at an index in tensor form
Note: not using self.__getitem__(), as any transformations passed in
could mess up this functionality.
Argument:
index (int): index of img to show
Return:
tensorized version of img, squeezed
'''
to_tensor = transforms.ToTensor()
return torch.Tensor(self.pull_image(index)).unsqueeze_(0)
def evaluate_detections(self, all_boxes, output_dir=None):
"""
all_boxes is a list of length number-of-classes.
Each list element is a list of length number-of-images.
Each of those list elements is either an empty list []
or a numpy array of detection.
all_boxes[class][image] = [] or np.array of shape #dets x 5
"""
self._write_voc_results_file(all_boxes)
aps,map = self._do_python_eval(output_dir)
return aps,map
def parse_rec(self, filename):
""" Parse a PASCAL VOC xml file """
tree = ET.parse(filename)
objects = []
for obj in tree.findall('object'):
obj_struct = {}
obj_struct['name'] = obj.find('name').text
# obj_struct['pose'] = obj.find('pose').text
obj_struct['truncated'] = int(obj.find('truncated').text)
obj_struct['difficult'] = int(obj.find('difficult').text)
bbox = obj.find('bndbox')
obj_struct['bbox'] = [int(bbox.find('xmin').text),
int(bbox.find('ymin').text),
int(bbox.find('xmax').text),
int(bbox.find('ymax').text)]
objects.append(obj_struct)
return objects
## test
# if __name__ == '__main__':
# ds = VOCDetection('../../../../../dataset/VOCdevkit/', [('2012', 'train')],
# None, AnnotationTransform())
# print(len(ds))
# img, target = ds[0]
# print(target)
# ds.show(1) | [
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
11748,
28034,
198,
11748,
28034,
13,
26791,
13,
7890,
355,
1366,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
11,
7412,
23252,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
6738,
1341,
9060,
13,
19334,
1330,
7514,
14520,
198,
198,
361,
25064,
13,
9641,
62,
10951,
58,
15,
60,
6624,
362,
25,
198,
220,
220,
220,
1330,
35555,
13,
316,
631,
13,
66,
20180,
27660,
355,
12152,
198,
17772,
25,
198,
220,
220,
220,
1330,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
628,
198,
53,
4503,
62,
31631,
1546,
796,
357,
705,
834,
25249,
834,
3256,
1303,
1464,
6376,
657,
198,
220,
220,
220,
705,
25534,
20106,
1531,
3256,
705,
65,
35298,
3256,
705,
16944,
3256,
705,
24482,
3256,
198,
220,
220,
220,
705,
10985,
293,
3256,
705,
10885,
3256,
705,
7718,
3256,
705,
9246,
3256,
705,
16337,
3256,
198,
220,
220,
220,
705,
8232,
3256,
705,
67,
3191,
11487,
3256,
705,
9703,
3256,
705,
30527,
3256,
198,
220,
220,
220,
705,
76,
20965,
32256,
3256,
705,
6259,
3256,
705,
79,
8426,
15060,
3256,
198,
220,
220,
220,
705,
7091,
538,
3256,
705,
568,
13331,
3256,
705,
27432,
3256,
705,
14981,
41143,
11537,
198,
198,
53,
4503,
62,
31631,
1546,
796,
357,
705,
834,
25249,
834,
3256,
705,
16,
3256,
705,
17,
3256,
705,
18,
3256,
705,
19,
3256,
705,
20,
3256,
705,
21,
3256,
705,
22,
3256,
705,
23,
3256,
705,
24,
3256,
705,
940,
3256,
705,
1157,
3256,
705,
1065,
3256,
705,
1485,
3256,
705,
1415,
3256,
705,
1314,
3256,
705,
1433,
3256,
705,
1558,
3256,
705,
1507,
3256,
705,
1129,
3256,
705,
1238,
11537,
198,
198,
2,
329,
1642,
5421,
278,
10559,
2495,
198,
25154,
20673,
796,
14808,
13381,
11,
657,
11,
657,
11,
13108,
828,
357,
15,
11,
14280,
11,
657,
11,
13108,
828,
357,
15,
11,
657,
11,
14280,
11,
13108,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
15,
11,
14280,
11,
14280,
11,
13108,
828,
357,
13381,
11,
657,
11,
14280,
11,
13108,
828,
357,
13381,
11,
14280,
11,
657,
11,
13108,
4008,
628,
198,
4871,
1052,
38983,
41762,
7,
15252,
2599,
628,
220,
220,
220,
37227,
8291,
23914,
257,
569,
4503,
23025,
656,
257,
309,
22854,
286,
275,
3524,
763,
3669,
290,
6167,
6376,
198,
220,
220,
220,
44707,
346,
1143,
351,
257,
22155,
35847,
286,
1398,
14933,
284,
39199,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1398,
62,
1462,
62,
521,
357,
11600,
11,
11902,
2599,
22155,
35847,
286,
1398,
14933,
4613,
39199,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
12286,
25,
435,
746,
33312,
6376,
278,
286,
569,
4503,
338,
1160,
6097,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1394,
62,
26069,
2249,
357,
30388,
11,
11902,
2599,
1394,
2408,
10245,
393,
407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
12286,
25,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6001,
357,
600,
2599,
6001,
198,
220,
220,
220,
220,
220,
220,
220,
9647,
357,
600,
2599,
9647,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
13345,
834,
7,
944,
11,
2496,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2496,
357,
1236,
14221,
8,
1058,
262,
2496,
23025,
284,
307,
925,
24284,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
481,
307,
281,
12152,
13,
20180,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
1351,
7268,
8341,
286,
5421,
278,
10559,
220,
685,
65,
3524,
763,
3669,
11,
1398,
1438,
60,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
581,
796,
45941,
13,
28920,
19510,
15,
11,
20,
4008,
220,
198,
220,
220,
220,
220,
220,
220,
220,
329,
26181,
287,
2496,
13,
2676,
10786,
15252,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2408,
796,
493,
7,
26801,
13,
19796,
10786,
26069,
2249,
27691,
5239,
8,
6624,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
14894,
62,
26069,
2249,
290,
2408,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
26181,
13,
19796,
10786,
3672,
27691,
5239,
13,
21037,
22446,
36311,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
796,
26181,
13,
19796,
10786,
65,
358,
3524,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43344,
796,
37250,
87,
1084,
3256,
705,
88,
1084,
3256,
705,
87,
9806,
3256,
705,
4948,
897,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
358,
3524,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
11,
42975,
287,
27056,
378,
7,
457,
82,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1090,
62,
457,
796,
493,
7,
65,
3524,
13,
19796,
7,
457,
737,
5239,
8,
532,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5046,
6001,
393,
9647,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
22019,
62,
457,
796,
1090,
62,
457,
1220,
9647,
611,
1312,
4064,
362,
6624,
657,
2073,
1090,
62,
457,
1220,
6001,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
358,
3524,
13,
33295,
7,
22019,
62,
457,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
62,
312,
87,
796,
2116,
13,
4871,
62,
1462,
62,
521,
58,
3672,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
358,
3524,
13,
33295,
7,
18242,
62,
312,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
45941,
13,
85,
25558,
19510,
411,
11,
65,
358,
3524,
4008,
220,
1303,
685,
87,
1084,
11,
331,
1084,
11,
2124,
9806,
11,
331,
9806,
11,
6167,
62,
521,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
33705,
62,
312,
796,
2496,
13,
19796,
10786,
34345,
27691,
5239,
58,
21912,
19,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
581,
220,
1303,
16410,
87,
1084,
11,
331,
1084,
11,
2124,
9806,
11,
331,
9806,
11,
6167,
62,
521,
4357,
2644,
2361,
628,
198,
4871,
449,
2246,
10917,
9795,
11242,
3213,
7,
7890,
13,
27354,
292,
316,
2599,
628,
220,
220,
220,
37227,
53,
4503,
46254,
16092,
292,
316,
9515,
628,
220,
220,
220,
5128,
318,
2939,
11,
2496,
318,
23025,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
6808,
357,
8841,
2599,
2393,
6978,
284,
569,
4503,
7959,
15813,
9483,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
2617,
357,
8841,
2599,
4263,
316,
284,
779,
357,
1533,
13,
705,
27432,
3256,
705,
2100,
3256,
705,
9288,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
6121,
357,
13345,
540,
11,
11902,
2599,
13389,
284,
1620,
319,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
2939,
198,
220,
220,
220,
220,
220,
220,
220,
2496,
62,
35636,
357,
13345,
540,
11,
11902,
2599,
13389,
284,
1620,
319,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2496,
4600,
1236,
14221,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
1533,
25,
1011,
287,
8305,
4731,
11,
1441,
11192,
273,
286,
1573,
36525,
8,
198,
220,
220,
220,
220,
220,
220,
220,
27039,
62,
3672,
357,
8841,
11,
11902,
2599,
543,
27039,
284,
3440,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
12286,
25,
705,
53,
4503,
12726,
11537,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
2834,
62,
9060,
7,
944,
11,
6376,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
35561,
262,
2656,
2939,
2134,
379,
6376,
287,
350,
4146,
1296,
628,
220,
220,
220,
220,
220,
220,
220,
5740,
25,
407,
1262,
2116,
13,
834,
1136,
9186,
834,
22784,
355,
597,
38226,
3804,
287,
198,
220,
220,
220,
220,
220,
220,
220,
714,
2085,
510,
428,
11244,
13,
628,
220,
220,
220,
220,
220,
220,
220,
45751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
357,
600,
2599,
6376,
286,
33705,
284,
905,
198,
220,
220,
220,
220,
220,
220,
220,
8229,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
350,
4146,
33705,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
33705,
62,
312,
796,
2116,
13,
2340,
58,
9630,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
269,
85,
17,
13,
320,
961,
7,
944,
13557,
9600,
6978,
4064,
33705,
62,
312,
11,
269,
85,
17,
13,
3955,
15675,
62,
46786,
8,
628,
220,
220,
220,
825,
2834,
62,
1236,
78,
7,
944,
11,
6376,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
35561,
262,
2656,
23025,
286,
2939,
379,
6376,
628,
220,
220,
220,
220,
220,
220,
220,
5740,
25,
407,
1262,
2116,
13,
834,
1136,
9186,
834,
22784,
355,
597,
38226,
3804,
287,
198,
220,
220,
220,
220,
220,
220,
220,
714,
2085,
510,
428,
11244,
13,
628,
220,
220,
220,
220,
220,
220,
220,
45751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
357,
600,
2599,
6376,
286,
33705,
284,
651,
23025,
286,
198,
220,
220,
220,
220,
220,
220,
220,
8229,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1351,
25,
220,
685,
9600,
62,
312,
11,
47527,
18242,
11,
275,
3524,
763,
3669,
828,
986,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29206,
25,
19203,
405,
1558,
1507,
3256,
685,
10786,
9703,
3256,
357,
4846,
11,
1511,
11,
604,
2548,
11,
41423,
4008,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
33705,
62,
312,
796,
2116,
13,
2340,
58,
9630,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1529,
78,
796,
12152,
13,
29572,
7,
944,
13557,
1236,
18569,
4064,
33705,
62,
312,
737,
1136,
15763,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
308,
83,
796,
2116,
13,
16793,
62,
35636,
7,
1236,
78,
11,
352,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
308,
83,
796,
2116,
13,
16793,
62,
35636,
7,
1236,
78,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1441,
33705,
62,
312,
58,
16,
4357,
308,
83,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
16793,
62,
35636,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1529,
78,
796,
2116,
13,
16793,
62,
35636,
7,
1236,
78,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1529,
78,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
825,
2834,
62,
9600,
62,
1236,
78,
7,
944,
11,
6376,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
35561,
262,
2656,
23025,
286,
2939,
379,
6376,
628,
220,
220,
220,
220,
220,
220,
220,
5740,
25,
407,
1262,
2116,
13,
834,
1136,
9186,
834,
22784,
355,
597,
38226,
3804,
287,
198,
220,
220,
220,
220,
220,
220,
220,
714,
2085,
510,
428,
11244,
13,
628,
220,
220,
220,
220,
220,
220,
220,
45751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
357,
600,
2599,
6376,
286,
33705,
284,
651,
23025,
286,
198,
220,
220,
220,
220,
220,
220,
220,
8229,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1351,
25,
220,
685,
9600,
62,
312,
11,
47527,
18242,
11,
275,
3524,
763,
3669,
828,
986,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29206,
25,
19203,
405,
1558,
1507,
3256,
685,
10786,
9703,
3256,
357,
4846,
11,
1511,
11,
604,
2548,
11,
41423,
4008,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
33705,
62,
312,
796,
2116,
13,
2340,
58,
9630,
60,
198,
220,
220,
220,
220,
220,
220,
220,
33705,
796,
269,
85,
17,
13,
320,
961,
7,
944,
13557,
9600,
6978,
4064,
33705,
62,
312,
11,
269,
85,
17,
13,
3955,
15675,
62,
46786,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1529,
78,
796,
12152,
13,
29572,
7,
944,
13557,
1236,
18569,
4064,
33705,
62,
312,
737,
1136,
15763,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
308,
83,
796,
2116,
13,
16793,
62,
35636,
7,
1236,
78,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6001,
11,
9647,
11,
4808,
796,
33705,
13,
43358,
198,
220,
220,
220,
220,
220,
220,
220,
10559,
796,
308,
83,
58,
45299,
21912,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
14722,
796,
308,
83,
58,
25,
12095,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
10559,
58,
45299,
657,
3712,
17,
60,
1220,
28,
9647,
198,
220,
220,
220,
220,
220,
220,
220,
10559,
58,
45299,
352,
3712,
17,
60,
1220,
28,
6001,
198,
220,
220,
220,
220,
220,
220,
220,
14722,
796,
45941,
13,
11201,
392,
62,
67,
12078,
7,
23912,
1424,
11,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6670,
796,
45941,
13,
71,
25558,
19510,
29305,
11,
23912,
1424,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
33705,
11,
6670,
628,
220,
220,
220,
825,
2834,
62,
83,
22854,
7,
944,
11,
6376,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
35561,
262,
2656,
2939,
379,
281,
6376,
287,
11192,
273,
1296,
628,
220,
220,
220,
220,
220,
220,
220,
5740,
25,
407,
1262,
2116,
13,
834,
1136,
9186,
834,
22784,
355,
597,
38226,
3804,
287,
198,
220,
220,
220,
220,
220,
220,
220,
714,
2085,
510,
428,
11244,
13,
628,
220,
220,
220,
220,
220,
220,
220,
45751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
357,
600,
2599,
6376,
286,
33705,
284,
905,
198,
220,
220,
220,
220,
220,
220,
220,
8229,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11192,
273,
1143,
2196,
286,
33705,
11,
29650,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
284,
62,
83,
22854,
796,
31408,
13,
2514,
51,
22854,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
28034,
13,
51,
22854,
7,
944,
13,
31216,
62,
9060,
7,
9630,
29720,
13271,
421,
1453,
2736,
41052,
15,
8,
628,
220,
220,
220,
825,
13446,
62,
15255,
478,
507,
7,
944,
11,
477,
62,
29305,
11,
5072,
62,
15908,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
29305,
318,
257,
1351,
286,
4129,
1271,
12,
1659,
12,
37724,
13,
198,
220,
220,
220,
220,
220,
220,
220,
5501,
1351,
5002,
318,
257,
1351,
286,
4129,
1271,
12,
1659,
12,
17566,
13,
198,
220,
220,
220,
220,
220,
220,
220,
5501,
286,
883,
1351,
4847,
318,
2035,
281,
6565,
1351,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
393,
257,
299,
32152,
7177,
286,
13326,
13,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
29305,
58,
4871,
7131,
9060,
60,
796,
17635,
393,
45941,
13,
18747,
286,
5485,
1303,
67,
1039,
2124,
642,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
13564,
62,
18893,
62,
43420,
62,
7753,
7,
439,
62,
29305,
8,
198,
220,
220,
220,
220,
220,
220,
220,
257,
862,
11,
8899,
796,
2116,
13557,
4598,
62,
29412,
62,
18206,
7,
22915,
62,
15908,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
257,
862,
11,
8899,
628,
220,
220,
220,
825,
21136,
62,
8344,
7,
944,
11,
29472,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
2547,
325,
257,
350,
42643,
1847,
569,
4503,
35555,
2393,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5509,
796,
12152,
13,
29572,
7,
34345,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5563,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
26181,
287,
5509,
13,
19796,
439,
10786,
15252,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
7249,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
7249,
17816,
3672,
20520,
796,
26181,
13,
19796,
10786,
3672,
27691,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26181,
62,
7249,
17816,
3455,
20520,
796,
26181,
13,
19796,
10786,
3455,
27691,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
7249,
17816,
2213,
19524,
515,
20520,
796,
493,
7,
26801,
13,
19796,
10786,
2213,
19524,
515,
27691,
5239,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
7249,
17816,
26069,
2249,
20520,
796,
493,
7,
26801,
13,
19796,
10786,
26069,
2249,
27691,
5239,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
796,
26181,
13,
19796,
10786,
65,
358,
3524,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
7249,
17816,
65,
3524,
20520,
796,
685,
600,
7,
65,
3524,
13,
19796,
10786,
87,
1084,
27691,
5239,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
7,
65,
3524,
13,
19796,
10786,
88,
1084,
27691,
5239,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
7,
65,
3524,
13,
19796,
10786,
87,
9806,
27691,
5239,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
7,
65,
3524,
13,
19796,
10786,
4948,
897,
27691,
5239,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5563,
13,
33295,
7,
26801,
62,
7249,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
5563,
628,
628,
198,
2235,
1332,
198,
2,
611,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
2,
220,
220,
220,
220,
288,
82,
796,
569,
4503,
11242,
3213,
10786,
40720,
40720,
40720,
40720,
40720,
19608,
292,
316,
14,
53,
4503,
7959,
15813,
14,
3256,
685,
10786,
6999,
3256,
705,
27432,
11537,
4357,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6045,
11,
1052,
38983,
41762,
28955,
198,
2,
220,
220,
220,
220,
3601,
7,
11925,
7,
9310,
4008,
198,
2,
220,
220,
220,
220,
33705,
11,
2496,
796,
288,
82,
58,
15,
60,
198,
2,
220,
220,
220,
220,
3601,
7,
16793,
8,
198,
2,
220,
220,
220,
220,
288,
82,
13,
12860,
7,
16,
8
] | 2.218214 | 3,382 |
import cv2
import numpy as np
import imutils
import easyocr
from matplotlib import pyplot as plt
image = cv2.imread('images/license.jpg')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
image_filter = cv2.bilateralFilter(gray, 11, 15, 15)
edges = cv2.Canny(image_filter, 30, 200)
contours = cv2.findContours(edges.copy(), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
contours = imutils.grab_contours(contours)
contours = sorted(contours, key=cv2.contourArea, reverse=True)
position = None
for contour in contours:
approx = cv2.approxPolyDP(contour, 10, True)
number_of_edges = 4
if len(approx) == number_of_edges:
position = approx
break
mask = np.zeros(gray.shape, np.uint8)
new_image = cv2.drawContours(mask, [position], 0, 255, -1)
bitwise_image = cv2.bitwise_and(image, image, mask=mask)
x, y = np.where(mask == 255)
x1, y1 = np.min(x), np.min(y)
x2, y2 = np.max(x), np.max(y)
crop = gray[x1:x2, y1:y2]
text = easyocr.Reader(['en'])
text = text.readtext(crop)
result = text[0][-2]
final_image = cv2.putText(image, result, (x1, y2 + 60), cv2.FONT_HERSHEY_PLAIN, 3, (0, 0, 255), 1)
final_image = cv2.rectangle(image, (x1, x2), (y1, y2), (0, 255, 0), 1)
plt.imshow(cv2.cvtColor(final_image, cv2.COLOR_BGR2RGB))
plt.show()
| [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
545,
26791,
198,
11748,
2562,
1696,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
9060,
796,
269,
85,
17,
13,
320,
961,
10786,
17566,
14,
43085,
13,
9479,
11537,
198,
44605,
796,
269,
85,
17,
13,
33967,
83,
10258,
7,
9060,
11,
269,
85,
17,
13,
46786,
62,
33,
10761,
17,
38,
30631,
8,
198,
198,
9060,
62,
24455,
796,
269,
85,
17,
13,
65,
14796,
22417,
7,
44605,
11,
1367,
11,
1315,
11,
1315,
8,
198,
276,
3212,
796,
269,
85,
17,
13,
34,
7737,
7,
9060,
62,
24455,
11,
1542,
11,
939,
8,
198,
198,
3642,
4662,
796,
269,
85,
17,
13,
19796,
4264,
4662,
7,
276,
3212,
13,
30073,
22784,
269,
85,
17,
13,
2200,
5446,
62,
51,
11587,
11,
269,
85,
17,
13,
3398,
29833,
62,
2969,
31190,
55,
62,
48913,
16437,
8,
198,
3642,
4662,
796,
545,
26791,
13,
32393,
62,
3642,
4662,
7,
3642,
4662,
8,
198,
3642,
4662,
796,
23243,
7,
3642,
4662,
11,
1994,
28,
33967,
17,
13,
3642,
454,
30547,
11,
9575,
28,
17821,
8,
198,
198,
9150,
796,
6045,
198,
1640,
542,
454,
287,
542,
4662,
25,
198,
220,
220,
220,
5561,
796,
269,
85,
17,
13,
1324,
13907,
34220,
6322,
7,
3642,
454,
11,
838,
11,
6407,
8,
198,
220,
220,
220,
1271,
62,
1659,
62,
276,
3212,
796,
604,
198,
220,
220,
220,
611,
18896,
7,
1324,
13907,
8,
6624,
1271,
62,
1659,
62,
276,
3212,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2292,
796,
5561,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
198,
27932,
796,
45941,
13,
9107,
418,
7,
44605,
13,
43358,
11,
45941,
13,
28611,
23,
8,
198,
3605,
62,
9060,
796,
269,
85,
17,
13,
19334,
4264,
4662,
7,
27932,
11,
685,
9150,
4357,
657,
11,
14280,
11,
532,
16,
8,
198,
2545,
3083,
62,
9060,
796,
269,
85,
17,
13,
2545,
3083,
62,
392,
7,
9060,
11,
2939,
11,
9335,
28,
27932,
8,
198,
198,
87,
11,
331,
796,
45941,
13,
3003,
7,
27932,
6624,
14280,
8,
198,
87,
16,
11,
331,
16,
796,
45941,
13,
1084,
7,
87,
828,
45941,
13,
1084,
7,
88,
8,
198,
87,
17,
11,
331,
17,
796,
45941,
13,
9806,
7,
87,
828,
45941,
13,
9806,
7,
88,
8,
198,
31476,
796,
12768,
58,
87,
16,
25,
87,
17,
11,
331,
16,
25,
88,
17,
60,
198,
198,
5239,
796,
2562,
1696,
13,
33634,
7,
17816,
268,
6,
12962,
198,
5239,
796,
2420,
13,
961,
5239,
7,
31476,
8,
198,
198,
20274,
796,
2420,
58,
15,
7131,
12,
17,
60,
198,
20311,
62,
9060,
796,
269,
85,
17,
13,
1996,
8206,
7,
9060,
11,
1255,
11,
357,
87,
16,
11,
331,
17,
1343,
3126,
828,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
6489,
29833,
11,
513,
11,
357,
15,
11,
657,
11,
14280,
828,
352,
8,
198,
20311,
62,
9060,
796,
269,
85,
17,
13,
2554,
9248,
7,
9060,
11,
357,
87,
16,
11,
2124,
17,
828,
357,
88,
16,
11,
331,
17,
828,
357,
15,
11,
14280,
11,
657,
828,
352,
8,
198,
198,
489,
83,
13,
320,
12860,
7,
33967,
17,
13,
33967,
83,
10258,
7,
20311,
62,
9060,
11,
269,
85,
17,
13,
46786,
62,
33,
10761,
17,
36982,
4008,
198,
489,
83,
13,
12860,
3419,
198
] | 2.2 | 570 |
# Carlos Montes Parra
# A program that displays a number from the Fibonacci sequence. The position
# in the sequence is linked to the first and last letter of the user's name
# and the addition of their Unicode values.
# Adapted from one of Ian McLoughlin's lectures https://github.com/ianmcloughlin/python-fib/blob/master/fibname.py
name = "Montes"
first = name[0]
last = name[-1]
firstN = ord(first)
lastN = ord(last)
x = firstN + lastN
ans = fib(x)
print("My surname is", name)
print("The first letter", first, "is number", firstN)
print("The last letter", last, "is number", lastN)
print("Fibonacci number", x, "is", ans)
# SOLUTION
# My surname is Montes
# The first letter M is number 77
# The last letter s is number 115
# Fibonacci number 192 is 5972304273877744135569338397692020533504
# ord () is a python built-in function which returns the Unicode value linked to a one-character string. It's the opposite of chr() or unichr()
| [
2,
17409,
5575,
274,
2547,
430,
198,
198,
2,
317,
1430,
326,
11298,
257,
1271,
422,
262,
41566,
261,
44456,
8379,
13,
383,
2292,
220,
198,
2,
287,
262,
8379,
318,
6692,
284,
262,
717,
290,
938,
3850,
286,
262,
2836,
338,
1438,
198,
2,
290,
262,
3090,
286,
511,
34371,
3815,
13,
198,
198,
2,
30019,
276,
422,
530,
286,
12930,
18365,
619,
2815,
338,
25917,
3740,
1378,
12567,
13,
785,
14,
666,
76,
565,
619,
2815,
14,
29412,
12,
69,
571,
14,
2436,
672,
14,
9866,
14,
69,
571,
3672,
13,
9078,
198,
198,
3672,
796,
366,
26031,
274,
1,
198,
11085,
796,
1438,
58,
15,
60,
198,
12957,
796,
1438,
58,
12,
16,
60,
198,
11085,
45,
796,
2760,
7,
11085,
8,
198,
12957,
45,
796,
2760,
7,
12957,
8,
198,
87,
796,
717,
45,
1343,
938,
45,
198,
198,
504,
796,
12900,
7,
87,
8,
198,
4798,
7203,
3666,
40358,
318,
1600,
1438,
8,
198,
4798,
7203,
464,
717,
3850,
1600,
717,
11,
366,
271,
1271,
1600,
717,
45,
8,
198,
4798,
7203,
464,
938,
3850,
1600,
938,
11,
366,
271,
1271,
1600,
938,
45,
8,
198,
4798,
7203,
37,
571,
261,
44456,
1271,
1600,
2124,
11,
366,
271,
1600,
9093,
8,
198,
198,
2,
36817,
35354,
198,
198,
2,
2011,
40358,
318,
5575,
274,
198,
198,
2,
383,
717,
3850,
337,
318,
1271,
8541,
198,
198,
2,
383,
938,
3850,
264,
318,
1271,
12279,
198,
198,
2,
41566,
261,
44456,
1271,
17817,
318,
7863,
4761,
21288,
1983,
2548,
29331,
2598,
1485,
2816,
3388,
28460,
33372,
3388,
1238,
21261,
2091,
33580,
220,
198,
198,
2,
2760,
7499,
318,
257,
21015,
3170,
12,
259,
2163,
543,
5860,
262,
34371,
1988,
6692,
284,
257,
530,
12,
22769,
4731,
13,
632,
338,
262,
6697,
286,
442,
81,
3419,
393,
555,
488,
81,
3419,
198
] | 3.118033 | 305 |
import os
import argparse
import numpy as np
import pandas as pd
TASK = "xflickrco"
LANGS = ['de', 'ja']
SHOTS = [200, 500, 1000, 1500, '100x5', '200x5']
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--models', type=str)
parser.add_argument('--exp_dir', type=str)
parser.add_argument('--version', type=str, default=None)
args = parser.parse_args()
version = f".{args.version}" if args.version is not None else ""
exp_dir = args.exp_dir + version
models = args.models.split(",")
for shot in SHOTS:
res_ir_df = pd.DataFrame(columns=['model']+LANGS)
res_tr_df = pd.DataFrame(columns=['model']+LANGS)
for model in models:
res_ir = dict()
res_tr = dict()
res_ir['model'] = model
res_tr['model'] = model
for lang in LANGS:
fn = os.path.join(exp_dir, model, TASK, lang, str(shot), f"test.out")
try:
lines = [l.strip() for l in open(fn).readlines() if l.startswith("Final")] #[-1]
ir1 = float(lines[-2].split()[1].split(",")[0].split(':')[1])
tr1 = float(lines[-1].split()[1].split(",")[0].split(':')[1])
res_ir[lang] = ir1
res_tr[lang] = tr1
except:
print(fn)
res_ir[lang] = -1.0
res_tr[lang] = -1.0
# avg_ir = np.mean([res_ir[lang] for lang in LANGS])
# avg_tr = np.mean([res_tr[lang] for lang in LANGS])
# res_ir['avg'] = avg_ir
# res_tr['avg'] = avg_tr
res_ir_df = res_ir_df.append(res_ir, ignore_index=True)
res_tr_df = res_tr_df.append(res_tr, ignore_index=True)
res_ir_df.to_csv(f"{TASK}/xFlickrCO-many_ir_{shot}{version}.csv", index=False)
res_tr_df.to_csv(f"{TASK}/xFlickrCO-many_tr_{shot}{version}.csv", index=False)
| [
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
51,
1921,
42,
796,
366,
87,
2704,
18994,
1073,
1,
198,
25697,
14313,
796,
37250,
2934,
3256,
705,
6592,
20520,
198,
9693,
33472,
796,
685,
2167,
11,
5323,
11,
8576,
11,
20007,
11,
705,
3064,
87,
20,
3256,
705,
2167,
87,
20,
20520,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
27530,
3256,
2099,
28,
2536,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
11201,
62,
15908,
3256,
2099,
28,
2536,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
438,
9641,
3256,
2099,
28,
2536,
11,
4277,
28,
14202,
8,
198,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
628,
220,
220,
220,
2196,
796,
277,
1911,
90,
22046,
13,
9641,
36786,
611,
26498,
13,
9641,
318,
407,
6045,
2073,
13538,
198,
220,
220,
220,
1033,
62,
15908,
796,
26498,
13,
11201,
62,
15908,
1343,
2196,
628,
220,
220,
220,
4981,
796,
26498,
13,
27530,
13,
35312,
7,
2430,
8,
198,
220,
220,
220,
329,
2823,
287,
6006,
33472,
25,
198,
220,
220,
220,
220,
220,
220,
220,
581,
62,
343,
62,
7568,
796,
279,
67,
13,
6601,
19778,
7,
28665,
82,
28,
17816,
19849,
20520,
10,
25697,
14313,
8,
198,
220,
220,
220,
220,
220,
220,
220,
581,
62,
2213,
62,
7568,
796,
279,
67,
13,
6601,
19778,
7,
28665,
82,
28,
17816,
19849,
20520,
10,
25697,
14313,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2746,
287,
4981,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
343,
796,
8633,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
2213,
796,
8633,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
343,
17816,
19849,
20520,
796,
2746,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
2213,
17816,
19849,
20520,
796,
2746,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
42392,
287,
24192,
14313,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24714,
796,
28686,
13,
6978,
13,
22179,
7,
11201,
62,
15908,
11,
2746,
11,
309,
1921,
42,
11,
42392,
11,
965,
7,
9442,
828,
277,
1,
9288,
13,
448,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3951,
796,
685,
75,
13,
36311,
3419,
329,
300,
287,
1280,
7,
22184,
737,
961,
6615,
3419,
611,
300,
13,
9688,
2032,
342,
7203,
19006,
4943,
60,
1303,
58,
12,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
16,
796,
12178,
7,
6615,
58,
12,
17,
4083,
35312,
3419,
58,
16,
4083,
35312,
7,
2430,
38381,
15,
4083,
35312,
7,
10354,
11537,
58,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
491,
16,
796,
12178,
7,
6615,
58,
12,
16,
4083,
35312,
3419,
58,
16,
4083,
35312,
7,
2430,
38381,
15,
4083,
35312,
7,
10354,
11537,
58,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
343,
58,
17204,
60,
796,
4173,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
2213,
58,
17204,
60,
796,
491,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
22184,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
343,
58,
17204,
60,
796,
532,
16,
13,
15,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
2213,
58,
17204,
60,
796,
532,
16,
13,
15,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
42781,
62,
343,
796,
45941,
13,
32604,
26933,
411,
62,
343,
58,
17204,
60,
329,
42392,
287,
24192,
14313,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
42781,
62,
2213,
796,
45941,
13,
32604,
26933,
411,
62,
2213,
58,
17204,
60,
329,
42392,
287,
24192,
14313,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
581,
62,
343,
17816,
615,
70,
20520,
796,
42781,
62,
343,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
581,
62,
2213,
17816,
615,
70,
20520,
796,
42781,
62,
2213,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
343,
62,
7568,
796,
581,
62,
343,
62,
7568,
13,
33295,
7,
411,
62,
343,
11,
8856,
62,
9630,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
62,
2213,
62,
7568,
796,
581,
62,
2213,
62,
7568,
13,
33295,
7,
411,
62,
2213,
11,
8856,
62,
9630,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
581,
62,
343,
62,
7568,
13,
1462,
62,
40664,
7,
69,
1,
90,
51,
1921,
42,
92,
14,
87,
47250,
8220,
12,
21834,
62,
343,
23330,
9442,
18477,
9641,
27422,
40664,
1600,
6376,
28,
25101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
581,
62,
2213,
62,
7568,
13,
1462,
62,
40664,
7,
69,
1,
90,
51,
1921,
42,
92,
14,
87,
47250,
8220,
12,
21834,
62,
2213,
23330,
9442,
18477,
9641,
27422,
40664,
1600,
6376,
28,
25101,
8,
198
] | 1.899809 | 1,048 |
import matplotlib.pyplot as plt
import numpy as np
plt.plot(list(index for index, y in enumerate(get_coords())), list(y for y in get_coords()), "y-.s")
plt.show()
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
489,
83,
13,
29487,
7,
4868,
7,
9630,
329,
6376,
11,
331,
287,
27056,
378,
7,
1136,
62,
1073,
3669,
28955,
828,
1351,
7,
88,
329,
331,
287,
651,
62,
1073,
3669,
3419,
828,
366,
88,
34507,
82,
4943,
198,
489,
83,
13,
12860,
3419,
198
] | 2.553846 | 65 |
from torchtext.data import Field
from quati import constants
from quati.dataset.vocabulary import Vocabulary
class AffixesField(Field):
"""
Defines a field for affixes (prefixes and suffixes) by setting only
unk_token and pad_token to their default constant value.
"""
| [
6738,
28034,
5239,
13,
7890,
1330,
7663,
198,
198,
6738,
627,
7246,
1330,
38491,
198,
6738,
627,
7246,
13,
19608,
292,
316,
13,
18893,
22528,
1330,
47208,
22528,
628,
198,
4871,
6708,
844,
274,
15878,
7,
15878,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2896,
1127,
257,
2214,
329,
1527,
844,
274,
357,
40290,
274,
290,
35488,
274,
8,
416,
4634,
691,
198,
220,
220,
220,
555,
74,
62,
30001,
290,
14841,
62,
30001,
284,
511,
4277,
6937,
1988,
13,
198,
220,
220,
220,
37227,
628,
198
] | 3.222222 | 90 |
"""Interface to the game"""
import anre
import time
import enum
import logging
import pkg_resources
logging.basicConfig(level=logging.INFO)
LOG = logging.getLogger(__name__)
AVOID_DOUBLE_TAB_DELAY = 0.1
| [
37811,
39317,
284,
262,
983,
37811,
198,
198,
11748,
281,
260,
198,
11748,
640,
198,
11748,
33829,
198,
11748,
18931,
198,
198,
11748,
279,
10025,
62,
37540,
628,
628,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
10778,
8,
198,
198,
25294,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
10116,
46,
2389,
62,
35,
2606,
19146,
62,
5603,
33,
62,
35,
3698,
4792,
796,
657,
13,
16,
628,
198,
220,
220,
220,
220,
220,
220,
220,
220
] | 2.55814 | 86 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for glazier.lib.file_util."""
from pyfakefs import fake_filesystem
from glazier.lib import file_util
from absl.testing import absltest
if __name__ == '__main__':
absltest.main()
| [
2,
15069,
1584,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
198,
37811,
51,
3558,
329,
1278,
1031,
959,
13,
8019,
13,
7753,
62,
22602,
526,
15931,
198,
198,
6738,
12972,
30706,
9501,
1330,
8390,
62,
16624,
6781,
198,
6738,
1278,
1031,
959,
13,
8019,
1330,
2393,
62,
22602,
198,
6738,
2352,
75,
13,
33407,
1330,
2352,
2528,
395,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
2352,
2528,
395,
13,
12417,
3419,
198
] | 3.554054 | 222 |
import py
pydir = py.path.local(py.__file__).dirpath()
pytestpath = pydir.join("bin", "py.test")
EXPECTTIMEOUT=10.0
| [
11748,
12972,
198,
198,
79,
5173,
343,
796,
12972,
13,
6978,
13,
12001,
7,
9078,
13,
834,
7753,
834,
737,
15908,
6978,
3419,
198,
9078,
9288,
6978,
796,
279,
5173,
343,
13,
22179,
7203,
8800,
1600,
366,
9078,
13,
9288,
4943,
198,
49864,
9782,
34694,
12425,
28,
940,
13,
15,
628,
628
] | 2.307692 | 52 |
from utils import ListNode
| [
6738,
3384,
4487,
1330,
7343,
19667,
628
] | 4 | 7 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-24 18:27
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
20,
319,
2177,
12,
1157,
12,
1731,
1248,
25,
1983,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.690909 | 55 |
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
from graphviz import Digraph
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
main()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
| [
2,
770,
318,
257,
6291,
11361,
4226,
13,
198,
198,
2,
4332,
15576,
10,
37,
940,
284,
12260,
340,
393,
6330,
340,
351,
534,
2438,
13,
198,
2,
4332,
11198,
15576,
284,
2989,
8347,
329,
6097,
11,
3696,
11,
2891,
9168,
11,
4028,
11,
290,
6460,
13,
198,
6738,
4823,
85,
528,
1330,
7367,
1470,
628,
198,
2,
4332,
262,
4077,
4936,
287,
262,
308,
10381,
284,
1057,
262,
4226,
13,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198,
198,
2,
4091,
9485,
1925,
1670,
1037,
379,
3740,
1378,
2503,
13,
31173,
1671,
1299,
13,
785,
14,
16794,
14,
9078,
354,
1670,
14,
198
] | 3.385965 | 114 |
import json
import socketserver
import threading
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
from io import BytesIO
from pathlib import Path
import sys
from socketserver import ThreadingMixIn
from time import sleep
import depthai as dai
import numpy as np
import cv2
from PIL import Image
import blobconverter
HTTP_SERVER_PORT = 8090
# HTTPServer MJPEG
class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
"""Handle requests in a separate thread."""
pass
# start TCP data server
server_TCP = socketserver.TCPServer(('localhost', 8070), TCPServerRequest)
th = threading.Thread(target=server_TCP.serve_forever)
th.daemon = True
th.start()
# start MJPEG HTTP Server
server_HTTP = ThreadedHTTPServer(('localhost', HTTP_SERVER_PORT), VideoStreamHandler)
th2 = threading.Thread(target=server_HTTP.serve_forever)
th2.daemon = True
th2.start()
# MobilenetSSD label texts
labelMap = ["background", "aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow",
"diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"]
syncNN = True
# Pipeline is defined, now we can connect to the device
with dai.Device(dai.OpenVINO.Version.VERSION_2021_2) as device:
cams = device.getConnectedCameras()
depth_enabled = dai.CameraBoardSocket.LEFT in cams and dai.CameraBoardSocket.RIGHT in cams
# Start pipeline
device.startPipeline(create_pipeline(depth_enabled))
print(f"DepthAI is up & running. Navigate to 'localhost:{str(HTTP_SERVER_PORT)}' with Chrome to see the mjpeg stream")
# Output queues will be used to get the rgb frames and nn data from the outputs defined above
previewQueue = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)
detectionNNQueue = device.getOutputQueue(name="detections", maxSize=4, blocking=False)
if depth_enabled:
xoutBoundingBoxDepthMapping = device.getOutputQueue(name="boundingBoxDepthMapping", maxSize=4, blocking=False)
depthQueue = device.getOutputQueue(name="depth", maxSize=4, blocking=False)
frame = None
detections = []
startTime = time.monotonic()
counter = 0
fps = 0
color = (255, 255, 255)
while True:
inPreview = previewQueue.get()
frame = inPreview.getCvFrame()
inNN = detectionNNQueue.get()
detections = inNN.detections
counter+=1
current_time = time.monotonic()
if (current_time - startTime) > 1 :
fps = counter / (current_time - startTime)
counter = 0
startTime = current_time
if depth_enabled:
depth = depthQueue.get()
depthFrame = depth.getFrame()
depthFrameColor = cv2.normalize(depthFrame, None, 255, 0, cv2.NORM_INF, cv2.CV_8UC1)
depthFrameColor = cv2.equalizeHist(depthFrameColor)
depthFrameColor = cv2.applyColorMap(depthFrameColor, cv2.COLORMAP_HOT)
if len(detections) != 0:
boundingBoxMapping = xoutBoundingBoxDepthMapping.get()
roiDatas = boundingBoxMapping.getConfigData()
for roiData in roiDatas:
roi = roiData.roi
roi = roi.denormalize(depthFrameColor.shape[1], depthFrameColor.shape[0])
topLeft = roi.topLeft()
bottomRight = roi.bottomRight()
xmin = int(topLeft.x)
ymin = int(topLeft.y)
xmax = int(bottomRight.x)
ymax = int(bottomRight.y)
cv2.rectangle(depthFrameColor, (xmin, ymin), (xmax, ymax), color, cv2.FONT_HERSHEY_SCRIPT_SIMPLEX)
# If the frame is available, draw bounding boxes on it and show the frame
height = frame.shape[0]
width = frame.shape[1]
for detection in detections:
# Denormalize bounding box
x1 = int(detection.xmin * width)
x2 = int(detection.xmax * width)
y1 = int(detection.ymin * height)
y2 = int(detection.ymax * height)
try:
label = labelMap[detection.label]
except:
label = detection.label
cv2.putText(frame, str(label), (x1 + 10, y1 + 20), cv2.FONT_HERSHEY_TRIPLEX, 0.5, color)
cv2.putText(frame, "{:.2f}".format(detection.confidence*100), (x1 + 10, y1 + 35), cv2.FONT_HERSHEY_TRIPLEX, 0.5, color)
if depth_enabled:
cv2.putText(frame, f"X: {int(detection.spatialCoordinates.x)} mm", (x1 + 10, y1 + 50), cv2.FONT_HERSHEY_TRIPLEX, 0.5, color)
cv2.putText(frame, f"Y: {int(detection.spatialCoordinates.y)} mm", (x1 + 10, y1 + 65), cv2.FONT_HERSHEY_TRIPLEX, 0.5, color)
cv2.putText(frame, f"Z: {int(detection.spatialCoordinates.z)} mm", (x1 + 10, y1 + 80), cv2.FONT_HERSHEY_TRIPLEX, 0.5, color)
cv2.rectangle(frame, (x1, y1), (x2, y2), color, cv2.FONT_HERSHEY_SIMPLEX)
server_TCP.datatosend = str(label) + "," + f"{int(detection.confidence * 100)}%"
cv2.putText(frame, "NN fps: {:.2f}".format(fps), (2, frame.shape[0] - 4), cv2.FONT_HERSHEY_TRIPLEX, 0.4, color)
if depth_enabled:
new_width = int(depthFrameColor.shape[1] * (frame.shape[0] / depthFrameColor.shape[0]))
stacked = np.hstack([frame, cv2.resize(depthFrameColor, (new_width, frame.shape[0]))])
cv2.imshow("stacked", stacked)
server_HTTP.frametosend = stacked
else:
cv2.imshow("frame", frame)
server_HTTP.frametosend = frame
if cv2.waitKey(1) == ord('q'):
break
| [
11748,
33918,
198,
11748,
37037,
18497,
198,
11748,
4704,
278,
198,
11748,
640,
198,
6738,
2638,
13,
15388,
1330,
7308,
40717,
18453,
25060,
11,
38288,
18497,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
25064,
198,
6738,
37037,
18497,
1330,
14122,
278,
35608,
818,
198,
6738,
640,
1330,
3993,
198,
11748,
6795,
1872,
355,
288,
1872,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
44812,
1102,
332,
353,
198,
198,
40717,
62,
35009,
5959,
62,
15490,
796,
807,
42534,
628,
198,
2,
38288,
18497,
337,
12889,
7156,
628,
198,
4871,
14122,
276,
6535,
28820,
18497,
7,
16818,
278,
35608,
818,
11,
38288,
18497,
2599,
198,
220,
220,
220,
37227,
37508,
7007,
287,
257,
4553,
4704,
526,
15931,
198,
220,
220,
220,
1208,
628,
198,
2,
923,
23633,
1366,
4382,
198,
15388,
62,
4825,
47,
796,
37037,
18497,
13,
4825,
3705,
18497,
7,
10786,
36750,
3256,
4019,
2154,
828,
17283,
3705,
18497,
18453,
8,
198,
400,
796,
4704,
278,
13,
16818,
7,
16793,
28,
15388,
62,
4825,
47,
13,
2655,
303,
62,
754,
332,
8,
198,
400,
13,
6814,
7966,
796,
6407,
198,
400,
13,
9688,
3419,
628,
198,
2,
923,
337,
12889,
7156,
14626,
9652,
198,
15388,
62,
40717,
796,
14122,
276,
6535,
28820,
18497,
7,
10786,
36750,
3256,
14626,
62,
35009,
5959,
62,
15490,
828,
7623,
12124,
25060,
8,
198,
400,
17,
796,
4704,
278,
13,
16818,
7,
16793,
28,
15388,
62,
40717,
13,
2655,
303,
62,
754,
332,
8,
198,
400,
17,
13,
6814,
7966,
796,
6407,
198,
400,
17,
13,
9688,
3419,
628,
198,
198,
2,
45951,
268,
316,
5432,
35,
6167,
13399,
198,
18242,
13912,
796,
14631,
25249,
1600,
366,
25534,
20106,
1531,
1600,
366,
65,
35298,
1600,
366,
16944,
1600,
366,
24482,
1600,
366,
10985,
293,
1600,
366,
10885,
1600,
366,
7718,
1600,
366,
9246,
1600,
366,
16337,
1600,
366,
8232,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
67,
3191,
11487,
1600,
366,
9703,
1600,
366,
30527,
1600,
366,
76,
20965,
32256,
1600,
366,
6259,
1600,
366,
79,
8426,
15060,
1600,
366,
7091,
538,
1600,
366,
568,
13331,
1600,
366,
27432,
1600,
366,
14981,
41143,
8973,
198,
198,
27261,
6144,
796,
6407,
198,
198,
2,
37709,
318,
5447,
11,
783,
356,
460,
2018,
284,
262,
3335,
198,
4480,
288,
1872,
13,
24728,
7,
67,
1872,
13,
11505,
53,
46016,
13,
14815,
13,
43717,
62,
1238,
2481,
62,
17,
8,
355,
3335,
25,
198,
220,
220,
220,
269,
4105,
796,
3335,
13,
1136,
13313,
276,
34,
2382,
292,
3419,
198,
220,
220,
220,
6795,
62,
25616,
796,
288,
1872,
13,
35632,
29828,
39105,
13,
2538,
9792,
287,
269,
4105,
290,
288,
1872,
13,
35632,
29828,
39105,
13,
49,
9947,
287,
269,
4105,
628,
220,
220,
220,
1303,
7253,
11523,
198,
220,
220,
220,
3335,
13,
9688,
47,
541,
4470,
7,
17953,
62,
79,
541,
4470,
7,
18053,
62,
25616,
4008,
628,
220,
220,
220,
3601,
7,
69,
1,
48791,
20185,
318,
510,
1222,
2491,
13,
13244,
10055,
284,
705,
36750,
29164,
2536,
7,
40717,
62,
35009,
5959,
62,
15490,
38165,
6,
351,
13282,
284,
766,
262,
285,
73,
22071,
4269,
4943,
628,
220,
220,
220,
1303,
25235,
43359,
481,
307,
973,
284,
651,
262,
46140,
13431,
290,
299,
77,
1366,
422,
262,
23862,
5447,
2029,
198,
220,
220,
220,
12714,
34991,
796,
3335,
13,
1136,
26410,
34991,
7,
3672,
2625,
81,
22296,
1600,
3509,
10699,
28,
19,
11,
12013,
28,
25101,
8,
198,
220,
220,
220,
13326,
6144,
34991,
796,
3335,
13,
1136,
26410,
34991,
7,
3672,
2625,
15255,
478,
507,
1600,
3509,
10699,
28,
19,
11,
12013,
28,
25101,
8,
198,
220,
220,
220,
611,
6795,
62,
25616,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
448,
33,
9969,
14253,
48791,
44,
5912,
796,
3335,
13,
1136,
26410,
34991,
7,
3672,
2625,
7784,
278,
14253,
48791,
44,
5912,
1600,
3509,
10699,
28,
19,
11,
12013,
28,
25101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6795,
34991,
796,
3335,
13,
1136,
26410,
34991,
7,
3672,
2625,
18053,
1600,
3509,
10699,
28,
19,
11,
12013,
28,
25101,
8,
628,
220,
220,
220,
5739,
796,
6045,
198,
220,
220,
220,
4886,
507,
796,
17635,
628,
220,
220,
220,
923,
7575,
796,
640,
13,
2144,
313,
9229,
3419,
198,
220,
220,
220,
3753,
796,
657,
198,
220,
220,
220,
32977,
796,
657,
198,
220,
220,
220,
3124,
796,
357,
13381,
11,
14280,
11,
14280,
8,
628,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
287,
48835,
796,
12714,
34991,
13,
1136,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
5739,
796,
287,
48835,
13,
1136,
34,
85,
19778,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
287,
6144,
796,
13326,
6144,
34991,
13,
1136,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
4886,
507,
796,
287,
6144,
13,
15255,
478,
507,
628,
220,
220,
220,
220,
220,
220,
220,
3753,
47932,
16,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
62,
2435,
796,
640,
13,
2144,
313,
9229,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
14421,
62,
2435,
532,
923,
7575,
8,
1875,
352,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32977,
796,
3753,
1220,
357,
14421,
62,
2435,
532,
923,
7575,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3753,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
7575,
796,
1459,
62,
2435,
628,
220,
220,
220,
220,
220,
220,
220,
611,
6795,
62,
25616,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6795,
796,
6795,
34991,
13,
1136,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6795,
19778,
796,
6795,
13,
1136,
19778,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6795,
19778,
10258,
796,
269,
85,
17,
13,
11265,
1096,
7,
18053,
19778,
11,
6045,
11,
14280,
11,
657,
11,
269,
85,
17,
13,
35510,
44,
62,
1268,
37,
11,
269,
85,
17,
13,
33538,
62,
23,
9598,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6795,
19778,
10258,
796,
269,
85,
17,
13,
40496,
1096,
13749,
7,
18053,
19778,
10258,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6795,
19778,
10258,
796,
269,
85,
17,
13,
39014,
10258,
13912,
7,
18053,
19778,
10258,
11,
269,
85,
17,
13,
46786,
33767,
62,
39,
2394,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
15255,
478,
507,
8,
14512,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5421,
278,
14253,
44,
5912,
796,
2124,
448,
33,
9969,
14253,
48791,
44,
5912,
13,
1136,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
686,
72,
27354,
292,
796,
5421,
278,
14253,
44,
5912,
13,
1136,
16934,
6601,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
686,
72,
6601,
287,
686,
72,
27354,
292,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
686,
72,
796,
686,
72,
6601,
13,
305,
72,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
686,
72,
796,
686,
72,
13,
6559,
6636,
1096,
7,
18053,
19778,
10258,
13,
43358,
58,
16,
4357,
6795,
19778,
10258,
13,
43358,
58,
15,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1353,
18819,
796,
686,
72,
13,
4852,
18819,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4220,
11028,
796,
686,
72,
13,
22487,
11028,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
1084,
796,
493,
7,
4852,
18819,
13,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
1084,
796,
493,
7,
4852,
18819,
13,
88,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
9806,
796,
493,
7,
22487,
11028,
13,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
9806,
796,
493,
7,
22487,
11028,
13,
88,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
2554,
9248,
7,
18053,
19778,
10258,
11,
357,
87,
1084,
11,
331,
1084,
828,
357,
87,
9806,
11,
331,
9806,
828,
3124,
11,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
6173,
46023,
62,
48913,
16437,
55,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
262,
5739,
318,
1695,
11,
3197,
5421,
278,
10559,
319,
340,
290,
905,
262,
5739,
198,
220,
220,
220,
220,
220,
220,
220,
6001,
796,
5739,
13,
43358,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
9647,
220,
796,
5739,
13,
43358,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
329,
13326,
287,
4886,
507,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5601,
6636,
1096,
5421,
278,
3091,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
16,
796,
493,
7,
15255,
3213,
13,
87,
1084,
1635,
9647,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
17,
796,
493,
7,
15255,
3213,
13,
87,
9806,
1635,
9647,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
16,
796,
493,
7,
15255,
3213,
13,
88,
1084,
1635,
6001,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
17,
796,
493,
7,
15255,
3213,
13,
4948,
897,
1635,
6001,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
796,
6167,
13912,
58,
15255,
3213,
13,
18242,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
796,
13326,
13,
18242,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
1996,
8206,
7,
14535,
11,
965,
7,
18242,
828,
357,
87,
16,
1343,
838,
11,
331,
16,
1343,
1160,
828,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
5446,
4061,
2538,
55,
11,
657,
13,
20,
11,
3124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
1996,
8206,
7,
14535,
11,
45144,
25,
13,
17,
69,
92,
1911,
18982,
7,
15255,
3213,
13,
39745,
9,
3064,
828,
357,
87,
16,
1343,
838,
11,
331,
16,
1343,
3439,
828,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
5446,
4061,
2538,
55,
11,
657,
13,
20,
11,
3124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
6795,
62,
25616,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
1996,
8206,
7,
14535,
11,
277,
1,
55,
25,
1391,
600,
7,
15255,
3213,
13,
2777,
34961,
7222,
585,
17540,
13,
87,
38165,
8085,
1600,
357,
87,
16,
1343,
838,
11,
331,
16,
1343,
2026,
828,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
5446,
4061,
2538,
55,
11,
657,
13,
20,
11,
3124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
1996,
8206,
7,
14535,
11,
277,
1,
56,
25,
1391,
600,
7,
15255,
3213,
13,
2777,
34961,
7222,
585,
17540,
13,
88,
38165,
8085,
1600,
357,
87,
16,
1343,
838,
11,
331,
16,
1343,
6135,
828,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
5446,
4061,
2538,
55,
11,
657,
13,
20,
11,
3124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
1996,
8206,
7,
14535,
11,
277,
1,
57,
25,
1391,
600,
7,
15255,
3213,
13,
2777,
34961,
7222,
585,
17540,
13,
89,
38165,
8085,
1600,
357,
87,
16,
1343,
838,
11,
331,
16,
1343,
4019,
828,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
5446,
4061,
2538,
55,
11,
657,
13,
20,
11,
3124,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
2554,
9248,
7,
14535,
11,
357,
87,
16,
11,
331,
16,
828,
357,
87,
17,
11,
331,
17,
828,
3124,
11,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
48913,
16437,
55,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4382,
62,
4825,
47,
13,
19608,
35492,
437,
796,
965,
7,
18242,
8,
1343,
366,
553,
1343,
277,
1,
90,
600,
7,
15255,
3213,
13,
39745,
1635,
1802,
38165,
39658,
628,
198,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
1996,
8206,
7,
14535,
11,
366,
6144,
32977,
25,
46110,
13,
17,
69,
92,
1911,
18982,
7,
29647,
828,
357,
17,
11,
5739,
13,
43358,
58,
15,
60,
532,
604,
828,
269,
85,
17,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
5446,
4061,
2538,
55,
11,
657,
13,
19,
11,
3124,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
6795,
62,
25616,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
10394,
796,
493,
7,
18053,
19778,
10258,
13,
43358,
58,
16,
60,
1635,
357,
14535,
13,
43358,
58,
15,
60,
1220,
6795,
19778,
10258,
13,
43358,
58,
15,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24167,
796,
45941,
13,
71,
25558,
26933,
14535,
11,
269,
85,
17,
13,
411,
1096,
7,
18053,
19778,
10258,
11,
357,
3605,
62,
10394,
11,
5739,
13,
43358,
58,
15,
60,
4008,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7203,
301,
6021,
1600,
24167,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4382,
62,
40717,
13,
19298,
316,
418,
437,
796,
24167,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7203,
14535,
1600,
5739,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4382,
62,
40717,
13,
19298,
316,
418,
437,
796,
5739,
628,
198,
220,
220,
220,
220,
220,
220,
220,
611,
269,
85,
17,
13,
17077,
9218,
7,
16,
8,
6624,
2760,
10786,
80,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198
] | 2.203396 | 2,591 |
import string
import pdb
from collections import namedtuple
import math
ADD, SUB, MUL, DIV, CHAR = 'ADD','SUB','MUL','DIV','CHAR'
NUM, EOF, OPAR, CPAR, POW = 'NUM','EOF','OPAR','CPAR','POW'
WHITESPACE = string.whitespace
Token = namedtuple('Token',['token_type', 'token_value'])
if __name__ == "__main__":
main()
| [
11748,
4731,
198,
11748,
279,
9945,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
11748,
10688,
198,
198,
29266,
11,
28932,
11,
337,
6239,
11,
360,
3824,
11,
28521,
796,
705,
29266,
41707,
50,
10526,
41707,
44,
6239,
41707,
33569,
41707,
38019,
6,
198,
41359,
11,
412,
19238,
11,
13349,
1503,
11,
16932,
1503,
11,
24148,
796,
705,
41359,
41707,
4720,
37,
41707,
3185,
1503,
41707,
8697,
1503,
41707,
47,
3913,
6,
198,
198,
12418,
2043,
1546,
47,
11598,
796,
4731,
13,
1929,
2737,
10223,
198,
198,
30642,
796,
3706,
83,
29291,
10786,
30642,
3256,
17816,
30001,
62,
4906,
3256,
705,
30001,
62,
8367,
6,
12962,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.576 | 125 |
# -*- coding: utf-8 -*-
"""
@author: Victor Kohler
@since: date 17/12/2016
@version: 0.1
"""
import httplib
import helpers
import cookies
class Response(object):
"""Used to set and return data back to the server. The Response object
can be instantiated in one of two ways:
1. It is created manually in the view function to add custom headers,
cookies or response codes.
2. It gets created automatically once the view function returns
some data.
Create the response object from the view using app.make_response(data)
"""
def __init__(self, make_response=None, code=200, data=''):
"""For the view data we're currently supporting either a tuple with
both the returned data and a dictionary of headers or just the
returned data.
"""
if isinstance(data, tuple):
self.data = data[0]
headers = data[1]
else:
self.data = data
headers = {}
self.headers = headers
self.code = code
self.make_response = make_response
def set_cookie(self, key, value='', path='/', expires=None, max_age=None,
domain=None, secure=False, httponly=False):
"""Creates a cookie dictionary and adds it to the headers.
This function is ment to be used in the view function:
resp = make_response(data)
resp.set_cookie('key', 'value')
"""
cookie = cookies.create_cookie(key, value, path, expires, max_age,
domain, secure, httponly)
#TODO: Handle multiple cookies
self.headers.update(cookie)
def render(self):
"""Renders the final response back to the server with status code,
headers and data. It aslo transform headers and codes into
a WSGI compatible format.
If status code is 5xx or 4xx no view data is returned.
"""
# If the content type is not specified, we set
# it to text/html as the default
if 'content-type' not in map(lambda x:x.lower(), self.headers):
self.headers['Content-Type'] = 'text/html'
# Set headers as list of tuples
self.headers = [(k, v) for k, v in self.headers.items()]
# httplib.responses maps the HTTP 1.1 status codes to W3C names.
# Output example: '200 OK' or '404 Not Found'
resp_code = '{} {}'.format(self.code, httplib.responses[self.code])
if str(self.code)[0] in ['4', '5'] and not self.data:
self.make_response(resp_code, self.headers)
return resp_code.encode('utf-8')
try:
data = bytes(self.data).encode('utf-8')
except UnicodeDecodeError:
data = bytes(self.data)
self.make_response(resp_code, self.headers)
return data
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9800,
25,
12622,
24754,
1754,
198,
31,
20777,
25,
3128,
1596,
14,
1065,
14,
5304,
198,
31,
9641,
25,
657,
13,
16,
198,
37811,
198,
198,
11748,
1841,
489,
571,
198,
11748,
49385,
198,
11748,
14746,
198,
198,
4871,
18261,
7,
15252,
2599,
198,
220,
220,
220,
37227,
38052,
284,
900,
290,
1441,
1366,
736,
284,
262,
4382,
13,
383,
18261,
2134,
198,
220,
220,
220,
460,
307,
9113,
12931,
287,
530,
286,
734,
2842,
25,
628,
220,
220,
220,
352,
13,
632,
318,
2727,
14500,
287,
262,
1570,
2163,
284,
751,
2183,
24697,
11,
220,
198,
220,
220,
220,
14746,
393,
2882,
12416,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
362,
13,
632,
3011,
2727,
6338,
1752,
262,
1570,
2163,
5860,
198,
220,
220,
220,
617,
1366,
13,
628,
220,
220,
220,
13610,
262,
2882,
2134,
422,
262,
1570,
1262,
598,
13,
15883,
62,
26209,
7,
7890,
8,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
787,
62,
26209,
28,
14202,
11,
2438,
28,
2167,
11,
1366,
28,
7061,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
1890,
262,
1570,
1366,
356,
821,
3058,
6493,
2035,
257,
46545,
351,
198,
220,
220,
220,
220,
220,
220,
220,
1111,
262,
4504,
1366,
290,
257,
22155,
286,
24697,
393,
655,
262,
220,
198,
220,
220,
220,
220,
220,
220,
220,
4504,
1366,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
7890,
11,
46545,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7890,
796,
1366,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24697,
796,
1366,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7890,
796,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24697,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
50145,
796,
24697,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
8189,
796,
2438,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15883,
62,
26209,
796,
787,
62,
26209,
628,
220,
220,
220,
825,
900,
62,
44453,
7,
944,
11,
1994,
11,
1988,
11639,
3256,
3108,
11639,
14,
3256,
27396,
28,
14202,
11,
3509,
62,
496,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7386,
28,
14202,
11,
5713,
28,
25101,
11,
2638,
8807,
28,
25101,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16719,
274,
257,
19751,
22155,
290,
6673,
340,
284,
262,
24697,
13,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2163,
318,
6229,
284,
307,
973,
287,
262,
1570,
2163,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1217,
796,
787,
62,
26209,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1217,
13,
2617,
62,
44453,
10786,
2539,
3256,
705,
8367,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
19751,
796,
14746,
13,
17953,
62,
44453,
7,
2539,
11,
1988,
11,
3108,
11,
27396,
11,
3509,
62,
496,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7386,
11,
5713,
11,
2638,
8807,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
51,
3727,
46,
25,
33141,
3294,
14746,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
50145,
13,
19119,
7,
44453,
8,
628,
220,
220,
220,
825,
8543,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
49,
7338,
262,
2457,
2882,
736,
284,
262,
4382,
351,
3722,
2438,
11,
198,
220,
220,
220,
220,
220,
220,
220,
24697,
290,
1366,
13,
632,
355,
5439,
6121,
24697,
290,
12416,
656,
198,
220,
220,
220,
220,
220,
220,
220,
257,
25290,
18878,
11670,
5794,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
3722,
2438,
318,
642,
5324,
393,
604,
5324,
645,
1570,
1366,
318,
4504,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
262,
2695,
2099,
318,
407,
7368,
11,
356,
900,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
340,
284,
2420,
14,
6494,
355,
262,
4277,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
11299,
12,
4906,
6,
407,
287,
3975,
7,
50033,
2124,
25,
87,
13,
21037,
22784,
2116,
13,
50145,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
50145,
17816,
19746,
12,
6030,
20520,
796,
705,
5239,
14,
6494,
6,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
5345,
24697,
355,
1351,
286,
12777,
2374,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
50145,
796,
47527,
74,
11,
410,
8,
329,
479,
11,
410,
287,
2116,
13,
50145,
13,
23814,
3419,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1841,
489,
571,
13,
16733,
274,
8739,
262,
14626,
352,
13,
16,
3722,
12416,
284,
370,
18,
34,
3891,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
25235,
1672,
25,
705,
2167,
7477,
6,
393,
705,
26429,
1892,
4062,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1217,
62,
8189,
796,
705,
90,
92,
23884,
4458,
18982,
7,
944,
13,
8189,
11,
1841,
489,
571,
13,
16733,
274,
58,
944,
13,
8189,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
611,
965,
7,
944,
13,
8189,
38381,
15,
60,
287,
37250,
19,
3256,
705,
20,
20520,
290,
407,
2116,
13,
7890,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15883,
62,
26209,
7,
4363,
62,
8189,
11,
2116,
13,
50145,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1217,
62,
8189,
13,
268,
8189,
10786,
40477,
12,
23,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
9881,
7,
944,
13,
7890,
737,
268,
8189,
10786,
40477,
12,
23,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
34371,
10707,
1098,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
9881,
7,
944,
13,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15883,
62,
26209,
7,
4363,
62,
8189,
11,
2116,
13,
50145,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
198
] | 2.439863 | 1,164 |
# Copyright 2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import numpy as np
import pytest
import nnabla as nn
import nnabla_rl.algorithms as A
import nnabla_rl.environments as E
from nnabla_rl.replay_buffer import ReplayBuffer
if __name__ == "__main__":
from testing_utils import generate_dummy_experiences
pytest.main()
else:
from ..testing_utils import generate_dummy_experiences
| [
2,
15069,
33448,
10184,
10501,
13,
198,
2,
15069,
33448,
10184,
4912,
10501,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
198,
11748,
299,
77,
397,
5031,
355,
299,
77,
198,
11748,
299,
77,
397,
5031,
62,
45895,
13,
282,
7727,
907,
355,
317,
198,
11748,
299,
77,
397,
5031,
62,
45895,
13,
268,
12103,
355,
412,
198,
6738,
299,
77,
397,
5031,
62,
45895,
13,
260,
1759,
62,
22252,
1330,
23635,
28632,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
422,
4856,
62,
26791,
1330,
7716,
62,
67,
13513,
62,
23100,
10035,
198,
220,
220,
220,
12972,
9288,
13,
12417,
3419,
198,
17772,
25,
198,
220,
220,
220,
422,
11485,
33407,
62,
26791,
1330,
7716,
62,
67,
13513,
62,
23100,
10035,
198
] | 3.455197 | 279 |
# Generated by Django 2.0.4 on 2018-04-25 14:50
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
19,
319,
2864,
12,
3023,
12,
1495,
1478,
25,
1120,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.818182 | 44 |
#!/usr/bin/env python
# from .app_macros import * #relative import - did not work properly
from app_macros import *
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
220,
220,
220,
198,
2,
422,
764,
1324,
62,
20285,
4951,
1330,
1635,
220,
1303,
43762,
1330,
532,
750,
407,
670,
6105,
198,
6738,
598,
62,
20285,
4951,
1330,
1635,
628,
198
] | 3.05 | 40 |
"""Clean Code in Python - Chapter 3: General Traits of Good Code
> Error Handling - Exceptions
"""
import logging
import time
from base import Connector, Event
logger = logging.getLogger(__name__)
def connect_with_retry(
connector: Connector, retry_n_times: int, retry_backoff: int = 5
):
"""Tries to establish the connection of <connector> retrying
<retry_n_times>, and waiting <retry_backoff> seconds between attempts.
If it can connect, returns the connection object.
If it's not possible to connect after the retries have been exhausted, raises ``ConnectionError``.
:param connector: An object with a ``.connect()`` method.
:param retry_n_times int: The number of times to try to call
``connector.connect()``.
:param retry_backoff int: The time lapse between retry calls.
"""
for _ in range(retry_n_times):
try:
return connector.connect()
except ConnectionError as e:
logger.info(
"%s: attempting new connection in %is", e, retry_backoff
)
time.sleep(retry_backoff)
exc = ConnectionError(f"Couldn't connect after {retry_n_times} times")
logger.exception(exc)
raise exc
class DataTransport:
"""An example of an object that separates the exception handling by
abstraction levels.
"""
_RETRY_BACKOFF: int = 5
_RETRY_TIMES: int = 3
| [
37811,
32657,
6127,
287,
11361,
532,
7006,
513,
25,
3611,
4759,
896,
286,
4599,
6127,
198,
198,
29,
13047,
49500,
532,
1475,
11755,
198,
37811,
198,
11748,
18931,
198,
11748,
640,
198,
198,
6738,
2779,
1330,
8113,
273,
11,
8558,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4299,
2018,
62,
4480,
62,
1186,
563,
7,
198,
220,
220,
220,
21716,
25,
8113,
273,
11,
1005,
563,
62,
77,
62,
22355,
25,
493,
11,
1005,
563,
62,
1891,
2364,
25,
493,
796,
642,
198,
2599,
198,
220,
220,
220,
37227,
51,
1678,
284,
4474,
262,
4637,
286,
1279,
8443,
273,
29,
1005,
14992,
198,
220,
220,
220,
1279,
1186,
563,
62,
77,
62,
22355,
22330,
290,
4953,
1279,
1186,
563,
62,
1891,
2364,
29,
4201,
1022,
6370,
13,
628,
220,
220,
220,
1002,
340,
460,
2018,
11,
5860,
262,
4637,
2134,
13,
198,
220,
220,
220,
1002,
340,
338,
407,
1744,
284,
2018,
706,
262,
1005,
1678,
423,
587,
19064,
11,
12073,
7559,
32048,
12331,
15506,
13,
628,
220,
220,
220,
1058,
17143,
21716,
25,
220,
220,
220,
220,
220,
220,
220,
220,
1052,
2134,
351,
257,
7559,
13,
8443,
3419,
15506,
2446,
13,
198,
220,
220,
220,
1058,
17143,
1005,
563,
62,
77,
62,
22355,
493,
25,
383,
1271,
286,
1661,
284,
1949,
284,
869,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7559,
8443,
273,
13,
8443,
3419,
15506,
13,
198,
220,
220,
220,
1058,
17143,
1005,
563,
62,
1891,
2364,
493,
25,
383,
640,
42689,
1022,
1005,
563,
3848,
13,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
329,
4808,
287,
2837,
7,
1186,
563,
62,
77,
62,
22355,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
21716,
13,
8443,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
26923,
12331,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36521,
82,
25,
9361,
649,
4637,
287,
4064,
271,
1600,
304,
11,
1005,
563,
62,
1891,
2364,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
640,
13,
42832,
7,
1186,
563,
62,
1891,
2364,
8,
198,
220,
220,
220,
2859,
796,
26923,
12331,
7,
69,
1,
23722,
77,
470,
2018,
706,
1391,
1186,
563,
62,
77,
62,
22355,
92,
1661,
4943,
198,
220,
220,
220,
49706,
13,
1069,
4516,
7,
41194,
8,
198,
220,
220,
220,
5298,
2859,
628,
198,
4871,
6060,
8291,
634,
25,
198,
220,
220,
220,
37227,
2025,
1672,
286,
281,
2134,
326,
31555,
262,
6631,
9041,
416,
198,
220,
220,
220,
34651,
2974,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
4808,
2200,
40405,
62,
31098,
27977,
25,
493,
796,
642,
198,
220,
220,
220,
4808,
2200,
40405,
62,
51,
3955,
1546,
25,
493,
796,
513,
198
] | 2.657407 | 540 |
from flask import Blueprint, render_template, Response
from application.helpers import requires_auth
from core.tag.models import Tag
tag_pages = Blueprint('tag', __name__
, template_folder='templates', static_folder='static')
@tag_pages.route("/list")
@requires_auth
| [
6738,
42903,
1330,
39932,
11,
8543,
62,
28243,
11,
18261,
198,
198,
6738,
3586,
13,
16794,
364,
1330,
4433,
62,
18439,
198,
6738,
4755,
13,
12985,
13,
27530,
1330,
17467,
198,
198,
12985,
62,
31126,
796,
39932,
10786,
12985,
3256,
11593,
3672,
834,
198,
197,
11,
11055,
62,
43551,
11639,
11498,
17041,
3256,
9037,
62,
43551,
11639,
12708,
11537,
198,
198,
31,
12985,
62,
31126,
13,
38629,
7203,
14,
4868,
4943,
198,
31,
47911,
62,
18439,
628
] | 3.532468 | 77 |
# -*- coding: UTF-8 -*-
import os
import tqdm
import pickle
import argparse
import numpy as np
from scipy.io import loadmat
parser = argparse.ArgumentParser(description='widerface evaluate')
parser.add_argument('-p', '--pred', default="./widerface_evaluate/widerface_txt/")
parser.add_argument('-g', '--gt', default='./widerface_evaluate/ground_truth/')
args = parser.parse_args()
def bbox_overlaps(bboxes1, bboxes2, mode='iou'):
"""Calculate the ious between each bbox of bboxes1 and bboxes2.
Args:
bboxes1(ndarray): shape (n, 4)
bboxes2(ndarray): shape (k, 4)
mode(str): iou (intersection over union) or iof (intersection
over foreground)
Returns:
ious(ndarray): shape (n, k)
"""
assert mode in ['iou', 'iof']
bboxes1 = bboxes1.astype(np.float32)
bboxes2 = bboxes2.astype(np.float32)
rows = bboxes1.shape[0]
cols = bboxes2.shape[0]
ious = np.zeros((rows, cols), dtype=np.float32)
if rows * cols == 0:
return ious
exchange = False
if bboxes1.shape[0] > bboxes2.shape[0]:
bboxes1, bboxes2 = bboxes2, bboxes1
ious = np.zeros((cols, rows), dtype=np.float32)
exchange = True
area1 = (bboxes1[:, 2] - bboxes1[:, 0] + 1) * (
bboxes1[:, 3] - bboxes1[:, 1] + 1)
area2 = (bboxes2[:, 2] - bboxes2[:, 0] + 1) * (
bboxes2[:, 3] - bboxes2[:, 1] + 1)
for i in range(bboxes1.shape[0]):
x_start = np.maximum(bboxes1[i, 0], bboxes2[:, 0])
y_start = np.maximum(bboxes1[i, 1], bboxes2[:, 1])
x_end = np.minimum(bboxes1[i, 2], bboxes2[:, 2])
y_end = np.minimum(bboxes1[i, 3], bboxes2[:, 3])
overlap = np.maximum(x_end - x_start + 1, 0) * np.maximum(
y_end - y_start + 1, 0)
if mode == 'iou':
union = area1[i] + area2 - overlap
else:
union = area1[i] if not exchange else area2
ious[i, :] = overlap / union
if exchange:
ious = ious.T
return ious
def get_gt_boxes(gt_dir):
""" gt dir: (wider_face_val.mat, wider_easy_val.mat, wider_medium_val.mat, wider_hard_val.mat)"""
gt_mat = loadmat(os.path.join(gt_dir, 'wider_face_val.mat'))
hard_mat = loadmat(os.path.join(gt_dir, 'wider_hard_val.mat'))
medium_mat = loadmat(os.path.join(gt_dir, 'wider_medium_val.mat'))
easy_mat = loadmat(os.path.join(gt_dir, 'wider_easy_val.mat'))
facebox_list = gt_mat['face_bbx_list']
event_list = gt_mat['event_list']
file_list = gt_mat['file_list']
hard_gt_list = hard_mat['gt_list']
medium_gt_list = medium_mat['gt_list']
easy_gt_list = easy_mat['gt_list']
return facebox_list, event_list, file_list, hard_gt_list, medium_gt_list, easy_gt_list
def norm_score(pred):
""" norm score
pred {key: [[x1,y1,x2,y2,s]]}
"""
max_score = 0
min_score = 1
for _, k in pred.items():
for _, v in k.items():
if len(v) == 0:
continue
_min = np.min(v[:, -1])
_max = np.max(v[:, -1])
max_score = max(_max, max_score)
min_score = min(_min, min_score)
diff = max_score - min_score
for _, k in pred.items():
for _, v in k.items():
if len(v) == 0:
continue
v[:, -1] = (v[:, -1] - min_score)/diff
def image_eval(pred, gt, ignore, iou_thresh):
""" single image evaluation
pred: Nx5
gt: Nx4
ignore:
"""
_pred = pred.copy()
_gt = gt.copy()
pred_recall = np.zeros(_pred.shape[0])
recall_list = np.zeros(_gt.shape[0])
proposal_list = np.ones(_pred.shape[0])
_pred[:, 2] = _pred[:, 2] + _pred[:, 0]
_pred[:, 3] = _pred[:, 3] + _pred[:, 1]
_gt[:, 2] = _gt[:, 2] + _gt[:, 0]
_gt[:, 3] = _gt[:, 3] + _gt[:, 1]
overlaps = bbox_overlaps(_pred[:, :4], _gt)
for h in range(_pred.shape[0]):
gt_overlap = overlaps[h]
max_overlap, max_idx = gt_overlap.max(), gt_overlap.argmax()
if max_overlap >= iou_thresh:
if ignore[max_idx] == 0:
recall_list[max_idx] = -1
proposal_list[h] = -1
elif recall_list[max_idx] == 0:
recall_list[max_idx] = 1
r_keep_index = np.where(recall_list == 1)[0]
pred_recall[h] = len(r_keep_index)
return pred_recall, proposal_list
if __name__ == '__main__':
evaluation(args.pred, args.gt)
| [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
256,
80,
36020,
198,
11748,
2298,
293,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
952,
1330,
3440,
6759,
628,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
86,
1304,
2550,
13446,
11537,
198,
48610,
13,
2860,
62,
49140,
10786,
12,
79,
3256,
705,
438,
28764,
3256,
4277,
28,
1911,
14,
86,
1304,
2550,
62,
49786,
14,
86,
1304,
2550,
62,
14116,
14,
4943,
198,
48610,
13,
2860,
62,
49140,
10786,
12,
70,
3256,
705,
438,
13655,
3256,
4277,
28,
4458,
14,
86,
1304,
2550,
62,
49786,
14,
2833,
62,
35310,
14,
11537,
198,
22046,
796,
30751,
13,
29572,
62,
22046,
3419,
628,
198,
4299,
275,
3524,
62,
2502,
75,
1686,
7,
65,
29305,
16,
11,
275,
29305,
17,
11,
4235,
11639,
72,
280,
6,
2599,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
220,
699,
1022,
1123,
275,
3524,
286,
275,
29305,
16,
290,
275,
29305,
17,
13,
198,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
275,
29305,
16,
7,
358,
18747,
2599,
5485,
357,
77,
11,
604,
8,
198,
220,
220,
220,
220,
220,
220,
220,
275,
29305,
17,
7,
358,
18747,
2599,
5485,
357,
74,
11,
604,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4235,
7,
2536,
2599,
1312,
280,
357,
3849,
5458,
625,
6441,
8,
393,
33245,
69,
357,
3849,
5458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
625,
36282,
8,
198,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
699,
7,
358,
18747,
2599,
5485,
357,
77,
11,
479,
8,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
6818,
4235,
287,
37250,
72,
280,
3256,
705,
952,
69,
20520,
628,
220,
220,
220,
275,
29305,
16,
796,
275,
29305,
16,
13,
459,
2981,
7,
37659,
13,
22468,
2624,
8,
198,
220,
220,
220,
275,
29305,
17,
796,
275,
29305,
17,
13,
459,
2981,
7,
37659,
13,
22468,
2624,
8,
198,
220,
220,
220,
15274,
796,
275,
29305,
16,
13,
43358,
58,
15,
60,
198,
220,
220,
220,
951,
82,
796,
275,
29305,
17,
13,
43358,
58,
15,
60,
198,
220,
220,
220,
220,
699,
796,
45941,
13,
9107,
418,
19510,
8516,
11,
951,
82,
828,
288,
4906,
28,
37659,
13,
22468,
2624,
8,
198,
220,
220,
220,
611,
15274,
1635,
951,
82,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
220,
699,
198,
220,
220,
220,
5163,
796,
10352,
198,
220,
220,
220,
611,
275,
29305,
16,
13,
43358,
58,
15,
60,
1875,
275,
29305,
17,
13,
43358,
58,
15,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
275,
29305,
16,
11,
275,
29305,
17,
796,
275,
29305,
17,
11,
275,
29305,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
699,
796,
45941,
13,
9107,
418,
19510,
4033,
82,
11,
15274,
828,
288,
4906,
28,
37659,
13,
22468,
2624,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5163,
796,
6407,
198,
220,
220,
220,
1989,
16,
796,
357,
65,
29305,
16,
58,
45299,
362,
60,
532,
275,
29305,
16,
58,
45299,
657,
60,
1343,
352,
8,
1635,
357,
198,
220,
220,
220,
220,
220,
220,
220,
275,
29305,
16,
58,
45299,
513,
60,
532,
275,
29305,
16,
58,
45299,
352,
60,
1343,
352,
8,
198,
220,
220,
220,
1989,
17,
796,
357,
65,
29305,
17,
58,
45299,
362,
60,
532,
275,
29305,
17,
58,
45299,
657,
60,
1343,
352,
8,
1635,
357,
198,
220,
220,
220,
220,
220,
220,
220,
275,
29305,
17,
58,
45299,
513,
60,
532,
275,
29305,
17,
58,
45299,
352,
60,
1343,
352,
8,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
65,
29305,
16,
13,
43358,
58,
15,
60,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
62,
9688,
796,
45941,
13,
47033,
7,
65,
29305,
16,
58,
72,
11,
657,
4357,
275,
29305,
17,
58,
45299,
657,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
331,
62,
9688,
796,
45941,
13,
47033,
7,
65,
29305,
16,
58,
72,
11,
352,
4357,
275,
29305,
17,
58,
45299,
352,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
62,
437,
796,
45941,
13,
39504,
7,
65,
29305,
16,
58,
72,
11,
362,
4357,
275,
29305,
17,
58,
45299,
362,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
331,
62,
437,
796,
45941,
13,
39504,
7,
65,
29305,
16,
58,
72,
11,
513,
4357,
275,
29305,
17,
58,
45299,
513,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
21721,
796,
45941,
13,
47033,
7,
87,
62,
437,
532,
2124,
62,
9688,
1343,
352,
11,
657,
8,
1635,
45941,
13,
47033,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
62,
437,
532,
331,
62,
9688,
1343,
352,
11,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4235,
6624,
705,
72,
280,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6441,
796,
1989,
16,
58,
72,
60,
1343,
1989,
17,
532,
21721,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6441,
796,
1989,
16,
58,
72,
60,
611,
407,
5163,
2073,
1989,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
699,
58,
72,
11,
1058,
60,
796,
21721,
1220,
6441,
198,
220,
220,
220,
611,
5163,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
699,
796,
220,
699,
13,
51,
198,
220,
220,
220,
1441,
220,
699,
628,
198,
4299,
651,
62,
13655,
62,
29305,
7,
13655,
62,
15908,
2599,
198,
220,
220,
220,
37227,
308,
83,
26672,
25,
357,
86,
1304,
62,
2550,
62,
2100,
13,
6759,
11,
10595,
62,
38171,
62,
2100,
13,
6759,
11,
10595,
62,
24132,
62,
2100,
13,
6759,
11,
10595,
62,
10424,
62,
2100,
13,
6759,
8,
37811,
628,
220,
220,
220,
308,
83,
62,
6759,
796,
3440,
6759,
7,
418,
13,
6978,
13,
22179,
7,
13655,
62,
15908,
11,
705,
86,
1304,
62,
2550,
62,
2100,
13,
6759,
6,
4008,
198,
220,
220,
220,
1327,
62,
6759,
796,
3440,
6759,
7,
418,
13,
6978,
13,
22179,
7,
13655,
62,
15908,
11,
705,
86,
1304,
62,
10424,
62,
2100,
13,
6759,
6,
4008,
198,
220,
220,
220,
7090,
62,
6759,
796,
3440,
6759,
7,
418,
13,
6978,
13,
22179,
7,
13655,
62,
15908,
11,
705,
86,
1304,
62,
24132,
62,
2100,
13,
6759,
6,
4008,
198,
220,
220,
220,
2562,
62,
6759,
796,
3440,
6759,
7,
418,
13,
6978,
13,
22179,
7,
13655,
62,
15908,
11,
705,
86,
1304,
62,
38171,
62,
2100,
13,
6759,
6,
4008,
628,
220,
220,
220,
1986,
3524,
62,
4868,
796,
308,
83,
62,
6759,
17816,
2550,
62,
11848,
87,
62,
4868,
20520,
198,
220,
220,
220,
1785,
62,
4868,
796,
308,
83,
62,
6759,
17816,
15596,
62,
4868,
20520,
198,
220,
220,
220,
2393,
62,
4868,
796,
308,
83,
62,
6759,
17816,
7753,
62,
4868,
20520,
628,
220,
220,
220,
1327,
62,
13655,
62,
4868,
796,
1327,
62,
6759,
17816,
13655,
62,
4868,
20520,
198,
220,
220,
220,
7090,
62,
13655,
62,
4868,
796,
7090,
62,
6759,
17816,
13655,
62,
4868,
20520,
198,
220,
220,
220,
2562,
62,
13655,
62,
4868,
796,
2562,
62,
6759,
17816,
13655,
62,
4868,
20520,
628,
220,
220,
220,
1441,
1986,
3524,
62,
4868,
11,
1785,
62,
4868,
11,
2393,
62,
4868,
11,
1327,
62,
13655,
62,
4868,
11,
7090,
62,
13655,
62,
4868,
11,
2562,
62,
13655,
62,
4868,
628,
628,
198,
4299,
2593,
62,
26675,
7,
28764,
2599,
198,
220,
220,
220,
37227,
2593,
4776,
198,
220,
220,
220,
2747,
1391,
2539,
25,
16410,
87,
16,
11,
88,
16,
11,
87,
17,
11,
88,
17,
11,
82,
11907,
92,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
3509,
62,
26675,
796,
657,
198,
220,
220,
220,
949,
62,
26675,
796,
352,
628,
220,
220,
220,
329,
4808,
11,
479,
287,
2747,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4808,
11,
410,
287,
479,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
85,
8,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
1084,
796,
45941,
13,
1084,
7,
85,
58,
45299,
532,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
9806,
796,
45941,
13,
9806,
7,
85,
58,
45299,
532,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
26675,
796,
3509,
28264,
9806,
11,
3509,
62,
26675,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
949,
62,
26675,
796,
949,
28264,
1084,
11,
949,
62,
26675,
8,
628,
220,
220,
220,
814,
796,
3509,
62,
26675,
532,
949,
62,
26675,
198,
220,
220,
220,
329,
4808,
11,
479,
287,
2747,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4808,
11,
410,
287,
479,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
85,
8,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
58,
45299,
532,
16,
60,
796,
357,
85,
58,
45299,
532,
16,
60,
532,
949,
62,
26675,
20679,
26069,
628,
198,
4299,
2939,
62,
18206,
7,
28764,
11,
308,
83,
11,
8856,
11,
1312,
280,
62,
400,
3447,
2599,
198,
220,
220,
220,
37227,
2060,
2939,
12660,
198,
220,
220,
220,
2747,
25,
399,
87,
20,
198,
220,
220,
220,
308,
83,
25,
399,
87,
19,
198,
220,
220,
220,
8856,
25,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
4808,
28764,
796,
2747,
13,
30073,
3419,
198,
220,
220,
220,
4808,
13655,
796,
308,
83,
13,
30073,
3419,
198,
220,
220,
220,
2747,
62,
8344,
439,
796,
45941,
13,
9107,
418,
28264,
28764,
13,
43358,
58,
15,
12962,
198,
220,
220,
220,
10014,
62,
4868,
796,
45941,
13,
9107,
418,
28264,
13655,
13,
43358,
58,
15,
12962,
198,
220,
220,
220,
6961,
62,
4868,
796,
45941,
13,
1952,
28264,
28764,
13,
43358,
58,
15,
12962,
628,
220,
220,
220,
4808,
28764,
58,
45299,
362,
60,
796,
4808,
28764,
58,
45299,
362,
60,
1343,
4808,
28764,
58,
45299,
657,
60,
198,
220,
220,
220,
4808,
28764,
58,
45299,
513,
60,
796,
4808,
28764,
58,
45299,
513,
60,
1343,
4808,
28764,
58,
45299,
352,
60,
198,
220,
220,
220,
4808,
13655,
58,
45299,
362,
60,
796,
4808,
13655,
58,
45299,
362,
60,
1343,
4808,
13655,
58,
45299,
657,
60,
198,
220,
220,
220,
4808,
13655,
58,
45299,
513,
60,
796,
4808,
13655,
58,
45299,
513,
60,
1343,
4808,
13655,
58,
45299,
352,
60,
628,
220,
220,
220,
12893,
1686,
796,
275,
3524,
62,
2502,
75,
1686,
28264,
28764,
58,
45299,
1058,
19,
4357,
4808,
13655,
8,
628,
220,
220,
220,
329,
289,
287,
2837,
28264,
28764,
13,
43358,
58,
15,
60,
2599,
628,
220,
220,
220,
220,
220,
220,
220,
308,
83,
62,
2502,
37796,
796,
12893,
1686,
58,
71,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
2502,
37796,
11,
3509,
62,
312,
87,
796,
308,
83,
62,
2502,
37796,
13,
9806,
22784,
308,
83,
62,
2502,
37796,
13,
853,
9806,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
3509,
62,
2502,
37796,
18189,
1312,
280,
62,
400,
3447,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
8856,
58,
9806,
62,
312,
87,
60,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10014,
62,
4868,
58,
9806,
62,
312,
87,
60,
796,
532,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6961,
62,
4868,
58,
71,
60,
796,
532,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
10014,
62,
4868,
58,
9806,
62,
312,
87,
60,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10014,
62,
4868,
58,
9806,
62,
312,
87,
60,
796,
352,
628,
220,
220,
220,
220,
220,
220,
220,
374,
62,
14894,
62,
9630,
796,
45941,
13,
3003,
7,
8344,
439,
62,
4868,
6624,
352,
38381,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2747,
62,
8344,
439,
58,
71,
60,
796,
18896,
7,
81,
62,
14894,
62,
9630,
8,
198,
220,
220,
220,
1441,
2747,
62,
8344,
439,
11,
6961,
62,
4868,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
12660,
7,
22046,
13,
28764,
11,
26498,
13,
13655,
8,
198
] | 2.022821 | 2,191 |
import os
import subprocess
import shutil
OBJDUMP = "objdump"
DLL_NAME_PREFIX = 'DLL Name:'
paths = filter(lambda line: not "windows" in line.lower(),
os.environ['PATH'].split(os.pathsep))
searchfiles = [f for f in os.listdir('.') if is_interesting_local_file(f)]
while len(searchfiles):
localfile = searchfiles.pop(0)
print "checking " + localfile
for dep in get_dependencies(localfile):
if not in_cwd(dep):
fullpath = find_in_path(dep)
if fullpath:
print "copying from " + fullpath
shutil.copy(fullpath, os.getcwd())
searchfiles.append(dep)
| [
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
4423,
346,
198,
198,
9864,
37882,
20476,
796,
366,
26801,
39455,
1,
198,
35,
3069,
62,
20608,
62,
47,
31688,
10426,
796,
705,
35,
3069,
6530,
32105,
198,
198,
6978,
82,
796,
8106,
7,
50033,
1627,
25,
407,
366,
28457,
1,
287,
1627,
13,
21037,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
268,
2268,
17816,
34219,
6,
4083,
35312,
7,
418,
13,
6978,
325,
79,
4008,
198,
198,
12947,
16624,
796,
685,
69,
329,
277,
287,
28686,
13,
4868,
15908,
10786,
2637,
8,
611,
318,
62,
47914,
62,
12001,
62,
7753,
7,
69,
15437,
198,
198,
4514,
18896,
7,
12947,
16624,
2599,
198,
220,
1179,
1604,
576,
796,
2989,
16624,
13,
12924,
7,
15,
8,
198,
220,
3601,
366,
41004,
366,
1343,
1179,
1604,
576,
198,
220,
329,
1207,
287,
651,
62,
45841,
3976,
7,
17946,
1604,
576,
2599,
198,
220,
220,
220,
611,
407,
287,
62,
66,
16993,
7,
10378,
2599,
198,
220,
220,
220,
220,
220,
1336,
6978,
796,
1064,
62,
259,
62,
6978,
7,
10378,
8,
198,
220,
220,
220,
220,
220,
611,
1336,
6978,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
366,
22163,
1112,
422,
366,
1343,
1336,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
4423,
346,
13,
30073,
7,
12853,
6978,
11,
28686,
13,
1136,
66,
16993,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2989,
16624,
13,
33295,
7,
10378,
8,
198
] | 2.403162 | 253 |
import sys
import typing
def bvh(filepath: str = "",
filter_glob: str = "*.bvh",
target: typing.Union[str, int] = 'ARMATURE',
global_scale: float = 1.0,
frame_start: int = 1,
use_fps_scale: bool = False,
update_scene_fps: bool = False,
update_scene_duration: bool = False,
use_cyclic: bool = False,
rotate_mode: typing.Union[str, int] = 'NATIVE',
axis_forward: typing.Union[str, int] = '-Z',
axis_up: typing.Union[str, int] = 'Y'):
'''Load a BVH motion capture file
:param filepath: File Path, Filepath used for importing the file
:type filepath: str
:param filter_glob: filter_glob
:type filter_glob: str
:param target: Target, Import target type
:type target: typing.Union[str, int]
:param global_scale: Scale, Scale the BVH by this value
:type global_scale: float
:param frame_start: Start Frame, Starting frame for the animation
:type frame_start: int
:param use_fps_scale: Scale FPS, Scale the framerate from the BVH to the current scenes, otherwise each BVH frame maps directly to a Blender frame
:type use_fps_scale: bool
:param update_scene_fps: Update Scene FPS, Set the scene framerate to that of the BVH file (note that this nullifies the ‘Scale FPS’ option, as the scale will be 1:1)
:type update_scene_fps: bool
:param update_scene_duration: Update Scene Duration, Extend the scene’s duration to the BVH duration (never shortens the scene)
:type update_scene_duration: bool
:param use_cyclic: Loop, Loop the animation playback
:type use_cyclic: bool
:param rotate_mode: Rotation, Rotation conversionQUATERNION Quaternion, Convert rotations to quaternions.NATIVE Euler (Native), Use the rotation order defined in the BVH file.XYZ Euler (XYZ), Convert rotations to euler XYZ.XZY Euler (XZY), Convert rotations to euler XZY.YXZ Euler (YXZ), Convert rotations to euler YXZ.YZX Euler (YZX), Convert rotations to euler YZX.ZXY Euler (ZXY), Convert rotations to euler ZXY.ZYX Euler (ZYX), Convert rotations to euler ZYX.
:type rotate_mode: typing.Union[str, int]
:param axis_forward: Forward
:type axis_forward: typing.Union[str, int]
:param axis_up: Up
:type axis_up: typing.Union[str, int]
'''
pass
| [
11748,
25064,
198,
11748,
19720,
628,
198,
4299,
275,
85,
71,
7,
7753,
6978,
25,
965,
796,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
8106,
62,
4743,
672,
25,
965,
796,
366,
24620,
65,
85,
71,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
2496,
25,
19720,
13,
38176,
58,
2536,
11,
493,
60,
796,
705,
33456,
40086,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3298,
62,
9888,
25,
12178,
796,
352,
13,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
5739,
62,
9688,
25,
493,
796,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
779,
62,
29647,
62,
9888,
25,
20512,
796,
10352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4296,
62,
29734,
62,
29647,
25,
20512,
796,
10352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4296,
62,
29734,
62,
32257,
25,
20512,
796,
10352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
779,
62,
15539,
291,
25,
20512,
796,
10352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
23064,
62,
14171,
25,
19720,
13,
38176,
58,
2536,
11,
493,
60,
796,
705,
34259,
9306,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
16488,
62,
11813,
25,
19720,
13,
38176,
58,
2536,
11,
493,
60,
796,
705,
12,
57,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
16488,
62,
929,
25,
19720,
13,
38176,
58,
2536,
11,
493,
60,
796,
705,
56,
6,
2599,
198,
220,
220,
220,
705,
7061,
8912,
257,
347,
53,
39,
6268,
8006,
2393,
220,
628,
220,
220,
220,
1058,
17143,
2393,
6978,
25,
9220,
10644,
11,
9220,
6978,
973,
329,
33332,
262,
2393,
220,
198,
220,
220,
220,
1058,
4906,
2393,
6978,
25,
965,
198,
220,
220,
220,
1058,
17143,
8106,
62,
4743,
672,
25,
8106,
62,
4743,
672,
220,
198,
220,
220,
220,
1058,
4906,
8106,
62,
4743,
672,
25,
965,
198,
220,
220,
220,
1058,
17143,
2496,
25,
12744,
11,
17267,
2496,
2099,
220,
198,
220,
220,
220,
1058,
4906,
2496,
25,
19720,
13,
38176,
58,
2536,
11,
493,
60,
198,
220,
220,
220,
1058,
17143,
3298,
62,
9888,
25,
21589,
11,
21589,
262,
347,
53,
39,
416,
428,
1988,
220,
198,
220,
220,
220,
1058,
4906,
3298,
62,
9888,
25,
12178,
198,
220,
220,
220,
1058,
17143,
5739,
62,
9688,
25,
7253,
25184,
11,
17962,
5739,
329,
262,
11034,
220,
198,
220,
220,
220,
1058,
4906,
5739,
62,
9688,
25,
493,
198,
220,
220,
220,
1058,
17143,
779,
62,
29647,
62,
9888,
25,
21589,
22082,
11,
21589,
262,
5346,
21620,
422,
262,
347,
53,
39,
284,
262,
1459,
8188,
11,
4306,
1123,
347,
53,
39,
5739,
8739,
3264,
284,
257,
1086,
2194,
5739,
220,
198,
220,
220,
220,
1058,
4906,
779,
62,
29647,
62,
9888,
25,
20512,
198,
220,
220,
220,
1058,
17143,
4296,
62,
29734,
62,
29647,
25,
10133,
28315,
22082,
11,
5345,
262,
3715,
5346,
21620,
284,
326,
286,
262,
347,
53,
39,
2393,
357,
11295,
326,
428,
9242,
6945,
262,
564,
246,
29990,
22082,
447,
247,
3038,
11,
355,
262,
5046,
481,
307,
352,
25,
16,
8,
220,
198,
220,
220,
220,
1058,
4906,
4296,
62,
29734,
62,
29647,
25,
20512,
198,
220,
220,
220,
1058,
17143,
4296,
62,
29734,
62,
32257,
25,
10133,
28315,
22920,
11,
46228,
262,
3715,
447,
247,
82,
9478,
284,
262,
347,
53,
39,
9478,
357,
12081,
1790,
641,
262,
3715,
8,
220,
198,
220,
220,
220,
1058,
4906,
4296,
62,
29734,
62,
32257,
25,
20512,
198,
220,
220,
220,
1058,
17143,
779,
62,
15539,
291,
25,
26304,
11,
26304,
262,
11034,
16388,
220,
198,
220,
220,
220,
1058,
4906,
779,
62,
15539,
291,
25,
20512,
198,
220,
220,
220,
1058,
17143,
23064,
62,
14171,
25,
371,
14221,
11,
371,
14221,
11315,
10917,
23261,
45,
2849,
2264,
9205,
295,
11,
38240,
5724,
602,
284,
627,
9205,
507,
13,
34259,
9306,
412,
18173,
357,
31272,
828,
5765,
262,
13179,
1502,
5447,
287,
262,
347,
53,
39,
2393,
13,
34278,
57,
412,
18173,
357,
34278,
57,
828,
38240,
5724,
602,
284,
304,
18173,
41420,
57,
13,
55,
57,
56,
412,
18173,
357,
55,
57,
56,
828,
38240,
5724,
602,
284,
304,
18173,
1395,
57,
56,
13,
56,
55,
57,
412,
18173,
357,
56,
55,
57,
828,
38240,
5724,
602,
284,
304,
18173,
575,
55,
57,
13,
56,
40692,
412,
18173,
357,
56,
40692,
828,
38240,
5724,
602,
284,
304,
18173,
575,
40692,
13,
57,
34278,
412,
18173,
357,
57,
34278,
828,
38240,
5724,
602,
284,
304,
18173,
1168,
34278,
13,
57,
56,
55,
412,
18173,
357,
57,
56,
55,
828,
38240,
5724,
602,
284,
304,
18173,
1168,
56,
55,
13,
220,
198,
220,
220,
220,
1058,
4906,
23064,
62,
14171,
25,
19720,
13,
38176,
58,
2536,
11,
493,
60,
198,
220,
220,
220,
1058,
17143,
16488,
62,
11813,
25,
19530,
220,
198,
220,
220,
220,
1058,
4906,
16488,
62,
11813,
25,
19720,
13,
38176,
58,
2536,
11,
493,
60,
198,
220,
220,
220,
1058,
17143,
16488,
62,
929,
25,
3205,
220,
198,
220,
220,
220,
1058,
4906,
16488,
62,
929,
25,
19720,
13,
38176,
58,
2536,
11,
493,
60,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
1208,
198
] | 2.685185 | 864 |
left = 1
right = 22
p = Solution()
print(p.selfDividingNumbers(left,right)) | [
9464,
796,
352,
198,
3506,
796,
2534,
198,
79,
796,
28186,
3419,
198,
4798,
7,
79,
13,
944,
35,
1699,
278,
49601,
7,
9464,
11,
3506,
4008
] | 2.777778 | 27 |
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from . import models
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
from rest_auth.registration.views import SocialLoginView
| [
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
764,
1330,
4981,
198,
6738,
477,
18439,
13,
14557,
23317,
13,
15234,
4157,
13,
19024,
13,
33571,
1330,
3203,
23621,
1071,
17,
47307,
198,
6738,
1334,
62,
18439,
13,
2301,
33397,
13,
33571,
1330,
5483,
47790,
7680,
198
] | 4.227273 | 66 |
from django.test import TestCase
from rdmsapp.models import Contact
class ContactTests(TestCase):
"""Contact model tests."""
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
374,
67,
907,
1324,
13,
27530,
1330,
14039,
198,
198,
4871,
14039,
51,
3558,
7,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
17829,
2746,
5254,
526,
15931,
198
] | 3.275 | 40 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.